@cloudflare/kumo 2.7.0 → 2.9.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 +107 -0
- package/README.md +3 -39
- package/ai/USAGE.md +89 -80
- package/ai/component-registry.json +1319 -194
- package/ai/component-registry.md +1799 -198
- package/ai/schemas.ts +139 -8
- package/bin/kumo.js +1 -1
- package/dist/.build-complete +1 -1
- package/dist/ai/schemas.d.ts +2040 -1791
- package/dist/ai/schemas.js +5550 -3868
- package/dist/blocks-source/delete-resource/delete-resource.tsx +5 -5
- package/dist/blocks-source/resource-list/resource-list.test.tsx +1 -1
- package/dist/blocks-source/resource-list/resource-list.tsx +1 -4
- package/dist/button-Bbi7gFL7.d.ts +227 -0
- package/dist/catalog.d.ts +377 -0
- package/dist/catalog.js +347 -215
- package/dist/chunks/AlertDialogTrigger-fn9yjykev9h5l12q.js +24 -0
- package/dist/chunks/AutocompleteItem-clgm7u7zzgjy1hvb.js +82 -0
- package/dist/chunks/Button-oczevl8g75m85ew9.js +27 -0
- package/dist/chunks/CSPContext-guqghj8kxoukvlky.js +17 -0
- package/dist/chunks/CSPProvider-ogozggb4nr6evned.js +24 -0
- package/dist/chunks/CheckboxGroup-h9w1c6bo2nlcc4uj.js +177 -0
- package/dist/chunks/CheckboxGroupContext-f9wox07n2u5moq4h.js +12 -0
- package/dist/chunks/CheckboxIndicator-gz18hapnzraxyz9a.js +49 -0
- package/dist/chunks/CheckboxRoot-g6fb44xqgc0qxusf.js +361 -0
- package/dist/chunks/CollapsiblePanel-mnjlf99v79k3yabx.js +177 -0
- package/dist/chunks/ComboboxChipRemove-opf1zyu9yyp98dqd.js +302 -0
- package/dist/chunks/ComboboxClear-fi4op1n12c99ktca.js +302 -0
- package/dist/chunks/ComboboxEmpty-dr78bn7zilhqbkgc.js +1882 -0
- package/dist/chunks/ComboboxPopup-bugeajuqjattk1n7.js +205 -0
- package/dist/chunks/CompositeItem-l7zee38lq5m224d5.js +23 -0
- package/dist/chunks/CompositeList-bek8pmx9o8cu36ig.js +129 -0
- package/dist/chunks/CompositeListContext-oetjj2x8li8678as.js +18 -0
- package/dist/chunks/CompositeRoot-jm9n0rrea12rfny1.js +225 -0
- package/dist/chunks/CompositeRootContext-ofhzmevv7hadjhyy.js +12 -0
- package/dist/chunks/DialogHandle-o964gplvp59qqv23.js +139 -0
- package/dist/chunks/DialogPopup-cz73mkiyi9c33mhn.js +174 -0
- package/dist/chunks/DialogRoot-kfhbouiouenljp3q.js +15 -0
- package/dist/chunks/DialogTrigger-gzxvssie7e5e1iba.js +139 -0
- package/dist/chunks/DirectionContext-jc1g0w645603sd6p.js +13 -0
- package/dist/chunks/DirectionProvider-gdktkteyrlpnokak.js +21 -0
- package/dist/chunks/FieldControl-oz007qbkl6ejp7di.js +104 -0
- package/dist/chunks/FieldDescription-go88jdymmj9o0ugi.js +121 -0
- package/dist/chunks/FieldItemContext-j85dc0ihramj5ezs.js +10 -0
- package/dist/chunks/FieldLabel-junk2aczkvogpv5d.js +558 -0
- package/dist/chunks/FieldsetLegend-ch85hugankjah152.js +68 -0
- package/dist/chunks/FieldsetRootContext-b633e9uzilttuyfi.js +12 -0
- package/dist/chunks/FloatingPortalLite-ld4o97z16w23x6za.js +25 -0
- package/dist/chunks/FloatingTree-jdm71b3m43e34hk7.js +115 -0
- package/dist/chunks/Form-f1ibju5npd1qqowg.js +102 -0
- package/dist/chunks/FormContext-xz0b4h7ue30fkkn1.js +17 -0
- package/dist/chunks/Input-opaph7rt3w2vx3c0.js +20 -0
- package/dist/chunks/LabelableContext-hetas2e4y0kywfas.js +131 -0
- package/dist/chunks/MenuBackdrop-m0tfcr6sg50f9sn5.js +78 -0
- package/dist/chunks/MenuSubmenuTrigger-n281iqpstcnacsk6.js +1532 -0
- package/dist/chunks/MenuTrigger-dwh2ewyxp5j3ml02.js +266 -0
- package/dist/chunks/Menubar-m8euwx8biy1qpo44.js +117 -0
- package/dist/chunks/MenubarContext-ei2r6vu6lmsspozo.js +12 -0
- package/dist/chunks/MeterLabel-efe4koezlgg05cv8.js +151 -0
- package/dist/chunks/PopoverClose-inm8xliypc51murq.js +666 -0
- package/dist/chunks/RadioGroup-h25jrjmet0gxrvex.js +165 -0
- package/dist/chunks/RadioGroupContext-ft0nndmzqynjz8a2.js +10 -0
- package/dist/chunks/RadioIndicator-lvpixnzpkxpq7rp1.js +296 -0
- package/dist/chunks/ScrollAreaThumb-jydo7azxxwjn1cqf.js +944 -0
- package/dist/chunks/SelectGroupLabel-mug19qcz2k67qule.js +1600 -0
- package/dist/chunks/Separator-b8wf5rea6m1cei8k.js +24 -0
- package/dist/chunks/SwitchRoot-gumgk7356eqv7dve.js +237 -0
- package/dist/chunks/TabsList-obzldrvfzo50uqr4.js +617 -0
- package/dist/chunks/Toggle-hlf7recxsq6mxvax.js +89 -0
- package/dist/chunks/ToggleGroup-l8tfcwe33tlqqm8a.js +106 -0
- package/dist/chunks/ToggleGroupContext-cdk2zo6ciddpockn.js +12 -0
- package/dist/chunks/ToolbarGroupContext-nriz3632ymugfj6h.js +12 -0
- package/dist/chunks/ToolbarInput-oy7o682hhn2jdjen.js +152 -0
- package/dist/chunks/ToolbarRootContext-lvi96r1vvs93rhde.js +12 -0
- package/dist/chunks/TooltipPopup-ehusafczcky9jvae.js +868 -0
- package/dist/chunks/TooltipProvider-iq6hgymrn3b68h50.js +64 -0
- package/dist/chunks/addEventListener-lhqvk2ahlzjsanyg.js +13 -0
- package/dist/chunks/areArraysEqual-nlbeaqlzf4274zr3.js +7 -0
- package/dist/chunks/autocomplete-m8n1c775n0iilomf.js +152 -0
- package/dist/chunks/badge-e16yhhe9xibra5k7.js +148 -0
- package/dist/chunks/banner-cu2mip76zfx0gf27.js +258 -0
- package/dist/chunks/bash-jpzh6zbf5237424t.js +3 -0
- package/dist/chunks/breadcrumbs-hxibrxjtvudy0ir9.js +164 -0
- package/dist/chunks/button-eikucjpgqbsn5m5m.js +260 -0
- package/dist/chunks/chart-bxxlck50zlsbj3kl.js +3083 -0
- package/dist/chunks/checkbox-fovnhs7f1sekaxrh.js +158 -0
- package/dist/chunks/clamp-kvu4wtr1dw6b3pnd.js +7 -0
- package/dist/chunks/clipboard-text-fuyj4apm2xry4hkk.js +198 -0
- package/dist/chunks/cloudflare-logo-g0aimzpllornl0rc.js +186 -0
- package/dist/chunks/code-eu8kzwqnlhoyin24.js +96 -0
- package/dist/chunks/collapsible-lj0glxe1hezap65x.js +178 -0
- package/dist/chunks/combobox-m2nvbt0b1stb2syc.js +301 -0
- package/dist/chunks/command-palette-jjrbvylvvbj0qusg.js +507 -0
- package/dist/chunks/composite-o65hjzwwzb4kvl4w.js +102 -0
- package/dist/chunks/constants-j09lrtg73n4vlx5x.js +5 -0
- package/dist/chunks/core-kjfqbvgicl9i3abf.js +7163 -0
- package/dist/chunks/createBaseUIEventDetails-ddivuhl74gni72qn.js +86 -0
- package/dist/chunks/createToastManager-kjd838m8jog8pddj.js +1233 -0
- package/dist/chunks/css-d3t41yfupsmz7l1a.js +4 -0
- package/dist/chunks/date-picker-njfirc1m165k6yax.js +6786 -0
- package/dist/chunks/date-range-picker-g6sje1ua7n7jerkq.js +335 -0
- package/dist/chunks/dialog-b4r3dv8uvgl2pqem.js +170 -0
- package/dist/chunks/diff-g2re0kj6fh27rgg5.js +4 -0
- package/dist/chunks/dropdown-k0y5j6iuad7tvqgx.js +279 -0
- package/dist/chunks/empty-hmu7x39lnp0z2qm6.js +89 -0
- package/dist/chunks/engine-io35xsj9fgfxtihg.js +10 -0
- package/dist/chunks/engine-javascript-d795u677f1802oaf.js +3103 -0
- package/dist/chunks/engine-oniguruma-xjlw46ay321yj1av.js +388 -0
- package/dist/chunks/error-mm98alb8acdy93vq.js +15 -0
- package/dist/chunks/field-dxe9ne8fqy5whws2.js +70 -0
- package/dist/chunks/flow-fbsv3yek3w7v5a6p.js +10270 -0
- package/dist/chunks/formatNumber-hjijm58g645q6a0n.js +26 -0
- package/dist/chunks/getCssDimensions-mi941fe1jvztqm6b.js +21 -0
- package/dist/chunks/getEmptyRootContext-2utawetz04dqkzyn.js +18 -0
- package/dist/chunks/getPseudoElementBounds-jg72lmrlwgbqhmjh.js +28 -0
- package/dist/chunks/github-light-kb466scjoy42qxpu.js +5 -0
- package/dist/chunks/graphql-gtqr4wytdf0qjybo.js +16 -0
- package/dist/chunks/grid-d43q1qme6ffbbcl1.js +118 -0
- package/dist/chunks/hcl-ohpfnrffs96hzyj5.js +4 -0
- package/dist/chunks/html-ijyj3f9k0foag15c.js +12 -0
- package/dist/chunks/index.parts-9xtishx4m3j6sbg9.js +1429 -0
- package/dist/chunks/index.parts-bsarfaby0ttw67bb.js +206 -0
- package/dist/chunks/index.parts-buqjmx1pfsd225r7.js +30 -0
- package/dist/chunks/index.parts-bzlq2foymrigspiz.js +81 -0
- package/dist/chunks/index.parts-c4kz48uuogge3k9g.js +1462 -0
- package/dist/chunks/index.parts-cou5w8shwfwuk6wo.js +128 -0
- package/dist/chunks/index.parts-etb66t5m85rhhipe.js +11 -0
- package/dist/chunks/index.parts-f3xvfc67ai7txeru.js +127 -0
- package/dist/chunks/index.parts-g0wrrbkxyh0oo730.js +171 -0
- package/dist/chunks/index.parts-g27bw668q8dtcjz8.js +1229 -0
- package/dist/chunks/index.parts-gcwd6ds0od2n1i0p.js +10 -0
- package/dist/chunks/index.parts-ghwrm31fyo614381.js +23 -0
- package/dist/chunks/index.parts-giu46tgp0ypgfq6a.js +88 -0
- package/dist/chunks/index.parts-hi0bbzsnswj74v28.js +11 -0
- package/dist/chunks/index.parts-ixizrcasario34jo.js +213 -0
- package/dist/chunks/index.parts-j775zfdbhcd9ypeb.js +41 -0
- package/dist/chunks/index.parts-jmkwypigix07dit1.js +119 -0
- package/dist/chunks/index.parts-kdoulw17e9zk96yw.js +156 -0
- package/dist/chunks/index.parts-kh9waplhfwlszcyp.js +245 -0
- package/dist/chunks/index.parts-kwqb2nzc7u2zzxqs.js +2464 -0
- package/dist/chunks/index.parts-kwx43zlomuu96clc.js +46 -0
- package/dist/chunks/index.parts-lojnx790s6z0mi1f.js +388 -0
- package/dist/chunks/index.parts-n6t1aj932fytioz8.js +692 -0
- package/dist/chunks/index.parts-ngc39crwuz80oiij.js +13 -0
- package/dist/chunks/index.parts-nq06i1gji6fjnmln.js +192 -0
- package/dist/chunks/index.parts-omt7bu8mbte48ulb.js +73 -0
- package/dist/chunks/index.parts-pb65142mbin4hpc7.js +564 -0
- package/dist/chunks/index2.parts-k2au6nzued1wgy6t.js +95 -0
- package/dist/chunks/index2.parts-noiw2eweufmplfsp.js +10 -0
- package/dist/chunks/inertValue-f9pgp32jxnm88df3.js +9 -0
- package/dist/chunks/input-dwl9oy1f1ufah0bx.js +145 -0
- package/dist/chunks/input-group-otq3m9lach1jyxl0.js +452 -0
- package/dist/chunks/input-o3mtvvtqf69j5k10.js +85 -0
- package/dist/chunks/isElementDisabled-ffsy1y4adxocmexb.js +7 -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-opyibemromjwmd0s.js +72 -0
- package/dist/chunks/layer-card-nah241sxhj6i7i03.js +72 -0
- package/dist/chunks/link-1b3jda6cdzl4lkeo.js +112 -0
- package/dist/chunks/link-provider-l9ohtet4pj559eg0.js +60 -0
- package/dist/chunks/loader-j2v6fab8iucuxz1z.js +91 -0
- package/dist/chunks/markdown-eybeqjr58vfygtz1.js +4 -0
- package/dist/chunks/menubar-m0h31eymts6exeke.js +103 -0
- package/dist/chunks/mergeCleanups-pexn3wul6a4zn873.js +15 -0
- package/dist/chunks/meter-iauic8ww87xxqf74.js +35 -0
- package/dist/chunks/pagination-k0yll9ynbi8flc3b.js +290 -0
- package/dist/chunks/popover-l0xg7b854w7txyoz.js +152 -0
- package/dist/chunks/popupStateMapping-jpzw7eyzl8ghiv8s.js +868 -0
- package/dist/chunks/popupStoreUtils-fpjh6veok5pa2hd1.js +367 -0
- package/dist/chunks/portal-provider-langu3fqwfr9tlhm.js +59 -0
- package/dist/chunks/python-nrpnmxq4r6yp6fcd.js +4 -0
- package/dist/chunks/radio-igpo6t2t2tpe08d5.js +173 -0
- package/dist/chunks/resolve-variant-l6x5ksfrjtu4m66l.js +35 -0
- package/dist/chunks/resolveAriaLabelledBy-h9qwvo10ftlj6t9k.js +10 -0
- package/dist/chunks/resolveValueLabel-i36fqhi09ki67hx5.js +89 -0
- package/dist/chunks/rolldown-runtime-hi7ti5xiuxsegr96.js +18 -0
- package/dist/chunks/safePolygon-flrfpyc6fpidq4fb.js +659 -0
- package/dist/chunks/safeReact-bavzz23j5tex60z2.js +18 -0
- package/dist/chunks/select-ln6ibqbbs0n4tiig.js +262 -0
- package/dist/chunks/sensitive-input-karaei12un7z7nep.js +256 -0
- package/dist/chunks/serializeValue-ci3kihruew64i36f.js +13 -0
- package/dist/chunks/shellscript-i4m7lo8wi0f5bl8b.js +4 -0
- package/dist/chunks/sidebar-kvjzu0ya0b2z6eec.js +1297 -0
- package/dist/chunks/skeleton-line-f6sju1dxawm8h9tg.js +40 -0
- package/dist/chunks/sql-do9h6435gka97c4c.js +4 -0
- package/dist/chunks/store-i9l3lkcl6auhkpfl.js +88 -0
- package/dist/chunks/stringifyLocale-cl8et9xf6zon4qbs.js +9 -0
- package/dist/chunks/styles-dbhgpd8fm76fdfo3.js +35 -0
- package/dist/chunks/surface-jwwh5xl06kv9tp7b.js +30 -0
- package/dist/chunks/switch-cusffup6w3tan5ot.js +202 -0
- package/dist/chunks/table-ds3nzcffm3pu9o0l.js +238 -0
- package/dist/chunks/table-of-contents-l66abisn473qzd07.js +231 -0
- package/dist/chunks/tabs-dz3fsnkrznrggilz.js +255 -0
- package/dist/chunks/text-e1ko7r96hsoz2tor.js +109 -0
- package/dist/chunks/toast-itl6qo5oy1vy6d36.js +324 -0
- package/dist/chunks/toml-oyqrgosuct25x413.js +4 -0
- package/dist/chunks/toolbar-gwd1orc8yl7lzaou.js +127 -0
- package/dist/chunks/tooltip-maelyxs1y7a78vje.js +90 -0
- package/dist/chunks/tsx-pem8x69upvmibv6l.js +4 -0
- package/dist/chunks/typescript-pe5y016phdwbgws7.js +4 -0
- package/dist/chunks/useAnchoredPopupScrollLock-bx8vvwcdp25ix0kj.js +31 -0
- package/dist/chunks/useAnimationFrame-ssgc72hyq6sg3yit.js +86 -0
- package/dist/chunks/useAriaLabelledBy-bvw56m1d7czf0w3f.js +38 -0
- package/dist/chunks/useBaseUiId-gqkl5ep5pn6hd0rw.js +13 -0
- package/dist/chunks/useButton-cpo6u2idqcnou6vy.js +149 -0
- package/dist/chunks/useClick-fvwb39qgead2jyft.js +86 -0
- package/dist/chunks/useCollapsiblePanel-bw63vwvq9a3sj73q.js +379 -0
- package/dist/chunks/useCompositeItem-esr3n4pmlssiuxuy.js +31 -0
- package/dist/chunks/useCompositeListItem-0exfww37ospqz69b.js +75 -0
- package/dist/chunks/useControlled-nlx0kk1ksgk0auvi.js +52 -0
- package/dist/chunks/useDismiss-l2gbj4cain4zqtne.js +353 -0
- package/dist/chunks/useFilteredItems-ckor5h4rcmztfgt1.js +183 -0
- package/dist/chunks/useFloatingRootContext-jo582qzez5k9gbgk.js +51 -0
- package/dist/chunks/useFocus-e8drzpkl9flxq1o1.js +122 -0
- package/dist/chunks/useForcedRerendering-el1fbg3ib5yo0v7k.js +14 -0
- package/dist/chunks/useId-l9soitgw3e4jk5ie.js +32 -0
- package/dist/chunks/useIsHydrating-b6whcsimonagru6u.js +22 -0
- package/dist/chunks/useLabel-nh9hf8h7o6oquqn5.js +47 -0
- package/dist/chunks/useLabelableId-b1kwq9st3rjrtakn.js +60 -0
- package/dist/chunks/useListNavigation-iyo9r9vug2g1clmc.js +447 -0
- package/dist/chunks/useOnMount-j4wobeq47l3u9olo.js +12 -0
- package/dist/chunks/useOpenChangeComplete-dpkex2e23s1evpol.js +117 -0
- package/dist/chunks/usePopupViewport-at3zpph46apa78a3.js +343 -0
- package/dist/chunks/usePositioner-h1n5q86am1sjo5hn.js +602 -0
- package/dist/chunks/usePreviousValue-le0grv8f43vmunn1.js +21 -0
- package/dist/chunks/useRegisterFieldControl-m1rxsuvtpau2341n.js +34 -0
- package/dist/chunks/useRegisteredLabelId-dh83mybmzy75waje.js +16 -0
- package/dist/chunks/useRender-gtnbrp1ityffi4xf.js +13 -0
- package/dist/chunks/useRenderDialogRoot-ecyv072j7yj8q0w3.js +262 -0
- package/dist/chunks/useRenderElement-m8kc7jyuczp71mq8.js +433 -0
- package/dist/chunks/useScrollLock-lj0spjth12xjeap0.js +854 -0
- package/dist/chunks/useStableCallback-ninxmksdjvwl6ejj.js +38 -0
- package/dist/chunks/useSwipeDismiss-bpbyw2ihsw3fw6y9.js +818 -0
- package/dist/chunks/useTimeout-oqptmu2xmyv5ccic.js +43 -0
- package/dist/chunks/useTransitionStatus-ig4waxl2kervpyw4.js +66 -0
- package/dist/chunks/useTriggerFocusGuards-j8nano0pqu9dscrz.js +49 -0
- package/dist/chunks/useTypeahead-onenwjyhgw955ygx.js +114 -0
- package/dist/chunks/useValueAsRef-lrn42zari17368c9.js +27 -0
- package/dist/chunks/useValueChanged-kthmz4wk7ywnjwtx.js +18 -0
- package/dist/chunks/utils-0i7gujfv3f3e9dqh.js +19 -0
- package/dist/chunks/valueToPercent-henpkkj3juy3ukeu.js +7 -0
- package/dist/chunks/vendor-floating-ui-dsysdmve7iazaaes.js +1558 -0
- package/dist/chunks/vendor-styling-da1xibnxfkjmtglr.js +3631 -0
- package/dist/chunks/vendor-utils-luqsvbyuig727bnr.js +512 -0
- package/dist/chunks/vesper-ho3j3gt6ilwfuc1g.js +5 -0
- package/dist/chunks/visuallyHidden-n14xllazfozg55ox.js +24 -0
- package/dist/chunks/wasm-nfbosyhilcq70atf.js +8 -0
- package/dist/chunks/yaml-kzk5ddyekbyha04v.js +4 -0
- package/dist/cn-DCSItmT-.d.ts +5 -0
- package/dist/code/server.d.ts +97 -0
- package/dist/code/server.js +146 -84
- package/dist/code.d.ts +82 -0
- package/dist/code.js +348 -248
- package/dist/components/autocomplete.d.ts +2 -0
- package/dist/components/autocomplete.js +2 -8
- package/dist/components/badge.d.ts +2 -0
- package/dist/components/badge.js +2 -6
- package/dist/components/banner.d.ts +2 -0
- package/dist/components/banner.js +2 -6
- package/dist/components/breadcrumbs.d.ts +2 -0
- package/dist/components/breadcrumbs.js +2 -8
- package/dist/components/button.d.ts +3 -0
- package/dist/components/button.js +2 -8
- package/dist/components/chart.d.ts +2 -0
- package/dist/components/chart.js +2 -11
- package/dist/components/checkbox.d.ts +2 -0
- package/dist/components/checkbox.js +2 -7
- package/dist/components/clipboard-text.d.ts +2 -0
- package/dist/components/clipboard-text.js +2 -5
- package/dist/components/cloudflare-logo.d.ts +2 -0
- package/dist/components/cloudflare-logo.js +2 -9
- package/dist/components/code.d.ts +2 -0
- package/dist/components/code.js +2 -6
- package/dist/components/collapsible.d.ts +2 -0
- package/dist/components/collapsible.js +2 -5
- package/dist/components/combobox.d.ts +2 -0
- package/dist/components/combobox.js +2 -5
- package/dist/components/command-palette.d.ts +2 -0
- package/dist/components/command-palette.js +2 -7
- package/dist/components/date-picker.d.ts +2 -0
- package/dist/components/date-picker.js +2 -5
- package/dist/components/date-range-picker.d.ts +2 -0
- package/dist/components/date-range-picker.js +2 -5
- package/dist/components/dialog.d.ts +2 -0
- package/dist/components/dialog.js +2 -10
- package/dist/components/dropdown.d.ts +2 -0
- package/dist/components/dropdown.js +2 -5
- package/dist/components/empty.d.ts +2 -0
- package/dist/components/empty.js +2 -8
- package/dist/components/field.d.ts +2 -0
- package/dist/components/field.js +2 -9
- package/dist/components/flow.d.ts +2 -0
- package/dist/components/flow.js +2 -5839
- package/dist/components/grid.d.ts +2 -0
- package/dist/components/grid.js +2 -10
- package/dist/components/input-group.d.ts +2 -0
- package/dist/components/input-group.js +2 -7
- package/dist/components/input.d.ts +4 -0
- package/dist/components/input.js +4 -13
- package/dist/components/label.d.ts +2 -0
- package/dist/components/label.js +2 -9
- package/dist/components/layer-card.d.ts +2 -0
- package/dist/components/layer-card.js +2 -5
- package/dist/components/link.d.ts +68 -0
- package/dist/components/link.js +2 -8
- package/dist/components/loader.d.ts +2 -0
- package/dist/components/loader.js +3 -7
- package/dist/components/menubar.d.ts +2 -0
- package/dist/components/menubar.js +2 -6
- package/dist/components/meter.d.ts +2 -0
- package/dist/components/meter.js +2 -5
- package/dist/components/pagination.d.ts +2 -0
- package/dist/components/pagination.js +2 -5
- package/dist/components/popover.d.ts +2 -0
- package/dist/components/popover.js +2 -13
- package/dist/components/radio.d.ts +2 -0
- package/dist/components/radio.js +2 -9
- package/dist/components/select.d.ts +2 -0
- package/dist/components/select.js +2 -5
- package/dist/components/sensitive-input.d.ts +2 -0
- package/dist/components/sensitive-input.js +2 -7
- package/dist/components/sidebar.d.ts +2 -0
- package/dist/components/sidebar.js +2 -33
- package/dist/components/surface.d.ts +2 -0
- package/dist/components/surface.js +2 -5
- package/dist/components/switch.d.ts +2 -0
- package/dist/components/switch.js +2 -7
- package/dist/components/table-of-contents.d.ts +2 -0
- package/dist/components/table-of-contents.js +2 -7
- package/dist/components/table.d.ts +2 -0
- package/dist/components/table.js +2 -7
- package/dist/components/tabs.d.ts +2 -0
- package/dist/components/tabs.js +2 -5
- package/dist/components/text.d.ts +2 -0
- package/dist/components/text.js +2 -5
- package/dist/components/toast.d.ts +2 -0
- package/dist/components/toast.js +3 -10
- package/dist/components/toolbar.d.ts +2 -0
- package/dist/components/toolbar.js +2 -7
- package/dist/components/tooltip.d.ts +2 -0
- package/dist/components/tooltip.js +2 -6
- package/dist/field-DIjlHM8W.d.ts +91 -0
- package/dist/index-AMEc1MEg2.d.ts +180 -0
- package/dist/index-B-hCpI5K.d.ts +1 -0
- package/dist/index-B6LJIy7_2.d.ts +52 -0
- package/dist/index-B9niVl3r.d.ts +140 -0
- package/dist/index-BAQwS4mL.d.ts +70 -0
- package/dist/index-BD-gTiEv.d.ts +71 -0
- package/dist/index-BVgXnR1V.d.ts +137 -0
- package/dist/index-Bgl_czT12.d.ts +140 -0
- package/dist/index-BkyMHk632.d.ts +110 -0
- package/dist/index-BlEUcijd.d.ts +795 -0
- package/dist/index-BoPqM1Ia2.d.ts +179 -0
- package/dist/index-BzE0aNpx.d.ts +143 -0
- package/dist/index-C3iraF8M2.d.ts +100 -0
- package/dist/index-CGbkysYW2.d.ts +161 -0
- package/dist/index-CLsBWiaS.d.ts +79 -0
- package/dist/index-CSWbPhke.d.ts +126 -0
- package/dist/index-CYoiniZ4.d.ts +135 -0
- package/dist/index-CeBzVJP8.d.ts +426 -0
- package/dist/index-ClS-eFxE.d.ts +104 -0
- package/dist/index-Cp0aQngm.d.ts +182 -0
- package/dist/index-CzIWigmH.d.ts +62 -0
- package/dist/index-CzTgKPh-.d.ts +105 -0
- package/dist/index-D-y1ktn-.d.ts +68 -0
- package/dist/index-D2Gvly0i2.d.ts +96 -0
- package/dist/index-DBlw3E9m.d.ts +166 -0
- package/dist/index-DCA5tjHa.d.ts +68 -0
- package/dist/index-DIV3riUd2.d.ts +148 -0
- package/dist/index-DJIRVD5B.d.ts +85 -0
- package/dist/index-DUCaDjfd.d.ts +240 -0
- package/dist/index-Di3sC6UF.d.ts +91 -0
- package/dist/index-DnbdiagK.d.ts +171 -0
- package/dist/index-DpzpArsi2.d.ts +614 -0
- package/dist/index-Dsn2VLZv.d.ts +238 -0
- package/dist/index-FZvrMcIo2.d.ts +158 -0
- package/dist/index-J1qdw9mL.d.ts +188 -0
- package/dist/index-Vj9ZzRh0.d.ts +66 -0
- package/dist/index-bAud6rG22.d.ts +278 -0
- package/dist/index-lOWfpkxK.d.ts +118 -0
- package/dist/index-yK3Hayg_.d.ts +40 -0
- package/dist/index.d.ts +102 -0
- package/dist/index.js +195 -348
- package/dist/input-BeWEb-jD.d.ts +122 -0
- package/dist/input-group-DpGSsAZy.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/portal-provider-4AHCxYE6.d.ts +51 -0
- package/dist/primitives/accordion.d.ts +1 -0
- package/dist/primitives/accordion.js +2 -5
- package/dist/primitives/alert-dialog.d.ts +1 -0
- package/dist/primitives/alert-dialog.js +2 -5
- package/dist/primitives/autocomplete.d.ts +1 -0
- package/dist/primitives/autocomplete.js +2 -5
- package/dist/primitives/avatar.d.ts +1 -0
- package/dist/primitives/avatar.js +2 -5
- package/dist/primitives/button.d.ts +1 -0
- package/dist/primitives/button.js +2 -5
- package/dist/primitives/checkbox-group.d.ts +1 -0
- package/dist/primitives/checkbox-group.js +2 -5
- package/dist/primitives/checkbox.d.ts +1 -0
- package/dist/primitives/checkbox.js +2 -5
- package/dist/primitives/collapsible.d.ts +1 -0
- package/dist/primitives/collapsible.js +2 -5
- package/dist/primitives/combobox.d.ts +1 -0
- package/dist/primitives/combobox.js +2 -5
- package/dist/primitives/context-menu.d.ts +1 -0
- package/dist/primitives/context-menu.js +2 -5
- package/dist/primitives/csp-provider.d.ts +1 -0
- package/dist/primitives/csp-provider.js +2 -5
- package/dist/primitives/dialog.d.ts +1 -0
- package/dist/primitives/dialog.js +2 -5
- package/dist/primitives/direction-provider.d.ts +1 -0
- package/dist/primitives/direction-provider.js +3 -6
- package/dist/primitives/drawer.d.ts +1 -0
- package/dist/primitives/drawer.js +2 -5
- package/dist/primitives/field.d.ts +1 -0
- package/dist/primitives/field.js +2 -5
- package/dist/primitives/fieldset.d.ts +1 -0
- package/dist/primitives/fieldset.js +2 -5
- package/dist/primitives/form.d.ts +1 -0
- package/dist/primitives/form.js +2 -5
- package/dist/primitives/input.d.ts +1 -0
- package/dist/primitives/input.js +2 -5
- package/dist/primitives/menu.d.ts +1 -0
- package/dist/primitives/menu.js +2 -5
- package/dist/primitives/menubar.d.ts +1 -0
- package/dist/primitives/menubar.js +2 -5
- package/dist/primitives/meter.d.ts +1 -0
- package/dist/primitives/meter.js +2 -5
- package/dist/primitives/navigation-menu.d.ts +1 -0
- package/dist/primitives/navigation-menu.js +2 -5
- package/dist/primitives/number-field.d.ts +1 -0
- package/dist/primitives/number-field.js +2 -5
- package/dist/primitives/otp-field.d.ts +3 -0
- package/dist/primitives/otp-field.js +2 -6
- package/dist/primitives/popover.d.ts +1 -0
- package/dist/primitives/popover.js +2 -5
- package/dist/primitives/preview-card.d.ts +1 -0
- package/dist/primitives/preview-card.js +2 -5
- package/dist/primitives/progress.d.ts +1 -0
- package/dist/primitives/progress.js +2 -5
- package/dist/primitives/radio-group.d.ts +1 -0
- package/dist/primitives/radio-group.js +2 -5
- package/dist/primitives/radio.d.ts +1 -0
- package/dist/primitives/radio.js +2 -5
- package/dist/primitives/scroll-area.d.ts +1 -0
- package/dist/primitives/scroll-area.js +2 -5
- package/dist/primitives/select.d.ts +1 -0
- package/dist/primitives/select.js +2 -5
- package/dist/primitives/separator.d.ts +1 -0
- package/dist/primitives/separator.js +2 -5
- package/dist/primitives/slider.d.ts +1 -0
- package/dist/primitives/slider.js +2 -5
- package/dist/primitives/switch.d.ts +1 -0
- package/dist/primitives/switch.js +2 -5
- package/dist/primitives/tabs.d.ts +1 -0
- package/dist/primitives/tabs.js +2 -5
- package/dist/primitives/toast.d.ts +1 -0
- package/dist/primitives/toast.js +2 -5
- package/dist/primitives/toggle-group.d.ts +1 -0
- package/dist/primitives/toggle-group.js +2 -5
- package/dist/primitives/toggle.d.ts +1 -0
- package/dist/primitives/toggle.js +2 -5
- package/dist/primitives/toolbar.d.ts +1 -0
- package/dist/primitives/toolbar.js +2 -5
- package/dist/primitives/tooltip.d.ts +1 -0
- package/dist/primitives/tooltip.js +2 -5
- package/dist/primitives.d.ts +42 -0
- package/dist/primitives.js +42 -46
- package/dist/registry.d.ts +2 -0
- package/dist/registry.js +0 -1
- package/dist/scripts/theme-generator/config.d.ts +7 -5
- package/dist/scripts/theme-generator/config.js +475 -627
- package/dist/scripts/theme-generator/types.d.ts +51 -49
- package/dist/scripts/theme-generator/types.js +0 -1
- package/dist/styles/kumo-binding.css +35 -8
- package/dist/styles/kumo-standalone.css +1 -1
- package/dist/styles/kumo.css +3 -5
- package/dist/styles/theme-fedramp.css +7 -15
- package/dist/styles/theme-kumo.css +101 -56
- package/dist/tooltip-BuCo6Ki4.d.ts +105 -0
- package/dist/types-C402rKiz.d.ts +132 -0
- package/dist/types-CdzJnnIl.d.ts +193 -0
- package/dist/utils.d.ts +4 -0
- package/dist/utils.js +5 -12
- package/package.json +231 -232
- package/scripts/component-registry/discovery.ts +87 -0
- package/scripts/component-registry/index.test.ts +90 -2
- package/scripts/component-registry/index.ts +27 -2
- package/scripts/component-registry/metadata.ts +3 -4
- package/scripts/component-registry/props-filter.ts +3 -1
- package/scripts/component-registry/sub-components.ts +34 -21
- package/scripts/component-registry/variant-parser.ts +1 -0
- package/scripts/generate-primitives.ts +1 -1
- package/scripts/theme-generator/config.ts +21 -22
- package/scripts/theme-generator/generate-css.test.ts +1 -1
- package/dist/ai/schemas.d.ts.map +0 -1
- package/dist/ai/schemas.js.map +0 -1
- package/dist/catalog.js.map +0 -1
- package/dist/chunks/Maps-fkiyllhs5w0qzw1y.js +0 -2155
- package/dist/chunks/Maps-fkiyllhs5w0qzw1y.js.map +0 -1
- package/dist/chunks/autocomplete-a4gvspveibfuod24.js +0 -193
- package/dist/chunks/autocomplete-a4gvspveibfuod24.js.map +0 -1
- package/dist/chunks/badge-dfc1r37osagi3rs4.js +0 -163
- package/dist/chunks/badge-dfc1r37osagi3rs4.js.map +0 -1
- package/dist/chunks/banner-j52y8l13puk7dybi.js +0 -120
- package/dist/chunks/banner-j52y8l13puk7dybi.js.map +0 -1
- package/dist/chunks/bash-g5z23u7me5rx7bzt.js +0 -15
- package/dist/chunks/bash-g5z23u7me5rx7bzt.js.map +0 -1
- package/dist/chunks/breadcrumbs-js59m7m57bdsveew.js +0 -169
- package/dist/chunks/breadcrumbs-js59m7m57bdsveew.js.map +0 -1
- package/dist/chunks/button-ebfdg9mkhojue36n.js +0 -237
- package/dist/chunks/button-ebfdg9mkhojue36n.js.map +0 -1
- package/dist/chunks/checkbox-k355pnfisqt0h4eg.js +0 -216
- package/dist/chunks/checkbox-k355pnfisqt0h4eg.js.map +0 -1
- package/dist/chunks/clipboard-text-isb05zkg2aox0tp6.js +0 -191
- package/dist/chunks/clipboard-text-isb05zkg2aox0tp6.js.map +0 -1
- package/dist/chunks/cloudflare-logo-fiuocxdxqrxawjfv.js +0 -175
- package/dist/chunks/cloudflare-logo-fiuocxdxqrxawjfv.js.map +0 -1
- package/dist/chunks/cn-bo7ya7641lkickbt.js +0 -22
- package/dist/chunks/cn-bo7ya7641lkickbt.js.map +0 -1
- package/dist/chunks/code-pbkfdfat0yilg6dx.js +0 -61
- package/dist/chunks/code-pbkfdfat0yilg6dx.js.map +0 -1
- package/dist/chunks/collapsible-f9hgtc1u6xvqrgt8.js +0 -76
- package/dist/chunks/collapsible-f9hgtc1u6xvqrgt8.js.map +0 -1
- package/dist/chunks/combobox-hc9wi9nwsyyli8ur.js +0 -408
- package/dist/chunks/combobox-hc9wi9nwsyyli8ur.js.map +0 -1
- package/dist/chunks/command-palette-c03zze4ayuytwxjg.js +0 -403
- package/dist/chunks/command-palette-c03zze4ayuytwxjg.js.map +0 -1
- package/dist/chunks/core-dyku7qctyc40nnhh.js +0 -5464
- package/dist/chunks/core-dyku7qctyc40nnhh.js.map +0 -1
- package/dist/chunks/css-d1mi3wy1sl3fzekh.js +0 -8
- package/dist/chunks/css-d1mi3wy1sl3fzekh.js.map +0 -1
- package/dist/chunks/date-picker-bffp889exjixmgz3.js +0 -2921
- package/dist/chunks/date-picker-bffp889exjixmgz3.js.map +0 -1
- package/dist/chunks/date-range-picker-oks2r14lbbukd545.js +0 -408
- package/dist/chunks/date-range-picker-oks2r14lbbukd545.js.map +0 -1
- package/dist/chunks/dialog-ovhmzfuppr5xix0e.js +0 -134
- package/dist/chunks/dialog-ovhmzfuppr5xix0e.js.map +0 -1
- package/dist/chunks/diff-cpj1h9lg0bw716mj.js +0 -8
- package/dist/chunks/diff-cpj1h9lg0bw716mj.js.map +0 -1
- package/dist/chunks/dropdown-iey8f344rd5dgahz.js +0 -321
- package/dist/chunks/dropdown-iey8f344rd5dgahz.js.map +0 -1
- package/dist/chunks/empty-k83r53jh5utqvv7w.js +0 -94
- package/dist/chunks/empty-k83r53jh5utqvv7w.js.map +0 -1
- package/dist/chunks/engine-javascript-hi1kqifa6nkcridk.js +0 -2638
- package/dist/chunks/engine-javascript-hi1kqifa6nkcridk.js.map +0 -1
- package/dist/chunks/engine-oniguruma-g75h8oxao68cjmhg.js +0 -295
- package/dist/chunks/engine-oniguruma-g75h8oxao68cjmhg.js.map +0 -1
- package/dist/chunks/field-bmglk138wa8bf3ei.js +0 -77
- package/dist/chunks/field-bmglk138wa8bf3ei.js.map +0 -1
- package/dist/chunks/github-light-ulev8flhimfg79ob.js +0 -6
- package/dist/chunks/github-light-ulev8flhimfg79ob.js.map +0 -1
- package/dist/chunks/graphql-ft2h47erta7isqn4.js +0 -16
- package/dist/chunks/graphql-ft2h47erta7isqn4.js.map +0 -1
- package/dist/chunks/grid-jze04557ljywg3uc.js +0 -128
- package/dist/chunks/grid-jze04557ljywg3uc.js.map +0 -1
- package/dist/chunks/hcl-hcu7d6ja6t540ijn.js +0 -8
- package/dist/chunks/hcl-hcu7d6ja6t540ijn.js.map +0 -1
- package/dist/chunks/html-kl304jmqj4jxj777.js +0 -12
- package/dist/chunks/html-kl304jmqj4jxj777.js.map +0 -1
- package/dist/chunks/input-area-ixtj4e8eny58nbf9.js +0 -78
- package/dist/chunks/input-area-ixtj4e8eny58nbf9.js.map +0 -1
- package/dist/chunks/input-ckl5misj0jd9cu5r.js +0 -130
- package/dist/chunks/input-ckl5misj0jd9cu5r.js.map +0 -1
- package/dist/chunks/input-group-bflx1m6ki55e99vf.js +0 -505
- package/dist/chunks/input-group-bflx1m6ki55e99vf.js.map +0 -1
- package/dist/chunks/javascript-hhx3avh9uv2o27ay.js +0 -8
- package/dist/chunks/javascript-hhx3avh9uv2o27ay.js.map +0 -1
- package/dist/chunks/json-jovp9qemdkp5cziz.js +0 -8
- package/dist/chunks/json-jovp9qemdkp5cziz.js.map +0 -1
- package/dist/chunks/jsonc-jbkkgjer6ispw2u3.js +0 -8
- package/dist/chunks/jsonc-jbkkgjer6ispw2u3.js.map +0 -1
- package/dist/chunks/jsx-ij885l2li2lzfoss.js +0 -8
- package/dist/chunks/jsx-ij885l2li2lzfoss.js.map +0 -1
- package/dist/chunks/label-i1xbmg8y1n0tbtkx.js +0 -68
- package/dist/chunks/label-i1xbmg8y1n0tbtkx.js.map +0 -1
- package/dist/chunks/layer-card-m6h85dpadvee39h2.js +0 -47
- package/dist/chunks/layer-card-m6h85dpadvee39h2.js.map +0 -1
- package/dist/chunks/link-j93fl5m8zrcfivsr.js +0 -95
- package/dist/chunks/link-j93fl5m8zrcfivsr.js.map +0 -1
- package/dist/chunks/link-provider-mn2voeohon7cj9o4.js +0 -22
- package/dist/chunks/link-provider-mn2voeohon7cj9o4.js.map +0 -1
- package/dist/chunks/loader-g8a6j76ue5nq0lr8.js +0 -109
- package/dist/chunks/loader-g8a6j76ue5nq0lr8.js.map +0 -1
- package/dist/chunks/markdown-n2vyyq7l68fy32wc.js +0 -8
- package/dist/chunks/markdown-n2vyyq7l68fy32wc.js.map +0 -1
- package/dist/chunks/menubar-opzxfzylaatfz4nv.js +0 -98
- package/dist/chunks/menubar-opzxfzylaatfz4nv.js.map +0 -1
- package/dist/chunks/meter-6br6z5ekw41trxeh.js +0 -51
- package/dist/chunks/meter-6br6z5ekw41trxeh.js.map +0 -1
- package/dist/chunks/pagination-j33ntwqmm9qskfgv.js +0 -266
- package/dist/chunks/pagination-j33ntwqmm9qskfgv.js.map +0 -1
- package/dist/chunks/popover-cqdmpp8i4hg8gzzx.js +0 -181
- package/dist/chunks/popover-cqdmpp8i4hg8gzzx.js.map +0 -1
- package/dist/chunks/portal-provider-hwmkdmkpvct0cb76.js +0 -18
- package/dist/chunks/portal-provider-hwmkdmkpvct0cb76.js.map +0 -1
- package/dist/chunks/python-gg755pb8oe9ra1d1.js +0 -8
- package/dist/chunks/python-gg755pb8oe9ra1d1.js.map +0 -1
- package/dist/chunks/radio-ejey7i6r4tq314av.js +0 -226
- package/dist/chunks/radio-ejey7i6r4tq314av.js.map +0 -1
- package/dist/chunks/resolve-variant-gw6eh7fa4st8ej7m.js +0 -11
- package/dist/chunks/resolve-variant-gw6eh7fa4st8ej7m.js.map +0 -1
- package/dist/chunks/select-p8adn2tnpom25hpl.js +0 -237
- package/dist/chunks/select-p8adn2tnpom25hpl.js.map +0 -1
- package/dist/chunks/sensitive-input-it1hsswlccq3u7g6.js +0 -273
- package/dist/chunks/sensitive-input-it1hsswlccq3u7g6.js.map +0 -1
- package/dist/chunks/sidebar-ctd980heycmxsux1.js +0 -1144
- package/dist/chunks/sidebar-ctd980heycmxsux1.js.map +0 -1
- package/dist/chunks/skeleton-line-omxgxia23vpav94x.js +0 -33
- package/dist/chunks/skeleton-line-omxgxia23vpav94x.js.map +0 -1
- package/dist/chunks/sql-ovukp5mrfunfk5tv.js +0 -8
- package/dist/chunks/sql-ovukp5mrfunfk5tv.js.map +0 -1
- package/dist/chunks/surface-gc2gblserrxcb1eg.js +0 -29
- package/dist/chunks/surface-gc2gblserrxcb1eg.js.map +0 -1
- package/dist/chunks/switch-ljsq915e0l1a5mjd.js +0 -256
- package/dist/chunks/switch-ljsq915e0l1a5mjd.js.map +0 -1
- package/dist/chunks/table-of-contents-cghjqyk43nj5zmlw.js +0 -106
- package/dist/chunks/table-of-contents-cghjqyk43nj5zmlw.js.map +0 -1
- package/dist/chunks/table-ojjjeqszmt9jgnug.js +0 -208
- package/dist/chunks/table-ojjjeqszmt9jgnug.js.map +0 -1
- package/dist/chunks/tabs-kemdy19kfesj2xjr.js +0 -177
- package/dist/chunks/tabs-kemdy19kfesj2xjr.js.map +0 -1
- package/dist/chunks/text-oqp48b9m5u6t62b4.js +0 -103
- package/dist/chunks/text-oqp48b9m5u6t62b4.js.map +0 -1
- package/dist/chunks/toast-ldj9zi940w83ub90.js +0 -386
- package/dist/chunks/toast-ldj9zi940w83ub90.js.map +0 -1
- package/dist/chunks/toml-nczb2z9n0o23o3ci.js +0 -8
- package/dist/chunks/toml-nczb2z9n0o23o3ci.js.map +0 -1
- package/dist/chunks/toolbar-lmylyrod70sn0q4i.js +0 -172
- package/dist/chunks/toolbar-lmylyrod70sn0q4i.js.map +0 -1
- package/dist/chunks/tooltip-mooldq78tg77ekvv.js +0 -103
- package/dist/chunks/tooltip-mooldq78tg77ekvv.js.map +0 -1
- package/dist/chunks/tsx-ehy8lrzet6v54zur.js +0 -8
- package/dist/chunks/tsx-ehy8lrzet6v54zur.js.map +0 -1
- package/dist/chunks/typescript-k4ggjrxhrhcdni6u.js +0 -8
- package/dist/chunks/typescript-k4ggjrxhrhcdni6u.js.map +0 -1
- package/dist/chunks/vendor-base-ui-elpbzr8xeffrz4h2.js +0 -25027
- package/dist/chunks/vendor-base-ui-elpbzr8xeffrz4h2.js.map +0 -1
- package/dist/chunks/vendor-floating-ui-k1zjlb8fkwtcw4k5.js +0 -1310
- package/dist/chunks/vendor-floating-ui-k1zjlb8fkwtcw4k5.js.map +0 -1
- package/dist/chunks/vendor-styling-ofvnbcuht98q88oo.js +0 -3252
- package/dist/chunks/vendor-styling-ofvnbcuht98q88oo.js.map +0 -1
- package/dist/chunks/vendor-utils-m5h2xu7s2rs3pgk5.js +0 -217
- package/dist/chunks/vendor-utils-m5h2xu7s2rs3pgk5.js.map +0 -1
- package/dist/chunks/vesper-ebfu9ns65f2v830s.js +0 -6
- package/dist/chunks/vesper-ebfu9ns65f2v830s.js.map +0 -1
- package/dist/chunks/wasm-oj22f8usru9h7dzg.js +0 -9
- package/dist/chunks/wasm-oj22f8usru9h7dzg.js.map +0 -1
- package/dist/chunks/yaml-e2v22lr79tss2brj.js +0 -8
- package/dist/chunks/yaml-e2v22lr79tss2brj.js.map +0 -1
- package/dist/code/server.js.map +0 -1
- package/dist/code.js.map +0 -1
- package/dist/components/autocomplete.js.map +0 -1
- package/dist/components/badge.js.map +0 -1
- package/dist/components/banner.js.map +0 -1
- package/dist/components/breadcrumbs.js.map +0 -1
- package/dist/components/button.js.map +0 -1
- package/dist/components/chart.js.map +0 -1
- package/dist/components/checkbox.js.map +0 -1
- package/dist/components/clipboard-text.js.map +0 -1
- package/dist/components/cloudflare-logo.js.map +0 -1
- package/dist/components/code.js.map +0 -1
- package/dist/components/collapsible.js.map +0 -1
- package/dist/components/combobox.js.map +0 -1
- package/dist/components/command-palette.js.map +0 -1
- package/dist/components/date-picker.js.map +0 -1
- package/dist/components/date-range-picker.js.map +0 -1
- package/dist/components/dialog.js.map +0 -1
- package/dist/components/dropdown.js.map +0 -1
- package/dist/components/empty.js.map +0 -1
- package/dist/components/field.js.map +0 -1
- package/dist/components/flow.js.map +0 -1
- package/dist/components/grid.js.map +0 -1
- package/dist/components/input-group.js.map +0 -1
- package/dist/components/input.js.map +0 -1
- package/dist/components/label.js.map +0 -1
- package/dist/components/layer-card.js.map +0 -1
- package/dist/components/link.js.map +0 -1
- package/dist/components/loader.js.map +0 -1
- package/dist/components/menubar.js.map +0 -1
- package/dist/components/meter.js.map +0 -1
- package/dist/components/pagination.js.map +0 -1
- package/dist/components/popover.js.map +0 -1
- package/dist/components/radio.js.map +0 -1
- package/dist/components/select.js.map +0 -1
- package/dist/components/sensitive-input.js.map +0 -1
- package/dist/components/sidebar.js.map +0 -1
- package/dist/components/surface.js.map +0 -1
- package/dist/components/switch.js.map +0 -1
- package/dist/components/table-of-contents.js.map +0 -1
- package/dist/components/table.js.map +0 -1
- package/dist/components/tabs.js.map +0 -1
- package/dist/components/text.js.map +0 -1
- package/dist/components/toast.js.map +0 -1
- package/dist/components/toolbar.js.map +0 -1
- package/dist/components/tooltip.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/primitives/accordion.js.map +0 -1
- package/dist/primitives/alert-dialog.js.map +0 -1
- package/dist/primitives/autocomplete.js.map +0 -1
- package/dist/primitives/avatar.js.map +0 -1
- package/dist/primitives/button.js.map +0 -1
- package/dist/primitives/checkbox-group.js.map +0 -1
- package/dist/primitives/checkbox.js.map +0 -1
- package/dist/primitives/collapsible.js.map +0 -1
- package/dist/primitives/combobox.js.map +0 -1
- package/dist/primitives/context-menu.js.map +0 -1
- package/dist/primitives/csp-provider.js.map +0 -1
- package/dist/primitives/dialog.js.map +0 -1
- package/dist/primitives/direction-provider.js.map +0 -1
- package/dist/primitives/drawer.js.map +0 -1
- package/dist/primitives/field.js.map +0 -1
- package/dist/primitives/fieldset.js.map +0 -1
- package/dist/primitives/form.js.map +0 -1
- package/dist/primitives/input.js.map +0 -1
- package/dist/primitives/menu.js.map +0 -1
- package/dist/primitives/menubar.js.map +0 -1
- package/dist/primitives/meter.js.map +0 -1
- package/dist/primitives/navigation-menu.js.map +0 -1
- package/dist/primitives/number-field.js.map +0 -1
- package/dist/primitives/otp-field.js.map +0 -1
- package/dist/primitives/popover.js.map +0 -1
- package/dist/primitives/preview-card.js.map +0 -1
- package/dist/primitives/progress.js.map +0 -1
- package/dist/primitives/radio-group.js.map +0 -1
- package/dist/primitives/radio.js.map +0 -1
- package/dist/primitives/scroll-area.js.map +0 -1
- package/dist/primitives/select.js.map +0 -1
- package/dist/primitives/separator.js.map +0 -1
- package/dist/primitives/slider.js.map +0 -1
- package/dist/primitives/switch.js.map +0 -1
- package/dist/primitives/tabs.js.map +0 -1
- package/dist/primitives/toast.js.map +0 -1
- package/dist/primitives/toggle-group.js.map +0 -1
- package/dist/primitives/toggle.js.map +0 -1
- package/dist/primitives/toolbar.js.map +0 -1
- package/dist/primitives/tooltip.js.map +0 -1
- package/dist/primitives.js.map +0 -1
- package/dist/registry.js.map +0 -1
- package/dist/scripts/theme-generator/config.d.ts.map +0 -1
- package/dist/scripts/theme-generator/config.js.map +0 -1
- package/dist/scripts/theme-generator/generate-css.d.ts +0 -31
- package/dist/scripts/theme-generator/generate-css.d.ts.map +0 -1
- package/dist/scripts/theme-generator/index.d.ts +0 -13
- package/dist/scripts/theme-generator/index.d.ts.map +0 -1
- package/dist/scripts/theme-generator/migrate.d.ts +0 -56
- package/dist/scripts/theme-generator/migrate.d.ts.map +0 -1
- package/dist/scripts/theme-generator/types.d.ts.map +0 -1
- package/dist/scripts/theme-generator/types.js.map +0 -1
- package/dist/src/blocks/delete-resource/delete-resource.d.ts +0 -46
- package/dist/src/blocks/delete-resource/delete-resource.d.ts.map +0 -1
- package/dist/src/blocks/delete-resource/index.d.ts +0 -2
- package/dist/src/blocks/delete-resource/index.d.ts.map +0 -1
- package/dist/src/blocks/page-header/index.d.ts +0 -2
- package/dist/src/blocks/page-header/index.d.ts.map +0 -1
- package/dist/src/blocks/page-header/page-header.d.ts +0 -38
- package/dist/src/blocks/page-header/page-header.d.ts.map +0 -1
- package/dist/src/blocks/resource-list/index.d.ts +0 -2
- package/dist/src/blocks/resource-list/index.d.ts.map +0 -1
- package/dist/src/blocks/resource-list/resource-list.d.ts +0 -18
- package/dist/src/blocks/resource-list/resource-list.d.ts.map +0 -1
- package/dist/src/catalog/catalog.d.ts +0 -75
- package/dist/src/catalog/catalog.d.ts.map +0 -1
- package/dist/src/catalog/data.d.ts +0 -44
- package/dist/src/catalog/data.d.ts.map +0 -1
- package/dist/src/catalog/index.d.ts +0 -39
- package/dist/src/catalog/index.d.ts.map +0 -1
- package/dist/src/catalog/types.d.ts +0 -226
- package/dist/src/catalog/types.d.ts.map +0 -1
- package/dist/src/catalog/visibility.d.ts +0 -37
- package/dist/src/catalog/visibility.d.ts.map +0 -1
- package/dist/src/code/code-highlighted.d.ts +0 -32
- package/dist/src/code/code-highlighted.d.ts.map +0 -1
- package/dist/src/code/context.d.ts +0 -16
- package/dist/src/code/context.d.ts.map +0 -1
- package/dist/src/code/index.d.ts +0 -32
- package/dist/src/code/index.d.ts.map +0 -1
- package/dist/src/code/provider.d.ts +0 -13
- package/dist/src/code/provider.d.ts.map +0 -1
- package/dist/src/code/server.d.ts +0 -95
- package/dist/src/code/server.d.ts.map +0 -1
- package/dist/src/code/types.d.ts +0 -130
- package/dist/src/code/types.d.ts.map +0 -1
- package/dist/src/code/use-shiki-highlighter.d.ts +0 -36
- package/dist/src/code/use-shiki-highlighter.d.ts.map +0 -1
- package/dist/src/command-line/build-cli.d.ts +0 -7
- package/dist/src/command-line/build-cli.d.ts.map +0 -1
- package/dist/src/command-line/cli.d.ts +0 -13
- package/dist/src/command-line/cli.d.ts.map +0 -1
- package/dist/src/command-line/commands/add.d.ts +0 -10
- package/dist/src/command-line/commands/add.d.ts.map +0 -1
- package/dist/src/command-line/commands/ai.d.ts +0 -10
- package/dist/src/command-line/commands/ai.d.ts.map +0 -1
- package/dist/src/command-line/commands/blocks.d.ts +0 -10
- package/dist/src/command-line/commands/blocks.d.ts.map +0 -1
- package/dist/src/command-line/commands/doc.d.ts +0 -14
- package/dist/src/command-line/commands/doc.d.ts.map +0 -1
- package/dist/src/command-line/commands/init.d.ts +0 -18
- package/dist/src/command-line/commands/init.d.ts.map +0 -1
- package/dist/src/command-line/commands/ls.d.ts +0 -10
- package/dist/src/command-line/commands/ls.d.ts.map +0 -1
- package/dist/src/command-line/commands/migrate.d.ts +0 -10
- package/dist/src/command-line/commands/migrate.d.ts.map +0 -1
- package/dist/src/command-line/utils/config.d.ts +0 -42
- package/dist/src/command-line/utils/config.d.ts.map +0 -1
- package/dist/src/command-line/utils/transformer.d.ts +0 -21
- package/dist/src/command-line/utils/transformer.d.ts.map +0 -1
- package/dist/src/components/autocomplete/autocomplete.d.ts +0 -181
- package/dist/src/components/autocomplete/autocomplete.d.ts.map +0 -1
- package/dist/src/components/autocomplete/index.d.ts +0 -3
- package/dist/src/components/autocomplete/index.d.ts.map +0 -1
- package/dist/src/components/badge/badge.d.ts +0 -180
- package/dist/src/components/badge/badge.d.ts.map +0 -1
- package/dist/src/components/badge/index.d.ts +0 -2
- package/dist/src/components/badge/index.d.ts.map +0 -1
- package/dist/src/components/banner/banner.d.ts +0 -106
- package/dist/src/components/banner/banner.d.ts.map +0 -1
- package/dist/src/components/banner/index.d.ts +0 -2
- package/dist/src/components/banner/index.d.ts.map +0 -1
- package/dist/src/components/breadcrumbs/breadcrumbs.d.ts +0 -78
- package/dist/src/components/breadcrumbs/breadcrumbs.d.ts.map +0 -1
- package/dist/src/components/breadcrumbs/index.d.ts +0 -2
- package/dist/src/components/breadcrumbs/index.d.ts.map +0 -1
- package/dist/src/components/button/button.d.ts +0 -214
- package/dist/src/components/button/button.d.ts.map +0 -1
- package/dist/src/components/button/index.d.ts +0 -2
- package/dist/src/components/button/index.d.ts.map +0 -1
- package/dist/src/components/chart/Color.d.ts +0 -107
- package/dist/src/components/chart/Color.d.ts.map +0 -1
- package/dist/src/components/chart/EChart.d.ts +0 -166
- package/dist/src/components/chart/EChart.d.ts.map +0 -1
- package/dist/src/components/chart/Legend.d.ts +0 -51
- package/dist/src/components/chart/Legend.d.ts.map +0 -1
- package/dist/src/components/chart/Maps.d.ts +0 -211
- package/dist/src/components/chart/Maps.d.ts.map +0 -1
- package/dist/src/components/chart/SankeyChart.d.ts +0 -98
- package/dist/src/components/chart/SankeyChart.d.ts.map +0 -1
- package/dist/src/components/chart/TimeseriesChart.d.ts +0 -181
- package/dist/src/components/chart/TimeseriesChart.d.ts.map +0 -1
- package/dist/src/components/chart/index.d.ts +0 -7
- package/dist/src/components/chart/index.d.ts.map +0 -1
- package/dist/src/components/chart/tooltip-utils.d.ts +0 -4
- package/dist/src/components/chart/tooltip-utils.d.ts.map +0 -1
- package/dist/src/components/checkbox/checkbox.d.ts +0 -197
- package/dist/src/components/checkbox/checkbox.d.ts.map +0 -1
- package/dist/src/components/checkbox/index.d.ts +0 -2
- package/dist/src/components/checkbox/index.d.ts.map +0 -1
- package/dist/src/components/clipboard-text/clipboard-text.d.ts +0 -88
- package/dist/src/components/clipboard-text/clipboard-text.d.ts.map +0 -1
- package/dist/src/components/clipboard-text/index.d.ts +0 -2
- package/dist/src/components/clipboard-text/index.d.ts.map +0 -1
- package/dist/src/components/cloudflare-logo/cloudflare-logo.d.ts +0 -133
- package/dist/src/components/cloudflare-logo/cloudflare-logo.d.ts.map +0 -1
- package/dist/src/components/cloudflare-logo/index.d.ts +0 -2
- package/dist/src/components/cloudflare-logo/index.d.ts.map +0 -1
- package/dist/src/components/code/code.d.ts +0 -189
- package/dist/src/components/code/code.d.ts.map +0 -1
- package/dist/src/components/code/index.d.ts +0 -4
- package/dist/src/components/code/index.d.ts.map +0 -1
- package/dist/src/components/collapsible/collapsible.d.ts +0 -109
- package/dist/src/components/collapsible/collapsible.d.ts.map +0 -1
- package/dist/src/components/collapsible/index.d.ts +0 -2
- package/dist/src/components/collapsible/index.d.ts.map +0 -1
- package/dist/src/components/combobox/combobox.d.ts +0 -246
- package/dist/src/components/combobox/combobox.d.ts.map +0 -1
- package/dist/src/components/combobox/index.d.ts +0 -3
- package/dist/src/components/combobox/index.d.ts.map +0 -1
- package/dist/src/components/command-palette/command-palette.d.ts +0 -258
- package/dist/src/components/command-palette/command-palette.d.ts.map +0 -1
- package/dist/src/components/command-palette/index.d.ts +0 -3
- package/dist/src/components/command-palette/index.d.ts.map +0 -1
- package/dist/src/components/command-palette/types.d.ts +0 -168
- package/dist/src/components/command-palette/types.d.ts.map +0 -1
- package/dist/src/components/date-picker/date-picker.d.ts +0 -65
- package/dist/src/components/date-picker/date-picker.d.ts.map +0 -1
- package/dist/src/components/date-picker/index.d.ts +0 -4
- package/dist/src/components/date-picker/index.d.ts.map +0 -1
- package/dist/src/components/date-range-picker/date-range-picker.d.ts +0 -125
- package/dist/src/components/date-range-picker/date-range-picker.d.ts.map +0 -1
- package/dist/src/components/date-range-picker/index.d.ts +0 -5
- package/dist/src/components/date-range-picker/index.d.ts.map +0 -1
- package/dist/src/components/dialog/dialog.d.ts +0 -242
- package/dist/src/components/dialog/dialog.d.ts.map +0 -1
- package/dist/src/components/dialog/index.d.ts +0 -2
- package/dist/src/components/dialog/index.d.ts.map +0 -1
- package/dist/src/components/dropdown/dropdown.d.ts +0 -116
- package/dist/src/components/dropdown/dropdown.d.ts.map +0 -1
- package/dist/src/components/dropdown/index.d.ts +0 -2
- package/dist/src/components/dropdown/index.d.ts.map +0 -1
- package/dist/src/components/empty/empty.d.ts +0 -69
- package/dist/src/components/empty/empty.d.ts.map +0 -1
- package/dist/src/components/empty/index.d.ts +0 -2
- package/dist/src/components/empty/index.d.ts.map +0 -1
- package/dist/src/components/field/field.d.ts +0 -89
- package/dist/src/components/field/field.d.ts.map +0 -1
- package/dist/src/components/field/index.d.ts +0 -2
- package/dist/src/components/field/index.d.ts.map +0 -1
- package/dist/src/components/flow/connectors.d.ts +0 -41
- package/dist/src/components/flow/connectors.d.ts.map +0 -1
- package/dist/src/components/flow/diagram.d.ts +0 -98
- package/dist/src/components/flow/diagram.d.ts.map +0 -1
- package/dist/src/components/flow/index.d.ts +0 -26
- package/dist/src/components/flow/index.d.ts.map +0 -1
- package/dist/src/components/flow/node.d.ts +0 -61
- package/dist/src/components/flow/node.d.ts.map +0 -1
- package/dist/src/components/flow/parallel.d.ts +0 -13
- package/dist/src/components/flow/parallel.d.ts.map +0 -1
- package/dist/src/components/flow/use-children.d.ts +0 -87
- package/dist/src/components/flow/use-children.d.ts.map +0 -1
- package/dist/src/components/grid/grid.d.ts +0 -135
- package/dist/src/components/grid/grid.d.ts.map +0 -1
- package/dist/src/components/grid/index.d.ts +0 -2
- package/dist/src/components/grid/index.d.ts.map +0 -1
- package/dist/src/components/input/index.d.ts +0 -19
- package/dist/src/components/input/index.d.ts.map +0 -1
- package/dist/src/components/input/input-area.d.ts +0 -65
- package/dist/src/components/input/input-area.d.ts.map +0 -1
- package/dist/src/components/input/input.d.ts +0 -175
- package/dist/src/components/input/input.d.ts.map +0 -1
- package/dist/src/components/input-group/context.d.ts +0 -96
- package/dist/src/components/input-group/context.d.ts.map +0 -1
- package/dist/src/components/input-group/index.d.ts +0 -2
- package/dist/src/components/input-group/index.d.ts.map +0 -1
- package/dist/src/components/input-group/input-group-addon.d.ts +0 -15
- package/dist/src/components/input-group/input-group-addon.d.ts.map +0 -1
- package/dist/src/components/input-group/input-group-button.d.ts +0 -36
- package/dist/src/components/input-group/input-group-button.d.ts.map +0 -1
- package/dist/src/components/input-group/input-group-input.d.ts +0 -9
- package/dist/src/components/input-group/input-group-input.d.ts.map +0 -1
- package/dist/src/components/input-group/input-group-suffix.d.ts +0 -13
- package/dist/src/components/input-group/input-group-suffix.d.ts.map +0 -1
- package/dist/src/components/input-group/input-group.d.ts +0 -43
- package/dist/src/components/input-group/input-group.d.ts.map +0 -1
- package/dist/src/components/label/index.d.ts +0 -2
- package/dist/src/components/label/index.d.ts.map +0 -1
- package/dist/src/components/label/label.d.ts +0 -67
- package/dist/src/components/label/label.d.ts.map +0 -1
- package/dist/src/components/layer-card/index.d.ts +0 -2
- package/dist/src/components/layer-card/index.d.ts.map +0 -1
- package/dist/src/components/layer-card/layer-card.d.ts +0 -60
- package/dist/src/components/layer-card/layer-card.d.ts.map +0 -1
- package/dist/src/components/link/index.d.ts +0 -2
- package/dist/src/components/link/index.d.ts.map +0 -1
- package/dist/src/components/link/link.d.ts +0 -66
- package/dist/src/components/link/link.d.ts.map +0 -1
- package/dist/src/components/loader/index.d.ts +0 -3
- package/dist/src/components/loader/index.d.ts.map +0 -1
- package/dist/src/components/loader/loader.d.ts +0 -70
- package/dist/src/components/loader/loader.d.ts.map +0 -1
- package/dist/src/components/loader/skeleton-line.d.ts +0 -11
- package/dist/src/components/loader/skeleton-line.d.ts.map +0 -1
- package/dist/src/components/menubar/index.d.ts +0 -3
- package/dist/src/components/menubar/index.d.ts.map +0 -1
- package/dist/src/components/menubar/menubar.d.ts +0 -66
- package/dist/src/components/menubar/menubar.d.ts.map +0 -1
- package/dist/src/components/menubar/use-menu-navigation.d.ts +0 -8
- package/dist/src/components/menubar/use-menu-navigation.d.ts.map +0 -1
- package/dist/src/components/meter/index.d.ts +0 -2
- package/dist/src/components/meter/index.d.ts.map +0 -1
- package/dist/src/components/meter/meter.d.ts +0 -44
- package/dist/src/components/meter/meter.d.ts.map +0 -1
- package/dist/src/components/pagination/index.d.ts +0 -2
- package/dist/src/components/pagination/index.d.ts.map +0 -1
- package/dist/src/components/pagination/pagination.d.ts +0 -241
- package/dist/src/components/pagination/pagination.d.ts.map +0 -1
- package/dist/src/components/popover/index.d.ts +0 -3
- package/dist/src/components/popover/index.d.ts.map +0 -1
- package/dist/src/components/popover/popover.d.ts +0 -178
- package/dist/src/components/popover/popover.d.ts.map +0 -1
- package/dist/src/components/radio/index.d.ts +0 -2
- package/dist/src/components/radio/index.d.ts.map +0 -1
- package/dist/src/components/radio/radio.d.ts +0 -277
- package/dist/src/components/radio/radio.d.ts.map +0 -1
- package/dist/src/components/radio/radio.type-spec.d.ts +0 -12
- package/dist/src/components/radio/radio.type-spec.d.ts.map +0 -1
- package/dist/src/components/select/index.d.ts +0 -2
- package/dist/src/components/select/index.d.ts.map +0 -1
- package/dist/src/components/select/select.d.ts +0 -288
- package/dist/src/components/select/select.d.ts.map +0 -1
- package/dist/src/components/sensitive-input/index.d.ts +0 -2
- package/dist/src/components/sensitive-input/index.d.ts.map +0 -1
- package/dist/src/components/sensitive-input/sensitive-input.d.ts +0 -94
- package/dist/src/components/sensitive-input/sensitive-input.d.ts.map +0 -1
- package/dist/src/components/sidebar/index.d.ts +0 -2
- package/dist/src/components/sidebar/index.d.ts.map +0 -1
- package/dist/src/components/sidebar/sidebar.d.ts +0 -581
- package/dist/src/components/sidebar/sidebar.d.ts.map +0 -1
- package/dist/src/components/surface/index.d.ts +0 -5
- package/dist/src/components/surface/index.d.ts.map +0 -1
- package/dist/src/components/surface/surface.d.ts +0 -64
- package/dist/src/components/surface/surface.d.ts.map +0 -1
- package/dist/src/components/switch/index.d.ts +0 -2
- package/dist/src/components/switch/index.d.ts.map +0 -1
- package/dist/src/components/switch/switch.d.ts +0 -197
- package/dist/src/components/switch/switch.d.ts.map +0 -1
- package/dist/src/components/table/index.d.ts +0 -2
- package/dist/src/components/table/index.d.ts.map +0 -1
- package/dist/src/components/table/table.d.ts +0 -138
- package/dist/src/components/table/table.d.ts.map +0 -1
- package/dist/src/components/table-of-contents/index.d.ts +0 -2
- package/dist/src/components/table-of-contents/index.d.ts.map +0 -1
- package/dist/src/components/table-of-contents/table-of-contents.d.ts +0 -72
- package/dist/src/components/table-of-contents/table-of-contents.d.ts.map +0 -1
- package/dist/src/components/tabs/index.d.ts +0 -3
- package/dist/src/components/tabs/index.d.ts.map +0 -1
- package/dist/src/components/tabs/tabs.d.ts +0 -116
- package/dist/src/components/tabs/tabs.d.ts.map +0 -1
- package/dist/src/components/text/index.d.ts +0 -2
- package/dist/src/components/text/index.d.ts.map +0 -1
- package/dist/src/components/text/text.d.ts +0 -214
- package/dist/src/components/text/text.d.ts.map +0 -1
- package/dist/src/components/text/text.type-spec.d.ts +0 -44
- package/dist/src/components/text/text.type-spec.d.ts.map +0 -1
- package/dist/src/components/toast/index.d.ts +0 -5
- package/dist/src/components/toast/index.d.ts.map +0 -1
- package/dist/src/components/toast/toast.d.ts +0 -197
- package/dist/src/components/toast/toast.d.ts.map +0 -1
- package/dist/src/components/toolbar/index.d.ts +0 -2
- package/dist/src/components/toolbar/index.d.ts.map +0 -1
- package/dist/src/components/toolbar/toolbar.d.ts +0 -50
- package/dist/src/components/toolbar/toolbar.d.ts.map +0 -1
- package/dist/src/components/tooltip/index.d.ts +0 -2
- package/dist/src/components/tooltip/index.d.ts.map +0 -1
- package/dist/src/components/tooltip/tooltip.d.ts +0 -108
- package/dist/src/components/tooltip/tooltip.d.ts.map +0 -1
- package/dist/src/index.d.ts +0 -85
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/primitives/accordion.d.ts +0 -13
- package/dist/src/primitives/accordion.d.ts.map +0 -1
- package/dist/src/primitives/alert-dialog.d.ts +0 -13
- package/dist/src/primitives/alert-dialog.d.ts.map +0 -1
- package/dist/src/primitives/autocomplete.d.ts +0 -13
- package/dist/src/primitives/autocomplete.d.ts.map +0 -1
- package/dist/src/primitives/avatar.d.ts +0 -13
- package/dist/src/primitives/avatar.d.ts.map +0 -1
- package/dist/src/primitives/button.d.ts +0 -13
- package/dist/src/primitives/button.d.ts.map +0 -1
- package/dist/src/primitives/checkbox-group.d.ts +0 -13
- package/dist/src/primitives/checkbox-group.d.ts.map +0 -1
- package/dist/src/primitives/checkbox.d.ts +0 -13
- package/dist/src/primitives/checkbox.d.ts.map +0 -1
- package/dist/src/primitives/collapsible.d.ts +0 -13
- package/dist/src/primitives/collapsible.d.ts.map +0 -1
- package/dist/src/primitives/combobox.d.ts +0 -13
- package/dist/src/primitives/combobox.d.ts.map +0 -1
- package/dist/src/primitives/context-menu.d.ts +0 -13
- package/dist/src/primitives/context-menu.d.ts.map +0 -1
- package/dist/src/primitives/csp-provider.d.ts +0 -13
- package/dist/src/primitives/csp-provider.d.ts.map +0 -1
- package/dist/src/primitives/dialog.d.ts +0 -13
- package/dist/src/primitives/dialog.d.ts.map +0 -1
- package/dist/src/primitives/direction-provider.d.ts +0 -13
- package/dist/src/primitives/direction-provider.d.ts.map +0 -1
- package/dist/src/primitives/drawer.d.ts +0 -13
- package/dist/src/primitives/drawer.d.ts.map +0 -1
- package/dist/src/primitives/field.d.ts +0 -13
- package/dist/src/primitives/field.d.ts.map +0 -1
- package/dist/src/primitives/fieldset.d.ts +0 -13
- package/dist/src/primitives/fieldset.d.ts.map +0 -1
- package/dist/src/primitives/form.d.ts +0 -13
- package/dist/src/primitives/form.d.ts.map +0 -1
- package/dist/src/primitives/index.d.ts +0 -56
- package/dist/src/primitives/index.d.ts.map +0 -1
- package/dist/src/primitives/input.d.ts +0 -13
- package/dist/src/primitives/input.d.ts.map +0 -1
- package/dist/src/primitives/menu.d.ts +0 -13
- package/dist/src/primitives/menu.d.ts.map +0 -1
- package/dist/src/primitives/menubar.d.ts +0 -13
- package/dist/src/primitives/menubar.d.ts.map +0 -1
- package/dist/src/primitives/meter.d.ts +0 -13
- package/dist/src/primitives/meter.d.ts.map +0 -1
- package/dist/src/primitives/navigation-menu.d.ts +0 -13
- package/dist/src/primitives/navigation-menu.d.ts.map +0 -1
- package/dist/src/primitives/number-field.d.ts +0 -13
- package/dist/src/primitives/number-field.d.ts.map +0 -1
- package/dist/src/primitives/otp-field.d.ts +0 -14
- package/dist/src/primitives/otp-field.d.ts.map +0 -1
- package/dist/src/primitives/popover.d.ts +0 -13
- package/dist/src/primitives/popover.d.ts.map +0 -1
- package/dist/src/primitives/preview-card.d.ts +0 -13
- package/dist/src/primitives/preview-card.d.ts.map +0 -1
- package/dist/src/primitives/progress.d.ts +0 -13
- package/dist/src/primitives/progress.d.ts.map +0 -1
- package/dist/src/primitives/radio-group.d.ts +0 -13
- package/dist/src/primitives/radio-group.d.ts.map +0 -1
- package/dist/src/primitives/radio.d.ts +0 -13
- package/dist/src/primitives/radio.d.ts.map +0 -1
- package/dist/src/primitives/scroll-area.d.ts +0 -13
- package/dist/src/primitives/scroll-area.d.ts.map +0 -1
- package/dist/src/primitives/select.d.ts +0 -13
- package/dist/src/primitives/select.d.ts.map +0 -1
- package/dist/src/primitives/separator.d.ts +0 -13
- package/dist/src/primitives/separator.d.ts.map +0 -1
- package/dist/src/primitives/slider.d.ts +0 -13
- package/dist/src/primitives/slider.d.ts.map +0 -1
- package/dist/src/primitives/switch.d.ts +0 -13
- package/dist/src/primitives/switch.d.ts.map +0 -1
- package/dist/src/primitives/tabs.d.ts +0 -13
- package/dist/src/primitives/tabs.d.ts.map +0 -1
- package/dist/src/primitives/toast.d.ts +0 -13
- package/dist/src/primitives/toast.d.ts.map +0 -1
- package/dist/src/primitives/toggle-group.d.ts +0 -13
- package/dist/src/primitives/toggle-group.d.ts.map +0 -1
- package/dist/src/primitives/toggle.d.ts +0 -13
- package/dist/src/primitives/toggle.d.ts.map +0 -1
- package/dist/src/primitives/toolbar.d.ts +0 -13
- package/dist/src/primitives/toolbar.d.ts.map +0 -1
- package/dist/src/primitives/tooltip.d.ts +0 -13
- package/dist/src/primitives/tooltip.d.ts.map +0 -1
- package/dist/src/registry/index.d.ts +0 -8
- package/dist/src/registry/index.d.ts.map +0 -1
- package/dist/src/registry/types.d.ts +0 -191
- package/dist/src/registry/types.d.ts.map +0 -1
- package/dist/src/utils/cn.d.ts +0 -3
- package/dist/src/utils/cn.d.ts.map +0 -1
- package/dist/src/utils/index.d.ts +0 -4
- package/dist/src/utils/index.d.ts.map +0 -1
- package/dist/src/utils/link-provider.d.ts +0 -66
- package/dist/src/utils/link-provider.d.ts.map +0 -1
- package/dist/src/utils/portal-provider.d.ts +0 -56
- package/dist/src/utils/portal-provider.d.ts.map +0 -1
- package/dist/src/utils/prop-examples.d.ts +0 -36
- package/dist/src/utils/prop-examples.d.ts.map +0 -1
- package/dist/src/utils/resolve-variant.d.ts +0 -27
- package/dist/src/utils/resolve-variant.d.ts.map +0 -1
- package/dist/utils.js.map +0 -1
|
@@ -0,0 +1,1882 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { a as EMPTY_ARRAY, d as useRefWithInit, o as EMPTY_OBJECT, r as mergeProps, s as NOOP, t as useRenderElement, u as useMergedRefs } from "./useRenderElement-m8kc7jyuczp71mq8.js";
|
|
3
|
+
import { d as createSelector, i as pressableTriggerOpenStateMapping, l as Store, u as useStore } from "./popupStateMapping-jpzw7eyzl8ghiv8s.js";
|
|
4
|
+
import { n as useIsoLayoutEffect } from "./safeReact-bavzz23j5tex60z2.js";
|
|
5
|
+
import { n as useTimeout } from "./useTimeout-oqptmu2xmyv5ccic.js";
|
|
6
|
+
import { B as stopEvent, H as android, O as contains, W as ios, f as getGridNavigatedIndex, g as isIndexOutOfListBounds, k as getTarget } from "./vendor-utils-luqsvbyuig727bnr.js";
|
|
7
|
+
import { t as gecko } from "./engine-io35xsj9fgfxtihg.js";
|
|
8
|
+
import { E as none, _ as inputChange, b as inputPress, d as escapeKey, n as createGenericEventDetails, o as closePress, t as createChangeEventDetails, v as inputClear, x as itemPress } from "./createBaseUIEventDetails-ddivuhl74gni72qn.js";
|
|
9
|
+
import { t as useValueAsRef } from "./useValueAsRef-lrn42zari17368c9.js";
|
|
10
|
+
import { t as useStableCallback } from "./useStableCallback-ninxmksdjvwl6ejj.js";
|
|
11
|
+
import { n as visuallyHiddenInput, t as visuallyHidden } from "./visuallyHidden-n14xllazfozg55ox.js";
|
|
12
|
+
import { t as useDismiss } from "./useDismiss-l2gbj4cain4zqtne.js";
|
|
13
|
+
import { r as useOpenInteractionType } from "./useScrollLock-lj0spjth12xjeap0.js";
|
|
14
|
+
import { t as useOpenChangeComplete } from "./useOpenChangeComplete-dpkex2e23s1evpol.js";
|
|
15
|
+
import { t as useClick } from "./useClick-fvwb39qgead2jyft.js";
|
|
16
|
+
import { h as useOnFirstRender, t as FOCUSABLE_POPUP_PROPS } from "./popupStoreUtils-fpjh6veok5pa2hd1.js";
|
|
17
|
+
import { t as useTransitionStatus } from "./useTransitionStatus-ig4waxl2kervpyw4.js";
|
|
18
|
+
import { t as useFloatingRootContext } from "./useFloatingRootContext-jo582qzez5k9gbgk.js";
|
|
19
|
+
import { t as useListNavigation } from "./useListNavigation-iyo9r9vug2g1clmc.js";
|
|
20
|
+
import { t as useBaseUiId } from "./useBaseUiId-gqkl5ep5pn6hd0rw.js";
|
|
21
|
+
import { n as useDirection } from "./DirectionContext-jc1g0w645603sd6p.js";
|
|
22
|
+
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-hetas2e4y0kywfas.js";
|
|
23
|
+
import { n as useFormContext } from "./FormContext-xz0b4h7ue30fkkn1.js";
|
|
24
|
+
import { t as useLabelableId } from "./useLabelableId-b1kwq9st3rjrtakn.js";
|
|
25
|
+
import { t as useControlled } from "./useControlled-nlx0kk1ksgk0auvi.js";
|
|
26
|
+
import { t as useRegisterFieldControl } from "./useRegisterFieldControl-m1rxsuvtpau2341n.js";
|
|
27
|
+
import { t as useButton } from "./useButton-cpo6u2idqcnou6vy.js";
|
|
28
|
+
import { t as useValueChanged } from "./useValueChanged-kthmz4wk7ywnjwtx.js";
|
|
29
|
+
import { t as areArraysEqual } from "./areArraysEqual-nlbeaqlzf4274zr3.js";
|
|
30
|
+
import { a as stringifyAsLabel, c as defaultItemEquality, d as selectedValueIncludes, l as findItemIndex, n as isGroupedItems, o as stringifyAsValue, s as compareItemEquality, t as hasNullItemLabel, u as removeItem } from "./resolveValueLabel-i36fqhi09ki67hx5.js";
|
|
31
|
+
import { t as stringifyLocale } from "./stringifyLocale-cl8et9xf6zon4qbs.js";
|
|
32
|
+
import { n as resolveAriaLabelledBy } from "./resolveAriaLabelledBy-h9qwvo10ftlj6t9k.js";
|
|
33
|
+
import { t as CompositeList } from "./CompositeList-bek8pmx9o8cu36ig.js";
|
|
34
|
+
import { n as useCompositeListItem, t as IndexGuessBehavior } from "./useCompositeListItem-0exfww37ospqz69b.js";
|
|
35
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
36
|
+
import * as React$1 from "react";
|
|
37
|
+
import * as ReactDOM from "react-dom";
|
|
38
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.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
|
|
39
|
+
/**
|
|
40
|
+
* Positional arguments are deliberate: property names of an options object
|
|
41
|
+
* don't minify, and the signature is locked to the caller via `typeof` on the
|
|
42
|
+
* `grid` option of `useListNavigation`.
|
|
43
|
+
*
|
|
44
|
+
* The injected grid navigator only ever operates on a uniform 1x1 grid (sizes are
|
|
45
|
+
* always `1x1` and packing is never dense), so the cell-map machinery that supports
|
|
46
|
+
* multi-cell items collapses to an identity transform over the item list. Calling
|
|
47
|
+
* `getGridNavigatedIndex` directly keeps the cell-map helpers
|
|
48
|
+
* (`createGridCellMap`/`getGridCellIndexOfCorner`/`getGridCellIndices`) out of
|
|
49
|
+
* grid-combobox bundles.
|
|
50
|
+
*/
|
|
51
|
+
function gridNavigation(event, prevIndex, listRef, orientation, loopFocus, rtl, disabledIndices, minIndex, maxIndex, cols = 2) {
|
|
52
|
+
const nextIndex = getGridNavigatedIndex(listRef.current, {
|
|
53
|
+
event,
|
|
54
|
+
orientation,
|
|
55
|
+
loopFocus,
|
|
56
|
+
rtl,
|
|
57
|
+
cols,
|
|
58
|
+
disabledIndices,
|
|
59
|
+
minIndex,
|
|
60
|
+
maxIndex,
|
|
61
|
+
prevIndex: prevIndex > maxIndex ? minIndex : prevIndex,
|
|
62
|
+
stopEvent: true
|
|
63
|
+
});
|
|
64
|
+
return isIndexOutOfListBounds(listRef.current, nextIndex) ? void 0 : nextIndex;
|
|
65
|
+
}
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.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
|
|
68
|
+
const ComboboxRootContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
69
|
+
ComboboxRootContext.displayName = "ComboboxRootContext";
|
|
70
|
+
const ComboboxFloatingContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
71
|
+
ComboboxFloatingContext.displayName = "ComboboxFloatingContext";
|
|
72
|
+
const ComboboxDerivedItemsContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
73
|
+
ComboboxDerivedItemsContext.displayName = "ComboboxDerivedItemsContext";
|
|
74
|
+
const ComboboxHasItemsContext = /*#__PURE__*/ React$1.createContext(false);
|
|
75
|
+
ComboboxHasItemsContext.displayName = "ComboboxHasItemsContext";
|
|
76
|
+
const ComboboxInputValueContext = /*#__PURE__*/ React$1.createContext("");
|
|
77
|
+
ComboboxInputValueContext.displayName = "ComboboxInputValueContext";
|
|
78
|
+
function useComboboxRootContext() {
|
|
79
|
+
const context = React$1.useContext(ComboboxRootContext);
|
|
80
|
+
if (!context) throw new Error("Base UI: ComboboxRootContext is missing. Combobox parts must be placed within <Combobox.Root>.");
|
|
81
|
+
return context;
|
|
82
|
+
}
|
|
83
|
+
function useComboboxFloatingContext() {
|
|
84
|
+
const context = React$1.useContext(ComboboxFloatingContext);
|
|
85
|
+
if (!context) throw new Error("Base UI: ComboboxFloatingContext is missing. Combobox parts must be placed within <Combobox.Root>.");
|
|
86
|
+
return context;
|
|
87
|
+
}
|
|
88
|
+
function useComboboxDerivedItemsContext() {
|
|
89
|
+
const context = React$1.useContext(ComboboxDerivedItemsContext);
|
|
90
|
+
if (!context) throw new Error("Base UI: ComboboxItemsContext is missing. Combobox parts must be placed within <Combobox.Root>.");
|
|
91
|
+
return context;
|
|
92
|
+
}
|
|
93
|
+
function useComboboxInputValueContext() {
|
|
94
|
+
return React$1.useContext(ComboboxInputValueContext);
|
|
95
|
+
}
|
|
96
|
+
function useComboboxHasItemsContext() {
|
|
97
|
+
return React$1.useContext(ComboboxHasItemsContext);
|
|
98
|
+
}
|
|
99
|
+
//#endregion
|
|
100
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.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
|
|
101
|
+
const selectors = {
|
|
102
|
+
id: createSelector((state) => state.id),
|
|
103
|
+
labelId: createSelector((state) => state.labelId),
|
|
104
|
+
items: createSelector((state) => state.items),
|
|
105
|
+
selectedValue: createSelector((state) => state.selectedValue),
|
|
106
|
+
hasSelectionChips: createSelector((state) => {
|
|
107
|
+
const selectedValue = state.selectedValue;
|
|
108
|
+
return Array.isArray(selectedValue) && selectedValue.length > 0;
|
|
109
|
+
}),
|
|
110
|
+
hasSelectedValue: createSelector((state) => {
|
|
111
|
+
const { selectedValue, selectionMode } = state;
|
|
112
|
+
if (selectedValue == null) return false;
|
|
113
|
+
if (selectionMode === "multiple" && Array.isArray(selectedValue)) return selectedValue.length > 0;
|
|
114
|
+
return true;
|
|
115
|
+
}),
|
|
116
|
+
hasNullItemLabel: createSelector((state, enabled) => {
|
|
117
|
+
return enabled ? hasNullItemLabel(state.items) : false;
|
|
118
|
+
}),
|
|
119
|
+
open: createSelector((state) => state.open),
|
|
120
|
+
mounted: createSelector((state) => state.mounted),
|
|
121
|
+
forceMounted: createSelector((state) => state.forceMounted),
|
|
122
|
+
inline: createSelector((state) => state.inline),
|
|
123
|
+
activeIndex: createSelector((state) => state.activeIndex),
|
|
124
|
+
selectedIndex: createSelector((state) => state.selectedIndex),
|
|
125
|
+
isActive: createSelector((state, index) => state.activeIndex === index),
|
|
126
|
+
isSelected: createSelector((state, itemValue) => {
|
|
127
|
+
const comparer = state.isItemEqualToValue;
|
|
128
|
+
const selectedValue = state.selectedValue;
|
|
129
|
+
if (Array.isArray(selectedValue)) return selectedValue.some((selectedItem) => compareItemEquality(itemValue, selectedItem, comparer));
|
|
130
|
+
return compareItemEquality(itemValue, selectedValue, comparer);
|
|
131
|
+
}),
|
|
132
|
+
transitionStatus: createSelector((state) => state.transitionStatus),
|
|
133
|
+
popupProps: createSelector((state) => state.popupProps),
|
|
134
|
+
inputProps: createSelector((state) => state.inputProps),
|
|
135
|
+
triggerProps: createSelector((state) => state.triggerProps),
|
|
136
|
+
itemProps: createSelector((state) => state.itemProps),
|
|
137
|
+
positionerElement: createSelector((state) => state.positionerElement),
|
|
138
|
+
listElement: createSelector((state) => state.listElement),
|
|
139
|
+
popupId: createSelector((state) => state.popupId),
|
|
140
|
+
triggerElement: createSelector((state) => state.triggerElement),
|
|
141
|
+
inputElement: createSelector((state) => state.inputElement),
|
|
142
|
+
inputGroupElement: createSelector((state) => state.inputGroupElement),
|
|
143
|
+
popupSide: createSelector((state) => state.popupSide),
|
|
144
|
+
openMethod: createSelector((state) => state.openMethod),
|
|
145
|
+
inputInsidePopup: createSelector((state) => state.inputInsidePopup),
|
|
146
|
+
inputOwnsFormValue: createSelector((state) => state.inputOwnsFormValue),
|
|
147
|
+
selectionMode: createSelector((state) => state.selectionMode),
|
|
148
|
+
name: createSelector((state) => state.name),
|
|
149
|
+
form: createSelector((state) => state.form),
|
|
150
|
+
disabled: createSelector((state) => state.disabled),
|
|
151
|
+
readOnly: createSelector((state) => state.readOnly),
|
|
152
|
+
required: createSelector((state) => state.required),
|
|
153
|
+
grid: createSelector((state) => state.grid),
|
|
154
|
+
virtualized: createSelector((state) => state.virtualized),
|
|
155
|
+
itemToStringLabel: createSelector((state) => state.itemToStringLabel),
|
|
156
|
+
isItemEqualToValue: createSelector((state) => state.isItemEqualToValue),
|
|
157
|
+
modal: createSelector((state) => state.modal),
|
|
158
|
+
autoHighlight: createSelector((state) => state.autoHighlight),
|
|
159
|
+
submitOnItemClick: createSelector((state) => state.submitOnItemClick)
|
|
160
|
+
};
|
|
161
|
+
//#endregion
|
|
162
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.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
|
|
163
|
+
/**
|
|
164
|
+
* Derives the default id assigned to `Combobox.Popup` when the input is rendered inside it.
|
|
165
|
+
* Shared by the popup (which applies it) and the trigger (which references it via `aria-controls`)
|
|
166
|
+
* so the convention only lives in one place.
|
|
167
|
+
*/
|
|
168
|
+
function getComboboxPopupId(rootId) {
|
|
169
|
+
return rootId == null ? void 0 : `${rootId}-popup`;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Enhanced filter using Intl.Collator for more robust string matching.
|
|
173
|
+
* Uses the provided `itemToStringLabel` function if available, otherwise falls back to:
|
|
174
|
+
* • When `item` is an object with a `value` property, that property is used.
|
|
175
|
+
* • When `item` is a primitive (e.g. `string`), it is used directly.
|
|
176
|
+
*/
|
|
177
|
+
function createCollatorItemFilter(collatorFilter, itemToStringLabel) {
|
|
178
|
+
return (item, query) => {
|
|
179
|
+
if (item == null) return false;
|
|
180
|
+
const itemString = stringifyAsLabel(item, itemToStringLabel);
|
|
181
|
+
return collatorFilter.contains(itemString, query);
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Enhanced filter for single selection mode using Intl.Collator that shows all items
|
|
186
|
+
* when query is empty or matches the current selection, making it easier to browse options.
|
|
187
|
+
*/
|
|
188
|
+
function createSingleSelectionCollatorFilter(collatorFilter, itemToStringLabel, selectedValue) {
|
|
189
|
+
return (item, query) => {
|
|
190
|
+
if (item == null) return false;
|
|
191
|
+
if (!query) return true;
|
|
192
|
+
const itemString = stringifyAsLabel(item, itemToStringLabel);
|
|
193
|
+
const selectedString = selectedValue != null ? stringifyAsLabel(selectedValue, itemToStringLabel) : "";
|
|
194
|
+
if (selectedString && collatorFilter.contains(selectedString, query) && selectedString.length === query.length) return true;
|
|
195
|
+
return collatorFilter.contains(itemString, query);
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
//#endregion
|
|
199
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/internals/filter.mjs
|
|
200
|
+
const filterCache = /* @__PURE__ */ new Map();
|
|
201
|
+
function getFilter(options = {}) {
|
|
202
|
+
const mergedOptions = {
|
|
203
|
+
usage: "search",
|
|
204
|
+
sensitivity: "base",
|
|
205
|
+
ignorePunctuation: true,
|
|
206
|
+
...options
|
|
207
|
+
};
|
|
208
|
+
const cacheKey = `${stringifyLocale(options.locale)}|${JSON.stringify(mergedOptions)}`;
|
|
209
|
+
const cachedFilter = filterCache.get(cacheKey);
|
|
210
|
+
if (cachedFilter) return cachedFilter;
|
|
211
|
+
const collator = new Intl.Collator(options.locale, mergedOptions);
|
|
212
|
+
const filter = {
|
|
213
|
+
contains(item, query, itemToString) {
|
|
214
|
+
if (!query) return true;
|
|
215
|
+
const itemString = stringifyAsLabel(item, itemToString);
|
|
216
|
+
for (let i = 0; i <= itemString.length - query.length; i += 1) if (collator.compare(itemString.slice(i, i + query.length), query) === 0) return true;
|
|
217
|
+
return false;
|
|
218
|
+
},
|
|
219
|
+
startsWith(item, query, itemToString) {
|
|
220
|
+
if (!query) return true;
|
|
221
|
+
const itemString = stringifyAsLabel(item, itemToString);
|
|
222
|
+
return collator.compare(itemString.slice(0, query.length), query) === 0;
|
|
223
|
+
},
|
|
224
|
+
endsWith(item, query, itemToString) {
|
|
225
|
+
if (!query) return true;
|
|
226
|
+
const itemString = stringifyAsLabel(item, itemToString);
|
|
227
|
+
const queryLength = query.length;
|
|
228
|
+
return itemString.length >= queryLength && collator.compare(itemString.slice(itemString.length - queryLength), query) === 0;
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
filterCache.set(cacheKey, filter);
|
|
232
|
+
return filter;
|
|
233
|
+
}
|
|
234
|
+
//#endregion
|
|
235
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.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
|
|
236
|
+
/**
|
|
237
|
+
* Matches items against a query using `Intl.Collator` for robust string matching.
|
|
238
|
+
*/
|
|
239
|
+
const useCoreFilter = getFilter;
|
|
240
|
+
/**
|
|
241
|
+
* Matches items against a query using `Intl.Collator` for robust string matching.
|
|
242
|
+
*/
|
|
243
|
+
function useComboboxFilter(options = {}) {
|
|
244
|
+
const { multiple = false, value, ...collatorOptions } = options;
|
|
245
|
+
const coreFilter = getFilter(collatorOptions);
|
|
246
|
+
const contains = React$1.useCallback((item, query, itemToString) => {
|
|
247
|
+
if (multiple) return createCollatorItemFilter(coreFilter, itemToString)(item, query);
|
|
248
|
+
return createSingleSelectionCollatorFilter(coreFilter, itemToString, value)(item, query);
|
|
249
|
+
}, [
|
|
250
|
+
coreFilter,
|
|
251
|
+
value,
|
|
252
|
+
multiple
|
|
253
|
+
]);
|
|
254
|
+
return React$1.useMemo(() => ({
|
|
255
|
+
contains,
|
|
256
|
+
startsWith: coreFilter.startsWith,
|
|
257
|
+
endsWith: coreFilter.endsWith
|
|
258
|
+
}), [contains, coreFilter]);
|
|
259
|
+
}
|
|
260
|
+
//#endregion
|
|
261
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.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
|
|
262
|
+
const NO_ACTIVE_VALUE = Symbol("none");
|
|
263
|
+
const INITIAL_LAST_HIGHLIGHT = {
|
|
264
|
+
value: NO_ACTIVE_VALUE,
|
|
265
|
+
index: -1
|
|
266
|
+
};
|
|
267
|
+
//#endregion
|
|
268
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.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
|
|
269
|
+
/**
|
|
270
|
+
* @internal
|
|
271
|
+
*/
|
|
272
|
+
function AriaCombobox(props) {
|
|
273
|
+
const { id: idProp, onOpenChangeComplete: onOpenChangeCompleteProp, defaultSelectedValue = null, selectedValue: selectedValueProp, onSelectedValueChange, defaultInputValue: defaultInputValueProp, inputValue: inputValueProp, open: openProp, defaultOpen = false, selectionMode = "none", onItemHighlighted: onItemHighlightedProp, name: nameProp, form, disabled: disabledProp = false, readOnly = false, required = false, inputRef: inputRefProp, grid = false, items, filteredItems: filteredItemsProp, filter: filterProp, openOnInputClick = true, autoHighlight = false, keepHighlight = false, highlightItemOnHover = true, loopFocus = true, itemToStringLabel, itemToStringValue, isItemEqualToValue = defaultItemEquality, virtualized = false, inline: inlineProp = false, fillInputOnItemPress = true, modal = false, limit = -1, autoComplete = "list", formAutoComplete, locale, submitOnItemClick = false } = props;
|
|
274
|
+
const { clearErrors } = useFormContext();
|
|
275
|
+
const { setDirty, validityData, setFilled, name: fieldName, disabled: fieldDisabled, setTouched, setFocused, validationMode, validation } = useFieldRootContext();
|
|
276
|
+
const direction = useDirection();
|
|
277
|
+
const id = useLabelableId({ id: idProp });
|
|
278
|
+
const collatorFilter = useCoreFilter({ locale });
|
|
279
|
+
const [queryChangedAfterOpen, setQueryChangedAfterOpen] = React$1.useState(false);
|
|
280
|
+
const [closeQuery, setCloseQuery] = React$1.useState(null);
|
|
281
|
+
const listRef = React$1.useRef([]);
|
|
282
|
+
const labelsRef = React$1.useRef([]);
|
|
283
|
+
const popupRef = React$1.useRef(null);
|
|
284
|
+
const inputRef = React$1.useRef(null);
|
|
285
|
+
const startDismissRef = React$1.useRef(null);
|
|
286
|
+
const endDismissRef = React$1.useRef(null);
|
|
287
|
+
const emptyRef = React$1.useRef(null);
|
|
288
|
+
const keyboardActiveRef = React$1.useRef(true);
|
|
289
|
+
const hadInputClearRef = React$1.useRef(false);
|
|
290
|
+
const chipsContainerRef = React$1.useRef(null);
|
|
291
|
+
const clearRef = React$1.useRef(null);
|
|
292
|
+
const selectionEventRef = React$1.useRef(null);
|
|
293
|
+
const lastHighlightRef = React$1.useRef(INITIAL_LAST_HIGHLIGHT);
|
|
294
|
+
const pendingQueryHighlightRef = React$1.useRef(null);
|
|
295
|
+
/**
|
|
296
|
+
* Contains the currently visible list of item values post-filtering.
|
|
297
|
+
*/
|
|
298
|
+
const valuesRef = React$1.useRef([]);
|
|
299
|
+
/**
|
|
300
|
+
* Contains all item values in a stable, unfiltered order.
|
|
301
|
+
* This is only used when `items` prop is not provided.
|
|
302
|
+
* It accumulates values on first mount and does not remove them on unmount due to
|
|
303
|
+
* filtering, providing a stable index for selected value tracking.
|
|
304
|
+
*/
|
|
305
|
+
const allValuesRef = React$1.useRef([]);
|
|
306
|
+
const disabled = fieldDisabled || disabledProp;
|
|
307
|
+
const name = fieldName ?? nameProp;
|
|
308
|
+
const multiple = selectionMode === "multiple";
|
|
309
|
+
const single = selectionMode === "single";
|
|
310
|
+
const hasInputValue = inputValueProp !== void 0 || defaultInputValueProp !== void 0;
|
|
311
|
+
const hasItems = items !== void 0;
|
|
312
|
+
const hasFilteredItemsProp = filteredItemsProp !== void 0;
|
|
313
|
+
let autoHighlightMode;
|
|
314
|
+
if (autoHighlight === "always") autoHighlightMode = "always";
|
|
315
|
+
else autoHighlightMode = autoHighlight ? "input-change" : false;
|
|
316
|
+
const [selectedValue, setSelectedValueUnwrapped] = useControlled({
|
|
317
|
+
controlled: selectedValueProp,
|
|
318
|
+
default: multiple ? defaultSelectedValue ?? EMPTY_ARRAY : defaultSelectedValue,
|
|
319
|
+
name: "Combobox",
|
|
320
|
+
state: "selectedValue"
|
|
321
|
+
});
|
|
322
|
+
const filter = React$1.useMemo(() => {
|
|
323
|
+
if (filterProp === null) return () => true;
|
|
324
|
+
if (filterProp !== void 0) return filterProp;
|
|
325
|
+
if (single && !queryChangedAfterOpen) return createSingleSelectionCollatorFilter(collatorFilter, itemToStringLabel, selectedValue);
|
|
326
|
+
return createCollatorItemFilter(collatorFilter, itemToStringLabel);
|
|
327
|
+
}, [
|
|
328
|
+
filterProp,
|
|
329
|
+
single,
|
|
330
|
+
selectedValue,
|
|
331
|
+
queryChangedAfterOpen,
|
|
332
|
+
collatorFilter,
|
|
333
|
+
itemToStringLabel
|
|
334
|
+
]);
|
|
335
|
+
const initialDefaultInputValue = useRefWithInit(() => {
|
|
336
|
+
if (hasInputValue) return defaultInputValueProp ?? "";
|
|
337
|
+
if (single) return stringifyAsLabel(selectedValue, itemToStringLabel);
|
|
338
|
+
return "";
|
|
339
|
+
}).current;
|
|
340
|
+
const [inputValue, setInputValueUnwrapped] = useControlled({
|
|
341
|
+
controlled: inputValueProp,
|
|
342
|
+
default: initialDefaultInputValue,
|
|
343
|
+
name: "Combobox",
|
|
344
|
+
state: "inputValue"
|
|
345
|
+
});
|
|
346
|
+
const [open, setOpenUnwrapped] = useControlled({
|
|
347
|
+
controlled: openProp,
|
|
348
|
+
default: defaultOpen,
|
|
349
|
+
name: "Combobox",
|
|
350
|
+
state: "open"
|
|
351
|
+
});
|
|
352
|
+
const isGrouped = isGroupedItems(items);
|
|
353
|
+
const query = closeQuery ?? (inputValue === "" ? "" : String(inputValue).trim());
|
|
354
|
+
const selectedLabelString = single ? stringifyAsLabel(selectedValue, itemToStringLabel) : "";
|
|
355
|
+
const shouldBypassFiltering = single && !queryChangedAfterOpen && query !== "" && selectedLabelString !== "" && selectedLabelString.length === query.length && collatorFilter.contains(selectedLabelString, query);
|
|
356
|
+
const filterQuery = shouldBypassFiltering ? "" : query;
|
|
357
|
+
const shouldIgnoreExternalFiltering = hasItems && hasFilteredItemsProp && shouldBypassFiltering;
|
|
358
|
+
const flatItems = React$1.useMemo(() => {
|
|
359
|
+
if (!items) return EMPTY_ARRAY;
|
|
360
|
+
if (isGrouped) return items.flatMap((group) => group.items);
|
|
361
|
+
return items;
|
|
362
|
+
}, [items, isGrouped]);
|
|
363
|
+
const filteredItems = React$1.useMemo(() => {
|
|
364
|
+
if (filteredItemsProp && !shouldIgnoreExternalFiltering) return filteredItemsProp;
|
|
365
|
+
if (!items) return EMPTY_ARRAY;
|
|
366
|
+
if (isGrouped) {
|
|
367
|
+
const groupedItems = items;
|
|
368
|
+
const resultingGroups = [];
|
|
369
|
+
let currentCount = 0;
|
|
370
|
+
for (const group of groupedItems) {
|
|
371
|
+
if (limit > -1 && currentCount >= limit) break;
|
|
372
|
+
const candidateItems = filterQuery === "" ? group.items : group.items.filter((item) => filter(item, filterQuery, itemToStringLabel));
|
|
373
|
+
if (candidateItems.length === 0) continue;
|
|
374
|
+
const remainingLimit = limit > -1 ? limit - currentCount : Infinity;
|
|
375
|
+
const itemsToTake = candidateItems.slice(0, remainingLimit);
|
|
376
|
+
if (itemsToTake.length > 0) {
|
|
377
|
+
const newGroup = {
|
|
378
|
+
...group,
|
|
379
|
+
items: itemsToTake
|
|
380
|
+
};
|
|
381
|
+
resultingGroups.push(newGroup);
|
|
382
|
+
currentCount += itemsToTake.length;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
return resultingGroups;
|
|
386
|
+
}
|
|
387
|
+
if (filterQuery === "") return limit > -1 ? flatItems.slice(0, limit) : flatItems;
|
|
388
|
+
const limitedItems = [];
|
|
389
|
+
for (const item of flatItems) {
|
|
390
|
+
if (limit > -1 && limitedItems.length >= limit) break;
|
|
391
|
+
if (filter(item, filterQuery, itemToStringLabel)) limitedItems.push(item);
|
|
392
|
+
}
|
|
393
|
+
return limitedItems;
|
|
394
|
+
}, [
|
|
395
|
+
filteredItemsProp,
|
|
396
|
+
shouldIgnoreExternalFiltering,
|
|
397
|
+
items,
|
|
398
|
+
isGrouped,
|
|
399
|
+
filterQuery,
|
|
400
|
+
limit,
|
|
401
|
+
filter,
|
|
402
|
+
itemToStringLabel,
|
|
403
|
+
flatItems
|
|
404
|
+
]);
|
|
405
|
+
const flatFilteredItems = React$1.useMemo(() => {
|
|
406
|
+
if (isGrouped) return filteredItems.flatMap((g) => g.items);
|
|
407
|
+
return filteredItems;
|
|
408
|
+
}, [filteredItems, isGrouped]);
|
|
409
|
+
const store = useRefWithInit(() => new Store({
|
|
410
|
+
id,
|
|
411
|
+
labelId: void 0,
|
|
412
|
+
selectedValue,
|
|
413
|
+
open,
|
|
414
|
+
filter,
|
|
415
|
+
query,
|
|
416
|
+
items,
|
|
417
|
+
selectionMode,
|
|
418
|
+
listRef,
|
|
419
|
+
labelsRef,
|
|
420
|
+
popupRef,
|
|
421
|
+
emptyRef,
|
|
422
|
+
inputRef,
|
|
423
|
+
startDismissRef,
|
|
424
|
+
endDismissRef,
|
|
425
|
+
keyboardActiveRef,
|
|
426
|
+
chipsContainerRef,
|
|
427
|
+
clearRef,
|
|
428
|
+
valuesRef,
|
|
429
|
+
allValuesRef,
|
|
430
|
+
selectionEventRef,
|
|
431
|
+
name,
|
|
432
|
+
form,
|
|
433
|
+
disabled,
|
|
434
|
+
readOnly,
|
|
435
|
+
required,
|
|
436
|
+
grid,
|
|
437
|
+
isGrouped,
|
|
438
|
+
virtualized,
|
|
439
|
+
openOnInputClick,
|
|
440
|
+
itemToStringLabel,
|
|
441
|
+
isItemEqualToValue,
|
|
442
|
+
modal,
|
|
443
|
+
autoHighlight: autoHighlightMode,
|
|
444
|
+
submitOnItemClick,
|
|
445
|
+
hasInputValue,
|
|
446
|
+
mounted: false,
|
|
447
|
+
forceMounted: false,
|
|
448
|
+
transitionStatus: "idle",
|
|
449
|
+
inline: inlineProp,
|
|
450
|
+
activeIndex: null,
|
|
451
|
+
selectedIndex: null,
|
|
452
|
+
popupProps: {},
|
|
453
|
+
inputProps: {},
|
|
454
|
+
triggerProps: {},
|
|
455
|
+
itemProps: EMPTY_OBJECT,
|
|
456
|
+
positionerElement: null,
|
|
457
|
+
listElement: null,
|
|
458
|
+
popupId: void 0,
|
|
459
|
+
triggerElement: null,
|
|
460
|
+
inputElement: null,
|
|
461
|
+
inputGroupElement: null,
|
|
462
|
+
popupSide: null,
|
|
463
|
+
openMethod: null,
|
|
464
|
+
inputInsidePopup: true,
|
|
465
|
+
inputOwnsFormValue: selectionMode === "none",
|
|
466
|
+
onOpenChangeComplete: onOpenChangeCompleteProp || NOOP,
|
|
467
|
+
setOpen: NOOP,
|
|
468
|
+
setInputValue: NOOP,
|
|
469
|
+
setSelectedValue: NOOP,
|
|
470
|
+
setIndices: NOOP,
|
|
471
|
+
onItemHighlighted: NOOP,
|
|
472
|
+
handleSelection: NOOP,
|
|
473
|
+
forceMount: NOOP,
|
|
474
|
+
requestSubmit: NOOP
|
|
475
|
+
})).current;
|
|
476
|
+
const fieldRawValue = selectionMode === "none" ? inputValue : selectedValue;
|
|
477
|
+
const fieldStringValue = React$1.useMemo(() => {
|
|
478
|
+
if (selectionMode === "none") return fieldRawValue;
|
|
479
|
+
if (Array.isArray(selectedValue)) return selectedValue.map((value) => stringifyAsValue(value, itemToStringValue));
|
|
480
|
+
return stringifyAsValue(selectedValue, itemToStringValue);
|
|
481
|
+
}, [
|
|
482
|
+
fieldRawValue,
|
|
483
|
+
itemToStringValue,
|
|
484
|
+
selectionMode,
|
|
485
|
+
selectedValue
|
|
486
|
+
]);
|
|
487
|
+
const onItemHighlighted = useStableCallback(onItemHighlightedProp);
|
|
488
|
+
const onOpenChangeComplete = useStableCallback(onOpenChangeCompleteProp);
|
|
489
|
+
const activeIndex = useStore(store, selectors.activeIndex);
|
|
490
|
+
const selectedIndex = useStore(store, selectors.selectedIndex);
|
|
491
|
+
const positionerElement = useStore(store, selectors.positionerElement);
|
|
492
|
+
const listElement = useStore(store, selectors.listElement);
|
|
493
|
+
const triggerElement = useStore(store, selectors.triggerElement);
|
|
494
|
+
const inputElement = useStore(store, selectors.inputElement);
|
|
495
|
+
const inputGroupElement = useStore(store, selectors.inputGroupElement);
|
|
496
|
+
const inline = useStore(store, selectors.inline);
|
|
497
|
+
const inputInsidePopup = useStore(store, selectors.inputInsidePopup);
|
|
498
|
+
const inputOwnsFormValue = useStore(store, selectors.inputOwnsFormValue);
|
|
499
|
+
const triggerRef = useValueAsRef(triggerElement);
|
|
500
|
+
const { mounted, setMounted, transitionStatus } = useTransitionStatus(open);
|
|
501
|
+
const { openMethod, triggerProps } = useOpenInteractionType(open);
|
|
502
|
+
const getStringifiedValueForForm = useStableCallback(() => fieldStringValue);
|
|
503
|
+
useRegisterFieldControl(inputInsidePopup ? triggerRef : inputRef, id, fieldRawValue, getStringifiedValueForForm, !disabled, nameProp);
|
|
504
|
+
const forceMount = useStableCallback(() => {
|
|
505
|
+
if (items) labelsRef.current = flatFilteredItems.map((item) => stringifyAsLabel(item, itemToStringLabel));
|
|
506
|
+
else store.set("forceMounted", true);
|
|
507
|
+
});
|
|
508
|
+
const initialSelectedValueRef = React$1.useRef(selectedValue);
|
|
509
|
+
useIsoLayoutEffect(() => {
|
|
510
|
+
if (selectedValue !== initialSelectedValueRef.current) forceMount();
|
|
511
|
+
}, [forceMount, selectedValue]);
|
|
512
|
+
const setIndices = useStableCallback((options) => {
|
|
513
|
+
store.update(options);
|
|
514
|
+
const type = options.type || "none";
|
|
515
|
+
if (options.activeIndex === void 0) return;
|
|
516
|
+
if (options.activeIndex === null) {
|
|
517
|
+
if (lastHighlightRef.current !== INITIAL_LAST_HIGHLIGHT) {
|
|
518
|
+
lastHighlightRef.current = INITIAL_LAST_HIGHLIGHT;
|
|
519
|
+
onItemHighlighted(void 0, createGenericEventDetails(type, void 0, { index: -1 }));
|
|
520
|
+
}
|
|
521
|
+
} else {
|
|
522
|
+
const activeValue = valuesRef.current[options.activeIndex];
|
|
523
|
+
lastHighlightRef.current = {
|
|
524
|
+
value: activeValue,
|
|
525
|
+
index: options.activeIndex
|
|
526
|
+
};
|
|
527
|
+
onItemHighlighted(activeValue, createGenericEventDetails(type, void 0, { index: options.activeIndex }));
|
|
528
|
+
}
|
|
529
|
+
});
|
|
530
|
+
const setInputValue = useStableCallback((next, eventDetails) => {
|
|
531
|
+
hadInputClearRef.current = eventDetails.reason === inputClear;
|
|
532
|
+
props.onInputValueChange?.(next, eventDetails);
|
|
533
|
+
if (eventDetails.isCanceled) return;
|
|
534
|
+
if (eventDetails.reason === "input-change") {
|
|
535
|
+
const event = eventDetails.event;
|
|
536
|
+
const inputType = event.inputType;
|
|
537
|
+
if (event.type === "compositionend" || inputType != null && inputType !== "" && inputType !== "insertReplacementText") {
|
|
538
|
+
const hasQuery = next.trim() !== "";
|
|
539
|
+
if (hasQuery) setQueryChangedAfterOpen(true);
|
|
540
|
+
pendingQueryHighlightRef.current = { hasQuery };
|
|
541
|
+
if (hasQuery && autoHighlightMode && store.state.activeIndex == null) store.set("activeIndex", 0);
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
setInputValueUnwrapped(next);
|
|
545
|
+
});
|
|
546
|
+
const setOpen = useStableCallback((nextOpen, eventDetails) => {
|
|
547
|
+
if (open === nextOpen) return;
|
|
548
|
+
if (eventDetails.reason === "escape-key" && hasItems && flatFilteredItems.length === 0 && !store.state.emptyRef.current) eventDetails.allowPropagation();
|
|
549
|
+
props.onOpenChange?.(nextOpen, eventDetails);
|
|
550
|
+
if (eventDetails.isCanceled) return;
|
|
551
|
+
if (nextOpen && multiple && inputInsidePopup && !inline && closeQuery !== null) {
|
|
552
|
+
setQueryChangedAfterOpen(false);
|
|
553
|
+
setCloseQuery(null);
|
|
554
|
+
if (inputValue !== "") setInputValue("", createChangeEventDetails(inputClear, eventDetails.event));
|
|
555
|
+
}
|
|
556
|
+
if (!nextOpen && queryChangedAfterOpen) {
|
|
557
|
+
if (single) {
|
|
558
|
+
if (!inline) setCloseQuery(query);
|
|
559
|
+
if (query === "") setQueryChangedAfterOpen(false);
|
|
560
|
+
} else if (multiple) {
|
|
561
|
+
if (!inline) setCloseQuery(query);
|
|
562
|
+
if (inputInsidePopup) setIndices({ activeIndex: null });
|
|
563
|
+
if (!inputInsidePopup || inline) setInputValue("", createChangeEventDetails(inputClear, eventDetails.event));
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
setOpenUnwrapped(nextOpen);
|
|
567
|
+
if (!nextOpen && inputInsidePopup && (eventDetails.reason === "focus-out" || eventDetails.reason === "outside-press")) {
|
|
568
|
+
setTouched(true);
|
|
569
|
+
setFocused(false);
|
|
570
|
+
if (validationMode === "onBlur") {
|
|
571
|
+
const valueToValidate = selectionMode === "none" ? inputValue : selectedValue;
|
|
572
|
+
validation.commit(valueToValidate);
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
});
|
|
576
|
+
const setSelectedValue = useStableCallback((nextValue, eventDetails) => {
|
|
577
|
+
onSelectedValueChange?.(nextValue, eventDetails);
|
|
578
|
+
if (eventDetails.isCanceled) return;
|
|
579
|
+
setSelectedValueUnwrapped(nextValue);
|
|
580
|
+
if (selectionMode === "none" && popupRef.current && fillInputOnItemPress || single && !store.state.inputInsidePopup) setInputValue(stringifyAsLabel(nextValue, itemToStringLabel), createChangeEventDetails(eventDetails.reason, eventDetails.event));
|
|
581
|
+
if (single && nextValue != null && eventDetails.reason !== "input-change" && queryChangedAfterOpen && !inline) setCloseQuery(query);
|
|
582
|
+
});
|
|
583
|
+
const handleSelection = useStableCallback((event, passedValue) => {
|
|
584
|
+
let itemValue = passedValue;
|
|
585
|
+
if (itemValue === void 0) {
|
|
586
|
+
if (activeIndex === null) return;
|
|
587
|
+
itemValue = valuesRef.current[activeIndex];
|
|
588
|
+
}
|
|
589
|
+
const targetEl = getTarget(event);
|
|
590
|
+
const overrideEvent = selectionEventRef.current ?? event;
|
|
591
|
+
selectionEventRef.current = null;
|
|
592
|
+
const eventDetails = createChangeEventDetails(itemPress, overrideEvent);
|
|
593
|
+
const href = targetEl?.closest("a")?.getAttribute("href");
|
|
594
|
+
if (href) {
|
|
595
|
+
if (href.startsWith("#")) setOpen(false, eventDetails);
|
|
596
|
+
return;
|
|
597
|
+
}
|
|
598
|
+
if (multiple) {
|
|
599
|
+
const currentSelectedValue = Array.isArray(selectedValue) ? selectedValue : [];
|
|
600
|
+
const nextValue = selectedValueIncludes(currentSelectedValue, itemValue, store.state.isItemEqualToValue) ? removeItem(currentSelectedValue, itemValue, store.state.isItemEqualToValue) : [...currentSelectedValue, itemValue];
|
|
601
|
+
setSelectedValue(nextValue, eventDetails);
|
|
602
|
+
if (eventDetails.isCanceled) return;
|
|
603
|
+
if (!(inputRef.current ? inputRef.current.value.trim() !== "" : false)) return;
|
|
604
|
+
if (store.state.inputInsidePopup) setInputValue("", createChangeEventDetails(inputClear, eventDetails.event));
|
|
605
|
+
else setOpen(false, eventDetails);
|
|
606
|
+
} else {
|
|
607
|
+
setSelectedValue(itemValue, eventDetails);
|
|
608
|
+
if (eventDetails.isCanceled) return;
|
|
609
|
+
setOpen(false, eventDetails);
|
|
610
|
+
}
|
|
611
|
+
});
|
|
612
|
+
const requestSubmit = useStableCallback(() => {
|
|
613
|
+
if (!store.state.submitOnItemClick) return;
|
|
614
|
+
const formElement = validation.inputRef.current?.form ?? store.state.inputElement?.form;
|
|
615
|
+
if (formElement && typeof formElement.requestSubmit === "function") formElement.requestSubmit();
|
|
616
|
+
});
|
|
617
|
+
const handleUnmount = useStableCallback(() => {
|
|
618
|
+
setMounted(false);
|
|
619
|
+
onOpenChangeComplete?.(false);
|
|
620
|
+
setQueryChangedAfterOpen(false);
|
|
621
|
+
setCloseQuery(null);
|
|
622
|
+
if (selectionMode === "none") setIndices({
|
|
623
|
+
activeIndex: null,
|
|
624
|
+
selectedIndex: null
|
|
625
|
+
});
|
|
626
|
+
else setIndices({ activeIndex: null });
|
|
627
|
+
if (multiple && inputRef.current && inputRef.current.value !== "" && !hadInputClearRef.current) setInputValue("", createChangeEventDetails(inputClear));
|
|
628
|
+
if (single) if (store.state.inputInsidePopup) {
|
|
629
|
+
if (inputRef.current && inputRef.current.value !== "") setInputValue("", createChangeEventDetails(inputClear));
|
|
630
|
+
} else {
|
|
631
|
+
const stringVal = stringifyAsLabel(selectedValue, itemToStringLabel);
|
|
632
|
+
if (inputRef.current && inputRef.current.value !== stringVal) setInputValue(stringVal, createChangeEventDetails(stringVal === "" ? inputClear : none));
|
|
633
|
+
}
|
|
634
|
+
});
|
|
635
|
+
const resolvedPopupRef = React$1.useMemo(() => {
|
|
636
|
+
if (inline && positionerElement) return { current: positionerElement.closest("[role=\"dialog\"]") };
|
|
637
|
+
return popupRef;
|
|
638
|
+
}, [inline, positionerElement]);
|
|
639
|
+
useOpenChangeComplete({
|
|
640
|
+
enabled: !props.actionsRef,
|
|
641
|
+
open,
|
|
642
|
+
ref: resolvedPopupRef,
|
|
643
|
+
onComplete() {
|
|
644
|
+
if (!open) handleUnmount();
|
|
645
|
+
}
|
|
646
|
+
});
|
|
647
|
+
React$1.useImperativeHandle(props.actionsRef, () => ({ unmount: handleUnmount }), [handleUnmount]);
|
|
648
|
+
useIsoLayoutEffect(function syncSelectedIndex() {
|
|
649
|
+
if (open || selectionMode === "none") return;
|
|
650
|
+
const registry = items ? flatItems : allValuesRef.current;
|
|
651
|
+
if (multiple) {
|
|
652
|
+
const currentValue = Array.isArray(selectedValue) ? selectedValue : [];
|
|
653
|
+
const lastValue = currentValue[currentValue.length - 1];
|
|
654
|
+
const lastIndex = findItemIndex(registry, lastValue, isItemEqualToValue);
|
|
655
|
+
setIndices({ selectedIndex: lastIndex === -1 ? null : lastIndex });
|
|
656
|
+
} else {
|
|
657
|
+
const index = findItemIndex(registry, selectedValue, isItemEqualToValue);
|
|
658
|
+
setIndices({ selectedIndex: index === -1 ? null : index });
|
|
659
|
+
}
|
|
660
|
+
}, [
|
|
661
|
+
open,
|
|
662
|
+
selectedValue,
|
|
663
|
+
items,
|
|
664
|
+
selectionMode,
|
|
665
|
+
flatItems,
|
|
666
|
+
multiple,
|
|
667
|
+
isItemEqualToValue,
|
|
668
|
+
setIndices
|
|
669
|
+
]);
|
|
670
|
+
useIsoLayoutEffect(() => {
|
|
671
|
+
if (items) {
|
|
672
|
+
valuesRef.current = flatFilteredItems;
|
|
673
|
+
listRef.current.length = flatFilteredItems.length;
|
|
674
|
+
}
|
|
675
|
+
}, [items, flatFilteredItems]);
|
|
676
|
+
useIsoLayoutEffect(() => {
|
|
677
|
+
const pendingHighlight = pendingQueryHighlightRef.current;
|
|
678
|
+
if (pendingHighlight) {
|
|
679
|
+
if (pendingHighlight.hasQuery) {
|
|
680
|
+
if (autoHighlightMode) store.set("activeIndex", 0);
|
|
681
|
+
} else if (autoHighlightMode === "always") store.set("activeIndex", 0);
|
|
682
|
+
pendingQueryHighlightRef.current = null;
|
|
683
|
+
}
|
|
684
|
+
if (!open && !inline) return;
|
|
685
|
+
const candidateItems = hasItems || hasFilteredItemsProp ? flatFilteredItems : valuesRef.current;
|
|
686
|
+
const storeActiveIndex = store.state.activeIndex;
|
|
687
|
+
if (storeActiveIndex == null) {
|
|
688
|
+
if (autoHighlightMode === "always" && candidateItems.length > 0) {
|
|
689
|
+
store.set("activeIndex", 0);
|
|
690
|
+
return;
|
|
691
|
+
}
|
|
692
|
+
if (lastHighlightRef.current !== INITIAL_LAST_HIGHLIGHT) {
|
|
693
|
+
lastHighlightRef.current = INITIAL_LAST_HIGHLIGHT;
|
|
694
|
+
store.state.onItemHighlighted(void 0, createGenericEventDetails(none, void 0, { index: -1 }));
|
|
695
|
+
}
|
|
696
|
+
return;
|
|
697
|
+
}
|
|
698
|
+
if (storeActiveIndex >= candidateItems.length) {
|
|
699
|
+
if (lastHighlightRef.current !== INITIAL_LAST_HIGHLIGHT) {
|
|
700
|
+
lastHighlightRef.current = INITIAL_LAST_HIGHLIGHT;
|
|
701
|
+
store.state.onItemHighlighted(void 0, createGenericEventDetails(none, void 0, { index: -1 }));
|
|
702
|
+
}
|
|
703
|
+
store.set("activeIndex", null);
|
|
704
|
+
return;
|
|
705
|
+
}
|
|
706
|
+
const itemValue = candidateItems[storeActiveIndex];
|
|
707
|
+
const previouslyHighlightedItemValue = lastHighlightRef.current.value;
|
|
708
|
+
const isSameItem = previouslyHighlightedItemValue !== NO_ACTIVE_VALUE && compareItemEquality(itemValue, previouslyHighlightedItemValue, store.state.isItemEqualToValue);
|
|
709
|
+
if (lastHighlightRef.current.index !== storeActiveIndex || !isSameItem) {
|
|
710
|
+
lastHighlightRef.current = {
|
|
711
|
+
value: itemValue,
|
|
712
|
+
index: storeActiveIndex
|
|
713
|
+
};
|
|
714
|
+
store.state.onItemHighlighted(itemValue, createGenericEventDetails(none, void 0, { index: storeActiveIndex }));
|
|
715
|
+
}
|
|
716
|
+
}, [
|
|
717
|
+
activeIndex,
|
|
718
|
+
autoHighlightMode,
|
|
719
|
+
hasFilteredItemsProp,
|
|
720
|
+
hasItems,
|
|
721
|
+
flatFilteredItems,
|
|
722
|
+
inline,
|
|
723
|
+
open,
|
|
724
|
+
store
|
|
725
|
+
]);
|
|
726
|
+
useIsoLayoutEffect(() => {
|
|
727
|
+
if (selectionMode === "none") {
|
|
728
|
+
setFilled(String(inputValue) !== "");
|
|
729
|
+
return;
|
|
730
|
+
}
|
|
731
|
+
setFilled(multiple ? Array.isArray(selectedValue) && selectedValue.length > 0 : selectedValue != null);
|
|
732
|
+
}, [
|
|
733
|
+
setFilled,
|
|
734
|
+
selectionMode,
|
|
735
|
+
inputValue,
|
|
736
|
+
selectedValue,
|
|
737
|
+
multiple
|
|
738
|
+
]);
|
|
739
|
+
React$1.useEffect(() => {
|
|
740
|
+
if (hasItems && autoHighlightMode && flatFilteredItems.length === 0) setIndices({ activeIndex: null });
|
|
741
|
+
}, [
|
|
742
|
+
hasItems,
|
|
743
|
+
autoHighlightMode,
|
|
744
|
+
flatFilteredItems.length,
|
|
745
|
+
setIndices
|
|
746
|
+
]);
|
|
747
|
+
function isSelectedValueDirty(value) {
|
|
748
|
+
const initialValue = validityData.initialValue;
|
|
749
|
+
if (Array.isArray(value) && Array.isArray(initialValue)) return !areArraysEqual(value, initialValue, (itemValue, initialItemValue) => compareItemEquality(itemValue, initialItemValue, isItemEqualToValue));
|
|
750
|
+
return value !== initialValue;
|
|
751
|
+
}
|
|
752
|
+
useValueChanged(query, () => {
|
|
753
|
+
if (!open || query === "" || query === String(initialDefaultInputValue)) return;
|
|
754
|
+
setQueryChangedAfterOpen(true);
|
|
755
|
+
});
|
|
756
|
+
useValueChanged(selectedValue, () => {
|
|
757
|
+
if (selectionMode === "none") return;
|
|
758
|
+
clearErrors(name);
|
|
759
|
+
setDirty(isSelectedValueDirty(selectedValue));
|
|
760
|
+
validation.change(selectedValue);
|
|
761
|
+
if (single && !hasInputValue && !inputInsidePopup) {
|
|
762
|
+
const nextInputValue = stringifyAsLabel(selectedValue, itemToStringLabel);
|
|
763
|
+
if (inputValue !== nextInputValue) setInputValue(nextInputValue, createChangeEventDetails(none));
|
|
764
|
+
}
|
|
765
|
+
});
|
|
766
|
+
useValueChanged(inputValue, () => {
|
|
767
|
+
if (selectionMode !== "none") return;
|
|
768
|
+
clearErrors(name);
|
|
769
|
+
setDirty(inputValue !== validityData.initialValue);
|
|
770
|
+
validation.change(inputValue);
|
|
771
|
+
});
|
|
772
|
+
useValueChanged(items, () => {
|
|
773
|
+
if (!single || hasInputValue || inputInsidePopup || queryChangedAfterOpen) return;
|
|
774
|
+
const nextInputValue = stringifyAsLabel(selectedValue, itemToStringLabel);
|
|
775
|
+
if (inputValue !== nextInputValue) setInputValue(nextInputValue, createChangeEventDetails(none));
|
|
776
|
+
});
|
|
777
|
+
const floatingRootContext = useFloatingRootContext({
|
|
778
|
+
open: inline ? true : open,
|
|
779
|
+
onOpenChange: setOpen,
|
|
780
|
+
elements: {
|
|
781
|
+
reference: inputInsidePopup ? triggerElement : inputElement,
|
|
782
|
+
floating: positionerElement
|
|
783
|
+
}
|
|
784
|
+
});
|
|
785
|
+
let ariaHasPopup;
|
|
786
|
+
let ariaExpanded;
|
|
787
|
+
if (!inline) {
|
|
788
|
+
ariaHasPopup = grid ? "grid" : "listbox";
|
|
789
|
+
ariaExpanded = open ? "true" : "false";
|
|
790
|
+
}
|
|
791
|
+
const role = React$1.useMemo(() => {
|
|
792
|
+
const isPlainInput = inputElement?.tagName === "INPUT";
|
|
793
|
+
const shouldTreatAsInput = inputElement == null || isPlainInput;
|
|
794
|
+
const shouldApplyAria = shouldTreatAsInput || open;
|
|
795
|
+
const reference = shouldTreatAsInput ? {
|
|
796
|
+
autoComplete: "off",
|
|
797
|
+
spellCheck: "false",
|
|
798
|
+
autoCorrect: "off",
|
|
799
|
+
autoCapitalize: "none"
|
|
800
|
+
} : {};
|
|
801
|
+
if (shouldApplyAria) {
|
|
802
|
+
reference.role = "combobox";
|
|
803
|
+
reference["aria-expanded"] = ariaExpanded;
|
|
804
|
+
reference["aria-haspopup"] = ariaHasPopup;
|
|
805
|
+
reference["aria-controls"] = open ? listElement?.id : void 0;
|
|
806
|
+
reference["aria-autocomplete"] = autoComplete;
|
|
807
|
+
}
|
|
808
|
+
return {
|
|
809
|
+
reference,
|
|
810
|
+
floating: { role: "presentation" }
|
|
811
|
+
};
|
|
812
|
+
}, [
|
|
813
|
+
inputElement,
|
|
814
|
+
open,
|
|
815
|
+
ariaExpanded,
|
|
816
|
+
ariaHasPopup,
|
|
817
|
+
listElement?.id,
|
|
818
|
+
autoComplete
|
|
819
|
+
]);
|
|
820
|
+
const click = useClick(floatingRootContext, {
|
|
821
|
+
enabled: !readOnly && !disabled && openOnInputClick,
|
|
822
|
+
event: "mousedown-only",
|
|
823
|
+
toggle: false,
|
|
824
|
+
touchOpenDelay: inputInsidePopup ? 0 : 100,
|
|
825
|
+
reason: inputPress
|
|
826
|
+
});
|
|
827
|
+
const dismiss = useDismiss(floatingRootContext, {
|
|
828
|
+
enabled: !readOnly && !disabled && !inline,
|
|
829
|
+
outsidePressEvent: {
|
|
830
|
+
mouse: "sloppy",
|
|
831
|
+
touch: "intentional"
|
|
832
|
+
},
|
|
833
|
+
bubbles: inline ? true : void 0,
|
|
834
|
+
outsidePress(event) {
|
|
835
|
+
const target = getTarget(event);
|
|
836
|
+
return !contains(triggerElement, target) && !contains(clearRef.current, target) && !contains(chipsContainerRef.current, target) && !contains(inputGroupElement, target);
|
|
837
|
+
}
|
|
838
|
+
});
|
|
839
|
+
const listNavigation = useListNavigation(floatingRootContext, {
|
|
840
|
+
enabled: !readOnly && !disabled,
|
|
841
|
+
id,
|
|
842
|
+
listRef,
|
|
843
|
+
activeIndex,
|
|
844
|
+
selectedIndex,
|
|
845
|
+
virtual: true,
|
|
846
|
+
loopFocus,
|
|
847
|
+
allowEscape: loopFocus && !autoHighlightMode,
|
|
848
|
+
focusItemOnOpen: queryChangedAfterOpen || selectionMode === "none" && !autoHighlightMode ? false : "auto",
|
|
849
|
+
focusItemOnHover: highlightItemOnHover,
|
|
850
|
+
resetOnPointerLeave: !keepHighlight,
|
|
851
|
+
orientation: grid ? "horizontal" : void 0,
|
|
852
|
+
rtl: direction === "rtl",
|
|
853
|
+
disabledIndices: EMPTY_ARRAY,
|
|
854
|
+
grid: grid ? gridNavigation : void 0,
|
|
855
|
+
onNavigate(nextActiveIndex, event) {
|
|
856
|
+
if (!event && !open || transitionStatus === "ending") return;
|
|
857
|
+
if (!event) setIndices({ activeIndex: nextActiveIndex });
|
|
858
|
+
else setIndices({
|
|
859
|
+
activeIndex: nextActiveIndex,
|
|
860
|
+
type: keyboardActiveRef.current ? "keyboard" : "pointer"
|
|
861
|
+
});
|
|
862
|
+
}
|
|
863
|
+
});
|
|
864
|
+
const inputProps = React$1.useMemo(() => mergeProps(listNavigation.reference, { onKeyDown(event) {
|
|
865
|
+
if (grid && store.state.activeIndex == null && (event.key === "ArrowLeft" || event.key === "ArrowRight")) event.preventBaseUIHandler();
|
|
866
|
+
} }, dismiss.reference, click.reference, role.reference), [
|
|
867
|
+
listNavigation.reference,
|
|
868
|
+
dismiss.reference,
|
|
869
|
+
click.reference,
|
|
870
|
+
role.reference,
|
|
871
|
+
grid,
|
|
872
|
+
store
|
|
873
|
+
]);
|
|
874
|
+
const popupProps = React$1.useMemo(() => mergeProps(FOCUSABLE_POPUP_PROPS, listNavigation.floating, dismiss.floating, role.floating), [
|
|
875
|
+
listNavigation.floating,
|
|
876
|
+
dismiss.floating,
|
|
877
|
+
role.floating
|
|
878
|
+
]);
|
|
879
|
+
const itemProps = React$1.useMemo(() => {
|
|
880
|
+
const listNavigationItemProps = listNavigation.item;
|
|
881
|
+
if (!listNavigationItemProps) return EMPTY_OBJECT;
|
|
882
|
+
return {
|
|
883
|
+
...listNavigationItemProps,
|
|
884
|
+
onFocus: void 0
|
|
885
|
+
};
|
|
886
|
+
}, [listNavigation.item]);
|
|
887
|
+
useOnFirstRender(() => {
|
|
888
|
+
store.update({
|
|
889
|
+
inline: inlineProp,
|
|
890
|
+
popupProps,
|
|
891
|
+
inputProps,
|
|
892
|
+
triggerProps,
|
|
893
|
+
itemProps,
|
|
894
|
+
setOpen,
|
|
895
|
+
setInputValue,
|
|
896
|
+
setSelectedValue,
|
|
897
|
+
setIndices,
|
|
898
|
+
onItemHighlighted,
|
|
899
|
+
handleSelection,
|
|
900
|
+
forceMount,
|
|
901
|
+
requestSubmit
|
|
902
|
+
});
|
|
903
|
+
});
|
|
904
|
+
useIsoLayoutEffect(() => {
|
|
905
|
+
store.update({
|
|
906
|
+
id,
|
|
907
|
+
selectedValue,
|
|
908
|
+
open,
|
|
909
|
+
mounted,
|
|
910
|
+
transitionStatus,
|
|
911
|
+
items,
|
|
912
|
+
inline: inlineProp,
|
|
913
|
+
popupProps,
|
|
914
|
+
inputProps,
|
|
915
|
+
triggerProps,
|
|
916
|
+
openMethod,
|
|
917
|
+
itemProps,
|
|
918
|
+
selectionMode,
|
|
919
|
+
name,
|
|
920
|
+
form,
|
|
921
|
+
disabled,
|
|
922
|
+
readOnly,
|
|
923
|
+
required,
|
|
924
|
+
grid,
|
|
925
|
+
isGrouped,
|
|
926
|
+
virtualized,
|
|
927
|
+
onOpenChangeComplete,
|
|
928
|
+
openOnInputClick,
|
|
929
|
+
itemToStringLabel,
|
|
930
|
+
modal,
|
|
931
|
+
autoHighlight: autoHighlightMode,
|
|
932
|
+
isItemEqualToValue,
|
|
933
|
+
submitOnItemClick,
|
|
934
|
+
hasInputValue,
|
|
935
|
+
requestSubmit,
|
|
936
|
+
inputOwnsFormValue: selectionMode === "none" && (inlineProp || !store.state.inputInsidePopup)
|
|
937
|
+
});
|
|
938
|
+
}, [
|
|
939
|
+
store,
|
|
940
|
+
id,
|
|
941
|
+
selectedValue,
|
|
942
|
+
open,
|
|
943
|
+
mounted,
|
|
944
|
+
transitionStatus,
|
|
945
|
+
items,
|
|
946
|
+
popupProps,
|
|
947
|
+
inputProps,
|
|
948
|
+
itemProps,
|
|
949
|
+
openMethod,
|
|
950
|
+
triggerProps,
|
|
951
|
+
selectionMode,
|
|
952
|
+
name,
|
|
953
|
+
disabled,
|
|
954
|
+
readOnly,
|
|
955
|
+
required,
|
|
956
|
+
validation,
|
|
957
|
+
grid,
|
|
958
|
+
isGrouped,
|
|
959
|
+
virtualized,
|
|
960
|
+
onOpenChangeComplete,
|
|
961
|
+
openOnInputClick,
|
|
962
|
+
itemToStringLabel,
|
|
963
|
+
modal,
|
|
964
|
+
isItemEqualToValue,
|
|
965
|
+
submitOnItemClick,
|
|
966
|
+
hasInputValue,
|
|
967
|
+
inlineProp,
|
|
968
|
+
requestSubmit,
|
|
969
|
+
autoHighlightMode,
|
|
970
|
+
form
|
|
971
|
+
]);
|
|
972
|
+
const hiddenInputRef = useMergedRefs(inputRefProp, validation.inputRef);
|
|
973
|
+
const itemsContextValue = React$1.useMemo(() => ({
|
|
974
|
+
query,
|
|
975
|
+
hasItems,
|
|
976
|
+
filteredItems,
|
|
977
|
+
flatFilteredItems
|
|
978
|
+
}), [
|
|
979
|
+
query,
|
|
980
|
+
hasItems,
|
|
981
|
+
filteredItems,
|
|
982
|
+
flatFilteredItems
|
|
983
|
+
]);
|
|
984
|
+
const serializedValue = React$1.useMemo(() => {
|
|
985
|
+
if (Array.isArray(fieldRawValue)) return "";
|
|
986
|
+
return stringifyAsValue(fieldRawValue, itemToStringValue);
|
|
987
|
+
}, [fieldRawValue, itemToStringValue]);
|
|
988
|
+
const hasMultipleSelection = multiple && Array.isArray(selectedValue) && selectedValue.length > 0;
|
|
989
|
+
const hiddenInputName = multiple || selectionMode === "none" && inputOwnsFormValue ? void 0 : name;
|
|
990
|
+
const hiddenInputs = React$1.useMemo(() => {
|
|
991
|
+
if (!multiple || !Array.isArray(selectedValue) || !name) return null;
|
|
992
|
+
return selectedValue.map((value) => {
|
|
993
|
+
const currentSerializedValue = stringifyAsValue(value, itemToStringValue);
|
|
994
|
+
return /*#__PURE__*/ jsx("input", {
|
|
995
|
+
type: "hidden",
|
|
996
|
+
form,
|
|
997
|
+
name,
|
|
998
|
+
value: currentSerializedValue,
|
|
999
|
+
disabled
|
|
1000
|
+
}, currentSerializedValue);
|
|
1001
|
+
});
|
|
1002
|
+
}, [
|
|
1003
|
+
multiple,
|
|
1004
|
+
selectedValue,
|
|
1005
|
+
form,
|
|
1006
|
+
name,
|
|
1007
|
+
itemToStringValue,
|
|
1008
|
+
disabled
|
|
1009
|
+
]);
|
|
1010
|
+
const children = /*#__PURE__*/ jsxs(React$1.Fragment, { children: [
|
|
1011
|
+
props.children,
|
|
1012
|
+
/*#__PURE__*/ jsx("input", {
|
|
1013
|
+
...validation.getValidationProps(disabled, {
|
|
1014
|
+
onFocus() {
|
|
1015
|
+
if (inputInsidePopup) {
|
|
1016
|
+
triggerElement?.focus();
|
|
1017
|
+
return;
|
|
1018
|
+
}
|
|
1019
|
+
(inputRef.current || triggerElement)?.focus();
|
|
1020
|
+
},
|
|
1021
|
+
onChange(event) {
|
|
1022
|
+
if (event.nativeEvent.defaultPrevented || disabled || readOnly) return;
|
|
1023
|
+
const nextValue = event.currentTarget.value;
|
|
1024
|
+
const nextValueLower = nextValue.toLowerCase();
|
|
1025
|
+
const details = createChangeEventDetails(none, event.nativeEvent);
|
|
1026
|
+
const findSerializedMatchIndex = () => valuesRef.current.findIndex((candidate) => stringifyAsValue(candidate, itemToStringValue).toLowerCase() === nextValueLower || stringifyAsLabel(candidate, itemToStringLabel).toLowerCase() === nextValueLower);
|
|
1027
|
+
function handleChange() {
|
|
1028
|
+
if (multiple) return;
|
|
1029
|
+
if (selectionMode === "none") {
|
|
1030
|
+
setInputValue(nextValue, details);
|
|
1031
|
+
return;
|
|
1032
|
+
}
|
|
1033
|
+
let matchingIndex = findSerializedMatchIndex();
|
|
1034
|
+
if (matchingIndex === -1) matchingIndex = valuesRef.current.findIndex((_, index) => {
|
|
1035
|
+
const renderedLabel = labelsRef.current[index];
|
|
1036
|
+
return renderedLabel != null && renderedLabel.toLowerCase() === nextValueLower;
|
|
1037
|
+
});
|
|
1038
|
+
const matchingValue = matchingIndex === -1 ? void 0 : valuesRef.current[matchingIndex];
|
|
1039
|
+
if (matchingValue != null) setSelectedValue?.(matchingValue, details);
|
|
1040
|
+
}
|
|
1041
|
+
if (single) {
|
|
1042
|
+
forceMount();
|
|
1043
|
+
if (items && findSerializedMatchIndex() === -1) store.set("forceMounted", true);
|
|
1044
|
+
}
|
|
1045
|
+
queueMicrotask(handleChange);
|
|
1046
|
+
}
|
|
1047
|
+
}),
|
|
1048
|
+
id: id && hiddenInputName == null ? `${id}-hidden-input` : void 0,
|
|
1049
|
+
form,
|
|
1050
|
+
name: hiddenInputName,
|
|
1051
|
+
autoComplete: formAutoComplete,
|
|
1052
|
+
disabled,
|
|
1053
|
+
required: required && !hasMultipleSelection,
|
|
1054
|
+
readOnly,
|
|
1055
|
+
value: serializedValue,
|
|
1056
|
+
ref: hiddenInputRef,
|
|
1057
|
+
style: hiddenInputName ? visuallyHiddenInput : visuallyHidden,
|
|
1058
|
+
tabIndex: -1,
|
|
1059
|
+
"aria-hidden": true,
|
|
1060
|
+
suppressHydrationWarning: true
|
|
1061
|
+
}),
|
|
1062
|
+
hiddenInputs
|
|
1063
|
+
] });
|
|
1064
|
+
return /*#__PURE__*/ jsx(ComboboxRootContext.Provider, {
|
|
1065
|
+
value: store,
|
|
1066
|
+
children: /*#__PURE__*/ jsx(ComboboxFloatingContext.Provider, {
|
|
1067
|
+
value: floatingRootContext,
|
|
1068
|
+
children: /*#__PURE__*/ jsx(ComboboxHasItemsContext.Provider, {
|
|
1069
|
+
value: hasItems,
|
|
1070
|
+
children: /*#__PURE__*/ jsx(ComboboxDerivedItemsContext.Provider, {
|
|
1071
|
+
value: itemsContextValue,
|
|
1072
|
+
children: /*#__PURE__*/ jsx(ComboboxInputValueContext.Provider, {
|
|
1073
|
+
value: inputValue,
|
|
1074
|
+
children
|
|
1075
|
+
})
|
|
1076
|
+
})
|
|
1077
|
+
})
|
|
1078
|
+
})
|
|
1079
|
+
});
|
|
1080
|
+
}
|
|
1081
|
+
//#endregion
|
|
1082
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.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
|
|
1083
|
+
const triggerStateAttributesMapping = {
|
|
1084
|
+
...pressableTriggerOpenStateMapping,
|
|
1085
|
+
...fieldValidityMapping,
|
|
1086
|
+
popupSide: (side) => side ? { "data-popup-side": side } : null,
|
|
1087
|
+
listEmpty: (empty) => empty ? { "data-list-empty": "" } : null
|
|
1088
|
+
};
|
|
1089
|
+
//#endregion
|
|
1090
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.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
|
|
1091
|
+
const ComboboxChipsContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
1092
|
+
ComboboxChipsContext.displayName = "ComboboxChipsContext";
|
|
1093
|
+
function useComboboxChipsContext() {
|
|
1094
|
+
return React$1.useContext(ComboboxChipsContext);
|
|
1095
|
+
}
|
|
1096
|
+
//#endregion
|
|
1097
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.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
|
|
1098
|
+
const ComboboxPositionerContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
1099
|
+
ComboboxPositionerContext.displayName = "ComboboxPositionerContext";
|
|
1100
|
+
function useComboboxPositionerContext(optional) {
|
|
1101
|
+
const context = React$1.useContext(ComboboxPositionerContext);
|
|
1102
|
+
if (context === void 0 && !optional) throw new Error("Base UI: <Combobox.Popup> and <Combobox.Arrow> must be used within the <Combobox.Positioner> component");
|
|
1103
|
+
return context;
|
|
1104
|
+
}
|
|
1105
|
+
//#endregion
|
|
1106
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.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
|
|
1107
|
+
/**
|
|
1108
|
+
* @internal
|
|
1109
|
+
*/
|
|
1110
|
+
const ComboboxInternalDismissButton = /*#__PURE__*/ React$1.forwardRef(function ComboboxInternalDismissButton(_, forwardedRef) {
|
|
1111
|
+
const store = useComboboxRootContext();
|
|
1112
|
+
const { buttonRef, getButtonProps } = useButton({ native: false });
|
|
1113
|
+
const mergedRef = useMergedRefs(forwardedRef, buttonRef);
|
|
1114
|
+
function handleDismiss(event) {
|
|
1115
|
+
store.state.setOpen(false, createChangeEventDetails(closePress, event.nativeEvent, event.currentTarget));
|
|
1116
|
+
}
|
|
1117
|
+
return /*#__PURE__*/ jsx("span", {
|
|
1118
|
+
ref: mergedRef,
|
|
1119
|
+
...getButtonProps({ onClick: handleDismiss }),
|
|
1120
|
+
"aria-label": "Dismiss",
|
|
1121
|
+
tabIndex: void 0,
|
|
1122
|
+
style: visuallyHiddenInput
|
|
1123
|
+
});
|
|
1124
|
+
});
|
|
1125
|
+
ComboboxInternalDismissButton.displayName = "ComboboxInternalDismissButton";
|
|
1126
|
+
//#endregion
|
|
1127
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.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
|
|
1128
|
+
/**
|
|
1129
|
+
* A text input to search for items in the list.
|
|
1130
|
+
* Renders an `<input>` element.
|
|
1131
|
+
*
|
|
1132
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
1133
|
+
*/
|
|
1134
|
+
const ComboboxInput = /*#__PURE__*/ React$1.forwardRef(function ComboboxInput(componentProps, forwardedRef) {
|
|
1135
|
+
const { render, className, disabled: disabledProp = false, id: idProp, style, ...elementProps } = componentProps;
|
|
1136
|
+
const { state: fieldState, disabled: fieldDisabled, setTouched, setFocused, validationMode, validation } = useFieldRootContext();
|
|
1137
|
+
const { labelId: fieldLabelId } = useLabelableContext();
|
|
1138
|
+
const comboboxChipsContext = useComboboxChipsContext();
|
|
1139
|
+
const positioning = useComboboxPositionerContext(true);
|
|
1140
|
+
const hasPositionerParent = Boolean(positioning);
|
|
1141
|
+
const store = useComboboxRootContext();
|
|
1142
|
+
const { filteredItems } = useComboboxDerivedItemsContext();
|
|
1143
|
+
const inputValue = useComboboxInputValueContext();
|
|
1144
|
+
const direction = useDirection();
|
|
1145
|
+
const required = useStore(store, selectors.required);
|
|
1146
|
+
const comboboxDisabled = useStore(store, selectors.disabled);
|
|
1147
|
+
const readOnly = useStore(store, selectors.readOnly);
|
|
1148
|
+
const name = useStore(store, selectors.name);
|
|
1149
|
+
const form = useStore(store, selectors.form);
|
|
1150
|
+
const selectionMode = useStore(store, selectors.selectionMode);
|
|
1151
|
+
const autoHighlightMode = useStore(store, selectors.autoHighlight);
|
|
1152
|
+
const inputProps = useStore(store, selectors.inputProps);
|
|
1153
|
+
const triggerProps = useStore(store, selectors.triggerProps);
|
|
1154
|
+
const open = useStore(store, selectors.open);
|
|
1155
|
+
const mounted = useStore(store, selectors.mounted);
|
|
1156
|
+
const selectedValue = useStore(store, selectors.selectedValue);
|
|
1157
|
+
const popupSideValue = useStore(store, selectors.popupSide);
|
|
1158
|
+
const positionerElement = useStore(store, selectors.positionerElement);
|
|
1159
|
+
const rootId = useStore(store, selectors.id);
|
|
1160
|
+
const inline = useStore(store, selectors.inline);
|
|
1161
|
+
const modal = useStore(store, selectors.modal);
|
|
1162
|
+
const autoHighlightEnabled = Boolean(autoHighlightMode);
|
|
1163
|
+
const popupSide = mounted && positionerElement ? popupSideValue : null;
|
|
1164
|
+
const disabled = fieldDisabled || comboboxDisabled || disabledProp;
|
|
1165
|
+
const listEmpty = filteredItems.length === 0;
|
|
1166
|
+
const isInsidePopup = hasPositionerParent || inline;
|
|
1167
|
+
const focusManagerModal = !isInsidePopup || modal;
|
|
1168
|
+
const id = useBaseUiId(idProp ?? (!isInsidePopup ? rootId : void 0));
|
|
1169
|
+
const ariaLabelledBy = resolveAriaLabelledBy(fieldLabelId, void 0);
|
|
1170
|
+
const fieldStateForInput = hasPositionerParent ? DEFAULT_FIELD_STATE_ATTRIBUTES : fieldState;
|
|
1171
|
+
const [composingValue, setComposingValue] = React$1.useState(null);
|
|
1172
|
+
const isComposingRef = React$1.useRef(false);
|
|
1173
|
+
const lastActiveIndexRef = React$1.useRef(null);
|
|
1174
|
+
const shouldRestoreActiveIndexRef = React$1.useRef(false);
|
|
1175
|
+
const inputOwnsFormValue = selectionMode === "none" && !hasPositionerParent;
|
|
1176
|
+
const setInputElement = useStableCallback((element) => {
|
|
1177
|
+
const nextIsInsidePopup = hasPositionerParent || store.state.inline;
|
|
1178
|
+
if (nextIsInsidePopup && !store.state.hasInputValue) store.state.setInputValue("", createChangeEventDetails(none));
|
|
1179
|
+
store.update({
|
|
1180
|
+
inputElement: element,
|
|
1181
|
+
inputInsidePopup: nextIsInsidePopup,
|
|
1182
|
+
inputOwnsFormValue
|
|
1183
|
+
});
|
|
1184
|
+
});
|
|
1185
|
+
const validationProps = hasPositionerParent || !validation ? elementProps : validation.getValidationProps(disabled, elementProps);
|
|
1186
|
+
const state = {
|
|
1187
|
+
...fieldStateForInput,
|
|
1188
|
+
open,
|
|
1189
|
+
disabled,
|
|
1190
|
+
readOnly,
|
|
1191
|
+
popupSide,
|
|
1192
|
+
listEmpty
|
|
1193
|
+
};
|
|
1194
|
+
function handleKeyDown(event) {
|
|
1195
|
+
if (!comboboxChipsContext) return;
|
|
1196
|
+
let nextIndex;
|
|
1197
|
+
const { highlightedChipIndex } = comboboxChipsContext;
|
|
1198
|
+
const renderedChipsCount = comboboxChipsContext.chipsRef.current.length;
|
|
1199
|
+
const isRtl = direction === "rtl";
|
|
1200
|
+
const previousChipKey = isRtl ? "ArrowRight" : "ArrowLeft";
|
|
1201
|
+
const nextChipKey = isRtl ? "ArrowLeft" : "ArrowRight";
|
|
1202
|
+
if (highlightedChipIndex !== void 0) {
|
|
1203
|
+
if (event.key === previousChipKey) {
|
|
1204
|
+
event.preventDefault();
|
|
1205
|
+
if (highlightedChipIndex > 0) nextIndex = highlightedChipIndex - 1;
|
|
1206
|
+
else nextIndex = void 0;
|
|
1207
|
+
} else if (event.key === nextChipKey) {
|
|
1208
|
+
event.preventDefault();
|
|
1209
|
+
if (highlightedChipIndex < renderedChipsCount - 1) nextIndex = highlightedChipIndex + 1;
|
|
1210
|
+
else nextIndex = void 0;
|
|
1211
|
+
} else if (event.key === "Backspace" || event.key === "Delete") {
|
|
1212
|
+
event.preventDefault();
|
|
1213
|
+
const computedNextIndex = highlightedChipIndex >= selectedValue.length - 1 ? selectedValue.length - 2 : highlightedChipIndex;
|
|
1214
|
+
nextIndex = computedNextIndex >= 0 ? computedNextIndex : void 0;
|
|
1215
|
+
store.state.setIndices({
|
|
1216
|
+
activeIndex: null,
|
|
1217
|
+
selectedIndex: null,
|
|
1218
|
+
type: "keyboard"
|
|
1219
|
+
});
|
|
1220
|
+
}
|
|
1221
|
+
return nextIndex;
|
|
1222
|
+
}
|
|
1223
|
+
if (event.key === previousChipKey && (event.currentTarget.selectionStart ?? 0) === 0 && selectedValue.length > 0) {
|
|
1224
|
+
event.preventDefault();
|
|
1225
|
+
nextIndex = renderedChipsCount > 0 ? renderedChipsCount - 1 : void 0;
|
|
1226
|
+
} else if (event.key === "Backspace" && event.currentTarget.value === "" && selectedValue.length > 0) {
|
|
1227
|
+
store.state.setIndices({
|
|
1228
|
+
activeIndex: null,
|
|
1229
|
+
selectedIndex: null,
|
|
1230
|
+
type: "keyboard"
|
|
1231
|
+
});
|
|
1232
|
+
event.preventDefault();
|
|
1233
|
+
}
|
|
1234
|
+
return nextIndex;
|
|
1235
|
+
}
|
|
1236
|
+
const element = useRenderElement("input", componentProps, {
|
|
1237
|
+
state,
|
|
1238
|
+
ref: [
|
|
1239
|
+
forwardedRef,
|
|
1240
|
+
store.state.inputRef,
|
|
1241
|
+
setInputElement
|
|
1242
|
+
],
|
|
1243
|
+
props: [
|
|
1244
|
+
inputProps,
|
|
1245
|
+
triggerProps,
|
|
1246
|
+
{
|
|
1247
|
+
type: "text",
|
|
1248
|
+
value: componentProps.value ?? composingValue ?? inputValue,
|
|
1249
|
+
"aria-readonly": readOnly || void 0,
|
|
1250
|
+
"aria-required": required || void 0,
|
|
1251
|
+
"aria-labelledby": ariaLabelledBy,
|
|
1252
|
+
disabled,
|
|
1253
|
+
readOnly,
|
|
1254
|
+
required: selectionMode === "none" ? required : void 0,
|
|
1255
|
+
form,
|
|
1256
|
+
...inputOwnsFormValue && name && { name },
|
|
1257
|
+
id,
|
|
1258
|
+
onFocus() {
|
|
1259
|
+
setFocused(true);
|
|
1260
|
+
if (!inline || !shouldRestoreActiveIndexRef.current) return;
|
|
1261
|
+
shouldRestoreActiveIndexRef.current = false;
|
|
1262
|
+
const nextActiveIndex = lastActiveIndexRef.current;
|
|
1263
|
+
if (nextActiveIndex == null || !Object.hasOwn(store.state.valuesRef.current, nextActiveIndex)) return;
|
|
1264
|
+
store.state.setIndices({ activeIndex: nextActiveIndex });
|
|
1265
|
+
},
|
|
1266
|
+
onBlur() {
|
|
1267
|
+
setTouched(true);
|
|
1268
|
+
setFocused(false);
|
|
1269
|
+
const activeIndex = store.state.activeIndex;
|
|
1270
|
+
if (inline && activeIndex !== null && autoHighlightMode !== "always") {
|
|
1271
|
+
lastActiveIndexRef.current = activeIndex;
|
|
1272
|
+
shouldRestoreActiveIndexRef.current = true;
|
|
1273
|
+
store.state.setIndices({ activeIndex: null });
|
|
1274
|
+
}
|
|
1275
|
+
if (validationMode === "onBlur") {
|
|
1276
|
+
const valueToValidate = selectionMode === "none" ? inputValue : selectedValue;
|
|
1277
|
+
validation.commit(valueToValidate);
|
|
1278
|
+
}
|
|
1279
|
+
},
|
|
1280
|
+
onCompositionStart(event) {
|
|
1281
|
+
if (android) return;
|
|
1282
|
+
isComposingRef.current = true;
|
|
1283
|
+
setComposingValue(event.currentTarget.value);
|
|
1284
|
+
},
|
|
1285
|
+
onCompositionEnd(event) {
|
|
1286
|
+
isComposingRef.current = false;
|
|
1287
|
+
const next = event.currentTarget.value;
|
|
1288
|
+
setComposingValue(null);
|
|
1289
|
+
store.state.setInputValue(next, createChangeEventDetails(inputChange, event.nativeEvent));
|
|
1290
|
+
},
|
|
1291
|
+
onChange(event) {
|
|
1292
|
+
const inputType = event.nativeEvent.inputType;
|
|
1293
|
+
const autofillLikeInput = !inputType || inputType === "insertReplacementText";
|
|
1294
|
+
const shouldOpenOnInput = isComposingRef.current || !autofillLikeInput;
|
|
1295
|
+
if (isComposingRef.current) {
|
|
1296
|
+
const nextVal = event.currentTarget.value;
|
|
1297
|
+
setComposingValue(nextVal);
|
|
1298
|
+
if (nextVal === "" && !store.state.openOnInputClick && !store.state.inputInsidePopup) store.state.setOpen(false, createChangeEventDetails(inputClear, event.nativeEvent));
|
|
1299
|
+
const trimmed = nextVal.trim();
|
|
1300
|
+
const shouldMaintainHighlight = autoHighlightEnabled && trimmed !== "";
|
|
1301
|
+
if (!readOnly && !disabled && trimmed) {
|
|
1302
|
+
if (shouldOpenOnInput) {
|
|
1303
|
+
store.state.setOpen(true, createChangeEventDetails(inputChange, event.nativeEvent));
|
|
1304
|
+
if (!autoHighlightEnabled) store.state.setIndices({
|
|
1305
|
+
activeIndex: null,
|
|
1306
|
+
selectedIndex: null,
|
|
1307
|
+
type: store.state.keyboardActiveRef.current ? "keyboard" : "pointer"
|
|
1308
|
+
});
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
if (open && store.state.activeIndex !== null && !shouldMaintainHighlight) store.state.setIndices({
|
|
1312
|
+
activeIndex: null,
|
|
1313
|
+
selectedIndex: null,
|
|
1314
|
+
type: store.state.keyboardActiveRef.current ? "keyboard" : "pointer"
|
|
1315
|
+
});
|
|
1316
|
+
return;
|
|
1317
|
+
}
|
|
1318
|
+
const inputChangeDetails = createChangeEventDetails(inputChange, event.nativeEvent);
|
|
1319
|
+
store.state.setInputValue(event.currentTarget.value, inputChangeDetails);
|
|
1320
|
+
if (inputChangeDetails.isCanceled) return;
|
|
1321
|
+
const empty = event.currentTarget.value === "";
|
|
1322
|
+
const clearDetails = createChangeEventDetails(inputClear, event.nativeEvent);
|
|
1323
|
+
if (empty && !store.state.inputInsidePopup) {
|
|
1324
|
+
if (selectionMode === "single") store.state.setSelectedValue(null, clearDetails);
|
|
1325
|
+
if (!store.state.openOnInputClick) store.state.setOpen(false, clearDetails);
|
|
1326
|
+
}
|
|
1327
|
+
const trimmed = event.currentTarget.value.trim();
|
|
1328
|
+
if (!readOnly && !disabled && trimmed) {
|
|
1329
|
+
if (shouldOpenOnInput) {
|
|
1330
|
+
store.state.setOpen(true, createChangeEventDetails(inputChange, event.nativeEvent));
|
|
1331
|
+
if (!autoHighlightEnabled) store.state.setIndices({
|
|
1332
|
+
activeIndex: null,
|
|
1333
|
+
selectedIndex: null,
|
|
1334
|
+
type: store.state.keyboardActiveRef.current ? "keyboard" : "pointer"
|
|
1335
|
+
});
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1338
|
+
if (open && store.state.activeIndex !== null && !autoHighlightEnabled) store.state.setIndices({
|
|
1339
|
+
activeIndex: null,
|
|
1340
|
+
selectedIndex: null,
|
|
1341
|
+
type: store.state.keyboardActiveRef.current ? "keyboard" : "pointer"
|
|
1342
|
+
});
|
|
1343
|
+
},
|
|
1344
|
+
onKeyDown(event) {
|
|
1345
|
+
if (disabled || readOnly) return;
|
|
1346
|
+
if (event.ctrlKey || event.shiftKey || event.altKey || event.metaKey) return;
|
|
1347
|
+
store.state.keyboardActiveRef.current = true;
|
|
1348
|
+
const input = event.currentTarget;
|
|
1349
|
+
const scrollAmount = input.scrollWidth - input.clientWidth;
|
|
1350
|
+
const isRTL = direction === "rtl";
|
|
1351
|
+
if (event.key === "Home") {
|
|
1352
|
+
stopEvent(event);
|
|
1353
|
+
const cursor = gecko && isRTL ? input.value.length : 0;
|
|
1354
|
+
input.setSelectionRange(cursor, cursor);
|
|
1355
|
+
input.scrollLeft = 0;
|
|
1356
|
+
return;
|
|
1357
|
+
}
|
|
1358
|
+
if (event.key === "End") {
|
|
1359
|
+
stopEvent(event);
|
|
1360
|
+
const cursor = gecko && isRTL ? 0 : input.value.length;
|
|
1361
|
+
input.setSelectionRange(cursor, cursor);
|
|
1362
|
+
input.scrollLeft = isRTL ? -scrollAmount : scrollAmount;
|
|
1363
|
+
return;
|
|
1364
|
+
}
|
|
1365
|
+
if (!mounted && event.key === "Escape") {
|
|
1366
|
+
const isClear = selectionMode === "multiple" && Array.isArray(selectedValue) ? selectedValue.length === 0 : selectedValue === null;
|
|
1367
|
+
const details = createChangeEventDetails(escapeKey, event.nativeEvent);
|
|
1368
|
+
const value = selectionMode === "multiple" ? [] : null;
|
|
1369
|
+
store.state.setInputValue("", details);
|
|
1370
|
+
store.state.setSelectedValue(value, details);
|
|
1371
|
+
if (!isClear && !store.state.inline && !details.isPropagationAllowed) event.stopPropagation();
|
|
1372
|
+
return;
|
|
1373
|
+
}
|
|
1374
|
+
if (comboboxChipsContext && event.key === "Backspace" && input.value === "" && comboboxChipsContext.highlightedChipIndex === void 0 && Array.isArray(selectedValue) && selectedValue.length > 0) {
|
|
1375
|
+
const renderedChipsCount = comboboxChipsContext.chipsRef.current.length;
|
|
1376
|
+
const removalIndex = renderedChipsCount > 0 ? renderedChipsCount - 1 : selectedValue.length - 1;
|
|
1377
|
+
const newValue = selectedValue.filter((_, index) => index !== removalIndex);
|
|
1378
|
+
store.state.setIndices({
|
|
1379
|
+
activeIndex: null,
|
|
1380
|
+
selectedIndex: null,
|
|
1381
|
+
type: store.state.keyboardActiveRef.current ? "keyboard" : "pointer"
|
|
1382
|
+
});
|
|
1383
|
+
store.state.setSelectedValue(newValue, createChangeEventDetails(none, event.nativeEvent));
|
|
1384
|
+
return;
|
|
1385
|
+
}
|
|
1386
|
+
const hadHighlightedChip = comboboxChipsContext?.highlightedChipIndex !== void 0;
|
|
1387
|
+
const nextIndex = handleKeyDown(event);
|
|
1388
|
+
comboboxChipsContext?.setHighlightedChipIndex(nextIndex);
|
|
1389
|
+
if (nextIndex !== void 0) comboboxChipsContext?.chipsRef.current[nextIndex]?.focus();
|
|
1390
|
+
else if (hadHighlightedChip) store.state.inputRef.current?.focus();
|
|
1391
|
+
if (event.which === 229) return;
|
|
1392
|
+
if (event.key === "Enter" && open) {
|
|
1393
|
+
const activeIndex = store.state.activeIndex;
|
|
1394
|
+
const nativeEvent = event.nativeEvent;
|
|
1395
|
+
if (activeIndex === null) {
|
|
1396
|
+
if (inline) return;
|
|
1397
|
+
store.state.setOpen(false, createChangeEventDetails(none, nativeEvent));
|
|
1398
|
+
return;
|
|
1399
|
+
}
|
|
1400
|
+
stopEvent(event);
|
|
1401
|
+
const listItem = store.state.listRef.current[activeIndex];
|
|
1402
|
+
if (listItem) {
|
|
1403
|
+
store.state.selectionEventRef.current = nativeEvent;
|
|
1404
|
+
listItem.click();
|
|
1405
|
+
store.state.selectionEventRef.current = null;
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1408
|
+
},
|
|
1409
|
+
onPointerMove() {
|
|
1410
|
+
store.state.keyboardActiveRef.current = false;
|
|
1411
|
+
},
|
|
1412
|
+
onPointerDown() {
|
|
1413
|
+
store.state.keyboardActiveRef.current = false;
|
|
1414
|
+
}
|
|
1415
|
+
},
|
|
1416
|
+
validationProps
|
|
1417
|
+
],
|
|
1418
|
+
stateAttributesMapping: triggerStateAttributesMapping
|
|
1419
|
+
});
|
|
1420
|
+
const renderedInput = hasPositionerParent ? /*#__PURE__*/ jsx(FieldRootContext.Provider, {
|
|
1421
|
+
value: DEFAULT_FIELD_ROOT_CONTEXT,
|
|
1422
|
+
children: element
|
|
1423
|
+
}) : element;
|
|
1424
|
+
return /*#__PURE__*/ jsxs(React$1.Fragment, { children: [open && focusManagerModal && /*#__PURE__*/ jsx(ComboboxInternalDismissButton, { ref: store.state.startDismissRef }), renderedInput] });
|
|
1425
|
+
});
|
|
1426
|
+
ComboboxInput.displayName = "ComboboxInput";
|
|
1427
|
+
//#endregion
|
|
1428
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.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
|
|
1429
|
+
const GroupCollectionContext = /*#__PURE__*/ React$1.createContext(null);
|
|
1430
|
+
GroupCollectionContext.displayName = "GroupCollectionContext";
|
|
1431
|
+
function useGroupCollectionContext() {
|
|
1432
|
+
return React$1.useContext(GroupCollectionContext);
|
|
1433
|
+
}
|
|
1434
|
+
function GroupCollectionProvider(props) {
|
|
1435
|
+
const { children, items } = props;
|
|
1436
|
+
const contextValue = React$1.useMemo(() => ({ items }), [items]);
|
|
1437
|
+
return /*#__PURE__*/ jsx(GroupCollectionContext.Provider, {
|
|
1438
|
+
value: contextValue,
|
|
1439
|
+
children
|
|
1440
|
+
});
|
|
1441
|
+
}
|
|
1442
|
+
//#endregion
|
|
1443
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.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
|
|
1444
|
+
/**
|
|
1445
|
+
* Renders filtered list items.
|
|
1446
|
+
* Doesn't render its own HTML element.
|
|
1447
|
+
*
|
|
1448
|
+
* If rendering a flat list, pass a function child to the `List` component instead, which implicitly wraps it.
|
|
1449
|
+
*
|
|
1450
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
1451
|
+
*/
|
|
1452
|
+
function ComboboxCollection(props) {
|
|
1453
|
+
const { children } = props;
|
|
1454
|
+
const { filteredItems } = useComboboxDerivedItemsContext();
|
|
1455
|
+
const groupContext = useGroupCollectionContext();
|
|
1456
|
+
const itemsToRender = groupContext ? groupContext.items : filteredItems;
|
|
1457
|
+
if (!itemsToRender) return null;
|
|
1458
|
+
return /*#__PURE__*/ jsx(React$1.Fragment, { children: itemsToRender.map(children) });
|
|
1459
|
+
}
|
|
1460
|
+
//#endregion
|
|
1461
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.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
|
|
1462
|
+
/**
|
|
1463
|
+
* A list container for the items.
|
|
1464
|
+
* Renders a `<div>` element.
|
|
1465
|
+
*
|
|
1466
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
1467
|
+
*/
|
|
1468
|
+
const ComboboxList = /*#__PURE__*/ React$1.forwardRef(function ComboboxList(componentProps, forwardedRef) {
|
|
1469
|
+
var _ComboboxCollection;
|
|
1470
|
+
const { render, className, style, children, ...elementProps } = componentProps;
|
|
1471
|
+
const store = useComboboxRootContext();
|
|
1472
|
+
const floatingRootContext = useComboboxFloatingContext();
|
|
1473
|
+
const hasPositionerContext = Boolean(useComboboxPositionerContext(true));
|
|
1474
|
+
const { filteredItems, hasItems } = useComboboxDerivedItemsContext();
|
|
1475
|
+
const selectionMode = useStore(store, selectors.selectionMode);
|
|
1476
|
+
const grid = useStore(store, selectors.grid);
|
|
1477
|
+
const popupProps = useStore(store, selectors.popupProps);
|
|
1478
|
+
const virtualized = useStore(store, selectors.virtualized);
|
|
1479
|
+
const forceMounted = useStore(store, selectors.forceMounted);
|
|
1480
|
+
const multiple = selectionMode === "multiple";
|
|
1481
|
+
const empty = filteredItems.length === 0;
|
|
1482
|
+
const setPositionerElement = useStableCallback((element) => {
|
|
1483
|
+
store.set("positionerElement", element);
|
|
1484
|
+
});
|
|
1485
|
+
const setListElement = useStableCallback((element) => {
|
|
1486
|
+
store.set("listElement", element);
|
|
1487
|
+
});
|
|
1488
|
+
const resolvedChildren = React$1.useMemo(() => {
|
|
1489
|
+
if (typeof children === "function") return _ComboboxCollection || (_ComboboxCollection = /*#__PURE__*/ jsx(ComboboxCollection, { children }));
|
|
1490
|
+
return children;
|
|
1491
|
+
}, [children]);
|
|
1492
|
+
const state = { empty };
|
|
1493
|
+
const floatingId = floatingRootContext.useState("floatingId");
|
|
1494
|
+
const element = useRenderElement("div", componentProps, {
|
|
1495
|
+
state,
|
|
1496
|
+
ref: [
|
|
1497
|
+
forwardedRef,
|
|
1498
|
+
setListElement,
|
|
1499
|
+
hasPositionerContext ? null : setPositionerElement
|
|
1500
|
+
],
|
|
1501
|
+
props: [
|
|
1502
|
+
popupProps,
|
|
1503
|
+
{
|
|
1504
|
+
children: resolvedChildren,
|
|
1505
|
+
tabIndex: -1,
|
|
1506
|
+
id: floatingId,
|
|
1507
|
+
role: grid ? "grid" : "listbox",
|
|
1508
|
+
"aria-multiselectable": multiple ? "true" : void 0,
|
|
1509
|
+
onKeyDown(event) {
|
|
1510
|
+
if (store.state.disabled || store.state.readOnly) return;
|
|
1511
|
+
if (event.key === "Enter") {
|
|
1512
|
+
const activeIndex = store.state.activeIndex;
|
|
1513
|
+
if (activeIndex == null) return;
|
|
1514
|
+
stopEvent(event);
|
|
1515
|
+
const nativeEvent = event.nativeEvent;
|
|
1516
|
+
const listItem = store.state.listRef.current[activeIndex];
|
|
1517
|
+
if (listItem) {
|
|
1518
|
+
store.state.selectionEventRef.current = nativeEvent;
|
|
1519
|
+
listItem.click();
|
|
1520
|
+
store.state.selectionEventRef.current = null;
|
|
1521
|
+
}
|
|
1522
|
+
}
|
|
1523
|
+
},
|
|
1524
|
+
onKeyDownCapture() {
|
|
1525
|
+
store.state.keyboardActiveRef.current = true;
|
|
1526
|
+
},
|
|
1527
|
+
onPointerMoveCapture() {
|
|
1528
|
+
store.state.keyboardActiveRef.current = false;
|
|
1529
|
+
}
|
|
1530
|
+
},
|
|
1531
|
+
elementProps
|
|
1532
|
+
]
|
|
1533
|
+
});
|
|
1534
|
+
if (virtualized) return element;
|
|
1535
|
+
const labelsRef = hasItems && !forceMounted ? void 0 : store.state.labelsRef;
|
|
1536
|
+
return /*#__PURE__*/ jsx(CompositeList, {
|
|
1537
|
+
elementsRef: store.state.listRef,
|
|
1538
|
+
labelsRef,
|
|
1539
|
+
children: element
|
|
1540
|
+
});
|
|
1541
|
+
});
|
|
1542
|
+
ComboboxList.displayName = "ComboboxList";
|
|
1543
|
+
//#endregion
|
|
1544
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.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/useInitialLiveRegionTextMutation.mjs
|
|
1545
|
+
const LIVE_REGION_MARKER = "";
|
|
1546
|
+
function findLastTextNode(root) {
|
|
1547
|
+
const walker = root.ownerDocument.createTreeWalker(root, NodeFilter.SHOW_TEXT);
|
|
1548
|
+
let lastTextNode = null;
|
|
1549
|
+
while (walker.nextNode()) {
|
|
1550
|
+
const textNode = walker.currentNode;
|
|
1551
|
+
if (textNode.nodeValue !== "") lastTextNode = textNode;
|
|
1552
|
+
}
|
|
1553
|
+
return lastTextNode;
|
|
1554
|
+
}
|
|
1555
|
+
function useInitialLiveRegionTextMutation() {
|
|
1556
|
+
const timeout = useTimeout();
|
|
1557
|
+
const rootRef = React$1.useRef(null);
|
|
1558
|
+
React$1.useEffect(() => {
|
|
1559
|
+
if (ios) return;
|
|
1560
|
+
const root = rootRef.current;
|
|
1561
|
+
if (root == null) return;
|
|
1562
|
+
const textNode = findLastTextNode(root);
|
|
1563
|
+
if (textNode == null) return;
|
|
1564
|
+
const originalValue = textNode.nodeValue ?? "";
|
|
1565
|
+
const markedValue = `${originalValue}${LIVE_REGION_MARKER}`;
|
|
1566
|
+
textNode.nodeValue = markedValue;
|
|
1567
|
+
timeout.start(200, () => {
|
|
1568
|
+
if (textNode.nodeValue === markedValue) textNode.nodeValue = originalValue;
|
|
1569
|
+
});
|
|
1570
|
+
return () => {
|
|
1571
|
+
timeout.clear();
|
|
1572
|
+
if (textNode.nodeValue === markedValue) textNode.nodeValue = originalValue;
|
|
1573
|
+
};
|
|
1574
|
+
}, [rootRef, timeout]);
|
|
1575
|
+
return rootRef;
|
|
1576
|
+
}
|
|
1577
|
+
//#endregion
|
|
1578
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.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
|
|
1579
|
+
const ComboboxGroupContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
1580
|
+
ComboboxGroupContext.displayName = "ComboboxGroupContext";
|
|
1581
|
+
function useComboboxGroupContext() {
|
|
1582
|
+
const context = React$1.useContext(ComboboxGroupContext);
|
|
1583
|
+
if (context === void 0) throw new Error("Base UI: ComboboxGroupContext is missing. ComboboxGroup parts must be placed within <Combobox.Group>.");
|
|
1584
|
+
return context;
|
|
1585
|
+
}
|
|
1586
|
+
//#endregion
|
|
1587
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.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
|
|
1588
|
+
/**
|
|
1589
|
+
* Groups related items with the corresponding label.
|
|
1590
|
+
* Renders a `<div>` element.
|
|
1591
|
+
*
|
|
1592
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
1593
|
+
*/
|
|
1594
|
+
const ComboboxGroup = /*#__PURE__*/ React$1.forwardRef(function ComboboxGroup(componentProps, forwardedRef) {
|
|
1595
|
+
const { render, className, style, items, ...elementProps } = componentProps;
|
|
1596
|
+
const [labelId, setLabelId] = React$1.useState();
|
|
1597
|
+
const contextValue = React$1.useMemo(() => ({
|
|
1598
|
+
labelId,
|
|
1599
|
+
setLabelId,
|
|
1600
|
+
items
|
|
1601
|
+
}), [
|
|
1602
|
+
labelId,
|
|
1603
|
+
setLabelId,
|
|
1604
|
+
items
|
|
1605
|
+
]);
|
|
1606
|
+
const element = useRenderElement("div", componentProps, {
|
|
1607
|
+
ref: forwardedRef,
|
|
1608
|
+
props: [{
|
|
1609
|
+
role: "group",
|
|
1610
|
+
"aria-labelledby": labelId
|
|
1611
|
+
}, elementProps]
|
|
1612
|
+
});
|
|
1613
|
+
const wrappedElement = /*#__PURE__*/ jsx(ComboboxGroupContext.Provider, {
|
|
1614
|
+
value: contextValue,
|
|
1615
|
+
children: element
|
|
1616
|
+
});
|
|
1617
|
+
if (items) return /*#__PURE__*/ jsx(GroupCollectionProvider, {
|
|
1618
|
+
items,
|
|
1619
|
+
children: wrappedElement
|
|
1620
|
+
});
|
|
1621
|
+
return wrappedElement;
|
|
1622
|
+
});
|
|
1623
|
+
ComboboxGroup.displayName = "ComboboxGroup";
|
|
1624
|
+
//#endregion
|
|
1625
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.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
|
|
1626
|
+
/**
|
|
1627
|
+
* An accessible label that is automatically associated with its parent group.
|
|
1628
|
+
* Renders a `<div>` element.
|
|
1629
|
+
*
|
|
1630
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
1631
|
+
*/
|
|
1632
|
+
const ComboboxGroupLabel = /*#__PURE__*/ React$1.forwardRef(function ComboboxGroupLabel(componentProps, forwardedRef) {
|
|
1633
|
+
const { render, className, style, id: idProp, ...elementProps } = componentProps;
|
|
1634
|
+
const { setLabelId } = useComboboxGroupContext();
|
|
1635
|
+
const id = useBaseUiId(idProp);
|
|
1636
|
+
useIsoLayoutEffect(() => {
|
|
1637
|
+
setLabelId(id);
|
|
1638
|
+
return () => {
|
|
1639
|
+
setLabelId(void 0);
|
|
1640
|
+
};
|
|
1641
|
+
}, [id, setLabelId]);
|
|
1642
|
+
return useRenderElement("div", componentProps, {
|
|
1643
|
+
ref: forwardedRef,
|
|
1644
|
+
props: [{ id }, elementProps]
|
|
1645
|
+
});
|
|
1646
|
+
});
|
|
1647
|
+
ComboboxGroupLabel.displayName = "ComboboxGroupLabel";
|
|
1648
|
+
//#endregion
|
|
1649
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.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
|
|
1650
|
+
const ComboboxItemContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
1651
|
+
ComboboxItemContext.displayName = "ComboboxItemContext";
|
|
1652
|
+
function useComboboxItemContext() {
|
|
1653
|
+
const context = React$1.useContext(ComboboxItemContext);
|
|
1654
|
+
if (!context) throw new Error("Base UI: ComboboxItemContext is missing. ComboboxItem parts must be placed within <Combobox.Item>.");
|
|
1655
|
+
return context;
|
|
1656
|
+
}
|
|
1657
|
+
//#endregion
|
|
1658
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.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
|
|
1659
|
+
const ComboboxRowContext = /*#__PURE__*/ React$1.createContext(false);
|
|
1660
|
+
ComboboxRowContext.displayName = "ComboboxRowContext";
|
|
1661
|
+
function useComboboxRowContext() {
|
|
1662
|
+
return React$1.useContext(ComboboxRowContext);
|
|
1663
|
+
}
|
|
1664
|
+
//#endregion
|
|
1665
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.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
|
|
1666
|
+
function ComboboxItemInner(props) {
|
|
1667
|
+
const { componentProps, forwardedRef, virtualized, indexFromFilter } = props;
|
|
1668
|
+
const { render, className, style, value: itemValue = null, index: indexProp, disabled = false, nativeButton = false, ...elementProps } = componentProps;
|
|
1669
|
+
const didPointerDownRef = React$1.useRef(false);
|
|
1670
|
+
const textRef = React$1.useRef(null);
|
|
1671
|
+
const listItem = useCompositeListItem({
|
|
1672
|
+
index: indexProp,
|
|
1673
|
+
textRef,
|
|
1674
|
+
indexGuessBehavior: IndexGuessBehavior.GuessFromOrder
|
|
1675
|
+
});
|
|
1676
|
+
const store = useComboboxRootContext();
|
|
1677
|
+
const isRow = useComboboxRowContext();
|
|
1678
|
+
const hasItems = useComboboxHasItemsContext();
|
|
1679
|
+
const open = useStore(store, selectors.open);
|
|
1680
|
+
const selectionMode = useStore(store, selectors.selectionMode);
|
|
1681
|
+
const readOnly = useStore(store, selectors.readOnly);
|
|
1682
|
+
const isItemEqualToValue = useStore(store, selectors.isItemEqualToValue);
|
|
1683
|
+
const selectable = selectionMode !== "none";
|
|
1684
|
+
const index = indexProp ?? (virtualized ? indexFromFilter ?? -1 : listItem.index);
|
|
1685
|
+
const hasRegistered = listItem.index !== -1;
|
|
1686
|
+
const rootId = useStore(store, selectors.id);
|
|
1687
|
+
const highlighted = useStore(store, selectors.isActive, index);
|
|
1688
|
+
const matchesSelectedValue = useStore(store, selectors.isSelected, itemValue);
|
|
1689
|
+
const itemProps = useStore(store, selectors.itemProps);
|
|
1690
|
+
const itemRef = React$1.useRef(null);
|
|
1691
|
+
const id = rootId != null && hasRegistered ? `${rootId}-${index}` : void 0;
|
|
1692
|
+
const selected = matchesSelectedValue && selectable;
|
|
1693
|
+
useIsoLayoutEffect(() => {
|
|
1694
|
+
if (!(hasRegistered && (virtualized || indexProp != null))) return;
|
|
1695
|
+
const list = store.state.listRef.current;
|
|
1696
|
+
list[index] = itemRef.current;
|
|
1697
|
+
return () => {
|
|
1698
|
+
delete list[index];
|
|
1699
|
+
};
|
|
1700
|
+
}, [
|
|
1701
|
+
hasRegistered,
|
|
1702
|
+
virtualized,
|
|
1703
|
+
index,
|
|
1704
|
+
indexProp,
|
|
1705
|
+
store
|
|
1706
|
+
]);
|
|
1707
|
+
useIsoLayoutEffect(() => {
|
|
1708
|
+
if (!hasRegistered || hasItems) return;
|
|
1709
|
+
const visibleMap = store.state.valuesRef.current;
|
|
1710
|
+
visibleMap[index] = itemValue;
|
|
1711
|
+
if (selectionMode !== "none") store.state.allValuesRef.current.push(itemValue);
|
|
1712
|
+
return () => {
|
|
1713
|
+
delete visibleMap[index];
|
|
1714
|
+
};
|
|
1715
|
+
}, [
|
|
1716
|
+
hasRegistered,
|
|
1717
|
+
hasItems,
|
|
1718
|
+
index,
|
|
1719
|
+
itemValue,
|
|
1720
|
+
store,
|
|
1721
|
+
selectionMode
|
|
1722
|
+
]);
|
|
1723
|
+
useIsoLayoutEffect(() => {
|
|
1724
|
+
if (!open) {
|
|
1725
|
+
didPointerDownRef.current = false;
|
|
1726
|
+
return;
|
|
1727
|
+
}
|
|
1728
|
+
if (!hasRegistered || hasItems) return;
|
|
1729
|
+
const selectedValue = store.state.selectedValue;
|
|
1730
|
+
const lastSelectedValue = Array.isArray(selectedValue) ? selectedValue[selectedValue.length - 1] : selectedValue;
|
|
1731
|
+
if (compareItemEquality(itemValue, lastSelectedValue, isItemEqualToValue)) store.set("selectedIndex", index);
|
|
1732
|
+
}, [
|
|
1733
|
+
hasRegistered,
|
|
1734
|
+
hasItems,
|
|
1735
|
+
open,
|
|
1736
|
+
store,
|
|
1737
|
+
index,
|
|
1738
|
+
itemValue,
|
|
1739
|
+
isItemEqualToValue
|
|
1740
|
+
]);
|
|
1741
|
+
const { getButtonProps, buttonRef } = useButton({
|
|
1742
|
+
disabled,
|
|
1743
|
+
focusableWhenDisabled: true,
|
|
1744
|
+
native: nativeButton,
|
|
1745
|
+
composite: true
|
|
1746
|
+
});
|
|
1747
|
+
const state = {
|
|
1748
|
+
disabled,
|
|
1749
|
+
selected,
|
|
1750
|
+
highlighted
|
|
1751
|
+
};
|
|
1752
|
+
function commitSelection(nativeEvent) {
|
|
1753
|
+
function selectItem() {
|
|
1754
|
+
store.state.handleSelection(nativeEvent, itemValue);
|
|
1755
|
+
}
|
|
1756
|
+
if (store.state.submitOnItemClick) {
|
|
1757
|
+
ReactDOM.flushSync(selectItem);
|
|
1758
|
+
store.state.requestSubmit();
|
|
1759
|
+
} else selectItem();
|
|
1760
|
+
}
|
|
1761
|
+
const defaultProps = {
|
|
1762
|
+
id,
|
|
1763
|
+
role: isRow ? "gridcell" : "option",
|
|
1764
|
+
"aria-selected": selectable ? selected : void 0,
|
|
1765
|
+
tabIndex: void 0,
|
|
1766
|
+
onPointerDownCapture(event) {
|
|
1767
|
+
didPointerDownRef.current = true;
|
|
1768
|
+
event.preventDefault();
|
|
1769
|
+
},
|
|
1770
|
+
onMouseDown(event) {
|
|
1771
|
+
event.preventDefault();
|
|
1772
|
+
},
|
|
1773
|
+
onClick(event) {
|
|
1774
|
+
if (disabled || readOnly) return;
|
|
1775
|
+
commitSelection(event.nativeEvent);
|
|
1776
|
+
},
|
|
1777
|
+
onMouseUp(event) {
|
|
1778
|
+
const pointerStartedOnItem = didPointerDownRef.current;
|
|
1779
|
+
didPointerDownRef.current = false;
|
|
1780
|
+
if (disabled || readOnly || event.button !== 0 || pointerStartedOnItem || !highlighted) return;
|
|
1781
|
+
commitSelection(event.nativeEvent);
|
|
1782
|
+
}
|
|
1783
|
+
};
|
|
1784
|
+
const element = useRenderElement("div", componentProps, {
|
|
1785
|
+
ref: [
|
|
1786
|
+
buttonRef,
|
|
1787
|
+
forwardedRef,
|
|
1788
|
+
listItem.ref,
|
|
1789
|
+
itemRef
|
|
1790
|
+
],
|
|
1791
|
+
state,
|
|
1792
|
+
props: [
|
|
1793
|
+
itemProps,
|
|
1794
|
+
defaultProps,
|
|
1795
|
+
elementProps,
|
|
1796
|
+
getButtonProps
|
|
1797
|
+
]
|
|
1798
|
+
});
|
|
1799
|
+
const contextValue = React$1.useMemo(() => ({
|
|
1800
|
+
selected,
|
|
1801
|
+
textRef
|
|
1802
|
+
}), [selected, textRef]);
|
|
1803
|
+
return /*#__PURE__*/ jsx(ComboboxItemContext.Provider, {
|
|
1804
|
+
value: contextValue,
|
|
1805
|
+
children: element
|
|
1806
|
+
});
|
|
1807
|
+
}
|
|
1808
|
+
/**
|
|
1809
|
+
* Resolves the index from the filtered items for the virtualized fallback (no `index` prop).
|
|
1810
|
+
* Isolated here so that this per-keystroke subscription to the derived-items context is only
|
|
1811
|
+
* paid by virtualized items. Those re-render on every input change anyway — the parent
|
|
1812
|
+
* virtualizer re-windows the list as the filtered set changes — so the extra subscription costs
|
|
1813
|
+
* them nothing, while it keeps every non-virtualized item off that context.
|
|
1814
|
+
*/
|
|
1815
|
+
function ComboboxItemVirtualizedIndex(props) {
|
|
1816
|
+
const { componentProps, forwardedRef } = props;
|
|
1817
|
+
const isItemEqualToValue = useStore(useComboboxRootContext(), selectors.isItemEqualToValue);
|
|
1818
|
+
const { flatFilteredItems } = useComboboxDerivedItemsContext();
|
|
1819
|
+
return /*#__PURE__*/ jsx(ComboboxItemInner, {
|
|
1820
|
+
componentProps,
|
|
1821
|
+
forwardedRef,
|
|
1822
|
+
virtualized: true,
|
|
1823
|
+
indexFromFilter: findItemIndex(flatFilteredItems, componentProps.value ?? null, isItemEqualToValue)
|
|
1824
|
+
});
|
|
1825
|
+
}
|
|
1826
|
+
/**
|
|
1827
|
+
* An individual item in the list.
|
|
1828
|
+
* Renders a `<div>` element.
|
|
1829
|
+
*
|
|
1830
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
1831
|
+
*/
|
|
1832
|
+
const ComboboxItem = /*#__PURE__*/ React$1.memo(/*#__PURE__*/ React$1.forwardRef(function ComboboxItem(componentProps, forwardedRef) {
|
|
1833
|
+
const virtualized = useStore(useComboboxRootContext(), selectors.virtualized);
|
|
1834
|
+
if (virtualized && componentProps.index == null) return /*#__PURE__*/ jsx(ComboboxItemVirtualizedIndex, {
|
|
1835
|
+
componentProps,
|
|
1836
|
+
forwardedRef
|
|
1837
|
+
});
|
|
1838
|
+
return /*#__PURE__*/ jsx(ComboboxItemInner, {
|
|
1839
|
+
componentProps,
|
|
1840
|
+
forwardedRef,
|
|
1841
|
+
virtualized,
|
|
1842
|
+
indexFromFilter: void 0
|
|
1843
|
+
});
|
|
1844
|
+
}));
|
|
1845
|
+
ComboboxItem.displayName = "ComboboxItem";
|
|
1846
|
+
//#endregion
|
|
1847
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.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
|
|
1848
|
+
/**
|
|
1849
|
+
* Renders its children only when the list is empty.
|
|
1850
|
+
* Requires the `items` prop on the root component.
|
|
1851
|
+
* Announces changes politely to screen readers.
|
|
1852
|
+
* This component's root element must remain mounted in the DOM to announce
|
|
1853
|
+
* changes consistently across screen readers. Avoid hiding or removing the
|
|
1854
|
+
* component itself with `display: none`, `hidden`, `aria-hidden`, or conditional
|
|
1855
|
+
* rendering. Prefer updating or conditionally rendering its children instead.
|
|
1856
|
+
* Renders a `<div>` element.
|
|
1857
|
+
*
|
|
1858
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
1859
|
+
*/
|
|
1860
|
+
const ComboboxEmpty = /*#__PURE__*/ React$1.forwardRef(function ComboboxEmpty(componentProps, forwardedRef) {
|
|
1861
|
+
const { render, className, style, children: childrenProp, ...elementProps } = componentProps;
|
|
1862
|
+
const { filteredItems } = useComboboxDerivedItemsContext();
|
|
1863
|
+
const store = useComboboxRootContext();
|
|
1864
|
+
const emptyRef = useInitialLiveRegionTextMutation();
|
|
1865
|
+
const children = filteredItems.length === 0 ? childrenProp : null;
|
|
1866
|
+
return useRenderElement("div", componentProps, {
|
|
1867
|
+
ref: [
|
|
1868
|
+
forwardedRef,
|
|
1869
|
+
store.state.emptyRef,
|
|
1870
|
+
emptyRef
|
|
1871
|
+
],
|
|
1872
|
+
props: [{
|
|
1873
|
+
children,
|
|
1874
|
+
role: "status",
|
|
1875
|
+
"aria-live": "polite",
|
|
1876
|
+
"aria-atomic": true
|
|
1877
|
+
}, elementProps]
|
|
1878
|
+
});
|
|
1879
|
+
});
|
|
1880
|
+
ComboboxEmpty.displayName = "ComboboxEmpty";
|
|
1881
|
+
//#endregion
|
|
1882
|
+
export { useComboboxFloatingContext as C, useComboboxDerivedItemsContext as S, useComboboxRootContext as T, AriaCombobox as _, ComboboxGroupLabel as a, getComboboxPopupId as b, ComboboxList as c, ComboboxInternalDismissButton as d, ComboboxPositionerContext as f, triggerStateAttributesMapping as g, useComboboxChipsContext as h, useComboboxItemContext as i, ComboboxCollection as l, ComboboxChipsContext as m, ComboboxItem as n, ComboboxGroup as o, useComboboxPositionerContext as p, ComboboxRowContext as r, useInitialLiveRegionTextMutation as s, ComboboxEmpty as t, ComboboxInput as u, useComboboxFilter as v, useComboboxInputValueContext as w, selectors as x, useCoreFilter as y };
|