@stevederico/skateboard-ui 3.12.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +37 -31
- package/dist/shadcn/ui/accordion.d.ts +1 -6
- package/dist/shadcn/ui/accordion.js +3 -17
- package/dist/shadcn/ui/alert-dialog.d.ts +1 -18
- package/dist/shadcn/ui/alert-dialog.js +3 -43
- package/dist/shadcn/ui/alert.d.ts +1 -13
- package/dist/shadcn/ui/alert.js +3 -28
- package/dist/shadcn/ui/aspect-ratio.d.ts +1 -4
- package/dist/shadcn/ui/aspect-ratio.js +3 -8
- package/dist/shadcn/ui/avatar.d.ts +1 -11
- package/dist/shadcn/ui/avatar.js +3 -24
- package/dist/shadcn/ui/badge.d.ts +1 -14
- package/dist/shadcn/ui/badge.js +3 -33
- package/dist/shadcn/ui/breadcrumb.d.ts +1 -10
- package/dist/shadcn/ui/breadcrumb.js +3 -37
- package/dist/shadcn/ui/button-group.d.ts +1 -13
- package/dist/shadcn/ui/button-group.js +3 -36
- package/dist/shadcn/ui/button.d.ts +1 -34
- package/dist/shadcn/ui/button.js +3 -53
- package/dist/shadcn/ui/calendar.d.ts +1 -13
- package/dist/shadcn/ui/calendar.js +3 -75
- package/dist/shadcn/ui/card.d.ts +1 -11
- package/dist/shadcn/ui/card.js +3 -25
- package/dist/shadcn/ui/checkbox.d.ts +1 -3
- package/dist/shadcn/ui/checkbox.js +3 -9
- package/dist/shadcn/ui/collapsible.d.ts +1 -5
- package/dist/shadcn/ui/collapsible.js +3 -13
- package/dist/shadcn/ui/command.d.ts +1 -19
- package/dist/shadcn/ui/command.js +3 -35
- package/dist/shadcn/ui/context-menu.d.ts +1 -29
- package/dist/shadcn/ui/context-menu.js +3 -52
- package/dist/shadcn/ui/dialog.d.ts +1 -17
- package/dist/shadcn/ui/dialog.js +3 -38
- package/dist/shadcn/ui/drawer.d.ts +1 -13
- package/dist/shadcn/ui/drawer.js +3 -196
- package/dist/shadcn/ui/dropdown-menu.d.ts +1 -29
- package/dist/shadcn/ui/dropdown-menu.js +3 -52
- package/dist/shadcn/ui/empty.d.ts +1 -14
- package/dist/shadcn/ui/empty.js +3 -33
- package/dist/shadcn/ui/field.d.ts +1 -28
- package/dist/shadcn/ui/field.js +3 -68
- package/dist/shadcn/ui/hover-card.d.ts +1 -5
- package/dist/shadcn/ui/hover-card.js +3 -14
- package/dist/shadcn/ui/input-group.d.ts +1 -28
- package/dist/shadcn/ui/input-group.js +3 -58
- package/dist/shadcn/ui/input.d.ts +1 -3
- package/dist/shadcn/ui/input.js +3 -8
- package/dist/shadcn/ui/item.d.ts +1 -34
- package/dist/shadcn/ui/item.js +3 -79
- package/dist/shadcn/ui/kbd.d.ts +1 -3
- package/dist/shadcn/ui/kbd.js +3 -9
- package/dist/shadcn/ui/label.d.ts +1 -3
- package/dist/shadcn/ui/label.js +3 -8
- package/dist/shadcn/ui/menubar.d.ts +1 -29
- package/dist/shadcn/ui/menubar.js +3 -57
- package/dist/shadcn/ui/navigation-menu.d.ts +1 -13
- package/dist/shadcn/ui/navigation-menu.js +3 -31
- package/dist/shadcn/ui/pagination.d.ts +1 -17
- package/dist/shadcn/ui/pagination.js +3 -27
- package/dist/shadcn/ui/popover.d.ts +1 -9
- package/dist/shadcn/ui/popover.js +3 -24
- package/dist/shadcn/ui/progress.d.ts +1 -7
- package/dist/shadcn/ui/progress.js +3 -20
- package/dist/shadcn/ui/radio-group.d.ts +1 -5
- package/dist/shadcn/ui/radio-group.js +3 -12
- package/dist/shadcn/ui/scroll-area.d.ts +1 -5
- package/dist/shadcn/ui/scroll-area.js +3 -12
- package/dist/shadcn/ui/select.d.ts +1 -15
- package/dist/shadcn/ui/select.js +3 -35
- package/dist/shadcn/ui/separator.d.ts +1 -3
- package/dist/shadcn/ui/separator.js +3 -8
- package/dist/shadcn/ui/sheet.d.ts +1 -14
- package/dist/shadcn/ui/sheet.js +3 -38
- package/dist/shadcn/ui/sidebar.d.ts +1 -70
- package/dist/shadcn/ui/sidebar.js +3 -256
- package/dist/shadcn/ui/skeleton.d.ts +1 -2
- package/dist/shadcn/ui/skeleton.js +3 -6
- package/dist/shadcn/ui/slider.d.ts +1 -3
- package/dist/shadcn/ui/slider.js +3 -12
- package/dist/shadcn/ui/spinner.d.ts +1 -2
- package/dist/shadcn/ui/spinner.js +3 -7
- package/dist/shadcn/ui/switch.d.ts +1 -5
- package/dist/shadcn/ui/switch.js +3 -8
- package/dist/shadcn/ui/table.d.ts +1 -10
- package/dist/shadcn/ui/table.js +3 -29
- package/dist/shadcn/ui/tabs.d.ts +1 -13
- package/dist/shadcn/ui/tabs.js +3 -29
- package/dist/shadcn/ui/textarea.d.ts +1 -3
- package/dist/shadcn/ui/textarea.js +3 -7
- package/dist/shadcn/ui/toggle-group.d.ts +1 -11
- package/dist/shadcn/ui/toggle-group.js +3 -25
- package/dist/shadcn/ui/toggle.d.ts +1 -15
- package/dist/shadcn/ui/toggle.js +3 -26
- package/dist/shadcn/ui/tooltip.d.ts +1 -6
- package/dist/shadcn/ui/tooltip.js +3 -17
- package/dist/ui/accordion.d.ts +21 -0
- package/dist/ui/accordion.js +67 -0
- package/dist/ui/alert-dialog.d.ts +32 -0
- package/dist/ui/alert-dialog.js +102 -0
- package/dist/ui/alert.d.ts +13 -0
- package/dist/ui/alert.js +28 -0
- package/dist/ui/aspect-ratio.d.ts +5 -0
- package/dist/ui/aspect-ratio.js +9 -0
- package/dist/ui/avatar.d.ts +14 -0
- package/dist/ui/avatar.js +49 -0
- package/dist/ui/badge.d.ts +22 -0
- package/dist/ui/badge.js +26 -0
- package/dist/ui/breadcrumb.d.ts +13 -0
- package/dist/ui/breadcrumb.js +29 -0
- package/dist/ui/button-group.d.ts +21 -0
- package/dist/ui/button-group.js +29 -0
- package/dist/ui/button.d.ts +38 -0
- package/dist/ui/button.js +49 -0
- package/dist/ui/calendar.d.ts +13 -0
- package/dist/ui/calendar.js +75 -0
- package/dist/ui/card.d.ts +11 -0
- package/dist/ui/card.js +25 -0
- package/dist/ui/checkbox.d.ts +17 -0
- package/dist/ui/checkbox.js +25 -0
- package/dist/ui/collapsible.d.ts +11 -0
- package/dist/ui/collapsible.js +40 -0
- package/dist/ui/command.d.ts +19 -0
- package/dist/ui/command.js +35 -0
- package/dist/ui/context-menu.d.ts +53 -0
- package/dist/ui/context-menu.js +345 -0
- package/dist/ui/dialog.d.ts +40 -0
- package/dist/ui/dialog.js +109 -0
- package/dist/ui/drawer.d.ts +36 -0
- package/dist/ui/drawer.js +234 -0
- package/dist/ui/dropdown-menu.d.ts +61 -0
- package/dist/ui/dropdown-menu.js +323 -0
- package/dist/ui/empty.d.ts +14 -0
- package/dist/ui/empty.js +33 -0
- package/dist/ui/field.d.ts +28 -0
- package/dist/ui/field.js +68 -0
- package/dist/ui/hover-card.d.ts +32 -0
- package/dist/ui/hover-card.js +119 -0
- package/dist/ui/input-group.d.ts +28 -0
- package/dist/ui/input-group.js +58 -0
- package/dist/ui/input.d.ts +3 -0
- package/dist/ui/input.js +7 -0
- package/dist/ui/item.d.ts +41 -0
- package/dist/ui/item.js +69 -0
- package/dist/ui/kbd.d.ts +4 -0
- package/dist/ui/kbd.js +10 -0
- package/dist/ui/label.d.ts +3 -0
- package/dist/ui/label.js +8 -0
- package/dist/ui/menubar.d.ts +59 -0
- package/dist/ui/menubar.js +384 -0
- package/dist/ui/navigation-menu.d.ts +24 -0
- package/dist/ui/navigation-menu.js +134 -0
- package/dist/ui/pagination.d.ts +17 -0
- package/dist/ui/pagination.js +36 -0
- package/dist/ui/popover.d.ts +25 -0
- package/dist/ui/popover.js +68 -0
- package/dist/ui/portal.d.ts +7 -0
- package/dist/ui/portal.js +12 -0
- package/dist/ui/progress.d.ts +15 -0
- package/dist/ui/progress.js +36 -0
- package/dist/ui/radio-group.d.ts +17 -0
- package/dist/ui/radio-group.js +54 -0
- package/dist/ui/scroll-area.d.ts +9 -0
- package/dist/ui/scroll-area.js +72 -0
- package/dist/ui/select.d.ts +37 -0
- package/dist/ui/select.js +216 -0
- package/dist/ui/separator.d.ts +14 -0
- package/dist/ui/separator.js +13 -0
- package/dist/ui/sheet.d.ts +31 -0
- package/dist/ui/sheet.js +121 -0
- package/dist/ui/sidebar.d.ts +86 -0
- package/dist/ui/sidebar.js +211 -0
- package/dist/ui/skeleton.d.ts +3 -0
- package/dist/ui/skeleton.js +7 -0
- package/dist/ui/slider.d.ts +18 -0
- package/dist/ui/slider.js +94 -0
- package/dist/ui/slot.d.ts +27 -0
- package/dist/ui/slot.js +62 -0
- package/dist/ui/spinner.d.ts +3 -0
- package/dist/ui/spinner.js +8 -0
- package/dist/ui/switch.d.ts +17 -0
- package/dist/ui/switch.js +23 -0
- package/dist/ui/table.d.ts +10 -0
- package/dist/ui/table.js +29 -0
- package/dist/ui/tabs.d.ts +29 -0
- package/dist/ui/tabs.js +82 -0
- package/dist/ui/textarea.d.ts +3 -0
- package/dist/ui/textarea.js +7 -0
- package/dist/ui/toggle-group.d.ts +23 -0
- package/dist/ui/toggle-group.js +52 -0
- package/dist/ui/toggle.d.ts +25 -0
- package/dist/ui/toggle.js +41 -0
- package/dist/ui/tooltip.d.ts +25 -0
- package/dist/ui/tooltip.js +90 -0
- package/dist/ui/use-controllable-state.d.ts +10 -0
- package/dist/ui/use-controllable-state.js +17 -0
- package/dist/ui/use-dismiss.d.ts +10 -0
- package/dist/ui/use-dismiss.js +51 -0
- package/dist/ui/use-floating.d.ts +38 -0
- package/dist/ui/use-floating.js +128 -0
- package/dist/ui/use-presence.d.ts +8 -0
- package/dist/ui/use-presence.js +48 -0
- package/package.json +6 -1
- package/dist/shadcn/lib/base-ui/LICENSE +0 -21
- package/dist/shadcn/lib/base-ui/_chunk-000kmre8.js +0 -150
- package/dist/shadcn/lib/base-ui/_chunk-1vw45v38.js +0 -64
- package/dist/shadcn/lib/base-ui/_chunk-23rx7haq.js +0 -81
- package/dist/shadcn/lib/base-ui/_chunk-242gh8ph.js +0 -230
- package/dist/shadcn/lib/base-ui/_chunk-26cc610z.js +0 -6
- package/dist/shadcn/lib/base-ui/_chunk-2z044bba.js +0 -5890
- package/dist/shadcn/lib/base-ui/_chunk-3cpd1vjz.js +0 -13
- package/dist/shadcn/lib/base-ui/_chunk-3enq1vat.js +0 -82
- package/dist/shadcn/lib/base-ui/_chunk-3xpke33f.js +0 -23
- package/dist/shadcn/lib/base-ui/_chunk-451nqgsa.js +0 -6
- package/dist/shadcn/lib/base-ui/_chunk-4maf6pas.js +0 -11
- package/dist/shadcn/lib/base-ui/_chunk-4zhfq4d3.js +0 -16
- package/dist/shadcn/lib/base-ui/_chunk-5gaqyne5.js +0 -21
- package/dist/shadcn/lib/base-ui/_chunk-5tt5hk59.js +0 -4
- package/dist/shadcn/lib/base-ui/_chunk-5tze5c8q.js +0 -13
- package/dist/shadcn/lib/base-ui/_chunk-5xmdvndx.js +0 -225
- package/dist/shadcn/lib/base-ui/_chunk-6adaer33.js +0 -435
- package/dist/shadcn/lib/base-ui/_chunk-6ejf1z1r.js +0 -9
- package/dist/shadcn/lib/base-ui/_chunk-6kqramh9.js +0 -27
- package/dist/shadcn/lib/base-ui/_chunk-7b9dc493.js +0 -14
- package/dist/shadcn/lib/base-ui/_chunk-8a9vv8am.js +0 -89
- package/dist/shadcn/lib/base-ui/_chunk-8ctgmf06.js +0 -129
- package/dist/shadcn/lib/base-ui/_chunk-8ganmsbg.js +0 -54
- package/dist/shadcn/lib/base-ui/_chunk-8xaqxgck.js +0 -15
- package/dist/shadcn/lib/base-ui/_chunk-95tf2rxq.js +0 -62
- package/dist/shadcn/lib/base-ui/_chunk-9x63vfqj.js +0 -70
- package/dist/shadcn/lib/base-ui/_chunk-ase0ydtt.js +0 -9
- package/dist/shadcn/lib/base-ui/_chunk-b0nc8wq7.js +0 -34
- package/dist/shadcn/lib/base-ui/_chunk-b5ya6xds.js +0 -10
- package/dist/shadcn/lib/base-ui/_chunk-b6dkjkbw.js +0 -43
- package/dist/shadcn/lib/base-ui/_chunk-c2bz952e.js +0 -19
- package/dist/shadcn/lib/base-ui/_chunk-cdgfsr3q.js +0 -15
- package/dist/shadcn/lib/base-ui/_chunk-cdj8cpx5.js +0 -347
- package/dist/shadcn/lib/base-ui/_chunk-cgptgywc.js +0 -104
- package/dist/shadcn/lib/base-ui/_chunk-cwvtvwc7.js +0 -35
- package/dist/shadcn/lib/base-ui/_chunk-dan0mva4.js +0 -23
- package/dist/shadcn/lib/base-ui/_chunk-dzvjwv25.js +0 -0
- package/dist/shadcn/lib/base-ui/_chunk-e13rsb6b.js +0 -184
- package/dist/shadcn/lib/base-ui/_chunk-e56mpvk1.js +0 -118
- package/dist/shadcn/lib/base-ui/_chunk-e6k2ecs7.js +0 -48
- package/dist/shadcn/lib/base-ui/_chunk-ebyxgtb4.js +0 -29
- package/dist/shadcn/lib/base-ui/_chunk-f2wttwrf.js +0 -39
- package/dist/shadcn/lib/base-ui/_chunk-fdzctasg.js +0 -38
- package/dist/shadcn/lib/base-ui/_chunk-ffpjy0ta.js +0 -39
- package/dist/shadcn/lib/base-ui/_chunk-fqry7pew.js +0 -603
- package/dist/shadcn/lib/base-ui/_chunk-ghn1tzt8.js +0 -84
- package/dist/shadcn/lib/base-ui/_chunk-gy0bpkmx.js +0 -12
- package/dist/shadcn/lib/base-ui/_chunk-hm5h9vsk.js +0 -16
- package/dist/shadcn/lib/base-ui/_chunk-htdj1jps.js +0 -833
- package/dist/shadcn/lib/base-ui/_chunk-j29xjete.js +0 -146
- package/dist/shadcn/lib/base-ui/_chunk-j3qkyd10.js +0 -50
- package/dist/shadcn/lib/base-ui/_chunk-ktvsd5k6.js +0 -2386
- package/dist/shadcn/lib/base-ui/_chunk-kw8nnq00.js +0 -546
- package/dist/shadcn/lib/base-ui/_chunk-m307wpdj.js +0 -18
- package/dist/shadcn/lib/base-ui/_chunk-mnd0j7v9.js +0 -15
- package/dist/shadcn/lib/base-ui/_chunk-n11h505c.js +0 -32
- package/dist/shadcn/lib/base-ui/_chunk-p0e2qacz.js +0 -26
- package/dist/shadcn/lib/base-ui/_chunk-pv7b791x.js +0 -106
- package/dist/shadcn/lib/base-ui/_chunk-q5cg71p7.js +0 -83
- package/dist/shadcn/lib/base-ui/_chunk-qbezxj1g.js +0 -385
- package/dist/shadcn/lib/base-ui/_chunk-qmsqz6nt.js +0 -15
- package/dist/shadcn/lib/base-ui/_chunk-rrh8rt4v.js +0 -65
- package/dist/shadcn/lib/base-ui/_chunk-s5pwkz8v.js +0 -25
- package/dist/shadcn/lib/base-ui/_chunk-svxv97ph.js +0 -218
- package/dist/shadcn/lib/base-ui/_chunk-t7ppm3t0.js +0 -68
- package/dist/shadcn/lib/base-ui/_chunk-vg16xxmb.js +0 -52
- package/dist/shadcn/lib/base-ui/_chunk-vgkfmtbe.js +0 -21
- package/dist/shadcn/lib/base-ui/_chunk-watha94s.js +0 -14
- package/dist/shadcn/lib/base-ui/_chunk-wdqynnjf.js +0 -35
- package/dist/shadcn/lib/base-ui/_chunk-wx2nxg0p.js +0 -15
- package/dist/shadcn/lib/base-ui/_chunk-x11e1k9r.js +0 -0
- package/dist/shadcn/lib/base-ui/_chunk-x8xehj6d.js +0 -302
- package/dist/shadcn/lib/base-ui/_chunk-xcqbtm2f.js +0 -28
- package/dist/shadcn/lib/base-ui/_chunk-ytnp24gq.js +0 -328
- package/dist/shadcn/lib/base-ui/_chunk-yzr7eg4b.js +0 -6
- package/dist/shadcn/lib/base-ui/_chunk-zk4mtm9m.js +0 -9
- package/dist/shadcn/lib/base-ui/accordion.d.ts +0 -447
- package/dist/shadcn/lib/base-ui/accordion.js +0 -630
- package/dist/shadcn/lib/base-ui/alert-dialog.d.ts +0 -1467
- package/dist/shadcn/lib/base-ui/alert-dialog.js +0 -98
- package/dist/shadcn/lib/base-ui/avatar.d.ts +0 -123
- package/dist/shadcn/lib/base-ui/avatar.js +0 -235
- package/dist/shadcn/lib/base-ui/button.d.ts +0 -84
- package/dist/shadcn/lib/base-ui/button.js +0 -51
- package/dist/shadcn/lib/base-ui/checkbox.d.ts +0 -341
- package/dist/shadcn/lib/base-ui/checkbox.js +0 -501
- package/dist/shadcn/lib/base-ui/collapsible.d.ts +0 -291
- package/dist/shadcn/lib/base-ui/collapsible.js +0 -264
- package/dist/shadcn/lib/base-ui/context-menu.d.ts +0 -2213
- package/dist/shadcn/lib/base-ui/context-menu.js +0 -323
- package/dist/shadcn/lib/base-ui/dialog.d.ts +0 -1448
- package/dist/shadcn/lib/base-ui/dialog.js +0 -79
- package/dist/shadcn/lib/base-ui/input.d.ts +0 -506
- package/dist/shadcn/lib/base-ui/input.js +0 -1027
- package/dist/shadcn/lib/base-ui/menu.d.ts +0 -2275
- package/dist/shadcn/lib/base-ui/menu.js +0 -60
- package/dist/shadcn/lib/base-ui/menubar.d.ts +0 -48
- package/dist/shadcn/lib/base-ui/menubar.js +0 -156
- package/dist/shadcn/lib/base-ui/merge-props.d.ts +0 -70
- package/dist/shadcn/lib/base-ui/merge-props.js +0 -15
- package/dist/shadcn/lib/base-ui/navigation-menu.d.ts +0 -825
- package/dist/shadcn/lib/base-ui/navigation-menu.js +0 -1849
- package/dist/shadcn/lib/base-ui/popover.d.ts +0 -1743
- package/dist/shadcn/lib/base-ui/popover.js +0 -1089
- package/dist/shadcn/lib/base-ui/preview-card.d.ts +0 -1608
- package/dist/shadcn/lib/base-ui/preview-card.js +0 -919
- package/dist/shadcn/lib/base-ui/progress.d.ts +0 -172
- package/dist/shadcn/lib/base-ui/progress.js +0 -272
- package/dist/shadcn/lib/base-ui/radio-group.d.ts +0 -260
- package/dist/shadcn/lib/base-ui/radio-group.js +0 -239
- package/dist/shadcn/lib/base-ui/radio.d.ts +0 -176
- package/dist/shadcn/lib/base-ui/radio.js +0 -387
- package/dist/shadcn/lib/base-ui/scroll-area.d.ts +0 -241
- package/dist/shadcn/lib/base-ui/scroll-area.js +0 -1055
- package/dist/shadcn/lib/base-ui/select.d.ts +0 -1266
- package/dist/shadcn/lib/base-ui/select.js +0 -2450
- package/dist/shadcn/lib/base-ui/separator.d.ts +0 -76
- package/dist/shadcn/lib/base-ui/separator.js +0 -11
- package/dist/shadcn/lib/base-ui/slider.d.ts +0 -551
- package/dist/shadcn/lib/base-ui/slider.js +0 -1583
- package/dist/shadcn/lib/base-ui/switch.d.ts +0 -313
- package/dist/shadcn/lib/base-ui/switch.js +0 -326
- package/dist/shadcn/lib/base-ui/tabs.d.ts +0 -406
- package/dist/shadcn/lib/base-ui/tabs.js +0 -915
- package/dist/shadcn/lib/base-ui/toggle-group.d.ts +0 -235
- package/dist/shadcn/lib/base-ui/toggle-group.js +0 -145
- package/dist/shadcn/lib/base-ui/toggle.d.ts +0 -224
- package/dist/shadcn/lib/base-ui/toggle.js +0 -127
- package/dist/shadcn/lib/base-ui/tooltip.d.ts +0 -1656
- package/dist/shadcn/lib/base-ui/tooltip.js +0 -920
- package/dist/shadcn/lib/base-ui/use-render.d.ts +0 -87
- package/dist/shadcn/lib/base-ui/use-render.js +0 -15
|
@@ -1,2386 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getPseudoElementBounds
|
|
3
|
-
} from "./_chunk-b0nc8wq7.js";
|
|
4
|
-
import {
|
|
5
|
-
Separator
|
|
6
|
-
} from "./_chunk-n11h505c.js";
|
|
7
|
-
import {
|
|
8
|
-
useMenubarContext
|
|
9
|
-
} from "./_chunk-wx2nxg0p.js";
|
|
10
|
-
import {
|
|
11
|
-
CompositeItem
|
|
12
|
-
} from "./_chunk-f2wttwrf.js";
|
|
13
|
-
import {
|
|
14
|
-
useTriggerFocusGuards
|
|
15
|
-
} from "./_chunk-8ganmsbg.js";
|
|
16
|
-
import {
|
|
17
|
-
useAnchoredPopupScrollLock
|
|
18
|
-
} from "./_chunk-ebyxgtb4.js";
|
|
19
|
-
import {
|
|
20
|
-
useToolbarRootContext
|
|
21
|
-
} from "./_chunk-mnd0j7v9.js";
|
|
22
|
-
import {
|
|
23
|
-
usePopupViewport
|
|
24
|
-
} from "./_chunk-qbezxj1g.js";
|
|
25
|
-
import {
|
|
26
|
-
adaptiveOrigin,
|
|
27
|
-
getDisabledMountTransitionStyles,
|
|
28
|
-
useAnchorPositioning,
|
|
29
|
-
usePositioner
|
|
30
|
-
} from "./_chunk-fqry7pew.js";
|
|
31
|
-
import {
|
|
32
|
-
useCompositeListItem
|
|
33
|
-
} from "./_chunk-3enq1vat.js";
|
|
34
|
-
import {
|
|
35
|
-
isElementDisabled
|
|
36
|
-
} from "./_chunk-26cc610z.js";
|
|
37
|
-
import {
|
|
38
|
-
CompositeList
|
|
39
|
-
} from "./_chunk-j29xjete.js";
|
|
40
|
-
import {
|
|
41
|
-
useDirection
|
|
42
|
-
} from "./_chunk-gy0bpkmx.js";
|
|
43
|
-
import {
|
|
44
|
-
useControlled
|
|
45
|
-
} from "./_chunk-9x63vfqj.js";
|
|
46
|
-
import {
|
|
47
|
-
InternalBackdrop,
|
|
48
|
-
useOpenInteractionType
|
|
49
|
-
} from "./_chunk-ytnp24gq.js";
|
|
50
|
-
import {
|
|
51
|
-
createInitialPopupStoreState,
|
|
52
|
-
popupStoreSelectors
|
|
53
|
-
} from "./_chunk-q5cg71p7.js";
|
|
54
|
-
import {
|
|
55
|
-
FOCUSABLE_POPUP_PROPS,
|
|
56
|
-
useImplicitActiveTrigger,
|
|
57
|
-
useOnFirstRender,
|
|
58
|
-
useOpenStateTransitions,
|
|
59
|
-
usePopupInteractionProps,
|
|
60
|
-
useTriggerDataForwarding,
|
|
61
|
-
useTriggerRegistration
|
|
62
|
-
} from "./_chunk-242gh8ph.js";
|
|
63
|
-
import {
|
|
64
|
-
popupStateMapping,
|
|
65
|
-
pressableTriggerOpenStateMapping,
|
|
66
|
-
triggerOpenStateMapping
|
|
67
|
-
} from "./_chunk-t7ppm3t0.js";
|
|
68
|
-
import {
|
|
69
|
-
inertValue
|
|
70
|
-
} from "./_chunk-3cpd1vjz.js";
|
|
71
|
-
import {
|
|
72
|
-
DROPDOWN_COLLISION_AVOIDANCE,
|
|
73
|
-
FloatingFocusManager,
|
|
74
|
-
FloatingNode,
|
|
75
|
-
FloatingPortal,
|
|
76
|
-
FloatingTree,
|
|
77
|
-
FloatingTreeStore,
|
|
78
|
-
FocusGuard,
|
|
79
|
-
PATIENT_CLICK_THRESHOLD,
|
|
80
|
-
POPUP_COLLISION_AVOIDANCE,
|
|
81
|
-
PopupTriggerMap,
|
|
82
|
-
ReactStore,
|
|
83
|
-
TYPEAHEAD_RESET_MS,
|
|
84
|
-
createSelector,
|
|
85
|
-
fastComponent,
|
|
86
|
-
fastComponentRef,
|
|
87
|
-
safePolygon,
|
|
88
|
-
useClick,
|
|
89
|
-
useDismiss,
|
|
90
|
-
useFloatingNodeId,
|
|
91
|
-
useFloatingParentNodeId,
|
|
92
|
-
useFloatingTree,
|
|
93
|
-
useFocus,
|
|
94
|
-
useHoverFloatingInteraction,
|
|
95
|
-
useHoverReferenceInteraction,
|
|
96
|
-
useListNavigation,
|
|
97
|
-
useSyncedFloatingRootContext,
|
|
98
|
-
useTypeahead
|
|
99
|
-
} from "./_chunk-2z044bba.js";
|
|
100
|
-
import {
|
|
101
|
-
contains
|
|
102
|
-
} from "./_chunk-cgptgywc.js";
|
|
103
|
-
import {
|
|
104
|
-
COMPOSITE_KEYS
|
|
105
|
-
} from "./_chunk-pv7b791x.js";
|
|
106
|
-
import {
|
|
107
|
-
isMac
|
|
108
|
-
} from "./_chunk-rrh8rt4v.js";
|
|
109
|
-
import {
|
|
110
|
-
useTimeout
|
|
111
|
-
} from "./_chunk-b6dkjkbw.js";
|
|
112
|
-
import {
|
|
113
|
-
ownerDocument
|
|
114
|
-
} from "./_chunk-451nqgsa.js";
|
|
115
|
-
import {
|
|
116
|
-
createChangeEventDetails,
|
|
117
|
-
exports_reason_parts
|
|
118
|
-
} from "./_chunk-e56mpvk1.js";
|
|
119
|
-
import {
|
|
120
|
-
useBaseUiId,
|
|
121
|
-
useId
|
|
122
|
-
} from "./_chunk-wdqynnjf.js";
|
|
123
|
-
import {
|
|
124
|
-
transitionStatusMapping,
|
|
125
|
-
useAnimationsFinished,
|
|
126
|
-
useOpenChangeComplete,
|
|
127
|
-
useTransitionStatus
|
|
128
|
-
} from "./_chunk-e13rsb6b.js";
|
|
129
|
-
import {
|
|
130
|
-
useButton
|
|
131
|
-
} from "./_chunk-5xmdvndx.js";
|
|
132
|
-
import {
|
|
133
|
-
useCompositeRootContext
|
|
134
|
-
} from "./_chunk-cdgfsr3q.js";
|
|
135
|
-
import {
|
|
136
|
-
getParentNode,
|
|
137
|
-
isHTMLElement,
|
|
138
|
-
isLastTraversableNode
|
|
139
|
-
} from "./_chunk-000kmre8.js";
|
|
140
|
-
import {
|
|
141
|
-
useStableCallback
|
|
142
|
-
} from "./_chunk-cwvtvwc7.js";
|
|
143
|
-
import {
|
|
144
|
-
SafeReact,
|
|
145
|
-
useIsoLayoutEffect
|
|
146
|
-
} from "./_chunk-5tze5c8q.js";
|
|
147
|
-
import {
|
|
148
|
-
EMPTY_ARRAY,
|
|
149
|
-
EMPTY_OBJECT,
|
|
150
|
-
useMergedRefs,
|
|
151
|
-
useRefWithInit,
|
|
152
|
-
useRenderElement,
|
|
153
|
-
warn
|
|
154
|
-
} from "./_chunk-x8xehj6d.js";
|
|
155
|
-
import {
|
|
156
|
-
__export,
|
|
157
|
-
mergeProps
|
|
158
|
-
} from "./_chunk-svxv97ph.js";
|
|
159
|
-
|
|
160
|
-
// node_modules/@base-ui/react/esm/menu/index.parts.js
|
|
161
|
-
var exports_index_parts = {};
|
|
162
|
-
__export(exports_index_parts, {
|
|
163
|
-
createHandle: () => createMenuHandle,
|
|
164
|
-
Viewport: () => MenuViewport,
|
|
165
|
-
Trigger: () => MenuTrigger,
|
|
166
|
-
SubmenuTrigger: () => MenuSubmenuTrigger,
|
|
167
|
-
SubmenuRoot: () => MenuSubmenuRoot,
|
|
168
|
-
Separator: () => Separator,
|
|
169
|
-
Root: () => MenuRoot,
|
|
170
|
-
RadioItemIndicator: () => MenuRadioItemIndicator,
|
|
171
|
-
RadioItem: () => MenuRadioItem,
|
|
172
|
-
RadioGroup: () => MenuRadioGroup,
|
|
173
|
-
Positioner: () => MenuPositioner,
|
|
174
|
-
Portal: () => MenuPortal,
|
|
175
|
-
Popup: () => MenuPopup,
|
|
176
|
-
LinkItem: () => MenuLinkItem,
|
|
177
|
-
Item: () => MenuItem,
|
|
178
|
-
Handle: () => MenuHandle,
|
|
179
|
-
GroupLabel: () => MenuGroupLabel,
|
|
180
|
-
Group: () => MenuGroup,
|
|
181
|
-
CheckboxItemIndicator: () => MenuCheckboxItemIndicator,
|
|
182
|
-
CheckboxItem: () => MenuCheckboxItem,
|
|
183
|
-
Backdrop: () => MenuBackdrop,
|
|
184
|
-
Arrow: () => MenuArrow
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
// node_modules/@base-ui/react/esm/menu/arrow/MenuArrow.js
|
|
188
|
-
import * as React3 from "react";
|
|
189
|
-
|
|
190
|
-
// node_modules/@base-ui/react/esm/menu/positioner/MenuPositionerContext.js
|
|
191
|
-
import * as React from "react";
|
|
192
|
-
"use client";
|
|
193
|
-
var MenuPositionerContext = /* @__PURE__ */ React.createContext(undefined);
|
|
194
|
-
if (true)
|
|
195
|
-
MenuPositionerContext.displayName = "MenuPositionerContext";
|
|
196
|
-
function useMenuPositionerContext(optional) {
|
|
197
|
-
const context = React.useContext(MenuPositionerContext);
|
|
198
|
-
if (context === undefined && !optional) {
|
|
199
|
-
throw new Error("Base UI: MenuPositionerContext is missing. MenuPositioner parts must be placed within <Menu.Positioner>.");
|
|
200
|
-
}
|
|
201
|
-
return context;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
// node_modules/@base-ui/react/esm/menu/root/MenuRootContext.js
|
|
205
|
-
import * as React2 from "react";
|
|
206
|
-
"use client";
|
|
207
|
-
var MenuRootContext = /* @__PURE__ */ React2.createContext(undefined);
|
|
208
|
-
if (true)
|
|
209
|
-
MenuRootContext.displayName = "MenuRootContext";
|
|
210
|
-
function useMenuRootContext(optional) {
|
|
211
|
-
const context = React2.useContext(MenuRootContext);
|
|
212
|
-
if (context === undefined && !optional) {
|
|
213
|
-
throw new Error("Base UI: MenuRootContext is missing. Menu parts must be placed within <Menu.Root>.");
|
|
214
|
-
}
|
|
215
|
-
return context;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
// node_modules/@base-ui/react/esm/menu/arrow/MenuArrow.js
|
|
219
|
-
"use client";
|
|
220
|
-
var MenuArrow = /* @__PURE__ */ React3.forwardRef(function MenuArrow2(componentProps, forwardedRef) {
|
|
221
|
-
const {
|
|
222
|
-
render,
|
|
223
|
-
className,
|
|
224
|
-
style,
|
|
225
|
-
...elementProps
|
|
226
|
-
} = componentProps;
|
|
227
|
-
const {
|
|
228
|
-
store
|
|
229
|
-
} = useMenuRootContext();
|
|
230
|
-
const {
|
|
231
|
-
arrowRef,
|
|
232
|
-
side,
|
|
233
|
-
align,
|
|
234
|
-
arrowUncentered,
|
|
235
|
-
arrowStyles
|
|
236
|
-
} = useMenuPositionerContext();
|
|
237
|
-
const open = store.useState("open");
|
|
238
|
-
const state = {
|
|
239
|
-
open,
|
|
240
|
-
side,
|
|
241
|
-
align,
|
|
242
|
-
uncentered: arrowUncentered
|
|
243
|
-
};
|
|
244
|
-
return useRenderElement("div", componentProps, {
|
|
245
|
-
ref: [arrowRef, forwardedRef],
|
|
246
|
-
stateAttributesMapping: popupStateMapping,
|
|
247
|
-
state,
|
|
248
|
-
props: {
|
|
249
|
-
style: arrowStyles,
|
|
250
|
-
"aria-hidden": true,
|
|
251
|
-
...elementProps
|
|
252
|
-
}
|
|
253
|
-
});
|
|
254
|
-
});
|
|
255
|
-
if (true)
|
|
256
|
-
MenuArrow.displayName = "MenuArrow";
|
|
257
|
-
// node_modules/@base-ui/react/esm/menu/backdrop/MenuBackdrop.js
|
|
258
|
-
import * as React5 from "react";
|
|
259
|
-
|
|
260
|
-
// node_modules/@base-ui/react/esm/context-menu/root/ContextMenuRootContext.js
|
|
261
|
-
import * as React4 from "react";
|
|
262
|
-
"use client";
|
|
263
|
-
var ContextMenuRootContext = /* @__PURE__ */ React4.createContext(undefined);
|
|
264
|
-
if (true)
|
|
265
|
-
ContextMenuRootContext.displayName = "ContextMenuRootContext";
|
|
266
|
-
function useContextMenuRootContext(optional = true) {
|
|
267
|
-
const context = React4.useContext(ContextMenuRootContext);
|
|
268
|
-
if (context === undefined && !optional) {
|
|
269
|
-
throw new Error("Base UI: ContextMenuRootContext is missing. ContextMenu parts must be placed within <ContextMenu.Root>.");
|
|
270
|
-
}
|
|
271
|
-
return context;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
// node_modules/@base-ui/react/esm/menu/backdrop/MenuBackdrop.js
|
|
275
|
-
"use client";
|
|
276
|
-
var stateAttributesMapping = {
|
|
277
|
-
...popupStateMapping,
|
|
278
|
-
...transitionStatusMapping
|
|
279
|
-
};
|
|
280
|
-
var MenuBackdrop = /* @__PURE__ */ React5.forwardRef(function MenuBackdrop2(componentProps, forwardedRef) {
|
|
281
|
-
const {
|
|
282
|
-
render,
|
|
283
|
-
className,
|
|
284
|
-
style,
|
|
285
|
-
...elementProps
|
|
286
|
-
} = componentProps;
|
|
287
|
-
const {
|
|
288
|
-
store
|
|
289
|
-
} = useMenuRootContext();
|
|
290
|
-
const open = store.useState("open");
|
|
291
|
-
const mounted = store.useState("mounted");
|
|
292
|
-
const transitionStatus = store.useState("transitionStatus");
|
|
293
|
-
const lastOpenChangeReason = store.useState("lastOpenChangeReason");
|
|
294
|
-
const contextMenuContext = useContextMenuRootContext();
|
|
295
|
-
const state = {
|
|
296
|
-
open,
|
|
297
|
-
transitionStatus
|
|
298
|
-
};
|
|
299
|
-
return useRenderElement("div", componentProps, {
|
|
300
|
-
ref: contextMenuContext?.backdropRef ? [forwardedRef, contextMenuContext.backdropRef] : forwardedRef,
|
|
301
|
-
state,
|
|
302
|
-
stateAttributesMapping,
|
|
303
|
-
props: [{
|
|
304
|
-
role: "presentation",
|
|
305
|
-
hidden: !mounted,
|
|
306
|
-
style: {
|
|
307
|
-
pointerEvents: lastOpenChangeReason === exports_reason_parts.triggerHover ? "none" : undefined,
|
|
308
|
-
userSelect: "none",
|
|
309
|
-
WebkitUserSelect: "none"
|
|
310
|
-
}
|
|
311
|
-
}, elementProps]
|
|
312
|
-
});
|
|
313
|
-
});
|
|
314
|
-
if (true)
|
|
315
|
-
MenuBackdrop.displayName = "MenuBackdrop";
|
|
316
|
-
// node_modules/@base-ui/react/esm/menu/checkbox-item/MenuCheckboxItem.js
|
|
317
|
-
import * as React9 from "react";
|
|
318
|
-
|
|
319
|
-
// node_modules/@base-ui/react/esm/menu/checkbox-item/MenuCheckboxItemContext.js
|
|
320
|
-
import * as React6 from "react";
|
|
321
|
-
"use client";
|
|
322
|
-
var MenuCheckboxItemContext = /* @__PURE__ */ React6.createContext(undefined);
|
|
323
|
-
if (true)
|
|
324
|
-
MenuCheckboxItemContext.displayName = "MenuCheckboxItemContext";
|
|
325
|
-
function useMenuCheckboxItemContext() {
|
|
326
|
-
const context = React6.useContext(MenuCheckboxItemContext);
|
|
327
|
-
if (context === undefined) {
|
|
328
|
-
throw new Error("Base UI: MenuCheckboxItemContext is missing. MenuCheckboxItem parts must be placed within <Menu.CheckboxItem>.");
|
|
329
|
-
}
|
|
330
|
-
return context;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
// node_modules/@base-ui/react/esm/menu/item/useMenuItem.js
|
|
334
|
-
import * as React8 from "react";
|
|
335
|
-
|
|
336
|
-
// node_modules/@base-ui/react/esm/menu/item/useMenuItemCommonProps.js
|
|
337
|
-
import * as React7 from "react";
|
|
338
|
-
"use client";
|
|
339
|
-
function useMenuItemCommonProps(params) {
|
|
340
|
-
const {
|
|
341
|
-
closeOnClick,
|
|
342
|
-
highlighted,
|
|
343
|
-
id,
|
|
344
|
-
nodeId,
|
|
345
|
-
store,
|
|
346
|
-
typingRef,
|
|
347
|
-
itemRef,
|
|
348
|
-
itemMetadata
|
|
349
|
-
} = params;
|
|
350
|
-
const {
|
|
351
|
-
events: menuEvents
|
|
352
|
-
} = store.useState("floatingTreeRoot");
|
|
353
|
-
const contextMenuContext = useContextMenuRootContext(true);
|
|
354
|
-
const isContextMenu = contextMenuContext !== undefined;
|
|
355
|
-
return React7.useMemo(() => ({
|
|
356
|
-
id,
|
|
357
|
-
role: "menuitem",
|
|
358
|
-
tabIndex: highlighted ? 0 : -1,
|
|
359
|
-
onKeyDown(event) {
|
|
360
|
-
if (event.key === " " && typingRef?.current) {
|
|
361
|
-
event.preventDefault();
|
|
362
|
-
}
|
|
363
|
-
},
|
|
364
|
-
onMouseMove(event) {
|
|
365
|
-
if (!nodeId) {
|
|
366
|
-
return;
|
|
367
|
-
}
|
|
368
|
-
menuEvents.emit("itemhover", {
|
|
369
|
-
nodeId,
|
|
370
|
-
target: event.currentTarget
|
|
371
|
-
});
|
|
372
|
-
},
|
|
373
|
-
onClick(event) {
|
|
374
|
-
if (closeOnClick) {
|
|
375
|
-
menuEvents.emit("close", {
|
|
376
|
-
domEvent: event,
|
|
377
|
-
reason: exports_reason_parts.itemPress
|
|
378
|
-
});
|
|
379
|
-
}
|
|
380
|
-
},
|
|
381
|
-
onMouseUp(event) {
|
|
382
|
-
if (contextMenuContext) {
|
|
383
|
-
const initialCursorPoint = contextMenuContext.initialCursorPointRef.current;
|
|
384
|
-
contextMenuContext.initialCursorPointRef.current = null;
|
|
385
|
-
if (isContextMenu && initialCursorPoint && Math.abs(event.clientX - initialCursorPoint.x) <= 1 && Math.abs(event.clientY - initialCursorPoint.y) <= 1) {
|
|
386
|
-
return;
|
|
387
|
-
}
|
|
388
|
-
if (isContextMenu && !isMac && event.button === 2) {
|
|
389
|
-
return;
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
if (itemRef.current && store.context.allowMouseUpTriggerRef.current && (!isContextMenu || event.button === 2)) {
|
|
393
|
-
if (!itemMetadata || itemMetadata.type === "regular-item") {
|
|
394
|
-
itemRef.current.click();
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
}), [closeOnClick, highlighted, id, menuEvents, nodeId, store, typingRef, itemRef, contextMenuContext, isContextMenu, itemMetadata]);
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
// node_modules/@base-ui/react/esm/menu/item/useMenuItem.js
|
|
402
|
-
"use client";
|
|
403
|
-
var REGULAR_ITEM = {
|
|
404
|
-
type: "regular-item"
|
|
405
|
-
};
|
|
406
|
-
function useMenuItem(params) {
|
|
407
|
-
const {
|
|
408
|
-
closeOnClick,
|
|
409
|
-
disabled = false,
|
|
410
|
-
highlighted,
|
|
411
|
-
id,
|
|
412
|
-
store,
|
|
413
|
-
typingRef = store.context.typingRef,
|
|
414
|
-
nativeButton,
|
|
415
|
-
itemMetadata,
|
|
416
|
-
nodeId
|
|
417
|
-
} = params;
|
|
418
|
-
const itemRef = React8.useRef(null);
|
|
419
|
-
const {
|
|
420
|
-
getButtonProps,
|
|
421
|
-
buttonRef
|
|
422
|
-
} = useButton({
|
|
423
|
-
disabled,
|
|
424
|
-
focusableWhenDisabled: true,
|
|
425
|
-
native: nativeButton,
|
|
426
|
-
composite: true
|
|
427
|
-
});
|
|
428
|
-
const commonProps = useMenuItemCommonProps({
|
|
429
|
-
closeOnClick,
|
|
430
|
-
highlighted,
|
|
431
|
-
id,
|
|
432
|
-
nodeId,
|
|
433
|
-
store,
|
|
434
|
-
typingRef,
|
|
435
|
-
itemRef,
|
|
436
|
-
itemMetadata
|
|
437
|
-
});
|
|
438
|
-
const getItemProps = React8.useCallback((externalProps) => {
|
|
439
|
-
return mergeProps(commonProps, {
|
|
440
|
-
onMouseEnter() {
|
|
441
|
-
if (itemMetadata.type !== "submenu-trigger") {
|
|
442
|
-
return;
|
|
443
|
-
}
|
|
444
|
-
itemMetadata.setActive();
|
|
445
|
-
}
|
|
446
|
-
}, externalProps, getButtonProps);
|
|
447
|
-
}, [commonProps, getButtonProps, itemMetadata]);
|
|
448
|
-
const mergedRef = useMergedRefs(itemRef, buttonRef);
|
|
449
|
-
return React8.useMemo(() => ({
|
|
450
|
-
getItemProps,
|
|
451
|
-
itemRef: mergedRef
|
|
452
|
-
}), [getItemProps, mergedRef]);
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
// node_modules/@base-ui/react/esm/menu/checkbox-item/MenuCheckboxItemDataAttributes.js
|
|
456
|
-
var MenuCheckboxItemDataAttributes = /* @__PURE__ */ function(MenuCheckboxItemDataAttributes2) {
|
|
457
|
-
MenuCheckboxItemDataAttributes2["checked"] = "data-checked";
|
|
458
|
-
MenuCheckboxItemDataAttributes2["unchecked"] = "data-unchecked";
|
|
459
|
-
MenuCheckboxItemDataAttributes2["disabled"] = "data-disabled";
|
|
460
|
-
MenuCheckboxItemDataAttributes2["highlighted"] = "data-highlighted";
|
|
461
|
-
return MenuCheckboxItemDataAttributes2;
|
|
462
|
-
}({});
|
|
463
|
-
|
|
464
|
-
// node_modules/@base-ui/react/esm/menu/utils/stateAttributesMapping.js
|
|
465
|
-
var itemMapping = {
|
|
466
|
-
checked(value) {
|
|
467
|
-
if (value) {
|
|
468
|
-
return {
|
|
469
|
-
[MenuCheckboxItemDataAttributes.checked]: ""
|
|
470
|
-
};
|
|
471
|
-
}
|
|
472
|
-
return {
|
|
473
|
-
[MenuCheckboxItemDataAttributes.unchecked]: ""
|
|
474
|
-
};
|
|
475
|
-
},
|
|
476
|
-
...transitionStatusMapping
|
|
477
|
-
};
|
|
478
|
-
|
|
479
|
-
// node_modules/@base-ui/react/esm/menu/checkbox-item/MenuCheckboxItem.js
|
|
480
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
481
|
-
"use client";
|
|
482
|
-
var MenuCheckboxItem = /* @__PURE__ */ React9.forwardRef(function MenuCheckboxItem2(componentProps, forwardedRef) {
|
|
483
|
-
const {
|
|
484
|
-
render,
|
|
485
|
-
className,
|
|
486
|
-
id: idProp,
|
|
487
|
-
label,
|
|
488
|
-
nativeButton = false,
|
|
489
|
-
disabled = false,
|
|
490
|
-
closeOnClick = false,
|
|
491
|
-
checked: checkedProp,
|
|
492
|
-
defaultChecked,
|
|
493
|
-
onCheckedChange,
|
|
494
|
-
style,
|
|
495
|
-
...elementProps
|
|
496
|
-
} = componentProps;
|
|
497
|
-
const listItem = useCompositeListItem({
|
|
498
|
-
label
|
|
499
|
-
});
|
|
500
|
-
const menuPositionerContext = useMenuPositionerContext(true);
|
|
501
|
-
const id = useBaseUiId(idProp);
|
|
502
|
-
const {
|
|
503
|
-
store
|
|
504
|
-
} = useMenuRootContext();
|
|
505
|
-
const highlighted = store.useState("isActive", listItem.index);
|
|
506
|
-
const itemProps = store.useState("itemProps");
|
|
507
|
-
const [checked, setChecked] = useControlled({
|
|
508
|
-
controlled: checkedProp,
|
|
509
|
-
default: defaultChecked ?? false,
|
|
510
|
-
name: "MenuCheckboxItem",
|
|
511
|
-
state: "checked"
|
|
512
|
-
});
|
|
513
|
-
const {
|
|
514
|
-
getItemProps,
|
|
515
|
-
itemRef
|
|
516
|
-
} = useMenuItem({
|
|
517
|
-
closeOnClick,
|
|
518
|
-
disabled,
|
|
519
|
-
highlighted,
|
|
520
|
-
id,
|
|
521
|
-
store,
|
|
522
|
-
nativeButton,
|
|
523
|
-
nodeId: menuPositionerContext?.context.nodeId,
|
|
524
|
-
itemMetadata: REGULAR_ITEM
|
|
525
|
-
});
|
|
526
|
-
const state = React9.useMemo(() => ({
|
|
527
|
-
disabled,
|
|
528
|
-
highlighted,
|
|
529
|
-
checked
|
|
530
|
-
}), [disabled, highlighted, checked]);
|
|
531
|
-
function handleClick(event) {
|
|
532
|
-
const details = createChangeEventDetails(exports_reason_parts.itemPress, event.nativeEvent, undefined, {
|
|
533
|
-
preventUnmountOnClose() {}
|
|
534
|
-
});
|
|
535
|
-
onCheckedChange?.(!checked, details);
|
|
536
|
-
if (details.isCanceled) {
|
|
537
|
-
return;
|
|
538
|
-
}
|
|
539
|
-
setChecked((currentlyChecked) => !currentlyChecked);
|
|
540
|
-
}
|
|
541
|
-
const element = useRenderElement("div", componentProps, {
|
|
542
|
-
state,
|
|
543
|
-
stateAttributesMapping: itemMapping,
|
|
544
|
-
props: [itemProps, {
|
|
545
|
-
role: "menuitemcheckbox",
|
|
546
|
-
"aria-checked": checked,
|
|
547
|
-
onClick: handleClick
|
|
548
|
-
}, elementProps, getItemProps],
|
|
549
|
-
ref: [itemRef, forwardedRef, listItem.ref]
|
|
550
|
-
});
|
|
551
|
-
return /* @__PURE__ */ _jsx(MenuCheckboxItemContext.Provider, {
|
|
552
|
-
value: state,
|
|
553
|
-
children: element
|
|
554
|
-
});
|
|
555
|
-
});
|
|
556
|
-
if (true)
|
|
557
|
-
MenuCheckboxItem.displayName = "MenuCheckboxItem";
|
|
558
|
-
// node_modules/@base-ui/react/esm/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.js
|
|
559
|
-
import * as React10 from "react";
|
|
560
|
-
"use client";
|
|
561
|
-
var MenuCheckboxItemIndicator = /* @__PURE__ */ React10.forwardRef(function MenuCheckboxItemIndicator2(componentProps, forwardedRef) {
|
|
562
|
-
const {
|
|
563
|
-
render,
|
|
564
|
-
className,
|
|
565
|
-
style,
|
|
566
|
-
keepMounted = false,
|
|
567
|
-
...elementProps
|
|
568
|
-
} = componentProps;
|
|
569
|
-
const item = useMenuCheckboxItemContext();
|
|
570
|
-
const indicatorRef = React10.useRef(null);
|
|
571
|
-
const {
|
|
572
|
-
transitionStatus,
|
|
573
|
-
setMounted
|
|
574
|
-
} = useTransitionStatus(item.checked);
|
|
575
|
-
useOpenChangeComplete({
|
|
576
|
-
open: item.checked,
|
|
577
|
-
ref: indicatorRef,
|
|
578
|
-
onComplete() {
|
|
579
|
-
if (!item.checked) {
|
|
580
|
-
setMounted(false);
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
});
|
|
584
|
-
const state = {
|
|
585
|
-
checked: item.checked,
|
|
586
|
-
disabled: item.disabled,
|
|
587
|
-
highlighted: item.highlighted,
|
|
588
|
-
transitionStatus
|
|
589
|
-
};
|
|
590
|
-
const element = useRenderElement("span", componentProps, {
|
|
591
|
-
state,
|
|
592
|
-
ref: [forwardedRef, indicatorRef],
|
|
593
|
-
stateAttributesMapping: itemMapping,
|
|
594
|
-
props: {
|
|
595
|
-
"aria-hidden": true,
|
|
596
|
-
...elementProps
|
|
597
|
-
},
|
|
598
|
-
enabled: keepMounted || item.checked
|
|
599
|
-
});
|
|
600
|
-
return element;
|
|
601
|
-
});
|
|
602
|
-
if (true)
|
|
603
|
-
MenuCheckboxItemIndicator.displayName = "MenuCheckboxItemIndicator";
|
|
604
|
-
// node_modules/@base-ui/react/esm/menu/group/MenuGroup.js
|
|
605
|
-
import * as React12 from "react";
|
|
606
|
-
|
|
607
|
-
// node_modules/@base-ui/react/esm/menu/group/MenuGroupContext.js
|
|
608
|
-
import * as React11 from "react";
|
|
609
|
-
"use client";
|
|
610
|
-
var MenuGroupContext = /* @__PURE__ */ React11.createContext(undefined);
|
|
611
|
-
if (true)
|
|
612
|
-
MenuGroupContext.displayName = "MenuGroupContext";
|
|
613
|
-
function useMenuGroupRootContext() {
|
|
614
|
-
const context = React11.useContext(MenuGroupContext);
|
|
615
|
-
if (context === undefined) {
|
|
616
|
-
throw new Error("Base UI: MenuGroupContext is missing. Menu group parts must be used within <Menu.Group> or <Menu.RadioGroup>.");
|
|
617
|
-
}
|
|
618
|
-
return context;
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
// node_modules/@base-ui/react/esm/menu/group/MenuGroup.js
|
|
622
|
-
import { jsx as _jsx2 } from "react/jsx-runtime";
|
|
623
|
-
"use client";
|
|
624
|
-
var MenuGroup = /* @__PURE__ */ React12.forwardRef(function MenuGroup2(componentProps, forwardedRef) {
|
|
625
|
-
const {
|
|
626
|
-
render,
|
|
627
|
-
className,
|
|
628
|
-
style,
|
|
629
|
-
...elementProps
|
|
630
|
-
} = componentProps;
|
|
631
|
-
const [labelId, setLabelId] = React12.useState(undefined);
|
|
632
|
-
const element = useRenderElement("div", componentProps, {
|
|
633
|
-
ref: forwardedRef,
|
|
634
|
-
props: {
|
|
635
|
-
role: "group",
|
|
636
|
-
"aria-labelledby": labelId,
|
|
637
|
-
...elementProps
|
|
638
|
-
}
|
|
639
|
-
});
|
|
640
|
-
return /* @__PURE__ */ _jsx2(MenuGroupContext.Provider, {
|
|
641
|
-
value: setLabelId,
|
|
642
|
-
children: element
|
|
643
|
-
});
|
|
644
|
-
});
|
|
645
|
-
if (true)
|
|
646
|
-
MenuGroup.displayName = "MenuGroup";
|
|
647
|
-
// node_modules/@base-ui/react/esm/menu/group-label/MenuGroupLabel.js
|
|
648
|
-
import * as React13 from "react";
|
|
649
|
-
"use client";
|
|
650
|
-
var MenuGroupLabel = /* @__PURE__ */ React13.forwardRef(function MenuGroupLabel2(componentProps, forwardedRef) {
|
|
651
|
-
const {
|
|
652
|
-
render,
|
|
653
|
-
className,
|
|
654
|
-
style,
|
|
655
|
-
id: idProp,
|
|
656
|
-
...elementProps
|
|
657
|
-
} = componentProps;
|
|
658
|
-
const id = useBaseUiId(idProp);
|
|
659
|
-
const setLabelId = useMenuGroupRootContext();
|
|
660
|
-
useIsoLayoutEffect(() => {
|
|
661
|
-
setLabelId(id);
|
|
662
|
-
return () => {
|
|
663
|
-
setLabelId(undefined);
|
|
664
|
-
};
|
|
665
|
-
}, [setLabelId, id]);
|
|
666
|
-
return useRenderElement("div", componentProps, {
|
|
667
|
-
ref: forwardedRef,
|
|
668
|
-
props: {
|
|
669
|
-
id,
|
|
670
|
-
role: "presentation",
|
|
671
|
-
...elementProps
|
|
672
|
-
}
|
|
673
|
-
});
|
|
674
|
-
});
|
|
675
|
-
if (true)
|
|
676
|
-
MenuGroupLabel.displayName = "MenuGroupLabel";
|
|
677
|
-
// node_modules/@base-ui/react/esm/menu/item/MenuItem.js
|
|
678
|
-
import * as React14 from "react";
|
|
679
|
-
"use client";
|
|
680
|
-
var MenuItem = /* @__PURE__ */ React14.forwardRef(function MenuItem2(componentProps, forwardedRef) {
|
|
681
|
-
const {
|
|
682
|
-
render,
|
|
683
|
-
className,
|
|
684
|
-
id: idProp,
|
|
685
|
-
label,
|
|
686
|
-
nativeButton = false,
|
|
687
|
-
disabled = false,
|
|
688
|
-
closeOnClick = true,
|
|
689
|
-
style,
|
|
690
|
-
...elementProps
|
|
691
|
-
} = componentProps;
|
|
692
|
-
const listItem = useCompositeListItem({
|
|
693
|
-
label
|
|
694
|
-
});
|
|
695
|
-
const menuPositionerContext = useMenuPositionerContext(true);
|
|
696
|
-
const id = useBaseUiId(idProp);
|
|
697
|
-
const {
|
|
698
|
-
store
|
|
699
|
-
} = useMenuRootContext();
|
|
700
|
-
const highlighted = store.useState("isActive", listItem.index);
|
|
701
|
-
const itemProps = store.useState("itemProps");
|
|
702
|
-
const {
|
|
703
|
-
getItemProps,
|
|
704
|
-
itemRef
|
|
705
|
-
} = useMenuItem({
|
|
706
|
-
closeOnClick,
|
|
707
|
-
disabled,
|
|
708
|
-
highlighted,
|
|
709
|
-
id,
|
|
710
|
-
store,
|
|
711
|
-
nativeButton,
|
|
712
|
-
nodeId: menuPositionerContext?.context.nodeId,
|
|
713
|
-
itemMetadata: REGULAR_ITEM
|
|
714
|
-
});
|
|
715
|
-
const state = {
|
|
716
|
-
disabled,
|
|
717
|
-
highlighted
|
|
718
|
-
};
|
|
719
|
-
return useRenderElement("div", componentProps, {
|
|
720
|
-
state,
|
|
721
|
-
props: [itemProps, elementProps, getItemProps],
|
|
722
|
-
ref: [itemRef, forwardedRef, listItem.ref]
|
|
723
|
-
});
|
|
724
|
-
});
|
|
725
|
-
if (true)
|
|
726
|
-
MenuItem.displayName = "MenuItem";
|
|
727
|
-
// node_modules/@base-ui/react/esm/menu/link-item/MenuLinkItem.js
|
|
728
|
-
import * as React15 from "react";
|
|
729
|
-
"use client";
|
|
730
|
-
var MenuLinkItem = /* @__PURE__ */ React15.forwardRef(function MenuLinkItem2(componentProps, forwardedRef) {
|
|
731
|
-
const {
|
|
732
|
-
render,
|
|
733
|
-
className,
|
|
734
|
-
id: idProp,
|
|
735
|
-
label,
|
|
736
|
-
closeOnClick = false,
|
|
737
|
-
style,
|
|
738
|
-
...elementProps
|
|
739
|
-
} = componentProps;
|
|
740
|
-
const linkRef = React15.useRef(null);
|
|
741
|
-
const listItem = useCompositeListItem({
|
|
742
|
-
label
|
|
743
|
-
});
|
|
744
|
-
const menuPositionerContext = useMenuPositionerContext(true);
|
|
745
|
-
const nodeId = menuPositionerContext?.context.nodeId;
|
|
746
|
-
const id = useBaseUiId(idProp);
|
|
747
|
-
const {
|
|
748
|
-
store
|
|
749
|
-
} = useMenuRootContext();
|
|
750
|
-
const highlighted = store.useState("isActive", listItem.index);
|
|
751
|
-
const itemProps = store.useState("itemProps");
|
|
752
|
-
const typingRef = store.context.typingRef;
|
|
753
|
-
const {
|
|
754
|
-
getButtonProps,
|
|
755
|
-
buttonRef
|
|
756
|
-
} = useButton({
|
|
757
|
-
native: false,
|
|
758
|
-
composite: true
|
|
759
|
-
});
|
|
760
|
-
const commonProps = useMenuItemCommonProps({
|
|
761
|
-
closeOnClick,
|
|
762
|
-
highlighted,
|
|
763
|
-
id,
|
|
764
|
-
nodeId,
|
|
765
|
-
store,
|
|
766
|
-
typingRef,
|
|
767
|
-
itemRef: linkRef
|
|
768
|
-
});
|
|
769
|
-
function getItemProps(externalProps) {
|
|
770
|
-
return mergeProps(commonProps, externalProps, getButtonProps);
|
|
771
|
-
}
|
|
772
|
-
const state = {
|
|
773
|
-
highlighted
|
|
774
|
-
};
|
|
775
|
-
return useRenderElement("a", componentProps, {
|
|
776
|
-
state,
|
|
777
|
-
props: [itemProps, elementProps, getItemProps],
|
|
778
|
-
ref: [linkRef, buttonRef, forwardedRef, listItem.ref]
|
|
779
|
-
});
|
|
780
|
-
});
|
|
781
|
-
if (true)
|
|
782
|
-
MenuLinkItem.displayName = "MenuLinkItem";
|
|
783
|
-
// node_modules/@base-ui/react/esm/menu/popup/MenuPopup.js
|
|
784
|
-
import * as React16 from "react";
|
|
785
|
-
import { jsx as _jsx3 } from "react/jsx-runtime";
|
|
786
|
-
"use client";
|
|
787
|
-
var stateAttributesMapping2 = {
|
|
788
|
-
...popupStateMapping,
|
|
789
|
-
...transitionStatusMapping
|
|
790
|
-
};
|
|
791
|
-
var MenuPopup = /* @__PURE__ */ React16.forwardRef(function MenuPopup2(componentProps, forwardedRef) {
|
|
792
|
-
const {
|
|
793
|
-
render,
|
|
794
|
-
className,
|
|
795
|
-
style,
|
|
796
|
-
finalFocus,
|
|
797
|
-
...elementProps
|
|
798
|
-
} = componentProps;
|
|
799
|
-
const {
|
|
800
|
-
store
|
|
801
|
-
} = useMenuRootContext();
|
|
802
|
-
const {
|
|
803
|
-
side,
|
|
804
|
-
align
|
|
805
|
-
} = useMenuPositionerContext();
|
|
806
|
-
const insideToolbar = useToolbarRootContext(true) != null;
|
|
807
|
-
const open = store.useState("open");
|
|
808
|
-
const transitionStatus = store.useState("transitionStatus");
|
|
809
|
-
const popupProps = store.useState("popupProps");
|
|
810
|
-
const mounted = store.useState("mounted");
|
|
811
|
-
const instantType = store.useState("instantType");
|
|
812
|
-
const triggerElement = store.useState("activeTriggerElement");
|
|
813
|
-
const parent = store.useState("parent");
|
|
814
|
-
const lastOpenChangeReason = store.useState("lastOpenChangeReason");
|
|
815
|
-
const rootId = store.useState("rootId");
|
|
816
|
-
const floatingContext = store.useState("floatingRootContext");
|
|
817
|
-
const floatingTreeRoot = store.useState("floatingTreeRoot");
|
|
818
|
-
const closeDelay = store.useState("closeDelay");
|
|
819
|
-
const activeTriggerElement = store.useState("activeTriggerElement");
|
|
820
|
-
const hoverEnabled = store.useState("hoverEnabled");
|
|
821
|
-
const disabled = store.useState("disabled");
|
|
822
|
-
const isContextMenu = parent.type === "context-menu";
|
|
823
|
-
useOpenChangeComplete({
|
|
824
|
-
open,
|
|
825
|
-
ref: store.context.popupRef,
|
|
826
|
-
onComplete() {
|
|
827
|
-
if (open) {
|
|
828
|
-
store.context.onOpenChangeComplete?.(true);
|
|
829
|
-
}
|
|
830
|
-
}
|
|
831
|
-
});
|
|
832
|
-
React16.useEffect(() => {
|
|
833
|
-
function handleClose(event) {
|
|
834
|
-
store.setOpen(false, createChangeEventDetails(event.reason, event.domEvent));
|
|
835
|
-
}
|
|
836
|
-
floatingTreeRoot.events.on("close", handleClose);
|
|
837
|
-
return () => {
|
|
838
|
-
floatingTreeRoot.events.off("close", handleClose);
|
|
839
|
-
};
|
|
840
|
-
}, [floatingTreeRoot.events, store]);
|
|
841
|
-
useHoverFloatingInteraction(floatingContext, {
|
|
842
|
-
enabled: hoverEnabled && !disabled && !isContextMenu && parent.type !== "menubar",
|
|
843
|
-
closeDelay
|
|
844
|
-
});
|
|
845
|
-
const setPopupElement = React16.useCallback((element2) => {
|
|
846
|
-
store.set("popupElement", element2);
|
|
847
|
-
}, [store]);
|
|
848
|
-
const state = {
|
|
849
|
-
transitionStatus,
|
|
850
|
-
side,
|
|
851
|
-
align,
|
|
852
|
-
open,
|
|
853
|
-
nested: parent.type === "menu",
|
|
854
|
-
instant: instantType
|
|
855
|
-
};
|
|
856
|
-
const element = useRenderElement("div", componentProps, {
|
|
857
|
-
state,
|
|
858
|
-
ref: [forwardedRef, store.context.popupRef, setPopupElement],
|
|
859
|
-
stateAttributesMapping: stateAttributesMapping2,
|
|
860
|
-
props: [popupProps, {
|
|
861
|
-
onKeyDown(event) {
|
|
862
|
-
if (insideToolbar && COMPOSITE_KEYS.has(event.key)) {
|
|
863
|
-
event.stopPropagation();
|
|
864
|
-
}
|
|
865
|
-
}
|
|
866
|
-
}, getDisabledMountTransitionStyles(transitionStatus), elementProps, {
|
|
867
|
-
"data-rootownerid": rootId
|
|
868
|
-
}]
|
|
869
|
-
});
|
|
870
|
-
let returnFocus = parent.type === undefined || isContextMenu;
|
|
871
|
-
if (triggerElement || parent.type === "menubar" && lastOpenChangeReason !== exports_reason_parts.outsidePress) {
|
|
872
|
-
returnFocus = true;
|
|
873
|
-
}
|
|
874
|
-
return /* @__PURE__ */ _jsx3(FloatingFocusManager, {
|
|
875
|
-
context: floatingContext,
|
|
876
|
-
modal: isContextMenu,
|
|
877
|
-
disabled: !mounted,
|
|
878
|
-
returnFocus: finalFocus === undefined ? returnFocus : finalFocus,
|
|
879
|
-
initialFocus: parent.type !== "menu",
|
|
880
|
-
restoreFocus: true,
|
|
881
|
-
externalTree: parent.type !== "menubar" ? floatingTreeRoot : undefined,
|
|
882
|
-
previousFocusableElement: activeTriggerElement,
|
|
883
|
-
nextFocusableElement: parent.type === undefined ? store.context.triggerFocusTargetRef : undefined,
|
|
884
|
-
beforeContentFocusGuardRef: parent.type === undefined ? store.context.beforeContentFocusGuardRef : undefined,
|
|
885
|
-
children: element
|
|
886
|
-
});
|
|
887
|
-
});
|
|
888
|
-
if (true)
|
|
889
|
-
MenuPopup.displayName = "MenuPopup";
|
|
890
|
-
// node_modules/@base-ui/react/esm/menu/portal/MenuPortal.js
|
|
891
|
-
import * as React18 from "react";
|
|
892
|
-
|
|
893
|
-
// node_modules/@base-ui/react/esm/menu/portal/MenuPortalContext.js
|
|
894
|
-
import * as React17 from "react";
|
|
895
|
-
"use client";
|
|
896
|
-
var MenuPortalContext = /* @__PURE__ */ React17.createContext(undefined);
|
|
897
|
-
if (true)
|
|
898
|
-
MenuPortalContext.displayName = "MenuPortalContext";
|
|
899
|
-
function useMenuPortalContext() {
|
|
900
|
-
const value = React17.useContext(MenuPortalContext);
|
|
901
|
-
if (value === undefined) {
|
|
902
|
-
throw new Error("Base UI: <Menu.Portal> is missing.");
|
|
903
|
-
}
|
|
904
|
-
return value;
|
|
905
|
-
}
|
|
906
|
-
|
|
907
|
-
// node_modules/@base-ui/react/esm/menu/portal/MenuPortal.js
|
|
908
|
-
import { jsx as _jsx4 } from "react/jsx-runtime";
|
|
909
|
-
"use client";
|
|
910
|
-
var MenuPortal = /* @__PURE__ */ React18.forwardRef(function MenuPortal2(props, forwardedRef) {
|
|
911
|
-
const {
|
|
912
|
-
keepMounted = false,
|
|
913
|
-
...portalProps
|
|
914
|
-
} = props;
|
|
915
|
-
const {
|
|
916
|
-
store
|
|
917
|
-
} = useMenuRootContext();
|
|
918
|
-
const mounted = store.useState("mounted");
|
|
919
|
-
const shouldRender = mounted || keepMounted;
|
|
920
|
-
if (!shouldRender) {
|
|
921
|
-
return null;
|
|
922
|
-
}
|
|
923
|
-
return /* @__PURE__ */ _jsx4(MenuPortalContext.Provider, {
|
|
924
|
-
value: keepMounted,
|
|
925
|
-
children: /* @__PURE__ */ _jsx4(FloatingPortal, {
|
|
926
|
-
ref: forwardedRef,
|
|
927
|
-
...portalProps
|
|
928
|
-
})
|
|
929
|
-
});
|
|
930
|
-
});
|
|
931
|
-
if (true)
|
|
932
|
-
MenuPortal.displayName = "MenuPortal";
|
|
933
|
-
// node_modules/@base-ui/react/esm/menu/positioner/MenuPositioner.js
|
|
934
|
-
import * as React19 from "react";
|
|
935
|
-
import { jsx as _jsx5, jsxs as _jsxs } from "react/jsx-runtime";
|
|
936
|
-
"use client";
|
|
937
|
-
var MenuPositioner = /* @__PURE__ */ React19.forwardRef(function MenuPositioner2(componentProps, forwardedRef) {
|
|
938
|
-
const {
|
|
939
|
-
anchor: anchorProp,
|
|
940
|
-
positionMethod: positionMethodProp = "absolute",
|
|
941
|
-
className,
|
|
942
|
-
render,
|
|
943
|
-
side,
|
|
944
|
-
align: alignProp,
|
|
945
|
-
sideOffset: sideOffsetProp = 0,
|
|
946
|
-
alignOffset: alignOffsetProp = 0,
|
|
947
|
-
collisionBoundary = "clipping-ancestors",
|
|
948
|
-
collisionPadding = 5,
|
|
949
|
-
arrowPadding = 5,
|
|
950
|
-
sticky = false,
|
|
951
|
-
disableAnchorTracking = false,
|
|
952
|
-
collisionAvoidance: collisionAvoidanceProp = DROPDOWN_COLLISION_AVOIDANCE,
|
|
953
|
-
style,
|
|
954
|
-
...elementProps
|
|
955
|
-
} = componentProps;
|
|
956
|
-
const {
|
|
957
|
-
store
|
|
958
|
-
} = useMenuRootContext();
|
|
959
|
-
const keepMounted = useMenuPortalContext();
|
|
960
|
-
const contextMenuContext = useContextMenuRootContext(true);
|
|
961
|
-
const parent = store.useState("parent");
|
|
962
|
-
const floatingRootContext = store.useState("floatingRootContext");
|
|
963
|
-
const floatingTreeRoot = store.useState("floatingTreeRoot");
|
|
964
|
-
const mounted = store.useState("mounted");
|
|
965
|
-
const open = store.useState("open");
|
|
966
|
-
const modal = store.useState("modal");
|
|
967
|
-
const openMethod = store.useState("openMethod");
|
|
968
|
-
const triggerElement = store.useState("activeTriggerElement");
|
|
969
|
-
const transitionStatus = store.useState("transitionStatus");
|
|
970
|
-
const positionerElement = store.useState("positionerElement");
|
|
971
|
-
const instantType = store.useState("instantType");
|
|
972
|
-
const hasViewport = store.useState("hasViewport");
|
|
973
|
-
const lastOpenChangeReason = store.useState("lastOpenChangeReason");
|
|
974
|
-
const floatingNodeId = store.useState("floatingNodeId");
|
|
975
|
-
const floatingParentNodeId = store.useState("floatingParentNodeId");
|
|
976
|
-
const domReference = floatingRootContext.useState("domReferenceElement");
|
|
977
|
-
const previousTriggerRef = React19.useRef(null);
|
|
978
|
-
const runOnceAnimationsFinish = useAnimationsFinished(positionerElement, false, false);
|
|
979
|
-
let anchor = anchorProp;
|
|
980
|
-
let sideOffset = sideOffsetProp;
|
|
981
|
-
let alignOffset = alignOffsetProp;
|
|
982
|
-
let align = alignProp;
|
|
983
|
-
let collisionAvoidance = collisionAvoidanceProp;
|
|
984
|
-
if (parent.type === "context-menu") {
|
|
985
|
-
anchor = anchorProp ?? parent.context?.anchor;
|
|
986
|
-
align = align ?? "start";
|
|
987
|
-
if (!side && align !== "center") {
|
|
988
|
-
alignOffset = componentProps.alignOffset ?? 2;
|
|
989
|
-
sideOffset = componentProps.sideOffset ?? -5;
|
|
990
|
-
}
|
|
991
|
-
}
|
|
992
|
-
let computedSide = side;
|
|
993
|
-
let computedAlign = align;
|
|
994
|
-
if (parent.type === "menu") {
|
|
995
|
-
computedSide = computedSide ?? "inline-end";
|
|
996
|
-
computedAlign = computedAlign ?? "start";
|
|
997
|
-
collisionAvoidance = componentProps.collisionAvoidance ?? POPUP_COLLISION_AVOIDANCE;
|
|
998
|
-
} else if (parent.type === "menubar") {
|
|
999
|
-
computedSide = computedSide ?? "bottom";
|
|
1000
|
-
computedAlign = computedAlign ?? "start";
|
|
1001
|
-
}
|
|
1002
|
-
const contextMenu = parent.type === "context-menu";
|
|
1003
|
-
const positioner = useAnchorPositioning({
|
|
1004
|
-
anchor,
|
|
1005
|
-
floatingRootContext,
|
|
1006
|
-
positionMethod: contextMenuContext ? "fixed" : positionMethodProp,
|
|
1007
|
-
mounted,
|
|
1008
|
-
side: computedSide,
|
|
1009
|
-
sideOffset,
|
|
1010
|
-
align: computedAlign,
|
|
1011
|
-
alignOffset,
|
|
1012
|
-
arrowPadding: contextMenu ? 0 : arrowPadding,
|
|
1013
|
-
collisionBoundary,
|
|
1014
|
-
collisionPadding,
|
|
1015
|
-
sticky,
|
|
1016
|
-
nodeId: floatingNodeId,
|
|
1017
|
-
keepMounted,
|
|
1018
|
-
disableAnchorTracking,
|
|
1019
|
-
collisionAvoidance,
|
|
1020
|
-
shiftCrossAxis: contextMenu && !(("side" in collisionAvoidance) && collisionAvoidance.side === "flip"),
|
|
1021
|
-
externalTree: floatingTreeRoot,
|
|
1022
|
-
adaptiveOrigin: hasViewport ? adaptiveOrigin : undefined
|
|
1023
|
-
});
|
|
1024
|
-
React19.useEffect(() => {
|
|
1025
|
-
function onMenuOpenChange(details) {
|
|
1026
|
-
if (details.open) {
|
|
1027
|
-
if (details.parentNodeId === floatingNodeId) {
|
|
1028
|
-
store.set("hoverEnabled", false);
|
|
1029
|
-
}
|
|
1030
|
-
if (details.nodeId !== floatingNodeId && details.parentNodeId === store.select("floatingParentNodeId")) {
|
|
1031
|
-
store.setOpen(false, createChangeEventDetails(exports_reason_parts.siblingOpen));
|
|
1032
|
-
}
|
|
1033
|
-
}
|
|
1034
|
-
}
|
|
1035
|
-
floatingTreeRoot.events.on("menuopenchange", onMenuOpenChange);
|
|
1036
|
-
return () => {
|
|
1037
|
-
floatingTreeRoot.events.off("menuopenchange", onMenuOpenChange);
|
|
1038
|
-
};
|
|
1039
|
-
}, [store, floatingTreeRoot.events, floatingNodeId]);
|
|
1040
|
-
React19.useEffect(() => {
|
|
1041
|
-
if (store.select("floatingParentNodeId") == null) {
|
|
1042
|
-
return;
|
|
1043
|
-
}
|
|
1044
|
-
function onParentClose(details) {
|
|
1045
|
-
if (details.open || details.nodeId !== store.select("floatingParentNodeId")) {
|
|
1046
|
-
return;
|
|
1047
|
-
}
|
|
1048
|
-
const reason = details.reason ?? exports_reason_parts.siblingOpen;
|
|
1049
|
-
store.setOpen(false, createChangeEventDetails(reason));
|
|
1050
|
-
}
|
|
1051
|
-
floatingTreeRoot.events.on("menuopenchange", onParentClose);
|
|
1052
|
-
return () => {
|
|
1053
|
-
floatingTreeRoot.events.off("menuopenchange", onParentClose);
|
|
1054
|
-
};
|
|
1055
|
-
}, [floatingTreeRoot.events, store]);
|
|
1056
|
-
const closeTimeout = useTimeout();
|
|
1057
|
-
React19.useEffect(() => {
|
|
1058
|
-
if (!open) {
|
|
1059
|
-
closeTimeout.clear();
|
|
1060
|
-
}
|
|
1061
|
-
}, [open, closeTimeout]);
|
|
1062
|
-
React19.useEffect(() => {
|
|
1063
|
-
function onItemHover(event) {
|
|
1064
|
-
if (!open || event.nodeId !== store.select("floatingParentNodeId")) {
|
|
1065
|
-
return;
|
|
1066
|
-
}
|
|
1067
|
-
if (event.target && triggerElement && triggerElement !== event.target) {
|
|
1068
|
-
const delay = store.select("closeDelay");
|
|
1069
|
-
if (delay > 0) {
|
|
1070
|
-
if (!closeTimeout.isStarted()) {
|
|
1071
|
-
closeTimeout.start(delay, () => {
|
|
1072
|
-
store.setOpen(false, createChangeEventDetails(exports_reason_parts.siblingOpen));
|
|
1073
|
-
});
|
|
1074
|
-
}
|
|
1075
|
-
} else {
|
|
1076
|
-
store.setOpen(false, createChangeEventDetails(exports_reason_parts.siblingOpen));
|
|
1077
|
-
}
|
|
1078
|
-
} else {
|
|
1079
|
-
closeTimeout.clear();
|
|
1080
|
-
}
|
|
1081
|
-
}
|
|
1082
|
-
floatingTreeRoot.events.on("itemhover", onItemHover);
|
|
1083
|
-
return () => {
|
|
1084
|
-
floatingTreeRoot.events.off("itemhover", onItemHover);
|
|
1085
|
-
};
|
|
1086
|
-
}, [floatingTreeRoot.events, open, triggerElement, store, closeTimeout]);
|
|
1087
|
-
React19.useEffect(() => {
|
|
1088
|
-
const eventDetails = {
|
|
1089
|
-
open,
|
|
1090
|
-
nodeId: floatingNodeId,
|
|
1091
|
-
parentNodeId: floatingParentNodeId,
|
|
1092
|
-
reason: store.select("lastOpenChangeReason")
|
|
1093
|
-
};
|
|
1094
|
-
floatingTreeRoot.events.emit("menuopenchange", eventDetails);
|
|
1095
|
-
}, [floatingTreeRoot.events, open, store, floatingNodeId, floatingParentNodeId]);
|
|
1096
|
-
useIsoLayoutEffect(() => {
|
|
1097
|
-
const currentTrigger = domReference;
|
|
1098
|
-
const previousTrigger = previousTriggerRef.current;
|
|
1099
|
-
if (currentTrigger) {
|
|
1100
|
-
previousTriggerRef.current = currentTrigger;
|
|
1101
|
-
}
|
|
1102
|
-
if (previousTrigger && currentTrigger && currentTrigger !== previousTrigger) {
|
|
1103
|
-
store.set("instantType", undefined);
|
|
1104
|
-
const abortController = new AbortController;
|
|
1105
|
-
runOnceAnimationsFinish(() => {
|
|
1106
|
-
store.set("instantType", "trigger-change");
|
|
1107
|
-
}, abortController.signal);
|
|
1108
|
-
return () => {
|
|
1109
|
-
abortController.abort();
|
|
1110
|
-
};
|
|
1111
|
-
}
|
|
1112
|
-
return;
|
|
1113
|
-
}, [domReference, runOnceAnimationsFinish, store]);
|
|
1114
|
-
const state = {
|
|
1115
|
-
open,
|
|
1116
|
-
side: positioner.side,
|
|
1117
|
-
align: positioner.align,
|
|
1118
|
-
anchorHidden: positioner.anchorHidden,
|
|
1119
|
-
nested: parent.type === "menu",
|
|
1120
|
-
instant: instantType
|
|
1121
|
-
};
|
|
1122
|
-
const menubarModal = parent.type === "menubar" && parent.context.modal;
|
|
1123
|
-
const popupModal = modal && lastOpenChangeReason !== exports_reason_parts.triggerHover;
|
|
1124
|
-
useAnchoredPopupScrollLock(open && (menubarModal || popupModal), openMethod === "touch", positionerElement, triggerElement);
|
|
1125
|
-
const element = usePositioner(componentProps, state, {
|
|
1126
|
-
styles: positioner.positionerStyles,
|
|
1127
|
-
transitionStatus,
|
|
1128
|
-
props: elementProps,
|
|
1129
|
-
refs: [forwardedRef, store.useStateSetter("positionerElement")],
|
|
1130
|
-
hidden: !mounted,
|
|
1131
|
-
inert: !open
|
|
1132
|
-
});
|
|
1133
|
-
const shouldRenderBackdrop = mounted && parent.type !== "menu" && (parent.type !== "menubar" && modal && lastOpenChangeReason !== exports_reason_parts.triggerHover || parent.type === "menubar" && parent.context.modal);
|
|
1134
|
-
let backdropCutout = null;
|
|
1135
|
-
if (parent.type === "menubar") {
|
|
1136
|
-
backdropCutout = parent.context.contentElement;
|
|
1137
|
-
} else if (parent.type === undefined) {
|
|
1138
|
-
backdropCutout = triggerElement;
|
|
1139
|
-
}
|
|
1140
|
-
return /* @__PURE__ */ _jsxs(MenuPositionerContext.Provider, {
|
|
1141
|
-
value: positioner,
|
|
1142
|
-
children: [shouldRenderBackdrop && /* @__PURE__ */ _jsx5(InternalBackdrop, {
|
|
1143
|
-
ref: parent.type === "context-menu" || parent.type === "nested-context-menu" ? parent.context.internalBackdropRef : null,
|
|
1144
|
-
inert: inertValue(!open),
|
|
1145
|
-
cutout: backdropCutout
|
|
1146
|
-
}), /* @__PURE__ */ _jsx5(FloatingNode, {
|
|
1147
|
-
id: floatingNodeId,
|
|
1148
|
-
children: /* @__PURE__ */ _jsx5(CompositeList, {
|
|
1149
|
-
elementsRef: store.context.itemDomElements,
|
|
1150
|
-
labelsRef: store.context.itemLabels,
|
|
1151
|
-
children: element
|
|
1152
|
-
})
|
|
1153
|
-
})]
|
|
1154
|
-
});
|
|
1155
|
-
});
|
|
1156
|
-
if (true)
|
|
1157
|
-
MenuPositioner.displayName = "MenuPositioner";
|
|
1158
|
-
// node_modules/@base-ui/react/esm/menu/radio-group/MenuRadioGroup.js
|
|
1159
|
-
import * as React21 from "react";
|
|
1160
|
-
|
|
1161
|
-
// node_modules/@base-ui/react/esm/menu/radio-group/MenuRadioGroupContext.js
|
|
1162
|
-
import * as React20 from "react";
|
|
1163
|
-
"use client";
|
|
1164
|
-
var MenuRadioGroupContext = /* @__PURE__ */ React20.createContext(undefined);
|
|
1165
|
-
if (true)
|
|
1166
|
-
MenuRadioGroupContext.displayName = "MenuRadioGroupContext";
|
|
1167
|
-
function useMenuRadioGroupContext() {
|
|
1168
|
-
const context = React20.useContext(MenuRadioGroupContext);
|
|
1169
|
-
if (context === undefined) {
|
|
1170
|
-
throw new Error("Base UI: MenuRadioGroupContext is missing. MenuRadioGroup parts must be placed within <Menu.RadioGroup>.");
|
|
1171
|
-
}
|
|
1172
|
-
return context;
|
|
1173
|
-
}
|
|
1174
|
-
|
|
1175
|
-
// node_modules/@base-ui/react/esm/menu/radio-group/MenuRadioGroup.js
|
|
1176
|
-
import { jsx as _jsx6 } from "react/jsx-runtime";
|
|
1177
|
-
"use client";
|
|
1178
|
-
var MenuRadioGroup = /* @__PURE__ */ React21.memo(/* @__PURE__ */ React21.forwardRef(function MenuRadioGroup2(componentProps, forwardedRef) {
|
|
1179
|
-
const {
|
|
1180
|
-
render,
|
|
1181
|
-
className,
|
|
1182
|
-
value: valueProp,
|
|
1183
|
-
defaultValue,
|
|
1184
|
-
onValueChange: onValueChangeProp,
|
|
1185
|
-
disabled = false,
|
|
1186
|
-
style,
|
|
1187
|
-
"aria-labelledby": ariaLabelledByProp,
|
|
1188
|
-
...elementProps
|
|
1189
|
-
} = componentProps;
|
|
1190
|
-
const [labelId, setLabelId] = React21.useState(undefined);
|
|
1191
|
-
const [value, setValueUnwrapped] = useControlled({
|
|
1192
|
-
controlled: valueProp,
|
|
1193
|
-
default: defaultValue,
|
|
1194
|
-
name: "MenuRadioGroup"
|
|
1195
|
-
});
|
|
1196
|
-
const setValue = useStableCallback((newValue, eventDetails) => {
|
|
1197
|
-
onValueChangeProp?.(newValue, eventDetails);
|
|
1198
|
-
if (eventDetails.isCanceled) {
|
|
1199
|
-
return;
|
|
1200
|
-
}
|
|
1201
|
-
setValueUnwrapped(newValue);
|
|
1202
|
-
});
|
|
1203
|
-
const state = {
|
|
1204
|
-
disabled
|
|
1205
|
-
};
|
|
1206
|
-
const element = useRenderElement("div", componentProps, {
|
|
1207
|
-
state,
|
|
1208
|
-
ref: forwardedRef,
|
|
1209
|
-
props: {
|
|
1210
|
-
role: "group",
|
|
1211
|
-
"aria-labelledby": ariaLabelledByProp ?? labelId,
|
|
1212
|
-
"aria-disabled": disabled || undefined,
|
|
1213
|
-
...elementProps
|
|
1214
|
-
}
|
|
1215
|
-
});
|
|
1216
|
-
const context = React21.useMemo(() => ({
|
|
1217
|
-
value,
|
|
1218
|
-
setValue,
|
|
1219
|
-
disabled
|
|
1220
|
-
}), [value, setValue, disabled]);
|
|
1221
|
-
return /* @__PURE__ */ _jsx6(MenuGroupContext.Provider, {
|
|
1222
|
-
value: setLabelId,
|
|
1223
|
-
children: /* @__PURE__ */ _jsx6(MenuRadioGroupContext.Provider, {
|
|
1224
|
-
value: context,
|
|
1225
|
-
children: element
|
|
1226
|
-
})
|
|
1227
|
-
});
|
|
1228
|
-
}));
|
|
1229
|
-
if (true)
|
|
1230
|
-
MenuRadioGroup.displayName = "MenuRadioGroup";
|
|
1231
|
-
// node_modules/@base-ui/react/esm/menu/radio-item/MenuRadioItem.js
|
|
1232
|
-
import * as React23 from "react";
|
|
1233
|
-
|
|
1234
|
-
// node_modules/@base-ui/react/esm/menu/radio-item/MenuRadioItemContext.js
|
|
1235
|
-
import * as React22 from "react";
|
|
1236
|
-
"use client";
|
|
1237
|
-
var MenuRadioItemContext = /* @__PURE__ */ React22.createContext(undefined);
|
|
1238
|
-
if (true)
|
|
1239
|
-
MenuRadioItemContext.displayName = "MenuRadioItemContext";
|
|
1240
|
-
function useMenuRadioItemContext() {
|
|
1241
|
-
const context = React22.useContext(MenuRadioItemContext);
|
|
1242
|
-
if (context === undefined) {
|
|
1243
|
-
throw new Error("Base UI: MenuRadioItemContext is missing. MenuRadioItem parts must be placed within <Menu.RadioItem>.");
|
|
1244
|
-
}
|
|
1245
|
-
return context;
|
|
1246
|
-
}
|
|
1247
|
-
|
|
1248
|
-
// node_modules/@base-ui/react/esm/menu/radio-item/MenuRadioItem.js
|
|
1249
|
-
import { jsx as _jsx7 } from "react/jsx-runtime";
|
|
1250
|
-
"use client";
|
|
1251
|
-
var MenuRadioItem = /* @__PURE__ */ React23.forwardRef(function MenuRadioItem2(componentProps, forwardedRef) {
|
|
1252
|
-
const {
|
|
1253
|
-
render,
|
|
1254
|
-
className,
|
|
1255
|
-
id: idProp,
|
|
1256
|
-
label,
|
|
1257
|
-
nativeButton = false,
|
|
1258
|
-
disabled: disabledProp = false,
|
|
1259
|
-
closeOnClick = false,
|
|
1260
|
-
value,
|
|
1261
|
-
style,
|
|
1262
|
-
...elementProps
|
|
1263
|
-
} = componentProps;
|
|
1264
|
-
const listItem = useCompositeListItem({
|
|
1265
|
-
label
|
|
1266
|
-
});
|
|
1267
|
-
const menuPositionerContext = useMenuPositionerContext(true);
|
|
1268
|
-
const id = useBaseUiId(idProp);
|
|
1269
|
-
const {
|
|
1270
|
-
store
|
|
1271
|
-
} = useMenuRootContext();
|
|
1272
|
-
const highlighted = store.useState("isActive", listItem.index);
|
|
1273
|
-
const itemProps = store.useState("itemProps");
|
|
1274
|
-
const {
|
|
1275
|
-
value: selectedValue,
|
|
1276
|
-
setValue: setSelectedValue,
|
|
1277
|
-
disabled: groupDisabled
|
|
1278
|
-
} = useMenuRadioGroupContext();
|
|
1279
|
-
const disabled = groupDisabled || disabledProp;
|
|
1280
|
-
const checked = selectedValue === value;
|
|
1281
|
-
const {
|
|
1282
|
-
getItemProps,
|
|
1283
|
-
itemRef
|
|
1284
|
-
} = useMenuItem({
|
|
1285
|
-
closeOnClick,
|
|
1286
|
-
disabled,
|
|
1287
|
-
highlighted,
|
|
1288
|
-
id,
|
|
1289
|
-
store,
|
|
1290
|
-
nativeButton,
|
|
1291
|
-
nodeId: menuPositionerContext?.context.nodeId,
|
|
1292
|
-
itemMetadata: REGULAR_ITEM
|
|
1293
|
-
});
|
|
1294
|
-
const state = React23.useMemo(() => ({
|
|
1295
|
-
disabled,
|
|
1296
|
-
highlighted,
|
|
1297
|
-
checked
|
|
1298
|
-
}), [disabled, highlighted, checked]);
|
|
1299
|
-
function handleClick(event) {
|
|
1300
|
-
const details = createChangeEventDetails(exports_reason_parts.itemPress, event.nativeEvent, undefined, {
|
|
1301
|
-
preventUnmountOnClose() {}
|
|
1302
|
-
});
|
|
1303
|
-
setSelectedValue(value, details);
|
|
1304
|
-
}
|
|
1305
|
-
const element = useRenderElement("div", componentProps, {
|
|
1306
|
-
state,
|
|
1307
|
-
stateAttributesMapping: itemMapping,
|
|
1308
|
-
props: [itemProps, {
|
|
1309
|
-
role: "menuitemradio",
|
|
1310
|
-
"aria-checked": checked,
|
|
1311
|
-
onClick: handleClick
|
|
1312
|
-
}, elementProps, getItemProps],
|
|
1313
|
-
ref: [itemRef, forwardedRef, listItem.ref]
|
|
1314
|
-
});
|
|
1315
|
-
return /* @__PURE__ */ _jsx7(MenuRadioItemContext.Provider, {
|
|
1316
|
-
value: state,
|
|
1317
|
-
children: element
|
|
1318
|
-
});
|
|
1319
|
-
});
|
|
1320
|
-
if (true)
|
|
1321
|
-
MenuRadioItem.displayName = "MenuRadioItem";
|
|
1322
|
-
// node_modules/@base-ui/react/esm/menu/radio-item-indicator/MenuRadioItemIndicator.js
|
|
1323
|
-
import * as React24 from "react";
|
|
1324
|
-
"use client";
|
|
1325
|
-
var MenuRadioItemIndicator = /* @__PURE__ */ React24.forwardRef(function MenuRadioItemIndicator2(componentProps, forwardedRef) {
|
|
1326
|
-
const {
|
|
1327
|
-
render,
|
|
1328
|
-
className,
|
|
1329
|
-
style,
|
|
1330
|
-
keepMounted = false,
|
|
1331
|
-
...elementProps
|
|
1332
|
-
} = componentProps;
|
|
1333
|
-
const item = useMenuRadioItemContext();
|
|
1334
|
-
const indicatorRef = React24.useRef(null);
|
|
1335
|
-
const {
|
|
1336
|
-
transitionStatus,
|
|
1337
|
-
setMounted
|
|
1338
|
-
} = useTransitionStatus(item.checked);
|
|
1339
|
-
useOpenChangeComplete({
|
|
1340
|
-
open: item.checked,
|
|
1341
|
-
ref: indicatorRef,
|
|
1342
|
-
onComplete() {
|
|
1343
|
-
if (!item.checked) {
|
|
1344
|
-
setMounted(false);
|
|
1345
|
-
}
|
|
1346
|
-
}
|
|
1347
|
-
});
|
|
1348
|
-
const state = {
|
|
1349
|
-
checked: item.checked,
|
|
1350
|
-
disabled: item.disabled,
|
|
1351
|
-
highlighted: item.highlighted,
|
|
1352
|
-
transitionStatus
|
|
1353
|
-
};
|
|
1354
|
-
const element = useRenderElement("span", componentProps, {
|
|
1355
|
-
state,
|
|
1356
|
-
stateAttributesMapping: itemMapping,
|
|
1357
|
-
ref: [forwardedRef, indicatorRef],
|
|
1358
|
-
props: {
|
|
1359
|
-
"aria-hidden": true,
|
|
1360
|
-
...elementProps
|
|
1361
|
-
},
|
|
1362
|
-
enabled: keepMounted || item.checked
|
|
1363
|
-
});
|
|
1364
|
-
return element;
|
|
1365
|
-
});
|
|
1366
|
-
if (true)
|
|
1367
|
-
MenuRadioItemIndicator.displayName = "MenuRadioItemIndicator";
|
|
1368
|
-
// node_modules/@base-ui/react/esm/menu/root/MenuRoot.js
|
|
1369
|
-
import * as React27 from "react";
|
|
1370
|
-
|
|
1371
|
-
// node_modules/@base-ui/react/esm/menu/store/MenuStore.js
|
|
1372
|
-
import * as React25 from "react";
|
|
1373
|
-
var selectors = {
|
|
1374
|
-
...popupStoreSelectors,
|
|
1375
|
-
disabled: createSelector((state) => state.parent.type === "menubar" ? state.parent.context.disabled || state.disabled : state.disabled),
|
|
1376
|
-
modal: createSelector((state) => (state.parent.type === undefined || state.parent.type === "context-menu") && (state.modal ?? true)),
|
|
1377
|
-
openMethod: createSelector((state) => state.openMethod),
|
|
1378
|
-
allowMouseEnter: createSelector((state) => state.allowMouseEnter),
|
|
1379
|
-
stickIfOpen: createSelector((state) => state.stickIfOpen),
|
|
1380
|
-
parent: createSelector((state) => state.parent),
|
|
1381
|
-
rootId: createSelector((state) => {
|
|
1382
|
-
if (state.parent.type === "menu") {
|
|
1383
|
-
return state.parent.store.select("rootId");
|
|
1384
|
-
}
|
|
1385
|
-
return state.parent.type !== undefined ? state.parent.context.rootId : state.rootId;
|
|
1386
|
-
}),
|
|
1387
|
-
activeIndex: createSelector((state) => state.activeIndex),
|
|
1388
|
-
isActive: createSelector((state, itemIndex) => state.activeIndex === itemIndex),
|
|
1389
|
-
hoverEnabled: createSelector((state) => state.hoverEnabled),
|
|
1390
|
-
instantType: createSelector((state) => state.instantType),
|
|
1391
|
-
lastOpenChangeReason: createSelector((state) => state.openChangeReason),
|
|
1392
|
-
floatingTreeRoot: createSelector((state) => {
|
|
1393
|
-
if (state.parent.type === "menu") {
|
|
1394
|
-
return state.parent.store.select("floatingTreeRoot");
|
|
1395
|
-
}
|
|
1396
|
-
return state.floatingTreeRoot;
|
|
1397
|
-
}),
|
|
1398
|
-
floatingNodeId: createSelector((state) => state.floatingNodeId),
|
|
1399
|
-
floatingParentNodeId: createSelector((state) => state.floatingParentNodeId),
|
|
1400
|
-
itemProps: createSelector((state) => state.itemProps),
|
|
1401
|
-
closeDelay: createSelector((state) => state.closeDelay),
|
|
1402
|
-
hasViewport: createSelector((state) => state.hasViewport),
|
|
1403
|
-
keyboardEventRelay: createSelector((state) => {
|
|
1404
|
-
if (state.keyboardEventRelay) {
|
|
1405
|
-
return state.keyboardEventRelay;
|
|
1406
|
-
}
|
|
1407
|
-
if (state.parent.type === "menu") {
|
|
1408
|
-
return state.parent.store.select("keyboardEventRelay");
|
|
1409
|
-
}
|
|
1410
|
-
return;
|
|
1411
|
-
})
|
|
1412
|
-
};
|
|
1413
|
-
|
|
1414
|
-
class MenuStore extends ReactStore {
|
|
1415
|
-
constructor(initialState) {
|
|
1416
|
-
super({
|
|
1417
|
-
...createInitialState(),
|
|
1418
|
-
...initialState
|
|
1419
|
-
}, {
|
|
1420
|
-
positionerRef: /* @__PURE__ */ React25.createRef(),
|
|
1421
|
-
popupRef: /* @__PURE__ */ React25.createRef(),
|
|
1422
|
-
typingRef: {
|
|
1423
|
-
current: false
|
|
1424
|
-
},
|
|
1425
|
-
itemDomElements: {
|
|
1426
|
-
current: []
|
|
1427
|
-
},
|
|
1428
|
-
itemLabels: {
|
|
1429
|
-
current: []
|
|
1430
|
-
},
|
|
1431
|
-
allowMouseUpTriggerRef: {
|
|
1432
|
-
current: false
|
|
1433
|
-
},
|
|
1434
|
-
triggerFocusTargetRef: /* @__PURE__ */ React25.createRef(),
|
|
1435
|
-
beforeContentFocusGuardRef: /* @__PURE__ */ React25.createRef(),
|
|
1436
|
-
onOpenChangeComplete: undefined,
|
|
1437
|
-
triggerElements: new PopupTriggerMap
|
|
1438
|
-
}, selectors);
|
|
1439
|
-
this.unsubscribeParentListener = this.observe("parent", (parent) => {
|
|
1440
|
-
this.unsubscribeParentListener?.();
|
|
1441
|
-
if (parent.type === "menu") {
|
|
1442
|
-
let rootId = parent.store.select("rootId");
|
|
1443
|
-
let floatingTreeRoot = parent.store.select("floatingTreeRoot");
|
|
1444
|
-
let keyboardEventRelay = parent.store.select("keyboardEventRelay");
|
|
1445
|
-
this.unsubscribeParentListener = parent.store.subscribe(() => {
|
|
1446
|
-
const nextRootId = parent.store.select("rootId");
|
|
1447
|
-
const nextFloatingTreeRoot = parent.store.select("floatingTreeRoot");
|
|
1448
|
-
const nextKeyboardEventRelay = parent.store.select("keyboardEventRelay");
|
|
1449
|
-
if (rootId === nextRootId && floatingTreeRoot === nextFloatingTreeRoot && keyboardEventRelay === nextKeyboardEventRelay) {
|
|
1450
|
-
return;
|
|
1451
|
-
}
|
|
1452
|
-
rootId = nextRootId;
|
|
1453
|
-
floatingTreeRoot = nextFloatingTreeRoot;
|
|
1454
|
-
keyboardEventRelay = nextKeyboardEventRelay;
|
|
1455
|
-
this.notifyAll();
|
|
1456
|
-
});
|
|
1457
|
-
this.context.allowMouseUpTriggerRef = parent.store.context.allowMouseUpTriggerRef;
|
|
1458
|
-
return;
|
|
1459
|
-
}
|
|
1460
|
-
if (parent.type !== undefined) {
|
|
1461
|
-
this.context.allowMouseUpTriggerRef = parent.context.allowMouseUpTriggerRef;
|
|
1462
|
-
}
|
|
1463
|
-
this.unsubscribeParentListener = null;
|
|
1464
|
-
});
|
|
1465
|
-
}
|
|
1466
|
-
setOpen(open, eventDetails) {
|
|
1467
|
-
this.state.floatingRootContext.context.events.emit("setOpen", {
|
|
1468
|
-
open,
|
|
1469
|
-
eventDetails
|
|
1470
|
-
});
|
|
1471
|
-
}
|
|
1472
|
-
static useStore(externalStore, initialState) {
|
|
1473
|
-
const internalStore = useRefWithInit(() => {
|
|
1474
|
-
return new MenuStore(initialState);
|
|
1475
|
-
}).current;
|
|
1476
|
-
return externalStore ?? internalStore;
|
|
1477
|
-
}
|
|
1478
|
-
unsubscribeParentListener = null;
|
|
1479
|
-
}
|
|
1480
|
-
function createInitialState() {
|
|
1481
|
-
return {
|
|
1482
|
-
...createInitialPopupStoreState(),
|
|
1483
|
-
disabled: false,
|
|
1484
|
-
modal: true,
|
|
1485
|
-
openMethod: null,
|
|
1486
|
-
allowMouseEnter: false,
|
|
1487
|
-
stickIfOpen: true,
|
|
1488
|
-
parent: {
|
|
1489
|
-
type: undefined
|
|
1490
|
-
},
|
|
1491
|
-
rootId: undefined,
|
|
1492
|
-
activeIndex: null,
|
|
1493
|
-
hoverEnabled: true,
|
|
1494
|
-
instantType: undefined,
|
|
1495
|
-
openChangeReason: null,
|
|
1496
|
-
floatingTreeRoot: new FloatingTreeStore,
|
|
1497
|
-
floatingNodeId: undefined,
|
|
1498
|
-
floatingParentNodeId: null,
|
|
1499
|
-
itemProps: EMPTY_OBJECT,
|
|
1500
|
-
keyboardEventRelay: undefined,
|
|
1501
|
-
closeDelay: 0,
|
|
1502
|
-
hasViewport: false
|
|
1503
|
-
};
|
|
1504
|
-
}
|
|
1505
|
-
|
|
1506
|
-
// node_modules/@base-ui/react/esm/menu/submenu-root/MenuSubmenuRootContext.js
|
|
1507
|
-
import * as React26 from "react";
|
|
1508
|
-
"use client";
|
|
1509
|
-
var MenuSubmenuRootContext = /* @__PURE__ */ React26.createContext(undefined);
|
|
1510
|
-
if (true)
|
|
1511
|
-
MenuSubmenuRootContext.displayName = "MenuSubmenuRootContext";
|
|
1512
|
-
function useMenuSubmenuRootContext() {
|
|
1513
|
-
return React26.useContext(MenuSubmenuRootContext);
|
|
1514
|
-
}
|
|
1515
|
-
|
|
1516
|
-
// node_modules/@base-ui/react/esm/menu/root/MenuRoot.js
|
|
1517
|
-
import { jsx as _jsx8 } from "react/jsx-runtime";
|
|
1518
|
-
"use client";
|
|
1519
|
-
var MenuRoot = fastComponent(function MenuRoot2(props) {
|
|
1520
|
-
const {
|
|
1521
|
-
children,
|
|
1522
|
-
open: openProp,
|
|
1523
|
-
onOpenChange,
|
|
1524
|
-
onOpenChangeComplete,
|
|
1525
|
-
defaultOpen = false,
|
|
1526
|
-
disabled: disabledProp = false,
|
|
1527
|
-
modal: modalProp,
|
|
1528
|
-
loopFocus = true,
|
|
1529
|
-
orientation = "vertical",
|
|
1530
|
-
actionsRef,
|
|
1531
|
-
closeParentOnEsc = false,
|
|
1532
|
-
handle,
|
|
1533
|
-
triggerId: triggerIdProp,
|
|
1534
|
-
defaultTriggerId: defaultTriggerIdProp = null,
|
|
1535
|
-
highlightItemOnHover = true
|
|
1536
|
-
} = props;
|
|
1537
|
-
const contextMenuContext = useContextMenuRootContext(true);
|
|
1538
|
-
const parentMenuRootContext = useMenuRootContext(true);
|
|
1539
|
-
const menubarContext = useMenubarContext(true);
|
|
1540
|
-
const isSubmenu = useMenuSubmenuRootContext();
|
|
1541
|
-
const parentFromContext = React27.useMemo(() => {
|
|
1542
|
-
if (isSubmenu && parentMenuRootContext) {
|
|
1543
|
-
return {
|
|
1544
|
-
type: "menu",
|
|
1545
|
-
store: parentMenuRootContext.store
|
|
1546
|
-
};
|
|
1547
|
-
}
|
|
1548
|
-
if (menubarContext) {
|
|
1549
|
-
return {
|
|
1550
|
-
type: "menubar",
|
|
1551
|
-
context: menubarContext
|
|
1552
|
-
};
|
|
1553
|
-
}
|
|
1554
|
-
if (contextMenuContext && !parentMenuRootContext) {
|
|
1555
|
-
return {
|
|
1556
|
-
type: "context-menu",
|
|
1557
|
-
context: contextMenuContext
|
|
1558
|
-
};
|
|
1559
|
-
}
|
|
1560
|
-
return {
|
|
1561
|
-
type: undefined
|
|
1562
|
-
};
|
|
1563
|
-
}, [contextMenuContext, parentMenuRootContext, menubarContext, isSubmenu]);
|
|
1564
|
-
const store = MenuStore.useStore(handle?.store, {
|
|
1565
|
-
open: defaultOpen,
|
|
1566
|
-
openProp,
|
|
1567
|
-
activeTriggerId: defaultTriggerIdProp,
|
|
1568
|
-
triggerIdProp,
|
|
1569
|
-
parent: parentFromContext
|
|
1570
|
-
});
|
|
1571
|
-
useOnFirstRender(() => {
|
|
1572
|
-
if (openProp === undefined && store.state.open === false && defaultOpen === true) {
|
|
1573
|
-
store.update({
|
|
1574
|
-
open: true,
|
|
1575
|
-
activeTriggerId: defaultTriggerIdProp
|
|
1576
|
-
});
|
|
1577
|
-
}
|
|
1578
|
-
});
|
|
1579
|
-
store.useControlledProp("openProp", openProp);
|
|
1580
|
-
store.useControlledProp("triggerIdProp", triggerIdProp);
|
|
1581
|
-
store.useContextCallback("onOpenChangeComplete", onOpenChangeComplete);
|
|
1582
|
-
const rootId = useId();
|
|
1583
|
-
const floatingId = useId();
|
|
1584
|
-
const floatingTreeRoot = store.useState("floatingTreeRoot");
|
|
1585
|
-
const floatingNodeIdFromContext = useFloatingNodeId(floatingTreeRoot);
|
|
1586
|
-
const floatingParentNodeIdFromContext = useFloatingParentNodeId();
|
|
1587
|
-
const open = store.useState("open");
|
|
1588
|
-
const activeTriggerElement = store.useState("activeTriggerElement");
|
|
1589
|
-
const positionerElement = store.useState("positionerElement");
|
|
1590
|
-
const hoverEnabled = store.useState("hoverEnabled");
|
|
1591
|
-
const disabled = store.useState("disabled");
|
|
1592
|
-
const lastOpenChangeReason = store.useState("lastOpenChangeReason");
|
|
1593
|
-
const parent = store.useState("parent");
|
|
1594
|
-
const activeIndex = store.useState("activeIndex");
|
|
1595
|
-
const payload = store.useState("payload");
|
|
1596
|
-
const floatingParentNodeId = store.useState("floatingParentNodeId");
|
|
1597
|
-
const openEventRef = React27.useRef(null);
|
|
1598
|
-
const allowOutsidePressDismissalRef = React27.useRef(parent.type !== "context-menu");
|
|
1599
|
-
const allowOutsidePressDismissalTimeout = useTimeout();
|
|
1600
|
-
const allowTouchToCloseRef = React27.useRef(true);
|
|
1601
|
-
const allowTouchToCloseTimeout = useTimeout();
|
|
1602
|
-
const nested = floatingParentNodeId != null;
|
|
1603
|
-
if (true) {
|
|
1604
|
-
if (parent.type !== undefined && modalProp !== undefined) {
|
|
1605
|
-
console.warn("Base UI: The `modal` prop is not supported on nested menus. It will be ignored.");
|
|
1606
|
-
}
|
|
1607
|
-
}
|
|
1608
|
-
const {
|
|
1609
|
-
openMethod,
|
|
1610
|
-
triggerProps: interactionTypeProps
|
|
1611
|
-
} = useOpenInteractionType(open);
|
|
1612
|
-
store.useSyncedValues({
|
|
1613
|
-
disabled: disabledProp,
|
|
1614
|
-
modal: parent.type === undefined ? modalProp : undefined,
|
|
1615
|
-
openMethod,
|
|
1616
|
-
rootId
|
|
1617
|
-
});
|
|
1618
|
-
useImplicitActiveTrigger(store);
|
|
1619
|
-
const {
|
|
1620
|
-
forceUnmount
|
|
1621
|
-
} = useOpenStateTransitions(open, store, () => {
|
|
1622
|
-
store.update({
|
|
1623
|
-
allowMouseEnter: false,
|
|
1624
|
-
stickIfOpen: true
|
|
1625
|
-
});
|
|
1626
|
-
});
|
|
1627
|
-
useIsoLayoutEffect(() => {
|
|
1628
|
-
if (contextMenuContext && !parentMenuRootContext) {
|
|
1629
|
-
store.update({
|
|
1630
|
-
parent: {
|
|
1631
|
-
type: "context-menu",
|
|
1632
|
-
context: contextMenuContext
|
|
1633
|
-
},
|
|
1634
|
-
floatingNodeId: floatingNodeIdFromContext,
|
|
1635
|
-
floatingParentNodeId: floatingParentNodeIdFromContext
|
|
1636
|
-
});
|
|
1637
|
-
} else if (parentMenuRootContext) {
|
|
1638
|
-
store.update({
|
|
1639
|
-
floatingNodeId: floatingNodeIdFromContext,
|
|
1640
|
-
floatingParentNodeId: floatingParentNodeIdFromContext
|
|
1641
|
-
});
|
|
1642
|
-
}
|
|
1643
|
-
}, [contextMenuContext, parentMenuRootContext, floatingNodeIdFromContext, floatingParentNodeIdFromContext, store]);
|
|
1644
|
-
React27.useEffect(() => {
|
|
1645
|
-
if (!open) {
|
|
1646
|
-
openEventRef.current = null;
|
|
1647
|
-
}
|
|
1648
|
-
if (parent.type !== "context-menu") {
|
|
1649
|
-
return;
|
|
1650
|
-
}
|
|
1651
|
-
if (!open) {
|
|
1652
|
-
allowOutsidePressDismissalTimeout.clear();
|
|
1653
|
-
allowOutsidePressDismissalRef.current = false;
|
|
1654
|
-
return;
|
|
1655
|
-
}
|
|
1656
|
-
allowOutsidePressDismissalTimeout.start(500, () => {
|
|
1657
|
-
allowOutsidePressDismissalRef.current = true;
|
|
1658
|
-
});
|
|
1659
|
-
}, [allowOutsidePressDismissalTimeout, open, parent.type]);
|
|
1660
|
-
useIsoLayoutEffect(() => {
|
|
1661
|
-
if (!open && !hoverEnabled) {
|
|
1662
|
-
store.set("hoverEnabled", true);
|
|
1663
|
-
}
|
|
1664
|
-
}, [open, hoverEnabled, store]);
|
|
1665
|
-
const setOpen = useStableCallback((nextOpen, eventDetails) => {
|
|
1666
|
-
const reason = eventDetails.reason;
|
|
1667
|
-
if (open === nextOpen && eventDetails.trigger === activeTriggerElement && lastOpenChangeReason === reason) {
|
|
1668
|
-
return;
|
|
1669
|
-
}
|
|
1670
|
-
eventDetails.preventUnmountOnClose = () => {
|
|
1671
|
-
store.set("preventUnmountingOnClose", true);
|
|
1672
|
-
};
|
|
1673
|
-
if (!nextOpen && eventDetails.trigger == null) {
|
|
1674
|
-
eventDetails.trigger = activeTriggerElement ?? undefined;
|
|
1675
|
-
}
|
|
1676
|
-
onOpenChange?.(nextOpen, eventDetails);
|
|
1677
|
-
if (eventDetails.isCanceled) {
|
|
1678
|
-
return;
|
|
1679
|
-
}
|
|
1680
|
-
store.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);
|
|
1681
|
-
const nativeEvent = eventDetails.event;
|
|
1682
|
-
if (nextOpen === false && nativeEvent?.type === "click" && nativeEvent.pointerType === "touch" && !allowTouchToCloseRef.current) {
|
|
1683
|
-
return;
|
|
1684
|
-
}
|
|
1685
|
-
if (!nextOpen && activeIndex !== null) {
|
|
1686
|
-
const activeOption = store.context.itemDomElements.current[activeIndex];
|
|
1687
|
-
queueMicrotask(() => {
|
|
1688
|
-
activeOption?.setAttribute("tabindex", "-1");
|
|
1689
|
-
});
|
|
1690
|
-
}
|
|
1691
|
-
if (nextOpen && reason === exports_reason_parts.triggerFocus) {
|
|
1692
|
-
allowTouchToCloseRef.current = false;
|
|
1693
|
-
allowTouchToCloseTimeout.start(300, () => {
|
|
1694
|
-
allowTouchToCloseRef.current = true;
|
|
1695
|
-
});
|
|
1696
|
-
} else {
|
|
1697
|
-
allowTouchToCloseRef.current = true;
|
|
1698
|
-
allowTouchToCloseTimeout.clear();
|
|
1699
|
-
}
|
|
1700
|
-
const isKeyboardClick = (reason === exports_reason_parts.triggerPress || reason === exports_reason_parts.itemPress) && nativeEvent.detail === 0 && nativeEvent?.isTrusted;
|
|
1701
|
-
const isDismissClose = !nextOpen && (reason === exports_reason_parts.escapeKey || reason == null);
|
|
1702
|
-
const updatedState = {
|
|
1703
|
-
open: nextOpen,
|
|
1704
|
-
openChangeReason: reason
|
|
1705
|
-
};
|
|
1706
|
-
openEventRef.current = eventDetails.event ?? null;
|
|
1707
|
-
const newTriggerId = eventDetails.trigger?.id ?? null;
|
|
1708
|
-
if (newTriggerId || nextOpen) {
|
|
1709
|
-
updatedState.activeTriggerId = newTriggerId;
|
|
1710
|
-
updatedState.activeTriggerElement = eventDetails.trigger ?? null;
|
|
1711
|
-
}
|
|
1712
|
-
store.update(updatedState);
|
|
1713
|
-
if (parent.type === "menubar" && (reason === exports_reason_parts.triggerFocus || reason === exports_reason_parts.focusOut || reason === exports_reason_parts.triggerHover || reason === exports_reason_parts.listNavigation || reason === exports_reason_parts.siblingOpen)) {
|
|
1714
|
-
store.set("instantType", "group");
|
|
1715
|
-
} else if (isKeyboardClick || isDismissClose) {
|
|
1716
|
-
store.set("instantType", isKeyboardClick ? "click" : "dismiss");
|
|
1717
|
-
} else {
|
|
1718
|
-
store.set("instantType", undefined);
|
|
1719
|
-
}
|
|
1720
|
-
});
|
|
1721
|
-
const floatingRootContext = useSyncedFloatingRootContext({
|
|
1722
|
-
popupStore: store,
|
|
1723
|
-
floatingId,
|
|
1724
|
-
nested: floatingParentNodeIdFromContext != null,
|
|
1725
|
-
onOpenChange: setOpen
|
|
1726
|
-
});
|
|
1727
|
-
const floatingEvents = floatingRootContext.context.events;
|
|
1728
|
-
React27.useEffect(() => {
|
|
1729
|
-
const handleSetOpenEvent = ({
|
|
1730
|
-
open: nextOpen,
|
|
1731
|
-
eventDetails
|
|
1732
|
-
}) => setOpen(nextOpen, eventDetails);
|
|
1733
|
-
floatingEvents.on("setOpen", handleSetOpenEvent);
|
|
1734
|
-
return () => {
|
|
1735
|
-
floatingEvents?.off("setOpen", handleSetOpenEvent);
|
|
1736
|
-
};
|
|
1737
|
-
}, [floatingEvents, setOpen]);
|
|
1738
|
-
const handleImperativeClose = React27.useCallback(() => {
|
|
1739
|
-
store.setOpen(false, createChangeEventDetails(exports_reason_parts.imperativeAction));
|
|
1740
|
-
}, [store]);
|
|
1741
|
-
React27.useImperativeHandle(actionsRef, () => ({
|
|
1742
|
-
unmount: forceUnmount,
|
|
1743
|
-
close: handleImperativeClose
|
|
1744
|
-
}), [forceUnmount, handleImperativeClose]);
|
|
1745
|
-
let ctx;
|
|
1746
|
-
if (parent.type === "context-menu") {
|
|
1747
|
-
ctx = parent.context;
|
|
1748
|
-
}
|
|
1749
|
-
React27.useImperativeHandle(ctx?.positionerRef, () => positionerElement, [positionerElement]);
|
|
1750
|
-
React27.useImperativeHandle(ctx?.actionsRef, () => ({
|
|
1751
|
-
setOpen
|
|
1752
|
-
}), [setOpen]);
|
|
1753
|
-
const dismiss = useDismiss(floatingRootContext, {
|
|
1754
|
-
enabled: !disabled,
|
|
1755
|
-
bubbles: {
|
|
1756
|
-
escapeKey: closeParentOnEsc && parent.type === "menu"
|
|
1757
|
-
},
|
|
1758
|
-
outsidePress() {
|
|
1759
|
-
if (parent.type !== "context-menu" || openEventRef.current?.type === "contextmenu") {
|
|
1760
|
-
return true;
|
|
1761
|
-
}
|
|
1762
|
-
return allowOutsidePressDismissalRef.current;
|
|
1763
|
-
},
|
|
1764
|
-
externalTree: nested ? floatingTreeRoot : undefined
|
|
1765
|
-
});
|
|
1766
|
-
const direction = useDirection();
|
|
1767
|
-
const setActiveIndex = React27.useCallback((index) => {
|
|
1768
|
-
if (store.select("activeIndex") === index) {
|
|
1769
|
-
return;
|
|
1770
|
-
}
|
|
1771
|
-
store.set("activeIndex", index);
|
|
1772
|
-
}, [store]);
|
|
1773
|
-
const listNavigation = useListNavigation(floatingRootContext, {
|
|
1774
|
-
enabled: !disabled,
|
|
1775
|
-
listRef: store.context.itemDomElements,
|
|
1776
|
-
activeIndex,
|
|
1777
|
-
nested: parent.type !== undefined,
|
|
1778
|
-
loopFocus,
|
|
1779
|
-
orientation,
|
|
1780
|
-
parentOrientation: parent.type === "menubar" ? parent.context.orientation : undefined,
|
|
1781
|
-
rtl: direction === "rtl",
|
|
1782
|
-
disabledIndices: EMPTY_ARRAY,
|
|
1783
|
-
onNavigate: setActiveIndex,
|
|
1784
|
-
openOnArrowKeyDown: parent.type !== "context-menu",
|
|
1785
|
-
externalTree: nested ? floatingTreeRoot : undefined,
|
|
1786
|
-
focusItemOnHover: highlightItemOnHover
|
|
1787
|
-
});
|
|
1788
|
-
const onTyping = React27.useCallback((nextTyping) => {
|
|
1789
|
-
store.context.typingRef.current = nextTyping;
|
|
1790
|
-
}, [store]);
|
|
1791
|
-
const typeahead = useTypeahead(floatingRootContext, {
|
|
1792
|
-
listRef: store.context.itemLabels,
|
|
1793
|
-
elementsRef: store.context.itemDomElements,
|
|
1794
|
-
activeIndex,
|
|
1795
|
-
resetMs: TYPEAHEAD_RESET_MS,
|
|
1796
|
-
onMatch: (index) => {
|
|
1797
|
-
if (open && index !== activeIndex) {
|
|
1798
|
-
store.set("activeIndex", index);
|
|
1799
|
-
}
|
|
1800
|
-
},
|
|
1801
|
-
onTyping
|
|
1802
|
-
});
|
|
1803
|
-
const activeTriggerProps = React27.useMemo(() => {
|
|
1804
|
-
const mergedProps = mergeProps(typeahead.reference, listNavigation.reference, dismiss.reference, {
|
|
1805
|
-
onMouseMove() {
|
|
1806
|
-
store.set("allowMouseEnter", true);
|
|
1807
|
-
}
|
|
1808
|
-
}, interactionTypeProps);
|
|
1809
|
-
mergedProps["aria-haspopup"] = "menu";
|
|
1810
|
-
mergedProps["aria-expanded"] = open;
|
|
1811
|
-
return mergedProps;
|
|
1812
|
-
}, [store, typeahead.reference, listNavigation.reference, dismiss.reference, interactionTypeProps, open]);
|
|
1813
|
-
const inactiveTriggerProps = React27.useMemo(() => {
|
|
1814
|
-
const mergedProps = mergeProps(listNavigation.trigger, dismiss.trigger, interactionTypeProps);
|
|
1815
|
-
mergedProps["aria-haspopup"] = "menu";
|
|
1816
|
-
mergedProps["aria-expanded"] = false;
|
|
1817
|
-
return mergedProps;
|
|
1818
|
-
}, [listNavigation.trigger, dismiss.trigger, interactionTypeProps]);
|
|
1819
|
-
const popupProps = React27.useMemo(() => mergeProps(FOCUSABLE_POPUP_PROPS, {
|
|
1820
|
-
id: floatingId,
|
|
1821
|
-
role: "menu",
|
|
1822
|
-
"aria-labelledby": activeTriggerElement?.id,
|
|
1823
|
-
onMouseMove() {
|
|
1824
|
-
store.set("allowMouseEnter", true);
|
|
1825
|
-
if (parent.type === "menu") {
|
|
1826
|
-
store.set("hoverEnabled", false);
|
|
1827
|
-
}
|
|
1828
|
-
},
|
|
1829
|
-
onClick() {
|
|
1830
|
-
if (store.select("hoverEnabled")) {
|
|
1831
|
-
store.set("hoverEnabled", false);
|
|
1832
|
-
}
|
|
1833
|
-
},
|
|
1834
|
-
onKeyDown(event) {
|
|
1835
|
-
const relay = store.select("keyboardEventRelay");
|
|
1836
|
-
if (relay && !event.isPropagationStopped()) {
|
|
1837
|
-
relay(event);
|
|
1838
|
-
}
|
|
1839
|
-
}
|
|
1840
|
-
}, typeahead.floating, listNavigation.floating, dismiss.floating), [activeTriggerElement, floatingId, parent.type, store, typeahead.floating, listNavigation.floating, dismiss.floating]);
|
|
1841
|
-
const itemProps = listNavigation.item ?? EMPTY_OBJECT;
|
|
1842
|
-
usePopupInteractionProps(store, {
|
|
1843
|
-
floatingRootContext,
|
|
1844
|
-
activeTriggerProps,
|
|
1845
|
-
inactiveTriggerProps,
|
|
1846
|
-
popupProps,
|
|
1847
|
-
itemProps
|
|
1848
|
-
});
|
|
1849
|
-
const context = React27.useMemo(() => ({
|
|
1850
|
-
store,
|
|
1851
|
-
parent: parentFromContext
|
|
1852
|
-
}), [store, parentFromContext]);
|
|
1853
|
-
const content = /* @__PURE__ */ _jsx8(MenuRootContext.Provider, {
|
|
1854
|
-
value: context,
|
|
1855
|
-
children: typeof children === "function" ? children({
|
|
1856
|
-
payload
|
|
1857
|
-
}) : children
|
|
1858
|
-
});
|
|
1859
|
-
if (parent.type === undefined || parent.type === "context-menu") {
|
|
1860
|
-
return /* @__PURE__ */ _jsx8(FloatingTree, {
|
|
1861
|
-
externalTree: floatingTreeRoot,
|
|
1862
|
-
children: content
|
|
1863
|
-
});
|
|
1864
|
-
}
|
|
1865
|
-
return content;
|
|
1866
|
-
});
|
|
1867
|
-
if (true)
|
|
1868
|
-
MenuRoot.displayName = "MenuRoot";
|
|
1869
|
-
// node_modules/@base-ui/react/esm/menu/submenu-root/MenuSubmenuRoot.js
|
|
1870
|
-
import * as React28 from "react";
|
|
1871
|
-
import { jsx as _jsx9 } from "react/jsx-runtime";
|
|
1872
|
-
"use client";
|
|
1873
|
-
function MenuSubmenuRoot(props) {
|
|
1874
|
-
const parentMenu = useMenuRootContext().store;
|
|
1875
|
-
const contextValue = React28.useMemo(() => ({
|
|
1876
|
-
parentMenu
|
|
1877
|
-
}), [parentMenu]);
|
|
1878
|
-
return /* @__PURE__ */ _jsx9(MenuSubmenuRootContext.Provider, {
|
|
1879
|
-
value: contextValue,
|
|
1880
|
-
children: /* @__PURE__ */ _jsx9(MenuRoot, {
|
|
1881
|
-
...props
|
|
1882
|
-
})
|
|
1883
|
-
});
|
|
1884
|
-
}
|
|
1885
|
-
// node_modules/@base-ui/react/esm/menu/trigger/MenuTrigger.js
|
|
1886
|
-
import * as React30 from "react";
|
|
1887
|
-
|
|
1888
|
-
// node_modules/@base-ui/react/esm/menu/utils/findRootOwnerId.js
|
|
1889
|
-
function findRootOwnerId(node) {
|
|
1890
|
-
if (isHTMLElement(node) && node.hasAttribute("data-rootownerid")) {
|
|
1891
|
-
return node.getAttribute("data-rootownerid") ?? undefined;
|
|
1892
|
-
}
|
|
1893
|
-
if (isLastTraversableNode(node)) {
|
|
1894
|
-
return;
|
|
1895
|
-
}
|
|
1896
|
-
return findRootOwnerId(getParentNode(node));
|
|
1897
|
-
}
|
|
1898
|
-
|
|
1899
|
-
// node_modules/@base-ui/react/esm/utils/useMixedToggleClickHandler.js
|
|
1900
|
-
import * as React29 from "react";
|
|
1901
|
-
"use client";
|
|
1902
|
-
function useMixedToggleClickHandler(params) {
|
|
1903
|
-
const {
|
|
1904
|
-
enabled = true,
|
|
1905
|
-
mouseDownAction,
|
|
1906
|
-
open
|
|
1907
|
-
} = params;
|
|
1908
|
-
const ignoreClickRef = React29.useRef(false);
|
|
1909
|
-
return React29.useMemo(() => {
|
|
1910
|
-
if (!enabled) {
|
|
1911
|
-
return EMPTY_OBJECT;
|
|
1912
|
-
}
|
|
1913
|
-
return {
|
|
1914
|
-
onMouseDown: (event) => {
|
|
1915
|
-
if (mouseDownAction === "open" && !open || mouseDownAction === "close" && open) {
|
|
1916
|
-
ignoreClickRef.current = true;
|
|
1917
|
-
ownerDocument(event.currentTarget).addEventListener("click", () => {
|
|
1918
|
-
ignoreClickRef.current = false;
|
|
1919
|
-
}, {
|
|
1920
|
-
once: true
|
|
1921
|
-
});
|
|
1922
|
-
}
|
|
1923
|
-
},
|
|
1924
|
-
onClick: (event) => {
|
|
1925
|
-
if (ignoreClickRef.current) {
|
|
1926
|
-
ignoreClickRef.current = false;
|
|
1927
|
-
event.preventBaseUIHandler();
|
|
1928
|
-
}
|
|
1929
|
-
}
|
|
1930
|
-
};
|
|
1931
|
-
}, [enabled, mouseDownAction, open]);
|
|
1932
|
-
}
|
|
1933
|
-
|
|
1934
|
-
// node_modules/@base-ui/react/esm/menu/trigger/MenuTrigger.js
|
|
1935
|
-
import { jsx as _jsx10, jsxs as _jsxs2 } from "react/jsx-runtime";
|
|
1936
|
-
"use client";
|
|
1937
|
-
var BOUNDARY_OFFSET = 2;
|
|
1938
|
-
var MenuTrigger = fastComponentRef(function MenuTrigger2(componentProps, forwardedRef) {
|
|
1939
|
-
const {
|
|
1940
|
-
render,
|
|
1941
|
-
className,
|
|
1942
|
-
style,
|
|
1943
|
-
disabled: disabledProp = false,
|
|
1944
|
-
nativeButton = true,
|
|
1945
|
-
id: idProp,
|
|
1946
|
-
openOnHover: openOnHoverProp,
|
|
1947
|
-
delay = 100,
|
|
1948
|
-
closeDelay = 0,
|
|
1949
|
-
handle,
|
|
1950
|
-
payload,
|
|
1951
|
-
...elementProps
|
|
1952
|
-
} = componentProps;
|
|
1953
|
-
const rootContext = useMenuRootContext(true);
|
|
1954
|
-
const store = handle?.store ?? rootContext?.store;
|
|
1955
|
-
if (!store) {
|
|
1956
|
-
throw new Error("Base UI: <Menu.Trigger> must be either used within a <Menu.Root> component or provided with a handle.");
|
|
1957
|
-
}
|
|
1958
|
-
const thisTriggerId = useBaseUiId(idProp);
|
|
1959
|
-
const isTriggerActive = store.useState("isTriggerActive", thisTriggerId);
|
|
1960
|
-
const floatingRootContext = store.useState("floatingRootContext");
|
|
1961
|
-
const isOpenedByThisTrigger = store.useState("isOpenedByTrigger", thisTriggerId);
|
|
1962
|
-
const popupId = store.useState("triggerPopupId", thisTriggerId);
|
|
1963
|
-
const triggerElementRef = React30.useRef(null);
|
|
1964
|
-
const parent = useMenuParent();
|
|
1965
|
-
const compositeRootContext = useCompositeRootContext(true);
|
|
1966
|
-
const floatingTreeRootFromContext = useFloatingTree();
|
|
1967
|
-
const floatingTreeRoot = React30.useMemo(() => {
|
|
1968
|
-
return floatingTreeRootFromContext ?? new FloatingTreeStore;
|
|
1969
|
-
}, [floatingTreeRootFromContext]);
|
|
1970
|
-
const floatingNodeId = useFloatingNodeId(floatingTreeRoot);
|
|
1971
|
-
const floatingParentNodeId = useFloatingParentNodeId();
|
|
1972
|
-
const {
|
|
1973
|
-
registerTrigger,
|
|
1974
|
-
isMountedByThisTrigger
|
|
1975
|
-
} = useTriggerDataForwarding(thisTriggerId, triggerElementRef, store, {
|
|
1976
|
-
payload,
|
|
1977
|
-
closeDelay,
|
|
1978
|
-
parent,
|
|
1979
|
-
floatingTreeRoot,
|
|
1980
|
-
floatingNodeId,
|
|
1981
|
-
floatingParentNodeId,
|
|
1982
|
-
keyboardEventRelay: compositeRootContext?.relayKeyboardEvent
|
|
1983
|
-
});
|
|
1984
|
-
const isInMenubar = parent.type === "menubar";
|
|
1985
|
-
const rootDisabled = store.useState("disabled");
|
|
1986
|
-
const disabled = disabledProp || rootDisabled || isInMenubar && parent.context.disabled;
|
|
1987
|
-
const {
|
|
1988
|
-
getButtonProps,
|
|
1989
|
-
buttonRef
|
|
1990
|
-
} = useButton({
|
|
1991
|
-
disabled,
|
|
1992
|
-
native: nativeButton
|
|
1993
|
-
});
|
|
1994
|
-
React30.useEffect(() => {
|
|
1995
|
-
if (!isOpenedByThisTrigger && parent.type === undefined) {
|
|
1996
|
-
store.context.allowMouseUpTriggerRef.current = false;
|
|
1997
|
-
}
|
|
1998
|
-
}, [store, isOpenedByThisTrigger, parent.type]);
|
|
1999
|
-
const triggerRef = React30.useRef(null);
|
|
2000
|
-
const allowMouseUpTriggerTimeout = useTimeout();
|
|
2001
|
-
const handleDocumentMouseUp = useStableCallback((mouseEvent) => {
|
|
2002
|
-
if (!triggerRef.current) {
|
|
2003
|
-
return;
|
|
2004
|
-
}
|
|
2005
|
-
allowMouseUpTriggerTimeout.clear();
|
|
2006
|
-
store.context.allowMouseUpTriggerRef.current = false;
|
|
2007
|
-
const mouseUpTarget = mouseEvent.target;
|
|
2008
|
-
if (contains(triggerRef.current, mouseUpTarget) || contains(store.select("positionerElement"), mouseUpTarget) || mouseUpTarget === triggerRef.current) {
|
|
2009
|
-
return;
|
|
2010
|
-
}
|
|
2011
|
-
if (mouseUpTarget != null && findRootOwnerId(mouseUpTarget) === store.select("rootId")) {
|
|
2012
|
-
return;
|
|
2013
|
-
}
|
|
2014
|
-
const bounds = getPseudoElementBounds(triggerRef.current);
|
|
2015
|
-
if (mouseEvent.clientX >= bounds.left - BOUNDARY_OFFSET && mouseEvent.clientX <= bounds.right + BOUNDARY_OFFSET && mouseEvent.clientY >= bounds.top - BOUNDARY_OFFSET && mouseEvent.clientY <= bounds.bottom + BOUNDARY_OFFSET) {
|
|
2016
|
-
return;
|
|
2017
|
-
}
|
|
2018
|
-
floatingTreeRoot.events.emit("close", {
|
|
2019
|
-
domEvent: mouseEvent,
|
|
2020
|
-
reason: exports_reason_parts.cancelOpen
|
|
2021
|
-
});
|
|
2022
|
-
});
|
|
2023
|
-
React30.useEffect(() => {
|
|
2024
|
-
if (isOpenedByThisTrigger && store.select("lastOpenChangeReason") === exports_reason_parts.triggerHover) {
|
|
2025
|
-
const doc = ownerDocument(triggerRef.current);
|
|
2026
|
-
doc.addEventListener("mouseup", handleDocumentMouseUp, {
|
|
2027
|
-
once: true
|
|
2028
|
-
});
|
|
2029
|
-
}
|
|
2030
|
-
}, [isOpenedByThisTrigger, handleDocumentMouseUp, store]);
|
|
2031
|
-
const parentMenubarHasSubmenuOpen = isInMenubar && parent.context.hasSubmenuOpen;
|
|
2032
|
-
const openOnHover = openOnHoverProp ?? parentMenubarHasSubmenuOpen;
|
|
2033
|
-
const hoverProps = useHoverReferenceInteraction(floatingRootContext, {
|
|
2034
|
-
enabled: openOnHover && !disabled && parent.type !== "context-menu" && (!isInMenubar || parentMenubarHasSubmenuOpen && !isMountedByThisTrigger),
|
|
2035
|
-
handleClose: safePolygon({
|
|
2036
|
-
blockPointerEvents: !isInMenubar
|
|
2037
|
-
}),
|
|
2038
|
-
mouseOnly: true,
|
|
2039
|
-
move: false,
|
|
2040
|
-
restMs: parent.type === undefined ? delay : undefined,
|
|
2041
|
-
delay: {
|
|
2042
|
-
close: closeDelay
|
|
2043
|
-
},
|
|
2044
|
-
triggerElementRef,
|
|
2045
|
-
externalTree: floatingTreeRoot,
|
|
2046
|
-
isActiveTrigger: isTriggerActive,
|
|
2047
|
-
isClosing: () => store.select("transitionStatus") === "ending"
|
|
2048
|
-
});
|
|
2049
|
-
const stickIfOpen = useStickIfOpen(isOpenedByThisTrigger, store.select("lastOpenChangeReason"));
|
|
2050
|
-
const click = useClick(floatingRootContext, {
|
|
2051
|
-
enabled: !disabled && parent.type !== "context-menu",
|
|
2052
|
-
event: isOpenedByThisTrigger && isInMenubar ? "click" : "mousedown",
|
|
2053
|
-
toggle: true,
|
|
2054
|
-
ignoreMouse: false,
|
|
2055
|
-
stickIfOpen: parent.type === undefined ? stickIfOpen : false
|
|
2056
|
-
});
|
|
2057
|
-
const focus = useFocus(floatingRootContext, {
|
|
2058
|
-
enabled: !disabled && parentMenubarHasSubmenuOpen
|
|
2059
|
-
});
|
|
2060
|
-
const mixedToggleHandlers = useMixedToggleClickHandler({
|
|
2061
|
-
open: isOpenedByThisTrigger,
|
|
2062
|
-
enabled: isInMenubar,
|
|
2063
|
-
mouseDownAction: "open"
|
|
2064
|
-
});
|
|
2065
|
-
const localInteractionProps = React30.useMemo(() => mergeProps(focus.reference, click.reference), [focus.reference, click.reference]);
|
|
2066
|
-
const rootTriggerProps = store.useState("triggerProps", isMountedByThisTrigger);
|
|
2067
|
-
const {
|
|
2068
|
-
preFocusGuardRef,
|
|
2069
|
-
handlePreFocusGuardFocus,
|
|
2070
|
-
handleFocusTargetFocus
|
|
2071
|
-
} = useTriggerFocusGuards(store, triggerElementRef);
|
|
2072
|
-
const state = {
|
|
2073
|
-
disabled,
|
|
2074
|
-
open: isOpenedByThisTrigger
|
|
2075
|
-
};
|
|
2076
|
-
const ref = [triggerRef, forwardedRef, buttonRef, registerTrigger, triggerElementRef];
|
|
2077
|
-
const props = [localInteractionProps, hoverProps ?? EMPTY_OBJECT, rootTriggerProps, {
|
|
2078
|
-
"aria-haspopup": "menu",
|
|
2079
|
-
"aria-controls": popupId,
|
|
2080
|
-
id: thisTriggerId,
|
|
2081
|
-
onMouseDown: (event) => {
|
|
2082
|
-
if (store.select("open")) {
|
|
2083
|
-
return;
|
|
2084
|
-
}
|
|
2085
|
-
allowMouseUpTriggerTimeout.start(200, () => {
|
|
2086
|
-
store.context.allowMouseUpTriggerRef.current = true;
|
|
2087
|
-
});
|
|
2088
|
-
const doc = ownerDocument(event.currentTarget);
|
|
2089
|
-
doc.addEventListener("mouseup", handleDocumentMouseUp, {
|
|
2090
|
-
once: true
|
|
2091
|
-
});
|
|
2092
|
-
}
|
|
2093
|
-
}, isInMenubar ? {
|
|
2094
|
-
role: "menuitem"
|
|
2095
|
-
} : {}, mixedToggleHandlers, elementProps, getButtonProps];
|
|
2096
|
-
const element = useRenderElement("button", componentProps, {
|
|
2097
|
-
enabled: !isInMenubar,
|
|
2098
|
-
stateAttributesMapping: pressableTriggerOpenStateMapping,
|
|
2099
|
-
state,
|
|
2100
|
-
ref,
|
|
2101
|
-
props
|
|
2102
|
-
});
|
|
2103
|
-
if (isInMenubar) {
|
|
2104
|
-
return /* @__PURE__ */ _jsx10(CompositeItem, {
|
|
2105
|
-
tag: "button",
|
|
2106
|
-
render,
|
|
2107
|
-
className,
|
|
2108
|
-
style,
|
|
2109
|
-
state,
|
|
2110
|
-
refs: ref,
|
|
2111
|
-
props,
|
|
2112
|
-
stateAttributesMapping: pressableTriggerOpenStateMapping
|
|
2113
|
-
});
|
|
2114
|
-
}
|
|
2115
|
-
if (isOpenedByThisTrigger) {
|
|
2116
|
-
return /* @__PURE__ */ _jsxs2(React30.Fragment, {
|
|
2117
|
-
children: [/* @__PURE__ */ _jsx10(FocusGuard, {
|
|
2118
|
-
ref: preFocusGuardRef,
|
|
2119
|
-
onFocus: handlePreFocusGuardFocus
|
|
2120
|
-
}, `${thisTriggerId}-pre-focus-guard`), /* @__PURE__ */ _jsx10(React30.Fragment, {
|
|
2121
|
-
children: element
|
|
2122
|
-
}, thisTriggerId), /* @__PURE__ */ _jsx10(FocusGuard, {
|
|
2123
|
-
ref: store.context.triggerFocusTargetRef,
|
|
2124
|
-
onFocus: handleFocusTargetFocus
|
|
2125
|
-
}, `${thisTriggerId}-post-focus-guard`)]
|
|
2126
|
-
});
|
|
2127
|
-
}
|
|
2128
|
-
return /* @__PURE__ */ _jsx10(React30.Fragment, {
|
|
2129
|
-
children: element
|
|
2130
|
-
}, thisTriggerId);
|
|
2131
|
-
});
|
|
2132
|
-
if (true)
|
|
2133
|
-
MenuTrigger.displayName = "MenuTrigger";
|
|
2134
|
-
function useStickIfOpen(open, openReason) {
|
|
2135
|
-
const stickIfOpenTimeout = useTimeout();
|
|
2136
|
-
const [stickIfOpen, setStickIfOpen] = React30.useState(false);
|
|
2137
|
-
useIsoLayoutEffect(() => {
|
|
2138
|
-
if (open && openReason === "trigger-hover") {
|
|
2139
|
-
setStickIfOpen(true);
|
|
2140
|
-
stickIfOpenTimeout.start(PATIENT_CLICK_THRESHOLD, () => {
|
|
2141
|
-
setStickIfOpen(false);
|
|
2142
|
-
});
|
|
2143
|
-
} else if (!open) {
|
|
2144
|
-
stickIfOpenTimeout.clear();
|
|
2145
|
-
setStickIfOpen(false);
|
|
2146
|
-
}
|
|
2147
|
-
}, [open, openReason, stickIfOpenTimeout]);
|
|
2148
|
-
return stickIfOpen;
|
|
2149
|
-
}
|
|
2150
|
-
function useMenuParent() {
|
|
2151
|
-
const contextMenuContext = useContextMenuRootContext(true);
|
|
2152
|
-
const parentContext = useMenuRootContext(true);
|
|
2153
|
-
const menubarContext = useMenubarContext(true);
|
|
2154
|
-
const parent = React30.useMemo(() => {
|
|
2155
|
-
if (menubarContext) {
|
|
2156
|
-
return {
|
|
2157
|
-
type: "menubar",
|
|
2158
|
-
context: menubarContext
|
|
2159
|
-
};
|
|
2160
|
-
}
|
|
2161
|
-
if (contextMenuContext && !parentContext) {
|
|
2162
|
-
return {
|
|
2163
|
-
type: "context-menu",
|
|
2164
|
-
context: contextMenuContext
|
|
2165
|
-
};
|
|
2166
|
-
}
|
|
2167
|
-
return {
|
|
2168
|
-
type: undefined
|
|
2169
|
-
};
|
|
2170
|
-
}, [contextMenuContext, parentContext, menubarContext]);
|
|
2171
|
-
return parent;
|
|
2172
|
-
}
|
|
2173
|
-
// node_modules/@base-ui/react/esm/menu/viewport/MenuViewport.js
|
|
2174
|
-
import * as React31 from "react";
|
|
2175
|
-
|
|
2176
|
-
// node_modules/@base-ui/react/esm/menu/viewport/MenuViewportCssVars.js
|
|
2177
|
-
var MenuViewportCssVars = /* @__PURE__ */ function(MenuViewportCssVars2) {
|
|
2178
|
-
MenuViewportCssVars2["popupWidth"] = "--popup-width";
|
|
2179
|
-
MenuViewportCssVars2["popupHeight"] = "--popup-height";
|
|
2180
|
-
return MenuViewportCssVars2;
|
|
2181
|
-
}({});
|
|
2182
|
-
|
|
2183
|
-
// node_modules/@base-ui/react/esm/menu/viewport/MenuViewport.js
|
|
2184
|
-
"use client";
|
|
2185
|
-
var stateAttributesMapping3 = {
|
|
2186
|
-
activationDirection: (value) => value ? {
|
|
2187
|
-
"data-activation-direction": value
|
|
2188
|
-
} : null
|
|
2189
|
-
};
|
|
2190
|
-
var MenuViewport = /* @__PURE__ */ React31.forwardRef(function MenuViewport2(componentProps, forwardedRef) {
|
|
2191
|
-
const {
|
|
2192
|
-
render,
|
|
2193
|
-
className,
|
|
2194
|
-
style,
|
|
2195
|
-
children,
|
|
2196
|
-
...elementProps
|
|
2197
|
-
} = componentProps;
|
|
2198
|
-
const {
|
|
2199
|
-
store
|
|
2200
|
-
} = useMenuRootContext();
|
|
2201
|
-
const {
|
|
2202
|
-
side
|
|
2203
|
-
} = useMenuPositionerContext();
|
|
2204
|
-
const instantType = store.useState("instantType");
|
|
2205
|
-
const {
|
|
2206
|
-
children: childrenToRender,
|
|
2207
|
-
state: viewportState
|
|
2208
|
-
} = usePopupViewport({
|
|
2209
|
-
store,
|
|
2210
|
-
side,
|
|
2211
|
-
cssVars: MenuViewportCssVars,
|
|
2212
|
-
children
|
|
2213
|
-
});
|
|
2214
|
-
const state = {
|
|
2215
|
-
activationDirection: viewportState.activationDirection,
|
|
2216
|
-
transitioning: viewportState.transitioning,
|
|
2217
|
-
instant: instantType
|
|
2218
|
-
};
|
|
2219
|
-
return useRenderElement("div", componentProps, {
|
|
2220
|
-
state,
|
|
2221
|
-
ref: forwardedRef,
|
|
2222
|
-
props: [elementProps, {
|
|
2223
|
-
children: childrenToRender
|
|
2224
|
-
}],
|
|
2225
|
-
stateAttributesMapping: stateAttributesMapping3
|
|
2226
|
-
});
|
|
2227
|
-
});
|
|
2228
|
-
if (true)
|
|
2229
|
-
MenuViewport.displayName = "MenuViewport";
|
|
2230
|
-
// node_modules/@base-ui/react/esm/menu/submenu-trigger/MenuSubmenuTrigger.js
|
|
2231
|
-
import * as React32 from "react";
|
|
2232
|
-
"use client";
|
|
2233
|
-
var MenuSubmenuTrigger = /* @__PURE__ */ React32.forwardRef(function MenuSubmenuTrigger2(componentProps, forwardedRef) {
|
|
2234
|
-
const {
|
|
2235
|
-
render,
|
|
2236
|
-
className,
|
|
2237
|
-
style,
|
|
2238
|
-
label,
|
|
2239
|
-
id: idProp,
|
|
2240
|
-
nativeButton = false,
|
|
2241
|
-
openOnHover = true,
|
|
2242
|
-
delay = 100,
|
|
2243
|
-
closeDelay = 0,
|
|
2244
|
-
disabled: disabledProp = false,
|
|
2245
|
-
...elementProps
|
|
2246
|
-
} = componentProps;
|
|
2247
|
-
const listItem = useCompositeListItem();
|
|
2248
|
-
const menuPositionerContext = useMenuPositionerContext();
|
|
2249
|
-
const {
|
|
2250
|
-
store
|
|
2251
|
-
} = useMenuRootContext();
|
|
2252
|
-
const thisTriggerId = useBaseUiId(idProp);
|
|
2253
|
-
const open = store.useState("open");
|
|
2254
|
-
const floatingRootContext = store.useState("floatingRootContext");
|
|
2255
|
-
const floatingTreeRoot = store.useState("floatingTreeRoot");
|
|
2256
|
-
const popupId = store.useState("triggerPopupId", thisTriggerId);
|
|
2257
|
-
const baseRegisterTrigger = useTriggerRegistration(thisTriggerId, store);
|
|
2258
|
-
const registerTrigger = React32.useCallback((element2) => {
|
|
2259
|
-
const cleanup = baseRegisterTrigger(element2);
|
|
2260
|
-
if (element2 !== null && store.select("open") && store.select("activeTriggerId") == null) {
|
|
2261
|
-
store.update({
|
|
2262
|
-
activeTriggerId: thisTriggerId,
|
|
2263
|
-
activeTriggerElement: element2,
|
|
2264
|
-
closeDelay
|
|
2265
|
-
});
|
|
2266
|
-
}
|
|
2267
|
-
return cleanup;
|
|
2268
|
-
}, [baseRegisterTrigger, closeDelay, store, thisTriggerId]);
|
|
2269
|
-
const triggerElementRef = React32.useRef(null);
|
|
2270
|
-
const handleTriggerElementRef = React32.useCallback((el) => {
|
|
2271
|
-
triggerElementRef.current = el;
|
|
2272
|
-
store.set("activeTriggerElement", el);
|
|
2273
|
-
}, [store]);
|
|
2274
|
-
if (true) {
|
|
2275
|
-
useIsoLayoutEffect(() => {
|
|
2276
|
-
const element2 = triggerElementRef.current;
|
|
2277
|
-
if (element2 && isElementDisabled(element2) && !disabledProp) {
|
|
2278
|
-
const ownerStackMessage = SafeReact.captureOwnerStack?.() || "";
|
|
2279
|
-
warn(`A disabled element was detected on <Menu.SubmenuTrigger>. To properly disable the trigger, use the \`disabled\` prop on the component instead of setting it on the rendered element.${ownerStackMessage}`);
|
|
2280
|
-
}
|
|
2281
|
-
});
|
|
2282
|
-
}
|
|
2283
|
-
const submenuRootContext = useMenuSubmenuRootContext();
|
|
2284
|
-
if (!submenuRootContext?.parentMenu) {
|
|
2285
|
-
throw new Error("Base UI: <Menu.SubmenuTrigger> must be placed in <Menu.SubmenuRoot>.");
|
|
2286
|
-
}
|
|
2287
|
-
store.useSyncedValue("closeDelay", closeDelay);
|
|
2288
|
-
const parentMenuStore = submenuRootContext.parentMenu;
|
|
2289
|
-
const itemProps = parentMenuStore.useState("itemProps");
|
|
2290
|
-
const highlighted = parentMenuStore.useState("isActive", listItem.index);
|
|
2291
|
-
const itemMetadata = React32.useMemo(() => ({
|
|
2292
|
-
type: "submenu-trigger",
|
|
2293
|
-
setActive() {
|
|
2294
|
-
parentMenuStore.set("activeIndex", listItem.index);
|
|
2295
|
-
}
|
|
2296
|
-
}), [parentMenuStore, listItem.index]);
|
|
2297
|
-
const rootDisabled = store.useState("disabled");
|
|
2298
|
-
const disabled = disabledProp || rootDisabled;
|
|
2299
|
-
const {
|
|
2300
|
-
getItemProps,
|
|
2301
|
-
itemRef
|
|
2302
|
-
} = useMenuItem({
|
|
2303
|
-
closeOnClick: false,
|
|
2304
|
-
disabled,
|
|
2305
|
-
highlighted,
|
|
2306
|
-
id: thisTriggerId,
|
|
2307
|
-
store,
|
|
2308
|
-
typingRef: parentMenuStore.context.typingRef,
|
|
2309
|
-
nativeButton,
|
|
2310
|
-
itemMetadata,
|
|
2311
|
-
nodeId: menuPositionerContext?.context.nodeId
|
|
2312
|
-
});
|
|
2313
|
-
const hoverEnabled = store.useState("hoverEnabled");
|
|
2314
|
-
const allowMouseEnter = parentMenuStore.useState("allowMouseEnter");
|
|
2315
|
-
const hoverProps = useHoverReferenceInteraction(floatingRootContext, {
|
|
2316
|
-
enabled: hoverEnabled && openOnHover && !disabled,
|
|
2317
|
-
handleClose: safePolygon({
|
|
2318
|
-
blockPointerEvents: true
|
|
2319
|
-
}),
|
|
2320
|
-
mouseOnly: true,
|
|
2321
|
-
move: true,
|
|
2322
|
-
restMs: delay,
|
|
2323
|
-
delay: allowMouseEnter ? {
|
|
2324
|
-
open: delay,
|
|
2325
|
-
close: closeDelay
|
|
2326
|
-
} : 0,
|
|
2327
|
-
triggerElementRef,
|
|
2328
|
-
externalTree: floatingTreeRoot,
|
|
2329
|
-
isClosing: () => store.select("transitionStatus") === "ending"
|
|
2330
|
-
});
|
|
2331
|
-
const click = useClick(floatingRootContext, {
|
|
2332
|
-
enabled: !disabled,
|
|
2333
|
-
event: "mousedown",
|
|
2334
|
-
toggle: !openOnHover,
|
|
2335
|
-
ignoreMouse: openOnHover,
|
|
2336
|
-
stickIfOpen: false
|
|
2337
|
-
});
|
|
2338
|
-
const localInteractionProps = click.reference ?? EMPTY_OBJECT;
|
|
2339
|
-
const rootTriggerProps = store.useState("triggerProps", true);
|
|
2340
|
-
delete rootTriggerProps.id;
|
|
2341
|
-
const state = {
|
|
2342
|
-
disabled,
|
|
2343
|
-
highlighted,
|
|
2344
|
-
open
|
|
2345
|
-
};
|
|
2346
|
-
const element = useRenderElement("div", componentProps, {
|
|
2347
|
-
state,
|
|
2348
|
-
stateAttributesMapping: triggerOpenStateMapping,
|
|
2349
|
-
props: [localInteractionProps, hoverProps, rootTriggerProps, itemProps, {
|
|
2350
|
-
"aria-controls": popupId,
|
|
2351
|
-
tabIndex: open || highlighted ? 0 : -1,
|
|
2352
|
-
onBlur() {
|
|
2353
|
-
if (highlighted) {
|
|
2354
|
-
parentMenuStore.set("activeIndex", null);
|
|
2355
|
-
}
|
|
2356
|
-
}
|
|
2357
|
-
}, elementProps, getItemProps],
|
|
2358
|
-
ref: [forwardedRef, listItem.ref, itemRef, registerTrigger, handleTriggerElementRef]
|
|
2359
|
-
});
|
|
2360
|
-
return element;
|
|
2361
|
-
});
|
|
2362
|
-
if (true)
|
|
2363
|
-
MenuSubmenuTrigger.displayName = "MenuSubmenuTrigger";
|
|
2364
|
-
// node_modules/@base-ui/react/esm/menu/store/MenuHandle.js
|
|
2365
|
-
class MenuHandle {
|
|
2366
|
-
constructor() {
|
|
2367
|
-
this.store = new MenuStore;
|
|
2368
|
-
}
|
|
2369
|
-
open(triggerId) {
|
|
2370
|
-
const triggerElement = triggerId ? this.store.context.triggerElements.getById(triggerId) : undefined;
|
|
2371
|
-
if (triggerId && !triggerElement) {
|
|
2372
|
-
throw new Error(`Base UI: MenuHandle.open: No trigger found with id "${triggerId}".`);
|
|
2373
|
-
}
|
|
2374
|
-
this.store.setOpen(true, createChangeEventDetails("imperative-action", undefined, triggerElement));
|
|
2375
|
-
}
|
|
2376
|
-
close() {
|
|
2377
|
-
this.store.setOpen(false, createChangeEventDetails("imperative-action", undefined, undefined));
|
|
2378
|
-
}
|
|
2379
|
-
get isOpen() {
|
|
2380
|
-
return this.store.select("open");
|
|
2381
|
-
}
|
|
2382
|
-
}
|
|
2383
|
-
function createMenuHandle() {
|
|
2384
|
-
return new MenuHandle;
|
|
2385
|
-
}
|
|
2386
|
-
export { ContextMenuRootContext, useContextMenuRootContext, MenuRootContext, useMenuRootContext, MenuArrow, MenuBackdrop, MenuCheckboxItem, MenuCheckboxItemIndicator, MenuGroup, MenuGroupLabel, MenuItem, MenuLinkItem, MenuPopup, MenuPortal, MenuPositioner, MenuRadioGroup, MenuRadioItem, MenuRadioItemIndicator, MenuSubmenuRoot, findRootOwnerId, MenuSubmenuTrigger, exports_index_parts };
|