@webority/ui-react 0.4.0 → 0.5.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.
@@ -10,6 +10,9 @@
10
10
  * @param {string} [props.icon]
11
11
  * @param {import('react').ReactNode} [props.iconNode]
12
12
  * @param {number} [props.iconSize=18]
13
+ * @param {string} [props.image] Image URL — renders an image-forward card (overrides `icon`).
14
+ * @param {string} [props.imageAlt]
15
+ * @param {import('react').ReactNode} [props.children] Custom body, overriding title/description.
13
16
  * @param {import('react').ReactNode} props.title
14
17
  * @param {import('react').ReactNode} [props.description]
15
18
  * @param {string} [props.checkIcon="check"]
@@ -28,6 +31,9 @@ title, description, checkIcon, checkSize, className, }: {
28
31
  icon?: string;
29
32
  iconNode?: import('react').ReactNode;
30
33
  iconSize?: number;
34
+ image?: string;
35
+ imageAlt?: string;
36
+ children?: import('react').ReactNode;
31
37
  title: import('react').ReactNode;
32
38
  description?: import('react').ReactNode;
33
39
  checkIcon?: string;
@@ -5,6 +5,7 @@
5
5
  * @param {boolean} [props.multiple=true] Checkbox (multi-select) when true, radio when false.
6
6
  * @param {import('react').ReactNode} [props.label] Chip text (or use `children`).
7
7
  * @param {string} [props.name]
8
+ * @param {string} [props.value]
8
9
  * @param {boolean} props.checked
9
10
  * @param {(e: import('react').ChangeEvent<HTMLInputElement>) => void} props.onChange
10
11
  * @param {import('react').ReactNode} props.children
@@ -16,6 +17,7 @@ export default function AppChoiceChip({ multiple, label, name, value, checked, o
16
17
  multiple?: boolean;
17
18
  label?: import('react').ReactNode;
18
19
  name?: string;
20
+ value?: string;
19
21
  checked: boolean;
20
22
  onChange: (e: import('react').ChangeEvent<HTMLInputElement>) => void;
21
23
  children: import('react').ReactNode;
@@ -15,6 +15,7 @@
15
15
  * @param {(row: object) => import('react').ReactNode} [props.rowActions]
16
16
  * @param {string} [props.rowActionsLabel]
17
17
  * @param {object} [props.pagination]
18
+ * @param {string} [props.ariaLabel]
18
19
  * @param {string} [props.className]
19
20
  * @param {boolean} [props.selectable=false] Render a leading checkbox column.
20
21
  * @param {Set<string|number>} [props.selectedIds] Currently selected row keys.
@@ -38,6 +39,7 @@ export default function AppDataTable({ columns, rows, rowKey, sort, onSort, load
38
39
  rowActions?: (row: object) => import('react').ReactNode;
39
40
  rowActionsLabel?: string;
40
41
  pagination?: object;
42
+ ariaLabel?: string;
41
43
  className?: string;
42
44
  selectable?: boolean;
43
45
  selectedIds?: Set<string | number>;
@@ -6,6 +6,7 @@
6
6
  * @param {object} props
7
7
  * @param {string} props.label
8
8
  * @param {File|{ url: string }|null} [props.value]
9
+ * @param {string} [props.name] Form field name; also the input id the label points at.
9
10
  * @param {(file: File|null) => void} props.onPick
10
11
  * @param {string} [props.accept=".jpg,.jpeg,.png"] Accepted file types (the `accept` attribute).
11
12
  * @param {number} [props.maxSizeMb=5]
@@ -17,6 +18,7 @@ export default function AppFilePicker({ label, value, name, onPick, accept, maxS
17
18
  value?: File | {
18
19
  url: string;
19
20
  } | null;
21
+ name?: string;
20
22
  onPick: (file: File | null) => void;
21
23
  accept?: string;
22
24
  maxSizeMb?: number;
@@ -1,9 +1,15 @@
1
1
  /**
2
2
  * Pagination footer under a .table. Pair with usePagination.
3
3
  *
4
+ * `page` is ONE-BASED, matching `<app-table-pagination page="…">` and the fleet pagination
5
+ * contract in react.md ("request `page` (1-based)"). It used to be zero-based here while
6
+ * Razor's was one-based — the same prop name meaning different things on the two surfaces,
7
+ * which no name-level check can see. `pageCount` is likewise now `totalPages`, the name
8
+ * Razor and the fleet response shape already use.
9
+ *
4
10
  * @param {object} props
5
- * @param {number} props.page
6
- * @param {number} props.pageCount
11
+ * @param {number} props.page 1-based.
12
+ * @param {number} props.totalPages
7
13
  * @param {number} props.pageSize
8
14
  * @param {number} props.total
9
15
  * @param {number} props.firstRow
@@ -12,9 +18,9 @@
12
18
  * @param {(size: number) => void} props.onPageSizeChange
13
19
  * @param {number[]} [props.pageSizes]
14
20
  */
15
- export default function AppTablePagination({ page, pageCount, pageSize, total, firstRow, lastRow, onPageChange, onPageSizeChange, pageSizes, }: {
21
+ export default function AppTablePagination({ page, totalPages, pageSize, total, firstRow, lastRow, onPageChange, onPageSizeChange, pageSizes, }: {
16
22
  page: number;
17
- pageCount: number;
23
+ totalPages: number;
18
24
  pageSize: number;
19
25
  total: number;
20
26
  firstRow: number;
@@ -3,7 +3,7 @@ export declare function usePagination(items: any, initialPageSize?: number): {
3
3
  setPage: import("react").Dispatch<import("react").SetStateAction<number>>;
4
4
  pageSize: number;
5
5
  setPageSize: (n: any) => void;
6
- pageCount: number;
6
+ totalPages: number;
7
7
  pageRows: any;
8
8
  total: any;
9
9
  firstRow: number;