@webority/ui-react 0.7.1 → 0.7.3
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/types/components/ActionIcon.d.ts +2 -2
- package/dist/types/components/AppAsyncBlock.d.ts +32 -0
- package/dist/types/components/AppAutocomplete.d.ts +17 -5
- package/dist/types/components/AppBadge.d.ts +2 -2
- package/dist/types/components/AppButton.d.ts +2 -1
- package/dist/types/components/AppChip.d.ts +1 -1
- package/dist/types/components/AppConfirmDialog.d.ts +4 -1
- package/dist/types/components/AppDropdown.d.ts +2 -1
- package/dist/types/components/AppEmptyState.d.ts +2 -2
- package/dist/types/components/AppInfoList.d.ts +2 -2
- package/dist/types/components/AppInfoTip.d.ts +2 -1
- package/dist/types/components/AppKpiTile.d.ts +6 -3
- package/dist/types/components/AppModal.d.ts +17 -13
- package/dist/types/components/AppScrollbar.d.ts +22 -0
- package/dist/types/components/AppSegmented.d.ts +5 -1
- package/dist/types/components/AppShell.d.ts +43 -10
- package/dist/types/components/AppSpinner.d.ts +15 -3
- package/dist/types/components/AppSplash.d.ts +30 -6
- package/dist/types/components/AppTablePagination.d.ts +5 -1
- package/dist/types/components/AppTabs.d.ts +23 -8
- package/dist/types/components/AppToastContainer.d.ts +13 -0
- package/dist/types/components/Icon.d.ts +15 -1
- package/dist/types/components/normalizeTone.d.ts +1 -0
- package/dist/types/components/renderIconProp.d.ts +9 -0
- package/dist/types/components/toastStore.d.ts +9 -0
- package/dist/types/index.d.ts +4 -1
- package/dist/types/lib/pageWindow.d.ts +10 -0
- package/dist/ui-react.js +2220 -1736
- package/package.json +4 -5
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* unusable with a screen reader, and it doubles as the hover tooltip.
|
|
9
9
|
*
|
|
10
10
|
* @param {object} props
|
|
11
|
-
* @param {string} props.icon glyph name (see Icon)
|
|
11
|
+
* @param {string|import('react').ReactNode} props.icon glyph name (see Icon), or a custom node (e.g. an iconsax glyph)
|
|
12
12
|
* @param {string} props.label accessible name + tooltip
|
|
13
13
|
* @param {boolean} [props.danger] destructive tint
|
|
14
14
|
* @param {boolean} [props.disabled]
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* @param {string} [props.href] sets an anchor without needing `as`.
|
|
20
20
|
*/
|
|
21
21
|
export default function ActionIcon({ icon, label, danger, disabled, size, onClick, className, as, href, ...rest }: {
|
|
22
|
-
icon: string;
|
|
22
|
+
icon: string | import('react').ReactNode;
|
|
23
23
|
label: string;
|
|
24
24
|
danger?: boolean;
|
|
25
25
|
disabled?: boolean;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The loading / error / empty / content switcher every screen that fetches data needs
|
|
3
|
+
* (react.md's "Shared AsyncBlock"). React-only by design: Razor is server-rendered, so a
|
|
4
|
+
* page model already knows whether it has data by the time it renders — there is no
|
|
5
|
+
* client-side loading/error state to switch on, and so no `<app-async-block>` counterpart.
|
|
6
|
+
*
|
|
7
|
+
* Precedence is fixed: `loading` wins over everything, then `error`, then `empty`, then
|
|
8
|
+
* `children`. A fetch that is simultaneously loading and holding a stale error only shows
|
|
9
|
+
* the loading state, which is the least surprising reading of "still in flight".
|
|
10
|
+
*
|
|
11
|
+
* @param {object} props
|
|
12
|
+
* @param {boolean} [props.loading=false] Show the skeleton (or spinner) instead of content.
|
|
13
|
+
* @param {string|import('react').ReactNode} [props.error] An error to show in place of content.
|
|
14
|
+
* Falsy (including `null`/`undefined`) means no error.
|
|
15
|
+
* @param {boolean} [props.empty=false] Show the empty state instead of content — the fetch
|
|
16
|
+
* succeeded with nothing to display.
|
|
17
|
+
* @param {import('react').ReactNode} props.children Real content, shown once loaded,
|
|
18
|
+
* error-free and non-empty.
|
|
19
|
+
* @param {() => void} [props.onRetry] Shown as a Retry button on the error state when set.
|
|
20
|
+
* @param {import('react').ReactNode} [props.skeleton] Loading placeholder shaped like the
|
|
21
|
+
* content. Falls back to a centered `AppSpinner` when omitted.
|
|
22
|
+
* @param {string} [props.className] Extra classes on the wrapper.
|
|
23
|
+
*/
|
|
24
|
+
export default function AppAsyncBlock({ loading, error, empty, children, onRetry, skeleton, className, ...rest }: {
|
|
25
|
+
loading?: boolean;
|
|
26
|
+
error?: string | import('react').ReactNode;
|
|
27
|
+
empty?: boolean;
|
|
28
|
+
children: import('react').ReactNode;
|
|
29
|
+
onRetry?: () => void;
|
|
30
|
+
skeleton?: import('react').ReactNode;
|
|
31
|
+
className?: string;
|
|
32
|
+
}): import("react").JSX.Element;
|
|
@@ -10,14 +10,21 @@ import '@webority/ui-elements';
|
|
|
10
10
|
*
|
|
11
11
|
* @param {object} props
|
|
12
12
|
* @param {string} [props.value] Selected option value.
|
|
13
|
-
* @param {(value: string) => void} [props.onChange]
|
|
13
|
+
* @param {(value: string, meta?: { isCustom: boolean }) => void} [props.onChange] The second
|
|
14
|
+
* argument reports whether the commit was a freeform entry (`allowCustom`) rather than a
|
|
15
|
+
* listed option — existing callers reading only the first argument are unaffected.
|
|
14
16
|
* @param {{value: string, label: string}[]} [props.options] Static options.
|
|
15
|
-
* @param {(query: string) => Promise<{value: string, label: string}[]>} [props.loadOptions]
|
|
17
|
+
* @param {(query: string, opts?: { signal?: AbortSignal }) => Promise<{value: string, label: string}[]>} [props.loadOptions]
|
|
18
|
+
* Remote loader; receives an AbortSignal for the superseded request (optional to use).
|
|
16
19
|
* @param {string} [props.placeholder]
|
|
17
20
|
* @param {number} [props.minChars] Min chars before a remote search fires (default 1 in remote mode).
|
|
18
21
|
* @param {number} [props.debounce] Debounce ms for remote search (default 250).
|
|
19
22
|
* @param {boolean} [props.disabled]
|
|
20
23
|
* @param {'sm'|'lg'} [props.size] Control size around the default.
|
|
24
|
+
* @param {boolean} [props.allowCustom] When the typed text matches no option and the user
|
|
25
|
+
* commits (Enter, or blur with text), offers it as its own selectable "Add "…"" row and,
|
|
26
|
+
* once picked, commits that raw text as the value with `onChange`'s second argument
|
|
27
|
+
* reporting `{ isCustom: true }`.
|
|
21
28
|
* @param {string} [props.name]
|
|
22
29
|
* @param {import('react').ReactNode} [props.label]
|
|
23
30
|
* @param {string} [props.error]
|
|
@@ -25,14 +32,18 @@ import '@webority/ui-elements';
|
|
|
25
32
|
* @param {boolean} [props.required]
|
|
26
33
|
* @param {string} [props.fieldClassName]
|
|
27
34
|
*/
|
|
28
|
-
export default function AppAutocomplete({ value, onChange, options, loadOptions, placeholder, minChars, debounce, disabled, size, name, label, error, hint, required, fieldClassName, ...rest }: {
|
|
35
|
+
export default function AppAutocomplete({ value, onChange, options, loadOptions, placeholder, minChars, debounce, disabled, size, allowCustom, name, label, error, hint, required, fieldClassName, ...rest }: {
|
|
29
36
|
value?: string;
|
|
30
|
-
onChange?: (value: string
|
|
37
|
+
onChange?: (value: string, meta?: {
|
|
38
|
+
isCustom: boolean;
|
|
39
|
+
}) => void;
|
|
31
40
|
options?: {
|
|
32
41
|
value: string;
|
|
33
42
|
label: string;
|
|
34
43
|
}[];
|
|
35
|
-
loadOptions?: (query: string
|
|
44
|
+
loadOptions?: (query: string, opts?: {
|
|
45
|
+
signal?: AbortSignal;
|
|
46
|
+
}) => Promise<{
|
|
36
47
|
value: string;
|
|
37
48
|
label: string;
|
|
38
49
|
}[]>;
|
|
@@ -41,6 +52,7 @@ export default function AppAutocomplete({ value, onChange, options, loadOptions,
|
|
|
41
52
|
debounce?: number;
|
|
42
53
|
disabled?: boolean;
|
|
43
54
|
size?: 'sm' | 'lg';
|
|
55
|
+
allowCustom?: boolean;
|
|
44
56
|
name?: string;
|
|
45
57
|
label?: import('react').ReactNode;
|
|
46
58
|
error?: string;
|
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @param {object} props
|
|
9
9
|
* @param {import('react').ReactNode} props.children
|
|
10
|
-
* @param {"primary"|"success"|"
|
|
10
|
+
* @param {"neutral"|"primary"|"success"|"warning"|"danger"|"info"} [props.tone] Legacy "warn" is aliased to "warning".
|
|
11
11
|
* @param {boolean} [props.dot=false]
|
|
12
12
|
* @param {string} [props.className]
|
|
13
13
|
*/
|
|
14
14
|
export default function AppBadge({ children, tone, dot, className, ...rest }: {
|
|
15
15
|
children: import('react').ReactNode;
|
|
16
|
-
tone?: "primary" | "success" | "
|
|
16
|
+
tone?: "neutral" | "primary" | "success" | "warning" | "danger" | "info";
|
|
17
17
|
dot?: boolean;
|
|
18
18
|
className?: string;
|
|
19
19
|
}): import("react").JSX.Element;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export default function AppButton({ children, variant, size, type, loading, disabled, block, leftIcon, rightIcon, className, ...rest }: {
|
|
1
|
+
export default function AppButton({ children, variant, size, type, loading, disabled, block, leftIcon, rightIcon, href, className, ...rest }: {
|
|
2
2
|
[x: string]: any;
|
|
3
3
|
block?: boolean;
|
|
4
4
|
children: any;
|
|
5
5
|
className?: string;
|
|
6
6
|
disabled?: boolean;
|
|
7
|
+
href: any;
|
|
7
8
|
leftIcon?: any;
|
|
8
9
|
loading?: boolean;
|
|
9
10
|
rightIcon?: any;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* @param {import('react').ReactNode} [props.children]
|
|
15
15
|
* @param {"neutral"|"primary"|"success"|"warning"|"danger"|"info"} [props.tone="neutral"]
|
|
16
16
|
* @param {"sm"|"md"} [props.size="md"]
|
|
17
|
-
* @param {string} [props.leadingIcon]
|
|
17
|
+
* @param {string} [props.leadingIcon] Bootstrap Icons name for a leading glyph.
|
|
18
18
|
* @param {string|import('react').ReactNode} [props.avatar] Leading avatar — an image URL or a node.
|
|
19
19
|
* @param {() => void} [props.onRemove] Present → shows the dismiss ✕.
|
|
20
20
|
* @param {() => void} [props.onClick] Present → the chip body is clickable.
|
|
@@ -17,8 +17,10 @@
|
|
|
17
17
|
* Escape, and onClose while the async action is in flight.
|
|
18
18
|
* @param {boolean} [props.staticBackdrop=false] Forwarded to AppModal — when true, backdrop
|
|
19
19
|
* click and Escape no longer close the dialog (BUG-06649).
|
|
20
|
+
* @param {'center'|'top'} [props.placement='center'] Vertical placement of the card,
|
|
21
|
+
* forwarded to AppModal — centred (default) or pinned near the top.
|
|
20
22
|
*/
|
|
21
|
-
export default function AppConfirmDialog({ open, title, message, confirmLabel, cancelLabel, danger, tone, confirmPhrase, onConfirm, onClose, loading, staticBackdrop, ...rest }: {
|
|
23
|
+
export default function AppConfirmDialog({ open, title, message, confirmLabel, cancelLabel, danger, tone, confirmPhrase, onConfirm, onClose, loading, staticBackdrop, placement, ...rest }: {
|
|
22
24
|
open: boolean;
|
|
23
25
|
title: string;
|
|
24
26
|
message?: import('react').ReactNode;
|
|
@@ -31,4 +33,5 @@ export default function AppConfirmDialog({ open, title, message, confirmLabel, c
|
|
|
31
33
|
onClose: () => void;
|
|
32
34
|
loading?: boolean;
|
|
33
35
|
staticBackdrop?: boolean;
|
|
36
|
+
placement?: 'center' | 'top';
|
|
34
37
|
}): import("react").JSX.Element;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export default function AppDropdown({ icon, iconSize, toggleClassName, label, ariaLabel, align, items, menuClassName, linkComponent, ...rest }: {
|
|
1
|
+
export default function AppDropdown({ icon, iconSize, toggleClassName, label, ariaLabel, align, items, menuClassName, linkComponent, children, ...rest }: {
|
|
2
2
|
[x: string]: any;
|
|
3
3
|
align?: string;
|
|
4
4
|
ariaLabel: any;
|
|
5
|
+
children: any;
|
|
5
6
|
icon: any;
|
|
6
7
|
iconSize: any;
|
|
7
8
|
items?: any[];
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* the tighter widget/tile variant (smaller title + text).
|
|
11
11
|
*
|
|
12
12
|
* @param {object} props
|
|
13
|
-
* @param {string} props.icon
|
|
13
|
+
* @param {string|import('react').ReactNode} props.icon Bootstrap Icons name for the bubble, or a custom node
|
|
14
14
|
* @param {number} [props.iconSize=24]
|
|
15
15
|
* @param {"md"|"sm"} [props.size="md"]
|
|
16
16
|
* @param {import('react').ReactNode} props.title
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* @param {import('react').CSSProperties} [props.style]
|
|
21
21
|
*/
|
|
22
22
|
export default function AppEmptyState({ icon, iconSize, size, title, text, action, className, style, ...rest }: {
|
|
23
|
-
icon: string;
|
|
23
|
+
icon: string | import('react').ReactNode;
|
|
24
24
|
iconSize?: number;
|
|
25
25
|
size?: "md" | "sm";
|
|
26
26
|
title: import('react').ReactNode;
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
* `AppStatusBadge`. This is for stating facts.
|
|
10
10
|
*
|
|
11
11
|
* @param {object} props
|
|
12
|
-
* @param {{ key?: string, icon: string, label: string, value: import('react').ReactNode, href?: string }[]} props.items
|
|
12
|
+
* @param {{ key?: string, icon: string|import('react').ReactNode, label: string, value: import('react').ReactNode, href?: string }[]} props.items
|
|
13
13
|
* @param {string} [props.className]
|
|
14
14
|
*/
|
|
15
15
|
export default function AppInfoList({ items, className, ...rest }: {
|
|
16
16
|
items: {
|
|
17
17
|
key?: string;
|
|
18
|
-
icon: string;
|
|
18
|
+
icon: string | import('react').ReactNode;
|
|
19
19
|
label: string;
|
|
20
20
|
value: import('react').ReactNode;
|
|
21
21
|
href?: string;
|
|
@@ -5,18 +5,21 @@
|
|
|
5
5
|
* @param {object} props
|
|
6
6
|
* @param {string} props.label What the number measures.
|
|
7
7
|
* @param {import('react').ReactNode} props.value The number itself, already formatted.
|
|
8
|
-
* @param {string} [props.icon] Icon name for the leading tile.
|
|
8
|
+
* @param {string|import('react').ReactNode} [props.icon] Icon name for the leading tile, or a custom node.
|
|
9
9
|
* @param {import('react').ReactNode} [props.delta] Change text, e.g. "12% vs last month".
|
|
10
10
|
* @param {'up'|'down'|'flat'} [props.deltaDirection='flat'] Colours the delta and picks its arrow.
|
|
11
|
+
* @param {'plain'|'filled'|'accent'} [props.variant='plain'] The tile surface: plain (today's
|
|
12
|
+
* bordered card), filled (a subtle surface fill), accent (a brand-tinted fill).
|
|
11
13
|
* @param {boolean} [props.inline=false] Put the icon beside the text instead of above it.
|
|
12
14
|
* @param {string} [props.className]
|
|
13
15
|
*/
|
|
14
|
-
export default function AppKpiTile({ label, value, icon, delta, deltaDirection, inline, className, ...rest }: {
|
|
16
|
+
export default function AppKpiTile({ label, value, icon, delta, deltaDirection, variant, inline, className, ...rest }: {
|
|
15
17
|
label: string;
|
|
16
18
|
value: import('react').ReactNode;
|
|
17
|
-
icon?: string;
|
|
19
|
+
icon?: string | import('react').ReactNode;
|
|
18
20
|
delta?: import('react').ReactNode;
|
|
19
21
|
deltaDirection?: 'up' | 'down' | 'flat';
|
|
22
|
+
variant?: 'plain' | 'filled' | 'accent';
|
|
20
23
|
inline?: boolean;
|
|
21
24
|
className?: string;
|
|
22
25
|
}): import("react").JSX.Element;
|
|
@@ -3,34 +3,38 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @param {object} props
|
|
5
5
|
* @param {boolean} props.open
|
|
6
|
+
* @param {import('react').ReactNode} [props.eyebrow] A small kicker label above the title.
|
|
6
7
|
* @param {import('react').ReactNode} [props.title]
|
|
7
8
|
* @param {import('react').ReactNode} [props.subtitle]
|
|
8
|
-
* @param {string} [props.headerIcon]
|
|
9
|
+
* @param {string} [props.headerIcon] Bootstrap Icons name
|
|
10
|
+
* @param {'default'|'danger'|'success'|'warning'} [props.tone='default'] Tints the header icon
|
|
11
|
+
* and eyebrow to signal intent — a destructive or a success dialog reads it from the header.
|
|
12
|
+
* @param {boolean} [props.dismissible=true] Show the header close (×) button. Pair with
|
|
13
|
+
* `staticBackdrop` for a forced-choice dialog with no way out but an explicit action.
|
|
9
14
|
* @param {() => void} props.onClose
|
|
10
15
|
* @param {import('react').ReactNode} [props.footer]
|
|
11
|
-
* @param {
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* @param {boolean} [props.side=false]
|
|
16
|
-
* @param {number|string} [props.maxWidth]
|
|
16
|
+
* @param {'sm'|'md'|'lg'|'xl'|number} [props.size='md'] Card width — a preset, or an exact
|
|
17
|
+
* max-width in px for a custom size.
|
|
18
|
+
* @param {'center'|'top'} [props.placement='center'] Vertical placement of the card —
|
|
19
|
+
* centred (default) or pinned near the top of the viewport.
|
|
17
20
|
* @param {boolean} [props.hideHeader=false]
|
|
18
21
|
* @param {boolean} [props.staticBackdrop=false] When true, the backdrop click and Escape
|
|
19
22
|
* key no longer close the dialog — only an explicit close action can (BUG-06649).
|
|
20
|
-
* @param {string} [props.className]
|
|
23
|
+
* @param {string} [props.className] Extra classes on the modal card.
|
|
21
24
|
* @param {import('react').ReactNode} props.children
|
|
22
25
|
*/
|
|
23
|
-
export default function AppModal({ open, title, subtitle, headerIcon,
|
|
26
|
+
export default function AppModal({ open, eyebrow, title, subtitle, headerIcon, tone, dismissible, onClose, footer, size, placement, hideHeader, staticBackdrop, className, children, ...rest }: {
|
|
24
27
|
open: boolean;
|
|
28
|
+
eyebrow?: import('react').ReactNode;
|
|
25
29
|
title?: import('react').ReactNode;
|
|
26
30
|
subtitle?: import('react').ReactNode;
|
|
27
31
|
headerIcon?: string;
|
|
32
|
+
tone?: 'default' | 'danger' | 'success' | 'warning';
|
|
33
|
+
dismissible?: boolean;
|
|
28
34
|
onClose: () => void;
|
|
29
35
|
footer?: import('react').ReactNode;
|
|
30
|
-
size?:
|
|
31
|
-
|
|
32
|
-
side?: boolean;
|
|
33
|
-
maxWidth?: number | string;
|
|
36
|
+
size?: 'sm' | 'md' | 'lg' | 'xl' | number;
|
|
37
|
+
placement?: 'center' | 'top';
|
|
34
38
|
hideHeader?: boolean;
|
|
35
39
|
staticBackdrop?: boolean;
|
|
36
40
|
className?: string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A scroll container with a thin, themed scrollbar in place of the browser's default chunky one.
|
|
3
|
+
* Pure CSS — native scrolling, keyboard navigation and in-page anchoring are untouched; only the
|
|
4
|
+
* visible track is restyled, via the `.wui-scroll` rules in `@webority/theme`. No JavaScript and
|
|
5
|
+
* no dependency: the thin overlay look comes from native `scrollbar-width` / `::-webkit-scrollbar`.
|
|
6
|
+
*
|
|
7
|
+
* React-only by design so far: a Razor `<app-scrollbar>` would just apply the same `.wui-scroll`
|
|
8
|
+
* class, so this is "not ported yet", not "cannot be ported".
|
|
9
|
+
*
|
|
10
|
+
* @param {object} props
|
|
11
|
+
* @param {import('react').ReactNode} props.children The scrollable content.
|
|
12
|
+
* @param {string} [props.className] Extra classes on the scroll container.
|
|
13
|
+
* @param {number|string} [props.maxHeight] Caps the container height so content overflows and
|
|
14
|
+
* scrolls. A number is treated as pixels.
|
|
15
|
+
* @param {object} [props.style] Extra inline styles, merged with maxHeight.
|
|
16
|
+
*/
|
|
17
|
+
export default function AppScrollbar({ children, className, maxHeight, style, ...rest }: {
|
|
18
|
+
children: import('react').ReactNode;
|
|
19
|
+
className?: string;
|
|
20
|
+
maxHeight?: number | string;
|
|
21
|
+
style?: object;
|
|
22
|
+
}): import("react").JSX.Element;
|
|
@@ -12,7 +12,10 @@
|
|
|
12
12
|
* posts inside a plain form with no JavaScript.
|
|
13
13
|
*
|
|
14
14
|
* @param {object} props
|
|
15
|
-
* @param {{ value: string, label: string, icon?: string, disabled?: boolean }[]} props.options
|
|
15
|
+
* @param {{ value: string, label: string, note?: string, icon?: string, disabled?: boolean }[]} props.options
|
|
16
|
+
* `note` renders as a smaller, muted sub-line under the label — a supporting detail
|
|
17
|
+
* ("Last 7 days") without shrinking the label itself. Optional; segments without one are
|
|
18
|
+
* unaffected.
|
|
16
19
|
* @param {string} props.value The selected option's value.
|
|
17
20
|
* @param {(value: string) => void} props.onChange
|
|
18
21
|
* @param {string} props.label Accessible name for the group.
|
|
@@ -26,6 +29,7 @@ export default function AppSegmented({ options, value, onChange, label, name, si
|
|
|
26
29
|
options: {
|
|
27
30
|
value: string;
|
|
28
31
|
label: string;
|
|
32
|
+
note?: string;
|
|
29
33
|
icon?: string;
|
|
30
34
|
disabled?: boolean;
|
|
31
35
|
}[];
|
|
@@ -1,3 +1,44 @@
|
|
|
1
|
+
export type NavItemShape = {
|
|
2
|
+
key?: string;
|
|
3
|
+
label: string;
|
|
4
|
+
/**
|
|
5
|
+
* Bootstrap Icons name for the row's leading glyph.
|
|
6
|
+
*/
|
|
7
|
+
icon?: string;
|
|
8
|
+
href: string;
|
|
9
|
+
/**
|
|
10
|
+
* A count or short status at the row's end.
|
|
11
|
+
*/
|
|
12
|
+
badge?: import('react').ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Tints the badge for an alert count.
|
|
15
|
+
*/
|
|
16
|
+
badgeTone?: 'danger' | 'success' | 'warning';
|
|
17
|
+
/**
|
|
18
|
+
* A right-aligned secondary glyph (lock, external arrow, new dot).
|
|
19
|
+
*/
|
|
20
|
+
trailingIcon?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The current page — takes the brand tint + aria-current.
|
|
23
|
+
*/
|
|
24
|
+
active?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Sub-items — the row becomes an expandable parent.
|
|
27
|
+
*/
|
|
28
|
+
children?: NavItemShape[];
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* @typedef {object} NavItemShape
|
|
32
|
+
* @property {string} [key]
|
|
33
|
+
* @property {string} label
|
|
34
|
+
* @property {string} [icon] Bootstrap Icons name for the row's leading glyph.
|
|
35
|
+
* @property {string} href
|
|
36
|
+
* @property {import('react').ReactNode} [badge] A count or short status at the row's end.
|
|
37
|
+
* @property {'danger'|'success'|'warning'} [badgeTone] Tints the badge for an alert count.
|
|
38
|
+
* @property {string} [trailingIcon] A right-aligned secondary glyph (lock, external arrow, new dot).
|
|
39
|
+
* @property {boolean} [active] The current page — takes the brand tint + aria-current.
|
|
40
|
+
* @property {NavItemShape[]} [children] Sub-items — the row becomes an expandable parent.
|
|
41
|
+
*/
|
|
1
42
|
/**
|
|
2
43
|
* The persistent frame every authenticated portal sits inside — a sidebar of
|
|
3
44
|
* navigation, a sticky topbar, the routed content, and an optional footer.
|
|
@@ -11,8 +52,7 @@
|
|
|
11
52
|
* `to`; without it they render as plain `<a href>`, which is what Razor emits.
|
|
12
53
|
*
|
|
13
54
|
* @param {object} props
|
|
14
|
-
* @param {{ label?: string, items:
|
|
15
|
-
* badge?: import('react').ReactNode, active?: boolean }[] }[]} props.groups Nav groups, in order.
|
|
55
|
+
* @param {{ label?: string, items: NavItemShape[] }[]} props.groups Nav groups, in order.
|
|
16
56
|
* Groups after the first are separated by a rule.
|
|
17
57
|
* @param {import('react').ReactNode} [props.brand] The logo row at the top of the sidebar.
|
|
18
58
|
* @param {import('react').ReactNode} [props.sidebarFooter] Pinned below the scrolling nav.
|
|
@@ -29,14 +69,7 @@
|
|
|
29
69
|
export default function AppShell({ groups, brand, sidebarFooter, topbarStart, topbarEnd, footer, children, collapsed, onCollapsedChange, noSidebar, navLabel, linkComponent: Link, className, ...rest }: {
|
|
30
70
|
groups: {
|
|
31
71
|
label?: string;
|
|
32
|
-
items:
|
|
33
|
-
key?: string;
|
|
34
|
-
label: string;
|
|
35
|
-
icon?: string;
|
|
36
|
-
href: string;
|
|
37
|
-
badge?: import('react').ReactNode;
|
|
38
|
-
active?: boolean;
|
|
39
|
-
}[];
|
|
72
|
+
items: NavItemShape[];
|
|
40
73
|
}[];
|
|
41
74
|
brand?: import('react').ReactNode;
|
|
42
75
|
sidebarFooter?: import('react').ReactNode;
|
|
@@ -1,6 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A themed loading spinner — Bootstrap's `.spinner-border`, tinted by the theme.
|
|
3
|
+
* The React counterpart of `<app-spinner>`.
|
|
4
|
+
*
|
|
5
|
+
* For a whole section that is loading, prefer `AppSkeleton` — a content-shaped
|
|
6
|
+
* placeholder reads better than a spinner above the fold.
|
|
7
|
+
*
|
|
8
|
+
* @param {object} props
|
|
9
|
+
* @param {'sm'|'md'|number} [props.size='md'] A preset, or an exact diameter in px — pass any
|
|
10
|
+
* positive number so the spinner matches whatever it sits in; the border scales with it.
|
|
11
|
+
* @param {string} [props.label='Loading'] Accessible name.
|
|
12
|
+
* @param {string} [props.className]
|
|
13
|
+
*/
|
|
1
14
|
export default function AppSpinner({ size, label, className, ...rest }: {
|
|
2
|
-
|
|
3
|
-
className?: string;
|
|
15
|
+
size?: 'sm' | 'md' | number;
|
|
4
16
|
label?: string;
|
|
5
|
-
|
|
17
|
+
className?: string;
|
|
6
18
|
}): import("react").JSX.Element;
|
|
@@ -1,8 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The full-viewport boot screen shown while the app resolves its session, before
|
|
3
|
+
* the first route can render — the thing `ApplicationNavigator` returns while
|
|
4
|
+
* `authStatus` is still unresolved.
|
|
5
|
+
*
|
|
6
|
+
* Without it the app flashes the login screen at an already-authenticated user for
|
|
7
|
+
* the length of one session check.
|
|
8
|
+
*
|
|
9
|
+
* The indicator is indeterminate, not a progress value: boot has no measurable
|
|
10
|
+
* percentage, and something that appears to measure one would be lying. Pick its
|
|
11
|
+
* style with `variant` (a sweeping bar, a spinning ring, or bouncing dots).
|
|
12
|
+
*
|
|
13
|
+
* @param {object} props
|
|
14
|
+
* @param {import('react').ReactNode} [props.logo] Brand mark — an `<img>` or an SVG.
|
|
15
|
+
* @param {string} [props.initials] Fallback mark when there is no logo.
|
|
16
|
+
* @param {string} [props.text] One line, e.g. "Signing you in…".
|
|
17
|
+
* @param {string} [props.subtext] A quieter second line under the text.
|
|
18
|
+
* @param {'bar'|'ring'|'dots'} [props.variant='bar'] The indeterminate boot indicator.
|
|
19
|
+
* @param {'sm'|'md'|'lg'|number} [props.size='md'] Mark size — a preset or an exact px diameter.
|
|
20
|
+
* @param {string} [props.label='Loading'] Accessible name for the live region.
|
|
21
|
+
* @param {string} [props.className]
|
|
22
|
+
*/
|
|
23
|
+
export default function AppSplash({ logo, initials, text, subtext, variant, size, label, className, ...rest }: {
|
|
24
|
+
logo?: import('react').ReactNode;
|
|
25
|
+
initials?: string;
|
|
26
|
+
text?: string;
|
|
27
|
+
subtext?: string;
|
|
28
|
+
variant?: 'bar' | 'ring' | 'dots';
|
|
29
|
+
size?: 'sm' | 'md' | 'lg' | number;
|
|
5
30
|
label?: string;
|
|
6
|
-
|
|
7
|
-
text: any;
|
|
31
|
+
className?: string;
|
|
8
32
|
}): import("react").JSX.Element;
|
|
@@ -17,8 +17,11 @@
|
|
|
17
17
|
* @param {(page: number) => void} props.onPageChange
|
|
18
18
|
* @param {(size: number) => void} props.onPageSizeChange
|
|
19
19
|
* @param {number[]} [props.pageSizes]
|
|
20
|
+
* @param {'prev-next'|'numbered'} [props.mode='prev-next'] prev-next (default) is the arrows-
|
|
21
|
+
* only nav above. numbered inserts windowed page buttons — first/last plus an ellipsis over
|
|
22
|
+
* any run of hidden pages — between the arrows.
|
|
20
23
|
*/
|
|
21
|
-
export default function AppTablePagination({ page, totalPages, pageSize, total, firstRow, lastRow, onPageChange, onPageSizeChange, pageSizes, ...rest }: {
|
|
24
|
+
export default function AppTablePagination({ page, totalPages, pageSize, total, firstRow, lastRow, onPageChange, onPageSizeChange, pageSizes, mode, ...rest }: {
|
|
22
25
|
page: number;
|
|
23
26
|
totalPages: number;
|
|
24
27
|
pageSize: number;
|
|
@@ -28,4 +31,5 @@ export default function AppTablePagination({ page, totalPages, pageSize, total,
|
|
|
28
31
|
onPageChange: (page: number) => void;
|
|
29
32
|
onPageSizeChange: (size: number) => void;
|
|
30
33
|
pageSizes?: number[];
|
|
34
|
+
mode?: 'prev-next' | 'numbered';
|
|
31
35
|
}): import("react").JSX.Element;
|
|
@@ -1,22 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Shared tab strip (.app-tabs).
|
|
2
|
+
* Shared tab strip (.app-tabs). A controlled component: the caller owns `value` +
|
|
3
|
+
* `onChange` and renders the panels. Razor's <app-tabs> renders the same strip markup
|
|
4
|
+
* (plus Bootstrap panels), so both surfaces look and behave alike.
|
|
3
5
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
6
|
+
* The active state is a sliding "ink bar" (`.app-tab-indicator`) — one element that is
|
|
7
|
+
* JS-measured against the active tab and animates between tabs with an elastic overshoot
|
|
8
|
+
* (`--wui-ease-elastic`). It becomes a moving pill in the `pills` variant and a moving
|
|
9
|
+
* left edge when `orientation="vertical"`, and it snaps (no slide) under
|
|
10
|
+
* `prefers-reduced-motion`.
|
|
11
|
+
*
|
|
12
|
+
* Keyboard (WAI-ARIA tablist): Arrow (Left/Right, or Up/Down when vertical) / Home / End
|
|
13
|
+
* roam the strip skipping disabled tabs. `activation="automatic"` (default) selects as
|
|
14
|
+
* focus moves; `activation="manual"` moves focus only and selects on Enter/Space.
|
|
7
15
|
*
|
|
8
16
|
* @param {object} props
|
|
9
17
|
* @param {{ key: string, label: import('react').ReactNode, count?: number, tone?: string, icon?: import('react').ReactNode, danger?: boolean, disabled?: boolean }[]} props.tabs
|
|
10
|
-
* @param {string} props.value
|
|
18
|
+
* @param {string} props.value Selected tab key.
|
|
11
19
|
* @param {(key: string) => void} props.onChange
|
|
12
20
|
* @param {"underline"|"pills"} [props.variant="underline"]
|
|
21
|
+
* @param {"horizontal"|"vertical"} [props.orientation="horizontal"] Vertical renders a side rail.
|
|
22
|
+
* @param {"sm"|"md"|"lg"} [props.size="md"]
|
|
23
|
+
* @param {boolean} [props.fitted=false] Tabs share the width equally instead of scrolling.
|
|
24
|
+
* @param {"automatic"|"manual"} [props.activation="automatic"] Whether arrow keys also select.
|
|
13
25
|
* @param {string} [props.ariaLabel]
|
|
14
26
|
* @param {string} [props.className]
|
|
15
27
|
* @param {import('react').CSSProperties} [props.style]
|
|
16
|
-
* @param {"success"|"warning"|"danger"|"info"} [props.tone]
|
|
17
|
-
* pill — set per-tab as `tabs[].tone`, matching the vocabulary `.status-label` uses.
|
|
28
|
+
* @param {"success"|"warning"|"danger"|"info"} [props.tone] Per-tab count-pill tint (set as `tabs[].tone`).
|
|
18
29
|
*/
|
|
19
|
-
export default function AppTabs({ tabs, value, onChange, variant, ariaLabel, className, style, ...rest }: {
|
|
30
|
+
export default function AppTabs({ tabs, value, onChange, variant, orientation, size, fitted, activation, ariaLabel, className, style, ...rest }: {
|
|
20
31
|
tabs: {
|
|
21
32
|
key: string;
|
|
22
33
|
label: import('react').ReactNode;
|
|
@@ -29,6 +40,10 @@ export default function AppTabs({ tabs, value, onChange, variant, ariaLabel, cla
|
|
|
29
40
|
value: string;
|
|
30
41
|
onChange: (key: string) => void;
|
|
31
42
|
variant?: "underline" | "pills";
|
|
43
|
+
orientation?: "horizontal" | "vertical";
|
|
44
|
+
size?: "sm" | "md" | "lg";
|
|
45
|
+
fitted?: boolean;
|
|
46
|
+
activation?: "automatic" | "manual";
|
|
32
47
|
ariaLabel?: string;
|
|
33
48
|
className?: string;
|
|
34
49
|
style?: import('react').CSSProperties;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mounts once near the app root and renders whatever toast()/errorToast() raise. Everything —
|
|
3
|
+
* auto-dismiss, the ARIA live region, the slide/fade — comes from react-bootstrap's Toast, so
|
|
4
|
+
* there is no toast library and no bespoke stylesheet; the look is Bootstrap + the shared theme.
|
|
5
|
+
*
|
|
6
|
+
* @param {object} props
|
|
7
|
+
* @param {'top-start'|'top-center'|'top-end'|'middle-center'|'bottom-start'|'bottom-center'|'bottom-end'} [props.position='bottom-end']
|
|
8
|
+
* @param {number} [props.autoDismiss=5000] Milliseconds a toast stays before it fades itself out.
|
|
9
|
+
*/
|
|
10
|
+
export default function AppToastContainer({ position, autoDismiss }: {
|
|
11
|
+
position?: 'top-start' | 'top-center' | 'top-end' | 'middle-center' | 'bottom-start' | 'bottom-center' | 'bottom-end';
|
|
12
|
+
autoDismiss?: number;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
export declare const iconNames: string[];
|
|
2
|
+
/**
|
|
3
|
+
* Register product-specific glyphs — call once at app init, before first render. Each value is a
|
|
4
|
+
* render function `({ size, color, className, style }) => ReactNode` that returns your own glyph
|
|
5
|
+
* (e.g. an iconsax Bulk component) applied to those props. A registered name wins over the
|
|
6
|
+
* built-in Bootstrap-Icon map; every unregistered name still resolves to Bootstrap Icons.
|
|
7
|
+
*
|
|
8
|
+
* @param {Record<string, (props: { size: number, color?: string, className?: string, style?: object }) => import('react').ReactNode>} map
|
|
9
|
+
*/
|
|
10
|
+
export declare function registerIcons(map: Record<string, (props: {
|
|
11
|
+
size: number;
|
|
12
|
+
color?: string;
|
|
13
|
+
className?: string;
|
|
14
|
+
style?: object;
|
|
15
|
+
}) => import('react').ReactNode>): void;
|
|
2
16
|
export default function Icon({ name, size, className, color, style, ...rest }: {
|
|
3
17
|
[x: string]: any;
|
|
4
18
|
className: any;
|
|
@@ -6,4 +20,4 @@ export default function Icon({ name, size, className, color, style, ...rest }: {
|
|
|
6
20
|
name: any;
|
|
7
21
|
size?: number;
|
|
8
22
|
style: any;
|
|
9
|
-
}):
|
|
23
|
+
}): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function normalizeTone(tone: any): any;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {string | import('react').ReactNode} icon A Bootstrap-Icons name, or a node rendered as-is.
|
|
3
|
+
* @param {{ size?: number, className?: string }} [options]
|
|
4
|
+
* @returns {import('react').ReactNode | null}
|
|
5
|
+
*/
|
|
6
|
+
export default function renderIconProp(icon: string | import('react').ReactNode, { size, className }?: {
|
|
7
|
+
size?: number;
|
|
8
|
+
className?: string;
|
|
9
|
+
}): import('react').ReactNode | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Subscribe to the active-toast list. Calls back immediately, and returns an unsubscribe fn. */
|
|
2
|
+
export declare function subscribeToasts(listener: any): () => boolean;
|
|
3
|
+
/**
|
|
4
|
+
* Raise a toast. De-duped by `variant:message` while one is still on screen, so a burst of the
|
|
5
|
+
* same failure (many in-flight requests, a retry) shows once instead of stacking copies.
|
|
6
|
+
*/
|
|
7
|
+
export declare function pushToast(message: any, variant: any): void;
|
|
8
|
+
/** Remove a toast — its auto-dismiss timer fired, or the user closed it. */
|
|
9
|
+
export declare function dismissToast(id: any): void;
|