@fldr/ui 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2366 -0
- package/LICENSE +21 -0
- package/README.md +488 -2
- package/ai/USAGE.md +216 -0
- package/ai/component-registry.json +8694 -0
- package/ai/component-registry.md +11933 -0
- package/ai/schemas.ts +1239 -0
- package/bin/kumo.js +36 -0
- package/dist/.build-complete +1 -0
- package/dist/ai/schemas.d.ts +3229 -0
- package/dist/ai/schemas.js +5963 -0
- package/dist/blocks-source/delete-resource/delete-resource.test.tsx +21 -0
- package/dist/blocks-source/delete-resource/delete-resource.tsx +219 -0
- package/dist/blocks-source/page-header/page-header.tsx +99 -0
- package/dist/blocks-source/resource-list/resource-list.test.tsx +28 -0
- package/dist/blocks-source/resource-list/resource-list.tsx +66 -0
- package/dist/button-DzavLWXm.d.ts +227 -0
- package/dist/catalog.d.ts +380 -0
- package/dist/catalog.js +387 -0
- package/dist/chunks/AccordionPanelDataAttributes-mmrmkky28u1010l5.js +457 -0
- package/dist/chunks/AlertDialogTrigger-l1r1gbxcky1xq889.js +24 -0
- package/dist/chunks/AlertDialogTriggerDataAttributes-go49qon601catpgn.js +56 -0
- package/dist/chunks/AutocompleteItem-36ysm5nwbsd0snr6.js +70 -0
- package/dist/chunks/AutocompleteItemDataAttributes-n5rigpf0s9ylnwi3.js +232 -0
- package/dist/chunks/AutocompleteSeparator-bnqeqh7i983d92gx.js +12 -0
- package/dist/chunks/AvatarImageDataAttributes-jw70u384c83lhqfp.js +247 -0
- package/dist/chunks/ButtonDataAttributes-nceand1fi7lvnmkb.js +35 -0
- package/dist/chunks/CSPContext-iv67i0qqhihg8mur.js +11 -0
- package/dist/chunks/CSPProvider-finau3a8hnc9o2td.js +24 -0
- package/dist/chunks/CheckboxGroup-581mfftu99wvjb3a.js +190 -0
- package/dist/chunks/CheckboxGroupContext-jf1bt3znvqlhrql6.js +10 -0
- package/dist/chunks/CheckboxGroupDataAttributes-nskqcxts64symbvf.js +10 -0
- package/dist/chunks/CheckboxIndicator-i13dmhacfgqo328c.js +414 -0
- package/dist/chunks/CheckboxIndicatorDataAttributes-3p29ju7nkczz1l2y.js +85 -0
- package/dist/chunks/CollapsiblePanel-md5suzmtnsyz1kab.js +178 -0
- package/dist/chunks/CollapsibleRootDataAttributes-bynmgxmt4jikaoha.js +36 -0
- package/dist/chunks/ComboboxClear-ioejwvtnmqanph88.js +294 -0
- package/dist/chunks/ComboboxClearDataAttributes-lo0enstdmrqpywsy.js +402 -0
- package/dist/chunks/ComboboxEmpty-gkt1y5b81a4983v7.js +1950 -0
- package/dist/chunks/ComboboxItemIndicatorDataAttributes-iku7l9ig0ve09an4.js +259 -0
- package/dist/chunks/ComboboxPopup-n8cbgys9st446j1i.js +205 -0
- package/dist/chunks/CompositeItem-kepwg8jtvgap06o6.js +20 -0
- package/dist/chunks/CompositeList-gwuaf6d14s4da0j0.js +182 -0
- package/dist/chunks/CompositeListContext-bejvmlu39hsfjzgu.js +15 -0
- package/dist/chunks/CompositeRoot-dnlkb27uw4g5aocf.js +223 -0
- package/dist/chunks/CompositeRootContext-obm54j7y6s86qwhq.js +12 -0
- package/dist/chunks/ContextMenuTriggerDataAttributes-xwozccynxv6pk5s0.js +237 -0
- package/dist/chunks/DialogBackdropDataAttributes-jwqxd6jla03xh8ke.js +28 -0
- package/dist/chunks/DialogCloseDataAttributes-12m7gwh3i6fd7d05.js +76 -0
- package/dist/chunks/DialogPopup-n6w7b389e7bs0472.js +133 -0
- package/dist/chunks/DialogRoot-hkkqj7vcjpkx8qk8.js +16 -0
- package/dist/chunks/DialogTrigger-kpugfkbfswqrus4u.js +142 -0
- package/dist/chunks/DialogTriggerDataAttributes-bp9bu13cvwuddh5b.js +18 -0
- package/dist/chunks/DialogViewportDataAttributes-mma9emv1edsc1vuy.js +78 -0
- package/dist/chunks/DirectionContext-kpby968j030psajn.js +10 -0
- package/dist/chunks/DirectionProvider-cg0pwzgdyg6r73r6.js +21 -0
- package/dist/chunks/DrawerViewport-mzqpwvqtylnad8ib.js +1532 -0
- package/dist/chunks/DrawerViewportDataAttributes-dd9593zm9fl9vcsm.js +1072 -0
- package/dist/chunks/FieldControl-hjj2tcqruozadgdi.js +122 -0
- package/dist/chunks/FieldDescription-orix2gepowrp5ni4.js +122 -0
- package/dist/chunks/FieldItemContext-ohsf45im6xhpay40.js +10 -0
- package/dist/chunks/FieldItemDataAttributes-m52srx69pispz49i.js +283 -0
- package/dist/chunks/FieldLabel-fjc7tdis7rcbq8o4.js +353 -0
- package/dist/chunks/FieldsetLegend-gl9z9eezr0xg9zr7.js +61 -0
- package/dist/chunks/FieldsetLegendDataAttributes-fn20251jxjqkpkxm.js +17 -0
- package/dist/chunks/FieldsetRootContext-fphwizvcm55ydg94.js +12 -0
- package/dist/chunks/FloatingPortalLite-j7dsy7gokbxdoe1i.js +25 -0
- package/dist/chunks/FloatingRootStore-men6ufp3a2b296fh.js +840 -0
- package/dist/chunks/FloatingTree-kiyzavvaum442o1s.js +115 -0
- package/dist/chunks/Form-oz425k7r4abea8o4.js +113 -0
- package/dist/chunks/FormContext-jv19engyccpf6xcl.js +18 -0
- package/dist/chunks/Input-ozudotydd679ly63.js +20 -0
- package/dist/chunks/InputDataAttributes-oy8t6q5y5t8ik02j.js +42 -0
- package/dist/chunks/ItemIndicator-cvf8cw5fv5l3cd8j.js +37 -0
- package/dist/chunks/LabelableContext-dz4wz3lu3lgqusu7.js +135 -0
- package/dist/chunks/ListboxSeparator-skazx18vzzj7i9zp.js +21 -0
- package/dist/chunks/MenuClearDataAttributes-fo0pekd36n56mdxu.js +1645 -0
- package/dist/chunks/MenuSubmenuTrigger-hm5xbgik6aq95x35.js +1976 -0
- package/dist/chunks/MenuSubmenuTriggerDataAttributes-gdfxdjymgmnaxdds.js +372 -0
- package/dist/chunks/MenuTrigger-dlfvicsaggss0o9m.js +265 -0
- package/dist/chunks/Menubar-ja5int05ihjj0ra4.js +116 -0
- package/dist/chunks/MenubarContext-ooz0h08i55c8oip5.js +12 -0
- package/dist/chunks/MeterLabel-cykbkvqys5263z05.js +148 -0
- package/dist/chunks/NavigationMenuIconDataAttributes-l82pkpm61d0meqxf.js +1654 -0
- package/dist/chunks/NullStore-my62xo2vfcfkerri.js +110 -0
- package/dist/chunks/NumberFieldScrubAreaCursorDataAttributes-k2lsbk35svshnwf5.js +1493 -0
- package/dist/chunks/OTPFieldInputDataAttributes-gvgtu2gg85kgjzwr.js +683 -0
- package/dist/chunks/PopoverViewport-peh28i8q4hqfjy97.js +713 -0
- package/dist/chunks/PopoverViewportDataAttributes-gplhq9d7ffp9q8u3.js +329 -0
- package/dist/chunks/PrehydrationScript-hs2je3mndbxuts7w.js +78 -0
- package/dist/chunks/PreviewCardViewportDataAttributes-bgfwmyshey7fx6nr.js +914 -0
- package/dist/chunks/ProgressLabelDataAttributes-j8mutcz11ei0ohvj.js +287 -0
- package/dist/chunks/RadioGroup-kioqngmmuo7a1lfa.js +163 -0
- package/dist/chunks/RadioGroupContext-dr6uihsj7oky0eol.js +10 -0
- package/dist/chunks/RadioGroupDataAttributes-dpdr6xe4ve204qwb.js +10 -0
- package/dist/chunks/RadioIndicator-bhxqih8wzv7hyrec.js +299 -0
- package/dist/chunks/RadioIndicatorDataAttributes-n5yupp5psifu0d4f.js +80 -0
- package/dist/chunks/ScrollAreaThumb-hxig41yn4lrurd3o.js +928 -0
- package/dist/chunks/ScrollAreaThumbDataAttributes-gup5wfxvqye6jj27.js +137 -0
- package/dist/chunks/SelectScrollUpArrowDataAttributes-fce5i1afjkb0necr.js +473 -0
- package/dist/chunks/SelectSeparator-nnak70azojox8b2b.js +1632 -0
- package/dist/chunks/Separator-fhwve0tfny3tht3a.js +24 -0
- package/dist/chunks/SeparatorDataAttributes-ch6e63bas7zflw00.js +11 -0
- package/dist/chunks/SliderIndicator-h1o3qbrvr8x0t4t2.js +1171 -0
- package/dist/chunks/SliderIndicatorDataAttributes-ff2f1cjealif5nvo.js +240 -0
- package/dist/chunks/SwitchRoot-m4t2tq5zn5wibyxk.js +244 -0
- package/dist/chunks/SwitchThumbDataAttributes-f95ld864on9y6ptk.js +90 -0
- package/dist/chunks/TabsList-n5n93rxr4sy704u8.js +664 -0
- package/dist/chunks/TabsListDataAttributes-e03a7kbubuf02z1l.js +183 -0
- package/dist/chunks/ToastArrowDataAttributes-jbnvz3kp6a35slgj.js +136 -0
- package/dist/chunks/ToggleDataAttributes-jl9ojyvwgrvefke6.js +103 -0
- package/dist/chunks/ToggleGroupContext-hg8zbkgqpscqhz83.js +10 -0
- package/dist/chunks/ToggleGroupDataAttributes-n1dwona1alvabstl.js +102 -0
- package/dist/chunks/ToolbarGroupContext-eawva8xkxb4osbxb.js +10 -0
- package/dist/chunks/ToolbarInput-kyxl1be0p3cyuayp.js +174 -0
- package/dist/chunks/ToolbarInputDataAttributes-n4a18a4km735du04.js +150 -0
- package/dist/chunks/ToolbarRootContext-difqbj720teyt8lu.js +12 -0
- package/dist/chunks/TooltipPopup-furysmeyb68uycbz.js +839 -0
- package/dist/chunks/TooltipProvider-hyans0ens4axh1y8.js +61 -0
- package/dist/chunks/TooltipViewportDataAttributes-gkwbezdq40ssuevg.js +312 -0
- package/dist/chunks/adaptiveOriginMiddleware-m9tqzw58wya9sdds.js +51 -0
- package/dist/chunks/addEventListener-ku3x23446prmd1kz.js +13 -0
- package/dist/chunks/areArraysEqual-nnpg93s9g7aqcaoh.js +15 -0
- package/dist/chunks/autocomplete-gdd9aruremdgdvx7.js +152 -0
- package/dist/chunks/badge-gca8xfu79ne55d5k.js +165 -0
- package/dist/chunks/banner-mo1xl9ww734kgsqh.js +269 -0
- package/dist/chunks/bash-jpzh6zbf5237424t.js +3 -0
- package/dist/chunks/breadcrumbs-z1jo40oxlw8e4eh4.js +159 -0
- package/dist/chunks/button-group-biv43ksvaipc3p5n.js +59 -0
- package/dist/chunks/button-hzvowfkbathmx8yg.js +274 -0
- package/dist/chunks/chart-dgh98nbzo2sux2bs.js +3985 -0
- package/dist/chunks/checkbox-eifiwbw34xwsikvf.js +211 -0
- package/dist/chunks/clamp-rcpupxvhqrn8uuyf.js +7 -0
- package/dist/chunks/clipboard-text-oukrnke1s3kebk3y.js +209 -0
- package/dist/chunks/cloudflare-logo-d8mid9xr190h78cu.js +186 -0
- package/dist/chunks/code-nj2nu6qzxhz6qnkk.js +96 -0
- package/dist/chunks/collapsible-ic6813hc4yv5s5hv.js +185 -0
- package/dist/chunks/combobox-mzvobpvalz2gnpli.js +321 -0
- package/dist/chunks/command-palette-d45ueqbuxygu87ir.js +507 -0
- package/dist/chunks/composite-c11t1ok72s3cggjc.js +90 -0
- package/dist/chunks/constants-l10cgj6pyqg27jod.js +5 -0
- package/dist/chunks/core-n0de50o00ej2ecfe.js +7177 -0
- package/dist/chunks/createBaseUIEventDetails-nvee6bghv2reeqdb.js +50 -0
- package/dist/chunks/createItems-n07tfwx89cdoar18.js +323 -0
- package/dist/chunks/createToastManager-cxjmn4jx3ejh85fs.js +1225 -0
- package/dist/chunks/css-j501gxq1am2gnikh.js +4 -0
- package/dist/chunks/date-picker-ija2bz17ai6ypnao.js +6865 -0
- package/dist/chunks/date-range-picker-oivlshld01jbel29.js +336 -0
- package/dist/chunks/dialog-g7wavhkdv2gplwq9.js +173 -0
- package/dist/chunks/diff-g2re0kj6fh27rgg5.js +4 -0
- package/dist/chunks/dropdown-m5a8nwer5hpvnkfk.js +384 -0
- package/dist/chunks/empty-e0onzpyokyl6h9bp.js +96 -0
- package/dist/chunks/engine-hzmefiqm63hu0c7i.js +10 -0
- package/dist/chunks/engine-javascript-e9xj8hhz9xfqhpnu.js +3118 -0
- package/dist/chunks/engine-oniguruma-ias56ildu01gf939.js +389 -0
- package/dist/chunks/error-lbnic2b20qr3mukp.js +6 -0
- package/dist/chunks/field-fowmq5smvp17pnqe.js +75 -0
- package/dist/chunks/flow-fak0fyldoaozd32s.js +10290 -0
- package/dist/chunks/formatNumber-b4kjdsebslm2b3t0.js +21 -0
- package/dist/chunks/getCssDimensions-gckwdrp86f73cv51.js +21 -0
- package/dist/chunks/getElementTransform-cz3jyftv0x5io95f.js +38 -0
- package/dist/chunks/getFiniteAnimations-jwd833ybtz81j5f0.js +13 -0
- package/dist/chunks/getHighlightReason-fhc53kq6qakcct9s.js +15 -0
- package/dist/chunks/getPseudoElementBounds-csuw8kwsoeyxd5tv.js +37 -0
- package/dist/chunks/github-light-hir7yctc38258pwt.js +5 -0
- package/dist/chunks/graphql-n9vlzkvcp2j19p7a.js +16 -0
- package/dist/chunks/grid-nwiczrab3r4w0zr2.js +118 -0
- package/dist/chunks/hcl-ohpfnrffs96hzyj5.js +4 -0
- package/dist/chunks/html-nimj6ljkkifnc9ni.js +12 -0
- package/dist/chunks/index.parts-db9pzsm9rrs9tp0t.js +200 -0
- package/dist/chunks/index.parts-ggacwr0yakuemead.js +24 -0
- package/dist/chunks/index.parts-pcg3pmf3yyro841t.js +13 -0
- package/dist/chunks/inertValue-n09gkjvwwa1kddov.js +9 -0
- package/dist/chunks/inline-copy-text-izxpvnrtebcqlquf.js +104 -0
- package/dist/chunks/input-group-h9fepskc84e1h11n.js +457 -0
- package/dist/chunks/input-kfi46426y22ocoo4.js +85 -0
- package/dist/chunks/input-m2tfec2viezoz9hh.js +146 -0
- package/dist/chunks/isElementDisabled-dyqutxpzdfppbohx.js +7 -0
- package/dist/chunks/itemEquality-ki3x4tzdhjlqjey6.js +56 -0
- package/dist/chunks/javascript-b6fq9bl50fdj6813.js +4 -0
- package/dist/chunks/json-h2g0z143t3cs13d7.js +4 -0
- package/dist/chunks/jsonc-jxlzvingck161eej.js +4 -0
- package/dist/chunks/jsx-jp7a33937sef92sn.js +4 -0
- package/dist/chunks/label-f18fnpbv85jddo4q.js +76 -0
- package/dist/chunks/layer-card-lsmeuqic9i1isv2b.js +74 -0
- package/dist/chunks/layer-dialog-ejtz9s7bbfhjk1md.js +414 -0
- package/dist/chunks/link-h84bkh8eem39p529.js +112 -0
- package/dist/chunks/link-provider-kbwllpbo24fvgioj.js +60 -0
- package/dist/chunks/loader-kv5nk8j8tsuesxqo.js +87 -0
- package/dist/chunks/locale-provider-j4ii538ntyok36r6.js +50 -0
- package/dist/chunks/markdown-eybeqjr58vfygtz1.js +4 -0
- package/dist/chunks/menubar-gzlyhmmc4i24prn1.js +106 -0
- package/dist/chunks/mergeCleanups-nw73c6jfwl5tyhw4.js +15 -0
- package/dist/chunks/meter-poh8jpe0qtq6mvee.js +35 -0
- package/dist/chunks/pagination-lmogkvvtu19mnr7f.js +296 -0
- package/dist/chunks/popover-nqrt3ykqv6sic8pz.js +206 -0
- package/dist/chunks/popupHandle-dk3ixgc8flr7v971.js +177 -0
- package/dist/chunks/popupStoreUtils-czfnxn051xakask5.js +868 -0
- package/dist/chunks/portal-provider-eveknxf26oudn7pp.js +63 -0
- package/dist/chunks/python-nrpnmxq4r6yp6fcd.js +4 -0
- package/dist/chunks/radio-nf717i5ypsga9zdh.js +204 -0
- package/dist/chunks/reason-parts-hssx64rmlxyn6gw5.js +40 -0
- package/dist/chunks/resolve-variant-l6x5ksfrjtu4m66l.js +35 -0
- package/dist/chunks/resolveAriaLabelledBy-knaucrjrjwnk7tvs.js +10 -0
- package/dist/chunks/resolveValueLabel-ntacnb58mhka5gg0.js +70 -0
- package/dist/chunks/rolldown-runtime-hi7ti5xiuxsegr96.js +18 -0
- package/dist/chunks/safePolygon-ep4133qogeu5vjf3.js +661 -0
- package/dist/chunks/safeReact-ek77ilng4ekk7mgz.js +18 -0
- package/dist/chunks/scrollable-k784b35i80aolmvg.js +29 -0
- package/dist/chunks/select-lnekz415wm4v6d6m.js +279 -0
- package/dist/chunks/sensitive-input-dvwlnntm7rdudwp0.js +252 -0
- package/dist/chunks/serializeValue-d1otz2i7h5tygrwf.js +13 -0
- package/dist/chunks/shellscript-i4m7lo8wi0f5bl8b.js +4 -0
- package/dist/chunks/sidebar-mhlgvpawixxoey2k.js +1466 -0
- package/dist/chunks/skeleton-line-kmhnp0lx3rxhioxa.js +74 -0
- package/dist/chunks/slider-e395gihi5cjd62ss.js +87 -0
- package/dist/chunks/sql-hqp2eekl7qhmxe92.js +4 -0
- package/dist/chunks/stringifyLocale-gbxouqj7ol627jxh.js +9 -0
- package/dist/chunks/styles-eb8bvypmayf578jf.js +35 -0
- package/dist/chunks/surface-jr8x5hy0gucjk5ig.js +30 -0
- package/dist/chunks/switch-nc8thi7ogd51m3gi.js +202 -0
- package/dist/chunks/table-ngl1b5yc8mcur662.js +238 -0
- package/dist/chunks/table-of-contents-gkjv9ck8etbz64ej.js +234 -0
- package/dist/chunks/tabs-o59bv7348nh2gppm.js +280 -0
- package/dist/chunks/tag-input-lbx9yzt33d4wu07o.js +156 -0
- package/dist/chunks/text-nqum95flcp07ac9s.js +126 -0
- package/dist/chunks/toast-ljpenshot856xqq4.js +341 -0
- package/dist/chunks/toml-oyqrgosuct25x413.js +4 -0
- package/dist/chunks/toolbar-kh6pc12ii7b6dv1x.js +141 -0
- package/dist/chunks/tooltip-bcymn9bfyz29fvji.js +92 -0
- package/dist/chunks/tsx-pem8x69upvmibv6l.js +4 -0
- package/dist/chunks/typescript-pe5y016phdwbgws7.js +4 -0
- package/dist/chunks/unwrap-lazy-element-hzbdkmujhd7iksau.js +45 -0
- package/dist/chunks/use-copy-feedback-gl55ghst0csvpv4j.js +55 -0
- package/dist/chunks/useAnchoredPopupScrollLock-msm8tzkewysnunut.js +31 -0
- package/dist/chunks/useAnimationFrame-k9lqdj9quln3sd85.js +87 -0
- package/dist/chunks/useAriaLabelledBy-j3j9jqlr9ukyk08s.js +36 -0
- package/dist/chunks/useBaseUiId-nk4k7nj9h1cy76ny.js +13 -0
- package/dist/chunks/useButton-lklvdzuhvj22bx07.js +186 -0
- package/dist/chunks/useClick-pcbkcc7r620v1smu.js +87 -0
- package/dist/chunks/useCollapsiblePanel-lrfsgx21ds36cwlp.js +415 -0
- package/dist/chunks/useCompositeItem-2juex3zh9gyrs8e9.js +31 -0
- package/dist/chunks/useCompositeListItem-ekwo2j2rjkggg7xj.js +54 -0
- package/dist/chunks/useControlled-i3srnkxy598s0au9.js +52 -0
- package/dist/chunks/useFieldValidation-oe16jiigp971yrzr.js +224 -0
- package/dist/chunks/useFloatingRootContext-k676b6m7f80bdapd.js +51 -0
- package/dist/chunks/useFocus-mn7a9t9v6fnlb4mf.js +124 -0
- package/dist/chunks/useId-82z8yqlmc1hy1c5t.js +50 -0
- package/dist/chunks/useInitialLiveRegionTextMutation-nl2hus7zx1h7ggno.js +86 -0
- package/dist/chunks/useLabel-me6zzfvkypo458pi.js +58 -0
- package/dist/chunks/useLabelableId-bjeh6q3pgrqjb7er.js +56 -0
- package/dist/chunks/useListNavigation-hpddbd0cc9pvt461.js +441 -0
- package/dist/chunks/useOnMount-gxggz1m0n869s6r0.js +12 -0
- package/dist/chunks/useOpenChangeComplete-edtabjwqmechsyv6.js +129 -0
- package/dist/chunks/usePopupHandleStore-gawjmfjf1xdgiph3.js +27 -0
- package/dist/chunks/usePopupViewport-l6w01iohvzloghy8.js +367 -0
- package/dist/chunks/usePositioner-mzvgnazldqvy44z2.js +580 -0
- package/dist/chunks/usePressAndHold-k9ynk78pgf677kpx.js +179 -0
- package/dist/chunks/usePreviousValue-o6swt5tb7xhpdu4e.js +21 -0
- package/dist/chunks/useRegisterFieldControl-m1stc9l9y4cndf0k.js +40 -0
- package/dist/chunks/useRegisteredLabelId-b7u9ygya03448zzn.js +16 -0
- package/dist/chunks/useRender-h9ktka9xt4obdv6y.js +13 -0
- package/dist/chunks/useRenderDialogRoot-bsqrqpc1ddau7xg4.js +312 -0
- package/dist/chunks/useRenderElement-nkklxbq1rp7h2kw0.js +436 -0
- package/dist/chunks/useScrollLock-le7ajwlt7oh6fzxi.js +877 -0
- package/dist/chunks/useSetFieldFocused-fbvj7gcv67dqfkp0.js +35 -0
- package/dist/chunks/useStableCallback-le5qgj6p9l04729n.js +38 -0
- package/dist/chunks/useSwipeDismiss-e8tfxzlp05p86mgb.js +697 -0
- package/dist/chunks/useTimeout-f0ayn2l2l9aop4l8.js +43 -0
- package/dist/chunks/useTransitionStatus-disysoblzgk34w14.js +74 -0
- package/dist/chunks/useTriggerFocusGuards-dyd3hb1m8en8ct50.js +40 -0
- package/dist/chunks/useTriggerSwitchTransition-hk5j36hd5dq2ok6w.js +62 -0
- package/dist/chunks/useTypeahead-kfdsw1ksl5bgvvzl.js +111 -0
- package/dist/chunks/useValueAsRef-dv0tmfr1xlpzdlru.js +27 -0
- package/dist/chunks/useValueChanged-fjssa2v6d4w8y332.js +15 -0
- package/dist/chunks/utils-o44zfmzz9z7uyj1v.js +18 -0
- package/dist/chunks/valueToPercent-djk2mqnihth2uvf6.js +7 -0
- package/dist/chunks/vendor-floating-ui-fqblx3wa0r71mjoo.js +1458 -0
- package/dist/chunks/vendor-styling-gs32v7xt5znc8kg0.js +1167 -0
- package/dist/chunks/vendor-utils-io8z5lsfxq8m2dcc.js +660 -0
- package/dist/chunks/vesper-g839e590k3dxnwh3.js +5 -0
- package/dist/chunks/visuallyHidden-kzzs9hbe93is3rci.js +25 -0
- package/dist/chunks/wasm-cpasy0o9lsjrm39j.js +8 -0
- package/dist/chunks/yaml-kzk5ddyekbyha04v.js +4 -0
- package/dist/code/server.d.ts +96 -0
- package/dist/code/server.js +151 -0
- package/dist/code.d.ts +82 -0
- package/dist/code.js +373 -0
- package/dist/command-line/cli.js +1705 -0
- package/dist/command-line/commands/add.js +282 -0
- package/dist/command-line/commands/ai.js +22 -0
- package/dist/command-line/commands/blocks.js +61 -0
- package/dist/command-line/commands/doc.js +167 -0
- package/dist/command-line/commands/init.js +95 -0
- package/dist/command-line/commands/ls.js +53 -0
- package/dist/command-line/commands/theme.js +850 -0
- package/dist/components/autocomplete.d.ts +2 -0
- package/dist/components/autocomplete.js +3 -0
- package/dist/components/badge.d.ts +2 -0
- package/dist/components/badge.js +3 -0
- package/dist/components/banner.d.ts +2 -0
- package/dist/components/banner.js +3 -0
- package/dist/components/breadcrumbs.d.ts +2 -0
- package/dist/components/breadcrumbs.js +3 -0
- package/dist/components/button-group.d.ts +2 -0
- package/dist/components/button-group.js +3 -0
- package/dist/components/button.d.ts +3 -0
- package/dist/components/button.js +3 -0
- package/dist/components/chart.d.ts +2 -0
- package/dist/components/chart.js +3 -0
- package/dist/components/checkbox.d.ts +2 -0
- package/dist/components/checkbox.js +3 -0
- package/dist/components/clipboard-text.d.ts +2 -0
- package/dist/components/clipboard-text.js +3 -0
- package/dist/components/cloudflare-logo.d.ts +2 -0
- package/dist/components/cloudflare-logo.js +3 -0
- package/dist/components/code.d.ts +2 -0
- package/dist/components/code.js +3 -0
- package/dist/components/collapsible.d.ts +2 -0
- package/dist/components/collapsible.js +3 -0
- package/dist/components/combobox.d.ts +2 -0
- package/dist/components/combobox.js +3 -0
- package/dist/components/command-palette.d.ts +2 -0
- package/dist/components/command-palette.js +3 -0
- package/dist/components/date-picker.d.ts +2 -0
- package/dist/components/date-picker.js +3 -0
- package/dist/components/date-range-picker.d.ts +2 -0
- package/dist/components/date-range-picker.js +3 -0
- package/dist/components/dialog.d.ts +2 -0
- package/dist/components/dialog.js +3 -0
- package/dist/components/dropdown.d.ts +2 -0
- package/dist/components/dropdown.js +3 -0
- package/dist/components/empty.d.ts +2 -0
- package/dist/components/empty.js +3 -0
- package/dist/components/field.d.ts +2 -0
- package/dist/components/field.js +3 -0
- package/dist/components/flow.d.ts +2 -0
- package/dist/components/flow.js +3 -0
- package/dist/components/grid.d.ts +2 -0
- package/dist/components/grid.js +3 -0
- package/dist/components/inline-copy-text.d.ts +2 -0
- package/dist/components/inline-copy-text.js +3 -0
- package/dist/components/input-group.d.ts +2 -0
- package/dist/components/input-group.js +3 -0
- package/dist/components/input.d.ts +4 -0
- package/dist/components/input.js +5 -0
- package/dist/components/label.d.ts +2 -0
- package/dist/components/label.js +3 -0
- package/dist/components/layer-card.d.ts +2 -0
- package/dist/components/layer-card.js +3 -0
- package/dist/components/layer-dialog.d.ts +2 -0
- package/dist/components/layer-dialog.js +3 -0
- package/dist/components/link.d.ts +67 -0
- package/dist/components/link.js +3 -0
- package/dist/components/loader.d.ts +2 -0
- package/dist/components/loader.js +4 -0
- package/dist/components/menubar.d.ts +2 -0
- package/dist/components/menubar.js +3 -0
- package/dist/components/meter.d.ts +2 -0
- package/dist/components/meter.js +3 -0
- package/dist/components/pagination.d.ts +2 -0
- package/dist/components/pagination.js +3 -0
- package/dist/components/popover.d.ts +2 -0
- package/dist/components/popover.js +3 -0
- package/dist/components/radio.d.ts +2 -0
- package/dist/components/radio.js +3 -0
- package/dist/components/select.d.ts +2 -0
- package/dist/components/select.js +3 -0
- package/dist/components/sensitive-input.d.ts +2 -0
- package/dist/components/sensitive-input.js +3 -0
- package/dist/components/sidebar.d.ts +2 -0
- package/dist/components/sidebar.js +3 -0
- package/dist/components/slider.d.ts +2 -0
- package/dist/components/slider.js +3 -0
- package/dist/components/surface.d.ts +2 -0
- package/dist/components/surface.js +3 -0
- package/dist/components/switch.d.ts +2 -0
- package/dist/components/switch.js +3 -0
- package/dist/components/table-of-contents.d.ts +2 -0
- package/dist/components/table-of-contents.js +3 -0
- package/dist/components/table.d.ts +2 -0
- package/dist/components/table.js +3 -0
- package/dist/components/tabs.d.ts +2 -0
- package/dist/components/tabs.js +3 -0
- package/dist/components/tag-input.d.ts +2 -0
- package/dist/components/tag-input.js +3 -0
- package/dist/components/text.d.ts +2 -0
- package/dist/components/text.js +3 -0
- package/dist/components/toast.d.ts +2 -0
- package/dist/components/toast.js +4 -0
- package/dist/components/toolbar.d.ts +2 -0
- package/dist/components/toolbar.js +3 -0
- package/dist/components/tooltip.d.ts +2 -0
- package/dist/components/tooltip.js +3 -0
- package/dist/config-BKj6nyHa.d.ts +620 -0
- package/dist/field-DIjlHM8W.d.ts +91 -0
- package/dist/index-2jvVmJ8P.d.ts +46 -0
- package/dist/index-5PpauI_2.d.ts +85 -0
- package/dist/index-AMEc1MEg.d.ts +180 -0
- package/dist/index-AUC5xRcO.d.ts +236 -0
- package/dist/index-B7epkoHc.d.ts +72 -0
- package/dist/index-B9-RdY6D.d.ts +75 -0
- package/dist/index-B9niVl3r.d.ts +140 -0
- package/dist/index-BD-gTiEv.d.ts +71 -0
- package/dist/index-BK1tZgmP.d.ts +426 -0
- package/dist/index-BVgXnR1V.d.ts +137 -0
- package/dist/index-BW1HVU7T.d.ts +119 -0
- package/dist/index-BWe6haHU.d.ts +64 -0
- package/dist/index-BkTAB4wj.d.ts +673 -0
- package/dist/index-Bwhwpw_j.d.ts +189 -0
- package/dist/index-BzE0aNpx.d.ts +143 -0
- package/dist/index-C7RoG_CH.d.ts +57 -0
- package/dist/index-CE09bLNb.d.ts +72 -0
- package/dist/index-CJRe-8P-.d.ts +174 -0
- package/dist/index-CReGk3Dc.d.ts +91 -0
- package/dist/index-CU_lnxg7.d.ts +287 -0
- package/dist/index-CYoiniZ4.d.ts +135 -0
- package/dist/index-ClS-eFxE.d.ts +104 -0
- package/dist/index-CzIWigmH.d.ts +62 -0
- package/dist/index-CzTgKPh-.d.ts +105 -0
- package/dist/index-D2Gvly0i.d.ts +96 -0
- package/dist/index-DIV3riUd.d.ts +148 -0
- package/dist/index-DL1-uSuH.d.ts +1 -0
- package/dist/index-DYYiDxZs.d.ts +243 -0
- package/dist/index-DjSGDESy.d.ts +222 -0
- package/dist/index-Dmbgjww7.d.ts +157 -0
- package/dist/index-DwNMa4LN.d.ts +166 -0
- package/dist/index-Dx7hOWUc.d.ts +93 -0
- package/dist/index-DxOyYZaJ.d.ts +251 -0
- package/dist/index-NnHba-T1.d.ts +136 -0
- package/dist/index-RP_rt8vB.d.ts +140 -0
- package/dist/index-T1sSoiWG.d.ts +184 -0
- package/dist/index-aahL-0Zw.d.ts +60 -0
- package/dist/index-bBPKMepR.d.ts +73 -0
- package/dist/index-g-eFm1Bq.d.ts +877 -0
- package/dist/index-gYC6cQVO.d.ts +105 -0
- package/dist/index-lOWfpkxK.d.ts +118 -0
- package/dist/index-pjdgauIH.d.ts +170 -0
- package/dist/index-yK3Hayg_.d.ts +40 -0
- package/dist/index.d.ts +108 -0
- package/dist/index.js +207 -0
- package/dist/input-BeWEb-jD.d.ts +122 -0
- package/dist/input-group-8gEtPiKw.d.ts +100 -0
- package/dist/layer-card-BNIn9pqy.d.ts +56 -0
- package/dist/link-provider-tz-NJp9x.d.ts +67 -0
- package/dist/locale-provider-CHMCQ0-J.d.ts +40 -0
- package/dist/panda.d.ts +25 -0
- package/dist/panda.js +32 -0
- package/dist/portal-provider-BAqPpq_a.d.ts +55 -0
- package/dist/primitives/accordion.d.ts +1 -0
- package/dist/primitives/accordion.js +3 -0
- package/dist/primitives/alert-dialog.d.ts +1 -0
- package/dist/primitives/alert-dialog.js +8 -0
- package/dist/primitives/autocomplete.d.ts +1 -0
- package/dist/primitives/autocomplete.js +6 -0
- package/dist/primitives/avatar.d.ts +1 -0
- package/dist/primitives/avatar.js +3 -0
- package/dist/primitives/button.d.ts +1 -0
- package/dist/primitives/button.js +3 -0
- package/dist/primitives/checkbox-group.d.ts +1 -0
- package/dist/primitives/checkbox-group.js +4 -0
- package/dist/primitives/checkbox.d.ts +1 -0
- package/dist/primitives/checkbox.js +4 -0
- package/dist/primitives/collapsible.d.ts +1 -0
- package/dist/primitives/collapsible.js +5 -0
- package/dist/primitives/combobox.d.ts +1 -0
- package/dist/primitives/combobox.js +6 -0
- package/dist/primitives/context-menu.d.ts +1 -0
- package/dist/primitives/context-menu.js +6 -0
- package/dist/primitives/csp-provider.d.ts +1 -0
- package/dist/primitives/csp-provider.js +3 -0
- package/dist/primitives/dialog.d.ts +1 -0
- package/dist/primitives/dialog.js +9 -0
- package/dist/primitives/direction-provider.d.ts +1 -0
- package/dist/primitives/direction-provider.js +4 -0
- package/dist/primitives/drawer.d.ts +1 -0
- package/dist/primitives/drawer.js +6 -0
- package/dist/primitives/field.d.ts +1 -0
- package/dist/primitives/field.js +4 -0
- package/dist/primitives/fieldset.d.ts +1 -0
- package/dist/primitives/fieldset.js +3 -0
- package/dist/primitives/form.d.ts +1 -0
- package/dist/primitives/form.js +3 -0
- package/dist/primitives/input.d.ts +1 -0
- package/dist/primitives/input.js +4 -0
- package/dist/primitives/menu.d.ts +1 -0
- package/dist/primitives/menu.js +6 -0
- package/dist/primitives/menubar.d.ts +1 -0
- package/dist/primitives/menubar.js +3 -0
- package/dist/primitives/meter.d.ts +1 -0
- package/dist/primitives/meter.js +3 -0
- package/dist/primitives/navigation-menu.d.ts +1 -0
- package/dist/primitives/navigation-menu.js +3 -0
- package/dist/primitives/number-field.d.ts +1 -0
- package/dist/primitives/number-field.js +3 -0
- package/dist/primitives/otp-field.d.ts +3 -0
- package/dist/primitives/otp-field.js +4 -0
- package/dist/primitives/popover.d.ts +1 -0
- package/dist/primitives/popover.js +3 -0
- package/dist/primitives/preview-card.d.ts +1 -0
- package/dist/primitives/preview-card.js +3 -0
- package/dist/primitives/progress.d.ts +1 -0
- package/dist/primitives/progress.js +3 -0
- package/dist/primitives/radio-group.d.ts +1 -0
- package/dist/primitives/radio-group.js +4 -0
- package/dist/primitives/radio.d.ts +1 -0
- package/dist/primitives/radio.js +4 -0
- package/dist/primitives/scroll-area.d.ts +1 -0
- package/dist/primitives/scroll-area.js +4 -0
- package/dist/primitives/select.d.ts +1 -0
- package/dist/primitives/select.js +5 -0
- package/dist/primitives/separator.d.ts +1 -0
- package/dist/primitives/separator.js +4 -0
- package/dist/primitives/slider.d.ts +1 -0
- package/dist/primitives/slider.js +4 -0
- package/dist/primitives/switch.d.ts +1 -0
- package/dist/primitives/switch.js +4 -0
- package/dist/primitives/tabs.d.ts +1 -0
- package/dist/primitives/tabs.js +4 -0
- package/dist/primitives/toast.d.ts +1 -0
- package/dist/primitives/toast.js +5 -0
- package/dist/primitives/toggle-group.d.ts +1 -0
- package/dist/primitives/toggle-group.js +3 -0
- package/dist/primitives/toggle.d.ts +1 -0
- package/dist/primitives/toggle.js +3 -0
- package/dist/primitives/toolbar.d.ts +1 -0
- package/dist/primitives/toolbar.js +3 -0
- package/dist/primitives/tooltip.d.ts +1 -0
- package/dist/primitives/tooltip.js +4 -0
- package/dist/primitives.d.ts +42 -0
- package/dist/primitives.js +71 -0
- package/dist/registry.d.ts +2 -0
- package/dist/registry.js +1 -0
- package/dist/scripts/theme-generator/config.d.ts +2 -0
- package/dist/scripts/theme-generator/config.js +487 -0
- package/dist/scripts/theme-generator/types.d.ts +2 -0
- package/dist/scripts/theme-generator/types.js +1 -0
- package/dist/styles/kumo-binding.css +490 -0
- package/dist/styles/kumo-standalone.css +2 -0
- package/dist/styles/kumo.css +153 -0
- package/dist/styles/theme-fedramp.css +31 -0
- package/dist/styles/theme-fldr.css +67 -0
- package/dist/styles/theme-kumo.css +464 -0
- package/dist/text-CRRU2g-u.d.ts +183 -0
- package/dist/theming.d.ts +185 -0
- package/dist/theming.js +241 -0
- package/dist/tooltip-D_vhi1PN.d.ts +105 -0
- package/dist/types-C6in2C8V.d.ts +135 -0
- package/dist/types-CdzJnnIl.d.ts +193 -0
- package/dist/types-Cl4HuOrB.d.ts +84 -0
- package/dist/utils.d.ts +4 -0
- package/dist/utils.js +7 -0
- package/package.json +483 -3
- package/scripts/component-registry/cache.ts +123 -0
- package/scripts/component-registry/discovery.ts +560 -0
- package/scripts/component-registry/example-cleanup.ts +168 -0
- package/scripts/component-registry/index.test.ts +1075 -0
- package/scripts/component-registry/index.ts +1065 -0
- package/scripts/component-registry/markdown-generator.ts +222 -0
- package/scripts/component-registry/metadata.ts +1030 -0
- package/scripts/component-registry/props-filter.ts +312 -0
- package/scripts/component-registry/schema-generator.ts +333 -0
- package/scripts/component-registry/sub-components.ts +393 -0
- package/scripts/component-registry/types.ts +158 -0
- package/scripts/component-registry/utils.ts +280 -0
- package/scripts/component-registry/variant-parser.ts +262 -0
- package/scripts/css-build.ts +106 -0
- package/scripts/format-generated.ts +12 -0
- package/scripts/generate-globe-land-mask.mjs +80 -0
- package/scripts/generate-primitives.ts +196 -0
- package/scripts/publish-fldr.ts +78 -0
- package/scripts/theme-generator/config.ts +666 -0
- package/scripts/theme-generator/generate-css.test.ts +30 -0
- package/scripts/theme-generator/generate-css.ts +352 -0
- package/scripts/theme-generator/index.ts +165 -0
- package/scripts/theme-generator/migrate.ts +560 -0
- package/scripts/theme-generator/types.ts +92 -0
|
@@ -0,0 +1,1950 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-hi7ti5xiuxsegr96.js";
|
|
3
|
+
import { c as NOOP, f as useMergedRefs, i as mergeProps, n as useRenderElement, o as EMPTY_ARRAY, p as useRefWithInit, s as EMPTY_OBJECT } from "./useRenderElement-nkklxbq1rp7h2kw0.js";
|
|
4
|
+
import { n as ReactStore } from "./FloatingRootStore-men6ufp3a2b296fh.js";
|
|
5
|
+
import { n as useIsoLayoutEffect } from "./safeReact-ek77ilng4ekk7mgz.js";
|
|
6
|
+
import { $ as getTarget, N as popupOpen$1, P as pressed$1, Q as contains, X as activeElement, Z as closest, at as stopEvent, d as getGridNavigatedIndex, g as isIndexOutOfListBounds, j as pressableTriggerOpenStateMapping, st as android } from "./vendor-utils-io8z5lsfxq8m2dcc.js";
|
|
7
|
+
import { t as gecko } from "./engine-hzmefiqm63hu0c7i.js";
|
|
8
|
+
import { E as isHTMLElement, S as getOverflowAncestors } from "./vendor-floating-ui-fqblx3wa0r71mjoo.js";
|
|
9
|
+
import { n as createGenericEventDetails, t as createChangeEventDetails } from "./createBaseUIEventDetails-nvee6bghv2reeqdb.js";
|
|
10
|
+
import { d as imperativeAction, g as inputClear, h as inputChange, i as closePress, l as escapeKey, v as inputPress, w as none, y as itemPress } from "./reason-parts-hssx64rmlxyn6gw5.js";
|
|
11
|
+
import { t as useValueAsRef } from "./useValueAsRef-dv0tmfr1xlpzdlru.js";
|
|
12
|
+
import { t as useStableCallback } from "./useStableCallback-le5qgj6p9l04729n.js";
|
|
13
|
+
import { n as visuallyHiddenInput, t as visuallyHidden } from "./visuallyHidden-kzzs9hbe93is3rci.js";
|
|
14
|
+
import { g as useDismiss, i as attachPreventUnmountOnClose, m as useUnmountAfterClose, t as FOCUSABLE_POPUP_PROPS } from "./popupStoreUtils-czfnxn051xakask5.js";
|
|
15
|
+
import { r as useOpenInteractionType } from "./useScrollLock-le7ajwlt7oh6fzxi.js";
|
|
16
|
+
import { t as useClick } from "./useClick-pcbkcc7r620v1smu.js";
|
|
17
|
+
import { t as useFloatingRootContext } from "./useFloatingRootContext-k676b6m7f80bdapd.js";
|
|
18
|
+
import { a as useListNavigation } from "./useListNavigation-hpddbd0cc9pvt461.js";
|
|
19
|
+
import { t as useBaseUiId } from "./useBaseUiId-nk4k7nj9h1cy76ny.js";
|
|
20
|
+
import { n as useDirection } from "./DirectionContext-kpby968j030psajn.js";
|
|
21
|
+
import { a as useFieldRootContext, c as fieldValidityMapping, i as FieldRootContext, n as useLabelableContext, o as DEFAULT_FIELD_STATE_ATTRIBUTES, r as DEFAULT_FIELD_ROOT_CONTEXT } from "./LabelableContext-dz4wz3lu3lgqusu7.js";
|
|
22
|
+
import { n as useFormContext } from "./FormContext-jv19engyccpf6xcl.js";
|
|
23
|
+
import { t as useLabelableId } from "./useLabelableId-bjeh6q3pgrqjb7er.js";
|
|
24
|
+
import { t as useSetFieldFocused } from "./useSetFieldFocused-fbvj7gcv67dqfkp0.js";
|
|
25
|
+
import { t as useRegisterFieldControl } from "./useRegisterFieldControl-m1stc9l9y4cndf0k.js";
|
|
26
|
+
import { t as useValueChanged } from "./useValueChanged-fjssa2v6d4w8y332.js";
|
|
27
|
+
import { t as useControlled } from "./useControlled-i3srnkxy598s0au9.js";
|
|
28
|
+
import { t as useButton } from "./useButton-lklvdzuhvj22bx07.js";
|
|
29
|
+
import { r as isScrollableY } from "./scrollable-k784b35i80aolmvg.js";
|
|
30
|
+
import { a as isSelectedValueDirty, c as selectedValueIncludes, i as findSelectionIndex, l as useOnFirstRender, n as defaultItemEquality, o as removeItem, r as findItemIndex, s as resolveSelectedIndex, t as compareItemEquality } from "./itemEquality-ki3x4tzdhjlqjey6.js";
|
|
31
|
+
import { t as getHighlightReason } from "./getHighlightReason-fhc53kq6qakcct9s.js";
|
|
32
|
+
import { n as hasNullItemLabel, o as stringifyAsLabel, r as isGroupedItems, s as stringifyAsValue, t as flattenLeafItems } from "./resolveValueLabel-ntacnb58mhka5gg0.js";
|
|
33
|
+
import { n as getFilter, t as useInitialLiveRegionTextMutation } from "./useInitialLiveRegionTextMutation-nl2hus7zx1h7ggno.js";
|
|
34
|
+
import { t as CompositeList } from "./CompositeList-gwuaf6d14s4da0j0.js";
|
|
35
|
+
import { t as useCompositeListItem } from "./useCompositeListItem-ekwo2j2rjkggg7xj.js";
|
|
36
|
+
import * as React$1 from "react";
|
|
37
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
38
|
+
import * as ReactDOM from "react-dom";
|
|
39
|
+
//#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/gridNavigation.mjs
|
|
40
|
+
/**
|
|
41
|
+
* Positional arguments are deliberate: property names of an options object
|
|
42
|
+
* don't minify, and the signature is locked to the caller via `typeof` on the
|
|
43
|
+
* `grid` option of `useListNavigation`.
|
|
44
|
+
*
|
|
45
|
+
* The injected grid navigator only ever operates on a uniform 1x1 grid (sizes are
|
|
46
|
+
* always `1x1` and packing is never dense), so the cell-map machinery that supports
|
|
47
|
+
* multi-cell items collapses to an identity transform over the item list. Calling
|
|
48
|
+
* `getGridNavigatedIndex` directly keeps the cell-map helpers
|
|
49
|
+
* (`createGridCellMap`/`getGridCellIndexOfCorner`/`getGridCellIndices`) out of
|
|
50
|
+
* grid-combobox bundles.
|
|
51
|
+
*/
|
|
52
|
+
function gridNavigation(event, prevIndex, listRef, orientation, loopFocus, rtl, disabledIndices, minIndex, maxIndex, cols = 2) {
|
|
53
|
+
const nextIndex = getGridNavigatedIndex(listRef.current, {
|
|
54
|
+
event,
|
|
55
|
+
orientation,
|
|
56
|
+
loopFocus,
|
|
57
|
+
rtl,
|
|
58
|
+
cols,
|
|
59
|
+
disabledIndices,
|
|
60
|
+
minIndex,
|
|
61
|
+
maxIndex,
|
|
62
|
+
prevIndex: prevIndex > maxIndex ? minIndex : prevIndex,
|
|
63
|
+
stopEvent: true
|
|
64
|
+
});
|
|
65
|
+
return isIndexOutOfListBounds(listRef.current, nextIndex) ? void 0 : nextIndex;
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
//#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/combobox/root/ComboboxRootContext.mjs
|
|
69
|
+
const ComboboxRootContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
70
|
+
ComboboxRootContext.displayName = "ComboboxRootContext";
|
|
71
|
+
const ComboboxFloatingContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
72
|
+
ComboboxFloatingContext.displayName = "ComboboxFloatingContext";
|
|
73
|
+
const ComboboxDerivedItemsContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
74
|
+
ComboboxDerivedItemsContext.displayName = "ComboboxDerivedItemsContext";
|
|
75
|
+
const ComboboxHasItemsContext = /*#__PURE__*/ React$1.createContext(false);
|
|
76
|
+
ComboboxHasItemsContext.displayName = "ComboboxHasItemsContext";
|
|
77
|
+
const ComboboxInputValueContext = /*#__PURE__*/ React$1.createContext("");
|
|
78
|
+
ComboboxInputValueContext.displayName = "ComboboxInputValueContext";
|
|
79
|
+
function useComboboxRootContext() {
|
|
80
|
+
const context = React$1.useContext(ComboboxRootContext);
|
|
81
|
+
if (!context) throw new Error("Base UI: ComboboxRootContext is missing. Combobox parts must be placed within <Combobox.Root>.");
|
|
82
|
+
return context;
|
|
83
|
+
}
|
|
84
|
+
function useComboboxFloatingContext() {
|
|
85
|
+
const context = React$1.useContext(ComboboxFloatingContext);
|
|
86
|
+
if (!context) throw new Error("Base UI: ComboboxFloatingContext is missing. Combobox parts must be placed within <Combobox.Root>.");
|
|
87
|
+
return context;
|
|
88
|
+
}
|
|
89
|
+
function useComboboxDerivedItemsContext() {
|
|
90
|
+
const context = React$1.useContext(ComboboxDerivedItemsContext);
|
|
91
|
+
if (!context) throw new Error("Base UI: ComboboxItemsContext is missing. Combobox parts must be placed within <Combobox.Root>.");
|
|
92
|
+
return context;
|
|
93
|
+
}
|
|
94
|
+
function useComboboxInputValueContext() {
|
|
95
|
+
return React$1.useContext(ComboboxInputValueContext);
|
|
96
|
+
}
|
|
97
|
+
function useComboboxHasItemsContext() {
|
|
98
|
+
return React$1.useContext(ComboboxHasItemsContext);
|
|
99
|
+
}
|
|
100
|
+
//#endregion
|
|
101
|
+
//#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/combobox/store.mjs
|
|
102
|
+
/**
|
|
103
|
+
* Non-reactive values shared with the combobox parts. Nothing here is observable through
|
|
104
|
+
* `selectors`, so writing to a ref never notifies subscribers.
|
|
105
|
+
*/
|
|
106
|
+
const selectors = {
|
|
107
|
+
id: (state) => state.id,
|
|
108
|
+
labelId: (state) => state.labelId,
|
|
109
|
+
items: (state) => state.items,
|
|
110
|
+
selectedValue: (state) => state.selectedValue,
|
|
111
|
+
hasSelectionChips: (state) => {
|
|
112
|
+
const selectedValue = state.selectedValue;
|
|
113
|
+
return Array.isArray(selectedValue) && selectedValue.length > 0;
|
|
114
|
+
},
|
|
115
|
+
hasSelectedValue: (state) => {
|
|
116
|
+
const { selectedValue, selectionMode } = state;
|
|
117
|
+
if (selectedValue == null) return false;
|
|
118
|
+
if (selectionMode === "multiple" && Array.isArray(selectedValue)) return selectedValue.length > 0;
|
|
119
|
+
return true;
|
|
120
|
+
},
|
|
121
|
+
hasNullItemLabel: (state, enabled) => {
|
|
122
|
+
return enabled ? hasNullItemLabel(state.items) : false;
|
|
123
|
+
},
|
|
124
|
+
open: (state) => state.open,
|
|
125
|
+
mounted: (state) => state.mounted,
|
|
126
|
+
forceMounted: (state) => state.forceMounted,
|
|
127
|
+
inline: (state) => state.inline,
|
|
128
|
+
activeIndex: (state) => state.activeIndex,
|
|
129
|
+
selectedIndex: (state) => state.selectedIndex,
|
|
130
|
+
isActive: (state, index) => state.activeIndex === index,
|
|
131
|
+
isSelected: (state, itemValue) => {
|
|
132
|
+
const comparer = state.isItemEqualToValue;
|
|
133
|
+
const selectedValue = state.selectedValue;
|
|
134
|
+
if (Array.isArray(selectedValue)) return selectedValue.some((selectedItem) => compareItemEquality(itemValue, selectedItem, comparer));
|
|
135
|
+
return compareItemEquality(itemValue, selectedValue, comparer);
|
|
136
|
+
},
|
|
137
|
+
transitionStatus: (state) => state.transitionStatus,
|
|
138
|
+
popupProps: (state) => state.popupProps,
|
|
139
|
+
listProps: (state) => state.listProps,
|
|
140
|
+
inputProps: (state) => state.inputProps,
|
|
141
|
+
triggerProps: (state) => state.triggerProps,
|
|
142
|
+
itemRoot: (state) => state.itemRoot,
|
|
143
|
+
positionerElement: (state) => state.positionerElement,
|
|
144
|
+
listElement: (state) => state.listElement,
|
|
145
|
+
popupId: (state) => state.popupId,
|
|
146
|
+
triggerElement: (state) => state.triggerElement,
|
|
147
|
+
inputElement: (state) => state.inputElement,
|
|
148
|
+
inputGroupElement: (state) => state.inputGroupElement,
|
|
149
|
+
popupSide: (state) => state.popupSide,
|
|
150
|
+
openMethod: (state) => state.openMethod,
|
|
151
|
+
inputInsidePopup: (state) => state.inputInsidePopup,
|
|
152
|
+
inputOwnsFormValue: (state) => state.inputOwnsFormValue,
|
|
153
|
+
selectionMode: (state) => state.selectionMode,
|
|
154
|
+
name: (state) => state.name,
|
|
155
|
+
form: (state) => state.form,
|
|
156
|
+
disabled: (state) => state.disabled,
|
|
157
|
+
readOnly: (state) => state.readOnly,
|
|
158
|
+
required: (state) => state.required,
|
|
159
|
+
grid: (state) => state.grid,
|
|
160
|
+
virtualized: (state) => state.virtualized,
|
|
161
|
+
itemToStringLabel: (state) => state.itemToStringLabel,
|
|
162
|
+
isItemEqualToValue: (state) => state.isItemEqualToValue,
|
|
163
|
+
modal: (state) => state.modal,
|
|
164
|
+
autoHighlight: (state) => state.autoHighlight
|
|
165
|
+
};
|
|
166
|
+
//#endregion
|
|
167
|
+
//#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/combobox/root/utils/index.mjs
|
|
168
|
+
/**
|
|
169
|
+
* Derives the default id assigned to `Combobox.Popup` when the input is rendered inside it.
|
|
170
|
+
* Shared by the popup (which applies it) and the trigger (which references it via `aria-controls`)
|
|
171
|
+
* so the convention only lives in one place.
|
|
172
|
+
*/
|
|
173
|
+
function getComboboxPopupId(rootId) {
|
|
174
|
+
return rootId == null ? void 0 : `${rootId}-popup`;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Enhanced filter using Intl.Collator for more robust string matching.
|
|
178
|
+
* Uses the provided `itemToStringLabel` function if available, otherwise falls back to:
|
|
179
|
+
* • When `item` is an object with a `value` property, that property is used.
|
|
180
|
+
* • When `item` is a primitive (e.g. `string`), it is used directly.
|
|
181
|
+
*/
|
|
182
|
+
function createCollatorItemFilter(collatorFilter, itemToStringLabel) {
|
|
183
|
+
return (item, query) => {
|
|
184
|
+
if (item == null) return false;
|
|
185
|
+
return collatorFilter.contains(item, query, itemToStringLabel);
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Enhanced filter for single selection mode using Intl.Collator that shows all items
|
|
190
|
+
* when query is empty or matches the current selection, making it easier to browse options.
|
|
191
|
+
*/
|
|
192
|
+
function createSingleSelectionCollatorFilter(collatorFilter, itemToStringLabel, selectedValue) {
|
|
193
|
+
return (item, query) => {
|
|
194
|
+
if (item == null) return false;
|
|
195
|
+
if (!query) return true;
|
|
196
|
+
const selectedValueToString = itemToStringLabel?.selected ?? itemToStringLabel;
|
|
197
|
+
const selectedString = selectedValue != null ? stringifyAsLabel(selectedValue, selectedValueToString) : "";
|
|
198
|
+
if (selectedString && collatorFilter.contains(selectedString, query) && selectedString.length === query.length) return true;
|
|
199
|
+
return collatorFilter.contains(item, query, itemToStringLabel);
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
//#endregion
|
|
203
|
+
//#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/combobox/root/utils/useFilter.mjs
|
|
204
|
+
/**
|
|
205
|
+
* Matches items against a query using `Intl.Collator` for robust string matching.
|
|
206
|
+
*/
|
|
207
|
+
const useCoreFilter = getFilter;
|
|
208
|
+
/**
|
|
209
|
+
* Matches items against a query using `Intl.Collator` for robust string matching.
|
|
210
|
+
*/
|
|
211
|
+
function useComboboxFilter(options = {}) {
|
|
212
|
+
const { multiple = false, value, ...collatorOptions } = options;
|
|
213
|
+
const coreFilter = getFilter(collatorOptions);
|
|
214
|
+
const contains = React$1.useCallback((item, query, itemToString) => {
|
|
215
|
+
if (multiple) return createCollatorItemFilter(coreFilter, itemToString)(item, query);
|
|
216
|
+
return createSingleSelectionCollatorFilter(coreFilter, itemToString, value)(item, query);
|
|
217
|
+
}, [
|
|
218
|
+
coreFilter,
|
|
219
|
+
value,
|
|
220
|
+
multiple
|
|
221
|
+
]);
|
|
222
|
+
return React$1.useMemo(() => ({
|
|
223
|
+
...coreFilter,
|
|
224
|
+
contains
|
|
225
|
+
}), [contains, coreFilter]);
|
|
226
|
+
}
|
|
227
|
+
//#endregion
|
|
228
|
+
//#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/combobox/root/utils/constants.mjs
|
|
229
|
+
const NO_ACTIVE_VALUE = Symbol("none");
|
|
230
|
+
const INITIAL_LAST_HIGHLIGHT = {
|
|
231
|
+
value: NO_ACTIVE_VALUE,
|
|
232
|
+
index: -1
|
|
233
|
+
};
|
|
234
|
+
//#endregion
|
|
235
|
+
//#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/combobox/items/itemCollection.mjs
|
|
236
|
+
function findCollectionItem(valueToItem, itemValue, isEqual) {
|
|
237
|
+
const exactItem = valueToItem.get(itemValue);
|
|
238
|
+
if (exactItem !== void 0 || isEqual === defaultItemEquality) return exactItem;
|
|
239
|
+
for (const [derivedValue, item] of valueToItem) if (compareItemEquality(derivedValue, itemValue, isEqual)) return item;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* An opaque collection created by `createItems()`.
|
|
243
|
+
*
|
|
244
|
+
* It carries the source item and derived value types so the root can infer the list item and
|
|
245
|
+
* selection value types.
|
|
246
|
+
*
|
|
247
|
+
* Pass it directly to the root's `items` prop; it has no public members.
|
|
248
|
+
*/
|
|
249
|
+
/**
|
|
250
|
+
* Internal shape of a collection. The extra members let the root project items to
|
|
251
|
+
* their values and resolve a selected value back to its label while items are unmounted.
|
|
252
|
+
*/
|
|
253
|
+
//#endregion
|
|
254
|
+
//#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/combobox/root/AriaCombobox.mjs
|
|
255
|
+
/**
|
|
256
|
+
* @internal
|
|
257
|
+
*/
|
|
258
|
+
function AriaCombobox(props) {
|
|
259
|
+
const { id: idProp, onOpenChangeComplete: onOpenChangeCompleteProp, defaultSelectedValue = null, selectedValue: selectedValueProp, onSelectedValueChange, defaultInputValue, inputValue: inputValueProp, open: openProp, defaultOpen = false, selectionMode, onItemHighlighted: onItemHighlightedProp, name: nameProp, form, disabled: disabledProp = false, readOnly = false, required = false, inputRef: inputRefProp, grid = false, items: itemsProp, filteredItems: filteredItemsProp, filter: filterProp, filterQuery: filterQueryProp, openOnInputClick = true, autoHighlight = false, keepHighlight = false, highlightItemOnHover = true, loopFocus = true, itemToStringLabel: itemToStringLabelProp, itemToStringValue, isItemEqualToValue = defaultItemEquality, virtualized = false, inline: inlineProp = false, fillInputOnItemPress = true, modal = false, limit = -1, autoComplete = "list", formAutoComplete, locale, submitOnItemClick = false } = props;
|
|
260
|
+
const { clearErrors } = useFormContext();
|
|
261
|
+
const { setDirty, validityData, setFilled, name: fieldName, disabled: fieldDisabled, setTouched, setFocused, validationMode, validation } = useFieldRootContext();
|
|
262
|
+
const direction = useDirection();
|
|
263
|
+
const id = useLabelableId({ id: idProp });
|
|
264
|
+
const collatorFilter = useCoreFilter({ locale });
|
|
265
|
+
const collection = Array.isArray(itemsProp) ? null : itemsProp;
|
|
266
|
+
if (collection && typeof collection.label !== "function") throw new Error("Base UI: the `items` prop received an object that is not a collection, so its items cannot be read. Pass an array of items, an array of groups with items, or the result of `createItems()`. See https://base-ui.com/react/components/combobox#createitems");
|
|
267
|
+
const items = collection ? collection.data : itemsProp;
|
|
268
|
+
const itemToValue = collection?.value;
|
|
269
|
+
const storeItems = itemToValue ? void 0 : items;
|
|
270
|
+
const externalWindow = React$1.useMemo(() => {
|
|
271
|
+
if (!filteredItemsProp || !itemToValue) return;
|
|
272
|
+
const flat = flattenLeafItems(filteredItemsProp);
|
|
273
|
+
const values = flat.map(itemToValue);
|
|
274
|
+
let valueToItem;
|
|
275
|
+
return {
|
|
276
|
+
values,
|
|
277
|
+
findItem(itemValue, isEqual) {
|
|
278
|
+
if (!valueToItem) {
|
|
279
|
+
valueToItem = /* @__PURE__ */ new Map();
|
|
280
|
+
for (let i = 0; i < values.length; i += 1) if (!valueToItem.has(values[i])) valueToItem.set(values[i], flat[i]);
|
|
281
|
+
}
|
|
282
|
+
return findCollectionItem(valueToItem, itemValue, isEqual);
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
}, [filteredItemsProp, itemToValue]);
|
|
286
|
+
const itemToStringLabel = React$1.useMemo(() => {
|
|
287
|
+
if (!collection) return itemToStringLabelProp;
|
|
288
|
+
return (itemValue) => {
|
|
289
|
+
return collection.label(itemValue, isItemEqualToValue, (unresolvedValue) => {
|
|
290
|
+
const externalItem = externalWindow?.findItem(unresolvedValue, isItemEqualToValue);
|
|
291
|
+
if (externalItem != null) return collection.itemLabel(externalItem);
|
|
292
|
+
return stringifyAsLabel(unresolvedValue, itemToStringLabelProp);
|
|
293
|
+
});
|
|
294
|
+
};
|
|
295
|
+
}, [
|
|
296
|
+
collection,
|
|
297
|
+
itemToStringLabelProp,
|
|
298
|
+
externalWindow,
|
|
299
|
+
isItemEqualToValue
|
|
300
|
+
]);
|
|
301
|
+
const filterItemToString = React$1.useMemo(() => {
|
|
302
|
+
if (!collection) return itemToStringLabelProp;
|
|
303
|
+
return Object.assign((item) => collection.itemLabel(item), { selected: (value) => stringifyAsLabel(value, itemToStringLabel) });
|
|
304
|
+
}, [
|
|
305
|
+
collection,
|
|
306
|
+
itemToStringLabel,
|
|
307
|
+
itemToStringLabelProp
|
|
308
|
+
]);
|
|
309
|
+
function stringifyValueLabel(item) {
|
|
310
|
+
return stringifyAsLabel(item, itemToStringLabel);
|
|
311
|
+
}
|
|
312
|
+
const [queryChangedAfterOpen, setQueryChangedAfterOpen] = React$1.useState(false);
|
|
313
|
+
const [closeQuery, setCloseQuery] = React$1.useState(null);
|
|
314
|
+
const previousCloseQueryRef = React$1.useRef(closeQuery);
|
|
315
|
+
const listRef = React$1.useRef([]);
|
|
316
|
+
const labelsRef = React$1.useRef([]);
|
|
317
|
+
const popupRef = React$1.useRef(null);
|
|
318
|
+
const inputRef = React$1.useRef(null);
|
|
319
|
+
const startDismissRef = React$1.useRef(null);
|
|
320
|
+
const endDismissRef = React$1.useRef(null);
|
|
321
|
+
const emptyRef = React$1.useRef(null);
|
|
322
|
+
const hadInputClearRef = React$1.useRef(false);
|
|
323
|
+
const chipsContainerRef = React$1.useRef(null);
|
|
324
|
+
const clearRef = React$1.useRef(null);
|
|
325
|
+
const selectionEventRef = React$1.useRef(null);
|
|
326
|
+
const lastHighlightRef = React$1.useRef(INITIAL_LAST_HIGHLIGHT);
|
|
327
|
+
const pendingQueryHighlightRef = React$1.useRef(null);
|
|
328
|
+
/**
|
|
329
|
+
* Contains the currently visible list of item values post-filtering.
|
|
330
|
+
*/
|
|
331
|
+
const valuesRef = React$1.useRef([]);
|
|
332
|
+
/**
|
|
333
|
+
* The item element that received the last `pointerdown`, used to detect whether a
|
|
334
|
+
* `mouseup` on an item belongs to a drag-select gesture that started elsewhere.
|
|
335
|
+
*/
|
|
336
|
+
const pointerDownItemRef = React$1.useRef(null);
|
|
337
|
+
const disabled = fieldDisabled || disabledProp;
|
|
338
|
+
const name = fieldName ?? nameProp;
|
|
339
|
+
const multiple = selectionMode === "multiple";
|
|
340
|
+
const single = selectionMode === "single";
|
|
341
|
+
const hasInputValue = inputValueProp !== void 0 || defaultInputValue !== void 0;
|
|
342
|
+
const hasItems = items !== void 0;
|
|
343
|
+
const hasFilteredItemsProp = filteredItemsProp !== void 0;
|
|
344
|
+
let autoHighlightMode;
|
|
345
|
+
if (autoHighlight === "always") autoHighlightMode = "always";
|
|
346
|
+
else autoHighlightMode = autoHighlight ? "input-change" : false;
|
|
347
|
+
const [selectedValue, setSelectedValueUnwrapped] = useControlled({
|
|
348
|
+
controlled: selectedValueProp,
|
|
349
|
+
default: multiple ? defaultSelectedValue ?? EMPTY_ARRAY : defaultSelectedValue,
|
|
350
|
+
name: "Combobox",
|
|
351
|
+
state: "selectedValue"
|
|
352
|
+
});
|
|
353
|
+
const filter = React$1.useMemo(() => {
|
|
354
|
+
if (filterProp === null) return () => true;
|
|
355
|
+
if (filterProp !== void 0) return filterProp;
|
|
356
|
+
return createCollatorItemFilter(collatorFilter, filterItemToString);
|
|
357
|
+
}, [
|
|
358
|
+
filterProp,
|
|
359
|
+
collatorFilter,
|
|
360
|
+
filterItemToString
|
|
361
|
+
]);
|
|
362
|
+
const initialDefaultInputValue = useRefWithInit(() => {
|
|
363
|
+
if (hasInputValue) return defaultInputValue ?? "";
|
|
364
|
+
if (single) return stringifyValueLabel(selectedValue);
|
|
365
|
+
return "";
|
|
366
|
+
}).current;
|
|
367
|
+
const [inputValue, setInputValueUnwrapped] = useControlled({
|
|
368
|
+
controlled: inputValueProp,
|
|
369
|
+
default: initialDefaultInputValue,
|
|
370
|
+
name: "Combobox",
|
|
371
|
+
state: "inputValue"
|
|
372
|
+
});
|
|
373
|
+
const [open, setOpenUnwrapped] = useControlled({
|
|
374
|
+
controlled: openProp,
|
|
375
|
+
default: defaultOpen,
|
|
376
|
+
name: "Combobox",
|
|
377
|
+
state: "open"
|
|
378
|
+
});
|
|
379
|
+
const isGrouped = isGroupedItems(items);
|
|
380
|
+
const query = !open && closeQuery !== null ? closeQuery : String(inputValue).trim();
|
|
381
|
+
const selectedLabelString = single ? stringifyValueLabel(selectedValue) : "";
|
|
382
|
+
const shouldBypassFiltering = single && !queryChangedAfterOpen && query !== "" && selectedLabelString.length === query.length && collatorFilter.contains(selectedLabelString, query);
|
|
383
|
+
const filterQuery = shouldBypassFiltering ? "" : filterQueryProp ?? query;
|
|
384
|
+
const shouldIgnoreExternalFiltering = hasItems && hasFilteredItemsProp && shouldBypassFiltering && (!collection || collection.hasValue(selectedValue, isItemEqualToValue));
|
|
385
|
+
const flatItems = React$1.useMemo(() => items ? flattenLeafItems(items) : EMPTY_ARRAY, [items]);
|
|
386
|
+
const filteredItems = React$1.useMemo(() => {
|
|
387
|
+
if (filteredItemsProp && !shouldIgnoreExternalFiltering) return filteredItemsProp;
|
|
388
|
+
if (!items) return EMPTY_ARRAY;
|
|
389
|
+
if (isGrouped) {
|
|
390
|
+
const groupedItems = items;
|
|
391
|
+
const resultingGroups = [];
|
|
392
|
+
let currentCount = 0;
|
|
393
|
+
for (const group of groupedItems) {
|
|
394
|
+
if (limit > -1 && currentCount >= limit) break;
|
|
395
|
+
const remainingLimit = limit > -1 ? limit - currentCount : Infinity;
|
|
396
|
+
const itemsToTake = filterQuery === "" ? group.items.slice(0, remainingLimit) : [];
|
|
397
|
+
if (filterQuery !== "") for (const item of group.items) {
|
|
398
|
+
if (itemsToTake.length >= remainingLimit) break;
|
|
399
|
+
if (filter(item, filterQuery, filterItemToString)) itemsToTake.push(item);
|
|
400
|
+
}
|
|
401
|
+
if (itemsToTake.length > 0) {
|
|
402
|
+
const newGroup = {
|
|
403
|
+
...group,
|
|
404
|
+
items: itemsToTake
|
|
405
|
+
};
|
|
406
|
+
resultingGroups.push(newGroup);
|
|
407
|
+
currentCount += itemsToTake.length;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
return resultingGroups;
|
|
411
|
+
}
|
|
412
|
+
if (filterQuery === "") return limit > -1 ? flatItems.slice(0, limit) : flatItems;
|
|
413
|
+
const limitedItems = [];
|
|
414
|
+
for (const item of flatItems) {
|
|
415
|
+
if (limit > -1 && limitedItems.length >= limit) break;
|
|
416
|
+
if (filter(item, filterQuery, filterItemToString)) limitedItems.push(item);
|
|
417
|
+
}
|
|
418
|
+
return limitedItems;
|
|
419
|
+
}, [
|
|
420
|
+
filteredItemsProp,
|
|
421
|
+
shouldIgnoreExternalFiltering,
|
|
422
|
+
items,
|
|
423
|
+
isGrouped,
|
|
424
|
+
filterQuery,
|
|
425
|
+
limit,
|
|
426
|
+
filter,
|
|
427
|
+
filterItemToString,
|
|
428
|
+
flatItems
|
|
429
|
+
]);
|
|
430
|
+
/**
|
|
431
|
+
* The filtered items flattened across groups and projected to their selection values.
|
|
432
|
+
*/
|
|
433
|
+
const flatFilteredValues = React$1.useMemo(() => {
|
|
434
|
+
if (externalWindow && filteredItems === filteredItemsProp) return externalWindow.values;
|
|
435
|
+
const flat = flattenLeafItems(filteredItems);
|
|
436
|
+
return itemToValue ? flat.map((item) => itemToValue(item)) : flat;
|
|
437
|
+
}, [
|
|
438
|
+
filteredItems,
|
|
439
|
+
filteredItemsProp,
|
|
440
|
+
externalWindow,
|
|
441
|
+
itemToValue
|
|
442
|
+
]);
|
|
443
|
+
const store = useRefWithInit(() => {
|
|
444
|
+
let initialSelectedIndex = null;
|
|
445
|
+
if (inlineProp && open && hasItems && selectionMode !== "none") initialSelectedIndex = findSelectionIndex(flatFilteredValues, selectedValue, isItemEqualToValue, multiple);
|
|
446
|
+
return new ReactStore({
|
|
447
|
+
id,
|
|
448
|
+
labelId: void 0,
|
|
449
|
+
selectedValue,
|
|
450
|
+
open,
|
|
451
|
+
items: storeItems,
|
|
452
|
+
selectionMode,
|
|
453
|
+
name,
|
|
454
|
+
form,
|
|
455
|
+
disabled,
|
|
456
|
+
readOnly,
|
|
457
|
+
required,
|
|
458
|
+
grid,
|
|
459
|
+
virtualized,
|
|
460
|
+
openOnInputClick,
|
|
461
|
+
itemToStringLabel,
|
|
462
|
+
isItemEqualToValue,
|
|
463
|
+
modal,
|
|
464
|
+
autoHighlight: autoHighlightMode,
|
|
465
|
+
submitOnItemClick,
|
|
466
|
+
hasInputValue,
|
|
467
|
+
mounted: false,
|
|
468
|
+
forceMounted: false,
|
|
469
|
+
transitionStatus: "idle",
|
|
470
|
+
inline: inlineProp,
|
|
471
|
+
activeIndex: null,
|
|
472
|
+
selectedIndex: initialSelectedIndex,
|
|
473
|
+
popupProps: {},
|
|
474
|
+
listProps: {},
|
|
475
|
+
inputProps: {},
|
|
476
|
+
triggerProps: {},
|
|
477
|
+
itemRoot: {
|
|
478
|
+
props: EMPTY_OBJECT,
|
|
479
|
+
id,
|
|
480
|
+
selectionMode,
|
|
481
|
+
disabled,
|
|
482
|
+
readOnly,
|
|
483
|
+
isItemEqualToValue
|
|
484
|
+
},
|
|
485
|
+
positionerElement: null,
|
|
486
|
+
listElement: null,
|
|
487
|
+
popupId: void 0,
|
|
488
|
+
triggerElement: null,
|
|
489
|
+
inputElement: null,
|
|
490
|
+
inputGroupElement: null,
|
|
491
|
+
popupSide: null,
|
|
492
|
+
openMethod: null,
|
|
493
|
+
inputInsidePopup: true,
|
|
494
|
+
inputOwnsFormValue: selectionMode === "none"
|
|
495
|
+
}, {
|
|
496
|
+
onOpenChangeComplete: NOOP,
|
|
497
|
+
setOpen: NOOP,
|
|
498
|
+
setInputValue: NOOP,
|
|
499
|
+
setSelectedValue: NOOP,
|
|
500
|
+
setIndices: NOOP,
|
|
501
|
+
handleSelection: NOOP,
|
|
502
|
+
forceMount: NOOP,
|
|
503
|
+
requestSubmit: NOOP,
|
|
504
|
+
listRef,
|
|
505
|
+
labelsRef,
|
|
506
|
+
popupRef,
|
|
507
|
+
emptyRef,
|
|
508
|
+
inputRef,
|
|
509
|
+
startDismissRef,
|
|
510
|
+
endDismissRef,
|
|
511
|
+
chipsContainerRef,
|
|
512
|
+
clearRef,
|
|
513
|
+
valuesRef,
|
|
514
|
+
pointerDownItemRef,
|
|
515
|
+
selectionEventRef
|
|
516
|
+
}, selectors);
|
|
517
|
+
}).current;
|
|
518
|
+
const fieldRawValue = selectionMode === "none" ? inputValue : selectedValue;
|
|
519
|
+
const fieldStringValue = React$1.useMemo(() => {
|
|
520
|
+
if (selectionMode === "none") return fieldRawValue;
|
|
521
|
+
if (Array.isArray(selectedValue)) return selectedValue.map((value) => stringifyAsValue(value, itemToStringValue));
|
|
522
|
+
return stringifyAsValue(selectedValue, itemToStringValue);
|
|
523
|
+
}, [
|
|
524
|
+
fieldRawValue,
|
|
525
|
+
itemToStringValue,
|
|
526
|
+
selectionMode,
|
|
527
|
+
selectedValue
|
|
528
|
+
]);
|
|
529
|
+
const onItemHighlighted = useStableCallback(onItemHighlightedProp);
|
|
530
|
+
const onOpenChangeComplete = useStableCallback(onOpenChangeCompleteProp);
|
|
531
|
+
const activeIndex = store.useState("activeIndex");
|
|
532
|
+
const selectedIndex = store.useState("selectedIndex");
|
|
533
|
+
const positionerElement = store.useState("positionerElement");
|
|
534
|
+
const listElement = store.useState("listElement");
|
|
535
|
+
const triggerElement = store.useState("triggerElement");
|
|
536
|
+
const inputElement = store.useState("inputElement");
|
|
537
|
+
const inputGroupElement = store.useState("inputGroupElement");
|
|
538
|
+
const inline = store.useState("inline");
|
|
539
|
+
const inputInsidePopup = store.useState("inputInsidePopup");
|
|
540
|
+
const inputOwnsFormValue = store.useState("inputOwnsFormValue");
|
|
541
|
+
const inputMatchesSelectedValue = single && !inputInsidePopup && inputValue === selectedLabelString;
|
|
542
|
+
const triggerRef = useValueAsRef(triggerElement);
|
|
543
|
+
const { openMethod, triggerProps } = useOpenInteractionType(open);
|
|
544
|
+
const getStringifiedValueForForm = useStableCallback(() => fieldStringValue);
|
|
545
|
+
useRegisterFieldControl(inputInsidePopup ? triggerRef : inputRef, id, fieldRawValue, getStringifiedValueForForm, !disabled, nameProp);
|
|
546
|
+
const forceMount = useStableCallback(() => {
|
|
547
|
+
if (items) labelsRef.current = flatFilteredValues.map(stringifyValueLabel);
|
|
548
|
+
else store.set("forceMounted", true);
|
|
549
|
+
});
|
|
550
|
+
/**
|
|
551
|
+
* Emits `onItemHighlighted` for the item at `index`, or clears the highlight when `index` is `-1`
|
|
552
|
+
* (a no-op if nothing was highlighted). Keeps `lastHighlightRef` in sync with what was emitted.
|
|
553
|
+
*/
|
|
554
|
+
const emitHighlight = useStableCallback((value, index, type, event) => {
|
|
555
|
+
if (index === -1) {
|
|
556
|
+
if (lastHighlightRef.current === INITIAL_LAST_HIGHLIGHT) return;
|
|
557
|
+
lastHighlightRef.current = INITIAL_LAST_HIGHLIGHT;
|
|
558
|
+
} else lastHighlightRef.current = {
|
|
559
|
+
value,
|
|
560
|
+
index
|
|
561
|
+
};
|
|
562
|
+
onItemHighlighted(value, createGenericEventDetails(type, event, { index }));
|
|
563
|
+
});
|
|
564
|
+
const setIndices = useStableCallback((options) => {
|
|
565
|
+
const update = {};
|
|
566
|
+
if (options.activeIndex !== void 0) update.activeIndex = options.activeIndex;
|
|
567
|
+
if (options.selectedIndex !== void 0) update.selectedIndex = options.selectedIndex;
|
|
568
|
+
store.update(update);
|
|
569
|
+
const activeIndexOption = options.activeIndex;
|
|
570
|
+
if (activeIndexOption === void 0) return;
|
|
571
|
+
const type = options.type || "none";
|
|
572
|
+
if (activeIndexOption === null) emitHighlight(void 0, -1, type, options.event);
|
|
573
|
+
else emitHighlight(valuesRef.current[activeIndexOption], activeIndexOption, type, options.event);
|
|
574
|
+
});
|
|
575
|
+
const setInputValue = useStableCallback((next, eventDetails) => {
|
|
576
|
+
props.onInputValueChange?.(next, eventDetails);
|
|
577
|
+
if (eventDetails.isCanceled) return;
|
|
578
|
+
hadInputClearRef.current = eventDetails.reason === inputClear;
|
|
579
|
+
if (eventDetails.reason === "input-change") {
|
|
580
|
+
if (open && closeQuery !== null) setCloseQuery(null);
|
|
581
|
+
const event = eventDetails.event;
|
|
582
|
+
const inputType = event.inputType;
|
|
583
|
+
if (event.type === "compositionend" || inputType != null && inputType !== "" && inputType !== "insertReplacementText") {
|
|
584
|
+
const hasQuery = next.trim() !== "";
|
|
585
|
+
if (hasQuery) setQueryChangedAfterOpen(true);
|
|
586
|
+
pendingQueryHighlightRef.current = { hasQuery };
|
|
587
|
+
const list = store.state.listElement;
|
|
588
|
+
if (!store.state.virtualized && list) {
|
|
589
|
+
const popup = popupRef.current;
|
|
590
|
+
for (const ancestor of getOverflowAncestors(list.firstElementChild ?? list)) {
|
|
591
|
+
if (!isHTMLElement(ancestor) || (popup ? !contains(popup, ancestor) : ancestor.getAttribute("role") === "dialog")) break;
|
|
592
|
+
if (isScrollableY(ancestor)) {
|
|
593
|
+
ancestor.scrollTop = 0;
|
|
594
|
+
break;
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
if (hasQuery && autoHighlightMode && store.state.activeIndex == null && (open || inline)) store.set("activeIndex", 0);
|
|
599
|
+
}
|
|
600
|
+
} else if (eventDetails.reason === "input-clear" && next === "" && store.state.inputInsidePopup) pendingQueryHighlightRef.current = {
|
|
601
|
+
hasQuery: false,
|
|
602
|
+
selection: true
|
|
603
|
+
};
|
|
604
|
+
setInputValueUnwrapped(next);
|
|
605
|
+
});
|
|
606
|
+
const handleInterruptedReopen = useStableCallback((isInputChange) => {
|
|
607
|
+
const clearsPendingInput = !isInputChange && inputInsidePopup && !inline && inputValue !== "" && (String(inputValue).trim() === closeQuery || inputValue === selectedLabelString);
|
|
608
|
+
if (!isInputChange && (clearsPendingInput || inputValue === "" || inputMatchesSelectedValue)) setQueryChangedAfterOpen(false);
|
|
609
|
+
setCloseQuery(null);
|
|
610
|
+
if (clearsPendingInput) setInputValue("", createChangeEventDetails(inputClear));
|
|
611
|
+
});
|
|
612
|
+
const [preventUnmountOnClose, setPreventUnmountOnClose] = React$1.useState(false);
|
|
613
|
+
const setOpen = useStableCallback((nextOpen, eventDetails) => {
|
|
614
|
+
if (open === nextOpen) return;
|
|
615
|
+
if (eventDetails.reason === "escape-key" && hasItems && flatFilteredValues.length === 0 && !emptyRef.current) eventDetails.allowPropagation();
|
|
616
|
+
const openEventDetails = eventDetails;
|
|
617
|
+
const shouldPreventUnmountOnClose = attachPreventUnmountOnClose(openEventDetails);
|
|
618
|
+
props.onOpenChange?.(nextOpen, openEventDetails);
|
|
619
|
+
if (pendingQueryHighlightRef.current?.hasQuery && eventDetails.reason === "input-change" === eventDetails.isCanceled) pendingQueryHighlightRef.current = null;
|
|
620
|
+
if (eventDetails.isCanceled) return;
|
|
621
|
+
if (nextOpen && closeQuery !== null) handleInterruptedReopen(eventDetails.reason === inputChange);
|
|
622
|
+
if (!nextOpen && queryChangedAfterOpen) {
|
|
623
|
+
if (single) {
|
|
624
|
+
if (!inline) setCloseQuery(query);
|
|
625
|
+
if (query === "") setQueryChangedAfterOpen(false);
|
|
626
|
+
} else if (multiple) {
|
|
627
|
+
if (!inline) setCloseQuery(query);
|
|
628
|
+
if (inputInsidePopup) setIndices({ activeIndex: null });
|
|
629
|
+
if (!inputInsidePopup || inline) setInputValue("", createChangeEventDetails(inputClear, eventDetails.event, void 0, { isItemPress: eventDetails.reason === itemPress }));
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
if (!nextOpen) setPreventUnmountOnClose(shouldPreventUnmountOnClose());
|
|
633
|
+
setOpenUnwrapped(nextOpen);
|
|
634
|
+
if (!nextOpen && inputInsidePopup && (eventDetails.reason === "focus-out" || eventDetails.reason === "outside-press")) {
|
|
635
|
+
setTouched(true);
|
|
636
|
+
setFocused(false);
|
|
637
|
+
if (validationMode === "onBlur") {
|
|
638
|
+
const valueToValidate = selectionMode === "none" ? inputValue : selectedValue;
|
|
639
|
+
validation.commit(valueToValidate);
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
});
|
|
643
|
+
const setSelectedValue = useStableCallback((nextValue, eventDetails) => {
|
|
644
|
+
onSelectedValueChange?.(nextValue, eventDetails);
|
|
645
|
+
if (eventDetails.isCanceled) return;
|
|
646
|
+
setSelectedValueUnwrapped(nextValue);
|
|
647
|
+
if (selectionMode === "none" && popupRef.current && fillInputOnItemPress || single && !store.state.inputInsidePopup) setInputValue(stringifyValueLabel(nextValue), createChangeEventDetails(eventDetails.reason, eventDetails.event));
|
|
648
|
+
});
|
|
649
|
+
const handleSelection = useStableCallback((event, itemValue) => {
|
|
650
|
+
const targetEl = getTarget(event);
|
|
651
|
+
const overrideEvent = selectionEventRef.current ?? event;
|
|
652
|
+
selectionEventRef.current = null;
|
|
653
|
+
const eventDetails = createChangeEventDetails(itemPress, overrideEvent);
|
|
654
|
+
const href = closest(targetEl, "a")?.getAttribute("href");
|
|
655
|
+
if (href) {
|
|
656
|
+
if (href.startsWith("#")) setOpen(false, eventDetails);
|
|
657
|
+
return;
|
|
658
|
+
}
|
|
659
|
+
if (multiple) {
|
|
660
|
+
const currentSelectedValue = Array.isArray(selectedValue) ? selectedValue : [];
|
|
661
|
+
const isCurrentlySelected = selectedValueIncludes(currentSelectedValue, itemValue, isItemEqualToValue);
|
|
662
|
+
const nextValue = isCurrentlySelected ? removeItem(currentSelectedValue, itemValue, isItemEqualToValue) : [...currentSelectedValue, itemValue];
|
|
663
|
+
setSelectedValue(nextValue, eventDetails);
|
|
664
|
+
if (eventDetails.isCanceled) return;
|
|
665
|
+
if (!(inputRef.current ? inputRef.current.value.trim() !== "" : false)) return;
|
|
666
|
+
if (store.state.inputInsidePopup) {
|
|
667
|
+
setInputValue("", createChangeEventDetails(inputClear, eventDetails.event, void 0, { isItemPress: true }));
|
|
668
|
+
const pendingHighlight = pendingQueryHighlightRef.current;
|
|
669
|
+
if (pendingHighlight && !isCurrentlySelected) pendingHighlight.toggledValue = itemValue;
|
|
670
|
+
} else setOpen(false, eventDetails);
|
|
671
|
+
} else {
|
|
672
|
+
setSelectedValue(itemValue, eventDetails);
|
|
673
|
+
if (eventDetails.isCanceled) return;
|
|
674
|
+
setOpen(false, eventDetails);
|
|
675
|
+
}
|
|
676
|
+
});
|
|
677
|
+
const requestSubmit = useStableCallback(() => {
|
|
678
|
+
const formElement = validation.inputRef.current?.form ?? store.state.inputElement?.form;
|
|
679
|
+
if (formElement && typeof formElement.requestSubmit === "function") formElement.requestSubmit();
|
|
680
|
+
});
|
|
681
|
+
const handleUnmountCleanup = useStableCallback(() => {
|
|
682
|
+
onOpenChangeComplete?.(false);
|
|
683
|
+
setQueryChangedAfterOpen(false);
|
|
684
|
+
setCloseQuery(null);
|
|
685
|
+
if (selectionMode === "none") setIndices({
|
|
686
|
+
activeIndex: null,
|
|
687
|
+
selectedIndex: null
|
|
688
|
+
});
|
|
689
|
+
else setIndices({ activeIndex: null });
|
|
690
|
+
if (multiple && inputRef.current && inputRef.current.value !== "" && !hadInputClearRef.current) setInputValue("", createChangeEventDetails(inputClear));
|
|
691
|
+
if (single) {
|
|
692
|
+
if (store.state.inputInsidePopup) {
|
|
693
|
+
if (inputRef.current && inputRef.current.value !== "") setInputValue("", createChangeEventDetails(inputClear));
|
|
694
|
+
} else {
|
|
695
|
+
const stringVal = stringifyValueLabel(selectedValue);
|
|
696
|
+
if (inputRef.current && inputRef.current.value !== stringVal) setInputValue(stringVal, createChangeEventDetails(stringVal === "" ? inputClear : none));
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
});
|
|
700
|
+
const resolvedPopupRef = React$1.useMemo(() => {
|
|
701
|
+
if (inline && positionerElement) return { current: closest(positionerElement, "[role=\"dialog\"]") };
|
|
702
|
+
return popupRef;
|
|
703
|
+
}, [inline, positionerElement]);
|
|
704
|
+
const { mounted, transitionStatus, forceUnmount: handleUnmount } = useUnmountAfterClose({
|
|
705
|
+
open,
|
|
706
|
+
ref: resolvedPopupRef,
|
|
707
|
+
preventUnmountOnClose,
|
|
708
|
+
setPreventUnmountOnClose,
|
|
709
|
+
onUnmount: handleUnmountCleanup
|
|
710
|
+
});
|
|
711
|
+
React$1.useImperativeHandle(props.actionsRef, () => ({
|
|
712
|
+
unmount: handleUnmount,
|
|
713
|
+
close: () => setOpen(false, createChangeEventDetails(imperativeAction))
|
|
714
|
+
}), [handleUnmount, setOpen]);
|
|
715
|
+
useIsoLayoutEffect(function syncSelectedIndex() {
|
|
716
|
+
const closeQueryReleased = previousCloseQueryRef.current !== null && closeQuery === null;
|
|
717
|
+
previousCloseQueryRef.current = closeQuery;
|
|
718
|
+
if (open && (!closeQueryReleased || !hasItems)) return;
|
|
719
|
+
if (!open) pointerDownItemRef.current = null;
|
|
720
|
+
if (selectionMode === "none") return;
|
|
721
|
+
const registry = hasItems ? flatFilteredValues : valuesRef.current;
|
|
722
|
+
setIndices({ selectedIndex: findSelectionIndex(registry, selectedValue, isItemEqualToValue, multiple) });
|
|
723
|
+
}, [
|
|
724
|
+
open,
|
|
725
|
+
closeQuery,
|
|
726
|
+
selectedValue,
|
|
727
|
+
selectionMode,
|
|
728
|
+
multiple,
|
|
729
|
+
hasItems,
|
|
730
|
+
flatFilteredValues,
|
|
731
|
+
isItemEqualToValue,
|
|
732
|
+
setIndices
|
|
733
|
+
]);
|
|
734
|
+
useIsoLayoutEffect(() => {
|
|
735
|
+
if (items) {
|
|
736
|
+
valuesRef.current = flatFilteredValues;
|
|
737
|
+
listRef.current.length = flatFilteredValues.length;
|
|
738
|
+
}
|
|
739
|
+
}, [items, flatFilteredValues]);
|
|
740
|
+
useIsoLayoutEffect(() => {
|
|
741
|
+
if (!open && pendingQueryHighlightRef.current?.hasQuery) pendingQueryHighlightRef.current = null;
|
|
742
|
+
}, [open]);
|
|
743
|
+
useIsoLayoutEffect(() => {
|
|
744
|
+
if (!open && inline && resolvedPopupRef.current) {
|
|
745
|
+
pendingQueryHighlightRef.current = null;
|
|
746
|
+
return;
|
|
747
|
+
}
|
|
748
|
+
const candidateItems = hasItems || hasFilteredItemsProp ? flatFilteredValues : valuesRef.current;
|
|
749
|
+
const pendingHighlight = pendingQueryHighlightRef.current;
|
|
750
|
+
if (pendingHighlight) {
|
|
751
|
+
const listIsNavigable = open || inline || store.state.positionerElement?.hidden === false;
|
|
752
|
+
if (pendingHighlight.hasQuery) {
|
|
753
|
+
const input = inputRef.current;
|
|
754
|
+
if (!autoHighlightMode || String(inputValue).trim() === "" || inline && autoHighlightMode !== "always" && (!input || activeElement(input.ownerDocument) !== input)) pendingQueryHighlightRef.current = null;
|
|
755
|
+
else if (listIsNavigable && (candidateItems[0] !== void 0 || !hasItems && !hasFilteredItemsProp)) {
|
|
756
|
+
store.set("activeIndex", 0);
|
|
757
|
+
pendingQueryHighlightRef.current = null;
|
|
758
|
+
}
|
|
759
|
+
} else if (String(inputValue).trim() === "") {
|
|
760
|
+
pendingQueryHighlightRef.current = null;
|
|
761
|
+
if (listIsNavigable) {
|
|
762
|
+
const clearedBySelection = pendingHighlight.selection;
|
|
763
|
+
if (autoHighlightMode === "always" && !clearedBySelection && store.state.selectionMode === "none") store.set("activeIndex", 0);
|
|
764
|
+
queueMicrotask(() => {
|
|
765
|
+
if (!store.state.open && (!store.state.inline || resolvedPopupRef.current) || inputRef.current && inputRef.current.value.trim() !== "") return;
|
|
766
|
+
const currentSelectedValue = store.state.selectedValue;
|
|
767
|
+
const isMultiple = store.state.selectionMode === "multiple";
|
|
768
|
+
if (isMultiple && Array.isArray(currentSelectedValue) ? currentSelectedValue.length > 0 : store.state.selectionMode !== "none" && currentSelectedValue != null) {
|
|
769
|
+
const registry = hasItems || hasFilteredItemsProp ? flatFilteredValues : valuesRef.current;
|
|
770
|
+
const toggledIndex = findItemIndex(registry, pendingHighlight.toggledValue, store.state.isItemEqualToValue);
|
|
771
|
+
store.set("activeIndex", toggledIndex !== -1 ? toggledIndex : findSelectionIndex(registry, currentSelectedValue, store.state.isItemEqualToValue, isMultiple));
|
|
772
|
+
} else if (clearedBySelection) store.set("activeIndex", null);
|
|
773
|
+
else if (autoHighlightMode === "always") store.set("activeIndex", 0);
|
|
774
|
+
});
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
if (!open && !inline) return;
|
|
779
|
+
const storeActiveIndex = store.state.activeIndex;
|
|
780
|
+
if (storeActiveIndex == null) {
|
|
781
|
+
if (autoHighlightMode === "always" && candidateItems.length > 0) {
|
|
782
|
+
store.set("activeIndex", 0);
|
|
783
|
+
return;
|
|
784
|
+
}
|
|
785
|
+
emitHighlight(void 0, -1, none);
|
|
786
|
+
return;
|
|
787
|
+
}
|
|
788
|
+
if (storeActiveIndex >= candidateItems.length) {
|
|
789
|
+
emitHighlight(void 0, -1, none);
|
|
790
|
+
store.set("activeIndex", null);
|
|
791
|
+
return;
|
|
792
|
+
}
|
|
793
|
+
const itemValue = candidateItems[storeActiveIndex];
|
|
794
|
+
const previouslyHighlightedItemValue = lastHighlightRef.current.value;
|
|
795
|
+
const isSameItem = previouslyHighlightedItemValue !== NO_ACTIVE_VALUE && compareItemEquality(itemValue, previouslyHighlightedItemValue, store.state.isItemEqualToValue);
|
|
796
|
+
if (lastHighlightRef.current.index !== storeActiveIndex || !isSameItem) emitHighlight(itemValue, storeActiveIndex, none);
|
|
797
|
+
}, [
|
|
798
|
+
activeIndex,
|
|
799
|
+
autoHighlightMode,
|
|
800
|
+
emitHighlight,
|
|
801
|
+
hasFilteredItemsProp,
|
|
802
|
+
hasItems,
|
|
803
|
+
flatFilteredValues,
|
|
804
|
+
inline,
|
|
805
|
+
open,
|
|
806
|
+
resolvedPopupRef,
|
|
807
|
+
store,
|
|
808
|
+
inputValue
|
|
809
|
+
]);
|
|
810
|
+
useIsoLayoutEffect(() => {
|
|
811
|
+
if (selectionMode === "none") {
|
|
812
|
+
setFilled(String(inputValue) !== "");
|
|
813
|
+
return;
|
|
814
|
+
}
|
|
815
|
+
setFilled(multiple ? Array.isArray(selectedValue) && selectedValue.length > 0 : selectedValue != null);
|
|
816
|
+
}, [
|
|
817
|
+
setFilled,
|
|
818
|
+
selectionMode,
|
|
819
|
+
inputValue,
|
|
820
|
+
selectedValue,
|
|
821
|
+
multiple
|
|
822
|
+
]);
|
|
823
|
+
React$1.useEffect(() => {
|
|
824
|
+
if (hasItems && autoHighlightMode && flatFilteredValues.length === 0) setIndices({ activeIndex: null });
|
|
825
|
+
}, [
|
|
826
|
+
hasItems,
|
|
827
|
+
autoHighlightMode,
|
|
828
|
+
flatFilteredValues.length,
|
|
829
|
+
setIndices
|
|
830
|
+
]);
|
|
831
|
+
function handleQueryChanged() {
|
|
832
|
+
if (open && query !== "" && query !== String(initialDefaultInputValue) && !inputMatchesSelectedValue) setQueryChangedAfterOpen(true);
|
|
833
|
+
}
|
|
834
|
+
function handleOpenChanged() {
|
|
835
|
+
if (open && closeQuery !== null) handleInterruptedReopen(false);
|
|
836
|
+
}
|
|
837
|
+
let syncedSelectedLabel = false;
|
|
838
|
+
function syncInputToSelectedLabel() {
|
|
839
|
+
if (!syncedSelectedLabel && inputValue !== selectedLabelString) {
|
|
840
|
+
syncedSelectedLabel = true;
|
|
841
|
+
setInputValue(selectedLabelString, createChangeEventDetails(none));
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
function handleSelectedValueChanged() {
|
|
845
|
+
if (selectionMode === "none") return;
|
|
846
|
+
clearErrors(name);
|
|
847
|
+
setDirty(isSelectedValueDirty(selectedValue, validityData.initialValue, isItemEqualToValue));
|
|
848
|
+
validation.change(selectedValue);
|
|
849
|
+
if (single && !hasInputValue && !inputInsidePopup) syncInputToSelectedLabel();
|
|
850
|
+
}
|
|
851
|
+
function syncInputAfterItemsOrLabelChange() {
|
|
852
|
+
if (single && !hasInputValue && !inputInsidePopup && !queryChangedAfterOpen) syncInputToSelectedLabel();
|
|
853
|
+
}
|
|
854
|
+
function handleInputValueChanged() {
|
|
855
|
+
if (selectionMode !== "none") return;
|
|
856
|
+
clearErrors(name);
|
|
857
|
+
setDirty(inputValue !== validityData.initialValue);
|
|
858
|
+
validation.change(inputValue);
|
|
859
|
+
}
|
|
860
|
+
useValueChanged(query, handleQueryChanged);
|
|
861
|
+
useValueChanged(open, handleOpenChanged);
|
|
862
|
+
useValueChanged(selectedValue, handleSelectedValueChanged);
|
|
863
|
+
useValueChanged(selectedLabelString, syncInputAfterItemsOrLabelChange);
|
|
864
|
+
useValueChanged(items, syncInputAfterItemsOrLabelChange);
|
|
865
|
+
useValueChanged(inputValue, handleInputValueChanged);
|
|
866
|
+
const floatingRootContext = useFloatingRootContext({
|
|
867
|
+
open: inline ? true : open,
|
|
868
|
+
onOpenChange: setOpen,
|
|
869
|
+
elements: {
|
|
870
|
+
reference: inputInsidePopup ? triggerElement : inputElement,
|
|
871
|
+
floating: positionerElement
|
|
872
|
+
}
|
|
873
|
+
});
|
|
874
|
+
const ariaHasPopup = grid ? "grid" : "listbox";
|
|
875
|
+
const expanded = open || inline;
|
|
876
|
+
const ariaExpanded = expanded ? "true" : "false";
|
|
877
|
+
const role = React$1.useMemo(() => {
|
|
878
|
+
const isPlainInput = inputElement?.tagName === "INPUT";
|
|
879
|
+
const shouldTreatAsInput = inputElement == null || isPlainInput;
|
|
880
|
+
const shouldApplyAria = shouldTreatAsInput || expanded;
|
|
881
|
+
const reference = shouldTreatAsInput ? {
|
|
882
|
+
autoComplete: "off",
|
|
883
|
+
spellCheck: "false",
|
|
884
|
+
autoCorrect: "off",
|
|
885
|
+
autoCapitalize: "none"
|
|
886
|
+
} : {};
|
|
887
|
+
if (shouldApplyAria) {
|
|
888
|
+
reference.role = "combobox";
|
|
889
|
+
reference["aria-expanded"] = ariaExpanded;
|
|
890
|
+
reference["aria-haspopup"] = ariaHasPopup;
|
|
891
|
+
reference["aria-controls"] = expanded ? listElement?.id : void 0;
|
|
892
|
+
reference["aria-autocomplete"] = readOnly ? "none" : autoComplete;
|
|
893
|
+
}
|
|
894
|
+
return {
|
|
895
|
+
reference,
|
|
896
|
+
floating: { role: "presentation" }
|
|
897
|
+
};
|
|
898
|
+
}, [
|
|
899
|
+
inputElement,
|
|
900
|
+
expanded,
|
|
901
|
+
ariaExpanded,
|
|
902
|
+
ariaHasPopup,
|
|
903
|
+
listElement?.id,
|
|
904
|
+
autoComplete,
|
|
905
|
+
readOnly
|
|
906
|
+
]);
|
|
907
|
+
const click = useClick(floatingRootContext, {
|
|
908
|
+
enabled: !disabled && openOnInputClick,
|
|
909
|
+
event: "mousedown-only",
|
|
910
|
+
toggle: false,
|
|
911
|
+
touchOpenDelay: inputInsidePopup ? 0 : 100,
|
|
912
|
+
reason: inputPress
|
|
913
|
+
});
|
|
914
|
+
const dismiss = useDismiss(floatingRootContext, {
|
|
915
|
+
enabled: !disabled && !inline,
|
|
916
|
+
outsidePressEvent: {
|
|
917
|
+
mouse: "sloppy",
|
|
918
|
+
touch: "intentional"
|
|
919
|
+
},
|
|
920
|
+
bubbles: inline ? true : void 0,
|
|
921
|
+
outsidePress(event) {
|
|
922
|
+
const target = getTarget(event);
|
|
923
|
+
return !contains(triggerElement, target) && !contains(clearRef.current, target) && !contains(chipsContainerRef.current, target) && !contains(inputGroupElement, target);
|
|
924
|
+
}
|
|
925
|
+
});
|
|
926
|
+
const listNavigation = useListNavigation(floatingRootContext, {
|
|
927
|
+
enabled: !disabled,
|
|
928
|
+
id,
|
|
929
|
+
listRef,
|
|
930
|
+
activeIndex,
|
|
931
|
+
selectedIndex,
|
|
932
|
+
virtual: true,
|
|
933
|
+
loopFocus,
|
|
934
|
+
allowEscape: loopFocus && !autoHighlightMode,
|
|
935
|
+
focusItemOnOpen: queryChangedAfterOpen || selectionMode === "none" && !autoHighlightMode ? false : "auto",
|
|
936
|
+
focusItemOnHover: highlightItemOnHover,
|
|
937
|
+
resetOnPointerLeave: !keepHighlight,
|
|
938
|
+
orientation: grid ? "horizontal" : void 0,
|
|
939
|
+
rtl: direction === "rtl",
|
|
940
|
+
disabledIndices: EMPTY_ARRAY,
|
|
941
|
+
grid: grid ? gridNavigation : void 0,
|
|
942
|
+
onNavigate(nextActiveIndex, event) {
|
|
943
|
+
if (!event && !open && !(inline && nextActiveIndex === null) || transitionStatus === "ending") return;
|
|
944
|
+
setIndices({
|
|
945
|
+
activeIndex: nextActiveIndex,
|
|
946
|
+
type: getHighlightReason(event),
|
|
947
|
+
event: event?.nativeEvent
|
|
948
|
+
});
|
|
949
|
+
}
|
|
950
|
+
});
|
|
951
|
+
const inputProps = React$1.useMemo(() => mergeProps(listNavigation.reference, { onKeyDown(event) {
|
|
952
|
+
if (grid && store.state.activeIndex == null && (event.key === "ArrowLeft" || event.key === "ArrowRight")) event.preventBaseUIHandler();
|
|
953
|
+
} }, dismiss.reference, click.reference, role.reference), [
|
|
954
|
+
listNavigation.reference,
|
|
955
|
+
dismiss.reference,
|
|
956
|
+
click.reference,
|
|
957
|
+
role.reference,
|
|
958
|
+
grid,
|
|
959
|
+
store
|
|
960
|
+
]);
|
|
961
|
+
const popupProps = React$1.useMemo(() => mergeProps(FOCUSABLE_POPUP_PROPS, dismiss.floating), [dismiss.floating]);
|
|
962
|
+
const listProps = React$1.useMemo(() => mergeProps(listNavigation.floating, role.floating), [listNavigation.floating, role.floating]);
|
|
963
|
+
const itemRoot = React$1.useMemo(() => {
|
|
964
|
+
const listNavigationItemProps = listNavigation.item;
|
|
965
|
+
return {
|
|
966
|
+
props: listNavigationItemProps ? {
|
|
967
|
+
...listNavigationItemProps,
|
|
968
|
+
onFocus: void 0
|
|
969
|
+
} : EMPTY_OBJECT,
|
|
970
|
+
id,
|
|
971
|
+
selectionMode,
|
|
972
|
+
disabled,
|
|
973
|
+
readOnly,
|
|
974
|
+
isItemEqualToValue
|
|
975
|
+
};
|
|
976
|
+
}, [
|
|
977
|
+
listNavigation.item,
|
|
978
|
+
id,
|
|
979
|
+
selectionMode,
|
|
980
|
+
disabled,
|
|
981
|
+
readOnly,
|
|
982
|
+
isItemEqualToValue
|
|
983
|
+
]);
|
|
984
|
+
store.useContextCallback("setOpen", setOpen);
|
|
985
|
+
store.useContextCallback("setInputValue", setInputValue);
|
|
986
|
+
store.useContextCallback("setSelectedValue", setSelectedValue);
|
|
987
|
+
store.useContextCallback("setIndices", setIndices);
|
|
988
|
+
store.useContextCallback("handleSelection", handleSelection);
|
|
989
|
+
store.useContextCallback("forceMount", forceMount);
|
|
990
|
+
store.useContextCallback("requestSubmit", requestSubmit);
|
|
991
|
+
store.useContextCallback("onOpenChangeComplete", onOpenChangeCompleteProp);
|
|
992
|
+
useOnFirstRender(() => {
|
|
993
|
+
store.update({
|
|
994
|
+
inline: inlineProp,
|
|
995
|
+
popupProps,
|
|
996
|
+
listProps,
|
|
997
|
+
inputProps,
|
|
998
|
+
triggerProps,
|
|
999
|
+
itemRoot
|
|
1000
|
+
});
|
|
1001
|
+
});
|
|
1002
|
+
const syncedValues = {
|
|
1003
|
+
id,
|
|
1004
|
+
selectedValue,
|
|
1005
|
+
open,
|
|
1006
|
+
mounted,
|
|
1007
|
+
transitionStatus,
|
|
1008
|
+
items: storeItems,
|
|
1009
|
+
inline: inlineProp,
|
|
1010
|
+
popupProps,
|
|
1011
|
+
listProps,
|
|
1012
|
+
inputProps,
|
|
1013
|
+
triggerProps,
|
|
1014
|
+
itemRoot,
|
|
1015
|
+
openMethod,
|
|
1016
|
+
selectionMode,
|
|
1017
|
+
name,
|
|
1018
|
+
form,
|
|
1019
|
+
disabled,
|
|
1020
|
+
readOnly,
|
|
1021
|
+
required,
|
|
1022
|
+
grid,
|
|
1023
|
+
virtualized,
|
|
1024
|
+
openOnInputClick,
|
|
1025
|
+
itemToStringLabel,
|
|
1026
|
+
modal,
|
|
1027
|
+
autoHighlight: autoHighlightMode,
|
|
1028
|
+
isItemEqualToValue,
|
|
1029
|
+
submitOnItemClick,
|
|
1030
|
+
hasInputValue
|
|
1031
|
+
};
|
|
1032
|
+
useIsoLayoutEffect(() => {
|
|
1033
|
+
store.update({
|
|
1034
|
+
...syncedValues,
|
|
1035
|
+
inputOwnsFormValue: selectionMode === "none" && (inlineProp || !store.state.inputInsidePopup)
|
|
1036
|
+
});
|
|
1037
|
+
}, [store, ...Object.values(syncedValues)]);
|
|
1038
|
+
const hiddenInputRef = useMergedRefs(inputRefProp, validation.inputRef);
|
|
1039
|
+
const itemsContextValue = React$1.useMemo(() => ({
|
|
1040
|
+
query,
|
|
1041
|
+
hasItems,
|
|
1042
|
+
filteredItems,
|
|
1043
|
+
flatFilteredValues
|
|
1044
|
+
}), [
|
|
1045
|
+
query,
|
|
1046
|
+
hasItems,
|
|
1047
|
+
filteredItems,
|
|
1048
|
+
flatFilteredValues
|
|
1049
|
+
]);
|
|
1050
|
+
const serializedValue = React$1.useMemo(() => {
|
|
1051
|
+
if (Array.isArray(fieldRawValue)) return "";
|
|
1052
|
+
return stringifyAsValue(fieldRawValue, itemToStringValue);
|
|
1053
|
+
}, [fieldRawValue, itemToStringValue]);
|
|
1054
|
+
const hasMultipleSelection = multiple && Array.isArray(selectedValue) && selectedValue.length > 0;
|
|
1055
|
+
const hiddenInputName = multiple || selectionMode === "none" && inputOwnsFormValue ? void 0 : name;
|
|
1056
|
+
const hiddenInputs = React$1.useMemo(() => {
|
|
1057
|
+
if (!multiple || !Array.isArray(selectedValue) || !name) return null;
|
|
1058
|
+
return selectedValue.map((value) => {
|
|
1059
|
+
const currentSerializedValue = stringifyAsValue(value, itemToStringValue);
|
|
1060
|
+
return /*#__PURE__*/ jsx("input", {
|
|
1061
|
+
type: "hidden",
|
|
1062
|
+
form,
|
|
1063
|
+
name,
|
|
1064
|
+
value: currentSerializedValue,
|
|
1065
|
+
disabled
|
|
1066
|
+
}, currentSerializedValue);
|
|
1067
|
+
});
|
|
1068
|
+
}, [
|
|
1069
|
+
multiple,
|
|
1070
|
+
selectedValue,
|
|
1071
|
+
form,
|
|
1072
|
+
name,
|
|
1073
|
+
itemToStringValue,
|
|
1074
|
+
disabled
|
|
1075
|
+
]);
|
|
1076
|
+
const children = /*#__PURE__*/ jsxs(React$1.Fragment, { children: [
|
|
1077
|
+
props.children,
|
|
1078
|
+
/*#__PURE__*/ jsx("input", {
|
|
1079
|
+
...validation.getValidationProps(disabled, {
|
|
1080
|
+
onFocus() {
|
|
1081
|
+
if (inputInsidePopup) {
|
|
1082
|
+
triggerElement?.focus();
|
|
1083
|
+
return;
|
|
1084
|
+
}
|
|
1085
|
+
(inputRef.current || triggerElement)?.focus();
|
|
1086
|
+
},
|
|
1087
|
+
onChange(event) {
|
|
1088
|
+
if (event.nativeEvent.defaultPrevented || disabled || readOnly) return;
|
|
1089
|
+
const nextValue = event.currentTarget.value;
|
|
1090
|
+
const nextValueLower = nextValue.toLowerCase();
|
|
1091
|
+
const details = createChangeEventDetails(none, event.nativeEvent);
|
|
1092
|
+
const findSerializedMatchIndex = () => valuesRef.current.findIndex((candidate) => stringifyAsValue(candidate, itemToStringValue).toLowerCase() === nextValueLower || stringifyValueLabel(candidate).toLowerCase() === nextValueLower);
|
|
1093
|
+
function handleChange() {
|
|
1094
|
+
if (multiple) return;
|
|
1095
|
+
if (selectionMode === "none") {
|
|
1096
|
+
setInputValue(nextValue, details);
|
|
1097
|
+
return;
|
|
1098
|
+
}
|
|
1099
|
+
let matchingIndex = findSerializedMatchIndex();
|
|
1100
|
+
if (matchingIndex === -1) matchingIndex = valuesRef.current.findIndex((_, index) => {
|
|
1101
|
+
const renderedLabel = labelsRef.current[index];
|
|
1102
|
+
return renderedLabel != null && renderedLabel.toLowerCase() === nextValueLower;
|
|
1103
|
+
});
|
|
1104
|
+
const matchingValue = matchingIndex === -1 ? void 0 : valuesRef.current[matchingIndex];
|
|
1105
|
+
if (matchingValue != null) setSelectedValue?.(matchingValue, details);
|
|
1106
|
+
}
|
|
1107
|
+
if (single) {
|
|
1108
|
+
forceMount();
|
|
1109
|
+
if (items && findSerializedMatchIndex() === -1) store.set("forceMounted", true);
|
|
1110
|
+
}
|
|
1111
|
+
queueMicrotask(handleChange);
|
|
1112
|
+
}
|
|
1113
|
+
}),
|
|
1114
|
+
id: id && hiddenInputName == null ? `${id}-hidden-input` : void 0,
|
|
1115
|
+
form,
|
|
1116
|
+
name: hiddenInputName,
|
|
1117
|
+
autoComplete: formAutoComplete,
|
|
1118
|
+
disabled,
|
|
1119
|
+
required: required && !hasMultipleSelection,
|
|
1120
|
+
readOnly,
|
|
1121
|
+
value: serializedValue,
|
|
1122
|
+
ref: hiddenInputRef,
|
|
1123
|
+
style: hiddenInputName ? visuallyHiddenInput : visuallyHidden,
|
|
1124
|
+
tabIndex: -1,
|
|
1125
|
+
"aria-hidden": true,
|
|
1126
|
+
suppressHydrationWarning: true
|
|
1127
|
+
}),
|
|
1128
|
+
hiddenInputs
|
|
1129
|
+
] });
|
|
1130
|
+
return /*#__PURE__*/ jsx(ComboboxRootContext.Provider, {
|
|
1131
|
+
value: store,
|
|
1132
|
+
children: /*#__PURE__*/ jsx(ComboboxFloatingContext.Provider, {
|
|
1133
|
+
value: floatingRootContext,
|
|
1134
|
+
children: /*#__PURE__*/ jsx(ComboboxHasItemsContext.Provider, {
|
|
1135
|
+
value: hasItems,
|
|
1136
|
+
children: /*#__PURE__*/ jsx(ComboboxDerivedItemsContext.Provider, {
|
|
1137
|
+
value: itemsContextValue,
|
|
1138
|
+
children: /*#__PURE__*/ jsx(ComboboxInputValueContext.Provider, {
|
|
1139
|
+
value: inputValue,
|
|
1140
|
+
children
|
|
1141
|
+
})
|
|
1142
|
+
})
|
|
1143
|
+
})
|
|
1144
|
+
})
|
|
1145
|
+
});
|
|
1146
|
+
}
|
|
1147
|
+
//#endregion
|
|
1148
|
+
//#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/combobox/input/ComboboxInputDataAttributes.mjs
|
|
1149
|
+
var ComboboxInputDataAttributes_exports = /* @__PURE__ */ __exportAll({
|
|
1150
|
+
dirty: () => dirty,
|
|
1151
|
+
disabled: () => disabled,
|
|
1152
|
+
filled: () => filled,
|
|
1153
|
+
focused: () => focused,
|
|
1154
|
+
invalid: () => invalid,
|
|
1155
|
+
listEmpty: () => listEmpty,
|
|
1156
|
+
popupOpen: () => popupOpen,
|
|
1157
|
+
popupSide: () => popupSide,
|
|
1158
|
+
pressed: () => pressed,
|
|
1159
|
+
readonly: () => readonly,
|
|
1160
|
+
required: () => required,
|
|
1161
|
+
touched: () => touched,
|
|
1162
|
+
valid: () => valid
|
|
1163
|
+
});
|
|
1164
|
+
/**
|
|
1165
|
+
* Present when the corresponding popup is open.
|
|
1166
|
+
*/
|
|
1167
|
+
const popupOpen = popupOpen$1;
|
|
1168
|
+
/**
|
|
1169
|
+
* Present when the input is pressed.
|
|
1170
|
+
*/
|
|
1171
|
+
const pressed = pressed$1;
|
|
1172
|
+
/**
|
|
1173
|
+
* Present when the component is disabled.
|
|
1174
|
+
*/
|
|
1175
|
+
const disabled = "data-disabled";
|
|
1176
|
+
/**
|
|
1177
|
+
* Present when the component is readonly.
|
|
1178
|
+
*/
|
|
1179
|
+
const readonly = "data-readonly";
|
|
1180
|
+
/**
|
|
1181
|
+
* Indicates which side the corresponding popup is positioned relative to its anchor.
|
|
1182
|
+
* @type {'top' | 'bottom' | 'left' | 'right' | 'inline-end' | 'inline-start' | null}
|
|
1183
|
+
*/
|
|
1184
|
+
const popupSide = "data-popup-side";
|
|
1185
|
+
/**
|
|
1186
|
+
* Present when the component is required.
|
|
1187
|
+
*/
|
|
1188
|
+
const required = "data-required";
|
|
1189
|
+
/**
|
|
1190
|
+
* Present when the component is in a valid state (when wrapped in Field.Root).
|
|
1191
|
+
*/
|
|
1192
|
+
const valid = "data-valid";
|
|
1193
|
+
/**
|
|
1194
|
+
* Present when the component is in an invalid state (when wrapped in Field.Root).
|
|
1195
|
+
*/
|
|
1196
|
+
const invalid = "data-invalid";
|
|
1197
|
+
/**
|
|
1198
|
+
* Present when the component has been touched (when wrapped in Field.Root).
|
|
1199
|
+
*/
|
|
1200
|
+
const touched = "data-touched";
|
|
1201
|
+
/**
|
|
1202
|
+
* Present when the component's value has changed (when wrapped in Field.Root).
|
|
1203
|
+
*/
|
|
1204
|
+
const dirty = "data-dirty";
|
|
1205
|
+
/**
|
|
1206
|
+
* Present when the component has a value (when wrapped in Field.Root).
|
|
1207
|
+
*/
|
|
1208
|
+
const filled = "data-filled";
|
|
1209
|
+
/**
|
|
1210
|
+
* Present when the input is focused (when wrapped in Field.Root).
|
|
1211
|
+
*/
|
|
1212
|
+
const focused = "data-focused";
|
|
1213
|
+
/**
|
|
1214
|
+
* Present when the corresponding items list is empty.
|
|
1215
|
+
*/
|
|
1216
|
+
const listEmpty = "data-list-empty";
|
|
1217
|
+
//#endregion
|
|
1218
|
+
//#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/combobox/utils/stateAttributesMapping.mjs
|
|
1219
|
+
const triggerStateAttributesMapping = {
|
|
1220
|
+
...pressableTriggerOpenStateMapping,
|
|
1221
|
+
...fieldValidityMapping,
|
|
1222
|
+
popupSide: (side) => side ? { [popupSide]: side } : null,
|
|
1223
|
+
listEmpty: (empty) => empty ? { [listEmpty]: "" } : null
|
|
1224
|
+
};
|
|
1225
|
+
//#endregion
|
|
1226
|
+
//#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/combobox/chips/ComboboxChipsContext.mjs
|
|
1227
|
+
const ComboboxChipsContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
1228
|
+
ComboboxChipsContext.displayName = "ComboboxChipsContext";
|
|
1229
|
+
function useComboboxChipsContext() {
|
|
1230
|
+
return React$1.useContext(ComboboxChipsContext);
|
|
1231
|
+
}
|
|
1232
|
+
//#endregion
|
|
1233
|
+
//#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/combobox/positioner/ComboboxPositionerContext.mjs
|
|
1234
|
+
const ComboboxPositionerContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
1235
|
+
ComboboxPositionerContext.displayName = "ComboboxPositionerContext";
|
|
1236
|
+
function useComboboxPositionerContext(optional) {
|
|
1237
|
+
const context = React$1.useContext(ComboboxPositionerContext);
|
|
1238
|
+
if (context === void 0 && !optional) throw new Error("Base UI: <Combobox.Popup> and <Combobox.Arrow> must be used within the <Combobox.Positioner> component");
|
|
1239
|
+
return context;
|
|
1240
|
+
}
|
|
1241
|
+
//#endregion
|
|
1242
|
+
//#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/combobox/utils/ComboboxInternalDismissButton.mjs
|
|
1243
|
+
/**
|
|
1244
|
+
* @internal
|
|
1245
|
+
*/
|
|
1246
|
+
const ComboboxInternalDismissButton = /*#__PURE__*/ React$1.forwardRef(function ComboboxInternalDismissButton(_, forwardedRef) {
|
|
1247
|
+
const store = useComboboxRootContext();
|
|
1248
|
+
const { buttonRef, getButtonProps } = useButton({ native: false });
|
|
1249
|
+
const mergedRef = useMergedRefs(forwardedRef, buttonRef);
|
|
1250
|
+
function handleDismiss(event) {
|
|
1251
|
+
store.context.setOpen(false, createChangeEventDetails(closePress, event.nativeEvent, event.currentTarget));
|
|
1252
|
+
}
|
|
1253
|
+
const dismissProps = getButtonProps({ onClick: handleDismiss });
|
|
1254
|
+
return /*#__PURE__*/ jsx("span", {
|
|
1255
|
+
ref: mergedRef,
|
|
1256
|
+
...dismissProps,
|
|
1257
|
+
"aria-label": "Dismiss",
|
|
1258
|
+
tabIndex: void 0,
|
|
1259
|
+
style: visuallyHiddenInput
|
|
1260
|
+
});
|
|
1261
|
+
});
|
|
1262
|
+
ComboboxInternalDismissButton.displayName = "ComboboxInternalDismissButton";
|
|
1263
|
+
//#endregion
|
|
1264
|
+
//#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/combobox/utils/parts.mjs
|
|
1265
|
+
/**
|
|
1266
|
+
* The popup side is only meaningful while the positioner is mounted, as the store retains the
|
|
1267
|
+
* last resolved side after the popup unmounts.
|
|
1268
|
+
*/
|
|
1269
|
+
function usePopupSide(store) {
|
|
1270
|
+
const mounted = store.useState("mounted");
|
|
1271
|
+
const popupSide = store.useState("popupSide");
|
|
1272
|
+
const positionerElement = store.useState("positionerElement");
|
|
1273
|
+
return mounted && positionerElement ? popupSide : null;
|
|
1274
|
+
}
|
|
1275
|
+
/**
|
|
1276
|
+
* Whether the filtered list has no items to show.
|
|
1277
|
+
*/
|
|
1278
|
+
function useListEmpty() {
|
|
1279
|
+
return useComboboxDerivedItemsContext().filteredItems.length === 0;
|
|
1280
|
+
}
|
|
1281
|
+
/**
|
|
1282
|
+
* The arrow keys that move the chip highlight backwards and forwards, in that order.
|
|
1283
|
+
*/
|
|
1284
|
+
function getChipNavigationKeys(direction) {
|
|
1285
|
+
return direction === "rtl" ? ["ArrowRight", "ArrowLeft"] : ["ArrowLeft", "ArrowRight"];
|
|
1286
|
+
}
|
|
1287
|
+
/**
|
|
1288
|
+
* Where the highlight lands once the chip at `index` is removed, or `undefined` for no highlight.
|
|
1289
|
+
*/
|
|
1290
|
+
function getIndexAfterChipRemoval(index, chipCount) {
|
|
1291
|
+
const nextIndex = index >= chipCount - 1 ? chipCount - 2 : index;
|
|
1292
|
+
return nextIndex >= 0 ? nextIndex : void 0;
|
|
1293
|
+
}
|
|
1294
|
+
/**
|
|
1295
|
+
* Commits the highlighted item by clicking it, tagging the originating event so the item's
|
|
1296
|
+
* handler can attribute the selection to it.
|
|
1297
|
+
*/
|
|
1298
|
+
function clickHighlightedItem(store, activeIndex, nativeEvent) {
|
|
1299
|
+
const listItem = store.context.listRef.current[activeIndex];
|
|
1300
|
+
if (listItem) {
|
|
1301
|
+
store.context.selectionEventRef.current = nativeEvent;
|
|
1302
|
+
listItem.click();
|
|
1303
|
+
store.context.selectionEventRef.current = null;
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
//#endregion
|
|
1307
|
+
//#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/combobox/input/ComboboxInput.mjs
|
|
1308
|
+
/**
|
|
1309
|
+
* A text input to search for items in the list.
|
|
1310
|
+
* Renders an `<input>` element.
|
|
1311
|
+
*
|
|
1312
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
1313
|
+
*/
|
|
1314
|
+
const ComboboxInput = /*#__PURE__*/ React$1.forwardRef(function ComboboxInput(componentProps, forwardedRef) {
|
|
1315
|
+
const { render, className, disabled: disabledProp = false, id: idProp, style, ...elementProps } = componentProps;
|
|
1316
|
+
const { state: fieldState, disabled: fieldDisabled, setTouched, validationMode, validation } = useFieldRootContext();
|
|
1317
|
+
const { labelId: fieldLabelId } = useLabelableContext();
|
|
1318
|
+
const comboboxChipsContext = useComboboxChipsContext();
|
|
1319
|
+
const positioning = useComboboxPositionerContext(true);
|
|
1320
|
+
const hasPositionerParent = Boolean(positioning);
|
|
1321
|
+
const store = useComboboxRootContext();
|
|
1322
|
+
const inputValue = useComboboxInputValueContext();
|
|
1323
|
+
const direction = useDirection();
|
|
1324
|
+
const required = store.useState("required");
|
|
1325
|
+
const comboboxDisabled = store.useState("disabled");
|
|
1326
|
+
const readOnly = store.useState("readOnly");
|
|
1327
|
+
const name = store.useState("name");
|
|
1328
|
+
const form = store.useState("form");
|
|
1329
|
+
const selectionMode = store.useState("selectionMode");
|
|
1330
|
+
const autoHighlightMode = store.useState("autoHighlight");
|
|
1331
|
+
const inputProps = store.useState("inputProps");
|
|
1332
|
+
const triggerProps = store.useState("triggerProps");
|
|
1333
|
+
const open = store.useState("open");
|
|
1334
|
+
const mounted = store.useState("mounted");
|
|
1335
|
+
const selectedValue = store.useState("selectedValue");
|
|
1336
|
+
const rootId = store.useState("id");
|
|
1337
|
+
const inline = store.useState("inline");
|
|
1338
|
+
const modal = store.useState("modal");
|
|
1339
|
+
const autoHighlightEnabled = Boolean(autoHighlightMode);
|
|
1340
|
+
const popupSide = usePopupSide(store);
|
|
1341
|
+
const disabled = fieldDisabled || comboboxDisabled || disabledProp;
|
|
1342
|
+
const listEmpty = useListEmpty();
|
|
1343
|
+
const setFocused = useSetFieldFocused(disabled, store.context.inputRef);
|
|
1344
|
+
const isInsidePopup = hasPositionerParent || inline;
|
|
1345
|
+
const focusManagerModal = !isInsidePopup || modal;
|
|
1346
|
+
const id = useBaseUiId(idProp ?? (!isInsidePopup ? rootId : void 0));
|
|
1347
|
+
const fieldStateForInput = hasPositionerParent ? DEFAULT_FIELD_STATE_ATTRIBUTES : fieldState;
|
|
1348
|
+
const [composingValue, setComposingValue] = React$1.useState(null);
|
|
1349
|
+
const isComposingRef = React$1.useRef(false);
|
|
1350
|
+
const lastActiveIndexRef = React$1.useRef(null);
|
|
1351
|
+
useIsoLayoutEffect(() => {
|
|
1352
|
+
if (!open) lastActiveIndexRef.current = null;
|
|
1353
|
+
}, [open]);
|
|
1354
|
+
const inputOwnsFormValue = selectionMode === "none" && !hasPositionerParent;
|
|
1355
|
+
const setInputElement = useStableCallback((element) => {
|
|
1356
|
+
const nextIsInsidePopup = hasPositionerParent || store.state.inline;
|
|
1357
|
+
if (nextIsInsidePopup && !store.state.hasInputValue) store.context.setInputValue("", createChangeEventDetails(none));
|
|
1358
|
+
store.update({
|
|
1359
|
+
inputElement: element,
|
|
1360
|
+
inputInsidePopup: nextIsInsidePopup,
|
|
1361
|
+
inputOwnsFormValue
|
|
1362
|
+
});
|
|
1363
|
+
});
|
|
1364
|
+
const validationProps = hasPositionerParent ? elementProps : validation.getValidationProps(disabled, elementProps);
|
|
1365
|
+
function clearHighlight(event) {
|
|
1366
|
+
store.context.setIndices({
|
|
1367
|
+
activeIndex: null,
|
|
1368
|
+
selectedIndex: null,
|
|
1369
|
+
type: getHighlightReason(event),
|
|
1370
|
+
event
|
|
1371
|
+
});
|
|
1372
|
+
}
|
|
1373
|
+
const state = {
|
|
1374
|
+
...fieldStateForInput,
|
|
1375
|
+
open,
|
|
1376
|
+
disabled,
|
|
1377
|
+
readOnly,
|
|
1378
|
+
popupSide,
|
|
1379
|
+
listEmpty
|
|
1380
|
+
};
|
|
1381
|
+
function handleKeyDown(event) {
|
|
1382
|
+
if (!comboboxChipsContext) return;
|
|
1383
|
+
let nextIndex;
|
|
1384
|
+
const renderedChipsCount = comboboxChipsContext.chipsRef.current.length;
|
|
1385
|
+
const [previousChipKey] = getChipNavigationKeys(direction);
|
|
1386
|
+
if (event.key === previousChipKey && (event.currentTarget.selectionStart ?? 0) === 0 && selectedValue.length > 0) {
|
|
1387
|
+
event.preventDefault();
|
|
1388
|
+
nextIndex = renderedChipsCount > 0 ? renderedChipsCount - 1 : void 0;
|
|
1389
|
+
}
|
|
1390
|
+
return nextIndex;
|
|
1391
|
+
}
|
|
1392
|
+
const element = useRenderElement("input", componentProps, {
|
|
1393
|
+
state,
|
|
1394
|
+
ref: [
|
|
1395
|
+
forwardedRef,
|
|
1396
|
+
store.context.inputRef,
|
|
1397
|
+
setInputElement
|
|
1398
|
+
],
|
|
1399
|
+
props: [
|
|
1400
|
+
inputProps,
|
|
1401
|
+
triggerProps,
|
|
1402
|
+
{
|
|
1403
|
+
value: composingValue ?? inputValue,
|
|
1404
|
+
"aria-readonly": readOnly || void 0,
|
|
1405
|
+
"aria-required": required || void 0,
|
|
1406
|
+
"aria-labelledby": fieldLabelId,
|
|
1407
|
+
disabled,
|
|
1408
|
+
readOnly,
|
|
1409
|
+
required: selectionMode === "none" ? required : void 0,
|
|
1410
|
+
form,
|
|
1411
|
+
...inputOwnsFormValue && name && { name },
|
|
1412
|
+
id,
|
|
1413
|
+
onFocus() {
|
|
1414
|
+
setFocused(true);
|
|
1415
|
+
if (!inline) return;
|
|
1416
|
+
const nextActiveIndex = lastActiveIndexRef.current;
|
|
1417
|
+
lastActiveIndexRef.current = null;
|
|
1418
|
+
if (nextActiveIndex == null || !Object.hasOwn(store.context.valuesRef.current, nextActiveIndex)) return;
|
|
1419
|
+
store.context.setIndices({ activeIndex: nextActiveIndex });
|
|
1420
|
+
},
|
|
1421
|
+
onBlur() {
|
|
1422
|
+
setTouched(true);
|
|
1423
|
+
setFocused(false);
|
|
1424
|
+
const activeIndex = store.state.activeIndex;
|
|
1425
|
+
if (inline && activeIndex !== null && autoHighlightMode !== "always") {
|
|
1426
|
+
lastActiveIndexRef.current = activeIndex;
|
|
1427
|
+
store.context.setIndices({ activeIndex: null });
|
|
1428
|
+
}
|
|
1429
|
+
if (validationMode === "onBlur") {
|
|
1430
|
+
const valueToValidate = selectionMode === "none" ? inputValue : selectedValue;
|
|
1431
|
+
validation.commit(valueToValidate);
|
|
1432
|
+
}
|
|
1433
|
+
},
|
|
1434
|
+
onCompositionStart(event) {
|
|
1435
|
+
if (android) return;
|
|
1436
|
+
isComposingRef.current = true;
|
|
1437
|
+
setComposingValue(event.currentTarget.value);
|
|
1438
|
+
},
|
|
1439
|
+
onCompositionEnd(event) {
|
|
1440
|
+
isComposingRef.current = false;
|
|
1441
|
+
const next = event.currentTarget.value;
|
|
1442
|
+
setComposingValue(null);
|
|
1443
|
+
store.context.setInputValue(next, createChangeEventDetails(inputChange, event.nativeEvent));
|
|
1444
|
+
},
|
|
1445
|
+
onChange(event) {
|
|
1446
|
+
const nativeEvent = event.nativeEvent;
|
|
1447
|
+
const inputType = nativeEvent.inputType;
|
|
1448
|
+
const autofillLikeInput = !inputType || inputType === "insertReplacementText";
|
|
1449
|
+
const shouldOpenOnInput = isComposingRef.current || !autofillLikeInput;
|
|
1450
|
+
function maybeOpenOnInput(trimmed) {
|
|
1451
|
+
if (readOnly || disabled || !trimmed || !shouldOpenOnInput) return;
|
|
1452
|
+
store.context.setOpen(true, createChangeEventDetails(inputChange, nativeEvent));
|
|
1453
|
+
if (!autoHighlightEnabled) clearHighlight(nativeEvent);
|
|
1454
|
+
}
|
|
1455
|
+
if (isComposingRef.current) {
|
|
1456
|
+
const nextVal = event.currentTarget.value;
|
|
1457
|
+
setComposingValue(nextVal);
|
|
1458
|
+
if (nextVal === "" && !store.state.openOnInputClick && !store.state.inputInsidePopup) store.context.setOpen(false, createChangeEventDetails(inputClear, nativeEvent));
|
|
1459
|
+
const trimmed = nextVal.trim();
|
|
1460
|
+
const shouldMaintainHighlight = autoHighlightEnabled && trimmed !== "";
|
|
1461
|
+
maybeOpenOnInput(trimmed);
|
|
1462
|
+
if (open && store.state.activeIndex !== null && !shouldMaintainHighlight) clearHighlight(nativeEvent);
|
|
1463
|
+
return;
|
|
1464
|
+
}
|
|
1465
|
+
const inputChangeDetails = createChangeEventDetails(inputChange, nativeEvent);
|
|
1466
|
+
store.context.setInputValue(event.currentTarget.value, inputChangeDetails);
|
|
1467
|
+
if (inputChangeDetails.isCanceled) return;
|
|
1468
|
+
const empty = event.currentTarget.value === "";
|
|
1469
|
+
const clearDetails = createChangeEventDetails(inputClear, nativeEvent);
|
|
1470
|
+
if (empty && !store.state.inputInsidePopup) {
|
|
1471
|
+
if (selectionMode === "single") store.context.setSelectedValue(null, clearDetails);
|
|
1472
|
+
if (!store.state.openOnInputClick) store.context.setOpen(false, clearDetails);
|
|
1473
|
+
}
|
|
1474
|
+
maybeOpenOnInput(event.currentTarget.value.trim());
|
|
1475
|
+
if (open && store.state.activeIndex !== null && !autoHighlightEnabled) clearHighlight(nativeEvent);
|
|
1476
|
+
},
|
|
1477
|
+
onKeyDown(event) {
|
|
1478
|
+
if (event.ctrlKey || event.shiftKey || event.altKey || event.metaKey) return;
|
|
1479
|
+
if (disabled || readOnly) {
|
|
1480
|
+
if (readOnly && event.key === "Enter" && open && store.state.activeIndex !== null) stopEvent(event);
|
|
1481
|
+
return;
|
|
1482
|
+
}
|
|
1483
|
+
const input = event.currentTarget;
|
|
1484
|
+
const scrollAmount = input.scrollWidth - input.clientWidth;
|
|
1485
|
+
const isRTL = direction === "rtl";
|
|
1486
|
+
if (event.key === "Home") {
|
|
1487
|
+
stopEvent(event);
|
|
1488
|
+
const cursor = gecko && isRTL ? input.value.length : 0;
|
|
1489
|
+
input.setSelectionRange(cursor, cursor);
|
|
1490
|
+
input.scrollLeft = 0;
|
|
1491
|
+
return;
|
|
1492
|
+
}
|
|
1493
|
+
if (event.key === "End") {
|
|
1494
|
+
stopEvent(event);
|
|
1495
|
+
const cursor = gecko && isRTL ? 0 : input.value.length;
|
|
1496
|
+
input.setSelectionRange(cursor, cursor);
|
|
1497
|
+
input.scrollLeft = isRTL ? -scrollAmount : scrollAmount;
|
|
1498
|
+
return;
|
|
1499
|
+
}
|
|
1500
|
+
if (!mounted && event.key === "Escape") {
|
|
1501
|
+
const isClear = selectionMode === "multiple" && Array.isArray(selectedValue) ? selectedValue.length === 0 : selectedValue === null;
|
|
1502
|
+
const details = createChangeEventDetails(escapeKey, event.nativeEvent);
|
|
1503
|
+
const value = selectionMode === "multiple" ? [] : null;
|
|
1504
|
+
store.context.setInputValue("", details);
|
|
1505
|
+
store.context.setSelectedValue(value, details);
|
|
1506
|
+
if (!isClear && !store.state.inline && !details.isPropagationAllowed) event.stopPropagation();
|
|
1507
|
+
return;
|
|
1508
|
+
}
|
|
1509
|
+
if (comboboxChipsContext && event.key === "Backspace" && input.value === "" && Array.isArray(selectedValue) && selectedValue.length > 0) {
|
|
1510
|
+
const renderedChipsCount = comboboxChipsContext.chipsRef.current.length;
|
|
1511
|
+
const removalIndex = renderedChipsCount > 0 ? renderedChipsCount - 1 : selectedValue.length - 1;
|
|
1512
|
+
const newValue = selectedValue.filter((_, index) => index !== removalIndex);
|
|
1513
|
+
clearHighlight(event.nativeEvent);
|
|
1514
|
+
store.context.setSelectedValue(newValue, createChangeEventDetails(none, event.nativeEvent));
|
|
1515
|
+
return;
|
|
1516
|
+
}
|
|
1517
|
+
const nextIndex = handleKeyDown(event);
|
|
1518
|
+
if (nextIndex !== void 0) comboboxChipsContext?.chipsRef.current[nextIndex]?.focus();
|
|
1519
|
+
if (event.which === 229) return;
|
|
1520
|
+
if (event.key === "Enter" && open) {
|
|
1521
|
+
const activeIndex = store.state.activeIndex;
|
|
1522
|
+
const nativeEvent = event.nativeEvent;
|
|
1523
|
+
if (activeIndex === null) {
|
|
1524
|
+
if (inline) return;
|
|
1525
|
+
store.context.setOpen(false, createChangeEventDetails(none, nativeEvent));
|
|
1526
|
+
return;
|
|
1527
|
+
}
|
|
1528
|
+
stopEvent(event);
|
|
1529
|
+
clickHighlightedItem(store, activeIndex, nativeEvent);
|
|
1530
|
+
}
|
|
1531
|
+
}
|
|
1532
|
+
},
|
|
1533
|
+
validationProps
|
|
1534
|
+
],
|
|
1535
|
+
stateAttributesMapping: triggerStateAttributesMapping
|
|
1536
|
+
});
|
|
1537
|
+
const renderedInput = hasPositionerParent ? /*#__PURE__*/ jsx(FieldRootContext.Provider, {
|
|
1538
|
+
value: DEFAULT_FIELD_ROOT_CONTEXT,
|
|
1539
|
+
children: element
|
|
1540
|
+
}) : element;
|
|
1541
|
+
return /*#__PURE__*/ jsxs(React$1.Fragment, { children: [open && focusManagerModal && /*#__PURE__*/ jsx(ComboboxInternalDismissButton, { ref: store.context.startDismissRef }), renderedInput] });
|
|
1542
|
+
});
|
|
1543
|
+
ComboboxInput.displayName = "ComboboxInput";
|
|
1544
|
+
//#endregion
|
|
1545
|
+
//#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/combobox/collection/GroupCollectionContext.mjs
|
|
1546
|
+
const GroupCollectionContext = /*#__PURE__*/ React$1.createContext(null);
|
|
1547
|
+
GroupCollectionContext.displayName = "GroupCollectionContext";
|
|
1548
|
+
function useGroupCollectionContext() {
|
|
1549
|
+
return React$1.useContext(GroupCollectionContext);
|
|
1550
|
+
}
|
|
1551
|
+
function GroupCollectionProvider(props) {
|
|
1552
|
+
const { children, items } = props;
|
|
1553
|
+
const contextValue = React$1.useMemo(() => ({ items }), [items]);
|
|
1554
|
+
return /*#__PURE__*/ jsx(GroupCollectionContext.Provider, {
|
|
1555
|
+
value: contextValue,
|
|
1556
|
+
children
|
|
1557
|
+
});
|
|
1558
|
+
}
|
|
1559
|
+
//#endregion
|
|
1560
|
+
//#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/combobox/collection/ComboboxCollection.mjs
|
|
1561
|
+
/**
|
|
1562
|
+
* Renders filtered list items.
|
|
1563
|
+
* Doesn't render its own HTML element.
|
|
1564
|
+
*
|
|
1565
|
+
* If rendering a flat list, pass a function child to the `List` component instead, which implicitly wraps it.
|
|
1566
|
+
*
|
|
1567
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
1568
|
+
*/
|
|
1569
|
+
function ComboboxCollection(props) {
|
|
1570
|
+
const { children } = props;
|
|
1571
|
+
const { filteredItems } = useComboboxDerivedItemsContext();
|
|
1572
|
+
const groupContext = useGroupCollectionContext();
|
|
1573
|
+
const itemsToRender = groupContext ? groupContext.items : filteredItems;
|
|
1574
|
+
return /*#__PURE__*/ jsx(React$1.Fragment, { children: itemsToRender.map(children) });
|
|
1575
|
+
}
|
|
1576
|
+
//#endregion
|
|
1577
|
+
//#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/combobox/list/ComboboxList.mjs
|
|
1578
|
+
/**
|
|
1579
|
+
* A list container for the items.
|
|
1580
|
+
* Renders a `<div>` element.
|
|
1581
|
+
*
|
|
1582
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
1583
|
+
*/
|
|
1584
|
+
const ComboboxList = /*#__PURE__*/ React$1.forwardRef(function ComboboxList(componentProps, forwardedRef) {
|
|
1585
|
+
var _ComboboxCollection;
|
|
1586
|
+
const { render, className, style, children, ...elementProps } = componentProps;
|
|
1587
|
+
const store = useComboboxRootContext();
|
|
1588
|
+
const floatingRootContext = useComboboxFloatingContext();
|
|
1589
|
+
const hasPositionerContext = Boolean(useComboboxPositionerContext(true));
|
|
1590
|
+
const { filteredItems, hasItems } = useComboboxDerivedItemsContext();
|
|
1591
|
+
const selectionMode = store.useState("selectionMode");
|
|
1592
|
+
const grid = store.useState("grid");
|
|
1593
|
+
const readOnly = store.useState("readOnly");
|
|
1594
|
+
const listProps = store.useState("listProps");
|
|
1595
|
+
const virtualized = store.useState("virtualized");
|
|
1596
|
+
const forceMounted = store.useState("forceMounted");
|
|
1597
|
+
const multiple = selectionMode === "multiple";
|
|
1598
|
+
const empty = filteredItems.length === 0;
|
|
1599
|
+
const setPositionerElement = useStableCallback((element) => {
|
|
1600
|
+
store.set("positionerElement", element);
|
|
1601
|
+
});
|
|
1602
|
+
const setListElement = useStableCallback((element) => {
|
|
1603
|
+
store.set("listElement", element);
|
|
1604
|
+
});
|
|
1605
|
+
const resolvedChildren = React$1.useMemo(() => {
|
|
1606
|
+
if (typeof children === "function") return _ComboboxCollection || (_ComboboxCollection = /*#__PURE__*/ jsx(ComboboxCollection, { children }));
|
|
1607
|
+
return children;
|
|
1608
|
+
}, [children]);
|
|
1609
|
+
const state = { empty };
|
|
1610
|
+
const floatingId = floatingRootContext.useState("floatingId");
|
|
1611
|
+
const element = useRenderElement("div", componentProps, {
|
|
1612
|
+
state,
|
|
1613
|
+
ref: [
|
|
1614
|
+
forwardedRef,
|
|
1615
|
+
setListElement,
|
|
1616
|
+
hasPositionerContext ? null : setPositionerElement
|
|
1617
|
+
],
|
|
1618
|
+
props: [
|
|
1619
|
+
listProps,
|
|
1620
|
+
{
|
|
1621
|
+
children: resolvedChildren,
|
|
1622
|
+
tabIndex: -1,
|
|
1623
|
+
id: floatingId,
|
|
1624
|
+
role: grid ? "grid" : "listbox",
|
|
1625
|
+
"aria-multiselectable": multiple ? "true" : void 0,
|
|
1626
|
+
"aria-readonly": !grid && readOnly ? true : void 0,
|
|
1627
|
+
onKeyDown(event) {
|
|
1628
|
+
if (store.state.disabled || store.state.readOnly) return;
|
|
1629
|
+
if (event.key === "Enter") {
|
|
1630
|
+
const activeIndex = store.state.activeIndex;
|
|
1631
|
+
if (activeIndex == null) return;
|
|
1632
|
+
stopEvent(event);
|
|
1633
|
+
clickHighlightedItem(store, activeIndex, event.nativeEvent);
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
},
|
|
1637
|
+
elementProps
|
|
1638
|
+
]
|
|
1639
|
+
});
|
|
1640
|
+
if (virtualized) return element;
|
|
1641
|
+
const labelsRef = hasItems && !forceMounted ? void 0 : store.context.labelsRef;
|
|
1642
|
+
return /*#__PURE__*/ jsx(CompositeList, {
|
|
1643
|
+
elementsRef: store.context.listRef,
|
|
1644
|
+
labelsRef,
|
|
1645
|
+
children: element
|
|
1646
|
+
});
|
|
1647
|
+
});
|
|
1648
|
+
ComboboxList.displayName = "ComboboxList";
|
|
1649
|
+
//#endregion
|
|
1650
|
+
//#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/combobox/group/ComboboxGroupContext.mjs
|
|
1651
|
+
const ComboboxGroupContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
1652
|
+
ComboboxGroupContext.displayName = "ComboboxGroupContext";
|
|
1653
|
+
function useComboboxGroupContext() {
|
|
1654
|
+
const context = React$1.useContext(ComboboxGroupContext);
|
|
1655
|
+
if (context === void 0) throw new Error("Base UI: ComboboxGroupContext is missing. ComboboxGroup parts must be placed within <Combobox.Group>.");
|
|
1656
|
+
return context;
|
|
1657
|
+
}
|
|
1658
|
+
//#endregion
|
|
1659
|
+
//#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/combobox/group/ComboboxGroup.mjs
|
|
1660
|
+
/**
|
|
1661
|
+
* Groups related items with the corresponding label.
|
|
1662
|
+
* Renders a `<div>` element.
|
|
1663
|
+
*
|
|
1664
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
1665
|
+
*/
|
|
1666
|
+
const ComboboxGroup = /*#__PURE__*/ React$1.forwardRef(function ComboboxGroup(componentProps, forwardedRef) {
|
|
1667
|
+
const { render, className, style, items, ...elementProps } = componentProps;
|
|
1668
|
+
const grid = useComboboxRootContext().useState("grid");
|
|
1669
|
+
const [labelId, setLabelId] = React$1.useState();
|
|
1670
|
+
const contextValue = React$1.useMemo(() => ({
|
|
1671
|
+
labelId,
|
|
1672
|
+
setLabelId,
|
|
1673
|
+
items
|
|
1674
|
+
}), [
|
|
1675
|
+
labelId,
|
|
1676
|
+
setLabelId,
|
|
1677
|
+
items
|
|
1678
|
+
]);
|
|
1679
|
+
const element = useRenderElement("div", componentProps, {
|
|
1680
|
+
ref: forwardedRef,
|
|
1681
|
+
props: [{
|
|
1682
|
+
role: grid ? "rowgroup" : "group",
|
|
1683
|
+
"aria-labelledby": labelId
|
|
1684
|
+
}, elementProps]
|
|
1685
|
+
});
|
|
1686
|
+
const wrappedElement = /*#__PURE__*/ jsx(ComboboxGroupContext.Provider, {
|
|
1687
|
+
value: contextValue,
|
|
1688
|
+
children: element
|
|
1689
|
+
});
|
|
1690
|
+
if (items) return /*#__PURE__*/ jsx(GroupCollectionProvider, {
|
|
1691
|
+
items,
|
|
1692
|
+
children: wrappedElement
|
|
1693
|
+
});
|
|
1694
|
+
return wrappedElement;
|
|
1695
|
+
});
|
|
1696
|
+
ComboboxGroup.displayName = "ComboboxGroup";
|
|
1697
|
+
//#endregion
|
|
1698
|
+
//#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/combobox/group-label/ComboboxGroupLabel.mjs
|
|
1699
|
+
/**
|
|
1700
|
+
* An accessible label that is automatically associated with its parent group.
|
|
1701
|
+
* Renders a `<div>` element.
|
|
1702
|
+
*
|
|
1703
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
1704
|
+
*/
|
|
1705
|
+
const ComboboxGroupLabel = /*#__PURE__*/ React$1.forwardRef(function ComboboxGroupLabel(componentProps, forwardedRef) {
|
|
1706
|
+
const { render, className, style, id: idProp, ...elementProps } = componentProps;
|
|
1707
|
+
const { setLabelId } = useComboboxGroupContext();
|
|
1708
|
+
const id = useBaseUiId(idProp);
|
|
1709
|
+
useIsoLayoutEffect(() => {
|
|
1710
|
+
setLabelId(id);
|
|
1711
|
+
return () => {
|
|
1712
|
+
setLabelId((currentId) => currentId === id ? void 0 : currentId);
|
|
1713
|
+
};
|
|
1714
|
+
}, [id, setLabelId]);
|
|
1715
|
+
return useRenderElement("div", componentProps, {
|
|
1716
|
+
ref: forwardedRef,
|
|
1717
|
+
props: [{
|
|
1718
|
+
id,
|
|
1719
|
+
"aria-hidden": true
|
|
1720
|
+
}, elementProps]
|
|
1721
|
+
});
|
|
1722
|
+
});
|
|
1723
|
+
ComboboxGroupLabel.displayName = "ComboboxGroupLabel";
|
|
1724
|
+
//#endregion
|
|
1725
|
+
//#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/combobox/item/ComboboxItemContext.mjs
|
|
1726
|
+
const ComboboxItemContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
1727
|
+
ComboboxItemContext.displayName = "ComboboxItemContext";
|
|
1728
|
+
function useComboboxItemContext() {
|
|
1729
|
+
const context = React$1.useContext(ComboboxItemContext);
|
|
1730
|
+
if (!context) throw new Error("Base UI: ComboboxItemContext is missing. ComboboxItem parts must be placed within <Combobox.Item>.");
|
|
1731
|
+
return context;
|
|
1732
|
+
}
|
|
1733
|
+
//#endregion
|
|
1734
|
+
//#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/combobox/row/ComboboxRowContext.mjs
|
|
1735
|
+
const ComboboxRowContext = /*#__PURE__*/ React$1.createContext(false);
|
|
1736
|
+
ComboboxRowContext.displayName = "ComboboxRowContext";
|
|
1737
|
+
function useComboboxRowContext() {
|
|
1738
|
+
return React$1.useContext(ComboboxRowContext);
|
|
1739
|
+
}
|
|
1740
|
+
//#endregion
|
|
1741
|
+
//#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/combobox/item/ComboboxItem.mjs
|
|
1742
|
+
function ComboboxItemInner(props) {
|
|
1743
|
+
const { componentProps, forwardedRef, virtualized, indexFromFilter } = props;
|
|
1744
|
+
const { render, className, style, value: itemValue = null, index: indexProp, disabled: disabledProp = false, nativeButton = false, ...elementProps } = componentProps;
|
|
1745
|
+
const textRef = React$1.useRef(null);
|
|
1746
|
+
const listItem = useCompositeListItem({
|
|
1747
|
+
guess: true,
|
|
1748
|
+
index: indexProp,
|
|
1749
|
+
textRef
|
|
1750
|
+
});
|
|
1751
|
+
const store = useComboboxRootContext();
|
|
1752
|
+
const isRow = useComboboxRowContext();
|
|
1753
|
+
const hasItems = useComboboxHasItemsContext();
|
|
1754
|
+
const { props: itemProps, id: rootId, selectionMode, disabled: rootDisabled, readOnly, isItemEqualToValue } = store.useState("itemRoot");
|
|
1755
|
+
const disabled = rootDisabled || disabledProp;
|
|
1756
|
+
const selectable = selectionMode !== "none";
|
|
1757
|
+
const index = indexProp ?? indexFromFilter ?? listItem.index;
|
|
1758
|
+
const hasRegistered = index !== -1;
|
|
1759
|
+
const highlighted = store.useState("isActive", index);
|
|
1760
|
+
const matchesSelectedValue = store.useState("isSelected", itemValue);
|
|
1761
|
+
const itemRef = React$1.useRef(null);
|
|
1762
|
+
const id = rootId != null && hasRegistered ? `${rootId}-${index}` : void 0;
|
|
1763
|
+
const selected = matchesSelectedValue && selectable;
|
|
1764
|
+
useIsoLayoutEffect(() => {
|
|
1765
|
+
if (!(hasRegistered && (virtualized || indexProp != null))) return;
|
|
1766
|
+
const list = store.context.listRef.current;
|
|
1767
|
+
list[index] = itemRef.current;
|
|
1768
|
+
return () => {
|
|
1769
|
+
delete list[index];
|
|
1770
|
+
};
|
|
1771
|
+
}, [
|
|
1772
|
+
hasRegistered,
|
|
1773
|
+
virtualized,
|
|
1774
|
+
index,
|
|
1775
|
+
indexProp,
|
|
1776
|
+
store
|
|
1777
|
+
]);
|
|
1778
|
+
useIsoLayoutEffect(() => {
|
|
1779
|
+
if (!hasRegistered || hasItems) return;
|
|
1780
|
+
const visibleValues = store.context.valuesRef.current;
|
|
1781
|
+
visibleValues[index] = itemValue;
|
|
1782
|
+
return () => {
|
|
1783
|
+
delete visibleValues[index];
|
|
1784
|
+
};
|
|
1785
|
+
}, [
|
|
1786
|
+
hasRegistered,
|
|
1787
|
+
hasItems,
|
|
1788
|
+
index,
|
|
1789
|
+
itemValue,
|
|
1790
|
+
store
|
|
1791
|
+
]);
|
|
1792
|
+
useIsoLayoutEffect(() => {
|
|
1793
|
+
if (!hasRegistered || hasItems) return;
|
|
1794
|
+
const selectedValue = store.state.selectedValue;
|
|
1795
|
+
let nextIndex = store.state.selectedIndex;
|
|
1796
|
+
if (store.state.selectionMode === "multiple" && Array.isArray(selectedValue)) nextIndex = resolveSelectedIndex(index, itemValue, store.context.valuesRef.current, selectedValue, isItemEqualToValue, nextIndex);
|
|
1797
|
+
else if (compareItemEquality(itemValue, selectedValue, isItemEqualToValue)) nextIndex = index;
|
|
1798
|
+
store.set("selectedIndex", nextIndex);
|
|
1799
|
+
}, [
|
|
1800
|
+
hasRegistered,
|
|
1801
|
+
hasItems,
|
|
1802
|
+
store,
|
|
1803
|
+
index,
|
|
1804
|
+
itemValue,
|
|
1805
|
+
isItemEqualToValue
|
|
1806
|
+
]);
|
|
1807
|
+
const { getButtonProps, buttonRef } = useButton({
|
|
1808
|
+
disabled,
|
|
1809
|
+
focusableWhenDisabled: true,
|
|
1810
|
+
native: nativeButton,
|
|
1811
|
+
composite: true
|
|
1812
|
+
});
|
|
1813
|
+
const state = {
|
|
1814
|
+
disabled,
|
|
1815
|
+
selected,
|
|
1816
|
+
highlighted
|
|
1817
|
+
};
|
|
1818
|
+
function commitSelection(nativeEvent) {
|
|
1819
|
+
function selectItem() {
|
|
1820
|
+
store.context.handleSelection(nativeEvent, itemValue);
|
|
1821
|
+
}
|
|
1822
|
+
if (store.state.submitOnItemClick) {
|
|
1823
|
+
ReactDOM.flushSync(selectItem);
|
|
1824
|
+
store.context.requestSubmit();
|
|
1825
|
+
} else selectItem();
|
|
1826
|
+
}
|
|
1827
|
+
const defaultProps = {
|
|
1828
|
+
id,
|
|
1829
|
+
role: isRow ? "gridcell" : "option",
|
|
1830
|
+
"aria-selected": selectable ? selected : void 0,
|
|
1831
|
+
tabIndex: void 0,
|
|
1832
|
+
onPointerDownCapture(event) {
|
|
1833
|
+
if (event.isPrimary) store.context.pointerDownItemRef.current = event.currentTarget;
|
|
1834
|
+
event.preventDefault();
|
|
1835
|
+
},
|
|
1836
|
+
onMouseDown(event) {
|
|
1837
|
+
event.preventDefault();
|
|
1838
|
+
},
|
|
1839
|
+
onClick(event) {
|
|
1840
|
+
if (disabled || readOnly) return;
|
|
1841
|
+
commitSelection(event.nativeEvent);
|
|
1842
|
+
},
|
|
1843
|
+
onMouseUp(event) {
|
|
1844
|
+
const pointerStartedOnItem = store.context.pointerDownItemRef.current === event.currentTarget;
|
|
1845
|
+
store.context.pointerDownItemRef.current = null;
|
|
1846
|
+
if (disabled || readOnly || event.button !== 0 || pointerStartedOnItem || !highlighted) return;
|
|
1847
|
+
commitSelection(event.nativeEvent);
|
|
1848
|
+
}
|
|
1849
|
+
};
|
|
1850
|
+
const element = useRenderElement("div", componentProps, {
|
|
1851
|
+
ref: [
|
|
1852
|
+
buttonRef,
|
|
1853
|
+
forwardedRef,
|
|
1854
|
+
listItem.ref,
|
|
1855
|
+
itemRef
|
|
1856
|
+
],
|
|
1857
|
+
state,
|
|
1858
|
+
props: [
|
|
1859
|
+
itemProps,
|
|
1860
|
+
defaultProps,
|
|
1861
|
+
elementProps,
|
|
1862
|
+
getButtonProps
|
|
1863
|
+
]
|
|
1864
|
+
});
|
|
1865
|
+
const contextValue = React$1.useMemo(() => ({
|
|
1866
|
+
selected,
|
|
1867
|
+
textRef
|
|
1868
|
+
}), [selected, textRef]);
|
|
1869
|
+
return /*#__PURE__*/ jsx(ComboboxItemContext.Provider, {
|
|
1870
|
+
value: contextValue,
|
|
1871
|
+
children: element
|
|
1872
|
+
});
|
|
1873
|
+
}
|
|
1874
|
+
/**
|
|
1875
|
+
* Resolves the index from the filtered items for the virtualized fallback (no `index` prop).
|
|
1876
|
+
* Isolated here so that this per-keystroke subscription to the derived-items context is only
|
|
1877
|
+
* paid by virtualized items. Those re-render on every input change anyway — the parent
|
|
1878
|
+
* virtualizer re-windows the list as the filtered set changes — so the extra subscription costs
|
|
1879
|
+
* them nothing, while it keeps every non-virtualized item off that context.
|
|
1880
|
+
*/
|
|
1881
|
+
function ComboboxItemVirtualizedIndex(props) {
|
|
1882
|
+
const { componentProps, forwardedRef } = props;
|
|
1883
|
+
const isItemEqualToValue = useComboboxRootContext().useState("isItemEqualToValue");
|
|
1884
|
+
const { flatFilteredValues } = useComboboxDerivedItemsContext();
|
|
1885
|
+
const lookupValue = componentProps.value ?? null;
|
|
1886
|
+
const indexFromFilter = findItemIndex(flatFilteredValues, lookupValue, isItemEqualToValue);
|
|
1887
|
+
return /*#__PURE__*/ jsx(ComboboxItemInner, {
|
|
1888
|
+
componentProps,
|
|
1889
|
+
forwardedRef,
|
|
1890
|
+
virtualized: true,
|
|
1891
|
+
indexFromFilter
|
|
1892
|
+
});
|
|
1893
|
+
}
|
|
1894
|
+
/**
|
|
1895
|
+
* An individual item in the list.
|
|
1896
|
+
* Renders a `<div>` element.
|
|
1897
|
+
*
|
|
1898
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
1899
|
+
*/
|
|
1900
|
+
const ComboboxItem = /*#__PURE__*/ React$1.memo(/*#__PURE__*/ React$1.forwardRef(function ComboboxItem(componentProps, forwardedRef) {
|
|
1901
|
+
const virtualized = useComboboxRootContext().useState("virtualized");
|
|
1902
|
+
if (virtualized && componentProps.index == null) return /*#__PURE__*/ jsx(ComboboxItemVirtualizedIndex, {
|
|
1903
|
+
componentProps,
|
|
1904
|
+
forwardedRef
|
|
1905
|
+
});
|
|
1906
|
+
return /*#__PURE__*/ jsx(ComboboxItemInner, {
|
|
1907
|
+
componentProps,
|
|
1908
|
+
forwardedRef,
|
|
1909
|
+
virtualized,
|
|
1910
|
+
indexFromFilter: void 0
|
|
1911
|
+
});
|
|
1912
|
+
}));
|
|
1913
|
+
ComboboxItem.displayName = "ComboboxItem";
|
|
1914
|
+
//#endregion
|
|
1915
|
+
//#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/combobox/empty/ComboboxEmpty.mjs
|
|
1916
|
+
/**
|
|
1917
|
+
* Renders its children only when the list is empty.
|
|
1918
|
+
* Requires the `items` prop on the root component.
|
|
1919
|
+
* Announces changes politely to screen readers.
|
|
1920
|
+
* This component's root element must remain mounted in the DOM to announce
|
|
1921
|
+
* changes consistently across screen readers. Avoid hiding or removing the
|
|
1922
|
+
* component itself with `display: none`, `hidden`, `aria-hidden`, or conditional
|
|
1923
|
+
* rendering. Prefer updating or conditionally rendering its children instead.
|
|
1924
|
+
* Renders a `<div>` element.
|
|
1925
|
+
*
|
|
1926
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
1927
|
+
*/
|
|
1928
|
+
const ComboboxEmpty = /*#__PURE__*/ React$1.forwardRef(function ComboboxEmpty(componentProps, forwardedRef) {
|
|
1929
|
+
const { render, className, style, children: childrenProp, ...elementProps } = componentProps;
|
|
1930
|
+
const { filteredItems } = useComboboxDerivedItemsContext();
|
|
1931
|
+
const store = useComboboxRootContext();
|
|
1932
|
+
const emptyRef = useInitialLiveRegionTextMutation();
|
|
1933
|
+
const children = filteredItems.length === 0 ? childrenProp : null;
|
|
1934
|
+
return useRenderElement("div", componentProps, {
|
|
1935
|
+
ref: [
|
|
1936
|
+
forwardedRef,
|
|
1937
|
+
store.context.emptyRef,
|
|
1938
|
+
emptyRef
|
|
1939
|
+
],
|
|
1940
|
+
props: [{
|
|
1941
|
+
children,
|
|
1942
|
+
role: "status",
|
|
1943
|
+
"aria-live": "polite",
|
|
1944
|
+
"aria-atomic": true
|
|
1945
|
+
}, elementProps]
|
|
1946
|
+
});
|
|
1947
|
+
});
|
|
1948
|
+
ComboboxEmpty.displayName = "ComboboxEmpty";
|
|
1949
|
+
//#endregion
|
|
1950
|
+
export { useComboboxFilter as C, useComboboxFloatingContext as D, useComboboxDerivedItemsContext as E, useComboboxInputValueContext as O, findCollectionItem as S, getComboboxPopupId as T, ComboboxChipsContext as _, ComboboxGroupLabel as a, ComboboxInputDataAttributes_exports as b, ComboboxCollection as c, getIndexAfterChipRemoval as d, useListEmpty as f, useComboboxPositionerContext as g, ComboboxPositionerContext as h, useComboboxItemContext as i, useComboboxRootContext as k, ComboboxInput as l, ComboboxInternalDismissButton as m, ComboboxItem as n, ComboboxGroup as o, usePopupSide as p, ComboboxRowContext as r, ComboboxList as s, ComboboxEmpty as t, getChipNavigationKeys as u, useComboboxChipsContext as v, useCoreFilter as w, AriaCombobox as x, triggerStateAttributesMapping as y };
|