@cloudflare/kumo 2.14.0 → 2.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +51 -0
- package/ai/component-registry.json +231 -43
- package/ai/component-registry.md +774 -166
- package/ai/schemas.ts +22 -3
- package/dist/.build-complete +1 -1
- package/dist/ai/schemas.d.ts +51 -2
- package/dist/ai/schemas.js +32 -1
- package/dist/blocks-source/delete-resource/delete-resource.test.tsx +21 -0
- package/dist/blocks-source/delete-resource/delete-resource.tsx +14 -8
- package/dist/chunks/{index.parts-h7wtkrxpz4m8eqn9.js → AccordionPanelDataAttributes-mmrmkky28u1010l5.js} +150 -61
- package/dist/chunks/{AlertDialogTrigger-dkihgpvj12si73w3.js → AlertDialogTrigger-l1r1gbxcky1xq889.js} +4 -4
- package/dist/chunks/{index.parts-kgiqby97w6tn6jw7.js → AlertDialogTriggerDataAttributes-go49qon601catpgn.js} +24 -9
- package/dist/chunks/{AutocompleteItem-drxau0wm3735nihq.js → AutocompleteItem-36ysm5nwbsd0snr6.js} +5 -5
- package/dist/chunks/AutocompleteItemDataAttributes-n5rigpf0s9ylnwi3.js +232 -0
- package/dist/chunks/{AutocompleteSeparator-hqtaxxxye1rfezfg.js → AutocompleteSeparator-bnqeqh7i983d92gx.js} +2 -2
- package/dist/chunks/{index.parts-b9zmk3ta77w8dy9f.js → AvatarImageDataAttributes-jw70u384c83lhqfp.js} +39 -15
- package/dist/chunks/{Button-ccl5r1xlbe3gh998.js → ButtonDataAttributes-nceand1fi7lvnmkb.js} +12 -4
- package/dist/chunks/{CSPContext-ctyrgg64girv38ls.js → CSPContext-iv67i0qqhihg8mur.js} +1 -1
- package/dist/chunks/{CSPProvider-p9ensukmowjpkgc0.js → CSPProvider-finau3a8hnc9o2td.js} +2 -2
- package/dist/chunks/{CheckboxGroup-knvypu2d1s0iz86k.js → CheckboxGroup-581mfftu99wvjb3a.js} +18 -23
- package/dist/chunks/{CheckboxGroupContext-lgc9dwxou662i6zo.js → CheckboxGroupContext-jf1bt3znvqlhrql6.js} +1 -1
- package/dist/chunks/CheckboxGroupDataAttributes-nskqcxts64symbvf.js +10 -0
- package/dist/chunks/{CheckboxIndicator-n982pbktfkxsa5zz.js → CheckboxIndicator-i13dmhacfgqo328c.js} +86 -29
- package/dist/chunks/CheckboxIndicatorDataAttributes-3p29ju7nkczz1l2y.js +85 -0
- package/dist/chunks/{CollapsiblePanel-jm0ni90g7wz7ppkc.js → CollapsiblePanel-md5suzmtnsyz1kab.js} +17 -13
- package/dist/chunks/CollapsibleRootDataAttributes-bynmgxmt4jikaoha.js +36 -0
- package/dist/chunks/{ComboboxClear-c2kvjkh9yc6xfl38.js → ComboboxClear-ioejwvtnmqanph88.js} +31 -24
- package/dist/chunks/ComboboxClearDataAttributes-lo0enstdmrqpywsy.js +402 -0
- package/dist/chunks/{ComboboxEmpty-o0q20j2l2syar9kx.js → ComboboxEmpty-gkt1y5b81a4983v7.js} +207 -215
- package/dist/chunks/ComboboxItemIndicatorDataAttributes-iku7l9ig0ve09an4.js +259 -0
- package/dist/chunks/{ComboboxPopup-oxgggc2wxy6bfmru.js → ComboboxPopup-n8cbgys9st446j1i.js} +15 -15
- package/dist/chunks/{CompositeItem-hzuk5x3e5zsfgnyj.js → CompositeItem-kepwg8jtvgap06o6.js} +3 -3
- package/dist/chunks/{CompositeList-lbr4enu6yzek7oa9.js → CompositeList-gwuaf6d14s4da0j0.js} +9 -7
- package/dist/chunks/{CompositeListContext-m9frxn53kkmr23d0.js → CompositeListContext-bejvmlu39hsfjzgu.js} +1 -1
- package/dist/chunks/{CompositeRoot-g72lchaerolf5dc9.js → CompositeRoot-dnlkb27uw4g5aocf.js} +12 -12
- package/dist/chunks/{CompositeRootContext-ixz4myr7uwvavx6w.js → CompositeRootContext-obm54j7y6s86qwhq.js} +1 -1
- package/dist/chunks/{index.parts-d4wim8mcnl9a2n9d.js → ContextMenuTriggerDataAttributes-xwozccynxv6pk5s0.js} +29 -15
- package/dist/chunks/DialogBackdropDataAttributes-jwqxd6jla03xh8ke.js +28 -0
- package/dist/chunks/{DialogHandle-klk7uo1q1y8ghyx5.js → DialogCloseDataAttributes-12m7gwh3i6fd7d05.js} +14 -6
- package/dist/chunks/{DialogPopup-olsvyf7ulia6ekb1.js → DialogPopup-n6w7b389e7bs0472.js} +13 -11
- package/dist/chunks/{DialogRoot-hl3genvzl9h8ridm.js → DialogRoot-hkkqj7vcjpkx8qk8.js} +3 -3
- package/dist/chunks/{DialogTrigger-g44cuem7n4wez533.js → DialogTrigger-kpugfkbfswqrus4u.js} +16 -16
- package/dist/chunks/DialogTriggerDataAttributes-bp9bu13cvwuddh5b.js +18 -0
- package/dist/chunks/DialogViewportDataAttributes-mma9emv1edsc1vuy.js +78 -0
- package/dist/chunks/{DirectionContext-opvqcb794uxicri4.js → DirectionContext-kpby968j030psajn.js} +1 -1
- package/dist/chunks/{DirectionProvider-er2gibtc9a1f0kep.js → DirectionProvider-cg0pwzgdyg6r73r6.js} +2 -2
- package/dist/chunks/{DrawerViewport-eqzib92gukr4qap3.js → DrawerViewport-mzqpwvqtylnad8ib.js} +110 -61
- package/dist/chunks/{index.parts-jknln7yxhdokkvd6.js → DrawerViewportDataAttributes-dd9593zm9fl9vcsm.js} +166 -85
- package/dist/chunks/{FieldControl-c5sahhd5xg3nr2x7.js → FieldControl-hjj2tcqruozadgdi.js} +18 -27
- package/dist/chunks/{FieldDescription-ldfiii5bvssfib3d.js → FieldDescription-orix2gepowrp5ni4.js} +11 -11
- package/dist/chunks/{FieldItemContext-kpsmvqm5a98m8zpx.js → FieldItemContext-ohsf45im6xhpay40.js} +1 -1
- package/dist/chunks/FieldItemDataAttributes-m52srx69pispz49i.js +283 -0
- package/dist/chunks/{FieldLabel-j9teqs9f1exqv346.js → FieldLabel-fjc7tdis7rcbq8o4.js} +17 -15
- package/dist/chunks/{FieldsetLegend-jyy40ylt2ynkvgob.js → FieldsetLegend-gl9z9eezr0xg9zr7.js} +5 -5
- package/dist/chunks/FieldsetLegendDataAttributes-fn20251jxjqkpkxm.js +17 -0
- package/dist/chunks/{FieldsetRootContext-7nlstw7wronafxhw.js → FieldsetRootContext-fphwizvcm55ydg94.js} +1 -1
- package/dist/chunks/{FloatingPortalLite-da0wdcmem7ahkle6.js → FloatingPortalLite-j7dsy7gokbxdoe1i.js} +2 -2
- package/dist/chunks/{popupTriggerMap-ehv0fuhnmy59j3pn.js → FloatingRootStore-men6ufp3a2b296fh.js} +117 -119
- package/dist/chunks/{FloatingTree-lhdqtlu8s6m66n7l.js → FloatingTree-kiyzavvaum442o1s.js} +6 -6
- package/dist/chunks/{Form-fjfbann47c7ws316.js → Form-oz425k7r4abea8o4.js} +7 -7
- package/dist/chunks/{FormContext-bsu99v8i8pwu1yxc.js → FormContext-jv19engyccpf6xcl.js} +2 -2
- package/dist/chunks/{Input-irwtufp5t73pwnoj.js → Input-ozudotydd679ly63.js} +2 -2
- package/dist/chunks/InputDataAttributes-oy8t6q5y5t8ik02j.js +42 -0
- package/dist/chunks/ItemIndicator-cvf8cw5fv5l3cd8j.js +37 -0
- package/dist/chunks/{LabelableContext-ccxbhu73vrk089m1.js → LabelableContext-dz4wz3lu3lgqusu7.js} +37 -6
- package/dist/chunks/{ListboxSeparator-nfyv54r2v5qtmosj.js → ListboxSeparator-skazx18vzzj7i9zp.js} +2 -2
- package/dist/chunks/MenuClearDataAttributes-fo0pekd36n56mdxu.js +1645 -0
- package/dist/chunks/{MenuSubmenuTrigger-mbbda6ucik6nphbq.js → MenuSubmenuTrigger-hm5xbgik6aq95x35.js} +639 -281
- package/dist/chunks/MenuSubmenuTriggerDataAttributes-gdfxdjymgmnaxdds.js +372 -0
- package/dist/chunks/{MenuTrigger-disngqnt74owi30p.js → MenuTrigger-dlfvicsaggss0o9m.js} +36 -28
- package/dist/chunks/{Menubar-fluuxyn8c2zuz5pr.js → Menubar-ja5int05ihjj0ra4.js} +24 -14
- package/dist/chunks/{MenubarContext-blatefsj42br7jh8.js → MenubarContext-ooz0h08i55c8oip5.js} +1 -1
- package/dist/chunks/{MeterLabel-k6no448jvaidaptf.js → MeterLabel-cykbkvqys5263z05.js} +12 -12
- package/dist/chunks/{index.parts-gf9v1piz8xxt8ap1.js → NavigationMenuIconDataAttributes-l82pkpm61d0meqxf.js} +333 -94
- package/dist/chunks/{NullStore-jwgpmovsgl47g9bv.js → NullStore-my62xo2vfcfkerri.js} +7 -6
- package/dist/chunks/{index.parts-c1ocmbxanagpan6d.js → NumberFieldScrubAreaCursorDataAttributes-k2lsbk35svshnwf5.js} +439 -215
- package/dist/chunks/{index.parts-p2lcxzhh1ll3584m.js → OTPFieldInputDataAttributes-gvgtu2gg85kgjzwr.js} +173 -56
- package/dist/chunks/{PopoverClose-kpyt8hbqc52lnjb8.js → PopoverViewport-peh28i8q4hqfjy97.js} +135 -81
- package/dist/chunks/PopoverViewportDataAttributes-gplhq9d7ffp9q8u3.js +329 -0
- package/dist/chunks/{PrehydrationScript-j6zlrxmojrqni6b9.js → PrehydrationScript-hs2je3mndbxuts7w.js} +29 -14
- package/dist/chunks/{index.parts-cc0yi5vo7s4x3r9p.js → PreviewCardViewportDataAttributes-bgfwmyshey7fx6nr.js} +263 -36
- package/dist/chunks/{index.parts-lpafjiz853r94ydb.js → ProgressLabelDataAttributes-j8mutcz11ei0ohvj.js} +103 -22
- package/dist/chunks/{RadioGroup-pok1e5qbnbujrz1e.js → RadioGroup-kioqngmmuo7a1lfa.js} +37 -42
- package/dist/chunks/{RadioGroupContext-galfnl2el7y2krov.js → RadioGroupContext-dr6uihsj7oky0eol.js} +1 -1
- package/dist/chunks/RadioGroupDataAttributes-dpdr6xe4ve204qwb.js +10 -0
- package/dist/chunks/{RadioIndicator-jd511oajbwmyjxbg.js → RadioIndicator-bhxqih8wzv7hyrec.js} +83 -27
- package/dist/chunks/RadioIndicatorDataAttributes-n5yupp5psifu0d4f.js +80 -0
- package/dist/chunks/{ScrollAreaThumb-eed3hf0pmrblshfw.js → ScrollAreaThumb-hxig41yn4lrurd3o.js} +114 -43
- package/dist/chunks/ScrollAreaThumbDataAttributes-gup5wfxvqye6jj27.js +137 -0
- package/dist/chunks/SelectScrollUpArrowDataAttributes-fce5i1afjkb0necr.js +473 -0
- package/dist/chunks/{SelectSeparator-mrjooj7vmjez6fua.js → SelectSeparator-nnak70azojox8b2b.js} +249 -162
- package/dist/chunks/{Separator-bcm4ezllqxvtpvuj.js → Separator-fhwve0tfny3tht3a.js} +2 -2
- package/dist/chunks/SeparatorDataAttributes-ch6e63bas7zflw00.js +11 -0
- package/dist/chunks/{index.parts-j6kbr29a542ya81m.js → SliderIndicator-h1o3qbrvr8x0t4t2.js} +129 -74
- package/dist/chunks/SliderIndicatorDataAttributes-ff2f1cjealif5nvo.js +240 -0
- package/dist/chunks/{SwitchRoot-gahuqddsq1s55p8m.js → SwitchRoot-m4t2tq5zn5wibyxk.js} +74 -22
- package/dist/chunks/SwitchThumbDataAttributes-f95ld864on9y6ptk.js +90 -0
- package/dist/chunks/{TabsList-ebl0v8gu8wn28zss.js → TabsList-n5n93rxr4sy704u8.js} +48 -30
- package/dist/chunks/TabsListDataAttributes-e03a7kbubuf02z1l.js +183 -0
- package/dist/chunks/ToastArrowDataAttributes-jbnvz3kp6a35slgj.js +136 -0
- package/dist/chunks/{Toggle-mbshs50266z9hgxp.js → ToggleDataAttributes-jl9ojyvwgrvefke6.js} +26 -11
- package/dist/chunks/{ToggleGroupContext-h4v7jaf77rp2xng9.js → ToggleGroupContext-hg8zbkgqpscqhz83.js} +1 -1
- package/dist/chunks/{ToggleGroup-k2caz2ghv6zbzp5l.js → ToggleGroupDataAttributes-n1dwona1alvabstl.js} +30 -9
- package/dist/chunks/{ToolbarGroupContext-e5cg7needj0edodc.js → ToolbarGroupContext-eawva8xkxb4osbxb.js} +1 -1
- package/dist/chunks/{ToolbarInput-i4h95tes75w0p5y2.js → ToolbarInput-kyxl1be0p3cyuayp.js} +10 -10
- package/dist/chunks/ToolbarInputDataAttributes-n4a18a4km735du04.js +150 -0
- package/dist/chunks/{ToolbarRootContext-eqk40r8uh4h6r211.js → ToolbarRootContext-difqbj720teyt8lu.js} +1 -1
- package/dist/chunks/{TooltipPopup-dm4y0hbdeylzp22y.js → TooltipPopup-furysmeyb68uycbz.js} +41 -68
- package/dist/chunks/{TooltipProvider-h40qf9wcn0atj15v.js → TooltipProvider-hyans0ens4axh1y8.js} +5 -5
- package/dist/chunks/TooltipViewportDataAttributes-gkwbezdq40ssuevg.js +312 -0
- package/dist/chunks/{adaptiveOriginMiddleware-b8ztjthe278xq7lm.js → adaptiveOriginMiddleware-m9tqzw58wya9sdds.js} +3 -3
- package/dist/chunks/{addEventListener-l40nxvf06iukgvnj.js → addEventListener-ku3x23446prmd1kz.js} +1 -1
- package/dist/chunks/{areArraysEqual-bcx201k1x9ziizym.js → areArraysEqual-nnpg93s9g7aqcaoh.js} +1 -1
- package/dist/chunks/{autocomplete-m6h1pbygknrz5div.js → autocomplete-kgp17p6oz4pczxt9.js} +9 -9
- package/dist/chunks/{badge-dq8bx752b9dp7dst.js → badge-kyz53p7p0ng393bs.js} +2 -1
- package/dist/chunks/{banner-msnmqm7of2lck01x.js → banner-cpla8vqjxaulggyd.js} +3 -3
- package/dist/chunks/{breadcrumbs-lhi1qrdh74mb4zsx.js → breadcrumbs-oyuqwb09l08uhok2.js} +7 -16
- package/dist/chunks/{button-group-i9dh83xutyuxyry7.js → button-group-biv43ksvaipc3p5n.js} +2 -2
- package/dist/chunks/{button-pa1bq9b85hawg41a.js → button-oxy32x5w9x9az80g.js} +25 -6
- package/dist/chunks/{chart-kd1xd6crso2i956o.js → chart-foxl6xbubuoshfcs.js} +14 -10
- package/dist/chunks/{checkbox-lbo436duy7krxcsk.js → checkbox-o9627970y7c9ciqy.js} +90 -36
- package/dist/chunks/{clamp-jcjhzx71s6wt1rnc.js → clamp-rcpupxvhqrn8uuyf.js} +1 -1
- package/dist/chunks/{clipboard-text-gd6s3n1bqse9zgt8.js → clipboard-text-bhy88tgvk1o6wmyl.js} +6 -6
- package/dist/chunks/{cloudflare-logo-boafurcbm5ttoo4o.js → cloudflare-logo-d8mid9xr190h78cu.js} +3 -3
- package/dist/chunks/{code-eu8kzwqnlhoyin24.js → code-nj2nu6qzxhz6qnkk.js} +1 -1
- package/dist/chunks/{collapsible-l8g94on4w7qfosmn.js → collapsible-ic6813hc4yv5s5hv.js} +2 -2
- package/dist/chunks/{combobox-hdxtsm2gqcxxgfju.js → combobox-hwrq8etkr7p2id0x.js} +7 -7
- package/dist/chunks/{command-palette-crtm3nd32yjhuax1.js → command-palette-el4x943vpmid0po0.js} +8 -8
- package/dist/chunks/{composite-ab8dmdfoj6tmhcn1.js → composite-c11t1ok72s3cggjc.js} +1 -1
- package/dist/chunks/{constants-flxfd6q03phtu007.js → constants-l10cgj6pyqg27jod.js} +1 -1
- package/dist/chunks/{createBaseUIEventDetails-3ob3qgs95ffm8l0w.js → createBaseUIEventDetails-nvee6bghv2reeqdb.js} +3 -2
- package/dist/chunks/{createItems-b8n8vigg5nak6j9s.js → createItems-n07tfwx89cdoar18.js} +42 -77
- package/dist/chunks/{createToastManager-onmoqrmr8zo02rif.js → createToastManager-cxjmn4jx3ejh85fs.js} +86 -42
- package/dist/chunks/{date-picker-cotkexrpqu5tjikv.js → date-picker-oee5ehsrepnlmltj.js} +4 -2
- package/dist/chunks/{date-range-picker-i6d8y1yemm7x5ins.js → date-range-picker-hpx3cdu9ve01jx6d.js} +1 -1
- package/dist/chunks/{dialog-glpnivujociqs9lh.js → dialog-lgrwmsumwpftp2u8.js} +7 -7
- package/dist/chunks/{dropdown-m53ji1d66mws89wh.js → dropdown-o875yxeqod7qp871.js} +133 -30
- package/dist/chunks/{empty-hkvg3is3uc6dj1at.js → empty-ft85jcbs7fd5t3tn.js} +11 -12
- package/dist/chunks/{engine-g5egnkub1ikv3wvy.js → engine-hzmefiqm63hu0c7i.js} +2 -2
- package/dist/chunks/{error-f4f6l13zx6tynxmy.js → error-lbnic2b20qr3mukp.js} +2 -2
- package/dist/chunks/{field-oqtso1v0oszlxi0e.js → field-jzzlgre0jmrr38o2.js} +4 -4
- package/dist/chunks/{flow-iz8sn24h5q6q4b10.js → flow-imvwzp5p2f8y2dxm.js} +7 -3
- package/dist/chunks/{formatNumber-kcnmauoqxku5a84c.js → formatNumber-b4kjdsebslm2b3t0.js} +2 -2
- package/dist/chunks/{getCssDimensions-olosvhh5husavesv.js → getCssDimensions-gckwdrp86f73cv51.js} +1 -1
- package/dist/chunks/{getElementTransform-cuiqmjglkrz4db6c.js → getElementTransform-cz3jyftv0x5io95f.js} +1 -1
- package/dist/chunks/getFiniteAnimations-jwd833ybtz81j5f0.js +13 -0
- package/dist/chunks/getHighlightReason-fhc53kq6qakcct9s.js +15 -0
- package/dist/chunks/{getPseudoElementBounds-x7b9uqi5hdb1lq2r.js → getPseudoElementBounds-csuw8kwsoeyxd5tv.js} +2 -2
- package/dist/chunks/{grid-fjlo3wlpkwgw56y9.js → grid-nwiczrab3r4w0zr2.js} +1 -1
- package/dist/chunks/{index.parts-ftxrjoy00esi3aau.js → index.parts-db9pzsm9rrs9tp0t.js} +12 -12
- package/dist/chunks/{index.parts-iq66xivmdw2mouvx.js → index.parts-ggacwr0yakuemead.js} +7 -7
- package/dist/chunks/{index.parts-g390bxx23hdko02m.js → index.parts-pcg3pmf3yyro841t.js} +2 -2
- package/dist/chunks/{inertValue-e0o6qvuef83v78fk.js → inertValue-n09gkjvwwa1kddov.js} +2 -2
- package/dist/chunks/{inline-copy-text-gbd7jhwpor27l4rq.js → inline-copy-text-57r67slswfqvgbaf.js} +2 -2
- package/dist/chunks/{input-group-fjr4r5ax0x78ppax.js → input-group-n08mcd8b36wbylro.js} +5 -5
- package/dist/chunks/{input-h5ox92gf13ge04hp.js → input-il37wjigy2xtgdo2.js} +4 -4
- package/dist/chunks/{input-c8lv9ulv0kortliq.js → input-ksy1w6j1m6olz6ck.js} +3 -3
- package/dist/chunks/{isElementDisabled-o0j7po84u0xjuwgg.js → isElementDisabled-dyqutxpzdfppbohx.js} +1 -1
- package/dist/chunks/itemEquality-ki3x4tzdhjlqjey6.js +56 -0
- package/dist/chunks/{label-gzyfw17u08irhdo8.js → label-hugrtzreeqk5mtqu.js} +10 -6
- package/dist/chunks/{layer-card-idh3863vdgprgqai.js → layer-card-mar4dya5kl1vvie6.js} +3 -3
- package/dist/chunks/{layer-dialog-j5ywmzs46ccg6oqy.js → layer-dialog-dwrrgv1wasrerow4.js} +71 -46
- package/dist/chunks/{link-cqyfjezntvr53rh7.js → link-h84bkh8eem39p529.js} +4 -4
- package/dist/chunks/{loader-j2v6fab8iucuxz1z.js → loader-kv5nk8j8tsuesxqo.js} +2 -6
- package/dist/chunks/{locale-provider-kjlnws7jln3ak0dr.js → locale-provider-e3310bgo4lnffqkd.js} +20 -8
- package/dist/chunks/{menubar-fjhotkmndttb8mua.js → menubar-m5pqhx7lu5z7mkks.js} +2 -2
- package/dist/chunks/{mergeCleanups-ix8l84cgutsbotpd.js → mergeCleanups-nw73c6jfwl5tyhw4.js} +1 -1
- package/dist/chunks/{meter-majprsslwmpbmkzg.js → meter-poh8jpe0qtq6mvee.js} +2 -2
- package/dist/chunks/{pagination-oaenm9t7ou3lmcgw.js → pagination-h24on80p2z5ugqdb.js} +3 -3
- package/dist/chunks/{popover-hr0bfgg48xzjggky.js → popover-nqrt3ykqv6sic8pz.js} +70 -16
- package/dist/chunks/{popupHandle-7ghmro8a5uerjwu5.js → popupHandle-dk3ixgc8flr7v971.js} +4 -4
- package/dist/chunks/popupStoreUtils-czfnxn051xakask5.js +868 -0
- package/dist/chunks/radio-d3pkrvsldfbdefav.js +203 -0
- package/dist/chunks/{reason-parts-m5ishukzeux3q0pc.js → reason-parts-hssx64rmlxyn6gw5.js} +3 -2
- package/dist/chunks/{resolveAriaLabelledBy-nc8mdie5shy87nsb.js → resolveAriaLabelledBy-knaucrjrjwnk7tvs.js} +1 -1
- package/dist/chunks/resolveValueLabel-ntacnb58mhka5gg0.js +70 -0
- package/dist/chunks/{safePolygon-kmd5wsz26l4xtj6c.js → safePolygon-ep4133qogeu5vjf3.js} +34 -38
- package/dist/chunks/{safeReact-hpp4cck3y2s5jg75.js → safeReact-ek77ilng4ekk7mgz.js} +2 -2
- package/dist/chunks/{scrollable-b6m9ze1u7ps0q1qn.js → scrollable-k784b35i80aolmvg.js} +8 -13
- package/dist/chunks/{select-futox5zqr3r80y9a.js → select-ey03k4630uckf1rk.js} +8 -8
- package/dist/chunks/{sensitive-input-cw33yncetxk3fbrl.js → sensitive-input-lfrrtyg9n5ulq3tb.js} +23 -28
- package/dist/chunks/{serializeValue-ipcakiw32jb7kany.js → serializeValue-d1otz2i7h5tygrwf.js} +1 -1
- package/dist/chunks/{sidebar-in9zhvr473afsjpp.js → sidebar-gluq5b5oacrdk4m4.js} +23 -16
- package/dist/chunks/{skeleton-line-m9dyh126t9k07jvg.js → skeleton-line-gjf1fecmyy82aejz.js} +1 -1
- package/dist/chunks/slider-juwif2d8xa5n0429.js +87 -0
- package/dist/chunks/{stringifyLocale-bxsgxdnzaef2vcar.js → stringifyLocale-gbxouqj7ol627jxh.js} +1 -1
- package/dist/chunks/{styles-kl02oyrlnld7arja.js → styles-eb8bvypmayf578jf.js} +2 -2
- package/dist/chunks/{surface-irf0af2mfglu4p0j.js → surface-ginwpan1pz61l6k2.js} +2 -2
- package/dist/chunks/{switch-cqsvolm7h69z7vgg.js → switch-mqf1ulvle4nd6d2t.js} +4 -4
- package/dist/chunks/{table-yf8ul2e5nbemioi1.js → table-nysse5tiwf47gg4k.js} +2 -2
- package/dist/chunks/{table-of-contents-cvduqgssxdcbpagh.js → table-of-contents-gkjv9ck8etbz64ej.js} +5 -2
- package/dist/chunks/{tabs-gf57qqf1wcclaejq.js → tabs-mmkz7q5rofnmogwt.js} +3 -3
- package/dist/chunks/{tag-input-ohfybx5dbxy3houy.js → tag-input-b10gfxoob9vcizpm.js} +6 -5
- package/dist/chunks/{text-f1wxz183ckq7qtl7.js → text-me99rjbjkaff98gp.js} +1 -2
- package/dist/chunks/{toast-bzaothy2yrezh787.js → toast-b4t9rt9y1sumcmy2.js} +4 -4
- package/dist/chunks/{toolbar-h213d8e22yjh5cwq.js → toolbar-hov6sa3ui366f447.js} +5 -5
- package/dist/chunks/{tooltip-o4natsv01lpq8oq2.js → tooltip-lguwh8bjhxwnjfus.js} +3 -3
- package/dist/chunks/use-copy-feedback-gl55ghst0csvpv4j.js +55 -0
- package/dist/chunks/{useAnchoredPopupScrollLock-kp3kai20u91sdm7v.js → useAnchoredPopupScrollLock-msm8tzkewysnunut.js} +4 -4
- package/dist/chunks/{useAnimationFrame-0tt315hl9n3jzl86.js → useAnimationFrame-k9lqdj9quln3sd85.js} +3 -3
- package/dist/chunks/{useAriaLabelledBy-ox8dum59shmgypq1.js → useAriaLabelledBy-j3j9jqlr9ukyk08s.js} +7 -6
- package/dist/chunks/{useBaseUiId-lg1teubxudgin0w2.js → useBaseUiId-nk4k7nj9h1cy76ny.js} +2 -2
- package/dist/chunks/{useButton-h7s9aq1sfw6arawe.js → useButton-lklvdzuhvj22bx07.js} +14 -12
- package/dist/chunks/{useClick-l0p0endoxrlp0ae5.js → useClick-pcbkcc7r620v1smu.js} +12 -12
- package/dist/chunks/{useCollapsiblePanel-g6t146nqj521pild.js → useCollapsiblePanel-lrfsgx21ds36cwlp.js} +75 -28
- package/dist/chunks/{useCompositeItem-p7090ga00dpqcg5j.js → useCompositeItem-2juex3zh9gyrs8e9.js} +4 -4
- package/dist/chunks/{useCompositeListItem-odg6yo4h8866b37o.js → useCompositeListItem-ekwo2j2rjkggg7xj.js} +3 -3
- package/dist/chunks/{useControlled-lfns1ot6kwowa4t4.js → useControlled-i3srnkxy598s0au9.js} +3 -3
- package/dist/chunks/{useFieldValidation-e5pc8loiwzd68g4f.js → useFieldValidation-oe16jiigp971yrzr.js} +7 -7
- package/dist/chunks/{useFloatingRootContext-c849wtis7gx013m8.js → useFloatingRootContext-k676b6m7f80bdapd.js} +6 -6
- package/dist/chunks/{useFocus-lqwrnfa1svv3bcx1.js → useFocus-mn7a9t9v6fnlb4mf.js} +12 -14
- package/dist/chunks/useId-82z8yqlmc1hy1c5t.js +50 -0
- package/dist/chunks/useInitialLiveRegionTextMutation-nl2hus7zx1h7ggno.js +86 -0
- package/dist/chunks/{useLabel-kcggu762z3z2taeb.js → useLabel-me6zzfvkypo458pi.js} +19 -9
- package/dist/chunks/{useLabelableId-gqiiuqqn2k0u62r4.js → useLabelableId-bjeh6q3pgrqjb7er.js} +6 -6
- package/dist/chunks/{useListNavigation-3nyjs362qcau34in.js → useListNavigation-hpddbd0cc9pvt461.js} +56 -74
- package/dist/chunks/{useOnMount-hadwgyauanbzrvem.js → useOnMount-gxggz1m0n869s6r0.js} +2 -2
- package/dist/chunks/{useOpenChangeComplete-lk2gfu250t7r20c6.js → useOpenChangeComplete-edtabjwqmechsyv6.js} +10 -8
- package/dist/chunks/{usePopupHandleStore-hx871cmn66j0q7wz.js → usePopupHandleStore-gawjmfjf1xdgiph3.js} +2 -2
- package/dist/chunks/{usePopupViewport-iy5j9zawjrr3pcs0.js → usePopupViewport-l6w01iohvzloghy8.js} +28 -36
- package/dist/chunks/{usePositioner-k9nc7cl550bgfwzs.js → usePositioner-mzvgnazldqvy44z2.js} +41 -72
- package/dist/chunks/usePressAndHold-k9ynk78pgf677kpx.js +179 -0
- package/dist/chunks/{usePreviousValue-io5t1pdxehw21l85.js → usePreviousValue-o6swt5tb7xhpdu4e.js} +1 -1
- package/dist/chunks/{useRegisterFieldControl-lvusf6vc963clx02.js → useRegisterFieldControl-m1stc9l9y4cndf0k.js} +4 -4
- package/dist/chunks/{useRegisteredLabelId-hw6b87h1k7kow1o2.js → useRegisteredLabelId-b7u9ygya03448zzn.js} +3 -3
- package/dist/chunks/{useRender-onwjigxa00uch2ip.js → useRender-h9ktka9xt4obdv6y.js} +2 -2
- package/dist/chunks/{useRenderDialogRoot-lddunc01twftravv.js → useRenderDialogRoot-bsqrqpc1ddau7xg4.js} +57 -20
- package/dist/chunks/{useRenderElement-lrvp2pwrpt5zq1zd.js → useRenderElement-nkklxbq1rp7h2kw0.js} +17 -24
- package/dist/chunks/{useScrollLock-buonkbwuland9wl3.js → useScrollLock-le7ajwlt7oh6fzxi.js} +68 -72
- package/dist/chunks/useSetFieldFocused-fbvj7gcv67dqfkp0.js +35 -0
- package/dist/chunks/{useStableCallback-b1i1ghzd9k75bb85.js → useStableCallback-le5qgj6p9l04729n.js} +3 -3
- package/dist/chunks/{useSwipeDismiss-m1s13x9t9ey9ax3p.js → useSwipeDismiss-e8tfxzlp05p86mgb.js} +35 -54
- package/dist/chunks/{useTimeout-cpql3c8p250cr093.js → useTimeout-f0ayn2l2l9aop4l8.js} +3 -3
- package/dist/chunks/{useTransitionStatus-bwqaavnekreihom2.js → useTransitionStatus-disysoblzgk34w14.js} +9 -5
- package/dist/chunks/{useTriggerFocusGuards-lz7wt484xltizro4.js → useTriggerFocusGuards-dyd3hb1m8en8ct50.js} +12 -22
- package/dist/chunks/useTriggerSwitchTransition-hk5j36hd5dq2ok6w.js +62 -0
- package/dist/chunks/{useTypeahead-kvag4w6hu2g1kbwt.js → useTypeahead-kfdsw1ksl5bgvvzl.js} +16 -12
- package/dist/chunks/{useValueAsRef-o4s9ohb3aczypmnk.js → useValueAsRef-dv0tmfr1xlpzdlru.js} +3 -3
- package/dist/chunks/{useValueChanged-cz5wflhe8g15n6w1.js → useValueChanged-fjssa2v6d4w8y332.js} +3 -3
- package/dist/chunks/{utils-0i7gujfv3f3e9dqh.js → utils-o44zfmzz9z7uyj1v.js} +0 -1
- package/dist/chunks/{valueToPercent-d7gbqk1umostj7ch.js → valueToPercent-djk2mqnihth2uvf6.js} +1 -1
- package/dist/chunks/vendor-styling-gs32v7xt5znc8kg0.js +1167 -0
- package/dist/chunks/{vendor-utils-ecfbsk425x1bm0gh.js → vendor-utils-io8z5lsfxq8m2dcc.js} +88 -30
- package/dist/chunks/{visuallyHidden-nous086atnlxtf74.js → visuallyHidden-kzzs9hbe93is3rci.js} +2 -1
- package/dist/code.js +6 -11
- package/dist/components/autocomplete.d.ts +1 -1
- package/dist/components/autocomplete.js +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/banner.js +1 -1
- package/dist/components/breadcrumbs.js +1 -1
- package/dist/components/button-group.js +1 -1
- package/dist/components/button.js +1 -1
- package/dist/components/chart.d.ts +1 -1
- package/dist/components/chart.js +1 -1
- package/dist/components/checkbox.d.ts +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/clipboard-text.js +1 -1
- package/dist/components/cloudflare-logo.js +1 -1
- package/dist/components/code.js +1 -1
- package/dist/components/collapsible.js +1 -1
- package/dist/components/combobox.js +1 -1
- package/dist/components/command-palette.js +1 -1
- package/dist/components/date-picker.d.ts +1 -1
- package/dist/components/date-picker.js +1 -1
- package/dist/components/date-range-picker.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/dropdown.d.ts +1 -1
- package/dist/components/dropdown.js +1 -1
- package/dist/components/empty.js +1 -1
- package/dist/components/field.js +1 -1
- package/dist/components/flow.js +1 -1
- package/dist/components/grid.js +1 -1
- package/dist/components/inline-copy-text.js +1 -1
- package/dist/components/input-group.js +1 -1
- package/dist/components/input.js +3 -3
- package/dist/components/label.d.ts +1 -1
- package/dist/components/label.js +1 -1
- package/dist/components/layer-card.js +1 -1
- package/dist/components/layer-dialog.d.ts +2 -2
- package/dist/components/layer-dialog.js +1 -1
- package/dist/components/link.js +1 -1
- package/dist/components/loader.js +2 -2
- package/dist/components/menubar.js +1 -1
- package/dist/components/meter.js +1 -1
- package/dist/components/pagination.js +1 -1
- package/dist/components/popover.d.ts +1 -1
- package/dist/components/popover.js +1 -1
- package/dist/components/radio.d.ts +1 -1
- package/dist/components/radio.js +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/sensitive-input.js +1 -1
- package/dist/components/sidebar.d.ts +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/slider.d.ts +2 -0
- package/dist/components/slider.js +3 -0
- package/dist/components/surface.js +1 -1
- package/dist/components/switch.js +1 -1
- package/dist/components/table-of-contents.js +1 -1
- package/dist/components/table.d.ts +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/tabs.js +1 -1
- package/dist/components/tag-input.js +1 -1
- package/dist/components/text.js +1 -1
- package/dist/components/toast.js +2 -2
- package/dist/components/toolbar.js +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/{index-NqlNd7cQ.d.ts → index-5bJAnzUo.d.ts} +19 -7
- package/dist/{index-Cqrye3KD.d.ts → index-AUC5xRcO.d.ts} +64 -7
- package/dist/{index-C0d8uwYO.d.ts → index-BW1HVU7T.d.ts} +33 -5
- package/dist/index-BWe6haHU.d.ts +64 -0
- package/dist/{index-ChGFA5-n.d.ts → index-BvNXYn7u.d.ts} +4 -1
- package/dist/{index-D-y1ktn-.d.ts → index-CE09bLNb.d.ts} +5 -1
- package/dist/{index-bAud6rG2.d.ts → index-CU_lnxg7.d.ts} +13 -4
- package/dist/{index-Vj9ZzRh0.d.ts → index-DNsSKNUe.d.ts} +4 -1
- package/dist/{index-J1qdw9mL.d.ts → index-DjSGDESy.d.ts} +36 -2
- package/dist/{index-_Sl5wohy.d.ts → index-RP_rt8vB.d.ts} +1 -1
- package/dist/{index-Cp0aQngm.d.ts → index-T1sSoiWG.d.ts} +3 -1
- package/dist/{index-CtTNoYA2.d.ts → index-fsZE0vPs.d.ts} +12 -0
- package/dist/index.d.ts +14 -13
- package/dist/index.js +68 -63
- package/dist/{locale-provider-BLGya10h.d.ts → locale-provider-CAjVN3_0.d.ts} +6 -2
- package/dist/primitives/accordion.js +2 -2
- package/dist/primitives/alert-dialog.js +7 -2
- package/dist/primitives/autocomplete.js +5 -2
- package/dist/primitives/avatar.js +2 -2
- package/dist/primitives/button.js +2 -2
- package/dist/primitives/checkbox-group.js +3 -2
- package/dist/primitives/checkbox.js +3 -2
- package/dist/primitives/collapsible.js +4 -2
- package/dist/primitives/combobox.js +5 -2
- package/dist/primitives/context-menu.js +5 -2
- package/dist/primitives/csp-provider.js +1 -1
- package/dist/primitives/dialog.js +8 -2
- package/dist/primitives/direction-provider.js +2 -2
- package/dist/primitives/drawer.js +5 -2
- package/dist/primitives/field.js +3 -2
- package/dist/primitives/fieldset.js +2 -2
- package/dist/primitives/form.js +1 -1
- package/dist/primitives/input.js +3 -2
- package/dist/primitives/menu.js +5 -2
- package/dist/primitives/menubar.js +2 -2
- package/dist/primitives/meter.js +1 -1
- package/dist/primitives/navigation-menu.js +2 -2
- package/dist/primitives/number-field.js +2 -2
- package/dist/primitives/otp-field.js +3 -2
- package/dist/primitives/popover.js +2 -2
- package/dist/primitives/preview-card.js +2 -2
- package/dist/primitives/progress.js +2 -2
- package/dist/primitives/radio-group.js +3 -2
- package/dist/primitives/radio.js +3 -2
- package/dist/primitives/scroll-area.js +3 -2
- package/dist/primitives/select.js +4 -2
- package/dist/primitives/separator.js +3 -2
- package/dist/primitives/slider.js +3 -2
- package/dist/primitives/switch.js +3 -2
- package/dist/primitives/tabs.js +3 -2
- package/dist/primitives/toast.js +4 -2
- package/dist/primitives/toggle-group.js +2 -2
- package/dist/primitives/toggle.js +2 -2
- package/dist/primitives/toolbar.js +2 -2
- package/dist/primitives/tooltip.js +3 -2
- package/dist/primitives.d.ts +1 -1
- package/dist/primitives.js +70 -42
- package/dist/styles/kumo-standalone.css +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +3 -3
- package/package.json +7 -3
- package/scripts/component-registry/discovery.ts +1 -0
- package/scripts/component-registry/metadata.ts +38 -0
- package/dist/chunks/DialogViewport-e1tqfisqexc7o9z8.js +0 -42
- package/dist/chunks/MenuBackdrop-ouznwyglg27bosoj.js +0 -73
- package/dist/chunks/index.parts-bq90erougcgrwlgk.js +0 -242
- package/dist/chunks/index.parts-cdxa6fwtp3lpkpp4.js +0 -11
- package/dist/chunks/index.parts-cl2xux9bjec6cibd.js +0 -44
- package/dist/chunks/index.parts-e9s1lqq3qa9l6ndm.js +0 -10
- package/dist/chunks/index.parts-eks3uafpskcxle6j.js +0 -99
- package/dist/chunks/index.parts-fbip2x29k5okvypg.js +0 -64
- package/dist/chunks/index.parts-fhza3s183grld7zq.js +0 -102
- package/dist/chunks/index.parts-hmx3qlh517ii56yi.js +0 -116
- package/dist/chunks/index.parts-i6gbeimeit8gzhvi.js +0 -10
- package/dist/chunks/index.parts-ioii4acz2bjrf6sb.js +0 -77
- package/dist/chunks/index.parts-jjup1zgnozoxi7ky.js +0 -140
- package/dist/chunks/index.parts-jpm6c0fe0gyky12m.js +0 -95
- package/dist/chunks/index.parts-moguar0t0u4aumou.js +0 -31
- package/dist/chunks/index.parts-mw0e646n3qp6v1qe.js +0 -73
- package/dist/chunks/index.parts-olcmo45gi8e1qma1.js +0 -10
- package/dist/chunks/popupStoreUtils-i0y57dvmcnqrh4pv.js +0 -444
- package/dist/chunks/radio-35dx7y6rjrezbjsp.js +0 -173
- package/dist/chunks/resolveValueLabel-hpmsash3ektitvnb.js +0 -123
- package/dist/chunks/useDismiss-me91ertzzz3gly12.js +0 -384
- package/dist/chunks/useFilteredItems-kw2za6m9bng7twr0.js +0 -181
- package/dist/chunks/useForcedRerendering-i3n4ms0xose8borh.js +0 -14
- package/dist/chunks/useId-f8w657f9yys10abm.js +0 -32
- package/dist/chunks/vendor-styling-da1xibnxfkjmtglr.js +0 -3631
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { t as cn } from "./vendor-styling-da1xibnxfkjmtglr.js";
|
|
3
|
-
import { t as resolveVariant } from "./resolve-variant-l6x5ksfrjtu4m66l.js";
|
|
4
|
-
import { n as FieldsetRoot, t as FieldsetLegend } from "./FieldsetLegend-jyy40ylt2ynkvgob.js";
|
|
5
|
-
import { t as RadioGroup$1 } from "./RadioGroup-pok1e5qbnbujrz1e.js";
|
|
6
|
-
import { n as RadioRoot, t as RadioIndicator } from "./RadioIndicator-jd511oajbwmyjxbg.js";
|
|
7
|
-
import { createContext, forwardRef, useContext } from "react";
|
|
8
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
//#region src/components/radio/radio.tsx
|
|
10
|
-
/** Radio variant definitions mapping variant names to their Tailwind classes. */
|
|
11
|
-
const KUMO_RADIO_VARIANTS = {
|
|
12
|
-
variant: {
|
|
13
|
-
default: {
|
|
14
|
-
classes: "ring-kumo-hairline",
|
|
15
|
-
description: "Default radio appearance"
|
|
16
|
-
},
|
|
17
|
-
error: {
|
|
18
|
-
classes: "ring-kumo-danger",
|
|
19
|
-
description: "Error state for validation failures"
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
appearance: {
|
|
23
|
-
default: {
|
|
24
|
-
classes: "",
|
|
25
|
-
description: "Standard inline radio item"
|
|
26
|
-
},
|
|
27
|
-
card: {
|
|
28
|
-
classes: "rounded-lg border border-kumo-hairline bg-kumo-base p-3 transition-colors hover:bg-kumo-tint has-[[data-checked]]:border-kumo-interact has-[[data-checked]]:bg-kumo-tint",
|
|
29
|
-
description: "Choice card appearance with border, padding, and highlighted selection state"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
const KUMO_RADIO_DEFAULT_VARIANTS = {
|
|
34
|
-
variant: "default",
|
|
35
|
-
appearance: "default"
|
|
36
|
-
};
|
|
37
|
-
function radioVariants({ variant = KUMO_RADIO_DEFAULT_VARIANTS.variant, appearance = KUMO_RADIO_DEFAULT_VARIANTS.appearance } = {}) {
|
|
38
|
-
return cn(resolveVariant(KUMO_RADIO_VARIANTS.variant, variant, KUMO_RADIO_DEFAULT_VARIANTS.variant).classes, resolveVariant(KUMO_RADIO_VARIANTS.appearance, appearance, KUMO_RADIO_DEFAULT_VARIANTS.appearance).classes);
|
|
39
|
-
}
|
|
40
|
-
const RadioGroupContext = createContext({
|
|
41
|
-
controlPosition: void 0,
|
|
42
|
-
appearance: "default"
|
|
43
|
-
});
|
|
44
|
-
function _RadioItem({ className, disabled, variant = "default", appearance: appearanceProp, label, description, value }, ref) {
|
|
45
|
-
const { controlPosition, appearance: groupAppearance } = useContext(RadioGroupContext);
|
|
46
|
-
const isCard = (appearanceProp ?? groupAppearance) === "card";
|
|
47
|
-
const effectiveControlPosition = controlPosition ?? (isCard ? "end" : "start");
|
|
48
|
-
if (isCard) return /* @__PURE__ */ jsxs("label", {
|
|
49
|
-
"data-kumo-component": "Radio",
|
|
50
|
-
"data-kumo-part": "item-label",
|
|
51
|
-
className: cn("group relative m-0 flex items-start gap-3 rounded-lg border border-kumo-hairline bg-kumo-base p-3 transition-colors has-[[data-checked]]:border-kumo-interact has-[[data-checked]]:bg-kumo-tint", effectiveControlPosition === "start" && "flex-row-reverse", variant === "error" && "border-kumo-danger has-[[data-checked]]:border-kumo-danger has-[[data-checked]]:bg-kumo-base", disabled ? "cursor-not-allowed opacity-50" : cn("cursor-pointer has-[[data-disabled]]:cursor-not-allowed has-[[data-disabled]]:opacity-50", variant !== "error" && "hover:not-has-[[data-disabled]]:bg-kumo-tint"), className),
|
|
52
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
53
|
-
className: "flex min-w-0 flex-1 flex-col gap-0.5",
|
|
54
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
55
|
-
className: "text-base font-medium text-kumo-default",
|
|
56
|
-
children: label
|
|
57
|
-
}), description && /* @__PURE__ */ jsx("span", {
|
|
58
|
-
className: "text-sm text-kumo-subtle",
|
|
59
|
-
children: description
|
|
60
|
-
})]
|
|
61
|
-
}), /* @__PURE__ */ jsx(RadioRoot, {
|
|
62
|
-
ref,
|
|
63
|
-
"data-kumo-component": "Radio",
|
|
64
|
-
"data-kumo-part": "item",
|
|
65
|
-
value,
|
|
66
|
-
disabled,
|
|
67
|
-
className: cn("relative mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full border-0 bg-kumo-base ring-2 focus:ring-kumo-focus focus:outline-none focus-visible:ring-2 focus-visible:ring-kumo-brand", variant === "error" ? "ring-kumo-danger" : "ring-kumo-line", !disabled && variant !== "error" && "group-hover:ring-kumo-hairline focus-visible:outline-offset-3", !disabled && variant === "error" && "focus-visible:outline-offset-3", "data-[checked]:bg-kumo-contrast"),
|
|
68
|
-
children: /* @__PURE__ */ jsx(RadioIndicator, {
|
|
69
|
-
keepMounted: true,
|
|
70
|
-
className: "flex items-center justify-center",
|
|
71
|
-
children: /* @__PURE__ */ jsx("span", { className: "h-2 w-2 rounded-full bg-kumo-base" })
|
|
72
|
-
})
|
|
73
|
-
})]
|
|
74
|
-
});
|
|
75
|
-
return /* @__PURE__ */ jsxs("label", {
|
|
76
|
-
"data-kumo-component": "Radio",
|
|
77
|
-
"data-kumo-part": "item-label",
|
|
78
|
-
className: cn("group relative m-0 inline-flex items-start gap-2", effectiveControlPosition === "end" && "flex-row-reverse justify-end", disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer", className),
|
|
79
|
-
children: [/* @__PURE__ */ jsx(RadioRoot, {
|
|
80
|
-
ref,
|
|
81
|
-
"data-kumo-component": "Radio",
|
|
82
|
-
"data-kumo-part": "item",
|
|
83
|
-
value,
|
|
84
|
-
disabled,
|
|
85
|
-
className: cn("relative mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full border-0 bg-kumo-base ring after:absolute after:-inset-x-3 after:-inset-y-2 focus:outline-none", variant === "error" ? "ring-kumo-danger" : "ring-kumo-line", !disabled && variant !== "error" && "group-hover:ring-kumo-hairline focus:ring-2 focus:ring-kumo-focus focus-visible:ring-2 focus-visible:ring-kumo-brand focus-visible:outline-offset-3", !disabled && variant === "error" && "focus:ring-2 focus:ring-kumo-focus focus-visible:ring-2 focus-visible:ring-kumo-brand focus-visible:outline-offset-3", "data-[checked]:bg-kumo-contrast"),
|
|
86
|
-
children: /* @__PURE__ */ jsx(RadioIndicator, {
|
|
87
|
-
keepMounted: true,
|
|
88
|
-
className: "flex items-center justify-center",
|
|
89
|
-
children: /* @__PURE__ */ jsx("span", { className: "h-2 w-2 rounded-full bg-kumo-base" })
|
|
90
|
-
})
|
|
91
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
92
|
-
className: "text-base text-kumo-default",
|
|
93
|
-
children: label
|
|
94
|
-
})]
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
const RadioItem = forwardRef(_RadioItem);
|
|
98
|
-
RadioItem.displayName = "Radio.Item";
|
|
99
|
-
function RadioLegend({ children, className }) {
|
|
100
|
-
return /* @__PURE__ */ jsx(FieldsetLegend, {
|
|
101
|
-
className: cn("text-base font-medium text-kumo-default", className),
|
|
102
|
-
children
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
RadioLegend.displayName = "Radio.Legend";
|
|
106
|
-
function RadioGroup({ legend, children, orientation = "vertical", appearance = "default", error, description, defaultValue, value, onValueChange, disabled, controlPosition, name, className }) {
|
|
107
|
-
return /* @__PURE__ */ jsx(RadioGroupContext.Provider, {
|
|
108
|
-
value: {
|
|
109
|
-
controlPosition,
|
|
110
|
-
appearance
|
|
111
|
-
},
|
|
112
|
-
children: /* @__PURE__ */ jsx(RadioGroup$1, {
|
|
113
|
-
defaultValue,
|
|
114
|
-
value,
|
|
115
|
-
onValueChange: (newValue, eventDetails) => onValueChange?.(newValue, eventDetails),
|
|
116
|
-
disabled,
|
|
117
|
-
name,
|
|
118
|
-
children: /* @__PURE__ */ jsxs(FieldsetRoot, {
|
|
119
|
-
disabled,
|
|
120
|
-
className: cn("flex flex-col gap-4 p-0", className),
|
|
121
|
-
children: [
|
|
122
|
-
legend && /* @__PURE__ */ jsx(FieldsetLegend, {
|
|
123
|
-
className: "text-base font-medium text-kumo-default",
|
|
124
|
-
children: legend
|
|
125
|
-
}),
|
|
126
|
-
/* @__PURE__ */ jsx("div", {
|
|
127
|
-
className: cn(orientation === "vertical" ? cn("flex flex-col", appearance === "card" ? "gap-3" : "gap-2") : appearance === "card" ? "grid grid-cols-2 gap-3" : "flex flex-row flex-wrap gap-2"),
|
|
128
|
-
children
|
|
129
|
-
}),
|
|
130
|
-
error && /* @__PURE__ */ jsx("p", {
|
|
131
|
-
className: "text-sm text-kumo-danger",
|
|
132
|
-
children: error
|
|
133
|
-
}),
|
|
134
|
-
description && /* @__PURE__ */ jsx("p", {
|
|
135
|
-
className: "text-sm text-kumo-subtle",
|
|
136
|
-
children: description
|
|
137
|
-
})
|
|
138
|
-
]
|
|
139
|
-
})
|
|
140
|
-
})
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
RadioGroup.displayName = "Radio.Group";
|
|
144
|
-
/**
|
|
145
|
-
* Radio — radio button group for single-select choices.
|
|
146
|
-
*
|
|
147
|
-
* Compound component: `Radio.Group` (with built-in Fieldset), `Radio.Item`, and `Radio.Legend`.
|
|
148
|
-
* Built on `@base-ui/react/radio-group` + `@base-ui/react/radio`.
|
|
149
|
-
*
|
|
150
|
-
* @example
|
|
151
|
-
* ```tsx
|
|
152
|
-
* // Simple: legend as a string prop
|
|
153
|
-
* <Radio.Group legend="Notification preference" defaultValue="email">
|
|
154
|
-
* <Radio.Item label="Email" value="email" />
|
|
155
|
-
* <Radio.Item label="SMS" value="sms" />
|
|
156
|
-
* <Radio.Item label="Push" value="push" />
|
|
157
|
-
* </Radio.Group>
|
|
158
|
-
*
|
|
159
|
-
* // Composable: Radio.Legend for full styling control (e.g. visually hidden)
|
|
160
|
-
* <Radio.Group defaultValue="email">
|
|
161
|
-
* <Radio.Legend className="sr-only">Notification preference</Radio.Legend>
|
|
162
|
-
* <Radio.Item label="Email" value="email" />
|
|
163
|
-
* <Radio.Item label="SMS" value="sms" />
|
|
164
|
-
* </Radio.Group>
|
|
165
|
-
* ```
|
|
166
|
-
*/
|
|
167
|
-
const Radio = Object.assign(RadioGroup, {
|
|
168
|
-
Item: RadioItem,
|
|
169
|
-
Group: RadioGroup,
|
|
170
|
-
Legend: RadioLegend
|
|
171
|
-
});
|
|
172
|
-
//#endregion
|
|
173
|
-
export { radioVariants as a, RadioGroup as i, KUMO_RADIO_VARIANTS as n, Radio as r, KUMO_RADIO_DEFAULT_VARIANTS as t };
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { t as areArraysEqual } from "./areArraysEqual-bcx201k1x9ziizym.js";
|
|
3
|
-
import { t as serializeValue } from "./serializeValue-ipcakiw32jb7kany.js";
|
|
4
|
-
import * as React$1 from "react";
|
|
5
|
-
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
//#region ../../node_modules/.pnpm/@base-ui+utils@0.4.0_@types+react@19.2.4_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/utils/useOnFirstRender.mjs
|
|
7
|
-
function useOnFirstRender(fn) {
|
|
8
|
-
const ref = React$1.useRef(true);
|
|
9
|
-
if (ref.current) {
|
|
10
|
-
ref.current = false;
|
|
11
|
-
fn();
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
//#endregion
|
|
15
|
-
//#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/internals/itemEquality.mjs
|
|
16
|
-
const defaultItemEquality = (itemValue, selectedValue) => Object.is(itemValue, selectedValue);
|
|
17
|
-
function compareItemEquality(itemValue, selectedValue, comparer) {
|
|
18
|
-
if (itemValue == null || selectedValue == null) return Object.is(itemValue, selectedValue);
|
|
19
|
-
return comparer(itemValue, selectedValue);
|
|
20
|
-
}
|
|
21
|
-
function isSelectedValueDirty(currentValue, initialValue, comparer) {
|
|
22
|
-
if (Array.isArray(currentValue) && Array.isArray(initialValue)) return !areArraysEqual(currentValue, initialValue, (itemValue, initialItemValue) => compareItemEquality(itemValue, initialItemValue, comparer));
|
|
23
|
-
return currentValue !== initialValue;
|
|
24
|
-
}
|
|
25
|
-
function selectedValueIncludes(selectedValues, itemValue, comparer) {
|
|
26
|
-
if (!selectedValues) return false;
|
|
27
|
-
return selectedValues.some((selectedValue) => {
|
|
28
|
-
if (selectedValue === void 0) return false;
|
|
29
|
-
return compareItemEquality(itemValue, selectedValue, comparer);
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
function findItemIndex(itemValues, selectedValue, comparer) {
|
|
33
|
-
if (!itemValues) return -1;
|
|
34
|
-
return itemValues.findIndex((itemValue) => {
|
|
35
|
-
if (itemValue === void 0) return false;
|
|
36
|
-
return compareItemEquality(itemValue, selectedValue, comparer);
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
function createSelectionMatcher(selectedValues, comparer) {
|
|
40
|
-
if (comparer !== defaultItemEquality) return (itemValue) => selectedValueIncludes(selectedValues, itemValue, comparer);
|
|
41
|
-
const index = new Set(selectedValues);
|
|
42
|
-
index.delete(void 0);
|
|
43
|
-
return (itemValue) => index.has(itemValue) && (itemValue !== 0 || selectedValues.some((v) => Object.is(itemValue, v)));
|
|
44
|
-
}
|
|
45
|
-
function findSelectionIndex(itemValues, selectedValue, comparer, multiple) {
|
|
46
|
-
const index = multiple && Array.isArray(selectedValue) ? itemValues.findIndex(createSelectionMatcher(selectedValue, comparer)) : findItemIndex(itemValues, selectedValue, comparer);
|
|
47
|
-
return index === -1 ? null : index;
|
|
48
|
-
}
|
|
49
|
-
/** Resolves the first selected index as items register or change. */
|
|
50
|
-
function resolveSelectedIndex(index, itemValue, registry, selectedValues, comparer, currentIndex) {
|
|
51
|
-
if (selectedValueIncludes(selectedValues, itemValue, comparer)) return currentIndex != null && index > currentIndex && selectedValueIncludes(selectedValues, registry[currentIndex], comparer) ? currentIndex : index;
|
|
52
|
-
return index === currentIndex ? findSelectionIndex(registry, selectedValues, comparer, true) : currentIndex;
|
|
53
|
-
}
|
|
54
|
-
function removeItem(selectedValues, itemValue, comparer) {
|
|
55
|
-
return selectedValues.filter((selectedValue) => !compareItemEquality(itemValue, selectedValue, comparer));
|
|
56
|
-
}
|
|
57
|
-
//#endregion
|
|
58
|
-
//#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/internals/resolveValueLabel.mjs
|
|
59
|
-
function isGroup(item) {
|
|
60
|
-
return typeof item === "object" && item != null && Array.isArray(item.items);
|
|
61
|
-
}
|
|
62
|
-
function isGroupedItems(items) {
|
|
63
|
-
return isGroup(items?.[0]);
|
|
64
|
-
}
|
|
65
|
-
function flattenLeafItems(items) {
|
|
66
|
-
return isGroupedItems(items) ? items.flatMap((group) => group.items) : items;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Checks if the items array contains an item with a null value that has a non-null label.
|
|
70
|
-
*/
|
|
71
|
-
function hasNullItemLabel(items) {
|
|
72
|
-
if (!Array.isArray(items)) return items != null && "null" in items;
|
|
73
|
-
const arrayItems = items;
|
|
74
|
-
if (isGroupedItems(arrayItems)) {
|
|
75
|
-
for (const group of arrayItems) for (const item of group.items) if (item && item.value == null && item.label != null) return true;
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
for (const item of arrayItems) if (item && item.value == null && item.label != null) return true;
|
|
79
|
-
return false;
|
|
80
|
-
}
|
|
81
|
-
function stringifyAsLabel(item, itemToStringLabel) {
|
|
82
|
-
if (itemToStringLabel && item != null) return itemToStringLabel(item) ?? "";
|
|
83
|
-
if (item && typeof item === "object") {
|
|
84
|
-
if ("label" in item && item.label != null) return String(item.label);
|
|
85
|
-
if ("value" in item) return String(item.value);
|
|
86
|
-
}
|
|
87
|
-
return serializeValue(item);
|
|
88
|
-
}
|
|
89
|
-
function stringifyAsValue(item, itemToStringValue) {
|
|
90
|
-
if (itemToStringValue && item != null) return itemToStringValue(item) ?? "";
|
|
91
|
-
if (item && typeof item === "object" && "value" in item && "label" in item) return serializeValue(item.value);
|
|
92
|
-
return serializeValue(item);
|
|
93
|
-
}
|
|
94
|
-
function resolveSelectedLabel(value, items, itemToStringLabel) {
|
|
95
|
-
function fallback() {
|
|
96
|
-
return stringifyAsLabel(value, itemToStringLabel);
|
|
97
|
-
}
|
|
98
|
-
if (itemToStringLabel && value != null) return itemToStringLabel(value);
|
|
99
|
-
if (value && typeof value === "object" && "label" in value && value.label != null) return value.label;
|
|
100
|
-
if (items && !Array.isArray(items)) return (Object.hasOwn(items, value) ? items[value] : void 0) ?? fallback();
|
|
101
|
-
if (Array.isArray(items)) {
|
|
102
|
-
const flatItems = flattenLeafItems(items);
|
|
103
|
-
if (value == null || typeof value !== "object") {
|
|
104
|
-
const match = flatItems.find((item) => item.value === value);
|
|
105
|
-
if (match && match.label != null) return match.label;
|
|
106
|
-
return fallback();
|
|
107
|
-
}
|
|
108
|
-
if ("value" in value) {
|
|
109
|
-
const match = flatItems.find((item) => item && item.value === value.value);
|
|
110
|
-
if (match && match.label != null) return match.label;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
return fallback();
|
|
114
|
-
}
|
|
115
|
-
function resolveMultipleLabels(values, items, itemToStringLabel) {
|
|
116
|
-
return values.reduce((acc, value, index) => {
|
|
117
|
-
if (index > 0) acc.push(", ");
|
|
118
|
-
acc.push(/*#__PURE__*/ jsx(React$1.Fragment, { children: resolveSelectedLabel(value, items, itemToStringLabel) }, index));
|
|
119
|
-
return acc;
|
|
120
|
-
}, []);
|
|
121
|
-
}
|
|
122
|
-
//#endregion
|
|
123
|
-
export { resolveSelectedLabel as a, compareItemEquality as c, findSelectionIndex as d, isSelectedValueDirty as f, useOnFirstRender as g, selectedValueIncludes as h, resolveMultipleLabels as i, defaultItemEquality as l, resolveSelectedIndex as m, hasNullItemLabel as n, stringifyAsLabel as o, removeItem as p, isGroupedItems as r, stringifyAsValue as s, flattenLeafItems as t, findItemIndex as u };
|
|
@@ -1,384 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { m as createAttribute } from "./popupTriggerMap-ehv0fuhnmy59j3pn.js";
|
|
3
|
-
import { n as useTimeout, t as Timeout } from "./useTimeout-cpql3c8p250cr093.js";
|
|
4
|
-
import { J as getTarget, Q as isVirtualClick, S as isRootElement, Z as isReactEvent, b as isEventTargetWithin, q as contains, v as ownerDocument } from "./vendor-utils-ecfbsk425x1bm0gh.js";
|
|
5
|
-
import { n as webkit } from "./engine-g5egnkub1ikv3wvy.js";
|
|
6
|
-
import { A as isShadowRoot, C as getParentNode, D as isLastTraversableNode, E as isHTMLElement, T as isElement, b as getComputedStyle } from "./vendor-floating-ui-fqblx3wa0r71mjoo.js";
|
|
7
|
-
import { N as triggerPress, T as outsidePress, l as escapeKey } from "./reason-parts-m5ishukzeux3q0pc.js";
|
|
8
|
-
import { t as createChangeEventDetails } from "./createBaseUIEventDetails-3ob3qgs95ffm8l0w.js";
|
|
9
|
-
import { t as addEventListener } from "./addEventListener-l40nxvf06iukgvnj.js";
|
|
10
|
-
import { t as mergeCleanups } from "./mergeCleanups-ix8l84cgutsbotpd.js";
|
|
11
|
-
import { t as useStableCallback } from "./useStableCallback-b1i1ghzd9k75bb85.js";
|
|
12
|
-
import { a as useFloatingTree } from "./FloatingTree-lhdqtlu8s6m66n7l.js";
|
|
13
|
-
import * as React$1 from "react";
|
|
14
|
-
//#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/floating-ui-react/utils/nodes.mjs
|
|
15
|
-
function getNodeChildren(nodes, id, onlyOpenChildren = true) {
|
|
16
|
-
return nodes.filter((node) => node.parentId === id).flatMap((child) => [...!onlyOpenChildren || child.context?.open ? [child] : [], ...getNodeChildren(nodes, child.id, onlyOpenChildren)]);
|
|
17
|
-
}
|
|
18
|
-
function getNodeAncestors(nodes, id) {
|
|
19
|
-
let allAncestors = [];
|
|
20
|
-
let currentParentId = nodes.find((node) => node.id === id)?.parentId;
|
|
21
|
-
while (currentParentId) {
|
|
22
|
-
const currentNode = nodes.find((node) => node.id === currentParentId);
|
|
23
|
-
currentParentId = currentNode?.parentId;
|
|
24
|
-
if (currentNode) allAncestors = allAncestors.concat(currentNode);
|
|
25
|
-
}
|
|
26
|
-
return allAncestors;
|
|
27
|
-
}
|
|
28
|
-
//#endregion
|
|
29
|
-
//#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/floating-ui-react/hooks/useDismiss.mjs
|
|
30
|
-
function alwaysFalse() {
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
function normalizeProp(normalizable) {
|
|
34
|
-
return {
|
|
35
|
-
escapeKey: typeof normalizable === "boolean" ? normalizable : normalizable?.escapeKey ?? false,
|
|
36
|
-
outsidePress: typeof normalizable === "boolean" ? normalizable : normalizable?.outsidePress ?? true
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Closes the floating element when a dismissal is requested — by default, when
|
|
41
|
-
* the user presses the `escape` key or outside of the floating element.
|
|
42
|
-
* @see https://floating-ui.com/docs/useDismiss
|
|
43
|
-
*/
|
|
44
|
-
function useDismiss(context, props = {}) {
|
|
45
|
-
const { enabled = true, escapeKey: escapeKey$1 = true, outsidePress: outsidePressProp = true, outsidePressEvent = "sloppy", referencePress = alwaysFalse, bubbles, externalTree } = props;
|
|
46
|
-
const store = "rootStore" in context ? context.rootStore : context;
|
|
47
|
-
const open = store.useState("open");
|
|
48
|
-
const floatingElement = store.useState("floatingElement");
|
|
49
|
-
const { dataRef, events } = store.context;
|
|
50
|
-
const tree = useFloatingTree(externalTree);
|
|
51
|
-
const outsidePressFn = useStableCallback(typeof outsidePressProp === "function" ? outsidePressProp : () => false);
|
|
52
|
-
const outsidePress$1 = typeof outsidePressProp === "function" ? outsidePressFn : outsidePressProp;
|
|
53
|
-
const outsidePressEnabled = outsidePress$1 !== false;
|
|
54
|
-
const getOutsidePressEventProp = useStableCallback(() => outsidePressEvent);
|
|
55
|
-
const { escapeKey: escapeKeyBubbles, outsidePress: outsidePressBubbles } = normalizeProp(bubbles);
|
|
56
|
-
const pressStartedInsideRef = React$1.useRef(false);
|
|
57
|
-
const pressStartPreventedRef = React$1.useRef(false);
|
|
58
|
-
const suppressNextOutsideClickRef = React$1.useRef(false);
|
|
59
|
-
const sawPressWhileOpenRef = React$1.useRef(false);
|
|
60
|
-
const isComposingRef = React$1.useRef(false);
|
|
61
|
-
const currentPointerTypeRef = React$1.useRef("");
|
|
62
|
-
const touchStateRef = React$1.useRef(null);
|
|
63
|
-
const cancelDismissOnEndTimeout = useTimeout();
|
|
64
|
-
const clearInsideReactTreeTimeout = useTimeout();
|
|
65
|
-
const clearInsideReactTree = useStableCallback(() => {
|
|
66
|
-
clearInsideReactTreeTimeout.clear();
|
|
67
|
-
dataRef.current.insideReactTree = false;
|
|
68
|
-
});
|
|
69
|
-
const hasBlockingChild = useStableCallback((bubbleKey) => {
|
|
70
|
-
const nodeId = dataRef.current.floatingContext?.nodeId;
|
|
71
|
-
return (tree ? getNodeChildren(tree.nodesRef.current, nodeId) : []).some((child) => child.context?.open && !child.context.dataRef.current[bubbleKey]);
|
|
72
|
-
});
|
|
73
|
-
const isEventWithinOwnElements = useStableCallback((event) => {
|
|
74
|
-
return isEventTargetWithin(event, store.select("floatingElement")) || isEventTargetWithin(event, store.select("domReferenceElement"));
|
|
75
|
-
});
|
|
76
|
-
const closeOnReferencePress = useStableCallback((event) => {
|
|
77
|
-
if (!referencePress()) return;
|
|
78
|
-
store.setOpen(false, createChangeEventDetails(triggerPress, event.nativeEvent));
|
|
79
|
-
});
|
|
80
|
-
const closeOnEscapeKeyDown = useStableCallback((event) => {
|
|
81
|
-
if (!open || !enabled || !escapeKey$1 || event.key !== "Escape") return;
|
|
82
|
-
if (isComposingRef.current) return;
|
|
83
|
-
if (!escapeKeyBubbles && hasBlockingChild("__escapeKeyBubbles")) return;
|
|
84
|
-
const native = isReactEvent(event) ? event.nativeEvent : event;
|
|
85
|
-
const eventDetails = createChangeEventDetails(escapeKey, native);
|
|
86
|
-
store.setOpen(false, eventDetails);
|
|
87
|
-
if (!eventDetails.isCanceled) event.preventDefault();
|
|
88
|
-
if (!escapeKeyBubbles && !eventDetails.isPropagationAllowed) event.stopPropagation();
|
|
89
|
-
});
|
|
90
|
-
const markInsideReactTree = useStableCallback(() => {
|
|
91
|
-
dataRef.current.insideReactTree = true;
|
|
92
|
-
clearInsideReactTreeTimeout.start(0, clearInsideReactTree);
|
|
93
|
-
});
|
|
94
|
-
const markPressStartedInsideReactTree = useStableCallback((event) => {
|
|
95
|
-
if (!open || !enabled || event.button !== 0) return;
|
|
96
|
-
const target = getTarget(event.nativeEvent);
|
|
97
|
-
if (!contains(store.select("floatingElement"), target)) return;
|
|
98
|
-
if (!pressStartedInsideRef.current) {
|
|
99
|
-
pressStartedInsideRef.current = true;
|
|
100
|
-
pressStartPreventedRef.current = false;
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
const markInsidePressStartPrevented = useStableCallback((event) => {
|
|
104
|
-
if (!open || !enabled) return;
|
|
105
|
-
if (!(event.defaultPrevented || event.nativeEvent.defaultPrevented)) return;
|
|
106
|
-
if (pressStartedInsideRef.current) pressStartPreventedRef.current = true;
|
|
107
|
-
});
|
|
108
|
-
React$1.useEffect(() => {
|
|
109
|
-
function handleOpenChange(details) {
|
|
110
|
-
if (!details.open) sawPressWhileOpenRef.current = false;
|
|
111
|
-
}
|
|
112
|
-
events.on("openchange", handleOpenChange);
|
|
113
|
-
return () => {
|
|
114
|
-
events.off("openchange", handleOpenChange);
|
|
115
|
-
};
|
|
116
|
-
}, [events]);
|
|
117
|
-
React$1.useEffect(() => {
|
|
118
|
-
if (!open || !enabled) {
|
|
119
|
-
if (!open) sawPressWhileOpenRef.current = false;
|
|
120
|
-
return clearInsideReactTree;
|
|
121
|
-
}
|
|
122
|
-
dataRef.current.__escapeKeyBubbles = escapeKeyBubbles;
|
|
123
|
-
dataRef.current.__outsidePressBubbles = outsidePressBubbles;
|
|
124
|
-
const compositionTimeout = new Timeout();
|
|
125
|
-
const preventedPressSuppressionTimeout = new Timeout();
|
|
126
|
-
const doc = ownerDocument(floatingElement);
|
|
127
|
-
function handleCompositionStart() {
|
|
128
|
-
compositionTimeout.clear();
|
|
129
|
-
isComposingRef.current = true;
|
|
130
|
-
}
|
|
131
|
-
function handleCompositionEnd() {
|
|
132
|
-
compositionTimeout.start(webkit ? 5 : 0, () => {
|
|
133
|
-
isComposingRef.current = false;
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
function suppressImmediateOutsideClickAfterPreventedStart() {
|
|
137
|
-
suppressNextOutsideClickRef.current = true;
|
|
138
|
-
preventedPressSuppressionTimeout.start(0, () => {
|
|
139
|
-
suppressNextOutsideClickRef.current = false;
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
function resetPressStartState() {
|
|
143
|
-
pressStartedInsideRef.current = false;
|
|
144
|
-
pressStartPreventedRef.current = false;
|
|
145
|
-
}
|
|
146
|
-
function getOutsidePressEvent() {
|
|
147
|
-
const type = currentPointerTypeRef.current;
|
|
148
|
-
const computedType = type === "pen" || !type ? "mouse" : type;
|
|
149
|
-
const outsidePressEventValue = getOutsidePressEventProp();
|
|
150
|
-
const resolved = typeof outsidePressEventValue === "function" ? outsidePressEventValue() : outsidePressEventValue;
|
|
151
|
-
if (typeof resolved === "string") return resolved;
|
|
152
|
-
return resolved[computedType];
|
|
153
|
-
}
|
|
154
|
-
function shouldIgnoreEvent(event) {
|
|
155
|
-
const computedOutsidePressEvent = getOutsidePressEvent();
|
|
156
|
-
return computedOutsidePressEvent === "intentional" && event.type !== "click" || computedOutsidePressEvent === "sloppy" && event.type === "click";
|
|
157
|
-
}
|
|
158
|
-
function isEventWithinFloatingTree(event) {
|
|
159
|
-
const nodeId = dataRef.current.floatingContext?.nodeId;
|
|
160
|
-
const targetIsInsideChildren = tree && getNodeChildren(tree.nodesRef.current, nodeId).some((node) => isEventTargetWithin(event, node.context?.elements.floating));
|
|
161
|
-
return isEventWithinOwnElements(event) || targetIsInsideChildren;
|
|
162
|
-
}
|
|
163
|
-
function closeOnPressOutside(event) {
|
|
164
|
-
if (shouldIgnoreEvent(event)) {
|
|
165
|
-
if (event.type !== "click" && !isEventWithinOwnElements(event)) {
|
|
166
|
-
preventedPressSuppressionTimeout.clear();
|
|
167
|
-
suppressNextOutsideClickRef.current = false;
|
|
168
|
-
}
|
|
169
|
-
clearInsideReactTree();
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
if (dataRef.current.insideReactTree) {
|
|
173
|
-
clearInsideReactTree();
|
|
174
|
-
return;
|
|
175
|
-
}
|
|
176
|
-
const target = getTarget(event);
|
|
177
|
-
const inertSelector = `[${createAttribute("inert")}]`;
|
|
178
|
-
const targetRoot = isElement(target) ? target.getRootNode() : null;
|
|
179
|
-
const markers = Array.from((isShadowRoot(targetRoot) ? targetRoot : ownerDocument(store.select("floatingElement"))).querySelectorAll(inertSelector));
|
|
180
|
-
const triggers = store.context.triggerElements;
|
|
181
|
-
if (target && (triggers.hasElement(target) || triggers.hasMatchingElement((trigger) => contains(trigger, target)))) return;
|
|
182
|
-
let targetRootAncestor = isElement(target) ? target : null;
|
|
183
|
-
while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) {
|
|
184
|
-
const nextParent = getParentNode(targetRootAncestor);
|
|
185
|
-
if (isLastTraversableNode(nextParent) || !isElement(nextParent)) break;
|
|
186
|
-
targetRootAncestor = nextParent;
|
|
187
|
-
}
|
|
188
|
-
if (markers.length && isElement(target) && !isRootElement(target) && !contains(target, store.select("floatingElement")) && markers.every((marker) => !contains(targetRootAncestor, marker))) return;
|
|
189
|
-
if (isHTMLElement(target) && !("touches" in event)) {
|
|
190
|
-
const lastTraversableNode = isLastTraversableNode(target);
|
|
191
|
-
const style = getComputedStyle(target);
|
|
192
|
-
const scrollRe = /auto|scroll/;
|
|
193
|
-
const isScrollableX = lastTraversableNode || scrollRe.test(style.overflowX);
|
|
194
|
-
const isScrollableY = lastTraversableNode || scrollRe.test(style.overflowY);
|
|
195
|
-
const canScrollX = isScrollableX && target.clientWidth > 0 && target.scrollWidth > target.clientWidth;
|
|
196
|
-
const canScrollY = isScrollableY && target.clientHeight > 0 && target.scrollHeight > target.clientHeight;
|
|
197
|
-
const isRTL = style.direction === "rtl";
|
|
198
|
-
const pressedVerticalScrollbar = canScrollY && (isRTL ? event.offsetX <= target.offsetWidth - target.clientWidth : event.offsetX > target.clientWidth);
|
|
199
|
-
const pressedHorizontalScrollbar = canScrollX && event.offsetY > target.clientHeight;
|
|
200
|
-
if (pressedVerticalScrollbar || pressedHorizontalScrollbar) return;
|
|
201
|
-
}
|
|
202
|
-
if (isEventWithinFloatingTree(event)) return;
|
|
203
|
-
if (getOutsidePressEvent() === "intentional") {
|
|
204
|
-
if (event.detail !== 0 && !isVirtualClick(event) && !sawPressWhileOpenRef.current) return;
|
|
205
|
-
if (suppressNextOutsideClickRef.current) {
|
|
206
|
-
preventedPressSuppressionTimeout.clear();
|
|
207
|
-
suppressNextOutsideClickRef.current = false;
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
if (typeof outsidePress$1 === "function" && !outsidePress$1(event)) return;
|
|
212
|
-
if (hasBlockingChild("__outsidePressBubbles")) return;
|
|
213
|
-
store.setOpen(false, createChangeEventDetails(outsidePress, event));
|
|
214
|
-
clearInsideReactTree();
|
|
215
|
-
}
|
|
216
|
-
function handlePointerDown(event) {
|
|
217
|
-
if (getOutsidePressEvent() !== "sloppy" || event.pointerType === "touch" || !store.select("open") || !enabled || isEventWithinOwnElements(event)) return;
|
|
218
|
-
closeOnPressOutside(event);
|
|
219
|
-
}
|
|
220
|
-
function handleTouchStart(event) {
|
|
221
|
-
if (getOutsidePressEvent() !== "sloppy" || !store.select("open") || !enabled || isEventWithinOwnElements(event)) return;
|
|
222
|
-
const touch = event.touches[0];
|
|
223
|
-
if (touch) {
|
|
224
|
-
touchStateRef.current = {
|
|
225
|
-
startTime: Date.now(),
|
|
226
|
-
startX: touch.clientX,
|
|
227
|
-
startY: touch.clientY,
|
|
228
|
-
dismissOnTouchEnd: false,
|
|
229
|
-
dismissOnMouseDown: true
|
|
230
|
-
};
|
|
231
|
-
cancelDismissOnEndTimeout.start(1e3, () => {
|
|
232
|
-
if (touchStateRef.current) {
|
|
233
|
-
touchStateRef.current.dismissOnTouchEnd = false;
|
|
234
|
-
touchStateRef.current.dismissOnMouseDown = false;
|
|
235
|
-
}
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
function addTargetEventListenerOnce(event, listener) {
|
|
240
|
-
const target = getTarget(event);
|
|
241
|
-
if (!target) return;
|
|
242
|
-
const unsubscribe = addEventListener(target, event.type, () => {
|
|
243
|
-
listener(event);
|
|
244
|
-
unsubscribe();
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
function handleTouchStartCapture(event) {
|
|
248
|
-
currentPointerTypeRef.current = "touch";
|
|
249
|
-
addTargetEventListenerOnce(event, handleTouchStart);
|
|
250
|
-
}
|
|
251
|
-
function closeOnPressOutsideCapture(event) {
|
|
252
|
-
cancelDismissOnEndTimeout.clear();
|
|
253
|
-
if (event.type === "pointerdown") {
|
|
254
|
-
if (event.button === 0) sawPressWhileOpenRef.current = true;
|
|
255
|
-
currentPointerTypeRef.current = event.pointerType;
|
|
256
|
-
}
|
|
257
|
-
if (event.type === "mousedown" && touchStateRef.current && !touchStateRef.current.dismissOnMouseDown) return;
|
|
258
|
-
addTargetEventListenerOnce(event, (targetEvent) => {
|
|
259
|
-
if (targetEvent.type === "pointerdown") handlePointerDown(targetEvent);
|
|
260
|
-
else closeOnPressOutside(targetEvent);
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
function handlePressEndCapture(event) {
|
|
264
|
-
if (event.type === "pointercancel") sawPressWhileOpenRef.current = false;
|
|
265
|
-
if (!pressStartedInsideRef.current) return;
|
|
266
|
-
const pressStartedInsideDefaultPrevented = pressStartPreventedRef.current;
|
|
267
|
-
resetPressStartState();
|
|
268
|
-
if (getOutsidePressEvent() !== "intentional") return;
|
|
269
|
-
if (event.type === "pointercancel") {
|
|
270
|
-
if (pressStartedInsideDefaultPrevented) suppressImmediateOutsideClickAfterPreventedStart();
|
|
271
|
-
return;
|
|
272
|
-
}
|
|
273
|
-
if (isEventWithinFloatingTree(event)) return;
|
|
274
|
-
if (pressStartedInsideDefaultPrevented) {
|
|
275
|
-
suppressImmediateOutsideClickAfterPreventedStart();
|
|
276
|
-
return;
|
|
277
|
-
}
|
|
278
|
-
if (typeof outsidePress$1 === "function" && !outsidePress$1(event)) return;
|
|
279
|
-
preventedPressSuppressionTimeout.clear();
|
|
280
|
-
suppressNextOutsideClickRef.current = true;
|
|
281
|
-
clearInsideReactTree();
|
|
282
|
-
}
|
|
283
|
-
function handleTouchMove(event) {
|
|
284
|
-
if (getOutsidePressEvent() !== "sloppy" || !touchStateRef.current || isEventWithinOwnElements(event)) return;
|
|
285
|
-
const touch = event.touches[0];
|
|
286
|
-
if (!touch) return;
|
|
287
|
-
const deltaX = Math.abs(touch.clientX - touchStateRef.current.startX);
|
|
288
|
-
const deltaY = Math.abs(touch.clientY - touchStateRef.current.startY);
|
|
289
|
-
const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
|
|
290
|
-
if (distance > 5) touchStateRef.current.dismissOnTouchEnd = true;
|
|
291
|
-
if (distance > 10) {
|
|
292
|
-
closeOnPressOutside(event);
|
|
293
|
-
cancelDismissOnEndTimeout.clear();
|
|
294
|
-
touchStateRef.current = null;
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
function handleTouchMoveCapture(event) {
|
|
298
|
-
addTargetEventListenerOnce(event, handleTouchMove);
|
|
299
|
-
}
|
|
300
|
-
function handleTouchEnd(event) {
|
|
301
|
-
if (getOutsidePressEvent() !== "sloppy" || !touchStateRef.current || isEventWithinOwnElements(event)) return;
|
|
302
|
-
if (touchStateRef.current.dismissOnTouchEnd) closeOnPressOutside(event);
|
|
303
|
-
cancelDismissOnEndTimeout.clear();
|
|
304
|
-
touchStateRef.current = null;
|
|
305
|
-
}
|
|
306
|
-
function handleTouchEndCapture(event) {
|
|
307
|
-
addTargetEventListenerOnce(event, handleTouchEnd);
|
|
308
|
-
}
|
|
309
|
-
const unsubscribe = mergeCleanups(escapeKey$1 && mergeCleanups(addEventListener(doc, "keydown", closeOnEscapeKeyDown), addEventListener(doc, "compositionstart", handleCompositionStart), addEventListener(doc, "compositionend", handleCompositionEnd)), outsidePressEnabled && mergeCleanups(addEventListener(doc, "click", closeOnPressOutsideCapture, true), addEventListener(doc, "pointerdown", closeOnPressOutsideCapture, true), addEventListener(doc, "pointerup", handlePressEndCapture, true), addEventListener(doc, "pointercancel", handlePressEndCapture, true), addEventListener(doc, "mousedown", closeOnPressOutsideCapture, true), addEventListener(doc, "mouseup", handlePressEndCapture, true), addEventListener(doc, "touchstart", handleTouchStartCapture, {
|
|
310
|
-
capture: true,
|
|
311
|
-
passive: true
|
|
312
|
-
}), addEventListener(doc, "touchmove", handleTouchMoveCapture, {
|
|
313
|
-
capture: true,
|
|
314
|
-
passive: true
|
|
315
|
-
}), addEventListener(doc, "touchend", handleTouchEndCapture, {
|
|
316
|
-
capture: true,
|
|
317
|
-
passive: true
|
|
318
|
-
})));
|
|
319
|
-
return () => {
|
|
320
|
-
unsubscribe();
|
|
321
|
-
compositionTimeout.clear();
|
|
322
|
-
preventedPressSuppressionTimeout.clear();
|
|
323
|
-
resetPressStartState();
|
|
324
|
-
suppressNextOutsideClickRef.current = false;
|
|
325
|
-
clearInsideReactTree();
|
|
326
|
-
};
|
|
327
|
-
}, [
|
|
328
|
-
dataRef,
|
|
329
|
-
floatingElement,
|
|
330
|
-
escapeKey$1,
|
|
331
|
-
outsidePressEnabled,
|
|
332
|
-
outsidePress$1,
|
|
333
|
-
open,
|
|
334
|
-
enabled,
|
|
335
|
-
escapeKeyBubbles,
|
|
336
|
-
outsidePressBubbles,
|
|
337
|
-
closeOnEscapeKeyDown,
|
|
338
|
-
clearInsideReactTree,
|
|
339
|
-
getOutsidePressEventProp,
|
|
340
|
-
hasBlockingChild,
|
|
341
|
-
isEventWithinOwnElements,
|
|
342
|
-
tree,
|
|
343
|
-
store,
|
|
344
|
-
cancelDismissOnEndTimeout
|
|
345
|
-
]);
|
|
346
|
-
const reference = React$1.useMemo(() => ({
|
|
347
|
-
onKeyDown: closeOnEscapeKeyDown,
|
|
348
|
-
onPointerDown: closeOnReferencePress,
|
|
349
|
-
onClick: closeOnReferencePress
|
|
350
|
-
}), [closeOnEscapeKeyDown, closeOnReferencePress]);
|
|
351
|
-
const floating = React$1.useMemo(() => ({
|
|
352
|
-
onKeyDown: closeOnEscapeKeyDown,
|
|
353
|
-
onPointerDown: markInsidePressStartPrevented,
|
|
354
|
-
onMouseDown: markInsidePressStartPrevented,
|
|
355
|
-
onClickCapture: markInsideReactTree,
|
|
356
|
-
onMouseDownCapture(event) {
|
|
357
|
-
markInsideReactTree();
|
|
358
|
-
markPressStartedInsideReactTree(event);
|
|
359
|
-
},
|
|
360
|
-
onPointerDownCapture(event) {
|
|
361
|
-
markInsideReactTree();
|
|
362
|
-
markPressStartedInsideReactTree(event);
|
|
363
|
-
},
|
|
364
|
-
onMouseUpCapture: markInsideReactTree,
|
|
365
|
-
onTouchEndCapture: markInsideReactTree,
|
|
366
|
-
onTouchMoveCapture: markInsideReactTree
|
|
367
|
-
}), [
|
|
368
|
-
closeOnEscapeKeyDown,
|
|
369
|
-
markInsideReactTree,
|
|
370
|
-
markPressStartedInsideReactTree,
|
|
371
|
-
markInsidePressStartPrevented
|
|
372
|
-
]);
|
|
373
|
-
return React$1.useMemo(() => enabled ? {
|
|
374
|
-
reference,
|
|
375
|
-
floating,
|
|
376
|
-
trigger: reference
|
|
377
|
-
} : {}, [
|
|
378
|
-
enabled,
|
|
379
|
-
reference,
|
|
380
|
-
floating
|
|
381
|
-
]);
|
|
382
|
-
}
|
|
383
|
-
//#endregion
|
|
384
|
-
export { getNodeAncestors as n, getNodeChildren as r, useDismiss as t };
|