@zag-js/popover 2.0.0-next.2 → 2.0.0-next.4
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/dist/index.d.mts +8 -10
- package/dist/index.d.ts +8 -10
- package/dist/index.js +12 -38
- package/dist/index.mjs +2 -7
- package/dist/popover.anatomy.d.mts +2 -6
- package/dist/popover.anatomy.d.ts +2 -6
- package/dist/popover.anatomy.js +8 -44
- package/dist/popover.anatomy.mjs +4 -18
- package/dist/popover.connect.d.mts +3 -9
- package/dist/popover.connect.d.ts +3 -9
- package/dist/popover.connect.js +270 -212
- package/dist/popover.connect.mjs +263 -174
- package/dist/popover.dom.d.mts +19 -21
- package/dist/popover.dom.d.ts +19 -21
- package/dist/popover.dom.js +59 -84
- package/dist/popover.dom.mjs +38 -43
- package/dist/popover.machine.d.mts +2 -9
- package/dist/popover.machine.d.ts +2 -9
- package/dist/popover.machine.js +466 -357
- package/dist/popover.machine.mjs +459 -319
- package/dist/popover.props.d.mts +3 -10
- package/dist/popover.props.d.ts +3 -10
- package/dist/popover.props.js +34 -59
- package/dist/popover.props.mjs +30 -33
- package/dist/popover.style.d.mts +15 -0
- package/dist/popover.style.d.ts +15 -0
- package/dist/popover.style.js +15 -0
- package/dist/popover.style.mjs +11 -0
- package/dist/popover.types.d.mts +350 -237
- package/dist/popover.types.d.ts +350 -237
- package/dist/popover.types.js +4 -18
- package/dist/popover.types.mjs +1 -0
- package/package.json +12 -12
package/dist/popover.types.d.ts
CHANGED
|
@@ -1,250 +1,363 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DismissableElementHandlers,
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { ViewportSize } from "./popover.style.js";
|
|
2
|
+
import { DismissableElementHandlers, LayerSnapshot, PersistentElementOptions } from "@zag-js/dismissable";
|
|
3
|
+
import { CommonProperties, DirectionProperty, MaybeElement, PopupActivationDirection, PropTypes } from "@zag-js/types";
|
|
4
|
+
import { EventObject, Machine, Service } from "@zag-js/core";
|
|
5
|
+
import { AnimationFrame } from "@zag-js/dom-query";
|
|
6
|
+
import { Placement, PlacementSide, PositioningOptions } from "@zag-js/popper";
|
|
7
|
+
/**
|
|
8
|
+
* Why the next animation should be skipped:
|
|
9
|
+
* - `click`: opened or closed from the keyboard on the trigger
|
|
10
|
+
* - `dismiss`: closed with Escape
|
|
11
|
+
* - `focus`: closed because focus left
|
|
12
|
+
* - `trigger-change`: moved between triggers, so repositioning snaps
|
|
13
|
+
*/
|
|
14
|
+
export type InstantType = "click" | "dismiss" | "focus" | "trigger-change" | null;
|
|
15
|
+
/**
|
|
16
|
+
* What opened or closed the popover:
|
|
17
|
+
* - `trigger-click`: the trigger was pressed
|
|
18
|
+
* - `close-trigger`: the close trigger was pressed
|
|
19
|
+
* - `escape-key`: Escape was pressed
|
|
20
|
+
* - `interact-outside`: the pointer was pressed outside
|
|
21
|
+
* - `focus-outside`: focus moved outside
|
|
22
|
+
* - `script`: `setOpen` was called
|
|
23
|
+
*/
|
|
24
|
+
export type OpenChangeReason = "trigger-click" | "close-trigger" | "escape-key" | "interact-outside" | "focus-outside" | "script";
|
|
25
|
+
export interface OpenChangeDetails {
|
|
26
|
+
open: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* What opened or closed the popover
|
|
29
|
+
*/
|
|
30
|
+
reason?: OpenChangeReason | undefined;
|
|
9
31
|
}
|
|
10
|
-
interface TriggerValueChangeDetails {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
32
|
+
export interface TriggerValueChangeDetails {
|
|
33
|
+
/**
|
|
34
|
+
* The value of the trigger
|
|
35
|
+
*/
|
|
36
|
+
value: string | null;
|
|
37
|
+
/**
|
|
38
|
+
* The trigger element
|
|
39
|
+
*/
|
|
40
|
+
triggerElement: HTMLElement | null;
|
|
19
41
|
}
|
|
20
|
-
interface IntlTranslations {
|
|
21
|
-
|
|
42
|
+
export interface IntlTranslations {
|
|
43
|
+
closeTriggerLabel?: string | undefined;
|
|
22
44
|
}
|
|
23
|
-
interface ElementIds {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
45
|
+
export interface ElementIds {
|
|
46
|
+
anchor?: string | undefined;
|
|
47
|
+
trigger?: (string | ((value?: string) => string)) | undefined;
|
|
48
|
+
content?: string | undefined;
|
|
49
|
+
title?: string | undefined;
|
|
50
|
+
description?: string | undefined;
|
|
51
|
+
closeTrigger?: string | undefined;
|
|
52
|
+
positioner?: string | undefined;
|
|
53
|
+
arrow?: string | undefined;
|
|
32
54
|
}
|
|
33
|
-
interface PopoverProps extends CommonProperties, DirectionProperty, DismissableElementHandlers, PersistentElementOptions {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
55
|
+
export interface PopoverProps extends CommonProperties, DirectionProperty, DismissableElementHandlers, PersistentElementOptions {
|
|
56
|
+
/**
|
|
57
|
+
* Specifies the localized strings that identifies the accessibility elements and their states
|
|
58
|
+
*/
|
|
59
|
+
translations?: IntlTranslations | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* The ids of the elements in the popover. Useful for composition.
|
|
62
|
+
*/
|
|
63
|
+
ids?: ElementIds | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Whether the popover should be modal. When set to `true`:
|
|
66
|
+
* - interaction with outside elements will be disabled
|
|
67
|
+
* - only popover content will be visible to screen readers
|
|
68
|
+
* - scrolling is blocked
|
|
69
|
+
* - focus is trapped within the popover
|
|
70
|
+
*
|
|
71
|
+
* @default false
|
|
72
|
+
*/
|
|
73
|
+
modal?: boolean | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Whether to automatically set focus on the first focusable
|
|
76
|
+
* content within the popover when opened.
|
|
77
|
+
*
|
|
78
|
+
* @default true
|
|
79
|
+
*/
|
|
80
|
+
autoFocus?: boolean | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* The element to focus on when the popover is opened.
|
|
83
|
+
* Return `false` to skip moving focus, or `null` to use the default.
|
|
84
|
+
*/
|
|
85
|
+
initialFocusEl?: (() => HTMLElement | null | false) | null | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* Element to receive focus when the popover is closed.
|
|
88
|
+
*/
|
|
89
|
+
finalFocusEl?: (() => MaybeElement) | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* Whether to restore focus to the element that had focus before the popover was opened.
|
|
92
|
+
*
|
|
93
|
+
* @default true
|
|
94
|
+
*/
|
|
95
|
+
restoreFocus?: boolean | undefined;
|
|
96
|
+
/**
|
|
97
|
+
* Whether to close the popover when the user clicks outside of the popover.
|
|
98
|
+
* @default true
|
|
99
|
+
*/
|
|
100
|
+
closeOnInteractOutside?: boolean | undefined;
|
|
101
|
+
/**
|
|
102
|
+
* Whether to close the popover when the escape key is pressed.
|
|
103
|
+
* @default true
|
|
104
|
+
*/
|
|
105
|
+
closeOnEscape?: boolean | undefined;
|
|
106
|
+
/**
|
|
107
|
+
* Function invoked when the popover opens or closes
|
|
108
|
+
*/
|
|
109
|
+
onOpenChange?: ((details: OpenChangeDetails) => void) | undefined;
|
|
110
|
+
/**
|
|
111
|
+
* The user provided options used to position the popover content
|
|
112
|
+
*/
|
|
113
|
+
positioning?: PositioningOptions | undefined;
|
|
114
|
+
/**
|
|
115
|
+
* The controlled open state of the popover
|
|
116
|
+
*/
|
|
117
|
+
open?: boolean | undefined;
|
|
118
|
+
/**
|
|
119
|
+
* The initial open state of the popover when rendered.
|
|
120
|
+
* Use when you don't need to control the open state of the popover.
|
|
121
|
+
*/
|
|
122
|
+
defaultOpen?: boolean | undefined;
|
|
123
|
+
/**
|
|
124
|
+
* The controlled trigger value
|
|
125
|
+
*/
|
|
126
|
+
triggerValue?: string | null | undefined;
|
|
127
|
+
/**
|
|
128
|
+
* The initial trigger value when rendered.
|
|
129
|
+
* Use when you don't need to control the trigger value.
|
|
130
|
+
*/
|
|
131
|
+
defaultTriggerValue?: string | null | undefined;
|
|
132
|
+
/**
|
|
133
|
+
* Function called when the trigger value changes.
|
|
134
|
+
*/
|
|
135
|
+
onTriggerValueChange?: ((details: TriggerValueChangeDetails) => void) | undefined;
|
|
113
136
|
}
|
|
114
|
-
type PropsWithDefault = "closeOnInteractOutside" | "closeOnEscape" | "modal" | "autoFocus" | "restoreFocus" | "positioning"
|
|
137
|
+
type PropsWithDefault = "closeOnInteractOutside" | "closeOnEscape" | "modal" | "autoFocus" | "restoreFocus" | "positioning";
|
|
115
138
|
interface PrivateContext {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
139
|
+
/**
|
|
140
|
+
* The computed layer stack state used for declarative styles and attributes.
|
|
141
|
+
*/
|
|
142
|
+
layer: LayerSnapshot | null;
|
|
143
|
+
/**
|
|
144
|
+
* The elements that are rendered on mount
|
|
145
|
+
*/
|
|
146
|
+
renderedElements: {
|
|
147
|
+
title: boolean;
|
|
148
|
+
description: boolean;
|
|
149
|
+
viewport: boolean;
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* The computed placement (maybe different from initial placement)
|
|
153
|
+
*/
|
|
154
|
+
currentPlacement?: Placement | undefined;
|
|
155
|
+
/**
|
|
156
|
+
* The trigger value
|
|
157
|
+
*/
|
|
158
|
+
triggerValue: string | null;
|
|
159
|
+
/**
|
|
160
|
+
* Where the current trigger sits relative to the previous one, after switching triggers while open
|
|
161
|
+
*/
|
|
162
|
+
activationDirection: PopupActivationDirection | null;
|
|
163
|
+
/** The trigger value before the last switch, kept until the switch ends */
|
|
164
|
+
previousTriggerValue: string | null;
|
|
165
|
+
/**
|
|
166
|
+
* Why the next animation should be skipped
|
|
167
|
+
*/
|
|
168
|
+
instant: InstantType;
|
|
169
|
+
/**
|
|
170
|
+
* Whether the content is animating between triggers
|
|
171
|
+
*/
|
|
172
|
+
transitioning: boolean;
|
|
173
|
+
/**
|
|
174
|
+
* The size of the current content, when the viewport is rendered
|
|
175
|
+
*/
|
|
176
|
+
viewportSize: ViewportSize | null;
|
|
135
177
|
}
|
|
136
|
-
interface PopoverSchema {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
178
|
+
export interface PopoverSchema {
|
|
179
|
+
props: PopoverProps;
|
|
180
|
+
defaultPropKey: PropsWithDefault;
|
|
181
|
+
state: "open" | "closed";
|
|
182
|
+
context: PrivateContext;
|
|
183
|
+
computed: {};
|
|
184
|
+
refs: {
|
|
185
|
+
renderedFrame: AnimationFrame;
|
|
186
|
+
initialFocusFrame: AnimationFrame;
|
|
187
|
+
cancelTriggerSwitch: VoidFunction | null;
|
|
188
|
+
awaitingViewportSize: boolean;
|
|
189
|
+
};
|
|
190
|
+
event: EventObject;
|
|
191
|
+
action: string;
|
|
192
|
+
effect: string;
|
|
193
|
+
guard: string;
|
|
146
194
|
}
|
|
147
|
-
type PopoverService = Service<PopoverSchema>;
|
|
148
|
-
type PopoverMachine = Machine<PopoverSchema>;
|
|
149
|
-
interface TriggerProps {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
195
|
+
export type PopoverService = Service<PopoverSchema>;
|
|
196
|
+
export type PopoverMachine = Machine<PopoverSchema>;
|
|
197
|
+
export interface TriggerProps {
|
|
198
|
+
/**
|
|
199
|
+
* The value that identifies this specific trigger
|
|
200
|
+
*/
|
|
201
|
+
value?: string | undefined;
|
|
154
202
|
}
|
|
155
|
-
interface TriggerState {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
203
|
+
export interface TriggerState {
|
|
204
|
+
/**
|
|
205
|
+
* The value that identifies this specific trigger
|
|
206
|
+
*/
|
|
207
|
+
value: string | undefined;
|
|
208
|
+
/**
|
|
209
|
+
* Whether this trigger is the one that opened the popover
|
|
210
|
+
*/
|
|
211
|
+
current: boolean;
|
|
212
|
+
/**
|
|
213
|
+
* Whether the popover is open
|
|
214
|
+
*/
|
|
215
|
+
open: boolean;
|
|
168
216
|
}
|
|
169
|
-
interface PositionerState {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
217
|
+
export interface PositionerState {
|
|
218
|
+
/**
|
|
219
|
+
* Whether the popover is nested within another layered element
|
|
220
|
+
*/
|
|
221
|
+
nested: boolean;
|
|
222
|
+
/**
|
|
223
|
+
* Whether the popover is moving from one trigger to another
|
|
224
|
+
*/
|
|
225
|
+
transitioning: boolean;
|
|
226
|
+
/**
|
|
227
|
+
* Why the next animation should be skipped
|
|
228
|
+
*/
|
|
229
|
+
instant: InstantType;
|
|
230
|
+
/**
|
|
231
|
+
* Whether the popover has nested layered elements within it
|
|
232
|
+
*/
|
|
233
|
+
hasNested: boolean;
|
|
178
234
|
}
|
|
179
|
-
interface
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* Whether the popover is modal
|
|
186
|
-
*/
|
|
187
|
-
modal: boolean;
|
|
188
|
-
/**
|
|
189
|
-
* Whether the popover is nested within another layered element
|
|
190
|
-
*/
|
|
191
|
-
nested: boolean;
|
|
192
|
-
/**
|
|
193
|
-
* Whether the popover has nested layered elements within it
|
|
194
|
-
*/
|
|
195
|
-
hasNested: boolean;
|
|
196
|
-
/**
|
|
197
|
-
* The current placement of the content relative to the trigger
|
|
198
|
-
*/
|
|
199
|
-
placement: Placement | undefined;
|
|
200
|
-
/**
|
|
201
|
-
* The side of the trigger the content is placed on
|
|
202
|
-
*/
|
|
203
|
-
side: PlacementSide | undefined;
|
|
235
|
+
export interface ContentProps {
|
|
236
|
+
/**
|
|
237
|
+
* The trigger value this content belongs to. Use one content per trigger inside the viewport.
|
|
238
|
+
*/
|
|
239
|
+
value?: string | undefined;
|
|
204
240
|
}
|
|
205
|
-
interface
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
getPositionerProps: () => T["element"];
|
|
240
|
-
/**
|
|
241
|
-
* Returns the state of the content
|
|
242
|
-
*/
|
|
243
|
-
getContentState: () => ContentState;
|
|
244
|
-
getContentProps: () => T["element"];
|
|
245
|
-
getTitleProps: () => T["element"];
|
|
246
|
-
getDescriptionProps: () => T["element"];
|
|
247
|
-
getCloseTriggerProps: () => T["button"];
|
|
241
|
+
export interface ContentState {
|
|
242
|
+
/**
|
|
243
|
+
* Why the next animation should be skipped
|
|
244
|
+
*/
|
|
245
|
+
instant: InstantType;
|
|
246
|
+
/**
|
|
247
|
+
* Whether the content is shown. For a content with a `value`, whether its trigger is the current one.
|
|
248
|
+
*/
|
|
249
|
+
open: boolean;
|
|
250
|
+
/**
|
|
251
|
+
* Whether the popover is modal
|
|
252
|
+
*/
|
|
253
|
+
modal: boolean;
|
|
254
|
+
/**
|
|
255
|
+
* Whether the popover is nested within another layered element
|
|
256
|
+
*/
|
|
257
|
+
nested: boolean;
|
|
258
|
+
/**
|
|
259
|
+
* Whether the popover has nested layered elements within it
|
|
260
|
+
*/
|
|
261
|
+
hasNested: boolean;
|
|
262
|
+
/**
|
|
263
|
+
* The current placement of the content relative to the trigger
|
|
264
|
+
*/
|
|
265
|
+
placement: Placement | undefined;
|
|
266
|
+
/**
|
|
267
|
+
* The side of the trigger the content is placed on
|
|
268
|
+
*/
|
|
269
|
+
side: PlacementSide | undefined;
|
|
270
|
+
/**
|
|
271
|
+
* Where the current trigger sits relative to the previous one, e.g. `"right"` or `"left down"`.
|
|
272
|
+
* `null` until the popover switches triggers while open.
|
|
273
|
+
*/
|
|
274
|
+
activationDirection: PopupActivationDirection | null;
|
|
248
275
|
}
|
|
249
|
-
|
|
250
|
-
|
|
276
|
+
export interface ViewportState {
|
|
277
|
+
/**
|
|
278
|
+
* Whether the popover is open
|
|
279
|
+
*/
|
|
280
|
+
open: boolean;
|
|
281
|
+
/**
|
|
282
|
+
* Why the next animation should be skipped
|
|
283
|
+
*/
|
|
284
|
+
instant: InstantType;
|
|
285
|
+
/**
|
|
286
|
+
* The side of the trigger the viewport is placed on
|
|
287
|
+
*/
|
|
288
|
+
side: PlacementSide | undefined;
|
|
289
|
+
/**
|
|
290
|
+
* Where the current trigger sits relative to the previous one, e.g. `"right"` or `"left down"`.
|
|
291
|
+
* `null` until the popover switches triggers while open.
|
|
292
|
+
*/
|
|
293
|
+
activationDirection: PopupActivationDirection | null;
|
|
294
|
+
/**
|
|
295
|
+
* Whether the popover is moving between triggers
|
|
296
|
+
*/
|
|
297
|
+
transitioning: boolean;
|
|
298
|
+
}
|
|
299
|
+
export interface PopoverApi<T extends PropTypes = PropTypes> {
|
|
300
|
+
/**
|
|
301
|
+
* Whether the popover is open
|
|
302
|
+
*/
|
|
303
|
+
open: boolean;
|
|
304
|
+
/**
|
|
305
|
+
* Function to open or close the popover
|
|
306
|
+
*/
|
|
307
|
+
setOpen: (open: boolean, reason?: OpenChangeReason) => void;
|
|
308
|
+
/**
|
|
309
|
+
* The trigger value
|
|
310
|
+
*/
|
|
311
|
+
triggerValue: string | null;
|
|
312
|
+
/**
|
|
313
|
+
* Function to set the trigger value
|
|
314
|
+
*/
|
|
315
|
+
setTriggerValue: (value: string | null) => void;
|
|
316
|
+
/**
|
|
317
|
+
* Where the current trigger sits relative to the previous one, after switching triggers while open
|
|
318
|
+
*/
|
|
319
|
+
activationDirection: PopupActivationDirection | null;
|
|
320
|
+
/**
|
|
321
|
+
* Returns the trigger values whose content to render: the current one, plus the previous one while
|
|
322
|
+
* it animates out after a switch. Oldest first.
|
|
323
|
+
*/
|
|
324
|
+
getContentValues: () => string[];
|
|
325
|
+
/**
|
|
326
|
+
* Function to reposition the popover
|
|
327
|
+
*/
|
|
328
|
+
reposition: (options?: Partial<PositioningOptions>) => void;
|
|
329
|
+
getArrowProps: () => T["element"];
|
|
330
|
+
getArrowTipProps: () => T["element"];
|
|
331
|
+
getAnchorProps: () => T["element"];
|
|
332
|
+
/**
|
|
333
|
+
* Returns the state of a specific trigger, including whether it's the currently active one
|
|
334
|
+
*/
|
|
335
|
+
getTriggerState: (props?: TriggerProps) => TriggerState;
|
|
336
|
+
getTriggerProps: (props?: TriggerProps) => T["button"];
|
|
337
|
+
getIndicatorProps: () => T["element"];
|
|
338
|
+
/**
|
|
339
|
+
* Returns the state of the positioner
|
|
340
|
+
*/
|
|
341
|
+
getPositionerState: () => PositionerState;
|
|
342
|
+
getPositionerProps: () => T["element"];
|
|
343
|
+
/**
|
|
344
|
+
* Returns the state of the content
|
|
345
|
+
*/
|
|
346
|
+
getContentState: (props?: ContentProps) => ContentState;
|
|
347
|
+
getContentProps: (props?: ContentProps) => T["element"];
|
|
348
|
+
/**
|
|
349
|
+
* Returns the state of the viewport
|
|
350
|
+
*/
|
|
351
|
+
getViewportState: () => ViewportState;
|
|
352
|
+
getViewportProps: () => T["element"];
|
|
353
|
+
/**
|
|
354
|
+
* Pass the content's `value` when there's one content per trigger
|
|
355
|
+
*/
|
|
356
|
+
getTitleProps: (props?: ContentProps) => T["element"];
|
|
357
|
+
/**
|
|
358
|
+
* Pass the content's `value` when there's one content per trigger
|
|
359
|
+
*/
|
|
360
|
+
getDescriptionProps: (props?: ContentProps) => T["element"];
|
|
361
|
+
getCloseTriggerProps: () => T["button"];
|
|
362
|
+
}
|
|
363
|
+
export type { Placement, PositioningOptions };
|
package/dist/popover.types.js
CHANGED
|
@@ -1,18 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
|
|
16
|
-
// src/popover.types.ts
|
|
17
|
-
var popover_types_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(popover_types_exports);
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
package/dist/popover.types.mjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|