@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,441 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { n as useIsoLayoutEffect } from "./safeReact-ek77ilng4ekk7mgz.js";
|
|
3
|
+
import { $ as getTarget, G as ARROW_DOWN, J as ARROW_UP, K as ARROW_LEFT, Q as contains, T as isTypeableElement, X as activeElement, at as stopEvent, f as getMaxListIndex, g as isIndexOutOfListBounds, it as isVirtualPointerEvent, m as getNextListIndex, p as getMinListIndex, q as ARROW_RIGHT, rt as isVirtualClick, v as ownerDocument, w as isTypeableCombobox, y as getFloatingFocusElement } from "./vendor-utils-io8z5lsfxq8m2dcc.js";
|
|
4
|
+
import { n as webkit } from "./engine-hzmefiqm63hu0c7i.js";
|
|
5
|
+
import { E as isHTMLElement } from "./vendor-floating-ui-fqblx3wa0r71mjoo.js";
|
|
6
|
+
import { t as createChangeEventDetails } from "./createBaseUIEventDetails-nvee6bghv2reeqdb.js";
|
|
7
|
+
import { S as listNavigation, u as focusOut } from "./reason-parts-hssx64rmlxyn6gw5.js";
|
|
8
|
+
import { t as useValueAsRef } from "./useValueAsRef-dv0tmfr1xlpzdlru.js";
|
|
9
|
+
import { t as useStableCallback } from "./useStableCallback-le5qgj6p9l04729n.js";
|
|
10
|
+
import { n as useAnimationFrame } from "./useAnimationFrame-k9lqdj9quln3sd85.js";
|
|
11
|
+
import { s as enqueueFocus } from "./useScrollLock-le7ajwlt7oh6fzxi.js";
|
|
12
|
+
import { a as useFloatingTree, i as useFloatingParentNodeId } from "./FloatingTree-kiyzavvaum442o1s.js";
|
|
13
|
+
import * as React$1 from "react";
|
|
14
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/floating-ui-react/hooks/useListNavigation.mjs
|
|
15
|
+
function isStationaryWebKitPointer(event) {
|
|
16
|
+
return webkit && event.movementX === 0 && event.movementY === 0;
|
|
17
|
+
}
|
|
18
|
+
function doSwitch(orientation, vertical, horizontal) {
|
|
19
|
+
switch (orientation) {
|
|
20
|
+
case "vertical": return vertical;
|
|
21
|
+
case "horizontal": return horizontal;
|
|
22
|
+
default: return vertical || horizontal;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function isMainOrientationKey(key, orientation) {
|
|
26
|
+
return doSwitch(orientation, key === "ArrowUp" || key === "ArrowDown", key === "ArrowLeft" || key === "ArrowRight");
|
|
27
|
+
}
|
|
28
|
+
function isMainOrientationToEndKey(key, orientation, rtl) {
|
|
29
|
+
return doSwitch(orientation, key === "ArrowDown", rtl ? key === "ArrowLeft" : key === "ArrowRight") || key === "Enter" || key === " " || key === "";
|
|
30
|
+
}
|
|
31
|
+
function isCrossOrientationOpenKey(key, orientation, rtl) {
|
|
32
|
+
return doSwitch(orientation, rtl ? key === ARROW_LEFT : key === ARROW_RIGHT, key === ARROW_DOWN);
|
|
33
|
+
}
|
|
34
|
+
function isCrossOrientationCloseKey(key, orientation, rtl, grid) {
|
|
35
|
+
const vertical = rtl ? key === ARROW_RIGHT : key === ARROW_LEFT;
|
|
36
|
+
const horizontal = key === ARROW_UP;
|
|
37
|
+
if (orientation === "both" || orientation === "horizontal" && grid) return key === "Escape";
|
|
38
|
+
return doSwitch(orientation, vertical, horizontal);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Adds arrow key-based navigation of a list of items, either using real DOM
|
|
42
|
+
* focus or virtual focus.
|
|
43
|
+
* @see https://floating-ui.com/docs/useListNavigation
|
|
44
|
+
*/
|
|
45
|
+
function useListNavigation(store, props) {
|
|
46
|
+
const { listRef, activeIndex, onNavigate: onNavigateProp = () => {}, enabled = true, selectedIndex = null, allowEscape = false, loopFocus = false, nested = false, rtl = false, virtual = false, focusItemOnOpen = "auto", focusItemOnHover = true, openOnArrowKeyDown = true, disabledIndices = void 0, orientation = "vertical", triggerOrientation = orientation, parentOrientation, id, resetOnPointerLeave = true, externalTree, nestedReturnFocusRef, grid: navigateGrid } = props;
|
|
47
|
+
const isGrid = navigateGrid != null;
|
|
48
|
+
if (allowEscape) {
|
|
49
|
+
if (!loopFocus) console.warn("`useListNavigation` looping must be enabled to allow escaping.");
|
|
50
|
+
if (!virtual) console.warn("`useListNavigation` must be virtual to allow escaping.");
|
|
51
|
+
}
|
|
52
|
+
if (orientation === "vertical" && isGrid) console.warn("In grid list navigation mode, the `orientation` should", "be either \"horizontal\" or \"both\".");
|
|
53
|
+
const open = store.useState("open");
|
|
54
|
+
const floatingElement = store.useState("floatingElement");
|
|
55
|
+
const domReferenceElement = store.useState("domReferenceElement");
|
|
56
|
+
const dataRef = store.context.dataRef;
|
|
57
|
+
const floatingFocusElement = getFloatingFocusElement(floatingElement);
|
|
58
|
+
const typeableComboboxReference = isTypeableCombobox(domReferenceElement);
|
|
59
|
+
const floatingFocusElementRef = useValueAsRef(floatingFocusElement);
|
|
60
|
+
const parentId = useFloatingParentNodeId();
|
|
61
|
+
const tree = useFloatingTree(externalTree);
|
|
62
|
+
const focusItemOnOpenRef = React$1.useRef(focusItemOnOpen);
|
|
63
|
+
const indexRef = React$1.useRef(selectedIndex ?? -1);
|
|
64
|
+
const keyRef = React$1.useRef(null);
|
|
65
|
+
const isPointerModalityRef = React$1.useRef(true);
|
|
66
|
+
const onNavigate = useStableCallback((event) => {
|
|
67
|
+
onNavigateProp(indexRef.current === -1 ? null : indexRef.current, event);
|
|
68
|
+
});
|
|
69
|
+
const previousMountedRef = React$1.useRef(!!floatingElement);
|
|
70
|
+
const previousOpenRef = React$1.useRef(open);
|
|
71
|
+
const forceSyncFocusRef = React$1.useRef(false);
|
|
72
|
+
const forceScrollIntoViewRef = React$1.useRef(false);
|
|
73
|
+
const cancelQueuedFocusRef = React$1.useRef(null);
|
|
74
|
+
const disabledIndicesRef = useValueAsRef(disabledIndices);
|
|
75
|
+
const latestOpenRef = useValueAsRef(open);
|
|
76
|
+
const selectedIndexRef = useValueAsRef(selectedIndex);
|
|
77
|
+
const resetOnPointerLeaveRef = useValueAsRef(resetOnPointerLeave);
|
|
78
|
+
const focusFrame = useAnimationFrame();
|
|
79
|
+
const waitForListPopulatedFrame = useAnimationFrame();
|
|
80
|
+
const focusItem = useStableCallback(() => {
|
|
81
|
+
focusFrame.cancel();
|
|
82
|
+
function runFocus(item) {
|
|
83
|
+
if (!virtual) cancelQueuedFocusRef.current = enqueueFocus(item, {
|
|
84
|
+
sync: forceSyncFocusRef.current,
|
|
85
|
+
preventScroll: true
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
const initialItem = listRef.current[indexRef.current];
|
|
89
|
+
const forceScrollIntoView = forceScrollIntoViewRef.current;
|
|
90
|
+
if (initialItem) runFocus(initialItem);
|
|
91
|
+
(forceSyncFocusRef.current ? (callback) => callback() : (callback) => focusFrame.request(callback))(() => {
|
|
92
|
+
const waitedItem = listRef.current[indexRef.current] || initialItem;
|
|
93
|
+
if (!waitedItem) return;
|
|
94
|
+
if (!initialItem) runFocus(waitedItem);
|
|
95
|
+
if (item && (forceScrollIntoView || !isPointerModalityRef.current)) waitedItem.scrollIntoView?.({
|
|
96
|
+
block: "nearest",
|
|
97
|
+
inline: "nearest"
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
useIsoLayoutEffect(() => {
|
|
102
|
+
dataRef.current.orientation = orientation;
|
|
103
|
+
}, [dataRef, orientation]);
|
|
104
|
+
useIsoLayoutEffect(() => {
|
|
105
|
+
if (!open) keyRef.current = null;
|
|
106
|
+
if (!open || focusItemOnOpen !== "auto") focusItemOnOpenRef.current = focusItemOnOpen;
|
|
107
|
+
}, [open, focusItemOnOpen]);
|
|
108
|
+
useIsoLayoutEffect(() => {
|
|
109
|
+
if (!enabled) return;
|
|
110
|
+
if (open && floatingElement) {
|
|
111
|
+
indexRef.current = selectedIndex ?? -1;
|
|
112
|
+
if (focusItemOnOpenRef.current && selectedIndex != null) {
|
|
113
|
+
forceScrollIntoViewRef.current = true;
|
|
114
|
+
onNavigate();
|
|
115
|
+
}
|
|
116
|
+
} else if (previousMountedRef.current) {
|
|
117
|
+
indexRef.current = -1;
|
|
118
|
+
onNavigate();
|
|
119
|
+
}
|
|
120
|
+
}, [
|
|
121
|
+
enabled,
|
|
122
|
+
open,
|
|
123
|
+
floatingElement,
|
|
124
|
+
selectedIndex,
|
|
125
|
+
onNavigate
|
|
126
|
+
]);
|
|
127
|
+
useIsoLayoutEffect(() => {
|
|
128
|
+
if (!enabled) return;
|
|
129
|
+
if (!open) {
|
|
130
|
+
forceSyncFocusRef.current = false;
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
if (!floatingElement) return;
|
|
134
|
+
if (activeIndex == null) {
|
|
135
|
+
forceSyncFocusRef.current = false;
|
|
136
|
+
if (selectedIndexRef.current != null) return;
|
|
137
|
+
if (previousMountedRef.current) {
|
|
138
|
+
indexRef.current = -1;
|
|
139
|
+
focusItem();
|
|
140
|
+
}
|
|
141
|
+
if ((!previousOpenRef.current || !previousMountedRef.current) && focusItemOnOpenRef.current && (keyRef.current != null || focusItemOnOpenRef.current === true && keyRef.current == null)) {
|
|
142
|
+
let runs = 0;
|
|
143
|
+
const waitForListPopulated = () => {
|
|
144
|
+
if (listRef.current[0] == null) {
|
|
145
|
+
if (runs < 2) (runs ? (callback) => waitForListPopulatedFrame.request(callback) : queueMicrotask)(waitForListPopulated);
|
|
146
|
+
runs += 1;
|
|
147
|
+
} else {
|
|
148
|
+
indexRef.current = keyRef.current == null || isMainOrientationToEndKey(keyRef.current, triggerOrientation, rtl) || nested ? getMinListIndex(listRef) : getMaxListIndex(listRef);
|
|
149
|
+
keyRef.current = null;
|
|
150
|
+
onNavigate();
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
waitForListPopulated();
|
|
154
|
+
}
|
|
155
|
+
} else if (!isIndexOutOfListBounds(listRef.current, activeIndex)) {
|
|
156
|
+
indexRef.current = activeIndex;
|
|
157
|
+
focusItem();
|
|
158
|
+
forceScrollIntoViewRef.current = false;
|
|
159
|
+
}
|
|
160
|
+
}, [
|
|
161
|
+
enabled,
|
|
162
|
+
open,
|
|
163
|
+
floatingElement,
|
|
164
|
+
activeIndex,
|
|
165
|
+
selectedIndexRef,
|
|
166
|
+
nested,
|
|
167
|
+
listRef,
|
|
168
|
+
triggerOrientation,
|
|
169
|
+
rtl,
|
|
170
|
+
onNavigate,
|
|
171
|
+
focusItem,
|
|
172
|
+
waitForListPopulatedFrame
|
|
173
|
+
]);
|
|
174
|
+
useIsoLayoutEffect(() => {
|
|
175
|
+
if (!enabled || floatingElement || !tree || virtual || !previousMountedRef.current) return;
|
|
176
|
+
const nodes = tree.nodesRef.current;
|
|
177
|
+
const parent = nodes.find((node) => node.id === parentId)?.context?.elements.floating;
|
|
178
|
+
const activeEl = activeElement(ownerDocument(domReferenceElement ?? parent ?? null));
|
|
179
|
+
const treeContainsActiveEl = nodes.some((node) => node.context && contains(node.context.elements.floating, activeEl));
|
|
180
|
+
if (parent && !treeContainsActiveEl && isPointerModalityRef.current) parent.focus({ preventScroll: true });
|
|
181
|
+
}, [
|
|
182
|
+
enabled,
|
|
183
|
+
floatingElement,
|
|
184
|
+
domReferenceElement,
|
|
185
|
+
tree,
|
|
186
|
+
parentId,
|
|
187
|
+
virtual
|
|
188
|
+
]);
|
|
189
|
+
useIsoLayoutEffect(() => {
|
|
190
|
+
previousOpenRef.current = open;
|
|
191
|
+
previousMountedRef.current = !!floatingElement;
|
|
192
|
+
});
|
|
193
|
+
const hasActiveIndex = activeIndex != null;
|
|
194
|
+
const syncCurrentTarget = useStableCallback((event) => {
|
|
195
|
+
if (!latestOpenRef.current) return;
|
|
196
|
+
const index = listRef.current.indexOf(event.currentTarget);
|
|
197
|
+
if (index !== -1 && (indexRef.current !== index || activeIndex !== index)) {
|
|
198
|
+
indexRef.current = index;
|
|
199
|
+
onNavigate(event);
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
const getParentOrientation = useStableCallback(() => {
|
|
203
|
+
return parentOrientation ?? tree?.nodesRef.current.find((node) => node.id === parentId)?.context?.dataRef?.current.orientation;
|
|
204
|
+
});
|
|
205
|
+
const getMinEnabledIndex = useStableCallback(() => {
|
|
206
|
+
return getMinListIndex(listRef, disabledIndicesRef.current);
|
|
207
|
+
});
|
|
208
|
+
const commonOnKeyDown = useStableCallback((event) => {
|
|
209
|
+
isPointerModalityRef.current = false;
|
|
210
|
+
forceSyncFocusRef.current = true;
|
|
211
|
+
if (event.which === 229) return;
|
|
212
|
+
if (!latestOpenRef.current && event.currentTarget === floatingFocusElementRef.current) return;
|
|
213
|
+
if (nested && isCrossOrientationCloseKey(event.key, orientation, rtl, isGrid)) {
|
|
214
|
+
if (!isMainOrientationKey(event.key, getParentOrientation())) stopEvent(event);
|
|
215
|
+
store.setOpen(false, createChangeEventDetails(listNavigation, event.nativeEvent));
|
|
216
|
+
const returnElement = nestedReturnFocusRef?.current ?? domReferenceElement;
|
|
217
|
+
if (isHTMLElement(returnElement)) returnElement.focus();
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
if (activeIndex != null && activeIndex !== indexRef.current && !isIndexOutOfListBounds(listRef.current, activeIndex)) indexRef.current = activeIndex;
|
|
221
|
+
const currentIndex = indexRef.current;
|
|
222
|
+
const minIndex = getMinListIndex(listRef, disabledIndices);
|
|
223
|
+
const maxIndex = getMaxListIndex(listRef, disabledIndices);
|
|
224
|
+
if (!typeableComboboxReference) {
|
|
225
|
+
if (event.key === "Home") {
|
|
226
|
+
stopEvent(event);
|
|
227
|
+
indexRef.current = minIndex;
|
|
228
|
+
onNavigate(event);
|
|
229
|
+
}
|
|
230
|
+
if (event.key === "End") {
|
|
231
|
+
stopEvent(event);
|
|
232
|
+
indexRef.current = maxIndex;
|
|
233
|
+
onNavigate(event);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
if (navigateGrid != null) {
|
|
237
|
+
const index = navigateGrid(event, indexRef.current, listRef, orientation, loopFocus, rtl, disabledIndices, minIndex, maxIndex);
|
|
238
|
+
if (index != null && index !== indexRef.current) {
|
|
239
|
+
indexRef.current = index;
|
|
240
|
+
onNavigate(event);
|
|
241
|
+
}
|
|
242
|
+
if (orientation === "both") return;
|
|
243
|
+
}
|
|
244
|
+
if (isMainOrientationKey(event.key, orientation)) {
|
|
245
|
+
stopEvent(event);
|
|
246
|
+
const focusedElement = activeElement(event.currentTarget.ownerDocument);
|
|
247
|
+
if (open && !virtual && contains(event.currentTarget, focusedElement) && !listRef.current.some((item) => item != null && contains(item, focusedElement))) {
|
|
248
|
+
indexRef.current = isMainOrientationToEndKey(event.key, orientation, rtl) ? minIndex : maxIndex;
|
|
249
|
+
onNavigate(event);
|
|
250
|
+
if (activeIndex === indexRef.current) focusItem();
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
const { index, wrapped } = getNextListIndex(listRef.current, currentIndex, {
|
|
254
|
+
decrement: !isMainOrientationToEndKey(event.key, orientation, rtl),
|
|
255
|
+
loopFocus,
|
|
256
|
+
allowEscape,
|
|
257
|
+
disabledIndices,
|
|
258
|
+
minIndex,
|
|
259
|
+
maxIndex
|
|
260
|
+
});
|
|
261
|
+
if (wrapped) forceSyncFocusRef.current = false;
|
|
262
|
+
indexRef.current = index;
|
|
263
|
+
onNavigate(event);
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
const item = React$1.useMemo(() => {
|
|
267
|
+
return {
|
|
268
|
+
onFocus(event) {
|
|
269
|
+
forceSyncFocusRef.current = true;
|
|
270
|
+
syncCurrentTarget(event);
|
|
271
|
+
},
|
|
272
|
+
onClick({ currentTarget }) {
|
|
273
|
+
if (!virtual) currentTarget.focus({ preventScroll: true });
|
|
274
|
+
},
|
|
275
|
+
onMouseMove(event) {
|
|
276
|
+
if (isStationaryWebKitPointer(event)) return;
|
|
277
|
+
forceSyncFocusRef.current = true;
|
|
278
|
+
forceScrollIntoViewRef.current = false;
|
|
279
|
+
if (focusItemOnHover) syncCurrentTarget(event);
|
|
280
|
+
},
|
|
281
|
+
onPointerLeave(event) {
|
|
282
|
+
if (!latestOpenRef.current || !isPointerModalityRef.current || event.pointerType === "touch") return;
|
|
283
|
+
forceSyncFocusRef.current = true;
|
|
284
|
+
const relatedTarget = event.relatedTarget;
|
|
285
|
+
if (!focusItemOnHover || listRef.current.includes(relatedTarget)) return;
|
|
286
|
+
if (!resetOnPointerLeaveRef.current) return;
|
|
287
|
+
cancelQueuedFocusRef.current?.();
|
|
288
|
+
cancelQueuedFocusRef.current = null;
|
|
289
|
+
indexRef.current = -1;
|
|
290
|
+
onNavigate(event);
|
|
291
|
+
if (!virtual) {
|
|
292
|
+
const floatingFocusEl = floatingFocusElementRef.current;
|
|
293
|
+
const activeEl = activeElement(ownerDocument(floatingFocusEl));
|
|
294
|
+
if (floatingFocusEl && contains(floatingFocusEl, activeEl)) floatingFocusEl.focus({ preventScroll: true });
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
}, [
|
|
299
|
+
syncCurrentTarget,
|
|
300
|
+
latestOpenRef,
|
|
301
|
+
floatingFocusElementRef,
|
|
302
|
+
focusItemOnHover,
|
|
303
|
+
listRef,
|
|
304
|
+
onNavigate,
|
|
305
|
+
resetOnPointerLeaveRef,
|
|
306
|
+
virtual
|
|
307
|
+
]);
|
|
308
|
+
const ariaActiveDescendantProp = React$1.useMemo(() => {
|
|
309
|
+
return virtual && open && hasActiveIndex && { "aria-activedescendant": `${id}-${activeIndex}` };
|
|
310
|
+
}, [
|
|
311
|
+
virtual,
|
|
312
|
+
open,
|
|
313
|
+
hasActiveIndex,
|
|
314
|
+
id,
|
|
315
|
+
activeIndex
|
|
316
|
+
]);
|
|
317
|
+
const floating = React$1.useMemo(() => {
|
|
318
|
+
return {
|
|
319
|
+
...!typeableComboboxReference ? ariaActiveDescendantProp : {},
|
|
320
|
+
onKeyDown(event) {
|
|
321
|
+
if (event.key === "Tab" && event.shiftKey && open && !virtual) {
|
|
322
|
+
const target = getTarget(event.nativeEvent);
|
|
323
|
+
if (target && !contains(floatingFocusElementRef.current, target)) return;
|
|
324
|
+
stopEvent(event);
|
|
325
|
+
const details = createChangeEventDetails(focusOut, event.nativeEvent);
|
|
326
|
+
store.setOpen(false, details);
|
|
327
|
+
const returnElement = nestedReturnFocusRef?.current ?? domReferenceElement;
|
|
328
|
+
if (!details.isCanceled && isHTMLElement(returnElement)) returnElement.focus();
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
commonOnKeyDown(event);
|
|
332
|
+
},
|
|
333
|
+
onPointerMove(event) {
|
|
334
|
+
if (isStationaryWebKitPointer(event)) return;
|
|
335
|
+
isPointerModalityRef.current = true;
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
}, [
|
|
339
|
+
ariaActiveDescendantProp,
|
|
340
|
+
commonOnKeyDown,
|
|
341
|
+
floatingFocusElementRef,
|
|
342
|
+
typeableComboboxReference,
|
|
343
|
+
store,
|
|
344
|
+
open,
|
|
345
|
+
virtual,
|
|
346
|
+
domReferenceElement,
|
|
347
|
+
nestedReturnFocusRef
|
|
348
|
+
]);
|
|
349
|
+
const trigger = React$1.useMemo(() => {
|
|
350
|
+
function openOnNavigationKeyDown(event) {
|
|
351
|
+
store.setOpen(true, createChangeEventDetails(listNavigation, event.nativeEvent, event.currentTarget));
|
|
352
|
+
}
|
|
353
|
+
function checkVirtualMouse(event) {
|
|
354
|
+
if (focusItemOnOpen === "auto" && isVirtualClick(event.nativeEvent)) focusItemOnOpenRef.current = !virtual;
|
|
355
|
+
}
|
|
356
|
+
function checkVirtualPointer(event) {
|
|
357
|
+
focusItemOnOpenRef.current = focusItemOnOpen;
|
|
358
|
+
if (focusItemOnOpen === "auto" && isVirtualPointerEvent(event.nativeEvent)) focusItemOnOpenRef.current = true;
|
|
359
|
+
}
|
|
360
|
+
return {
|
|
361
|
+
onKeyDown(event) {
|
|
362
|
+
const currentOpen = store.select("open");
|
|
363
|
+
isPointerModalityRef.current = false;
|
|
364
|
+
const isArrowKey = event.key.startsWith("Arrow");
|
|
365
|
+
const isParentCrossOpenKey = isCrossOrientationOpenKey(event.key, getParentOrientation(), rtl);
|
|
366
|
+
const isMainKey = isMainOrientationKey(event.key, currentOpen ? orientation : triggerOrientation);
|
|
367
|
+
const isNavigationKey = (nested ? isParentCrossOpenKey : isMainKey) || event.key === "Enter" || event.key.trim() === "";
|
|
368
|
+
if (virtual && currentOpen && (!nested || isTypeableElement(event.currentTarget))) return commonOnKeyDown(event);
|
|
369
|
+
if (!currentOpen && !openOnArrowKeyDown && isArrowKey) return;
|
|
370
|
+
if (isNavigationKey) {
|
|
371
|
+
const isParentMainKey = isMainOrientationKey(event.key, getParentOrientation());
|
|
372
|
+
keyRef.current = nested && isParentMainKey ? null : event.key;
|
|
373
|
+
}
|
|
374
|
+
if (nested) {
|
|
375
|
+
if (isParentCrossOpenKey) {
|
|
376
|
+
stopEvent(event);
|
|
377
|
+
if (currentOpen) {
|
|
378
|
+
indexRef.current = getMinEnabledIndex();
|
|
379
|
+
onNavigate(event);
|
|
380
|
+
if (virtual) floatingFocusElementRef.current?.focus();
|
|
381
|
+
} else openOnNavigationKeyDown(event);
|
|
382
|
+
}
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
if (isMainKey) {
|
|
386
|
+
if (selectedIndexRef.current != null) indexRef.current = selectedIndexRef.current;
|
|
387
|
+
stopEvent(event);
|
|
388
|
+
if (!currentOpen && openOnArrowKeyDown) openOnNavigationKeyDown(event);
|
|
389
|
+
else commonOnKeyDown(event);
|
|
390
|
+
if (currentOpen) onNavigate(event);
|
|
391
|
+
}
|
|
392
|
+
},
|
|
393
|
+
onFocus(event) {
|
|
394
|
+
if (event.target !== event.currentTarget) return;
|
|
395
|
+
if (store.select("open") && !virtual) {
|
|
396
|
+
indexRef.current = -1;
|
|
397
|
+
onNavigate(event);
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
onPointerDown: checkVirtualPointer,
|
|
401
|
+
onPointerEnter: checkVirtualPointer,
|
|
402
|
+
onMouseDown: checkVirtualMouse,
|
|
403
|
+
onClick: checkVirtualMouse
|
|
404
|
+
};
|
|
405
|
+
}, [
|
|
406
|
+
commonOnKeyDown,
|
|
407
|
+
focusItemOnOpen,
|
|
408
|
+
getMinEnabledIndex,
|
|
409
|
+
nested,
|
|
410
|
+
onNavigate,
|
|
411
|
+
store,
|
|
412
|
+
openOnArrowKeyDown,
|
|
413
|
+
orientation,
|
|
414
|
+
triggerOrientation,
|
|
415
|
+
getParentOrientation,
|
|
416
|
+
rtl,
|
|
417
|
+
selectedIndexRef,
|
|
418
|
+
virtual,
|
|
419
|
+
floatingFocusElementRef
|
|
420
|
+
]);
|
|
421
|
+
const reference = React$1.useMemo(() => {
|
|
422
|
+
return {
|
|
423
|
+
...ariaActiveDescendantProp,
|
|
424
|
+
...trigger
|
|
425
|
+
};
|
|
426
|
+
}, [ariaActiveDescendantProp, trigger]);
|
|
427
|
+
return React$1.useMemo(() => enabled ? {
|
|
428
|
+
reference,
|
|
429
|
+
floating,
|
|
430
|
+
item,
|
|
431
|
+
trigger
|
|
432
|
+
} : {}, [
|
|
433
|
+
enabled,
|
|
434
|
+
reference,
|
|
435
|
+
floating,
|
|
436
|
+
trigger,
|
|
437
|
+
item
|
|
438
|
+
]);
|
|
439
|
+
}
|
|
440
|
+
//#endregion
|
|
441
|
+
export { useListNavigation as a, isMainOrientationToEndKey as i, isCrossOrientationOpenKey as n, isMainOrientationKey as r, isCrossOrientationCloseKey as t };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { o as EMPTY_ARRAY } from "./useRenderElement-nkklxbq1rp7h2kw0.js";
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
//#region ../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.2.4_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/utils/useOnMount.mjs
|
|
5
|
+
/**
|
|
6
|
+
* A React.useEffect equivalent that runs once, when the component is mounted.
|
|
7
|
+
*/
|
|
8
|
+
function useOnMount(fn) {
|
|
9
|
+
React$1.useEffect(fn, EMPTY_ARRAY);
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { useOnMount as t };
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { c as NOOP } from "./useRenderElement-nkklxbq1rp7h2kw0.js";
|
|
3
|
+
import { W as startingStyle } from "./vendor-utils-io8z5lsfxq8m2dcc.js";
|
|
4
|
+
import { t as useStableCallback } from "./useStableCallback-le5qgj6p9l04729n.js";
|
|
5
|
+
import { n as useAnimationFrame } from "./useAnimationFrame-k9lqdj9quln3sd85.js";
|
|
6
|
+
import { t as getFiniteAnimations } from "./getFiniteAnimations-jwd833ybtz81j5f0.js";
|
|
7
|
+
import * as React$1 from "react";
|
|
8
|
+
import * as ReactDOM from "react-dom";
|
|
9
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/utils/resolveRef.mjs
|
|
10
|
+
/**
|
|
11
|
+
* If the provided argument is a ref object, returns its `current` value.
|
|
12
|
+
* Otherwise, returns the argument itself.
|
|
13
|
+
*/
|
|
14
|
+
function resolveRef(maybeRef) {
|
|
15
|
+
if (maybeRef == null) return maybeRef;
|
|
16
|
+
return "current" in maybeRef ? maybeRef.current : maybeRef;
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/internals/useAnimationsFinished.mjs
|
|
20
|
+
let pendingCallbacks = null;
|
|
21
|
+
/**
|
|
22
|
+
* Runs the callback in a synchronous flush before the browser paints, so that the
|
|
23
|
+
* browser doesn't paint an intermediate frame: https://github.com/mui/base-ui/issues/979
|
|
24
|
+
* Callbacks that become ready within the same microtask checkpoint (e.g. multiple elements
|
|
25
|
+
* whose animations finish together) are batched into a single commit:
|
|
26
|
+
* https://github.com/mui/base-ui/issues/5481
|
|
27
|
+
*/
|
|
28
|
+
function flushBeforePaint(fn) {
|
|
29
|
+
if (!pendingCallbacks) {
|
|
30
|
+
const callbacks = [];
|
|
31
|
+
pendingCallbacks = callbacks;
|
|
32
|
+
queueMicrotask(() => {
|
|
33
|
+
pendingCallbacks = null;
|
|
34
|
+
ReactDOM.flushSync(() => {
|
|
35
|
+
for (const callback of callbacks) callback();
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
pendingCallbacks.push(fn);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Executes a function once all animations have finished on the provided element.
|
|
43
|
+
* If an animation is canceled, waits for any replacement animations before executing.
|
|
44
|
+
* @param elementOrRef - The element to watch for animations.
|
|
45
|
+
* @param waitForStartingStyleRemoved - Whether to wait for [data-starting-style] to be removed before checking for animations.
|
|
46
|
+
* @param batch - Whether completions ready in the same microtask may be coalesced into a single
|
|
47
|
+
* commit. A batched callback runs before earlier callbacks' React updates have committed, so only
|
|
48
|
+
* opt in when the callback doesn't read state that another completion can change.
|
|
49
|
+
* @returns A function that takes a callback to execute once all animations have finished, and an optional AbortSignal to abort the callback
|
|
50
|
+
*/
|
|
51
|
+
function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, batch = false) {
|
|
52
|
+
const frame = useAnimationFrame();
|
|
53
|
+
return useStableCallback((fnToExecute, signal = null) => {
|
|
54
|
+
frame.cancel();
|
|
55
|
+
const element = resolveRef(elementOrRef);
|
|
56
|
+
if (element == null) return;
|
|
57
|
+
const resolvedElement = element;
|
|
58
|
+
const done = () => {
|
|
59
|
+
if (!batch) {
|
|
60
|
+
ReactDOM.flushSync(fnToExecute);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
flushBeforePaint(() => {
|
|
64
|
+
if (!signal?.aborted) fnToExecute();
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
if (typeof resolvedElement.getAnimations !== "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED) {
|
|
68
|
+
fnToExecute();
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
function exec() {
|
|
72
|
+
Promise.all(getFiniteAnimations(resolvedElement).map((animation) => animation.finished.then(NOOP))).then(() => {
|
|
73
|
+
if (!signal?.aborted) done();
|
|
74
|
+
}, () => {
|
|
75
|
+
if (signal?.aborted) return;
|
|
76
|
+
if (getFiniteAnimations(resolvedElement).some((animation) => animation.pending || animation.playState !== "finished")) {
|
|
77
|
+
exec();
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
done();
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
if (waitForStartingStyleRemoved) {
|
|
84
|
+
const startingStyleAttribute = startingStyle;
|
|
85
|
+
if (!resolvedElement.hasAttribute(startingStyleAttribute)) {
|
|
86
|
+
frame.request(exec);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const attributeObserver = new MutationObserver(() => {
|
|
90
|
+
if (!resolvedElement.hasAttribute(startingStyleAttribute)) {
|
|
91
|
+
attributeObserver.disconnect();
|
|
92
|
+
exec();
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
attributeObserver.observe(resolvedElement, {
|
|
96
|
+
attributes: true,
|
|
97
|
+
attributeFilter: [startingStyleAttribute]
|
|
98
|
+
});
|
|
99
|
+
signal?.addEventListener("abort", () => attributeObserver.disconnect(), { once: true });
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
frame.request(exec);
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs
|
|
107
|
+
/**
|
|
108
|
+
* Calls the provided function when the CSS open/close animation or transition completes.
|
|
109
|
+
*/
|
|
110
|
+
function useOpenChangeComplete(parameters) {
|
|
111
|
+
const { enabled = true, open, ref, batch = false, onComplete: onCompleteParam } = parameters;
|
|
112
|
+
const onComplete = useStableCallback(onCompleteParam);
|
|
113
|
+
const runOnceAnimationsFinish = useAnimationsFinished(ref, open, batch);
|
|
114
|
+
React$1.useEffect(() => {
|
|
115
|
+
if (!enabled) return;
|
|
116
|
+
const abortController = new AbortController();
|
|
117
|
+
runOnceAnimationsFinish(onComplete, abortController.signal);
|
|
118
|
+
return () => {
|
|
119
|
+
abortController.abort();
|
|
120
|
+
};
|
|
121
|
+
}, [
|
|
122
|
+
enabled,
|
|
123
|
+
open,
|
|
124
|
+
onComplete,
|
|
125
|
+
runOnceAnimationsFinish
|
|
126
|
+
]);
|
|
127
|
+
}
|
|
128
|
+
//#endregion
|
|
129
|
+
export { useAnimationsFinished as n, resolveRef as r, useOpenChangeComplete as t };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { c as NOOP } from "./useRenderElement-nkklxbq1rp7h2kw0.js";
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
import { useSyncExternalStore as useSyncExternalStore$1 } from "use-sync-external-store/shim";
|
|
5
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/utils/popups/usePopupHandleStore.mjs
|
|
6
|
+
/**
|
|
7
|
+
* Reads the store currently exposed by a popup handle and subscribes to store-pointer changes.
|
|
8
|
+
* Detached triggers use this to follow a handle as a root attaches or detaches: while no root is
|
|
9
|
+
* attached, the handle exposes its fallback store; once a root attaches, subscribers re-render and
|
|
10
|
+
* read from the live root store.
|
|
11
|
+
*
|
|
12
|
+
* Returns `undefined` when no handle is provided so callers can fall back to their root context.
|
|
13
|
+
*
|
|
14
|
+
* @param handle The popup handle to read from, or `undefined` when the trigger is not handle-bound.
|
|
15
|
+
*/
|
|
16
|
+
function usePopupHandleStore(handle) {
|
|
17
|
+
const subscribe = React$1.useCallback((listener) => {
|
|
18
|
+
if (handle === void 0) return NOOP;
|
|
19
|
+
return handle.subscribeStore(listener);
|
|
20
|
+
}, [handle]);
|
|
21
|
+
const getSnapshot = React$1.useCallback(() => {
|
|
22
|
+
return handle === void 0 ? void 0 : handle.store;
|
|
23
|
+
}, [handle]);
|
|
24
|
+
return useSyncExternalStore$1(subscribe, getSnapshot, () => handle?.serverStore);
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { usePopupHandleStore as t };
|