@webority/ui-react 0.7.2 → 0.7.4

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.
@@ -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;
@@ -14,7 +14,8 @@ import '@webority/ui-elements';
14
14
  * argument reports whether the commit was a freeform entry (`allowCustom`) rather than a
15
15
  * listed option — existing callers reading only the first argument are unaffected.
16
16
  * @param {{value: string, label: string}[]} [props.options] Static options.
17
- * @param {(query: string) => Promise<{value: string, label: string}[]>} [props.loadOptions] Remote loader.
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).
18
19
  * @param {string} [props.placeholder]
19
20
  * @param {number} [props.minChars] Min chars before a remote search fires (default 1 in remote mode).
20
21
  * @param {number} [props.debounce] Debounce ms for remote search (default 250).
@@ -40,7 +41,9 @@ export default function AppAutocomplete({ value, onChange, options, loadOptions,
40
41
  value: string;
41
42
  label: string;
42
43
  }[];
43
- loadOptions?: (query: string) => Promise<{
44
+ loadOptions?: (query: string, opts?: {
45
+ signal?: AbortSignal;
46
+ }) => Promise<{
44
47
  value: string;
45
48
  label: string;
46
49
  }[]>;
@@ -7,13 +7,13 @@
7
7
  *
8
8
  * @param {object} props
9
9
  * @param {import('react').ReactNode} props.children
10
- * @param {"primary"|"success"|"warn"|"danger"|"info"} [props.tone]
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" | "warn" | "danger" | "info";
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;
@@ -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 (TASK-06077).
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]
@@ -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;
@@ -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 Bootstrap Icons name for the bubble
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;
@@ -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>>;
@@ -5,21 +5,33 @@
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
+ * @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
- icon?: string;
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,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;
@@ -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;
@@ -20,8 +20,10 @@
20
20
  * @param {'prev-next'|'numbered'} [props.mode='prev-next'] prev-next (default) is the arrows-
21
21
  * only nav above. numbered inserts windowed page buttons — first/last plus an ellipsis over
22
22
  * any run of hidden pages — between the arrows.
23
+ * @param {boolean} [props.showPageSize=true] Show the "Rows per page" selector. Set false for a
24
+ * compact pager that pages but doesn't expose page size (e.g. a dense numbered table).
23
25
  */
24
- export default function AppTablePagination({ page, totalPages, pageSize, total, firstRow, lastRow, onPageChange, onPageSizeChange, pageSizes, mode, ...rest }: {
26
+ export default function AppTablePagination({ page, totalPages, pageSize, total, firstRow, lastRow, onPageChange, onPageSizeChange, pageSizes, mode, showPageSize, ...rest }: {
25
27
  page: number;
26
28
  totalPages: number;
27
29
  pageSize: number;
@@ -32,4 +34,5 @@ export default function AppTablePagination({ page, totalPages, pageSize, total,
32
34
  onPageSizeChange: (size: number) => void;
33
35
  pageSizes?: number[];
34
36
  mode?: 'prev-next' | 'numbered';
37
+ showPageSize?: boolean;
35
38
  }): import("react").JSX.Element;
@@ -1,22 +1,33 @@
1
1
  /**
2
- * Shared tab strip (.app-tabs). Keyboard: Arrow / Home / End.
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
- * React drives the strip as a controlled component (`value` + `onChange`, panels
5
- * are the caller's); Razor's <app-tabs> additionally renders Bootstrap panels
6
- * from its children. The strip markup is the same on both, so they look alike.
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] Tone tint for a tab's count
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 @@
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;
@@ -32,6 +32,7 @@ export { default as AppMultiSelect } from './components/AppMultiSelect.jsx';
32
32
  export { default as AppOtpInput } from './components/AppOtpInput.jsx';
33
33
  export { default as AppPageHeader } from './components/AppPageHeader.jsx';
34
34
  export { default as AppPhoneNumberInput } from './components/AppPhoneNumberInput.jsx';
35
+ export { default as AppPopover } from './components/AppPopover.jsx';
35
36
  export { default as AppPricingCard } from './components/AppPricingCard.jsx';
36
37
  export { default as AppRadio } from './components/AppRadio.jsx';
37
38
  export { default as AppRepeater } from './components/AppRepeater.jsx';