@cloudflare/kumo 2.13.2 → 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 +76 -0
- package/README.md +2 -2
- package/ai/component-registry.json +792 -64
- package/ai/component-registry.md +1666 -224
- package/ai/schemas.ts +110 -3
- package/dist/.build-complete +1 -1
- package/dist/ai/schemas.d.ts +360 -69
- package/dist/ai/schemas.js +216 -23
- 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/catalog.d.ts +11 -11
- package/dist/chunks/{index.parts-ef9111sjk9e3al87.js → AccordionPanelDataAttributes-mmrmkky28u1010l5.js} +189 -120
- package/dist/chunks/{AlertDialogTrigger-k3f8nevrda6awa4s.js → AlertDialogTrigger-l1r1gbxcky1xq889.js} +5 -5
- package/dist/chunks/AlertDialogTriggerDataAttributes-go49qon601catpgn.js +56 -0
- package/dist/chunks/{AutocompleteItem-ksckpihly1c23f3j.js → AutocompleteItem-36ysm5nwbsd0snr6.js} +17 -29
- package/dist/chunks/AutocompleteItemDataAttributes-n5rigpf0s9ylnwi3.js +232 -0
- package/dist/chunks/AutocompleteSeparator-bnqeqh7i983d92gx.js +12 -0
- package/dist/chunks/{index.parts-i4iu310eo65d7lfc.js → AvatarImageDataAttributes-jw70u384c83lhqfp.js} +111 -35
- package/dist/chunks/{Button-oczevl8g75m85ew9.js → ButtonDataAttributes-nceand1fi7lvnmkb.js} +12 -4
- package/dist/chunks/{CSPContext-guqghj8kxoukvlky.js → CSPContext-iv67i0qqhihg8mur.js} +1 -7
- package/dist/chunks/{CSPProvider-f3it239kgztzgryk.js → CSPProvider-finau3a8hnc9o2td.js} +2 -2
- package/dist/chunks/{CheckboxGroup-g5xn5gnq8ocqyoum.js → CheckboxGroup-581mfftu99wvjb3a.js} +58 -45
- package/dist/chunks/{CheckboxGroupContext-f9wox07n2u5moq4h.js → CheckboxGroupContext-jf1bt3znvqlhrql6.js} +3 -5
- package/dist/chunks/CheckboxGroupDataAttributes-nskqcxts64symbvf.js +10 -0
- package/dist/chunks/{CheckboxRoot-o5bfpje6e4p6pdgm.js → CheckboxIndicator-i13dmhacfgqo328c.js} +187 -134
- package/dist/chunks/CheckboxIndicatorDataAttributes-3p29ju7nkczz1l2y.js +85 -0
- package/dist/chunks/{CollapsiblePanel-e80n35tnsb2cskt9.js → CollapsiblePanel-md5suzmtnsyz1kab.js} +39 -38
- package/dist/chunks/CollapsibleRootDataAttributes-bynmgxmt4jikaoha.js +36 -0
- package/dist/chunks/{ComboboxClear-glm805v81uaaf3su.js → ComboboxClear-ioejwvtnmqanph88.js} +91 -99
- package/dist/chunks/ComboboxClearDataAttributes-lo0enstdmrqpywsy.js +402 -0
- package/dist/chunks/{ComboboxEmpty-hwv2kjxnf9un635e.js → ComboboxEmpty-gkt1y5b81a4983v7.js} +770 -702
- package/dist/chunks/ComboboxItemIndicatorDataAttributes-iku7l9ig0ve09an4.js +259 -0
- package/dist/chunks/{ComboboxPopup-fx7xex6g75t9u0gm.js → ComboboxPopup-n8cbgys9st446j1i.js} +57 -57
- package/dist/chunks/{CompositeItem-l7zee38lq5m224d5.js → CompositeItem-kepwg8jtvgap06o6.js} +4 -7
- package/dist/chunks/CompositeList-gwuaf6d14s4da0j0.js +182 -0
- package/dist/chunks/{CompositeListContext-oetjj2x8li8678as.js → CompositeListContext-bejvmlu39hsfjzgu.js} +2 -5
- package/dist/chunks/{CompositeRoot-l6ot8jo0umdics5m.js → CompositeRoot-dnlkb27uw4g5aocf.js} +61 -63
- package/dist/chunks/{CompositeRootContext-ofhzmevv7hadjhyy.js → CompositeRootContext-obm54j7y6s86qwhq.js} +1 -1
- package/dist/chunks/{index.parts-bv57na43ve93uz3x.js → ContextMenuTriggerDataAttributes-xwozccynxv6pk5s0.js} +82 -37
- package/dist/chunks/DialogBackdropDataAttributes-jwqxd6jla03xh8ke.js +28 -0
- package/dist/chunks/DialogCloseDataAttributes-12m7gwh3i6fd7d05.js +76 -0
- package/dist/chunks/{DialogPopup-mp89aob2nown2akq.js → DialogPopup-n6w7b389e7bs0472.js} +31 -72
- package/dist/chunks/DialogRoot-hkkqj7vcjpkx8qk8.js +16 -0
- package/dist/chunks/{DialogTrigger-cmok07cf3ks0kzug.js → DialogTrigger-kpugfkbfswqrus4u.js} +23 -20
- package/dist/chunks/DialogTriggerDataAttributes-bp9bu13cvwuddh5b.js +18 -0
- package/dist/chunks/DialogViewportDataAttributes-mma9emv1edsc1vuy.js +78 -0
- package/dist/chunks/{DirectionContext-jc1g0w645603sd6p.js → DirectionContext-kpby968j030psajn.js} +1 -4
- package/dist/chunks/{DirectionProvider-ihtfgxd5qpm6oth1.js → DirectionProvider-cg0pwzgdyg6r73r6.js} +2 -2
- package/dist/chunks/DrawerViewport-mzqpwvqtylnad8ib.js +1532 -0
- package/dist/chunks/DrawerViewportDataAttributes-dd9593zm9fl9vcsm.js +1072 -0
- package/dist/chunks/FieldControl-hjj2tcqruozadgdi.js +122 -0
- package/dist/chunks/{FieldDescription-ju607ea6gwgzga8p.js → FieldDescription-orix2gepowrp5ni4.js} +13 -12
- package/dist/chunks/{FieldItemContext-j85dc0ihramj5ezs.js → FieldItemContext-ohsf45im6xhpay40.js} +1 -1
- package/dist/chunks/FieldItemDataAttributes-m52srx69pispz49i.js +283 -0
- package/dist/chunks/FieldLabel-fjc7tdis7rcbq8o4.js +353 -0
- package/dist/chunks/{FieldsetLegend-j5piwq1giyhrr8s4.js → FieldsetLegend-gl9z9eezr0xg9zr7.js} +7 -14
- package/dist/chunks/FieldsetLegendDataAttributes-fn20251jxjqkpkxm.js +17 -0
- package/dist/chunks/{FieldsetRootContext-b633e9uzilttuyfi.js → FieldsetRootContext-fphwizvcm55ydg94.js} +1 -1
- package/dist/chunks/{FloatingPortalLite-mlt7ztrvhzepwi5y.js → FloatingPortalLite-j7dsy7gokbxdoe1i.js} +3 -3
- package/dist/chunks/{popupStateMapping-hdv48wmkzb2mqful.js → FloatingRootStore-men6ufp3a2b296fh.js} +215 -243
- package/dist/chunks/{FloatingTree-oosjswl1s9q4obvg.js → FloatingTree-kiyzavvaum442o1s.js} +6 -6
- package/dist/chunks/Form-oz425k7r4abea8o4.js +113 -0
- package/dist/chunks/{FormContext-xz0b4h7ue30fkkn1.js → FormContext-jv19engyccpf6xcl.js} +4 -3
- package/dist/chunks/{Input-ovqfhsmpfcrg5czm.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-hetas2e4y0kywfas.js → LabelableContext-dz4wz3lu3lgqusu7.js} +50 -46
- package/dist/chunks/ListboxSeparator-skazx18vzzj7i9zp.js +21 -0
- package/dist/chunks/MenuClearDataAttributes-fo0pekd36n56mdxu.js +1645 -0
- package/dist/chunks/{MenuSubmenuTrigger-fzubf5xr7ohsgsi7.js → MenuSubmenuTrigger-hm5xbgik6aq95x35.js} +917 -473
- package/dist/chunks/MenuSubmenuTriggerDataAttributes-gdfxdjymgmnaxdds.js +372 -0
- package/dist/chunks/{MenuTrigger-ntugq34yppc8ouwe.js → MenuTrigger-dlfvicsaggss0o9m.js} +45 -46
- package/dist/chunks/{Menubar-d57cyjuztbge4dvv.js → Menubar-ja5int05ihjj0ra4.js} +29 -30
- package/dist/chunks/{MenubarContext-ei2r6vu6lmsspozo.js → MenubarContext-ooz0h08i55c8oip5.js} +1 -1
- package/dist/chunks/{MeterLabel-c40b0q8r81cftkjj.js → MeterLabel-cykbkvqys5263z05.js} +15 -18
- package/dist/chunks/{index.parts-fl4zaorc97ed3keb.js → NavigationMenuIconDataAttributes-l82pkpm61d0meqxf.js} +470 -278
- package/dist/chunks/NullStore-my62xo2vfcfkerri.js +110 -0
- package/dist/chunks/{index.parts-7z8hqx6zl9yajzvs.js → NumberFieldScrubAreaCursorDataAttributes-k2lsbk35svshnwf5.js} +592 -528
- package/dist/chunks/{index.parts-bmzuqorz0tmneh7t.js → OTPFieldInputDataAttributes-gvgtu2gg85kgjzwr.js} +189 -70
- package/dist/chunks/{PopoverClose-e91n3nkw16qnyese.js → PopoverViewport-peh28i8q4hqfjy97.js} +271 -224
- package/dist/chunks/PopoverViewportDataAttributes-gplhq9d7ffp9q8u3.js +329 -0
- package/dist/chunks/PrehydrationScript-hs2je3mndbxuts7w.js +78 -0
- package/dist/chunks/{index.parts-nd3mitrhxf806lsa.js → PreviewCardViewportDataAttributes-bgfwmyshey7fx6nr.js} +369 -147
- package/dist/chunks/ProgressLabelDataAttributes-j8mutcz11ei0ohvj.js +287 -0
- package/dist/chunks/{RadioGroup-lsix4haqxfigpuv8.js → RadioGroup-kioqngmmuo7a1lfa.js} +49 -51
- package/dist/chunks/{RadioGroupContext-ft0nndmzqynjz8a2.js → RadioGroupContext-dr6uihsj7oky0eol.js} +1 -1
- package/dist/chunks/RadioGroupDataAttributes-dpdr6xe4ve204qwb.js +10 -0
- package/dist/chunks/{RadioIndicator-mwkahpwyqfc6yk1i.js → RadioIndicator-bhxqih8wzv7hyrec.js} +108 -105
- package/dist/chunks/RadioIndicatorDataAttributes-n5yupp5psifu0d4f.js +80 -0
- package/dist/chunks/{ScrollAreaThumb-kmhan411yxfo0362.js → ScrollAreaThumb-hxig41yn4lrurd3o.js} +373 -389
- package/dist/chunks/ScrollAreaThumbDataAttributes-gup5wfxvqye6jj27.js +137 -0
- package/dist/chunks/SelectScrollUpArrowDataAttributes-fce5i1afjkb0necr.js +473 -0
- package/dist/chunks/{SelectGroupLabel-m4h5hrft9043nsd1.js → SelectSeparator-nnak70azojox8b2b.js} +593 -561
- package/dist/chunks/{Separator-b8wf5rea6m1cei8k.js → Separator-fhwve0tfny3tht3a.js} +2 -2
- package/dist/chunks/SeparatorDataAttributes-ch6e63bas7zflw00.js +11 -0
- package/dist/chunks/{index.parts-hxjt52jbictdzgad.js → SliderIndicator-h1o3qbrvr8x0t4t2.js} +341 -399
- package/dist/chunks/SliderIndicatorDataAttributes-ff2f1cjealif5nvo.js +240 -0
- package/dist/chunks/{SwitchRoot-e3hnyh3mf8qd30hj.js → SwitchRoot-m4t2tq5zn5wibyxk.js} +96 -89
- package/dist/chunks/SwitchThumbDataAttributes-f95ld864on9y6ptk.js +90 -0
- package/dist/chunks/{TabsList-c0inft3sf8gi2o4v.js → TabsList-n5n93rxr4sy704u8.js} +225 -178
- package/dist/chunks/TabsListDataAttributes-e03a7kbubuf02z1l.js +183 -0
- package/dist/chunks/ToastArrowDataAttributes-jbnvz3kp6a35slgj.js +136 -0
- package/dist/chunks/{Toggle-c8p9m3puz8l4mav7.js → ToggleDataAttributes-jl9ojyvwgrvefke6.js} +28 -14
- package/dist/chunks/{ToggleGroupContext-cdk2zo6ciddpockn.js → ToggleGroupContext-hg8zbkgqpscqhz83.js} +3 -5
- package/dist/chunks/{ToggleGroup-xz9zrh7t1htn6ht4.js → ToggleGroupDataAttributes-n1dwona1alvabstl.js} +35 -39
- package/dist/chunks/{ToolbarGroupContext-nriz3632ymugfj6h.js → ToolbarGroupContext-eawva8xkxb4osbxb.js} +3 -5
- package/dist/chunks/{ToolbarInput-er5t9irqvuwcjrir.js → ToolbarInput-kyxl1be0p3cyuayp.js} +28 -33
- package/dist/chunks/ToolbarInputDataAttributes-n4a18a4km735du04.js +150 -0
- package/dist/chunks/{ToolbarRootContext-lvi96r1vvs93rhde.js → ToolbarRootContext-difqbj720teyt8lu.js} +1 -1
- package/dist/chunks/{TooltipPopup-l2zrbjavf1cqclfx.js → TooltipPopup-furysmeyb68uycbz.js} +132 -161
- package/dist/chunks/{TooltipProvider-eyhgia63aq2x4frl.js → TooltipProvider-hyans0ens4axh1y8.js} +14 -17
- package/dist/chunks/TooltipViewportDataAttributes-gkwbezdq40ssuevg.js +312 -0
- package/dist/chunks/adaptiveOriginMiddleware-m9tqzw58wya9sdds.js +51 -0
- package/dist/chunks/{addEventListener-lhqvk2ahlzjsanyg.js → addEventListener-ku3x23446prmd1kz.js} +1 -1
- package/dist/chunks/areArraysEqual-nnpg93s9g7aqcaoh.js +15 -0
- package/dist/chunks/{autocomplete-dn6g4rc8bktdl4an.js → autocomplete-kgp17p6oz4pczxt9.js} +10 -10
- package/dist/chunks/{badge-xw5ydgdjx2o5qxbl.js → badge-kyz53p7p0ng393bs.js} +4 -2
- package/dist/chunks/{banner-n1ekcvrwashsgv93.js → banner-cpla8vqjxaulggyd.js} +3 -3
- package/dist/chunks/{breadcrumbs-ffwe8tzqzmpyikq5.js → breadcrumbs-oyuqwb09l08uhok2.js} +9 -17
- package/dist/chunks/button-group-biv43ksvaipc3p5n.js +59 -0
- package/dist/chunks/{button-h36q7tklakhd38nx.js → button-oxy32x5w9x9az80g.js} +25 -6
- package/dist/chunks/{chart-qmls2klknm1pd6hs.js → chart-foxl6xbubuoshfcs.js} +945 -54
- package/dist/chunks/{checkbox-jachq6akfh72x12r.js → checkbox-o9627970y7c9ciqy.js} +90 -37
- package/dist/chunks/clamp-rcpupxvhqrn8uuyf.js +7 -0
- package/dist/chunks/{clipboard-text-ms46uaujvkjmjnng.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-jyajpe40jcca357s.js → collapsible-ic6813hc4yv5s5hv.js} +2 -2
- package/dist/chunks/{combobox-hxarufzb1z61xnbv.js → combobox-hwrq8etkr7p2id0x.js} +13 -12
- package/dist/chunks/{command-palette-iomiziccabzh4ogg.js → command-palette-el4x943vpmid0po0.js} +9 -9
- package/dist/chunks/{composite-o65hjzwwzb4kvl4w.js → composite-c11t1ok72s3cggjc.js} +9 -21
- package/dist/chunks/{constants-j09lrtg73n4vlx5x.js → constants-l10cgj6pyqg27jod.js} +1 -1
- package/dist/chunks/{core-kjfqbvgicl9i3abf.js → core-n0de50o00ej2ecfe.js} +69 -55
- package/dist/chunks/createBaseUIEventDetails-nvee6bghv2reeqdb.js +50 -0
- package/dist/chunks/{ComboboxChipRemove-ksyozjezihhstmbu.js → createItems-n07tfwx89cdoar18.js} +125 -104
- package/dist/chunks/{createToastManager-kv89sv0xhhsvmq54.js → createToastManager-cxjmn4jx3ejh85fs.js} +353 -361
- package/dist/chunks/{css-d3t41yfupsmz7l1a.js → css-j501gxq1am2gnikh.js} +1 -1
- package/dist/chunks/{date-picker-fwe3vllwco4u1utz.js → date-picker-oee5ehsrepnlmltj.js} +58 -51
- package/dist/chunks/{date-range-picker-iymdx410i1hpvxai.js → date-range-picker-hpx3cdu9ve01jx6d.js} +16 -15
- package/dist/chunks/{dialog-o0164pgcyc74lvp9.js → dialog-lgrwmsumwpftp2u8.js} +14 -11
- package/dist/chunks/{dropdown-d5qrzj1w1a96w2we.js → dropdown-o875yxeqod7qp871.js} +134 -31
- package/dist/chunks/empty-ft85jcbs7fd5t3tn.js +96 -0
- package/dist/chunks/{engine-io35xsj9fgfxtihg.js → engine-hzmefiqm63hu0c7i.js} +2 -2
- package/dist/chunks/{engine-javascript-d795u677f1802oaf.js → engine-javascript-e9xj8hhz9xfqhpnu.js} +200 -185
- package/dist/chunks/{engine-oniguruma-xjlw46ay321yj1av.js → engine-oniguruma-ias56ildu01gf939.js} +8 -7
- package/dist/chunks/error-lbnic2b20qr3mukp.js +6 -0
- package/dist/chunks/{field-kgz7w7yixmtpg010.js → field-jzzlgre0jmrr38o2.js} +4 -4
- package/dist/chunks/{flow-fmfb3ri8cxo7w9ci.js → flow-imvwzp5p2f8y2dxm.js} +83 -63
- package/dist/chunks/formatNumber-b4kjdsebslm2b3t0.js +21 -0
- package/dist/chunks/{getCssDimensions-mi941fe1jvztqm6b.js → getCssDimensions-gckwdrp86f73cv51.js} +2 -2
- package/dist/chunks/getElementTransform-cz3jyftv0x5io95f.js +38 -0
- package/dist/chunks/getFiniteAnimations-jwd833ybtz81j5f0.js +13 -0
- package/dist/chunks/getHighlightReason-fhc53kq6qakcct9s.js +15 -0
- package/dist/chunks/{getPseudoElementBounds-jg72lmrlwgbqhmjh.js → getPseudoElementBounds-csuw8kwsoeyxd5tv.js} +13 -4
- package/dist/chunks/{github-light-kb466scjoy42qxpu.js → github-light-hir7yctc38258pwt.js} +1 -1
- package/dist/chunks/{graphql-gtqr4wytdf0qjybo.js → graphql-n9vlzkvcp2j19p7a.js} +1 -1
- package/dist/chunks/{grid-fjlo3wlpkwgw56y9.js → grid-nwiczrab3r4w0zr2.js} +1 -1
- package/dist/chunks/{html-ijyj3f9k0foag15c.js → html-nimj6ljkkifnc9ni.js} +2 -2
- package/dist/chunks/{index.parts-lz9cnngidxppvhz7.js → index.parts-db9pzsm9rrs9tp0t.js} +27 -40
- package/dist/chunks/{index.parts-i5twygaksh86erb7.js → index.parts-ggacwr0yakuemead.js} +7 -6
- package/dist/chunks/{index.parts-kt0w73ciea6adi2i.js → index.parts-pcg3pmf3yyro841t.js} +2 -2
- package/dist/chunks/{inertValue-f9pgp32jxnm88df3.js → inertValue-n09gkjvwwa1kddov.js} +2 -2
- package/dist/chunks/inline-copy-text-57r67slswfqvgbaf.js +104 -0
- package/dist/chunks/{input-group-kshukialqry0fmra.js → input-group-n08mcd8b36wbylro.js} +11 -8
- package/dist/chunks/{input-ikfimmpl5sngvh9s.js → input-il37wjigy2xtgdo2.js} +12 -11
- package/dist/chunks/{input-pehjmr1q131tz38w.js → input-ksy1w6j1m6olz6ck.js} +3 -3
- package/dist/chunks/{isElementDisabled-ffsy1y4adxocmexb.js → isElementDisabled-dyqutxpzdfppbohx.js} +1 -1
- package/dist/chunks/itemEquality-ki3x4tzdhjlqjey6.js +56 -0
- package/dist/chunks/{label-ie2gpde0nco1avi7.js → label-hugrtzreeqk5mtqu.js} +10 -6
- package/dist/chunks/{layer-card-dnikj7emx8qeaspz.js → layer-card-mar4dya5kl1vvie6.js} +6 -4
- package/dist/chunks/layer-dialog-dwrrgv1wasrerow4.js +406 -0
- package/dist/chunks/{link-gp4swsrd3vfnvori.js → link-h84bkh8eem39p529.js} +4 -4
- package/dist/chunks/{loader-j2v6fab8iucuxz1z.js → loader-kv5nk8j8tsuesxqo.js} +2 -6
- package/dist/chunks/locale-provider-e3310bgo4lnffqkd.js +41 -0
- package/dist/chunks/{menubar-ljbsj2ulayebjyza.js → menubar-m5pqhx7lu5z7mkks.js} +14 -13
- package/dist/chunks/{mergeCleanups-pexn3wul6a4zn873.js → mergeCleanups-nw73c6jfwl5tyhw4.js} +1 -1
- package/dist/chunks/{meter-fl03ece4glrrzizj.js → meter-poh8jpe0qtq6mvee.js} +2 -2
- package/dist/chunks/{pagination-i3jewbdolgru0xnr.js → pagination-h24on80p2z5ugqdb.js} +3 -3
- package/dist/chunks/{popover-jal8z9sv176703lf.js → popover-nqrt3ykqv6sic8pz.js} +71 -17
- package/dist/chunks/popupHandle-dk3ixgc8flr7v971.js +177 -0
- package/dist/chunks/popupStoreUtils-czfnxn051xakask5.js +868 -0
- package/dist/chunks/{portal-provider-gznk6snyqj6egd6d.js → portal-provider-eveknxf26oudn7pp.js} +4 -0
- package/dist/chunks/radio-d3pkrvsldfbdefav.js +203 -0
- package/dist/chunks/reason-parts-hssx64rmlxyn6gw5.js +40 -0
- package/dist/chunks/{resolveAriaLabelledBy-h9qwvo10ftlj6t9k.js → resolveAriaLabelledBy-knaucrjrjwnk7tvs.js} +1 -1
- package/dist/chunks/{resolveValueLabel-bq3nrzord518kp9q.js → resolveValueLabel-ntacnb58mhka5gg0.js} +11 -30
- package/dist/chunks/{safePolygon-szbj0u31i6mpt36d.js → safePolygon-ep4133qogeu5vjf3.js} +51 -49
- package/dist/chunks/{safeReact-bavzz23j5tex60z2.js → safeReact-ek77ilng4ekk7mgz.js} +2 -2
- package/dist/chunks/scrollable-k784b35i80aolmvg.js +29 -0
- package/dist/chunks/{select-ndqpqpmqtmn497rq.js → select-ey03k4630uckf1rk.js} +10 -11
- package/dist/chunks/{sensitive-input-jtbp3mvdynz9wewu.js → sensitive-input-lfrrtyg9n5ulq3tb.js} +23 -28
- package/dist/chunks/{serializeValue-ci3kihruew64i36f.js → serializeValue-d1otz2i7h5tygrwf.js} +1 -1
- package/dist/chunks/{sidebar-icky50wdc2b1biw8.js → sidebar-gluq5b5oacrdk4m4.js} +120 -40
- package/dist/chunks/{skeleton-line-hlk5vauzo7xsalbo.js → skeleton-line-gjf1fecmyy82aejz.js} +9 -6
- package/dist/chunks/slider-juwif2d8xa5n0429.js +87 -0
- package/dist/chunks/{sql-do9h6435gka97c4c.js → sql-hqp2eekl7qhmxe92.js} +1 -1
- package/dist/chunks/{stringifyLocale-cl8et9xf6zon4qbs.js → stringifyLocale-gbxouqj7ol627jxh.js} +1 -1
- package/dist/chunks/{styles-dbhgpd8fm76fdfo3.js → styles-eb8bvypmayf578jf.js} +2 -2
- package/dist/chunks/{surface-ef2kr5pn7r1y3ipk.js → surface-ginwpan1pz61l6k2.js} +2 -2
- package/dist/chunks/{switch-oghrd7f6i5jqar59.js → switch-mqf1ulvle4nd6d2t.js} +4 -4
- package/dist/chunks/{table-miggde3uqhhrd5at.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-mr2dsloqfe0io4a5.js → tabs-mmkz7q5rofnmogwt.js} +3 -3
- package/dist/chunks/tag-input-b10gfxoob9vcizpm.js +140 -0
- package/dist/chunks/{text-jzp4mdlr222iuzxt.js → text-me99rjbjkaff98gp.js} +4 -4
- package/dist/chunks/{toast-g435fvt74w5orxqo.js → toast-b4t9rt9y1sumcmy2.js} +8 -7
- package/dist/chunks/{toolbar-e0b61hr6ys6dmwhv.js → toolbar-hov6sa3ui366f447.js} +7 -6
- package/dist/chunks/{tooltip-jq15p5jzgfrhslpo.js → tooltip-lguwh8bjhxwnjfus.js} +4 -4
- package/dist/chunks/use-copy-feedback-gl55ghst0csvpv4j.js +55 -0
- package/dist/chunks/{useAnchoredPopupScrollLock-lbrqp1zm5z821z20.js → useAnchoredPopupScrollLock-msm8tzkewysnunut.js} +4 -4
- package/dist/chunks/{useAnimationFrame-ssgc72hyq6sg3yit.js → useAnimationFrame-k9lqdj9quln3sd85.js} +5 -4
- package/dist/chunks/{useAriaLabelledBy-bvw56m1d7czf0w3f.js → useAriaLabelledBy-j3j9jqlr9ukyk08s.js} +7 -9
- package/dist/chunks/{useBaseUiId-gqkl5ep5pn6hd0rw.js → useBaseUiId-nk4k7nj9h1cy76ny.js} +2 -2
- package/dist/chunks/{useButton-cpo6u2idqcnou6vy.js → useButton-lklvdzuhvj22bx07.js} +58 -21
- package/dist/chunks/{useClick-fvwb39qgead2jyft.js → useClick-pcbkcc7r620v1smu.js} +13 -12
- package/dist/chunks/{useCollapsiblePanel-bw63vwvq9a3sj73q.js → useCollapsiblePanel-lrfsgx21ds36cwlp.js} +116 -80
- package/dist/chunks/{useCompositeItem-esr3n4pmlssiuxuy.js → useCompositeItem-2juex3zh9gyrs8e9.js} +4 -4
- package/dist/chunks/useCompositeListItem-ekwo2j2rjkggg7xj.js +54 -0
- package/dist/chunks/{useControlled-nlx0kk1ksgk0auvi.js → useControlled-i3srnkxy598s0au9.js} +4 -4
- package/dist/chunks/useFieldValidation-oe16jiigp971yrzr.js +224 -0
- package/dist/chunks/{useFloatingRootContext-o6mk8fvodtbbm2v1.js → useFloatingRootContext-k676b6m7f80bdapd.js} +7 -7
- package/dist/chunks/{useFocus-gdfx28bn90keg8cf.js → useFocus-mn7a9t9v6fnlb4mf.js} +17 -15
- package/dist/chunks/useId-82z8yqlmc1hy1c5t.js +50 -0
- package/dist/chunks/useInitialLiveRegionTextMutation-nl2hus7zx1h7ggno.js +86 -0
- package/dist/chunks/{useLabel-nh9hf8h7o6oquqn5.js → useLabel-me6zzfvkypo458pi.js} +23 -12
- package/dist/chunks/useLabelableId-bjeh6q3pgrqjb7er.js +56 -0
- package/dist/chunks/{useListNavigation-jnxpvegv3ak857b1.js → useListNavigation-hpddbd0cc9pvt461.js} +62 -68
- package/dist/chunks/{useOnMount-j4wobeq47l3u9olo.js → useOnMount-gxggz1m0n869s6r0.js} +3 -3
- package/dist/chunks/{useOpenChangeComplete-dpkex2e23s1evpol.js → useOpenChangeComplete-edtabjwqmechsyv6.js} +51 -39
- package/dist/chunks/usePopupHandleStore-gawjmfjf1xdgiph3.js +27 -0
- package/dist/chunks/{usePopupViewport-hu0kn0ziyf1vqzrs.js → usePopupViewport-l6w01iohvzloghy8.js} +99 -75
- package/dist/chunks/{usePositioner-fz9uswhkhg22lo42.js → usePositioner-mzvgnazldqvy44z2.js} +160 -182
- package/dist/chunks/usePressAndHold-k9ynk78pgf677kpx.js +179 -0
- package/dist/chunks/{usePreviousValue-le0grv8f43vmunn1.js → usePreviousValue-o6swt5tb7xhpdu4e.js} +2 -2
- package/dist/chunks/{useRegisterFieldControl-m1rxsuvtpau2341n.js → useRegisterFieldControl-m1stc9l9y4cndf0k.js} +16 -10
- package/dist/chunks/{useRegisteredLabelId-dh83mybmzy75waje.js → useRegisteredLabelId-b7u9ygya03448zzn.js} +4 -4
- package/dist/chunks/{useRender-gtnbrp1ityffi4xf.js → useRender-h9ktka9xt4obdv6y.js} +2 -2
- package/dist/chunks/useRenderDialogRoot-bsqrqpc1ddau7xg4.js +312 -0
- package/dist/chunks/{useRenderElement-m8kc7jyuczp71mq8.js → useRenderElement-nkklxbq1rp7h2kw0.js} +59 -56
- package/dist/chunks/{useScrollLock-mpns3u42eks8hhex.js → useScrollLock-le7ajwlt7oh6fzxi.js} +108 -85
- package/dist/chunks/useSetFieldFocused-fbvj7gcv67dqfkp0.js +35 -0
- package/dist/chunks/{useStableCallback-ninxmksdjvwl6ejj.js → useStableCallback-le5qgj6p9l04729n.js} +3 -3
- package/dist/chunks/{useSwipeDismiss-bpbyw2ihsw3fw6y9.js → useSwipeDismiss-e8tfxzlp05p86mgb.js} +96 -217
- package/dist/chunks/{useTimeout-oqptmu2xmyv5ccic.js → useTimeout-f0ayn2l2l9aop4l8.js} +3 -3
- package/dist/chunks/{useTransitionStatus-ig4waxl2kervpyw4.js → useTransitionStatus-disysoblzgk34w14.js} +15 -7
- package/dist/chunks/{useTriggerFocusGuards-j8nano0pqu9dscrz.js → useTriggerFocusGuards-dyd3hb1m8en8ct50.js} +12 -21
- package/dist/chunks/useTriggerSwitchTransition-hk5j36hd5dq2ok6w.js +62 -0
- package/dist/chunks/{useTypeahead-onenwjyhgw955ygx.js → useTypeahead-kfdsw1ksl5bgvvzl.js} +20 -23
- package/dist/chunks/{useValueAsRef-lrn42zari17368c9.js → useValueAsRef-dv0tmfr1xlpzdlru.js} +3 -3
- package/dist/chunks/{useValueChanged-kthmz4wk7ywnjwtx.js → useValueChanged-fjssa2v6d4w8y332.js} +5 -8
- package/dist/chunks/{utils-0i7gujfv3f3e9dqh.js → utils-o44zfmzz9z7uyj1v.js} +0 -1
- package/dist/chunks/{valueToPercent-henpkkj3juy3ukeu.js → valueToPercent-djk2mqnihth2uvf6.js} +1 -1
- package/dist/chunks/{vendor-floating-ui-dsysdmve7iazaaes.js → vendor-floating-ui-fqblx3wa0r71mjoo.js} +87 -187
- package/dist/chunks/vendor-styling-gs32v7xt5znc8kg0.js +1167 -0
- package/dist/chunks/{vendor-utils-luqsvbyuig727bnr.js → vendor-utils-io8z5lsfxq8m2dcc.js} +191 -43
- package/dist/chunks/vesper-g839e590k3dxnwh3.js +5 -0
- package/dist/chunks/{visuallyHidden-n14xllazfozg55ox.js → visuallyHidden-kzzs9hbe93is3rci.js} +2 -1
- package/dist/chunks/{wasm-nfbosyhilcq70atf.js → wasm-cpasy0o9lsjrm39j.js} +1 -1
- package/dist/code/server.d.ts +9 -10
- package/dist/code/server.js +8 -7
- package/dist/code.d.ts +8 -8
- package/dist/code.js +23 -26
- 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.d.ts +2 -0
- package/dist/components/button-group.js +3 -0
- package/dist/components/button.js +1 -1
- package/dist/components/chart.d.ts +2 -2
- package/dist/components/chart.js +2 -2
- 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.d.ts +1 -1
- package/dist/components/combobox.js +1 -1
- package/dist/components/command-palette.d.ts +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.d.ts +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.d.ts +2 -0
- package/dist/components/inline-copy-text.js +3 -0
- package/dist/components/input-group.d.ts +1 -1
- package/dist/components/input-group.js +1 -1
- package/dist/components/input.d.ts +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 -0
- package/dist/components/layer-dialog.js +3 -0
- package/dist/components/link.d.ts +8 -9
- 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.d.ts +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/sensitive-input.d.ts +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.d.ts +1 -1
- package/dist/components/switch.js +1 -1
- package/dist/components/table-of-contents.d.ts +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.d.ts +1 -1
- package/dist/components/tabs.js +1 -1
- package/dist/components/tag-input.d.ts +2 -0
- package/dist/components/tag-input.js +3 -0
- package/dist/components/text.d.ts +1 -1
- package/dist/components/text.js +1 -1
- package/dist/components/toast.d.ts +1 -1
- package/dist/components/toast.js +2 -2
- package/dist/components/toolbar.d.ts +1 -1
- package/dist/components/toolbar.js +1 -1
- package/dist/components/tooltip.d.ts +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/{index-BXsHCLB82.d.ts → index--RbAKeBL.d.ts} +1 -1
- package/dist/index-5bJAnzUo.d.ts +156 -0
- package/dist/{index-BoPqM1Ia2.d.ts → index-AUC5xRcO.d.ts} +65 -8
- package/dist/{index-CeBzVJP8.d.ts → index-BK1tZgmP.d.ts} +1 -1
- package/dist/{index-CGbkysYW2.d.ts → index-BMe3cpLB.d.ts} +5 -4
- package/dist/{index-Di3sC6UF.d.ts → index-BW1HVU7T.d.ts} +34 -6
- package/dist/index-BWe6haHU.d.ts +64 -0
- package/dist/{index-BcRyiNd72.d.ts → index-BvNXYn7u.d.ts} +8 -1
- package/dist/index-C7RoG_CH.d.ts +57 -0
- package/dist/{index-D-y1ktn-.d.ts → index-CE09bLNb.d.ts} +5 -1
- package/dist/{index-DBlw3E9m.d.ts → index-CNJRbVxG.d.ts} +1 -1
- package/dist/{index-bAud6rG22.d.ts → index-CU_lnxg7.d.ts} +13 -4
- package/dist/index-CiwC1j1N.d.ts +37 -0
- package/dist/{index-Bw3M24Mi.d.ts → index-CrQi3QCY.d.ts} +2 -1
- package/dist/{index-Vj9ZzRh0.d.ts → index-DNsSKNUe.d.ts} +4 -1
- package/dist/{index-D97n4Bpf2.d.ts → index-DWZia2ui.d.ts} +1 -1
- package/dist/{index-J1qdw9mL.d.ts → index-DjSGDESy.d.ts} +36 -2
- package/dist/{index-_Sl5wohy2.d.ts → index-RP_rt8vB.d.ts} +1 -1
- package/dist/{index-Cp0aQngm.d.ts → index-T1sSoiWG.d.ts} +3 -1
- package/dist/{index-BlEUcijd.d.ts → index-fsZE0vPs.d.ts} +81 -1
- package/dist/index-jNWPjJl9.d.ts +75 -0
- package/dist/index.d.ts +36 -30
- package/dist/index.js +69 -59
- package/dist/{input-group-DpGSsAZy.d.ts → input-group-B3M_WRqm.d.ts} +1 -1
- package/dist/locale-provider-CAjVN3_0.d.ts +32 -0
- package/dist/{portal-provider-4AHCxYE6.d.ts → portal-provider-BAqPpq_a.d.ts} +4 -0
- 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 +2 -2
- package/dist/primitives.js +70 -42
- package/dist/scripts/theme-generator/config.d.ts +4 -5
- package/dist/scripts/theme-generator/types.d.ts +12 -13
- package/dist/styles/kumo-standalone.css +1 -1
- package/dist/{index-Dzzi1o7w2.d.ts → text-B4l7S5Z0.d.ts} +60 -1
- package/dist/{tooltip-BuCo6Ki4.d.ts → tooltip-D_vhi1PN.d.ts} +1 -1
- package/dist/{types-C402rKiz.d.ts → types-C6in2C8V.d.ts} +6 -3
- package/dist/utils.d.ts +3 -3
- package/dist/utils.js +5 -4
- package/package.json +27 -6
- package/scripts/component-registry/discovery.ts +4 -0
- package/scripts/component-registry/metadata.ts +75 -0
- package/scripts/generate-globe-land-mask.mjs +80 -0
- package/dist/chunks/CheckboxIndicator-igofmpn0wcfdqooa.js +0 -49
- package/dist/chunks/CompositeList-tx08unuok7wsl2d9.js +0 -129
- package/dist/chunks/DialogHandle-b3froel96o9fwjmm.js +0 -139
- package/dist/chunks/DialogRoot-fp7d16uxogvye294.js +0 -15
- package/dist/chunks/FieldControl-oz007qbkl6ejp7di.js +0 -104
- package/dist/chunks/FieldLabel-f6vwzm8nefzxwlh8.js +0 -558
- package/dist/chunks/Form-is7d5c1kbk1wn39s.js +0 -102
- package/dist/chunks/MenuBackdrop-dlntmavtopj7wv0l.js +0 -78
- package/dist/chunks/areArraysEqual-nlbeaqlzf4274zr3.js +0 -7
- package/dist/chunks/clamp-kvu4wtr1dw6b3pnd.js +0 -7
- package/dist/chunks/createBaseUIEventDetails-ddivuhl74gni72qn.js +0 -86
- package/dist/chunks/empty-ox60d384lkwbj5n4.js +0 -89
- package/dist/chunks/error-mm98alb8acdy93vq.js +0 -15
- package/dist/chunks/formatNumber-hjijm58g645q6a0n.js +0 -26
- package/dist/chunks/getEmptyRootContext-ekvv3rp5w16ewoqx.js +0 -18
- package/dist/chunks/index.parts-c5yto0l67i7ok5fd.js +0 -206
- package/dist/chunks/index.parts-cpviii2nt413tb8k.js +0 -30
- package/dist/chunks/index.parts-gj1k50tf9fcs7nru.js +0 -81
- package/dist/chunks/index.parts-gslyp9n88qdh38n1.js +0 -10
- package/dist/chunks/index.parts-hve0zir3biaolih0.js +0 -128
- package/dist/chunks/index.parts-i4lbjqdnhsnjtny6.js +0 -88
- package/dist/chunks/index.parts-ieuelcd4z5e0mcb7.js +0 -73
- package/dist/chunks/index.parts-j2ecf25zajyd5ia3.js +0 -11
- package/dist/chunks/index.parts-jmb5ztstw4xlfyp9.js +0 -46
- package/dist/chunks/index.parts-jv5kiaeixrjah9js.js +0 -119
- package/dist/chunks/index.parts-k7ezm98skegahepw.js +0 -2464
- package/dist/chunks/index.parts-komdbdvf823cm5jw.js +0 -41
- package/dist/chunks/index.parts-lhpuh6pw7rjcddnl.js +0 -156
- package/dist/chunks/index.parts-mr7tgwe4pgfozkt5.js +0 -245
- package/dist/chunks/index.parts-nc6jzjq91z2nye75.js +0 -11
- package/dist/chunks/index.parts-nzwjx603vcq1kryz.js +0 -127
- package/dist/chunks/index2.parts-kiwz8e3k8utvm4zb.js +0 -67
- package/dist/chunks/index2.parts-mv7x6w0p2splvf6b.js +0 -10
- package/dist/chunks/popupStoreUtils-jrxqkz5jmlijlr91.js +0 -367
- package/dist/chunks/radio-gvy6ekh5hu9awlru.js +0 -173
- package/dist/chunks/store-9b2cp7rx1dvq90fp.js +0 -88
- package/dist/chunks/useCompositeListItem-0exfww37ospqz69b.js +0 -75
- package/dist/chunks/useDismiss-kbtx2o3ruyh3jwgn.js +0 -353
- package/dist/chunks/useFilteredItems-ns32d3hpp626kt73.js +0 -183
- package/dist/chunks/useForcedRerendering-el1fbg3ib5yo0v7k.js +0 -14
- package/dist/chunks/useId-l9soitgw3e4jk5ie.js +0 -32
- package/dist/chunks/useIsHydrating-b6whcsimonagru6u.js +0 -22
- package/dist/chunks/useLabelableId-b1kwq9st3rjrtakn.js +0 -60
- package/dist/chunks/useRenderDialogRoot-hhowqeoreyr6uuc7.js +0 -262
- package/dist/chunks/vendor-styling-da1xibnxfkjmtglr.js +0 -3631
- package/dist/chunks/vesper-ho3j3gt6ilwfuc1g.js +0 -5
- package/dist/cn-DCSItmT-.d.ts +0 -5
- /package/dist/{index-AMEc1MEg2.d.ts → index-AMEc1MEg.d.ts} +0 -0
- /package/dist/{index-D2Gvly0i2.d.ts → index-D2Gvly0i.d.ts} +0 -0
- /package/dist/{index-DIV3riUd2.d.ts → index-DIV3riUd.d.ts} +0 -0
- /package/dist/{index-FCkuxSvs2.d.ts → index-FCkuxSvs.d.ts} +0 -0
|
@@ -1,40 +1,43 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
5
|
-
import { n as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { n as
|
|
9
|
-
import {
|
|
10
|
-
import { t as
|
|
11
|
-
import { t as
|
|
12
|
-
import {
|
|
13
|
-
import { t as
|
|
14
|
-
import { i as
|
|
15
|
-
import {
|
|
16
|
-
import { t as
|
|
17
|
-
import {
|
|
18
|
-
import { t as
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import { t as useTypeahead } from "./useTypeahead-
|
|
23
|
-
import { t as useBaseUiId } from "./useBaseUiId-
|
|
24
|
-
import { n as
|
|
25
|
-
import {
|
|
26
|
-
import { t as
|
|
27
|
-
import { t as
|
|
28
|
-
import { t as
|
|
29
|
-
import { t as
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import { t as
|
|
33
|
-
import {
|
|
34
|
-
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";
|
|
9
|
+
import { C as getParentNode, D as isLastTraversableNode, E as isHTMLElement } from "./vendor-floating-ui-fqblx3wa0r71mjoo.js";
|
|
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";
|
|
35
38
|
import * as React$1 from "react";
|
|
36
39
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
37
|
-
//#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
|
|
38
41
|
const MenuPositionerContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
39
42
|
MenuPositionerContext.displayName = "MenuPositionerContext";
|
|
40
43
|
function useMenuPositionerContext(optional) {
|
|
@@ -43,7 +46,7 @@ function useMenuPositionerContext(optional) {
|
|
|
43
46
|
return context;
|
|
44
47
|
}
|
|
45
48
|
//#endregion
|
|
46
|
-
//#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
|
|
47
50
|
const MenuRootContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
48
51
|
MenuRootContext.displayName = "MenuRootContext";
|
|
49
52
|
function useMenuRootContext(optional) {
|
|
@@ -52,7 +55,7 @@ function useMenuRootContext(optional) {
|
|
|
52
55
|
return context;
|
|
53
56
|
}
|
|
54
57
|
//#endregion
|
|
55
|
-
//#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
|
|
56
59
|
const ContextMenuRootContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
57
60
|
ContextMenuRootContext.displayName = "ContextMenuRootContext";
|
|
58
61
|
function useContextMenuRootContext(optional = true) {
|
|
@@ -61,7 +64,60 @@ function useContextMenuRootContext(optional = true) {
|
|
|
61
64
|
return context;
|
|
62
65
|
}
|
|
63
66
|
//#endregion
|
|
64
|
-
//#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
|
|
65
121
|
const MenuCheckboxItemContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
66
122
|
MenuCheckboxItemContext.displayName = "MenuCheckboxItemContext";
|
|
67
123
|
function useMenuCheckboxItemContext() {
|
|
@@ -70,22 +126,31 @@ function useMenuCheckboxItemContext() {
|
|
|
70
126
|
return context;
|
|
71
127
|
}
|
|
72
128
|
//#endregion
|
|
73
|
-
//#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
|
+
}
|
|
74
133
|
/**
|
|
75
134
|
* Returns common props shared by all menu item types.
|
|
76
|
-
* This hook extracts the shared logic for id, role, tabIndex,
|
|
77
|
-
* onMouseMove, onClick, and onMouseUp handlers.
|
|
135
|
+
* This hook extracts the shared logic for id, role, tabIndex, and interaction handlers.
|
|
78
136
|
*/
|
|
79
137
|
function useMenuItemCommonProps(params) {
|
|
80
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);
|
|
81
144
|
const { events: menuEvents } = store.useState("floatingTreeRoot");
|
|
82
145
|
const open = store.useState("open");
|
|
83
|
-
const contextMenuContext = useContextMenuRootContext(true);
|
|
84
146
|
const isContextMenu = contextMenuContext !== void 0;
|
|
147
|
+
const tabIndex = !virtualFocus && open && highlighted ? 0 : -1;
|
|
85
148
|
return React$1.useMemo(() => ({
|
|
86
149
|
id,
|
|
87
150
|
role: "menuitem",
|
|
88
|
-
tabIndex
|
|
151
|
+
tabIndex,
|
|
152
|
+
"aria-selected": ariaSelected,
|
|
153
|
+
onMouseDown: virtualFocus ? preventMouseDownDefault : void 0,
|
|
89
154
|
onKeyDown(event) {
|
|
90
155
|
if (event.key === " " && typingRef?.current) event.preventDefault();
|
|
91
156
|
},
|
|
@@ -98,7 +163,7 @@ function useMenuItemCommonProps(params) {
|
|
|
98
163
|
},
|
|
99
164
|
onClick(event) {
|
|
100
165
|
if (closeOnClick) menuEvents.emit("close", {
|
|
101
|
-
domEvent: event,
|
|
166
|
+
domEvent: event.nativeEvent,
|
|
102
167
|
reason: itemPress
|
|
103
168
|
});
|
|
104
169
|
},
|
|
@@ -110,31 +175,33 @@ function useMenuItemCommonProps(params) {
|
|
|
110
175
|
if (isContextMenu && !mac && event.button === 2) return;
|
|
111
176
|
}
|
|
112
177
|
if (itemRef.current && store.context.allowMouseUpTriggerRef.current && (!isContextMenu || event.button === 2)) {
|
|
113
|
-
if (
|
|
178
|
+
if (itemMetadata.type === "regular-item") dispatchClickWithModifiers(itemRef.current, event, {
|
|
179
|
+
detail: 1,
|
|
180
|
+
pointerType: "mouse"
|
|
181
|
+
});
|
|
114
182
|
}
|
|
115
183
|
}
|
|
116
184
|
}), [
|
|
117
185
|
closeOnClick,
|
|
118
|
-
|
|
186
|
+
tabIndex,
|
|
119
187
|
id,
|
|
120
188
|
menuEvents,
|
|
121
189
|
nodeId,
|
|
122
|
-
|
|
123
|
-
store,
|
|
190
|
+
store.context.allowMouseUpTriggerRef,
|
|
124
191
|
typingRef,
|
|
125
192
|
itemRef,
|
|
126
193
|
contextMenuContext,
|
|
127
194
|
isContextMenu,
|
|
128
|
-
itemMetadata
|
|
195
|
+
itemMetadata.type,
|
|
196
|
+
ariaSelected,
|
|
197
|
+
virtualFocus
|
|
129
198
|
]);
|
|
130
199
|
}
|
|
131
200
|
//#endregion
|
|
132
|
-
//#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
|
|
133
202
|
const REGULAR_ITEM = { type: "regular-item" };
|
|
134
203
|
function useMenuItem(params) {
|
|
135
|
-
const { closeOnClick, disabled
|
|
136
|
-
const rootDisabled = store.useState("disabled");
|
|
137
|
-
const disabled = disabledProp || rootDisabled;
|
|
204
|
+
const { closeOnClick, disabled, highlighted, id, store, typingRef = store.context.typingRef, nativeButton, itemMetadata, nodeId } = params;
|
|
138
205
|
const itemRef = React$1.useRef(null);
|
|
139
206
|
const { getButtonProps, buttonRef } = useButton({
|
|
140
207
|
disabled,
|
|
@@ -153,9 +220,9 @@ function useMenuItem(params) {
|
|
|
153
220
|
itemMetadata
|
|
154
221
|
});
|
|
155
222
|
const getItemProps = React$1.useCallback((externalProps) => {
|
|
156
|
-
return mergeProps(commonProps, { onMouseEnter() {
|
|
223
|
+
return mergeProps(commonProps, { onMouseEnter(event) {
|
|
157
224
|
if (itemMetadata.type !== "submenu-trigger") return;
|
|
158
|
-
itemMetadata.setActive();
|
|
225
|
+
itemMetadata.setActive(event.nativeEvent);
|
|
159
226
|
} }, externalProps, getButtonProps);
|
|
160
227
|
}, [
|
|
161
228
|
commonProps,
|
|
@@ -169,57 +236,53 @@ function useMenuItem(params) {
|
|
|
169
236
|
}), [getItemProps, mergedRef]);
|
|
170
237
|
}
|
|
171
238
|
//#endregion
|
|
172
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
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
|
+
});
|
|
246
|
+
/**
|
|
247
|
+
* Present when the menu checkbox item is checked.
|
|
248
|
+
*/
|
|
249
|
+
const checked = "data-checked";
|
|
250
|
+
/**
|
|
251
|
+
* Present when the menu checkbox item is not checked.
|
|
252
|
+
*/
|
|
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";
|
|
192
262
|
//#endregion
|
|
193
|
-
//#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
|
|
194
264
|
const itemMapping = {
|
|
195
265
|
checked(value) {
|
|
196
|
-
if (value) return { [
|
|
197
|
-
return { [
|
|
266
|
+
if (value) return { [checked]: "" };
|
|
267
|
+
return { [unchecked]: "" };
|
|
198
268
|
},
|
|
199
269
|
...transitionStatusMapping
|
|
200
270
|
};
|
|
201
271
|
//#endregion
|
|
202
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
* Renders a `<div>` element.
|
|
206
|
-
*
|
|
207
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
208
|
-
*/
|
|
209
|
-
const MenuCheckboxItem = /*#__PURE__*/ React$1.forwardRef(function MenuCheckboxItem(componentProps, forwardedRef) {
|
|
210
|
-
const { render, className, id: idProp, label, nativeButton = false, disabled = false, closeOnClick = false, checked: checkedProp, defaultChecked, onCheckedChange, style, ...elementProps } = componentProps;
|
|
211
|
-
const listItem = useCompositeListItem({ label });
|
|
212
|
-
const menuPositionerContext = useMenuPositionerContext(true);
|
|
213
|
-
const id = useBaseUiId(idProp);
|
|
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;
|
|
214
275
|
const { store } = useMenuRootContext();
|
|
276
|
+
const listItem = useCompositeListItem({
|
|
277
|
+
guess: true,
|
|
278
|
+
label
|
|
279
|
+
});
|
|
280
|
+
const id = useBaseUiId(idProp);
|
|
281
|
+
const rootDisabled = store.useState("disabled");
|
|
215
282
|
const highlighted = store.useState("isActive", listItem.index);
|
|
283
|
+
const nodeId = store.useState("floatingNodeId");
|
|
216
284
|
const itemProps = store.useState("itemProps");
|
|
217
|
-
const
|
|
218
|
-
controlled: checkedProp,
|
|
219
|
-
default: defaultChecked ?? false,
|
|
220
|
-
name: "MenuCheckboxItem",
|
|
221
|
-
state: "checked"
|
|
222
|
-
});
|
|
285
|
+
const disabled = disabledProp || rootDisabled;
|
|
223
286
|
const { getItemProps, itemRef } = useMenuItem({
|
|
224
287
|
closeOnClick,
|
|
225
288
|
disabled,
|
|
@@ -227,7 +290,7 @@ const MenuCheckboxItem = /*#__PURE__*/ React$1.forwardRef(function MenuCheckboxI
|
|
|
227
290
|
id,
|
|
228
291
|
store,
|
|
229
292
|
nativeButton,
|
|
230
|
-
nodeId
|
|
293
|
+
nodeId,
|
|
231
294
|
itemMetadata: REGULAR_ITEM
|
|
232
295
|
});
|
|
233
296
|
const state = React$1.useMemo(() => ({
|
|
@@ -240,10 +303,8 @@ const MenuCheckboxItem = /*#__PURE__*/ React$1.forwardRef(function MenuCheckboxI
|
|
|
240
303
|
checked
|
|
241
304
|
]);
|
|
242
305
|
function handleClick(event) {
|
|
243
|
-
const details = createChangeEventDetails(itemPress, event.nativeEvent, void 0, { preventUnmountOnClose
|
|
306
|
+
const details = createChangeEventDetails(itemPress, event.nativeEvent, void 0, { preventUnmountOnClose: NOOP });
|
|
244
307
|
onCheckedChange?.(!checked, details);
|
|
245
|
-
if (details.isCanceled) return;
|
|
246
|
-
setChecked((currentlyChecked) => !currentlyChecked);
|
|
247
308
|
}
|
|
248
309
|
const element = useRenderElement("div", componentProps, {
|
|
249
310
|
state,
|
|
@@ -269,9 +330,31 @@ const MenuCheckboxItem = /*#__PURE__*/ React$1.forwardRef(function MenuCheckboxI
|
|
|
269
330
|
children: element
|
|
270
331
|
});
|
|
271
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
|
+
});
|
|
272
355
|
MenuCheckboxItem.displayName = "MenuCheckboxItem";
|
|
273
356
|
//#endregion
|
|
274
|
-
//#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
|
|
275
358
|
/**
|
|
276
359
|
* Indicates whether the checkbox item is ticked.
|
|
277
360
|
* Renders a `<span>` element.
|
|
@@ -282,33 +365,36 @@ const MenuCheckboxItemIndicator = /*#__PURE__*/ React$1.forwardRef(function Menu
|
|
|
282
365
|
const { render, className, style, keepMounted = false, ...elementProps } = componentProps;
|
|
283
366
|
const item = useMenuCheckboxItemContext();
|
|
284
367
|
const indicatorRef = React$1.useRef(null);
|
|
285
|
-
const { transitionStatus, setMounted } = useTransitionStatus(item.checked);
|
|
368
|
+
const { transitionStatus, mounted, setMounted } = useTransitionStatus(item.checked);
|
|
286
369
|
useOpenChangeComplete({
|
|
370
|
+
batch: true,
|
|
371
|
+
enabled: !item.checked,
|
|
287
372
|
open: item.checked,
|
|
288
373
|
ref: indicatorRef,
|
|
289
374
|
onComplete() {
|
|
290
375
|
if (!item.checked) setMounted(false);
|
|
291
376
|
}
|
|
292
377
|
});
|
|
378
|
+
const state = {
|
|
379
|
+
checked: item.checked,
|
|
380
|
+
disabled: item.disabled,
|
|
381
|
+
highlighted: item.highlighted,
|
|
382
|
+
transitionStatus
|
|
383
|
+
};
|
|
293
384
|
return useRenderElement("span", componentProps, {
|
|
294
|
-
state
|
|
295
|
-
checked: item.checked,
|
|
296
|
-
disabled: item.disabled,
|
|
297
|
-
highlighted: item.highlighted,
|
|
298
|
-
transitionStatus
|
|
299
|
-
},
|
|
385
|
+
state,
|
|
300
386
|
ref: [forwardedRef, indicatorRef],
|
|
301
387
|
stateAttributesMapping: itemMapping,
|
|
302
388
|
props: {
|
|
303
389
|
"aria-hidden": true,
|
|
304
390
|
...elementProps
|
|
305
391
|
},
|
|
306
|
-
enabled: keepMounted ||
|
|
392
|
+
enabled: keepMounted || mounted
|
|
307
393
|
});
|
|
308
394
|
});
|
|
309
395
|
MenuCheckboxItemIndicator.displayName = "MenuCheckboxItemIndicator";
|
|
310
396
|
//#endregion
|
|
311
|
-
//#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
|
|
312
398
|
const MenuGroupContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
313
399
|
MenuGroupContext.displayName = "MenuGroupContext";
|
|
314
400
|
function useMenuGroupRootContext() {
|
|
@@ -317,14 +403,11 @@ function useMenuGroupRootContext() {
|
|
|
317
403
|
return context;
|
|
318
404
|
}
|
|
319
405
|
//#endregion
|
|
320
|
-
//#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
|
|
321
407
|
/**
|
|
322
|
-
*
|
|
323
|
-
* Renders a `<div>` element.
|
|
324
|
-
*
|
|
325
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
408
|
+
* @internal
|
|
326
409
|
*/
|
|
327
|
-
const
|
|
410
|
+
const MenuGroupPlain = /*#__PURE__*/ React$1.forwardRef(function MenuGroupPlain(componentProps, forwardedRef) {
|
|
328
411
|
const { render, className, style, ...elementProps } = componentProps;
|
|
329
412
|
const [labelId, setLabelId] = React$1.useState(void 0);
|
|
330
413
|
const element = useRenderElement("div", componentProps, {
|
|
@@ -340,9 +423,17 @@ const MenuGroup = /*#__PURE__*/ React$1.forwardRef(function MenuGroup(componentP
|
|
|
340
423
|
children: element
|
|
341
424
|
});
|
|
342
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
|
+
});
|
|
343
434
|
MenuGroup.displayName = "MenuGroup";
|
|
344
435
|
//#endregion
|
|
345
|
-
//#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
|
|
346
437
|
/**
|
|
347
438
|
* An accessible label that is automatically associated with its parent group.
|
|
348
439
|
* Renders a `<div>` element.
|
|
@@ -356,35 +447,34 @@ const MenuGroupLabel = /*#__PURE__*/ React$1.forwardRef(function MenuGroupLabel(
|
|
|
356
447
|
useIsoLayoutEffect(() => {
|
|
357
448
|
setLabelId(id);
|
|
358
449
|
return () => {
|
|
359
|
-
setLabelId(void 0);
|
|
450
|
+
setLabelId((currentId) => currentId === id ? void 0 : currentId);
|
|
360
451
|
};
|
|
361
452
|
}, [setLabelId, id]);
|
|
362
453
|
return useRenderElement("div", componentProps, {
|
|
363
454
|
ref: forwardedRef,
|
|
364
455
|
props: {
|
|
365
456
|
id,
|
|
366
|
-
|
|
457
|
+
"aria-hidden": true,
|
|
367
458
|
...elementProps
|
|
368
459
|
}
|
|
369
460
|
});
|
|
370
461
|
});
|
|
371
462
|
MenuGroupLabel.displayName = "MenuGroupLabel";
|
|
372
463
|
//#endregion
|
|
373
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
* Renders a `<div>` element.
|
|
377
|
-
*
|
|
378
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
379
|
-
*/
|
|
380
|
-
const MenuItem = /*#__PURE__*/ React$1.forwardRef(function MenuItem(componentProps, forwardedRef) {
|
|
381
|
-
const { render, className, id: idProp, label, nativeButton = false, disabled = false, closeOnClick = true, style, ...elementProps } = componentProps;
|
|
382
|
-
const listItem = useCompositeListItem({ label });
|
|
383
|
-
const menuPositionerContext = useMenuPositionerContext(true);
|
|
384
|
-
const id = useBaseUiId(idProp);
|
|
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) {
|
|
466
|
+
const { render, className, id: idProp, label, nativeButton = false, disabled: disabledProp = false, closeOnClick = true, style, ...elementProps } = componentProps;
|
|
385
467
|
const { store } = useMenuRootContext();
|
|
468
|
+
const listItem = useCompositeListItem({
|
|
469
|
+
guess: true,
|
|
470
|
+
label
|
|
471
|
+
});
|
|
472
|
+
const id = useBaseUiId(idProp);
|
|
473
|
+
const rootDisabled = store.useState("disabled");
|
|
386
474
|
const highlighted = store.useState("isActive", listItem.index);
|
|
475
|
+
const nodeId = store.useState("floatingNodeId");
|
|
387
476
|
const itemProps = store.useState("itemProps");
|
|
477
|
+
const disabled = disabledProp || rootDisabled;
|
|
388
478
|
const { getItemProps, itemRef } = useMenuItem({
|
|
389
479
|
closeOnClick,
|
|
390
480
|
disabled,
|
|
@@ -392,7 +482,7 @@ const MenuItem = /*#__PURE__*/ React$1.forwardRef(function MenuItem(componentPro
|
|
|
392
482
|
id,
|
|
393
483
|
store,
|
|
394
484
|
nativeButton,
|
|
395
|
-
nodeId
|
|
485
|
+
nodeId,
|
|
396
486
|
itemMetadata: REGULAR_ITEM
|
|
397
487
|
});
|
|
398
488
|
return useRenderElement("div", componentProps, {
|
|
@@ -412,23 +502,29 @@ const MenuItem = /*#__PURE__*/ React$1.forwardRef(function MenuItem(componentPro
|
|
|
412
502
|
]
|
|
413
503
|
});
|
|
414
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
|
+
});
|
|
415
514
|
MenuItem.displayName = "MenuItem";
|
|
416
515
|
//#endregion
|
|
417
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
418
|
-
|
|
419
|
-
* A link in the menu that can be used to navigate to a different page or section.
|
|
420
|
-
* Renders an `<a>` element.
|
|
421
|
-
*
|
|
422
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
423
|
-
*/
|
|
424
|
-
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) {
|
|
425
518
|
const { render, className, id: idProp, label, closeOnClick = false, style, ...elementProps } = componentProps;
|
|
519
|
+
const { store } = useMenuRootContext();
|
|
426
520
|
const linkRef = React$1.useRef(null);
|
|
427
|
-
const listItem = useCompositeListItem({
|
|
428
|
-
|
|
521
|
+
const listItem = useCompositeListItem({
|
|
522
|
+
guess: true,
|
|
523
|
+
label
|
|
524
|
+
});
|
|
429
525
|
const id = useBaseUiId(idProp);
|
|
430
|
-
const { store } = useMenuRootContext();
|
|
431
526
|
const highlighted = store.useState("isActive", listItem.index);
|
|
527
|
+
const nodeId = store.useState("floatingNodeId");
|
|
432
528
|
const itemProps = store.useState("itemProps");
|
|
433
529
|
const typingRef = store.context.typingRef;
|
|
434
530
|
const { getButtonProps, buttonRef } = useButton({
|
|
@@ -442,7 +538,8 @@ const MenuLinkItem = /*#__PURE__*/ React$1.forwardRef(function MenuLinkItem(comp
|
|
|
442
538
|
nodeId,
|
|
443
539
|
store,
|
|
444
540
|
typingRef,
|
|
445
|
-
itemRef: linkRef
|
|
541
|
+
itemRef: linkRef,
|
|
542
|
+
itemMetadata: REGULAR_ITEM
|
|
446
543
|
});
|
|
447
544
|
function getItemProps(externalProps) {
|
|
448
545
|
return mergeProps(commonProps, externalProps, getButtonProps);
|
|
@@ -462,22 +559,73 @@ const MenuLinkItem = /*#__PURE__*/ React$1.forwardRef(function MenuLinkItem(comp
|
|
|
462
559
|
]
|
|
463
560
|
});
|
|
464
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
|
+
});
|
|
465
571
|
MenuLinkItem.displayName = "MenuLinkItem";
|
|
466
572
|
//#endregion
|
|
467
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
468
|
-
const
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
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
|
|
472
581
|
/**
|
|
473
|
-
*
|
|
474
|
-
*
|
|
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.
|
|
475
587
|
*
|
|
476
|
-
*
|
|
588
|
+
* @internal
|
|
477
589
|
*/
|
|
478
|
-
|
|
479
|
-
const
|
|
480
|
-
|
|
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();
|
|
481
629
|
const { side, align } = useMenuPositionerContext();
|
|
482
630
|
const insideToolbar = useToolbarRootContext(true) != null;
|
|
483
631
|
const open = store.useState("open");
|
|
@@ -485,18 +633,27 @@ const MenuPopup = /*#__PURE__*/ React$1.forwardRef(function MenuPopup(componentP
|
|
|
485
633
|
const popupProps = store.useState("popupProps");
|
|
486
634
|
const mounted = store.useState("mounted");
|
|
487
635
|
const instantType = store.useState("instantType");
|
|
488
|
-
const
|
|
636
|
+
const activeTriggerElement = store.useState("activeTriggerElement");
|
|
489
637
|
const parent = store.useState("parent");
|
|
490
638
|
const lastOpenChangeReason = store.useState("lastOpenChangeReason");
|
|
491
639
|
const rootId = store.useState("rootId");
|
|
492
640
|
const floatingContext = store.useState("floatingRootContext");
|
|
493
641
|
const floatingTreeRoot = store.useState("floatingTreeRoot");
|
|
494
642
|
const closeDelay = store.useState("closeDelay");
|
|
495
|
-
const activeTriggerElement = store.useState("activeTriggerElement");
|
|
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,
|
|
@@ -517,54 +674,89 @@ const MenuPopup = /*#__PURE__*/ React$1.forwardRef(function MenuPopup(componentP
|
|
|
517
674
|
enabled: hoverEnabled && !disabled && !isContextMenu && parent.type !== "menubar",
|
|
518
675
|
closeDelay
|
|
519
676
|
});
|
|
520
|
-
const setPopupElement =
|
|
521
|
-
|
|
522
|
-
|
|
677
|
+
const setPopupElement = store.useStateSetter("popupElement");
|
|
678
|
+
const { parentVirtualFocusRef, handleFocus } = (React$1.useContext(MenuFilterImplContext)?.useParentHandoff ?? useNoParentHandoff)(store, parent, open, virtualFocus);
|
|
679
|
+
const state = {
|
|
680
|
+
transitionStatus,
|
|
681
|
+
side,
|
|
682
|
+
align,
|
|
683
|
+
open,
|
|
684
|
+
nested: parent.type === "menu",
|
|
685
|
+
instant: instantType
|
|
686
|
+
};
|
|
523
687
|
const element = useRenderElement("div", componentProps, {
|
|
524
|
-
state
|
|
525
|
-
transitionStatus,
|
|
526
|
-
side,
|
|
527
|
-
align,
|
|
528
|
-
open,
|
|
529
|
-
nested: parent.type === "menu",
|
|
530
|
-
instant: instantType
|
|
531
|
-
},
|
|
688
|
+
state,
|
|
532
689
|
ref: [
|
|
533
690
|
forwardedRef,
|
|
534
691
|
store.context.popupRef,
|
|
535
|
-
setPopupElement
|
|
692
|
+
setPopupElement,
|
|
693
|
+
registerIdRef
|
|
536
694
|
],
|
|
537
|
-
stateAttributesMapping,
|
|
695
|
+
stateAttributesMapping: popupTransitionStateMapping,
|
|
538
696
|
props: [
|
|
539
697
|
popupProps,
|
|
540
|
-
{
|
|
541
|
-
|
|
542
|
-
|
|
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
|
+
},
|
|
543
711
|
getDisabledMountTransitionStyles(transitionStatus),
|
|
544
712
|
elementProps,
|
|
545
713
|
{ "data-rootownerid": rootId }
|
|
546
714
|
]
|
|
547
715
|
});
|
|
548
716
|
let returnFocus = parent.type === void 0 || isContextMenu;
|
|
549
|
-
if (
|
|
717
|
+
if (activeTriggerElement || parent.type === "menubar" && lastOpenChangeReason !== "outside-press") returnFocus = true;
|
|
718
|
+
const dynamicReturnFocus = submenuRootContext?.getReturnElement ?? parentVirtualFocusRef;
|
|
550
719
|
return /*#__PURE__*/ jsx(FloatingFocusManager, {
|
|
551
720
|
context: floatingContext,
|
|
552
721
|
openInteractionType: openMethod,
|
|
553
722
|
modal: isContextMenu,
|
|
554
723
|
disabled: !mounted,
|
|
555
|
-
returnFocus: finalFocus
|
|
556
|
-
|
|
724
|
+
returnFocus: finalFocus ?? dynamicReturnFocus ?? returnFocus,
|
|
725
|
+
explicitReturnFocus: finalFocus === void 0 && dynamicReturnFocus ? false : void 0,
|
|
726
|
+
initialFocus,
|
|
557
727
|
restoreFocus: true,
|
|
728
|
+
getInsideElements: parent.type === void 0 ? () => [store.context.beforeTriggerFocusGuardRef.current] : void 0,
|
|
558
729
|
externalTree: parent.type !== "menubar" ? floatingTreeRoot : void 0,
|
|
559
730
|
previousFocusableElement: activeTriggerElement,
|
|
560
731
|
nextFocusableElement: parent.type === void 0 ? store.context.triggerFocusTargetRef : void 0,
|
|
561
|
-
beforeContentFocusGuardRef:
|
|
732
|
+
beforeContentFocusGuardRef: store.context.beforeContentFocusGuardRef,
|
|
562
733
|
children: element
|
|
563
734
|
});
|
|
564
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
|
+
});
|
|
565
757
|
MenuPopup.displayName = "MenuPopup";
|
|
566
758
|
//#endregion
|
|
567
|
-
//#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
|
|
568
760
|
const MenuPortalContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
569
761
|
MenuPortalContext.displayName = "MenuPortalContext";
|
|
570
762
|
function useMenuPortalContext() {
|
|
@@ -573,7 +765,7 @@ function useMenuPortalContext() {
|
|
|
573
765
|
return value;
|
|
574
766
|
}
|
|
575
767
|
//#endregion
|
|
576
|
-
//#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
|
|
577
769
|
/**
|
|
578
770
|
* A portal element that moves the popup to a different part of the DOM.
|
|
579
771
|
* By default, the portal element is appended to `<body>`.
|
|
@@ -583,19 +775,21 @@ function useMenuPortalContext() {
|
|
|
583
775
|
*/
|
|
584
776
|
const MenuPortal = /*#__PURE__*/ React$1.forwardRef(function MenuPortal(props, forwardedRef) {
|
|
585
777
|
const { keepMounted = false, ...portalProps } = props;
|
|
586
|
-
const { store } = useMenuRootContext();
|
|
778
|
+
const { store, parent } = useMenuRootContext();
|
|
587
779
|
if (!(store.useState("mounted") || keepMounted)) return null;
|
|
780
|
+
const portalOwnerRole = parent.type === "menu" || parent.type === "menubar" ? "group" : void 0;
|
|
588
781
|
return /*#__PURE__*/ jsx(MenuPortalContext.Provider, {
|
|
589
782
|
value: keepMounted,
|
|
590
783
|
children: /*#__PURE__*/ jsx(FloatingPortal, {
|
|
591
784
|
ref: forwardedRef,
|
|
592
|
-
...portalProps
|
|
785
|
+
...portalProps,
|
|
786
|
+
portalOwnerRole
|
|
593
787
|
})
|
|
594
788
|
});
|
|
595
789
|
});
|
|
596
790
|
MenuPortal.displayName = "MenuPortal";
|
|
597
791
|
//#endregion
|
|
598
|
-
//#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
|
|
599
793
|
/**
|
|
600
794
|
* Positions the menu popup against the trigger.
|
|
601
795
|
* Renders a `<div>` element.
|
|
@@ -604,7 +798,7 @@ MenuPortal.displayName = "MenuPortal";
|
|
|
604
798
|
*/
|
|
605
799
|
const MenuPositioner = /*#__PURE__*/ React$1.forwardRef(function MenuPositioner(componentProps, forwardedRef) {
|
|
606
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;
|
|
607
|
-
const { store } = useMenuRootContext();
|
|
801
|
+
const { store, virtualFocus, syncHighlightedItem } = useMenuRootContext();
|
|
608
802
|
const keepMounted = useMenuPortalContext();
|
|
609
803
|
const contextMenuContext = useContextMenuRootContext(true);
|
|
610
804
|
const parent = store.useState("parent");
|
|
@@ -618,13 +812,11 @@ const MenuPositioner = /*#__PURE__*/ React$1.forwardRef(function MenuPositioner(
|
|
|
618
812
|
const transitionStatus = store.useState("transitionStatus");
|
|
619
813
|
const positionerElement = store.useState("positionerElement");
|
|
620
814
|
const instantType = store.useState("instantType");
|
|
621
|
-
const
|
|
815
|
+
const adaptiveOrigin = store.useState("adaptiveOrigin");
|
|
622
816
|
const lastOpenChangeReason = store.useState("lastOpenChangeReason");
|
|
623
817
|
const floatingNodeId = store.useState("floatingNodeId");
|
|
624
818
|
const floatingParentNodeId = store.useState("floatingParentNodeId");
|
|
625
819
|
const domReference = floatingRootContext.useState("domReferenceElement");
|
|
626
|
-
const previousTriggerRef = React$1.useRef(null);
|
|
627
|
-
const runOnceAnimationsFinish = useAnimationsFinished(positionerElement, false, false);
|
|
628
820
|
let anchor = anchorProp;
|
|
629
821
|
let sideOffset = sideOffsetProp;
|
|
630
822
|
let alignOffset = alignOffsetProp;
|
|
@@ -666,9 +858,13 @@ const MenuPositioner = /*#__PURE__*/ React$1.forwardRef(function MenuPositioner(
|
|
|
666
858
|
keepMounted,
|
|
667
859
|
disableAnchorTracking,
|
|
668
860
|
collisionAvoidance,
|
|
669
|
-
|
|
861
|
+
shift: contextMenu ? {
|
|
862
|
+
crossAxis: !("side" in collisionAvoidance && collisionAvoidance.side === "flip"),
|
|
863
|
+
rootBoundary: "layoutViewport"
|
|
864
|
+
} : void 0,
|
|
670
865
|
externalTree: floatingTreeRoot,
|
|
671
|
-
adaptiveOrigin
|
|
866
|
+
adaptiveOrigin,
|
|
867
|
+
lazyFlip: virtualFocus ? "placement" : false
|
|
672
868
|
});
|
|
673
869
|
React$1.useEffect(() => {
|
|
674
870
|
function onMenuOpenChange(details) {
|
|
@@ -740,25 +936,12 @@ const MenuPositioner = /*#__PURE__*/ React$1.forwardRef(function MenuPositioner(
|
|
|
740
936
|
floatingNodeId,
|
|
741
937
|
floatingParentNodeId
|
|
742
938
|
]);
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
const previousTrigger = previousTriggerRef.current;
|
|
746
|
-
if (currentTrigger) previousTriggerRef.current = currentTrigger;
|
|
747
|
-
if (previousTrigger && currentTrigger && currentTrigger !== previousTrigger) {
|
|
748
|
-
store.set("instantType", void 0);
|
|
749
|
-
const abortController = new AbortController();
|
|
750
|
-
runOnceAnimationsFinish(() => {
|
|
751
|
-
store.set("instantType", "trigger-change");
|
|
752
|
-
}, abortController.signal);
|
|
753
|
-
return () => {
|
|
754
|
-
abortController.abort();
|
|
755
|
-
};
|
|
756
|
-
}
|
|
757
|
-
}, [
|
|
939
|
+
useTriggerSwitchTransition({
|
|
940
|
+
store,
|
|
758
941
|
domReference,
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
942
|
+
positionerElement,
|
|
943
|
+
open
|
|
944
|
+
});
|
|
762
945
|
const state = {
|
|
763
946
|
open,
|
|
764
947
|
side: positioner.side,
|
|
@@ -792,6 +975,7 @@ const MenuPositioner = /*#__PURE__*/ React$1.forwardRef(function MenuPositioner(
|
|
|
792
975
|
children: /*#__PURE__*/ jsx(CompositeList, {
|
|
793
976
|
elementsRef: store.context.itemDomElements,
|
|
794
977
|
labelsRef: store.context.itemLabels,
|
|
978
|
+
onMapChange: syncHighlightedItem,
|
|
795
979
|
children: element
|
|
796
980
|
})
|
|
797
981
|
})]
|
|
@@ -799,7 +983,7 @@ const MenuPositioner = /*#__PURE__*/ React$1.forwardRef(function MenuPositioner(
|
|
|
799
983
|
});
|
|
800
984
|
MenuPositioner.displayName = "MenuPositioner";
|
|
801
985
|
//#endregion
|
|
802
|
-
//#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
|
|
803
987
|
const MenuRadioGroupContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
804
988
|
MenuRadioGroupContext.displayName = "MenuRadioGroupContext";
|
|
805
989
|
function useMenuRadioGroupContext() {
|
|
@@ -808,14 +992,11 @@ function useMenuRadioGroupContext() {
|
|
|
808
992
|
return context;
|
|
809
993
|
}
|
|
810
994
|
//#endregion
|
|
811
|
-
//#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
|
|
812
996
|
/**
|
|
813
|
-
*
|
|
814
|
-
* Renders a `<div>` element.
|
|
815
|
-
*
|
|
816
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
997
|
+
* @internal
|
|
817
998
|
*/
|
|
818
|
-
const
|
|
999
|
+
const MenuRadioGroupPlain = /*#__PURE__*/ React$1.forwardRef(function MenuRadioGroupPlain(componentProps, forwardedRef) {
|
|
819
1000
|
const { render, className, value: valueProp, defaultValue, onValueChange: onValueChangeProp, disabled = false, style, "aria-labelledby": ariaLabelledByProp, ...elementProps } = componentProps;
|
|
820
1001
|
const [labelId, setLabelId] = React$1.useState(void 0);
|
|
821
1002
|
const [value, setValueUnwrapped] = useControlled({
|
|
@@ -854,10 +1035,18 @@ const MenuRadioGroup = /*#__PURE__*/ React$1.memo(/*#__PURE__*/ React$1.forwardR
|
|
|
854
1035
|
children: element
|
|
855
1036
|
})
|
|
856
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
|
+
});
|
|
857
1046
|
}));
|
|
858
1047
|
MenuRadioGroup.displayName = "MenuRadioGroup";
|
|
859
1048
|
//#endregion
|
|
860
|
-
//#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
|
|
861
1050
|
const MenuRadioItemContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
862
1051
|
MenuRadioItemContext.displayName = "MenuRadioItemContext";
|
|
863
1052
|
function useMenuRadioItemContext() {
|
|
@@ -866,23 +1055,21 @@ function useMenuRadioItemContext() {
|
|
|
866
1055
|
return context;
|
|
867
1056
|
}
|
|
868
1057
|
//#endregion
|
|
869
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
870
|
-
|
|
871
|
-
* A menu item that works like a radio button in a given group.
|
|
872
|
-
* Renders a `<div>` element.
|
|
873
|
-
*
|
|
874
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
875
|
-
*/
|
|
876
|
-
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) {
|
|
877
1060
|
const { render, className, id: idProp, label, nativeButton = false, disabled: disabledProp = false, closeOnClick = false, value, style, ...elementProps } = componentProps;
|
|
878
|
-
const listItem = useCompositeListItem({ label });
|
|
879
|
-
const menuPositionerContext = useMenuPositionerContext(true);
|
|
880
|
-
const id = useBaseUiId(idProp);
|
|
881
1061
|
const { store } = useMenuRootContext();
|
|
1062
|
+
const { value: selectedValue, setValue: setSelectedValue, disabled: groupDisabled } = useMenuRadioGroupContext();
|
|
1063
|
+
const listItem = useCompositeListItem({
|
|
1064
|
+
guess: true,
|
|
1065
|
+
label
|
|
1066
|
+
});
|
|
1067
|
+
const id = useBaseUiId(idProp);
|
|
882
1068
|
const highlighted = store.useState("isActive", listItem.index);
|
|
1069
|
+
const nodeId = store.useState("floatingNodeId");
|
|
883
1070
|
const itemProps = store.useState("itemProps");
|
|
884
|
-
const
|
|
885
|
-
const disabled = groupDisabled ||
|
|
1071
|
+
const rootDisabled = store.useState("disabled");
|
|
1072
|
+
const disabled = disabledProp || groupDisabled || rootDisabled;
|
|
886
1073
|
const checked = selectedValue === value;
|
|
887
1074
|
const { getItemProps, itemRef } = useMenuItem({
|
|
888
1075
|
closeOnClick,
|
|
@@ -891,7 +1078,7 @@ const MenuRadioItem = /*#__PURE__*/ React$1.forwardRef(function MenuRadioItem(co
|
|
|
891
1078
|
id,
|
|
892
1079
|
store,
|
|
893
1080
|
nativeButton,
|
|
894
|
-
nodeId
|
|
1081
|
+
nodeId,
|
|
895
1082
|
itemMetadata: REGULAR_ITEM
|
|
896
1083
|
});
|
|
897
1084
|
const state = React$1.useMemo(() => ({
|
|
@@ -904,7 +1091,7 @@ const MenuRadioItem = /*#__PURE__*/ React$1.forwardRef(function MenuRadioItem(co
|
|
|
904
1091
|
checked
|
|
905
1092
|
]);
|
|
906
1093
|
function handleClick(event) {
|
|
907
|
-
const details = createChangeEventDetails(itemPress, event.nativeEvent, void 0, { preventUnmountOnClose
|
|
1094
|
+
const details = createChangeEventDetails(itemPress, event.nativeEvent, void 0, { preventUnmountOnClose: NOOP });
|
|
908
1095
|
setSelectedValue(value, details);
|
|
909
1096
|
}
|
|
910
1097
|
const element = useRenderElement("div", componentProps, {
|
|
@@ -931,9 +1118,18 @@ const MenuRadioItem = /*#__PURE__*/ React$1.forwardRef(function MenuRadioItem(co
|
|
|
931
1118
|
children: element
|
|
932
1119
|
});
|
|
933
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
|
+
});
|
|
934
1130
|
MenuRadioItem.displayName = "MenuRadioItem";
|
|
935
1131
|
//#endregion
|
|
936
|
-
//#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
|
|
937
1133
|
/**
|
|
938
1134
|
* Indicates whether the radio item is selected.
|
|
939
1135
|
* Renders a `<span>` element.
|
|
@@ -944,103 +1140,116 @@ const MenuRadioItemIndicator = /*#__PURE__*/ React$1.forwardRef(function MenuRad
|
|
|
944
1140
|
const { render, className, style, keepMounted = false, ...elementProps } = componentProps;
|
|
945
1141
|
const item = useMenuRadioItemContext();
|
|
946
1142
|
const indicatorRef = React$1.useRef(null);
|
|
947
|
-
const { transitionStatus, setMounted } = useTransitionStatus(item.checked);
|
|
1143
|
+
const { transitionStatus, mounted, setMounted } = useTransitionStatus(item.checked);
|
|
948
1144
|
useOpenChangeComplete({
|
|
1145
|
+
batch: true,
|
|
1146
|
+
enabled: !item.checked,
|
|
949
1147
|
open: item.checked,
|
|
950
1148
|
ref: indicatorRef,
|
|
951
1149
|
onComplete() {
|
|
952
1150
|
if (!item.checked) setMounted(false);
|
|
953
1151
|
}
|
|
954
1152
|
});
|
|
1153
|
+
const state = {
|
|
1154
|
+
checked: item.checked,
|
|
1155
|
+
disabled: item.disabled,
|
|
1156
|
+
highlighted: item.highlighted,
|
|
1157
|
+
transitionStatus
|
|
1158
|
+
};
|
|
955
1159
|
return useRenderElement("span", componentProps, {
|
|
956
|
-
state
|
|
957
|
-
checked: item.checked,
|
|
958
|
-
disabled: item.disabled,
|
|
959
|
-
highlighted: item.highlighted,
|
|
960
|
-
transitionStatus
|
|
961
|
-
},
|
|
1160
|
+
state,
|
|
962
1161
|
stateAttributesMapping: itemMapping,
|
|
963
1162
|
ref: [forwardedRef, indicatorRef],
|
|
964
1163
|
props: {
|
|
965
1164
|
"aria-hidden": true,
|
|
966
1165
|
...elementProps
|
|
967
1166
|
},
|
|
968
|
-
enabled: keepMounted ||
|
|
1167
|
+
enabled: keepMounted || mounted
|
|
969
1168
|
});
|
|
970
1169
|
});
|
|
971
1170
|
MenuRadioItemIndicator.displayName = "MenuRadioItemIndicator";
|
|
972
1171
|
//#endregion
|
|
973
|
-
//#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
|
|
974
1173
|
const selectors = {
|
|
975
1174
|
...popupStoreSelectors,
|
|
976
|
-
disabled:
|
|
977
|
-
modal:
|
|
978
|
-
openMethod:
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
parent:
|
|
983
|
-
rootId:
|
|
1175
|
+
disabled: (state) => state.parent.type === "menubar" ? state.parent.context.disabled || state.disabled : state.disabled,
|
|
1176
|
+
modal: (state) => (state.parent.type === void 0 || state.parent.type === "context-menu") && (state.modal ?? true),
|
|
1177
|
+
openMethod: (state) => state.openMethod,
|
|
1178
|
+
keyboardOpen: (state) => state.keyboardOpen,
|
|
1179
|
+
allowMouseEnter: (state) => state.allowMouseEnter,
|
|
1180
|
+
highlightItemOnHover: (state) => state.highlightItemOnHover,
|
|
1181
|
+
parent: (state) => state.parent,
|
|
1182
|
+
rootId: (state) => {
|
|
984
1183
|
if (state.parent.type === "menu") return state.parent.store.select("rootId");
|
|
985
1184
|
return state.parent.type !== void 0 ? state.parent.context.rootId : state.rootId;
|
|
986
|
-
}
|
|
987
|
-
activeIndex:
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
1185
|
+
},
|
|
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,
|
|
1197
|
+
isActive: (state, itemIndex) => state.activeIndex === itemIndex,
|
|
1198
|
+
hoverEnabled: (state) => state.hoverEnabled,
|
|
1199
|
+
instantType: (state) => state.instantType === "trigger-change" && !popupStoreSelectors.open(state) ? void 0 : state.instantType,
|
|
1200
|
+
lastOpenChangeReason: (state) => state.openChangeReason,
|
|
1201
|
+
floatingTreeRoot: (state) => {
|
|
993
1202
|
if (state.parent.type === "menu") return state.parent.store.select("floatingTreeRoot");
|
|
994
1203
|
return state.floatingTreeRoot;
|
|
995
|
-
}
|
|
996
|
-
floatingNodeId:
|
|
997
|
-
floatingParentNodeId:
|
|
998
|
-
itemProps:
|
|
999
|
-
closeDelay:
|
|
1000
|
-
|
|
1001
|
-
keyboardEventRelay:
|
|
1204
|
+
},
|
|
1205
|
+
floatingNodeId: (state) => state.floatingNodeId,
|
|
1206
|
+
floatingParentNodeId: (state) => state.floatingParentNodeId,
|
|
1207
|
+
itemProps: (state) => state.itemProps,
|
|
1208
|
+
closeDelay: (state) => state.closeDelay,
|
|
1209
|
+
adaptiveOrigin: (state) => state.adaptiveOrigin,
|
|
1210
|
+
keyboardEventRelay: (state) => {
|
|
1002
1211
|
if (state.keyboardEventRelay) return state.keyboardEventRelay;
|
|
1003
1212
|
if (state.parent.type === "menu") return state.parent.store.select("keyboardEventRelay");
|
|
1004
|
-
}
|
|
1213
|
+
}
|
|
1005
1214
|
};
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
this.
|
|
1215
|
+
/**
|
|
1216
|
+
* The store view that detached handle-backed triggers read from. Both the real `MenuStore` and the
|
|
1217
|
+
* inert fallback store satisfy it, so a trigger can read from whichever store the handle currently
|
|
1218
|
+
* exposes. Narrowed to the members a trigger actually uses — the trigger-data members plus `setOpen`
|
|
1219
|
+
* (called by the focus guards) — so the exposed surface can't bypass the open-change pipeline; on
|
|
1220
|
+
* the detached fallback store every one of these mutations is a no-op.
|
|
1221
|
+
*/
|
|
1222
|
+
var MenuStore = class extends ReactStore {
|
|
1223
|
+
constructor(initialState, floatingId, nested = false) {
|
|
1224
|
+
const triggerElements = new PopupTriggerMap();
|
|
1225
|
+
const state = createInitialState(triggerElements, floatingId, nested, initialState);
|
|
1226
|
+
super(state, createInitialContext(triggerElements), selectors);
|
|
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();
|
|
1044
1253
|
});
|
|
1045
1254
|
}
|
|
1046
1255
|
setOpen(open, eventDetails) {
|
|
@@ -1049,26 +1258,67 @@ var MenuStore = class MenuStore extends ReactStore {
|
|
|
1049
1258
|
eventDetails
|
|
1050
1259
|
});
|
|
1051
1260
|
}
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
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);
|
|
1057
1272
|
}
|
|
1058
|
-
unsubscribeParentListener = null;
|
|
1059
1273
|
};
|
|
1060
|
-
|
|
1274
|
+
/**
|
|
1275
|
+
* Creates the inert fallback store used by detached handle-backed triggers while no `Menu.Root` is
|
|
1276
|
+
* attached. It preserves a menu-specific trigger registry in context so detached triggers can
|
|
1277
|
+
* register before migrating to the live root store. `setOpen` is a no-op (matching the inert
|
|
1278
|
+
* reads/writes of `NullStore`), so a trigger can hand the store to focus-guard helpers that expect
|
|
1279
|
+
* `setOpen` without it ever taking effect while detached.
|
|
1280
|
+
*/
|
|
1281
|
+
function createNullMenuStore() {
|
|
1282
|
+
const triggerElements = new PopupTriggerMap();
|
|
1283
|
+
const store = new NullStore(Object.freeze(createInitialState(triggerElements)), Object.freeze(createInitialContext(triggerElements)), selectors);
|
|
1284
|
+
return Object.assign(store, { setOpen: NOOP });
|
|
1285
|
+
}
|
|
1286
|
+
function createInitialContext(triggerElements) {
|
|
1061
1287
|
return {
|
|
1062
|
-
|
|
1288
|
+
positionerRef: /*#__PURE__*/ React$1.createRef(),
|
|
1289
|
+
popupRef: /*#__PURE__*/ React$1.createRef(),
|
|
1290
|
+
typingRef: { current: false },
|
|
1291
|
+
itemDomElements: { current: [] },
|
|
1292
|
+
itemLabels: { current: [] },
|
|
1293
|
+
highlightReason: "none",
|
|
1294
|
+
highlightEvent: void 0,
|
|
1295
|
+
reportedItem: void 0,
|
|
1296
|
+
allowMouseUpTriggerRef: { current: false },
|
|
1297
|
+
virtualFocusRef: void 0,
|
|
1298
|
+
triggerFocusTargetRef: /*#__PURE__*/ React$1.createRef(),
|
|
1299
|
+
beforeTriggerFocusGuardRef: /*#__PURE__*/ React$1.createRef(),
|
|
1300
|
+
beforeContentFocusGuardRef: /*#__PURE__*/ React$1.createRef(),
|
|
1301
|
+
onOpenChangeComplete: void 0,
|
|
1302
|
+
triggerElements
|
|
1303
|
+
};
|
|
1304
|
+
}
|
|
1305
|
+
function createInitialState(triggerElements, floatingId, nested = false, initialState) {
|
|
1306
|
+
return {
|
|
1307
|
+
...createInitialPopupStoreState(triggerElements, floatingId, nested),
|
|
1063
1308
|
disabled: false,
|
|
1064
1309
|
modal: true,
|
|
1065
1310
|
openMethod: null,
|
|
1311
|
+
keyboardOpen: false,
|
|
1066
1312
|
allowMouseEnter: false,
|
|
1067
1313
|
highlightItemOnHover: true,
|
|
1068
|
-
stickIfOpen: true,
|
|
1069
1314
|
parent: { type: void 0 },
|
|
1070
1315
|
rootId: void 0,
|
|
1071
1316
|
activeIndex: null,
|
|
1317
|
+
listElement: null,
|
|
1318
|
+
filterTriggerProps: EMPTY_OBJECT,
|
|
1319
|
+
inputProps: EMPTY_OBJECT,
|
|
1320
|
+
inputFocused: false,
|
|
1321
|
+
highlightedItem: void 0,
|
|
1072
1322
|
hoverEnabled: true,
|
|
1073
1323
|
instantType: void 0,
|
|
1074
1324
|
openChangeReason: null,
|
|
@@ -1078,66 +1328,100 @@ function createInitialState() {
|
|
|
1078
1328
|
itemProps: EMPTY_OBJECT,
|
|
1079
1329
|
keyboardEventRelay: void 0,
|
|
1080
1330
|
closeDelay: 0,
|
|
1081
|
-
|
|
1331
|
+
adaptiveOrigin: void 0,
|
|
1332
|
+
...initialState
|
|
1082
1333
|
};
|
|
1083
1334
|
}
|
|
1084
1335
|
//#endregion
|
|
1085
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
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);
|
|
1090
1363
|
}
|
|
1091
1364
|
//#endregion
|
|
1092
|
-
//#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
|
|
1093
1366
|
/**
|
|
1094
|
-
*
|
|
1095
|
-
* Doesn't render its own HTML element.
|
|
1096
|
-
*
|
|
1097
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
1367
|
+
* @internal
|
|
1098
1368
|
*/
|
|
1099
|
-
const
|
|
1100
|
-
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;
|
|
1101
1371
|
const contextMenuContext = useContextMenuRootContext(true);
|
|
1102
1372
|
const parentMenuRootContext = useMenuRootContext(true);
|
|
1103
1373
|
const menubarContext = useMenubarContext(true);
|
|
1104
|
-
const
|
|
1374
|
+
const enclosingMenuStore = parentMenuRootContext?.store;
|
|
1375
|
+
const parentVirtualFocus = parentMenuRootContext?.virtualFocus ?? false;
|
|
1105
1376
|
const parentFromContext = React$1.useMemo(() => {
|
|
1106
|
-
if (isSubmenu &&
|
|
1377
|
+
if (isSubmenu && enclosingMenuStore) return {
|
|
1107
1378
|
type: "menu",
|
|
1108
|
-
store:
|
|
1379
|
+
store: enclosingMenuStore
|
|
1109
1380
|
};
|
|
1110
1381
|
if (menubarContext) return {
|
|
1111
1382
|
type: "menubar",
|
|
1112
1383
|
context: menubarContext
|
|
1113
1384
|
};
|
|
1114
|
-
if (contextMenuContext && !
|
|
1385
|
+
if (contextMenuContext && !enclosingMenuStore) return {
|
|
1115
1386
|
type: "context-menu",
|
|
1116
1387
|
context: contextMenuContext
|
|
1117
1388
|
};
|
|
1118
1389
|
return { type: void 0 };
|
|
1119
1390
|
}, [
|
|
1120
1391
|
contextMenuContext,
|
|
1121
|
-
|
|
1392
|
+
enclosingMenuStore,
|
|
1122
1393
|
menubarContext,
|
|
1123
1394
|
isSubmenu
|
|
1124
1395
|
]);
|
|
1125
|
-
const
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1396
|
+
const rootId = useBaseUiId();
|
|
1397
|
+
const defaultFloatingId = useBaseUiId();
|
|
1398
|
+
const [renderedFloatingId, setRenderedFloatingId] = React$1.useState(void 0);
|
|
1399
|
+
const floatingId = (renderedFloatingId ?? defaultFloatingId) || void 0;
|
|
1400
|
+
const floatingParentNodeIdFromContext = useFloatingParentNodeId();
|
|
1401
|
+
const parentMenuStore = parentFromContext.type === "menu" ? parentFromContext.store : void 0;
|
|
1402
|
+
const animateInitialOpen = (openProp ?? defaultOpen) && parentMenuStore?.state.transitionStatus === "starting";
|
|
1403
|
+
const seededInstantType = useRefWithInit(() => animateInitialOpen ? parentMenuStore?.state.instantType : void 0).current;
|
|
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;
|
|
1133
1420
|
store.useControlledProp("openProp", openProp);
|
|
1134
1421
|
store.useControlledProp("triggerIdProp", triggerIdProp);
|
|
1135
1422
|
store.useContextCallback("onOpenChangeComplete", onOpenChangeComplete);
|
|
1136
|
-
const rootId = useId$1();
|
|
1137
|
-
const floatingId = useId$1();
|
|
1138
1423
|
const floatingTreeRoot = store.useState("floatingTreeRoot");
|
|
1139
1424
|
const floatingNodeIdFromContext = useFloatingNodeId(floatingTreeRoot);
|
|
1140
|
-
const floatingParentNodeIdFromContext = useFloatingParentNodeId();
|
|
1141
1425
|
const open = store.useState("open");
|
|
1142
1426
|
const activeTriggerElement = store.useState("activeTriggerElement");
|
|
1143
1427
|
const positionerElement = store.useState("positionerElement");
|
|
@@ -1146,6 +1430,7 @@ const MenuRoot = fastComponent(function MenuRoot(props) {
|
|
|
1146
1430
|
const lastOpenChangeReason = store.useState("lastOpenChangeReason");
|
|
1147
1431
|
const parent = store.useState("parent");
|
|
1148
1432
|
const activeIndex = store.useState("activeIndex");
|
|
1433
|
+
const keyboardOpen = store.useState("keyboardOpen");
|
|
1149
1434
|
const payload = store.useState("payload");
|
|
1150
1435
|
const floatingParentNodeId = store.useState("floatingParentNodeId");
|
|
1151
1436
|
const openEventRef = React$1.useRef(null);
|
|
@@ -1164,12 +1449,36 @@ const MenuRoot = fastComponent(function MenuRoot(props) {
|
|
|
1164
1449
|
rootId
|
|
1165
1450
|
});
|
|
1166
1451
|
useImplicitActiveTrigger(store);
|
|
1167
|
-
const { forceUnmount } = useOpenStateTransitions(open, store, () => {
|
|
1168
|
-
store.
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1452
|
+
const { forceUnmount, transitionStatus } = useOpenStateTransitions(open, store, () => {
|
|
1453
|
+
store.set("allowMouseEnter", false);
|
|
1454
|
+
}, animateInitialOpen);
|
|
1455
|
+
const runOnceAnimationsFinish = useAnimationsFinished(store.context.popupRef);
|
|
1456
|
+
React$1.useEffect(() => {
|
|
1457
|
+
if (seededInstantType === void 0) return;
|
|
1458
|
+
const clearSeededInstantType = () => {
|
|
1459
|
+
if (store.state.instantType === seededInstantType) store.set("instantType", void 0);
|
|
1460
|
+
};
|
|
1461
|
+
if (!open) {
|
|
1462
|
+
clearSeededInstantType();
|
|
1463
|
+
return;
|
|
1464
|
+
}
|
|
1465
|
+
if (transitionStatus !== void 0) return;
|
|
1466
|
+
if (store.context.popupRef.current == null) {
|
|
1467
|
+
clearSeededInstantType();
|
|
1468
|
+
return;
|
|
1469
|
+
}
|
|
1470
|
+
const abortController = new AbortController();
|
|
1471
|
+
runOnceAnimationsFinish(clearSeededInstantType, abortController.signal);
|
|
1472
|
+
return () => {
|
|
1473
|
+
abortController.abort();
|
|
1474
|
+
};
|
|
1475
|
+
}, [
|
|
1476
|
+
seededInstantType,
|
|
1477
|
+
open,
|
|
1478
|
+
transitionStatus,
|
|
1479
|
+
runOnceAnimationsFinish,
|
|
1480
|
+
store
|
|
1481
|
+
]);
|
|
1173
1482
|
useIsoLayoutEffect(() => {
|
|
1174
1483
|
if (contextMenuContext && !parentMenuRootContext) store.update({
|
|
1175
1484
|
parent: {
|
|
@@ -1179,7 +1488,7 @@ const MenuRoot = fastComponent(function MenuRoot(props) {
|
|
|
1179
1488
|
floatingNodeId: floatingNodeIdFromContext,
|
|
1180
1489
|
floatingParentNodeId: floatingParentNodeIdFromContext
|
|
1181
1490
|
});
|
|
1182
|
-
else if (parentMenuRootContext) store.update({
|
|
1491
|
+
else if (parentMenuRootContext || !store.select("activeTriggerElement")) store.update({
|
|
1183
1492
|
floatingNodeId: floatingNodeIdFromContext,
|
|
1184
1493
|
floatingParentNodeId: floatingParentNodeIdFromContext
|
|
1185
1494
|
});
|
|
@@ -1188,6 +1497,7 @@ const MenuRoot = fastComponent(function MenuRoot(props) {
|
|
|
1188
1497
|
parentMenuRootContext,
|
|
1189
1498
|
floatingNodeIdFromContext,
|
|
1190
1499
|
floatingParentNodeIdFromContext,
|
|
1500
|
+
activeTriggerElement,
|
|
1191
1501
|
store
|
|
1192
1502
|
]);
|
|
1193
1503
|
React$1.useEffect(() => {
|
|
@@ -1215,6 +1525,7 @@ const MenuRoot = fastComponent(function MenuRoot(props) {
|
|
|
1215
1525
|
]);
|
|
1216
1526
|
const setOpen = useStableCallback((nextOpen, eventDetails) => {
|
|
1217
1527
|
const reason = eventDetails.reason;
|
|
1528
|
+
if (!nextOpen && !store.select("open")) return;
|
|
1218
1529
|
if (open === nextOpen && eventDetails.trigger === activeTriggerElement && lastOpenChangeReason === reason) return;
|
|
1219
1530
|
const shouldPreventUnmountOnClose = attachPreventUnmountOnClose(eventDetails);
|
|
1220
1531
|
if (!nextOpen && eventDetails.trigger == null) eventDetails.trigger = activeTriggerElement ?? void 0;
|
|
@@ -1222,7 +1533,7 @@ const MenuRoot = fastComponent(function MenuRoot(props) {
|
|
|
1222
1533
|
if (eventDetails.isCanceled) return;
|
|
1223
1534
|
store.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);
|
|
1224
1535
|
const nativeEvent = eventDetails.event;
|
|
1225
|
-
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;
|
|
1226
1537
|
if (nextOpen && reason === "trigger-focus") {
|
|
1227
1538
|
allowTouchToCloseRef.current = false;
|
|
1228
1539
|
allowTouchToCloseTimeout.start(300, () => {
|
|
@@ -1232,33 +1543,33 @@ const MenuRoot = fastComponent(function MenuRoot(props) {
|
|
|
1232
1543
|
allowTouchToCloseRef.current = true;
|
|
1233
1544
|
allowTouchToCloseTimeout.clear();
|
|
1234
1545
|
}
|
|
1235
|
-
const isKeyboardClick = (reason === "trigger-press" || reason === "item-press") && nativeEvent.detail === 0 && nativeEvent?.isTrusted;
|
|
1236
1546
|
const isDismissClose = !nextOpen && (reason === "escape-key" || reason == null);
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
else store.set("instantType", void 0);
|
|
1547
|
+
openEventRef.current = eventDetails.event;
|
|
1548
|
+
const popupOpenState = createPopupOpenState(store.state, nextOpen, eventDetails.trigger, shouldPreventUnmountOnClose());
|
|
1549
|
+
popupOpenState.openChangeReason = reason;
|
|
1550
|
+
popupOpenState.keyboardOpen = nextOpen && isKeyboardOpen(reason, nativeEvent);
|
|
1551
|
+
if (parent.type === "menubar" && (reason === "trigger-focus" || reason === "focus-out" || reason === "trigger-hover" || reason === "list-navigation" || reason === "sibling-open")) popupOpenState.instantType = "group";
|
|
1552
|
+
else if (isKeyboardClick(reason, nativeEvent)) popupOpenState.instantType = "click";
|
|
1553
|
+
else if (isDismissClose) popupOpenState.instantType = "dismiss";
|
|
1554
|
+
else popupOpenState.instantType = void 0;
|
|
1555
|
+
store.update(popupOpenState);
|
|
1247
1556
|
});
|
|
1248
1557
|
const floatingRootContext = useSyncedFloatingRootContext({
|
|
1249
1558
|
popupStore: store,
|
|
1559
|
+
floatingRootContext: store.state.floatingRootContext,
|
|
1250
1560
|
floatingId,
|
|
1251
1561
|
nested: floatingParentNodeIdFromContext != null,
|
|
1252
1562
|
onOpenChange: setOpen
|
|
1253
1563
|
});
|
|
1254
1564
|
const floatingEvents = floatingRootContext.context.events;
|
|
1255
|
-
|
|
1565
|
+
useIsoLayoutEffect(() => {
|
|
1256
1566
|
const handleSetOpenEvent = ({ open: nextOpen, eventDetails }) => setOpen(nextOpen, eventDetails);
|
|
1257
1567
|
floatingEvents.on("setOpen", handleSetOpenEvent);
|
|
1258
1568
|
return () => {
|
|
1259
1569
|
floatingEvents?.off("setOpen", handleSetOpenEvent);
|
|
1260
1570
|
};
|
|
1261
1571
|
}, [floatingEvents, setOpen]);
|
|
1572
|
+
useIsoLayoutEffect(() => store.subscribeToParentMenu(), [store]);
|
|
1262
1573
|
const handleImperativeClose = React$1.useCallback(() => {
|
|
1263
1574
|
store.setOpen(false, createChangeEventDetails(imperativeAction));
|
|
1264
1575
|
}, [store]);
|
|
@@ -1280,109 +1591,182 @@ const MenuRoot = fastComponent(function MenuRoot(props) {
|
|
|
1280
1591
|
externalTree: nested ? floatingTreeRoot : void 0
|
|
1281
1592
|
});
|
|
1282
1593
|
const direction = useDirection();
|
|
1283
|
-
const setActiveIndex = React$1.useCallback((index) => {
|
|
1284
|
-
if (store.select("activeIndex") === index) return;
|
|
1285
|
-
store.set("activeIndex", index);
|
|
1286
|
-
}, [store]);
|
|
1287
1594
|
const listNavigation$1 = useListNavigation(floatingRootContext, {
|
|
1288
1595
|
enabled: !disabled,
|
|
1289
1596
|
listRef: store.context.itemDomElements,
|
|
1290
1597
|
activeIndex,
|
|
1291
|
-
|
|
1598
|
+
virtual: virtualFocus,
|
|
1599
|
+
nested: parent.type === "menubar" || !virtualFocus && parent.type !== void 0,
|
|
1600
|
+
parentOrientation: parent.type === "menubar" ? parent.context.orientation : void 0,
|
|
1292
1601
|
loopFocus,
|
|
1602
|
+
focusItemOnOpen: virtualFocus ? keyboardOpen : void 0,
|
|
1603
|
+
allowEscape: virtualFocus && loopFocus && allowEscape,
|
|
1293
1604
|
orientation,
|
|
1294
|
-
|
|
1605
|
+
triggerOrientation: virtualFocus ? "vertical" : orientation,
|
|
1295
1606
|
rtl: direction === "rtl",
|
|
1296
1607
|
disabledIndices: EMPTY_ARRAY,
|
|
1297
|
-
onNavigate
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
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
|
|
1301
1616
|
});
|
|
1302
1617
|
const onTyping = React$1.useCallback((nextTyping) => {
|
|
1303
1618
|
store.context.typingRef.current = nextTyping;
|
|
1304
1619
|
}, [store]);
|
|
1305
1620
|
const typeahead = useTypeahead(floatingRootContext, {
|
|
1306
|
-
enabled: !disabled,
|
|
1621
|
+
enabled: !disabled && !virtualFocus,
|
|
1307
1622
|
listRef: store.context.itemLabels,
|
|
1308
1623
|
elementsRef: store.context.itemDomElements,
|
|
1309
1624
|
activeIndex,
|
|
1310
1625
|
resetMs: 500,
|
|
1311
|
-
onMatch: (index) => {
|
|
1312
|
-
if (open && index !== activeIndex) store.
|
|
1626
|
+
onMatch: (index, event) => {
|
|
1627
|
+
if (open && index !== activeIndex) store.setActiveIndex(index, keyboard, event.nativeEvent);
|
|
1313
1628
|
},
|
|
1314
1629
|
onTyping
|
|
1315
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);
|
|
1662
|
+
const activeTriggerProps = React$1.useMemo(() => {
|
|
1663
|
+
const mergedProps = mergeProps(typeahead.reference, openTriggerProps, dismiss.reference, { onMouseMove() {
|
|
1664
|
+
store.set("allowMouseEnter", true);
|
|
1665
|
+
} }, interactionTypeProps);
|
|
1666
|
+
mergedProps["aria-haspopup"] = "menu";
|
|
1667
|
+
mergedProps["aria-expanded"] = open;
|
|
1668
|
+
return mergedProps;
|
|
1669
|
+
}, [
|
|
1670
|
+
store,
|
|
1671
|
+
typeahead.reference,
|
|
1672
|
+
openTriggerProps,
|
|
1673
|
+
dismiss.reference,
|
|
1674
|
+
interactionTypeProps,
|
|
1675
|
+
open
|
|
1676
|
+
]);
|
|
1677
|
+
const inactiveTriggerProps = React$1.useMemo(() => {
|
|
1678
|
+
const mergedProps = mergeProps(listNavigation$1.trigger, dismiss.trigger, interactionTypeProps);
|
|
1679
|
+
mergedProps["aria-haspopup"] = "menu";
|
|
1680
|
+
mergedProps["aria-expanded"] = false;
|
|
1681
|
+
return mergedProps;
|
|
1682
|
+
}, [
|
|
1683
|
+
listNavigation$1.trigger,
|
|
1684
|
+
dismiss.trigger,
|
|
1685
|
+
interactionTypeProps
|
|
1686
|
+
]);
|
|
1687
|
+
useRefWithInit(() => {
|
|
1688
|
+
store.update({ inactiveTriggerProps });
|
|
1689
|
+
return null;
|
|
1690
|
+
});
|
|
1691
|
+
const popupProps = React$1.useMemo(() => mergeProps(FOCUSABLE_POPUP_PROPS, {
|
|
1692
|
+
onMouseMove() {
|
|
1693
|
+
store.set("allowMouseEnter", true);
|
|
1694
|
+
if (parent.type === "menu") store.set("hoverEnabled", false);
|
|
1695
|
+
},
|
|
1696
|
+
onClick() {
|
|
1697
|
+
if (store.select("hoverEnabled")) store.set("hoverEnabled", false);
|
|
1698
|
+
},
|
|
1699
|
+
onKeyDown(event) {
|
|
1700
|
+
const relay = store.select("keyboardEventRelay");
|
|
1701
|
+
if (relay && !event.isPropagationStopped()) relay(event);
|
|
1702
|
+
}
|
|
1703
|
+
}, typeahead.floating, listNavigation$1.floating, dismiss.floating), [
|
|
1704
|
+
parent.type,
|
|
1705
|
+
store,
|
|
1706
|
+
typeahead.floating,
|
|
1707
|
+
listNavigation$1.floating,
|
|
1708
|
+
dismiss.floating
|
|
1709
|
+
]);
|
|
1710
|
+
const itemProps = listNavigation$1.item ?? EMPTY_OBJECT;
|
|
1316
1711
|
usePopupInteractionProps(store, {
|
|
1317
1712
|
floatingRootContext,
|
|
1318
|
-
activeTriggerProps
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
mergedProps["aria-haspopup"] = "menu";
|
|
1323
|
-
mergedProps["aria-expanded"] = open;
|
|
1324
|
-
return mergedProps;
|
|
1325
|
-
}, [
|
|
1326
|
-
store,
|
|
1327
|
-
typeahead.reference,
|
|
1328
|
-
listNavigation$1.reference,
|
|
1329
|
-
dismiss.reference,
|
|
1330
|
-
interactionTypeProps,
|
|
1331
|
-
open
|
|
1332
|
-
]),
|
|
1333
|
-
inactiveTriggerProps: React$1.useMemo(() => {
|
|
1334
|
-
const mergedProps = mergeProps(listNavigation$1.trigger, dismiss.trigger, interactionTypeProps);
|
|
1335
|
-
mergedProps["aria-haspopup"] = "menu";
|
|
1336
|
-
mergedProps["aria-expanded"] = false;
|
|
1337
|
-
return mergedProps;
|
|
1338
|
-
}, [
|
|
1339
|
-
listNavigation$1.trigger,
|
|
1340
|
-
dismiss.trigger,
|
|
1341
|
-
interactionTypeProps
|
|
1342
|
-
]),
|
|
1343
|
-
popupProps: React$1.useMemo(() => mergeProps(FOCUSABLE_POPUP_PROPS, {
|
|
1344
|
-
id: floatingId,
|
|
1345
|
-
role: "menu",
|
|
1346
|
-
"aria-labelledby": activeTriggerElement?.id,
|
|
1347
|
-
onMouseMove() {
|
|
1348
|
-
store.set("allowMouseEnter", true);
|
|
1349
|
-
if (parent.type === "menu") store.set("hoverEnabled", false);
|
|
1350
|
-
},
|
|
1351
|
-
onClick() {
|
|
1352
|
-
if (store.select("hoverEnabled")) store.set("hoverEnabled", false);
|
|
1353
|
-
},
|
|
1354
|
-
onKeyDown(event) {
|
|
1355
|
-
const relay = store.select("keyboardEventRelay");
|
|
1356
|
-
if (relay && !event.isPropagationStopped()) relay(event);
|
|
1357
|
-
}
|
|
1358
|
-
}, typeahead.floating, listNavigation$1.floating, dismiss.floating), [
|
|
1359
|
-
activeTriggerElement,
|
|
1360
|
-
floatingId,
|
|
1361
|
-
parent.type,
|
|
1362
|
-
store,
|
|
1363
|
-
typeahead.floating,
|
|
1364
|
-
listNavigation$1.floating,
|
|
1365
|
-
dismiss.floating
|
|
1366
|
-
]),
|
|
1367
|
-
itemProps: listNavigation$1.item ?? EMPTY_OBJECT
|
|
1713
|
+
activeTriggerProps,
|
|
1714
|
+
inactiveTriggerProps,
|
|
1715
|
+
popupProps,
|
|
1716
|
+
itemProps
|
|
1368
1717
|
});
|
|
1369
1718
|
const context = React$1.useMemo(() => ({
|
|
1370
1719
|
store,
|
|
1371
|
-
parent: parentFromContext
|
|
1372
|
-
|
|
1373
|
-
|
|
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, {
|
|
1374
1742
|
value: context,
|
|
1375
|
-
children:
|
|
1743
|
+
children: [handle && /*#__PURE__*/ jsx(PopupHandleAttachment, {
|
|
1744
|
+
handle,
|
|
1745
|
+
store
|
|
1746
|
+
}), renderedChildren]
|
|
1376
1747
|
});
|
|
1377
|
-
if (parent.type === void 0 || parent.type === "context-menu")
|
|
1748
|
+
if (parent.type === void 0 || parent.type === "context-menu") content = /*#__PURE__*/ jsx(FloatingTree, {
|
|
1378
1749
|
externalTree: floatingTreeRoot,
|
|
1379
1750
|
children: content
|
|
1380
1751
|
});
|
|
1381
1752
|
return content;
|
|
1382
1753
|
});
|
|
1383
|
-
|
|
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
|
+
});
|
|
1766
|
+
}
|
|
1384
1767
|
//#endregion
|
|
1385
|
-
//#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 = {};
|
|
1386
1770
|
/**
|
|
1387
1771
|
* Groups all parts of a submenu.
|
|
1388
1772
|
* Doesn't render its own HTML element.
|
|
@@ -1390,75 +1774,110 @@ MenuRoot.displayName = "MenuRoot";
|
|
|
1390
1774
|
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
1391
1775
|
*/
|
|
1392
1776
|
function MenuSubmenuRoot(props) {
|
|
1393
|
-
|
|
1394
|
-
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
|
+
}
|
|
1395
1789
|
return /*#__PURE__*/ jsx(MenuSubmenuRootContext.Provider, {
|
|
1396
|
-
value:
|
|
1397
|
-
children: /*#__PURE__*/ jsx(
|
|
1790
|
+
value: EMPTY_SUBMENU_ROOT_CONTEXT,
|
|
1791
|
+
children: /*#__PURE__*/ jsx(MenuRootInternal, {
|
|
1792
|
+
...props,
|
|
1793
|
+
isSubmenu: true
|
|
1794
|
+
})
|
|
1398
1795
|
});
|
|
1399
1796
|
}
|
|
1400
1797
|
//#endregion
|
|
1401
|
-
//#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
|
|
1402
1799
|
function findRootOwnerId(node) {
|
|
1403
|
-
if (isHTMLElement(node) && node.hasAttribute("data-rootownerid")) return node.getAttribute("data-rootownerid")
|
|
1800
|
+
if (isHTMLElement(node) && node.hasAttribute("data-rootownerid")) return node.getAttribute("data-rootownerid");
|
|
1404
1801
|
if (isLastTraversableNode(node)) return;
|
|
1405
1802
|
return findRootOwnerId(getParentNode(node));
|
|
1406
1803
|
}
|
|
1407
1804
|
//#endregion
|
|
1408
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
* Renders a `<div>` element.
|
|
1412
|
-
*
|
|
1413
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
1414
|
-
*/
|
|
1415
|
-
const MenuSubmenuTrigger = /*#__PURE__*/ React$1.forwardRef(function MenuSubmenuTrigger(componentProps, forwardedRef) {
|
|
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
|
|
1806
|
+
const VOICE_OVER_EXPANDED_PROPS = { "aria-expanded": void 0 };
|
|
1807
|
+
const MenuSubmenuTriggerPlain = /*#__PURE__*/ React$1.forwardRef(function MenuSubmenuTriggerPlain(componentProps, forwardedRef) {
|
|
1416
1808
|
const { render, className, style, label, id: idProp, nativeButton = false, openOnHover = true, delay = 100, closeDelay = 0, disabled: disabledProp = false, ...elementProps } = componentProps;
|
|
1417
|
-
const
|
|
1809
|
+
const context = useMenuRootContext(true);
|
|
1810
|
+
if (context?.parent.type !== "menu") throw new Error("Base UI: <Menu.SubmenuTrigger> must be placed in <Menu.SubmenuRoot>.");
|
|
1418
1811
|
const menuPositionerContext = useMenuPositionerContext();
|
|
1419
|
-
const
|
|
1812
|
+
const submenuRootContext = useMenuSubmenuRootContext();
|
|
1813
|
+
const { store, parentVirtualFocus } = context;
|
|
1814
|
+
const parentMenuStore = context.parent.store;
|
|
1815
|
+
const listItem = useCompositeListItem({
|
|
1816
|
+
guess: true,
|
|
1817
|
+
label
|
|
1818
|
+
});
|
|
1420
1819
|
const thisTriggerId = useBaseUiId(idProp);
|
|
1421
1820
|
const open = store.useState("open");
|
|
1821
|
+
const focusReturnedThroughGuardRef = React$1.useRef(false);
|
|
1822
|
+
const positionerElement = store.useState("positionerElement");
|
|
1422
1823
|
const floatingRootContext = store.useState("floatingRootContext");
|
|
1423
1824
|
const floatingTreeRoot = store.useState("floatingTreeRoot");
|
|
1424
1825
|
const popupId = store.useState("triggerPopupId", thisTriggerId);
|
|
1425
1826
|
const baseRegisterTrigger = useTriggerRegistration(thisTriggerId, store);
|
|
1426
|
-
const registerTrigger =
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1827
|
+
const registerTrigger = useStableCallback((element) => {
|
|
1828
|
+
baseRegisterTrigger(element);
|
|
1829
|
+
const activeTriggerElement = store.select("activeTriggerElement");
|
|
1830
|
+
if (element !== null && store.select("open") && (activeTriggerElement === element || store.select("activeTriggerId") == null)) store.update({
|
|
1831
|
+
activeTriggerId: thisTriggerId ?? null,
|
|
1430
1832
|
activeTriggerElement: element,
|
|
1431
1833
|
closeDelay
|
|
1432
1834
|
});
|
|
1433
|
-
|
|
1434
|
-
}, [
|
|
1435
|
-
baseRegisterTrigger,
|
|
1436
|
-
closeDelay,
|
|
1437
|
-
store,
|
|
1438
|
-
thisTriggerId
|
|
1439
|
-
]);
|
|
1835
|
+
});
|
|
1440
1836
|
const triggerElementRef = React$1.useRef(null);
|
|
1441
1837
|
const handleTriggerElementRef = React$1.useCallback((el) => {
|
|
1442
1838
|
triggerElementRef.current = el;
|
|
1443
1839
|
store.set("activeTriggerElement", el);
|
|
1444
1840
|
}, [store]);
|
|
1445
|
-
|
|
1446
|
-
|
|
1841
|
+
useIsoLayoutEffect(() => {
|
|
1842
|
+
registerTrigger(triggerElementRef.current);
|
|
1843
|
+
return () => registerTrigger(null);
|
|
1844
|
+
}, [
|
|
1845
|
+
registerTrigger,
|
|
1846
|
+
thisTriggerId,
|
|
1847
|
+
store
|
|
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
|
+
]);
|
|
1447
1864
|
store.useSyncedValue("closeDelay", closeDelay);
|
|
1448
|
-
const parentMenuStore = submenuRootContext.parentMenu;
|
|
1449
1865
|
const rootDisabled = store.useState("disabled");
|
|
1450
1866
|
const parentDisabled = parentMenuStore.useState("disabled");
|
|
1451
1867
|
const disabled = disabledProp || rootDisabled || parentDisabled;
|
|
1452
|
-
|
|
1868
|
+
React$1.useEffect(() => {
|
|
1453
1869
|
const element = triggerElementRef.current;
|
|
1454
|
-
if (element && isElementDisabled(element) && !disabled)
|
|
1870
|
+
if (element && isElementDisabled(element) && !disabled) {
|
|
1871
|
+
const ownerStackMessage = SafeReact.captureOwnerStack?.() || "";
|
|
1872
|
+
warn(`A disabled element was detected on <Menu.SubmenuTrigger>. To properly disable the trigger, use the \`disabled\` prop on the component instead of setting it on the rendered element.${ownerStackMessage}`);
|
|
1873
|
+
}
|
|
1455
1874
|
});
|
|
1456
1875
|
const itemProps = parentMenuStore.useState("itemProps");
|
|
1457
1876
|
const highlighted = parentMenuStore.useState("isActive", listItem.index);
|
|
1458
1877
|
const itemMetadata = React$1.useMemo(() => ({
|
|
1459
1878
|
type: "submenu-trigger",
|
|
1460
|
-
setActive() {
|
|
1461
|
-
if (parentMenuStore.select("highlightItemOnHover")) parentMenuStore.
|
|
1879
|
+
setActive(event) {
|
|
1880
|
+
if (parentMenuStore.select("highlightItemOnHover")) parentMenuStore.setActiveIndex(listItem.index, pointer, event);
|
|
1462
1881
|
}
|
|
1463
1882
|
}), [parentMenuStore, listItem.index]);
|
|
1464
1883
|
const { getItemProps, itemRef } = useMenuItem({
|
|
@@ -1472,8 +1891,9 @@ const MenuSubmenuTrigger = /*#__PURE__*/ React$1.forwardRef(function MenuSubmenu
|
|
|
1472
1891
|
itemMetadata,
|
|
1473
1892
|
nodeId: menuPositionerContext?.context.nodeId
|
|
1474
1893
|
});
|
|
1894
|
+
const hoverEnabled = store.useState("hoverEnabled");
|
|
1475
1895
|
const hoverProps = useHoverReferenceInteraction(floatingRootContext, {
|
|
1476
|
-
enabled:
|
|
1896
|
+
enabled: hoverEnabled && openOnHover && !disabled,
|
|
1477
1897
|
handleClose: safePolygon({ blockPointerEvents: true }),
|
|
1478
1898
|
mouseOnly: true,
|
|
1479
1899
|
move: true,
|
|
@@ -1485,34 +1905,48 @@ const MenuSubmenuTrigger = /*#__PURE__*/ React$1.forwardRef(function MenuSubmenu
|
|
|
1485
1905
|
shouldOpen: delay > 0 ? () => parentMenuStore.select("allowMouseEnter") : void 0,
|
|
1486
1906
|
triggerElementRef,
|
|
1487
1907
|
externalTree: floatingTreeRoot,
|
|
1488
|
-
isClosing: () => store.select("transitionStatus") === "ending"
|
|
1908
|
+
isClosing: () => store.select("transitionStatus") === "ending",
|
|
1909
|
+
guardStaleOpen: true
|
|
1489
1910
|
});
|
|
1490
1911
|
const localInteractionProps = useClick(floatingRootContext, {
|
|
1491
1912
|
enabled: !disabled,
|
|
1492
1913
|
event: "mousedown",
|
|
1493
|
-
toggle:
|
|
1914
|
+
toggle: true,
|
|
1494
1915
|
ignoreMouse: openOnHover,
|
|
1495
|
-
stickIfOpen:
|
|
1916
|
+
stickIfOpen: openOnHover
|
|
1496
1917
|
}).reference ?? EMPTY_OBJECT;
|
|
1497
1918
|
const rootTriggerProps = store.useState("triggerProps", true);
|
|
1498
1919
|
delete rootTriggerProps.id;
|
|
1920
|
+
const state = {
|
|
1921
|
+
disabled,
|
|
1922
|
+
highlighted,
|
|
1923
|
+
open
|
|
1924
|
+
};
|
|
1925
|
+
const openMethod = store.useState("openMethod");
|
|
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;
|
|
1499
1929
|
return useRenderElement("div", componentProps, {
|
|
1500
|
-
state
|
|
1501
|
-
disabled,
|
|
1502
|
-
highlighted,
|
|
1503
|
-
open
|
|
1504
|
-
},
|
|
1930
|
+
state,
|
|
1505
1931
|
stateAttributesMapping: triggerOpenStateMapping,
|
|
1506
1932
|
props: [
|
|
1507
1933
|
localInteractionProps,
|
|
1508
1934
|
hoverProps,
|
|
1509
1935
|
rootTriggerProps,
|
|
1936
|
+
submenuKeyDownProps,
|
|
1510
1937
|
itemProps,
|
|
1938
|
+
shouldOmitExpanded ? VOICE_OVER_EXPANDED_PROPS : void 0,
|
|
1511
1939
|
{
|
|
1512
1940
|
"aria-controls": popupId,
|
|
1513
|
-
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
|
+
},
|
|
1514
1948
|
onBlur() {
|
|
1515
|
-
if (highlighted) parentMenuStore.
|
|
1949
|
+
if (highlighted) parentMenuStore.setActiveIndex(null, none);
|
|
1516
1950
|
}
|
|
1517
1951
|
},
|
|
1518
1952
|
elementProps,
|
|
@@ -1527,6 +1961,16 @@ const MenuSubmenuTrigger = /*#__PURE__*/ React$1.forwardRef(function MenuSubmenu
|
|
|
1527
1961
|
]
|
|
1528
1962
|
});
|
|
1529
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
|
+
});
|
|
1530
1974
|
MenuSubmenuTrigger.displayName = "MenuSubmenuTrigger";
|
|
1531
1975
|
//#endregion
|
|
1532
|
-
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 };
|