@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
package/dist/chunks/{SelectGroupLabel-m4h5hrft9043nsd1.js → SelectSeparator-nnak70azojox8b2b.js}
RENAMED
|
@@ -1,119 +1,130 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
5
|
-
import { n as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { t as
|
|
11
|
-
import { t as
|
|
12
|
-
import { t as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { i as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { t as
|
|
21
|
-
import { t as useFloatingRootContext } from "./useFloatingRootContext-
|
|
22
|
-
import {
|
|
23
|
-
import { t as
|
|
24
|
-
import { t as
|
|
25
|
-
import { t as
|
|
26
|
-
import { n as useDirection } from "./DirectionContext-
|
|
27
|
-
import { t as inertValue } from "./inertValue-
|
|
28
|
-
import { t as usePreviousValue } from "./usePreviousValue-
|
|
29
|
-
import { a as useFieldRootContext, c as fieldValidityMapping, n as useLabelableContext } from "./LabelableContext-
|
|
30
|
-
import { n as useFormContext } from "./FormContext-
|
|
31
|
-
import { t as useLabelableId } from "./useLabelableId-
|
|
32
|
-
import {
|
|
33
|
-
import { t as
|
|
34
|
-
import { t as useRegisterFieldControl } from "./useRegisterFieldControl-
|
|
35
|
-
import { t as
|
|
36
|
-
import { t as
|
|
37
|
-
import { t as
|
|
38
|
-
import { t as clamp } from "./clamp-
|
|
39
|
-
import { a as
|
|
40
|
-
import { n as
|
|
41
|
-
import { t as
|
|
42
|
-
import { t as
|
|
43
|
-
import { t as
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import { t as
|
|
47
|
-
import {
|
|
48
|
-
import { n as
|
|
49
|
-
import {
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-hi7ti5xiuxsegr96.js";
|
|
3
|
+
import { c as NOOP, f as useMergedRefs, i as mergeProps, n as useRenderElement, o as EMPTY_ARRAY, p as useRefWithInit, s as EMPTY_OBJECT } from "./useRenderElement-nkklxbq1rp7h2kw0.js";
|
|
4
|
+
import { a as FloatingPortal, f as DROPDOWN_COLLISION_AVOIDANCE, n as ReactStore } from "./FloatingRootStore-men6ufp3a2b296fh.js";
|
|
5
|
+
import { n as useIsoLayoutEffect } from "./safeReact-ek77ilng4ekk7mgz.js";
|
|
6
|
+
import { n as useTimeout } from "./useTimeout-f0ayn2l2l9aop4l8.js";
|
|
7
|
+
import { H as transitionStatusMapping, M as triggerOpenStateMapping, N as popupOpen$1, P as pressed$1, Q as contains, j as pressableTriggerOpenStateMapping, k as popupStateMapping, rt as isVirtualClick, v as ownerDocument, y as getFloatingFocusElement } from "./vendor-utils-io8z5lsfxq8m2dcc.js";
|
|
8
|
+
import { n as webkit } from "./engine-hzmefiqm63hu0c7i.js";
|
|
9
|
+
import { c as platform, v as rectToClientRect, w as getWindow } from "./vendor-floating-ui-fqblx3wa0r71mjoo.js";
|
|
10
|
+
import { t as createChangeEventDetails } from "./createBaseUIEventDetails-nvee6bghv2reeqdb.js";
|
|
11
|
+
import { I as windowResize, d as imperativeAction, t as cancelOpen, w as none, y as itemPress } from "./reason-parts-hssx64rmlxyn6gw5.js";
|
|
12
|
+
import { t as addEventListener } from "./addEventListener-ku3x23446prmd1kz.js";
|
|
13
|
+
import { t as useValueAsRef } from "./useValueAsRef-dv0tmfr1xlpzdlru.js";
|
|
14
|
+
import { t as useStableCallback } from "./useStableCallback-le5qgj6p9l04729n.js";
|
|
15
|
+
import { n as useAnimationFrame } from "./useAnimationFrame-k9lqdj9quln3sd85.js";
|
|
16
|
+
import { n as visuallyHiddenInput, t as visuallyHidden } from "./visuallyHidden-kzzs9hbe93is3rci.js";
|
|
17
|
+
import { g as useDismiss, i as attachPreventUnmountOnClose, m as useUnmountAfterClose, t as FOCUSABLE_POPUP_PROPS } from "./popupStoreUtils-czfnxn051xakask5.js";
|
|
18
|
+
import { n as InternalBackdrop, o as FloatingFocusManager, r as useOpenInteractionType } from "./useScrollLock-le7ajwlt7oh6fzxi.js";
|
|
19
|
+
import { t as useOpenChangeComplete } from "./useOpenChangeComplete-edtabjwqmechsyv6.js";
|
|
20
|
+
import { t as useClick } from "./useClick-pcbkcc7r620v1smu.js";
|
|
21
|
+
import { t as useFloatingRootContext } from "./useFloatingRootContext-k676b6m7f80bdapd.js";
|
|
22
|
+
import { a as useListNavigation } from "./useListNavigation-hpddbd0cc9pvt461.js";
|
|
23
|
+
import { t as useTypeahead } from "./useTypeahead-kfdsw1ksl5bgvvzl.js";
|
|
24
|
+
import { t as useBaseUiId } from "./useBaseUiId-nk4k7nj9h1cy76ny.js";
|
|
25
|
+
import { n as getDisabledMountTransitionStyles, r as useAnchorPositioning, t as usePositioner } from "./usePositioner-mzvgnazldqvy44z2.js";
|
|
26
|
+
import { n as useDirection } from "./DirectionContext-kpby968j030psajn.js";
|
|
27
|
+
import { t as inertValue } from "./inertValue-n09gkjvwwa1kddov.js";
|
|
28
|
+
import { t as usePreviousValue } from "./usePreviousValue-o6swt5tb7xhpdu4e.js";
|
|
29
|
+
import { a as useFieldRootContext, c as fieldValidityMapping, n as useLabelableContext } from "./LabelableContext-dz4wz3lu3lgqusu7.js";
|
|
30
|
+
import { n as useFormContext } from "./FormContext-jv19engyccpf6xcl.js";
|
|
31
|
+
import { t as useLabelableId } from "./useLabelableId-bjeh6q3pgrqjb7er.js";
|
|
32
|
+
import { r as useLabel } from "./useLabel-me6zzfvkypo458pi.js";
|
|
33
|
+
import { t as useSetFieldFocused } from "./useSetFieldFocused-fbvj7gcv67dqfkp0.js";
|
|
34
|
+
import { t as useRegisterFieldControl } from "./useRegisterFieldControl-m1stc9l9y4cndf0k.js";
|
|
35
|
+
import { t as useValueChanged } from "./useValueChanged-fjssa2v6d4w8y332.js";
|
|
36
|
+
import { t as useControlled } from "./useControlled-i3srnkxy598s0au9.js";
|
|
37
|
+
import { t as useButton } from "./useButton-lklvdzuhvj22bx07.js";
|
|
38
|
+
import { t as clamp } from "./clamp-rcpupxvhqrn8uuyf.js";
|
|
39
|
+
import { a as isSelectedValueDirty, i as findSelectionIndex, l as useOnFirstRender, n as defaultItemEquality, o as removeItem, r as findItemIndex, s as resolveSelectedIndex, t as compareItemEquality } from "./itemEquality-ki3x4tzdhjlqjey6.js";
|
|
40
|
+
import { a as resolveSelectedLabel, i as resolveMultipleLabels, n as hasNullItemLabel, o as stringifyAsLabel, s as stringifyAsValue } from "./resolveValueLabel-ntacnb58mhka5gg0.js";
|
|
41
|
+
import { n as resolveAriaLabelledBy, t as getDefaultLabelId } from "./resolveAriaLabelledBy-knaucrjrjwnk7tvs.js";
|
|
42
|
+
import { t as isMouseWithinBounds } from "./getPseudoElementBounds-csuw8kwsoeyxd5tv.js";
|
|
43
|
+
import { t as CompositeList } from "./CompositeList-gwuaf6d14s4da0j0.js";
|
|
44
|
+
import { t as useAnchoredPopupScrollLock } from "./useAnchoredPopupScrollLock-msm8tzkewysnunut.js";
|
|
45
|
+
import { t as useCompositeListItem } from "./useCompositeListItem-ekwo2j2rjkggg7xj.js";
|
|
46
|
+
import { t as ItemIndicator } from "./ItemIndicator-cvf8cw5fv5l3cd8j.js";
|
|
47
|
+
import { t as ListboxSeparator } from "./ListboxSeparator-skazx18vzzj7i9zp.js";
|
|
48
|
+
import { n as useToolbarRootContext } from "./ToolbarRootContext-difqbj720teyt8lu.js";
|
|
49
|
+
import { t as isElementDisabled } from "./isElementDisabled-dyqutxpzdfppbohx.js";
|
|
50
|
+
import { a as COMPOSITE_KEYS } from "./composite-c11t1ok72s3cggjc.js";
|
|
51
|
+
import { n as getMaxScrollOffset, r as normalizeScrollOffset, t as styleDisableScrollbar } from "./styles-eb8bvypmayf578jf.js";
|
|
52
|
+
import { n as useCSPContext } from "./CSPContext-iv67i0qqhihg8mur.js";
|
|
50
53
|
import * as React$1 from "react";
|
|
51
54
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
52
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
53
|
-
const SelectRootContext = /*#__PURE__*/ React$1.createContext(
|
|
55
|
+
//#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/select/root/SelectRootContext.mjs
|
|
56
|
+
const SelectRootContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
54
57
|
SelectRootContext.displayName = "SelectRootContext";
|
|
55
|
-
const SelectFloatingContext = /*#__PURE__*/ React$1.createContext(
|
|
58
|
+
const SelectFloatingContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
56
59
|
SelectFloatingContext.displayName = "SelectFloatingContext";
|
|
57
60
|
function useSelectRootContext() {
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
60
|
-
return
|
|
61
|
+
const store = React$1.useContext(SelectRootContext);
|
|
62
|
+
if (store === void 0) throw new Error("Base UI: SelectRootContext is missing. Select parts must be placed within <Select.Root>.");
|
|
63
|
+
return store;
|
|
61
64
|
}
|
|
62
65
|
function useSelectFloatingContext() {
|
|
63
66
|
const context = React$1.useContext(SelectFloatingContext);
|
|
64
|
-
if (context ===
|
|
67
|
+
if (context === void 0) throw new Error("Base UI: SelectFloatingContext is missing. Select parts must be placed within <Select.Root>.");
|
|
65
68
|
return context;
|
|
66
69
|
}
|
|
67
70
|
//#endregion
|
|
68
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
71
|
+
//#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/select/store.mjs
|
|
72
|
+
/**
|
|
73
|
+
* Non-reactive values shared with the select parts. Nothing here is observable through
|
|
74
|
+
* `selectors`, so writing to a ref never notifies subscribers.
|
|
75
|
+
*/
|
|
69
76
|
const selectors = {
|
|
70
|
-
id:
|
|
71
|
-
labelId:
|
|
72
|
-
modal:
|
|
73
|
-
multiple:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
id: (state) => state.id,
|
|
78
|
+
labelId: (state) => state.labelId,
|
|
79
|
+
modal: (state) => state.modal,
|
|
80
|
+
multiple: (state) => state.multiple,
|
|
81
|
+
disabled: (state) => state.disabled,
|
|
82
|
+
readOnly: (state) => state.readOnly,
|
|
83
|
+
required: (state) => state.required,
|
|
84
|
+
highlightItemOnHover: (state) => state.highlightItemOnHover,
|
|
85
|
+
items: (state) => state.items,
|
|
86
|
+
itemToStringLabel: (state) => state.itemToStringLabel,
|
|
87
|
+
isItemEqualToValue: (state) => state.isItemEqualToValue,
|
|
88
|
+
value: (state) => state.value,
|
|
89
|
+
hasSelectedValue: (state) => {
|
|
80
90
|
const { value, multiple, itemToStringValue } = state;
|
|
81
91
|
if (value == null) return false;
|
|
82
92
|
if (multiple && Array.isArray(value)) return value.length > 0;
|
|
83
93
|
return stringifyAsValue(value, itemToStringValue) !== "";
|
|
84
|
-
}
|
|
85
|
-
hasNullItemLabel:
|
|
94
|
+
},
|
|
95
|
+
hasNullItemLabel: (state, enabled) => {
|
|
86
96
|
return enabled ? hasNullItemLabel(state.items) : false;
|
|
87
|
-
}
|
|
88
|
-
open:
|
|
89
|
-
mounted:
|
|
90
|
-
forceMount:
|
|
91
|
-
transitionStatus:
|
|
92
|
-
openMethod:
|
|
93
|
-
activeIndex:
|
|
94
|
-
selectedIndex:
|
|
95
|
-
isActive:
|
|
96
|
-
isSelected:
|
|
97
|
+
},
|
|
98
|
+
open: (state) => state.open,
|
|
99
|
+
mounted: (state) => state.mounted,
|
|
100
|
+
forceMount: (state) => state.forceMount,
|
|
101
|
+
transitionStatus: (state) => state.transitionStatus,
|
|
102
|
+
openMethod: (state) => state.openMethod,
|
|
103
|
+
activeIndex: (state) => state.activeIndex,
|
|
104
|
+
selectedIndex: (state) => state.selectedIndex,
|
|
105
|
+
isActive: (state, index) => state.activeIndex === index,
|
|
106
|
+
isSelected: (state, itemValue) => {
|
|
97
107
|
const comparer = state.isItemEqualToValue;
|
|
98
108
|
const storeValue = state.value;
|
|
99
109
|
if (state.multiple) return Array.isArray(storeValue) && storeValue.some((selectedItem) => compareItemEquality(itemValue, selectedItem, comparer));
|
|
100
110
|
return compareItemEquality(itemValue, storeValue, comparer);
|
|
101
|
-
}
|
|
102
|
-
isSelectedByFocus:
|
|
111
|
+
},
|
|
112
|
+
isSelectedByFocus: (state, index) => {
|
|
103
113
|
return state.selectedIndex === index;
|
|
104
|
-
}
|
|
105
|
-
popupProps:
|
|
106
|
-
triggerProps:
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
+
},
|
|
115
|
+
popupProps: (state) => state.popupProps,
|
|
116
|
+
triggerProps: (state) => state.triggerProps,
|
|
117
|
+
itemRoot: (state) => state.itemRoot,
|
|
118
|
+
triggerElement: (state) => state.triggerElement,
|
|
119
|
+
positionerElement: (state) => state.positionerElement,
|
|
120
|
+
listElement: (state) => state.listElement,
|
|
121
|
+
popupSide: (state) => state.popupSide,
|
|
122
|
+
scrollUpArrowVisible: (state) => state.scrollUpArrowVisible,
|
|
123
|
+
scrollDownArrowVisible: (state) => state.scrollDownArrowVisible,
|
|
124
|
+
hasScrollArrows: (state) => state.hasScrollArrows
|
|
114
125
|
};
|
|
115
126
|
//#endregion
|
|
116
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
127
|
+
//#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/select/root/SelectRoot.mjs
|
|
117
128
|
/**
|
|
118
129
|
* Groups all parts of the select.
|
|
119
130
|
* Doesn't render its own HTML element.
|
|
@@ -155,27 +166,38 @@ function SelectRoot(props) {
|
|
|
155
166
|
dragY: 0
|
|
156
167
|
});
|
|
157
168
|
const alignItemWithTriggerActiveRef = React$1.useRef(false);
|
|
158
|
-
const
|
|
169
|
+
const initialValueRef = React$1.useRef(value);
|
|
159
170
|
const { openMethod, triggerProps: interactionTypeProps } = useOpenInteractionType(open);
|
|
160
|
-
const store = useRefWithInit(() => new
|
|
171
|
+
const store = useRefWithInit(() => new ReactStore({
|
|
161
172
|
id: generatedId,
|
|
162
173
|
labelId: void 0,
|
|
163
174
|
modal,
|
|
164
175
|
multiple,
|
|
176
|
+
disabled,
|
|
177
|
+
readOnly,
|
|
178
|
+
required,
|
|
179
|
+
highlightItemOnHover,
|
|
165
180
|
itemToStringLabel,
|
|
166
181
|
itemToStringValue,
|
|
167
182
|
isItemEqualToValue,
|
|
168
183
|
value,
|
|
169
184
|
open,
|
|
170
|
-
mounted,
|
|
171
|
-
transitionStatus,
|
|
185
|
+
mounted: open,
|
|
186
|
+
transitionStatus: void 0,
|
|
172
187
|
items,
|
|
173
188
|
forceMount: false,
|
|
174
189
|
openMethod: null,
|
|
175
190
|
activeIndex: null,
|
|
176
191
|
selectedIndex: null,
|
|
177
|
-
popupProps:
|
|
178
|
-
triggerProps:
|
|
192
|
+
popupProps: EMPTY_OBJECT,
|
|
193
|
+
triggerProps: EMPTY_OBJECT,
|
|
194
|
+
itemRoot: {
|
|
195
|
+
props: EMPTY_OBJECT,
|
|
196
|
+
multiple,
|
|
197
|
+
disabled,
|
|
198
|
+
readOnly,
|
|
199
|
+
isItemEqualToValue
|
|
200
|
+
},
|
|
179
201
|
triggerElement: null,
|
|
180
202
|
positionerElement: null,
|
|
181
203
|
listElement: null,
|
|
@@ -183,13 +205,47 @@ function SelectRoot(props) {
|
|
|
183
205
|
scrollUpArrowVisible: false,
|
|
184
206
|
scrollDownArrowVisible: false,
|
|
185
207
|
hasScrollArrows: false
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
208
|
+
}, {
|
|
209
|
+
setValue: NOOP,
|
|
210
|
+
setOpen: NOOP,
|
|
211
|
+
handleScrollArrowVisibility: NOOP,
|
|
212
|
+
onOpenChangeComplete: NOOP,
|
|
213
|
+
listRef,
|
|
214
|
+
popupRef,
|
|
215
|
+
scrollHandlerRef,
|
|
216
|
+
scrollArrowsMountedCountRef,
|
|
217
|
+
valueRef,
|
|
218
|
+
valuesRef,
|
|
219
|
+
labelsRef,
|
|
220
|
+
typingRef,
|
|
221
|
+
selectionRef,
|
|
222
|
+
firstItemTextRef,
|
|
223
|
+
selectedItemTextRef,
|
|
224
|
+
alignItemWithTriggerActiveRef,
|
|
225
|
+
initialValueRef
|
|
226
|
+
}, selectors)).current;
|
|
227
|
+
const [preventUnmountOnClose, setPreventUnmountOnClose] = React$1.useState(false);
|
|
228
|
+
const { mounted, transitionStatus, forceUnmount: handleUnmount } = useUnmountAfterClose({
|
|
229
|
+
open,
|
|
230
|
+
ref: popupRef,
|
|
231
|
+
preventUnmountOnClose,
|
|
232
|
+
setPreventUnmountOnClose,
|
|
233
|
+
onUnmount() {
|
|
234
|
+
store.update({
|
|
235
|
+
activeIndex: null,
|
|
236
|
+
openMethod: null,
|
|
237
|
+
scrollUpArrowVisible: false,
|
|
238
|
+
scrollDownArrowVisible: false
|
|
239
|
+
});
|
|
240
|
+
onOpenChangeComplete?.(false);
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
const activeIndex = store.useState("activeIndex");
|
|
244
|
+
const selectedIndex = store.useState("selectedIndex");
|
|
245
|
+
const triggerElement = store.useState("triggerElement");
|
|
246
|
+
const positionerElement = store.useState("positionerElement");
|
|
191
247
|
const previousOpenMethod = usePreviousValue(openMethod);
|
|
192
|
-
const renderedOpenMethod = openMethod ?? previousOpenMethod
|
|
248
|
+
const renderedOpenMethod = openMethod ?? previousOpenMethod;
|
|
193
249
|
const serializedValue = React$1.useMemo(() => {
|
|
194
250
|
if (multiple) return "";
|
|
195
251
|
return stringifyAsValue(value, itemToStringValue);
|
|
@@ -206,56 +262,36 @@ function SelectRoot(props) {
|
|
|
206
262
|
value,
|
|
207
263
|
itemToStringValue
|
|
208
264
|
]);
|
|
209
|
-
|
|
210
|
-
const
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
if (value !== initialValueRef.current) store.set("forceMount", true);
|
|
214
|
-
}, [store, value]);
|
|
265
|
+
const controlRef = useValueAsRef(triggerElement);
|
|
266
|
+
const getStringifiedValueForForm = useStableCallback(() => fieldStringValue);
|
|
267
|
+
useRegisterFieldControl(controlRef, generatedId, value, getStringifiedValueForForm, !disabled, nameProp);
|
|
268
|
+
const hasSelectedValue = multiple ? Array.isArray(value) && value.length > 0 : value != null && serializedValue !== "";
|
|
215
269
|
useIsoLayoutEffect(() => {
|
|
216
270
|
setFilled(hasSelectedValue);
|
|
217
271
|
}, [hasSelectedValue, setFilled]);
|
|
218
272
|
useIsoLayoutEffect(function syncSelectedIndex() {
|
|
219
|
-
const
|
|
220
|
-
let nextIndex;
|
|
221
|
-
if (multiple) {
|
|
222
|
-
const currentValue = Array.isArray(value) ? value : [];
|
|
223
|
-
if (currentValue.length === 0) nextIndex = null;
|
|
224
|
-
else {
|
|
225
|
-
const lastValue = currentValue[currentValue.length - 1];
|
|
226
|
-
const lastIndex = findItemIndex(registry, lastValue, isItemEqualToValue);
|
|
227
|
-
nextIndex = lastIndex === -1 ? null : lastIndex;
|
|
228
|
-
}
|
|
229
|
-
} else {
|
|
230
|
-
const index = findItemIndex(registry, value, isItemEqualToValue);
|
|
231
|
-
nextIndex = index === -1 ? null : index;
|
|
232
|
-
}
|
|
273
|
+
const nextIndex = findSelectionIndex(valuesRef.current, value, isItemEqualToValue, multiple);
|
|
233
274
|
if (nextIndex === null) selectedItemTextRef.current = null;
|
|
234
275
|
if (open) return;
|
|
235
276
|
store.set("selectedIndex", nextIndex);
|
|
236
277
|
}, [
|
|
237
|
-
hasSelectedValue,
|
|
238
278
|
multiple,
|
|
239
279
|
open,
|
|
240
280
|
value,
|
|
241
|
-
valuesRef,
|
|
242
281
|
isItemEqualToValue,
|
|
243
|
-
store
|
|
244
|
-
selectedItemTextRef
|
|
282
|
+
store
|
|
245
283
|
]);
|
|
246
|
-
function isSelectedValueDirty(currentValue) {
|
|
247
|
-
const initialValue = validityData.initialValue;
|
|
248
|
-
if (Array.isArray(currentValue) && Array.isArray(initialValue)) return !areArraysEqual(currentValue, initialValue, (itemValue, initialItemValue) => compareItemEquality(itemValue, initialItemValue, isItemEqualToValue));
|
|
249
|
-
return currentValue !== initialValue;
|
|
250
|
-
}
|
|
251
284
|
useValueChanged(value, () => {
|
|
252
285
|
clearErrors(name);
|
|
253
|
-
setDirty(isSelectedValueDirty(value));
|
|
286
|
+
setDirty(isSelectedValueDirty(value, validityData.initialValue, isItemEqualToValue));
|
|
254
287
|
validation.change(value);
|
|
255
288
|
});
|
|
256
289
|
const setOpen = useStableCallback((nextOpen, eventDetails) => {
|
|
257
|
-
|
|
290
|
+
const openEventDetails = eventDetails;
|
|
291
|
+
const shouldPreventUnmountOnClose = attachPreventUnmountOnClose(openEventDetails);
|
|
292
|
+
onOpenChange?.(nextOpen, openEventDetails);
|
|
258
293
|
if (eventDetails.isCanceled) return;
|
|
294
|
+
if (!nextOpen) setPreventUnmountOnClose(shouldPreventUnmountOnClose());
|
|
259
295
|
setOpenUnwrapped(nextOpen);
|
|
260
296
|
if (!nextOpen && (eventDetails.reason === "focus-out" || eventDetails.reason === "outside-press")) {
|
|
261
297
|
setTouched(true);
|
|
@@ -263,37 +299,28 @@ function SelectRoot(props) {
|
|
|
263
299
|
if (validationMode === "onBlur") validation.commit(value);
|
|
264
300
|
}
|
|
265
301
|
});
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
openMethod: null
|
|
271
|
-
});
|
|
272
|
-
onOpenChangeComplete?.(false);
|
|
273
|
-
});
|
|
274
|
-
useOpenChangeComplete({
|
|
275
|
-
enabled: !actionsRef,
|
|
276
|
-
open,
|
|
277
|
-
ref: popupRef,
|
|
278
|
-
onComplete() {
|
|
279
|
-
if (!open) handleUnmount();
|
|
302
|
+
React$1.useImperativeHandle(actionsRef, () => ({
|
|
303
|
+
unmount: handleUnmount,
|
|
304
|
+
close: () => {
|
|
305
|
+
if (store.state.open) setOpen(false, createChangeEventDetails(imperativeAction));
|
|
280
306
|
}
|
|
281
|
-
})
|
|
282
|
-
|
|
307
|
+
}), [
|
|
308
|
+
handleUnmount,
|
|
309
|
+
setOpen,
|
|
310
|
+
store
|
|
311
|
+
]);
|
|
283
312
|
const setValue = useStableCallback((nextValue, eventDetails) => {
|
|
284
313
|
onValueChange?.(nextValue, eventDetails);
|
|
285
314
|
if (eventDetails.isCanceled) return;
|
|
286
315
|
setValueUnwrapped(nextValue);
|
|
287
316
|
});
|
|
288
|
-
const handleScrollArrowVisibility = useStableCallback(() => {
|
|
289
|
-
const scroller = store.state.listElement || popupRef.current;
|
|
290
|
-
if (!scroller) return;
|
|
317
|
+
const handleScrollArrowVisibility = useStableCallback((scroller) => {
|
|
291
318
|
const maxScrollTop = getMaxScrollOffset(scroller.scrollHeight, scroller.clientHeight);
|
|
292
319
|
const scrollTop = normalizeScrollOffset(scroller.scrollTop, maxScrollTop);
|
|
293
320
|
const shouldShowUp = scrollTop > 0;
|
|
294
321
|
const shouldShowDown = scrollTop < maxScrollTop;
|
|
295
|
-
|
|
296
|
-
|
|
322
|
+
store.set("scrollUpArrowVisible", shouldShowUp);
|
|
323
|
+
store.set("scrollDownArrowVisible", shouldShowDown);
|
|
297
324
|
});
|
|
298
325
|
const floatingContext = useFloatingRootContext({
|
|
299
326
|
open,
|
|
@@ -304,12 +331,12 @@ function SelectRoot(props) {
|
|
|
304
331
|
}
|
|
305
332
|
});
|
|
306
333
|
const click = useClick(floatingContext, {
|
|
307
|
-
enabled: !
|
|
334
|
+
enabled: !disabled,
|
|
308
335
|
event: "mousedown"
|
|
309
336
|
});
|
|
310
337
|
const dismiss = useDismiss(floatingContext);
|
|
311
338
|
const listNavigation = useListNavigation(floatingContext, {
|
|
312
|
-
enabled: !
|
|
339
|
+
enabled: !disabled,
|
|
313
340
|
listRef,
|
|
314
341
|
activeIndex,
|
|
315
342
|
selectedIndex,
|
|
@@ -321,30 +348,25 @@ function SelectRoot(props) {
|
|
|
321
348
|
focusItemOnHover: highlightItemOnHover
|
|
322
349
|
});
|
|
323
350
|
const typeahead = useTypeahead(floatingContext, {
|
|
324
|
-
enabled: !
|
|
351
|
+
enabled: !disabled && (open || !readOnly && !multiple),
|
|
325
352
|
listRef: labelsRef,
|
|
326
353
|
activeIndex,
|
|
327
354
|
selectedIndex,
|
|
328
355
|
disabledIndices: (index) => isElementDisabled(listRef.current[index]),
|
|
329
356
|
onMatch(index) {
|
|
330
357
|
if (open) store.set("activeIndex", index);
|
|
331
|
-
else setValue(valuesRef.current[index], createChangeEventDetails(
|
|
358
|
+
else setValue(valuesRef.current[index], createChangeEventDetails(none));
|
|
332
359
|
},
|
|
333
360
|
onTyping(typing) {
|
|
334
361
|
typingRef.current = typing;
|
|
335
362
|
}
|
|
336
363
|
});
|
|
337
|
-
const mergedTriggerProps = React$1.useMemo(() =>
|
|
338
|
-
const triggerInteractionProps = mergeProps(typeahead.reference, listNavigation.reference, dismiss.reference, click.reference, interactionTypeProps);
|
|
339
|
-
if (generatedId) triggerInteractionProps.id = generatedId;
|
|
340
|
-
return triggerInteractionProps;
|
|
341
|
-
}, [
|
|
364
|
+
const mergedTriggerProps = React$1.useMemo(() => mergeProps(typeahead.reference, listNavigation.reference, dismiss.reference, click.reference, interactionTypeProps), [
|
|
342
365
|
click.reference,
|
|
343
366
|
typeahead.reference,
|
|
344
367
|
listNavigation.reference,
|
|
345
368
|
dismiss.reference,
|
|
346
|
-
interactionTypeProps
|
|
347
|
-
generatedId
|
|
369
|
+
interactionTypeProps
|
|
348
370
|
]);
|
|
349
371
|
const popupProps = React$1.useMemo(() => mergeProps(FOCUSABLE_POPUP_PROPS, typeahead.floating, listNavigation.floating, dismiss.floating), [
|
|
350
372
|
typeahead.floating,
|
|
@@ -352,90 +374,52 @@ function SelectRoot(props) {
|
|
|
352
374
|
dismiss.floating
|
|
353
375
|
]);
|
|
354
376
|
const itemProps = listNavigation.item ?? EMPTY_OBJECT;
|
|
377
|
+
const itemRoot = React$1.useMemo(() => ({
|
|
378
|
+
props: itemProps,
|
|
379
|
+
multiple,
|
|
380
|
+
disabled,
|
|
381
|
+
readOnly,
|
|
382
|
+
isItemEqualToValue
|
|
383
|
+
}), [
|
|
384
|
+
itemProps,
|
|
385
|
+
multiple,
|
|
386
|
+
disabled,
|
|
387
|
+
readOnly,
|
|
388
|
+
isItemEqualToValue
|
|
389
|
+
]);
|
|
390
|
+
store.useContextCallback("setValue", setValue);
|
|
391
|
+
store.useContextCallback("setOpen", setOpen);
|
|
392
|
+
store.useContextCallback("handleScrollArrowVisibility", handleScrollArrowVisibility);
|
|
393
|
+
store.useContextCallback("onOpenChangeComplete", onOpenChangeComplete);
|
|
355
394
|
useOnFirstRender(() => {
|
|
356
395
|
store.update({
|
|
357
|
-
popupProps,
|
|
358
|
-
triggerProps: mergedTriggerProps
|
|
359
|
-
});
|
|
360
|
-
});
|
|
361
|
-
useIsoLayoutEffect(() => {
|
|
362
|
-
store.update({
|
|
363
|
-
id: generatedId,
|
|
364
|
-
modal,
|
|
365
|
-
multiple,
|
|
366
|
-
value,
|
|
367
|
-
open,
|
|
368
|
-
mounted,
|
|
369
|
-
transitionStatus,
|
|
370
396
|
popupProps,
|
|
371
397
|
triggerProps: mergedTriggerProps,
|
|
372
|
-
|
|
373
|
-
itemToStringLabel,
|
|
374
|
-
itemToStringValue,
|
|
375
|
-
isItemEqualToValue,
|
|
376
|
-
openMethod: renderedOpenMethod
|
|
398
|
+
itemRoot
|
|
377
399
|
});
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
generatedId,
|
|
400
|
+
});
|
|
401
|
+
store.useSyncedValues({
|
|
402
|
+
id: generatedId,
|
|
381
403
|
modal,
|
|
382
404
|
multiple,
|
|
405
|
+
disabled,
|
|
406
|
+
readOnly,
|
|
407
|
+
required,
|
|
408
|
+
highlightItemOnHover,
|
|
383
409
|
value,
|
|
384
410
|
open,
|
|
385
411
|
mounted,
|
|
386
412
|
transitionStatus,
|
|
387
413
|
popupProps,
|
|
388
|
-
mergedTriggerProps,
|
|
414
|
+
triggerProps: mergedTriggerProps,
|
|
415
|
+
itemRoot,
|
|
389
416
|
items,
|
|
390
417
|
itemToStringLabel,
|
|
391
418
|
itemToStringValue,
|
|
392
419
|
isItemEqualToValue,
|
|
393
|
-
renderedOpenMethod
|
|
394
|
-
|
|
395
|
-
const contextValue = React$1.useMemo(() => ({
|
|
396
|
-
store,
|
|
397
|
-
name,
|
|
398
|
-
required,
|
|
399
|
-
disabled,
|
|
400
|
-
readOnly,
|
|
401
|
-
multiple,
|
|
402
|
-
highlightItemOnHover,
|
|
403
|
-
setValue,
|
|
404
|
-
setOpen,
|
|
405
|
-
listRef,
|
|
406
|
-
popupRef,
|
|
407
|
-
scrollHandlerRef,
|
|
408
|
-
handleScrollArrowVisibility,
|
|
409
|
-
scrollArrowsMountedCountRef,
|
|
410
|
-
itemProps,
|
|
411
|
-
valueRef,
|
|
412
|
-
valuesRef,
|
|
413
|
-
labelsRef,
|
|
414
|
-
typingRef,
|
|
415
|
-
selectionRef,
|
|
416
|
-
firstItemTextRef,
|
|
417
|
-
selectedItemTextRef,
|
|
418
|
-
validation,
|
|
419
|
-
onOpenChangeComplete,
|
|
420
|
-
alignItemWithTriggerActiveRef,
|
|
421
|
-
initialValueRef
|
|
422
|
-
}), [
|
|
423
|
-
store,
|
|
424
|
-
name,
|
|
425
|
-
required,
|
|
426
|
-
disabled,
|
|
427
|
-
readOnly,
|
|
428
|
-
multiple,
|
|
429
|
-
highlightItemOnHover,
|
|
430
|
-
setValue,
|
|
431
|
-
setOpen,
|
|
432
|
-
itemProps,
|
|
433
|
-
validation,
|
|
434
|
-
onOpenChangeComplete,
|
|
435
|
-
handleScrollArrowVisibility
|
|
436
|
-
]);
|
|
420
|
+
openMethod: renderedOpenMethod
|
|
421
|
+
});
|
|
437
422
|
const ref = useMergedRefs(inputRef, validation.inputRef);
|
|
438
|
-
const hasMultipleSelection = multiple && Array.isArray(value) && value.length > 0;
|
|
439
423
|
const hiddenInputName = multiple ? void 0 : name;
|
|
440
424
|
const hiddenInputs = React$1.useMemo(() => {
|
|
441
425
|
if (!multiple || !Array.isArray(value) || !name) return null;
|
|
@@ -457,57 +441,57 @@ function SelectRoot(props) {
|
|
|
457
441
|
itemToStringValue,
|
|
458
442
|
disabled
|
|
459
443
|
]);
|
|
460
|
-
return /*#__PURE__*/
|
|
461
|
-
value:
|
|
462
|
-
children:
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
children
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
store.set("forceMount", true);
|
|
487
|
-
queueMicrotask(handleChange);
|
|
444
|
+
return /*#__PURE__*/ jsxs(SelectRootContext.Provider, {
|
|
445
|
+
value: store,
|
|
446
|
+
children: [
|
|
447
|
+
/*#__PURE__*/ jsx(SelectFloatingContext.Provider, {
|
|
448
|
+
value: floatingContext,
|
|
449
|
+
children
|
|
450
|
+
}),
|
|
451
|
+
/*#__PURE__*/ jsx("input", {
|
|
452
|
+
...validation.getValidationProps(disabled, {
|
|
453
|
+
onFocus() {
|
|
454
|
+
store.state.triggerElement?.focus({ focusVisible: true });
|
|
455
|
+
},
|
|
456
|
+
onChange(event) {
|
|
457
|
+
if (event.nativeEvent.defaultPrevented || disabled || readOnly) return;
|
|
458
|
+
const nextValue = event.currentTarget.value;
|
|
459
|
+
const details = createChangeEventDetails(none, event.nativeEvent);
|
|
460
|
+
function handleChange() {
|
|
461
|
+
if (multiple) return;
|
|
462
|
+
const nextValueLower = nextValue.toLowerCase();
|
|
463
|
+
let matchingIndex = valuesRef.current.findIndex((candidate) => stringifyAsValue(candidate, itemToStringValue).toLowerCase() === nextValueLower || stringifyAsLabel(candidate, itemToStringLabel).toLowerCase() === nextValueLower);
|
|
464
|
+
if (matchingIndex === -1) matchingIndex = valuesRef.current.findIndex((_, index) => {
|
|
465
|
+
const renderedLabel = labelsRef.current[index];
|
|
466
|
+
return renderedLabel != null && renderedLabel.toLowerCase() === nextValueLower;
|
|
467
|
+
});
|
|
468
|
+
const matchingValue = valuesRef.current[matchingIndex];
|
|
469
|
+
if (matchingValue != null) setValue(matchingValue, details);
|
|
488
470
|
}
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
name: hiddenInputName,
|
|
493
|
-
autoComplete,
|
|
494
|
-
value: serializedValue,
|
|
495
|
-
disabled,
|
|
496
|
-
required: required && !hasMultipleSelection,
|
|
497
|
-
readOnly,
|
|
498
|
-
ref,
|
|
499
|
-
style: name ? visuallyHiddenInput : visuallyHidden,
|
|
500
|
-
tabIndex: -1,
|
|
501
|
-
"aria-hidden": true,
|
|
502
|
-
suppressHydrationWarning: true
|
|
471
|
+
store.set("forceMount", true);
|
|
472
|
+
queueMicrotask(handleChange);
|
|
473
|
+
}
|
|
503
474
|
}),
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
475
|
+
id: generatedId && hiddenInputName == null ? `${generatedId}-hidden-input` : void 0,
|
|
476
|
+
form,
|
|
477
|
+
name: hiddenInputName,
|
|
478
|
+
autoComplete,
|
|
479
|
+
value: serializedValue,
|
|
480
|
+
disabled,
|
|
481
|
+
required: required && !(multiple && hasSelectedValue),
|
|
482
|
+
readOnly,
|
|
483
|
+
ref,
|
|
484
|
+
style: name ? visuallyHiddenInput : visuallyHidden,
|
|
485
|
+
tabIndex: -1,
|
|
486
|
+
"aria-hidden": true,
|
|
487
|
+
suppressHydrationWarning: true
|
|
488
|
+
}),
|
|
489
|
+
hiddenInputs
|
|
490
|
+
]
|
|
507
491
|
});
|
|
508
492
|
}
|
|
509
493
|
//#endregion
|
|
510
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
494
|
+
//#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/select/label/SelectLabel.mjs
|
|
511
495
|
/**
|
|
512
496
|
* An accessible label that is automatically associated with the select trigger.
|
|
513
497
|
* Renders a `<div>` element.
|
|
@@ -519,14 +503,16 @@ const SelectLabel = /*#__PURE__*/ React$1.forwardRef(function SelectLabel(compon
|
|
|
519
503
|
const elementPropsWithoutId = elementProps;
|
|
520
504
|
delete elementPropsWithoutId.id;
|
|
521
505
|
const fieldRootContext = useFieldRootContext();
|
|
522
|
-
const
|
|
523
|
-
const triggerElement =
|
|
524
|
-
const rootId =
|
|
506
|
+
const store = useSelectRootContext();
|
|
507
|
+
const triggerElement = store.useState("triggerElement");
|
|
508
|
+
const rootId = store.useState("id");
|
|
509
|
+
const defaultLabelId = getDefaultLabelId(rootId);
|
|
525
510
|
const labelProps = useLabel({
|
|
526
|
-
id:
|
|
511
|
+
id: defaultLabelId,
|
|
527
512
|
fallbackControlId: triggerElement?.id ?? rootId,
|
|
528
513
|
setLabelId(nextLabelId) {
|
|
529
|
-
store.
|
|
514
|
+
const resolvedLabelId = typeof nextLabelId === "function" ? nextLabelId(store.state.labelId) : nextLabelId;
|
|
515
|
+
store.set("labelId", resolvedLabelId);
|
|
530
516
|
}
|
|
531
517
|
});
|
|
532
518
|
return useRenderElement("div", componentProps, {
|
|
@@ -538,13 +524,82 @@ const SelectLabel = /*#__PURE__*/ React$1.forwardRef(function SelectLabel(compon
|
|
|
538
524
|
});
|
|
539
525
|
SelectLabel.displayName = "SelectLabel";
|
|
540
526
|
//#endregion
|
|
541
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
542
|
-
|
|
527
|
+
//#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/select/trigger/SelectTriggerDataAttributes.mjs
|
|
528
|
+
var SelectTriggerDataAttributes_exports = /* @__PURE__ */ __exportAll({
|
|
529
|
+
dirty: () => dirty,
|
|
530
|
+
disabled: () => disabled,
|
|
531
|
+
filled: () => filled,
|
|
532
|
+
focused: () => focused,
|
|
533
|
+
invalid: () => invalid,
|
|
534
|
+
placeholder: () => placeholder,
|
|
535
|
+
popupOpen: () => popupOpen,
|
|
536
|
+
popupSide: () => popupSide,
|
|
537
|
+
pressed: () => pressed,
|
|
538
|
+
readonly: () => readonly,
|
|
539
|
+
required: () => required,
|
|
540
|
+
touched: () => touched,
|
|
541
|
+
valid: () => valid
|
|
542
|
+
});
|
|
543
|
+
/**
|
|
544
|
+
* Present when the corresponding select is open.
|
|
545
|
+
*/
|
|
546
|
+
const popupOpen = popupOpen$1;
|
|
547
|
+
/**
|
|
548
|
+
* Present when the trigger is pressed.
|
|
549
|
+
*/
|
|
550
|
+
const pressed = pressed$1;
|
|
551
|
+
/**
|
|
552
|
+
* Present when the select is disabled.
|
|
553
|
+
*/
|
|
554
|
+
const disabled = "data-disabled";
|
|
555
|
+
/**
|
|
556
|
+
* Present when the select is readonly.
|
|
557
|
+
*/
|
|
558
|
+
const readonly = "data-readonly";
|
|
559
|
+
/**
|
|
560
|
+
* Indicates which side the corresponding popup is positioned relative to its anchor.
|
|
561
|
+
* @type {'top' | 'bottom' | 'left' | 'right' | 'inline-end' | 'inline-start' | null}
|
|
562
|
+
*/
|
|
563
|
+
const popupSide = "data-popup-side";
|
|
564
|
+
/**
|
|
565
|
+
* Present when the select is required.
|
|
566
|
+
*/
|
|
567
|
+
const required = "data-required";
|
|
568
|
+
/**
|
|
569
|
+
* Present when the select is in a valid state (when wrapped in Field.Root).
|
|
570
|
+
*/
|
|
571
|
+
const valid = "data-valid";
|
|
572
|
+
/**
|
|
573
|
+
* Present when the select is in an invalid state (when wrapped in Field.Root).
|
|
574
|
+
*/
|
|
575
|
+
const invalid = "data-invalid";
|
|
576
|
+
/**
|
|
577
|
+
* Present when the select has been touched (when wrapped in Field.Root).
|
|
578
|
+
*/
|
|
579
|
+
const touched = "data-touched";
|
|
580
|
+
/**
|
|
581
|
+
* Present when the select's value has changed (when wrapped in Field.Root).
|
|
582
|
+
*/
|
|
583
|
+
const dirty = "data-dirty";
|
|
584
|
+
/**
|
|
585
|
+
* Present when the select has a value (when wrapped in Field.Root).
|
|
586
|
+
*/
|
|
587
|
+
const filled = "data-filled";
|
|
588
|
+
/**
|
|
589
|
+
* Present when the select trigger is focused (when wrapped in Field.Root).
|
|
590
|
+
*/
|
|
591
|
+
const focused = "data-focused";
|
|
592
|
+
/**
|
|
593
|
+
* Present when the select doesn't have a value.
|
|
594
|
+
*/
|
|
595
|
+
const placeholder = "data-placeholder";
|
|
596
|
+
//#endregion
|
|
597
|
+
//#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/select/trigger/SelectTrigger.mjs
|
|
543
598
|
const SELECTED_DELAY = 400;
|
|
544
599
|
const stateAttributesMapping$2 = {
|
|
545
600
|
...pressableTriggerOpenStateMapping,
|
|
546
601
|
...fieldValidityMapping,
|
|
547
|
-
popupSide: (side) => side ? {
|
|
602
|
+
popupSide: (side) => side ? { [popupSide]: side } : null,
|
|
548
603
|
value: () => null
|
|
549
604
|
};
|
|
550
605
|
/**
|
|
@@ -555,47 +610,49 @@ const stateAttributesMapping$2 = {
|
|
|
555
610
|
*/
|
|
556
611
|
const SelectTrigger = /*#__PURE__*/ React$1.forwardRef(function SelectTrigger(componentProps, forwardedRef) {
|
|
557
612
|
const { render, className, id: idProp, disabled: disabledProp = false, nativeButton = true, style, ...elementProps } = componentProps;
|
|
558
|
-
const { setTouched,
|
|
613
|
+
const { setTouched, validationMode, validation, state: fieldState, disabled: fieldDisabled } = useFieldRootContext();
|
|
559
614
|
const { labelId: fieldLabelId } = useLabelableContext();
|
|
560
|
-
const
|
|
615
|
+
const store = useSelectRootContext();
|
|
616
|
+
const readOnly = store.useState("readOnly");
|
|
617
|
+
const required = store.useState("required");
|
|
618
|
+
const selectDisabled = store.useState("disabled");
|
|
561
619
|
const disabled = fieldDisabled || selectDisabled || disabledProp;
|
|
562
|
-
const open =
|
|
563
|
-
const mounted =
|
|
564
|
-
const value =
|
|
565
|
-
const triggerProps =
|
|
566
|
-
const positionerElement =
|
|
567
|
-
const listElement =
|
|
568
|
-
const popupSideValue =
|
|
569
|
-
const rootId =
|
|
570
|
-
const selectLabelId =
|
|
571
|
-
const hasSelectedValue =
|
|
620
|
+
const open = store.useState("open");
|
|
621
|
+
const mounted = store.useState("mounted");
|
|
622
|
+
const value = store.useState("value");
|
|
623
|
+
const triggerProps = store.useState("triggerProps");
|
|
624
|
+
const positionerElement = store.useState("positionerElement");
|
|
625
|
+
const listElement = store.useState("listElement");
|
|
626
|
+
const popupSideValue = store.useState("popupSide");
|
|
627
|
+
const rootId = store.useState("id");
|
|
628
|
+
const selectLabelId = store.useState("labelId");
|
|
629
|
+
const hasSelectedValue = store.useState("hasSelectedValue");
|
|
572
630
|
const popupSide = mounted && positionerElement ? popupSideValue : null;
|
|
573
631
|
const id = idProp ?? rootId;
|
|
574
632
|
const ariaLabelledBy = resolveAriaLabelledBy(fieldLabelId, selectLabelId);
|
|
575
|
-
useLabelableId({ id });
|
|
633
|
+
useLabelableId({ id: idProp });
|
|
576
634
|
const positionerRef = useValueAsRef(positionerElement);
|
|
577
635
|
const triggerRef = React$1.useRef(null);
|
|
636
|
+
const setFocused = useSetFieldFocused(disabled, triggerRef);
|
|
578
637
|
const { getButtonProps, buttonRef } = useButton({
|
|
579
638
|
disabled,
|
|
580
639
|
native: nativeButton
|
|
581
640
|
});
|
|
582
|
-
const setTriggerElement =
|
|
583
|
-
store.set("triggerElement", element);
|
|
584
|
-
});
|
|
641
|
+
const setTriggerElement = store.useStateSetter("triggerElement");
|
|
585
642
|
const timeoutFocus = useTimeout();
|
|
586
643
|
const timeoutMouseDown = useTimeout();
|
|
587
644
|
const selectedDelayTimeout = useTimeout();
|
|
588
645
|
React$1.useEffect(() => {
|
|
589
646
|
if (open) {
|
|
590
647
|
selectedDelayTimeout.start(SELECTED_DELAY, () => {
|
|
591
|
-
selectionRef.current.allowUnselectedMouseUp = true;
|
|
592
|
-
selectionRef.current.allowSelectedMouseUp = true;
|
|
648
|
+
store.context.selectionRef.current.allowUnselectedMouseUp = true;
|
|
649
|
+
store.context.selectionRef.current.allowSelectedMouseUp = true;
|
|
593
650
|
});
|
|
594
651
|
return () => {
|
|
595
652
|
selectedDelayTimeout.clear();
|
|
596
653
|
};
|
|
597
654
|
}
|
|
598
|
-
selectionRef.current = {
|
|
655
|
+
store.context.selectionRef.current = {
|
|
599
656
|
allowSelectedMouseUp: false,
|
|
600
657
|
allowUnselectedMouseUp: false,
|
|
601
658
|
dragY: 0
|
|
@@ -603,14 +660,14 @@ const SelectTrigger = /*#__PURE__*/ React$1.forwardRef(function SelectTrigger(co
|
|
|
603
660
|
timeoutMouseDown.clear();
|
|
604
661
|
}, [
|
|
605
662
|
open,
|
|
606
|
-
|
|
663
|
+
store,
|
|
607
664
|
timeoutMouseDown,
|
|
608
665
|
selectedDelayTimeout
|
|
609
666
|
]);
|
|
610
667
|
const mergedProps = mergeProps(triggerProps, {
|
|
611
668
|
id,
|
|
612
669
|
role: "combobox",
|
|
613
|
-
"aria-expanded": open
|
|
670
|
+
"aria-expanded": open,
|
|
614
671
|
"aria-haspopup": "listbox",
|
|
615
672
|
"aria-controls": open ? listElement?.id ?? getFloatingFocusElement(positionerElement)?.id : void 0,
|
|
616
673
|
"aria-labelledby": ariaLabelledBy,
|
|
@@ -619,7 +676,7 @@ const SelectTrigger = /*#__PURE__*/ React$1.forwardRef(function SelectTrigger(co
|
|
|
619
676
|
tabIndex: disabled ? -1 : 0,
|
|
620
677
|
onFocus(event) {
|
|
621
678
|
setFocused(true);
|
|
622
|
-
if (open && alignItemWithTriggerActiveRef.current) setOpen(false, createChangeEventDetails(none, event.nativeEvent));
|
|
679
|
+
if (open && store.context.alignItemWithTriggerActiveRef.current) store.context.setOpen(false, createChangeEventDetails(none, event.nativeEvent));
|
|
623
680
|
timeoutFocus.start(0, () => {
|
|
624
681
|
store.set("forceMount", true);
|
|
625
682
|
});
|
|
@@ -637,9 +694,8 @@ const SelectTrigger = /*#__PURE__*/ React$1.forwardRef(function SelectTrigger(co
|
|
|
637
694
|
if (!triggerRef.current) return;
|
|
638
695
|
const mouseUpTarget = mouseEvent.target;
|
|
639
696
|
if (contains(triggerRef.current, mouseUpTarget) || contains(positionerRef.current, mouseUpTarget)) return;
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
setOpen(false, createChangeEventDetails(cancelOpen, mouseEvent));
|
|
697
|
+
if (isMouseWithinBounds(mouseEvent, triggerRef.current)) return;
|
|
698
|
+
store.context.setOpen(false, createChangeEventDetails(cancelOpen, mouseEvent));
|
|
643
699
|
}
|
|
644
700
|
timeoutMouseDown.start(0, () => {
|
|
645
701
|
doc.addEventListener("mouseup", handleMouseUp, { once: true });
|
|
@@ -671,7 +727,7 @@ const SelectTrigger = /*#__PURE__*/ React$1.forwardRef(function SelectTrigger(co
|
|
|
671
727
|
});
|
|
672
728
|
SelectTrigger.displayName = "SelectTrigger";
|
|
673
729
|
//#endregion
|
|
674
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
730
|
+
//#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/select/value/SelectValue.mjs
|
|
675
731
|
const stateAttributesMapping$1 = { value: () => null };
|
|
676
732
|
/**
|
|
677
733
|
* A text label of the currently selected item.
|
|
@@ -681,13 +737,13 @@ const stateAttributesMapping$1 = { value: () => null };
|
|
|
681
737
|
*/
|
|
682
738
|
const SelectValue = /*#__PURE__*/ React$1.forwardRef(function SelectValue(componentProps, forwardedRef) {
|
|
683
739
|
const { className, render, children: childrenProp, placeholder, style, ...elementProps } = componentProps;
|
|
684
|
-
const
|
|
685
|
-
const value =
|
|
686
|
-
const items =
|
|
687
|
-
const itemToStringLabel =
|
|
688
|
-
const hasSelectedValue =
|
|
740
|
+
const store = useSelectRootContext();
|
|
741
|
+
const value = store.useState("value");
|
|
742
|
+
const items = store.useState("items");
|
|
743
|
+
const itemToStringLabel = store.useState("itemToStringLabel");
|
|
744
|
+
const hasSelectedValue = store.useState("hasSelectedValue");
|
|
689
745
|
const shouldCheckNullItemLabel = !hasSelectedValue && placeholder != null && childrenProp == null;
|
|
690
|
-
const hasNullLabel =
|
|
746
|
+
const hasNullLabel = store.useState("hasNullItemLabel", shouldCheckNullItemLabel);
|
|
691
747
|
const state = {
|
|
692
748
|
value,
|
|
693
749
|
placeholder: !hasSelectedValue
|
|
@@ -695,19 +751,19 @@ const SelectValue = /*#__PURE__*/ React$1.forwardRef(function SelectValue(compon
|
|
|
695
751
|
let children = null;
|
|
696
752
|
if (typeof childrenProp === "function") children = childrenProp(value);
|
|
697
753
|
else if (childrenProp != null) children = childrenProp;
|
|
698
|
-
else if (
|
|
754
|
+
else if (shouldCheckNullItemLabel && !hasNullLabel) children = placeholder;
|
|
699
755
|
else if (Array.isArray(value)) children = resolveMultipleLabels(value, items, itemToStringLabel);
|
|
700
756
|
else children = resolveSelectedLabel(value, items, itemToStringLabel);
|
|
701
757
|
return useRenderElement("span", componentProps, {
|
|
702
758
|
state,
|
|
703
|
-
ref: [forwardedRef, valueRef],
|
|
759
|
+
ref: [forwardedRef, store.context.valueRef],
|
|
704
760
|
props: [{ children }, elementProps],
|
|
705
761
|
stateAttributesMapping: stateAttributesMapping$1
|
|
706
762
|
});
|
|
707
763
|
});
|
|
708
764
|
SelectValue.displayName = "SelectValue";
|
|
709
765
|
//#endregion
|
|
710
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
766
|
+
//#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/select/icon/SelectIcon.mjs
|
|
711
767
|
/**
|
|
712
768
|
* An icon that indicates that the trigger button opens a select popup.
|
|
713
769
|
* Renders a `<span>` element.
|
|
@@ -716,9 +772,9 @@ SelectValue.displayName = "SelectValue";
|
|
|
716
772
|
*/
|
|
717
773
|
const SelectIcon = /*#__PURE__*/ React$1.forwardRef(function SelectIcon(componentProps, forwardedRef) {
|
|
718
774
|
const { render, className, style, ...elementProps } = componentProps;
|
|
719
|
-
const
|
|
775
|
+
const state = { open: useSelectRootContext().useState("open") };
|
|
720
776
|
return useRenderElement("span", componentProps, {
|
|
721
|
-
state
|
|
777
|
+
state,
|
|
722
778
|
ref: forwardedRef,
|
|
723
779
|
props: [{
|
|
724
780
|
"aria-hidden": true,
|
|
@@ -729,11 +785,7 @@ const SelectIcon = /*#__PURE__*/ React$1.forwardRef(function SelectIcon(componen
|
|
|
729
785
|
});
|
|
730
786
|
SelectIcon.displayName = "SelectIcon";
|
|
731
787
|
//#endregion
|
|
732
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
733
|
-
const SelectPortalContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
734
|
-
SelectPortalContext.displayName = "SelectPortalContext";
|
|
735
|
-
//#endregion
|
|
736
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.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/select/portal/SelectPortal.mjs
|
|
788
|
+
//#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/select/portal/SelectPortal.mjs
|
|
737
789
|
/**
|
|
738
790
|
* A portal element that moves the popup to a different part of the DOM.
|
|
739
791
|
* By default, the portal element is appended to `<body>`.
|
|
@@ -742,21 +794,18 @@ SelectPortalContext.displayName = "SelectPortalContext";
|
|
|
742
794
|
* Documentation: [Base UI Select](https://base-ui.com/react/components/select)
|
|
743
795
|
*/
|
|
744
796
|
const SelectPortal = /*#__PURE__*/ React$1.forwardRef(function SelectPortal(portalProps, forwardedRef) {
|
|
745
|
-
const
|
|
746
|
-
const mounted =
|
|
747
|
-
const forceMount =
|
|
797
|
+
const store = useSelectRootContext();
|
|
798
|
+
const mounted = store.useState("mounted");
|
|
799
|
+
const forceMount = store.useState("forceMount");
|
|
748
800
|
if (!(mounted || forceMount)) return null;
|
|
749
|
-
return /*#__PURE__*/ jsx(
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
ref: forwardedRef,
|
|
753
|
-
...portalProps
|
|
754
|
-
})
|
|
801
|
+
return /*#__PURE__*/ jsx(FloatingPortal, {
|
|
802
|
+
ref: forwardedRef,
|
|
803
|
+
...portalProps
|
|
755
804
|
});
|
|
756
805
|
});
|
|
757
806
|
SelectPortal.displayName = "SelectPortal";
|
|
758
807
|
//#endregion
|
|
759
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
808
|
+
//#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/select/positioner/SelectPositionerContext.mjs
|
|
760
809
|
const SelectPositionerContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
761
810
|
SelectPositionerContext.displayName = "SelectPositionerContext";
|
|
762
811
|
function useSelectPositionerContext() {
|
|
@@ -765,7 +814,7 @@ function useSelectPositionerContext() {
|
|
|
765
814
|
return context;
|
|
766
815
|
}
|
|
767
816
|
//#endregion
|
|
768
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
817
|
+
//#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/select/popup/utils.mjs
|
|
769
818
|
function clearStyles(element, originalStyles) {
|
|
770
819
|
if (element) Object.assign(element.style, originalStyles);
|
|
771
820
|
}
|
|
@@ -776,7 +825,7 @@ const LIST_FUNCTIONAL_STYLES = {
|
|
|
776
825
|
overflowY: "auto"
|
|
777
826
|
};
|
|
778
827
|
//#endregion
|
|
779
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
828
|
+
//#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/select/positioner/SelectPositioner.mjs
|
|
780
829
|
const FIXED = { position: "fixed" };
|
|
781
830
|
/**
|
|
782
831
|
* Positions the select popup.
|
|
@@ -785,30 +834,24 @@ const FIXED = { position: "fixed" };
|
|
|
785
834
|
* Documentation: [Base UI Select](https://base-ui.com/react/components/select)
|
|
786
835
|
*/
|
|
787
836
|
const SelectPositioner = /*#__PURE__*/ React$1.forwardRef(function SelectPositioner(componentProps, forwardedRef) {
|
|
788
|
-
const { anchor,
|
|
789
|
-
const
|
|
837
|
+
const { anchor, className, render, positionMethod, side, align, sideOffset, alignOffset, collisionBoundary = "clipping-ancestors", collisionPadding, arrowPadding, sticky, disableAnchorTracking, alignItemWithTrigger = true, collisionAvoidance = DROPDOWN_COLLISION_AVOIDANCE, style, ...elementProps } = componentProps;
|
|
838
|
+
const store = useSelectRootContext();
|
|
790
839
|
const floatingRootContext = useSelectFloatingContext();
|
|
791
|
-
const open =
|
|
792
|
-
const mounted =
|
|
793
|
-
const modal =
|
|
794
|
-
const value =
|
|
795
|
-
const openMethod =
|
|
796
|
-
const positionerElement =
|
|
797
|
-
const triggerElement =
|
|
798
|
-
const isItemEqualToValue =
|
|
799
|
-
const transitionStatus =
|
|
840
|
+
const open = store.useState("open");
|
|
841
|
+
const mounted = store.useState("mounted");
|
|
842
|
+
const modal = store.useState("modal");
|
|
843
|
+
const value = store.useState("value");
|
|
844
|
+
const openMethod = store.useState("openMethod");
|
|
845
|
+
const positionerElement = store.useState("positionerElement");
|
|
846
|
+
const triggerElement = store.useState("triggerElement");
|
|
847
|
+
const isItemEqualToValue = store.useState("isItemEqualToValue");
|
|
848
|
+
const transitionStatus = store.useState("transitionStatus");
|
|
800
849
|
const scrollUpArrowRef = React$1.useRef(null);
|
|
801
850
|
const scrollDownArrowRef = React$1.useRef(null);
|
|
802
851
|
const [controlledAlignItemWithTrigger, setControlledAlignItemWithTrigger] = React$1.useState(alignItemWithTrigger);
|
|
803
852
|
const alignItemWithTriggerActive = mounted && controlledAlignItemWithTrigger && openMethod !== "touch";
|
|
804
853
|
if (!mounted && controlledAlignItemWithTrigger !== alignItemWithTrigger) setControlledAlignItemWithTrigger(alignItemWithTrigger);
|
|
805
|
-
|
|
806
|
-
if (!mounted) {
|
|
807
|
-
if (selectors.scrollUpArrowVisible(store.state)) store.set("scrollUpArrowVisible", false);
|
|
808
|
-
if (selectors.scrollDownArrowVisible(store.state)) store.set("scrollDownArrowVisible", false);
|
|
809
|
-
}
|
|
810
|
-
}, [store, mounted]);
|
|
811
|
-
React$1.useImperativeHandle(alignItemWithTriggerActiveRef, () => alignItemWithTriggerActive);
|
|
854
|
+
React$1.useImperativeHandle(store.context.alignItemWithTriggerActiveRef, () => alignItemWithTriggerActive);
|
|
812
855
|
useAnchoredPopupScrollLock((alignItemWithTriggerActive || modal) && open, openMethod === "touch", positionerElement, triggerElement);
|
|
813
856
|
const positioning = useAnchorPositioning({
|
|
814
857
|
anchor,
|
|
@@ -838,43 +881,39 @@ const SelectPositioner = /*#__PURE__*/ React$1.forwardRef(function SelectPositio
|
|
|
838
881
|
useIsoLayoutEffect(() => {
|
|
839
882
|
store.set("popupSide", positioning.side);
|
|
840
883
|
}, [store, positioning.side]);
|
|
884
|
+
const setPositionerElement = store.useStateSetter("positionerElement");
|
|
841
885
|
const element = usePositioner(componentProps, state, {
|
|
842
886
|
styles: positionerStyles,
|
|
843
887
|
transitionStatus,
|
|
844
888
|
props: elementProps,
|
|
845
|
-
refs: [forwardedRef,
|
|
846
|
-
store.set("positionerElement", element);
|
|
847
|
-
})],
|
|
889
|
+
refs: [forwardedRef, setPositionerElement],
|
|
848
890
|
hidden: !mounted,
|
|
849
891
|
inert: !open
|
|
850
892
|
});
|
|
851
893
|
const prevMapSizeRef = React$1.useRef(0);
|
|
852
894
|
const onMapChange = useStableCallback((map) => {
|
|
853
|
-
if (
|
|
854
|
-
if (valuesRef.current.length === 0) return;
|
|
895
|
+
if (store.context.valuesRef.current.length === 0) return;
|
|
855
896
|
const prevSize = prevMapSizeRef.current;
|
|
856
897
|
prevMapSizeRef.current = map.size;
|
|
857
|
-
if (map.size === prevSize) return;
|
|
858
898
|
const eventDetails = createChangeEventDetails(none);
|
|
859
899
|
if (prevSize !== 0 && !store.state.multiple && value !== null) {
|
|
860
|
-
if (findItemIndex(valuesRef.current, value, isItemEqualToValue) === -1) {
|
|
861
|
-
const initialSelectedValue = initialValueRef.current;
|
|
862
|
-
const nextValue = initialSelectedValue != null && findItemIndex(valuesRef.current, initialSelectedValue, isItemEqualToValue) !== -1 ? initialSelectedValue : null;
|
|
863
|
-
setValue(nextValue, eventDetails);
|
|
900
|
+
if (findItemIndex(store.context.valuesRef.current, value, isItemEqualToValue) === -1) {
|
|
901
|
+
const initialSelectedValue = store.context.initialValueRef.current;
|
|
902
|
+
const nextValue = initialSelectedValue != null && findItemIndex(store.context.valuesRef.current, initialSelectedValue, isItemEqualToValue) !== -1 ? initialSelectedValue : null;
|
|
903
|
+
store.context.setValue(nextValue, eventDetails);
|
|
864
904
|
if (nextValue === null) {
|
|
865
905
|
store.set("selectedIndex", null);
|
|
866
|
-
selectedItemTextRef.current = null;
|
|
906
|
+
store.context.selectedItemTextRef.current = null;
|
|
867
907
|
}
|
|
868
908
|
}
|
|
869
909
|
}
|
|
870
910
|
if (prevSize !== 0 && store.state.multiple && Array.isArray(value)) {
|
|
871
|
-
const
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
setValue(nextValue, eventDetails);
|
|
911
|
+
const nextValue = value.filter((selectedItemValue) => findItemIndex(store.context.valuesRef.current, selectedItemValue, isItemEqualToValue) !== -1);
|
|
912
|
+
if (nextValue.length !== value.length) {
|
|
913
|
+
store.context.setValue(nextValue, eventDetails);
|
|
875
914
|
if (nextValue.length === 0) {
|
|
876
915
|
store.set("selectedIndex", null);
|
|
877
|
-
selectedItemTextRef.current = null;
|
|
916
|
+
store.context.selectedItemTextRef.current = null;
|
|
878
917
|
}
|
|
879
918
|
}
|
|
880
919
|
}
|
|
@@ -885,7 +924,7 @@ const SelectPositioner = /*#__PURE__*/ React$1.forwardRef(function SelectPositio
|
|
|
885
924
|
});
|
|
886
925
|
const stylesToClear = { height: "" };
|
|
887
926
|
clearStyles(positionerElement, stylesToClear);
|
|
888
|
-
clearStyles(popupRef.current, stylesToClear);
|
|
927
|
+
clearStyles(store.context.popupRef.current, stylesToClear);
|
|
889
928
|
}
|
|
890
929
|
});
|
|
891
930
|
const contextValue = React$1.useMemo(() => ({
|
|
@@ -902,8 +941,8 @@ const SelectPositioner = /*#__PURE__*/ React$1.forwardRef(function SelectPositio
|
|
|
902
941
|
setControlledAlignItemWithTrigger
|
|
903
942
|
]);
|
|
904
943
|
return /*#__PURE__*/ jsx(CompositeList, {
|
|
905
|
-
elementsRef: listRef,
|
|
906
|
-
labelsRef,
|
|
944
|
+
elementsRef: store.context.listRef,
|
|
945
|
+
labelsRef: store.context.labelsRef,
|
|
907
946
|
onMapChange,
|
|
908
947
|
children: /*#__PURE__*/ jsxs(SelectPositionerContext.Provider, {
|
|
909
948
|
value: contextValue,
|
|
@@ -916,7 +955,41 @@ const SelectPositioner = /*#__PURE__*/ React$1.forwardRef(function SelectPositio
|
|
|
916
955
|
});
|
|
917
956
|
SelectPositioner.displayName = "SelectPositioner";
|
|
918
957
|
//#endregion
|
|
919
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
958
|
+
//#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/select/positioner/SelectPositionerCssVars.mjs
|
|
959
|
+
var SelectPositionerCssVars_exports = /* @__PURE__ */ __exportAll({
|
|
960
|
+
anchorHeight: () => anchorHeight,
|
|
961
|
+
anchorWidth: () => anchorWidth,
|
|
962
|
+
availableHeight: () => availableHeight,
|
|
963
|
+
availableWidth: () => availableWidth,
|
|
964
|
+
transformOrigin: () => transformOrigin
|
|
965
|
+
});
|
|
966
|
+
/**
|
|
967
|
+
* The available width between the trigger and the edge of the viewport.
|
|
968
|
+
* @type {number}
|
|
969
|
+
*/
|
|
970
|
+
const availableWidth = "--available-width";
|
|
971
|
+
/**
|
|
972
|
+
* The available height between the trigger and the edge of the viewport.
|
|
973
|
+
* @type {number}
|
|
974
|
+
*/
|
|
975
|
+
const availableHeight = "--available-height";
|
|
976
|
+
/**
|
|
977
|
+
* The anchor's width.
|
|
978
|
+
* @type {number}
|
|
979
|
+
*/
|
|
980
|
+
const anchorWidth = "--anchor-width";
|
|
981
|
+
/**
|
|
982
|
+
* The anchor's height.
|
|
983
|
+
* @type {number}
|
|
984
|
+
*/
|
|
985
|
+
const anchorHeight = "--anchor-height";
|
|
986
|
+
/**
|
|
987
|
+
* The coordinates that this element is anchored to. Used for animations and transitions.
|
|
988
|
+
* @type {string}
|
|
989
|
+
*/
|
|
990
|
+
const transformOrigin = "--transform-origin";
|
|
991
|
+
//#endregion
|
|
992
|
+
//#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/select/popup/SelectPopup.mjs
|
|
920
993
|
const stateAttributesMapping = {
|
|
921
994
|
...popupStateMapping,
|
|
922
995
|
...transitionStatusMapping
|
|
@@ -929,35 +1002,34 @@ const stateAttributesMapping = {
|
|
|
929
1002
|
*/
|
|
930
1003
|
const SelectPopup = /*#__PURE__*/ React$1.forwardRef(function SelectPopup(componentProps, forwardedRef) {
|
|
931
1004
|
const { render, className, style, finalFocus, ...elementProps } = componentProps;
|
|
932
|
-
const
|
|
1005
|
+
const store = useSelectRootContext();
|
|
1006
|
+
const multiple = store.useState("multiple");
|
|
1007
|
+
const readOnly = store.useState("readOnly");
|
|
1008
|
+
const highlightItemOnHover = store.useState("highlightItemOnHover");
|
|
1009
|
+
const floatingRootContext = useSelectFloatingContext();
|
|
933
1010
|
const { side, align, alignItemWithTriggerActive, isPositioned, setControlledAlignItemWithTrigger } = useSelectPositionerContext();
|
|
934
1011
|
const insideToolbar = useToolbarRootContext(true) != null;
|
|
935
|
-
const floatingRootContext = useSelectFloatingContext();
|
|
936
1012
|
const direction = useDirection();
|
|
937
1013
|
const { nonce, disableStyleElements } = useCSPContext();
|
|
938
|
-
const id =
|
|
939
|
-
const open =
|
|
940
|
-
const openMethod =
|
|
941
|
-
const mounted =
|
|
942
|
-
const popupProps =
|
|
943
|
-
const transitionStatus =
|
|
944
|
-
const triggerElement =
|
|
945
|
-
const positionerElement =
|
|
946
|
-
const listElement =
|
|
1014
|
+
const id = store.useState("id");
|
|
1015
|
+
const open = store.useState("open");
|
|
1016
|
+
const openMethod = store.useState("openMethod");
|
|
1017
|
+
const mounted = store.useState("mounted");
|
|
1018
|
+
const popupProps = store.useState("popupProps");
|
|
1019
|
+
const transitionStatus = store.useState("transitionStatus");
|
|
1020
|
+
const triggerElement = store.useState("triggerElement");
|
|
1021
|
+
const positionerElement = store.useState("positionerElement");
|
|
1022
|
+
const listElement = store.useState("listElement");
|
|
947
1023
|
const reachedMaxHeightRef = React$1.useRef(false);
|
|
948
1024
|
const initialPlacedRef = React$1.useRef(false);
|
|
949
1025
|
const originalPositionerStylesRef = React$1.useRef({});
|
|
950
1026
|
const scrollArrowFrame = useAnimationFrame();
|
|
951
1027
|
const handleScroll = useStableCallback((scroller) => {
|
|
952
|
-
if (!positionerElement || !popupRef.current || !initialPlacedRef.current) return;
|
|
953
|
-
if (reachedMaxHeightRef.current || !alignItemWithTriggerActive) {
|
|
954
|
-
handleScrollArrowVisibility();
|
|
955
|
-
return;
|
|
956
|
-
}
|
|
1028
|
+
if (!positionerElement || !store.context.popupRef.current || !initialPlacedRef.current) return;
|
|
957
1029
|
const isTopPositioned = positionerElement.style.top === "0px";
|
|
958
1030
|
const isBottomPositioned = positionerElement.style.bottom === "0px";
|
|
959
|
-
if (!isTopPositioned && !isBottomPositioned) {
|
|
960
|
-
handleScrollArrowVisibility();
|
|
1031
|
+
if (reachedMaxHeightRef.current || !alignItemWithTriggerActive || !isTopPositioned && !isBottomPositioned) {
|
|
1032
|
+
store.context.handleScrollArrowVisibility(scroller);
|
|
961
1033
|
return;
|
|
962
1034
|
}
|
|
963
1035
|
const scale = getScale(positionerElement);
|
|
@@ -967,53 +1039,41 @@ const SelectPopup = /*#__PURE__*/ React$1.forwardRef(function SelectPopup(compon
|
|
|
967
1039
|
const positionerStyles = win.getComputedStyle(positionerElement);
|
|
968
1040
|
const marginTop = parseFloat(positionerStyles.marginTop);
|
|
969
1041
|
const marginBottom = parseFloat(positionerStyles.marginBottom);
|
|
970
|
-
const maxPopupHeight = getMaxPopupHeight(win.getComputedStyle(popupRef.current));
|
|
1042
|
+
const maxPopupHeight = getMaxPopupHeight(win.getComputedStyle(store.context.popupRef.current));
|
|
971
1043
|
const maxAvailableHeight = Math.min(doc.documentElement.clientHeight - marginTop - marginBottom, maxPopupHeight);
|
|
972
1044
|
const scrollTop = scroller.scrollTop;
|
|
973
1045
|
const maxScrollTop = getMaxScrollTop(scroller);
|
|
974
|
-
let nextPositionerHeight = 0;
|
|
975
1046
|
let nextScrollTop = null;
|
|
976
|
-
let setReachedMax = false;
|
|
977
|
-
let scrollToMax = false;
|
|
978
1047
|
const setHeight = (height) => {
|
|
979
1048
|
positionerElement.style.height = `${height}px`;
|
|
980
1049
|
};
|
|
981
|
-
const handleSmallDiff = (diff, targetScrollTop) => {
|
|
982
|
-
const heightDelta = clamp(diff, 0, maxAvailableHeight - currentHeight);
|
|
983
|
-
if (heightDelta > 0) setHeight(currentHeight + heightDelta);
|
|
984
|
-
scroller.scrollTop = targetScrollTop;
|
|
985
|
-
if (maxAvailableHeight - (currentHeight + heightDelta) <= 1) reachedMaxHeightRef.current = true;
|
|
986
|
-
handleScrollArrowVisibility();
|
|
987
|
-
};
|
|
988
1050
|
const diff = isTopPositioned ? maxScrollTop - scrollTop : scrollTop;
|
|
989
1051
|
const nextHeight = Math.min(currentHeight + diff, maxAvailableHeight);
|
|
990
|
-
nextPositionerHeight = nextHeight;
|
|
991
1052
|
if (diff <= 1) {
|
|
992
|
-
|
|
1053
|
+
const heightDelta = clamp(diff, 0, maxAvailableHeight - currentHeight);
|
|
1054
|
+
if (heightDelta > 0) setHeight(currentHeight + heightDelta);
|
|
1055
|
+
scroller.scrollTop = isTopPositioned ? maxScrollTop : 0;
|
|
1056
|
+
if (maxAvailableHeight - (currentHeight + heightDelta) <= 1) reachedMaxHeightRef.current = true;
|
|
1057
|
+
store.context.handleScrollArrowVisibility(scroller);
|
|
993
1058
|
return;
|
|
994
1059
|
}
|
|
995
|
-
if (maxAvailableHeight - nextHeight > 1)
|
|
996
|
-
else nextScrollTop =
|
|
997
|
-
|
|
998
|
-
setReachedMax = true;
|
|
999
|
-
if (isBottomPositioned && scrollTop < maxScrollTop) nextScrollTop = scrollTop - (diff - (currentHeight + diff - maxAvailableHeight));
|
|
1000
|
-
}
|
|
1001
|
-
nextPositionerHeight = Math.ceil(nextPositionerHeight);
|
|
1060
|
+
if (maxAvailableHeight - nextHeight > 1) nextScrollTop = isTopPositioned ? Infinity : 0;
|
|
1061
|
+
else if (isBottomPositioned && scrollTop < maxScrollTop) nextScrollTop = scrollTop - (diff - (currentHeight + diff - maxAvailableHeight));
|
|
1062
|
+
const nextPositionerHeight = Math.ceil(nextHeight);
|
|
1002
1063
|
if (nextPositionerHeight !== 0) setHeight(nextPositionerHeight);
|
|
1003
|
-
if (
|
|
1004
|
-
const
|
|
1005
|
-
const target = scrollToMax ? nextMaxScrollTop : clamp(nextScrollTop, 0, nextMaxScrollTop);
|
|
1064
|
+
if (nextScrollTop != null) {
|
|
1065
|
+
const target = clamp(nextScrollTop, 0, getMaxScrollTop(scroller));
|
|
1006
1066
|
if (Math.abs(scroller.scrollTop - target) > 1) scroller.scrollTop = target;
|
|
1007
1067
|
}
|
|
1008
|
-
if (
|
|
1009
|
-
handleScrollArrowVisibility();
|
|
1068
|
+
if (nextPositionerHeight >= maxAvailableHeight - 1) reachedMaxHeightRef.current = true;
|
|
1069
|
+
store.context.handleScrollArrowVisibility(scroller);
|
|
1010
1070
|
});
|
|
1011
|
-
React$1.useImperativeHandle(scrollHandlerRef, () => handleScroll, [handleScroll]);
|
|
1071
|
+
React$1.useImperativeHandle(store.context.scrollHandlerRef, () => handleScroll, [handleScroll]);
|
|
1012
1072
|
useOpenChangeComplete({
|
|
1013
1073
|
open,
|
|
1014
|
-
ref: popupRef,
|
|
1074
|
+
ref: store.context.popupRef,
|
|
1015
1075
|
onComplete() {
|
|
1016
|
-
if (open) onOpenChangeComplete
|
|
1076
|
+
if (open) store.context.onOpenChangeComplete(true);
|
|
1017
1077
|
}
|
|
1018
1078
|
});
|
|
1019
1079
|
const state = {
|
|
@@ -1023,7 +1083,7 @@ const SelectPopup = /*#__PURE__*/ React$1.forwardRef(function SelectPopup(compon
|
|
|
1023
1083
|
align
|
|
1024
1084
|
};
|
|
1025
1085
|
useIsoLayoutEffect(() => {
|
|
1026
|
-
if (!positionerElement || !popupRef.current || Object.keys(originalPositionerStylesRef.current).length) return;
|
|
1086
|
+
if (!positionerElement || !store.context.popupRef.current || Object.keys(originalPositionerStylesRef.current).length) return;
|
|
1027
1087
|
originalPositionerStylesRef.current = {
|
|
1028
1088
|
top: positionerElement.style.top || "0",
|
|
1029
1089
|
left: positionerElement.style.left || "0",
|
|
@@ -1035,7 +1095,7 @@ const SelectPopup = /*#__PURE__*/ React$1.forwardRef(function SelectPopup(compon
|
|
|
1035
1095
|
marginTop: positionerElement.style.marginTop,
|
|
1036
1096
|
marginBottom: positionerElement.style.marginBottom
|
|
1037
1097
|
};
|
|
1038
|
-
}, [
|
|
1098
|
+
}, [store, positionerElement]);
|
|
1039
1099
|
useIsoLayoutEffect(() => {
|
|
1040
1100
|
if (open || alignItemWithTriggerActive) return;
|
|
1041
1101
|
initialPlacedRef.current = false;
|
|
@@ -1044,24 +1104,22 @@ const SelectPopup = /*#__PURE__*/ React$1.forwardRef(function SelectPopup(compon
|
|
|
1044
1104
|
}, [
|
|
1045
1105
|
open,
|
|
1046
1106
|
alignItemWithTriggerActive,
|
|
1047
|
-
positionerElement
|
|
1048
|
-
popupRef
|
|
1107
|
+
positionerElement
|
|
1049
1108
|
]);
|
|
1050
1109
|
useIsoLayoutEffect(() => {
|
|
1051
|
-
const popupElement = popupRef.current;
|
|
1110
|
+
const popupElement = store.context.popupRef.current;
|
|
1052
1111
|
if (!open || !triggerElement || !positionerElement || !popupElement || alignItemWithTriggerActive && !isPositioned || store.state.transitionStatus === "ending") return;
|
|
1112
|
+
initialPlacedRef.current = true;
|
|
1113
|
+
popupElement.style.removeProperty(transformOrigin);
|
|
1053
1114
|
if (!alignItemWithTriggerActive) {
|
|
1054
|
-
|
|
1055
|
-
scrollArrowFrame.request(handleScrollArrowVisibility);
|
|
1056
|
-
popupElement.style.removeProperty("--transform-origin");
|
|
1115
|
+
scrollArrowFrame.request(() => store.context.handleScrollArrowVisibility(listElement || popupElement));
|
|
1057
1116
|
return;
|
|
1058
1117
|
}
|
|
1059
1118
|
const restoreTransformStyles = unsetTransformStyles(popupElement);
|
|
1060
|
-
popupElement.style.removeProperty("--transform-origin");
|
|
1061
1119
|
try {
|
|
1062
|
-
let textElement = selectedItemTextRef.current;
|
|
1063
|
-
if (!textElement?.isConnected) textElement = !
|
|
1064
|
-
const valueElement = valueRef.current;
|
|
1120
|
+
let textElement = store.context.selectedItemTextRef.current;
|
|
1121
|
+
if (!textElement?.isConnected) textElement = !store.select("hasSelectedValue") && store.context.firstItemTextRef.current?.isConnected ? store.context.firstItemTextRef.current : null;
|
|
1122
|
+
const valueElement = store.context.valueRef.current;
|
|
1065
1123
|
const win = getWindow(positionerElement);
|
|
1066
1124
|
const positionerStyles = win.getComputedStyle(positionerElement);
|
|
1067
1125
|
const popupStyles = win.getComputedStyle(popupElement);
|
|
@@ -1110,7 +1168,6 @@ const SelectPopup = /*#__PURE__*/ React$1.forwardRef(function SelectPopup(compon
|
|
|
1110
1168
|
const fallbackToAlignPopupToTrigger = triggerRect.top < triggerCollisionThreshold || triggerRect.bottom > viewportHeight - triggerCollisionThreshold || Math.ceil(height) + 1 < Math.min(scrollHeight, minHeight);
|
|
1111
1169
|
const isPinchZoomed = (win.visualViewport?.scale ?? 1) !== 1 && webkit;
|
|
1112
1170
|
if (fallbackToAlignPopupToTrigger || isPinchZoomed) {
|
|
1113
|
-
initialPlacedRef.current = true;
|
|
1114
1171
|
clearStyles(positionerElement, originalPositionerStylesRef.current);
|
|
1115
1172
|
setControlledAlignItemWithTrigger(false);
|
|
1116
1173
|
return;
|
|
@@ -1130,12 +1187,11 @@ const SelectPopup = /*#__PURE__*/ React$1.forwardRef(function SelectPopup(compon
|
|
|
1130
1187
|
const popupHeight = positionerRect.height;
|
|
1131
1188
|
const textCenterY = textRect.top + textRect.height / 2;
|
|
1132
1189
|
const clampedY = clamp(popupHeight > 0 ? (textCenterY - popupTop) / popupHeight * 100 : 50, 0, 100);
|
|
1133
|
-
popupElement.style.setProperty(
|
|
1190
|
+
popupElement.style.setProperty(transformOrigin, `50% ${clampedY}%`);
|
|
1134
1191
|
}
|
|
1135
1192
|
if (initialHeight === viewportHeight || height >= maxPopupHeight) reachedMaxHeightRef.current = true;
|
|
1136
|
-
handleScrollArrowVisibility();
|
|
1137
|
-
if (highlightItemOnHover && store.state.selectedIndex === null && store.state.activeIndex === null && listRef.current[0] != null) store.set("activeIndex", 0);
|
|
1138
|
-
initialPlacedRef.current = true;
|
|
1193
|
+
store.context.handleScrollArrowVisibility(scroller);
|
|
1194
|
+
if (highlightItemOnHover && store.state.selectedIndex === null && store.state.activeIndex === null && store.context.listRef.current[0] != null) store.set("activeIndex", 0);
|
|
1139
1195
|
} finally {
|
|
1140
1196
|
restoreTransformStyles();
|
|
1141
1197
|
}
|
|
@@ -1144,16 +1200,10 @@ const SelectPopup = /*#__PURE__*/ React$1.forwardRef(function SelectPopup(compon
|
|
|
1144
1200
|
open,
|
|
1145
1201
|
positionerElement,
|
|
1146
1202
|
triggerElement,
|
|
1147
|
-
valueRef,
|
|
1148
|
-
firstItemTextRef,
|
|
1149
|
-
selectedItemTextRef,
|
|
1150
|
-
popupRef,
|
|
1151
|
-
handleScrollArrowVisibility,
|
|
1152
1203
|
alignItemWithTriggerActive,
|
|
1153
1204
|
setControlledAlignItemWithTrigger,
|
|
1154
1205
|
scrollArrowFrame,
|
|
1155
1206
|
listElement,
|
|
1156
|
-
listRef,
|
|
1157
1207
|
highlightItemOnHover,
|
|
1158
1208
|
direction,
|
|
1159
1209
|
isPositioned
|
|
@@ -1162,22 +1212,20 @@ const SelectPopup = /*#__PURE__*/ React$1.forwardRef(function SelectPopup(compon
|
|
|
1162
1212
|
if (!alignItemWithTriggerActive || !positionerElement || !open) return;
|
|
1163
1213
|
const win = getWindow(positionerElement);
|
|
1164
1214
|
function handleResize(event) {
|
|
1165
|
-
setOpen(false, createChangeEventDetails(windowResize, event));
|
|
1215
|
+
store.context.setOpen(false, createChangeEventDetails(windowResize, event));
|
|
1166
1216
|
}
|
|
1167
1217
|
return addEventListener(win, "resize", handleResize);
|
|
1168
1218
|
}, [
|
|
1169
|
-
|
|
1219
|
+
store,
|
|
1170
1220
|
alignItemWithTriggerActive,
|
|
1171
1221
|
positionerElement,
|
|
1172
1222
|
open
|
|
1173
1223
|
]);
|
|
1174
1224
|
const defaultProps = {
|
|
1175
|
-
...listElement ? {
|
|
1176
|
-
role: "presentation",
|
|
1177
|
-
"aria-orientation": void 0
|
|
1178
|
-
} : {
|
|
1225
|
+
...listElement ? { role: "presentation" } : {
|
|
1179
1226
|
role: "listbox",
|
|
1180
1227
|
"aria-multiselectable": multiple || void 0,
|
|
1228
|
+
"aria-readonly": readOnly || void 0,
|
|
1181
1229
|
id: `${id}-list`
|
|
1182
1230
|
},
|
|
1183
1231
|
onKeyDown(event) {
|
|
@@ -1187,17 +1235,17 @@ const SelectPopup = /*#__PURE__*/ React$1.forwardRef(function SelectPopup(compon
|
|
|
1187
1235
|
if (listElement) return;
|
|
1188
1236
|
handleScroll(event.currentTarget);
|
|
1189
1237
|
},
|
|
1190
|
-
...alignItemWithTriggerActive && { style: listElement ? { height: "100%" } : LIST_FUNCTIONAL_STYLES }
|
|
1238
|
+
...alignItemWithTriggerActive && { style: listElement ? { height: "100%" } : LIST_FUNCTIONAL_STYLES },
|
|
1239
|
+
className: !listElement && alignItemWithTriggerActive ? styleDisableScrollbar.className : void 0
|
|
1191
1240
|
};
|
|
1192
1241
|
const element = useRenderElement("div", componentProps, {
|
|
1193
|
-
ref: [forwardedRef, popupRef],
|
|
1242
|
+
ref: [forwardedRef, store.context.popupRef],
|
|
1194
1243
|
state,
|
|
1195
1244
|
stateAttributesMapping,
|
|
1196
1245
|
props: [
|
|
1197
1246
|
popupProps,
|
|
1198
1247
|
defaultProps,
|
|
1199
1248
|
getDisabledMountTransitionStyles(transitionStatus),
|
|
1200
|
-
{ className: !listElement && alignItemWithTriggerActive ? styleDisableScrollbar.className : void 0 },
|
|
1201
1249
|
elementProps
|
|
1202
1250
|
]
|
|
1203
1251
|
});
|
|
@@ -1213,7 +1261,7 @@ const SelectPopup = /*#__PURE__*/ React$1.forwardRef(function SelectPopup(compon
|
|
|
1213
1261
|
});
|
|
1214
1262
|
SelectPopup.displayName = "SelectPopup";
|
|
1215
1263
|
function getMaxPopupHeight(popupStyles) {
|
|
1216
|
-
const maxHeightStyle = popupStyles.maxHeight
|
|
1264
|
+
const maxHeightStyle = popupStyles.maxHeight;
|
|
1217
1265
|
return maxHeightStyle.endsWith("px") ? parseFloat(maxHeightStyle) || Infinity : Infinity;
|
|
1218
1266
|
}
|
|
1219
1267
|
function getMaxScrollTop(scroller) {
|
|
@@ -1254,7 +1302,7 @@ function unsetTransformStyles(popupElement) {
|
|
|
1254
1302
|
};
|
|
1255
1303
|
}
|
|
1256
1304
|
//#endregion
|
|
1257
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1305
|
+
//#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/select/list/SelectList.mjs
|
|
1258
1306
|
/**
|
|
1259
1307
|
* A container for the select items.
|
|
1260
1308
|
* Renders a `<div>` element.
|
|
@@ -1263,31 +1311,32 @@ function unsetTransformStyles(popupElement) {
|
|
|
1263
1311
|
*/
|
|
1264
1312
|
const SelectList = /*#__PURE__*/ React$1.forwardRef(function SelectList(componentProps, forwardedRef) {
|
|
1265
1313
|
const { render, className, style, ...elementProps } = componentProps;
|
|
1266
|
-
const
|
|
1314
|
+
const store = useSelectRootContext();
|
|
1315
|
+
const multiple = store.useState("multiple");
|
|
1316
|
+
const readOnly = store.useState("readOnly");
|
|
1267
1317
|
const { alignItemWithTriggerActive } = useSelectPositionerContext();
|
|
1268
|
-
const hasScrollArrows =
|
|
1269
|
-
const openMethod =
|
|
1270
|
-
const multiple = useStore(store, selectors.multiple);
|
|
1318
|
+
const hasScrollArrows = store.useState("hasScrollArrows");
|
|
1319
|
+
const openMethod = store.useState("openMethod");
|
|
1271
1320
|
const defaultProps = {
|
|
1272
|
-
id: `${
|
|
1321
|
+
id: `${store.useState("id")}-list`,
|
|
1273
1322
|
role: "listbox",
|
|
1274
1323
|
"aria-multiselectable": multiple || void 0,
|
|
1324
|
+
"aria-readonly": readOnly || void 0,
|
|
1275
1325
|
onScroll(event) {
|
|
1276
|
-
scrollHandlerRef.current?.(event.currentTarget);
|
|
1326
|
+
store.context.scrollHandlerRef.current?.(event.currentTarget);
|
|
1277
1327
|
},
|
|
1278
1328
|
...alignItemWithTriggerActive && { style: LIST_FUNCTIONAL_STYLES },
|
|
1279
1329
|
className: hasScrollArrows && openMethod !== "touch" ? styleDisableScrollbar.className : void 0
|
|
1280
1330
|
};
|
|
1331
|
+
const setListElement = store.useStateSetter("listElement");
|
|
1281
1332
|
return useRenderElement("div", componentProps, {
|
|
1282
|
-
ref: [forwardedRef,
|
|
1283
|
-
store.set("listElement", element);
|
|
1284
|
-
})],
|
|
1333
|
+
ref: [forwardedRef, setListElement],
|
|
1285
1334
|
props: [defaultProps, elementProps]
|
|
1286
1335
|
});
|
|
1287
1336
|
});
|
|
1288
1337
|
SelectList.displayName = "SelectList";
|
|
1289
1338
|
//#endregion
|
|
1290
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1339
|
+
//#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/select/item/SelectItemContext.mjs
|
|
1291
1340
|
const SelectItemContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
1292
1341
|
SelectItemContext.displayName = "SelectItemContext";
|
|
1293
1342
|
function useSelectItemContext() {
|
|
@@ -1296,7 +1345,7 @@ function useSelectItemContext() {
|
|
|
1296
1345
|
return context;
|
|
1297
1346
|
}
|
|
1298
1347
|
//#endregion
|
|
1299
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
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/select/item/SelectItem.mjs
|
|
1300
1349
|
/**
|
|
1301
1350
|
* An individual option in the select popup.
|
|
1302
1351
|
* Renders a `<div>` element.
|
|
@@ -1304,54 +1353,55 @@ function useSelectItemContext() {
|
|
|
1304
1353
|
* Documentation: [Base UI Select](https://base-ui.com/react/components/select)
|
|
1305
1354
|
*/
|
|
1306
1355
|
const SelectItem = /*#__PURE__*/ React$1.memo(/*#__PURE__*/ React$1.forwardRef(function SelectItem(componentProps, forwardedRef) {
|
|
1307
|
-
const { render, className, style, value: itemValue = null, label, disabled = false, nativeButton = false, ...elementProps } = componentProps;
|
|
1356
|
+
const { render, className, style, value: itemValue = null, label, disabled: disabledProp = false, nativeButton = false, ...elementProps } = componentProps;
|
|
1308
1357
|
const textRef = React$1.useRef(null);
|
|
1309
1358
|
const listItem = useCompositeListItem({
|
|
1359
|
+
guess: true,
|
|
1310
1360
|
label,
|
|
1311
|
-
textRef
|
|
1312
|
-
indexGuessBehavior: IndexGuessBehavior.GuessFromOrder
|
|
1361
|
+
textRef
|
|
1313
1362
|
});
|
|
1314
|
-
const
|
|
1315
|
-
const
|
|
1316
|
-
const
|
|
1317
|
-
const
|
|
1318
|
-
const
|
|
1319
|
-
const
|
|
1363
|
+
const store = useSelectRootContext();
|
|
1364
|
+
const { props: itemProps, multiple, disabled: selectDisabled, readOnly, isItemEqualToValue } = store.useState("itemRoot");
|
|
1365
|
+
const disabled = selectDisabled || disabledProp;
|
|
1366
|
+
const highlighted = store.useState("isActive", listItem.index);
|
|
1367
|
+
const open = store.useState("open");
|
|
1368
|
+
const selected = store.useState("isSelected", itemValue);
|
|
1369
|
+
const selectedByFocus = store.useState("isSelectedByFocus", listItem.index);
|
|
1320
1370
|
const index = listItem.index;
|
|
1321
|
-
const hasRegistered = index !== -1;
|
|
1322
1371
|
const itemRef = React$1.useRef(null);
|
|
1323
1372
|
useIsoLayoutEffect(() => {
|
|
1324
|
-
|
|
1325
|
-
const values = valuesRef.current;
|
|
1373
|
+
const values = store.context.valuesRef.current;
|
|
1326
1374
|
values[index] = itemValue;
|
|
1327
1375
|
return () => {
|
|
1328
1376
|
delete values[index];
|
|
1329
1377
|
};
|
|
1330
1378
|
}, [
|
|
1331
|
-
hasRegistered,
|
|
1332
1379
|
index,
|
|
1333
1380
|
itemValue,
|
|
1334
|
-
|
|
1381
|
+
store
|
|
1335
1382
|
]);
|
|
1336
1383
|
useIsoLayoutEffect(() => {
|
|
1337
|
-
if (!hasRegistered) return;
|
|
1338
1384
|
const selectedValue = store.state.value;
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1385
|
+
const currentIndex = store.state.selectedIndex;
|
|
1386
|
+
let nextIndex = currentIndex;
|
|
1387
|
+
let claims;
|
|
1388
|
+
if (multiple && Array.isArray(selectedValue)) {
|
|
1389
|
+
nextIndex = resolveSelectedIndex(index, itemValue, store.context.valuesRef.current, selectedValue, isItemEqualToValue, currentIndex);
|
|
1390
|
+
claims = nextIndex === index;
|
|
1391
|
+
if (index === currentIndex && !claims) store.context.selectedItemTextRef.current = null;
|
|
1392
|
+
} else {
|
|
1393
|
+
claims = selectedValue !== void 0 && compareItemEquality(itemValue, selectedValue, isItemEqualToValue);
|
|
1394
|
+
if (claims) nextIndex = index;
|
|
1344
1395
|
}
|
|
1396
|
+
store.set("selectedIndex", nextIndex);
|
|
1397
|
+
if (claims && textRef.current) store.context.selectedItemTextRef.current = textRef.current;
|
|
1345
1398
|
}, [
|
|
1346
|
-
hasRegistered,
|
|
1347
1399
|
index,
|
|
1348
1400
|
multiple,
|
|
1349
1401
|
isItemEqualToValue,
|
|
1350
1402
|
store,
|
|
1351
|
-
itemValue
|
|
1352
|
-
selectedItemTextRef
|
|
1403
|
+
itemValue
|
|
1353
1404
|
]);
|
|
1354
|
-
const lastKeyRef = React$1.useRef(null);
|
|
1355
1405
|
const pointerTypeRef = React$1.useRef("mouse");
|
|
1356
1406
|
const allowMouseSelectionRef = React$1.useRef(false);
|
|
1357
1407
|
const { getButtonProps, buttonRef } = useButton({
|
|
@@ -1371,33 +1421,30 @@ const SelectItem = /*#__PURE__*/ React$1.memo(/*#__PURE__*/ React$1.forwardRef(f
|
|
|
1371
1421
|
if (multiple) {
|
|
1372
1422
|
const currentValue = Array.isArray(selectedValue) ? selectedValue : [];
|
|
1373
1423
|
const nextValue = selected ? removeItem(currentValue, itemValue, isItemEqualToValue) : [...currentValue, itemValue];
|
|
1374
|
-
setValue(nextValue, createChangeEventDetails(itemPress, event));
|
|
1424
|
+
store.context.setValue(nextValue, createChangeEventDetails(itemPress, event));
|
|
1375
1425
|
} else {
|
|
1376
|
-
setValue(itemValue, createChangeEventDetails(itemPress, event));
|
|
1377
|
-
setOpen(false, createChangeEventDetails(itemPress, event));
|
|
1426
|
+
store.context.setValue(itemValue, createChangeEventDetails(itemPress, event));
|
|
1427
|
+
store.context.setOpen(false, createChangeEventDetails(itemPress, event));
|
|
1378
1428
|
}
|
|
1379
1429
|
}
|
|
1380
1430
|
function resetDragMovement() {
|
|
1381
|
-
selectionRef.current.dragY = 0;
|
|
1431
|
+
store.context.selectionRef.current.dragY = 0;
|
|
1382
1432
|
}
|
|
1383
1433
|
const defaultProps = {
|
|
1384
1434
|
role: "option",
|
|
1385
1435
|
"aria-selected": selected,
|
|
1386
1436
|
tabIndex: open && highlighted ? 0 : -1,
|
|
1387
1437
|
onKeyDown(event) {
|
|
1388
|
-
lastKeyRef.current = event.key;
|
|
1389
1438
|
store.set("activeIndex", index);
|
|
1390
|
-
if (event.key === " " && typingRef.current) event.preventDefault();
|
|
1439
|
+
if (event.key === " " && store.context.typingRef.current) event.preventDefault();
|
|
1391
1440
|
},
|
|
1392
1441
|
onClick(event) {
|
|
1393
|
-
const isMouseClick =
|
|
1442
|
+
const isMouseClick = pointerTypeRef.current !== "touch";
|
|
1394
1443
|
const clickPointerType = event.nativeEvent.pointerType;
|
|
1395
1444
|
const isVirtualMouseClick = isMouseClick && isVirtualClick(event.nativeEvent) && (clickPointerType !== void 0 || highlighted);
|
|
1396
1445
|
const isInvalidMouseClick = isMouseClick && !isVirtualMouseClick && !allowMouseSelectionRef.current;
|
|
1397
1446
|
allowMouseSelectionRef.current = false;
|
|
1398
|
-
if (
|
|
1399
|
-
if (disabled || event.type === "keydown" && lastKeyRef.current === " " && typingRef.current || isInvalidMouseClick) return;
|
|
1400
|
-
lastKeyRef.current = null;
|
|
1447
|
+
if (disabled || isInvalidMouseClick) return;
|
|
1401
1448
|
commitSelection(event.nativeEvent);
|
|
1402
1449
|
},
|
|
1403
1450
|
onPointerEnter(event) {
|
|
@@ -1405,7 +1452,7 @@ const SelectItem = /*#__PURE__*/ React$1.memo(/*#__PURE__*/ React$1.forwardRef(f
|
|
|
1405
1452
|
},
|
|
1406
1453
|
onPointerMove(event) {
|
|
1407
1454
|
if (event.pointerType === "mouse" && event.buttons === 1) {
|
|
1408
|
-
const selection = selectionRef.current;
|
|
1455
|
+
const selection = store.context.selectionRef.current;
|
|
1409
1456
|
selection.dragY += event.movementY;
|
|
1410
1457
|
if (selection.dragY ** 2 >= 64) selection.allowUnselectedMouseUp = true;
|
|
1411
1458
|
}
|
|
@@ -1419,8 +1466,8 @@ const SelectItem = /*#__PURE__*/ React$1.memo(/*#__PURE__*/ React$1.forwardRef(f
|
|
|
1419
1466
|
resetDragMovement();
|
|
1420
1467
|
if (disabled || pointerTypeRef.current === "touch") return;
|
|
1421
1468
|
if (allowMouseSelectionRef.current) return;
|
|
1422
|
-
const disallowSelectedMouseUp = !selectionRef.current.allowSelectedMouseUp && selected;
|
|
1423
|
-
const disallowUnselectedMouseUp = !selectionRef.current.allowUnselectedMouseUp && !selected;
|
|
1469
|
+
const disallowSelectedMouseUp = !store.context.selectionRef.current.allowSelectedMouseUp && selected;
|
|
1470
|
+
const disallowUnselectedMouseUp = !store.context.selectionRef.current.allowUnselectedMouseUp && !selected;
|
|
1424
1471
|
if (disallowSelectedMouseUp || disallowUnselectedMouseUp) return;
|
|
1425
1472
|
allowMouseSelectionRef.current = true;
|
|
1426
1473
|
itemRef.current?.click();
|
|
@@ -1446,14 +1493,12 @@ const SelectItem = /*#__PURE__*/ React$1.memo(/*#__PURE__*/ React$1.forwardRef(f
|
|
|
1446
1493
|
selected,
|
|
1447
1494
|
index,
|
|
1448
1495
|
textRef,
|
|
1449
|
-
selectedByFocus
|
|
1450
|
-
hasRegistered
|
|
1496
|
+
selectedByFocus
|
|
1451
1497
|
}), [
|
|
1452
1498
|
selected,
|
|
1453
1499
|
index,
|
|
1454
1500
|
textRef,
|
|
1455
|
-
selectedByFocus
|
|
1456
|
-
hasRegistered
|
|
1501
|
+
selectedByFocus
|
|
1457
1502
|
]);
|
|
1458
1503
|
return /*#__PURE__*/ jsx(SelectItemContext.Provider, {
|
|
1459
1504
|
value: contextValue,
|
|
@@ -1462,7 +1507,7 @@ const SelectItem = /*#__PURE__*/ React$1.memo(/*#__PURE__*/ React$1.forwardRef(f
|
|
|
1462
1507
|
}));
|
|
1463
1508
|
SelectItem.displayName = "SelectItem";
|
|
1464
1509
|
//#endregion
|
|
1465
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1510
|
+
//#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/select/item-indicator/SelectItemIndicator.mjs
|
|
1466
1511
|
/**
|
|
1467
1512
|
* Indicates whether the select item is selected.
|
|
1468
1513
|
* Renders a `<span>` element.
|
|
@@ -1470,44 +1515,17 @@ SelectItem.displayName = "SelectItem";
|
|
|
1470
1515
|
* Documentation: [Base UI Select](https://base-ui.com/react/components/select)
|
|
1471
1516
|
*/
|
|
1472
1517
|
const SelectItemIndicator = /*#__PURE__*/ React$1.forwardRef(function SelectItemIndicator(componentProps, forwardedRef) {
|
|
1473
|
-
const keepMounted = componentProps.keepMounted ?? false;
|
|
1474
1518
|
const { selected } = useSelectItemContext();
|
|
1475
|
-
if (!(keepMounted || selected)) return null;
|
|
1476
|
-
return /*#__PURE__*/ jsx(
|
|
1519
|
+
if (!(componentProps.keepMounted || selected)) return null;
|
|
1520
|
+
return /*#__PURE__*/ jsx(ItemIndicator, {
|
|
1477
1521
|
...componentProps,
|
|
1522
|
+
selected,
|
|
1478
1523
|
ref: forwardedRef
|
|
1479
1524
|
});
|
|
1480
1525
|
});
|
|
1481
1526
|
SelectItemIndicator.displayName = "SelectItemIndicator";
|
|
1482
|
-
const Inner = /*#__PURE__*/ React$1.memo(/*#__PURE__*/ React$1.forwardRef((componentProps, forwardedRef) => {
|
|
1483
|
-
const { render, className, style, keepMounted, ...elementProps } = componentProps;
|
|
1484
|
-
const { selected } = useSelectItemContext();
|
|
1485
|
-
const indicatorRef = React$1.useRef(null);
|
|
1486
|
-
const { transitionStatus, setMounted } = useTransitionStatus(selected);
|
|
1487
|
-
const element = useRenderElement("span", componentProps, {
|
|
1488
|
-
ref: [forwardedRef, indicatorRef],
|
|
1489
|
-
state: {
|
|
1490
|
-
selected,
|
|
1491
|
-
transitionStatus
|
|
1492
|
-
},
|
|
1493
|
-
props: [{
|
|
1494
|
-
"aria-hidden": true,
|
|
1495
|
-
children: "✔️"
|
|
1496
|
-
}, elementProps],
|
|
1497
|
-
stateAttributesMapping: transitionStatusMapping
|
|
1498
|
-
});
|
|
1499
|
-
useOpenChangeComplete({
|
|
1500
|
-
open: selected,
|
|
1501
|
-
ref: indicatorRef,
|
|
1502
|
-
onComplete() {
|
|
1503
|
-
if (!selected) setMounted(false);
|
|
1504
|
-
}
|
|
1505
|
-
});
|
|
1506
|
-
return element;
|
|
1507
|
-
}));
|
|
1508
|
-
Inner.displayName = "Inner";
|
|
1509
1527
|
//#endregion
|
|
1510
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1528
|
+
//#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/select/item-text/SelectItemText.mjs
|
|
1511
1529
|
/**
|
|
1512
1530
|
* A text label of the select item.
|
|
1513
1531
|
* Renders a `<div>` element.
|
|
@@ -1515,22 +1533,21 @@ Inner.displayName = "Inner";
|
|
|
1515
1533
|
* Documentation: [Base UI Select](https://base-ui.com/react/components/select)
|
|
1516
1534
|
*/
|
|
1517
1535
|
const SelectItemText = /*#__PURE__*/ React$1.memo(/*#__PURE__*/ React$1.forwardRef(function SelectItemText(componentProps, forwardedRef) {
|
|
1518
|
-
const { index, textRef, selectedByFocus
|
|
1519
|
-
const
|
|
1536
|
+
const { index, textRef, selectedByFocus } = useSelectItemContext();
|
|
1537
|
+
const store = useSelectRootContext();
|
|
1520
1538
|
const { render, className, style, ...elementProps } = componentProps;
|
|
1539
|
+
const localRef = React$1.useCallback((node) => {
|
|
1540
|
+
if (!node) return;
|
|
1541
|
+
if (index === 0) store.context.firstItemTextRef.current = node;
|
|
1542
|
+
if (selectedByFocus) store.context.selectedItemTextRef.current = node;
|
|
1543
|
+
}, [
|
|
1544
|
+
store,
|
|
1545
|
+
index,
|
|
1546
|
+
selectedByFocus
|
|
1547
|
+
]);
|
|
1521
1548
|
return useRenderElement("div", componentProps, {
|
|
1522
1549
|
ref: [
|
|
1523
|
-
|
|
1524
|
-
if (!node) return;
|
|
1525
|
-
if (hasRegistered && index === 0) firstItemTextRef.current = node;
|
|
1526
|
-
if (hasRegistered && selectedByFocus) selectedItemTextRef.current = node;
|
|
1527
|
-
}, [
|
|
1528
|
-
firstItemTextRef,
|
|
1529
|
-
selectedItemTextRef,
|
|
1530
|
-
index,
|
|
1531
|
-
selectedByFocus,
|
|
1532
|
-
hasRegistered
|
|
1533
|
-
]),
|
|
1550
|
+
localRef,
|
|
1534
1551
|
forwardedRef,
|
|
1535
1552
|
textRef
|
|
1536
1553
|
],
|
|
@@ -1539,7 +1556,7 @@ const SelectItemText = /*#__PURE__*/ React$1.memo(/*#__PURE__*/ React$1.forwardR
|
|
|
1539
1556
|
}));
|
|
1540
1557
|
SelectItemText.displayName = "SelectItemText";
|
|
1541
1558
|
//#endregion
|
|
1542
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1559
|
+
//#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/select/group/SelectGroupContext.mjs
|
|
1543
1560
|
const SelectGroupContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
1544
1561
|
SelectGroupContext.displayName = "SelectGroupContext";
|
|
1545
1562
|
function useSelectGroupContext() {
|
|
@@ -1548,7 +1565,7 @@ function useSelectGroupContext() {
|
|
|
1548
1565
|
return context;
|
|
1549
1566
|
}
|
|
1550
1567
|
//#endregion
|
|
1551
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1568
|
+
//#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/select/group/SelectGroup.mjs
|
|
1552
1569
|
/**
|
|
1553
1570
|
* Groups related select items with the corresponding label.
|
|
1554
1571
|
* Renders a `<div>` element.
|
|
@@ -1576,7 +1593,7 @@ const SelectGroup = /*#__PURE__*/ React$1.forwardRef(function SelectGroup(compon
|
|
|
1576
1593
|
});
|
|
1577
1594
|
SelectGroup.displayName = "SelectGroup";
|
|
1578
1595
|
//#endregion
|
|
1579
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1596
|
+
//#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/select/group-label/SelectGroupLabel.mjs
|
|
1580
1597
|
/**
|
|
1581
1598
|
* An accessible label that is automatically associated with its parent group.
|
|
1582
1599
|
* Renders a `<div>` element.
|
|
@@ -1589,12 +1606,27 @@ const SelectGroupLabel = /*#__PURE__*/ React$1.forwardRef(function SelectGroupLa
|
|
|
1589
1606
|
const id = useBaseUiId(idProp);
|
|
1590
1607
|
useIsoLayoutEffect(() => {
|
|
1591
1608
|
setLabelId(id);
|
|
1609
|
+
return () => {
|
|
1610
|
+
setLabelId((currentId) => currentId === id ? void 0 : currentId);
|
|
1611
|
+
};
|
|
1592
1612
|
}, [id, setLabelId]);
|
|
1593
1613
|
return useRenderElement("div", componentProps, {
|
|
1594
1614
|
ref: forwardedRef,
|
|
1595
|
-
props: [{
|
|
1615
|
+
props: [{
|
|
1616
|
+
id,
|
|
1617
|
+
"aria-hidden": true
|
|
1618
|
+
}, elementProps]
|
|
1596
1619
|
});
|
|
1597
1620
|
});
|
|
1598
1621
|
SelectGroupLabel.displayName = "SelectGroupLabel";
|
|
1599
1622
|
//#endregion
|
|
1600
|
-
|
|
1623
|
+
//#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/select/separator/SelectSeparator.mjs
|
|
1624
|
+
/**
|
|
1625
|
+
* A visual separator between items or groups.
|
|
1626
|
+
* Renders a `<div>` element.
|
|
1627
|
+
*
|
|
1628
|
+
* Documentation: [Base UI Select](https://base-ui.com/react/components/select)
|
|
1629
|
+
*/
|
|
1630
|
+
const SelectSeparator = ListboxSeparator;
|
|
1631
|
+
//#endregion
|
|
1632
|
+
export { SelectLabel as _, SelectItemIndicator as a, SelectPopup as c, useSelectPositionerContext as d, SelectPortal as f, SelectTriggerDataAttributes_exports as g, SelectTrigger as h, SelectItemText as i, SelectPositionerCssVars_exports as l, SelectValue as m, SelectGroupLabel as n, SelectItem as o, SelectIcon as p, SelectGroup as r, SelectList as s, SelectSeparator as t, SelectPositioner as u, SelectRoot as v, useSelectRootContext as y };
|