@fldr/ui 0.0.0-stage → 0.3.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/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-hp2x28uiufmk3elz.js +94 -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/createBaseUIEventDetails-nvee6bghv2reeqdb.js +50 -0
- package/dist/chunks/createItems-n07tfwx89cdoar18.js +323 -0
- package/dist/chunks/createToastManager-cxjmn4jx3ejh85fs.js +1225 -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/dropdown-m5a8nwer5hpvnkfk.js +384 -0
- package/dist/chunks/empty-e0onzpyokyl6h9bp.js +96 -0
- package/dist/chunks/engine-hzmefiqm63hu0c7i.js +10 -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/grid-nwiczrab3r4w0zr2.js +118 -0
- package/dist/chunks/highlighter-mouttug0tu8xg1i8.js +1364 -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/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/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/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/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/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/toolbar-kh6pc12ii7b6dv1x.js +141 -0
- package/dist/chunks/tooltip-bcymn9bfyz29fvji.js +92 -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/visuallyHidden-kzzs9hbe93is3rci.js +25 -0
- package/dist/code/server.d.ts +11 -0
- package/dist/code/server.js +18 -0
- package/dist/code.d.ts +65 -0
- package/dist/code.js +232 -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/highlighter-BT3TakhJ.d.ts +13 -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-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-CNL6VDYZ.d.ts +138 -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 +491 -0
- package/dist/styles/kumo-standalone.css +2 -0
- package/dist/styles/kumo.css +135 -0
- package/dist/styles/theme-code.css +142 -0
- package/dist/styles/theme-fedramp.css +31 -0
- package/dist/styles/theme-fldr.css +481 -0
- package/dist/styles/theme-kumo.css +464 -0
- package/dist/text-CRRU2g-u.d.ts +183 -0
- package/dist/theming.d.ts +224 -0
- package/dist/theming.js +386 -0
- package/dist/tooltip-D_vhi1PN.d.ts +105 -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 +481 -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 +107 -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 +120 -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 +175 -0
- package/scripts/theme-generator/migrate.ts +560 -0
- package/scripts/theme-generator/types.ts +92 -0
|
@@ -0,0 +1,1458 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { useLayoutEffect } from "react";
|
|
4
|
+
import * as ReactDOM from "react-dom";
|
|
5
|
+
//#region ../../node_modules/.pnpm/@floating-ui+utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
|
|
6
|
+
function hasWindow() {
|
|
7
|
+
return typeof window !== "undefined";
|
|
8
|
+
}
|
|
9
|
+
function getNodeName(node) {
|
|
10
|
+
if (isNode(node)) return (node.nodeName || "").toLowerCase();
|
|
11
|
+
return "#document";
|
|
12
|
+
}
|
|
13
|
+
function getWindow(node) {
|
|
14
|
+
var _node$ownerDocument;
|
|
15
|
+
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
16
|
+
}
|
|
17
|
+
function getDocumentElement(node) {
|
|
18
|
+
var _ref;
|
|
19
|
+
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
20
|
+
}
|
|
21
|
+
function isNode(value) {
|
|
22
|
+
if (!hasWindow()) return false;
|
|
23
|
+
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
24
|
+
}
|
|
25
|
+
function isElement(value) {
|
|
26
|
+
if (!hasWindow()) return false;
|
|
27
|
+
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
28
|
+
}
|
|
29
|
+
function isHTMLElement(value) {
|
|
30
|
+
if (!hasWindow()) return false;
|
|
31
|
+
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
32
|
+
}
|
|
33
|
+
function isShadowRoot(value) {
|
|
34
|
+
if (!hasWindow() || typeof ShadowRoot === "undefined") return false;
|
|
35
|
+
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
36
|
+
}
|
|
37
|
+
function isOverflowElement(element) {
|
|
38
|
+
const { overflow, overflowX, overflowY, display } = getComputedStyle$1(element);
|
|
39
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== "inline" && display !== "contents";
|
|
40
|
+
}
|
|
41
|
+
function isTableElement(element) {
|
|
42
|
+
return /^(table|td|th)$/.test(getNodeName(element));
|
|
43
|
+
}
|
|
44
|
+
function isTopLayer(element) {
|
|
45
|
+
try {
|
|
46
|
+
if (element.matches(":popover-open")) return true;
|
|
47
|
+
} catch (_e) {}
|
|
48
|
+
try {
|
|
49
|
+
return element.matches(":modal");
|
|
50
|
+
} catch (_e) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const willChangeRe = /transform|translate|scale|rotate|perspective|filter/;
|
|
55
|
+
const containRe = /paint|layout|strict|content/;
|
|
56
|
+
const isNotNone = (value) => !!value && value !== "none";
|
|
57
|
+
let isWebKitValue;
|
|
58
|
+
function isContainingBlock(elementOrCss) {
|
|
59
|
+
const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
|
|
60
|
+
return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || "") || containRe.test(css.contain || "");
|
|
61
|
+
}
|
|
62
|
+
function getContainingBlock(element) {
|
|
63
|
+
let currentNode = getParentNode(element);
|
|
64
|
+
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
65
|
+
if (isContainingBlock(currentNode)) return currentNode;
|
|
66
|
+
else if (isTopLayer(currentNode)) return null;
|
|
67
|
+
currentNode = getParentNode(currentNode);
|
|
68
|
+
}
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
function isWebKit() {
|
|
72
|
+
if (isWebKitValue == null) isWebKitValue = typeof CSS !== "undefined" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none");
|
|
73
|
+
return isWebKitValue;
|
|
74
|
+
}
|
|
75
|
+
function isLastTraversableNode(node) {
|
|
76
|
+
return /^(html|body|#document)$/.test(getNodeName(node));
|
|
77
|
+
}
|
|
78
|
+
function getComputedStyle$1(element) {
|
|
79
|
+
return getWindow(element).getComputedStyle(element);
|
|
80
|
+
}
|
|
81
|
+
function getNodeScroll(element) {
|
|
82
|
+
if (isElement(element)) return {
|
|
83
|
+
scrollLeft: element.scrollLeft,
|
|
84
|
+
scrollTop: element.scrollTop
|
|
85
|
+
};
|
|
86
|
+
return {
|
|
87
|
+
scrollLeft: element.scrollX,
|
|
88
|
+
scrollTop: element.scrollY
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function getParentNode(node) {
|
|
92
|
+
if (getNodeName(node) === "html") return node;
|
|
93
|
+
const result = node.assignedSlot || node.parentNode || isShadowRoot(node) && node.host || getDocumentElement(node);
|
|
94
|
+
return isShadowRoot(result) ? result.host : result;
|
|
95
|
+
}
|
|
96
|
+
function getNearestOverflowAncestor(node) {
|
|
97
|
+
const parentNode = getParentNode(node);
|
|
98
|
+
if (isLastTraversableNode(parentNode)) return (node.ownerDocument || node).body;
|
|
99
|
+
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) return parentNode;
|
|
100
|
+
return getNearestOverflowAncestor(parentNode);
|
|
101
|
+
}
|
|
102
|
+
function getOverflowAncestors(node, list, traverseIframes) {
|
|
103
|
+
var _node$ownerDocument2;
|
|
104
|
+
if (list === void 0) list = [];
|
|
105
|
+
if (traverseIframes === void 0) traverseIframes = true;
|
|
106
|
+
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
107
|
+
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
108
|
+
const win = getWindow(scrollableAncestor);
|
|
109
|
+
if (isBody) {
|
|
110
|
+
const frameElement = getFrameElement(win);
|
|
111
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
|
|
112
|
+
} else return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
113
|
+
}
|
|
114
|
+
function getFrameElement(win) {
|
|
115
|
+
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
116
|
+
}
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region ../../node_modules/.pnpm/@floating-ui+utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
119
|
+
const min = Math.min;
|
|
120
|
+
const max = Math.max;
|
|
121
|
+
const round = Math.round;
|
|
122
|
+
const floor = Math.floor;
|
|
123
|
+
const createCoords = (v) => ({
|
|
124
|
+
x: v,
|
|
125
|
+
y: v
|
|
126
|
+
});
|
|
127
|
+
const oppositeSideMap = {
|
|
128
|
+
left: "right",
|
|
129
|
+
right: "left",
|
|
130
|
+
bottom: "top",
|
|
131
|
+
top: "bottom"
|
|
132
|
+
};
|
|
133
|
+
function clamp(start, value, end) {
|
|
134
|
+
return max(start, min(value, end));
|
|
135
|
+
}
|
|
136
|
+
function evaluate(value, param) {
|
|
137
|
+
return typeof value === "function" ? value(param) : value;
|
|
138
|
+
}
|
|
139
|
+
function getSide(placement) {
|
|
140
|
+
return placement.split("-")[0];
|
|
141
|
+
}
|
|
142
|
+
function getAlignment(placement) {
|
|
143
|
+
return placement.split("-")[1];
|
|
144
|
+
}
|
|
145
|
+
function getOppositeAxis(axis) {
|
|
146
|
+
return axis === "x" ? "y" : "x";
|
|
147
|
+
}
|
|
148
|
+
function getAxisLength(axis) {
|
|
149
|
+
return axis === "y" ? "height" : "width";
|
|
150
|
+
}
|
|
151
|
+
function getSideAxis(placement) {
|
|
152
|
+
const firstChar = placement[0];
|
|
153
|
+
return firstChar === "t" || firstChar === "b" ? "y" : "x";
|
|
154
|
+
}
|
|
155
|
+
function getAlignmentAxis(placement) {
|
|
156
|
+
return getOppositeAxis(getSideAxis(placement));
|
|
157
|
+
}
|
|
158
|
+
function getAlignmentSides(placement, rects, rtl) {
|
|
159
|
+
if (rtl === void 0) rtl = false;
|
|
160
|
+
const alignment = getAlignment(placement);
|
|
161
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
162
|
+
const length = getAxisLength(alignmentAxis);
|
|
163
|
+
let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
|
|
164
|
+
if (rects.reference[length] > rects.floating[length]) mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
165
|
+
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
166
|
+
}
|
|
167
|
+
function getExpandedPlacements(placement) {
|
|
168
|
+
const oppositePlacement = getOppositePlacement(placement);
|
|
169
|
+
return [
|
|
170
|
+
getOppositeAlignmentPlacement(placement),
|
|
171
|
+
oppositePlacement,
|
|
172
|
+
getOppositeAlignmentPlacement(oppositePlacement)
|
|
173
|
+
];
|
|
174
|
+
}
|
|
175
|
+
function getOppositeAlignmentPlacement(placement) {
|
|
176
|
+
return placement.includes("start") ? placement.replace("start", "end") : placement.replace("end", "start");
|
|
177
|
+
}
|
|
178
|
+
const lrPlacement = ["left", "right"];
|
|
179
|
+
const rlPlacement = ["right", "left"];
|
|
180
|
+
const tbPlacement = ["top", "bottom"];
|
|
181
|
+
const btPlacement = ["bottom", "top"];
|
|
182
|
+
function getSideList(side, isStart, rtl) {
|
|
183
|
+
switch (side) {
|
|
184
|
+
case "top":
|
|
185
|
+
case "bottom":
|
|
186
|
+
if (rtl) return isStart ? rlPlacement : lrPlacement;
|
|
187
|
+
return isStart ? lrPlacement : rlPlacement;
|
|
188
|
+
case "left":
|
|
189
|
+
case "right": return isStart ? tbPlacement : btPlacement;
|
|
190
|
+
default: return [];
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
194
|
+
const alignment = getAlignment(placement);
|
|
195
|
+
let list = getSideList(getSide(placement), direction === "start", rtl);
|
|
196
|
+
if (alignment) {
|
|
197
|
+
list = list.map((side) => side + "-" + alignment);
|
|
198
|
+
if (flipAlignment) list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
199
|
+
}
|
|
200
|
+
return list;
|
|
201
|
+
}
|
|
202
|
+
function getOppositePlacement(placement) {
|
|
203
|
+
const side = getSide(placement);
|
|
204
|
+
return oppositeSideMap[side] + placement.slice(side.length);
|
|
205
|
+
}
|
|
206
|
+
function expandPaddingObject(padding) {
|
|
207
|
+
var _padding$top, _padding$right, _padding$bottom, _padding$left;
|
|
208
|
+
return {
|
|
209
|
+
top: (_padding$top = padding.top) != null ? _padding$top : 0,
|
|
210
|
+
right: (_padding$right = padding.right) != null ? _padding$right : 0,
|
|
211
|
+
bottom: (_padding$bottom = padding.bottom) != null ? _padding$bottom : 0,
|
|
212
|
+
left: (_padding$left = padding.left) != null ? _padding$left : 0
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
function getPaddingObject(padding) {
|
|
216
|
+
return typeof padding !== "number" ? expandPaddingObject(padding) : {
|
|
217
|
+
top: padding,
|
|
218
|
+
right: padding,
|
|
219
|
+
bottom: padding,
|
|
220
|
+
left: padding
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
function rectToClientRect(rect) {
|
|
224
|
+
const { x, y, width, height } = rect;
|
|
225
|
+
return {
|
|
226
|
+
width,
|
|
227
|
+
height,
|
|
228
|
+
top: y,
|
|
229
|
+
left: x,
|
|
230
|
+
right: x + width,
|
|
231
|
+
bottom: y + height,
|
|
232
|
+
x,
|
|
233
|
+
y
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
//#endregion
|
|
237
|
+
//#region ../../node_modules/.pnpm/@floating-ui+core@1.8.0/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
|
|
238
|
+
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
239
|
+
let { reference, floating } = _ref;
|
|
240
|
+
const sideAxis = getSideAxis(placement);
|
|
241
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
242
|
+
const alignLength = getAxisLength(alignmentAxis);
|
|
243
|
+
const side = getSide(placement);
|
|
244
|
+
const isVertical = sideAxis === "y";
|
|
245
|
+
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
|
246
|
+
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
|
247
|
+
const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
|
|
248
|
+
let coords;
|
|
249
|
+
switch (side) {
|
|
250
|
+
case "top":
|
|
251
|
+
coords = {
|
|
252
|
+
x: commonX,
|
|
253
|
+
y: reference.y - floating.height
|
|
254
|
+
};
|
|
255
|
+
break;
|
|
256
|
+
case "bottom":
|
|
257
|
+
coords = {
|
|
258
|
+
x: commonX,
|
|
259
|
+
y: reference.y + reference.height
|
|
260
|
+
};
|
|
261
|
+
break;
|
|
262
|
+
case "right":
|
|
263
|
+
coords = {
|
|
264
|
+
x: reference.x + reference.width,
|
|
265
|
+
y: commonY
|
|
266
|
+
};
|
|
267
|
+
break;
|
|
268
|
+
case "left":
|
|
269
|
+
coords = {
|
|
270
|
+
x: reference.x - floating.width,
|
|
271
|
+
y: commonY
|
|
272
|
+
};
|
|
273
|
+
break;
|
|
274
|
+
default: coords = {
|
|
275
|
+
x: reference.x,
|
|
276
|
+
y: reference.y
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
const alignment = getAlignment(placement);
|
|
280
|
+
if (alignment) coords[alignmentAxis] += commonAlign * (alignment === "end" ? 1 : -1) * (rtl && isVertical ? -1 : 1);
|
|
281
|
+
return coords;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Resolves with an object of overflow side offsets that determine how much the
|
|
285
|
+
* element is overflowing a given clipping boundary on each side.
|
|
286
|
+
* - positive = overflowing the boundary by that number of pixels
|
|
287
|
+
* - negative = how many pixels left before it will overflow
|
|
288
|
+
* - 0 = lies flush with the boundary
|
|
289
|
+
* @see https://floating-ui.com/docs/detectOverflow
|
|
290
|
+
*/
|
|
291
|
+
async function detectOverflow(state, options) {
|
|
292
|
+
var _await$platform$isEle;
|
|
293
|
+
if (options === void 0) options = {};
|
|
294
|
+
const { x, y, platform, rects, elements, strategy } = state;
|
|
295
|
+
const { boundary = "clippingAncestors", rootBoundary = "viewport", elementContext = "floating", altBoundary = false, padding = 0 } = evaluate(options, state);
|
|
296
|
+
const paddingObject = getPaddingObject(padding);
|
|
297
|
+
const element = elements[altBoundary ? elementContext === "floating" ? "reference" : "floating" : elementContext];
|
|
298
|
+
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
299
|
+
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating)),
|
|
300
|
+
boundary,
|
|
301
|
+
rootBoundary,
|
|
302
|
+
strategy
|
|
303
|
+
}));
|
|
304
|
+
const rect = elementContext === "floating" ? {
|
|
305
|
+
x,
|
|
306
|
+
y,
|
|
307
|
+
width: rects.floating.width,
|
|
308
|
+
height: rects.floating.height
|
|
309
|
+
} : rects.reference;
|
|
310
|
+
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
311
|
+
const offsetScale = await (platform.isElement == null ? void 0 : platform.isElement(offsetParent)) && await (platform.getScale == null ? void 0 : platform.getScale(offsetParent)) || {
|
|
312
|
+
x: 1,
|
|
313
|
+
y: 1
|
|
314
|
+
};
|
|
315
|
+
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
316
|
+
elements,
|
|
317
|
+
rect,
|
|
318
|
+
offsetParent,
|
|
319
|
+
strategy
|
|
320
|
+
}) : rect);
|
|
321
|
+
return {
|
|
322
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
323
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
324
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
325
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
const MAX_RESET_COUNT = 50;
|
|
329
|
+
/**
|
|
330
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
|
331
|
+
* next to a given reference element.
|
|
332
|
+
*
|
|
333
|
+
* This export does not have any `platform` interface logic. You will need to
|
|
334
|
+
* write one for the platform you are using Floating UI with.
|
|
335
|
+
*/
|
|
336
|
+
const computePosition$1 = async (reference, floating, config) => {
|
|
337
|
+
const { placement = "bottom", strategy = "absolute", middleware = [], platform } = config;
|
|
338
|
+
const platformWithDetectOverflow = platform.detectOverflow ? platform : {
|
|
339
|
+
...platform,
|
|
340
|
+
detectOverflow
|
|
341
|
+
};
|
|
342
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
|
|
343
|
+
let rects = await platform.getElementRects({
|
|
344
|
+
reference,
|
|
345
|
+
floating,
|
|
346
|
+
strategy
|
|
347
|
+
});
|
|
348
|
+
let { x, y } = computeCoordsFromPlacement(rects, placement, rtl);
|
|
349
|
+
let statefulPlacement = placement;
|
|
350
|
+
let resetCount = 0;
|
|
351
|
+
const middlewareData = {};
|
|
352
|
+
for (let i = 0; i < middleware.length; i++) {
|
|
353
|
+
const currentMiddleware = middleware[i];
|
|
354
|
+
if (!currentMiddleware) continue;
|
|
355
|
+
const { name, fn } = currentMiddleware;
|
|
356
|
+
const { x: nextX, y: nextY, data, reset } = await fn({
|
|
357
|
+
x,
|
|
358
|
+
y,
|
|
359
|
+
initialPlacement: placement,
|
|
360
|
+
placement: statefulPlacement,
|
|
361
|
+
strategy,
|
|
362
|
+
middlewareData,
|
|
363
|
+
rects,
|
|
364
|
+
platform: platformWithDetectOverflow,
|
|
365
|
+
elements: {
|
|
366
|
+
reference,
|
|
367
|
+
floating
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
x = nextX != null ? nextX : x;
|
|
371
|
+
y = nextY != null ? nextY : y;
|
|
372
|
+
middlewareData[name] = {
|
|
373
|
+
...middlewareData[name],
|
|
374
|
+
...data
|
|
375
|
+
};
|
|
376
|
+
if (reset && resetCount < MAX_RESET_COUNT) {
|
|
377
|
+
resetCount++;
|
|
378
|
+
if (typeof reset === "object") {
|
|
379
|
+
if (reset.placement) statefulPlacement = reset.placement;
|
|
380
|
+
if (reset.rects) rects = reset.rects === true ? await platform.getElementRects({
|
|
381
|
+
reference,
|
|
382
|
+
floating,
|
|
383
|
+
strategy
|
|
384
|
+
}) : reset.rects;
|
|
385
|
+
({x, y} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
386
|
+
}
|
|
387
|
+
i = -1;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
return {
|
|
391
|
+
x,
|
|
392
|
+
y,
|
|
393
|
+
placement: statefulPlacement,
|
|
394
|
+
strategy,
|
|
395
|
+
middlewareData
|
|
396
|
+
};
|
|
397
|
+
};
|
|
398
|
+
/**
|
|
399
|
+
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
400
|
+
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
401
|
+
* clipping boundary. Alternative to `autoPlacement`.
|
|
402
|
+
* @see https://floating-ui.com/docs/flip
|
|
403
|
+
*/
|
|
404
|
+
const flip$2 = function(options) {
|
|
405
|
+
if (options === void 0) options = {};
|
|
406
|
+
return {
|
|
407
|
+
name: "flip",
|
|
408
|
+
options,
|
|
409
|
+
async fn(state) {
|
|
410
|
+
var _middlewareData$arrow, _middlewareData$flip;
|
|
411
|
+
const { placement, middlewareData, rects, initialPlacement, platform, elements } = state;
|
|
412
|
+
const { mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = true, fallbackPlacements: specifiedFallbackPlacements, fallbackStrategy = "bestFit", fallbackAxisSideDirection = "none", flipAlignment = true, ...detectOverflowOptions } = evaluate(options, state);
|
|
413
|
+
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) return {};
|
|
414
|
+
const side = getSide(placement);
|
|
415
|
+
const initialSideAxis = getSideAxis(initialPlacement);
|
|
416
|
+
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
417
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
418
|
+
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
419
|
+
const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
|
|
420
|
+
if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
421
|
+
const placements = [initialPlacement, ...fallbackPlacements];
|
|
422
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
423
|
+
const overflows = [];
|
|
424
|
+
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
425
|
+
if (checkMainAxis) overflows.push(overflow[side]);
|
|
426
|
+
if (checkCrossAxis) {
|
|
427
|
+
const sides = getAlignmentSides(placement, rects, rtl);
|
|
428
|
+
overflows.push(overflow[sides[0]], overflow[sides[1]]);
|
|
429
|
+
}
|
|
430
|
+
overflowsData = [...overflowsData, {
|
|
431
|
+
placement,
|
|
432
|
+
overflows
|
|
433
|
+
}];
|
|
434
|
+
if (!overflows.every((side) => side <= 0)) {
|
|
435
|
+
var _middlewareData$flip2, _overflowsData$filter;
|
|
436
|
+
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
437
|
+
const nextPlacement = placements[nextIndex];
|
|
438
|
+
if (nextPlacement) {
|
|
439
|
+
if (!(checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false) || overflowsData.every((d) => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) return {
|
|
440
|
+
data: {
|
|
441
|
+
index: nextIndex,
|
|
442
|
+
overflows: overflowsData
|
|
443
|
+
},
|
|
444
|
+
reset: { placement: nextPlacement }
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
|
|
448
|
+
if (!resetPlacement) switch (fallbackStrategy) {
|
|
449
|
+
case "bestFit": {
|
|
450
|
+
var _overflowsData$filter2;
|
|
451
|
+
const placement = (_overflowsData$filter2 = overflowsData.filter((d) => {
|
|
452
|
+
if (hasFallbackAxisSideDirection) {
|
|
453
|
+
const currentSideAxis = getSideAxis(d.placement);
|
|
454
|
+
return currentSideAxis === initialSideAxis || currentSideAxis === "y";
|
|
455
|
+
}
|
|
456
|
+
return true;
|
|
457
|
+
}).map((d) => [d.placement, d.overflows.filter((overflow) => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
|
|
458
|
+
if (placement) resetPlacement = placement;
|
|
459
|
+
break;
|
|
460
|
+
}
|
|
461
|
+
case "initialPlacement": resetPlacement = initialPlacement;
|
|
462
|
+
}
|
|
463
|
+
if (placement !== resetPlacement) return { reset: { placement: resetPlacement } };
|
|
464
|
+
}
|
|
465
|
+
return {};
|
|
466
|
+
}
|
|
467
|
+
};
|
|
468
|
+
};
|
|
469
|
+
const originSides = /*#__PURE__*/ new Set(["left", "top"]);
|
|
470
|
+
async function convertValueToCoords(state, options) {
|
|
471
|
+
const { placement, platform, elements } = state;
|
|
472
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
473
|
+
const side = getSide(placement);
|
|
474
|
+
const alignment = getAlignment(placement);
|
|
475
|
+
const isVertical = getSideAxis(placement) === "y";
|
|
476
|
+
const mainAxisMulti = originSides.has(side) ? -1 : 1;
|
|
477
|
+
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
478
|
+
const rawValue = evaluate(options, state);
|
|
479
|
+
let { mainAxis, crossAxis, alignmentAxis } = typeof rawValue === "number" ? {
|
|
480
|
+
mainAxis: rawValue,
|
|
481
|
+
crossAxis: 0,
|
|
482
|
+
alignmentAxis: null
|
|
483
|
+
} : {
|
|
484
|
+
mainAxis: rawValue.mainAxis || 0,
|
|
485
|
+
crossAxis: rawValue.crossAxis || 0,
|
|
486
|
+
alignmentAxis: rawValue.alignmentAxis
|
|
487
|
+
};
|
|
488
|
+
if (alignment && typeof alignmentAxis === "number") crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
|
|
489
|
+
return isVertical ? {
|
|
490
|
+
x: crossAxis * crossAxisMulti,
|
|
491
|
+
y: mainAxis * mainAxisMulti
|
|
492
|
+
} : {
|
|
493
|
+
x: mainAxis * mainAxisMulti,
|
|
494
|
+
y: crossAxis * crossAxisMulti
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* Modifies the placement by translating the floating element along the
|
|
499
|
+
* specified axes.
|
|
500
|
+
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
501
|
+
* object may be passed.
|
|
502
|
+
* @see https://floating-ui.com/docs/offset
|
|
503
|
+
*/
|
|
504
|
+
const offset$2 = function(options) {
|
|
505
|
+
if (options === void 0) options = 0;
|
|
506
|
+
return {
|
|
507
|
+
name: "offset",
|
|
508
|
+
options,
|
|
509
|
+
async fn(state) {
|
|
510
|
+
var _middlewareData$offse, _middlewareData$arrow;
|
|
511
|
+
const { x, y, placement, middlewareData } = state;
|
|
512
|
+
const diffCoords = await convertValueToCoords(state, options);
|
|
513
|
+
if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) return {};
|
|
514
|
+
return {
|
|
515
|
+
x: x + diffCoords.x,
|
|
516
|
+
y: y + diffCoords.y,
|
|
517
|
+
data: {
|
|
518
|
+
...diffCoords,
|
|
519
|
+
placement
|
|
520
|
+
}
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
};
|
|
524
|
+
};
|
|
525
|
+
/**
|
|
526
|
+
* Optimizes the visibility of the floating element by shifting it in order to
|
|
527
|
+
* keep it in view when it will overflow the clipping boundary.
|
|
528
|
+
* @see https://floating-ui.com/docs/shift
|
|
529
|
+
*/
|
|
530
|
+
const shift$2 = function(options) {
|
|
531
|
+
if (options === void 0) options = {};
|
|
532
|
+
return {
|
|
533
|
+
name: "shift",
|
|
534
|
+
options,
|
|
535
|
+
async fn(state) {
|
|
536
|
+
const { x, y, placement, platform } = state;
|
|
537
|
+
const { mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = false, limiter = { fn: (_ref) => {
|
|
538
|
+
let { x, y } = _ref;
|
|
539
|
+
return {
|
|
540
|
+
x,
|
|
541
|
+
y
|
|
542
|
+
};
|
|
543
|
+
} }, ...detectOverflowOptions } = evaluate(options, state);
|
|
544
|
+
const coords = {
|
|
545
|
+
x,
|
|
546
|
+
y
|
|
547
|
+
};
|
|
548
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
549
|
+
const crossAxis = getSideAxis(placement);
|
|
550
|
+
const mainAxis = getOppositeAxis(crossAxis);
|
|
551
|
+
let mainAxisCoord = coords[mainAxis];
|
|
552
|
+
let crossAxisCoord = coords[crossAxis];
|
|
553
|
+
const clampCoord = (axis, coord) => clamp(coord + overflow[axis === "y" ? "top" : "left"], coord, coord - overflow[axis === "y" ? "bottom" : "right"]);
|
|
554
|
+
if (checkMainAxis) mainAxisCoord = clampCoord(mainAxis, mainAxisCoord);
|
|
555
|
+
if (checkCrossAxis) crossAxisCoord = clampCoord(crossAxis, crossAxisCoord);
|
|
556
|
+
const limitedCoords = limiter.fn({
|
|
557
|
+
...state,
|
|
558
|
+
[mainAxis]: mainAxisCoord,
|
|
559
|
+
[crossAxis]: crossAxisCoord
|
|
560
|
+
});
|
|
561
|
+
return {
|
|
562
|
+
...limitedCoords,
|
|
563
|
+
data: {
|
|
564
|
+
x: limitedCoords.x - x,
|
|
565
|
+
y: limitedCoords.y - y,
|
|
566
|
+
enabled: {
|
|
567
|
+
[mainAxis]: checkMainAxis,
|
|
568
|
+
[crossAxis]: checkCrossAxis
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
};
|
|
572
|
+
}
|
|
573
|
+
};
|
|
574
|
+
};
|
|
575
|
+
/**
|
|
576
|
+
* Built-in `limiter` that will stop `shift()` at a certain point.
|
|
577
|
+
*/
|
|
578
|
+
const limitShift$2 = function(options) {
|
|
579
|
+
if (options === void 0) options = {};
|
|
580
|
+
return {
|
|
581
|
+
options,
|
|
582
|
+
fn(state) {
|
|
583
|
+
var _rawOffset$mainAxis, _rawOffset$crossAxis;
|
|
584
|
+
const { x, y, placement, rects, middlewareData } = state;
|
|
585
|
+
const { offset = 0, mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = true } = evaluate(options, state);
|
|
586
|
+
const coords = {
|
|
587
|
+
x,
|
|
588
|
+
y
|
|
589
|
+
};
|
|
590
|
+
const crossAxis = getSideAxis(placement);
|
|
591
|
+
const mainAxis = getOppositeAxis(crossAxis);
|
|
592
|
+
let mainAxisCoord = coords[mainAxis];
|
|
593
|
+
let crossAxisCoord = coords[crossAxis];
|
|
594
|
+
const rawOffset = evaluate(offset, state);
|
|
595
|
+
const computedOffset = typeof rawOffset === "number" ? {
|
|
596
|
+
mainAxis: rawOffset,
|
|
597
|
+
crossAxis: 0
|
|
598
|
+
} : {
|
|
599
|
+
mainAxis: (_rawOffset$mainAxis = rawOffset.mainAxis) != null ? _rawOffset$mainAxis : 0,
|
|
600
|
+
crossAxis: (_rawOffset$crossAxis = rawOffset.crossAxis) != null ? _rawOffset$crossAxis : 0
|
|
601
|
+
};
|
|
602
|
+
if (checkMainAxis) {
|
|
603
|
+
const len = mainAxis === "y" ? "height" : "width";
|
|
604
|
+
const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
|
|
605
|
+
const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
|
|
606
|
+
if (mainAxisCoord < limitMin) mainAxisCoord = limitMin;
|
|
607
|
+
else if (mainAxisCoord > limitMax) mainAxisCoord = limitMax;
|
|
608
|
+
}
|
|
609
|
+
if (checkCrossAxis) {
|
|
610
|
+
var _middlewareData$offse, _middlewareData$offse2;
|
|
611
|
+
const len = mainAxis === "y" ? "width" : "height";
|
|
612
|
+
const isOriginSide = originSides.has(getSide(placement));
|
|
613
|
+
const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
|
|
614
|
+
const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
|
|
615
|
+
if (crossAxisCoord < limitMin) crossAxisCoord = limitMin;
|
|
616
|
+
else if (crossAxisCoord > limitMax) crossAxisCoord = limitMax;
|
|
617
|
+
}
|
|
618
|
+
return {
|
|
619
|
+
[mainAxis]: mainAxisCoord,
|
|
620
|
+
[crossAxis]: crossAxisCoord
|
|
621
|
+
};
|
|
622
|
+
}
|
|
623
|
+
};
|
|
624
|
+
};
|
|
625
|
+
/**
|
|
626
|
+
* Provides data that allows you to change the size of the floating element —
|
|
627
|
+
* for instance, prevent it from overflowing the clipping boundary or match the
|
|
628
|
+
* width of the reference element.
|
|
629
|
+
* @see https://floating-ui.com/docs/size
|
|
630
|
+
*/
|
|
631
|
+
const size$2 = function(options) {
|
|
632
|
+
if (options === void 0) options = {};
|
|
633
|
+
return {
|
|
634
|
+
name: "size",
|
|
635
|
+
options,
|
|
636
|
+
async fn(state) {
|
|
637
|
+
const { placement, rects, platform, elements } = state;
|
|
638
|
+
const { apply = () => {}, ...detectOverflowOptions } = evaluate(options, state);
|
|
639
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
640
|
+
const side = getSide(placement);
|
|
641
|
+
const alignment = getAlignment(placement);
|
|
642
|
+
const isYAxis = getSideAxis(placement) === "y";
|
|
643
|
+
const { width, height } = rects.floating;
|
|
644
|
+
let heightSide;
|
|
645
|
+
let widthSide;
|
|
646
|
+
if (side === "top" || side === "bottom") {
|
|
647
|
+
heightSide = side;
|
|
648
|
+
widthSide = alignment === (await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right";
|
|
649
|
+
} else {
|
|
650
|
+
widthSide = side;
|
|
651
|
+
heightSide = alignment === "end" ? "top" : "bottom";
|
|
652
|
+
}
|
|
653
|
+
const maximumClippingHeight = height - overflow.top - overflow.bottom;
|
|
654
|
+
const maximumClippingWidth = width - overflow.left - overflow.right;
|
|
655
|
+
const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
|
|
656
|
+
const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
|
|
657
|
+
const shiftData = state.middlewareData.shift;
|
|
658
|
+
const noShift = !shiftData;
|
|
659
|
+
let availableHeight = overflowAvailableHeight;
|
|
660
|
+
let availableWidth = overflowAvailableWidth;
|
|
661
|
+
if (shiftData != null && shiftData.enabled.x) availableWidth = maximumClippingWidth;
|
|
662
|
+
if (shiftData != null && shiftData.enabled.y) availableHeight = maximumClippingHeight;
|
|
663
|
+
if (noShift && !alignment) {
|
|
664
|
+
if (isYAxis) availableWidth = width - 2 * max(overflow.left, overflow.right);
|
|
665
|
+
else availableHeight = height - 2 * max(overflow.top, overflow.bottom);
|
|
666
|
+
}
|
|
667
|
+
await apply({
|
|
668
|
+
...state,
|
|
669
|
+
availableWidth,
|
|
670
|
+
availableHeight
|
|
671
|
+
});
|
|
672
|
+
const nextDimensions = await platform.getDimensions(elements.floating);
|
|
673
|
+
if (width !== nextDimensions.width || height !== nextDimensions.height) return { reset: { rects: true } };
|
|
674
|
+
return {};
|
|
675
|
+
}
|
|
676
|
+
};
|
|
677
|
+
};
|
|
678
|
+
//#endregion
|
|
679
|
+
//#region ../../node_modules/.pnpm/@floating-ui+dom@1.8.0/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
|
|
680
|
+
function getCssDimensions(element) {
|
|
681
|
+
const css = getComputedStyle$1(element);
|
|
682
|
+
let width = parseFloat(css.width) || 0;
|
|
683
|
+
let height = parseFloat(css.height) || 0;
|
|
684
|
+
const hasOffset = isHTMLElement(element);
|
|
685
|
+
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
686
|
+
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
687
|
+
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
688
|
+
if (shouldFallback) {
|
|
689
|
+
width = offsetWidth;
|
|
690
|
+
height = offsetHeight;
|
|
691
|
+
}
|
|
692
|
+
return {
|
|
693
|
+
width,
|
|
694
|
+
height,
|
|
695
|
+
$: shouldFallback
|
|
696
|
+
};
|
|
697
|
+
}
|
|
698
|
+
function unwrapElement(element) {
|
|
699
|
+
return !isElement(element) ? element.contextElement : element;
|
|
700
|
+
}
|
|
701
|
+
function getScale(element) {
|
|
702
|
+
const domElement = unwrapElement(element);
|
|
703
|
+
if (!isHTMLElement(domElement)) return createCoords(1);
|
|
704
|
+
const rect = domElement.getBoundingClientRect();
|
|
705
|
+
const { width, height, $ } = getCssDimensions(domElement);
|
|
706
|
+
let x = ($ ? round(rect.width) : rect.width) / width;
|
|
707
|
+
let y = ($ ? round(rect.height) : rect.height) / height;
|
|
708
|
+
if (!x || !Number.isFinite(x)) x = 1;
|
|
709
|
+
if (!y || !Number.isFinite(y)) y = 1;
|
|
710
|
+
return {
|
|
711
|
+
x,
|
|
712
|
+
y
|
|
713
|
+
};
|
|
714
|
+
}
|
|
715
|
+
const noOffsets = /*#__PURE__*/ createCoords(0);
|
|
716
|
+
function getVisualOffsets(element) {
|
|
717
|
+
const win = getWindow(element);
|
|
718
|
+
if (!isWebKit() || !win.visualViewport) return noOffsets;
|
|
719
|
+
return {
|
|
720
|
+
x: win.visualViewport.offsetLeft,
|
|
721
|
+
y: win.visualViewport.offsetTop
|
|
722
|
+
};
|
|
723
|
+
}
|
|
724
|
+
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
725
|
+
if (isFixed === void 0) isFixed = false;
|
|
726
|
+
return !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element);
|
|
727
|
+
}
|
|
728
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
729
|
+
if (includeScale === void 0) includeScale = false;
|
|
730
|
+
if (isFixedStrategy === void 0) isFixedStrategy = false;
|
|
731
|
+
const clientRect = element.getBoundingClientRect();
|
|
732
|
+
const domElement = unwrapElement(element);
|
|
733
|
+
let scale = createCoords(1);
|
|
734
|
+
if (includeScale) {
|
|
735
|
+
if (offsetParent) {
|
|
736
|
+
if (isElement(offsetParent)) scale = getScale(offsetParent);
|
|
737
|
+
} else scale = getScale(element);
|
|
738
|
+
}
|
|
739
|
+
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
|
740
|
+
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
|
741
|
+
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
|
742
|
+
let width = clientRect.width / scale.x;
|
|
743
|
+
let height = clientRect.height / scale.y;
|
|
744
|
+
if (domElement && offsetParent) {
|
|
745
|
+
const win = getWindow(domElement);
|
|
746
|
+
const offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
747
|
+
let currentWin = win;
|
|
748
|
+
let currentIFrame = getFrameElement(currentWin);
|
|
749
|
+
while (currentIFrame && offsetWin !== currentWin) {
|
|
750
|
+
const iframeScale = getScale(currentIFrame);
|
|
751
|
+
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
752
|
+
const css = getComputedStyle$1(currentIFrame);
|
|
753
|
+
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
754
|
+
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
755
|
+
x *= iframeScale.x;
|
|
756
|
+
y *= iframeScale.y;
|
|
757
|
+
width *= iframeScale.x;
|
|
758
|
+
height *= iframeScale.y;
|
|
759
|
+
x += left;
|
|
760
|
+
y += top;
|
|
761
|
+
currentWin = getWindow(currentIFrame);
|
|
762
|
+
currentIFrame = getFrameElement(currentWin);
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
return rectToClientRect({
|
|
766
|
+
width,
|
|
767
|
+
height,
|
|
768
|
+
x,
|
|
769
|
+
y
|
|
770
|
+
});
|
|
771
|
+
}
|
|
772
|
+
function getWindowScrollBarX(element, rect) {
|
|
773
|
+
const leftScroll = getNodeScroll(element).scrollLeft;
|
|
774
|
+
if (!rect) return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
|
|
775
|
+
return rect.left + leftScroll;
|
|
776
|
+
}
|
|
777
|
+
function getHTMLOffset(documentElement, scroll) {
|
|
778
|
+
const htmlRect = documentElement.getBoundingClientRect();
|
|
779
|
+
return {
|
|
780
|
+
x: htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect),
|
|
781
|
+
y: htmlRect.top + scroll.scrollTop
|
|
782
|
+
};
|
|
783
|
+
}
|
|
784
|
+
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
785
|
+
let { elements, rect, offsetParent, strategy } = _ref;
|
|
786
|
+
const isFixed = strategy === "fixed";
|
|
787
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
788
|
+
const topLayer = elements ? isTopLayer(elements.floating) : false;
|
|
789
|
+
if (offsetParent === documentElement || topLayer && isFixed) return rect;
|
|
790
|
+
let scroll = {
|
|
791
|
+
scrollLeft: 0,
|
|
792
|
+
scrollTop: 0
|
|
793
|
+
};
|
|
794
|
+
let scale = createCoords(1);
|
|
795
|
+
const offsets = createCoords(0);
|
|
796
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
797
|
+
if (isOffsetParentAnElement || !isFixed) {
|
|
798
|
+
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) scroll = getNodeScroll(offsetParent);
|
|
799
|
+
if (isOffsetParentAnElement) {
|
|
800
|
+
const offsetRect = getBoundingClientRect(offsetParent);
|
|
801
|
+
scale = getScale(offsetParent);
|
|
802
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
803
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
807
|
+
return {
|
|
808
|
+
width: rect.width * scale.x,
|
|
809
|
+
height: rect.height * scale.y,
|
|
810
|
+
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
|
|
811
|
+
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
|
|
812
|
+
};
|
|
813
|
+
}
|
|
814
|
+
function getClientRects(element) {
|
|
815
|
+
return element.getClientRects ? Array.from(element.getClientRects()) : [];
|
|
816
|
+
}
|
|
817
|
+
function getDocumentRect(html) {
|
|
818
|
+
const scroll = getNodeScroll(html);
|
|
819
|
+
const body = html.ownerDocument.body;
|
|
820
|
+
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
821
|
+
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
822
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX(html);
|
|
823
|
+
const y = -scroll.scrollTop;
|
|
824
|
+
if (getComputedStyle$1(body).direction === "rtl") x += max(html.clientWidth, body.clientWidth) - width;
|
|
825
|
+
return {
|
|
826
|
+
width,
|
|
827
|
+
height,
|
|
828
|
+
x,
|
|
829
|
+
y
|
|
830
|
+
};
|
|
831
|
+
}
|
|
832
|
+
const SCROLLBAR_MAX = 25;
|
|
833
|
+
function getViewportRect(element, strategy, rootBoundary) {
|
|
834
|
+
if (rootBoundary === void 0) rootBoundary = "viewport";
|
|
835
|
+
const isLayoutViewport = rootBoundary === "layoutViewport";
|
|
836
|
+
const win = getWindow(element);
|
|
837
|
+
const html = getDocumentElement(element);
|
|
838
|
+
const visualViewport = win.visualViewport;
|
|
839
|
+
let width = html.clientWidth;
|
|
840
|
+
let height = html.clientHeight;
|
|
841
|
+
let x = 0;
|
|
842
|
+
let y = 0;
|
|
843
|
+
if (visualViewport) {
|
|
844
|
+
const layoutRelativeClientCoords = !isWebKit() || strategy === "fixed";
|
|
845
|
+
if (isLayoutViewport) {
|
|
846
|
+
if (!layoutRelativeClientCoords) {
|
|
847
|
+
x = -visualViewport.offsetLeft;
|
|
848
|
+
y = -visualViewport.offsetTop;
|
|
849
|
+
}
|
|
850
|
+
} else {
|
|
851
|
+
width = visualViewport.width;
|
|
852
|
+
height = visualViewport.height;
|
|
853
|
+
if (layoutRelativeClientCoords) {
|
|
854
|
+
x = visualViewport.offsetLeft;
|
|
855
|
+
y = visualViewport.offsetTop;
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
if (getWindowScrollBarX(html) <= 0) {
|
|
860
|
+
const doc = html.ownerDocument;
|
|
861
|
+
const body = doc.body;
|
|
862
|
+
const bodyStyles = getComputedStyle(body);
|
|
863
|
+
const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
|
|
864
|
+
const reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
|
|
865
|
+
const gutter = getComputedStyle(html).scrollbarGutter === "stable both-edges" ? reservedWidth / 2 : reservedWidth;
|
|
866
|
+
if (gutter <= SCROLLBAR_MAX) width -= gutter;
|
|
867
|
+
}
|
|
868
|
+
return {
|
|
869
|
+
width,
|
|
870
|
+
height,
|
|
871
|
+
x,
|
|
872
|
+
y
|
|
873
|
+
};
|
|
874
|
+
}
|
|
875
|
+
function getInnerBoundingClientRect(element, strategy) {
|
|
876
|
+
const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
|
|
877
|
+
const top = clientRect.top + element.clientTop;
|
|
878
|
+
const left = clientRect.left + element.clientLeft;
|
|
879
|
+
const scale = getScale(element);
|
|
880
|
+
return {
|
|
881
|
+
width: element.clientWidth * scale.x,
|
|
882
|
+
height: element.clientHeight * scale.y,
|
|
883
|
+
x: left * scale.x,
|
|
884
|
+
y: top * scale.y
|
|
885
|
+
};
|
|
886
|
+
}
|
|
887
|
+
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
888
|
+
let rect;
|
|
889
|
+
if (clippingAncestor === "viewport" || clippingAncestor === "layoutViewport") rect = getViewportRect(element, strategy, clippingAncestor);
|
|
890
|
+
else if (clippingAncestor === "document") rect = getDocumentRect(getDocumentElement(element));
|
|
891
|
+
else if (isElement(clippingAncestor)) rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
892
|
+
else {
|
|
893
|
+
const visualOffsets = getVisualOffsets(element);
|
|
894
|
+
rect = {
|
|
895
|
+
x: clippingAncestor.x - visualOffsets.x,
|
|
896
|
+
y: clippingAncestor.y - visualOffsets.y,
|
|
897
|
+
width: clippingAncestor.width,
|
|
898
|
+
height: clippingAncestor.height
|
|
899
|
+
};
|
|
900
|
+
}
|
|
901
|
+
return rectToClientRect(rect);
|
|
902
|
+
}
|
|
903
|
+
function getClippingElementAncestors(element, cache) {
|
|
904
|
+
const cachedResult = cache.get(element);
|
|
905
|
+
if (cachedResult) return cachedResult;
|
|
906
|
+
let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
|
|
907
|
+
let lastKeptComputedStyle = null;
|
|
908
|
+
const elementIsFixed = getComputedStyle$1(element).position === "fixed";
|
|
909
|
+
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
910
|
+
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
911
|
+
const computedStyle = getComputedStyle$1(currentNode);
|
|
912
|
+
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
913
|
+
const lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? "fixed" : "";
|
|
914
|
+
if (!currentNodeIsContaining && (lastPosition === "fixed" || lastPosition === "absolute" && computedStyle.position === "static")) result = result.filter((ancestor) => ancestor !== currentNode);
|
|
915
|
+
else lastKeptComputedStyle = computedStyle;
|
|
916
|
+
currentNode = getParentNode(currentNode);
|
|
917
|
+
}
|
|
918
|
+
cache.set(element, result);
|
|
919
|
+
return result;
|
|
920
|
+
}
|
|
921
|
+
function getClippingRect(_ref) {
|
|
922
|
+
let { element, boundary, rootBoundary, strategy } = _ref;
|
|
923
|
+
const clippingAncestors = [...boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary), rootBoundary];
|
|
924
|
+
const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy);
|
|
925
|
+
let top = firstRect.top;
|
|
926
|
+
let right = firstRect.right;
|
|
927
|
+
let bottom = firstRect.bottom;
|
|
928
|
+
let left = firstRect.left;
|
|
929
|
+
for (let i = 1; i < clippingAncestors.length; i++) {
|
|
930
|
+
const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy);
|
|
931
|
+
top = max(rect.top, top);
|
|
932
|
+
right = min(rect.right, right);
|
|
933
|
+
bottom = min(rect.bottom, bottom);
|
|
934
|
+
left = max(rect.left, left);
|
|
935
|
+
}
|
|
936
|
+
return {
|
|
937
|
+
width: right - left,
|
|
938
|
+
height: bottom - top,
|
|
939
|
+
x: left,
|
|
940
|
+
y: top
|
|
941
|
+
};
|
|
942
|
+
}
|
|
943
|
+
function getDimensions(element) {
|
|
944
|
+
const { width, height } = getCssDimensions(element);
|
|
945
|
+
return {
|
|
946
|
+
width,
|
|
947
|
+
height
|
|
948
|
+
};
|
|
949
|
+
}
|
|
950
|
+
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
951
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
952
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
953
|
+
const isFixed = strategy === "fixed";
|
|
954
|
+
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
|
955
|
+
let scroll = {
|
|
956
|
+
scrollLeft: 0,
|
|
957
|
+
scrollTop: 0
|
|
958
|
+
};
|
|
959
|
+
const offsets = createCoords(0);
|
|
960
|
+
if (isOffsetParentAnElement || !isFixed) {
|
|
961
|
+
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) scroll = getNodeScroll(offsetParent);
|
|
962
|
+
if (isOffsetParentAnElement) {
|
|
963
|
+
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
964
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
965
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
if (!isOffsetParentAnElement && documentElement) offsets.x = getWindowScrollBarX(documentElement);
|
|
969
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
970
|
+
return {
|
|
971
|
+
x: rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x,
|
|
972
|
+
y: rect.top + scroll.scrollTop - offsets.y - htmlOffset.y,
|
|
973
|
+
width: rect.width,
|
|
974
|
+
height: rect.height
|
|
975
|
+
};
|
|
976
|
+
}
|
|
977
|
+
function isStaticPositioned(element) {
|
|
978
|
+
return getComputedStyle$1(element).position === "static";
|
|
979
|
+
}
|
|
980
|
+
function getTrueOffsetParent(element, polyfill) {
|
|
981
|
+
if (!isHTMLElement(element) || getComputedStyle$1(element).position === "fixed") return null;
|
|
982
|
+
if (polyfill) return polyfill(element);
|
|
983
|
+
let rawOffsetParent = element.offsetParent;
|
|
984
|
+
if (getDocumentElement(element) === rawOffsetParent) rawOffsetParent = rawOffsetParent.ownerDocument.body;
|
|
985
|
+
return rawOffsetParent;
|
|
986
|
+
}
|
|
987
|
+
function getOffsetParent(element, polyfill) {
|
|
988
|
+
const win = getWindow(element);
|
|
989
|
+
if (isTopLayer(element)) return win;
|
|
990
|
+
if (!isHTMLElement(element)) {
|
|
991
|
+
let svgOffsetParent = getParentNode(element);
|
|
992
|
+
while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
|
|
993
|
+
if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) return svgOffsetParent;
|
|
994
|
+
svgOffsetParent = getParentNode(svgOffsetParent);
|
|
995
|
+
}
|
|
996
|
+
return win;
|
|
997
|
+
}
|
|
998
|
+
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
999
|
+
while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
1000
|
+
if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) return win;
|
|
1001
|
+
return offsetParent || getContainingBlock(element) || win;
|
|
1002
|
+
}
|
|
1003
|
+
const getElementRects = async function(data) {
|
|
1004
|
+
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
1005
|
+
const getDimensionsFn = this.getDimensions;
|
|
1006
|
+
const floatingDimensions = await getDimensionsFn(data.floating);
|
|
1007
|
+
return {
|
|
1008
|
+
reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
|
|
1009
|
+
floating: {
|
|
1010
|
+
x: 0,
|
|
1011
|
+
y: 0,
|
|
1012
|
+
width: floatingDimensions.width,
|
|
1013
|
+
height: floatingDimensions.height
|
|
1014
|
+
}
|
|
1015
|
+
};
|
|
1016
|
+
};
|
|
1017
|
+
function isRTL(element) {
|
|
1018
|
+
return getComputedStyle$1(element).direction === "rtl";
|
|
1019
|
+
}
|
|
1020
|
+
const platform = {
|
|
1021
|
+
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
1022
|
+
getDocumentElement,
|
|
1023
|
+
getClippingRect,
|
|
1024
|
+
getOffsetParent,
|
|
1025
|
+
getElementRects,
|
|
1026
|
+
getClientRects,
|
|
1027
|
+
getDimensions,
|
|
1028
|
+
getScale,
|
|
1029
|
+
isElement,
|
|
1030
|
+
isRTL
|
|
1031
|
+
};
|
|
1032
|
+
function rectsAreEqual(a, b) {
|
|
1033
|
+
return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
|
|
1034
|
+
}
|
|
1035
|
+
function observeMove(element, onMove, ancestorResize) {
|
|
1036
|
+
let io = null;
|
|
1037
|
+
let timeoutId;
|
|
1038
|
+
const root = getDocumentElement(element);
|
|
1039
|
+
function cleanup() {
|
|
1040
|
+
var _io;
|
|
1041
|
+
clearTimeout(timeoutId);
|
|
1042
|
+
(_io = io) == null || _io.disconnect();
|
|
1043
|
+
io = null;
|
|
1044
|
+
}
|
|
1045
|
+
function refresh(skip, threshold) {
|
|
1046
|
+
if (skip === void 0) skip = false;
|
|
1047
|
+
if (threshold === void 0) threshold = 1;
|
|
1048
|
+
cleanup();
|
|
1049
|
+
const elementRectForRootMargin = element.getBoundingClientRect();
|
|
1050
|
+
const { left, top, width, height } = elementRectForRootMargin;
|
|
1051
|
+
if (!skip) onMove();
|
|
1052
|
+
if (!width || !height) return;
|
|
1053
|
+
const insetTop = floor(top);
|
|
1054
|
+
const insetRight = floor(root.clientWidth - (left + width));
|
|
1055
|
+
const insetBottom = floor(root.clientHeight - (top + height));
|
|
1056
|
+
const insetLeft = floor(left);
|
|
1057
|
+
const options = {
|
|
1058
|
+
rootMargin: -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px",
|
|
1059
|
+
threshold: max(0, min(1, threshold)) || 1
|
|
1060
|
+
};
|
|
1061
|
+
let isFirstUpdate = true;
|
|
1062
|
+
function handleObserve(entries) {
|
|
1063
|
+
const ratio = entries[0].intersectionRatio;
|
|
1064
|
+
if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) return refresh();
|
|
1065
|
+
if (ratio !== threshold) {
|
|
1066
|
+
if (!isFirstUpdate) return refresh();
|
|
1067
|
+
if (!ratio) timeoutId = setTimeout(() => {
|
|
1068
|
+
refresh(false, 1e-7);
|
|
1069
|
+
}, 1e3);
|
|
1070
|
+
else refresh(false, ratio);
|
|
1071
|
+
}
|
|
1072
|
+
isFirstUpdate = false;
|
|
1073
|
+
}
|
|
1074
|
+
try {
|
|
1075
|
+
io = new IntersectionObserver(handleObserve, {
|
|
1076
|
+
...options,
|
|
1077
|
+
root: root.ownerDocument
|
|
1078
|
+
});
|
|
1079
|
+
} catch (_e) {
|
|
1080
|
+
io = new IntersectionObserver(handleObserve, options);
|
|
1081
|
+
}
|
|
1082
|
+
io.observe(element);
|
|
1083
|
+
}
|
|
1084
|
+
const win = getWindow(element);
|
|
1085
|
+
const handleResize = () => refresh(ancestorResize);
|
|
1086
|
+
win.addEventListener("resize", handleResize);
|
|
1087
|
+
refresh(true);
|
|
1088
|
+
return () => {
|
|
1089
|
+
win.removeEventListener("resize", handleResize);
|
|
1090
|
+
cleanup();
|
|
1091
|
+
};
|
|
1092
|
+
}
|
|
1093
|
+
/**
|
|
1094
|
+
* Automatically updates the position of the floating element when necessary.
|
|
1095
|
+
* Should only be called when the floating element is mounted on the DOM or
|
|
1096
|
+
* visible on the screen.
|
|
1097
|
+
* @returns cleanup function that should be invoked when the floating element is
|
|
1098
|
+
* removed from the DOM or hidden from the screen.
|
|
1099
|
+
* @see https://floating-ui.com/docs/autoUpdate
|
|
1100
|
+
*/
|
|
1101
|
+
function autoUpdate(reference, floating, update, options) {
|
|
1102
|
+
if (options === void 0) options = {};
|
|
1103
|
+
const { ancestorScroll = true, ancestorResize = true, elementResize = typeof ResizeObserver === "function", layoutShift = typeof IntersectionObserver === "function", animationFrame = false } = options;
|
|
1104
|
+
const referenceEl = unwrapElement(reference);
|
|
1105
|
+
const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...floating ? getOverflowAncestors(floating) : []] : [];
|
|
1106
|
+
ancestors.forEach((ancestor) => {
|
|
1107
|
+
ancestorScroll && ancestor.addEventListener("scroll", update);
|
|
1108
|
+
ancestorResize && ancestor.addEventListener("resize", update);
|
|
1109
|
+
});
|
|
1110
|
+
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update, ancestorResize) : null;
|
|
1111
|
+
let reobserveFrame = -1;
|
|
1112
|
+
let resizeObserver = null;
|
|
1113
|
+
if (elementResize) {
|
|
1114
|
+
resizeObserver = new ResizeObserver((_ref) => {
|
|
1115
|
+
let [firstEntry] = _ref;
|
|
1116
|
+
if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) {
|
|
1117
|
+
resizeObserver.unobserve(floating);
|
|
1118
|
+
cancelAnimationFrame(reobserveFrame);
|
|
1119
|
+
reobserveFrame = requestAnimationFrame(() => {
|
|
1120
|
+
var _resizeObserver;
|
|
1121
|
+
(_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
|
|
1122
|
+
});
|
|
1123
|
+
}
|
|
1124
|
+
update();
|
|
1125
|
+
});
|
|
1126
|
+
if (referenceEl && !animationFrame) resizeObserver.observe(referenceEl);
|
|
1127
|
+
if (floating) resizeObserver.observe(floating);
|
|
1128
|
+
}
|
|
1129
|
+
let frameId;
|
|
1130
|
+
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
|
|
1131
|
+
if (animationFrame) frameLoop();
|
|
1132
|
+
function frameLoop() {
|
|
1133
|
+
const nextRefRect = getBoundingClientRect(reference);
|
|
1134
|
+
if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) update();
|
|
1135
|
+
prevRefRect = nextRefRect;
|
|
1136
|
+
frameId = requestAnimationFrame(frameLoop);
|
|
1137
|
+
}
|
|
1138
|
+
update();
|
|
1139
|
+
return () => {
|
|
1140
|
+
var _resizeObserver2;
|
|
1141
|
+
ancestors.forEach((ancestor) => {
|
|
1142
|
+
ancestorScroll && ancestor.removeEventListener("scroll", update);
|
|
1143
|
+
ancestorResize && ancestor.removeEventListener("resize", update);
|
|
1144
|
+
});
|
|
1145
|
+
cleanupIo?.();
|
|
1146
|
+
(_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
|
|
1147
|
+
resizeObserver = null;
|
|
1148
|
+
if (animationFrame) cancelAnimationFrame(frameId);
|
|
1149
|
+
};
|
|
1150
|
+
}
|
|
1151
|
+
/**
|
|
1152
|
+
* Modifies the placement by translating the floating element along the
|
|
1153
|
+
* specified axes.
|
|
1154
|
+
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
1155
|
+
* object may be passed.
|
|
1156
|
+
* @see https://floating-ui.com/docs/offset
|
|
1157
|
+
*/
|
|
1158
|
+
const offset$1 = offset$2;
|
|
1159
|
+
/**
|
|
1160
|
+
* Optimizes the visibility of the floating element by shifting it in order to
|
|
1161
|
+
* keep it in view when it will overflow the clipping boundary.
|
|
1162
|
+
* @see https://floating-ui.com/docs/shift
|
|
1163
|
+
*/
|
|
1164
|
+
const shift$1 = shift$2;
|
|
1165
|
+
/**
|
|
1166
|
+
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
1167
|
+
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
1168
|
+
* clipping boundary. Alternative to `autoPlacement`.
|
|
1169
|
+
* @see https://floating-ui.com/docs/flip
|
|
1170
|
+
*/
|
|
1171
|
+
const flip$1 = flip$2;
|
|
1172
|
+
/**
|
|
1173
|
+
* Provides data that allows you to change the size of the floating element —
|
|
1174
|
+
* for instance, prevent it from overflowing the clipping boundary or match the
|
|
1175
|
+
* width of the reference element.
|
|
1176
|
+
* @see https://floating-ui.com/docs/size
|
|
1177
|
+
*/
|
|
1178
|
+
const size$1 = size$2;
|
|
1179
|
+
/**
|
|
1180
|
+
* Built-in `limiter` that will stop `shift()` at a certain point.
|
|
1181
|
+
*/
|
|
1182
|
+
const limitShift$1 = limitShift$2;
|
|
1183
|
+
/**
|
|
1184
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
|
1185
|
+
* next to a given reference element.
|
|
1186
|
+
*/
|
|
1187
|
+
const computePosition = (reference, floating, options) => {
|
|
1188
|
+
const cache = /* @__PURE__ */ new Map();
|
|
1189
|
+
const mergedOptions = options != null ? options : {};
|
|
1190
|
+
const platformWithCache = {
|
|
1191
|
+
...platform,
|
|
1192
|
+
...mergedOptions.platform,
|
|
1193
|
+
_c: cache
|
|
1194
|
+
};
|
|
1195
|
+
return computePosition$1(reference, floating, {
|
|
1196
|
+
...mergedOptions,
|
|
1197
|
+
platform: platformWithCache
|
|
1198
|
+
});
|
|
1199
|
+
};
|
|
1200
|
+
//#endregion
|
|
1201
|
+
//#region ../../node_modules/.pnpm/@floating-ui+react-dom@2.1.9_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs
|
|
1202
|
+
var index = typeof document !== "undefined" ? useLayoutEffect : function noop() {};
|
|
1203
|
+
function deepEqual(a, b) {
|
|
1204
|
+
if (a === b) return true;
|
|
1205
|
+
if (typeof a !== typeof b) return false;
|
|
1206
|
+
if (typeof a === "function" && a.toString() === b.toString()) return true;
|
|
1207
|
+
let length;
|
|
1208
|
+
let i;
|
|
1209
|
+
let keys;
|
|
1210
|
+
if (a && b && typeof a === "object") {
|
|
1211
|
+
if (Array.isArray(a)) {
|
|
1212
|
+
length = a.length;
|
|
1213
|
+
if (length !== b.length) return false;
|
|
1214
|
+
for (i = length; i-- !== 0;) if (!deepEqual(a[i], b[i])) return false;
|
|
1215
|
+
return true;
|
|
1216
|
+
}
|
|
1217
|
+
keys = Object.keys(a);
|
|
1218
|
+
length = keys.length;
|
|
1219
|
+
if (length !== Object.keys(b).length) return false;
|
|
1220
|
+
for (i = length; i-- !== 0;) if (!{}.hasOwnProperty.call(b, keys[i])) return false;
|
|
1221
|
+
for (i = length; i-- !== 0;) {
|
|
1222
|
+
const key = keys[i];
|
|
1223
|
+
if (key === "_owner" && a.$$typeof) continue;
|
|
1224
|
+
if (!deepEqual(a[key], b[key])) return false;
|
|
1225
|
+
}
|
|
1226
|
+
return true;
|
|
1227
|
+
}
|
|
1228
|
+
return a !== a && b !== b;
|
|
1229
|
+
}
|
|
1230
|
+
function getDPR(element) {
|
|
1231
|
+
if (typeof window === "undefined") return 1;
|
|
1232
|
+
return (element.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
1233
|
+
}
|
|
1234
|
+
function roundByDPR(element, value) {
|
|
1235
|
+
const dpr = getDPR(element);
|
|
1236
|
+
return Math.round(value * dpr) / dpr;
|
|
1237
|
+
}
|
|
1238
|
+
function useLatestRef(value) {
|
|
1239
|
+
const ref = React$1.useRef(value);
|
|
1240
|
+
index(() => {
|
|
1241
|
+
ref.current = value;
|
|
1242
|
+
});
|
|
1243
|
+
return ref;
|
|
1244
|
+
}
|
|
1245
|
+
/**
|
|
1246
|
+
* Provides data to position a floating element.
|
|
1247
|
+
* @see https://floating-ui.com/docs/useFloating
|
|
1248
|
+
*/
|
|
1249
|
+
function useFloating(options) {
|
|
1250
|
+
if (options === void 0) options = {};
|
|
1251
|
+
const { placement = "bottom", strategy = "absolute", middleware = [], platform, elements: { reference: externalReference, floating: externalFloating } = {}, transform = true, whileElementsMounted, open } = options;
|
|
1252
|
+
const [data, setData] = React$1.useState({
|
|
1253
|
+
x: 0,
|
|
1254
|
+
y: 0,
|
|
1255
|
+
strategy,
|
|
1256
|
+
placement,
|
|
1257
|
+
middlewareData: {},
|
|
1258
|
+
isPositioned: false
|
|
1259
|
+
});
|
|
1260
|
+
const [latestMiddleware, setLatestMiddleware] = React$1.useState(middleware);
|
|
1261
|
+
if (!deepEqual(latestMiddleware, middleware)) setLatestMiddleware(middleware);
|
|
1262
|
+
const [_reference, _setReference] = React$1.useState(null);
|
|
1263
|
+
const [_floating, _setFloating] = React$1.useState(null);
|
|
1264
|
+
const setReference = React$1.useCallback((node) => {
|
|
1265
|
+
if (node !== referenceRef.current) {
|
|
1266
|
+
referenceRef.current = node;
|
|
1267
|
+
_setReference(node);
|
|
1268
|
+
}
|
|
1269
|
+
}, []);
|
|
1270
|
+
const setFloating = React$1.useCallback((node) => {
|
|
1271
|
+
if (node !== floatingRef.current) {
|
|
1272
|
+
floatingRef.current = node;
|
|
1273
|
+
_setFloating(node);
|
|
1274
|
+
}
|
|
1275
|
+
}, []);
|
|
1276
|
+
const referenceEl = externalReference || _reference;
|
|
1277
|
+
const floatingEl = externalFloating || _floating;
|
|
1278
|
+
const referenceRef = React$1.useRef(null);
|
|
1279
|
+
const floatingRef = React$1.useRef(null);
|
|
1280
|
+
const dataRef = React$1.useRef(data);
|
|
1281
|
+
const hasWhileElementsMounted = whileElementsMounted != null;
|
|
1282
|
+
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
1283
|
+
const platformRef = useLatestRef(platform);
|
|
1284
|
+
const openRef = useLatestRef(open);
|
|
1285
|
+
const update = React$1.useCallback(() => {
|
|
1286
|
+
if (!referenceRef.current || !floatingRef.current) return;
|
|
1287
|
+
const config = {
|
|
1288
|
+
placement,
|
|
1289
|
+
strategy,
|
|
1290
|
+
middleware: latestMiddleware
|
|
1291
|
+
};
|
|
1292
|
+
if (platformRef.current) config.platform = platformRef.current;
|
|
1293
|
+
computePosition(referenceRef.current, floatingRef.current, config).then((data) => {
|
|
1294
|
+
const fullData = {
|
|
1295
|
+
...data,
|
|
1296
|
+
isPositioned: openRef.current !== false
|
|
1297
|
+
};
|
|
1298
|
+
if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
|
|
1299
|
+
dataRef.current = fullData;
|
|
1300
|
+
ReactDOM.flushSync(() => {
|
|
1301
|
+
setData(fullData);
|
|
1302
|
+
});
|
|
1303
|
+
}
|
|
1304
|
+
});
|
|
1305
|
+
}, [
|
|
1306
|
+
latestMiddleware,
|
|
1307
|
+
placement,
|
|
1308
|
+
strategy,
|
|
1309
|
+
platformRef,
|
|
1310
|
+
openRef
|
|
1311
|
+
]);
|
|
1312
|
+
index(() => {
|
|
1313
|
+
if (open === false && dataRef.current.isPositioned) {
|
|
1314
|
+
dataRef.current.isPositioned = false;
|
|
1315
|
+
setData((data) => ({
|
|
1316
|
+
...data,
|
|
1317
|
+
isPositioned: false
|
|
1318
|
+
}));
|
|
1319
|
+
}
|
|
1320
|
+
}, [open]);
|
|
1321
|
+
const isMountedRef = React$1.useRef(false);
|
|
1322
|
+
index(() => {
|
|
1323
|
+
isMountedRef.current = true;
|
|
1324
|
+
return () => {
|
|
1325
|
+
isMountedRef.current = false;
|
|
1326
|
+
};
|
|
1327
|
+
}, []);
|
|
1328
|
+
index(() => {
|
|
1329
|
+
if (referenceEl) referenceRef.current = referenceEl;
|
|
1330
|
+
if (floatingEl) floatingRef.current = floatingEl;
|
|
1331
|
+
if (referenceEl && floatingEl) {
|
|
1332
|
+
if (whileElementsMountedRef.current) return whileElementsMountedRef.current(referenceEl, floatingEl, update);
|
|
1333
|
+
update();
|
|
1334
|
+
}
|
|
1335
|
+
}, [
|
|
1336
|
+
referenceEl,
|
|
1337
|
+
floatingEl,
|
|
1338
|
+
update,
|
|
1339
|
+
whileElementsMountedRef,
|
|
1340
|
+
hasWhileElementsMounted
|
|
1341
|
+
]);
|
|
1342
|
+
const refs = React$1.useMemo(() => ({
|
|
1343
|
+
reference: referenceRef,
|
|
1344
|
+
floating: floatingRef,
|
|
1345
|
+
setReference,
|
|
1346
|
+
setFloating
|
|
1347
|
+
}), [setReference, setFloating]);
|
|
1348
|
+
const elements = React$1.useMemo(() => ({
|
|
1349
|
+
reference: referenceEl,
|
|
1350
|
+
floating: floatingEl
|
|
1351
|
+
}), [referenceEl, floatingEl]);
|
|
1352
|
+
const floatingStyles = React$1.useMemo(() => {
|
|
1353
|
+
const initialStyles = {
|
|
1354
|
+
position: strategy,
|
|
1355
|
+
left: 0,
|
|
1356
|
+
top: 0
|
|
1357
|
+
};
|
|
1358
|
+
if (!elements.floating) return initialStyles;
|
|
1359
|
+
const x = roundByDPR(elements.floating, data.x);
|
|
1360
|
+
const y = roundByDPR(elements.floating, data.y);
|
|
1361
|
+
if (transform) return {
|
|
1362
|
+
...initialStyles,
|
|
1363
|
+
transform: "translate(" + x + "px, " + y + "px)",
|
|
1364
|
+
...getDPR(elements.floating) >= 1.5 && { willChange: "transform" }
|
|
1365
|
+
};
|
|
1366
|
+
return {
|
|
1367
|
+
position: strategy,
|
|
1368
|
+
left: x,
|
|
1369
|
+
top: y
|
|
1370
|
+
};
|
|
1371
|
+
}, [
|
|
1372
|
+
strategy,
|
|
1373
|
+
transform,
|
|
1374
|
+
elements.floating,
|
|
1375
|
+
data.x,
|
|
1376
|
+
data.y
|
|
1377
|
+
]);
|
|
1378
|
+
return React$1.useMemo(() => ({
|
|
1379
|
+
...data,
|
|
1380
|
+
update,
|
|
1381
|
+
refs,
|
|
1382
|
+
elements,
|
|
1383
|
+
floatingStyles
|
|
1384
|
+
}), [
|
|
1385
|
+
data,
|
|
1386
|
+
update,
|
|
1387
|
+
refs,
|
|
1388
|
+
elements,
|
|
1389
|
+
floatingStyles
|
|
1390
|
+
]);
|
|
1391
|
+
}
|
|
1392
|
+
/**
|
|
1393
|
+
* Modifies the placement by translating the floating element along the
|
|
1394
|
+
* specified axes.
|
|
1395
|
+
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
1396
|
+
* object may be passed.
|
|
1397
|
+
* @see https://floating-ui.com/docs/offset
|
|
1398
|
+
*/
|
|
1399
|
+
const offset = (options, deps) => {
|
|
1400
|
+
const result = offset$1(options);
|
|
1401
|
+
return {
|
|
1402
|
+
name: result.name,
|
|
1403
|
+
fn: result.fn,
|
|
1404
|
+
options: [options, deps]
|
|
1405
|
+
};
|
|
1406
|
+
};
|
|
1407
|
+
/**
|
|
1408
|
+
* Optimizes the visibility of the floating element by shifting it in order to
|
|
1409
|
+
* keep it in view when it will overflow the clipping boundary.
|
|
1410
|
+
* @see https://floating-ui.com/docs/shift
|
|
1411
|
+
*/
|
|
1412
|
+
const shift = (options, deps) => {
|
|
1413
|
+
const result = shift$1(options);
|
|
1414
|
+
return {
|
|
1415
|
+
name: result.name,
|
|
1416
|
+
fn: result.fn,
|
|
1417
|
+
options: [options, deps]
|
|
1418
|
+
};
|
|
1419
|
+
};
|
|
1420
|
+
/**
|
|
1421
|
+
* Built-in `limiter` that will stop `shift()` at a certain point.
|
|
1422
|
+
*/
|
|
1423
|
+
const limitShift = (options, deps) => {
|
|
1424
|
+
return {
|
|
1425
|
+
fn: limitShift$1(options).fn,
|
|
1426
|
+
options: [options, deps]
|
|
1427
|
+
};
|
|
1428
|
+
};
|
|
1429
|
+
/**
|
|
1430
|
+
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
1431
|
+
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
1432
|
+
* clipping boundary. Alternative to `autoPlacement`.
|
|
1433
|
+
* @see https://floating-ui.com/docs/flip
|
|
1434
|
+
*/
|
|
1435
|
+
const flip = (options, deps) => {
|
|
1436
|
+
const result = flip$1(options);
|
|
1437
|
+
return {
|
|
1438
|
+
name: result.name,
|
|
1439
|
+
fn: result.fn,
|
|
1440
|
+
options: [options, deps]
|
|
1441
|
+
};
|
|
1442
|
+
};
|
|
1443
|
+
/**
|
|
1444
|
+
* Provides data that allows you to change the size of the floating element —
|
|
1445
|
+
* for instance, prevent it from overflowing the clipping boundary or match the
|
|
1446
|
+
* width of the reference element.
|
|
1447
|
+
* @see https://floating-ui.com/docs/size
|
|
1448
|
+
*/
|
|
1449
|
+
const size = (options, deps) => {
|
|
1450
|
+
const result = size$1(options);
|
|
1451
|
+
return {
|
|
1452
|
+
name: result.name,
|
|
1453
|
+
fn: result.fn,
|
|
1454
|
+
options: [options, deps]
|
|
1455
|
+
};
|
|
1456
|
+
};
|
|
1457
|
+
//#endregion
|
|
1458
|
+
export { isShadowRoot as A, getParentNode as C, isLastTraversableNode as D, isHTMLElement as E, isNode as O, getOverflowAncestors as S, isElement as T, getSideAxis as _, size as a, getComputedStyle$1 as b, platform as c, floor as d, getAlignment as f, getSide as g, getPaddingObject as h, shift as i, isOverflowElement as k, clamp as l, getAxisLength as m, limitShift as n, useFloating as o, getAlignmentAxis as p, offset as r, autoUpdate as s, flip as t, evaluate as u, rectToClientRect as v, getWindow as w, getNodeName as x, round as y };
|