@primer/react 0.0.0-20260427204434 → 0.0.0-20260428150519

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 (344) hide show
  1. package/CHANGELOG.md +10 -6
  2. package/dist/ActionBar/ActionBar.js +502 -705
  3. package/dist/ActionBar/ActionBar.module.css.js +10 -5
  4. package/dist/ActionBar/index.js +8 -8
  5. package/dist/ActionList/ActionList.module.css.js +31 -5
  6. package/dist/ActionList/ActionListContainerContext.js +4 -5
  7. package/dist/ActionList/Description.js +117 -133
  8. package/dist/ActionList/Divider.js +31 -38
  9. package/dist/ActionList/Group.js +292 -349
  10. package/dist/ActionList/Group.module.css.js +10 -5
  11. package/dist/ActionList/Heading.js +88 -106
  12. package/dist/ActionList/Heading.module.css.js +5 -5
  13. package/dist/ActionList/Item.js +668 -811
  14. package/dist/ActionList/LinkItem.js +36 -56
  15. package/dist/ActionList/List.js +168 -210
  16. package/dist/ActionList/Selection.js +83 -112
  17. package/dist/ActionList/TrailingAction.js +97 -112
  18. package/dist/ActionList/Visuals.js +143 -191
  19. package/dist/ActionList/index.js +33 -33
  20. package/dist/ActionList/shared.js +5 -9
  21. package/dist/ActionMenu/ActionMenu.js +223 -310
  22. package/dist/ActionMenu/ActionMenu.module.css.js +5 -5
  23. package/dist/AnchoredOverlay/AnchoredOverlay.d.ts.map +1 -1
  24. package/dist/AnchoredOverlay/AnchoredOverlay.js +206 -298
  25. package/dist/AnchoredOverlay/AnchoredOverlay.module.css.js +9 -5
  26. package/dist/Autocomplete/Autocomplete.js +125 -141
  27. package/dist/Autocomplete/AutocompleteContext.js +18 -20
  28. package/dist/Autocomplete/AutocompleteInput.js +108 -146
  29. package/dist/Autocomplete/AutocompleteMenu.js +201 -238
  30. package/dist/Autocomplete/AutocompleteMenu.module.css.js +8 -5
  31. package/dist/Autocomplete/AutocompleteOverlay.js +54 -79
  32. package/dist/Autocomplete/AutocompleteOverlay.module.css.js +5 -5
  33. package/dist/Avatar/Avatar.js +106 -133
  34. package/dist/Avatar/Avatar.module.css.js +5 -5
  35. package/dist/AvatarStack/AvatarStack.js +102 -143
  36. package/dist/AvatarStack/AvatarStack.module.css.js +9 -5
  37. package/dist/Banner/Banner.js +133 -186
  38. package/dist/Banner/Banner.module.css.js +14 -5
  39. package/dist/Banner/index.js +7 -7
  40. package/dist/BaseStyles.js +74 -91
  41. package/dist/BaseStyles.module.css.js +5 -5
  42. package/dist/Blankslate/Blankslate.js +266 -328
  43. package/dist/Blankslate/Blankslate.module.css.js +12 -5
  44. package/dist/Blankslate/BlankslateContext.js +7 -9
  45. package/dist/Blankslate/index.js +9 -9
  46. package/dist/BranchName/BranchName.js +49 -59
  47. package/dist/BranchName/BranchName.module.css.js +5 -5
  48. package/dist/Breadcrumbs/Breadcrumbs.js +371 -431
  49. package/dist/Breadcrumbs/Breadcrumbs.module.css.js +15 -5
  50. package/dist/Button/Button.js +15 -18
  51. package/dist/Button/ButtonBase.js +76 -139
  52. package/dist/Button/ButtonBase.module.css.js +16 -5
  53. package/dist/Button/IconButton.js +42 -74
  54. package/dist/Button/LinkButton.js +13 -17
  55. package/dist/ButtonGroup/ButtonGroup.js +80 -97
  56. package/dist/ButtonGroup/ButtonGroup.module.css.js +5 -5
  57. package/dist/Card/Card.js +401 -491
  58. package/dist/Card/Card.module.css.js +18 -5
  59. package/dist/Card/index.js +9 -9
  60. package/dist/Checkbox/Checkbox.js +52 -71
  61. package/dist/Checkbox/Checkbox.module.css.js +9 -5
  62. package/dist/Checkbox/shared.module.css.js +5 -5
  63. package/dist/CheckboxGroup/CheckboxGroup.js +111 -132
  64. package/dist/CheckboxGroup/CheckboxGroupContext.js +4 -4
  65. package/dist/CircleBadge/CircleBadge.js +77 -90
  66. package/dist/CircleBadge/CircleBadge.module.css.js +8 -5
  67. package/dist/ConfirmationDialog/ConfirmationDialog.js +68 -92
  68. package/dist/CounterLabel/CounterLabel.js +83 -99
  69. package/dist/CounterLabel/CounterLabel.module.css.js +5 -5
  70. package/dist/DataTable/DataTable.js +100 -140
  71. package/dist/DataTable/ErrorDialog.js +33 -45
  72. package/dist/DataTable/Pagination.js +464 -592
  73. package/dist/DataTable/Pagination.module.css.js +13 -5
  74. package/dist/DataTable/Table.js +527 -710
  75. package/dist/DataTable/Table.module.css.js +26 -5
  76. package/dist/DataTable/column.js +10 -11
  77. package/dist/DataTable/index.js +22 -20
  78. package/dist/DataTable/sorting.js +65 -103
  79. package/dist/DataTable/useTable.js +207 -290
  80. package/dist/Details/Details.js +100 -126
  81. package/dist/Details/Details.module.css.js +5 -5
  82. package/dist/Dialog/Dialog.js +259 -351
  83. package/dist/Dialog/Dialog.module.css.js +22 -5
  84. package/dist/FeatureFlags/DefaultFeatureFlags.js +7 -7
  85. package/dist/FeatureFlags/FeatureFlagContext.js +5 -5
  86. package/dist/FeatureFlags/FeatureFlagScope.js +36 -44
  87. package/dist/FeatureFlags/FeatureFlags.js +29 -37
  88. package/dist/FeatureFlags/useFeatureFlag.js +17 -19
  89. package/dist/FilteredActionList/FilteredActionList.js +454 -579
  90. package/dist/FilteredActionList/FilteredActionList.module.css.js +15 -5
  91. package/dist/FilteredActionList/FilteredActionListLoaders.js +119 -150
  92. package/dist/FilteredActionList/FilteredActionListLoaders.module.css.js +9 -5
  93. package/dist/FilteredActionList/useAnnouncements.js +167 -180
  94. package/dist/Flash/Flash.js +57 -69
  95. package/dist/Flash/Flash.module.css.js +5 -5
  96. package/dist/FormControl/FormControl.js +211 -227
  97. package/dist/FormControl/FormControl.module.css.js +11 -5
  98. package/dist/FormControl/FormControlCaption.js +37 -49
  99. package/dist/FormControl/FormControlCaption.module.css.js +5 -5
  100. package/dist/FormControl/FormControlLabel.js +95 -115
  101. package/dist/FormControl/FormControlLeadingVisual.js +29 -37
  102. package/dist/FormControl/FormControlLeadingVisual.module.css.js +5 -5
  103. package/dist/FormControl/_FormControlContext.js +41 -48
  104. package/dist/FormControl/_FormControlValidation.js +29 -39
  105. package/dist/Header/Header.js +138 -165
  106. package/dist/Header/Header.module.css.js +9 -5
  107. package/dist/Heading/Heading.js +26 -37
  108. package/dist/Heading/Heading.module.css.js +5 -5
  109. package/dist/Hidden/Hidden.js +54 -77
  110. package/dist/Hidden/Hidden.module.css.js +5 -5
  111. package/dist/InlineMessage/InlineMessage.js +88 -116
  112. package/dist/InlineMessage/InlineMessage.module.css.js +8 -5
  113. package/dist/KeybindingHint/KeybindingHint.js +70 -88
  114. package/dist/KeybindingHint/KeybindingHint.module.css.js +5 -5
  115. package/dist/KeybindingHint/components/Chord.js +81 -93
  116. package/dist/KeybindingHint/components/Chord.module.css.js +11 -5
  117. package/dist/KeybindingHint/components/Key.js +49 -66
  118. package/dist/KeybindingHint/components/Sequence.js +12 -24
  119. package/dist/KeybindingHint/key-names.js +99 -114
  120. package/dist/Label/Label.js +56 -66
  121. package/dist/Label/Label.module.css.js +5 -5
  122. package/dist/Label/index.js +5 -5
  123. package/dist/LabelGroup/LabelGroup.js +260 -344
  124. package/dist/LabelGroup/LabelGroup.module.css.js +12 -5
  125. package/dist/Link/Link.js +31 -47
  126. package/dist/Link/Link.module.css.js +5 -5
  127. package/dist/NavList/NavList.js +424 -614
  128. package/dist/NavList/NavList.module.css.js +5 -5
  129. package/dist/Octicon/Octicon.js +35 -37
  130. package/dist/Overlay/Overlay.js +264 -318
  131. package/dist/Overlay/Overlay.module.css.js +8 -5
  132. package/dist/PageHeader/PageHeader.js +579 -823
  133. package/dist/PageHeader/PageHeader.module.css.js +21 -5
  134. package/dist/PageLayout/PageLayout.js +631 -913
  135. package/dist/PageLayout/PageLayout.module.css.js +31 -5
  136. package/dist/PageLayout/paneUtils.js +15 -29
  137. package/dist/PageLayout/usePaneWidth.js +334 -437
  138. package/dist/Pagehead/Pagehead.js +10 -14
  139. package/dist/Pagehead/Pagehead.module.css.js +5 -5
  140. package/dist/Pagination/Pagination.js +84 -114
  141. package/dist/Pagination/Pagination.module.css.js +9 -5
  142. package/dist/Pagination/index.js +5 -5
  143. package/dist/Pagination/model.js +118 -194
  144. package/dist/Popover/Popover.js +126 -151
  145. package/dist/Popover/Popover.module.css.js +8 -5
  146. package/dist/Portal/Portal.js +65 -85
  147. package/dist/Portal/index.js +5 -6
  148. package/dist/ProgressBar/ProgressBar.js +210 -255
  149. package/dist/ProgressBar/ProgressBar.module.css.js +9 -5
  150. package/dist/ProgressBar/index.js +6 -8
  151. package/dist/Radio/Radio.js +97 -115
  152. package/dist/Radio/Radio.module.css.js +5 -5
  153. package/dist/RadioGroup/RadioGroup.js +99 -118
  154. package/dist/RelativeTime/RelativeTime.js +64 -76
  155. package/dist/ScrollableRegion/ScrollableRegion.js +67 -79
  156. package/dist/ScrollableRegion/ScrollableRegion.module.css.js +5 -5
  157. package/dist/SegmentedControl/SegmentedControl.js +238 -287
  158. package/dist/SegmentedControl/SegmentedControl.module.css.js +15 -5
  159. package/dist/SegmentedControl/SegmentedControlButton.js +156 -187
  160. package/dist/SegmentedControl/SegmentedControlIconButton.js +133 -161
  161. package/dist/Select/Select.js +185 -234
  162. package/dist/Select/Select.module.css.js +10 -5
  163. package/dist/SelectPanel/SelectPanel.js +620 -828
  164. package/dist/SelectPanel/SelectPanel.module.css.js +27 -5
  165. package/dist/SelectPanel/SelectPanelMessage.js +37 -39
  166. package/dist/SideNav.js +24 -47
  167. package/dist/SideNav.module.css.js +12 -5
  168. package/dist/Skeleton/SkeletonBox.js +94 -111
  169. package/dist/Skeleton/SkeletonBox.module.css.js +8 -5
  170. package/dist/SkeletonAvatar/SkeletonAvatar.js +95 -120
  171. package/dist/SkeletonAvatar/SkeletonAvatar.module.css.js +5 -5
  172. package/dist/SkeletonText/SkeletonText.js +114 -137
  173. package/dist/SkeletonText/SkeletonText.module.css.js +8 -5
  174. package/dist/Spinner/Spinner.js +183 -211
  175. package/dist/Spinner/Spinner.module.css.js +9 -5
  176. package/dist/SplitPageLayout/SplitPageLayout.js +215 -276
  177. package/dist/Stack/Stack.js +207 -255
  178. package/dist/Stack/Stack.module.css.js +8 -5
  179. package/dist/Stack/index.js +4 -6
  180. package/dist/StateLabel/StateLabel.js +110 -123
  181. package/dist/StateLabel/StateLabel.module.css.js +8 -5
  182. package/dist/SubNav/SubNav.js +159 -197
  183. package/dist/SubNav/SubNav.module.css.js +11 -5
  184. package/dist/TabNav/TabNav.js +167 -199
  185. package/dist/TabNav/TabNav.module.css.js +10 -5
  186. package/dist/Text/Text.js +56 -67
  187. package/dist/Text/Text.module.css.js +5 -5
  188. package/dist/TextInput/TextInput.js +195 -228
  189. package/dist/TextInput/TextInput.module.css.js +8 -5
  190. package/dist/TextInputWithTokens/TextInputWithTokens.js +567 -673
  191. package/dist/TextInputWithTokens/TextInputWithTokens.module.css.js +14 -5
  192. package/dist/Textarea/TextArea.module.css.js +9 -5
  193. package/dist/Textarea/Textarea.js +264 -294
  194. package/dist/ThemeProvider.js +199 -257
  195. package/dist/Timeline/Timeline.js +204 -247
  196. package/dist/Timeline/Timeline.module.css.js +12 -5
  197. package/dist/ToggleSwitch/ToggleSwitch.js +403 -471
  198. package/dist/ToggleSwitch/ToggleSwitch.module.css.js +16 -5
  199. package/dist/Token/IssueLabelToken.js +256 -297
  200. package/dist/Token/IssueLabelToken.module.css.js +8 -5
  201. package/dist/Token/Token.js +232 -280
  202. package/dist/Token/Token.module.css.js +9 -5
  203. package/dist/Token/TokenBase.js +99 -126
  204. package/dist/Token/TokenBase.module.css.js +5 -5
  205. package/dist/Token/_RemoveTokenButton.js +27 -48
  206. package/dist/Token/_RemoveTokenButton.module.css.js +5 -5
  207. package/dist/Token/_TokenTextContainer.js +54 -65
  208. package/dist/Token/_TokenTextContainer.module.css.js +5 -5
  209. package/dist/Tooltip/Tooltip.js +49 -56
  210. package/dist/Tooltip/Tooltip.module.css.js +20 -5
  211. package/dist/TooltipV2/Tooltip.js +222 -305
  212. package/dist/TooltipV2/Tooltip.module.css.js +11 -5
  213. package/dist/TopicTag/TopicTag.js +46 -55
  214. package/dist/TopicTag/TopicTag.module.css.js +5 -5
  215. package/dist/TopicTag/TopicTagGroup.js +40 -48
  216. package/dist/TopicTag/TopicTagGroup.module.css.js +5 -5
  217. package/dist/TopicTag/index.js +5 -7
  218. package/dist/TreeView/TreeView.js +1082 -1414
  219. package/dist/TreeView/TreeView.module.css.js +24 -5
  220. package/dist/TreeView/shared.js +10 -9
  221. package/dist/TreeView/useRovingTabIndex.js +129 -203
  222. package/dist/TreeView/useTreeItemCache.js +64 -79
  223. package/dist/TreeView/useTypeahead.js +90 -112
  224. package/dist/Truncate/Truncate.js +21 -33
  225. package/dist/Truncate/Truncate.module.css.js +5 -5
  226. package/dist/UnderlineNav/UnderlineNav.js +278 -375
  227. package/dist/UnderlineNav/UnderlineNav.module.css.js +8 -5
  228. package/dist/UnderlineNav/UnderlineNavContext.js +8 -8
  229. package/dist/UnderlineNav/UnderlineNavItem.js +56 -72
  230. package/dist/UnderlineNav/UnderlineNavItem.module.css.js +5 -5
  231. package/dist/UnderlineNav/index.js +5 -7
  232. package/dist/UnderlineNav/styles.js +11 -15
  233. package/dist/VisuallyHidden/VisuallyHidden.js +51 -49
  234. package/dist/VisuallyHidden/VisuallyHidden.module.css.js +5 -5
  235. package/dist/_VisuallyHidden.js +50 -62
  236. package/dist/_VisuallyHidden.module.css.js +5 -5
  237. package/dist/deprecated/ActionList/Divider.js +23 -23
  238. package/dist/deprecated/ActionList/Divider.module.css.js +5 -5
  239. package/dist/deprecated/ActionList/Group.js +43 -50
  240. package/dist/deprecated/ActionList/Header.js +69 -81
  241. package/dist/deprecated/ActionList/Header.module.css.js +5 -5
  242. package/dist/deprecated/ActionList/Item.js +308 -352
  243. package/dist/deprecated/ActionList/Item.module.css.js +18 -5
  244. package/dist/deprecated/ActionList/List.js +157 -196
  245. package/dist/deprecated/ActionList/List.module.css.js +5 -5
  246. package/dist/deprecated/ActionList/index.js +14 -14
  247. package/dist/deprecated/ActionMenu.js +159 -190
  248. package/dist/deprecated/DialogV1/Dialog.js +166 -200
  249. package/dist/deprecated/DialogV1/Dialog.module.css.js +11 -5
  250. package/dist/deprecated/FilteredSearch/FilteredSearch.js +43 -51
  251. package/dist/deprecated/FilteredSearch/FilteredSearch.module.css.js +5 -5
  252. package/dist/deprecated/UnderlineNav/UnderlineNav.js +132 -160
  253. package/dist/deprecated/UnderlineNav/UnderlineNav.module.css.js +14 -5
  254. package/dist/deprecated/index.js +20 -9
  255. package/dist/experimental/IssueLabel/IssueLabel.js +134 -158
  256. package/dist/experimental/IssueLabel/IssueLabel.module.css.js +5 -5
  257. package/dist/experimental/SelectPanel2/SelectPanel.js +419 -567
  258. package/dist/experimental/SelectPanel2/SelectPanel.module.css.js +32 -5
  259. package/dist/experimental/Tabs/Tabs.js +234 -297
  260. package/dist/experimental/UnderlinePanels/UnderlinePanels.js +165 -215
  261. package/dist/experimental/UnderlinePanels/UnderlinePanels.module.css.js +5 -5
  262. package/dist/experimental/index.js +44 -33
  263. package/dist/hooks/useAnchoredPosition.d.ts +0 -6
  264. package/dist/hooks/useAnchoredPosition.d.ts.map +1 -1
  265. package/dist/hooks/useAnchoredPosition.js +123 -130
  266. package/dist/hooks/useControllableState.js +34 -59
  267. package/dist/hooks/useDetails.js +84 -99
  268. package/dist/hooks/useDialog.js +140 -178
  269. package/dist/hooks/useFocusTrap.js +57 -71
  270. package/dist/hooks/useFocusZone.js +32 -38
  271. package/dist/hooks/useId.js +14 -16
  272. package/dist/hooks/useIsMacOS.js +21 -26
  273. package/dist/hooks/useMedia.js +54 -68
  274. package/dist/hooks/useMenuInitialFocus.js +65 -62
  275. package/dist/hooks/useMenuKeyboardNavigation.js +129 -126
  276. package/dist/hooks/useMergedRefs.js +63 -78
  277. package/dist/hooks/useMnemonics.js +77 -107
  278. package/dist/hooks/useOnEscapePress.js +45 -56
  279. package/dist/hooks/useOnOutsideClick.js +32 -63
  280. package/dist/hooks/useOpenAndCloseFocus.js +40 -43
  281. package/dist/hooks/useOverflow.js +32 -36
  282. package/dist/hooks/useOverlay.js +56 -75
  283. package/dist/hooks/useProvidedRefOrCreate.js +24 -24
  284. package/dist/hooks/useProvidedStateOrCreate.js +33 -39
  285. package/dist/hooks/useRefObjectAsForwardedRef.js +30 -32
  286. package/dist/hooks/useRenderForcingRef.js +42 -46
  287. package/dist/hooks/useResizeObserver.js +32 -43
  288. package/dist/hooks/useResponsiveValue.js +37 -57
  289. package/dist/hooks/useSafeTimeout.js +26 -29
  290. package/dist/hooks/useScrollFlash.js +16 -23
  291. package/dist/hooks/useSlots.js +102 -136
  292. package/dist/hooks/useSyncedState.js +31 -37
  293. package/dist/index.js +88 -85
  294. package/dist/internal/components/ButtonReset.js +45 -50
  295. package/dist/internal/components/ButtonReset.module.css.js +5 -5
  296. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.js +79 -105
  297. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.module.css.js +12 -5
  298. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupCaption.js +16 -21
  299. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupContext.js +4 -4
  300. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupLabel.js +26 -35
  301. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupValidation.js +14 -19
  302. package/dist/internal/components/ConditionalWrapper.js +41 -51
  303. package/dist/internal/components/InputLabel.js +92 -113
  304. package/dist/internal/components/InputLabel.module.css.js +8 -5
  305. package/dist/internal/components/InputValidation.js +67 -87
  306. package/dist/internal/components/InputValidation.module.css.js +9 -5
  307. package/dist/internal/components/TextInputInnerAction.js +134 -173
  308. package/dist/internal/components/TextInputInnerAction.module.css.js +9 -5
  309. package/dist/internal/components/TextInputInnerVisualSlot.js +89 -110
  310. package/dist/internal/components/TextInputInnerVisualSlot.module.css.js +11 -5
  311. package/dist/internal/components/TextInputWrapper.js +187 -230
  312. package/dist/internal/components/TextInputWrapper.module.css.js +8 -5
  313. package/dist/internal/components/UnderlineTabbedInterface.js +191 -238
  314. package/dist/internal/components/UnderlineTabbedInterface.module.css.js +11 -5
  315. package/dist/internal/components/UnstyledTextInput.js +40 -47
  316. package/dist/internal/components/UnstyledTextInput.module.css.js +5 -5
  317. package/dist/internal/components/ValidationAnimationContainer.js +55 -66
  318. package/dist/internal/components/ValidationAnimationContainer.module.css.js +8 -5
  319. package/dist/internal/hooks/useEffectCallback.js +35 -38
  320. package/dist/internal/hooks/useEffectOnce.js +23 -25
  321. package/dist/internal/utils/getResponsiveAttributes.js +23 -26
  322. package/dist/internal/utils/hasInteractiveNodes.js +34 -46
  323. package/dist/legacy-theme/ts/color-schemes.js +4250 -4732
  324. package/dist/live-region/Announce.js +144 -183
  325. package/dist/live-region/AriaAlert.js +20 -22
  326. package/dist/live-region/AriaStatus.js +20 -22
  327. package/dist/next/index.js +3 -1
  328. package/dist/test-helpers.js +40 -62
  329. package/dist/theme.js +83 -47
  330. package/dist/utils/character-counter.js +45 -63
  331. package/dist/utils/create-component.js +15 -16
  332. package/dist/utils/descendant-registry.js +182 -218
  333. package/dist/utils/environment.js +7 -7
  334. package/dist/utils/getBreakpointDeclarations.js +9 -10
  335. package/dist/utils/invariant.js +17 -23
  336. package/dist/utils/is-slot.js +10 -11
  337. package/dist/utils/isNumeric.js +3 -3
  338. package/dist/utils/modern-polymorphic.js +12 -20
  339. package/dist/utils/scroll.js +8 -11
  340. package/dist/utils/theme.js +5 -10
  341. package/dist/utils/useIsomorphicLayoutEffect.js +4 -9
  342. package/dist/utils/warning.js +14 -21
  343. package/generated/components.json +9 -9
  344. package/package.json +5 -10
@@ -1,5 +1,14 @@
1
- import './TextInputWithTokens-946ead3e.css';
2
-
3
- var styles = {"TextInputWrapper":"prc-TextInputWithTokens-TextInputWrapper-HAIfc","UnstyledTextInput":"prc-TextInputWithTokens-UnstyledTextInput-XwhBc","InputWrapper":"prc-TextInputWithTokens-InputWrapper-1lXK5","Container":"prc-TextInputWithTokens-Container-dPCL7","OverflowCountSmall":"prc-TextInputWithTokens-OverflowCountSmall-HJUP6","OverflowCountLarge":"prc-TextInputWithTokens-OverflowCountLarge-caBt8","OverflowCountMedium":"prc-TextInputWithTokens-OverflowCountMedium-uq-gt","OverflowCountXLarge":"prc-TextInputWithTokens-OverflowCountXLarge-A-rpJ"};
4
-
5
- export { styles as default };
1
+ import "./TextInputWithTokens-946ead3e.css";
2
+ //#region src/TextInputWithTokens/TextInputWithTokens.module.css.js
3
+ var TextInputWithTokens_module_css_default = {
4
+ "TextInputWrapper": "prc-TextInputWithTokens-TextInputWrapper-HAIfc",
5
+ "UnstyledTextInput": "prc-TextInputWithTokens-UnstyledTextInput-XwhBc",
6
+ "InputWrapper": "prc-TextInputWithTokens-InputWrapper-1lXK5",
7
+ "Container": "prc-TextInputWithTokens-Container-dPCL7",
8
+ "OverflowCountSmall": "prc-TextInputWithTokens-OverflowCountSmall-HJUP6",
9
+ "OverflowCountLarge": "prc-TextInputWithTokens-OverflowCountLarge-caBt8",
10
+ "OverflowCountMedium": "prc-TextInputWithTokens-OverflowCountMedium-uq-gt",
11
+ "OverflowCountXLarge": "prc-TextInputWithTokens-OverflowCountXLarge-A-rpJ"
12
+ };
13
+ //#endregion
14
+ export { TextInputWithTokens_module_css_default as default };
@@ -1,5 +1,9 @@
1
- import './TextArea-53e27580.css';
2
-
3
- var classes = {"TextArea":"prc-Textarea-TextArea-snlco","CharacterCounter":"prc-Textarea-CharacterCounter-qnOXd","CharacterCounter--error":"prc-Textarea-CharacterCounter--error-eewrs"};
4
-
5
- export { classes as default };
1
+ import "./TextArea-53e27580.css";
2
+ //#region src/Textarea/TextArea.module.css.js
3
+ var TextArea_module_css_default = {
4
+ "TextArea": "prc-Textarea-TextArea-snlco",
5
+ "CharacterCounter": "prc-Textarea-CharacterCounter-qnOXd",
6
+ "CharacterCounter--error": "prc-Textarea-CharacterCounter--error-eewrs"
7
+ };
8
+ //#endregion
9
+ export { TextArea_module_css_default as default };
@@ -1,296 +1,266 @@
1
- import { c } from 'react-compiler-runtime';
2
- import React, { useRef, useId, useEffect } from 'react';
3
- import { TextInputBaseWrapper } from '../internal/components/TextInputWrapper.js';
4
- import classes from './TextArea.module.css.js';
5
- import { AlertFillIcon } from '@primer/octicons-react';
6
- import { CharacterCounter } from '../utils/character-counter.js';
7
- import VisuallyHidden from '../_VisuallyHidden.js';
8
- import { clsx } from 'clsx';
9
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
10
- import Text from '../Text/Text.js';
11
-
12
- const DEFAULT_TEXTAREA_ROWS = 7;
13
- const DEFAULT_TEXTAREA_COLS = 30;
14
- const DEFAULT_TEXTAREA_RESIZE = 'both';
1
+ import Text_default from "../Text/Text.js";
2
+ import VisuallyHidden from "../_VisuallyHidden.js";
3
+ import { TextInputBaseWrapper } from "../internal/components/TextInputWrapper.js";
4
+ import { CharacterCounter } from "../utils/character-counter.js";
5
+ import TextArea_module_css_default from "./TextArea.module.css.js";
6
+ import { c } from "react-compiler-runtime";
7
+ import { clsx } from "clsx";
8
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
+ import React, { useEffect, useId, useRef } from "react";
10
+ import { AlertFillIcon } from "@primer/octicons-react";
11
+ const DEFAULT_TEXTAREA_RESIZE = "both";
15
12
  /**
16
- * An accessible, native textarea component that supports validation states.
17
- * This component accepts all native HTML <textarea> attributes as props.
18
- */
19
- const Textarea = /*#__PURE__*/React.forwardRef((t0, ref) => {
20
- const $ = c(68);
21
- let block;
22
- let characterLimit;
23
- let className;
24
- let contrast;
25
- let defaultValue;
26
- let disabled;
27
- let maxHeight;
28
- let minHeight;
29
- let onChange;
30
- let required;
31
- let rest;
32
- let style;
33
- let t1;
34
- let t2;
35
- let t3;
36
- let validationStatus;
37
- let value;
38
- if ($[0] !== t0) {
39
- ({
40
- value,
41
- disabled,
42
- required,
43
- validationStatus,
44
- rows: t1,
45
- cols: t2,
46
- resize: t3,
47
- block,
48
- contrast,
49
- className,
50
- minHeight,
51
- maxHeight,
52
- style,
53
- characterLimit,
54
- onChange,
55
- defaultValue,
56
- ...rest
57
- } = t0);
58
- $[0] = t0;
59
- $[1] = block;
60
- $[2] = characterLimit;
61
- $[3] = className;
62
- $[4] = contrast;
63
- $[5] = defaultValue;
64
- $[6] = disabled;
65
- $[7] = maxHeight;
66
- $[8] = minHeight;
67
- $[9] = onChange;
68
- $[10] = required;
69
- $[11] = rest;
70
- $[12] = style;
71
- $[13] = t1;
72
- $[14] = t2;
73
- $[15] = t3;
74
- $[16] = validationStatus;
75
- $[17] = value;
76
- } else {
77
- block = $[1];
78
- characterLimit = $[2];
79
- className = $[3];
80
- contrast = $[4];
81
- defaultValue = $[5];
82
- disabled = $[6];
83
- maxHeight = $[7];
84
- minHeight = $[8];
85
- onChange = $[9];
86
- required = $[10];
87
- rest = $[11];
88
- style = $[12];
89
- t1 = $[13];
90
- t2 = $[14];
91
- t3 = $[15];
92
- validationStatus = $[16];
93
- value = $[17];
94
- }
95
- const rows = t1 === undefined ? DEFAULT_TEXTAREA_ROWS : t1;
96
- const cols = t2 === undefined ? DEFAULT_TEXTAREA_COLS : t2;
97
- const resize = t3 === undefined ? DEFAULT_TEXTAREA_RESIZE : t3;
98
- const [characterCount, setCharacterCount] = React.useState("");
99
- const [isOverLimit, setIsOverLimit] = React.useState(false);
100
- const [screenReaderMessage, setScreenReaderMessage] = React.useState("");
101
- const characterCounterRef = useRef(null);
102
- const characterCountId = useId();
103
- const characterCountStaticMessageId = useId();
104
- let t4;
105
- let t5;
106
- if ($[18] !== characterLimit) {
107
- t4 = () => {
108
- if (characterLimit) {
109
- characterCounterRef.current = new CharacterCounter({
110
- onCountUpdate: (count, overLimit, message) => {
111
- setCharacterCount(message);
112
- setIsOverLimit(overLimit);
113
- },
114
- onScreenReaderAnnounce: message_0 => {
115
- setScreenReaderMessage(message_0);
116
- }
117
- });
118
- return () => {
119
- var _characterCounterRef$;
120
- (_characterCounterRef$ = characterCounterRef.current) === null || _characterCounterRef$ === void 0 ? void 0 : _characterCounterRef$.cleanup();
121
- };
122
- }
123
- };
124
- t5 = [characterLimit];
125
- $[18] = characterLimit;
126
- $[19] = t4;
127
- $[20] = t5;
128
- } else {
129
- t4 = $[19];
130
- t5 = $[20];
131
- }
132
- useEffect(t4, t5);
133
- let t6;
134
- let t7;
135
- if ($[21] !== characterLimit || $[22] !== defaultValue || $[23] !== value) {
136
- t6 = () => {
137
- if (characterLimit && characterCounterRef.current) {
138
- const currentValue = value !== undefined ? String(value) : defaultValue !== undefined ? String(defaultValue) : "";
139
- characterCounterRef.current.updateCharacterCount(currentValue.length, characterLimit);
140
- }
141
- };
142
- t7 = [value, defaultValue, characterLimit];
143
- $[21] = characterLimit;
144
- $[22] = defaultValue;
145
- $[23] = value;
146
- $[24] = t6;
147
- $[25] = t7;
148
- } else {
149
- t6 = $[24];
150
- t7 = $[25];
151
- }
152
- useEffect(t6, t7);
153
- let t8;
154
- if ($[26] !== characterLimit || $[27] !== onChange) {
155
- t8 = e => {
156
- var _onChange;
157
- if (characterLimit && characterCounterRef.current) {
158
- characterCounterRef.current.updateCharacterCount(e.target.value.length, characterLimit);
159
- }
160
- (_onChange = onChange) === null || _onChange === void 0 ? void 0 : _onChange(e);
161
- };
162
- $[26] = characterLimit;
163
- $[27] = onChange;
164
- $[28] = t8;
165
- } else {
166
- t8 = $[28];
167
- }
168
- const handleTextareaChange = t8;
169
- const isValid = isOverLimit ? "error" : validationStatus;
170
- const t9 = isValid === "error" ? "true" : "false";
171
- let t10;
172
- if ($[29] !== maxHeight || $[30] !== minHeight || $[31] !== style) {
173
- t10 = {
174
- minHeight,
175
- maxHeight,
176
- ...style
177
- };
178
- $[29] = maxHeight;
179
- $[30] = minHeight;
180
- $[31] = style;
181
- $[32] = t10;
182
- } else {
183
- t10 = $[32];
184
- }
185
- let t11;
186
- if ($[33] !== characterCountStaticMessageId || $[34] !== characterLimit || $[35] !== rest) {
187
- t11 = characterLimit ? [characterCountStaticMessageId, rest["aria-describedby"]].filter(Boolean).join(" ") || undefined : rest["aria-describedby"];
188
- $[33] = characterCountStaticMessageId;
189
- $[34] = characterLimit;
190
- $[35] = rest;
191
- $[36] = t11;
192
- } else {
193
- t11 = $[36];
194
- }
195
- let t12;
196
- if ($[37] !== cols || $[38] !== defaultValue || $[39] !== disabled || $[40] !== handleTextareaChange || $[41] !== ref || $[42] !== required || $[43] !== resize || $[44] !== rest || $[45] !== rows || $[46] !== t10 || $[47] !== t11 || $[48] !== t9 || $[49] !== value) {
197
- t12 = /*#__PURE__*/jsx("textarea", {
198
- value: value,
199
- defaultValue: defaultValue,
200
- "data-resize": resize,
201
- "aria-required": required,
202
- "aria-invalid": t9,
203
- ref: ref,
204
- disabled: disabled,
205
- rows: rows,
206
- cols: cols,
207
- className: classes.TextArea,
208
- onChange: handleTextareaChange,
209
- style: t10,
210
- ...rest,
211
- "aria-describedby": t11
212
- });
213
- $[37] = cols;
214
- $[38] = defaultValue;
215
- $[39] = disabled;
216
- $[40] = handleTextareaChange;
217
- $[41] = ref;
218
- $[42] = required;
219
- $[43] = resize;
220
- $[44] = rest;
221
- $[45] = rows;
222
- $[46] = t10;
223
- $[47] = t11;
224
- $[48] = t9;
225
- $[49] = value;
226
- $[50] = t12;
227
- } else {
228
- t12 = $[50];
229
- }
230
- let t13;
231
- if ($[51] !== block || $[52] !== className || $[53] !== contrast || $[54] !== disabled || $[55] !== isValid || $[56] !== t12) {
232
- t13 = /*#__PURE__*/jsx(TextInputBaseWrapper, {
233
- validationStatus: isValid,
234
- disabled: disabled,
235
- block: block,
236
- contrast: contrast,
237
- className: className,
238
- children: t12
239
- });
240
- $[51] = block;
241
- $[52] = className;
242
- $[53] = contrast;
243
- $[54] = disabled;
244
- $[55] = isValid;
245
- $[56] = t12;
246
- $[57] = t13;
247
- } else {
248
- t13 = $[57];
249
- }
250
- let t14;
251
- if ($[58] !== characterCount || $[59] !== characterCountId || $[60] !== characterCountStaticMessageId || $[61] !== characterLimit || $[62] !== isOverLimit || $[63] !== screenReaderMessage) {
252
- t14 = characterLimit && /*#__PURE__*/jsxs(Fragment, {
253
- children: [/*#__PURE__*/jsx(VisuallyHidden, {
254
- "aria-live": "polite",
255
- role: "status",
256
- children: screenReaderMessage
257
- }), /*#__PURE__*/jsxs(VisuallyHidden, {
258
- id: characterCountStaticMessageId,
259
- children: ["You can enter up to ", characterLimit, " ", characterLimit === 1 ? "character" : "characters"]
260
- }), /*#__PURE__*/jsxs(Text, {
261
- "aria-hidden": "true",
262
- id: characterCountId,
263
- size: "small",
264
- className: clsx(classes.CharacterCounter, isOverLimit && classes["CharacterCounter--error"]),
265
- children: [isOverLimit && /*#__PURE__*/jsx(AlertFillIcon, {
266
- size: 16
267
- }), characterCount]
268
- })]
269
- });
270
- $[58] = characterCount;
271
- $[59] = characterCountId;
272
- $[60] = characterCountStaticMessageId;
273
- $[61] = characterLimit;
274
- $[62] = isOverLimit;
275
- $[63] = screenReaderMessage;
276
- $[64] = t14;
277
- } else {
278
- t14 = $[64];
279
- }
280
- let t15;
281
- if ($[65] !== t13 || $[66] !== t14) {
282
- t15 = /*#__PURE__*/jsxs(Fragment, {
283
- children: [t13, t14]
284
- });
285
- $[65] = t13;
286
- $[66] = t14;
287
- $[67] = t15;
288
- } else {
289
- t15 = $[67];
290
- }
291
- return t15;
13
+ * An accessible, native textarea component that supports validation states.
14
+ * This component accepts all native HTML <textarea> attributes as props.
15
+ */
16
+ const Textarea = /* @__PURE__ */ React.forwardRef((t0, ref) => {
17
+ const $ = c(68);
18
+ let block;
19
+ let characterLimit;
20
+ let className;
21
+ let contrast;
22
+ let defaultValue;
23
+ let disabled;
24
+ let maxHeight;
25
+ let minHeight;
26
+ let onChange;
27
+ let required;
28
+ let rest;
29
+ let style;
30
+ let t1;
31
+ let t2;
32
+ let t3;
33
+ let validationStatus;
34
+ let value;
35
+ if ($[0] !== t0) {
36
+ ({value, disabled, required, validationStatus, rows: t1, cols: t2, resize: t3, block, contrast, className, minHeight, maxHeight, style, characterLimit, onChange, defaultValue, ...rest} = t0);
37
+ $[0] = t0;
38
+ $[1] = block;
39
+ $[2] = characterLimit;
40
+ $[3] = className;
41
+ $[4] = contrast;
42
+ $[5] = defaultValue;
43
+ $[6] = disabled;
44
+ $[7] = maxHeight;
45
+ $[8] = minHeight;
46
+ $[9] = onChange;
47
+ $[10] = required;
48
+ $[11] = rest;
49
+ $[12] = style;
50
+ $[13] = t1;
51
+ $[14] = t2;
52
+ $[15] = t3;
53
+ $[16] = validationStatus;
54
+ $[17] = value;
55
+ } else {
56
+ block = $[1];
57
+ characterLimit = $[2];
58
+ className = $[3];
59
+ contrast = $[4];
60
+ defaultValue = $[5];
61
+ disabled = $[6];
62
+ maxHeight = $[7];
63
+ minHeight = $[8];
64
+ onChange = $[9];
65
+ required = $[10];
66
+ rest = $[11];
67
+ style = $[12];
68
+ t1 = $[13];
69
+ t2 = $[14];
70
+ t3 = $[15];
71
+ validationStatus = $[16];
72
+ value = $[17];
73
+ }
74
+ const rows = t1 === void 0 ? 7 : t1;
75
+ const cols = t2 === void 0 ? 30 : t2;
76
+ const resize = t3 === void 0 ? DEFAULT_TEXTAREA_RESIZE : t3;
77
+ const [characterCount, setCharacterCount] = React.useState("");
78
+ const [isOverLimit, setIsOverLimit] = React.useState(false);
79
+ const [screenReaderMessage, setScreenReaderMessage] = React.useState("");
80
+ const characterCounterRef = useRef(null);
81
+ const characterCountId = useId();
82
+ const characterCountStaticMessageId = useId();
83
+ let t4;
84
+ let t5;
85
+ if ($[18] !== characterLimit) {
86
+ t4 = () => {
87
+ if (characterLimit) {
88
+ characterCounterRef.current = new CharacterCounter({
89
+ onCountUpdate: (count, overLimit, message) => {
90
+ setCharacterCount(message);
91
+ setIsOverLimit(overLimit);
92
+ },
93
+ onScreenReaderAnnounce: (message_0) => {
94
+ setScreenReaderMessage(message_0);
95
+ }
96
+ });
97
+ return () => {
98
+ var _characterCounterRef$;
99
+ (_characterCounterRef$ = characterCounterRef.current) === null || _characterCounterRef$ === void 0 || _characterCounterRef$.cleanup();
100
+ };
101
+ }
102
+ };
103
+ t5 = [characterLimit];
104
+ $[18] = characterLimit;
105
+ $[19] = t4;
106
+ $[20] = t5;
107
+ } else {
108
+ t4 = $[19];
109
+ t5 = $[20];
110
+ }
111
+ useEffect(t4, t5);
112
+ let t6;
113
+ let t7;
114
+ if ($[21] !== characterLimit || $[22] !== defaultValue || $[23] !== value) {
115
+ t6 = () => {
116
+ if (characterLimit && characterCounterRef.current) {
117
+ const currentValue = value !== void 0 ? String(value) : defaultValue !== void 0 ? String(defaultValue) : "";
118
+ characterCounterRef.current.updateCharacterCount(currentValue.length, characterLimit);
119
+ }
120
+ };
121
+ t7 = [
122
+ value,
123
+ defaultValue,
124
+ characterLimit
125
+ ];
126
+ $[21] = characterLimit;
127
+ $[22] = defaultValue;
128
+ $[23] = value;
129
+ $[24] = t6;
130
+ $[25] = t7;
131
+ } else {
132
+ t6 = $[24];
133
+ t7 = $[25];
134
+ }
135
+ useEffect(t6, t7);
136
+ let t8;
137
+ if ($[26] !== characterLimit || $[27] !== onChange) {
138
+ t8 = (e) => {
139
+ var _onChange;
140
+ if (characterLimit && characterCounterRef.current) characterCounterRef.current.updateCharacterCount(e.target.value.length, characterLimit);
141
+ (_onChange = onChange) === null || _onChange === void 0 || _onChange(e);
142
+ };
143
+ $[26] = characterLimit;
144
+ $[27] = onChange;
145
+ $[28] = t8;
146
+ } else t8 = $[28];
147
+ const handleTextareaChange = t8;
148
+ const isValid = isOverLimit ? "error" : validationStatus;
149
+ const t9 = isValid === "error" ? "true" : "false";
150
+ let t10;
151
+ if ($[29] !== maxHeight || $[30] !== minHeight || $[31] !== style) {
152
+ t10 = {
153
+ minHeight,
154
+ maxHeight,
155
+ ...style
156
+ };
157
+ $[29] = maxHeight;
158
+ $[30] = minHeight;
159
+ $[31] = style;
160
+ $[32] = t10;
161
+ } else t10 = $[32];
162
+ let t11;
163
+ if ($[33] !== characterCountStaticMessageId || $[34] !== characterLimit || $[35] !== rest) {
164
+ t11 = characterLimit ? [characterCountStaticMessageId, rest["aria-describedby"]].filter(Boolean).join(" ") || void 0 : rest["aria-describedby"];
165
+ $[33] = characterCountStaticMessageId;
166
+ $[34] = characterLimit;
167
+ $[35] = rest;
168
+ $[36] = t11;
169
+ } else t11 = $[36];
170
+ let t12;
171
+ if ($[37] !== cols || $[38] !== defaultValue || $[39] !== disabled || $[40] !== handleTextareaChange || $[41] !== ref || $[42] !== required || $[43] !== resize || $[44] !== rest || $[45] !== rows || $[46] !== t10 || $[47] !== t11 || $[48] !== t9 || $[49] !== value) {
172
+ t12 = /* @__PURE__ */ jsx("textarea", {
173
+ value,
174
+ defaultValue,
175
+ "data-resize": resize,
176
+ "aria-required": required,
177
+ "aria-invalid": t9,
178
+ ref,
179
+ disabled,
180
+ rows,
181
+ cols,
182
+ className: TextArea_module_css_default.TextArea,
183
+ onChange: handleTextareaChange,
184
+ style: t10,
185
+ ...rest,
186
+ "aria-describedby": t11
187
+ });
188
+ $[37] = cols;
189
+ $[38] = defaultValue;
190
+ $[39] = disabled;
191
+ $[40] = handleTextareaChange;
192
+ $[41] = ref;
193
+ $[42] = required;
194
+ $[43] = resize;
195
+ $[44] = rest;
196
+ $[45] = rows;
197
+ $[46] = t10;
198
+ $[47] = t11;
199
+ $[48] = t9;
200
+ $[49] = value;
201
+ $[50] = t12;
202
+ } else t12 = $[50];
203
+ let t13;
204
+ if ($[51] !== block || $[52] !== className || $[53] !== contrast || $[54] !== disabled || $[55] !== isValid || $[56] !== t12) {
205
+ t13 = /* @__PURE__ */ jsx(TextInputBaseWrapper, {
206
+ validationStatus: isValid,
207
+ disabled,
208
+ block,
209
+ contrast,
210
+ className,
211
+ children: t12
212
+ });
213
+ $[51] = block;
214
+ $[52] = className;
215
+ $[53] = contrast;
216
+ $[54] = disabled;
217
+ $[55] = isValid;
218
+ $[56] = t12;
219
+ $[57] = t13;
220
+ } else t13 = $[57];
221
+ let t14;
222
+ if ($[58] !== characterCount || $[59] !== characterCountId || $[60] !== characterCountStaticMessageId || $[61] !== characterLimit || $[62] !== isOverLimit || $[63] !== screenReaderMessage) {
223
+ t14 = characterLimit && /* @__PURE__ */ jsxs(Fragment, { children: [
224
+ /* @__PURE__ */ jsx(VisuallyHidden, {
225
+ "aria-live": "polite",
226
+ role: "status",
227
+ children: screenReaderMessage
228
+ }),
229
+ /* @__PURE__ */ jsxs(VisuallyHidden, {
230
+ id: characterCountStaticMessageId,
231
+ children: [
232
+ "You can enter up to ",
233
+ characterLimit,
234
+ " ",
235
+ characterLimit === 1 ? "character" : "characters"
236
+ ]
237
+ }),
238
+ /* @__PURE__ */ jsxs(Text_default, {
239
+ "aria-hidden": "true",
240
+ id: characterCountId,
241
+ size: "small",
242
+ className: clsx(TextArea_module_css_default.CharacterCounter, isOverLimit && TextArea_module_css_default["CharacterCounter--error"]),
243
+ children: [isOverLimit && /* @__PURE__ */ jsx(AlertFillIcon, { size: 16 }), characterCount]
244
+ })
245
+ ] });
246
+ $[58] = characterCount;
247
+ $[59] = characterCountId;
248
+ $[60] = characterCountStaticMessageId;
249
+ $[61] = characterLimit;
250
+ $[62] = isOverLimit;
251
+ $[63] = screenReaderMessage;
252
+ $[64] = t14;
253
+ } else t14 = $[64];
254
+ let t15;
255
+ if ($[65] !== t13 || $[66] !== t14) {
256
+ t15 = /* @__PURE__ */ jsxs(Fragment, { children: [t13, t14] });
257
+ $[65] = t13;
258
+ $[66] = t14;
259
+ $[67] = t15;
260
+ } else t15 = $[67];
261
+ return t15;
292
262
  });
293
- Textarea.displayName = 'Textarea';
294
- Textarea.__SLOT__ = Symbol('Textarea');
295
-
296
- export { DEFAULT_TEXTAREA_COLS, DEFAULT_TEXTAREA_RESIZE, DEFAULT_TEXTAREA_ROWS, Textarea as default };
263
+ Textarea.displayName = "Textarea";
264
+ Textarea.__SLOT__ = Symbol("Textarea");
265
+ //#endregion
266
+ export { Textarea as default };