@mortenbrudvik/waveui 0.14.1 → 0.16.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 (265) hide show
  1. package/README.md +413 -53
  2. package/dist/components/data-display/InfoButton.cjs +1 -1
  3. package/dist/components/data-display/InfoButton.cjs.map +1 -1
  4. package/dist/components/data-display/InfoButton.mjs +90 -82
  5. package/dist/components/data-display/InfoButton.mjs.map +1 -1
  6. package/dist/components/data-display/InfoLabel.cjs +1 -1
  7. package/dist/components/data-display/InfoLabel.cjs.map +1 -1
  8. package/dist/components/data-display/InfoLabel.mjs +19 -18
  9. package/dist/components/data-display/InfoLabel.mjs.map +1 -1
  10. package/dist/components/data-display/List.cjs +1 -1
  11. package/dist/components/data-display/List.cjs.map +1 -1
  12. package/dist/components/data-display/List.mjs +405 -219
  13. package/dist/components/data-display/List.mjs.map +1 -1
  14. package/dist/components/data-display/List.registry.cjs +1 -1
  15. package/dist/components/data-display/List.registry.cjs.map +1 -1
  16. package/dist/components/data-display/List.registry.mjs +12 -6
  17. package/dist/components/data-display/List.registry.mjs.map +1 -1
  18. package/dist/components/feedback/MessageBarGroup.cjs +2 -0
  19. package/dist/components/feedback/MessageBarGroup.cjs.map +1 -0
  20. package/dist/components/feedback/MessageBarGroup.mjs +63 -0
  21. package/dist/components/feedback/MessageBarGroup.mjs.map +1 -0
  22. package/dist/components/feedback/ProgressBar.cjs +1 -1
  23. package/dist/components/feedback/ProgressBar.cjs.map +1 -1
  24. package/dist/components/feedback/ProgressBar.mjs +41 -39
  25. package/dist/components/feedback/ProgressBar.mjs.map +1 -1
  26. package/dist/components/feedback/Toaster.cjs +1 -1
  27. package/dist/components/feedback/Toaster.cjs.map +1 -1
  28. package/dist/components/feedback/Toaster.mjs +222 -216
  29. package/dist/components/feedback/Toaster.mjs.map +1 -1
  30. package/dist/components/input/Combobox.cjs +1 -1
  31. package/dist/components/input/Combobox.cjs.map +1 -1
  32. package/dist/components/input/Combobox.mjs +163 -148
  33. package/dist/components/input/Combobox.mjs.map +1 -1
  34. package/dist/components/input/Dropdown.cjs +1 -1
  35. package/dist/components/input/Dropdown.cjs.map +1 -1
  36. package/dist/components/input/Dropdown.mjs +132 -117
  37. package/dist/components/input/Dropdown.mjs.map +1 -1
  38. package/dist/components/input/Listbox.cjs +1 -1
  39. package/dist/components/input/Listbox.cjs.map +1 -1
  40. package/dist/components/input/Listbox.mjs +90 -78
  41. package/dist/components/input/Listbox.mjs.map +1 -1
  42. package/dist/components/input/Option.cjs +1 -1
  43. package/dist/components/input/Option.cjs.map +1 -1
  44. package/dist/components/input/Option.data.cjs +2 -0
  45. package/dist/components/input/Option.data.cjs.map +1 -0
  46. package/dist/components/input/Option.data.mjs +114 -0
  47. package/dist/components/input/Option.data.mjs.map +1 -0
  48. package/dist/components/input/Option.mjs +21 -17
  49. package/dist/components/input/Option.mjs.map +1 -1
  50. package/dist/components/layout/Accordion.cjs +1 -1
  51. package/dist/components/layout/Accordion.cjs.map +1 -1
  52. package/dist/components/layout/Accordion.mjs +124 -109
  53. package/dist/components/layout/Accordion.mjs.map +1 -1
  54. package/dist/components/layout/Carousel.cjs +1 -1
  55. package/dist/components/layout/Carousel.cjs.map +1 -1
  56. package/dist/components/layout/Carousel.mjs +207 -193
  57. package/dist/components/layout/Carousel.mjs.map +1 -1
  58. package/dist/components/layout/FlatTree.cjs +2 -0
  59. package/dist/components/layout/FlatTree.cjs.map +1 -0
  60. package/dist/components/layout/FlatTree.context.cjs +2 -0
  61. package/dist/components/layout/FlatTree.context.cjs.map +1 -0
  62. package/dist/components/layout/FlatTree.context.mjs +20 -0
  63. package/dist/components/layout/FlatTree.context.mjs.map +1 -0
  64. package/dist/components/layout/FlatTree.item.cjs +2 -0
  65. package/dist/components/layout/FlatTree.item.cjs.map +1 -0
  66. package/dist/components/layout/FlatTree.item.mjs +90 -0
  67. package/dist/components/layout/FlatTree.item.mjs.map +1 -0
  68. package/dist/components/layout/FlatTree.mjs +276 -0
  69. package/dist/components/layout/FlatTree.mjs.map +1 -0
  70. package/dist/components/layout/TabList.cjs +1 -1
  71. package/dist/components/layout/TabList.cjs.map +1 -1
  72. package/dist/components/layout/TabList.mjs +149 -108
  73. package/dist/components/layout/TabList.mjs.map +1 -1
  74. package/dist/components/layout/Tree.cjs.map +1 -1
  75. package/dist/components/layout/Tree.context.cjs +1 -1
  76. package/dist/components/layout/Tree.context.cjs.map +1 -1
  77. package/dist/components/layout/Tree.context.mjs +2 -1
  78. package/dist/components/layout/Tree.context.mjs.map +1 -1
  79. package/dist/components/layout/Tree.core.cjs +1 -1
  80. package/dist/components/layout/Tree.core.cjs.map +1 -1
  81. package/dist/components/layout/Tree.core.mjs +162 -148
  82. package/dist/components/layout/Tree.core.mjs.map +1 -1
  83. package/dist/components/layout/Tree.mjs.map +1 -1
  84. package/dist/components/layout/Tree.selection.cjs +1 -1
  85. package/dist/components/layout/Tree.selection.cjs.map +1 -1
  86. package/dist/components/layout/Tree.selection.mjs +11 -57
  87. package/dist/components/layout/Tree.selection.mjs.map +1 -1
  88. package/dist/components/layout/useFlatTree.cjs +2 -0
  89. package/dist/components/layout/useFlatTree.cjs.map +1 -0
  90. package/dist/components/layout/useFlatTree.mjs +83 -0
  91. package/dist/components/layout/useFlatTree.mjs.map +1 -0
  92. package/dist/components/navigation/Menu.popover.cjs +1 -1
  93. package/dist/components/navigation/Menu.popover.cjs.map +1 -1
  94. package/dist/components/navigation/Menu.popover.mjs +154 -168
  95. package/dist/components/navigation/Menu.popover.mjs.map +1 -1
  96. package/dist/components/navigation/Nav.cjs +1 -1
  97. package/dist/components/navigation/Nav.cjs.map +1 -1
  98. package/dist/components/navigation/Nav.mjs +156 -136
  99. package/dist/components/navigation/Nav.mjs.map +1 -1
  100. package/dist/components/navigation/NavDrawer.cjs +1 -1
  101. package/dist/components/navigation/NavDrawer.cjs.map +1 -1
  102. package/dist/components/navigation/NavDrawer.mjs +48 -45
  103. package/dist/components/navigation/NavDrawer.mjs.map +1 -1
  104. package/dist/components/overlays/Dialog.cjs +1 -1
  105. package/dist/components/overlays/Dialog.cjs.map +1 -1
  106. package/dist/components/overlays/Dialog.mjs +128 -122
  107. package/dist/components/overlays/Dialog.mjs.map +1 -1
  108. package/dist/components/overlays/Dialog.slots.cjs +1 -1
  109. package/dist/components/overlays/Dialog.slots.cjs.map +1 -1
  110. package/dist/components/overlays/Dialog.slots.mjs +12 -12
  111. package/dist/components/overlays/Dialog.slots.mjs.map +1 -1
  112. package/dist/components/overlays/Drawer.cjs.map +1 -1
  113. package/dist/components/overlays/Drawer.mjs.map +1 -1
  114. package/dist/components/overlays/Drawer.panel.cjs +1 -1
  115. package/dist/components/overlays/Drawer.panel.cjs.map +1 -1
  116. package/dist/components/overlays/Drawer.panel.mjs +97 -81
  117. package/dist/components/overlays/Drawer.panel.mjs.map +1 -1
  118. package/dist/components/overlays/Drawer.root.cjs +1 -1
  119. package/dist/components/overlays/Drawer.root.cjs.map +1 -1
  120. package/dist/components/overlays/Drawer.root.mjs +34 -31
  121. package/dist/components/overlays/Drawer.root.mjs.map +1 -1
  122. package/dist/components/overlays/Popover.cjs +1 -1
  123. package/dist/components/overlays/Popover.cjs.map +1 -1
  124. package/dist/components/overlays/Popover.mjs +231 -216
  125. package/dist/components/overlays/Popover.mjs.map +1 -1
  126. package/dist/components/overlays/TeachingPopover.cjs.map +1 -1
  127. package/dist/components/overlays/TeachingPopover.mjs.map +1 -1
  128. package/dist/components/overlays/TeachingPopover.parts.cjs +1 -1
  129. package/dist/components/overlays/TeachingPopover.parts.cjs.map +1 -1
  130. package/dist/components/overlays/TeachingPopover.parts.mjs +199 -177
  131. package/dist/components/overlays/TeachingPopover.parts.mjs.map +1 -1
  132. package/dist/components/overlays/TeachingPopover.root.cjs +1 -1
  133. package/dist/components/overlays/TeachingPopover.root.cjs.map +1 -1
  134. package/dist/components/overlays/TeachingPopover.root.mjs +93 -92
  135. package/dist/components/overlays/TeachingPopover.root.mjs.map +1 -1
  136. package/dist/components/overlays/Tooltip.cjs +1 -1
  137. package/dist/components/overlays/Tooltip.cjs.map +1 -1
  138. package/dist/components/overlays/Tooltip.mjs +66 -61
  139. package/dist/components/overlays/Tooltip.mjs.map +1 -1
  140. package/dist/components/provider/WaveProvider.cjs +1 -1
  141. package/dist/components/provider/WaveProvider.cjs.map +1 -1
  142. package/dist/components/provider/WaveProvider.mjs +26 -23
  143. package/dist/components/provider/WaveProvider.mjs.map +1 -1
  144. package/dist/components/table/DataGrid.cjs +1 -1
  145. package/dist/components/table/DataGrid.cjs.map +1 -1
  146. package/dist/components/table/DataGrid.context.cjs +2 -0
  147. package/dist/components/table/DataGrid.context.cjs.map +1 -0
  148. package/dist/components/table/DataGrid.context.mjs +74 -0
  149. package/dist/components/table/DataGrid.context.mjs.map +1 -0
  150. package/dist/components/table/DataGrid.header.cjs +2 -0
  151. package/dist/components/table/DataGrid.header.cjs.map +1 -0
  152. package/dist/components/table/DataGrid.header.mjs +168 -0
  153. package/dist/components/table/DataGrid.header.mjs.map +1 -0
  154. package/dist/components/table/DataGrid.mjs +488 -591
  155. package/dist/components/table/DataGrid.mjs.map +1 -1
  156. package/dist/components/table/DataGrid.sizing.cjs +2 -0
  157. package/dist/components/table/DataGrid.sizing.cjs.map +1 -0
  158. package/dist/components/table/DataGrid.sizing.mjs +187 -0
  159. package/dist/components/table/DataGrid.sizing.mjs.map +1 -0
  160. package/dist/components/table/DataGrid.store.cjs +2 -0
  161. package/dist/components/table/DataGrid.store.cjs.map +1 -0
  162. package/dist/components/table/DataGrid.store.mjs +108 -0
  163. package/dist/components/table/DataGrid.store.mjs.map +1 -0
  164. package/dist/components/table/DataGrid.window.cjs +2 -0
  165. package/dist/components/table/DataGrid.window.cjs.map +1 -0
  166. package/dist/components/table/DataGrid.window.mjs +165 -0
  167. package/dist/components/table/DataGrid.window.mjs.map +1 -0
  168. package/dist/components/table/Table.cjs +1 -1
  169. package/dist/components/table/Table.cjs.map +1 -1
  170. package/dist/components/table/Table.mjs +74 -72
  171. package/dist/components/table/Table.mjs.map +1 -1
  172. package/dist/components/table/Table.resize.cjs +2 -0
  173. package/dist/components/table/Table.resize.cjs.map +1 -0
  174. package/dist/components/table/Table.resize.mjs +98 -0
  175. package/dist/components/table/Table.resize.mjs.map +1 -0
  176. package/dist/components/table/useGridNavigation.cjs +1 -1
  177. package/dist/components/table/useGridNavigation.cjs.map +1 -1
  178. package/dist/components/table/useGridNavigation.mjs +343 -140
  179. package/dist/components/table/useGridNavigation.mjs.map +1 -1
  180. package/dist/components/table/useTableColumnSizing.cjs +2 -0
  181. package/dist/components/table/useTableColumnSizing.cjs.map +1 -0
  182. package/dist/components/table/useTableColumnSizing.mjs +76 -0
  183. package/dist/components/table/useTableColumnSizing.mjs.map +1 -0
  184. package/dist/components/table/useTableFeatures.cjs +2 -0
  185. package/dist/components/table/useTableFeatures.cjs.map +1 -0
  186. package/dist/components/table/useTableFeatures.mjs +110 -0
  187. package/dist/components/table/useTableFeatures.mjs.map +1 -0
  188. package/dist/components/table/useTableSelection.cjs +2 -0
  189. package/dist/components/table/useTableSelection.cjs.map +1 -0
  190. package/dist/components/table/useTableSelection.mjs +39 -0
  191. package/dist/components/table/useTableSelection.mjs.map +1 -0
  192. package/dist/components/table/useTableSort.cjs +2 -0
  193. package/dist/components/table/useTableSort.cjs.map +1 -0
  194. package/dist/components/table/useTableSort.mjs +58 -0
  195. package/dist/components/table/useTableSort.mjs.map +1 -0
  196. package/dist/hooks/useActiveDescendant.cjs +1 -1
  197. package/dist/hooks/useActiveDescendant.cjs.map +1 -1
  198. package/dist/hooks/useActiveDescendant.mjs +33 -25
  199. package/dist/hooks/useActiveDescendant.mjs.map +1 -1
  200. package/dist/hooks/useCollapsePresence.cjs +2 -0
  201. package/dist/hooks/useCollapsePresence.cjs.map +1 -0
  202. package/dist/hooks/useCollapsePresence.mjs +21 -0
  203. package/dist/hooks/useCollapsePresence.mjs.map +1 -0
  204. package/dist/hooks/useFocusBeforeClose.cjs +2 -0
  205. package/dist/hooks/useFocusBeforeClose.cjs.map +1 -0
  206. package/dist/hooks/useFocusBeforeClose.mjs +33 -0
  207. package/dist/hooks/useFocusBeforeClose.mjs.map +1 -0
  208. package/dist/hooks/useListbox.cjs +1 -1
  209. package/dist/hooks/useListbox.cjs.map +1 -1
  210. package/dist/hooks/useListbox.mjs +140 -130
  211. package/dist/hooks/useListbox.mjs.map +1 -1
  212. package/dist/hooks/useMotion.cjs +2 -0
  213. package/dist/hooks/useMotion.cjs.map +1 -0
  214. package/dist/hooks/useMotion.mjs +14 -0
  215. package/dist/hooks/useMotion.mjs.map +1 -0
  216. package/dist/hooks/usePresenceGroup.cjs +2 -0
  217. package/dist/hooks/usePresenceGroup.cjs.map +1 -0
  218. package/dist/hooks/usePresenceGroup.mjs +68 -0
  219. package/dist/hooks/usePresenceGroup.mjs.map +1 -0
  220. package/dist/hooks/useRovingTabIndex.cjs +1 -1
  221. package/dist/hooks/useRovingTabIndex.cjs.map +1 -1
  222. package/dist/hooks/useRovingTabIndex.mjs +1 -1
  223. package/dist/hooks/useRovingTabIndex.mjs.map +1 -1
  224. package/dist/hooks/useSelection.cjs +2 -0
  225. package/dist/hooks/useSelection.cjs.map +1 -0
  226. package/dist/hooks/useSelection.mjs +57 -0
  227. package/dist/hooks/useSelection.mjs.map +1 -0
  228. package/dist/hooks/useVirtualWindow.cjs +2 -0
  229. package/dist/hooks/useVirtualWindow.cjs.map +1 -0
  230. package/dist/hooks/useVirtualWindow.mjs +102 -0
  231. package/dist/hooks/useVirtualWindow.mjs.map +1 -0
  232. package/dist/index.cjs +1 -1
  233. package/dist/index.d.cts +2249 -179
  234. package/dist/index.d.ts +2249 -179
  235. package/dist/index.mjs +147 -135
  236. package/dist/lib/classNames.cjs +1 -1
  237. package/dist/lib/classNames.cjs.map +1 -1
  238. package/dist/lib/classNames.mjs +125 -95
  239. package/dist/lib/classNames.mjs.map +1 -1
  240. package/dist/lib/columnSizing.cjs +2 -0
  241. package/dist/lib/columnSizing.cjs.map +1 -0
  242. package/dist/lib/columnSizing.mjs +27 -0
  243. package/dist/lib/columnSizing.mjs.map +1 -0
  244. package/dist/lib/flatTree.cjs +2 -0
  245. package/dist/lib/flatTree.cjs.map +1 -0
  246. package/dist/lib/flatTree.mjs +118 -0
  247. package/dist/lib/flatTree.mjs.map +1 -0
  248. package/dist/lib/motion.cjs +2 -0
  249. package/dist/lib/motion.cjs.map +1 -0
  250. package/dist/lib/motion.mjs +43 -0
  251. package/dist/lib/motion.mjs.map +1 -0
  252. package/dist/lib/selection.cjs +2 -0
  253. package/dist/lib/selection.cjs.map +1 -0
  254. package/dist/lib/selection.mjs +28 -0
  255. package/dist/lib/selection.mjs.map +1 -0
  256. package/dist/lib/treeCascade.cjs +2 -0
  257. package/dist/lib/treeCascade.cjs.map +1 -0
  258. package/dist/lib/treeCascade.mjs +52 -0
  259. package/dist/lib/treeCascade.mjs.map +1 -0
  260. package/dist/lib/virtual.cjs +2 -0
  261. package/dist/lib/virtual.cjs.map +1 -0
  262. package/dist/lib/virtual.mjs +54 -0
  263. package/dist/lib/virtual.mjs.map +1 -0
  264. package/dist/styles.css +1 -1
  265. package/package.json +2 -1
@@ -1 +1 @@
1
- {"version":3,"file":"TabList.cjs","names":["React","getElementType","resolveDeprecatedProp","useControllable","useRovingTabIndex","useEventCallback","useId","getPartId","useMergedRefs","cn","tabListClassNames","composeEventHandlers","forcedColors","slotRendersContent","tabListTabClassNames","disabledStyles","focusRingInset","renderSlot","tabListPanelClassNames","focusRing","tabListPanelsClassNames","require_runtime","require_cn","require_children","require_dev","require_slot","require_composeEventHandlers","require_classNames","require_useEventCallback","require_useControllable","require_useId","require_useRovingTabIndex","require_useMergedRefs","require_styles","require_disclosureIds","react","react_jsx_runtime","warnDuplicateTabValue","value","createRegistry","entries","listeners","ready","emit","listener","map","part","ids","id","index","INERT_REGISTRY","TabListContext","INERT_CONTEXT","useTabListContext","component","isUnavailable","ariaDisabled","props","consumerId","collectStructure","node","child","into","type","Tab","TabPanel","TabListRoot","containsPart","TabPanels","rendersAfterTablist","TabListAreaContext","PANEL_IN_TABLIST_MESSAGE","valueProp","defaultValueProp","orientationProp","rest","selectedValue","defaultValue","defaultSelectedValue","orientation","vertical","onTabSelect","selected","setSelected","isControlled","onValueChange","structureKey","children","structure","parsed","derivesSelection","selectTabOnFocus","select","next","isSelected","getTabIndex","tabValue","baseId","registry","context","itemValue","panel","appearance","size","mergedRef","ref","containerProps","tabs","panels","keyed","key","isVertical","className","onKeyDown","onFocus","tabPadding","tabIconOnlyPadding","tabText","tabLookClasses","shape","idProp","ctx","unavailable","hasIcon","icon","iconOnly","ariaLabel","ariaLabelledBy","named","mountedPanelId","panelId","onClick","insideTablist","mountedTabId","tabId","TabList"],"sources":["../../../src/components/layout/TabList.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n tabListClassNames,\n tabListPanelClassNames,\n tabListPanelsClassNames,\n tabListTabClassNames,\n} from '../../lib/classNames';\nimport { flattenChildren, getElementType } from '../../lib/children';\nimport { cn } from '../../lib/cn';\nimport { composeEventHandlers } from '../../lib/composeEventHandlers';\nimport {\n reportMissingContext,\n resolveDeprecatedProp,\n warnDeprecated,\n warnOnce,\n} from '../../lib/dev';\nimport { renderSlot, slotRendersContent } from '../../lib/slot';\nimport { disabledStyles, focusRing, focusRingInset, forcedColors } from '../../lib/styles';\nimport type { CoreSize, Orientation, Slot } from '../../lib/types';\nimport { useControllable } from '../../hooks/useControllable';\nimport { useEventCallback } from '../../hooks/useEventCallback';\nimport { useId } from '../../hooks/useId';\nimport { useMergedRefs } from '../../hooks/useMergedRefs';\nimport { useRovingTabIndex } from '../../hooks/useRovingTabIndex';\nimport { getPartId } from './disclosureIds';\n\n/* ------------------------------------------------------------------ */\n/* Context */\n/* ------------------------------------------------------------------ */\n\ntype TabListPart = 'tab' | 'panel';\n\n/**\n * The ids of the mounted Tabs and Panels by value. A Tab references a panel only while one with\n * its value is mounted (a TabList used as a filter bar has none), and each side references the\n * other's actual id, a consumer `id` included. Read with `useSyncExternalStore`.\n *\n * Before the TabList has mounted (server HTML, hydration and the first client render) the\n * registry is not ready and the static structure of the children stands in for it; once it is\n * ready, it alone decides, so a Panel that is in the element tree but never mounts (inside a\n * wrapper that renders nothing) is not referenced.\n */\ninterface TabListRegistry {\n /** Registers a mounted Tab or Panel; returns the unregister function. */\n register: (part: TabListPart, value: string, id: string) => () => void;\n /**\n * Id of the first mounted Tab or Panel with this value, `null` when none is mounted, or\n * `undefined` while the registry is not ready (use the static structure then).\n */\n get: (part: TabListPart, value: string) => string | null | undefined;\n /** Called by the TabList once it (and so every Tab and Panel mounted with it) has mounted. */\n markReady: () => void;\n subscribe: (listener: () => void) => () => void;\n}\n\n/** Tabs that share a value share one id, and are selected and tab stops together. */\nfunction warnDuplicateTabValue(value: string): void {\n warnOnce(\n `TabList:duplicate:${value}`,\n `TabList: several tabs share the value \"${value}\". Tab values must be unique within a ` +\n 'TabList; tabs with the same value share one id and are selected (and tab stops) together.',\n );\n}\n\nfunction createRegistry(): TabListRegistry {\n const entries: Record<TabListPart, Map<string, string[]>> = { tab: new Map(), panel: new Map() };\n const listeners = new Set<() => void>();\n let ready = false;\n const emit = () => {\n listeners.forEach((listener) => listener());\n };\n return {\n register(part, value, id) {\n const map = entries[part];\n const ids = map.get(value) ?? [];\n // Called from the part's layout effect (C-DEV). Two Panels may share a value (the Tab links\n // to the first mounted one); two Tabs may not.\n if (part === 'tab' && ids.length > 0) warnDuplicateTabValue(value);\n map.set(value, [...ids, id]);\n emit();\n return () => {\n const ids = [...(map.get(value) ?? [])];\n const index = ids.indexOf(id);\n if (index !== -1) ids.splice(index, 1);\n if (ids.length > 0) map.set(value, ids);\n else map.delete(value);\n emit();\n };\n },\n get: (part, value) => (ready ? (entries[part].get(value)?.[0] ?? null) : undefined),\n markReady() {\n if (ready) return;\n ready = true;\n emit();\n },\n subscribe(listener) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n };\n}\n\nconst INERT_REGISTRY: TabListRegistry = {\n register: () => () => {},\n get: () => undefined,\n markReady: () => {},\n subscribe: () => () => {},\n};\n\n/**\n * What the TabList's children show before anything mounts (server HTML and the first render):\n * found in the element tree through Fragments and the `children` of wrapper elements, but not\n * inside a component that renders a Tab or Panel itself (the registry covers those once mounted).\n */\ninterface TabListStructure {\n /** Value of the first Tab without `disabled`/`aria-disabled`: the uncontrolled default. */\n firstEnabled?: string;\n /** Consumer `id`s of Tabs, by value. */\n tabIds: Array<[string, string]>;\n /** Values of the Panels, each with its consumer `id` or `null`. */\n panels: Array<[string, string | null]>;\n}\n\n/** The look of a TabList: an underline, subtle fills, or circular subtle or filled tabs. */\nexport type TabListAppearance = 'transparent' | 'subtle' | 'subtle-circular' | 'filled-circular';\n\ninterface TabListContextValue {\n orientation: Orientation;\n appearance: TabListAppearance;\n size: CoreSize;\n /** Whether the tab with this value is the selected one (explicit value, else the tab stop). */\n isSelected: (value: string) => boolean;\n /**\n * Activates a tab: a click (Enter and Space click the tab button), or with automatic activation\n * focus moved by the keys.\n */\n select: (value: string) => void;\n getTabIndex: (value: string) => 0 | -1;\n /** The generated id of a Tab or Panel (used when it has no consumer `id`). */\n getGeneratedId: (part: TabListPart, value: string) => string;\n /**\n * Id of the Tab with this value before the TabList mounts: its consumer `id`, else the\n * generated one.\n */\n getStaticTabId: (value: string) => string;\n /**\n * Id of the Panel with this value before the TabList mounts, or `undefined` when the children\n * have none.\n */\n getStaticPanelId: (value: string) => string | undefined;\n registry: TabListRegistry;\n}\n\nconst TabListContext = React.createContext<TabListContextValue | null>(null);\n\nconst INERT_CONTEXT: TabListContextValue = {\n orientation: 'horizontal',\n appearance: 'transparent',\n size: 'medium',\n isSelected: () => false,\n select: () => {},\n getTabIndex: () => -1,\n getGeneratedId: (part, value) => `wave-tablist-inert-${part}-${value}`,\n getStaticTabId: (value) => `wave-tablist-inert-tab-${value}`,\n getStaticPanelId: () => undefined,\n registry: INERT_REGISTRY,\n};\n\n/** C-CONTEXT: throws in development, logs once and returns an inert value in production. */\nfunction useTabListContext(component: string): TabListContextValue {\n const context = React.useContext(TabListContext);\n if (context) return context;\n reportMissingContext(component, '<TabList>');\n return INERT_CONTEXT;\n}\n\ninterface StructureProps {\n value?: unknown;\n id?: unknown;\n disabled?: unknown;\n 'aria-disabled'?: unknown;\n children?: unknown;\n}\n\n/** Whether a Tab's props make it unavailable (it cannot be selected and is skipped by keys). */\nfunction isUnavailable(props: StructureProps): boolean {\n const ariaDisabled = props['aria-disabled'];\n return props.disabled === true || ariaDisabled === true || ariaDisabled === 'true';\n}\n\n/** A consumer `id` that replaces the generated one: a non-empty string (`''` counts as none). */\nfunction consumerId(id: unknown): string | null {\n return typeof id === 'string' && id !== '' ? id : null;\n}\n\n/**\n * Walks the element tree of the TabList's children (see {@link TabListStructure}). Parts are\n * identified through their element type, so parts written in a Server Component (lazy\n * references) count too. A `React.lazy` still loading (inside the consumer's own `<Suspense>`,\n * such as code-split panels in `TabList.Panels`) is no part and never suspends the TabList: its\n * children are walked instead. Runs during render only.\n */\nfunction collectStructure(node: unknown, into: TabListStructure): TabListStructure {\n if (Array.isArray(node)) {\n node.forEach((child) => collectStructure(child, into));\n return into;\n }\n if (!React.isValidElement<StructureProps>(node)) return into;\n const { props } = node;\n const type = getElementType(node, { suspend: false });\n const value = typeof props.value === 'string' ? props.value : undefined;\n if (type === Tab) {\n if (value !== undefined) {\n if (into.firstEnabled === undefined && !isUnavailable(props)) into.firstEnabled = value;\n const id = consumerId(props.id);\n if (id !== null) into.tabIds.push([value, id]);\n }\n return into;\n }\n if (type === TabPanel) {\n if (value !== undefined) into.panels.push([value, consumerId(props.id)]);\n return into;\n }\n if (type === TabListRoot) return into;\n return collectStructure(props.children, into);\n}\n\n/**\n * Whether an element tree shows a Tab, or a Panel (`TabList.Panel` or `TabList.Panels`), found as\n * in {@link collectStructure}: through Fragments and the `children` of wrapper elements, not inside\n * a nested TabList or a component that renders the part itself.\n */\nfunction containsPart(node: unknown, part: TabListPart): boolean {\n if (Array.isArray(node)) return node.some((child) => containsPart(child, part));\n if (!React.isValidElement<StructureProps>(node)) return false;\n const type = getElementType(node, { suspend: false });\n if (type === Tab) return part === 'tab';\n if (type === TabPanel || type === TabPanels) return part === 'panel';\n if (type === TabListRoot) return false;\n return containsPart(node.props.children, part);\n}\n\n/**\n * Whether a child of the TabList renders after the tablist: a Panel, `TabList.Panels`, or a\n * wrapper (an element, `Suspense`, an error boundary) that holds panels and no tab.\n */\nfunction rendersAfterTablist(child: React.ReactNode): boolean {\n return containsPart(child, 'panel') && !containsPart(child, 'tab');\n}\n\n/**\n * Where the TabList renders its children: inside the `role=\"tablist\"` element (`'tabs'`) or after\n * it (`'panels'`). A Panel that ends up inside the tablist warns in development.\n */\nconst TabListAreaContext = React.createContext<'tabs' | 'panels' | null>(null);\n\nconst PANEL_IN_TABLIST_MESSAGE =\n 'TabList.Panel was rendered inside the role=\"tablist\" element, where only tabs belong (axe ' +\n 'aria-required-children). The TabList moves a Panel after the tablist when it is its child, or ' +\n 'in a wrapper that holds no Tab, but it cannot see a Panel that a component renders itself, or ' +\n \"separate a wrapper's Panels from its Tabs. Place such panels inside TabList.Panels, which \" +\n 'renders after the tablist.';\n\n/* ------------------------------------------------------------------ */\n/* TabList */\n/* ------------------------------------------------------------------ */\n\n/** Properties for the TabList component. */\nexport interface TabListProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'defaultValue'> {\n /**\n * Controlled value of the selected tab (`''`: no tab selected). A controlled value that becomes\n * `undefined` also selects no tab: the TabList stays controlled.\n */\n value?: string;\n /**\n * Selected tab for uncontrolled usage. When it is omitted (or `''`), the first enabled tab\n * written in the TabList's children is selected, from the first render (and in server-rendered\n * HTML) on. Tabs written directly in the children, in Fragments or in wrapper elements that\n * pass them as `children` (such as a Tooltip) count; a tab rendered by a custom component that\n * renders `TabList.Tab` itself does not, even when it comes first in the DOM, so that server\n * and client pick the same tab. When every tab comes from such a component, the first enabled\n * tab in the DOM is selected once the tabs mount. To select a tab that a custom component\n * renders, pass `defaultValue`.\n */\n defaultValue?: string;\n /** Called with the new value when the selected tab changes (not when it is activated again). */\n onValueChange?: (value: string) => void;\n /**\n * Layout and arrow-key axis: `'horizontal'` (Left/Right, mirrored in RTL) or `'vertical'`\n * (Up/Down).\n * @default 'horizontal'\n */\n orientation?: Orientation;\n /**\n * Look of the tabs: `transparent` underlines the selected tab, `subtle` and `subtle-circular`\n * fill it with a subtle color (square or fully rounded), `filled-circular` fills it with the\n * primary color. In forced colors the selected tab keeps a Highlight outline (or underline) in\n * every appearance.\n * @default 'transparent'\n */\n appearance?: TabListAppearance;\n /**\n * Size of the tabs: their padding and type (`medium` is 14px text on 16 by 8px padding).\n * @default 'medium'\n */\n size?: CoreSize;\n /**\n * Whether moving focus with the arrow keys, Home and End also selects the tab (automatic\n * activation, as in 0.5). With `false`, the keys only move focus and Enter, Space or a click\n * selects the focused tab (manual activation, for panels that are slow to show). Fluent's\n * default is `false`.\n * @default true\n */\n selectTabOnFocus?: boolean;\n /** @deprecated Use `value`. */\n selectedValue?: string;\n /** @deprecated Use `defaultValue`. */\n defaultSelectedValue?: string;\n /**\n * @deprecated Use `onValueChange`. Unlike `onValueChange`, it is called on every activation,\n * including a click on the tab that is already selected.\n */\n onTabSelect?: (value: string) => void;\n /** @deprecated Use `orientation=\"vertical\"`. */\n vertical?: boolean;\n /** Ref to the `role=\"tablist\"` element. */\n ref?: React.Ref<HTMLDivElement>;\n}\n\nconst TabListRoot = ({\n value: valueProp,\n defaultValue: defaultValueProp,\n onValueChange,\n orientation: orientationProp,\n appearance = 'transparent',\n size = 'medium',\n selectTabOnFocus = true,\n selectedValue,\n defaultSelectedValue,\n onTabSelect,\n vertical,\n className,\n children,\n onKeyDown,\n onFocus,\n ref,\n ...rest\n}: TabListProps) => {\n const value = resolveDeprecatedProp(\n 'TabList',\n valueProp,\n selectedValue,\n 'selectedValue',\n 'value',\n );\n const defaultValue = resolveDeprecatedProp(\n 'TabList',\n defaultValueProp,\n defaultSelectedValue,\n 'defaultSelectedValue',\n 'defaultValue',\n );\n const orientation =\n resolveDeprecatedProp<Orientation>(\n 'TabList',\n orientationProp,\n vertical === undefined ? undefined : vertical ? 'vertical' : 'horizontal',\n 'vertical',\n 'orientation',\n ) ?? 'horizontal';\n if (onTabSelect) {\n warnDeprecated(\n 'TabList',\n 'onTabSelect',\n 'onValueChange',\n '`onValueChange` is called only when the selected tab changes.',\n );\n }\n\n // The sticky mode: a controlled value that becomes `undefined` clears the selection (`''`).\n const [selected, setSelected, isControlled] = useControllable(\n value,\n defaultValue ?? '',\n onValueChange,\n );\n\n // The children are a new element tree on every parent render: memoized by content, so the\n // context value stays stable while the tabs and panels stay the same.\n const structureKey = JSON.stringify(collectStructure(children, { tabIds: [], panels: [] }));\n const structure = React.useMemo(() => {\n const parsed = JSON.parse(structureKey) as TabListStructure;\n return {\n firstEnabled: parsed.firstEnabled,\n tabIds: new Map(parsed.tabIds),\n panels: new Map(parsed.panels),\n };\n }, [structureKey]);\n\n // Uncontrolled without a selection: the first enabled tab is selected. It is the tab stop the\n // roving store resolves from `activeValue` (the first enabled tab of the children, replaced by\n // the first enabled tab in the DOM once the store sees it disabled), so the selection is\n // derived during render, present from the first render on, and follows tabs that disable\n // themselves.\n const derivesSelection = !isControlled && selected === '';\n\n const { containerProps, getTabIndex } = useRovingTabIndex({\n activeValue: derivesSelection ? (structure.firstEnabled ?? null) : selected,\n orientation,\n loop: true,\n // Automatic activation (APG Tabs): moving focus selects the tab. With manual activation the\n // keys only move focus; the tab stop stays on the selected tab (`tabStop: 'active'`), and Enter\n // or Space selects the focused tab through its native click.\n onFocusMove: selectTabOnFocus ? (next) => select(next) : undefined,\n });\n\n const isSelected = React.useCallback(\n (tabValue: string) => (derivesSelection ? getTabIndex(tabValue) === 0 : selected === tabValue),\n [derivesSelection, getTabIndex, selected],\n );\n\n const select = useEventCallback((next: string) => {\n onTabSelect?.(next);\n if (!isSelected(next)) setSelected(next);\n });\n\n const baseId = useId('tablist');\n const [registry] = React.useState(createRegistry);\n // Runs after the layout effects of the Tabs and Panels mounted with the TabList, which have\n // registered by then: from here on the registry, not the static structure, decides the links.\n React.useLayoutEffect(() => registry.markReady(), [registry]);\n const context = React.useMemo<TabListContextValue>(\n () => ({\n orientation,\n appearance,\n size,\n isSelected,\n select,\n getTabIndex,\n getGeneratedId: (part, itemValue) => getPartId(baseId, part, itemValue),\n getStaticTabId: (tabValue) =>\n structure.tabIds.get(tabValue) ?? getPartId(baseId, 'tab', tabValue),\n getStaticPanelId: (tabValue) => {\n const panel = structure.panels.get(tabValue);\n if (panel === undefined) return undefined;\n return panel ?? getPartId(baseId, 'panel', tabValue);\n },\n registry,\n }),\n [orientation, appearance, size, isSelected, select, getTabIndex, baseId, structure, registry],\n );\n\n const mergedRef = useMergedRefs<HTMLDivElement>(ref, containerProps.ref);\n\n const tabs: React.ReactNode[] = [];\n const panels: React.ReactNode[] = [];\n flattenChildren(children).forEach(({ key, node: child }) => {\n const keyed = <React.Fragment key={key}>{child}</React.Fragment>;\n (rendersAfterTablist(child) ? panels : tabs).push(keyed);\n });\n\n const isVertical = orientation === 'vertical';\n return (\n <TabListContext.Provider value={context}>\n <div className={cn(isVertical && 'flex')}>\n <div\n role=\"tablist\"\n aria-orientation={orientation}\n data-appearance={appearance}\n data-size={size}\n data-orientation={orientation}\n className={cn(\n tabListClassNames.root,\n isVertical ? 'flex w-40 flex-col' : 'flex',\n appearance === 'transparent'\n ? isVertical\n ? 'border-e border-border'\n : 'border-b border-border'\n : 'gap-1',\n className,\n )}\n {...rest}\n data-roving-container=\"\"\n onKeyDown={composeEventHandlers(onKeyDown, containerProps.onKeyDown)}\n onFocus={composeEventHandlers(onFocus, containerProps.onFocus, {\n checkDefaultPrevented: false,\n })}\n ref={mergedRef}\n >\n <TabListAreaContext.Provider value=\"tabs\">{tabs}</TabListAreaContext.Provider>\n </div>\n <TabListAreaContext.Provider value=\"panels\">{panels}</TabListAreaContext.Provider>\n </div>\n </TabListContext.Provider>\n );\n};\nTabListRoot.displayName = 'TabList';\n\n/* ------------------------------------------------------------------ */\n/* TabList.Tab */\n/* ------------------------------------------------------------------ */\n\n/** Padding of a tab with text, per size. Literal strings only. */\nconst tabPadding: Readonly<Record<CoreSize, string>> = {\n small: 'px-3 py-1.5',\n medium: 'px-4 py-2',\n large: 'px-5 py-3',\n};\n\n/** Padding of an icon-only tab (a square hit area), per size. */\nconst tabIconOnlyPadding: Readonly<Record<CoreSize, string>> = {\n small: 'p-1.5',\n medium: 'p-2',\n large: 'p-3',\n};\n\n/** Type step of a tab, per size. */\nconst tabText: Readonly<Record<CoreSize, string>> = {\n small: 'text-caption-1',\n medium: 'text-body-1',\n large: 'text-body-2',\n};\n\n/**\n * The colors, fill and selected indicator of a tab per appearance. Literal strings only; hover and\n * pressed use the gated rules (a disabled tab keeps its look). In forced colors fills are dropped,\n * so every selected tab keeps a Highlight outline (or, for the underline, a Highlight border).\n */\nfunction tabLookClasses(\n appearance: TabListAppearance,\n selected: boolean,\n vertical: boolean,\n): string {\n switch (appearance) {\n case 'subtle':\n case 'subtle-circular': {\n const shape = appearance === 'subtle' ? 'rounded-md' : 'rounded-full';\n return selected\n ? cn(shape, 'bg-subtle-selected text-foreground', forcedColors.selectedContainer)\n : cn(\n shape,\n 'text-muted-foreground not-disabled:not-aria-disabled:hover:bg-subtle-hover not-disabled:not-aria-disabled:hover:text-foreground not-disabled:not-aria-disabled:active:bg-subtle-pressed',\n );\n }\n case 'filled-circular':\n return selected\n ? cn(\n 'rounded-full bg-primary text-primary-foreground not-disabled:not-aria-disabled:hover:bg-primary-hover not-disabled:not-aria-disabled:active:bg-primary-pressed',\n forcedColors.selectedContainer,\n )\n : 'rounded-full bg-muted text-muted-foreground not-disabled:not-aria-disabled:hover:bg-muted-hover not-disabled:not-aria-disabled:hover:text-foreground not-disabled:not-aria-disabled:active:bg-muted-pressed';\n default:\n return selected\n ? cn(\n 'text-primary forced-colors:border-[Highlight]',\n vertical ? 'border-s-2 border-s-primary' : 'border-b-2 border-b-primary',\n )\n : 'text-muted-foreground not-disabled:not-aria-disabled:hover:text-foreground';\n }\n}\n\n/** Properties for the Tab sub-component. */\nexport interface TabProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /** Unique value identifying this tab (and its panel). */\n value: string;\n /**\n * An icon before the text, hidden from assistive technology. A tab with an icon and no text is\n * icon-only (a square hit area): name it with `aria-label`, or a development warning asks for it.\n */\n icon?: Slot<'span'>;\n /** Ref to the tab `<button>`. */\n ref?: React.Ref<HTMLButtonElement>;\n}\n\n/**\n * A tab button. `onClick` runs before the selection (call `event.preventDefault()` to keep the\n * current tab). A `disabled` (or `aria-disabled=\"true\"`) tab is skipped by the keyboard and cannot\n * be selected. A non-empty `id` replaces the generated one (its panel's `aria-labelledby` follows\n * it). The selected tab references its panel with `aria-controls` only while a `TabList.Panel`\n * with its value is mounted.\n */\nconst Tab = ({ value, id: idProp, icon, className, children, onClick, ref, ...rest }: TabProps) => {\n const ctx = useTabListContext('TabList.Tab');\n const selected = ctx.isSelected(value);\n const isVertical = ctx.orientation === 'vertical';\n const unavailable = isUnavailable(rest);\n const hasIcon = !!icon && slotRendersContent(icon);\n const iconOnly = hasIcon && !slotRendersContent(children);\n const ariaLabel = rest['aria-label'];\n const ariaLabelledBy = rest['aria-labelledby'];\n const named =\n (typeof ariaLabel === 'string' && ariaLabel.trim() !== '') ||\n (typeof ariaLabelledBy === 'string' && ariaLabelledBy.trim() !== '');\n React.useEffect(() => {\n if (iconOnly && !named) {\n warnOnce(\n 'TabList.Tab:icon-only-name',\n 'TabList.Tab: a tab with an icon and no text has no accessible name. Pass `aria-label` (or `aria-labelledby`).',\n );\n }\n }, [iconOnly, named]);\n\n const { registry } = ctx;\n const id = consumerId(idProp) ?? ctx.getGeneratedId('tab', value);\n React.useLayoutEffect(() => registry.register('tab', value, id), [registry, value, id]);\n const mountedPanelId = React.useSyncExternalStore(\n registry.subscribe,\n () => registry.get('panel', value),\n () => undefined,\n );\n // Before the TabList mounts the static structure stands in; after that only a mounted panel is\n // referenced (`null`: none).\n const panelId =\n mountedPanelId === undefined ? ctx.getStaticPanelId(value) : (mountedPanelId ?? undefined);\n\n return (\n <button\n type=\"button\"\n role=\"tab\"\n className={cn(\n tabListTabClassNames.root,\n 'font-semibold transition-colors motion-reduce:transition-none',\n iconOnly ? tabIconOnlyPadding[ctx.size] : tabPadding[ctx.size],\n tabText[ctx.size],\n hasIcon && 'inline-flex items-center justify-center gap-2',\n isVertical && 'text-start',\n tabLookClasses(ctx.appearance, selected, isVertical),\n disabledStyles,\n focusRingInset,\n className,\n )}\n {...rest}\n id={id}\n aria-selected={selected}\n aria-controls={selected ? panelId : undefined}\n tabIndex={ctx.getTabIndex(value)}\n data-roving-value={value}\n data-selected={selected ? '' : undefined}\n data-icon-only={iconOnly ? '' : undefined}\n onClick={composeEventHandlers(onClick, () => {\n if (!unavailable) ctx.select(value);\n })}\n ref={ref}\n >\n {hasIcon && renderSlot(icon, 'span', tabListTabClassNames.icon, { 'aria-hidden': true })}\n {children}\n </button>\n );\n};\nTab.displayName = 'Tab';\n\n/* ------------------------------------------------------------------ */\n/* TabList.Panel */\n/* ------------------------------------------------------------------ */\n\n/** Properties for the TabPanel sub-component. */\nexport interface TabPanelProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Value of the Tab that shows this panel. */\n value: string;\n /** Ref to the `role=\"tabpanel\"` element. */\n ref?: React.Ref<HTMLDivElement>;\n}\n\n/**\n * The content of one tab, rendered only while its tab is selected and labelled by it (while a Tab\n * with its value is mounted). A non-empty `id` replaces the generated one (the tab's\n * `aria-controls` follows it).\n */\nconst TabPanel = ({ value, id: idProp, children, className, ref, ...rest }: TabPanelProps) => {\n const ctx = useTabListContext('TabList.Panel');\n const insideTablist = React.useContext(TabListAreaContext) === 'tabs';\n React.useEffect(() => {\n if (insideTablist) warnOnce('TabList.Panel:inside-tablist', PANEL_IN_TABLIST_MESSAGE);\n }, [insideTablist]);\n const { registry } = ctx;\n const id = consumerId(idProp) ?? ctx.getGeneratedId('panel', value);\n // Registered while mounted, also while hidden: the tab that selects it links to it.\n React.useLayoutEffect(() => registry.register('panel', value, id), [registry, value, id]);\n const mountedTabId = React.useSyncExternalStore(\n registry.subscribe,\n () => registry.get('tab', value),\n () => undefined,\n );\n if (!ctx.isSelected(value)) return null;\n // As for the Tab's aria-controls: the static structure only before the TabList mounts.\n const tabId =\n mountedTabId === undefined ? ctx.getStaticTabId(value) : (mountedTabId ?? undefined);\n return (\n <div\n role=\"tabpanel\"\n tabIndex={0}\n className={cn(tabListPanelClassNames.root, 'p-4', focusRing, className)}\n {...rest}\n id={id}\n aria-labelledby={tabId}\n ref={ref}\n >\n {children}\n </div>\n );\n};\nTabPanel.displayName = 'TabPanel';\n\n/* ------------------------------------------------------------------ */\n/* TabList.Panels */\n/* ------------------------------------------------------------------ */\n\n/** Properties for the TabPanels sub-component. */\nexport interface TabPanelsProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Ref to the container `<div>`. */\n ref?: React.Ref<HTMLDivElement>;\n}\n\n/**\n * Optional container for the panels, rendered after the tablist. Use it to style the panel area,\n * and for panels that components render themselves: the TabList finds a Panel in its children, in\n * a Fragment or in a wrapper that holds no Tab, but a component that renders a Panel itself\n * renders inside the tablist unless it is placed in `TabList.Panels`.\n */\nconst TabPanels = ({ className, children, ref, ...rest }: TabPanelsProps) => (\n <div\n ref={ref}\n className={cn(tabListPanelsClassNames.root, 'min-w-0 flex-1', className)}\n {...rest}\n >\n {children}\n </div>\n);\nTabPanels.displayName = 'TabPanels';\n\n/* ------------------------------------------------------------------ */\n/* Export */\n/* ------------------------------------------------------------------ */\n\n/**\n * A set of tabs with their panels (WAI-ARIA Tabs pattern): the arrow keys (Left/Right, mirrored\n * in RTL; Up/Down when vertical), Home and End move focus and select (automatic activation); with\n * `selectTabOnFocus={false}` they only move focus, and Enter, Space or a click selects the focused\n * tab (manual activation). The selected tab is the only tab stop; disabled tabs are skipped. Every\n * tab needs a `value` that is unique within the TabList (a development warning names a value that\n * several tabs share).\n *\n * Tabs register through context and are found in DOM order, so they may be wrapped (a Fragment,\n * a Tooltip). The children render inside the `role=\"tablist\"` element, except panels, which render\n * after it: a `TabList.Panel` or `TabList.Panels` child, or a wrapper (an element, `Suspense`, an\n * error boundary) that holds panels and no Tab. A Panel that a component renders itself cannot be\n * seen from the children: put that component inside `TabList.Panels` (a development warning names\n * a Panel that ends up inside the tablist). Content that is not a tab, such as a button next to\n * the tabs, does not belong in a tablist either: render it outside the TabList.\n *\n * Sub-components are also exported under flat names (`TabListTab`, `TabListPanel`,\n * `TabListPanels`) for React Server Components, which cannot use the dotted form.\n */\nexport const TabList = /* @__PURE__ */ Object.assign(TabListRoot, {\n Tab,\n Panel: TabPanel,\n Panels: TabPanels,\n});\n\nexport { Tab as TabListTab, TabPanel as TabListPanel, TabPanels as TabListPanels };\n"],"mappings":"koBAwDA,SAASqC,EAAsB,EAAqB,CAClDb,EAAA,SACE,qBAAqBc,IACrB,0CAA0CA,EAAM,gIAElD,CACF,CAEA,SAASC,GAAkC,CACzC,IAAMC,EAAsD,CAAE,IAAK,IAAI,IAAO,MAAO,IAAI,GAAM,EACzFC,EAAY,IAAI,IAClBC,EAAQ,GACNC,MAAa,CACjBF,EAAU,QAAS,GAAaG,EAAS,CAAC,CAC5C,EACA,MAAO,CACL,SAAS,EAAM,EAAO,EAAI,CACxB,IAAMC,EAAML,EAAQM,GACdC,EAAMF,EAAI,IAAIP,CAAK,GAAK,CAAC,EAM/B,OAHIQ,IAAS,OAASC,EAAI,OAAS,GAAGV,EAAsBC,CAAK,EACjEO,EAAI,IAAIP,EAAO,CAAC,GAAGS,EAAKC,CAAE,CAAC,EAC3BL,EAAK,MACQ,CACX,IAAMI,EAAM,CAAC,GAAIF,EAAI,IAAIP,CAAK,GAAK,CAAC,CAAE,EAChCW,EAAQF,EAAI,QAAQC,CAAE,EACxBC,IAAU,IAAIF,EAAI,OAAOE,EAAO,CAAC,EACjCF,EAAI,OAAS,EAAGF,EAAI,IAAIP,EAAOS,CAAG,EACj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AAAA,wBAAwB,KAAM,iBAAkB4F,CAAS,EACvE,GAAIrC,EAEH,UACE,CAAA,EAEP,EAAU,YAAc,YAyBxB,IAAa4D,EAA0B,OAAO,OAAOrE,EAAa,CAChE,MACA,MAAOD,EACP,OAAQG,CACV,CAAC"}
1
+ {"version":3,"file":"TabList.cjs","names":["React","getElementType","resolveDeprecatedProp","useControllable","useRovingTabIndex","useEventCallback","useId","useMotionClasses","tabIndicatorMotion","usePrefersReducedMotion","getPartId","useMergedRefs","cn","tabListClassNames","composeEventHandlers","forcedColors","slotRendersContent","tabListTabClassNames","disabledStyles","focusRingInset","renderSlot","tabListPanelClassNames","focusRing","tabListPanelsClassNames","require_runtime","require_cn","require_children","require_dev","require_slot","require_composeEventHandlers","require_classNames","require_useEventCallback","require_useControllable","require_useId","require_useRovingTabIndex","require_useMergedRefs","require_usePrefersReducedMotion","require_styles","require_motion","require_useMotion","require_disclosureIds","react","react_jsx_runtime","warnDuplicateTabValue","value","createRegistry","entries","listeners","ready","emit","listener","map","part","ids","id","index","INERT_REGISTRY","TabListContext","INERT_CONTEXT","useTabListContext","component","isUnavailable","ariaDisabled","props","consumerId","collectStructure","node","child","into","type","Tab","TabPanel","TabListRoot","containsPart","TabPanels","rendersAfterTablist","TabListAreaContext","PANEL_IN_TABLIST_MESSAGE","valueProp","defaultValueProp","orientationProp","rest","selectedValue","defaultValue","defaultSelectedValue","orientation","vertical","onTabSelect","selected","setSelected","isControlled","onValueChange","structureKey","children","structure","parsed","derivesSelection","selectTabOnFocus","select","next","isSelected","getTabIndex","tabValue","baseId","registry","isVertical","indicatorMotion","motion","prefersReducedMotion","slidesIndicator","appearance","indicator","setIndicator","tablistRef","lineValueRef","tablist","tabs","valueOf","tab","nextValue","previousValue","previous","from","to","size","frame","context","itemValue","panel","mergedRef","ref","containerProps","panels","keyed","key","className","onKeyDown","onFocus","tabPadding","tabIconOnlyPadding","tabText","tabIndicatorClasses","tabLookClasses","shape","idProp","ctx","lineStart","lineMotion","tabStyle","style","unavailable","hasIcon","icon","iconOnly","ariaLabel","ariaLabelledBy","named","mountedPanelId","panelId","onClick","insideTablist","mountedTabId","tabId","TabList"],"sources":["../../../src/components/layout/TabList.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n tabListClassNames,\n tabListPanelClassNames,\n tabListPanelsClassNames,\n tabListTabClassNames,\n} from '../../lib/classNames';\nimport { flattenChildren, getElementType } from '../../lib/children';\nimport { cn } from '../../lib/cn';\nimport { composeEventHandlers } from '../../lib/composeEventHandlers';\nimport {\n reportMissingContext,\n resolveDeprecatedProp,\n warnDeprecated,\n warnOnce,\n} from '../../lib/dev';\nimport { tabIndicatorMotion } from '../../lib/motion';\nimport { renderSlot, slotRendersContent } from '../../lib/slot';\nimport { disabledStyles, focusRing, focusRingInset, forcedColors } from '../../lib/styles';\nimport type { CoreSize, MotionSlot, Orientation, Slot } from '../../lib/types';\nimport { useControllable } from '../../hooks/useControllable';\nimport { useEventCallback } from '../../hooks/useEventCallback';\nimport { useId } from '../../hooks/useId';\nimport { useMergedRefs } from '../../hooks/useMergedRefs';\nimport { useMotionClasses } from '../../hooks/useMotion';\nimport { usePrefersReducedMotion } from '../../hooks/usePrefersReducedMotion';\nimport { useRovingTabIndex } from '../../hooks/useRovingTabIndex';\nimport { getPartId } from './disclosureIds';\n\n/* ------------------------------------------------------------------ */\n/* Context */\n/* ------------------------------------------------------------------ */\n\ntype TabListPart = 'tab' | 'panel';\n\n/**\n * The ids of the mounted Tabs and Panels by value. A Tab references a panel only while one with\n * its value is mounted (a TabList used as a filter bar has none), and each side references the\n * other's actual id, a consumer `id` included. Read with `useSyncExternalStore`.\n *\n * Before the TabList has mounted (server HTML, hydration and the first client render) the\n * registry is not ready and the static structure of the children stands in for it; once it is\n * ready, it alone decides, so a Panel that is in the element tree but never mounts (inside a\n * wrapper that renders nothing) is not referenced.\n */\ninterface TabListRegistry {\n /** Registers a mounted Tab or Panel; returns the unregister function. */\n register: (part: TabListPart, value: string, id: string) => () => void;\n /**\n * Id of the first mounted Tab or Panel with this value, `null` when none is mounted, or\n * `undefined` while the registry is not ready (use the static structure then).\n */\n get: (part: TabListPart, value: string) => string | null | undefined;\n /** Called by the TabList once it (and so every Tab and Panel mounted with it) has mounted. */\n markReady: () => void;\n subscribe: (listener: () => void) => () => void;\n}\n\n/** Tabs that share a value share one id, and are selected and tab stops together. */\nfunction warnDuplicateTabValue(value: string): void {\n warnOnce(\n `TabList:duplicate:${value}`,\n `TabList: several tabs share the value \"${value}\". Tab values must be unique within a ` +\n 'TabList; tabs with the same value share one id and are selected (and tab stops) together.',\n );\n}\n\nfunction createRegistry(): TabListRegistry {\n const entries: Record<TabListPart, Map<string, string[]>> = { tab: new Map(), panel: new Map() };\n const listeners = new Set<() => void>();\n let ready = false;\n const emit = () => {\n listeners.forEach((listener) => listener());\n };\n return {\n register(part, value, id) {\n const map = entries[part];\n const ids = map.get(value) ?? [];\n // Called from the part's layout effect (C-DEV). Two Panels may share a value (the Tab links\n // to the first mounted one); two Tabs may not.\n if (part === 'tab' && ids.length > 0) warnDuplicateTabValue(value);\n map.set(value, [...ids, id]);\n emit();\n return () => {\n const ids = [...(map.get(value) ?? [])];\n const index = ids.indexOf(id);\n if (index !== -1) ids.splice(index, 1);\n if (ids.length > 0) map.set(value, ids);\n else map.delete(value);\n emit();\n };\n },\n get: (part, value) => (ready ? (entries[part].get(value)?.[0] ?? null) : undefined),\n markReady() {\n if (ready) return;\n ready = true;\n emit();\n },\n subscribe(listener) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n };\n}\n\nconst INERT_REGISTRY: TabListRegistry = {\n register: () => () => {},\n get: () => undefined,\n markReady: () => {},\n subscribe: () => () => {},\n};\n\n/**\n * What the TabList's children show before anything mounts (server HTML and the first render):\n * found in the element tree through Fragments and the `children` of wrapper elements, but not\n * inside a component that renders a Tab or Panel itself (the registry covers those once mounted).\n */\ninterface TabListStructure {\n /** Value of the first Tab without `disabled`/`aria-disabled`: the uncontrolled default. */\n firstEnabled?: string;\n /** Consumer `id`s of Tabs, by value. */\n tabIds: Array<[string, string]>;\n /** Values of the Panels, each with its consumer `id` or `null`. */\n panels: Array<[string, string | null]>;\n}\n\n/** The look of a TabList: an underline, subtle fills, or circular subtle or filled tabs. */\nexport type TabListAppearance = 'transparent' | 'subtle' | 'subtle-circular' | 'filled-circular';\n\n/**\n * Where the selected tab's line starts its slide (FLIP), measured in physical pixels from the tab\n * selected before: its offset along the list's axis and its size as a ratio of the new tab's.\n */\ninterface TabIndicatorStart {\n /** The value of the tab that draws the line. */\n value: string;\n /** The previous tab's left (top when vertical) minus the new tab's, in pixels. */\n offset: number;\n /** The previous tab's width (height when vertical) divided by the new tab's. */\n scale: number;\n}\n\ninterface TabListContextValue {\n orientation: Orientation;\n appearance: TabListAppearance;\n size: CoreSize;\n /** Whether the tab with this value is the selected one (explicit value, else the tab stop). */\n isSelected: (value: string) => boolean;\n /**\n * Activates a tab: a click (Enter and Space click the tab button), or with automatic activation\n * focus moved by the keys.\n */\n select: (value: string) => void;\n getTabIndex: (value: string) => 0 | -1;\n /** The generated id of a Tab or Panel (used when it has no consumer `id`). */\n getGeneratedId: (part: TabListPart, value: string) => string;\n /**\n * Id of the Tab with this value before the TabList mounts: its consumer `id`, else the\n * generated one.\n */\n getStaticTabId: (value: string) => string;\n /**\n * Id of the Panel with this value before the TabList mounts, or `undefined` when the children\n * have none.\n */\n getStaticPanelId: (value: string) => string | undefined;\n registry: TabListRegistry;\n /**\n * The line's start for the one frame after the selection moved, rendered by the tab with its\n * value as custom properties (without `indicatorMotion`); `null` otherwise.\n */\n indicator: TabIndicatorStart | null;\n /** The motion classes of the selected tab's line (`''`: none). */\n indicatorMotion: string;\n}\n\nconst TabListContext = React.createContext<TabListContextValue | null>(null);\n\nconst INERT_CONTEXT: TabListContextValue = {\n orientation: 'horizontal',\n appearance: 'transparent',\n size: 'medium',\n isSelected: () => false,\n select: () => {},\n getTabIndex: () => -1,\n getGeneratedId: (part, value) => `wave-tablist-inert-${part}-${value}`,\n getStaticTabId: (value) => `wave-tablist-inert-tab-${value}`,\n getStaticPanelId: () => undefined,\n registry: INERT_REGISTRY,\n indicator: null,\n indicatorMotion: '',\n};\n\n/** C-CONTEXT: throws in development, logs once and returns an inert value in production. */\nfunction useTabListContext(component: string): TabListContextValue {\n const context = React.useContext(TabListContext);\n if (context) return context;\n reportMissingContext(component, '<TabList>');\n return INERT_CONTEXT;\n}\n\ninterface StructureProps {\n value?: unknown;\n id?: unknown;\n disabled?: unknown;\n 'aria-disabled'?: unknown;\n children?: unknown;\n}\n\n/** Whether a Tab's props make it unavailable (it cannot be selected and is skipped by keys). */\nfunction isUnavailable(props: StructureProps): boolean {\n const ariaDisabled = props['aria-disabled'];\n return props.disabled === true || ariaDisabled === true || ariaDisabled === 'true';\n}\n\n/** A consumer `id` that replaces the generated one: a non-empty string (`''` counts as none). */\nfunction consumerId(id: unknown): string | null {\n return typeof id === 'string' && id !== '' ? id : null;\n}\n\n/**\n * Walks the element tree of the TabList's children (see {@link TabListStructure}). Parts are\n * identified through their element type, so parts written in a Server Component (lazy\n * references) count too. A `React.lazy` still loading (inside the consumer's own `<Suspense>`,\n * such as code-split panels in `TabList.Panels`) is no part and never suspends the TabList: its\n * children are walked instead. Runs during render only.\n */\nfunction collectStructure(node: unknown, into: TabListStructure): TabListStructure {\n if (Array.isArray(node)) {\n node.forEach((child) => collectStructure(child, into));\n return into;\n }\n if (!React.isValidElement<StructureProps>(node)) return into;\n const { props } = node;\n const type = getElementType(node, { suspend: false });\n const value = typeof props.value === 'string' ? props.value : undefined;\n if (type === Tab) {\n if (value !== undefined) {\n if (into.firstEnabled === undefined && !isUnavailable(props)) into.firstEnabled = value;\n const id = consumerId(props.id);\n if (id !== null) into.tabIds.push([value, id]);\n }\n return into;\n }\n if (type === TabPanel) {\n if (value !== undefined) into.panels.push([value, consumerId(props.id)]);\n return into;\n }\n if (type === TabListRoot) return into;\n return collectStructure(props.children, into);\n}\n\n/**\n * Whether an element tree shows a Tab, or a Panel (`TabList.Panel` or `TabList.Panels`), found as\n * in {@link collectStructure}: through Fragments and the `children` of wrapper elements, not inside\n * a nested TabList or a component that renders the part itself.\n */\nfunction containsPart(node: unknown, part: TabListPart): boolean {\n if (Array.isArray(node)) return node.some((child) => containsPart(child, part));\n if (!React.isValidElement<StructureProps>(node)) return false;\n const type = getElementType(node, { suspend: false });\n if (type === Tab) return part === 'tab';\n if (type === TabPanel || type === TabPanels) return part === 'panel';\n if (type === TabListRoot) return false;\n return containsPart(node.props.children, part);\n}\n\n/**\n * Whether a child of the TabList renders after the tablist: a Panel, `TabList.Panels`, or a\n * wrapper (an element, `Suspense`, an error boundary) that holds panels and no tab.\n */\nfunction rendersAfterTablist(child: React.ReactNode): boolean {\n return containsPart(child, 'panel') && !containsPart(child, 'tab');\n}\n\n/**\n * Where the TabList renders its children: inside the `role=\"tablist\"` element (`'tabs'`) or after\n * it (`'panels'`). A Panel that ends up inside the tablist warns in development.\n */\nconst TabListAreaContext = React.createContext<'tabs' | 'panels' | null>(null);\n\nconst PANEL_IN_TABLIST_MESSAGE =\n 'TabList.Panel was rendered inside the role=\"tablist\" element, where only tabs belong (axe ' +\n 'aria-required-children). The TabList moves a Panel after the tablist when it is its child, or ' +\n 'in a wrapper that holds no Tab, but it cannot see a Panel that a component renders itself, or ' +\n \"separate a wrapper's Panels from its Tabs. Place such panels inside TabList.Panels, which \" +\n 'renders after the tablist.';\n\n/* ------------------------------------------------------------------ */\n/* TabList */\n/* ------------------------------------------------------------------ */\n\n/** Properties for the TabList component. */\nexport interface TabListProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'defaultValue'> {\n /**\n * Controlled value of the selected tab (`''`: no tab selected). A controlled value that becomes\n * `undefined` also selects no tab: the TabList stays controlled.\n */\n value?: string;\n /**\n * Selected tab for uncontrolled usage. When it is omitted (or `''`), the first enabled tab\n * written in the TabList's children is selected, from the first render (and in server-rendered\n * HTML) on. Tabs written directly in the children, in Fragments or in wrapper elements that\n * pass them as `children` (such as a Tooltip) count; a tab rendered by a custom component that\n * renders `TabList.Tab` itself does not, even when it comes first in the DOM, so that server\n * and client pick the same tab. When every tab comes from such a component, the first enabled\n * tab in the DOM is selected once the tabs mount. To select a tab that a custom component\n * renders, pass `defaultValue`.\n */\n defaultValue?: string;\n /** Called with the new value when the selected tab changes (not when it is activated again). */\n onValueChange?: (value: string) => void;\n /**\n * Layout and arrow-key axis: `'horizontal'` (Left/Right, mirrored in RTL) or `'vertical'`\n * (Up/Down).\n * @default 'horizontal'\n */\n orientation?: Orientation;\n /**\n * Look of the tabs: `transparent` underlines the selected tab, `subtle` and `subtle-circular`\n * fill it with a subtle color (square or fully rounded), `filled-circular` fills it with the\n * primary color. In forced colors the selected tab keeps a Highlight outline (or underline) in\n * every appearance.\n * @default 'transparent'\n */\n appearance?: TabListAppearance;\n /**\n * Size of the tabs: their padding and type (`medium` is 14px text on 16 by 8px padding).\n * @default 'medium'\n */\n size?: CoreSize;\n /**\n * Whether moving focus with the arrow keys, Home and End also selects the tab (automatic\n * activation, as in 0.5). With `false`, the keys only move focus and Enter, Space or a click\n * selects the focused tab (manual activation, for panels that are slow to show). Fluent's\n * default is `false`.\n * @default true\n */\n selectTabOnFocus?: boolean;\n /**\n * Replaces the slide of the selected tab's line in the `transparent` appearance (the other\n * appearances have no line and do not move): by default, when the selection moves, the line\n * slides and stretches from the tab selected before to the new one, over the slow duration\n * (300 ms) with the max decelerating curve. The classes go on the selected tab and time its\n * line, the tab's after pseudo-element (write them with the after variant, and a reduced-motion\n * counterpart); the line starts from the previous tab through two custom properties the\n * TabList writes for one frame. `null` turns the slide off (the line moves at once); a class\n * string or `{ className }` replaces the classes with plain transition classes for the line, as\n * above (it has no presence phases). A\n * `WaveProvider` with `motion=\"none\"` turns the default off, and a value here still applies\n * under it. The line also moves at once while the user prefers reduced motion. Fluent's\n * TabList slides its indicator with no prop to turn it off: this prop is a WaveUI addition.\n * @default the slide described above\n */\n motion?: MotionSlot | null;\n /** @deprecated Use `value`. */\n selectedValue?: string;\n /** @deprecated Use `defaultValue`. */\n defaultSelectedValue?: string;\n /**\n * @deprecated Use `onValueChange`. Unlike `onValueChange`, it is called on every activation,\n * including a click on the tab that is already selected.\n */\n onTabSelect?: (value: string) => void;\n /** @deprecated Use `orientation=\"vertical\"`. */\n vertical?: boolean;\n /** Ref to the `role=\"tablist\"` element. */\n ref?: React.Ref<HTMLDivElement>;\n}\n\nconst TabListRoot = ({\n value: valueProp,\n defaultValue: defaultValueProp,\n onValueChange,\n orientation: orientationProp,\n appearance = 'transparent',\n size = 'medium',\n selectTabOnFocus = true,\n motion,\n selectedValue,\n defaultSelectedValue,\n onTabSelect,\n vertical,\n className,\n children,\n onKeyDown,\n onFocus,\n ref,\n ...rest\n}: TabListProps) => {\n const value = resolveDeprecatedProp(\n 'TabList',\n valueProp,\n selectedValue,\n 'selectedValue',\n 'value',\n );\n const defaultValue = resolveDeprecatedProp(\n 'TabList',\n defaultValueProp,\n defaultSelectedValue,\n 'defaultSelectedValue',\n 'defaultValue',\n );\n const orientation =\n resolveDeprecatedProp<Orientation>(\n 'TabList',\n orientationProp,\n vertical === undefined ? undefined : vertical ? 'vertical' : 'horizontal',\n 'vertical',\n 'orientation',\n ) ?? 'horizontal';\n if (onTabSelect) {\n warnDeprecated(\n 'TabList',\n 'onTabSelect',\n 'onValueChange',\n '`onValueChange` is called only when the selected tab changes.',\n );\n }\n\n // The sticky mode: a controlled value that becomes `undefined` clears the selection (`''`).\n const [selected, setSelected, isControlled] = useControllable(\n value,\n defaultValue ?? '',\n onValueChange,\n );\n\n // The children are a new element tree on every parent render: memoized by content, so the\n // context value stays stable while the tabs and panels stay the same.\n const structureKey = JSON.stringify(collectStructure(children, { tabIds: [], panels: [] }));\n const structure = React.useMemo(() => {\n const parsed = JSON.parse(structureKey) as TabListStructure;\n return {\n firstEnabled: parsed.firstEnabled,\n tabIds: new Map(parsed.tabIds),\n panels: new Map(parsed.panels),\n };\n }, [structureKey]);\n\n // Uncontrolled without a selection: the first enabled tab is selected. It is the tab stop the\n // roving store resolves from `activeValue` (the first enabled tab of the children, replaced by\n // the first enabled tab in the DOM once the store sees it disabled), so the selection is\n // derived during render, present from the first render on, and follows tabs that disable\n // themselves.\n const derivesSelection = !isControlled && selected === '';\n\n const { containerProps, getTabIndex } = useRovingTabIndex({\n activeValue: derivesSelection ? (structure.firstEnabled ?? null) : selected,\n orientation,\n loop: true,\n // Automatic activation (APG Tabs): moving focus selects the tab. With manual activation the\n // keys only move focus; the tab stop stays on the selected tab (`tabStop: 'active'`), and Enter\n // or Space selects the focused tab through its native click.\n onFocusMove: selectTabOnFocus ? (next) => select(next) : undefined,\n });\n\n const isSelected = React.useCallback(\n (tabValue: string) => (derivesSelection ? getTabIndex(tabValue) === 0 : selected === tabValue),\n [derivesSelection, getTabIndex, selected],\n );\n\n const select = useEventCallback((next: string) => {\n onTabSelect?.(next);\n if (!isSelected(next)) setSelected(next);\n });\n\n const baseId = useId('tablist');\n const [registry] = React.useState(createRegistry);\n // Runs after the layout effects of the Tabs and Panels mounted with the TabList, which have\n // registered by then: from here on the registry, not the static structure, decides the links.\n React.useLayoutEffect(() => registry.markReady(), [registry]);\n\n const isVertical = orientation === 'vertical';\n const indicatorMotion = useMotionClasses(motion, tabIndicatorMotion);\n const prefersReducedMotion = usePrefersReducedMotion();\n // Only the underline look has a line, and only a motion slides it (spec §9.2).\n const slidesIndicator =\n appearance === 'transparent' && indicatorMotion !== '' && !prefersReducedMotion;\n const [indicator, setIndicator] = React.useState<TabIndicatorStart | null>(null);\n const tablistRef = React.useRef<HTMLDivElement>(null);\n // The value of the tab that drew the line after the last selection change seen, `null` before\n // the first one is seen (nothing slides on mount).\n const lineValueRef = React.useRef<string | null>(null);\n\n // The FLIP of the line (spec §9.2, Ruling R12), keyed on the selection (`isSelected` changes\n // with it, the derived default included): once the newly selected tab is in the DOM, both tabs\n // are measured (physical pixels, so right-to-left needs nothing of its own) and the new tab\n // starts its line over the previous one for one frame. Tabs are matched by their value as a\n // string, never through a selector built from it.\n React.useLayoutEffect(() => {\n const tablist = tablistRef.current;\n if (!tablist) return;\n const tabs = Array.from(tablist.querySelectorAll<HTMLElement>('[role=\"tab\"]'));\n const valueOf = (tab: HTMLElement) => tab.getAttribute('data-roving-value');\n const next = tabs.find((tab) => {\n const tabValue = valueOf(tab);\n return tabValue !== null && isSelected(tabValue);\n });\n const nextValue = next ? valueOf(next) : null;\n const previousValue = lineValueRef.current;\n lineValueRef.current = nextValue;\n if (!slidesIndicator || !next || nextValue === null || previousValue === null) return;\n if (nextValue === previousValue) return;\n const previous = tabs.find((tab) => valueOf(tab) === previousValue);\n if (!previous) return;\n const from = previous.getBoundingClientRect();\n const to = next.getBoundingClientRect();\n const size = isVertical ? to.height : to.width;\n if (size === 0) return;\n setIndicator({\n value: nextValue,\n offset: isVertical ? from.top - to.top : from.left - to.left,\n scale: (isVertical ? from.height : from.width) / size,\n });\n }, [isSelected, slidesIndicator, isVertical]);\n\n // The start is painted for one frame, then cleared (C-HOOKS deferred update): the next commit\n // drops the properties and adds the motion, so the line glides back to its own tab. A newer\n // start, or an unmount, cancels the frame of the one before.\n React.useEffect(() => {\n if (!indicator) return;\n const frame = requestAnimationFrame(() => setIndicator(null));\n return () => cancelAnimationFrame(frame);\n }, [indicator]);\n\n const context = React.useMemo<TabListContextValue>(\n () => ({\n orientation,\n appearance,\n size,\n isSelected,\n select,\n getTabIndex,\n getGeneratedId: (part, itemValue) => getPartId(baseId, part, itemValue),\n getStaticTabId: (tabValue) =>\n structure.tabIds.get(tabValue) ?? getPartId(baseId, 'tab', tabValue),\n getStaticPanelId: (tabValue) => {\n const panel = structure.panels.get(tabValue);\n if (panel === undefined) return undefined;\n return panel ?? getPartId(baseId, 'panel', tabValue);\n },\n registry,\n indicator,\n indicatorMotion,\n }),\n [\n orientation,\n appearance,\n size,\n isSelected,\n select,\n getTabIndex,\n baseId,\n structure,\n registry,\n indicator,\n indicatorMotion,\n ],\n );\n\n const mergedRef = useMergedRefs<HTMLDivElement>(ref, containerProps.ref, tablistRef);\n\n const tabs: React.ReactNode[] = [];\n const panels: React.ReactNode[] = [];\n flattenChildren(children).forEach(({ key, node: child }) => {\n const keyed = <React.Fragment key={key}>{child}</React.Fragment>;\n (rendersAfterTablist(child) ? panels : tabs).push(keyed);\n });\n\n return (\n <TabListContext.Provider value={context}>\n <div className={cn(isVertical && 'flex')}>\n <div\n role=\"tablist\"\n aria-orientation={orientation}\n data-appearance={appearance}\n data-size={size}\n data-orientation={orientation}\n className={cn(\n tabListClassNames.root,\n isVertical ? 'flex w-40 flex-col' : 'flex',\n appearance === 'transparent'\n ? isVertical\n ? 'border-e border-border'\n : 'border-b border-border'\n : 'gap-1',\n className,\n )}\n {...rest}\n data-roving-container=\"\"\n onKeyDown={composeEventHandlers(onKeyDown, containerProps.onKeyDown)}\n onFocus={composeEventHandlers(onFocus, containerProps.onFocus, {\n checkDefaultPrevented: false,\n })}\n ref={mergedRef}\n >\n <TabListAreaContext.Provider value=\"tabs\">{tabs}</TabListAreaContext.Provider>\n </div>\n <TabListAreaContext.Provider value=\"panels\">{panels}</TabListAreaContext.Provider>\n </div>\n </TabListContext.Provider>\n );\n};\nTabListRoot.displayName = 'TabList';\n\n/* ------------------------------------------------------------------ */\n/* TabList.Tab */\n/* ------------------------------------------------------------------ */\n\n/** Padding of a tab with text, per size. Literal strings only. */\nconst tabPadding: Readonly<Record<CoreSize, string>> = {\n small: 'px-3 py-1.5',\n medium: 'px-4 py-2',\n large: 'px-5 py-3',\n};\n\n/** Padding of an icon-only tab (a square hit area), per size. */\nconst tabIconOnlyPadding: Readonly<Record<CoreSize, string>> = {\n small: 'p-1.5',\n medium: 'p-2',\n large: 'p-3',\n};\n\n/** Type step of a tab, per size. */\nconst tabText: Readonly<Record<CoreSize, string>> = {\n small: 'text-caption-1',\n medium: 'text-body-1',\n large: 'text-body-2',\n};\n\n/**\n * The line of the selected tab with the underline look, per orientation. A transparent 2px border\n * on the tab's edge keeps the tab's box, and the after pseudo-element draws the line exactly over\n * it, as a border, so forced colors keep it (in Highlight). The line's translate and scale read\n * the two custom properties of its FLIP start, so it begins over the tab selected before for one\n * frame. Literal strings only.\n */\nconst tabIndicatorClasses: Readonly<Record<Orientation, string>> = {\n horizontal:\n 'relative border-b-2 border-b-transparent after:absolute after:inset-x-0 after:-bottom-0.5 after:border-b-2 after:border-b-primary after:origin-left after:translate-x-[var(--wave-tab-indicator-offset,0px)] after:scale-x-[var(--wave-tab-indicator-scale,1)] forced-colors:after:border-[Highlight]', // wave-allow-physical: the FLIP offset is measured in physical pixels\n vertical:\n 'relative border-s-2 border-s-transparent after:absolute after:inset-y-0 after:-start-0.5 after:border-s-2 after:border-s-primary after:origin-top after:translate-y-[var(--wave-tab-indicator-offset,0px)] after:scale-y-[var(--wave-tab-indicator-scale,1)] forced-colors:after:border-[Highlight]', // wave-allow-physical: the FLIP offset is measured in physical pixels\n};\n\n/**\n * The colors, fill and selected indicator of a tab per appearance. Literal strings only; hover and\n * pressed use the gated rules (a disabled tab keeps its look). In forced colors fills are dropped,\n * so every selected tab keeps a Highlight outline (or, for the underline, a Highlight line).\n */\nfunction tabLookClasses(\n appearance: TabListAppearance,\n selected: boolean,\n vertical: boolean,\n): string {\n switch (appearance) {\n case 'subtle':\n case 'subtle-circular': {\n const shape = appearance === 'subtle' ? 'rounded-md' : 'rounded-full';\n return selected\n ? cn(shape, 'bg-subtle-selected text-foreground', forcedColors.selectedContainer)\n : cn(\n shape,\n 'text-muted-foreground not-disabled:not-aria-disabled:hover:bg-subtle-hover not-disabled:not-aria-disabled:hover:text-foreground not-disabled:not-aria-disabled:active:bg-subtle-pressed',\n );\n }\n case 'filled-circular':\n return selected\n ? cn(\n 'rounded-full bg-primary text-primary-foreground not-disabled:not-aria-disabled:hover:bg-primary-hover not-disabled:not-aria-disabled:active:bg-primary-pressed',\n forcedColors.selectedContainer,\n )\n : 'rounded-full bg-muted text-muted-foreground not-disabled:not-aria-disabled:hover:bg-muted-hover not-disabled:not-aria-disabled:hover:text-foreground not-disabled:not-aria-disabled:active:bg-muted-pressed';\n default:\n // Every tab's own border has one color whether selected or not (forced colors would turn a\n // transparent one into the text color, but keep a system color): the tab's color transition\n // covers its border, so a color that changed with the selection would fade a second line in\n // under the new tab while its line slides there.\n return cn(\n 'border-transparent forced-colors:border-[Canvas]',\n selected\n ? cn('text-primary', tabIndicatorClasses[vertical ? 'vertical' : 'horizontal'])\n : 'text-muted-foreground not-disabled:not-aria-disabled:hover:text-foreground',\n );\n }\n}\n\n/** Properties for the Tab sub-component. */\nexport interface TabProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /** Unique value identifying this tab (and its panel). */\n value: string;\n /**\n * An icon before the text, hidden from assistive technology. A tab with an icon and no text is\n * icon-only (a square hit area): name it with `aria-label`, or a development warning asks for it.\n */\n icon?: Slot<'span'>;\n /** Ref to the tab `<button>`. */\n ref?: React.Ref<HTMLButtonElement>;\n}\n\n/**\n * A tab button. `onClick` runs before the selection (call `event.preventDefault()` to keep the\n * current tab). A `disabled` (or `aria-disabled=\"true\"`) tab is skipped by the keyboard and cannot\n * be selected. A non-empty `id` replaces the generated one (its panel's `aria-labelledby` follows\n * it). The selected tab references its panel with `aria-controls` only while a `TabList.Panel`\n * with its value is mounted.\n */\nconst Tab = ({\n value,\n id: idProp,\n icon,\n className,\n style,\n children,\n onClick,\n ref,\n ...rest\n}: TabProps) => {\n const ctx = useTabListContext('TabList.Tab');\n const selected = ctx.isSelected(value);\n const isVertical = ctx.orientation === 'vertical';\n // The selected tab's line: over the tab selected before for one frame after the selection moved\n // (its FLIP start, without the motion), then on this tab with the motion, so it slides back.\n const lineStart = selected && ctx.indicator?.value === value ? ctx.indicator : null;\n const lineMotion =\n selected && ctx.appearance === 'transparent' && !lineStart ? ctx.indicatorMotion : undefined;\n const tabStyle = lineStart\n ? ({\n ...style,\n '--wave-tab-indicator-offset': `${lineStart.offset}px`,\n '--wave-tab-indicator-scale': String(lineStart.scale),\n } as React.CSSProperties)\n : style;\n const unavailable = isUnavailable(rest);\n const hasIcon = !!icon && slotRendersContent(icon);\n const iconOnly = hasIcon && !slotRendersContent(children);\n const ariaLabel = rest['aria-label'];\n const ariaLabelledBy = rest['aria-labelledby'];\n const named =\n (typeof ariaLabel === 'string' && ariaLabel.trim() !== '') ||\n (typeof ariaLabelledBy === 'string' && ariaLabelledBy.trim() !== '');\n React.useEffect(() => {\n if (iconOnly && !named) {\n warnOnce(\n 'TabList.Tab:icon-only-name',\n 'TabList.Tab: a tab with an icon and no text has no accessible name. Pass `aria-label` (or `aria-labelledby`).',\n );\n }\n }, [iconOnly, named]);\n\n const { registry } = ctx;\n const id = consumerId(idProp) ?? ctx.getGeneratedId('tab', value);\n React.useLayoutEffect(() => registry.register('tab', value, id), [registry, value, id]);\n const mountedPanelId = React.useSyncExternalStore(\n registry.subscribe,\n () => registry.get('panel', value),\n () => undefined,\n );\n // Before the TabList mounts the static structure stands in; after that only a mounted panel is\n // referenced (`null`: none).\n const panelId =\n mountedPanelId === undefined ? ctx.getStaticPanelId(value) : (mountedPanelId ?? undefined);\n\n return (\n <button\n type=\"button\"\n role=\"tab\"\n className={cn(\n tabListTabClassNames.root,\n 'font-semibold transition-colors motion-reduce:transition-none',\n iconOnly ? tabIconOnlyPadding[ctx.size] : tabPadding[ctx.size],\n tabText[ctx.size],\n hasIcon && 'inline-flex items-center justify-center gap-2',\n isVertical && 'text-start',\n tabLookClasses(ctx.appearance, selected, isVertical),\n disabledStyles,\n focusRingInset,\n lineMotion,\n className,\n )}\n style={tabStyle}\n {...rest}\n id={id}\n aria-selected={selected}\n aria-controls={selected ? panelId : undefined}\n tabIndex={ctx.getTabIndex(value)}\n data-roving-value={value}\n data-selected={selected ? '' : undefined}\n data-icon-only={iconOnly ? '' : undefined}\n onClick={composeEventHandlers(onClick, () => {\n if (!unavailable) ctx.select(value);\n })}\n ref={ref}\n >\n {hasIcon && renderSlot(icon, 'span', tabListTabClassNames.icon, { 'aria-hidden': true })}\n {children}\n </button>\n );\n};\nTab.displayName = 'Tab';\n\n/* ------------------------------------------------------------------ */\n/* TabList.Panel */\n/* ------------------------------------------------------------------ */\n\n/** Properties for the TabPanel sub-component. */\nexport interface TabPanelProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Value of the Tab that shows this panel. */\n value: string;\n /** Ref to the `role=\"tabpanel\"` element. */\n ref?: React.Ref<HTMLDivElement>;\n}\n\n/**\n * The content of one tab, rendered only while its tab is selected and labelled by it (while a Tab\n * with its value is mounted). A non-empty `id` replaces the generated one (the tab's\n * `aria-controls` follows it).\n */\nconst TabPanel = ({ value, id: idProp, children, className, ref, ...rest }: TabPanelProps) => {\n const ctx = useTabListContext('TabList.Panel');\n const insideTablist = React.useContext(TabListAreaContext) === 'tabs';\n React.useEffect(() => {\n if (insideTablist) warnOnce('TabList.Panel:inside-tablist', PANEL_IN_TABLIST_MESSAGE);\n }, [insideTablist]);\n const { registry } = ctx;\n const id = consumerId(idProp) ?? ctx.getGeneratedId('panel', value);\n // Registered while mounted, also while hidden: the tab that selects it links to it.\n React.useLayoutEffect(() => registry.register('panel', value, id), [registry, value, id]);\n const mountedTabId = React.useSyncExternalStore(\n registry.subscribe,\n () => registry.get('tab', value),\n () => undefined,\n );\n if (!ctx.isSelected(value)) return null;\n // As for the Tab's aria-controls: the static structure only before the TabList mounts.\n const tabId =\n mountedTabId === undefined ? ctx.getStaticTabId(value) : (mountedTabId ?? undefined);\n return (\n <div\n role=\"tabpanel\"\n tabIndex={0}\n className={cn(tabListPanelClassNames.root, 'p-4', focusRing, className)}\n {...rest}\n id={id}\n aria-labelledby={tabId}\n ref={ref}\n >\n {children}\n </div>\n );\n};\nTabPanel.displayName = 'TabPanel';\n\n/* ------------------------------------------------------------------ */\n/* TabList.Panels */\n/* ------------------------------------------------------------------ */\n\n/** Properties for the TabPanels sub-component. */\nexport interface TabPanelsProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Ref to the container `<div>`. */\n ref?: React.Ref<HTMLDivElement>;\n}\n\n/**\n * Optional container for the panels, rendered after the tablist. Use it to style the panel area,\n * and for panels that components render themselves: the TabList finds a Panel in its children, in\n * a Fragment or in a wrapper that holds no Tab, but a component that renders a Panel itself\n * renders inside the tablist unless it is placed in `TabList.Panels`.\n */\nconst TabPanels = ({ className, children, ref, ...rest }: TabPanelsProps) => (\n <div\n ref={ref}\n className={cn(tabListPanelsClassNames.root, 'min-w-0 flex-1', className)}\n {...rest}\n >\n {children}\n </div>\n);\nTabPanels.displayName = 'TabPanels';\n\n/* ------------------------------------------------------------------ */\n/* Export */\n/* ------------------------------------------------------------------ */\n\n/**\n * A set of tabs with their panels (WAI-ARIA Tabs pattern): the arrow keys (Left/Right, mirrored\n * in RTL; Up/Down when vertical), Home and End move focus and select (automatic activation); with\n * `selectTabOnFocus={false}` they only move focus, and Enter, Space or a click selects the focused\n * tab (manual activation). The selected tab is the only tab stop; disabled tabs are skipped. Every\n * tab needs a `value` that is unique within the TabList (a development warning names a value that\n * several tabs share).\n *\n * Tabs register through context and are found in DOM order, so they may be wrapped (a Fragment,\n * a Tooltip). The children render inside the `role=\"tablist\"` element, except panels, which render\n * after it: a `TabList.Panel` or `TabList.Panels` child, or a wrapper (an element, `Suspense`, an\n * error boundary) that holds panels and no Tab. A Panel that a component renders itself cannot be\n * seen from the children: put that component inside `TabList.Panels` (a development warning names\n * a Panel that ends up inside the tablist). Content that is not a tab, such as a button next to\n * the tabs, does not belong in a tablist either: render it outside the TabList.\n *\n * In the `transparent` appearance the selected tab draws its line with its after pseudo-element,\n * over a transparent 2px border on its bottom edge (its start edge when vertical), so the tab keeps\n * the box it has without the line; a class that recolours the line targets that pseudo-element's\n * border. When the selection moves, the line slides from the tab selected before (`motion`).\n *\n * Sub-components are also exported under flat names (`TabListTab`, `TabListPanel`,\n * `TabListPanels`) for React Server Components, which cannot use the dotted form.\n */\nexport const TabList = /* @__PURE__ */ Object.assign(TabListRoot, {\n Tab,\n Panel: TabPanel,\n Panels: TabPanels,\n});\n\nexport { Tab as T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