@stevederico/skateboard-ui 3.12.0 → 4.0.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/CHANGELOG.md +12 -0
- package/README.md +37 -31
- package/dist/shadcn/ui/accordion.d.ts +1 -6
- package/dist/shadcn/ui/accordion.js +3 -17
- package/dist/shadcn/ui/alert-dialog.d.ts +1 -18
- package/dist/shadcn/ui/alert-dialog.js +3 -43
- package/dist/shadcn/ui/alert.d.ts +1 -13
- package/dist/shadcn/ui/alert.js +3 -28
- package/dist/shadcn/ui/aspect-ratio.d.ts +1 -4
- package/dist/shadcn/ui/aspect-ratio.js +3 -8
- package/dist/shadcn/ui/avatar.d.ts +1 -11
- package/dist/shadcn/ui/avatar.js +3 -24
- package/dist/shadcn/ui/badge.d.ts +1 -14
- package/dist/shadcn/ui/badge.js +3 -33
- package/dist/shadcn/ui/breadcrumb.d.ts +1 -10
- package/dist/shadcn/ui/breadcrumb.js +3 -37
- package/dist/shadcn/ui/button-group.d.ts +1 -13
- package/dist/shadcn/ui/button-group.js +3 -36
- package/dist/shadcn/ui/button.d.ts +1 -34
- package/dist/shadcn/ui/button.js +3 -53
- package/dist/shadcn/ui/calendar.d.ts +1 -13
- package/dist/shadcn/ui/calendar.js +3 -75
- package/dist/shadcn/ui/card.d.ts +1 -11
- package/dist/shadcn/ui/card.js +3 -25
- package/dist/shadcn/ui/checkbox.d.ts +1 -3
- package/dist/shadcn/ui/checkbox.js +3 -9
- package/dist/shadcn/ui/collapsible.d.ts +1 -5
- package/dist/shadcn/ui/collapsible.js +3 -13
- package/dist/shadcn/ui/command.d.ts +1 -19
- package/dist/shadcn/ui/command.js +3 -35
- package/dist/shadcn/ui/context-menu.d.ts +1 -29
- package/dist/shadcn/ui/context-menu.js +3 -52
- package/dist/shadcn/ui/dialog.d.ts +1 -17
- package/dist/shadcn/ui/dialog.js +3 -38
- package/dist/shadcn/ui/drawer.d.ts +1 -13
- package/dist/shadcn/ui/drawer.js +3 -196
- package/dist/shadcn/ui/dropdown-menu.d.ts +1 -29
- package/dist/shadcn/ui/dropdown-menu.js +3 -52
- package/dist/shadcn/ui/empty.d.ts +1 -14
- package/dist/shadcn/ui/empty.js +3 -33
- package/dist/shadcn/ui/field.d.ts +1 -28
- package/dist/shadcn/ui/field.js +3 -68
- package/dist/shadcn/ui/hover-card.d.ts +1 -5
- package/dist/shadcn/ui/hover-card.js +3 -14
- package/dist/shadcn/ui/input-group.d.ts +1 -28
- package/dist/shadcn/ui/input-group.js +3 -58
- package/dist/shadcn/ui/input.d.ts +1 -3
- package/dist/shadcn/ui/input.js +3 -8
- package/dist/shadcn/ui/item.d.ts +1 -34
- package/dist/shadcn/ui/item.js +3 -79
- package/dist/shadcn/ui/kbd.d.ts +1 -3
- package/dist/shadcn/ui/kbd.js +3 -9
- package/dist/shadcn/ui/label.d.ts +1 -3
- package/dist/shadcn/ui/label.js +3 -8
- package/dist/shadcn/ui/menubar.d.ts +1 -29
- package/dist/shadcn/ui/menubar.js +3 -57
- package/dist/shadcn/ui/navigation-menu.d.ts +1 -13
- package/dist/shadcn/ui/navigation-menu.js +3 -31
- package/dist/shadcn/ui/pagination.d.ts +1 -17
- package/dist/shadcn/ui/pagination.js +3 -27
- package/dist/shadcn/ui/popover.d.ts +1 -9
- package/dist/shadcn/ui/popover.js +3 -24
- package/dist/shadcn/ui/progress.d.ts +1 -7
- package/dist/shadcn/ui/progress.js +3 -20
- package/dist/shadcn/ui/radio-group.d.ts +1 -5
- package/dist/shadcn/ui/radio-group.js +3 -12
- package/dist/shadcn/ui/scroll-area.d.ts +1 -5
- package/dist/shadcn/ui/scroll-area.js +3 -12
- package/dist/shadcn/ui/select.d.ts +1 -15
- package/dist/shadcn/ui/select.js +3 -35
- package/dist/shadcn/ui/separator.d.ts +1 -3
- package/dist/shadcn/ui/separator.js +3 -8
- package/dist/shadcn/ui/sheet.d.ts +1 -14
- package/dist/shadcn/ui/sheet.js +3 -38
- package/dist/shadcn/ui/sidebar.d.ts +1 -70
- package/dist/shadcn/ui/sidebar.js +3 -256
- package/dist/shadcn/ui/skeleton.d.ts +1 -2
- package/dist/shadcn/ui/skeleton.js +3 -6
- package/dist/shadcn/ui/slider.d.ts +1 -3
- package/dist/shadcn/ui/slider.js +3 -12
- package/dist/shadcn/ui/spinner.d.ts +1 -2
- package/dist/shadcn/ui/spinner.js +3 -7
- package/dist/shadcn/ui/switch.d.ts +1 -5
- package/dist/shadcn/ui/switch.js +3 -8
- package/dist/shadcn/ui/table.d.ts +1 -10
- package/dist/shadcn/ui/table.js +3 -29
- package/dist/shadcn/ui/tabs.d.ts +1 -13
- package/dist/shadcn/ui/tabs.js +3 -29
- package/dist/shadcn/ui/textarea.d.ts +1 -3
- package/dist/shadcn/ui/textarea.js +3 -7
- package/dist/shadcn/ui/toggle-group.d.ts +1 -11
- package/dist/shadcn/ui/toggle-group.js +3 -25
- package/dist/shadcn/ui/toggle.d.ts +1 -15
- package/dist/shadcn/ui/toggle.js +3 -26
- package/dist/shadcn/ui/tooltip.d.ts +1 -6
- package/dist/shadcn/ui/tooltip.js +3 -17
- package/dist/ui/accordion.d.ts +21 -0
- package/dist/ui/accordion.js +67 -0
- package/dist/ui/alert-dialog.d.ts +32 -0
- package/dist/ui/alert-dialog.js +102 -0
- package/dist/ui/alert.d.ts +13 -0
- package/dist/ui/alert.js +28 -0
- package/dist/ui/aspect-ratio.d.ts +5 -0
- package/dist/ui/aspect-ratio.js +9 -0
- package/dist/ui/avatar.d.ts +14 -0
- package/dist/ui/avatar.js +49 -0
- package/dist/ui/badge.d.ts +22 -0
- package/dist/ui/badge.js +26 -0
- package/dist/ui/breadcrumb.d.ts +13 -0
- package/dist/ui/breadcrumb.js +29 -0
- package/dist/ui/button-group.d.ts +21 -0
- package/dist/ui/button-group.js +29 -0
- package/dist/ui/button.d.ts +38 -0
- package/dist/ui/button.js +49 -0
- package/dist/ui/calendar.d.ts +13 -0
- package/dist/ui/calendar.js +75 -0
- package/dist/ui/card.d.ts +11 -0
- package/dist/ui/card.js +25 -0
- package/dist/ui/checkbox.d.ts +17 -0
- package/dist/ui/checkbox.js +25 -0
- package/dist/ui/collapsible.d.ts +11 -0
- package/dist/ui/collapsible.js +40 -0
- package/dist/ui/command.d.ts +19 -0
- package/dist/ui/command.js +35 -0
- package/dist/ui/context-menu.d.ts +53 -0
- package/dist/ui/context-menu.js +345 -0
- package/dist/ui/dialog.d.ts +40 -0
- package/dist/ui/dialog.js +109 -0
- package/dist/ui/drawer.d.ts +36 -0
- package/dist/ui/drawer.js +234 -0
- package/dist/ui/dropdown-menu.d.ts +61 -0
- package/dist/ui/dropdown-menu.js +323 -0
- package/dist/ui/empty.d.ts +14 -0
- package/dist/ui/empty.js +33 -0
- package/dist/ui/field.d.ts +28 -0
- package/dist/ui/field.js +68 -0
- package/dist/ui/hover-card.d.ts +32 -0
- package/dist/ui/hover-card.js +119 -0
- package/dist/ui/input-group.d.ts +28 -0
- package/dist/ui/input-group.js +58 -0
- package/dist/ui/input.d.ts +3 -0
- package/dist/ui/input.js +7 -0
- package/dist/ui/item.d.ts +41 -0
- package/dist/ui/item.js +69 -0
- package/dist/ui/kbd.d.ts +4 -0
- package/dist/ui/kbd.js +10 -0
- package/dist/ui/label.d.ts +3 -0
- package/dist/ui/label.js +8 -0
- package/dist/ui/menubar.d.ts +59 -0
- package/dist/ui/menubar.js +384 -0
- package/dist/ui/navigation-menu.d.ts +24 -0
- package/dist/ui/navigation-menu.js +134 -0
- package/dist/ui/pagination.d.ts +17 -0
- package/dist/ui/pagination.js +36 -0
- package/dist/ui/popover.d.ts +25 -0
- package/dist/ui/popover.js +68 -0
- package/dist/ui/portal.d.ts +7 -0
- package/dist/ui/portal.js +12 -0
- package/dist/ui/progress.d.ts +15 -0
- package/dist/ui/progress.js +36 -0
- package/dist/ui/radio-group.d.ts +17 -0
- package/dist/ui/radio-group.js +54 -0
- package/dist/ui/scroll-area.d.ts +9 -0
- package/dist/ui/scroll-area.js +72 -0
- package/dist/ui/select.d.ts +37 -0
- package/dist/ui/select.js +216 -0
- package/dist/ui/separator.d.ts +14 -0
- package/dist/ui/separator.js +13 -0
- package/dist/ui/sheet.d.ts +31 -0
- package/dist/ui/sheet.js +121 -0
- package/dist/ui/sidebar.d.ts +86 -0
- package/dist/ui/sidebar.js +211 -0
- package/dist/ui/skeleton.d.ts +3 -0
- package/dist/ui/skeleton.js +7 -0
- package/dist/ui/slider.d.ts +18 -0
- package/dist/ui/slider.js +94 -0
- package/dist/ui/slot.d.ts +27 -0
- package/dist/ui/slot.js +62 -0
- package/dist/ui/spinner.d.ts +3 -0
- package/dist/ui/spinner.js +8 -0
- package/dist/ui/switch.d.ts +17 -0
- package/dist/ui/switch.js +23 -0
- package/dist/ui/table.d.ts +10 -0
- package/dist/ui/table.js +29 -0
- package/dist/ui/tabs.d.ts +29 -0
- package/dist/ui/tabs.js +82 -0
- package/dist/ui/textarea.d.ts +3 -0
- package/dist/ui/textarea.js +7 -0
- package/dist/ui/toggle-group.d.ts +23 -0
- package/dist/ui/toggle-group.js +52 -0
- package/dist/ui/toggle.d.ts +25 -0
- package/dist/ui/toggle.js +41 -0
- package/dist/ui/tooltip.d.ts +25 -0
- package/dist/ui/tooltip.js +90 -0
- package/dist/ui/use-controllable-state.d.ts +10 -0
- package/dist/ui/use-controllable-state.js +17 -0
- package/dist/ui/use-dismiss.d.ts +10 -0
- package/dist/ui/use-dismiss.js +51 -0
- package/dist/ui/use-floating.d.ts +38 -0
- package/dist/ui/use-floating.js +128 -0
- package/dist/ui/use-presence.d.ts +8 -0
- package/dist/ui/use-presence.js +48 -0
- package/package.json +6 -1
- package/dist/shadcn/lib/base-ui/LICENSE +0 -21
- package/dist/shadcn/lib/base-ui/_chunk-000kmre8.js +0 -150
- package/dist/shadcn/lib/base-ui/_chunk-1vw45v38.js +0 -64
- package/dist/shadcn/lib/base-ui/_chunk-23rx7haq.js +0 -81
- package/dist/shadcn/lib/base-ui/_chunk-242gh8ph.js +0 -230
- package/dist/shadcn/lib/base-ui/_chunk-26cc610z.js +0 -6
- package/dist/shadcn/lib/base-ui/_chunk-2z044bba.js +0 -5890
- package/dist/shadcn/lib/base-ui/_chunk-3cpd1vjz.js +0 -13
- package/dist/shadcn/lib/base-ui/_chunk-3enq1vat.js +0 -82
- package/dist/shadcn/lib/base-ui/_chunk-3xpke33f.js +0 -23
- package/dist/shadcn/lib/base-ui/_chunk-451nqgsa.js +0 -6
- package/dist/shadcn/lib/base-ui/_chunk-4maf6pas.js +0 -11
- package/dist/shadcn/lib/base-ui/_chunk-4zhfq4d3.js +0 -16
- package/dist/shadcn/lib/base-ui/_chunk-5gaqyne5.js +0 -21
- package/dist/shadcn/lib/base-ui/_chunk-5tt5hk59.js +0 -4
- package/dist/shadcn/lib/base-ui/_chunk-5tze5c8q.js +0 -13
- package/dist/shadcn/lib/base-ui/_chunk-5xmdvndx.js +0 -225
- package/dist/shadcn/lib/base-ui/_chunk-6adaer33.js +0 -435
- package/dist/shadcn/lib/base-ui/_chunk-6ejf1z1r.js +0 -9
- package/dist/shadcn/lib/base-ui/_chunk-6kqramh9.js +0 -27
- package/dist/shadcn/lib/base-ui/_chunk-7b9dc493.js +0 -14
- package/dist/shadcn/lib/base-ui/_chunk-8a9vv8am.js +0 -89
- package/dist/shadcn/lib/base-ui/_chunk-8ctgmf06.js +0 -129
- package/dist/shadcn/lib/base-ui/_chunk-8ganmsbg.js +0 -54
- package/dist/shadcn/lib/base-ui/_chunk-8xaqxgck.js +0 -15
- package/dist/shadcn/lib/base-ui/_chunk-95tf2rxq.js +0 -62
- package/dist/shadcn/lib/base-ui/_chunk-9x63vfqj.js +0 -70
- package/dist/shadcn/lib/base-ui/_chunk-ase0ydtt.js +0 -9
- package/dist/shadcn/lib/base-ui/_chunk-b0nc8wq7.js +0 -34
- package/dist/shadcn/lib/base-ui/_chunk-b5ya6xds.js +0 -10
- package/dist/shadcn/lib/base-ui/_chunk-b6dkjkbw.js +0 -43
- package/dist/shadcn/lib/base-ui/_chunk-c2bz952e.js +0 -19
- package/dist/shadcn/lib/base-ui/_chunk-cdgfsr3q.js +0 -15
- package/dist/shadcn/lib/base-ui/_chunk-cdj8cpx5.js +0 -347
- package/dist/shadcn/lib/base-ui/_chunk-cgptgywc.js +0 -104
- package/dist/shadcn/lib/base-ui/_chunk-cwvtvwc7.js +0 -35
- package/dist/shadcn/lib/base-ui/_chunk-dan0mva4.js +0 -23
- package/dist/shadcn/lib/base-ui/_chunk-dzvjwv25.js +0 -0
- package/dist/shadcn/lib/base-ui/_chunk-e13rsb6b.js +0 -184
- package/dist/shadcn/lib/base-ui/_chunk-e56mpvk1.js +0 -118
- package/dist/shadcn/lib/base-ui/_chunk-e6k2ecs7.js +0 -48
- package/dist/shadcn/lib/base-ui/_chunk-ebyxgtb4.js +0 -29
- package/dist/shadcn/lib/base-ui/_chunk-f2wttwrf.js +0 -39
- package/dist/shadcn/lib/base-ui/_chunk-fdzctasg.js +0 -38
- package/dist/shadcn/lib/base-ui/_chunk-ffpjy0ta.js +0 -39
- package/dist/shadcn/lib/base-ui/_chunk-fqry7pew.js +0 -603
- package/dist/shadcn/lib/base-ui/_chunk-ghn1tzt8.js +0 -84
- package/dist/shadcn/lib/base-ui/_chunk-gy0bpkmx.js +0 -12
- package/dist/shadcn/lib/base-ui/_chunk-hm5h9vsk.js +0 -16
- package/dist/shadcn/lib/base-ui/_chunk-htdj1jps.js +0 -833
- package/dist/shadcn/lib/base-ui/_chunk-j29xjete.js +0 -146
- package/dist/shadcn/lib/base-ui/_chunk-j3qkyd10.js +0 -50
- package/dist/shadcn/lib/base-ui/_chunk-ktvsd5k6.js +0 -2386
- package/dist/shadcn/lib/base-ui/_chunk-kw8nnq00.js +0 -546
- package/dist/shadcn/lib/base-ui/_chunk-m307wpdj.js +0 -18
- package/dist/shadcn/lib/base-ui/_chunk-mnd0j7v9.js +0 -15
- package/dist/shadcn/lib/base-ui/_chunk-n11h505c.js +0 -32
- package/dist/shadcn/lib/base-ui/_chunk-p0e2qacz.js +0 -26
- package/dist/shadcn/lib/base-ui/_chunk-pv7b791x.js +0 -106
- package/dist/shadcn/lib/base-ui/_chunk-q5cg71p7.js +0 -83
- package/dist/shadcn/lib/base-ui/_chunk-qbezxj1g.js +0 -385
- package/dist/shadcn/lib/base-ui/_chunk-qmsqz6nt.js +0 -15
- package/dist/shadcn/lib/base-ui/_chunk-rrh8rt4v.js +0 -65
- package/dist/shadcn/lib/base-ui/_chunk-s5pwkz8v.js +0 -25
- package/dist/shadcn/lib/base-ui/_chunk-svxv97ph.js +0 -218
- package/dist/shadcn/lib/base-ui/_chunk-t7ppm3t0.js +0 -68
- package/dist/shadcn/lib/base-ui/_chunk-vg16xxmb.js +0 -52
- package/dist/shadcn/lib/base-ui/_chunk-vgkfmtbe.js +0 -21
- package/dist/shadcn/lib/base-ui/_chunk-watha94s.js +0 -14
- package/dist/shadcn/lib/base-ui/_chunk-wdqynnjf.js +0 -35
- package/dist/shadcn/lib/base-ui/_chunk-wx2nxg0p.js +0 -15
- package/dist/shadcn/lib/base-ui/_chunk-x11e1k9r.js +0 -0
- package/dist/shadcn/lib/base-ui/_chunk-x8xehj6d.js +0 -302
- package/dist/shadcn/lib/base-ui/_chunk-xcqbtm2f.js +0 -28
- package/dist/shadcn/lib/base-ui/_chunk-ytnp24gq.js +0 -328
- package/dist/shadcn/lib/base-ui/_chunk-yzr7eg4b.js +0 -6
- package/dist/shadcn/lib/base-ui/_chunk-zk4mtm9m.js +0 -9
- package/dist/shadcn/lib/base-ui/accordion.d.ts +0 -447
- package/dist/shadcn/lib/base-ui/accordion.js +0 -630
- package/dist/shadcn/lib/base-ui/alert-dialog.d.ts +0 -1467
- package/dist/shadcn/lib/base-ui/alert-dialog.js +0 -98
- package/dist/shadcn/lib/base-ui/avatar.d.ts +0 -123
- package/dist/shadcn/lib/base-ui/avatar.js +0 -235
- package/dist/shadcn/lib/base-ui/button.d.ts +0 -84
- package/dist/shadcn/lib/base-ui/button.js +0 -51
- package/dist/shadcn/lib/base-ui/checkbox.d.ts +0 -341
- package/dist/shadcn/lib/base-ui/checkbox.js +0 -501
- package/dist/shadcn/lib/base-ui/collapsible.d.ts +0 -291
- package/dist/shadcn/lib/base-ui/collapsible.js +0 -264
- package/dist/shadcn/lib/base-ui/context-menu.d.ts +0 -2213
- package/dist/shadcn/lib/base-ui/context-menu.js +0 -323
- package/dist/shadcn/lib/base-ui/dialog.d.ts +0 -1448
- package/dist/shadcn/lib/base-ui/dialog.js +0 -79
- package/dist/shadcn/lib/base-ui/input.d.ts +0 -506
- package/dist/shadcn/lib/base-ui/input.js +0 -1027
- package/dist/shadcn/lib/base-ui/menu.d.ts +0 -2275
- package/dist/shadcn/lib/base-ui/menu.js +0 -60
- package/dist/shadcn/lib/base-ui/menubar.d.ts +0 -48
- package/dist/shadcn/lib/base-ui/menubar.js +0 -156
- package/dist/shadcn/lib/base-ui/merge-props.d.ts +0 -70
- package/dist/shadcn/lib/base-ui/merge-props.js +0 -15
- package/dist/shadcn/lib/base-ui/navigation-menu.d.ts +0 -825
- package/dist/shadcn/lib/base-ui/navigation-menu.js +0 -1849
- package/dist/shadcn/lib/base-ui/popover.d.ts +0 -1743
- package/dist/shadcn/lib/base-ui/popover.js +0 -1089
- package/dist/shadcn/lib/base-ui/preview-card.d.ts +0 -1608
- package/dist/shadcn/lib/base-ui/preview-card.js +0 -919
- package/dist/shadcn/lib/base-ui/progress.d.ts +0 -172
- package/dist/shadcn/lib/base-ui/progress.js +0 -272
- package/dist/shadcn/lib/base-ui/radio-group.d.ts +0 -260
- package/dist/shadcn/lib/base-ui/radio-group.js +0 -239
- package/dist/shadcn/lib/base-ui/radio.d.ts +0 -176
- package/dist/shadcn/lib/base-ui/radio.js +0 -387
- package/dist/shadcn/lib/base-ui/scroll-area.d.ts +0 -241
- package/dist/shadcn/lib/base-ui/scroll-area.js +0 -1055
- package/dist/shadcn/lib/base-ui/select.d.ts +0 -1266
- package/dist/shadcn/lib/base-ui/select.js +0 -2450
- package/dist/shadcn/lib/base-ui/separator.d.ts +0 -76
- package/dist/shadcn/lib/base-ui/separator.js +0 -11
- package/dist/shadcn/lib/base-ui/slider.d.ts +0 -551
- package/dist/shadcn/lib/base-ui/slider.js +0 -1583
- package/dist/shadcn/lib/base-ui/switch.d.ts +0 -313
- package/dist/shadcn/lib/base-ui/switch.js +0 -326
- package/dist/shadcn/lib/base-ui/tabs.d.ts +0 -406
- package/dist/shadcn/lib/base-ui/tabs.js +0 -915
- package/dist/shadcn/lib/base-ui/toggle-group.d.ts +0 -235
- package/dist/shadcn/lib/base-ui/toggle-group.js +0 -145
- package/dist/shadcn/lib/base-ui/toggle.d.ts +0 -224
- package/dist/shadcn/lib/base-ui/toggle.js +0 -127
- package/dist/shadcn/lib/base-ui/tooltip.d.ts +0 -1656
- package/dist/shadcn/lib/base-ui/tooltip.js +0 -920
- package/dist/shadcn/lib/base-ui/use-render.d.ts +0 -87
- package/dist/shadcn/lib/base-ui/use-render.js +0 -15
|
@@ -1,2275 +0,0 @@
|
|
|
1
|
-
/* @base-ui/react 1.5.0 — vendored (MIT — MUI Inc).
|
|
2
|
-
* Refresh: scripts/vendor-base-ui.js (see header for instructions).
|
|
3
|
-
* Do not edit by hand. */
|
|
4
|
-
import * as React$1 from 'react';
|
|
5
|
-
|
|
6
|
-
export declare type AlignedPlacement = `${Side}-${Alignment}`;
|
|
7
|
-
export declare type Alignment = "start" | "end";
|
|
8
|
-
export declare type Axis = "x" | "y";
|
|
9
|
-
export declare type ClientRectObject = Prettify<Rect & SideObject>;
|
|
10
|
-
export declare type Coords = {
|
|
11
|
-
[key in Axis]: number;
|
|
12
|
-
};
|
|
13
|
-
export declare type Dimensions = {
|
|
14
|
-
[key in Length]: number;
|
|
15
|
-
};
|
|
16
|
-
export declare type Length = "width" | "height";
|
|
17
|
-
export declare type Padding = number | Prettify<Partial<SideObject>>;
|
|
18
|
-
export declare type Placement = Prettify<Side | AlignedPlacement>;
|
|
19
|
-
export declare type Prettify<T> = {
|
|
20
|
-
[K in keyof T]: T[K];
|
|
21
|
-
} & {};
|
|
22
|
-
export declare type Rect = Prettify<Coords & Dimensions>;
|
|
23
|
-
export declare type Side = "top" | "right" | "bottom" | "left";
|
|
24
|
-
export declare type SideObject = {
|
|
25
|
-
[key in Side]: number;
|
|
26
|
-
};
|
|
27
|
-
export declare type Strategy = "absolute" | "fixed";
|
|
28
|
-
export declare interface ComputePositionReturn extends Coords {
|
|
29
|
-
/**
|
|
30
|
-
* The final chosen placement of the floating element.
|
|
31
|
-
*/
|
|
32
|
-
placement: Placement;
|
|
33
|
-
/**
|
|
34
|
-
* The strategy used to position the floating element.
|
|
35
|
-
*/
|
|
36
|
-
strategy: Strategy;
|
|
37
|
-
/**
|
|
38
|
-
* Object containing data returned from all middleware, keyed by their name.
|
|
39
|
-
*/
|
|
40
|
-
middlewareData: MiddlewareData;
|
|
41
|
-
}
|
|
42
|
-
export declare interface MiddlewareData {
|
|
43
|
-
[key: string]: any;
|
|
44
|
-
arrow?: Partial<Coords> & {
|
|
45
|
-
centerOffset: number;
|
|
46
|
-
alignmentOffset?: number;
|
|
47
|
-
};
|
|
48
|
-
autoPlacement?: {
|
|
49
|
-
index?: number;
|
|
50
|
-
overflows: Array<{
|
|
51
|
-
placement: Placement;
|
|
52
|
-
overflows: Array<number>;
|
|
53
|
-
}>;
|
|
54
|
-
};
|
|
55
|
-
flip?: {
|
|
56
|
-
index?: number;
|
|
57
|
-
overflows: Array<{
|
|
58
|
-
placement: Placement;
|
|
59
|
-
overflows: Array<number>;
|
|
60
|
-
}>;
|
|
61
|
-
};
|
|
62
|
-
hide?: {
|
|
63
|
-
referenceHidden?: boolean;
|
|
64
|
-
escaped?: boolean;
|
|
65
|
-
referenceHiddenOffsets?: SideObject;
|
|
66
|
-
escapedOffsets?: SideObject;
|
|
67
|
-
};
|
|
68
|
-
offset?: Coords & {
|
|
69
|
-
placement: Placement;
|
|
70
|
-
};
|
|
71
|
-
shift?: Coords & {
|
|
72
|
-
enabled: {
|
|
73
|
-
[key in Axis]: boolean;
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Custom positioning reference element.
|
|
79
|
-
* @see https://floating-ui.com/docs/virtual-elements
|
|
80
|
-
*/
|
|
81
|
-
export declare interface VirtualElement {
|
|
82
|
-
getBoundingClientRect(): ClientRectObject;
|
|
83
|
-
getClientRects?(): Array<ClientRectObject> | DOMRectList;
|
|
84
|
-
contextElement?: Element;
|
|
85
|
-
}
|
|
86
|
-
declare type Prettify$1<T> = {
|
|
87
|
-
[K in keyof T]: T[K];
|
|
88
|
-
} & {};
|
|
89
|
-
export declare type ReferenceType = Element | VirtualElement;
|
|
90
|
-
export declare type UseFloatingData = Prettify$1<ComputePositionReturn & {
|
|
91
|
-
isPositioned: boolean;
|
|
92
|
-
}>;
|
|
93
|
-
export declare type UseFloatingReturn<RT extends ReferenceType = ReferenceType> = Prettify$1<UseFloatingData & {
|
|
94
|
-
/**
|
|
95
|
-
* Update the position of the floating element, re-rendering the component
|
|
96
|
-
* if required.
|
|
97
|
-
*/
|
|
98
|
-
update: () => void;
|
|
99
|
-
/**
|
|
100
|
-
* Pre-configured positioning styles to apply to the floating element.
|
|
101
|
-
*/
|
|
102
|
-
floatingStyles: React$1.CSSProperties;
|
|
103
|
-
/**
|
|
104
|
-
* Object containing the reference and floating refs and reactive setters.
|
|
105
|
-
*/
|
|
106
|
-
refs: {
|
|
107
|
-
/**
|
|
108
|
-
* A React ref to the reference element.
|
|
109
|
-
*/
|
|
110
|
-
reference: React$1.MutableRefObject<RT | null>;
|
|
111
|
-
/**
|
|
112
|
-
* A React ref to the floating element.
|
|
113
|
-
*/
|
|
114
|
-
floating: React$1.MutableRefObject<HTMLElement | null>;
|
|
115
|
-
/**
|
|
116
|
-
* A callback to set the reference element (reactive).
|
|
117
|
-
*/
|
|
118
|
-
setReference: (node: RT | null) => void;
|
|
119
|
-
/**
|
|
120
|
-
* A callback to set the floating element (reactive).
|
|
121
|
-
*/
|
|
122
|
-
setFloating: (node: HTMLElement | null) => void;
|
|
123
|
-
};
|
|
124
|
-
/**
|
|
125
|
-
* Object containing the reference and floating elements.
|
|
126
|
-
*/
|
|
127
|
-
elements: {
|
|
128
|
-
reference: RT | null;
|
|
129
|
-
floating: HTMLElement | null;
|
|
130
|
-
};
|
|
131
|
-
}>;
|
|
132
|
-
declare const none: "none";
|
|
133
|
-
declare const triggerPress: "trigger-press";
|
|
134
|
-
declare const triggerHover: "trigger-hover";
|
|
135
|
-
declare const triggerFocus: "trigger-focus";
|
|
136
|
-
declare const outsidePress: "outside-press";
|
|
137
|
-
declare const itemPress: "item-press";
|
|
138
|
-
declare const closePress: "close-press";
|
|
139
|
-
declare const linkPress: "link-press";
|
|
140
|
-
declare const clearPress: "clear-press";
|
|
141
|
-
declare const chipRemovePress: "chip-remove-press";
|
|
142
|
-
declare const trackPress: "track-press";
|
|
143
|
-
declare const incrementPress: "increment-press";
|
|
144
|
-
declare const decrementPress: "decrement-press";
|
|
145
|
-
declare const inputChange: "input-change";
|
|
146
|
-
declare const inputClear: "input-clear";
|
|
147
|
-
declare const inputBlur: "input-blur";
|
|
148
|
-
declare const inputPaste: "input-paste";
|
|
149
|
-
declare const inputPress: "input-press";
|
|
150
|
-
declare const focusOut: "focus-out";
|
|
151
|
-
declare const escapeKey: "escape-key";
|
|
152
|
-
declare const closeWatcher: "close-watcher";
|
|
153
|
-
declare const listNavigation: "list-navigation";
|
|
154
|
-
declare const keyboard: "keyboard";
|
|
155
|
-
declare const pointer: "pointer";
|
|
156
|
-
declare const drag: "drag";
|
|
157
|
-
declare const wheel: "wheel";
|
|
158
|
-
declare const scrub: "scrub";
|
|
159
|
-
declare const cancelOpen: "cancel-open";
|
|
160
|
-
declare const siblingOpen: "sibling-open";
|
|
161
|
-
declare const disabled: "disabled";
|
|
162
|
-
declare const missing: "missing";
|
|
163
|
-
declare const initial: "initial";
|
|
164
|
-
declare const imperativeAction: "imperative-action";
|
|
165
|
-
declare const swipe: "swipe";
|
|
166
|
-
declare const windowResize: "window-resize";
|
|
167
|
-
export interface ReasonToEventMap {
|
|
168
|
-
[none]: Event;
|
|
169
|
-
[triggerPress]: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent;
|
|
170
|
-
[triggerHover]: MouseEvent;
|
|
171
|
-
[triggerFocus]: FocusEvent;
|
|
172
|
-
[outsidePress]: MouseEvent | PointerEvent | TouchEvent;
|
|
173
|
-
[itemPress]: MouseEvent | KeyboardEvent | PointerEvent;
|
|
174
|
-
[closePress]: MouseEvent | KeyboardEvent | PointerEvent;
|
|
175
|
-
[linkPress]: MouseEvent | PointerEvent;
|
|
176
|
-
[clearPress]: PointerEvent | MouseEvent | KeyboardEvent;
|
|
177
|
-
[chipRemovePress]: PointerEvent | MouseEvent | KeyboardEvent;
|
|
178
|
-
[trackPress]: PointerEvent | MouseEvent | TouchEvent;
|
|
179
|
-
[incrementPress]: PointerEvent | MouseEvent | TouchEvent;
|
|
180
|
-
[decrementPress]: PointerEvent | MouseEvent | TouchEvent;
|
|
181
|
-
[inputChange]: InputEvent | Event;
|
|
182
|
-
[inputClear]: InputEvent | FocusEvent | Event;
|
|
183
|
-
[inputBlur]: FocusEvent;
|
|
184
|
-
[inputPaste]: ClipboardEvent;
|
|
185
|
-
[inputPress]: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent;
|
|
186
|
-
[focusOut]: FocusEvent | KeyboardEvent;
|
|
187
|
-
[escapeKey]: KeyboardEvent;
|
|
188
|
-
[closeWatcher]: Event;
|
|
189
|
-
[listNavigation]: KeyboardEvent;
|
|
190
|
-
[keyboard]: KeyboardEvent;
|
|
191
|
-
[pointer]: PointerEvent;
|
|
192
|
-
[drag]: PointerEvent | TouchEvent;
|
|
193
|
-
[swipe]: PointerEvent | TouchEvent;
|
|
194
|
-
[wheel]: WheelEvent;
|
|
195
|
-
[scrub]: PointerEvent;
|
|
196
|
-
[cancelOpen]: MouseEvent;
|
|
197
|
-
[siblingOpen]: Event;
|
|
198
|
-
[disabled]: Event;
|
|
199
|
-
[missing]: Event;
|
|
200
|
-
[initial]: Event;
|
|
201
|
-
[imperativeAction]: Event;
|
|
202
|
-
[windowResize]: UIEvent;
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* Maps a change `reason` string to the corresponding native event type.
|
|
206
|
-
*/
|
|
207
|
-
export type ReasonToEvent<Reason extends string> = Reason extends keyof ReasonToEventMap ? ReasonToEventMap[Reason] : Event;
|
|
208
|
-
export type BaseUIChangeEventDetail<Reason extends string, CustomProperties extends object> = {
|
|
209
|
-
/**
|
|
210
|
-
* The reason for the event.
|
|
211
|
-
*/
|
|
212
|
-
reason: Reason;
|
|
213
|
-
/**
|
|
214
|
-
* The native event associated with the custom event.
|
|
215
|
-
*/
|
|
216
|
-
event: ReasonToEvent<Reason>;
|
|
217
|
-
/**
|
|
218
|
-
* Cancels Base UI from handling the event.
|
|
219
|
-
*/
|
|
220
|
-
cancel: () => void;
|
|
221
|
-
/**
|
|
222
|
-
* Allows the event to propagate in cases where Base UI will stop the propagation.
|
|
223
|
-
*/
|
|
224
|
-
allowPropagation: () => void;
|
|
225
|
-
/**
|
|
226
|
-
* Indicates whether the event has been canceled.
|
|
227
|
-
*/
|
|
228
|
-
isCanceled: boolean;
|
|
229
|
-
/**
|
|
230
|
-
* Indicates whether the event is allowed to propagate.
|
|
231
|
-
*/
|
|
232
|
-
isPropagationAllowed: boolean;
|
|
233
|
-
/**
|
|
234
|
-
* The element that triggered the event, if applicable.
|
|
235
|
-
*/
|
|
236
|
-
trigger: Element | undefined;
|
|
237
|
-
} & CustomProperties;
|
|
238
|
-
/**
|
|
239
|
-
* Details of custom change events emitted by Base UI components.
|
|
240
|
-
*/
|
|
241
|
-
export type BaseUIChangeEventDetails<Reason extends string, CustomProperties extends object = {}> = Reason extends string ? BaseUIChangeEventDetail<Reason, CustomProperties> & {} : never;
|
|
242
|
-
declare class FloatingTreeStore {
|
|
243
|
-
readonly nodesRef: React$1.RefObject<Array<FloatingNodeType>>;
|
|
244
|
-
readonly events: FloatingEvents;
|
|
245
|
-
addNode(node: FloatingNodeType): void;
|
|
246
|
-
removeNode(node: FloatingNodeType): void;
|
|
247
|
-
}
|
|
248
|
-
export type Listener<T> = (state: T) => void;
|
|
249
|
-
declare class Store<State> {
|
|
250
|
-
/**
|
|
251
|
-
* The current state of the store.
|
|
252
|
-
* This property is updated immediately when the state changes as a result of calling {@link setState}, {@link update}, or {@link set}.
|
|
253
|
-
* To subscribe to state changes, use the {@link useState} method. The value returned by {@link useState} is updated after the component renders (similarly to React's useState).
|
|
254
|
-
* The values can be used directly (to avoid subscribing to the store) in effects or event handlers.
|
|
255
|
-
*
|
|
256
|
-
* Do not modify properties in state directly. Instead, use the provided methods to ensure proper state management and listener notification.
|
|
257
|
-
*/
|
|
258
|
-
state: State;
|
|
259
|
-
private listeners;
|
|
260
|
-
private updateTick;
|
|
261
|
-
constructor(state: State);
|
|
262
|
-
/**
|
|
263
|
-
* Registers a listener that will be called whenever the store's state changes.
|
|
264
|
-
*
|
|
265
|
-
* @param fn The listener function to be called on state changes.
|
|
266
|
-
* @returns A function to unsubscribe the listener.
|
|
267
|
-
*/
|
|
268
|
-
subscribe: (fn: Listener<State>) => () => void;
|
|
269
|
-
/**
|
|
270
|
-
* Returns the current state of the store.
|
|
271
|
-
*/
|
|
272
|
-
getSnapshot: () => State;
|
|
273
|
-
/**
|
|
274
|
-
* Updates the entire store's state and notifies all registered listeners.
|
|
275
|
-
*
|
|
276
|
-
* @param newState The new state to set for the store.
|
|
277
|
-
*/
|
|
278
|
-
setState(newState: State): void;
|
|
279
|
-
/**
|
|
280
|
-
* Merges the provided changes into the current state and notifies listeners if there are changes.
|
|
281
|
-
*
|
|
282
|
-
* @param changes An object containing the changes to apply to the current state.
|
|
283
|
-
*/
|
|
284
|
-
update(changes: Partial<State>): void;
|
|
285
|
-
/**
|
|
286
|
-
* Sets a specific key in the store's state to a new value and notifies listeners if the value has changed.
|
|
287
|
-
*
|
|
288
|
-
* @param key The key in the store's state to update.
|
|
289
|
-
* @param value The new value to set for the specified key.
|
|
290
|
-
*/
|
|
291
|
-
set<T>(key: keyof State, value: T): void;
|
|
292
|
-
/**
|
|
293
|
-
* Gives the state a new reference and updates all registered listeners.
|
|
294
|
-
*/
|
|
295
|
-
notifyAll(): void;
|
|
296
|
-
use<F extends (...args: any) => any>(selector: F, ...args: SelectorArgs<F>): ReturnType<F>;
|
|
297
|
-
}
|
|
298
|
-
export type SelectorArgs<Selector> = Selector extends ((...params: infer Params) => any) ? Tail<Params> : never;
|
|
299
|
-
export type Tail<T extends readonly any[]> = T extends readonly [
|
|
300
|
-
any,
|
|
301
|
-
...infer Rest
|
|
302
|
-
] ? Rest : [
|
|
303
|
-
];
|
|
304
|
-
declare class ReactStore<State extends object, Context = Record<string, never>, Selectors extends Record<string, SelectorFunction<State>> = Record<string, never>> extends Store<State> {
|
|
305
|
-
/**
|
|
306
|
-
* Creates a new ReactStore instance.
|
|
307
|
-
*
|
|
308
|
-
* @param state Initial state of the store.
|
|
309
|
-
* @param context Non-reactive context values.
|
|
310
|
-
* @param selectors Optional selectors for use with `useState`.
|
|
311
|
-
*/
|
|
312
|
-
constructor(state: State, context?: Context, selectors?: Selectors);
|
|
313
|
-
/**
|
|
314
|
-
* Non-reactive values such as refs, callbacks, etc.
|
|
315
|
-
*/
|
|
316
|
-
readonly context: Context;
|
|
317
|
-
private selectors;
|
|
318
|
-
/**
|
|
319
|
-
* Synchronizes a single external value into the store.
|
|
320
|
-
*
|
|
321
|
-
* Note that the while the value in `state` is updated immediately, the value returned
|
|
322
|
-
* by `useState` is updated before the next render (similarly to React's `useState`).
|
|
323
|
-
*/
|
|
324
|
-
useSyncedValue<Key extends keyof State, Value extends State[Key]>(key: keyof State, value: Value): void;
|
|
325
|
-
/**
|
|
326
|
-
* Synchronizes a single external value into the store and
|
|
327
|
-
* cleans it up (sets to `undefined`) on unmount.
|
|
328
|
-
*
|
|
329
|
-
* Note that the while the value in `state` is updated immediately, the value returned
|
|
330
|
-
* by `useState` is updated before the next render (similarly to React's `useState`).
|
|
331
|
-
*/
|
|
332
|
-
useSyncedValueWithCleanup<Key extends KeysAllowingUndefined<State>>(key: Key, value: State[Key]): void;
|
|
333
|
-
/**
|
|
334
|
-
* Synchronizes multiple external values into the store.
|
|
335
|
-
*
|
|
336
|
-
* Note that the while the values in `state` are updated immediately, the values returned
|
|
337
|
-
* by `useState` are updated before the next render (similarly to React's `useState`).
|
|
338
|
-
*/
|
|
339
|
-
useSyncedValues(statePart: Partial<State>): void;
|
|
340
|
-
/**
|
|
341
|
-
* Registers a controllable prop pair (`controlled`, `defaultValue`) for a specific key. If `controlled`
|
|
342
|
-
* is non-undefined, the store's state at `key` is updated to match `controlled`.
|
|
343
|
-
*/
|
|
344
|
-
useControlledProp<Key extends keyof State, Value extends State[Key]>(key: keyof State, controlled: Value | undefined): void;
|
|
345
|
-
/** Gets the current value from the store using a selector with the provided key.
|
|
346
|
-
*
|
|
347
|
-
* @param key Key of the selector to use.
|
|
348
|
-
*/
|
|
349
|
-
select<Key extends keyof Selectors>(key: Key, ...args: SelectorArgs$1<Selectors[Key]>): ReturnType<Selectors[Key]>;
|
|
350
|
-
/**
|
|
351
|
-
* Returns a value from the store's state using a selector function.
|
|
352
|
-
* Used to subscribe to specific parts of the state.
|
|
353
|
-
* This methods causes a rerender whenever the selected state changes.
|
|
354
|
-
*
|
|
355
|
-
* @param key Key of the selector to use.
|
|
356
|
-
*/
|
|
357
|
-
useState<Key extends keyof Selectors>(key: Key, ...args: SelectorArgs$1<Selectors[Key]>): ReturnType<Selectors[Key]>;
|
|
358
|
-
/**
|
|
359
|
-
* Wraps a function with `useStableCallback` to ensure it has a stable reference
|
|
360
|
-
* and assigns it to the context.
|
|
361
|
-
*
|
|
362
|
-
* @param key Key of the event callback. Must be a function in the context.
|
|
363
|
-
* @param fn Function to assign.
|
|
364
|
-
*/
|
|
365
|
-
useContextCallback<Key extends ContextFunctionKeys<Context>>(key: Key, fn: ContextFunction<Context, Key> | undefined): void;
|
|
366
|
-
/**
|
|
367
|
-
* Returns a stable setter function for a specific key in the store's state.
|
|
368
|
-
* It's commonly used to pass as a ref callback to React elements.
|
|
369
|
-
*
|
|
370
|
-
* @param key Key of the state to set.
|
|
371
|
-
*/
|
|
372
|
-
useStateSetter<const Key extends keyof State, Value extends State[Key]>(key: keyof State): (v: Value) => void;
|
|
373
|
-
/**
|
|
374
|
-
* Observes changes derived from the store's selectors and calls the listener when the selected value changes.
|
|
375
|
-
*
|
|
376
|
-
* @param key Key of the selector to observe.
|
|
377
|
-
* @param listener Listener function called when the selector result changes.
|
|
378
|
-
*/
|
|
379
|
-
observe<Key extends keyof Selectors>(selector: Key, listener: (newValue: ReturnType<Selectors[Key]>, oldValue: ReturnType<Selectors[Key]>, store: this) => void): () => void;
|
|
380
|
-
observe<Selector extends ObserveSelector<State>>(selector: Selector, listener: (newValue: ReturnType<Selector>, oldValue: ReturnType<Selector>, store: this) => void): () => void;
|
|
381
|
-
}
|
|
382
|
-
export type MaybeCallable = (...args: any[]) => any;
|
|
383
|
-
export type ContextFunctionKeys<Context> = {
|
|
384
|
-
[Key in keyof Context]-?: Extract<Context[Key], MaybeCallable> extends never ? never : Key;
|
|
385
|
-
}[keyof Context];
|
|
386
|
-
export type ContextFunction<Context, Key extends keyof Context> = Extract<Context[Key], MaybeCallable>;
|
|
387
|
-
export type KeysAllowingUndefined<State> = {
|
|
388
|
-
[Key in keyof State]-?: undefined extends State[Key] ? Key : never;
|
|
389
|
-
}[keyof State];
|
|
390
|
-
export type ObserveSelector<State> = (state: State) => any;
|
|
391
|
-
export type SelectorFunction<State> = (state: State, ...args: any[]) => any;
|
|
392
|
-
type Tail$1<T extends readonly any[]> = T extends readonly [
|
|
393
|
-
any,
|
|
394
|
-
...infer Rest
|
|
395
|
-
] ? Rest : [
|
|
396
|
-
];
|
|
397
|
-
type SelectorArgs$1<Selector> = Selector extends ((...params: infer Params) => any) ? Tail$1<Params> : never;
|
|
398
|
-
export type InteractionType = "mouse" | "touch" | "pen" | "keyboard" | "";
|
|
399
|
-
export type TransitionStatus = "starting" | "ending" | "idle" | undefined;
|
|
400
|
-
declare class PopupTriggerMap {
|
|
401
|
-
private elementsSet;
|
|
402
|
-
private idMap;
|
|
403
|
-
constructor();
|
|
404
|
-
/**
|
|
405
|
-
* Adds a trigger element with the given ID.
|
|
406
|
-
*
|
|
407
|
-
* Note: The provided element is assumed to not be registered under multiple IDs.
|
|
408
|
-
*/
|
|
409
|
-
add(id: string, element: Element): void;
|
|
410
|
-
/**
|
|
411
|
-
* Removes the trigger element with the given ID.
|
|
412
|
-
*/
|
|
413
|
-
delete(id: string): void;
|
|
414
|
-
/**
|
|
415
|
-
* Whether the given element is registered as a trigger.
|
|
416
|
-
*/
|
|
417
|
-
hasElement(element: Element): boolean;
|
|
418
|
-
/**
|
|
419
|
-
* Whether there is a registered trigger element matching the given predicate.
|
|
420
|
-
*/
|
|
421
|
-
hasMatchingElement(predicate: (el: Element) => boolean): boolean;
|
|
422
|
-
/**
|
|
423
|
-
* Returns the trigger element associated with the given ID, or undefined if no such element exists.
|
|
424
|
-
*/
|
|
425
|
-
getById(id: string): Element | undefined;
|
|
426
|
-
/**
|
|
427
|
-
* Returns an iterable of all registered trigger entries, where each entry is a tuple of [id, element].
|
|
428
|
-
*/
|
|
429
|
-
entries(): IterableIterator<[
|
|
430
|
-
string,
|
|
431
|
-
Element
|
|
432
|
-
]>;
|
|
433
|
-
/**
|
|
434
|
-
* Returns an iterable of all registered trigger elements.
|
|
435
|
-
*/
|
|
436
|
-
elements(): IterableIterator<Element>;
|
|
437
|
-
/**
|
|
438
|
-
* Returns the number of registered trigger elements.
|
|
439
|
-
*/
|
|
440
|
-
get size(): number;
|
|
441
|
-
}
|
|
442
|
-
export type HTMLProps<T = any> = React$1.HTMLAttributes<T> & {
|
|
443
|
-
ref?: React$1.Ref<T> | undefined;
|
|
444
|
-
};
|
|
445
|
-
/**
|
|
446
|
-
* Shape of the render prop: a function that takes props to be spread on the element and component's state and returns a React element.
|
|
447
|
-
*
|
|
448
|
-
* @template Props Props to be spread on the rendered element.
|
|
449
|
-
* @template State Component's internal state.
|
|
450
|
-
*/
|
|
451
|
-
export type ComponentRenderFn<Props, State> = (props: Props, state: State) => React$1.ReactElement<unknown>;
|
|
452
|
-
export type BaseUIEvent<E extends React$1.SyntheticEvent<Element, Event>> = E & {
|
|
453
|
-
preventBaseUIHandler: () => void;
|
|
454
|
-
readonly baseUIHandlerPrevented?: boolean | undefined;
|
|
455
|
-
};
|
|
456
|
-
export type WithPreventBaseUIHandler<T> = T extends ((event: infer E) => any) ? E extends React$1.SyntheticEvent<Element, Event> ? (event: BaseUIEvent<E>) => ReturnType<T> : T : T extends undefined ? undefined : T;
|
|
457
|
-
/**
|
|
458
|
-
* Adds a `preventBaseUIHandler` method to all event handlers.
|
|
459
|
-
*/
|
|
460
|
-
export type WithBaseUIEvent<T> = {
|
|
461
|
-
[K in keyof T]: WithPreventBaseUIHandler<T[K]>;
|
|
462
|
-
};
|
|
463
|
-
/**
|
|
464
|
-
* Props shared by all Base UI components.
|
|
465
|
-
* Contains `className` (string or callback taking the component's state as an argument) and `render` (function to customize rendering).
|
|
466
|
-
*/
|
|
467
|
-
export type BaseUIComponentProps<ElementType extends React$1.ElementType, State, RenderFunctionProps = HTMLProps> = Omit<WithBaseUIEvent<React$1.ComponentPropsWithRef<ElementType>>, "className" | "color" | "defaultValue" | "defaultChecked" | "style"> & {
|
|
468
|
-
/**
|
|
469
|
-
* CSS class applied to the element, or a function that
|
|
470
|
-
* returns a class based on the component's state.
|
|
471
|
-
*/
|
|
472
|
-
className?: string | ((state: State) => string | undefined) | undefined;
|
|
473
|
-
/**
|
|
474
|
-
* Allows you to replace the component's HTML element
|
|
475
|
-
* with a different tag, or compose it with another component.
|
|
476
|
-
*
|
|
477
|
-
* Accepts a `ReactElement` or a function that returns the element to render.
|
|
478
|
-
*/
|
|
479
|
-
render?: React$1.ReactElement | ComponentRenderFn<RenderFunctionProps, State> | undefined;
|
|
480
|
-
/**
|
|
481
|
-
* Style applied to the element, or a function that
|
|
482
|
-
* returns a style object based on the component's state.
|
|
483
|
-
*/
|
|
484
|
-
style?: React$1.CSSProperties | ((state: State) => React$1.CSSProperties | undefined) | undefined;
|
|
485
|
-
};
|
|
486
|
-
export interface NativeButtonProps {
|
|
487
|
-
/**
|
|
488
|
-
* Whether the component renders a native `<button>` element when replacing it
|
|
489
|
-
* via the `render` prop.
|
|
490
|
-
* Set to `false` if the rendered element is not a button (for example, `<div>`).
|
|
491
|
-
* @default true
|
|
492
|
-
*/
|
|
493
|
-
nativeButton?: boolean | undefined;
|
|
494
|
-
}
|
|
495
|
-
export interface NonNativeButtonProps {
|
|
496
|
-
/**
|
|
497
|
-
* Whether the component renders a native `<button>` element when replacing it
|
|
498
|
-
* via the `render` prop.
|
|
499
|
-
* Set to `true` if the rendered element is a native button.
|
|
500
|
-
* @default false
|
|
501
|
-
*/
|
|
502
|
-
nativeButton?: boolean | undefined;
|
|
503
|
-
}
|
|
504
|
-
export type Orientation = "horizontal" | "vertical";
|
|
505
|
-
/**
|
|
506
|
-
* State common to all popup stores.
|
|
507
|
-
*/
|
|
508
|
-
export type PopupStoreState<Payload> = {
|
|
509
|
-
/**
|
|
510
|
-
* Whether the popup is open (internal state).
|
|
511
|
-
*/
|
|
512
|
-
open: boolean;
|
|
513
|
-
/**
|
|
514
|
-
* Whether the popup is open (external prop).
|
|
515
|
-
*/
|
|
516
|
-
readonly openProp: boolean | undefined;
|
|
517
|
-
/**
|
|
518
|
-
* Whether the popup should be mounted in the DOM.
|
|
519
|
-
* This usually follows `open` but can be different during exit transitions.
|
|
520
|
-
*/
|
|
521
|
-
mounted: boolean;
|
|
522
|
-
/**
|
|
523
|
-
* The current enter/exit transition status of the popup.
|
|
524
|
-
*/
|
|
525
|
-
transitionStatus: TransitionStatus;
|
|
526
|
-
floatingRootContext: FloatingRootContext;
|
|
527
|
-
floatingId: string | undefined;
|
|
528
|
-
/**
|
|
529
|
-
* Number of trigger elements currently registered for this popup.
|
|
530
|
-
*/
|
|
531
|
-
triggerCount: number;
|
|
532
|
-
/**
|
|
533
|
-
* Whether to prevent unmounting the popup when closed.
|
|
534
|
-
* Useful for interacting with JS animation libraries that control unmounting themselves.
|
|
535
|
-
*/
|
|
536
|
-
preventUnmountingOnClose: boolean;
|
|
537
|
-
/**
|
|
538
|
-
* Optional payload set by the trigger.
|
|
539
|
-
*/
|
|
540
|
-
payload: Payload | undefined;
|
|
541
|
-
/**
|
|
542
|
-
* ID of the currently active trigger.
|
|
543
|
-
*/
|
|
544
|
-
activeTriggerId: string | null;
|
|
545
|
-
/**
|
|
546
|
-
* The currently active trigger DOM element.
|
|
547
|
-
*/
|
|
548
|
-
activeTriggerElement: Element | null;
|
|
549
|
-
/**
|
|
550
|
-
* ID of the trigger (external prop).
|
|
551
|
-
*/
|
|
552
|
-
readonly triggerIdProp: string | null | undefined;
|
|
553
|
-
/**
|
|
554
|
-
* The popup DOM element.
|
|
555
|
-
*/
|
|
556
|
-
popupElement: HTMLElement | null;
|
|
557
|
-
/**
|
|
558
|
-
* The positioner DOM element.
|
|
559
|
-
*/
|
|
560
|
-
positionerElement: HTMLElement | null;
|
|
561
|
-
/**
|
|
562
|
-
* Props to spread onto the active trigger element.
|
|
563
|
-
*/
|
|
564
|
-
activeTriggerProps: HTMLProps;
|
|
565
|
-
/**
|
|
566
|
-
* Props to spread onto inactive trigger elements.
|
|
567
|
-
*/
|
|
568
|
-
inactiveTriggerProps: HTMLProps;
|
|
569
|
-
/**
|
|
570
|
-
* Props to spread onto the popup element.
|
|
571
|
-
*/
|
|
572
|
-
popupProps: HTMLProps;
|
|
573
|
-
};
|
|
574
|
-
export type PopupStoreContext<ChangeEventDetails> = {
|
|
575
|
-
/**
|
|
576
|
-
* Map of registered trigger elements.
|
|
577
|
-
*/
|
|
578
|
-
readonly triggerElements: PopupTriggerMap;
|
|
579
|
-
/**
|
|
580
|
-
* Reference to the popup element.
|
|
581
|
-
*/
|
|
582
|
-
readonly popupRef: React$1.RefObject<HTMLElement | null>;
|
|
583
|
-
/**
|
|
584
|
-
* Callback fired when the open state changes.
|
|
585
|
-
*/
|
|
586
|
-
onOpenChange?: ((open: boolean, eventDetails: ChangeEventDetails) => void) | undefined;
|
|
587
|
-
/**
|
|
588
|
-
* Callback fired when the open state change animation completes.
|
|
589
|
-
*/
|
|
590
|
-
onOpenChangeComplete: ((open: boolean) => void) | undefined;
|
|
591
|
-
};
|
|
592
|
-
export type PayloadChildRenderFunction<Payload> = (arg: {
|
|
593
|
-
payload: Payload | undefined;
|
|
594
|
-
}) => React$1.ReactNode;
|
|
595
|
-
export interface FloatingRootState {
|
|
596
|
-
open: boolean;
|
|
597
|
-
transitionStatus: TransitionStatus | undefined;
|
|
598
|
-
domReferenceElement: Element | null;
|
|
599
|
-
referenceElement: ReferenceType$1 | null;
|
|
600
|
-
floatingElement: HTMLElement | null;
|
|
601
|
-
positionReference: ReferenceType$1 | null;
|
|
602
|
-
/**
|
|
603
|
-
* The ID of the floating element.
|
|
604
|
-
*/
|
|
605
|
-
floatingId: string | undefined;
|
|
606
|
-
}
|
|
607
|
-
export interface FloatingRootStoreContext {
|
|
608
|
-
onOpenChange: ((open: boolean, eventDetails: BaseUIChangeEventDetails<string>) => void) | undefined;
|
|
609
|
-
readonly dataRef: React$1.RefObject<ContextData>;
|
|
610
|
-
readonly events: FloatingEvents;
|
|
611
|
-
nested: boolean;
|
|
612
|
-
readonly triggerElements: PopupTriggerMap;
|
|
613
|
-
}
|
|
614
|
-
declare const selectors: {
|
|
615
|
-
open: (state: FloatingRootState) => boolean;
|
|
616
|
-
transitionStatus: (state: FloatingRootState) => TransitionStatus;
|
|
617
|
-
domReferenceElement: (state: FloatingRootState) => Element | null;
|
|
618
|
-
referenceElement: (state: FloatingRootState) => ReferenceType$1 | null;
|
|
619
|
-
floatingElement: (state: FloatingRootState) => HTMLElement | null;
|
|
620
|
-
floatingId: (state: FloatingRootState) => string | undefined;
|
|
621
|
-
};
|
|
622
|
-
export interface FloatingRootStoreOptions {
|
|
623
|
-
open: boolean;
|
|
624
|
-
transitionStatus: TransitionStatus | undefined;
|
|
625
|
-
referenceElement: ReferenceType$1 | null;
|
|
626
|
-
floatingElement: HTMLElement | null;
|
|
627
|
-
triggerElements: PopupTriggerMap;
|
|
628
|
-
floatingId: string | undefined;
|
|
629
|
-
/**
|
|
630
|
-
* When true, `setOpen` only forwards to `onOpenChange`.
|
|
631
|
-
* The popup store owns `dispatchOpenChange(...)` in this mode.
|
|
632
|
-
*/
|
|
633
|
-
syncOnly: boolean;
|
|
634
|
-
nested: boolean;
|
|
635
|
-
onOpenChange: ((open: boolean, eventDetails: BaseUIChangeEventDetails<string>) => void) | undefined;
|
|
636
|
-
}
|
|
637
|
-
declare class FloatingRootStore extends ReactStore<Readonly<FloatingRootState>, FloatingRootStoreContext, typeof selectors> {
|
|
638
|
-
private readonly syncOnly;
|
|
639
|
-
constructor(options: FloatingRootStoreOptions);
|
|
640
|
-
/**
|
|
641
|
-
* Syncs the event used by hover logic to distinguish hover-open from click-like interaction.
|
|
642
|
-
*/
|
|
643
|
-
syncOpenEvent: (newOpen: boolean, event: Event | undefined) => void;
|
|
644
|
-
/**
|
|
645
|
-
* Runs the root-owned side effects for an open state change.
|
|
646
|
-
*/
|
|
647
|
-
dispatchOpenChange: (newOpen: boolean, eventDetails: BaseUIChangeEventDetails<string>) => void;
|
|
648
|
-
/**
|
|
649
|
-
* Emits the `openchange` event through the internal event emitter and calls the `onOpenChange` handler with the provided arguments.
|
|
650
|
-
*
|
|
651
|
-
* @param newOpen The new open state.
|
|
652
|
-
* @param eventDetails Details about the event that triggered the open state change.
|
|
653
|
-
*/
|
|
654
|
-
setOpen: (newOpen: boolean, eventDetails: BaseUIChangeEventDetails<string>) => void;
|
|
655
|
-
}
|
|
656
|
-
export interface UseRenderElementComponentProps<State> {
|
|
657
|
-
/**
|
|
658
|
-
* The class name to apply to the rendered element.
|
|
659
|
-
* Can be a string or a function that accepts the state and returns a string.
|
|
660
|
-
*/
|
|
661
|
-
className?: string | ((state: State) => string | undefined) | undefined;
|
|
662
|
-
/**
|
|
663
|
-
* The render prop or React element to override the default element.
|
|
664
|
-
*/
|
|
665
|
-
render?: undefined | React$1.ReactElement | ComponentRenderFn<React$1.HTMLAttributes<any>, State>;
|
|
666
|
-
/**
|
|
667
|
-
* The style to apply to the rendered element.
|
|
668
|
-
* Can be a style object or a function that accepts the state and returns a style object.
|
|
669
|
-
*/
|
|
670
|
-
style?: React$1.CSSProperties | ((state: State) => React$1.CSSProperties | undefined) | undefined;
|
|
671
|
-
}
|
|
672
|
-
export interface UseFloatingPortalNodeProps {
|
|
673
|
-
ref?: React$1.Ref<HTMLDivElement> | undefined;
|
|
674
|
-
container?: HTMLElement | ShadowRoot | null | React$1.RefObject<HTMLElement | ShadowRoot | null> | undefined;
|
|
675
|
-
componentProps?: UseRenderElementComponentProps<any> | undefined;
|
|
676
|
-
elementProps?: React$1.HTMLAttributes<HTMLDivElement> | undefined;
|
|
677
|
-
}
|
|
678
|
-
declare const FloatingPortal: React$1.ForwardRefExoticComponent<Omit<FloatingPortal.Props<any> & {
|
|
679
|
-
renderGuards?: boolean | undefined;
|
|
680
|
-
}, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
681
|
-
export interface FloatingPortalState {
|
|
682
|
-
}
|
|
683
|
-
declare namespace FloatingPortal {
|
|
684
|
-
type State = FloatingPortalState;
|
|
685
|
-
interface Props<TState> extends BaseUIComponentProps<"div", TState> {
|
|
686
|
-
/**
|
|
687
|
-
* A parent element to render the portal element into.
|
|
688
|
-
*/
|
|
689
|
-
container?: UseFloatingPortalNodeProps["container"] | undefined;
|
|
690
|
-
}
|
|
691
|
-
}
|
|
692
|
-
export type NarrowedElement<T> = T extends Element ? T : Element;
|
|
693
|
-
export interface ExtendedRefs {
|
|
694
|
-
reference: React$1.RefObject<ReferenceType$1 | null>;
|
|
695
|
-
floating: React$1.RefObject<HTMLElement | null>;
|
|
696
|
-
domReference: React$1.RefObject<NarrowedElement<ReferenceType$1> | null>;
|
|
697
|
-
setReference(node: ReferenceType$1 | null): void;
|
|
698
|
-
setFloating(node: HTMLElement | null): void;
|
|
699
|
-
setPositionReference(node: ReferenceType$1 | null): void;
|
|
700
|
-
}
|
|
701
|
-
export interface ExtendedElements {
|
|
702
|
-
reference: ReferenceType$1 | null;
|
|
703
|
-
floating: HTMLElement | null;
|
|
704
|
-
domReference: NarrowedElement<ReferenceType$1> | null;
|
|
705
|
-
}
|
|
706
|
-
export interface FloatingEvents {
|
|
707
|
-
emit<T extends string>(event: T, data?: any): void;
|
|
708
|
-
on(event: string, handler: (data: any) => void): void;
|
|
709
|
-
off(event: string, handler: (data: any) => void): void;
|
|
710
|
-
}
|
|
711
|
-
export interface ContextData {
|
|
712
|
-
openEvent?: Event | undefined;
|
|
713
|
-
floatingContext?: FloatingContext | undefined;
|
|
714
|
-
[key: string]: any;
|
|
715
|
-
}
|
|
716
|
-
export type FloatingRootContext = FloatingRootStore;
|
|
717
|
-
export type FloatingContext = Omit<UseFloatingReturn<ReferenceType$1>, "refs" | "elements"> & {
|
|
718
|
-
open: boolean;
|
|
719
|
-
onOpenChange(open: boolean, eventDetails: BaseUIChangeEventDetails<string>): void;
|
|
720
|
-
events: FloatingEvents;
|
|
721
|
-
dataRef: React$1.RefObject<ContextData>;
|
|
722
|
-
nodeId: string | undefined;
|
|
723
|
-
floatingId: string | undefined;
|
|
724
|
-
refs: ExtendedRefs;
|
|
725
|
-
elements: ExtendedElements;
|
|
726
|
-
rootStore: FloatingRootContext;
|
|
727
|
-
};
|
|
728
|
-
export interface FloatingNodeType {
|
|
729
|
-
id: string | undefined;
|
|
730
|
-
parentId: string | null;
|
|
731
|
-
context?: FloatingContext | undefined;
|
|
732
|
-
}
|
|
733
|
-
type ReferenceType$1 = Element | VirtualElement;
|
|
734
|
-
type Side$1 = "top" | "bottom" | "left" | "right" | "inline-end" | "inline-start";
|
|
735
|
-
export type Align = "start" | "center" | "end";
|
|
736
|
-
export type Boundary = "clipping-ancestors" | Element | Element[] | Rect;
|
|
737
|
-
export type OffsetFunction = (data: {
|
|
738
|
-
side: Side$1;
|
|
739
|
-
align: Align;
|
|
740
|
-
anchor: {
|
|
741
|
-
width: number;
|
|
742
|
-
height: number;
|
|
743
|
-
};
|
|
744
|
-
positioner: {
|
|
745
|
-
width: number;
|
|
746
|
-
height: number;
|
|
747
|
-
};
|
|
748
|
-
}) => number;
|
|
749
|
-
export interface SideFlipMode {
|
|
750
|
-
/**
|
|
751
|
-
* How to avoid collisions on the side axis.
|
|
752
|
-
* - `'flip'`: If there is not enough space, place the popup on the opposite side.
|
|
753
|
-
* - `'none'`: Keep the preferred side even if it overflows.
|
|
754
|
-
*/
|
|
755
|
-
side?: "flip" | "none" | undefined;
|
|
756
|
-
/**
|
|
757
|
-
* How to avoid collisions on the align axis.
|
|
758
|
-
* - `'flip'`: If there is not enough space, swap `'start'` and `'end'` alignment.
|
|
759
|
-
* - `'shift'`: Keep the alignment and shift the popup to fit within the boundary.
|
|
760
|
-
* - `'none'`: Keep the preferred alignment even if it overflows.
|
|
761
|
-
*/
|
|
762
|
-
align?: "flip" | "shift" | "none" | undefined;
|
|
763
|
-
/**
|
|
764
|
-
* If both sides on the preferred axis do not fit, determines whether to fallback
|
|
765
|
-
* to a side on the perpendicular axis and which logical side to prefer.
|
|
766
|
-
* - `'start'`: Prefer the logical start side on the perpendicular axis.
|
|
767
|
-
* - `'end'`: Prefer the logical end side on the perpendicular axis.
|
|
768
|
-
* - `'none'`: Do not fallback to the perpendicular axis.
|
|
769
|
-
*/
|
|
770
|
-
fallbackAxisSide?: "start" | "end" | "none" | undefined;
|
|
771
|
-
}
|
|
772
|
-
export interface SideShiftMode {
|
|
773
|
-
/**
|
|
774
|
-
* How to avoid collisions on the side axis.
|
|
775
|
-
* - `'shift'`: Keep the preferred side and shift the popup to fit within the boundary.
|
|
776
|
-
* - `'none'`: Keep the preferred side even if it overflows.
|
|
777
|
-
*/
|
|
778
|
-
side?: "shift" | "none" | undefined;
|
|
779
|
-
/**
|
|
780
|
-
* How to avoid collisions on the align axis.
|
|
781
|
-
* - `'shift'`: Keep the alignment and shift the popup to fit within the boundary.
|
|
782
|
-
* - `'none'`: Keep the preferred alignment even if it overflows.
|
|
783
|
-
*/
|
|
784
|
-
align?: "shift" | "none" | undefined;
|
|
785
|
-
/**
|
|
786
|
-
* If both sides on the preferred axis do not fit, determines whether to fallback
|
|
787
|
-
* to a side on the perpendicular axis and which logical side to prefer.
|
|
788
|
-
* - `'start'`: Prefer the logical start side on the perpendicular axis.
|
|
789
|
-
* - `'end'`: Prefer the logical end side on the perpendicular axis.
|
|
790
|
-
* - `'none'`: Do not fallback to the perpendicular axis.
|
|
791
|
-
*/
|
|
792
|
-
fallbackAxisSide?: "start" | "end" | "none" | undefined;
|
|
793
|
-
}
|
|
794
|
-
export type CollisionAvoidance = SideFlipMode | SideShiftMode;
|
|
795
|
-
export interface UseAnchorPositioningSharedParameters {
|
|
796
|
-
/**
|
|
797
|
-
* An element to position the popup against.
|
|
798
|
-
* By default, the popup will be positioned against the trigger.
|
|
799
|
-
*/
|
|
800
|
-
anchor?: Element | null | VirtualElement | React$1.RefObject<Element | null> | (() => Element | VirtualElement | null) | undefined;
|
|
801
|
-
/**
|
|
802
|
-
* Determines which CSS `position` property to use.
|
|
803
|
-
* @default 'absolute'
|
|
804
|
-
*/
|
|
805
|
-
positionMethod?: "absolute" | "fixed" | undefined;
|
|
806
|
-
/**
|
|
807
|
-
* Which side of the anchor element to align the popup against.
|
|
808
|
-
* May automatically change to avoid collisions.
|
|
809
|
-
* @default 'bottom'
|
|
810
|
-
*/
|
|
811
|
-
side?: Side$1 | undefined;
|
|
812
|
-
/**
|
|
813
|
-
* Distance between the anchor and the popup in pixels.
|
|
814
|
-
* Also accepts a function that returns the distance to read the dimensions of the anchor
|
|
815
|
-
* and positioner elements, along with its side and alignment.
|
|
816
|
-
*
|
|
817
|
-
* The function takes a `data` object parameter with the following properties:
|
|
818
|
-
* - `data.anchor`: the dimensions of the anchor element with properties `width` and `height`.
|
|
819
|
-
* - `data.positioner`: the dimensions of the positioner element with properties `width` and `height`.
|
|
820
|
-
* - `data.side`: which side of the anchor element the positioner is aligned against.
|
|
821
|
-
* - `data.align`: how the positioner is aligned relative to the specified side.
|
|
822
|
-
*
|
|
823
|
-
* @example
|
|
824
|
-
* ```jsx
|
|
825
|
-
* <Positioner
|
|
826
|
-
* sideOffset={({ side, align, anchor, positioner }) => {
|
|
827
|
-
* return side === 'top' || side === 'bottom'
|
|
828
|
-
* ? anchor.height
|
|
829
|
-
* : anchor.width;
|
|
830
|
-
* }}
|
|
831
|
-
* />
|
|
832
|
-
* ```
|
|
833
|
-
*
|
|
834
|
-
* @default 0
|
|
835
|
-
*/
|
|
836
|
-
sideOffset?: number | OffsetFunction | undefined;
|
|
837
|
-
/**
|
|
838
|
-
* How to align the popup relative to the specified side.
|
|
839
|
-
* @default 'center'
|
|
840
|
-
*/
|
|
841
|
-
align?: Align | undefined;
|
|
842
|
-
/**
|
|
843
|
-
* Additional offset along the alignment axis in pixels.
|
|
844
|
-
* Also accepts a function that returns the offset to read the dimensions of the anchor
|
|
845
|
-
* and positioner elements, along with its side and alignment.
|
|
846
|
-
*
|
|
847
|
-
* The function takes a `data` object parameter with the following properties:
|
|
848
|
-
* - `data.anchor`: the dimensions of the anchor element with properties `width` and `height`.
|
|
849
|
-
* - `data.positioner`: the dimensions of the positioner element with properties `width` and `height`.
|
|
850
|
-
* - `data.side`: which side of the anchor element the positioner is aligned against.
|
|
851
|
-
* - `data.align`: how the positioner is aligned relative to the specified side.
|
|
852
|
-
*
|
|
853
|
-
* @example
|
|
854
|
-
* ```jsx
|
|
855
|
-
* <Positioner
|
|
856
|
-
* alignOffset={({ side, align, anchor, positioner }) => {
|
|
857
|
-
* return side === 'top' || side === 'bottom'
|
|
858
|
-
* ? anchor.width
|
|
859
|
-
* : anchor.height;
|
|
860
|
-
* }}
|
|
861
|
-
* />
|
|
862
|
-
* ```
|
|
863
|
-
*
|
|
864
|
-
* @default 0
|
|
865
|
-
*/
|
|
866
|
-
alignOffset?: number | OffsetFunction | undefined;
|
|
867
|
-
/**
|
|
868
|
-
* An element or a rectangle that delimits the area that the popup is confined to.
|
|
869
|
-
* @default 'clipping-ancestors'
|
|
870
|
-
*/
|
|
871
|
-
collisionBoundary?: Boundary | undefined;
|
|
872
|
-
/**
|
|
873
|
-
* Additional space to maintain from the edge of the collision boundary.
|
|
874
|
-
* @default 5
|
|
875
|
-
*/
|
|
876
|
-
collisionPadding?: Padding | undefined;
|
|
877
|
-
/**
|
|
878
|
-
* Whether to maintain the popup in the viewport after
|
|
879
|
-
* the anchor element was scrolled out of view.
|
|
880
|
-
* @default false
|
|
881
|
-
*/
|
|
882
|
-
sticky?: boolean | undefined;
|
|
883
|
-
/**
|
|
884
|
-
* Minimum distance to maintain between the arrow and the edges of the popup.
|
|
885
|
-
*
|
|
886
|
-
* Use it to prevent the arrow element from hanging out of the rounded corners of a popup.
|
|
887
|
-
* @default 5
|
|
888
|
-
*/
|
|
889
|
-
arrowPadding?: number | undefined;
|
|
890
|
-
/**
|
|
891
|
-
* Whether to disable the popup from tracking any layout shift of its positioning anchor.
|
|
892
|
-
* @default false
|
|
893
|
-
*/
|
|
894
|
-
disableAnchorTracking?: boolean | undefined;
|
|
895
|
-
/**
|
|
896
|
-
* Determines how to handle collisions when positioning the popup.
|
|
897
|
-
*
|
|
898
|
-
* `side` controls overflow on the preferred placement axis (`top`/`bottom` or `left`/`right`):
|
|
899
|
-
* - `'flip'`: keep the requested side when it fits; otherwise try the opposite side
|
|
900
|
-
* (`top` and `bottom`, or `left` and `right`).
|
|
901
|
-
* - `'shift'`: never change side; keep the requested side and move the popup within
|
|
902
|
-
* the clipping boundary so it stays visible.
|
|
903
|
-
* - `'none'`: do not correct side-axis overflow.
|
|
904
|
-
*
|
|
905
|
-
* `align` controls overflow on the alignment axis (`start`/`center`/`end`):
|
|
906
|
-
* - `'flip'`: keep side, but swap `start` and `end` when the requested alignment overflows.
|
|
907
|
-
* - `'shift'`: keep side and requested alignment, then nudge the popup along the
|
|
908
|
-
* alignment axis to fit.
|
|
909
|
-
* - `'none'`: do not correct alignment-axis overflow.
|
|
910
|
-
*
|
|
911
|
-
* `fallbackAxisSide` controls fallback behavior on the perpendicular axis when the
|
|
912
|
-
* preferred axis cannot fit:
|
|
913
|
-
* - `'start'`: allow perpendicular fallback and try the logical start side first
|
|
914
|
-
* (`top` before `bottom`, or `left` before `right` in LTR).
|
|
915
|
-
* - `'end'`: allow perpendicular fallback and try the logical end side first
|
|
916
|
-
* (`bottom` before `top`, or `right` before `left` in LTR).
|
|
917
|
-
* - `'none'`: do not fallback to the perpendicular axis.
|
|
918
|
-
*
|
|
919
|
-
* When `side` is `'shift'`, explicitly setting `align` only supports `'shift'` or `'none'`.
|
|
920
|
-
* If `align` is omitted, it defaults to `'flip'`.
|
|
921
|
-
*
|
|
922
|
-
* @example
|
|
923
|
-
* ```jsx
|
|
924
|
-
* <Positioner
|
|
925
|
-
* collisionAvoidance={{
|
|
926
|
-
* side: 'shift',
|
|
927
|
-
* align: 'shift',
|
|
928
|
-
* fallbackAxisSide: 'none',
|
|
929
|
-
* }}
|
|
930
|
-
* />
|
|
931
|
-
* ```
|
|
932
|
-
*
|
|
933
|
-
*/
|
|
934
|
-
collisionAvoidance?: CollisionAvoidance | undefined;
|
|
935
|
-
}
|
|
936
|
-
/**
|
|
937
|
-
* Displays an element positioned against the menu anchor.
|
|
938
|
-
* Renders a `<div>` element.
|
|
939
|
-
*
|
|
940
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
941
|
-
*/
|
|
942
|
-
export declare const MenuArrow: React$1.ForwardRefExoticComponent<Omit<MenuArrowProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
943
|
-
export interface MenuArrowState {
|
|
944
|
-
/**
|
|
945
|
-
* Whether the menu is currently open.
|
|
946
|
-
*/
|
|
947
|
-
open: boolean;
|
|
948
|
-
/**
|
|
949
|
-
* The side of the anchor the component is placed on.
|
|
950
|
-
*/
|
|
951
|
-
side: Side$1;
|
|
952
|
-
/**
|
|
953
|
-
* The alignment of the component relative to the anchor.
|
|
954
|
-
*/
|
|
955
|
-
align: Align;
|
|
956
|
-
/**
|
|
957
|
-
* Whether the arrow cannot be centered on the anchor.
|
|
958
|
-
*/
|
|
959
|
-
uncentered: boolean;
|
|
960
|
-
}
|
|
961
|
-
export interface MenuArrowProps extends BaseUIComponentProps<"div", MenuArrowState> {
|
|
962
|
-
}
|
|
963
|
-
export declare namespace MenuArrow {
|
|
964
|
-
type State = MenuArrowState;
|
|
965
|
-
type Props = MenuArrowProps;
|
|
966
|
-
}
|
|
967
|
-
/**
|
|
968
|
-
* An overlay displayed beneath the menu popup.
|
|
969
|
-
* Renders a `<div>` element.
|
|
970
|
-
*
|
|
971
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
972
|
-
*/
|
|
973
|
-
export declare const MenuBackdrop: React$1.ForwardRefExoticComponent<Omit<MenuBackdropProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
974
|
-
export interface MenuBackdropState {
|
|
975
|
-
/**
|
|
976
|
-
* Whether the menu is currently open.
|
|
977
|
-
*/
|
|
978
|
-
open: boolean;
|
|
979
|
-
/**
|
|
980
|
-
* The transition status of the component.
|
|
981
|
-
*/
|
|
982
|
-
transitionStatus: TransitionStatus;
|
|
983
|
-
}
|
|
984
|
-
export interface MenuBackdropProps extends BaseUIComponentProps<"div", MenuBackdropState> {
|
|
985
|
-
}
|
|
986
|
-
export declare namespace MenuBackdrop {
|
|
987
|
-
type State = MenuBackdropState;
|
|
988
|
-
type Props = MenuBackdropProps;
|
|
989
|
-
}
|
|
990
|
-
export type State<Payload> = PopupStoreState<Payload> & {
|
|
991
|
-
disabled: boolean;
|
|
992
|
-
modal: boolean;
|
|
993
|
-
openMethod: InteractionType | null;
|
|
994
|
-
allowMouseEnter: boolean;
|
|
995
|
-
parent: MenuParent;
|
|
996
|
-
rootId: string | undefined;
|
|
997
|
-
activeIndex: number | null;
|
|
998
|
-
hoverEnabled: boolean;
|
|
999
|
-
stickIfOpen: boolean;
|
|
1000
|
-
instantType: "dismiss" | "click" | "group" | "trigger-change" | undefined;
|
|
1001
|
-
openChangeReason: MenuRoot.ChangeEventReason | null;
|
|
1002
|
-
floatingTreeRoot: FloatingTreeStore;
|
|
1003
|
-
floatingNodeId: string | undefined;
|
|
1004
|
-
floatingParentNodeId: string | null;
|
|
1005
|
-
itemProps: HTMLProps;
|
|
1006
|
-
closeDelay: number;
|
|
1007
|
-
keyboardEventRelay: ((event: React$1.KeyboardEvent<any>) => void) | undefined;
|
|
1008
|
-
hasViewport: boolean;
|
|
1009
|
-
};
|
|
1010
|
-
export type Context = PopupStoreContext<MenuRoot.ChangeEventDetails> & {
|
|
1011
|
-
readonly positionerRef: React$1.RefObject<HTMLElement | null>;
|
|
1012
|
-
readonly popupRef: React$1.RefObject<HTMLElement | null>;
|
|
1013
|
-
readonly typingRef: React$1.RefObject<boolean>;
|
|
1014
|
-
readonly itemDomElements: React$1.RefObject<(HTMLElement | null)[]>;
|
|
1015
|
-
readonly itemLabels: React$1.RefObject<(string | null)[]>;
|
|
1016
|
-
allowMouseUpTriggerRef: React$1.RefObject<boolean>;
|
|
1017
|
-
readonly triggerFocusTargetRef: React$1.RefObject<HTMLElement | null>;
|
|
1018
|
-
readonly beforeContentFocusGuardRef: React$1.RefObject<HTMLElement | null>;
|
|
1019
|
-
};
|
|
1020
|
-
declare const selectors$1: {
|
|
1021
|
-
disabled: (state: State<unknown>) => boolean;
|
|
1022
|
-
modal: (state: State<unknown>) => boolean;
|
|
1023
|
-
openMethod: (state: State<unknown>) => InteractionType | null;
|
|
1024
|
-
allowMouseEnter: (state: State<unknown>) => boolean;
|
|
1025
|
-
stickIfOpen: (state: State<unknown>) => boolean;
|
|
1026
|
-
parent: (state: State<unknown>) => MenuParent;
|
|
1027
|
-
rootId: (state: State<unknown>) => string | undefined;
|
|
1028
|
-
activeIndex: (state: State<unknown>) => number | null;
|
|
1029
|
-
isActive: (state: State<unknown>, itemIndex: number) => boolean;
|
|
1030
|
-
hoverEnabled: (state: State<unknown>) => boolean;
|
|
1031
|
-
instantType: (state: State<unknown>) => "group" | "click" | "dismiss" | "trigger-change" | undefined;
|
|
1032
|
-
lastOpenChangeReason: (state: State<unknown>) => MenuRootChangeEventReason | null;
|
|
1033
|
-
floatingTreeRoot: (state: State<unknown>) => FloatingTreeStore;
|
|
1034
|
-
floatingNodeId: (state: State<unknown>) => string | undefined;
|
|
1035
|
-
floatingParentNodeId: (state: State<unknown>) => string | null;
|
|
1036
|
-
itemProps: (state: State<unknown>) => HTMLProps;
|
|
1037
|
-
closeDelay: (state: State<unknown>) => number;
|
|
1038
|
-
hasViewport: (state: State<unknown>) => boolean;
|
|
1039
|
-
keyboardEventRelay: (state: State<unknown>) => React$1.KeyboardEventHandler<any> | undefined;
|
|
1040
|
-
open: (state: {
|
|
1041
|
-
open: boolean;
|
|
1042
|
-
readonly openProp: boolean | undefined;
|
|
1043
|
-
mounted: boolean;
|
|
1044
|
-
transitionStatus: TransitionStatus;
|
|
1045
|
-
floatingRootContext: FloatingRootContext;
|
|
1046
|
-
floatingId: string | undefined;
|
|
1047
|
-
triggerCount: number;
|
|
1048
|
-
preventUnmountingOnClose: boolean;
|
|
1049
|
-
payload: unknown;
|
|
1050
|
-
activeTriggerId: string | null;
|
|
1051
|
-
activeTriggerElement: Element | null;
|
|
1052
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1053
|
-
popupElement: HTMLElement | null;
|
|
1054
|
-
positionerElement: HTMLElement | null;
|
|
1055
|
-
activeTriggerProps: HTMLProps;
|
|
1056
|
-
inactiveTriggerProps: HTMLProps;
|
|
1057
|
-
popupProps: HTMLProps;
|
|
1058
|
-
}) => boolean;
|
|
1059
|
-
mounted: (state: {
|
|
1060
|
-
open: boolean;
|
|
1061
|
-
readonly openProp: boolean | undefined;
|
|
1062
|
-
mounted: boolean;
|
|
1063
|
-
transitionStatus: TransitionStatus;
|
|
1064
|
-
floatingRootContext: FloatingRootContext;
|
|
1065
|
-
floatingId: string | undefined;
|
|
1066
|
-
triggerCount: number;
|
|
1067
|
-
preventUnmountingOnClose: boolean;
|
|
1068
|
-
payload: unknown;
|
|
1069
|
-
activeTriggerId: string | null;
|
|
1070
|
-
activeTriggerElement: Element | null;
|
|
1071
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1072
|
-
popupElement: HTMLElement | null;
|
|
1073
|
-
positionerElement: HTMLElement | null;
|
|
1074
|
-
activeTriggerProps: HTMLProps;
|
|
1075
|
-
inactiveTriggerProps: HTMLProps;
|
|
1076
|
-
popupProps: HTMLProps;
|
|
1077
|
-
}) => boolean;
|
|
1078
|
-
transitionStatus: (state: {
|
|
1079
|
-
open: boolean;
|
|
1080
|
-
readonly openProp: boolean | undefined;
|
|
1081
|
-
mounted: boolean;
|
|
1082
|
-
transitionStatus: TransitionStatus;
|
|
1083
|
-
floatingRootContext: FloatingRootContext;
|
|
1084
|
-
floatingId: string | undefined;
|
|
1085
|
-
triggerCount: number;
|
|
1086
|
-
preventUnmountingOnClose: boolean;
|
|
1087
|
-
payload: unknown;
|
|
1088
|
-
activeTriggerId: string | null;
|
|
1089
|
-
activeTriggerElement: Element | null;
|
|
1090
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1091
|
-
popupElement: HTMLElement | null;
|
|
1092
|
-
positionerElement: HTMLElement | null;
|
|
1093
|
-
activeTriggerProps: HTMLProps;
|
|
1094
|
-
inactiveTriggerProps: HTMLProps;
|
|
1095
|
-
popupProps: HTMLProps;
|
|
1096
|
-
}) => TransitionStatus;
|
|
1097
|
-
floatingRootContext: (state: {
|
|
1098
|
-
open: boolean;
|
|
1099
|
-
readonly openProp: boolean | undefined;
|
|
1100
|
-
mounted: boolean;
|
|
1101
|
-
transitionStatus: TransitionStatus;
|
|
1102
|
-
floatingRootContext: FloatingRootContext;
|
|
1103
|
-
floatingId: string | undefined;
|
|
1104
|
-
triggerCount: number;
|
|
1105
|
-
preventUnmountingOnClose: boolean;
|
|
1106
|
-
payload: unknown;
|
|
1107
|
-
activeTriggerId: string | null;
|
|
1108
|
-
activeTriggerElement: Element | null;
|
|
1109
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1110
|
-
popupElement: HTMLElement | null;
|
|
1111
|
-
positionerElement: HTMLElement | null;
|
|
1112
|
-
activeTriggerProps: HTMLProps;
|
|
1113
|
-
inactiveTriggerProps: HTMLProps;
|
|
1114
|
-
popupProps: HTMLProps;
|
|
1115
|
-
}) => FloatingRootStore;
|
|
1116
|
-
triggerCount: (state: {
|
|
1117
|
-
open: boolean;
|
|
1118
|
-
readonly openProp: boolean | undefined;
|
|
1119
|
-
mounted: boolean;
|
|
1120
|
-
transitionStatus: TransitionStatus;
|
|
1121
|
-
floatingRootContext: FloatingRootContext;
|
|
1122
|
-
floatingId: string | undefined;
|
|
1123
|
-
triggerCount: number;
|
|
1124
|
-
preventUnmountingOnClose: boolean;
|
|
1125
|
-
payload: unknown;
|
|
1126
|
-
activeTriggerId: string | null;
|
|
1127
|
-
activeTriggerElement: Element | null;
|
|
1128
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1129
|
-
popupElement: HTMLElement | null;
|
|
1130
|
-
positionerElement: HTMLElement | null;
|
|
1131
|
-
activeTriggerProps: HTMLProps;
|
|
1132
|
-
inactiveTriggerProps: HTMLProps;
|
|
1133
|
-
popupProps: HTMLProps;
|
|
1134
|
-
}) => number;
|
|
1135
|
-
preventUnmountingOnClose: (state: {
|
|
1136
|
-
open: boolean;
|
|
1137
|
-
readonly openProp: boolean | undefined;
|
|
1138
|
-
mounted: boolean;
|
|
1139
|
-
transitionStatus: TransitionStatus;
|
|
1140
|
-
floatingRootContext: FloatingRootContext;
|
|
1141
|
-
floatingId: string | undefined;
|
|
1142
|
-
triggerCount: number;
|
|
1143
|
-
preventUnmountingOnClose: boolean;
|
|
1144
|
-
payload: unknown;
|
|
1145
|
-
activeTriggerId: string | null;
|
|
1146
|
-
activeTriggerElement: Element | null;
|
|
1147
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1148
|
-
popupElement: HTMLElement | null;
|
|
1149
|
-
positionerElement: HTMLElement | null;
|
|
1150
|
-
activeTriggerProps: HTMLProps;
|
|
1151
|
-
inactiveTriggerProps: HTMLProps;
|
|
1152
|
-
popupProps: HTMLProps;
|
|
1153
|
-
}) => boolean;
|
|
1154
|
-
payload: (state: {
|
|
1155
|
-
open: boolean;
|
|
1156
|
-
readonly openProp: boolean | undefined;
|
|
1157
|
-
mounted: boolean;
|
|
1158
|
-
transitionStatus: TransitionStatus;
|
|
1159
|
-
floatingRootContext: FloatingRootContext;
|
|
1160
|
-
floatingId: string | undefined;
|
|
1161
|
-
triggerCount: number;
|
|
1162
|
-
preventUnmountingOnClose: boolean;
|
|
1163
|
-
payload: unknown;
|
|
1164
|
-
activeTriggerId: string | null;
|
|
1165
|
-
activeTriggerElement: Element | null;
|
|
1166
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1167
|
-
popupElement: HTMLElement | null;
|
|
1168
|
-
positionerElement: HTMLElement | null;
|
|
1169
|
-
activeTriggerProps: HTMLProps;
|
|
1170
|
-
inactiveTriggerProps: HTMLProps;
|
|
1171
|
-
popupProps: HTMLProps;
|
|
1172
|
-
}) => unknown;
|
|
1173
|
-
activeTriggerId: (state: {
|
|
1174
|
-
open: boolean;
|
|
1175
|
-
readonly openProp: boolean | undefined;
|
|
1176
|
-
mounted: boolean;
|
|
1177
|
-
transitionStatus: TransitionStatus;
|
|
1178
|
-
floatingRootContext: FloatingRootContext;
|
|
1179
|
-
floatingId: string | undefined;
|
|
1180
|
-
triggerCount: number;
|
|
1181
|
-
preventUnmountingOnClose: boolean;
|
|
1182
|
-
payload: unknown;
|
|
1183
|
-
activeTriggerId: string | null;
|
|
1184
|
-
activeTriggerElement: Element | null;
|
|
1185
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1186
|
-
popupElement: HTMLElement | null;
|
|
1187
|
-
positionerElement: HTMLElement | null;
|
|
1188
|
-
activeTriggerProps: HTMLProps;
|
|
1189
|
-
inactiveTriggerProps: HTMLProps;
|
|
1190
|
-
popupProps: HTMLProps;
|
|
1191
|
-
}) => string | null;
|
|
1192
|
-
activeTriggerElement: (state: {
|
|
1193
|
-
open: boolean;
|
|
1194
|
-
readonly openProp: boolean | undefined;
|
|
1195
|
-
mounted: boolean;
|
|
1196
|
-
transitionStatus: TransitionStatus;
|
|
1197
|
-
floatingRootContext: FloatingRootContext;
|
|
1198
|
-
floatingId: string | undefined;
|
|
1199
|
-
triggerCount: number;
|
|
1200
|
-
preventUnmountingOnClose: boolean;
|
|
1201
|
-
payload: unknown;
|
|
1202
|
-
activeTriggerId: string | null;
|
|
1203
|
-
activeTriggerElement: Element | null;
|
|
1204
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1205
|
-
popupElement: HTMLElement | null;
|
|
1206
|
-
positionerElement: HTMLElement | null;
|
|
1207
|
-
activeTriggerProps: HTMLProps;
|
|
1208
|
-
inactiveTriggerProps: HTMLProps;
|
|
1209
|
-
popupProps: HTMLProps;
|
|
1210
|
-
}) => Element | null;
|
|
1211
|
-
popupId: (state: {
|
|
1212
|
-
open: boolean;
|
|
1213
|
-
readonly openProp: boolean | undefined;
|
|
1214
|
-
mounted: boolean;
|
|
1215
|
-
transitionStatus: TransitionStatus;
|
|
1216
|
-
floatingRootContext: FloatingRootContext;
|
|
1217
|
-
floatingId: string | undefined;
|
|
1218
|
-
triggerCount: number;
|
|
1219
|
-
preventUnmountingOnClose: boolean;
|
|
1220
|
-
payload: unknown;
|
|
1221
|
-
activeTriggerId: string | null;
|
|
1222
|
-
activeTriggerElement: Element | null;
|
|
1223
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1224
|
-
popupElement: HTMLElement | null;
|
|
1225
|
-
positionerElement: HTMLElement | null;
|
|
1226
|
-
activeTriggerProps: HTMLProps;
|
|
1227
|
-
inactiveTriggerProps: HTMLProps;
|
|
1228
|
-
popupProps: HTMLProps;
|
|
1229
|
-
}) => string | undefined;
|
|
1230
|
-
isTriggerActive: (state: {
|
|
1231
|
-
open: boolean;
|
|
1232
|
-
readonly openProp: boolean | undefined;
|
|
1233
|
-
mounted: boolean;
|
|
1234
|
-
transitionStatus: TransitionStatus;
|
|
1235
|
-
floatingRootContext: FloatingRootContext;
|
|
1236
|
-
floatingId: string | undefined;
|
|
1237
|
-
triggerCount: number;
|
|
1238
|
-
preventUnmountingOnClose: boolean;
|
|
1239
|
-
payload: unknown;
|
|
1240
|
-
activeTriggerId: string | null;
|
|
1241
|
-
activeTriggerElement: Element | null;
|
|
1242
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1243
|
-
popupElement: HTMLElement | null;
|
|
1244
|
-
positionerElement: HTMLElement | null;
|
|
1245
|
-
activeTriggerProps: HTMLProps;
|
|
1246
|
-
inactiveTriggerProps: HTMLProps;
|
|
1247
|
-
popupProps: HTMLProps;
|
|
1248
|
-
}, triggerId: string | undefined) => boolean;
|
|
1249
|
-
isOpenedByTrigger: (state: {
|
|
1250
|
-
open: boolean;
|
|
1251
|
-
readonly openProp: boolean | undefined;
|
|
1252
|
-
mounted: boolean;
|
|
1253
|
-
transitionStatus: TransitionStatus;
|
|
1254
|
-
floatingRootContext: FloatingRootContext;
|
|
1255
|
-
floatingId: string | undefined;
|
|
1256
|
-
triggerCount: number;
|
|
1257
|
-
preventUnmountingOnClose: boolean;
|
|
1258
|
-
payload: unknown;
|
|
1259
|
-
activeTriggerId: string | null;
|
|
1260
|
-
activeTriggerElement: Element | null;
|
|
1261
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1262
|
-
popupElement: HTMLElement | null;
|
|
1263
|
-
positionerElement: HTMLElement | null;
|
|
1264
|
-
activeTriggerProps: HTMLProps;
|
|
1265
|
-
inactiveTriggerProps: HTMLProps;
|
|
1266
|
-
popupProps: HTMLProps;
|
|
1267
|
-
}, triggerId: string | undefined) => boolean;
|
|
1268
|
-
isMountedByTrigger: (state: {
|
|
1269
|
-
open: boolean;
|
|
1270
|
-
readonly openProp: boolean | undefined;
|
|
1271
|
-
mounted: boolean;
|
|
1272
|
-
transitionStatus: TransitionStatus;
|
|
1273
|
-
floatingRootContext: FloatingRootContext;
|
|
1274
|
-
floatingId: string | undefined;
|
|
1275
|
-
triggerCount: number;
|
|
1276
|
-
preventUnmountingOnClose: boolean;
|
|
1277
|
-
payload: unknown;
|
|
1278
|
-
activeTriggerId: string | null;
|
|
1279
|
-
activeTriggerElement: Element | null;
|
|
1280
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1281
|
-
popupElement: HTMLElement | null;
|
|
1282
|
-
positionerElement: HTMLElement | null;
|
|
1283
|
-
activeTriggerProps: HTMLProps;
|
|
1284
|
-
inactiveTriggerProps: HTMLProps;
|
|
1285
|
-
popupProps: HTMLProps;
|
|
1286
|
-
}, triggerId: string | undefined) => boolean;
|
|
1287
|
-
triggerProps: (state: {
|
|
1288
|
-
open: boolean;
|
|
1289
|
-
readonly openProp: boolean | undefined;
|
|
1290
|
-
mounted: boolean;
|
|
1291
|
-
transitionStatus: TransitionStatus;
|
|
1292
|
-
floatingRootContext: FloatingRootContext;
|
|
1293
|
-
floatingId: string | undefined;
|
|
1294
|
-
triggerCount: number;
|
|
1295
|
-
preventUnmountingOnClose: boolean;
|
|
1296
|
-
payload: unknown;
|
|
1297
|
-
activeTriggerId: string | null;
|
|
1298
|
-
activeTriggerElement: Element | null;
|
|
1299
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1300
|
-
popupElement: HTMLElement | null;
|
|
1301
|
-
positionerElement: HTMLElement | null;
|
|
1302
|
-
activeTriggerProps: HTMLProps;
|
|
1303
|
-
inactiveTriggerProps: HTMLProps;
|
|
1304
|
-
popupProps: HTMLProps;
|
|
1305
|
-
}, isActive: boolean) => HTMLProps;
|
|
1306
|
-
triggerPopupId: (state: {
|
|
1307
|
-
open: boolean;
|
|
1308
|
-
readonly openProp: boolean | undefined;
|
|
1309
|
-
mounted: boolean;
|
|
1310
|
-
transitionStatus: TransitionStatus;
|
|
1311
|
-
floatingRootContext: FloatingRootContext;
|
|
1312
|
-
floatingId: string | undefined;
|
|
1313
|
-
triggerCount: number;
|
|
1314
|
-
preventUnmountingOnClose: boolean;
|
|
1315
|
-
payload: unknown;
|
|
1316
|
-
activeTriggerId: string | null;
|
|
1317
|
-
activeTriggerElement: Element | null;
|
|
1318
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1319
|
-
popupElement: HTMLElement | null;
|
|
1320
|
-
positionerElement: HTMLElement | null;
|
|
1321
|
-
activeTriggerProps: HTMLProps;
|
|
1322
|
-
inactiveTriggerProps: HTMLProps;
|
|
1323
|
-
popupProps: HTMLProps;
|
|
1324
|
-
}, triggerId: string | undefined) => string | undefined;
|
|
1325
|
-
popupProps: (state: {
|
|
1326
|
-
open: boolean;
|
|
1327
|
-
readonly openProp: boolean | undefined;
|
|
1328
|
-
mounted: boolean;
|
|
1329
|
-
transitionStatus: TransitionStatus;
|
|
1330
|
-
floatingRootContext: FloatingRootContext;
|
|
1331
|
-
floatingId: string | undefined;
|
|
1332
|
-
triggerCount: number;
|
|
1333
|
-
preventUnmountingOnClose: boolean;
|
|
1334
|
-
payload: unknown;
|
|
1335
|
-
activeTriggerId: string | null;
|
|
1336
|
-
activeTriggerElement: Element | null;
|
|
1337
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1338
|
-
popupElement: HTMLElement | null;
|
|
1339
|
-
positionerElement: HTMLElement | null;
|
|
1340
|
-
activeTriggerProps: HTMLProps;
|
|
1341
|
-
inactiveTriggerProps: HTMLProps;
|
|
1342
|
-
popupProps: HTMLProps;
|
|
1343
|
-
}) => HTMLProps;
|
|
1344
|
-
popupElement: (state: {
|
|
1345
|
-
open: boolean;
|
|
1346
|
-
readonly openProp: boolean | undefined;
|
|
1347
|
-
mounted: boolean;
|
|
1348
|
-
transitionStatus: TransitionStatus;
|
|
1349
|
-
floatingRootContext: FloatingRootContext;
|
|
1350
|
-
floatingId: string | undefined;
|
|
1351
|
-
triggerCount: number;
|
|
1352
|
-
preventUnmountingOnClose: boolean;
|
|
1353
|
-
payload: unknown;
|
|
1354
|
-
activeTriggerId: string | null;
|
|
1355
|
-
activeTriggerElement: Element | null;
|
|
1356
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1357
|
-
popupElement: HTMLElement | null;
|
|
1358
|
-
positionerElement: HTMLElement | null;
|
|
1359
|
-
activeTriggerProps: HTMLProps;
|
|
1360
|
-
inactiveTriggerProps: HTMLProps;
|
|
1361
|
-
popupProps: HTMLProps;
|
|
1362
|
-
}) => HTMLElement | null;
|
|
1363
|
-
positionerElement: (state: {
|
|
1364
|
-
open: boolean;
|
|
1365
|
-
readonly openProp: boolean | undefined;
|
|
1366
|
-
mounted: boolean;
|
|
1367
|
-
transitionStatus: TransitionStatus;
|
|
1368
|
-
floatingRootContext: FloatingRootContext;
|
|
1369
|
-
floatingId: string | undefined;
|
|
1370
|
-
triggerCount: number;
|
|
1371
|
-
preventUnmountingOnClose: boolean;
|
|
1372
|
-
payload: unknown;
|
|
1373
|
-
activeTriggerId: string | null;
|
|
1374
|
-
activeTriggerElement: Element | null;
|
|
1375
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1376
|
-
popupElement: HTMLElement | null;
|
|
1377
|
-
positionerElement: HTMLElement | null;
|
|
1378
|
-
activeTriggerProps: HTMLProps;
|
|
1379
|
-
inactiveTriggerProps: HTMLProps;
|
|
1380
|
-
popupProps: HTMLProps;
|
|
1381
|
-
}) => HTMLElement | null;
|
|
1382
|
-
};
|
|
1383
|
-
declare class MenuStore<Payload> extends ReactStore<Readonly<State<Payload>>, Context, typeof selectors$1> {
|
|
1384
|
-
constructor(initialState?: Partial<State<Payload>>);
|
|
1385
|
-
setOpen(open: boolean, eventDetails: Omit<MenuRoot.ChangeEventDetails, "preventUnmountOnClose">): void;
|
|
1386
|
-
static useStore<Payload>(externalStore: MenuStore<Payload> | undefined, initialState: Partial<State<Payload>>): MenuStore<Payload>;
|
|
1387
|
-
private unsubscribeParentListener;
|
|
1388
|
-
}
|
|
1389
|
-
export interface MenuRootContext<Payload = unknown> {
|
|
1390
|
-
store: MenuStore<Payload>;
|
|
1391
|
-
parent: MenuParent;
|
|
1392
|
-
}
|
|
1393
|
-
declare const MenuRootContext: React$1.Context<MenuRootContext<unknown> | undefined>;
|
|
1394
|
-
export interface MenubarContext {
|
|
1395
|
-
modal: boolean;
|
|
1396
|
-
disabled: boolean;
|
|
1397
|
-
contentElement: HTMLElement | null;
|
|
1398
|
-
setContentElement: (element: HTMLElement | null) => void;
|
|
1399
|
-
hasSubmenuOpen: boolean;
|
|
1400
|
-
setHasSubmenuOpen: (open: boolean) => void;
|
|
1401
|
-
orientation: MenuRoot.Orientation;
|
|
1402
|
-
allowMouseUpTriggerRef: React$1.RefObject<boolean>;
|
|
1403
|
-
rootId: string | undefined;
|
|
1404
|
-
}
|
|
1405
|
-
declare const MenubarContext: React$1.Context<MenubarContext | null>;
|
|
1406
|
-
declare function ContextMenuRoot(props: ContextMenuRoot.Props): import("react/jsx-runtime").React$1.JSX.Element;
|
|
1407
|
-
export interface ContextMenuRootState {
|
|
1408
|
-
}
|
|
1409
|
-
export interface ContextMenuRootProps extends Omit<Menu.Root.Props, "modal" | "openOnHover" | "delay" | "closeDelay" | "onOpenChange"> {
|
|
1410
|
-
/**
|
|
1411
|
-
* Event handler called when the menu is opened or closed.
|
|
1412
|
-
*/
|
|
1413
|
-
onOpenChange?: ((open: boolean, eventDetails: ContextMenuRoot.ChangeEventDetails) => void) | undefined;
|
|
1414
|
-
}
|
|
1415
|
-
export type ContextMenuRootActions = MenuRoot.Actions;
|
|
1416
|
-
export type ContextMenuRootChangeEventReason = MenuRoot.ChangeEventReason;
|
|
1417
|
-
export type ContextMenuRootChangeEventDetails = BaseUIChangeEventDetails<ContextMenuRoot.ChangeEventReason>;
|
|
1418
|
-
declare namespace ContextMenuRoot {
|
|
1419
|
-
type State = ContextMenuRootState;
|
|
1420
|
-
type Props = ContextMenuRootProps;
|
|
1421
|
-
type Actions = ContextMenuRootActions;
|
|
1422
|
-
type ChangeEventReason = ContextMenuRootChangeEventReason;
|
|
1423
|
-
type ChangeEventDetails = ContextMenuRootChangeEventDetails;
|
|
1424
|
-
}
|
|
1425
|
-
export interface ContextMenuRootContext {
|
|
1426
|
-
anchor: {
|
|
1427
|
-
getBoundingClientRect: () => DOMRect;
|
|
1428
|
-
};
|
|
1429
|
-
setAnchor: React$1.Dispatch<React$1.SetStateAction<ContextMenuRootContext["anchor"]>>;
|
|
1430
|
-
backdropRef: React$1.RefObject<HTMLDivElement | null>;
|
|
1431
|
-
internalBackdropRef: React$1.RefObject<HTMLDivElement | null>;
|
|
1432
|
-
actionsRef: React$1.RefObject<{
|
|
1433
|
-
setOpen: (nextOpen: boolean, eventDetails: ContextMenuRoot.ChangeEventDetails) => void;
|
|
1434
|
-
} | null>;
|
|
1435
|
-
positionerRef: React$1.RefObject<HTMLElement | null>;
|
|
1436
|
-
allowMouseUpTriggerRef: React$1.RefObject<boolean>;
|
|
1437
|
-
initialCursorPointRef: React$1.RefObject<{
|
|
1438
|
-
x: number;
|
|
1439
|
-
y: number;
|
|
1440
|
-
} | null>;
|
|
1441
|
-
rootId: string | undefined;
|
|
1442
|
-
}
|
|
1443
|
-
declare const ContextMenuRootContext: React$1.Context<ContextMenuRootContext | undefined>;
|
|
1444
|
-
declare class MenuHandle<Payload> {
|
|
1445
|
-
/**
|
|
1446
|
-
* Internal store holding the menu's state.
|
|
1447
|
-
* @internal
|
|
1448
|
-
*/
|
|
1449
|
-
readonly store: MenuStore<Payload>;
|
|
1450
|
-
constructor();
|
|
1451
|
-
/**
|
|
1452
|
-
* Opens the menu and associates it with the trigger with the given id.
|
|
1453
|
-
* The trigger must be a Menu.Trigger component with this handle passed as a prop.
|
|
1454
|
-
*
|
|
1455
|
-
* @param triggerId ID of the trigger to associate with the menu.
|
|
1456
|
-
*/
|
|
1457
|
-
open(triggerId: string): void;
|
|
1458
|
-
/**
|
|
1459
|
-
* Closes the menu.
|
|
1460
|
-
*/
|
|
1461
|
-
close(): void;
|
|
1462
|
-
/**
|
|
1463
|
-
* Indicates whether the menu is currently open.
|
|
1464
|
-
*/
|
|
1465
|
-
get isOpen(): boolean;
|
|
1466
|
-
}
|
|
1467
|
-
declare function createMenuHandle<Payload>(): MenuHandle<Payload>;
|
|
1468
|
-
/**
|
|
1469
|
-
* Groups all parts of the menu.
|
|
1470
|
-
* Doesn't render its own HTML element.
|
|
1471
|
-
*
|
|
1472
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
1473
|
-
*/
|
|
1474
|
-
export declare const MenuRoot: <Payload>(props: MenuRoot.Props<Payload>) => import("react/jsx-runtime").React$1.JSX.Element;
|
|
1475
|
-
export interface MenuRootState {
|
|
1476
|
-
}
|
|
1477
|
-
export interface MenuRootProps<Payload = unknown> {
|
|
1478
|
-
/**
|
|
1479
|
-
* Whether the menu is initially open.
|
|
1480
|
-
*
|
|
1481
|
-
* To render a controlled menu, use the `open` prop instead.
|
|
1482
|
-
* @default false
|
|
1483
|
-
*/
|
|
1484
|
-
defaultOpen?: boolean | undefined;
|
|
1485
|
-
/**
|
|
1486
|
-
* Whether to loop keyboard focus back to the first item
|
|
1487
|
-
* when the end of the list is reached while using the arrow keys.
|
|
1488
|
-
* @default true
|
|
1489
|
-
*/
|
|
1490
|
-
loopFocus?: boolean | undefined;
|
|
1491
|
-
/**
|
|
1492
|
-
* Whether moving the pointer over items should highlight them.
|
|
1493
|
-
* Disabling this prop allows CSS `:hover` to be differentiated from the `:focus` (`data-highlighted`) state.
|
|
1494
|
-
* @default true
|
|
1495
|
-
*/
|
|
1496
|
-
highlightItemOnHover?: boolean | undefined;
|
|
1497
|
-
/**
|
|
1498
|
-
* Determines if the menu enters a modal state when open.
|
|
1499
|
-
* - `true`: user interaction is limited to the menu: document page scroll is locked and pointer interactions on outside elements are disabled.
|
|
1500
|
-
* - `false`: user interaction with the rest of the document is allowed.
|
|
1501
|
-
* @default true
|
|
1502
|
-
*/
|
|
1503
|
-
modal?: boolean | undefined;
|
|
1504
|
-
/**
|
|
1505
|
-
* Event handler called when the menu is opened or closed.
|
|
1506
|
-
*/
|
|
1507
|
-
onOpenChange?: ((open: boolean, eventDetails: MenuRoot.ChangeEventDetails) => void) | undefined;
|
|
1508
|
-
/**
|
|
1509
|
-
* Event handler called after any animations complete when the menu is closed.
|
|
1510
|
-
*/
|
|
1511
|
-
onOpenChangeComplete?: ((open: boolean) => void) | undefined;
|
|
1512
|
-
/**
|
|
1513
|
-
* Whether the menu is currently open.
|
|
1514
|
-
*/
|
|
1515
|
-
open?: boolean | undefined;
|
|
1516
|
-
/**
|
|
1517
|
-
* The visual orientation of the menu.
|
|
1518
|
-
* Controls whether roving focus uses up/down or left/right arrow keys.
|
|
1519
|
-
* @default 'vertical'
|
|
1520
|
-
*/
|
|
1521
|
-
orientation?: MenuRoot.Orientation | undefined;
|
|
1522
|
-
/**
|
|
1523
|
-
* Whether the component should ignore user interaction.
|
|
1524
|
-
* @default false
|
|
1525
|
-
*/
|
|
1526
|
-
disabled?: boolean | undefined;
|
|
1527
|
-
/**
|
|
1528
|
-
* When in a submenu, determines whether pressing the Escape key
|
|
1529
|
-
* closes the entire menu, or only the current child menu.
|
|
1530
|
-
* @default false
|
|
1531
|
-
*/
|
|
1532
|
-
closeParentOnEsc?: boolean | undefined;
|
|
1533
|
-
/**
|
|
1534
|
-
* A ref to imperative actions.
|
|
1535
|
-
* - `unmount`: When specified, the menu will not be unmounted when closed.
|
|
1536
|
-
* Instead, the `unmount` function must be called to unmount the menu manually.
|
|
1537
|
-
* Useful when the menu's animation is controlled by an external library.
|
|
1538
|
-
* - `close`: When specified, the menu can be closed imperatively.
|
|
1539
|
-
*/
|
|
1540
|
-
actionsRef?: React$1.RefObject<MenuRoot.Actions | null> | undefined;
|
|
1541
|
-
/**
|
|
1542
|
-
* ID of the trigger that the popover is associated with.
|
|
1543
|
-
* This is useful in conjunction with the `open` prop to create a controlled popover.
|
|
1544
|
-
* There's no need to specify this prop when the popover is uncontrolled (that is, when the `open` prop is not set).
|
|
1545
|
-
*/
|
|
1546
|
-
triggerId?: string | null | undefined;
|
|
1547
|
-
/**
|
|
1548
|
-
* ID of the trigger that the popover is associated with.
|
|
1549
|
-
* This is useful in conjunction with the `defaultOpen` prop to create an initially open popover.
|
|
1550
|
-
*/
|
|
1551
|
-
defaultTriggerId?: string | null | undefined;
|
|
1552
|
-
/**
|
|
1553
|
-
* A handle to associate the menu with a trigger.
|
|
1554
|
-
* If specified, allows external triggers to control the menu's open state.
|
|
1555
|
-
*/
|
|
1556
|
-
handle?: MenuHandle<Payload> | undefined;
|
|
1557
|
-
/**
|
|
1558
|
-
* The content of the popover.
|
|
1559
|
-
* This can be a regular React node or a render function that receives the `payload` of the active trigger.
|
|
1560
|
-
*/
|
|
1561
|
-
children?: React$1.ReactNode | PayloadChildRenderFunction<Payload>;
|
|
1562
|
-
}
|
|
1563
|
-
export interface MenuRootActions {
|
|
1564
|
-
unmount: () => void;
|
|
1565
|
-
close: () => void;
|
|
1566
|
-
}
|
|
1567
|
-
export type MenuRootChangeEventReason = typeof triggerHover | typeof triggerFocus | typeof triggerPress | typeof outsidePress | typeof focusOut | typeof listNavigation | typeof escapeKey | typeof itemPress | typeof closePress | typeof siblingOpen | typeof cancelOpen | typeof imperativeAction | typeof none;
|
|
1568
|
-
export type MenuRootChangeEventDetails = BaseUIChangeEventDetails<MenuRoot.ChangeEventReason> & {
|
|
1569
|
-
preventUnmountOnClose(): void;
|
|
1570
|
-
};
|
|
1571
|
-
export type MenuRootOrientation = "horizontal" | "vertical";
|
|
1572
|
-
export type MenuParent = {
|
|
1573
|
-
type: "menu";
|
|
1574
|
-
store: MenuStore<unknown>;
|
|
1575
|
-
} | {
|
|
1576
|
-
type: "menubar";
|
|
1577
|
-
context: MenubarContext;
|
|
1578
|
-
} | {
|
|
1579
|
-
type: "context-menu";
|
|
1580
|
-
context: ContextMenuRootContext;
|
|
1581
|
-
} | {
|
|
1582
|
-
type: "nested-context-menu";
|
|
1583
|
-
context: ContextMenuRootContext;
|
|
1584
|
-
menuContext: MenuRootContext;
|
|
1585
|
-
} | {
|
|
1586
|
-
type: undefined;
|
|
1587
|
-
};
|
|
1588
|
-
export declare namespace MenuRoot {
|
|
1589
|
-
type State = MenuRootState;
|
|
1590
|
-
type Props<Payload = unknown> = MenuRootProps<Payload>;
|
|
1591
|
-
type Actions = MenuRootActions;
|
|
1592
|
-
type ChangeEventReason = MenuRootChangeEventReason;
|
|
1593
|
-
type ChangeEventDetails = MenuRootChangeEventDetails;
|
|
1594
|
-
type Orientation = MenuRootOrientation;
|
|
1595
|
-
}
|
|
1596
|
-
/**
|
|
1597
|
-
* A menu item that toggles a setting on or off.
|
|
1598
|
-
* Renders a `<div>` element.
|
|
1599
|
-
*
|
|
1600
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
1601
|
-
*/
|
|
1602
|
-
export declare const MenuCheckboxItem: React$1.ForwardRefExoticComponent<Omit<MenuCheckboxItemProps, "ref"> & React$1.RefAttributes<HTMLElement>>;
|
|
1603
|
-
export interface MenuCheckboxItemState {
|
|
1604
|
-
/**
|
|
1605
|
-
* Whether the checkbox item should ignore user interaction.
|
|
1606
|
-
*/
|
|
1607
|
-
disabled: boolean;
|
|
1608
|
-
/**
|
|
1609
|
-
* Whether the checkbox item is currently highlighted.
|
|
1610
|
-
*/
|
|
1611
|
-
highlighted: boolean;
|
|
1612
|
-
/**
|
|
1613
|
-
* Whether the checkbox item is currently ticked.
|
|
1614
|
-
*/
|
|
1615
|
-
checked: boolean;
|
|
1616
|
-
}
|
|
1617
|
-
export interface MenuCheckboxItemProps extends NonNativeButtonProps, BaseUIComponentProps<"div", MenuCheckboxItemState> {
|
|
1618
|
-
/**
|
|
1619
|
-
* Whether the checkbox item is currently ticked.
|
|
1620
|
-
*
|
|
1621
|
-
* To render an uncontrolled checkbox item, use the `defaultChecked` prop instead.
|
|
1622
|
-
*/
|
|
1623
|
-
checked?: boolean | undefined;
|
|
1624
|
-
/**
|
|
1625
|
-
* Whether the checkbox item is initially ticked.
|
|
1626
|
-
*
|
|
1627
|
-
* To render a controlled checkbox item, use the `checked` prop instead.
|
|
1628
|
-
* @default false
|
|
1629
|
-
*/
|
|
1630
|
-
defaultChecked?: boolean | undefined;
|
|
1631
|
-
/**
|
|
1632
|
-
* Event handler called when the checkbox item is ticked or unticked.
|
|
1633
|
-
*/
|
|
1634
|
-
onCheckedChange?: ((checked: boolean, eventDetails: MenuCheckboxItem.ChangeEventDetails) => void) | undefined;
|
|
1635
|
-
/**
|
|
1636
|
-
* The click handler for the menu item.
|
|
1637
|
-
*/
|
|
1638
|
-
onClick?: BaseUIComponentProps<"div", MenuCheckboxItemState>["onClick"] | undefined;
|
|
1639
|
-
/**
|
|
1640
|
-
* Whether the component should ignore user interaction.
|
|
1641
|
-
* @default false
|
|
1642
|
-
*/
|
|
1643
|
-
disabled?: boolean | undefined;
|
|
1644
|
-
/**
|
|
1645
|
-
* Overrides the text label to use when the item is matched during keyboard text navigation.
|
|
1646
|
-
*/
|
|
1647
|
-
label?: string | undefined;
|
|
1648
|
-
/**
|
|
1649
|
-
* @ignore
|
|
1650
|
-
*/
|
|
1651
|
-
id?: string | undefined;
|
|
1652
|
-
/**
|
|
1653
|
-
* Whether to close the menu when the item is clicked.
|
|
1654
|
-
* @default false
|
|
1655
|
-
*/
|
|
1656
|
-
closeOnClick?: boolean | undefined;
|
|
1657
|
-
}
|
|
1658
|
-
export type MenuCheckboxItemChangeEventReason = MenuRoot.ChangeEventReason;
|
|
1659
|
-
export type MenuCheckboxItemChangeEventDetails = MenuRoot.ChangeEventDetails;
|
|
1660
|
-
export declare namespace MenuCheckboxItem {
|
|
1661
|
-
type State = MenuCheckboxItemState;
|
|
1662
|
-
type Props = MenuCheckboxItemProps;
|
|
1663
|
-
type ChangeEventReason = MenuCheckboxItemChangeEventReason;
|
|
1664
|
-
type ChangeEventDetails = MenuCheckboxItemChangeEventDetails;
|
|
1665
|
-
}
|
|
1666
|
-
/**
|
|
1667
|
-
* Indicates whether the checkbox item is ticked.
|
|
1668
|
-
* Renders a `<span>` element.
|
|
1669
|
-
*
|
|
1670
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
1671
|
-
*/
|
|
1672
|
-
export declare const MenuCheckboxItemIndicator: React$1.ForwardRefExoticComponent<Omit<MenuCheckboxItemIndicatorProps, "ref"> & React$1.RefAttributes<HTMLSpanElement>>;
|
|
1673
|
-
export interface MenuCheckboxItemIndicatorProps extends BaseUIComponentProps<"span", MenuCheckboxItemIndicatorState> {
|
|
1674
|
-
/**
|
|
1675
|
-
* Whether to keep the HTML element in the DOM when the checkbox item is not checked.
|
|
1676
|
-
* @default false
|
|
1677
|
-
*/
|
|
1678
|
-
keepMounted?: boolean | undefined;
|
|
1679
|
-
}
|
|
1680
|
-
export interface MenuCheckboxItemIndicatorState {
|
|
1681
|
-
/**
|
|
1682
|
-
* Whether the checkbox item is currently ticked.
|
|
1683
|
-
*/
|
|
1684
|
-
checked: boolean;
|
|
1685
|
-
/**
|
|
1686
|
-
* Whether the component should ignore user interaction.
|
|
1687
|
-
*/
|
|
1688
|
-
disabled: boolean;
|
|
1689
|
-
/**
|
|
1690
|
-
* Whether the item is highlighted.
|
|
1691
|
-
*/
|
|
1692
|
-
highlighted: boolean;
|
|
1693
|
-
/**
|
|
1694
|
-
* The transition status of the component.
|
|
1695
|
-
*/
|
|
1696
|
-
transitionStatus: TransitionStatus;
|
|
1697
|
-
}
|
|
1698
|
-
export declare namespace MenuCheckboxItemIndicator {
|
|
1699
|
-
type Props = MenuCheckboxItemIndicatorProps;
|
|
1700
|
-
type State = MenuCheckboxItemIndicatorState;
|
|
1701
|
-
}
|
|
1702
|
-
/**
|
|
1703
|
-
* Groups related menu items with the corresponding label.
|
|
1704
|
-
* Renders a `<div>` element.
|
|
1705
|
-
*
|
|
1706
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
1707
|
-
*/
|
|
1708
|
-
export declare const MenuGroup: React$1.ForwardRefExoticComponent<Omit<MenuGroupProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
1709
|
-
export interface MenuGroupProps extends BaseUIComponentProps<"div", MenuGroupState> {
|
|
1710
|
-
/**
|
|
1711
|
-
* The content of the component.
|
|
1712
|
-
*/
|
|
1713
|
-
children?: React$1.ReactNode;
|
|
1714
|
-
}
|
|
1715
|
-
export interface MenuGroupState {
|
|
1716
|
-
}
|
|
1717
|
-
export declare namespace MenuGroup {
|
|
1718
|
-
type Props = MenuGroupProps;
|
|
1719
|
-
type State = MenuGroupState;
|
|
1720
|
-
}
|
|
1721
|
-
/**
|
|
1722
|
-
* An accessible label that is automatically associated with its parent group.
|
|
1723
|
-
* Renders a `<div>` element.
|
|
1724
|
-
*
|
|
1725
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
1726
|
-
*/
|
|
1727
|
-
export declare const MenuGroupLabel: React$1.ForwardRefExoticComponent<Omit<MenuGroupLabelProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
1728
|
-
export interface MenuGroupLabelProps extends BaseUIComponentProps<"div", MenuGroupLabelState> {
|
|
1729
|
-
}
|
|
1730
|
-
export interface MenuGroupLabelState {
|
|
1731
|
-
}
|
|
1732
|
-
export declare namespace MenuGroupLabel {
|
|
1733
|
-
type Props = MenuGroupLabelProps;
|
|
1734
|
-
type State = MenuGroupLabelState;
|
|
1735
|
-
}
|
|
1736
|
-
/**
|
|
1737
|
-
* An individual interactive item in the menu.
|
|
1738
|
-
* Renders a `<div>` element.
|
|
1739
|
-
*
|
|
1740
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
1741
|
-
*/
|
|
1742
|
-
export declare const MenuItem: React$1.ForwardRefExoticComponent<Omit<MenuItemProps, "ref"> & React$1.RefAttributes<HTMLElement>>;
|
|
1743
|
-
export interface MenuItemState {
|
|
1744
|
-
/**
|
|
1745
|
-
* Whether the item should ignore user interaction.
|
|
1746
|
-
*/
|
|
1747
|
-
disabled: boolean;
|
|
1748
|
-
/**
|
|
1749
|
-
* Whether the item is highlighted.
|
|
1750
|
-
*/
|
|
1751
|
-
highlighted: boolean;
|
|
1752
|
-
}
|
|
1753
|
-
export interface MenuItemProps extends NonNativeButtonProps, BaseUIComponentProps<"div", MenuItemState> {
|
|
1754
|
-
/**
|
|
1755
|
-
* The click handler for the menu item.
|
|
1756
|
-
*/
|
|
1757
|
-
onClick?: BaseUIComponentProps<"div", MenuItemState>["onClick"] | undefined;
|
|
1758
|
-
/**
|
|
1759
|
-
* Whether the component should ignore user interaction.
|
|
1760
|
-
* @default false
|
|
1761
|
-
*/
|
|
1762
|
-
disabled?: boolean | undefined;
|
|
1763
|
-
/**
|
|
1764
|
-
* Overrides the text label to use when the item is matched during keyboard text navigation.
|
|
1765
|
-
*/
|
|
1766
|
-
label?: string | undefined;
|
|
1767
|
-
/**
|
|
1768
|
-
* @ignore
|
|
1769
|
-
*/
|
|
1770
|
-
id?: string | undefined;
|
|
1771
|
-
/**
|
|
1772
|
-
* Whether to close the menu when the item is clicked.
|
|
1773
|
-
*
|
|
1774
|
-
* @default true
|
|
1775
|
-
*/
|
|
1776
|
-
closeOnClick?: boolean | undefined;
|
|
1777
|
-
}
|
|
1778
|
-
export declare namespace MenuItem {
|
|
1779
|
-
type State = MenuItemState;
|
|
1780
|
-
type Props = MenuItemProps;
|
|
1781
|
-
}
|
|
1782
|
-
/**
|
|
1783
|
-
* A link in the menu that can be used to navigate to a different page or section.
|
|
1784
|
-
* Renders an `<a>` element.
|
|
1785
|
-
*
|
|
1786
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
1787
|
-
*/
|
|
1788
|
-
export declare const MenuLinkItem: React$1.ForwardRefExoticComponent<Omit<MenuLinkItemProps, "ref"> & React$1.RefAttributes<Element>>;
|
|
1789
|
-
export interface MenuLinkItemState {
|
|
1790
|
-
/**
|
|
1791
|
-
* Whether the item is highlighted.
|
|
1792
|
-
*/
|
|
1793
|
-
highlighted: boolean;
|
|
1794
|
-
}
|
|
1795
|
-
export interface MenuLinkItemProps extends BaseUIComponentProps<"a", MenuLinkItemState> {
|
|
1796
|
-
/**
|
|
1797
|
-
* Overrides the text label to use when the item is matched during keyboard text navigation.
|
|
1798
|
-
*/
|
|
1799
|
-
label?: string | undefined;
|
|
1800
|
-
/**
|
|
1801
|
-
* @ignore
|
|
1802
|
-
*/
|
|
1803
|
-
id?: string | undefined;
|
|
1804
|
-
/**
|
|
1805
|
-
* Whether to close the menu when the item is clicked.
|
|
1806
|
-
* @default false
|
|
1807
|
-
*/
|
|
1808
|
-
closeOnClick?: boolean | undefined;
|
|
1809
|
-
}
|
|
1810
|
-
export declare namespace MenuLinkItem {
|
|
1811
|
-
type State = MenuLinkItemState;
|
|
1812
|
-
type Props = MenuLinkItemProps;
|
|
1813
|
-
}
|
|
1814
|
-
/**
|
|
1815
|
-
* A container for the menu items.
|
|
1816
|
-
* Renders a `<div>` element.
|
|
1817
|
-
*
|
|
1818
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
1819
|
-
*/
|
|
1820
|
-
export declare const MenuPopup: React$1.ForwardRefExoticComponent<Omit<MenuPopupProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
1821
|
-
export interface MenuPopupProps extends BaseUIComponentProps<"div", MenuPopupState> {
|
|
1822
|
-
children?: React$1.ReactNode;
|
|
1823
|
-
/**
|
|
1824
|
-
* @ignore
|
|
1825
|
-
*/
|
|
1826
|
-
id?: string | undefined;
|
|
1827
|
-
/**
|
|
1828
|
-
* Determines the element to focus when the menu is closed.
|
|
1829
|
-
*
|
|
1830
|
-
* - `false`: Do not move focus.
|
|
1831
|
-
* - `true`: Move focus based on the default behavior (trigger or previously focused element).
|
|
1832
|
-
* - `RefObject`: Move focus to the ref element.
|
|
1833
|
-
* - `function`: Called with the interaction type (`mouse`, `touch`, `pen`, or `keyboard`).
|
|
1834
|
-
* Return an element to focus, `true` to use the default behavior, or `false`/`undefined` to do nothing.
|
|
1835
|
-
*/
|
|
1836
|
-
finalFocus?: boolean | React$1.RefObject<HTMLElement | null> | ((closeType: InteractionType) => boolean | HTMLElement | null | void) | undefined;
|
|
1837
|
-
}
|
|
1838
|
-
export interface MenuPopupState {
|
|
1839
|
-
/**
|
|
1840
|
-
* The transition status of the component.
|
|
1841
|
-
*/
|
|
1842
|
-
transitionStatus: TransitionStatus;
|
|
1843
|
-
/**
|
|
1844
|
-
* The side of the anchor the component is placed on.
|
|
1845
|
-
*/
|
|
1846
|
-
side: Side$1;
|
|
1847
|
-
/**
|
|
1848
|
-
* The alignment of the component relative to the anchor.
|
|
1849
|
-
*/
|
|
1850
|
-
align: Align;
|
|
1851
|
-
/**
|
|
1852
|
-
* Whether the menu is currently open.
|
|
1853
|
-
*/
|
|
1854
|
-
open: boolean;
|
|
1855
|
-
/**
|
|
1856
|
-
* Whether the component is nested.
|
|
1857
|
-
*/
|
|
1858
|
-
nested: boolean;
|
|
1859
|
-
/**
|
|
1860
|
-
* Whether transitions should be skipped.
|
|
1861
|
-
*/
|
|
1862
|
-
instant: "dismiss" | "click" | "group" | "trigger-change" | undefined;
|
|
1863
|
-
}
|
|
1864
|
-
export declare namespace MenuPopup {
|
|
1865
|
-
type Props = MenuPopupProps;
|
|
1866
|
-
type State = MenuPopupState;
|
|
1867
|
-
}
|
|
1868
|
-
/**
|
|
1869
|
-
* A portal element that moves the popup to a different part of the DOM.
|
|
1870
|
-
* By default, the portal element is appended to `<body>`.
|
|
1871
|
-
* Renders a `<div>` element.
|
|
1872
|
-
*
|
|
1873
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
1874
|
-
*/
|
|
1875
|
-
export declare const MenuPortal: React$1.ForwardRefExoticComponent<Omit<MenuPortalProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
1876
|
-
export interface MenuPortalState {
|
|
1877
|
-
}
|
|
1878
|
-
export interface MenuPortalProps extends FloatingPortal.Props<MenuPortalState> {
|
|
1879
|
-
/**
|
|
1880
|
-
* Whether to keep the portal mounted in the DOM while the popup is hidden.
|
|
1881
|
-
* @default false
|
|
1882
|
-
*/
|
|
1883
|
-
keepMounted?: boolean | undefined;
|
|
1884
|
-
}
|
|
1885
|
-
export declare namespace MenuPortal {
|
|
1886
|
-
type State = MenuPortalState;
|
|
1887
|
-
type Props = MenuPortalProps;
|
|
1888
|
-
}
|
|
1889
|
-
/**
|
|
1890
|
-
* Positions the menu popup against the trigger.
|
|
1891
|
-
* Renders a `<div>` element.
|
|
1892
|
-
*
|
|
1893
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
1894
|
-
*/
|
|
1895
|
-
export declare const MenuPositioner: React$1.ForwardRefExoticComponent<Omit<MenuPositionerProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
1896
|
-
export interface MenuPositionerState {
|
|
1897
|
-
/**
|
|
1898
|
-
* Whether the menu is currently open.
|
|
1899
|
-
*/
|
|
1900
|
-
open: boolean;
|
|
1901
|
-
/**
|
|
1902
|
-
* The side of the anchor the component is placed on.
|
|
1903
|
-
*/
|
|
1904
|
-
side: Side$1;
|
|
1905
|
-
/**
|
|
1906
|
-
* The alignment of the component relative to the anchor.
|
|
1907
|
-
*/
|
|
1908
|
-
align: Align;
|
|
1909
|
-
/**
|
|
1910
|
-
* Whether the anchor element is hidden.
|
|
1911
|
-
*/
|
|
1912
|
-
anchorHidden: boolean;
|
|
1913
|
-
/**
|
|
1914
|
-
* Whether the component is nested.
|
|
1915
|
-
*/
|
|
1916
|
-
nested: boolean;
|
|
1917
|
-
/**
|
|
1918
|
-
* Whether CSS transitions should be disabled.
|
|
1919
|
-
*/
|
|
1920
|
-
instant: string | undefined;
|
|
1921
|
-
}
|
|
1922
|
-
export interface MenuPositionerProps extends UseAnchorPositioningSharedParameters, BaseUIComponentProps<"div", MenuPositionerState> {
|
|
1923
|
-
}
|
|
1924
|
-
export declare namespace MenuPositioner {
|
|
1925
|
-
type State = MenuPositionerState;
|
|
1926
|
-
type Props = MenuPositionerProps;
|
|
1927
|
-
}
|
|
1928
|
-
/**
|
|
1929
|
-
* Groups related radio items.
|
|
1930
|
-
* Renders a `<div>` element.
|
|
1931
|
-
*
|
|
1932
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
1933
|
-
*/
|
|
1934
|
-
export declare const MenuRadioGroup: React$1.NamedExoticComponent<Omit<MenuRadioGroupProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
1935
|
-
export interface MenuRadioGroupProps extends BaseUIComponentProps<"div", MenuRadioGroupState> {
|
|
1936
|
-
/**
|
|
1937
|
-
* The content of the component.
|
|
1938
|
-
*/
|
|
1939
|
-
children?: React$1.ReactNode;
|
|
1940
|
-
/**
|
|
1941
|
-
* The controlled value of the radio item that should be currently selected.
|
|
1942
|
-
*
|
|
1943
|
-
* To render an uncontrolled radio group, use the `defaultValue` prop instead.
|
|
1944
|
-
*/
|
|
1945
|
-
value?: any;
|
|
1946
|
-
/**
|
|
1947
|
-
* The uncontrolled value of the radio item that should be initially selected.
|
|
1948
|
-
*
|
|
1949
|
-
* To render a controlled radio group, use the `value` prop instead.
|
|
1950
|
-
*/
|
|
1951
|
-
defaultValue?: any;
|
|
1952
|
-
/**
|
|
1953
|
-
* Function called when the selected value changes.
|
|
1954
|
-
*/
|
|
1955
|
-
onValueChange?: ((value: any, eventDetails: MenuRadioGroup.ChangeEventDetails) => void) | undefined;
|
|
1956
|
-
/**
|
|
1957
|
-
* Whether the component should ignore user interaction.
|
|
1958
|
-
*
|
|
1959
|
-
* @default false
|
|
1960
|
-
*/
|
|
1961
|
-
disabled?: boolean | undefined;
|
|
1962
|
-
}
|
|
1963
|
-
export interface MenuRadioGroupState {
|
|
1964
|
-
/**
|
|
1965
|
-
* Whether the component is disabled.
|
|
1966
|
-
*/
|
|
1967
|
-
disabled: boolean;
|
|
1968
|
-
}
|
|
1969
|
-
export type MenuRadioGroupChangeEventReason = MenuRoot.ChangeEventReason;
|
|
1970
|
-
export type MenuRadioGroupChangeEventDetails = MenuRoot.ChangeEventDetails;
|
|
1971
|
-
export declare namespace MenuRadioGroup {
|
|
1972
|
-
type Props = MenuRadioGroupProps;
|
|
1973
|
-
type State = MenuRadioGroupState;
|
|
1974
|
-
type ChangeEventReason = MenuRadioGroupChangeEventReason;
|
|
1975
|
-
type ChangeEventDetails = MenuRadioGroupChangeEventDetails;
|
|
1976
|
-
}
|
|
1977
|
-
/**
|
|
1978
|
-
* A menu item that works like a radio button in a given group.
|
|
1979
|
-
* Renders a `<div>` element.
|
|
1980
|
-
*
|
|
1981
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
1982
|
-
*/
|
|
1983
|
-
export declare const MenuRadioItem: React$1.ForwardRefExoticComponent<Omit<MenuRadioItemProps, "ref"> & React$1.RefAttributes<HTMLElement>>;
|
|
1984
|
-
export interface MenuRadioItemState {
|
|
1985
|
-
/**
|
|
1986
|
-
* Whether the radio item should ignore user interaction.
|
|
1987
|
-
*/
|
|
1988
|
-
disabled: boolean;
|
|
1989
|
-
/**
|
|
1990
|
-
* Whether the radio item is currently highlighted.
|
|
1991
|
-
*/
|
|
1992
|
-
highlighted: boolean;
|
|
1993
|
-
/**
|
|
1994
|
-
* Whether the radio item is currently selected.
|
|
1995
|
-
*/
|
|
1996
|
-
checked: boolean;
|
|
1997
|
-
}
|
|
1998
|
-
export interface MenuRadioItemProps extends NonNativeButtonProps, BaseUIComponentProps<"div", MenuRadioItemState> {
|
|
1999
|
-
/**
|
|
2000
|
-
* Value of the radio item.
|
|
2001
|
-
* This is the value that will be set in the MenuRadioGroup when the item is selected.
|
|
2002
|
-
*/
|
|
2003
|
-
value: any;
|
|
2004
|
-
/**
|
|
2005
|
-
* The click handler for the menu item.
|
|
2006
|
-
*/
|
|
2007
|
-
onClick?: BaseUIComponentProps<"div", MenuRadioItemState>["onClick"] | undefined;
|
|
2008
|
-
/**
|
|
2009
|
-
* Whether the component should ignore user interaction.
|
|
2010
|
-
* @default false
|
|
2011
|
-
*/
|
|
2012
|
-
disabled?: boolean | undefined;
|
|
2013
|
-
/**
|
|
2014
|
-
* Overrides the text label to use when the item is matched during keyboard text navigation.
|
|
2015
|
-
*/
|
|
2016
|
-
label?: string | undefined;
|
|
2017
|
-
/**
|
|
2018
|
-
* @ignore
|
|
2019
|
-
*/
|
|
2020
|
-
id?: string | undefined;
|
|
2021
|
-
/**
|
|
2022
|
-
* Whether to close the menu when the item is clicked.
|
|
2023
|
-
* @default false
|
|
2024
|
-
*/
|
|
2025
|
-
closeOnClick?: boolean | undefined;
|
|
2026
|
-
}
|
|
2027
|
-
export declare namespace MenuRadioItem {
|
|
2028
|
-
type State = MenuRadioItemState;
|
|
2029
|
-
type Props = MenuRadioItemProps;
|
|
2030
|
-
}
|
|
2031
|
-
/**
|
|
2032
|
-
* Indicates whether the radio item is selected.
|
|
2033
|
-
* Renders a `<span>` element.
|
|
2034
|
-
*
|
|
2035
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
2036
|
-
*/
|
|
2037
|
-
export declare const MenuRadioItemIndicator: React$1.ForwardRefExoticComponent<Omit<MenuRadioItemIndicatorProps, "ref"> & React$1.RefAttributes<HTMLSpanElement>>;
|
|
2038
|
-
export interface MenuRadioItemIndicatorProps extends BaseUIComponentProps<"span", MenuRadioItemIndicatorState> {
|
|
2039
|
-
/**
|
|
2040
|
-
* Whether to keep the HTML element in the DOM when the radio item is inactive.
|
|
2041
|
-
* @default false
|
|
2042
|
-
*/
|
|
2043
|
-
keepMounted?: boolean | undefined;
|
|
2044
|
-
}
|
|
2045
|
-
export interface MenuRadioItemIndicatorState {
|
|
2046
|
-
/**
|
|
2047
|
-
* Whether the radio item is currently selected.
|
|
2048
|
-
*/
|
|
2049
|
-
checked: boolean;
|
|
2050
|
-
/**
|
|
2051
|
-
* Whether the component should ignore user interaction.
|
|
2052
|
-
*/
|
|
2053
|
-
disabled: boolean;
|
|
2054
|
-
/**
|
|
2055
|
-
* Whether the item is highlighted.
|
|
2056
|
-
*/
|
|
2057
|
-
highlighted: boolean;
|
|
2058
|
-
/**
|
|
2059
|
-
* The transition status of the component.
|
|
2060
|
-
*/
|
|
2061
|
-
transitionStatus: TransitionStatus;
|
|
2062
|
-
}
|
|
2063
|
-
export declare namespace MenuRadioItemIndicator {
|
|
2064
|
-
type Props = MenuRadioItemIndicatorProps;
|
|
2065
|
-
type State = MenuRadioItemIndicatorState;
|
|
2066
|
-
}
|
|
2067
|
-
declare const MenuSubmenuRootContext: React$1.Context<MenuSubmenuRootContext | undefined>;
|
|
2068
|
-
export interface MenuSubmenuRootContext {
|
|
2069
|
-
parentMenu: MenuStore<unknown>;
|
|
2070
|
-
}
|
|
2071
|
-
export declare function useMenuSubmenuRootContext(): MenuSubmenuRootContext | undefined;
|
|
2072
|
-
/**
|
|
2073
|
-
* Groups all parts of a submenu.
|
|
2074
|
-
* Doesn't render its own HTML element.
|
|
2075
|
-
*
|
|
2076
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
2077
|
-
*/
|
|
2078
|
-
export declare function MenuSubmenuRoot(props: MenuSubmenuRoot.Props): import("react/jsx-runtime").React$1.JSX.Element;
|
|
2079
|
-
export interface MenuSubmenuRootProps extends Omit<MenuRoot.Props, "modal" | "openOnHover" | "onOpenChange"> {
|
|
2080
|
-
/**
|
|
2081
|
-
* Event handler called when the menu is opened or closed.
|
|
2082
|
-
*/
|
|
2083
|
-
onOpenChange?: ((open: boolean, eventDetails: MenuSubmenuRoot.ChangeEventDetails) => void) | undefined;
|
|
2084
|
-
/**
|
|
2085
|
-
* When in a submenu, determines whether pressing the Escape key
|
|
2086
|
-
* closes the entire menu, or only the current child menu.
|
|
2087
|
-
* @default false
|
|
2088
|
-
*/
|
|
2089
|
-
closeParentOnEsc?: boolean | undefined;
|
|
2090
|
-
}
|
|
2091
|
-
export interface MenuSubmenuRootState {
|
|
2092
|
-
}
|
|
2093
|
-
export type MenuSubmenuRootChangeEventReason = MenuRoot.ChangeEventReason;
|
|
2094
|
-
export type MenuSubmenuRootChangeEventDetails = MenuRoot.ChangeEventDetails;
|
|
2095
|
-
export declare namespace MenuSubmenuRoot {
|
|
2096
|
-
type Props = MenuSubmenuRootProps;
|
|
2097
|
-
type State = MenuSubmenuRootState;
|
|
2098
|
-
type ChangeEventReason = MenuSubmenuRootChangeEventReason;
|
|
2099
|
-
type ChangeEventDetails = MenuSubmenuRootChangeEventDetails;
|
|
2100
|
-
}
|
|
2101
|
-
/**
|
|
2102
|
-
* A button that opens the menu.
|
|
2103
|
-
* Renders a `<button>` element.
|
|
2104
|
-
*
|
|
2105
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
2106
|
-
*/
|
|
2107
|
-
export declare const MenuTrigger: MenuTrigger;
|
|
2108
|
-
export interface MenuTrigger {
|
|
2109
|
-
<Payload>(componentProps: MenuTriggerProps<Payload> & React$1.RefAttributes<HTMLElement>): React$1.JSX.Element;
|
|
2110
|
-
}
|
|
2111
|
-
export interface MenuTriggerProps<Payload = unknown> extends NativeButtonProps, BaseUIComponentProps<"button", MenuTriggerState> {
|
|
2112
|
-
children?: React$1.ReactNode;
|
|
2113
|
-
/**
|
|
2114
|
-
* Whether the component should ignore user interaction.
|
|
2115
|
-
* @default false
|
|
2116
|
-
*/
|
|
2117
|
-
disabled?: boolean | undefined;
|
|
2118
|
-
/**
|
|
2119
|
-
* A handle to associate the trigger with a menu.
|
|
2120
|
-
*/
|
|
2121
|
-
handle?: MenuHandle<Payload> | undefined;
|
|
2122
|
-
/**
|
|
2123
|
-
* A payload to pass to the menu when it is opened.
|
|
2124
|
-
*/
|
|
2125
|
-
payload?: Payload | undefined;
|
|
2126
|
-
/**
|
|
2127
|
-
* How long to wait before the menu may be opened on hover. Specified in milliseconds.
|
|
2128
|
-
*
|
|
2129
|
-
* Requires the `openOnHover` prop.
|
|
2130
|
-
* @default 100
|
|
2131
|
-
*/
|
|
2132
|
-
delay?: number | undefined;
|
|
2133
|
-
/**
|
|
2134
|
-
* How long to wait before closing the menu that was opened on hover.
|
|
2135
|
-
* Specified in milliseconds.
|
|
2136
|
-
*
|
|
2137
|
-
* Requires the `openOnHover` prop.
|
|
2138
|
-
* @default 0
|
|
2139
|
-
*/
|
|
2140
|
-
closeDelay?: number | undefined;
|
|
2141
|
-
/**
|
|
2142
|
-
* Whether the menu should also open when the trigger is hovered.
|
|
2143
|
-
*/
|
|
2144
|
-
openOnHover?: boolean | undefined;
|
|
2145
|
-
}
|
|
2146
|
-
export interface MenuTriggerState {
|
|
2147
|
-
/**
|
|
2148
|
-
* Whether the menu is currently open.
|
|
2149
|
-
*/
|
|
2150
|
-
open: boolean;
|
|
2151
|
-
/**
|
|
2152
|
-
* Whether the trigger is disabled.
|
|
2153
|
-
*/
|
|
2154
|
-
disabled: boolean;
|
|
2155
|
-
}
|
|
2156
|
-
export declare namespace MenuTrigger {
|
|
2157
|
-
type Props<Payload = unknown> = MenuTriggerProps<Payload>;
|
|
2158
|
-
type State = MenuTriggerState;
|
|
2159
|
-
}
|
|
2160
|
-
/**
|
|
2161
|
-
* A viewport for displaying content transitions.
|
|
2162
|
-
* This component is only required if one popup can be opened by multiple triggers, its content
|
|
2163
|
-
* changes based on the trigger, and switching between them is animated.
|
|
2164
|
-
* Renders a `<div>` element.
|
|
2165
|
-
*
|
|
2166
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
2167
|
-
*/
|
|
2168
|
-
export declare const MenuViewport: React$1.ForwardRefExoticComponent<Omit<MenuViewport.Props, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
2169
|
-
export declare namespace MenuViewport {
|
|
2170
|
-
interface Props extends BaseUIComponentProps<"div", State> {
|
|
2171
|
-
/**
|
|
2172
|
-
* The content to render inside the transition container.
|
|
2173
|
-
*/
|
|
2174
|
-
children?: React$1.ReactNode;
|
|
2175
|
-
}
|
|
2176
|
-
interface State {
|
|
2177
|
-
activationDirection: string | undefined;
|
|
2178
|
-
/**
|
|
2179
|
-
* Whether the viewport is currently transitioning between contents.
|
|
2180
|
-
*/
|
|
2181
|
-
transitioning: boolean;
|
|
2182
|
-
/**
|
|
2183
|
-
* Present if animations should be instant.
|
|
2184
|
-
*/
|
|
2185
|
-
instant: "dismiss" | "click" | "group" | "trigger-change" | undefined;
|
|
2186
|
-
}
|
|
2187
|
-
}
|
|
2188
|
-
declare const Separator: React$1.ForwardRefExoticComponent<Omit<SeparatorProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
2189
|
-
export interface SeparatorProps extends BaseUIComponentProps<"div", SeparatorState> {
|
|
2190
|
-
/**
|
|
2191
|
-
* The orientation of the separator.
|
|
2192
|
-
* @default 'horizontal'
|
|
2193
|
-
*/
|
|
2194
|
-
orientation?: Orientation | undefined;
|
|
2195
|
-
}
|
|
2196
|
-
export interface SeparatorState {
|
|
2197
|
-
/**
|
|
2198
|
-
* The orientation of the separator.
|
|
2199
|
-
*/
|
|
2200
|
-
orientation: Orientation;
|
|
2201
|
-
}
|
|
2202
|
-
declare namespace Separator {
|
|
2203
|
-
type Props = SeparatorProps;
|
|
2204
|
-
type State = SeparatorState;
|
|
2205
|
-
}
|
|
2206
|
-
/**
|
|
2207
|
-
* A menu item that opens a submenu.
|
|
2208
|
-
* Renders a `<div>` element.
|
|
2209
|
-
*
|
|
2210
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
2211
|
-
*/
|
|
2212
|
-
export declare const MenuSubmenuTrigger: React$1.ForwardRefExoticComponent<Omit<MenuSubmenuTriggerProps, "ref"> & React$1.RefAttributes<HTMLElement>>;
|
|
2213
|
-
export interface MenuSubmenuTriggerState {
|
|
2214
|
-
/**
|
|
2215
|
-
* Whether the component should ignore user interaction.
|
|
2216
|
-
*/
|
|
2217
|
-
disabled: boolean;
|
|
2218
|
-
/**
|
|
2219
|
-
* Whether the item is highlighted.
|
|
2220
|
-
*/
|
|
2221
|
-
highlighted: boolean;
|
|
2222
|
-
/**
|
|
2223
|
-
* Whether the menu is currently open.
|
|
2224
|
-
*/
|
|
2225
|
-
open: boolean;
|
|
2226
|
-
}
|
|
2227
|
-
export interface MenuSubmenuTriggerProps extends NonNativeButtonProps, BaseUIComponentProps<"div", MenuSubmenuTriggerState> {
|
|
2228
|
-
onClick?: BaseUIComponentProps<"div", MenuSubmenuTriggerState>["onClick"] | undefined;
|
|
2229
|
-
/**
|
|
2230
|
-
* Overrides the text label to use when the item is matched during keyboard text navigation.
|
|
2231
|
-
*/
|
|
2232
|
-
label?: string | undefined;
|
|
2233
|
-
/**
|
|
2234
|
-
* @ignore
|
|
2235
|
-
*/
|
|
2236
|
-
id?: string | undefined;
|
|
2237
|
-
/**
|
|
2238
|
-
* Whether the component should ignore user interaction.
|
|
2239
|
-
* @default false
|
|
2240
|
-
*/
|
|
2241
|
-
disabled?: boolean | undefined;
|
|
2242
|
-
/**
|
|
2243
|
-
* How long to wait before the menu may be opened on hover. Specified in milliseconds.
|
|
2244
|
-
*
|
|
2245
|
-
* Requires the `openOnHover` prop.
|
|
2246
|
-
* @default 100
|
|
2247
|
-
*/
|
|
2248
|
-
delay?: number | undefined;
|
|
2249
|
-
/**
|
|
2250
|
-
* How long to wait before closing the menu that was opened on hover.
|
|
2251
|
-
* Specified in milliseconds.
|
|
2252
|
-
*
|
|
2253
|
-
* Requires the `openOnHover` prop.
|
|
2254
|
-
* @default 0
|
|
2255
|
-
*/
|
|
2256
|
-
closeDelay?: number | undefined;
|
|
2257
|
-
/**
|
|
2258
|
-
* Whether the menu should also open when the trigger is hovered.
|
|
2259
|
-
*/
|
|
2260
|
-
openOnHover?: boolean | undefined;
|
|
2261
|
-
}
|
|
2262
|
-
export declare namespace MenuSubmenuTrigger {
|
|
2263
|
-
type Props = MenuSubmenuTriggerProps;
|
|
2264
|
-
type State = MenuSubmenuTriggerState;
|
|
2265
|
-
}
|
|
2266
|
-
|
|
2267
|
-
declare namespace Menu {
|
|
2268
|
-
export { MenuArrow as Arrow, MenuBackdrop as Backdrop, MenuCheckboxItem as CheckboxItem, MenuCheckboxItemIndicator as CheckboxItemIndicator, MenuGroup as Group, MenuGroupLabel as GroupLabel, MenuHandle as Handle, MenuItem as Item, MenuLinkItem as LinkItem, MenuPopup as Popup, MenuPortal as Portal, MenuPositioner as Positioner, MenuRadioGroup as RadioGroup, MenuRadioItem as RadioItem, MenuRadioItemIndicator as RadioItemIndicator, MenuRoot as Root, MenuSubmenuRoot as SubmenuRoot, MenuSubmenuTrigger as SubmenuTrigger, MenuTrigger as Trigger, MenuViewport as Viewport, Separator, createMenuHandle as createHandle };
|
|
2269
|
-
}
|
|
2270
|
-
|
|
2271
|
-
export {
|
|
2272
|
-
Menu,
|
|
2273
|
-
};
|
|
2274
|
-
|
|
2275
|
-
export {};
|