@primer/react 0.0.0-20260428150519 → 0.0.0-20260428191209

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 (362) hide show
  1. package/CHANGELOG.md +5 -1
  2. package/dist/ActionBar/ActionBar.js +705 -502
  3. package/dist/ActionBar/ActionBar.module.css.js +5 -10
  4. package/dist/ActionBar/index.js +8 -8
  5. package/dist/ActionList/{ActionList-53389912.css → ActionList-09f5c4a8.css} +2 -2
  6. package/dist/ActionList/ActionList-09f5c4a8.css.map +1 -0
  7. package/dist/ActionList/ActionList.module.css.js +5 -31
  8. package/dist/ActionList/ActionListContainerContext.js +5 -4
  9. package/dist/ActionList/Description.js +133 -117
  10. package/dist/ActionList/Divider.js +38 -31
  11. package/dist/ActionList/Group.js +349 -292
  12. package/dist/ActionList/Group.module.css.js +5 -10
  13. package/dist/ActionList/Heading.js +106 -88
  14. package/dist/ActionList/Heading.module.css.js +5 -5
  15. package/dist/ActionList/Item.js +811 -668
  16. package/dist/ActionList/LinkItem.js +56 -36
  17. package/dist/ActionList/List.js +210 -168
  18. package/dist/ActionList/Selection.d.ts +2 -3
  19. package/dist/ActionList/Selection.d.ts.map +1 -1
  20. package/dist/ActionList/Selection.js +112 -83
  21. package/dist/ActionList/TrailingAction.js +112 -97
  22. package/dist/ActionList/Visuals.js +191 -143
  23. package/dist/ActionList/index.d.ts +7 -0
  24. package/dist/ActionList/index.d.ts.map +1 -1
  25. package/dist/ActionList/index.js +38 -33
  26. package/dist/ActionList/shared.js +9 -5
  27. package/dist/ActionMenu/ActionMenu.js +310 -223
  28. package/dist/ActionMenu/ActionMenu.module.css.js +5 -5
  29. package/dist/AnchoredOverlay/AnchoredOverlay.js +280 -206
  30. package/dist/AnchoredOverlay/AnchoredOverlay.module.css.js +5 -9
  31. package/dist/Autocomplete/Autocomplete.js +141 -125
  32. package/dist/Autocomplete/AutocompleteContext.js +20 -18
  33. package/dist/Autocomplete/AutocompleteInput.js +146 -108
  34. package/dist/Autocomplete/AutocompleteMenu.js +238 -201
  35. package/dist/Autocomplete/AutocompleteMenu.module.css.js +5 -8
  36. package/dist/Autocomplete/AutocompleteOverlay.js +79 -54
  37. package/dist/Autocomplete/AutocompleteOverlay.module.css.js +5 -5
  38. package/dist/Avatar/Avatar.js +133 -106
  39. package/dist/Avatar/Avatar.module.css.js +5 -5
  40. package/dist/AvatarStack/AvatarStack.js +143 -102
  41. package/dist/AvatarStack/AvatarStack.module.css.js +5 -9
  42. package/dist/Banner/Banner.js +186 -133
  43. package/dist/Banner/Banner.module.css.js +5 -14
  44. package/dist/Banner/index.js +7 -7
  45. package/dist/BaseStyles.js +91 -74
  46. package/dist/BaseStyles.module.css.js +5 -5
  47. package/dist/Blankslate/Blankslate.js +328 -266
  48. package/dist/Blankslate/Blankslate.module.css.js +5 -12
  49. package/dist/Blankslate/BlankslateContext.js +9 -7
  50. package/dist/Blankslate/index.js +9 -9
  51. package/dist/BranchName/BranchName.js +59 -49
  52. package/dist/BranchName/BranchName.module.css.js +5 -5
  53. package/dist/Breadcrumbs/Breadcrumbs.js +431 -371
  54. package/dist/Breadcrumbs/Breadcrumbs.module.css.js +5 -15
  55. package/dist/Button/Button.js +18 -15
  56. package/dist/Button/ButtonBase.js +139 -76
  57. package/dist/Button/ButtonBase.module.css.js +5 -16
  58. package/dist/Button/IconButton.js +74 -42
  59. package/dist/Button/LinkButton.js +17 -13
  60. package/dist/ButtonGroup/ButtonGroup.js +97 -80
  61. package/dist/ButtonGroup/ButtonGroup.module.css.js +5 -5
  62. package/dist/Card/Card.js +491 -401
  63. package/dist/Card/Card.module.css.js +5 -18
  64. package/dist/Card/index.js +9 -9
  65. package/dist/Checkbox/Checkbox.js +71 -52
  66. package/dist/Checkbox/Checkbox.module.css.js +5 -9
  67. package/dist/Checkbox/shared.module.css.js +5 -5
  68. package/dist/CheckboxGroup/CheckboxGroup.js +132 -111
  69. package/dist/CheckboxGroup/CheckboxGroupContext.js +4 -4
  70. package/dist/CircleBadge/CircleBadge.js +90 -77
  71. package/dist/CircleBadge/CircleBadge.module.css.js +5 -8
  72. package/dist/ConfirmationDialog/ConfirmationDialog.js +92 -68
  73. package/dist/CounterLabel/CounterLabel.js +99 -83
  74. package/dist/CounterLabel/CounterLabel.module.css.js +5 -5
  75. package/dist/DataTable/DataTable.js +140 -100
  76. package/dist/DataTable/ErrorDialog.js +45 -33
  77. package/dist/DataTable/Pagination.js +592 -464
  78. package/dist/DataTable/Pagination.module.css.js +5 -13
  79. package/dist/DataTable/Table.js +710 -527
  80. package/dist/DataTable/Table.module.css.js +5 -26
  81. package/dist/DataTable/column.js +11 -10
  82. package/dist/DataTable/index.js +20 -22
  83. package/dist/DataTable/sorting.js +103 -65
  84. package/dist/DataTable/useTable.js +290 -207
  85. package/dist/Details/Details.js +126 -100
  86. package/dist/Details/Details.module.css.js +5 -5
  87. package/dist/Dialog/Dialog.js +351 -259
  88. package/dist/Dialog/Dialog.module.css.js +5 -22
  89. package/dist/FeatureFlags/DefaultFeatureFlags.js +7 -7
  90. package/dist/FeatureFlags/FeatureFlagContext.js +5 -5
  91. package/dist/FeatureFlags/FeatureFlagScope.js +44 -36
  92. package/dist/FeatureFlags/FeatureFlags.js +37 -29
  93. package/dist/FeatureFlags/useFeatureFlag.js +19 -17
  94. package/dist/FilteredActionList/FilteredActionList.d.ts.map +1 -1
  95. package/dist/FilteredActionList/FilteredActionList.js +559 -454
  96. package/dist/FilteredActionList/FilteredActionList.module.css.js +5 -15
  97. package/dist/FilteredActionList/FilteredActionListInput.d.ts +15 -0
  98. package/dist/FilteredActionList/FilteredActionListInput.d.ts.map +1 -0
  99. package/dist/FilteredActionList/FilteredActionListInput.js +119 -0
  100. package/dist/FilteredActionList/FilteredActionListLoaders.js +150 -119
  101. package/dist/FilteredActionList/FilteredActionListLoaders.module.css.js +5 -9
  102. package/dist/FilteredActionList/index.d.ts +9 -1
  103. package/dist/FilteredActionList/index.d.ts.map +1 -1
  104. package/dist/FilteredActionList/index.js +11 -0
  105. package/dist/FilteredActionList/useAnnouncements.js +180 -167
  106. package/dist/Flash/Flash.js +69 -57
  107. package/dist/Flash/Flash.module.css.js +5 -5
  108. package/dist/FormControl/FormControl.js +227 -211
  109. package/dist/FormControl/FormControl.module.css.js +5 -11
  110. package/dist/FormControl/FormControlCaption.js +49 -37
  111. package/dist/FormControl/FormControlCaption.module.css.js +5 -5
  112. package/dist/FormControl/FormControlLabel.js +115 -95
  113. package/dist/FormControl/FormControlLeadingVisual.js +37 -29
  114. package/dist/FormControl/FormControlLeadingVisual.module.css.js +5 -5
  115. package/dist/FormControl/_FormControlContext.js +48 -41
  116. package/dist/FormControl/_FormControlValidation.js +39 -29
  117. package/dist/Header/Header.js +165 -138
  118. package/dist/Header/Header.module.css.js +5 -9
  119. package/dist/Heading/Heading.js +37 -26
  120. package/dist/Heading/Heading.module.css.js +5 -5
  121. package/dist/Hidden/Hidden.js +77 -54
  122. package/dist/Hidden/Hidden.module.css.js +5 -5
  123. package/dist/InlineMessage/InlineMessage.js +116 -88
  124. package/dist/InlineMessage/InlineMessage.module.css.js +5 -8
  125. package/dist/KeybindingHint/KeybindingHint.js +88 -70
  126. package/dist/KeybindingHint/KeybindingHint.module.css.js +5 -5
  127. package/dist/KeybindingHint/components/Chord.js +93 -81
  128. package/dist/KeybindingHint/components/Chord.module.css.js +5 -11
  129. package/dist/KeybindingHint/components/Key.js +66 -49
  130. package/dist/KeybindingHint/components/Sequence.js +24 -12
  131. package/dist/KeybindingHint/key-names.js +114 -99
  132. package/dist/Label/Label.js +66 -56
  133. package/dist/Label/Label.module.css.js +5 -5
  134. package/dist/Label/index.js +5 -5
  135. package/dist/LabelGroup/LabelGroup.js +344 -260
  136. package/dist/LabelGroup/LabelGroup.module.css.js +5 -12
  137. package/dist/Link/Link.js +47 -31
  138. package/dist/Link/Link.module.css.js +5 -5
  139. package/dist/NavList/NavList.js +614 -424
  140. package/dist/NavList/NavList.module.css.js +5 -5
  141. package/dist/Octicon/Octicon.js +37 -35
  142. package/dist/Overlay/Overlay.js +318 -264
  143. package/dist/Overlay/Overlay.module.css.js +5 -8
  144. package/dist/PageHeader/PageHeader.js +823 -579
  145. package/dist/PageHeader/PageHeader.module.css.js +5 -21
  146. package/dist/PageLayout/PageLayout.js +913 -631
  147. package/dist/PageLayout/PageLayout.module.css.js +5 -31
  148. package/dist/PageLayout/paneUtils.js +29 -15
  149. package/dist/PageLayout/usePaneWidth.js +437 -334
  150. package/dist/Pagehead/Pagehead.js +14 -10
  151. package/dist/Pagehead/Pagehead.module.css.js +5 -5
  152. package/dist/Pagination/Pagination.js +114 -84
  153. package/dist/Pagination/Pagination.module.css.js +5 -9
  154. package/dist/Pagination/index.js +5 -5
  155. package/dist/Pagination/model.js +194 -118
  156. package/dist/Popover/Popover.js +151 -126
  157. package/dist/Popover/Popover.module.css.js +5 -8
  158. package/dist/Portal/Portal.js +85 -65
  159. package/dist/Portal/index.js +6 -5
  160. package/dist/ProgressBar/ProgressBar.js +255 -210
  161. package/dist/ProgressBar/ProgressBar.module.css.js +5 -9
  162. package/dist/ProgressBar/index.js +8 -6
  163. package/dist/Radio/Radio.js +115 -97
  164. package/dist/Radio/Radio.module.css.js +5 -5
  165. package/dist/RadioGroup/RadioGroup.js +118 -99
  166. package/dist/RelativeTime/RelativeTime.js +76 -64
  167. package/dist/ScrollableRegion/ScrollableRegion.js +79 -67
  168. package/dist/ScrollableRegion/ScrollableRegion.module.css.js +5 -5
  169. package/dist/SegmentedControl/SegmentedControl.js +287 -238
  170. package/dist/SegmentedControl/SegmentedControl.module.css.js +5 -15
  171. package/dist/SegmentedControl/SegmentedControlButton.js +187 -156
  172. package/dist/SegmentedControl/SegmentedControlIconButton.js +161 -133
  173. package/dist/Select/Select.js +234 -185
  174. package/dist/Select/Select.module.css.js +5 -10
  175. package/dist/SelectPanel/SelectPanel.d.ts +1 -0
  176. package/dist/SelectPanel/SelectPanel.d.ts.map +1 -1
  177. package/dist/SelectPanel/SelectPanel.js +829 -620
  178. package/dist/SelectPanel/SelectPanel.module.css.js +5 -27
  179. package/dist/SelectPanel/SelectPanelMessage.js +39 -37
  180. package/dist/SelectPanel/index.d.ts +1 -0
  181. package/dist/SelectPanel/index.d.ts.map +1 -1
  182. package/dist/SideNav.js +47 -24
  183. package/dist/SideNav.module.css.js +5 -12
  184. package/dist/Skeleton/SkeletonBox.js +111 -94
  185. package/dist/Skeleton/SkeletonBox.module.css.js +5 -8
  186. package/dist/SkeletonAvatar/SkeletonAvatar.js +120 -95
  187. package/dist/SkeletonAvatar/SkeletonAvatar.module.css.js +5 -5
  188. package/dist/SkeletonText/SkeletonText.js +137 -114
  189. package/dist/SkeletonText/SkeletonText.module.css.js +5 -8
  190. package/dist/Spinner/Spinner.js +211 -183
  191. package/dist/Spinner/Spinner.module.css.js +5 -9
  192. package/dist/SplitPageLayout/SplitPageLayout.js +276 -215
  193. package/dist/Stack/Stack.js +255 -207
  194. package/dist/Stack/Stack.module.css.js +5 -8
  195. package/dist/Stack/index.js +6 -4
  196. package/dist/StateLabel/StateLabel.js +123 -110
  197. package/dist/StateLabel/StateLabel.module.css.js +5 -8
  198. package/dist/SubNav/SubNav.js +197 -159
  199. package/dist/SubNav/SubNav.module.css.js +5 -11
  200. package/dist/TabNav/TabNav.js +199 -167
  201. package/dist/TabNav/TabNav.module.css.js +5 -10
  202. package/dist/Text/Text.js +67 -56
  203. package/dist/Text/Text.module.css.js +5 -5
  204. package/dist/TextInput/TextInput.js +228 -195
  205. package/dist/TextInput/TextInput.module.css.js +5 -8
  206. package/dist/TextInputWithTokens/TextInputWithTokens.js +673 -567
  207. package/dist/TextInputWithTokens/TextInputWithTokens.module.css.js +5 -14
  208. package/dist/Textarea/TextArea.module.css.js +5 -9
  209. package/dist/Textarea/Textarea.js +294 -264
  210. package/dist/ThemeProvider.js +257 -199
  211. package/dist/Timeline/Timeline.js +247 -204
  212. package/dist/Timeline/Timeline.module.css.js +5 -12
  213. package/dist/ToggleSwitch/ToggleSwitch.js +471 -403
  214. package/dist/ToggleSwitch/ToggleSwitch.module.css.js +5 -16
  215. package/dist/Token/IssueLabelToken.js +297 -256
  216. package/dist/Token/IssueLabelToken.module.css.js +5 -8
  217. package/dist/Token/Token.js +280 -232
  218. package/dist/Token/Token.module.css.js +5 -9
  219. package/dist/Token/TokenBase.js +126 -99
  220. package/dist/Token/TokenBase.module.css.js +5 -5
  221. package/dist/Token/_RemoveTokenButton.js +48 -27
  222. package/dist/Token/_RemoveTokenButton.module.css.js +5 -5
  223. package/dist/Token/_TokenTextContainer.js +65 -54
  224. package/dist/Token/_TokenTextContainer.module.css.js +5 -5
  225. package/dist/Tooltip/Tooltip.js +56 -49
  226. package/dist/Tooltip/Tooltip.module.css.js +5 -20
  227. package/dist/TooltipV2/Tooltip.js +305 -222
  228. package/dist/TooltipV2/Tooltip.module.css.js +5 -11
  229. package/dist/TopicTag/TopicTag.js +55 -46
  230. package/dist/TopicTag/TopicTag.module.css.js +5 -5
  231. package/dist/TopicTag/TopicTagGroup.js +48 -40
  232. package/dist/TopicTag/TopicTagGroup.module.css.js +5 -5
  233. package/dist/TopicTag/index.js +7 -5
  234. package/dist/TreeView/TreeView.js +1414 -1082
  235. package/dist/TreeView/TreeView.module.css.js +5 -24
  236. package/dist/TreeView/shared.js +9 -10
  237. package/dist/TreeView/useRovingTabIndex.js +203 -129
  238. package/dist/TreeView/useTreeItemCache.js +79 -64
  239. package/dist/TreeView/useTypeahead.js +112 -90
  240. package/dist/Truncate/Truncate.js +33 -21
  241. package/dist/Truncate/Truncate.module.css.js +5 -5
  242. package/dist/UnderlineNav/UnderlineNav.js +375 -278
  243. package/dist/UnderlineNav/UnderlineNav.module.css.js +5 -8
  244. package/dist/UnderlineNav/UnderlineNavContext.js +8 -8
  245. package/dist/UnderlineNav/UnderlineNavItem.js +72 -56
  246. package/dist/UnderlineNav/UnderlineNavItem.module.css.js +5 -5
  247. package/dist/UnderlineNav/index.js +7 -5
  248. package/dist/UnderlineNav/styles.js +15 -11
  249. package/dist/VisuallyHidden/VisuallyHidden.js +49 -51
  250. package/dist/VisuallyHidden/VisuallyHidden.module.css.js +5 -5
  251. package/dist/_VisuallyHidden.js +62 -50
  252. package/dist/_VisuallyHidden.module.css.js +5 -5
  253. package/dist/deprecated/ActionList/Divider.js +23 -23
  254. package/dist/deprecated/ActionList/Divider.module.css.js +5 -5
  255. package/dist/deprecated/ActionList/Group.js +50 -43
  256. package/dist/deprecated/ActionList/Header.js +81 -69
  257. package/dist/deprecated/ActionList/Header.module.css.js +5 -5
  258. package/dist/deprecated/ActionList/Item.js +352 -308
  259. package/dist/deprecated/ActionList/Item.module.css.js +5 -18
  260. package/dist/deprecated/ActionList/List.js +196 -157
  261. package/dist/deprecated/ActionList/List.module.css.js +5 -5
  262. package/dist/deprecated/ActionList/index.js +14 -14
  263. package/dist/deprecated/ActionMenu.js +190 -159
  264. package/dist/deprecated/DialogV1/Dialog.js +200 -166
  265. package/dist/deprecated/DialogV1/Dialog.module.css.js +5 -11
  266. package/dist/deprecated/FilteredSearch/FilteredSearch.js +51 -43
  267. package/dist/deprecated/FilteredSearch/FilteredSearch.module.css.js +5 -5
  268. package/dist/deprecated/UnderlineNav/UnderlineNav.js +160 -132
  269. package/dist/deprecated/UnderlineNav/UnderlineNav.module.css.js +5 -14
  270. package/dist/deprecated/index.js +9 -20
  271. package/dist/experimental/IssueLabel/IssueLabel.js +158 -134
  272. package/dist/experimental/IssueLabel/IssueLabel.module.css.js +5 -5
  273. package/dist/experimental/SelectPanel2/SelectPanel.js +567 -419
  274. package/dist/experimental/SelectPanel2/SelectPanel.module.css.js +5 -32
  275. package/dist/experimental/Tabs/Tabs.js +297 -234
  276. package/dist/experimental/UnderlinePanels/UnderlinePanels.js +215 -165
  277. package/dist/experimental/UnderlinePanels/UnderlinePanels.module.css.js +5 -5
  278. package/dist/experimental/index.d.ts +2 -2
  279. package/dist/experimental/index.d.ts.map +1 -1
  280. package/dist/experimental/index.js +34 -44
  281. package/dist/hooks/useAnchoredPosition.js +144 -123
  282. package/dist/hooks/useControllableState.js +59 -34
  283. package/dist/hooks/useDetails.js +99 -84
  284. package/dist/hooks/useDialog.js +178 -140
  285. package/dist/hooks/useFocusTrap.js +71 -57
  286. package/dist/hooks/useFocusZone.js +38 -32
  287. package/dist/hooks/useId.js +16 -14
  288. package/dist/hooks/useIsMacOS.js +26 -21
  289. package/dist/hooks/useMedia.js +68 -54
  290. package/dist/hooks/useMenuInitialFocus.js +62 -65
  291. package/dist/hooks/useMenuKeyboardNavigation.js +126 -129
  292. package/dist/hooks/useMergedRefs.js +78 -63
  293. package/dist/hooks/useMnemonics.js +107 -77
  294. package/dist/hooks/useOnEscapePress.js +56 -45
  295. package/dist/hooks/useOnOutsideClick.js +63 -32
  296. package/dist/hooks/useOpenAndCloseFocus.js +43 -40
  297. package/dist/hooks/useOverflow.js +36 -32
  298. package/dist/hooks/useOverlay.js +75 -56
  299. package/dist/hooks/useProvidedRefOrCreate.js +24 -24
  300. package/dist/hooks/useProvidedStateOrCreate.js +39 -33
  301. package/dist/hooks/useRefObjectAsForwardedRef.js +32 -30
  302. package/dist/hooks/useRenderForcingRef.js +46 -42
  303. package/dist/hooks/useResizeObserver.js +43 -32
  304. package/dist/hooks/useResponsiveValue.js +57 -37
  305. package/dist/hooks/useSafeTimeout.js +29 -26
  306. package/dist/hooks/useScrollFlash.js +23 -16
  307. package/dist/hooks/useSlots.js +136 -102
  308. package/dist/hooks/useSyncedState.js +37 -31
  309. package/dist/index.d.ts +2 -2
  310. package/dist/index.d.ts.map +1 -1
  311. package/dist/index.js +86 -88
  312. package/dist/internal/components/ButtonReset.js +50 -45
  313. package/dist/internal/components/ButtonReset.module.css.js +5 -5
  314. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.js +105 -79
  315. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.module.css.js +5 -12
  316. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupCaption.js +21 -16
  317. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupContext.js +4 -4
  318. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupLabel.js +35 -26
  319. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupValidation.js +19 -14
  320. package/dist/internal/components/ConditionalWrapper.js +51 -41
  321. package/dist/internal/components/InputLabel.js +113 -92
  322. package/dist/internal/components/InputLabel.module.css.js +5 -8
  323. package/dist/internal/components/InputValidation.js +87 -67
  324. package/dist/internal/components/InputValidation.module.css.js +5 -9
  325. package/dist/internal/components/TextInputInnerAction.js +173 -134
  326. package/dist/internal/components/TextInputInnerAction.module.css.js +5 -9
  327. package/dist/internal/components/TextInputInnerVisualSlot.js +110 -89
  328. package/dist/internal/components/TextInputInnerVisualSlot.module.css.js +5 -11
  329. package/dist/internal/components/TextInputWrapper.js +230 -187
  330. package/dist/internal/components/TextInputWrapper.module.css.js +5 -8
  331. package/dist/internal/components/UnderlineTabbedInterface.js +238 -191
  332. package/dist/internal/components/UnderlineTabbedInterface.module.css.js +5 -11
  333. package/dist/internal/components/UnstyledTextInput.js +47 -40
  334. package/dist/internal/components/UnstyledTextInput.module.css.js +5 -5
  335. package/dist/internal/components/ValidationAnimationContainer.js +66 -55
  336. package/dist/internal/components/ValidationAnimationContainer.module.css.js +5 -8
  337. package/dist/internal/hooks/useEffectCallback.js +38 -35
  338. package/dist/internal/hooks/useEffectOnce.js +25 -23
  339. package/dist/internal/utils/getResponsiveAttributes.js +26 -23
  340. package/dist/internal/utils/hasInteractiveNodes.js +46 -34
  341. package/dist/legacy-theme/ts/color-schemes.js +4732 -4250
  342. package/dist/live-region/Announce.js +183 -144
  343. package/dist/live-region/AriaAlert.js +22 -20
  344. package/dist/live-region/AriaStatus.js +22 -20
  345. package/dist/next/index.js +1 -3
  346. package/dist/test-helpers.js +62 -40
  347. package/dist/theme.js +47 -83
  348. package/dist/utils/character-counter.js +63 -45
  349. package/dist/utils/create-component.js +16 -15
  350. package/dist/utils/descendant-registry.js +218 -182
  351. package/dist/utils/environment.js +7 -7
  352. package/dist/utils/getBreakpointDeclarations.js +10 -9
  353. package/dist/utils/invariant.js +23 -17
  354. package/dist/utils/is-slot.js +11 -10
  355. package/dist/utils/isNumeric.js +3 -3
  356. package/dist/utils/modern-polymorphic.js +20 -12
  357. package/dist/utils/scroll.js +11 -8
  358. package/dist/utils/theme.js +10 -5
  359. package/dist/utils/useIsomorphicLayoutEffect.js +9 -4
  360. package/dist/utils/warning.js +21 -14
  361. package/package.json +10 -5
  362. 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 };