@webority/ui-react 0.7.9 → 0.8.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.
@@ -18,9 +18,12 @@
18
18
  * @param {import('react').ReactNode} props.children
19
19
  * @param {"default"|"elevated"|"outlined"|"muted"|"accent"} [props.variant="default"]
20
20
  * @param {"primary"|"success"|"warning"|"danger"|"info"} [props.tone="primary"] Colours the `accent` stripe.
21
- * @param {"none"|"sm"|"md"|"lg"} [props.padding="md"] Header/body/footer padding.
21
+ * @param {"none"|"sm"|"md"|"lg"} [props.padding="md"] Header/body/footer padding preset. The
22
+ * default (md) is a uniform 20px; for an arbitrary inset, add a class (see `className`) that
23
+ * sets the `--wui-card-pad` token instead of using this preset scale.
22
24
  * @param {"xs"|"sm"|"md"|"lg"|number|string} [props.maxWidth] Cap + centre a standalone card.
23
- * @param {string} [props.className]
25
+ * @param {string} [props.className] Extra classes on the `.card` root — the padding hook: a class
26
+ * here can set `--wui-card-pad` to retune the inset (the Razor counterpart is a plain `class`).
24
27
  * @param {string} [props.bodyClassName]
25
28
  * @param {string} [props.headerClassName]
26
29
  * @param {boolean} [props.body=true] Wrap children in `.card-body`. False for a flush card.
@@ -16,7 +16,10 @@
16
16
  * @param {string} [props.rowActionsLabel]
17
17
  * @param {object} [props.pagination]
18
18
  * @param {string} [props.ariaLabel]
19
- * @param {string} [props.className]
19
+ * @param {string} [props.className] Extra classes on the <table> (column/table styling).
20
+ * @param {string} [props.wrapperClassName] Extra classes on the `.table-wrap` outer div — the
21
+ * padding hook. Manage the table's inset from here (e.g. a class that sets `--wui-table-pad`);
22
+ * the Razor counterpart is a plain `class` on `<app-data-table>`.
20
23
  * @param {boolean} [props.selectable=false] Render a leading checkbox column.
21
24
  * @param {Set<string|number>} [props.selectedIds] Currently selected row keys.
22
25
  * @param {(id: string|number) => void} [props.onToggleRow]
@@ -24,7 +27,7 @@
24
27
  * @param {(row: object) => import('react').ReactNode} [props.renderExpanded] When given, each row
25
28
  * gets a leading expand toggle; the returned content renders in a full-width row beneath it.
26
29
  */
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 }: {
30
+ export default function AppDataTable({ columns, rows, rowKey, sort, onSort, loading, skeletonRows, empty, emptyFiltered, sourceCount, rowActions, rowActionsLabel, pagination, ariaLabel, className, wrapperClassName, selectable, selectedIds, onToggleRow, onToggleAll, renderExpanded, ...rest }: {
28
31
  columns: object[];
29
32
  rows: object[];
30
33
  rowKey?: (row: object, index: number) => string | number;
@@ -43,6 +46,7 @@ export default function AppDataTable({ columns, rows, rowKey, sort, onSort, load
43
46
  pagination?: object;
44
47
  ariaLabel?: string;
45
48
  className?: string;
49
+ wrapperClassName?: string;
46
50
  selectable?: boolean;
47
51
  selectedIds?: Set<string | number>;
48
52
  onToggleRow?: (id: string | number) => void;
@@ -0,0 +1,42 @@
1
+ import '@webority/ui-elements';
2
+ /**
3
+ * A macOS-style floating dock — a pill of icon links whose items magnify as the pointer
4
+ * approaches them. Marketing / landing-page chrome, not a replacement for `AppShell`
5
+ * primary navigation.
6
+ *
7
+ * Wraps the shared `<wui-dock>` element, which owns the pointer-tracking magnification
8
+ * and turns itself off on coarse pointers and under `prefers-reduced-motion` — so the
9
+ * dock is a plain, fully usable icon row wherever the effect would misbehave. Every item
10
+ * is a real link (or button) with an accessible name; the visible tooltip is decorative.
11
+ *
12
+ * Router-decoupled like AppBreadcrumbs: an item with `to` renders through `linkComponent`
13
+ * when one is provided, otherwise a plain `<a href>`. An item with `onClick` and no
14
+ * href/to renders a `<button>`. The library never imports a router.
15
+ *
16
+ * @param {object} props
17
+ * @param {{ key?: string, title: string, icon: string|import('react').ReactNode,
18
+ * href?: string, to?: string, onClick?: () => void }[]} props.items The dock items,
19
+ * left to right. `title` is the accessible name and the hover tooltip.
20
+ * @param {import('react').ElementType} [props.linkComponent] Component for `to` items (e.g. Link).
21
+ * @param {string} [props.ariaLabel='Quick navigation'] Accessible name for the dock landmark.
22
+ * @param {boolean} [props.magnify=true] Set false to render a static dock (no hover effect).
23
+ * @param {number} [props.maxScale] Item scale at cursor center (element default 1.6).
24
+ * @param {number} [props.radius] Px falloff distance for the magnification (element default 100).
25
+ * @param {string} [props.className]
26
+ */
27
+ export default function AppFloatingDock({ items, linkComponent, ariaLabel, magnify, maxScale, radius, className, ...rest }: {
28
+ items: {
29
+ key?: string;
30
+ title: string;
31
+ icon: string | import('react').ReactNode;
32
+ href?: string;
33
+ to?: string;
34
+ onClick?: () => void;
35
+ }[];
36
+ linkComponent?: import('react').ElementType;
37
+ ariaLabel?: string;
38
+ magnify?: boolean;
39
+ maxScale?: number;
40
+ radius?: number;
41
+ className?: string;
42
+ }): import("react").JSX.Element;
@@ -5,35 +5,50 @@
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 {import('react').ReactNode} [props.caption] A sub-line under the value (e.g. "Total sent").
8
9
  * @param {string|import('react').ReactNode} [props.icon] Icon name for the leading tile, or a custom node.
9
10
  * @param {'primary'|'success'|'warning'|'danger'|'info'|'neutral'} [props.iconTone] Tints the icon chip.
10
11
  * @param {import('react').ReactNode} [props.delta] Change text, e.g. "12% vs last month".
11
12
  * @param {'up'|'down'|'flat'} [props.deltaDirection] Colours the delta and picks its arrow. Omitted →
12
13
  * inferred from a leading "+"/"-" on `delta` (falls back to 'flat').
13
14
  * @param {number[]} [props.sparkline] A trend series rendered as a small inline chart.
14
- * @param {'plain'|'filled'|'accent'} [props.variant='plain'] The tile surface: plain (today's
15
- * bordered card), filled (a subtle surface fill), accent (a brand-tinted fill).
15
+ * @param {'plain'|'filled'|'accent'|'spotlight'} [props.variant='plain'] The tile surface/layout:
16
+ * plain (today's bordered card), filled (a subtle surface fill), accent (a brand-tinted fill),
17
+ * spotlight (editorial feature tile — icon pinned top-right, serif value, caption below).
16
18
  * @param {'md'|'lg'} [props.size='md'] Tile scale: md (default), lg (a hero tile with an
17
19
  * enlarged value — for the single headline stat above a dashboard).
18
20
  * @param {boolean} [props.inline=false] Put the icon beside the text instead of above it.
19
21
  * @param {boolean} [props.attention=false] Marks the tile as needing action (warning-tinted).
20
22
  * @param {string} [props.href] Renders the whole tile as a link to this URL.
21
23
  * @param {import('react').ElementType} [props.linkComponent] Router link; receives `to` instead of `href`.
22
- * @param {string} [props.className]
24
+ * @param {string} [props.className] Extra class(es) on the tile root.
25
+ * @param {string} [props.iconClassName] Extra class(es) on the icon chip.
26
+ * @param {string} [props.labelClassName] Extra class(es) on the label.
27
+ * @param {string} [props.valueClassName] Extra class(es) on the value.
28
+ * @param {string} [props.captionClassName] Extra class(es) on the caption.
29
+ * @param {string} [props.deltaClassName] Extra class(es) on the delta.
30
+ * @param {string} [props.sparklineClassName] Extra class(es) on the sparkline.
23
31
  */
24
- export default function AppKpiTile({ label, value, icon, iconTone, delta, deltaDirection, sparkline, variant, size, inline, attention, href, linkComponent: Link, className, ...rest }: {
32
+ export default function AppKpiTile({ label, value, caption, icon, iconTone, delta, deltaDirection, sparkline, variant, size, inline, attention, href, linkComponent: Link, className, iconClassName, labelClassName, valueClassName, captionClassName, deltaClassName, sparklineClassName, ...rest }: {
25
33
  label: string;
26
34
  value: import('react').ReactNode;
35
+ caption?: import('react').ReactNode;
27
36
  icon?: string | import('react').ReactNode;
28
37
  iconTone?: 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'neutral';
29
38
  delta?: import('react').ReactNode;
30
39
  deltaDirection?: 'up' | 'down' | 'flat';
31
40
  sparkline?: number[];
32
- variant?: 'plain' | 'filled' | 'accent';
41
+ variant?: 'plain' | 'filled' | 'accent' | 'spotlight';
33
42
  size?: 'md' | 'lg';
34
43
  inline?: boolean;
35
44
  attention?: boolean;
36
45
  href?: string;
37
46
  linkComponent?: import('react').ElementType;
38
47
  className?: string;
48
+ iconClassName?: string;
49
+ labelClassName?: string;
50
+ valueClassName?: string;
51
+ captionClassName?: string;
52
+ deltaClassName?: string;
53
+ sparklineClassName?: string;
39
54
  }): import("react").JSX.Element;
@@ -12,8 +12,9 @@
12
12
  * @param {string} [props.name]
13
13
  * @param {string} [props.error] Error message, rendered below the control. Replaces the hint.
14
14
  * @param {string} [props.hint] Helper text below the control. Hidden while an error is shown.
15
- * @param {'pill'|'circle'} [props.shape] Track shape — `pill` (default) is the sliding
16
- * pill; `circle` is a compact round on/off button.
15
+ * @param {'pill'|'circle'|'round'} [props.shape] Track shape — `pill` (default) is the sliding
16
+ * pill (squircle ends); `round` is the same sliding pill with truly circular ends
17
+ * (`corner-shape: round`); `circle` is a compact round on/off button.
17
18
  * @param {string} [props.className]
18
19
  * @param {import('react').Ref<HTMLInputElement>} [ref]
19
20
  */
@@ -1,26 +1,50 @@
1
1
  /**
2
- * A chronological activity feed — an audit trail, a sign-off history, a status log.
3
- * Each entry is a toned dot on a vertical rail, with a title, a timestamp, an
4
- * actor, and an optional free-text note.
2
+ * A chronological activity feed OR a status-progress tracker.
5
3
  *
6
- * The rail is drawn on the list, not per item, so it cannot break into segments
7
- * when an entry wraps to two lines.
4
+ * - `variant="feed"` (default) — an audit trail / sign-off history / status log.
5
+ * Each entry is a toned dot on a continuous vertical rail, with a title, a
6
+ * timestamp, an actor and an optional boxed note.
7
+ * - `variant="progress"` — a status tracker for a fixed sequence of stages
8
+ * (e.g. Initiated → Submitted → Approved → Sanctioned → Disbursed). Each step
9
+ * shows a solid status dot (done/current/on-hold/rejected/cancelled/skipped)
10
+ * or a hollow ring (upcoming); the rail is drawn per segment so the path
11
+ * between two completed steps reads as filled. The timestamp is pinned to the
12
+ * top-right of the step.
13
+ *
14
+ * The rail is drawn so it cannot break into disconnected segments when an entry
15
+ * wraps to two lines — the failure that makes most hand-rolled timelines look
16
+ * broken with real data.
8
17
  *
9
18
  * @param {object} props
10
- * @param {{ key?: string, icon?: string, tone?: 'neutral'|'success'|'warning'|'danger'|'info',
11
- * title: import('react').ReactNode, at?: string, by?: string, note?: string }[]} props.items
12
- * Newest first — a reader scanning an audit trail expects the latest event at the top.
19
+ * @param {{ key?: string, icon?: string,
20
+ * tone?: 'neutral'|'success'|'warning'|'danger'|'info',
21
+ * status?: 'upcoming'|'current'|'done'|'on-hold'|'rejected'|'cancelled'|'skipped',
22
+ * title: import('react').ReactNode, description?: import('react').ReactNode,
23
+ * at?: string, by?: string, note?: string }[]} props.items
24
+ * Feed variant: newest first. Progress variant: first stage first.
25
+ * `status` drives the dot + rail in the progress variant; `description` is a
26
+ * plain inline subtext under the title (distinct from the boxed `note`).
27
+ * @param {'feed'|'progress'} [props.variant] Layout mode. Defaults to `feed`.
28
+ * @param {number} [props.size] Dot diameter in px (default 24). The rail, halo
29
+ * and glyph scale from it, so the whole timeline grows/shrinks in proportion.
13
30
  * @param {string} [props.className]
31
+ * @param {import('react').CSSProperties} [props.style] Inline style on the list;
32
+ * the `size` var is merged into it.
14
33
  */
15
- export default function AppTimeline({ items, className, ...rest }: {
34
+ export default function AppTimeline({ items, variant, size, className, style, ...rest }: {
16
35
  items: {
17
36
  key?: string;
18
37
  icon?: string;
19
38
  tone?: 'neutral' | 'success' | 'warning' | 'danger' | 'info';
39
+ status?: 'upcoming' | 'current' | 'done' | 'on-hold' | 'rejected' | 'cancelled' | 'skipped';
20
40
  title: import('react').ReactNode;
41
+ description?: import('react').ReactNode;
21
42
  at?: string;
22
43
  by?: string;
23
44
  note?: string;
24
45
  }[];
46
+ variant?: 'feed' | 'progress';
47
+ size?: number;
25
48
  className?: string;
49
+ style?: import('react').CSSProperties;
26
50
  }): import("react").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Mounts once near the app root and renders whatever toast()/errorToast() raise — surface cards
3
- * with a variant accent + icon, an auto-dismiss progress bar (pauses on hover/focus), and
3
+ * with a variant icon, a quiet auto-dismiss (the invisible countdown pauses on hover/focus), and
4
4
  * swipe-to-dismiss. There is no toast library; the look is Bootstrap utilities + the shared theme.
5
5
  * The Razor counterpart is <app-toast> + WUI.toast, kept structurally identical.
6
6
  *
@@ -10,8 +10,20 @@
10
10
  * @param {object} props
11
11
  * @param {'top-start'|'top-center'|'top-end'|'middle-center'|'bottom-start'|'bottom-center'|'bottom-end'} [props.position='bottom-end']
12
12
  * @param {number} [props.maxVisible=4] Most toasts shown at once; older ones collapse to a "+N more" chip.
13
+ * @param {'rise'|'organic'|'jelly'|'spring'} [props.animation='rise'] Default entrance motion for
14
+ * every toast: `rise` (soft fade + lift), `organic` (surface materializes, status icon grows
15
+ * from a dot, message trails in), `jelly` (squash-and-stretch drop), `spring` (elastic
16
+ * slide-up). A per-toast `animation` option overrides it.
17
+ * @param {'rounded'|'pill'|'sharp'} [props.shape='rounded'] Default corner treatment; a per-toast
18
+ * `shape` option overrides it.
19
+ * @param {'auto'|'inverse'} [props.surface='auto'] `inverse` renders every toast on the OPPOSITE
20
+ * surface of the active mode — a dark card in light mode, a light card in dark mode — so the
21
+ * stack always contrasts with the page. A per-toast `surface` option overrides it.
13
22
  */
14
- export default function AppToast({ position, maxVisible }: {
23
+ export default function AppToast({ position, maxVisible, animation, shape, surface, }: {
15
24
  position?: 'top-start' | 'top-center' | 'top-end' | 'middle-center' | 'bottom-start' | 'bottom-center' | 'bottom-end';
16
25
  maxVisible?: number;
26
+ animation?: 'rise' | 'organic' | 'jelly' | 'spring';
27
+ shape?: 'rounded' | 'pill' | 'sharp';
28
+ surface?: 'auto' | 'inverse';
17
29
  }): import("react").JSX.Element;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * A Figma-style toolbar — a pill strip of icon tools over a work surface. Exactly one
3
+ * tool is active; the active tool expands to reveal its label, the rest stay icon-only.
4
+ * Optional momentary `actions` render after a divider and just fire — they never stay
5
+ * selected.
6
+ *
7
+ * Not `AppSegmented` (that chooses a form VALUE — view mode, period) and not
8
+ * `AppFloatingDock` (marketing navigation shortcuts): this is action chrome — which
9
+ * TOOL is in hand.
10
+ *
11
+ * Built on real `<input type="radio">` elements inside labels, so arrow-key navigation,
12
+ * the single tab stop, and screen-reader announcements come from the browser — and the
13
+ * Razor `<app-toolbar>` posts the selected tool inside a plain form with no JavaScript.
14
+ * The expand/collapse is pure CSS and honours `prefers-reduced-motion`.
15
+ *
16
+ * Controlled via `value` + `onSelect`, or uncontrolled via `defaultValue`.
17
+ *
18
+ * @param {object} props
19
+ * @param {{ value: string, title: string, icon: string|import('react').ReactNode,
20
+ * disabled?: boolean }[]} props.items The tools, left to right.
21
+ * @param {{ key?: string, title: string, icon: string|import('react').ReactNode,
22
+ * onClick?: () => void, disabled?: boolean }[]} [props.actions] Momentary buttons after
23
+ * a divider — fire and forget, never selected.
24
+ * @param {string} [props.value] The active tool's value (controlled).
25
+ * @param {string} [props.defaultValue] Initially active tool (uncontrolled).
26
+ * @param {(value: string) => void} [props.onSelect]
27
+ * @param {string} props.label Accessible name for the toolbar.
28
+ * @param {string} [props.name] Field name grouping the radios (and what posts in a form).
29
+ * Defaults to a generated one.
30
+ * @param {boolean} [props.disabled=false] Disables the whole toolbar.
31
+ * @param {string} [props.className]
32
+ */
33
+ export default function AppToolbar({ items, actions, value, defaultValue, onSelect, label, name, disabled, className, ...rest }: {
34
+ items: {
35
+ value: string;
36
+ title: string;
37
+ icon: string | import('react').ReactNode;
38
+ disabled?: boolean;
39
+ }[];
40
+ actions?: {
41
+ key?: string;
42
+ title: string;
43
+ icon: string | import('react').ReactNode;
44
+ onClick?: () => void;
45
+ disabled?: boolean;
46
+ }[];
47
+ value?: string;
48
+ defaultValue?: string;
49
+ onSelect?: (value: string) => void;
50
+ label: string;
51
+ name?: string;
52
+ disabled?: boolean;
53
+ className?: string;
54
+ }): import("react").JSX.Element;
@@ -21,6 +21,7 @@ import '@webority/ui-elements';
21
21
  * @param {'steps'|'journey'|'icons'} [props.variant='steps'] Stepper header style — compact circles, the wide journey bar, or large connected icon badges with a "STEP n" eyebrow.
22
22
  * @param {'primary'|'success'|'warning'|'danger'|'info'} [props.tone] Recolour the whole stepper accent (active fill, done rail, ring, done tint) to a semantic ramp. Unset keeps the variant's default (primary for steps/journey, success/green for icons). For any other colour, override the `--wui-step-accent` / `--wui-step-soft` CSS variables via `style` or a `className` instead.
23
23
  * @param {'horizontal'|'vertical'} [props.orientation='horizontal']
24
+ * @param {boolean} [props.skippable=false] Show a Skip button on every step (bar the last), without needing per-step `optional`. A per-step `optional` still works on its own.
24
25
  * @param {boolean} [props.nonLinear=false] Allow jumping to any step, not only completed ones.
25
26
  * @param {boolean} [props.hideStepper=false] Hide the progress header.
26
27
  * @param {boolean} [props.disabled=false] Disable all navigation.
@@ -31,10 +31,12 @@
31
31
  * @param {string} [props.createLabel="Create workspace"] Copy for the create row.
32
32
  * @param {boolean} [props.compact=false] Renders the 36px monogram button instead of the full
33
33
  * card — the shape a collapsed rail slot wants. Same menu either way.
34
+ * @param {"sm"|"md"|"lg"} [props.size="md"] Trigger size tier — scales the card (and the compact
35
+ * square), its mark and name. The dropdown menu is unchanged across sizes.
34
36
  * @param {string} [props.ariaLabel] Accessible name for the trigger. Defaults to
35
37
  * "Workspace <name>".
36
38
  */
37
- export default function AppWorkspaceSwitcher({ tenants, currentId, onSelect, menuLabel, footerAction, linkComponent, searchable, onCreate, canCreate, createLabel, compact, ariaLabel, ...rest }: {
39
+ export default function AppWorkspaceSwitcher({ tenants, currentId, onSelect, menuLabel, footerAction, linkComponent, searchable, onCreate, canCreate, createLabel, compact, size, ariaLabel, ...rest }: {
38
40
  tenants?: {
39
41
  id: string;
40
42
  name: string;
@@ -55,5 +57,6 @@ export default function AppWorkspaceSwitcher({ tenants, currentId, onSelect, men
55
57
  canCreate?: boolean;
56
58
  createLabel?: string;
57
59
  compact?: boolean;
60
+ size?: "sm" | "md" | "lg";
58
61
  ariaLabel?: string;
59
62
  }): import("react").JSX.Element;
@@ -27,6 +27,7 @@ export { default as AppDropdown } from './components/AppDropdown.jsx';
27
27
  export { default as AppEmptyState } from './components/AppEmptyState.jsx';
28
28
  export { default as AppFileAttachment } from './components/AppFileAttachment.jsx';
29
29
  export { default as AppFilePicker } from './components/AppFilePicker.jsx';
30
+ export { default as AppFloatingDock } from './components/AppFloatingDock.jsx';
30
31
  export { default as AppFormActions } from './components/AppFormActions.jsx';
31
32
  export { default as AppFormRow } from './components/AppFormRow.jsx';
32
33
  export { default as AppFormSection } from './components/AppFormSection.jsx';
@@ -72,6 +73,7 @@ export { default as AppTextarea } from './components/AppTextarea.jsx';
72
73
  export { default as AppTimeline } from './components/AppTimeline.jsx';
73
74
  export { default as AppTimePicker } from './components/AppTimePicker.jsx';
74
75
  export { default as AppToast, default as AppToastContainer } from './components/AppToast.jsx';
76
+ export { default as AppToolbar } from './components/AppToolbar.jsx';
75
77
  export { default as AppTooltip } from './components/AppTooltip.jsx';
76
78
  export { default as AppWizard } from './components/AppWizard.jsx';
77
79
  export { default as AppWorkspaceSwitcher } from './components/AppWorkspaceSwitcher.jsx';