@webority/ui-react 0.7.3 → 0.7.5

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.
@@ -0,0 +1,22 @@
1
+ /**
2
+ * A page/system-level announcement bar — a full-width strip for a message that applies to the
3
+ * whole screen or app (scheduled maintenance, a trial ending, a new version). It sits apart
4
+ * from the other status surfaces: `AppAlert` is an inline message about one section, and a
5
+ * toast is a transient pop; a banner is persistent, full-bleed, and page-scoped.
6
+ *
7
+ * @param {object} props
8
+ * @param {'info'|'success'|'warning'|'danger'|'neutral'} [props.tone='info'] The banner's colour/intent.
9
+ * @param {string|import('react').ReactNode} [props.icon] A leading icon — a glyph name or a node.
10
+ * @param {import('react').ReactNode} props.children The message; may include an inline action link.
11
+ * @param {boolean} [props.dismissible=false] Show a close button that removes the banner.
12
+ * @param {() => void} [props.onDismiss] Called after the banner is dismissed.
13
+ * @param {string} [props.className]
14
+ */
15
+ export default function AppBanner({ tone, icon, children, dismissible, onDismiss, className, ...rest }: {
16
+ tone?: 'info' | 'success' | 'warning' | 'danger' | 'neutral';
17
+ icon?: string | import('react').ReactNode;
18
+ children: import('react').ReactNode;
19
+ dismissible?: boolean;
20
+ onDismiss?: () => void;
21
+ className?: string;
22
+ }): import("react").JSX.Element;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * A breadcrumb trail — the path from a root to the current page. The last item is the
3
+ * current page: rendered as text with `aria-current="page"`, never a link. Wraps
4
+ * react-bootstrap's Breadcrumb (Bootstrap `.breadcrumb`), so React and the Razor
5
+ * `<app-breadcrumbs>` render the same markup.
6
+ *
7
+ * Router-decoupled like AppDropdown: an item with `to` renders through `linkComponent`
8
+ * (react-router's `Link`) when one is provided, otherwise a plain `<a href>`. The library
9
+ * never imports a router.
10
+ *
11
+ * @param {object} props
12
+ * @param {{ key?: string, label: string, href?: string, to?: string,
13
+ * icon?: string|import('react').ReactNode }[]} props.items The trail, root first, current
14
+ * page last. An item links when it has `href`/`to` and is not the last one.
15
+ * @param {import('react').ElementType} [props.linkComponent] Component for `to` items (e.g. Link).
16
+ * @param {string} [props.className]
17
+ */
18
+ export default function AppBreadcrumbs({ items, linkComponent, className, ...rest }: {
19
+ items: {
20
+ key?: string;
21
+ label: string;
22
+ href?: string;
23
+ to?: string;
24
+ icon?: string | import('react').ReactNode;
25
+ }[];
26
+ linkComponent?: import('react').ElementType;
27
+ className?: string;
28
+ }): import("react").JSX.Element;
@@ -12,7 +12,7 @@
12
12
  * @param {string} [props.bodyClassName]
13
13
  * @param {string} [props.headerClassName]
14
14
  * @param {boolean} [props.body=true]
15
- * @param {boolean} [props.lifted=false] Raised/hover treatment (.card-lifted).
15
+ * @param {boolean} [props.lifted=false] 1px hover translate (.card-lifted) — not a drop shadow.
16
16
  */
17
17
  export default function AppCard({ title, titleClassName, header, headerExtra, headerActions, children, className, bodyClassName, headerClassName, body, lifted, ...rest }: {
18
18
  title?: import('react').ReactNode;
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Shared checkbox on the Bootstrap `.form-check` markup — the same structure the
3
- * Razor <app-checkbox> emits, so both surfaces render identically.
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.
4
5
  *
5
- * The label is bound to the input with id/htmlFor rather than react-bootstrap's
6
- * `label` prop: that rendered a <label> with no `for`, so clicking the text did
7
- * nothing and screen readers never announced the name.
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
8
  *
9
9
  * @param {object} props
10
10
  * @param {import('react').ReactNode} [props.label]
@@ -16,7 +16,7 @@
16
16
  * disables Cancel and the confirm-phrase field, and blocks dismissal via the backdrop,
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
- * click and Escape no longer close the dialog (BUG-06649).
19
+ * click and Escape no longer close the dialog.
20
20
  * @param {'center'|'top'} [props.placement='center'] Vertical placement of the card,
21
21
  * forwarded to AppModal — centred (default) or pinned near the top.
22
22
  */
@@ -21,8 +21,10 @@
21
21
  * @param {Set<string|number>} [props.selectedIds] Currently selected row keys.
22
22
  * @param {(id: string|number) => void} [props.onToggleRow]
23
23
  * @param {(checked: boolean) => void} [props.onToggleAll] Toggle all current rows.
24
+ * @param {(row: object) => import('react').ReactNode} [props.renderExpanded] When given, each row
25
+ * gets a leading expand toggle; the returned content renders in a full-width row beneath it.
24
26
  */
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 }: {
27
+ export default function AppDataTable({ columns, rows, rowKey, sort, onSort, loading, skeletonRows, empty, emptyFiltered, sourceCount, rowActions, rowActionsLabel, pagination, ariaLabel, className, selectable, selectedIds, onToggleRow, onToggleAll, renderExpanded, ...rest }: {
26
28
  columns: object[];
27
29
  rows: object[];
28
30
  rowKey?: (row: object, index: number) => string | number;
@@ -45,4 +47,5 @@ export default function AppDataTable({ columns, rows, rowKey, sort, onSort, load
45
47
  selectedIds?: Set<string | number>;
46
48
  onToggleRow?: (id: string | number) => void;
47
49
  onToggleAll?: (checked: boolean) => void;
50
+ renderExpanded?: (row: object) => import('react').ReactNode;
48
51
  }): import("react").JSX.Element;
@@ -1,4 +1,4 @@
1
- export default function AppDropdown({ icon, iconSize, toggleClassName, label, ariaLabel, align, items, menuClassName, linkComponent, children, ...rest }: {
1
+ export default function AppDropdown({ icon, iconSize, toggleClassName, label, ariaLabel, align, items, menuClassName, linkComponent, children, trigger, ...rest }: {
2
2
  [x: string]: any;
3
3
  align?: string;
4
4
  ariaLabel: any;
@@ -9,5 +9,6 @@ export default function AppDropdown({ icon, iconSize, toggleClassName, label, ar
9
9
  label: any;
10
10
  linkComponent: any;
11
11
  menuClassName?: string;
12
- toggleClassName?: string;
12
+ toggleClassName: any;
13
+ trigger: any;
13
14
  }): import("react").JSX.Element;
@@ -1,8 +1,9 @@
1
1
  /**
2
- * The shared text field — wraps react-bootstrap Form.Group / Form.Label / Form.Control
3
- * (which inherit the brand `$input-*` styling) while keeping the `.field`/`.input` classes
4
- * so the look is unchanged, and folding in the control shells screens kept hand-rolling:
5
- * a unit suffix, a password reveal toggle, a leading icon, and a trailing action.
2
+ * The shared text field — wraps react-bootstrap Form.Group / Form.Label / Form.Control.
3
+ * Visual chrome is Bootstrap `.form-control` (theme `$input-*` + one post-CSS skin);
4
+ * `.input` is an alias on the same element for size/shell hooks (`.input-sm`,
5
+ * `.input-icon`, …), not a second look. Shells: unit, password reveal, leading icon,
6
+ * trailing action.
6
7
  *
7
8
  * Forwards `ref` to the underlying control, so react-hook-form's spread `{...register("name")}`
8
9
  * works unchanged, as does a controlled `value`/`onChange` pair.
@@ -35,6 +36,8 @@
35
36
  * @param {import('react').ReactNode} [props.suffix] A bordered box after the input (e.g. .00, .com).
36
37
  * @param {boolean} [props.floatingLabel=false] Label sits inside as a placeholder, then slides up
37
38
  * on focus/fill. Opt-in variant; standalone only (no icon/unit/prefix in the same field).
39
+ * @param {"bare"} [props.variant] Borderless variant — no border/background, inherits the
40
+ * container's chrome (inline-rename, ⌘K).
38
41
  * @param {import('react').Ref<HTMLInputElement>} [ref]
39
42
  */
40
43
  declare const AppInput: import("react").ForwardRefExoticComponent<import("react").RefAttributes<any>>;
@@ -6,20 +6,32 @@
6
6
  * @param {string} props.label What the number measures.
7
7
  * @param {import('react').ReactNode} props.value The number itself, already formatted.
8
8
  * @param {string|import('react').ReactNode} [props.icon] Icon name for the leading tile, or a custom node.
9
+ * @param {'primary'|'success'|'warning'|'danger'|'info'|'neutral'} [props.iconTone] Tints the icon chip.
9
10
  * @param {import('react').ReactNode} [props.delta] Change text, e.g. "12% vs last month".
10
- * @param {'up'|'down'|'flat'} [props.deltaDirection='flat'] Colours the delta and picks its arrow.
11
+ * @param {'up'|'down'|'flat'} [props.deltaDirection] Colours the delta and picks its arrow. Omitted →
12
+ * inferred from a leading "+"/"-" on `delta` (falls back to 'flat').
13
+ * @param {number[]} [props.sparkline] A trend series rendered as a small inline chart.
11
14
  * @param {'plain'|'filled'|'accent'} [props.variant='plain'] The tile surface: plain (today's
12
15
  * bordered card), filled (a subtle surface fill), accent (a brand-tinted fill).
16
+ * @param {'md'|'lg'} [props.size='md'] Tile scale: md (default), lg (a hero tile with an
17
+ * enlarged value — for the single headline stat above a dashboard).
13
18
  * @param {boolean} [props.inline=false] Put the icon beside the text instead of above it.
19
+ * @param {boolean} [props.attention=false] Marks the tile as needing action (warning-tinted).
20
+ * @param {string} [props.href] Renders the whole tile as a link to this URL.
14
21
  * @param {string} [props.className]
15
22
  */
16
- export default function AppKpiTile({ label, value, icon, delta, deltaDirection, variant, inline, className, ...rest }: {
23
+ export default function AppKpiTile({ label, value, icon, iconTone, delta, deltaDirection, sparkline, variant, size, inline, attention, href, className, ...rest }: {
17
24
  label: string;
18
25
  value: import('react').ReactNode;
19
26
  icon?: string | import('react').ReactNode;
27
+ iconTone?: 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'neutral';
20
28
  delta?: import('react').ReactNode;
21
29
  deltaDirection?: 'up' | 'down' | 'flat';
30
+ sparkline?: number[];
22
31
  variant?: 'plain' | 'filled' | 'accent';
32
+ size?: 'md' | 'lg';
23
33
  inline?: boolean;
34
+ attention?: boolean;
35
+ href?: string;
24
36
  className?: string;
25
37
  }): import("react").JSX.Element;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * A meter — a scalar measurement within a known range (disk usage, a score, remaining quota).
3
+ * Unlike AppProgress (a task advancing over time) this is `role="meter"`; given `low`/`high`
4
+ * thresholds it auto-tones green/amber/red by which end is `optimum`. It shares AppProgress's
5
+ * bar, and renders identically to the Razor `<app-meter>`.
6
+ *
7
+ * @param {object} props
8
+ * @param {number} props.value The measurement (min…max); clamped into range.
9
+ * @param {number} [props.min=0]
10
+ * @param {number} [props.max=100]
11
+ * @param {'info'|'success'|'warning'|'danger'|'neutral'} [props.tone='info'] Fallback fill when no thresholds.
12
+ * @param {'high'|'low'} [props.optimum='high'] Which end is good — `high` = bigger is better.
13
+ * @param {number} [props.low] At-or-below this value is the low zone.
14
+ * @param {number} [props.high] At-or-above this value is the high zone.
15
+ * @param {'sm'|'md'} [props.size='md'] Bar thickness.
16
+ * @param {string} [props.label] Accessible name; also shown in the bar when `showLabel`.
17
+ * @param {boolean} [props.showLabel=false]
18
+ * @param {string} [props.className]
19
+ */
20
+ export default function AppMeter({ value, min, max, tone, optimum, low, high, size, label, showLabel, className, ...rest }: {
21
+ value: number;
22
+ min?: number;
23
+ max?: number;
24
+ tone?: 'info' | 'success' | 'warning' | 'danger' | 'neutral';
25
+ optimum?: 'high' | 'low';
26
+ low?: number;
27
+ high?: number;
28
+ size?: 'sm' | 'md';
29
+ label?: string;
30
+ showLabel?: boolean;
31
+ className?: string;
32
+ }): import("react").JSX.Element;
@@ -19,7 +19,7 @@
19
19
  * centred (default) or pinned near the top of the viewport.
20
20
  * @param {boolean} [props.hideHeader=false]
21
21
  * @param {boolean} [props.staticBackdrop=false] When true, the backdrop click and Escape
22
- * key no longer close the dialog — only an explicit close action can (BUG-06649).
22
+ * key no longer close the dialog — only an explicit close action can.
23
23
  * @param {string} [props.className] Extra classes on the modal card.
24
24
  * @param {import('react').ReactNode} props.children
25
25
  */
@@ -0,0 +1,26 @@
1
+ /**
2
+ * A positioned overlay anchored to a trigger — a click-opened floating panel (a notifications
3
+ * list, a filters panel, a rich mini-menu). Distinct from AppModal (centered + backdrop),
4
+ * AppDropdown (a flat action menu), and AppInfoTip (a hover "?" help popover). Wraps
5
+ * react-bootstrap's OverlayTrigger/Popover (Popper positioning); the Razor counterpart
6
+ * `<app-popover>` uses Bootstrap's own popover, so both surfaces stay in lockstep.
7
+ *
8
+ * @param {object} props
9
+ * @param {import('react').ReactElement} props.trigger The anchor element the panel opens from.
10
+ * Must be a single element that forwards a ref (a DOM element, or a react-bootstrap-based
11
+ * App* like AppButton/ActionIcon). It renders as written; clicking it toggles the panel.
12
+ * @param {import('react').ReactNode} props.children The panel body.
13
+ * @param {string} [props.title] Optional panel heading.
14
+ * @param {'top'|'bottom'|'start'|'end'|'auto'} [props.placement='bottom'] Where it opens; `auto`
15
+ * flips to stay in view.
16
+ * @param {'click'|'hover'|'focus'} [props.triggerType='click'] What opens it.
17
+ * @param {string} [props.className] Class on the popover panel.
18
+ */
19
+ export default function AppPopover({ trigger, children, title, placement, triggerType, className, ...rest }: {
20
+ trigger: import('react').ReactElement;
21
+ children: import('react').ReactNode;
22
+ title?: string;
23
+ placement?: 'top' | 'bottom' | 'start' | 'end' | 'auto';
24
+ triggerType?: 'click' | 'hover' | 'focus';
25
+ className?: string;
26
+ }): import("react").JSX.Element;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * A determinate progress bar — a task's completion from 0 to `max`. For an indeterminate
3
+ * "working…" state pass `indeterminate` (an animated sweep, no value). Renders Bootstrap
4
+ * `.progress` markup with a brand-toned fill, identical to the Razor `<app-progress>`.
5
+ *
6
+ * @param {object} props
7
+ * @param {number} props.value Current amount (0…max); clamped into range. Ignored when `indeterminate`.
8
+ * @param {number} [props.max=100]
9
+ * @param {'info'|'success'|'warning'|'danger'|'neutral'} [props.tone='info'] Fill colour.
10
+ * @param {'sm'|'md'} [props.size='md'] Bar thickness — sm is a thin 4px bar for inline/table use.
11
+ * @param {string} [props.label] Accessible name for the bar; also shown inside it when `showLabel`.
12
+ * @param {boolean} [props.showLabel=false] Render the label text inside the bar (ignored when indeterminate).
13
+ * @param {boolean} [props.striped=false] Diagonal stripe overlay.
14
+ * @param {boolean} [props.animated=false] Animate the stripes (implies striped).
15
+ * @param {boolean} [props.indeterminate=false] Unknown-duration sweep; drops the value/label.
16
+ * @param {string} [props.className]
17
+ */
18
+ export default function AppProgress({ value, max, tone, size, label, showLabel, striped, animated, indeterminate, className, ...rest }: {
19
+ value: number;
20
+ max?: number;
21
+ tone?: 'info' | 'success' | 'warning' | 'danger' | 'neutral';
22
+ size?: 'sm' | 'md';
23
+ label?: string;
24
+ showLabel?: boolean;
25
+ striped?: boolean;
26
+ animated?: boolean;
27
+ indeterminate?: boolean;
28
+ className?: string;
29
+ }): import("react").JSX.Element;
@@ -2,13 +2,13 @@
2
2
  * Empty ledger body for AppDataTable.
3
3
  *
4
4
  * @param {object} props
5
- * @param {string} props.icon
5
+ * @param {string|import('react').ReactNode} props.icon Icon name, or a custom node.
6
6
  * @param {import('react').ReactNode} props.title
7
7
  * @param {import('react').ReactNode} [props.text]
8
8
  * @param {import('react').ReactNode} [props.action]
9
9
  */
10
10
  export default function AppTableEmptyState({ icon, title, text, action, ...rest }: {
11
- icon: string;
11
+ icon: string | import('react').ReactNode;
12
12
  title: import('react').ReactNode;
13
13
  text?: import('react').ReactNode;
14
14
  action?: import('react').ReactNode;
@@ -1,11 +1,10 @@
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
4
+ * `page` is ONE-BASED, matching `<app-table-pagination page="…">` (the shared 1-based pagination contract). It used to be zero-based here while
6
5
  * Razor's was one-based — the same prop name meaning different things on the two surfaces,
7
6
  * which no name-level check can see. `pageCount` is likewise now `totalPages`, the name
8
- * Razor and the fleet response shape already use.
7
+ * Razor and the shared response shape already use.
9
8
  *
10
9
  * @param {object} props
11
10
  * @param {number} props.page 1-based.
@@ -20,8 +19,10 @@
20
19
  * @param {'prev-next'|'numbered'} [props.mode='prev-next'] prev-next (default) is the arrows-
21
20
  * only nav above. numbered inserts windowed page buttons — first/last plus an ellipsis over
22
21
  * any run of hidden pages — between the arrows.
22
+ * @param {boolean} [props.showPageSize=true] Show the "Rows per page" selector. Set false for a
23
+ * compact pager that pages but doesn't expose page size (e.g. a dense numbered table).
23
24
  */
24
- export default function AppTablePagination({ page, totalPages, pageSize, total, firstRow, lastRow, onPageChange, onPageSizeChange, pageSizes, mode, ...rest }: {
25
+ export default function AppTablePagination({ page, totalPages, pageSize, total, firstRow, lastRow, onPageChange, onPageSizeChange, pageSizes, mode, showPageSize, ...rest }: {
25
26
  page: number;
26
27
  totalPages: number;
27
28
  pageSize: number;
@@ -32,4 +33,5 @@ export default function AppTablePagination({ page, totalPages, pageSize, total,
32
33
  onPageSizeChange: (size: number) => void;
33
34
  pageSizes?: number[];
34
35
  mode?: 'prev-next' | 'numbered';
36
+ showPageSize?: boolean;
35
37
  }): import("react").JSX.Element;
@@ -5,6 +5,8 @@ export { default as AppAsyncBlock } from './components/AppAsyncBlock.jsx';
5
5
  export { default as AppAutocomplete } from './components/AppAutocomplete.jsx';
6
6
  export { default as AppAvatar } from './components/AppAvatar.jsx';
7
7
  export { default as AppBadge } from './components/AppBadge.jsx';
8
+ export { default as AppBanner } from './components/AppBanner.jsx';
9
+ export { default as AppBreadcrumbs } from './components/AppBreadcrumbs.jsx';
8
10
  export { default as AppButton } from './components/AppButton.jsx';
9
11
  export { default as AppCallout } from './components/AppCallout.jsx';
10
12
  export { default as AppCard } from './components/AppCard.jsx';
@@ -27,12 +29,15 @@ export { default as AppInfoTip } from './components/AppInfoTip.jsx';
27
29
  export { default as AppInput } from './components/AppInput.jsx';
28
30
  export { default as AppKpiTile } from './components/AppKpiTile.jsx';
29
31
  export { default as AppLogoPicker } from './components/AppLogoPicker.jsx';
32
+ export { default as AppMeter } from './components/AppMeter.jsx';
30
33
  export { default as AppModal } from './components/AppModal.jsx';
31
34
  export { default as AppMultiSelect } from './components/AppMultiSelect.jsx';
32
35
  export { default as AppOtpInput } from './components/AppOtpInput.jsx';
33
36
  export { default as AppPageHeader } from './components/AppPageHeader.jsx';
34
37
  export { default as AppPhoneNumberInput } from './components/AppPhoneNumberInput.jsx';
38
+ export { default as AppPopover } from './components/AppPopover.jsx';
35
39
  export { default as AppPricingCard } from './components/AppPricingCard.jsx';
40
+ export { default as AppProgress } from './components/AppProgress.jsx';
36
41
  export { default as AppRadio } from './components/AppRadio.jsx';
37
42
  export { default as AppRepeater } from './components/AppRepeater.jsx';
38
43
  export { default as AppResourceCard } from './components/AppResourceCard.jsx';