@nanahoshi/mona-ui 0.24.1 → 0.24.2

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 (33) hide show
  1. package/README.md +1 -0
  2. package/fesm2022/nanahoshi-mona-ui-button-group.mjs +1 -1
  3. package/fesm2022/nanahoshi-mona-ui-button.mjs +122 -60
  4. package/fesm2022/nanahoshi-mona-ui-calendar.mjs +1 -2
  5. package/fesm2022/nanahoshi-mona-ui-chip.mjs +1 -1
  6. package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +1 -1
  7. package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +1 -1
  8. package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +1 -1
  9. package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +1 -1
  10. package/fesm2022/nanahoshi-mona-ui-dialog.mjs +1 -1
  11. package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +1 -1
  12. package/fesm2022/nanahoshi-mona-ui-editor.mjs +13 -13
  13. package/fesm2022/nanahoshi-mona-ui-filter.mjs +1 -1
  14. package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-row.component-CnPhVIr4.mjs → nanahoshi-mona-ui-grid-grid-footer-row.component-x_euoNnS.mjs} +2 -2
  15. package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-DxY6bfTX.mjs → nanahoshi-mona-ui-grid-grid-list.component-C1_6vq77.mjs} +4 -4
  16. package/fesm2022/{nanahoshi-mona-ui-grid-grid-row.component-CaO5Lae6.mjs → nanahoshi-mona-ui-grid-grid-row.component-BhukVWIy.mjs} +3 -3
  17. package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-jNYtqg5B.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-XQKOPPVs.mjs} +4 -4
  18. package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-9FtfCutf.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-Iw-wvKGl.mjs} +13 -12
  19. package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
  20. package/fesm2022/nanahoshi-mona-ui-list-box.mjs +1 -1
  21. package/fesm2022/nanahoshi-mona-ui-notification.mjs +1 -1
  22. package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +2 -2
  23. package/fesm2022/nanahoshi-mona-ui-pager.mjs +1 -1
  24. package/fesm2022/nanahoshi-mona-ui-sheet.mjs +1 -1
  25. package/fesm2022/nanahoshi-mona-ui-split-button.mjs +1 -1
  26. package/fesm2022/nanahoshi-mona-ui-splitter.mjs +1 -1
  27. package/fesm2022/nanahoshi-mona-ui-tabs.mjs +1 -1
  28. package/fesm2022/nanahoshi-mona-ui-text-box.mjs +1 -1
  29. package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +1 -1
  30. package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +1 -1
  31. package/fesm2022/nanahoshi-mona-ui-window.mjs +1 -1
  32. package/package.json +1 -1
  33. package/types/nanahoshi-mona-ui-button.d.ts +44 -20
@@ -1,9 +1,15 @@
1
1
  import * as _angular_core from '@angular/core';
2
+ import { Signal } from '@angular/core';
2
3
  import * as class_variance_authority_types from 'class-variance-authority/types';
3
4
  import { VariantInputs } from '@nanahoshi/mona-ui/internal';
4
5
  import { VariantProps } from 'class-variance-authority';
5
6
  import { Subject } from 'rxjs';
6
7
 
8
+ /**
9
+ * Values accepted by the `aria-haspopup` input of `ButtonDirective`. `"false"` (the default) omits the attribute.
10
+ */
11
+ type ButtonAriaHasPopup = "dialog" | "false" | "grid" | "listbox" | "menu" | "tree" | "true";
12
+
7
13
  declare const buttonThemeVariants: (props?: ({
8
14
  disabled?: boolean | null | undefined;
9
15
  iconOnly?: boolean | null | undefined;
@@ -18,41 +24,44 @@ type ButtonVariantsInput = VariantInputs<ButtonVariantProps>;
18
24
 
19
25
  declare class ButtonDirective implements ButtonVariantsInput {
20
26
  #private;
21
- protected readonly displaysPressedState: _angular_core.Signal<boolean>;
27
+ protected readonly baseClass: _angular_core.Signal<string>;
22
28
  protected readonly effectiveDisabled: _angular_core.Signal<boolean>;
23
29
  protected readonly effectiveLook: _angular_core.Signal<"default" | "primary" | "success" | "error" | "warning" | "info" | "outline" | "secondary" | "ghost" | "link" | "clear" | null | undefined>;
24
30
  protected readonly effectiveRounded: _angular_core.Signal<"full" | "large" | "medium" | "none" | "small" | null | undefined>;
25
31
  protected readonly effectiveSize: _angular_core.Signal<"large" | "medium" | "small" | null | undefined>;
26
32
  protected readonly effectiveToggleable: _angular_core.Signal<boolean>;
27
- protected readonly isInButtonGroup: _angular_core.Signal<boolean>;
28
- protected readonly baseClass: _angular_core.Signal<string>;
29
33
  protected readonly loadingSize: _angular_core.Signal<12 | 16 | 14>;
30
34
  /**
31
35
  * @description Value forwarded to the `aria-haspopup` attribute. Set when this button triggers a popup, menu,
32
36
  * listbox, tree, grid, or dialog. Omit or leave as `"false"` for plain action buttons.
33
37
  * @default "false"
34
38
  */
35
- readonly ariaHasPopup: _angular_core.InputSignal<string>;
39
+ readonly ariaHasPopup: _angular_core.InputSignal<ButtonAriaHasPopup>;
36
40
  /**
37
41
  * @description Renders the component with reduced visual emphasis and removes pointer interaction.
38
- * When inside a `ButtonGroup`, the group's disabled state takes precedence.
42
+ * Accepts the bare attribute form (`<button monaButton disabled>`).
43
+ * When inside a `ButtonGroup`, the button is disabled when either it or the group is disabled.
39
44
  * @default false
40
45
  */
41
- readonly disabled: _angular_core.ModelSignal<boolean>;
46
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
42
47
  /**
43
48
  * @description Removes horizontal padding and fixes a square aspect ratio sized to match `size`.
44
- * Provide `aria-label` on the host when using icon-only buttons.
49
+ * Provide `aria-label` on the host when using icon-only buttons; in dev mode, an icon-only button without an
50
+ * accessible name logs a warning.
45
51
  * @default false
46
52
  */
47
- readonly iconOnly: _angular_core.InputSignal<boolean>;
53
+ readonly iconOnly: _angular_core.InputSignalWithTransform<boolean, unknown>;
48
54
  /**
49
55
  * @description Displays a loading indicator and prevents interaction while an operation is in progress.
50
- * Sets `aria-busy="true"` on the host.
56
+ * Sets `aria-busy="true"` and `aria-disabled="true"` on the host. The button stays focusable, so keyboard focus
57
+ * isn't lost when loading starts, and clicks (including form submission) are blocked until it ends.
51
58
  * @default false
52
59
  */
53
- readonly loading: _angular_core.ModelSignal<boolean>;
60
+ readonly loading: _angular_core.InputSignalWithTransform<boolean, unknown>;
54
61
  /**
55
62
  * @description Visual style variant of the button. When inside a `ButtonGroup`, the group's look takes precedence.
63
+ * `"outline"` looks the same as `"default"`. `"clear"` shows no selected state, so use another look for
64
+ * toggle buttons.
56
65
  * @default "default"
57
66
  */
58
67
  readonly look: _angular_core.ModelSignal<"default" | "primary" | "success" | "error" | "warning" | "info" | "outline" | "secondary" | "ghost" | "link" | "clear" | null | undefined>;
@@ -75,23 +84,23 @@ declare class ButtonDirective implements ButtonVariantsInput {
75
84
  */
76
85
  readonly size: _angular_core.InputSignal<"large" | "medium" | "small" | null | undefined>;
77
86
  /**
78
- * @description Tab index of the host element. Automatically overridden to `-1` when the button is disabled or loading.
79
- * Accepts a numeric string and converts it to a number.
87
+ * @description Tab index of the host element. Automatically overridden to `-1` when the button is disabled.
88
+ * Accepts a numeric string and converts it to a number; a value that is not a number falls back to `0`.
80
89
  * @default 0
81
90
  */
82
91
  readonly tabindex: _angular_core.InputSignalWithTransform<number, string | number>;
92
+ /**
93
+ * @description Enables toggle behavior — each click flips the `selected` state and `aria-pressed` is managed.
94
+ * Accepts the bare attribute form. Buttons in a `ButtonGroup` are toggleable unless this is set to `false`.
95
+ * @default undefined
96
+ */
97
+ readonly toggleable: _angular_core.InputSignalWithTransform<boolean | undefined, unknown>;
83
98
  /**
84
99
  * @description Native `type` attribute of the button. Defaults to `"button"` to prevent accidental
85
100
  * form submission; set to `"submit"` or `"reset"` explicitly when that behavior is intended.
86
101
  * @default "button"
87
102
  */
88
103
  readonly type: _angular_core.InputSignal<"button" | "reset" | "submit">;
89
- /**
90
- * @description Enables toggle behavior — each click flips the `selected` state and `aria-pressed` is managed.
91
- * Must use `[toggleable]="true"` binding syntax, not bare attribute form.
92
- * @default undefined
93
- */
94
- readonly toggleable: _angular_core.InputSignal<boolean | undefined>;
95
104
  /**
96
105
  * @description Additional CSS classes merged onto the host element via `tailwind-merge`.
97
106
  * @default ""
@@ -99,19 +108,34 @@ declare class ButtonDirective implements ButtonVariantsInput {
99
108
  readonly userClass: _angular_core.InputSignal<string>;
100
109
  constructor();
101
110
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ButtonDirective, never>;
102
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ButtonDirective, "button[monaButton]", never, { "ariaHasPopup": { "alias": "aria-haspopup"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "iconOnly": { "alias": "iconOnly"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "look": { "alias": "look"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "tabindex": { "alias": "tabindex"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "toggleable": { "alias": "toggleable"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, { "disabled": "disabledChange"; "loading": "loadingChange"; "look": "lookChange"; "selected": "selectedChange"; }, never, never, true, never>;
111
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ButtonDirective, "button[monaButton]", never, { "ariaHasPopup": { "alias": "aria-haspopup"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "iconOnly": { "alias": "iconOnly"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "look": { "alias": "look"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "tabindex": { "alias": "tabindex"; "required": false; "isSignal": true; }; "toggleable": { "alias": "toggleable"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, { "look": "lookChange"; "selected": "selectedChange"; }, never, never, true, never>;
103
112
  }
104
113
 
114
+ /**
115
+ * Coordinates a `mona-button-group` with its buttons: the group publishes its look, size, rounding, disabled state
116
+ * and members here, and buttons report clicks and receive selection changes through it. It is public so the
117
+ * button-group entry point can provide it; applications don't need to use it directly.
118
+ */
105
119
  declare class ButtonService {
120
+ #private;
106
121
  readonly buttonClick$: Subject<[ButtonDirective, boolean]>;
107
122
  readonly buttonSelect$: Subject<[ButtonDirective, boolean]>;
108
123
  readonly groupDisabled: _angular_core.WritableSignal<boolean>;
109
124
  readonly groupLook: _angular_core.WritableSignal<"default" | "primary" | "success" | "error" | "warning" | "info" | "outline" | "secondary" | "ghost" | "link" | "clear" | null | undefined>;
110
125
  readonly groupRounded: _angular_core.WritableSignal<"full" | "large" | "medium" | "none" | "small" | null | undefined>;
111
126
  readonly groupSize: _angular_core.WritableSignal<"large" | "medium" | "small" | null | undefined>;
127
+ /**
128
+ * The buttons that belong to the group. Only these follow the group's look, size, rounding, disabled state and
129
+ * selection; other buttons that can inject this service ignore it.
130
+ */
131
+ readonly members: Signal<readonly ButtonDirective[]>;
132
+ /**
133
+ * Sets the source of the group's members, such as the group's `contentChildren(ButtonDirective)` query.
134
+ */
135
+ setMembers(members: Signal<readonly ButtonDirective[]>): void;
112
136
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ButtonService, never>;
113
137
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<ButtonService>;
114
138
  }
115
139
 
116
140
  export { ButtonDirective, ButtonService };
117
- export type { ButtonVariantProps, ButtonVariantsInput };
141
+ export type { ButtonAriaHasPopup, ButtonVariantProps, ButtonVariantsInput };