panelui-native 0.49.0 → 0.53.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.
- package/README.md +9 -1
- package/lib/module/components/candlestick-chart/index.js +1161 -0
- package/lib/module/components/candlestick-chart/index.js.map +1 -0
- package/lib/module/components/combobox/index.js +73 -7
- package/lib/module/components/combobox/index.js.map +1 -1
- package/lib/module/components/context-menu/index.js +529 -0
- package/lib/module/components/context-menu/index.js.map +1 -0
- package/lib/module/components/menu/index.js +18 -10
- package/lib/module/components/menu/index.js.map +1 -1
- package/lib/module/components/popover/index.js +71 -7
- package/lib/module/components/popover/index.js.map +1 -1
- package/lib/module/components/sortable/index.js +942 -0
- package/lib/module/components/sortable/index.js.map +1 -0
- package/lib/module/components/swipe/index.js +140 -5
- package/lib/module/components/swipe/index.js.map +1 -1
- package/lib/module/components/tabs/index.js +56 -15
- package/lib/module/components/tabs/index.js.map +1 -1
- package/lib/module/components/time-picker/index.js +295 -31
- package/lib/module/components/time-picker/index.js.map +1 -1
- package/lib/module/icons/index.js +29 -0
- package/lib/module/icons/index.js.map +1 -1
- package/lib/module/index.js +5 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils/haptics.js +19 -0
- package/lib/module/utils/haptics.js.map +1 -1
- package/lib/typescript/src/components/candlestick-chart/index.d.ts +278 -0
- package/lib/typescript/src/components/candlestick-chart/index.d.ts.map +1 -0
- package/lib/typescript/src/components/combobox/index.d.ts.map +1 -1
- package/lib/typescript/src/components/context-menu/index.d.ts +270 -0
- package/lib/typescript/src/components/context-menu/index.d.ts.map +1 -0
- package/lib/typescript/src/components/menu/index.d.ts +20 -20
- package/lib/typescript/src/components/menu/index.d.ts.map +1 -1
- package/lib/typescript/src/components/popover/index.d.ts +51 -1
- package/lib/typescript/src/components/popover/index.d.ts.map +1 -1
- package/lib/typescript/src/components/sortable/index.d.ts +248 -0
- package/lib/typescript/src/components/sortable/index.d.ts.map +1 -0
- package/lib/typescript/src/components/swipe/index.d.ts +35 -0
- package/lib/typescript/src/components/swipe/index.d.ts.map +1 -1
- package/lib/typescript/src/components/tabs/index.d.ts +34 -2
- package/lib/typescript/src/components/tabs/index.d.ts.map +1 -1
- package/lib/typescript/src/components/time-picker/index.d.ts.map +1 -1
- package/lib/typescript/src/icons/index.d.ts +8 -0
- package/lib/typescript/src/icons/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +5 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/utils/haptics.d.ts +14 -0
- package/lib/typescript/src/utils/haptics.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/candlestick-chart/index.tsx +1360 -0
- package/src/components/combobox/index.tsx +84 -6
- package/src/components/context-menu/index.tsx +658 -0
- package/src/components/menu/index.tsx +17 -10
- package/src/components/popover/index.tsx +94 -6
- package/src/components/sortable/index.tsx +1266 -0
- package/src/components/swipe/index.tsx +165 -3
- package/src/components/tabs/index.tsx +82 -16
- package/src/components/time-picker/index.tsx +330 -35
- package/src/icons/index.tsx +22 -0
- package/src/index.ts +39 -0
- package/src/utils/haptics.ts +21 -0
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ContextMenu — the actions that belong to a piece of content, opened on it.
|
|
3
|
+
*
|
|
4
|
+
* A `Menu` hangs off a control that exists to be pressed: a ⋯ button, a toolbar
|
|
5
|
+
* item, something whose whole job is to open the menu. A context menu has no
|
|
6
|
+
* such control. The target is the content itself — a message, a note, a photo,
|
|
7
|
+
* a row — and the actions are reached by pressing and holding it.
|
|
8
|
+
*
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <ContextMenu>
|
|
11
|
+
* <ContextMenu.Trigger>
|
|
12
|
+
* <Message>Would you like an interactive todo list?</Message>
|
|
13
|
+
* </ContextMenu.Trigger>
|
|
14
|
+
* <ContextMenu.Content>
|
|
15
|
+
* <ContextMenu.Item icon={<Share2 size={16} />}>Share</ContextMenu.Item>
|
|
16
|
+
* <ContextMenu.Item icon={<Copy size={16} />}>Copy</ContextMenu.Item>
|
|
17
|
+
* <ContextMenu.Separator />
|
|
18
|
+
* <ContextMenu.Item variant="destructive" icon={<Flag size={16} />}>
|
|
19
|
+
* Report
|
|
20
|
+
* </ContextMenu.Item>
|
|
21
|
+
* </ContextMenu.Content>
|
|
22
|
+
* </ContextMenu>
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* ## It is a Menu, and deliberately so
|
|
26
|
+
*
|
|
27
|
+
* The rows here *are* `Menu`'s rows — the same components, not a second set
|
|
28
|
+
* styled to match. `ContextMenu.Item` and `Menu.Item` are one implementation,
|
|
29
|
+
* so the destructive colour, the press-in scale, the indicator column and the
|
|
30
|
+
* dismiss-on-select rule cannot drift apart between the two ways of reaching
|
|
31
|
+
* them. The panel is `Menu`'s panel, which is `Popover`'s, so `presentation`,
|
|
32
|
+
* submenus and edge-flipping all arrive already working.
|
|
33
|
+
*
|
|
34
|
+
* What this component owns is the two things a menu opened on content needs and
|
|
35
|
+
* a menu opened from a button does not: the long press, and where the panel
|
|
36
|
+
* goes.
|
|
37
|
+
*
|
|
38
|
+
* ## Anchored to the finger, not to the target
|
|
39
|
+
*
|
|
40
|
+
* A toolbar menu is placed against its trigger, because the trigger is small
|
|
41
|
+
* and its position is the only sensible answer. A context menu's target is
|
|
42
|
+
* often most of the screen — a whole message, a whole card — and the middle of
|
|
43
|
+
* it is not where the finger was. So the anchor is the press point by default,
|
|
44
|
+
* and the panel unfolds from it the way a popover unfolds from a button.
|
|
45
|
+
*
|
|
46
|
+
* `anchor="target"` places it against the target's bounds instead, which is the
|
|
47
|
+
* better answer for something small and list-shaped, where the panel lining up
|
|
48
|
+
* with the row reads as belonging to it.
|
|
49
|
+
*
|
|
50
|
+
* ## Why the gesture is not a Pressable
|
|
51
|
+
*
|
|
52
|
+
* The target usually has a press of its own — open the thread, play the video,
|
|
53
|
+
* follow the link — and the two must not both fire. React Native's `Pressable`
|
|
54
|
+
* decides between them after the fact, and the tap can still get through on the
|
|
55
|
+
* way to a long press; the recogniser here is asked for the arbitration up
|
|
56
|
+
* front instead, so a hold that opens the menu never also counts as a press.
|
|
57
|
+
*
|
|
58
|
+
* It is also what lets the target be anything at all. A cloned `onLongPress`
|
|
59
|
+
* needs a child that takes one, which rules out exactly the plain views —
|
|
60
|
+
* bubbles, cards, images — that content-native actions are usually attached to.
|
|
61
|
+
*/
|
|
62
|
+
import { type ReactNode } from 'react';
|
|
63
|
+
import { type ViewProps } from 'react-native';
|
|
64
|
+
import { type MenuCheckboxItemProps, type MenuContentProps, type MenuItemProps, type MenuProps } from '../menu/index.js';
|
|
65
|
+
/**
|
|
66
|
+
* The root takes exactly what `Menu`'s root takes — `open`, `onOpenChange`,
|
|
67
|
+
* `defaultOpen`, `presentation` and `haptics` — because it *is* that root.
|
|
68
|
+
*/
|
|
69
|
+
export type ContextMenuProps = MenuProps;
|
|
70
|
+
/**
|
|
71
|
+
* The root. Provides the menu's own context and the popover underneath it.
|
|
72
|
+
*
|
|
73
|
+
* It renders a `Menu`, which is not a shortcut — it is the point. Everything a
|
|
74
|
+
* menu is, this is, and the parts below are the only difference.
|
|
75
|
+
*/
|
|
76
|
+
declare function ContextMenuRoot({ children, ...props }: ContextMenuProps): import("react").JSX.Element;
|
|
77
|
+
/** Which rectangle the panel is placed against. */
|
|
78
|
+
export type ContextMenuAnchor = 'point' | 'target';
|
|
79
|
+
export interface ContextMenuTriggerProps extends Omit<ViewProps, 'children'> {
|
|
80
|
+
/**
|
|
81
|
+
* Classes on the wrapper the content sits in, which lays out like any other
|
|
82
|
+
* view — it does not shrink to its child, because the things held are usually
|
|
83
|
+
* meant to fill their place in the layout. It is also the rect
|
|
84
|
+
* `anchor="target"` measures.
|
|
85
|
+
*/
|
|
86
|
+
className?: string;
|
|
87
|
+
/**
|
|
88
|
+
* The content the actions belong to. Anything at all — it is not required to
|
|
89
|
+
* be pressable, and is not cloned or altered.
|
|
90
|
+
*/
|
|
91
|
+
children: ReactNode;
|
|
92
|
+
/**
|
|
93
|
+
* `point` anchors the panel where the finger landed, `target` against the
|
|
94
|
+
* bounds of the whole trigger.
|
|
95
|
+
*
|
|
96
|
+
* Point is the default because a context menu's target is usually large, and
|
|
97
|
+
* the middle of a whole message is not where the press was. Reach for
|
|
98
|
+
* `target` when the target is small and list-shaped and the panel should read
|
|
99
|
+
* as lining up with it.
|
|
100
|
+
*/
|
|
101
|
+
anchor?: ContextMenuAnchor;
|
|
102
|
+
/** How long the hold has to last, in milliseconds. 350 by default. */
|
|
103
|
+
delay?: number;
|
|
104
|
+
/**
|
|
105
|
+
* How far the finger may move during the hold before it stops being one, in
|
|
106
|
+
* points. 12 by default.
|
|
107
|
+
*
|
|
108
|
+
* Loose rather than tight, because the target is usually inside a scroller: a
|
|
109
|
+
* threshold small enough to feel precise cancels the menu for anyone whose
|
|
110
|
+
* thumb drifts while holding still, and a scroll has travelled much further
|
|
111
|
+
* than this by the time the two need telling apart. Tighten it only for a
|
|
112
|
+
* target that cannot be scrolled.
|
|
113
|
+
*/
|
|
114
|
+
slop?: number;
|
|
115
|
+
/** A short press on the target, which the hold never also counts as. */
|
|
116
|
+
onPress?: () => void;
|
|
117
|
+
/**
|
|
118
|
+
* Tick the haptic engine as the menu opens. Needs the optional
|
|
119
|
+
* `expo-haptics`, and is silent without it.
|
|
120
|
+
*
|
|
121
|
+
* Worth setting more often than not. A hold has no edge to it the way a press
|
|
122
|
+
* does — nothing moves under the finger at the moment it takes — so the tick
|
|
123
|
+
* is what tells someone the hold has been long enough, before the panel has
|
|
124
|
+
* had time to say so.
|
|
125
|
+
*/
|
|
126
|
+
haptics?: boolean;
|
|
127
|
+
/** Nothing opens the menu, and the short press stops firing too. */
|
|
128
|
+
disabled?: boolean;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Wraps the content and opens the menu when it is held.
|
|
132
|
+
*
|
|
133
|
+
* The wrapper is a plain view and lays out like one, stretching as a view does
|
|
134
|
+
* rather than shrinking to its child. That is the opposite of what a tooltip's
|
|
135
|
+
* trigger wants, and for the opposite reason: a tooltip names a control and
|
|
136
|
+
* belongs over it, while the things held here — a bubble, a card, a row — are
|
|
137
|
+
* usually meant to fill their place in the layout, and a wrapper that collapsed
|
|
138
|
+
* around them would change it.
|
|
139
|
+
*
|
|
140
|
+
* It is also the rect measured under `anchor="target"`, which is why that
|
|
141
|
+
* anchoring lines the panel up with the row rather than with the text in it.
|
|
142
|
+
*/
|
|
143
|
+
declare function ContextMenuTrigger({ className, children, anchor, delay, slop, onPress, haptics, disabled, ...props }: ContextMenuTriggerProps): import("react").JSX.Element;
|
|
144
|
+
export interface ContextMenuPreviewProps {
|
|
145
|
+
/**
|
|
146
|
+
* Drawn instead of the target itself. For a target that would be wrong to
|
|
147
|
+
* repeat — one carrying a video, a live map, a text field with a cursor in
|
|
148
|
+
* it — or one that should show more of itself once it has the screen.
|
|
149
|
+
*
|
|
150
|
+
* Left out, the target is drawn again as it stands, which is what makes the
|
|
151
|
+
* lift read as the content coming forward rather than as a picture of it
|
|
152
|
+
* appearing.
|
|
153
|
+
*/
|
|
154
|
+
children?: ReactNode;
|
|
155
|
+
/** Extra classes on the lifted copy. */
|
|
156
|
+
className?: string;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* The target, lifted off the page while its actions are up.
|
|
160
|
+
*
|
|
161
|
+
* Declared inside `ContextMenu.Content`, but not drawn there — it floats over
|
|
162
|
+
* the dimmed screen at the place the target was measured, and the panel is
|
|
163
|
+
* anchored to that same rectangle so the two never overlap. Its presence is
|
|
164
|
+
* what switches the anchor: a panel placed at the press point would open across
|
|
165
|
+
* the very content the preview exists to hold up.
|
|
166
|
+
*
|
|
167
|
+
* What it draws is the trigger's own children, rendered a second time. That
|
|
168
|
+
* keeps the lift honest — it is the content itself coming forward, at the size
|
|
169
|
+
* and in the place it already occupied — and it is why a target that should not
|
|
170
|
+
* simply be repeated can pass its own `children` instead.
|
|
171
|
+
*
|
|
172
|
+
* It takes no touches. The actions are in the panel; the lifted content is
|
|
173
|
+
* there to say what they are about, and a second live copy of a pressable card
|
|
174
|
+
* would be a second place to press.
|
|
175
|
+
*/
|
|
176
|
+
declare function ContextMenuPreview({ children, className }: ContextMenuPreviewProps): import("react").JSX.Element | null;
|
|
177
|
+
declare namespace ContextMenuPreview {
|
|
178
|
+
var displayName: string;
|
|
179
|
+
}
|
|
180
|
+
export interface ContextMenuItemProps extends MenuItemProps {
|
|
181
|
+
/**
|
|
182
|
+
* The row's glyph, drawn at the trailing edge rather than in front of the
|
|
183
|
+
* label. Painted to match the label unless it carries a colour of its own.
|
|
184
|
+
*/
|
|
185
|
+
icon?: ReactNode;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* One row: the verb at the leading edge, its glyph at the trailing one.
|
|
189
|
+
*
|
|
190
|
+
* The other way round is right for a menu dropped from a button, where the
|
|
191
|
+
* glyphs form a column the eye runs down to find the row it wants. A context
|
|
192
|
+
* menu is not read that way. It appears under the hand that opened it, already
|
|
193
|
+
* over the content, and what is being scanned is the *words* — so the words
|
|
194
|
+
* start at the edge, flush with one another, and the glyph sits at the far side
|
|
195
|
+
* confirming the row rather than introducing it.
|
|
196
|
+
*
|
|
197
|
+
* It is still `Menu.Item` underneath, handed the glyph as its trailing slot. So
|
|
198
|
+
* the press-in fill, the destructive colour and the dismiss-on-select rule are
|
|
199
|
+
* one implementation shared with `Menu`, and only the arrangement differs.
|
|
200
|
+
*/
|
|
201
|
+
declare function ContextMenuItem({ className, icon, variant, ...props }: ContextMenuItemProps): import("react").JSX.Element;
|
|
202
|
+
declare namespace ContextMenuItem {
|
|
203
|
+
var displayName: string;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* A row carrying a state. Its tick stays at the leading edge, where `Menu` puts
|
|
207
|
+
* it, because a tick is not a glyph naming the row — it is the answer to it,
|
|
208
|
+
* and a column of them is what makes a set of choices readable as one.
|
|
209
|
+
*/
|
|
210
|
+
declare function ContextMenuCheckboxItem({ className, ...props }: MenuCheckboxItemProps): import("react").JSX.Element;
|
|
211
|
+
declare namespace ContextMenuCheckboxItem {
|
|
212
|
+
var displayName: string;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Everything `Menu.Content` takes. The four listed here are the ones whose
|
|
216
|
+
* defaults differ, and they are listed so the difference is visible.
|
|
217
|
+
*/
|
|
218
|
+
export interface ContextMenuContentProps extends MenuContentProps {
|
|
219
|
+
/** Which side of the anchor the panel opens on. Down from the press, flipping
|
|
220
|
+
* above it near the bottom of the screen. */
|
|
221
|
+
placement?: MenuContentProps['placement'];
|
|
222
|
+
/** Where it sits along the other axis. From the press, not centred on it. */
|
|
223
|
+
align?: MenuContentProps['align'];
|
|
224
|
+
/** Gap between the anchor and the panel. Small, so it reads as coming out of
|
|
225
|
+
* the press rather than floating near it. */
|
|
226
|
+
offset?: number;
|
|
227
|
+
/**
|
|
228
|
+
* Floor for the panel's width. A context menu has no trigger to take its
|
|
229
|
+
* width from, and a column of one-word verbs is too narrow to aim at.
|
|
230
|
+
*/
|
|
231
|
+
minWidth?: number;
|
|
232
|
+
/** Dim the screen behind the panel. On here, unlike a plain popover. */
|
|
233
|
+
scrim?: boolean;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* The panel, with the defaults a context menu wants rather than a popover's.
|
|
237
|
+
*
|
|
238
|
+
* It unfolds down and from the press rather than being centred on it —
|
|
239
|
+
* centring is right for a panel under a button, and wrong for one at a
|
|
240
|
+
* fingertip, where it would put half the panel back under the hand that opened
|
|
241
|
+
* it. Near the bottom of the screen `Popover` flips it above the press and
|
|
242
|
+
* clamps it into the safe area, so the one case where down does not work
|
|
243
|
+
* answers itself.
|
|
244
|
+
*
|
|
245
|
+
* The gap to the anchor is small, so the panel reads as coming out of the press
|
|
246
|
+
* rather than floating near it.
|
|
247
|
+
*
|
|
248
|
+
* The screen dims behind it, which a popover does not do. A context menu is
|
|
249
|
+
* modal in practice — the content underneath is what the actions are *about*,
|
|
250
|
+
* so nothing else on the screen is available while it is up, and the dim is
|
|
251
|
+
* what says so.
|
|
252
|
+
*/
|
|
253
|
+
declare function ContextMenuContent({ placement, align, offset, minWidth, scrim, children, ...props }: ContextMenuContentProps): import("react").JSX.Element;
|
|
254
|
+
export declare const ContextMenu: typeof ContextMenuRoot & {
|
|
255
|
+
Trigger: typeof ContextMenuTrigger;
|
|
256
|
+
Content: typeof ContextMenuContent;
|
|
257
|
+
Preview: typeof ContextMenuPreview;
|
|
258
|
+
Background: typeof import("../menu/index.js").MenuBackground;
|
|
259
|
+
Label: typeof import("../menu/index.js").MenuLabel;
|
|
260
|
+
Item: typeof ContextMenuItem;
|
|
261
|
+
CheckboxItem: typeof ContextMenuCheckboxItem;
|
|
262
|
+
RadioGroup: typeof import("../menu/index.js").MenuRadioGroup;
|
|
263
|
+
RadioItem: typeof import("../menu/index.js").MenuRadioItem;
|
|
264
|
+
Separator: typeof import("../menu/index.js").MenuSeparator;
|
|
265
|
+
Sub: typeof import("../menu/index.js").MenuSub;
|
|
266
|
+
SubTrigger: typeof import("../menu/index.js").MenuSubTrigger;
|
|
267
|
+
SubContent: typeof import("../menu/index.js").MenuSubContent;
|
|
268
|
+
};
|
|
269
|
+
export {};
|
|
270
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/context-menu/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,OAAO,EAYL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAYpD,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,kBAAS,CAAC;AAyIjB;;;GAGG;AACH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AGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED;;;;;;;;;;;;;GAaG;AACH,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,oBAAoB,+BAWpF;kBAXQ,eAAe;;;AAexB;;;;GAIG;AACH,iBAAS,uBAAuB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,qBAAqB,+BAE9E;kBAFQ,uBAAuB;;;AAMhC;;;GAGG;AACH,MAAM,WAAW,uBAAwB,SAAQ,gBAAgB;IAC/D;iDAC6C;IAC7C,SAAS,CAAC,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC;IAC1C,6EAA6E;IAC7E,KAAK,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAClC;iDAC6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wEAAwE;IACxE,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,iBAAS,kBAAkB,CAAC,EAC1B,SAAoB,EACpB,KAAe,EACf,MAAU,EACV,QAA4B,EAC5B,KAAY,EACZ,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,uBAAuB,+BAkBzB;AASD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;CActB,CAAC"}
|
|
@@ -101,8 +101,8 @@ export interface MenuBackgroundProps extends ViewProps {
|
|
|
101
101
|
* `overflow-hidden` on the panel is what keeps whatever that is inside the
|
|
102
102
|
* corner radius.
|
|
103
103
|
*/
|
|
104
|
-
declare function MenuBackground({ className, children, ...props }: MenuBackgroundProps): import("react").JSX.Element;
|
|
105
|
-
declare namespace MenuBackground {
|
|
104
|
+
export declare function MenuBackground({ className, children, ...props }: MenuBackgroundProps): import("react").JSX.Element;
|
|
105
|
+
export declare namespace MenuBackground {
|
|
106
106
|
var displayName: string;
|
|
107
107
|
}
|
|
108
108
|
export interface MenuLabelProps extends ViewProps {
|
|
@@ -112,16 +112,16 @@ export interface MenuLabelProps extends ViewProps {
|
|
|
112
112
|
children?: ReactNode;
|
|
113
113
|
}
|
|
114
114
|
/** Non-interactive heading over a run of rows. */
|
|
115
|
-
declare function MenuLabel({ className, inset, children, ...props }: MenuLabelProps): import("react").JSX.Element;
|
|
116
|
-
declare namespace MenuLabel {
|
|
115
|
+
export declare function MenuLabel({ className, inset, children, ...props }: MenuLabelProps): import("react").JSX.Element;
|
|
116
|
+
export declare namespace MenuLabel {
|
|
117
117
|
var displayName: string;
|
|
118
118
|
}
|
|
119
119
|
export interface MenuSeparatorProps extends ViewProps {
|
|
120
120
|
className?: string;
|
|
121
121
|
}
|
|
122
122
|
/** Hairline between two runs of rows. */
|
|
123
|
-
declare function MenuSeparator({ className, ...props }: MenuSeparatorProps): import("react").JSX.Element;
|
|
124
|
-
declare namespace MenuSeparator {
|
|
123
|
+
export declare function MenuSeparator({ className, ...props }: MenuSeparatorProps): import("react").JSX.Element;
|
|
124
|
+
export declare namespace MenuSeparator {
|
|
125
125
|
var displayName: string;
|
|
126
126
|
}
|
|
127
127
|
export interface MenuItemProps extends Omit<PressableProps, 'children' | 'style'> {
|
|
@@ -161,8 +161,8 @@ export interface MenuItemProps extends Omit<PressableProps, 'children' | 'style'
|
|
|
161
161
|
* that a row which is disabled or which opts out via `closeOnSelect` behaves
|
|
162
162
|
* the same either way.
|
|
163
163
|
*/
|
|
164
|
-
declare function MenuItem({ className, children, icon, description, shortcut, trailing, variant, inset, disabled, closeOnSelect, onSelect, onPress, ...props }: MenuItemProps): import("react").JSX.Element;
|
|
165
|
-
declare namespace MenuItem {
|
|
164
|
+
export declare function MenuItem({ className, children, icon, description, shortcut, trailing, variant, inset, disabled, closeOnSelect, onSelect, onPress, ...props }: MenuItemProps): import("react").JSX.Element;
|
|
165
|
+
export declare namespace MenuItem {
|
|
166
166
|
var displayName: string;
|
|
167
167
|
}
|
|
168
168
|
export interface MenuCheckboxItemProps extends Omit<MenuItemProps, 'icon' | 'inset'> {
|
|
@@ -176,8 +176,8 @@ export interface MenuCheckboxItemProps extends Omit<MenuItemProps, 'icon' | 'ins
|
|
|
176
176
|
* deliberately so: a set of toggles is nearly always set more than one at a
|
|
177
177
|
* time, and closing after each one turns three taps into six.
|
|
178
178
|
*/
|
|
179
|
-
declare function MenuCheckboxItem({ checked, onCheckedChange, onSelect, closeOnSelect, ...props }: MenuCheckboxItemProps): import("react").JSX.Element;
|
|
180
|
-
declare namespace MenuCheckboxItem {
|
|
179
|
+
export declare function MenuCheckboxItem({ checked, onCheckedChange, onSelect, closeOnSelect, ...props }: MenuCheckboxItemProps): import("react").JSX.Element;
|
|
180
|
+
export declare namespace MenuCheckboxItem {
|
|
181
181
|
var displayName: string;
|
|
182
182
|
}
|
|
183
183
|
export interface MenuRadioGroupProps extends ViewProps {
|
|
@@ -187,8 +187,8 @@ export interface MenuRadioGroupProps extends ViewProps {
|
|
|
187
187
|
children?: ReactNode;
|
|
188
188
|
}
|
|
189
189
|
/** A run of rows of which exactly one is chosen. */
|
|
190
|
-
declare function MenuRadioGroup({ value, onValueChange, className, children, ...props }: MenuRadioGroupProps): import("react").JSX.Element;
|
|
191
|
-
declare namespace MenuRadioGroup {
|
|
190
|
+
export declare function MenuRadioGroup({ value, onValueChange, className, children, ...props }: MenuRadioGroupProps): import("react").JSX.Element;
|
|
191
|
+
export declare namespace MenuRadioGroup {
|
|
192
192
|
var displayName: string;
|
|
193
193
|
}
|
|
194
194
|
export type MenuRadioIndicator = 'check' | 'dot';
|
|
@@ -198,8 +198,8 @@ export interface MenuRadioItemProps extends Omit<MenuItemProps, 'icon' | 'inset'
|
|
|
198
198
|
indicator?: MenuRadioIndicator;
|
|
199
199
|
}
|
|
200
200
|
/** One option inside a `Menu.RadioGroup`. */
|
|
201
|
-
declare function MenuRadioItem({ value, indicator, onSelect, closeOnSelect, ...props }: MenuRadioItemProps): import("react").JSX.Element;
|
|
202
|
-
declare namespace MenuRadioItem {
|
|
201
|
+
export declare function MenuRadioItem({ value, indicator, onSelect, closeOnSelect, ...props }: MenuRadioItemProps): import("react").JSX.Element;
|
|
202
|
+
export declare namespace MenuRadioItem {
|
|
203
203
|
var displayName: string;
|
|
204
204
|
}
|
|
205
205
|
export interface MenuSubProps {
|
|
@@ -209,8 +209,8 @@ export interface MenuSubProps {
|
|
|
209
209
|
onOpenChange?: (open: boolean) => void;
|
|
210
210
|
}
|
|
211
211
|
/** Groups a `Menu.SubTrigger` with the rows it reveals. */
|
|
212
|
-
declare function MenuSub({ children, defaultOpen, open, onOpenChange }: MenuSubProps): import("react").JSX.Element;
|
|
213
|
-
declare namespace MenuSub {
|
|
212
|
+
export declare function MenuSub({ children, defaultOpen, open, onOpenChange }: MenuSubProps): import("react").JSX.Element;
|
|
213
|
+
export declare namespace MenuSub {
|
|
214
214
|
var displayName: string;
|
|
215
215
|
}
|
|
216
216
|
export interface MenuSubTriggerProps extends Omit<MenuItemProps, 'closeOnSelect' | 'shortcut' | 'trailing'> {
|
|
@@ -222,8 +222,8 @@ export interface MenuSubTriggerProps extends Omit<MenuItemProps, 'closeOnSelect'
|
|
|
222
222
|
* point down once open, so the row states which way its rows will appear
|
|
223
223
|
* rather than only that it has some.
|
|
224
224
|
*/
|
|
225
|
-
declare function MenuSubTrigger({ className, children, icon, onSelect, ...props }: MenuSubTriggerProps): import("react").JSX.Element;
|
|
226
|
-
declare namespace MenuSubTrigger {
|
|
225
|
+
export declare function MenuSubTrigger({ className, children, icon, onSelect, ...props }: MenuSubTriggerProps): import("react").JSX.Element;
|
|
226
|
+
export declare namespace MenuSubTrigger {
|
|
227
227
|
var displayName: string;
|
|
228
228
|
}
|
|
229
229
|
export interface MenuSubContentProps extends ViewProps {
|
|
@@ -239,8 +239,8 @@ export interface MenuSubContentProps extends ViewProps {
|
|
|
239
239
|
* would otherwise report the animated height back, and the panel would settle
|
|
240
240
|
* at whatever it happened to measure on the first frame.
|
|
241
241
|
*/
|
|
242
|
-
declare function MenuSubContent({ className, children, ...props }: MenuSubContentProps): import("react").JSX.Element;
|
|
243
|
-
declare namespace MenuSubContent {
|
|
242
|
+
export declare function MenuSubContent({ className, children, ...props }: MenuSubContentProps): import("react").JSX.Element;
|
|
243
|
+
export declare namespace MenuSubContent {
|
|
244
244
|
var displayName: string;
|
|
245
245
|
}
|
|
246
246
|
export declare const Menu: typeof MenuRoot & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/menu/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OAAO,EASL,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAmB,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAcpF,OAAO,EAAW,KAAK,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAY,CAAC;AAmFlF,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,aAAa,CAAC;AA8DxD,MAAM,WAAW,SAAU,SAAQ,YAAY;IAC7C;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,iBAAS,QAAQ,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,OAAe,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,+BAkCpG;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,YAAY,CAAC;QAAE,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAA;KAAE,CAAC,CAAC;CACpE;AAED,iFAAiF;AACjF,iBAAS,WAAW,CAAC,EAAE,QAAQ,EAAE,EAAE,gBAAgB,+BAElD;kBAFQ,WAAW;;;AAIpB,MAAM,WAAW,gBAC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AC,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,+BAmDpG;yBAnDe,cAAc;;;AAqD9B,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,+BAoCpF;yBApCe,cAAc;;;AA0D9B,eAAO,MAAM,IAAI;;;;;;;;;;;;;CAaf,CAAC"}
|
|
@@ -34,7 +34,45 @@ import { type ViewProps } from 'react-native';
|
|
|
34
34
|
import { type TextProps } from '../../primitives/text.js';
|
|
35
35
|
export type PopoverPlacement = 'top' | 'bottom' | 'left' | 'right';
|
|
36
36
|
export type PopoverAlign = 'start' | 'center' | 'end';
|
|
37
|
+
/**
|
|
38
|
+
* The rectangle the panel is placed against, in window coordinates.
|
|
39
|
+
*
|
|
40
|
+
* Normally the trigger's own bounds. A zero-sized rect is meaningful too: it
|
|
41
|
+
* anchors the panel to a single point, which is what a menu opened by a long
|
|
42
|
+
* press on arbitrary content needs — there the interesting position is where
|
|
43
|
+
* the finger landed, not the bounds of whatever it landed on.
|
|
44
|
+
*/
|
|
45
|
+
export interface PopoverAnchorRect {
|
|
46
|
+
x: number;
|
|
47
|
+
y: number;
|
|
48
|
+
width: number;
|
|
49
|
+
height: number;
|
|
50
|
+
}
|
|
37
51
|
export type PopoverPresentation = 'popover' | 'bottom-sheet';
|
|
52
|
+
export interface PopoverAnchorControls {
|
|
53
|
+
open: boolean;
|
|
54
|
+
setOpen: (open: boolean) => void;
|
|
55
|
+
/**
|
|
56
|
+
* Place the panel against an explicit rect rather than against a measured
|
|
57
|
+
* trigger. Pass a zero-sized rect to anchor it to a point.
|
|
58
|
+
*/
|
|
59
|
+
anchorTo: (rect: PopoverAnchorRect) => void;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* For a trigger that opens the panel on something other than a plain press, or
|
|
63
|
+
* anchors it to something other than its own bounds.
|
|
64
|
+
*
|
|
65
|
+
* `Popover.Trigger` covers the ordinary case — press the thing, measure the
|
|
66
|
+
* thing, open next to it. A component built on this one may need neither half
|
|
67
|
+
* of that: a context menu opens on a long press and belongs at the point the
|
|
68
|
+
* finger landed. Rather than have it own a second copy of the placing,
|
|
69
|
+
* flipping and edge-clamping this file already does, it borrows them by
|
|
70
|
+
* setting the anchor itself.
|
|
71
|
+
*
|
|
72
|
+
* Only useful inside a `Popover`, which is the same rule every other part here
|
|
73
|
+
* follows.
|
|
74
|
+
*/
|
|
75
|
+
export declare function usePopoverAnchor(component: string): PopoverAnchorControls;
|
|
38
76
|
export interface PopoverProps {
|
|
39
77
|
children: ReactNode;
|
|
40
78
|
/** Controlled open state. */
|
|
@@ -127,9 +165,21 @@ export interface PopoverContentProps extends ViewProps {
|
|
|
127
165
|
* not, so it is safe to pass either way.
|
|
128
166
|
*/
|
|
129
167
|
blur?: boolean;
|
|
168
|
+
/**
|
|
169
|
+
* Dim the screen behind the panel.
|
|
170
|
+
*
|
|
171
|
+
* Off by default: a popover is a panel *beside* something, and dimming the
|
|
172
|
+
* page says the thing behind it has stopped being available — which is a
|
|
173
|
+
* dialog's claim, not a popover's. Worth turning on when the panel is the
|
|
174
|
+
* only thing that matters while it is up, which is what a menu opened on the
|
|
175
|
+
* content itself is. Ignored under `blur`, which draws its own dim.
|
|
176
|
+
*/
|
|
177
|
+
scrim?: boolean;
|
|
178
|
+
/** The dim's classes, when `scrim` is set. */
|
|
179
|
+
scrimClassName?: string;
|
|
130
180
|
children?: ReactNode;
|
|
131
181
|
}
|
|
132
|
-
declare function PopoverContent({ className, placement, align, offset, alignOffset, width, minWidth, maxHeight, scrollable, unstyled, background, dismissible, blur, children, onLayout: onLayoutProp, style, ...props }: PopoverContentProps): import("react").JSX.Element | null;
|
|
182
|
+
declare function PopoverContent({ className, placement, align, offset, alignOffset, width, minWidth, maxHeight, scrollable, unstyled, background, dismissible, blur, scrim, scrimClassName, children, onLayout: onLayoutProp, style, ...props }: PopoverContentProps): import("react").JSX.Element | null;
|
|
133
183
|
export interface PopoverArrowProps extends ViewProps {
|
|
134
184
|
className?: string;
|
|
135
185
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/popover/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EAUL,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAML,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AActB,OAAO,EAAQ,KAAK,SAAS,EAAgB,MAAM,0BAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/popover/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EAUL,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAML,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AActB,OAAO,EAAQ,KAAK,SAAS,EAAgB,MAAM,0BAAuB,CAAC;AAoB3E,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AACnE,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEtD;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAChC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAmBD,MAAM,MAAM,mBAAmB,GAAG,SAA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