@leabankab/component-library 8.10.0 → 8.11.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.
@@ -1,2 +1,5 @@
1
- export * from './icons';
2
- export * from './illustrations';
1
+ export * from './check-animation/check-animation';
2
+ export * from './loader/loader';
3
+ export * from './pulse-animation/pulse-animation';
4
+ export * from './status-animation/status-animation';
5
+ export * from './status-icon/status-icon';
@@ -0,0 +1,43 @@
1
+ import { AnimationColor, AnimationSize } from '../shared';
2
+ export type LoaderStatus = "loading" | "done";
3
+ export type LoaderProps = {
4
+ /**
5
+ * `"loading"` shows the pulse. `"done"` cross-fades into the check and fires
6
+ * its one-time confetti.
7
+ * @default "loading"
8
+ */
9
+ status?: LoaderStatus;
10
+ /**
11
+ * `"sm"` is 90px, `"lg"` 150px.
12
+ * @default "lg"
13
+ */
14
+ size?: AnimationSize;
15
+ /**
16
+ * Colour of the pulse and of the check (and its halo).
17
+ * @default "primary"
18
+ */
19
+ color?: AnimationColor;
20
+ /**
21
+ * Minimum time (ms) the pulse stays visible once mounted in the loading
22
+ * state, so a very fast response doesn't make the spinner flash. The check
23
+ * appears as soon as `status` is `"done"` *and* this minimum has elapsed.
24
+ */
25
+ minLoadingMs?: number;
26
+ /**
27
+ * Visually-hidden status text announced while loading. Defaults to the
28
+ * translated word for "loading" in the `LeaProvider` language.
29
+ */
30
+ loadingLabel?: string;
31
+ /**
32
+ * Visually-hidden status text announced once done. Defaults to the translated
33
+ * word for "done".
34
+ */
35
+ doneLabel?: string;
36
+ };
37
+ /**
38
+ * The library's loading indicator: shows {@link PulseAnimation} while
39
+ * `status` is `"loading"`, then cross-fades into {@link CheckAnimation}
40
+ * (firing its one-time confetti) once `status` becomes `"done"`. Announces
41
+ * state changes politely and respects `prefers-reduced-motion`.
42
+ */
43
+ export declare const Loader: ({ status, size, color, minLoadingMs, loadingLabel, doneLabel, }: LoaderProps) => import("react").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { AnimationColor, AnimationSize } from '../shared';
2
+ type PulseAnimationProps = {
3
+ /**
4
+ * `"sm"` is 90px, `"lg"` 150px.
5
+ * @default "lg"
6
+ */
7
+ size?: AnimationSize;
8
+ /**
9
+ * Colour of the rings and the centre circle.
10
+ * @default "primary"
11
+ */
12
+ color?: AnimationColor;
13
+ /**
14
+ * Accessible name for the spinner; defaults to the translated word for
15
+ * "loading" in the `LeaProvider` language. `Loader` hides the pulse from
16
+ * assistive tech and announces its own status text instead.
17
+ */
18
+ label?: string;
19
+ };
20
+ export declare const PulseAnimation: ({ size, color, label, }: PulseAnimationProps) => import("react").JSX.Element;
21
+ export {};
@@ -8,7 +8,7 @@ type StatusAnimationProps = {
8
8
  */
9
9
  size?: AnimationSize;
10
10
  /**
11
- * Colour of the resulting check (and its halo).
11
+ * Colour of the pulse and of the resulting check (and its halo).
12
12
  * @default "primary"
13
13
  */
14
14
  color?: AnimationColor;
@@ -30,10 +30,11 @@ type StatusAnimationProps = {
30
30
  doneLabel?: string;
31
31
  };
32
32
  /**
33
- * A controlled loading → success indicator: shows {@link PulseAnimation} while
34
- * `loading`, then cross-fades into {@link CheckAnimation} (firing its one-time
35
- * confetti) once `loading` becomes `false`. Announces state changes politely
36
- * and respects `prefers-reduced-motion`.
33
+ * A controlled loading → success indicator: the pulse while `loading`, then
34
+ * the check once `loading` becomes `false`.
35
+ *
36
+ * @deprecated Use {@link Loader}, which renders the same thing:
37
+ * `<Loader status={loading ? "loading" : "done"} />`.
37
38
  */
38
- export declare const StatusAnimation: ({ loading, size, color, minLoadingMs, loadingLabel, doneLabel, }: StatusAnimationProps) => import("react").JSX.Element;
39
+ export declare const StatusAnimation: ({ loading, ...rest }: StatusAnimationProps) => import("react").JSX.Element;
39
40
  export {};
@@ -52,10 +52,10 @@ export declare function resolveAlert({ severity, color, variant, size, icon, act
52
52
  "data-color": AlertColor;
53
53
  "data-variant": AlertVariant;
54
54
  "data-size": AlertSize;
55
+ title?: string | undefined | undefined;
55
56
  className?: string | undefined | undefined;
56
57
  slot?: string | undefined | undefined;
57
58
  style?: import('react').CSSProperties | undefined;
58
- title?: string | undefined | undefined;
59
59
  onAnimationStart?: import('react').AnimationEventHandler<HTMLDivElement> | undefined;
60
60
  onDragStart?: import('react').DragEventHandler<HTMLDivElement> | undefined;
61
61
  onDragEnd?: import('react').DragEventHandler<HTMLDivElement> | undefined;