@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,2464 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-hi7ti5xiuxsegr96.js";
|
|
3
|
+
import { o as EMPTY_OBJECT, r as mergeProps, t as useRenderElement } from "./useRenderElement-m8kc7jyuczp71mq8.js";
|
|
4
|
+
import { h as BASE_UI_SWIPE_IGNORE_SELECTOR, r as popupStateMapping, t as CommonPopupDataAttributes } from "./popupStateMapping-jpzw7eyzl8ghiv8s.js";
|
|
5
|
+
import { n as useIsoLayoutEffect, t as SafeReact } from "./safeReact-bavzz23j5tex60z2.js";
|
|
6
|
+
import { n as useTimeout } from "./useTimeout-oqptmu2xmyv5ccic.js";
|
|
7
|
+
import { D as activeElement, H as android, O as contains, k as getTarget, v as ownerDocument, x as isInteractiveElement } from "./vendor-utils-luqsvbyuig727bnr.js";
|
|
8
|
+
import { C as getParentNode, E as isHTMLElement, T as isElement, w as getWindow, x as getComputedStyle$1 } from "./vendor-floating-ui-dsysdmve7iazaaes.js";
|
|
9
|
+
import { j as swipe, s as closeWatcher, t as createChangeEventDetails } from "./createBaseUIEventDetails-ddivuhl74gni72qn.js";
|
|
10
|
+
import { t as addEventListener } from "./addEventListener-lhqvk2ahlzjsanyg.js";
|
|
11
|
+
import { t as useStableCallback } from "./useStableCallback-ninxmksdjvwl6ejj.js";
|
|
12
|
+
import { n as useAnimationFrame } from "./useAnimationFrame-ssgc72hyq6sg3yit.js";
|
|
13
|
+
import { a as FloatingFocusManager } from "./useScrollLock-lj0spjth12xjeap0.js";
|
|
14
|
+
import { t as useId$1 } from "./useId-l9soitgw3e4jk5ie.js";
|
|
15
|
+
import { i as transitionStatusMapping, r as TransitionStatusDataAttributes, t as useOpenChangeComplete } from "./useOpenChangeComplete-dpkex2e23s1evpol.js";
|
|
16
|
+
import { p as useTriggerRegistration, t as FOCUSABLE_POPUP_PROPS } from "./popupStoreUtils-fpjh6veok5pa2hd1.js";
|
|
17
|
+
import { t as useBaseUiId } from "./useBaseUiId-gqkl5ep5pn6hd0rw.js";
|
|
18
|
+
import { t as error } from "./error-mm98alb8acdy93vq.js";
|
|
19
|
+
import { t as useControlled } from "./useControlled-nlx0kk1ksgk0auvi.js";
|
|
20
|
+
import { a as findScrollableTouchTarget, i as getElementAtPoint, n as getElementTransform, r as useSwipeDismiss, t as getDisplacement } from "./useSwipeDismiss-bpbyw2ihsw3fw6y9.js";
|
|
21
|
+
import { t as clamp } from "./clamp-kvu4wtr1dw6b3pnd.js";
|
|
22
|
+
import { o as COMPOSITE_KEYS } from "./composite-o65hjzwwzb4kvl4w.js";
|
|
23
|
+
import { a as IsDrawerContext, i as useDialogPortalContext, o as useDialogRootContext, r as DialogPortal } from "./useRenderDialogRoot-ecyv072j7yj8q0w3.js";
|
|
24
|
+
import { i as DialogClose, n as DialogTitle, r as DialogDescription, t as DialogTrigger } from "./DialogTrigger-gzxvssie7e5e1iba.js";
|
|
25
|
+
import { t as DialogRoot } from "./DialogRoot-kfhbouiouenljp3q.js";
|
|
26
|
+
import { n as createDialogHandle, r as DialogViewport, t as DialogHandle } from "./DialogHandle-o964gplvp59qqv23.js";
|
|
27
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
28
|
+
import * as React$1 from "react";
|
|
29
|
+
import * as ReactDOM from "react-dom";
|
|
30
|
+
//#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/drawer/popup/DrawerPopupCssVars.mjs
|
|
31
|
+
let DrawerPopupCssVars = /*#__PURE__*/ function(DrawerPopupCssVars) {
|
|
32
|
+
/**
|
|
33
|
+
* The number of nested drawers that are currently open.
|
|
34
|
+
* @type {number}
|
|
35
|
+
*/
|
|
36
|
+
DrawerPopupCssVars["nestedDrawers"] = "--nested-drawers";
|
|
37
|
+
/**
|
|
38
|
+
* The height of the drawer popup.
|
|
39
|
+
* @type {CSS length}
|
|
40
|
+
*/
|
|
41
|
+
DrawerPopupCssVars["height"] = "--drawer-height";
|
|
42
|
+
/**
|
|
43
|
+
* The height of the frontmost open drawer in the current nested drawer stack.
|
|
44
|
+
* @type {CSS length}
|
|
45
|
+
*/
|
|
46
|
+
DrawerPopupCssVars["frontmostHeight"] = "--drawer-frontmost-height";
|
|
47
|
+
/**
|
|
48
|
+
* The swipe movement on the X axis.
|
|
49
|
+
* @type {CSS length}
|
|
50
|
+
*/
|
|
51
|
+
DrawerPopupCssVars["swipeMovementX"] = "--drawer-swipe-movement-x";
|
|
52
|
+
/**
|
|
53
|
+
* The swipe movement on the Y axis.
|
|
54
|
+
* @type {CSS length}
|
|
55
|
+
*/
|
|
56
|
+
DrawerPopupCssVars["swipeMovementY"] = "--drawer-swipe-movement-y";
|
|
57
|
+
/**
|
|
58
|
+
* The snap point offset used for translating the drawer.
|
|
59
|
+
* @type {CSS length}
|
|
60
|
+
*/
|
|
61
|
+
DrawerPopupCssVars["snapPointOffset"] = "--drawer-snap-point-offset";
|
|
62
|
+
/**
|
|
63
|
+
* A scalar (0.1-1) used to scale the swipe release transition duration in CSS.
|
|
64
|
+
* @type {number}
|
|
65
|
+
*/
|
|
66
|
+
DrawerPopupCssVars["swipeStrength"] = "--drawer-swipe-strength";
|
|
67
|
+
return DrawerPopupCssVars;
|
|
68
|
+
}({});
|
|
69
|
+
//#endregion
|
|
70
|
+
//#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/drawer/backdrop/DrawerBackdropCssVars.mjs
|
|
71
|
+
let DrawerBackdropCssVars = /*#__PURE__*/ function(DrawerBackdropCssVars) {
|
|
72
|
+
/**
|
|
73
|
+
* The swipe progress of the drawer gesture.
|
|
74
|
+
* @type {number}
|
|
75
|
+
*/
|
|
76
|
+
DrawerBackdropCssVars["swipeProgress"] = "--drawer-swipe-progress";
|
|
77
|
+
return DrawerBackdropCssVars;
|
|
78
|
+
}({});
|
|
79
|
+
//#endregion
|
|
80
|
+
//#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/drawer/backdrop/DrawerBackdrop.mjs
|
|
81
|
+
const stateAttributesMapping$4 = {
|
|
82
|
+
...popupStateMapping,
|
|
83
|
+
...transitionStatusMapping
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* An overlay displayed beneath the popup.
|
|
87
|
+
* Renders a `<div>` element.
|
|
88
|
+
*
|
|
89
|
+
* Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)
|
|
90
|
+
*/
|
|
91
|
+
const DrawerBackdrop = /*#__PURE__*/ React$1.forwardRef(function DrawerBackdrop(componentProps, forwardedRef) {
|
|
92
|
+
const { render, className, style, forceRender = false, ...elementProps } = componentProps;
|
|
93
|
+
const { store } = useDialogRootContext();
|
|
94
|
+
const open = store.useState("open");
|
|
95
|
+
const nested = store.useState("nested");
|
|
96
|
+
const mounted = store.useState("mounted");
|
|
97
|
+
return useRenderElement("div", componentProps, {
|
|
98
|
+
state: {
|
|
99
|
+
open,
|
|
100
|
+
transitionStatus: store.useState("transitionStatus")
|
|
101
|
+
},
|
|
102
|
+
ref: [store.context.backdropRef, forwardedRef],
|
|
103
|
+
stateAttributesMapping: stateAttributesMapping$4,
|
|
104
|
+
props: [{
|
|
105
|
+
role: "presentation",
|
|
106
|
+
hidden: !mounted,
|
|
107
|
+
style: {
|
|
108
|
+
pointerEvents: !open ? "none" : void 0,
|
|
109
|
+
userSelect: "none",
|
|
110
|
+
WebkitUserSelect: "none",
|
|
111
|
+
[DrawerBackdropCssVars.swipeProgress]: "0",
|
|
112
|
+
[DrawerPopupCssVars.swipeStrength]: "1"
|
|
113
|
+
}
|
|
114
|
+
}, elementProps],
|
|
115
|
+
enabled: forceRender || !nested
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
DrawerBackdrop.displayName = "DrawerBackdrop";
|
|
119
|
+
//#endregion
|
|
120
|
+
//#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/drawer/close/DrawerClose.mjs
|
|
121
|
+
/**
|
|
122
|
+
* A button that closes the drawer.
|
|
123
|
+
* Renders a `<button>` element.
|
|
124
|
+
*
|
|
125
|
+
* Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)
|
|
126
|
+
*/
|
|
127
|
+
const DrawerClose = DialogClose;
|
|
128
|
+
//#endregion
|
|
129
|
+
//#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/drawer/content/DrawerContentDataAttributes.mjs
|
|
130
|
+
const DRAWER_CONTENT_ATTRIBUTE = "data-drawer-content";
|
|
131
|
+
//#endregion
|
|
132
|
+
//#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/drawer/content/DrawerContent.mjs
|
|
133
|
+
/**
|
|
134
|
+
* A container for the drawer contents.
|
|
135
|
+
* Renders a `<div>` element.
|
|
136
|
+
*
|
|
137
|
+
* Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)
|
|
138
|
+
*/
|
|
139
|
+
const DrawerContent = /*#__PURE__*/ React$1.forwardRef(function DrawerContent(componentProps, forwardedRef) {
|
|
140
|
+
const { render, className, style, ...elementProps } = componentProps;
|
|
141
|
+
useDialogRootContext();
|
|
142
|
+
return useRenderElement("div", componentProps, {
|
|
143
|
+
ref: forwardedRef,
|
|
144
|
+
props: [{ [DRAWER_CONTENT_ATTRIBUTE]: "" }, elementProps]
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
DrawerContent.displayName = "DrawerContent";
|
|
148
|
+
//#endregion
|
|
149
|
+
//#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/drawer/description/DrawerDescription.mjs
|
|
150
|
+
/**
|
|
151
|
+
* A paragraph with additional information about the drawer.
|
|
152
|
+
* Renders a `<p>` element.
|
|
153
|
+
*
|
|
154
|
+
* Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)
|
|
155
|
+
*/
|
|
156
|
+
const DrawerDescription = DialogDescription;
|
|
157
|
+
//#endregion
|
|
158
|
+
//#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/drawer/provider/DrawerProviderContext.mjs
|
|
159
|
+
const DrawerProviderContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
160
|
+
DrawerProviderContext.displayName = "DrawerProviderContext";
|
|
161
|
+
function useDrawerProviderContext(optional) {
|
|
162
|
+
const context = React$1.useContext(DrawerProviderContext);
|
|
163
|
+
if (optional === false && context === void 0) throw new Error("Base UI: DrawerProviderContext is missing. Use <Drawer.Provider>.");
|
|
164
|
+
return context;
|
|
165
|
+
}
|
|
166
|
+
//#endregion
|
|
167
|
+
//#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/drawer/indent/DrawerIndent.mjs
|
|
168
|
+
const stateAttributesMapping$3 = { active(value) {
|
|
169
|
+
if (value) return { "data-active": "" };
|
|
170
|
+
return { "data-inactive": "" };
|
|
171
|
+
} };
|
|
172
|
+
/**
|
|
173
|
+
* A wrapper element intended to contain your app's main UI.
|
|
174
|
+
* Applies `data-active` when any drawer within the nearest `<Drawer.Provider>` is open.
|
|
175
|
+
* Renders a `<div>` element.
|
|
176
|
+
*
|
|
177
|
+
* Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)
|
|
178
|
+
*/
|
|
179
|
+
const DrawerIndent = /*#__PURE__*/ React$1.forwardRef(function DrawerIndent(componentProps, forwardedRef) {
|
|
180
|
+
const { render, className, style, ...elementProps } = componentProps;
|
|
181
|
+
const providerContext = useDrawerProviderContext(true);
|
|
182
|
+
const active = providerContext?.active ?? false;
|
|
183
|
+
const visualStateStore = providerContext?.visualStateStore;
|
|
184
|
+
const indentRef = React$1.useRef(null);
|
|
185
|
+
useIsoLayoutEffect(() => {
|
|
186
|
+
const element = indentRef.current;
|
|
187
|
+
if (!element || !visualStateStore) return;
|
|
188
|
+
const syncVisualState = () => {
|
|
189
|
+
const { swipeProgress, frontmostHeight } = visualStateStore.getSnapshot();
|
|
190
|
+
if (swipeProgress <= 0) element.style.setProperty(DrawerBackdropCssVars.swipeProgress, "0");
|
|
191
|
+
else element.style.setProperty(DrawerBackdropCssVars.swipeProgress, `${swipeProgress}`);
|
|
192
|
+
if (frontmostHeight <= 0) element.style.removeProperty(DrawerPopupCssVars.height);
|
|
193
|
+
else element.style.setProperty(DrawerPopupCssVars.height, `${frontmostHeight}px`);
|
|
194
|
+
};
|
|
195
|
+
syncVisualState();
|
|
196
|
+
const unsubscribe = visualStateStore.subscribe(syncVisualState);
|
|
197
|
+
return () => {
|
|
198
|
+
unsubscribe();
|
|
199
|
+
element.style.setProperty(DrawerBackdropCssVars.swipeProgress, "0");
|
|
200
|
+
element.style.removeProperty(DrawerPopupCssVars.height);
|
|
201
|
+
};
|
|
202
|
+
}, [visualStateStore]);
|
|
203
|
+
return useRenderElement("div", componentProps, {
|
|
204
|
+
ref: [forwardedRef, indentRef],
|
|
205
|
+
state: { active },
|
|
206
|
+
props: [{ style: { [DrawerBackdropCssVars.swipeProgress]: "0" } }, elementProps],
|
|
207
|
+
stateAttributesMapping: stateAttributesMapping$3
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
DrawerIndent.displayName = "DrawerIndent";
|
|
211
|
+
//#endregion
|
|
212
|
+
//#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/drawer/indent-background/DrawerIndentBackground.mjs
|
|
213
|
+
const stateAttributesMapping$2 = { active(value) {
|
|
214
|
+
if (value) return { "data-active": "" };
|
|
215
|
+
return { "data-inactive": "" };
|
|
216
|
+
} };
|
|
217
|
+
/**
|
|
218
|
+
* An element placed before `<Drawer.Indent>` to render a background layer that can be styled based on whether any drawer is open.
|
|
219
|
+
* Renders a `<div>` element.
|
|
220
|
+
*
|
|
221
|
+
* Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)
|
|
222
|
+
*/
|
|
223
|
+
const DrawerIndentBackground = /*#__PURE__*/ React$1.forwardRef(function DrawerIndentBackground(componentProps, forwardedRef) {
|
|
224
|
+
const { render, className, style, ...elementProps } = componentProps;
|
|
225
|
+
return useRenderElement("div", componentProps, {
|
|
226
|
+
ref: forwardedRef,
|
|
227
|
+
state: { active: useDrawerProviderContext(true)?.active ?? false },
|
|
228
|
+
props: elementProps,
|
|
229
|
+
stateAttributesMapping: stateAttributesMapping$2
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
DrawerIndentBackground.displayName = "DrawerIndentBackground";
|
|
233
|
+
//#endregion
|
|
234
|
+
//#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/drawer/popup/DrawerPopupDataAttributes.mjs
|
|
235
|
+
let DrawerPopupDataAttributes = function(DrawerPopupDataAttributes) {
|
|
236
|
+
/**
|
|
237
|
+
* Present when the drawer is open.
|
|
238
|
+
*/
|
|
239
|
+
DrawerPopupDataAttributes[DrawerPopupDataAttributes["open"] = CommonPopupDataAttributes.open] = "open";
|
|
240
|
+
/**
|
|
241
|
+
* Present when the drawer is closed.
|
|
242
|
+
*/
|
|
243
|
+
DrawerPopupDataAttributes[DrawerPopupDataAttributes["closed"] = CommonPopupDataAttributes.closed] = "closed";
|
|
244
|
+
/**
|
|
245
|
+
* Present when the drawer is animating in.
|
|
246
|
+
*/
|
|
247
|
+
DrawerPopupDataAttributes[DrawerPopupDataAttributes["startingStyle"] = CommonPopupDataAttributes.startingStyle] = "startingStyle";
|
|
248
|
+
/**
|
|
249
|
+
* Present when the drawer is animating out.
|
|
250
|
+
*/
|
|
251
|
+
DrawerPopupDataAttributes[DrawerPopupDataAttributes["endingStyle"] = CommonPopupDataAttributes.endingStyle] = "endingStyle";
|
|
252
|
+
/**
|
|
253
|
+
* Present when the drawer is at the expanded (full-height) snap point.
|
|
254
|
+
*/
|
|
255
|
+
DrawerPopupDataAttributes["expanded"] = "data-expanded";
|
|
256
|
+
/**
|
|
257
|
+
* Present when a nested drawer is open.
|
|
258
|
+
*/
|
|
259
|
+
DrawerPopupDataAttributes["nestedDrawerOpen"] = "data-nested-drawer-open";
|
|
260
|
+
/**
|
|
261
|
+
* Present when a nested drawer is being swiped.
|
|
262
|
+
*/
|
|
263
|
+
DrawerPopupDataAttributes["nestedDrawerSwiping"] = "data-nested-drawer-swiping";
|
|
264
|
+
/**
|
|
265
|
+
* Present when the drawer is dismissed by swiping.
|
|
266
|
+
*/
|
|
267
|
+
DrawerPopupDataAttributes["swipeDismiss"] = "data-swipe-dismiss";
|
|
268
|
+
/**
|
|
269
|
+
* Indicates the swipe direction.
|
|
270
|
+
* @type {'up' | 'down' | 'left' | 'right'}
|
|
271
|
+
*/
|
|
272
|
+
DrawerPopupDataAttributes["swipeDirection"] = "data-swipe-direction";
|
|
273
|
+
/**
|
|
274
|
+
* Present when the drawer is being swiped.
|
|
275
|
+
*/
|
|
276
|
+
DrawerPopupDataAttributes["swiping"] = "data-swiping";
|
|
277
|
+
return DrawerPopupDataAttributes;
|
|
278
|
+
}({});
|
|
279
|
+
//#endregion
|
|
280
|
+
//#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/drawer/root/DrawerRootContext.mjs
|
|
281
|
+
const DrawerRootContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
282
|
+
DrawerRootContext.displayName = "DrawerRootContext";
|
|
283
|
+
function useDrawerRootContext(optional) {
|
|
284
|
+
const drawerRootContext = React$1.useContext(DrawerRootContext);
|
|
285
|
+
if (optional === false && drawerRootContext === void 0) throw new Error("Base UI: DrawerRootContext is missing. Drawer parts must be placed within <Drawer.Root>.");
|
|
286
|
+
return drawerRootContext;
|
|
287
|
+
}
|
|
288
|
+
//#endregion
|
|
289
|
+
//#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/drawer/root/useDrawerSnapPoints.mjs
|
|
290
|
+
/**
|
|
291
|
+
* Resolves the vertical swipe movement for a snap point, applying square-root damping once the drag
|
|
292
|
+
* overshoots the fully-open edge (`nextOffset < 0`) so the popup resists travelling past it.
|
|
293
|
+
*/
|
|
294
|
+
function getSnapPointSwipeMovement(baseOffset, movementValue) {
|
|
295
|
+
const nextOffset = baseOffset + movementValue;
|
|
296
|
+
if (nextOffset >= 0) return movementValue;
|
|
297
|
+
return -Math.sqrt(-nextOffset) - baseOffset;
|
|
298
|
+
}
|
|
299
|
+
function resolveSnapPointValue(snapPoint, viewportHeight, rootFontSize) {
|
|
300
|
+
if (!Number.isFinite(viewportHeight) || viewportHeight <= 0) return null;
|
|
301
|
+
if (typeof snapPoint === "number") {
|
|
302
|
+
if (!Number.isFinite(snapPoint)) return null;
|
|
303
|
+
if (snapPoint <= 1) return clamp(snapPoint, 0, 1) * viewportHeight;
|
|
304
|
+
return snapPoint;
|
|
305
|
+
}
|
|
306
|
+
const trimmed = snapPoint.trim();
|
|
307
|
+
if (trimmed.endsWith("px")) {
|
|
308
|
+
const value = Number.parseFloat(trimmed);
|
|
309
|
+
return Number.isFinite(value) ? value : null;
|
|
310
|
+
}
|
|
311
|
+
if (trimmed.endsWith("rem")) {
|
|
312
|
+
const value = Number.parseFloat(trimmed);
|
|
313
|
+
return Number.isFinite(value) ? value * rootFontSize : null;
|
|
314
|
+
}
|
|
315
|
+
return null;
|
|
316
|
+
}
|
|
317
|
+
function findClosestSnapPoint(height, points) {
|
|
318
|
+
let closest = null;
|
|
319
|
+
let closestDistance = Infinity;
|
|
320
|
+
for (const point of points) {
|
|
321
|
+
const distance = Math.abs(point.height - height);
|
|
322
|
+
if (distance < closestDistance) {
|
|
323
|
+
closestDistance = distance;
|
|
324
|
+
closest = point;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
return closest;
|
|
328
|
+
}
|
|
329
|
+
function useDrawerSnapPoints() {
|
|
330
|
+
const { store } = useDialogRootContext();
|
|
331
|
+
const { snapPoints, activeSnapPoint, setActiveSnapPoint, popupHeight } = useDrawerRootContext();
|
|
332
|
+
const viewportElement = store.useState("viewportElement");
|
|
333
|
+
const [viewportHeight, setViewportHeight] = React$1.useState(0);
|
|
334
|
+
const [rootFontSize, setRootFontSize] = React$1.useState(16);
|
|
335
|
+
const measureViewportHeight = useStableCallback(() => {
|
|
336
|
+
const html = ownerDocument(viewportElement).documentElement;
|
|
337
|
+
if (viewportElement) setViewportHeight(viewportElement.offsetHeight);
|
|
338
|
+
if (!viewportElement) setViewportHeight(html.clientHeight);
|
|
339
|
+
const fontSize = parseFloat(getComputedStyle(html).fontSize);
|
|
340
|
+
if (Number.isFinite(fontSize)) setRootFontSize(fontSize);
|
|
341
|
+
});
|
|
342
|
+
useIsoLayoutEffect(() => {
|
|
343
|
+
measureViewportHeight();
|
|
344
|
+
if (!viewportElement || typeof ResizeObserver !== "function") return;
|
|
345
|
+
const resizeObserver = new ResizeObserver(measureViewportHeight);
|
|
346
|
+
resizeObserver.observe(viewportElement);
|
|
347
|
+
return () => {
|
|
348
|
+
resizeObserver.disconnect();
|
|
349
|
+
};
|
|
350
|
+
}, [measureViewportHeight, viewportElement]);
|
|
351
|
+
const resolvedSnapPoints = React$1.useMemo(() => {
|
|
352
|
+
if (!snapPoints || snapPoints.length === 0 || viewportHeight <= 0 || popupHeight <= 0) return [];
|
|
353
|
+
const maxHeight = Math.min(popupHeight, viewportHeight);
|
|
354
|
+
if (!Number.isFinite(maxHeight) || maxHeight <= 0) return [];
|
|
355
|
+
const resolved = snapPoints.map((value) => {
|
|
356
|
+
const resolvedHeight = resolveSnapPointValue(value, viewportHeight, rootFontSize);
|
|
357
|
+
if (resolvedHeight === null || !Number.isFinite(resolvedHeight)) return null;
|
|
358
|
+
const clampedHeight = clamp(resolvedHeight, 0, maxHeight);
|
|
359
|
+
return {
|
|
360
|
+
value,
|
|
361
|
+
height: clampedHeight,
|
|
362
|
+
offset: Math.max(0, popupHeight - clampedHeight)
|
|
363
|
+
};
|
|
364
|
+
}).filter((point) => Boolean(point));
|
|
365
|
+
if (resolved.length <= 1) return resolved;
|
|
366
|
+
const deduped = [];
|
|
367
|
+
const seenHeights = [];
|
|
368
|
+
for (let index = resolved.length - 1; index >= 0; index -= 1) {
|
|
369
|
+
const point = resolved[index];
|
|
370
|
+
if (seenHeights.some((height) => Math.abs(height - point.height) <= 1)) continue;
|
|
371
|
+
seenHeights.push(point.height);
|
|
372
|
+
deduped.push(point);
|
|
373
|
+
}
|
|
374
|
+
deduped.reverse();
|
|
375
|
+
return deduped;
|
|
376
|
+
}, [
|
|
377
|
+
popupHeight,
|
|
378
|
+
rootFontSize,
|
|
379
|
+
snapPoints,
|
|
380
|
+
viewportHeight
|
|
381
|
+
]);
|
|
382
|
+
return {
|
|
383
|
+
snapPoints,
|
|
384
|
+
activeSnapPoint,
|
|
385
|
+
setActiveSnapPoint,
|
|
386
|
+
popupHeight,
|
|
387
|
+
viewportHeight,
|
|
388
|
+
resolvedSnapPoints,
|
|
389
|
+
activeSnapPointOffset: React$1.useMemo(() => {
|
|
390
|
+
if (activeSnapPoint === void 0) return resolvedSnapPoints[0];
|
|
391
|
+
if (activeSnapPoint === null) return;
|
|
392
|
+
const exactMatch = resolvedSnapPoints.find((point) => Object.is(point.value, activeSnapPoint));
|
|
393
|
+
if (exactMatch) return exactMatch;
|
|
394
|
+
const maxHeight = Math.min(popupHeight, viewportHeight);
|
|
395
|
+
const resolvedHeight = resolveSnapPointValue(activeSnapPoint, viewportHeight, rootFontSize);
|
|
396
|
+
if (resolvedHeight === null || !Number.isFinite(resolvedHeight)) return;
|
|
397
|
+
return findClosestSnapPoint(clamp(resolvedHeight, 0, maxHeight), resolvedSnapPoints) ?? void 0;
|
|
398
|
+
}, [
|
|
399
|
+
activeSnapPoint,
|
|
400
|
+
popupHeight,
|
|
401
|
+
resolvedSnapPoints,
|
|
402
|
+
rootFontSize,
|
|
403
|
+
viewportHeight
|
|
404
|
+
])?.offset ?? null
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
//#endregion
|
|
408
|
+
//#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/drawer/viewport/DrawerViewportContext.mjs
|
|
409
|
+
const DrawerViewportContext = /*#__PURE__*/ React$1.createContext(null);
|
|
410
|
+
DrawerViewportContext.displayName = "DrawerViewportContext";
|
|
411
|
+
function useDrawerViewportContext(optional) {
|
|
412
|
+
const context = React$1.useContext(DrawerViewportContext);
|
|
413
|
+
if (optional === false && context === null) throw new Error("Base UI: DrawerViewportContext is missing. Drawer parts must be placed within <Drawer.Viewport>.");
|
|
414
|
+
return context;
|
|
415
|
+
}
|
|
416
|
+
//#endregion
|
|
417
|
+
//#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/drawer/popup/DrawerPopup.mjs
|
|
418
|
+
let drawerSwipeVarsRegistered = false;
|
|
419
|
+
/**
|
|
420
|
+
* Removes inheritance of high-frequency drawer swipe CSS variables, which
|
|
421
|
+
* reduces style recalculation cost in complex drawers with deep subtrees.
|
|
422
|
+
* See https://motion.dev/blog/web-animation-performance-tier-list
|
|
423
|
+
* under the "Improving CSS variable performance" section.
|
|
424
|
+
*/
|
|
425
|
+
function removeCSSVariableInheritance() {
|
|
426
|
+
if (drawerSwipeVarsRegistered) return;
|
|
427
|
+
if (typeof CSS !== "undefined" && "registerProperty" in CSS) {
|
|
428
|
+
[
|
|
429
|
+
DrawerPopupCssVars.swipeMovementX,
|
|
430
|
+
DrawerPopupCssVars.swipeMovementY,
|
|
431
|
+
DrawerPopupCssVars.snapPointOffset
|
|
432
|
+
].forEach((name) => {
|
|
433
|
+
try {
|
|
434
|
+
CSS.registerProperty({
|
|
435
|
+
name,
|
|
436
|
+
syntax: "<length>",
|
|
437
|
+
inherits: false,
|
|
438
|
+
initialValue: "0px"
|
|
439
|
+
});
|
|
440
|
+
} catch {}
|
|
441
|
+
});
|
|
442
|
+
[{
|
|
443
|
+
name: DrawerBackdropCssVars.swipeProgress,
|
|
444
|
+
initialValue: "0"
|
|
445
|
+
}, {
|
|
446
|
+
name: DrawerPopupCssVars.swipeStrength,
|
|
447
|
+
initialValue: "1"
|
|
448
|
+
}].forEach(({ name, initialValue }) => {
|
|
449
|
+
try {
|
|
450
|
+
CSS.registerProperty({
|
|
451
|
+
name,
|
|
452
|
+
syntax: "<number>",
|
|
453
|
+
inherits: false,
|
|
454
|
+
initialValue
|
|
455
|
+
});
|
|
456
|
+
} catch {}
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
drawerSwipeVarsRegistered = true;
|
|
460
|
+
}
|
|
461
|
+
const stateAttributesMapping$1 = {
|
|
462
|
+
...popupStateMapping,
|
|
463
|
+
...transitionStatusMapping,
|
|
464
|
+
expanded(value) {
|
|
465
|
+
return value ? { [DrawerPopupDataAttributes.expanded]: "" } : null;
|
|
466
|
+
},
|
|
467
|
+
nestedDrawerOpen(value) {
|
|
468
|
+
return value ? { [DrawerPopupDataAttributes.nestedDrawerOpen]: "" } : null;
|
|
469
|
+
},
|
|
470
|
+
nestedDrawerSwiping(value) {
|
|
471
|
+
return value ? { [DrawerPopupDataAttributes.nestedDrawerSwiping]: "" } : null;
|
|
472
|
+
},
|
|
473
|
+
swipeDirection(value) {
|
|
474
|
+
return value ? { [DrawerPopupDataAttributes.swipeDirection]: value } : null;
|
|
475
|
+
},
|
|
476
|
+
swiping(value) {
|
|
477
|
+
return value ? { [DrawerPopupDataAttributes.swiping]: "" } : null;
|
|
478
|
+
}
|
|
479
|
+
};
|
|
480
|
+
/**
|
|
481
|
+
* A container for the drawer contents.
|
|
482
|
+
* Renders a `<div>` element.
|
|
483
|
+
*
|
|
484
|
+
* Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)
|
|
485
|
+
*/
|
|
486
|
+
const DrawerPopup = /*#__PURE__*/ React$1.forwardRef(function DrawerPopup(componentProps, forwardedRef) {
|
|
487
|
+
const { render, className, style, finalFocus, initialFocus, ...elementProps } = componentProps;
|
|
488
|
+
const { store } = useDialogRootContext();
|
|
489
|
+
const popupRef = store.context.popupRef;
|
|
490
|
+
const { swipeDirection, frontmostHeight, hasNestedDrawer, nestedSwiping, nestedSwipeProgressStore, onPopupHeightChange, notifyParentFrontmostHeight, notifyParentHasNestedDrawer } = useDrawerRootContext();
|
|
491
|
+
const descriptionElementId = store.useState("descriptionElementId");
|
|
492
|
+
const disablePointerDismissal = store.useState("disablePointerDismissal");
|
|
493
|
+
const floatingRootContext = store.useState("floatingRootContext");
|
|
494
|
+
const rootPopupProps = store.useState("popupProps");
|
|
495
|
+
const modal = store.useState("modal");
|
|
496
|
+
const mounted = store.useState("mounted");
|
|
497
|
+
const nested = store.useState("nested");
|
|
498
|
+
const nestedOpenDrawerCount = store.useState("nestedOpenDrawerCount");
|
|
499
|
+
const transitionStatus = store.useState("transitionStatus");
|
|
500
|
+
const open = store.useState("open");
|
|
501
|
+
const openMethod = store.useState("openMethod");
|
|
502
|
+
const titleElementId = store.useState("titleElementId");
|
|
503
|
+
const role = store.useState("role");
|
|
504
|
+
const floatingId = floatingRootContext.useState("floatingId");
|
|
505
|
+
const popupId = elementProps.id ?? floatingId;
|
|
506
|
+
const swipe = useDrawerViewportContext(true);
|
|
507
|
+
useDialogPortalContext();
|
|
508
|
+
const { snapPoints, activeSnapPoint, activeSnapPointOffset } = useDrawerSnapPoints();
|
|
509
|
+
const nestedDrawerOpen = nestedOpenDrawerCount > 0;
|
|
510
|
+
const swiping = swipe?.swiping ?? false;
|
|
511
|
+
const swipeStrength = swipe?.swipeStrength ?? null;
|
|
512
|
+
const [popupHeight, setPopupHeight] = React$1.useState(0);
|
|
513
|
+
const popupHeightRef = React$1.useRef(0);
|
|
514
|
+
React$1.useEffect(() => {
|
|
515
|
+
if (swipe) return;
|
|
516
|
+
error(`<Drawer.Popup> expected to be rendered within <Drawer.Viewport>. Omitting the viewport disables drawer swipe handling and touch scroll locking. Wrap <Drawer.Popup> in <Drawer.Viewport>.${SafeReact.captureOwnerStack?.() || ""}`);
|
|
517
|
+
}, [swipe]);
|
|
518
|
+
const measureHeight = useStableCallback(() => {
|
|
519
|
+
const popupElement = popupRef.current;
|
|
520
|
+
if (!popupElement) return;
|
|
521
|
+
const offsetHeight = popupElement.offsetHeight;
|
|
522
|
+
if (popupHeightRef.current > 0 && frontmostHeight > popupHeightRef.current && offsetHeight > popupHeightRef.current) return;
|
|
523
|
+
if (popupHeightRef.current > 0 && hasNestedDrawer) {
|
|
524
|
+
const oldHeight = popupHeightRef.current;
|
|
525
|
+
setPopupHeight(oldHeight);
|
|
526
|
+
onPopupHeightChange(oldHeight);
|
|
527
|
+
return;
|
|
528
|
+
}
|
|
529
|
+
const nextHeight = offsetHeight;
|
|
530
|
+
if (nextHeight === popupHeightRef.current) return;
|
|
531
|
+
popupHeightRef.current = nextHeight;
|
|
532
|
+
setPopupHeight(nextHeight);
|
|
533
|
+
onPopupHeightChange(nextHeight);
|
|
534
|
+
});
|
|
535
|
+
useIsoLayoutEffect(() => {
|
|
536
|
+
if (!mounted) {
|
|
537
|
+
popupHeightRef.current = 0;
|
|
538
|
+
setPopupHeight(0);
|
|
539
|
+
onPopupHeightChange(0);
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
const popupElement = popupRef.current;
|
|
543
|
+
if (!popupElement) return;
|
|
544
|
+
removeCSSVariableInheritance();
|
|
545
|
+
measureHeight();
|
|
546
|
+
if (typeof ResizeObserver !== "function") return;
|
|
547
|
+
const resizeObserver = new ResizeObserver(measureHeight);
|
|
548
|
+
resizeObserver.observe(popupElement);
|
|
549
|
+
return () => {
|
|
550
|
+
resizeObserver.disconnect();
|
|
551
|
+
};
|
|
552
|
+
}, [
|
|
553
|
+
measureHeight,
|
|
554
|
+
mounted,
|
|
555
|
+
nestedDrawerOpen,
|
|
556
|
+
onPopupHeightChange,
|
|
557
|
+
popupRef
|
|
558
|
+
]);
|
|
559
|
+
useIsoLayoutEffect(() => {
|
|
560
|
+
const syncNestedSwipeProgress = () => {
|
|
561
|
+
const popupElement = popupRef.current;
|
|
562
|
+
if (!popupElement) return;
|
|
563
|
+
const progress = nestedSwipeProgressStore.getSnapshot();
|
|
564
|
+
if (progress > 0) popupElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, `${progress}`);
|
|
565
|
+
else popupElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, "0");
|
|
566
|
+
};
|
|
567
|
+
syncNestedSwipeProgress();
|
|
568
|
+
const unsubscribe = nestedSwipeProgressStore.subscribe(syncNestedSwipeProgress);
|
|
569
|
+
const popupElement = popupRef.current;
|
|
570
|
+
return () => {
|
|
571
|
+
unsubscribe();
|
|
572
|
+
if (popupElement) popupElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, "0");
|
|
573
|
+
};
|
|
574
|
+
}, [nestedSwipeProgressStore, popupRef]);
|
|
575
|
+
React$1.useEffect(() => {
|
|
576
|
+
if (!open) return;
|
|
577
|
+
notifyParentFrontmostHeight?.(frontmostHeight);
|
|
578
|
+
return () => {
|
|
579
|
+
notifyParentFrontmostHeight?.(0);
|
|
580
|
+
};
|
|
581
|
+
}, [
|
|
582
|
+
frontmostHeight,
|
|
583
|
+
open,
|
|
584
|
+
notifyParentFrontmostHeight
|
|
585
|
+
]);
|
|
586
|
+
React$1.useEffect(() => {
|
|
587
|
+
if (!notifyParentHasNestedDrawer) return;
|
|
588
|
+
notifyParentHasNestedDrawer(open || transitionStatus === "ending");
|
|
589
|
+
return () => {
|
|
590
|
+
notifyParentHasNestedDrawer(false);
|
|
591
|
+
};
|
|
592
|
+
}, [
|
|
593
|
+
notifyParentHasNestedDrawer,
|
|
594
|
+
open,
|
|
595
|
+
transitionStatus
|
|
596
|
+
]);
|
|
597
|
+
useOpenChangeComplete({
|
|
598
|
+
open,
|
|
599
|
+
ref: popupRef,
|
|
600
|
+
onComplete() {
|
|
601
|
+
if (open) store.context.onOpenChangeComplete?.(true);
|
|
602
|
+
}
|
|
603
|
+
});
|
|
604
|
+
const resolvedInitialFocus = initialFocus === void 0 ? popupRef : initialFocus;
|
|
605
|
+
const setPopupElement = store.useStateSetter("popupElement");
|
|
606
|
+
const state = {
|
|
607
|
+
open,
|
|
608
|
+
nested,
|
|
609
|
+
transitionStatus,
|
|
610
|
+
expanded: activeSnapPoint === 1,
|
|
611
|
+
nestedDrawerOpen,
|
|
612
|
+
nestedDrawerSwiping: nestedSwiping,
|
|
613
|
+
swipeDirection,
|
|
614
|
+
swiping
|
|
615
|
+
};
|
|
616
|
+
let popupHeightCssVarValue;
|
|
617
|
+
if (popupHeight && !(!hasNestedDrawer && transitionStatus !== "ending")) popupHeightCssVarValue = `${popupHeight}px`;
|
|
618
|
+
const shouldApplySnapPoints = snapPoints && snapPoints.length > 0 && (swipeDirection === "down" || swipeDirection === "up");
|
|
619
|
+
let snapPointOffsetValue = null;
|
|
620
|
+
if (shouldApplySnapPoints && activeSnapPointOffset !== null) snapPointOffsetValue = swipeDirection === "up" ? -activeSnapPointOffset : activeSnapPointOffset;
|
|
621
|
+
let dragStyles = swipe ? swipe.getDragStyles() : EMPTY_OBJECT;
|
|
622
|
+
if (shouldApplySnapPoints && swipeDirection === "down") {
|
|
623
|
+
const baseOffset = activeSnapPointOffset ?? 0;
|
|
624
|
+
const movementValue = Number.parseFloat(String(dragStyles[DrawerPopupCssVars.swipeMovementY] ?? 0));
|
|
625
|
+
if (swiping && Number.isFinite(movementValue)) dragStyles = {
|
|
626
|
+
...dragStyles,
|
|
627
|
+
transform: void 0,
|
|
628
|
+
[DrawerPopupCssVars.swipeMovementY]: `${getSnapPointSwipeMovement(baseOffset, movementValue)}px`
|
|
629
|
+
};
|
|
630
|
+
else dragStyles = {
|
|
631
|
+
...dragStyles,
|
|
632
|
+
transform: void 0
|
|
633
|
+
};
|
|
634
|
+
}
|
|
635
|
+
const element = useRenderElement("div", componentProps, {
|
|
636
|
+
state,
|
|
637
|
+
props: [
|
|
638
|
+
rootPopupProps,
|
|
639
|
+
{
|
|
640
|
+
id: popupId,
|
|
641
|
+
"aria-labelledby": titleElementId,
|
|
642
|
+
"aria-describedby": descriptionElementId,
|
|
643
|
+
role,
|
|
644
|
+
...FOCUSABLE_POPUP_PROPS,
|
|
645
|
+
hidden: !mounted,
|
|
646
|
+
onKeyDown(event) {
|
|
647
|
+
if (COMPOSITE_KEYS.has(event.key)) event.stopPropagation();
|
|
648
|
+
},
|
|
649
|
+
style: {
|
|
650
|
+
...dragStyles,
|
|
651
|
+
[DrawerBackdropCssVars.swipeProgress]: "0",
|
|
652
|
+
[DrawerPopupCssVars.nestedDrawers]: nestedOpenDrawerCount,
|
|
653
|
+
[DrawerPopupCssVars.height]: popupHeightCssVarValue,
|
|
654
|
+
[DrawerPopupCssVars.snapPointOffset]: typeof snapPointOffsetValue === "number" ? `${snapPointOffsetValue}px` : "0px",
|
|
655
|
+
[DrawerPopupCssVars.frontmostHeight]: frontmostHeight ? `${frontmostHeight}px` : void 0,
|
|
656
|
+
[DrawerPopupCssVars.swipeStrength]: typeof swipeStrength === "number" && Number.isFinite(swipeStrength) && swipeStrength > 0 ? `${swipeStrength}` : "1"
|
|
657
|
+
}
|
|
658
|
+
},
|
|
659
|
+
elementProps
|
|
660
|
+
],
|
|
661
|
+
ref: [
|
|
662
|
+
forwardedRef,
|
|
663
|
+
popupRef,
|
|
664
|
+
setPopupElement
|
|
665
|
+
],
|
|
666
|
+
stateAttributesMapping: stateAttributesMapping$1
|
|
667
|
+
});
|
|
668
|
+
return /*#__PURE__*/ jsx(FloatingFocusManager, {
|
|
669
|
+
context: floatingRootContext,
|
|
670
|
+
openInteractionType: openMethod,
|
|
671
|
+
disabled: !mounted,
|
|
672
|
+
closeOnFocusOut: !disablePointerDismissal,
|
|
673
|
+
initialFocus: resolvedInitialFocus,
|
|
674
|
+
returnFocus: finalFocus,
|
|
675
|
+
modal: modal !== false,
|
|
676
|
+
restoreFocus: "popup",
|
|
677
|
+
children: element
|
|
678
|
+
});
|
|
679
|
+
});
|
|
680
|
+
DrawerPopup.displayName = "DrawerPopup";
|
|
681
|
+
//#endregion
|
|
682
|
+
//#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/drawer/portal/DrawerPortal.mjs
|
|
683
|
+
/**
|
|
684
|
+
* A portal element that moves the popup to a different part of the DOM.
|
|
685
|
+
* By default, the portal element is appended to `<body>`.
|
|
686
|
+
* Renders a `<div>` element.
|
|
687
|
+
*
|
|
688
|
+
* Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)
|
|
689
|
+
*/
|
|
690
|
+
const DrawerPortal = DialogPortal;
|
|
691
|
+
//#endregion
|
|
692
|
+
//#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/drawer/provider/DrawerProvider.mjs
|
|
693
|
+
/**
|
|
694
|
+
* Provides a shared context for coordinating global Drawer UI, such as indent/background effects based on whether any Drawer is open.
|
|
695
|
+
* Doesn't render its own HTML element.
|
|
696
|
+
*
|
|
697
|
+
* Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)
|
|
698
|
+
*/
|
|
699
|
+
function DrawerProvider(props) {
|
|
700
|
+
const { children } = props;
|
|
701
|
+
const [openById, setOpenById] = React$1.useState(() => /* @__PURE__ */ new Map());
|
|
702
|
+
const [visualStateStore] = React$1.useState(createVisualStateStore);
|
|
703
|
+
const setDrawerOpen = useStableCallback((drawerId, open) => {
|
|
704
|
+
setOpenById((prev) => {
|
|
705
|
+
if (prev.get(drawerId) === open) return prev;
|
|
706
|
+
const next = new Map(prev);
|
|
707
|
+
next.set(drawerId, open);
|
|
708
|
+
return next;
|
|
709
|
+
});
|
|
710
|
+
});
|
|
711
|
+
const removeDrawer = useStableCallback((drawerId) => {
|
|
712
|
+
setOpenById((prev) => {
|
|
713
|
+
if (!prev.has(drawerId)) return prev;
|
|
714
|
+
const next = new Map(prev);
|
|
715
|
+
next.delete(drawerId);
|
|
716
|
+
return next;
|
|
717
|
+
});
|
|
718
|
+
});
|
|
719
|
+
const active = React$1.useMemo(() => {
|
|
720
|
+
for (const open of openById.values()) if (open) return true;
|
|
721
|
+
return false;
|
|
722
|
+
}, [openById]);
|
|
723
|
+
const contextValue = React$1.useMemo(() => ({
|
|
724
|
+
setDrawerOpen,
|
|
725
|
+
removeDrawer,
|
|
726
|
+
active,
|
|
727
|
+
visualStateStore
|
|
728
|
+
}), [
|
|
729
|
+
active,
|
|
730
|
+
removeDrawer,
|
|
731
|
+
setDrawerOpen,
|
|
732
|
+
visualStateStore
|
|
733
|
+
]);
|
|
734
|
+
return /*#__PURE__*/ jsx(DrawerProviderContext.Provider, {
|
|
735
|
+
value: contextValue,
|
|
736
|
+
children
|
|
737
|
+
});
|
|
738
|
+
}
|
|
739
|
+
function createVisualStateStore() {
|
|
740
|
+
let state = {
|
|
741
|
+
swipeProgress: 0,
|
|
742
|
+
frontmostHeight: 0
|
|
743
|
+
};
|
|
744
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
745
|
+
return {
|
|
746
|
+
getSnapshot: () => state,
|
|
747
|
+
set(nextState) {
|
|
748
|
+
let nextSwipeProgress = state.swipeProgress;
|
|
749
|
+
if (nextState.swipeProgress !== void 0) nextSwipeProgress = Number.isFinite(nextState.swipeProgress) ? nextState.swipeProgress : 0;
|
|
750
|
+
let nextFrontmostHeight = state.frontmostHeight;
|
|
751
|
+
if (nextState.frontmostHeight !== void 0) nextFrontmostHeight = Number.isFinite(nextState.frontmostHeight) ? nextState.frontmostHeight : 0;
|
|
752
|
+
if (nextSwipeProgress === state.swipeProgress && nextFrontmostHeight === state.frontmostHeight) return;
|
|
753
|
+
state = {
|
|
754
|
+
swipeProgress: nextSwipeProgress,
|
|
755
|
+
frontmostHeight: nextFrontmostHeight
|
|
756
|
+
};
|
|
757
|
+
listeners.forEach((listener) => {
|
|
758
|
+
listener();
|
|
759
|
+
});
|
|
760
|
+
},
|
|
761
|
+
subscribe(listener) {
|
|
762
|
+
listeners.add(listener);
|
|
763
|
+
return () => {
|
|
764
|
+
listeners.delete(listener);
|
|
765
|
+
};
|
|
766
|
+
}
|
|
767
|
+
};
|
|
768
|
+
}
|
|
769
|
+
//#endregion
|
|
770
|
+
//#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/drawer/root/DrawerRoot.mjs
|
|
771
|
+
var _DrawerProviderReport;
|
|
772
|
+
var _DrawerProviderReport2;
|
|
773
|
+
/**
|
|
774
|
+
* Groups all parts of the drawer.
|
|
775
|
+
* Doesn't render its own HTML element.
|
|
776
|
+
*
|
|
777
|
+
* Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)
|
|
778
|
+
*/
|
|
779
|
+
function DrawerRoot(props) {
|
|
780
|
+
const { children, open: openProp, defaultOpen = false, onOpenChange, onOpenChangeComplete, disablePointerDismissal = false, modal = true, actionsRef, handle, triggerId: triggerIdProp, defaultTriggerId: defaultTriggerIdProp = null, swipeDirection = "down", snapToSequentialPoints = false, snapPoints, snapPoint: snapPointProp, defaultSnapPoint, onSnapPointChange } = props;
|
|
781
|
+
const parentDrawerRootContext = useDrawerRootContext(true);
|
|
782
|
+
const notifyParentSwipeProgressChange = parentDrawerRootContext?.onNestedSwipeProgressChange;
|
|
783
|
+
const notifyParentFrontmostHeight = parentDrawerRootContext?.onNestedFrontmostHeightChange;
|
|
784
|
+
const notifyParentSwipingChange = parentDrawerRootContext?.onNestedSwipingChange;
|
|
785
|
+
const notifyParentHasNestedDrawer = parentDrawerRootContext?.onNestedDrawerPresenceChange;
|
|
786
|
+
const [popupHeight, setPopupHeight] = React$1.useState(0);
|
|
787
|
+
const [frontmostHeight, setFrontmostHeight] = React$1.useState(0);
|
|
788
|
+
const [hasNestedDrawer, setHasNestedDrawer] = React$1.useState(false);
|
|
789
|
+
const [nestedSwiping, setNestedSwiping] = React$1.useState(false);
|
|
790
|
+
const [nestedSwipeProgressStore] = React$1.useState(createNestedSwipeProgressStore);
|
|
791
|
+
const resolvedDefaultSnapPoint = defaultSnapPoint !== void 0 ? defaultSnapPoint : snapPoints?.[0] ?? null;
|
|
792
|
+
const isSnapPointControlled = snapPointProp !== void 0;
|
|
793
|
+
const [activeSnapPoint, setActiveSnapPointUnwrapped] = useControlled({
|
|
794
|
+
controlled: snapPointProp,
|
|
795
|
+
default: resolvedDefaultSnapPoint,
|
|
796
|
+
name: "Drawer",
|
|
797
|
+
state: "snapPoint"
|
|
798
|
+
});
|
|
799
|
+
const isNestedDrawerOpenRef = React$1.useRef(false);
|
|
800
|
+
const setActiveSnapPoint = useStableCallback((nextSnapPoint, eventDetails) => {
|
|
801
|
+
const resolvedEventDetails = eventDetails ?? createChangeEventDetails("none");
|
|
802
|
+
onSnapPointChange?.(nextSnapPoint, resolvedEventDetails);
|
|
803
|
+
if (resolvedEventDetails.isCanceled) return;
|
|
804
|
+
setActiveSnapPointUnwrapped(nextSnapPoint);
|
|
805
|
+
});
|
|
806
|
+
const resolvedActiveSnapPoint = React$1.useMemo(() => {
|
|
807
|
+
if (isSnapPointControlled) return activeSnapPoint;
|
|
808
|
+
if (!snapPoints || snapPoints.length === 0) return activeSnapPoint;
|
|
809
|
+
if (activeSnapPoint === null || !snapPoints.some((snapPoint) => Object.is(snapPoint, activeSnapPoint))) return resolvedDefaultSnapPoint;
|
|
810
|
+
return activeSnapPoint;
|
|
811
|
+
}, [
|
|
812
|
+
activeSnapPoint,
|
|
813
|
+
isSnapPointControlled,
|
|
814
|
+
resolvedDefaultSnapPoint,
|
|
815
|
+
snapPoints
|
|
816
|
+
]);
|
|
817
|
+
const onPopupHeightChange = useStableCallback((height) => {
|
|
818
|
+
setPopupHeight(height);
|
|
819
|
+
if (!isNestedDrawerOpenRef.current && height > 0) setFrontmostHeight(height);
|
|
820
|
+
});
|
|
821
|
+
const onNestedFrontmostHeightChange = useStableCallback((height) => {
|
|
822
|
+
if (height > 0) {
|
|
823
|
+
isNestedDrawerOpenRef.current = true;
|
|
824
|
+
setFrontmostHeight(height);
|
|
825
|
+
return;
|
|
826
|
+
}
|
|
827
|
+
isNestedDrawerOpenRef.current = false;
|
|
828
|
+
if (popupHeight > 0) setFrontmostHeight(popupHeight);
|
|
829
|
+
});
|
|
830
|
+
const onNestedDrawerPresenceChange = useStableCallback((present) => {
|
|
831
|
+
setHasNestedDrawer(present);
|
|
832
|
+
});
|
|
833
|
+
const onNestedSwipeProgressChange = useStableCallback((progress) => {
|
|
834
|
+
nestedSwipeProgressStore.set(progress);
|
|
835
|
+
notifyParentSwipeProgressChange?.(progress);
|
|
836
|
+
});
|
|
837
|
+
const onNestedSwipingChange = useStableCallback((swiping) => {
|
|
838
|
+
setNestedSwiping(swiping);
|
|
839
|
+
notifyParentSwipingChange?.(swiping);
|
|
840
|
+
});
|
|
841
|
+
const handleOpenChange = useStableCallback((nextOpen, eventDetails) => {
|
|
842
|
+
onOpenChange?.(nextOpen, eventDetails);
|
|
843
|
+
if (eventDetails.isCanceled) return;
|
|
844
|
+
if (!nextOpen && snapPoints && snapPoints.length > 0) setActiveSnapPoint(resolvedDefaultSnapPoint, createChangeEventDetails(eventDetails.reason, eventDetails.event, eventDetails.trigger));
|
|
845
|
+
});
|
|
846
|
+
const contextValue = React$1.useMemo(() => ({
|
|
847
|
+
swipeDirection,
|
|
848
|
+
snapToSequentialPoints,
|
|
849
|
+
snapPoints,
|
|
850
|
+
activeSnapPoint: resolvedActiveSnapPoint,
|
|
851
|
+
setActiveSnapPoint,
|
|
852
|
+
frontmostHeight,
|
|
853
|
+
popupHeight,
|
|
854
|
+
hasNestedDrawer,
|
|
855
|
+
nestedSwiping,
|
|
856
|
+
nestedSwipeProgressStore,
|
|
857
|
+
onNestedDrawerPresenceChange,
|
|
858
|
+
onPopupHeightChange,
|
|
859
|
+
onNestedFrontmostHeightChange,
|
|
860
|
+
onNestedSwipingChange,
|
|
861
|
+
onNestedSwipeProgressChange,
|
|
862
|
+
notifyParentFrontmostHeight,
|
|
863
|
+
notifyParentSwipingChange,
|
|
864
|
+
notifyParentSwipeProgressChange,
|
|
865
|
+
notifyParentHasNestedDrawer
|
|
866
|
+
}), [
|
|
867
|
+
resolvedActiveSnapPoint,
|
|
868
|
+
frontmostHeight,
|
|
869
|
+
hasNestedDrawer,
|
|
870
|
+
nestedSwiping,
|
|
871
|
+
nestedSwipeProgressStore,
|
|
872
|
+
notifyParentHasNestedDrawer,
|
|
873
|
+
notifyParentSwipeProgressChange,
|
|
874
|
+
notifyParentSwipingChange,
|
|
875
|
+
notifyParentFrontmostHeight,
|
|
876
|
+
onNestedDrawerPresenceChange,
|
|
877
|
+
onNestedFrontmostHeightChange,
|
|
878
|
+
onNestedSwipeProgressChange,
|
|
879
|
+
onNestedSwipingChange,
|
|
880
|
+
onPopupHeightChange,
|
|
881
|
+
popupHeight,
|
|
882
|
+
setActiveSnapPoint,
|
|
883
|
+
snapPoints,
|
|
884
|
+
snapToSequentialPoints,
|
|
885
|
+
swipeDirection
|
|
886
|
+
]);
|
|
887
|
+
const resolvedChildren = typeof children === "function" ? (payload) => /*#__PURE__*/ jsxs(React$1.Fragment, { children: [_DrawerProviderReport || (_DrawerProviderReport = /*#__PURE__*/ jsx(DrawerProviderReporter, {})), children(payload)] }) : /*#__PURE__*/ jsxs(React$1.Fragment, { children: [_DrawerProviderReport2 || (_DrawerProviderReport2 = /*#__PURE__*/ jsx(DrawerProviderReporter, {})), children] });
|
|
888
|
+
return /*#__PURE__*/ jsx(DrawerRootContext.Provider, {
|
|
889
|
+
value: contextValue,
|
|
890
|
+
children: /*#__PURE__*/ jsx(IsDrawerContext.Provider, {
|
|
891
|
+
value: true,
|
|
892
|
+
children: /*#__PURE__*/ jsx(DialogRoot, {
|
|
893
|
+
open: openProp,
|
|
894
|
+
defaultOpen,
|
|
895
|
+
onOpenChange: handleOpenChange,
|
|
896
|
+
onOpenChangeComplete,
|
|
897
|
+
disablePointerDismissal,
|
|
898
|
+
modal,
|
|
899
|
+
actionsRef,
|
|
900
|
+
handle,
|
|
901
|
+
triggerId: triggerIdProp,
|
|
902
|
+
defaultTriggerId: defaultTriggerIdProp,
|
|
903
|
+
children: resolvedChildren
|
|
904
|
+
})
|
|
905
|
+
})
|
|
906
|
+
});
|
|
907
|
+
}
|
|
908
|
+
function createNestedSwipeProgressStore() {
|
|
909
|
+
let progress = 0;
|
|
910
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
911
|
+
return {
|
|
912
|
+
getSnapshot: () => progress,
|
|
913
|
+
set(nextProgress) {
|
|
914
|
+
const resolved = Number.isFinite(nextProgress) ? nextProgress : 0;
|
|
915
|
+
if (resolved === progress) return;
|
|
916
|
+
progress = resolved;
|
|
917
|
+
listeners.forEach((listener) => {
|
|
918
|
+
listener();
|
|
919
|
+
});
|
|
920
|
+
},
|
|
921
|
+
subscribe(listener) {
|
|
922
|
+
listeners.add(listener);
|
|
923
|
+
return () => {
|
|
924
|
+
listeners.delete(listener);
|
|
925
|
+
};
|
|
926
|
+
}
|
|
927
|
+
};
|
|
928
|
+
}
|
|
929
|
+
function DrawerProviderReporter() {
|
|
930
|
+
const drawerId = useId$1();
|
|
931
|
+
const providerContext = useDrawerProviderContext(true);
|
|
932
|
+
const { store } = useDialogRootContext(false);
|
|
933
|
+
const open = store.useState("open");
|
|
934
|
+
const nestedOpenDialogCount = store.useState("nestedOpenDialogCount");
|
|
935
|
+
const popupElement = store.useState("popupElement");
|
|
936
|
+
const isTopmost = nestedOpenDialogCount === 0;
|
|
937
|
+
React$1.useEffect(() => {
|
|
938
|
+
if (!providerContext || drawerId == null) return;
|
|
939
|
+
return () => {
|
|
940
|
+
providerContext.removeDrawer(drawerId);
|
|
941
|
+
};
|
|
942
|
+
}, [drawerId, providerContext]);
|
|
943
|
+
React$1.useEffect(() => {
|
|
944
|
+
if (drawerId == null) return;
|
|
945
|
+
providerContext?.setDrawerOpen(drawerId, open);
|
|
946
|
+
}, [
|
|
947
|
+
drawerId,
|
|
948
|
+
open,
|
|
949
|
+
providerContext
|
|
950
|
+
]);
|
|
951
|
+
React$1.useEffect(() => {
|
|
952
|
+
if (!open || !isTopmost || !android) return;
|
|
953
|
+
const CloseWatcherCtor = getWindow(popupElement).CloseWatcher;
|
|
954
|
+
if (!CloseWatcherCtor) return;
|
|
955
|
+
function handleCloseWatcher(event) {
|
|
956
|
+
if (!store.select("open")) return;
|
|
957
|
+
store.setOpen(false, createChangeEventDetails(closeWatcher, event));
|
|
958
|
+
}
|
|
959
|
+
const closeWatcher$1 = new CloseWatcherCtor();
|
|
960
|
+
const unsubscribe = addEventListener(closeWatcher$1, "close", handleCloseWatcher);
|
|
961
|
+
return () => {
|
|
962
|
+
unsubscribe();
|
|
963
|
+
closeWatcher$1.destroy();
|
|
964
|
+
};
|
|
965
|
+
}, [
|
|
966
|
+
store,
|
|
967
|
+
isTopmost,
|
|
968
|
+
open,
|
|
969
|
+
popupElement
|
|
970
|
+
]);
|
|
971
|
+
return null;
|
|
972
|
+
}
|
|
973
|
+
//#endregion
|
|
974
|
+
//#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/drawer/swipe-area/DrawerSwipeAreaDataAttributes.mjs
|
|
975
|
+
let DrawerSwipeAreaDataAttributes = function(DrawerSwipeAreaDataAttributes) {
|
|
976
|
+
/**
|
|
977
|
+
* Present when the drawer is open.
|
|
978
|
+
*/
|
|
979
|
+
DrawerSwipeAreaDataAttributes[DrawerSwipeAreaDataAttributes["open"] = CommonPopupDataAttributes.open] = "open";
|
|
980
|
+
/**
|
|
981
|
+
* Present when the drawer is closed.
|
|
982
|
+
*/
|
|
983
|
+
DrawerSwipeAreaDataAttributes[DrawerSwipeAreaDataAttributes["closed"] = CommonPopupDataAttributes.closed] = "closed";
|
|
984
|
+
/**
|
|
985
|
+
* Present when the swipe area is disabled.
|
|
986
|
+
*/
|
|
987
|
+
DrawerSwipeAreaDataAttributes["disabled"] = "data-disabled";
|
|
988
|
+
/**
|
|
989
|
+
* Indicates the swipe direction.
|
|
990
|
+
* @type {'up' | 'down' | 'left' | 'right'}
|
|
991
|
+
*/
|
|
992
|
+
DrawerSwipeAreaDataAttributes["swipeDirection"] = "data-swipe-direction";
|
|
993
|
+
/**
|
|
994
|
+
* Present when the drawer is being swiped.
|
|
995
|
+
*/
|
|
996
|
+
DrawerSwipeAreaDataAttributes["swiping"] = "data-swiping";
|
|
997
|
+
return DrawerSwipeAreaDataAttributes;
|
|
998
|
+
}({});
|
|
999
|
+
//#endregion
|
|
1000
|
+
//#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/drawer/swipe-area/DrawerSwipeArea.mjs
|
|
1001
|
+
const DEFAULT_SWIPE_OPEN_RATIO = .5;
|
|
1002
|
+
const MIN_SWIPE_START_DISTANCE = 1;
|
|
1003
|
+
const VELOCITY_THRESHOLD = .1;
|
|
1004
|
+
const FALLBACK_SWIPE_OPEN_THRESHOLD = 40;
|
|
1005
|
+
const SWIPE_AREA_OPEN_HOOK = { [DrawerSwipeAreaDataAttributes.open]: "" };
|
|
1006
|
+
const SWIPE_AREA_CLOSED_HOOK = { [DrawerSwipeAreaDataAttributes.closed]: "" };
|
|
1007
|
+
const SWIPE_AREA_SWIPING_HOOK = { [DrawerSwipeAreaDataAttributes.swiping]: "" };
|
|
1008
|
+
const SWIPE_AREA_DISABLED_HOOK = { [DrawerSwipeAreaDataAttributes.disabled]: "" };
|
|
1009
|
+
const stateAttributesMapping = {
|
|
1010
|
+
open(value) {
|
|
1011
|
+
return value ? SWIPE_AREA_OPEN_HOOK : SWIPE_AREA_CLOSED_HOOK;
|
|
1012
|
+
},
|
|
1013
|
+
swiping(value) {
|
|
1014
|
+
return value ? SWIPE_AREA_SWIPING_HOOK : null;
|
|
1015
|
+
},
|
|
1016
|
+
swipeDirection(value) {
|
|
1017
|
+
return value ? { [DrawerSwipeAreaDataAttributes.swipeDirection]: value } : null;
|
|
1018
|
+
},
|
|
1019
|
+
disabled(value) {
|
|
1020
|
+
return value ? SWIPE_AREA_DISABLED_HOOK : null;
|
|
1021
|
+
}
|
|
1022
|
+
};
|
|
1023
|
+
const oppositeSwipeDirection = {
|
|
1024
|
+
up: "down",
|
|
1025
|
+
down: "up",
|
|
1026
|
+
left: "right",
|
|
1027
|
+
right: "left"
|
|
1028
|
+
};
|
|
1029
|
+
function resolveTouchAction(direction) {
|
|
1030
|
+
return direction === "left" || direction === "right" ? "pan-y" : "pan-x";
|
|
1031
|
+
}
|
|
1032
|
+
/**
|
|
1033
|
+
* An invisible area that listens for swipe gestures to open the drawer.
|
|
1034
|
+
* Renders a `<div>` element.
|
|
1035
|
+
*
|
|
1036
|
+
* Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)
|
|
1037
|
+
*/
|
|
1038
|
+
const DrawerSwipeArea = /*#__PURE__*/ React$1.forwardRef(function DrawerSwipeArea(componentProps, forwardedRef) {
|
|
1039
|
+
const { render, className, style, disabled = false, swipeDirection: swipeDirectionProp, ...elementProps } = componentProps;
|
|
1040
|
+
const { store } = useDialogRootContext();
|
|
1041
|
+
const { swipeDirection, frontmostHeight } = useDrawerRootContext();
|
|
1042
|
+
const providerContext = useDrawerProviderContext(true);
|
|
1043
|
+
const [swipeActive, setSwipeActive] = React$1.useState(false);
|
|
1044
|
+
const releaseDismissTimeout = useTimeout();
|
|
1045
|
+
const swipeAreaRef = React$1.useRef(null);
|
|
1046
|
+
const swipeStartEventRef = React$1.useRef(null);
|
|
1047
|
+
const openedBySwipeRef = React$1.useRef(false);
|
|
1048
|
+
const dragDeltaRef = React$1.useRef({
|
|
1049
|
+
x: 0,
|
|
1050
|
+
y: 0
|
|
1051
|
+
});
|
|
1052
|
+
const closedOffsetRef = React$1.useRef(null);
|
|
1053
|
+
const appliedSwipeStylesRef = React$1.useRef(false);
|
|
1054
|
+
const popupTransitionRef = React$1.useRef(null);
|
|
1055
|
+
const swipeAreaId = useBaseUiId(componentProps.id);
|
|
1056
|
+
const registerTrigger = useTriggerRegistration(swipeAreaId, store);
|
|
1057
|
+
const open = store.useState("open");
|
|
1058
|
+
const resetDragDelta = useStableCallback(() => {
|
|
1059
|
+
dragDeltaRef.current.x = 0;
|
|
1060
|
+
dragDeltaRef.current.y = 0;
|
|
1061
|
+
});
|
|
1062
|
+
const resolvedSwipeDirection = swipeDirectionProp ?? oppositeSwipeDirection[swipeDirection];
|
|
1063
|
+
const dismissDirection = oppositeSwipeDirection[resolvedSwipeDirection];
|
|
1064
|
+
const enabled = !disabled && (!open || swipeActive);
|
|
1065
|
+
function disableDismissForSwipe() {
|
|
1066
|
+
releaseDismissTimeout.clear();
|
|
1067
|
+
store.context.outsidePressEnabledRef.current = false;
|
|
1068
|
+
}
|
|
1069
|
+
function enableDismissAfterRelease() {
|
|
1070
|
+
releaseDismissTimeout.start(0, () => {
|
|
1071
|
+
store.context.outsidePressEnabledRef.current = true;
|
|
1072
|
+
});
|
|
1073
|
+
}
|
|
1074
|
+
function resolvePopupSize() {
|
|
1075
|
+
const popupElement = store.context.popupRef.current;
|
|
1076
|
+
if (!popupElement) return null;
|
|
1077
|
+
const size = dismissDirection === "left" || dismissDirection === "right" ? popupElement.offsetWidth : popupElement.offsetHeight;
|
|
1078
|
+
if (size <= 0) return null;
|
|
1079
|
+
return size;
|
|
1080
|
+
}
|
|
1081
|
+
function resolveClosedOffset() {
|
|
1082
|
+
const offset = resolvePopupSize();
|
|
1083
|
+
if (offset == null) return null;
|
|
1084
|
+
const popupElement = store.context.popupRef.current;
|
|
1085
|
+
if (!popupElement) return offset;
|
|
1086
|
+
const isHorizontal = dismissDirection === "left" || dismissDirection === "right";
|
|
1087
|
+
const transform = getElementTransform(popupElement);
|
|
1088
|
+
const transformOffset = isHorizontal ? transform.x : transform.y;
|
|
1089
|
+
if (Number.isFinite(transformOffset) && Math.abs(transformOffset) > .5) return Math.min(offset, Math.abs(transformOffset));
|
|
1090
|
+
return offset;
|
|
1091
|
+
}
|
|
1092
|
+
function resolveSwipeOpenThreshold() {
|
|
1093
|
+
const popupSize = resolvePopupSize();
|
|
1094
|
+
if (popupSize == null) return FALLBACK_SWIPE_OPEN_THRESHOLD;
|
|
1095
|
+
return popupSize * DEFAULT_SWIPE_OPEN_RATIO;
|
|
1096
|
+
}
|
|
1097
|
+
function applySwipeMovement() {
|
|
1098
|
+
if (!swipeActive) return;
|
|
1099
|
+
const popupElement = store.context.popupRef.current;
|
|
1100
|
+
if (!popupElement) return;
|
|
1101
|
+
if (!store.select("open") || !store.select("mounted")) return;
|
|
1102
|
+
if (closedOffsetRef.current == null) closedOffsetRef.current = resolveClosedOffset();
|
|
1103
|
+
const closedOffset = closedOffsetRef.current;
|
|
1104
|
+
if (!closedOffset || !Number.isFinite(closedOffset) || closedOffset <= 0) return;
|
|
1105
|
+
const { x, y } = dragDeltaRef.current;
|
|
1106
|
+
const displacement = getDisplacement(resolvedSwipeDirection, x, y);
|
|
1107
|
+
const clampedDisplacement = Math.max(0, displacement);
|
|
1108
|
+
const movement = (closedOffset - (clampedDisplacement > closedOffset ? closedOffset + Math.sqrt(clampedDisplacement - closedOffset) : clampedDisplacement)) * (dismissDirection === "left" || dismissDirection === "up" ? -1 : 1);
|
|
1109
|
+
const isHorizontal = dismissDirection === "left" || dismissDirection === "right";
|
|
1110
|
+
const movementX = isHorizontal ? movement : 0;
|
|
1111
|
+
const movementY = isHorizontal ? 0 : movement;
|
|
1112
|
+
const openProgress = Math.max(0, Math.min(1, clampedDisplacement / closedOffset));
|
|
1113
|
+
const backdropProgress = Math.max(0, Math.min(1, 1 - openProgress));
|
|
1114
|
+
popupElement.style.setProperty(DrawerPopupCssVars.swipeMovementX, `${movementX}px`);
|
|
1115
|
+
popupElement.style.setProperty(DrawerPopupCssVars.swipeMovementY, `${movementY}px`);
|
|
1116
|
+
popupElement.setAttribute(DrawerPopupDataAttributes.swiping, "");
|
|
1117
|
+
if (popupTransitionRef.current === null) popupTransitionRef.current = popupElement.style.transition;
|
|
1118
|
+
popupElement.style.transition = "none";
|
|
1119
|
+
const backdropElement = store.context.backdropRef.current;
|
|
1120
|
+
if (backdropElement) {
|
|
1121
|
+
backdropElement.setAttribute(DrawerPopupDataAttributes.swiping, "");
|
|
1122
|
+
backdropElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, `${backdropProgress}`);
|
|
1123
|
+
if (openProgress > 0 && frontmostHeight > 0) backdropElement.style.setProperty(DrawerPopupCssVars.height, `${frontmostHeight}px`);
|
|
1124
|
+
else backdropElement.style.removeProperty(DrawerPopupCssVars.height);
|
|
1125
|
+
}
|
|
1126
|
+
providerContext?.visualStateStore.set({
|
|
1127
|
+
swipeProgress: openProgress,
|
|
1128
|
+
frontmostHeight: openProgress > 0 ? frontmostHeight : 0
|
|
1129
|
+
});
|
|
1130
|
+
appliedSwipeStylesRef.current = true;
|
|
1131
|
+
}
|
|
1132
|
+
const clearSwipeStyles = useStableCallback(() => {
|
|
1133
|
+
const popupElement = store.context.popupRef.current;
|
|
1134
|
+
if (popupElement && appliedSwipeStylesRef.current) {
|
|
1135
|
+
popupElement.style.removeProperty(DrawerPopupCssVars.swipeMovementX);
|
|
1136
|
+
popupElement.style.removeProperty(DrawerPopupCssVars.swipeMovementY);
|
|
1137
|
+
popupElement.removeAttribute(DrawerPopupDataAttributes.swiping);
|
|
1138
|
+
}
|
|
1139
|
+
if (popupElement && popupTransitionRef.current !== null) {
|
|
1140
|
+
popupElement.style.transition = popupTransitionRef.current;
|
|
1141
|
+
popupTransitionRef.current = null;
|
|
1142
|
+
}
|
|
1143
|
+
const backdropElement = store.context.backdropRef.current;
|
|
1144
|
+
if (backdropElement) {
|
|
1145
|
+
backdropElement.removeAttribute(DrawerPopupDataAttributes.swiping);
|
|
1146
|
+
backdropElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, "0");
|
|
1147
|
+
backdropElement.style.removeProperty(DrawerPopupCssVars.height);
|
|
1148
|
+
}
|
|
1149
|
+
providerContext?.visualStateStore.set({
|
|
1150
|
+
swipeProgress: 0,
|
|
1151
|
+
frontmostHeight: 0
|
|
1152
|
+
});
|
|
1153
|
+
appliedSwipeStylesRef.current = false;
|
|
1154
|
+
});
|
|
1155
|
+
function openDrawer(event) {
|
|
1156
|
+
if (store.select("open")) return;
|
|
1157
|
+
openedBySwipeRef.current = true;
|
|
1158
|
+
store.setOpen(true, createChangeEventDetails(swipe, event, swipeAreaRef.current ?? void 0));
|
|
1159
|
+
}
|
|
1160
|
+
function closeDrawer(event) {
|
|
1161
|
+
if (!store.select("open")) return;
|
|
1162
|
+
store.setOpen(false, createChangeEventDetails(swipe, event, swipeAreaRef.current ?? void 0));
|
|
1163
|
+
}
|
|
1164
|
+
function resetSwipeInteractionState() {
|
|
1165
|
+
swipeStartEventRef.current = null;
|
|
1166
|
+
openedBySwipeRef.current = false;
|
|
1167
|
+
closedOffsetRef.current = null;
|
|
1168
|
+
setSwipeActive(false);
|
|
1169
|
+
}
|
|
1170
|
+
function finishSwipeInteraction() {
|
|
1171
|
+
resetSwipeInteractionState();
|
|
1172
|
+
enableDismissAfterRelease();
|
|
1173
|
+
resetDragDelta();
|
|
1174
|
+
clearSwipeStyles();
|
|
1175
|
+
}
|
|
1176
|
+
const swipe$2 = useSwipeDismiss({
|
|
1177
|
+
enabled,
|
|
1178
|
+
directions: [resolvedSwipeDirection],
|
|
1179
|
+
elementRef: swipeAreaRef,
|
|
1180
|
+
trackDrag: false,
|
|
1181
|
+
movementCssVars: {
|
|
1182
|
+
x: DrawerPopupCssVars.swipeMovementX,
|
|
1183
|
+
y: DrawerPopupCssVars.swipeMovementY
|
|
1184
|
+
},
|
|
1185
|
+
onSwipeStart(event) {
|
|
1186
|
+
disableDismissForSwipe();
|
|
1187
|
+
swipeStartEventRef.current = event;
|
|
1188
|
+
openedBySwipeRef.current = false;
|
|
1189
|
+
setSwipeActive(true);
|
|
1190
|
+
resetDragDelta();
|
|
1191
|
+
},
|
|
1192
|
+
onProgress(_progress, details) {
|
|
1193
|
+
if (!details) return;
|
|
1194
|
+
if (!swipeStartEventRef.current) return;
|
|
1195
|
+
dragDeltaRef.current.x = details.deltaX;
|
|
1196
|
+
dragDeltaRef.current.y = details.deltaY;
|
|
1197
|
+
if (details.direction !== resolvedSwipeDirection) return;
|
|
1198
|
+
if (getDisplacement(resolvedSwipeDirection, details.deltaX, details.deltaY) < MIN_SWIPE_START_DISTANCE && !openedBySwipeRef.current) return;
|
|
1199
|
+
if (!openedBySwipeRef.current) openDrawer(swipeStartEventRef.current);
|
|
1200
|
+
applySwipeMovement();
|
|
1201
|
+
},
|
|
1202
|
+
onRelease({ event, direction, deltaX, deltaY, releaseVelocityX, releaseVelocityY }) {
|
|
1203
|
+
const displacement = getDisplacement(resolvedSwipeDirection, deltaX, deltaY);
|
|
1204
|
+
const releaseVelocity = getDisplacement(resolvedSwipeDirection, releaseVelocityX, releaseVelocityY);
|
|
1205
|
+
const threshold = resolveSwipeOpenThreshold();
|
|
1206
|
+
if (threshold != null && direction === resolvedSwipeDirection && (threshold != null && displacement >= threshold || releaseVelocity >= VELOCITY_THRESHOLD) && !disabled) {
|
|
1207
|
+
if (!store.select("open")) openDrawer(event);
|
|
1208
|
+
} else if (openedBySwipeRef.current) closeDrawer(event);
|
|
1209
|
+
finishSwipeInteraction();
|
|
1210
|
+
return false;
|
|
1211
|
+
},
|
|
1212
|
+
onCancel: finishSwipeInteraction
|
|
1213
|
+
});
|
|
1214
|
+
const swipePointerProps = swipe$2.getPointerProps();
|
|
1215
|
+
const swipeTouchProps = swipe$2.getTouchProps();
|
|
1216
|
+
const resetSwipe = swipe$2.reset;
|
|
1217
|
+
React$1.useEffect(() => {
|
|
1218
|
+
if (!enabled) {
|
|
1219
|
+
resetSwipe();
|
|
1220
|
+
resetDragDelta();
|
|
1221
|
+
clearSwipeStyles();
|
|
1222
|
+
resetSwipeInteractionState();
|
|
1223
|
+
}
|
|
1224
|
+
}, [
|
|
1225
|
+
clearSwipeStyles,
|
|
1226
|
+
enabled,
|
|
1227
|
+
resetDragDelta,
|
|
1228
|
+
resetSwipe
|
|
1229
|
+
]);
|
|
1230
|
+
React$1.useEffect(() => {
|
|
1231
|
+
return () => {
|
|
1232
|
+
store.context.outsidePressEnabledRef.current = true;
|
|
1233
|
+
};
|
|
1234
|
+
}, [store]);
|
|
1235
|
+
return useRenderElement("div", componentProps, {
|
|
1236
|
+
state: {
|
|
1237
|
+
open,
|
|
1238
|
+
swiping: swipe$2.swiping,
|
|
1239
|
+
swipeDirection: resolvedSwipeDirection,
|
|
1240
|
+
disabled
|
|
1241
|
+
},
|
|
1242
|
+
ref: [
|
|
1243
|
+
forwardedRef,
|
|
1244
|
+
swipeAreaRef,
|
|
1245
|
+
registerTrigger
|
|
1246
|
+
],
|
|
1247
|
+
stateAttributesMapping,
|
|
1248
|
+
props: [
|
|
1249
|
+
{
|
|
1250
|
+
role: "presentation",
|
|
1251
|
+
"aria-hidden": true,
|
|
1252
|
+
style: {
|
|
1253
|
+
pointerEvents: !enabled ? "none" : void 0,
|
|
1254
|
+
touchAction: resolveTouchAction(resolvedSwipeDirection)
|
|
1255
|
+
},
|
|
1256
|
+
onPointerDown(event) {
|
|
1257
|
+
if (event.pointerType === "touch") return;
|
|
1258
|
+
swipePointerProps.onPointerDown?.(event);
|
|
1259
|
+
if (event.cancelable) event.preventDefault();
|
|
1260
|
+
},
|
|
1261
|
+
onPointerMove(event) {
|
|
1262
|
+
if (event.pointerType === "touch") return;
|
|
1263
|
+
swipePointerProps.onPointerMove?.(event);
|
|
1264
|
+
},
|
|
1265
|
+
onPointerUp(event) {
|
|
1266
|
+
if (event.pointerType === "touch") return;
|
|
1267
|
+
swipePointerProps.onPointerUp?.(event);
|
|
1268
|
+
},
|
|
1269
|
+
onPointerCancel(event) {
|
|
1270
|
+
if (event.pointerType === "touch") return;
|
|
1271
|
+
swipePointerProps.onPointerCancel?.(event);
|
|
1272
|
+
}
|
|
1273
|
+
},
|
|
1274
|
+
swipeTouchProps,
|
|
1275
|
+
swipeAreaId ? { id: swipeAreaId } : void 0,
|
|
1276
|
+
elementProps
|
|
1277
|
+
]
|
|
1278
|
+
});
|
|
1279
|
+
});
|
|
1280
|
+
DrawerSwipeArea.displayName = "DrawerSwipeArea";
|
|
1281
|
+
//#endregion
|
|
1282
|
+
//#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/drawer/title/DrawerTitle.mjs
|
|
1283
|
+
/**
|
|
1284
|
+
* A heading that labels the drawer.
|
|
1285
|
+
* Renders an `<h2>` element.
|
|
1286
|
+
*
|
|
1287
|
+
* Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)
|
|
1288
|
+
*/
|
|
1289
|
+
const DrawerTitle = DialogTitle;
|
|
1290
|
+
//#endregion
|
|
1291
|
+
//#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/drawer/trigger/DrawerTrigger.mjs
|
|
1292
|
+
/**
|
|
1293
|
+
* A button that opens the drawer.
|
|
1294
|
+
* Renders a `<button>` element.
|
|
1295
|
+
*
|
|
1296
|
+
* Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)
|
|
1297
|
+
*/
|
|
1298
|
+
const DrawerTrigger = DialogTrigger;
|
|
1299
|
+
//#endregion
|
|
1300
|
+
//#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/drawer/virtual-keyboard-provider/DrawerVirtualKeyboardContext.mjs
|
|
1301
|
+
const DrawerVirtualKeyboardContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
1302
|
+
DrawerVirtualKeyboardContext.displayName = "DrawerVirtualKeyboardContext";
|
|
1303
|
+
function useDrawerVirtualKeyboardContext() {
|
|
1304
|
+
return React$1.useContext(DrawerVirtualKeyboardContext);
|
|
1305
|
+
}
|
|
1306
|
+
//#endregion
|
|
1307
|
+
//#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/drawer/viewport/DrawerViewport.mjs
|
|
1308
|
+
const MIN_SWIPE_THRESHOLD = 10;
|
|
1309
|
+
const FAST_SWIPE_VELOCITY = .5;
|
|
1310
|
+
const SNAP_VELOCITY_THRESHOLD = .5;
|
|
1311
|
+
const SNAP_VELOCITY_MULTIPLIER = 300;
|
|
1312
|
+
const MAX_SNAP_VELOCITY = 4;
|
|
1313
|
+
const MIN_SWIPE_RELEASE_VELOCITY = .2;
|
|
1314
|
+
const MAX_SWIPE_RELEASE_VELOCITY = 4;
|
|
1315
|
+
const MIN_SWIPE_RELEASE_DURATION_MS = 80;
|
|
1316
|
+
const MAX_SWIPE_RELEASE_DURATION_MS = 360;
|
|
1317
|
+
const MIN_SWIPE_RELEASE_SCALAR = .1;
|
|
1318
|
+
const MAX_SWIPE_RELEASE_SCALAR = 1;
|
|
1319
|
+
const DRAWER_CONTENT_SELECTOR = `[${DRAWER_CONTENT_ATTRIBUTE}]`;
|
|
1320
|
+
/**
|
|
1321
|
+
* A positioning container for the drawer popup that can be made scrollable.
|
|
1322
|
+
* Renders a `<div>` element.
|
|
1323
|
+
*
|
|
1324
|
+
* Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)
|
|
1325
|
+
*/
|
|
1326
|
+
const DrawerViewport = /*#__PURE__*/ React$1.forwardRef(function DrawerViewport(props, forwardedRef) {
|
|
1327
|
+
const { render, className, style, children, ...elementProps } = props;
|
|
1328
|
+
const { store } = useDialogRootContext();
|
|
1329
|
+
const popupRef = store.context.popupRef;
|
|
1330
|
+
const backdropRef = store.context.backdropRef;
|
|
1331
|
+
const { swipeDirection, notifyParentSwipingChange, notifyParentSwipeProgressChange, frontmostHeight, snapToSequentialPoints } = useDrawerRootContext();
|
|
1332
|
+
const providerContext = useDrawerProviderContext(true);
|
|
1333
|
+
const { snapPoints, resolvedSnapPoints, activeSnapPoint, activeSnapPointOffset, setActiveSnapPoint, popupHeight } = useDrawerSnapPoints();
|
|
1334
|
+
const open = store.useState("open");
|
|
1335
|
+
const mounted = store.useState("mounted");
|
|
1336
|
+
const nested = store.useState("nested");
|
|
1337
|
+
const nestedOpenDrawerCount = store.useState("nestedOpenDrawerCount");
|
|
1338
|
+
const viewportElement = store.useState("viewportElement");
|
|
1339
|
+
const popupElementState = store.useState("popupElement");
|
|
1340
|
+
const visualStateStore = providerContext?.visualStateStore;
|
|
1341
|
+
const nestedDrawerOpen = nestedOpenDrawerCount > 0;
|
|
1342
|
+
const scrollAxis = swipeDirection === "left" || swipeDirection === "right" ? "horizontal" : "vertical";
|
|
1343
|
+
const isVerticalScrollAxis = scrollAxis === "vertical";
|
|
1344
|
+
const crossScrollAxis = isVerticalScrollAxis ? "horizontal" : "vertical";
|
|
1345
|
+
const [swipeRelease, setSwipeRelease] = React$1.useState(null);
|
|
1346
|
+
const pendingSwipeCloseSnapPointRef = React$1.useRef(void 0);
|
|
1347
|
+
const resetSwipeRef = React$1.useRef(null);
|
|
1348
|
+
const controlledDismissFrame = useAnimationFrame();
|
|
1349
|
+
const swipingRef = React$1.useRef(false);
|
|
1350
|
+
const nestedSwipeActiveRef = React$1.useRef(false);
|
|
1351
|
+
const lastPointerTypeRef = React$1.useRef("");
|
|
1352
|
+
const ignoreNextTouchStartFromPenRef = React$1.useRef(false);
|
|
1353
|
+
const ignoreTouchSwipeRef = React$1.useRef(false);
|
|
1354
|
+
const touchScrollStateRef = React$1.useRef(null);
|
|
1355
|
+
const virtualKeyboard = useDrawerVirtualKeyboardContext();
|
|
1356
|
+
const snapPointRange = React$1.useMemo(() => {
|
|
1357
|
+
if (!snapPoints || snapPoints.length < 2) return null;
|
|
1358
|
+
if (swipeDirection !== "down" && swipeDirection !== "up") return null;
|
|
1359
|
+
if (resolvedSnapPoints.length < 2) return null;
|
|
1360
|
+
const offsets = resolvedSnapPoints.map((point) => point.offset).filter((offset) => Number.isFinite(offset)).sort((a, b) => a - b);
|
|
1361
|
+
if (offsets.length < 2) return null;
|
|
1362
|
+
const minOffset = offsets[0];
|
|
1363
|
+
const nextOffset = offsets[1];
|
|
1364
|
+
const maxOffset = offsets[offsets.length - 1];
|
|
1365
|
+
let range = nextOffset - minOffset;
|
|
1366
|
+
if (!Number.isFinite(range) || range <= 0) {
|
|
1367
|
+
const fallbackRange = maxOffset - minOffset;
|
|
1368
|
+
if (!Number.isFinite(fallbackRange) || fallbackRange <= 0) return null;
|
|
1369
|
+
range = fallbackRange;
|
|
1370
|
+
}
|
|
1371
|
+
return {
|
|
1372
|
+
minOffset,
|
|
1373
|
+
range
|
|
1374
|
+
};
|
|
1375
|
+
}, [
|
|
1376
|
+
resolvedSnapPoints,
|
|
1377
|
+
snapPoints,
|
|
1378
|
+
swipeDirection
|
|
1379
|
+
]);
|
|
1380
|
+
const snapPointProgress = React$1.useMemo(() => {
|
|
1381
|
+
if (!snapPointRange || activeSnapPointOffset === null) return null;
|
|
1382
|
+
return clamp((activeSnapPointOffset - snapPointRange.minOffset) / snapPointRange.range, 0, 1);
|
|
1383
|
+
}, [activeSnapPointOffset, snapPointRange]);
|
|
1384
|
+
const swipeDirections = React$1.useMemo(() => {
|
|
1385
|
+
if (snapPoints && snapPoints.length > 0 && (swipeDirection === "down" || swipeDirection === "up")) return swipeDirection === "down" ? ["down", "up"] : ["up", "down"];
|
|
1386
|
+
return [swipeDirection];
|
|
1387
|
+
}, [snapPoints, swipeDirection]);
|
|
1388
|
+
const setSwipeDismissed = useStableCallback((dismissed) => {
|
|
1389
|
+
setSwipeDismissedElements(popupRef.current, backdropRef.current, dismissed);
|
|
1390
|
+
});
|
|
1391
|
+
const clearSwipeRelease = useStableCallback(() => {
|
|
1392
|
+
setSwipeDismissed(false);
|
|
1393
|
+
popupRef.current?.removeAttribute(TransitionStatusDataAttributes.endingStyle);
|
|
1394
|
+
setSwipeRelease(null);
|
|
1395
|
+
});
|
|
1396
|
+
const finishNestedSwipe = useStableCallback(() => {
|
|
1397
|
+
if (!nestedSwipeActiveRef.current) return;
|
|
1398
|
+
nestedSwipeActiveRef.current = false;
|
|
1399
|
+
notifyParentSwipingChange?.(false);
|
|
1400
|
+
});
|
|
1401
|
+
const applySwipeProgress = useStableCallback(({ resolvedProgress, shouldTrackProgress, notifyParent }) => {
|
|
1402
|
+
const isActive = open && !nested && shouldTrackProgress;
|
|
1403
|
+
const swipeProgress = isActive ? resolvedProgress : 0;
|
|
1404
|
+
const nestedSwipeProgress = open && shouldTrackProgress ? resolvedProgress : 0;
|
|
1405
|
+
if (notifyParent && notifyParentSwipeProgressChange) {
|
|
1406
|
+
notifyParentSwipeProgressChange(nestedSwipeProgress);
|
|
1407
|
+
if (nestedSwipeProgress <= 0) finishNestedSwipe();
|
|
1408
|
+
}
|
|
1409
|
+
visualStateStore?.set({
|
|
1410
|
+
swipeProgress,
|
|
1411
|
+
frontmostHeight: swipeProgress > 0 ? frontmostHeight : 0
|
|
1412
|
+
});
|
|
1413
|
+
const backdropElement = backdropRef.current;
|
|
1414
|
+
if (!backdropElement) return;
|
|
1415
|
+
if (!isActive || swipeProgress <= 0) {
|
|
1416
|
+
backdropElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, "0");
|
|
1417
|
+
backdropElement.style.removeProperty(DrawerPopupCssVars.height);
|
|
1418
|
+
return;
|
|
1419
|
+
}
|
|
1420
|
+
backdropElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, `${swipeProgress}`);
|
|
1421
|
+
if (frontmostHeight > 0) backdropElement.style.setProperty(DrawerPopupCssVars.height, `${frontmostHeight}px`);
|
|
1422
|
+
else backdropElement.style.removeProperty(DrawerPopupCssVars.height);
|
|
1423
|
+
});
|
|
1424
|
+
function resolveSwipeRelease({ direction, deltaX, deltaY, velocityX, velocityY, releaseVelocityX, releaseVelocityY }) {
|
|
1425
|
+
if (!direction) return null;
|
|
1426
|
+
const popupElement = store.context.popupRef.current;
|
|
1427
|
+
if (!popupElement) return null;
|
|
1428
|
+
const size = direction === "left" || direction === "right" ? popupElement.offsetWidth : popupElement.offsetHeight;
|
|
1429
|
+
if (!Number.isFinite(size) || size <= 0) return null;
|
|
1430
|
+
const axisDelta = direction === "left" || direction === "right" ? deltaX : deltaY;
|
|
1431
|
+
const snapPointBaseOffset = snapPoints && snapPoints.length > 0 ? activeSnapPointOffset ?? 0 : 0;
|
|
1432
|
+
let baseOffset = 0;
|
|
1433
|
+
if (direction === "down") baseOffset = snapPointBaseOffset;
|
|
1434
|
+
else if (direction === "up") baseOffset = -snapPointBaseOffset;
|
|
1435
|
+
const translation = baseOffset + axisDelta;
|
|
1436
|
+
const translationAlongDirection = direction === "left" || direction === "up" ? -translation : translation;
|
|
1437
|
+
const remainingDistance = Math.max(0, size - translationAlongDirection);
|
|
1438
|
+
if (!Number.isFinite(remainingDistance) || remainingDistance <= 0) return null;
|
|
1439
|
+
const axisVelocity = direction === "left" || direction === "right" ? releaseVelocityX : releaseVelocityY;
|
|
1440
|
+
const fallbackVelocity = direction === "left" || direction === "right" ? velocityX : velocityY;
|
|
1441
|
+
const resolvedVelocity = Math.abs(axisVelocity) > 0 && Number.isFinite(axisVelocity) ? axisVelocity : fallbackVelocity;
|
|
1442
|
+
const directionalVelocity = direction === "left" || direction === "up" ? -resolvedVelocity : resolvedVelocity;
|
|
1443
|
+
if (!Number.isFinite(directionalVelocity) || directionalVelocity <= MIN_SWIPE_RELEASE_VELOCITY) return null;
|
|
1444
|
+
const durationMs = clamp(remainingDistance / clamp(directionalVelocity, MIN_SWIPE_RELEASE_VELOCITY, MAX_SWIPE_RELEASE_VELOCITY), MIN_SWIPE_RELEASE_DURATION_MS, MAX_SWIPE_RELEASE_DURATION_MS);
|
|
1445
|
+
if (!Number.isFinite(durationMs)) return null;
|
|
1446
|
+
const normalizedDuration = (durationMs - MIN_SWIPE_RELEASE_DURATION_MS) / (MAX_SWIPE_RELEASE_DURATION_MS - MIN_SWIPE_RELEASE_DURATION_MS);
|
|
1447
|
+
const durationScalar = clamp(MIN_SWIPE_RELEASE_SCALAR + normalizedDuration * (MAX_SWIPE_RELEASE_SCALAR - MIN_SWIPE_RELEASE_SCALAR), MIN_SWIPE_RELEASE_SCALAR, MAX_SWIPE_RELEASE_SCALAR);
|
|
1448
|
+
if (!Number.isFinite(durationScalar) || durationScalar <= 0) return null;
|
|
1449
|
+
return durationScalar;
|
|
1450
|
+
}
|
|
1451
|
+
function updateNestedSwipeActive(details) {
|
|
1452
|
+
if (nestedSwipeActiveRef.current || !details) return;
|
|
1453
|
+
const direction = details.direction ?? swipeDirection;
|
|
1454
|
+
const delta = direction === "left" || direction === "right" ? details.deltaX : details.deltaY;
|
|
1455
|
+
if (!Number.isFinite(delta) || Math.abs(delta) < MIN_SWIPE_THRESHOLD) return;
|
|
1456
|
+
nestedSwipeActiveRef.current = true;
|
|
1457
|
+
notifyParentSwipingChange?.(true);
|
|
1458
|
+
}
|
|
1459
|
+
const swipe$1 = useSwipeDismiss({
|
|
1460
|
+
enabled: mounted && !nestedDrawerOpen,
|
|
1461
|
+
directions: swipeDirections,
|
|
1462
|
+
elementRef: store.context.popupRef,
|
|
1463
|
+
ignoreSelectorWhenTouch: false,
|
|
1464
|
+
ignoreScrollableAncestors: true,
|
|
1465
|
+
movementCssVars: {
|
|
1466
|
+
x: DrawerPopupCssVars.swipeMovementX,
|
|
1467
|
+
y: DrawerPopupCssVars.swipeMovementY
|
|
1468
|
+
},
|
|
1469
|
+
onSwipeStart(event) {
|
|
1470
|
+
if ("touches" in event || "pointerType" in event && event.pointerType === "touch") return;
|
|
1471
|
+
const popupElement = popupRef.current;
|
|
1472
|
+
if (!popupElement) return;
|
|
1473
|
+
const selection = ownerDocument(popupElement).getSelection?.();
|
|
1474
|
+
if (!selection || selection.isCollapsed) return;
|
|
1475
|
+
const anchorElement = isElement(selection.anchorNode) ? selection.anchorNode : selection.anchorNode?.parentElement;
|
|
1476
|
+
const focusElement = isElement(selection.focusNode) ? selection.focusNode : selection.focusNode?.parentElement;
|
|
1477
|
+
if (!contains(popupElement, anchorElement) && !contains(popupElement, focusElement)) return;
|
|
1478
|
+
selection.removeAllRanges();
|
|
1479
|
+
},
|
|
1480
|
+
onSwipingChange(swiping) {
|
|
1481
|
+
swipingRef.current = swiping;
|
|
1482
|
+
setBackdropSwipingAttribute(store.context.backdropRef.current, swiping);
|
|
1483
|
+
if (!swiping && !notifyParentSwipeProgressChange) finishNestedSwipe();
|
|
1484
|
+
},
|
|
1485
|
+
swipeThreshold({ element, direction }) {
|
|
1486
|
+
return getBaseSwipeThreshold(element, direction);
|
|
1487
|
+
},
|
|
1488
|
+
canStart(position, details) {
|
|
1489
|
+
const popupElement = store.context.popupRef.current;
|
|
1490
|
+
if (!popupElement) return false;
|
|
1491
|
+
const doc = popupElement.ownerDocument;
|
|
1492
|
+
const elementAtPoint = getElementAtPoint(doc, position.x, position.y);
|
|
1493
|
+
if (!elementAtPoint || !contains(popupElement, elementAtPoint)) return false;
|
|
1494
|
+
const nativeEvent = details.nativeEvent;
|
|
1495
|
+
if (("touches" in nativeEvent || "pointerType" in nativeEvent && nativeEvent.pointerType === "touch") && shouldIgnoreSwipeForTextSelection(doc, popupElement)) return false;
|
|
1496
|
+
if (nativeEvent.type === "touchstart" && isSwipeIgnoredTarget(elementAtPoint)) return false;
|
|
1497
|
+
return true;
|
|
1498
|
+
},
|
|
1499
|
+
onProgress(progress, details) {
|
|
1500
|
+
updateNestedSwipeActive(details);
|
|
1501
|
+
const hasSnapPoints = Boolean(snapPoints && snapPoints.length > 0);
|
|
1502
|
+
if (swipingRef.current && swipeDirection === "down" && hasSnapPoints && details && Number.isFinite(details.deltaY)) {
|
|
1503
|
+
const popupElement = store.context.popupRef.current;
|
|
1504
|
+
if (popupElement) {
|
|
1505
|
+
popupElement.style.removeProperty("transform");
|
|
1506
|
+
popupElement.style.setProperty(DrawerPopupCssVars.swipeMovementY, `${getSnapPointSwipeMovement(activeSnapPointOffset ?? 0, details.deltaY)}px`);
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
const currentDirection = details?.direction ?? swipe$1.swipeDirection;
|
|
1510
|
+
const shouldTrackProgress = hasSnapPoints && (swipeDirection === "down" || swipeDirection === "up") || !hasSnapPoints || swipeDirection === "left" || swipeDirection === "right" || currentDirection === void 0 || currentDirection === swipeDirection;
|
|
1511
|
+
let resolvedProgress = progress;
|
|
1512
|
+
if (snapPointRange && popupHeight > 0) {
|
|
1513
|
+
if (details && Number.isFinite(details.deltaY)) resolvedProgress = clamp((clamp((activeSnapPointOffset ?? snapPointRange.minOffset) + details.deltaY, 0, popupHeight) - snapPointRange.minOffset) / snapPointRange.range, 0, 1);
|
|
1514
|
+
else if (snapPointProgress !== null) resolvedProgress = snapPointProgress;
|
|
1515
|
+
else if (currentDirection === "down" || currentDirection === "up") {
|
|
1516
|
+
const displacement = progress * popupHeight;
|
|
1517
|
+
const baseOffset = activeSnapPointOffset ?? snapPointRange.minOffset;
|
|
1518
|
+
resolvedProgress = clamp(((currentDirection === "down" ? baseOffset + displacement : baseOffset - displacement) - snapPointRange.minOffset) / snapPointRange.range, 0, 1);
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
applySwipeProgress({
|
|
1522
|
+
resolvedProgress,
|
|
1523
|
+
shouldTrackProgress,
|
|
1524
|
+
notifyParent: true
|
|
1525
|
+
});
|
|
1526
|
+
},
|
|
1527
|
+
onRelease({ event, deltaX, deltaY, direction, velocityX, velocityY, releaseVelocityX, releaseVelocityY }) {
|
|
1528
|
+
const swipeReleasePayload = {
|
|
1529
|
+
deltaX,
|
|
1530
|
+
deltaY,
|
|
1531
|
+
velocityX,
|
|
1532
|
+
velocityY,
|
|
1533
|
+
releaseVelocityX,
|
|
1534
|
+
releaseVelocityY
|
|
1535
|
+
};
|
|
1536
|
+
function startSwipeRelease(resolvedDirection) {
|
|
1537
|
+
const popupElement = store.context.popupRef.current;
|
|
1538
|
+
if (!popupElement) return;
|
|
1539
|
+
finishNestedSwipe();
|
|
1540
|
+
setSwipeDismissed(true);
|
|
1541
|
+
popupElement.style.removeProperty("transition");
|
|
1542
|
+
popupElement.setAttribute(TransitionStatusDataAttributes.endingStyle, "");
|
|
1543
|
+
ReactDOM.flushSync(() => {
|
|
1544
|
+
setSwipeRelease(resolveSwipeRelease({
|
|
1545
|
+
direction: resolvedDirection,
|
|
1546
|
+
...swipeReleasePayload
|
|
1547
|
+
}));
|
|
1548
|
+
});
|
|
1549
|
+
}
|
|
1550
|
+
if (!snapPoints || snapPoints.length === 0) {
|
|
1551
|
+
if (!direction) {
|
|
1552
|
+
clearSwipeRelease();
|
|
1553
|
+
return;
|
|
1554
|
+
}
|
|
1555
|
+
const element = store.context.popupRef.current;
|
|
1556
|
+
if (!element) {
|
|
1557
|
+
clearSwipeRelease();
|
|
1558
|
+
return;
|
|
1559
|
+
}
|
|
1560
|
+
const baseThreshold = getBaseSwipeThreshold(element, direction);
|
|
1561
|
+
const delta = direction === "left" || direction === "right" ? deltaX : deltaY;
|
|
1562
|
+
if (!Number.isFinite(delta)) {
|
|
1563
|
+
clearSwipeRelease();
|
|
1564
|
+
return;
|
|
1565
|
+
}
|
|
1566
|
+
const directionalDelta = direction === "left" || direction === "up" ? -delta : delta;
|
|
1567
|
+
if (directionalDelta <= 0) {
|
|
1568
|
+
clearSwipeRelease();
|
|
1569
|
+
return false;
|
|
1570
|
+
}
|
|
1571
|
+
const velocity = direction === "left" || direction === "right" ? velocityX : velocityY;
|
|
1572
|
+
if ((direction === "left" || direction === "up" ? -velocity : velocity) >= FAST_SWIPE_VELOCITY && directionalDelta > 0) {
|
|
1573
|
+
startSwipeRelease(direction);
|
|
1574
|
+
return true;
|
|
1575
|
+
}
|
|
1576
|
+
const shouldClose = directionalDelta > baseThreshold;
|
|
1577
|
+
if (shouldClose) startSwipeRelease(direction);
|
|
1578
|
+
else clearSwipeRelease();
|
|
1579
|
+
return shouldClose;
|
|
1580
|
+
}
|
|
1581
|
+
if (swipeDirection !== "down" && swipeDirection !== "up") {
|
|
1582
|
+
clearSwipeRelease();
|
|
1583
|
+
return;
|
|
1584
|
+
}
|
|
1585
|
+
if (!popupHeight || resolvedSnapPoints.length === 0) {
|
|
1586
|
+
clearSwipeRelease();
|
|
1587
|
+
return;
|
|
1588
|
+
}
|
|
1589
|
+
const dragDelta = swipeDirection === "down" ? deltaY : -deltaY;
|
|
1590
|
+
if (!Number.isFinite(dragDelta)) {
|
|
1591
|
+
clearSwipeRelease();
|
|
1592
|
+
return;
|
|
1593
|
+
}
|
|
1594
|
+
const dragDirection = Math.sign(dragDelta);
|
|
1595
|
+
const releaseDirectionalVelocity = swipeDirection === "down" ? releaseVelocityY : -releaseVelocityY;
|
|
1596
|
+
const fallbackDirectionalVelocity = swipeDirection === "down" ? velocityY : -velocityY;
|
|
1597
|
+
let resolvedDirectionalVelocity = Number.isFinite(releaseDirectionalVelocity) ? releaseDirectionalVelocity : fallbackDirectionalVelocity;
|
|
1598
|
+
if (dragDirection !== 0 && Math.abs(dragDelta) >= MIN_SWIPE_THRESHOLD && Number.isFinite(resolvedDirectionalVelocity)) {
|
|
1599
|
+
const velocityDirection = Math.sign(resolvedDirectionalVelocity);
|
|
1600
|
+
if (velocityDirection !== 0 && velocityDirection !== dragDirection) resolvedDirectionalVelocity = fallbackDirectionalVelocity;
|
|
1601
|
+
}
|
|
1602
|
+
const currentOffset = activeSnapPointOffset ?? 0;
|
|
1603
|
+
const dragTargetOffset = clamp(currentOffset + dragDelta, 0, popupHeight);
|
|
1604
|
+
const velocityOffset = Number.isFinite(resolvedDirectionalVelocity) && Math.abs(resolvedDirectionalVelocity) >= SNAP_VELOCITY_THRESHOLD ? clamp(resolvedDirectionalVelocity, -4, MAX_SNAP_VELOCITY) * SNAP_VELOCITY_MULTIPLIER : 0;
|
|
1605
|
+
const targetOffset = snapToSequentialPoints ? dragTargetOffset : clamp(dragTargetOffset + velocityOffset, 0, popupHeight);
|
|
1606
|
+
const snapPointEventDetails = createChangeEventDetails(swipe, event);
|
|
1607
|
+
const closeFromSnapPoints = () => {
|
|
1608
|
+
pendingSwipeCloseSnapPointRef.current = activeSnapPoint;
|
|
1609
|
+
setActiveSnapPoint?.(null, snapPointEventDetails);
|
|
1610
|
+
startSwipeRelease(swipeDirection);
|
|
1611
|
+
return true;
|
|
1612
|
+
};
|
|
1613
|
+
if (snapToSequentialPoints) {
|
|
1614
|
+
const orderedSnapPoints = [...resolvedSnapPoints].sort((first, second) => first.offset - second.offset);
|
|
1615
|
+
if (orderedSnapPoints.length === 0) {
|
|
1616
|
+
clearSwipeRelease();
|
|
1617
|
+
return false;
|
|
1618
|
+
}
|
|
1619
|
+
let currentIndex = 0;
|
|
1620
|
+
let closestDistance = Math.abs(currentOffset - orderedSnapPoints[0].offset);
|
|
1621
|
+
for (let index = 1; index < orderedSnapPoints.length; index += 1) {
|
|
1622
|
+
const distance = Math.abs(currentOffset - orderedSnapPoints[index].offset);
|
|
1623
|
+
if (distance < closestDistance) {
|
|
1624
|
+
closestDistance = distance;
|
|
1625
|
+
currentIndex = index;
|
|
1626
|
+
}
|
|
1627
|
+
}
|
|
1628
|
+
let targetSnapPoint = orderedSnapPoints[0];
|
|
1629
|
+
closestDistance = Math.abs(targetOffset - targetSnapPoint.offset);
|
|
1630
|
+
for (const snapPoint of orderedSnapPoints) {
|
|
1631
|
+
const distance = Math.abs(targetOffset - snapPoint.offset);
|
|
1632
|
+
if (distance < closestDistance) {
|
|
1633
|
+
closestDistance = distance;
|
|
1634
|
+
targetSnapPoint = snapPoint;
|
|
1635
|
+
}
|
|
1636
|
+
}
|
|
1637
|
+
const velocityDirection = Math.sign(resolvedDirectionalVelocity);
|
|
1638
|
+
const shouldAdvance = dragDirection !== 0 && velocityDirection !== 0 && velocityDirection === dragDirection && Math.abs(resolvedDirectionalVelocity) >= SNAP_VELOCITY_THRESHOLD;
|
|
1639
|
+
let effectiveTargetOffset = targetOffset;
|
|
1640
|
+
if (shouldAdvance) {
|
|
1641
|
+
const adjacentIndex = clamp(currentIndex + dragDirection, 0, orderedSnapPoints.length - 1);
|
|
1642
|
+
if (adjacentIndex !== currentIndex) {
|
|
1643
|
+
const adjacentPoint = orderedSnapPoints[adjacentIndex];
|
|
1644
|
+
if (dragDirection > 0 ? targetOffset < adjacentPoint.offset : targetOffset > adjacentPoint.offset) {
|
|
1645
|
+
targetSnapPoint = adjacentPoint;
|
|
1646
|
+
effectiveTargetOffset = adjacentPoint.offset;
|
|
1647
|
+
}
|
|
1648
|
+
} else if (dragDirection > 0) return closeFromSnapPoints();
|
|
1649
|
+
}
|
|
1650
|
+
if (Math.abs(effectiveTargetOffset - popupHeight) < Math.abs(effectiveTargetOffset - targetSnapPoint.offset)) return closeFromSnapPoints();
|
|
1651
|
+
setActiveSnapPoint?.(targetSnapPoint.value, snapPointEventDetails);
|
|
1652
|
+
clearSwipeRelease();
|
|
1653
|
+
return false;
|
|
1654
|
+
}
|
|
1655
|
+
if (resolvedDirectionalVelocity >= FAST_SWIPE_VELOCITY && dragDelta > 0) return closeFromSnapPoints();
|
|
1656
|
+
let closestSnapPoint = resolvedSnapPoints[0];
|
|
1657
|
+
let closestDistance = Math.abs(targetOffset - closestSnapPoint.offset);
|
|
1658
|
+
for (const snapPoint of resolvedSnapPoints) {
|
|
1659
|
+
const distance = Math.abs(targetOffset - snapPoint.offset);
|
|
1660
|
+
if (distance < closestDistance) {
|
|
1661
|
+
closestDistance = distance;
|
|
1662
|
+
closestSnapPoint = snapPoint;
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
if (Math.abs(targetOffset - popupHeight) < closestDistance) return closeFromSnapPoints();
|
|
1666
|
+
setActiveSnapPoint?.(closestSnapPoint.value, snapPointEventDetails);
|
|
1667
|
+
clearSwipeRelease();
|
|
1668
|
+
return false;
|
|
1669
|
+
},
|
|
1670
|
+
onDismiss(event) {
|
|
1671
|
+
visualStateStore?.set({
|
|
1672
|
+
swipeProgress: 0,
|
|
1673
|
+
frontmostHeight: 0
|
|
1674
|
+
});
|
|
1675
|
+
const backdropElement = store.context.backdropRef.current;
|
|
1676
|
+
if (backdropElement) {
|
|
1677
|
+
backdropElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, "0");
|
|
1678
|
+
backdropElement.style.removeProperty(DrawerPopupCssVars.height);
|
|
1679
|
+
}
|
|
1680
|
+
const dismissEventDetails = createChangeEventDetails(swipe, event);
|
|
1681
|
+
store.setOpen(false, dismissEventDetails);
|
|
1682
|
+
if (dismissEventDetails.isCanceled) {
|
|
1683
|
+
const pendingSnapPoint = pendingSwipeCloseSnapPointRef.current;
|
|
1684
|
+
if (pendingSnapPoint !== void 0) setActiveSnapPoint?.(pendingSnapPoint, createChangeEventDetails(swipe, event));
|
|
1685
|
+
pendingSwipeCloseSnapPointRef.current = void 0;
|
|
1686
|
+
resetSwipeRef.current?.();
|
|
1687
|
+
clearSwipeRelease();
|
|
1688
|
+
return;
|
|
1689
|
+
}
|
|
1690
|
+
if (store.select("open")) {
|
|
1691
|
+
const savedEvent = event;
|
|
1692
|
+
controlledDismissFrame.request(() => {
|
|
1693
|
+
if (store.select("open")) {
|
|
1694
|
+
const pendingSnapPoint = pendingSwipeCloseSnapPointRef.current;
|
|
1695
|
+
if (pendingSnapPoint !== void 0) setActiveSnapPoint?.(pendingSnapPoint, createChangeEventDetails(swipe, savedEvent));
|
|
1696
|
+
pendingSwipeCloseSnapPointRef.current = void 0;
|
|
1697
|
+
clearSwipeRelease();
|
|
1698
|
+
resetSwipeRef.current?.();
|
|
1699
|
+
} else pendingSwipeCloseSnapPointRef.current = void 0;
|
|
1700
|
+
});
|
|
1701
|
+
return;
|
|
1702
|
+
}
|
|
1703
|
+
pendingSwipeCloseSnapPointRef.current = void 0;
|
|
1704
|
+
setSwipeDismissed(true);
|
|
1705
|
+
}
|
|
1706
|
+
});
|
|
1707
|
+
const swipePointerProps = swipe$1.getPointerProps();
|
|
1708
|
+
const swipeTouchProps = swipe$1.getTouchProps();
|
|
1709
|
+
const { moveNative: moveSwipeNative, reset: resetSwipe } = swipe$1;
|
|
1710
|
+
resetSwipeRef.current = resetSwipe;
|
|
1711
|
+
React$1.useEffect(() => {
|
|
1712
|
+
const rootElement = viewportElement ?? popupElementState;
|
|
1713
|
+
if (!rootElement) return;
|
|
1714
|
+
const resolvedRootElement = rootElement;
|
|
1715
|
+
const doc = ownerDocument(resolvedRootElement);
|
|
1716
|
+
const win = getWindow(doc);
|
|
1717
|
+
function handleNativeTouchMove(event) {
|
|
1718
|
+
virtualKeyboard?.onTouchMove(event);
|
|
1719
|
+
if (ignoreTouchSwipeRef.current) return;
|
|
1720
|
+
const touchState = touchScrollStateRef.current;
|
|
1721
|
+
const touch = event.touches[0];
|
|
1722
|
+
if (!touch || !touchState) return;
|
|
1723
|
+
const drawerAxisDelta = isVerticalScrollAxis ? touch.clientY - touchState.lastY : touch.clientX - touchState.lastX;
|
|
1724
|
+
if (isEventOnRangeInput(event, win)) {
|
|
1725
|
+
touchState.allowSwipe = false;
|
|
1726
|
+
updateTouchScrollPosition(touchState, touch);
|
|
1727
|
+
return;
|
|
1728
|
+
}
|
|
1729
|
+
if (event.touches.length === 2) {
|
|
1730
|
+
updateTouchScrollPosition(touchState, touch);
|
|
1731
|
+
return;
|
|
1732
|
+
}
|
|
1733
|
+
if (shouldIgnoreSwipeForTextSelection(doc, resolvedRootElement) || !open || !mounted || nestedDrawerOpen) {
|
|
1734
|
+
updateTouchScrollPosition(touchState, touch);
|
|
1735
|
+
return;
|
|
1736
|
+
}
|
|
1737
|
+
if (preserveNativeCrossAxisScrollOnMove(touchState, touch, isVerticalScrollAxis)) {
|
|
1738
|
+
updateTouchScrollPosition(touchState, touch);
|
|
1739
|
+
return;
|
|
1740
|
+
}
|
|
1741
|
+
const scrollTarget = touchState.scrollTarget;
|
|
1742
|
+
if (!scrollTarget || scrollTarget === doc.documentElement || scrollTarget === doc.body) {
|
|
1743
|
+
if (event.cancelable) event.preventDefault();
|
|
1744
|
+
event.stopPropagation();
|
|
1745
|
+
moveSwipeNative(event, resolvedRootElement);
|
|
1746
|
+
updateTouchScrollPosition(touchState, touch);
|
|
1747
|
+
return;
|
|
1748
|
+
}
|
|
1749
|
+
if (!hasScrollableContentOnAxis(scrollTarget, scrollAxis)) {
|
|
1750
|
+
if (event.cancelable) event.preventDefault();
|
|
1751
|
+
event.stopPropagation();
|
|
1752
|
+
updateTouchScrollPosition(touchState, touch);
|
|
1753
|
+
return;
|
|
1754
|
+
}
|
|
1755
|
+
const delta = drawerAxisDelta;
|
|
1756
|
+
if (delta !== 0) {
|
|
1757
|
+
const canSwipeFromScrollEdge = canSwipeFromScrollEdgeOnMove(scrollTarget, scrollAxis, swipeDirection, delta);
|
|
1758
|
+
if (!touchState.allowSwipe) if (!event.cancelable) touchState.allowSwipe = false;
|
|
1759
|
+
else if (canSwipeFromScrollEdge) {
|
|
1760
|
+
touchState.allowSwipe = true;
|
|
1761
|
+
event.preventDefault();
|
|
1762
|
+
} else touchState.allowSwipe = false;
|
|
1763
|
+
else if (event.cancelable) event.preventDefault();
|
|
1764
|
+
}
|
|
1765
|
+
if (touchState.allowSwipe === true) {
|
|
1766
|
+
event.stopPropagation();
|
|
1767
|
+
moveSwipeNative(event, resolvedRootElement);
|
|
1768
|
+
}
|
|
1769
|
+
updateTouchScrollPosition(touchState, touch);
|
|
1770
|
+
}
|
|
1771
|
+
return addEventListener(doc, "touchmove", handleNativeTouchMove, {
|
|
1772
|
+
passive: false,
|
|
1773
|
+
capture: true
|
|
1774
|
+
});
|
|
1775
|
+
}, [
|
|
1776
|
+
mounted,
|
|
1777
|
+
nestedDrawerOpen,
|
|
1778
|
+
open,
|
|
1779
|
+
popupElementState,
|
|
1780
|
+
isVerticalScrollAxis,
|
|
1781
|
+
scrollAxis,
|
|
1782
|
+
swipeDirection,
|
|
1783
|
+
moveSwipeNative,
|
|
1784
|
+
viewportElement,
|
|
1785
|
+
virtualKeyboard
|
|
1786
|
+
]);
|
|
1787
|
+
React$1.useEffect(() => {
|
|
1788
|
+
if (!snapPointRange || swipe$1.swiping) return;
|
|
1789
|
+
applySwipeProgress({
|
|
1790
|
+
resolvedProgress: !open || nested ? 0 : snapPointProgress ?? 0,
|
|
1791
|
+
shouldTrackProgress: true,
|
|
1792
|
+
notifyParent: false
|
|
1793
|
+
});
|
|
1794
|
+
}, [
|
|
1795
|
+
applySwipeProgress,
|
|
1796
|
+
frontmostHeight,
|
|
1797
|
+
nested,
|
|
1798
|
+
notifyParentSwipeProgressChange,
|
|
1799
|
+
open,
|
|
1800
|
+
snapPointProgress,
|
|
1801
|
+
snapPointRange,
|
|
1802
|
+
swipe$1.swiping,
|
|
1803
|
+
store,
|
|
1804
|
+
visualStateStore
|
|
1805
|
+
]);
|
|
1806
|
+
React$1.useEffect(() => {
|
|
1807
|
+
if (!notifyParentSwipeProgressChange) return;
|
|
1808
|
+
if (!open) notifyParentSwipeProgressChange(0);
|
|
1809
|
+
return () => {
|
|
1810
|
+
notifyParentSwipeProgressChange(0);
|
|
1811
|
+
};
|
|
1812
|
+
}, [notifyParentSwipeProgressChange, open]);
|
|
1813
|
+
React$1.useEffect(() => {
|
|
1814
|
+
if (open) {
|
|
1815
|
+
resetSwipe();
|
|
1816
|
+
clearSwipeRelease();
|
|
1817
|
+
}
|
|
1818
|
+
}, [
|
|
1819
|
+
clearSwipeRelease,
|
|
1820
|
+
open,
|
|
1821
|
+
resetSwipe
|
|
1822
|
+
]);
|
|
1823
|
+
React$1.useEffect(() => {
|
|
1824
|
+
const backdropElement = backdropRef.current;
|
|
1825
|
+
return () => {
|
|
1826
|
+
visualStateStore?.set({
|
|
1827
|
+
swipeProgress: 0,
|
|
1828
|
+
frontmostHeight: 0
|
|
1829
|
+
});
|
|
1830
|
+
setBackdropSwipingAttribute(backdropElement, false);
|
|
1831
|
+
const currentBackdrop = backdropRef.current;
|
|
1832
|
+
if (currentBackdrop !== backdropElement) setBackdropSwipingAttribute(currentBackdrop, false);
|
|
1833
|
+
finishNestedSwipe();
|
|
1834
|
+
};
|
|
1835
|
+
}, [
|
|
1836
|
+
backdropRef,
|
|
1837
|
+
finishNestedSwipe,
|
|
1838
|
+
visualStateStore
|
|
1839
|
+
]);
|
|
1840
|
+
const swipeProviderValue = React$1.useMemo(() => ({
|
|
1841
|
+
swiping: swipe$1.swiping,
|
|
1842
|
+
getDragStyles: swipe$1.getDragStyles,
|
|
1843
|
+
swipeStrength: swipeRelease ?? null,
|
|
1844
|
+
setSwipeDismissed
|
|
1845
|
+
}), [
|
|
1846
|
+
setSwipeDismissed,
|
|
1847
|
+
swipe$1.getDragStyles,
|
|
1848
|
+
swipe$1.swiping,
|
|
1849
|
+
swipeRelease
|
|
1850
|
+
]);
|
|
1851
|
+
function resetTouchTrackingState() {
|
|
1852
|
+
ignoreTouchSwipeRef.current = false;
|
|
1853
|
+
touchScrollStateRef.current = null;
|
|
1854
|
+
lastPointerTypeRef.current = "";
|
|
1855
|
+
ignoreNextTouchStartFromPenRef.current = false;
|
|
1856
|
+
}
|
|
1857
|
+
return /*#__PURE__*/ jsx(DialogViewport, {
|
|
1858
|
+
ref: forwardedRef,
|
|
1859
|
+
className,
|
|
1860
|
+
style,
|
|
1861
|
+
render,
|
|
1862
|
+
...mergeProps(elementProps, {
|
|
1863
|
+
onPointerDown(event) {
|
|
1864
|
+
lastPointerTypeRef.current = event.pointerType;
|
|
1865
|
+
ignoreNextTouchStartFromPenRef.current = event.pointerType === "pen";
|
|
1866
|
+
if (!open || !mounted || nestedDrawerOpen) return;
|
|
1867
|
+
const elementAtPoint = getElementAtPoint(ownerDocument(event.currentTarget), event.clientX, event.clientY);
|
|
1868
|
+
if (isSwipeIgnoredTarget(elementAtPoint) || isDrawerContentTarget(elementAtPoint)) return;
|
|
1869
|
+
if (event.pointerType === "touch") return;
|
|
1870
|
+
swipePointerProps.onPointerDown?.(event);
|
|
1871
|
+
},
|
|
1872
|
+
onPointerMove(event) {
|
|
1873
|
+
if (event.pointerType === "touch") return;
|
|
1874
|
+
swipePointerProps.onPointerMove?.(event);
|
|
1875
|
+
},
|
|
1876
|
+
onPointerUp(event) {
|
|
1877
|
+
if (lastPointerTypeRef.current === event.pointerType) lastPointerTypeRef.current = "";
|
|
1878
|
+
if (event.pointerType === "touch") return;
|
|
1879
|
+
swipePointerProps.onPointerUp?.(event);
|
|
1880
|
+
},
|
|
1881
|
+
onPointerCancel(event) {
|
|
1882
|
+
if (lastPointerTypeRef.current === event.pointerType) lastPointerTypeRef.current = "";
|
|
1883
|
+
if (event.pointerType === "touch") return;
|
|
1884
|
+
swipePointerProps.onPointerCancel?.(event);
|
|
1885
|
+
},
|
|
1886
|
+
onTouchStart(event) {
|
|
1887
|
+
if (lastPointerTypeRef.current === "pen" && ignoreNextTouchStartFromPenRef.current) {
|
|
1888
|
+
ignoreNextTouchStartFromPenRef.current = false;
|
|
1889
|
+
ignoreTouchSwipeRef.current = false;
|
|
1890
|
+
touchScrollStateRef.current = null;
|
|
1891
|
+
return;
|
|
1892
|
+
}
|
|
1893
|
+
if (!open || !mounted || nestedDrawerOpen) {
|
|
1894
|
+
ignoreTouchSwipeRef.current = false;
|
|
1895
|
+
touchScrollStateRef.current = null;
|
|
1896
|
+
return;
|
|
1897
|
+
}
|
|
1898
|
+
const touch = event.touches[0];
|
|
1899
|
+
if (!touch) return;
|
|
1900
|
+
if (isReactTouchEventOnRangeInput(event)) {
|
|
1901
|
+
ignoreTouchSwipeRef.current = false;
|
|
1902
|
+
touchScrollStateRef.current = null;
|
|
1903
|
+
return;
|
|
1904
|
+
}
|
|
1905
|
+
const elementAtPoint = getElementAtPoint(ownerDocument(event.currentTarget), touch.clientX, touch.clientY);
|
|
1906
|
+
const rootElement = viewportElement ?? popupElementState;
|
|
1907
|
+
const eventTarget = getTarget(event.nativeEvent);
|
|
1908
|
+
const target = isElement(eventTarget) ? eventTarget : null;
|
|
1909
|
+
if (rootElement && target && !contains(rootElement, target)) {
|
|
1910
|
+
ignoreTouchSwipeRef.current = true;
|
|
1911
|
+
touchScrollStateRef.current = null;
|
|
1912
|
+
return;
|
|
1913
|
+
}
|
|
1914
|
+
virtualKeyboard?.onTouchStart(event);
|
|
1915
|
+
ignoreTouchSwipeRef.current = isSwipeIgnoredTarget(elementAtPoint);
|
|
1916
|
+
if (ignoreTouchSwipeRef.current) {
|
|
1917
|
+
touchScrollStateRef.current = null;
|
|
1918
|
+
return;
|
|
1919
|
+
}
|
|
1920
|
+
let scrollTarget = null;
|
|
1921
|
+
let hasCrossAxisScrollableContent = false;
|
|
1922
|
+
if (rootElement && target) {
|
|
1923
|
+
scrollTarget = findScrollableTouchTarget(target, rootElement, scrollAxis);
|
|
1924
|
+
hasCrossAxisScrollableContent = findScrollableTouchTarget(target, rootElement, crossScrollAxis) != null;
|
|
1925
|
+
}
|
|
1926
|
+
let allowSwipe = null;
|
|
1927
|
+
if (scrollTarget) allowSwipe = isAtSwipeStartEdge(scrollTarget, scrollAxis, swipeDirection) ? null : false;
|
|
1928
|
+
touchScrollStateRef.current = {
|
|
1929
|
+
startX: touch.clientX,
|
|
1930
|
+
startY: touch.clientY,
|
|
1931
|
+
lastX: touch.clientX,
|
|
1932
|
+
lastY: touch.clientY,
|
|
1933
|
+
scrollTarget,
|
|
1934
|
+
hasCrossAxisScrollableContent,
|
|
1935
|
+
allowSwipe,
|
|
1936
|
+
preserveNativeCrossAxisScroll: false
|
|
1937
|
+
};
|
|
1938
|
+
swipeTouchProps.onTouchStart?.(event);
|
|
1939
|
+
},
|
|
1940
|
+
onTouchEnd(event) {
|
|
1941
|
+
virtualKeyboard?.onTouchEnd(event);
|
|
1942
|
+
resetTouchTrackingState();
|
|
1943
|
+
swipeTouchProps.onTouchEnd?.(event);
|
|
1944
|
+
},
|
|
1945
|
+
onTouchCancel(event) {
|
|
1946
|
+
virtualKeyboard?.onTouchCancel();
|
|
1947
|
+
resetTouchTrackingState();
|
|
1948
|
+
swipeTouchProps.onTouchCancel?.(event);
|
|
1949
|
+
},
|
|
1950
|
+
["data-nested-dialog-open"]: void 0
|
|
1951
|
+
}),
|
|
1952
|
+
children: /*#__PURE__*/ jsx(DrawerViewportContext.Provider, {
|
|
1953
|
+
value: swipeProviderValue,
|
|
1954
|
+
children
|
|
1955
|
+
})
|
|
1956
|
+
});
|
|
1957
|
+
});
|
|
1958
|
+
DrawerViewport.displayName = "DrawerViewport";
|
|
1959
|
+
function setSwipeDismissedElements(popupElement, backdropElement, dismissed) {
|
|
1960
|
+
if (dismissed) {
|
|
1961
|
+
popupElement?.setAttribute(DrawerPopupDataAttributes.swipeDismiss, "");
|
|
1962
|
+
backdropElement?.setAttribute(DrawerPopupDataAttributes.swipeDismiss, "");
|
|
1963
|
+
return;
|
|
1964
|
+
}
|
|
1965
|
+
popupElement?.removeAttribute(DrawerPopupDataAttributes.swipeDismiss);
|
|
1966
|
+
backdropElement?.removeAttribute(DrawerPopupDataAttributes.swipeDismiss);
|
|
1967
|
+
}
|
|
1968
|
+
function setBackdropSwipingAttribute(backdropElement, swiping) {
|
|
1969
|
+
if (!backdropElement) return;
|
|
1970
|
+
if (swiping) {
|
|
1971
|
+
backdropElement.setAttribute(DrawerPopupDataAttributes.swiping, "");
|
|
1972
|
+
return;
|
|
1973
|
+
}
|
|
1974
|
+
backdropElement.removeAttribute(DrawerPopupDataAttributes.swiping);
|
|
1975
|
+
}
|
|
1976
|
+
function isSwipeIgnoredTarget(target) {
|
|
1977
|
+
return Boolean(target?.closest(BASE_UI_SWIPE_IGNORE_SELECTOR));
|
|
1978
|
+
}
|
|
1979
|
+
function isDrawerContentTarget(target) {
|
|
1980
|
+
return Boolean(target?.closest(DRAWER_CONTENT_SELECTOR));
|
|
1981
|
+
}
|
|
1982
|
+
function getBaseSwipeThreshold(element, direction) {
|
|
1983
|
+
const size = direction === "left" || direction === "right" ? element.offsetWidth : element.offsetHeight;
|
|
1984
|
+
return Math.max(size * .5, MIN_SWIPE_THRESHOLD);
|
|
1985
|
+
}
|
|
1986
|
+
function isRangeInput(target, win) {
|
|
1987
|
+
return target instanceof win.HTMLInputElement && target.type === "range";
|
|
1988
|
+
}
|
|
1989
|
+
function isTextSelectionControl(target) {
|
|
1990
|
+
if (!isElement(target)) return false;
|
|
1991
|
+
return target.tagName === "INPUT" || target.tagName === "TEXTAREA";
|
|
1992
|
+
}
|
|
1993
|
+
function hasExpandedSelectionWithinTarget(selection, target) {
|
|
1994
|
+
const anchorElement = isElement(selection.anchorNode) ? selection.anchorNode : selection.anchorNode?.parentElement;
|
|
1995
|
+
const focusElement = isElement(selection.focusNode) ? selection.focusNode : selection.focusNode?.parentElement;
|
|
1996
|
+
return selection.containsNode(target, true) || contains(target, anchorElement) || contains(target, focusElement);
|
|
1997
|
+
}
|
|
1998
|
+
function shouldIgnoreSwipeForTextSelection(doc, rootElement) {
|
|
1999
|
+
const activeEl = activeElement(doc);
|
|
2000
|
+
if (Boolean(activeEl && contains(rootElement, activeEl)) && isTextSelectionControl(activeEl)) {
|
|
2001
|
+
const { selectionStart, selectionEnd } = activeEl;
|
|
2002
|
+
if (selectionStart != null && selectionEnd != null && selectionStart < selectionEnd) return true;
|
|
2003
|
+
}
|
|
2004
|
+
const selection = doc.getSelection?.();
|
|
2005
|
+
if (!selection || selection.isCollapsed) return false;
|
|
2006
|
+
return hasExpandedSelectionWithinTarget(selection, rootElement);
|
|
2007
|
+
}
|
|
2008
|
+
function isEventOnRangeInput(event, win) {
|
|
2009
|
+
const composedPath = event.composedPath();
|
|
2010
|
+
if (composedPath) return composedPath.some((pathTarget) => isRangeInput(pathTarget, win));
|
|
2011
|
+
return isRangeInput(getTarget(event), win);
|
|
2012
|
+
}
|
|
2013
|
+
function isReactTouchEventOnRangeInput(event) {
|
|
2014
|
+
return isEventOnRangeInput(event.nativeEvent, getWindow(event.currentTarget));
|
|
2015
|
+
}
|
|
2016
|
+
function updateTouchScrollPosition(touchState, touch) {
|
|
2017
|
+
touchState.lastX = touch.clientX;
|
|
2018
|
+
touchState.lastY = touch.clientY;
|
|
2019
|
+
}
|
|
2020
|
+
function preserveNativeCrossAxisScrollOnMove(touchState, touch, isVerticalScrollAxis) {
|
|
2021
|
+
if (touchState.preserveNativeCrossAxisScroll) return true;
|
|
2022
|
+
if (touchState.allowSwipe === true || !touchState.hasCrossAxisScrollableContent) return false;
|
|
2023
|
+
const drawerAxisGestureDelta = isVerticalScrollAxis ? touch.clientY - touchState.startY : touch.clientX - touchState.startX;
|
|
2024
|
+
const crossAxisGestureDelta = isVerticalScrollAxis ? touch.clientX - touchState.startX : touch.clientY - touchState.startY;
|
|
2025
|
+
const absDrawerAxisGestureDelta = Math.abs(drawerAxisGestureDelta);
|
|
2026
|
+
const absCrossAxisGestureDelta = Math.abs(crossAxisGestureDelta);
|
|
2027
|
+
if (absCrossAxisGestureDelta < 6 || absCrossAxisGestureDelta <= absDrawerAxisGestureDelta + 2) return false;
|
|
2028
|
+
touchState.preserveNativeCrossAxisScroll = true;
|
|
2029
|
+
return true;
|
|
2030
|
+
}
|
|
2031
|
+
function hasScrollableContentOnAxis(scrollTarget, axis) {
|
|
2032
|
+
return axis === "vertical" ? scrollTarget.scrollHeight > scrollTarget.clientHeight : scrollTarget.scrollWidth > scrollTarget.clientWidth;
|
|
2033
|
+
}
|
|
2034
|
+
function getScrollMetrics(scrollTarget, axis) {
|
|
2035
|
+
if (axis === "vertical") {
|
|
2036
|
+
const max = Math.max(0, scrollTarget.scrollHeight - scrollTarget.clientHeight);
|
|
2037
|
+
return {
|
|
2038
|
+
offset: scrollTarget.scrollTop,
|
|
2039
|
+
max
|
|
2040
|
+
};
|
|
2041
|
+
}
|
|
2042
|
+
const max = Math.max(0, scrollTarget.scrollWidth - scrollTarget.clientWidth);
|
|
2043
|
+
return {
|
|
2044
|
+
offset: scrollTarget.scrollLeft,
|
|
2045
|
+
max
|
|
2046
|
+
};
|
|
2047
|
+
}
|
|
2048
|
+
function isAtSwipeStartEdge(scrollTarget, axis, direction) {
|
|
2049
|
+
const { offset, max } = getScrollMetrics(scrollTarget, axis);
|
|
2050
|
+
const dismissFromStartEdge = shouldDismissFromStartEdge(direction, axis);
|
|
2051
|
+
if (dismissFromStartEdge === null) return false;
|
|
2052
|
+
return dismissFromStartEdge ? offset <= 0 : offset >= max;
|
|
2053
|
+
}
|
|
2054
|
+
function canSwipeFromScrollEdgeOnMove(scrollTarget, axis, direction, delta) {
|
|
2055
|
+
const { offset, max } = getScrollMetrics(scrollTarget, axis);
|
|
2056
|
+
const dismissFromStartEdge = shouldDismissFromStartEdge(direction, axis);
|
|
2057
|
+
if (dismissFromStartEdge === null) return false;
|
|
2058
|
+
if (!(dismissFromStartEdge ? delta > 0 : delta < 0)) return false;
|
|
2059
|
+
return dismissFromStartEdge ? offset <= 0 : offset >= max;
|
|
2060
|
+
}
|
|
2061
|
+
function shouldDismissFromStartEdge(direction, axis) {
|
|
2062
|
+
if (axis === "vertical") {
|
|
2063
|
+
if (direction === "down") return true;
|
|
2064
|
+
if (direction === "up") return false;
|
|
2065
|
+
return null;
|
|
2066
|
+
}
|
|
2067
|
+
if (direction === "right") return true;
|
|
2068
|
+
if (direction === "left") return false;
|
|
2069
|
+
return null;
|
|
2070
|
+
}
|
|
2071
|
+
//#endregion
|
|
2072
|
+
//#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/drawer/viewport/DrawerViewportCssVars.mjs
|
|
2073
|
+
let DrawerViewportCssVars = /*#__PURE__*/ function(DrawerViewportCssVars) {
|
|
2074
|
+
/**
|
|
2075
|
+
* The software keyboard inset, measured from the bottom edge of the layout viewport.
|
|
2076
|
+
* Present only when the drawer is wrapped in `Drawer.VirtualKeyboardProvider`.
|
|
2077
|
+
* @type {CSS length}
|
|
2078
|
+
*/
|
|
2079
|
+
DrawerViewportCssVars["keyboardInset"] = "--drawer-keyboard-inset";
|
|
2080
|
+
return DrawerViewportCssVars;
|
|
2081
|
+
}({});
|
|
2082
|
+
//#endregion
|
|
2083
|
+
//#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/drawer/virtual-keyboard-provider/DrawerVirtualKeyboardProvider.mjs
|
|
2084
|
+
const KEYBOARD_RESIZE_THRESHOLD = 60;
|
|
2085
|
+
const KEYBOARD_VISIBILITY_MARGIN = 16;
|
|
2086
|
+
const KEYBOARD_SCROLL_SLACK = 48;
|
|
2087
|
+
const INPUT_TAP_MOVE_THRESHOLD = 10;
|
|
2088
|
+
const INPUT_TAP_HIT_SLOP = 16;
|
|
2089
|
+
const KEYBOARD_INPUT_TYPES = /* @__PURE__ */ new Set([
|
|
2090
|
+
"email",
|
|
2091
|
+
"number",
|
|
2092
|
+
"password",
|
|
2093
|
+
"search",
|
|
2094
|
+
"tel",
|
|
2095
|
+
"text",
|
|
2096
|
+
"url"
|
|
2097
|
+
]);
|
|
2098
|
+
const KEYBOARD_TAP_BLOCKED = Symbol("KeyboardTapBlocked");
|
|
2099
|
+
/**
|
|
2100
|
+
* Provides keyboard-aware focus and scroll handling for bottom-sheet drawers with form fields.
|
|
2101
|
+
*
|
|
2102
|
+
* Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)
|
|
2103
|
+
*/
|
|
2104
|
+
function DrawerVirtualKeyboardProvider(props) {
|
|
2105
|
+
const { children } = props;
|
|
2106
|
+
const { store } = useDialogRootContext();
|
|
2107
|
+
const open = store.useState("open");
|
|
2108
|
+
const mounted = store.useState("mounted");
|
|
2109
|
+
const nestedOpenDialogCount = store.useState("nestedOpenDialogCount");
|
|
2110
|
+
const rootElement = store.useState("viewportElement");
|
|
2111
|
+
const nestedDrawerOpen = nestedOpenDialogCount > 0;
|
|
2112
|
+
const pendingKeyboardFocusMovedRef = React$1.useRef(false);
|
|
2113
|
+
const keyboardTouchStartRef = React$1.useRef(null);
|
|
2114
|
+
const focusedKeyboardTargetRef = React$1.useRef(null);
|
|
2115
|
+
const keyboardScrollAdjustmentRef = React$1.useRef(null);
|
|
2116
|
+
const keyboardFocusFrame = useAnimationFrame();
|
|
2117
|
+
const restoreKeyboardScrollAdjustment = useStableCallback(() => {
|
|
2118
|
+
const adjustment = keyboardScrollAdjustmentRef.current;
|
|
2119
|
+
if (!adjustment) return;
|
|
2120
|
+
adjustment.element.style.overflowAnchor = adjustment.overflowAnchor;
|
|
2121
|
+
adjustment.element.style.paddingBottom = adjustment.paddingBottom;
|
|
2122
|
+
adjustment.element.style.scrollPaddingBottom = adjustment.scrollPaddingBottom;
|
|
2123
|
+
keyboardScrollAdjustmentRef.current = null;
|
|
2124
|
+
});
|
|
2125
|
+
const setKeyboardScrollSlack = useStableCallback((element, slack) => {
|
|
2126
|
+
const roundedSlack = Math.max(0, Math.ceil(slack));
|
|
2127
|
+
let adjustment = keyboardScrollAdjustmentRef.current;
|
|
2128
|
+
if (adjustment && !adjustment.element.isConnected) {
|
|
2129
|
+
restoreKeyboardScrollAdjustment();
|
|
2130
|
+
adjustment = null;
|
|
2131
|
+
}
|
|
2132
|
+
if (roundedSlack === 0) {
|
|
2133
|
+
restoreKeyboardScrollAdjustment();
|
|
2134
|
+
return;
|
|
2135
|
+
}
|
|
2136
|
+
if (adjustment && adjustment.element !== element) {
|
|
2137
|
+
restoreKeyboardScrollAdjustment();
|
|
2138
|
+
adjustment = null;
|
|
2139
|
+
}
|
|
2140
|
+
if (!adjustment) {
|
|
2141
|
+
const styles = getComputedStyle$1(element);
|
|
2142
|
+
adjustment = {
|
|
2143
|
+
element,
|
|
2144
|
+
overflowAnchor: element.style.overflowAnchor,
|
|
2145
|
+
paddingBottom: element.style.paddingBottom,
|
|
2146
|
+
scrollPaddingBottom: element.style.scrollPaddingBottom,
|
|
2147
|
+
computedPaddingBottom: Number.parseFloat(styles.paddingBottom) || 0,
|
|
2148
|
+
computedScrollPaddingBottom: Number.parseFloat(styles.scrollPaddingBottom) || 0
|
|
2149
|
+
};
|
|
2150
|
+
keyboardScrollAdjustmentRef.current = adjustment;
|
|
2151
|
+
}
|
|
2152
|
+
element.style.overflowAnchor = "none";
|
|
2153
|
+
element.style.paddingBottom = `${adjustment.computedPaddingBottom + roundedSlack}px`;
|
|
2154
|
+
element.style.scrollPaddingBottom = `${adjustment.computedScrollPaddingBottom + KEYBOARD_VISIBILITY_MARGIN}px`;
|
|
2155
|
+
});
|
|
2156
|
+
const animateKeyboardScroll = useStableCallback((element, scrollTop) => {
|
|
2157
|
+
const behavior = getWindow(element).matchMedia?.("(prefers-reduced-motion: reduce)")?.matches ? "auto" : "smooth";
|
|
2158
|
+
element.scrollTo({
|
|
2159
|
+
top: scrollTop,
|
|
2160
|
+
behavior
|
|
2161
|
+
});
|
|
2162
|
+
});
|
|
2163
|
+
const resetTouchTrackingState = useStableCallback(() => {
|
|
2164
|
+
pendingKeyboardFocusMovedRef.current = false;
|
|
2165
|
+
keyboardTouchStartRef.current = null;
|
|
2166
|
+
});
|
|
2167
|
+
React$1.useEffect(() => {
|
|
2168
|
+
if (!mounted || !open) {
|
|
2169
|
+
focusedKeyboardTargetRef.current = null;
|
|
2170
|
+
restoreKeyboardScrollAdjustment();
|
|
2171
|
+
keyboardFocusFrame.cancel();
|
|
2172
|
+
return;
|
|
2173
|
+
}
|
|
2174
|
+
if (!rootElement) {
|
|
2175
|
+
restoreKeyboardScrollAdjustment();
|
|
2176
|
+
return;
|
|
2177
|
+
}
|
|
2178
|
+
const doc = ownerDocument(rootElement);
|
|
2179
|
+
const win = getWindow(rootElement);
|
|
2180
|
+
const visualViewport = win.visualViewport;
|
|
2181
|
+
const setDrawerKeyboardInset = (inset) => {
|
|
2182
|
+
rootElement.style.setProperty(DrawerViewportCssVars.keyboardInset, `${Math.max(0, Math.ceil(inset))}px`);
|
|
2183
|
+
};
|
|
2184
|
+
const resetDrawerKeyboardInset = () => {
|
|
2185
|
+
setDrawerKeyboardInset(0);
|
|
2186
|
+
};
|
|
2187
|
+
const clearFocusedKeyboardTarget = () => {
|
|
2188
|
+
focusedKeyboardTargetRef.current = null;
|
|
2189
|
+
resetDrawerKeyboardInset();
|
|
2190
|
+
restoreKeyboardScrollAdjustment();
|
|
2191
|
+
keyboardFocusFrame.cancel();
|
|
2192
|
+
};
|
|
2193
|
+
const alignFocusedKeyboardTarget = () => {
|
|
2194
|
+
const target = focusedKeyboardTargetRef.current;
|
|
2195
|
+
if (nestedDrawerOpen || !target || !contains(rootElement, target)) {
|
|
2196
|
+
resetDrawerKeyboardInset();
|
|
2197
|
+
restoreKeyboardScrollAdjustment();
|
|
2198
|
+
return;
|
|
2199
|
+
}
|
|
2200
|
+
const keyboardViewport = getKeyboardVisualViewport(win);
|
|
2201
|
+
if (!keyboardViewport) {
|
|
2202
|
+
resetDrawerKeyboardInset();
|
|
2203
|
+
restoreKeyboardScrollAdjustment();
|
|
2204
|
+
return;
|
|
2205
|
+
}
|
|
2206
|
+
setDrawerKeyboardInset(getDrawerKeyboardInset(win, keyboardViewport));
|
|
2207
|
+
const scrollTarget = findKeyboardScrollTarget(target, rootElement);
|
|
2208
|
+
if (!scrollTarget) {
|
|
2209
|
+
restoreKeyboardScrollAdjustment();
|
|
2210
|
+
return;
|
|
2211
|
+
}
|
|
2212
|
+
if (!scrollTarget.isConnected || !contains(rootElement, scrollTarget)) {
|
|
2213
|
+
resetDrawerKeyboardInset();
|
|
2214
|
+
restoreKeyboardScrollAdjustment();
|
|
2215
|
+
return;
|
|
2216
|
+
}
|
|
2217
|
+
const scrollTargetRect = scrollTarget.getBoundingClientRect();
|
|
2218
|
+
const clippedBottom = Math.min(scrollTargetRect.bottom, keyboardViewport.bottom);
|
|
2219
|
+
const overlap = Math.max(0, scrollTargetRect.bottom - keyboardViewport.bottom);
|
|
2220
|
+
setKeyboardScrollSlack(scrollTarget, overlap > 0 ? overlap + KEYBOARD_SCROLL_SLACK : 0);
|
|
2221
|
+
const maxScrollTop = Math.max(0, scrollTarget.scrollHeight - scrollTarget.clientHeight);
|
|
2222
|
+
if (maxScrollTop <= 0) return;
|
|
2223
|
+
const visibleTop = Math.max(scrollTargetRect.top, keyboardViewport.top) + KEYBOARD_VISIBILITY_MARGIN;
|
|
2224
|
+
const visibleBottom = clippedBottom - KEYBOARD_VISIBILITY_MARGIN;
|
|
2225
|
+
if (visibleBottom <= visibleTop) return;
|
|
2226
|
+
const targetRect = target.getBoundingClientRect();
|
|
2227
|
+
const targetCenter = (targetRect.top + targetRect.bottom) / 2;
|
|
2228
|
+
const visibleCenter = (visibleTop + visibleBottom) / 2;
|
|
2229
|
+
const nextScrollTop = scrollTarget.scrollTop + targetCenter - visibleCenter;
|
|
2230
|
+
animateKeyboardScroll(scrollTarget, clamp(nextScrollTop, 0, maxScrollTop));
|
|
2231
|
+
};
|
|
2232
|
+
const scheduleKeyboardFocusAlignment = () => {
|
|
2233
|
+
keyboardFocusFrame.request(alignFocusedKeyboardTarget);
|
|
2234
|
+
};
|
|
2235
|
+
const captureFocusedKeyboardTarget = (eventTarget) => {
|
|
2236
|
+
if (nestedDrawerOpen) return false;
|
|
2237
|
+
const target = resolveKeyboardInputTarget(eventTarget);
|
|
2238
|
+
if (!target || !contains(rootElement, target)) return false;
|
|
2239
|
+
focusedKeyboardTargetRef.current = target;
|
|
2240
|
+
return true;
|
|
2241
|
+
};
|
|
2242
|
+
const handleFocusIn = (event) => {
|
|
2243
|
+
if (captureFocusedKeyboardTarget(getTarget(event))) scheduleKeyboardFocusAlignment();
|
|
2244
|
+
};
|
|
2245
|
+
const handleFocusOut = (event) => {
|
|
2246
|
+
if (captureFocusedKeyboardTarget(event.relatedTarget)) {
|
|
2247
|
+
scheduleKeyboardFocusAlignment();
|
|
2248
|
+
return;
|
|
2249
|
+
}
|
|
2250
|
+
clearFocusedKeyboardTarget();
|
|
2251
|
+
};
|
|
2252
|
+
const handleViewportUpdate = () => {
|
|
2253
|
+
if (focusedKeyboardTargetRef.current || captureFocusedKeyboardTarget(activeElement(doc))) scheduleKeyboardFocusAlignment();
|
|
2254
|
+
};
|
|
2255
|
+
const cleanupListeners = [];
|
|
2256
|
+
if (visualViewport) cleanupListeners.push(addEventListener(visualViewport, "resize", handleViewportUpdate), addEventListener(visualViewport, "scroll", handleViewportUpdate));
|
|
2257
|
+
cleanupListeners.push(addEventListener(doc, "focusin", handleFocusIn, true), addEventListener(doc, "focusout", handleFocusOut, true));
|
|
2258
|
+
if (captureFocusedKeyboardTarget(activeElement(doc))) scheduleKeyboardFocusAlignment();
|
|
2259
|
+
return () => {
|
|
2260
|
+
cleanupListeners.forEach((cleanup) => cleanup());
|
|
2261
|
+
clearFocusedKeyboardTarget();
|
|
2262
|
+
rootElement.style.removeProperty(DrawerViewportCssVars.keyboardInset);
|
|
2263
|
+
};
|
|
2264
|
+
}, [
|
|
2265
|
+
animateKeyboardScroll,
|
|
2266
|
+
keyboardFocusFrame,
|
|
2267
|
+
mounted,
|
|
2268
|
+
nestedDrawerOpen,
|
|
2269
|
+
open,
|
|
2270
|
+
restoreKeyboardScrollAdjustment,
|
|
2271
|
+
rootElement,
|
|
2272
|
+
setKeyboardScrollSlack
|
|
2273
|
+
]);
|
|
2274
|
+
const onTouchStart = useStableCallback((event) => {
|
|
2275
|
+
if (!open || !mounted || nestedDrawerOpen) {
|
|
2276
|
+
resetTouchTrackingState();
|
|
2277
|
+
return;
|
|
2278
|
+
}
|
|
2279
|
+
const touch = event.touches[0];
|
|
2280
|
+
if (!touch) return;
|
|
2281
|
+
pendingKeyboardFocusMovedRef.current = false;
|
|
2282
|
+
keyboardTouchStartRef.current = {
|
|
2283
|
+
x: touch.clientX,
|
|
2284
|
+
y: touch.clientY
|
|
2285
|
+
};
|
|
2286
|
+
});
|
|
2287
|
+
const onTouchMove = useStableCallback((event) => {
|
|
2288
|
+
const touch = event.touches[0];
|
|
2289
|
+
const touchStart = keyboardTouchStartRef.current;
|
|
2290
|
+
if (!touch || !touchStart || pendingKeyboardFocusMovedRef.current) return;
|
|
2291
|
+
if (Math.abs(touch.clientX - touchStart.x) > INPUT_TAP_MOVE_THRESHOLD || Math.abs(touch.clientY - touchStart.y) > INPUT_TAP_MOVE_THRESHOLD) pendingKeyboardFocusMovedRef.current = true;
|
|
2292
|
+
});
|
|
2293
|
+
const onTouchEnd = useStableCallback((event) => {
|
|
2294
|
+
if (!open || !mounted || nestedDrawerOpen || !rootElement || !keyboardTouchStartRef.current || pendingKeyboardFocusMovedRef.current) {
|
|
2295
|
+
resetTouchTrackingState();
|
|
2296
|
+
return;
|
|
2297
|
+
}
|
|
2298
|
+
const touch = event.changedTouches[0] ?? event.touches[0];
|
|
2299
|
+
const doc = ownerDocument(event.currentTarget);
|
|
2300
|
+
const nativeEventTarget = getTarget(event.nativeEvent);
|
|
2301
|
+
const pointTarget = touch ? resolveKeyboardTouchTargetFromPoint(doc, touch.clientX, touch.clientY) : null;
|
|
2302
|
+
if (pointTarget === KEYBOARD_TAP_BLOCKED) {
|
|
2303
|
+
resetTouchTrackingState();
|
|
2304
|
+
return;
|
|
2305
|
+
}
|
|
2306
|
+
const keyboardTarget = touch && (pointTarget ?? resolveKeyboardTouchTarget(nativeEventTarget));
|
|
2307
|
+
if (keyboardTarget && (!contains(rootElement, keyboardTarget.focusTarget) || !contains(rootElement, keyboardTarget.clickTarget))) {
|
|
2308
|
+
resetTouchTrackingState();
|
|
2309
|
+
return;
|
|
2310
|
+
}
|
|
2311
|
+
if (keyboardTarget) {
|
|
2312
|
+
const { clickTarget: keyboardClickTarget, focusTarget: keyboardFocusTarget } = keyboardTarget;
|
|
2313
|
+
const win = getWindow(keyboardFocusTarget);
|
|
2314
|
+
if (win.visualViewport && win.visualViewport.scale !== 1) {
|
|
2315
|
+
resetTouchTrackingState();
|
|
2316
|
+
return;
|
|
2317
|
+
}
|
|
2318
|
+
if (activeElement(ownerDocument(keyboardFocusTarget)) === keyboardFocusTarget && isKeyboardVisualViewportOpen(win)) {
|
|
2319
|
+
resetTouchTrackingState();
|
|
2320
|
+
return;
|
|
2321
|
+
}
|
|
2322
|
+
event.preventDefault();
|
|
2323
|
+
focusKeyboardInputWithoutPageScroll(keyboardFocusTarget);
|
|
2324
|
+
dispatchKeyboardClick(keyboardClickTarget, touch);
|
|
2325
|
+
resetTouchTrackingState();
|
|
2326
|
+
return;
|
|
2327
|
+
}
|
|
2328
|
+
resetTouchTrackingState();
|
|
2329
|
+
});
|
|
2330
|
+
const contextValue = React$1.useMemo(() => ({
|
|
2331
|
+
onTouchStart,
|
|
2332
|
+
onTouchMove,
|
|
2333
|
+
onTouchEnd,
|
|
2334
|
+
onTouchCancel: resetTouchTrackingState
|
|
2335
|
+
}), [
|
|
2336
|
+
onTouchEnd,
|
|
2337
|
+
onTouchMove,
|
|
2338
|
+
onTouchStart,
|
|
2339
|
+
resetTouchTrackingState
|
|
2340
|
+
]);
|
|
2341
|
+
return /*#__PURE__*/ jsx(DrawerVirtualKeyboardContext.Provider, {
|
|
2342
|
+
value: contextValue,
|
|
2343
|
+
children
|
|
2344
|
+
});
|
|
2345
|
+
}
|
|
2346
|
+
function isKeyboardInputElement(element) {
|
|
2347
|
+
if (element.isContentEditable) return true;
|
|
2348
|
+
const win = getWindow(element);
|
|
2349
|
+
if (element instanceof win.HTMLTextAreaElement || element instanceof win.HTMLInputElement && KEYBOARD_INPUT_TYPES.has(element.type)) return !element.matches(":disabled");
|
|
2350
|
+
return false;
|
|
2351
|
+
}
|
|
2352
|
+
function resolveKeyboardInputTarget(target) {
|
|
2353
|
+
if (!isHTMLElement(target)) return null;
|
|
2354
|
+
if (isKeyboardInputElement(target)) return target.isContentEditable ? getContentEditableHost(target) : target;
|
|
2355
|
+
const control = target.closest("label")?.control ?? null;
|
|
2356
|
+
return isHTMLElement(control) && isKeyboardInputElement(control) ? control : null;
|
|
2357
|
+
}
|
|
2358
|
+
function resolveKeyboardTouchTarget(target) {
|
|
2359
|
+
const focusTarget = resolveKeyboardInputTarget(target);
|
|
2360
|
+
if (!focusTarget) return null;
|
|
2361
|
+
return {
|
|
2362
|
+
focusTarget,
|
|
2363
|
+
clickTarget: isHTMLElement(target) ? target : focusTarget
|
|
2364
|
+
};
|
|
2365
|
+
}
|
|
2366
|
+
function getContentEditableHost(element) {
|
|
2367
|
+
let host = element;
|
|
2368
|
+
while (host.parentElement?.isContentEditable) host = host.parentElement;
|
|
2369
|
+
return host;
|
|
2370
|
+
}
|
|
2371
|
+
function resolveKeyboardTouchTargetFromPoint(doc, clientX, clientY) {
|
|
2372
|
+
const exactTarget = getElementAtPoint(doc, clientX, clientY);
|
|
2373
|
+
const exactKeyboardTarget = resolveKeyboardInputTarget(exactTarget);
|
|
2374
|
+
if (exactKeyboardTarget) return {
|
|
2375
|
+
focusTarget: exactKeyboardTarget,
|
|
2376
|
+
clickTarget: isHTMLElement(exactTarget) ? exactTarget : exactKeyboardTarget
|
|
2377
|
+
};
|
|
2378
|
+
if (isInteractiveElement(exactTarget) || exactTarget?.closest("label") != null) return KEYBOARD_TAP_BLOCKED;
|
|
2379
|
+
for (const [offsetX, offsetY] of [
|
|
2380
|
+
[0, INPUT_TAP_HIT_SLOP],
|
|
2381
|
+
[0, -16],
|
|
2382
|
+
[INPUT_TAP_HIT_SLOP, 0],
|
|
2383
|
+
[-16, 0]
|
|
2384
|
+
]) {
|
|
2385
|
+
const keyboardTarget = resolveKeyboardInputTarget(getElementAtPoint(doc, clientX + offsetX, clientY + offsetY));
|
|
2386
|
+
if (keyboardTarget) return {
|
|
2387
|
+
focusTarget: keyboardTarget,
|
|
2388
|
+
clickTarget: keyboardTarget
|
|
2389
|
+
};
|
|
2390
|
+
}
|
|
2391
|
+
return null;
|
|
2392
|
+
}
|
|
2393
|
+
function dispatchKeyboardClick(target, touch) {
|
|
2394
|
+
const win = getWindow(target);
|
|
2395
|
+
const ClickEvent = win.PointerEvent ?? win.MouseEvent;
|
|
2396
|
+
target.dispatchEvent(new ClickEvent("click", {
|
|
2397
|
+
bubbles: true,
|
|
2398
|
+
cancelable: true,
|
|
2399
|
+
clientX: touch.clientX,
|
|
2400
|
+
clientY: touch.clientY,
|
|
2401
|
+
detail: 1,
|
|
2402
|
+
view: win
|
|
2403
|
+
}));
|
|
2404
|
+
}
|
|
2405
|
+
function focusKeyboardInputWithoutPageScroll(target) {
|
|
2406
|
+
const wasFocused = activeElement(ownerDocument(target)) === target;
|
|
2407
|
+
const previousOpacity = target.style.opacity;
|
|
2408
|
+
const previousTransform = target.style.transform;
|
|
2409
|
+
const previousTransition = target.style.transition;
|
|
2410
|
+
target.style.transition = "none";
|
|
2411
|
+
target.style.opacity = "0";
|
|
2412
|
+
target.style.transform = "translateY(-2000px)";
|
|
2413
|
+
try {
|
|
2414
|
+
if (wasFocused) target.blur();
|
|
2415
|
+
target.focus({ preventScroll: true });
|
|
2416
|
+
} finally {
|
|
2417
|
+
target.style.opacity = previousOpacity;
|
|
2418
|
+
target.style.transform = previousTransform;
|
|
2419
|
+
target.style.transition = previousTransition;
|
|
2420
|
+
}
|
|
2421
|
+
}
|
|
2422
|
+
function findKeyboardScrollTarget(target, root) {
|
|
2423
|
+
const scrollStart = getParentNode(target);
|
|
2424
|
+
return findScrollableTouchTarget(scrollStart, root, "vertical") ?? findScrollableTouchTarget(scrollStart, root, "vertical", true);
|
|
2425
|
+
}
|
|
2426
|
+
function getKeyboardVisualViewport(win) {
|
|
2427
|
+
const visualViewport = win.visualViewport;
|
|
2428
|
+
if (!visualViewport || visualViewport.scale !== 1) return null;
|
|
2429
|
+
if (win.innerHeight - visualViewport.height <= KEYBOARD_RESIZE_THRESHOLD) return null;
|
|
2430
|
+
const top = Math.max(0, visualViewport.offsetTop);
|
|
2431
|
+
return {
|
|
2432
|
+
top,
|
|
2433
|
+
bottom: Math.min(win.innerHeight, top + visualViewport.height)
|
|
2434
|
+
};
|
|
2435
|
+
}
|
|
2436
|
+
function getDrawerKeyboardInset(win, keyboardViewport) {
|
|
2437
|
+
return Math.max(0, win.innerHeight - keyboardViewport.bottom);
|
|
2438
|
+
}
|
|
2439
|
+
function isKeyboardVisualViewportOpen(win) {
|
|
2440
|
+
return !win.visualViewport || getKeyboardVisualViewport(win) != null;
|
|
2441
|
+
}
|
|
2442
|
+
//#endregion
|
|
2443
|
+
//#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/drawer/index.parts.mjs
|
|
2444
|
+
var index_parts_exports = /* @__PURE__ */ __exportAll({
|
|
2445
|
+
Backdrop: () => DrawerBackdrop,
|
|
2446
|
+
Close: () => DrawerClose,
|
|
2447
|
+
Content: () => DrawerContent,
|
|
2448
|
+
Description: () => DrawerDescription,
|
|
2449
|
+
Handle: () => DialogHandle,
|
|
2450
|
+
Indent: () => DrawerIndent,
|
|
2451
|
+
IndentBackground: () => DrawerIndentBackground,
|
|
2452
|
+
Popup: () => DrawerPopup,
|
|
2453
|
+
Portal: () => DrawerPortal,
|
|
2454
|
+
Provider: () => DrawerProvider,
|
|
2455
|
+
Root: () => DrawerRoot,
|
|
2456
|
+
SwipeArea: () => DrawerSwipeArea,
|
|
2457
|
+
Title: () => DrawerTitle,
|
|
2458
|
+
Trigger: () => DrawerTrigger,
|
|
2459
|
+
Viewport: () => DrawerViewport,
|
|
2460
|
+
VirtualKeyboardProvider: () => DrawerVirtualKeyboardProvider,
|
|
2461
|
+
createHandle: () => createDialogHandle
|
|
2462
|
+
});
|
|
2463
|
+
//#endregion
|
|
2464
|
+
export { index_parts_exports as t };
|