ngwr 7.1.0 → 7.2.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 (58) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +4 -2
  3. package/alert/styles/_index.scss +2 -0
  4. package/back-top/styles/_index.scss +4 -2
  5. package/cascader/styles/_index.scss +16 -0
  6. package/command-palette/styles/_index.scss +28 -0
  7. package/descriptions/styles/_index.scss +59 -0
  8. package/dialog/styles/_index.scss +2 -0
  9. package/dropdown/styles/_index.scss +1 -0
  10. package/fesm2022/ngwr-cascader.mjs +2 -2
  11. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  12. package/fesm2022/ngwr-command-palette.mjs +17 -3
  13. package/fesm2022/ngwr-command-palette.mjs.map +1 -1
  14. package/fesm2022/ngwr-descriptions.mjs +11 -2
  15. package/fesm2022/ngwr-descriptions.mjs.map +1 -1
  16. package/fesm2022/ngwr-dialog.mjs +11 -4
  17. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  18. package/fesm2022/ngwr-dropdown.mjs +35 -11
  19. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  20. package/fesm2022/ngwr-lightbox.mjs +2 -2
  21. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  22. package/fesm2022/ngwr-overlay.mjs +70 -1
  23. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  24. package/fesm2022/ngwr-page-header.mjs +11 -3
  25. package/fesm2022/ngwr-page-header.mjs.map +1 -1
  26. package/fesm2022/ngwr-pagination.mjs +1 -1
  27. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  28. package/fesm2022/ngwr-popover.mjs +36 -10
  29. package/fesm2022/ngwr-popover.mjs.map +1 -1
  30. package/fesm2022/ngwr-select.mjs +35 -14
  31. package/fesm2022/ngwr-select.mjs.map +1 -1
  32. package/fesm2022/ngwr-stepper.mjs +11 -2
  33. package/fesm2022/ngwr-stepper.mjs.map +1 -1
  34. package/fesm2022/ngwr-table.mjs +1 -1
  35. package/fesm2022/ngwr-table.mjs.map +1 -1
  36. package/fesm2022/ngwr-version.mjs +1 -1
  37. package/fesm2022/ngwr-version.mjs.map +1 -1
  38. package/lightbox/styles/_index.scss +2 -0
  39. package/overlay/styles/_index.scss +31 -0
  40. package/package.json +6 -5
  41. package/page-header/styles/_index.scss +16 -0
  42. package/popover/styles/_index.scss +1 -0
  43. package/select/styles/_index.scss +27 -0
  44. package/stepper/styles/_index.scss +30 -0
  45. package/styles.scss +1 -0
  46. package/theme/styles/_mixins.scss +47 -0
  47. package/toast/styles/_index.scss +30 -1
  48. package/tree/styles/_index.scss +15 -0
  49. package/types/ngwr-command-palette.d.ts +13 -1
  50. package/types/ngwr-descriptions.d.ts +8 -1
  51. package/types/ngwr-dialog.d.ts +7 -0
  52. package/types/ngwr-dropdown.d.ts +10 -1
  53. package/types/ngwr-overlay.d.ts +69 -1
  54. package/types/ngwr-page-header.d.ts +8 -1
  55. package/types/ngwr-popover.d.ts +10 -1
  56. package/types/ngwr-select.d.ts +10 -1
  57. package/types/ngwr-stepper.d.ts +8 -1
  58. package/types/ngwr-version.d.ts +1 -1
@@ -68,6 +68,74 @@ declare class WrOverlayContainer extends OverlayContainer {
68
68
  */
69
69
  declare function provideWrOverlay(): EnvironmentProviders;
70
70
 
71
+ /**
72
+ * @license
73
+ *
74
+ * Use of this source code is governed by an MIT-style license that can be
75
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
76
+ */
77
+
78
+ /** Configuration for responsive (bottom-sheet) overlay presentation. */
79
+ interface WrResponsiveOverlaysConfig {
80
+ /**
81
+ * Viewport width (CSS px) at or below which overlays present as a
82
+ * bottom-sheet instead of a floating panel. @default 640
83
+ */
84
+ readonly breakpoint: number;
85
+ }
86
+ /**
87
+ * When set, overlay services (dialog, select, dropdown, …) present as a
88
+ * slide-up bottom-sheet on viewports at or below `breakpoint`. `null`
89
+ * (the default) keeps every overlay floating. Configure via
90
+ * {@link provideWrResponsiveOverlays}; override per call with a
91
+ * component's `responsive` option.
92
+ *
93
+ * @internal
94
+ */
95
+ declare const WR_RESPONSIVE_OVERLAYS: InjectionToken<WrResponsiveOverlaysConfig | null>;
96
+ /**
97
+ * Decide whether an overlay should present as a bottom-sheet for the
98
+ * current viewport.
99
+ *
100
+ * - `responsive === true` — sheet on small viewports regardless of config.
101
+ * - `responsive === false` — never a sheet.
102
+ * - `responsive === undefined` — follow the global config (sheet when
103
+ * {@link provideWrResponsiveOverlays} is configured).
104
+ *
105
+ * SSR-safe: returns `false` when there's no `window`.
106
+ *
107
+ * @internal
108
+ */
109
+ declare function wrPresentAsSheet(responsive: boolean | undefined, config: WrResponsiveOverlaysConfig | null): boolean;
110
+
111
+ /**
112
+ * @license
113
+ *
114
+ * Use of this source code is governed by an MIT-style license that can be
115
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
116
+ */
117
+
118
+ /**
119
+ * Opt every NGWR overlay into responsive presentation — on viewports at or
120
+ * below `breakpoint`, dialogs / selects / dropdowns and friends slide up as
121
+ * a full-width bottom-sheet instead of a floating panel. Built on the same
122
+ * overlay plumbing, so focus-trap, backdrop and scroll-blocking carry over.
123
+ *
124
+ * Individual components can still opt out (or in) per instance via their
125
+ * `responsive` option.
126
+ *
127
+ * @example
128
+ * ```ts
129
+ * bootstrapApplication(AppComponent, {
130
+ * providers: [provideWrOverlay(), provideWrResponsiveOverlays()],
131
+ * });
132
+ *
133
+ * // Custom breakpoint:
134
+ * provideWrResponsiveOverlays({ breakpoint: 768 });
135
+ * ```
136
+ */
137
+ declare function provideWrResponsiveOverlays(config?: Partial<WrResponsiveOverlaysConfig>): EnvironmentProviders;
138
+
71
139
  /**
72
140
  * @license
73
141
  *
@@ -107,4 +175,4 @@ declare const WR_OVERLAY: InjectionToken<Overlay>;
107
175
  */
108
176
  declare const WR_OVERLAY_CONTAINER: InjectionToken<OverlayContainer>;
109
177
 
110
- export { WR_OVERLAY, WR_OVERLAY_CONTAINER, WrOverlayContainer, provideWrOverlay };
178
+ export { WR_OVERLAY, WR_OVERLAY_CONTAINER, WR_RESPONSIVE_OVERLAYS, WrOverlayContainer, provideWrOverlay, provideWrResponsiveOverlays, wrPresentAsSheet };
@@ -28,8 +28,15 @@ declare class WrPageHeader {
28
28
  readonly title: _angular_core.InputSignal<string>;
29
29
  /** Secondary line below the title. */
30
30
  readonly subtitle: _angular_core.InputSignal<string>;
31
+ /**
32
+ * Stack the title and actions vertically when the header's own box is too
33
+ * narrow to sit them side by side (a container query on its own width, not
34
+ * the viewport — so it adapts inside a narrow column or split pane).
35
+ * @default false
36
+ */
37
+ readonly responsive: _angular_core.InputSignalWithTransform<boolean, any>;
31
38
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<WrPageHeader, never>;
32
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<WrPageHeader, "wr-page-header", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; "subtitle": { "alias": "subtitle"; "required": false; "isSignal": true; }; }, {}, never, ["[wrPageHeaderBreadcrumbs]", "[wrPageHeaderActions]", "[wrPageHeaderExtra]"], true, never>;
39
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<WrPageHeader, "wr-page-header", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; "subtitle": { "alias": "subtitle"; "required": false; "isSignal": true; }; "responsive": { "alias": "responsive"; "required": false; "isSignal": true; }; }, {}, never, ["[wrPageHeaderBreadcrumbs]", "[wrPageHeaderActions]", "[wrPageHeaderExtra]"], true, never>;
33
40
  }
34
41
 
35
42
  export { WrPageHeader };
@@ -1,5 +1,6 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import { TemplateRef } from '@angular/core';
3
+ import { BooleanInput } from '@angular/cdk/coercion';
3
4
 
4
5
  /**
5
6
  * @license
@@ -37,12 +38,20 @@ declare class WrPopover {
37
38
  readonly showDelay: _angular_core.InputSignalWithTransform<number, unknown>;
38
39
  /** Tooltip only — delay before hiding, in ms. @default 60 */
39
40
  readonly hideDelay: _angular_core.InputSignalWithTransform<number, unknown>;
41
+ /**
42
+ * Popover mode only — present the panel as a full-width bottom-sheet on
43
+ * small viewports instead of an anchored panel. `undefined` follows the
44
+ * app-wide `provideWrResponsiveOverlays()` setting; `true`/`false`
45
+ * overrides it. Tooltips never become sheets. @default undefined
46
+ */
47
+ readonly responsive: _angular_core.InputSignalWithTransform<boolean | undefined, BooleanInput>;
40
48
  /** Fires after the panel opens. */
41
49
  readonly opened: _angular_core.OutputEmitterRef<void>;
42
50
  /** Fires after the panel closes. */
43
51
  readonly closed: _angular_core.OutputEmitterRef<void>;
44
52
  private readonly host;
45
53
  private readonly overlay;
54
+ private readonly responsiveConfig;
46
55
  private readonly vcr;
47
56
  private readonly scrollStrategies;
48
57
  private readonly destroyRef;
@@ -83,7 +92,7 @@ declare class WrPopover {
83
92
  private scheduleHoverClose;
84
93
  private clearHoverClose;
85
94
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<WrPopover, never>;
86
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<WrPopover, "[wrPopover]", never, { "content": { "alias": "wrPopover"; "required": true; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "trigger": { "alias": "trigger"; "required": false; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; "showDelay": { "alias": "showDelay"; "required": false; "isSignal": true; }; "hideDelay": { "alias": "hideDelay"; "required": false; "isSignal": true; }; }, { "opened": "opened"; "closed": "closed"; }, never, never, true, never>;
95
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<WrPopover, "[wrPopover]", never, { "content": { "alias": "wrPopover"; "required": true; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "trigger": { "alias": "trigger"; "required": false; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; "showDelay": { "alias": "showDelay"; "required": false; "isSignal": true; }; "hideDelay": { "alias": "hideDelay"; "required": false; "isSignal": true; }; "responsive": { "alias": "responsive"; "required": false; "isSignal": true; }; }, { "opened": "opened"; "closed": "closed"; }, never, never, true, never>;
87
96
  }
88
97
 
89
98
  export { WrPopover };
@@ -1,6 +1,7 @@
1
1
  import * as ngwr_i18n from 'ngwr/i18n';
2
2
  import * as _angular_core from '@angular/core';
3
3
  import { InjectionToken, Signal, TemplateRef, ElementRef } from '@angular/core';
4
+ import { BooleanInput } from '@angular/cdk/coercion';
4
5
  import { ControlValueAccessor } from '@angular/forms';
5
6
  import { Observable } from 'rxjs';
6
7
 
@@ -154,6 +155,13 @@ declare class WrSelect implements ControlValueAccessor, WrSelectContext {
154
155
  readonly disabled: _angular_core.InputSignalWithTransform<boolean, any>;
155
156
  /** Pill-shaped corners on the trigger. @default false */
156
157
  readonly rounded: _angular_core.InputSignalWithTransform<boolean, any>;
158
+ /**
159
+ * Present the option panel as a full-width bottom-sheet on small
160
+ * viewports instead of an anchored dropdown. `undefined` follows the
161
+ * app-wide `provideWrResponsiveOverlays()` setting; `true`/`false`
162
+ * overrides it. @default undefined
163
+ */
164
+ readonly responsive: _angular_core.InputSignalWithTransform<boolean | undefined, BooleanInput>;
157
165
  /**
158
166
  * Behavior mode. `<wr-select>` is the unified combobox primitive —
159
167
  * pick the shape via `[mode]`:
@@ -309,6 +317,7 @@ declare class WrSelect implements ControlValueAccessor, WrSelectContext {
309
317
  protected readonly searchDisplay: _angular_core.Signal<string>;
310
318
  private readonly host;
311
319
  private readonly overlay;
320
+ private readonly responsiveConfig;
312
321
  private readonly vcr;
313
322
  private readonly scrollStrategies;
314
323
  private readonly destroyRef;
@@ -346,7 +355,7 @@ declare class WrSelect implements ControlValueAccessor, WrSelectContext {
346
355
  private openOverlay;
347
356
  private closeOverlay;
348
357
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<WrSelect, never>;
349
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<WrSelect, "wr-select", never, { "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "clearLabel": { "alias": "clearLabel"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "displayWith": { "alias": "displayWith"; "required": false; "isSignal": true; }; "loader": { "alias": "loader"; "required": false; "isSignal": true; }; "debounceMs": { "alias": "debounceMs"; "required": false; "isSignal": true; }; "minChars": { "alias": "minChars"; "required": false; "isSignal": true; }; "freeText": { "alias": "freeText"; "required": false; "isSignal": true; }; "noResultsText": { "alias": "noResultsText"; "required": false; "isSignal": true; }; "loadingText": { "alias": "loadingText"; "required": false; "isSignal": true; }; "separators": { "alias": "separators"; "required": false; "isSignal": true; }; "allowDuplicates": { "alias": "allowDuplicates"; "required": false; "isSignal": true; }; "validate": { "alias": "validate"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "maxItems": { "alias": "maxItems"; "required": false; "isSignal": true; }; "maxTagCount": { "alias": "maxTagCount"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
358
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<WrSelect, "wr-select", never, { "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "clearLabel": { "alias": "clearLabel"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "responsive": { "alias": "responsive"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "displayWith": { "alias": "displayWith"; "required": false; "isSignal": true; }; "loader": { "alias": "loader"; "required": false; "isSignal": true; }; "debounceMs": { "alias": "debounceMs"; "required": false; "isSignal": true; }; "minChars": { "alias": "minChars"; "required": false; "isSignal": true; }; "freeText": { "alias": "freeText"; "required": false; "isSignal": true; }; "noResultsText": { "alias": "noResultsText"; "required": false; "isSignal": true; }; "loadingText": { "alias": "loadingText"; "required": false; "isSignal": true; }; "separators": { "alias": "separators"; "required": false; "isSignal": true; }; "allowDuplicates": { "alias": "allowDuplicates"; "required": false; "isSignal": true; }; "validate": { "alias": "validate"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "maxItems": { "alias": "maxItems"; "required": false; "isSignal": true; }; "maxTagCount": { "alias": "maxTagCount"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
350
359
  }
351
360
 
352
361
  /**
@@ -80,6 +80,13 @@ declare class WrStepper implements WrStepperContext {
80
80
  readonly orientation: _angular_core.InputSignal<"horizontal" | "vertical">;
81
81
  /** Lock steps after the latest completed one. @default false */
82
82
  readonly linear: _angular_core.InputSignalWithTransform<boolean, any>;
83
+ /**
84
+ * Drop a horizontal stepper to a vertical layout when its own box is too
85
+ * narrow for the row (a container query on its own width, not the
86
+ * viewport — so it adapts inside a narrow column or side panel). No effect
87
+ * when `orientation` is already `vertical`. @default false
88
+ */
89
+ readonly responsive: _angular_core.InputSignalWithTransform<boolean, any>;
83
90
  protected readonly steps: _angular_core.Signal<readonly WrStep[]>;
84
91
  protected readonly classes: _angular_core.Signal<string>;
85
92
  constructor();
@@ -92,7 +99,7 @@ declare class WrStepper implements WrStepperContext {
92
99
  next(): void;
93
100
  prev(): void;
94
101
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<WrStepper, never>;
95
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<WrStepper, "wr-stepper", never, { "active": { "alias": "active"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "linear": { "alias": "linear"; "required": false; "isSignal": true; }; }, { "active": "activeChange"; }, ["steps"], ["*"], true, never>;
102
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<WrStepper, "wr-stepper", never, { "active": { "alias": "active"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "linear": { "alias": "linear"; "required": false; "isSignal": true; }; "responsive": { "alias": "responsive"; "required": false; "isSignal": true; }; }, { "active": "activeChange"; }, ["steps"], ["*"], true, never>;
96
103
  }
97
104
 
98
105
  export { WR_STEPPER, WrStep, WrStepper };
@@ -16,7 +16,7 @@ import { InjectionToken } from '@angular/core';
16
16
  * Distinct from `Version` exported by `@angular/core`, which reports the
17
17
  * loaded Angular runtime version (e.g. `'21.2.13'`), not ngwr's.
18
18
  */
19
- declare const NGWR_VERSION = "7.1.0";
19
+ declare const NGWR_VERSION = "7.2.0";
20
20
 
21
21
  /**
22
22
  * @license