@cloudflare/kumo 2.13.2 → 2.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/README.md +2 -2
- package/ai/component-registry.json +548 -8
- package/ai/component-registry.md +853 -19
- package/ai/schemas.ts +90 -2
- package/dist/.build-complete +1 -1
- package/dist/ai/schemas.d.ts +311 -69
- package/dist/ai/schemas.js +185 -23
- package/dist/catalog.d.ts +11 -11
- package/dist/chunks/{AlertDialogTrigger-k3f8nevrda6awa4s.js → AlertDialogTrigger-dkihgpvj12si73w3.js} +5 -5
- package/dist/chunks/{AutocompleteItem-ksckpihly1c23f3j.js → AutocompleteItem-drxau0wm3735nihq.js} +17 -29
- package/dist/chunks/AutocompleteSeparator-hqtaxxxye1rfezfg.js +12 -0
- package/dist/chunks/{Button-oczevl8g75m85ew9.js → Button-ccl5r1xlbe3gh998.js} +3 -3
- package/dist/chunks/{CSPContext-guqghj8kxoukvlky.js → CSPContext-ctyrgg64girv38ls.js} +1 -7
- package/dist/chunks/{CSPProvider-f3it239kgztzgryk.js → CSPProvider-p9ensukmowjpkgc0.js} +2 -2
- package/dist/chunks/{CheckboxGroup-g5xn5gnq8ocqyoum.js → CheckboxGroup-knvypu2d1s0iz86k.js} +63 -45
- package/dist/chunks/{CheckboxGroupContext-f9wox07n2u5moq4h.js → CheckboxGroupContext-lgc9dwxou662i6zo.js} +3 -5
- package/dist/chunks/{CheckboxRoot-o5bfpje6e4p6pdgm.js → CheckboxIndicator-n982pbktfkxsa5zz.js} +128 -132
- package/dist/chunks/{CollapsiblePanel-e80n35tnsb2cskt9.js → CollapsiblePanel-jm0ni90g7wz7ppkc.js} +33 -36
- package/dist/chunks/{ComboboxClear-glm805v81uaaf3su.js → ComboboxClear-c2kvjkh9yc6xfl38.js} +83 -98
- package/dist/chunks/{ComboboxEmpty-hwv2kjxnf9un635e.js → ComboboxEmpty-o0q20j2l2syar9kx.js} +662 -586
- package/dist/chunks/{ComboboxPopup-fx7xex6g75t9u0gm.js → ComboboxPopup-oxgggc2wxy6bfmru.js} +57 -57
- package/dist/chunks/{CompositeItem-l7zee38lq5m224d5.js → CompositeItem-hzuk5x3e5zsfgnyj.js} +4 -7
- package/dist/chunks/CompositeList-lbr4enu6yzek7oa9.js +180 -0
- package/dist/chunks/{CompositeListContext-oetjj2x8li8678as.js → CompositeListContext-m9frxn53kkmr23d0.js} +2 -5
- package/dist/chunks/{CompositeRoot-l6ot8jo0umdics5m.js → CompositeRoot-g72lchaerolf5dc9.js} +61 -63
- package/dist/chunks/{CompositeRootContext-ofhzmevv7hadjhyy.js → CompositeRootContext-ixz4myr7uwvavx6w.js} +1 -1
- package/dist/chunks/DialogHandle-klk7uo1q1y8ghyx5.js +68 -0
- package/dist/chunks/{DialogPopup-mp89aob2nown2akq.js → DialogPopup-olsvyf7ulia6ekb1.js} +28 -71
- package/dist/chunks/DialogRoot-hl3genvzl9h8ridm.js +16 -0
- package/dist/chunks/{DialogTrigger-cmok07cf3ks0kzug.js → DialogTrigger-g44cuem7n4wez533.js} +23 -20
- package/dist/chunks/DialogViewport-e1tqfisqexc7o9z8.js +42 -0
- package/dist/chunks/{DirectionContext-jc1g0w645603sd6p.js → DirectionContext-opvqcb794uxicri4.js} +1 -4
- package/dist/chunks/{DirectionProvider-ihtfgxd5qpm6oth1.js → DirectionProvider-er2gibtc9a1f0kep.js} +2 -2
- package/dist/chunks/DrawerViewport-eqzib92gukr4qap3.js +1483 -0
- package/dist/chunks/{FieldControl-oz007qbkl6ejp7di.js → FieldControl-c5sahhd5xg3nr2x7.js} +58 -31
- package/dist/chunks/{FieldDescription-ju607ea6gwgzga8p.js → FieldDescription-ldfiii5bvssfib3d.js} +13 -12
- package/dist/chunks/{FieldItemContext-j85dc0ihramj5ezs.js → FieldItemContext-kpsmvqm5a98m8zpx.js} +1 -1
- package/dist/chunks/FieldLabel-j9teqs9f1exqv346.js +351 -0
- package/dist/chunks/{FieldsetLegend-j5piwq1giyhrr8s4.js → FieldsetLegend-jyy40ylt2ynkvgob.js} +7 -14
- package/dist/chunks/{FieldsetRootContext-b633e9uzilttuyfi.js → FieldsetRootContext-7nlstw7wronafxhw.js} +1 -1
- package/dist/chunks/{FloatingPortalLite-mlt7ztrvhzepwi5y.js → FloatingPortalLite-da0wdcmem7ahkle6.js} +3 -3
- package/dist/chunks/{FloatingTree-oosjswl1s9q4obvg.js → FloatingTree-lhdqtlu8s6m66n7l.js} +6 -6
- package/dist/chunks/Form-fjfbann47c7ws316.js +113 -0
- package/dist/chunks/{FormContext-xz0b4h7ue30fkkn1.js → FormContext-bsu99v8i8pwu1yxc.js} +4 -3
- package/dist/chunks/{Input-ovqfhsmpfcrg5czm.js → Input-irwtufp5t73pwnoj.js} +2 -2
- package/dist/chunks/{LabelableContext-hetas2e4y0kywfas.js → LabelableContext-ccxbhu73vrk089m1.js} +18 -45
- package/dist/chunks/ListboxSeparator-nfyv54r2v5qtmosj.js +21 -0
- package/dist/chunks/{MenuBackdrop-dlntmavtopj7wv0l.js → MenuBackdrop-ouznwyglg27bosoj.js} +7 -12
- package/dist/chunks/{MenuSubmenuTrigger-fzubf5xr7ohsgsi7.js → MenuSubmenuTrigger-mbbda6ucik6nphbq.js} +378 -292
- package/dist/chunks/{MenuTrigger-ntugq34yppc8ouwe.js → MenuTrigger-disngqnt74owi30p.js} +32 -41
- package/dist/chunks/{Menubar-d57cyjuztbge4dvv.js → Menubar-fluuxyn8c2zuz5pr.js} +12 -23
- package/dist/chunks/{MenubarContext-ei2r6vu6lmsspozo.js → MenubarContext-blatefsj42br7jh8.js} +1 -1
- package/dist/chunks/{MeterLabel-c40b0q8r81cftkjj.js → MeterLabel-k6no448jvaidaptf.js} +15 -18
- package/dist/chunks/NullStore-jwgpmovsgl47g9bv.js +109 -0
- package/dist/chunks/{PopoverClose-e91n3nkw16qnyese.js → PopoverClose-kpyt8hbqc52lnjb8.js} +183 -190
- package/dist/chunks/PrehydrationScript-j6zlrxmojrqni6b9.js +63 -0
- package/dist/chunks/{RadioGroup-lsix4haqxfigpuv8.js → RadioGroup-pok1e5qbnbujrz1e.js} +38 -35
- package/dist/chunks/{RadioGroupContext-ft0nndmzqynjz8a2.js → RadioGroupContext-galfnl2el7y2krov.js} +1 -1
- package/dist/chunks/{RadioIndicator-mwkahpwyqfc6yk1i.js → RadioIndicator-jd511oajbwmyjxbg.js} +49 -102
- package/dist/chunks/{ScrollAreaThumb-kmhan411yxfo0362.js → ScrollAreaThumb-eed3hf0pmrblshfw.js} +298 -385
- package/dist/chunks/{SelectGroupLabel-m4h5hrft9043nsd1.js → SelectSeparator-mrjooj7vmjez6fua.js} +447 -502
- package/dist/chunks/{Separator-b8wf5rea6m1cei8k.js → Separator-bcm4ezllqxvtpvuj.js} +2 -2
- package/dist/chunks/{SwitchRoot-e3hnyh3mf8qd30hj.js → SwitchRoot-gahuqddsq1s55p8m.js} +40 -85
- package/dist/chunks/{TabsList-c0inft3sf8gi2o4v.js → TabsList-ebl0v8gu8wn28zss.js} +204 -175
- package/dist/chunks/{Toggle-c8p9m3puz8l4mav7.js → Toggle-mbshs50266z9hgxp.js} +12 -13
- package/dist/chunks/{ToggleGroup-xz9zrh7t1htn6ht4.js → ToggleGroup-k2caz2ghv6zbzp5l.js} +13 -38
- package/dist/chunks/{ToggleGroupContext-cdk2zo6ciddpockn.js → ToggleGroupContext-h4v7jaf77rp2xng9.js} +3 -5
- package/dist/chunks/{ToolbarGroupContext-nriz3632ymugfj6h.js → ToolbarGroupContext-e5cg7needj0edodc.js} +3 -5
- package/dist/chunks/{ToolbarInput-er5t9irqvuwcjrir.js → ToolbarInput-i4h95tes75w0p5y2.js} +28 -33
- package/dist/chunks/{ToolbarRootContext-lvi96r1vvs93rhde.js → ToolbarRootContext-eqk40r8uh4h6r211.js} +1 -1
- package/dist/chunks/{TooltipPopup-l2zrbjavf1cqclfx.js → TooltipPopup-dm4y0hbdeylzp22y.js} +125 -127
- package/dist/chunks/{TooltipProvider-eyhgia63aq2x4frl.js → TooltipProvider-h40qf9wcn0atj15v.js} +14 -17
- package/dist/chunks/adaptiveOriginMiddleware-b8ztjthe278xq7lm.js +51 -0
- package/dist/chunks/{addEventListener-lhqvk2ahlzjsanyg.js → addEventListener-l40nxvf06iukgvnj.js} +1 -1
- package/dist/chunks/areArraysEqual-bcx201k1x9ziizym.js +15 -0
- package/dist/chunks/{autocomplete-dn6g4rc8bktdl4an.js → autocomplete-m6h1pbygknrz5div.js} +7 -7
- package/dist/chunks/{badge-xw5ydgdjx2o5qxbl.js → badge-dq8bx752b9dp7dst.js} +2 -1
- package/dist/chunks/{banner-n1ekcvrwashsgv93.js → banner-msnmqm7of2lck01x.js} +2 -2
- package/dist/chunks/{breadcrumbs-ffwe8tzqzmpyikq5.js → breadcrumbs-lhi1qrdh74mb4zsx.js} +4 -3
- package/dist/chunks/button-group-i9dh83xutyuxyry7.js +59 -0
- package/dist/chunks/{button-h36q7tklakhd38nx.js → button-pa1bq9b85hawg41a.js} +1 -1
- package/dist/chunks/{chart-qmls2klknm1pd6hs.js → chart-kd1xd6crso2i956o.js} +936 -49
- package/dist/chunks/{checkbox-jachq6akfh72x12r.js → checkbox-lbo436duy7krxcsk.js} +6 -7
- package/dist/chunks/clamp-jcjhzx71s6wt1rnc.js +7 -0
- package/dist/chunks/{clipboard-text-ms46uaujvkjmjnng.js → clipboard-text-gd6s3n1bqse9zgt8.js} +5 -5
- package/dist/chunks/{collapsible-jyajpe40jcca357s.js → collapsible-l8g94on4w7qfosmn.js} +1 -1
- package/dist/chunks/{combobox-hxarufzb1z61xnbv.js → combobox-hdxtsm2gqcxxgfju.js} +12 -11
- package/dist/chunks/{command-palette-iomiziccabzh4ogg.js → command-palette-crtm3nd32yjhuax1.js} +7 -7
- package/dist/chunks/{composite-o65hjzwwzb4kvl4w.js → composite-ab8dmdfoj6tmhcn1.js} +9 -21
- package/dist/chunks/{constants-j09lrtg73n4vlx5x.js → constants-flxfd6q03phtu007.js} +1 -1
- package/dist/chunks/{core-kjfqbvgicl9i3abf.js → core-n0de50o00ej2ecfe.js} +69 -55
- package/dist/chunks/createBaseUIEventDetails-3ob3qgs95ffm8l0w.js +49 -0
- package/dist/chunks/{ComboboxChipRemove-ksyozjezihhstmbu.js → createItems-b8n8vigg5nak6j9s.js} +113 -57
- package/dist/chunks/{createToastManager-kv89sv0xhhsvmq54.js → createToastManager-onmoqrmr8zo02rif.js} +305 -357
- package/dist/chunks/{css-d3t41yfupsmz7l1a.js → css-j501gxq1am2gnikh.js} +1 -1
- package/dist/chunks/{date-picker-fwe3vllwco4u1utz.js → date-picker-cotkexrpqu5tjikv.js} +54 -49
- package/dist/chunks/{date-range-picker-iymdx410i1hpvxai.js → date-range-picker-i6d8y1yemm7x5ins.js} +15 -14
- package/dist/chunks/{dialog-o0164pgcyc74lvp9.js → dialog-glpnivujociqs9lh.js} +13 -10
- package/dist/chunks/{dropdown-d5qrzj1w1a96w2we.js → dropdown-m53ji1d66mws89wh.js} +4 -4
- package/dist/chunks/{empty-ox60d384lkwbj5n4.js → empty-hkvg3is3uc6dj1at.js} +46 -38
- package/dist/chunks/{engine-io35xsj9fgfxtihg.js → engine-g5egnkub1ikv3wvy.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-f4f6l13zx6tynxmy.js +6 -0
- package/dist/chunks/{field-kgz7w7yixmtpg010.js → field-oqtso1v0oszlxi0e.js} +3 -3
- package/dist/chunks/{flow-fmfb3ri8cxo7w9ci.js → flow-iz8sn24h5q6q4b10.js} +76 -60
- package/dist/chunks/formatNumber-kcnmauoqxku5a84c.js +21 -0
- package/dist/chunks/{getCssDimensions-mi941fe1jvztqm6b.js → getCssDimensions-olosvhh5husavesv.js} +2 -2
- package/dist/chunks/getElementTransform-cuiqmjglkrz4db6c.js +38 -0
- package/dist/chunks/{getPseudoElementBounds-jg72lmrlwgbqhmjh.js → getPseudoElementBounds-x7b9uqi5hdb1lq2r.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/{html-ijyj3f9k0foag15c.js → html-nimj6ljkkifnc9ni.js} +2 -2
- package/dist/chunks/{index.parts-i4iu310eo65d7lfc.js → index.parts-b9zmk3ta77w8dy9f.js} +86 -34
- package/dist/chunks/{index.parts-mr7tgwe4pgfozkt5.js → index.parts-bq90erougcgrwlgk.js} +47 -50
- package/dist/chunks/{index.parts-7z8hqx6zl9yajzvs.js → index.parts-c1ocmbxanagpan6d.js} +206 -366
- package/dist/chunks/{index.parts-nd3mitrhxf806lsa.js → index.parts-cc0yi5vo7s4x3r9p.js} +140 -145
- package/dist/chunks/{index.parts-j2ecf25zajyd5ia3.js → index.parts-cdxa6fwtp3lpkpp4.js} +2 -2
- package/dist/chunks/{index.parts-komdbdvf823cm5jw.js → index.parts-cl2xux9bjec6cibd.js} +14 -11
- package/dist/chunks/{index.parts-bv57na43ve93uz3x.js → index.parts-d4wim8mcnl9a2n9d.js} +67 -36
- package/dist/chunks/{index.parts-gslyp9n88qdh38n1.js → index.parts-e9s1lqq3qa9l6ndm.js} +2 -2
- package/dist/chunks/{index.parts-i4lbjqdnhsnjtny6.js → index.parts-eks3uafpskcxle6j.js} +33 -22
- package/dist/chunks/{index2.parts-kiwz8e3k8utvm4zb.js → index.parts-fbip2x29k5okvypg.js} +9 -12
- package/dist/chunks/index.parts-fhza3s183grld7zq.js +102 -0
- package/dist/chunks/{index.parts-lz9cnngidxppvhz7.js → index.parts-ftxrjoy00esi3aau.js} +27 -40
- package/dist/chunks/{index.parts-kt0w73ciea6adi2i.js → index.parts-g390bxx23hdko02m.js} +2 -2
- package/dist/chunks/{index.parts-fl4zaorc97ed3keb.js → index.parts-gf9v1piz8xxt8ap1.js} +197 -244
- package/dist/chunks/{index.parts-ef9111sjk9e3al87.js → index.parts-h7wtkrxpz4m8eqn9.js} +63 -83
- package/dist/chunks/index.parts-hmx3qlh517ii56yi.js +116 -0
- package/dist/chunks/{index2.parts-mv7x6w0p2splvf6b.js → index.parts-i6gbeimeit8gzhvi.js} +2 -2
- package/dist/chunks/{index.parts-gj1k50tf9fcs7nru.js → index.parts-ioii4acz2bjrf6sb.js} +17 -21
- package/dist/chunks/{index.parts-i5twygaksh86erb7.js → index.parts-iq66xivmdw2mouvx.js} +7 -6
- package/dist/chunks/{index.parts-hxjt52jbictdzgad.js → index.parts-j6kbr29a542ya81m.js} +275 -388
- package/dist/chunks/{index.parts-lhpuh6pw7rjcddnl.js → index.parts-jjup1zgnozoxi7ky.js} +41 -57
- package/dist/chunks/index.parts-jknln7yxhdokkvd6.js +991 -0
- package/dist/chunks/{index.parts-nzwjx603vcq1kryz.js → index.parts-jpm6c0fe0gyky12m.js} +22 -54
- package/dist/chunks/{index.parts-jmb5ztstw4xlfyp9.js → index.parts-kgiqby97w6tn6jw7.js} +15 -20
- package/dist/chunks/{index.parts-c5yto0l67i7ok5fd.js → index.parts-lpafjiz853r94ydb.js} +59 -59
- package/dist/chunks/{index.parts-cpviii2nt413tb8k.js → index.parts-moguar0t0u4aumou.js} +6 -5
- package/dist/chunks/{index.parts-ieuelcd4z5e0mcb7.js → index.parts-mw0e646n3qp6v1qe.js} +11 -11
- package/dist/chunks/{index.parts-nc6jzjq91z2nye75.js → index.parts-olcmo45gi8e1qma1.js} +2 -3
- package/dist/chunks/{index.parts-bmzuqorz0tmneh7t.js → index.parts-p2lcxzhh1ll3584m.js} +41 -39
- package/dist/chunks/{inertValue-f9pgp32jxnm88df3.js → inertValue-e0o6qvuef83v78fk.js} +2 -2
- package/dist/chunks/inline-copy-text-gbd7jhwpor27l4rq.js +104 -0
- package/dist/chunks/{input-pehjmr1q131tz38w.js → input-c8lv9ulv0kortliq.js} +2 -2
- package/dist/chunks/{input-group-kshukialqry0fmra.js → input-group-fjr4r5ax0x78ppax.js} +10 -7
- package/dist/chunks/{input-ikfimmpl5sngvh9s.js → input-h5ox92gf13ge04hp.js} +11 -10
- package/dist/chunks/{isElementDisabled-ffsy1y4adxocmexb.js → isElementDisabled-o0j7po84u0xjuwgg.js} +1 -1
- package/dist/chunks/{label-ie2gpde0nco1avi7.js → label-gzyfw17u08irhdo8.js} +2 -2
- package/dist/chunks/{layer-card-dnikj7emx8qeaspz.js → layer-card-idh3863vdgprgqai.js} +5 -3
- package/dist/chunks/layer-dialog-j5ywmzs46ccg6oqy.js +381 -0
- package/dist/chunks/{link-gp4swsrd3vfnvori.js → link-cqyfjezntvr53rh7.js} +2 -2
- package/dist/chunks/locale-provider-kjlnws7jln3ak0dr.js +29 -0
- package/dist/chunks/{menubar-ljbsj2ulayebjyza.js → menubar-fjhotkmndttb8mua.js} +13 -12
- package/dist/chunks/{mergeCleanups-pexn3wul6a4zn873.js → mergeCleanups-ix8l84cgutsbotpd.js} +1 -1
- package/dist/chunks/{meter-fl03ece4glrrzizj.js → meter-majprsslwmpbmkzg.js} +1 -1
- package/dist/chunks/{pagination-i3jewbdolgru0xnr.js → pagination-oaenm9t7ou3lmcgw.js} +2 -2
- package/dist/chunks/{popover-jal8z9sv176703lf.js → popover-hr0bfgg48xzjggky.js} +2 -2
- package/dist/chunks/popupHandle-7ghmro8a5uerjwu5.js +177 -0
- package/dist/chunks/{popupStoreUtils-jrxqkz5jmlijlr91.js → popupStoreUtils-i0y57dvmcnqrh4pv.js} +178 -101
- package/dist/chunks/{popupStateMapping-hdv48wmkzb2mqful.js → popupTriggerMap-ehv0fuhnmy59j3pn.js} +167 -193
- package/dist/chunks/{portal-provider-gznk6snyqj6egd6d.js → portal-provider-eveknxf26oudn7pp.js} +4 -0
- package/dist/chunks/{radio-gvy6ekh5hu9awlru.js → radio-35dx7y6rjrezbjsp.js} +4 -4
- package/dist/chunks/reason-parts-m5ishukzeux3q0pc.js +39 -0
- package/dist/chunks/{resolveAriaLabelledBy-h9qwvo10ftlj6t9k.js → resolveAriaLabelledBy-nc8mdie5shy87nsb.js} +1 -1
- package/dist/chunks/{resolveValueLabel-bq3nrzord518kp9q.js → resolveValueLabel-hpmsash3ektitvnb.js} +44 -10
- package/dist/chunks/{safePolygon-szbj0u31i6mpt36d.js → safePolygon-kmd5wsz26l4xtj6c.js} +35 -29
- package/dist/chunks/{safeReact-bavzz23j5tex60z2.js → safeReact-hpp4cck3y2s5jg75.js} +2 -2
- package/dist/chunks/scrollable-b6m9ze1u7ps0q1qn.js +34 -0
- package/dist/chunks/{select-ndqpqpmqtmn497rq.js → select-futox5zqr3r80y9a.js} +8 -9
- package/dist/chunks/{sensitive-input-jtbp3mvdynz9wewu.js → sensitive-input-cw33yncetxk3fbrl.js} +3 -3
- package/dist/chunks/{serializeValue-ci3kihruew64i36f.js → serializeValue-ipcakiw32jb7kany.js} +1 -1
- package/dist/chunks/{sidebar-icky50wdc2b1biw8.js → sidebar-in9zhvr473afsjpp.js} +104 -31
- package/dist/chunks/{skeleton-line-hlk5vauzo7xsalbo.js → skeleton-line-m9dyh126t9k07jvg.js} +8 -5
- package/dist/chunks/{sql-do9h6435gka97c4c.js → sql-hqp2eekl7qhmxe92.js} +1 -1
- package/dist/chunks/{stringifyLocale-cl8et9xf6zon4qbs.js → stringifyLocale-bxsgxdnzaef2vcar.js} +1 -1
- package/dist/chunks/{styles-dbhgpd8fm76fdfo3.js → styles-kl02oyrlnld7arja.js} +2 -2
- package/dist/chunks/{surface-ef2kr5pn7r1y3ipk.js → surface-irf0af2mfglu4p0j.js} +1 -1
- package/dist/chunks/{switch-oghrd7f6i5jqar59.js → switch-cqsvolm7h69z7vgg.js} +3 -3
- package/dist/chunks/{table-miggde3uqhhrd5at.js → table-yf8ul2e5nbemioi1.js} +1 -1
- package/dist/chunks/{tabs-mr2dsloqfe0io4a5.js → tabs-gf57qqf1wcclaejq.js} +1 -1
- package/dist/chunks/tag-input-ohfybx5dbxy3houy.js +139 -0
- package/dist/chunks/{text-jzp4mdlr222iuzxt.js → text-f1wxz183ckq7qtl7.js} +3 -2
- package/dist/chunks/{toast-g435fvt74w5orxqo.js → toast-bzaothy2yrezh787.js} +7 -6
- package/dist/chunks/{toolbar-e0b61hr6ys6dmwhv.js → toolbar-h213d8e22yjh5cwq.js} +6 -5
- package/dist/chunks/{tooltip-jq15p5jzgfrhslpo.js → tooltip-o4natsv01lpq8oq2.js} +3 -3
- package/dist/chunks/{useAnchoredPopupScrollLock-lbrqp1zm5z821z20.js → useAnchoredPopupScrollLock-kp3kai20u91sdm7v.js} +4 -4
- package/dist/chunks/{useAnimationFrame-ssgc72hyq6sg3yit.js → useAnimationFrame-0tt315hl9n3jzl86.js} +5 -4
- package/dist/chunks/{useAriaLabelledBy-bvw56m1d7czf0w3f.js → useAriaLabelledBy-ox8dum59shmgypq1.js} +3 -6
- package/dist/chunks/{useBaseUiId-gqkl5ep5pn6hd0rw.js → useBaseUiId-lg1teubxudgin0w2.js} +2 -2
- package/dist/chunks/{useButton-cpo6u2idqcnou6vy.js → useButton-h7s9aq1sfw6arawe.js} +56 -21
- package/dist/chunks/{useClick-fvwb39qgead2jyft.js → useClick-l0p0endoxrlp0ae5.js} +8 -7
- package/dist/chunks/{useCollapsiblePanel-bw63vwvq9a3sj73q.js → useCollapsiblePanel-g6t146nqj521pild.js} +60 -71
- package/dist/chunks/{useCompositeItem-esr3n4pmlssiuxuy.js → useCompositeItem-p7090ga00dpqcg5j.js} +4 -4
- package/dist/chunks/useCompositeListItem-odg6yo4h8866b37o.js +54 -0
- package/dist/chunks/{useControlled-nlx0kk1ksgk0auvi.js → useControlled-lfns1ot6kwowa4t4.js} +3 -3
- package/dist/chunks/{useDismiss-kbtx2o3ruyh3jwgn.js → useDismiss-me91ertzzz3gly12.js} +54 -23
- package/dist/chunks/useFieldValidation-e5pc8loiwzd68g4f.js +224 -0
- package/dist/chunks/{useFilteredItems-ns32d3hpp626kt73.js → useFilteredItems-kw2za6m9bng7twr0.js} +36 -38
- package/dist/chunks/{useFloatingRootContext-o6mk8fvodtbbm2v1.js → useFloatingRootContext-c849wtis7gx013m8.js} +7 -7
- package/dist/chunks/{useFocus-gdfx28bn90keg8cf.js → useFocus-lqwrnfa1svv3bcx1.js} +14 -10
- package/dist/chunks/{useForcedRerendering-el1fbg3ib5yo0v7k.js → useForcedRerendering-i3n4ms0xose8borh.js} +1 -1
- package/dist/chunks/{useId-l9soitgw3e4jk5ie.js → useId-f8w657f9yys10abm.js} +2 -2
- package/dist/chunks/{useLabel-nh9hf8h7o6oquqn5.js → useLabel-kcggu762z3z2taeb.js} +10 -9
- package/dist/chunks/useLabelableId-gqiiuqqn2k0u62r4.js +56 -0
- package/dist/chunks/{useListNavigation-jnxpvegv3ak857b1.js → useListNavigation-3nyjs362qcau34in.js} +51 -39
- package/dist/chunks/{useOnMount-j4wobeq47l3u9olo.js → useOnMount-hadwgyauanbzrvem.js} +3 -3
- package/dist/chunks/{useOpenChangeComplete-dpkex2e23s1evpol.js → useOpenChangeComplete-lk2gfu250t7r20c6.js} +48 -38
- package/dist/chunks/usePopupHandleStore-hx871cmn66j0q7wz.js +27 -0
- package/dist/chunks/{usePopupViewport-hu0kn0ziyf1vqzrs.js → usePopupViewport-iy5j9zawjrr3pcs0.js} +89 -57
- package/dist/chunks/{usePositioner-fz9uswhkhg22lo42.js → usePositioner-k9nc7cl550bgfwzs.js} +151 -142
- package/dist/chunks/{usePreviousValue-le0grv8f43vmunn1.js → usePreviousValue-io5t1pdxehw21l85.js} +2 -2
- package/dist/chunks/{useRegisterFieldControl-m1rxsuvtpau2341n.js → useRegisterFieldControl-lvusf6vc963clx02.js} +16 -10
- package/dist/chunks/{useRegisteredLabelId-dh83mybmzy75waje.js → useRegisteredLabelId-hw6b87h1k7kow1o2.js} +4 -4
- package/dist/chunks/{useRender-gtnbrp1ityffi4xf.js → useRender-onwjigxa00uch2ip.js} +2 -2
- package/dist/chunks/{useRenderDialogRoot-hhowqeoreyr6uuc7.js → useRenderDialogRoot-lddunc01twftravv.js} +123 -110
- package/dist/chunks/{useRenderElement-m8kc7jyuczp71mq8.js → useRenderElement-lrvp2pwrpt5zq1zd.js} +56 -46
- package/dist/chunks/{useScrollLock-mpns3u42eks8hhex.js → useScrollLock-buonkbwuland9wl3.js} +65 -38
- package/dist/chunks/{useStableCallback-ninxmksdjvwl6ejj.js → useStableCallback-b1i1ghzd9k75bb85.js} +3 -3
- package/dist/chunks/{useSwipeDismiss-bpbyw2ihsw3fw6y9.js → useSwipeDismiss-m1s13x9t9ey9ax3p.js} +73 -175
- package/dist/chunks/{useTimeout-oqptmu2xmyv5ccic.js → useTimeout-cpql3c8p250cr093.js} +3 -3
- package/dist/chunks/{useTransitionStatus-ig4waxl2kervpyw4.js → useTransitionStatus-bwqaavnekreihom2.js} +9 -5
- package/dist/chunks/{useTriggerFocusGuards-j8nano0pqu9dscrz.js → useTriggerFocusGuards-lz7wt484xltizro4.js} +4 -3
- package/dist/chunks/{useTypeahead-onenwjyhgw955ygx.js → useTypeahead-kvag4w6hu2g1kbwt.js} +10 -17
- package/dist/chunks/{useValueAsRef-lrn42zari17368c9.js → useValueAsRef-o4s9ohb3aczypmnk.js} +3 -3
- package/dist/chunks/{useValueChanged-kthmz4wk7ywnjwtx.js → useValueChanged-cz5wflhe8g15n6w1.js} +5 -8
- package/dist/chunks/{valueToPercent-henpkkj3juy3ukeu.js → valueToPercent-d7gbqk1umostj7ch.js} +1 -1
- package/dist/chunks/{vendor-floating-ui-dsysdmve7iazaaes.js → vendor-floating-ui-fqblx3wa0r71mjoo.js} +87 -187
- package/dist/chunks/{vendor-utils-luqsvbyuig727bnr.js → vendor-utils-ecfbsk425x1bm0gh.js} +119 -29
- package/dist/chunks/vesper-g839e590k3dxnwh3.js +5 -0
- package/dist/chunks/{visuallyHidden-n14xllazfozg55ox.js → visuallyHidden-nous086atnlxtf74.js} +1 -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 +18 -16
- 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.js +1 -1
- package/dist/components/clipboard-text.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.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/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.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 +1 -1
- 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/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.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-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-C0d8uwYO.d.ts} +4 -4
- package/dist/index-C7RoG_CH.d.ts +57 -0
- package/dist/{index-DBlw3E9m.d.ts → index-CNJRbVxG.d.ts} +1 -1
- package/dist/{index-BcRyiNd72.d.ts → index-ChGFA5-n.d.ts} +5 -1
- package/dist/index-CiwC1j1N.d.ts +37 -0
- package/dist/{index-BoPqM1Ia2.d.ts → index-Cqrye3KD.d.ts} +1 -1
- package/dist/{index-Bw3M24Mi.d.ts → index-CrQi3QCY.d.ts} +2 -1
- package/dist/{index-BlEUcijd.d.ts → index-CtTNoYA2.d.ts} +69 -1
- package/dist/{index-D97n4Bpf2.d.ts → index-DWZia2ui.d.ts} +1 -1
- package/dist/index-NqlNd7cQ.d.ts +144 -0
- package/dist/index-jNWPjJl9.d.ts +75 -0
- package/dist/index.d.ts +31 -26
- package/dist/index.js +49 -44
- package/dist/{input-group-DpGSsAZy.d.ts → input-group-B3M_WRqm.d.ts} +1 -1
- package/dist/locale-provider-BLGya10h.d.ts +28 -0
- package/dist/{portal-provider-4AHCxYE6.d.ts → portal-provider-BAqPpq_a.d.ts} +4 -0
- package/dist/primitives/accordion.js +1 -1
- package/dist/primitives/alert-dialog.js +1 -1
- package/dist/primitives/autocomplete.js +1 -1
- package/dist/primitives/avatar.js +1 -1
- package/dist/primitives/button.js +1 -1
- package/dist/primitives/checkbox-group.js +1 -1
- package/dist/primitives/checkbox.js +1 -1
- package/dist/primitives/collapsible.js +1 -1
- package/dist/primitives/combobox.js +1 -1
- package/dist/primitives/context-menu.js +1 -1
- package/dist/primitives/csp-provider.js +1 -1
- package/dist/primitives/dialog.js +1 -1
- package/dist/primitives/direction-provider.js +2 -2
- package/dist/primitives/drawer.js +1 -1
- package/dist/primitives/field.js +1 -1
- package/dist/primitives/fieldset.js +1 -1
- package/dist/primitives/form.js +1 -1
- package/dist/primitives/input.js +1 -1
- package/dist/primitives/menu.js +1 -1
- package/dist/primitives/menubar.js +1 -1
- package/dist/primitives/meter.js +1 -1
- package/dist/primitives/navigation-menu.js +1 -1
- package/dist/primitives/number-field.js +1 -1
- package/dist/primitives/otp-field.js +1 -1
- package/dist/primitives/popover.js +1 -1
- package/dist/primitives/preview-card.js +1 -1
- package/dist/primitives/progress.js +1 -1
- package/dist/primitives/radio-group.js +1 -1
- package/dist/primitives/radio.js +1 -1
- package/dist/primitives/scroll-area.js +1 -1
- package/dist/primitives/select.js +1 -1
- package/dist/primitives/separator.js +1 -1
- package/dist/primitives/slider.js +1 -1
- package/dist/primitives/switch.js +1 -1
- package/dist/primitives/tabs.js +1 -1
- package/dist/primitives/toast.js +1 -1
- package/dist/primitives/toggle-group.js +1 -1
- package/dist/primitives/toggle.js +1 -1
- package/dist/primitives/toolbar.js +1 -1
- package/dist/primitives/tooltip.js +1 -1
- package/dist/primitives.d.ts +1 -1
- package/dist/primitives.js +41 -41
- 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 +3 -2
- package/package.json +22 -5
- package/scripts/component-registry/discovery.ts +3 -0
- package/scripts/component-registry/metadata.ts +37 -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/FieldLabel-f6vwzm8nefzxwlh8.js +0 -558
- package/dist/chunks/Form-is7d5c1kbk1wn39s.js +0 -102
- 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/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-hve0zir3biaolih0.js +0 -128
- package/dist/chunks/index.parts-jv5kiaeixrjah9js.js +0 -119
- package/dist/chunks/index.parts-k7ezm98skegahepw.js +0 -2464
- package/dist/chunks/store-9b2cp7rx1dvq90fp.js +0 -88
- package/dist/chunks/useCompositeListItem-0exfww37ospqz69b.js +0 -75
- package/dist/chunks/useIsHydrating-b6whcsimonagru6u.js +0 -22
- package/dist/chunks/useLabelableId-b1kwq9st3rjrtakn.js +0 -60
- 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/{index-_Sl5wohy2.d.ts → index-_Sl5wohy.d.ts} +0 -0
- /package/dist/{index-bAud6rG22.d.ts → index-bAud6rG2.d.ts} +0 -0
package/dist/chunks/{SelectGroupLabel-m4h5hrft9043nsd1.js → SelectSeparator-mrjooj7vmjez6fua.js}
RENAMED
|
@@ -1,119 +1,133 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { a as EMPTY_ARRAY, d as useRefWithInit, o as EMPTY_OBJECT, r as mergeProps,
|
|
3
|
-
import {
|
|
4
|
-
import { n as useIsoLayoutEffect } from "./safeReact-
|
|
5
|
-
import { n as useTimeout } from "./useTimeout-
|
|
6
|
-
import { O as
|
|
7
|
-
import { n as webkit } from "./engine-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { t as
|
|
11
|
-
import { t as
|
|
12
|
-
import { t as
|
|
13
|
-
import {
|
|
14
|
-
import { n as
|
|
15
|
-
import { t as
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { t as
|
|
19
|
-
import {
|
|
20
|
-
import { t as
|
|
21
|
-
import { t as
|
|
22
|
-
import {
|
|
23
|
-
import { t as
|
|
24
|
-
import { t as
|
|
25
|
-
import { t as
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import { t as
|
|
29
|
-
import {
|
|
30
|
-
import { n as
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import { t as
|
|
35
|
-
import { t as
|
|
36
|
-
import { t as useValueChanged } from "./useValueChanged-
|
|
37
|
-
import { t as
|
|
38
|
-
import { t as clamp } from "./clamp-
|
|
39
|
-
import { a as
|
|
40
|
-
import { n as resolveAriaLabelledBy, t as getDefaultLabelId } from "./resolveAriaLabelledBy-
|
|
41
|
-
import { t as
|
|
42
|
-
import { t as CompositeList } from "./CompositeList-
|
|
43
|
-
import { t as useAnchoredPopupScrollLock } from "./useAnchoredPopupScrollLock-
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import { n as
|
|
2
|
+
import { a as EMPTY_ARRAY, d as useMergedRefs, f as useRefWithInit, o as EMPTY_OBJECT, r as mergeProps, s as NOOP, t as useRenderElement } from "./useRenderElement-lrvp2pwrpt5zq1zd.js";
|
|
3
|
+
import { i as FloatingPortal, r as ReactStore, u as DROPDOWN_COLLISION_AVOIDANCE } from "./popupTriggerMap-ehv0fuhnmy59j3pn.js";
|
|
4
|
+
import { n as useIsoLayoutEffect } from "./safeReact-hpp4cck3y2s5jg75.js";
|
|
5
|
+
import { n as useTimeout } from "./useTimeout-cpql3c8p250cr093.js";
|
|
6
|
+
import { A as pressableTriggerOpenStateMapping, O as popupStateMapping, Q as isVirtualClick, R as transitionStatusMapping, j as triggerOpenStateMapping, q as contains, v as ownerDocument, y as getFloatingFocusElement } from "./vendor-utils-ecfbsk425x1bm0gh.js";
|
|
7
|
+
import { n as webkit } from "./engine-g5egnkub1ikv3wvy.js";
|
|
8
|
+
import { c as platform, v as rectToClientRect, w as getWindow } from "./vendor-floating-ui-fqblx3wa0r71mjoo.js";
|
|
9
|
+
import { F as windowResize, t as cancelOpen, w as none, y as itemPress } from "./reason-parts-m5ishukzeux3q0pc.js";
|
|
10
|
+
import { t as createChangeEventDetails } from "./createBaseUIEventDetails-3ob3qgs95ffm8l0w.js";
|
|
11
|
+
import { t as addEventListener } from "./addEventListener-l40nxvf06iukgvnj.js";
|
|
12
|
+
import { t as useValueAsRef } from "./useValueAsRef-o4s9ohb3aczypmnk.js";
|
|
13
|
+
import { t as useStableCallback } from "./useStableCallback-b1i1ghzd9k75bb85.js";
|
|
14
|
+
import { n as useAnimationFrame } from "./useAnimationFrame-0tt315hl9n3jzl86.js";
|
|
15
|
+
import { n as visuallyHiddenInput, t as visuallyHidden } from "./visuallyHidden-nous086atnlxtf74.js";
|
|
16
|
+
import { t as useDismiss } from "./useDismiss-me91ertzzz3gly12.js";
|
|
17
|
+
import { a as FloatingFocusManager, n as InternalBackdrop, r as useOpenInteractionType } from "./useScrollLock-buonkbwuland9wl3.js";
|
|
18
|
+
import { t as useOpenChangeComplete } from "./useOpenChangeComplete-lk2gfu250t7r20c6.js";
|
|
19
|
+
import { t as useClick } from "./useClick-l0p0endoxrlp0ae5.js";
|
|
20
|
+
import { t as FOCUSABLE_POPUP_PROPS } from "./popupStoreUtils-i0y57dvmcnqrh4pv.js";
|
|
21
|
+
import { t as useTransitionStatus } from "./useTransitionStatus-bwqaavnekreihom2.js";
|
|
22
|
+
import { t as useFloatingRootContext } from "./useFloatingRootContext-c849wtis7gx013m8.js";
|
|
23
|
+
import { n as getDisabledMountTransitionStyles, r as useAnchorPositioning, t as usePositioner } from "./usePositioner-k9nc7cl550bgfwzs.js";
|
|
24
|
+
import { t as useListNavigation } from "./useListNavigation-3nyjs362qcau34in.js";
|
|
25
|
+
import { t as useTypeahead } from "./useTypeahead-kvag4w6hu2g1kbwt.js";
|
|
26
|
+
import { t as useBaseUiId } from "./useBaseUiId-lg1teubxudgin0w2.js";
|
|
27
|
+
import { n as useDirection } from "./DirectionContext-opvqcb794uxicri4.js";
|
|
28
|
+
import { t as inertValue } from "./inertValue-e0o6qvuef83v78fk.js";
|
|
29
|
+
import { t as usePreviousValue } from "./usePreviousValue-io5t1pdxehw21l85.js";
|
|
30
|
+
import { a as useFieldRootContext, c as fieldValidityMapping, n as useLabelableContext } from "./LabelableContext-ccxbhu73vrk089m1.js";
|
|
31
|
+
import { n as useFormContext } from "./FormContext-bsu99v8i8pwu1yxc.js";
|
|
32
|
+
import { t as useLabelableId } from "./useLabelableId-gqiiuqqn2k0u62r4.js";
|
|
33
|
+
import { n as useLabel } from "./useLabel-kcggu762z3z2taeb.js";
|
|
34
|
+
import { t as useControlled } from "./useControlled-lfns1ot6kwowa4t4.js";
|
|
35
|
+
import { t as useRegisterFieldControl } from "./useRegisterFieldControl-lvusf6vc963clx02.js";
|
|
36
|
+
import { t as useValueChanged } from "./useValueChanged-cz5wflhe8g15n6w1.js";
|
|
37
|
+
import { t as useButton } from "./useButton-h7s9aq1sfw6arawe.js";
|
|
38
|
+
import { t as clamp } from "./clamp-jcjhzx71s6wt1rnc.js";
|
|
39
|
+
import { a as resolveSelectedLabel, c as compareItemEquality, d as findSelectionIndex, f as isSelectedValueDirty, g as useOnFirstRender, i as resolveMultipleLabels, l as defaultItemEquality, m as resolveSelectedIndex, n as hasNullItemLabel, o as stringifyAsLabel, p as removeItem, s as stringifyAsValue, u as findItemIndex } from "./resolveValueLabel-hpmsash3ektitvnb.js";
|
|
40
|
+
import { n as resolveAriaLabelledBy, t as getDefaultLabelId } from "./resolveAriaLabelledBy-nc8mdie5shy87nsb.js";
|
|
41
|
+
import { t as isMouseWithinBounds } from "./getPseudoElementBounds-x7b9uqi5hdb1lq2r.js";
|
|
42
|
+
import { t as CompositeList } from "./CompositeList-lbr4enu6yzek7oa9.js";
|
|
43
|
+
import { t as useAnchoredPopupScrollLock } from "./useAnchoredPopupScrollLock-kp3kai20u91sdm7v.js";
|
|
44
|
+
import { t as useCompositeListItem } from "./useCompositeListItem-odg6yo4h8866b37o.js";
|
|
45
|
+
import { t as ListboxSeparator } from "./ListboxSeparator-nfyv54r2v5qtmosj.js";
|
|
46
|
+
import { n as useToolbarRootContext } from "./ToolbarRootContext-eqk40r8uh4h6r211.js";
|
|
47
|
+
import { t as isElementDisabled } from "./isElementDisabled-o0j7po84u0xjuwgg.js";
|
|
48
|
+
import { a as COMPOSITE_KEYS } from "./composite-ab8dmdfoj6tmhcn1.js";
|
|
49
|
+
import { n as getMaxScrollOffset, r as normalizeScrollOffset, t as styleDisableScrollbar } from "./styles-kl02oyrlnld7arja.js";
|
|
50
|
+
import { n as useCSPContext } from "./CSPContext-ctyrgg64girv38ls.js";
|
|
50
51
|
import * as React$1 from "react";
|
|
51
52
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
52
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
53
|
-
|
|
53
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.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
|
|
54
|
+
/**
|
|
55
|
+
* Root values consumed during render. Keep these outside `useSyncedValues` so descendant ref
|
|
56
|
+
* callbacks see the current props during the same commit.
|
|
57
|
+
*/
|
|
58
|
+
const SelectRootContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
54
59
|
SelectRootContext.displayName = "SelectRootContext";
|
|
55
|
-
const
|
|
60
|
+
const SelectRootPropsContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
61
|
+
SelectRootPropsContext.displayName = "SelectRootPropsContext";
|
|
62
|
+
const SelectFloatingContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
56
63
|
SelectFloatingContext.displayName = "SelectFloatingContext";
|
|
57
64
|
function useSelectRootContext() {
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
65
|
+
const store = React$1.useContext(SelectRootContext);
|
|
66
|
+
if (store === void 0) throw new Error("Base UI: SelectRootContext is missing. Select parts must be placed within <Select.Root>.");
|
|
67
|
+
return store;
|
|
68
|
+
}
|
|
69
|
+
function useSelectRootPropsContext() {
|
|
70
|
+
const context = React$1.useContext(SelectRootPropsContext);
|
|
71
|
+
if (context === void 0) throw new Error("Base UI: SelectRootPropsContext is missing. Select parts must be placed within <Select.Root>.");
|
|
60
72
|
return context;
|
|
61
73
|
}
|
|
62
74
|
function useSelectFloatingContext() {
|
|
63
75
|
const context = React$1.useContext(SelectFloatingContext);
|
|
64
|
-
if (context ===
|
|
76
|
+
if (context === void 0) throw new Error("Base UI: SelectFloatingContext is missing. Select parts must be placed within <Select.Root>.");
|
|
65
77
|
return context;
|
|
66
78
|
}
|
|
67
79
|
//#endregion
|
|
68
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
80
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.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
|
|
81
|
+
/**
|
|
82
|
+
* Non-reactive values shared with the select parts. Nothing here is observable through
|
|
83
|
+
* `selectors`, so writing to a ref never notifies subscribers.
|
|
84
|
+
*/
|
|
69
85
|
const selectors = {
|
|
70
|
-
id:
|
|
71
|
-
labelId:
|
|
72
|
-
modal:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
value: createSelector((state) => state.value),
|
|
79
|
-
hasSelectedValue: createSelector((state) => {
|
|
86
|
+
id: (state) => state.id,
|
|
87
|
+
labelId: (state) => state.labelId,
|
|
88
|
+
modal: (state) => state.modal,
|
|
89
|
+
items: (state) => state.items,
|
|
90
|
+
itemToStringLabel: (state) => state.itemToStringLabel,
|
|
91
|
+
isItemEqualToValue: (state) => state.isItemEqualToValue,
|
|
92
|
+
value: (state) => state.value,
|
|
93
|
+
hasSelectedValue: (state) => {
|
|
80
94
|
const { value, multiple, itemToStringValue } = state;
|
|
81
95
|
if (value == null) return false;
|
|
82
96
|
if (multiple && Array.isArray(value)) return value.length > 0;
|
|
83
97
|
return stringifyAsValue(value, itemToStringValue) !== "";
|
|
84
|
-
}
|
|
85
|
-
hasNullItemLabel:
|
|
98
|
+
},
|
|
99
|
+
hasNullItemLabel: (state, enabled) => {
|
|
86
100
|
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:
|
|
101
|
+
},
|
|
102
|
+
open: (state) => state.open,
|
|
103
|
+
mounted: (state) => state.mounted,
|
|
104
|
+
forceMount: (state) => state.forceMount,
|
|
105
|
+
transitionStatus: (state) => state.transitionStatus,
|
|
106
|
+
openMethod: (state) => state.openMethod,
|
|
107
|
+
activeIndex: (state) => state.activeIndex,
|
|
108
|
+
selectedIndex: (state) => state.selectedIndex,
|
|
109
|
+
isActive: (state, index) => state.activeIndex === index,
|
|
110
|
+
isSelected: (state, itemValue) => {
|
|
97
111
|
const comparer = state.isItemEqualToValue;
|
|
98
112
|
const storeValue = state.value;
|
|
99
113
|
if (state.multiple) return Array.isArray(storeValue) && storeValue.some((selectedItem) => compareItemEquality(itemValue, selectedItem, comparer));
|
|
100
114
|
return compareItemEquality(itemValue, storeValue, comparer);
|
|
101
|
-
}
|
|
102
|
-
isSelectedByFocus:
|
|
115
|
+
},
|
|
116
|
+
isSelectedByFocus: (state, index) => {
|
|
103
117
|
return state.selectedIndex === index;
|
|
104
|
-
}
|
|
105
|
-
popupProps:
|
|
106
|
-
triggerProps:
|
|
107
|
-
triggerElement:
|
|
108
|
-
positionerElement:
|
|
109
|
-
listElement:
|
|
110
|
-
popupSide:
|
|
111
|
-
scrollUpArrowVisible:
|
|
112
|
-
scrollDownArrowVisible:
|
|
113
|
-
hasScrollArrows:
|
|
118
|
+
},
|
|
119
|
+
popupProps: (state) => state.popupProps,
|
|
120
|
+
triggerProps: (state) => state.triggerProps,
|
|
121
|
+
triggerElement: (state) => state.triggerElement,
|
|
122
|
+
positionerElement: (state) => state.positionerElement,
|
|
123
|
+
listElement: (state) => state.listElement,
|
|
124
|
+
popupSide: (state) => state.popupSide,
|
|
125
|
+
scrollUpArrowVisible: (state) => state.scrollUpArrowVisible,
|
|
126
|
+
scrollDownArrowVisible: (state) => state.scrollDownArrowVisible,
|
|
127
|
+
hasScrollArrows: (state) => state.hasScrollArrows
|
|
114
128
|
};
|
|
115
129
|
//#endregion
|
|
116
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
130
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.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
131
|
/**
|
|
118
132
|
* Groups all parts of the select.
|
|
119
133
|
* Doesn't render its own HTML element.
|
|
@@ -155,9 +169,10 @@ function SelectRoot(props) {
|
|
|
155
169
|
dragY: 0
|
|
156
170
|
});
|
|
157
171
|
const alignItemWithTriggerActiveRef = React$1.useRef(false);
|
|
172
|
+
const initialValueRef = React$1.useRef(value);
|
|
158
173
|
const { mounted, setMounted, transitionStatus } = useTransitionStatus(open);
|
|
159
174
|
const { openMethod, triggerProps: interactionTypeProps } = useOpenInteractionType(open);
|
|
160
|
-
const store = useRefWithInit(() => new
|
|
175
|
+
const store = useRefWithInit(() => new ReactStore({
|
|
161
176
|
id: generatedId,
|
|
162
177
|
labelId: void 0,
|
|
163
178
|
modal,
|
|
@@ -174,8 +189,8 @@ function SelectRoot(props) {
|
|
|
174
189
|
openMethod: null,
|
|
175
190
|
activeIndex: null,
|
|
176
191
|
selectedIndex: null,
|
|
177
|
-
popupProps:
|
|
178
|
-
triggerProps:
|
|
192
|
+
popupProps: EMPTY_OBJECT,
|
|
193
|
+
triggerProps: EMPTY_OBJECT,
|
|
179
194
|
triggerElement: null,
|
|
180
195
|
positionerElement: null,
|
|
181
196
|
listElement: null,
|
|
@@ -183,13 +198,31 @@ function SelectRoot(props) {
|
|
|
183
198
|
scrollUpArrowVisible: false,
|
|
184
199
|
scrollDownArrowVisible: false,
|
|
185
200
|
hasScrollArrows: false
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
201
|
+
}, {
|
|
202
|
+
setValue: NOOP,
|
|
203
|
+
setOpen: NOOP,
|
|
204
|
+
handleScrollArrowVisibility: NOOP,
|
|
205
|
+
onOpenChangeComplete: NOOP,
|
|
206
|
+
listRef,
|
|
207
|
+
popupRef,
|
|
208
|
+
scrollHandlerRef,
|
|
209
|
+
scrollArrowsMountedCountRef,
|
|
210
|
+
valueRef,
|
|
211
|
+
valuesRef,
|
|
212
|
+
labelsRef,
|
|
213
|
+
typingRef,
|
|
214
|
+
selectionRef,
|
|
215
|
+
firstItemTextRef,
|
|
216
|
+
selectedItemTextRef,
|
|
217
|
+
alignItemWithTriggerActiveRef,
|
|
218
|
+
initialValueRef
|
|
219
|
+
}, selectors)).current;
|
|
220
|
+
const activeIndex = store.useState("activeIndex");
|
|
221
|
+
const selectedIndex = store.useState("selectedIndex");
|
|
222
|
+
const triggerElement = store.useState("triggerElement");
|
|
223
|
+
const positionerElement = store.useState("positionerElement");
|
|
191
224
|
const previousOpenMethod = usePreviousValue(openMethod);
|
|
192
|
-
const renderedOpenMethod = openMethod ?? previousOpenMethod
|
|
225
|
+
const renderedOpenMethod = openMethod ?? previousOpenMethod;
|
|
193
226
|
const serializedValue = React$1.useMemo(() => {
|
|
194
227
|
if (multiple) return "";
|
|
195
228
|
return stringifyAsValue(value, itemToStringValue);
|
|
@@ -206,51 +239,28 @@ function SelectRoot(props) {
|
|
|
206
239
|
value,
|
|
207
240
|
itemToStringValue
|
|
208
241
|
]);
|
|
209
|
-
|
|
210
|
-
const
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
if (value !== initialValueRef.current) store.set("forceMount", true);
|
|
214
|
-
}, [store, value]);
|
|
242
|
+
const controlRef = useValueAsRef(triggerElement);
|
|
243
|
+
const getStringifiedValueForForm = useStableCallback(() => fieldStringValue);
|
|
244
|
+
useRegisterFieldControl(controlRef, generatedId, value, getStringifiedValueForForm, !disabled, nameProp);
|
|
245
|
+
const hasSelectedValue = multiple ? Array.isArray(value) && value.length > 0 : value != null && serializedValue !== "";
|
|
215
246
|
useIsoLayoutEffect(() => {
|
|
216
247
|
setFilled(hasSelectedValue);
|
|
217
248
|
}, [hasSelectedValue, setFilled]);
|
|
218
249
|
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
|
-
}
|
|
250
|
+
const nextIndex = findSelectionIndex(valuesRef.current, value, isItemEqualToValue, multiple);
|
|
233
251
|
if (nextIndex === null) selectedItemTextRef.current = null;
|
|
234
252
|
if (open) return;
|
|
235
253
|
store.set("selectedIndex", nextIndex);
|
|
236
254
|
}, [
|
|
237
|
-
hasSelectedValue,
|
|
238
255
|
multiple,
|
|
239
256
|
open,
|
|
240
257
|
value,
|
|
241
|
-
valuesRef,
|
|
242
258
|
isItemEqualToValue,
|
|
243
|
-
store
|
|
244
|
-
selectedItemTextRef
|
|
259
|
+
store
|
|
245
260
|
]);
|
|
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
261
|
useValueChanged(value, () => {
|
|
252
262
|
clearErrors(name);
|
|
253
|
-
setDirty(isSelectedValueDirty(value));
|
|
263
|
+
setDirty(isSelectedValueDirty(value, validityData.initialValue, isItemEqualToValue));
|
|
254
264
|
validation.change(value);
|
|
255
265
|
});
|
|
256
266
|
const setOpen = useStableCallback((nextOpen, eventDetails) => {
|
|
@@ -267,7 +277,9 @@ function SelectRoot(props) {
|
|
|
267
277
|
setMounted(false);
|
|
268
278
|
store.update({
|
|
269
279
|
activeIndex: null,
|
|
270
|
-
openMethod: null
|
|
280
|
+
openMethod: null,
|
|
281
|
+
scrollUpArrowVisible: false,
|
|
282
|
+
scrollDownArrowVisible: false
|
|
271
283
|
});
|
|
272
284
|
onOpenChangeComplete?.(false);
|
|
273
285
|
});
|
|
@@ -285,15 +297,13 @@ function SelectRoot(props) {
|
|
|
285
297
|
if (eventDetails.isCanceled) return;
|
|
286
298
|
setValueUnwrapped(nextValue);
|
|
287
299
|
});
|
|
288
|
-
const handleScrollArrowVisibility = useStableCallback(() => {
|
|
289
|
-
const scroller = store.state.listElement || popupRef.current;
|
|
290
|
-
if (!scroller) return;
|
|
300
|
+
const handleScrollArrowVisibility = useStableCallback((scroller) => {
|
|
291
301
|
const maxScrollTop = getMaxScrollOffset(scroller.scrollHeight, scroller.clientHeight);
|
|
292
302
|
const scrollTop = normalizeScrollOffset(scroller.scrollTop, maxScrollTop);
|
|
293
303
|
const shouldShowUp = scrollTop > 0;
|
|
294
304
|
const shouldShowDown = scrollTop < maxScrollTop;
|
|
295
|
-
|
|
296
|
-
|
|
305
|
+
store.set("scrollUpArrowVisible", shouldShowUp);
|
|
306
|
+
store.set("scrollDownArrowVisible", shouldShowDown);
|
|
297
307
|
});
|
|
298
308
|
const floatingContext = useFloatingRootContext({
|
|
299
309
|
open,
|
|
@@ -304,12 +314,12 @@ function SelectRoot(props) {
|
|
|
304
314
|
}
|
|
305
315
|
});
|
|
306
316
|
const click = useClick(floatingContext, {
|
|
307
|
-
enabled: !
|
|
317
|
+
enabled: !disabled,
|
|
308
318
|
event: "mousedown"
|
|
309
319
|
});
|
|
310
320
|
const dismiss = useDismiss(floatingContext);
|
|
311
321
|
const listNavigation = useListNavigation(floatingContext, {
|
|
312
|
-
enabled: !
|
|
322
|
+
enabled: !disabled,
|
|
313
323
|
listRef,
|
|
314
324
|
activeIndex,
|
|
315
325
|
selectedIndex,
|
|
@@ -321,30 +331,25 @@ function SelectRoot(props) {
|
|
|
321
331
|
focusItemOnHover: highlightItemOnHover
|
|
322
332
|
});
|
|
323
333
|
const typeahead = useTypeahead(floatingContext, {
|
|
324
|
-
enabled: !
|
|
334
|
+
enabled: !disabled && (open || !readOnly && !multiple),
|
|
325
335
|
listRef: labelsRef,
|
|
326
336
|
activeIndex,
|
|
327
337
|
selectedIndex,
|
|
328
338
|
disabledIndices: (index) => isElementDisabled(listRef.current[index]),
|
|
329
339
|
onMatch(index) {
|
|
330
340
|
if (open) store.set("activeIndex", index);
|
|
331
|
-
else setValue(valuesRef.current[index], createChangeEventDetails(
|
|
341
|
+
else setValue(valuesRef.current[index], createChangeEventDetails(none));
|
|
332
342
|
},
|
|
333
343
|
onTyping(typing) {
|
|
334
344
|
typingRef.current = typing;
|
|
335
345
|
}
|
|
336
346
|
});
|
|
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
|
-
}, [
|
|
347
|
+
const mergedTriggerProps = React$1.useMemo(() => mergeProps(typeahead.reference, listNavigation.reference, dismiss.reference, click.reference, interactionTypeProps), [
|
|
342
348
|
click.reference,
|
|
343
349
|
typeahead.reference,
|
|
344
350
|
listNavigation.reference,
|
|
345
351
|
dismiss.reference,
|
|
346
|
-
interactionTypeProps
|
|
347
|
-
generatedId
|
|
352
|
+
interactionTypeProps
|
|
348
353
|
]);
|
|
349
354
|
const popupProps = React$1.useMemo(() => mergeProps(FOCUSABLE_POPUP_PROPS, typeahead.floating, listNavigation.floating, dismiss.floating), [
|
|
350
355
|
typeahead.floating,
|
|
@@ -352,32 +357,18 @@ function SelectRoot(props) {
|
|
|
352
357
|
dismiss.floating
|
|
353
358
|
]);
|
|
354
359
|
const itemProps = listNavigation.item ?? EMPTY_OBJECT;
|
|
360
|
+
store.useContextCallback("setValue", setValue);
|
|
361
|
+
store.useContextCallback("setOpen", setOpen);
|
|
362
|
+
store.useContextCallback("handleScrollArrowVisibility", handleScrollArrowVisibility);
|
|
363
|
+
store.useContextCallback("onOpenChangeComplete", onOpenChangeComplete);
|
|
355
364
|
useOnFirstRender(() => {
|
|
356
365
|
store.update({
|
|
357
366
|
popupProps,
|
|
358
367
|
triggerProps: mergedTriggerProps
|
|
359
368
|
});
|
|
360
369
|
});
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
id: generatedId,
|
|
364
|
-
modal,
|
|
365
|
-
multiple,
|
|
366
|
-
value,
|
|
367
|
-
open,
|
|
368
|
-
mounted,
|
|
369
|
-
transitionStatus,
|
|
370
|
-
popupProps,
|
|
371
|
-
triggerProps: mergedTriggerProps,
|
|
372
|
-
items,
|
|
373
|
-
itemToStringLabel,
|
|
374
|
-
itemToStringValue,
|
|
375
|
-
isItemEqualToValue,
|
|
376
|
-
openMethod: renderedOpenMethod
|
|
377
|
-
});
|
|
378
|
-
}, [
|
|
379
|
-
store,
|
|
380
|
-
generatedId,
|
|
370
|
+
store.useSyncedValues({
|
|
371
|
+
id: generatedId,
|
|
381
372
|
modal,
|
|
382
373
|
multiple,
|
|
383
374
|
value,
|
|
@@ -385,57 +376,29 @@ function SelectRoot(props) {
|
|
|
385
376
|
mounted,
|
|
386
377
|
transitionStatus,
|
|
387
378
|
popupProps,
|
|
388
|
-
mergedTriggerProps,
|
|
379
|
+
triggerProps: mergedTriggerProps,
|
|
389
380
|
items,
|
|
390
381
|
itemToStringLabel,
|
|
391
382
|
itemToStringValue,
|
|
392
383
|
isItemEqualToValue,
|
|
393
|
-
renderedOpenMethod
|
|
394
|
-
|
|
395
|
-
const
|
|
396
|
-
store,
|
|
397
|
-
name,
|
|
398
|
-
required,
|
|
384
|
+
openMethod: renderedOpenMethod
|
|
385
|
+
});
|
|
386
|
+
const rootPropsContextValue = React$1.useMemo(() => ({
|
|
399
387
|
disabled,
|
|
400
388
|
readOnly,
|
|
389
|
+
required,
|
|
401
390
|
multiple,
|
|
402
391
|
highlightItemOnHover,
|
|
403
|
-
|
|
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
|
|
392
|
+
itemProps
|
|
422
393
|
}), [
|
|
423
|
-
store,
|
|
424
|
-
name,
|
|
425
|
-
required,
|
|
426
394
|
disabled,
|
|
427
395
|
readOnly,
|
|
396
|
+
required,
|
|
428
397
|
multiple,
|
|
429
398
|
highlightItemOnHover,
|
|
430
|
-
|
|
431
|
-
setOpen,
|
|
432
|
-
itemProps,
|
|
433
|
-
validation,
|
|
434
|
-
onOpenChangeComplete,
|
|
435
|
-
handleScrollArrowVisibility
|
|
399
|
+
itemProps
|
|
436
400
|
]);
|
|
437
401
|
const ref = useMergedRefs(inputRef, validation.inputRef);
|
|
438
|
-
const hasMultipleSelection = multiple && Array.isArray(value) && value.length > 0;
|
|
439
402
|
const hiddenInputName = multiple ? void 0 : name;
|
|
440
403
|
const hiddenInputs = React$1.useMemo(() => {
|
|
441
404
|
if (!multiple || !Array.isArray(value) || !name) return null;
|
|
@@ -457,57 +420,60 @@ function SelectRoot(props) {
|
|
|
457
420
|
itemToStringValue,
|
|
458
421
|
disabled
|
|
459
422
|
]);
|
|
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
|
-
|
|
487
|
-
|
|
423
|
+
return /*#__PURE__*/ jsxs(SelectRootContext.Provider, {
|
|
424
|
+
value: store,
|
|
425
|
+
children: [
|
|
426
|
+
/*#__PURE__*/ jsx(SelectRootPropsContext.Provider, {
|
|
427
|
+
value: rootPropsContextValue,
|
|
428
|
+
children: /*#__PURE__*/ jsx(SelectFloatingContext.Provider, {
|
|
429
|
+
value: floatingContext,
|
|
430
|
+
children
|
|
431
|
+
})
|
|
432
|
+
}),
|
|
433
|
+
/*#__PURE__*/ jsx("input", {
|
|
434
|
+
...validation.getValidationProps(disabled, {
|
|
435
|
+
onFocus() {
|
|
436
|
+
store.state.triggerElement?.focus({ focusVisible: true });
|
|
437
|
+
},
|
|
438
|
+
onChange(event) {
|
|
439
|
+
if (event.nativeEvent.defaultPrevented || disabled || readOnly) return;
|
|
440
|
+
const nextValue = event.currentTarget.value;
|
|
441
|
+
const details = createChangeEventDetails(none, event.nativeEvent);
|
|
442
|
+
function handleChange() {
|
|
443
|
+
if (multiple) return;
|
|
444
|
+
const nextValueLower = nextValue.toLowerCase();
|
|
445
|
+
let matchingIndex = valuesRef.current.findIndex((candidate) => stringifyAsValue(candidate, itemToStringValue).toLowerCase() === nextValueLower || stringifyAsLabel(candidate, itemToStringLabel).toLowerCase() === nextValueLower);
|
|
446
|
+
if (matchingIndex === -1) matchingIndex = valuesRef.current.findIndex((_, index) => {
|
|
447
|
+
const renderedLabel = labelsRef.current[index];
|
|
448
|
+
return renderedLabel != null && renderedLabel.toLowerCase() === nextValueLower;
|
|
449
|
+
});
|
|
450
|
+
const matchingValue = valuesRef.current[matchingIndex];
|
|
451
|
+
if (matchingValue != null) setValue(matchingValue, details);
|
|
488
452
|
}
|
|
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
|
|
453
|
+
store.set("forceMount", true);
|
|
454
|
+
queueMicrotask(handleChange);
|
|
455
|
+
}
|
|
503
456
|
}),
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
457
|
+
id: generatedId && hiddenInputName == null ? `${generatedId}-hidden-input` : void 0,
|
|
458
|
+
form,
|
|
459
|
+
name: hiddenInputName,
|
|
460
|
+
autoComplete,
|
|
461
|
+
value: serializedValue,
|
|
462
|
+
disabled,
|
|
463
|
+
required: required && !(multiple && hasSelectedValue),
|
|
464
|
+
readOnly,
|
|
465
|
+
ref,
|
|
466
|
+
style: name ? visuallyHiddenInput : visuallyHidden,
|
|
467
|
+
tabIndex: -1,
|
|
468
|
+
"aria-hidden": true,
|
|
469
|
+
suppressHydrationWarning: true
|
|
470
|
+
}),
|
|
471
|
+
hiddenInputs
|
|
472
|
+
]
|
|
507
473
|
});
|
|
508
474
|
}
|
|
509
475
|
//#endregion
|
|
510
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
476
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.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
477
|
/**
|
|
512
478
|
* An accessible label that is automatically associated with the select trigger.
|
|
513
479
|
* Renders a `<div>` element.
|
|
@@ -519,14 +485,16 @@ const SelectLabel = /*#__PURE__*/ React$1.forwardRef(function SelectLabel(compon
|
|
|
519
485
|
const elementPropsWithoutId = elementProps;
|
|
520
486
|
delete elementPropsWithoutId.id;
|
|
521
487
|
const fieldRootContext = useFieldRootContext();
|
|
522
|
-
const
|
|
523
|
-
const triggerElement =
|
|
524
|
-
const rootId =
|
|
488
|
+
const store = useSelectRootContext();
|
|
489
|
+
const triggerElement = store.useState("triggerElement");
|
|
490
|
+
const rootId = store.useState("id");
|
|
491
|
+
const defaultLabelId = getDefaultLabelId(rootId);
|
|
525
492
|
const labelProps = useLabel({
|
|
526
|
-
id:
|
|
493
|
+
id: defaultLabelId,
|
|
527
494
|
fallbackControlId: triggerElement?.id ?? rootId,
|
|
528
495
|
setLabelId(nextLabelId) {
|
|
529
|
-
store.
|
|
496
|
+
const resolvedLabelId = typeof nextLabelId === "function" ? nextLabelId(store.state.labelId) : nextLabelId;
|
|
497
|
+
store.set("labelId", resolvedLabelId);
|
|
530
498
|
}
|
|
531
499
|
});
|
|
532
500
|
return useRenderElement("div", componentProps, {
|
|
@@ -537,14 +505,18 @@ const SelectLabel = /*#__PURE__*/ React$1.forwardRef(function SelectLabel(compon
|
|
|
537
505
|
});
|
|
538
506
|
});
|
|
539
507
|
SelectLabel.displayName = "SelectLabel";
|
|
508
|
+
/**
|
|
509
|
+
* Indicates which side the corresponding popup is positioned relative to its anchor.
|
|
510
|
+
* @type {'top' | 'bottom' | 'left' | 'right' | 'inline-end' | 'inline-start' | null}
|
|
511
|
+
*/
|
|
512
|
+
const popupSide = "data-popup-side";
|
|
540
513
|
//#endregion
|
|
541
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
542
|
-
const BOUNDARY_OFFSET = 2;
|
|
514
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.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
515
|
const SELECTED_DELAY = 400;
|
|
544
516
|
const stateAttributesMapping$2 = {
|
|
545
517
|
...pressableTriggerOpenStateMapping,
|
|
546
518
|
...fieldValidityMapping,
|
|
547
|
-
popupSide: (side) => side ? {
|
|
519
|
+
popupSide: (side) => side ? { [popupSide]: side } : null,
|
|
548
520
|
value: () => null
|
|
549
521
|
};
|
|
550
522
|
/**
|
|
@@ -555,47 +527,46 @@ const stateAttributesMapping$2 = {
|
|
|
555
527
|
*/
|
|
556
528
|
const SelectTrigger = /*#__PURE__*/ React$1.forwardRef(function SelectTrigger(componentProps, forwardedRef) {
|
|
557
529
|
const { render, className, id: idProp, disabled: disabledProp = false, nativeButton = true, style, ...elementProps } = componentProps;
|
|
558
|
-
const { setTouched, setFocused, validationMode, state: fieldState, disabled: fieldDisabled } = useFieldRootContext();
|
|
530
|
+
const { setTouched, setFocused, validationMode, validation, state: fieldState, disabled: fieldDisabled } = useFieldRootContext();
|
|
559
531
|
const { labelId: fieldLabelId } = useLabelableContext();
|
|
560
|
-
const
|
|
532
|
+
const store = useSelectRootContext();
|
|
533
|
+
const { readOnly, required, disabled: selectDisabled } = useSelectRootPropsContext();
|
|
561
534
|
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 =
|
|
535
|
+
const open = store.useState("open");
|
|
536
|
+
const mounted = store.useState("mounted");
|
|
537
|
+
const value = store.useState("value");
|
|
538
|
+
const triggerProps = store.useState("triggerProps");
|
|
539
|
+
const positionerElement = store.useState("positionerElement");
|
|
540
|
+
const listElement = store.useState("listElement");
|
|
541
|
+
const popupSideValue = store.useState("popupSide");
|
|
542
|
+
const rootId = store.useState("id");
|
|
543
|
+
const selectLabelId = store.useState("labelId");
|
|
544
|
+
const hasSelectedValue = store.useState("hasSelectedValue");
|
|
572
545
|
const popupSide = mounted && positionerElement ? popupSideValue : null;
|
|
573
546
|
const id = idProp ?? rootId;
|
|
574
547
|
const ariaLabelledBy = resolveAriaLabelledBy(fieldLabelId, selectLabelId);
|
|
575
|
-
useLabelableId({ id });
|
|
548
|
+
useLabelableId({ id: idProp });
|
|
576
549
|
const positionerRef = useValueAsRef(positionerElement);
|
|
577
550
|
const triggerRef = React$1.useRef(null);
|
|
578
551
|
const { getButtonProps, buttonRef } = useButton({
|
|
579
552
|
disabled,
|
|
580
553
|
native: nativeButton
|
|
581
554
|
});
|
|
582
|
-
const setTriggerElement =
|
|
583
|
-
store.set("triggerElement", element);
|
|
584
|
-
});
|
|
555
|
+
const setTriggerElement = store.useStateSetter("triggerElement");
|
|
585
556
|
const timeoutFocus = useTimeout();
|
|
586
557
|
const timeoutMouseDown = useTimeout();
|
|
587
558
|
const selectedDelayTimeout = useTimeout();
|
|
588
559
|
React$1.useEffect(() => {
|
|
589
560
|
if (open) {
|
|
590
561
|
selectedDelayTimeout.start(SELECTED_DELAY, () => {
|
|
591
|
-
selectionRef.current.allowUnselectedMouseUp = true;
|
|
592
|
-
selectionRef.current.allowSelectedMouseUp = true;
|
|
562
|
+
store.context.selectionRef.current.allowUnselectedMouseUp = true;
|
|
563
|
+
store.context.selectionRef.current.allowSelectedMouseUp = true;
|
|
593
564
|
});
|
|
594
565
|
return () => {
|
|
595
566
|
selectedDelayTimeout.clear();
|
|
596
567
|
};
|
|
597
568
|
}
|
|
598
|
-
selectionRef.current = {
|
|
569
|
+
store.context.selectionRef.current = {
|
|
599
570
|
allowSelectedMouseUp: false,
|
|
600
571
|
allowUnselectedMouseUp: false,
|
|
601
572
|
dragY: 0
|
|
@@ -603,14 +574,14 @@ const SelectTrigger = /*#__PURE__*/ React$1.forwardRef(function SelectTrigger(co
|
|
|
603
574
|
timeoutMouseDown.clear();
|
|
604
575
|
}, [
|
|
605
576
|
open,
|
|
606
|
-
|
|
577
|
+
store,
|
|
607
578
|
timeoutMouseDown,
|
|
608
579
|
selectedDelayTimeout
|
|
609
580
|
]);
|
|
610
581
|
const mergedProps = mergeProps(triggerProps, {
|
|
611
582
|
id,
|
|
612
583
|
role: "combobox",
|
|
613
|
-
"aria-expanded": open
|
|
584
|
+
"aria-expanded": open,
|
|
614
585
|
"aria-haspopup": "listbox",
|
|
615
586
|
"aria-controls": open ? listElement?.id ?? getFloatingFocusElement(positionerElement)?.id : void 0,
|
|
616
587
|
"aria-labelledby": ariaLabelledBy,
|
|
@@ -619,7 +590,7 @@ const SelectTrigger = /*#__PURE__*/ React$1.forwardRef(function SelectTrigger(co
|
|
|
619
590
|
tabIndex: disabled ? -1 : 0,
|
|
620
591
|
onFocus(event) {
|
|
621
592
|
setFocused(true);
|
|
622
|
-
if (open && alignItemWithTriggerActiveRef.current) setOpen(false, createChangeEventDetails(none, event.nativeEvent));
|
|
593
|
+
if (open && store.context.alignItemWithTriggerActiveRef.current) store.context.setOpen(false, createChangeEventDetails(none, event.nativeEvent));
|
|
623
594
|
timeoutFocus.start(0, () => {
|
|
624
595
|
store.set("forceMount", true);
|
|
625
596
|
});
|
|
@@ -637,9 +608,8 @@ const SelectTrigger = /*#__PURE__*/ React$1.forwardRef(function SelectTrigger(co
|
|
|
637
608
|
if (!triggerRef.current) return;
|
|
638
609
|
const mouseUpTarget = mouseEvent.target;
|
|
639
610
|
if (contains(triggerRef.current, mouseUpTarget) || contains(positionerRef.current, mouseUpTarget)) return;
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
setOpen(false, createChangeEventDetails(cancelOpen, mouseEvent));
|
|
611
|
+
if (isMouseWithinBounds(mouseEvent, triggerRef.current)) return;
|
|
612
|
+
store.context.setOpen(false, createChangeEventDetails(cancelOpen, mouseEvent));
|
|
643
613
|
}
|
|
644
614
|
timeoutMouseDown.start(0, () => {
|
|
645
615
|
doc.addEventListener("mouseup", handleMouseUp, { once: true });
|
|
@@ -671,7 +641,7 @@ const SelectTrigger = /*#__PURE__*/ React$1.forwardRef(function SelectTrigger(co
|
|
|
671
641
|
});
|
|
672
642
|
SelectTrigger.displayName = "SelectTrigger";
|
|
673
643
|
//#endregion
|
|
674
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
644
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.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
645
|
const stateAttributesMapping$1 = { value: () => null };
|
|
676
646
|
/**
|
|
677
647
|
* A text label of the currently selected item.
|
|
@@ -681,13 +651,13 @@ const stateAttributesMapping$1 = { value: () => null };
|
|
|
681
651
|
*/
|
|
682
652
|
const SelectValue = /*#__PURE__*/ React$1.forwardRef(function SelectValue(componentProps, forwardedRef) {
|
|
683
653
|
const { className, render, children: childrenProp, placeholder, style, ...elementProps } = componentProps;
|
|
684
|
-
const
|
|
685
|
-
const value =
|
|
686
|
-
const items =
|
|
687
|
-
const itemToStringLabel =
|
|
688
|
-
const hasSelectedValue =
|
|
654
|
+
const store = useSelectRootContext();
|
|
655
|
+
const value = store.useState("value");
|
|
656
|
+
const items = store.useState("items");
|
|
657
|
+
const itemToStringLabel = store.useState("itemToStringLabel");
|
|
658
|
+
const hasSelectedValue = store.useState("hasSelectedValue");
|
|
689
659
|
const shouldCheckNullItemLabel = !hasSelectedValue && placeholder != null && childrenProp == null;
|
|
690
|
-
const hasNullLabel =
|
|
660
|
+
const hasNullLabel = store.useState("hasNullItemLabel", shouldCheckNullItemLabel);
|
|
691
661
|
const state = {
|
|
692
662
|
value,
|
|
693
663
|
placeholder: !hasSelectedValue
|
|
@@ -695,19 +665,19 @@ const SelectValue = /*#__PURE__*/ React$1.forwardRef(function SelectValue(compon
|
|
|
695
665
|
let children = null;
|
|
696
666
|
if (typeof childrenProp === "function") children = childrenProp(value);
|
|
697
667
|
else if (childrenProp != null) children = childrenProp;
|
|
698
|
-
else if (
|
|
668
|
+
else if (shouldCheckNullItemLabel && !hasNullLabel) children = placeholder;
|
|
699
669
|
else if (Array.isArray(value)) children = resolveMultipleLabels(value, items, itemToStringLabel);
|
|
700
670
|
else children = resolveSelectedLabel(value, items, itemToStringLabel);
|
|
701
671
|
return useRenderElement("span", componentProps, {
|
|
702
672
|
state,
|
|
703
|
-
ref: [forwardedRef, valueRef],
|
|
673
|
+
ref: [forwardedRef, store.context.valueRef],
|
|
704
674
|
props: [{ children }, elementProps],
|
|
705
675
|
stateAttributesMapping: stateAttributesMapping$1
|
|
706
676
|
});
|
|
707
677
|
});
|
|
708
678
|
SelectValue.displayName = "SelectValue";
|
|
709
679
|
//#endregion
|
|
710
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
680
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.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
681
|
/**
|
|
712
682
|
* An icon that indicates that the trigger button opens a select popup.
|
|
713
683
|
* Renders a `<span>` element.
|
|
@@ -716,9 +686,9 @@ SelectValue.displayName = "SelectValue";
|
|
|
716
686
|
*/
|
|
717
687
|
const SelectIcon = /*#__PURE__*/ React$1.forwardRef(function SelectIcon(componentProps, forwardedRef) {
|
|
718
688
|
const { render, className, style, ...elementProps } = componentProps;
|
|
719
|
-
const
|
|
689
|
+
const state = { open: useSelectRootContext().useState("open") };
|
|
720
690
|
return useRenderElement("span", componentProps, {
|
|
721
|
-
state
|
|
691
|
+
state,
|
|
722
692
|
ref: forwardedRef,
|
|
723
693
|
props: [{
|
|
724
694
|
"aria-hidden": true,
|
|
@@ -729,11 +699,7 @@ const SelectIcon = /*#__PURE__*/ React$1.forwardRef(function SelectIcon(componen
|
|
|
729
699
|
});
|
|
730
700
|
SelectIcon.displayName = "SelectIcon";
|
|
731
701
|
//#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
|
|
702
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.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
703
|
/**
|
|
738
704
|
* A portal element that moves the popup to a different part of the DOM.
|
|
739
705
|
* By default, the portal element is appended to `<body>`.
|
|
@@ -742,21 +708,18 @@ SelectPortalContext.displayName = "SelectPortalContext";
|
|
|
742
708
|
* Documentation: [Base UI Select](https://base-ui.com/react/components/select)
|
|
743
709
|
*/
|
|
744
710
|
const SelectPortal = /*#__PURE__*/ React$1.forwardRef(function SelectPortal(portalProps, forwardedRef) {
|
|
745
|
-
const
|
|
746
|
-
const mounted =
|
|
747
|
-
const forceMount =
|
|
711
|
+
const store = useSelectRootContext();
|
|
712
|
+
const mounted = store.useState("mounted");
|
|
713
|
+
const forceMount = store.useState("forceMount");
|
|
748
714
|
if (!(mounted || forceMount)) return null;
|
|
749
|
-
return /*#__PURE__*/ jsx(
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
ref: forwardedRef,
|
|
753
|
-
...portalProps
|
|
754
|
-
})
|
|
715
|
+
return /*#__PURE__*/ jsx(FloatingPortal, {
|
|
716
|
+
ref: forwardedRef,
|
|
717
|
+
...portalProps
|
|
755
718
|
});
|
|
756
719
|
});
|
|
757
720
|
SelectPortal.displayName = "SelectPortal";
|
|
758
721
|
//#endregion
|
|
759
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
722
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.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
723
|
const SelectPositionerContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
761
724
|
SelectPositionerContext.displayName = "SelectPositionerContext";
|
|
762
725
|
function useSelectPositionerContext() {
|
|
@@ -765,7 +728,7 @@ function useSelectPositionerContext() {
|
|
|
765
728
|
return context;
|
|
766
729
|
}
|
|
767
730
|
//#endregion
|
|
768
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
731
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.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
732
|
function clearStyles(element, originalStyles) {
|
|
770
733
|
if (element) Object.assign(element.style, originalStyles);
|
|
771
734
|
}
|
|
@@ -776,7 +739,7 @@ const LIST_FUNCTIONAL_STYLES = {
|
|
|
776
739
|
overflowY: "auto"
|
|
777
740
|
};
|
|
778
741
|
//#endregion
|
|
779
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
742
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.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
743
|
const FIXED = { position: "fixed" };
|
|
781
744
|
/**
|
|
782
745
|
* Positions the select popup.
|
|
@@ -785,30 +748,24 @@ const FIXED = { position: "fixed" };
|
|
|
785
748
|
* Documentation: [Base UI Select](https://base-ui.com/react/components/select)
|
|
786
749
|
*/
|
|
787
750
|
const SelectPositioner = /*#__PURE__*/ React$1.forwardRef(function SelectPositioner(componentProps, forwardedRef) {
|
|
788
|
-
const { anchor,
|
|
789
|
-
const
|
|
751
|
+
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;
|
|
752
|
+
const store = useSelectRootContext();
|
|
790
753
|
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 =
|
|
754
|
+
const open = store.useState("open");
|
|
755
|
+
const mounted = store.useState("mounted");
|
|
756
|
+
const modal = store.useState("modal");
|
|
757
|
+
const value = store.useState("value");
|
|
758
|
+
const openMethod = store.useState("openMethod");
|
|
759
|
+
const positionerElement = store.useState("positionerElement");
|
|
760
|
+
const triggerElement = store.useState("triggerElement");
|
|
761
|
+
const isItemEqualToValue = store.useState("isItemEqualToValue");
|
|
762
|
+
const transitionStatus = store.useState("transitionStatus");
|
|
800
763
|
const scrollUpArrowRef = React$1.useRef(null);
|
|
801
764
|
const scrollDownArrowRef = React$1.useRef(null);
|
|
802
765
|
const [controlledAlignItemWithTrigger, setControlledAlignItemWithTrigger] = React$1.useState(alignItemWithTrigger);
|
|
803
766
|
const alignItemWithTriggerActive = mounted && controlledAlignItemWithTrigger && openMethod !== "touch";
|
|
804
767
|
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);
|
|
768
|
+
React$1.useImperativeHandle(store.context.alignItemWithTriggerActiveRef, () => alignItemWithTriggerActive);
|
|
812
769
|
useAnchoredPopupScrollLock((alignItemWithTriggerActive || modal) && open, openMethod === "touch", positionerElement, triggerElement);
|
|
813
770
|
const positioning = useAnchorPositioning({
|
|
814
771
|
anchor,
|
|
@@ -838,43 +795,39 @@ const SelectPositioner = /*#__PURE__*/ React$1.forwardRef(function SelectPositio
|
|
|
838
795
|
useIsoLayoutEffect(() => {
|
|
839
796
|
store.set("popupSide", positioning.side);
|
|
840
797
|
}, [store, positioning.side]);
|
|
798
|
+
const setPositionerElement = store.useStateSetter("positionerElement");
|
|
841
799
|
const element = usePositioner(componentProps, state, {
|
|
842
800
|
styles: positionerStyles,
|
|
843
801
|
transitionStatus,
|
|
844
802
|
props: elementProps,
|
|
845
|
-
refs: [forwardedRef,
|
|
846
|
-
store.set("positionerElement", element);
|
|
847
|
-
})],
|
|
803
|
+
refs: [forwardedRef, setPositionerElement],
|
|
848
804
|
hidden: !mounted,
|
|
849
805
|
inert: !open
|
|
850
806
|
});
|
|
851
807
|
const prevMapSizeRef = React$1.useRef(0);
|
|
852
808
|
const onMapChange = useStableCallback((map) => {
|
|
853
|
-
if (
|
|
854
|
-
if (valuesRef.current.length === 0) return;
|
|
809
|
+
if (store.context.valuesRef.current.length === 0) return;
|
|
855
810
|
const prevSize = prevMapSizeRef.current;
|
|
856
811
|
prevMapSizeRef.current = map.size;
|
|
857
|
-
if (map.size === prevSize) return;
|
|
858
812
|
const eventDetails = createChangeEventDetails(none);
|
|
859
813
|
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);
|
|
814
|
+
if (findItemIndex(store.context.valuesRef.current, value, isItemEqualToValue) === -1) {
|
|
815
|
+
const initialSelectedValue = store.context.initialValueRef.current;
|
|
816
|
+
const nextValue = initialSelectedValue != null && findItemIndex(store.context.valuesRef.current, initialSelectedValue, isItemEqualToValue) !== -1 ? initialSelectedValue : null;
|
|
817
|
+
store.context.setValue(nextValue, eventDetails);
|
|
864
818
|
if (nextValue === null) {
|
|
865
819
|
store.set("selectedIndex", null);
|
|
866
|
-
selectedItemTextRef.current = null;
|
|
820
|
+
store.context.selectedItemTextRef.current = null;
|
|
867
821
|
}
|
|
868
822
|
}
|
|
869
823
|
}
|
|
870
824
|
if (prevSize !== 0 && store.state.multiple && Array.isArray(value)) {
|
|
871
|
-
const
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
setValue(nextValue, eventDetails);
|
|
825
|
+
const nextValue = value.filter((selectedItemValue) => findItemIndex(store.context.valuesRef.current, selectedItemValue, isItemEqualToValue) !== -1);
|
|
826
|
+
if (nextValue.length !== value.length) {
|
|
827
|
+
store.context.setValue(nextValue, eventDetails);
|
|
875
828
|
if (nextValue.length === 0) {
|
|
876
829
|
store.set("selectedIndex", null);
|
|
877
|
-
selectedItemTextRef.current = null;
|
|
830
|
+
store.context.selectedItemTextRef.current = null;
|
|
878
831
|
}
|
|
879
832
|
}
|
|
880
833
|
}
|
|
@@ -885,7 +838,7 @@ const SelectPositioner = /*#__PURE__*/ React$1.forwardRef(function SelectPositio
|
|
|
885
838
|
});
|
|
886
839
|
const stylesToClear = { height: "" };
|
|
887
840
|
clearStyles(positionerElement, stylesToClear);
|
|
888
|
-
clearStyles(popupRef.current, stylesToClear);
|
|
841
|
+
clearStyles(store.context.popupRef.current, stylesToClear);
|
|
889
842
|
}
|
|
890
843
|
});
|
|
891
844
|
const contextValue = React$1.useMemo(() => ({
|
|
@@ -902,8 +855,8 @@ const SelectPositioner = /*#__PURE__*/ React$1.forwardRef(function SelectPositio
|
|
|
902
855
|
setControlledAlignItemWithTrigger
|
|
903
856
|
]);
|
|
904
857
|
return /*#__PURE__*/ jsx(CompositeList, {
|
|
905
|
-
elementsRef: listRef,
|
|
906
|
-
labelsRef,
|
|
858
|
+
elementsRef: store.context.listRef,
|
|
859
|
+
labelsRef: store.context.labelsRef,
|
|
907
860
|
onMapChange,
|
|
908
861
|
children: /*#__PURE__*/ jsxs(SelectPositionerContext.Provider, {
|
|
909
862
|
value: contextValue,
|
|
@@ -916,7 +869,14 @@ const SelectPositioner = /*#__PURE__*/ React$1.forwardRef(function SelectPositio
|
|
|
916
869
|
});
|
|
917
870
|
SelectPositioner.displayName = "SelectPositioner";
|
|
918
871
|
//#endregion
|
|
919
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
872
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.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
|
|
873
|
+
/**
|
|
874
|
+
* The coordinates that this element is anchored to. Used for animations and transitions.
|
|
875
|
+
* @type {string}
|
|
876
|
+
*/
|
|
877
|
+
const transformOrigin = "--transform-origin";
|
|
878
|
+
//#endregion
|
|
879
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.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
880
|
const stateAttributesMapping = {
|
|
921
881
|
...popupStateMapping,
|
|
922
882
|
...transitionStatusMapping
|
|
@@ -929,35 +889,32 @@ const stateAttributesMapping = {
|
|
|
929
889
|
*/
|
|
930
890
|
const SelectPopup = /*#__PURE__*/ React$1.forwardRef(function SelectPopup(componentProps, forwardedRef) {
|
|
931
891
|
const { render, className, style, finalFocus, ...elementProps } = componentProps;
|
|
932
|
-
const
|
|
892
|
+
const store = useSelectRootContext();
|
|
893
|
+
const { multiple, readOnly, highlightItemOnHover } = useSelectRootPropsContext();
|
|
894
|
+
const floatingRootContext = useSelectFloatingContext();
|
|
933
895
|
const { side, align, alignItemWithTriggerActive, isPositioned, setControlledAlignItemWithTrigger } = useSelectPositionerContext();
|
|
934
896
|
const insideToolbar = useToolbarRootContext(true) != null;
|
|
935
|
-
const floatingRootContext = useSelectFloatingContext();
|
|
936
897
|
const direction = useDirection();
|
|
937
898
|
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 =
|
|
899
|
+
const id = store.useState("id");
|
|
900
|
+
const open = store.useState("open");
|
|
901
|
+
const openMethod = store.useState("openMethod");
|
|
902
|
+
const mounted = store.useState("mounted");
|
|
903
|
+
const popupProps = store.useState("popupProps");
|
|
904
|
+
const transitionStatus = store.useState("transitionStatus");
|
|
905
|
+
const triggerElement = store.useState("triggerElement");
|
|
906
|
+
const positionerElement = store.useState("positionerElement");
|
|
907
|
+
const listElement = store.useState("listElement");
|
|
947
908
|
const reachedMaxHeightRef = React$1.useRef(false);
|
|
948
909
|
const initialPlacedRef = React$1.useRef(false);
|
|
949
910
|
const originalPositionerStylesRef = React$1.useRef({});
|
|
950
911
|
const scrollArrowFrame = useAnimationFrame();
|
|
951
912
|
const handleScroll = useStableCallback((scroller) => {
|
|
952
|
-
if (!positionerElement || !popupRef.current || !initialPlacedRef.current) return;
|
|
953
|
-
if (reachedMaxHeightRef.current || !alignItemWithTriggerActive) {
|
|
954
|
-
handleScrollArrowVisibility();
|
|
955
|
-
return;
|
|
956
|
-
}
|
|
913
|
+
if (!positionerElement || !store.context.popupRef.current || !initialPlacedRef.current) return;
|
|
957
914
|
const isTopPositioned = positionerElement.style.top === "0px";
|
|
958
915
|
const isBottomPositioned = positionerElement.style.bottom === "0px";
|
|
959
|
-
if (!isTopPositioned && !isBottomPositioned) {
|
|
960
|
-
handleScrollArrowVisibility();
|
|
916
|
+
if (reachedMaxHeightRef.current || !alignItemWithTriggerActive || !isTopPositioned && !isBottomPositioned) {
|
|
917
|
+
store.context.handleScrollArrowVisibility(scroller);
|
|
961
918
|
return;
|
|
962
919
|
}
|
|
963
920
|
const scale = getScale(positionerElement);
|
|
@@ -967,53 +924,41 @@ const SelectPopup = /*#__PURE__*/ React$1.forwardRef(function SelectPopup(compon
|
|
|
967
924
|
const positionerStyles = win.getComputedStyle(positionerElement);
|
|
968
925
|
const marginTop = parseFloat(positionerStyles.marginTop);
|
|
969
926
|
const marginBottom = parseFloat(positionerStyles.marginBottom);
|
|
970
|
-
const maxPopupHeight = getMaxPopupHeight(win.getComputedStyle(popupRef.current));
|
|
927
|
+
const maxPopupHeight = getMaxPopupHeight(win.getComputedStyle(store.context.popupRef.current));
|
|
971
928
|
const maxAvailableHeight = Math.min(doc.documentElement.clientHeight - marginTop - marginBottom, maxPopupHeight);
|
|
972
929
|
const scrollTop = scroller.scrollTop;
|
|
973
930
|
const maxScrollTop = getMaxScrollTop(scroller);
|
|
974
|
-
let nextPositionerHeight = 0;
|
|
975
931
|
let nextScrollTop = null;
|
|
976
|
-
let setReachedMax = false;
|
|
977
|
-
let scrollToMax = false;
|
|
978
932
|
const setHeight = (height) => {
|
|
979
933
|
positionerElement.style.height = `${height}px`;
|
|
980
934
|
};
|
|
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
935
|
const diff = isTopPositioned ? maxScrollTop - scrollTop : scrollTop;
|
|
989
936
|
const nextHeight = Math.min(currentHeight + diff, maxAvailableHeight);
|
|
990
|
-
nextPositionerHeight = nextHeight;
|
|
991
937
|
if (diff <= 1) {
|
|
992
|
-
|
|
938
|
+
const heightDelta = clamp(diff, 0, maxAvailableHeight - currentHeight);
|
|
939
|
+
if (heightDelta > 0) setHeight(currentHeight + heightDelta);
|
|
940
|
+
scroller.scrollTop = isTopPositioned ? maxScrollTop : 0;
|
|
941
|
+
if (maxAvailableHeight - (currentHeight + heightDelta) <= 1) reachedMaxHeightRef.current = true;
|
|
942
|
+
store.context.handleScrollArrowVisibility(scroller);
|
|
993
943
|
return;
|
|
994
944
|
}
|
|
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);
|
|
945
|
+
if (maxAvailableHeight - nextHeight > 1) nextScrollTop = isTopPositioned ? Infinity : 0;
|
|
946
|
+
else if (isBottomPositioned && scrollTop < maxScrollTop) nextScrollTop = scrollTop - (diff - (currentHeight + diff - maxAvailableHeight));
|
|
947
|
+
const nextPositionerHeight = Math.ceil(nextHeight);
|
|
1002
948
|
if (nextPositionerHeight !== 0) setHeight(nextPositionerHeight);
|
|
1003
|
-
if (
|
|
1004
|
-
const
|
|
1005
|
-
const target = scrollToMax ? nextMaxScrollTop : clamp(nextScrollTop, 0, nextMaxScrollTop);
|
|
949
|
+
if (nextScrollTop != null) {
|
|
950
|
+
const target = clamp(nextScrollTop, 0, getMaxScrollTop(scroller));
|
|
1006
951
|
if (Math.abs(scroller.scrollTop - target) > 1) scroller.scrollTop = target;
|
|
1007
952
|
}
|
|
1008
|
-
if (
|
|
1009
|
-
handleScrollArrowVisibility();
|
|
953
|
+
if (nextPositionerHeight >= maxAvailableHeight - 1) reachedMaxHeightRef.current = true;
|
|
954
|
+
store.context.handleScrollArrowVisibility(scroller);
|
|
1010
955
|
});
|
|
1011
|
-
React$1.useImperativeHandle(scrollHandlerRef, () => handleScroll, [handleScroll]);
|
|
956
|
+
React$1.useImperativeHandle(store.context.scrollHandlerRef, () => handleScroll, [handleScroll]);
|
|
1012
957
|
useOpenChangeComplete({
|
|
1013
958
|
open,
|
|
1014
|
-
ref: popupRef,
|
|
959
|
+
ref: store.context.popupRef,
|
|
1015
960
|
onComplete() {
|
|
1016
|
-
if (open) onOpenChangeComplete
|
|
961
|
+
if (open) store.context.onOpenChangeComplete(true);
|
|
1017
962
|
}
|
|
1018
963
|
});
|
|
1019
964
|
const state = {
|
|
@@ -1023,7 +968,7 @@ const SelectPopup = /*#__PURE__*/ React$1.forwardRef(function SelectPopup(compon
|
|
|
1023
968
|
align
|
|
1024
969
|
};
|
|
1025
970
|
useIsoLayoutEffect(() => {
|
|
1026
|
-
if (!positionerElement || !popupRef.current || Object.keys(originalPositionerStylesRef.current).length) return;
|
|
971
|
+
if (!positionerElement || !store.context.popupRef.current || Object.keys(originalPositionerStylesRef.current).length) return;
|
|
1027
972
|
originalPositionerStylesRef.current = {
|
|
1028
973
|
top: positionerElement.style.top || "0",
|
|
1029
974
|
left: positionerElement.style.left || "0",
|
|
@@ -1035,7 +980,7 @@ const SelectPopup = /*#__PURE__*/ React$1.forwardRef(function SelectPopup(compon
|
|
|
1035
980
|
marginTop: positionerElement.style.marginTop,
|
|
1036
981
|
marginBottom: positionerElement.style.marginBottom
|
|
1037
982
|
};
|
|
1038
|
-
}, [
|
|
983
|
+
}, [store, positionerElement]);
|
|
1039
984
|
useIsoLayoutEffect(() => {
|
|
1040
985
|
if (open || alignItemWithTriggerActive) return;
|
|
1041
986
|
initialPlacedRef.current = false;
|
|
@@ -1044,24 +989,22 @@ const SelectPopup = /*#__PURE__*/ React$1.forwardRef(function SelectPopup(compon
|
|
|
1044
989
|
}, [
|
|
1045
990
|
open,
|
|
1046
991
|
alignItemWithTriggerActive,
|
|
1047
|
-
positionerElement
|
|
1048
|
-
popupRef
|
|
992
|
+
positionerElement
|
|
1049
993
|
]);
|
|
1050
994
|
useIsoLayoutEffect(() => {
|
|
1051
|
-
const popupElement = popupRef.current;
|
|
995
|
+
const popupElement = store.context.popupRef.current;
|
|
1052
996
|
if (!open || !triggerElement || !positionerElement || !popupElement || alignItemWithTriggerActive && !isPositioned || store.state.transitionStatus === "ending") return;
|
|
997
|
+
initialPlacedRef.current = true;
|
|
998
|
+
popupElement.style.removeProperty(transformOrigin);
|
|
1053
999
|
if (!alignItemWithTriggerActive) {
|
|
1054
|
-
|
|
1055
|
-
scrollArrowFrame.request(handleScrollArrowVisibility);
|
|
1056
|
-
popupElement.style.removeProperty("--transform-origin");
|
|
1000
|
+
scrollArrowFrame.request(() => store.context.handleScrollArrowVisibility(listElement || popupElement));
|
|
1057
1001
|
return;
|
|
1058
1002
|
}
|
|
1059
1003
|
const restoreTransformStyles = unsetTransformStyles(popupElement);
|
|
1060
|
-
popupElement.style.removeProperty("--transform-origin");
|
|
1061
1004
|
try {
|
|
1062
|
-
let textElement = selectedItemTextRef.current;
|
|
1063
|
-
if (!textElement?.isConnected) textElement = !
|
|
1064
|
-
const valueElement = valueRef.current;
|
|
1005
|
+
let textElement = store.context.selectedItemTextRef.current;
|
|
1006
|
+
if (!textElement?.isConnected) textElement = !store.select("hasSelectedValue") && store.context.firstItemTextRef.current?.isConnected ? store.context.firstItemTextRef.current : null;
|
|
1007
|
+
const valueElement = store.context.valueRef.current;
|
|
1065
1008
|
const win = getWindow(positionerElement);
|
|
1066
1009
|
const positionerStyles = win.getComputedStyle(positionerElement);
|
|
1067
1010
|
const popupStyles = win.getComputedStyle(popupElement);
|
|
@@ -1110,7 +1053,6 @@ const SelectPopup = /*#__PURE__*/ React$1.forwardRef(function SelectPopup(compon
|
|
|
1110
1053
|
const fallbackToAlignPopupToTrigger = triggerRect.top < triggerCollisionThreshold || triggerRect.bottom > viewportHeight - triggerCollisionThreshold || Math.ceil(height) + 1 < Math.min(scrollHeight, minHeight);
|
|
1111
1054
|
const isPinchZoomed = (win.visualViewport?.scale ?? 1) !== 1 && webkit;
|
|
1112
1055
|
if (fallbackToAlignPopupToTrigger || isPinchZoomed) {
|
|
1113
|
-
initialPlacedRef.current = true;
|
|
1114
1056
|
clearStyles(positionerElement, originalPositionerStylesRef.current);
|
|
1115
1057
|
setControlledAlignItemWithTrigger(false);
|
|
1116
1058
|
return;
|
|
@@ -1130,12 +1072,11 @@ const SelectPopup = /*#__PURE__*/ React$1.forwardRef(function SelectPopup(compon
|
|
|
1130
1072
|
const popupHeight = positionerRect.height;
|
|
1131
1073
|
const textCenterY = textRect.top + textRect.height / 2;
|
|
1132
1074
|
const clampedY = clamp(popupHeight > 0 ? (textCenterY - popupTop) / popupHeight * 100 : 50, 0, 100);
|
|
1133
|
-
popupElement.style.setProperty(
|
|
1075
|
+
popupElement.style.setProperty(transformOrigin, `50% ${clampedY}%`);
|
|
1134
1076
|
}
|
|
1135
1077
|
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;
|
|
1078
|
+
store.context.handleScrollArrowVisibility(scroller);
|
|
1079
|
+
if (highlightItemOnHover && store.state.selectedIndex === null && store.state.activeIndex === null && store.context.listRef.current[0] != null) store.set("activeIndex", 0);
|
|
1139
1080
|
} finally {
|
|
1140
1081
|
restoreTransformStyles();
|
|
1141
1082
|
}
|
|
@@ -1144,16 +1085,10 @@ const SelectPopup = /*#__PURE__*/ React$1.forwardRef(function SelectPopup(compon
|
|
|
1144
1085
|
open,
|
|
1145
1086
|
positionerElement,
|
|
1146
1087
|
triggerElement,
|
|
1147
|
-
valueRef,
|
|
1148
|
-
firstItemTextRef,
|
|
1149
|
-
selectedItemTextRef,
|
|
1150
|
-
popupRef,
|
|
1151
|
-
handleScrollArrowVisibility,
|
|
1152
1088
|
alignItemWithTriggerActive,
|
|
1153
1089
|
setControlledAlignItemWithTrigger,
|
|
1154
1090
|
scrollArrowFrame,
|
|
1155
1091
|
listElement,
|
|
1156
|
-
listRef,
|
|
1157
1092
|
highlightItemOnHover,
|
|
1158
1093
|
direction,
|
|
1159
1094
|
isPositioned
|
|
@@ -1162,22 +1097,20 @@ const SelectPopup = /*#__PURE__*/ React$1.forwardRef(function SelectPopup(compon
|
|
|
1162
1097
|
if (!alignItemWithTriggerActive || !positionerElement || !open) return;
|
|
1163
1098
|
const win = getWindow(positionerElement);
|
|
1164
1099
|
function handleResize(event) {
|
|
1165
|
-
setOpen(false, createChangeEventDetails(windowResize, event));
|
|
1100
|
+
store.context.setOpen(false, createChangeEventDetails(windowResize, event));
|
|
1166
1101
|
}
|
|
1167
1102
|
return addEventListener(win, "resize", handleResize);
|
|
1168
1103
|
}, [
|
|
1169
|
-
|
|
1104
|
+
store,
|
|
1170
1105
|
alignItemWithTriggerActive,
|
|
1171
1106
|
positionerElement,
|
|
1172
1107
|
open
|
|
1173
1108
|
]);
|
|
1174
1109
|
const defaultProps = {
|
|
1175
|
-
...listElement ? {
|
|
1176
|
-
role: "presentation",
|
|
1177
|
-
"aria-orientation": void 0
|
|
1178
|
-
} : {
|
|
1110
|
+
...listElement ? { role: "presentation" } : {
|
|
1179
1111
|
role: "listbox",
|
|
1180
1112
|
"aria-multiselectable": multiple || void 0,
|
|
1113
|
+
"aria-readonly": readOnly || void 0,
|
|
1181
1114
|
id: `${id}-list`
|
|
1182
1115
|
},
|
|
1183
1116
|
onKeyDown(event) {
|
|
@@ -1187,17 +1120,17 @@ const SelectPopup = /*#__PURE__*/ React$1.forwardRef(function SelectPopup(compon
|
|
|
1187
1120
|
if (listElement) return;
|
|
1188
1121
|
handleScroll(event.currentTarget);
|
|
1189
1122
|
},
|
|
1190
|
-
...alignItemWithTriggerActive && { style: listElement ? { height: "100%" } : LIST_FUNCTIONAL_STYLES }
|
|
1123
|
+
...alignItemWithTriggerActive && { style: listElement ? { height: "100%" } : LIST_FUNCTIONAL_STYLES },
|
|
1124
|
+
className: !listElement && alignItemWithTriggerActive ? styleDisableScrollbar.className : void 0
|
|
1191
1125
|
};
|
|
1192
1126
|
const element = useRenderElement("div", componentProps, {
|
|
1193
|
-
ref: [forwardedRef, popupRef],
|
|
1127
|
+
ref: [forwardedRef, store.context.popupRef],
|
|
1194
1128
|
state,
|
|
1195
1129
|
stateAttributesMapping,
|
|
1196
1130
|
props: [
|
|
1197
1131
|
popupProps,
|
|
1198
1132
|
defaultProps,
|
|
1199
1133
|
getDisabledMountTransitionStyles(transitionStatus),
|
|
1200
|
-
{ className: !listElement && alignItemWithTriggerActive ? styleDisableScrollbar.className : void 0 },
|
|
1201
1134
|
elementProps
|
|
1202
1135
|
]
|
|
1203
1136
|
});
|
|
@@ -1213,7 +1146,7 @@ const SelectPopup = /*#__PURE__*/ React$1.forwardRef(function SelectPopup(compon
|
|
|
1213
1146
|
});
|
|
1214
1147
|
SelectPopup.displayName = "SelectPopup";
|
|
1215
1148
|
function getMaxPopupHeight(popupStyles) {
|
|
1216
|
-
const maxHeightStyle = popupStyles.maxHeight
|
|
1149
|
+
const maxHeightStyle = popupStyles.maxHeight;
|
|
1217
1150
|
return maxHeightStyle.endsWith("px") ? parseFloat(maxHeightStyle) || Infinity : Infinity;
|
|
1218
1151
|
}
|
|
1219
1152
|
function getMaxScrollTop(scroller) {
|
|
@@ -1254,7 +1187,7 @@ function unsetTransformStyles(popupElement) {
|
|
|
1254
1187
|
};
|
|
1255
1188
|
}
|
|
1256
1189
|
//#endregion
|
|
1257
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1190
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.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
1191
|
/**
|
|
1259
1192
|
* A container for the select items.
|
|
1260
1193
|
* Renders a `<div>` element.
|
|
@@ -1263,31 +1196,31 @@ function unsetTransformStyles(popupElement) {
|
|
|
1263
1196
|
*/
|
|
1264
1197
|
const SelectList = /*#__PURE__*/ React$1.forwardRef(function SelectList(componentProps, forwardedRef) {
|
|
1265
1198
|
const { render, className, style, ...elementProps } = componentProps;
|
|
1266
|
-
const
|
|
1199
|
+
const store = useSelectRootContext();
|
|
1200
|
+
const { multiple, readOnly } = useSelectRootPropsContext();
|
|
1267
1201
|
const { alignItemWithTriggerActive } = useSelectPositionerContext();
|
|
1268
|
-
const hasScrollArrows =
|
|
1269
|
-
const openMethod =
|
|
1270
|
-
const multiple = useStore(store, selectors.multiple);
|
|
1202
|
+
const hasScrollArrows = store.useState("hasScrollArrows");
|
|
1203
|
+
const openMethod = store.useState("openMethod");
|
|
1271
1204
|
const defaultProps = {
|
|
1272
|
-
id: `${
|
|
1205
|
+
id: `${store.useState("id")}-list`,
|
|
1273
1206
|
role: "listbox",
|
|
1274
1207
|
"aria-multiselectable": multiple || void 0,
|
|
1208
|
+
"aria-readonly": readOnly || void 0,
|
|
1275
1209
|
onScroll(event) {
|
|
1276
|
-
scrollHandlerRef.current?.(event.currentTarget);
|
|
1210
|
+
store.context.scrollHandlerRef.current?.(event.currentTarget);
|
|
1277
1211
|
},
|
|
1278
1212
|
...alignItemWithTriggerActive && { style: LIST_FUNCTIONAL_STYLES },
|
|
1279
1213
|
className: hasScrollArrows && openMethod !== "touch" ? styleDisableScrollbar.className : void 0
|
|
1280
1214
|
};
|
|
1215
|
+
const setListElement = store.useStateSetter("listElement");
|
|
1281
1216
|
return useRenderElement("div", componentProps, {
|
|
1282
|
-
ref: [forwardedRef,
|
|
1283
|
-
store.set("listElement", element);
|
|
1284
|
-
})],
|
|
1217
|
+
ref: [forwardedRef, setListElement],
|
|
1285
1218
|
props: [defaultProps, elementProps]
|
|
1286
1219
|
});
|
|
1287
1220
|
});
|
|
1288
1221
|
SelectList.displayName = "SelectList";
|
|
1289
1222
|
//#endregion
|
|
1290
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1223
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.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
1224
|
const SelectItemContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
1292
1225
|
SelectItemContext.displayName = "SelectItemContext";
|
|
1293
1226
|
function useSelectItemContext() {
|
|
@@ -1296,7 +1229,7 @@ function useSelectItemContext() {
|
|
|
1296
1229
|
return context;
|
|
1297
1230
|
}
|
|
1298
1231
|
//#endregion
|
|
1299
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1232
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.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
1233
|
/**
|
|
1301
1234
|
* An individual option in the select popup.
|
|
1302
1235
|
* Renders a `<div>` element.
|
|
@@ -1304,54 +1237,56 @@ function useSelectItemContext() {
|
|
|
1304
1237
|
* Documentation: [Base UI Select](https://base-ui.com/react/components/select)
|
|
1305
1238
|
*/
|
|
1306
1239
|
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;
|
|
1240
|
+
const { render, className, style, value: itemValue = null, label, disabled: disabledProp = false, nativeButton = false, ...elementProps } = componentProps;
|
|
1308
1241
|
const textRef = React$1.useRef(null);
|
|
1309
1242
|
const listItem = useCompositeListItem({
|
|
1243
|
+
guess: true,
|
|
1310
1244
|
label,
|
|
1311
|
-
textRef
|
|
1312
|
-
indexGuessBehavior: IndexGuessBehavior.GuessFromOrder
|
|
1245
|
+
textRef
|
|
1313
1246
|
});
|
|
1314
|
-
const
|
|
1315
|
-
const
|
|
1316
|
-
const
|
|
1317
|
-
const
|
|
1318
|
-
const
|
|
1319
|
-
const
|
|
1247
|
+
const store = useSelectRootContext();
|
|
1248
|
+
const { itemProps, multiple, disabled: selectDisabled, readOnly } = useSelectRootPropsContext();
|
|
1249
|
+
const disabled = selectDisabled || disabledProp;
|
|
1250
|
+
const highlighted = store.useState("isActive", listItem.index);
|
|
1251
|
+
const open = store.useState("open");
|
|
1252
|
+
const selected = store.useState("isSelected", itemValue);
|
|
1253
|
+
const selectedByFocus = store.useState("isSelectedByFocus", listItem.index);
|
|
1254
|
+
const isItemEqualToValue = store.useState("isItemEqualToValue");
|
|
1320
1255
|
const index = listItem.index;
|
|
1321
|
-
const hasRegistered = index !== -1;
|
|
1322
1256
|
const itemRef = React$1.useRef(null);
|
|
1323
1257
|
useIsoLayoutEffect(() => {
|
|
1324
|
-
|
|
1325
|
-
const values = valuesRef.current;
|
|
1258
|
+
const values = store.context.valuesRef.current;
|
|
1326
1259
|
values[index] = itemValue;
|
|
1327
1260
|
return () => {
|
|
1328
1261
|
delete values[index];
|
|
1329
1262
|
};
|
|
1330
1263
|
}, [
|
|
1331
|
-
hasRegistered,
|
|
1332
1264
|
index,
|
|
1333
1265
|
itemValue,
|
|
1334
|
-
|
|
1266
|
+
store
|
|
1335
1267
|
]);
|
|
1336
1268
|
useIsoLayoutEffect(() => {
|
|
1337
|
-
if (!hasRegistered) return;
|
|
1338
1269
|
const selectedValue = store.state.value;
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1270
|
+
const currentIndex = store.state.selectedIndex;
|
|
1271
|
+
let nextIndex = currentIndex;
|
|
1272
|
+
let claims;
|
|
1273
|
+
if (multiple && Array.isArray(selectedValue)) {
|
|
1274
|
+
nextIndex = resolveSelectedIndex(index, itemValue, store.context.valuesRef.current, selectedValue, isItemEqualToValue, currentIndex);
|
|
1275
|
+
claims = nextIndex === index;
|
|
1276
|
+
if (index === currentIndex && !claims) store.context.selectedItemTextRef.current = null;
|
|
1277
|
+
} else {
|
|
1278
|
+
claims = selectedValue !== void 0 && compareItemEquality(itemValue, selectedValue, isItemEqualToValue);
|
|
1279
|
+
if (claims) nextIndex = index;
|
|
1344
1280
|
}
|
|
1281
|
+
store.set("selectedIndex", nextIndex);
|
|
1282
|
+
if (claims && textRef.current) store.context.selectedItemTextRef.current = textRef.current;
|
|
1345
1283
|
}, [
|
|
1346
|
-
hasRegistered,
|
|
1347
1284
|
index,
|
|
1348
1285
|
multiple,
|
|
1349
1286
|
isItemEqualToValue,
|
|
1350
1287
|
store,
|
|
1351
|
-
itemValue
|
|
1352
|
-
selectedItemTextRef
|
|
1288
|
+
itemValue
|
|
1353
1289
|
]);
|
|
1354
|
-
const lastKeyRef = React$1.useRef(null);
|
|
1355
1290
|
const pointerTypeRef = React$1.useRef("mouse");
|
|
1356
1291
|
const allowMouseSelectionRef = React$1.useRef(false);
|
|
1357
1292
|
const { getButtonProps, buttonRef } = useButton({
|
|
@@ -1371,33 +1306,30 @@ const SelectItem = /*#__PURE__*/ React$1.memo(/*#__PURE__*/ React$1.forwardRef(f
|
|
|
1371
1306
|
if (multiple) {
|
|
1372
1307
|
const currentValue = Array.isArray(selectedValue) ? selectedValue : [];
|
|
1373
1308
|
const nextValue = selected ? removeItem(currentValue, itemValue, isItemEqualToValue) : [...currentValue, itemValue];
|
|
1374
|
-
setValue(nextValue, createChangeEventDetails(itemPress, event));
|
|
1309
|
+
store.context.setValue(nextValue, createChangeEventDetails(itemPress, event));
|
|
1375
1310
|
} else {
|
|
1376
|
-
setValue(itemValue, createChangeEventDetails(itemPress, event));
|
|
1377
|
-
setOpen(false, createChangeEventDetails(itemPress, event));
|
|
1311
|
+
store.context.setValue(itemValue, createChangeEventDetails(itemPress, event));
|
|
1312
|
+
store.context.setOpen(false, createChangeEventDetails(itemPress, event));
|
|
1378
1313
|
}
|
|
1379
1314
|
}
|
|
1380
1315
|
function resetDragMovement() {
|
|
1381
|
-
selectionRef.current.dragY = 0;
|
|
1316
|
+
store.context.selectionRef.current.dragY = 0;
|
|
1382
1317
|
}
|
|
1383
1318
|
const defaultProps = {
|
|
1384
1319
|
role: "option",
|
|
1385
1320
|
"aria-selected": selected,
|
|
1386
1321
|
tabIndex: open && highlighted ? 0 : -1,
|
|
1387
1322
|
onKeyDown(event) {
|
|
1388
|
-
lastKeyRef.current = event.key;
|
|
1389
1323
|
store.set("activeIndex", index);
|
|
1390
|
-
if (event.key === " " && typingRef.current) event.preventDefault();
|
|
1324
|
+
if (event.key === " " && store.context.typingRef.current) event.preventDefault();
|
|
1391
1325
|
},
|
|
1392
1326
|
onClick(event) {
|
|
1393
|
-
const isMouseClick =
|
|
1327
|
+
const isMouseClick = pointerTypeRef.current !== "touch";
|
|
1394
1328
|
const clickPointerType = event.nativeEvent.pointerType;
|
|
1395
1329
|
const isVirtualMouseClick = isMouseClick && isVirtualClick(event.nativeEvent) && (clickPointerType !== void 0 || highlighted);
|
|
1396
1330
|
const isInvalidMouseClick = isMouseClick && !isVirtualMouseClick && !allowMouseSelectionRef.current;
|
|
1397
1331
|
allowMouseSelectionRef.current = false;
|
|
1398
|
-
if (
|
|
1399
|
-
if (disabled || event.type === "keydown" && lastKeyRef.current === " " && typingRef.current || isInvalidMouseClick) return;
|
|
1400
|
-
lastKeyRef.current = null;
|
|
1332
|
+
if (disabled || isInvalidMouseClick) return;
|
|
1401
1333
|
commitSelection(event.nativeEvent);
|
|
1402
1334
|
},
|
|
1403
1335
|
onPointerEnter(event) {
|
|
@@ -1405,7 +1337,7 @@ const SelectItem = /*#__PURE__*/ React$1.memo(/*#__PURE__*/ React$1.forwardRef(f
|
|
|
1405
1337
|
},
|
|
1406
1338
|
onPointerMove(event) {
|
|
1407
1339
|
if (event.pointerType === "mouse" && event.buttons === 1) {
|
|
1408
|
-
const selection = selectionRef.current;
|
|
1340
|
+
const selection = store.context.selectionRef.current;
|
|
1409
1341
|
selection.dragY += event.movementY;
|
|
1410
1342
|
if (selection.dragY ** 2 >= 64) selection.allowUnselectedMouseUp = true;
|
|
1411
1343
|
}
|
|
@@ -1419,8 +1351,8 @@ const SelectItem = /*#__PURE__*/ React$1.memo(/*#__PURE__*/ React$1.forwardRef(f
|
|
|
1419
1351
|
resetDragMovement();
|
|
1420
1352
|
if (disabled || pointerTypeRef.current === "touch") return;
|
|
1421
1353
|
if (allowMouseSelectionRef.current) return;
|
|
1422
|
-
const disallowSelectedMouseUp = !selectionRef.current.allowSelectedMouseUp && selected;
|
|
1423
|
-
const disallowUnselectedMouseUp = !selectionRef.current.allowUnselectedMouseUp && !selected;
|
|
1354
|
+
const disallowSelectedMouseUp = !store.context.selectionRef.current.allowSelectedMouseUp && selected;
|
|
1355
|
+
const disallowUnselectedMouseUp = !store.context.selectionRef.current.allowUnselectedMouseUp && !selected;
|
|
1424
1356
|
if (disallowSelectedMouseUp || disallowUnselectedMouseUp) return;
|
|
1425
1357
|
allowMouseSelectionRef.current = true;
|
|
1426
1358
|
itemRef.current?.click();
|
|
@@ -1446,14 +1378,12 @@ const SelectItem = /*#__PURE__*/ React$1.memo(/*#__PURE__*/ React$1.forwardRef(f
|
|
|
1446
1378
|
selected,
|
|
1447
1379
|
index,
|
|
1448
1380
|
textRef,
|
|
1449
|
-
selectedByFocus
|
|
1450
|
-
hasRegistered
|
|
1381
|
+
selectedByFocus
|
|
1451
1382
|
}), [
|
|
1452
1383
|
selected,
|
|
1453
1384
|
index,
|
|
1454
1385
|
textRef,
|
|
1455
|
-
selectedByFocus
|
|
1456
|
-
hasRegistered
|
|
1386
|
+
selectedByFocus
|
|
1457
1387
|
]);
|
|
1458
1388
|
return /*#__PURE__*/ jsx(SelectItemContext.Provider, {
|
|
1459
1389
|
value: contextValue,
|
|
@@ -1462,7 +1392,7 @@ const SelectItem = /*#__PURE__*/ React$1.memo(/*#__PURE__*/ React$1.forwardRef(f
|
|
|
1462
1392
|
}));
|
|
1463
1393
|
SelectItem.displayName = "SelectItem";
|
|
1464
1394
|
//#endregion
|
|
1465
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1395
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.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
1396
|
/**
|
|
1467
1397
|
* Indicates whether the select item is selected.
|
|
1468
1398
|
* Renders a `<span>` element.
|
|
@@ -1470,9 +1400,8 @@ SelectItem.displayName = "SelectItem";
|
|
|
1470
1400
|
* Documentation: [Base UI Select](https://base-ui.com/react/components/select)
|
|
1471
1401
|
*/
|
|
1472
1402
|
const SelectItemIndicator = /*#__PURE__*/ React$1.forwardRef(function SelectItemIndicator(componentProps, forwardedRef) {
|
|
1473
|
-
const keepMounted = componentProps.keepMounted ?? false;
|
|
1474
1403
|
const { selected } = useSelectItemContext();
|
|
1475
|
-
if (!(keepMounted || selected)) return null;
|
|
1404
|
+
if (!(componentProps.keepMounted || selected)) return null;
|
|
1476
1405
|
return /*#__PURE__*/ jsx(Inner, {
|
|
1477
1406
|
...componentProps,
|
|
1478
1407
|
ref: forwardedRef
|
|
@@ -1497,6 +1426,8 @@ const Inner = /*#__PURE__*/ React$1.memo(/*#__PURE__*/ React$1.forwardRef((compo
|
|
|
1497
1426
|
stateAttributesMapping: transitionStatusMapping
|
|
1498
1427
|
});
|
|
1499
1428
|
useOpenChangeComplete({
|
|
1429
|
+
batch: true,
|
|
1430
|
+
enabled: !selected,
|
|
1500
1431
|
open: selected,
|
|
1501
1432
|
ref: indicatorRef,
|
|
1502
1433
|
onComplete() {
|
|
@@ -1507,7 +1438,7 @@ const Inner = /*#__PURE__*/ React$1.memo(/*#__PURE__*/ React$1.forwardRef((compo
|
|
|
1507
1438
|
}));
|
|
1508
1439
|
Inner.displayName = "Inner";
|
|
1509
1440
|
//#endregion
|
|
1510
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1441
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.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
1442
|
/**
|
|
1512
1443
|
* A text label of the select item.
|
|
1513
1444
|
* Renders a `<div>` element.
|
|
@@ -1515,22 +1446,21 @@ Inner.displayName = "Inner";
|
|
|
1515
1446
|
* Documentation: [Base UI Select](https://base-ui.com/react/components/select)
|
|
1516
1447
|
*/
|
|
1517
1448
|
const SelectItemText = /*#__PURE__*/ React$1.memo(/*#__PURE__*/ React$1.forwardRef(function SelectItemText(componentProps, forwardedRef) {
|
|
1518
|
-
const { index, textRef, selectedByFocus
|
|
1519
|
-
const
|
|
1449
|
+
const { index, textRef, selectedByFocus } = useSelectItemContext();
|
|
1450
|
+
const store = useSelectRootContext();
|
|
1520
1451
|
const { render, className, style, ...elementProps } = componentProps;
|
|
1452
|
+
const localRef = React$1.useCallback((node) => {
|
|
1453
|
+
if (!node) return;
|
|
1454
|
+
if (index === 0) store.context.firstItemTextRef.current = node;
|
|
1455
|
+
if (selectedByFocus) store.context.selectedItemTextRef.current = node;
|
|
1456
|
+
}, [
|
|
1457
|
+
store,
|
|
1458
|
+
index,
|
|
1459
|
+
selectedByFocus
|
|
1460
|
+
]);
|
|
1521
1461
|
return useRenderElement("div", componentProps, {
|
|
1522
1462
|
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
|
-
]),
|
|
1463
|
+
localRef,
|
|
1534
1464
|
forwardedRef,
|
|
1535
1465
|
textRef
|
|
1536
1466
|
],
|
|
@@ -1539,7 +1469,7 @@ const SelectItemText = /*#__PURE__*/ React$1.memo(/*#__PURE__*/ React$1.forwardR
|
|
|
1539
1469
|
}));
|
|
1540
1470
|
SelectItemText.displayName = "SelectItemText";
|
|
1541
1471
|
//#endregion
|
|
1542
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1472
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.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
1473
|
const SelectGroupContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
1544
1474
|
SelectGroupContext.displayName = "SelectGroupContext";
|
|
1545
1475
|
function useSelectGroupContext() {
|
|
@@ -1548,7 +1478,7 @@ function useSelectGroupContext() {
|
|
|
1548
1478
|
return context;
|
|
1549
1479
|
}
|
|
1550
1480
|
//#endregion
|
|
1551
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1481
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.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
1482
|
/**
|
|
1553
1483
|
* Groups related select items with the corresponding label.
|
|
1554
1484
|
* Renders a `<div>` element.
|
|
@@ -1576,7 +1506,7 @@ const SelectGroup = /*#__PURE__*/ React$1.forwardRef(function SelectGroup(compon
|
|
|
1576
1506
|
});
|
|
1577
1507
|
SelectGroup.displayName = "SelectGroup";
|
|
1578
1508
|
//#endregion
|
|
1579
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1509
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.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
1510
|
/**
|
|
1581
1511
|
* An accessible label that is automatically associated with its parent group.
|
|
1582
1512
|
* Renders a `<div>` element.
|
|
@@ -1589,12 +1519,27 @@ const SelectGroupLabel = /*#__PURE__*/ React$1.forwardRef(function SelectGroupLa
|
|
|
1589
1519
|
const id = useBaseUiId(idProp);
|
|
1590
1520
|
useIsoLayoutEffect(() => {
|
|
1591
1521
|
setLabelId(id);
|
|
1522
|
+
return () => {
|
|
1523
|
+
setLabelId((currentId) => currentId === id ? void 0 : currentId);
|
|
1524
|
+
};
|
|
1592
1525
|
}, [id, setLabelId]);
|
|
1593
1526
|
return useRenderElement("div", componentProps, {
|
|
1594
1527
|
ref: forwardedRef,
|
|
1595
|
-
props: [{
|
|
1528
|
+
props: [{
|
|
1529
|
+
id,
|
|
1530
|
+
"aria-hidden": true
|
|
1531
|
+
}, elementProps]
|
|
1596
1532
|
});
|
|
1597
1533
|
});
|
|
1598
1534
|
SelectGroupLabel.displayName = "SelectGroupLabel";
|
|
1599
1535
|
//#endregion
|
|
1600
|
-
|
|
1536
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.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
|
|
1537
|
+
/**
|
|
1538
|
+
* A visual separator between items or groups.
|
|
1539
|
+
* Renders a `<div>` element.
|
|
1540
|
+
*
|
|
1541
|
+
* Documentation: [Base UI Select](https://base-ui.com/react/components/select)
|
|
1542
|
+
*/
|
|
1543
|
+
const SelectSeparator = ListboxSeparator;
|
|
1544
|
+
//#endregion
|
|
1545
|
+
export { useSelectRootContext as _, SelectItemIndicator as a, SelectPopup as c, SelectPortal as d, SelectIcon as f, SelectRoot as g, SelectLabel as h, SelectItemText as i, SelectPositioner as l, SelectTrigger as m, SelectGroupLabel as n, SelectItem as o, SelectValue as p, SelectGroup as r, SelectList as s, SelectSeparator as t, useSelectPositionerContext as u };
|