@nanahoshi/mona-ui 0.3.0 → 0.5.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/card/package.json +4 -0
- package/collapsible/package.json +4 -0
- package/fesm2022/nanahoshi-mona-ui-button.mjs +1 -2
- package/fesm2022/nanahoshi-mona-ui-card.mjs +307 -0
- package/fesm2022/nanahoshi-mona-ui-collapsible.mjs +304 -0
- package/fesm2022/nanahoshi-mona-ui-common.mjs +19 -1
- package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +20 -9
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-cell.component-B6FBLtrr.mjs → nanahoshi-mona-ui-grid-grid-footer-cell.component-D-JCCvYJ.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-OJe4UYuw.mjs → nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-7zwgl7u1.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-DCd8K6ng.mjs → nanahoshi-mona-ui-grid-grid-list.component-n3eQNIza.mjs} +5 -5
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-toggle.component-Dl8Hlkhj.mjs → nanahoshi-mona-ui-grid-grid-toggle.component-BhS7c7rW.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-C5FRZlvv.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-B4VB3xFw.mjs} +5 -5
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-BRZUd8cE.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-A6Cq2a4Q.mjs} +11 -11
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +18 -16
- package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +2025 -0
- package/fesm2022/nanahoshi-mona-ui-skeleton.mjs +96 -0
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-theme.mjs +71 -25
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +49 -2
- package/package.json +17 -1
- package/sidebar/package.json +4 -0
- package/skeleton/package.json +4 -0
- package/types/nanahoshi-mona-ui-card.d.ts +104 -0
- package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +2 -1
- package/types/nanahoshi-mona-ui-collapsible.d.ts +92 -0
- package/types/nanahoshi-mona-ui-common.d.ts +6 -2
- package/types/nanahoshi-mona-ui-expansion-panel.d.ts +11 -3
- package/types/nanahoshi-mona-ui-popup-menu.d.ts +6 -4
- package/types/nanahoshi-mona-ui-sidebar.d.ts +695 -0
- package/types/nanahoshi-mona-ui-skeleton.d.ts +51 -0
- package/types/nanahoshi-mona-ui-theme.d.ts +28 -2
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { Signal, InjectionToken } from '@angular/core';
|
|
3
|
+
import * as _nanahoshi_mona_ui_collapsible from '@nanahoshi/mona-ui/collapsible';
|
|
4
|
+
|
|
5
|
+
declare const CollapsibleToken: InjectionToken<CollapsibleConfig>;
|
|
6
|
+
/**
|
|
7
|
+
* The contract a collapsible root exposes to its trigger and content parts.
|
|
8
|
+
*/
|
|
9
|
+
interface CollapsibleConfig {
|
|
10
|
+
readonly animate: Signal<boolean>;
|
|
11
|
+
collapse(): void;
|
|
12
|
+
readonly contentId: string;
|
|
13
|
+
readonly disabled: Signal<boolean>;
|
|
14
|
+
expand(): void;
|
|
15
|
+
readonly expanded: Signal<boolean>;
|
|
16
|
+
toggle(): void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @description
|
|
21
|
+
* Headless disclosure root. Adds no markup of its own, so it can be applied to any element
|
|
22
|
+
* (`li`, `div`, `section`) and paired with `monaCollapsibleTrigger` and `monaCollapsibleContent`.
|
|
23
|
+
*/
|
|
24
|
+
declare class CollapsibleDirective implements CollapsibleConfig {
|
|
25
|
+
protected readonly state: _angular_core.Signal<"open" | "closed">;
|
|
26
|
+
/**
|
|
27
|
+
* @description Enables the height transition applied to the collapsible content.
|
|
28
|
+
* @default true
|
|
29
|
+
*/
|
|
30
|
+
readonly animate: _angular_core.InputSignal<boolean>;
|
|
31
|
+
/**
|
|
32
|
+
* @description Id assigned to the content element and referenced by the trigger through `aria-controls`.
|
|
33
|
+
*/
|
|
34
|
+
readonly contentId: string;
|
|
35
|
+
/**
|
|
36
|
+
* @description Suppresses toggling through the trigger. `expand()` and `collapse()` still apply.
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
readonly disabled: _angular_core.InputSignal<boolean>;
|
|
40
|
+
/**
|
|
41
|
+
* @description Sets whether the content is expanded. Supports two-way binding.
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
readonly expanded: _angular_core.ModelSignal<boolean>;
|
|
45
|
+
collapse(): void;
|
|
46
|
+
expand(): void;
|
|
47
|
+
toggle(): void;
|
|
48
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CollapsibleDirective, never>;
|
|
49
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CollapsibleDirective, "[monaCollapsible]", ["monaCollapsible"], { "animate": { "alias": "animate"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "expanded": { "alias": "expanded"; "required": false; "isSignal": true; }; }, { "expanded": "expandedChange"; }, never, never, true, never>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @description
|
|
54
|
+
* Animates the height of the collapsible content between `0` and its measured size. Adds no wrapper
|
|
55
|
+
* element, so it can be applied directly to a `ul`, `div` or any other container with any number of children.
|
|
56
|
+
*
|
|
57
|
+
* The measured size is also published on the host as the `--mona-collapsible-content-height` custom
|
|
58
|
+
* property, so consumers can drive their own animation instead (pair it with `[animate]="false"` on the root).
|
|
59
|
+
*/
|
|
60
|
+
declare class CollapsibleContentDirective {
|
|
61
|
+
#private;
|
|
62
|
+
protected readonly collapsible: _nanahoshi_mona_ui_collapsible.CollapsibleConfig;
|
|
63
|
+
protected readonly inert: _angular_core.Signal<true | null>;
|
|
64
|
+
protected readonly state: _angular_core.Signal<"open" | "closed">;
|
|
65
|
+
constructor();
|
|
66
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CollapsibleContentDirective, never>;
|
|
67
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CollapsibleContentDirective, "[monaCollapsibleContent]", never, {}, {}, never, never, true, never>;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* @description
|
|
72
|
+
* Toggles the closest `monaCollapsible`. Wires `aria-expanded` / `aria-controls` automatically and
|
|
73
|
+
* only adds `role`, `tabindex` and keyboard handling when the host element is not already interactive.
|
|
74
|
+
*/
|
|
75
|
+
declare class CollapsibleTriggerDirective {
|
|
76
|
+
#private;
|
|
77
|
+
protected readonly ariaDisabled: _angular_core.Signal<"true" | null>;
|
|
78
|
+
protected readonly collapsible: _nanahoshi_mona_ui_collapsible.CollapsibleConfig;
|
|
79
|
+
protected readonly nativeDisabled: _angular_core.Signal<"" | null>;
|
|
80
|
+
protected readonly role: string | null;
|
|
81
|
+
protected readonly state: _angular_core.Signal<"open" | "closed">;
|
|
82
|
+
protected readonly tabIndex: _angular_core.Signal<0 | -1 | null>;
|
|
83
|
+
protected readonly type: string | null;
|
|
84
|
+
protected onClick(): void;
|
|
85
|
+
protected onEnterKeydown(event: Event): void;
|
|
86
|
+
protected onSpaceKeydown(event: Event): void;
|
|
87
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CollapsibleTriggerDirective, never>;
|
|
88
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CollapsibleTriggerDirective, "[monaCollapsibleTrigger]", never, {}, {}, never, never, true, never>;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export { CollapsibleContentDirective, CollapsibleDirective, CollapsibleToken, CollapsibleTriggerDirective };
|
|
92
|
+
export type { CollapsibleConfig };
|
|
@@ -6,6 +6,8 @@ type SelectionMode = "single" | "multiple";
|
|
|
6
6
|
|
|
7
7
|
type ScrollDirection = "left" | "right";
|
|
8
8
|
|
|
9
|
+
type ClassInputType = string | string[] | Record<string, unknown> | null | undefined;
|
|
10
|
+
|
|
9
11
|
type ColorMode = "hsv" | "rgb";
|
|
10
12
|
type ColorOutputFormat = "hex" | "rgb" | "hsl";
|
|
11
13
|
|
|
@@ -369,6 +371,8 @@ declare class IterablePatchStore<TItem, TId> implements IIterablePatchStore<TIte
|
|
|
369
371
|
declare const createIterablePatchStore: <TItem, TId>(options: IterablePatchStoreOptions<TItem, TId>) => IIterablePatchStore<TItem, TId>;
|
|
370
372
|
declare const createObjectPatchStore: <T>(options: ObjectPatchStoreOptions<T>) => IObjectPatchStore<T>;
|
|
371
373
|
|
|
374
|
+
declare const classInputToClass: (input: ClassInputType) => string;
|
|
375
|
+
|
|
372
376
|
/**
|
|
373
377
|
* Calculates the percentage of a value within a given range, rounded to the specified precision.
|
|
374
378
|
* @param value The current value.
|
|
@@ -382,5 +386,5 @@ declare const getPercentage: (value: number, min: number, max: number, precision
|
|
|
382
386
|
|
|
383
387
|
declare function moveIndices<T>(array: T[], indices: number[], offset: number): T[];
|
|
384
388
|
|
|
385
|
-
export { AnyPipe, ContainsPipe, FilterChangeEvent, IterablePatchStore, ObjectPatchStore, PreventableEvent, SlicePipe, TakeFirstPipe, buildNested, createIterablePatchStore, createObjectPatchStore, deepEquals, deepMerge, getPercentage, isEmptyObject, isPlainObject, mergeInto, mergePatchInto, moveIndices, patchAt, prunePatch, setAt };
|
|
386
|
-
export type { ArrayStrategy, BaseChangeStrategy, ColorMode, ColorOutputFormat, DataType, DeepMergeOptions, DeepPartial, FilterOperator, FilterableOptions, IIterablePatchStore, IObjectPatchStore, IterablePatchStoreOptions, ObjectPatchStoreOptions, Orientation, PaletteType, Path, PathValue, Position, ScrollDirection, SelectionMode, VirtualScrollOptions };
|
|
389
|
+
export { AnyPipe, ContainsPipe, FilterChangeEvent, IterablePatchStore, ObjectPatchStore, PreventableEvent, SlicePipe, TakeFirstPipe, buildNested, classInputToClass, createIterablePatchStore, createObjectPatchStore, deepEquals, deepMerge, getPercentage, isEmptyObject, isPlainObject, mergeInto, mergePatchInto, moveIndices, patchAt, prunePatch, setAt };
|
|
390
|
+
export type { ArrayStrategy, BaseChangeStrategy, ClassInputType, ColorMode, ColorOutputFormat, DataType, DeepMergeOptions, DeepPartial, FilterOperator, FilterableOptions, IIterablePatchStore, IObjectPatchStore, IterablePatchStoreOptions, ObjectPatchStoreOptions, Orientation, PaletteType, Path, PathValue, Position, ScrollDirection, SelectionMode, VirtualScrollOptions };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { TemplateRef } from '@angular/core';
|
|
3
|
+
import { CollapsibleConfig } from '@nanahoshi/mona-ui/collapsible';
|
|
3
4
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
5
|
import { VariantInputs } from '@nanahoshi/mona-ui/internal';
|
|
5
6
|
import { VariantProps } from 'class-variance-authority';
|
|
@@ -27,16 +28,21 @@ type ExpansionPanelIconContainerVariantProps = VariantProps<typeof expansionPane
|
|
|
27
28
|
type ExpansionPanelIconContainerVariantInput = VariantInputs<ExpansionPanelIconContainerVariantProps>;
|
|
28
29
|
type ExpansionPanelVariantInput = ExpansionPanelBaseVariantInput & Omit<ExpansionPanelHeaderVariantInput, "collapsed"> & ExpansionPanelContentVariantInput & Omit<ExpansionPanelIconContainerVariantInput, "hasTemplate">;
|
|
29
30
|
|
|
30
|
-
declare class ExpansionPanelComponent implements ExpansionPanelVariantInput {
|
|
31
|
+
declare class ExpansionPanelComponent implements ExpansionPanelVariantInput, CollapsibleConfig {
|
|
31
32
|
protected readonly actionsTemplateList: _angular_core.Signal<readonly TemplateRef<any>[]>;
|
|
32
33
|
protected readonly baseClass: _angular_core.Signal<string>;
|
|
33
34
|
protected readonly contentClass: _angular_core.Signal<string>;
|
|
34
|
-
protected readonly contentId: string;
|
|
35
35
|
protected readonly headerClass: _angular_core.Signal<string>;
|
|
36
36
|
protected readonly headerTitleClass: _angular_core.Signal<string>;
|
|
37
37
|
protected readonly iconContainerClass: _angular_core.Signal<string>;
|
|
38
38
|
protected readonly iconTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
39
39
|
protected readonly titleTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
40
|
+
/**
|
|
41
|
+
* @description Always enabled. Satisfies the `CollapsibleConfig` contract for `monaCollapsibleTrigger`;
|
|
42
|
+
* this component doesn't use `monaCollapsibleContent`, so no animation ever consults it.
|
|
43
|
+
*/
|
|
44
|
+
readonly animate: _angular_core.Signal<boolean>;
|
|
45
|
+
readonly contentId: string;
|
|
40
46
|
/**
|
|
41
47
|
* @description Disables header interaction, suppressing click and keyboard toggling.
|
|
42
48
|
* @default false
|
|
@@ -62,7 +68,9 @@ declare class ExpansionPanelComponent implements ExpansionPanelVariantInput {
|
|
|
62
68
|
* @default ""
|
|
63
69
|
*/
|
|
64
70
|
readonly userClass: _angular_core.InputSignal<string>;
|
|
65
|
-
|
|
71
|
+
collapse(): void;
|
|
72
|
+
expand(): void;
|
|
73
|
+
toggle(): void;
|
|
66
74
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ExpansionPanelComponent, never>;
|
|
67
75
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ExpansionPanelComponent, "mona-expansion-panel", never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "expanded": { "alias": "expanded"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "userClass": { "alias": "userClass"; "required": false; "isSignal": true; }; }, { "expanded": "expandedChange"; }, ["actionsTemplateList", "iconTemplate", "titleTemplate"], ["*"], true, never>;
|
|
68
76
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { Signal, TemplateRef, ElementRef, InjectionToken, OnInit } from '@angular/core';
|
|
3
3
|
import * as _mirei_ts_collections from '@mirei/ts-collections';
|
|
4
|
+
import { PreventableEvent, ClassInputType } from '@nanahoshi/mona-ui/common';
|
|
4
5
|
import { PopupCloseEvent, PopupRef, ConnectionPoint, PopupOffset } from '@nanahoshi/mona-ui/popup';
|
|
5
|
-
import { PreventableEvent } from '@nanahoshi/mona-ui/common';
|
|
6
6
|
import { Subject } from 'rxjs';
|
|
7
7
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
8
8
|
import { VariantProps } from 'class-variance-authority';
|
|
@@ -165,6 +165,7 @@ declare class PopupMenuComponent implements PopupMenuVariantInput {
|
|
|
165
165
|
* This will be applied to the root menu and all submenus.
|
|
166
166
|
*/
|
|
167
167
|
readonly width: _angular_core.InputSignal<string | number | undefined>;
|
|
168
|
+
readonly userClass: _angular_core.InputSignalWithTransform<string | undefined, ClassInputType>;
|
|
168
169
|
constructor();
|
|
169
170
|
clearFocusRestoration(): void;
|
|
170
171
|
closeMenu(): void;
|
|
@@ -178,7 +179,7 @@ declare class PopupMenuComponent implements PopupMenuVariantInput {
|
|
|
178
179
|
private setSubscriptions;
|
|
179
180
|
private setTriggerSubscription;
|
|
180
181
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PopupMenuComponent, never>;
|
|
181
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<PopupMenuComponent, "mona-popup-menu", never, { "anchor": { "alias": "anchor"; "required": false; "isSignal": true; }; "anchorConnectionPoint": { "alias": "anchorConnectionPoint"; "required": false; "isSignal": true; }; "items": { "alias": "items"; "required": false; "isSignal": true; }; "menuId": { "alias": "id"; "required": false; "isSignal": true; }; "minWidth": { "alias": "minWidth"; "required": false; "isSignal": true; }; "offset": { "alias": "offset"; "required": false; "isSignal": true; }; "popupConnectionPoint": { "alias": "popupConnectionPoint"; "required": false; "isSignal": true; }; "precise": { "alias": "precise"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "target": { "alias": "target"; "required": true; "isSignal": true; }; "trigger": { "alias": "trigger"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; }, { "close": "close"; "menuClick": "menuClick"; "navigate": "navigate"; "open": "open"; }, ["groupTemplateConfig", "iconTemplateConfig", "nestedComponents", "shortcutTemplateConfig", "textTemplateConfig"], never, true, never>;
|
|
182
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<PopupMenuComponent, "mona-popup-menu", never, { "anchor": { "alias": "anchor"; "required": false; "isSignal": true; }; "anchorConnectionPoint": { "alias": "anchorConnectionPoint"; "required": false; "isSignal": true; }; "items": { "alias": "items"; "required": false; "isSignal": true; }; "menuId": { "alias": "id"; "required": false; "isSignal": true; }; "minWidth": { "alias": "minWidth"; "required": false; "isSignal": true; }; "offset": { "alias": "offset"; "required": false; "isSignal": true; }; "popupConnectionPoint": { "alias": "popupConnectionPoint"; "required": false; "isSignal": true; }; "precise": { "alias": "precise"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "target": { "alias": "target"; "required": true; "isSignal": true; }; "trigger": { "alias": "trigger"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, { "close": "close"; "menuClick": "menuClick"; "navigate": "navigate"; "open": "open"; }, ["groupTemplateConfig", "iconTemplateConfig", "nestedComponents", "shortcutTemplateConfig", "textTemplateConfig"], never, true, never>;
|
|
182
183
|
}
|
|
183
184
|
|
|
184
185
|
declare const PopupMenuToken: InjectionToken<PopupMenuConfig>;
|
|
@@ -289,17 +290,18 @@ declare class PopupMenuItemComponent implements PopupMenuConfig, OnInit {
|
|
|
289
290
|
}
|
|
290
291
|
|
|
291
292
|
declare class PopupMenuGroupComponent implements PopupMenuConfig {
|
|
293
|
+
#private;
|
|
292
294
|
protected readonly groupTemplateConfig: _angular_core.Signal<_nanahoshi_mona_ui_popup_menu.PopupTemplateConfig | undefined>;
|
|
293
295
|
protected readonly items: _angular_core.Signal<readonly PopupMenuConfig[]>;
|
|
294
296
|
readonly origin: PopupMenuOrigin;
|
|
295
297
|
/**
|
|
296
298
|
* @description Sets the title of the menu group.
|
|
297
299
|
*/
|
|
298
|
-
readonly title: _angular_core.InputSignal<string>;
|
|
300
|
+
readonly title: _angular_core.InputSignal<string | undefined>;
|
|
299
301
|
readonly type = PopupMenuItemType.MenuGroup;
|
|
300
302
|
getPopupMenuItem(): PopupMenuItem[];
|
|
301
303
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PopupMenuGroupComponent, never>;
|
|
302
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<PopupMenuGroupComponent, "mona-popup-menu-group", never, { "title": { "alias": "title"; "required":
|
|
304
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<PopupMenuGroupComponent, "mona-popup-menu-group", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; }, {}, ["groupTemplateConfig", "items"], never, true, never>;
|
|
303
305
|
}
|
|
304
306
|
|
|
305
307
|
declare class PopupMenuRadioGroupComponent implements PopupMenuConfig, OnInit {
|