@webority/ui-react 0.8.1 → 0.8.3

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/README.md CHANGED
@@ -20,4 +20,4 @@ import { AppButton } from '@webority/ui-react';
20
20
  <AppButton variant="primary">Save changes</AppButton>;
21
21
  ```
22
22
 
23
- Component catalogue: <https://ui.webority.dev>
23
+ Component catalogue: <https://ui-react.webority.dev>
@@ -7,19 +7,25 @@
7
7
  * @param {"info"|"success"|"warning"|"danger"} [props.variant="info"]
8
8
  * @param {import('react').ReactNode} props.children The alert body.
9
9
  * @param {import('react').ReactNode} [props.title] A bold heading line above the body (`.alert-heading`).
10
- * @param {string|import('react').ReactNode} [props.icon] A leading glyph — a Bootstrap Icons name or a node.
10
+ * @param {string|import('react').ReactNode} [props.icon] A leading glyph — a Bootstrap Icons name or a node. Defaults to the variant's badge glyph; pass `null` for none.
11
+ * @param {string} [props.image] A custom image URL shown in the badge instead of the icon glyph (fills the circle).
12
+ * @param {string} [props.imageAlt] Alt text for the custom image.
11
13
  * @param {string} [props.className]
12
14
  * @param {() => void} [props.onClose] Called when dismissed
13
15
  * @param {boolean} [props.dismissible] Show the close button (defaults to true when onClose is set)
16
+ * @param {boolean} [props.bordered=true] Draw the soft variant border. `false` keeps only the tint fill.
14
17
  * @param {"alert"|"status"} [props.role="alert"] Use "status" for non-assertive notices
15
18
  */
16
- export default function AppAlert({ variant, children, title, icon, className, onClose, dismissible, role, ...rest }: {
19
+ export default function AppAlert({ variant, children, title, icon, image, imageAlt, className, onClose, dismissible, bordered, role, ...rest }: {
17
20
  variant?: "info" | "success" | "warning" | "danger";
18
21
  children: import('react').ReactNode;
19
22
  title?: import('react').ReactNode;
20
23
  icon?: string | import('react').ReactNode;
24
+ image?: string;
25
+ imageAlt?: string;
21
26
  className?: string;
22
27
  onClose?: () => void;
23
28
  dismissible?: boolean;
29
+ bordered?: boolean;
24
30
  role?: "alert" | "status";
25
31
  }): import("react").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * A soft branded aside that EXPLAINS something — how a calculation works, what a
3
- * setting affects, what happens next in a flow.
3
+ * setting affects, what happens next in a flow. A thick coloured left edge marks it
4
+ * as an aside.
4
5
  *
5
6
  * Distinct from `AppAlert`, and the difference is not cosmetic: an alert reports a
6
7
  * *state* ("we couldn't save", "your trial ends in 3 days") and goes away when that
@@ -9,11 +10,25 @@
9
10
  *
10
11
  * @param {object} props
11
12
  * @param {import('react').ReactNode} props.children The explanation. `<strong>` is styled.
12
- * @param {string} [props.icon='info'] Leading glyph. Pass `null` for none.
13
+ * @param {"info"|"success"|"warning"|"danger"} [props.tone="info"] The colour, mapped to intent.
14
+ * @param {import('react').ReactNode} [props.title] A bold heading line above the body.
15
+ * @param {string|import('react').ReactNode} [props.icon] Leading glyph — a Bootstrap Icons name or a node. Defaults to the tone's badge glyph; pass `null` for none.
16
+ * @param {string} [props.image] A custom image URL shown in the badge instead of the icon glyph (fills the circle).
17
+ * @param {string} [props.imageAlt] Alt text for the custom image.
18
+ * @param {"md"|"sm"} [props.size="md"] `sm` is a compact single line with tone-coloured text.
19
+ * @param {boolean} [props.dismissible=false] Show a × on the right that removes the callout.
20
+ * @param {() => void} [props.onDismiss] Called after the callout is dismissed.
13
21
  * @param {string} [props.className]
14
22
  */
15
- export default function AppCallout({ children, icon, className, ...rest }: {
23
+ export default function AppCallout({ children, tone, title, icon, image, imageAlt, size, dismissible, onDismiss, className, ...rest }: {
16
24
  children: import('react').ReactNode;
17
- icon?: string;
25
+ tone?: "info" | "success" | "warning" | "danger";
26
+ title?: import('react').ReactNode;
27
+ icon?: string | import('react').ReactNode;
28
+ image?: string;
29
+ imageAlt?: string;
30
+ size?: "md" | "sm";
31
+ dismissible?: boolean;
32
+ onDismiss?: () => void;
18
33
  className?: string;
19
34
  }): import("react").JSX.Element;
@@ -15,13 +15,17 @@
15
15
  * @param {'plain'|'filled'|'accent'|'spotlight'} [props.variant='plain'] The tile surface/layout:
16
16
  * plain (today's bordered card), filled (a subtle surface fill), accent (a brand-tinted fill),
17
17
  * spotlight (editorial feature tile — icon pinned top-right, serif value, caption below).
18
- * @param {'md'|'lg'} [props.size='md'] Tile scale: md (default), lg (a hero tile with an
19
- * enlarged value — for the single headline stat above a dashboard).
18
+ * @param {'sm'|'md'|'lg'} [props.size='md'] Tile scale: sm (compact), md (default), lg (a hero
19
+ * tile with an enlarged value — for the single headline stat above a dashboard).
20
+ * @param {number} [props.valueSize] Custom value ("main heading") font-size in px. Overrides the
21
+ * size/variant default — use it to tame a too-large headline (e.g. the spotlight serif).
20
22
  * @param {boolean} [props.inline=false] Put the icon beside the text instead of above it.
21
23
  * @param {boolean} [props.attention=false] Marks the tile as needing action (warning-tinted).
22
24
  * @param {string} [props.href] Renders the whole tile as a link to this URL.
23
25
  * @param {import('react').ElementType} [props.linkComponent] Router link; receives `to` instead of `href`.
24
26
  * @param {string} [props.className] Extra class(es) on the tile root.
27
+ * @param {import('react').CSSProperties} [props.style] Inline style on the tile root; the
28
+ * `valueSize` var is merged into it.
25
29
  * @param {string} [props.iconClassName] Extra class(es) on the icon chip.
26
30
  * @param {string} [props.labelClassName] Extra class(es) on the label.
27
31
  * @param {string} [props.valueClassName] Extra class(es) on the value.
@@ -29,7 +33,7 @@
29
33
  * @param {string} [props.deltaClassName] Extra class(es) on the delta.
30
34
  * @param {string} [props.sparklineClassName] Extra class(es) on the sparkline.
31
35
  */
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 }: {
36
+ export default function AppKpiTile({ label, value, caption, icon, iconTone, delta, deltaDirection, sparkline, variant, size, valueSize, inline, attention, href, linkComponent: Link, className, style, iconClassName, labelClassName, valueClassName, captionClassName, deltaClassName, sparklineClassName, ...rest }: {
33
37
  label: string;
34
38
  value: import('react').ReactNode;
35
39
  caption?: import('react').ReactNode;
@@ -39,12 +43,14 @@ export default function AppKpiTile({ label, value, caption, icon, iconTone, delt
39
43
  deltaDirection?: 'up' | 'down' | 'flat';
40
44
  sparkline?: number[];
41
45
  variant?: 'plain' | 'filled' | 'accent' | 'spotlight';
42
- size?: 'md' | 'lg';
46
+ size?: 'sm' | 'md' | 'lg';
47
+ valueSize?: number;
43
48
  inline?: boolean;
44
49
  attention?: boolean;
45
50
  href?: string;
46
51
  linkComponent?: import('react').ElementType;
47
52
  className?: string;
53
+ style?: import('react').CSSProperties;
48
54
  iconClassName?: string;
49
55
  labelClassName?: string;
50
56
  valueClassName?: string;
@@ -23,6 +23,9 @@
23
23
  * @param {boolean} [props.required=false]
24
24
  * @param {string} [props.error]
25
25
  * @param {string} [props.hint]
26
+ * @param {import('react').ReactNode} [props.help] Content for the label info-tip (decoupled:
27
+ * the caller supplies the node; a glossary-backed app wraps its lookup here). Mirrors AppInput.
28
+ * @param {string} [props.helpLabel="More information"] aria-label for the info-tip button.
26
29
  * @param {number} [props.min] Minimum value (inclusive)
27
30
  * @param {number} [props.max] Maximum value (inclusive)
28
31
  * @param {number} [props.step=1] Increment by this amount