@webority/ui-react 0.6.13 → 0.7.1
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/AppCheckbox.d.ts +2 -0
- package/dist/types/components/AppConfirmDialog.d.ts +8 -1
- package/dist/types/components/AppDataTable.d.ts +2 -2
- package/dist/types/components/AppFileAttachment.d.ts +19 -11
- package/dist/types/components/AppFilePicker.d.ts +23 -8
- package/dist/types/components/AppLogoPicker.d.ts +19 -22
- package/dist/types/components/AppModal.d.ts +5 -2
- package/dist/types/components/AppRadio.d.ts +2 -0
- package/dist/types/components/AppSelect.d.ts +4 -1
- package/dist/types/components/AppSidebarMenu.d.ts +2 -1
- package/dist/types/components/AppSwitch.d.ts +2 -0
- package/dist/types/components/AppTabs.d.ts +8 -2
- package/dist/types/index.d.ts +1 -0
- package/dist/ui-react.js +1268 -872
- package/package.json +14 -5
- package/dist/types/lib/useListboxMenu.d.ts +0 -46
- package/dist/types/lib/usePopover.d.ts +0 -7
- package/dist/types/lib/useTableSort.d.ts +0 -25
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
* @param {import('react').ReactNode} [props.label]
|
|
11
11
|
* @param {string} [props.id]
|
|
12
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.
|
|
13
15
|
* @param {string} [props.className]
|
|
14
16
|
* @param {import('react').Ref} [ref]
|
|
15
17
|
*/
|
|
@@ -12,8 +12,13 @@
|
|
|
12
12
|
* @param {() => void} props.onConfirm
|
|
13
13
|
* @param {string} [props.cancelLabel="Cancel"]
|
|
14
14
|
* @param {() => void} props.onClose
|
|
15
|
+
* @param {boolean} [props.loading=false] Busy state — shows a spinner and disables Confirm,
|
|
16
|
+
* disables Cancel and the confirm-phrase field, and blocks dismissal via the backdrop,
|
|
17
|
+
* Escape, and onClose while the async action is in flight.
|
|
18
|
+
* @param {boolean} [props.staticBackdrop=false] Forwarded to AppModal — when true, backdrop
|
|
19
|
+
* click and Escape no longer close the dialog (BUG-06649).
|
|
15
20
|
*/
|
|
16
|
-
export default function AppConfirmDialog({ open, title, message, confirmLabel, cancelLabel, danger, tone, confirmPhrase, onConfirm, onClose, ...rest }: {
|
|
21
|
+
export default function AppConfirmDialog({ open, title, message, confirmLabel, cancelLabel, danger, tone, confirmPhrase, onConfirm, onClose, loading, staticBackdrop, ...rest }: {
|
|
17
22
|
open: boolean;
|
|
18
23
|
title: string;
|
|
19
24
|
message?: import('react').ReactNode;
|
|
@@ -24,4 +29,6 @@ export default function AppConfirmDialog({ open, title, message, confirmLabel, c
|
|
|
24
29
|
onConfirm: () => void;
|
|
25
30
|
cancelLabel?: string;
|
|
26
31
|
onClose: () => void;
|
|
32
|
+
loading?: boolean;
|
|
33
|
+
staticBackdrop?: boolean;
|
|
27
34
|
}): import("react").JSX.Element;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @param {object} props
|
|
5
5
|
* @param {object[]} props.columns
|
|
6
6
|
* @param {object[]} props.rows
|
|
7
|
-
* @param {(row: object) => string|number} [props.rowKey]
|
|
7
|
+
* @param {(row: object, index: number) => string|number} [props.rowKey]
|
|
8
8
|
* @param {{ key: string, dir: "asc"|"desc" }} [props.sort]
|
|
9
9
|
* @param {(key: string) => void} [props.onSort]
|
|
10
10
|
* @param {boolean} [props.loading=false]
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
export default function AppDataTable({ columns, rows, rowKey, sort, onSort, loading, skeletonRows, empty, emptyFiltered, sourceCount, rowActions, rowActionsLabel, pagination, ariaLabel, className, selectable, selectedIds, onToggleRow, onToggleAll, ...rest }: {
|
|
26
26
|
columns: object[];
|
|
27
27
|
rows: object[];
|
|
28
|
-
rowKey?: (row: object) => string | number;
|
|
28
|
+
rowKey?: (row: object, index: number) => string | number;
|
|
29
29
|
sort?: {
|
|
30
30
|
key: string;
|
|
31
31
|
dir: "asc" | "desc";
|
|
@@ -1,33 +1,41 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Compact
|
|
3
|
-
* once a file is chosen (× to remove). Self-manages the
|
|
4
|
-
* type + size, reporting the choice via onChange
|
|
2
|
+
* Compact attachment field — a browse row that swaps to a preview (image thumbnail or a
|
|
3
|
+
* file-type icon) plus filename/size once a file is chosen (× to remove). Self-manages the
|
|
4
|
+
* preview object URL and validates type + size, reporting the choice via onChange.
|
|
5
|
+
*
|
|
6
|
+
* Handles both images and any other file type (PDF, doc, zip) — narrow it with `accept`.
|
|
7
|
+
* With `multiple`, several files stack in a list and each removes on its own; `value` is then
|
|
8
|
+
* an array and `onChange` receives the updated array.
|
|
5
9
|
*
|
|
6
10
|
* Distinct from AppFilePicker (a tall visual image dropzone): this is for attaching a file
|
|
7
11
|
* to something (a ticket, a message) where the file's name/size matters more than a big preview.
|
|
8
12
|
*
|
|
9
13
|
* @param {object} props
|
|
10
14
|
* @param {string} [props.label="Attachment"]
|
|
11
|
-
* @param {File|{ url: string, name?: string }|null} [props.value]
|
|
15
|
+
* @param {File|{ url: string, name?: string }|Array<File|{ url: string, name?: string }>|null} [props.value]
|
|
12
16
|
* @param {string} [props.name] Form field name, so an uncontrolled form can post the file.
|
|
13
|
-
* @param {(file: File|null) => void} props.onChange
|
|
14
|
-
* @param {
|
|
17
|
+
* @param {(file: File|null) => void | (files: File[]) => void} props.onChange single-mode → File|null; multiple → File[]
|
|
18
|
+
* @param {boolean} [props.multiple=false]
|
|
19
|
+
* @param {string} [props.accept] Defaults to images; pass e.g. "image/*,application/pdf" for mixed.
|
|
15
20
|
* @param {number} [props.maxSizeMb=5]
|
|
16
21
|
* @param {boolean} [props.optional=false]
|
|
17
22
|
* @param {string} [props.error]
|
|
18
23
|
* @param {string} [props.id]
|
|
19
24
|
*/
|
|
20
|
-
export default function AppFileAttachment({ label, value, // File | { url, name } | null
|
|
21
|
-
name, onChange, //
|
|
22
|
-
accept, maxSizeMb, optional, error, // external error, shown alongside internal validation errors
|
|
25
|
+
export default function AppFileAttachment({ label, value, // File | { url, name } | array | null
|
|
26
|
+
name, onChange, multiple, accept, maxSizeMb, optional, error, // external error, shown alongside internal validation errors
|
|
23
27
|
id, ...rest }: {
|
|
24
28
|
label?: string;
|
|
25
29
|
value?: File | {
|
|
26
30
|
url: string;
|
|
27
31
|
name?: string;
|
|
28
|
-
} |
|
|
32
|
+
} | Array<File | {
|
|
33
|
+
url: string;
|
|
34
|
+
name?: string;
|
|
35
|
+
}> | null;
|
|
29
36
|
name?: string;
|
|
30
|
-
onChange: (file: File | null) => void;
|
|
37
|
+
onChange: (file: File | null) => void | ((files: File[]) => void);
|
|
38
|
+
multiple?: boolean;
|
|
31
39
|
accept?: string;
|
|
32
40
|
maxSizeMb?: number;
|
|
33
41
|
optional?: boolean;
|
|
@@ -1,27 +1,42 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* is chosen (hover to change, × to remove).
|
|
4
|
-
*
|
|
2
|
+
* File picker — a drag-and-drop dropzone. In single mode it swaps to a large preview once a
|
|
3
|
+
* file is chosen (hover to change, × to remove). With `multiple`, the dropzone stays put and
|
|
4
|
+
* picked files stack in a list inside it, below the prompt (image thumbnail or file-type icon +
|
|
5
|
+
* name/size, each removable). Accepts freshly-picked Files or existing `{ url, name }` values; reports the
|
|
6
|
+
* choice via onPick — a File|null in single mode, a File[] in multiple mode.
|
|
7
|
+
*
|
|
8
|
+
* Not just images: widen `accept` (e.g. "image/*,application/pdf") and non-image files show a
|
|
9
|
+
* file-type icon instead of a thumbnail.
|
|
5
10
|
*
|
|
6
11
|
* @param {object} props
|
|
7
12
|
* @param {string} props.label
|
|
8
|
-
* @param {File|{ url: string }|null} [props.value]
|
|
13
|
+
* @param {File|{ url: string, name?: string }|Array<File|{ url: string, name?: string }>|null} [props.value]
|
|
9
14
|
* @param {string} [props.name] Form field name; also the input id the label points at.
|
|
10
|
-
* @param {(file: File|null) => void} props.onPick
|
|
15
|
+
* @param {(file: File|null) => void | (files: File[]) => void} props.onPick single → File|null; multiple → File[]
|
|
16
|
+
* @param {boolean} [props.multiple=false]
|
|
17
|
+
* @param {number} [props.maxFiles] Cap on total files in multiple mode.
|
|
11
18
|
* @param {string} [props.accept=".jpg,.jpeg,.png"] Accepted file types (the `accept` attribute).
|
|
12
19
|
* @param {number} [props.maxSizeMb=5]
|
|
13
20
|
* @param {boolean} [props.required]
|
|
14
21
|
* @param {string} [props.error]
|
|
22
|
+
* @param {string} [props.className] Extra class on the field wrapper — e.g. a `file-w-*` width preset.
|
|
15
23
|
*/
|
|
16
|
-
export default function AppFilePicker({ label, value, name, onPick, accept, maxSizeMb, required, error, ...rest }: {
|
|
24
|
+
export default function AppFilePicker({ label, value, name, onPick, multiple, maxFiles, accept, maxSizeMb, required, error, className, ...rest }: {
|
|
17
25
|
label: string;
|
|
18
26
|
value?: File | {
|
|
19
27
|
url: string;
|
|
20
|
-
|
|
28
|
+
name?: string;
|
|
29
|
+
} | Array<File | {
|
|
30
|
+
url: string;
|
|
31
|
+
name?: string;
|
|
32
|
+
}> | null;
|
|
21
33
|
name?: string;
|
|
22
|
-
onPick: (file: File | null) => void;
|
|
34
|
+
onPick: (file: File | null) => void | ((files: File[]) => void);
|
|
35
|
+
multiple?: boolean;
|
|
36
|
+
maxFiles?: number;
|
|
23
37
|
accept?: string;
|
|
24
38
|
maxSizeMb?: number;
|
|
25
39
|
required?: boolean;
|
|
26
40
|
error?: string;
|
|
41
|
+
className?: string;
|
|
27
42
|
}): import("react").JSX.Element;
|
|
@@ -1,31 +1,28 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Circular logo/avatar picker with update overlay.
|
|
3
|
-
*
|
|
4
|
-
* @param {object} props
|
|
5
|
-
* @param {string|null} [props.value]
|
|
6
|
-
* @param {import('react').ReactNode} [props.fallback]
|
|
7
|
-
* @param {string} [props.name] Form field name, so an uncontrolled form can post the file.
|
|
8
|
-
* @param {(file: File) => void} props.onPick
|
|
9
|
-
* @param {boolean} [props.loading=false]
|
|
10
|
-
* @param {string} [props.accept]
|
|
11
|
-
* @param {number} [props.maxSizeMb=5]
|
|
12
|
-
* @param {string} [props.overlayIcon]
|
|
13
|
-
* @param {string} [props.overlayLabel]
|
|
14
|
-
* @param {string} [props.ariaLabel]
|
|
15
|
-
*/
|
|
16
1
|
export default function AppLogoPicker({ value, // current image URL | null
|
|
17
2
|
fallback, // node shown when there's no image (e.g. initials)
|
|
18
3
|
name, onPick, // (file) => void — receives a validated File
|
|
4
|
+
onRemove, // () => void — clears the current logo
|
|
19
5
|
loading, // show a spinner + block interaction while the pick is uploading
|
|
20
|
-
accept, maxSizeMb, overlayIcon, overlayLabel, ariaLabel, ...rest }: {
|
|
21
|
-
|
|
22
|
-
fallback?: import('react').ReactNode;
|
|
23
|
-
name?: string;
|
|
24
|
-
onPick: (file: File) => void;
|
|
25
|
-
loading?: boolean;
|
|
6
|
+
disabled, accept, maxSizeMb, overlayIcon, overlayLabel, ariaLabel, label, hint, error, required, variant, size, shape, className, ...rest }: {
|
|
7
|
+
[x: string]: any;
|
|
26
8
|
accept?: string;
|
|
9
|
+
ariaLabel?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
error: any;
|
|
13
|
+
fallback: any;
|
|
14
|
+
hint: any;
|
|
15
|
+
label: any;
|
|
16
|
+
loading?: boolean;
|
|
27
17
|
maxSizeMb?: number;
|
|
18
|
+
name: any;
|
|
19
|
+
onPick: any;
|
|
20
|
+
onRemove: any;
|
|
28
21
|
overlayIcon?: string;
|
|
29
22
|
overlayLabel?: string;
|
|
30
|
-
|
|
23
|
+
required?: boolean;
|
|
24
|
+
shape?: string;
|
|
25
|
+
size?: string;
|
|
26
|
+
value: any;
|
|
27
|
+
variant?: string;
|
|
31
28
|
}): import("react").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The single dialog primitive. Wraps react-bootstrap Modal with `.
|
|
2
|
+
* The single dialog primitive. Wraps react-bootstrap Modal with `.wui-modal-*` chrome.
|
|
3
3
|
*
|
|
4
4
|
* @param {object} props
|
|
5
5
|
* @param {boolean} props.open
|
|
@@ -15,10 +15,12 @@
|
|
|
15
15
|
* @param {boolean} [props.side=false]
|
|
16
16
|
* @param {number|string} [props.maxWidth]
|
|
17
17
|
* @param {boolean} [props.hideHeader=false]
|
|
18
|
+
* @param {boolean} [props.staticBackdrop=false] When true, the backdrop click and Escape
|
|
19
|
+
* key no longer close the dialog — only an explicit close action can (BUG-06649).
|
|
18
20
|
* @param {string} [props.className]
|
|
19
21
|
* @param {import('react').ReactNode} props.children
|
|
20
22
|
*/
|
|
21
|
-
export default function AppModal({ open, title, subtitle, headerIcon, onClose, footer, size, wide, side, maxWidth, hideHeader, className, children, ...rest }: {
|
|
23
|
+
export default function AppModal({ open, title, subtitle, headerIcon, onClose, footer, size, wide, side, maxWidth, hideHeader, staticBackdrop, className, children, ...rest }: {
|
|
22
24
|
open: boolean;
|
|
23
25
|
title?: import('react').ReactNode;
|
|
24
26
|
subtitle?: import('react').ReactNode;
|
|
@@ -30,6 +32,7 @@ export default function AppModal({ open, title, subtitle, headerIcon, onClose, f
|
|
|
30
32
|
side?: boolean;
|
|
31
33
|
maxWidth?: number | string;
|
|
32
34
|
hideHeader?: boolean;
|
|
35
|
+
staticBackdrop?: boolean;
|
|
33
36
|
className?: string;
|
|
34
37
|
children: import('react').ReactNode;
|
|
35
38
|
}): import("react").JSX.Element;
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
* @param {import('react').ReactNode} [props.label]
|
|
11
11
|
* @param {string} [props.id]
|
|
12
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.
|
|
13
15
|
* @param {string} [props.className]
|
|
14
16
|
* @param {import('react').Ref} [ref]
|
|
15
17
|
*/
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import '@webority/ui-elements';
|
|
2
|
-
export default function AppSelect({ value, onChange, options, placeholder, searchPlaceholder, searchable, clearable, size, icon, floatingLabel, disabled, label, required, error, hint, help, helpLabel, id, name, className, fieldClassName, ...rest }: {
|
|
2
|
+
export default function AppSelect({ value, onChange, options, placeholder, searchPlaceholder, searchable, clearable, size, icon, floatingLabel, disabled, label, required, error, hint, help, helpLabel, id, name, className, fieldClassName, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, ...rest }: {
|
|
3
3
|
[x: string]: any;
|
|
4
|
+
"aria-describedby": any;
|
|
5
|
+
"aria-label": any;
|
|
6
|
+
"aria-labelledby": any;
|
|
4
7
|
className?: string;
|
|
5
8
|
clearable?: boolean;
|
|
6
9
|
disabled: any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export default function AppSidebarMenu({ show, onHide, side, title, titleIcon, header, children, footer, width, backdrop, scroll, keyboard, closeButton, responsive, className, bodyClassName, ariaLabel, ...rest }: {
|
|
1
|
+
export default function AppSidebarMenu({ show, onHide, side, title, titleIcon, header, children, footer, width, maxWidth, backdrop, scroll, keyboard, closeButton, responsive, className, bodyClassName, ariaLabel, ...rest }: {
|
|
2
2
|
[x: string]: any;
|
|
3
3
|
ariaLabel: any;
|
|
4
4
|
backdrop?: boolean;
|
|
@@ -9,6 +9,7 @@ export default function AppSidebarMenu({ show, onHide, side, title, titleIcon, h
|
|
|
9
9
|
footer: any;
|
|
10
10
|
header: any;
|
|
11
11
|
keyboard?: boolean;
|
|
12
|
+
maxWidth: any;
|
|
12
13
|
onHide: any;
|
|
13
14
|
responsive: any;
|
|
14
15
|
scroll?: boolean;
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
* @param {import('react').ReactNode} [props.label]
|
|
11
11
|
* @param {string} [props.id]
|
|
12
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.
|
|
13
15
|
* @param {string} [props.className]
|
|
14
16
|
* @param {import('react').Ref} [ref]
|
|
15
17
|
*/
|
|
@@ -6,14 +6,17 @@
|
|
|
6
6
|
* from its children. The strip markup is the same on both, so they look alike.
|
|
7
7
|
*
|
|
8
8
|
* @param {object} props
|
|
9
|
-
* @param {{ key: string, label: import('react').ReactNode, count?: number, tone?: string, icon?: import('react').ReactNode, danger?: boolean }[]} props.tabs
|
|
9
|
+
* @param {{ key: string, label: import('react').ReactNode, count?: number, tone?: string, icon?: import('react').ReactNode, danger?: boolean, disabled?: boolean }[]} props.tabs
|
|
10
10
|
* @param {string} props.value
|
|
11
11
|
* @param {(key: string) => void} props.onChange
|
|
12
12
|
* @param {"underline"|"pills"} [props.variant="underline"]
|
|
13
13
|
* @param {string} [props.ariaLabel]
|
|
14
14
|
* @param {string} [props.className]
|
|
15
|
+
* @param {import('react').CSSProperties} [props.style]
|
|
16
|
+
* @param {"success"|"warning"|"danger"|"info"} [props.tone] Tone tint for a tab's count
|
|
17
|
+
* pill — set per-tab as `tabs[].tone`, matching the vocabulary `.status-label` uses.
|
|
15
18
|
*/
|
|
16
|
-
export default function AppTabs({ tabs, value, onChange, variant, ariaLabel, className, ...rest }: {
|
|
19
|
+
export default function AppTabs({ tabs, value, onChange, variant, ariaLabel, className, style, ...rest }: {
|
|
17
20
|
tabs: {
|
|
18
21
|
key: string;
|
|
19
22
|
label: import('react').ReactNode;
|
|
@@ -21,10 +24,13 @@ export default function AppTabs({ tabs, value, onChange, variant, ariaLabel, cla
|
|
|
21
24
|
tone?: string;
|
|
22
25
|
icon?: import('react').ReactNode;
|
|
23
26
|
danger?: boolean;
|
|
27
|
+
disabled?: boolean;
|
|
24
28
|
}[];
|
|
25
29
|
value: string;
|
|
26
30
|
onChange: (key: string) => void;
|
|
27
31
|
variant?: "underline" | "pills";
|
|
28
32
|
ariaLabel?: string;
|
|
29
33
|
className?: string;
|
|
34
|
+
style?: import('react').CSSProperties;
|
|
35
|
+
tone?: "success" | "warning" | "danger" | "info";
|
|
30
36
|
}): import("react").JSX.Element;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -56,3 +56,4 @@ export { default as Icon, iconNames } from './components/Icon.jsx';
|
|
|
56
56
|
export { MODAL_ICONS } from './components/ModalIcons.jsx';
|
|
57
57
|
export { default as RequiredMark } from './components/RequiredMark.jsx';
|
|
58
58
|
export { errorToast, toast } from './components/toast.js';
|
|
59
|
+
export { usePagination } from './lib/usePagination.js';
|