@webority/ui-react 0.9.12 → 0.9.14
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/AppActionIcon.d.ts +15 -7
- package/dist/types/components/AppAvatar.d.ts +6 -2
- package/dist/types/components/AppBadge.d.ts +6 -2
- package/dist/types/components/AppButton.d.ts +4 -2
- package/dist/types/components/AppCopyButton.d.ts +6 -2
- package/dist/types/components/AppIcon.d.ts +7 -5
- package/dist/types/components/AppLink.d.ts +14 -0
- package/dist/types/components/AppStatusBadge.d.ts +4 -2
- package/dist/types/components/AppTabs.d.ts +21 -5
- package/dist/types/components/AppTooltip.d.ts +4 -3
- package/dist/types/components/withTooltip.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/ui-react.js +2296 -2172
- package/package.json +3 -3
|
@@ -4,23 +4,31 @@
|
|
|
4
4
|
* hover tint and disabled state come from the design system rather than each
|
|
5
5
|
* screen re-inventing a bare icon button.
|
|
6
6
|
*
|
|
7
|
-
* `label` is required: an icon-only control with no accessible name is
|
|
8
|
-
*
|
|
7
|
+
* `label` is required: an icon-only control with no accessible name is unusable with a screen
|
|
8
|
+
* reader, and it doubles as the hover/focus tooltip — shown through `AppTooltip` (Popper), so it
|
|
9
|
+
* is collision-aware: it prefers `tooltipPlacement` and flips to stay on-screen.
|
|
9
10
|
*
|
|
10
11
|
* @param {object} props
|
|
11
12
|
* @param {string|import('react').ReactNode} props.icon glyph name (see Icon), or a custom node (e.g. an iconsax glyph)
|
|
12
|
-
* @param {string} props.label accessible name + tooltip
|
|
13
|
+
* @param {string} props.label accessible name + collision-aware hover/focus tooltip
|
|
14
|
+
* @param {'auto'|'top'|'bottom'|'start'|'end'} [props.tooltipPlacement='auto'] which side the
|
|
15
|
+
* tooltip prefers. `auto` (default) lets Popper pick the side with the most room; a named side
|
|
16
|
+
* is preferred but still flips to stay in view. Powered by `AppTooltip`, so it never clips.
|
|
13
17
|
* @param {boolean} [props.danger] destructive tint
|
|
14
18
|
* @param {boolean} [props.disabled]
|
|
15
|
-
* @param {number} [props.size=20]
|
|
19
|
+
* @param {number} [props.size=20] glyph size in px; the disc (and its hover tint) scales with it, keeping a constant 8px ring
|
|
16
20
|
* @param {() => void} [props.onClick]
|
|
17
21
|
* @param {string} [props.className]
|
|
18
|
-
* @param {React.ElementType} [props.as] render as something else — a router `Link`, `"a"`.
|
|
22
|
+
* @param {React.ElementType} [props.as] render as something else — a router `Link`, `"a"`. When a
|
|
23
|
+
* `label` is set the control is the tooltip trigger, so `as` must FORWARD A REF to its DOM node
|
|
24
|
+
* for the tooltip (Popper) to anchor correctly — router `Link`s already do; a hand-rolled `as`
|
|
25
|
+
* wrapper must use `forwardRef` (the tooltip still opens without it, but may be mispositioned).
|
|
19
26
|
* @param {string} [props.href] sets an anchor without needing `as`.
|
|
20
27
|
*/
|
|
21
|
-
export default function AppActionIcon({ icon, label, danger, disabled, size, onClick, className, as, href, ...rest }: {
|
|
28
|
+
export default function AppActionIcon({ icon, label, tooltipPlacement, danger, disabled, size, onClick, className, as, href, ...rest }: {
|
|
22
29
|
icon: string | import('react').ReactNode;
|
|
23
30
|
label: string;
|
|
31
|
+
tooltipPlacement?: 'auto' | 'top' | 'bottom' | 'start' | 'end';
|
|
24
32
|
danger?: boolean;
|
|
25
33
|
disabled?: boolean;
|
|
26
34
|
size?: number;
|
|
@@ -28,4 +36,4 @@ export default function AppActionIcon({ icon, label, danger, disabled, size, onC
|
|
|
28
36
|
className?: string;
|
|
29
37
|
as?: React.ElementType;
|
|
30
38
|
href?: string;
|
|
31
|
-
}):
|
|
39
|
+
}): any;
|
|
@@ -15,9 +15,11 @@
|
|
|
15
15
|
* @param {string} [props.href] Makes the avatar a link.
|
|
16
16
|
* @param {(e) => void} [props.onClick] Makes the avatar a button (when no href).
|
|
17
17
|
* @param {import('react').ElementType} [props.linkComponent] Router link; receives `to` instead of `href`.
|
|
18
|
+
* @param {string} [props.tooltip] A collision-aware hover/focus tooltip (via AppTooltip / Popper) — flips to stay on-screen. Distinct from `label`, which is the fixed CSS bubble.
|
|
19
|
+
* @param {"auto"|"top"|"bottom"|"start"|"end"} [props.tooltipPlacement="auto"] Preferred tooltip side; `auto` picks the side with the most room.
|
|
18
20
|
* @param {string} [props.className]
|
|
19
21
|
*/
|
|
20
|
-
export default function AppAvatar({ name, src, size, shape, tone, status, ring, label, icon, badge, href, onClick, linkComponent: Link, className, ...rest }: {
|
|
22
|
+
export default function AppAvatar({ name, src, size, shape, tone, status, ring, label, icon, badge, href, onClick, linkComponent: Link, tooltip, tooltipPlacement, className, ...rest }: {
|
|
21
23
|
name?: string;
|
|
22
24
|
src?: string;
|
|
23
25
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | number | string;
|
|
@@ -31,5 +33,7 @@ export default function AppAvatar({ name, src, size, shape, tone, status, ring,
|
|
|
31
33
|
href?: string;
|
|
32
34
|
onClick?: (e: any) => void;
|
|
33
35
|
linkComponent?: import('react').ElementType;
|
|
36
|
+
tooltip?: string;
|
|
37
|
+
tooltipPlacement?: "auto" | "top" | "bottom" | "start" | "end";
|
|
34
38
|
className?: string;
|
|
35
|
-
}):
|
|
39
|
+
}): any;
|
|
@@ -9,11 +9,15 @@
|
|
|
9
9
|
* @param {import('react').ReactNode} props.children
|
|
10
10
|
* @param {"neutral"|"primary"|"success"|"warning"|"danger"|"info"} [props.tone]
|
|
11
11
|
* @param {boolean} [props.dot=false]
|
|
12
|
+
* @param {string} [props.tooltip] A collision-aware hover/focus tooltip (via AppTooltip / Popper) — flips to stay on-screen.
|
|
13
|
+
* @param {"auto"|"top"|"bottom"|"start"|"end"} [props.tooltipPlacement="auto"] Preferred tooltip side; `auto` picks the side with the most room.
|
|
12
14
|
* @param {string} [props.className]
|
|
13
15
|
*/
|
|
14
|
-
export default function AppBadge({ children, tone, dot, className, ...rest }: {
|
|
16
|
+
export default function AppBadge({ children, tone, dot, tooltip, tooltipPlacement, className, ...rest }: {
|
|
15
17
|
children: import('react').ReactNode;
|
|
16
18
|
tone?: "neutral" | "primary" | "success" | "warning" | "danger" | "info";
|
|
17
19
|
dot?: boolean;
|
|
20
|
+
tooltip?: string;
|
|
21
|
+
tooltipPlacement?: "auto" | "top" | "bottom" | "start" | "end";
|
|
18
22
|
className?: string;
|
|
19
|
-
}):
|
|
23
|
+
}): any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export default function AppButton({ children, variant, size, type, loading, disabled, block, leftIcon, rightIcon, href, static: isStatic, className, ...rest }: {
|
|
1
|
+
export default function AppButton({ children, variant, size, type, loading, disabled, block, leftIcon, rightIcon, href, static: isStatic, tooltip, tooltipPlacement, className, ...rest }: {
|
|
2
2
|
[x: string]: any;
|
|
3
3
|
block?: boolean;
|
|
4
4
|
children: any;
|
|
@@ -10,6 +10,8 @@ export default function AppButton({ children, variant, size, type, loading, disa
|
|
|
10
10
|
rightIcon?: any;
|
|
11
11
|
size?: string;
|
|
12
12
|
static?: boolean;
|
|
13
|
+
tooltip: any;
|
|
14
|
+
tooltipPlacement: any;
|
|
13
15
|
type?: string;
|
|
14
16
|
variant?: string;
|
|
15
|
-
}):
|
|
17
|
+
}): any;
|
|
@@ -14,8 +14,10 @@
|
|
|
14
14
|
* @param {"ghost"|"outline"|"secondary"|"light"} [props.variant="ghost"] Button variant
|
|
15
15
|
* @param {() => void} [props.onCopied] Callback fired on successful copy
|
|
16
16
|
* @param {string} [props.className] Custom className
|
|
17
|
+
* @param {string} [props.tooltip] A collision-aware hover/focus tooltip (via AppTooltip / Popper) — flips to stay on-screen.
|
|
18
|
+
* @param {"auto"|"top"|"bottom"|"start"|"end"} [props.tooltipPlacement="auto"] Preferred tooltip side; `auto` picks the side with the most room.
|
|
17
19
|
*/
|
|
18
|
-
export default function AppCopyButton({ text, label, copiedLabel, iconOnly, size, variant, onCopied, className, ...rest }: {
|
|
20
|
+
export default function AppCopyButton({ text, label, copiedLabel, iconOnly, size, variant, onCopied, className, tooltip, tooltipPlacement, ...rest }: {
|
|
19
21
|
text: string;
|
|
20
22
|
label?: string;
|
|
21
23
|
copiedLabel?: string;
|
|
@@ -24,4 +26,6 @@ export default function AppCopyButton({ text, label, copiedLabel, iconOnly, size
|
|
|
24
26
|
variant?: "ghost" | "outline" | "secondary" | "light";
|
|
25
27
|
onCopied?: () => void;
|
|
26
28
|
className?: string;
|
|
27
|
-
|
|
29
|
+
tooltip?: string;
|
|
30
|
+
tooltipPlacement?: "auto" | "top" | "bottom" | "start" | "end";
|
|
31
|
+
}): any;
|
|
@@ -28,19 +28,21 @@ export declare function registerIcons(map: Record<string, (props: {
|
|
|
28
28
|
* @param {string} props.name Icon name (kebab-case; curated or full-catalogue).
|
|
29
29
|
* @param {number} [props.size=16]
|
|
30
30
|
* @param {'linear'|'outline'|'bold'|'bulk'|'broken'|'twotone'} [props.variant]
|
|
31
|
-
* @param {string} [props.tooltip] A hover/focus tooltip
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
31
|
+
* @param {string} [props.tooltip] A collision-aware hover/focus tooltip (via `AppTooltip` / Popper)
|
|
32
|
+
* that flips to stay on-screen. The glyph is wrapped in a `role="img"` + `aria-label` span so the
|
|
33
|
+
* icon is also named for assistive tech.
|
|
34
|
+
* @param {'auto'|'top'|'bottom'|'start'|'end'} [props.tooltipPlacement='auto'] Preferred tooltip
|
|
35
|
+
* side; `auto` picks the side with the most room.
|
|
35
36
|
* @param {string} [props.className]
|
|
36
37
|
* @param {string} [props.color]
|
|
37
38
|
* @param {object} [props.style]
|
|
38
39
|
*/
|
|
39
|
-
export default function AppIcon({ name, size, variant, tooltip, className, color, style, ...rest }: {
|
|
40
|
+
export default function AppIcon({ name, size, variant, tooltip, tooltipPlacement, className, color, style, ...rest }: {
|
|
40
41
|
name: string;
|
|
41
42
|
size?: number;
|
|
42
43
|
variant?: 'linear' | 'outline' | 'bold' | 'bulk' | 'broken' | 'twotone';
|
|
43
44
|
tooltip?: string;
|
|
45
|
+
tooltipPlacement?: 'auto' | 'top' | 'bottom' | 'start' | 'end';
|
|
44
46
|
className?: string;
|
|
45
47
|
color?: string;
|
|
46
48
|
style?: object;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export default function AppLink({ children, label, href, animation, leftIcon, rightIcon, size, external, disabled, linkComponent: Link, className, ...rest }: {
|
|
2
|
+
[x: string]: any;
|
|
3
|
+
animation?: string;
|
|
4
|
+
children: any;
|
|
5
|
+
className?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
external?: boolean;
|
|
8
|
+
href: any;
|
|
9
|
+
label: any;
|
|
10
|
+
leftIcon?: any;
|
|
11
|
+
linkComponent: any;
|
|
12
|
+
rightIcon?: any;
|
|
13
|
+
size?: string;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
export default function AppStatusBadge({ label, tone, className, ...rest }: {
|
|
1
|
+
export default function AppStatusBadge({ label, tone, className, tooltip, tooltipPlacement, ...rest }: {
|
|
2
2
|
[x: string]: any;
|
|
3
3
|
className?: string;
|
|
4
4
|
label: any;
|
|
5
5
|
tone?: string;
|
|
6
|
-
|
|
6
|
+
tooltip: any;
|
|
7
|
+
tooltipPlacement: any;
|
|
8
|
+
}): any;
|
|
@@ -13,14 +13,25 @@
|
|
|
13
13
|
* roam the strip skipping disabled tabs. `activation="automatic"` (default) selects as
|
|
14
14
|
* focus moves; `activation="manual"` moves focus only and selects on Enter/Space.
|
|
15
15
|
*
|
|
16
|
+
* A tab becomes a real link when it carries `href` or `to`: it renders as an `<a>` (or the
|
|
17
|
+
* given `linkComponent` for a `to`) instead of a `<button>`, so the browser gives right-click
|
|
18
|
+
* "Open in new tab", Ctrl/⌘-click and middle-click for free — the standard, accessible way to
|
|
19
|
+
* open a tab on the next screen. `target="_blank"` opens it there on a plain click too (and
|
|
20
|
+
* gets `rel="noopener noreferrer"` unless the tab sets its own `rel`). A plain left-click still
|
|
21
|
+
* calls `onChange`; a modified click (new tab/window) does not, so the current selection is
|
|
22
|
+
* left untouched. Link tabs make `onChange` optional — selection usually follows the route the
|
|
23
|
+
* caller passes as `value`.
|
|
24
|
+
*
|
|
16
25
|
* @param {object} props
|
|
17
|
-
* @param {{ key: string, label: import('react').ReactNode, count?: number, tone?: string, icon?: string|import('react').ReactNode, image?: string, imageAlt?: string, tooltip?: import('react').ReactNode, danger?: boolean, disabled?: boolean }[]} props.tabs
|
|
26
|
+
* @param {{ key: string, label: import('react').ReactNode, count?: number, tone?: string, icon?: string|import('react').ReactNode, image?: string, imageAlt?: string, tooltip?: import('react').ReactNode, danger?: boolean, disabled?: boolean, href?: string, to?: string, target?: string, rel?: string }[]} props.tabs
|
|
18
27
|
* `icon` is a Bootstrap-Icons name OR a custom node (e.g. an iconsax glyph); `image` is a
|
|
19
28
|
* picture URL (logo/avatar) rendered before the label — `image` wins over `icon`. `tooltip`
|
|
20
29
|
* is a hover/focus hint (text or node) shown on the tab via AppTooltip — the same branded
|
|
21
|
-
* tip the Razor `<app-tab tooltip="…">` renders.
|
|
30
|
+
* tip the Razor `<app-tab tooltip="…">` renders. `href`/`to` turn the tab into a link (see
|
|
31
|
+
* above); `target`/`rel` are the standard anchor attributes on such a tab.
|
|
22
32
|
* @param {string} props.value Selected tab key.
|
|
23
|
-
* @param {(key: string) => void} props.onChange
|
|
33
|
+
* @param {(key: string) => void} [props.onChange] Optional for link tabs; required for panel tabs.
|
|
34
|
+
* @param {import('react').ElementType} [props.linkComponent] Component for `to` tabs (e.g. react-router's Link). The library never imports a router.
|
|
24
35
|
* @param {"underline"|"pills"} [props.variant="underline"]
|
|
25
36
|
* @param {"horizontal"|"vertical"} [props.orientation="horizontal"] Vertical renders a side rail.
|
|
26
37
|
* @param {"sm"|"md"|"lg"} [props.size="md"]
|
|
@@ -31,7 +42,7 @@
|
|
|
31
42
|
* @param {import('react').CSSProperties} [props.style]
|
|
32
43
|
* @param {"success"|"warning"|"danger"|"info"} [props.tone] Per-tab count-pill tint (set as `tabs[].tone`).
|
|
33
44
|
*/
|
|
34
|
-
export default function AppTabs({ tabs, value, onChange, variant, orientation, size, fitted, activation, ariaLabel, className, style, ...rest }: {
|
|
45
|
+
export default function AppTabs({ tabs, value, onChange, linkComponent, variant, orientation, size, fitted, activation, ariaLabel, className, style, ...rest }: {
|
|
35
46
|
tabs: {
|
|
36
47
|
key: string;
|
|
37
48
|
label: import('react').ReactNode;
|
|
@@ -43,9 +54,14 @@ export default function AppTabs({ tabs, value, onChange, variant, orientation, s
|
|
|
43
54
|
tooltip?: import('react').ReactNode;
|
|
44
55
|
danger?: boolean;
|
|
45
56
|
disabled?: boolean;
|
|
57
|
+
href?: string;
|
|
58
|
+
to?: string;
|
|
59
|
+
target?: string;
|
|
60
|
+
rel?: string;
|
|
46
61
|
}[];
|
|
47
62
|
value: string;
|
|
48
|
-
onChange
|
|
63
|
+
onChange?: (key: string) => void;
|
|
64
|
+
linkComponent?: import('react').ElementType;
|
|
49
65
|
variant?: "underline" | "pills";
|
|
50
66
|
orientation?: "horizontal" | "vertical";
|
|
51
67
|
size?: "sm" | "md" | "lg";
|
|
@@ -9,8 +9,9 @@
|
|
|
9
9
|
* @param {import('react').ReactElement} props.children A single trigger element that forwards
|
|
10
10
|
* a ref (a DOM element, or a react-bootstrap-based App* like AppButton/AppActionIcon). It
|
|
11
11
|
* renders as written; hovering or focusing it reveals the tooltip.
|
|
12
|
-
* @param {'top'|'bottom'|'start'|'end'} [props.placement='top'] Where the tooltip appears
|
|
13
|
-
*
|
|
12
|
+
* @param {'auto'|'top'|'bottom'|'start'|'end'} [props.placement='top'] Where the tooltip appears.
|
|
13
|
+
* A named side is preferred but flips if needed to stay in view; `auto` lets Popper pick the
|
|
14
|
+
* side with the most room outright. Either way the tooltip never clips off-screen.
|
|
14
15
|
* @param {'default'|'dark'|'primary'|'success'|'warning'|'danger'} [props.tone='default'] Preset
|
|
15
16
|
* colour of the tooltip. `default` is the light surface look; the others are solid tints. For
|
|
16
17
|
* a fully custom colour, pass a `className` whose rule sets the `--wui-tooltip-bg` /
|
|
@@ -23,7 +24,7 @@
|
|
|
23
24
|
export default function AppTooltip({ content, children, placement, tone, size, className, ...rest }: {
|
|
24
25
|
content: import('react').ReactNode;
|
|
25
26
|
children: import('react').ReactElement;
|
|
26
|
-
placement?: 'top' | 'bottom' | 'start' | 'end';
|
|
27
|
+
placement?: 'auto' | 'top' | 'bottom' | 'start' | 'end';
|
|
27
28
|
tone?: 'default' | 'dark' | 'primary' | 'success' | 'warning' | 'danger';
|
|
28
29
|
size?: 'sm' | 'md' | 'lg';
|
|
29
30
|
className?: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function withTooltip(element: any, tooltip: any, placement: any): any;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ export { default as AppInfoList } from "./components/AppInfoList.jsx";
|
|
|
37
37
|
export { default as AppInfoTip } from "./components/AppInfoTip.jsx";
|
|
38
38
|
export { default as AppInput } from "./components/AppInput.jsx";
|
|
39
39
|
export { default as AppKpiTile } from "./components/AppKpiTile.jsx";
|
|
40
|
+
export { default as AppLink } from "./components/AppLink.jsx";
|
|
40
41
|
export { default as AppLogoPicker } from "./components/AppLogoPicker.jsx";
|
|
41
42
|
export { default as AppMeter } from "./components/AppMeter.jsx";
|
|
42
43
|
export { default as AppModal } from "./components/AppModal.jsx";
|