@webority/ui-react 0.13.4 → 0.14.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
  *
11
11
  * @param {object} props
12
12
  * @param {string|import('react').ReactNode} props.icon glyph name (see Icon), or a custom node (e.g. an iconsax glyph)
13
+ * @param {'linear'|'outline'|'bold'|'bulk'|'broken'|'twotone'} [props.iconVariant='linear'] iconsax
14
+ * style of a NAMED icon (AppIcon's `variant`). A node passed as `icon` is the caller's own glyph
15
+ * and is not restyled.
13
16
  * @param {string} props.label accessible name + collision-aware hover/focus tooltip
14
17
  * @param {'auto'|'top'|'bottom'|'start'|'end'} [props.tooltipPlacement='auto'] which side the
15
18
  * tooltip prefers. `auto` (default) lets Popper pick the side with the most room; a named side
@@ -25,8 +28,9 @@
25
28
  * wrapper must use `forwardRef` (the tooltip still opens without it, but may be mispositioned).
26
29
  * @param {string} [props.href] sets an anchor without needing `as`.
27
30
  */
28
- export default function AppActionIcon({ icon, label, tooltipPlacement, danger, disabled, size, onClick, className, as, href, ...rest }: {
31
+ export default function AppActionIcon({ icon, iconVariant, label, tooltipPlacement, danger, disabled, size, onClick, className, as, href, ...rest }: {
29
32
  icon: string | import('react').ReactNode;
33
+ iconVariant?: 'linear' | 'outline' | 'bold' | 'bulk' | 'broken' | 'twotone';
30
34
  label: string;
31
35
  tooltipPlacement?: 'auto' | 'top' | 'bottom' | 'start' | 'end';
32
36
  danger?: boolean;
@@ -1,8 +1,15 @@
1
1
  /**
2
- * The shared status banner — wraps react-bootstrap <Alert> (same `.alert` /
2
+ * The shared tinted banner — wraps react-bootstrap <Alert> (same `.alert` /
3
3
  * `.alert-{variant}` classes Bootstrap + the theme already style). Screens must
4
4
  * use this instead of raw `className="alert alert-…"`.
5
5
  *
6
+ * It does two jobs, and `role` is what tells them apart for assistive technology:
7
+ * - REPORT a state ("we couldn't save", "your trial ends in 3 days"): keep the default
8
+ * `role="alert"`, or `"status"` for a notice that must not interrupt.
9
+ * - EXPLAIN part of the page (how a figure is worked out, what happens next): pass
10
+ * `role="none"` so a screen reader reads it as ordinary content instead of breaking in.
11
+ * `accent` adds the thick left edge that marks such an aside.
12
+ *
6
13
  * @param {object} props
7
14
  * @param {"info"|"success"|"warning"|"danger"} [props.variant="info"]
8
15
  * @param {import('react').ReactNode} props.children The alert body.
@@ -10,22 +17,32 @@
10
17
  * @param {string|import('react').ReactNode} [props.icon] A leading glyph — a semantic icon name or a node. Defaults to the variant's badge glyph; pass `null` for none.
11
18
  * @param {string} [props.image] A custom image URL shown in the badge instead of the icon glyph (fills the circle).
12
19
  * @param {string} [props.imageAlt] Alt text for the custom image.
20
+ * @param {number} [props.imageSize] Width and height of the image badge in px. Unset, it follows `size`.
13
21
  * @param {string} [props.className]
14
22
  * @param {() => void} [props.onClose] Called when dismissed
15
23
  * @param {boolean} [props.dismissible] Show the close button (defaults to true when onClose is set)
16
24
  * @param {boolean} [props.bordered=true] Draw the soft variant border. `false` keeps only the tint fill.
17
- * @param {"alert"|"status"} [props.role="alert"] Use "status" for non-assertive notices
25
+ * @param {boolean} [props.accent=false] A thick variant-coloured left edge, marking the alert as an aside.
26
+ * @param {"sm"|"md"|"lg"} [props.size="md"] `sm` is a compact single line; `lg` is roomier, with a larger
27
+ * heading, body and badge.
28
+ * @param {import('react').ReactNode} [props.action] A trailing action pinned to the right — usually an `AppButton`.
29
+ * @param {"alert"|"status"|"none"} [props.role="alert"] "status" for non-assertive notices; "none" for
30
+ * explanatory page content, which must not interrupt a screen reader.
18
31
  */
19
- export default function AppAlert({ variant, children, title, icon, image, imageAlt, className, onClose, dismissible, bordered, role, ...rest }: {
32
+ export default function AppAlert({ variant, children, title, icon, image, imageAlt, imageSize, className, onClose, dismissible, bordered, accent, size, action, role, ...rest }: {
20
33
  variant?: "info" | "success" | "warning" | "danger";
21
34
  children: import('react').ReactNode;
22
35
  title?: import('react').ReactNode;
23
36
  icon?: string | import('react').ReactNode;
24
37
  image?: string;
25
38
  imageAlt?: string;
39
+ imageSize?: number;
26
40
  className?: string;
27
41
  onClose?: () => void;
28
42
  dismissible?: boolean;
29
43
  bordered?: boolean;
30
- role?: "alert" | "status";
44
+ accent?: boolean;
45
+ size?: "sm" | "md" | "lg";
46
+ action?: import('react').ReactNode;
47
+ role?: "alert" | "status" | "none";
31
48
  }): import("react").JSX.Element;
@@ -7,9 +7,10 @@
7
7
  * @param {string} props.value
8
8
  * @param {boolean} props.checked
9
9
  * @param {(e: import('react').ChangeEvent<HTMLInputElement>) => void} props.onChange
10
- * @param {string} [props.icon]
10
+ * @param {string} [props.icon] Icon name. Renders linear, and switches to the solid (bold) style
11
+ * while the card is checked so the selected card reads at a glance.
11
12
  * @param {import('react').ReactNode} [props.iconNode]
12
- * @param {number} [props.iconSize=18]
13
+ * @param {number} [props.iconSize] Icon glyph size in px. Defaults to the card size: 16 (sm), 18 (md), 22 (lg).
13
14
  * @param {string} [props.image] Image URL — renders an image-forward card (overrides `icon`).
14
15
  * @param {string} [props.imageAlt]
15
16
  * @param {import('react').ReactNode} [props.children] Custom body, overriding title/description.
@@ -17,12 +18,18 @@
17
18
  * @param {import('react').ReactNode} [props.description]
18
19
  * @param {string} [props.checkIcon="check"]
19
20
  * @param {number} [props.checkSize=18]
21
+ * @param {boolean} [props.hideCheck=false] Render no selected tick. Selection then reads from the
22
+ * card's border and fill alone, and the card sheds the top/bottom room the tick needed.
23
+ * @param {'sm'|'md'|'lg'} [props.size='md'] Card size: padding, gap, icon disc, type and the
24
+ * tick offset step together.
25
+ * @param {'inline'|'stacked'} [props.layout='inline'] `inline` puts the icon beside the text;
26
+ * `stacked` puts the icon on its own line with the title and description below it.
20
27
  * @param {string} [props.className]
21
28
  */
22
29
  export default function AppChoiceCard({ name, multiple, value, checked, onChange, icon, iconNode, // custom icon element; overrides the `icon` name when provided
23
30
  iconSize, image, // image URL — renders an image-forward card (overrides icon)
24
31
  imageAlt, children, // custom body template — overrides title/description when provided
25
- title, description, checkIcon, checkSize, className, ...rest }: {
32
+ title, description, checkIcon, checkSize, hideCheck, size, layout, className, ...rest }: {
26
33
  name: string;
27
34
  multiple?: boolean;
28
35
  value: string;
@@ -38,5 +45,8 @@ title, description, checkIcon, checkSize, className, ...rest }: {
38
45
  description?: import('react').ReactNode;
39
46
  checkIcon?: string;
40
47
  checkSize?: number;
48
+ hideCheck?: boolean;
49
+ size?: 'sm' | 'md' | 'lg';
50
+ layout?: 'inline' | 'stacked';
41
51
  className?: string;
42
52
  }): import("react").JSX.Element;
@@ -13,6 +13,8 @@
13
13
  * badge occupies (and to the same reduced footprint when the dialog has no message), so a
14
14
  * 1024px PNG and a 64px one land identically. Decorative like the tone artwork: it renders
15
15
  * aria-hidden with an empty alt, and the title plus message carry the meaning.
16
+ * @param {number} [props.iconSize] Width and height of the illustration in px, for the tone
17
+ * artwork and a custom `image` alike. Unset, it is 80px with a message and 56px without.
16
18
  * @param {string} [props.confirmPhrase]
17
19
  * @param {() => void} props.onConfirm
18
20
  * @param {string} [props.cancelLabel="Cancel"]
@@ -28,7 +30,7 @@
28
30
  * a preset, or an exact max-width in px for a custom size.
29
31
  * @param {string} [props.className] Merged with the dialog's own wui-confirm class.
30
32
  */
31
- export default function AppConfirmDialog({ open, title, message, confirmLabel, cancelLabel, danger, tone, image, confirmPhrase, onConfirm, onClose, loading, staticBackdrop, placement, size, className, ...rest }: {
33
+ export default function AppConfirmDialog({ open, title, message, confirmLabel, cancelLabel, danger, tone, image, iconSize, confirmPhrase, onConfirm, onClose, loading, staticBackdrop, placement, size, className, ...rest }: {
32
34
  open: boolean;
33
35
  title: string;
34
36
  message?: import('react').ReactNode;
@@ -36,6 +38,7 @@ export default function AppConfirmDialog({ open, title, message, confirmLabel, c
36
38
  danger?: boolean;
37
39
  tone?: string;
38
40
  image?: string;
41
+ iconSize?: number;
39
42
  confirmPhrase?: string;
40
43
  onConfirm: () => void;
41
44
  cancelLabel?: string;
@@ -0,0 +1,14 @@
1
+ import "@webority/ui-elements";
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>>;
14
+ export default AppCountrySelect;
@@ -14,7 +14,10 @@
14
14
  * @param {number} [props.sourceCount]
15
15
  * @param {(row: object) => import('react').ReactNode} [props.rowActions]
16
16
  * @param {string} [props.rowActionsLabel]
17
- * @param {object} [props.pagination]
17
+ * @param {object} [props.pagination] The footer's state, usually straight from usePagination:
18
+ * `{ page, totalPages, pageSize, total, firstRow, lastRow, setPage, setPageSize }`, plus the
19
+ * optional `pageSizes` and `mode` that AppTablePagination takes. The footer shows once `total`
20
+ * is above 0 and stays in place while `loading`, so the table does not jump between pages.
18
21
  * @param {string} [props.ariaLabel]
19
22
  * @param {string} [props.className] Extra classes on the <table> (column/table styling).
20
23
  * @param {string} [props.wrapperClassName] Extra classes on the `.table-wrap` outer div — the
@@ -17,7 +17,8 @@
17
17
  * @param {boolean} [props.multiple=false]
18
18
  * @param {number} [props.maxFiles] Cap on total files in multiple mode.
19
19
  * @param {string} [props.accept=".jpg,.jpeg,.png"] Accepted file types (the `accept` attribute).
20
- * @param {number} [props.maxSizeMb] Defaults to the shared DEFAULT_MAX_SIZE_MB.
20
+ * @param {number} [props.maxSizeMb] Defaults to the shared DEFAULT_MAX_SIZE_MB. 0 means no size
21
+ * limit: nothing is rejected for its size, and the hint names no size.
21
22
  * @param {boolean} [props.required]
22
23
  * @param {string} [props.error]
23
24
  * @param {string} [props.hint] Helper text below the control; an error (the caller's or a rejected
@@ -1,7 +1,8 @@
1
- export default function AppInfoTip({ label, children, placement, className, ...rest }: {
1
+ export default function AppInfoTip({ label, children, placement, width, className, ...rest }: {
2
2
  [x: string]: any;
3
3
  children: any;
4
4
  className?: string;
5
5
  label: any;
6
6
  placement?: string;
7
+ width?: string;
7
8
  }): import("react").JSX.Element;
@@ -21,6 +21,8 @@
21
21
  * @param {() => void} props.onAdd
22
22
  * @param {(index: number) => void} [props.onRemove] Omit to make rows non-removable.
23
23
  * @param {string} [props.addLabel='Add another']
24
+ * @param {string} [props.addVariant='secondary'] The add button's AppButton variant
25
+ * (primary, outline, ghost, …); an unknown value warns in dev, same as AppButton.
24
26
  * @param {string} [props.removeLabel='Remove row']
25
27
  * @param {string} [props.emptyText] Shown in place of the rows when there are none.
26
28
  * @param {number} [props.min=0] Rows at or below this count cannot be removed.
@@ -28,7 +30,7 @@
28
30
  * @param {boolean} [props.numbered=true] Show the row index.
29
31
  * @param {string} [props.className]
30
32
  */
31
- export default function AppRepeater({ rows, renderRow, rowLabel, onAdd, onRemove, addLabel, removeLabel, emptyText, min, max, numbered, className, ...rest }: {
33
+ export default function AppRepeater({ rows, renderRow, rowLabel, onAdd, onRemove, addLabel, addVariant, removeLabel, emptyText, min, max, numbered, className, ...rest }: {
32
34
  rows: {
33
35
  id?: string | number;
34
36
  }[];
@@ -37,6 +39,7 @@ export default function AppRepeater({ rows, renderRow, rowLabel, onAdd, onRemove
37
39
  onAdd: () => void;
38
40
  onRemove?: (index: number) => void;
39
41
  addLabel?: string;
42
+ addVariant?: string;
40
43
  removeLabel?: string;
41
44
  emptyText?: string;
42
45
  min?: number;
@@ -3,6 +3,9 @@ import "@webority/ui-elements";
3
3
  * @param {object} props
4
4
  * @param {string} [props.className] Class to apply to the control element.
5
5
  * @param {string} [props.fieldClassName] Class to apply to the wrapper field div.
6
+ * @param {import('react').ReactNode} [props.prefix] A bordered box before the select (e.g. "+91", "Tag"),
7
+ * the same shell as AppInput's prefix. Not combined with floatingLabel.
8
+ * @param {import('react').ReactNode} [props.suffix] A bordered box after the select, as AppInput's suffix.
6
9
  */
7
10
  declare const AppSelect: import("react").ForwardRefExoticComponent<import("react").RefAttributes<any>>;
8
11
  export default AppSelect;
@@ -14,6 +14,9 @@ export declare const InfoIcon: ({ size }: {
14
14
  export declare const DeleteIcon: ({ size }: {
15
15
  size?: number;
16
16
  }) => import("react").JSX.Element;
17
+ export declare const PrimaryIcon: ({ size }: {
18
+ size?: number;
19
+ }) => import("react").JSX.Element;
17
20
  export declare const MODAL_ICONS: {
18
21
  success: ({ size }: {
19
22
  size?: number;
@@ -30,4 +33,7 @@ export declare const MODAL_ICONS: {
30
33
  delete: ({ size }: {
31
34
  size?: number;
32
35
  }) => import("react").JSX.Element;
36
+ primary: ({ size }: {
37
+ size?: number;
38
+ }) => import("react").JSX.Element;
33
39
  };
@@ -1,9 +1,11 @@
1
1
  /**
2
2
  * @param {string | import('react').ReactNode} icon A Bootstrap-Icons name, or a node rendered as-is.
3
- * @param {{ size?: number, className?: string }} [options]
3
+ * @param {{ size?: number, className?: string, variant?: string }} [options] `variant` is the iconsax
4
+ * style for a NAMED icon; a node is the caller's own glyph and renders untouched.
4
5
  * @returns {import('react').ReactNode | null}
5
6
  */
6
- export default function renderIconProp(icon: string | import('react').ReactNode, { size, className }?: {
7
+ export default function renderIconProp(icon: string | import('react').ReactNode, { size, className, variant }?: {
7
8
  size?: number;
8
9
  className?: string;
10
+ variant?: string;
9
11
  }): import('react').ReactNode | null;
@@ -9,7 +9,6 @@ export { default as AppBadge } from "./components/AppBadge.jsx";
9
9
  export { default as AppBanner } from "./components/AppBanner.jsx";
10
10
  export { default as AppBreadcrumbs } from "./components/AppBreadcrumbs.jsx";
11
11
  export { default as AppButton } from "./components/AppButton.jsx";
12
- export { default as AppCallout } from "./components/AppCallout.jsx";
13
12
  export { default as AppCard } from "./components/AppCard.jsx";
14
13
  export { default as AppCheckbox } from "./components/AppCheckbox.jsx";
15
14
  export { default as AppChip } from "./components/AppChip.jsx";
@@ -20,6 +19,7 @@ export { default as AppCompareTable } from "./components/AppCompareTable.jsx";
20
19
  export { default as AppConfirmDialog } from "./components/AppConfirmDialog.jsx";
21
20
  export { default as AppConsentBanner } from "./components/AppConsentBanner.jsx";
22
21
  export { default as AppCopyButton } from "./components/AppCopyButton.jsx";
22
+ export { default as AppCountrySelect } from "./components/AppCountrySelect.jsx";
23
23
  export { default as AppDataTable } from "./components/AppDataTable.jsx";
24
24
  export { default as AppDatePicker } from "./components/AppDatePicker.jsx";
25
25
  export { default as AppDateRangePicker } from "./components/AppDateRangePicker.jsx";