@webority/ui-react 0.8.2 → 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.
@@ -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;