@mittwald/flow-react-components 1.5.39 → 1.5.41

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.
@@ -1,16 +1,13 @@
1
+ import { OverlayState, OverlayCloseHandler, OverlayCloseOptions, OverlayOpenHandler, OverlayOpenStateHandler } from '../../../_bundled/flow-components-base/index';
1
2
  import { DependencyList } from 'react';
2
3
  import { FlowComponentName } from '../../../components/propTypes';
3
- export type OverlayOpenHandler = () => unknown;
4
- export type OverlayCloseHandler = () => unknown;
5
- export type OverlayOpenStateHandler = (isOpen: boolean) => unknown;
6
- type DisposerFn = () => void;
7
- export interface CloseOverlayOptions {
4
+ export type { OverlayCloseHandler, OverlayOpenHandler, OverlayOpenStateHandler, } from '../../../_bundled/flow-components-base/index';
5
+ export interface CloseOverlayOptions extends OverlayCloseOptions {
8
6
  /**
9
7
  * The overlay to close. Omitted, the nearest enclosing overlay is closed –
10
8
  * the same thing `closeOverlay={true}` means.
11
9
  */
12
10
  overlay?: FlowComponentName | OverlayController;
13
- bypassConfirmation?: boolean;
14
11
  }
15
12
  export interface OnOverlayClosedOptions {
16
13
  dependencies?: DependencyList;
@@ -35,48 +32,17 @@ export interface OverlayControllerOptions {
35
32
  */
36
33
  confirmOnClose?: boolean;
37
34
  }
38
- type ConstructorOptions = Pick<OverlayControllerOptions, "isDefaultOpen" | "confirmOnClose">;
39
- export declare class OverlayController {
40
- isOpen: boolean;
41
- isContentSuspended: boolean;
42
- private onOpenHandlers;
43
- private onCloseHandlers;
44
- private onOpenChangeHandlers;
45
- showConfirmationModal: boolean;
46
- closeIsConfirmed: boolean;
47
- private readonly confirmOnCloseFromOptions;
48
- /**
49
- * Every mounted component that has an opinion on close confirmation
50
- * contributes one entry here – e.g. a `Modal` with a `confirmOnClose` prop
51
- * and a `Form` tracking its dirty state. Combining them instead of assigning
52
- * a single flag keeps them from overwriting each other.
53
- */
54
- private confirmOnCloseSources;
55
- /**
56
- * Active grants that allow closing without a confirmation. Each entry is
57
- * scoped to an ongoing operation that legitimately closes the overlay – e.g.
58
- * a `Form` submit – and is dropped again when that operation has finished, so
59
- * an operation that does _not_ close the overlay leaves the confirmation
60
- * armed.
61
- */
62
- private closeWithoutConfirmationGrants;
63
- /**
64
- * The open state a `setOpen` call is currently applying. Handlers run before
65
- * `isOpen` is assigned, so a handler that calls `setOpen` again would not be
66
- * caught by the equality check at the top and would recurse.
67
- */
68
- private openStateInFlight;
69
- constructor(options?: ConstructorOptions);
70
- /** Whether closing this overlay currently requires a confirmation. */
71
- get confirmOnCloseEnabled(): boolean;
35
+ /**
36
+ * The state is `OverlayState` from `@mittwald/flow-components-base`, shared
37
+ * with every remote binding; this adds the hooks.
38
+ */
39
+ export declare class OverlayController extends OverlayState<CloseOptions> {
72
40
  useUpdateOptions(options?: OverlayControllerOptions): void;
73
41
  /**
74
42
  * Registers the calling component as a close confirmation source for as long
75
43
  * as it is mounted. `undefined` contributes nothing at all.
76
44
  */
77
45
  private useConfirmOnCloseSource;
78
- private setConfirmOnCloseSource;
79
- private removeConfirmOnCloseSource;
80
46
  /**
81
47
  * Can be used to execute a callback when the Overlay has unmounted – means
82
48
  * after any closing animation.
@@ -85,27 +51,7 @@ export declare class OverlayController {
85
51
  */
86
52
  useOnClosed(callback: () => unknown, options?: OnOverlayClosedOptions): void;
87
53
  static useNew(options?: OverlayControllerOptions): OverlayController;
88
- private addOpenStateHandler;
89
54
  private useOnHandler;
90
- private executeHandlers;
91
- private executeOnClose;
92
- private executeOnOpen;
93
- private executeOnOpenChange;
94
- addOnClose(handler: OverlayCloseHandler): DisposerFn;
95
- addOnOpen(handler: OverlayOpenHandler): DisposerFn;
96
- addOnOpenChange(handler: OverlayOpenStateHandler): DisposerFn;
97
- open(): void;
98
- close(options?: CloseOptions): void;
99
- toggle(): void;
100
- setOpen(toOpen: boolean, options?: CloseOptions): void;
101
- /**
102
- * Sets the open state without running any handler. Use it to mirror a
103
- * controlled `isOpen` prop, whose change comes from the consumer – notifying
104
- * them of their own state would echo it back.
105
- */
106
- syncOpen(toOpen: boolean): void;
107
- private applyOpenState;
108
- setIsContentSuspended(to: boolean): void;
109
55
  useIsOpen(): boolean;
110
56
  useIsContentSuspended(): boolean;
111
57
  useShowConfirmationModal(): boolean;
@@ -115,16 +61,4 @@ export declare class OverlayController {
115
61
  readonly cancel: () => void;
116
62
  readonly confirm: () => void;
117
63
  } | undefined;
118
- /**
119
- * Allows closing this overlay without a confirmation until the returned
120
- * disposer is called. Use it around an operation that may legitimately close
121
- * the overlay – e.g. a `Form` submit, where a "discard unsaved changes?"
122
- * prompt would be nonsense – and dispose it as soon as that operation has
123
- * finished. An operation that ends without closing the overlay therefore
124
- * leaves the confirmation armed (#2775).
125
- */
126
- grantCloseWithoutConfirmation(): DisposerFn;
127
- confirmClose(): void;
128
- cancelConfirmation(): void;
129
64
  }
130
- export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/flow-react-components",
3
- "version": "1.5.39",
3
+ "version": "1.5.41",
4
4
  "type": "module",
5
5
  "description": "A React implementation of Flow, mittwald’s design system",
6
6
  "homepage": "https://flow.mittwald.de",
@@ -84,9 +84,9 @@
84
84
  "@internationalized/string-compiler": "^3.4.1",
85
85
  "@lezer/common": "^1.5.2",
86
86
  "@lezer/highlight": "^1.2.3",
87
- "@mittwald/flow-icons": "^1.5.39",
87
+ "@mittwald/flow-icons": "^1.5.41",
88
88
  "@mittwald/password-tools-js": "^3.0.0",
89
- "@mittwald/react-tunnel": "^1.5.39",
89
+ "@mittwald/react-tunnel": "^1.5.41",
90
90
  "@mittwald/react-use-promise": "^4.2.2",
91
91
  "@react-aria/form": "^3.2.1",
92
92
  "@react-aria/i18n": "^3.13.1",
@@ -139,13 +139,13 @@
139
139
  "@internationalized/date": "^3.12.3",
140
140
  "@lezer/generator": "^1.8.0",
141
141
  "@lezer/lr": "^1.4.10",
142
- "@mittwald/flow-components-base": "1.5.39",
143
- "@mittwald/flow-core": "1.5.39",
144
- "@mittwald/flow-design-tokens": "1.5.39",
145
- "@mittwald/flow-icons-base": "1.5.39",
142
+ "@mittwald/flow-components-base": "1.5.41",
143
+ "@mittwald/flow-core": "1.5.41",
144
+ "@mittwald/flow-design-tokens": "1.5.41",
145
+ "@mittwald/flow-icons-base": "1.5.41",
146
146
  "@mittwald/react-use-promise": "^4.2.2",
147
147
  "@mittwald/remote-dom-react": "1.2.2-mittwald.10",
148
- "@mittwald/typescript-config": "1.5.39",
148
+ "@mittwald/typescript-config": "1.5.41",
149
149
  "@nx/storybook": "^22.7.6",
150
150
  "@storybook/addon-a11y": "^10.5.10",
151
151
  "@storybook/addon-actions": "^9.0.8",
@@ -199,7 +199,7 @@
199
199
  },
200
200
  "peerDependencies": {
201
201
  "@internationalized/date": "^3.12.2",
202
- "@mittwald/flow-icons-pro": "1.5.39",
202
+ "@mittwald/flow-icons-pro": "1.5.41",
203
203
  "@mittwald/react-use-promise": "^4.2.2",
204
204
  "next": "^16.2.3",
205
205
  "react": "^19.2.0",
@@ -223,5 +223,5 @@
223
223
  "browserslist": [
224
224
  "baseline widely available"
225
225
  ],
226
- "gitHead": "8c64cc3870d11c76b8b72709d48857e4e1d6b736"
226
+ "gitHead": "cf4d4ef710dab68d8041026fb8cfb43ce61f8990"
227
227
  }