@cloudflare/kumo 2.14.0 → 2.15.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 +51 -0
- package/ai/component-registry.json +231 -43
- package/ai/component-registry.md +774 -166
- package/ai/schemas.ts +22 -3
- package/dist/.build-complete +1 -1
- package/dist/ai/schemas.d.ts +51 -2
- package/dist/ai/schemas.js +32 -1
- package/dist/blocks-source/delete-resource/delete-resource.test.tsx +21 -0
- package/dist/blocks-source/delete-resource/delete-resource.tsx +14 -8
- package/dist/chunks/{index.parts-h7wtkrxpz4m8eqn9.js → AccordionPanelDataAttributes-mmrmkky28u1010l5.js} +150 -61
- package/dist/chunks/{AlertDialogTrigger-dkihgpvj12si73w3.js → AlertDialogTrigger-l1r1gbxcky1xq889.js} +4 -4
- package/dist/chunks/{index.parts-kgiqby97w6tn6jw7.js → AlertDialogTriggerDataAttributes-go49qon601catpgn.js} +24 -9
- package/dist/chunks/{AutocompleteItem-drxau0wm3735nihq.js → AutocompleteItem-36ysm5nwbsd0snr6.js} +5 -5
- package/dist/chunks/AutocompleteItemDataAttributes-n5rigpf0s9ylnwi3.js +232 -0
- package/dist/chunks/{AutocompleteSeparator-hqtaxxxye1rfezfg.js → AutocompleteSeparator-bnqeqh7i983d92gx.js} +2 -2
- package/dist/chunks/{index.parts-b9zmk3ta77w8dy9f.js → AvatarImageDataAttributes-jw70u384c83lhqfp.js} +39 -15
- package/dist/chunks/{Button-ccl5r1xlbe3gh998.js → ButtonDataAttributes-nceand1fi7lvnmkb.js} +12 -4
- package/dist/chunks/{CSPContext-ctyrgg64girv38ls.js → CSPContext-iv67i0qqhihg8mur.js} +1 -1
- package/dist/chunks/{CSPProvider-p9ensukmowjpkgc0.js → CSPProvider-finau3a8hnc9o2td.js} +2 -2
- package/dist/chunks/{CheckboxGroup-knvypu2d1s0iz86k.js → CheckboxGroup-581mfftu99wvjb3a.js} +18 -23
- package/dist/chunks/{CheckboxGroupContext-lgc9dwxou662i6zo.js → CheckboxGroupContext-jf1bt3znvqlhrql6.js} +1 -1
- package/dist/chunks/CheckboxGroupDataAttributes-nskqcxts64symbvf.js +10 -0
- package/dist/chunks/{CheckboxIndicator-n982pbktfkxsa5zz.js → CheckboxIndicator-i13dmhacfgqo328c.js} +86 -29
- package/dist/chunks/CheckboxIndicatorDataAttributes-3p29ju7nkczz1l2y.js +85 -0
- package/dist/chunks/{CollapsiblePanel-jm0ni90g7wz7ppkc.js → CollapsiblePanel-md5suzmtnsyz1kab.js} +17 -13
- package/dist/chunks/CollapsibleRootDataAttributes-bynmgxmt4jikaoha.js +36 -0
- package/dist/chunks/{ComboboxClear-c2kvjkh9yc6xfl38.js → ComboboxClear-ioejwvtnmqanph88.js} +31 -24
- package/dist/chunks/ComboboxClearDataAttributes-lo0enstdmrqpywsy.js +402 -0
- package/dist/chunks/{ComboboxEmpty-o0q20j2l2syar9kx.js → ComboboxEmpty-gkt1y5b81a4983v7.js} +207 -215
- package/dist/chunks/ComboboxItemIndicatorDataAttributes-iku7l9ig0ve09an4.js +259 -0
- package/dist/chunks/{ComboboxPopup-oxgggc2wxy6bfmru.js → ComboboxPopup-n8cbgys9st446j1i.js} +15 -15
- package/dist/chunks/{CompositeItem-hzuk5x3e5zsfgnyj.js → CompositeItem-kepwg8jtvgap06o6.js} +3 -3
- package/dist/chunks/{CompositeList-lbr4enu6yzek7oa9.js → CompositeList-gwuaf6d14s4da0j0.js} +9 -7
- package/dist/chunks/{CompositeListContext-m9frxn53kkmr23d0.js → CompositeListContext-bejvmlu39hsfjzgu.js} +1 -1
- package/dist/chunks/{CompositeRoot-g72lchaerolf5dc9.js → CompositeRoot-dnlkb27uw4g5aocf.js} +12 -12
- package/dist/chunks/{CompositeRootContext-ixz4myr7uwvavx6w.js → CompositeRootContext-obm54j7y6s86qwhq.js} +1 -1
- package/dist/chunks/{index.parts-d4wim8mcnl9a2n9d.js → ContextMenuTriggerDataAttributes-xwozccynxv6pk5s0.js} +29 -15
- package/dist/chunks/DialogBackdropDataAttributes-jwqxd6jla03xh8ke.js +28 -0
- package/dist/chunks/{DialogHandle-klk7uo1q1y8ghyx5.js → DialogCloseDataAttributes-12m7gwh3i6fd7d05.js} +14 -6
- package/dist/chunks/{DialogPopup-olsvyf7ulia6ekb1.js → DialogPopup-n6w7b389e7bs0472.js} +13 -11
- package/dist/chunks/{DialogRoot-hl3genvzl9h8ridm.js → DialogRoot-hkkqj7vcjpkx8qk8.js} +3 -3
- package/dist/chunks/{DialogTrigger-g44cuem7n4wez533.js → DialogTrigger-kpugfkbfswqrus4u.js} +16 -16
- package/dist/chunks/DialogTriggerDataAttributes-bp9bu13cvwuddh5b.js +18 -0
- package/dist/chunks/DialogViewportDataAttributes-mma9emv1edsc1vuy.js +78 -0
- package/dist/chunks/{DirectionContext-opvqcb794uxicri4.js → DirectionContext-kpby968j030psajn.js} +1 -1
- package/dist/chunks/{DirectionProvider-er2gibtc9a1f0kep.js → DirectionProvider-cg0pwzgdyg6r73r6.js} +2 -2
- package/dist/chunks/{DrawerViewport-eqzib92gukr4qap3.js → DrawerViewport-mzqpwvqtylnad8ib.js} +110 -61
- package/dist/chunks/{index.parts-jknln7yxhdokkvd6.js → DrawerViewportDataAttributes-dd9593zm9fl9vcsm.js} +166 -85
- package/dist/chunks/{FieldControl-c5sahhd5xg3nr2x7.js → FieldControl-hjj2tcqruozadgdi.js} +18 -27
- package/dist/chunks/{FieldDescription-ldfiii5bvssfib3d.js → FieldDescription-orix2gepowrp5ni4.js} +11 -11
- package/dist/chunks/{FieldItemContext-kpsmvqm5a98m8zpx.js → FieldItemContext-ohsf45im6xhpay40.js} +1 -1
- package/dist/chunks/FieldItemDataAttributes-m52srx69pispz49i.js +283 -0
- package/dist/chunks/{FieldLabel-j9teqs9f1exqv346.js → FieldLabel-fjc7tdis7rcbq8o4.js} +17 -15
- package/dist/chunks/{FieldsetLegend-jyy40ylt2ynkvgob.js → FieldsetLegend-gl9z9eezr0xg9zr7.js} +5 -5
- package/dist/chunks/FieldsetLegendDataAttributes-fn20251jxjqkpkxm.js +17 -0
- package/dist/chunks/{FieldsetRootContext-7nlstw7wronafxhw.js → FieldsetRootContext-fphwizvcm55ydg94.js} +1 -1
- package/dist/chunks/{FloatingPortalLite-da0wdcmem7ahkle6.js → FloatingPortalLite-j7dsy7gokbxdoe1i.js} +2 -2
- package/dist/chunks/{popupTriggerMap-ehv0fuhnmy59j3pn.js → FloatingRootStore-men6ufp3a2b296fh.js} +117 -119
- package/dist/chunks/{FloatingTree-lhdqtlu8s6m66n7l.js → FloatingTree-kiyzavvaum442o1s.js} +6 -6
- package/dist/chunks/{Form-fjfbann47c7ws316.js → Form-oz425k7r4abea8o4.js} +7 -7
- package/dist/chunks/{FormContext-bsu99v8i8pwu1yxc.js → FormContext-jv19engyccpf6xcl.js} +2 -2
- package/dist/chunks/{Input-irwtufp5t73pwnoj.js → Input-ozudotydd679ly63.js} +2 -2
- package/dist/chunks/InputDataAttributes-oy8t6q5y5t8ik02j.js +42 -0
- package/dist/chunks/ItemIndicator-cvf8cw5fv5l3cd8j.js +37 -0
- package/dist/chunks/{LabelableContext-ccxbhu73vrk089m1.js → LabelableContext-dz4wz3lu3lgqusu7.js} +37 -6
- package/dist/chunks/{ListboxSeparator-nfyv54r2v5qtmosj.js → ListboxSeparator-skazx18vzzj7i9zp.js} +2 -2
- package/dist/chunks/MenuClearDataAttributes-fo0pekd36n56mdxu.js +1645 -0
- package/dist/chunks/{MenuSubmenuTrigger-mbbda6ucik6nphbq.js → MenuSubmenuTrigger-hm5xbgik6aq95x35.js} +639 -281
- package/dist/chunks/MenuSubmenuTriggerDataAttributes-gdfxdjymgmnaxdds.js +372 -0
- package/dist/chunks/{MenuTrigger-disngqnt74owi30p.js → MenuTrigger-dlfvicsaggss0o9m.js} +36 -28
- package/dist/chunks/{Menubar-fluuxyn8c2zuz5pr.js → Menubar-ja5int05ihjj0ra4.js} +24 -14
- package/dist/chunks/{MenubarContext-blatefsj42br7jh8.js → MenubarContext-ooz0h08i55c8oip5.js} +1 -1
- package/dist/chunks/{MeterLabel-k6no448jvaidaptf.js → MeterLabel-cykbkvqys5263z05.js} +12 -12
- package/dist/chunks/{index.parts-gf9v1piz8xxt8ap1.js → NavigationMenuIconDataAttributes-l82pkpm61d0meqxf.js} +333 -94
- package/dist/chunks/{NullStore-jwgpmovsgl47g9bv.js → NullStore-my62xo2vfcfkerri.js} +7 -6
- package/dist/chunks/{index.parts-c1ocmbxanagpan6d.js → NumberFieldScrubAreaCursorDataAttributes-k2lsbk35svshnwf5.js} +439 -215
- package/dist/chunks/{index.parts-p2lcxzhh1ll3584m.js → OTPFieldInputDataAttributes-gvgtu2gg85kgjzwr.js} +173 -56
- package/dist/chunks/{PopoverClose-kpyt8hbqc52lnjb8.js → PopoverViewport-peh28i8q4hqfjy97.js} +135 -81
- package/dist/chunks/PopoverViewportDataAttributes-gplhq9d7ffp9q8u3.js +329 -0
- package/dist/chunks/{PrehydrationScript-j6zlrxmojrqni6b9.js → PrehydrationScript-hs2je3mndbxuts7w.js} +29 -14
- package/dist/chunks/{index.parts-cc0yi5vo7s4x3r9p.js → PreviewCardViewportDataAttributes-bgfwmyshey7fx6nr.js} +263 -36
- package/dist/chunks/{index.parts-lpafjiz853r94ydb.js → ProgressLabelDataAttributes-j8mutcz11ei0ohvj.js} +103 -22
- package/dist/chunks/{RadioGroup-pok1e5qbnbujrz1e.js → RadioGroup-kioqngmmuo7a1lfa.js} +37 -42
- package/dist/chunks/{RadioGroupContext-galfnl2el7y2krov.js → RadioGroupContext-dr6uihsj7oky0eol.js} +1 -1
- package/dist/chunks/RadioGroupDataAttributes-dpdr6xe4ve204qwb.js +10 -0
- package/dist/chunks/{RadioIndicator-jd511oajbwmyjxbg.js → RadioIndicator-bhxqih8wzv7hyrec.js} +83 -27
- package/dist/chunks/RadioIndicatorDataAttributes-n5yupp5psifu0d4f.js +80 -0
- package/dist/chunks/{ScrollAreaThumb-eed3hf0pmrblshfw.js → ScrollAreaThumb-hxig41yn4lrurd3o.js} +114 -43
- package/dist/chunks/ScrollAreaThumbDataAttributes-gup5wfxvqye6jj27.js +137 -0
- package/dist/chunks/SelectScrollUpArrowDataAttributes-fce5i1afjkb0necr.js +473 -0
- package/dist/chunks/{SelectSeparator-mrjooj7vmjez6fua.js → SelectSeparator-nnak70azojox8b2b.js} +249 -162
- package/dist/chunks/{Separator-bcm4ezllqxvtpvuj.js → Separator-fhwve0tfny3tht3a.js} +2 -2
- package/dist/chunks/SeparatorDataAttributes-ch6e63bas7zflw00.js +11 -0
- package/dist/chunks/{index.parts-j6kbr29a542ya81m.js → SliderIndicator-h1o3qbrvr8x0t4t2.js} +129 -74
- package/dist/chunks/SliderIndicatorDataAttributes-ff2f1cjealif5nvo.js +240 -0
- package/dist/chunks/{SwitchRoot-gahuqddsq1s55p8m.js → SwitchRoot-m4t2tq5zn5wibyxk.js} +74 -22
- package/dist/chunks/SwitchThumbDataAttributes-f95ld864on9y6ptk.js +90 -0
- package/dist/chunks/{TabsList-ebl0v8gu8wn28zss.js → TabsList-n5n93rxr4sy704u8.js} +48 -30
- package/dist/chunks/TabsListDataAttributes-e03a7kbubuf02z1l.js +183 -0
- package/dist/chunks/ToastArrowDataAttributes-jbnvz3kp6a35slgj.js +136 -0
- package/dist/chunks/{Toggle-mbshs50266z9hgxp.js → ToggleDataAttributes-jl9ojyvwgrvefke6.js} +26 -11
- package/dist/chunks/{ToggleGroupContext-h4v7jaf77rp2xng9.js → ToggleGroupContext-hg8zbkgqpscqhz83.js} +1 -1
- package/dist/chunks/{ToggleGroup-k2caz2ghv6zbzp5l.js → ToggleGroupDataAttributes-n1dwona1alvabstl.js} +30 -9
- package/dist/chunks/{ToolbarGroupContext-e5cg7needj0edodc.js → ToolbarGroupContext-eawva8xkxb4osbxb.js} +1 -1
- package/dist/chunks/{ToolbarInput-i4h95tes75w0p5y2.js → ToolbarInput-kyxl1be0p3cyuayp.js} +10 -10
- package/dist/chunks/ToolbarInputDataAttributes-n4a18a4km735du04.js +150 -0
- package/dist/chunks/{ToolbarRootContext-eqk40r8uh4h6r211.js → ToolbarRootContext-difqbj720teyt8lu.js} +1 -1
- package/dist/chunks/{TooltipPopup-dm4y0hbdeylzp22y.js → TooltipPopup-furysmeyb68uycbz.js} +41 -68
- package/dist/chunks/{TooltipProvider-h40qf9wcn0atj15v.js → TooltipProvider-hyans0ens4axh1y8.js} +5 -5
- package/dist/chunks/TooltipViewportDataAttributes-gkwbezdq40ssuevg.js +312 -0
- package/dist/chunks/{adaptiveOriginMiddleware-b8ztjthe278xq7lm.js → adaptiveOriginMiddleware-m9tqzw58wya9sdds.js} +3 -3
- package/dist/chunks/{addEventListener-l40nxvf06iukgvnj.js → addEventListener-ku3x23446prmd1kz.js} +1 -1
- package/dist/chunks/{areArraysEqual-bcx201k1x9ziizym.js → areArraysEqual-nnpg93s9g7aqcaoh.js} +1 -1
- package/dist/chunks/{autocomplete-m6h1pbygknrz5div.js → autocomplete-kgp17p6oz4pczxt9.js} +9 -9
- package/dist/chunks/{badge-dq8bx752b9dp7dst.js → badge-kyz53p7p0ng393bs.js} +2 -1
- package/dist/chunks/{banner-msnmqm7of2lck01x.js → banner-cpla8vqjxaulggyd.js} +3 -3
- package/dist/chunks/{breadcrumbs-lhi1qrdh74mb4zsx.js → breadcrumbs-oyuqwb09l08uhok2.js} +7 -16
- package/dist/chunks/{button-group-i9dh83xutyuxyry7.js → button-group-biv43ksvaipc3p5n.js} +2 -2
- package/dist/chunks/{button-pa1bq9b85hawg41a.js → button-oxy32x5w9x9az80g.js} +25 -6
- package/dist/chunks/{chart-kd1xd6crso2i956o.js → chart-foxl6xbubuoshfcs.js} +14 -10
- package/dist/chunks/{checkbox-lbo436duy7krxcsk.js → checkbox-o9627970y7c9ciqy.js} +90 -36
- package/dist/chunks/{clamp-jcjhzx71s6wt1rnc.js → clamp-rcpupxvhqrn8uuyf.js} +1 -1
- package/dist/chunks/{clipboard-text-gd6s3n1bqse9zgt8.js → clipboard-text-bhy88tgvk1o6wmyl.js} +6 -6
- package/dist/chunks/{cloudflare-logo-boafurcbm5ttoo4o.js → cloudflare-logo-d8mid9xr190h78cu.js} +3 -3
- package/dist/chunks/{code-eu8kzwqnlhoyin24.js → code-nj2nu6qzxhz6qnkk.js} +1 -1
- package/dist/chunks/{collapsible-l8g94on4w7qfosmn.js → collapsible-ic6813hc4yv5s5hv.js} +2 -2
- package/dist/chunks/{combobox-hdxtsm2gqcxxgfju.js → combobox-hwrq8etkr7p2id0x.js} +7 -7
- package/dist/chunks/{command-palette-crtm3nd32yjhuax1.js → command-palette-el4x943vpmid0po0.js} +8 -8
- package/dist/chunks/{composite-ab8dmdfoj6tmhcn1.js → composite-c11t1ok72s3cggjc.js} +1 -1
- package/dist/chunks/{constants-flxfd6q03phtu007.js → constants-l10cgj6pyqg27jod.js} +1 -1
- package/dist/chunks/{createBaseUIEventDetails-3ob3qgs95ffm8l0w.js → createBaseUIEventDetails-nvee6bghv2reeqdb.js} +3 -2
- package/dist/chunks/{createItems-b8n8vigg5nak6j9s.js → createItems-n07tfwx89cdoar18.js} +42 -77
- package/dist/chunks/{createToastManager-onmoqrmr8zo02rif.js → createToastManager-cxjmn4jx3ejh85fs.js} +86 -42
- package/dist/chunks/{date-picker-cotkexrpqu5tjikv.js → date-picker-oee5ehsrepnlmltj.js} +4 -2
- package/dist/chunks/{date-range-picker-i6d8y1yemm7x5ins.js → date-range-picker-hpx3cdu9ve01jx6d.js} +1 -1
- package/dist/chunks/{dialog-glpnivujociqs9lh.js → dialog-lgrwmsumwpftp2u8.js} +7 -7
- package/dist/chunks/{dropdown-m53ji1d66mws89wh.js → dropdown-o875yxeqod7qp871.js} +133 -30
- package/dist/chunks/{empty-hkvg3is3uc6dj1at.js → empty-ft85jcbs7fd5t3tn.js} +11 -12
- package/dist/chunks/{engine-g5egnkub1ikv3wvy.js → engine-hzmefiqm63hu0c7i.js} +2 -2
- package/dist/chunks/{error-f4f6l13zx6tynxmy.js → error-lbnic2b20qr3mukp.js} +2 -2
- package/dist/chunks/{field-oqtso1v0oszlxi0e.js → field-jzzlgre0jmrr38o2.js} +4 -4
- package/dist/chunks/{flow-iz8sn24h5q6q4b10.js → flow-imvwzp5p2f8y2dxm.js} +7 -3
- package/dist/chunks/{formatNumber-kcnmauoqxku5a84c.js → formatNumber-b4kjdsebslm2b3t0.js} +2 -2
- package/dist/chunks/{getCssDimensions-olosvhh5husavesv.js → getCssDimensions-gckwdrp86f73cv51.js} +1 -1
- package/dist/chunks/{getElementTransform-cuiqmjglkrz4db6c.js → getElementTransform-cz3jyftv0x5io95f.js} +1 -1
- package/dist/chunks/getFiniteAnimations-jwd833ybtz81j5f0.js +13 -0
- package/dist/chunks/getHighlightReason-fhc53kq6qakcct9s.js +15 -0
- package/dist/chunks/{getPseudoElementBounds-x7b9uqi5hdb1lq2r.js → getPseudoElementBounds-csuw8kwsoeyxd5tv.js} +2 -2
- package/dist/chunks/{grid-fjlo3wlpkwgw56y9.js → grid-nwiczrab3r4w0zr2.js} +1 -1
- package/dist/chunks/{index.parts-ftxrjoy00esi3aau.js → index.parts-db9pzsm9rrs9tp0t.js} +12 -12
- package/dist/chunks/{index.parts-iq66xivmdw2mouvx.js → index.parts-ggacwr0yakuemead.js} +7 -7
- package/dist/chunks/{index.parts-g390bxx23hdko02m.js → index.parts-pcg3pmf3yyro841t.js} +2 -2
- package/dist/chunks/{inertValue-e0o6qvuef83v78fk.js → inertValue-n09gkjvwwa1kddov.js} +2 -2
- package/dist/chunks/{inline-copy-text-gbd7jhwpor27l4rq.js → inline-copy-text-57r67slswfqvgbaf.js} +2 -2
- package/dist/chunks/{input-group-fjr4r5ax0x78ppax.js → input-group-n08mcd8b36wbylro.js} +5 -5
- package/dist/chunks/{input-h5ox92gf13ge04hp.js → input-il37wjigy2xtgdo2.js} +4 -4
- package/dist/chunks/{input-c8lv9ulv0kortliq.js → input-ksy1w6j1m6olz6ck.js} +3 -3
- package/dist/chunks/{isElementDisabled-o0j7po84u0xjuwgg.js → isElementDisabled-dyqutxpzdfppbohx.js} +1 -1
- package/dist/chunks/itemEquality-ki3x4tzdhjlqjey6.js +56 -0
- package/dist/chunks/{label-gzyfw17u08irhdo8.js → label-hugrtzreeqk5mtqu.js} +10 -6
- package/dist/chunks/{layer-card-idh3863vdgprgqai.js → layer-card-mar4dya5kl1vvie6.js} +3 -3
- package/dist/chunks/{layer-dialog-j5ywmzs46ccg6oqy.js → layer-dialog-dwrrgv1wasrerow4.js} +71 -46
- package/dist/chunks/{link-cqyfjezntvr53rh7.js → link-h84bkh8eem39p529.js} +4 -4
- package/dist/chunks/{loader-j2v6fab8iucuxz1z.js → loader-kv5nk8j8tsuesxqo.js} +2 -6
- package/dist/chunks/{locale-provider-kjlnws7jln3ak0dr.js → locale-provider-e3310bgo4lnffqkd.js} +20 -8
- package/dist/chunks/{menubar-fjhotkmndttb8mua.js → menubar-m5pqhx7lu5z7mkks.js} +2 -2
- package/dist/chunks/{mergeCleanups-ix8l84cgutsbotpd.js → mergeCleanups-nw73c6jfwl5tyhw4.js} +1 -1
- package/dist/chunks/{meter-majprsslwmpbmkzg.js → meter-poh8jpe0qtq6mvee.js} +2 -2
- package/dist/chunks/{pagination-oaenm9t7ou3lmcgw.js → pagination-h24on80p2z5ugqdb.js} +3 -3
- package/dist/chunks/{popover-hr0bfgg48xzjggky.js → popover-nqrt3ykqv6sic8pz.js} +70 -16
- package/dist/chunks/{popupHandle-7ghmro8a5uerjwu5.js → popupHandle-dk3ixgc8flr7v971.js} +4 -4
- package/dist/chunks/popupStoreUtils-czfnxn051xakask5.js +868 -0
- package/dist/chunks/radio-d3pkrvsldfbdefav.js +203 -0
- package/dist/chunks/{reason-parts-m5ishukzeux3q0pc.js → reason-parts-hssx64rmlxyn6gw5.js} +3 -2
- package/dist/chunks/{resolveAriaLabelledBy-nc8mdie5shy87nsb.js → resolveAriaLabelledBy-knaucrjrjwnk7tvs.js} +1 -1
- package/dist/chunks/resolveValueLabel-ntacnb58mhka5gg0.js +70 -0
- package/dist/chunks/{safePolygon-kmd5wsz26l4xtj6c.js → safePolygon-ep4133qogeu5vjf3.js} +34 -38
- package/dist/chunks/{safeReact-hpp4cck3y2s5jg75.js → safeReact-ek77ilng4ekk7mgz.js} +2 -2
- package/dist/chunks/{scrollable-b6m9ze1u7ps0q1qn.js → scrollable-k784b35i80aolmvg.js} +8 -13
- package/dist/chunks/{select-futox5zqr3r80y9a.js → select-ey03k4630uckf1rk.js} +8 -8
- package/dist/chunks/{sensitive-input-cw33yncetxk3fbrl.js → sensitive-input-lfrrtyg9n5ulq3tb.js} +23 -28
- package/dist/chunks/{serializeValue-ipcakiw32jb7kany.js → serializeValue-d1otz2i7h5tygrwf.js} +1 -1
- package/dist/chunks/{sidebar-in9zhvr473afsjpp.js → sidebar-gluq5b5oacrdk4m4.js} +23 -16
- package/dist/chunks/{skeleton-line-m9dyh126t9k07jvg.js → skeleton-line-gjf1fecmyy82aejz.js} +1 -1
- package/dist/chunks/slider-juwif2d8xa5n0429.js +87 -0
- package/dist/chunks/{stringifyLocale-bxsgxdnzaef2vcar.js → stringifyLocale-gbxouqj7ol627jxh.js} +1 -1
- package/dist/chunks/{styles-kl02oyrlnld7arja.js → styles-eb8bvypmayf578jf.js} +2 -2
- package/dist/chunks/{surface-irf0af2mfglu4p0j.js → surface-ginwpan1pz61l6k2.js} +2 -2
- package/dist/chunks/{switch-cqsvolm7h69z7vgg.js → switch-mqf1ulvle4nd6d2t.js} +4 -4
- package/dist/chunks/{table-yf8ul2e5nbemioi1.js → table-nysse5tiwf47gg4k.js} +2 -2
- package/dist/chunks/{table-of-contents-cvduqgssxdcbpagh.js → table-of-contents-gkjv9ck8etbz64ej.js} +5 -2
- package/dist/chunks/{tabs-gf57qqf1wcclaejq.js → tabs-mmkz7q5rofnmogwt.js} +3 -3
- package/dist/chunks/{tag-input-ohfybx5dbxy3houy.js → tag-input-b10gfxoob9vcizpm.js} +6 -5
- package/dist/chunks/{text-f1wxz183ckq7qtl7.js → text-me99rjbjkaff98gp.js} +1 -2
- package/dist/chunks/{toast-bzaothy2yrezh787.js → toast-b4t9rt9y1sumcmy2.js} +4 -4
- package/dist/chunks/{toolbar-h213d8e22yjh5cwq.js → toolbar-hov6sa3ui366f447.js} +5 -5
- package/dist/chunks/{tooltip-o4natsv01lpq8oq2.js → tooltip-lguwh8bjhxwnjfus.js} +3 -3
- package/dist/chunks/use-copy-feedback-gl55ghst0csvpv4j.js +55 -0
- package/dist/chunks/{useAnchoredPopupScrollLock-kp3kai20u91sdm7v.js → useAnchoredPopupScrollLock-msm8tzkewysnunut.js} +4 -4
- package/dist/chunks/{useAnimationFrame-0tt315hl9n3jzl86.js → useAnimationFrame-k9lqdj9quln3sd85.js} +3 -3
- package/dist/chunks/{useAriaLabelledBy-ox8dum59shmgypq1.js → useAriaLabelledBy-j3j9jqlr9ukyk08s.js} +7 -6
- package/dist/chunks/{useBaseUiId-lg1teubxudgin0w2.js → useBaseUiId-nk4k7nj9h1cy76ny.js} +2 -2
- package/dist/chunks/{useButton-h7s9aq1sfw6arawe.js → useButton-lklvdzuhvj22bx07.js} +14 -12
- package/dist/chunks/{useClick-l0p0endoxrlp0ae5.js → useClick-pcbkcc7r620v1smu.js} +12 -12
- package/dist/chunks/{useCollapsiblePanel-g6t146nqj521pild.js → useCollapsiblePanel-lrfsgx21ds36cwlp.js} +75 -28
- package/dist/chunks/{useCompositeItem-p7090ga00dpqcg5j.js → useCompositeItem-2juex3zh9gyrs8e9.js} +4 -4
- package/dist/chunks/{useCompositeListItem-odg6yo4h8866b37o.js → useCompositeListItem-ekwo2j2rjkggg7xj.js} +3 -3
- package/dist/chunks/{useControlled-lfns1ot6kwowa4t4.js → useControlled-i3srnkxy598s0au9.js} +3 -3
- package/dist/chunks/{useFieldValidation-e5pc8loiwzd68g4f.js → useFieldValidation-oe16jiigp971yrzr.js} +7 -7
- package/dist/chunks/{useFloatingRootContext-c849wtis7gx013m8.js → useFloatingRootContext-k676b6m7f80bdapd.js} +6 -6
- package/dist/chunks/{useFocus-lqwrnfa1svv3bcx1.js → useFocus-mn7a9t9v6fnlb4mf.js} +12 -14
- package/dist/chunks/useId-82z8yqlmc1hy1c5t.js +50 -0
- package/dist/chunks/useInitialLiveRegionTextMutation-nl2hus7zx1h7ggno.js +86 -0
- package/dist/chunks/{useLabel-kcggu762z3z2taeb.js → useLabel-me6zzfvkypo458pi.js} +19 -9
- package/dist/chunks/{useLabelableId-gqiiuqqn2k0u62r4.js → useLabelableId-bjeh6q3pgrqjb7er.js} +6 -6
- package/dist/chunks/{useListNavigation-3nyjs362qcau34in.js → useListNavigation-hpddbd0cc9pvt461.js} +56 -74
- package/dist/chunks/{useOnMount-hadwgyauanbzrvem.js → useOnMount-gxggz1m0n869s6r0.js} +2 -2
- package/dist/chunks/{useOpenChangeComplete-lk2gfu250t7r20c6.js → useOpenChangeComplete-edtabjwqmechsyv6.js} +10 -8
- package/dist/chunks/{usePopupHandleStore-hx871cmn66j0q7wz.js → usePopupHandleStore-gawjmfjf1xdgiph3.js} +2 -2
- package/dist/chunks/{usePopupViewport-iy5j9zawjrr3pcs0.js → usePopupViewport-l6w01iohvzloghy8.js} +28 -36
- package/dist/chunks/{usePositioner-k9nc7cl550bgfwzs.js → usePositioner-mzvgnazldqvy44z2.js} +41 -72
- package/dist/chunks/usePressAndHold-k9ynk78pgf677kpx.js +179 -0
- package/dist/chunks/{usePreviousValue-io5t1pdxehw21l85.js → usePreviousValue-o6swt5tb7xhpdu4e.js} +1 -1
- package/dist/chunks/{useRegisterFieldControl-lvusf6vc963clx02.js → useRegisterFieldControl-m1stc9l9y4cndf0k.js} +4 -4
- package/dist/chunks/{useRegisteredLabelId-hw6b87h1k7kow1o2.js → useRegisteredLabelId-b7u9ygya03448zzn.js} +3 -3
- package/dist/chunks/{useRender-onwjigxa00uch2ip.js → useRender-h9ktka9xt4obdv6y.js} +2 -2
- package/dist/chunks/{useRenderDialogRoot-lddunc01twftravv.js → useRenderDialogRoot-bsqrqpc1ddau7xg4.js} +57 -20
- package/dist/chunks/{useRenderElement-lrvp2pwrpt5zq1zd.js → useRenderElement-nkklxbq1rp7h2kw0.js} +17 -24
- package/dist/chunks/{useScrollLock-buonkbwuland9wl3.js → useScrollLock-le7ajwlt7oh6fzxi.js} +68 -72
- package/dist/chunks/useSetFieldFocused-fbvj7gcv67dqfkp0.js +35 -0
- package/dist/chunks/{useStableCallback-b1i1ghzd9k75bb85.js → useStableCallback-le5qgj6p9l04729n.js} +3 -3
- package/dist/chunks/{useSwipeDismiss-m1s13x9t9ey9ax3p.js → useSwipeDismiss-e8tfxzlp05p86mgb.js} +35 -54
- package/dist/chunks/{useTimeout-cpql3c8p250cr093.js → useTimeout-f0ayn2l2l9aop4l8.js} +3 -3
- package/dist/chunks/{useTransitionStatus-bwqaavnekreihom2.js → useTransitionStatus-disysoblzgk34w14.js} +9 -5
- package/dist/chunks/{useTriggerFocusGuards-lz7wt484xltizro4.js → useTriggerFocusGuards-dyd3hb1m8en8ct50.js} +12 -22
- package/dist/chunks/useTriggerSwitchTransition-hk5j36hd5dq2ok6w.js +62 -0
- package/dist/chunks/{useTypeahead-kvag4w6hu2g1kbwt.js → useTypeahead-kfdsw1ksl5bgvvzl.js} +16 -12
- package/dist/chunks/{useValueAsRef-o4s9ohb3aczypmnk.js → useValueAsRef-dv0tmfr1xlpzdlru.js} +3 -3
- package/dist/chunks/{useValueChanged-cz5wflhe8g15n6w1.js → useValueChanged-fjssa2v6d4w8y332.js} +3 -3
- package/dist/chunks/{utils-0i7gujfv3f3e9dqh.js → utils-o44zfmzz9z7uyj1v.js} +0 -1
- package/dist/chunks/{valueToPercent-d7gbqk1umostj7ch.js → valueToPercent-djk2mqnihth2uvf6.js} +1 -1
- package/dist/chunks/vendor-styling-gs32v7xt5znc8kg0.js +1167 -0
- package/dist/chunks/{vendor-utils-ecfbsk425x1bm0gh.js → vendor-utils-io8z5lsfxq8m2dcc.js} +88 -30
- package/dist/chunks/{visuallyHidden-nous086atnlxtf74.js → visuallyHidden-kzzs9hbe93is3rci.js} +2 -1
- package/dist/code.js +6 -11
- package/dist/components/autocomplete.d.ts +1 -1
- package/dist/components/autocomplete.js +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/banner.js +1 -1
- package/dist/components/breadcrumbs.js +1 -1
- package/dist/components/button-group.js +1 -1
- package/dist/components/button.js +1 -1
- package/dist/components/chart.d.ts +1 -1
- package/dist/components/chart.js +1 -1
- package/dist/components/checkbox.d.ts +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/clipboard-text.js +1 -1
- package/dist/components/cloudflare-logo.js +1 -1
- package/dist/components/code.js +1 -1
- package/dist/components/collapsible.js +1 -1
- package/dist/components/combobox.js +1 -1
- package/dist/components/command-palette.js +1 -1
- package/dist/components/date-picker.d.ts +1 -1
- package/dist/components/date-picker.js +1 -1
- package/dist/components/date-range-picker.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/dropdown.d.ts +1 -1
- package/dist/components/dropdown.js +1 -1
- package/dist/components/empty.js +1 -1
- package/dist/components/field.js +1 -1
- package/dist/components/flow.js +1 -1
- package/dist/components/grid.js +1 -1
- package/dist/components/inline-copy-text.js +1 -1
- package/dist/components/input-group.js +1 -1
- package/dist/components/input.js +3 -3
- package/dist/components/label.d.ts +1 -1
- package/dist/components/label.js +1 -1
- package/dist/components/layer-card.js +1 -1
- package/dist/components/layer-dialog.d.ts +2 -2
- package/dist/components/layer-dialog.js +1 -1
- package/dist/components/link.js +1 -1
- package/dist/components/loader.js +2 -2
- package/dist/components/menubar.js +1 -1
- package/dist/components/meter.js +1 -1
- package/dist/components/pagination.js +1 -1
- package/dist/components/popover.d.ts +1 -1
- package/dist/components/popover.js +1 -1
- package/dist/components/radio.d.ts +1 -1
- package/dist/components/radio.js +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/sensitive-input.js +1 -1
- package/dist/components/sidebar.d.ts +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/slider.d.ts +2 -0
- package/dist/components/slider.js +3 -0
- package/dist/components/surface.js +1 -1
- package/dist/components/switch.js +1 -1
- package/dist/components/table-of-contents.js +1 -1
- package/dist/components/table.d.ts +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/tabs.js +1 -1
- package/dist/components/tag-input.js +1 -1
- package/dist/components/text.js +1 -1
- package/dist/components/toast.js +2 -2
- package/dist/components/toolbar.js +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/{index-NqlNd7cQ.d.ts → index-5bJAnzUo.d.ts} +19 -7
- package/dist/{index-Cqrye3KD.d.ts → index-AUC5xRcO.d.ts} +64 -7
- package/dist/{index-C0d8uwYO.d.ts → index-BW1HVU7T.d.ts} +33 -5
- package/dist/index-BWe6haHU.d.ts +64 -0
- package/dist/{index-ChGFA5-n.d.ts → index-BvNXYn7u.d.ts} +4 -1
- package/dist/{index-D-y1ktn-.d.ts → index-CE09bLNb.d.ts} +5 -1
- package/dist/{index-bAud6rG2.d.ts → index-CU_lnxg7.d.ts} +13 -4
- package/dist/{index-Vj9ZzRh0.d.ts → index-DNsSKNUe.d.ts} +4 -1
- package/dist/{index-J1qdw9mL.d.ts → index-DjSGDESy.d.ts} +36 -2
- package/dist/{index-_Sl5wohy.d.ts → index-RP_rt8vB.d.ts} +1 -1
- package/dist/{index-Cp0aQngm.d.ts → index-T1sSoiWG.d.ts} +3 -1
- package/dist/{index-CtTNoYA2.d.ts → index-fsZE0vPs.d.ts} +12 -0
- package/dist/index.d.ts +14 -13
- package/dist/index.js +68 -63
- package/dist/{locale-provider-BLGya10h.d.ts → locale-provider-CAjVN3_0.d.ts} +6 -2
- package/dist/primitives/accordion.js +2 -2
- package/dist/primitives/alert-dialog.js +7 -2
- package/dist/primitives/autocomplete.js +5 -2
- package/dist/primitives/avatar.js +2 -2
- package/dist/primitives/button.js +2 -2
- package/dist/primitives/checkbox-group.js +3 -2
- package/dist/primitives/checkbox.js +3 -2
- package/dist/primitives/collapsible.js +4 -2
- package/dist/primitives/combobox.js +5 -2
- package/dist/primitives/context-menu.js +5 -2
- package/dist/primitives/csp-provider.js +1 -1
- package/dist/primitives/dialog.js +8 -2
- package/dist/primitives/direction-provider.js +2 -2
- package/dist/primitives/drawer.js +5 -2
- package/dist/primitives/field.js +3 -2
- package/dist/primitives/fieldset.js +2 -2
- package/dist/primitives/form.js +1 -1
- package/dist/primitives/input.js +3 -2
- package/dist/primitives/menu.js +5 -2
- package/dist/primitives/menubar.js +2 -2
- package/dist/primitives/meter.js +1 -1
- package/dist/primitives/navigation-menu.js +2 -2
- package/dist/primitives/number-field.js +2 -2
- package/dist/primitives/otp-field.js +3 -2
- package/dist/primitives/popover.js +2 -2
- package/dist/primitives/preview-card.js +2 -2
- package/dist/primitives/progress.js +2 -2
- package/dist/primitives/radio-group.js +3 -2
- package/dist/primitives/radio.js +3 -2
- package/dist/primitives/scroll-area.js +3 -2
- package/dist/primitives/select.js +4 -2
- package/dist/primitives/separator.js +3 -2
- package/dist/primitives/slider.js +3 -2
- package/dist/primitives/switch.js +3 -2
- package/dist/primitives/tabs.js +3 -2
- package/dist/primitives/toast.js +4 -2
- package/dist/primitives/toggle-group.js +2 -2
- package/dist/primitives/toggle.js +2 -2
- package/dist/primitives/toolbar.js +2 -2
- package/dist/primitives/tooltip.js +3 -2
- package/dist/primitives.d.ts +1 -1
- package/dist/primitives.js +70 -42
- package/dist/styles/kumo-standalone.css +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +3 -3
- package/package.json +7 -3
- package/scripts/component-registry/discovery.ts +1 -0
- package/scripts/component-registry/metadata.ts +38 -0
- package/dist/chunks/DialogViewport-e1tqfisqexc7o9z8.js +0 -42
- package/dist/chunks/MenuBackdrop-ouznwyglg27bosoj.js +0 -73
- package/dist/chunks/index.parts-bq90erougcgrwlgk.js +0 -242
- package/dist/chunks/index.parts-cdxa6fwtp3lpkpp4.js +0 -11
- package/dist/chunks/index.parts-cl2xux9bjec6cibd.js +0 -44
- package/dist/chunks/index.parts-e9s1lqq3qa9l6ndm.js +0 -10
- package/dist/chunks/index.parts-eks3uafpskcxle6j.js +0 -99
- package/dist/chunks/index.parts-fbip2x29k5okvypg.js +0 -64
- package/dist/chunks/index.parts-fhza3s183grld7zq.js +0 -102
- package/dist/chunks/index.parts-hmx3qlh517ii56yi.js +0 -116
- package/dist/chunks/index.parts-i6gbeimeit8gzhvi.js +0 -10
- package/dist/chunks/index.parts-ioii4acz2bjrf6sb.js +0 -77
- package/dist/chunks/index.parts-jjup1zgnozoxi7ky.js +0 -140
- package/dist/chunks/index.parts-jpm6c0fe0gyky12m.js +0 -95
- package/dist/chunks/index.parts-moguar0t0u4aumou.js +0 -31
- package/dist/chunks/index.parts-mw0e646n3qp6v1qe.js +0 -73
- package/dist/chunks/index.parts-olcmo45gi8e1qma1.js +0 -10
- package/dist/chunks/popupStoreUtils-i0y57dvmcnqrh4pv.js +0 -444
- package/dist/chunks/radio-35dx7y6rjrezbjsp.js +0 -173
- package/dist/chunks/resolveValueLabel-hpmsash3ektitvnb.js +0 -123
- package/dist/chunks/useDismiss-me91ertzzz3gly12.js +0 -384
- package/dist/chunks/useFilteredItems-kw2za6m9bng7twr0.js +0 -181
- package/dist/chunks/useForcedRerendering-i3n4ms0xose8borh.js +0 -14
- package/dist/chunks/useId-f8w657f9yys10abm.js +0 -32
- package/dist/chunks/vendor-styling-da1xibnxfkjmtglr.js +0 -3631
|
@@ -1,41 +1,43 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
5
|
-
import { n as
|
|
6
|
-
import {
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-hi7ti5xiuxsegr96.js";
|
|
3
|
+
import { c as NOOP, f as useMergedRefs, i as mergeProps, l as warn, n as useRenderElement, o as EMPTY_ARRAY, p as useRefWithInit, s as EMPTY_OBJECT, t as unwrapLazyRenderProp } from "./useRenderElement-nkklxbq1rp7h2kw0.js";
|
|
4
|
+
import { a as FloatingPortal, f as DROPDOWN_COLLISION_AVOIDANCE, i as PopupTriggerMap, m as POPUP_COLLISION_AVOIDANCE, n as ReactStore, v as voiceOver, y as fastComponent } from "./FloatingRootStore-men6ufp3a2b296fh.js";
|
|
5
|
+
import { n as useIsoLayoutEffect, t as SafeReact } from "./safeReact-ek77ilng4ekk7mgz.js";
|
|
6
|
+
import { n as useTimeout } from "./useTimeout-f0ayn2l2l9aop4l8.js";
|
|
7
|
+
import { $ as getTarget, A as popupTransitionStateMapping, H as transitionStatusMapping, M as triggerOpenStateMapping, ut as mac } from "./vendor-utils-io8z5lsfxq8m2dcc.js";
|
|
8
|
+
import { n as webkit } from "./engine-hzmefiqm63hu0c7i.js";
|
|
7
9
|
import { C as getParentNode, D as isLastTraversableNode, E as isHTMLElement } from "./vendor-floating-ui-fqblx3wa0r71mjoo.js";
|
|
8
|
-
import { n as useHoverReferenceInteraction, r as useHoverFloatingInteraction, t as safePolygon } from "./safePolygon-
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { t as useStableCallback } from "./useStableCallback-
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { t as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { t as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import { t as
|
|
23
|
-
import {
|
|
24
|
-
import { t as
|
|
25
|
-
import {
|
|
26
|
-
import { t as
|
|
27
|
-
import { t as
|
|
28
|
-
import {
|
|
29
|
-
import { t as
|
|
30
|
-
import { t as
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import { n as useMenubarContext } from "./MenubarContext-
|
|
10
|
+
import { n as useHoverReferenceInteraction, r as useHoverFloatingInteraction, t as safePolygon } from "./safePolygon-ep4133qogeu5vjf3.js";
|
|
11
|
+
import { n as createGenericEventDetails, t as createChangeEventDetails } from "./createBaseUIEventDetails-nvee6bghv2reeqdb.js";
|
|
12
|
+
import { E as pointer, b as keyboard, d as imperativeAction, k as siblingOpen, u as focusOut, w as none, y as itemPress } from "./reason-parts-hssx64rmlxyn6gw5.js";
|
|
13
|
+
import { t as useStableCallback } from "./useStableCallback-le5qgj6p9l04729n.js";
|
|
14
|
+
import { c as useOpenStateTransitions, g as useDismiss, h as useSyncedFloatingRootContext, i as attachPreventUnmountOnClose, l as usePopupInteractionProps, n as PopupHandleAttachment, o as createPopupOpenState, p as useTriggerRegistration, s as useImplicitActiveTrigger, t as FOCUSABLE_POPUP_PROPS } from "./popupStoreUtils-czfnxn051xakask5.js";
|
|
15
|
+
import { n as InternalBackdrop, o as FloatingFocusManager, r as useOpenInteractionType } from "./useScrollLock-le7ajwlt7oh6fzxi.js";
|
|
16
|
+
import { i as useFloatingParentNodeId, n as FloatingTree, o as FloatingTreeStore, r as useFloatingNodeId, t as FloatingNode } from "./FloatingTree-kiyzavvaum442o1s.js";
|
|
17
|
+
import { n as useAnimationsFinished, t as useOpenChangeComplete } from "./useOpenChangeComplete-edtabjwqmechsyv6.js";
|
|
18
|
+
import { t as useClick } from "./useClick-pcbkcc7r620v1smu.js";
|
|
19
|
+
import { t as useTransitionStatus } from "./useTransitionStatus-disysoblzgk34w14.js";
|
|
20
|
+
import { n as createInitialPopupStoreState, r as popupStoreSelectors, t as NullStore } from "./NullStore-my62xo2vfcfkerri.js";
|
|
21
|
+
import { a as useListNavigation } from "./useListNavigation-hpddbd0cc9pvt461.js";
|
|
22
|
+
import { t as useTypeahead } from "./useTypeahead-kfdsw1ksl5bgvvzl.js";
|
|
23
|
+
import { t as useBaseUiId } from "./useBaseUiId-nk4k7nj9h1cy76ny.js";
|
|
24
|
+
import { n as getDisabledMountTransitionStyles, r as useAnchorPositioning, t as usePositioner } from "./usePositioner-mzvgnazldqvy44z2.js";
|
|
25
|
+
import { n as useDirection } from "./DirectionContext-kpby968j030psajn.js";
|
|
26
|
+
import { t as inertValue } from "./inertValue-n09gkjvwwa1kddov.js";
|
|
27
|
+
import { t as useControlled } from "./useControlled-i3srnkxy598s0au9.js";
|
|
28
|
+
import { r as dispatchClickWithModifiers, t as useButton } from "./useButton-lklvdzuhvj22bx07.js";
|
|
29
|
+
import { t as getHighlightReason } from "./getHighlightReason-fhc53kq6qakcct9s.js";
|
|
30
|
+
import { t as CompositeList } from "./CompositeList-gwuaf6d14s4da0j0.js";
|
|
31
|
+
import { t as useAnchoredPopupScrollLock } from "./useAnchoredPopupScrollLock-msm8tzkewysnunut.js";
|
|
32
|
+
import { t as useCompositeListItem } from "./useCompositeListItem-ekwo2j2rjkggg7xj.js";
|
|
33
|
+
import { n as useToolbarRootContext } from "./ToolbarRootContext-difqbj720teyt8lu.js";
|
|
34
|
+
import { t as isElementDisabled } from "./isElementDisabled-dyqutxpzdfppbohx.js";
|
|
35
|
+
import { a as COMPOSITE_KEYS } from "./composite-c11t1ok72s3cggjc.js";
|
|
36
|
+
import { t as useTriggerSwitchTransition } from "./useTriggerSwitchTransition-hk5j36hd5dq2ok6w.js";
|
|
37
|
+
import { n as useMenubarContext } from "./MenubarContext-ooz0h08i55c8oip5.js";
|
|
36
38
|
import * as React$1 from "react";
|
|
37
39
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
38
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
40
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/menu/positioner/MenuPositionerContext.mjs
|
|
39
41
|
const MenuPositionerContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
40
42
|
MenuPositionerContext.displayName = "MenuPositionerContext";
|
|
41
43
|
function useMenuPositionerContext(optional) {
|
|
@@ -44,7 +46,7 @@ function useMenuPositionerContext(optional) {
|
|
|
44
46
|
return context;
|
|
45
47
|
}
|
|
46
48
|
//#endregion
|
|
47
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
49
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/menu/root/MenuRootContext.mjs
|
|
48
50
|
const MenuRootContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
49
51
|
MenuRootContext.displayName = "MenuRootContext";
|
|
50
52
|
function useMenuRootContext(optional) {
|
|
@@ -53,7 +55,7 @@ function useMenuRootContext(optional) {
|
|
|
53
55
|
return context;
|
|
54
56
|
}
|
|
55
57
|
//#endregion
|
|
56
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
58
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/context-menu/root/ContextMenuRootContext.mjs
|
|
57
59
|
const ContextMenuRootContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
58
60
|
ContextMenuRootContext.displayName = "ContextMenuRootContext";
|
|
59
61
|
function useContextMenuRootContext(optional = true) {
|
|
@@ -62,7 +64,60 @@ function useContextMenuRootContext(optional = true) {
|
|
|
62
64
|
return context;
|
|
63
65
|
}
|
|
64
66
|
//#endregion
|
|
65
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
67
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/menu/filter-root/MenuFilterContext.mjs
|
|
68
|
+
/**
|
|
69
|
+
* The filter implementation that a filterable root hands to the parts below it. Only the roots
|
|
70
|
+
* `Menu.FilterProvider` renders import it, so a plain menu never bundles it. Parts whose whole
|
|
71
|
+
* structure differs are swapped as components; parts that only register with the filter call an
|
|
72
|
+
* injected hook, so a menu that never renders them doesn't bundle a second implementation.
|
|
73
|
+
*/
|
|
74
|
+
/** Static below a filter root: the implementation never changes, so subscribers never re-render. */
|
|
75
|
+
const MenuFilterImplContext = /*#__PURE__*/ React$1.createContext(null);
|
|
76
|
+
MenuFilterImplContext.displayName = "MenuFilterImplContext";
|
|
77
|
+
/**
|
|
78
|
+
* The filter implementation when the menu this part belongs to is filterable, otherwise `null`.
|
|
79
|
+
* `virtualFocus` marks a filter root; a plain `Menu.Root` never sets it. The result is fixed for
|
|
80
|
+
* a mounted part: a filter root can't appear above it without remounting it.
|
|
81
|
+
*/
|
|
82
|
+
function useMenuFilterImpl(scope = "root") {
|
|
83
|
+
const impl = React$1.useContext(MenuFilterImplContext);
|
|
84
|
+
const root = React$1.useContext(MenuRootContext);
|
|
85
|
+
if (impl === null || root === void 0) return null;
|
|
86
|
+
return (scope === "submenu-trigger" ? root.virtualFocus || root.parentVirtualFocus : root.virtualFocus) ? impl : null;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Throws unless the menu this part renders in is filterable, naming the part and the provider.
|
|
90
|
+
*/
|
|
91
|
+
function useMenuFilterPart(part) {
|
|
92
|
+
if (useMenuFilterImpl() === null) throw new Error(`Base UI: <Menu.${part}> must be placed in a menu wrapped in <Menu.FilterProvider>. It reads the filter query and the matching items from the provider, which a plain menu does not have. Wrap the <Menu.Root> or <Menu.SubmenuRoot> it belongs to in <Menu.FilterProvider>. See https://base-ui.com/react/components/menu#filtering`);
|
|
93
|
+
}
|
|
94
|
+
const UNFILTERED = {
|
|
95
|
+
visible: true,
|
|
96
|
+
ref: null
|
|
97
|
+
};
|
|
98
|
+
function useUnfilteredItem() {
|
|
99
|
+
return UNFILTERED;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Registers an item part with the filter of the menu it belongs to. A plain menu's items are
|
|
103
|
+
* always visible.
|
|
104
|
+
*/
|
|
105
|
+
function useMenuFilterItem(props, forwardedRef, scope = "root") {
|
|
106
|
+
const impl = useMenuFilterImpl(scope);
|
|
107
|
+
const item = ((scope === "submenu-trigger" ? impl?.useSubmenuTrigger : impl?.useItem) ?? useUnfilteredItem)({
|
|
108
|
+
label: props.label,
|
|
109
|
+
children: props.children,
|
|
110
|
+
render: props.render
|
|
111
|
+
});
|
|
112
|
+
const ref = useMergedRefs(forwardedRef, item.ref);
|
|
113
|
+
return {
|
|
114
|
+
visible: item.visible,
|
|
115
|
+
ref,
|
|
116
|
+
props: item.props
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
//#endregion
|
|
120
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/menu/checkbox-item/MenuCheckboxItemContext.mjs
|
|
66
121
|
const MenuCheckboxItemContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
67
122
|
MenuCheckboxItemContext.displayName = "MenuCheckboxItemContext";
|
|
68
123
|
function useMenuCheckboxItemContext() {
|
|
@@ -71,22 +126,31 @@ function useMenuCheckboxItemContext() {
|
|
|
71
126
|
return context;
|
|
72
127
|
}
|
|
73
128
|
//#endregion
|
|
74
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
129
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/menu/item/useMenuItemCommonProps.mjs
|
|
130
|
+
function preventMouseDownDefault(event) {
|
|
131
|
+
event.preventDefault();
|
|
132
|
+
}
|
|
75
133
|
/**
|
|
76
134
|
* Returns common props shared by all menu item types.
|
|
77
|
-
* This hook extracts the shared logic for id, role, tabIndex,
|
|
78
|
-
* onMouseMove, onClick, and onMouseUp handlers.
|
|
135
|
+
* This hook extracts the shared logic for id, role, tabIndex, and interaction handlers.
|
|
79
136
|
*/
|
|
80
137
|
function useMenuItemCommonProps(params) {
|
|
81
138
|
const { closeOnClick, highlighted, id, nodeId, store, typingRef, itemRef, itemMetadata } = params;
|
|
139
|
+
const rootContext = useMenuRootContext();
|
|
140
|
+
const contextMenuContext = useContextMenuRootContext(true);
|
|
141
|
+
const isSubmenuTrigger = itemMetadata.type === "submenu-trigger";
|
|
142
|
+
const virtualFocus = isSubmenuTrigger ? rootContext.parentVirtualFocus : rootContext.virtualFocus;
|
|
143
|
+
const ariaSelected = (isSubmenuTrigger && rootContext.parent.type === "menu" ? rootContext.parent.store : rootContext.store).useState("webkitAriaSelected", highlighted);
|
|
82
144
|
const { events: menuEvents } = store.useState("floatingTreeRoot");
|
|
83
145
|
const open = store.useState("open");
|
|
84
|
-
const contextMenuContext = useContextMenuRootContext(true);
|
|
85
146
|
const isContextMenu = contextMenuContext !== void 0;
|
|
147
|
+
const tabIndex = !virtualFocus && open && highlighted ? 0 : -1;
|
|
86
148
|
return React$1.useMemo(() => ({
|
|
87
149
|
id,
|
|
88
150
|
role: "menuitem",
|
|
89
|
-
tabIndex
|
|
151
|
+
tabIndex,
|
|
152
|
+
"aria-selected": ariaSelected,
|
|
153
|
+
onMouseDown: virtualFocus ? preventMouseDownDefault : void 0,
|
|
90
154
|
onKeyDown(event) {
|
|
91
155
|
if (event.key === " " && typingRef?.current) event.preventDefault();
|
|
92
156
|
},
|
|
@@ -99,7 +163,7 @@ function useMenuItemCommonProps(params) {
|
|
|
99
163
|
},
|
|
100
164
|
onClick(event) {
|
|
101
165
|
if (closeOnClick) menuEvents.emit("close", {
|
|
102
|
-
domEvent: event,
|
|
166
|
+
domEvent: event.nativeEvent,
|
|
103
167
|
reason: itemPress
|
|
104
168
|
});
|
|
105
169
|
},
|
|
@@ -111,26 +175,30 @@ function useMenuItemCommonProps(params) {
|
|
|
111
175
|
if (isContextMenu && !mac && event.button === 2) return;
|
|
112
176
|
}
|
|
113
177
|
if (itemRef.current && store.context.allowMouseUpTriggerRef.current && (!isContextMenu || event.button === 2)) {
|
|
114
|
-
if (itemMetadata.type === "regular-item") dispatchClickWithModifiers(itemRef.current, event, {
|
|
178
|
+
if (itemMetadata.type === "regular-item") dispatchClickWithModifiers(itemRef.current, event, {
|
|
179
|
+
detail: 1,
|
|
180
|
+
pointerType: "mouse"
|
|
181
|
+
});
|
|
115
182
|
}
|
|
116
183
|
}
|
|
117
184
|
}), [
|
|
118
185
|
closeOnClick,
|
|
119
|
-
|
|
186
|
+
tabIndex,
|
|
120
187
|
id,
|
|
121
188
|
menuEvents,
|
|
122
189
|
nodeId,
|
|
123
|
-
|
|
124
|
-
store,
|
|
190
|
+
store.context.allowMouseUpTriggerRef,
|
|
125
191
|
typingRef,
|
|
126
192
|
itemRef,
|
|
127
193
|
contextMenuContext,
|
|
128
194
|
isContextMenu,
|
|
129
|
-
itemMetadata
|
|
195
|
+
itemMetadata.type,
|
|
196
|
+
ariaSelected,
|
|
197
|
+
virtualFocus
|
|
130
198
|
]);
|
|
131
199
|
}
|
|
132
200
|
//#endregion
|
|
133
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
201
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/menu/item/useMenuItem.mjs
|
|
134
202
|
const REGULAR_ITEM = { type: "regular-item" };
|
|
135
203
|
function useMenuItem(params) {
|
|
136
204
|
const { closeOnClick, disabled, highlighted, id, store, typingRef = store.context.typingRef, nativeButton, itemMetadata, nodeId } = params;
|
|
@@ -152,9 +220,9 @@ function useMenuItem(params) {
|
|
|
152
220
|
itemMetadata
|
|
153
221
|
});
|
|
154
222
|
const getItemProps = React$1.useCallback((externalProps) => {
|
|
155
|
-
return mergeProps(commonProps, { onMouseEnter() {
|
|
223
|
+
return mergeProps(commonProps, { onMouseEnter(event) {
|
|
156
224
|
if (itemMetadata.type !== "submenu-trigger") return;
|
|
157
|
-
itemMetadata.setActive();
|
|
225
|
+
itemMetadata.setActive(event.nativeEvent);
|
|
158
226
|
} }, externalProps, getButtonProps);
|
|
159
227
|
}, [
|
|
160
228
|
commonProps,
|
|
@@ -168,7 +236,13 @@ function useMenuItem(params) {
|
|
|
168
236
|
}), [getItemProps, mergedRef]);
|
|
169
237
|
}
|
|
170
238
|
//#endregion
|
|
171
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
239
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/menu/checkbox-item/MenuCheckboxItemDataAttributes.mjs
|
|
240
|
+
var MenuCheckboxItemDataAttributes_exports = /* @__PURE__ */ __exportAll({
|
|
241
|
+
checked: () => checked,
|
|
242
|
+
disabled: () => disabled,
|
|
243
|
+
highlighted: () => highlighted,
|
|
244
|
+
unchecked: () => unchecked
|
|
245
|
+
});
|
|
172
246
|
/**
|
|
173
247
|
* Present when the menu checkbox item is checked.
|
|
174
248
|
*/
|
|
@@ -177,8 +251,16 @@ const checked = "data-checked";
|
|
|
177
251
|
* Present when the menu checkbox item is not checked.
|
|
178
252
|
*/
|
|
179
253
|
const unchecked = "data-unchecked";
|
|
254
|
+
/**
|
|
255
|
+
* Present when the menu checkbox item is disabled.
|
|
256
|
+
*/
|
|
257
|
+
const disabled = "data-disabled";
|
|
258
|
+
/**
|
|
259
|
+
* Present when the menu checkbox item is highlighted.
|
|
260
|
+
*/
|
|
261
|
+
const highlighted = "data-highlighted";
|
|
180
262
|
//#endregion
|
|
181
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
263
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/menu/utils/stateAttributesMapping.mjs
|
|
182
264
|
const itemMapping = {
|
|
183
265
|
checked(value) {
|
|
184
266
|
if (value) return { [checked]: "" };
|
|
@@ -187,32 +269,20 @@ const itemMapping = {
|
|
|
187
269
|
...transitionStatusMapping
|
|
188
270
|
};
|
|
189
271
|
//#endregion
|
|
190
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
*
|
|
195
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
196
|
-
*/
|
|
197
|
-
const MenuCheckboxItem = /*#__PURE__*/ React$1.forwardRef(function MenuCheckboxItem(componentProps, forwardedRef) {
|
|
198
|
-
const { render, className, id: idProp, label, nativeButton = false, disabled: disabledProp = false, closeOnClick = false, checked: checkedProp, defaultChecked, onCheckedChange, style, ...elementProps } = componentProps;
|
|
272
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/menu/checkbox-item/MenuCheckboxItem.mjs
|
|
273
|
+
const MenuCheckboxItemPlain = /*#__PURE__*/ React$1.forwardRef(function MenuCheckboxItemPlain(componentProps, forwardedRef) {
|
|
274
|
+
const { render, className, id: idProp, label, nativeButton = false, disabled: disabledProp = false, closeOnClick = false, checked = false, onCheckedChange, style, ...elementProps } = componentProps;
|
|
275
|
+
const { store } = useMenuRootContext();
|
|
199
276
|
const listItem = useCompositeListItem({
|
|
200
277
|
guess: true,
|
|
201
278
|
label
|
|
202
279
|
});
|
|
203
|
-
const menuPositionerContext = useMenuPositionerContext(true);
|
|
204
280
|
const id = useBaseUiId(idProp);
|
|
205
|
-
const { store } = useMenuRootContext();
|
|
206
281
|
const rootDisabled = store.useState("disabled");
|
|
207
|
-
const disabled = disabledProp || rootDisabled;
|
|
208
282
|
const highlighted = store.useState("isActive", listItem.index);
|
|
283
|
+
const nodeId = store.useState("floatingNodeId");
|
|
209
284
|
const itemProps = store.useState("itemProps");
|
|
210
|
-
const
|
|
211
|
-
controlled: checkedProp,
|
|
212
|
-
default: defaultChecked ?? false,
|
|
213
|
-
name: "MenuCheckboxItem",
|
|
214
|
-
state: "checked"
|
|
215
|
-
});
|
|
285
|
+
const disabled = disabledProp || rootDisabled;
|
|
216
286
|
const { getItemProps, itemRef } = useMenuItem({
|
|
217
287
|
closeOnClick,
|
|
218
288
|
disabled,
|
|
@@ -220,7 +290,7 @@ const MenuCheckboxItem = /*#__PURE__*/ React$1.forwardRef(function MenuCheckboxI
|
|
|
220
290
|
id,
|
|
221
291
|
store,
|
|
222
292
|
nativeButton,
|
|
223
|
-
nodeId
|
|
293
|
+
nodeId,
|
|
224
294
|
itemMetadata: REGULAR_ITEM
|
|
225
295
|
});
|
|
226
296
|
const state = React$1.useMemo(() => ({
|
|
@@ -235,8 +305,6 @@ const MenuCheckboxItem = /*#__PURE__*/ React$1.forwardRef(function MenuCheckboxI
|
|
|
235
305
|
function handleClick(event) {
|
|
236
306
|
const details = createChangeEventDetails(itemPress, event.nativeEvent, void 0, { preventUnmountOnClose: NOOP });
|
|
237
307
|
onCheckedChange?.(!checked, details);
|
|
238
|
-
if (details.isCanceled) return;
|
|
239
|
-
setChecked((currentlyChecked) => !currentlyChecked);
|
|
240
308
|
}
|
|
241
309
|
const element = useRenderElement("div", componentProps, {
|
|
242
310
|
state,
|
|
@@ -262,9 +330,31 @@ const MenuCheckboxItem = /*#__PURE__*/ React$1.forwardRef(function MenuCheckboxI
|
|
|
262
330
|
children: element
|
|
263
331
|
});
|
|
264
332
|
});
|
|
333
|
+
MenuCheckboxItemPlain.displayName = "MenuCheckboxItemPlain";
|
|
334
|
+
const MenuCheckboxItem = /*#__PURE__*/ React$1.forwardRef(function MenuCheckboxItem(props, forwardedRef) {
|
|
335
|
+
const { checked: checkedProp, defaultChecked, onCheckedChange, ...plainProps } = props;
|
|
336
|
+
const [checked, setChecked] = useControlled({
|
|
337
|
+
controlled: checkedProp,
|
|
338
|
+
default: defaultChecked ?? false,
|
|
339
|
+
name: "MenuCheckboxItem",
|
|
340
|
+
state: "checked"
|
|
341
|
+
});
|
|
342
|
+
const filterItem = useMenuFilterItem(props, forwardedRef);
|
|
343
|
+
function handleCheckedChange(nextChecked, eventDetails) {
|
|
344
|
+
onCheckedChange?.(nextChecked, eventDetails);
|
|
345
|
+
if (!eventDetails.isCanceled) setChecked(nextChecked);
|
|
346
|
+
}
|
|
347
|
+
if (!filterItem.visible) return null;
|
|
348
|
+
return /*#__PURE__*/ jsx(MenuCheckboxItemPlain, {
|
|
349
|
+
...plainProps,
|
|
350
|
+
checked,
|
|
351
|
+
onCheckedChange: handleCheckedChange,
|
|
352
|
+
ref: filterItem.ref
|
|
353
|
+
});
|
|
354
|
+
});
|
|
265
355
|
MenuCheckboxItem.displayName = "MenuCheckboxItem";
|
|
266
356
|
//#endregion
|
|
267
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
357
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.mjs
|
|
268
358
|
/**
|
|
269
359
|
* Indicates whether the checkbox item is ticked.
|
|
270
360
|
* Renders a `<span>` element.
|
|
@@ -304,7 +394,7 @@ const MenuCheckboxItemIndicator = /*#__PURE__*/ React$1.forwardRef(function Menu
|
|
|
304
394
|
});
|
|
305
395
|
MenuCheckboxItemIndicator.displayName = "MenuCheckboxItemIndicator";
|
|
306
396
|
//#endregion
|
|
307
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
397
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/menu/group/MenuGroupContext.mjs
|
|
308
398
|
const MenuGroupContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
309
399
|
MenuGroupContext.displayName = "MenuGroupContext";
|
|
310
400
|
function useMenuGroupRootContext() {
|
|
@@ -313,14 +403,11 @@ function useMenuGroupRootContext() {
|
|
|
313
403
|
return context;
|
|
314
404
|
}
|
|
315
405
|
//#endregion
|
|
316
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
406
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/menu/group/MenuGroup.mjs
|
|
317
407
|
/**
|
|
318
|
-
*
|
|
319
|
-
* Renders a `<div>` element.
|
|
320
|
-
*
|
|
321
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
408
|
+
* @internal
|
|
322
409
|
*/
|
|
323
|
-
const
|
|
410
|
+
const MenuGroupPlain = /*#__PURE__*/ React$1.forwardRef(function MenuGroupPlain(componentProps, forwardedRef) {
|
|
324
411
|
const { render, className, style, ...elementProps } = componentProps;
|
|
325
412
|
const [labelId, setLabelId] = React$1.useState(void 0);
|
|
326
413
|
const element = useRenderElement("div", componentProps, {
|
|
@@ -336,9 +423,17 @@ const MenuGroup = /*#__PURE__*/ React$1.forwardRef(function MenuGroup(componentP
|
|
|
336
423
|
children: element
|
|
337
424
|
});
|
|
338
425
|
});
|
|
426
|
+
MenuGroupPlain.displayName = "MenuGroupPlain";
|
|
427
|
+
const MenuGroup = /*#__PURE__*/ React$1.forwardRef(function MenuGroup(props, forwardedRef) {
|
|
428
|
+
const Group = useMenuFilterImpl()?.Group ?? MenuGroupPlain;
|
|
429
|
+
return /*#__PURE__*/ jsx(Group, {
|
|
430
|
+
...props,
|
|
431
|
+
ref: forwardedRef
|
|
432
|
+
});
|
|
433
|
+
});
|
|
339
434
|
MenuGroup.displayName = "MenuGroup";
|
|
340
435
|
//#endregion
|
|
341
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
436
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/menu/group-label/MenuGroupLabel.mjs
|
|
342
437
|
/**
|
|
343
438
|
* An accessible label that is automatically associated with its parent group.
|
|
344
439
|
* Renders a `<div>` element.
|
|
@@ -366,26 +461,20 @@ const MenuGroupLabel = /*#__PURE__*/ React$1.forwardRef(function MenuGroupLabel(
|
|
|
366
461
|
});
|
|
367
462
|
MenuGroupLabel.displayName = "MenuGroupLabel";
|
|
368
463
|
//#endregion
|
|
369
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
370
|
-
|
|
371
|
-
* An individual interactive item in the menu.
|
|
372
|
-
* Renders a `<div>` element.
|
|
373
|
-
*
|
|
374
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
375
|
-
*/
|
|
376
|
-
const MenuItem = /*#__PURE__*/ React$1.forwardRef(function MenuItem(componentProps, forwardedRef) {
|
|
464
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/menu/item/MenuItem.mjs
|
|
465
|
+
const MenuItemPlain = /*#__PURE__*/ React$1.forwardRef(function MenuItemPlain(componentProps, forwardedRef) {
|
|
377
466
|
const { render, className, id: idProp, label, nativeButton = false, disabled: disabledProp = false, closeOnClick = true, style, ...elementProps } = componentProps;
|
|
467
|
+
const { store } = useMenuRootContext();
|
|
378
468
|
const listItem = useCompositeListItem({
|
|
379
469
|
guess: true,
|
|
380
470
|
label
|
|
381
471
|
});
|
|
382
|
-
const menuPositionerContext = useMenuPositionerContext(true);
|
|
383
472
|
const id = useBaseUiId(idProp);
|
|
384
|
-
const { store } = useMenuRootContext();
|
|
385
473
|
const rootDisabled = store.useState("disabled");
|
|
386
|
-
const disabled = disabledProp || rootDisabled;
|
|
387
474
|
const highlighted = store.useState("isActive", listItem.index);
|
|
475
|
+
const nodeId = store.useState("floatingNodeId");
|
|
388
476
|
const itemProps = store.useState("itemProps");
|
|
477
|
+
const disabled = disabledProp || rootDisabled;
|
|
389
478
|
const { getItemProps, itemRef } = useMenuItem({
|
|
390
479
|
closeOnClick,
|
|
391
480
|
disabled,
|
|
@@ -393,7 +482,7 @@ const MenuItem = /*#__PURE__*/ React$1.forwardRef(function MenuItem(componentPro
|
|
|
393
482
|
id,
|
|
394
483
|
store,
|
|
395
484
|
nativeButton,
|
|
396
|
-
nodeId
|
|
485
|
+
nodeId,
|
|
397
486
|
itemMetadata: REGULAR_ITEM
|
|
398
487
|
});
|
|
399
488
|
return useRenderElement("div", componentProps, {
|
|
@@ -413,26 +502,29 @@ const MenuItem = /*#__PURE__*/ React$1.forwardRef(function MenuItem(componentPro
|
|
|
413
502
|
]
|
|
414
503
|
});
|
|
415
504
|
});
|
|
505
|
+
MenuItemPlain.displayName = "MenuItemPlain";
|
|
506
|
+
const MenuItem = /*#__PURE__*/ React$1.forwardRef(function MenuItem(props, forwardedRef) {
|
|
507
|
+
const filterItem = useMenuFilterItem(props, forwardedRef);
|
|
508
|
+
if (!filterItem.visible) return null;
|
|
509
|
+
return /*#__PURE__*/ jsx(MenuItemPlain, {
|
|
510
|
+
...props,
|
|
511
|
+
ref: filterItem.ref
|
|
512
|
+
});
|
|
513
|
+
});
|
|
416
514
|
MenuItem.displayName = "MenuItem";
|
|
417
515
|
//#endregion
|
|
418
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
419
|
-
|
|
420
|
-
* A link in the menu that can be used to navigate to a different page or section.
|
|
421
|
-
* Renders an `<a>` element.
|
|
422
|
-
*
|
|
423
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
424
|
-
*/
|
|
425
|
-
const MenuLinkItem = /*#__PURE__*/ React$1.forwardRef(function MenuLinkItem(componentProps, forwardedRef) {
|
|
516
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/menu/link-item/MenuLinkItem.mjs
|
|
517
|
+
const MenuLinkItemPlain = /*#__PURE__*/ React$1.forwardRef(function MenuLinkItemPlain(componentProps, forwardedRef) {
|
|
426
518
|
const { render, className, id: idProp, label, closeOnClick = false, style, ...elementProps } = componentProps;
|
|
519
|
+
const { store } = useMenuRootContext();
|
|
427
520
|
const linkRef = React$1.useRef(null);
|
|
428
521
|
const listItem = useCompositeListItem({
|
|
429
522
|
guess: true,
|
|
430
523
|
label
|
|
431
524
|
});
|
|
432
|
-
const nodeId = useMenuPositionerContext(true)?.context.nodeId;
|
|
433
525
|
const id = useBaseUiId(idProp);
|
|
434
|
-
const { store } = useMenuRootContext();
|
|
435
526
|
const highlighted = store.useState("isActive", listItem.index);
|
|
527
|
+
const nodeId = store.useState("floatingNodeId");
|
|
436
528
|
const itemProps = store.useState("itemProps");
|
|
437
529
|
const typingRef = store.context.typingRef;
|
|
438
530
|
const { getButtonProps, buttonRef } = useButton({
|
|
@@ -467,18 +559,73 @@ const MenuLinkItem = /*#__PURE__*/ React$1.forwardRef(function MenuLinkItem(comp
|
|
|
467
559
|
]
|
|
468
560
|
});
|
|
469
561
|
});
|
|
562
|
+
MenuLinkItemPlain.displayName = "MenuLinkItemPlain";
|
|
563
|
+
const MenuLinkItem = /*#__PURE__*/ React$1.forwardRef(function MenuLinkItem(props, forwardedRef) {
|
|
564
|
+
const filterItem = useMenuFilterItem(props, forwardedRef);
|
|
565
|
+
if (!filterItem.visible) return null;
|
|
566
|
+
return /*#__PURE__*/ jsx(MenuLinkItemPlain, {
|
|
567
|
+
...props,
|
|
568
|
+
ref: filterItem.ref
|
|
569
|
+
});
|
|
570
|
+
});
|
|
470
571
|
MenuLinkItem.displayName = "MenuLinkItem";
|
|
471
572
|
//#endregion
|
|
472
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
573
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/menu/submenu-root/MenuSubmenuRootContext.mjs
|
|
574
|
+
const MenuSubmenuRootContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
575
|
+
MenuSubmenuRootContext.displayName = "MenuSubmenuRootContext";
|
|
576
|
+
function useMenuSubmenuRootContext() {
|
|
577
|
+
return React$1.useContext(MenuSubmenuRootContext);
|
|
578
|
+
}
|
|
579
|
+
//#endregion
|
|
580
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/internals/resolveRenderedId.mjs
|
|
473
581
|
/**
|
|
474
|
-
*
|
|
475
|
-
*
|
|
582
|
+
* Resolves an element's id using the same precedence as `useRenderElement`.
|
|
583
|
+
* Returns `''` when the element renders with an explicitly empty id, which consumers must treat
|
|
584
|
+
* as "no id" rather than falling back to the generated one, so ARIA relationships never reference
|
|
585
|
+
* an id no element carries. Render callbacks are opaque and are expected to use the id passed to
|
|
586
|
+
* them.
|
|
476
587
|
*
|
|
477
|
-
*
|
|
588
|
+
* @internal
|
|
478
589
|
*/
|
|
479
|
-
|
|
480
|
-
const
|
|
481
|
-
|
|
590
|
+
function resolveRenderedId(props, fallbackId) {
|
|
591
|
+
const render = unwrapLazyRenderProp(props.render);
|
|
592
|
+
if (/*#__PURE__*/ React$1.isValidElement(render)) {
|
|
593
|
+
const renderProps = render.props;
|
|
594
|
+
if (Object.hasOwn(renderProps, "id")) return renderProps.id ?? "";
|
|
595
|
+
}
|
|
596
|
+
return props.id ?? fallbackId;
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* Resolves the element's id and returns a ref that publishes it to the owner while mounted.
|
|
600
|
+
* A generated fallback is never published as an override, so removing an explicit id lets the
|
|
601
|
+
* element return to the generated one.
|
|
602
|
+
*
|
|
603
|
+
* @internal
|
|
604
|
+
*/
|
|
605
|
+
function useRenderedId(props, defaultId, setId) {
|
|
606
|
+
const id = resolveRenderedId(props, defaultId);
|
|
607
|
+
const registeredId = id === defaultId ? void 0 : id;
|
|
608
|
+
return [id, React$1.useCallback((element) => setId?.(element ? registeredId : void 0), [registeredId, setId])];
|
|
609
|
+
}
|
|
610
|
+
//#endregion
|
|
611
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/internals/resolvePopupLabel.mjs
|
|
612
|
+
function resolvePopupLabel(props, activeTriggerElement, activeTriggerId) {
|
|
613
|
+
const render = unwrapLazyRenderProp(props.render);
|
|
614
|
+
const renderedElementProps = /*#__PURE__*/ React$1.isValidElement(render) ? render.props : void 0;
|
|
615
|
+
const ariaLabel = props["aria-label"] ?? renderedElementProps?.["aria-label"];
|
|
616
|
+
let ariaLabelledBy = props["aria-labelledby"] ?? renderedElementProps?.["aria-labelledby"];
|
|
617
|
+
if (ariaLabelledBy == null && !ariaLabel) ariaLabelledBy = activeTriggerElement ? activeTriggerElement.id || void 0 : activeTriggerId || void 0;
|
|
618
|
+
return ariaLabelledBy;
|
|
619
|
+
}
|
|
620
|
+
//#endregion
|
|
621
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/menu/popup/MenuPopup.mjs
|
|
622
|
+
/**
|
|
623
|
+
* @internal
|
|
624
|
+
*/
|
|
625
|
+
const MenuPopupPlain = /*#__PURE__*/ React$1.forwardRef(function MenuPopupPlain(componentProps, forwardedRef) {
|
|
626
|
+
const { render, className, style, finalFocus, id: idProp, initialFocus: initialFocusProp, ...elementProps } = componentProps;
|
|
627
|
+
const { store, defaultFloatingId, setRenderedFloatingId, virtualFocus, orientation } = useMenuRootContext();
|
|
628
|
+
const inheritedSubmenuRootContext = useMenuSubmenuRootContext();
|
|
482
629
|
const { side, align } = useMenuPositionerContext();
|
|
483
630
|
const insideToolbar = useToolbarRootContext(true) != null;
|
|
484
631
|
const open = store.useState("open");
|
|
@@ -496,7 +643,17 @@ const MenuPopup = /*#__PURE__*/ React$1.forwardRef(function MenuPopup(componentP
|
|
|
496
643
|
const hoverEnabled = store.useState("hoverEnabled");
|
|
497
644
|
const disabled = store.useState("disabled");
|
|
498
645
|
const openMethod = store.useState("openMethod");
|
|
646
|
+
const activeTriggerId = store.useState("activeTriggerId");
|
|
647
|
+
const listElement = store.useState("listElement");
|
|
648
|
+
const [id, registerIdRef] = useRenderedId(componentProps, defaultFloatingId, setRenderedFloatingId);
|
|
649
|
+
const ariaLabelledBy = resolvePopupLabel(componentProps, activeTriggerElement, activeTriggerId);
|
|
650
|
+
const submenuRootContext = parent.type === "menu" ? inheritedSubmenuRootContext : void 0;
|
|
499
651
|
const isContextMenu = parent.type === "context-menu";
|
|
652
|
+
let initialFocus = initialFocusProp ?? parent.type !== "menu";
|
|
653
|
+
if (initialFocusProp === void 0 && listElement && parent.type !== "menu") initialFocus = () => {
|
|
654
|
+
if (store.state.activeIndex !== null) return false;
|
|
655
|
+
return listElement;
|
|
656
|
+
};
|
|
500
657
|
useOpenChangeComplete({
|
|
501
658
|
open,
|
|
502
659
|
ref: store.context.popupRef,
|
|
@@ -518,6 +675,7 @@ const MenuPopup = /*#__PURE__*/ React$1.forwardRef(function MenuPopup(componentP
|
|
|
518
675
|
closeDelay
|
|
519
676
|
});
|
|
520
677
|
const setPopupElement = store.useStateSetter("popupElement");
|
|
678
|
+
const { parentVirtualFocusRef, handleFocus } = (React$1.useContext(MenuFilterImplContext)?.useParentHandoff ?? useNoParentHandoff)(store, parent, open, virtualFocus);
|
|
521
679
|
const state = {
|
|
522
680
|
transitionStatus,
|
|
523
681
|
side,
|
|
@@ -531,14 +689,25 @@ const MenuPopup = /*#__PURE__*/ React$1.forwardRef(function MenuPopup(componentP
|
|
|
531
689
|
ref: [
|
|
532
690
|
forwardedRef,
|
|
533
691
|
store.context.popupRef,
|
|
534
|
-
setPopupElement
|
|
692
|
+
setPopupElement,
|
|
693
|
+
registerIdRef
|
|
535
694
|
],
|
|
536
695
|
stateAttributesMapping: popupTransitionStateMapping,
|
|
537
696
|
props: [
|
|
538
697
|
popupProps,
|
|
539
|
-
{
|
|
540
|
-
|
|
541
|
-
|
|
698
|
+
{
|
|
699
|
+
id,
|
|
700
|
+
...listElement ? { role: "presentation" } : {
|
|
701
|
+
role: "menu",
|
|
702
|
+
"aria-orientation": orientation === "horizontal" ? "horizontal" : void 0,
|
|
703
|
+
"aria-labelledby": ariaLabelledBy
|
|
704
|
+
},
|
|
705
|
+
onKeyDown(event) {
|
|
706
|
+
submenuRootContext?.onPopupKeyDown?.(event);
|
|
707
|
+
if (insideToolbar && COMPOSITE_KEYS.has(event.key)) event.stopPropagation();
|
|
708
|
+
},
|
|
709
|
+
onFocus: handleFocus
|
|
710
|
+
},
|
|
542
711
|
getDisabledMountTransitionStyles(transitionStatus),
|
|
543
712
|
elementProps,
|
|
544
713
|
{ "data-rootownerid": rootId }
|
|
@@ -546,24 +715,48 @@ const MenuPopup = /*#__PURE__*/ React$1.forwardRef(function MenuPopup(componentP
|
|
|
546
715
|
});
|
|
547
716
|
let returnFocus = parent.type === void 0 || isContextMenu;
|
|
548
717
|
if (activeTriggerElement || parent.type === "menubar" && lastOpenChangeReason !== "outside-press") returnFocus = true;
|
|
718
|
+
const dynamicReturnFocus = submenuRootContext?.getReturnElement ?? parentVirtualFocusRef;
|
|
549
719
|
return /*#__PURE__*/ jsx(FloatingFocusManager, {
|
|
550
720
|
context: floatingContext,
|
|
551
721
|
openInteractionType: openMethod,
|
|
552
722
|
modal: isContextMenu,
|
|
553
723
|
disabled: !mounted,
|
|
554
|
-
returnFocus: finalFocus
|
|
555
|
-
|
|
724
|
+
returnFocus: finalFocus ?? dynamicReturnFocus ?? returnFocus,
|
|
725
|
+
explicitReturnFocus: finalFocus === void 0 && dynamicReturnFocus ? false : void 0,
|
|
726
|
+
initialFocus,
|
|
556
727
|
restoreFocus: true,
|
|
728
|
+
getInsideElements: parent.type === void 0 ? () => [store.context.beforeTriggerFocusGuardRef.current] : void 0,
|
|
557
729
|
externalTree: parent.type !== "menubar" ? floatingTreeRoot : void 0,
|
|
558
730
|
previousFocusableElement: activeTriggerElement,
|
|
559
731
|
nextFocusableElement: parent.type === void 0 ? store.context.triggerFocusTargetRef : void 0,
|
|
560
|
-
beforeContentFocusGuardRef:
|
|
732
|
+
beforeContentFocusGuardRef: store.context.beforeContentFocusGuardRef,
|
|
561
733
|
children: element
|
|
562
734
|
});
|
|
563
735
|
});
|
|
736
|
+
MenuPopupPlain.displayName = "MenuPopupPlain";
|
|
737
|
+
const NO_PARENT_HANDOFF = {
|
|
738
|
+
parentVirtualFocusRef: void 0,
|
|
739
|
+
handleFocus: void 0
|
|
740
|
+
};
|
|
741
|
+
function useNoParentHandoff() {
|
|
742
|
+
return NO_PARENT_HANDOFF;
|
|
743
|
+
}
|
|
744
|
+
/**
|
|
745
|
+
* A container for the menu items.
|
|
746
|
+
* Renders a `<div>` element.
|
|
747
|
+
*
|
|
748
|
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
749
|
+
*/
|
|
750
|
+
const MenuPopup = /*#__PURE__*/ React$1.forwardRef(function MenuPopup(props, forwardedRef) {
|
|
751
|
+
const Popup = useMenuFilterImpl()?.Popup ?? MenuPopupPlain;
|
|
752
|
+
return /*#__PURE__*/ jsx(Popup, {
|
|
753
|
+
...props,
|
|
754
|
+
ref: forwardedRef
|
|
755
|
+
});
|
|
756
|
+
});
|
|
564
757
|
MenuPopup.displayName = "MenuPopup";
|
|
565
758
|
//#endregion
|
|
566
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
759
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/menu/portal/MenuPortalContext.mjs
|
|
567
760
|
const MenuPortalContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
568
761
|
MenuPortalContext.displayName = "MenuPortalContext";
|
|
569
762
|
function useMenuPortalContext() {
|
|
@@ -572,7 +765,7 @@ function useMenuPortalContext() {
|
|
|
572
765
|
return value;
|
|
573
766
|
}
|
|
574
767
|
//#endregion
|
|
575
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
768
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/menu/portal/MenuPortal.mjs
|
|
576
769
|
/**
|
|
577
770
|
* A portal element that moves the popup to a different part of the DOM.
|
|
578
771
|
* By default, the portal element is appended to `<body>`.
|
|
@@ -596,7 +789,7 @@ const MenuPortal = /*#__PURE__*/ React$1.forwardRef(function MenuPortal(props, f
|
|
|
596
789
|
});
|
|
597
790
|
MenuPortal.displayName = "MenuPortal";
|
|
598
791
|
//#endregion
|
|
599
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
792
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/menu/positioner/MenuPositioner.mjs
|
|
600
793
|
/**
|
|
601
794
|
* Positions the menu popup against the trigger.
|
|
602
795
|
* Renders a `<div>` element.
|
|
@@ -605,7 +798,7 @@ MenuPortal.displayName = "MenuPortal";
|
|
|
605
798
|
*/
|
|
606
799
|
const MenuPositioner = /*#__PURE__*/ React$1.forwardRef(function MenuPositioner(componentProps, forwardedRef) {
|
|
607
800
|
const { anchor: anchorProp, positionMethod: positionMethodProp = "absolute", className, render, side, align: alignProp, sideOffset: sideOffsetProp = 0, alignOffset: alignOffsetProp = 0, collisionBoundary = "clipping-ancestors", collisionPadding = 5, arrowPadding = 5, sticky = false, disableAnchorTracking = false, collisionAvoidance: collisionAvoidanceProp = DROPDOWN_COLLISION_AVOIDANCE, style, ...elementProps } = componentProps;
|
|
608
|
-
const { store } = useMenuRootContext();
|
|
801
|
+
const { store, virtualFocus, syncHighlightedItem } = useMenuRootContext();
|
|
609
802
|
const keepMounted = useMenuPortalContext();
|
|
610
803
|
const contextMenuContext = useContextMenuRootContext(true);
|
|
611
804
|
const parent = store.useState("parent");
|
|
@@ -624,8 +817,6 @@ const MenuPositioner = /*#__PURE__*/ React$1.forwardRef(function MenuPositioner(
|
|
|
624
817
|
const floatingNodeId = store.useState("floatingNodeId");
|
|
625
818
|
const floatingParentNodeId = store.useState("floatingParentNodeId");
|
|
626
819
|
const domReference = floatingRootContext.useState("domReferenceElement");
|
|
627
|
-
const previousTriggerRef = React$1.useRef(null);
|
|
628
|
-
const runOnceAnimationsFinish = useAnimationsFinished(positionerElement);
|
|
629
820
|
let anchor = anchorProp;
|
|
630
821
|
let sideOffset = sideOffsetProp;
|
|
631
822
|
let alignOffset = alignOffsetProp;
|
|
@@ -672,7 +863,8 @@ const MenuPositioner = /*#__PURE__*/ React$1.forwardRef(function MenuPositioner(
|
|
|
672
863
|
rootBoundary: "layoutViewport"
|
|
673
864
|
} : void 0,
|
|
674
865
|
externalTree: floatingTreeRoot,
|
|
675
|
-
adaptiveOrigin
|
|
866
|
+
adaptiveOrigin,
|
|
867
|
+
lazyFlip: virtualFocus ? "placement" : false
|
|
676
868
|
});
|
|
677
869
|
React$1.useEffect(() => {
|
|
678
870
|
function onMenuOpenChange(details) {
|
|
@@ -744,25 +936,12 @@ const MenuPositioner = /*#__PURE__*/ React$1.forwardRef(function MenuPositioner(
|
|
|
744
936
|
floatingNodeId,
|
|
745
937
|
floatingParentNodeId
|
|
746
938
|
]);
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
const previousTrigger = previousTriggerRef.current;
|
|
750
|
-
if (currentTrigger) previousTriggerRef.current = currentTrigger;
|
|
751
|
-
if (previousTrigger && currentTrigger && currentTrigger !== previousTrigger) {
|
|
752
|
-
store.set("instantType", void 0);
|
|
753
|
-
const abortController = new AbortController();
|
|
754
|
-
runOnceAnimationsFinish(() => {
|
|
755
|
-
store.set("instantType", "trigger-change");
|
|
756
|
-
}, abortController.signal);
|
|
757
|
-
return () => {
|
|
758
|
-
abortController.abort();
|
|
759
|
-
};
|
|
760
|
-
}
|
|
761
|
-
}, [
|
|
939
|
+
useTriggerSwitchTransition({
|
|
940
|
+
store,
|
|
762
941
|
domReference,
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
942
|
+
positionerElement,
|
|
943
|
+
open
|
|
944
|
+
});
|
|
766
945
|
const state = {
|
|
767
946
|
open,
|
|
768
947
|
side: positioner.side,
|
|
@@ -796,6 +975,7 @@ const MenuPositioner = /*#__PURE__*/ React$1.forwardRef(function MenuPositioner(
|
|
|
796
975
|
children: /*#__PURE__*/ jsx(CompositeList, {
|
|
797
976
|
elementsRef: store.context.itemDomElements,
|
|
798
977
|
labelsRef: store.context.itemLabels,
|
|
978
|
+
onMapChange: syncHighlightedItem,
|
|
799
979
|
children: element
|
|
800
980
|
})
|
|
801
981
|
})]
|
|
@@ -803,7 +983,7 @@ const MenuPositioner = /*#__PURE__*/ React$1.forwardRef(function MenuPositioner(
|
|
|
803
983
|
});
|
|
804
984
|
MenuPositioner.displayName = "MenuPositioner";
|
|
805
985
|
//#endregion
|
|
806
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
986
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/menu/radio-group/MenuRadioGroupContext.mjs
|
|
807
987
|
const MenuRadioGroupContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
808
988
|
MenuRadioGroupContext.displayName = "MenuRadioGroupContext";
|
|
809
989
|
function useMenuRadioGroupContext() {
|
|
@@ -812,14 +992,11 @@ function useMenuRadioGroupContext() {
|
|
|
812
992
|
return context;
|
|
813
993
|
}
|
|
814
994
|
//#endregion
|
|
815
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
995
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/menu/radio-group/MenuRadioGroup.mjs
|
|
816
996
|
/**
|
|
817
|
-
*
|
|
818
|
-
* Renders a `<div>` element.
|
|
819
|
-
*
|
|
820
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
997
|
+
* @internal
|
|
821
998
|
*/
|
|
822
|
-
const
|
|
999
|
+
const MenuRadioGroupPlain = /*#__PURE__*/ React$1.forwardRef(function MenuRadioGroupPlain(componentProps, forwardedRef) {
|
|
823
1000
|
const { render, className, value: valueProp, defaultValue, onValueChange: onValueChangeProp, disabled = false, style, "aria-labelledby": ariaLabelledByProp, ...elementProps } = componentProps;
|
|
824
1001
|
const [labelId, setLabelId] = React$1.useState(void 0);
|
|
825
1002
|
const [value, setValueUnwrapped] = useControlled({
|
|
@@ -858,10 +1035,18 @@ const MenuRadioGroup = /*#__PURE__*/ React$1.memo(/*#__PURE__*/ React$1.forwardR
|
|
|
858
1035
|
children: element
|
|
859
1036
|
})
|
|
860
1037
|
});
|
|
1038
|
+
});
|
|
1039
|
+
MenuRadioGroupPlain.displayName = "MenuRadioGroupPlain";
|
|
1040
|
+
const MenuRadioGroup = /*#__PURE__*/ React$1.memo(/*#__PURE__*/ React$1.forwardRef(function MenuRadioGroup(props, forwardedRef) {
|
|
1041
|
+
const RadioGroup = useMenuFilterImpl()?.RadioGroup ?? MenuRadioGroupPlain;
|
|
1042
|
+
return /*#__PURE__*/ jsx(RadioGroup, {
|
|
1043
|
+
...props,
|
|
1044
|
+
ref: forwardedRef
|
|
1045
|
+
});
|
|
861
1046
|
}));
|
|
862
1047
|
MenuRadioGroup.displayName = "MenuRadioGroup";
|
|
863
1048
|
//#endregion
|
|
864
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1049
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/menu/radio-item/MenuRadioItemContext.mjs
|
|
865
1050
|
const MenuRadioItemContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
866
1051
|
MenuRadioItemContext.displayName = "MenuRadioItemContext";
|
|
867
1052
|
function useMenuRadioItemContext() {
|
|
@@ -870,25 +1055,19 @@ function useMenuRadioItemContext() {
|
|
|
870
1055
|
return context;
|
|
871
1056
|
}
|
|
872
1057
|
//#endregion
|
|
873
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
874
|
-
|
|
875
|
-
* A menu item that works like a radio button in a given group.
|
|
876
|
-
* Renders a `<div>` element.
|
|
877
|
-
*
|
|
878
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
879
|
-
*/
|
|
880
|
-
const MenuRadioItem = /*#__PURE__*/ React$1.forwardRef(function MenuRadioItem(componentProps, forwardedRef) {
|
|
1058
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/menu/radio-item/MenuRadioItem.mjs
|
|
1059
|
+
const MenuRadioItemPlain = /*#__PURE__*/ React$1.forwardRef(function MenuRadioItemPlain(componentProps, forwardedRef) {
|
|
881
1060
|
const { render, className, id: idProp, label, nativeButton = false, disabled: disabledProp = false, closeOnClick = false, value, style, ...elementProps } = componentProps;
|
|
1061
|
+
const { store } = useMenuRootContext();
|
|
1062
|
+
const { value: selectedValue, setValue: setSelectedValue, disabled: groupDisabled } = useMenuRadioGroupContext();
|
|
882
1063
|
const listItem = useCompositeListItem({
|
|
883
1064
|
guess: true,
|
|
884
1065
|
label
|
|
885
1066
|
});
|
|
886
|
-
const menuPositionerContext = useMenuPositionerContext(true);
|
|
887
1067
|
const id = useBaseUiId(idProp);
|
|
888
|
-
const { store } = useMenuRootContext();
|
|
889
1068
|
const highlighted = store.useState("isActive", listItem.index);
|
|
1069
|
+
const nodeId = store.useState("floatingNodeId");
|
|
890
1070
|
const itemProps = store.useState("itemProps");
|
|
891
|
-
const { value: selectedValue, setValue: setSelectedValue, disabled: groupDisabled } = useMenuRadioGroupContext();
|
|
892
1071
|
const rootDisabled = store.useState("disabled");
|
|
893
1072
|
const disabled = disabledProp || groupDisabled || rootDisabled;
|
|
894
1073
|
const checked = selectedValue === value;
|
|
@@ -899,7 +1078,7 @@ const MenuRadioItem = /*#__PURE__*/ React$1.forwardRef(function MenuRadioItem(co
|
|
|
899
1078
|
id,
|
|
900
1079
|
store,
|
|
901
1080
|
nativeButton,
|
|
902
|
-
nodeId
|
|
1081
|
+
nodeId,
|
|
903
1082
|
itemMetadata: REGULAR_ITEM
|
|
904
1083
|
});
|
|
905
1084
|
const state = React$1.useMemo(() => ({
|
|
@@ -939,9 +1118,18 @@ const MenuRadioItem = /*#__PURE__*/ React$1.forwardRef(function MenuRadioItem(co
|
|
|
939
1118
|
children: element
|
|
940
1119
|
});
|
|
941
1120
|
});
|
|
1121
|
+
MenuRadioItemPlain.displayName = "MenuRadioItemPlain";
|
|
1122
|
+
const MenuRadioItem = /*#__PURE__*/ React$1.forwardRef(function MenuRadioItem(props, forwardedRef) {
|
|
1123
|
+
const filterItem = useMenuFilterItem(props, forwardedRef);
|
|
1124
|
+
if (!filterItem.visible) return null;
|
|
1125
|
+
return /*#__PURE__*/ jsx(MenuRadioItemPlain, {
|
|
1126
|
+
...props,
|
|
1127
|
+
ref: filterItem.ref
|
|
1128
|
+
});
|
|
1129
|
+
});
|
|
942
1130
|
MenuRadioItem.displayName = "MenuRadioItem";
|
|
943
1131
|
//#endregion
|
|
944
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1132
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/menu/radio-item-indicator/MenuRadioItemIndicator.mjs
|
|
945
1133
|
/**
|
|
946
1134
|
* Indicates whether the radio item is selected.
|
|
947
1135
|
* Renders a `<span>` element.
|
|
@@ -981,12 +1169,13 @@ const MenuRadioItemIndicator = /*#__PURE__*/ React$1.forwardRef(function MenuRad
|
|
|
981
1169
|
});
|
|
982
1170
|
MenuRadioItemIndicator.displayName = "MenuRadioItemIndicator";
|
|
983
1171
|
//#endregion
|
|
984
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1172
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/menu/store/MenuStore.mjs
|
|
985
1173
|
const selectors = {
|
|
986
1174
|
...popupStoreSelectors,
|
|
987
1175
|
disabled: (state) => state.parent.type === "menubar" ? state.parent.context.disabled || state.disabled : state.disabled,
|
|
988
1176
|
modal: (state) => (state.parent.type === void 0 || state.parent.type === "context-menu") && (state.modal ?? true),
|
|
989
1177
|
openMethod: (state) => state.openMethod,
|
|
1178
|
+
keyboardOpen: (state) => state.keyboardOpen,
|
|
990
1179
|
allowMouseEnter: (state) => state.allowMouseEnter,
|
|
991
1180
|
highlightItemOnHover: (state) => state.highlightItemOnHover,
|
|
992
1181
|
parent: (state) => state.parent,
|
|
@@ -995,9 +1184,19 @@ const selectors = {
|
|
|
995
1184
|
return state.parent.type !== void 0 ? state.parent.context.rootId : state.rootId;
|
|
996
1185
|
},
|
|
997
1186
|
activeIndex: (state) => state.activeIndex,
|
|
1187
|
+
listElement: (state) => state.listElement,
|
|
1188
|
+
/** The trigger's `aria-controls`: the list when one holds the `menu` role, else the popup. */
|
|
1189
|
+
triggerControlsId: (state, triggerId) => {
|
|
1190
|
+
const popupId = popupStoreSelectors.triggerPopupId(state, triggerId);
|
|
1191
|
+
return popupId ? state.listElement?.id || popupId : void 0;
|
|
1192
|
+
},
|
|
1193
|
+
filterTriggerProps: (state) => state.filterTriggerProps,
|
|
1194
|
+
inputProps: (state) => state.inputProps,
|
|
1195
|
+
webkitAriaSelected: (state, highlighted) => webkit && state.inputFocused && highlighted ? true : void 0,
|
|
1196
|
+
highlightedItemId: (state) => state.highlightedItem?.id || void 0,
|
|
998
1197
|
isActive: (state, itemIndex) => state.activeIndex === itemIndex,
|
|
999
1198
|
hoverEnabled: (state) => state.hoverEnabled,
|
|
1000
|
-
instantType: (state) => state.instantType,
|
|
1199
|
+
instantType: (state) => state.instantType === "trigger-change" && !popupStoreSelectors.open(state) ? void 0 : state.instantType,
|
|
1001
1200
|
lastOpenChangeReason: (state) => state.openChangeReason,
|
|
1002
1201
|
floatingTreeRoot: (state) => {
|
|
1003
1202
|
if (state.parent.type === "menu") return state.parent.store.select("floatingTreeRoot");
|
|
@@ -1025,27 +1224,32 @@ var MenuStore = class extends ReactStore {
|
|
|
1025
1224
|
const triggerElements = new PopupTriggerMap();
|
|
1026
1225
|
const state = createInitialState(triggerElements, floatingId, nested, initialState);
|
|
1027
1226
|
super(state, createInitialContext(triggerElements), selectors);
|
|
1028
|
-
this.
|
|
1029
|
-
this.
|
|
1030
|
-
if (parent.type
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1227
|
+
this.observe("parent", (parent) => {
|
|
1228
|
+
if (parent.type === "menu") this.context.allowMouseUpTriggerRef = parent.store.context.allowMouseUpTriggerRef;
|
|
1229
|
+
else if (parent.type !== void 0) this.context.allowMouseUpTriggerRef = parent.context.allowMouseUpTriggerRef;
|
|
1230
|
+
});
|
|
1231
|
+
}
|
|
1232
|
+
/**
|
|
1233
|
+
* Propagates changes of the parent menu's shared tree state to this store's subscribers.
|
|
1234
|
+
* The owning `Menu.Root` calls it from an effect so the parent store subscription is released
|
|
1235
|
+
* when the submenu unmounts.
|
|
1236
|
+
* @returns A function that removes the parent store subscription.
|
|
1237
|
+
*/
|
|
1238
|
+
subscribeToParentMenu() {
|
|
1239
|
+
const parent = this.state.parent;
|
|
1240
|
+
if (parent.type !== "menu") return;
|
|
1241
|
+
let rootId = parent.store.select("rootId");
|
|
1242
|
+
let floatingTreeRoot = parent.store.select("floatingTreeRoot");
|
|
1243
|
+
let keyboardEventRelay = parent.store.select("keyboardEventRelay");
|
|
1244
|
+
return parent.store.subscribe(() => {
|
|
1245
|
+
const nextRootId = parent.store.select("rootId");
|
|
1246
|
+
const nextFloatingTreeRoot = parent.store.select("floatingTreeRoot");
|
|
1247
|
+
const nextKeyboardEventRelay = parent.store.select("keyboardEventRelay");
|
|
1248
|
+
if (rootId === nextRootId && floatingTreeRoot === nextFloatingTreeRoot && keyboardEventRelay === nextKeyboardEventRelay) return;
|
|
1249
|
+
rootId = nextRootId;
|
|
1250
|
+
floatingTreeRoot = nextFloatingTreeRoot;
|
|
1251
|
+
keyboardEventRelay = nextKeyboardEventRelay;
|
|
1252
|
+
this.notifyAll();
|
|
1049
1253
|
});
|
|
1050
1254
|
}
|
|
1051
1255
|
setOpen(open, eventDetails) {
|
|
@@ -1054,7 +1258,18 @@ var MenuStore = class extends ReactStore {
|
|
|
1054
1258
|
eventDetails
|
|
1055
1259
|
});
|
|
1056
1260
|
}
|
|
1057
|
-
|
|
1261
|
+
setActiveIndex(activeIndex, reason, event) {
|
|
1262
|
+
if (this.state.activeIndex !== activeIndex) {
|
|
1263
|
+
const isWriteBack = (activeIndex === null ? void 0 : this.context.itemDomElements.current[activeIndex]) === this.context.reportedItem;
|
|
1264
|
+
this.context.highlightReason = isWriteBack ? "none" : reason;
|
|
1265
|
+
this.context.highlightEvent = isWriteBack ? void 0 : event;
|
|
1266
|
+
}
|
|
1267
|
+
this.set("activeIndex", activeIndex);
|
|
1268
|
+
}
|
|
1269
|
+
highlightItem(element, reason, event) {
|
|
1270
|
+
const index = this.context.itemDomElements.current.indexOf(element);
|
|
1271
|
+
if (index > -1) this.setActiveIndex(index, reason, event);
|
|
1272
|
+
}
|
|
1058
1273
|
};
|
|
1059
1274
|
/**
|
|
1060
1275
|
* Creates the inert fallback store used by detached handle-backed triggers while no `Menu.Root` is
|
|
@@ -1075,8 +1290,13 @@ function createInitialContext(triggerElements) {
|
|
|
1075
1290
|
typingRef: { current: false },
|
|
1076
1291
|
itemDomElements: { current: [] },
|
|
1077
1292
|
itemLabels: { current: [] },
|
|
1293
|
+
highlightReason: "none",
|
|
1294
|
+
highlightEvent: void 0,
|
|
1295
|
+
reportedItem: void 0,
|
|
1078
1296
|
allowMouseUpTriggerRef: { current: false },
|
|
1297
|
+
virtualFocusRef: void 0,
|
|
1079
1298
|
triggerFocusTargetRef: /*#__PURE__*/ React$1.createRef(),
|
|
1299
|
+
beforeTriggerFocusGuardRef: /*#__PURE__*/ React$1.createRef(),
|
|
1080
1300
|
beforeContentFocusGuardRef: /*#__PURE__*/ React$1.createRef(),
|
|
1081
1301
|
onOpenChangeComplete: void 0,
|
|
1082
1302
|
triggerElements
|
|
@@ -1088,11 +1308,17 @@ function createInitialState(triggerElements, floatingId, nested = false, initial
|
|
|
1088
1308
|
disabled: false,
|
|
1089
1309
|
modal: true,
|
|
1090
1310
|
openMethod: null,
|
|
1311
|
+
keyboardOpen: false,
|
|
1091
1312
|
allowMouseEnter: false,
|
|
1092
1313
|
highlightItemOnHover: true,
|
|
1093
1314
|
parent: { type: void 0 },
|
|
1094
1315
|
rootId: void 0,
|
|
1095
1316
|
activeIndex: null,
|
|
1317
|
+
listElement: null,
|
|
1318
|
+
filterTriggerProps: EMPTY_OBJECT,
|
|
1319
|
+
inputProps: EMPTY_OBJECT,
|
|
1320
|
+
inputFocused: false,
|
|
1321
|
+
highlightedItem: void 0,
|
|
1096
1322
|
hoverEnabled: true,
|
|
1097
1323
|
instantType: void 0,
|
|
1098
1324
|
openChangeReason: null,
|
|
@@ -1107,64 +1333,90 @@ function createInitialState(triggerElements, floatingId, nested = false, initial
|
|
|
1107
1333
|
};
|
|
1108
1334
|
}
|
|
1109
1335
|
//#endregion
|
|
1110
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1336
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/menu/filter-provider/MenuFilterProviderContext.mjs
|
|
1337
|
+
/**
|
|
1338
|
+
* What `Menu.FilterProvider` hands to the root directly inside it: the filterable root
|
|
1339
|
+
* implementations (the provider is their only importer) and the filter props.
|
|
1340
|
+
*/
|
|
1341
|
+
/**
|
|
1342
|
+
* Non-null only directly below a provider. The root that consumes it resets it, so a plain
|
|
1343
|
+
* `Menu.SubmenuRoot` inside a filterable menu stays plain.
|
|
1344
|
+
*/
|
|
1345
|
+
const MenuFilterProviderContext = /*#__PURE__*/ React$1.createContext(null);
|
|
1346
|
+
MenuFilterProviderContext.displayName = "MenuFilterProviderContext";
|
|
1347
|
+
//#endregion
|
|
1348
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/menu/utils/isKeyboardOpen.mjs
|
|
1349
|
+
/**
|
|
1350
|
+
* Keyboard and assistive-technology activations produce `detail === 0` clicks; mouse-gesture
|
|
1351
|
+
* clicks (including the synthesized drag-release click from `useMenuItemCommonProps`) carry
|
|
1352
|
+
* `detail >= 1`.
|
|
1353
|
+
*/
|
|
1354
|
+
function isKeyboardClick(reason, event) {
|
|
1355
|
+
return (reason === "trigger-press" || reason === "item-press") && event?.detail === 0;
|
|
1356
|
+
}
|
|
1357
|
+
/**
|
|
1358
|
+
* Whether a menu opens from the keyboard, which lands focus in the popup. Arrow keys report
|
|
1359
|
+
* `list-navigation`; Enter and Space dispatch a click carrying no pointer detail.
|
|
1360
|
+
*/
|
|
1361
|
+
function isKeyboardOpen(reason, event) {
|
|
1362
|
+
return reason === "list-navigation" || isKeyboardClick(reason, event);
|
|
1115
1363
|
}
|
|
1116
1364
|
//#endregion
|
|
1117
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1365
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/menu/root/MenuRoot.mjs
|
|
1118
1366
|
/**
|
|
1119
|
-
*
|
|
1120
|
-
* Doesn't render its own HTML element.
|
|
1121
|
-
*
|
|
1122
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
1367
|
+
* @internal
|
|
1123
1368
|
*/
|
|
1124
|
-
const
|
|
1125
|
-
const { children, open: openProp, onOpenChange, onOpenChangeComplete, defaultOpen = false, disabled: disabledProp = false, modal: modalProp, loopFocus = true, orientation = "vertical", actionsRef, closeParentOnEsc = false, handle, triggerId: triggerIdProp, defaultTriggerId: defaultTriggerIdProp = null, highlightItemOnHover = true } = props;
|
|
1369
|
+
const MenuRootInternal = fastComponent(function MenuRootInternal(props) {
|
|
1370
|
+
const { children, open: openProp, onOpenChange, onOpenChangeComplete, onItemHighlighted: onItemHighlightedProp, defaultOpen = false, disabled: disabledProp = false, modal: modalProp, loopFocus = true, orientation = "vertical", actionsRef, closeParentOnEsc = false, handle, triggerId: triggerIdProp, defaultTriggerId: defaultTriggerIdProp = null, highlightItemOnHover = true, isSubmenu = false, virtualFocus = false, virtualFocusRef, allowEscape = true, resetOnPointerLeave = true } = props;
|
|
1126
1371
|
const contextMenuContext = useContextMenuRootContext(true);
|
|
1127
1372
|
const parentMenuRootContext = useMenuRootContext(true);
|
|
1128
1373
|
const menubarContext = useMenubarContext(true);
|
|
1129
|
-
const
|
|
1374
|
+
const enclosingMenuStore = parentMenuRootContext?.store;
|
|
1375
|
+
const parentVirtualFocus = parentMenuRootContext?.virtualFocus ?? false;
|
|
1130
1376
|
const parentFromContext = React$1.useMemo(() => {
|
|
1131
|
-
if (isSubmenu &&
|
|
1377
|
+
if (isSubmenu && enclosingMenuStore) return {
|
|
1132
1378
|
type: "menu",
|
|
1133
|
-
store:
|
|
1379
|
+
store: enclosingMenuStore
|
|
1134
1380
|
};
|
|
1135
1381
|
if (menubarContext) return {
|
|
1136
1382
|
type: "menubar",
|
|
1137
1383
|
context: menubarContext
|
|
1138
1384
|
};
|
|
1139
|
-
if (contextMenuContext && !
|
|
1385
|
+
if (contextMenuContext && !enclosingMenuStore) return {
|
|
1140
1386
|
type: "context-menu",
|
|
1141
1387
|
context: contextMenuContext
|
|
1142
1388
|
};
|
|
1143
1389
|
return { type: void 0 };
|
|
1144
1390
|
}, [
|
|
1145
1391
|
contextMenuContext,
|
|
1146
|
-
|
|
1392
|
+
enclosingMenuStore,
|
|
1147
1393
|
menubarContext,
|
|
1148
1394
|
isSubmenu
|
|
1149
1395
|
]);
|
|
1150
|
-
const rootId =
|
|
1151
|
-
const
|
|
1396
|
+
const rootId = useBaseUiId();
|
|
1397
|
+
const defaultFloatingId = useBaseUiId();
|
|
1398
|
+
const [renderedFloatingId, setRenderedFloatingId] = React$1.useState(void 0);
|
|
1399
|
+
const floatingId = (renderedFloatingId ?? defaultFloatingId) || void 0;
|
|
1152
1400
|
const floatingParentNodeIdFromContext = useFloatingParentNodeId();
|
|
1153
1401
|
const parentMenuStore = parentFromContext.type === "menu" ? parentFromContext.store : void 0;
|
|
1154
1402
|
const animateInitialOpen = (openProp ?? defaultOpen) && parentMenuStore?.state.transitionStatus === "starting";
|
|
1155
1403
|
const seededInstantType = useRefWithInit(() => animateInitialOpen ? parentMenuStore?.state.instantType : void 0).current;
|
|
1156
|
-
const store =
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1404
|
+
const store = useRefWithInit(() => {
|
|
1405
|
+
const menuStore = new MenuStore({
|
|
1406
|
+
open: defaultOpen,
|
|
1407
|
+
openProp,
|
|
1408
|
+
activeTriggerId: defaultTriggerIdProp,
|
|
1409
|
+
triggerIdProp,
|
|
1410
|
+
parent: parentFromContext,
|
|
1411
|
+
disabled: disabledProp,
|
|
1412
|
+
highlightItemOnHover,
|
|
1413
|
+
modal: parentFromContext.type === void 0 ? modalProp : void 0,
|
|
1414
|
+
rootId,
|
|
1415
|
+
instantType: seededInstantType
|
|
1416
|
+
}, floatingId, floatingParentNodeIdFromContext != null);
|
|
1417
|
+
menuStore.context.virtualFocusRef = virtualFocusRef;
|
|
1418
|
+
return menuStore;
|
|
1419
|
+
}).current;
|
|
1168
1420
|
store.useControlledProp("openProp", openProp);
|
|
1169
1421
|
store.useControlledProp("triggerIdProp", triggerIdProp);
|
|
1170
1422
|
store.useContextCallback("onOpenChangeComplete", onOpenChangeComplete);
|
|
@@ -1178,6 +1430,7 @@ const MenuRoot = fastComponent(function MenuRoot(props) {
|
|
|
1178
1430
|
const lastOpenChangeReason = store.useState("lastOpenChangeReason");
|
|
1179
1431
|
const parent = store.useState("parent");
|
|
1180
1432
|
const activeIndex = store.useState("activeIndex");
|
|
1433
|
+
const keyboardOpen = store.useState("keyboardOpen");
|
|
1181
1434
|
const payload = store.useState("payload");
|
|
1182
1435
|
const floatingParentNodeId = store.useState("floatingParentNodeId");
|
|
1183
1436
|
const openEventRef = React$1.useRef(null);
|
|
@@ -1235,7 +1488,7 @@ const MenuRoot = fastComponent(function MenuRoot(props) {
|
|
|
1235
1488
|
floatingNodeId: floatingNodeIdFromContext,
|
|
1236
1489
|
floatingParentNodeId: floatingParentNodeIdFromContext
|
|
1237
1490
|
});
|
|
1238
|
-
else if (parentMenuRootContext) store.update({
|
|
1491
|
+
else if (parentMenuRootContext || !store.select("activeTriggerElement")) store.update({
|
|
1239
1492
|
floatingNodeId: floatingNodeIdFromContext,
|
|
1240
1493
|
floatingParentNodeId: floatingParentNodeIdFromContext
|
|
1241
1494
|
});
|
|
@@ -1244,6 +1497,7 @@ const MenuRoot = fastComponent(function MenuRoot(props) {
|
|
|
1244
1497
|
parentMenuRootContext,
|
|
1245
1498
|
floatingNodeIdFromContext,
|
|
1246
1499
|
floatingParentNodeIdFromContext,
|
|
1500
|
+
activeTriggerElement,
|
|
1247
1501
|
store
|
|
1248
1502
|
]);
|
|
1249
1503
|
React$1.useEffect(() => {
|
|
@@ -1279,7 +1533,7 @@ const MenuRoot = fastComponent(function MenuRoot(props) {
|
|
|
1279
1533
|
if (eventDetails.isCanceled) return;
|
|
1280
1534
|
store.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);
|
|
1281
1535
|
const nativeEvent = eventDetails.event;
|
|
1282
|
-
if (nextOpen === false && nativeEvent?.type === "click" && nativeEvent.pointerType === "touch" && !allowTouchToCloseRef.current) return;
|
|
1536
|
+
if (nextOpen === false && reason !== "item-press" && nativeEvent?.type === "click" && nativeEvent.pointerType === "touch" && !allowTouchToCloseRef.current) return;
|
|
1283
1537
|
if (nextOpen && reason === "trigger-focus") {
|
|
1284
1538
|
allowTouchToCloseRef.current = false;
|
|
1285
1539
|
allowTouchToCloseTimeout.start(300, () => {
|
|
@@ -1289,13 +1543,14 @@ const MenuRoot = fastComponent(function MenuRoot(props) {
|
|
|
1289
1543
|
allowTouchToCloseRef.current = true;
|
|
1290
1544
|
allowTouchToCloseTimeout.clear();
|
|
1291
1545
|
}
|
|
1292
|
-
const isKeyboardClick = (reason === "trigger-press" || reason === "item-press") && nativeEvent.detail === 0;
|
|
1293
1546
|
const isDismissClose = !nextOpen && (reason === "escape-key" || reason == null);
|
|
1294
1547
|
openEventRef.current = eventDetails.event;
|
|
1295
1548
|
const popupOpenState = createPopupOpenState(store.state, nextOpen, eventDetails.trigger, shouldPreventUnmountOnClose());
|
|
1296
1549
|
popupOpenState.openChangeReason = reason;
|
|
1550
|
+
popupOpenState.keyboardOpen = nextOpen && isKeyboardOpen(reason, nativeEvent);
|
|
1297
1551
|
if (parent.type === "menubar" && (reason === "trigger-focus" || reason === "focus-out" || reason === "trigger-hover" || reason === "list-navigation" || reason === "sibling-open")) popupOpenState.instantType = "group";
|
|
1298
|
-
else if (isKeyboardClick
|
|
1552
|
+
else if (isKeyboardClick(reason, nativeEvent)) popupOpenState.instantType = "click";
|
|
1553
|
+
else if (isDismissClose) popupOpenState.instantType = "dismiss";
|
|
1299
1554
|
else popupOpenState.instantType = void 0;
|
|
1300
1555
|
store.update(popupOpenState);
|
|
1301
1556
|
});
|
|
@@ -1314,6 +1569,7 @@ const MenuRoot = fastComponent(function MenuRoot(props) {
|
|
|
1314
1569
|
floatingEvents?.off("setOpen", handleSetOpenEvent);
|
|
1315
1570
|
};
|
|
1316
1571
|
}, [floatingEvents, setOpen]);
|
|
1572
|
+
useIsoLayoutEffect(() => store.subscribeToParentMenu(), [store]);
|
|
1317
1573
|
const handleImperativeClose = React$1.useCallback(() => {
|
|
1318
1574
|
store.setOpen(false, createChangeEventDetails(imperativeAction));
|
|
1319
1575
|
}, [store]);
|
|
@@ -1335,41 +1591,76 @@ const MenuRoot = fastComponent(function MenuRoot(props) {
|
|
|
1335
1591
|
externalTree: nested ? floatingTreeRoot : void 0
|
|
1336
1592
|
});
|
|
1337
1593
|
const direction = useDirection();
|
|
1338
|
-
const setActiveIndex = React$1.useCallback((index) => {
|
|
1339
|
-
if (store.select("activeIndex") === index) return;
|
|
1340
|
-
store.set("activeIndex", index);
|
|
1341
|
-
}, [store]);
|
|
1342
1594
|
const listNavigation$1 = useListNavigation(floatingRootContext, {
|
|
1343
1595
|
enabled: !disabled,
|
|
1344
1596
|
listRef: store.context.itemDomElements,
|
|
1345
1597
|
activeIndex,
|
|
1346
|
-
|
|
1598
|
+
virtual: virtualFocus,
|
|
1599
|
+
nested: parent.type === "menubar" || !virtualFocus && parent.type !== void 0,
|
|
1600
|
+
parentOrientation: parent.type === "menubar" ? parent.context.orientation : void 0,
|
|
1347
1601
|
loopFocus,
|
|
1602
|
+
focusItemOnOpen: virtualFocus ? keyboardOpen : void 0,
|
|
1603
|
+
allowEscape: virtualFocus && loopFocus && allowEscape,
|
|
1348
1604
|
orientation,
|
|
1349
|
-
|
|
1605
|
+
triggerOrientation: virtualFocus ? "vertical" : orientation,
|
|
1350
1606
|
rtl: direction === "rtl",
|
|
1351
1607
|
disabledIndices: EMPTY_ARRAY,
|
|
1352
|
-
onNavigate
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1608
|
+
onNavigate(nextActiveIndex, event) {
|
|
1609
|
+
store.setActiveIndex(nextActiveIndex, getHighlightReason(event), event?.nativeEvent);
|
|
1610
|
+
},
|
|
1611
|
+
openOnArrowKeyDown: parent.type !== "context-menu" && !(virtualFocus && isSubmenu),
|
|
1612
|
+
externalTree: !virtualFocus && nested ? floatingTreeRoot : void 0,
|
|
1613
|
+
nestedReturnFocusRef: parentMenuStore?.context.virtualFocusRef,
|
|
1614
|
+
focusItemOnHover: highlightItemOnHover,
|
|
1615
|
+
resetOnPointerLeave
|
|
1356
1616
|
});
|
|
1357
1617
|
const onTyping = React$1.useCallback((nextTyping) => {
|
|
1358
1618
|
store.context.typingRef.current = nextTyping;
|
|
1359
1619
|
}, [store]);
|
|
1360
1620
|
const typeahead = useTypeahead(floatingRootContext, {
|
|
1361
|
-
enabled: !disabled,
|
|
1621
|
+
enabled: !disabled && !virtualFocus,
|
|
1362
1622
|
listRef: store.context.itemLabels,
|
|
1363
1623
|
elementsRef: store.context.itemDomElements,
|
|
1364
1624
|
activeIndex,
|
|
1365
1625
|
resetMs: 500,
|
|
1366
|
-
onMatch: (index) => {
|
|
1367
|
-
if (open && index !== activeIndex) store.
|
|
1626
|
+
onMatch: (index, event) => {
|
|
1627
|
+
if (open && index !== activeIndex) store.setActiveIndex(index, keyboard, event.nativeEvent);
|
|
1368
1628
|
},
|
|
1369
1629
|
onTyping
|
|
1370
1630
|
});
|
|
1631
|
+
const onItemHighlighted = useStableCallback(onItemHighlightedProp);
|
|
1632
|
+
const lastHighlightIndexRef = React$1.useRef(-1);
|
|
1633
|
+
const syncHighlightedItem = useStableCallback(() => {
|
|
1634
|
+
const index = store.state.activeIndex;
|
|
1635
|
+
const item = index === null ? void 0 : store.context.itemDomElements.current[index] ?? void 0;
|
|
1636
|
+
if (item?.isConnected === false) return;
|
|
1637
|
+
const itemIndex = item === void 0 ? -1 : index;
|
|
1638
|
+
if (lastHighlightIndexRef.current === itemIndex && store.context.reportedItem === item) return;
|
|
1639
|
+
lastHighlightIndexRef.current = itemIndex;
|
|
1640
|
+
store.context.reportedItem = item;
|
|
1641
|
+
if (virtualFocus) store.set("highlightedItem", item);
|
|
1642
|
+
const { highlightReason, highlightEvent } = store.context;
|
|
1643
|
+
store.context.highlightReason = none;
|
|
1644
|
+
store.context.highlightEvent = void 0;
|
|
1645
|
+
if (!onItemHighlightedProp) return;
|
|
1646
|
+
onItemHighlighted(item, createGenericEventDetails(highlightReason, highlightEvent, { label: item === void 0 ? void 0 : store.context.itemLabels.current[itemIndex] ?? void 0 }));
|
|
1647
|
+
});
|
|
1648
|
+
useIsoLayoutEffect(() => {
|
|
1649
|
+
syncHighlightedItem();
|
|
1650
|
+
}, [activeIndex, syncHighlightedItem]);
|
|
1651
|
+
const openTriggerProps = React$1.useMemo(() => {
|
|
1652
|
+
if (!virtualFocus) return listNavigation$1.reference;
|
|
1653
|
+
if (!listNavigation$1.trigger) return EMPTY_OBJECT;
|
|
1654
|
+
const { onFocus, ...rest } = listNavigation$1.trigger;
|
|
1655
|
+
return rest;
|
|
1656
|
+
}, [
|
|
1657
|
+
virtualFocus,
|
|
1658
|
+
listNavigation$1.reference,
|
|
1659
|
+
listNavigation$1.trigger
|
|
1660
|
+
]);
|
|
1661
|
+
store.useSyncedValue("inputProps", virtualFocus ? listNavigation$1.reference ?? EMPTY_OBJECT : EMPTY_OBJECT);
|
|
1371
1662
|
const activeTriggerProps = React$1.useMemo(() => {
|
|
1372
|
-
const mergedProps = mergeProps(typeahead.reference,
|
|
1663
|
+
const mergedProps = mergeProps(typeahead.reference, openTriggerProps, dismiss.reference, { onMouseMove() {
|
|
1373
1664
|
store.set("allowMouseEnter", true);
|
|
1374
1665
|
} }, interactionTypeProps);
|
|
1375
1666
|
mergedProps["aria-haspopup"] = "menu";
|
|
@@ -1378,7 +1669,7 @@ const MenuRoot = fastComponent(function MenuRoot(props) {
|
|
|
1378
1669
|
}, [
|
|
1379
1670
|
store,
|
|
1380
1671
|
typeahead.reference,
|
|
1381
|
-
|
|
1672
|
+
openTriggerProps,
|
|
1382
1673
|
dismiss.reference,
|
|
1383
1674
|
interactionTypeProps,
|
|
1384
1675
|
open
|
|
@@ -1398,10 +1689,6 @@ const MenuRoot = fastComponent(function MenuRoot(props) {
|
|
|
1398
1689
|
return null;
|
|
1399
1690
|
});
|
|
1400
1691
|
const popupProps = React$1.useMemo(() => mergeProps(FOCUSABLE_POPUP_PROPS, {
|
|
1401
|
-
id: floatingId,
|
|
1402
|
-
role: "menu",
|
|
1403
|
-
"aria-orientation": orientation === "horizontal" ? "horizontal" : void 0,
|
|
1404
|
-
"aria-labelledby": activeTriggerElement?.id,
|
|
1405
1692
|
onMouseMove() {
|
|
1406
1693
|
store.set("allowMouseEnter", true);
|
|
1407
1694
|
if (parent.type === "menu") store.set("hoverEnabled", false);
|
|
@@ -1414,9 +1701,6 @@ const MenuRoot = fastComponent(function MenuRoot(props) {
|
|
|
1414
1701
|
if (relay && !event.isPropagationStopped()) relay(event);
|
|
1415
1702
|
}
|
|
1416
1703
|
}, typeahead.floating, listNavigation$1.floating, dismiss.floating), [
|
|
1417
|
-
activeTriggerElement,
|
|
1418
|
-
floatingId,
|
|
1419
|
-
orientation,
|
|
1420
1704
|
parent.type,
|
|
1421
1705
|
store,
|
|
1422
1706
|
typeahead.floating,
|
|
@@ -1433,27 +1717,56 @@ const MenuRoot = fastComponent(function MenuRoot(props) {
|
|
|
1433
1717
|
});
|
|
1434
1718
|
const context = React$1.useMemo(() => ({
|
|
1435
1719
|
store,
|
|
1436
|
-
parent: parentFromContext
|
|
1437
|
-
|
|
1438
|
-
|
|
1720
|
+
parent: parentFromContext,
|
|
1721
|
+
orientation,
|
|
1722
|
+
loopFocus,
|
|
1723
|
+
allowEscape,
|
|
1724
|
+
defaultFloatingId,
|
|
1725
|
+
setRenderedFloatingId,
|
|
1726
|
+
virtualFocus,
|
|
1727
|
+
parentVirtualFocus,
|
|
1728
|
+
syncHighlightedItem
|
|
1729
|
+
}), [
|
|
1730
|
+
store,
|
|
1731
|
+
parentFromContext,
|
|
1732
|
+
orientation,
|
|
1733
|
+
loopFocus,
|
|
1734
|
+
allowEscape,
|
|
1735
|
+
defaultFloatingId,
|
|
1736
|
+
virtualFocus,
|
|
1737
|
+
parentVirtualFocus,
|
|
1738
|
+
syncHighlightedItem
|
|
1739
|
+
]);
|
|
1740
|
+
const renderedChildren = typeof children === "function" ? children({ payload }) : children;
|
|
1741
|
+
let content = /*#__PURE__*/ jsxs(MenuRootContext.Provider, {
|
|
1439
1742
|
value: context,
|
|
1440
1743
|
children: [handle && /*#__PURE__*/ jsx(PopupHandleAttachment, {
|
|
1441
1744
|
handle,
|
|
1442
1745
|
store
|
|
1443
|
-
}),
|
|
1746
|
+
}), renderedChildren]
|
|
1444
1747
|
});
|
|
1445
|
-
if (parent.type === void 0 || parent.type === "context-menu")
|
|
1748
|
+
if (parent.type === void 0 || parent.type === "context-menu") content = /*#__PURE__*/ jsx(FloatingTree, {
|
|
1446
1749
|
externalTree: floatingTreeRoot,
|
|
1447
1750
|
children: content
|
|
1448
1751
|
});
|
|
1449
1752
|
return content;
|
|
1450
1753
|
});
|
|
1451
|
-
|
|
1452
|
-
function
|
|
1453
|
-
|
|
1754
|
+
MenuRootInternal.displayName = "MenuRootInternal";
|
|
1755
|
+
function MenuRoot(props) {
|
|
1756
|
+
const filterProvider = React$1.useContext(MenuFilterProviderContext);
|
|
1757
|
+
if (filterProvider === null) return /*#__PURE__*/ jsx(MenuRootInternal, { ...props });
|
|
1758
|
+
const FilterRoot = filterProvider.Root;
|
|
1759
|
+
return /*#__PURE__*/ jsx(MenuFilterProviderContext.Provider, {
|
|
1760
|
+
value: null,
|
|
1761
|
+
children: /*#__PURE__*/ jsx(FilterRoot, {
|
|
1762
|
+
...filterProvider.options,
|
|
1763
|
+
...props
|
|
1764
|
+
})
|
|
1765
|
+
});
|
|
1454
1766
|
}
|
|
1455
1767
|
//#endregion
|
|
1456
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1768
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/menu/submenu-root/MenuSubmenuRoot.mjs
|
|
1769
|
+
const EMPTY_SUBMENU_ROOT_CONTEXT = {};
|
|
1457
1770
|
/**
|
|
1458
1771
|
* Groups all parts of a submenu.
|
|
1459
1772
|
* Doesn't render its own HTML element.
|
|
@@ -1461,48 +1774,60 @@ function useMenuRootStore(initialState, floatingId, nested) {
|
|
|
1461
1774
|
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
1462
1775
|
*/
|
|
1463
1776
|
function MenuSubmenuRoot(props) {
|
|
1464
|
-
|
|
1465
|
-
const
|
|
1777
|
+
useMenuRootContext();
|
|
1778
|
+
const filterProvider = React$1.useContext(MenuFilterProviderContext);
|
|
1779
|
+
if (filterProvider !== null) {
|
|
1780
|
+
const FilterSubmenuRoot = filterProvider.SubmenuRoot;
|
|
1781
|
+
return /*#__PURE__*/ jsx(MenuFilterProviderContext.Provider, {
|
|
1782
|
+
value: null,
|
|
1783
|
+
children: /*#__PURE__*/ jsx(FilterSubmenuRoot, {
|
|
1784
|
+
...filterProvider.options,
|
|
1785
|
+
...props
|
|
1786
|
+
})
|
|
1787
|
+
});
|
|
1788
|
+
}
|
|
1466
1789
|
return /*#__PURE__*/ jsx(MenuSubmenuRootContext.Provider, {
|
|
1467
|
-
value:
|
|
1468
|
-
children: /*#__PURE__*/ jsx(
|
|
1790
|
+
value: EMPTY_SUBMENU_ROOT_CONTEXT,
|
|
1791
|
+
children: /*#__PURE__*/ jsx(MenuRootInternal, {
|
|
1792
|
+
...props,
|
|
1793
|
+
isSubmenu: true
|
|
1794
|
+
})
|
|
1469
1795
|
});
|
|
1470
1796
|
}
|
|
1471
1797
|
//#endregion
|
|
1472
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1798
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/menu/utils/findRootOwnerId.mjs
|
|
1473
1799
|
function findRootOwnerId(node) {
|
|
1474
1800
|
if (isHTMLElement(node) && node.hasAttribute("data-rootownerid")) return node.getAttribute("data-rootownerid");
|
|
1475
1801
|
if (isLastTraversableNode(node)) return;
|
|
1476
1802
|
return findRootOwnerId(getParentNode(node));
|
|
1477
1803
|
}
|
|
1478
1804
|
//#endregion
|
|
1479
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1805
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/menu/submenu-trigger/MenuSubmenuTrigger.mjs
|
|
1480
1806
|
const VOICE_OVER_EXPANDED_PROPS = { "aria-expanded": void 0 };
|
|
1481
|
-
|
|
1482
|
-
* A menu item that opens a submenu.
|
|
1483
|
-
* Renders a `<div>` element.
|
|
1484
|
-
*
|
|
1485
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
1486
|
-
*/
|
|
1487
|
-
const MenuSubmenuTrigger = /*#__PURE__*/ React$1.forwardRef(function MenuSubmenuTrigger(componentProps, forwardedRef) {
|
|
1807
|
+
const MenuSubmenuTriggerPlain = /*#__PURE__*/ React$1.forwardRef(function MenuSubmenuTriggerPlain(componentProps, forwardedRef) {
|
|
1488
1808
|
const { render, className, style, label, id: idProp, nativeButton = false, openOnHover = true, delay = 100, closeDelay = 0, disabled: disabledProp = false, ...elementProps } = componentProps;
|
|
1809
|
+
const context = useMenuRootContext(true);
|
|
1810
|
+
if (context?.parent.type !== "menu") throw new Error("Base UI: <Menu.SubmenuTrigger> must be placed in <Menu.SubmenuRoot>.");
|
|
1811
|
+
const menuPositionerContext = useMenuPositionerContext();
|
|
1489
1812
|
const submenuRootContext = useMenuSubmenuRootContext();
|
|
1490
|
-
|
|
1813
|
+
const { store, parentVirtualFocus } = context;
|
|
1814
|
+
const parentMenuStore = context.parent.store;
|
|
1491
1815
|
const listItem = useCompositeListItem({
|
|
1492
1816
|
guess: true,
|
|
1493
1817
|
label
|
|
1494
1818
|
});
|
|
1495
|
-
const menuPositionerContext = useMenuPositionerContext();
|
|
1496
|
-
const { store } = useMenuRootContext();
|
|
1497
1819
|
const thisTriggerId = useBaseUiId(idProp);
|
|
1498
1820
|
const open = store.useState("open");
|
|
1821
|
+
const focusReturnedThroughGuardRef = React$1.useRef(false);
|
|
1822
|
+
const positionerElement = store.useState("positionerElement");
|
|
1499
1823
|
const floatingRootContext = store.useState("floatingRootContext");
|
|
1500
1824
|
const floatingTreeRoot = store.useState("floatingTreeRoot");
|
|
1501
1825
|
const popupId = store.useState("triggerPopupId", thisTriggerId);
|
|
1502
1826
|
const baseRegisterTrigger = useTriggerRegistration(thisTriggerId, store);
|
|
1503
1827
|
const registerTrigger = useStableCallback((element) => {
|
|
1504
1828
|
baseRegisterTrigger(element);
|
|
1505
|
-
|
|
1829
|
+
const activeTriggerElement = store.select("activeTriggerElement");
|
|
1830
|
+
if (element !== null && store.select("open") && (activeTriggerElement === element || store.select("activeTriggerId") == null)) store.update({
|
|
1506
1831
|
activeTriggerId: thisTriggerId ?? null,
|
|
1507
1832
|
activeTriggerElement: element,
|
|
1508
1833
|
closeDelay
|
|
@@ -1521,8 +1846,22 @@ const MenuSubmenuTrigger = /*#__PURE__*/ React$1.forwardRef(function MenuSubmenu
|
|
|
1521
1846
|
thisTriggerId,
|
|
1522
1847
|
store
|
|
1523
1848
|
]);
|
|
1849
|
+
useIsoLayoutEffect(() => {
|
|
1850
|
+
if (!open || !positionerElement) return;
|
|
1851
|
+
function handleGuardFocusOut(event) {
|
|
1852
|
+
if (getTarget(event) === store.context.beforeContentFocusGuardRef.current) focusReturnedThroughGuardRef.current = event.relatedTarget === triggerElementRef.current;
|
|
1853
|
+
}
|
|
1854
|
+
positionerElement.addEventListener("focusout", handleGuardFocusOut, true);
|
|
1855
|
+
return () => {
|
|
1856
|
+
focusReturnedThroughGuardRef.current = false;
|
|
1857
|
+
positionerElement.removeEventListener("focusout", handleGuardFocusOut, true);
|
|
1858
|
+
};
|
|
1859
|
+
}, [
|
|
1860
|
+
open,
|
|
1861
|
+
positionerElement,
|
|
1862
|
+
store
|
|
1863
|
+
]);
|
|
1524
1864
|
store.useSyncedValue("closeDelay", closeDelay);
|
|
1525
|
-
const parentMenuStore = submenuRootContext.parentMenu;
|
|
1526
1865
|
const rootDisabled = store.useState("disabled");
|
|
1527
1866
|
const parentDisabled = parentMenuStore.useState("disabled");
|
|
1528
1867
|
const disabled = disabledProp || rootDisabled || parentDisabled;
|
|
@@ -1537,8 +1876,8 @@ const MenuSubmenuTrigger = /*#__PURE__*/ React$1.forwardRef(function MenuSubmenu
|
|
|
1537
1876
|
const highlighted = parentMenuStore.useState("isActive", listItem.index);
|
|
1538
1877
|
const itemMetadata = React$1.useMemo(() => ({
|
|
1539
1878
|
type: "submenu-trigger",
|
|
1540
|
-
setActive() {
|
|
1541
|
-
if (parentMenuStore.select("highlightItemOnHover")) parentMenuStore.
|
|
1879
|
+
setActive(event) {
|
|
1880
|
+
if (parentMenuStore.select("highlightItemOnHover")) parentMenuStore.setActiveIndex(listItem.index, pointer, event);
|
|
1542
1881
|
}
|
|
1543
1882
|
}), [parentMenuStore, listItem.index]);
|
|
1544
1883
|
const { getItemProps, itemRef } = useMenuItem({
|
|
@@ -1572,9 +1911,9 @@ const MenuSubmenuTrigger = /*#__PURE__*/ React$1.forwardRef(function MenuSubmenu
|
|
|
1572
1911
|
const localInteractionProps = useClick(floatingRootContext, {
|
|
1573
1912
|
enabled: !disabled,
|
|
1574
1913
|
event: "mousedown",
|
|
1575
|
-
toggle:
|
|
1914
|
+
toggle: true,
|
|
1576
1915
|
ignoreMouse: openOnHover,
|
|
1577
|
-
stickIfOpen:
|
|
1916
|
+
stickIfOpen: openOnHover
|
|
1578
1917
|
}).reference ?? EMPTY_OBJECT;
|
|
1579
1918
|
const rootTriggerProps = store.useState("triggerProps", true);
|
|
1580
1919
|
delete rootTriggerProps.id;
|
|
@@ -1585,6 +1924,8 @@ const MenuSubmenuTrigger = /*#__PURE__*/ React$1.forwardRef(function MenuSubmenu
|
|
|
1585
1924
|
};
|
|
1586
1925
|
const openMethod = store.useState("openMethod");
|
|
1587
1926
|
const openedByKeyboard = store.useState("lastOpenChangeReason") === "list-navigation" || openMethod === "keyboard";
|
|
1927
|
+
const shouldOmitExpanded = open && openedByKeyboard && voiceOver;
|
|
1928
|
+
const submenuKeyDownProps = submenuRootContext?.onTriggerKeyDown ? { onKeyDown: submenuRootContext.onTriggerKeyDown } : void 0;
|
|
1588
1929
|
return useRenderElement("div", componentProps, {
|
|
1589
1930
|
state,
|
|
1590
1931
|
stateAttributesMapping: triggerOpenStateMapping,
|
|
@@ -1592,13 +1933,20 @@ const MenuSubmenuTrigger = /*#__PURE__*/ React$1.forwardRef(function MenuSubmenu
|
|
|
1592
1933
|
localInteractionProps,
|
|
1593
1934
|
hoverProps,
|
|
1594
1935
|
rootTriggerProps,
|
|
1936
|
+
submenuKeyDownProps,
|
|
1595
1937
|
itemProps,
|
|
1596
|
-
|
|
1938
|
+
shouldOmitExpanded ? VOICE_OVER_EXPANDED_PROPS : void 0,
|
|
1597
1939
|
{
|
|
1598
1940
|
"aria-controls": popupId,
|
|
1599
|
-
tabIndex: open || highlighted ?
|
|
1941
|
+
tabIndex: parentVirtualFocus || !(open || highlighted) ? -1 : 0,
|
|
1942
|
+
onFocus(event) {
|
|
1943
|
+
if (store.select("open") && focusReturnedThroughGuardRef.current) {
|
|
1944
|
+
focusReturnedThroughGuardRef.current = false;
|
|
1945
|
+
store.setOpen(false, createChangeEventDetails(focusOut, event.nativeEvent));
|
|
1946
|
+
}
|
|
1947
|
+
},
|
|
1600
1948
|
onBlur() {
|
|
1601
|
-
if (highlighted) parentMenuStore.
|
|
1949
|
+
if (highlighted) parentMenuStore.setActiveIndex(null, none);
|
|
1602
1950
|
}
|
|
1603
1951
|
},
|
|
1604
1952
|
elementProps,
|
|
@@ -1613,6 +1961,16 @@ const MenuSubmenuTrigger = /*#__PURE__*/ React$1.forwardRef(function MenuSubmenu
|
|
|
1613
1961
|
]
|
|
1614
1962
|
});
|
|
1615
1963
|
});
|
|
1964
|
+
MenuSubmenuTriggerPlain.displayName = "MenuSubmenuTriggerPlain";
|
|
1965
|
+
const MenuSubmenuTrigger = /*#__PURE__*/ React$1.forwardRef(function MenuSubmenuTrigger(props, forwardedRef) {
|
|
1966
|
+
const filterItem = useMenuFilterItem(props, forwardedRef, "submenu-trigger");
|
|
1967
|
+
if (!filterItem.visible) return null;
|
|
1968
|
+
const mergedProps = filterItem.props ? mergeProps(filterItem.props, props) : props;
|
|
1969
|
+
return /*#__PURE__*/ jsx(MenuSubmenuTriggerPlain, {
|
|
1970
|
+
...mergedProps,
|
|
1971
|
+
ref: filterItem.ref
|
|
1972
|
+
});
|
|
1973
|
+
});
|
|
1616
1974
|
MenuSubmenuTrigger.displayName = "MenuSubmenuTrigger";
|
|
1617
1975
|
//#endregion
|
|
1618
|
-
export { useMenuPositionerContext as S,
|
|
1976
|
+
export { useMenuFilterImpl as A, MenuGroupLabel as C, MenuCheckboxItem as D, MenuCheckboxItemIndicator as E, useMenuRootContext as F, useMenuPositionerContext as I, ContextMenuRootContext as M, useContextMenuRootContext as N, MenuCheckboxItemDataAttributes_exports as O, MenuRootContext as P, MenuItem as S, MenuGroupPlain as T, resolvePopupLabel as _, MenuRootInternal as a, useMenuSubmenuRootContext as b, createNullMenuStore as c, MenuRadioGroup as d, MenuRadioGroupPlain as f, MenuPopupPlain as g, MenuPopup as h, MenuRoot as i, useMenuFilterPart as j, MenuFilterImplContext as k, MenuRadioItemIndicator as l, MenuPortal as m, findRootOwnerId as n, isKeyboardOpen as o, MenuPositioner as p, MenuSubmenuRoot as r, MenuFilterProviderContext as s, MenuSubmenuTrigger as t, MenuRadioItem as u, useRenderedId as v, MenuGroup as w, MenuLinkItem as x, MenuSubmenuRootContext as y };
|