@fragiola/primitives 0.0.0-stage → 0.0.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.
Files changed (191) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +50 -2
  3. package/dist/async-list-Bv6ff5Oj.js +81 -0
  4. package/dist/async-list-Bv6ff5Oj.js.map +1 -0
  5. package/dist/async-list.d.ts +2 -0
  6. package/dist/async-list.js +1 -0
  7. package/dist/calendar-keys-DGYpjLwv.d.ts +12 -0
  8. package/dist/calendar-system-B5U5HcPQ.d.ts +415 -0
  9. package/dist/calendar-systems-Daa6Q_ca.js +659 -0
  10. package/dist/calendar-systems-Daa6Q_ca.js.map +1 -0
  11. package/dist/calendar-systems.d.ts +3 -0
  12. package/dist/calendar-systems.js +1 -0
  13. package/dist/carousel-LRbWqbAx.js +375 -0
  14. package/dist/carousel-LRbWqbAx.js.map +1 -0
  15. package/dist/carousel.d.ts +2 -0
  16. package/dist/carousel.js +1 -0
  17. package/dist/cascade-B155Xvvv.js +64 -0
  18. package/dist/cascade-B155Xvvv.js.map +1 -0
  19. package/dist/cascade.d.ts +2 -0
  20. package/dist/cascade.js +1 -0
  21. package/dist/clipboard-Cy2cbGEW.js +33 -0
  22. package/dist/clipboard-Cy2cbGEW.js.map +1 -0
  23. package/dist/clipboard.d.ts +2 -0
  24. package/dist/clipboard.js +1 -0
  25. package/dist/collection-Dbk-PB5S.js +609 -0
  26. package/dist/collection-Dbk-PB5S.js.map +1 -0
  27. package/dist/collection.d.ts +2 -0
  28. package/dist/collection.js +3 -0
  29. package/dist/color-sURV5Irg.js +699 -0
  30. package/dist/color-sURV5Irg.js.map +1 -0
  31. package/dist/color.d.ts +2 -0
  32. package/dist/color.js +1 -0
  33. package/dist/command-DueCXi65.js +104 -0
  34. package/dist/command-DueCXi65.js.map +1 -0
  35. package/dist/command.d.ts +2 -0
  36. package/dist/command.js +1 -0
  37. package/dist/date-CrbFSJKQ.js +215 -0
  38. package/dist/date-CrbFSJKQ.js.map +1 -0
  39. package/dist/date.d.ts +4 -0
  40. package/dist/date.js +1 -0
  41. package/dist/direction-CTnVLpmd.d.ts +8 -0
  42. package/dist/direction-DJDPvnxJ.js +13 -0
  43. package/dist/direction-DJDPvnxJ.js.map +1 -0
  44. package/dist/direction.d.ts +2 -0
  45. package/dist/direction.js +1 -0
  46. package/dist/drag-session-CSr06B5v.js +41 -0
  47. package/dist/drag-session-CSr06B5v.js.map +1 -0
  48. package/dist/file-DSLtfzbi.js +263 -0
  49. package/dist/file-DSLtfzbi.js.map +1 -0
  50. package/dist/file.d.ts +2 -0
  51. package/dist/file.js +1 -0
  52. package/dist/focus-BI-VvM0f.js +75 -0
  53. package/dist/focus-BI-VvM0f.js.map +1 -0
  54. package/dist/focus.d.ts +2 -0
  55. package/dist/focus.js +3 -0
  56. package/dist/form-DovwKtqz.js +501 -0
  57. package/dist/form-DovwKtqz.js.map +1 -0
  58. package/dist/form.d.ts +2 -0
  59. package/dist/form.js +1 -0
  60. package/dist/hover-BakyPYnC.js +62 -0
  61. package/dist/hover-BakyPYnC.js.map +1 -0
  62. package/dist/hover.d.ts +2 -0
  63. package/dist/hover.js +1 -0
  64. package/dist/id-B0Y8iZrc.js +13 -0
  65. package/dist/id-B0Y8iZrc.js.map +1 -0
  66. package/dist/id.d.ts +2 -0
  67. package/dist/id.js +1 -0
  68. package/dist/image-D4X_yRYw.js +44 -0
  69. package/dist/image-D4X_yRYw.js.map +1 -0
  70. package/dist/image.d.ts +2 -0
  71. package/dist/image.js +1 -0
  72. package/dist/index-B0rwIZw9.d.ts +51 -0
  73. package/dist/index-B4wF1isn.d.ts +128 -0
  74. package/dist/index-BHiBRE01.d.ts +20 -0
  75. package/dist/index-BNlMm-0u.d.ts +17 -0
  76. package/dist/index-BapNrjY9.d.ts +48 -0
  77. package/dist/index-Bd-tVb7C.d.ts +6 -0
  78. package/dist/index-BjE8nDiX.d.ts +125 -0
  79. package/dist/index-BpbT-FsX.d.ts +117 -0
  80. package/dist/index-CBgGcTeX.d.ts +37 -0
  81. package/dist/index-CGThV_Md.d.ts +100 -0
  82. package/dist/index-CMig3TXL.d.ts +28 -0
  83. package/dist/index-CWFRduRd.d.ts +212 -0
  84. package/dist/index-CkrHWyU_.d.ts +33 -0
  85. package/dist/index-Cwu6f7y1.d.ts +18 -0
  86. package/dist/index-D10LDdR6.d.ts +139 -0
  87. package/dist/index-D146vm21.d.ts +104 -0
  88. package/dist/index-DGKhEvNr.d.ts +107 -0
  89. package/dist/index-DbAu4s16.d.ts +48 -0
  90. package/dist/index-DdaCj6IO.d.ts +54 -0
  91. package/dist/index-DeHcNdjC.d.ts +68 -0
  92. package/dist/index-DeR4ncrW.d.ts +93 -0
  93. package/dist/index-HIksgK0e.d.ts +70 -0
  94. package/dist/index-IZB0mlZl.d.ts +71 -0
  95. package/dist/index-IfDZj87U.d.ts +28 -0
  96. package/dist/index-SrTuVBms.d.ts +75 -0
  97. package/dist/index-T9UcYvkf.d.ts +339 -0
  98. package/dist/index-fRTojAoR.d.ts +31 -0
  99. package/dist/index-fuLUke9n.d.ts +6 -0
  100. package/dist/index-l63esAck.d.ts +104 -0
  101. package/dist/index-raSUg9U7.d.ts +38 -0
  102. package/dist/index-twgzPKvZ.d.ts +278 -0
  103. package/dist/index-wBpjRykh.d.ts +125 -0
  104. package/dist/index.d.ts +39 -0
  105. package/dist/index.js +42 -0
  106. package/dist/inert-DlGToy3q.js +80 -0
  107. package/dist/inert-DlGToy3q.js.map +1 -0
  108. package/dist/inert.d.ts +2 -0
  109. package/dist/inert.js +1 -0
  110. package/dist/layer-stack-BEtzaFC1.js +118 -0
  111. package/dist/layer-stack-BEtzaFC1.js.map +1 -0
  112. package/dist/layers-C-N4rrZX.js +24 -0
  113. package/dist/layers-C-N4rrZX.js.map +1 -0
  114. package/dist/layers.d.ts +2 -0
  115. package/dist/layers.js +3 -0
  116. package/dist/list-navigation-CbWv4DK5.js +40 -0
  117. package/dist/list-navigation-CbWv4DK5.js.map +1 -0
  118. package/dist/month-year-BG5imFUq.js +108 -0
  119. package/dist/month-year-BG5imFUq.js.map +1 -0
  120. package/dist/month-year.d.ts +3 -0
  121. package/dist/month-year.js +1 -0
  122. package/dist/number-BFUio97d.js +316 -0
  123. package/dist/number-BFUio97d.js.map +1 -0
  124. package/dist/number.d.ts +2 -0
  125. package/dist/number.js +1 -0
  126. package/dist/overlay-BwPyiM3T.js +78 -0
  127. package/dist/overlay-BwPyiM3T.js.map +1 -0
  128. package/dist/overlay.d.ts +2 -0
  129. package/dist/overlay.js +1 -0
  130. package/dist/pagination-BkVzaIGP.js +51 -0
  131. package/dist/pagination-BkVzaIGP.js.map +1 -0
  132. package/dist/pagination.d.ts +2 -0
  133. package/dist/pagination.js +1 -0
  134. package/dist/plain-date-idQH1P6X.d.ts +29 -0
  135. package/dist/plain-date-time-B8PGahhe.d.ts +99 -0
  136. package/dist/pointer-CuDtD9XA.js +189 -0
  137. package/dist/pointer-CuDtD9XA.js.map +1 -0
  138. package/dist/pointer.d.ts +2 -0
  139. package/dist/pointer.js +3 -0
  140. package/dist/positioning-DDUQ75mB.js +148 -0
  141. package/dist/positioning-DDUQ75mB.js.map +1 -0
  142. package/dist/positioning.d.ts +2 -0
  143. package/dist/positioning.js +1 -0
  144. package/dist/presence-BhKDOmII.js +86 -0
  145. package/dist/presence-BhKDOmII.js.map +1 -0
  146. package/dist/presence.d.ts +2 -0
  147. package/dist/presence.js +1 -0
  148. package/dist/range-o0_GBhyY.js +158 -0
  149. package/dist/range-o0_GBhyY.js.map +1 -0
  150. package/dist/range.d.ts +2 -0
  151. package/dist/range.js +1 -0
  152. package/dist/scroll-area-BYNhv36t.js +447 -0
  153. package/dist/scroll-area-BYNhv36t.js.map +1 -0
  154. package/dist/scroll-area.d.ts +2 -0
  155. package/dist/scroll-area.js +1 -0
  156. package/dist/scroll-lock-JzRNOA1O.js +42 -0
  157. package/dist/scroll-lock-JzRNOA1O.js.map +1 -0
  158. package/dist/scroll-lock.d.ts +2 -0
  159. package/dist/scroll-lock.js +1 -0
  160. package/dist/segments-eRu5G_Bd.js +587 -0
  161. package/dist/segments-eRu5G_Bd.js.map +1 -0
  162. package/dist/segments.d.ts +3 -0
  163. package/dist/segments.js +1 -0
  164. package/dist/selection-Cor67w_V.js +287 -0
  165. package/dist/selection-Cor67w_V.js.map +1 -0
  166. package/dist/selection.d.ts +2 -0
  167. package/dist/selection.js +1 -0
  168. package/dist/swipe.d.ts +2 -0
  169. package/dist/swipe.js +1 -0
  170. package/dist/tabbable-BPiLssIv.js +35 -0
  171. package/dist/tabbable-BPiLssIv.js.map +1 -0
  172. package/dist/time-Ct6oq9kt.js +208 -0
  173. package/dist/time-Ct6oq9kt.js.map +1 -0
  174. package/dist/time-zone-DegkzwST.js +305 -0
  175. package/dist/time-zone-DegkzwST.js.map +1 -0
  176. package/dist/time-zone.d.ts +2 -0
  177. package/dist/time-zone.js +1 -0
  178. package/dist/time.d.ts +2 -0
  179. package/dist/time.js +1 -0
  180. package/dist/toast-BjRpJalM.js +400 -0
  181. package/dist/toast-BjRpJalM.js.map +1 -0
  182. package/dist/toast.d.ts +2 -0
  183. package/dist/toast.js +1 -0
  184. package/dist/unit-grid-DJy8lb5D.d.ts +21 -0
  185. package/dist/virtual-BlX1RuHD.js +306 -0
  186. package/dist/virtual-BlX1RuHD.js.map +1 -0
  187. package/dist/virtual.d.ts +2 -0
  188. package/dist/virtual.js +1 -0
  189. package/dist/watch-swipe-BIucfr9O.js +301 -0
  190. package/dist/watch-swipe-BIucfr9O.js.map +1 -0
  191. package/package.json +234 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collection-Dbk-PB5S.js","names":[],"sources":["../src/collection/activation-direction.ts","../src/collection/chip-keys.ts","../src/collection/combobox-items.ts","../src/collection/key-maps.ts","../src/collection/roving-focus.ts","../src/collection/scroll-into-view.ts","../src/collection/segment-indicator.ts","../src/collection/tabs-indicator.ts","../src/collection/tag-keys.ts","../src/collection/typeahead.ts"],"sourcesContent":["/** Where a newly selected tab sits from the previous one (spec/tabs.md, `data-activation-direction`). */\nexport type ActivationDirection = \"left\" | \"right\" | \"up\" | \"down\" | \"none\";\n\n/**\n * The physical direction from the previously selected tab to the new one, measured on the page\n * (Base UI): `left` / `right` along a horizontal list, `up` / `down` along a vertical one, `none`\n * when either tab is missing or both sit at the same place. In RTL the next tab sits on the left,\n * so it gives `left`.\n */\nexport function activationDirection(\n previous: Element | null | undefined,\n next: Element | null | undefined,\n orientation: \"horizontal\" | \"vertical\",\n): ActivationDirection {\n if (!previous || !next || previous === next) {\n return \"none\";\n }\n const from = previous.getBoundingClientRect();\n const to = next.getBoundingClientRect();\n const [before, after] =\n orientation === \"horizontal\"\n ? [from.left, to.left]\n : [from.top, to.top];\n if (after < before) {\n return orientation === \"horizontal\" ? \"left\" : \"up\";\n }\n if (after > before) {\n return orientation === \"horizontal\" ? \"right\" : \"down\";\n }\n return \"none\";\n}\n","// Adapted from Base UI (packages/react/src/combobox/chip/ComboboxChip.tsx, combobox/utils/parts.ts), MIT.\n\n/** What a key on a focused chip does (spec/combobox.md, \"Keyboard\"). */\nexport interface ChipKeyAction {\n /** Where focus goes: a chip's index (after a removal: in the chips that are left), or the input. */\n focus: number | \"input\";\n /** Remove the focused chip's value. */\n remove?: true;\n /** Open the list. */\n open?: true;\n}\n\n/** The arrow that goes back (toward the first chip) and forward, for the direction. */\nexport function chipArrows(rtl: boolean): { previous: string; next: string } {\n return rtl\n ? { previous: \"ArrowRight\", next: \"ArrowLeft\" }\n : { previous: \"ArrowLeft\", next: \"ArrowRight\" };\n}\n\n/**\n * The action of `key` on the chip at `index` of `count` chips, or `null` for a key it leaves\n * alone. A printable character moves focus to the input, which receives it.\n */\nexport function chipKeyTarget(\n key: string,\n index: number,\n count: number,\n rtl: boolean,\n): ChipKeyAction | null {\n const arrows = chipArrows(rtl);\n if (key === arrows.previous) {\n return { focus: index > 0 ? index - 1 : \"input\" };\n }\n if (key === arrows.next) {\n return { focus: index < count - 1 ? index + 1 : \"input\" };\n }\n if (key === \"Backspace\" || key === \"Delete\") {\n const next = index >= count - 1 ? count - 2 : index;\n return { focus: next >= 0 ? next : \"input\", remove: true };\n }\n if (key === \"Enter\" || key === \" \") {\n return { focus: \"input\" };\n }\n if (key === \"ArrowDown\" || key === \"ArrowUp\") {\n return { focus: \"input\", open: true };\n }\n if (key.length === 1) {\n return { focus: \"input\" };\n }\n return null;\n}\n","// Adapted from Base UI (packages/react/src/internals/filter.ts, internals/resolveValueLabel.tsx,\n// combobox/root/AriaCombobox.tsx), MIT.\n\n/** A group of items: any object with an `items` array (spec/combobox.md, \"API\"). */\nexport interface ItemGroup<Item> {\n readonly items: readonly Item[];\n}\n\n/** An item matches the query (spec/combobox.md, `filter`). */\nexport type ItemFilter<Item> = (\n item: Item,\n query: string,\n itemToString: (item: Item) => string,\n) => boolean;\n\n/** Whether an item is a value (`isItemEqualToValue`). */\nexport type ItemEquality<Item> = (item: Item, value: Item) => boolean;\n\n/** Whether an entry of `items` is a group (it carries an `items` array). */\nexport function isItemGroup<Item>(\n entry: Item | ItemGroup<Item>,\n): entry is ItemGroup<Item> {\n return (\n typeof entry === \"object\" &&\n entry !== null &&\n Array.isArray((entry as { items?: unknown }).items)\n );\n}\n\n/** Every item of `items`, groups flattened, in order. */\nexport function flattenItems<Item>(\n items: readonly (Item | ItemGroup<Item>)[],\n): Item[] {\n return items.flatMap((entry) =>\n isItemGroup(entry) ? [...entry.items] : [entry],\n );\n}\n\nfunction serialize(item: unknown): string {\n if (item === null || item === undefined) {\n return \"\";\n }\n return typeof item === \"string\" ? item : (JSON.stringify(item) ?? \"\");\n}\n\n/**\n * An item's text (`itemToStringLabel`): the consumer's function, else an object's `label`, else\n * its `value`, else the item itself.\n */\nexport function itemLabel<Item>(\n item: Item | null | undefined,\n itemToStringLabel?: (item: Item) => string,\n): string {\n if (item === null || item === undefined) {\n return \"\";\n }\n if (itemToStringLabel !== undefined) {\n return itemToStringLabel(item) ?? \"\";\n }\n if (typeof item === \"object\") {\n const record = item as { label?: unknown; value?: unknown };\n if (record.label !== null && record.label !== undefined) {\n return String(record.label);\n }\n if (\"value\" in record) {\n return String(record.value);\n }\n }\n return typeof item === \"string\" ? item : serialize(item);\n}\n\n/**\n * An item's form value (`itemToStringValue`): the consumer's function, else the `value` of an\n * object with `value` and `label`, else the item as a string.\n */\nexport function itemFormValue<Item>(\n item: Item | null | undefined,\n itemToStringValue?: (item: Item) => string,\n): string {\n if (item === null || item === undefined) {\n return \"\";\n }\n if (itemToStringValue !== undefined) {\n return itemToStringValue(item) ?? \"\";\n }\n if (typeof item === \"object\" && \"value\" in item && \"label\" in item) {\n return serialize((item as { value: unknown }).value);\n }\n return serialize(item);\n}\n\nconst collators = new Map<string, Intl.Collator>();\n\nfunction collator(locale: string | undefined): Intl.Collator {\n const key = locale ?? \"\";\n let found = collators.get(key);\n if (found === undefined) {\n found = new Intl.Collator(locale, {\n usage: \"search\",\n sensitivity: \"base\",\n ignorePunctuation: true,\n });\n collators.set(key, found);\n }\n return found;\n}\n\n/** Whether `text` holds `query`, ignoring case, accents and punctuation (the locale's collator). */\nexport function textContains(\n text: string,\n query: string,\n locale?: string,\n): boolean {\n if (query === \"\") {\n return true;\n }\n const compare = collator(locale);\n for (let start = 0; start <= text.length - query.length; start += 1) {\n if (\n compare.compare(text.slice(start, start + query.length), query) ===\n 0\n ) {\n return true;\n }\n }\n return false;\n}\n\n/** The default `filter`: the item's label contains the query, for the locale. */\nexport function containsFilter<Item>(locale?: string): ItemFilter<Item> {\n return (item, query, itemToString) =>\n textContains(itemToString(item), query, locale);\n}\n\n/**\n * Whether the query is the selected item's label: then a single combobox that just opened shows\n * every item (spec/combobox.md, \"The query\").\n */\nexport function queryIsLabel(\n label: string,\n query: string,\n locale?: string,\n): boolean {\n return (\n query !== \"\" &&\n label.length === query.length &&\n textContains(label, query, locale)\n );\n}\n\nexport interface FilterItemsOptions<Item> {\n /** `null`: no filtering. */\n filter: ItemFilter<Item> | null;\n /** The most items kept, across groups; `-1` for no limit. */\n limit: number;\n itemToString: (item: Item) => string;\n}\n\n/**\n * The entries a List renders for a query: the matching items, or the groups with their matching\n * items (a group with none is left out), at most `limit` items in all.\n */\nexport function filterItems<Item>(\n items: readonly (Item | ItemGroup<Item>)[],\n query: string,\n options: FilterItemsOptions<Item>,\n): (Item | ItemGroup<Item>)[] {\n const { filter, limit, itemToString } = options;\n let left = limit < 0 ? Number.POSITIVE_INFINITY : limit;\n const keep = (item: Item) =>\n query === \"\" || filter === null || filter(item, query, itemToString);\n const take = (list: readonly Item[]): Item[] => {\n const kept: Item[] = [];\n for (const item of list) {\n if (left <= 0) {\n break;\n }\n if (keep(item)) {\n kept.push(item);\n left -= 1;\n }\n }\n return kept;\n };\n const entries: (Item | ItemGroup<Item>)[] = [];\n for (const entry of items) {\n if (left <= 0) {\n break;\n }\n if (isItemGroup(entry)) {\n const kept = take(entry.items);\n if (kept.length > 0) {\n entries.push({ ...entry, items: kept });\n }\n } else {\n entries.push(...take([entry]));\n }\n }\n return entries;\n}\n\n/** `isItemEqualToValue`, with `null` and `undefined` compared by identity. */\nexport function itemsEqual<Item>(\n item: Item | null | undefined,\n value: Item | null | undefined,\n isEqual: ItemEquality<Item> = Object.is,\n): boolean {\n if (\n item === null ||\n item === undefined ||\n value === null ||\n value === undefined\n ) {\n return Object.is(item, value);\n }\n return isEqual(item, value);\n}\n\n/** Whether `item` is one of `values`. */\nexport function includesItem<Item>(\n values: readonly Item[],\n item: Item,\n isEqual?: ItemEquality<Item>,\n): boolean {\n return values.some((value) => itemsEqual(item, value, isEqual));\n}\n\n/** `values` with `item` added at the end, or removed when it is already one of them. */\nexport function toggleItem<Item>(\n values: readonly Item[],\n item: Item,\n isEqual?: ItemEquality<Item>,\n): Item[] {\n return includesItem(values, item, isEqual)\n ? values.filter((value) => !itemsEqual(item, value, isEqual))\n : [...values, item];\n}\n","import { stepIndex } from \"./list-navigation.ts\";\n\nexport interface TabsKeyOptions {\n orientation: \"horizontal\" | \"vertical\";\n rtl: boolean;\n loop: boolean;\n}\n\n/**\n * The tab a key moves focus to (spec/tabs.md, \"Keyboard\"): arrows along the orientation (mirrored\n * in RTL), Home and End; `null` when the key does not move it. Disabled tabs are reachable.\n */\nexport function tabsKeyTarget(\n key: string,\n index: number,\n count: number,\n options: TabsKeyOptions,\n): number | null {\n const next =\n options.orientation === \"vertical\"\n ? \"ArrowDown\"\n : options.rtl\n ? \"ArrowLeft\"\n : \"ArrowRight\";\n const previous =\n options.orientation === \"vertical\"\n ? \"ArrowUp\"\n : options.rtl\n ? \"ArrowRight\"\n : \"ArrowLeft\";\n if (key === next || key === previous) {\n return stepIndex(count, index, key === next ? 1 : -1, {\n loop: options.loop,\n });\n }\n if (key === \"Home\") {\n return count > 0 ? 0 : null;\n }\n if (key === \"End\") {\n return count > 0 ? count - 1 : null;\n }\n return null;\n}\n\nexport type AccordionKeyOptions = TabsKeyOptions;\n\n/**\n * The Trigger a key moves focus to in an accordion (spec/accordion.md, \"Keyboard\"): the tabs' key\n * map (arrows along the orientation, mirrored in RTL, Home and End) over the enabled Triggers the\n * caller passes; `null` when the key does not move it.\n */\nexport function accordionKeyTarget(\n key: string,\n index: number,\n count: number,\n options: AccordionKeyOptions,\n): number | null {\n return tabsKeyTarget(key, index, count, options);\n}\n\n/**\n * The item a key moves focus to in a menu (spec/menu.md, \"Keyboard\"): ArrowDown and ArrowUp (wrapping\n * with `loop`), Home and End; `null` when the key does not move it. Disabled items are reachable.\n */\nexport function menuKeyTarget(\n key: string,\n index: number,\n count: number,\n options: { loop: boolean },\n): number | null {\n if (key === \"ArrowDown\" || key === \"ArrowUp\") {\n return stepIndex(count, index, key === \"ArrowDown\" ? 1 : -1, {\n loop: options.loop,\n });\n }\n if (key === \"Home\") {\n return count > 0 ? 0 : null;\n }\n if (key === \"End\") {\n return count > 0 ? count - 1 : null;\n }\n return null;\n}\n\n/** The keys that open and close a submenu: the arrows toward and away from it. */\nexport function submenuKeys(rtl: boolean): { open: string; close: string } {\n return rtl\n ? { open: \"ArrowLeft\", close: \"ArrowRight\" }\n : { open: \"ArrowRight\", close: \"ArrowLeft\" };\n}\n\nexport interface RadioKeyOptions {\n rtl: boolean;\n /** Wrap from the last radio to the first, and back (spec/radio-group.md, `loopFocus`). */\n loop: boolean;\n /** The radios the arrows pass over: the disabled ones. */\n skip?: (index: number) => boolean;\n}\n\n/**\n * The radio an arrow key moves focus (and the check) to in a radio group (spec/radio-group.md,\n * \"Keyboard\"): ArrowDown and ArrowRight the next, ArrowUp and ArrowLeft the previous, whatever the\n * orientation (APG); in RTL, ArrowLeft is the next and ArrowRight the previous. Skipped radios are\n * passed over. `null` when the key does not move it: another key, or an end without `loop`.\n */\nexport function radioKeyTarget(\n key: string,\n index: number,\n count: number,\n options: RadioKeyOptions,\n): number | null {\n const forward = options.rtl\n ? key === \"ArrowDown\" || key === \"ArrowLeft\"\n : key === \"ArrowDown\" || key === \"ArrowRight\";\n const backward = options.rtl\n ? key === \"ArrowUp\" || key === \"ArrowRight\"\n : key === \"ArrowUp\" || key === \"ArrowLeft\";\n if (!forward && !backward) {\n return null;\n }\n const target = stepIndex(count, index, forward ? 1 : -1, {\n loop: options.loop,\n skip: options.skip,\n });\n return target === index || target === -1 ? null : target;\n}\n","import { edgeIndex, stepIndex } from \"./list-navigation.ts\";\n\n/** The axis a roving composite's arrows move along (spec/toolbar.md, \"Keyboard\"). */\nexport type RovingOrientation = \"horizontal\" | \"vertical\";\n\n/** The keys that move to a roving composite's next and previous item. */\nexport interface RovingKeys {\n next: string;\n previous: string;\n}\n\nexport interface RovingKeyOptions {\n orientation: RovingOrientation;\n rtl: boolean;\n /** Wrap from the last item to the first, and back (`loopFocus`). */\n loop: boolean;\n /** The items the keys pass over: the ones that cannot take focus (default: none). */\n skip?: (index: number) => boolean;\n}\n\n/**\n * The arrows of a roving composite (a toolbar, a toggle group, a menu bar; spec/toolbar.md,\n * \"Keyboard\"): ArrowRight and ArrowLeft when horizontal (mirrored in RTL), ArrowDown and ArrowUp\n * when vertical. A menu bar reads them to tell an arrow that moves to the neighbouring item.\n */\nexport function rovingKeys(\n orientation: RovingOrientation,\n rtl: boolean,\n): RovingKeys {\n if (orientation === \"vertical\") {\n return { next: \"ArrowDown\", previous: \"ArrowUp\" };\n }\n return rtl\n ? { next: \"ArrowLeft\", previous: \"ArrowRight\" }\n : { next: \"ArrowRight\", previous: \"ArrowLeft\" };\n}\n\n/**\n * The item a key moves focus to in a roving composite of `count` items (spec/toolbar.md,\n * spec/toggle-group.md, \"Keyboard\"): the next and previous arrows of the orientation (mirrored in\n * RTL), passing over skipped items and wrapping with `loop` (without it, an arrow at an end gives\n * `index` back); Home and End the first and last item not skipped. From no item (`index` -1), the\n * next arrow gives the first item and the previous one the last. `null` when the key is none of\n * these (the other orientation's arrows included), or when every item is skipped.\n */\nexport function rovingKeyTarget(\n key: string,\n index: number,\n count: number,\n options: RovingKeyOptions,\n): number | null {\n const { next, previous } = rovingKeys(options.orientation, options.rtl);\n const skip = options.skip ?? (() => false);\n let target: number;\n if (key === next || key === previous) {\n target = stepIndex(count, index, key === next ? 1 : -1, {\n loop: options.loop,\n skip,\n });\n // a skipped item never gets the focus back, even when there is nowhere to go\n if (target !== -1 && skip(target)) {\n return null;\n }\n } else if (key === \"Home\" || key === \"End\") {\n target = edgeIndex(count, key === \"Home\" ? \"first\" : \"last\", skip);\n } else {\n return null;\n }\n return target === -1 ? null : target;\n}\n\n/**\n * The item that holds a roving composite's tab stop (`tabindex=\"0\"`, spec/toolbar.md, \"Focus\"):\n * `preferred` (the item that last had focus) while it is in range and not skipped, else the first\n * item not skipped; -1 when every item is skipped (the composite is then no tab stop).\n */\nexport function rovingTabStop(\n count: number,\n preferred: number,\n skip: (index: number) => boolean = () => false,\n): number {\n if (preferred >= 0 && preferred < count && !skip(preferred)) {\n return preferred;\n }\n return edgeIndex(count, \"first\", skip);\n}\n\n/** The `<input>` types whose caret the arrow keys move (they have a text selection). */\nconst TEXT_TYPES: readonly string[] = [\n \"\",\n \"text\",\n \"search\",\n \"url\",\n \"tel\",\n \"password\",\n];\n\ninterface TextField extends Element {\n readonly value: string;\n readonly selectionStart: number | null;\n readonly selectionEnd: number | null;\n readonly disabled: boolean;\n readonly type: string;\n}\n\n/** An enabled text field: a `<textarea>`, or an `<input>` of a text type, not `aria-disabled`. */\nfunction textField(element: Element): TextField | null {\n const tag = element.tagName;\n if (tag !== \"INPUT\" && tag !== \"TEXTAREA\") {\n return null;\n }\n const field = element as TextField;\n if (\n field.disabled ||\n element.getAttribute(\"aria-disabled\") === \"true\" ||\n (tag === \"INPUT\" && !TEXT_TYPES.includes(field.type))\n ) {\n return null;\n }\n return field;\n}\n\n/**\n * Whether a text field keeps a key a roving composite would act on (spec/toolbar.md, \"A\n * Toolbar.Input keeps its text keys\", Base UI): while text is selected, every key; with a\n * collapsed caret, the next arrow unless the caret is at the end, the previous arrow unless it is\n * at the start, Home and End unless the text is empty. `false` for an element that is no enabled\n * text field, and for any other key (the composite does not act on it anyway).\n */\nexport function textFieldKeepsKey(\n element: Element,\n key: string,\n keys: RovingKeys,\n): boolean {\n const field = textField(element);\n if (field === null) {\n return false;\n }\n const handled =\n key === keys.next ||\n key === keys.previous ||\n key === \"Home\" ||\n key === \"End\";\n if (!handled) {\n return false;\n }\n const start = field.selectionStart;\n const end = field.selectionEnd;\n // no selection to read (an input type without one): the field keeps its keys\n if (start === null || end === null || start !== end) {\n return true;\n }\n const length = field.value.length;\n if (key === keys.next) {\n return start < length;\n }\n if (key === keys.previous) {\n return start > 0;\n }\n return length > 0;\n}\n\n/**\n * The entries in their elements' document order (a roving composite's items registered in any\n * order: spec/toolbar.md, \"Nested composites\"). The order is taken in one tree: the document's\n * when an element is connected, else the first element's; the entries whose element is in another\n * tree (disconnected) come last, in their relative order.\n */\nexport function inDocumentOrder<Entry>(\n entries: readonly Entry[],\n element: (entry: Entry) => Node,\n): Entry[] {\n const first =\n entries.find((entry) => element(entry).isConnected) ?? entries[0];\n if (first === undefined) {\n return [];\n }\n const tree = element(first).getRootNode();\n const inTree: Entry[] = [];\n const elsewhere: Entry[] = [];\n for (const entry of entries) {\n (element(entry).getRootNode() === tree ? inTree : elsewhere).push(\n entry,\n );\n }\n // within one tree, every two nodes are ordered: a consistent comparator\n inTree.sort((a, b) => {\n const left = element(a);\n const right = element(b);\n if (left === right) {\n return 0;\n }\n return left.compareDocumentPosition(right) &\n Node.DOCUMENT_POSITION_FOLLOWING\n ? -1\n : 1;\n });\n return [...inTree, ...elsewhere];\n}\n","/**\n * Scrolls the scrollable ancestors of `item`, up to `boundary` (included), so the item is in view\n * at the nearest edge: a highlighted option inside its popup (spec/select.md, spec/combobox.md).\n * Unlike `Element.scrollIntoView`, it never scrolls past `boundary`: a list that mounts before it\n * is positioned (at the end of a tall page) does not scroll the page.\n */\nexport function scrollIntoViewWithin(\n item: HTMLElement,\n boundary: HTMLElement | null,\n): void {\n if (boundary === null || !boundary.contains(item)) {\n return;\n }\n const view = item.ownerDocument.defaultView;\n for (\n let element = item.parentElement;\n element !== null;\n element = element.parentElement\n ) {\n const overflow = view?.getComputedStyle(element).overflowY ?? \"\";\n if (\n element.scrollHeight > element.clientHeight &&\n (overflow === \"auto\" || overflow === \"scroll\")\n ) {\n // the visible scroll area: inside the border, above a horizontal scrollbar\n const top = element.getBoundingClientRect().top + element.clientTop;\n const bottom = top + element.clientHeight;\n const rect = item.getBoundingClientRect();\n if (rect.top < top) {\n element.scrollTop -= top - rect.top;\n } else if (rect.bottom > bottom) {\n element.scrollTop += rect.bottom - bottom;\n }\n }\n if (element === boundary) {\n return;\n }\n }\n}\n","/**\n * A SegmentedControl Indicator's CSS variables (spec/segmented-control.md, \"API\"): the checked\n * Item's box from the Root's padding box.\n */\nexport type SegmentIndicatorBox = Record<\n | \"--segment-indicator-inset-inline-start\"\n | \"--segment-indicator-inset-block-start\"\n | \"--segment-indicator-inline-size\"\n | \"--segment-indicator-block-size\"\n | \"--segment-indicator-left\"\n | \"--segment-indicator-right\"\n | \"--segment-indicator-top\"\n | \"--segment-indicator-bottom\"\n | \"--segment-indicator-width\"\n | \"--segment-indicator-height\",\n string\n>;\n\n/**\n * The checked Item's box relative to the Root's padding box (where an absolute Indicator is placed\n * from), as the Indicator's variables (spec/segmented-control.md, \"API\"): the logical ones\n * (inline-start measured from the Root's right padding edge when `rtl`, the layout's direction)\n * and the physical ones, every value in pixels.\n */\nexport function segmentIndicatorBox(\n root: Element,\n item: Element,\n rtl: boolean,\n): SegmentIndicatorBox {\n const rootRect = root.getBoundingClientRect();\n const itemRect = item.getBoundingClientRect();\n // from the padding box: inside the borders (a scrollbar on the end side left out too)\n const left = itemRect.left - rootRect.left - root.clientLeft;\n const top = itemRect.top - rootRect.top - root.clientTop;\n const right = root.clientWidth - left - itemRect.width;\n const bottom = root.clientHeight - top - itemRect.height;\n return {\n \"--segment-indicator-inset-inline-start\": `${rtl ? right : left}px`,\n \"--segment-indicator-inset-block-start\": `${top}px`,\n \"--segment-indicator-inline-size\": `${itemRect.width}px`,\n \"--segment-indicator-block-size\": `${itemRect.height}px`,\n \"--segment-indicator-left\": `${left}px`,\n \"--segment-indicator-right\": `${right}px`,\n \"--segment-indicator-top\": `${top}px`,\n \"--segment-indicator-bottom\": `${bottom}px`,\n \"--segment-indicator-width\": `${itemRect.width}px`,\n \"--segment-indicator-height\": `${itemRect.height}px`,\n };\n}\n\n/**\n * Places a server-rendered SegmentedControl Indicator before hydration\n * (spec/segmented-control.md, \"Server rendering\"; Base UI's `renderBeforeHydration`, as\n * {@link placeTabsIndicator}). It runs as an inline script inside the Indicator, as the page\n * parses: `script` is that script, which it removes. The Root and its checked Item are found by\n * their part attributes. Self-contained (no import, no closure): a framework writes its source\n * into the page, `` `(${placeSegmentIndicator})(document.currentScript)` ``. It sets the variables\n * of {@link segmentIndicatorBox}, computed the same way.\n */\nexport function placeSegmentIndicator(script: Element | null): void {\n const indicator = script?.parentElement;\n script?.remove();\n const root = indicator?.closest(\n '[data-primitives-part=\"segmented-control-root\"]',\n );\n const item = root?.querySelector(\n '[data-primitives-part=\"segmented-control-item\"][aria-checked=\"true\"]',\n );\n const view = indicator?.ownerDocument.defaultView;\n if (!indicator || !root || !item || !view) {\n return;\n }\n const rootRect = root.getBoundingClientRect();\n const itemRect = item.getBoundingClientRect();\n const rtl = view.getComputedStyle(root).direction === \"rtl\";\n const left = itemRect.left - rootRect.left - root.clientLeft;\n const top = itemRect.top - rootRect.top - root.clientTop;\n const right = root.clientWidth - left - itemRect.width;\n const values: [string, number][] = [\n [\"inset-inline-start\", rtl ? right : left],\n [\"inset-block-start\", top],\n [\"inline-size\", itemRect.width],\n [\"block-size\", itemRect.height],\n [\"left\", left],\n [\"right\", right],\n [\"top\", top],\n [\"bottom\", root.clientHeight - top - itemRect.height],\n [\"width\", itemRect.width],\n [\"height\", itemRect.height],\n ];\n values.forEach(([name, value]) => {\n indicator.style.setProperty(\n `--segment-indicator-${name}`,\n `${value}px`,\n );\n });\n}\n","/** The Indicator's CSS variables (spec/tabs.md, \"API\"): the selected tab's box from the list. */\nexport type TabsIndicatorBox = Record<\n | \"--tabs-indicator-inset-inline-start\"\n | \"--tabs-indicator-inset-block-start\"\n | \"--tabs-indicator-inline-size\"\n | \"--tabs-indicator-block-size\"\n | \"--active-tab-left\"\n | \"--active-tab-right\"\n | \"--active-tab-top\"\n | \"--active-tab-bottom\"\n | \"--active-tab-width\"\n | \"--active-tab-height\",\n string\n>;\n\n/**\n * The selected tab's box relative to its list, as the Indicator's variables (spec/tabs.md, \"API\"):\n * the logical ones (inline-start measured from the list's right edge when `rtl`, the layout's\n * direction) and Base UI's physical ones, every value in pixels.\n */\nexport function tabsIndicatorBox(\n list: Element,\n tab: Element,\n rtl: boolean,\n): TabsIndicatorBox {\n const listRect = list.getBoundingClientRect();\n const tabRect = tab.getBoundingClientRect();\n const left = tabRect.left - listRect.left;\n const right = listRect.right - tabRect.right;\n const top = tabRect.top - listRect.top;\n const bottom = listRect.bottom - tabRect.bottom;\n return {\n \"--tabs-indicator-inset-inline-start\": `${rtl ? right : left}px`,\n \"--tabs-indicator-inset-block-start\": `${top}px`,\n \"--tabs-indicator-inline-size\": `${tabRect.width}px`,\n \"--tabs-indicator-block-size\": `${tabRect.height}px`,\n \"--active-tab-left\": `${left}px`,\n \"--active-tab-right\": `${right}px`,\n \"--active-tab-top\": `${top}px`,\n \"--active-tab-bottom\": `${bottom}px`,\n \"--active-tab-width\": `${tabRect.width}px`,\n \"--active-tab-height\": `${tabRect.height}px`,\n };\n}\n\n/**\n * Places a server-rendered Tabs Indicator before hydration (spec/tabs.md, \"Server rendering\"; Base\n * UI's `renderBeforeHydration`). It runs as an inline script inside the Indicator, as the page\n * parses: `script` is that script, which it removes, so the hydration finds the Indicator as the\n * client renders it. The selected tab is the list's `aria-selected=\"true\"` tab. Self-contained (no\n * import, no closure): a framework writes its source into the page,\n * `` `(${placeTabsIndicator})(document.currentScript)` ``. It sets the variables of\n * {@link tabsIndicatorBox}, computed the same way.\n */\nexport function placeTabsIndicator(script: Element | null): void {\n const indicator = script?.parentElement;\n script?.remove();\n const list = indicator?.closest('[role=\"tablist\"]');\n const tab = list?.querySelector('[role=\"tab\"][aria-selected=\"true\"]');\n const view = indicator?.ownerDocument.defaultView;\n if (!indicator || !list || !tab || !view) {\n return;\n }\n const listRect = list.getBoundingClientRect();\n const tabRect = tab.getBoundingClientRect();\n const rtl = view.getComputedStyle(list).direction === \"rtl\";\n const left = tabRect.left - listRect.left;\n const right = listRect.right - tabRect.right;\n const top = tabRect.top - listRect.top;\n const values: [string, number][] = [\n [\"--tabs-indicator-inset-inline-start\", rtl ? right : left],\n [\"--tabs-indicator-inset-block-start\", top],\n [\"--tabs-indicator-inline-size\", tabRect.width],\n [\"--tabs-indicator-block-size\", tabRect.height],\n [\"--active-tab-left\", left],\n [\"--active-tab-right\", right],\n [\"--active-tab-top\", top],\n [\"--active-tab-bottom\", listRect.bottom - tabRect.bottom],\n [\"--active-tab-width\", tabRect.width],\n [\"--active-tab-height\", tabRect.height],\n ];\n values.forEach(([name, value]) => {\n indicator.style.setProperty(name, `${value}px`);\n });\n}\n","import { rovingKeyTarget } from \"./roving-focus.ts\";\n\n/** The keys of a key event that matter to the tag key maps (a `KeyboardEvent`, or a framework's). */\nexport interface TagKeyEvent {\n key: string;\n shiftKey: boolean;\n ctrlKey: boolean;\n metaKey: boolean;\n altKey: boolean;\n}\n\n/** What a key on a TagGroup's focused tag does (spec/tag-group.md, \"Keyboard\"). */\nexport type TagGroupKeyAction =\n | { type: \"focus\"; index: number }\n | { type: \"select\" }\n | { type: \"remove\" };\n\nexport interface TagGroupKeyOptions {\n rtl: boolean;\n /** Wrap from the last tag to the first, and back (`loopFocus`). */\n loop: boolean;\n /** The tags the keys pass over: the disabled ones (default: none). */\n skip?: (index: number) => boolean;\n /** Space and Enter select (a `selectionMode` other than `\"none\"`). */\n selectable: boolean;\n /** Delete and Backspace remove (the group has `onRemove`). */\n removable: boolean;\n}\n\n/**\n * The action of a key on the tag at `index` of a TagGroup's `count` tags (spec/tag-group.md,\n * \"Keyboard\"), or `null` for a key it leaves alone: the next tag is ArrowRight (ArrowLeft in RTL)\n * and ArrowDown, the previous one ArrowLeft (ArrowRight in RTL) and ArrowUp, passing over the\n * skipped tags and wrapping with `loop`; Home and End the first and last tag not skipped; Space\n * and Enter select; Delete and Backspace remove. A key with a modifier does nothing.\n */\nexport function tagGroupKeyTarget(\n event: TagKeyEvent,\n index: number,\n count: number,\n options: TagGroupKeyOptions,\n): TagGroupKeyAction | null {\n if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) {\n return null;\n }\n const { key } = event;\n if (key === \" \" || key === \"Enter\") {\n return options.selectable ? { type: \"select\" } : null;\n }\n if (key === \"Delete\" || key === \"Backspace\") {\n return options.removable ? { type: \"remove\" } : null;\n }\n const roving = {\n orientation: \"horizontal\" as const,\n rtl: options.rtl,\n loop: options.loop,\n ...(options.skip === undefined ? {} : { skip: options.skip }),\n };\n // ArrowDown and ArrowUp read the tags in order, as the next and previous arrows\n const moved =\n key === \"ArrowDown\"\n ? rovingKeyTarget(\n options.rtl ? \"ArrowLeft\" : \"ArrowRight\",\n index,\n count,\n roving,\n )\n : key === \"ArrowUp\"\n ? rovingKeyTarget(\n options.rtl ? \"ArrowRight\" : \"ArrowLeft\",\n index,\n count,\n roving,\n )\n : rovingKeyTarget(key, index, count, roving);\n return moved === null ? null : { type: \"focus\", index: moved };\n}\n\n/**\n * Where the focus goes once the item at `removed` of `count` items is gone (spec/tag-group.md,\n * \"Focus\"): the first item after it not skipped, else the last one before it not skipped, else -1\n * (the container). The index is the item's in the list before the removal.\n */\nexport function removalFocusIndex(\n count: number,\n removed: number,\n skip: (index: number) => boolean = () => false,\n): number {\n for (let index = removed + 1; index < count; index++) {\n if (!skip(index)) {\n return index;\n }\n }\n for (let index = Math.min(removed, count) - 1; index >= 0; index--) {\n if (!skip(index)) {\n return index;\n }\n }\n return -1;\n}\n\n/** The arrows that move toward the first tag and toward the Input, for the direction. */\nfunction tagArrows(rtl: boolean): { previous: string; next: string } {\n return rtl\n ? { previous: \"ArrowRight\", next: \"ArrowLeft\" }\n : { previous: \"ArrowLeft\", next: \"ArrowRight\" };\n}\n\n/** What a key in a TagsInput's Input does (spec/tags-input.md, \"Keyboard\"). */\nexport type TagsInputInputKeyAction =\n | { type: \"add\" }\n | { type: \"focus-tag\"; index: number };\n\n/**\n * The action of a key in a TagsInput's Input of `count` tags, or `null` for a key it leaves to the\n * input: Enter adds (the caller checks the text is not blank); Backspace and the previous arrow,\n * with the caret at the start and no text selected, focus the last tag. A key with Ctrl, Meta or\n * Alt does nothing.\n */\nexport function tagsInputInputKeyTarget(\n event: TagKeyEvent,\n caret: { selectionStart: number | null; selectionEnd: number | null },\n count: number,\n rtl: boolean,\n): TagsInputInputKeyAction | null {\n if (event.altKey || event.ctrlKey || event.metaKey) {\n return null;\n }\n if (event.key === \"Enter\") {\n return { type: \"add\" };\n }\n const atStart = caret.selectionStart === 0 && caret.selectionEnd === 0;\n if (\n atStart &&\n count > 0 &&\n !event.shiftKey &&\n (event.key === \"Backspace\" || event.key === tagArrows(rtl).previous)\n ) {\n return { type: \"focus-tag\", index: count - 1 };\n }\n return null;\n}\n\n/** What a key on a TagsInput's focused tag does (spec/tags-input.md, \"Keyboard\"). */\nexport type TagsInputTagKeyAction =\n /** Focus a tag (its index) or the Input. */\n | { type: \"focus\"; target: number | \"input\" }\n /** Remove the tag, then focus a tag (its index once removed) or the Input. */\n | { type: \"remove\"; focus: number | \"input\" }\n /** Edit the tag in its TagInput. */\n | { type: \"edit\" }\n /** Focus the Input, which receives the key (a printable character). */\n | { type: \"type\" };\n\n/**\n * The action of a key on the tag at `index` of a TagsInput's `count` tags (spec/tags-input.md,\n * \"Keyboard\"), or `null` for a key it leaves alone: the previous arrow focuses the previous tag\n * (none on the first), the next arrow the next tag or, past the last, the Input; Backspace removes\n * it and focuses the previous tag, else the one now at its place, else the Input; Delete removes it\n * and focuses the one now at its place, else the previous tag, else the Input; Enter edits it when\n * `editable`; Escape focuses the Input; a printable character goes to the Input. A key with Ctrl,\n * Meta or Alt does nothing.\n */\nexport function tagsInputTagKeyTarget(\n event: TagKeyEvent,\n index: number,\n count: number,\n options: { rtl: boolean; editable: boolean },\n): TagsInputTagKeyAction | null {\n if (event.altKey || event.ctrlKey || event.metaKey) {\n return null;\n }\n const { key } = event;\n const arrows = tagArrows(options.rtl);\n if (key === arrows.previous) {\n return index > 0 ? { type: \"focus\", target: index - 1 } : null;\n }\n if (key === arrows.next) {\n return {\n type: \"focus\",\n target: index < count - 1 ? index + 1 : \"input\",\n };\n }\n // the tags left once it is removed: `count - 1`, the one after it now at `index`\n const left = count - 1;\n if (key === \"Backspace\") {\n return {\n type: \"remove\",\n focus: index > 0 ? index - 1 : left > 0 ? 0 : \"input\",\n };\n }\n if (key === \"Delete\") {\n return {\n type: \"remove\",\n focus: index < left ? index : left > 0 ? left - 1 : \"input\",\n };\n }\n if (key === \"Enter\") {\n return options.editable ? { type: \"edit\" } : null;\n }\n if (key === \"Escape\") {\n return { type: \"focus\", target: \"input\" };\n }\n if (key.length === 1) {\n return { type: \"type\" };\n }\n return null;\n}\n","/**\n * Typeahead for lists (spec/menu.md): characters typed within `timeout` ms accumulate; repeating\n * one character cycles through the items starting with it.\n */\nexport function createTypeahead(timeout = 500) {\n let buffer = \"\";\n let last = 0;\n return {\n /** The index of the item to move to for `key`, or -1. `labels[i]` is item i's text. */\n match(\n key: string,\n labels: readonly string[],\n current: number,\n now = Date.now(),\n ): number {\n if (key.length !== 1 || labels.length === 0) {\n return -1;\n }\n buffer = now - last > timeout ? key : buffer + key;\n last = now;\n const lower = buffer.toLowerCase();\n const repeated = [...lower].every(\n (character) => character === lower[0],\n );\n const query = repeated ? (lower[0] ?? \"\") : lower;\n const start =\n repeated || buffer.length === 1\n ? current + 1\n : Math.max(current, 0);\n for (let offset = 0; offset < labels.length; offset++) {\n const index = (start + offset) % labels.length;\n if (\n (labels[index] ?? \"\").trim().toLowerCase().startsWith(query)\n ) {\n return index;\n }\n }\n return -1;\n },\n reset() {\n buffer = \"\";\n last = 0;\n },\n };\n}\n"],"mappings":";;;;;;;;AASA,SAAgB,oBACZ,UACA,MACA,aACmB;CACnB,IAAI,CAAC,YAAY,CAAC,QAAQ,aAAa,MACnC,OAAO;CAEX,MAAM,OAAO,SAAS,sBAAsB;CAC5C,MAAM,KAAK,KAAK,sBAAsB;CACtC,MAAM,CAAC,QAAQ,SACX,gBAAgB,eACV,CAAC,KAAK,MAAM,GAAG,IAAI,IACnB,CAAC,KAAK,KAAK,GAAG,GAAG;CAC3B,IAAI,QAAQ,QACR,OAAO,gBAAgB,eAAe,SAAS;CAEnD,IAAI,QAAQ,QACR,OAAO,gBAAgB,eAAe,UAAU;CAEpD,OAAO;AACX;;;ACjBA,SAAgB,WAAW,KAAkD;CACzE,OAAO,MACD;EAAE,UAAU;EAAc,MAAM;CAAY,IAC5C;EAAE,UAAU;EAAa,MAAM;CAAa;AACtD;;;;;AAMA,SAAgB,cACZ,KACA,OACA,OACA,KACoB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U,GAAA,CAAI,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,WAAW,KAAK,GAE3D,OAAO;GAEf;GACA,OAAO;EACX;EACA,QAAQ;GACJ,SAAS;GACT,OAAO;EACX;CACJ;AACJ"}
@@ -0,0 +1,2 @@
1
+ import { $ as ChipKeyAction, A as AccordionKeyOptions, B as ItemFilter, C as rovingKeys, D as edgeIndex, E as NavigationOptions, F as radioKeyTarget, G as includesItem, H as containsFilter, I as submenuKeys, J as itemLabel, K as isItemGroup, L as tabsKeyTarget, M as TabsKeyOptions, N as accordionKeyTarget, O as stepIndex, P as menuKeyTarget, Q as toggleItem, R as FilterItemsOptions, S as rovingKeyTarget, T as textFieldKeepsKey, U as filterItems, V as ItemGroup, W as flattenItems, X as queryIsLabel, Y as itemsEqual, Z as textContains, _ as scrollIntoViewWithin, a as TagsInputInputKeyAction, b as RovingOrientation, c as tagGroupKeyTarget, d as TabsIndicatorBox, et as chipArrows, f as placeTabsIndicator, g as segmentIndicatorBox, h as placeSegmentIndicator, i as TagKeyEvent, j as RadioKeyOptions, k as stepThroughNone, l as tagsInputInputKeyTarget, m as SegmentIndicatorBox, n as TagGroupKeyAction, nt as ActivationDirection, o as TagsInputTagKeyAction, p as tabsIndicatorBox, q as itemFormValue, r as TagGroupKeyOptions, rt as activationDirection, s as removalFocusIndex, t as createTypeahead, tt as chipKeyTarget, u as tagsInputTagKeyTarget, v as RovingKeyOptions, w as rovingTabStop, x as inDocumentOrder, y as RovingKeys, z as ItemEquality } from "./index-T9UcYvkf.js";
2
+ export { type AccordionKeyOptions, type ActivationDirection, type ChipKeyAction, type FilterItemsOptions, type ItemEquality, type ItemFilter, type ItemGroup, type NavigationOptions, type RadioKeyOptions, type RovingKeyOptions, type RovingKeys, type RovingOrientation, type SegmentIndicatorBox, type TabsIndicatorBox, type TabsKeyOptions, type TagGroupKeyAction, type TagGroupKeyOptions, type TagKeyEvent, type TagsInputInputKeyAction, type TagsInputTagKeyAction, accordionKeyTarget, activationDirection, chipArrows, chipKeyTarget, containsFilter, createTypeahead, edgeIndex, filterItems, flattenItems, inDocumentOrder, includesItem, isItemGroup, itemFormValue, itemLabel, itemsEqual, menuKeyTarget, placeSegmentIndicator, placeTabsIndicator, queryIsLabel, radioKeyTarget, removalFocusIndex, rovingKeyTarget, rovingKeys, rovingTabStop, scrollIntoViewWithin, segmentIndicatorBox, stepIndex, stepThroughNone, submenuKeys, tabsIndicatorBox, tabsKeyTarget, tagGroupKeyTarget, tagsInputInputKeyTarget, tagsInputTagKeyTarget, textContains, textFieldKeepsKey, toggleItem };
@@ -0,0 +1,3 @@
1
+ import { A as textContains, C as flattenItems, D as itemLabel, E as itemFormValue, M as chipArrows, N as chipKeyTarget, O as itemsEqual, P as activationDirection, S as filterItems, T as isItemGroup, _ as menuKeyTarget, a as tagsInputTagKeyTarget, b as tabsKeyTarget, c as placeSegmentIndicator, d as inDocumentOrder, f as rovingKeyTarget, g as accordionKeyTarget, h as textFieldKeepsKey, i as tagsInputInputKeyTarget, j as toggleItem, k as queryIsLabel, l as segmentIndicatorBox, m as rovingTabStop, n as removalFocusIndex, o as placeTabsIndicator, p as rovingKeys, r as tagGroupKeyTarget, s as tabsIndicatorBox, t as createTypeahead, u as scrollIntoViewWithin, v as radioKeyTarget, w as includesItem, x as containsFilter, y as submenuKeys } from "./collection-Dbk-PB5S.js";
2
+ import { n as stepIndex, r as stepThroughNone, t as edgeIndex } from "./list-navigation-CbWv4DK5.js";
3
+ export { accordionKeyTarget, activationDirection, chipArrows, chipKeyTarget, containsFilter, createTypeahead, edgeIndex, filterItems, flattenItems, inDocumentOrder, includesItem, isItemGroup, itemFormValue, itemLabel, itemsEqual, menuKeyTarget, placeSegmentIndicator, placeTabsIndicator, queryIsLabel, radioKeyTarget, removalFocusIndex, rovingKeyTarget, rovingKeys, rovingTabStop, scrollIntoViewWithin, segmentIndicatorBox, stepIndex, stepThroughNone, submenuKeys, tabsIndicatorBox, tabsKeyTarget, tagGroupKeyTarget, tagsInputInputKeyTarget, tagsInputTagKeyTarget, textContains, textFieldKeepsKey, toggleItem };