@stevederico/skateboard-ui 3.12.0 → 4.1.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 +25 -0
- package/README.md +37 -31
- package/dist/components/core/Command.js +33 -7
- 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 +372 -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 +243 -0
- package/dist/ui/dropdown-menu.d.ts +61 -0
- package/dist/ui/dropdown-menu.js +347 -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 +397 -0
- package/dist/ui/navigation-menu.d.ts +24 -0
- package/dist/ui/navigation-menu.js +203 -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 +126 -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 +66 -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 +226 -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 +96 -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 +42 -0
- package/dist/ui/use-floating.js +136 -0
- package/dist/ui/use-presence.d.ts +8 -0
- package/dist/ui/use-presence.js +48 -0
- package/dist/ui/use-typeahead.d.ts +19 -0
- package/dist/ui/use-typeahead.js +64 -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,1849 +0,0 @@
|
|
|
1
|
-
/* @base-ui/react 1.5.0 — vendored (MIT — MUI Inc).
|
|
2
|
-
* Refresh: scripts/vendor-base-ui.js (see header for instructions).
|
|
3
|
-
* Do not edit by hand. */
|
|
4
|
-
import {
|
|
5
|
-
CompositeRoot
|
|
6
|
-
} from "./_chunk-cdj8cpx5.js";
|
|
7
|
-
import"./_chunk-5tt5hk59.js";
|
|
8
|
-
import {
|
|
9
|
-
CompositeItem
|
|
10
|
-
} from "./_chunk-f2wttwrf.js";
|
|
11
|
-
import"./_chunk-j3qkyd10.js";
|
|
12
|
-
import {
|
|
13
|
-
adaptiveOrigin,
|
|
14
|
-
useAnchorPositioning,
|
|
15
|
-
usePositioner
|
|
16
|
-
} from "./_chunk-fqry7pew.js";
|
|
17
|
-
import {
|
|
18
|
-
getCssDimensions
|
|
19
|
-
} from "./_chunk-xcqbtm2f.js";
|
|
20
|
-
import"./_chunk-3enq1vat.js";
|
|
21
|
-
import"./_chunk-26cc610z.js";
|
|
22
|
-
import"./_chunk-j29xjete.js";
|
|
23
|
-
import"./_chunk-3xpke33f.js";
|
|
24
|
-
import {
|
|
25
|
-
useDirection
|
|
26
|
-
} from "./_chunk-gy0bpkmx.js";
|
|
27
|
-
import {
|
|
28
|
-
useControlled
|
|
29
|
-
} from "./_chunk-9x63vfqj.js";
|
|
30
|
-
import {
|
|
31
|
-
getEmptyRootContext
|
|
32
|
-
} from "./_chunk-5gaqyne5.js";
|
|
33
|
-
import {
|
|
34
|
-
popupStateMapping,
|
|
35
|
-
pressableTriggerOpenStateMapping,
|
|
36
|
-
triggerOpenStateMapping
|
|
37
|
-
} from "./_chunk-t7ppm3t0.js";
|
|
38
|
-
import {
|
|
39
|
-
inertValue
|
|
40
|
-
} from "./_chunk-3cpd1vjz.js";
|
|
41
|
-
import {
|
|
42
|
-
DROPDOWN_COLLISION_AVOIDANCE,
|
|
43
|
-
FloatingNode,
|
|
44
|
-
FloatingPortal,
|
|
45
|
-
FloatingTree,
|
|
46
|
-
FocusGuard,
|
|
47
|
-
PATIENT_CLICK_THRESHOLD,
|
|
48
|
-
POPUP_COLLISION_AVOIDANCE,
|
|
49
|
-
applySafePolygonPointerEventsMutation,
|
|
50
|
-
clearSafePolygonPointerEventsMutation,
|
|
51
|
-
disableFocusInside,
|
|
52
|
-
enableFocusInside,
|
|
53
|
-
getNextTabbable,
|
|
54
|
-
getNodeChildren,
|
|
55
|
-
getPreviousTabbable,
|
|
56
|
-
getTabbableAfterElement,
|
|
57
|
-
isOutsideEvent,
|
|
58
|
-
mergeCleanups,
|
|
59
|
-
ownerVisuallyHidden,
|
|
60
|
-
safePolygon,
|
|
61
|
-
useClick,
|
|
62
|
-
useDismiss,
|
|
63
|
-
useFloatingNodeId,
|
|
64
|
-
useFloatingParentNodeId,
|
|
65
|
-
useFloatingRootContext,
|
|
66
|
-
useFloatingTree,
|
|
67
|
-
useHoverFloatingInteraction,
|
|
68
|
-
useHoverInteractionSharedState,
|
|
69
|
-
useHoverReferenceInteraction
|
|
70
|
-
} from "./_chunk-2z044bba.js";
|
|
71
|
-
import"./_chunk-1vw45v38.js";
|
|
72
|
-
import {
|
|
73
|
-
activeElement,
|
|
74
|
-
contains,
|
|
75
|
-
getTarget
|
|
76
|
-
} from "./_chunk-cgptgywc.js";
|
|
77
|
-
import"./_chunk-pv7b791x.js";
|
|
78
|
-
import {
|
|
79
|
-
stopEvent
|
|
80
|
-
} from "./_chunk-kw8nnq00.js";
|
|
81
|
-
import"./_chunk-rrh8rt4v.js";
|
|
82
|
-
import {
|
|
83
|
-
useTimeout
|
|
84
|
-
} from "./_chunk-b6dkjkbw.js";
|
|
85
|
-
import"./_chunk-dan0mva4.js";
|
|
86
|
-
import"./_chunk-x11e1k9r.js";
|
|
87
|
-
import {
|
|
88
|
-
addEventListener
|
|
89
|
-
} from "./_chunk-ase0ydtt.js";
|
|
90
|
-
import {
|
|
91
|
-
useValueAsRef
|
|
92
|
-
} from "./_chunk-6kqramh9.js";
|
|
93
|
-
import {
|
|
94
|
-
ownerDocument
|
|
95
|
-
} from "./_chunk-451nqgsa.js";
|
|
96
|
-
import {
|
|
97
|
-
createChangeEventDetails,
|
|
98
|
-
exports_reason_parts
|
|
99
|
-
} from "./_chunk-e56mpvk1.js";
|
|
100
|
-
import {
|
|
101
|
-
useBaseUiId,
|
|
102
|
-
useId
|
|
103
|
-
} from "./_chunk-wdqynnjf.js";
|
|
104
|
-
import {
|
|
105
|
-
TransitionStatusDataAttributes,
|
|
106
|
-
transitionStatusMapping,
|
|
107
|
-
useAnimationsFinished,
|
|
108
|
-
useOpenChangeComplete,
|
|
109
|
-
useTransitionStatus
|
|
110
|
-
} from "./_chunk-e13rsb6b.js";
|
|
111
|
-
import"./_chunk-zk4mtm9m.js";
|
|
112
|
-
import {
|
|
113
|
-
useAnimationFrame
|
|
114
|
-
} from "./_chunk-8a9vv8am.js";
|
|
115
|
-
import"./_chunk-6ejf1z1r.js";
|
|
116
|
-
import {
|
|
117
|
-
useButton
|
|
118
|
-
} from "./_chunk-5xmdvndx.js";
|
|
119
|
-
import"./_chunk-hm5h9vsk.js";
|
|
120
|
-
import"./_chunk-cdgfsr3q.js";
|
|
121
|
-
import {
|
|
122
|
-
getWindow,
|
|
123
|
-
isHTMLElement
|
|
124
|
-
} from "./_chunk-000kmre8.js";
|
|
125
|
-
import {
|
|
126
|
-
useStableCallback
|
|
127
|
-
} from "./_chunk-cwvtvwc7.js";
|
|
128
|
-
import {
|
|
129
|
-
useIsoLayoutEffect
|
|
130
|
-
} from "./_chunk-5tze5c8q.js";
|
|
131
|
-
import {
|
|
132
|
-
EMPTY_ARRAY,
|
|
133
|
-
EMPTY_OBJECT,
|
|
134
|
-
useRenderElement
|
|
135
|
-
} from "./_chunk-x8xehj6d.js";
|
|
136
|
-
import {
|
|
137
|
-
__export,
|
|
138
|
-
mergeProps
|
|
139
|
-
} from "./_chunk-svxv97ph.js";
|
|
140
|
-
|
|
141
|
-
// node_modules/@base-ui/react/esm/navigation-menu/index.parts.js
|
|
142
|
-
var exports_index_parts = {};
|
|
143
|
-
__export(exports_index_parts, {
|
|
144
|
-
Viewport: () => NavigationMenuViewport,
|
|
145
|
-
Trigger: () => NavigationMenuTrigger,
|
|
146
|
-
Root: () => NavigationMenuRoot,
|
|
147
|
-
Positioner: () => NavigationMenuPositioner,
|
|
148
|
-
Portal: () => NavigationMenuPortal,
|
|
149
|
-
Popup: () => NavigationMenuPopup,
|
|
150
|
-
List: () => NavigationMenuList,
|
|
151
|
-
Link: () => NavigationMenuLink,
|
|
152
|
-
Item: () => NavigationMenuItem,
|
|
153
|
-
Icon: () => NavigationMenuIcon,
|
|
154
|
-
Content: () => NavigationMenuContent,
|
|
155
|
-
Backdrop: () => NavigationMenuBackdrop,
|
|
156
|
-
Arrow: () => NavigationMenuArrow
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
// node_modules/@base-ui/react/esm/navigation-menu/root/NavigationMenuRoot.js
|
|
160
|
-
import * as React2 from "react";
|
|
161
|
-
|
|
162
|
-
// node_modules/@base-ui/react/esm/navigation-menu/root/NavigationMenuRootContext.js
|
|
163
|
-
import * as React from "react";
|
|
164
|
-
"use client";
|
|
165
|
-
var NavigationMenuRootContext = /* @__PURE__ */ React.createContext(undefined);
|
|
166
|
-
if (true)
|
|
167
|
-
NavigationMenuRootContext.displayName = "NavigationMenuRootContext";
|
|
168
|
-
if (true) {
|
|
169
|
-
NavigationMenuRootContext.displayName = "NavigationMenuRootContext";
|
|
170
|
-
}
|
|
171
|
-
function useNavigationMenuRootContext(optional) {
|
|
172
|
-
const context = React.useContext(NavigationMenuRootContext);
|
|
173
|
-
if (context === undefined && !optional) {
|
|
174
|
-
throw new Error("Base UI: NavigationMenuRootContext is missing. Navigation Menu parts must be placed within <NavigationMenu.Root>.");
|
|
175
|
-
}
|
|
176
|
-
return context;
|
|
177
|
-
}
|
|
178
|
-
var NavigationMenuTreeContext = /* @__PURE__ */ React.createContext(undefined);
|
|
179
|
-
if (true)
|
|
180
|
-
NavigationMenuTreeContext.displayName = "NavigationMenuTreeContext";
|
|
181
|
-
function useNavigationMenuTreeContext() {
|
|
182
|
-
return React.useContext(NavigationMenuTreeContext);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
// node_modules/@base-ui/react/esm/navigation-menu/popup/NavigationMenuPopupCssVars.js
|
|
186
|
-
var NavigationMenuPopupCssVars = /* @__PURE__ */ function(NavigationMenuPopupCssVars2) {
|
|
187
|
-
NavigationMenuPopupCssVars2["popupWidth"] = "--popup-width";
|
|
188
|
-
NavigationMenuPopupCssVars2["popupHeight"] = "--popup-height";
|
|
189
|
-
return NavigationMenuPopupCssVars2;
|
|
190
|
-
}({});
|
|
191
|
-
|
|
192
|
-
// node_modules/@base-ui/react/esm/navigation-menu/positioner/NavigationMenuPositionerCssVars.js
|
|
193
|
-
var NavigationMenuPositionerCssVars = /* @__PURE__ */ function(NavigationMenuPositionerCssVars2) {
|
|
194
|
-
NavigationMenuPositionerCssVars2["availableWidth"] = "--available-width";
|
|
195
|
-
NavigationMenuPositionerCssVars2["availableHeight"] = "--available-height";
|
|
196
|
-
NavigationMenuPositionerCssVars2["anchorWidth"] = "--anchor-width";
|
|
197
|
-
NavigationMenuPositionerCssVars2["anchorHeight"] = "--anchor-height";
|
|
198
|
-
NavigationMenuPositionerCssVars2["transformOrigin"] = "--transform-origin";
|
|
199
|
-
NavigationMenuPositionerCssVars2["positionerWidth"] = "--positioner-width";
|
|
200
|
-
NavigationMenuPositionerCssVars2["positionerHeight"] = "--positioner-height";
|
|
201
|
-
return NavigationMenuPositionerCssVars2;
|
|
202
|
-
}({});
|
|
203
|
-
|
|
204
|
-
// node_modules/@base-ui/react/esm/navigation-menu/root/NavigationMenuRoot.js
|
|
205
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
206
|
-
"use client";
|
|
207
|
-
var blockedReturnFocusReasons = new Set([exports_reason_parts.triggerHover, exports_reason_parts.outsidePress, exports_reason_parts.focusOut]);
|
|
208
|
-
function setSharedFixedSize(popupElement, positionerElement) {
|
|
209
|
-
const {
|
|
210
|
-
width,
|
|
211
|
-
height
|
|
212
|
-
} = getCssDimensions(popupElement);
|
|
213
|
-
if (width === 0 || height === 0) {
|
|
214
|
-
return;
|
|
215
|
-
}
|
|
216
|
-
popupElement.style.setProperty(NavigationMenuPopupCssVars.popupWidth, `${width}px`);
|
|
217
|
-
popupElement.style.setProperty(NavigationMenuPopupCssVars.popupHeight, `${height}px`);
|
|
218
|
-
positionerElement.style.setProperty(NavigationMenuPositionerCssVars.positionerWidth, `${width}px`);
|
|
219
|
-
positionerElement.style.setProperty(NavigationMenuPositionerCssVars.positionerHeight, `${height}px`);
|
|
220
|
-
}
|
|
221
|
-
var NavigationMenuRoot = /* @__PURE__ */ React2.forwardRef(function NavigationMenuRoot2(componentProps, forwardedRef) {
|
|
222
|
-
const {
|
|
223
|
-
defaultValue = null,
|
|
224
|
-
value: valueParam,
|
|
225
|
-
onValueChange,
|
|
226
|
-
actionsRef,
|
|
227
|
-
delay = 50,
|
|
228
|
-
closeDelay = 50,
|
|
229
|
-
orientation = "horizontal",
|
|
230
|
-
onOpenChangeComplete
|
|
231
|
-
} = componentProps;
|
|
232
|
-
const nested = useFloatingParentNodeId() != null;
|
|
233
|
-
const parentRootContext = useNavigationMenuRootContext(true);
|
|
234
|
-
const [value, setValueUnwrapped] = useControlled({
|
|
235
|
-
controlled: valueParam,
|
|
236
|
-
default: defaultValue,
|
|
237
|
-
name: "NavigationMenu",
|
|
238
|
-
state: "value"
|
|
239
|
-
});
|
|
240
|
-
const open = value != null;
|
|
241
|
-
const closeReasonRef = React2.useRef(undefined);
|
|
242
|
-
const rootRef = React2.useRef(null);
|
|
243
|
-
const [positionerElement, setPositionerElement] = React2.useState(null);
|
|
244
|
-
const [popupElement, setPopupElement] = React2.useState(null);
|
|
245
|
-
const [viewportElement, setViewportElement] = React2.useState(null);
|
|
246
|
-
const [viewportTargetElement, setViewportTargetElement] = React2.useState(null);
|
|
247
|
-
const [activationDirection, setActivationDirection] = React2.useState(null);
|
|
248
|
-
const [floatingRootContext, setFloatingRootContext] = React2.useState(undefined);
|
|
249
|
-
const [viewportInert, setViewportInert] = React2.useState(false);
|
|
250
|
-
const prevTriggerElementRef = React2.useRef(null);
|
|
251
|
-
const currentContentRef = React2.useRef(null);
|
|
252
|
-
const beforeInsideRef = React2.useRef(null);
|
|
253
|
-
const afterInsideRef = React2.useRef(null);
|
|
254
|
-
const beforeOutsideRef = React2.useRef(null);
|
|
255
|
-
const afterOutsideRef = React2.useRef(null);
|
|
256
|
-
const popupAutoSizeResetRef = React2.useRef({
|
|
257
|
-
abortController: null,
|
|
258
|
-
owner: null
|
|
259
|
-
});
|
|
260
|
-
const {
|
|
261
|
-
mounted,
|
|
262
|
-
setMounted,
|
|
263
|
-
transitionStatus
|
|
264
|
-
} = useTransitionStatus(open);
|
|
265
|
-
React2.useEffect(() => {
|
|
266
|
-
setViewportInert(false);
|
|
267
|
-
}, [value]);
|
|
268
|
-
const setValue = useStableCallback((nextValue, eventDetails) => {
|
|
269
|
-
if (!nextValue) {
|
|
270
|
-
closeReasonRef.current = eventDetails.reason;
|
|
271
|
-
setActivationDirection(null);
|
|
272
|
-
setFloatingRootContext(undefined);
|
|
273
|
-
if (positionerElement && popupElement) {
|
|
274
|
-
setSharedFixedSize(popupElement, positionerElement);
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
if (nextValue !== value) {
|
|
278
|
-
onValueChange?.(nextValue, eventDetails);
|
|
279
|
-
}
|
|
280
|
-
if (eventDetails.isCanceled) {
|
|
281
|
-
return;
|
|
282
|
-
}
|
|
283
|
-
setValueUnwrapped(nextValue);
|
|
284
|
-
if (nested && !nextValue && eventDetails.reason === exports_reason_parts.linkPress && parentRootContext) {
|
|
285
|
-
parentRootContext.setValue(null, eventDetails);
|
|
286
|
-
}
|
|
287
|
-
});
|
|
288
|
-
const handleUnmount = useStableCallback(() => {
|
|
289
|
-
const doc = ownerDocument(rootRef.current);
|
|
290
|
-
const activeEl = activeElement(doc);
|
|
291
|
-
const isReturnFocusBlocked = closeReasonRef.current ? blockedReturnFocusReasons.has(closeReasonRef.current) : false;
|
|
292
|
-
if (!isReturnFocusBlocked && isHTMLElement(prevTriggerElementRef.current) && (activeEl === ownerDocument(popupElement).body || contains(popupElement, activeEl)) && popupElement) {
|
|
293
|
-
prevTriggerElementRef.current.focus({
|
|
294
|
-
preventScroll: true
|
|
295
|
-
});
|
|
296
|
-
prevTriggerElementRef.current = undefined;
|
|
297
|
-
}
|
|
298
|
-
setMounted(false);
|
|
299
|
-
onOpenChangeComplete?.(false);
|
|
300
|
-
setActivationDirection(null);
|
|
301
|
-
setFloatingRootContext(undefined);
|
|
302
|
-
currentContentRef.current = null;
|
|
303
|
-
closeReasonRef.current = undefined;
|
|
304
|
-
});
|
|
305
|
-
useOpenChangeComplete({
|
|
306
|
-
enabled: !actionsRef,
|
|
307
|
-
open,
|
|
308
|
-
ref: {
|
|
309
|
-
current: popupElement
|
|
310
|
-
},
|
|
311
|
-
onComplete() {
|
|
312
|
-
if (!open) {
|
|
313
|
-
handleUnmount();
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
});
|
|
317
|
-
useOpenChangeComplete({
|
|
318
|
-
enabled: !actionsRef,
|
|
319
|
-
open,
|
|
320
|
-
ref: {
|
|
321
|
-
current: viewportTargetElement
|
|
322
|
-
},
|
|
323
|
-
onComplete() {
|
|
324
|
-
if (!open) {
|
|
325
|
-
handleUnmount();
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
});
|
|
329
|
-
const contextValue = React2.useMemo(() => ({
|
|
330
|
-
open,
|
|
331
|
-
value,
|
|
332
|
-
setValue,
|
|
333
|
-
mounted,
|
|
334
|
-
transitionStatus,
|
|
335
|
-
positionerElement,
|
|
336
|
-
setPositionerElement,
|
|
337
|
-
popupElement,
|
|
338
|
-
setPopupElement,
|
|
339
|
-
viewportElement,
|
|
340
|
-
setViewportElement,
|
|
341
|
-
viewportTargetElement,
|
|
342
|
-
setViewportTargetElement,
|
|
343
|
-
activationDirection,
|
|
344
|
-
setActivationDirection,
|
|
345
|
-
floatingRootContext,
|
|
346
|
-
setFloatingRootContext,
|
|
347
|
-
currentContentRef,
|
|
348
|
-
nested,
|
|
349
|
-
rootRef,
|
|
350
|
-
beforeInsideRef,
|
|
351
|
-
afterInsideRef,
|
|
352
|
-
beforeOutsideRef,
|
|
353
|
-
afterOutsideRef,
|
|
354
|
-
prevTriggerElementRef,
|
|
355
|
-
popupAutoSizeResetRef,
|
|
356
|
-
delay,
|
|
357
|
-
closeDelay,
|
|
358
|
-
orientation,
|
|
359
|
-
viewportInert,
|
|
360
|
-
setViewportInert
|
|
361
|
-
}), [open, value, setValue, mounted, transitionStatus, positionerElement, popupElement, viewportElement, viewportTargetElement, activationDirection, floatingRootContext, nested, delay, closeDelay, orientation, viewportInert]);
|
|
362
|
-
const jsx = /* @__PURE__ */ _jsx(NavigationMenuRootContext.Provider, {
|
|
363
|
-
value: contextValue,
|
|
364
|
-
children: /* @__PURE__ */ _jsx(TreeContext, {
|
|
365
|
-
componentProps,
|
|
366
|
-
forwardedRef,
|
|
367
|
-
children: componentProps.children
|
|
368
|
-
})
|
|
369
|
-
});
|
|
370
|
-
if (!nested) {
|
|
371
|
-
return /* @__PURE__ */ _jsx(FloatingTree, {
|
|
372
|
-
children: jsx
|
|
373
|
-
});
|
|
374
|
-
}
|
|
375
|
-
return jsx;
|
|
376
|
-
});
|
|
377
|
-
if (true)
|
|
378
|
-
NavigationMenuRoot.displayName = "NavigationMenuRoot";
|
|
379
|
-
function TreeContext(props) {
|
|
380
|
-
const {
|
|
381
|
-
className,
|
|
382
|
-
render,
|
|
383
|
-
defaultValue,
|
|
384
|
-
value: valueParam,
|
|
385
|
-
onValueChange,
|
|
386
|
-
actionsRef,
|
|
387
|
-
delay,
|
|
388
|
-
closeDelay,
|
|
389
|
-
orientation,
|
|
390
|
-
onOpenChangeComplete,
|
|
391
|
-
style,
|
|
392
|
-
...elementProps
|
|
393
|
-
} = props.componentProps;
|
|
394
|
-
const nodeId = useFloatingNodeId();
|
|
395
|
-
const {
|
|
396
|
-
rootRef,
|
|
397
|
-
nested,
|
|
398
|
-
open
|
|
399
|
-
} = useNavigationMenuRootContext();
|
|
400
|
-
const state = {
|
|
401
|
-
open,
|
|
402
|
-
nested
|
|
403
|
-
};
|
|
404
|
-
const element = useRenderElement(nested ? "div" : "nav", props.componentProps, {
|
|
405
|
-
state,
|
|
406
|
-
ref: [props.forwardedRef, rootRef],
|
|
407
|
-
props: elementProps
|
|
408
|
-
});
|
|
409
|
-
return /* @__PURE__ */ _jsx(NavigationMenuTreeContext.Provider, {
|
|
410
|
-
value: nodeId,
|
|
411
|
-
children: /* @__PURE__ */ _jsx(FloatingNode, {
|
|
412
|
-
id: nodeId,
|
|
413
|
-
children: element
|
|
414
|
-
})
|
|
415
|
-
});
|
|
416
|
-
}
|
|
417
|
-
// node_modules/@base-ui/react/esm/navigation-menu/list/NavigationMenuList.js
|
|
418
|
-
import * as React4 from "react";
|
|
419
|
-
|
|
420
|
-
// node_modules/@base-ui/react/esm/navigation-menu/utils/constants.js
|
|
421
|
-
var NAVIGATION_MENU_TRIGGER_IDENTIFIER = "data-base-ui-navigation-menu-trigger";
|
|
422
|
-
|
|
423
|
-
// node_modules/@base-ui/react/esm/navigation-menu/list/NavigationMenuDismissContext.js
|
|
424
|
-
import * as React3 from "react";
|
|
425
|
-
"use client";
|
|
426
|
-
var NavigationMenuDismissContext = /* @__PURE__ */ React3.createContext(undefined);
|
|
427
|
-
if (true)
|
|
428
|
-
NavigationMenuDismissContext.displayName = "NavigationMenuDismissContext";
|
|
429
|
-
function useNavigationMenuDismissContext() {
|
|
430
|
-
return React3.useContext(NavigationMenuDismissContext);
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
// node_modules/@base-ui/react/esm/navigation-menu/list/NavigationMenuList.js
|
|
434
|
-
import { jsx as _jsx2 } from "react/jsx-runtime";
|
|
435
|
-
"use client";
|
|
436
|
-
var NavigationMenuList = /* @__PURE__ */ React4.forwardRef(function NavigationMenuList2(componentProps, forwardedRef) {
|
|
437
|
-
const {
|
|
438
|
-
render,
|
|
439
|
-
className,
|
|
440
|
-
style,
|
|
441
|
-
...elementProps
|
|
442
|
-
} = componentProps;
|
|
443
|
-
const nodeId = useNavigationMenuTreeContext();
|
|
444
|
-
const {
|
|
445
|
-
orientation,
|
|
446
|
-
open,
|
|
447
|
-
floatingRootContext,
|
|
448
|
-
positionerElement,
|
|
449
|
-
value,
|
|
450
|
-
closeDelay,
|
|
451
|
-
viewportElement,
|
|
452
|
-
nested
|
|
453
|
-
} = useNavigationMenuRootContext();
|
|
454
|
-
const fallbackContext = React4.useMemo(() => getEmptyRootContext(), []);
|
|
455
|
-
const context = floatingRootContext || fallbackContext;
|
|
456
|
-
const interactionsEnabled = positionerElement ? true : !value;
|
|
457
|
-
const hoverInteractionsEnabled = positionerElement || viewportElement ? true : !value;
|
|
458
|
-
useHoverFloatingInteraction(context, {
|
|
459
|
-
enabled: Boolean(floatingRootContext) && hoverInteractionsEnabled,
|
|
460
|
-
closeDelay,
|
|
461
|
-
nodeId
|
|
462
|
-
});
|
|
463
|
-
const dismiss = useDismiss(context, {
|
|
464
|
-
enabled: interactionsEnabled,
|
|
465
|
-
outsidePressEvent: "intentional",
|
|
466
|
-
outsidePress(event) {
|
|
467
|
-
const target = getTarget(event);
|
|
468
|
-
const closestNavigationMenuTrigger = target?.closest(`[${NAVIGATION_MENU_TRIGGER_IDENTIFIER}]`);
|
|
469
|
-
return closestNavigationMenuTrigger === null;
|
|
470
|
-
}
|
|
471
|
-
});
|
|
472
|
-
const dismissProps = floatingRootContext ? dismiss : undefined;
|
|
473
|
-
const state = {
|
|
474
|
-
open
|
|
475
|
-
};
|
|
476
|
-
const defaultProps = nested ? EMPTY_OBJECT : {
|
|
477
|
-
onKeyDown(event) {
|
|
478
|
-
const shouldStop = orientation === "horizontal" && (event.key === "ArrowLeft" || event.key === "ArrowRight") || orientation === "vertical" && (event.key === "ArrowUp" || event.key === "ArrowDown");
|
|
479
|
-
if (shouldStop) {
|
|
480
|
-
event.stopPropagation();
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
};
|
|
484
|
-
const props = [dismissProps?.floating || EMPTY_OBJECT, defaultProps, {
|
|
485
|
-
"aria-orientation": undefined
|
|
486
|
-
}, elementProps];
|
|
487
|
-
const element = useRenderElement("ul", componentProps, {
|
|
488
|
-
state,
|
|
489
|
-
ref: forwardedRef,
|
|
490
|
-
props,
|
|
491
|
-
enabled: nested
|
|
492
|
-
});
|
|
493
|
-
if (nested) {
|
|
494
|
-
return /* @__PURE__ */ _jsx2(NavigationMenuDismissContext.Provider, {
|
|
495
|
-
value: dismissProps,
|
|
496
|
-
children: element
|
|
497
|
-
});
|
|
498
|
-
}
|
|
499
|
-
return /* @__PURE__ */ _jsx2(NavigationMenuDismissContext.Provider, {
|
|
500
|
-
value: dismissProps,
|
|
501
|
-
children: /* @__PURE__ */ _jsx2(CompositeRoot, {
|
|
502
|
-
render,
|
|
503
|
-
className,
|
|
504
|
-
style,
|
|
505
|
-
state,
|
|
506
|
-
refs: [forwardedRef],
|
|
507
|
-
props,
|
|
508
|
-
loopFocus: false,
|
|
509
|
-
orientation,
|
|
510
|
-
tag: "ul"
|
|
511
|
-
})
|
|
512
|
-
});
|
|
513
|
-
});
|
|
514
|
-
if (true)
|
|
515
|
-
NavigationMenuList.displayName = "NavigationMenuList";
|
|
516
|
-
// node_modules/@base-ui/react/esm/navigation-menu/item/NavigationMenuItem.js
|
|
517
|
-
import * as React6 from "react";
|
|
518
|
-
|
|
519
|
-
// node_modules/@base-ui/react/esm/navigation-menu/item/NavigationMenuItemContext.js
|
|
520
|
-
import * as React5 from "react";
|
|
521
|
-
"use client";
|
|
522
|
-
var NavigationMenuItemContext = /* @__PURE__ */ React5.createContext(undefined);
|
|
523
|
-
if (true)
|
|
524
|
-
NavigationMenuItemContext.displayName = "NavigationMenuItemContext";
|
|
525
|
-
function useNavigationMenuItemContext() {
|
|
526
|
-
const value = React5.useContext(NavigationMenuItemContext);
|
|
527
|
-
if (!value) {
|
|
528
|
-
throw new Error("Base UI: NavigationMenuItem parts must be used within a <NavigationMenu.Item>.");
|
|
529
|
-
}
|
|
530
|
-
return value;
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
// node_modules/@base-ui/react/esm/navigation-menu/item/NavigationMenuItem.js
|
|
534
|
-
import { jsx as _jsx3 } from "react/jsx-runtime";
|
|
535
|
-
"use client";
|
|
536
|
-
var NavigationMenuItem = /* @__PURE__ */ React6.forwardRef(function NavigationMenuItem2(componentProps, forwardedRef) {
|
|
537
|
-
const {
|
|
538
|
-
render,
|
|
539
|
-
className,
|
|
540
|
-
style,
|
|
541
|
-
value: valueProp,
|
|
542
|
-
...elementProps
|
|
543
|
-
} = componentProps;
|
|
544
|
-
const fallbackValue = useBaseUiId();
|
|
545
|
-
const value = valueProp ?? fallbackValue;
|
|
546
|
-
const element = useRenderElement("li", componentProps, {
|
|
547
|
-
ref: forwardedRef,
|
|
548
|
-
props: elementProps
|
|
549
|
-
});
|
|
550
|
-
const contextValue = React6.useMemo(() => ({
|
|
551
|
-
value
|
|
552
|
-
}), [value]);
|
|
553
|
-
return /* @__PURE__ */ _jsx3(NavigationMenuItemContext.Provider, {
|
|
554
|
-
value: contextValue,
|
|
555
|
-
children: element
|
|
556
|
-
});
|
|
557
|
-
});
|
|
558
|
-
if (true)
|
|
559
|
-
NavigationMenuItem.displayName = "NavigationMenuItem";
|
|
560
|
-
// node_modules/@base-ui/react/esm/navigation-menu/content/NavigationMenuContent.js
|
|
561
|
-
import * as React7 from "react";
|
|
562
|
-
import * as ReactDOM from "react-dom";
|
|
563
|
-
import { jsx as _jsx4 } from "react/jsx-runtime";
|
|
564
|
-
"use client";
|
|
565
|
-
var stateAttributesMapping = {
|
|
566
|
-
...popupStateMapping,
|
|
567
|
-
...transitionStatusMapping,
|
|
568
|
-
activationDirection(value) {
|
|
569
|
-
if (!value) {
|
|
570
|
-
return null;
|
|
571
|
-
}
|
|
572
|
-
return {
|
|
573
|
-
"data-activation-direction": value
|
|
574
|
-
};
|
|
575
|
-
}
|
|
576
|
-
};
|
|
577
|
-
var NavigationMenuContent = /* @__PURE__ */ React7.forwardRef(function NavigationMenuContent2(componentProps, forwardedRef) {
|
|
578
|
-
const {
|
|
579
|
-
render,
|
|
580
|
-
className,
|
|
581
|
-
style,
|
|
582
|
-
keepMounted = false,
|
|
583
|
-
...elementProps
|
|
584
|
-
} = componentProps;
|
|
585
|
-
const {
|
|
586
|
-
mounted: popupMounted,
|
|
587
|
-
viewportElement,
|
|
588
|
-
value,
|
|
589
|
-
activationDirection,
|
|
590
|
-
currentContentRef,
|
|
591
|
-
viewportTargetElement
|
|
592
|
-
} = useNavigationMenuRootContext();
|
|
593
|
-
const {
|
|
594
|
-
value: itemValue
|
|
595
|
-
} = useNavigationMenuItemContext();
|
|
596
|
-
const nodeId = useNavigationMenuTreeContext();
|
|
597
|
-
const open = popupMounted && value === itemValue;
|
|
598
|
-
const ref = React7.useRef(null);
|
|
599
|
-
const [hasMountedInPortal, setHasMountedInPortal] = React7.useState(false);
|
|
600
|
-
const [focusInside, setFocusInside] = React7.useState(false);
|
|
601
|
-
const {
|
|
602
|
-
mounted,
|
|
603
|
-
setMounted,
|
|
604
|
-
transitionStatus
|
|
605
|
-
} = useTransitionStatus(open);
|
|
606
|
-
if (mounted && !popupMounted) {
|
|
607
|
-
setMounted(false);
|
|
608
|
-
}
|
|
609
|
-
useOpenChangeComplete({
|
|
610
|
-
ref,
|
|
611
|
-
open,
|
|
612
|
-
onComplete() {
|
|
613
|
-
if (!open) {
|
|
614
|
-
setMounted(false);
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
});
|
|
618
|
-
useIsoLayoutEffect(() => {
|
|
619
|
-
if (open && ref.current) {
|
|
620
|
-
currentContentRef.current = ref.current;
|
|
621
|
-
}
|
|
622
|
-
}, [open, currentContentRef]);
|
|
623
|
-
const state = {
|
|
624
|
-
open,
|
|
625
|
-
transitionStatus,
|
|
626
|
-
activationDirection
|
|
627
|
-
};
|
|
628
|
-
const handleCurrentContentRef = useStableCallback((node) => {
|
|
629
|
-
if (node && open) {
|
|
630
|
-
currentContentRef.current = node;
|
|
631
|
-
}
|
|
632
|
-
});
|
|
633
|
-
const commonProps = {
|
|
634
|
-
onFocus(event) {
|
|
635
|
-
const target = getTarget(event.nativeEvent);
|
|
636
|
-
if (target?.hasAttribute("data-base-ui-focus-guard")) {
|
|
637
|
-
return;
|
|
638
|
-
}
|
|
639
|
-
setFocusInside(true);
|
|
640
|
-
},
|
|
641
|
-
onBlur(event) {
|
|
642
|
-
if (!contains(event.currentTarget, event.relatedTarget)) {
|
|
643
|
-
setFocusInside(false);
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
};
|
|
647
|
-
const defaultProps = !open && mounted ? {
|
|
648
|
-
style: {
|
|
649
|
-
position: "absolute",
|
|
650
|
-
top: 0,
|
|
651
|
-
left: 0
|
|
652
|
-
},
|
|
653
|
-
inert: inertValue(!focusInside),
|
|
654
|
-
...commonProps
|
|
655
|
-
} : commonProps;
|
|
656
|
-
const portalContainer = viewportTargetElement || viewportElement;
|
|
657
|
-
const hidden = keepMounted && !mounted;
|
|
658
|
-
const shouldRenderInline = keepMounted && !portalContainer && !hasMountedInPortal;
|
|
659
|
-
if (keepMounted && portalContainer && !hasMountedInPortal) {
|
|
660
|
-
setHasMountedInPortal(true);
|
|
661
|
-
}
|
|
662
|
-
if (shouldRenderInline) {
|
|
663
|
-
return /* @__PURE__ */ _jsx4(CompositeRoot, {
|
|
664
|
-
render,
|
|
665
|
-
className,
|
|
666
|
-
style,
|
|
667
|
-
state,
|
|
668
|
-
refs: [forwardedRef],
|
|
669
|
-
props: [defaultProps, {
|
|
670
|
-
hidden: true
|
|
671
|
-
}, elementProps],
|
|
672
|
-
stateAttributesMapping
|
|
673
|
-
});
|
|
674
|
-
}
|
|
675
|
-
if (!portalContainer || !mounted && !keepMounted) {
|
|
676
|
-
return null;
|
|
677
|
-
}
|
|
678
|
-
return /* @__PURE__ */ ReactDOM.createPortal(/* @__PURE__ */ _jsx4(FloatingNode, {
|
|
679
|
-
id: nodeId,
|
|
680
|
-
children: /* @__PURE__ */ _jsx4(CompositeRoot, {
|
|
681
|
-
render,
|
|
682
|
-
className,
|
|
683
|
-
style,
|
|
684
|
-
state,
|
|
685
|
-
refs: [forwardedRef, ref, handleCurrentContentRef],
|
|
686
|
-
props: [defaultProps, hidden ? {
|
|
687
|
-
hidden: true
|
|
688
|
-
} : EMPTY_OBJECT, elementProps],
|
|
689
|
-
stateAttributesMapping
|
|
690
|
-
})
|
|
691
|
-
}), portalContainer);
|
|
692
|
-
});
|
|
693
|
-
if (true)
|
|
694
|
-
NavigationMenuContent.displayName = "NavigationMenuContent";
|
|
695
|
-
// node_modules/@base-ui/react/esm/navigation-menu/trigger/NavigationMenuTrigger.js
|
|
696
|
-
import * as React8 from "react";
|
|
697
|
-
import * as ReactDOM2 from "react-dom";
|
|
698
|
-
|
|
699
|
-
// node_modules/@base-ui/react/esm/navigation-menu/utils/isOutsideMenuEvent.js
|
|
700
|
-
function isOutsideMenuEvent({
|
|
701
|
-
currentTarget,
|
|
702
|
-
relatedTarget
|
|
703
|
-
}, params) {
|
|
704
|
-
const {
|
|
705
|
-
popupElement,
|
|
706
|
-
rootRef,
|
|
707
|
-
tree,
|
|
708
|
-
nodeId
|
|
709
|
-
} = params;
|
|
710
|
-
const nodeChildrenContains = tree ? getNodeChildren(tree.nodesRef.current, nodeId).some((node) => contains(node.context?.elements.floating, relatedTarget)) : [];
|
|
711
|
-
if (!popupElement) {
|
|
712
|
-
return !contains(rootRef.current, relatedTarget) && !nodeChildrenContains;
|
|
713
|
-
}
|
|
714
|
-
return !contains(popupElement, currentTarget) && !contains(popupElement, relatedTarget) && !contains(rootRef.current, relatedTarget) && !nodeChildrenContains && !(contains(popupElement, relatedTarget) && relatedTarget?.hasAttribute("data-base-ui-focus-guard"));
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
// node_modules/@base-ui/react/esm/navigation-menu/trigger/NavigationMenuTrigger.js
|
|
718
|
-
import { jsx as _jsx5, jsxs as _jsxs } from "react/jsx-runtime";
|
|
719
|
-
"use client";
|
|
720
|
-
var DEFAULT_SIZE = {
|
|
721
|
-
width: 0,
|
|
722
|
-
height: 0
|
|
723
|
-
};
|
|
724
|
-
var NavigationMenuTrigger = /* @__PURE__ */ React8.forwardRef(function NavigationMenuTrigger2(componentProps, forwardedRef) {
|
|
725
|
-
const {
|
|
726
|
-
render,
|
|
727
|
-
className,
|
|
728
|
-
style,
|
|
729
|
-
nativeButton = true,
|
|
730
|
-
disabled,
|
|
731
|
-
...elementProps
|
|
732
|
-
} = componentProps;
|
|
733
|
-
const {
|
|
734
|
-
value,
|
|
735
|
-
setValue,
|
|
736
|
-
mounted,
|
|
737
|
-
open,
|
|
738
|
-
positionerElement,
|
|
739
|
-
setActivationDirection,
|
|
740
|
-
setFloatingRootContext,
|
|
741
|
-
popupElement,
|
|
742
|
-
viewportElement,
|
|
743
|
-
transitionStatus,
|
|
744
|
-
rootRef,
|
|
745
|
-
beforeOutsideRef,
|
|
746
|
-
afterOutsideRef,
|
|
747
|
-
afterInsideRef,
|
|
748
|
-
beforeInsideRef,
|
|
749
|
-
prevTriggerElementRef,
|
|
750
|
-
popupAutoSizeResetRef,
|
|
751
|
-
currentContentRef,
|
|
752
|
-
delay,
|
|
753
|
-
closeDelay,
|
|
754
|
-
orientation,
|
|
755
|
-
setViewportInert,
|
|
756
|
-
nested
|
|
757
|
-
} = useNavigationMenuRootContext();
|
|
758
|
-
const {
|
|
759
|
-
value: itemValue
|
|
760
|
-
} = useNavigationMenuItemContext();
|
|
761
|
-
const nodeId = useNavigationMenuTreeContext();
|
|
762
|
-
const tree = useFloatingTree();
|
|
763
|
-
const dismissProps = useNavigationMenuDismissContext();
|
|
764
|
-
const direction = useDirection();
|
|
765
|
-
const stickIfOpenTimeout = useTimeout();
|
|
766
|
-
const focusFrame = useAnimationFrame();
|
|
767
|
-
const mutationFrame = useAnimationFrame();
|
|
768
|
-
const resizeFrame = useAnimationFrame();
|
|
769
|
-
const sizeFrame = useAnimationFrame();
|
|
770
|
-
const [triggerElement, setTriggerElement] = React8.useState(null);
|
|
771
|
-
const [stickIfOpen, setStickIfOpen] = React8.useState(true);
|
|
772
|
-
const [pointerType, setPointerType] = React8.useState("");
|
|
773
|
-
const triggerElementRef = React8.useRef(null);
|
|
774
|
-
const allowFocusRef = React8.useRef(false);
|
|
775
|
-
const prevSizeRef = React8.useRef(DEFAULT_SIZE);
|
|
776
|
-
const skipAutoSizeSyncRef = React8.useRef(false);
|
|
777
|
-
const isActiveItem = open && value === itemValue;
|
|
778
|
-
const isActiveItemRef = useValueAsRef(isActiveItem);
|
|
779
|
-
const interactionsEnabled = positionerElement ? true : !value;
|
|
780
|
-
const hoverFloatingElement = positionerElement || viewportElement;
|
|
781
|
-
const hoverInteractionsEnabled = hoverFloatingElement ? true : !value;
|
|
782
|
-
const runOnceAnimationsFinish = useAnimationsFinished(popupElement, false, false);
|
|
783
|
-
const handleTriggerElement = React8.useCallback((element) => {
|
|
784
|
-
triggerElementRef.current = element;
|
|
785
|
-
setTriggerElement(element);
|
|
786
|
-
}, []);
|
|
787
|
-
const cancelAutoSizeReset = useStableCallback((force = false) => {
|
|
788
|
-
if (!force && popupAutoSizeResetRef.current.owner !== itemValue) {
|
|
789
|
-
return;
|
|
790
|
-
}
|
|
791
|
-
popupAutoSizeResetRef.current.abortController?.abort();
|
|
792
|
-
popupAutoSizeResetRef.current.abortController = null;
|
|
793
|
-
popupAutoSizeResetRef.current.owner = null;
|
|
794
|
-
});
|
|
795
|
-
useIsoLayoutEffect(() => {
|
|
796
|
-
if (isActiveItem) {
|
|
797
|
-
return;
|
|
798
|
-
}
|
|
799
|
-
mutationFrame.cancel();
|
|
800
|
-
sizeFrame.cancel();
|
|
801
|
-
cancelAutoSizeReset();
|
|
802
|
-
}, [isActiveItem, mutationFrame, sizeFrame, cancelAutoSizeReset]);
|
|
803
|
-
function setAutoSizes() {
|
|
804
|
-
if (!popupElement) {
|
|
805
|
-
return;
|
|
806
|
-
}
|
|
807
|
-
popupElement.style.setProperty(NavigationMenuPopupCssVars.popupWidth, "auto");
|
|
808
|
-
popupElement.style.setProperty(NavigationMenuPopupCssVars.popupHeight, "auto");
|
|
809
|
-
}
|
|
810
|
-
function clearFixedSizes() {
|
|
811
|
-
if (!popupElement || !positionerElement) {
|
|
812
|
-
return;
|
|
813
|
-
}
|
|
814
|
-
popupElement.style.removeProperty(NavigationMenuPopupCssVars.popupWidth);
|
|
815
|
-
popupElement.style.removeProperty(NavigationMenuPopupCssVars.popupHeight);
|
|
816
|
-
positionerElement.style.removeProperty(NavigationMenuPositionerCssVars.positionerWidth);
|
|
817
|
-
positionerElement.style.removeProperty(NavigationMenuPositionerCssVars.positionerHeight);
|
|
818
|
-
}
|
|
819
|
-
function setSharedFixedSizes(width, height) {
|
|
820
|
-
if (!popupElement || !positionerElement) {
|
|
821
|
-
return;
|
|
822
|
-
}
|
|
823
|
-
popupElement.style.setProperty(NavigationMenuPopupCssVars.popupWidth, `${width}px`);
|
|
824
|
-
popupElement.style.setProperty(NavigationMenuPopupCssVars.popupHeight, `${height}px`);
|
|
825
|
-
positionerElement.style.setProperty(NavigationMenuPositionerCssVars.positionerWidth, `${width}px`);
|
|
826
|
-
positionerElement.style.setProperty(NavigationMenuPositionerCssVars.positionerHeight, `${height}px`);
|
|
827
|
-
}
|
|
828
|
-
function scheduleAutoSizeReset() {
|
|
829
|
-
cancelAutoSizeReset(true);
|
|
830
|
-
const abortController = new AbortController;
|
|
831
|
-
popupAutoSizeResetRef.current.abortController = abortController;
|
|
832
|
-
popupAutoSizeResetRef.current.owner = itemValue;
|
|
833
|
-
runOnceAnimationsFinish(() => {
|
|
834
|
-
if (popupAutoSizeResetRef.current.abortController !== abortController || popupAutoSizeResetRef.current.owner !== itemValue) {
|
|
835
|
-
return;
|
|
836
|
-
}
|
|
837
|
-
popupAutoSizeResetRef.current.abortController = null;
|
|
838
|
-
popupAutoSizeResetRef.current.owner = null;
|
|
839
|
-
setAutoSizes();
|
|
840
|
-
}, abortController.signal);
|
|
841
|
-
}
|
|
842
|
-
const handleValueChange = useStableCallback((currentWidth, currentHeight, options = {}) => {
|
|
843
|
-
if (!popupElement || !positionerElement) {
|
|
844
|
-
return;
|
|
845
|
-
}
|
|
846
|
-
cancelAutoSizeReset(true);
|
|
847
|
-
const {
|
|
848
|
-
syncPositioner = false
|
|
849
|
-
} = options;
|
|
850
|
-
clearFixedSizes();
|
|
851
|
-
const {
|
|
852
|
-
width,
|
|
853
|
-
height
|
|
854
|
-
} = getCssDimensions(popupElement);
|
|
855
|
-
const measuredWidth = width || prevSizeRef.current.width;
|
|
856
|
-
const measuredHeight = height || prevSizeRef.current.height;
|
|
857
|
-
if (currentHeight === 0 || currentWidth === 0) {
|
|
858
|
-
currentWidth = measuredWidth;
|
|
859
|
-
currentHeight = measuredHeight;
|
|
860
|
-
}
|
|
861
|
-
popupElement.style.setProperty(NavigationMenuPopupCssVars.popupWidth, `${currentWidth}px`);
|
|
862
|
-
popupElement.style.setProperty(NavigationMenuPopupCssVars.popupHeight, `${currentHeight}px`);
|
|
863
|
-
positionerElement.style.setProperty(NavigationMenuPositionerCssVars.positionerWidth, `${syncPositioner ? currentWidth : measuredWidth}px`);
|
|
864
|
-
positionerElement.style.setProperty(NavigationMenuPositionerCssVars.positionerHeight, `${syncPositioner ? currentHeight : measuredHeight}px`);
|
|
865
|
-
sizeFrame.request(() => {
|
|
866
|
-
if (!isActiveItemRef.current) {
|
|
867
|
-
return;
|
|
868
|
-
}
|
|
869
|
-
popupElement.style.setProperty(NavigationMenuPopupCssVars.popupWidth, `${measuredWidth}px`);
|
|
870
|
-
popupElement.style.setProperty(NavigationMenuPopupCssVars.popupHeight, `${measuredHeight}px`);
|
|
871
|
-
if (syncPositioner) {
|
|
872
|
-
positionerElement.style.setProperty(NavigationMenuPositionerCssVars.positionerWidth, `${measuredWidth}px`);
|
|
873
|
-
positionerElement.style.setProperty(NavigationMenuPositionerCssVars.positionerHeight, `${measuredHeight}px`);
|
|
874
|
-
}
|
|
875
|
-
scheduleAutoSizeReset();
|
|
876
|
-
});
|
|
877
|
-
});
|
|
878
|
-
const handleInterruptedMutationResize = useStableCallback((currentWidth, currentHeight) => {
|
|
879
|
-
if (!popupElement || !positionerElement) {
|
|
880
|
-
return;
|
|
881
|
-
}
|
|
882
|
-
sizeFrame.cancel();
|
|
883
|
-
mutationFrame.cancel();
|
|
884
|
-
cancelAutoSizeReset(true);
|
|
885
|
-
if (currentWidth === 0 || currentHeight === 0) {
|
|
886
|
-
return;
|
|
887
|
-
}
|
|
888
|
-
setSharedFixedSizes(currentWidth, currentHeight);
|
|
889
|
-
mutationFrame.request(() => {
|
|
890
|
-
mutationFrame.request(() => {
|
|
891
|
-
clearFixedSizes();
|
|
892
|
-
const {
|
|
893
|
-
width,
|
|
894
|
-
height
|
|
895
|
-
} = getCssDimensions(popupElement);
|
|
896
|
-
const measuredWidth = width || currentWidth || prevSizeRef.current.width;
|
|
897
|
-
const measuredHeight = height || currentHeight || prevSizeRef.current.height;
|
|
898
|
-
setSharedFixedSizes(currentWidth, currentHeight);
|
|
899
|
-
sizeFrame.request(() => {
|
|
900
|
-
if (!isActiveItemRef.current) {
|
|
901
|
-
return;
|
|
902
|
-
}
|
|
903
|
-
setSharedFixedSizes(measuredWidth, measuredHeight);
|
|
904
|
-
scheduleAutoSizeReset();
|
|
905
|
-
});
|
|
906
|
-
});
|
|
907
|
-
});
|
|
908
|
-
});
|
|
909
|
-
const syncCurrentSize = useStableCallback(() => {
|
|
910
|
-
if (!popupElement || !positionerElement) {
|
|
911
|
-
return;
|
|
912
|
-
}
|
|
913
|
-
sizeFrame.cancel();
|
|
914
|
-
cancelAutoSizeReset(true);
|
|
915
|
-
clearFixedSizes();
|
|
916
|
-
const {
|
|
917
|
-
width,
|
|
918
|
-
height
|
|
919
|
-
} = getCssDimensions(popupElement);
|
|
920
|
-
if (width === 0 || height === 0) {
|
|
921
|
-
return;
|
|
922
|
-
}
|
|
923
|
-
prevSizeRef.current = {
|
|
924
|
-
width,
|
|
925
|
-
height
|
|
926
|
-
};
|
|
927
|
-
setAutoSizes();
|
|
928
|
-
positionerElement.style.setProperty(NavigationMenuPositionerCssVars.positionerWidth, `${width}px`);
|
|
929
|
-
positionerElement.style.setProperty(NavigationMenuPositionerCssVars.positionerHeight, `${height}px`);
|
|
930
|
-
});
|
|
931
|
-
const getMutationBaseline = useStableCallback(() => {
|
|
932
|
-
if (!popupElement) {
|
|
933
|
-
return {
|
|
934
|
-
size: prevSizeRef.current,
|
|
935
|
-
syncPositioner: false
|
|
936
|
-
};
|
|
937
|
-
}
|
|
938
|
-
const popupWidth = popupElement.style.getPropertyValue(NavigationMenuPopupCssVars.popupWidth);
|
|
939
|
-
const popupHeight = popupElement.style.getPropertyValue(NavigationMenuPopupCssVars.popupHeight);
|
|
940
|
-
const isResizing = popupWidth !== "" && popupWidth !== "auto" && popupHeight !== "" && popupHeight !== "auto";
|
|
941
|
-
if (!isResizing) {
|
|
942
|
-
return {
|
|
943
|
-
size: prevSizeRef.current,
|
|
944
|
-
syncPositioner: false
|
|
945
|
-
};
|
|
946
|
-
}
|
|
947
|
-
return {
|
|
948
|
-
size: {
|
|
949
|
-
width: popupElement.offsetWidth || prevSizeRef.current.width,
|
|
950
|
-
height: popupElement.offsetHeight || prevSizeRef.current.height
|
|
951
|
-
},
|
|
952
|
-
syncPositioner: true
|
|
953
|
-
};
|
|
954
|
-
});
|
|
955
|
-
React8.useEffect(() => {
|
|
956
|
-
if (!open) {
|
|
957
|
-
stickIfOpenTimeout.clear();
|
|
958
|
-
mutationFrame.cancel();
|
|
959
|
-
resizeFrame.cancel();
|
|
960
|
-
sizeFrame.cancel();
|
|
961
|
-
cancelAutoSizeReset(true);
|
|
962
|
-
skipAutoSizeSyncRef.current = false;
|
|
963
|
-
setPointerType("");
|
|
964
|
-
}
|
|
965
|
-
}, [stickIfOpenTimeout, open, mutationFrame, resizeFrame, sizeFrame, cancelAutoSizeReset]);
|
|
966
|
-
React8.useEffect(() => {
|
|
967
|
-
if (!mounted) {
|
|
968
|
-
prevSizeRef.current = DEFAULT_SIZE;
|
|
969
|
-
}
|
|
970
|
-
}, [mounted]);
|
|
971
|
-
React8.useEffect(() => {
|
|
972
|
-
if (!popupElement || typeof ResizeObserver !== "function") {
|
|
973
|
-
return;
|
|
974
|
-
}
|
|
975
|
-
const resizeObserver = new ResizeObserver(() => {
|
|
976
|
-
prevSizeRef.current = {
|
|
977
|
-
width: popupElement.offsetWidth,
|
|
978
|
-
height: popupElement.offsetHeight
|
|
979
|
-
};
|
|
980
|
-
});
|
|
981
|
-
resizeObserver.observe(popupElement);
|
|
982
|
-
return () => {
|
|
983
|
-
resizeObserver.disconnect();
|
|
984
|
-
};
|
|
985
|
-
}, [popupElement]);
|
|
986
|
-
React8.useEffect(() => {
|
|
987
|
-
if (!open || !isActiveItem || !popupElement || !positionerElement) {
|
|
988
|
-
return;
|
|
989
|
-
}
|
|
990
|
-
const win = getWindow(positionerElement);
|
|
991
|
-
function handleResize() {
|
|
992
|
-
resizeFrame.cancel();
|
|
993
|
-
resizeFrame.request(syncCurrentSize);
|
|
994
|
-
}
|
|
995
|
-
const unsubscribe = addEventListener(win, "resize", handleResize);
|
|
996
|
-
return () => {
|
|
997
|
-
resizeFrame.cancel();
|
|
998
|
-
unsubscribe();
|
|
999
|
-
};
|
|
1000
|
-
}, [open, isActiveItem, popupElement, positionerElement, resizeFrame, syncCurrentSize]);
|
|
1001
|
-
React8.useEffect(() => {
|
|
1002
|
-
const observedElement = currentContentRef.current;
|
|
1003
|
-
if (!observedElement || !popupElement || !isActiveItem || typeof MutationObserver !== "function") {
|
|
1004
|
-
return;
|
|
1005
|
-
}
|
|
1006
|
-
const mutationObserver = new MutationObserver(() => {
|
|
1007
|
-
if (transitionStatus === "starting" || popupElement.hasAttribute(TransitionStatusDataAttributes.startingStyle)) {
|
|
1008
|
-
syncCurrentSize();
|
|
1009
|
-
return;
|
|
1010
|
-
}
|
|
1011
|
-
const {
|
|
1012
|
-
size,
|
|
1013
|
-
syncPositioner
|
|
1014
|
-
} = getMutationBaseline();
|
|
1015
|
-
if (syncPositioner) {
|
|
1016
|
-
handleInterruptedMutationResize(size.width, size.height);
|
|
1017
|
-
return;
|
|
1018
|
-
}
|
|
1019
|
-
handleValueChange(size.width, size.height);
|
|
1020
|
-
});
|
|
1021
|
-
mutationObserver.observe(observedElement, {
|
|
1022
|
-
childList: true,
|
|
1023
|
-
subtree: true,
|
|
1024
|
-
characterData: true,
|
|
1025
|
-
attributes: true,
|
|
1026
|
-
attributeFilter: ["hidden"]
|
|
1027
|
-
});
|
|
1028
|
-
return () => {
|
|
1029
|
-
mutationObserver.disconnect();
|
|
1030
|
-
};
|
|
1031
|
-
}, [currentContentRef, popupElement, isActiveItem, transitionStatus, getMutationBaseline, handleInterruptedMutationResize, handleValueChange, syncCurrentSize]);
|
|
1032
|
-
React8.useEffect(() => {
|
|
1033
|
-
if (isActiveItem && open && popupElement && allowFocusRef.current) {
|
|
1034
|
-
allowFocusRef.current = false;
|
|
1035
|
-
focusFrame.request(() => {
|
|
1036
|
-
beforeOutsideRef.current?.focus();
|
|
1037
|
-
});
|
|
1038
|
-
}
|
|
1039
|
-
return () => {
|
|
1040
|
-
focusFrame.cancel();
|
|
1041
|
-
};
|
|
1042
|
-
}, [beforeOutsideRef, focusFrame, isActiveItem, open, popupElement]);
|
|
1043
|
-
useIsoLayoutEffect(() => {
|
|
1044
|
-
if (isActiveItemRef.current && open && popupElement) {
|
|
1045
|
-
const hasNestedMenu = currentContentRef.current?.querySelector("[data-nested]") != null;
|
|
1046
|
-
if (transitionStatus === "starting" && hasNestedMenu) {
|
|
1047
|
-
sizeFrame.request(syncCurrentSize);
|
|
1048
|
-
return () => {
|
|
1049
|
-
sizeFrame.cancel();
|
|
1050
|
-
};
|
|
1051
|
-
}
|
|
1052
|
-
if (skipAutoSizeSyncRef.current) {
|
|
1053
|
-
skipAutoSizeSyncRef.current = false;
|
|
1054
|
-
return;
|
|
1055
|
-
}
|
|
1056
|
-
const {
|
|
1057
|
-
width,
|
|
1058
|
-
height
|
|
1059
|
-
} = getCssDimensions(popupElement);
|
|
1060
|
-
handleValueChange(width, height);
|
|
1061
|
-
}
|
|
1062
|
-
return;
|
|
1063
|
-
}, [currentContentRef, handleValueChange, isActiveItemRef, open, popupElement, sizeFrame, syncCurrentSize, transitionStatus]);
|
|
1064
|
-
function handleOpenChange(nextOpen, eventDetails) {
|
|
1065
|
-
const isHover = eventDetails.reason === exports_reason_parts.triggerHover;
|
|
1066
|
-
if (!interactionsEnabled) {
|
|
1067
|
-
return;
|
|
1068
|
-
}
|
|
1069
|
-
if (pointerType === "touch" && isHover) {
|
|
1070
|
-
return;
|
|
1071
|
-
}
|
|
1072
|
-
if (!nextOpen && value !== itemValue) {
|
|
1073
|
-
return;
|
|
1074
|
-
}
|
|
1075
|
-
function changeState() {
|
|
1076
|
-
if (isHover) {
|
|
1077
|
-
setStickIfOpen(true);
|
|
1078
|
-
stickIfOpenTimeout.clear();
|
|
1079
|
-
stickIfOpenTimeout.start(PATIENT_CLICK_THRESHOLD, () => {
|
|
1080
|
-
setStickIfOpen(false);
|
|
1081
|
-
});
|
|
1082
|
-
}
|
|
1083
|
-
if (nextOpen) {
|
|
1084
|
-
setValue(itemValue, eventDetails);
|
|
1085
|
-
} else {
|
|
1086
|
-
setValue(null, eventDetails);
|
|
1087
|
-
setPointerType("");
|
|
1088
|
-
}
|
|
1089
|
-
}
|
|
1090
|
-
if (isHover) {
|
|
1091
|
-
ReactDOM2.flushSync(changeState);
|
|
1092
|
-
} else {
|
|
1093
|
-
changeState();
|
|
1094
|
-
}
|
|
1095
|
-
}
|
|
1096
|
-
const context = useFloatingRootContext({
|
|
1097
|
-
open,
|
|
1098
|
-
onOpenChange: handleOpenChange,
|
|
1099
|
-
elements: {
|
|
1100
|
-
reference: triggerElement,
|
|
1101
|
-
floating: hoverFloatingElement
|
|
1102
|
-
}
|
|
1103
|
-
});
|
|
1104
|
-
const hoverInteractionState = useHoverInteractionSharedState(context);
|
|
1105
|
-
const shouldBlockSafePolygonPointerEvents = pointerType !== "touch";
|
|
1106
|
-
React8.useEffect(() => {
|
|
1107
|
-
if (!open) {
|
|
1108
|
-
context.context.dataRef.current.openEvent = undefined;
|
|
1109
|
-
hoverInteractionState.pointerType = undefined;
|
|
1110
|
-
hoverInteractionState.interactedInside = false;
|
|
1111
|
-
hoverInteractionState.restTimeoutPending = false;
|
|
1112
|
-
hoverInteractionState.openChangeTimeout.clear();
|
|
1113
|
-
hoverInteractionState.restTimeout.clear();
|
|
1114
|
-
clearSafePolygonPointerEventsMutation(hoverInteractionState);
|
|
1115
|
-
}
|
|
1116
|
-
}, [context, hoverInteractionState, open]);
|
|
1117
|
-
const getInlineHandleCloseContext = useStableCallback(() => {
|
|
1118
|
-
if (!nested || positionerElement || !triggerElementRef.current || !hoverFloatingElement) {
|
|
1119
|
-
return null;
|
|
1120
|
-
}
|
|
1121
|
-
return getHandleCloseContext(triggerElementRef.current, hoverFloatingElement, nodeId);
|
|
1122
|
-
});
|
|
1123
|
-
function getScope() {
|
|
1124
|
-
if (!nested || !positionerElement) {
|
|
1125
|
-
return triggerElementRef.current?.closest("ul") ?? null;
|
|
1126
|
-
}
|
|
1127
|
-
return null;
|
|
1128
|
-
}
|
|
1129
|
-
const hoverProps = useHoverReferenceInteraction(context, {
|
|
1130
|
-
enabled: hoverInteractionsEnabled,
|
|
1131
|
-
move: false,
|
|
1132
|
-
handleClose: safePolygon({
|
|
1133
|
-
blockPointerEvents: shouldBlockSafePolygonPointerEvents,
|
|
1134
|
-
getScope
|
|
1135
|
-
}),
|
|
1136
|
-
restMs: mounted && positionerElement ? 0 : delay,
|
|
1137
|
-
delay: {
|
|
1138
|
-
close: closeDelay
|
|
1139
|
-
},
|
|
1140
|
-
triggerElementRef,
|
|
1141
|
-
getHandleCloseContext: getInlineHandleCloseContext
|
|
1142
|
-
});
|
|
1143
|
-
const hover = React8.useMemo(() => hoverProps ? {
|
|
1144
|
-
reference: hoverProps
|
|
1145
|
-
} : undefined, [hoverProps]);
|
|
1146
|
-
const click = useClick(context, {
|
|
1147
|
-
enabled: interactionsEnabled,
|
|
1148
|
-
stickIfOpen,
|
|
1149
|
-
toggle: isActiveItem
|
|
1150
|
-
});
|
|
1151
|
-
const referenceProps = React8.useMemo(() => mergeProps(click.reference, hover?.reference), [click.reference, hover]);
|
|
1152
|
-
useIsoLayoutEffect(() => {
|
|
1153
|
-
if (isActiveItem) {
|
|
1154
|
-
setFloatingRootContext(context);
|
|
1155
|
-
prevTriggerElementRef.current = triggerElement;
|
|
1156
|
-
}
|
|
1157
|
-
}, [isActiveItem, context, setFloatingRootContext, prevTriggerElementRef, triggerElement]);
|
|
1158
|
-
function handleActivation(event) {
|
|
1159
|
-
ReactDOM2.flushSync(() => {
|
|
1160
|
-
const currentTarget = isHTMLElement(event.currentTarget) ? event.currentTarget : null;
|
|
1161
|
-
const prevTriggerRect = prevTriggerElementRef.current?.getBoundingClientRect();
|
|
1162
|
-
if (mounted && prevTriggerRect && triggerElement) {
|
|
1163
|
-
const nextTriggerRect = triggerElement.getBoundingClientRect();
|
|
1164
|
-
const isMovingRight = nextTriggerRect.left > prevTriggerRect.left;
|
|
1165
|
-
const isMovingDown = nextTriggerRect.top > prevTriggerRect.top;
|
|
1166
|
-
if (orientation === "horizontal" && nextTriggerRect.left !== prevTriggerRect.left) {
|
|
1167
|
-
setActivationDirection(isMovingRight ? "right" : "left");
|
|
1168
|
-
} else if (orientation === "vertical" && nextTriggerRect.top !== prevTriggerRect.top) {
|
|
1169
|
-
setActivationDirection(isMovingDown ? "down" : "up");
|
|
1170
|
-
}
|
|
1171
|
-
}
|
|
1172
|
-
if (event.type !== "click" && value != null) {
|
|
1173
|
-
context.context.dataRef.current.openEvent = undefined;
|
|
1174
|
-
}
|
|
1175
|
-
if (pointerType === "touch" && event.type !== "click") {
|
|
1176
|
-
return;
|
|
1177
|
-
}
|
|
1178
|
-
if (value != null) {
|
|
1179
|
-
setValue(itemValue, createChangeEventDetails(event.type === "mouseenter" ? exports_reason_parts.triggerHover : exports_reason_parts.triggerPress, event.nativeEvent));
|
|
1180
|
-
}
|
|
1181
|
-
if (event.type === "mouseenter" && shouldBlockSafePolygonPointerEvents && (!nested || !positionerElement) && hoverFloatingElement && currentTarget) {
|
|
1182
|
-
const applyPointerEventsMutation = () => {
|
|
1183
|
-
const scopeElement = getScope() ?? currentTarget.ownerDocument.body;
|
|
1184
|
-
applySafePolygonPointerEventsMutation(hoverInteractionState, {
|
|
1185
|
-
scopeElement,
|
|
1186
|
-
referenceElement: currentTarget,
|
|
1187
|
-
floatingElement: hoverFloatingElement
|
|
1188
|
-
});
|
|
1189
|
-
};
|
|
1190
|
-
if (value != null && value !== itemValue) {
|
|
1191
|
-
queueMicrotask(applyPointerEventsMutation);
|
|
1192
|
-
} else {
|
|
1193
|
-
applyPointerEventsMutation();
|
|
1194
|
-
}
|
|
1195
|
-
}
|
|
1196
|
-
});
|
|
1197
|
-
}
|
|
1198
|
-
const handleOpenEvent = useStableCallback((event) => {
|
|
1199
|
-
if (!popupElement || !positionerElement) {
|
|
1200
|
-
handleActivation(event);
|
|
1201
|
-
return;
|
|
1202
|
-
}
|
|
1203
|
-
const {
|
|
1204
|
-
width,
|
|
1205
|
-
height
|
|
1206
|
-
} = getCssDimensions(popupElement);
|
|
1207
|
-
const shouldSkipAutoSizeSync = value != null && value !== itemValue && (event.type === "click" || pointerType !== "touch");
|
|
1208
|
-
handleActivation(event);
|
|
1209
|
-
if (shouldSkipAutoSizeSync) {
|
|
1210
|
-
skipAutoSizeSyncRef.current = true;
|
|
1211
|
-
}
|
|
1212
|
-
handleValueChange(width, height);
|
|
1213
|
-
});
|
|
1214
|
-
const state = {
|
|
1215
|
-
open: isActiveItem
|
|
1216
|
-
};
|
|
1217
|
-
function handleSetPointerType(event) {
|
|
1218
|
-
setPointerType(event.pointerType);
|
|
1219
|
-
}
|
|
1220
|
-
function handleTriggerPointerDown(event) {
|
|
1221
|
-
handleSetPointerType(event);
|
|
1222
|
-
clearSafePolygonPointerEventsMutation(hoverInteractionState);
|
|
1223
|
-
}
|
|
1224
|
-
const defaultProps = {
|
|
1225
|
-
tabIndex: 0,
|
|
1226
|
-
onMouseEnter: handleOpenEvent,
|
|
1227
|
-
onClick: handleOpenEvent,
|
|
1228
|
-
onPointerEnter: handleSetPointerType,
|
|
1229
|
-
onPointerDown: handleTriggerPointerDown,
|
|
1230
|
-
"aria-expanded": isActiveItem,
|
|
1231
|
-
"aria-controls": isActiveItem ? popupElement?.id : undefined,
|
|
1232
|
-
[NAVIGATION_MENU_TRIGGER_IDENTIFIER]: "",
|
|
1233
|
-
onFocus() {
|
|
1234
|
-
if (!isActiveItem) {
|
|
1235
|
-
return;
|
|
1236
|
-
}
|
|
1237
|
-
setViewportInert(false);
|
|
1238
|
-
},
|
|
1239
|
-
onMouseMove() {
|
|
1240
|
-
allowFocusRef.current = false;
|
|
1241
|
-
},
|
|
1242
|
-
onKeyDown(event) {
|
|
1243
|
-
allowFocusRef.current = true;
|
|
1244
|
-
if (nested) {
|
|
1245
|
-
return;
|
|
1246
|
-
}
|
|
1247
|
-
const verticalOpenKey = direction === "rtl" ? "ArrowLeft" : "ArrowRight";
|
|
1248
|
-
const openHorizontal = orientation === "horizontal" && event.key === "ArrowDown";
|
|
1249
|
-
const openVertical = orientation === "vertical" && event.key === verticalOpenKey;
|
|
1250
|
-
if (openHorizontal || openVertical) {
|
|
1251
|
-
setValue(itemValue, createChangeEventDetails(exports_reason_parts.listNavigation, event.nativeEvent));
|
|
1252
|
-
handleOpenEvent(event);
|
|
1253
|
-
stopEvent(event);
|
|
1254
|
-
}
|
|
1255
|
-
},
|
|
1256
|
-
onBlur(event) {
|
|
1257
|
-
if (positionerElement && popupElement && isOutsideMenuEvent({
|
|
1258
|
-
currentTarget: event.currentTarget,
|
|
1259
|
-
relatedTarget: event.relatedTarget
|
|
1260
|
-
}, {
|
|
1261
|
-
popupElement,
|
|
1262
|
-
rootRef,
|
|
1263
|
-
tree,
|
|
1264
|
-
nodeId
|
|
1265
|
-
})) {
|
|
1266
|
-
setValue(null, createChangeEventDetails(exports_reason_parts.focusOut, event.nativeEvent));
|
|
1267
|
-
}
|
|
1268
|
-
}
|
|
1269
|
-
};
|
|
1270
|
-
const {
|
|
1271
|
-
getButtonProps,
|
|
1272
|
-
buttonRef
|
|
1273
|
-
} = useButton({
|
|
1274
|
-
disabled,
|
|
1275
|
-
focusableWhenDisabled: true,
|
|
1276
|
-
native: nativeButton
|
|
1277
|
-
});
|
|
1278
|
-
const referenceElement = hoverFloatingElement;
|
|
1279
|
-
return /* @__PURE__ */ _jsxs(React8.Fragment, {
|
|
1280
|
-
children: [/* @__PURE__ */ _jsx5(CompositeItem, {
|
|
1281
|
-
tag: "button",
|
|
1282
|
-
render,
|
|
1283
|
-
className,
|
|
1284
|
-
style,
|
|
1285
|
-
state,
|
|
1286
|
-
stateAttributesMapping: pressableTriggerOpenStateMapping,
|
|
1287
|
-
refs: [forwardedRef, handleTriggerElement, buttonRef],
|
|
1288
|
-
props: [referenceProps, dismissProps?.reference || EMPTY_ARRAY, defaultProps, elementProps, getButtonProps]
|
|
1289
|
-
}), isActiveItem && /* @__PURE__ */ _jsxs(React8.Fragment, {
|
|
1290
|
-
children: [/* @__PURE__ */ _jsx5(FocusGuard, {
|
|
1291
|
-
ref: beforeOutsideRef,
|
|
1292
|
-
onFocus: (event) => {
|
|
1293
|
-
if (referenceElement && isOutsideEvent(event, referenceElement)) {
|
|
1294
|
-
beforeInsideRef.current?.focus();
|
|
1295
|
-
} else {
|
|
1296
|
-
const prevTabbable = getPreviousTabbable(triggerElement);
|
|
1297
|
-
prevTabbable?.focus();
|
|
1298
|
-
}
|
|
1299
|
-
}
|
|
1300
|
-
}), /* @__PURE__ */ _jsx5("span", {
|
|
1301
|
-
"aria-owns": viewportElement?.id,
|
|
1302
|
-
style: ownerVisuallyHidden
|
|
1303
|
-
}), /* @__PURE__ */ _jsx5(FocusGuard, {
|
|
1304
|
-
ref: afterOutsideRef,
|
|
1305
|
-
onFocus: (event) => {
|
|
1306
|
-
if (referenceElement && isOutsideEvent(event, referenceElement)) {
|
|
1307
|
-
ReactDOM2.flushSync(() => {
|
|
1308
|
-
setViewportInert(false);
|
|
1309
|
-
});
|
|
1310
|
-
const elementToFocus = afterInsideRef.current || triggerElement;
|
|
1311
|
-
elementToFocus?.focus();
|
|
1312
|
-
} else {
|
|
1313
|
-
let nextTabbable = getNextTabbable(triggerElement);
|
|
1314
|
-
if (nested && !positionerElement && referenceElement && nextTabbable && contains(referenceElement, nextTabbable)) {
|
|
1315
|
-
nextTabbable = getTabbableAfterElement(afterInsideRef.current);
|
|
1316
|
-
}
|
|
1317
|
-
nextTabbable?.focus();
|
|
1318
|
-
if ((!nested || positionerElement) && !contains(rootRef.current, nextTabbable)) {
|
|
1319
|
-
setValue(null, createChangeEventDetails(exports_reason_parts.focusOut, event.nativeEvent));
|
|
1320
|
-
}
|
|
1321
|
-
}
|
|
1322
|
-
}
|
|
1323
|
-
})]
|
|
1324
|
-
})]
|
|
1325
|
-
});
|
|
1326
|
-
});
|
|
1327
|
-
if (true)
|
|
1328
|
-
NavigationMenuTrigger.displayName = "NavigationMenuTrigger";
|
|
1329
|
-
function getPlacementFromElements(domReferenceElement, floatingElement) {
|
|
1330
|
-
const referenceRect = domReferenceElement.getBoundingClientRect();
|
|
1331
|
-
const floatingRect = floatingElement.getBoundingClientRect();
|
|
1332
|
-
const referenceCenterX = referenceRect.left + referenceRect.width / 2;
|
|
1333
|
-
const referenceCenterY = referenceRect.top + referenceRect.height / 2;
|
|
1334
|
-
const floatingCenterX = floatingRect.left + floatingRect.width / 2;
|
|
1335
|
-
const floatingCenterY = floatingRect.top + floatingRect.height / 2;
|
|
1336
|
-
const deltaX = floatingCenterX - referenceCenterX;
|
|
1337
|
-
const deltaY = floatingCenterY - referenceCenterY;
|
|
1338
|
-
if (Math.abs(deltaX) >= Math.abs(deltaY)) {
|
|
1339
|
-
return deltaX >= 0 ? "right" : "left";
|
|
1340
|
-
}
|
|
1341
|
-
return deltaY >= 0 ? "bottom" : "top";
|
|
1342
|
-
}
|
|
1343
|
-
function getHandleCloseContext(domReferenceElement, floatingElement, nodeId) {
|
|
1344
|
-
return {
|
|
1345
|
-
placement: getPlacementFromElements(domReferenceElement, floatingElement),
|
|
1346
|
-
elements: {
|
|
1347
|
-
domReference: domReferenceElement,
|
|
1348
|
-
floating: floatingElement
|
|
1349
|
-
},
|
|
1350
|
-
nodeId
|
|
1351
|
-
};
|
|
1352
|
-
}
|
|
1353
|
-
// node_modules/@base-ui/react/esm/navigation-menu/portal/NavigationMenuPortal.js
|
|
1354
|
-
import * as React10 from "react";
|
|
1355
|
-
|
|
1356
|
-
// node_modules/@base-ui/react/esm/navigation-menu/portal/NavigationMenuPortalContext.js
|
|
1357
|
-
import * as React9 from "react";
|
|
1358
|
-
"use client";
|
|
1359
|
-
var NavigationMenuPortalContext = /* @__PURE__ */ React9.createContext(undefined);
|
|
1360
|
-
if (true)
|
|
1361
|
-
NavigationMenuPortalContext.displayName = "NavigationMenuPortalContext";
|
|
1362
|
-
function useNavigationMenuPortalContext() {
|
|
1363
|
-
const value = React9.useContext(NavigationMenuPortalContext);
|
|
1364
|
-
if (value === undefined) {
|
|
1365
|
-
throw new Error("Base UI: <NavigationMenu.Portal> is missing.");
|
|
1366
|
-
}
|
|
1367
|
-
return value;
|
|
1368
|
-
}
|
|
1369
|
-
|
|
1370
|
-
// node_modules/@base-ui/react/esm/navigation-menu/portal/NavigationMenuPortal.js
|
|
1371
|
-
import { jsx as _jsx6 } from "react/jsx-runtime";
|
|
1372
|
-
"use client";
|
|
1373
|
-
var NavigationMenuPortal = /* @__PURE__ */ React10.forwardRef(function NavigationMenuPortal2(props, forwardedRef) {
|
|
1374
|
-
const {
|
|
1375
|
-
keepMounted = false,
|
|
1376
|
-
...portalProps
|
|
1377
|
-
} = props;
|
|
1378
|
-
const {
|
|
1379
|
-
mounted
|
|
1380
|
-
} = useNavigationMenuRootContext();
|
|
1381
|
-
const shouldRender = mounted || keepMounted;
|
|
1382
|
-
if (!shouldRender) {
|
|
1383
|
-
return null;
|
|
1384
|
-
}
|
|
1385
|
-
return /* @__PURE__ */ _jsx6(NavigationMenuPortalContext.Provider, {
|
|
1386
|
-
value: keepMounted,
|
|
1387
|
-
children: /* @__PURE__ */ _jsx6(FloatingPortal, {
|
|
1388
|
-
ref: forwardedRef,
|
|
1389
|
-
...portalProps
|
|
1390
|
-
})
|
|
1391
|
-
});
|
|
1392
|
-
});
|
|
1393
|
-
if (true)
|
|
1394
|
-
NavigationMenuPortal.displayName = "NavigationMenuPortal";
|
|
1395
|
-
// node_modules/@base-ui/react/esm/navigation-menu/positioner/NavigationMenuPositioner.js
|
|
1396
|
-
import * as React12 from "react";
|
|
1397
|
-
import * as ReactDOM3 from "react-dom";
|
|
1398
|
-
|
|
1399
|
-
// node_modules/@base-ui/react/esm/navigation-menu/positioner/NavigationMenuPositionerContext.js
|
|
1400
|
-
import * as React11 from "react";
|
|
1401
|
-
"use client";
|
|
1402
|
-
var NavigationMenuPositionerContext = /* @__PURE__ */ React11.createContext(undefined);
|
|
1403
|
-
if (true)
|
|
1404
|
-
NavigationMenuPositionerContext.displayName = "NavigationMenuPositionerContext";
|
|
1405
|
-
function useNavigationMenuPositionerContext(optional = false) {
|
|
1406
|
-
const context = React11.useContext(NavigationMenuPositionerContext);
|
|
1407
|
-
if (!context && !optional) {
|
|
1408
|
-
throw new Error("Base UI: NavigationMenuPositionerContext is missing. NavigationMenuPositioner parts must be placed within <NavigationMenu.Positioner>.");
|
|
1409
|
-
}
|
|
1410
|
-
return context;
|
|
1411
|
-
}
|
|
1412
|
-
|
|
1413
|
-
// node_modules/@base-ui/react/esm/navigation-menu/positioner/NavigationMenuPositioner.js
|
|
1414
|
-
import { jsx as _jsx7 } from "react/jsx-runtime";
|
|
1415
|
-
"use client";
|
|
1416
|
-
var EMPTY_ROOT_CONTEXT = getEmptyRootContext();
|
|
1417
|
-
var NavigationMenuPositioner = /* @__PURE__ */ React12.forwardRef(function NavigationMenuPositioner2(componentProps, forwardedRef) {
|
|
1418
|
-
const {
|
|
1419
|
-
open,
|
|
1420
|
-
mounted,
|
|
1421
|
-
positionerElement,
|
|
1422
|
-
setPositionerElement,
|
|
1423
|
-
floatingRootContext,
|
|
1424
|
-
nested,
|
|
1425
|
-
transitionStatus
|
|
1426
|
-
} = useNavigationMenuRootContext();
|
|
1427
|
-
const {
|
|
1428
|
-
className,
|
|
1429
|
-
render,
|
|
1430
|
-
anchor,
|
|
1431
|
-
positionMethod = "absolute",
|
|
1432
|
-
side = "bottom",
|
|
1433
|
-
align = "center",
|
|
1434
|
-
sideOffset = 0,
|
|
1435
|
-
alignOffset = 0,
|
|
1436
|
-
collisionBoundary = "clipping-ancestors",
|
|
1437
|
-
collisionPadding = 5,
|
|
1438
|
-
collisionAvoidance = nested ? POPUP_COLLISION_AVOIDANCE : DROPDOWN_COLLISION_AVOIDANCE,
|
|
1439
|
-
arrowPadding = 5,
|
|
1440
|
-
sticky = false,
|
|
1441
|
-
disableAnchorTracking = false,
|
|
1442
|
-
style,
|
|
1443
|
-
...elementProps
|
|
1444
|
-
} = componentProps;
|
|
1445
|
-
const keepMounted = useNavigationMenuPortalContext();
|
|
1446
|
-
const nodeId = useNavigationMenuTreeContext();
|
|
1447
|
-
const resizeTimeout = useTimeout();
|
|
1448
|
-
const [instant, setInstant] = React12.useState(false);
|
|
1449
|
-
const positionerRef = React12.useRef(null);
|
|
1450
|
-
const prevTriggerElementRef = React12.useRef(null);
|
|
1451
|
-
React12.useEffect(() => {
|
|
1452
|
-
if (!positionerElement) {
|
|
1453
|
-
return;
|
|
1454
|
-
}
|
|
1455
|
-
function onFocus(event) {
|
|
1456
|
-
if (positionerElement && isOutsideEvent(event)) {
|
|
1457
|
-
const focusing = event.type === "focusin";
|
|
1458
|
-
const manageFocus = focusing ? enableFocusInside : disableFocusInside;
|
|
1459
|
-
manageFocus(positionerElement);
|
|
1460
|
-
}
|
|
1461
|
-
}
|
|
1462
|
-
return mergeCleanups(addEventListener(positionerElement, "focusin", onFocus, true), addEventListener(positionerElement, "focusout", onFocus, true));
|
|
1463
|
-
}, [positionerElement]);
|
|
1464
|
-
const domReference = (floatingRootContext || EMPTY_ROOT_CONTEXT).useState("domReferenceElement");
|
|
1465
|
-
const positioning = useAnchorPositioning({
|
|
1466
|
-
anchor: anchor ?? domReference ?? prevTriggerElementRef,
|
|
1467
|
-
positionMethod,
|
|
1468
|
-
mounted,
|
|
1469
|
-
side,
|
|
1470
|
-
sideOffset,
|
|
1471
|
-
align,
|
|
1472
|
-
alignOffset,
|
|
1473
|
-
arrowPadding,
|
|
1474
|
-
collisionBoundary,
|
|
1475
|
-
collisionPadding,
|
|
1476
|
-
sticky,
|
|
1477
|
-
disableAnchorTracking,
|
|
1478
|
-
keepMounted,
|
|
1479
|
-
floatingRootContext,
|
|
1480
|
-
collisionAvoidance,
|
|
1481
|
-
nodeId,
|
|
1482
|
-
adaptiveOrigin
|
|
1483
|
-
});
|
|
1484
|
-
const state = {
|
|
1485
|
-
open,
|
|
1486
|
-
side: positioning.side,
|
|
1487
|
-
align: positioning.align,
|
|
1488
|
-
anchorHidden: positioning.anchorHidden,
|
|
1489
|
-
instant
|
|
1490
|
-
};
|
|
1491
|
-
React12.useEffect(() => {
|
|
1492
|
-
if (!open) {
|
|
1493
|
-
return;
|
|
1494
|
-
}
|
|
1495
|
-
function handleResize() {
|
|
1496
|
-
ReactDOM3.flushSync(() => {
|
|
1497
|
-
setInstant(true);
|
|
1498
|
-
});
|
|
1499
|
-
resizeTimeout.start(100, () => {
|
|
1500
|
-
setInstant(false);
|
|
1501
|
-
});
|
|
1502
|
-
}
|
|
1503
|
-
const win = getWindow(positionerElement);
|
|
1504
|
-
return addEventListener(win, "resize", handleResize);
|
|
1505
|
-
}, [open, resizeTimeout, positionerElement]);
|
|
1506
|
-
const element = usePositioner(componentProps, state, {
|
|
1507
|
-
styles: positioning.positionerStyles,
|
|
1508
|
-
transitionStatus,
|
|
1509
|
-
props: elementProps,
|
|
1510
|
-
refs: [forwardedRef, setPositionerElement, positionerRef],
|
|
1511
|
-
hidden: !mounted,
|
|
1512
|
-
inert: !open
|
|
1513
|
-
});
|
|
1514
|
-
return /* @__PURE__ */ _jsx7(NavigationMenuPositionerContext.Provider, {
|
|
1515
|
-
value: positioning,
|
|
1516
|
-
children: element
|
|
1517
|
-
});
|
|
1518
|
-
});
|
|
1519
|
-
if (true)
|
|
1520
|
-
NavigationMenuPositioner.displayName = "NavigationMenuPositioner";
|
|
1521
|
-
// node_modules/@base-ui/react/esm/navigation-menu/viewport/NavigationMenuViewport.js
|
|
1522
|
-
import * as React13 from "react";
|
|
1523
|
-
import { jsx as _jsx8, jsxs as _jsxs2 } from "react/jsx-runtime";
|
|
1524
|
-
"use client";
|
|
1525
|
-
var EMPTY_ROOT_CONTEXT2 = getEmptyRootContext();
|
|
1526
|
-
function Guards({
|
|
1527
|
-
children
|
|
1528
|
-
}) {
|
|
1529
|
-
const {
|
|
1530
|
-
beforeInsideRef,
|
|
1531
|
-
beforeOutsideRef,
|
|
1532
|
-
afterInsideRef,
|
|
1533
|
-
afterOutsideRef,
|
|
1534
|
-
positionerElement,
|
|
1535
|
-
viewportElement,
|
|
1536
|
-
floatingRootContext
|
|
1537
|
-
} = useNavigationMenuRootContext();
|
|
1538
|
-
const hasPositioner = Boolean(useNavigationMenuPositionerContext(true));
|
|
1539
|
-
const referenceElement = positionerElement || viewportElement;
|
|
1540
|
-
if (!floatingRootContext && !hasPositioner) {
|
|
1541
|
-
return children;
|
|
1542
|
-
}
|
|
1543
|
-
return /* @__PURE__ */ _jsxs2(React13.Fragment, {
|
|
1544
|
-
children: [/* @__PURE__ */ _jsx8(FocusGuard, {
|
|
1545
|
-
ref: beforeInsideRef,
|
|
1546
|
-
onFocus: (event) => {
|
|
1547
|
-
if (referenceElement && isOutsideEvent(event, referenceElement)) {
|
|
1548
|
-
getNextTabbable(referenceElement)?.focus();
|
|
1549
|
-
} else {
|
|
1550
|
-
beforeOutsideRef.current?.focus();
|
|
1551
|
-
}
|
|
1552
|
-
}
|
|
1553
|
-
}), children, /* @__PURE__ */ _jsx8(FocusGuard, {
|
|
1554
|
-
ref: afterInsideRef,
|
|
1555
|
-
onFocus: (event) => {
|
|
1556
|
-
if (referenceElement && isOutsideEvent(event, referenceElement)) {
|
|
1557
|
-
getPreviousTabbable(referenceElement)?.focus();
|
|
1558
|
-
} else {
|
|
1559
|
-
afterOutsideRef.current?.focus();
|
|
1560
|
-
}
|
|
1561
|
-
}
|
|
1562
|
-
})]
|
|
1563
|
-
});
|
|
1564
|
-
}
|
|
1565
|
-
var NavigationMenuViewport = /* @__PURE__ */ React13.forwardRef(function NavigationMenuViewport2(componentProps, forwardedRef) {
|
|
1566
|
-
const {
|
|
1567
|
-
render,
|
|
1568
|
-
className,
|
|
1569
|
-
style,
|
|
1570
|
-
children,
|
|
1571
|
-
id: idProp,
|
|
1572
|
-
...elementProps
|
|
1573
|
-
} = componentProps;
|
|
1574
|
-
const id = useId(idProp);
|
|
1575
|
-
const {
|
|
1576
|
-
setViewportElement,
|
|
1577
|
-
setViewportTargetElement,
|
|
1578
|
-
floatingRootContext,
|
|
1579
|
-
prevTriggerElementRef,
|
|
1580
|
-
viewportInert,
|
|
1581
|
-
setViewportInert
|
|
1582
|
-
} = useNavigationMenuRootContext();
|
|
1583
|
-
const positioning = useNavigationMenuPositionerContext(true);
|
|
1584
|
-
const hasPositioner = Boolean(positioning);
|
|
1585
|
-
const domReference = (floatingRootContext || EMPTY_ROOT_CONTEXT2).useState("domReferenceElement");
|
|
1586
|
-
useIsoLayoutEffect(() => {
|
|
1587
|
-
if (domReference) {
|
|
1588
|
-
prevTriggerElementRef.current = domReference;
|
|
1589
|
-
}
|
|
1590
|
-
}, [domReference, prevTriggerElementRef]);
|
|
1591
|
-
const element = useRenderElement("div", componentProps, {
|
|
1592
|
-
ref: [forwardedRef, setViewportElement],
|
|
1593
|
-
props: [{
|
|
1594
|
-
id,
|
|
1595
|
-
onBlur(event) {
|
|
1596
|
-
const relatedTarget = event.relatedTarget;
|
|
1597
|
-
const currentTarget = event.currentTarget;
|
|
1598
|
-
if (relatedTarget && !contains(currentTarget, relatedTarget) && relatedTarget !== domReference) {
|
|
1599
|
-
setViewportInert(true);
|
|
1600
|
-
}
|
|
1601
|
-
},
|
|
1602
|
-
...!hasPositioner && viewportInert && {
|
|
1603
|
-
inert: inertValue(true)
|
|
1604
|
-
},
|
|
1605
|
-
children: hasPositioner ? children : /* @__PURE__ */ _jsx8(Guards, {
|
|
1606
|
-
children: /* @__PURE__ */ _jsx8("div", {
|
|
1607
|
-
ref: setViewportTargetElement,
|
|
1608
|
-
children
|
|
1609
|
-
})
|
|
1610
|
-
})
|
|
1611
|
-
}, elementProps]
|
|
1612
|
-
});
|
|
1613
|
-
return hasPositioner ? /* @__PURE__ */ _jsx8(Guards, {
|
|
1614
|
-
children: element
|
|
1615
|
-
}) : element;
|
|
1616
|
-
});
|
|
1617
|
-
if (true)
|
|
1618
|
-
NavigationMenuViewport.displayName = "NavigationMenuViewport";
|
|
1619
|
-
// node_modules/@base-ui/react/esm/navigation-menu/backdrop/NavigationMenuBackdrop.js
|
|
1620
|
-
import * as React14 from "react";
|
|
1621
|
-
"use client";
|
|
1622
|
-
var stateAttributesMapping2 = {
|
|
1623
|
-
...popupStateMapping,
|
|
1624
|
-
...transitionStatusMapping
|
|
1625
|
-
};
|
|
1626
|
-
var NavigationMenuBackdrop = /* @__PURE__ */ React14.forwardRef(function NavigationMenuBackdrop2(componentProps, forwardedRef) {
|
|
1627
|
-
const {
|
|
1628
|
-
render,
|
|
1629
|
-
className,
|
|
1630
|
-
style,
|
|
1631
|
-
...elementProps
|
|
1632
|
-
} = componentProps;
|
|
1633
|
-
const {
|
|
1634
|
-
open,
|
|
1635
|
-
mounted,
|
|
1636
|
-
transitionStatus
|
|
1637
|
-
} = useNavigationMenuRootContext();
|
|
1638
|
-
const state = {
|
|
1639
|
-
open,
|
|
1640
|
-
transitionStatus
|
|
1641
|
-
};
|
|
1642
|
-
const element = useRenderElement("div", componentProps, {
|
|
1643
|
-
state,
|
|
1644
|
-
ref: forwardedRef,
|
|
1645
|
-
props: [{
|
|
1646
|
-
role: "presentation",
|
|
1647
|
-
hidden: !mounted,
|
|
1648
|
-
style: {
|
|
1649
|
-
userSelect: "none",
|
|
1650
|
-
WebkitUserSelect: "none"
|
|
1651
|
-
}
|
|
1652
|
-
}, elementProps],
|
|
1653
|
-
stateAttributesMapping: stateAttributesMapping2
|
|
1654
|
-
});
|
|
1655
|
-
return element;
|
|
1656
|
-
});
|
|
1657
|
-
if (true)
|
|
1658
|
-
NavigationMenuBackdrop.displayName = "NavigationMenuBackdrop";
|
|
1659
|
-
// node_modules/@base-ui/react/esm/navigation-menu/popup/NavigationMenuPopup.js
|
|
1660
|
-
import * as React15 from "react";
|
|
1661
|
-
"use client";
|
|
1662
|
-
var stateAttributesMapping3 = {
|
|
1663
|
-
...popupStateMapping,
|
|
1664
|
-
...transitionStatusMapping
|
|
1665
|
-
};
|
|
1666
|
-
var NavigationMenuPopup = /* @__PURE__ */ React15.forwardRef(function NavigationMenuPopup2(componentProps, forwardedRef) {
|
|
1667
|
-
const {
|
|
1668
|
-
render,
|
|
1669
|
-
className,
|
|
1670
|
-
style,
|
|
1671
|
-
id: idProp,
|
|
1672
|
-
...elementProps
|
|
1673
|
-
} = componentProps;
|
|
1674
|
-
const {
|
|
1675
|
-
open,
|
|
1676
|
-
transitionStatus,
|
|
1677
|
-
setPopupElement
|
|
1678
|
-
} = useNavigationMenuRootContext();
|
|
1679
|
-
const positioning = useNavigationMenuPositionerContext();
|
|
1680
|
-
const direction = useDirection();
|
|
1681
|
-
const id = useBaseUiId(idProp);
|
|
1682
|
-
const state = {
|
|
1683
|
-
open,
|
|
1684
|
-
transitionStatus,
|
|
1685
|
-
side: positioning.side,
|
|
1686
|
-
align: positioning.align,
|
|
1687
|
-
anchorHidden: positioning.anchorHidden
|
|
1688
|
-
};
|
|
1689
|
-
let isOriginSide = positioning.side === "top";
|
|
1690
|
-
let isPhysicalLeft = positioning.side === "left";
|
|
1691
|
-
if (direction === "rtl") {
|
|
1692
|
-
isOriginSide = isOriginSide || positioning.side === "inline-end";
|
|
1693
|
-
isPhysicalLeft = isPhysicalLeft || positioning.side === "inline-end";
|
|
1694
|
-
} else {
|
|
1695
|
-
isOriginSide = isOriginSide || positioning.side === "inline-start";
|
|
1696
|
-
isPhysicalLeft = isPhysicalLeft || positioning.side === "inline-start";
|
|
1697
|
-
}
|
|
1698
|
-
const element = useRenderElement("nav", componentProps, {
|
|
1699
|
-
state,
|
|
1700
|
-
ref: [forwardedRef, setPopupElement],
|
|
1701
|
-
props: [{
|
|
1702
|
-
id,
|
|
1703
|
-
tabIndex: -1,
|
|
1704
|
-
style: isOriginSide ? {
|
|
1705
|
-
position: "absolute",
|
|
1706
|
-
[positioning.side === "top" ? "bottom" : "top"]: "0",
|
|
1707
|
-
[isPhysicalLeft ? "right" : "left"]: "0"
|
|
1708
|
-
} : {}
|
|
1709
|
-
}, elementProps],
|
|
1710
|
-
stateAttributesMapping: stateAttributesMapping3
|
|
1711
|
-
});
|
|
1712
|
-
return element;
|
|
1713
|
-
});
|
|
1714
|
-
if (true)
|
|
1715
|
-
NavigationMenuPopup.displayName = "NavigationMenuPopup";
|
|
1716
|
-
// node_modules/@base-ui/react/esm/navigation-menu/arrow/NavigationMenuArrow.js
|
|
1717
|
-
import * as React16 from "react";
|
|
1718
|
-
"use client";
|
|
1719
|
-
var NavigationMenuArrow = /* @__PURE__ */ React16.forwardRef(function NavigationMenuArrow2(componentProps, forwardedRef) {
|
|
1720
|
-
const {
|
|
1721
|
-
render,
|
|
1722
|
-
className,
|
|
1723
|
-
style,
|
|
1724
|
-
...elementProps
|
|
1725
|
-
} = componentProps;
|
|
1726
|
-
const {
|
|
1727
|
-
open
|
|
1728
|
-
} = useNavigationMenuRootContext();
|
|
1729
|
-
const {
|
|
1730
|
-
arrowRef,
|
|
1731
|
-
side,
|
|
1732
|
-
align,
|
|
1733
|
-
arrowUncentered,
|
|
1734
|
-
arrowStyles
|
|
1735
|
-
} = useNavigationMenuPositionerContext();
|
|
1736
|
-
const state = {
|
|
1737
|
-
open,
|
|
1738
|
-
side,
|
|
1739
|
-
align,
|
|
1740
|
-
uncentered: arrowUncentered
|
|
1741
|
-
};
|
|
1742
|
-
const element = useRenderElement("div", componentProps, {
|
|
1743
|
-
state,
|
|
1744
|
-
ref: [forwardedRef, arrowRef],
|
|
1745
|
-
props: [{
|
|
1746
|
-
style: arrowStyles,
|
|
1747
|
-
"aria-hidden": true
|
|
1748
|
-
}, elementProps],
|
|
1749
|
-
stateAttributesMapping: popupStateMapping
|
|
1750
|
-
});
|
|
1751
|
-
return element;
|
|
1752
|
-
});
|
|
1753
|
-
if (true)
|
|
1754
|
-
NavigationMenuArrow.displayName = "NavigationMenuArrow";
|
|
1755
|
-
// node_modules/@base-ui/react/esm/navigation-menu/link/NavigationMenuLink.js
|
|
1756
|
-
import * as React17 from "react";
|
|
1757
|
-
import { jsx as _jsx9 } from "react/jsx-runtime";
|
|
1758
|
-
"use client";
|
|
1759
|
-
var NavigationMenuLink = /* @__PURE__ */ React17.forwardRef(function NavigationMenuLink2(componentProps, forwardedRef) {
|
|
1760
|
-
const {
|
|
1761
|
-
className,
|
|
1762
|
-
render,
|
|
1763
|
-
active = false,
|
|
1764
|
-
closeOnClick = false,
|
|
1765
|
-
style,
|
|
1766
|
-
...elementProps
|
|
1767
|
-
} = componentProps;
|
|
1768
|
-
const {
|
|
1769
|
-
setValue,
|
|
1770
|
-
popupElement,
|
|
1771
|
-
positionerElement,
|
|
1772
|
-
rootRef
|
|
1773
|
-
} = useNavigationMenuRootContext();
|
|
1774
|
-
const nodeId = useNavigationMenuTreeContext();
|
|
1775
|
-
const tree = useFloatingTree();
|
|
1776
|
-
const state = {
|
|
1777
|
-
active
|
|
1778
|
-
};
|
|
1779
|
-
const defaultProps = {
|
|
1780
|
-
"aria-current": active ? "page" : undefined,
|
|
1781
|
-
tabIndex: undefined,
|
|
1782
|
-
onClick(event) {
|
|
1783
|
-
if (closeOnClick) {
|
|
1784
|
-
setValue(null, createChangeEventDetails(exports_reason_parts.linkPress, event.nativeEvent));
|
|
1785
|
-
}
|
|
1786
|
-
},
|
|
1787
|
-
onBlur(event) {
|
|
1788
|
-
if (positionerElement && popupElement && isOutsideMenuEvent({
|
|
1789
|
-
currentTarget: event.currentTarget,
|
|
1790
|
-
relatedTarget: event.relatedTarget
|
|
1791
|
-
}, {
|
|
1792
|
-
popupElement,
|
|
1793
|
-
rootRef,
|
|
1794
|
-
tree,
|
|
1795
|
-
nodeId
|
|
1796
|
-
})) {
|
|
1797
|
-
setValue(null, createChangeEventDetails(exports_reason_parts.focusOut, event.nativeEvent));
|
|
1798
|
-
}
|
|
1799
|
-
}
|
|
1800
|
-
};
|
|
1801
|
-
return /* @__PURE__ */ _jsx9(CompositeItem, {
|
|
1802
|
-
tag: "a",
|
|
1803
|
-
render,
|
|
1804
|
-
className,
|
|
1805
|
-
style,
|
|
1806
|
-
state,
|
|
1807
|
-
refs: [forwardedRef],
|
|
1808
|
-
props: [defaultProps, elementProps]
|
|
1809
|
-
});
|
|
1810
|
-
});
|
|
1811
|
-
if (true)
|
|
1812
|
-
NavigationMenuLink.displayName = "NavigationMenuLink";
|
|
1813
|
-
// node_modules/@base-ui/react/esm/navigation-menu/icon/NavigationMenuIcon.js
|
|
1814
|
-
import * as React18 from "react";
|
|
1815
|
-
"use client";
|
|
1816
|
-
var NavigationMenuIcon = /* @__PURE__ */ React18.forwardRef(function NavigationMenuIcon2(componentProps, forwardedRef) {
|
|
1817
|
-
const {
|
|
1818
|
-
render,
|
|
1819
|
-
className,
|
|
1820
|
-
style,
|
|
1821
|
-
...elementProps
|
|
1822
|
-
} = componentProps;
|
|
1823
|
-
const {
|
|
1824
|
-
value: itemValue
|
|
1825
|
-
} = useNavigationMenuItemContext();
|
|
1826
|
-
const {
|
|
1827
|
-
open,
|
|
1828
|
-
value
|
|
1829
|
-
} = useNavigationMenuRootContext();
|
|
1830
|
-
const isActiveItem = open && value === itemValue;
|
|
1831
|
-
const state = {
|
|
1832
|
-
open: isActiveItem
|
|
1833
|
-
};
|
|
1834
|
-
const element = useRenderElement("span", componentProps, {
|
|
1835
|
-
state,
|
|
1836
|
-
ref: forwardedRef,
|
|
1837
|
-
props: [{
|
|
1838
|
-
"aria-hidden": true,
|
|
1839
|
-
children: "▼"
|
|
1840
|
-
}, elementProps],
|
|
1841
|
-
stateAttributesMapping: triggerOpenStateMapping
|
|
1842
|
-
});
|
|
1843
|
-
return element;
|
|
1844
|
-
});
|
|
1845
|
-
if (true)
|
|
1846
|
-
NavigationMenuIcon.displayName = "NavigationMenuIcon";
|
|
1847
|
-
export {
|
|
1848
|
-
exports_index_parts as NavigationMenu
|
|
1849
|
-
};
|