@nanahoshi/mona-ui 0.46.0 → 0.47.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.
Files changed (46) hide show
  1. package/docs/api/button.json +1 -1
  2. package/docs/api/button.md +1 -0
  3. package/docs/api/check-box.json +1 -1
  4. package/docs/api/check-box.md +1 -0
  5. package/docs/api/chip.json +1 -1
  6. package/docs/api/chip.md +1 -0
  7. package/docs/api/common.json +1 -1
  8. package/docs/api/common.md +1 -1
  9. package/docs/api/index.json +1 -1
  10. package/docs/api/radio-button.json +1 -1
  11. package/docs/api/radio-button.md +1 -0
  12. package/docs/api/ripple.json +1 -0
  13. package/docs/api/ripple.md +75 -0
  14. package/docs/api/sidebar.json +1 -1
  15. package/docs/api/sidebar.md +1 -0
  16. package/docs/api/switch.json +1 -1
  17. package/docs/api/switch.md +1 -0
  18. package/docs/manifest.json +1 -1
  19. package/docs/ripple.md +360 -0
  20. package/docs/sidebar-menus.md +8 -0
  21. package/fesm2022/nanahoshi-mona-ui-button.mjs +20 -2
  22. package/fesm2022/nanahoshi-mona-ui-calendar.mjs +11 -3
  23. package/fesm2022/nanahoshi-mona-ui-check-box.mjs +30 -5
  24. package/fesm2022/nanahoshi-mona-ui-chip.mjs +13 -0
  25. package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +9 -1
  26. package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +9 -3
  27. package/fesm2022/nanahoshi-mona-ui-menubar.mjs +12 -4
  28. package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +11 -3
  29. package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +27 -3
  30. package/fesm2022/nanahoshi-mona-ui-ripple.mjs +196 -0
  31. package/fesm2022/nanahoshi-mona-ui-segmented.mjs +9 -3
  32. package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +21 -1
  33. package/fesm2022/nanahoshi-mona-ui-stepper.mjs +5 -1
  34. package/fesm2022/nanahoshi-mona-ui-switch.mjs +28 -3
  35. package/fesm2022/nanahoshi-mona-ui-tabs.mjs +7 -1
  36. package/llms.txt +2 -0
  37. package/package.json +5 -1
  38. package/ripple/package.json +5 -0
  39. package/types/nanahoshi-mona-ui-button.d.ts +8 -1
  40. package/types/nanahoshi-mona-ui-calendar.d.ts +1 -0
  41. package/types/nanahoshi-mona-ui-check-box.d.ts +10 -1
  42. package/types/nanahoshi-mona-ui-chip.d.ts +8 -1
  43. package/types/nanahoshi-mona-ui-radio-button.d.ts +9 -1
  44. package/types/nanahoshi-mona-ui-ripple.d.ts +72 -0
  45. package/types/nanahoshi-mona-ui-sidebar.d.ts +12 -0
  46. package/types/nanahoshi-mona-ui-switch.d.ts +10 -2
@@ -3,6 +3,7 @@ import { ElementRef } from "@angular/core";
3
3
  import { VariantProps } from "class-variance-authority";
4
4
  import { FormCheckboxControl } from "@angular/forms/signals";
5
5
  import { VariantInputs } from "@nanahoshi/mona-ui/internal";
6
+ import * as i1 from "@nanahoshi/mona-ui/ripple";
6
7
  declare const checkmarkThemeVariants: (props?: ({
7
8
  rounded?: "small" | "none" | "full" | "large" | "medium" | null | undefined;
8
9
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -22,6 +23,7 @@ export declare class CheckBoxComponent implements CheckboxVariantInput, Checkmar
22
23
  #private;
23
24
  protected readonly checkBoxClasses: import("@angular/core").Signal<string>;
24
25
  protected readonly checkMarkClasses: import("@angular/core").Signal<string>;
26
+ protected readonly checkMarkRef: import("@angular/core").Signal<ElementRef<HTMLSpanElement> | undefined>;
25
27
  protected readonly containerLabelClasses: import("@angular/core").Signal<string>;
26
28
  protected readonly describedBy: import("@angular/core").Signal<string | null>;
27
29
  protected readonly effectiveDisabled: import("@angular/core").Signal<boolean>;
@@ -146,6 +148,7 @@ export declare class CheckBoxComponent implements CheckboxVariantInput, Checkmar
146
148
  * @default ""
147
149
  */
148
150
  readonly userClass: import("@angular/core").InputSignal<string>;
151
+ constructor();
149
152
  /**
150
153
  * @description Moves focus to the native checkbox input.
151
154
  * @param options Options passed to the native `focus()` call, such as `preventScroll`.
@@ -253,7 +256,13 @@ export declare class CheckBoxComponent implements CheckboxVariantInput, Checkmar
253
256
  "inputChange": "inputChange";
254
257
  "inputFocus": "inputFocus";
255
258
  "touch": "touch";
256
- }, never, ["*"], true, never>;
259
+ }, never, ["*"], true, [{
260
+ directive: typeof i1.RippleDirective;
261
+ inputs: {
262
+ "monaRippleDisabled": "monaRippleDisabled";
263
+ };
264
+ outputs: {};
265
+ }]>;
257
266
  }
258
267
  /**
259
268
  * Applies Mona UI styling to a native `<input type="checkbox">`. All native checkbox behaviors — keyboard interaction,
@@ -2,6 +2,7 @@ import * as i0 from "@angular/core";
2
2
  import { ElementRef, TemplateRef } from "@angular/core";
3
3
  import { VariantProps } from "class-variance-authority";
4
4
  import { VariantInputs } from "@nanahoshi/mona-ui/internal";
5
+ import * as i1 from "@nanahoshi/mona-ui/ripple";
5
6
  export declare const CHIP_DEFAULT_MESSAGES: {
6
7
  removeLabel: (label?: string) => string;
7
8
  };
@@ -205,7 +206,13 @@ export declare class ChipComponent implements ChipVariantInputs {
205
206
  "contentClick": "contentClick";
206
207
  "remove": "remove";
207
208
  "selected": "selectedChange";
208
- }, ["prefixTemplate"], ["*"], true, never>;
209
+ }, ["prefixTemplate"], ["*"], true, [{
210
+ directive: typeof i1.RippleDirective;
211
+ inputs: {
212
+ "monaRippleDisabled": "monaRippleDisabled";
213
+ };
214
+ outputs: {};
215
+ }]>;
209
216
  }
210
217
  /**
211
218
  * @description Apply to an `<ng-template>` directly inside `<mona-chip>` to render prefix content
@@ -3,6 +3,7 @@ import { ElementRef } from "@angular/core";
3
3
  import { VariantProps } from "class-variance-authority";
4
4
  import { FormValueControl } from "@angular/forms/signals";
5
5
  import { VariantInputs } from "@nanahoshi/mona-ui/internal";
6
+ import * as i1 from "@nanahoshi/mona-ui/ripple";
6
7
  declare const radioGroupThemeVariants: (props?: ({
7
8
  orientation?: "horizontal" | "vertical" | null | undefined;
8
9
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -31,6 +32,7 @@ type RadioButtonDirectiveProps = VariantProps<typeof radioButtonDirectiveThemeVa
31
32
  type RadioButtonDirectiveInput = VariantInputs<RadioButtonDirectiveProps>;
32
33
  export declare class RadioButtonComponent<T = unknown> implements RadioButtonVariantInput, FormValueControl<T> {
33
34
  #private;
35
+ protected readonly circleRef: import("@angular/core").Signal<ElementRef<HTMLSpanElement> | undefined>;
34
36
  protected readonly containerLabelClasses: import("@angular/core").Signal<string>;
35
37
  protected readonly describedBy: import("@angular/core").Signal<string | null>;
36
38
  protected readonly effectiveDisabled: import("@angular/core").Signal<boolean>;
@@ -262,7 +264,13 @@ export declare class RadioButtonComponent<T = unknown> implements RadioButtonVar
262
264
  "inputFocus": "inputFocus";
263
265
  "touch": "touch";
264
266
  "value": "valueChange";
265
- }, never, ["*"], true, never>;
267
+ }, never, ["*"], true, [{
268
+ directive: typeof i1.RippleDirective;
269
+ inputs: {
270
+ "monaRippleDisabled": "monaRippleDisabled";
271
+ };
272
+ outputs: {};
273
+ }]>;
266
274
  }
267
275
  export declare class RadioGroupComponent<T = unknown> implements FormValueControl<T> {
268
276
  #private;
@@ -0,0 +1,72 @@
1
+ import * as i0 from "@angular/core";
2
+ import { EnvironmentProviders, InjectionToken, Signal } from "@angular/core";
3
+ /**
4
+ * @description
5
+ * Draws a ripple when the element is pressed: a wave in its text color that spreads from the pointer, stays while the
6
+ * element is held and fades once it is let go. Mona UI's buttons and other pressable components apply it themselves.
7
+ * It draws nothing until ripples are turned on with `provideRipple()`.
8
+ *
9
+ * The wave covers the element's padding box, over its background and under its content. For that, the first press
10
+ * gives the element `isolation: isolate`, and makes it `relative` if its position is `static`. The wave spreads over
11
+ * `--mona-ripple-duration`, 450ms unless set, fades over `--mona-ripple-fade-duration`, 300ms unless set, and its
12
+ * opacity is `--mona-ripple-opacity`, 12% unless set.
13
+ *
14
+ * There is no ripple on a disabled or `aria-disabled` element, with the system's reduced motion setting, or in forced
15
+ * colors. Keyboard presses have none either: the focus indicator already shows where they act. Nor does a press on a
16
+ * control inside the element, such as a button or a link, which belongs to that control, unless the element is the
17
+ * `<label>` of that control.
18
+ */
19
+ export declare class RippleDirective {
20
+ #private;
21
+ /**
22
+ * @description Turns the ripple off for this element while ripples are on.
23
+ * @default false
24
+ */
25
+ readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
26
+ constructor();
27
+ /**
28
+ * Draws the ripple as a halo around a control inside the element, such as a check box's box, which is too small to
29
+ * show a wave inside it. The halo spreads from the control's centre, reaches past its edges and is drawn under it,
30
+ * in the control itself, so it moves with the control, such as a switch's handle. The control must not clip what
31
+ * overflows it, and its position is made `relative` if it is `static`.
32
+ * @hidden Used by Mona UI's own components.
33
+ */
34
+ setHalo(target: () => HTMLElement | null | undefined): void;
35
+ /**
36
+ * Lets a component that applies this directive as a host directive turn the ripple off, such as a button whose look
37
+ * has no surface to draw it on.
38
+ * @hidden Used by Mona UI's own components.
39
+ */
40
+ setHostDisabled(disabled: Signal<boolean>): void;
41
+ static ɵfac: i0.ɵɵFactoryDeclaration<RippleDirective, never>;
42
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RippleDirective, "[monaRipple]", never, {
43
+ "disabled": {
44
+ "alias": "monaRippleDisabled";
45
+ "required": false;
46
+ "isSignal": true;
47
+ };
48
+ }, {}, never, never, true, never>;
49
+ }
50
+ /**
51
+ * @description Ripple settings. Set them for the application with `provideRipple()`.
52
+ */
53
+ interface RippleOptions {
54
+ /**
55
+ * @description Whether pressing a button, or another element with the `monaRipple` directive, draws a ripple.
56
+ * Ripples are off until `provideRipple()` turns them on.
57
+ */
58
+ readonly enabled: boolean;
59
+ }
60
+ /**
61
+ * Turns on the ripple Mona UI's buttons, and elements with the `monaRipple` directive, draw when pressed. Pass
62
+ * `{ enabled: false }` to keep them off, for example behind a setting.
63
+ */
64
+ export declare function provideRipple(options?: Partial<RippleOptions>): EnvironmentProviders;
65
+ /** The settings used when nothing is provided with `provideRipple()`: no ripples. */
66
+ export declare const DEFAULT_RIPPLE_OPTIONS: RippleOptions;
67
+ /**
68
+ * @description Ripple settings. Set them for the application with `provideRipple()`, or provide this token on a
69
+ * component to turn ripples on or off for everything inside it.
70
+ */
71
+ export declare const RIPPLE_OPTIONS: InjectionToken<RippleOptions>;
72
+ export type { RippleOptions };
@@ -326,6 +326,13 @@ export declare class SidebarMenuSkeletonComponent {
326
326
  * @default true
327
327
  */
328
328
  readonly showIcon: import("@angular/core").InputSignal<boolean>;
329
+ /**
330
+ * @description Additional CSS classes merged onto the host element via `tailwind-merge`. Give it the
331
+ * same height and padding as the menu buttons it stands in for when those are restyled, such as
332
+ * `h-7 px-2` for a denser menu, so the rows don't jump when the real ones arrive.
333
+ * @default ""
334
+ */
335
+ readonly userClass: import("@angular/core").InputSignalWithTransform<string, ClassInputType>;
329
336
  static ɵfac: i0.ɵɵFactoryDeclaration<SidebarMenuSkeletonComponent, never>;
330
337
  static ɵcmp: i0.ɵɵComponentDeclaration<SidebarMenuSkeletonComponent, "mona-sidebar-menu-skeleton", never, {
331
338
  "labelWidth": {
@@ -338,6 +345,11 @@ export declare class SidebarMenuSkeletonComponent {
338
345
  "required": false;
339
346
  "isSignal": true;
340
347
  };
348
+ "userClass": {
349
+ "alias": "class";
350
+ "required": false;
351
+ "isSignal": true;
352
+ };
341
353
  }, {}, never, never, true, never>;
342
354
  }
343
355
  export declare class SidebarContentDirective {
@@ -1,8 +1,9 @@
1
1
  import * as i0 from "@angular/core";
2
- import { TemplateRef } from "@angular/core";
2
+ import { ElementRef, TemplateRef } from "@angular/core";
3
3
  import { VariantProps } from "class-variance-authority";
4
4
  import { FormCheckboxControl } from "@angular/forms/signals";
5
5
  import { VariantInputs } from "@nanahoshi/mona-ui/internal";
6
+ import * as i1 from "@nanahoshi/mona-ui/ripple";
6
7
  declare const switchThemeVariants: (props?: ({
7
8
  rounded?: "small" | "none" | "full" | "large" | "medium" | null | undefined;
8
9
  size?: "small" | "large" | "medium" | null | undefined;
@@ -27,6 +28,7 @@ export declare class SwitchComponent implements SwitchVariantInputs, FormCheckbo
27
28
  protected readonly effectiveDisabled: import("@angular/core").Signal<boolean>;
28
29
  protected readonly handleClasses: import("@angular/core").Signal<string>;
29
30
  protected readonly handleContentTemplate: import("@angular/core").Signal<TemplateRef<any> | undefined>;
31
+ protected readonly handleRef: import("@angular/core").Signal<ElementRef<HTMLDivElement> | undefined>;
30
32
  protected readonly invalidState: import("@angular/core").Signal<boolean>;
31
33
  protected readonly labelClasses: import("@angular/core").Signal<string>;
32
34
  protected readonly labelledBy: import("@angular/core").Signal<string | null>;
@@ -202,7 +204,13 @@ export declare class SwitchComponent implements SwitchVariantInputs, FormCheckbo
202
204
  }, {
203
205
  "checked": "checkedChange";
204
206
  "touch": "touch";
205
- }, ["handleContentTemplate", "offLabelTemplate", "onLabelTemplate"], never, true, never>;
207
+ }, ["handleContentTemplate", "offLabelTemplate", "onLabelTemplate"], never, true, [{
208
+ directive: typeof i1.RippleDirective;
209
+ inputs: {
210
+ "monaRippleDisabled": "monaRippleDisabled";
211
+ };
212
+ outputs: {};
213
+ }]>;
206
214
  }
207
215
  export interface SwitchHandleContentTemplateContext {
208
216
  readonly $implicit: boolean;