@primer/react-brand 0.74.0 → 0.75.0-rc.5af1749e

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 (409) hide show
  1. package/docs/index.md +2 -2
  2. package/esm/Hero/sub-components/HeroLabel.d.ts +1 -0
  3. package/esm/Hero/sub-components/HeroLabel.d.ts.map +1 -1
  4. package/esm/Hero/sub-components/HeroLabel.js +7 -6
  5. package/esm/Hero/sub-components/HeroLabel.js.map +1 -1
  6. package/esm/TextCursorAnimation/TextCursorAnimation.d.ts +8 -3
  7. package/esm/TextCursorAnimation/TextCursorAnimation.d.ts.map +1 -1
  8. package/esm/TextCursorAnimation/TextCursorAnimation.js +53 -27
  9. package/esm/TextCursorAnimation/TextCursorAnimation.js.map +1 -1
  10. package/esm/TextCursorAnimation/TextCursorAnimation.module-BS4hPR8H.css +1 -0
  11. package/esm/TextCursorAnimation/TextCursorAnimation.module.js +14 -4
  12. package/esm/TextCursorAnimation/TextCursorAnimation.module.js.map +1 -1
  13. package/esm/hooks/useCursorAnimation.d.ts +8 -31
  14. package/esm/hooks/useCursorAnimation.d.ts.map +1 -1
  15. package/esm/hooks/useCursorAnimation.js +84 -36
  16. package/esm/hooks/useCursorAnimation.js.map +1 -1
  17. package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/base-DKbXhPKv.css +1 -0
  18. package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/colors-with-modes-BucKYl1n.css +1 -0
  19. package/lib/Hero/sub-components/HeroLabel.d.ts +1 -0
  20. package/lib/TextCursorAnimation/TextCursorAnimation.d.ts +8 -3
  21. package/lib/css/main.css +143 -99
  22. package/lib/design-tokens/css/tokens/base/colors/color-scales-with-modes.css +1 -1
  23. package/lib/design-tokens/css/tokens/base/colors/light.css +1 -1
  24. package/lib/design-tokens/css/tokens/base/size/size.css +1 -1
  25. package/lib/design-tokens/css/tokens/base/typography/typography.css +1 -1
  26. package/lib/design-tokens/css/tokens/functional/animation/base.css +1 -1
  27. package/lib/design-tokens/css/tokens/functional/colors/global-with-modes.css +1 -1
  28. package/lib/design-tokens/css/tokens/functional/colors/global.css +1 -1
  29. package/lib/design-tokens/css/tokens/functional/components/accordion/colors-with-modes.css +1 -1
  30. package/lib/design-tokens/css/tokens/functional/components/action-menu/colors-with-modes.css +1 -1
  31. package/lib/design-tokens/css/tokens/functional/components/anchor-nav/colors-with-modes.css +1 -1
  32. package/lib/design-tokens/css/tokens/functional/components/bento/base.css +1 -1
  33. package/lib/design-tokens/css/tokens/functional/components/blinking-cursor/colors-with-modes.css +1 -1
  34. package/lib/design-tokens/css/tokens/functional/components/breadcrumbs/colors-with-modes.css +1 -1
  35. package/lib/design-tokens/css/tokens/functional/components/button/colors-with-modes.css +1 -1
  36. package/lib/design-tokens/css/tokens/functional/components/card/base.css +1 -1
  37. package/lib/design-tokens/css/tokens/functional/components/card/colors-with-modes.css +1 -1
  38. package/lib/design-tokens/css/tokens/functional/components/card/colors.css +1 -1
  39. package/lib/design-tokens/css/tokens/functional/components/comparison-table/colors-with-modes.css +1 -1
  40. package/lib/design-tokens/css/tokens/functional/components/comparison-table/comparison-table.css +1 -1
  41. package/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes.css +1 -1
  42. package/lib/design-tokens/css/tokens/functional/components/cta-banner/colors-with-modes.css +1 -1
  43. package/lib/design-tokens/css/tokens/functional/components/eyebrow-banner/colors-with-modes.css +1 -1
  44. package/lib/design-tokens/css/tokens/functional/components/eyebrow-banner/eyebrow-banner.css +1 -1
  45. package/lib/design-tokens/css/tokens/functional/components/faq/base.css +1 -1
  46. package/lib/design-tokens/css/tokens/functional/components/faq/colors-with-modes.css +1 -1
  47. package/lib/design-tokens/css/tokens/functional/components/faq/colors.css +1 -1
  48. package/lib/design-tokens/css/tokens/functional/components/faq/faq.css +1 -1
  49. package/lib/design-tokens/css/tokens/functional/components/footer/base.css +1 -1
  50. package/lib/design-tokens/css/tokens/functional/components/footer/colors-with-modes.css +1 -1
  51. package/lib/design-tokens/css/tokens/functional/components/footer/colors.css +1 -1
  52. package/lib/design-tokens/css/tokens/functional/components/frosted-glass-vfx/base.css +1 -1
  53. package/lib/design-tokens/css/tokens/functional/components/frosted-glass-vfx/colors-with-modes.css +1 -1
  54. package/lib/design-tokens/css/tokens/functional/components/grid/colors-with-modes.css +1 -1
  55. package/lib/design-tokens/css/tokens/functional/components/grid/colors.css +1 -1
  56. package/lib/design-tokens/css/tokens/functional/components/grid/grid.css +1 -1
  57. package/lib/design-tokens/css/tokens/functional/components/hero/base.css +1 -1
  58. package/lib/design-tokens/css/tokens/functional/components/icon/colors-with-modes.css +1 -1
  59. package/lib/design-tokens/css/tokens/functional/components/icon/colors.css +1 -1
  60. package/lib/design-tokens/css/tokens/functional/components/ide/base.css +1 -1
  61. package/lib/design-tokens/css/tokens/functional/components/ide/colors-with-modes.css +1 -1
  62. package/lib/design-tokens/css/tokens/functional/components/image/base.css +1 -1
  63. package/lib/design-tokens/css/tokens/functional/components/inline-code/colors-with-modes.css +1 -1
  64. package/lib/design-tokens/css/tokens/functional/components/inline-code/colors.css +1 -1
  65. package/lib/design-tokens/css/tokens/functional/components/inline-link/base.css +1 -1
  66. package/lib/design-tokens/css/tokens/functional/components/inline-link/colors-with-modes.css +1 -1
  67. package/lib/design-tokens/css/tokens/functional/components/inline-link/colors.css +1 -1
  68. package/lib/design-tokens/css/tokens/functional/components/label/colors-with-modes.css +1 -1
  69. package/lib/design-tokens/css/tokens/functional/components/label/colors.css +1 -1
  70. package/lib/design-tokens/css/tokens/functional/components/link/colors-with-modes.css +1 -1
  71. package/lib/design-tokens/css/tokens/functional/components/link/colors.css +1 -1
  72. package/lib/design-tokens/css/tokens/functional/components/logosuite/base.css +1 -1
  73. package/lib/design-tokens/css/tokens/functional/components/logosuite/colors-with-modes.css +1 -1
  74. package/lib/design-tokens/css/tokens/functional/components/logosuite/colors.css +1 -1
  75. package/lib/design-tokens/css/tokens/functional/components/media-playlist/colors-with-modes.css +1 -1
  76. package/lib/design-tokens/css/tokens/functional/components/media-playlist/colors.css +1 -1
  77. package/lib/design-tokens/css/tokens/functional/components/nav-list/colors-with-modes.css +1 -1
  78. package/lib/design-tokens/css/tokens/functional/components/pricing-options/colors-with-modes.css +1 -1
  79. package/lib/design-tokens/css/tokens/functional/components/pricing-options/colors.css +1 -1
  80. package/lib/design-tokens/css/tokens/functional/components/pricing-options/pricing-options.css +1 -1
  81. package/lib/design-tokens/css/tokens/functional/components/prose/base.css +1 -1
  82. package/lib/design-tokens/css/tokens/functional/components/prose/colors-with-modes.css +1 -1
  83. package/lib/design-tokens/css/tokens/functional/components/river/base.css +1 -1
  84. package/lib/design-tokens/css/tokens/functional/components/river/river.css +1 -1
  85. package/lib/design-tokens/css/tokens/functional/components/river-story-scroll/colors-with-modes.css +1 -1
  86. package/lib/design-tokens/css/tokens/functional/components/section/section.css +1 -1
  87. package/lib/design-tokens/css/tokens/functional/components/statistic/base.css +1 -1
  88. package/lib/design-tokens/css/tokens/functional/components/sub-nav/base.css +1 -1
  89. package/lib/design-tokens/css/tokens/functional/components/sub-nav/colors-with-modes.css +1 -1
  90. package/lib/design-tokens/css/tokens/functional/components/subdomain-nav-bar/colors-with-modes.css +1 -1
  91. package/lib/design-tokens/css/tokens/functional/components/tabs/base.css +1 -1
  92. package/lib/design-tokens/css/tokens/functional/components/tabs/colors-with-modes.css +1 -1
  93. package/lib/design-tokens/css/tokens/functional/components/tabs/colors.css +1 -1
  94. package/lib/design-tokens/css/tokens/functional/components/testimonial/base.css +1 -1
  95. package/lib/design-tokens/css/tokens/functional/components/testimonial/colors-with-modes.css +1 -1
  96. package/lib/design-tokens/css/tokens/functional/components/testimonial/colors.css +1 -1
  97. package/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/base.css +8 -0
  98. package/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/colors-with-modes.css +7 -3
  99. package/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/colors.css +4 -2
  100. package/lib/design-tokens/css/tokens/functional/components/tiles/colors-with-modes.css +1 -1
  101. package/lib/design-tokens/css/tokens/functional/components/timeline/base.css +1 -1
  102. package/lib/design-tokens/css/tokens/functional/components/timeline/colors-with-modes.css +1 -1
  103. package/lib/design-tokens/css/tokens/functional/components/timeline/colors.css +1 -1
  104. package/lib/design-tokens/css/tokens/functional/components/token/colors-with-modes.css +1 -1
  105. package/lib/design-tokens/css/tokens/functional/components/token/colors.css +1 -1
  106. package/lib/design-tokens/css/tokens/functional/components/tooltip/colors-with-modes.css +1 -1
  107. package/lib/design-tokens/css/tokens/functional/components/tooltip/colors.css +1 -1
  108. package/lib/design-tokens/css/tokens/functional/components/video-player/base.css +1 -1
  109. package/lib/design-tokens/css/tokens/functional/components/video-player/colors-with-modes.css +1 -1
  110. package/lib/design-tokens/css/tokens/functional/size/border.css +1 -1
  111. package/lib/design-tokens/css/tokens/functional/size/breakpoints.css +1 -1
  112. package/lib/design-tokens/css/tokens/functional/size/size-coarse.css +1 -1
  113. package/lib/design-tokens/css/tokens/functional/size/size-fine.css +1 -1
  114. package/lib/design-tokens/css/tokens/functional/size/size.css +1 -1
  115. package/lib/design-tokens/css/tokens/functional/size/viewport.css +1 -1
  116. package/lib/design-tokens/css/tokens/functional/typography/typography-responsive.css +1 -1
  117. package/lib/design-tokens/css/tokens/functional/typography/typography.css +1 -1
  118. package/lib/design-tokens/js/module/tokens/base/colors/light.js +1 -1
  119. package/lib/design-tokens/js/module/tokens/base/size/size.js +1 -1
  120. package/lib/design-tokens/js/module/tokens/base/typography/typography.js +1 -1
  121. package/lib/design-tokens/js/module/tokens/functional/animation/base.js +1 -1
  122. package/lib/design-tokens/js/module/tokens/functional/colors/global.js +1 -1
  123. package/lib/design-tokens/js/module/tokens/functional/components/bento/base.js +1 -1
  124. package/lib/design-tokens/js/module/tokens/functional/components/card/base.js +1 -1
  125. package/lib/design-tokens/js/module/tokens/functional/components/card/colors.js +1 -1
  126. package/lib/design-tokens/js/module/tokens/functional/components/comparison-table/comparison-table.js +1 -1
  127. package/lib/design-tokens/js/module/tokens/functional/components/eyebrow-banner/eyebrow-banner.js +1 -1
  128. package/lib/design-tokens/js/module/tokens/functional/components/faq/base.js +1 -1
  129. package/lib/design-tokens/js/module/tokens/functional/components/faq/colors.js +1 -1
  130. package/lib/design-tokens/js/module/tokens/functional/components/faq/faq.js +1 -1
  131. package/lib/design-tokens/js/module/tokens/functional/components/footer/base.js +1 -1
  132. package/lib/design-tokens/js/module/tokens/functional/components/footer/colors.js +1 -1
  133. package/lib/design-tokens/js/module/tokens/functional/components/frosted-glass-vfx/base.js +1 -1
  134. package/lib/design-tokens/js/module/tokens/functional/components/grid/colors.js +1 -1
  135. package/lib/design-tokens/js/module/tokens/functional/components/grid/grid.js +1 -1
  136. package/lib/design-tokens/js/module/tokens/functional/components/hero/base.js +1 -1
  137. package/lib/design-tokens/js/module/tokens/functional/components/icon/colors.js +1 -1
  138. package/lib/design-tokens/js/module/tokens/functional/components/ide/base.js +1 -1
  139. package/lib/design-tokens/js/module/tokens/functional/components/image/base.js +1 -1
  140. package/lib/design-tokens/js/module/tokens/functional/components/inline-code/colors.js +1 -1
  141. package/lib/design-tokens/js/module/tokens/functional/components/inline-link/base.js +1 -1
  142. package/lib/design-tokens/js/module/tokens/functional/components/inline-link/colors.js +1 -1
  143. package/lib/design-tokens/js/module/tokens/functional/components/label/colors.js +1 -1
  144. package/lib/design-tokens/js/module/tokens/functional/components/link/colors.js +1 -1
  145. package/lib/design-tokens/js/module/tokens/functional/components/logosuite/base.js +1 -1
  146. package/lib/design-tokens/js/module/tokens/functional/components/logosuite/colors.js +1 -1
  147. package/lib/design-tokens/js/module/tokens/functional/components/media-playlist/colors.js +1 -1
  148. package/lib/design-tokens/js/module/tokens/functional/components/pricing-options/colors.js +1 -1
  149. package/lib/design-tokens/js/module/tokens/functional/components/pricing-options/pricing-options.js +1 -1
  150. package/lib/design-tokens/js/module/tokens/functional/components/prose/base.js +1 -1
  151. package/lib/design-tokens/js/module/tokens/functional/components/river/base.js +1 -1
  152. package/lib/design-tokens/js/module/tokens/functional/components/river/river.js +1 -1
  153. package/lib/design-tokens/js/module/tokens/functional/components/section/section.js +1 -1
  154. package/lib/design-tokens/js/module/tokens/functional/components/statistic/base.js +1 -1
  155. package/lib/design-tokens/js/module/tokens/functional/components/sub-nav/base.js +1 -1
  156. package/lib/design-tokens/js/module/tokens/functional/components/tabs/base.js +1 -1
  157. package/lib/design-tokens/js/module/tokens/functional/components/tabs/colors.js +1 -1
  158. package/lib/design-tokens/js/module/tokens/functional/components/testimonial/base.js +1 -1
  159. package/lib/design-tokens/js/module/tokens/functional/components/testimonial/colors.js +1 -1
  160. package/lib/design-tokens/js/module/tokens/functional/components/text-cursor-animation/base.js +14 -0
  161. package/lib/design-tokens/js/module/tokens/functional/components/text-cursor-animation/colors.js +10 -2
  162. package/lib/design-tokens/js/module/tokens/functional/components/timeline/base.js +1 -1
  163. package/lib/design-tokens/js/module/tokens/functional/components/timeline/colors.js +1 -1
  164. package/lib/design-tokens/js/module/tokens/functional/components/token/colors.js +1 -1
  165. package/lib/design-tokens/js/module/tokens/functional/components/tooltip/colors.js +1 -1
  166. package/lib/design-tokens/js/module/tokens/functional/components/video-player/base.js +1 -1
  167. package/lib/design-tokens/js/module/tokens/functional/size/border.js +1 -1
  168. package/lib/design-tokens/js/module/tokens/functional/size/breakpoints.js +1 -1
  169. package/lib/design-tokens/js/module/tokens/functional/size/size-coarse.js +1 -1
  170. package/lib/design-tokens/js/module/tokens/functional/size/size-fine.js +1 -1
  171. package/lib/design-tokens/js/module/tokens/functional/size/size.js +1 -1
  172. package/lib/design-tokens/js/module/tokens/functional/size/viewport.js +1 -1
  173. package/lib/design-tokens/js/module/tokens/functional/typography/typography-responsive.js +1 -1
  174. package/lib/design-tokens/js/module/tokens/functional/typography/typography.js +1 -1
  175. package/lib/design-tokens/js/tokens/base/colors/light.js +1 -1
  176. package/lib/design-tokens/js/tokens/base/size/size.js +1 -1
  177. package/lib/design-tokens/js/tokens/base/typography/typography.js +1 -1
  178. package/lib/design-tokens/js/tokens/functional/animation/base.js +1 -1
  179. package/lib/design-tokens/js/tokens/functional/colors/global.js +1 -1
  180. package/lib/design-tokens/js/tokens/functional/components/bento/base.js +1 -1
  181. package/lib/design-tokens/js/tokens/functional/components/card/base.js +1 -1
  182. package/lib/design-tokens/js/tokens/functional/components/card/colors.js +1 -1
  183. package/lib/design-tokens/js/tokens/functional/components/comparison-table/comparison-table.js +1 -1
  184. package/lib/design-tokens/js/tokens/functional/components/eyebrow-banner/eyebrow-banner.js +1 -1
  185. package/lib/design-tokens/js/tokens/functional/components/faq/base.js +1 -1
  186. package/lib/design-tokens/js/tokens/functional/components/faq/colors.js +1 -1
  187. package/lib/design-tokens/js/tokens/functional/components/faq/faq.js +1 -1
  188. package/lib/design-tokens/js/tokens/functional/components/footer/base.js +1 -1
  189. package/lib/design-tokens/js/tokens/functional/components/footer/colors.js +1 -1
  190. package/lib/design-tokens/js/tokens/functional/components/frosted-glass-vfx/base.js +1 -1
  191. package/lib/design-tokens/js/tokens/functional/components/grid/colors.js +1 -1
  192. package/lib/design-tokens/js/tokens/functional/components/grid/grid.js +1 -1
  193. package/lib/design-tokens/js/tokens/functional/components/hero/base.js +1 -1
  194. package/lib/design-tokens/js/tokens/functional/components/icon/colors.js +1 -1
  195. package/lib/design-tokens/js/tokens/functional/components/ide/base.js +1 -1
  196. package/lib/design-tokens/js/tokens/functional/components/image/base.js +1 -1
  197. package/lib/design-tokens/js/tokens/functional/components/inline-code/colors.js +1 -1
  198. package/lib/design-tokens/js/tokens/functional/components/inline-link/base.js +1 -1
  199. package/lib/design-tokens/js/tokens/functional/components/inline-link/colors.js +1 -1
  200. package/lib/design-tokens/js/tokens/functional/components/label/colors.js +1 -1
  201. package/lib/design-tokens/js/tokens/functional/components/link/colors.js +1 -1
  202. package/lib/design-tokens/js/tokens/functional/components/logosuite/base.js +1 -1
  203. package/lib/design-tokens/js/tokens/functional/components/logosuite/colors.js +1 -1
  204. package/lib/design-tokens/js/tokens/functional/components/media-playlist/colors.js +1 -1
  205. package/lib/design-tokens/js/tokens/functional/components/pricing-options/colors.js +1 -1
  206. package/lib/design-tokens/js/tokens/functional/components/pricing-options/pricing-options.js +1 -1
  207. package/lib/design-tokens/js/tokens/functional/components/prose/base.js +1 -1
  208. package/lib/design-tokens/js/tokens/functional/components/river/base.js +1 -1
  209. package/lib/design-tokens/js/tokens/functional/components/river/river.js +1 -1
  210. package/lib/design-tokens/js/tokens/functional/components/section/section.js +1 -1
  211. package/lib/design-tokens/js/tokens/functional/components/statistic/base.js +1 -1
  212. package/lib/design-tokens/js/tokens/functional/components/sub-nav/base.js +1 -1
  213. package/lib/design-tokens/js/tokens/functional/components/tabs/base.js +1 -1
  214. package/lib/design-tokens/js/tokens/functional/components/tabs/colors.js +1 -1
  215. package/lib/design-tokens/js/tokens/functional/components/testimonial/base.js +1 -1
  216. package/lib/design-tokens/js/tokens/functional/components/testimonial/colors.js +1 -1
  217. package/lib/design-tokens/js/tokens/functional/components/text-cursor-animation/base.js +6 -0
  218. package/lib/design-tokens/js/tokens/functional/components/text-cursor-animation/colors.js +4 -2
  219. package/lib/design-tokens/js/tokens/functional/components/timeline/base.js +1 -1
  220. package/lib/design-tokens/js/tokens/functional/components/timeline/colors.js +1 -1
  221. package/lib/design-tokens/js/tokens/functional/components/token/colors.js +1 -1
  222. package/lib/design-tokens/js/tokens/functional/components/tooltip/colors.js +1 -1
  223. package/lib/design-tokens/js/tokens/functional/components/video-player/base.js +1 -1
  224. package/lib/design-tokens/js/tokens/functional/size/border.js +1 -1
  225. package/lib/design-tokens/js/tokens/functional/size/breakpoints.js +1 -1
  226. package/lib/design-tokens/js/tokens/functional/size/size-coarse.js +1 -1
  227. package/lib/design-tokens/js/tokens/functional/size/size-fine.js +1 -1
  228. package/lib/design-tokens/js/tokens/functional/size/size.js +1 -1
  229. package/lib/design-tokens/js/tokens/functional/size/viewport.js +1 -1
  230. package/lib/design-tokens/js/tokens/functional/typography/typography-responsive.js +1 -1
  231. package/lib/design-tokens/js/tokens/functional/typography/typography.js +1 -1
  232. package/lib/design-tokens/json/colors.json +3 -1
  233. package/lib/design-tokens/scss/tokens/base/colors/light.scss +1 -1
  234. package/lib/design-tokens/scss/tokens/base/size/size.scss +1 -1
  235. package/lib/design-tokens/scss/tokens/base/typography/typography.scss +1 -1
  236. package/lib/design-tokens/scss/tokens/functional/animation/base.scss +1 -1
  237. package/lib/design-tokens/scss/tokens/functional/colors/global.scss +1 -1
  238. package/lib/design-tokens/scss/tokens/functional/components/bento/base.scss +1 -1
  239. package/lib/design-tokens/scss/tokens/functional/components/card/base.scss +1 -1
  240. package/lib/design-tokens/scss/tokens/functional/components/card/colors.scss +1 -1
  241. package/lib/design-tokens/scss/tokens/functional/components/comparison-table/comparison-table.scss +1 -1
  242. package/lib/design-tokens/scss/tokens/functional/components/eyebrow-banner/eyebrow-banner.scss +1 -1
  243. package/lib/design-tokens/scss/tokens/functional/components/faq/base.scss +1 -1
  244. package/lib/design-tokens/scss/tokens/functional/components/faq/colors.scss +1 -1
  245. package/lib/design-tokens/scss/tokens/functional/components/faq/faq.scss +1 -1
  246. package/lib/design-tokens/scss/tokens/functional/components/footer/base.scss +1 -1
  247. package/lib/design-tokens/scss/tokens/functional/components/footer/colors.scss +1 -1
  248. package/lib/design-tokens/scss/tokens/functional/components/frosted-glass-vfx/base.scss +1 -1
  249. package/lib/design-tokens/scss/tokens/functional/components/grid/colors.scss +1 -1
  250. package/lib/design-tokens/scss/tokens/functional/components/grid/grid.scss +1 -1
  251. package/lib/design-tokens/scss/tokens/functional/components/hero/base.scss +1 -1
  252. package/lib/design-tokens/scss/tokens/functional/components/icon/colors.scss +1 -1
  253. package/lib/design-tokens/scss/tokens/functional/components/ide/base.scss +1 -1
  254. package/lib/design-tokens/scss/tokens/functional/components/image/base.scss +1 -1
  255. package/lib/design-tokens/scss/tokens/functional/components/inline-code/colors.scss +1 -1
  256. package/lib/design-tokens/scss/tokens/functional/components/inline-link/base.scss +1 -1
  257. package/lib/design-tokens/scss/tokens/functional/components/inline-link/colors.scss +1 -1
  258. package/lib/design-tokens/scss/tokens/functional/components/label/colors.scss +1 -1
  259. package/lib/design-tokens/scss/tokens/functional/components/link/colors.scss +1 -1
  260. package/lib/design-tokens/scss/tokens/functional/components/logosuite/base.scss +1 -1
  261. package/lib/design-tokens/scss/tokens/functional/components/logosuite/colors.scss +1 -1
  262. package/lib/design-tokens/scss/tokens/functional/components/media-playlist/colors.scss +1 -1
  263. package/lib/design-tokens/scss/tokens/functional/components/pricing-options/colors.scss +1 -1
  264. package/lib/design-tokens/scss/tokens/functional/components/pricing-options/pricing-options.scss +1 -1
  265. package/lib/design-tokens/scss/tokens/functional/components/prose/base.scss +1 -1
  266. package/lib/design-tokens/scss/tokens/functional/components/river/base.scss +1 -1
  267. package/lib/design-tokens/scss/tokens/functional/components/river/river.scss +1 -1
  268. package/lib/design-tokens/scss/tokens/functional/components/section/section.scss +1 -1
  269. package/lib/design-tokens/scss/tokens/functional/components/statistic/base.scss +1 -1
  270. package/lib/design-tokens/scss/tokens/functional/components/sub-nav/base.scss +1 -1
  271. package/lib/design-tokens/scss/tokens/functional/components/tabs/base.scss +1 -1
  272. package/lib/design-tokens/scss/tokens/functional/components/tabs/colors.scss +1 -1
  273. package/lib/design-tokens/scss/tokens/functional/components/testimonial/base.scss +1 -1
  274. package/lib/design-tokens/scss/tokens/functional/components/testimonial/colors.scss +1 -1
  275. package/lib/design-tokens/scss/tokens/functional/components/text-cursor-animation/base.scss +5 -0
  276. package/lib/design-tokens/scss/tokens/functional/components/text-cursor-animation/colors.scss +4 -2
  277. package/lib/design-tokens/scss/tokens/functional/components/timeline/base.scss +1 -1
  278. package/lib/design-tokens/scss/tokens/functional/components/timeline/colors.scss +1 -1
  279. package/lib/design-tokens/scss/tokens/functional/components/token/colors.scss +1 -1
  280. package/lib/design-tokens/scss/tokens/functional/components/tooltip/colors.scss +1 -1
  281. package/lib/design-tokens/scss/tokens/functional/components/video-player/base.scss +1 -1
  282. package/lib/design-tokens/scss/tokens/functional/size/border.scss +1 -1
  283. package/lib/design-tokens/scss/tokens/functional/size/breakpoints.scss +1 -1
  284. package/lib/design-tokens/scss/tokens/functional/size/size-coarse.scss +1 -1
  285. package/lib/design-tokens/scss/tokens/functional/size/size-fine.scss +1 -1
  286. package/lib/design-tokens/scss/tokens/functional/size/size.scss +1 -1
  287. package/lib/design-tokens/scss/tokens/functional/size/viewport.scss +1 -1
  288. package/lib/design-tokens/scss/tokens/functional/typography/typography-responsive.scss +1 -1
  289. package/lib/design-tokens/scss/tokens/functional/typography/typography.scss +1 -1
  290. package/lib/design-tokens/ts/tokens/base/colors/light.d.ts +1 -1
  291. package/lib/design-tokens/ts/tokens/base/colors/light.js +1 -1
  292. package/lib/design-tokens/ts/tokens/base/size/size.d.ts +1 -1
  293. package/lib/design-tokens/ts/tokens/base/size/size.js +1 -1
  294. package/lib/design-tokens/ts/tokens/base/typography/typography.d.ts +1 -1
  295. package/lib/design-tokens/ts/tokens/base/typography/typography.js +1 -1
  296. package/lib/design-tokens/ts/tokens/functional/animation/base.d.ts +1 -1
  297. package/lib/design-tokens/ts/tokens/functional/animation/base.js +1 -1
  298. package/lib/design-tokens/ts/tokens/functional/colors/global.d.ts +1 -1
  299. package/lib/design-tokens/ts/tokens/functional/colors/global.js +1 -1
  300. package/lib/design-tokens/ts/tokens/functional/components/bento/base.d.ts +1 -1
  301. package/lib/design-tokens/ts/tokens/functional/components/bento/base.js +1 -1
  302. package/lib/design-tokens/ts/tokens/functional/components/card/base.d.ts +1 -1
  303. package/lib/design-tokens/ts/tokens/functional/components/card/base.js +1 -1
  304. package/lib/design-tokens/ts/tokens/functional/components/card/colors.d.ts +1 -1
  305. package/lib/design-tokens/ts/tokens/functional/components/card/colors.js +1 -1
  306. package/lib/design-tokens/ts/tokens/functional/components/comparison-table/comparison-table.d.ts +1 -1
  307. package/lib/design-tokens/ts/tokens/functional/components/comparison-table/comparison-table.js +1 -1
  308. package/lib/design-tokens/ts/tokens/functional/components/eyebrow-banner/eyebrow-banner.d.ts +1 -1
  309. package/lib/design-tokens/ts/tokens/functional/components/eyebrow-banner/eyebrow-banner.js +1 -1
  310. package/lib/design-tokens/ts/tokens/functional/components/faq/base.d.ts +1 -1
  311. package/lib/design-tokens/ts/tokens/functional/components/faq/base.js +1 -1
  312. package/lib/design-tokens/ts/tokens/functional/components/faq/colors.d.ts +1 -1
  313. package/lib/design-tokens/ts/tokens/functional/components/faq/colors.js +1 -1
  314. package/lib/design-tokens/ts/tokens/functional/components/faq/faq.d.ts +1 -1
  315. package/lib/design-tokens/ts/tokens/functional/components/faq/faq.js +1 -1
  316. package/lib/design-tokens/ts/tokens/functional/components/footer/base.d.ts +1 -1
  317. package/lib/design-tokens/ts/tokens/functional/components/footer/base.js +1 -1
  318. package/lib/design-tokens/ts/tokens/functional/components/footer/colors.d.ts +1 -1
  319. package/lib/design-tokens/ts/tokens/functional/components/footer/colors.js +1 -1
  320. package/lib/design-tokens/ts/tokens/functional/components/frosted-glass-vfx/base.d.ts +1 -1
  321. package/lib/design-tokens/ts/tokens/functional/components/frosted-glass-vfx/base.js +1 -1
  322. package/lib/design-tokens/ts/tokens/functional/components/grid/colors.d.ts +1 -1
  323. package/lib/design-tokens/ts/tokens/functional/components/grid/colors.js +1 -1
  324. package/lib/design-tokens/ts/tokens/functional/components/grid/grid.d.ts +1 -1
  325. package/lib/design-tokens/ts/tokens/functional/components/grid/grid.js +1 -1
  326. package/lib/design-tokens/ts/tokens/functional/components/hero/base.d.ts +1 -1
  327. package/lib/design-tokens/ts/tokens/functional/components/hero/base.js +1 -1
  328. package/lib/design-tokens/ts/tokens/functional/components/icon/colors.d.ts +1 -1
  329. package/lib/design-tokens/ts/tokens/functional/components/icon/colors.js +1 -1
  330. package/lib/design-tokens/ts/tokens/functional/components/ide/base.d.ts +1 -1
  331. package/lib/design-tokens/ts/tokens/functional/components/ide/base.js +1 -1
  332. package/lib/design-tokens/ts/tokens/functional/components/image/base.d.ts +1 -1
  333. package/lib/design-tokens/ts/tokens/functional/components/image/base.js +1 -1
  334. package/lib/design-tokens/ts/tokens/functional/components/inline-code/colors.d.ts +1 -1
  335. package/lib/design-tokens/ts/tokens/functional/components/inline-code/colors.js +1 -1
  336. package/lib/design-tokens/ts/tokens/functional/components/inline-link/base.d.ts +1 -1
  337. package/lib/design-tokens/ts/tokens/functional/components/inline-link/base.js +1 -1
  338. package/lib/design-tokens/ts/tokens/functional/components/inline-link/colors.d.ts +1 -1
  339. package/lib/design-tokens/ts/tokens/functional/components/inline-link/colors.js +1 -1
  340. package/lib/design-tokens/ts/tokens/functional/components/label/colors.d.ts +1 -1
  341. package/lib/design-tokens/ts/tokens/functional/components/label/colors.js +1 -1
  342. package/lib/design-tokens/ts/tokens/functional/components/link/colors.d.ts +1 -1
  343. package/lib/design-tokens/ts/tokens/functional/components/link/colors.js +1 -1
  344. package/lib/design-tokens/ts/tokens/functional/components/logosuite/base.d.ts +1 -1
  345. package/lib/design-tokens/ts/tokens/functional/components/logosuite/base.js +1 -1
  346. package/lib/design-tokens/ts/tokens/functional/components/logosuite/colors.d.ts +1 -1
  347. package/lib/design-tokens/ts/tokens/functional/components/logosuite/colors.js +1 -1
  348. package/lib/design-tokens/ts/tokens/functional/components/media-playlist/colors.d.ts +1 -1
  349. package/lib/design-tokens/ts/tokens/functional/components/media-playlist/colors.js +1 -1
  350. package/lib/design-tokens/ts/tokens/functional/components/pricing-options/colors.d.ts +1 -1
  351. package/lib/design-tokens/ts/tokens/functional/components/pricing-options/colors.js +1 -1
  352. package/lib/design-tokens/ts/tokens/functional/components/pricing-options/pricing-options.d.ts +1 -1
  353. package/lib/design-tokens/ts/tokens/functional/components/pricing-options/pricing-options.js +1 -1
  354. package/lib/design-tokens/ts/tokens/functional/components/prose/base.d.ts +1 -1
  355. package/lib/design-tokens/ts/tokens/functional/components/prose/base.js +1 -1
  356. package/lib/design-tokens/ts/tokens/functional/components/river/base.d.ts +1 -1
  357. package/lib/design-tokens/ts/tokens/functional/components/river/base.js +1 -1
  358. package/lib/design-tokens/ts/tokens/functional/components/river/river.d.ts +1 -1
  359. package/lib/design-tokens/ts/tokens/functional/components/river/river.js +1 -1
  360. package/lib/design-tokens/ts/tokens/functional/components/section/section.d.ts +1 -1
  361. package/lib/design-tokens/ts/tokens/functional/components/section/section.js +1 -1
  362. package/lib/design-tokens/ts/tokens/functional/components/statistic/base.d.ts +1 -1
  363. package/lib/design-tokens/ts/tokens/functional/components/statistic/base.js +1 -1
  364. package/lib/design-tokens/ts/tokens/functional/components/sub-nav/base.d.ts +1 -1
  365. package/lib/design-tokens/ts/tokens/functional/components/sub-nav/base.js +1 -1
  366. package/lib/design-tokens/ts/tokens/functional/components/tabs/base.d.ts +1 -1
  367. package/lib/design-tokens/ts/tokens/functional/components/tabs/base.js +1 -1
  368. package/lib/design-tokens/ts/tokens/functional/components/tabs/colors.d.ts +1 -1
  369. package/lib/design-tokens/ts/tokens/functional/components/tabs/colors.js +1 -1
  370. package/lib/design-tokens/ts/tokens/functional/components/testimonial/base.d.ts +1 -1
  371. package/lib/design-tokens/ts/tokens/functional/components/testimonial/base.js +1 -1
  372. package/lib/design-tokens/ts/tokens/functional/components/testimonial/colors.d.ts +1 -1
  373. package/lib/design-tokens/ts/tokens/functional/components/testimonial/colors.js +1 -1
  374. package/lib/design-tokens/ts/tokens/functional/components/text-cursor-animation/base.d.ts +17 -0
  375. package/lib/design-tokens/ts/tokens/functional/components/text-cursor-animation/base.js +14 -0
  376. package/lib/design-tokens/ts/tokens/functional/components/text-cursor-animation/colors.d.ts +4 -2
  377. package/lib/design-tokens/ts/tokens/functional/components/text-cursor-animation/colors.js +4 -2
  378. package/lib/design-tokens/ts/tokens/functional/components/timeline/base.d.ts +1 -1
  379. package/lib/design-tokens/ts/tokens/functional/components/timeline/base.js +1 -1
  380. package/lib/design-tokens/ts/tokens/functional/components/timeline/colors.d.ts +1 -1
  381. package/lib/design-tokens/ts/tokens/functional/components/timeline/colors.js +1 -1
  382. package/lib/design-tokens/ts/tokens/functional/components/token/colors.d.ts +1 -1
  383. package/lib/design-tokens/ts/tokens/functional/components/token/colors.js +1 -1
  384. package/lib/design-tokens/ts/tokens/functional/components/tooltip/colors.d.ts +1 -1
  385. package/lib/design-tokens/ts/tokens/functional/components/tooltip/colors.js +1 -1
  386. package/lib/design-tokens/ts/tokens/functional/components/video-player/base.d.ts +1 -1
  387. package/lib/design-tokens/ts/tokens/functional/components/video-player/base.js +1 -1
  388. package/lib/design-tokens/ts/tokens/functional/size/border.d.ts +1 -1
  389. package/lib/design-tokens/ts/tokens/functional/size/border.js +1 -1
  390. package/lib/design-tokens/ts/tokens/functional/size/breakpoints.d.ts +1 -1
  391. package/lib/design-tokens/ts/tokens/functional/size/breakpoints.js +1 -1
  392. package/lib/design-tokens/ts/tokens/functional/size/size-coarse.d.ts +1 -1
  393. package/lib/design-tokens/ts/tokens/functional/size/size-coarse.js +1 -1
  394. package/lib/design-tokens/ts/tokens/functional/size/size-fine.d.ts +1 -1
  395. package/lib/design-tokens/ts/tokens/functional/size/size-fine.js +1 -1
  396. package/lib/design-tokens/ts/tokens/functional/size/size.d.ts +1 -1
  397. package/lib/design-tokens/ts/tokens/functional/size/size.js +1 -1
  398. package/lib/design-tokens/ts/tokens/functional/size/viewport.d.ts +1 -1
  399. package/lib/design-tokens/ts/tokens/functional/size/viewport.js +1 -1
  400. package/lib/design-tokens/ts/tokens/functional/typography/typography-responsive.d.ts +1 -1
  401. package/lib/design-tokens/ts/tokens/functional/typography/typography-responsive.js +1 -1
  402. package/lib/design-tokens/ts/tokens/functional/typography/typography.d.ts +1 -1
  403. package/lib/design-tokens/ts/tokens/functional/typography/typography.js +1 -1
  404. package/lib/hooks/useCursorAnimation.d.ts +8 -31
  405. package/lib/index.js +1 -1
  406. package/llms.txt +2 -2
  407. package/package.json +1 -1
  408. package/esm/TextCursorAnimation/TextCursorAnimation.module-BJLhwKrK.css +0 -1
  409. package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/colors-with-modes-BODdIvrY.css +0 -1
package/docs/index.md CHANGED
@@ -1,6 +1,6 @@
1
- # Primer Brand docs (v0.74.0)
1
+ # Primer Brand docs (v0.75.0-rc.5af1749e)
2
2
 
3
- These docs are bundled with `@primer/react-brand@0.74.0` and match your installed version.
3
+ These docs are bundled with `@primer/react-brand@0.75.0-rc.5af1749e` 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.
@@ -3,6 +3,7 @@ import type { BaseProps } from '../../component-helpers';
3
3
  export type HeroLabelProps = Omit<TextProps, 'as' | 'ref' | 'animate'> & Omit<BaseProps<HTMLSpanElement>, 'animate'> & {
4
4
  animate?: boolean;
5
5
  animationDelay?: number;
6
+ initialText?: string;
6
7
  };
7
8
  export declare const HeroLabel: import("react").ForwardRefExoticComponent<Omit<HeroLabelProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
8
9
  //# sourceMappingURL=HeroLabel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"HeroLabel.d.ts","sourceRoot":"","sources":["../../../src/Hero/sub-components/HeroLabel.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAA;AACpC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAA;AAMtD,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,GAAG,KAAK,GAAG,SAAS,CAAC,GACpE,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,EAAE,SAAS,CAAC,GAAG;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAA;AAEH,eAAO,MAAM,SAAS,yHA0BrB,CAAA"}
1
+ {"version":3,"file":"HeroLabel.d.ts","sourceRoot":"","sources":["../../../src/Hero/sub-components/HeroLabel.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAA;AACpC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAA;AAMtD,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,GAAG,KAAK,GAAG,SAAS,CAAC,GACpE,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,EAAE,SAAS,CAAC,GAAG;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAEH,eAAO,MAAM,SAAS,yHAgCrB,CAAA"}
@@ -5,16 +5,17 @@ import r from "../Hero.module.js";
5
5
  import { forwardRef as i } from "react";
6
6
  import { jsx as a } from "react/jsx-runtime";
7
7
  //#region src/Hero/sub-components/HeroLabel.tsx
8
- var o = i(({ children: i, className: o, variant: s = "muted", animate: c = !1, animationDelay: l = 1e3, ...u }, d) => {
9
- let { variant: f, enableAnimation: p } = t(), m = f === "gridline" || f === "gridline-expressive", h = p || c, g = m && p || c;
8
+ var o = i(({ children: i, className: o, variant: s = "muted", animate: c = !1, animationDelay: l = 1e3, initialText: u, ...d }, f) => {
9
+ let { variant: p, enableAnimation: m } = t(), h = p === "gridline" || p === "gridline-expressive", g = m || c, _ = h && m || c;
10
10
  return /* @__PURE__ */ a("span", {
11
- ref: d,
11
+ ref: f,
12
12
  className: e(r["Hero-label"], o),
13
- ...u,
13
+ ...d,
14
14
  children: /* @__PURE__ */ a(n, {
15
15
  variant: s,
16
- animate: h,
17
- delay: g ? l : 0,
16
+ animate: g,
17
+ delay: _ ? l : 0,
18
+ initialText: u,
18
19
  children: i
19
20
  })
20
21
  });
@@ -1 +1 @@
1
- {"version":3,"file":"HeroLabel.js","names":[],"sources":["../../../src/Hero/sub-components/HeroLabel.tsx"],"sourcesContent":["import {forwardRef, PropsWithChildren} from 'react'\nimport {clsx} from 'clsx'\nimport {TextProps} from '../../Text'\nimport type {BaseProps} from '../../component-helpers'\nimport {TextCursorAnimation} from '../../TextCursorAnimation'\n\nimport styles from '../Hero.module.css'\nimport {useHeroContext} from '../HeroContext'\n\nexport type HeroLabelProps = Omit<TextProps, 'as' | 'ref' | 'animate'> &\n Omit<BaseProps<HTMLSpanElement>, 'animate'> & {\n animate?: boolean\n animationDelay?: number\n }\n\nexport const HeroLabel = forwardRef<HTMLSpanElement, HeroLabelProps>(\n (\n {\n children,\n className,\n variant = 'muted',\n animate = false,\n animationDelay = 1000,\n ...rest\n }: PropsWithChildren<HeroLabelProps>,\n ref,\n ) => {\n const {variant: heroVariant, enableAnimation} = useHeroContext()\n const isGridlineVariant = heroVariant === 'gridline' || heroVariant === 'gridline-expressive'\n\n const shouldAnimate = enableAnimation || animate\n const shouldHaveDelay = (isGridlineVariant && enableAnimation) || animate\n\n return (\n <span ref={ref} className={clsx(styles['Hero-label'], className)} {...rest}>\n <TextCursorAnimation variant={variant} animate={shouldAnimate} delay={shouldHaveDelay ? animationDelay : 0}>\n {children}\n </TextCursorAnimation>\n </span>\n )\n },\n)\n"],"mappings":";;;;;;;AAeA,IAAa,IAAY,GAErB,EACE,aACA,cACA,aAAU,SACV,aAAU,IACV,oBAAiB,KACjB,GAAG,KAEL,MACG;CACH,IAAM,EAAC,SAAS,GAAa,uBAAmB,GAAgB,EAC1D,IAAoB,MAAgB,cAAc,MAAgB,uBAElE,IAAgB,KAAmB,GACnC,IAAmB,KAAqB,KAAoB;AAElE,QACE,kBAAC,QAAD;EAAW;EAAK,WAAW,EAAK,EAAO,eAAe,EAAU;EAAE,GAAI;YACpE,kBAAC,GAAD;GAA8B;GAAS,SAAS;GAAe,OAAO,IAAkB,IAAiB;GACtG;GACmB,CAAA;EACjB,CAAA;EAGZ"}
1
+ {"version":3,"file":"HeroLabel.js","names":[],"sources":["../../../src/Hero/sub-components/HeroLabel.tsx"],"sourcesContent":["import {forwardRef, PropsWithChildren} from 'react'\nimport {clsx} from 'clsx'\nimport {TextProps} from '../../Text'\nimport type {BaseProps} from '../../component-helpers'\nimport {TextCursorAnimation} from '../../TextCursorAnimation'\n\nimport styles from '../Hero.module.css'\nimport {useHeroContext} from '../HeroContext'\n\nexport type HeroLabelProps = Omit<TextProps, 'as' | 'ref' | 'animate'> &\n Omit<BaseProps<HTMLSpanElement>, 'animate'> & {\n animate?: boolean\n animationDelay?: number\n initialText?: string\n }\n\nexport const HeroLabel = forwardRef<HTMLSpanElement, HeroLabelProps>(\n (\n {\n children,\n className,\n variant = 'muted',\n animate = false,\n animationDelay = 1000,\n initialText,\n ...rest\n }: PropsWithChildren<HeroLabelProps>,\n ref,\n ) => {\n const {variant: heroVariant, enableAnimation} = useHeroContext()\n const isGridlineVariant = heroVariant === 'gridline' || heroVariant === 'gridline-expressive'\n\n const shouldAnimate = enableAnimation || animate\n const shouldHaveDelay = (isGridlineVariant && enableAnimation) || animate\n\n return (\n <span ref={ref} className={clsx(styles['Hero-label'], className)} {...rest}>\n <TextCursorAnimation\n variant={variant}\n animate={shouldAnimate}\n delay={shouldHaveDelay ? animationDelay : 0}\n initialText={initialText}\n >\n {children}\n </TextCursorAnimation>\n </span>\n )\n },\n)\n"],"mappings":";;;;;;;AAgBA,IAAa,IAAY,GAErB,EACE,aACA,cACA,aAAU,SACV,aAAU,IACV,oBAAiB,KACjB,gBACA,GAAG,KAEL,MACG;CACH,IAAM,EAAC,SAAS,GAAa,uBAAmB,GAAgB,EAC1D,IAAoB,MAAgB,cAAc,MAAgB,uBAElE,IAAgB,KAAmB,GACnC,IAAmB,KAAqB,KAAoB;AAElE,QACE,kBAAC,QAAD;EAAW;EAAK,WAAW,EAAK,EAAO,eAAe,EAAU;EAAE,GAAI;YACpE,kBAAC,GAAD;GACW;GACT,SAAS;GACT,OAAO,IAAkB,IAAiB;GAC7B;GAEZ;GACmB,CAAA;EACjB,CAAA;EAGZ"}
@@ -1,19 +1,24 @@
1
1
  import React, { PropsWithChildren } from 'react';
2
2
  import { TextProps } from '../Text/Text';
3
+ import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/base.css';
3
4
  import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/colors-with-modes.css';
4
5
  export declare const testIds: {
5
6
  root: string;
7
+ readonly text: string;
6
8
  readonly cursor: string;
7
9
  };
8
10
  export type TextCursorAnimationProps = {
9
11
  /**
10
- * Whether to animate the text reveal with a sliding wipe animation
11
- * and a cursor that transitions from grey to green.
12
+ * Whether to animate the text with a typing effect.
12
13
  */
13
14
  animate?: boolean;
15
+ /**
16
+ * Optional text to type before transitioning to the final text
17
+ */
18
+ initialText?: string;
14
19
  ['data-testid']?: string;
15
20
  delay?: number;
16
21
  waitForPageLoad?: boolean;
17
22
  } & React.HTMLAttributes<HTMLSpanElement> & Omit<TextProps, 'animate' | 'as'>;
18
- export declare function TextCursorAnimation({ children, className, animate, 'data-testid': testId, delay, waitForPageLoad, variant, }: PropsWithChildren<TextCursorAnimationProps>): import("react/jsx-runtime").JSX.Element;
23
+ export declare function TextCursorAnimation({ children, className, animate, initialText, 'data-testid': testId, delay, waitForPageLoad, variant, }: PropsWithChildren<TextCursorAnimationProps>): import("react/jsx-runtime").JSX.Element;
19
24
  //# sourceMappingURL=TextCursorAnimation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextCursorAnimation.d.ts","sourceRoot":"","sources":["../../src/TextCursorAnimation/TextCursorAnimation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAC,iBAAiB,EAAC,MAAM,OAAO,CAAA;AAI9C,OAAO,EAAC,SAAS,EAAC,MAAM,cAAc,CAAA;AAEtC,OAAO,yHAAyH,CAAA;AAIhI,eAAO,MAAM,OAAO;;;CAKnB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,CAAC,aAAa,CAAC,CAAC,EAAE,MAAM,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,GAAG,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,GACvC,IAAI,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC,CAAA;AAEnC,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,SAAS,EACT,OAAO,EACP,aAAa,EAAE,MAAM,EACrB,KAAW,EACX,eAAsB,EACtB,OAAiB,GAClB,EAAE,iBAAiB,CAAC,wBAAwB,CAAC,2CA0C7C"}
1
+ {"version":3,"file":"TextCursorAnimation.d.ts","sourceRoot":"","sources":["../../src/TextCursorAnimation/TextCursorAnimation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAC,iBAAiB,EAAC,MAAM,OAAO,CAAA;AAI9C,OAAO,EAAC,SAAS,EAAC,MAAM,cAAc,CAAA;AAEtC,OAAO,4GAA4G,CAAA;AACnH,OAAO,yHAAyH,CAAA;AAIhI,eAAO,MAAM,OAAO;;;;CAQnB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,CAAC,aAAa,CAAC,CAAC,EAAE,MAAM,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,GAAG,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,GACvC,IAAI,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC,CAAA;AAEnC,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,SAAS,EACT,OAAO,EACP,WAAW,EACX,aAAa,EAAE,MAAM,EACrB,KAAK,EACL,eAAsB,EACtB,OAAiB,GAClB,EAAE,iBAAiB,CAAC,wBAAwB,CAAC,2CA+E7C"}
@@ -1,47 +1,73 @@
1
1
  import e from "../node_modules/clsx/dist/clsx.js";
2
2
  import { useCursorAnimation as t } from "../hooks/useCursorAnimation.js";
3
3
  import { EyebrowText as n } from "../EyebrowText/EyebrowText.js";
4
- import '../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/colors-with-modes-BODdIvrY.css';/* empty css */
4
+ import '../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/colors-with-modes-BucKYl1n.css';import '../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/base-DKbXhPKv.css';/* empty css */
5
+ /* empty css */
5
6
  import r from "./TextCursorAnimation.module.js";
6
7
  import "react";
7
8
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
8
9
  //#region src/TextCursorAnimation/TextCursorAnimation.tsx
9
10
  var o = {
10
11
  root: "TextCursorAnimation",
12
+ get text() {
13
+ return `${this.root}-text`;
14
+ },
11
15
  get cursor() {
12
16
  return `${this.root}-cursor`;
13
17
  }
14
18
  };
15
- function s({ children: s, className: c, animate: l, "data-testid": u, delay: d = 500, waitForPageLoad: f = !0, variant: p = "muted" }) {
16
- let m = typeof s == "string" ? s : "", { showCursor: h, progress: g } = t({
17
- text: m,
19
+ function s({ children: s, className: c, animate: l, initialText: u, "data-testid": d, delay: f, waitForPageLoad: p = !0, variant: m = "muted" }) {
20
+ let h = typeof s == "string" ? s : "", { showCursor: g, visibleText: _, cursorPhase: v } = t({
21
+ text: h,
22
+ initialText: u,
18
23
  animate: l,
19
- delay: d,
20
- waitForPageLoad: f
21
- }), _ = {
22
- "--brand-TextCursorAnimation-reveal-progress": g,
23
- "--brand-TextCursorAnimation-cursor-progress": g
24
- }, v = {
25
- "--brand-TextCursorAnimation-reveal-progress": 1,
26
- "--brand-TextCursorAnimation-cursor-progress": 1
27
- }, y = l === !0 && m, b = y ? _ : v, x = m || s;
24
+ delay: f,
25
+ waitForPageLoad: p
26
+ }), y = l === !0 && h.length > 0, b = h || s, x = {
27
+ initial: r["TextCursorAnimation__cursor--initial"],
28
+ correction: r["TextCursorAnimation__cursor--correction"],
29
+ final: r["TextCursorAnimation__cursor--final"],
30
+ complete: r["TextCursorAnimation__cursor--complete"]
31
+ }[y ? v : "complete"];
28
32
  return /* @__PURE__ */ i("span", {
29
33
  className: e(r.TextCursorAnimation, c),
30
- "data-testid": u || o.root,
34
+ "data-testid": d || o.root,
31
35
  children: /* @__PURE__ */ a("span", {
32
- className: r["TextCursorAnimation-inner"],
33
- style: b,
34
- children: [/* @__PURE__ */ i(n, {
35
- size: "100",
36
- variant: p,
37
- font: "monospace",
38
- weight: "medium",
39
- className: r["TextCursorAnimation-text"],
40
- children: x
41
- }), (h || !y) && /* @__PURE__ */ i("span", {
42
- className: r["TextCursorAnimation-cursor"],
43
- "aria-hidden": "true",
44
- "data-testid": o.cursor
36
+ className: r.TextCursorAnimation__inner,
37
+ children: [y && /* @__PURE__ */ a("span", {
38
+ className: r.TextCursorAnimation__sizingContainer,
39
+ children: [/* @__PURE__ */ i(n, {
40
+ size: "100",
41
+ variant: m,
42
+ font: "monospace",
43
+ weight: "medium",
44
+ className: e(r.TextCursorAnimation__text, r.TextCursorAnimation__sizingText),
45
+ children: h
46
+ }), u && u !== h && /* @__PURE__ */ i(n, {
47
+ size: "100",
48
+ variant: m,
49
+ font: "monospace",
50
+ weight: "medium",
51
+ className: e(r.TextCursorAnimation__text, r.TextCursorAnimation__sizingText),
52
+ "aria-hidden": "true",
53
+ children: u
54
+ })]
55
+ }), /* @__PURE__ */ a("span", {
56
+ className: e(r.TextCursorAnimation__content, y && r["TextCursorAnimation__content--animated"]),
57
+ "aria-hidden": y ? "true" : void 0,
58
+ children: [/* @__PURE__ */ i(n, {
59
+ size: "100",
60
+ variant: m,
61
+ font: "monospace",
62
+ weight: "medium",
63
+ className: r.TextCursorAnimation__text,
64
+ "data-testid": o.text,
65
+ children: y ? _ : b
66
+ }), g && /* @__PURE__ */ i("span", {
67
+ className: e(r.TextCursorAnimation__cursor, y && r["TextCursorAnimation__cursor--animated"], x),
68
+ "aria-hidden": "true",
69
+ "data-testid": o.cursor
70
+ })]
45
71
  })]
46
72
  })
47
73
  });
@@ -1 +1 @@
1
- {"version":3,"file":"TextCursorAnimation.js","names":[],"sources":["../../src/TextCursorAnimation/TextCursorAnimation.tsx"],"sourcesContent":["import React, {PropsWithChildren} from 'react'\nimport {clsx} from 'clsx'\nimport {useCursorAnimation} from '../hooks/useCursorAnimation'\nimport {EyebrowText} from '../EyebrowText'\nimport {TextProps} from '../Text/Text'\n\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/colors-with-modes.css'\n\nimport styles from './TextCursorAnimation.module.css'\n\nexport const testIds = {\n root: 'TextCursorAnimation',\n get cursor() {\n return `${this.root}-cursor`\n },\n}\n\nexport type TextCursorAnimationProps = {\n /**\n * Whether to animate the text reveal with a sliding wipe animation\n * and a cursor that transitions from grey to green.\n */\n animate?: boolean\n ['data-testid']?: string\n delay?: number\n waitForPageLoad?: boolean\n} & React.HTMLAttributes<HTMLSpanElement> &\n Omit<TextProps, 'animate' | 'as'>\n\nexport function TextCursorAnimation({\n children,\n className,\n animate,\n 'data-testid': testId,\n delay = 500,\n waitForPageLoad = true,\n variant = 'muted',\n}: PropsWithChildren<TextCursorAnimationProps>) {\n const text = typeof children === 'string' ? children : ''\n const {showCursor, progress} = useCursorAnimation({\n text,\n animate,\n delay,\n waitForPageLoad,\n })\n\n const revealStyle = {\n '--brand-TextCursorAnimation-reveal-progress': progress,\n '--brand-TextCursorAnimation-cursor-progress': progress,\n } as React.CSSProperties\n\n const staticStyle = {\n '--brand-TextCursorAnimation-reveal-progress': 1,\n '--brand-TextCursorAnimation-cursor-progress': 1,\n } as React.CSSProperties\n\n const hasAnimation = animate === true && text\n\n const style = hasAnimation ? revealStyle : staticStyle\n const content = text || children\n\n return (\n <span className={clsx(styles.TextCursorAnimation, className)} data-testid={testId || testIds.root}>\n <span className={styles['TextCursorAnimation-inner']} style={style}>\n <EyebrowText\n size=\"100\"\n variant={variant}\n font=\"monospace\"\n weight=\"medium\"\n className={styles['TextCursorAnimation-text']}\n >\n {content}\n </EyebrowText>\n {(showCursor || !hasAnimation) && (\n <span className={styles['TextCursorAnimation-cursor']} aria-hidden=\"true\" data-testid={testIds.cursor} />\n )}\n </span>\n </span>\n )\n}\n"],"mappings":";;;;;;;;AAUA,IAAa,IAAU;CACrB,MAAM;CACN,IAAI,SAAS;AACX,SAAO,GAAG,KAAK,KAAK;;CAEvB;AAcD,SAAgB,EAAoB,EAClC,aACA,cACA,YACA,eAAe,GACf,WAAQ,KACR,qBAAkB,IAClB,aAAU,WACoC;CAC9C,IAAM,IAAO,OAAO,KAAa,WAAW,IAAW,IACjD,EAAC,eAAY,gBAAY,EAAmB;EAChD;EACA;EACA;EACA;EACD,CAAC,EAEI,IAAc;EAClB,+CAA+C;EAC/C,+CAA+C;EAChD,EAEK,IAAc;EAClB,+CAA+C;EAC/C,+CAA+C;EAChD,EAEK,IAAe,MAAY,MAAQ,GAEnC,IAAQ,IAAe,IAAc,GACrC,IAAU,KAAQ;AAExB,QACE,kBAAC,QAAD;EAAM,WAAW,EAAK,EAAO,qBAAqB,EAAU;EAAE,eAAa,KAAU,EAAQ;YAC3F,kBAAC,QAAD;GAAM,WAAW,EAAO;GAAqC;aAA7D,CACE,kBAAC,GAAD;IACE,MAAK;IACI;IACT,MAAK;IACL,QAAO;IACP,WAAW,EAAO;cAEjB;IACW,CAAA,GACZ,KAAc,CAAC,MACf,kBAAC,QAAD;IAAM,WAAW,EAAO;IAA+B,eAAY;IAAO,eAAa,EAAQ;IAAU,CAAA,CAEtG;;EACF,CAAA"}
1
+ {"version":3,"file":"TextCursorAnimation.js","names":[],"sources":["../../src/TextCursorAnimation/TextCursorAnimation.tsx"],"sourcesContent":["import React, {PropsWithChildren} from 'react'\nimport {clsx} from 'clsx'\nimport {useCursorAnimation} from '../hooks/useCursorAnimation'\nimport {EyebrowText} from '../EyebrowText'\nimport {TextProps} from '../Text/Text'\n\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/base.css'\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/colors-with-modes.css'\n\nimport styles from './TextCursorAnimation.module.css'\n\nexport const testIds = {\n root: 'TextCursorAnimation',\n get text() {\n return `${this.root}-text`\n },\n get cursor() {\n return `${this.root}-cursor`\n },\n}\n\nexport type TextCursorAnimationProps = {\n /**\n * Whether to animate the text with a typing effect.\n */\n animate?: boolean\n /**\n * Optional text to type before transitioning to the final text\n */\n initialText?: string\n ['data-testid']?: string\n delay?: number\n waitForPageLoad?: boolean\n} & React.HTMLAttributes<HTMLSpanElement> &\n Omit<TextProps, 'animate' | 'as'>\n\nexport function TextCursorAnimation({\n children,\n className,\n animate,\n initialText,\n 'data-testid': testId,\n delay,\n waitForPageLoad = true,\n variant = 'muted',\n}: PropsWithChildren<TextCursorAnimationProps>) {\n const text = typeof children === 'string' ? children : ''\n const {showCursor, visibleText, cursorPhase} = useCursorAnimation({\n text,\n initialText,\n animate,\n delay,\n waitForPageLoad,\n })\n\n const hasAnimation = animate === true && text.length > 0\n const content = text || children\n const cursorPhaseClassName = {\n initial: styles['TextCursorAnimation__cursor--initial'],\n correction: styles['TextCursorAnimation__cursor--correction'],\n final: styles['TextCursorAnimation__cursor--final'],\n complete: styles['TextCursorAnimation__cursor--complete'],\n }[hasAnimation ? cursorPhase : 'complete']\n\n return (\n <span className={clsx(styles.TextCursorAnimation, className)} data-testid={testId || testIds.root}>\n <span className={styles.TextCursorAnimation__inner}>\n {hasAnimation && (\n <span className={styles.TextCursorAnimation__sizingContainer}>\n <EyebrowText\n size=\"100\"\n variant={variant}\n font=\"monospace\"\n weight=\"medium\"\n className={clsx(styles.TextCursorAnimation__text, styles.TextCursorAnimation__sizingText)}\n >\n {text}\n </EyebrowText>\n {initialText && initialText !== text && (\n <EyebrowText\n size=\"100\"\n variant={variant}\n font=\"monospace\"\n weight=\"medium\"\n className={clsx(styles.TextCursorAnimation__text, styles.TextCursorAnimation__sizingText)}\n aria-hidden=\"true\"\n >\n {initialText}\n </EyebrowText>\n )}\n </span>\n )}\n <span\n className={clsx(\n styles.TextCursorAnimation__content,\n hasAnimation && styles['TextCursorAnimation__content--animated'],\n )}\n aria-hidden={hasAnimation ? 'true' : undefined}\n >\n <EyebrowText\n size=\"100\"\n variant={variant}\n font=\"monospace\"\n weight=\"medium\"\n className={styles.TextCursorAnimation__text}\n data-testid={testIds.text}\n >\n {hasAnimation ? visibleText : content}\n </EyebrowText>\n {showCursor && (\n <span\n className={clsx(\n styles.TextCursorAnimation__cursor,\n hasAnimation && styles['TextCursorAnimation__cursor--animated'],\n cursorPhaseClassName,\n )}\n aria-hidden=\"true\"\n data-testid={testIds.cursor}\n />\n )}\n </span>\n </span>\n </span>\n )\n}\n"],"mappings":";;;;;;;;;AAWA,IAAa,IAAU;CACrB,MAAM;CACN,IAAI,OAAO;AACT,SAAO,GAAG,KAAK,KAAK;;CAEtB,IAAI,SAAS;AACX,SAAO,GAAG,KAAK,KAAK;;CAEvB;AAiBD,SAAgB,EAAoB,EAClC,aACA,cACA,YACA,gBACA,eAAe,GACf,UACA,qBAAkB,IAClB,aAAU,WACoC;CAC9C,IAAM,IAAO,OAAO,KAAa,WAAW,IAAW,IACjD,EAAC,eAAY,gBAAa,mBAAe,EAAmB;EAChE;EACA;EACA;EACA;EACA;EACD,CAAC,EAEI,IAAe,MAAY,MAAQ,EAAK,SAAS,GACjD,IAAU,KAAQ,GAClB,IAAuB;EAC3B,SAAS,EAAO;EAChB,YAAY,EAAO;EACnB,OAAO,EAAO;EACd,UAAU,EAAO;EAClB,CAAC,IAAe,IAAc;AAE/B,QACE,kBAAC,QAAD;EAAM,WAAW,EAAK,EAAO,qBAAqB,EAAU;EAAE,eAAa,KAAU,EAAQ;YAC3F,kBAAC,QAAD;GAAM,WAAW,EAAO;aAAxB,CACG,KACC,kBAAC,QAAD;IAAM,WAAW,EAAO;cAAxB,CACE,kBAAC,GAAD;KACE,MAAK;KACI;KACT,MAAK;KACL,QAAO;KACP,WAAW,EAAK,EAAO,2BAA2B,EAAO,gCAAgC;eAExF;KACW,CAAA,EACb,KAAe,MAAgB,KAC9B,kBAAC,GAAD;KACE,MAAK;KACI;KACT,MAAK;KACL,QAAO;KACP,WAAW,EAAK,EAAO,2BAA2B,EAAO,gCAAgC;KACzF,eAAY;eAEX;KACW,CAAA,CAEX;OAET,kBAAC,QAAD;IACE,WAAW,EACT,EAAO,8BACP,KAAgB,EAAO,0CACxB;IACD,eAAa,IAAe,SAAS,KAAA;cALvC,CAOE,kBAAC,GAAD;KACE,MAAK;KACI;KACT,MAAK;KACL,QAAO;KACP,WAAW,EAAO;KAClB,eAAa,EAAQ;eAEpB,IAAe,IAAc;KAClB,CAAA,EACb,KACC,kBAAC,QAAD;KACE,WAAW,EACT,EAAO,6BACP,KAAgB,EAAO,0CACvB,EACD;KACD,eAAY;KACZ,eAAa,EAAQ;KACrB,CAAA,CAEC;MACF;;EACF,CAAA"}
@@ -0,0 +1 @@
1
+ .Primer_Brand__TextCursorAnimation-module__TextCursorAnimation___fMZNu{align-items:center;display:inline-flex}.Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__inner____uwkl{align-items:center;display:inline-flex;position:relative}.Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__text___t1rcc{font-weight:var(--brand-text-weight-500);white-space:pre}.Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__sizingContainer___7_wcg{clip-path:inset(50%);display:inline-grid}.Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__sizingText___Mhr64{grid-area:1/1}.Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__content___M_K3E{align-items:center;gap:calc(var(--base-size-8) + var(--base-size-2));display:inline-flex}.Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__content--animated___Zmg8H{position:absolute;inset-block-start:0;inset-inline-start:0}.Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__cursor___suzWD{width:calc(var(--base-size-8) + var(--base-size-2) / 2);height:calc(var(--base-size-12) + var(--base-size-2));flex:0 0 calc(var(--base-size-8) + var(--base-size-2) / 2)}.Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__cursor--initial___Ozy64{background-color:var(--brand-TextCursorAnimation-cursor-color)}.Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__cursor--animated___EfpR4{animation:Primer_Brand__TextCursorAnimation-module__TextCursorAnimation-cursor-blink___cTxPh var(--brand-TextCursorAnimation-cursor-animationDuration) steps(1, end) .25s 3 forwards}.Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__cursor--correction___y1c10{background-color:var(--brand-TextCursorAnimation-cursor-deleteColor)}.Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__cursor--final___fBBsR,.Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__cursor--complete___gufWv{background-color:var(--brand-TextCursorAnimation-cursor-finalColor)}@keyframes Primer_Brand__TextCursorAnimation-module__TextCursorAnimation-cursor-blink___cTxPh{0%,79%{opacity:1}80%,99%{opacity:0}to{opacity:1}}@media (prefers-reduced-motion:reduce){.Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__cursor___suzWD{animation:none}}
@@ -1,8 +1,18 @@
1
- import './TextCursorAnimation.module-BJLhwKrK.css';var e = {
1
+ import './TextCursorAnimation.module-BS4hPR8H.css';var e = {
2
2
  TextCursorAnimation: "Primer_Brand__TextCursorAnimation-module__TextCursorAnimation___fMZNu",
3
- "TextCursorAnimation-inner": "Primer_Brand__TextCursorAnimation-module__TextCursorAnimation-inner___h__Hj",
4
- "TextCursorAnimation-text": "Primer_Brand__TextCursorAnimation-module__TextCursorAnimation-text___sBYZ9",
5
- "TextCursorAnimation-cursor": "Primer_Brand__TextCursorAnimation-module__TextCursorAnimation-cursor___1_9mQ"
3
+ TextCursorAnimation__inner: "Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__inner____uwkl",
4
+ TextCursorAnimation__text: "Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__text___t1rcc",
5
+ TextCursorAnimation__sizingContainer: "Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__sizingContainer___7_wcg",
6
+ TextCursorAnimation__sizingText: "Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__sizingText___Mhr64",
7
+ TextCursorAnimation__content: "Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__content___M_K3E",
8
+ "TextCursorAnimation__content--animated": "Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__content--animated___Zmg8H",
9
+ TextCursorAnimation__cursor: "Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__cursor___suzWD",
10
+ "TextCursorAnimation__cursor--initial": "Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__cursor--initial___Ozy64",
11
+ "TextCursorAnimation__cursor--animated": "Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__cursor--animated___EfpR4",
12
+ "TextCursorAnimation-cursor-blink": "Primer_Brand__TextCursorAnimation-module__TextCursorAnimation-cursor-blink___cTxPh",
13
+ "TextCursorAnimation__cursor--correction": "Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__cursor--correction___y1c10",
14
+ "TextCursorAnimation__cursor--final": "Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__cursor--final___fBBsR",
15
+ "TextCursorAnimation__cursor--complete": "Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__cursor--complete___gufWv"
6
16
  };
7
17
  //#endregion
8
18
  export { e as default };
@@ -1 +1 @@
1
- {"version":3,"file":"TextCursorAnimation.module.js","names":[],"sources":["../../src/TextCursorAnimation/TextCursorAnimation.module.css"],"sourcesContent":[".TextCursorAnimation {\n display: inline-flex;\n align-items: center;\n}\n\n.TextCursorAnimation-inner {\n position: relative;\n display: inline-flex;\n align-items: center;\n}\n\n.TextCursorAnimation-text {\n font-weight: var(--brand-text-weight-500);\n clip-path: inset(0 calc((1 - var(--brand-TextCursorAnimation-reveal-progress, 1)) * 100%) 0 0);\n white-space: pre;\n}\n\n.TextCursorAnimation-cursor {\n position: absolute;\n left: calc((var(--brand-TextCursorAnimation-reveal-progress, 1) * 100%) + var(--base-size-6));\n top: calc((1lh - 0.3cap) / 2 - 0.5cap);\n width: var(--base-size-8);\n height: 1cap;\n background-color: color-mix(\n in srgb,\n var(--brand-color-canvas-subtle) calc((1 - var(--brand-TextCursorAnimation-cursor-progress, 0)) * 100%),\n var(--brand-TextCursorAnimation-cursor-color) calc(var(--brand-TextCursorAnimation-cursor-progress, 0) * 100%)\n );\n}\n\n@media (prefers-reduced-motion: reduce) {\n .TextCursorAnimation-cursor {\n display: none;\n }\n\n .TextCursorAnimation-text {\n clip-path: none;\n }\n}\n"],"mappings":""}
1
+ {"version":3,"file":"TextCursorAnimation.module.js","names":[],"sources":["../../src/TextCursorAnimation/TextCursorAnimation.module.css"],"sourcesContent":[".TextCursorAnimation {\n display: inline-flex;\n align-items: center;\n}\n\n.TextCursorAnimation__inner {\n position: relative;\n display: inline-flex;\n align-items: center;\n}\n\n.TextCursorAnimation__text {\n font-weight: var(--brand-text-weight-500);\n white-space: pre;\n}\n\n.TextCursorAnimation__sizingContainer {\n display: inline-grid;\n clip-path: inset(50%);\n}\n\n.TextCursorAnimation__sizingText {\n grid-area: 1 / 1;\n}\n\n.TextCursorAnimation__content {\n display: inline-flex;\n align-items: center;\n gap: calc(var(--base-size-8) + var(--base-size-2));\n}\n\n.TextCursorAnimation__content--animated {\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: 0;\n}\n\n.TextCursorAnimation__cursor {\n width: calc(var(--base-size-8) + var(--base-size-2) / 2);\n height: calc(var(--base-size-12) + var(--base-size-2));\n flex: 0 0 calc(var(--base-size-8) + var(--base-size-2) / 2);\n}\n\n.TextCursorAnimation__cursor--initial {\n background-color: var(--brand-TextCursorAnimation-cursor-color);\n}\n\n.TextCursorAnimation__cursor--animated {\n animation: TextCursorAnimation-cursor-blink var(--brand-TextCursorAnimation-cursor-animationDuration) steps(1, end)\n 250ms 3 forwards;\n}\n\n.TextCursorAnimation__cursor--correction {\n background-color: var(--brand-TextCursorAnimation-cursor-deleteColor);\n}\n\n.TextCursorAnimation__cursor--final,\n.TextCursorAnimation__cursor--complete {\n background-color: var(--brand-TextCursorAnimation-cursor-finalColor);\n}\n\n@keyframes TextCursorAnimation-cursor-blink {\n 0%,\n 79% {\n opacity: 1;\n }\n\n 80%,\n 99% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .TextCursorAnimation__cursor {\n animation: none;\n }\n}\n"],"mappings":""}
@@ -1,38 +1,15 @@
1
+ export type CursorAnimationPhase = 'initial' | 'correction' | 'final' | 'complete';
2
+ export type UseCursorAnimationResult = {
3
+ visibleText: string;
4
+ showCursor: boolean;
5
+ cursorPhase: CursorAnimationPhase;
6
+ };
1
7
  export type UseCursorAnimationOptions = {
2
- /**
3
- * The text content to animate
4
- */
5
8
  text: string;
6
- /**
7
- * Whether to animate the text reveal with a cursor effect
8
- */
9
+ initialText?: string;
9
10
  animate?: boolean;
10
- /**
11
- * Duration of the reveal animation in milliseconds
12
- */
13
- duration?: number;
14
- /**
15
- * Delay to start the animation in milliseconds
16
- */
17
11
  delay?: number;
18
- /**
19
- * Loads after the page has fully loaded
20
- */
21
12
  waitForPageLoad?: boolean;
22
13
  };
23
- export type UseCursorAnimationResult = {
24
- /**
25
- * Whether the animation is currently running
26
- */
27
- isAnimating: boolean;
28
- /**
29
- * Whether to show the cursor
30
- */
31
- showCursor: boolean;
32
- /**
33
- * Progress of the animation (0 to 1)
34
- */
35
- progress: number;
36
- };
37
- export declare function useCursorAnimation({ text, animate, duration, delay, waitForPageLoad, }: UseCursorAnimationOptions): UseCursorAnimationResult;
14
+ export declare function useCursorAnimation({ text, initialText, animate, delay, waitForPageLoad, }: UseCursorAnimationOptions): UseCursorAnimationResult;
38
15
  //# sourceMappingURL=useCursorAnimation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useCursorAnimation.d.ts","sourceRoot":"","sources":["../../src/hooks/useCursorAnimation.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,yBAAyB,GAAG;IACtC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC;;OAEG;IACH,WAAW,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,UAAU,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,OAAO,EACP,QAAc,EACd,KAAW,EACX,eAAsB,GACvB,EAAE,yBAAyB,GAAG,wBAAwB,CAiFtD"}
1
+ {"version":3,"file":"useCursorAnimation.d.ts","sourceRoot":"","sources":["../../src/hooks/useCursorAnimation.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,YAAY,GAAG,OAAO,GAAG,UAAU,CAAA;AAElF,MAAM,MAAM,wBAAwB,GAAG;IACrC,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,OAAO,CAAA;IACnB,WAAW,EAAE,oBAAoB,CAAA;CAClC,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,WAAW,EACX,OAAO,EACP,KAAW,EACX,eAAsB,GACvB,EAAE,yBAAyB,GAAG,wBAAwB,CA6KtD"}
@@ -1,50 +1,98 @@
1
- import { useReducedMotion as e } from "./useReducedMotion.js";
2
- import { useCallback as t, useEffect as n, useState as r } from "react";
1
+ import e from "./useIsomorphicLayoutEffect.js";
2
+ import { useReducedMotion as t } from "./useReducedMotion.js";
3
+ import { useEffect as n, useState as r } from "react";
3
4
  //#region src/hooks/useCursorAnimation.ts
4
- function i({ text: i, animate: a, duration: o = 500, delay: s = 500, waitForPageLoad: c = !0 }) {
5
- let l = e(), u = a === !0 && !l && i.length > 0, [d, f] = r(u), [p, m] = r(+!u), h = t(() => {
6
- if (!u) {
7
- m(1), f(!1);
8
- return;
9
- }
10
- f(!0), m(0);
11
- let e = performance.now(), t = (n) => {
12
- let r = n - e, i = Math.min(r / o, 1);
13
- m(i), i < 1 ? requestAnimationFrame(t) : f(!1);
5
+ function i({ text: i, initialText: a, animate: o, delay: s = 500, waitForPageLoad: c = !0 }) {
6
+ let l = t(), u = o === !0 && !l && i.length > 0, d = o === !0 && i.length > 0, [f, p] = r({
7
+ visibleText: d ? "" : i,
8
+ showCursor: !d,
9
+ cursorPhase: d ? "initial" : "complete"
10
+ });
11
+ return e(() => {
12
+ u || p({
13
+ visibleText: i,
14
+ showCursor: !0,
15
+ cursorPhase: "complete"
16
+ });
17
+ }, [u, i]), n(() => {
18
+ if (!u) return;
19
+ let e = 1e3 / 60, t = 85 / 75 * 24, n = [
20
+ ">",
21
+ "*",
22
+ "=",
23
+ "&",
24
+ "+",
25
+ "-",
26
+ "%",
27
+ "^",
28
+ "_"
29
+ ];
30
+ p({
31
+ visibleText: "",
32
+ showCursor: !1,
33
+ cursorPhase: "initial"
34
+ });
35
+ let r = typeof a == "string" && a.length > 0 && a !== i ? a : void 0, o = 0;
36
+ if (r) for (; o < r.length && o < i.length && r[o] === i[o];) o += 1;
37
+ let l = r !== void 0 && o < r.length, d = l ? r : i, f = l ? d.length - o : 0, m = d.length / 34 * 1e3, h = m + (l ? 308.8235294117647 : 0), g = h + f / t * 1e3, _ = g + (l ? i.length - o : 0) / 34 * 1e3, v = h - e, y = _ - 6 * e, b = (e, t) => {
38
+ let r = "", i = 0;
39
+ for (let a = 0; a < t; a += 1) {
40
+ let o = e[a];
41
+ if (/\s/.test(o)) {
42
+ r = `${r}${o}`;
43
+ continue;
44
+ }
45
+ i += 1, r = `${r}${o}`, a === t - 1 && (r = `${r}${n[(i - 1) % n.length]}`);
46
+ }
47
+ return r;
48
+ }, x = (e) => {
49
+ let n = "";
50
+ if (e > 0 && e < m) n = b(d, Math.floor(e / 1e3 * 34));
51
+ else if (l && e >= m && e < h) n = d;
52
+ else if (l && e >= h && e < g) {
53
+ let r = e - h, i = Math.floor(r / 1e3 * t);
54
+ n = d.slice(0, d.length - i);
55
+ } else if (l && e >= g && e < _) {
56
+ let t = e - g, r = Math.min(i.length, o + Math.floor(t / 1e3 * 34));
57
+ n = i.slice(0, r);
58
+ } else e >= _ && (n = i);
59
+ let r = "initial";
60
+ return l && e >= v && (r = "correction"), e >= y && (r = "final"), e >= _ && (r = "complete"), {
61
+ visibleText: n,
62
+ showCursor: n.length > 0,
63
+ cursorPhase: r
64
+ };
65
+ }, S, C, w = () => {
66
+ let e = performance.now(), t = {
67
+ visibleText: "",
68
+ showCursor: !1,
69
+ cursorPhase: "initial"
70
+ }, n = (r) => {
71
+ let i = r - e, a = x(i);
72
+ (t.visibleText !== a.visibleText || t.showCursor !== a.showCursor || t.cursorPhase !== a.cursorPhase) && (t = a, p(a)), i < _ && (S = window.requestAnimationFrame(n));
73
+ };
74
+ S = window.requestAnimationFrame(n);
75
+ }, T = () => {
76
+ C = setTimeout(w, s);
14
77
  };
15
- requestAnimationFrame(t);
16
- }, [u, o]);
17
- return n(() => {
18
- if (!u) {
19
- m(1), f(!1);
20
- return;
21
- }
22
- let e = () => setTimeout(() => {
23
- h();
24
- }, s), t;
25
- if (c && typeof window < "u") if (document.readyState === "complete") t = e();
78
+ if (c && typeof window < "u") if (document.readyState === "complete") T();
26
79
  else {
27
- let n = () => {
28
- t = e();
29
- };
30
- return window.addEventListener("load", n), () => {
31
- window.removeEventListener("load", n), t && clearTimeout(t);
80
+ let e = () => T();
81
+ return window.addEventListener("load", e), () => {
82
+ window.removeEventListener("load", e), C !== void 0 && clearTimeout(C), S !== void 0 && window.cancelAnimationFrame(S);
32
83
  };
33
84
  }
34
- else t = e();
85
+ else T();
35
86
  return () => {
36
- t && clearTimeout(t);
87
+ C !== void 0 && clearTimeout(C), S !== void 0 && window.cancelAnimationFrame(S);
37
88
  };
38
89
  }, [
39
- h,
40
90
  s,
91
+ a,
41
92
  u,
93
+ i,
42
94
  c
43
- ]), {
44
- isAnimating: d,
45
- showCursor: !l && a === !0,
46
- progress: p
47
- };
95
+ ]), f;
48
96
  }
49
97
  //#endregion
50
98
  export { i as useCursorAnimation };
@@ -1 +1 @@
1
- {"version":3,"file":"useCursorAnimation.js","names":[],"sources":["../../src/hooks/useCursorAnimation.ts"],"sourcesContent":["import {useState, useEffect, useCallback} from 'react'\nimport {useReducedMotion} from './useReducedMotion'\n\nexport type UseCursorAnimationOptions = {\n /**\n * The text content to animate\n */\n text: string\n /**\n * Whether to animate the text reveal with a cursor effect\n */\n animate?: boolean\n /**\n * Duration of the reveal animation in milliseconds\n */\n duration?: number\n /**\n * Delay to start the animation in milliseconds\n */\n delay?: number\n /**\n * Loads after the page has fully loaded\n */\n waitForPageLoad?: boolean\n}\n\nexport type UseCursorAnimationResult = {\n /**\n * Whether the animation is currently running\n */\n isAnimating: boolean\n /**\n * Whether to show the cursor\n */\n showCursor: boolean\n /**\n * Progress of the animation (0 to 1)\n */\n progress: number\n}\n\nexport function useCursorAnimation({\n text,\n animate,\n duration = 500,\n delay = 500,\n waitForPageLoad = true,\n}: UseCursorAnimationOptions): UseCursorAnimationResult {\n const prefersReducedMotion = useReducedMotion()\n const shouldAnimate = animate === true && !prefersReducedMotion && text.length > 0\n\n const [isAnimating, setIsAnimating] = useState(shouldAnimate)\n const [progress, setProgress] = useState(shouldAnimate ? 0 : 1)\n\n const startAnimation = useCallback(() => {\n if (!shouldAnimate) {\n setProgress(1)\n setIsAnimating(false)\n return\n }\n\n setIsAnimating(true)\n setProgress(0)\n\n const startTime = performance.now()\n\n const tick = (currentTime: number) => {\n const elapsed = currentTime - startTime\n const newProgress = Math.min(elapsed / duration, 1)\n\n setProgress(newProgress)\n\n if (newProgress < 1) {\n requestAnimationFrame(tick)\n } else {\n setIsAnimating(false)\n }\n }\n\n requestAnimationFrame(tick)\n }, [shouldAnimate, duration])\n\n useEffect(() => {\n if (!shouldAnimate) {\n setProgress(1)\n setIsAnimating(false)\n return\n }\n\n const startDelayTimer = () => {\n return setTimeout(() => {\n startAnimation()\n }, delay)\n }\n\n let delayTimer: ReturnType<typeof setTimeout> | undefined\n\n if (waitForPageLoad && typeof window !== 'undefined') {\n // Check if page is already loaded\n if (document.readyState === 'complete') {\n delayTimer = startDelayTimer()\n } else {\n // Wait for page load before starting the delay timer\n const handleLoad = () => {\n delayTimer = startDelayTimer()\n }\n window.addEventListener('load', handleLoad)\n return () => {\n window.removeEventListener('load', handleLoad)\n if (delayTimer) clearTimeout(delayTimer)\n }\n }\n } else {\n delayTimer = startDelayTimer()\n }\n\n return () => {\n if (delayTimer) clearTimeout(delayTimer)\n }\n }, [startAnimation, delay, shouldAnimate, waitForPageLoad])\n\n const showCursor = !prefersReducedMotion && animate === true\n\n return {\n isAnimating,\n showCursor,\n progress,\n }\n}\n"],"mappings":";;;AAyCA,SAAgB,EAAmB,EACjC,SACA,YACA,cAAW,KACX,WAAQ,KACR,qBAAkB,MACoC;CACtD,IAAM,IAAuB,GAAkB,EACzC,IAAgB,MAAY,MAAQ,CAAC,KAAwB,EAAK,SAAS,GAE3E,CAAC,GAAa,KAAkB,EAAS,EAAc,EACvD,CAAC,GAAU,KAAe,EAAS,IAAsB,EAEzD,IAAiB,QAAkB;AACvC,MAAI,CAAC,GAAe;AAElB,GADA,EAAY,EAAE,EACd,EAAe,GAAM;AACrB;;AAIF,EADA,EAAe,GAAK,EACpB,EAAY,EAAE;EAEd,IAAM,IAAY,YAAY,KAAK,EAE7B,KAAQ,MAAwB;GACpC,IAAM,IAAU,IAAc,GACxB,IAAc,KAAK,IAAI,IAAU,GAAU,EAAE;AAInD,GAFA,EAAY,EAAY,EAEpB,IAAc,IAChB,sBAAsB,EAAK,GAE3B,EAAe,GAAM;;AAIzB,wBAAsB,EAAK;IAC1B,CAAC,GAAe,EAAS,CAAC;AA2C7B,QAzCA,QAAgB;AACd,MAAI,CAAC,GAAe;AAElB,GADA,EAAY,EAAE,EACd,EAAe,GAAM;AACrB;;EAGF,IAAM,UACG,iBAAiB;AACtB,MAAgB;KACf,EAAM,EAGP;AAEJ,MAAI,KAAmB,OAAO,SAAW,IAEvC,KAAI,SAAS,eAAe,WAC1B,KAAa,GAAiB;OACzB;GAEL,IAAM,UAAmB;AACvB,QAAa,GAAiB;;AAGhC,UADA,OAAO,iBAAiB,QAAQ,EAAW,QAC9B;AAEX,IADA,OAAO,oBAAoB,QAAQ,EAAW,EAC1C,KAAY,aAAa,EAAW;;;MAI5C,KAAa,GAAiB;AAGhC,eAAa;AACX,GAAI,KAAY,aAAa,EAAW;;IAEzC;EAAC;EAAgB;EAAO;EAAe;EAAgB,CAAC,EAIpD;EACL;EACA,YAJiB,CAAC,KAAwB,MAAY;EAKtD;EACD"}
1
+ {"version":3,"file":"useCursorAnimation.js","names":[],"sources":["../../src/hooks/useCursorAnimation.ts"],"sourcesContent":["import {useEffect, useState} from 'react'\nimport useIsomorphicLayoutEffect from './useIsomorphicLayoutEffect'\nimport {useReducedMotion} from './useReducedMotion'\n\nexport type CursorAnimationPhase = 'initial' | 'correction' | 'final' | 'complete'\n\nexport type UseCursorAnimationResult = {\n visibleText: string\n showCursor: boolean\n cursorPhase: CursorAnimationPhase\n}\n\nexport type UseCursorAnimationOptions = {\n text: string\n initialText?: string\n animate?: boolean\n delay?: number\n waitForPageLoad?: boolean\n}\n\nexport function useCursorAnimation({\n text,\n initialText,\n animate,\n delay = 500,\n waitForPageLoad = true,\n}: UseCursorAnimationOptions): UseCursorAnimationResult {\n const prefersReducedMotion = useReducedMotion()\n\n const shouldAnimate = animate === true && !prefersReducedMotion && text.length > 0\n const shouldStartHidden = animate === true && text.length > 0\n\n const [frame, setFrame] = useState<UseCursorAnimationResult>({\n visibleText: shouldStartHidden ? '' : text,\n showCursor: !shouldStartHidden,\n cursorPhase: shouldStartHidden ? 'initial' : 'complete',\n })\n\n useIsomorphicLayoutEffect(() => {\n if (!shouldAnimate) {\n setFrame({visibleText: text, showCursor: true, cursorPhase: 'complete'})\n }\n }, [shouldAnimate, text])\n\n useEffect(() => {\n if (!shouldAnimate) return\n\n const frameDuration = 1000 / 60\n const charactersPerSecond = 30 * (85 / 75)\n const deleteCharactersPerSecond = 24 * (85 / 75)\n const correctionPauseDuration = 350 / (85 / 75)\n const scrambleSymbols = ['>', '*', '=', '&', '+', '-', '%', '^', '_']\n\n setFrame({visibleText: '', showCursor: false, cursorPhase: 'initial'})\n\n const candidateInitialText =\n typeof initialText === 'string' && initialText.length > 0 && initialText !== text ? initialText : undefined\n let sharedPrefixLength = 0\n\n if (candidateInitialText) {\n while (\n sharedPrefixLength < candidateInitialText.length &&\n sharedPrefixLength < text.length &&\n candidateInitialText[sharedPrefixLength] === text[sharedPrefixLength]\n ) {\n sharedPrefixLength += 1\n }\n }\n\n const hasCorrection = candidateInitialText !== undefined && sharedPrefixLength < candidateInitialText.length\n const firstText = hasCorrection ? candidateInitialText : text\n const deletedCharacterCount = hasCorrection ? firstText.length - sharedPrefixLength : 0\n const firstTypeDuration = (firstText.length / charactersPerSecond) * 1000\n const correctionStart = firstTypeDuration + (hasCorrection ? correctionPauseDuration : 0)\n const deleteDuration = (deletedCharacterCount / deleteCharactersPerSecond) * 1000\n const secondTypeStart = correctionStart + deleteDuration\n const secondTypeCharacterCount = hasCorrection ? text.length - sharedPrefixLength : 0\n const secondTypeDuration = (secondTypeCharacterCount / charactersPerSecond) * 1000\n const typingComplete = secondTypeStart + secondTypeDuration\n const correctionCursorStart = correctionStart - frameDuration\n const finalCursorStart = typingComplete - 6 * frameDuration\n\n const getScrambledText = (sourceText: string, characterCount: number) => {\n let result = ''\n let visibleCharacterIndex = 0\n\n for (let index = 0; index < characterCount; index += 1) {\n const character = sourceText[index]\n\n if (/\\s/.test(character)) {\n result = `${result}${character}`\n continue\n }\n\n visibleCharacterIndex += 1\n result = `${result}${character}`\n\n if (index === characterCount - 1) {\n result = `${result}${scrambleSymbols[(visibleCharacterIndex - 1) % scrambleSymbols.length]}`\n }\n }\n\n return result\n }\n\n const getFrame = (elapsed: number): UseCursorAnimationResult => {\n let nextText = ''\n\n if (elapsed > 0 && elapsed < firstTypeDuration) {\n const typedCharacterCount = Math.floor((elapsed / 1000) * charactersPerSecond)\n nextText = getScrambledText(firstText, typedCharacterCount)\n } else if (hasCorrection && elapsed >= firstTypeDuration && elapsed < correctionStart) {\n nextText = firstText\n } else if (hasCorrection && elapsed >= correctionStart && elapsed < secondTypeStart) {\n const deleteElapsed = elapsed - correctionStart\n const currentDeletedCharacterCount = Math.floor((deleteElapsed / 1000) * deleteCharactersPerSecond)\n nextText = firstText.slice(0, firstText.length - currentDeletedCharacterCount)\n } else if (hasCorrection && elapsed >= secondTypeStart && elapsed < typingComplete) {\n const secondTypeElapsed = elapsed - secondTypeStart\n const typedCharacterCount = Math.min(\n text.length,\n sharedPrefixLength + Math.floor((secondTypeElapsed / 1000) * charactersPerSecond),\n )\n nextText = text.slice(0, typedCharacterCount)\n } else if (elapsed >= typingComplete) {\n nextText = text\n }\n\n let nextCursorPhase: CursorAnimationPhase = 'initial'\n if (hasCorrection && elapsed >= correctionCursorStart) nextCursorPhase = 'correction'\n if (elapsed >= finalCursorStart) nextCursorPhase = 'final'\n if (elapsed >= typingComplete) nextCursorPhase = 'complete'\n\n return {\n visibleText: nextText,\n showCursor: nextText.length > 0,\n cursorPhase: nextCursorPhase,\n }\n }\n\n let animationFrame: number | undefined\n let delayTimer: ReturnType<typeof setTimeout> | undefined\n\n const startAnimation = () => {\n const startTime = performance.now()\n let previousFrame: UseCursorAnimationResult = {\n visibleText: '',\n showCursor: false,\n cursorPhase: 'initial',\n }\n\n const tick = (currentTime: number) => {\n const elapsed = currentTime - startTime\n const nextFrame = getFrame(elapsed)\n\n if (\n previousFrame.visibleText !== nextFrame.visibleText ||\n previousFrame.showCursor !== nextFrame.showCursor ||\n previousFrame.cursorPhase !== nextFrame.cursorPhase\n ) {\n previousFrame = nextFrame\n setFrame(nextFrame)\n }\n\n if (elapsed < typingComplete) {\n animationFrame = window.requestAnimationFrame(tick)\n }\n }\n\n animationFrame = window.requestAnimationFrame(tick)\n }\n\n const startDelayTimer = () => {\n delayTimer = setTimeout(startAnimation, delay)\n }\n\n if (waitForPageLoad && typeof window !== 'undefined') {\n if (document.readyState === 'complete') {\n startDelayTimer()\n } else {\n const handleLoad = () => startDelayTimer()\n window.addEventListener('load', handleLoad)\n return () => {\n window.removeEventListener('load', handleLoad)\n if (delayTimer !== undefined) clearTimeout(delayTimer)\n if (animationFrame !== undefined) window.cancelAnimationFrame(animationFrame)\n }\n }\n } else {\n startDelayTimer()\n }\n\n return () => {\n if (delayTimer !== undefined) clearTimeout(delayTimer)\n if (animationFrame !== undefined) window.cancelAnimationFrame(animationFrame)\n }\n }, [delay, initialText, shouldAnimate, text, waitForPageLoad])\n\n return frame\n}\n"],"mappings":";;;;AAoBA,SAAgB,EAAmB,EACjC,SACA,gBACA,YACA,WAAQ,KACR,qBAAkB,MACoC;CACtD,IAAM,IAAuB,GAAkB,EAEzC,IAAgB,MAAY,MAAQ,CAAC,KAAwB,EAAK,SAAS,GAC3E,IAAoB,MAAY,MAAQ,EAAK,SAAS,GAEtD,CAAC,GAAO,KAAY,EAAmC;EAC3D,aAAa,IAAoB,KAAK;EACtC,YAAY,CAAC;EACb,aAAa,IAAoB,YAAY;EAC9C,CAAC;AAkKF,QAhKA,QAAgC;AAC9B,EAAK,KACH,EAAS;GAAC,aAAa;GAAM,YAAY;GAAM,aAAa;GAAW,CAAC;IAEzE,CAAC,GAAe,EAAK,CAAC,EAEzB,QAAgB;AACd,MAAI,CAAC,EAAe;EAEpB,IAAM,IAAgB,MAAO,IAEvB,IAAkC,KAAK,KAAX,IAE5B,IAAkB;GAAC;GAAK;GAAK;GAAK;GAAK;GAAK;GAAK;GAAK;GAAK;GAAI;AAErE,IAAS;GAAC,aAAa;GAAI,YAAY;GAAO,aAAa;GAAU,CAAC;EAEtE,IAAM,IACJ,OAAO,KAAgB,YAAY,EAAY,SAAS,KAAK,MAAgB,IAAO,IAAc,KAAA,GAChG,IAAqB;AAEzB,MAAI,EACF,QACE,IAAqB,EAAqB,UAC1C,IAAqB,EAAK,UAC1B,EAAqB,OAAwB,EAAK,IAElD,MAAsB;EAI1B,IAAM,IAAgB,MAAyB,KAAA,KAAa,IAAqB,EAAqB,QAChG,IAAY,IAAgB,IAAuB,GACnD,IAAwB,IAAgB,EAAU,SAAS,IAAqB,GAChF,IAAqB,EAAU,SAAS,KAAuB,KAC/D,IAAkB,KAAqB,IAAgB,oBAA0B,IAEjF,IAAkB,IADA,IAAwB,IAA6B,KAIvE,IAAiB,KAFU,IAAgB,EAAK,SAAS,IAAqB,KAC7B,KAAuB,KAExE,IAAwB,IAAkB,GAC1C,IAAmB,IAAiB,IAAI,GAExC,KAAoB,GAAoB,MAA2B;GACvE,IAAI,IAAS,IACT,IAAwB;AAE5B,QAAK,IAAI,IAAQ,GAAG,IAAQ,GAAgB,KAAS,GAAG;IACtD,IAAM,IAAY,EAAW;AAE7B,QAAI,KAAK,KAAK,EAAU,EAAE;AACxB,SAAS,GAAG,IAAS;AACrB;;AAMF,IAHA,KAAyB,GACzB,IAAS,GAAG,IAAS,KAEjB,MAAU,IAAiB,MAC7B,IAAS,GAAG,IAAS,GAAiB,IAAwB,KAAK,EAAgB;;AAIvF,UAAO;KAGH,KAAY,MAA8C;GAC9D,IAAI,IAAW;AAEf,OAAI,IAAU,KAAK,IAAU,EAE3B,KAAW,EAAiB,GADA,KAAK,MAAO,IAAU,MAAQ,GACnB,CAAoB;YAClD,KAAiB,KAAW,KAAqB,IAAU,EACpE,KAAW;YACF,KAAiB,KAAW,KAAmB,IAAU,GAAiB;IACnF,IAAM,IAAgB,IAAU,GAC1B,IAA+B,KAAK,MAAO,IAAgB,MAAQ,EAA0B;AACnG,QAAW,EAAU,MAAM,GAAG,EAAU,SAAS,EAA6B;cACrE,KAAiB,KAAW,KAAmB,IAAU,GAAgB;IAClF,IAAM,IAAoB,IAAU,GAC9B,IAAsB,KAAK,IAC/B,EAAK,QACL,IAAqB,KAAK,MAAO,IAAoB,MAAQ,GAAoB,CAClF;AACD,QAAW,EAAK,MAAM,GAAG,EAAoB;UACpC,KAAW,MACpB,IAAW;GAGb,IAAI,IAAwC;AAK5C,UAJI,KAAiB,KAAW,MAAuB,IAAkB,eACrE,KAAW,MAAkB,IAAkB,UAC/C,KAAW,MAAgB,IAAkB,aAE1C;IACL,aAAa;IACb,YAAY,EAAS,SAAS;IAC9B,aAAa;IACd;KAGC,GACA,GAEE,UAAuB;GAC3B,IAAM,IAAY,YAAY,KAAK,EAC/B,IAA0C;IAC5C,aAAa;IACb,YAAY;IACZ,aAAa;IACd,EAEK,KAAQ,MAAwB;IACpC,IAAM,IAAU,IAAc,GACxB,IAAY,EAAS,EAAQ;AAWnC,KARE,EAAc,gBAAgB,EAAU,eACxC,EAAc,eAAe,EAAU,cACvC,EAAc,gBAAgB,EAAU,iBAExC,IAAgB,GAChB,EAAS,EAAU,GAGjB,IAAU,MACZ,IAAiB,OAAO,sBAAsB,EAAK;;AAIvD,OAAiB,OAAO,sBAAsB,EAAK;KAG/C,UAAwB;AAC5B,OAAa,WAAW,GAAgB,EAAM;;AAGhD,MAAI,KAAmB,OAAO,SAAW,IACvC,KAAI,SAAS,eAAe,WAC1B,IAAiB;OACZ;GACL,IAAM,UAAmB,GAAiB;AAE1C,UADA,OAAO,iBAAiB,QAAQ,EAAW,QAC9B;AAGX,IAFA,OAAO,oBAAoB,QAAQ,EAAW,EAC1C,MAAe,KAAA,KAAW,aAAa,EAAW,EAClD,MAAmB,KAAA,KAAW,OAAO,qBAAqB,EAAe;;;MAIjF,IAAiB;AAGnB,eAAa;AAEX,GADI,MAAe,KAAA,KAAW,aAAa,EAAW,EAClD,MAAmB,KAAA,KAAW,OAAO,qBAAqB,EAAe;;IAE9E;EAAC;EAAO;EAAa;EAAe;EAAM;EAAgB,CAAC,EAEvD"}
@@ -0,0 +1 @@
1
+ :root{--brand-TextCursorAnimation-cursor-animationDuration:.833s}
@@ -0,0 +1 @@
1
+ :root,[data-color-mode=light]{--brand-TextCursorAnimation-cursor-color:var(--base-color-scale-purple-5);--brand-TextCursorAnimation-cursor-deleteColor:var(--base-color-scale-blue-4);--brand-TextCursorAnimation-cursor-finalColor:var(--base-color-scale-green-6)}[data-color-mode=dark]{--brand-TextCursorAnimation-cursor-color:var(--base-color-scale-purple-3);--brand-TextCursorAnimation-cursor-deleteColor:var(--base-color-scale-blue-3);--brand-TextCursorAnimation-cursor-finalColor:var(--base-color-scale-green-2)}
@@ -3,5 +3,6 @@ import type { BaseProps } from '../../component-helpers';
3
3
  export type HeroLabelProps = Omit<TextProps, 'as' | 'ref' | 'animate'> & Omit<BaseProps<HTMLSpanElement>, 'animate'> & {
4
4
  animate?: boolean;
5
5
  animationDelay?: number;
6
+ initialText?: string;
6
7
  };
7
8
  export declare const HeroLabel: import("react").ForwardRefExoticComponent<Omit<HeroLabelProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
@@ -1,18 +1,23 @@
1
1
  import React, { PropsWithChildren } from 'react';
2
2
  import { TextProps } from '../Text/Text';
3
+ import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/base.css';
3
4
  import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/colors-with-modes.css';
4
5
  export declare const testIds: {
5
6
  root: string;
7
+ readonly text: string;
6
8
  readonly cursor: string;
7
9
  };
8
10
  export type TextCursorAnimationProps = {
9
11
  /**
10
- * Whether to animate the text reveal with a sliding wipe animation
11
- * and a cursor that transitions from grey to green.
12
+ * Whether to animate the text with a typing effect.
12
13
  */
13
14
  animate?: boolean;
15
+ /**
16
+ * Optional text to type before transitioning to the final text
17
+ */
18
+ initialText?: string;
14
19
  ['data-testid']?: string;
15
20
  delay?: number;
16
21
  waitForPageLoad?: boolean;
17
22
  } & React.HTMLAttributes<HTMLSpanElement> & Omit<TextProps, 'animate' | 'as'>;
18
- export declare function TextCursorAnimation({ children, className, animate, 'data-testid': testId, delay, waitForPageLoad, variant, }: PropsWithChildren<TextCursorAnimationProps>): import("react/jsx-runtime").JSX.Element;
23
+ export declare function TextCursorAnimation({ children, className, animate, initialText, 'data-testid': testId, delay, waitForPageLoad, variant, }: PropsWithChildren<TextCursorAnimationProps>): import("react/jsx-runtime").JSX.Element;