@webority/ui-react 0.7.9 → 0.8.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.
- package/dist/types/components/AppCard.d.ts +5 -2
- package/dist/types/components/AppDataTable.d.ts +6 -2
- package/dist/types/components/AppFloatingDock.d.ts +42 -0
- package/dist/types/components/AppSwitch.d.ts +3 -2
- package/dist/types/components/AppToast.d.ts +14 -2
- package/dist/types/components/AppToolbar.d.ts +54 -0
- package/dist/types/components/AppWizard.d.ts +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/ui-react.js +822 -603
- package/package.json +3 -3
|
@@ -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;
|
|
@@ -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; `
|
|
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,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
|
|
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.
|
package/dist/types/index.d.ts
CHANGED
|
@@ -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';
|