@primer/react 0.0.0-20260428150519 → 0.0.0-20260428192448

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 (371) hide show
  1. package/CHANGELOG.md +15 -3
  2. package/dist/ActionBar/ActionBar-3f7b52a3.css +2 -0
  3. package/dist/ActionBar/ActionBar-3f7b52a3.css.map +1 -0
  4. package/dist/ActionBar/ActionBar.d.ts +1 -1
  5. package/dist/ActionBar/ActionBar.d.ts.map +1 -1
  6. package/dist/ActionBar/ActionBar.js +630 -514
  7. package/dist/ActionBar/ActionBar.module.css.js +5 -10
  8. package/dist/ActionBar/index.d.ts +1 -1
  9. package/dist/ActionBar/index.js +8 -8
  10. package/dist/ActionList/{ActionList-53389912.css → ActionList-09f5c4a8.css} +2 -2
  11. package/dist/ActionList/ActionList-09f5c4a8.css.map +1 -0
  12. package/dist/ActionList/ActionList.module.css.js +5 -31
  13. package/dist/ActionList/ActionListContainerContext.js +5 -4
  14. package/dist/ActionList/Description.js +133 -117
  15. package/dist/ActionList/Divider.js +38 -31
  16. package/dist/ActionList/Group.js +349 -292
  17. package/dist/ActionList/Group.module.css.js +5 -10
  18. package/dist/ActionList/Heading.js +106 -88
  19. package/dist/ActionList/Heading.module.css.js +5 -5
  20. package/dist/ActionList/Item.js +811 -668
  21. package/dist/ActionList/LinkItem.js +56 -36
  22. package/dist/ActionList/List.js +210 -168
  23. package/dist/ActionList/Selection.d.ts +2 -3
  24. package/dist/ActionList/Selection.d.ts.map +1 -1
  25. package/dist/ActionList/Selection.js +112 -83
  26. package/dist/ActionList/TrailingAction.js +112 -97
  27. package/dist/ActionList/Visuals.js +191 -143
  28. package/dist/ActionList/index.d.ts +7 -0
  29. package/dist/ActionList/index.d.ts.map +1 -1
  30. package/dist/ActionList/index.js +38 -33
  31. package/dist/ActionList/shared.js +9 -5
  32. package/dist/ActionMenu/ActionMenu.js +310 -223
  33. package/dist/ActionMenu/ActionMenu.module.css.js +5 -5
  34. package/dist/AnchoredOverlay/AnchoredOverlay.js +280 -206
  35. package/dist/AnchoredOverlay/AnchoredOverlay.module.css.js +5 -9
  36. package/dist/Autocomplete/Autocomplete.js +141 -125
  37. package/dist/Autocomplete/AutocompleteContext.js +20 -18
  38. package/dist/Autocomplete/AutocompleteInput.js +146 -108
  39. package/dist/Autocomplete/AutocompleteMenu.js +238 -201
  40. package/dist/Autocomplete/AutocompleteMenu.module.css.js +5 -8
  41. package/dist/Autocomplete/AutocompleteOverlay.js +79 -54
  42. package/dist/Autocomplete/AutocompleteOverlay.module.css.js +5 -5
  43. package/dist/Avatar/Avatar.js +133 -106
  44. package/dist/Avatar/Avatar.module.css.js +5 -5
  45. package/dist/AvatarStack/AvatarStack.js +143 -102
  46. package/dist/AvatarStack/AvatarStack.module.css.js +5 -9
  47. package/dist/Banner/Banner.js +186 -133
  48. package/dist/Banner/Banner.module.css.js +5 -14
  49. package/dist/Banner/index.js +7 -7
  50. package/dist/BaseStyles.js +91 -74
  51. package/dist/BaseStyles.module.css.js +5 -5
  52. package/dist/Blankslate/Blankslate.js +328 -266
  53. package/dist/Blankslate/Blankslate.module.css.js +5 -12
  54. package/dist/Blankslate/BlankslateContext.js +9 -7
  55. package/dist/Blankslate/index.js +9 -9
  56. package/dist/BranchName/BranchName.js +59 -49
  57. package/dist/BranchName/BranchName.module.css.js +5 -5
  58. package/dist/Breadcrumbs/Breadcrumbs.js +431 -371
  59. package/dist/Breadcrumbs/Breadcrumbs.module.css.js +5 -15
  60. package/dist/Button/Button.js +18 -15
  61. package/dist/Button/ButtonBase.js +139 -76
  62. package/dist/Button/ButtonBase.module.css.js +5 -16
  63. package/dist/Button/IconButton.js +74 -42
  64. package/dist/Button/LinkButton.js +17 -13
  65. package/dist/ButtonGroup/ButtonGroup.js +97 -80
  66. package/dist/ButtonGroup/ButtonGroup.module.css.js +5 -5
  67. package/dist/Card/Card.js +491 -401
  68. package/dist/Card/Card.module.css.js +5 -18
  69. package/dist/Card/index.js +9 -9
  70. package/dist/Checkbox/Checkbox.d.ts.map +1 -1
  71. package/dist/Checkbox/Checkbox.js +75 -52
  72. package/dist/Checkbox/Checkbox.module.css.js +5 -9
  73. package/dist/Checkbox/shared.module.css.js +5 -5
  74. package/dist/CheckboxGroup/CheckboxGroup.js +132 -111
  75. package/dist/CheckboxGroup/CheckboxGroupContext.js +4 -4
  76. package/dist/CircleBadge/CircleBadge.js +90 -77
  77. package/dist/CircleBadge/CircleBadge.module.css.js +5 -8
  78. package/dist/ConfirmationDialog/ConfirmationDialog.js +92 -68
  79. package/dist/CounterLabel/CounterLabel.js +99 -83
  80. package/dist/CounterLabel/CounterLabel.module.css.js +5 -5
  81. package/dist/DataTable/DataTable.js +140 -100
  82. package/dist/DataTable/ErrorDialog.js +45 -33
  83. package/dist/DataTable/Pagination.js +592 -464
  84. package/dist/DataTable/Pagination.module.css.js +5 -13
  85. package/dist/DataTable/Table.js +710 -527
  86. package/dist/DataTable/Table.module.css.js +5 -26
  87. package/dist/DataTable/column.js +11 -10
  88. package/dist/DataTable/index.js +20 -22
  89. package/dist/DataTable/sorting.js +103 -65
  90. package/dist/DataTable/useTable.js +290 -207
  91. package/dist/Details/Details.js +126 -100
  92. package/dist/Details/Details.module.css.js +5 -5
  93. package/dist/Dialog/Dialog.js +351 -259
  94. package/dist/Dialog/Dialog.module.css.js +5 -22
  95. package/dist/FeatureFlags/DefaultFeatureFlags.js +7 -7
  96. package/dist/FeatureFlags/FeatureFlagContext.js +5 -5
  97. package/dist/FeatureFlags/FeatureFlagScope.js +44 -36
  98. package/dist/FeatureFlags/FeatureFlags.js +37 -29
  99. package/dist/FeatureFlags/useFeatureFlag.js +19 -17
  100. package/dist/FilteredActionList/FilteredActionList.d.ts.map +1 -1
  101. package/dist/FilteredActionList/FilteredActionList.js +559 -454
  102. package/dist/FilteredActionList/FilteredActionList.module.css.js +5 -15
  103. package/dist/FilteredActionList/FilteredActionListInput.d.ts +15 -0
  104. package/dist/FilteredActionList/FilteredActionListInput.d.ts.map +1 -0
  105. package/dist/FilteredActionList/FilteredActionListInput.js +119 -0
  106. package/dist/FilteredActionList/FilteredActionListLoaders.js +150 -119
  107. package/dist/FilteredActionList/FilteredActionListLoaders.module.css.js +5 -9
  108. package/dist/FilteredActionList/index.d.ts +9 -1
  109. package/dist/FilteredActionList/index.d.ts.map +1 -1
  110. package/dist/FilteredActionList/index.js +11 -0
  111. package/dist/FilteredActionList/useAnnouncements.js +180 -167
  112. package/dist/Flash/Flash.js +69 -57
  113. package/dist/Flash/Flash.module.css.js +5 -5
  114. package/dist/FormControl/FormControl.js +227 -211
  115. package/dist/FormControl/FormControl.module.css.js +5 -11
  116. package/dist/FormControl/FormControlCaption.js +49 -37
  117. package/dist/FormControl/FormControlCaption.module.css.js +5 -5
  118. package/dist/FormControl/FormControlLabel.js +115 -95
  119. package/dist/FormControl/FormControlLeadingVisual.js +37 -29
  120. package/dist/FormControl/FormControlLeadingVisual.module.css.js +5 -5
  121. package/dist/FormControl/_FormControlContext.js +48 -41
  122. package/dist/FormControl/_FormControlValidation.js +39 -29
  123. package/dist/Header/Header.js +165 -138
  124. package/dist/Header/Header.module.css.js +5 -9
  125. package/dist/Heading/Heading.js +37 -26
  126. package/dist/Heading/Heading.module.css.js +5 -5
  127. package/dist/Hidden/Hidden.js +77 -54
  128. package/dist/Hidden/Hidden.module.css.js +5 -5
  129. package/dist/InlineMessage/InlineMessage.js +116 -88
  130. package/dist/InlineMessage/InlineMessage.module.css.js +5 -8
  131. package/dist/KeybindingHint/KeybindingHint.js +88 -70
  132. package/dist/KeybindingHint/KeybindingHint.module.css.js +5 -5
  133. package/dist/KeybindingHint/components/Chord.js +93 -81
  134. package/dist/KeybindingHint/components/Chord.module.css.js +5 -11
  135. package/dist/KeybindingHint/components/Key.js +66 -49
  136. package/dist/KeybindingHint/components/Sequence.js +24 -12
  137. package/dist/KeybindingHint/key-names.js +114 -99
  138. package/dist/Label/Label.js +66 -56
  139. package/dist/Label/Label.module.css.js +5 -5
  140. package/dist/Label/index.js +5 -5
  141. package/dist/LabelGroup/LabelGroup.js +344 -260
  142. package/dist/LabelGroup/LabelGroup.module.css.js +5 -12
  143. package/dist/Link/Link.js +47 -31
  144. package/dist/Link/Link.module.css.js +5 -5
  145. package/dist/NavList/NavList.js +614 -424
  146. package/dist/NavList/NavList.module.css.js +5 -5
  147. package/dist/Octicon/Octicon.js +37 -35
  148. package/dist/Overlay/Overlay.js +318 -264
  149. package/dist/Overlay/Overlay.module.css.js +5 -8
  150. package/dist/PageHeader/PageHeader.js +823 -579
  151. package/dist/PageHeader/PageHeader.module.css.js +5 -21
  152. package/dist/PageLayout/PageLayout.js +913 -631
  153. package/dist/PageLayout/PageLayout.module.css.js +5 -31
  154. package/dist/PageLayout/paneUtils.js +29 -15
  155. package/dist/PageLayout/usePaneWidth.js +437 -334
  156. package/dist/Pagehead/Pagehead.js +14 -10
  157. package/dist/Pagehead/Pagehead.module.css.js +5 -5
  158. package/dist/Pagination/Pagination.js +114 -84
  159. package/dist/Pagination/Pagination.module.css.js +5 -9
  160. package/dist/Pagination/index.js +5 -5
  161. package/dist/Pagination/model.js +194 -118
  162. package/dist/Popover/Popover.js +151 -126
  163. package/dist/Popover/Popover.module.css.js +5 -8
  164. package/dist/Portal/Portal.js +85 -65
  165. package/dist/Portal/index.js +6 -5
  166. package/dist/ProgressBar/ProgressBar.js +255 -210
  167. package/dist/ProgressBar/ProgressBar.module.css.js +5 -9
  168. package/dist/ProgressBar/index.js +8 -6
  169. package/dist/Radio/Radio.js +115 -97
  170. package/dist/Radio/Radio.module.css.js +5 -5
  171. package/dist/RadioGroup/RadioGroup.js +118 -99
  172. package/dist/RelativeTime/RelativeTime.js +76 -64
  173. package/dist/ScrollableRegion/ScrollableRegion.js +79 -67
  174. package/dist/ScrollableRegion/ScrollableRegion.module.css.js +5 -5
  175. package/dist/SegmentedControl/SegmentedControl.js +287 -238
  176. package/dist/SegmentedControl/SegmentedControl.module.css.js +5 -15
  177. package/dist/SegmentedControl/SegmentedControlButton.js +187 -156
  178. package/dist/SegmentedControl/SegmentedControlIconButton.js +161 -133
  179. package/dist/Select/Select.js +234 -185
  180. package/dist/Select/Select.module.css.js +5 -10
  181. package/dist/SelectPanel/SelectPanel.d.ts +1 -0
  182. package/dist/SelectPanel/SelectPanel.d.ts.map +1 -1
  183. package/dist/SelectPanel/SelectPanel.js +829 -620
  184. package/dist/SelectPanel/SelectPanel.module.css.js +5 -27
  185. package/dist/SelectPanel/SelectPanelMessage.js +39 -37
  186. package/dist/SelectPanel/index.d.ts +1 -0
  187. package/dist/SelectPanel/index.d.ts.map +1 -1
  188. package/dist/SideNav.js +47 -24
  189. package/dist/SideNav.module.css.js +5 -12
  190. package/dist/Skeleton/SkeletonBox.js +111 -94
  191. package/dist/Skeleton/SkeletonBox.module.css.js +5 -8
  192. package/dist/SkeletonAvatar/SkeletonAvatar.js +120 -95
  193. package/dist/SkeletonAvatar/SkeletonAvatar.module.css.js +5 -5
  194. package/dist/SkeletonText/SkeletonText.js +137 -114
  195. package/dist/SkeletonText/SkeletonText.module.css.js +5 -8
  196. package/dist/Spinner/Spinner.js +211 -183
  197. package/dist/Spinner/Spinner.module.css.js +5 -9
  198. package/dist/SplitPageLayout/SplitPageLayout.js +276 -215
  199. package/dist/Stack/Stack.js +255 -207
  200. package/dist/Stack/Stack.module.css.js +5 -8
  201. package/dist/Stack/index.js +6 -4
  202. package/dist/StateLabel/StateLabel.js +123 -110
  203. package/dist/StateLabel/StateLabel.module.css.js +5 -8
  204. package/dist/SubNav/SubNav.js +197 -159
  205. package/dist/SubNav/SubNav.module.css.js +5 -11
  206. package/dist/TabNav/TabNav.js +199 -167
  207. package/dist/TabNav/TabNav.module.css.js +5 -10
  208. package/dist/Text/Text.js +67 -56
  209. package/dist/Text/Text.module.css.js +5 -5
  210. package/dist/TextInput/TextInput.js +228 -195
  211. package/dist/TextInput/TextInput.module.css.js +5 -8
  212. package/dist/TextInputWithTokens/TextInputWithTokens.js +673 -567
  213. package/dist/TextInputWithTokens/TextInputWithTokens.module.css.js +5 -14
  214. package/dist/Textarea/TextArea.module.css.js +5 -9
  215. package/dist/Textarea/Textarea.js +294 -264
  216. package/dist/ThemeProvider.js +257 -199
  217. package/dist/Timeline/Timeline.js +247 -204
  218. package/dist/Timeline/Timeline.module.css.js +5 -12
  219. package/dist/ToggleSwitch/ToggleSwitch.js +471 -403
  220. package/dist/ToggleSwitch/ToggleSwitch.module.css.js +5 -16
  221. package/dist/Token/IssueLabelToken.js +297 -256
  222. package/dist/Token/IssueLabelToken.module.css.js +5 -8
  223. package/dist/Token/Token.js +280 -232
  224. package/dist/Token/Token.module.css.js +5 -9
  225. package/dist/Token/TokenBase.js +126 -99
  226. package/dist/Token/TokenBase.module.css.js +5 -5
  227. package/dist/Token/_RemoveTokenButton.js +48 -27
  228. package/dist/Token/_RemoveTokenButton.module.css.js +5 -5
  229. package/dist/Token/_TokenTextContainer.js +65 -54
  230. package/dist/Token/_TokenTextContainer.module.css.js +5 -5
  231. package/dist/Tooltip/Tooltip.js +56 -49
  232. package/dist/Tooltip/Tooltip.module.css.js +5 -20
  233. package/dist/TooltipV2/Tooltip.js +305 -222
  234. package/dist/TooltipV2/Tooltip.module.css.js +5 -11
  235. package/dist/TopicTag/TopicTag.js +55 -46
  236. package/dist/TopicTag/TopicTag.module.css.js +5 -5
  237. package/dist/TopicTag/TopicTagGroup.js +48 -40
  238. package/dist/TopicTag/TopicTagGroup.module.css.js +5 -5
  239. package/dist/TopicTag/index.js +7 -5
  240. package/dist/TreeView/TreeView.js +1414 -1082
  241. package/dist/TreeView/TreeView.module.css.js +5 -24
  242. package/dist/TreeView/shared.js +9 -10
  243. package/dist/TreeView/useRovingTabIndex.js +203 -129
  244. package/dist/TreeView/useTreeItemCache.js +79 -64
  245. package/dist/TreeView/useTypeahead.js +112 -90
  246. package/dist/Truncate/Truncate.js +33 -21
  247. package/dist/Truncate/Truncate.module.css.js +5 -5
  248. package/dist/UnderlineNav/UnderlineNav.js +375 -278
  249. package/dist/UnderlineNav/UnderlineNav.module.css.js +5 -8
  250. package/dist/UnderlineNav/UnderlineNavContext.js +8 -8
  251. package/dist/UnderlineNav/UnderlineNavItem.js +72 -56
  252. package/dist/UnderlineNav/UnderlineNavItem.module.css.js +5 -5
  253. package/dist/UnderlineNav/index.js +7 -5
  254. package/dist/UnderlineNav/styles.js +15 -11
  255. package/dist/VisuallyHidden/VisuallyHidden.js +49 -51
  256. package/dist/VisuallyHidden/VisuallyHidden.module.css.js +5 -5
  257. package/dist/_VisuallyHidden.js +62 -50
  258. package/dist/_VisuallyHidden.module.css.js +5 -5
  259. package/dist/deprecated/ActionList/Divider.js +23 -23
  260. package/dist/deprecated/ActionList/Divider.module.css.js +5 -5
  261. package/dist/deprecated/ActionList/Group.js +50 -43
  262. package/dist/deprecated/ActionList/Header.js +81 -69
  263. package/dist/deprecated/ActionList/Header.module.css.js +5 -5
  264. package/dist/deprecated/ActionList/Item.js +352 -308
  265. package/dist/deprecated/ActionList/Item.module.css.js +5 -18
  266. package/dist/deprecated/ActionList/List.js +196 -157
  267. package/dist/deprecated/ActionList/List.module.css.js +5 -5
  268. package/dist/deprecated/ActionList/index.js +14 -14
  269. package/dist/deprecated/ActionMenu.js +190 -159
  270. package/dist/deprecated/DialogV1/Dialog.js +200 -166
  271. package/dist/deprecated/DialogV1/Dialog.module.css.js +5 -11
  272. package/dist/deprecated/FilteredSearch/FilteredSearch.js +51 -43
  273. package/dist/deprecated/FilteredSearch/FilteredSearch.module.css.js +5 -5
  274. package/dist/deprecated/UnderlineNav/UnderlineNav.js +160 -132
  275. package/dist/deprecated/UnderlineNav/UnderlineNav.module.css.js +5 -14
  276. package/dist/deprecated/index.js +9 -20
  277. package/dist/experimental/IssueLabel/IssueLabel.js +158 -134
  278. package/dist/experimental/IssueLabel/IssueLabel.module.css.js +5 -5
  279. package/dist/experimental/SelectPanel2/SelectPanel.js +567 -419
  280. package/dist/experimental/SelectPanel2/SelectPanel.module.css.js +5 -32
  281. package/dist/experimental/Tabs/Tabs.js +297 -234
  282. package/dist/experimental/UnderlinePanels/UnderlinePanels.js +215 -165
  283. package/dist/experimental/UnderlinePanels/UnderlinePanels.module.css.js +5 -5
  284. package/dist/experimental/index.d.ts +2 -2
  285. package/dist/experimental/index.d.ts.map +1 -1
  286. package/dist/experimental/index.js +34 -44
  287. package/dist/hooks/useAnchoredPosition.js +144 -123
  288. package/dist/hooks/useControllableState.js +59 -34
  289. package/dist/hooks/useDetails.js +99 -84
  290. package/dist/hooks/useDialog.js +178 -140
  291. package/dist/hooks/useFocusTrap.js +71 -57
  292. package/dist/hooks/useFocusZone.js +38 -32
  293. package/dist/hooks/useId.js +16 -14
  294. package/dist/hooks/useIsMacOS.js +26 -21
  295. package/dist/hooks/useMedia.js +68 -54
  296. package/dist/hooks/useMenuInitialFocus.js +62 -65
  297. package/dist/hooks/useMenuKeyboardNavigation.js +126 -129
  298. package/dist/hooks/useMergedRefs.js +78 -63
  299. package/dist/hooks/useMnemonics.js +107 -77
  300. package/dist/hooks/useOnEscapePress.js +56 -45
  301. package/dist/hooks/useOnOutsideClick.js +63 -32
  302. package/dist/hooks/useOpenAndCloseFocus.js +43 -40
  303. package/dist/hooks/useOverflow.js +36 -32
  304. package/dist/hooks/useOverlay.js +75 -56
  305. package/dist/hooks/useProvidedRefOrCreate.js +24 -24
  306. package/dist/hooks/useProvidedStateOrCreate.js +39 -33
  307. package/dist/hooks/useRefObjectAsForwardedRef.js +32 -30
  308. package/dist/hooks/useRenderForcingRef.js +46 -42
  309. package/dist/hooks/useResizeObserver.js +43 -32
  310. package/dist/hooks/useResponsiveValue.js +57 -37
  311. package/dist/hooks/useSafeTimeout.js +29 -26
  312. package/dist/hooks/useScrollFlash.js +23 -16
  313. package/dist/hooks/useSlots.js +136 -102
  314. package/dist/hooks/useSyncedState.js +37 -31
  315. package/dist/index.d.ts +2 -2
  316. package/dist/index.d.ts.map +1 -1
  317. package/dist/index.js +86 -88
  318. package/dist/internal/components/ButtonReset.js +50 -45
  319. package/dist/internal/components/ButtonReset.module.css.js +5 -5
  320. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.js +105 -79
  321. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.module.css.js +5 -12
  322. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupCaption.js +21 -16
  323. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupContext.js +4 -4
  324. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupLabel.js +35 -26
  325. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupValidation.js +19 -14
  326. package/dist/internal/components/ConditionalWrapper.js +51 -41
  327. package/dist/internal/components/InputLabel.js +113 -92
  328. package/dist/internal/components/InputLabel.module.css.js +5 -8
  329. package/dist/internal/components/InputValidation.js +87 -67
  330. package/dist/internal/components/InputValidation.module.css.js +5 -9
  331. package/dist/internal/components/TextInputInnerAction.js +173 -134
  332. package/dist/internal/components/TextInputInnerAction.module.css.js +5 -9
  333. package/dist/internal/components/TextInputInnerVisualSlot.js +110 -89
  334. package/dist/internal/components/TextInputInnerVisualSlot.module.css.js +5 -11
  335. package/dist/internal/components/TextInputWrapper.js +230 -187
  336. package/dist/internal/components/TextInputWrapper.module.css.js +5 -8
  337. package/dist/internal/components/UnderlineTabbedInterface.js +238 -191
  338. package/dist/internal/components/UnderlineTabbedInterface.module.css.js +5 -11
  339. package/dist/internal/components/UnstyledTextInput.js +47 -40
  340. package/dist/internal/components/UnstyledTextInput.module.css.js +5 -5
  341. package/dist/internal/components/ValidationAnimationContainer.js +66 -55
  342. package/dist/internal/components/ValidationAnimationContainer.module.css.js +5 -8
  343. package/dist/internal/hooks/useEffectCallback.js +38 -35
  344. package/dist/internal/hooks/useEffectOnce.js +25 -23
  345. package/dist/internal/utils/getResponsiveAttributes.js +26 -23
  346. package/dist/internal/utils/hasInteractiveNodes.js +46 -34
  347. package/dist/legacy-theme/ts/color-schemes.js +4732 -4250
  348. package/dist/live-region/Announce.js +183 -144
  349. package/dist/live-region/AriaAlert.js +22 -20
  350. package/dist/live-region/AriaStatus.js +22 -20
  351. package/dist/next/index.js +1 -3
  352. package/dist/test-helpers.js +62 -40
  353. package/dist/theme.js +47 -83
  354. package/dist/utils/character-counter.js +63 -45
  355. package/dist/utils/create-component.js +16 -15
  356. package/dist/utils/descendant-registry.js +218 -182
  357. package/dist/utils/environment.js +7 -7
  358. package/dist/utils/getBreakpointDeclarations.js +10 -9
  359. package/dist/utils/invariant.js +23 -17
  360. package/dist/utils/is-slot.js +11 -10
  361. package/dist/utils/isNumeric.js +3 -3
  362. package/dist/utils/modern-polymorphic.js +20 -12
  363. package/dist/utils/scroll.js +11 -8
  364. package/dist/utils/theme.js +10 -5
  365. package/dist/utils/useIsomorphicLayoutEffect.js +9 -4
  366. package/dist/utils/warning.js +21 -14
  367. package/generated/components.json +1 -1
  368. package/package.json +10 -5
  369. package/dist/ActionBar/ActionBar-a41224b2.css +0 -2
  370. package/dist/ActionBar/ActionBar-a41224b2.css.map +0 -1
  371. package/dist/ActionList/ActionList-53389912.css.map +0 -1
@@ -1,32 +1,5 @@
1
- import "./SelectPanel-40b4ba73.css";
2
- //#region src/experimental/SelectPanel2/SelectPanel.module.css.js
3
- var SelectPanel_module_css_default = {
4
- "Overlay": "prc-SelectPanel2-Overlay--Q-FI",
5
- "Form": "prc-SelectPanel2-Form-bZ9HS",
6
- "Container": "prc-SelectPanel2-Container-e5e6-",
7
- "HeaderContent": "prc-SelectPanel2-HeaderContent-MsaAS",
8
- "TitleWrapper": "prc-SelectPanel2-TitleWrapper-HzPu3",
9
- "TextInput": "prc-SelectPanel2-TextInput-lHH1n",
10
- "Checkbox": "prc-SelectPanel2-Checkbox-AYR38",
11
- "FlexBox": "prc-SelectPanel2-FlexBox-gWPRg",
12
- "Title": "prc-SelectPanel2-Title-T-h3f",
13
- "Description": "prc-SelectPanel2-Description-qTXfi",
14
- "ClearAction": "prc-SelectPanel2-ClearAction-tQj-f",
15
- "Footer": "prc-SelectPanel2-Footer-TibV0",
16
- "FooterContent": "prc-SelectPanel2-FooterContent-UjAOM",
17
- "FooterActions": "prc-SelectPanel2-FooterActions-T6yQR",
18
- "SecondaryCheckbox": "prc-SelectPanel2-SecondaryCheckbox-omkf-",
19
- "SmallText": "prc-SelectPanel2-SmallText-c42ay",
20
- "SelectPanelLoading": "prc-SelectPanel2-SelectPanelLoading-mtyhD",
21
- "LoadingText": "prc-SelectPanel2-LoadingText-DB0wN",
22
- "MessageFull": "prc-SelectPanel2-MessageFull-nY-qF",
23
- "Octicon": "prc-SelectPanel2-Octicon-zt-zU",
24
- "Error": "prc-SelectPanel2-Error-ZrZQQ",
25
- "Warning": "prc-SelectPanel2-Warning-PDsVF",
26
- "MessageTitle": "prc-SelectPanel2-MessageTitle-T7v9d",
27
- "MessageContent": "prc-SelectPanel2-MessageContent-UZ9vY",
28
- "MessageInline": "prc-SelectPanel2-MessageInline-sErQf",
29
- "Header": "prc-SelectPanel2-Header-LKyEJ"
30
- };
31
- //#endregion
32
- export { SelectPanel_module_css_default as default };
1
+ import './SelectPanel-40b4ba73.css';
2
+
3
+ var classes = {"Overlay":"prc-SelectPanel2-Overlay--Q-FI","Form":"prc-SelectPanel2-Form-bZ9HS","Container":"prc-SelectPanel2-Container-e5e6-","HeaderContent":"prc-SelectPanel2-HeaderContent-MsaAS","TitleWrapper":"prc-SelectPanel2-TitleWrapper-HzPu3","TextInput":"prc-SelectPanel2-TextInput-lHH1n","Checkbox":"prc-SelectPanel2-Checkbox-AYR38","FlexBox":"prc-SelectPanel2-FlexBox-gWPRg","Title":"prc-SelectPanel2-Title-T-h3f","Description":"prc-SelectPanel2-Description-qTXfi","ClearAction":"prc-SelectPanel2-ClearAction-tQj-f","Footer":"prc-SelectPanel2-Footer-TibV0","FooterContent":"prc-SelectPanel2-FooterContent-UjAOM","FooterActions":"prc-SelectPanel2-FooterActions-T6yQR","SecondaryCheckbox":"prc-SelectPanel2-SecondaryCheckbox-omkf-","SmallText":"prc-SelectPanel2-SmallText-c42ay","SelectPanelLoading":"prc-SelectPanel2-SelectPanelLoading-mtyhD","LoadingText":"prc-SelectPanel2-LoadingText-DB0wN","MessageFull":"prc-SelectPanel2-MessageFull-nY-qF","Octicon":"prc-SelectPanel2-Octicon-zt-zU","Error":"prc-SelectPanel2-Error-ZrZQQ","Warning":"prc-SelectPanel2-Warning-PDsVF","MessageTitle":"prc-SelectPanel2-MessageTitle-T7v9d","MessageContent":"prc-SelectPanel2-MessageContent-UZ9vY","MessageInline":"prc-SelectPanel2-MessageInline-sErQf","Header":"prc-SelectPanel2-Header-LKyEJ"};
4
+
5
+ export { classes as default };
@@ -1,254 +1,317 @@
1
- import { useProvidedRefOrCreate } from "../../hooks/useProvidedRefOrCreate.js";
2
- import useIsomorphicLayoutEffect from "../../utils/useIsomorphicLayoutEffect.js";
3
- import { useControllableState } from "../../hooks/useControllableState.js";
4
- import { c } from "react-compiler-runtime";
5
- import { jsx } from "react/jsx-runtime";
6
- import React, { createContext, useContext, useId } from "react";
7
- //#region src/experimental/Tabs/Tabs.tsx
1
+ import { c } from 'react-compiler-runtime';
2
+ import React, { useId, createContext, useContext } from 'react';
3
+ import useIsomorphicLayoutEffect from '../../utils/useIsomorphicLayoutEffect.js';
4
+ import { useControllableState } from '../../hooks/useControllableState.js';
5
+ import { jsx } from 'react/jsx-runtime';
6
+ import { useProvidedRefOrCreate } from '../../hooks/useProvidedRefOrCreate.js';
7
+
8
8
  /**
9
- * Props to be used when the Tabs component's state is controlled by the parent
10
- */
11
- /**
12
- * Props to be used when the Tabs component is managing its own state
13
- */
14
- /**
15
- * The Tabs component provides the base structure for a tabbed interface, without providing any formal requirement on DOM structure or styling.
16
- * It manages the state of the selected tab, handles tab ordering/selection and provides context to its child components to ensure an accessible experience.
17
- *
18
- * This is intended to be used in conjunction with the `useTab`, `useTabList`, and `useTabPanel` hooks to build a fully accessible tabs component.
19
- * The `Tab`, `TabList`, and `TabPanel` components are provided for convenience to showcase the API & implementation.
20
- */
9
+ * The Tabs component provides the base structure for a tabbed interface, without providing any formal requirement on DOM structure or styling.
10
+ * It manages the state of the selected tab, handles tab ordering/selection and provides context to its child components to ensure an accessible experience.
11
+ *
12
+ * This is intended to be used in conjunction with the `useTab`, `useTabList`, and `useTabPanel` hooks to build a fully accessible tabs component.
13
+ * The `Tab`, `TabList`, and `TabPanel` components are provided for convenience to showcase the API & implementation.
14
+ */
21
15
  function Tabs(props) {
22
- var _props$defaultValue;
23
- const $ = c(13);
24
- const { children, onValueChange } = props;
25
- const groupId = useId();
26
- const t0 = (_props$defaultValue = props.defaultValue) !== null && _props$defaultValue !== void 0 ? _props$defaultValue : props.value;
27
- let t1;
28
- if ($[0] !== props.value || $[1] !== t0) {
29
- t1 = {
30
- name: "tab-selection",
31
- defaultValue: t0,
32
- value: props.value
33
- };
34
- $[0] = props.value;
35
- $[1] = t0;
36
- $[2] = t1;
37
- } else t1 = $[2];
38
- const [selectedValue, setSelectedValue] = useControllableState(t1);
39
- const savedOnValueChange = React.useRef(onValueChange);
40
- let t2;
41
- if ($[3] !== groupId || $[4] !== selectedValue || $[5] !== setSelectedValue) {
42
- t2 = {
43
- groupId,
44
- selectedValue,
45
- selectTab(value) {
46
- var _savedOnValueChange$c;
47
- setSelectedValue(value);
48
- (_savedOnValueChange$c = savedOnValueChange.current) === null || _savedOnValueChange$c === void 0 || _savedOnValueChange$c.call(savedOnValueChange, { value });
49
- }
50
- };
51
- $[3] = groupId;
52
- $[4] = selectedValue;
53
- $[5] = setSelectedValue;
54
- $[6] = t2;
55
- } else t2 = $[6];
56
- const contextValue = t2;
57
- let t3;
58
- let t4;
59
- if ($[7] !== onValueChange) {
60
- t3 = () => {
61
- savedOnValueChange.current = onValueChange;
62
- };
63
- t4 = [onValueChange];
64
- $[7] = onValueChange;
65
- $[8] = t3;
66
- $[9] = t4;
67
- } else {
68
- t3 = $[8];
69
- t4 = $[9];
70
- }
71
- useIsomorphicLayoutEffect(t3, t4);
72
- let t5;
73
- if ($[10] !== children || $[11] !== contextValue) {
74
- t5 = /* @__PURE__ */ jsx(TabsContext.Provider, {
75
- value: contextValue,
76
- children
77
- });
78
- $[10] = children;
79
- $[11] = contextValue;
80
- $[12] = t5;
81
- } else t5 = $[12];
82
- return t5;
16
+ var _props$defaultValue;
17
+ const $ = c(13);
18
+ const {
19
+ children,
20
+ onValueChange
21
+ } = props;
22
+ const groupId = useId();
23
+ const t0 = (_props$defaultValue = props.defaultValue) !== null && _props$defaultValue !== void 0 ? _props$defaultValue : props.value;
24
+ let t1;
25
+ if ($[0] !== props.value || $[1] !== t0) {
26
+ t1 = {
27
+ name: "tab-selection",
28
+ defaultValue: t0,
29
+ value: props.value
30
+ };
31
+ $[0] = props.value;
32
+ $[1] = t0;
33
+ $[2] = t1;
34
+ } else {
35
+ t1 = $[2];
36
+ }
37
+ const [selectedValue, setSelectedValue] = useControllableState(t1);
38
+ const savedOnValueChange = React.useRef(onValueChange);
39
+ let t2;
40
+ if ($[3] !== groupId || $[4] !== selectedValue || $[5] !== setSelectedValue) {
41
+ t2 = {
42
+ groupId,
43
+ selectedValue,
44
+ selectTab(value) {
45
+ var _savedOnValueChange$c;
46
+ setSelectedValue(value);
47
+ (_savedOnValueChange$c = savedOnValueChange.current) === null || _savedOnValueChange$c === void 0 ? void 0 : _savedOnValueChange$c.call(savedOnValueChange, {
48
+ value
49
+ });
50
+ }
51
+ };
52
+ $[3] = groupId;
53
+ $[4] = selectedValue;
54
+ $[5] = setSelectedValue;
55
+ $[6] = t2;
56
+ } else {
57
+ t2 = $[6];
58
+ }
59
+ const contextValue = t2;
60
+ let t3;
61
+ let t4;
62
+ if ($[7] !== onValueChange) {
63
+ t3 = () => {
64
+ savedOnValueChange.current = onValueChange;
65
+ };
66
+ t4 = [onValueChange];
67
+ $[7] = onValueChange;
68
+ $[8] = t3;
69
+ $[9] = t4;
70
+ } else {
71
+ t3 = $[8];
72
+ t4 = $[9];
73
+ }
74
+ useIsomorphicLayoutEffect(t3, t4);
75
+ let t5;
76
+ if ($[10] !== children || $[11] !== contextValue) {
77
+ t5 = /*#__PURE__*/jsx(TabsContext.Provider, {
78
+ value: contextValue,
79
+ children: children
80
+ });
81
+ $[10] = children;
82
+ $[11] = contextValue;
83
+ $[12] = t5;
84
+ } else {
85
+ t5 = $[12];
86
+ }
87
+ return t5;
83
88
  }
84
89
  function useTabList(props) {
85
- const $ = c(9);
86
- const { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-orientation": ariaOrientation } = props;
87
- const ref = useProvidedRefOrCreate(props.ref);
88
- let t0;
89
- if ($[0] !== ariaOrientation || $[1] !== ref) {
90
- t0 = (event) => {
91
- const { current: tablist } = ref;
92
- if (tablist === null) return;
93
- const tabs = getFocusableTabs(tablist);
94
- const isVertical = ariaOrientation === "vertical";
95
- const nextKey = isVertical ? "ArrowDown" : "ArrowRight";
96
- const prevKey = isVertical ? "ArrowUp" : "ArrowLeft";
97
- if (event.key === nextKey || event.key === prevKey || event.key === "Home" || event.key === "End") {
98
- event.preventDefault();
99
- event.stopPropagation();
100
- }
101
- if (event.key === nextKey) {
102
- const selectedTabIndex = tabs.findIndex(_temp);
103
- if (selectedTabIndex === -1) return;
104
- tabs[(selectedTabIndex + 1) % tabs.length].focus();
105
- } else if (event.key === prevKey) {
106
- const selectedTabIndex_0 = tabs.findIndex(_temp2);
107
- if (selectedTabIndex_0 === -1) return;
108
- tabs[(tabs.length + selectedTabIndex_0 - 1) % tabs.length].focus();
109
- } else if (event.key === "Home") {
110
- if (tabs[0]) tabs[0].focus();
111
- } else if (event.key === "End") {
112
- if (tabs.length > 0) tabs[tabs.length - 1].focus();
113
- }
114
- };
115
- $[0] = ariaOrientation;
116
- $[1] = ref;
117
- $[2] = t0;
118
- } else t0 = $[2];
119
- const onKeyDown = t0;
120
- const t1 = ariaOrientation !== null && ariaOrientation !== void 0 ? ariaOrientation : "horizontal";
121
- let t2;
122
- if ($[3] !== ariaLabel || $[4] !== ariaLabelledby || $[5] !== onKeyDown || $[6] !== ref || $[7] !== t1) {
123
- t2 = { tabListProps: {
124
- ref,
125
- "aria-label": ariaLabel,
126
- "aria-labelledby": ariaLabelledby,
127
- "aria-orientation": t1,
128
- role: "tablist",
129
- onKeyDown
130
- } };
131
- $[3] = ariaLabel;
132
- $[4] = ariaLabelledby;
133
- $[5] = onKeyDown;
134
- $[6] = ref;
135
- $[7] = t1;
136
- $[8] = t2;
137
- } else t2 = $[8];
138
- return t2;
90
+ const $ = c(9);
91
+ const {
92
+ "aria-label": ariaLabel,
93
+ "aria-labelledby": ariaLabelledby,
94
+ "aria-orientation": ariaOrientation
95
+ } = props;
96
+ const ref = useProvidedRefOrCreate(props.ref);
97
+ let t0;
98
+ if ($[0] !== ariaOrientation || $[1] !== ref) {
99
+ t0 = event => {
100
+ const {
101
+ current: tablist
102
+ } = ref;
103
+ if (tablist === null) {
104
+ return;
105
+ }
106
+ const tabs = getFocusableTabs(tablist);
107
+ const isVertical = ariaOrientation === "vertical";
108
+ const nextKey = isVertical ? "ArrowDown" : "ArrowRight";
109
+ const prevKey = isVertical ? "ArrowUp" : "ArrowLeft";
110
+ if (event.key === nextKey || event.key === prevKey || event.key === "Home" || event.key === "End") {
111
+ event.preventDefault();
112
+ event.stopPropagation();
113
+ }
114
+ if (event.key === nextKey) {
115
+ const selectedTabIndex = tabs.findIndex(_temp);
116
+ if (selectedTabIndex === -1) {
117
+ return;
118
+ }
119
+ const nextTabIndex = (selectedTabIndex + 1) % tabs.length;
120
+ tabs[nextTabIndex].focus();
121
+ } else {
122
+ if (event.key === prevKey) {
123
+ const selectedTabIndex_0 = tabs.findIndex(_temp2);
124
+ if (selectedTabIndex_0 === -1) {
125
+ return;
126
+ }
127
+ const nextTabIndex_0 = (tabs.length + selectedTabIndex_0 - 1) % tabs.length;
128
+ tabs[nextTabIndex_0].focus();
129
+ } else {
130
+ if (event.key === "Home") {
131
+ if (tabs[0]) {
132
+ tabs[0].focus();
133
+ }
134
+ } else {
135
+ if (event.key === "End") {
136
+ if (tabs.length > 0) {
137
+ tabs[tabs.length - 1].focus();
138
+ }
139
+ }
140
+ }
141
+ }
142
+ }
143
+ };
144
+ $[0] = ariaOrientation;
145
+ $[1] = ref;
146
+ $[2] = t0;
147
+ } else {
148
+ t0 = $[2];
149
+ }
150
+ const onKeyDown = t0;
151
+ const t1 = ariaOrientation !== null && ariaOrientation !== void 0 ? ariaOrientation : "horizontal";
152
+ let t2;
153
+ if ($[3] !== ariaLabel || $[4] !== ariaLabelledby || $[5] !== onKeyDown || $[6] !== ref || $[7] !== t1) {
154
+ t2 = {
155
+ tabListProps: {
156
+ ref,
157
+ "aria-label": ariaLabel,
158
+ "aria-labelledby": ariaLabelledby,
159
+ "aria-orientation": t1,
160
+ role: "tablist",
161
+ onKeyDown
162
+ }
163
+ };
164
+ $[3] = ariaLabel;
165
+ $[4] = ariaLabelledby;
166
+ $[5] = onKeyDown;
167
+ $[6] = ref;
168
+ $[7] = t1;
169
+ $[8] = t2;
170
+ } else {
171
+ t2 = $[8];
172
+ }
173
+ return t2;
139
174
  }
140
175
  function _temp2(tab_0) {
141
- return tab_0.getAttribute("aria-selected") === "true";
176
+ return tab_0.getAttribute("aria-selected") === "true";
142
177
  }
143
178
  function _temp(tab) {
144
- return tab.getAttribute("aria-selected") === "true";
179
+ return tab.getAttribute("aria-selected") === "true";
145
180
  }
146
181
  function getFocusableTabs(tablist) {
147
- return Array.from(tablist.querySelectorAll("[role=\"tab\"]:not([aria-disabled])"));
182
+ return Array.from(tablist.querySelectorAll('[role="tab"]:not([aria-disabled])'));
148
183
  }
149
184
  /**
150
- * A custom hook that provides the props needed for a tab component.
151
- * The props returned should be spread onto the component (typically a button) with the `role=tab`, under a `tablist`.
152
- */
185
+ * A custom hook that provides the props needed for a tab component.
186
+ * The props returned should be spread onto the component (typically a button) with the `role=tab`, under a `tablist`.
187
+ */
153
188
  function useTab(props) {
154
- const $ = c(21);
155
- const { disabled, value } = props;
156
- const tabs = useTabs();
157
- const selected = tabs.selectedValue === value;
158
- const id = `${tabs.groupId}-tab-${value}`;
159
- const panelId = `${tabs.groupId}-panel-${value}`;
160
- let t0;
161
- if ($[0] !== tabs || $[1] !== value) {
162
- t0 = function onKeyDown(event) {
163
- if (event.key === " " || event.key === "Enter") tabs.selectTab(value);
164
- };
165
- $[0] = tabs;
166
- $[1] = value;
167
- $[2] = t0;
168
- } else t0 = $[2];
169
- const onKeyDown = t0;
170
- let t1;
171
- if ($[3] !== disabled || $[4] !== tabs || $[5] !== value) {
172
- t1 = function onMouseDown(event_0) {
173
- if (!disabled && event_0.button === 0 && event_0.ctrlKey === false) tabs.selectTab(value);
174
- else event_0.preventDefault();
175
- };
176
- $[3] = disabled;
177
- $[4] = tabs;
178
- $[5] = value;
179
- $[6] = t1;
180
- } else t1 = $[6];
181
- const onMouseDown = t1;
182
- let t2;
183
- if ($[7] !== disabled || $[8] !== selected || $[9] !== tabs || $[10] !== value) {
184
- t2 = function onFocus() {
185
- if (!selected && !disabled) tabs.selectTab(value);
186
- };
187
- $[7] = disabled;
188
- $[8] = selected;
189
- $[9] = tabs;
190
- $[10] = value;
191
- $[11] = t2;
192
- } else t2 = $[11];
193
- const onFocus = t2;
194
- const t3 = disabled ? true : void 0;
195
- const t4 = selected ? 0 : -1;
196
- let t5;
197
- if ($[12] !== id || $[13] !== onFocus || $[14] !== onKeyDown || $[15] !== onMouseDown || $[16] !== panelId || $[17] !== selected || $[18] !== t3 || $[19] !== t4) {
198
- t5 = { tabProps: {
199
- "aria-disabled": t3,
200
- "aria-controls": panelId,
201
- "aria-selected": selected,
202
- onKeyDown,
203
- onMouseDown,
204
- onFocus,
205
- id,
206
- role: "tab",
207
- tabIndex: t4
208
- } };
209
- $[12] = id;
210
- $[13] = onFocus;
211
- $[14] = onKeyDown;
212
- $[15] = onMouseDown;
213
- $[16] = panelId;
214
- $[17] = selected;
215
- $[18] = t3;
216
- $[19] = t4;
217
- $[20] = t5;
218
- } else t5 = $[20];
219
- return t5;
189
+ const $ = c(21);
190
+ const {
191
+ disabled,
192
+ value
193
+ } = props;
194
+ const tabs = useTabs();
195
+ const selected = tabs.selectedValue === value;
196
+ const id = `${tabs.groupId}-tab-${value}`;
197
+ const panelId = `${tabs.groupId}-panel-${value}`;
198
+ let t0;
199
+ if ($[0] !== tabs || $[1] !== value) {
200
+ t0 = function onKeyDown(event) {
201
+ if (event.key === " " || event.key === "Enter") {
202
+ tabs.selectTab(value);
203
+ }
204
+ };
205
+ $[0] = tabs;
206
+ $[1] = value;
207
+ $[2] = t0;
208
+ } else {
209
+ t0 = $[2];
210
+ }
211
+ const onKeyDown = t0;
212
+ let t1;
213
+ if ($[3] !== disabled || $[4] !== tabs || $[5] !== value) {
214
+ t1 = function onMouseDown(event_0) {
215
+ if (!disabled && event_0.button === 0 && event_0.ctrlKey === false) {
216
+ tabs.selectTab(value);
217
+ } else {
218
+ event_0.preventDefault();
219
+ }
220
+ };
221
+ $[3] = disabled;
222
+ $[4] = tabs;
223
+ $[5] = value;
224
+ $[6] = t1;
225
+ } else {
226
+ t1 = $[6];
227
+ }
228
+ const onMouseDown = t1;
229
+ let t2;
230
+ if ($[7] !== disabled || $[8] !== selected || $[9] !== tabs || $[10] !== value) {
231
+ t2 = function onFocus() {
232
+ if (!selected && !disabled) {
233
+ tabs.selectTab(value);
234
+ }
235
+ };
236
+ $[7] = disabled;
237
+ $[8] = selected;
238
+ $[9] = tabs;
239
+ $[10] = value;
240
+ $[11] = t2;
241
+ } else {
242
+ t2 = $[11];
243
+ }
244
+ const onFocus = t2;
245
+ const t3 = disabled ? true : undefined;
246
+ const t4 = selected ? 0 : -1;
247
+ let t5;
248
+ if ($[12] !== id || $[13] !== onFocus || $[14] !== onKeyDown || $[15] !== onMouseDown || $[16] !== panelId || $[17] !== selected || $[18] !== t3 || $[19] !== t4) {
249
+ t5 = {
250
+ tabProps: {
251
+ "aria-disabled": t3,
252
+ "aria-controls": panelId,
253
+ "aria-selected": selected,
254
+ onKeyDown,
255
+ onMouseDown,
256
+ onFocus,
257
+ id,
258
+ role: "tab",
259
+ tabIndex: t4
260
+ }
261
+ };
262
+ $[12] = id;
263
+ $[13] = onFocus;
264
+ $[14] = onKeyDown;
265
+ $[15] = onMouseDown;
266
+ $[16] = panelId;
267
+ $[17] = selected;
268
+ $[18] = t3;
269
+ $[19] = t4;
270
+ $[20] = t5;
271
+ } else {
272
+ t5 = $[20];
273
+ }
274
+ return t5;
220
275
  }
221
276
  /** Utility hook for tab panels */
222
277
  function useTabPanel(props) {
223
- const $ = c(5);
224
- const { value } = props;
225
- const tabs = useTabs();
226
- const id = `${tabs.groupId}-panel-${value}`;
227
- const tabId = `${tabs.groupId}-tab-${value}`;
228
- const t0 = tabs.selectedValue === value ? "" : void 0;
229
- const t1 = tabs.selectedValue !== value;
230
- let t2;
231
- if ($[0] !== id || $[1] !== t0 || $[2] !== t1 || $[3] !== tabId) {
232
- t2 = { tabPanelProps: {
233
- "aria-labelledby": tabId,
234
- "data-selected": t0,
235
- id,
236
- hidden: t1,
237
- role: "tabpanel"
238
- } };
239
- $[0] = id;
240
- $[1] = t0;
241
- $[2] = t1;
242
- $[3] = tabId;
243
- $[4] = t2;
244
- } else t2 = $[4];
245
- return t2;
278
+ const $ = c(5);
279
+ const {
280
+ value
281
+ } = props;
282
+ const tabs = useTabs();
283
+ const id = `${tabs.groupId}-panel-${value}`;
284
+ const tabId = `${tabs.groupId}-tab-${value}`;
285
+ const t0 = tabs.selectedValue === value ? "" : undefined;
286
+ const t1 = tabs.selectedValue !== value;
287
+ let t2;
288
+ if ($[0] !== id || $[1] !== t0 || $[2] !== t1 || $[3] !== tabId) {
289
+ t2 = {
290
+ tabPanelProps: {
291
+ "aria-labelledby": tabId,
292
+ "data-selected": t0,
293
+ id,
294
+ hidden: t1,
295
+ role: "tabpanel"
296
+ }
297
+ };
298
+ $[0] = id;
299
+ $[1] = t0;
300
+ $[2] = t1;
301
+ $[3] = tabId;
302
+ $[4] = t2;
303
+ } else {
304
+ t2 = $[4];
305
+ }
306
+ return t2;
246
307
  }
247
- const TabsContext = /* @__PURE__ */ createContext(null);
308
+ const TabsContext = /*#__PURE__*/createContext(null);
248
309
  function useTabs() {
249
- const context = useContext(TabsContext);
250
- if (context) return context;
251
- throw new Error("Component must be used within a <Tabs> component");
310
+ const context = useContext(TabsContext);
311
+ if (context) {
312
+ return context;
313
+ }
314
+ throw new Error("Component must be used within a <Tabs> component");
252
315
  }
253
- //#endregion
316
+
254
317
  export { Tabs, useTab, useTabList, useTabPanel };