@stevederico/skateboard-ui 3.11.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 +17 -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 -48
- 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,1656 +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
|
-
declare const none: "none";
|
|
7
|
-
declare const triggerPress: "trigger-press";
|
|
8
|
-
declare const triggerHover: "trigger-hover";
|
|
9
|
-
declare const triggerFocus: "trigger-focus";
|
|
10
|
-
declare const outsidePress: "outside-press";
|
|
11
|
-
declare const itemPress: "item-press";
|
|
12
|
-
declare const closePress: "close-press";
|
|
13
|
-
declare const linkPress: "link-press";
|
|
14
|
-
declare const clearPress: "clear-press";
|
|
15
|
-
declare const chipRemovePress: "chip-remove-press";
|
|
16
|
-
declare const trackPress: "track-press";
|
|
17
|
-
declare const incrementPress: "increment-press";
|
|
18
|
-
declare const decrementPress: "decrement-press";
|
|
19
|
-
declare const inputChange: "input-change";
|
|
20
|
-
declare const inputClear: "input-clear";
|
|
21
|
-
declare const inputBlur: "input-blur";
|
|
22
|
-
declare const inputPaste: "input-paste";
|
|
23
|
-
declare const inputPress: "input-press";
|
|
24
|
-
declare const focusOut: "focus-out";
|
|
25
|
-
declare const escapeKey: "escape-key";
|
|
26
|
-
declare const closeWatcher: "close-watcher";
|
|
27
|
-
declare const listNavigation: "list-navigation";
|
|
28
|
-
declare const keyboard: "keyboard";
|
|
29
|
-
declare const pointer: "pointer";
|
|
30
|
-
declare const drag: "drag";
|
|
31
|
-
declare const wheel: "wheel";
|
|
32
|
-
declare const scrub: "scrub";
|
|
33
|
-
declare const cancelOpen: "cancel-open";
|
|
34
|
-
declare const siblingOpen: "sibling-open";
|
|
35
|
-
declare const disabled: "disabled";
|
|
36
|
-
declare const missing: "missing";
|
|
37
|
-
declare const initial: "initial";
|
|
38
|
-
declare const imperativeAction: "imperative-action";
|
|
39
|
-
declare const swipe: "swipe";
|
|
40
|
-
declare const windowResize: "window-resize";
|
|
41
|
-
export interface ReasonToEventMap {
|
|
42
|
-
[none]: Event;
|
|
43
|
-
[triggerPress]: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent;
|
|
44
|
-
[triggerHover]: MouseEvent;
|
|
45
|
-
[triggerFocus]: FocusEvent;
|
|
46
|
-
[outsidePress]: MouseEvent | PointerEvent | TouchEvent;
|
|
47
|
-
[itemPress]: MouseEvent | KeyboardEvent | PointerEvent;
|
|
48
|
-
[closePress]: MouseEvent | KeyboardEvent | PointerEvent;
|
|
49
|
-
[linkPress]: MouseEvent | PointerEvent;
|
|
50
|
-
[clearPress]: PointerEvent | MouseEvent | KeyboardEvent;
|
|
51
|
-
[chipRemovePress]: PointerEvent | MouseEvent | KeyboardEvent;
|
|
52
|
-
[trackPress]: PointerEvent | MouseEvent | TouchEvent;
|
|
53
|
-
[incrementPress]: PointerEvent | MouseEvent | TouchEvent;
|
|
54
|
-
[decrementPress]: PointerEvent | MouseEvent | TouchEvent;
|
|
55
|
-
[inputChange]: InputEvent | Event;
|
|
56
|
-
[inputClear]: InputEvent | FocusEvent | Event;
|
|
57
|
-
[inputBlur]: FocusEvent;
|
|
58
|
-
[inputPaste]: ClipboardEvent;
|
|
59
|
-
[inputPress]: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent;
|
|
60
|
-
[focusOut]: FocusEvent | KeyboardEvent;
|
|
61
|
-
[escapeKey]: KeyboardEvent;
|
|
62
|
-
[closeWatcher]: Event;
|
|
63
|
-
[listNavigation]: KeyboardEvent;
|
|
64
|
-
[keyboard]: KeyboardEvent;
|
|
65
|
-
[pointer]: PointerEvent;
|
|
66
|
-
[drag]: PointerEvent | TouchEvent;
|
|
67
|
-
[swipe]: PointerEvent | TouchEvent;
|
|
68
|
-
[wheel]: WheelEvent;
|
|
69
|
-
[scrub]: PointerEvent;
|
|
70
|
-
[cancelOpen]: MouseEvent;
|
|
71
|
-
[siblingOpen]: Event;
|
|
72
|
-
[disabled]: Event;
|
|
73
|
-
[missing]: Event;
|
|
74
|
-
[initial]: Event;
|
|
75
|
-
[imperativeAction]: Event;
|
|
76
|
-
[windowResize]: UIEvent;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Maps a change `reason` string to the corresponding native event type.
|
|
80
|
-
*/
|
|
81
|
-
export type ReasonToEvent<Reason extends string> = Reason extends keyof ReasonToEventMap ? ReasonToEventMap[Reason] : Event;
|
|
82
|
-
export type BaseUIChangeEventDetail<Reason extends string, CustomProperties extends object> = {
|
|
83
|
-
/**
|
|
84
|
-
* The reason for the event.
|
|
85
|
-
*/
|
|
86
|
-
reason: Reason;
|
|
87
|
-
/**
|
|
88
|
-
* The native event associated with the custom event.
|
|
89
|
-
*/
|
|
90
|
-
event: ReasonToEvent<Reason>;
|
|
91
|
-
/**
|
|
92
|
-
* Cancels Base UI from handling the event.
|
|
93
|
-
*/
|
|
94
|
-
cancel: () => void;
|
|
95
|
-
/**
|
|
96
|
-
* Allows the event to propagate in cases where Base UI will stop the propagation.
|
|
97
|
-
*/
|
|
98
|
-
allowPropagation: () => void;
|
|
99
|
-
/**
|
|
100
|
-
* Indicates whether the event has been canceled.
|
|
101
|
-
*/
|
|
102
|
-
isCanceled: boolean;
|
|
103
|
-
/**
|
|
104
|
-
* Indicates whether the event is allowed to propagate.
|
|
105
|
-
*/
|
|
106
|
-
isPropagationAllowed: boolean;
|
|
107
|
-
/**
|
|
108
|
-
* The element that triggered the event, if applicable.
|
|
109
|
-
*/
|
|
110
|
-
trigger: Element | undefined;
|
|
111
|
-
} & CustomProperties;
|
|
112
|
-
/**
|
|
113
|
-
* Details of custom change events emitted by Base UI components.
|
|
114
|
-
*/
|
|
115
|
-
export type BaseUIChangeEventDetails<Reason extends string, CustomProperties extends object = {}> = Reason extends string ? BaseUIChangeEventDetail<Reason, CustomProperties> & {} : never;
|
|
116
|
-
export declare type AlignedPlacement = `${Side}-${Alignment}`;
|
|
117
|
-
export declare type Alignment = "start" | "end";
|
|
118
|
-
export declare type Axis = "x" | "y";
|
|
119
|
-
export declare type ClientRectObject = Prettify<Rect & SideObject>;
|
|
120
|
-
export declare type Coords = {
|
|
121
|
-
[key in Axis]: number;
|
|
122
|
-
};
|
|
123
|
-
export declare type Dimensions = {
|
|
124
|
-
[key in Length]: number;
|
|
125
|
-
};
|
|
126
|
-
export declare type Length = "width" | "height";
|
|
127
|
-
export declare type Padding = number | Prettify<Partial<SideObject>>;
|
|
128
|
-
export declare type Placement = Prettify<Side | AlignedPlacement>;
|
|
129
|
-
export declare type Prettify<T> = {
|
|
130
|
-
[K in keyof T]: T[K];
|
|
131
|
-
} & {};
|
|
132
|
-
export declare type Rect = Prettify<Coords & Dimensions>;
|
|
133
|
-
export declare type Side = "top" | "right" | "bottom" | "left";
|
|
134
|
-
export declare type SideObject = {
|
|
135
|
-
[key in Side]: number;
|
|
136
|
-
};
|
|
137
|
-
export declare type Strategy = "absolute" | "fixed";
|
|
138
|
-
export declare interface ComputePositionReturn extends Coords {
|
|
139
|
-
/**
|
|
140
|
-
* The final chosen placement of the floating element.
|
|
141
|
-
*/
|
|
142
|
-
placement: Placement;
|
|
143
|
-
/**
|
|
144
|
-
* The strategy used to position the floating element.
|
|
145
|
-
*/
|
|
146
|
-
strategy: Strategy;
|
|
147
|
-
/**
|
|
148
|
-
* Object containing data returned from all middleware, keyed by their name.
|
|
149
|
-
*/
|
|
150
|
-
middlewareData: MiddlewareData;
|
|
151
|
-
}
|
|
152
|
-
export declare interface MiddlewareData {
|
|
153
|
-
[key: string]: any;
|
|
154
|
-
arrow?: Partial<Coords> & {
|
|
155
|
-
centerOffset: number;
|
|
156
|
-
alignmentOffset?: number;
|
|
157
|
-
};
|
|
158
|
-
autoPlacement?: {
|
|
159
|
-
index?: number;
|
|
160
|
-
overflows: Array<{
|
|
161
|
-
placement: Placement;
|
|
162
|
-
overflows: Array<number>;
|
|
163
|
-
}>;
|
|
164
|
-
};
|
|
165
|
-
flip?: {
|
|
166
|
-
index?: number;
|
|
167
|
-
overflows: Array<{
|
|
168
|
-
placement: Placement;
|
|
169
|
-
overflows: Array<number>;
|
|
170
|
-
}>;
|
|
171
|
-
};
|
|
172
|
-
hide?: {
|
|
173
|
-
referenceHidden?: boolean;
|
|
174
|
-
escaped?: boolean;
|
|
175
|
-
referenceHiddenOffsets?: SideObject;
|
|
176
|
-
escapedOffsets?: SideObject;
|
|
177
|
-
};
|
|
178
|
-
offset?: Coords & {
|
|
179
|
-
placement: Placement;
|
|
180
|
-
};
|
|
181
|
-
shift?: Coords & {
|
|
182
|
-
enabled: {
|
|
183
|
-
[key in Axis]: boolean;
|
|
184
|
-
};
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Custom positioning reference element.
|
|
189
|
-
* @see https://floating-ui.com/docs/virtual-elements
|
|
190
|
-
*/
|
|
191
|
-
export declare interface VirtualElement {
|
|
192
|
-
getBoundingClientRect(): ClientRectObject;
|
|
193
|
-
getClientRects?(): Array<ClientRectObject> | DOMRectList;
|
|
194
|
-
contextElement?: Element;
|
|
195
|
-
}
|
|
196
|
-
declare type Prettify$1<T> = {
|
|
197
|
-
[K in keyof T]: T[K];
|
|
198
|
-
} & {};
|
|
199
|
-
export declare type ReferenceType = Element | VirtualElement;
|
|
200
|
-
export declare type UseFloatingData = Prettify$1<ComputePositionReturn & {
|
|
201
|
-
isPositioned: boolean;
|
|
202
|
-
}>;
|
|
203
|
-
export declare type UseFloatingReturn<RT extends ReferenceType = ReferenceType> = Prettify$1<UseFloatingData & {
|
|
204
|
-
/**
|
|
205
|
-
* Update the position of the floating element, re-rendering the component
|
|
206
|
-
* if required.
|
|
207
|
-
*/
|
|
208
|
-
update: () => void;
|
|
209
|
-
/**
|
|
210
|
-
* Pre-configured positioning styles to apply to the floating element.
|
|
211
|
-
*/
|
|
212
|
-
floatingStyles: React$1.CSSProperties;
|
|
213
|
-
/**
|
|
214
|
-
* Object containing the reference and floating refs and reactive setters.
|
|
215
|
-
*/
|
|
216
|
-
refs: {
|
|
217
|
-
/**
|
|
218
|
-
* A React ref to the reference element.
|
|
219
|
-
*/
|
|
220
|
-
reference: React$1.MutableRefObject<RT | null>;
|
|
221
|
-
/**
|
|
222
|
-
* A React ref to the floating element.
|
|
223
|
-
*/
|
|
224
|
-
floating: React$1.MutableRefObject<HTMLElement | null>;
|
|
225
|
-
/**
|
|
226
|
-
* A callback to set the reference element (reactive).
|
|
227
|
-
*/
|
|
228
|
-
setReference: (node: RT | null) => void;
|
|
229
|
-
/**
|
|
230
|
-
* A callback to set the floating element (reactive).
|
|
231
|
-
*/
|
|
232
|
-
setFloating: (node: HTMLElement | null) => void;
|
|
233
|
-
};
|
|
234
|
-
/**
|
|
235
|
-
* Object containing the reference and floating elements.
|
|
236
|
-
*/
|
|
237
|
-
elements: {
|
|
238
|
-
reference: RT | null;
|
|
239
|
-
floating: HTMLElement | null;
|
|
240
|
-
};
|
|
241
|
-
}>;
|
|
242
|
-
export type Listener<T> = (state: T) => void;
|
|
243
|
-
declare class Store<State> {
|
|
244
|
-
/**
|
|
245
|
-
* The current state of the store.
|
|
246
|
-
* This property is updated immediately when the state changes as a result of calling {@link setState}, {@link update}, or {@link set}.
|
|
247
|
-
* 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).
|
|
248
|
-
* The values can be used directly (to avoid subscribing to the store) in effects or event handlers.
|
|
249
|
-
*
|
|
250
|
-
* Do not modify properties in state directly. Instead, use the provided methods to ensure proper state management and listener notification.
|
|
251
|
-
*/
|
|
252
|
-
state: State;
|
|
253
|
-
private listeners;
|
|
254
|
-
private updateTick;
|
|
255
|
-
constructor(state: State);
|
|
256
|
-
/**
|
|
257
|
-
* Registers a listener that will be called whenever the store's state changes.
|
|
258
|
-
*
|
|
259
|
-
* @param fn The listener function to be called on state changes.
|
|
260
|
-
* @returns A function to unsubscribe the listener.
|
|
261
|
-
*/
|
|
262
|
-
subscribe: (fn: Listener<State>) => () => void;
|
|
263
|
-
/**
|
|
264
|
-
* Returns the current state of the store.
|
|
265
|
-
*/
|
|
266
|
-
getSnapshot: () => State;
|
|
267
|
-
/**
|
|
268
|
-
* Updates the entire store's state and notifies all registered listeners.
|
|
269
|
-
*
|
|
270
|
-
* @param newState The new state to set for the store.
|
|
271
|
-
*/
|
|
272
|
-
setState(newState: State): void;
|
|
273
|
-
/**
|
|
274
|
-
* Merges the provided changes into the current state and notifies listeners if there are changes.
|
|
275
|
-
*
|
|
276
|
-
* @param changes An object containing the changes to apply to the current state.
|
|
277
|
-
*/
|
|
278
|
-
update(changes: Partial<State>): void;
|
|
279
|
-
/**
|
|
280
|
-
* Sets a specific key in the store's state to a new value and notifies listeners if the value has changed.
|
|
281
|
-
*
|
|
282
|
-
* @param key The key in the store's state to update.
|
|
283
|
-
* @param value The new value to set for the specified key.
|
|
284
|
-
*/
|
|
285
|
-
set<T>(key: keyof State, value: T): void;
|
|
286
|
-
/**
|
|
287
|
-
* Gives the state a new reference and updates all registered listeners.
|
|
288
|
-
*/
|
|
289
|
-
notifyAll(): void;
|
|
290
|
-
use<F extends (...args: any) => any>(selector: F, ...args: SelectorArgs<F>): ReturnType<F>;
|
|
291
|
-
}
|
|
292
|
-
export type SelectorArgs<Selector> = Selector extends ((...params: infer Params) => any) ? Tail<Params> : never;
|
|
293
|
-
export type Tail<T extends readonly any[]> = T extends readonly [
|
|
294
|
-
any,
|
|
295
|
-
...infer Rest
|
|
296
|
-
] ? Rest : [
|
|
297
|
-
];
|
|
298
|
-
declare class ReactStore<State extends object, Context = Record<string, never>, Selectors extends Record<string, SelectorFunction<State>> = Record<string, never>> extends Store<State> {
|
|
299
|
-
/**
|
|
300
|
-
* Creates a new ReactStore instance.
|
|
301
|
-
*
|
|
302
|
-
* @param state Initial state of the store.
|
|
303
|
-
* @param context Non-reactive context values.
|
|
304
|
-
* @param selectors Optional selectors for use with `useState`.
|
|
305
|
-
*/
|
|
306
|
-
constructor(state: State, context?: Context, selectors?: Selectors);
|
|
307
|
-
/**
|
|
308
|
-
* Non-reactive values such as refs, callbacks, etc.
|
|
309
|
-
*/
|
|
310
|
-
readonly context: Context;
|
|
311
|
-
private selectors;
|
|
312
|
-
/**
|
|
313
|
-
* Synchronizes a single external value into the store.
|
|
314
|
-
*
|
|
315
|
-
* Note that the while the value in `state` is updated immediately, the value returned
|
|
316
|
-
* by `useState` is updated before the next render (similarly to React's `useState`).
|
|
317
|
-
*/
|
|
318
|
-
useSyncedValue<Key extends keyof State, Value extends State[Key]>(key: keyof State, value: Value): void;
|
|
319
|
-
/**
|
|
320
|
-
* Synchronizes a single external value into the store and
|
|
321
|
-
* cleans it up (sets to `undefined`) on unmount.
|
|
322
|
-
*
|
|
323
|
-
* Note that the while the value in `state` is updated immediately, the value returned
|
|
324
|
-
* by `useState` is updated before the next render (similarly to React's `useState`).
|
|
325
|
-
*/
|
|
326
|
-
useSyncedValueWithCleanup<Key extends KeysAllowingUndefined<State>>(key: Key, value: State[Key]): void;
|
|
327
|
-
/**
|
|
328
|
-
* Synchronizes multiple external values into the store.
|
|
329
|
-
*
|
|
330
|
-
* Note that the while the values in `state` are updated immediately, the values returned
|
|
331
|
-
* by `useState` are updated before the next render (similarly to React's `useState`).
|
|
332
|
-
*/
|
|
333
|
-
useSyncedValues(statePart: Partial<State>): void;
|
|
334
|
-
/**
|
|
335
|
-
* Registers a controllable prop pair (`controlled`, `defaultValue`) for a specific key. If `controlled`
|
|
336
|
-
* is non-undefined, the store's state at `key` is updated to match `controlled`.
|
|
337
|
-
*/
|
|
338
|
-
useControlledProp<Key extends keyof State, Value extends State[Key]>(key: keyof State, controlled: Value | undefined): void;
|
|
339
|
-
/** Gets the current value from the store using a selector with the provided key.
|
|
340
|
-
*
|
|
341
|
-
* @param key Key of the selector to use.
|
|
342
|
-
*/
|
|
343
|
-
select<Key extends keyof Selectors>(key: Key, ...args: SelectorArgs$1<Selectors[Key]>): ReturnType<Selectors[Key]>;
|
|
344
|
-
/**
|
|
345
|
-
* Returns a value from the store's state using a selector function.
|
|
346
|
-
* Used to subscribe to specific parts of the state.
|
|
347
|
-
* This methods causes a rerender whenever the selected state changes.
|
|
348
|
-
*
|
|
349
|
-
* @param key Key of the selector to use.
|
|
350
|
-
*/
|
|
351
|
-
useState<Key extends keyof Selectors>(key: Key, ...args: SelectorArgs$1<Selectors[Key]>): ReturnType<Selectors[Key]>;
|
|
352
|
-
/**
|
|
353
|
-
* Wraps a function with `useStableCallback` to ensure it has a stable reference
|
|
354
|
-
* and assigns it to the context.
|
|
355
|
-
*
|
|
356
|
-
* @param key Key of the event callback. Must be a function in the context.
|
|
357
|
-
* @param fn Function to assign.
|
|
358
|
-
*/
|
|
359
|
-
useContextCallback<Key extends ContextFunctionKeys<Context>>(key: Key, fn: ContextFunction<Context, Key> | undefined): void;
|
|
360
|
-
/**
|
|
361
|
-
* Returns a stable setter function for a specific key in the store's state.
|
|
362
|
-
* It's commonly used to pass as a ref callback to React elements.
|
|
363
|
-
*
|
|
364
|
-
* @param key Key of the state to set.
|
|
365
|
-
*/
|
|
366
|
-
useStateSetter<const Key extends keyof State, Value extends State[Key]>(key: keyof State): (v: Value) => void;
|
|
367
|
-
/**
|
|
368
|
-
* Observes changes derived from the store's selectors and calls the listener when the selected value changes.
|
|
369
|
-
*
|
|
370
|
-
* @param key Key of the selector to observe.
|
|
371
|
-
* @param listener Listener function called when the selector result changes.
|
|
372
|
-
*/
|
|
373
|
-
observe<Key extends keyof Selectors>(selector: Key, listener: (newValue: ReturnType<Selectors[Key]>, oldValue: ReturnType<Selectors[Key]>, store: this) => void): () => void;
|
|
374
|
-
observe<Selector extends ObserveSelector<State>>(selector: Selector, listener: (newValue: ReturnType<Selector>, oldValue: ReturnType<Selector>, store: this) => void): () => void;
|
|
375
|
-
}
|
|
376
|
-
export type MaybeCallable = (...args: any[]) => any;
|
|
377
|
-
export type ContextFunctionKeys<Context> = {
|
|
378
|
-
[Key in keyof Context]-?: Extract<Context[Key], MaybeCallable> extends never ? never : Key;
|
|
379
|
-
}[keyof Context];
|
|
380
|
-
export type ContextFunction<Context, Key extends keyof Context> = Extract<Context[Key], MaybeCallable>;
|
|
381
|
-
export type KeysAllowingUndefined<State> = {
|
|
382
|
-
[Key in keyof State]-?: undefined extends State[Key] ? Key : never;
|
|
383
|
-
}[keyof State];
|
|
384
|
-
export type ObserveSelector<State> = (state: State) => any;
|
|
385
|
-
export type SelectorFunction<State> = (state: State, ...args: any[]) => any;
|
|
386
|
-
type Tail$1<T extends readonly any[]> = T extends readonly [
|
|
387
|
-
any,
|
|
388
|
-
...infer Rest
|
|
389
|
-
] ? Rest : [
|
|
390
|
-
];
|
|
391
|
-
type SelectorArgs$1<Selector> = Selector extends ((...params: infer Params) => any) ? Tail$1<Params> : never;
|
|
392
|
-
export type TransitionStatus = "starting" | "ending" | "idle" | undefined;
|
|
393
|
-
export interface FloatingRootState {
|
|
394
|
-
open: boolean;
|
|
395
|
-
transitionStatus: TransitionStatus | undefined;
|
|
396
|
-
domReferenceElement: Element | null;
|
|
397
|
-
referenceElement: ReferenceType$1 | null;
|
|
398
|
-
floatingElement: HTMLElement | null;
|
|
399
|
-
positionReference: ReferenceType$1 | null;
|
|
400
|
-
/**
|
|
401
|
-
* The ID of the floating element.
|
|
402
|
-
*/
|
|
403
|
-
floatingId: string | undefined;
|
|
404
|
-
}
|
|
405
|
-
export interface FloatingRootStoreContext {
|
|
406
|
-
onOpenChange: ((open: boolean, eventDetails: BaseUIChangeEventDetails<string>) => void) | undefined;
|
|
407
|
-
readonly dataRef: React$1.RefObject<ContextData>;
|
|
408
|
-
readonly events: FloatingEvents;
|
|
409
|
-
nested: boolean;
|
|
410
|
-
readonly triggerElements: PopupTriggerMap;
|
|
411
|
-
}
|
|
412
|
-
declare const selectors: {
|
|
413
|
-
open: (state: FloatingRootState) => boolean;
|
|
414
|
-
transitionStatus: (state: FloatingRootState) => TransitionStatus;
|
|
415
|
-
domReferenceElement: (state: FloatingRootState) => Element | null;
|
|
416
|
-
referenceElement: (state: FloatingRootState) => ReferenceType$1 | null;
|
|
417
|
-
floatingElement: (state: FloatingRootState) => HTMLElement | null;
|
|
418
|
-
floatingId: (state: FloatingRootState) => string | undefined;
|
|
419
|
-
};
|
|
420
|
-
export interface FloatingRootStoreOptions {
|
|
421
|
-
open: boolean;
|
|
422
|
-
transitionStatus: TransitionStatus | undefined;
|
|
423
|
-
referenceElement: ReferenceType$1 | null;
|
|
424
|
-
floatingElement: HTMLElement | null;
|
|
425
|
-
triggerElements: PopupTriggerMap;
|
|
426
|
-
floatingId: string | undefined;
|
|
427
|
-
/**
|
|
428
|
-
* When true, `setOpen` only forwards to `onOpenChange`.
|
|
429
|
-
* The popup store owns `dispatchOpenChange(...)` in this mode.
|
|
430
|
-
*/
|
|
431
|
-
syncOnly: boolean;
|
|
432
|
-
nested: boolean;
|
|
433
|
-
onOpenChange: ((open: boolean, eventDetails: BaseUIChangeEventDetails<string>) => void) | undefined;
|
|
434
|
-
}
|
|
435
|
-
declare class FloatingRootStore extends ReactStore<Readonly<FloatingRootState>, FloatingRootStoreContext, typeof selectors> {
|
|
436
|
-
private readonly syncOnly;
|
|
437
|
-
constructor(options: FloatingRootStoreOptions);
|
|
438
|
-
/**
|
|
439
|
-
* Syncs the event used by hover logic to distinguish hover-open from click-like interaction.
|
|
440
|
-
*/
|
|
441
|
-
syncOpenEvent: (newOpen: boolean, event: Event | undefined) => void;
|
|
442
|
-
/**
|
|
443
|
-
* Runs the root-owned side effects for an open state change.
|
|
444
|
-
*/
|
|
445
|
-
dispatchOpenChange: (newOpen: boolean, eventDetails: BaseUIChangeEventDetails<string>) => void;
|
|
446
|
-
/**
|
|
447
|
-
* Emits the `openchange` event through the internal event emitter and calls the `onOpenChange` handler with the provided arguments.
|
|
448
|
-
*
|
|
449
|
-
* @param newOpen The new open state.
|
|
450
|
-
* @param eventDetails Details about the event that triggered the open state change.
|
|
451
|
-
*/
|
|
452
|
-
setOpen: (newOpen: boolean, eventDetails: BaseUIChangeEventDetails<string>) => void;
|
|
453
|
-
}
|
|
454
|
-
export type HTMLProps<T = any> = React$1.HTMLAttributes<T> & {
|
|
455
|
-
ref?: React$1.Ref<T> | undefined;
|
|
456
|
-
};
|
|
457
|
-
/**
|
|
458
|
-
* 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.
|
|
459
|
-
*
|
|
460
|
-
* @template Props Props to be spread on the rendered element.
|
|
461
|
-
* @template State Component's internal state.
|
|
462
|
-
*/
|
|
463
|
-
export type ComponentRenderFn<Props, State> = (props: Props, state: State) => React$1.ReactElement<unknown>;
|
|
464
|
-
export type BaseUIEvent<E extends React$1.SyntheticEvent<Element, Event>> = E & {
|
|
465
|
-
preventBaseUIHandler: () => void;
|
|
466
|
-
readonly baseUIHandlerPrevented?: boolean | undefined;
|
|
467
|
-
};
|
|
468
|
-
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;
|
|
469
|
-
/**
|
|
470
|
-
* Adds a `preventBaseUIHandler` method to all event handlers.
|
|
471
|
-
*/
|
|
472
|
-
export type WithBaseUIEvent<T> = {
|
|
473
|
-
[K in keyof T]: WithPreventBaseUIHandler<T[K]>;
|
|
474
|
-
};
|
|
475
|
-
/**
|
|
476
|
-
* Props shared by all Base UI components.
|
|
477
|
-
* Contains `className` (string or callback taking the component's state as an argument) and `render` (function to customize rendering).
|
|
478
|
-
*/
|
|
479
|
-
export type BaseUIComponentProps<ElementType extends React$1.ElementType, State, RenderFunctionProps = HTMLProps> = Omit<WithBaseUIEvent<React$1.ComponentPropsWithRef<ElementType>>, "className" | "color" | "defaultValue" | "defaultChecked" | "style"> & {
|
|
480
|
-
/**
|
|
481
|
-
* CSS class applied to the element, or a function that
|
|
482
|
-
* returns a class based on the component's state.
|
|
483
|
-
*/
|
|
484
|
-
className?: string | ((state: State) => string | undefined) | undefined;
|
|
485
|
-
/**
|
|
486
|
-
* Allows you to replace the component's HTML element
|
|
487
|
-
* with a different tag, or compose it with another component.
|
|
488
|
-
*
|
|
489
|
-
* Accepts a `ReactElement` or a function that returns the element to render.
|
|
490
|
-
*/
|
|
491
|
-
render?: React$1.ReactElement | ComponentRenderFn<RenderFunctionProps, State> | undefined;
|
|
492
|
-
/**
|
|
493
|
-
* Style applied to the element, or a function that
|
|
494
|
-
* returns a style object based on the component's state.
|
|
495
|
-
*/
|
|
496
|
-
style?: React$1.CSSProperties | ((state: State) => React$1.CSSProperties | undefined) | undefined;
|
|
497
|
-
};
|
|
498
|
-
export interface UseRenderElementComponentProps<State> {
|
|
499
|
-
/**
|
|
500
|
-
* The class name to apply to the rendered element.
|
|
501
|
-
* Can be a string or a function that accepts the state and returns a string.
|
|
502
|
-
*/
|
|
503
|
-
className?: string | ((state: State) => string | undefined) | undefined;
|
|
504
|
-
/**
|
|
505
|
-
* The render prop or React element to override the default element.
|
|
506
|
-
*/
|
|
507
|
-
render?: undefined | React$1.ReactElement | ComponentRenderFn<React$1.HTMLAttributes<any>, State>;
|
|
508
|
-
/**
|
|
509
|
-
* The style to apply to the rendered element.
|
|
510
|
-
* Can be a style object or a function that accepts the state and returns a style object.
|
|
511
|
-
*/
|
|
512
|
-
style?: React$1.CSSProperties | ((state: State) => React$1.CSSProperties | undefined) | undefined;
|
|
513
|
-
}
|
|
514
|
-
export interface UseFloatingPortalNodeProps {
|
|
515
|
-
ref?: React$1.Ref<HTMLDivElement> | undefined;
|
|
516
|
-
container?: HTMLElement | ShadowRoot | null | React$1.RefObject<HTMLElement | ShadowRoot | null> | undefined;
|
|
517
|
-
componentProps?: UseRenderElementComponentProps<any> | undefined;
|
|
518
|
-
elementProps?: React$1.HTMLAttributes<HTMLDivElement> | undefined;
|
|
519
|
-
}
|
|
520
|
-
declare const FloatingPortal: React$1.ForwardRefExoticComponent<Omit<FloatingPortal.Props<any> & {
|
|
521
|
-
renderGuards?: boolean | undefined;
|
|
522
|
-
}, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
523
|
-
export interface FloatingPortalState {
|
|
524
|
-
}
|
|
525
|
-
declare namespace FloatingPortal {
|
|
526
|
-
type State = FloatingPortalState;
|
|
527
|
-
interface Props<TState> extends BaseUIComponentProps<"div", TState> {
|
|
528
|
-
/**
|
|
529
|
-
* A parent element to render the portal element into.
|
|
530
|
-
*/
|
|
531
|
-
container?: UseFloatingPortalNodeProps["container"] | undefined;
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
export type NarrowedElement<T> = T extends Element ? T : Element;
|
|
535
|
-
export interface ExtendedRefs {
|
|
536
|
-
reference: React$1.RefObject<ReferenceType$1 | null>;
|
|
537
|
-
floating: React$1.RefObject<HTMLElement | null>;
|
|
538
|
-
domReference: React$1.RefObject<NarrowedElement<ReferenceType$1> | null>;
|
|
539
|
-
setReference(node: ReferenceType$1 | null): void;
|
|
540
|
-
setFloating(node: HTMLElement | null): void;
|
|
541
|
-
setPositionReference(node: ReferenceType$1 | null): void;
|
|
542
|
-
}
|
|
543
|
-
export interface ExtendedElements {
|
|
544
|
-
reference: ReferenceType$1 | null;
|
|
545
|
-
floating: HTMLElement | null;
|
|
546
|
-
domReference: NarrowedElement<ReferenceType$1> | null;
|
|
547
|
-
}
|
|
548
|
-
export interface FloatingEvents {
|
|
549
|
-
emit<T extends string>(event: T, data?: any): void;
|
|
550
|
-
on(event: string, handler: (data: any) => void): void;
|
|
551
|
-
off(event: string, handler: (data: any) => void): void;
|
|
552
|
-
}
|
|
553
|
-
export interface ContextData {
|
|
554
|
-
openEvent?: Event | undefined;
|
|
555
|
-
floatingContext?: FloatingContext | undefined;
|
|
556
|
-
[key: string]: any;
|
|
557
|
-
}
|
|
558
|
-
export type FloatingRootContext = FloatingRootStore;
|
|
559
|
-
export type FloatingContext = Omit<UseFloatingReturn<ReferenceType$1>, "refs" | "elements"> & {
|
|
560
|
-
open: boolean;
|
|
561
|
-
onOpenChange(open: boolean, eventDetails: BaseUIChangeEventDetails<string>): void;
|
|
562
|
-
events: FloatingEvents;
|
|
563
|
-
dataRef: React$1.RefObject<ContextData>;
|
|
564
|
-
nodeId: string | undefined;
|
|
565
|
-
floatingId: string | undefined;
|
|
566
|
-
refs: ExtendedRefs;
|
|
567
|
-
elements: ExtendedElements;
|
|
568
|
-
rootStore: FloatingRootContext;
|
|
569
|
-
};
|
|
570
|
-
type ReferenceType$1 = Element | VirtualElement;
|
|
571
|
-
declare class PopupTriggerMap {
|
|
572
|
-
private elementsSet;
|
|
573
|
-
private idMap;
|
|
574
|
-
constructor();
|
|
575
|
-
/**
|
|
576
|
-
* Adds a trigger element with the given ID.
|
|
577
|
-
*
|
|
578
|
-
* Note: The provided element is assumed to not be registered under multiple IDs.
|
|
579
|
-
*/
|
|
580
|
-
add(id: string, element: Element): void;
|
|
581
|
-
/**
|
|
582
|
-
* Removes the trigger element with the given ID.
|
|
583
|
-
*/
|
|
584
|
-
delete(id: string): void;
|
|
585
|
-
/**
|
|
586
|
-
* Whether the given element is registered as a trigger.
|
|
587
|
-
*/
|
|
588
|
-
hasElement(element: Element): boolean;
|
|
589
|
-
/**
|
|
590
|
-
* Whether there is a registered trigger element matching the given predicate.
|
|
591
|
-
*/
|
|
592
|
-
hasMatchingElement(predicate: (el: Element) => boolean): boolean;
|
|
593
|
-
/**
|
|
594
|
-
* Returns the trigger element associated with the given ID, or undefined if no such element exists.
|
|
595
|
-
*/
|
|
596
|
-
getById(id: string): Element | undefined;
|
|
597
|
-
/**
|
|
598
|
-
* Returns an iterable of all registered trigger entries, where each entry is a tuple of [id, element].
|
|
599
|
-
*/
|
|
600
|
-
entries(): IterableIterator<[
|
|
601
|
-
string,
|
|
602
|
-
Element
|
|
603
|
-
]>;
|
|
604
|
-
/**
|
|
605
|
-
* Returns an iterable of all registered trigger elements.
|
|
606
|
-
*/
|
|
607
|
-
elements(): IterableIterator<Element>;
|
|
608
|
-
/**
|
|
609
|
-
* Returns the number of registered trigger elements.
|
|
610
|
-
*/
|
|
611
|
-
get size(): number;
|
|
612
|
-
}
|
|
613
|
-
/**
|
|
614
|
-
* State common to all popup stores.
|
|
615
|
-
*/
|
|
616
|
-
export type PopupStoreState<Payload> = {
|
|
617
|
-
/**
|
|
618
|
-
* Whether the popup is open (internal state).
|
|
619
|
-
*/
|
|
620
|
-
open: boolean;
|
|
621
|
-
/**
|
|
622
|
-
* Whether the popup is open (external prop).
|
|
623
|
-
*/
|
|
624
|
-
readonly openProp: boolean | undefined;
|
|
625
|
-
/**
|
|
626
|
-
* Whether the popup should be mounted in the DOM.
|
|
627
|
-
* This usually follows `open` but can be different during exit transitions.
|
|
628
|
-
*/
|
|
629
|
-
mounted: boolean;
|
|
630
|
-
/**
|
|
631
|
-
* The current enter/exit transition status of the popup.
|
|
632
|
-
*/
|
|
633
|
-
transitionStatus: TransitionStatus;
|
|
634
|
-
floatingRootContext: FloatingRootContext;
|
|
635
|
-
floatingId: string | undefined;
|
|
636
|
-
/**
|
|
637
|
-
* Number of trigger elements currently registered for this popup.
|
|
638
|
-
*/
|
|
639
|
-
triggerCount: number;
|
|
640
|
-
/**
|
|
641
|
-
* Whether to prevent unmounting the popup when closed.
|
|
642
|
-
* Useful for interacting with JS animation libraries that control unmounting themselves.
|
|
643
|
-
*/
|
|
644
|
-
preventUnmountingOnClose: boolean;
|
|
645
|
-
/**
|
|
646
|
-
* Optional payload set by the trigger.
|
|
647
|
-
*/
|
|
648
|
-
payload: Payload | undefined;
|
|
649
|
-
/**
|
|
650
|
-
* ID of the currently active trigger.
|
|
651
|
-
*/
|
|
652
|
-
activeTriggerId: string | null;
|
|
653
|
-
/**
|
|
654
|
-
* The currently active trigger DOM element.
|
|
655
|
-
*/
|
|
656
|
-
activeTriggerElement: Element | null;
|
|
657
|
-
/**
|
|
658
|
-
* ID of the trigger (external prop).
|
|
659
|
-
*/
|
|
660
|
-
readonly triggerIdProp: string | null | undefined;
|
|
661
|
-
/**
|
|
662
|
-
* The popup DOM element.
|
|
663
|
-
*/
|
|
664
|
-
popupElement: HTMLElement | null;
|
|
665
|
-
/**
|
|
666
|
-
* The positioner DOM element.
|
|
667
|
-
*/
|
|
668
|
-
positionerElement: HTMLElement | null;
|
|
669
|
-
/**
|
|
670
|
-
* Props to spread onto the active trigger element.
|
|
671
|
-
*/
|
|
672
|
-
activeTriggerProps: HTMLProps;
|
|
673
|
-
/**
|
|
674
|
-
* Props to spread onto inactive trigger elements.
|
|
675
|
-
*/
|
|
676
|
-
inactiveTriggerProps: HTMLProps;
|
|
677
|
-
/**
|
|
678
|
-
* Props to spread onto the popup element.
|
|
679
|
-
*/
|
|
680
|
-
popupProps: HTMLProps;
|
|
681
|
-
};
|
|
682
|
-
export type PopupStoreContext<ChangeEventDetails> = {
|
|
683
|
-
/**
|
|
684
|
-
* Map of registered trigger elements.
|
|
685
|
-
*/
|
|
686
|
-
readonly triggerElements: PopupTriggerMap;
|
|
687
|
-
/**
|
|
688
|
-
* Reference to the popup element.
|
|
689
|
-
*/
|
|
690
|
-
readonly popupRef: React$1.RefObject<HTMLElement | null>;
|
|
691
|
-
/**
|
|
692
|
-
* Callback fired when the open state changes.
|
|
693
|
-
*/
|
|
694
|
-
onOpenChange?: ((open: boolean, eventDetails: ChangeEventDetails) => void) | undefined;
|
|
695
|
-
/**
|
|
696
|
-
* Callback fired when the open state change animation completes.
|
|
697
|
-
*/
|
|
698
|
-
onOpenChangeComplete: ((open: boolean) => void) | undefined;
|
|
699
|
-
};
|
|
700
|
-
export type PayloadChildRenderFunction<Payload> = (arg: {
|
|
701
|
-
payload: Payload | undefined;
|
|
702
|
-
}) => React$1.ReactNode;
|
|
703
|
-
type Side$1 = "top" | "bottom" | "left" | "right" | "inline-end" | "inline-start";
|
|
704
|
-
export type Align = "start" | "center" | "end";
|
|
705
|
-
export type Boundary = "clipping-ancestors" | Element | Element[] | Rect;
|
|
706
|
-
export type OffsetFunction = (data: {
|
|
707
|
-
side: Side$1;
|
|
708
|
-
align: Align;
|
|
709
|
-
anchor: {
|
|
710
|
-
width: number;
|
|
711
|
-
height: number;
|
|
712
|
-
};
|
|
713
|
-
positioner: {
|
|
714
|
-
width: number;
|
|
715
|
-
height: number;
|
|
716
|
-
};
|
|
717
|
-
}) => number;
|
|
718
|
-
export interface SideFlipMode {
|
|
719
|
-
/**
|
|
720
|
-
* How to avoid collisions on the side axis.
|
|
721
|
-
* - `'flip'`: If there is not enough space, place the popup on the opposite side.
|
|
722
|
-
* - `'none'`: Keep the preferred side even if it overflows.
|
|
723
|
-
*/
|
|
724
|
-
side?: "flip" | "none" | undefined;
|
|
725
|
-
/**
|
|
726
|
-
* How to avoid collisions on the align axis.
|
|
727
|
-
* - `'flip'`: If there is not enough space, swap `'start'` and `'end'` alignment.
|
|
728
|
-
* - `'shift'`: Keep the alignment and shift the popup to fit within the boundary.
|
|
729
|
-
* - `'none'`: Keep the preferred alignment even if it overflows.
|
|
730
|
-
*/
|
|
731
|
-
align?: "flip" | "shift" | "none" | undefined;
|
|
732
|
-
/**
|
|
733
|
-
* If both sides on the preferred axis do not fit, determines whether to fallback
|
|
734
|
-
* to a side on the perpendicular axis and which logical side to prefer.
|
|
735
|
-
* - `'start'`: Prefer the logical start side on the perpendicular axis.
|
|
736
|
-
* - `'end'`: Prefer the logical end side on the perpendicular axis.
|
|
737
|
-
* - `'none'`: Do not fallback to the perpendicular axis.
|
|
738
|
-
*/
|
|
739
|
-
fallbackAxisSide?: "start" | "end" | "none" | undefined;
|
|
740
|
-
}
|
|
741
|
-
export interface SideShiftMode {
|
|
742
|
-
/**
|
|
743
|
-
* How to avoid collisions on the side axis.
|
|
744
|
-
* - `'shift'`: Keep the preferred side and shift the popup to fit within the boundary.
|
|
745
|
-
* - `'none'`: Keep the preferred side even if it overflows.
|
|
746
|
-
*/
|
|
747
|
-
side?: "shift" | "none" | undefined;
|
|
748
|
-
/**
|
|
749
|
-
* How to avoid collisions on the align axis.
|
|
750
|
-
* - `'shift'`: Keep the alignment and shift the popup to fit within the boundary.
|
|
751
|
-
* - `'none'`: Keep the preferred alignment even if it overflows.
|
|
752
|
-
*/
|
|
753
|
-
align?: "shift" | "none" | undefined;
|
|
754
|
-
/**
|
|
755
|
-
* If both sides on the preferred axis do not fit, determines whether to fallback
|
|
756
|
-
* to a side on the perpendicular axis and which logical side to prefer.
|
|
757
|
-
* - `'start'`: Prefer the logical start side on the perpendicular axis.
|
|
758
|
-
* - `'end'`: Prefer the logical end side on the perpendicular axis.
|
|
759
|
-
* - `'none'`: Do not fallback to the perpendicular axis.
|
|
760
|
-
*/
|
|
761
|
-
fallbackAxisSide?: "start" | "end" | "none" | undefined;
|
|
762
|
-
}
|
|
763
|
-
export type CollisionAvoidance = SideFlipMode | SideShiftMode;
|
|
764
|
-
export interface UseAnchorPositioningSharedParameters {
|
|
765
|
-
/**
|
|
766
|
-
* An element to position the popup against.
|
|
767
|
-
* By default, the popup will be positioned against the trigger.
|
|
768
|
-
*/
|
|
769
|
-
anchor?: Element | null | VirtualElement | React$1.RefObject<Element | null> | (() => Element | VirtualElement | null) | undefined;
|
|
770
|
-
/**
|
|
771
|
-
* Determines which CSS `position` property to use.
|
|
772
|
-
* @default 'absolute'
|
|
773
|
-
*/
|
|
774
|
-
positionMethod?: "absolute" | "fixed" | undefined;
|
|
775
|
-
/**
|
|
776
|
-
* Which side of the anchor element to align the popup against.
|
|
777
|
-
* May automatically change to avoid collisions.
|
|
778
|
-
* @default 'bottom'
|
|
779
|
-
*/
|
|
780
|
-
side?: Side$1 | undefined;
|
|
781
|
-
/**
|
|
782
|
-
* Distance between the anchor and the popup in pixels.
|
|
783
|
-
* Also accepts a function that returns the distance to read the dimensions of the anchor
|
|
784
|
-
* and positioner elements, along with its side and alignment.
|
|
785
|
-
*
|
|
786
|
-
* The function takes a `data` object parameter with the following properties:
|
|
787
|
-
* - `data.anchor`: the dimensions of the anchor element with properties `width` and `height`.
|
|
788
|
-
* - `data.positioner`: the dimensions of the positioner element with properties `width` and `height`.
|
|
789
|
-
* - `data.side`: which side of the anchor element the positioner is aligned against.
|
|
790
|
-
* - `data.align`: how the positioner is aligned relative to the specified side.
|
|
791
|
-
*
|
|
792
|
-
* @example
|
|
793
|
-
* ```jsx
|
|
794
|
-
* <Positioner
|
|
795
|
-
* sideOffset={({ side, align, anchor, positioner }) => {
|
|
796
|
-
* return side === 'top' || side === 'bottom'
|
|
797
|
-
* ? anchor.height
|
|
798
|
-
* : anchor.width;
|
|
799
|
-
* }}
|
|
800
|
-
* />
|
|
801
|
-
* ```
|
|
802
|
-
*
|
|
803
|
-
* @default 0
|
|
804
|
-
*/
|
|
805
|
-
sideOffset?: number | OffsetFunction | undefined;
|
|
806
|
-
/**
|
|
807
|
-
* How to align the popup relative to the specified side.
|
|
808
|
-
* @default 'center'
|
|
809
|
-
*/
|
|
810
|
-
align?: Align | undefined;
|
|
811
|
-
/**
|
|
812
|
-
* Additional offset along the alignment axis in pixels.
|
|
813
|
-
* Also accepts a function that returns the offset to read the dimensions of the anchor
|
|
814
|
-
* and positioner elements, along with its side and alignment.
|
|
815
|
-
*
|
|
816
|
-
* The function takes a `data` object parameter with the following properties:
|
|
817
|
-
* - `data.anchor`: the dimensions of the anchor element with properties `width` and `height`.
|
|
818
|
-
* - `data.positioner`: the dimensions of the positioner element with properties `width` and `height`.
|
|
819
|
-
* - `data.side`: which side of the anchor element the positioner is aligned against.
|
|
820
|
-
* - `data.align`: how the positioner is aligned relative to the specified side.
|
|
821
|
-
*
|
|
822
|
-
* @example
|
|
823
|
-
* ```jsx
|
|
824
|
-
* <Positioner
|
|
825
|
-
* alignOffset={({ side, align, anchor, positioner }) => {
|
|
826
|
-
* return side === 'top' || side === 'bottom'
|
|
827
|
-
* ? anchor.width
|
|
828
|
-
* : anchor.height;
|
|
829
|
-
* }}
|
|
830
|
-
* />
|
|
831
|
-
* ```
|
|
832
|
-
*
|
|
833
|
-
* @default 0
|
|
834
|
-
*/
|
|
835
|
-
alignOffset?: number | OffsetFunction | undefined;
|
|
836
|
-
/**
|
|
837
|
-
* An element or a rectangle that delimits the area that the popup is confined to.
|
|
838
|
-
* @default 'clipping-ancestors'
|
|
839
|
-
*/
|
|
840
|
-
collisionBoundary?: Boundary | undefined;
|
|
841
|
-
/**
|
|
842
|
-
* Additional space to maintain from the edge of the collision boundary.
|
|
843
|
-
* @default 5
|
|
844
|
-
*/
|
|
845
|
-
collisionPadding?: Padding | undefined;
|
|
846
|
-
/**
|
|
847
|
-
* Whether to maintain the popup in the viewport after
|
|
848
|
-
* the anchor element was scrolled out of view.
|
|
849
|
-
* @default false
|
|
850
|
-
*/
|
|
851
|
-
sticky?: boolean | undefined;
|
|
852
|
-
/**
|
|
853
|
-
* Minimum distance to maintain between the arrow and the edges of the popup.
|
|
854
|
-
*
|
|
855
|
-
* Use it to prevent the arrow element from hanging out of the rounded corners of a popup.
|
|
856
|
-
* @default 5
|
|
857
|
-
*/
|
|
858
|
-
arrowPadding?: number | undefined;
|
|
859
|
-
/**
|
|
860
|
-
* Whether to disable the popup from tracking any layout shift of its positioning anchor.
|
|
861
|
-
* @default false
|
|
862
|
-
*/
|
|
863
|
-
disableAnchorTracking?: boolean | undefined;
|
|
864
|
-
/**
|
|
865
|
-
* Determines how to handle collisions when positioning the popup.
|
|
866
|
-
*
|
|
867
|
-
* `side` controls overflow on the preferred placement axis (`top`/`bottom` or `left`/`right`):
|
|
868
|
-
* - `'flip'`: keep the requested side when it fits; otherwise try the opposite side
|
|
869
|
-
* (`top` and `bottom`, or `left` and `right`).
|
|
870
|
-
* - `'shift'`: never change side; keep the requested side and move the popup within
|
|
871
|
-
* the clipping boundary so it stays visible.
|
|
872
|
-
* - `'none'`: do not correct side-axis overflow.
|
|
873
|
-
*
|
|
874
|
-
* `align` controls overflow on the alignment axis (`start`/`center`/`end`):
|
|
875
|
-
* - `'flip'`: keep side, but swap `start` and `end` when the requested alignment overflows.
|
|
876
|
-
* - `'shift'`: keep side and requested alignment, then nudge the popup along the
|
|
877
|
-
* alignment axis to fit.
|
|
878
|
-
* - `'none'`: do not correct alignment-axis overflow.
|
|
879
|
-
*
|
|
880
|
-
* `fallbackAxisSide` controls fallback behavior on the perpendicular axis when the
|
|
881
|
-
* preferred axis cannot fit:
|
|
882
|
-
* - `'start'`: allow perpendicular fallback and try the logical start side first
|
|
883
|
-
* (`top` before `bottom`, or `left` before `right` in LTR).
|
|
884
|
-
* - `'end'`: allow perpendicular fallback and try the logical end side first
|
|
885
|
-
* (`bottom` before `top`, or `right` before `left` in LTR).
|
|
886
|
-
* - `'none'`: do not fallback to the perpendicular axis.
|
|
887
|
-
*
|
|
888
|
-
* When `side` is `'shift'`, explicitly setting `align` only supports `'shift'` or `'none'`.
|
|
889
|
-
* If `align` is omitted, it defaults to `'flip'`.
|
|
890
|
-
*
|
|
891
|
-
* @example
|
|
892
|
-
* ```jsx
|
|
893
|
-
* <Positioner
|
|
894
|
-
* collisionAvoidance={{
|
|
895
|
-
* side: 'shift',
|
|
896
|
-
* align: 'shift',
|
|
897
|
-
* fallbackAxisSide: 'none',
|
|
898
|
-
* }}
|
|
899
|
-
* />
|
|
900
|
-
* ```
|
|
901
|
-
*
|
|
902
|
-
*/
|
|
903
|
-
collisionAvoidance?: CollisionAvoidance | undefined;
|
|
904
|
-
}
|
|
905
|
-
declare const FloatingPortalLite: React$1.ForwardRefExoticComponent<Omit<FloatingPortalLite.Props<any>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
906
|
-
export interface FloatingPortalLiteState {
|
|
907
|
-
}
|
|
908
|
-
export interface FloatingPortalLiteProps<TState> extends FloatingPortal.Props<TState> {
|
|
909
|
-
}
|
|
910
|
-
declare namespace FloatingPortalLite {
|
|
911
|
-
type State = FloatingPortalLiteState;
|
|
912
|
-
type Props<TState> = FloatingPortalLiteProps<TState>;
|
|
913
|
-
}
|
|
914
|
-
export type State<Payload> = PopupStoreState<Payload> & {
|
|
915
|
-
disabled: boolean;
|
|
916
|
-
instantType: "delay" | "dismiss" | "focus" | undefined;
|
|
917
|
-
isInstantPhase: boolean;
|
|
918
|
-
trackCursorAxis: "none" | "x" | "y" | "both";
|
|
919
|
-
disableHoverablePopup: boolean;
|
|
920
|
-
openChangeReason: TooltipRoot.ChangeEventReason | null;
|
|
921
|
-
closeOnClick: boolean;
|
|
922
|
-
closeDelay: number;
|
|
923
|
-
hasViewport: boolean;
|
|
924
|
-
};
|
|
925
|
-
export type Context = PopupStoreContext<TooltipRoot.ChangeEventDetails> & {
|
|
926
|
-
readonly popupRef: React$1.RefObject<HTMLElement | null>;
|
|
927
|
-
};
|
|
928
|
-
declare const selectors$1: {
|
|
929
|
-
disabled: (state: State<unknown>) => boolean;
|
|
930
|
-
instantType: (state: State<unknown>) => "delay" | "focus" | "dismiss" | undefined;
|
|
931
|
-
isInstantPhase: (state: State<unknown>) => boolean;
|
|
932
|
-
trackCursorAxis: (state: State<unknown>) => "none" | "both" | "x" | "y";
|
|
933
|
-
disableHoverablePopup: (state: State<unknown>) => boolean;
|
|
934
|
-
lastOpenChangeReason: (state: State<unknown>) => TooltipRootChangeEventReason | null;
|
|
935
|
-
closeOnClick: (state: State<unknown>) => boolean;
|
|
936
|
-
closeDelay: (state: State<unknown>) => number;
|
|
937
|
-
hasViewport: (state: State<unknown>) => boolean;
|
|
938
|
-
open: (state: {
|
|
939
|
-
open: boolean;
|
|
940
|
-
readonly openProp: boolean | undefined;
|
|
941
|
-
mounted: boolean;
|
|
942
|
-
transitionStatus: TransitionStatus;
|
|
943
|
-
floatingRootContext: FloatingRootContext;
|
|
944
|
-
floatingId: string | undefined;
|
|
945
|
-
triggerCount: number;
|
|
946
|
-
preventUnmountingOnClose: boolean;
|
|
947
|
-
payload: unknown;
|
|
948
|
-
activeTriggerId: string | null;
|
|
949
|
-
activeTriggerElement: Element | null;
|
|
950
|
-
readonly triggerIdProp: string | null | undefined;
|
|
951
|
-
popupElement: HTMLElement | null;
|
|
952
|
-
positionerElement: HTMLElement | null;
|
|
953
|
-
activeTriggerProps: HTMLProps;
|
|
954
|
-
inactiveTriggerProps: HTMLProps;
|
|
955
|
-
popupProps: HTMLProps;
|
|
956
|
-
}) => boolean;
|
|
957
|
-
mounted: (state: {
|
|
958
|
-
open: boolean;
|
|
959
|
-
readonly openProp: boolean | undefined;
|
|
960
|
-
mounted: boolean;
|
|
961
|
-
transitionStatus: TransitionStatus;
|
|
962
|
-
floatingRootContext: FloatingRootContext;
|
|
963
|
-
floatingId: string | undefined;
|
|
964
|
-
triggerCount: number;
|
|
965
|
-
preventUnmountingOnClose: boolean;
|
|
966
|
-
payload: unknown;
|
|
967
|
-
activeTriggerId: string | null;
|
|
968
|
-
activeTriggerElement: Element | null;
|
|
969
|
-
readonly triggerIdProp: string | null | undefined;
|
|
970
|
-
popupElement: HTMLElement | null;
|
|
971
|
-
positionerElement: HTMLElement | null;
|
|
972
|
-
activeTriggerProps: HTMLProps;
|
|
973
|
-
inactiveTriggerProps: HTMLProps;
|
|
974
|
-
popupProps: HTMLProps;
|
|
975
|
-
}) => boolean;
|
|
976
|
-
transitionStatus: (state: {
|
|
977
|
-
open: boolean;
|
|
978
|
-
readonly openProp: boolean | undefined;
|
|
979
|
-
mounted: boolean;
|
|
980
|
-
transitionStatus: TransitionStatus;
|
|
981
|
-
floatingRootContext: FloatingRootContext;
|
|
982
|
-
floatingId: string | undefined;
|
|
983
|
-
triggerCount: number;
|
|
984
|
-
preventUnmountingOnClose: boolean;
|
|
985
|
-
payload: unknown;
|
|
986
|
-
activeTriggerId: string | null;
|
|
987
|
-
activeTriggerElement: Element | null;
|
|
988
|
-
readonly triggerIdProp: string | null | undefined;
|
|
989
|
-
popupElement: HTMLElement | null;
|
|
990
|
-
positionerElement: HTMLElement | null;
|
|
991
|
-
activeTriggerProps: HTMLProps;
|
|
992
|
-
inactiveTriggerProps: HTMLProps;
|
|
993
|
-
popupProps: HTMLProps;
|
|
994
|
-
}) => TransitionStatus;
|
|
995
|
-
floatingRootContext: (state: {
|
|
996
|
-
open: boolean;
|
|
997
|
-
readonly openProp: boolean | undefined;
|
|
998
|
-
mounted: boolean;
|
|
999
|
-
transitionStatus: TransitionStatus;
|
|
1000
|
-
floatingRootContext: FloatingRootContext;
|
|
1001
|
-
floatingId: string | undefined;
|
|
1002
|
-
triggerCount: number;
|
|
1003
|
-
preventUnmountingOnClose: boolean;
|
|
1004
|
-
payload: unknown;
|
|
1005
|
-
activeTriggerId: string | null;
|
|
1006
|
-
activeTriggerElement: Element | null;
|
|
1007
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1008
|
-
popupElement: HTMLElement | null;
|
|
1009
|
-
positionerElement: HTMLElement | null;
|
|
1010
|
-
activeTriggerProps: HTMLProps;
|
|
1011
|
-
inactiveTriggerProps: HTMLProps;
|
|
1012
|
-
popupProps: HTMLProps;
|
|
1013
|
-
}) => FloatingRootStore;
|
|
1014
|
-
triggerCount: (state: {
|
|
1015
|
-
open: boolean;
|
|
1016
|
-
readonly openProp: boolean | undefined;
|
|
1017
|
-
mounted: boolean;
|
|
1018
|
-
transitionStatus: TransitionStatus;
|
|
1019
|
-
floatingRootContext: FloatingRootContext;
|
|
1020
|
-
floatingId: string | undefined;
|
|
1021
|
-
triggerCount: number;
|
|
1022
|
-
preventUnmountingOnClose: boolean;
|
|
1023
|
-
payload: unknown;
|
|
1024
|
-
activeTriggerId: string | null;
|
|
1025
|
-
activeTriggerElement: Element | null;
|
|
1026
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1027
|
-
popupElement: HTMLElement | null;
|
|
1028
|
-
positionerElement: HTMLElement | null;
|
|
1029
|
-
activeTriggerProps: HTMLProps;
|
|
1030
|
-
inactiveTriggerProps: HTMLProps;
|
|
1031
|
-
popupProps: HTMLProps;
|
|
1032
|
-
}) => number;
|
|
1033
|
-
preventUnmountingOnClose: (state: {
|
|
1034
|
-
open: boolean;
|
|
1035
|
-
readonly openProp: boolean | undefined;
|
|
1036
|
-
mounted: boolean;
|
|
1037
|
-
transitionStatus: TransitionStatus;
|
|
1038
|
-
floatingRootContext: FloatingRootContext;
|
|
1039
|
-
floatingId: string | undefined;
|
|
1040
|
-
triggerCount: number;
|
|
1041
|
-
preventUnmountingOnClose: boolean;
|
|
1042
|
-
payload: unknown;
|
|
1043
|
-
activeTriggerId: string | null;
|
|
1044
|
-
activeTriggerElement: Element | null;
|
|
1045
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1046
|
-
popupElement: HTMLElement | null;
|
|
1047
|
-
positionerElement: HTMLElement | null;
|
|
1048
|
-
activeTriggerProps: HTMLProps;
|
|
1049
|
-
inactiveTriggerProps: HTMLProps;
|
|
1050
|
-
popupProps: HTMLProps;
|
|
1051
|
-
}) => boolean;
|
|
1052
|
-
payload: (state: {
|
|
1053
|
-
open: boolean;
|
|
1054
|
-
readonly openProp: boolean | undefined;
|
|
1055
|
-
mounted: boolean;
|
|
1056
|
-
transitionStatus: TransitionStatus;
|
|
1057
|
-
floatingRootContext: FloatingRootContext;
|
|
1058
|
-
floatingId: string | undefined;
|
|
1059
|
-
triggerCount: number;
|
|
1060
|
-
preventUnmountingOnClose: boolean;
|
|
1061
|
-
payload: unknown;
|
|
1062
|
-
activeTriggerId: string | null;
|
|
1063
|
-
activeTriggerElement: Element | null;
|
|
1064
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1065
|
-
popupElement: HTMLElement | null;
|
|
1066
|
-
positionerElement: HTMLElement | null;
|
|
1067
|
-
activeTriggerProps: HTMLProps;
|
|
1068
|
-
inactiveTriggerProps: HTMLProps;
|
|
1069
|
-
popupProps: HTMLProps;
|
|
1070
|
-
}) => unknown;
|
|
1071
|
-
activeTriggerId: (state: {
|
|
1072
|
-
open: boolean;
|
|
1073
|
-
readonly openProp: boolean | undefined;
|
|
1074
|
-
mounted: boolean;
|
|
1075
|
-
transitionStatus: TransitionStatus;
|
|
1076
|
-
floatingRootContext: FloatingRootContext;
|
|
1077
|
-
floatingId: string | undefined;
|
|
1078
|
-
triggerCount: number;
|
|
1079
|
-
preventUnmountingOnClose: boolean;
|
|
1080
|
-
payload: unknown;
|
|
1081
|
-
activeTriggerId: string | null;
|
|
1082
|
-
activeTriggerElement: Element | null;
|
|
1083
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1084
|
-
popupElement: HTMLElement | null;
|
|
1085
|
-
positionerElement: HTMLElement | null;
|
|
1086
|
-
activeTriggerProps: HTMLProps;
|
|
1087
|
-
inactiveTriggerProps: HTMLProps;
|
|
1088
|
-
popupProps: HTMLProps;
|
|
1089
|
-
}) => string | null;
|
|
1090
|
-
activeTriggerElement: (state: {
|
|
1091
|
-
open: boolean;
|
|
1092
|
-
readonly openProp: boolean | undefined;
|
|
1093
|
-
mounted: boolean;
|
|
1094
|
-
transitionStatus: TransitionStatus;
|
|
1095
|
-
floatingRootContext: FloatingRootContext;
|
|
1096
|
-
floatingId: string | undefined;
|
|
1097
|
-
triggerCount: number;
|
|
1098
|
-
preventUnmountingOnClose: boolean;
|
|
1099
|
-
payload: unknown;
|
|
1100
|
-
activeTriggerId: string | null;
|
|
1101
|
-
activeTriggerElement: Element | null;
|
|
1102
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1103
|
-
popupElement: HTMLElement | null;
|
|
1104
|
-
positionerElement: HTMLElement | null;
|
|
1105
|
-
activeTriggerProps: HTMLProps;
|
|
1106
|
-
inactiveTriggerProps: HTMLProps;
|
|
1107
|
-
popupProps: HTMLProps;
|
|
1108
|
-
}) => Element | null;
|
|
1109
|
-
popupId: (state: {
|
|
1110
|
-
open: boolean;
|
|
1111
|
-
readonly openProp: boolean | undefined;
|
|
1112
|
-
mounted: boolean;
|
|
1113
|
-
transitionStatus: TransitionStatus;
|
|
1114
|
-
floatingRootContext: FloatingRootContext;
|
|
1115
|
-
floatingId: string | undefined;
|
|
1116
|
-
triggerCount: number;
|
|
1117
|
-
preventUnmountingOnClose: boolean;
|
|
1118
|
-
payload: unknown;
|
|
1119
|
-
activeTriggerId: string | null;
|
|
1120
|
-
activeTriggerElement: Element | null;
|
|
1121
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1122
|
-
popupElement: HTMLElement | null;
|
|
1123
|
-
positionerElement: HTMLElement | null;
|
|
1124
|
-
activeTriggerProps: HTMLProps;
|
|
1125
|
-
inactiveTriggerProps: HTMLProps;
|
|
1126
|
-
popupProps: HTMLProps;
|
|
1127
|
-
}) => string | undefined;
|
|
1128
|
-
isTriggerActive: (state: {
|
|
1129
|
-
open: boolean;
|
|
1130
|
-
readonly openProp: boolean | undefined;
|
|
1131
|
-
mounted: boolean;
|
|
1132
|
-
transitionStatus: TransitionStatus;
|
|
1133
|
-
floatingRootContext: FloatingRootContext;
|
|
1134
|
-
floatingId: string | undefined;
|
|
1135
|
-
triggerCount: number;
|
|
1136
|
-
preventUnmountingOnClose: boolean;
|
|
1137
|
-
payload: unknown;
|
|
1138
|
-
activeTriggerId: string | null;
|
|
1139
|
-
activeTriggerElement: Element | null;
|
|
1140
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1141
|
-
popupElement: HTMLElement | null;
|
|
1142
|
-
positionerElement: HTMLElement | null;
|
|
1143
|
-
activeTriggerProps: HTMLProps;
|
|
1144
|
-
inactiveTriggerProps: HTMLProps;
|
|
1145
|
-
popupProps: HTMLProps;
|
|
1146
|
-
}, triggerId: string | undefined) => boolean;
|
|
1147
|
-
isOpenedByTrigger: (state: {
|
|
1148
|
-
open: boolean;
|
|
1149
|
-
readonly openProp: boolean | undefined;
|
|
1150
|
-
mounted: boolean;
|
|
1151
|
-
transitionStatus: TransitionStatus;
|
|
1152
|
-
floatingRootContext: FloatingRootContext;
|
|
1153
|
-
floatingId: string | undefined;
|
|
1154
|
-
triggerCount: number;
|
|
1155
|
-
preventUnmountingOnClose: boolean;
|
|
1156
|
-
payload: unknown;
|
|
1157
|
-
activeTriggerId: string | null;
|
|
1158
|
-
activeTriggerElement: Element | null;
|
|
1159
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1160
|
-
popupElement: HTMLElement | null;
|
|
1161
|
-
positionerElement: HTMLElement | null;
|
|
1162
|
-
activeTriggerProps: HTMLProps;
|
|
1163
|
-
inactiveTriggerProps: HTMLProps;
|
|
1164
|
-
popupProps: HTMLProps;
|
|
1165
|
-
}, triggerId: string | undefined) => boolean;
|
|
1166
|
-
isMountedByTrigger: (state: {
|
|
1167
|
-
open: boolean;
|
|
1168
|
-
readonly openProp: boolean | undefined;
|
|
1169
|
-
mounted: boolean;
|
|
1170
|
-
transitionStatus: TransitionStatus;
|
|
1171
|
-
floatingRootContext: FloatingRootContext;
|
|
1172
|
-
floatingId: string | undefined;
|
|
1173
|
-
triggerCount: number;
|
|
1174
|
-
preventUnmountingOnClose: boolean;
|
|
1175
|
-
payload: unknown;
|
|
1176
|
-
activeTriggerId: string | null;
|
|
1177
|
-
activeTriggerElement: Element | null;
|
|
1178
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1179
|
-
popupElement: HTMLElement | null;
|
|
1180
|
-
positionerElement: HTMLElement | null;
|
|
1181
|
-
activeTriggerProps: HTMLProps;
|
|
1182
|
-
inactiveTriggerProps: HTMLProps;
|
|
1183
|
-
popupProps: HTMLProps;
|
|
1184
|
-
}, triggerId: string | undefined) => boolean;
|
|
1185
|
-
triggerProps: (state: {
|
|
1186
|
-
open: boolean;
|
|
1187
|
-
readonly openProp: boolean | undefined;
|
|
1188
|
-
mounted: boolean;
|
|
1189
|
-
transitionStatus: TransitionStatus;
|
|
1190
|
-
floatingRootContext: FloatingRootContext;
|
|
1191
|
-
floatingId: string | undefined;
|
|
1192
|
-
triggerCount: number;
|
|
1193
|
-
preventUnmountingOnClose: boolean;
|
|
1194
|
-
payload: unknown;
|
|
1195
|
-
activeTriggerId: string | null;
|
|
1196
|
-
activeTriggerElement: Element | null;
|
|
1197
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1198
|
-
popupElement: HTMLElement | null;
|
|
1199
|
-
positionerElement: HTMLElement | null;
|
|
1200
|
-
activeTriggerProps: HTMLProps;
|
|
1201
|
-
inactiveTriggerProps: HTMLProps;
|
|
1202
|
-
popupProps: HTMLProps;
|
|
1203
|
-
}, isActive: boolean) => HTMLProps;
|
|
1204
|
-
triggerPopupId: (state: {
|
|
1205
|
-
open: boolean;
|
|
1206
|
-
readonly openProp: boolean | undefined;
|
|
1207
|
-
mounted: boolean;
|
|
1208
|
-
transitionStatus: TransitionStatus;
|
|
1209
|
-
floatingRootContext: FloatingRootContext;
|
|
1210
|
-
floatingId: string | undefined;
|
|
1211
|
-
triggerCount: number;
|
|
1212
|
-
preventUnmountingOnClose: boolean;
|
|
1213
|
-
payload: unknown;
|
|
1214
|
-
activeTriggerId: string | null;
|
|
1215
|
-
activeTriggerElement: Element | null;
|
|
1216
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1217
|
-
popupElement: HTMLElement | null;
|
|
1218
|
-
positionerElement: HTMLElement | null;
|
|
1219
|
-
activeTriggerProps: HTMLProps;
|
|
1220
|
-
inactiveTriggerProps: HTMLProps;
|
|
1221
|
-
popupProps: HTMLProps;
|
|
1222
|
-
}, triggerId: string | undefined) => string | undefined;
|
|
1223
|
-
popupProps: (state: {
|
|
1224
|
-
open: boolean;
|
|
1225
|
-
readonly openProp: boolean | undefined;
|
|
1226
|
-
mounted: boolean;
|
|
1227
|
-
transitionStatus: TransitionStatus;
|
|
1228
|
-
floatingRootContext: FloatingRootContext;
|
|
1229
|
-
floatingId: string | undefined;
|
|
1230
|
-
triggerCount: number;
|
|
1231
|
-
preventUnmountingOnClose: boolean;
|
|
1232
|
-
payload: unknown;
|
|
1233
|
-
activeTriggerId: string | null;
|
|
1234
|
-
activeTriggerElement: Element | null;
|
|
1235
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1236
|
-
popupElement: HTMLElement | null;
|
|
1237
|
-
positionerElement: HTMLElement | null;
|
|
1238
|
-
activeTriggerProps: HTMLProps;
|
|
1239
|
-
inactiveTriggerProps: HTMLProps;
|
|
1240
|
-
popupProps: HTMLProps;
|
|
1241
|
-
}) => HTMLProps;
|
|
1242
|
-
popupElement: (state: {
|
|
1243
|
-
open: boolean;
|
|
1244
|
-
readonly openProp: boolean | undefined;
|
|
1245
|
-
mounted: boolean;
|
|
1246
|
-
transitionStatus: TransitionStatus;
|
|
1247
|
-
floatingRootContext: FloatingRootContext;
|
|
1248
|
-
floatingId: string | undefined;
|
|
1249
|
-
triggerCount: number;
|
|
1250
|
-
preventUnmountingOnClose: boolean;
|
|
1251
|
-
payload: unknown;
|
|
1252
|
-
activeTriggerId: string | null;
|
|
1253
|
-
activeTriggerElement: Element | null;
|
|
1254
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1255
|
-
popupElement: HTMLElement | null;
|
|
1256
|
-
positionerElement: HTMLElement | null;
|
|
1257
|
-
activeTriggerProps: HTMLProps;
|
|
1258
|
-
inactiveTriggerProps: HTMLProps;
|
|
1259
|
-
popupProps: HTMLProps;
|
|
1260
|
-
}) => HTMLElement | null;
|
|
1261
|
-
positionerElement: (state: {
|
|
1262
|
-
open: boolean;
|
|
1263
|
-
readonly openProp: boolean | undefined;
|
|
1264
|
-
mounted: boolean;
|
|
1265
|
-
transitionStatus: TransitionStatus;
|
|
1266
|
-
floatingRootContext: FloatingRootContext;
|
|
1267
|
-
floatingId: string | undefined;
|
|
1268
|
-
triggerCount: number;
|
|
1269
|
-
preventUnmountingOnClose: boolean;
|
|
1270
|
-
payload: unknown;
|
|
1271
|
-
activeTriggerId: string | null;
|
|
1272
|
-
activeTriggerElement: Element | null;
|
|
1273
|
-
readonly triggerIdProp: string | null | undefined;
|
|
1274
|
-
popupElement: HTMLElement | null;
|
|
1275
|
-
positionerElement: HTMLElement | null;
|
|
1276
|
-
activeTriggerProps: HTMLProps;
|
|
1277
|
-
inactiveTriggerProps: HTMLProps;
|
|
1278
|
-
popupProps: HTMLProps;
|
|
1279
|
-
}) => HTMLElement | null;
|
|
1280
|
-
};
|
|
1281
|
-
declare class TooltipStore<Payload> extends ReactStore<Readonly<State<Payload>>, Context, typeof selectors$1> {
|
|
1282
|
-
constructor(initialState?: Partial<State<Payload>>, floatingId?: string | undefined, nested?: boolean);
|
|
1283
|
-
setOpen: (nextOpen: boolean, eventDetails: Omit<TooltipRoot.ChangeEventDetails, "preventUnmountOnClose">) => void;
|
|
1284
|
-
cancelPendingOpen(event: MouseEvent | PointerEvent): void;
|
|
1285
|
-
static useStore<Payload>(externalStore: TooltipStore<Payload> | undefined, initialState?: Partial<State<Payload>>): TooltipStore<Payload>;
|
|
1286
|
-
}
|
|
1287
|
-
declare class TooltipHandle<Payload> {
|
|
1288
|
-
/**
|
|
1289
|
-
* Internal store holding the tooltip state.
|
|
1290
|
-
* @internal
|
|
1291
|
-
*/
|
|
1292
|
-
readonly store: TooltipStore<Payload>;
|
|
1293
|
-
constructor();
|
|
1294
|
-
/**
|
|
1295
|
-
* Opens the tooltip and associates it with the trigger with the given ID.
|
|
1296
|
-
* The trigger must be a Tooltip.Trigger component with this handle passed as a prop.
|
|
1297
|
-
*
|
|
1298
|
-
* This method should only be called in an event handler or an effect (not during rendering).
|
|
1299
|
-
*
|
|
1300
|
-
* @param triggerId ID of the trigger to associate with the tooltip.
|
|
1301
|
-
*/
|
|
1302
|
-
open(triggerId: string): void;
|
|
1303
|
-
/**
|
|
1304
|
-
* Closes the tooltip.
|
|
1305
|
-
*/
|
|
1306
|
-
close(): void;
|
|
1307
|
-
/**
|
|
1308
|
-
* Indicates whether the tooltip is currently open.
|
|
1309
|
-
*/
|
|
1310
|
-
get isOpen(): boolean;
|
|
1311
|
-
}
|
|
1312
|
-
declare function createTooltipHandle<Payload>(): TooltipHandle<Payload>;
|
|
1313
|
-
/**
|
|
1314
|
-
* Groups all parts of the tooltip.
|
|
1315
|
-
* Doesn't render its own HTML element.
|
|
1316
|
-
*
|
|
1317
|
-
* Documentation: [Base UI Tooltip](https://base-ui.com/react/components/tooltip)
|
|
1318
|
-
*/
|
|
1319
|
-
export declare const TooltipRoot: <Payload>(props: TooltipRoot.Props<Payload>) => import("react/jsx-runtime").React$1.JSX.Element;
|
|
1320
|
-
export interface TooltipRootState {
|
|
1321
|
-
}
|
|
1322
|
-
export interface TooltipRootProps<Payload = unknown> {
|
|
1323
|
-
/**
|
|
1324
|
-
* Whether the tooltip is initially open.
|
|
1325
|
-
*
|
|
1326
|
-
* To render a controlled tooltip, use the `open` prop instead.
|
|
1327
|
-
* @default false
|
|
1328
|
-
*/
|
|
1329
|
-
defaultOpen?: boolean | undefined;
|
|
1330
|
-
/**
|
|
1331
|
-
* Whether the tooltip is currently open.
|
|
1332
|
-
*/
|
|
1333
|
-
open?: boolean | undefined;
|
|
1334
|
-
/**
|
|
1335
|
-
* Event handler called when the tooltip is opened or closed.
|
|
1336
|
-
*/
|
|
1337
|
-
onOpenChange?: ((open: boolean, eventDetails: TooltipRoot.ChangeEventDetails) => void) | undefined;
|
|
1338
|
-
/**
|
|
1339
|
-
* Event handler called after any animations complete when the tooltip is opened or closed.
|
|
1340
|
-
*/
|
|
1341
|
-
onOpenChangeComplete?: ((open: boolean) => void) | undefined;
|
|
1342
|
-
/**
|
|
1343
|
-
* Whether the tooltip contents can be hovered without closing the tooltip.
|
|
1344
|
-
* @default false
|
|
1345
|
-
*/
|
|
1346
|
-
disableHoverablePopup?: boolean | undefined;
|
|
1347
|
-
/**
|
|
1348
|
-
* Determines which axis the tooltip should track the cursor on.
|
|
1349
|
-
* @default 'none'
|
|
1350
|
-
*/
|
|
1351
|
-
trackCursorAxis?: "none" | "x" | "y" | "both" | undefined;
|
|
1352
|
-
/**
|
|
1353
|
-
* A ref to imperative actions.
|
|
1354
|
-
* - `unmount`: Unmounts the tooltip popup.
|
|
1355
|
-
* - `close`: Closes the tooltip imperatively when called.
|
|
1356
|
-
*/
|
|
1357
|
-
actionsRef?: React$1.RefObject<TooltipRoot.Actions | null> | undefined;
|
|
1358
|
-
/**
|
|
1359
|
-
* Whether the tooltip is disabled.
|
|
1360
|
-
* @default false
|
|
1361
|
-
*/
|
|
1362
|
-
disabled?: boolean | undefined;
|
|
1363
|
-
/**
|
|
1364
|
-
* A handle to associate the tooltip with a trigger.
|
|
1365
|
-
* If specified, allows external triggers to control the tooltip's open state.
|
|
1366
|
-
* Can be created with the Tooltip.createHandle() method.
|
|
1367
|
-
*/
|
|
1368
|
-
handle?: TooltipHandle<Payload> | undefined;
|
|
1369
|
-
/**
|
|
1370
|
-
* The content of the tooltip.
|
|
1371
|
-
* This can be a regular React node or a render function that receives the `payload` of the active trigger.
|
|
1372
|
-
*/
|
|
1373
|
-
children?: React$1.ReactNode | PayloadChildRenderFunction<Payload>;
|
|
1374
|
-
/**
|
|
1375
|
-
* ID of the trigger that the tooltip is associated with.
|
|
1376
|
-
* This is useful in conjunction with the `open` prop to create a controlled tooltip.
|
|
1377
|
-
* There's no need to specify this prop when the tooltip is uncontrolled (that is, when the `open` prop is not set).
|
|
1378
|
-
*/
|
|
1379
|
-
triggerId?: string | null | undefined;
|
|
1380
|
-
/**
|
|
1381
|
-
* ID of the trigger that the tooltip is associated with.
|
|
1382
|
-
* This is useful in conjunction with the `defaultOpen` prop to create an initially open tooltip.
|
|
1383
|
-
*/
|
|
1384
|
-
defaultTriggerId?: string | null | undefined;
|
|
1385
|
-
}
|
|
1386
|
-
export interface TooltipRootActions {
|
|
1387
|
-
unmount: () => void;
|
|
1388
|
-
close: () => void;
|
|
1389
|
-
}
|
|
1390
|
-
export type TooltipRootChangeEventReason = typeof triggerHover | typeof triggerFocus | typeof triggerPress | typeof outsidePress | typeof escapeKey | typeof disabled | typeof imperativeAction | typeof none;
|
|
1391
|
-
export type TooltipRootChangeEventDetails = BaseUIChangeEventDetails<TooltipRoot.ChangeEventReason> & {
|
|
1392
|
-
preventUnmountOnClose(): void;
|
|
1393
|
-
};
|
|
1394
|
-
export declare namespace TooltipRoot {
|
|
1395
|
-
type State = TooltipRootState;
|
|
1396
|
-
type Props<Payload = unknown> = TooltipRootProps<Payload>;
|
|
1397
|
-
type Actions = TooltipRootActions;
|
|
1398
|
-
type ChangeEventReason = TooltipRootChangeEventReason;
|
|
1399
|
-
type ChangeEventDetails = TooltipRootChangeEventDetails;
|
|
1400
|
-
}
|
|
1401
|
-
/**
|
|
1402
|
-
* An element to attach the tooltip to.
|
|
1403
|
-
* Renders a `<button>` element.
|
|
1404
|
-
*
|
|
1405
|
-
* Documentation: [Base UI Tooltip](https://base-ui.com/react/components/tooltip)
|
|
1406
|
-
*/
|
|
1407
|
-
export declare const TooltipTrigger: TooltipTrigger;
|
|
1408
|
-
export interface TooltipTrigger {
|
|
1409
|
-
<Payload>(componentProps: TooltipTrigger.Props<Payload> & React$1.RefAttributes<HTMLElement>): React$1.JSX.Element;
|
|
1410
|
-
}
|
|
1411
|
-
export interface TooltipTriggerState {
|
|
1412
|
-
/**
|
|
1413
|
-
* Whether the tooltip is currently open.
|
|
1414
|
-
*/
|
|
1415
|
-
open: boolean;
|
|
1416
|
-
}
|
|
1417
|
-
export interface TooltipTriggerProps<Payload = unknown> extends BaseUIComponentProps<"button", TooltipTriggerState> {
|
|
1418
|
-
/**
|
|
1419
|
-
* A handle to associate the trigger with a tooltip.
|
|
1420
|
-
*/
|
|
1421
|
-
handle?: TooltipHandle<Payload> | undefined;
|
|
1422
|
-
/**
|
|
1423
|
-
* A payload to pass to the tooltip when it is opened.
|
|
1424
|
-
*/
|
|
1425
|
-
payload?: Payload | undefined;
|
|
1426
|
-
/**
|
|
1427
|
-
* How long to wait before opening the tooltip. Specified in milliseconds.
|
|
1428
|
-
* @default 600
|
|
1429
|
-
*/
|
|
1430
|
-
delay?: number | undefined;
|
|
1431
|
-
/**
|
|
1432
|
-
* Whether the tooltip should close when this trigger is clicked.
|
|
1433
|
-
* @default true
|
|
1434
|
-
*/
|
|
1435
|
-
closeOnClick?: boolean | undefined;
|
|
1436
|
-
/**
|
|
1437
|
-
* How long to wait before closing the tooltip. Specified in milliseconds.
|
|
1438
|
-
* @default 0
|
|
1439
|
-
*/
|
|
1440
|
-
closeDelay?: number | undefined;
|
|
1441
|
-
/**
|
|
1442
|
-
* If `true`, the tooltip will not open when interacting with this trigger.
|
|
1443
|
-
* Note that this doesn't apply the `disabled` attribute to the trigger element.
|
|
1444
|
-
* If you want to disable the trigger element itself, you can pass the `disabled` prop to the trigger element via the `render` prop.
|
|
1445
|
-
* @default false
|
|
1446
|
-
*/
|
|
1447
|
-
disabled?: boolean | undefined;
|
|
1448
|
-
}
|
|
1449
|
-
export declare namespace TooltipTrigger {
|
|
1450
|
-
type State = TooltipTriggerState;
|
|
1451
|
-
type Props<Payload = unknown> = TooltipTriggerProps<Payload>;
|
|
1452
|
-
}
|
|
1453
|
-
/**
|
|
1454
|
-
* A portal element that moves the popup to a different part of the DOM.
|
|
1455
|
-
* By default, the portal element is appended to `<body>`.
|
|
1456
|
-
* Renders a `<div>` element.
|
|
1457
|
-
*
|
|
1458
|
-
* Documentation: [Base UI Tooltip](https://base-ui.com/react/components/tooltip)
|
|
1459
|
-
*/
|
|
1460
|
-
export declare const TooltipPortal: React$1.ForwardRefExoticComponent<Omit<TooltipPortalProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
1461
|
-
export interface TooltipPortalState {
|
|
1462
|
-
}
|
|
1463
|
-
export interface TooltipPortalProps extends FloatingPortalLite.Props<TooltipPortalState> {
|
|
1464
|
-
/**
|
|
1465
|
-
* Whether to keep the portal mounted in the DOM while the popup is hidden.
|
|
1466
|
-
* @default false
|
|
1467
|
-
*/
|
|
1468
|
-
keepMounted?: boolean | undefined;
|
|
1469
|
-
}
|
|
1470
|
-
export declare namespace TooltipPortal {
|
|
1471
|
-
type State = TooltipPortalState;
|
|
1472
|
-
type Props = TooltipPortalProps;
|
|
1473
|
-
}
|
|
1474
|
-
/**
|
|
1475
|
-
* Positions the tooltip against the trigger.
|
|
1476
|
-
* Renders a `<div>` element.
|
|
1477
|
-
*
|
|
1478
|
-
* Documentation: [Base UI Tooltip](https://base-ui.com/react/components/tooltip)
|
|
1479
|
-
*/
|
|
1480
|
-
export declare const TooltipPositioner: React$1.ForwardRefExoticComponent<Omit<TooltipPositionerProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
1481
|
-
export interface TooltipPositionerState {
|
|
1482
|
-
/**
|
|
1483
|
-
* Whether the tooltip is currently open.
|
|
1484
|
-
*/
|
|
1485
|
-
open: boolean;
|
|
1486
|
-
/**
|
|
1487
|
-
* The side of the anchor the component is placed on.
|
|
1488
|
-
*/
|
|
1489
|
-
side: Side$1;
|
|
1490
|
-
/**
|
|
1491
|
-
* The alignment of the component relative to the anchor.
|
|
1492
|
-
*/
|
|
1493
|
-
align: Align;
|
|
1494
|
-
/**
|
|
1495
|
-
* Whether the anchor element is hidden.
|
|
1496
|
-
*/
|
|
1497
|
-
anchorHidden: boolean;
|
|
1498
|
-
/**
|
|
1499
|
-
* Whether CSS transitions should be disabled.
|
|
1500
|
-
*/
|
|
1501
|
-
instant: string | undefined;
|
|
1502
|
-
}
|
|
1503
|
-
export interface TooltipPositionerProps extends BaseUIComponentProps<"div", TooltipPositionerState>, Omit<UseAnchorPositioningSharedParameters, "side"> {
|
|
1504
|
-
/**
|
|
1505
|
-
* Which side of the anchor element to align the popup against.
|
|
1506
|
-
* May automatically change to avoid collisions.
|
|
1507
|
-
* @default 'top'
|
|
1508
|
-
*/
|
|
1509
|
-
side?: Side$1 | undefined;
|
|
1510
|
-
}
|
|
1511
|
-
export declare namespace TooltipPositioner {
|
|
1512
|
-
type State = TooltipPositionerState;
|
|
1513
|
-
type Props = TooltipPositionerProps;
|
|
1514
|
-
}
|
|
1515
|
-
/**
|
|
1516
|
-
* A container for the tooltip contents.
|
|
1517
|
-
* Renders a `<div>` element.
|
|
1518
|
-
*
|
|
1519
|
-
* Documentation: [Base UI Tooltip](https://base-ui.com/react/components/tooltip)
|
|
1520
|
-
*/
|
|
1521
|
-
export declare const TooltipPopup: React$1.ForwardRefExoticComponent<Omit<TooltipPopupProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
1522
|
-
export interface TooltipPopupState {
|
|
1523
|
-
/**
|
|
1524
|
-
* Whether the tooltip is currently open.
|
|
1525
|
-
*/
|
|
1526
|
-
open: boolean;
|
|
1527
|
-
/**
|
|
1528
|
-
* The side of the anchor the component is placed on.
|
|
1529
|
-
*/
|
|
1530
|
-
side: Side$1;
|
|
1531
|
-
/**
|
|
1532
|
-
* The alignment of the component relative to the anchor.
|
|
1533
|
-
*/
|
|
1534
|
-
align: Align;
|
|
1535
|
-
/**
|
|
1536
|
-
* Whether transitions should be skipped.
|
|
1537
|
-
*/
|
|
1538
|
-
instant: "delay" | "focus" | "dismiss" | undefined;
|
|
1539
|
-
/**
|
|
1540
|
-
* The transition status of the component.
|
|
1541
|
-
*/
|
|
1542
|
-
transitionStatus: TransitionStatus;
|
|
1543
|
-
}
|
|
1544
|
-
export interface TooltipPopupProps extends BaseUIComponentProps<"div", TooltipPopupState> {
|
|
1545
|
-
}
|
|
1546
|
-
export declare namespace TooltipPopup {
|
|
1547
|
-
type State = TooltipPopupState;
|
|
1548
|
-
type Props = TooltipPopupProps;
|
|
1549
|
-
}
|
|
1550
|
-
/**
|
|
1551
|
-
* Displays an element positioned against the tooltip anchor.
|
|
1552
|
-
* Renders a `<div>` element.
|
|
1553
|
-
*
|
|
1554
|
-
* Documentation: [Base UI Tooltip](https://base-ui.com/react/components/tooltip)
|
|
1555
|
-
*/
|
|
1556
|
-
export declare const TooltipArrow: React$1.ForwardRefExoticComponent<Omit<TooltipArrowProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
1557
|
-
export interface TooltipArrowState {
|
|
1558
|
-
/**
|
|
1559
|
-
* Whether the tooltip is currently open.
|
|
1560
|
-
*/
|
|
1561
|
-
open: boolean;
|
|
1562
|
-
/**
|
|
1563
|
-
* The side of the anchor the component is placed on.
|
|
1564
|
-
*/
|
|
1565
|
-
side: Side$1;
|
|
1566
|
-
/**
|
|
1567
|
-
* The alignment of the component relative to the anchor.
|
|
1568
|
-
*/
|
|
1569
|
-
align: Align;
|
|
1570
|
-
/**
|
|
1571
|
-
* Whether the arrow cannot be centered on the anchor.
|
|
1572
|
-
*/
|
|
1573
|
-
uncentered: boolean;
|
|
1574
|
-
/**
|
|
1575
|
-
* Whether transitions should be skipped.
|
|
1576
|
-
*/
|
|
1577
|
-
instant: "delay" | "dismiss" | "focus" | undefined;
|
|
1578
|
-
}
|
|
1579
|
-
export interface TooltipArrowProps extends BaseUIComponentProps<"div", TooltipArrowState> {
|
|
1580
|
-
}
|
|
1581
|
-
export declare namespace TooltipArrow {
|
|
1582
|
-
type State = TooltipArrowState;
|
|
1583
|
-
type Props = TooltipArrowProps;
|
|
1584
|
-
}
|
|
1585
|
-
/**
|
|
1586
|
-
* Provides a shared delay for multiple tooltips. The grouping logic ensures that
|
|
1587
|
-
* once a tooltip becomes visible, the adjacent tooltips will be shown instantly.
|
|
1588
|
-
*
|
|
1589
|
-
* Documentation: [Base UI Tooltip](https://base-ui.com/react/components/tooltip)
|
|
1590
|
-
*/
|
|
1591
|
-
export declare const TooltipProvider: React$1.FC<TooltipProvider.Props>;
|
|
1592
|
-
export interface TooltipProviderState {
|
|
1593
|
-
}
|
|
1594
|
-
export interface TooltipProviderProps {
|
|
1595
|
-
children?: React$1.ReactNode;
|
|
1596
|
-
/**
|
|
1597
|
-
* How long to wait before opening a tooltip. Specified in milliseconds.
|
|
1598
|
-
*/
|
|
1599
|
-
delay?: number | undefined;
|
|
1600
|
-
/**
|
|
1601
|
-
* How long to wait before closing a tooltip. Specified in milliseconds.
|
|
1602
|
-
*/
|
|
1603
|
-
closeDelay?: number | undefined;
|
|
1604
|
-
/**
|
|
1605
|
-
* Another tooltip will open instantly if the previous tooltip
|
|
1606
|
-
* is closed within this timeout. Specified in milliseconds.
|
|
1607
|
-
* @default 400
|
|
1608
|
-
*/
|
|
1609
|
-
timeout?: number | undefined;
|
|
1610
|
-
}
|
|
1611
|
-
export declare namespace TooltipProvider {
|
|
1612
|
-
type State = TooltipProviderState;
|
|
1613
|
-
type Props = TooltipProviderProps;
|
|
1614
|
-
}
|
|
1615
|
-
/**
|
|
1616
|
-
* A viewport for displaying content transitions.
|
|
1617
|
-
* This component is only required if one popup can be opened by multiple triggers, its content
|
|
1618
|
-
* changes based on the trigger, and switching between them is animated.
|
|
1619
|
-
* Renders a `<div>` element.
|
|
1620
|
-
*
|
|
1621
|
-
* Documentation: [Base UI Tooltip](https://base-ui.com/react/components/tooltip)
|
|
1622
|
-
*/
|
|
1623
|
-
export declare const TooltipViewport: React$1.ForwardRefExoticComponent<Omit<TooltipViewport.Props, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
1624
|
-
export interface TooltipViewportState {
|
|
1625
|
-
/**
|
|
1626
|
-
* The activation direction of the transitioned content.
|
|
1627
|
-
*/
|
|
1628
|
-
activationDirection: string | undefined;
|
|
1629
|
-
/**
|
|
1630
|
-
* Whether the viewport is currently transitioning between contents.
|
|
1631
|
-
*/
|
|
1632
|
-
transitioning: boolean;
|
|
1633
|
-
/**
|
|
1634
|
-
* Present if animations should be instant.
|
|
1635
|
-
*/
|
|
1636
|
-
instant: "delay" | "dismiss" | "focus" | undefined;
|
|
1637
|
-
}
|
|
1638
|
-
export declare namespace TooltipViewport {
|
|
1639
|
-
interface Props extends BaseUIComponentProps<"div", TooltipViewportState> {
|
|
1640
|
-
/**
|
|
1641
|
-
* The content to render inside the transition container.
|
|
1642
|
-
*/
|
|
1643
|
-
children?: React$1.ReactNode;
|
|
1644
|
-
}
|
|
1645
|
-
type State = TooltipViewportState;
|
|
1646
|
-
}
|
|
1647
|
-
|
|
1648
|
-
declare namespace Tooltip {
|
|
1649
|
-
export { TooltipArrow as Arrow, TooltipHandle as Handle, TooltipPopup as Popup, TooltipPortal as Portal, TooltipPositioner as Positioner, TooltipProvider as Provider, TooltipRoot as Root, TooltipTrigger as Trigger, TooltipViewport as Viewport, createTooltipHandle as createHandle };
|
|
1650
|
-
}
|
|
1651
|
-
|
|
1652
|
-
export {
|
|
1653
|
-
Tooltip,
|
|
1654
|
-
};
|
|
1655
|
-
|
|
1656
|
-
export {};
|