@primer/react-brand 0.72.0-rc.c1f51647 → 0.72.0-rc.f8b72452

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 (434) hide show
  1. package/docs/components/River/react.md +12 -45
  2. package/docs/components/RiverBreakoutTabs/index.md +3 -4
  3. package/docs/index.md +2 -2
  4. package/esm/forms/Checkbox/Checkbox.d.ts +1 -0
  5. package/esm/forms/Checkbox/Checkbox.d.ts.map +1 -1
  6. package/esm/forms/Checkbox/Checkbox.js +1 -0
  7. package/esm/forms/Checkbox/Checkbox.js.map +1 -1
  8. package/esm/forms/FormControl/FormControl.d.ts +1 -0
  9. package/esm/forms/FormControl/FormControl.d.ts.map +1 -1
  10. package/esm/forms/FormControl/FormControl.js +1 -0
  11. package/esm/forms/FormControl/FormControl.js.map +1 -1
  12. package/esm/forms/Radio/Radio.d.ts +1 -0
  13. package/esm/forms/Radio/Radio.d.ts.map +1 -1
  14. package/esm/forms/Radio/Radio.js +1 -0
  15. package/esm/forms/Radio/Radio.js.map +1 -1
  16. package/esm/forms/Select/Select.d.ts +1 -0
  17. package/esm/forms/Select/Select.d.ts.map +1 -1
  18. package/esm/forms/Select/Select.js +1 -0
  19. package/esm/forms/Select/Select.js.map +1 -1
  20. package/esm/forms/TextInput/TextInput.d.ts +1 -0
  21. package/esm/forms/TextInput/TextInput.d.ts.map +1 -1
  22. package/esm/forms/TextInput/TextInput.js +1 -0
  23. package/esm/forms/TextInput/TextInput.js.map +1 -1
  24. package/esm/forms/Textarea/Textarea.d.ts +1 -0
  25. package/esm/forms/Textarea/Textarea.d.ts.map +1 -1
  26. package/esm/forms/Textarea/Textarea.js +1 -0
  27. package/esm/forms/Textarea/Textarea.js.map +1 -1
  28. package/esm/forms/index.d.ts +0 -4
  29. package/esm/forms/index.d.ts.map +1 -1
  30. package/esm/hooks/useFocusTrap.d.ts +8 -8
  31. package/esm/hooks/useFocusTrap.d.ts.map +1 -1
  32. package/esm/hooks/useFocusTrap.js +16 -16
  33. package/esm/hooks/useFocusTrap.js.map +1 -1
  34. package/esm/index.d.ts +1 -0
  35. package/esm/index.d.ts.map +1 -1
  36. package/esm/index.esm.js +51 -50
  37. package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes-C05YPRXo.css +1 -0
  38. package/esm/river/River/River.d.ts +0 -6
  39. package/esm/river/River/River.d.ts.map +1 -1
  40. package/esm/river/River/River.js +6 -6
  41. package/esm/river/River/River.js.map +1 -1
  42. package/esm/river/RiverAccordion/RiverAccordion.module-BTU_metB.css +1 -0
  43. package/esm/river/RiverAccordion/RiverAccordion.module.js +1 -1
  44. package/esm/river/RiverAccordion/RiverAccordion.module.js.map +1 -1
  45. package/esm/river/RiverBreakout/RiverBreakout.d.ts +2 -1
  46. package/esm/river/RiverBreakout/RiverBreakout.d.ts.map +1 -1
  47. package/esm/river/RiverBreakout/RiverBreakout.js +20 -16
  48. package/esm/river/RiverBreakout/RiverBreakout.js.map +1 -1
  49. package/esm/river/RiverBreakoutTabs/RiverBreakoutTabs.d.ts +1 -0
  50. package/esm/river/RiverBreakoutTabs/RiverBreakoutTabs.d.ts.map +1 -1
  51. package/esm/river/RiverBreakoutTabs/RiverBreakoutTabs.js.map +1 -1
  52. package/esm/river/river-shared.module-Bf_bNlTd.css +1 -0
  53. package/esm/river/river-shared.module.js +1 -1
  54. package/esm/river/river-shared.module.js.map +1 -1
  55. package/lib/css/main.css +181 -155
  56. package/lib/design-tokens/css/tokens/base/colors/color-scales-with-modes.css +1 -1
  57. package/lib/design-tokens/css/tokens/base/colors/light.css +1 -1
  58. package/lib/design-tokens/css/tokens/base/size/size.css +1 -1
  59. package/lib/design-tokens/css/tokens/base/typography/typography.css +1 -1
  60. package/lib/design-tokens/css/tokens/functional/animation/base.css +1 -1
  61. package/lib/design-tokens/css/tokens/functional/colors/global-with-modes.css +1 -1
  62. package/lib/design-tokens/css/tokens/functional/colors/global.css +1 -1
  63. package/lib/design-tokens/css/tokens/functional/components/accordion/colors-with-modes.css +1 -1
  64. package/lib/design-tokens/css/tokens/functional/components/action-menu/colors-with-modes.css +1 -1
  65. package/lib/design-tokens/css/tokens/functional/components/anchor-nav/colors-with-modes.css +1 -1
  66. package/lib/design-tokens/css/tokens/functional/components/bento/base.css +1 -1
  67. package/lib/design-tokens/css/tokens/functional/components/blinking-cursor/colors-with-modes.css +1 -1
  68. package/lib/design-tokens/css/tokens/functional/components/breadcrumbs/colors-with-modes.css +1 -1
  69. package/lib/design-tokens/css/tokens/functional/components/button/colors-with-modes.css +1 -1
  70. package/lib/design-tokens/css/tokens/functional/components/card/base.css +1 -1
  71. package/lib/design-tokens/css/tokens/functional/components/card/colors-with-modes.css +1 -1
  72. package/lib/design-tokens/css/tokens/functional/components/card/colors.css +1 -1
  73. package/lib/design-tokens/css/tokens/functional/components/comparison-table/colors-with-modes.css +1 -1
  74. package/lib/design-tokens/css/tokens/functional/components/comparison-table/comparison-table.css +1 -1
  75. package/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes.css +1 -1
  76. package/lib/design-tokens/css/tokens/functional/components/cta-banner/colors-with-modes.css +1 -1
  77. package/lib/design-tokens/css/tokens/functional/components/eyebrow-banner/colors-with-modes.css +1 -1
  78. package/lib/design-tokens/css/tokens/functional/components/eyebrow-banner/eyebrow-banner.css +1 -1
  79. package/lib/design-tokens/css/tokens/functional/components/faq/base.css +1 -1
  80. package/lib/design-tokens/css/tokens/functional/components/faq/colors-with-modes.css +1 -1
  81. package/lib/design-tokens/css/tokens/functional/components/faq/colors.css +1 -1
  82. package/lib/design-tokens/css/tokens/functional/components/faq/faq.css +1 -1
  83. package/lib/design-tokens/css/tokens/functional/components/footer/colors-with-modes.css +1 -1
  84. package/lib/design-tokens/css/tokens/functional/components/footer/colors.css +1 -1
  85. package/lib/design-tokens/css/tokens/functional/components/frosted-glass-vfx/base.css +1 -1
  86. package/lib/design-tokens/css/tokens/functional/components/frosted-glass-vfx/colors-with-modes.css +1 -1
  87. package/lib/design-tokens/css/tokens/functional/components/grid/colors-with-modes.css +1 -1
  88. package/lib/design-tokens/css/tokens/functional/components/grid/colors.css +1 -1
  89. package/lib/design-tokens/css/tokens/functional/components/grid/grid.css +1 -1
  90. package/lib/design-tokens/css/tokens/functional/components/hero/base.css +1 -1
  91. package/lib/design-tokens/css/tokens/functional/components/icon/colors-with-modes.css +1 -1
  92. package/lib/design-tokens/css/tokens/functional/components/icon/colors.css +1 -1
  93. package/lib/design-tokens/css/tokens/functional/components/ide/base.css +1 -1
  94. package/lib/design-tokens/css/tokens/functional/components/ide/colors-with-modes.css +1 -1
  95. package/lib/design-tokens/css/tokens/functional/components/image/base.css +1 -1
  96. package/lib/design-tokens/css/tokens/functional/components/inline-link/base.css +1 -1
  97. package/lib/design-tokens/css/tokens/functional/components/inline-link/colors-with-modes.css +1 -1
  98. package/lib/design-tokens/css/tokens/functional/components/inline-link/colors.css +1 -1
  99. package/lib/design-tokens/css/tokens/functional/components/label/colors-with-modes.css +1 -1
  100. package/lib/design-tokens/css/tokens/functional/components/label/colors.css +1 -1
  101. package/lib/design-tokens/css/tokens/functional/components/link/colors-with-modes.css +1 -1
  102. package/lib/design-tokens/css/tokens/functional/components/link/colors.css +1 -1
  103. package/lib/design-tokens/css/tokens/functional/components/logosuite/base.css +1 -1
  104. package/lib/design-tokens/css/tokens/functional/components/logosuite/colors-with-modes.css +1 -1
  105. package/lib/design-tokens/css/tokens/functional/components/logosuite/colors.css +1 -1
  106. package/lib/design-tokens/css/tokens/functional/components/media-playlist/colors-with-modes.css +1 -1
  107. package/lib/design-tokens/css/tokens/functional/components/media-playlist/colors.css +1 -1
  108. package/lib/design-tokens/css/tokens/functional/components/nav-list/colors-with-modes.css +1 -1
  109. package/lib/design-tokens/css/tokens/functional/components/pricing-options/colors-with-modes.css +1 -1
  110. package/lib/design-tokens/css/tokens/functional/components/pricing-options/colors.css +1 -1
  111. package/lib/design-tokens/css/tokens/functional/components/pricing-options/pricing-options.css +1 -1
  112. package/lib/design-tokens/css/tokens/functional/components/prose/base.css +1 -1
  113. package/lib/design-tokens/css/tokens/functional/components/prose/colors-with-modes.css +1 -1
  114. package/lib/design-tokens/css/tokens/functional/components/river/base.css +1 -1
  115. package/lib/design-tokens/css/tokens/functional/components/river/river.css +1 -1
  116. package/lib/design-tokens/css/tokens/functional/components/river-story-scroll/colors-with-modes.css +1 -1
  117. package/lib/design-tokens/css/tokens/functional/components/section/section.css +1 -1
  118. package/lib/design-tokens/css/tokens/functional/components/statistic/base.css +1 -1
  119. package/lib/design-tokens/css/tokens/functional/components/sub-nav/base.css +1 -1
  120. package/lib/design-tokens/css/tokens/functional/components/sub-nav/colors-with-modes.css +1 -1
  121. package/lib/design-tokens/css/tokens/functional/components/subdomain-nav-bar/colors-with-modes.css +1 -1
  122. package/lib/design-tokens/css/tokens/functional/components/tabs/base.css +1 -1
  123. package/lib/design-tokens/css/tokens/functional/components/tabs/colors-with-modes.css +1 -1
  124. package/lib/design-tokens/css/tokens/functional/components/tabs/colors.css +1 -1
  125. package/lib/design-tokens/css/tokens/functional/components/testimonial/base.css +1 -1
  126. package/lib/design-tokens/css/tokens/functional/components/testimonial/colors-with-modes.css +1 -1
  127. package/lib/design-tokens/css/tokens/functional/components/testimonial/colors.css +1 -1
  128. package/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/colors-with-modes.css +1 -1
  129. package/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/colors.css +1 -1
  130. package/lib/design-tokens/css/tokens/functional/components/tiles/colors-with-modes.css +1 -1
  131. package/lib/design-tokens/css/tokens/functional/components/timeline/base.css +1 -1
  132. package/lib/design-tokens/css/tokens/functional/components/timeline/colors-with-modes.css +1 -1
  133. package/lib/design-tokens/css/tokens/functional/components/timeline/colors.css +1 -1
  134. package/lib/design-tokens/css/tokens/functional/components/token/colors-with-modes.css +1 -1
  135. package/lib/design-tokens/css/tokens/functional/components/token/colors.css +1 -1
  136. package/lib/design-tokens/css/tokens/functional/components/tooltip/colors-with-modes.css +1 -1
  137. package/lib/design-tokens/css/tokens/functional/components/tooltip/colors.css +1 -1
  138. package/lib/design-tokens/css/tokens/functional/components/video-player/base.css +1 -1
  139. package/lib/design-tokens/css/tokens/functional/components/video-player/colors-with-modes.css +1 -1
  140. package/lib/design-tokens/css/tokens/functional/size/border.css +1 -1
  141. package/lib/design-tokens/css/tokens/functional/size/breakpoints.css +1 -1
  142. package/lib/design-tokens/css/tokens/functional/size/size-coarse.css +1 -1
  143. package/lib/design-tokens/css/tokens/functional/size/size-fine.css +1 -1
  144. package/lib/design-tokens/css/tokens/functional/size/size.css +1 -1
  145. package/lib/design-tokens/css/tokens/functional/size/viewport.css +1 -1
  146. package/lib/design-tokens/css/tokens/functional/typography/typography-responsive.css +1 -1
  147. package/lib/design-tokens/css/tokens/functional/typography/typography.css +1 -1
  148. package/lib/design-tokens/js/module/tokens/base/colors/light.js +1 -1
  149. package/lib/design-tokens/js/module/tokens/base/size/size.js +1 -1
  150. package/lib/design-tokens/js/module/tokens/base/typography/typography.js +1 -1
  151. package/lib/design-tokens/js/module/tokens/functional/animation/base.js +1 -1
  152. package/lib/design-tokens/js/module/tokens/functional/colors/global.js +1 -1
  153. package/lib/design-tokens/js/module/tokens/functional/components/bento/base.js +1 -1
  154. package/lib/design-tokens/js/module/tokens/functional/components/card/base.js +1 -1
  155. package/lib/design-tokens/js/module/tokens/functional/components/card/colors.js +1 -1
  156. package/lib/design-tokens/js/module/tokens/functional/components/comparison-table/comparison-table.js +1 -1
  157. package/lib/design-tokens/js/module/tokens/functional/components/eyebrow-banner/eyebrow-banner.js +1 -1
  158. package/lib/design-tokens/js/module/tokens/functional/components/faq/base.js +1 -1
  159. package/lib/design-tokens/js/module/tokens/functional/components/faq/colors.js +1 -1
  160. package/lib/design-tokens/js/module/tokens/functional/components/faq/faq.js +1 -1
  161. package/lib/design-tokens/js/module/tokens/functional/components/footer/colors.js +1 -1
  162. package/lib/design-tokens/js/module/tokens/functional/components/frosted-glass-vfx/base.js +1 -1
  163. package/lib/design-tokens/js/module/tokens/functional/components/grid/colors.js +1 -1
  164. package/lib/design-tokens/js/module/tokens/functional/components/grid/grid.js +1 -1
  165. package/lib/design-tokens/js/module/tokens/functional/components/hero/base.js +1 -1
  166. package/lib/design-tokens/js/module/tokens/functional/components/icon/colors.js +1 -1
  167. package/lib/design-tokens/js/module/tokens/functional/components/ide/base.js +1 -1
  168. package/lib/design-tokens/js/module/tokens/functional/components/image/base.js +1 -1
  169. package/lib/design-tokens/js/module/tokens/functional/components/inline-link/base.js +1 -1
  170. package/lib/design-tokens/js/module/tokens/functional/components/inline-link/colors.js +1 -1
  171. package/lib/design-tokens/js/module/tokens/functional/components/label/colors.js +1 -1
  172. package/lib/design-tokens/js/module/tokens/functional/components/link/colors.js +1 -1
  173. package/lib/design-tokens/js/module/tokens/functional/components/logosuite/base.js +1 -1
  174. package/lib/design-tokens/js/module/tokens/functional/components/logosuite/colors.js +1 -1
  175. package/lib/design-tokens/js/module/tokens/functional/components/media-playlist/colors.js +1 -1
  176. package/lib/design-tokens/js/module/tokens/functional/components/pricing-options/colors.js +1 -1
  177. package/lib/design-tokens/js/module/tokens/functional/components/pricing-options/pricing-options.js +1 -1
  178. package/lib/design-tokens/js/module/tokens/functional/components/prose/base.js +1 -1
  179. package/lib/design-tokens/js/module/tokens/functional/components/river/base.js +1 -1
  180. package/lib/design-tokens/js/module/tokens/functional/components/river/river.js +1 -1
  181. package/lib/design-tokens/js/module/tokens/functional/components/section/section.js +1 -1
  182. package/lib/design-tokens/js/module/tokens/functional/components/statistic/base.js +1 -1
  183. package/lib/design-tokens/js/module/tokens/functional/components/sub-nav/base.js +1 -1
  184. package/lib/design-tokens/js/module/tokens/functional/components/tabs/base.js +1 -1
  185. package/lib/design-tokens/js/module/tokens/functional/components/tabs/colors.js +1 -1
  186. package/lib/design-tokens/js/module/tokens/functional/components/testimonial/base.js +1 -1
  187. package/lib/design-tokens/js/module/tokens/functional/components/testimonial/colors.js +1 -1
  188. package/lib/design-tokens/js/module/tokens/functional/components/text-cursor-animation/colors.js +1 -1
  189. package/lib/design-tokens/js/module/tokens/functional/components/timeline/base.js +1 -1
  190. package/lib/design-tokens/js/module/tokens/functional/components/timeline/colors.js +1 -1
  191. package/lib/design-tokens/js/module/tokens/functional/components/token/colors.js +1 -1
  192. package/lib/design-tokens/js/module/tokens/functional/components/tooltip/colors.js +1 -1
  193. package/lib/design-tokens/js/module/tokens/functional/components/video-player/base.js +1 -1
  194. package/lib/design-tokens/js/module/tokens/functional/size/border.js +1 -1
  195. package/lib/design-tokens/js/module/tokens/functional/size/breakpoints.js +1 -1
  196. package/lib/design-tokens/js/module/tokens/functional/size/size-coarse.js +1 -1
  197. package/lib/design-tokens/js/module/tokens/functional/size/size-fine.js +1 -1
  198. package/lib/design-tokens/js/module/tokens/functional/size/size.js +1 -1
  199. package/lib/design-tokens/js/module/tokens/functional/size/viewport.js +1 -1
  200. package/lib/design-tokens/js/module/tokens/functional/typography/typography-responsive.js +1 -1
  201. package/lib/design-tokens/js/module/tokens/functional/typography/typography.js +1 -1
  202. package/lib/design-tokens/js/tokens/base/colors/light.js +1 -1
  203. package/lib/design-tokens/js/tokens/base/size/size.js +1 -1
  204. package/lib/design-tokens/js/tokens/base/typography/typography.js +1 -1
  205. package/lib/design-tokens/js/tokens/functional/animation/base.js +1 -1
  206. package/lib/design-tokens/js/tokens/functional/colors/global.js +1 -1
  207. package/lib/design-tokens/js/tokens/functional/components/bento/base.js +1 -1
  208. package/lib/design-tokens/js/tokens/functional/components/card/base.js +1 -1
  209. package/lib/design-tokens/js/tokens/functional/components/card/colors.js +1 -1
  210. package/lib/design-tokens/js/tokens/functional/components/comparison-table/comparison-table.js +1 -1
  211. package/lib/design-tokens/js/tokens/functional/components/eyebrow-banner/eyebrow-banner.js +1 -1
  212. package/lib/design-tokens/js/tokens/functional/components/faq/base.js +1 -1
  213. package/lib/design-tokens/js/tokens/functional/components/faq/colors.js +1 -1
  214. package/lib/design-tokens/js/tokens/functional/components/faq/faq.js +1 -1
  215. package/lib/design-tokens/js/tokens/functional/components/footer/colors.js +1 -1
  216. package/lib/design-tokens/js/tokens/functional/components/frosted-glass-vfx/base.js +1 -1
  217. package/lib/design-tokens/js/tokens/functional/components/grid/colors.js +1 -1
  218. package/lib/design-tokens/js/tokens/functional/components/grid/grid.js +1 -1
  219. package/lib/design-tokens/js/tokens/functional/components/hero/base.js +1 -1
  220. package/lib/design-tokens/js/tokens/functional/components/icon/colors.js +1 -1
  221. package/lib/design-tokens/js/tokens/functional/components/ide/base.js +1 -1
  222. package/lib/design-tokens/js/tokens/functional/components/image/base.js +1 -1
  223. package/lib/design-tokens/js/tokens/functional/components/inline-link/base.js +1 -1
  224. package/lib/design-tokens/js/tokens/functional/components/inline-link/colors.js +1 -1
  225. package/lib/design-tokens/js/tokens/functional/components/label/colors.js +1 -1
  226. package/lib/design-tokens/js/tokens/functional/components/link/colors.js +1 -1
  227. package/lib/design-tokens/js/tokens/functional/components/logosuite/base.js +1 -1
  228. package/lib/design-tokens/js/tokens/functional/components/logosuite/colors.js +1 -1
  229. package/lib/design-tokens/js/tokens/functional/components/media-playlist/colors.js +1 -1
  230. package/lib/design-tokens/js/tokens/functional/components/pricing-options/colors.js +1 -1
  231. package/lib/design-tokens/js/tokens/functional/components/pricing-options/pricing-options.js +1 -1
  232. package/lib/design-tokens/js/tokens/functional/components/prose/base.js +1 -1
  233. package/lib/design-tokens/js/tokens/functional/components/river/base.js +1 -1
  234. package/lib/design-tokens/js/tokens/functional/components/river/river.js +1 -1
  235. package/lib/design-tokens/js/tokens/functional/components/section/section.js +1 -1
  236. package/lib/design-tokens/js/tokens/functional/components/statistic/base.js +1 -1
  237. package/lib/design-tokens/js/tokens/functional/components/sub-nav/base.js +1 -1
  238. package/lib/design-tokens/js/tokens/functional/components/tabs/base.js +1 -1
  239. package/lib/design-tokens/js/tokens/functional/components/tabs/colors.js +1 -1
  240. package/lib/design-tokens/js/tokens/functional/components/testimonial/base.js +1 -1
  241. package/lib/design-tokens/js/tokens/functional/components/testimonial/colors.js +1 -1
  242. package/lib/design-tokens/js/tokens/functional/components/text-cursor-animation/colors.js +1 -1
  243. package/lib/design-tokens/js/tokens/functional/components/timeline/base.js +1 -1
  244. package/lib/design-tokens/js/tokens/functional/components/timeline/colors.js +1 -1
  245. package/lib/design-tokens/js/tokens/functional/components/token/colors.js +1 -1
  246. package/lib/design-tokens/js/tokens/functional/components/tooltip/colors.js +1 -1
  247. package/lib/design-tokens/js/tokens/functional/components/video-player/base.js +1 -1
  248. package/lib/design-tokens/js/tokens/functional/size/border.js +1 -1
  249. package/lib/design-tokens/js/tokens/functional/size/breakpoints.js +1 -1
  250. package/lib/design-tokens/js/tokens/functional/size/size-coarse.js +1 -1
  251. package/lib/design-tokens/js/tokens/functional/size/size-fine.js +1 -1
  252. package/lib/design-tokens/js/tokens/functional/size/size.js +1 -1
  253. package/lib/design-tokens/js/tokens/functional/size/viewport.js +1 -1
  254. package/lib/design-tokens/js/tokens/functional/typography/typography-responsive.js +1 -1
  255. package/lib/design-tokens/js/tokens/functional/typography/typography.js +1 -1
  256. package/lib/design-tokens/scss/tokens/base/colors/light.scss +1 -1
  257. package/lib/design-tokens/scss/tokens/base/size/size.scss +1 -1
  258. package/lib/design-tokens/scss/tokens/base/typography/typography.scss +1 -1
  259. package/lib/design-tokens/scss/tokens/functional/animation/base.scss +1 -1
  260. package/lib/design-tokens/scss/tokens/functional/colors/global.scss +1 -1
  261. package/lib/design-tokens/scss/tokens/functional/components/bento/base.scss +1 -1
  262. package/lib/design-tokens/scss/tokens/functional/components/card/base.scss +1 -1
  263. package/lib/design-tokens/scss/tokens/functional/components/card/colors.scss +1 -1
  264. package/lib/design-tokens/scss/tokens/functional/components/comparison-table/comparison-table.scss +1 -1
  265. package/lib/design-tokens/scss/tokens/functional/components/eyebrow-banner/eyebrow-banner.scss +1 -1
  266. package/lib/design-tokens/scss/tokens/functional/components/faq/base.scss +1 -1
  267. package/lib/design-tokens/scss/tokens/functional/components/faq/colors.scss +1 -1
  268. package/lib/design-tokens/scss/tokens/functional/components/faq/faq.scss +1 -1
  269. package/lib/design-tokens/scss/tokens/functional/components/footer/colors.scss +1 -1
  270. package/lib/design-tokens/scss/tokens/functional/components/frosted-glass-vfx/base.scss +1 -1
  271. package/lib/design-tokens/scss/tokens/functional/components/grid/colors.scss +1 -1
  272. package/lib/design-tokens/scss/tokens/functional/components/grid/grid.scss +1 -1
  273. package/lib/design-tokens/scss/tokens/functional/components/hero/base.scss +1 -1
  274. package/lib/design-tokens/scss/tokens/functional/components/icon/colors.scss +1 -1
  275. package/lib/design-tokens/scss/tokens/functional/components/ide/base.scss +1 -1
  276. package/lib/design-tokens/scss/tokens/functional/components/image/base.scss +1 -1
  277. package/lib/design-tokens/scss/tokens/functional/components/inline-link/base.scss +1 -1
  278. package/lib/design-tokens/scss/tokens/functional/components/inline-link/colors.scss +1 -1
  279. package/lib/design-tokens/scss/tokens/functional/components/label/colors.scss +1 -1
  280. package/lib/design-tokens/scss/tokens/functional/components/link/colors.scss +1 -1
  281. package/lib/design-tokens/scss/tokens/functional/components/logosuite/base.scss +1 -1
  282. package/lib/design-tokens/scss/tokens/functional/components/logosuite/colors.scss +1 -1
  283. package/lib/design-tokens/scss/tokens/functional/components/media-playlist/colors.scss +1 -1
  284. package/lib/design-tokens/scss/tokens/functional/components/pricing-options/colors.scss +1 -1
  285. package/lib/design-tokens/scss/tokens/functional/components/pricing-options/pricing-options.scss +1 -1
  286. package/lib/design-tokens/scss/tokens/functional/components/prose/base.scss +1 -1
  287. package/lib/design-tokens/scss/tokens/functional/components/river/base.scss +1 -1
  288. package/lib/design-tokens/scss/tokens/functional/components/river/river.scss +1 -1
  289. package/lib/design-tokens/scss/tokens/functional/components/section/section.scss +1 -1
  290. package/lib/design-tokens/scss/tokens/functional/components/statistic/base.scss +1 -1
  291. package/lib/design-tokens/scss/tokens/functional/components/sub-nav/base.scss +1 -1
  292. package/lib/design-tokens/scss/tokens/functional/components/tabs/base.scss +1 -1
  293. package/lib/design-tokens/scss/tokens/functional/components/tabs/colors.scss +1 -1
  294. package/lib/design-tokens/scss/tokens/functional/components/testimonial/base.scss +1 -1
  295. package/lib/design-tokens/scss/tokens/functional/components/testimonial/colors.scss +1 -1
  296. package/lib/design-tokens/scss/tokens/functional/components/text-cursor-animation/colors.scss +1 -1
  297. package/lib/design-tokens/scss/tokens/functional/components/timeline/base.scss +1 -1
  298. package/lib/design-tokens/scss/tokens/functional/components/timeline/colors.scss +1 -1
  299. package/lib/design-tokens/scss/tokens/functional/components/token/colors.scss +1 -1
  300. package/lib/design-tokens/scss/tokens/functional/components/tooltip/colors.scss +1 -1
  301. package/lib/design-tokens/scss/tokens/functional/components/video-player/base.scss +1 -1
  302. package/lib/design-tokens/scss/tokens/functional/size/border.scss +1 -1
  303. package/lib/design-tokens/scss/tokens/functional/size/breakpoints.scss +1 -1
  304. package/lib/design-tokens/scss/tokens/functional/size/size-coarse.scss +1 -1
  305. package/lib/design-tokens/scss/tokens/functional/size/size-fine.scss +1 -1
  306. package/lib/design-tokens/scss/tokens/functional/size/size.scss +1 -1
  307. package/lib/design-tokens/scss/tokens/functional/size/viewport.scss +1 -1
  308. package/lib/design-tokens/scss/tokens/functional/typography/typography-responsive.scss +1 -1
  309. package/lib/design-tokens/scss/tokens/functional/typography/typography.scss +1 -1
  310. package/lib/design-tokens/ts/tokens/base/colors/light.d.ts +1 -1
  311. package/lib/design-tokens/ts/tokens/base/colors/light.js +1 -1
  312. package/lib/design-tokens/ts/tokens/base/size/size.d.ts +1 -1
  313. package/lib/design-tokens/ts/tokens/base/size/size.js +1 -1
  314. package/lib/design-tokens/ts/tokens/base/typography/typography.d.ts +1 -1
  315. package/lib/design-tokens/ts/tokens/base/typography/typography.js +1 -1
  316. package/lib/design-tokens/ts/tokens/functional/animation/base.d.ts +1 -1
  317. package/lib/design-tokens/ts/tokens/functional/animation/base.js +1 -1
  318. package/lib/design-tokens/ts/tokens/functional/colors/global.d.ts +1 -1
  319. package/lib/design-tokens/ts/tokens/functional/colors/global.js +1 -1
  320. package/lib/design-tokens/ts/tokens/functional/components/bento/base.d.ts +1 -1
  321. package/lib/design-tokens/ts/tokens/functional/components/bento/base.js +1 -1
  322. package/lib/design-tokens/ts/tokens/functional/components/card/base.d.ts +1 -1
  323. package/lib/design-tokens/ts/tokens/functional/components/card/base.js +1 -1
  324. package/lib/design-tokens/ts/tokens/functional/components/card/colors.d.ts +1 -1
  325. package/lib/design-tokens/ts/tokens/functional/components/card/colors.js +1 -1
  326. package/lib/design-tokens/ts/tokens/functional/components/comparison-table/comparison-table.d.ts +1 -1
  327. package/lib/design-tokens/ts/tokens/functional/components/comparison-table/comparison-table.js +1 -1
  328. package/lib/design-tokens/ts/tokens/functional/components/eyebrow-banner/eyebrow-banner.d.ts +1 -1
  329. package/lib/design-tokens/ts/tokens/functional/components/eyebrow-banner/eyebrow-banner.js +1 -1
  330. package/lib/design-tokens/ts/tokens/functional/components/faq/base.d.ts +1 -1
  331. package/lib/design-tokens/ts/tokens/functional/components/faq/base.js +1 -1
  332. package/lib/design-tokens/ts/tokens/functional/components/faq/colors.d.ts +1 -1
  333. package/lib/design-tokens/ts/tokens/functional/components/faq/colors.js +1 -1
  334. package/lib/design-tokens/ts/tokens/functional/components/faq/faq.d.ts +1 -1
  335. package/lib/design-tokens/ts/tokens/functional/components/faq/faq.js +1 -1
  336. package/lib/design-tokens/ts/tokens/functional/components/footer/colors.d.ts +1 -1
  337. package/lib/design-tokens/ts/tokens/functional/components/footer/colors.js +1 -1
  338. package/lib/design-tokens/ts/tokens/functional/components/frosted-glass-vfx/base.d.ts +1 -1
  339. package/lib/design-tokens/ts/tokens/functional/components/frosted-glass-vfx/base.js +1 -1
  340. package/lib/design-tokens/ts/tokens/functional/components/grid/colors.d.ts +1 -1
  341. package/lib/design-tokens/ts/tokens/functional/components/grid/colors.js +1 -1
  342. package/lib/design-tokens/ts/tokens/functional/components/grid/grid.d.ts +1 -1
  343. package/lib/design-tokens/ts/tokens/functional/components/grid/grid.js +1 -1
  344. package/lib/design-tokens/ts/tokens/functional/components/hero/base.d.ts +1 -1
  345. package/lib/design-tokens/ts/tokens/functional/components/hero/base.js +1 -1
  346. package/lib/design-tokens/ts/tokens/functional/components/icon/colors.d.ts +1 -1
  347. package/lib/design-tokens/ts/tokens/functional/components/icon/colors.js +1 -1
  348. package/lib/design-tokens/ts/tokens/functional/components/ide/base.d.ts +1 -1
  349. package/lib/design-tokens/ts/tokens/functional/components/ide/base.js +1 -1
  350. package/lib/design-tokens/ts/tokens/functional/components/image/base.d.ts +1 -1
  351. package/lib/design-tokens/ts/tokens/functional/components/image/base.js +1 -1
  352. package/lib/design-tokens/ts/tokens/functional/components/inline-link/base.d.ts +1 -1
  353. package/lib/design-tokens/ts/tokens/functional/components/inline-link/base.js +1 -1
  354. package/lib/design-tokens/ts/tokens/functional/components/inline-link/colors.d.ts +1 -1
  355. package/lib/design-tokens/ts/tokens/functional/components/inline-link/colors.js +1 -1
  356. package/lib/design-tokens/ts/tokens/functional/components/label/colors.d.ts +1 -1
  357. package/lib/design-tokens/ts/tokens/functional/components/label/colors.js +1 -1
  358. package/lib/design-tokens/ts/tokens/functional/components/link/colors.d.ts +1 -1
  359. package/lib/design-tokens/ts/tokens/functional/components/link/colors.js +1 -1
  360. package/lib/design-tokens/ts/tokens/functional/components/logosuite/base.d.ts +1 -1
  361. package/lib/design-tokens/ts/tokens/functional/components/logosuite/base.js +1 -1
  362. package/lib/design-tokens/ts/tokens/functional/components/logosuite/colors.d.ts +1 -1
  363. package/lib/design-tokens/ts/tokens/functional/components/logosuite/colors.js +1 -1
  364. package/lib/design-tokens/ts/tokens/functional/components/media-playlist/colors.d.ts +1 -1
  365. package/lib/design-tokens/ts/tokens/functional/components/media-playlist/colors.js +1 -1
  366. package/lib/design-tokens/ts/tokens/functional/components/pricing-options/colors.d.ts +1 -1
  367. package/lib/design-tokens/ts/tokens/functional/components/pricing-options/colors.js +1 -1
  368. package/lib/design-tokens/ts/tokens/functional/components/pricing-options/pricing-options.d.ts +1 -1
  369. package/lib/design-tokens/ts/tokens/functional/components/pricing-options/pricing-options.js +1 -1
  370. package/lib/design-tokens/ts/tokens/functional/components/prose/base.d.ts +1 -1
  371. package/lib/design-tokens/ts/tokens/functional/components/prose/base.js +1 -1
  372. package/lib/design-tokens/ts/tokens/functional/components/river/base.d.ts +1 -1
  373. package/lib/design-tokens/ts/tokens/functional/components/river/base.js +1 -1
  374. package/lib/design-tokens/ts/tokens/functional/components/river/river.d.ts +1 -1
  375. package/lib/design-tokens/ts/tokens/functional/components/river/river.js +1 -1
  376. package/lib/design-tokens/ts/tokens/functional/components/section/section.d.ts +1 -1
  377. package/lib/design-tokens/ts/tokens/functional/components/section/section.js +1 -1
  378. package/lib/design-tokens/ts/tokens/functional/components/statistic/base.d.ts +1 -1
  379. package/lib/design-tokens/ts/tokens/functional/components/statistic/base.js +1 -1
  380. package/lib/design-tokens/ts/tokens/functional/components/sub-nav/base.d.ts +1 -1
  381. package/lib/design-tokens/ts/tokens/functional/components/sub-nav/base.js +1 -1
  382. package/lib/design-tokens/ts/tokens/functional/components/tabs/base.d.ts +1 -1
  383. package/lib/design-tokens/ts/tokens/functional/components/tabs/base.js +1 -1
  384. package/lib/design-tokens/ts/tokens/functional/components/tabs/colors.d.ts +1 -1
  385. package/lib/design-tokens/ts/tokens/functional/components/tabs/colors.js +1 -1
  386. package/lib/design-tokens/ts/tokens/functional/components/testimonial/base.d.ts +1 -1
  387. package/lib/design-tokens/ts/tokens/functional/components/testimonial/base.js +1 -1
  388. package/lib/design-tokens/ts/tokens/functional/components/testimonial/colors.d.ts +1 -1
  389. package/lib/design-tokens/ts/tokens/functional/components/testimonial/colors.js +1 -1
  390. package/lib/design-tokens/ts/tokens/functional/components/text-cursor-animation/colors.d.ts +1 -1
  391. package/lib/design-tokens/ts/tokens/functional/components/text-cursor-animation/colors.js +1 -1
  392. package/lib/design-tokens/ts/tokens/functional/components/timeline/base.d.ts +1 -1
  393. package/lib/design-tokens/ts/tokens/functional/components/timeline/base.js +1 -1
  394. package/lib/design-tokens/ts/tokens/functional/components/timeline/colors.d.ts +1 -1
  395. package/lib/design-tokens/ts/tokens/functional/components/timeline/colors.js +1 -1
  396. package/lib/design-tokens/ts/tokens/functional/components/token/colors.d.ts +1 -1
  397. package/lib/design-tokens/ts/tokens/functional/components/token/colors.js +1 -1
  398. package/lib/design-tokens/ts/tokens/functional/components/tooltip/colors.d.ts +1 -1
  399. package/lib/design-tokens/ts/tokens/functional/components/tooltip/colors.js +1 -1
  400. package/lib/design-tokens/ts/tokens/functional/components/video-player/base.d.ts +1 -1
  401. package/lib/design-tokens/ts/tokens/functional/components/video-player/base.js +1 -1
  402. package/lib/design-tokens/ts/tokens/functional/size/border.d.ts +1 -1
  403. package/lib/design-tokens/ts/tokens/functional/size/border.js +1 -1
  404. package/lib/design-tokens/ts/tokens/functional/size/breakpoints.d.ts +1 -1
  405. package/lib/design-tokens/ts/tokens/functional/size/breakpoints.js +1 -1
  406. package/lib/design-tokens/ts/tokens/functional/size/size-coarse.d.ts +1 -1
  407. package/lib/design-tokens/ts/tokens/functional/size/size-coarse.js +1 -1
  408. package/lib/design-tokens/ts/tokens/functional/size/size-fine.d.ts +1 -1
  409. package/lib/design-tokens/ts/tokens/functional/size/size-fine.js +1 -1
  410. package/lib/design-tokens/ts/tokens/functional/size/size.d.ts +1 -1
  411. package/lib/design-tokens/ts/tokens/functional/size/size.js +1 -1
  412. package/lib/design-tokens/ts/tokens/functional/size/viewport.d.ts +1 -1
  413. package/lib/design-tokens/ts/tokens/functional/size/viewport.js +1 -1
  414. package/lib/design-tokens/ts/tokens/functional/typography/typography-responsive.d.ts +1 -1
  415. package/lib/design-tokens/ts/tokens/functional/typography/typography-responsive.js +1 -1
  416. package/lib/design-tokens/ts/tokens/functional/typography/typography.d.ts +1 -1
  417. package/lib/design-tokens/ts/tokens/functional/typography/typography.js +1 -1
  418. package/lib/forms/Checkbox/Checkbox.d.ts +1 -0
  419. package/lib/forms/FormControl/FormControl.d.ts +1 -0
  420. package/lib/forms/Radio/Radio.d.ts +1 -0
  421. package/lib/forms/Select/Select.d.ts +1 -0
  422. package/lib/forms/TextInput/TextInput.d.ts +1 -0
  423. package/lib/forms/Textarea/Textarea.d.ts +1 -0
  424. package/lib/forms/index.d.ts +0 -4
  425. package/lib/hooks/useFocusTrap.d.ts +8 -8
  426. package/lib/index.d.ts +1 -0
  427. package/lib/index.js +1 -1
  428. package/lib/river/River/River.d.ts +0 -6
  429. package/lib/river/RiverBreakout/RiverBreakout.d.ts +2 -1
  430. package/lib/river/RiverBreakoutTabs/RiverBreakoutTabs.d.ts +1 -0
  431. package/llms.txt +2 -2
  432. package/package.json +1 -1
  433. package/esm/river/RiverAccordion/RiverAccordion.module-nlZZH3O7.css +0 -1
  434. package/esm/river/river-shared.module-D0AV93uz.css +0 -1
@@ -63,7 +63,7 @@ import {River, RiverBreakout} from '@primer/react-brand'
63
63
 
64
64
  ### GridLine variant
65
65
 
66
- The `gridline` variant adds lateral padding to the River component, making it suitable for use within bordered grid layouts.
66
+ The `gridline` variant adds lateral padding to the River component and applies a full-bleed visual background by default, making it suitable for use within bordered grid layouts.
67
67
 
68
68
  ```jsx
69
69
  <Stack style={{width: '100%'}}>
@@ -77,45 +77,13 @@ The `gridline` variant adds lateral padding to the River component, making it su
77
77
  <Link href="#">Call to action</Link>
78
78
  </River.Content>
79
79
  </River>
80
- <River variant="gridline" align="end">
80
+ <River variant="gridline">
81
81
  <River.Visual>
82
82
  <img src="/images/placeholder.png" alt="placeholder, blank area with a gray background color" />
83
83
  </River.Visual>
84
84
  <River.Content>
85
85
  <Heading>GridLine variant</Heading>
86
- <Text>The variant works with all alignment options.</Text>
87
- <Link href="#">Call to action</Link>
88
- </River.Content>
89
- </River>
90
- </Stack>
91
- ```
92
-
93
- ### Visual with background
94
-
95
- Use the `imageBackgroundColor` prop on `River.Visual` to create a full-bleed container with a background color and the image/video centered inside with padding. This is intended for use with the `gridline` variant.
96
-
97
- ```jsx
98
- <Stack style={{width: '100%'}}>
99
- <River variant="gridline">
100
- <River.Visual imageBackgroundColor="subtle">
101
- <img src="/images/placeholder.png" alt="placeholder, blank area with a gray background color" />
102
- </River.Visual>
103
- <River.Content>
104
- <Heading>Visual with background</Heading>
105
- <Text>
106
- The imageBackgroundColor prop creates a full-bleed container with a subtle background, centering the media with
107
- padding around it.
108
- </Text>
109
- <Link href="#">Call to action</Link>
110
- </River.Content>
111
- </River>
112
- <River variant="gridline" align="end">
113
- <River.Visual imageBackgroundColor="subtle">
114
- <img src="/images/placeholder.png" alt="placeholder, blank area with a gray background color" />
115
- </River.Visual>
116
- <River.Content>
117
- <Heading>Visual with background (end)</Heading>
118
- <Text>The imageBackgroundColor prop works with all alignment options.</Text>
86
+ <Text>Keep adjacent gridline Rivers aligned in the same direction.</Text>
119
87
  <Link href="#">Call to action</Link>
120
88
  </River.Content>
121
89
  </River>
@@ -258,16 +226,15 @@ Use the `imageBackgroundColor` prop on `River.Visual` to create a full-bleed con
258
226
 
259
227
  ### River.Visual and RiverBreakout.Visual `Required`
260
228
 
261
- | Name | Type | Default | Description |
262
- | :--------------------- | :---------------------- | :-----: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
263
- | `fillMedia` | `boolean` | true | Automatically styles images and video to fill and fit the width of the parent. Disable this setting if you have bespoke styling requirements. |
264
- | `children` | `ReactElement` | | Bring your own component (BYOC) `img` or `ReactElement` (E.g. Next.js `Image` component) |
265
- | `imageBackgroundColor` | `'default'`, `'subtle'` | | Applies a background color with padding around the media. Use `'subtle'` to create a full-bleed container with the image/video centered inside. Intended for use with `gridline` variant. |
266
- | `hasShadow` | `boolean` | `false` | Shadow applied to the `children`. Set be `false` when the child node has a transparent background. |
267
- | `className` | `string` | | Sets a custom class on the root element |
268
- | `id` | `string` | | Sets a custom id |
269
- | `ref` | `React.RefObject` | | Forward a Ref to the underlying DOM node |
270
- | `rounded` | `boolean` | `true` | Toggle visually rounded corners. Enabled by default. |
229
+ | Name | Type | Default | Description |
230
+ | :---------- | :---------------- | :-----: | :-------------------------------------------------------------------------------------------------------------------------------------------- |
231
+ | `fillMedia` | `boolean` | true | Automatically styles images and video to fill and fit the width of the parent. Disable this setting if you have bespoke styling requirements. |
232
+ | `children` | `ReactElement` | | Bring your own component (BYOC) `img` or `ReactElement` (E.g. Next.js `Image` component) |
233
+ | `hasShadow` | `boolean` | `false` | Shadow applied to the `children`. Set be `false` when the child node has a transparent background. |
234
+ | `className` | `string` | | Sets a custom class on the root element |
235
+ | `id` | `string` | | Sets a custom id |
236
+ | `ref` | `React.RefObject` | | Forward a Ref to the underlying DOM node |
237
+ | `rounded` | `boolean` | `true` | Toggle visually rounded corners. Enabled by default. |
271
238
 
272
239
  ### River.Content and RiverBreakout.Content `Required`
273
240
 
@@ -163,9 +163,8 @@ import {RiverBreakoutTabs} from '@primer/react-brand'
163
163
 
164
164
  ### RiverBreakoutTabs.Visual `Required`
165
165
 
166
- | Name | Type | Default | Description |
167
- | :--------------------- | :---------------------- | :-----: | :-------------------------------- |
168
- | `children` | `React.ReactElement` | | Item visual media |
169
- | `imageBackgroundColor` | `'default' \| 'subtle'` | | Optional background around visual |
166
+ | Name | Type | Default | Description |
167
+ | :--------- | :------------------- | :-----: | :---------------- |
168
+ | `children` | `React.ReactElement` | | Item visual media |
170
169
 
171
170
  `RiverBreakoutTabs.Visual` extends `River.Visual` and supports all `River.Visual` props.
package/docs/index.md CHANGED
@@ -1,6 +1,6 @@
1
- # Primer Brand docs (v0.72.0-rc.c1f51647)
1
+ # Primer Brand docs (v0.72.0-rc.f8b72452)
2
2
 
3
- These docs are bundled with `@primer/react-brand@0.72.0-rc.c1f51647` and match your installed version.
3
+ These docs are bundled with `@primer/react-brand@0.72.0-rc.f8b72452` and match your installed version.
4
4
 
5
5
  New here? Start with [Getting started](getting-started/index.md) for installation, global
6
6
  stylesheet and font setup. Component directories are named after their import (e.g.
@@ -1,6 +1,7 @@
1
1
  import React, { type InputHTMLAttributes } from 'react';
2
2
  import type { BaseProps } from '../../component-helpers';
3
3
  import type { FormValidationStatus } from '../form-types';
4
+ import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes.css';
4
5
  export type CheckboxProps = {
5
6
  /**
6
7
  * Apply indeterminate visual appearance to the checkbox
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/forms/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA0B,KAAK,mBAAmB,EAAoB,MAAM,OAAO,CAAA;AAIjG,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,eAAe,CAAA;AAMvD,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;IACvC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,GAAG,OAAO,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC,GACzD,SAAS,CAAC,gBAAgB,CAAC,CAAA;AAsF7B,eAAO,MAAM,QAAQ,4FAA+B,CAAA"}
1
+ {"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/forms/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA0B,KAAK,mBAAmB,EAAoB,MAAM,OAAO,CAAA;AAIjG,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,eAAe,CAAA;AAGvD,OAAO,2GAA2G,CAAA;AAIlH,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;IACvC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,GAAG,OAAO,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC,GACzD,SAAS,CAAC,gBAAgB,CAAC,CAAA;AAsF7B,eAAO,MAAM,QAAQ,4FAA+B,CAAA"}
@@ -2,6 +2,7 @@ import e from "../../node_modules/clsx/dist/clsx.js";
2
2
  import { useId as t } from "../../hooks/useId.js";
3
3
  import { useProvidedRefOrCreate as n } from "../../hooks/useRef.js";
4
4
  import r from "../../hooks/useIsomorphicLayoutEffect.js";
5
+ import '../../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes-C05YPRXo.css';/* empty css */
5
6
  import i from "./Checkbox.module.js";
6
7
  import { forwardRef as a, useCallback as o } from "react";
7
8
  import { jsx as s, jsxs as c } from "react/jsx-runtime";
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.js","names":[],"sources":["../../../src/forms/Checkbox/Checkbox.tsx"],"sourcesContent":["import React, {forwardRef, useCallback, type InputHTMLAttributes, type ReactElement} from 'react'\nimport {clsx} from 'clsx'\nimport {useId} from '../../hooks/useId'\n\nimport type {BaseProps} from '../../component-helpers'\nimport type {FormValidationStatus} from '../form-types'\nimport useLayoutEffect from '../../hooks/useIsomorphicLayoutEffect'\n\nimport styles from './Checkbox.module.css'\nimport {useProvidedRefOrCreate} from '../../hooks/useRef'\n\nexport type CheckboxProps = {\n /**\n * Apply indeterminate visual appearance to the checkbox\n */\n indeterminate?: boolean\n /**\n * Apply inactive visual appearance to the checkbox\n */\n disabled?: boolean\n /**\n * Indicates whether the checkbox must be checked\n */\n required?: boolean\n /**\n * Only used to inform ARIA attributes. Individual checkboxes do not have validation styles.\n */\n validationStatus?: FormValidationStatus\n /**\n * A unique value that is never shown to the user.\n * Used during form submission and to identify which checkbox inputs are selected\n */\n value?: string\n} & Exclude<InputHTMLAttributes<HTMLInputElement>, 'value'> &\n BaseProps<HTMLInputElement>\n\nconst CheckboxInternal = (\n {\n checked,\n className,\n indeterminate,\n disabled,\n id,\n onChange,\n required,\n validationStatus,\n value,\n ...rest\n }: CheckboxProps,\n ref,\n): ReactElement => {\n const inputRef = useProvidedRefOrCreate<HTMLInputElement | null>(ref || null)\n const uniqueId = useId(id)\n\n useLayoutEffect(() => {\n if (inputRef.current) {\n inputRef.current.indeterminate = indeterminate || false\n }\n }, [indeterminate, checked, inputRef])\n\n const onClick = useCallback(() => {\n if (!disabled && inputRef.current) {\n inputRef.current.click()\n }\n }, [disabled, inputRef])\n\n return (\n <span className={styles['Checkbox-wrapper']}>\n <input\n id={uniqueId}\n aria-invalid={validationStatus === 'error' ? 'true' : 'false'}\n aria-required={required ? 'true' : 'false'}\n aria-checked={indeterminate ? 'mixed' : checked}\n checked={indeterminate ? false : checked}\n className={clsx(styles['Checkbox-input'])}\n disabled={disabled}\n name={value}\n onChange={onChange}\n ref={inputRef}\n required={required}\n type=\"checkbox\"\n value={value}\n {...rest}\n />\n <span\n className={clsx(styles['Checkbox'], indeterminate && styles['Checkbox--indeterminate'], className)}\n onClick={onClick}\n tabIndex={-1}\n aria-hidden=\"true\"\n >\n {indeterminate ? (\n <svg\n className={clsx(styles['Checkbox-checkmark'])}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n width=\"16\"\n height=\"16\"\n aria-hidden=\"true\"\n >\n <path fillRule=\"evenodd\" d=\"M2 7.75A.75.75 0 012.75 7h10a.75.75 0 010 1.5h-10A.75.75 0 012 7.75z\"></path>\n </svg>\n ) : (\n <svg viewBox=\"0 0 100 100\" className={clsx(styles['Checkbox-checkmark'])} aria-hidden=\"true\">\n <path\n className={clsx(styles['Checkbox-checkmark-path'])}\n fill=\"none\"\n stroke=\"#000\"\n strokeWidth=\"13\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeMiterlimit=\"10\"\n d=\"M12.1 52.1l24.4 24.4 53-53\"\n />\n </svg>\n )}\n </span>\n </span>\n )\n}\n\nexport const Checkbox = forwardRef(CheckboxInternal)\n"],"mappings":";;;;;;;AAwHA,IAAa,IAAW,GAnFtB,EACE,YACA,cACA,kBACA,aACA,OACA,aACA,aACA,qBACA,UACA,GAAG,KAEL,MACiB;CACjB,IAAM,IAAW,EAAgD,KAAO,KAAK,EACvE,IAAW,EAAM,EAAG;AAE1B,SAAsB;AACpB,EAAI,EAAS,YACX,EAAS,QAAQ,gBAAgB,KAAiB;IAEnD;EAAC;EAAe;EAAS;EAAS,CAAC;CAEtC,IAAM,IAAU,QAAkB;AAChC,EAAI,CAAC,KAAY,EAAS,WACxB,EAAS,QAAQ,OAAO;IAEzB,CAAC,GAAU,EAAS,CAAC;AAExB,QACE,kBAAC,QAAD;EAAM,WAAW,EAAO;YAAxB,CACE,kBAAC,SAAD;GACE,IAAI;GACJ,gBAAc,MAAqB,UAAU,SAAS;GACtD,iBAAe,IAAW,SAAS;GACnC,gBAAc,IAAgB,UAAU;GACxC,SAAS,IAAgB,KAAQ;GACjC,WAAW,EAAK,EAAO,kBAAkB;GAC/B;GACV,MAAM;GACI;GACV,KAAK;GACK;GACV,MAAK;GACE;GACP,GAAI;GACJ,CAAA,EACF,kBAAC,QAAD;GACE,WAAW,EAAK,EAAO,UAAa,KAAiB,EAAO,4BAA4B,EAAU;GACzF;GACT,UAAU;GACV,eAAY;aAEX,IACC,kBAAC,OAAD;IACE,WAAW,EAAK,EAAO,sBAAsB;IAC7C,OAAM;IACN,SAAQ;IACR,OAAM;IACN,QAAO;IACP,eAAY;cAEZ,kBAAC,QAAD;KAAM,UAAS;KAAU,GAAE;KAA8E,CAAA;IACrG,CAAA,GAEN,kBAAC,OAAD;IAAK,SAAQ;IAAc,WAAW,EAAK,EAAO,sBAAsB;IAAE,eAAY;cACpF,kBAAC,QAAD;KACE,WAAW,EAAK,EAAO,2BAA2B;KAClD,MAAK;KACL,QAAO;KACP,aAAY;KACZ,eAAc;KACd,gBAAe;KACf,kBAAiB;KACjB,GAAE;KACF,CAAA;IACE,CAAA;GAEH,CAAA,CACF;;EAIyC"}
1
+ {"version":3,"file":"Checkbox.js","names":[],"sources":["../../../src/forms/Checkbox/Checkbox.tsx"],"sourcesContent":["import React, {forwardRef, useCallback, type InputHTMLAttributes, type ReactElement} from 'react'\nimport {clsx} from 'clsx'\nimport {useId} from '../../hooks/useId'\n\nimport type {BaseProps} from '../../component-helpers'\nimport type {FormValidationStatus} from '../form-types'\nimport useLayoutEffect from '../../hooks/useIsomorphicLayoutEffect'\n\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes.css'\nimport styles from './Checkbox.module.css'\nimport {useProvidedRefOrCreate} from '../../hooks/useRef'\n\nexport type CheckboxProps = {\n /**\n * Apply indeterminate visual appearance to the checkbox\n */\n indeterminate?: boolean\n /**\n * Apply inactive visual appearance to the checkbox\n */\n disabled?: boolean\n /**\n * Indicates whether the checkbox must be checked\n */\n required?: boolean\n /**\n * Only used to inform ARIA attributes. Individual checkboxes do not have validation styles.\n */\n validationStatus?: FormValidationStatus\n /**\n * A unique value that is never shown to the user.\n * Used during form submission and to identify which checkbox inputs are selected\n */\n value?: string\n} & Exclude<InputHTMLAttributes<HTMLInputElement>, 'value'> &\n BaseProps<HTMLInputElement>\n\nconst CheckboxInternal = (\n {\n checked,\n className,\n indeterminate,\n disabled,\n id,\n onChange,\n required,\n validationStatus,\n value,\n ...rest\n }: CheckboxProps,\n ref,\n): ReactElement => {\n const inputRef = useProvidedRefOrCreate<HTMLInputElement | null>(ref || null)\n const uniqueId = useId(id)\n\n useLayoutEffect(() => {\n if (inputRef.current) {\n inputRef.current.indeterminate = indeterminate || false\n }\n }, [indeterminate, checked, inputRef])\n\n const onClick = useCallback(() => {\n if (!disabled && inputRef.current) {\n inputRef.current.click()\n }\n }, [disabled, inputRef])\n\n return (\n <span className={styles['Checkbox-wrapper']}>\n <input\n id={uniqueId}\n aria-invalid={validationStatus === 'error' ? 'true' : 'false'}\n aria-required={required ? 'true' : 'false'}\n aria-checked={indeterminate ? 'mixed' : checked}\n checked={indeterminate ? false : checked}\n className={clsx(styles['Checkbox-input'])}\n disabled={disabled}\n name={value}\n onChange={onChange}\n ref={inputRef}\n required={required}\n type=\"checkbox\"\n value={value}\n {...rest}\n />\n <span\n className={clsx(styles['Checkbox'], indeterminate && styles['Checkbox--indeterminate'], className)}\n onClick={onClick}\n tabIndex={-1}\n aria-hidden=\"true\"\n >\n {indeterminate ? (\n <svg\n className={clsx(styles['Checkbox-checkmark'])}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n width=\"16\"\n height=\"16\"\n aria-hidden=\"true\"\n >\n <path fillRule=\"evenodd\" d=\"M2 7.75A.75.75 0 012.75 7h10a.75.75 0 010 1.5h-10A.75.75 0 012 7.75z\"></path>\n </svg>\n ) : (\n <svg viewBox=\"0 0 100 100\" className={clsx(styles['Checkbox-checkmark'])} aria-hidden=\"true\">\n <path\n className={clsx(styles['Checkbox-checkmark-path'])}\n fill=\"none\"\n stroke=\"#000\"\n strokeWidth=\"13\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeMiterlimit=\"10\"\n d=\"M12.1 52.1l24.4 24.4 53-53\"\n />\n </svg>\n )}\n </span>\n </span>\n )\n}\n\nexport const Checkbox = forwardRef(CheckboxInternal)\n"],"mappings":";;;;;;;;AAyHA,IAAa,IAAW,GAnFtB,EACE,YACA,cACA,kBACA,aACA,OACA,aACA,aACA,qBACA,UACA,GAAG,KAEL,MACiB;CACjB,IAAM,IAAW,EAAgD,KAAO,KAAK,EACvE,IAAW,EAAM,EAAG;AAE1B,SAAsB;AACpB,EAAI,EAAS,YACX,EAAS,QAAQ,gBAAgB,KAAiB;IAEnD;EAAC;EAAe;EAAS;EAAS,CAAC;CAEtC,IAAM,IAAU,QAAkB;AAChC,EAAI,CAAC,KAAY,EAAS,WACxB,EAAS,QAAQ,OAAO;IAEzB,CAAC,GAAU,EAAS,CAAC;AAExB,QACE,kBAAC,QAAD;EAAM,WAAW,EAAO;YAAxB,CACE,kBAAC,SAAD;GACE,IAAI;GACJ,gBAAc,MAAqB,UAAU,SAAS;GACtD,iBAAe,IAAW,SAAS;GACnC,gBAAc,IAAgB,UAAU;GACxC,SAAS,IAAgB,KAAQ;GACjC,WAAW,EAAK,EAAO,kBAAkB;GAC/B;GACV,MAAM;GACI;GACV,KAAK;GACK;GACV,MAAK;GACE;GACP,GAAI;GACJ,CAAA,EACF,kBAAC,QAAD;GACE,WAAW,EAAK,EAAO,UAAa,KAAiB,EAAO,4BAA4B,EAAU;GACzF;GACT,UAAU;GACV,eAAY;aAEX,IACC,kBAAC,OAAD;IACE,WAAW,EAAK,EAAO,sBAAsB;IAC7C,OAAM;IACN,SAAQ;IACR,OAAM;IACN,QAAO;IACP,eAAY;cAEZ,kBAAC,QAAD;KAAM,UAAS;KAAU,GAAE;KAA8E,CAAA;IACrG,CAAA,GAEN,kBAAC,OAAD;IAAK,SAAQ;IAAc,WAAW,EAAK,EAAO,sBAAsB;IAAE,eAAY;cACpF,kBAAC,QAAD;KACE,WAAW,EAAK,EAAO,2BAA2B;KAClD,MAAK;KACL,QAAO;KACP,aAAY;KACZ,eAAc;KACd,gBAAe;KACf,kBAAiB;KACjB,GAAE;KACF,CAAA;IACE,CAAA;GAEH,CAAA,CACF;;EAIyC"}
@@ -1,6 +1,7 @@
1
1
  import { PropsWithChildren } from 'react';
2
2
  import type { BaseProps } from '../../component-helpers';
3
3
  import type { FormValidationStatus, FormInputSizes } from '../';
4
+ import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes.css';
4
5
  export type FormControlProps = BaseProps<HTMLElement> & {
5
6
  /**
6
7
  * Apply a decorative border to the form control.
@@ -1 +1 @@
1
- {"version":3,"file":"FormControl.d.ts","sourceRoot":"","sources":["../../../src/forms/FormControl/FormControl.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAC,iBAAiB,EAAC,MAAM,OAAO,CAAA;AAK9C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAK,EAAC,oBAAoB,EAAE,cAAc,EAAC,MAAM,KAAK,CAAA;AAW7D,MAAM,MAAM,gBAAgB,GAAG,SAAS,CAAC,WAAW,CAAC,GAAG;IACtD;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;;OAIG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,IAAI,CAAC,EAAE,cAAc,CAAA;IACrB;;OAEG;IACH,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;CACxC,CAAA;AA2JD,KAAK,qBAAqB,GAAG;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,IAAI,CAAC,EAAE,cAAc,CAAA;IACrB,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;IACvC,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB,GAAG,SAAS,CAAC,gBAAgB,CAAC,CAAA;AA4C/B,KAAK,0BAA0B,GAAG;IAChC,QAAQ,EAAE,MAAM,CAAA;IAChB,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;CACxC,GAAG,SAAS,CAAC,eAAe,CAAC,CAAA;AA8B9B,KAAK,oBAAoB,GAAG,iBAAiB,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,CAAA;AAMzE;;;GAGG;AAC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AC,eAAe,CAAC,CAAA;AA8B9B,KAAK,oBAAoB,GAAG,iBAAiB,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,CAAA;AAMzE;;;GAGG;AACH,eAAO,MAAM,WAAW,kGAnOrB,iBAAiB,CAAC,gBAAgB,CAAC;gIAwJnC,iBAAiB,CAAC,qBAAqB,CAAC;sEAqCuC,0BAA0B;mCA8B7D,oBAAoB;CAYjE,CAAA"}
@@ -2,6 +2,7 @@ import e from "../../node_modules/clsx/dist/clsx.js";
2
2
  import { useId as t } from "../../hooks/useId.js";
3
3
  import { Text as n } from "../../Text/Text.js";
4
4
  import { AlertFillIcon as r, CheckCircleFillIcon as i } from "../../node_modules/@primer/octicons-react/dist/index.esm.js";
5
+ import '../../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes-C05YPRXo.css';/* empty css */
5
6
  import { Checkbox as a } from "../Checkbox/Checkbox.js";
6
7
  import { Textarea as o } from "../Textarea/Textarea.js";
7
8
  import { TextInput as s } from "../TextInput/TextInput.js";
@@ -1 +1 @@
1
- {"version":3,"file":"FormControl.js","names":[],"sources":["../../../src/forms/FormControl/FormControl.tsx"],"sourcesContent":["import React, {PropsWithChildren} from 'react'\nimport {useId} from '../../hooks/useId'\nimport {clsx} from 'clsx'\nimport {AlertFillIcon, CheckCircleFillIcon} from '@primer/octicons-react'\n\nimport type {BaseProps} from '../../component-helpers'\nimport type {FormValidationStatus, FormInputSizes} from '../'\n\nimport {Checkbox} from '../Checkbox'\nimport {Select} from '../Select'\nimport {TextInput} from '../TextInput'\nimport {Textarea} from '../Textarea'\nimport {Radio} from '../Radio'\nimport {Text} from '../../Text'\n\nimport styles from './FormControl.module.css'\n\nexport type FormControlProps = BaseProps<HTMLElement> & {\n /**\n * Apply a decorative border to the form control.\n */\n hasBorder?: boolean\n /**\n * Applies full width styling.\n */\n fullWidth?: boolean\n /**\n * A unique identifier for the form control.\n * This is used to associate the form control with its associated label.\n * If an id is not provided, a unique id will be generated.\n */\n id?: string\n /**\n * Applies required styling to the label and input.\n */\n required?: boolean\n /**\n * Alternative sizes for inputs and labels.\n */\n size?: FormInputSizes\n /**\n * Provides contextual validation feedback to all children, showing relevant messaging where applicable.\n */\n validationStatus?: FormValidationStatus\n}\n\n/**\n * The Checkbox and the Radio components both use the trick of using a <label> to render the visual control,\n * and visually hiding the <input>. This means that, when you add a FormControl.Label alongside your\n * Checkbox/Radio, the <input> technically has two <label> elements associated with it.\n * That doesn't appear to be a problem (it's valid HTML and NVDA announces it correctly) but it does annoy\n * our Storybook Axe tests because they only seem to look at one of the labels.\n * To fix this, we recommend that the FormControl.Label always appears before the Checkbox/Radio in the DOM,\n * even though it visually appears after the Checkbox/Radio, as this keeps Storybook Axe happy.\n */\n\nconst Root = ({\n children,\n className,\n hasBorder,\n fullWidth,\n id,\n required,\n size = 'medium',\n validationStatus,\n ...rest\n}: PropsWithChildren<FormControlProps>) => {\n const uniqueId = useId(id)\n const childrenArr = React.Children.toArray(children)\n\n const isInlineControl = childrenArr.some(\n child => React.isValidElement(child) && (child.type === Checkbox || child.type === Radio),\n )\n\n const containsHint = childrenArr.some(child => React.isValidElement(child) && child.type === FormControlHint)\n const containsValidation = childrenArr.some(\n child => React.isValidElement(child) && child.type === FormControlValidation,\n )\n\n return (\n <section\n id={`FormControl--${uniqueId}`}\n className={clsx(\n styles.FormControl,\n fullWidth && styles[`FormControl--fullWidth`],\n isInlineControl && styles['FormControl--checkbox'],\n hasBorder && styles['FormControl--border'],\n className,\n )}\n {...rest}\n >\n {React.Children.map(children, child => {\n if (!React.isValidElement(child)) return child\n\n const describedBy =\n [containsHint && `${uniqueId}-hint`, containsValidation && `${uniqueId}-validation`]\n .filter(Boolean)\n .join(' ') || undefined\n\n if (child.type === TextInput) {\n const element = child as React.ReactElement<React.ComponentProps<typeof TextInput>>\n return React.cloneElement(element, {\n className: clsx(element.props.className),\n id: uniqueId,\n name: element.props.name || uniqueId,\n required: element.props.required || required,\n validationStatus: element.props.validationStatus || validationStatus,\n fullWidth,\n size,\n 'aria-describedby': describedBy,\n })\n }\n\n if (child.type === Textarea) {\n const element = child as React.ReactElement<React.ComponentProps<typeof Textarea>>\n return React.cloneElement(element, {\n className: clsx(element.props.className),\n id: uniqueId,\n name: element.props.name || uniqueId,\n required: element.props.required || required,\n validationStatus: element.props.validationStatus || validationStatus,\n fullWidth,\n size,\n 'aria-describedby': describedBy,\n })\n }\n\n if (child.type === Select) {\n const element = child as React.ReactElement<React.ComponentProps<typeof Select>>\n return React.cloneElement(element, {\n className: clsx(element.props.className),\n id: uniqueId,\n name: element.props.name || uniqueId,\n required: element.props.required || required,\n validationStatus: element.props.validationStatus || validationStatus,\n fullWidth,\n size,\n 'aria-describedby': describedBy,\n })\n }\n\n if (child.type === Checkbox) {\n const element = child as React.ReactElement<React.ComponentProps<typeof Checkbox>>\n return React.cloneElement(element, {\n className: clsx(element.props.className, styles['FormControl-control--checkbox']),\n id: uniqueId,\n name: element.props.name || uniqueId,\n required: element.props.required || required,\n validationStatus: element.props.validationStatus || validationStatus,\n 'aria-describedby': describedBy,\n })\n }\n\n if (child.type === Radio) {\n const element = child as React.ReactElement<React.ComponentProps<typeof Radio>>\n return React.cloneElement(element, {\n className: clsx(isInlineControl && styles['FormControl-control--radio'], element.props.className),\n id: uniqueId,\n name: element.props.name,\n required: element.props.required || required,\n 'aria-describedby': describedBy,\n })\n }\n\n if (child.type === FormControlLabel) {\n const element = child as React.ReactElement<React.ComponentProps<typeof FormControlLabel>>\n return React.cloneElement(element, {\n className: clsx(isInlineControl && styles['FormControl-label--checkbox'], element.props.className),\n htmlFor: uniqueId,\n children: element.props.children,\n required,\n validationStatus,\n size,\n showRequiredIndicator: isInlineControl ? false : element.props.showRequiredIndicator,\n })\n }\n\n if (child.type === FormControlValidation) {\n const element = child as React.ReactElement<React.ComponentProps<typeof FormControlValidation>>\n return React.cloneElement(element, {\n className: clsx(isInlineControl && styles['FormControl-validation-checkbox'], element.props.className),\n validationStatus,\n id: `${uniqueId}-validation`,\n })\n }\n\n if (child.type === FormControlHint) {\n const element = child as React.ReactElement<React.ComponentProps<typeof FormControlHint>>\n return React.cloneElement(element, {\n id: `${uniqueId}-hint`,\n })\n }\n\n return child\n })}\n </section>\n )\n}\n\ntype FormControlLabelProps = {\n htmlFor?: string\n required?: boolean\n showRequiredIndicator?: boolean\n size?: FormInputSizes\n validationStatus?: FormValidationStatus\n visuallyHidden?: boolean\n} & BaseProps<HTMLLabelElement>\n\nconst FormControlLabel = ({\n children,\n className,\n htmlFor,\n required,\n showRequiredIndicator = true,\n size = 'medium',\n validationStatus,\n visuallyHidden,\n ...rest\n}: PropsWithChildren<FormControlLabelProps>) => {\n return (\n <label\n htmlFor={htmlFor}\n className={clsx(\n styles['FormControl-label'],\n validationStatus && styles[`FormControl-label--${validationStatus}`],\n styles[`FormControl-label--${size}`],\n visuallyHidden && styles['FormControl-label--visually-hidden'],\n className,\n )}\n {...rest}\n >\n {React.Children.map(children, child => {\n if (React.isValidElement<FormControlHintProps>(child) && child.type === FormControlHint) {\n return React.cloneElement(child, {\n className: clsx(styles['FormControl--visible'], child.props.className),\n })\n }\n return child\n })}\n\n {required && showRequiredIndicator && (\n <span className={styles['FormControl-label-required']} aria-hidden>\n {' '}\n *\n </span>\n )}\n </label>\n )\n}\n\ntype FormControlValidationProps = {\n children: string\n validationStatus?: FormValidationStatus\n} & BaseProps<HTMLSpanElement>\n\nconst FormControlValidation = ({children, validationStatus, className, ...props}: FormControlValidationProps) => {\n return (\n <Text\n as=\"span\"\n size=\"100\"\n className={clsx(\n styles['FormControl-validation'],\n validationStatus && styles['FormControl-validation--animate-in'],\n validationStatus && styles[`FormControl-validation--${validationStatus}`],\n className,\n )}\n {...props}\n >\n {validationStatus === 'error' && (\n <span className={styles['FormControl-validation-error-icon']}>\n <AlertFillIcon />\n </span>\n )}\n {validationStatus === 'success' && (\n <span className={styles['FormControl-validation-success-icon']}>\n <CheckCircleFillIcon />\n </span>\n )}\n {children}\n </Text>\n )\n}\n\ntype FormControlHintProps = PropsWithChildren<BaseProps<HTMLSpanElement>>\n\nconst FormControlHint = ({className, ...rest}: FormControlHintProps) => {\n return <Text as=\"span\" size=\"100\" variant=\"muted\" className={clsx(styles['FormControl-hint'], className)} {...rest} />\n}\n\n/**\n * FormControl\n * {@link https://primer.style/brand/components/FormControl/ See usage examples}.\n */\nexport const FormControl = Object.assign(Root, {\n Label: FormControlLabel,\n Validation: FormControlValidation,\n Hint: FormControlHint,\n})\n"],"mappings":";;;;;;;;;;;;;AAwDA,IAAM,KAAQ,EACZ,aACA,cACA,cACA,cACA,OACA,aACA,UAAO,UACP,qBACA,GAAG,QACsC;CACzC,IAAM,IAAW,EAAM,EAAG,EACpB,IAAc,EAAM,SAAS,QAAQ,EAAS,EAE9C,IAAkB,EAAY,MAClC,MAAS,EAAM,eAAe,EAAM,KAAK,EAAM,SAAS,KAAY,EAAM,SAAS,GACpF,EAEK,IAAe,EAAY,MAAK,MAAS,EAAM,eAAe,EAAM,IAAI,EAAM,SAAS,EAAgB,EACvG,IAAqB,EAAY,MACrC,MAAS,EAAM,eAAe,EAAM,IAAI,EAAM,SAAS,EACxD;AAED,QACE,kBAAC,WAAD;EACE,IAAI,gBAAgB;EACpB,WAAW,EACT,EAAO,aACP,KAAa,EAAO,2BACpB,KAAmB,EAAO,0BAC1B,KAAa,EAAO,wBACpB,EACD;EACD,GAAI;YAEH,EAAM,SAAS,IAAI,IAAU,MAAS;AACrC,OAAI,CAAC,EAAM,eAAe,EAAM,CAAE,QAAO;GAEzC,IAAM,IACJ,CAAC,KAAgB,GAAG,EAAS,QAAQ,KAAsB,GAAG,EAAS,aAAa,CACjF,OAAO,QAAQ,CACf,KAAK,IAAI,IAAI,KAAA;AAElB,OAAI,EAAM,SAAS,GAAW;IAC5B,IAAM,IAAU;AAChB,WAAO,EAAM,aAAa,GAAS;KACjC,WAAW,EAAK,EAAQ,MAAM,UAAU;KACxC,IAAI;KACJ,MAAM,EAAQ,MAAM,QAAQ;KAC5B,U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CAAA;GACZ,CAAA;EAER,MAAqB,aACpB,kBAAC,QAAD;GAAM,WAAW,EAAO;aACtB,kBAAC,GAAD,EAAuB,CAAA;GAClB,CAAA;EAER;EACI;IAML,KAAmB,EAAC,cAAW,GAAG,QAC/B,kBAAC,GAAD;CAAM,IAAG;CAAO,MAAK;CAAM,SAAQ;CAAQ,WAAW,EAAK,EAAO,qBAAqB,EAAU;CAAE,GAAI;CAAQ,CAAA,EAO3G,IAAc,OAAO,OAAO,GAAM;CAC7C,OAAO;CACP,YAAY;CACZ,MAAM;CACP,CAAC"}
1
+ {"version":3,"file":"FormControl.js","names":[],"sources":["../../../src/forms/FormControl/FormControl.tsx"],"sourcesContent":["import React, {PropsWithChildren} from 'react'\nimport {useId} from '../../hooks/useId'\nimport {clsx} from 'clsx'\nimport {AlertFillIcon, CheckCircleFillIcon} from '@primer/octicons-react'\n\nimport type {BaseProps} from '../../component-helpers'\nimport type {FormValidationStatus, FormInputSizes} from '../'\n\nimport {Checkbox} from '../Checkbox'\nimport {Select} from '../Select'\nimport {TextInput} from '../TextInput'\nimport {Textarea} from '../Textarea'\nimport {Radio} from '../Radio'\nimport {Text} from '../../Text'\n\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes.css'\nimport styles from './FormControl.module.css'\n\nexport type FormControlProps = BaseProps<HTMLElement> & {\n /**\n * Apply a decorative border to the form control.\n */\n hasBorder?: boolean\n /**\n * Applies full width styling.\n */\n fullWidth?: boolean\n /**\n * A unique identifier for the form control.\n * This is used to associate the form control with its associated label.\n * If an id is not provided, a unique id will be generated.\n */\n id?: string\n /**\n * Applies required styling to the label and input.\n */\n required?: boolean\n /**\n * Alternative sizes for inputs and labels.\n */\n size?: FormInputSizes\n /**\n * Provides contextual validation feedback to all children, showing relevant messaging where applicable.\n */\n validationStatus?: FormValidationStatus\n}\n\n/**\n * The Checkbox and the Radio components both use the trick of using a <label> to render the visual control,\n * and visually hiding the <input>. This means that, when you add a FormControl.Label alongside your\n * Checkbox/Radio, the <input> technically has two <label> elements associated with it.\n * That doesn't appear to be a problem (it's valid HTML and NVDA announces it correctly) but it does annoy\n * our Storybook Axe tests because they only seem to look at one of the labels.\n * To fix this, we recommend that the FormControl.Label always appears before the Checkbox/Radio in the DOM,\n * even though it visually appears after the Checkbox/Radio, as this keeps Storybook Axe happy.\n */\n\nconst Root = ({\n children,\n className,\n hasBorder,\n fullWidth,\n id,\n required,\n size = 'medium',\n validationStatus,\n ...rest\n}: PropsWithChildren<FormControlProps>) => {\n const uniqueId = useId(id)\n const childrenArr = React.Children.toArray(children)\n\n const isInlineControl = childrenArr.some(\n child => React.isValidElement(child) && (child.type === Checkbox || child.type === Radio),\n )\n\n const containsHint = childrenArr.some(child => React.isValidElement(child) && child.type === FormControlHint)\n const containsValidation = childrenArr.some(\n child => React.isValidElement(child) && child.type === FormControlValidation,\n )\n\n return (\n <section\n id={`FormControl--${uniqueId}`}\n className={clsx(\n styles.FormControl,\n fullWidth && styles[`FormControl--fullWidth`],\n isInlineControl && styles['FormControl--checkbox'],\n hasBorder && styles['FormControl--border'],\n className,\n )}\n {...rest}\n >\n {React.Children.map(children, child => {\n if (!React.isValidElement(child)) return child\n\n const describedBy =\n [containsHint && `${uniqueId}-hint`, containsValidation && `${uniqueId}-validation`]\n .filter(Boolean)\n .join(' ') || undefined\n\n if (child.type === TextInput) {\n const element = child as React.ReactElement<React.ComponentProps<typeof TextInput>>\n return React.cloneElement(element, {\n className: clsx(element.props.className),\n id: uniqueId,\n name: element.props.name || uniqueId,\n required: element.props.required || required,\n validationStatus: element.props.validationStatus || validationStatus,\n fullWidth,\n size,\n 'aria-describedby': describedBy,\n })\n }\n\n if (child.type === Textarea) {\n const element = child as React.ReactElement<React.ComponentProps<typeof Textarea>>\n return React.cloneElement(element, {\n className: clsx(element.props.className),\n id: uniqueId,\n name: element.props.name || uniqueId,\n required: element.props.required || required,\n validationStatus: element.props.validationStatus || validationStatus,\n fullWidth,\n size,\n 'aria-describedby': describedBy,\n })\n }\n\n if (child.type === Select) {\n const element = child as React.ReactElement<React.ComponentProps<typeof Select>>\n return React.cloneElement(element, {\n className: clsx(element.props.className),\n id: uniqueId,\n name: element.props.name || uniqueId,\n required: element.props.required || required,\n validationStatus: element.props.validationStatus || validationStatus,\n fullWidth,\n size,\n 'aria-describedby': describedBy,\n })\n }\n\n if (child.type === Checkbox) {\n const element = child as React.ReactElement<React.ComponentProps<typeof Checkbox>>\n return React.cloneElement(element, {\n className: clsx(element.props.className, styles['FormControl-control--checkbox']),\n id: uniqueId,\n name: element.props.name || uniqueId,\n required: element.props.required || required,\n validationStatus: element.props.validationStatus || validationStatus,\n 'aria-describedby': describedBy,\n })\n }\n\n if (child.type === Radio) {\n const element = child as React.ReactElement<React.ComponentProps<typeof Radio>>\n return React.cloneElement(element, {\n className: clsx(isInlineControl && styles['FormControl-control--radio'], element.props.className),\n id: uniqueId,\n name: element.props.name,\n required: element.props.required || required,\n 'aria-describedby': describedBy,\n })\n }\n\n if (child.type === FormControlLabel) {\n const element = child as React.ReactElement<React.ComponentProps<typeof FormControlLabel>>\n return React.cloneElement(element, {\n className: clsx(isInlineControl && styles['FormControl-label--checkbox'], element.props.className),\n htmlFor: uniqueId,\n children: element.props.children,\n required,\n validationStatus,\n size,\n showRequiredIndicator: isInlineControl ? false : element.props.showRequiredIndicator,\n })\n }\n\n if (child.type === FormControlValidation) {\n const element = child as React.ReactElement<React.ComponentProps<typeof FormControlValidation>>\n return React.cloneElement(element, {\n className: clsx(isInlineControl && styles['FormControl-validation-checkbox'], element.props.className),\n validationStatus,\n id: `${uniqueId}-validation`,\n })\n }\n\n if (child.type === FormControlHint) {\n const element = child as React.ReactElement<React.ComponentProps<typeof FormControlHint>>\n return React.cloneElement(element, {\n id: `${uniqueId}-hint`,\n })\n }\n\n return child\n })}\n </section>\n )\n}\n\ntype FormControlLabelProps = {\n htmlFor?: string\n required?: boolean\n showRequiredIndicator?: boolean\n size?: FormInputSizes\n validationStatus?: FormValidationStatus\n visuallyHidden?: boolean\n} & BaseProps<HTMLLabelElement>\n\nconst FormControlLabel = ({\n children,\n className,\n htmlFor,\n required,\n showRequiredIndicator = true,\n size = 'medium',\n validationStatus,\n visuallyHidden,\n ...rest\n}: PropsWithChildren<FormControlLabelProps>) => {\n return (\n <label\n htmlFor={htmlFor}\n className={clsx(\n styles['FormControl-label'],\n validationStatus && styles[`FormControl-label--${validationStatus}`],\n styles[`FormControl-label--${size}`],\n visuallyHidden && styles['FormControl-label--visually-hidden'],\n className,\n )}\n {...rest}\n >\n {React.Children.map(children, child => {\n if (React.isValidElement<FormControlHintProps>(child) && child.type === FormControlHint) {\n return React.cloneElement(child, {\n className: clsx(styles['FormControl--visible'], child.props.className),\n })\n }\n return child\n })}\n\n {required && showRequiredIndicator && (\n <span className={styles['FormControl-label-required']} aria-hidden>\n {' '}\n *\n </span>\n )}\n </label>\n )\n}\n\ntype FormControlValidationProps = {\n children: string\n validationStatus?: FormValidationStatus\n} & BaseProps<HTMLSpanElement>\n\nconst FormControlValidation = ({children, validationStatus, className, ...props}: FormControlValidationProps) => {\n return (\n <Text\n as=\"span\"\n size=\"100\"\n className={clsx(\n styles['FormControl-validation'],\n validationStatus && styles['FormControl-validation--animate-in'],\n validationStatus && styles[`FormControl-validation--${validationStatus}`],\n className,\n )}\n {...props}\n >\n {validationStatus === 'error' && (\n <span className={styles['FormControl-validation-error-icon']}>\n <AlertFillIcon />\n </span>\n )}\n {validationStatus === 'success' && (\n <span className={styles['FormControl-validation-success-icon']}>\n <CheckCircleFillIcon />\n </span>\n )}\n {children}\n </Text>\n )\n}\n\ntype FormControlHintProps = PropsWithChildren<BaseProps<HTMLSpanElement>>\n\nconst FormControlHint = ({className, ...rest}: FormControlHintProps) => {\n return <Text as=\"span\" size=\"100\" variant=\"muted\" className={clsx(styles['FormControl-hint'], className)} {...rest} />\n}\n\n/**\n * FormControl\n * {@link https://primer.style/brand/components/FormControl/ See usage examples}.\n */\nexport const FormControl = Object.assign(Root, {\n Label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,EAAU;CAAE,GAAI;CAAQ,CAAA,EAO3G,IAAc,OAAO,OAAO,GAAM;CAC7C,OAAO;CACP,YAAY;CACZ,MAAM;CACP,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import React, { type InputHTMLAttributes } from 'react';
2
2
  import type { BaseProps } from '../../component-helpers';
3
+ import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes.css';
3
4
  export type RadioProps = {
4
5
  /**
5
6
  * Apply inactive visual appearance to the Radio
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../../src/forms/Radio/Radio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA0B,KAAK,mBAAmB,EAAoB,MAAM,OAAO,CAAA;AAKjG,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAA;AAItD,MAAM,MAAM,UAAU,GAAG;IACvB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,GAAG,OAAO,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC,GACzD,SAAS,CAAC,gBAAgB,CAAC,CAAA;AAsC7B,eAAO,MAAM,KAAK,yFAA4B,CAAA"}
1
+ {"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../../src/forms/Radio/Radio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA0B,KAAK,mBAAmB,EAAoB,MAAM,OAAO,CAAA;AAKjG,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAA;AAEtD,OAAO,2GAA2G,CAAA;AAGlH,MAAM,MAAM,UAAU,GAAG;IACvB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,GAAG,OAAO,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC,GACzD,SAAS,CAAC,gBAAgB,CAAC,CAAA;AAsC7B,eAAO,MAAM,KAAK,yFAA4B,CAAA"}
@@ -1,6 +1,7 @@
1
1
  import e from "../../node_modules/clsx/dist/clsx.js";
2
2
  import { useId as t } from "../../hooks/useId.js";
3
3
  import { useProvidedRefOrCreate as n } from "../../hooks/useRef.js";
4
+ import '../../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes-C05YPRXo.css';/* empty css */
4
5
  import r from "./Radio.module.js";
5
6
  import { forwardRef as i, useCallback as a } from "react";
6
7
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.js","names":[],"sources":["../../../src/forms/Radio/Radio.tsx"],"sourcesContent":["import React, {forwardRef, useCallback, type InputHTMLAttributes, type ReactElement} from 'react'\nimport {clsx} from 'clsx'\nimport {useId} from '../../hooks/useId'\nimport {useProvidedRefOrCreate} from '../../hooks/useRef'\n\nimport type {BaseProps} from '../../component-helpers'\n\nimport styles from './Radio.module.css'\n\nexport type RadioProps = {\n /**\n * Apply inactive visual appearance to the Radio\n */\n disabled?: boolean\n /**\n * Indicates whether the Radio must be checked\n */\n required?: boolean\n /**\n * A unique value that is never shown to the user.\n * Used during form submission and to identify which Radio inputs are selected\n */\n value?: string\n} & Exclude<InputHTMLAttributes<HTMLInputElement>, 'value'> &\n BaseProps<HTMLInputElement>\n\nconst RadioInternal = (\n {checked, className, disabled, id, onChange, required, value, ...rest}: RadioProps,\n ref,\n): ReactElement => {\n const inputRef = useProvidedRefOrCreate<HTMLInputElement | null>(ref || null)\n const uniqueId = useId(id)\n\n const onClick = useCallback(() => {\n if (!disabled && inputRef.current) {\n inputRef.current.click()\n }\n }, [disabled, inputRef])\n\n return (\n <span className={styles['Radio-wrapper']}>\n <input\n id={uniqueId}\n aria-checked={checked ? 'true' : 'false'}\n checked={checked}\n className={clsx(styles['Radio-input'])}\n disabled={disabled}\n name={value}\n onChange={onChange}\n ref={inputRef}\n required={required}\n type=\"radio\"\n value={value}\n {...rest}\n />\n <span className={clsx(styles.Radio, className)} onClick={onClick} tabIndex={-1} aria-hidden=\"true\">\n <span className={styles['Radio-dot']} />\n </span>\n </span>\n )\n}\n\nexport const Radio = forwardRef(RadioInternal)\n"],"mappings":";;;;;;AA8DA,IAAa,IAAQ,GAnCnB,EAAC,YAAS,cAAW,aAAU,OAAI,aAAU,aAAU,UAAO,GAAG,KACjE,MACiB;CACjB,IAAM,IAAW,EAAgD,KAAO,KAAK,EACvE,IAAW,EAAM,EAAG,EAEpB,IAAU,QAAkB;AAChC,EAAI,CAAC,KAAY,EAAS,WACxB,EAAS,QAAQ,OAAO;IAEzB,CAAC,GAAU,EAAS,CAAC;AAExB,QACE,kBAAC,QAAD;EAAM,WAAW,EAAO;YAAxB,CACE,kBAAC,SAAD;GACE,IAAI;GACJ,gBAAc,IAAU,SAAS;GACxB;GACT,WAAW,EAAK,EAAO,eAAe;GAC5B;GACV,MAAM;GACI;GACV,KAAK;GACK;GACV,MAAK;GACE;GACP,GAAI;GACJ,CAAA,EACF,kBAAC,QAAD;GAAM,WAAW,EAAK,EAAO,OAAO,EAAU;GAAW;GAAS,UAAU;GAAI,eAAY;aAC1F,kBAAC,QAAD,EAAM,WAAW,EAAO,cAAgB,CAAA;GACnC,CAAA,CACF;;EAImC"}
1
+ {"version":3,"file":"Radio.js","names":[],"sources":["../../../src/forms/Radio/Radio.tsx"],"sourcesContent":["import React, {forwardRef, useCallback, type InputHTMLAttributes, type ReactElement} from 'react'\nimport {clsx} from 'clsx'\nimport {useId} from '../../hooks/useId'\nimport {useProvidedRefOrCreate} from '../../hooks/useRef'\n\nimport type {BaseProps} from '../../component-helpers'\n\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes.css'\nimport styles from './Radio.module.css'\n\nexport type RadioProps = {\n /**\n * Apply inactive visual appearance to the Radio\n */\n disabled?: boolean\n /**\n * Indicates whether the Radio must be checked\n */\n required?: boolean\n /**\n * A unique value that is never shown to the user.\n * Used during form submission and to identify which Radio inputs are selected\n */\n value?: string\n} & Exclude<InputHTMLAttributes<HTMLInputElement>, 'value'> &\n BaseProps<HTMLInputElement>\n\nconst RadioInternal = (\n {checked, className, disabled, id, onChange, required, value, ...rest}: RadioProps,\n ref,\n): ReactElement => {\n const inputRef = useProvidedRefOrCreate<HTMLInputElement | null>(ref || null)\n const uniqueId = useId(id)\n\n const onClick = useCallback(() => {\n if (!disabled && inputRef.current) {\n inputRef.current.click()\n }\n }, [disabled, inputRef])\n\n return (\n <span className={styles['Radio-wrapper']}>\n <input\n id={uniqueId}\n aria-checked={checked ? 'true' : 'false'}\n checked={checked}\n className={clsx(styles['Radio-input'])}\n disabled={disabled}\n name={value}\n onChange={onChange}\n ref={inputRef}\n required={required}\n type=\"radio\"\n value={value}\n {...rest}\n />\n <span className={clsx(styles.Radio, className)} onClick={onClick} tabIndex={-1} aria-hidden=\"true\">\n <span className={styles['Radio-dot']} />\n </span>\n </span>\n )\n}\n\nexport const Radio = forwardRef(RadioInternal)\n"],"mappings":";;;;;;;AA+DA,IAAa,IAAQ,GAnCnB,EAAC,YAAS,cAAW,aAAU,OAAI,aAAU,aAAU,UAAO,GAAG,KACjE,MACiB;CACjB,IAAM,IAAW,EAAgD,KAAO,KAAK,EACvE,IAAW,EAAM,EAAG,EAEpB,IAAU,QAAkB;AAChC,EAAI,CAAC,KAAY,EAAS,WACxB,EAAS,QAAQ,OAAO;IAEzB,CAAC,GAAU,EAAS,CAAC;AAExB,QACE,kBAAC,QAAD;EAAM,WAAW,EAAO;YAAxB,CACE,kBAAC,SAAD;GACE,IAAI;GACJ,gBAAc,IAAU,SAAS;GACxB;GACT,WAAW,EAAK,EAAO,eAAe;GAC5B;GACV,MAAM;GACI;GACV,KAAK;GACK;GACV,MAAK;GACE;GACP,GAAI;GACJ,CAAA,EACF,kBAAC,QAAD;GAAM,WAAW,EAAK,EAAO,OAAO,EAAU;GAAW;GAAS,UAAU;GAAI,eAAY;aAC1F,kBAAC,QAAD,EAAM,WAAW,EAAO,cAAgB,CAAA;GACnC,CAAA,CACF;;EAImC"}
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { BaseProps } from '../../component-helpers';
3
3
  import type { FormInputSizes, FormValidationStatus } from '../form-types';
4
+ import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes.css';
4
5
  export type SelectProps = {
5
6
  /**
6
7
  * Applies full width styling.
@@ -1 +1 @@
1
- {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/forms/Select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAGvC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAK,EAAC,cAAc,EAAE,oBAAoB,EAAC,MAAM,eAAe,CAAA;AAIvE,MAAM,MAAM,WAAW,GAAG;IACxB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,IAAI,CAAC,EAAE,cAAc,CAAA;IACrB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;CACxC,GAAG,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC,GAC5D,SAAS,CAAC,iBAAiB,CAAC,CAAA;AAmD9B,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAA;CACd,GAAG,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC,CAAA;AAU/D,MAAM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AAG,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC,CAAA;AAUjE;;GAEG;AACH,eAAO,MAAM,MAAM;2CA9ByB,WAAW;6CAmBT,aAAa;CAczD,CAAA"}
@@ -1,4 +1,5 @@
1
1
  import e from "../../node_modules/clsx/dist/clsx.js";
2
+ import '../../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes-C05YPRXo.css';/* empty css */
2
3
  import t from "./Select.module.js";
3
4
  import { forwardRef as n } from "react";
4
5
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","names":[],"sources":["../../../src/forms/Select/Select.tsx"],"sourcesContent":["import React, {forwardRef} from 'react'\nimport {clsx} from 'clsx'\n\nimport type {BaseProps} from '../../component-helpers'\nimport type {FormInputSizes, FormValidationStatus} from '../form-types'\n\nimport styles from './Select.module.css'\n\nexport type SelectProps = {\n /**\n * Applies full width styling.\n */\n fullWidth?: boolean\n /**\n * Applies a required attribute to the input\n */\n required?: boolean\n /**\n * Applies alternative sizing to the input\n */\n size?: FormInputSizes\n /**\n * Placeholder text to display when no value is selected\n */\n placeholder?: string\n /**\n *\n */\n validationStatus?: FormValidationStatus\n} & Omit<React.InputHTMLAttributes<HTMLSelectElement>, 'size'> &\n BaseProps<HTMLSelectElement>\n\nconst _SelectRoot = (\n {\n children,\n className,\n disabled,\n fullWidth = false,\n placeholder,\n size = 'medium',\n validationStatus,\n ...rest\n }: SelectProps,\n ref,\n) => {\n return (\n <span\n className={clsx(\n styles['Select-wrapper'],\n styles[`Select-wrapper--${size}`],\n fullWidth && styles['Select-wrapper--fullWidth'],\n validationStatus && styles[`Select--${validationStatus}`],\n disabled && styles[`Select-wrapper--disabled`],\n )}\n >\n <select\n aria-invalid={validationStatus === 'error'}\n className={clsx(\n styles.Select,\n styles[`Select--${size}`],\n 'Select',\n fullWidth && styles['Select--fullWidth'],\n className,\n )}\n disabled={disabled}\n ref={ref}\n {...rest}\n >\n {placeholder && (\n <option value=\"\" disabled={disabled}>\n {placeholder}\n </option>\n )}\n {children}\n </select>\n </span>\n )\n}\n\nconst SelectRoot = forwardRef(_SelectRoot)\n\nexport type OptionProps = {\n value: string\n} & React.PropsWithChildren<React.HTMLProps<HTMLOptionElement>>\n\nconst Option = ({children, value, ...rest}: OptionProps) => {\n return (\n <option value={value} {...rest}>\n {children}\n </option>\n )\n}\n\nexport type OptGroupProps = {\n /**\n * Specifies that an option-group should be disabled\n */\n disabled?: string\n /**\n * Specifies a label for an option-group\n */\n label: string\n} & React.PropsWithChildren<React.HTMLProps<HTMLOptGroupElement>>\n\nconst OptGroup = ({children, label, ...rest}: OptGroupProps) => {\n return (\n <optgroup label={label} {...rest}>\n {children}\n </optgroup>\n )\n}\n\n/**\n * Select\n */\nexport const Select = Object.assign(SelectRoot, {\n Option,\n OptGroup,\n})\n"],"mappings":";;;;AA+EA,IAAM,IAAa,GA9CjB,EACE,aACA,cACA,aACA,eAAY,IACZ,gBACA,UAAO,UACP,qBACA,GAAG,KAEL,MAGE,kBAAC,QAAD;CACE,WAAW,EACT,EAAO,mBACP,EAAO,mBAAmB,MAC1B,KAAa,EAAO,8BACpB,KAAoB,EAAO,WAAW,MACtC,KAAY,EAAO,4BACpB;WAED,kBAAC,UAAD;EACE,gBAAc,MAAqB;EACnC,WAAW,EACT,EAAO,QACP,EAAO,WAAW,MAClB,UACA,KAAa,EAAO,sBACpB,EACD;EACS;EACL;EACL,GAAI;YAXN,CAaG,KACC,kBAAC,UAAD;GAAQ,OAAM;GAAa;aACxB;GACM,CAAA,EAEV,EACM;;CACJ,CAAA,CAI+B,EAoC7B,IAAS,OAAO,OAAO,GAAY;CAC9C,SA/Bc,EAAC,aAAU,UAAO,GAAG,QAEjC,kBAAC,UAAD;EAAe;EAAO,GAAI;EACvB;EACM,CAAA;CA4BX,WAbgB,EAAC,aAAU,UAAO,GAAG,QAEnC,kBAAC,YAAD;EAAiB;EAAO,GAAI;EACzB;EACQ,CAAA;CAUd,CAAC"}
1
+ {"version":3,"file":"Select.js","names":[],"sources":["../../../src/forms/Select/Select.tsx"],"sourcesContent":["import React, {forwardRef} from 'react'\nimport {clsx} from 'clsx'\n\nimport type {BaseProps} from '../../component-helpers'\nimport type {FormInputSizes, FormValidationStatus} from '../form-types'\n\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes.css'\nimport styles from './Select.module.css'\n\nexport type SelectProps = {\n /**\n * Applies full width styling.\n */\n fullWidth?: boolean\n /**\n * Applies a required attribute to the input\n */\n required?: boolean\n /**\n * Applies alternative sizing to the input\n */\n size?: FormInputSizes\n /**\n * Placeholder text to display when no value is selected\n */\n placeholder?: string\n /**\n *\n */\n validationStatus?: FormValidationStatus\n} & Omit<React.InputHTMLAttributes<HTMLSelectElement>, 'size'> &\n BaseProps<HTMLSelectElement>\n\nconst _SelectRoot = (\n {\n children,\n className,\n disabled,\n fullWidth = false,\n placeholder,\n size = 'medium',\n validationStatus,\n ...rest\n }: SelectProps,\n ref,\n) => {\n return (\n <span\n className={clsx(\n styles['Select-wrapper'],\n styles[`Select-wrapper--${size}`],\n fullWidth && styles['Select-wrapper--fullWidth'],\n validationStatus && styles[`Select--${validationStatus}`],\n disabled && styles[`Select-wrapper--disabled`],\n )}\n >\n <select\n aria-invalid={validationStatus === 'error'}\n className={clsx(\n styles.Select,\n styles[`Select--${size}`],\n 'Select',\n fullWidth && styles['Select--fullWidth'],\n className,\n )}\n disabled={disabled}\n ref={ref}\n {...rest}\n >\n {placeholder && (\n <option value=\"\" disabled={disabled}>\n {placeholder}\n </option>\n )}\n {children}\n </select>\n </span>\n )\n}\n\nconst SelectRoot = forwardRef(_SelectRoot)\n\nexport type OptionProps = {\n value: string\n} & React.PropsWithChildren<React.HTMLProps<HTMLOptionElement>>\n\nconst Option = ({children, value, ...rest}: OptionProps) => {\n return (\n <option value={value} {...rest}>\n {children}\n </option>\n )\n}\n\nexport type OptGroupProps = {\n /**\n * Specifies that an option-group should be disabled\n */\n disabled?: string\n /**\n * Specifies a label for an option-group\n */\n label: string\n} & React.PropsWithChildren<React.HTMLProps<HTMLOptGroupElement>>\n\nconst OptGroup = ({children, label, ...rest}: OptGroupProps) => {\n return (\n <optgroup label={label} {...rest}>\n {children}\n </optgroup>\n )\n}\n\n/**\n * Select\n */\nexport const Select = Object.assign(SelectRoot, {\n Option,\n OptGroup,\n})\n"],"mappings":";;;;;AAgFA,IAAM,IAAa,GA9CjB,EACE,aACA,cACA,aACA,eAAY,IACZ,gBACA,UAAO,UACP,qBACA,GAAG,KAEL,MAGE,kBAAC,QAAD;CACE,WAAW,EACT,EAAO,mBACP,EAAO,mBAAmB,MAC1B,KAAa,EAAO,8BACpB,KAAoB,EAAO,WAAW,MACtC,KAAY,EAAO,4BACpB;WAED,kBAAC,UAAD;EACE,gBAAc,MAAqB;EACnC,WAAW,EACT,EAAO,QACP,EAAO,WAAW,MAClB,UACA,KAAa,EAAO,sBACpB,EACD;EACS;EACL;EACL,GAAI;YAXN,CAaG,KACC,kBAAC,UAAD;GAAQ,OAAM;GAAa;aACxB;GACM,CAAA,EAEV,EACM;;CACJ,CAAA,CAI+B,EAoC7B,IAAS,OAAO,OAAO,GAAY;CAC9C,SA/Bc,EAAC,aAAU,UAAO,GAAG,QAEjC,kBAAC,UAAD;EAAe;EAAO,GAAI;EACvB;EACM,CAAA;CA4BX,WAbgB,EAAC,aAAU,UAAO,GAAG,QAEnC,kBAAC,YAAD;EAAiB;EAAO,GAAI;EACzB;EACQ,CAAA;CAUd,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { BaseProps } from '../../component-helpers';
3
3
  import type { FormInputSizes, FormValidationStatus } from '../form-types';
4
+ import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes.css';
4
5
  import type { Icon } from '@primer/octicons-react';
5
6
  type VisualType = React.ReactElement | React.ReactNode | Icon;
6
7
  export type TextInput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,CAAC,GACpE,SAAS,CAAC,gBAAgB,CAAC,CAAA;AAkK7B,eAAO,MAAM,SAAS,6FAAgC,CAAA"}
@@ -1,6 +1,7 @@
1
1
  import e from "../../node_modules/clsx/dist/clsx.js";
2
2
  import { useId as t } from "../../hooks/useId.js";
3
3
  import { Text as n } from "../../Text/Text.js";
4
+ import '../../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes-C05YPRXo.css';/* empty css */
4
5
  import r from "./TextInput.module.js";
5
6
  import i, { forwardRef as a, useMemo as o } from "react";
6
7
  import { jsx as s, jsxs as c } from "react/jsx-runtime";
@@ -1 +1 @@
1
- {"version":3,"file":"TextInput.js","names":[],"sources":["../../../src/forms/TextInput/TextInput.tsx"],"sourcesContent":["import React, {forwardRef, useMemo} from 'react'\nimport {clsx} from 'clsx'\nimport {useId} from '../../hooks/useId'\n\nimport type {BaseProps} from '../../component-helpers'\nimport type {FormInputSizes, FormValidationStatus} from '../form-types'\nimport {Text} from '../../Text'\n\nimport styles from './TextInput.module.css'\nimport type {Icon} from '@primer/octicons-react'\n\ntype VisualType = React.ReactElement | React.ReactNode | Icon\n\nexport type TextInputProps = {\n /**\n * Applies full width styling.\n */\n fullWidth?: boolean\n /**\n * Removes border\n */\n invisible?: boolean\n /**\n * Applies non-interactive text to start of input.\n */\n leadingText?: string\n /**\n * Applies non-interactive iconography to start of input.\n */\n leadingVisual?: VisualType\n /**\n * Applies monospace styling.\n */\n monospace?: boolean\n /**\n * Applies alternative sizing to the input\n */\n size?: FormInputSizes\n /**\n * Applies non-interactive text to end of input.\n */\n trailingText?: string\n /**\n * Applies non-interactive iconography to end of input.\n */\n trailingVisual?: VisualType\n /**\n * Constrains the input type to single line inputs.\n */\n type?: 'text' | 'number' | 'email' | 'password' | 'search' | 'tel' | 'url' | 'date' | 'time' | 'datetime-local'\n /**\n * Applies a required attribute to the input\n */\n required?: boolean\n /**\n *\n */\n validationStatus?: FormValidationStatus\n} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'> &\n BaseProps<HTMLInputElement>\n\nconst TextInputInternal = (\n {\n className,\n disabled,\n fullWidth = false,\n invisible = false,\n leadingText,\n leadingVisual: LeadingVisual,\n monospace,\n placeholder,\n size = 'medium',\n trailingText,\n trailingVisual: TrailingVisual,\n validationStatus,\n ...rest\n }: TextInputProps,\n ref,\n) => {\n const uniqueId = useId()\n\n const showLeadingText = leadingText && !LeadingVisual\n const showLeadingVisual = LeadingVisual && !leadingText\n const showTrailingText = trailingText && !TrailingVisual\n const showTrailingVisual = TrailingVisual && !trailingText\n\n const leadingTextId = `${uniqueId}-leading-text`\n const leadingVisualId = `${uniqueId}-leading-visual`\n const trailingVisualId = `${uniqueId}-trailing-visual`\n const trailingTextId = `${uniqueId}-trailing-text`\n\n const describedBy = useMemo(() => {\n const elements = [\n {condition: showLeadingText, id: leadingTextId},\n {condition: showLeadingVisual, id: leadingVisualId},\n {condition: showTrailingVisual, id: trailingVisualId},\n {condition: showTrailingText, id: trailingTextId},\n ]\n\n return elements\n .filter(({condition}) => condition)\n .map(({id}) => id)\n .join(' ')\n }, [\n showLeadingText,\n showLeadingVisual,\n showTrailingVisual,\n showTrailingText,\n leadingTextId,\n leadingVisualId,\n trailingVisualId,\n trailingTextId,\n ])\n\n return (\n <span\n className={clsx(\n styles['TextInput-wrapper'],\n styles[`TextInput-wrapper--${size}`],\n fullWidth && styles['TextInput-wrapper--fullWidth'],\n invisible && styles['TextInput-wrapper--invisible'],\n disabled && styles['TextInput-wrapper--disabled'],\n monospace && styles['TextInput-wrapper--monospace'],\n validationStatus && styles[`TextInput-wrapper--${validationStatus}`],\n )}\n >\n {showLeadingText && (\n <span\n className={clsx(\n styles['TextInput-leading-text'],\n styles[`TextInput-leading-text--${size}`],\n disabled && styles['TextInput-leading-text--disabled'],\n validationStatus && styles[`TextInput-leading-text--${validationStatus}`],\n )}\n >\n <Text\n size={size === 'large' ? '200' : '100'}\n as=\"span\"\n className={clsx(styles['TextInput-leading-text-inner'], styles[`TextInput-leading-text-inner--${size}`])}\n id={leadingTextId}\n >\n {leadingText}\n </Text>\n </span>\n )}\n {showLeadingVisual && (\n <span className={clsx(styles['TextInput-leading-visual'], styles[`TextInput-leading-visual--${size}`])}>\n {LeadingVisual &&\n React.isValidElement<{className?: string; width?: number; height?: number; id?: string}>(LeadingVisual)\n ? React.cloneElement(LeadingVisual, {\n className: clsx(\n styles['TextInput-leading-visual-icon'],\n styles[`TextInput-leading-visual-icon--${size}`],\n ),\n width: size === 'large' ? 20 : 16,\n height: size === 'large' ? 20 : 16,\n id: leadingVisualId,\n })\n : null}\n </span>\n )}\n <input\n type=\"text\"\n ref={ref}\n className={clsx(\n styles.TextInput,\n 'TextInput',\n styles[`TextInput--${size}`],\n fullWidth && styles['TextInput--fullWidth'],\n LeadingVisual && styles[`TextInput--has-leading-visual--${size}`],\n TrailingVisual && styles[`TextInput--has-trailing-visual--${size}`],\n validationStatus && styles[`TextInput--${validationStatus}`],\n leadingText && !LeadingVisual && styles['TextInput--has-leading-text'],\n trailingText && !TrailingVisual && styles['TextInput--has-trailing-text'],\n className,\n )}\n placeholder={placeholder}\n disabled={disabled}\n aria-invalid={validationStatus === 'error'}\n aria-describedby={describedBy || undefined}\n {...rest}\n />\n {showTrailingVisual && (\n <span className={clsx(styles['TextInput-trailing-visual'], styles[`TextInput-trailing-visual--${size}`])}>\n {TrailingVisual &&\n React.isValidElement<{className?: string; width?: number; height?: number; id?: string}>(TrailingVisual)\n ? React.cloneElement(TrailingVisual, {\n className: clsx(\n styles['TextInput-trailing-visual-icon'],\n styles[`TextInput-trailing-visual-icon--${size}`],\n ),\n width: size === 'large' ? 20 : 16,\n height: size === 'large' ? 20 : 16,\n id: trailingVisualId,\n })\n : null}\n </span>\n )}\n {showTrailingText && (\n <span\n className={clsx(\n styles['TextInput-trailing-text'],\n styles[`TextInput-trailing-text--${size}`],\n disabled && styles['TextInput-trailing-text--disabled'],\n validationStatus && styles[`TextInput-trailing-text--${validationStatus}`],\n )}\n >\n <Text\n size={size === 'large' ? '200' : '100'}\n as=\"span\"\n className={clsx(styles['TextInput-trailing-text-inner'], styles[`TextInput-trailing-text-inner--${size}`])}\n id={trailingTextId}\n >\n {trailingText}\n </Text>\n </span>\n )}\n </span>\n )\n}\n\nexport const TextInput = forwardRef(TextInputInternal)\n\nTextInput.displayName = 'TextInput'\n"],"mappings":";;;;;;AA6NA,IAAa,IAAY,GA/JvB,EACE,cACA,aACA,eAAY,IACZ,eAAY,IACZ,gBACA,eAAe,GACf,cACA,gBACA,UAAO,UACP,iBACA,gBAAgB,GAChB,qBACA,GAAG,KAEL,MACG;CACH,IAAM,IAAW,GAAO,EAElB,IAAkB,KAAe,CAAC,GAClC,IAAoB,KAAiB,CAAC,GACtC,IAAmB,KAAgB,CAAC,GACpC,IAAqB,KAAkB,CAAC,GAExC,IAAgB,GAAG,EAAS,gBAC5B,IAAkB,GAAG,EAAS,kBAC9B,IAAmB,GAAG,EAAS,mBAC/B,IAAiB,GAAG,EAAS,iBAE7B,IAAc,QAQX;EANL;GAAC,WAAW;GAAiB,IAAI;GAAc;EAC/C;GAAC,WAAW;GAAmB,IAAI;GAAgB;EACnD;GAAC,WAAW;GAAoB,IAAI;GAAiB;EACrD;GAAC,WAAW;GAAkB,IAAI;GAAe;EAG5C,CACJ,QAAQ,EAAC,mBAAe,EAAU,CAClC,KAAK,EAAC,YAAQ,EAAG,CACjB,KAAK,IAAI,EACX;EACD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,QACE,kBAAC,QAAD;EACE,WAAW,EACT,EAAO,sBACP,EAAO,sBAAsB,MAC7B,KAAa,EAAO,iCACpB,KAAa,EAAO,iCACpB,KAAY,EAAO,gCACnB,KAAa,EAAO,iCACpB,KAAoB,EAAO,sBAAsB,KAClD;YATH;GAWG,KACC,kBAAC,QAAD;IACE,WAAW,EACT,EAAO,2BACP,EAAO,2BAA2B,MAClC,KAAY,EAAO,qCACnB,KAAoB,EAAO,2BAA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jC,IAAG;KACH,WAAW,EAAK,EAAO,kCAAkC,EAAO,kCAAkC,KAAQ;KAC1G,IAAI;eAEH;KACI,CAAA;IACF,CAAA;GAEJ;;EAI2C;AAEtD,EAAU,cAAc"}
1
+ {"version":3,"file":"TextInput.js","names":[],"sources":["../../../src/forms/TextInput/TextInput.tsx"],"sourcesContent":["import React, {forwardRef, useMemo} from 'react'\nimport {clsx} from 'clsx'\nimport {useId} from '../../hooks/useId'\n\nimport type {BaseProps} from '../../component-helpers'\nimport type {FormInputSizes, FormValidationStatus} from '../form-types'\nimport {Text} from '../../Text'\n\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes.css'\nimport styles from './TextInput.module.css'\nimport type {Icon} from '@primer/octicons-react'\n\ntype VisualType = React.ReactElement | React.ReactNode | Icon\n\nexport type TextInputProps = {\n /**\n * Applies full width styling.\n */\n fullWidth?: boolean\n /**\n * Removes border\n */\n invisible?: boolean\n /**\n * Applies non-interactive text to start of input.\n */\n leadingText?: string\n /**\n * Applies non-interactive iconography to start of input.\n */\n leadingVisual?: VisualType\n /**\n * Applies monospace styling.\n */\n monospace?: boolean\n /**\n * Applies alternative sizing to the input\n */\n size?: FormInputSizes\n /**\n * Applies non-interactive text to end of input.\n */\n trailingText?: string\n /**\n * Applies non-interactive iconography to end of input.\n */\n trailingVisual?: VisualType\n /**\n * Constrains the input type to single line inputs.\n */\n type?: 'text' | 'number' | 'email' | 'password' | 'search' | 'tel' | 'url' | 'date' | 'time' | 'datetime-local'\n /**\n * Applies a required attribute to the input\n */\n required?: boolean\n /**\n *\n */\n validationStatus?: FormValidationStatus\n} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'> &\n BaseProps<HTMLInputElement>\n\nconst TextInputInternal = (\n {\n className,\n disabled,\n fullWidth = false,\n invisible = false,\n leadingText,\n leadingVisual: LeadingVisual,\n monospace,\n placeholder,\n size = 'medium',\n trailingText,\n trailingVisual: TrailingVisual,\n validationStatus,\n ...rest\n }: TextInputProps,\n ref,\n) => {\n const uniqueId = useId()\n\n const showLeadingText = leadingText && !LeadingVisual\n const showLeadingVisual = LeadingVisual && !leadingText\n const showTrailingText = trailingText && !TrailingVisual\n const showTrailingVisual = TrailingVisual && !trailingText\n\n const leadingTextId = `${uniqueId}-leading-text`\n const leadingVisualId = `${uniqueId}-leading-visual`\n const trailingVisualId = `${uniqueId}-trailing-visual`\n const trailingTextId = `${uniqueId}-trailing-text`\n\n const describedBy = useMemo(() => {\n const elements = [\n {condition: showLeadingText, id: leadingTextId},\n {condition: showLeadingVisual, id: leadingVisualId},\n {condition: showTrailingVisual, id: trailingVisualId},\n {condition: showTrailingText, id: trailingTextId},\n ]\n\n return elements\n .filter(({condition}) => condition)\n .map(({id}) => id)\n .join(' ')\n }, [\n showLeadingText,\n showLeadingVisual,\n showTrailingVisual,\n showTrailingText,\n leadingTextId,\n leadingVisualId,\n trailingVisualId,\n trailingTextId,\n ])\n\n return (\n <span\n className={clsx(\n styles['TextInput-wrapper'],\n styles[`TextInput-wrapper--${size}`],\n fullWidth && styles['TextInput-wrapper--fullWidth'],\n invisible && styles['TextInput-wrapper--invisible'],\n disabled && styles['TextInput-wrapper--disabled'],\n monospace && styles['TextInput-wrapper--monospace'],\n validationStatus && styles[`TextInput-wrapper--${validationStatus}`],\n )}\n >\n {showLeadingText && (\n <span\n className={clsx(\n styles['TextInput-leading-text'],\n styles[`TextInput-leading-text--${size}`],\n disabled && styles['TextInput-leading-text--disabled'],\n validationStatus && styles[`TextInput-leading-text--${validationStatus}`],\n )}\n >\n <Text\n size={size === 'large' ? '200' : '100'}\n as=\"span\"\n className={clsx(styles['TextInput-leading-text-inner'], styles[`TextInput-leading-text-inner--${size}`])}\n id={leadingTextId}\n >\n {leadingText}\n </Text>\n </span>\n )}\n {showLeadingVisual && (\n <span className={clsx(styles['TextInput-leading-visual'], styles[`TextInput-leading-visual--${size}`])}>\n {LeadingVisual &&\n React.isValidElement<{className?: string; width?: number; height?: number; id?: string}>(LeadingVisual)\n ? React.cloneElement(LeadingVisual, {\n className: clsx(\n styles['TextInput-leading-visual-icon'],\n styles[`TextInput-leading-visual-icon--${size}`],\n ),\n width: size === 'large' ? 20 : 16,\n height: size === 'large' ? 20 : 16,\n id: leadingVisualId,\n })\n : null}\n </span>\n )}\n <input\n type=\"text\"\n ref={ref}\n className={clsx(\n styles.TextInput,\n 'TextInput',\n styles[`TextInput--${size}`],\n fullWidth && styles['TextInput--fullWidth'],\n LeadingVisual && styles[`TextInput--has-leading-visual--${size}`],\n TrailingVisual && styles[`TextInput--has-trailing-visual--${size}`],\n validationStatus && styles[`TextInput--${validationStatus}`],\n leadingText && !LeadingVisual && styles['TextInput--has-leading-text'],\n trailingText && !TrailingVisual && styles['TextInput--has-trailing-text'],\n className,\n )}\n placeholder={placeholder}\n disabled={disabled}\n aria-invalid={validationStatus === 'error'}\n aria-describedby={describedBy || undefined}\n {...rest}\n />\n {showTrailingVisual && (\n <span className={clsx(styles['TextInput-trailing-visual'], styles[`TextInput-trailing-visual--${size}`])}>\n {TrailingVisual &&\n React.isValidElement<{className?: string; width?: number; height?: number; id?: string}>(TrailingVisual)\n ? React.cloneElement(TrailingVisual, {\n className: clsx(\n styles['TextInput-trailing-visual-icon'],\n styles[`TextInput-trailing-visual-icon--${size}`],\n ),\n width: size === 'large' ? 20 : 16,\n height: size === 'large' ? 20 : 16,\n id: trailingVisualId,\n })\n : null}\n </span>\n )}\n {showTrailingText && (\n <span\n className={clsx(\n styles['TextInput-trailing-text'],\n styles[`TextInput-trailing-text--${size}`],\n disabled && styles['TextInput-trailing-text--disabled'],\n validationStatus && styles[`TextInput-trailing-text--${validationStatus}`],\n )}\n >\n <Text\n size={size === 'large' ? '200' : '100'}\n as=\"span\"\n className={clsx(styles['TextInput-trailing-text-inner'], styles[`TextInput-trailing-text-inner--${size}`])}\n id={trailingTextId}\n >\n {trailingText}\n </Text>\n </span>\n )}\n </span>\n )\n}\n\nexport const TextInput = forwardRef(TextInputIntern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../../component-helpers';
3
3
  import type { FormInputSizes, FormValidationStatus } from '../form-types';
4
+ import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes.css';
4
5
  export declare const DEFAULT_TEXTAREA_ROWS = 7;
5
6
  export declare const DEFAULT_TEXTAREA_COLS = 30;
6
7
  export declare const DEFAULT_TEXTAREA_RESIZE = "both";
@@ -1 +1 @@
1
- {"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../src/forms/Textarea/Textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAGvC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAK,EAAC,cAAc,EAAE,oBAAoB,EAAC,MAAM,eAAe,CAAA;AAIvE,eAAO,MAAM,qBAAqB,IAAI,CAAA;AACtC,eAAO,MAAM,qBAAqB,KAAK,CAAA;AACvC,eAAO,MAAM,uBAAuB,SAAS,CAAA;AAE7C,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,cAAc,CAAA;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;IACvC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,UAAU,CAAA;CACrD,GAAG,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC,GACjE,SAAS,CAAC,mBAAmB,CAAC,CAAA;AAiEhC,eAAO,MAAM,QAAQ,4FAAwB,CAAA"}
1
+ {"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../src/forms/Textarea/Textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAGvC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAK,EAAC,cAAc,EAAE,oBAAoB,EAAC,MAAM,eAAe,CAAA;AAEvE,OAAO,2GAA2G,CAAA;AAGlH,eAAO,MAAM,qBAAqB,IAAI,CAAA;AACtC,eAAO,MAAM,qBAAqB,KAAK,CAAA;AACvC,eAAO,MAAM,uBAAuB,SAAS,CAAA;AAE7C,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,cAAc,CAAA;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;IACvC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,UAAU,CAAA;CACrD,GAAG,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC,GACjE,SAAS,CAAC,mBAAmB,CAAC,CAAA;AAiEhC,eAAO,MAAM,QAAQ,4FAAwB,CAAA"}
@@ -1,4 +1,5 @@
1
1
  import e from "../../node_modules/clsx/dist/clsx.js";
2
+ import '../../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes-C05YPRXo.css';/* empty css */
2
3
  import t from "./Textarea.module.js";
3
4
  import { forwardRef as n } from "react";
4
5
  import { jsx as r } from "react/jsx-runtime";
@@ -1 +1 @@
1
- {"version":3,"file":"Textarea.js","names":[],"sources":["../../../src/forms/Textarea/Textarea.tsx"],"sourcesContent":["import React, {forwardRef} from 'react'\nimport {clsx} from 'clsx'\n\nimport type {BaseProps} from '../../component-helpers'\nimport type {FormInputSizes, FormValidationStatus} from '../form-types'\n\nimport styles from './Textarea.module.css'\n\nexport const DEFAULT_TEXTAREA_ROWS = 7\nexport const DEFAULT_TEXTAREA_COLS = 30\nexport const DEFAULT_TEXTAREA_RESIZE = 'both'\n\nexport type TextareaProps = {\n /**\n * Applies full width styling.\n */\n fullWidth?: boolean\n /**\n * Removes border\n */\n invisible?: boolean\n /**\n * Applies monospace styling.\n */\n monospace?: boolean\n /**\n * Applies alternative sizing to the input\n */\n size?: FormInputSizes\n /**\n * Applies a required attribute to the input\n */\n required?: boolean\n /**\n *\n */\n validationStatus?: FormValidationStatus\n /**\n * Allows resizing of the textarea\n */\n resize?: 'none' | 'both' | 'horizontal' | 'vertical'\n} & Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'size'> &\n BaseProps<HTMLTextAreaElement>\n\nconst testIds = {\n root: 'Textarea',\n get outerContainer() {\n return `${this.root}-outer-container`\n },\n}\n\nconst _Textarea = (\n {\n children,\n className,\n cols = DEFAULT_TEXTAREA_COLS,\n disabled,\n fullWidth = false,\n invisible = false,\n monospace,\n placeholder,\n size = 'medium',\n validationStatus,\n required,\n resize = DEFAULT_TEXTAREA_RESIZE,\n rows = DEFAULT_TEXTAREA_ROWS,\n ...rest\n }: TextareaProps,\n ref,\n) => {\n return (\n <span\n className={clsx(\n styles['Textarea-wrapper'],\n fullWidth && styles['Textarea-wrapper--fullWidth'],\n invisible && styles['Textarea-wrapper--invisible'],\n disabled && styles['Textarea-wrapper--disabled'],\n monospace && styles['Textarea-wrapper--monospace'],\n validationStatus && styles[`Textarea-wrapper--${validationStatus}`],\n )}\n data-testid={testIds.outerContainer}\n >\n <textarea\n ref={ref}\n className={clsx(\n styles.Textarea,\n 'Textarea',\n styles[`Textarea--${size}`],\n styles[`Textarea-resize--${resize}`],\n fullWidth && styles['Textarea--fullWidth'],\n validationStatus && styles[`Textarea--${validationStatus}`],\n className,\n )}\n placeholder={placeholder}\n disabled={disabled}\n aria-invalid={validationStatus === 'error'}\n required={required}\n rows={rows}\n cols={cols}\n {...rest}\n >\n {children}\n </textarea>\n </span>\n )\n}\n\nexport const Textarea = forwardRef(_Textarea)\n\nTextarea.displayName = 'Textarea'\n"],"mappings":";;;;;AAQA,IAAa,IAAwB,GACxB,IAAwB,IACxB,IAA0B,QAkCjC,IAAU;CACd,MAAM;CACN,IAAI,iBAAiB;AACnB,SAAO,GAAG,KAAK,KAAK;;CAEvB,EA0DY,IAAW,GAvDtB,EACE,aACA,cACA,UAAA,IACA,aACA,eAAY,IACZ,eAAY,IACZ,cACA,gBACA,UAAO,UACP,qBACA,aACA,YAAS,GACT,UAAA,GACA,GAAG,KAEL,MAGE,kBAAC,QAAD;CACE,WAAW,EACT,EAAO,qBACP,KAAa,EAAO,gCACpB,KAAa,EAAO,gCACpB,KAAY,EAAO,+BACnB,KAAa,EAAO,gCACpB,KAAoB,EAAO,qBAAqB,KACjD;CACD,eAAa,EAAQ;WAErB,kBAAC,YAAD;EACO;EACL,WAAW,EACT,EAAO,UACP,YACA,EAAO,aAAa,MACpB,EAAO,oBAAoB,MAC3B,KAAa,EAAO,wBACpB,KAAoB,EAAO,aAAa,MACxC,EACD;EACY;EACH;EACV,gBAAc,MAAqB;EACzB;EACJ;EACA;EACN,GAAI;EAEH;EACQ,CAAA;CACN,CAAA,CAIkC;AAE7C,EAAS,cAAc"}
1
+ {"version":3,"file":"Textarea.js","names":[],"sources":["../../../src/forms/Textarea/Textarea.tsx"],"sourcesContent":["import React, {forwardRef} from 'react'\nimport {clsx} from 'clsx'\n\nimport type {BaseProps} from '../../component-helpers'\nimport type {FormInputSizes, FormValidationStatus} from '../form-types'\n\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes.css'\nimport styles from './Textarea.module.css'\n\nexport const DEFAULT_TEXTAREA_ROWS = 7\nexport const DEFAULT_TEXTAREA_COLS = 30\nexport const DEFAULT_TEXTAREA_RESIZE = 'both'\n\nexport type TextareaProps = {\n /**\n * Applies full width styling.\n */\n fullWidth?: boolean\n /**\n * Removes border\n */\n invisible?: boolean\n /**\n * Applies monospace styling.\n */\n monospace?: boolean\n /**\n * Applies alternative sizing to the input\n */\n size?: FormInputSizes\n /**\n * Applies a required attribute to the input\n */\n required?: boolean\n /**\n *\n */\n validationStatus?: FormValidationStatus\n /**\n * Allows resizing of the textarea\n */\n resize?: 'none' | 'both' | 'horizontal' | 'vertical'\n} & Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'size'> &\n BaseProps<HTMLTextAreaElement>\n\nconst testIds = {\n root: 'Textarea',\n get outerContainer() {\n return `${this.root}-outer-container`\n },\n}\n\nconst _Textarea = (\n {\n children,\n className,\n cols = DEFAULT_TEXTAREA_COLS,\n disabled,\n fullWidth = false,\n invisible = false,\n monospace,\n placeholder,\n size = 'medium',\n validationStatus,\n required,\n resize = DEFAULT_TEXTAREA_RESIZE,\n rows = DEFAULT_TEXTAREA_ROWS,\n ...rest\n }: TextareaProps,\n ref,\n) => {\n return (\n <span\n className={clsx(\n styles['Textarea-wrapper'],\n fullWidth && styles['Textarea-wrapper--fullWidth'],\n invisible && styles['Textarea-wrapper--invisible'],\n disabled && styles['Textarea-wrapper--disabled'],\n monospace && styles['Textarea-wrapper--monospace'],\n validationStatus && styles[`Textarea-wrapper--${validationStatus}`],\n )}\n data-testid={testIds.outerContainer}\n >\n <textarea\n ref={ref}\n className={clsx(\n styles.Textarea,\n 'Textarea',\n styles[`Textarea--${size}`],\n styles[`Textarea-resize--${resize}`],\n fullWidth && styles['Textarea--fullWidth'],\n validationStatus && styles[`Textarea--${validationStatus}`],\n className,\n )}\n placeholder={placeholder}\n disabled={disabled}\n aria-invalid={validationStatus === 'error'}\n required={required}\n rows={rows}\n cols={cols}\n {...rest}\n >\n {children}\n </textarea>\n </span>\n )\n}\n\nexport const Textarea = forwardRef(_Textarea)\n\nTextarea.displayName = 'Textarea'\n"],"mappings":";;;;;;AASA,IAAa,IAAwB,GACxB,IAAwB,IACxB,IAA0B,QAkCjC,IAAU;CACd,MAAM;CACN,IAAI,iBAAiB;AACnB,SAAO,GAAG,KAAK,KAAK;;CAEvB,EA0DY,IAAW,GAvDtB,EACE,aACA,cACA,UAAA,IACA,aACA,eAAY,IACZ,eAAY,IACZ,cACA,gBACA,UAAO,UACP,qBACA,aACA,YAAS,GACT,UAAA,GACA,GAAG,KAEL,MAGE,kBAAC,QAAD;CACE,WAAW,EACT,EAAO,qBACP,KAAa,EAAO,gCACpB,KAAa,EAAO,gCACpB,KAAY,EAAO,+BACnB,KAAa,EAAO,gCACpB,KAAoB,EAAO,qBAAqB,KACjD;CACD,eAAa,EAAQ;WAErB,kBAAC,YAAD;EACO;EACL,WAAW,EACT,EAAO,UACP,YACA,EAAO,aAAa,MACpB,EAAO,oBAAoB,MAC3B,KAAa,EAAO,wBACpB,KAAoB,EAAO,aAAa,MACxC,EACD;EACY;EACH;EACV,gBAAc,MAAqB;EACzB;EACJ;EACA;EACN,GAAI;EAEH;EACQ,CAAA;CACN,CAAA,CAIkC;AAE7C,EAAS,cAAc"}
@@ -1,7 +1,3 @@
1
- /**
2
- * Shared form (control) design tokens
3
- */
4
- import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes.css';
5
1
  export * from './Checkbox';
6
2
  export * from './Textarea';
7
3
  export * from './TextInput';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/forms/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,2GAA2G,CAAA;AAElH,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/forms/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA"}
@@ -1,15 +1,15 @@
1
1
  import React from 'react';
2
- export interface FocusTrapHookSettings {
2
+ export interface FocusTrapHookSettings<ContainerElement extends HTMLElement = HTMLElement, InitialFocusElement extends HTMLElement = HTMLElement> {
3
3
  /**
4
- * Ref that will be used for the trapping container. If not provided, one will
4
+ * Ref object that will be used for the trapping container. If not provided, one will
5
5
  * be created by this hook and returned.
6
6
  */
7
- containerRef: React.RefObject<HTMLElement | null>;
7
+ containerRef?: React.RefObject<ContainerElement | null>;
8
8
  /**
9
- * Ref for the element that should receive focus when the focus trap is first enabled.
9
+ * Ref object for the element that should receive focus when the focus trap is first enabled.
10
10
  * If not provided, one will be created by this hook and returned. Its use is optional.
11
11
  */
12
- initialFocusRef?: React.RefObject<HTMLElement | null>;
12
+ initialFocusRef?: React.RefObject<InitialFocusElement | null>;
13
13
  /**
14
14
  * Set to true to disable the focus trap and clean up listeners. Can be re-enabled at any time.
15
15
  */
@@ -24,8 +24,8 @@ export interface FocusTrapHookSettings {
24
24
  * that should trap focus.
25
25
  * @param settings {FocusTrapHookSettings}
26
26
  */
27
- export declare function useFocusTrap(settings?: FocusTrapHookSettings, dependencies?: React.DependencyList): {
28
- containerRef: React.RefObject<HTMLElement | null> | undefined;
29
- initialFocusRef: React.RefObject<HTMLElement | null> | undefined;
27
+ export declare function useFocusTrap<ContainerElement extends HTMLElement = HTMLElement, InitialFocusElement extends HTMLElement = HTMLElement>(settings?: FocusTrapHookSettings<ContainerElement, InitialFocusElement>, dependencies?: React.DependencyList): {
28
+ containerRef: React.RefObject<ContainerElement | null>;
29
+ initialFocusRef: React.RefObject<InitialFocusElement | null>;
30
30
  };
31
31
  //# sourceMappingURL=useFocusTrap.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFocusTrap.d.ts","sourceRoot":"","sources":["../../src/hooks/useFocusTrap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IAEjD;;;OAGG;IACH,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IAErD;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,CAAC,EAAE,qBAAqB,EAChC,YAAY,GAAE,KAAK,CAAC,cAAmB,GACtC;IACD,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,SAAS,CAAA;IAC7D,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,SAAS,CAAA;CACjE,CAyCA"}
1
+ {"version":3,"file":"useFocusTrap.d.ts","sourceRoot":"","sources":["../../src/hooks/useFocusTrap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,MAAM,WAAW,qBAAqB,CACpC,gBAAgB,SAAS,WAAW,GAAG,WAAW,EAClD,mBAAmB,SAAS,WAAW,GAAG,WAAW;IAErD;;;OAGG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAA;IAEvD;;;OAGG;IACH,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAA;IAE7D;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,gBAAgB,SAAS,WAAW,GAAG,WAAW,EAClD,mBAAmB,SAAS,WAAW,GAAG,WAAW,EAErD,QAAQ,CAAC,EAAE,qBAAqB,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,EACvE,YAAY,GAAE,KAAK,CAAC,cAAmB,GACtC;IACD,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAA;IACtD,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAA;CAC7D,CAsCA"}
@@ -1,28 +1,28 @@
1
- import e from "react";
2
- import { focusTrap as t } from "@primer/behaviors";
1
+ import { useProvidedRefOrCreate as e } from "./useRef.js";
2
+ import t from "react";
3
+ import { focusTrap as n } from "@primer/behaviors";
3
4
  //#region src/hooks/useFocusTrap.ts
4
- function n(n, r = []) {
5
- let i = n?.containerRef, a = n?.initialFocusRef, o = n?.disabled, s = e.useRef(null), c = e.useRef(null);
6
- !c.current && !n?.disabled && (c.current = document.activeElement);
7
- function l() {
8
- s.current?.abort(), n?.restoreFocusOnCleanUp && c.current instanceof HTMLElement && (c.current.focus(), c.current = null);
5
+ function r(r, i = []) {
6
+ let a = e(r?.containerRef), o = e(r?.initialFocusRef), s = r?.disabled, c = t.useRef(null), l = t.useRef(null);
7
+ function u() {
8
+ c.current?.abort(), r?.restoreFocusOnCleanUp && l.current instanceof HTMLElement && l.current.focus(), l.current = null;
9
9
  }
10
- return e.useEffect(() => {
11
- if (i?.current instanceof HTMLElement) if (o) l();
12
- else return s.current = t(i.current, a?.current ?? void 0) ?? null, () => {
13
- l();
10
+ return t.useEffect(() => {
11
+ if (a.current instanceof HTMLElement) if (s) u();
12
+ else return l.current ||= document.activeElement, c.current = n(a.current, o.current ?? void 0) ?? null, () => {
13
+ u();
14
14
  };
15
15
  }, [
16
- i,
17
16
  a,
18
17
  o,
19
- ...r
18
+ s,
19
+ ...i
20
20
  ]), {
21
- containerRef: i,
22
- initialFocusRef: a
21
+ containerRef: a,
22
+ initialFocusRef: o
23
23
  };
24
24
  }
25
25
  //#endregion
26
- export { n as useFocusTrap };
26
+ export { r as useFocusTrap };
27
27
 
28
28
  //# sourceMappingURL=useFocusTrap.js.map