@fldr/ui 0.0.0-stage → 0.1.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 +2366 -0
- package/LICENSE +21 -0
- package/README.md +488 -2
- package/ai/USAGE.md +216 -0
- package/ai/component-registry.json +8694 -0
- package/ai/component-registry.md +11933 -0
- package/ai/schemas.ts +1239 -0
- package/bin/kumo.js +36 -0
- package/dist/.build-complete +1 -0
- package/dist/ai/schemas.d.ts +3229 -0
- package/dist/ai/schemas.js +5963 -0
- package/dist/blocks-source/delete-resource/delete-resource.test.tsx +21 -0
- package/dist/blocks-source/delete-resource/delete-resource.tsx +219 -0
- package/dist/blocks-source/page-header/page-header.tsx +99 -0
- package/dist/blocks-source/resource-list/resource-list.test.tsx +28 -0
- package/dist/blocks-source/resource-list/resource-list.tsx +66 -0
- package/dist/button-DzavLWXm.d.ts +227 -0
- package/dist/catalog.d.ts +380 -0
- package/dist/catalog.js +387 -0
- package/dist/chunks/AccordionPanelDataAttributes-mmrmkky28u1010l5.js +457 -0
- package/dist/chunks/AlertDialogTrigger-l1r1gbxcky1xq889.js +24 -0
- package/dist/chunks/AlertDialogTriggerDataAttributes-go49qon601catpgn.js +56 -0
- package/dist/chunks/AutocompleteItem-36ysm5nwbsd0snr6.js +70 -0
- package/dist/chunks/AutocompleteItemDataAttributes-n5rigpf0s9ylnwi3.js +232 -0
- package/dist/chunks/AutocompleteSeparator-bnqeqh7i983d92gx.js +12 -0
- package/dist/chunks/AvatarImageDataAttributes-jw70u384c83lhqfp.js +247 -0
- package/dist/chunks/ButtonDataAttributes-nceand1fi7lvnmkb.js +35 -0
- package/dist/chunks/CSPContext-iv67i0qqhihg8mur.js +11 -0
- package/dist/chunks/CSPProvider-finau3a8hnc9o2td.js +24 -0
- package/dist/chunks/CheckboxGroup-581mfftu99wvjb3a.js +190 -0
- package/dist/chunks/CheckboxGroupContext-jf1bt3znvqlhrql6.js +10 -0
- package/dist/chunks/CheckboxGroupDataAttributes-nskqcxts64symbvf.js +10 -0
- package/dist/chunks/CheckboxIndicator-i13dmhacfgqo328c.js +414 -0
- package/dist/chunks/CheckboxIndicatorDataAttributes-3p29ju7nkczz1l2y.js +85 -0
- package/dist/chunks/CollapsiblePanel-md5suzmtnsyz1kab.js +178 -0
- package/dist/chunks/CollapsibleRootDataAttributes-bynmgxmt4jikaoha.js +36 -0
- package/dist/chunks/ComboboxClear-ioejwvtnmqanph88.js +294 -0
- package/dist/chunks/ComboboxClearDataAttributes-lo0enstdmrqpywsy.js +402 -0
- package/dist/chunks/ComboboxEmpty-gkt1y5b81a4983v7.js +1950 -0
- package/dist/chunks/ComboboxItemIndicatorDataAttributes-iku7l9ig0ve09an4.js +259 -0
- package/dist/chunks/ComboboxPopup-n8cbgys9st446j1i.js +205 -0
- package/dist/chunks/CompositeItem-kepwg8jtvgap06o6.js +20 -0
- package/dist/chunks/CompositeList-gwuaf6d14s4da0j0.js +182 -0
- package/dist/chunks/CompositeListContext-bejvmlu39hsfjzgu.js +15 -0
- package/dist/chunks/CompositeRoot-dnlkb27uw4g5aocf.js +223 -0
- package/dist/chunks/CompositeRootContext-obm54j7y6s86qwhq.js +12 -0
- package/dist/chunks/ContextMenuTriggerDataAttributes-xwozccynxv6pk5s0.js +237 -0
- package/dist/chunks/DialogBackdropDataAttributes-jwqxd6jla03xh8ke.js +28 -0
- package/dist/chunks/DialogCloseDataAttributes-12m7gwh3i6fd7d05.js +76 -0
- package/dist/chunks/DialogPopup-n6w7b389e7bs0472.js +133 -0
- package/dist/chunks/DialogRoot-hkkqj7vcjpkx8qk8.js +16 -0
- package/dist/chunks/DialogTrigger-kpugfkbfswqrus4u.js +142 -0
- package/dist/chunks/DialogTriggerDataAttributes-bp9bu13cvwuddh5b.js +18 -0
- package/dist/chunks/DialogViewportDataAttributes-mma9emv1edsc1vuy.js +78 -0
- package/dist/chunks/DirectionContext-kpby968j030psajn.js +10 -0
- package/dist/chunks/DirectionProvider-cg0pwzgdyg6r73r6.js +21 -0
- package/dist/chunks/DrawerViewport-mzqpwvqtylnad8ib.js +1532 -0
- package/dist/chunks/DrawerViewportDataAttributes-dd9593zm9fl9vcsm.js +1072 -0
- package/dist/chunks/FieldControl-hjj2tcqruozadgdi.js +122 -0
- package/dist/chunks/FieldDescription-orix2gepowrp5ni4.js +122 -0
- package/dist/chunks/FieldItemContext-ohsf45im6xhpay40.js +10 -0
- package/dist/chunks/FieldItemDataAttributes-m52srx69pispz49i.js +283 -0
- package/dist/chunks/FieldLabel-fjc7tdis7rcbq8o4.js +353 -0
- package/dist/chunks/FieldsetLegend-gl9z9eezr0xg9zr7.js +61 -0
- package/dist/chunks/FieldsetLegendDataAttributes-fn20251jxjqkpkxm.js +17 -0
- package/dist/chunks/FieldsetRootContext-fphwizvcm55ydg94.js +12 -0
- package/dist/chunks/FloatingPortalLite-j7dsy7gokbxdoe1i.js +25 -0
- package/dist/chunks/FloatingRootStore-men6ufp3a2b296fh.js +840 -0
- package/dist/chunks/FloatingTree-kiyzavvaum442o1s.js +115 -0
- package/dist/chunks/Form-oz425k7r4abea8o4.js +113 -0
- package/dist/chunks/FormContext-jv19engyccpf6xcl.js +18 -0
- package/dist/chunks/Input-ozudotydd679ly63.js +20 -0
- package/dist/chunks/InputDataAttributes-oy8t6q5y5t8ik02j.js +42 -0
- package/dist/chunks/ItemIndicator-cvf8cw5fv5l3cd8j.js +37 -0
- package/dist/chunks/LabelableContext-dz4wz3lu3lgqusu7.js +135 -0
- package/dist/chunks/ListboxSeparator-skazx18vzzj7i9zp.js +21 -0
- package/dist/chunks/MenuClearDataAttributes-fo0pekd36n56mdxu.js +1645 -0
- package/dist/chunks/MenuSubmenuTrigger-hm5xbgik6aq95x35.js +1976 -0
- package/dist/chunks/MenuSubmenuTriggerDataAttributes-gdfxdjymgmnaxdds.js +372 -0
- package/dist/chunks/MenuTrigger-dlfvicsaggss0o9m.js +265 -0
- package/dist/chunks/Menubar-ja5int05ihjj0ra4.js +116 -0
- package/dist/chunks/MenubarContext-ooz0h08i55c8oip5.js +12 -0
- package/dist/chunks/MeterLabel-cykbkvqys5263z05.js +148 -0
- package/dist/chunks/NavigationMenuIconDataAttributes-l82pkpm61d0meqxf.js +1654 -0
- package/dist/chunks/NullStore-my62xo2vfcfkerri.js +110 -0
- package/dist/chunks/NumberFieldScrubAreaCursorDataAttributes-k2lsbk35svshnwf5.js +1493 -0
- package/dist/chunks/OTPFieldInputDataAttributes-gvgtu2gg85kgjzwr.js +683 -0
- package/dist/chunks/PopoverViewport-peh28i8q4hqfjy97.js +713 -0
- package/dist/chunks/PopoverViewportDataAttributes-gplhq9d7ffp9q8u3.js +329 -0
- package/dist/chunks/PrehydrationScript-hs2je3mndbxuts7w.js +78 -0
- package/dist/chunks/PreviewCardViewportDataAttributes-bgfwmyshey7fx6nr.js +914 -0
- package/dist/chunks/ProgressLabelDataAttributes-j8mutcz11ei0ohvj.js +287 -0
- package/dist/chunks/RadioGroup-kioqngmmuo7a1lfa.js +163 -0
- package/dist/chunks/RadioGroupContext-dr6uihsj7oky0eol.js +10 -0
- package/dist/chunks/RadioGroupDataAttributes-dpdr6xe4ve204qwb.js +10 -0
- package/dist/chunks/RadioIndicator-bhxqih8wzv7hyrec.js +299 -0
- package/dist/chunks/RadioIndicatorDataAttributes-n5yupp5psifu0d4f.js +80 -0
- package/dist/chunks/ScrollAreaThumb-hxig41yn4lrurd3o.js +928 -0
- package/dist/chunks/ScrollAreaThumbDataAttributes-gup5wfxvqye6jj27.js +137 -0
- package/dist/chunks/SelectScrollUpArrowDataAttributes-fce5i1afjkb0necr.js +473 -0
- package/dist/chunks/SelectSeparator-nnak70azojox8b2b.js +1632 -0
- package/dist/chunks/Separator-fhwve0tfny3tht3a.js +24 -0
- package/dist/chunks/SeparatorDataAttributes-ch6e63bas7zflw00.js +11 -0
- package/dist/chunks/SliderIndicator-h1o3qbrvr8x0t4t2.js +1171 -0
- package/dist/chunks/SliderIndicatorDataAttributes-ff2f1cjealif5nvo.js +240 -0
- package/dist/chunks/SwitchRoot-m4t2tq5zn5wibyxk.js +244 -0
- package/dist/chunks/SwitchThumbDataAttributes-f95ld864on9y6ptk.js +90 -0
- package/dist/chunks/TabsList-n5n93rxr4sy704u8.js +664 -0
- package/dist/chunks/TabsListDataAttributes-e03a7kbubuf02z1l.js +183 -0
- package/dist/chunks/ToastArrowDataAttributes-jbnvz3kp6a35slgj.js +136 -0
- package/dist/chunks/ToggleDataAttributes-jl9ojyvwgrvefke6.js +103 -0
- package/dist/chunks/ToggleGroupContext-hg8zbkgqpscqhz83.js +10 -0
- package/dist/chunks/ToggleGroupDataAttributes-n1dwona1alvabstl.js +102 -0
- package/dist/chunks/ToolbarGroupContext-eawva8xkxb4osbxb.js +10 -0
- package/dist/chunks/ToolbarInput-kyxl1be0p3cyuayp.js +174 -0
- package/dist/chunks/ToolbarInputDataAttributes-n4a18a4km735du04.js +150 -0
- package/dist/chunks/ToolbarRootContext-difqbj720teyt8lu.js +12 -0
- package/dist/chunks/TooltipPopup-furysmeyb68uycbz.js +839 -0
- package/dist/chunks/TooltipProvider-hyans0ens4axh1y8.js +61 -0
- package/dist/chunks/TooltipViewportDataAttributes-gkwbezdq40ssuevg.js +312 -0
- package/dist/chunks/adaptiveOriginMiddleware-m9tqzw58wya9sdds.js +51 -0
- package/dist/chunks/addEventListener-ku3x23446prmd1kz.js +13 -0
- package/dist/chunks/areArraysEqual-nnpg93s9g7aqcaoh.js +15 -0
- package/dist/chunks/autocomplete-gdd9aruremdgdvx7.js +152 -0
- package/dist/chunks/badge-gca8xfu79ne55d5k.js +165 -0
- package/dist/chunks/banner-mo1xl9ww734kgsqh.js +269 -0
- package/dist/chunks/bash-jpzh6zbf5237424t.js +3 -0
- package/dist/chunks/breadcrumbs-z1jo40oxlw8e4eh4.js +159 -0
- package/dist/chunks/button-group-biv43ksvaipc3p5n.js +59 -0
- package/dist/chunks/button-hzvowfkbathmx8yg.js +274 -0
- package/dist/chunks/chart-dgh98nbzo2sux2bs.js +3985 -0
- package/dist/chunks/checkbox-eifiwbw34xwsikvf.js +211 -0
- package/dist/chunks/clamp-rcpupxvhqrn8uuyf.js +7 -0
- package/dist/chunks/clipboard-text-oukrnke1s3kebk3y.js +209 -0
- package/dist/chunks/cloudflare-logo-d8mid9xr190h78cu.js +186 -0
- package/dist/chunks/code-nj2nu6qzxhz6qnkk.js +96 -0
- package/dist/chunks/collapsible-ic6813hc4yv5s5hv.js +185 -0
- package/dist/chunks/combobox-mzvobpvalz2gnpli.js +321 -0
- package/dist/chunks/command-palette-d45ueqbuxygu87ir.js +507 -0
- package/dist/chunks/composite-c11t1ok72s3cggjc.js +90 -0
- package/dist/chunks/constants-l10cgj6pyqg27jod.js +5 -0
- package/dist/chunks/core-n0de50o00ej2ecfe.js +7177 -0
- package/dist/chunks/createBaseUIEventDetails-nvee6bghv2reeqdb.js +50 -0
- package/dist/chunks/createItems-n07tfwx89cdoar18.js +323 -0
- package/dist/chunks/createToastManager-cxjmn4jx3ejh85fs.js +1225 -0
- package/dist/chunks/css-j501gxq1am2gnikh.js +4 -0
- package/dist/chunks/date-picker-ija2bz17ai6ypnao.js +6865 -0
- package/dist/chunks/date-range-picker-oivlshld01jbel29.js +336 -0
- package/dist/chunks/dialog-g7wavhkdv2gplwq9.js +173 -0
- package/dist/chunks/diff-g2re0kj6fh27rgg5.js +4 -0
- package/dist/chunks/dropdown-m5a8nwer5hpvnkfk.js +384 -0
- package/dist/chunks/empty-e0onzpyokyl6h9bp.js +96 -0
- package/dist/chunks/engine-hzmefiqm63hu0c7i.js +10 -0
- package/dist/chunks/engine-javascript-e9xj8hhz9xfqhpnu.js +3118 -0
- package/dist/chunks/engine-oniguruma-ias56ildu01gf939.js +389 -0
- package/dist/chunks/error-lbnic2b20qr3mukp.js +6 -0
- package/dist/chunks/field-fowmq5smvp17pnqe.js +75 -0
- package/dist/chunks/flow-fak0fyldoaozd32s.js +10290 -0
- package/dist/chunks/formatNumber-b4kjdsebslm2b3t0.js +21 -0
- package/dist/chunks/getCssDimensions-gckwdrp86f73cv51.js +21 -0
- package/dist/chunks/getElementTransform-cz3jyftv0x5io95f.js +38 -0
- package/dist/chunks/getFiniteAnimations-jwd833ybtz81j5f0.js +13 -0
- package/dist/chunks/getHighlightReason-fhc53kq6qakcct9s.js +15 -0
- package/dist/chunks/getPseudoElementBounds-csuw8kwsoeyxd5tv.js +37 -0
- package/dist/chunks/github-light-hir7yctc38258pwt.js +5 -0
- package/dist/chunks/graphql-n9vlzkvcp2j19p7a.js +16 -0
- package/dist/chunks/grid-nwiczrab3r4w0zr2.js +118 -0
- package/dist/chunks/hcl-ohpfnrffs96hzyj5.js +4 -0
- package/dist/chunks/html-nimj6ljkkifnc9ni.js +12 -0
- package/dist/chunks/index.parts-db9pzsm9rrs9tp0t.js +200 -0
- package/dist/chunks/index.parts-ggacwr0yakuemead.js +24 -0
- package/dist/chunks/index.parts-pcg3pmf3yyro841t.js +13 -0
- package/dist/chunks/inertValue-n09gkjvwwa1kddov.js +9 -0
- package/dist/chunks/inline-copy-text-izxpvnrtebcqlquf.js +104 -0
- package/dist/chunks/input-group-h9fepskc84e1h11n.js +457 -0
- package/dist/chunks/input-kfi46426y22ocoo4.js +85 -0
- package/dist/chunks/input-m2tfec2viezoz9hh.js +146 -0
- package/dist/chunks/isElementDisabled-dyqutxpzdfppbohx.js +7 -0
- package/dist/chunks/itemEquality-ki3x4tzdhjlqjey6.js +56 -0
- package/dist/chunks/javascript-b6fq9bl50fdj6813.js +4 -0
- package/dist/chunks/json-h2g0z143t3cs13d7.js +4 -0
- package/dist/chunks/jsonc-jxlzvingck161eej.js +4 -0
- package/dist/chunks/jsx-jp7a33937sef92sn.js +4 -0
- package/dist/chunks/label-f18fnpbv85jddo4q.js +76 -0
- package/dist/chunks/layer-card-lsmeuqic9i1isv2b.js +74 -0
- package/dist/chunks/layer-dialog-ejtz9s7bbfhjk1md.js +414 -0
- package/dist/chunks/link-h84bkh8eem39p529.js +112 -0
- package/dist/chunks/link-provider-kbwllpbo24fvgioj.js +60 -0
- package/dist/chunks/loader-kv5nk8j8tsuesxqo.js +87 -0
- package/dist/chunks/locale-provider-j4ii538ntyok36r6.js +50 -0
- package/dist/chunks/markdown-eybeqjr58vfygtz1.js +4 -0
- package/dist/chunks/menubar-gzlyhmmc4i24prn1.js +106 -0
- package/dist/chunks/mergeCleanups-nw73c6jfwl5tyhw4.js +15 -0
- package/dist/chunks/meter-poh8jpe0qtq6mvee.js +35 -0
- package/dist/chunks/pagination-lmogkvvtu19mnr7f.js +296 -0
- package/dist/chunks/popover-nqrt3ykqv6sic8pz.js +206 -0
- package/dist/chunks/popupHandle-dk3ixgc8flr7v971.js +177 -0
- package/dist/chunks/popupStoreUtils-czfnxn051xakask5.js +868 -0
- package/dist/chunks/portal-provider-eveknxf26oudn7pp.js +63 -0
- package/dist/chunks/python-nrpnmxq4r6yp6fcd.js +4 -0
- package/dist/chunks/radio-nf717i5ypsga9zdh.js +204 -0
- package/dist/chunks/reason-parts-hssx64rmlxyn6gw5.js +40 -0
- package/dist/chunks/resolve-variant-l6x5ksfrjtu4m66l.js +35 -0
- package/dist/chunks/resolveAriaLabelledBy-knaucrjrjwnk7tvs.js +10 -0
- package/dist/chunks/resolveValueLabel-ntacnb58mhka5gg0.js +70 -0
- package/dist/chunks/rolldown-runtime-hi7ti5xiuxsegr96.js +18 -0
- package/dist/chunks/safePolygon-ep4133qogeu5vjf3.js +661 -0
- package/dist/chunks/safeReact-ek77ilng4ekk7mgz.js +18 -0
- package/dist/chunks/scrollable-k784b35i80aolmvg.js +29 -0
- package/dist/chunks/select-lnekz415wm4v6d6m.js +279 -0
- package/dist/chunks/sensitive-input-dvwlnntm7rdudwp0.js +252 -0
- package/dist/chunks/serializeValue-d1otz2i7h5tygrwf.js +13 -0
- package/dist/chunks/shellscript-i4m7lo8wi0f5bl8b.js +4 -0
- package/dist/chunks/sidebar-mhlgvpawixxoey2k.js +1466 -0
- package/dist/chunks/skeleton-line-kmhnp0lx3rxhioxa.js +74 -0
- package/dist/chunks/slider-e395gihi5cjd62ss.js +87 -0
- package/dist/chunks/sql-hqp2eekl7qhmxe92.js +4 -0
- package/dist/chunks/stringifyLocale-gbxouqj7ol627jxh.js +9 -0
- package/dist/chunks/styles-eb8bvypmayf578jf.js +35 -0
- package/dist/chunks/surface-jr8x5hy0gucjk5ig.js +30 -0
- package/dist/chunks/switch-nc8thi7ogd51m3gi.js +202 -0
- package/dist/chunks/table-ngl1b5yc8mcur662.js +238 -0
- package/dist/chunks/table-of-contents-gkjv9ck8etbz64ej.js +234 -0
- package/dist/chunks/tabs-o59bv7348nh2gppm.js +280 -0
- package/dist/chunks/tag-input-lbx9yzt33d4wu07o.js +156 -0
- package/dist/chunks/text-nqum95flcp07ac9s.js +126 -0
- package/dist/chunks/toast-ljpenshot856xqq4.js +341 -0
- package/dist/chunks/toml-oyqrgosuct25x413.js +4 -0
- package/dist/chunks/toolbar-kh6pc12ii7b6dv1x.js +141 -0
- package/dist/chunks/tooltip-bcymn9bfyz29fvji.js +92 -0
- package/dist/chunks/tsx-pem8x69upvmibv6l.js +4 -0
- package/dist/chunks/typescript-pe5y016phdwbgws7.js +4 -0
- package/dist/chunks/unwrap-lazy-element-hzbdkmujhd7iksau.js +45 -0
- package/dist/chunks/use-copy-feedback-gl55ghst0csvpv4j.js +55 -0
- package/dist/chunks/useAnchoredPopupScrollLock-msm8tzkewysnunut.js +31 -0
- package/dist/chunks/useAnimationFrame-k9lqdj9quln3sd85.js +87 -0
- package/dist/chunks/useAriaLabelledBy-j3j9jqlr9ukyk08s.js +36 -0
- package/dist/chunks/useBaseUiId-nk4k7nj9h1cy76ny.js +13 -0
- package/dist/chunks/useButton-lklvdzuhvj22bx07.js +186 -0
- package/dist/chunks/useClick-pcbkcc7r620v1smu.js +87 -0
- package/dist/chunks/useCollapsiblePanel-lrfsgx21ds36cwlp.js +415 -0
- package/dist/chunks/useCompositeItem-2juex3zh9gyrs8e9.js +31 -0
- package/dist/chunks/useCompositeListItem-ekwo2j2rjkggg7xj.js +54 -0
- package/dist/chunks/useControlled-i3srnkxy598s0au9.js +52 -0
- package/dist/chunks/useFieldValidation-oe16jiigp971yrzr.js +224 -0
- package/dist/chunks/useFloatingRootContext-k676b6m7f80bdapd.js +51 -0
- package/dist/chunks/useFocus-mn7a9t9v6fnlb4mf.js +124 -0
- package/dist/chunks/useId-82z8yqlmc1hy1c5t.js +50 -0
- package/dist/chunks/useInitialLiveRegionTextMutation-nl2hus7zx1h7ggno.js +86 -0
- package/dist/chunks/useLabel-me6zzfvkypo458pi.js +58 -0
- package/dist/chunks/useLabelableId-bjeh6q3pgrqjb7er.js +56 -0
- package/dist/chunks/useListNavigation-hpddbd0cc9pvt461.js +441 -0
- package/dist/chunks/useOnMount-gxggz1m0n869s6r0.js +12 -0
- package/dist/chunks/useOpenChangeComplete-edtabjwqmechsyv6.js +129 -0
- package/dist/chunks/usePopupHandleStore-gawjmfjf1xdgiph3.js +27 -0
- package/dist/chunks/usePopupViewport-l6w01iohvzloghy8.js +367 -0
- package/dist/chunks/usePositioner-mzvgnazldqvy44z2.js +580 -0
- package/dist/chunks/usePressAndHold-k9ynk78pgf677kpx.js +179 -0
- package/dist/chunks/usePreviousValue-o6swt5tb7xhpdu4e.js +21 -0
- package/dist/chunks/useRegisterFieldControl-m1stc9l9y4cndf0k.js +40 -0
- package/dist/chunks/useRegisteredLabelId-b7u9ygya03448zzn.js +16 -0
- package/dist/chunks/useRender-h9ktka9xt4obdv6y.js +13 -0
- package/dist/chunks/useRenderDialogRoot-bsqrqpc1ddau7xg4.js +312 -0
- package/dist/chunks/useRenderElement-nkklxbq1rp7h2kw0.js +436 -0
- package/dist/chunks/useScrollLock-le7ajwlt7oh6fzxi.js +877 -0
- package/dist/chunks/useSetFieldFocused-fbvj7gcv67dqfkp0.js +35 -0
- package/dist/chunks/useStableCallback-le5qgj6p9l04729n.js +38 -0
- package/dist/chunks/useSwipeDismiss-e8tfxzlp05p86mgb.js +697 -0
- package/dist/chunks/useTimeout-f0ayn2l2l9aop4l8.js +43 -0
- package/dist/chunks/useTransitionStatus-disysoblzgk34w14.js +74 -0
- package/dist/chunks/useTriggerFocusGuards-dyd3hb1m8en8ct50.js +40 -0
- package/dist/chunks/useTriggerSwitchTransition-hk5j36hd5dq2ok6w.js +62 -0
- package/dist/chunks/useTypeahead-kfdsw1ksl5bgvvzl.js +111 -0
- package/dist/chunks/useValueAsRef-dv0tmfr1xlpzdlru.js +27 -0
- package/dist/chunks/useValueChanged-fjssa2v6d4w8y332.js +15 -0
- package/dist/chunks/utils-o44zfmzz9z7uyj1v.js +18 -0
- package/dist/chunks/valueToPercent-djk2mqnihth2uvf6.js +7 -0
- package/dist/chunks/vendor-floating-ui-fqblx3wa0r71mjoo.js +1458 -0
- package/dist/chunks/vendor-styling-gs32v7xt5znc8kg0.js +1167 -0
- package/dist/chunks/vendor-utils-io8z5lsfxq8m2dcc.js +660 -0
- package/dist/chunks/vesper-g839e590k3dxnwh3.js +5 -0
- package/dist/chunks/visuallyHidden-kzzs9hbe93is3rci.js +25 -0
- package/dist/chunks/wasm-cpasy0o9lsjrm39j.js +8 -0
- package/dist/chunks/yaml-kzk5ddyekbyha04v.js +4 -0
- package/dist/code/server.d.ts +96 -0
- package/dist/code/server.js +151 -0
- package/dist/code.d.ts +82 -0
- package/dist/code.js +373 -0
- package/dist/command-line/cli.js +1705 -0
- package/dist/command-line/commands/add.js +282 -0
- package/dist/command-line/commands/ai.js +22 -0
- package/dist/command-line/commands/blocks.js +61 -0
- package/dist/command-line/commands/doc.js +167 -0
- package/dist/command-line/commands/init.js +95 -0
- package/dist/command-line/commands/ls.js +53 -0
- package/dist/command-line/commands/theme.js +850 -0
- package/dist/components/autocomplete.d.ts +2 -0
- package/dist/components/autocomplete.js +3 -0
- package/dist/components/badge.d.ts +2 -0
- package/dist/components/badge.js +3 -0
- package/dist/components/banner.d.ts +2 -0
- package/dist/components/banner.js +3 -0
- package/dist/components/breadcrumbs.d.ts +2 -0
- package/dist/components/breadcrumbs.js +3 -0
- package/dist/components/button-group.d.ts +2 -0
- package/dist/components/button-group.js +3 -0
- package/dist/components/button.d.ts +3 -0
- package/dist/components/button.js +3 -0
- package/dist/components/chart.d.ts +2 -0
- package/dist/components/chart.js +3 -0
- package/dist/components/checkbox.d.ts +2 -0
- package/dist/components/checkbox.js +3 -0
- package/dist/components/clipboard-text.d.ts +2 -0
- package/dist/components/clipboard-text.js +3 -0
- package/dist/components/cloudflare-logo.d.ts +2 -0
- package/dist/components/cloudflare-logo.js +3 -0
- package/dist/components/code.d.ts +2 -0
- package/dist/components/code.js +3 -0
- package/dist/components/collapsible.d.ts +2 -0
- package/dist/components/collapsible.js +3 -0
- package/dist/components/combobox.d.ts +2 -0
- package/dist/components/combobox.js +3 -0
- package/dist/components/command-palette.d.ts +2 -0
- package/dist/components/command-palette.js +3 -0
- package/dist/components/date-picker.d.ts +2 -0
- package/dist/components/date-picker.js +3 -0
- package/dist/components/date-range-picker.d.ts +2 -0
- package/dist/components/date-range-picker.js +3 -0
- package/dist/components/dialog.d.ts +2 -0
- package/dist/components/dialog.js +3 -0
- package/dist/components/dropdown.d.ts +2 -0
- package/dist/components/dropdown.js +3 -0
- package/dist/components/empty.d.ts +2 -0
- package/dist/components/empty.js +3 -0
- package/dist/components/field.d.ts +2 -0
- package/dist/components/field.js +3 -0
- package/dist/components/flow.d.ts +2 -0
- package/dist/components/flow.js +3 -0
- package/dist/components/grid.d.ts +2 -0
- package/dist/components/grid.js +3 -0
- 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 +2 -0
- package/dist/components/input-group.js +3 -0
- package/dist/components/input.d.ts +4 -0
- package/dist/components/input.js +5 -0
- package/dist/components/label.d.ts +2 -0
- package/dist/components/label.js +3 -0
- package/dist/components/layer-card.d.ts +2 -0
- package/dist/components/layer-card.js +3 -0
- package/dist/components/layer-dialog.d.ts +2 -0
- package/dist/components/layer-dialog.js +3 -0
- package/dist/components/link.d.ts +67 -0
- package/dist/components/link.js +3 -0
- package/dist/components/loader.d.ts +2 -0
- package/dist/components/loader.js +4 -0
- package/dist/components/menubar.d.ts +2 -0
- package/dist/components/menubar.js +3 -0
- package/dist/components/meter.d.ts +2 -0
- package/dist/components/meter.js +3 -0
- package/dist/components/pagination.d.ts +2 -0
- package/dist/components/pagination.js +3 -0
- package/dist/components/popover.d.ts +2 -0
- package/dist/components/popover.js +3 -0
- package/dist/components/radio.d.ts +2 -0
- package/dist/components/radio.js +3 -0
- package/dist/components/select.d.ts +2 -0
- package/dist/components/select.js +3 -0
- package/dist/components/sensitive-input.d.ts +2 -0
- package/dist/components/sensitive-input.js +3 -0
- package/dist/components/sidebar.d.ts +2 -0
- package/dist/components/sidebar.js +3 -0
- package/dist/components/slider.d.ts +2 -0
- package/dist/components/slider.js +3 -0
- package/dist/components/surface.d.ts +2 -0
- package/dist/components/surface.js +3 -0
- package/dist/components/switch.d.ts +2 -0
- package/dist/components/switch.js +3 -0
- package/dist/components/table-of-contents.d.ts +2 -0
- package/dist/components/table-of-contents.js +3 -0
- package/dist/components/table.d.ts +2 -0
- package/dist/components/table.js +3 -0
- package/dist/components/tabs.d.ts +2 -0
- package/dist/components/tabs.js +3 -0
- package/dist/components/tag-input.d.ts +2 -0
- package/dist/components/tag-input.js +3 -0
- package/dist/components/text.d.ts +2 -0
- package/dist/components/text.js +3 -0
- package/dist/components/toast.d.ts +2 -0
- package/dist/components/toast.js +4 -0
- package/dist/components/toolbar.d.ts +2 -0
- package/dist/components/toolbar.js +3 -0
- package/dist/components/tooltip.d.ts +2 -0
- package/dist/components/tooltip.js +3 -0
- package/dist/config-BKj6nyHa.d.ts +620 -0
- package/dist/field-DIjlHM8W.d.ts +91 -0
- package/dist/index-2jvVmJ8P.d.ts +46 -0
- package/dist/index-5PpauI_2.d.ts +85 -0
- package/dist/index-AMEc1MEg.d.ts +180 -0
- package/dist/index-AUC5xRcO.d.ts +236 -0
- package/dist/index-B7epkoHc.d.ts +72 -0
- package/dist/index-B9-RdY6D.d.ts +75 -0
- package/dist/index-B9niVl3r.d.ts +140 -0
- package/dist/index-BD-gTiEv.d.ts +71 -0
- package/dist/index-BK1tZgmP.d.ts +426 -0
- package/dist/index-BVgXnR1V.d.ts +137 -0
- package/dist/index-BW1HVU7T.d.ts +119 -0
- package/dist/index-BWe6haHU.d.ts +64 -0
- package/dist/index-BkTAB4wj.d.ts +673 -0
- package/dist/index-Bwhwpw_j.d.ts +189 -0
- package/dist/index-BzE0aNpx.d.ts +143 -0
- package/dist/index-C7RoG_CH.d.ts +57 -0
- package/dist/index-CE09bLNb.d.ts +72 -0
- package/dist/index-CJRe-8P-.d.ts +174 -0
- package/dist/index-CReGk3Dc.d.ts +91 -0
- package/dist/index-CU_lnxg7.d.ts +287 -0
- package/dist/index-CYoiniZ4.d.ts +135 -0
- package/dist/index-ClS-eFxE.d.ts +104 -0
- package/dist/index-CzIWigmH.d.ts +62 -0
- package/dist/index-CzTgKPh-.d.ts +105 -0
- package/dist/index-D2Gvly0i.d.ts +96 -0
- package/dist/index-DIV3riUd.d.ts +148 -0
- package/dist/index-DL1-uSuH.d.ts +1 -0
- package/dist/index-DYYiDxZs.d.ts +243 -0
- package/dist/index-DjSGDESy.d.ts +222 -0
- package/dist/index-Dmbgjww7.d.ts +157 -0
- package/dist/index-DwNMa4LN.d.ts +166 -0
- package/dist/index-Dx7hOWUc.d.ts +93 -0
- package/dist/index-DxOyYZaJ.d.ts +251 -0
- package/dist/index-NnHba-T1.d.ts +136 -0
- package/dist/index-RP_rt8vB.d.ts +140 -0
- package/dist/index-T1sSoiWG.d.ts +184 -0
- package/dist/index-aahL-0Zw.d.ts +60 -0
- package/dist/index-bBPKMepR.d.ts +73 -0
- package/dist/index-g-eFm1Bq.d.ts +877 -0
- package/dist/index-gYC6cQVO.d.ts +105 -0
- package/dist/index-lOWfpkxK.d.ts +118 -0
- package/dist/index-pjdgauIH.d.ts +170 -0
- package/dist/index-yK3Hayg_.d.ts +40 -0
- package/dist/index.d.ts +108 -0
- package/dist/index.js +207 -0
- package/dist/input-BeWEb-jD.d.ts +122 -0
- package/dist/input-group-8gEtPiKw.d.ts +100 -0
- package/dist/layer-card-BNIn9pqy.d.ts +56 -0
- package/dist/link-provider-tz-NJp9x.d.ts +67 -0
- package/dist/locale-provider-CHMCQ0-J.d.ts +40 -0
- package/dist/panda.d.ts +25 -0
- package/dist/panda.js +32 -0
- package/dist/portal-provider-BAqPpq_a.d.ts +55 -0
- package/dist/primitives/accordion.d.ts +1 -0
- package/dist/primitives/accordion.js +3 -0
- package/dist/primitives/alert-dialog.d.ts +1 -0
- package/dist/primitives/alert-dialog.js +8 -0
- package/dist/primitives/autocomplete.d.ts +1 -0
- package/dist/primitives/autocomplete.js +6 -0
- package/dist/primitives/avatar.d.ts +1 -0
- package/dist/primitives/avatar.js +3 -0
- package/dist/primitives/button.d.ts +1 -0
- package/dist/primitives/button.js +3 -0
- package/dist/primitives/checkbox-group.d.ts +1 -0
- package/dist/primitives/checkbox-group.js +4 -0
- package/dist/primitives/checkbox.d.ts +1 -0
- package/dist/primitives/checkbox.js +4 -0
- package/dist/primitives/collapsible.d.ts +1 -0
- package/dist/primitives/collapsible.js +5 -0
- package/dist/primitives/combobox.d.ts +1 -0
- package/dist/primitives/combobox.js +6 -0
- package/dist/primitives/context-menu.d.ts +1 -0
- package/dist/primitives/context-menu.js +6 -0
- package/dist/primitives/csp-provider.d.ts +1 -0
- package/dist/primitives/csp-provider.js +3 -0
- package/dist/primitives/dialog.d.ts +1 -0
- package/dist/primitives/dialog.js +9 -0
- package/dist/primitives/direction-provider.d.ts +1 -0
- package/dist/primitives/direction-provider.js +4 -0
- package/dist/primitives/drawer.d.ts +1 -0
- package/dist/primitives/drawer.js +6 -0
- package/dist/primitives/field.d.ts +1 -0
- package/dist/primitives/field.js +4 -0
- package/dist/primitives/fieldset.d.ts +1 -0
- package/dist/primitives/fieldset.js +3 -0
- package/dist/primitives/form.d.ts +1 -0
- package/dist/primitives/form.js +3 -0
- package/dist/primitives/input.d.ts +1 -0
- package/dist/primitives/input.js +4 -0
- package/dist/primitives/menu.d.ts +1 -0
- package/dist/primitives/menu.js +6 -0
- package/dist/primitives/menubar.d.ts +1 -0
- package/dist/primitives/menubar.js +3 -0
- package/dist/primitives/meter.d.ts +1 -0
- package/dist/primitives/meter.js +3 -0
- package/dist/primitives/navigation-menu.d.ts +1 -0
- package/dist/primitives/navigation-menu.js +3 -0
- package/dist/primitives/number-field.d.ts +1 -0
- package/dist/primitives/number-field.js +3 -0
- package/dist/primitives/otp-field.d.ts +3 -0
- package/dist/primitives/otp-field.js +4 -0
- package/dist/primitives/popover.d.ts +1 -0
- package/dist/primitives/popover.js +3 -0
- package/dist/primitives/preview-card.d.ts +1 -0
- package/dist/primitives/preview-card.js +3 -0
- package/dist/primitives/progress.d.ts +1 -0
- package/dist/primitives/progress.js +3 -0
- package/dist/primitives/radio-group.d.ts +1 -0
- package/dist/primitives/radio-group.js +4 -0
- package/dist/primitives/radio.d.ts +1 -0
- package/dist/primitives/radio.js +4 -0
- package/dist/primitives/scroll-area.d.ts +1 -0
- package/dist/primitives/scroll-area.js +4 -0
- package/dist/primitives/select.d.ts +1 -0
- package/dist/primitives/select.js +5 -0
- package/dist/primitives/separator.d.ts +1 -0
- package/dist/primitives/separator.js +4 -0
- package/dist/primitives/slider.d.ts +1 -0
- package/dist/primitives/slider.js +4 -0
- package/dist/primitives/switch.d.ts +1 -0
- package/dist/primitives/switch.js +4 -0
- package/dist/primitives/tabs.d.ts +1 -0
- package/dist/primitives/tabs.js +4 -0
- package/dist/primitives/toast.d.ts +1 -0
- package/dist/primitives/toast.js +5 -0
- package/dist/primitives/toggle-group.d.ts +1 -0
- package/dist/primitives/toggle-group.js +3 -0
- package/dist/primitives/toggle.d.ts +1 -0
- package/dist/primitives/toggle.js +3 -0
- package/dist/primitives/toolbar.d.ts +1 -0
- package/dist/primitives/toolbar.js +3 -0
- package/dist/primitives/tooltip.d.ts +1 -0
- package/dist/primitives/tooltip.js +4 -0
- package/dist/primitives.d.ts +42 -0
- package/dist/primitives.js +71 -0
- package/dist/registry.d.ts +2 -0
- package/dist/registry.js +1 -0
- package/dist/scripts/theme-generator/config.d.ts +2 -0
- package/dist/scripts/theme-generator/config.js +487 -0
- package/dist/scripts/theme-generator/types.d.ts +2 -0
- package/dist/scripts/theme-generator/types.js +1 -0
- package/dist/styles/kumo-binding.css +490 -0
- package/dist/styles/kumo-standalone.css +2 -0
- package/dist/styles/kumo.css +153 -0
- package/dist/styles/theme-fedramp.css +31 -0
- package/dist/styles/theme-fldr.css +67 -0
- package/dist/styles/theme-kumo.css +464 -0
- package/dist/text-CRRU2g-u.d.ts +183 -0
- package/dist/theming.d.ts +185 -0
- package/dist/theming.js +241 -0
- package/dist/tooltip-D_vhi1PN.d.ts +105 -0
- package/dist/types-C6in2C8V.d.ts +135 -0
- package/dist/types-CdzJnnIl.d.ts +193 -0
- package/dist/types-Cl4HuOrB.d.ts +84 -0
- package/dist/utils.d.ts +4 -0
- package/dist/utils.js +7 -0
- package/package.json +483 -3
- package/scripts/component-registry/cache.ts +123 -0
- package/scripts/component-registry/discovery.ts +560 -0
- package/scripts/component-registry/example-cleanup.ts +168 -0
- package/scripts/component-registry/index.test.ts +1075 -0
- package/scripts/component-registry/index.ts +1065 -0
- package/scripts/component-registry/markdown-generator.ts +222 -0
- package/scripts/component-registry/metadata.ts +1030 -0
- package/scripts/component-registry/props-filter.ts +312 -0
- package/scripts/component-registry/schema-generator.ts +333 -0
- package/scripts/component-registry/sub-components.ts +393 -0
- package/scripts/component-registry/types.ts +158 -0
- package/scripts/component-registry/utils.ts +280 -0
- package/scripts/component-registry/variant-parser.ts +262 -0
- package/scripts/css-build.ts +106 -0
- package/scripts/format-generated.ts +12 -0
- package/scripts/generate-globe-land-mask.mjs +80 -0
- package/scripts/generate-primitives.ts +196 -0
- package/scripts/publish-fldr.ts +78 -0
- package/scripts/theme-generator/config.ts +666 -0
- package/scripts/theme-generator/generate-css.test.ts +30 -0
- package/scripts/theme-generator/generate-css.ts +352 -0
- package/scripts/theme-generator/index.ts +165 -0
- package/scripts/theme-generator/migrate.ts +560 -0
- package/scripts/theme-generator/types.ts +92 -0
|
@@ -0,0 +1,877 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { c as NOOP, f as useMergedRefs } from "./useRenderElement-nkklxbq1rp7h2kw0.js";
|
|
3
|
+
import { _ as FocusGuard, g as createAttribute, s as usePortalContext } from "./FloatingRootStore-men6ufp3a2b296fh.js";
|
|
4
|
+
import { n as useIsoLayoutEffect } from "./safeReact-ek77ilng4ekk7mgz.js";
|
|
5
|
+
import { n as useTimeout, t as Timeout } from "./useTimeout-f0ayn2l2l9aop4l8.js";
|
|
6
|
+
import { $ as getTarget, Q as contains, T as isTypeableElement, X as activeElement, Z as closest, a as getPreviousTabbable, at as stopEvent, c as isTabbable, h as isElementVisible, i as getNextTabbable, it as isVirtualPointerEvent, l as tabbable, lt as ios, r as focusable, rt as isVirtualClick, s as isOutsideEvent, v as ownerDocument, w as isTypeableCombobox, y as getFloatingFocusElement } from "./vendor-utils-io8z5lsfxq8m2dcc.js";
|
|
7
|
+
import { n as webkit } from "./engine-hzmefiqm63hu0c7i.js";
|
|
8
|
+
import { A as isShadowRoot, E as isHTMLElement, k as isOverflowElement, w as getWindow, x as getNodeName } from "./vendor-floating-ui-fqblx3wa0r71mjoo.js";
|
|
9
|
+
import { t as createChangeEventDetails } from "./createBaseUIEventDetails-nvee6bghv2reeqdb.js";
|
|
10
|
+
import { u as focusOut } from "./reason-parts-hssx64rmlxyn6gw5.js";
|
|
11
|
+
import { t as addEventListener } from "./addEventListener-ku3x23446prmd1kz.js";
|
|
12
|
+
import { t as mergeCleanups } from "./mergeCleanups-nw73c6jfwl5tyhw4.js";
|
|
13
|
+
import { t as useValueAsRef } from "./useValueAsRef-dv0tmfr1xlpzdlru.js";
|
|
14
|
+
import { t as useStableCallback } from "./useStableCallback-le5qgj6p9l04729n.js";
|
|
15
|
+
import { n as useAnimationFrame, t as AnimationFrame } from "./useAnimationFrame-k9lqdj9quln3sd85.js";
|
|
16
|
+
import { _ as getNodeAncestors, v as getNodeChildren } from "./popupStoreUtils-czfnxn051xakask5.js";
|
|
17
|
+
import { a as useFloatingTree } from "./FloatingTree-kiyzavvaum442o1s.js";
|
|
18
|
+
import { r as resolveRef } from "./useOpenChangeComplete-edtabjwqmechsyv6.js";
|
|
19
|
+
import { t as useValueChanged } from "./useValueChanged-fjssa2v6d4w8y332.js";
|
|
20
|
+
import * as React$1 from "react";
|
|
21
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
22
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/floating-ui-react/utils/enqueueFocus.mjs
|
|
23
|
+
let rafId = 0;
|
|
24
|
+
function enqueueFocus(el, options = {}) {
|
|
25
|
+
const { preventScroll = false, sync = false, shouldFocus } = options;
|
|
26
|
+
cancelAnimationFrame(rafId);
|
|
27
|
+
function exec() {
|
|
28
|
+
if (shouldFocus && !shouldFocus()) return;
|
|
29
|
+
el?.focus({ preventScroll });
|
|
30
|
+
}
|
|
31
|
+
if (sync) {
|
|
32
|
+
exec();
|
|
33
|
+
return NOOP;
|
|
34
|
+
}
|
|
35
|
+
const currentRafId = requestAnimationFrame(exec);
|
|
36
|
+
rafId = currentRafId;
|
|
37
|
+
return () => {
|
|
38
|
+
if (rafId === currentRafId) {
|
|
39
|
+
cancelAnimationFrame(currentRafId);
|
|
40
|
+
rafId = 0;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/floating-ui-react/utils/markOthers.mjs
|
|
46
|
+
const markerName = "data-base-ui-inert";
|
|
47
|
+
let ariaHiddenCounterMap = /* @__PURE__ */ new WeakMap();
|
|
48
|
+
let uncontrolledElementsSet = /* @__PURE__ */ new WeakSet();
|
|
49
|
+
let markerCounterMap = /* @__PURE__ */ new WeakMap();
|
|
50
|
+
let lockCount = 0;
|
|
51
|
+
function unwrapHost(node) {
|
|
52
|
+
if (!node) return null;
|
|
53
|
+
return isShadowRoot(node) ? node.host : unwrapHost(node.parentNode);
|
|
54
|
+
}
|
|
55
|
+
const correctElements = (parent, targets) => targets.map((target) => {
|
|
56
|
+
if (parent.contains(target)) return target;
|
|
57
|
+
const correctedTarget = unwrapHost(target);
|
|
58
|
+
if (parent.contains(correctedTarget)) return correctedTarget;
|
|
59
|
+
return null;
|
|
60
|
+
}).filter((x) => x != null);
|
|
61
|
+
const buildKeepSet = (targets) => {
|
|
62
|
+
const keep = /* @__PURE__ */ new Set();
|
|
63
|
+
targets.forEach((target) => {
|
|
64
|
+
let node = target;
|
|
65
|
+
while (node && !keep.has(node)) {
|
|
66
|
+
keep.add(node);
|
|
67
|
+
node = node.parentNode;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
return keep;
|
|
71
|
+
};
|
|
72
|
+
const collectOutsideElements = (root, keepElements, stopElements) => {
|
|
73
|
+
const outside = [];
|
|
74
|
+
const walk = (parent) => {
|
|
75
|
+
if (!parent || stopElements.has(parent)) return;
|
|
76
|
+
Array.from(parent.children).forEach((node) => {
|
|
77
|
+
if (getNodeName(node) === "script") return;
|
|
78
|
+
if (keepElements.has(node)) walk(node);
|
|
79
|
+
else outside.push(node);
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
walk(root);
|
|
83
|
+
return outside;
|
|
84
|
+
};
|
|
85
|
+
function applyAttributeToOthers(uncorrectedAvoidElements, body, ariaHidden, { mark = true }) {
|
|
86
|
+
const avoidElements = correctElements(body, uncorrectedAvoidElements);
|
|
87
|
+
const markerTargets = mark ? collectOutsideElements(body, buildKeepSet(avoidElements), new Set(avoidElements)) : [];
|
|
88
|
+
const hiddenElements = [];
|
|
89
|
+
const markedElements = [];
|
|
90
|
+
if (ariaHidden) {
|
|
91
|
+
const ariaLiveElements = correctElements(body, Array.from(body.querySelectorAll("[aria-live]")));
|
|
92
|
+
const controlElements = avoidElements.concat(ariaLiveElements);
|
|
93
|
+
collectOutsideElements(body, buildKeepSet(controlElements), new Set(controlElements)).forEach((node) => {
|
|
94
|
+
const attr = node.getAttribute("aria-hidden");
|
|
95
|
+
const alreadyHidden = attr !== null && attr !== "false";
|
|
96
|
+
const counterValue = (ariaHiddenCounterMap.get(node) || 0) + 1;
|
|
97
|
+
ariaHiddenCounterMap.set(node, counterValue);
|
|
98
|
+
hiddenElements.push(node);
|
|
99
|
+
if (counterValue === 1 && alreadyHidden) uncontrolledElementsSet.add(node);
|
|
100
|
+
if (!alreadyHidden) node.setAttribute("aria-hidden", "true");
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
if (mark) markerTargets.forEach((node) => {
|
|
104
|
+
const markerValue = (markerCounterMap.get(node) || 0) + 1;
|
|
105
|
+
markerCounterMap.set(node, markerValue);
|
|
106
|
+
markedElements.push(node);
|
|
107
|
+
if (markerValue === 1) node.setAttribute(markerName, "");
|
|
108
|
+
});
|
|
109
|
+
lockCount += 1;
|
|
110
|
+
return () => {
|
|
111
|
+
hiddenElements.forEach((element) => {
|
|
112
|
+
const counterValue = (ariaHiddenCounterMap.get(element) || 0) - 1;
|
|
113
|
+
ariaHiddenCounterMap.set(element, counterValue);
|
|
114
|
+
if (!counterValue) {
|
|
115
|
+
if (!uncontrolledElementsSet.has(element)) element.removeAttribute("aria-hidden");
|
|
116
|
+
uncontrolledElementsSet.delete(element);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
if (mark) markedElements.forEach((element) => {
|
|
120
|
+
const markerValue = (markerCounterMap.get(element) || 0) - 1;
|
|
121
|
+
markerCounterMap.set(element, markerValue);
|
|
122
|
+
if (!markerValue) element.removeAttribute(markerName);
|
|
123
|
+
});
|
|
124
|
+
lockCount -= 1;
|
|
125
|
+
if (!lockCount) {
|
|
126
|
+
ariaHiddenCounterMap = /* @__PURE__ */ new WeakMap();
|
|
127
|
+
uncontrolledElementsSet = /* @__PURE__ */ new WeakSet();
|
|
128
|
+
markerCounterMap = /* @__PURE__ */ new WeakMap();
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
function markOthers(avoidElements, options = {}) {
|
|
133
|
+
const { ariaHidden = false, mark = true } = options;
|
|
134
|
+
const body = ownerDocument(avoidElements[0]).body;
|
|
135
|
+
return applyAttributeToOthers(avoidElements, body, ariaHidden, { mark });
|
|
136
|
+
}
|
|
137
|
+
//#endregion
|
|
138
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/floating-ui-react/components/FloatingFocusManager.mjs
|
|
139
|
+
function getEventType(event, lastInteractionType) {
|
|
140
|
+
const win = getWindow(getTarget(event));
|
|
141
|
+
if (event instanceof win.KeyboardEvent) return "keyboard";
|
|
142
|
+
if (event instanceof win.FocusEvent) return lastInteractionType || "keyboard";
|
|
143
|
+
if ("pointerType" in event) return event.pointerType || (isVirtualClick(event) ? "keyboard" : lastInteractionType || "mouse");
|
|
144
|
+
if ("touches" in event) return "touch";
|
|
145
|
+
if (event instanceof win.MouseEvent) return lastInteractionType || (event.detail === 0 ? "keyboard" : "mouse");
|
|
146
|
+
return "";
|
|
147
|
+
}
|
|
148
|
+
const LIST_LIMIT = 20;
|
|
149
|
+
let previouslyFocusedElements = [];
|
|
150
|
+
function clearDisconnectedPreviouslyFocusedElements() {
|
|
151
|
+
previouslyFocusedElements = previouslyFocusedElements.filter((entry) => {
|
|
152
|
+
return entry.deref()?.isConnected;
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
function addPreviouslyFocusedElement(element) {
|
|
156
|
+
clearDisconnectedPreviouslyFocusedElements();
|
|
157
|
+
if (element && getNodeName(element) !== "body") {
|
|
158
|
+
previouslyFocusedElements.push(new WeakRef(element));
|
|
159
|
+
if (previouslyFocusedElements.length > LIST_LIMIT) previouslyFocusedElements = previouslyFocusedElements.slice(-20);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
function getPreviouslyFocusedElement() {
|
|
163
|
+
clearDisconnectedPreviouslyFocusedElements();
|
|
164
|
+
return previouslyFocusedElements[previouslyFocusedElements.length - 1]?.deref();
|
|
165
|
+
}
|
|
166
|
+
function getFirstTabbableElement(container) {
|
|
167
|
+
if (!container) return null;
|
|
168
|
+
if (isTabbable(container)) return container;
|
|
169
|
+
return tabbable(container)[0] || container;
|
|
170
|
+
}
|
|
171
|
+
function handleTabIndex(floatingFocusElement) {
|
|
172
|
+
if (floatingFocusElement.hasAttribute("tabindex") && !floatingFocusElement.hasAttribute("data-tabindex")) return;
|
|
173
|
+
if (!floatingFocusElement.getAttribute("role")?.includes("dialog")) return;
|
|
174
|
+
const tabbableContent = focusable(floatingFocusElement).filter((element) => {
|
|
175
|
+
const dataTabIndex = element.getAttribute("data-tabindex") || "";
|
|
176
|
+
return isTabbable(element) || element.hasAttribute("data-tabindex") && !dataTabIndex.startsWith("-");
|
|
177
|
+
});
|
|
178
|
+
const tabIndex = floatingFocusElement.getAttribute("tabindex");
|
|
179
|
+
if (tabbableContent.length === 0) {
|
|
180
|
+
if (tabIndex !== "0") {
|
|
181
|
+
floatingFocusElement.setAttribute("tabindex", "0");
|
|
182
|
+
floatingFocusElement.setAttribute("data-tabindex", "0");
|
|
183
|
+
}
|
|
184
|
+
} else if (tabIndex !== "-1" || floatingFocusElement.hasAttribute("data-tabindex") && floatingFocusElement.getAttribute("data-tabindex") !== "-1") {
|
|
185
|
+
floatingFocusElement.setAttribute("tabindex", "-1");
|
|
186
|
+
floatingFocusElement.setAttribute("data-tabindex", "-1");
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Provides focus management for the floating element.
|
|
191
|
+
* @see https://floating-ui.com/docs/FloatingFocusManager
|
|
192
|
+
* @internal
|
|
193
|
+
*/
|
|
194
|
+
function FloatingFocusManager(props) {
|
|
195
|
+
const { context: store, children, disabled = false, initialFocus = true, returnFocus = true, explicitReturnFocus, restoreFocus = false, modal = true, closeOnFocusOut = true, openInteractionType = "", nextFocusableElement, previousFocusableElement, beforeContentFocusGuardRef, externalTree, getInsideElements } = props;
|
|
196
|
+
const open = store.useState("open");
|
|
197
|
+
const domReference = store.useState("domReferenceElement");
|
|
198
|
+
const floating = store.useState("floatingElement");
|
|
199
|
+
const { events, dataRef } = store.context;
|
|
200
|
+
const getNodeId = useStableCallback(() => dataRef.current.floatingContext?.nodeId);
|
|
201
|
+
const ignoreInitialFocus = initialFocus === false;
|
|
202
|
+
const isUntrappedTypeableCombobox = isTypeableCombobox(domReference) && ignoreInitialFocus;
|
|
203
|
+
const initialFocusRef = useValueAsRef(initialFocus);
|
|
204
|
+
const returnFocusRef = useValueAsRef(returnFocus);
|
|
205
|
+
const explicitReturnFocusRef = useValueAsRef(explicitReturnFocus);
|
|
206
|
+
const openInteractionTypeRef = useValueAsRef(openInteractionType);
|
|
207
|
+
const openRef = useValueAsRef(open);
|
|
208
|
+
const tree = useFloatingTree(externalTree);
|
|
209
|
+
const portalContext = usePortalContext();
|
|
210
|
+
const preventReturnFocusRef = React$1.useRef(false);
|
|
211
|
+
const isPointerDownRef = React$1.useRef(false);
|
|
212
|
+
const pointerDownOutsideRef = React$1.useRef(false);
|
|
213
|
+
const lastFocusedTabbableRef = React$1.useRef(null);
|
|
214
|
+
const closeTypeRef = React$1.useRef("");
|
|
215
|
+
const lastInteractionTypeRef = React$1.useRef("");
|
|
216
|
+
const beforeGuardRef = React$1.useRef(null);
|
|
217
|
+
const afterGuardRef = React$1.useRef(null);
|
|
218
|
+
const mergedBeforeGuardRef = useMergedRefs(beforeGuardRef, beforeContentFocusGuardRef, portalContext?.beforeInsideRef);
|
|
219
|
+
const mergedAfterGuardRef = useMergedRefs(afterGuardRef, portalContext?.afterInsideRef);
|
|
220
|
+
const blurTimeout = useTimeout();
|
|
221
|
+
const pointerDownTimeout = useTimeout();
|
|
222
|
+
const restoreFocusFrame = useAnimationFrame();
|
|
223
|
+
const isInsidePortal = portalContext != null;
|
|
224
|
+
const floatingFocusElement = getFloatingFocusElement(floating);
|
|
225
|
+
const getTabbableContent = useStableCallback((container = floatingFocusElement) => {
|
|
226
|
+
return container ? tabbable(container) : [];
|
|
227
|
+
});
|
|
228
|
+
const getResolvedInsideElements = useStableCallback(() => getInsideElements?.().filter((element) => element != null) ?? []);
|
|
229
|
+
React$1.useEffect(() => {
|
|
230
|
+
if (disabled || !modal) return;
|
|
231
|
+
function onKeyDown(event) {
|
|
232
|
+
if (event.key === "Tab") {
|
|
233
|
+
if (contains(floatingFocusElement, activeElement(ownerDocument(floatingFocusElement))) && getTabbableContent().length === 0 && !isUntrappedTypeableCombobox) stopEvent(event);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
const doc = ownerDocument(floatingFocusElement);
|
|
237
|
+
return addEventListener(doc, "keydown", onKeyDown);
|
|
238
|
+
}, [
|
|
239
|
+
disabled,
|
|
240
|
+
floatingFocusElement,
|
|
241
|
+
modal,
|
|
242
|
+
isUntrappedTypeableCombobox,
|
|
243
|
+
getTabbableContent
|
|
244
|
+
]);
|
|
245
|
+
React$1.useEffect(() => {
|
|
246
|
+
if (disabled || !open) return;
|
|
247
|
+
const doc = ownerDocument(floatingFocusElement);
|
|
248
|
+
function clearPointerDownOutside() {
|
|
249
|
+
pointerDownOutsideRef.current = false;
|
|
250
|
+
}
|
|
251
|
+
function onPointerDown(event) {
|
|
252
|
+
const target = getTarget(event);
|
|
253
|
+
const insideElements = getResolvedInsideElements();
|
|
254
|
+
const pointerTargetInside = contains(floating, target) || contains(domReference, target) || contains(portalContext?.portalNode, target) || insideElements.some((element) => element === target || contains(element, target));
|
|
255
|
+
pointerDownOutsideRef.current = !pointerTargetInside;
|
|
256
|
+
lastInteractionTypeRef.current = event.pointerType || "keyboard";
|
|
257
|
+
if (closest(target, `[data-base-ui-click-trigger]`)) {
|
|
258
|
+
isPointerDownRef.current = true;
|
|
259
|
+
pointerDownTimeout.start(0, () => {
|
|
260
|
+
isPointerDownRef.current = false;
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
function onKeyDown() {
|
|
265
|
+
lastInteractionTypeRef.current = "keyboard";
|
|
266
|
+
}
|
|
267
|
+
return mergeCleanups(addEventListener(doc, "pointerdown", onPointerDown, true), addEventListener(doc, "pointerup", clearPointerDownOutside, true), addEventListener(doc, "pointercancel", clearPointerDownOutside, true), addEventListener(doc, "keydown", onKeyDown, true), clearPointerDownOutside);
|
|
268
|
+
}, [
|
|
269
|
+
disabled,
|
|
270
|
+
floating,
|
|
271
|
+
domReference,
|
|
272
|
+
floatingFocusElement,
|
|
273
|
+
open,
|
|
274
|
+
portalContext,
|
|
275
|
+
pointerDownTimeout,
|
|
276
|
+
getResolvedInsideElements
|
|
277
|
+
]);
|
|
278
|
+
React$1.useEffect(() => {
|
|
279
|
+
if (disabled || !closeOnFocusOut) return;
|
|
280
|
+
const doc = ownerDocument(floatingFocusElement);
|
|
281
|
+
function handlePointerDown() {
|
|
282
|
+
isPointerDownRef.current = true;
|
|
283
|
+
pointerDownTimeout.start(0, () => {
|
|
284
|
+
isPointerDownRef.current = false;
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
function handleFocusIn(event) {
|
|
288
|
+
const target = getTarget(event);
|
|
289
|
+
if (isTabbable(target)) lastFocusedTabbableRef.current = target;
|
|
290
|
+
}
|
|
291
|
+
function handleFocusOutside(event) {
|
|
292
|
+
const relatedTarget = event.relatedTarget;
|
|
293
|
+
const currentTarget = event.currentTarget;
|
|
294
|
+
const target = getTarget(event);
|
|
295
|
+
if (modal && relatedTarget == null && target != null && contains(floating, target)) addPreviouslyFocusedElement(target);
|
|
296
|
+
queueMicrotask(() => {
|
|
297
|
+
const nodeId = getNodeId();
|
|
298
|
+
const triggers = store.context.triggerElements;
|
|
299
|
+
const insideElements = getResolvedInsideElements();
|
|
300
|
+
const isRelatedFocusGuard = relatedTarget?.hasAttribute(createAttribute("focus-guard")) && [
|
|
301
|
+
beforeGuardRef.current,
|
|
302
|
+
afterGuardRef.current,
|
|
303
|
+
portalContext?.beforeInsideRef.current,
|
|
304
|
+
portalContext?.afterInsideRef.current,
|
|
305
|
+
portalContext?.beforeOutsideRef.current,
|
|
306
|
+
portalContext?.afterOutsideRef.current,
|
|
307
|
+
resolveRef(previousFocusableElement),
|
|
308
|
+
resolveRef(nextFocusableElement)
|
|
309
|
+
].includes(relatedTarget);
|
|
310
|
+
const movedToUnrelatedNode = !(contains(domReference, relatedTarget) || contains(floating, relatedTarget) || contains(relatedTarget, floating) || contains(portalContext?.portalNode, relatedTarget) || insideElements.some((element) => element === relatedTarget || contains(element, relatedTarget)) || triggers.hasMatchingElement((trigger) => contains(trigger, relatedTarget)) || isRelatedFocusGuard || tree && (getNodeChildren(tree.nodesRef.current, nodeId).find((node) => contains(node.context?.elements.floating, relatedTarget) || contains(node.context?.elements.domReference, relatedTarget)) || getNodeAncestors(tree.nodesRef.current, nodeId).find((node) => [node.context?.elements.floating, getFloatingFocusElement(node.context?.elements.floating)].includes(relatedTarget) || node.context?.elements.domReference === relatedTarget)));
|
|
311
|
+
if (currentTarget === domReference && floatingFocusElement) handleTabIndex(floatingFocusElement);
|
|
312
|
+
if (restoreFocus && currentTarget !== domReference && !isElementVisible(target) && activeElement(doc) === doc.body) {
|
|
313
|
+
if (isHTMLElement(floatingFocusElement)) {
|
|
314
|
+
floatingFocusElement.focus();
|
|
315
|
+
if (restoreFocus === "popup") {
|
|
316
|
+
restoreFocusFrame.request(() => {
|
|
317
|
+
floatingFocusElement.focus();
|
|
318
|
+
});
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
const tabbableContent = getTabbableContent();
|
|
323
|
+
const prevTabbable = lastFocusedTabbableRef.current;
|
|
324
|
+
const nodeToFocus = (prevTabbable && tabbableContent.includes(prevTabbable) ? prevTabbable : null) || tabbableContent[tabbableContent.length - 1] || floatingFocusElement;
|
|
325
|
+
if (isHTMLElement(nodeToFocus)) nodeToFocus.focus();
|
|
326
|
+
}
|
|
327
|
+
if (dataRef.current.insideReactTree) {
|
|
328
|
+
dataRef.current.insideReactTree = false;
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
if ((isUntrappedTypeableCombobox ? true : !modal) && relatedTarget && movedToUnrelatedNode && !isPointerDownRef.current && (isUntrappedTypeableCombobox || relatedTarget !== getPreviouslyFocusedElement())) {
|
|
332
|
+
preventReturnFocusRef.current = true;
|
|
333
|
+
store.setOpen(false, createChangeEventDetails(focusOut, event));
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
function markInsideReactTree() {
|
|
338
|
+
if (pointerDownOutsideRef.current) return;
|
|
339
|
+
dataRef.current.insideReactTree = true;
|
|
340
|
+
blurTimeout.start(0, () => {
|
|
341
|
+
dataRef.current.insideReactTree = false;
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
const domReferenceElement = isHTMLElement(domReference) ? domReference : null;
|
|
345
|
+
if (!floating && !domReferenceElement) return;
|
|
346
|
+
return mergeCleanups(domReferenceElement && addEventListener(domReferenceElement, "focusout", handleFocusOutside), domReferenceElement && addEventListener(domReferenceElement, "pointerdown", handlePointerDown), floating && addEventListener(floating, "focusin", handleFocusIn), floating && addEventListener(floating, "focusout", handleFocusOutside), floating && portalContext && addEventListener(floating, "focusout", markInsideReactTree, true));
|
|
347
|
+
}, [
|
|
348
|
+
disabled,
|
|
349
|
+
domReference,
|
|
350
|
+
floating,
|
|
351
|
+
floatingFocusElement,
|
|
352
|
+
modal,
|
|
353
|
+
tree,
|
|
354
|
+
portalContext,
|
|
355
|
+
store,
|
|
356
|
+
closeOnFocusOut,
|
|
357
|
+
restoreFocus,
|
|
358
|
+
getTabbableContent,
|
|
359
|
+
isUntrappedTypeableCombobox,
|
|
360
|
+
getNodeId,
|
|
361
|
+
dataRef,
|
|
362
|
+
blurTimeout,
|
|
363
|
+
pointerDownTimeout,
|
|
364
|
+
restoreFocusFrame,
|
|
365
|
+
nextFocusableElement,
|
|
366
|
+
previousFocusableElement,
|
|
367
|
+
getResolvedInsideElements
|
|
368
|
+
]);
|
|
369
|
+
React$1.useEffect(() => {
|
|
370
|
+
if (disabled || !floating || !open) return;
|
|
371
|
+
const portalNodes = Array.from(portalContext?.portalNode?.querySelectorAll(`[${createAttribute("portal")}]`) || []);
|
|
372
|
+
const rootAncestorComboboxDomReference = (tree ? getNodeAncestors(tree.nodesRef.current, getNodeId()) : []).find((node) => isTypeableCombobox(node.context?.elements.domReference || null))?.context?.elements.domReference;
|
|
373
|
+
const ariaHiddenCleanup = markOthers([
|
|
374
|
+
...[
|
|
375
|
+
floating,
|
|
376
|
+
...portalNodes,
|
|
377
|
+
beforeGuardRef.current,
|
|
378
|
+
afterGuardRef.current,
|
|
379
|
+
portalContext?.beforeOutsideRef.current,
|
|
380
|
+
portalContext?.afterOutsideRef.current,
|
|
381
|
+
...getResolvedInsideElements()
|
|
382
|
+
],
|
|
383
|
+
rootAncestorComboboxDomReference,
|
|
384
|
+
resolveRef(previousFocusableElement),
|
|
385
|
+
resolveRef(nextFocusableElement),
|
|
386
|
+
isUntrappedTypeableCombobox ? domReference : null
|
|
387
|
+
].filter((x) => x != null), {
|
|
388
|
+
ariaHidden: modal || isUntrappedTypeableCombobox,
|
|
389
|
+
mark: false
|
|
390
|
+
});
|
|
391
|
+
const markerCleanup = markOthers([floating, ...portalNodes].filter((x) => x != null));
|
|
392
|
+
return () => {
|
|
393
|
+
markerCleanup();
|
|
394
|
+
ariaHiddenCleanup();
|
|
395
|
+
};
|
|
396
|
+
}, [
|
|
397
|
+
open,
|
|
398
|
+
disabled,
|
|
399
|
+
domReference,
|
|
400
|
+
floating,
|
|
401
|
+
modal,
|
|
402
|
+
portalContext,
|
|
403
|
+
isUntrappedTypeableCombobox,
|
|
404
|
+
tree,
|
|
405
|
+
getNodeId,
|
|
406
|
+
nextFocusableElement,
|
|
407
|
+
previousFocusableElement,
|
|
408
|
+
getResolvedInsideElements
|
|
409
|
+
]);
|
|
410
|
+
useIsoLayoutEffect(() => {
|
|
411
|
+
if (!open || disabled || !isHTMLElement(floatingFocusElement)) return;
|
|
412
|
+
closeTypeRef.current = "";
|
|
413
|
+
lastInteractionTypeRef.current = "";
|
|
414
|
+
const doc = ownerDocument(floatingFocusElement);
|
|
415
|
+
const previouslyFocusedElement = activeElement(doc);
|
|
416
|
+
queueMicrotask(() => {
|
|
417
|
+
const initialFocusValueOrFn = initialFocusRef.current;
|
|
418
|
+
const resolvedInitialFocus = typeof initialFocusValueOrFn === "function" ? initialFocusValueOrFn(openInteractionTypeRef.current || "") : initialFocusValueOrFn;
|
|
419
|
+
if (resolvedInitialFocus === void 0 || resolvedInitialFocus === false) return;
|
|
420
|
+
if (contains(floatingFocusElement, previouslyFocusedElement)) return;
|
|
421
|
+
let focusableElements = null;
|
|
422
|
+
const getDefaultFocusElement = () => {
|
|
423
|
+
if (focusableElements == null) focusableElements = getTabbableContent(floatingFocusElement);
|
|
424
|
+
return focusableElements[0] || floatingFocusElement;
|
|
425
|
+
};
|
|
426
|
+
let elToFocus;
|
|
427
|
+
if (resolvedInitialFocus === true || resolvedInitialFocus === null) elToFocus = getDefaultFocusElement();
|
|
428
|
+
else elToFocus = resolveRef(resolvedInitialFocus);
|
|
429
|
+
elToFocus = elToFocus || getDefaultFocusElement();
|
|
430
|
+
const hadFocusInside = contains(floatingFocusElement, activeElement(doc));
|
|
431
|
+
const openEvent = dataRef.current.openEvent;
|
|
432
|
+
const openedByVirtualPress = openEvent?.type === "mousedown" && isVirtualClick(openEvent);
|
|
433
|
+
enqueueFocus(elToFocus, {
|
|
434
|
+
sync: openedByVirtualPress,
|
|
435
|
+
preventScroll: elToFocus === floatingFocusElement,
|
|
436
|
+
shouldFocus() {
|
|
437
|
+
if (!openRef.current) return false;
|
|
438
|
+
if (hadFocusInside) return true;
|
|
439
|
+
const currentActiveElement = activeElement(doc);
|
|
440
|
+
return !(currentActiveElement !== elToFocus && contains(floatingFocusElement, currentActiveElement));
|
|
441
|
+
}
|
|
442
|
+
});
|
|
443
|
+
});
|
|
444
|
+
}, [
|
|
445
|
+
disabled,
|
|
446
|
+
open,
|
|
447
|
+
floatingFocusElement,
|
|
448
|
+
getTabbableContent,
|
|
449
|
+
initialFocusRef,
|
|
450
|
+
openInteractionTypeRef,
|
|
451
|
+
openRef,
|
|
452
|
+
dataRef
|
|
453
|
+
]);
|
|
454
|
+
const pendingReturnFocusRef = React$1.useRef(null);
|
|
455
|
+
useIsoLayoutEffect(() => {
|
|
456
|
+
if (disabled || !floatingFocusElement) {
|
|
457
|
+
pendingReturnFocusRef.current = null;
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
if (pendingReturnFocusRef.current) {
|
|
461
|
+
pendingReturnFocusRef.current.cancelled = true;
|
|
462
|
+
pendingReturnFocusRef.current = null;
|
|
463
|
+
}
|
|
464
|
+
const doc = ownerDocument(floatingFocusElement);
|
|
465
|
+
const elementFocusedBeforeOpen = activeElement(doc);
|
|
466
|
+
const preferPreviousFocus = openInteractionTypeRef.current == null;
|
|
467
|
+
addPreviouslyFocusedElement(elementFocusedBeforeOpen);
|
|
468
|
+
function onOpenChangeLocal(details) {
|
|
469
|
+
if (!details.open) closeTypeRef.current = getEventType(details.nativeEvent, lastInteractionTypeRef.current);
|
|
470
|
+
if (details.reason === "focus-out" && details.triggerElement?.hasAttribute(createAttribute("focus-guard")) || details.reason === "trigger-hover" && details.nativeEvent.type === "mouseleave") preventReturnFocusRef.current = true;
|
|
471
|
+
if (details.reason !== "outside-press") return;
|
|
472
|
+
if (details.nested) preventReturnFocusRef.current = false;
|
|
473
|
+
else if (isVirtualClick(details.nativeEvent) || isVirtualPointerEvent(details.nativeEvent)) preventReturnFocusRef.current = false;
|
|
474
|
+
else {
|
|
475
|
+
let isPreventScrollSupported = false;
|
|
476
|
+
ownerDocument(floatingFocusElement).createElement("div").focus({ get preventScroll() {
|
|
477
|
+
isPreventScrollSupported = true;
|
|
478
|
+
return false;
|
|
479
|
+
} });
|
|
480
|
+
if (isPreventScrollSupported) preventReturnFocusRef.current = false;
|
|
481
|
+
else preventReturnFocusRef.current = true;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
events.on("openchange", onOpenChangeLocal);
|
|
485
|
+
function getReturnElement(closeType) {
|
|
486
|
+
const returnFocusValueOrFn = returnFocusRef.current;
|
|
487
|
+
let resolvedReturnFocusValue = typeof returnFocusValueOrFn === "function" ? returnFocusValueOrFn(closeType) : returnFocusValueOrFn;
|
|
488
|
+
if (resolvedReturnFocusValue === void 0 || resolvedReturnFocusValue === false) return null;
|
|
489
|
+
if (resolvedReturnFocusValue === null) resolvedReturnFocusValue = true;
|
|
490
|
+
const referenceReturnElement = domReference?.isConnected ? domReference : null;
|
|
491
|
+
const previousReturnElement = elementFocusedBeforeOpen?.isConnected && getNodeName(elementFocusedBeforeOpen) !== "body" ? elementFocusedBeforeOpen : null;
|
|
492
|
+
let defaultReturnElement = preferPreviousFocus ? previousReturnElement || referenceReturnElement : referenceReturnElement || previousReturnElement;
|
|
493
|
+
if (!defaultReturnElement) defaultReturnElement = getPreviouslyFocusedElement() || null;
|
|
494
|
+
if (typeof resolvedReturnFocusValue === "boolean") return defaultReturnElement;
|
|
495
|
+
return resolveRef(resolvedReturnFocusValue) || defaultReturnElement || null;
|
|
496
|
+
}
|
|
497
|
+
return () => {
|
|
498
|
+
events.off("openchange", onOpenChangeLocal);
|
|
499
|
+
const activeEl = activeElement(doc);
|
|
500
|
+
const insideElements = getResolvedInsideElements();
|
|
501
|
+
const isFocusInsideFloatingTree = contains(floating, activeEl) || insideElements.some((element) => element === activeEl || contains(element, activeEl)) || tree && getNodeChildren(tree.nodesRef.current, getNodeId(), false).some((node) => contains(node.context?.elements.floating, activeEl));
|
|
502
|
+
const returnFocusValueOrFn = returnFocusRef.current;
|
|
503
|
+
const closeType = closeTypeRef.current;
|
|
504
|
+
const returnElement = getReturnElement(closeType);
|
|
505
|
+
const job = { cancelled: false };
|
|
506
|
+
pendingReturnFocusRef.current = job;
|
|
507
|
+
queueMicrotask(() => {
|
|
508
|
+
if (pendingReturnFocusRef.current === job) pendingReturnFocusRef.current = null;
|
|
509
|
+
const tabbableReturnElement = getFirstTabbableElement(returnElement);
|
|
510
|
+
const hasExplicitReturnFocus = explicitReturnFocusRef.current ?? typeof returnFocusValueOrFn !== "boolean";
|
|
511
|
+
if (!job.cancelled && returnFocusValueOrFn && !preventReturnFocusRef.current && isHTMLElement(tabbableReturnElement) && (!hasExplicitReturnFocus && tabbableReturnElement !== activeEl && activeEl !== doc.body ? isFocusInsideFloatingTree : true)) {
|
|
512
|
+
const focusOptions = { preventScroll: true };
|
|
513
|
+
if (closeType === "keyboard") focusOptions.focusVisible = true;
|
|
514
|
+
tabbableReturnElement.focus(focusOptions);
|
|
515
|
+
}
|
|
516
|
+
preventReturnFocusRef.current = false;
|
|
517
|
+
});
|
|
518
|
+
};
|
|
519
|
+
}, [
|
|
520
|
+
disabled,
|
|
521
|
+
floating,
|
|
522
|
+
floatingFocusElement,
|
|
523
|
+
returnFocusRef,
|
|
524
|
+
explicitReturnFocusRef,
|
|
525
|
+
openInteractionTypeRef,
|
|
526
|
+
events,
|
|
527
|
+
tree,
|
|
528
|
+
domReference,
|
|
529
|
+
getNodeId,
|
|
530
|
+
getResolvedInsideElements
|
|
531
|
+
]);
|
|
532
|
+
useIsoLayoutEffect(() => {
|
|
533
|
+
if (!webkit || open || !floating) return;
|
|
534
|
+
const activeEl = activeElement(ownerDocument(floating));
|
|
535
|
+
if (!isHTMLElement(activeEl) || !isTypeableElement(activeEl)) return;
|
|
536
|
+
if (contains(floating, activeEl)) activeEl.blur();
|
|
537
|
+
}, [open, floating]);
|
|
538
|
+
useIsoLayoutEffect(() => {
|
|
539
|
+
if (disabled || !portalContext) return;
|
|
540
|
+
portalContext.setFocusManagerState({
|
|
541
|
+
modal,
|
|
542
|
+
closeOnFocusOut,
|
|
543
|
+
open,
|
|
544
|
+
onOpenChange: store.setOpen,
|
|
545
|
+
domReference
|
|
546
|
+
});
|
|
547
|
+
return () => {
|
|
548
|
+
portalContext.setFocusManagerState(null);
|
|
549
|
+
};
|
|
550
|
+
}, [
|
|
551
|
+
disabled,
|
|
552
|
+
portalContext,
|
|
553
|
+
modal,
|
|
554
|
+
open,
|
|
555
|
+
store,
|
|
556
|
+
closeOnFocusOut,
|
|
557
|
+
domReference
|
|
558
|
+
]);
|
|
559
|
+
useIsoLayoutEffect(() => {
|
|
560
|
+
if (disabled || !floatingFocusElement) return;
|
|
561
|
+
handleTabIndex(floatingFocusElement);
|
|
562
|
+
return () => {
|
|
563
|
+
queueMicrotask(clearDisconnectedPreviouslyFocusedElements);
|
|
564
|
+
};
|
|
565
|
+
}, [disabled, floatingFocusElement]);
|
|
566
|
+
const shouldRenderGuards = !disabled && (modal ? !isUntrappedTypeableCombobox : true) && (isInsidePortal || modal);
|
|
567
|
+
return /*#__PURE__*/ jsxs(React$1.Fragment, { children: [
|
|
568
|
+
shouldRenderGuards && /*#__PURE__*/ jsx(FocusGuard, {
|
|
569
|
+
"data-type": "inside",
|
|
570
|
+
ref: mergedBeforeGuardRef,
|
|
571
|
+
onFocus: (event) => {
|
|
572
|
+
if (modal) {
|
|
573
|
+
const els = getTabbableContent();
|
|
574
|
+
enqueueFocus(els[els.length - 1]);
|
|
575
|
+
} else if (portalContext?.portalNode) {
|
|
576
|
+
preventReturnFocusRef.current = false;
|
|
577
|
+
if (isOutsideEvent(event, portalContext.portalNode)) getNextTabbable(domReference)?.focus();
|
|
578
|
+
else resolveRef(previousFocusableElement ?? portalContext.beforeOutsideRef)?.focus();
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
}),
|
|
582
|
+
children,
|
|
583
|
+
shouldRenderGuards && /*#__PURE__*/ jsx(FocusGuard, {
|
|
584
|
+
"data-type": "inside",
|
|
585
|
+
ref: mergedAfterGuardRef,
|
|
586
|
+
onFocus: (event) => {
|
|
587
|
+
if (modal) enqueueFocus(getTabbableContent()[0]);
|
|
588
|
+
else if (portalContext?.portalNode) {
|
|
589
|
+
if (closeOnFocusOut) preventReturnFocusRef.current = true;
|
|
590
|
+
if (isOutsideEvent(event, portalContext.portalNode)) getPreviousTabbable(domReference)?.focus();
|
|
591
|
+
else resolveRef(nextFocusableElement ?? portalContext.afterOutsideRef)?.focus();
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
})
|
|
595
|
+
] });
|
|
596
|
+
}
|
|
597
|
+
//#endregion
|
|
598
|
+
//#region ../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.2.4_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/utils/useEnhancedClickHandler.mjs
|
|
599
|
+
/**
|
|
600
|
+
* Provides a cross-browser way to determine the type of the pointer used to click.
|
|
601
|
+
* Safari and Firefox do not provide the PointerEvent to the click handler (they use MouseEvent) yet.
|
|
602
|
+
* Additionally, this implementation detects if the click was triggered by the keyboard.
|
|
603
|
+
*
|
|
604
|
+
* @param handler The function to be called when the button is clicked. The first parameter is the original event and the second parameter is the pointer type.
|
|
605
|
+
*/
|
|
606
|
+
function useEnhancedClickHandler(handler) {
|
|
607
|
+
const lastClickInteractionTypeRef = React$1.useRef("");
|
|
608
|
+
const handlePointerDown = React$1.useCallback((event) => {
|
|
609
|
+
if (event.defaultPrevented) return;
|
|
610
|
+
lastClickInteractionTypeRef.current = event.pointerType;
|
|
611
|
+
handler(event, event.pointerType);
|
|
612
|
+
}, [handler]);
|
|
613
|
+
return {
|
|
614
|
+
onClick: React$1.useCallback((event) => {
|
|
615
|
+
if (event.detail === 0) {
|
|
616
|
+
handler(event, "keyboard");
|
|
617
|
+
return;
|
|
618
|
+
}
|
|
619
|
+
if ("pointerType" in event) handler(event, event.pointerType);
|
|
620
|
+
else handler(event, lastClickInteractionTypeRef.current);
|
|
621
|
+
lastClickInteractionTypeRef.current = "";
|
|
622
|
+
}, [handler]),
|
|
623
|
+
onPointerDown: handlePointerDown
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
//#endregion
|
|
627
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/utils/useOpenInteractionType.mjs
|
|
628
|
+
function useOpenMethodTriggerProps(open, setOpenMethod) {
|
|
629
|
+
const { onClick, onPointerDown } = useEnhancedClickHandler(useStableCallback((_, interactionType) => {
|
|
630
|
+
if (!(typeof open === "function" ? open() : open)) setOpenMethod(interactionType || (ios ? "touch" : ""));
|
|
631
|
+
}));
|
|
632
|
+
return React$1.useMemo(() => ({
|
|
633
|
+
onClick,
|
|
634
|
+
onPointerDown
|
|
635
|
+
}), [onClick, onPointerDown]);
|
|
636
|
+
}
|
|
637
|
+
/**
|
|
638
|
+
* Determines the interaction type (keyboard, mouse, touch, etc.) that opened the component.
|
|
639
|
+
*
|
|
640
|
+
* @param open The open state of the component.
|
|
641
|
+
*/
|
|
642
|
+
function useOpenInteractionType(open) {
|
|
643
|
+
const [openMethod, setOpenMethod] = React$1.useState(null);
|
|
644
|
+
const triggerProps = useOpenMethodTriggerProps(open, setOpenMethod);
|
|
645
|
+
useValueChanged(open, (previousOpen) => {
|
|
646
|
+
if (previousOpen && !open) setOpenMethod(null);
|
|
647
|
+
});
|
|
648
|
+
return React$1.useMemo(() => ({
|
|
649
|
+
openMethod,
|
|
650
|
+
triggerProps
|
|
651
|
+
}), [openMethod, triggerProps]);
|
|
652
|
+
}
|
|
653
|
+
//#endregion
|
|
654
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/utils/InternalBackdrop.mjs
|
|
655
|
+
/**
|
|
656
|
+
* @internal
|
|
657
|
+
*/
|
|
658
|
+
const InternalBackdrop = /*#__PURE__*/ React$1.forwardRef(function InternalBackdrop(props, ref) {
|
|
659
|
+
const { cutout, ...otherProps } = props;
|
|
660
|
+
let clipPath;
|
|
661
|
+
if (cutout) {
|
|
662
|
+
const rect = cutout.getBoundingClientRect();
|
|
663
|
+
clipPath = `polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${rect.left}px ${rect.top}px,${rect.left}px ${rect.bottom}px,${rect.right}px ${rect.bottom}px,${rect.right}px ${rect.top}px,${rect.left}px ${rect.top}px)`;
|
|
664
|
+
}
|
|
665
|
+
return /*#__PURE__*/ jsx("div", {
|
|
666
|
+
ref,
|
|
667
|
+
role: "presentation",
|
|
668
|
+
"data-base-ui-inert": "",
|
|
669
|
+
...otherProps,
|
|
670
|
+
style: {
|
|
671
|
+
position: "fixed",
|
|
672
|
+
inset: 0,
|
|
673
|
+
userSelect: "none",
|
|
674
|
+
WebkitUserSelect: "none",
|
|
675
|
+
clipPath
|
|
676
|
+
}
|
|
677
|
+
});
|
|
678
|
+
});
|
|
679
|
+
InternalBackdrop.displayName = "InternalBackdrop";
|
|
680
|
+
//#endregion
|
|
681
|
+
//#region ../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.2.4_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/utils/useScrollLock.mjs
|
|
682
|
+
let originalHtmlStyles = {};
|
|
683
|
+
let originalBodyStyles = {};
|
|
684
|
+
let originalHtmlScrollBehavior = "";
|
|
685
|
+
function getViewportScroller(html, body) {
|
|
686
|
+
return isOverflowElement(html) ? html : body;
|
|
687
|
+
}
|
|
688
|
+
function isPageScrollLocked(win, html, body) {
|
|
689
|
+
return /hidden|clip/.test(win.getComputedStyle(getViewportScroller(html, body)).overflowY);
|
|
690
|
+
}
|
|
691
|
+
function hasInsetScrollbars(referenceElement) {
|
|
692
|
+
if (typeof document === "undefined") return false;
|
|
693
|
+
const doc = ownerDocument(referenceElement);
|
|
694
|
+
return getWindow(doc).innerWidth - doc.documentElement.clientWidth > 0;
|
|
695
|
+
}
|
|
696
|
+
function supportsStableScrollbarGutter(referenceElement) {
|
|
697
|
+
if (!(typeof CSS !== "undefined" && CSS.supports && CSS.supports("scrollbar-gutter", "stable")) || typeof document === "undefined") return false;
|
|
698
|
+
const doc = ownerDocument(referenceElement);
|
|
699
|
+
const html = doc.documentElement;
|
|
700
|
+
const body = doc.body;
|
|
701
|
+
const scrollContainer = getViewportScroller(html, body);
|
|
702
|
+
const originalScrollContainerOverflowY = scrollContainer.style.overflowY;
|
|
703
|
+
const originalHtmlStyleGutter = html.style.scrollbarGutter;
|
|
704
|
+
html.style.scrollbarGutter = "stable";
|
|
705
|
+
scrollContainer.style.overflowY = "scroll";
|
|
706
|
+
const before = scrollContainer.offsetWidth;
|
|
707
|
+
scrollContainer.style.overflowY = "hidden";
|
|
708
|
+
const after = scrollContainer.offsetWidth;
|
|
709
|
+
scrollContainer.style.overflowY = originalScrollContainerOverflowY;
|
|
710
|
+
html.style.scrollbarGutter = originalHtmlStyleGutter;
|
|
711
|
+
return before === after;
|
|
712
|
+
}
|
|
713
|
+
function preventScrollOverlayScrollbars(referenceElement) {
|
|
714
|
+
const doc = ownerDocument(referenceElement);
|
|
715
|
+
const html = doc.documentElement;
|
|
716
|
+
const body = doc.body;
|
|
717
|
+
const elementToLock = getViewportScroller(html, body);
|
|
718
|
+
const originalElementToLockStyles = {
|
|
719
|
+
overflowY: elementToLock.style.overflowY,
|
|
720
|
+
overflowX: elementToLock.style.overflowX
|
|
721
|
+
};
|
|
722
|
+
Object.assign(elementToLock.style, {
|
|
723
|
+
overflowY: "hidden",
|
|
724
|
+
overflowX: "hidden"
|
|
725
|
+
});
|
|
726
|
+
return () => {
|
|
727
|
+
Object.assign(elementToLock.style, originalElementToLockStyles);
|
|
728
|
+
};
|
|
729
|
+
}
|
|
730
|
+
function preventScrollInsetScrollbars(referenceElement) {
|
|
731
|
+
const doc = ownerDocument(referenceElement);
|
|
732
|
+
const html = doc.documentElement;
|
|
733
|
+
const body = doc.body;
|
|
734
|
+
const win = getWindow(html);
|
|
735
|
+
let scrollTop = 0;
|
|
736
|
+
let scrollLeft = 0;
|
|
737
|
+
let updateGutterOnly = false;
|
|
738
|
+
const resizeFrame = AnimationFrame.create();
|
|
739
|
+
if (webkit && (win.visualViewport?.scale ?? 1) !== 1) return () => {};
|
|
740
|
+
function lockScroll() {
|
|
741
|
+
const htmlStyles = win.getComputedStyle(html);
|
|
742
|
+
const bodyStyles = win.getComputedStyle(body);
|
|
743
|
+
const scrollbarGutterValue = (htmlStyles.scrollbarGutter || "").includes("both-edges") ? "stable both-edges" : "stable";
|
|
744
|
+
scrollTop = html.scrollTop;
|
|
745
|
+
scrollLeft = html.scrollLeft;
|
|
746
|
+
originalHtmlStyles = {
|
|
747
|
+
scrollbarGutter: html.style.scrollbarGutter,
|
|
748
|
+
overflowY: html.style.overflowY,
|
|
749
|
+
overflowX: html.style.overflowX
|
|
750
|
+
};
|
|
751
|
+
originalHtmlScrollBehavior = html.style.scrollBehavior;
|
|
752
|
+
originalBodyStyles = {
|
|
753
|
+
position: body.style.position,
|
|
754
|
+
height: body.style.height,
|
|
755
|
+
width: body.style.width,
|
|
756
|
+
boxSizing: body.style.boxSizing,
|
|
757
|
+
overflowY: body.style.overflowY,
|
|
758
|
+
overflowX: body.style.overflowX,
|
|
759
|
+
scrollBehavior: body.style.scrollBehavior
|
|
760
|
+
};
|
|
761
|
+
const isScrollableY = html.scrollHeight > html.clientHeight;
|
|
762
|
+
const isScrollableX = html.scrollWidth > html.clientWidth;
|
|
763
|
+
const hasConstantOverflowY = htmlStyles.overflowY === "scroll" || bodyStyles.overflowY === "scroll";
|
|
764
|
+
const hasConstantOverflowX = htmlStyles.overflowX === "scroll" || bodyStyles.overflowX === "scroll";
|
|
765
|
+
const scrollbarWidth = Math.max(0, win.innerWidth - body.clientWidth);
|
|
766
|
+
const scrollbarHeight = Math.max(0, win.innerHeight - body.clientHeight);
|
|
767
|
+
const marginY = parseFloat(bodyStyles.marginTop) + parseFloat(bodyStyles.marginBottom);
|
|
768
|
+
const marginX = parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight);
|
|
769
|
+
const elementToLock = getViewportScroller(html, body);
|
|
770
|
+
updateGutterOnly = supportsStableScrollbarGutter(referenceElement);
|
|
771
|
+
if (updateGutterOnly) {
|
|
772
|
+
html.style.scrollbarGutter = scrollbarGutterValue;
|
|
773
|
+
elementToLock.style.overflowY = "hidden";
|
|
774
|
+
elementToLock.style.overflowX = "hidden";
|
|
775
|
+
return;
|
|
776
|
+
}
|
|
777
|
+
Object.assign(html.style, {
|
|
778
|
+
scrollbarGutter: scrollbarGutterValue,
|
|
779
|
+
overflowY: "hidden",
|
|
780
|
+
overflowX: "hidden"
|
|
781
|
+
});
|
|
782
|
+
if (isScrollableY || hasConstantOverflowY) html.style.overflowY = "scroll";
|
|
783
|
+
if (isScrollableX || hasConstantOverflowX) html.style.overflowX = "scroll";
|
|
784
|
+
Object.assign(body.style, {
|
|
785
|
+
position: "relative",
|
|
786
|
+
height: marginY || scrollbarHeight ? `calc(100dvh - ${marginY + scrollbarHeight}px)` : "100dvh",
|
|
787
|
+
width: marginX || scrollbarWidth ? `calc(100vw - ${marginX + scrollbarWidth}px)` : "100vw",
|
|
788
|
+
boxSizing: "border-box",
|
|
789
|
+
overflowY: "hidden",
|
|
790
|
+
overflowX: "hidden",
|
|
791
|
+
scrollBehavior: "unset"
|
|
792
|
+
});
|
|
793
|
+
body.scrollTop = scrollTop;
|
|
794
|
+
body.scrollLeft = scrollLeft;
|
|
795
|
+
html.setAttribute("data-base-ui-scroll-locked", "");
|
|
796
|
+
html.style.scrollBehavior = "unset";
|
|
797
|
+
}
|
|
798
|
+
function cleanup() {
|
|
799
|
+
Object.assign(html.style, originalHtmlStyles);
|
|
800
|
+
Object.assign(body.style, originalBodyStyles);
|
|
801
|
+
if (!updateGutterOnly) {
|
|
802
|
+
html.scrollTop = scrollTop;
|
|
803
|
+
html.scrollLeft = scrollLeft;
|
|
804
|
+
html.removeAttribute("data-base-ui-scroll-locked");
|
|
805
|
+
html.style.scrollBehavior = originalHtmlScrollBehavior;
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
function handleResize() {
|
|
809
|
+
cleanup();
|
|
810
|
+
resizeFrame.request(lockScroll);
|
|
811
|
+
}
|
|
812
|
+
lockScroll();
|
|
813
|
+
const unsubscribeResize = addEventListener(win, "resize", handleResize);
|
|
814
|
+
return () => {
|
|
815
|
+
resizeFrame.cancel();
|
|
816
|
+
cleanup();
|
|
817
|
+
if (typeof win.removeEventListener === "function") unsubscribeResize();
|
|
818
|
+
};
|
|
819
|
+
}
|
|
820
|
+
var ScrollLocker = class {
|
|
821
|
+
lockCount = 0;
|
|
822
|
+
restore = null;
|
|
823
|
+
timeoutLock = Timeout.create();
|
|
824
|
+
timeoutUnlock = Timeout.create();
|
|
825
|
+
acquire(referenceElement) {
|
|
826
|
+
this.lockCount += 1;
|
|
827
|
+
if (this.lockCount === 1 && this.restore === null) this.timeoutLock.start(0, () => this.lock(referenceElement));
|
|
828
|
+
return this.release;
|
|
829
|
+
}
|
|
830
|
+
release = () => {
|
|
831
|
+
this.lockCount -= 1;
|
|
832
|
+
if (this.lockCount === 0 && this.restore) this.timeoutUnlock.start(0, this.unlock);
|
|
833
|
+
};
|
|
834
|
+
unlock = () => {
|
|
835
|
+
if (this.lockCount === 0 && this.restore) {
|
|
836
|
+
this.restore?.();
|
|
837
|
+
this.restore = null;
|
|
838
|
+
}
|
|
839
|
+
};
|
|
840
|
+
lock(referenceElement) {
|
|
841
|
+
if (this.lockCount === 0 || this.restore !== null) return;
|
|
842
|
+
const doc = ownerDocument(referenceElement);
|
|
843
|
+
const html = doc.documentElement;
|
|
844
|
+
const body = doc.body;
|
|
845
|
+
const win = getWindow(html);
|
|
846
|
+
if (isPageScrollLocked(win, html, body)) {
|
|
847
|
+
const observer = new win.MutationObserver(() => {
|
|
848
|
+
if (isPageScrollLocked(win, html, body)) return;
|
|
849
|
+
observer.disconnect();
|
|
850
|
+
this.restore = null;
|
|
851
|
+
this.lock(referenceElement);
|
|
852
|
+
});
|
|
853
|
+
const options = { attributes: true };
|
|
854
|
+
observer.observe(html, options);
|
|
855
|
+
observer.observe(body, options);
|
|
856
|
+
this.restore = () => observer.disconnect();
|
|
857
|
+
return;
|
|
858
|
+
}
|
|
859
|
+
const hasOverlayScrollbars = ios || !hasInsetScrollbars(referenceElement);
|
|
860
|
+
this.restore = hasOverlayScrollbars ? preventScrollOverlayScrollbars(referenceElement) : preventScrollInsetScrollbars(referenceElement);
|
|
861
|
+
}
|
|
862
|
+
};
|
|
863
|
+
const SCROLL_LOCKER = new ScrollLocker();
|
|
864
|
+
/**
|
|
865
|
+
* Locks the scroll of the document when enabled.
|
|
866
|
+
*
|
|
867
|
+
* @param enabled - Whether to enable the scroll lock.
|
|
868
|
+
* @param referenceElement - Element to use as a reference for lock calculations.
|
|
869
|
+
*/
|
|
870
|
+
function useScrollLock(enabled = true, referenceElement = null) {
|
|
871
|
+
useIsoLayoutEffect(() => {
|
|
872
|
+
if (!enabled) return;
|
|
873
|
+
return SCROLL_LOCKER.acquire(referenceElement);
|
|
874
|
+
}, [enabled, referenceElement]);
|
|
875
|
+
}
|
|
876
|
+
//#endregion
|
|
877
|
+
export { useEnhancedClickHandler as a, useOpenMethodTriggerProps as i, InternalBackdrop as n, FloatingFocusManager as o, useOpenInteractionType as r, enqueueFocus as s, useScrollLock as t };
|