@nanahoshi/mona-ui 0.13.1 → 0.15.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/chart/README.md +662 -0
- package/chart/package.json +4 -0
- package/fesm2022/nanahoshi-mona-ui-chart.mjs +64226 -0
- package/fesm2022/nanahoshi-mona-ui-spinner.mjs +580 -0
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +1 -1
- package/package.json +15 -1
- package/spinner/package.json +4 -0
- package/types/nanahoshi-mona-ui-chart.d.ts +7815 -0
- package/types/nanahoshi-mona-ui-spinner.d.ts +114 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { ElementRef, OnDestroy } from '@angular/core';
|
|
3
|
+
import { LucideLoader } from '@lucide/angular';
|
|
4
|
+
import { ClassInputType } from '@nanahoshi/mona-ui/common';
|
|
5
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
6
|
+
import { VariantProps } from 'class-variance-authority';
|
|
7
|
+
import { VariantInputs } from '@nanahoshi/mona-ui/internal';
|
|
8
|
+
import { Observable } from 'rxjs';
|
|
9
|
+
|
|
10
|
+
type SpinnerAppearance = "default" | "pulsing" | "pulsing-triad" | "pulsing-ring" | "converging-spinner";
|
|
11
|
+
|
|
12
|
+
type SpinnerSize = "small" | "medium" | "large";
|
|
13
|
+
|
|
14
|
+
declare const spinnerThemeVariants: (props?: ({
|
|
15
|
+
size?: "small" | "medium" | "large" | null | undefined;
|
|
16
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
17
|
+
type SpinnerVariantProps = VariantProps<typeof spinnerThemeVariants>;
|
|
18
|
+
type SpinnerVariantInput = VariantInputs<SpinnerVariantProps>;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @description
|
|
22
|
+
* An indeterminate loading indicator primitive for communicating ongoing activity.
|
|
23
|
+
* Supports multiple appearances, standard sizes, and accessible status announcements.
|
|
24
|
+
*/
|
|
25
|
+
declare class SpinnerComponent implements SpinnerVariantInput {
|
|
26
|
+
protected readonly baseClass: _angular_core.Signal<string>;
|
|
27
|
+
protected readonly loaderIcon: typeof LucideLoader;
|
|
28
|
+
protected readonly pixelSize: _angular_core.Signal<12 | 24 | 16>;
|
|
29
|
+
/**
|
|
30
|
+
* @description Visual appearance of the spinner animation.
|
|
31
|
+
* @default "default"
|
|
32
|
+
*/
|
|
33
|
+
readonly appearance: _angular_core.InputSignal<SpinnerAppearance>;
|
|
34
|
+
/**
|
|
35
|
+
* @description Accessible text announced by assistive technology when the spinner is not decorative.
|
|
36
|
+
* @default "Loading"
|
|
37
|
+
*/
|
|
38
|
+
readonly ariaLabel: _angular_core.InputSignal<string>;
|
|
39
|
+
/**
|
|
40
|
+
* @description When `true`, removes the `status` role and hides the spinner from assistive technology with `aria-hidden="true"`.
|
|
41
|
+
* Useful when a parent element already manages loading semantics (such as `aria-busy="true"` on a button).
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
readonly decorative: _angular_core.InputSignal<boolean>;
|
|
45
|
+
/**
|
|
46
|
+
* @description Size preset controlling the dimensions of the indicator.
|
|
47
|
+
* @default "medium"
|
|
48
|
+
*/
|
|
49
|
+
readonly size: _angular_core.InputSignal<SpinnerSize>;
|
|
50
|
+
/**
|
|
51
|
+
* @description Additional CSS classes merged onto the host element via `tailwind-merge`.
|
|
52
|
+
* @default ""
|
|
53
|
+
*/
|
|
54
|
+
readonly userClass: _angular_core.InputSignalWithTransform<string, ClassInputType>;
|
|
55
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SpinnerComponent, never>;
|
|
56
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SpinnerComponent, "mona-spinner", never, { "appearance": { "alias": "appearance"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "decorative": { "alias": "decorative"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
interface SpinnerCancelOptions {
|
|
60
|
+
onCancel?: () => void;
|
|
61
|
+
text?: string;
|
|
62
|
+
}
|
|
63
|
+
interface SpinnerOptions {
|
|
64
|
+
appearance?: SpinnerAppearance;
|
|
65
|
+
cancellable?: boolean | SpinnerCancelOptions;
|
|
66
|
+
delay?: number;
|
|
67
|
+
id?: string;
|
|
68
|
+
minimumVisibleDuration?: number;
|
|
69
|
+
size?: SpinnerSize;
|
|
70
|
+
target?: HTMLElement | ElementRef<HTMLElement> | readonly (HTMLElement | ElementRef<HTMLElement>)[];
|
|
71
|
+
text?: string;
|
|
72
|
+
zIndex?: number;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
interface SpinnerUpdate {
|
|
76
|
+
appearance?: SpinnerAppearance;
|
|
77
|
+
size?: SpinnerSize;
|
|
78
|
+
text?: string;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
interface SpinnerRef {
|
|
82
|
+
readonly cancelled$: Observable<void>;
|
|
83
|
+
readonly id: string;
|
|
84
|
+
close(): void;
|
|
85
|
+
update(update: SpinnerUpdate): void;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
declare class SpinnerService implements OnDestroy {
|
|
89
|
+
#private;
|
|
90
|
+
/**
|
|
91
|
+
* Hides and destroys the spinner associated with the given `SpinnerRef` or string `id`.
|
|
92
|
+
*/
|
|
93
|
+
hide(refOrId: SpinnerRef | string): void;
|
|
94
|
+
/**
|
|
95
|
+
* Tears down every active/pending spinner request and physical overlay so
|
|
96
|
+
* nothing is left behind if the service outlives its consumers.
|
|
97
|
+
*/
|
|
98
|
+
ngOnDestroy(): void;
|
|
99
|
+
/**
|
|
100
|
+
* Displays a spinner loading overlay according to the provided options.
|
|
101
|
+
* Returns a `SpinnerRef` handle for lifecycle management and updates.
|
|
102
|
+
*/
|
|
103
|
+
show(options?: SpinnerOptions): SpinnerRef;
|
|
104
|
+
/**
|
|
105
|
+
* Wraps an Observable operation with a Spinner lifecycle.
|
|
106
|
+
* Shows the spinner on subscription and closes it when the observable completes, errors, or is unsubscribed.
|
|
107
|
+
*/
|
|
108
|
+
track<T>(source: Observable<T>, options?: SpinnerOptions): Observable<T>;
|
|
109
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SpinnerService, never>;
|
|
110
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<SpinnerService>;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export { SpinnerComponent, SpinnerService };
|
|
114
|
+
export type { SpinnerAppearance, SpinnerCancelOptions, SpinnerOptions, SpinnerRef, SpinnerSize, SpinnerUpdate, SpinnerVariantProps };
|