@purpur/library 9.1.3 → 9.2.1

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 (315) hide show
  1. package/.lintstagedrc.mts +10 -0
  2. package/CHANGELOG.json +59 -0
  3. package/CHANGELOG.md +29 -1
  4. package/dist/LICENSE.txt +66 -8
  5. package/dist/{ThemeProvider-ipAIFRUi.js → ThemeProvider-5r7lDX-h.js} +2 -2
  6. package/dist/{ThemeProvider-ipAIFRUi.js.map → ThemeProvider-5r7lDX-h.js.map} +1 -1
  7. package/dist/{ThemeProvider-BR1hJQOD.mjs → ThemeProvider-bkyFCeo6.mjs} +3 -3
  8. package/dist/{ThemeProvider-BR1hJQOD.mjs.map → ThemeProvider-bkyFCeo6.mjs.map} +1 -1
  9. package/dist/accordion-OsA0HvdA.js +2 -0
  10. package/dist/{accordion-DX8efWOt.js.map → accordion-OsA0HvdA.js.map} +1 -1
  11. package/dist/{accordion-BKTz9DM6.mjs → accordion-OtFSShSB.mjs} +37 -37
  12. package/dist/{accordion-BKTz9DM6.mjs.map → accordion-OtFSShSB.mjs.map} +1 -1
  13. package/dist/accordion.cjs.js +1 -1
  14. package/dist/accordion.es.js +1 -1
  15. package/dist/arrow-left.es-CCWJyrcQ.js +2 -0
  16. package/dist/arrow-left.es-CCWJyrcQ.js.map +1 -0
  17. package/dist/arrow-left.es-DU-PX-Il.mjs +13 -0
  18. package/dist/arrow-left.es-DU-PX-Il.mjs.map +1 -0
  19. package/dist/{autocomplete-B8L-dTmF.mjs → autocomplete-BipmyKf0.mjs} +2 -2
  20. package/dist/{autocomplete-B8L-dTmF.mjs.map → autocomplete-BipmyKf0.mjs.map} +1 -1
  21. package/dist/{autocomplete-B421J7CS.js → autocomplete-D9uCJzjY.js} +2 -2
  22. package/dist/{autocomplete-B421J7CS.js.map → autocomplete-D9uCJzjY.js.map} +1 -1
  23. package/dist/autocomplete.cjs.js +1 -1
  24. package/dist/autocomplete.es.js +1 -1
  25. package/dist/button-4-yWOgtD.mjs +109 -0
  26. package/dist/{button-Cv7NlYbv.mjs.map → button-4-yWOgtD.mjs.map} +1 -1
  27. package/dist/button-DmybVApa.js +2 -0
  28. package/dist/{button-Dqxdc3nC.js.map → button-DmybVApa.js.map} +1 -1
  29. package/dist/button.cjs.js +1 -1
  30. package/dist/button.es.js +1 -1
  31. package/dist/{calendar-CoP1dGpQ.js → calendar-CBBV8n3x.js} +2 -2
  32. package/dist/{calendar-CoP1dGpQ.js.map → calendar-CBBV8n3x.js.map} +1 -1
  33. package/dist/{calendar-D_sZrR92.mjs → calendar-DEXw83mu.mjs} +2 -2
  34. package/dist/{calendar-D_sZrR92.mjs.map → calendar-DEXw83mu.mjs.map} +1 -1
  35. package/dist/calendar.cjs.js +1 -1
  36. package/dist/calendar.es.js +1 -1
  37. package/dist/card-CRHXm5NR.js +2 -0
  38. package/dist/{card-VMa3cGCP.js.map → card-CRHXm5NR.js.map} +1 -1
  39. package/dist/{card-CkZQZOz1.mjs → card-DR2hvxjZ.mjs} +75 -75
  40. package/dist/{card-CkZQZOz1.mjs.map → card-DR2hvxjZ.mjs.map} +1 -1
  41. package/dist/card.cjs.js +1 -1
  42. package/dist/card.es.js +1 -1
  43. package/dist/carousel-BCw-5u92.js +2 -0
  44. package/dist/carousel-BCw-5u92.js.map +1 -0
  45. package/dist/carousel-BkxojLwn.mjs +1633 -0
  46. package/dist/carousel-BkxojLwn.mjs.map +1 -0
  47. package/dist/carousel.cjs.js +2 -0
  48. package/dist/carousel.cjs.js.map +1 -0
  49. package/dist/carousel.es.js +5 -0
  50. package/dist/carousel.es.js.map +1 -0
  51. package/dist/{chat-field-yK-TwW0D.mjs → chat-field-CVF4DooY.mjs} +2 -2
  52. package/dist/{chat-field-yK-TwW0D.mjs.map → chat-field-CVF4DooY.mjs.map} +1 -1
  53. package/dist/{chat-field-CxOqk0-9.js → chat-field-Wjvh2J6C.js} +2 -2
  54. package/dist/{chat-field-CxOqk0-9.js.map → chat-field-Wjvh2J6C.js.map} +1 -1
  55. package/dist/chat-field.cjs.js +1 -1
  56. package/dist/chat-field.es.js +1 -1
  57. package/dist/comparison-table-B8w65g43.js +2 -0
  58. package/dist/comparison-table-B8w65g43.js.map +1 -0
  59. package/dist/comparison-table-D1zJpdLL.mjs +275 -0
  60. package/dist/comparison-table-D1zJpdLL.mjs.map +1 -0
  61. package/dist/comparison-table.cjs.js +2 -0
  62. package/dist/comparison-table.cjs.js.map +1 -0
  63. package/dist/comparison-table.es.js +5 -0
  64. package/dist/comparison-table.es.js.map +1 -0
  65. package/dist/components/carousel/src/carousel.d.ts +43 -0
  66. package/dist/components/carousel/src/carousel.d.ts.map +1 -0
  67. package/dist/components/carousel/src/components/PageIndicator.d.ts +12 -0
  68. package/dist/components/carousel/src/components/PageIndicator.d.ts.map +1 -0
  69. package/dist/components/carousel/src/hooks/useAutoplay.d.ts +8 -0
  70. package/dist/components/carousel/src/hooks/useAutoplay.d.ts.map +1 -0
  71. package/dist/components/carousel/src/hooks/usePageIndicators.d.ts +9 -0
  72. package/dist/components/carousel/src/hooks/usePageIndicators.d.ts.map +1 -0
  73. package/dist/components/carousel/src/hooks/usePrefersReducedMotion.d.ts +2 -0
  74. package/dist/components/carousel/src/hooks/usePrefersReducedMotion.d.ts.map +1 -0
  75. package/dist/components/carousel/src/hooks/usePrevNextButtons.d.ts +11 -0
  76. package/dist/components/carousel/src/hooks/usePrevNextButtons.d.ts.map +1 -0
  77. package/dist/components/comparison-table/src/comparison-table.d.ts +64 -0
  78. package/dist/components/comparison-table/src/comparison-table.d.ts.map +1 -0
  79. package/dist/components/comparison-table/src/components/Cell/cell.d.ts +7 -0
  80. package/dist/components/comparison-table/src/components/Cell/cell.d.ts.map +1 -0
  81. package/dist/components/comparison-table/src/components/LeadCell/lead-cell.d.ts +8 -0
  82. package/dist/components/comparison-table/src/components/LeadCell/lead-cell.d.ts.map +1 -0
  83. package/dist/components/comparison-table/src/components/OptionCard/option-card.d.ts +26 -0
  84. package/dist/components/comparison-table/src/components/OptionCard/option-card.d.ts.map +1 -0
  85. package/dist/components/comparison-table/src/components/ScrollProgress/scroll-progress.d.ts +11 -0
  86. package/dist/components/comparison-table/src/components/ScrollProgress/scroll-progress.d.ts.map +1 -0
  87. package/dist/components/content-block/src/content-block.d.ts +2 -2
  88. package/dist/components/content-block/src/content-block.d.ts.map +1 -1
  89. package/dist/components/dropdown/src/dropdown-combobox.d.ts +2 -1
  90. package/dist/components/dropdown/src/dropdown-combobox.d.ts.map +1 -1
  91. package/dist/components/dropdown/src/dropdown-select.d.ts +2 -1
  92. package/dist/components/dropdown/src/dropdown-select.d.ts.map +1 -1
  93. package/dist/components/dropdown/src/dropdown-shared.d.ts +12 -1
  94. package/dist/components/dropdown/src/dropdown-shared.d.ts.map +1 -1
  95. package/dist/components/dropdown/src/dropdown.d.ts +1 -1
  96. package/dist/components/dropdown/src/dropdown.d.ts.map +1 -1
  97. package/dist/components/dropdown/src/dropdown.types.d.ts +10 -5
  98. package/dist/components/dropdown/src/dropdown.types.d.ts.map +1 -1
  99. package/dist/components/dropdown/src/useDropdown.d.ts +1 -1
  100. package/dist/components/dropdown/src/useDropdown.d.ts.map +1 -1
  101. package/dist/components-metadata.js +18 -2
  102. package/dist/{content-block-Cd7xSE8t.js → content-block-CDRUH0pg.js} +2 -2
  103. package/dist/content-block-CDRUH0pg.js.map +1 -0
  104. package/dist/{content-block-BMOvlH7a.mjs → content-block-Dm3L4g8w.mjs} +2 -2
  105. package/dist/content-block-Dm3L4g8w.mjs.map +1 -0
  106. package/dist/content-block.cjs.js +1 -1
  107. package/dist/content-block.es.js +1 -1
  108. package/dist/{cta-link-BHU6irMG.js → cta-link-B1qMjH76.js} +2 -2
  109. package/dist/{cta-link-BHU6irMG.js.map → cta-link-B1qMjH76.js.map} +1 -1
  110. package/dist/{cta-link-B_FfwflB.mjs → cta-link-pwva2f2r.mjs} +43 -43
  111. package/dist/{cta-link-B_FfwflB.mjs.map → cta-link-pwva2f2r.mjs.map} +1 -1
  112. package/dist/cta-link.cjs.js +1 -1
  113. package/dist/cta-link.es.js +1 -1
  114. package/dist/{date-field-B7ipm5sH.js → date-field-BJaomFjs.js} +2 -2
  115. package/dist/{date-field-B7ipm5sH.js.map → date-field-BJaomFjs.js.map} +1 -1
  116. package/dist/{date-field-4tYMPw89.mjs → date-field-D3rTtf9Y.mjs} +2 -2
  117. package/dist/{date-field-4tYMPw89.mjs.map → date-field-D3rTtf9Y.mjs.map} +1 -1
  118. package/dist/date-field.cjs.js +1 -1
  119. package/dist/date-field.es.js +1 -1
  120. package/dist/{date-picker-D7EisjDG.mjs → date-picker-CpDZ0gK9.mjs} +4 -4
  121. package/dist/{date-picker-D7EisjDG.mjs.map → date-picker-CpDZ0gK9.mjs.map} +1 -1
  122. package/dist/{date-picker-BWW4xzyc.js → date-picker-D3uJGCjl.js} +2 -2
  123. package/dist/{date-picker-BWW4xzyc.js.map → date-picker-D3uJGCjl.js.map} +1 -1
  124. package/dist/date-picker.cjs.js +1 -1
  125. package/dist/date-picker.es.js +1 -1
  126. package/dist/{drawer-Vi9H2O3N.mjs → drawer-BJ8xwriz.mjs} +2 -2
  127. package/dist/{drawer-Vi9H2O3N.mjs.map → drawer-BJ8xwriz.mjs.map} +1 -1
  128. package/dist/{drawer-UdK-u7IX.js → drawer-CNs9K8Ca.js} +2 -2
  129. package/dist/{drawer-UdK-u7IX.js.map → drawer-CNs9K8Ca.js.map} +1 -1
  130. package/dist/drawer.cjs.js +1 -1
  131. package/dist/drawer.es.js +1 -1
  132. package/dist/dropdown-BsqVnd7z.js +2 -0
  133. package/dist/dropdown-BsqVnd7z.js.map +1 -0
  134. package/dist/dropdown-TO3Mh0bk.mjs +910 -0
  135. package/dist/dropdown-TO3Mh0bk.mjs.map +1 -0
  136. package/dist/dropdown.cjs.js +1 -1
  137. package/dist/dropdown.es.js +1 -1
  138. package/dist/{footer-cH07Xqil.mjs → footer-BXs8uzTA.mjs} +4 -4
  139. package/dist/{footer-cH07Xqil.mjs.map → footer-BXs8uzTA.mjs.map} +1 -1
  140. package/dist/{footer-BL0ewBZT.js → footer-DF9adlni.js} +2 -2
  141. package/dist/{footer-BL0ewBZT.js.map → footer-DF9adlni.js.map} +1 -1
  142. package/dist/footer.cjs.js +1 -1
  143. package/dist/footer.es.js +1 -1
  144. package/dist/{hero-banner-yGRM4OlS.js → hero-banner-BfxclVFT.js} +2 -2
  145. package/dist/{hero-banner-yGRM4OlS.js.map → hero-banner-BfxclVFT.js.map} +1 -1
  146. package/dist/{hero-banner-BjwICxaJ.mjs → hero-banner-CxPvhXD2.mjs} +3 -3
  147. package/dist/{hero-banner-BjwICxaJ.mjs.map → hero-banner-CxPvhXD2.mjs.map} +1 -1
  148. package/dist/hero-banner.cjs.js +1 -1
  149. package/dist/hero-banner.es.js +1 -1
  150. package/dist/libraries/library/src/carousel.d.ts +6 -0
  151. package/dist/libraries/library/src/carousel.d.ts.map +1 -0
  152. package/dist/libraries/library/src/comparison-table.d.ts +6 -0
  153. package/dist/libraries/library/src/comparison-table.d.ts.map +1 -0
  154. package/dist/libraries/library/src/library.d.ts +2 -0
  155. package/dist/libraries/library/src/library.d.ts.map +1 -1
  156. package/dist/library.cjs.js +1 -1
  157. package/dist/library.es.js +609 -605
  158. package/dist/library.es.js.map +1 -1
  159. package/dist/minus.es-BK9qA9iJ.mjs +13 -0
  160. package/dist/minus.es-BK9qA9iJ.mjs.map +1 -0
  161. package/dist/minus.es-DtXArdKK.js +2 -0
  162. package/dist/minus.es-DtXArdKK.js.map +1 -0
  163. package/dist/{modal-fTWvPEPW.mjs → modal-DCfN6q8I.mjs} +28 -28
  164. package/dist/modal-DCfN6q8I.mjs.map +1 -0
  165. package/dist/{modal-DMeRO1wE.js → modal-DZIdw9xy.js} +2 -2
  166. package/dist/modal-DZIdw9xy.js.map +1 -0
  167. package/dist/modal.cjs.js +1 -1
  168. package/dist/modal.es.js +1 -1
  169. package/dist/{notification-DE1pvk9W.js → notification-BqjaT4E7.js} +2 -2
  170. package/dist/{notification-DE1pvk9W.js.map → notification-BqjaT4E7.js.map} +1 -1
  171. package/dist/{notification-BvoL7BIW.mjs → notification-DdRS5BF2.mjs} +2 -2
  172. package/dist/{notification-BvoL7BIW.mjs.map → notification-DdRS5BF2.mjs.map} +1 -1
  173. package/dist/{notification-banner-C4gkkSlf.mjs → notification-banner-BOclxqFu.mjs} +2 -2
  174. package/dist/{notification-banner-C4gkkSlf.mjs.map → notification-banner-BOclxqFu.mjs.map} +1 -1
  175. package/dist/{notification-banner-COH7wJu2.js → notification-banner-jY8rQH2M.js} +2 -2
  176. package/dist/{notification-banner-COH7wJu2.js.map → notification-banner-jY8rQH2M.js.map} +1 -1
  177. package/dist/notification-banner.cjs.js +1 -1
  178. package/dist/notification-banner.es.js +1 -1
  179. package/dist/notification.cjs.js +1 -1
  180. package/dist/notification.es.js +1 -1
  181. package/dist/pagination-Bwlkvqye.js +2 -0
  182. package/dist/pagination-Bwlkvqye.js.map +1 -0
  183. package/dist/{pagination-BdCjh1Pi.mjs → pagination-CVYUacXN.mjs} +235 -242
  184. package/dist/pagination-CVYUacXN.mjs.map +1 -0
  185. package/dist/pagination.cjs.js +1 -1
  186. package/dist/pagination.es.js +1 -1
  187. package/dist/{popover-lxTyKALA.mjs → popover-Dwqs1wGH.mjs} +2 -2
  188. package/dist/{popover-lxTyKALA.mjs.map → popover-Dwqs1wGH.mjs.map} +1 -1
  189. package/dist/{popover-BnUVNqSi.js → popover-XCUa2GfC.js} +2 -2
  190. package/dist/{popover-BnUVNqSi.js.map → popover-XCUa2GfC.js.map} +1 -1
  191. package/dist/popover.cjs.js +1 -1
  192. package/dist/popover.es.js +1 -1
  193. package/dist/{product-card-BU1ThhCx.mjs → product-card-BfB82XpS.mjs} +2 -2
  194. package/dist/{product-card-BU1ThhCx.mjs.map → product-card-BfB82XpS.mjs.map} +1 -1
  195. package/dist/{product-card-CNBegEBW.js → product-card-bVQ7JhHj.js} +2 -2
  196. package/dist/{product-card-CNBegEBW.js.map → product-card-bVQ7JhHj.js.map} +1 -1
  197. package/dist/product-card.cjs.js +1 -1
  198. package/dist/product-card.es.js +1 -1
  199. package/dist/{promotion-card-_bPyVr9t.mjs → promotion-card-BhNw94sC.mjs} +4 -4
  200. package/dist/{promotion-card-_bPyVr9t.mjs.map → promotion-card-BhNw94sC.mjs.map} +1 -1
  201. package/dist/{promotion-card-CXNhskRl.js → promotion-card-DqBBt2sz.js} +2 -2
  202. package/dist/{promotion-card-CXNhskRl.js.map → promotion-card-DqBBt2sz.js.map} +1 -1
  203. package/dist/promotion-card.cjs.js +1 -1
  204. package/dist/promotion-card.es.js +1 -1
  205. package/dist/purpur.css +1 -1
  206. package/dist/quantity-selector-8AkKNDik.js +2 -0
  207. package/dist/quantity-selector-8AkKNDik.js.map +1 -0
  208. package/dist/{quantity-selector-CGhJ2DjO.mjs → quantity-selector-C23kU1hF.mjs} +73 -79
  209. package/dist/quantity-selector-C23kU1hF.mjs.map +1 -0
  210. package/dist/quantity-selector.cjs.js +1 -1
  211. package/dist/quantity-selector.es.js +1 -1
  212. package/dist/scss/action.scss +1 -0
  213. package/dist/{search-field-DTuEiK-M.mjs → search-field-CMBDkydb.mjs} +3 -3
  214. package/dist/{search-field-DTuEiK-M.mjs.map → search-field-CMBDkydb.mjs.map} +1 -1
  215. package/dist/{search-field-Bst9d-wX.js → search-field-CU_tsmHb.js} +2 -2
  216. package/dist/{search-field-Bst9d-wX.js.map → search-field-CU_tsmHb.js.map} +1 -1
  217. package/dist/search-field.cjs.js +1 -1
  218. package/dist/search-field.es.js +1 -1
  219. package/dist/{stepper-k0bX9m4t.mjs → stepper-uBfDdIju.mjs} +3 -3
  220. package/dist/{stepper-k0bX9m4t.mjs.map → stepper-uBfDdIju.mjs.map} +1 -1
  221. package/dist/{stepper-ClLQuoXr.js → stepper-w-raIwqJ.js} +2 -2
  222. package/dist/{stepper-ClLQuoXr.js.map → stepper-w-raIwqJ.js.map} +1 -1
  223. package/dist/stepper.cjs.js +1 -1
  224. package/dist/stepper.es.js +1 -1
  225. package/dist/{table-Ddv6BKo9.js → table-BVSBvTYG.js} +2 -2
  226. package/dist/{table-Ddv6BKo9.js.map → table-BVSBvTYG.js.map} +1 -1
  227. package/dist/{table-D_XW4smf.mjs → table-CuV3Gda_.mjs} +6 -6
  228. package/dist/{table-D_XW4smf.mjs.map → table-CuV3Gda_.mjs.map} +1 -1
  229. package/dist/table.cjs.js +1 -1
  230. package/dist/table.es.js +1 -1
  231. package/dist/{text-area-9ggiIWtJ.js → text-area-C6W0fDiQ.js} +2 -2
  232. package/dist/{text-area-9ggiIWtJ.js.map → text-area-C6W0fDiQ.js.map} +1 -1
  233. package/dist/{text-area-CpYWt99s.mjs → text-area-DDZ_GQPW.mjs} +3 -3
  234. package/dist/{text-area-CpYWt99s.mjs.map → text-area-DDZ_GQPW.mjs.map} +1 -1
  235. package/dist/text-area.cjs.js +1 -1
  236. package/dist/text-area.es.js +1 -1
  237. package/dist/{text-field-BQYzwIrG.mjs → text-field-BQfxJobW.mjs} +2 -2
  238. package/dist/{text-field-BQYzwIrG.mjs.map → text-field-BQfxJobW.mjs.map} +1 -1
  239. package/dist/{text-field-BwxGMWds.js → text-field-CYJzQG3h.js} +2 -2
  240. package/dist/{text-field-BwxGMWds.js.map → text-field-CYJzQG3h.js.map} +1 -1
  241. package/dist/text-field.cjs.js +1 -1
  242. package/dist/text-field.es.js +1 -1
  243. package/dist/theme.cjs.js +1 -1
  244. package/dist/theme.es.js +2 -2
  245. package/dist/tokens/color/variables.css +12 -12
  246. package/dist/tokens/color/variables.dark.css +13 -13
  247. package/dist/tokens/color/variables.dark.js +13 -13
  248. package/dist/tokens/color/variables.dark.json +13 -13
  249. package/dist/tokens/color/variables.dark.scss +13 -13
  250. package/dist/tokens/color/variables.js +12 -12
  251. package/dist/tokens/color/variables.json +12 -12
  252. package/dist/tokens/color/variables.scss +12 -12
  253. package/dist/tokens/gradient/variables.dark.js +4 -4
  254. package/dist/tokens/gradient/variables.dark.json +4 -4
  255. package/dist/tokens/gradient/variables.dark.scss +4 -4
  256. package/dist/tokens/gradient/variables.js +4 -4
  257. package/dist/tokens/gradient/variables.json +4 -4
  258. package/dist/tokens/gradient/variables.scss +4 -4
  259. package/dist/tokens.cjs.js +1 -1
  260. package/dist/tokens.cjs.js.map +1 -1
  261. package/dist/tokens.es.js +41 -41
  262. package/dist/tokens.es.js.map +1 -1
  263. package/dist/{tooltip-BatXMflw.js → tooltip-0pLBlDG3.js} +2 -2
  264. package/dist/{tooltip-BatXMflw.js.map → tooltip-0pLBlDG3.js.map} +1 -1
  265. package/dist/{tooltip-CZzwHkea.mjs → tooltip-Kom0VfOC.mjs} +2 -2
  266. package/dist/{tooltip-CZzwHkea.mjs.map → tooltip-Kom0VfOC.mjs.map} +1 -1
  267. package/dist/tooltip.cjs.js +1 -1
  268. package/dist/tooltip.es.js +1 -1
  269. package/dist/useColorScheme-0GMDl2GF.js +2 -0
  270. package/dist/{useColorScheme-DNNu9bz0.js.map → useColorScheme-0GMDl2GF.js.map} +1 -1
  271. package/dist/{useColorScheme-9rgSgG0N.mjs → useColorScheme-Di_Q0JR4.mjs} +2 -2
  272. package/dist/{useColorScheme-9rgSgG0N.mjs.map → useColorScheme-Di_Q0JR4.mjs.map} +1 -1
  273. package/dist/{variables-BVgnpUH9.mjs → variables-CKp4o9Tn.mjs} +2 -2
  274. package/dist/{variables-BVgnpUH9.mjs.map → variables-CKp4o9Tn.mjs.map} +1 -1
  275. package/dist/{variables-CMzMXeor.js → variables-DH61hVNE.js} +2 -2
  276. package/dist/{variables-CMzMXeor.js.map → variables-DH61hVNE.js.map} +1 -1
  277. package/package.json +42 -40
  278. package/src/aliases.ts +11 -0
  279. package/src/carousel.ts +6 -0
  280. package/src/comparison-table.ts +6 -0
  281. package/src/entries.js +2 -0
  282. package/src/library.ts +4 -0
  283. package/tokens/color/variables.css +12 -12
  284. package/tokens/color/variables.dark.css +13 -13
  285. package/tokens/color/variables.dark.js +13 -13
  286. package/tokens/color/variables.dark.json +13 -13
  287. package/tokens/color/variables.dark.scss +13 -13
  288. package/tokens/color/variables.js +12 -12
  289. package/tokens/color/variables.json +12 -12
  290. package/tokens/color/variables.scss +12 -12
  291. package/tokens/gradient/variables.dark.js +4 -4
  292. package/tokens/gradient/variables.dark.json +4 -4
  293. package/tokens/gradient/variables.dark.scss +4 -4
  294. package/tokens/gradient/variables.js +4 -4
  295. package/tokens/gradient/variables.json +4 -4
  296. package/tokens/gradient/variables.scss +4 -4
  297. package/dist/accordion-DX8efWOt.js +0 -2
  298. package/dist/button-Cv7NlYbv.mjs +0 -109
  299. package/dist/button-Dqxdc3nC.js +0 -2
  300. package/dist/card-VMa3cGCP.js +0 -2
  301. package/dist/content-block-BMOvlH7a.mjs.map +0 -1
  302. package/dist/content-block-Cd7xSE8t.js.map +0 -1
  303. package/dist/dropdown-BQOY21kI.js +0 -2
  304. package/dist/dropdown-BQOY21kI.js.map +0 -1
  305. package/dist/dropdown-CBYTBaMW.mjs +0 -779
  306. package/dist/dropdown-CBYTBaMW.mjs.map +0 -1
  307. package/dist/modal-DMeRO1wE.js.map +0 -1
  308. package/dist/modal-fTWvPEPW.mjs.map +0 -1
  309. package/dist/pagination-BdCjh1Pi.mjs.map +0 -1
  310. package/dist/pagination-C2A8NPol.js +0 -2
  311. package/dist/pagination-C2A8NPol.js.map +0 -1
  312. package/dist/quantity-selector-BV7QwVlT.js +0 -2
  313. package/dist/quantity-selector-BV7QwVlT.js.map +0 -1
  314. package/dist/quantity-selector-CGhJ2DjO.mjs.map +0 -1
  315. package/dist/useColorScheme-DNNu9bz0.js +0 -2
package/dist/table.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./table-Ddv6BKo9.js");exports.Table=e.Table;exports.createColumnHelper=e.createColumnHelper;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./table-BVSBvTYG.js");exports.Table=e.Table;exports.createColumnHelper=e.createColumnHelper;
2
2
  //# sourceMappingURL=table.cjs.js.map
package/dist/table.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { T as r, c as l } from "./table-D_XW4smf.mjs";
1
+ import { T as r, c as l } from "./table-CuV3Gda_.mjs";
2
2
  export {
3
3
  r as Table,
4
4
  l as createColumnHelper
@@ -1,2 +1,2 @@
1
- "use strict";const t=require("react/jsx-runtime"),j=require("react"),y=require("./field-error-text-FhQulSV5.js"),O=require("./field-helper-text-DSKO-Tce.js"),R=require("./label-yHK80hhV.js");require("./ThemeProvider-ipAIFRUi.js");const T=require("./useColorScheme-DNNu9bz0.js"),A=require("./bind-DeUYJ6m9.js"),s={"purpur-text-area":"_purpur-text-area_1qqf0_1","purpur-text-area__label":"_purpur-text-area__label_1qqf0_8","purpur-text-area__label-text":"_purpur-text-area__label-text_1qqf0_13","purpur-text-area__frame":"_purpur-text-area__frame_1qqf0_16","purpur-text-area__textarea-container":"_purpur-text-area__textarea-container_1qqf0_23","purpur-text-area__textarea-container--disabled":"_purpur-text-area__textarea-container--disabled_1qqf0_33","purpur-text-area__textarea-container--readonly":"_purpur-text-area__textarea-container--readonly_1qqf0_36","purpur-text-area__textarea":"_purpur-text-area__textarea_1qqf0_23","purpur-text-area__textarea--light":"_purpur-text-area__textarea--light_1qqf0_52","purpur-text-area__textarea--dark":"_purpur-text-area__textarea--dark_1qqf0_60","purpur-text-area__textarea--valid":"_purpur-text-area__textarea--valid_1qqf0_91","purpur-text-area__textarea--error":"_purpur-text-area__textarea--error_1qqf0_91"},c={NONE:"none",BOTH:"both",HORIZONTAL:"horizontal",VERTICAL:"vertical"},l=A.c.bind(s),e="purpur-text-area",p=j.forwardRef(({id:i,["data-testid"]:x,className:o,errorText:r,helperText:n,label:d,rows:q=3,cols:b=90,resize:f=c.BOTH,style:h,...a},m)=>{const[$]=T.useColorScheme(),_=N=>x?`${x}-${N}`:void 0,u=n?`${i}-helper-text`:void 0,v=l(`${e}__textarea-container`,{[`${e}__textarea-container--disabled`]:a.disabled,[`${e}__textarea-container--readonly`]:a.readOnly&&!a.disabled});return t.jsxs("div",{className:l(o,e),"data-testid":x,children:[d&&t.jsxs(R.Label,{htmlFor:i,disabled:a.disabled,className:s[`${e}__label`],"data-testid":_("label"),children:[a.required&&t.jsx("span",{"aria-hidden":!0,children:"*"}),d]}),t.jsxs("div",{className:v,children:[t.jsx("textarea",{...a,ref:m,id:i,"data-testid":_("textarea"),"aria-describedby":a["aria-describedby"]||u,"aria-invalid":a["aria-invalid"]||!!r,className:l(`${e}__textarea`,`${e}__textarea--${$}`,{[`${e}__textarea--error`]:!!r}),rows:q,cols:b,style:{resize:f,...h}}),t.jsx("div",{className:s[`${e}__frame`]})]}),u&&t.jsx(O.FieldHelperText,{"data-testid":_("helper-text"),id:u,children:n}),r&&t.jsx(y.FieldErrorText,{"data-testid":_("error-text"),children:r})]})});p.displayName="TextArea";exports.ResizeOption=c;exports.TextArea=p;
2
- //# sourceMappingURL=text-area-9ggiIWtJ.js.map
1
+ "use strict";const t=require("react/jsx-runtime"),j=require("react"),y=require("./field-error-text-FhQulSV5.js"),O=require("./field-helper-text-DSKO-Tce.js"),R=require("./label-yHK80hhV.js");require("./ThemeProvider-5r7lDX-h.js");const T=require("./useColorScheme-0GMDl2GF.js"),A=require("./bind-DeUYJ6m9.js"),s={"purpur-text-area":"_purpur-text-area_1qqf0_1","purpur-text-area__label":"_purpur-text-area__label_1qqf0_8","purpur-text-area__label-text":"_purpur-text-area__label-text_1qqf0_13","purpur-text-area__frame":"_purpur-text-area__frame_1qqf0_16","purpur-text-area__textarea-container":"_purpur-text-area__textarea-container_1qqf0_23","purpur-text-area__textarea-container--disabled":"_purpur-text-area__textarea-container--disabled_1qqf0_33","purpur-text-area__textarea-container--readonly":"_purpur-text-area__textarea-container--readonly_1qqf0_36","purpur-text-area__textarea":"_purpur-text-area__textarea_1qqf0_23","purpur-text-area__textarea--light":"_purpur-text-area__textarea--light_1qqf0_52","purpur-text-area__textarea--dark":"_purpur-text-area__textarea--dark_1qqf0_60","purpur-text-area__textarea--valid":"_purpur-text-area__textarea--valid_1qqf0_91","purpur-text-area__textarea--error":"_purpur-text-area__textarea--error_1qqf0_91"},c={NONE:"none",BOTH:"both",HORIZONTAL:"horizontal",VERTICAL:"vertical"},l=A.c.bind(s),e="purpur-text-area",p=j.forwardRef(({id:i,["data-testid"]:x,className:o,errorText:r,helperText:n,label:d,rows:q=3,cols:b=90,resize:f=c.BOTH,style:h,...a},m)=>{const[$]=T.useColorScheme(),_=N=>x?`${x}-${N}`:void 0,u=n?`${i}-helper-text`:void 0,v=l(`${e}__textarea-container`,{[`${e}__textarea-container--disabled`]:a.disabled,[`${e}__textarea-container--readonly`]:a.readOnly&&!a.disabled});return t.jsxs("div",{className:l(o,e),"data-testid":x,children:[d&&t.jsxs(R.Label,{htmlFor:i,disabled:a.disabled,className:s[`${e}__label`],"data-testid":_("label"),children:[a.required&&t.jsx("span",{"aria-hidden":!0,children:"*"}),d]}),t.jsxs("div",{className:v,children:[t.jsx("textarea",{...a,ref:m,id:i,"data-testid":_("textarea"),"aria-describedby":a["aria-describedby"]||u,"aria-invalid":a["aria-invalid"]||!!r,className:l(`${e}__textarea`,`${e}__textarea--${$}`,{[`${e}__textarea--error`]:!!r}),rows:q,cols:b,style:{resize:f,...h}}),t.jsx("div",{className:s[`${e}__frame`]})]}),u&&t.jsx(O.FieldHelperText,{"data-testid":_("helper-text"),id:u,children:n}),r&&t.jsx(y.FieldErrorText,{"data-testid":_("error-text"),children:r})]})});p.displayName="TextArea";exports.ResizeOption=c;exports.TextArea=p;
2
+ //# sourceMappingURL=text-area-C6W0fDiQ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-area-9ggiIWtJ.js","sources":["../../../components/text-area/src/text-area.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { FieldErrorText } from \"@purpur/field-error-text\";\nimport { FieldHelperText } from \"@purpur/field-helper-text\";\nimport { Label } from \"@purpur/label\";\nimport { useColorScheme } from \"@purpur/theme\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./text-area.module.scss\";\n\nexport const ResizeOption = {\n NONE: \"none\",\n BOTH: \"both\",\n HORIZONTAL: \"horizontal\",\n VERTICAL: \"vertical\",\n} as const;\n\nexport type ResizeOption = (typeof ResizeOption)[keyof typeof ResizeOption];\n\nexport type TextAreaProps = Omit<BaseProps<\"textarea\">, \"id\"> & {\n id: string;\n /**\n * Use to render error message below the text area. The text area renders with error appearance.\n * */\n errorText?: string;\n /**\n * Use to give context about the text area's input. Renders below the text area.\n * */\n helperText?: string;\n /**\n * The label of the text area.\n * */\n label?: string;\n /**\n * The height of the text area, measured in number of rows.\n * */\n rows?: number;\n /**\n * The width of the text area, measured in number of cols.\n * */\n cols?: number;\n /**\n * Controls whether the text area can be resized, and in which direction.\n * */\n resize?: ResizeOption;\n};\n\nconst cx = c.bind(styles);\nconst rootClassName = \"purpur-text-area\";\n\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n (\n {\n id,\n [\"data-testid\"]: dataTestId,\n className,\n errorText,\n helperText,\n label,\n rows = 3,\n cols = 90,\n resize = ResizeOption.BOTH,\n style,\n ...props\n },\n ref\n ) => {\n const [colorScheme] = useColorScheme();\n\n const getTestId = (name: string) => (dataTestId ? `${dataTestId}-${name}` : undefined);\n\n const helperTextId = helperText ? `${id}-helper-text` : undefined;\n\n const textAreaContainerClassnames = cx(`${rootClassName}__textarea-container`, {\n [`${rootClassName}__textarea-container--disabled`]: props.disabled,\n [`${rootClassName}__textarea-container--readonly`]: props.readOnly && !props.disabled,\n });\n\n return (\n <div className={cx(className, rootClassName)} data-testid={dataTestId}>\n {label && (\n <Label\n htmlFor={id}\n disabled={props.disabled}\n className={styles[`${rootClassName}__label`]}\n data-testid={getTestId(\"label\")}\n >\n {props.required && <span aria-hidden>*</span>}\n {label}\n </Label>\n )}\n <div className={textAreaContainerClassnames}>\n <textarea\n {...props}\n ref={ref}\n id={id}\n data-testid={getTestId(\"textarea\")}\n aria-describedby={props[\"aria-describedby\"] || helperTextId}\n aria-invalid={props[\"aria-invalid\"] || !!errorText}\n className={cx(\n `${rootClassName}__textarea`,\n `${rootClassName}__textarea--${colorScheme}`,\n {\n [`${rootClassName}__textarea--error`]: !!errorText,\n }\n )}\n rows={rows}\n cols={cols}\n style={{ resize, ...style }}\n />\n <div className={styles[`${rootClassName}__frame`]} />\n </div>\n {helperTextId && (\n <FieldHelperText data-testid={getTestId(\"helper-text\")} id={helperTextId}>\n {helperText}\n </FieldHelperText>\n )}\n {errorText && (\n <FieldErrorText data-testid={getTestId(\"error-text\")}>{errorText}</FieldErrorText>\n )}\n </div>\n );\n }\n);\n\nTextArea.displayName = \"TextArea\";\n"],"names":["ResizeOption","cx","c","styles","rootClassName","TextArea","forwardRef","id","dataTestId","className","errorText","helperText","label","rows","cols","resize","style","props","ref","colorScheme","useColorScheme","getTestId","name","helperTextId","textAreaContainerClassnames","jsxs","Label","jsx","FieldHelperText","FieldErrorText"],"mappings":"suCAUaA,EAAe,CAC1B,KAAM,OACN,KAAM,OACN,WAAY,aACZ,SAAU,UACZ,EAgCMC,EAAKC,EAAAA,EAAE,KAAKC,CAAM,EAClBC,EAAgB,mBAETC,EAAWC,EAAAA,WACtB,CACE,CACE,GAAAC,EACA,CAAC,eAAgBC,EACjB,UAAAC,EACA,UAAAC,EACA,WAAAC,EAAA,MACAC,EACA,KAAAC,EAAO,EACP,KAAAC,EAAO,GACP,OAAAC,EAASf,EAAa,KACtB,MAAAgB,EACA,GAAGC,CAAA,EAELC,IACG,CACH,KAAM,CAACC,CAAW,EAAIC,iBAAA,EAEhBC,EAAaC,GAAkBd,EAAa,GAAGA,CAAU,IAAIc,CAAI,GAAK,OAEtEC,EAAeZ,EAAa,GAAGJ,CAAE,eAAiB,OAElDiB,EAA8BvB,EAAG,GAAGG,CAAa,uBAAwB,CAC7E,CAAC,GAAGA,CAAa,gCAAgC,EAAGa,EAAM,SAC1D,CAAC,GAAGb,CAAa,gCAAgC,EAAGa,EAAM,UAAY,CAACA,EAAM,QAAA,CAC9E,EAED,OACEQ,OAAC,OAAI,UAAWxB,EAAGQ,EAAWL,CAAa,EAAG,cAAaI,EACxD,SAAA,CAAAI,GACCa,EAAAA,KAACC,EAAAA,MAAA,CACC,QAASnB,EACT,SAAUU,EAAM,SAChB,UAAWd,EAAO,GAAGC,CAAa,SAAS,EAC3C,cAAaiB,EAAU,OAAO,EAE7B,SAAA,CAAAJ,EAAM,UAAYU,EAAAA,IAAC,OAAA,CAAK,cAAW,GAAC,SAAA,IAAC,EACrCf,CAAA,CAAA,CAAA,EAGLa,EAAAA,KAAC,MAAA,CAAI,UAAWD,EACd,SAAA,CAAAG,EAAAA,IAAC,WAAA,CACE,GAAGV,EACJ,IAAAC,EACA,GAAAX,EACA,cAAac,EAAU,UAAU,EACjC,mBAAkBJ,EAAM,kBAAkB,GAAKM,EAC/C,eAAcN,EAAM,cAAc,GAAK,CAAC,CAACP,EACzC,UAAWT,EACT,GAAGG,CAAa,aAChB,GAAGA,CAAa,eAAee,CAAW,GAC1C,CACE,CAAC,GAAGf,CAAa,mBAAmB,EAAG,CAAC,CAACM,CAAA,CAC3C,EAEF,KAAAG,EACA,KAAAC,EACA,MAAO,CAAE,OAAAC,EAAQ,GAAGC,CAAA,CAAM,CAAA,QAE3B,MAAA,CAAI,UAAWb,EAAO,GAAGC,CAAa,SAAS,CAAA,CAAG,CAAA,EACrD,EACCmB,SACEK,kBAAA,CAAgB,cAAaP,EAAU,aAAa,EAAG,GAAIE,EACzD,SAAAZ,CAAA,CACH,EAEDD,GACCiB,EAAAA,IAACE,EAAAA,eAAA,CAAe,cAAaR,EAAU,YAAY,EAAI,SAAAX,CAAA,CAAU,CAAA,EAErE,CAEJ,CACF,EAEAL,EAAS,YAAc"}
1
+ {"version":3,"file":"text-area-C6W0fDiQ.js","sources":["../../../components/text-area/src/text-area.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { FieldErrorText } from \"@purpur/field-error-text\";\nimport { FieldHelperText } from \"@purpur/field-helper-text\";\nimport { Label } from \"@purpur/label\";\nimport { useColorScheme } from \"@purpur/theme\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./text-area.module.scss\";\n\nexport const ResizeOption = {\n NONE: \"none\",\n BOTH: \"both\",\n HORIZONTAL: \"horizontal\",\n VERTICAL: \"vertical\",\n} as const;\n\nexport type ResizeOption = (typeof ResizeOption)[keyof typeof ResizeOption];\n\nexport type TextAreaProps = Omit<BaseProps<\"textarea\">, \"id\"> & {\n id: string;\n /**\n * Use to render error message below the text area. The text area renders with error appearance.\n * */\n errorText?: string;\n /**\n * Use to give context about the text area's input. Renders below the text area.\n * */\n helperText?: string;\n /**\n * The label of the text area.\n * */\n label?: string;\n /**\n * The height of the text area, measured in number of rows.\n * */\n rows?: number;\n /**\n * The width of the text area, measured in number of cols.\n * */\n cols?: number;\n /**\n * Controls whether the text area can be resized, and in which direction.\n * */\n resize?: ResizeOption;\n};\n\nconst cx = c.bind(styles);\nconst rootClassName = \"purpur-text-area\";\n\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n (\n {\n id,\n [\"data-testid\"]: dataTestId,\n className,\n errorText,\n helperText,\n label,\n rows = 3,\n cols = 90,\n resize = ResizeOption.BOTH,\n style,\n ...props\n },\n ref\n ) => {\n const [colorScheme] = useColorScheme();\n\n const getTestId = (name: string) => (dataTestId ? `${dataTestId}-${name}` : undefined);\n\n const helperTextId = helperText ? `${id}-helper-text` : undefined;\n\n const textAreaContainerClassnames = cx(`${rootClassName}__textarea-container`, {\n [`${rootClassName}__textarea-container--disabled`]: props.disabled,\n [`${rootClassName}__textarea-container--readonly`]: props.readOnly && !props.disabled,\n });\n\n return (\n <div className={cx(className, rootClassName)} data-testid={dataTestId}>\n {label && (\n <Label\n htmlFor={id}\n disabled={props.disabled}\n className={styles[`${rootClassName}__label`]}\n data-testid={getTestId(\"label\")}\n >\n {props.required && <span aria-hidden>*</span>}\n {label}\n </Label>\n )}\n <div className={textAreaContainerClassnames}>\n <textarea\n {...props}\n ref={ref}\n id={id}\n data-testid={getTestId(\"textarea\")}\n aria-describedby={props[\"aria-describedby\"] || helperTextId}\n aria-invalid={props[\"aria-invalid\"] || !!errorText}\n className={cx(\n `${rootClassName}__textarea`,\n `${rootClassName}__textarea--${colorScheme}`,\n {\n [`${rootClassName}__textarea--error`]: !!errorText,\n }\n )}\n rows={rows}\n cols={cols}\n style={{ resize, ...style }}\n />\n <div className={styles[`${rootClassName}__frame`]} />\n </div>\n {helperTextId && (\n <FieldHelperText data-testid={getTestId(\"helper-text\")} id={helperTextId}>\n {helperText}\n </FieldHelperText>\n )}\n {errorText && (\n <FieldErrorText data-testid={getTestId(\"error-text\")}>{errorText}</FieldErrorText>\n )}\n </div>\n );\n }\n);\n\nTextArea.displayName = \"TextArea\";\n"],"names":["ResizeOption","cx","c","styles","rootClassName","TextArea","forwardRef","id","dataTestId","className","errorText","helperText","label","rows","cols","resize","style","props","ref","colorScheme","useColorScheme","getTestId","name","helperTextId","textAreaContainerClassnames","jsxs","Label","jsx","FieldHelperText","FieldErrorText"],"mappings":"suCAUaA,EAAe,CAC1B,KAAM,OACN,KAAM,OACN,WAAY,aACZ,SAAU,UACZ,EAgCMC,EAAKC,EAAAA,EAAE,KAAKC,CAAM,EAClBC,EAAgB,mBAETC,EAAWC,EAAAA,WACtB,CACE,CACE,GAAAC,EACA,CAAC,eAAgBC,EACjB,UAAAC,EACA,UAAAC,EACA,WAAAC,EAAA,MACAC,EACA,KAAAC,EAAO,EACP,KAAAC,EAAO,GACP,OAAAC,EAASf,EAAa,KACtB,MAAAgB,EACA,GAAGC,CAAA,EAELC,IACG,CACH,KAAM,CAACC,CAAW,EAAIC,iBAAA,EAEhBC,EAAaC,GAAkBd,EAAa,GAAGA,CAAU,IAAIc,CAAI,GAAK,OAEtEC,EAAeZ,EAAa,GAAGJ,CAAE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YAAc"}
@@ -3,8 +3,8 @@ import { forwardRef as N } from "react";
3
3
  import { F as y } from "./field-error-text-CBSX8dGx.mjs";
4
4
  import { F as O } from "./field-helper-text-C5ee4SFV.mjs";
5
5
  import { L as A } from "./label-7sJe5-pX.mjs";
6
- import "./ThemeProvider-BR1hJQOD.mjs";
7
- import { u as C } from "./useColorScheme-9rgSgG0N.mjs";
6
+ import "./ThemeProvider-bkyFCeo6.mjs";
7
+ import { u as C } from "./useColorScheme-Di_Q0JR4.mjs";
8
8
  import { c as F } from "./bind-CU-R61T-.mjs";
9
9
  const p = {
10
10
  "purpur-text-area": "_purpur-text-area_1qqf0_1",
@@ -90,4 +90,4 @@ export {
90
90
  R,
91
91
  T
92
92
  };
93
- //# sourceMappingURL=text-area-CpYWt99s.mjs.map
93
+ //# sourceMappingURL=text-area-DDZ_GQPW.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-area-CpYWt99s.mjs","sources":["../../../components/text-area/src/text-area.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { FieldErrorText } from \"@purpur/field-error-text\";\nimport { FieldHelperText } from \"@purpur/field-helper-text\";\nimport { Label } from \"@purpur/label\";\nimport { useColorScheme } from \"@purpur/theme\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./text-area.module.scss\";\n\nexport const ResizeOption = {\n NONE: \"none\",\n BOTH: \"both\",\n HORIZONTAL: \"horizontal\",\n VERTICAL: \"vertical\",\n} as const;\n\nexport type ResizeOption = (typeof ResizeOption)[keyof typeof ResizeOption];\n\nexport type TextAreaProps = Omit<BaseProps<\"textarea\">, \"id\"> & {\n id: string;\n /**\n * Use to render error message below the text area. The text area renders with error appearance.\n * */\n errorText?: string;\n /**\n * Use to give context about the text area's input. Renders below the text area.\n * */\n helperText?: string;\n /**\n * The label of the text area.\n * */\n label?: string;\n /**\n * The height of the text area, measured in number of rows.\n * */\n rows?: number;\n /**\n * The width of the text area, measured in number of cols.\n * */\n cols?: number;\n /**\n * Controls whether the text area can be resized, and in which direction.\n * */\n resize?: ResizeOption;\n};\n\nconst cx = c.bind(styles);\nconst rootClassName = \"purpur-text-area\";\n\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n (\n {\n id,\n [\"data-testid\"]: dataTestId,\n className,\n errorText,\n helperText,\n label,\n rows = 3,\n cols = 90,\n resize = ResizeOption.BOTH,\n style,\n ...props\n },\n ref\n ) => {\n const [colorScheme] = useColorScheme();\n\n const getTestId = (name: string) => (dataTestId ? `${dataTestId}-${name}` : undefined);\n\n const helperTextId = helperText ? `${id}-helper-text` : undefined;\n\n const textAreaContainerClassnames = cx(`${rootClassName}__textarea-container`, {\n [`${rootClassName}__textarea-container--disabled`]: props.disabled,\n [`${rootClassName}__textarea-container--readonly`]: props.readOnly && !props.disabled,\n });\n\n return (\n <div className={cx(className, rootClassName)} data-testid={dataTestId}>\n {label && (\n <Label\n htmlFor={id}\n disabled={props.disabled}\n className={styles[`${rootClassName}__label`]}\n data-testid={getTestId(\"label\")}\n >\n {props.required && <span aria-hidden>*</span>}\n {label}\n </Label>\n )}\n <div className={textAreaContainerClassnames}>\n <textarea\n {...props}\n ref={ref}\n id={id}\n data-testid={getTestId(\"textarea\")}\n aria-describedby={props[\"aria-describedby\"] || helperTextId}\n aria-invalid={props[\"aria-invalid\"] || !!errorText}\n className={cx(\n `${rootClassName}__textarea`,\n `${rootClassName}__textarea--${colorScheme}`,\n {\n [`${rootClassName}__textarea--error`]: !!errorText,\n }\n )}\n rows={rows}\n cols={cols}\n style={{ resize, ...style }}\n />\n <div className={styles[`${rootClassName}__frame`]} />\n </div>\n {helperTextId && (\n <FieldHelperText data-testid={getTestId(\"helper-text\")} id={helperTextId}>\n {helperText}\n </FieldHelperText>\n )}\n {errorText && (\n <FieldErrorText data-testid={getTestId(\"error-text\")}>{errorText}</FieldErrorText>\n )}\n </div>\n );\n }\n);\n\nTextArea.displayName = \"TextArea\";\n"],"names":["ResizeOption","cx","c","styles","rootClassName","TextArea","forwardRef","id","dataTestId","className","errorText","helperText","label","rows","cols","resize","style","props","ref","colorScheme","useColorScheme","getTestId","name","helperTextId","textAreaContainerClassnames","jsxs","Label","jsx","FieldHelperText","FieldErrorText"],"mappings":";;;;;;;;;;;;;;;;;;;;;GAUaA,IAAe;AAAA,EAC1B,MAAM;AAAA,EACN,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,UAAU;AACZ,GAgCMC,IAAKC,EAAE,KAAKC,CAAM,GAClBC,IAAgB,oBAETC,IAAWC;AAAA,EACtB,CACE;AAAA,IACE,IAAAC;AAAA,IACA,CAAC,gBAAgBC;AAAA,IACjB,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,MAAAC,IAAO;AAAA,IACP,QAAAC,IAASf,EAAa;AAAA,IACtB,OAAAgB;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAM,CAACC,CAAW,IAAIC,EAAA,GAEhBC,IAAY,CAACC,MAAkBd,IAAa,GAAGA,CAAU,IAAIc,CAAI,KAAK,QAEtEC,IAAeZ,IAAa,GAAGJ,CAAE,iBAAiB,QAElDiB,IAA8BvB,EAAG,GAAGG,CAAa,wBAAwB;AAAA,MAC7E,CAAC,GAAGA,CAAa,gCAAgC,GAAGa,EAAM;AAAA,MAC1D,CAAC,GAAGb,CAAa,gCAAgC,GAAGa,EAAM,YAAY,CAACA,EAAM;AAAA,IAAA,CAC9E;AAED,WACE,gBAAAQ,EAAC,SAAI,WAAWxB,EAAGQ,GAAWL,CAAa,GAAG,eAAaI,GACxD,UAAA;AAAA,MAAAI,KACC,gBAAAa;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,SAASnB;AAAA,UACT,UAAUU,EAAM;AAAA,UAChB,WAAWd,EAAO,GAAGC,CAAa,SAAS;AAAA,UAC3C,eAAaiB,EAAU,OAAO;AAAA,UAE7B,UAAA;AAAA,YAAAJ,EAAM,YAAY,gBAAAU,EAAC,QAAA,EAAK,eAAW,IAAC,UAAA,KAAC;AAAA,YACrCf;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,MAGL,gBAAAa,EAAC,OAAA,EAAI,WAAWD,GACd,UAAA;AAAA,QAAA,gBAAAG;AAAA,UAAC;AAAA,UAAA;AAAA,YACE,GAAGV;AAAA,YACJ,KAAAC;AAAA,YACA,IAAAX;AAAA,YACA,eAAac,EAAU,UAAU;AAAA,YACjC,oBAAkBJ,EAAM,kBAAkB,KAAKM;AAAA,YAC/C,gBAAcN,EAAM,cAAc,KAAK,CAAC,CAACP;AAAA,YACzC,WAAWT;AAAA,cACT,GAAGG,CAAa;AAAA,cAChB,GAAGA,CAAa,eAAee,CAAW;AAAA,cAC1C;AAAA,gBACE,CAAC,GAAGf,CAAa,mBAAmB,GAAG,CAAC,CAACM;AAAA,cAAA;AAAA,YAC3C;AAAA,YAEF,MAAAG;AAAA,YACA,MAAAC;AAAA,YACA,OAAO,EAAE,QAAAC,GAAQ,GAAGC,EAAA;AAAA,UAAM;AAAA,QAAA;AAAA,0BAE3B,OAAA,EAAI,WAAWb,EAAO,GAAGC,CAAa,SAAS,EAAA,CAAG;AAAA,MAAA,GACrD;AAAA,MACCmB,uBACEK,GAAA,EAAgB,eAAaP,EAAU,aAAa,GAAG,IAAIE,GACzD,UAAAZ,EAAA,CACH;AAAA,MAEDD,KACC,gBAAAiB,EAACE,GAAA,EAAe,eAAaR,EAAU,YAAY,GAAI,UAAAX,EAAA,CAAU;AAAA,IAAA,GAErE;AAAA,EAEJ;AACF;AAEAL,EAAS,cAAc;"}
1
+ {"version":3,"file":"text-area-DDZ_GQPW.mjs","sources":["../../../components/text-area/src/text-area.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { FieldErrorText } from \"@purpur/field-error-text\";\nimport { FieldHelperText } from \"@purpur/field-helper-text\";\nimport { Label } from \"@purpur/label\";\nimport { useColorScheme } from \"@purpur/theme\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./text-area.module.scss\";\n\nexport const ResizeOption = {\n NONE: \"none\",\n BOTH: \"both\",\n HORIZONTAL: \"horizontal\",\n VERTICAL: \"vertical\",\n} as const;\n\nexport type ResizeOption = (typeof ResizeOption)[keyof typeof ResizeOption];\n\nexport type TextAreaProps = Omit<BaseProps<\"textarea\">, \"id\"> & {\n id: string;\n /**\n * Use to render error message below the text area. The text area renders with error appearance.\n * */\n errorText?: string;\n /**\n * Use to give context about the text area's input. Renders below the text area.\n * */\n helperText?: string;\n /**\n * The label of the text area.\n * */\n label?: string;\n /**\n * The height of the text area, measured in number of rows.\n * */\n rows?: number;\n /**\n * The width of the text area, measured in number of cols.\n * */\n cols?: number;\n /**\n * Controls whether the text area can be resized, and in which direction.\n * */\n resize?: ResizeOption;\n};\n\nconst cx = c.bind(styles);\nconst rootClassName = \"purpur-text-area\";\n\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n (\n {\n id,\n [\"data-testid\"]: dataTestId,\n className,\n errorText,\n helperText,\n label,\n rows = 3,\n cols = 90,\n resize = ResizeOption.BOTH,\n style,\n ...props\n },\n ref\n ) => {\n const [colorScheme] = useColorScheme();\n\n const getTestId = (name: string) => (dataTestId ? `${dataTestId}-${name}` : undefined);\n\n const helperTextId = helperText ? `${id}-helper-text` : undefined;\n\n const textAreaContainerClassnames = cx(`${rootClassName}__textarea-container`, {\n [`${rootClassName}__textarea-container--disabled`]: props.disabled,\n [`${rootClassName}__textarea-container--readonly`]: props.readOnly && !props.disabled,\n });\n\n return (\n <div className={cx(className, rootClassName)} data-testid={dataTestId}>\n {label && (\n <Label\n htmlFor={id}\n disabled={props.disabled}\n className={styles[`${rootClassName}__label`]}\n data-testid={getTestId(\"label\")}\n >\n {props.required && <span aria-hidden>*</span>}\n {label}\n </Label>\n )}\n <div className={textAreaContainerClassnames}>\n <textarea\n {...props}\n ref={ref}\n id={id}\n data-testid={getTestId(\"textarea\")}\n aria-describedby={props[\"aria-describedby\"] || helperTextId}\n aria-invalid={props[\"aria-invalid\"] || !!errorText}\n className={cx(\n `${rootClassName}__textarea`,\n `${rootClassName}__textarea--${colorScheme}`,\n {\n [`${rootClassName}__textarea--error`]: !!errorText,\n }\n )}\n rows={rows}\n cols={cols}\n style={{ resize, ...style }}\n />\n <div className={styles[`${rootClassName}__frame`]} />\n </div>\n {helperTextId && (\n <FieldHelperText data-testid={getTestId(\"helper-text\")} id={helperTextId}>\n {helperText}\n </FieldHelperText>\n )}\n {errorText && (\n <FieldErrorText data-testid={getTestId(\"error-text\")}>{errorText}</FieldErrorText>\n )}\n </div>\n );\n }\n);\n\nTextArea.displayName = \"TextArea\";\n"],"names":["ResizeOption","cx","c","styles","rootClassName","TextArea","forwardRef","id","dataTestId","className","errorText","helperText","label","rows","cols","resize","style","props","ref","colorScheme","useColorScheme","getTestId","name","helperTextId","textAreaContainerClassnames","jsxs","Label","jsx","FieldHelperText","FieldErrorText"],"mappings":";;;;;;;;;;;;;;;;;;;;;GAUaA,IAAe;AAAA,EAC1B,MAAM;AAAA,EACN,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,UAAU;AACZ,GAgCMC,IAAKC,EAAE,KAAKC,CAAM,GAClBC,IAAgB,oBAETC,IAAWC;AAAA,EACtB,CACE;AAAA,IACE,IAAAC;AAAA,IACA,CAAC,gBAAgBC;AAAA,IACjB,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,MAAAC,IAAO;AAAA,IACP,QAAAC,IAASf,EAAa;AAAA,IACtB,OAAAgB;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAM,CAACC,CAAW,IAAIC,EAAA,GAEhBC,IAAY,CAACC,MAAkBd,IAAa,GAAGA,CAAU,IAAIc,CAAI,KAAK,QAEtEC,IAAeZ,IAAa,GAA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AAa,SAAS,EAAA,CAAG;AAAA,MAAA,GACrD;AAAA,MACCmB,uBACEK,GAAA,EAAgB,eAAaP,EAAU,aAAa,GAAG,IAAIE,GACzD,UAAAZ,EAAA,CACH;AAAA,MAEDD,KACC,gBAAAiB,EAACE,GAAA,EAAe,eAAaR,EAAU,YAAY,GAAI,UAAAX,EAAA,CAAU;AAAA,IAAA,GAErE;AAAA,EAEJ;AACF;AAEAL,EAAS,cAAc;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./text-area-9ggiIWtJ.js");exports.ResizeOption=e.ResizeOption;exports.TextArea=e.TextArea;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./text-area-C6W0fDiQ.js");exports.ResizeOption=e.ResizeOption;exports.TextArea=e.TextArea;
2
2
  //# sourceMappingURL=text-area.cjs.js.map
@@ -1,4 +1,4 @@
1
- import { R as o, T as r } from "./text-area-CpYWt99s.mjs";
1
+ import { R as o, T as r } from "./text-area-DDZ_GQPW.mjs";
2
2
  export {
3
3
  o as ResizeOption,
4
4
  r as TextArea
@@ -2,7 +2,7 @@ import { jsx as r, jsxs as A } from "react/jsx-runtime";
2
2
  import { useRef as U, forwardRef as q, useId as te, useState as C, useCallback as ie, useEffect as L, isValidElement as ae } from "react";
3
3
  import { b as re } from "./icon-DNHpBTHs-JfI8WyiR.mjs";
4
4
  import { c as Q } from "./bind-CU-R61T-.mjs";
5
- import { b as ne } from "./button-Cv7NlYbv.mjs";
5
+ import { b as ne } from "./button-4-yWOgtD.mjs";
6
6
  import { F as ue } from "./field-error-text-CBSX8dGx.mjs";
7
7
  import { F as de } from "./field-helper-text-C5ee4SFV.mjs";
8
8
  import { r as le } from "./check-circle-filled.es-umBwOv5_.mjs";
@@ -319,4 +319,4 @@ export {
319
319
  Te as i,
320
320
  Re as t
321
321
  };
322
- //# sourceMappingURL=text-field-BQYzwIrG.mjs.map
322
+ //# sourceMappingURL=text-field-BQfxJobW.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-field-BQYzwIrG.mjs","sources":["../../../components/icon/dist/components/edit-ai.es.js","../../../components/text-field/src/utils.ts","../../../components/text-field/src/text-field-base.tsx","../../../components/text-field/src/text-field-ai.tsx","../../../components/text-field/src/text-field.tsx"],"sourcesContent":["import { jsx as i } from \"react/jsx-runtime\";\nimport { I as o } from \"../icon-DNHpBTHs.mjs\";\nconst t = {\n name: \"edit-ai\",\n svg: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M18.175 22.5c.464-.002.856-.304.978-.755.41-1.533 1.255-2.463 2.655-2.926a1.02 1.02 0 0 0 .015-1.93c-1.437-.508-2.283-1.434-2.664-2.919a1.017 1.017 0 0 0-.974-.766c-.445.02-.865.305-.986.747-.422 1.518-1.267 2.447-2.661 2.923a1.02 1.02 0 0 0-.686.969c0 .436.278.824.686.961 1.4.479 2.243 1.414 2.657 2.946.12.442.523.75.978.75h.002Zm-1.788-4.66a5.334 5.334 0 0 0 1.78-1.867 5.323 5.323 0 0 0 1.792 1.87 5.256 5.256 0 0 0-1.787 1.88 5.326 5.326 0 0 0-1.785-1.883Zm4.668-12.884L18.19 2.091a1.9 1.9 0 0 0-2.687 0l-11.37 11.37a.9.9 0 0 0-.212.335L1.556 20.44a.9.9 0 0 0 1.15 1.15l6.644-2.365a.9.9 0 0 0 .335-.212l11.37-11.37a1.9 1.9 0 0 0 0-2.687ZM3.888 19.26l1.253-3.518 2.264 2.264-3.517 1.254ZM19.781 6.37 9.048 17.104 6.04 14.098l8.16-8.16 1.504 1.503a.9.9 0 1 0 1.273-1.273l-1.504-1.503 1.302-1.3a.1.1 0 0 1 .14 0l2.865 2.864a.1.1 0 0 1 0 .141Z\"/></svg>',\n keywords: [\"edit-ai\"],\n category: \"ai\"\n}, l = (a) => /* @__PURE__ */ i(o, { ...a, svg: t });\nl.displayName = \"IconEditAi\";\nexport {\n l as IconEditAi\n};\n//# sourceMappingURL=edit-ai.es.js.map\n","import { type MutableRefObject, useRef } from \"react\";\n\nexport const useMutableRefObject = <T>(value: T): MutableRefObject<T> => {\n return useRef<T>(value) as MutableRefObject<T>;\n};\n","import React, { forwardRef, type ReactNode, useId } from \"react\";\nimport { Button } from \"@purpur/button\";\nimport { FieldErrorText } from \"@purpur/field-error-text\";\nimport { FieldHelperText } from \"@purpur/field-helper-text\";\nimport { IconCheckCircleFilled } from \"@purpur/icon/check-circle-filled\";\nimport { IconClose } from \"@purpur/icon/close\";\nimport { Label } from \"@purpur/label\";\nimport { Spinner } from \"@purpur/spinner\";\nimport c from \"classnames/bind\";\n\nimport type { TextFieldBaseProps } from \"./text-field\";\nimport defaultStyles from \"./text-field.module.scss\";\nimport { useMutableRefObject } from \"./utils\";\n\nconst defaultRootClassName = \"purpur-text-field-default\";\n\n// Internal overrides for variant composition (not part of the public API)\nexport type TextFieldBaseInternalOverrides = {\n _styles?: Record<string, string>;\n _rootClassName?: string;\n _prependEndAdornments?: ReactNode[];\n _inputModifiers?: Record<string, boolean>;\n _frameModifiers?: Record<string, boolean>;\n _inputContainerRef?: React.Ref<HTMLDivElement>;\n};\n\nexport const TextFieldBase = forwardRef<\n HTMLInputElement,\n TextFieldBaseProps & TextFieldBaseInternalOverrides\n>(\n (\n {\n [\"data-testid\"]: dataTestId,\n className,\n clearButtonAriaLabel,\n beforeField,\n afterField,\n endAdornment,\n errorText,\n helperText,\n hideRequiredAsterisk = false,\n label,\n loading = false,\n onClear,\n startAdornment,\n valid = false,\n negative = false,\n _styles,\n _rootClassName,\n _prependEndAdornments,\n _inputModifiers,\n _frameModifiers,\n _inputContainerRef,\n ...inputProps\n },\n ref\n ) => {\n const cx = c.bind(_styles ?? defaultStyles);\n const rootClassName = _rootClassName ?? defaultRootClassName;\n const randomId = useId();\n const inputId = inputProps.id ?? randomId;\n const getTestId = (name: string) => (dataTestId ? `${dataTestId}-${name}` : undefined);\n const isValid = valid && !errorText;\n const helperTextId = helperText ? `${inputId}-helper-text` : undefined;\n const startAdornments: ReactNode[] = [startAdornment].filter((adornment) => !!adornment);\n const hasValue =\n typeof inputProps.value === \"number\"\n ? inputProps.value !== undefined\n : inputProps.value?.length;\n const hasClearButton =\n hasValue &&\n !inputProps.disabled &&\n !inputProps.readOnly &&\n !loading &&\n onClear &&\n clearButtonAriaLabel;\n\n const internalRef = useMutableRefObject<HTMLInputElement | null>(null);\n const setRef = (node: HTMLInputElement | null) => {\n internalRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n };\n const handleClear = () => {\n onClear?.();\n internalRef.current?.focus();\n };\n\n const localEndAdornments: ReactNode[] = [\n ...(_prependEndAdornments ?? []),\n loading && (\n <Spinner\n key=\"spinner\"\n disabled={inputProps.disabled}\n size=\"xs\"\n data-testid={getTestId(\"spinner\")}\n negative={negative}\n />\n ),\n hasClearButton && (\n <Button\n negative={negative}\n key=\"clear-button\"\n variant=\"tertiary-purple\"\n onClick={handleClear}\n iconOnly\n aria-label={clearButtonAriaLabel ?? \"\"}\n data-testid={getTestId(\"clear-button\")}\n tabIndex={-1}\n >\n <IconClose size=\"xs\" />\n </Button>\n ),\n isValid && (\n <IconCheckCircleFilled\n key=\"valid-icon\"\n data-testid={getTestId(\"valid-icon\")}\n className={cx(`${rootClassName}__valid-icon`, {\n [`${rootClassName}__valid-icon--negative`]: negative,\n })}\n />\n ),\n ].filter((adornment) => !!adornment);\n\n const inputContainerClassnames = cx(`${rootClassName}__input-container`, {\n [`${rootClassName}__input-container--start-adornment`]: startAdornments.length,\n [`${rootClassName}__input-container--end-adornment`]:\n localEndAdornments.length || endAdornment,\n [`${rootClassName}__input-container--disabled`]: inputProps.disabled,\n [`${rootClassName}__input-container--has-clear-button`]: hasClearButton,\n [`${rootClassName}__input-container--readonly`]: inputProps.readOnly && !inputProps.disabled,\n [`${rootClassName}__input-container--negative`]: negative,\n });\n\n return (\n <div className={cx(className, rootClassName)}>\n {label && (\n <Label\n htmlFor={inputId}\n className={cx(`${rootClassName}__label`)}\n data-testid={getTestId(\"label\")}\n disabled={inputProps.disabled}\n negative={negative}\n >\n {inputProps.required && !hideRequiredAsterisk && <span aria-hidden>*</span>}\n {label}\n </Label>\n )}\n <div className={cx(`${rootClassName}__field-row`)}>\n {!!beforeField && beforeField}\n <div ref={_inputContainerRef} className={inputContainerClassnames}>\n {!!startAdornments.length && (\n <div\n data-testid={getTestId(\"start-adornments\")}\n className={cx(`${rootClassName}__adornment-container`)}\n >\n {startAdornments}\n </div>\n )}\n <input\n {...inputProps}\n id={inputId}\n ref={setRef}\n data-testid={getTestId(\"input\")}\n aria-describedby={inputProps[\"aria-describedby\"] || helperTextId}\n aria-invalid={inputProps[\"aria-invalid\"] || !!errorText}\n className={cx([\n `${rootClassName}__input`,\n {\n [`${rootClassName}__input--valid`]: isValid,\n [`${rootClassName}__input--error`]: !!errorText,\n [`${rootClassName}__input--negative`]: negative,\n ...(_inputModifiers ?? {}),\n },\n ])}\n />\n <div\n className={cx(`${rootClassName}__frame`, {\n [`${rootClassName}__frame--negative`]: negative,\n ...(_frameModifiers ?? {}),\n })}\n />\n {(!!localEndAdornments.length || endAdornment) && (\n <div\n data-testid={getTestId(\"end-adornments\")}\n className={cx(`${rootClassName}__adornment-container`)}\n >\n {localEndAdornments}\n {endAdornment}\n </div>\n )}\n </div>\n {!!afterField && afterField}\n </div>\n {helperTextId && (\n <FieldHelperText\n data-testid={getTestId(\"helper-text\")}\n id={helperTextId}\n negative={negative}\n disabled={inputProps.disabled}\n >\n {helperText}\n </FieldHelperText>\n )}\n {errorText && (\n <FieldErrorText data-testid={getTestId(\"error-text\")} negative={negative}>\n {errorText}\n </FieldErrorText>\n )}\n </div>\n );\n }\n);\n\nTextFieldBase.displayName = \"TextField\";\n","import React, { forwardRef, type ReactNode, useCallback, useEffect, useRef, useState } from \"react\";\nimport { IconEditAi } from \"@purpur/icon/edit-ai\";\nimport c from \"classnames/bind\";\n\nimport type { TextFieldAiInternalProps } from \"./text-field\";\nimport aiStyles from \"./text-field-ai.module.scss\";\nimport { TextFieldBase } from \"./text-field-base\";\n\nconst cx = c.bind(aiStyles);\nconst rootClassName = \"purpur-text-field-ai\";\nconst defaultTypingAnimationDurationMs = 1400;\n\nconst hasInputValue = (value: unknown) => {\n if (typeof value === \"number\") {\n return !Number.isNaN(value);\n }\n\n if (typeof value === \"string\") {\n return value.length > 0;\n }\n\n if (Array.isArray(value)) {\n return value.length > 0;\n }\n\n return value !== undefined && value !== null;\n};\n\nexport const TextFieldAiInternal = forwardRef<HTMLInputElement, TextFieldAiInternalProps>(\n (\n {\n [\"data-testid\"]: dataTestId,\n animatePrepopulatedValue = false,\n typingAnimationDurationMs = defaultTypingAnimationDurationMs,\n endAdornment,\n value: controlledValue,\n defaultValue,\n onChange,\n disabled,\n readOnly,\n valid = false,\n negative = false,\n ...baseProps\n },\n ref\n ) => {\n const getTestId = (name: string) => (dataTestId ? `${dataTestId}-${name}` : undefined);\n const isControlled = controlledValue !== undefined;\n const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);\n const [hasUserEditedValue, setHasUserEditedValue] = useState(false);\n const [shouldAnimatePrepopulatedValue, setShouldAnimatePrepopulatedValue] = useState(false);\n const [hasAnimatedPrepopulatedValue, setHasAnimatedPrepopulatedValue] = useState(false);\n const [animatedTypingValue, setAnimatedTypingValue] = useState<string | null>(null);\n const typingAnimationTimerRef = useRef<number | null>(null);\n const inputContainerRef = useRef<HTMLDivElement | null>(null);\n\n const value = isControlled ? controlledValue : uncontrolledValue;\n const hasValue = hasInputValue(value);\n const isAiPresentationActive = hasValue && !hasUserEditedValue;\n const isTypingAnimationRunning = animatedTypingValue !== null;\n const displayValue = isTypingAnimationRunning ? animatedTypingValue : value ?? \"\";\n const shouldAnimatePrepopulated =\n isAiPresentationActive &&\n animatePrepopulatedValue &&\n !hasAnimatedPrepopulatedValue &&\n !disabled &&\n !readOnly;\n\n const clearTypingAnimation = useCallback(() => {\n if (typingAnimationTimerRef.current !== null) {\n window.clearInterval(typingAnimationTimerRef.current);\n typingAnimationTimerRef.current = null;\n }\n }, []);\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n clearTypingAnimation();\n setAnimatedTypingValue(null);\n\n if (!isControlled) {\n setUncontrolledValue(event.currentTarget.value);\n }\n\n setHasUserEditedValue(true);\n onChange?.(event);\n };\n\n useEffect(() => {\n if (!shouldAnimatePrepopulated || typeof IntersectionObserver === \"undefined\") {\n return;\n }\n\n const node = inputContainerRef.current;\n\n if (!node) {\n return;\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n const isVisible = entries.some((entry) => entry.isIntersecting);\n\n if (isVisible) {\n setShouldAnimatePrepopulatedValue(true);\n setHasAnimatedPrepopulatedValue(true);\n observer.disconnect();\n }\n },\n { threshold: 0.35 }\n );\n\n observer.observe(node);\n\n return () => observer.disconnect();\n }, [shouldAnimatePrepopulated]);\n\n useEffect(() => {\n if (!shouldAnimatePrepopulatedValue || hasUserEditedValue || typeof value !== \"string\") {\n return;\n }\n\n const shouldReduceMotion = window.matchMedia?.(\"(prefers-reduced-motion: reduce)\")?.matches;\n\n if (shouldReduceMotion || value.length === 0) {\n setShouldAnimatePrepopulatedValue(false);\n return;\n }\n\n clearTypingAnimation();\n setAnimatedTypingValue(\"\");\n\n let index = 0;\n const safeAnimationDuration =\n Number.isFinite(typingAnimationDurationMs) && typingAnimationDurationMs > 0\n ? typingAnimationDurationMs\n : defaultTypingAnimationDurationMs;\n const intervalDuration = Math.max(20, Math.floor(safeAnimationDuration / value.length));\n\n typingAnimationTimerRef.current = window.setInterval(() => {\n index += 1;\n setAnimatedTypingValue(value.slice(0, index));\n\n if (index >= value.length) {\n clearTypingAnimation();\n setAnimatedTypingValue(null);\n setShouldAnimatePrepopulatedValue(false);\n }\n }, intervalDuration);\n\n return clearTypingAnimation;\n }, [\n clearTypingAnimation,\n hasUserEditedValue,\n shouldAnimatePrepopulatedValue,\n typingAnimationDurationMs,\n value,\n ]);\n\n useEffect(() => clearTypingAnimation, [clearTypingAnimation]);\n\n const aiEndAdornments: ReactNode[] = [];\n\n if (endAdornment === undefined && isAiPresentationActive) {\n aiEndAdornments.push(\n <IconEditAi\n key=\"ai-icon\"\n size=\"xs\"\n data-testid={getTestId(\"edit-ai-icon\")}\n className={cx(`${rootClassName}__ai-icon`, {\n [`${rootClassName}__ai-icon--negative`]: negative,\n })}\n />\n );\n }\n\n return (\n <TextFieldBase\n ref={ref}\n data-testid={dataTestId}\n {...baseProps}\n endAdornment={endAdornment}\n value={displayValue}\n onChange={handleInputChange}\n disabled={disabled}\n readOnly={readOnly}\n valid={valid}\n negative={negative}\n _styles={aiStyles}\n _rootClassName={rootClassName}\n _prependEndAdornments={aiEndAdornments}\n _inputModifiers={{ [`${rootClassName}__input--ai`]: isAiPresentationActive }}\n _frameModifiers={{ [`${rootClassName}__frame--ai`]: isAiPresentationActive }}\n _inputContainerRef={inputContainerRef}\n />\n );\n }\n);\n\nTextFieldAiInternal.displayName = \"TextField\";\n","import React, {\n forwardRef,\n type HTMLInputTypeAttribute,\n isValidElement,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\n\nimport { TextFieldAiInternal } from \"./text-field-ai\";\nimport { TextFieldBase } from \"./text-field-base\";\n\nexport const textFieldVariants = [\"default\", \"ai\"] as const;\nexport type TextFieldVariant = (typeof textFieldVariants)[number];\n\ntype TextFieldCommonProps = {\n /**\n * Use to display e.g. a button before the text field.\n *\n * _NOTE: Should ideally only be used by other purpur components!_\n */\n beforeField?: ReactNode;\n /**\n * Use to display e.g. a button after the text field.\n *\n * _NOTE: Should ideally only be used by other purpur components!_\n */\n afterField?: ReactNode;\n /**\n * Use to display e.g. an icon at the end inside of the text field.\n *\n * _NOTE: Should ideally only be used by other purpur components!_\n */\n endAdornment?: ReactNode;\n /**\n * Use to render error message below the text field. The text field renders with error appearance.\n * */\n errorText?: string;\n /**\n * Use to give context about the field's input. Renders below the field.\n * */\n helperText?: string;\n /**\n * The label of the text field.\n * */\n label?: string;\n /**\n * Use to render a spinner at the end inside of the text field.\n */\n loading?: boolean;\n /**\n * Hide the asterisk for required fields.\n * This is useful when the field is required but the context already indicates that.\n */\n hideRequiredAsterisk?: boolean;\n /**\n * Use to display e.g. an icon at the start inside of the text field.\n *\n * _NOTE: Should ideally only be used by other purpur components!_\n */\n startAdornment?: ReactNode;\n /**\n * Use to set the type of the field.\n */\n type?: Extract<\n HTMLInputTypeAttribute,\n \"email\" | \"number\" | \"password\" | \"search\" | \"tel\" | \"text\"\n >;\n /**\n * Use to render text field with valid appearance. A check\n * icon will render at the start inside of the input.\n */\n valid?: boolean;\n negative?: boolean;\n};\n\ntype TextFieldClearProps =\n | {\n /**\n * An accessible label for the clear button.\n * */\n clearButtonAriaLabel: string;\n /**\n * Event handler called when the clear button is clicked.\n * */\n onClear: () => void;\n }\n | {\n /**\n * An accessible label for the clear button.\n * */\n clearButtonAriaLabel?: never;\n /**\n * Event handler called when the clear button is clicked.\n * */\n onClear?: never;\n };\n\ntype TextFieldAiProps = {\n /**\n * Animate prepopulated value once when the field scrolls into view.\n */\n animatePrepopulatedValue?: boolean;\n /**\n * Duration in milliseconds for the prepopulated typing animation.\n */\n typingAnimationDurationMs?: number;\n};\n\nexport type TextFieldBaseProps = Omit<BaseProps<\"input\">, \"type\"> &\n TextFieldCommonProps &\n TextFieldClearProps;\n\nexport type TextFieldAiInternalProps = Omit<BaseProps<\"input\">, \"type\"> &\n TextFieldCommonProps &\n TextFieldClearProps &\n TextFieldAiProps;\n\nexport type TextFieldProps = Omit<BaseProps<\"input\">, \"type\"> &\n TextFieldCommonProps &\n TextFieldClearProps &\n TextFieldAiProps & {\n /**\n * Use to select the text field variant.\n * - `\"default\"` renders a standard text field.\n * - `\"ai\"` renders a text field with AI presentation (gradient border, AI icon, typing animation).\n * @default \"default\"\n */\n variant?: TextFieldVariant;\n };\n\nexport const TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n ({ variant = \"default\", ...props }, ref) => {\n if (variant === \"ai\") {\n return <TextFieldAiInternal ref={ref} {...props} />;\n }\n\n return <TextFieldBase ref={ref} {...props} />;\n }\n);\n\nTextField.displayName = \"TextField\";\n\nexport const isTextField = (child?: ReactNode): child is ReactElement<TextFieldProps> =>\n isValidElement<TextFieldProps>(child) &&\n (child.type as any).displayName === TextField.displayName; // eslint-disable-line @typescript-eslint/no-explicit-any\n"],"names":["t","l","a","i","o","useMutableRefObject","value","useRef","defaultRootClassName","TextFieldBase","forwardRef","dataTestId","className","clearButtonAriaLabel","beforeField","afterField","endAdornment","errorText","helperText","hideRequiredAsterisk","label","loading","onClear","startAdornment","valid","negative","_styles","_rootClassName","_prependEndAdornments","_inputModifiers","_frameModifiers","_inputContainerRef","inputProps","ref","cx","c","defaultStyles","rootClassName","randomId","useId","inputId","getTestId","name","isValid","helperTextId","startAdornments","adornment","hasClearButton","internalRef","setRef","node","handleClear","localEndAdornments","jsx","Spinner","Button","IconClose","IconCheckCircleFilled","inputContainerClassnames","jsxs","Label","FieldHelperText","FieldErrorText","aiStyles","defaultTypingAnimationDurationMs","hasInputValue","TextFieldAiInternal","animatePrepopulatedValue","typingAnimationDurationMs","controlledValue","defaultValue","onChange","disabled","readOnly","baseProps","isControlled","uncontrolledValue","setUncontrolledValue","useState","hasUserEditedValue","setHasUserEditedValue","shouldAnimatePrepopulatedValue","setShouldAnimatePrepopulatedValue","hasAnimatedPrepopulatedValue","setHasAnimatedPrepopulatedValue","animatedTypingValue","setAnimatedTypingValue","typingAnimationTimerRef","inputContainerRef","isAiPresentationActive","displayValue","shouldAnimatePrepopulated","clearTypingAnimation","useCallback","handleInputChange","event","useEffect","observer","entries","entry","index","safeAnimationDuration","intervalDuration","aiEndAdornments","IconEditAi","textFieldVariants","TextField","variant","props","isTextField","child","isValidElement"],"mappings":";;;;;;;;;;;AAEA,MAAMA,KAAI;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL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,GAAW,GAAG2E,EAAA,CAAO;AAE/C;AAEAF,EAAU,cAAc;AAEjB,MAAMG,KAAc,CAACC,MAC1BC,GAA+BD,CAAK,KACnCA,EAAM,KAAa,gBAAgBJ,EAAU;"}
1
+ {"version":3,"file":"text-field-BQfxJobW.mjs","sources":["../../../components/icon/dist/components/edit-ai.es.js","../../../components/text-field/src/utils.ts","../../../components/text-field/src/text-field-base.tsx","../../../components/text-field/src/text-field-ai.tsx","../../../components/text-field/src/text-field.tsx"],"sourcesContent":["import { jsx as i } from \"react/jsx-runtime\";\nimport { I as o } from \"../icon-DNHpBTHs.mjs\";\nconst t = {\n name: \"edit-ai\",\n svg: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M18.175 22.5c.464-.002.856-.304.978-.755.41-1.533 1.255-2.463 2.655-2.926a1.02 1.02 0 0 0 .015-1.93c-1.437-.508-2.283-1.434-2.664-2.919a1.017 1.017 0 0 0-.974-.766c-.445.02-.865.305-.986.747-.422 1.518-1.267 2.447-2.661 2.923a1.02 1.02 0 0 0-.686.969c0 .436.278.824.686.961 1.4.479 2.243 1.414 2.657 2.946.12.442.523.75.978.75h.002Zm-1.788-4.66a5.334 5.334 0 0 0 1.78-1.867 5.323 5.323 0 0 0 1.792 1.87 5.256 5.256 0 0 0-1.787 1.88 5.326 5.326 0 0 0-1.785-1.883Zm4.668-12.884L18.19 2.091a1.9 1.9 0 0 0-2.687 0l-11.37 11.37a.9.9 0 0 0-.212.335L1.556 20.44a.9.9 0 0 0 1.15 1.15l6.644-2.365a.9.9 0 0 0 .335-.212l11.37-11.37a1.9 1.9 0 0 0 0-2.687ZM3.888 19.26l1.253-3.518 2.264 2.264-3.517 1.254ZM19.781 6.37 9.048 17.104 6.04 14.098l8.16-8.16 1.504 1.503a.9.9 0 1 0 1.273-1.273l-1.504-1.503 1.302-1.3a.1.1 0 0 1 .14 0l2.865 2.864a.1.1 0 0 1 0 .141Z\"/></svg>',\n keywords: [\"edit-ai\"],\n category: \"ai\"\n}, l = (a) => /* @__PURE__ */ i(o, { ...a, svg: t });\nl.displayName = \"IconEditAi\";\nexport {\n l as IconEditAi\n};\n//# sourceMappingURL=edit-ai.es.js.map\n","import { type MutableRefObject, useRef } from \"react\";\n\nexport const useMutableRefObject = <T>(value: T): MutableRefObject<T> => {\n return useRef<T>(value) as MutableRefObject<T>;\n};\n","import React, { forwardRef, type ReactNode, useId } from \"react\";\nimport { Button } from \"@purpur/button\";\nimport { FieldErrorText } from \"@purpur/field-error-text\";\nimport { FieldHelperText } from \"@purpur/field-helper-text\";\nimport { IconCheckCircleFilled } from \"@purpur/icon/check-circle-filled\";\nimport { IconClose } from \"@purpur/icon/close\";\nimport { Label } from \"@purpur/label\";\nimport { Spinner } from \"@purpur/spinner\";\nimport c from \"classnames/bind\";\n\nimport type { TextFieldBaseProps } from \"./text-field\";\nimport defaultStyles from \"./text-field.module.scss\";\nimport { useMutableRefObject } from \"./utils\";\n\nconst defaultRootClassName = \"purpur-text-field-default\";\n\n// Internal overrides for variant composition (not part of the public API)\nexport type TextFieldBaseInternalOverrides = {\n _styles?: Record<string, string>;\n _rootClassName?: string;\n _prependEndAdornments?: ReactNode[];\n _inputModifiers?: Record<string, boolean>;\n _frameModifiers?: Record<string, boolean>;\n _inputContainerRef?: React.Ref<HTMLDivElement>;\n};\n\nexport const TextFieldBase = forwardRef<\n HTMLInputElement,\n TextFieldBaseProps & TextFieldBaseInternalOverrides\n>(\n (\n {\n [\"data-testid\"]: dataTestId,\n className,\n clearButtonAriaLabel,\n beforeField,\n afterField,\n endAdornment,\n errorText,\n helperText,\n hideRequiredAsterisk = false,\n label,\n loading = false,\n onClear,\n startAdornment,\n valid = false,\n negative = false,\n _styles,\n _rootClassName,\n _prependEndAdornments,\n _inputModifiers,\n _frameModifiers,\n _inputContainerRef,\n ...inputProps\n },\n ref\n ) => {\n const cx = c.bind(_styles ?? defaultStyles);\n const rootClassName = _rootClassName ?? defaultRootClassName;\n const randomId = useId();\n const inputId = inputProps.id ?? randomId;\n const getTestId = (name: string) => (dataTestId ? `${dataTestId}-${name}` : undefined);\n const isValid = valid && !errorText;\n const helperTextId = helperText ? `${inputId}-helper-text` : undefined;\n const startAdornments: ReactNode[] = [startAdornment].filter((adornment) => !!adornment);\n const hasValue =\n typeof inputProps.value === \"number\"\n ? inputProps.value !== undefined\n : inputProps.value?.length;\n const hasClearButton =\n hasValue &&\n !inputProps.disabled &&\n !inputProps.readOnly &&\n !loading &&\n onClear &&\n clearButtonAriaLabel;\n\n const internalRef = useMutableRefObject<HTMLInputElement | null>(null);\n const setRef = (node: HTMLInputElement | null) => {\n internalRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n };\n const handleClear = () => {\n onClear?.();\n internalRef.current?.focus();\n };\n\n const localEndAdornments: ReactNode[] = [\n ...(_prependEndAdornments ?? []),\n loading && (\n <Spinner\n key=\"spinner\"\n disabled={inputProps.disabled}\n size=\"xs\"\n data-testid={getTestId(\"spinner\")}\n negative={negative}\n />\n ),\n hasClearButton && (\n <Button\n negative={negative}\n key=\"clear-button\"\n variant=\"tertiary-purple\"\n onClick={handleClear}\n iconOnly\n aria-label={clearButtonAriaLabel ?? \"\"}\n data-testid={getTestId(\"clear-button\")}\n tabIndex={-1}\n >\n <IconClose size=\"xs\" />\n </Button>\n ),\n isValid && (\n <IconCheckCircleFilled\n key=\"valid-icon\"\n data-testid={getTestId(\"valid-icon\")}\n className={cx(`${rootClassName}__valid-icon`, {\n [`${rootClassName}__valid-icon--negative`]: negative,\n })}\n />\n ),\n ].filter((adornment) => !!adornment);\n\n const inputContainerClassnames = cx(`${rootClassName}__input-container`, {\n [`${rootClassName}__input-container--start-adornment`]: startAdornments.length,\n [`${rootClassName}__input-container--end-adornment`]:\n localEndAdornments.length || endAdornment,\n [`${rootClassName}__input-container--disabled`]: inputProps.disabled,\n [`${rootClassName}__input-container--has-clear-button`]: hasClearButton,\n [`${rootClassName}__input-container--readonly`]: inputProps.readOnly && !inputProps.disabled,\n [`${rootClassName}__input-container--negative`]: negative,\n });\n\n return (\n <div className={cx(className, rootClassName)}>\n {label && (\n <Label\n htmlFor={inputId}\n className={cx(`${rootClassName}__label`)}\n data-testid={getTestId(\"label\")}\n disabled={inputProps.disabled}\n negative={negative}\n >\n {inputProps.required && !hideRequiredAsterisk && <span aria-hidden>*</span>}\n {label}\n </Label>\n )}\n <div className={cx(`${rootClassName}__field-row`)}>\n {!!beforeField && beforeField}\n <div ref={_inputContainerRef} className={inputContainerClassnames}>\n {!!startAdornments.length && (\n <div\n data-testid={getTestId(\"start-adornments\")}\n className={cx(`${rootClassName}__adornment-container`)}\n >\n {startAdornments}\n </div>\n )}\n <input\n {...inputProps}\n id={inputId}\n ref={setRef}\n data-testid={getTestId(\"input\")}\n aria-describedby={inputProps[\"aria-describedby\"] || helperTextId}\n aria-invalid={inputProps[\"aria-invalid\"] || !!errorText}\n className={cx([\n `${rootClassName}__input`,\n {\n [`${rootClassName}__input--valid`]: isValid,\n [`${rootClassName}__input--error`]: !!errorText,\n [`${rootClassName}__input--negative`]: negative,\n ...(_inputModifiers ?? {}),\n },\n ])}\n />\n <div\n className={cx(`${rootClassName}__frame`, {\n [`${rootClassName}__frame--negative`]: negative,\n ...(_frameModifiers ?? {}),\n })}\n />\n {(!!localEndAdornments.length || endAdornment) && (\n <div\n data-testid={getTestId(\"end-adornments\")}\n className={cx(`${rootClassName}__adornment-container`)}\n >\n {localEndAdornments}\n {endAdornment}\n </div>\n )}\n </div>\n {!!afterField && afterField}\n </div>\n {helperTextId && (\n <FieldHelperText\n data-testid={getTestId(\"helper-text\")}\n id={helperTextId}\n negative={negative}\n disabled={inputProps.disabled}\n >\n {helperText}\n </FieldHelperText>\n )}\n {errorText && (\n <FieldErrorText data-testid={getTestId(\"error-text\")} negative={negative}>\n {errorText}\n </FieldErrorText>\n )}\n </div>\n );\n }\n);\n\nTextFieldBase.displayName = \"TextField\";\n","import React, { forwardRef, type ReactNode, useCallback, useEffect, useRef, useState } from \"react\";\nimport { IconEditAi } from \"@purpur/icon/edit-ai\";\nimport c from \"classnames/bind\";\n\nimport type { TextFieldAiInternalProps } from \"./text-field\";\nimport aiStyles from \"./text-field-ai.module.scss\";\nimport { TextFieldBase } from \"./text-field-base\";\n\nconst cx = c.bind(aiStyles);\nconst rootClassName = \"purpur-text-field-ai\";\nconst defaultTypingAnimationDurationMs = 1400;\n\nconst hasInputValue = (value: unknown) => {\n if (typeof value === \"number\") {\n return !Number.isNaN(value);\n }\n\n if (typeof value === \"string\") {\n return value.length > 0;\n }\n\n if (Array.isArray(value)) {\n return value.length > 0;\n }\n\n return value !== undefined && value !== null;\n};\n\nexport const TextFieldAiInternal = forwardRef<HTMLInputElement, TextFieldAiInternalProps>(\n (\n {\n [\"data-testid\"]: dataTestId,\n animatePrepopulatedValue = false,\n typingAnimationDurationMs = defaultTypingAnimationDurationMs,\n endAdornment,\n value: controlledValue,\n defaultValue,\n onChange,\n disabled,\n readOnly,\n valid = false,\n negative = false,\n ...baseProps\n },\n ref\n ) => {\n const getTestId = (name: string) => (dataTestId ? `${dataTestId}-${name}` : undefined);\n const isControlled = controlledValue !== undefined;\n const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);\n const [hasUserEditedValue, setHasUserEditedValue] = useState(false);\n const [shouldAnimatePrepopulatedValue, setShouldAnimatePrepopulatedValue] = useState(false);\n const [hasAnimatedPrepopulatedValue, setHasAnimatedPrepopulatedValue] = useState(false);\n const [animatedTypingValue, setAnimatedTypingValue] = useState<string | null>(null);\n const typingAnimationTimerRef = useRef<number | null>(null);\n const inputContainerRef = useRef<HTMLDivElement | null>(null);\n\n const value = isControlled ? controlledValue : uncontrolledValue;\n const hasValue = hasInputValue(value);\n const isAiPresentationActive = hasValue && !hasUserEditedValue;\n const isTypingAnimationRunning = animatedTypingValue !== null;\n const displayValue = isTypingAnimationRunning ? animatedTypingValue : value ?? \"\";\n const shouldAnimatePrepopulated =\n isAiPresentationActive &&\n animatePrepopulatedValue &&\n !hasAnimatedPrepopulatedValue &&\n !disabled &&\n !readOnly;\n\n const clearTypingAnimation = useCallback(() => {\n if (typingAnimationTimerRef.current !== null) {\n window.clearInterval(typingAnimationTimerRef.current);\n typingAnimationTimerRef.current = null;\n }\n }, []);\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n clearTypingAnimation();\n setAnimatedTypingValue(null);\n\n if (!isControlled) {\n setUncontrolledValue(event.currentTarget.value);\n }\n\n setHasUserEditedValue(true);\n onChange?.(event);\n };\n\n useEffect(() => {\n if (!shouldAnimatePrepopulated || typeof IntersectionObserver === \"undefined\") {\n return;\n }\n\n const node = inputContainerRef.current;\n\n if (!node) {\n return;\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n const isVisible = entries.some((entry) => entry.isIntersecting);\n\n if (isVisible) {\n setShouldAnimatePrepopulatedValue(true);\n setHasAnimatedPrepopulatedValue(true);\n observer.disconnect();\n }\n },\n { threshold: 0.35 }\n );\n\n observer.observe(node);\n\n return () => observer.disconnect();\n }, [shouldAnimatePrepopulated]);\n\n useEffect(() => {\n if (!shouldAnimatePrepopulatedValue || hasUserEditedValue || typeof value !== \"string\") {\n return;\n }\n\n const shouldReduceMotion = window.matchMedia?.(\"(prefers-reduced-motion: reduce)\")?.matches;\n\n if (shouldReduceMotion || value.length === 0) {\n setShouldAnimatePrepopulatedValue(false);\n return;\n }\n\n clearTypingAnimation();\n setAnimatedTypingValue(\"\");\n\n let index = 0;\n const safeAnimationDuration =\n Number.isFinite(typingAnimationDurationMs) && typingAnimationDurationMs > 0\n ? typingAnimationDurationMs\n : defaultTypingAnimationDurationMs;\n const intervalDuration = Math.max(20, Math.floor(safeAnimationDuration / value.length));\n\n typingAnimationTimerRef.current = window.setInterval(() => {\n index += 1;\n setAnimatedTypingValue(value.slice(0, index));\n\n if (index >= value.length) {\n clearTypingAnimation();\n setAnimatedTypingValue(null);\n setShouldAnimatePrepopulatedValue(false);\n }\n }, intervalDuration);\n\n return clearTypingAnimation;\n }, [\n clearTypingAnimation,\n hasUserEditedValue,\n shouldAnimatePrepopulatedValue,\n typingAnimationDurationMs,\n value,\n ]);\n\n useEffect(() => clearTypingAnimation, [clearTypingAnimation]);\n\n const aiEndAdornments: ReactNode[] = [];\n\n if (endAdornment === undefined && isAiPresentationActive) {\n aiEndAdornments.push(\n <IconEditAi\n key=\"ai-icon\"\n size=\"xs\"\n data-testid={getTestId(\"edit-ai-icon\")}\n className={cx(`${rootClassName}__ai-icon`, {\n [`${rootClassName}__ai-icon--negative`]: negative,\n })}\n />\n );\n }\n\n return (\n <TextFieldBase\n ref={ref}\n data-testid={dataTestId}\n {...baseProps}\n endAdornment={endAdornment}\n value={displayValue}\n onChange={handleInputChange}\n disabled={disabled}\n readOnly={readOnly}\n valid={valid}\n negative={negative}\n _styles={aiStyles}\n _rootClassName={rootClassName}\n _prependEndAdornments={aiEndAdornments}\n _inputModifiers={{ [`${rootClassName}__input--ai`]: isAiPresentationActive }}\n _frameModifiers={{ [`${rootClassName}__frame--ai`]: isAiPresentationActive }}\n _inputContainerRef={inputContainerRef}\n />\n );\n }\n);\n\nTextFieldAiInternal.displayName = \"TextField\";\n","import React, {\n forwardRef,\n type HTMLInputTypeAttribute,\n isValidElement,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\n\nimport { TextFieldAiInternal } from \"./text-field-ai\";\nimport { TextFieldBase } from \"./text-field-base\";\n\nexport const textFieldVariants = [\"default\", \"ai\"] as const;\nexport type TextFieldVariant = (typeof textFieldVariants)[number];\n\ntype TextFieldCommonProps = {\n /**\n * Use to display e.g. a button before the text field.\n *\n * _NOTE: Should ideally only be used by other purpur components!_\n */\n beforeField?: ReactNode;\n /**\n * Use to display e.g. a button after the text field.\n *\n * _NOTE: Should ideally only be used by other purpur components!_\n */\n afterField?: ReactNode;\n /**\n * Use to display e.g. an icon at the end inside of the text field.\n *\n * _NOTE: Should ideally only be used by other purpur components!_\n */\n endAdornment?: ReactNode;\n /**\n * Use to render error message below the text field. The text field renders with error appearance.\n * */\n errorText?: string;\n /**\n * Use to give context about the field's input. Renders below the field.\n * */\n helperText?: string;\n /**\n * The label of the text field.\n * */\n label?: string;\n /**\n * Use to render a spinner at the end inside of the text field.\n */\n loading?: boolean;\n /**\n * Hide the asterisk for required fields.\n * This is useful when the field is required but the context already indicates that.\n */\n hideRequiredAsterisk?: boolean;\n /**\n * Use to display e.g. an icon at the start inside of the text field.\n *\n * _NOTE: Should ideally only be used by other purpur components!_\n */\n startAdornment?: ReactNode;\n /**\n * Use to set the type of the field.\n */\n type?: Extract<\n HTMLInputTypeAttribute,\n \"email\" | \"number\" | \"password\" | \"search\" | \"tel\" | \"text\"\n >;\n /**\n * Use to render text field with valid appearance. A check\n * icon will render at the start inside of the input.\n */\n valid?: boolean;\n negative?: boolean;\n};\n\ntype TextFieldClearProps =\n | {\n /**\n * An accessible label for the clear button.\n * */\n clearButtonAriaLabel: string;\n /**\n * Event handler called when the clear button is clicked.\n * */\n onClear: () => void;\n }\n | {\n /**\n * An accessible label for the clear button.\n * */\n clearButtonAriaLabel?: never;\n /**\n * Event handler called when the clear button is clicked.\n * */\n onClear?: never;\n };\n\ntype TextFieldAiProps = {\n /**\n * Animate prepopulated value once when the field scrolls into view.\n */\n animatePrepopulatedValue?: boolean;\n /**\n * Duration in milliseconds for the prepopulated typing animation.\n */\n typingAnimationDurationMs?: number;\n};\n\nexport type TextFieldBaseProps = Omit<BaseProps<\"input\">, \"type\"> &\n TextFieldCommonProps &\n TextFieldClearProps;\n\nexport type TextFieldAiInternalProps = Omit<BaseProps<\"input\">, \"type\"> &\n TextFieldCommonProps &\n TextFieldClearProps &\n TextFieldAiProps;\n\nexport type TextFieldProps = Omit<BaseProps<\"input\">, \"type\"> &\n TextFieldCommonProps &\n TextFieldClearProps &\n TextFieldAiProps & {\n /**\n * Use to select the text field variant.\n * - `\"default\"` renders a standard text field.\n * - `\"ai\"` renders a text field with AI presentation (gradient border, AI icon, typing animation).\n * @default \"default\"\n */\n variant?: TextFieldVariant;\n };\n\nexport const TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n ({ variant = \"default\", ...props }, ref) => {\n if (variant === \"ai\") {\n return <TextFieldAiInternal ref={ref} {...props} />;\n }\n\n return <TextFieldBase ref={ref} {...props} />;\n }\n);\n\nTextField.displayName = \"TextField\";\n\nexport const isTextField = (child?: ReactNode): child is ReactElement<TextFieldProps> =>\n isValidElement<TextFieldProps>(child) &&\n (child.type as any).displayName === TextField.displayName; // eslint-disable-line @typescript-eslint/no-explicit-any\n"],"names":["t","l","a","i","o","useMutableRefObject","value","useRef","defaultRootClassName","TextFieldBase","forwardRef","dataTestId","className","clearButtonAriaLabel","beforeField","afterField","endAdornment","errorText","helperText","hideRequiredAsterisk","label","loading","onClear","startAdornment","valid","negative","_styles","_rootClassName","_prependEndAdornments","_inputModifiers","_frameModifiers","_inputContainerRef","inputProps","ref","cx","c","defaultStyles","rootClassName","randomId","useId","inputId","getTestId","name","isValid","helperTextId","startAdornments","adornment","hasClearButton","internalRef","setRef","node","handleClear","localEndAdornments","jsx","Spinner","Button","IconClose","IconCheckCircleFilled","inputContainerClassnames","jsxs","Label","FieldHelperText","FieldErrorText","aiStyles","defaultTypingAnimationDurationMs","hasInputValue","TextFieldAiInternal","animatePrepopulatedValue","typingAnimationDurationMs","controlledValue","defaultValue","onChange","disabled","readOnly","baseProps","isControlled","uncontrolledValue","setUncontrolledValue","useState","hasUserEditedValue","setHasUserEditedValue","shouldAnimatePrepopulatedValue","setShouldAnimatePrepopulatedValue","hasAnimatedPrepopulatedValue","setHasAnimatedPrepopulatedValue","animatedTypingValue","setAnimatedTypingValue","typingAnimationTimerRef","inputContainerRef","isAiPresentationActive","displayValue","shouldAnimatePrepopulated","clearTypingAnimation","useCallback","handleInputChange","event","useEffect","observer","entries","entry","index","safeAnimationDuration","intervalDuration","aiEndAdornments","IconEditAi","textFieldVariants","TextField","variant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tD,EAACa,GAAA,EAAoB,KAAAjC,GAAW,GAAG2E,EAAA,CAAO,IAG5C,gBAAAvD,EAAC5C,GAAA,EAAc,KAAAwB,GAAW,GAAG2E,EAAA,CAAO;AAE/C;AAEAF,EAAU,cAAc;AAEjB,MAAMG,KAAc,CAACC,MAC1BC,GAA+BD,CAAK,KACnCA,EAAM,KAAa,gBAAgBJ,EAAU;"}
@@ -1,2 +1,2 @@
1
- "use strict";const i=require("react/jsx-runtime"),n=require("react"),X=require("./icon-DNHpBTHs-faYHqTXU.js"),G=require("./bind-DeUYJ6m9.js"),Y=require("./button-Dqxdc3nC.js"),P=require("./field-error-text-FhQulSV5.js"),ee=require("./field-helper-text-DSKO-Tce.js"),te=require("./check-circle-filled.es-5-GXE9l4.js"),ie=require("./close.es-VL3lKi1O.js"),ae=require("./label-yHK80hhV.js"),re=require("./spinner-tKunS_o-.js"),ne={name:"edit-ai",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M18.175 22.5c.464-.002.856-.304.978-.755.41-1.533 1.255-2.463 2.655-2.926a1.02 1.02 0 0 0 .015-1.93c-1.437-.508-2.283-1.434-2.664-2.919a1.017 1.017 0 0 0-.974-.766c-.445.02-.865.305-.986.747-.422 1.518-1.267 2.447-2.661 2.923a1.02 1.02 0 0 0-.686.969c0 .436.278.824.686.961 1.4.479 2.243 1.414 2.657 2.946.12.442.523.75.978.75h.002Zm-1.788-4.66a5.334 5.334 0 0 0 1.78-1.867 5.323 5.323 0 0 0 1.792 1.87 5.256 5.256 0 0 0-1.787 1.88 5.326 5.326 0 0 0-1.785-1.883Zm4.668-12.884L18.19 2.091a1.9 1.9 0 0 0-2.687 0l-11.37 11.37a.9.9 0 0 0-.212.335L1.556 20.44a.9.9 0 0 0 1.15 1.15l6.644-2.365a.9.9 0 0 0 .335-.212l11.37-11.37a1.9 1.9 0 0 0 0-2.687ZM3.888 19.26l1.253-3.518 2.264 2.264-3.517 1.254ZM19.781 6.37 9.048 17.104 6.04 14.098l8.16-8.16 1.504 1.503a.9.9 0 1 0 1.273-1.273l-1.504-1.503 1.302-1.3a.1.1 0 0 1 .14 0l2.865 2.864a.1.1 0 0 1 0 .141Z"/></svg>',keywords:["edit-ai"],category:"ai"},J=t=>i.jsx(X.b,{...t,svg:ne});J.displayName="IconEditAi";const K={"purpur-text-field-ai":"_purpur-text-field-ai_xb5id_1","purpur-text-field-ai__label":"_purpur-text-field-ai__label_xb5id_7","purpur-text-field-ai__label-text":"_purpur-text-field-ai__label-text_xb5id_12","purpur-text-field-ai__field-row":"_purpur-text-field-ai__field-row_xb5id_15","purpur-text-field-ai__frame":"_purpur-text-field-ai__frame_xb5id_19","purpur-text-field-ai__frame--negative":"_purpur-text-field-ai__frame--negative_xb5id_26","purpur-text-field-ai__input-container":"_purpur-text-field-ai__input-container_xb5id_29","purpur-text-field-ai__input-container--disabled":"_purpur-text-field-ai__input-container--disabled_xb5id_40","purpur-text-field-ai__input-container--readonly":"_purpur-text-field-ai__input-container--readonly_xb5id_43","purpur-text-field-ai__input-container--has-clear-button":"_purpur-text-field-ai__input-container--has-clear-button_xb5id_46","purpur-text-field-ai__input-container--end-adornment":"_purpur-text-field-ai__input-container--end-adornment_xb5id_49","purpur-text-field-ai__input":"_purpur-text-field-ai__input_xb5id_29","purpur-text-field-ai__input-container--start-adornment":"_purpur-text-field-ai__input-container--start-adornment_xb5id_55","purpur-text-field-ai__input-container--negative":"_purpur-text-field-ai__input-container--negative_xb5id_61","purpur-text-field-ai__valid-icon":"_purpur-text-field-ai__valid-icon_xb5id_86","purpur-text-field-ai__valid-icon--negative":"_purpur-text-field-ai__valid-icon--negative_xb5id_89","purpur-text-field-ai__frame--ai":"_purpur-text-field-ai__frame--ai_xb5id_95","purpur-text-field-ai__ai-icon":"_purpur-text-field-ai__ai-icon_xb5id_112","purpur-text-field-ai__input--ai":"_purpur-text-field-ai__input--ai_xb5id_167","purpur-text-field-ai__input--valid":"_purpur-text-field-ai__input--valid_xb5id_179","purpur-text-field-ai__input--error":"_purpur-text-field-ai__input--error_xb5id_179","purpur-text-field-ai__input--negative":"_purpur-text-field-ai__input--negative_xb5id_227","purpur-text-field-ai__adornment-container":"_purpur-text-field-ai__adornment-container_xb5id_246","purpur-text-field-ai__ai-icon--negative":"_purpur-text-field-ai__ai-icon--negative_xb5id_256"},ue={"purpur-text-field-default":"_purpur-text-field-default_111s2_1","purpur-text-field-default__label":"_purpur-text-field-default__label_111s2_7","purpur-text-field-default__label-text":"_purpur-text-field-default__label-text_111s2_12","purpur-text-field-default__field-row":"_purpur-text-field-default__field-row_111s2_15","purpur-text-field-default__frame":"_purpur-text-field-default__frame_111s2_19","purpur-text-field-default__frame--negative":"_purpur-text-field-default__frame--negative_111s2_26","purpur-text-field-default__input-container":"_purpur-text-field-default__input-container_111s2_29","purpur-text-field-default__input-container--disabled":"_purpur-text-field-default__input-container--disabled_111s2_40","purpur-text-field-default__input-container--readonly":"_purpur-text-field-default__input-container--readonly_111s2_43","purpur-text-field-default__input-container--has-clear-button":"_purpur-text-field-default__input-container--has-clear-button_111s2_46","purpur-text-field-default__input-container--end-adornment":"_purpur-text-field-default__input-container--end-adornment_111s2_49","purpur-text-field-default__input":"_purpur-text-field-default__input_111s2_29","purpur-text-field-default__input-container--start-adornment":"_purpur-text-field-default__input-container--start-adornment_111s2_55","purpur-text-field-default__input-container--negative":"_purpur-text-field-default__input-container--negative_111s2_61","purpur-text-field-default__valid-icon":"_purpur-text-field-default__valid-icon_111s2_86","purpur-text-field-default__valid-icon--negative":"_purpur-text-field-default__valid-icon--negative_111s2_89","purpur-text-field-default__input--valid":"_purpur-text-field-default__input--valid_111s2_118","purpur-text-field-default__input--error":"_purpur-text-field-default__input--error_111s2_118","purpur-text-field-default__input--negative":"_purpur-text-field-default__input--negative_111s2_136","purpur-text-field-default__adornment-container":"_purpur-text-field-default__adornment-container_111s2_152"},le=t=>n.useRef(t),de="purpur-text-field-default",B=n.forwardRef(({["data-testid"]:t,className:x,clearButtonAriaLabel:s,beforeField:h,afterField:g,endAdornment:y,errorText:c,helperText:$,hideRequiredAsterisk:T=!1,label:C,loading:N=!1,onClear:A,startAdornment:E,valid:M=!1,negative:l=!1,_styles:S,_rootClassName:H,_prependEndAdornments:j,_inputModifiers:O,_frameModifiers:F,_inputContainerRef:w,...a},m)=>{const d=G.c.bind(S??ue),e=H??de,b=n.useId(),v=a.id??b,r=u=>t?`${t}-${u}`:void 0,Z=M&&!c,f=$?`${v}-helper-text`:void 0,I=[E].filter(u=>!!u),V=(typeof a.value=="number"?a.value!==void 0:a.value?.length)&&!a.disabled&&!a.readOnly&&!N&&A&&s,p=le(null),k=u=>{p.current=u,typeof m=="function"?m(u):m&&(m.current=u)},q=()=>{A?.(),p.current?.focus()},_=[...j??[],N&&i.jsx(re.Spinner,{disabled:a.disabled,size:"xs","data-testid":r("spinner"),negative:l},"spinner"),V&&i.jsx(Y.Button,{negative:l,variant:"tertiary-purple",onClick:q,iconOnly:!0,"aria-label":s??"","data-testid":r("clear-button"),tabIndex:-1,children:i.jsx(ie.r,{size:"xs"})},"clear-button"),Z&&i.jsx(te.r,{"data-testid":r("valid-icon"),className:d(`${e}__valid-icon`,{[`${e}__valid-icon--negative`]:l})},"valid-icon")].filter(u=>!!u),o=d(`${e}__input-container`,{[`${e}__input-container--start-adornment`]:I.length,[`${e}__input-container--end-adornment`]:_.length||y,[`${e}__input-container--disabled`]:a.disabled,[`${e}__input-container--has-clear-button`]:V,[`${e}__input-container--readonly`]:a.readOnly&&!a.disabled,[`${e}__input-container--negative`]:l});return i.jsxs("div",{className:d(x,e),children:[C&&i.jsxs(ae.Label,{htmlFor:v,className:d(`${e}__label`),"data-testid":r("label"),disabled:a.disabled,negative:l,children:[a.required&&!T&&i.jsx("span",{"aria-hidden":!0,children:"*"}),C]}),i.jsxs("div",{className:d(`${e}__field-row`),children:[!!h&&h,i.jsxs("div",{ref:w,className:o,children:[!!I.length&&i.jsx("div",{"data-testid":r("start-adornments"),className:d(`${e}__adornment-container`),children:I}),i.jsx("input",{...a,id:v,ref:k,"data-testid":r("input"),"aria-describedby":a["aria-describedby"]||f,"aria-invalid":a["aria-invalid"]||!!c,className:d([`${e}__input`,{[`${e}__input--valid`]:Z,[`${e}__input--error`]:!!c,[`${e}__input--negative`]:l,...O??{}}])}),i.jsx("div",{className:d(`${e}__frame`,{[`${e}__frame--negative`]:l,...F??{}})}),(!!_.length||y)&&i.jsxs("div",{"data-testid":r("end-adornments"),className:d(`${e}__adornment-container`),children:[_,y]})]}),!!g&&g]}),f&&i.jsx(ee.FieldHelperText,{"data-testid":r("helper-text"),id:f,negative:l,disabled:a.disabled,children:$}),c&&i.jsx(P.FieldErrorText,{"data-testid":r("error-text"),negative:l,children:c})]})});B.displayName="TextField";const _e=G.c.bind(K),R="purpur-text-field-ai",D=1400,se=t=>typeof t=="number"?!Number.isNaN(t):typeof t=="string"||Array.isArray(t)?t.length>0:t!=null,Q=n.forwardRef(({["data-testid"]:t,animatePrepopulatedValue:x=!1,typingAnimationDurationMs:s=D,endAdornment:h,value:g,defaultValue:y,onChange:c,disabled:$,readOnly:T,valid:C=!1,negative:N=!1,...A},E)=>{const M=_=>t?`${t}-${_}`:void 0,l=g!==void 0,[S,H]=n.useState(y),[j,O]=n.useState(!1),[F,w]=n.useState(!1),[a,m]=n.useState(!1),[d,e]=n.useState(null),b=n.useRef(null),v=n.useRef(null),r=l?g:S,f=se(r)&&!j,U=d!==null?d:r??"",V=f&&x&&!a&&!$&&!T,p=n.useCallback(()=>{b.current!==null&&(window.clearInterval(b.current),b.current=null)},[]),k=_=>{p(),e(null),l||H(_.currentTarget.value),O(!0),c?.(_)};n.useEffect(()=>{if(!V||typeof IntersectionObserver>"u")return;const _=v.current;if(!_)return;const o=new IntersectionObserver(u=>{u.some(W=>W.isIntersecting)&&(w(!0),m(!0),o.disconnect())},{threshold:.35});return o.observe(_),()=>o.disconnect()},[V]),n.useEffect(()=>{if(!F||j||typeof r!="string")return;if(window.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches||r.length===0){w(!1);return}p(),e("");let o=0;const u=Number.isFinite(s)&&s>0?s:D,L=Math.max(20,Math.floor(u/r.length));return b.current=window.setInterval(()=>{o+=1,e(r.slice(0,o)),o>=r.length&&(p(),e(null),w(!1))},L),p},[p,j,F,s,r]),n.useEffect(()=>p,[p]);const q=[];return h===void 0&&f&&q.push(i.jsx(J,{size:"xs","data-testid":M("edit-ai-icon"),className:_e(`${R}__ai-icon`,{[`${R}__ai-icon--negative`]:N})},"ai-icon")),i.jsx(B,{ref:E,"data-testid":t,...A,endAdornment:h,value:U,onChange:k,disabled:$,readOnly:T,valid:C,negative:N,_styles:K,_rootClassName:R,_prependEndAdornments:q,_inputModifiers:{[`${R}__input--ai`]:f},_frameModifiers:{[`${R}__frame--ai`]:f},_inputContainerRef:v})});Q.displayName="TextField";const pe=["default","ai"],z=n.forwardRef(({variant:t="default",...x},s)=>t==="ai"?i.jsx(Q,{ref:s,...x}):i.jsx(B,{ref:s,...x}));z.displayName="TextField";const oe=t=>n.isValidElement(t)&&t.type.displayName===z.displayName;exports.TextField=z;exports.isTextField=oe;exports.textFieldVariants=pe;
2
- //# sourceMappingURL=text-field-BwxGMWds.js.map
1
+ "use strict";const i=require("react/jsx-runtime"),n=require("react"),X=require("./icon-DNHpBTHs-faYHqTXU.js"),G=require("./bind-DeUYJ6m9.js"),Y=require("./button-DmybVApa.js"),P=require("./field-error-text-FhQulSV5.js"),ee=require("./field-helper-text-DSKO-Tce.js"),te=require("./check-circle-filled.es-5-GXE9l4.js"),ie=require("./close.es-VL3lKi1O.js"),ae=require("./label-yHK80hhV.js"),re=require("./spinner-tKunS_o-.js"),ne={name:"edit-ai",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M18.175 22.5c.464-.002.856-.304.978-.755.41-1.533 1.255-2.463 2.655-2.926a1.02 1.02 0 0 0 .015-1.93c-1.437-.508-2.283-1.434-2.664-2.919a1.017 1.017 0 0 0-.974-.766c-.445.02-.865.305-.986.747-.422 1.518-1.267 2.447-2.661 2.923a1.02 1.02 0 0 0-.686.969c0 .436.278.824.686.961 1.4.479 2.243 1.414 2.657 2.946.12.442.523.75.978.75h.002Zm-1.788-4.66a5.334 5.334 0 0 0 1.78-1.867 5.323 5.323 0 0 0 1.792 1.87 5.256 5.256 0 0 0-1.787 1.88 5.326 5.326 0 0 0-1.785-1.883Zm4.668-12.884L18.19 2.091a1.9 1.9 0 0 0-2.687 0l-11.37 11.37a.9.9 0 0 0-.212.335L1.556 20.44a.9.9 0 0 0 1.15 1.15l6.644-2.365a.9.9 0 0 0 .335-.212l11.37-11.37a1.9 1.9 0 0 0 0-2.687ZM3.888 19.26l1.253-3.518 2.264 2.264-3.517 1.254ZM19.781 6.37 9.048 17.104 6.04 14.098l8.16-8.16 1.504 1.503a.9.9 0 1 0 1.273-1.273l-1.504-1.503 1.302-1.3a.1.1 0 0 1 .14 0l2.865 2.864a.1.1 0 0 1 0 .141Z"/></svg>',keywords:["edit-ai"],category:"ai"},J=t=>i.jsx(X.b,{...t,svg:ne});J.displayName="IconEditAi";const K={"purpur-text-field-ai":"_purpur-text-field-ai_xb5id_1","purpur-text-field-ai__label":"_purpur-text-field-ai__label_xb5id_7","purpur-text-field-ai__label-text":"_purpur-text-field-ai__label-text_xb5id_12","purpur-text-field-ai__field-row":"_purpur-text-field-ai__field-row_xb5id_15","purpur-text-field-ai__frame":"_purpur-text-field-ai__frame_xb5id_19","purpur-text-field-ai__frame--negative":"_purpur-text-field-ai__frame--negative_xb5id_26","purpur-text-field-ai__input-container":"_purpur-text-field-ai__input-container_xb5id_29","purpur-text-field-ai__input-container--disabled":"_purpur-text-field-ai__input-container--disabled_xb5id_40","purpur-text-field-ai__input-container--readonly":"_purpur-text-field-ai__input-container--readonly_xb5id_43","purpur-text-field-ai__input-container--has-clear-button":"_purpur-text-field-ai__input-container--has-clear-button_xb5id_46","purpur-text-field-ai__input-container--end-adornment":"_purpur-text-field-ai__input-container--end-adornment_xb5id_49","purpur-text-field-ai__input":"_purpur-text-field-ai__input_xb5id_29","purpur-text-field-ai__input-container--start-adornment":"_purpur-text-field-ai__input-container--start-adornment_xb5id_55","purpur-text-field-ai__input-container--negative":"_purpur-text-field-ai__input-container--negative_xb5id_61","purpur-text-field-ai__valid-icon":"_purpur-text-field-ai__valid-icon_xb5id_86","purpur-text-field-ai__valid-icon--negative":"_purpur-text-field-ai__valid-icon--negative_xb5id_89","purpur-text-field-ai__frame--ai":"_purpur-text-field-ai__frame--ai_xb5id_95","purpur-text-field-ai__ai-icon":"_purpur-text-field-ai__ai-icon_xb5id_112","purpur-text-field-ai__input--ai":"_purpur-text-field-ai__input--ai_xb5id_167","purpur-text-field-ai__input--valid":"_purpur-text-field-ai__input--valid_xb5id_179","purpur-text-field-ai__input--error":"_purpur-text-field-ai__input--error_xb5id_179","purpur-text-field-ai__input--negative":"_purpur-text-field-ai__input--negative_xb5id_227","purpur-text-field-ai__adornment-container":"_purpur-text-field-ai__adornment-container_xb5id_246","purpur-text-field-ai__ai-icon--negative":"_purpur-text-field-ai__ai-icon--negative_xb5id_256"},ue={"purpur-text-field-default":"_purpur-text-field-default_111s2_1","purpur-text-field-default__label":"_purpur-text-field-default__label_111s2_7","purpur-text-field-default__label-text":"_purpur-text-field-default__label-text_111s2_12","purpur-text-field-default__field-row":"_purpur-text-field-default__field-row_111s2_15","purpur-text-field-default__frame":"_purpur-text-field-default__frame_111s2_19","purpur-text-field-default__frame--negative":"_purpur-text-field-default__frame--negative_111s2_26","purpur-text-field-default__input-container":"_purpur-text-field-default__input-container_111s2_29","purpur-text-field-default__input-container--disabled":"_purpur-text-field-default__input-container--disabled_111s2_40","purpur-text-field-default__input-container--readonly":"_purpur-text-field-default__input-container--readonly_111s2_43","purpur-text-field-default__input-container--has-clear-button":"_purpur-text-field-default__input-container--has-clear-button_111s2_46","purpur-text-field-default__input-container--end-adornment":"_purpur-text-field-default__input-container--end-adornment_111s2_49","purpur-text-field-default__input":"_purpur-text-field-default__input_111s2_29","purpur-text-field-default__input-container--start-adornment":"_purpur-text-field-default__input-container--start-adornment_111s2_55","purpur-text-field-default__input-container--negative":"_purpur-text-field-default__input-container--negative_111s2_61","purpur-text-field-default__valid-icon":"_purpur-text-field-default__valid-icon_111s2_86","purpur-text-field-default__valid-icon--negative":"_purpur-text-field-default__valid-icon--negative_111s2_89","purpur-text-field-default__input--valid":"_purpur-text-field-default__input--valid_111s2_118","purpur-text-field-default__input--error":"_purpur-text-field-default__input--error_111s2_118","purpur-text-field-default__input--negative":"_purpur-text-field-default__input--negative_111s2_136","purpur-text-field-default__adornment-container":"_purpur-text-field-default__adornment-container_111s2_152"},le=t=>n.useRef(t),de="purpur-text-field-default",B=n.forwardRef(({["data-testid"]:t,className:x,clearButtonAriaLabel:s,beforeField:h,afterField:g,endAdornment:y,errorText:c,helperText:$,hideRequiredAsterisk:T=!1,label:C,loading:N=!1,onClear:A,startAdornment:E,valid:M=!1,negative:l=!1,_styles:S,_rootClassName:H,_prependEndAdornments:j,_inputModifiers:O,_frameModifiers:F,_inputContainerRef:w,...a},m)=>{const d=G.c.bind(S??ue),e=H??de,b=n.useId(),v=a.id??b,r=u=>t?`${t}-${u}`:void 0,Z=M&&!c,f=$?`${v}-helper-text`:void 0,I=[E].filter(u=>!!u),V=(typeof a.value=="number"?a.value!==void 0:a.value?.length)&&!a.disabled&&!a.readOnly&&!N&&A&&s,p=le(null),k=u=>{p.current=u,typeof m=="function"?m(u):m&&(m.current=u)},q=()=>{A?.(),p.current?.focus()},_=[...j??[],N&&i.jsx(re.Spinner,{disabled:a.disabled,size:"xs","data-testid":r("spinner"),negative:l},"spinner"),V&&i.jsx(Y.Button,{negative:l,variant:"tertiary-purple",onClick:q,iconOnly:!0,"aria-label":s??"","data-testid":r("clear-button"),tabIndex:-1,children:i.jsx(ie.r,{size:"xs"})},"clear-button"),Z&&i.jsx(te.r,{"data-testid":r("valid-icon"),className:d(`${e}__valid-icon`,{[`${e}__valid-icon--negative`]:l})},"valid-icon")].filter(u=>!!u),o=d(`${e}__input-container`,{[`${e}__input-container--start-adornment`]:I.length,[`${e}__input-container--end-adornment`]:_.length||y,[`${e}__input-container--disabled`]:a.disabled,[`${e}__input-container--has-clear-button`]:V,[`${e}__input-container--readonly`]:a.readOnly&&!a.disabled,[`${e}__input-container--negative`]:l});return i.jsxs("div",{className:d(x,e),children:[C&&i.jsxs(ae.Label,{htmlFor:v,className:d(`${e}__label`),"data-testid":r("label"),disabled:a.disabled,negative:l,children:[a.required&&!T&&i.jsx("span",{"aria-hidden":!0,children:"*"}),C]}),i.jsxs("div",{className:d(`${e}__field-row`),children:[!!h&&h,i.jsxs("div",{ref:w,className:o,children:[!!I.length&&i.jsx("div",{"data-testid":r("start-adornments"),className:d(`${e}__adornment-container`),children:I}),i.jsx("input",{...a,id:v,ref:k,"data-testid":r("input"),"aria-describedby":a["aria-describedby"]||f,"aria-invalid":a["aria-invalid"]||!!c,className:d([`${e}__input`,{[`${e}__input--valid`]:Z,[`${e}__input--error`]:!!c,[`${e}__input--negative`]:l,...O??{}}])}),i.jsx("div",{className:d(`${e}__frame`,{[`${e}__frame--negative`]:l,...F??{}})}),(!!_.length||y)&&i.jsxs("div",{"data-testid":r("end-adornments"),className:d(`${e}__adornment-container`),children:[_,y]})]}),!!g&&g]}),f&&i.jsx(ee.FieldHelperText,{"data-testid":r("helper-text"),id:f,negative:l,disabled:a.disabled,children:$}),c&&i.jsx(P.FieldErrorText,{"data-testid":r("error-text"),negative:l,children:c})]})});B.displayName="TextField";const _e=G.c.bind(K),R="purpur-text-field-ai",D=1400,se=t=>typeof t=="number"?!Number.isNaN(t):typeof t=="string"||Array.isArray(t)?t.length>0:t!=null,Q=n.forwardRef(({["data-testid"]:t,animatePrepopulatedValue:x=!1,typingAnimationDurationMs:s=D,endAdornment:h,value:g,defaultValue:y,onChange:c,disabled:$,readOnly:T,valid:C=!1,negative:N=!1,...A},E)=>{const M=_=>t?`${t}-${_}`:void 0,l=g!==void 0,[S,H]=n.useState(y),[j,O]=n.useState(!1),[F,w]=n.useState(!1),[a,m]=n.useState(!1),[d,e]=n.useState(null),b=n.useRef(null),v=n.useRef(null),r=l?g:S,f=se(r)&&!j,U=d!==null?d:r??"",V=f&&x&&!a&&!$&&!T,p=n.useCallback(()=>{b.current!==null&&(window.clearInterval(b.current),b.current=null)},[]),k=_=>{p(),e(null),l||H(_.currentTarget.value),O(!0),c?.(_)};n.useEffect(()=>{if(!V||typeof IntersectionObserver>"u")return;const _=v.current;if(!_)return;const o=new IntersectionObserver(u=>{u.some(W=>W.isIntersecting)&&(w(!0),m(!0),o.disconnect())},{threshold:.35});return o.observe(_),()=>o.disconnect()},[V]),n.useEffect(()=>{if(!F||j||typeof r!="string")return;if(window.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches||r.length===0){w(!1);return}p(),e("");let o=0;const u=Number.isFinite(s)&&s>0?s:D,L=Math.max(20,Math.floor(u/r.length));return b.current=window.setInterval(()=>{o+=1,e(r.slice(0,o)),o>=r.length&&(p(),e(null),w(!1))},L),p},[p,j,F,s,r]),n.useEffect(()=>p,[p]);const q=[];return h===void 0&&f&&q.push(i.jsx(J,{size:"xs","data-testid":M("edit-ai-icon"),className:_e(`${R}__ai-icon`,{[`${R}__ai-icon--negative`]:N})},"ai-icon")),i.jsx(B,{ref:E,"data-testid":t,...A,endAdornment:h,value:U,onChange:k,disabled:$,readOnly:T,valid:C,negative:N,_styles:K,_rootClassName:R,_prependEndAdornments:q,_inputModifiers:{[`${R}__input--ai`]:f},_frameModifiers:{[`${R}__frame--ai`]:f},_inputContainerRef:v})});Q.displayName="TextField";const pe=["default","ai"],z=n.forwardRef(({variant:t="default",...x},s)=>t==="ai"?i.jsx(Q,{ref:s,...x}):i.jsx(B,{ref:s,...x}));z.displayName="TextField";const oe=t=>n.isValidElement(t)&&t.type.displayName===z.displayName;exports.TextField=z;exports.isTextField=oe;exports.textFieldVariants=pe;
2
+ //# sourceMappingURL=text-field-CYJzQG3h.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-field-BwxGMWds.js","sources":["../../../components/icon/dist/components/edit-ai.es.js","../../../components/text-field/src/utils.ts","../../../components/text-field/src/text-field-base.tsx","../../../components/text-field/src/text-field-ai.tsx","../../../components/text-field/src/text-field.tsx"],"sourcesContent":["import { jsx as i } from \"react/jsx-runtime\";\nimport { I as o } from \"../icon-DNHpBTHs.mjs\";\nconst t = {\n name: \"edit-ai\",\n svg: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M18.175 22.5c.464-.002.856-.304.978-.755.41-1.533 1.255-2.463 2.655-2.926a1.02 1.02 0 0 0 .015-1.93c-1.437-.508-2.283-1.434-2.664-2.919a1.017 1.017 0 0 0-.974-.766c-.445.02-.865.305-.986.747-.422 1.518-1.267 2.447-2.661 2.923a1.02 1.02 0 0 0-.686.969c0 .436.278.824.686.961 1.4.479 2.243 1.414 2.657 2.946.12.442.523.75.978.75h.002Zm-1.788-4.66a5.334 5.334 0 0 0 1.78-1.867 5.323 5.323 0 0 0 1.792 1.87 5.256 5.256 0 0 0-1.787 1.88 5.326 5.326 0 0 0-1.785-1.883Zm4.668-12.884L18.19 2.091a1.9 1.9 0 0 0-2.687 0l-11.37 11.37a.9.9 0 0 0-.212.335L1.556 20.44a.9.9 0 0 0 1.15 1.15l6.644-2.365a.9.9 0 0 0 .335-.212l11.37-11.37a1.9 1.9 0 0 0 0-2.687ZM3.888 19.26l1.253-3.518 2.264 2.264-3.517 1.254ZM19.781 6.37 9.048 17.104 6.04 14.098l8.16-8.16 1.504 1.503a.9.9 0 1 0 1.273-1.273l-1.504-1.503 1.302-1.3a.1.1 0 0 1 .14 0l2.865 2.864a.1.1 0 0 1 0 .141Z\"/></svg>',\n keywords: [\"edit-ai\"],\n category: \"ai\"\n}, l = (a) => /* @__PURE__ */ i(o, { ...a, svg: t });\nl.displayName = \"IconEditAi\";\nexport {\n l as IconEditAi\n};\n//# sourceMappingURL=edit-ai.es.js.map\n","import { type MutableRefObject, useRef } from \"react\";\n\nexport const useMutableRefObject = <T>(value: T): MutableRefObject<T> => {\n return useRef<T>(value) as MutableRefObject<T>;\n};\n","import React, { forwardRef, type ReactNode, useId } from \"react\";\nimport { Button } from \"@purpur/button\";\nimport { FieldErrorText } from \"@purpur/field-error-text\";\nimport { FieldHelperText } from \"@purpur/field-helper-text\";\nimport { IconCheckCircleFilled } from \"@purpur/icon/check-circle-filled\";\nimport { IconClose } from \"@purpur/icon/close\";\nimport { Label } from \"@purpur/label\";\nimport { Spinner } from \"@purpur/spinner\";\nimport c from \"classnames/bind\";\n\nimport type { TextFieldBaseProps } from \"./text-field\";\nimport defaultStyles from \"./text-field.module.scss\";\nimport { useMutableRefObject } from \"./utils\";\n\nconst defaultRootClassName = \"purpur-text-field-default\";\n\n// Internal overrides for variant composition (not part of the public API)\nexport type TextFieldBaseInternalOverrides = {\n _styles?: Record<string, string>;\n _rootClassName?: string;\n _prependEndAdornments?: ReactNode[];\n _inputModifiers?: Record<string, boolean>;\n _frameModifiers?: Record<string, boolean>;\n _inputContainerRef?: React.Ref<HTMLDivElement>;\n};\n\nexport const TextFieldBase = forwardRef<\n HTMLInputElement,\n TextFieldBaseProps & TextFieldBaseInternalOverrides\n>(\n (\n {\n [\"data-testid\"]: dataTestId,\n className,\n clearButtonAriaLabel,\n beforeField,\n afterField,\n endAdornment,\n errorText,\n helperText,\n hideRequiredAsterisk = false,\n label,\n loading = false,\n onClear,\n startAdornment,\n valid = false,\n negative = false,\n _styles,\n _rootClassName,\n _prependEndAdornments,\n _inputModifiers,\n _frameModifiers,\n _inputContainerRef,\n ...inputProps\n },\n ref\n ) => {\n const cx = c.bind(_styles ?? defaultStyles);\n const rootClassName = _rootClassName ?? defaultRootClassName;\n const randomId = useId();\n const inputId = inputProps.id ?? randomId;\n const getTestId = (name: string) => (dataTestId ? `${dataTestId}-${name}` : undefined);\n const isValid = valid && !errorText;\n const helperTextId = helperText ? `${inputId}-helper-text` : undefined;\n const startAdornments: ReactNode[] = [startAdornment].filter((adornment) => !!adornment);\n const hasValue =\n typeof inputProps.value === \"number\"\n ? inputProps.value !== undefined\n : inputProps.value?.length;\n const hasClearButton =\n hasValue &&\n !inputProps.disabled &&\n !inputProps.readOnly &&\n !loading &&\n onClear &&\n clearButtonAriaLabel;\n\n const internalRef = useMutableRefObject<HTMLInputElement | null>(null);\n const setRef = (node: HTMLInputElement | null) => {\n internalRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n };\n const handleClear = () => {\n onClear?.();\n internalRef.current?.focus();\n };\n\n const localEndAdornments: ReactNode[] = [\n ...(_prependEndAdornments ?? []),\n loading && (\n <Spinner\n key=\"spinner\"\n disabled={inputProps.disabled}\n size=\"xs\"\n data-testid={getTestId(\"spinner\")}\n negative={negative}\n />\n ),\n hasClearButton && (\n <Button\n negative={negative}\n key=\"clear-button\"\n variant=\"tertiary-purple\"\n onClick={handleClear}\n iconOnly\n aria-label={clearButtonAriaLabel ?? \"\"}\n data-testid={getTestId(\"clear-button\")}\n tabIndex={-1}\n >\n <IconClose size=\"xs\" />\n </Button>\n ),\n isValid && (\n <IconCheckCircleFilled\n key=\"valid-icon\"\n data-testid={getTestId(\"valid-icon\")}\n className={cx(`${rootClassName}__valid-icon`, {\n [`${rootClassName}__valid-icon--negative`]: negative,\n })}\n />\n ),\n ].filter((adornment) => !!adornment);\n\n const inputContainerClassnames = cx(`${rootClassName}__input-container`, {\n [`${rootClassName}__input-container--start-adornment`]: startAdornments.length,\n [`${rootClassName}__input-container--end-adornment`]:\n localEndAdornments.length || endAdornment,\n [`${rootClassName}__input-container--disabled`]: inputProps.disabled,\n [`${rootClassName}__input-container--has-clear-button`]: hasClearButton,\n [`${rootClassName}__input-container--readonly`]: inputProps.readOnly && !inputProps.disabled,\n [`${rootClassName}__input-container--negative`]: negative,\n });\n\n return (\n <div className={cx(className, rootClassName)}>\n {label && (\n <Label\n htmlFor={inputId}\n className={cx(`${rootClassName}__label`)}\n data-testid={getTestId(\"label\")}\n disabled={inputProps.disabled}\n negative={negative}\n >\n {inputProps.required && !hideRequiredAsterisk && <span aria-hidden>*</span>}\n {label}\n </Label>\n )}\n <div className={cx(`${rootClassName}__field-row`)}>\n {!!beforeField && beforeField}\n <div ref={_inputContainerRef} className={inputContainerClassnames}>\n {!!startAdornments.length && (\n <div\n data-testid={getTestId(\"start-adornments\")}\n className={cx(`${rootClassName}__adornment-container`)}\n >\n {startAdornments}\n </div>\n )}\n <input\n {...inputProps}\n id={inputId}\n ref={setRef}\n data-testid={getTestId(\"input\")}\n aria-describedby={inputProps[\"aria-describedby\"] || helperTextId}\n aria-invalid={inputProps[\"aria-invalid\"] || !!errorText}\n className={cx([\n `${rootClassName}__input`,\n {\n [`${rootClassName}__input--valid`]: isValid,\n [`${rootClassName}__input--error`]: !!errorText,\n [`${rootClassName}__input--negative`]: negative,\n ...(_inputModifiers ?? {}),\n },\n ])}\n />\n <div\n className={cx(`${rootClassName}__frame`, {\n [`${rootClassName}__frame--negative`]: negative,\n ...(_frameModifiers ?? {}),\n })}\n />\n {(!!localEndAdornments.length || endAdornment) && (\n <div\n data-testid={getTestId(\"end-adornments\")}\n className={cx(`${rootClassName}__adornment-container`)}\n >\n {localEndAdornments}\n {endAdornment}\n </div>\n )}\n </div>\n {!!afterField && afterField}\n </div>\n {helperTextId && (\n <FieldHelperText\n data-testid={getTestId(\"helper-text\")}\n id={helperTextId}\n negative={negative}\n disabled={inputProps.disabled}\n >\n {helperText}\n </FieldHelperText>\n )}\n {errorText && (\n <FieldErrorText data-testid={getTestId(\"error-text\")} negative={negative}>\n {errorText}\n </FieldErrorText>\n )}\n </div>\n );\n }\n);\n\nTextFieldBase.displayName = \"TextField\";\n","import React, { forwardRef, type ReactNode, useCallback, useEffect, useRef, useState } from \"react\";\nimport { IconEditAi } from \"@purpur/icon/edit-ai\";\nimport c from \"classnames/bind\";\n\nimport type { TextFieldAiInternalProps } from \"./text-field\";\nimport aiStyles from \"./text-field-ai.module.scss\";\nimport { TextFieldBase } from \"./text-field-base\";\n\nconst cx = c.bind(aiStyles);\nconst rootClassName = \"purpur-text-field-ai\";\nconst defaultTypingAnimationDurationMs = 1400;\n\nconst hasInputValue = (value: unknown) => {\n if (typeof value === \"number\") {\n return !Number.isNaN(value);\n }\n\n if (typeof value === \"string\") {\n return value.length > 0;\n }\n\n if (Array.isArray(value)) {\n return value.length > 0;\n }\n\n return value !== undefined && value !== null;\n};\n\nexport const TextFieldAiInternal = forwardRef<HTMLInputElement, TextFieldAiInternalProps>(\n (\n {\n [\"data-testid\"]: dataTestId,\n animatePrepopulatedValue = false,\n typingAnimationDurationMs = defaultTypingAnimationDurationMs,\n endAdornment,\n value: controlledValue,\n defaultValue,\n onChange,\n disabled,\n readOnly,\n valid = false,\n negative = false,\n ...baseProps\n },\n ref\n ) => {\n const getTestId = (name: string) => (dataTestId ? `${dataTestId}-${name}` : undefined);\n const isControlled = controlledValue !== undefined;\n const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);\n const [hasUserEditedValue, setHasUserEditedValue] = useState(false);\n const [shouldAnimatePrepopulatedValue, setShouldAnimatePrepopulatedValue] = useState(false);\n const [hasAnimatedPrepopulatedValue, setHasAnimatedPrepopulatedValue] = useState(false);\n const [animatedTypingValue, setAnimatedTypingValue] = useState<string | null>(null);\n const typingAnimationTimerRef = useRef<number | null>(null);\n const inputContainerRef = useRef<HTMLDivElement | null>(null);\n\n const value = isControlled ? controlledValue : uncontrolledValue;\n const hasValue = hasInputValue(value);\n const isAiPresentationActive = hasValue && !hasUserEditedValue;\n const isTypingAnimationRunning = animatedTypingValue !== null;\n const displayValue = isTypingAnimationRunning ? animatedTypingValue : value ?? \"\";\n const shouldAnimatePrepopulated =\n isAiPresentationActive &&\n animatePrepopulatedValue &&\n !hasAnimatedPrepopulatedValue &&\n !disabled &&\n !readOnly;\n\n const clearTypingAnimation = useCallback(() => {\n if (typingAnimationTimerRef.current !== null) {\n window.clearInterval(typingAnimationTimerRef.current);\n typingAnimationTimerRef.current = null;\n }\n }, []);\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n clearTypingAnimation();\n setAnimatedTypingValue(null);\n\n if (!isControlled) {\n setUncontrolledValue(event.currentTarget.value);\n }\n\n setHasUserEditedValue(true);\n onChange?.(event);\n };\n\n useEffect(() => {\n if (!shouldAnimatePrepopulated || typeof IntersectionObserver === \"undefined\") {\n return;\n }\n\n const node = inputContainerRef.current;\n\n if (!node) {\n return;\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n const isVisible = entries.some((entry) => entry.isIntersecting);\n\n if (isVisible) {\n setShouldAnimatePrepopulatedValue(true);\n setHasAnimatedPrepopulatedValue(true);\n observer.disconnect();\n }\n },\n { threshold: 0.35 }\n );\n\n observer.observe(node);\n\n return () => observer.disconnect();\n }, [shouldAnimatePrepopulated]);\n\n useEffect(() => {\n if (!shouldAnimatePrepopulatedValue || hasUserEditedValue || typeof value !== \"string\") {\n return;\n }\n\n const shouldReduceMotion = window.matchMedia?.(\"(prefers-reduced-motion: reduce)\")?.matches;\n\n if (shouldReduceMotion || value.length === 0) {\n setShouldAnimatePrepopulatedValue(false);\n return;\n }\n\n clearTypingAnimation();\n setAnimatedTypingValue(\"\");\n\n let index = 0;\n const safeAnimationDuration =\n Number.isFinite(typingAnimationDurationMs) && typingAnimationDurationMs > 0\n ? typingAnimationDurationMs\n : defaultTypingAnimationDurationMs;\n const intervalDuration = Math.max(20, Math.floor(safeAnimationDuration / value.length));\n\n typingAnimationTimerRef.current = window.setInterval(() => {\n index += 1;\n setAnimatedTypingValue(value.slice(0, index));\n\n if (index >= value.length) {\n clearTypingAnimation();\n setAnimatedTypingValue(null);\n setShouldAnimatePrepopulatedValue(false);\n }\n }, intervalDuration);\n\n return clearTypingAnimation;\n }, [\n clearTypingAnimation,\n hasUserEditedValue,\n shouldAnimatePrepopulatedValue,\n typingAnimationDurationMs,\n value,\n ]);\n\n useEffect(() => clearTypingAnimation, [clearTypingAnimation]);\n\n const aiEndAdornments: ReactNode[] = [];\n\n if (endAdornment === undefined && isAiPresentationActive) {\n aiEndAdornments.push(\n <IconEditAi\n key=\"ai-icon\"\n size=\"xs\"\n data-testid={getTestId(\"edit-ai-icon\")}\n className={cx(`${rootClassName}__ai-icon`, {\n [`${rootClassName}__ai-icon--negative`]: negative,\n })}\n />\n );\n }\n\n return (\n <TextFieldBase\n ref={ref}\n data-testid={dataTestId}\n {...baseProps}\n endAdornment={endAdornment}\n value={displayValue}\n onChange={handleInputChange}\n disabled={disabled}\n readOnly={readOnly}\n valid={valid}\n negative={negative}\n _styles={aiStyles}\n _rootClassName={rootClassName}\n _prependEndAdornments={aiEndAdornments}\n _inputModifiers={{ [`${rootClassName}__input--ai`]: isAiPresentationActive }}\n _frameModifiers={{ [`${rootClassName}__frame--ai`]: isAiPresentationActive }}\n _inputContainerRef={inputContainerRef}\n />\n );\n }\n);\n\nTextFieldAiInternal.displayName = \"TextField\";\n","import React, {\n forwardRef,\n type HTMLInputTypeAttribute,\n isValidElement,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\n\nimport { TextFieldAiInternal } from \"./text-field-ai\";\nimport { TextFieldBase } from \"./text-field-base\";\n\nexport const textFieldVariants = [\"default\", \"ai\"] as const;\nexport type TextFieldVariant = (typeof textFieldVariants)[number];\n\ntype TextFieldCommonProps = {\n /**\n * Use to display e.g. a button before the text field.\n *\n * _NOTE: Should ideally only be used by other purpur components!_\n */\n beforeField?: ReactNode;\n /**\n * Use to display e.g. a button after the text field.\n *\n * _NOTE: Should ideally only be used by other purpur components!_\n */\n afterField?: ReactNode;\n /**\n * Use to display e.g. an icon at the end inside of the text field.\n *\n * _NOTE: Should ideally only be used by other purpur components!_\n */\n endAdornment?: ReactNode;\n /**\n * Use to render error message below the text field. The text field renders with error appearance.\n * */\n errorText?: string;\n /**\n * Use to give context about the field's input. Renders below the field.\n * */\n helperText?: string;\n /**\n * The label of the text field.\n * */\n label?: string;\n /**\n * Use to render a spinner at the end inside of the text field.\n */\n loading?: boolean;\n /**\n * Hide the asterisk for required fields.\n * This is useful when the field is required but the context already indicates that.\n */\n hideRequiredAsterisk?: boolean;\n /**\n * Use to display e.g. an icon at the start inside of the text field.\n *\n * _NOTE: Should ideally only be used by other purpur components!_\n */\n startAdornment?: ReactNode;\n /**\n * Use to set the type of the field.\n */\n type?: Extract<\n HTMLInputTypeAttribute,\n \"email\" | \"number\" | \"password\" | \"search\" | \"tel\" | \"text\"\n >;\n /**\n * Use to render text field with valid appearance. A check\n * icon will render at the start inside of the input.\n */\n valid?: boolean;\n negative?: boolean;\n};\n\ntype TextFieldClearProps =\n | {\n /**\n * An accessible label for the clear button.\n * */\n clearButtonAriaLabel: string;\n /**\n * Event handler called when the clear button is clicked.\n * */\n onClear: () => void;\n }\n | {\n /**\n * An accessible label for the clear button.\n * */\n clearButtonAriaLabel?: never;\n /**\n * Event handler called when the clear button is clicked.\n * */\n onClear?: never;\n };\n\ntype TextFieldAiProps = {\n /**\n * Animate prepopulated value once when the field scrolls into view.\n */\n animatePrepopulatedValue?: boolean;\n /**\n * Duration in milliseconds for the prepopulated typing animation.\n */\n typingAnimationDurationMs?: number;\n};\n\nexport type TextFieldBaseProps = Omit<BaseProps<\"input\">, \"type\"> &\n TextFieldCommonProps &\n TextFieldClearProps;\n\nexport type TextFieldAiInternalProps = Omit<BaseProps<\"input\">, \"type\"> &\n TextFieldCommonProps &\n TextFieldClearProps &\n TextFieldAiProps;\n\nexport type TextFieldProps = Omit<BaseProps<\"input\">, \"type\"> &\n TextFieldCommonProps &\n TextFieldClearProps &\n TextFieldAiProps & {\n /**\n * Use to select the text field variant.\n * - `\"default\"` renders a standard text field.\n * - `\"ai\"` renders a text field with AI presentation (gradient border, AI icon, typing animation).\n * @default \"default\"\n */\n variant?: TextFieldVariant;\n };\n\nexport const TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n ({ variant = \"default\", ...props }, ref) => {\n if (variant === \"ai\") {\n return <TextFieldAiInternal ref={ref} {...props} />;\n }\n\n return <TextFieldBase ref={ref} {...props} />;\n }\n);\n\nTextField.displayName = \"TextField\";\n\nexport const isTextField = (child?: ReactNode): child is ReactElement<TextFieldProps> =>\n isValidElement<TextFieldProps>(child) &&\n (child.type as any).displayName === TextField.displayName; // eslint-disable-line @typescript-eslint/no-explicit-any\n"],"names":["t","l","a","i","o","useMutableRefObject","value","useRef","defaultRootClassName","TextFieldBase","forwardRef","dataTestId","className","clearButtonAriaLabel","beforeField","afterField","endAdornment","errorText","helperText","hideRequiredAsterisk","label","loading","onClear","startAdornment","valid","negative","_styles","_rootClassName","_prependEndAdornments","_inputModifiers","_frameModifiers","_inputContainerRef","inputProps","ref","cx","c","defaultStyles","rootClassName","randomId","useId","inputId","getTestId","name","isValid","helperTextId","startAdornments","adornment","hasClearButton","internalRef","setRef","node","handleClear","localEndAdornments","jsx","Spinner","Button","IconClose","IconCheckCircleFilled","inputContainerClassnames","jsxs","Label","FieldHelperText","FieldErrorText","aiStyles","defaultTypingAnimationDurationMs","hasInputValue","TextFieldAiInternal","animatePrepopulatedValue","typingAnimationDurationMs","controlledValue","defaultValue","onChange","disabled","readOnly","baseProps","isControlled","uncontrolledValue","setUncontrolledValue","useState","hasUserEditedValue","setHasUserEditedValue","shouldAnimatePrepopulatedValue","setShouldAnimatePrepopulatedValue","hasAnimatedPrepopulatedValue","setHasAnimatedPrepopulatedValue","animatedTypingValue","setAnimatedTypingValue","typingAnimationTimerRef","inputContainerRef","isAiPresentationActive","displayValue","shouldAnimatePrepopulated","clearTypingAnimation","useCallback","handleInputChange","event","useEffect","observer","entries","entry","index","safeAnimationDuration","intervalDuration","aiEndAdornments","IconEditAi","textFieldVariants","TextField","variant","props","isTextField","child","isValidElement"],"mappings":"waAEMA,GAAI,CACR,KAAM,UACN,IAAK,k7BACL,SAAU,CAAC,SAAS,EACpB,SAAU,IACZ,EAAGC,EAAKC,GAAs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U"}
1
+ {"version":3,"file":"text-field-CYJzQG3h.js","sources":["../../../components/icon/dist/components/edit-ai.es.js","../../../components/text-field/src/utils.ts","../../../components/text-field/src/text-field-base.tsx","../../../components/text-field/src/text-field-ai.tsx","../../../components/text-field/src/text-field.tsx"],"sourcesContent":["import { jsx as i } from \"react/jsx-runtime\";\nimport { I as o } from \"../icon-DNHpBTHs.mjs\";\nconst t = {\n name: \"edit-ai\",\n svg: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M18.175 22.5c.464-.002.856-.304.978-.755.41-1.533 1.255-2.463 2.655-2.926a1.02 1.02 0 0 0 .015-1.93c-1.437-.508-2.283-1.434-2.664-2.919a1.017 1.017 0 0 0-.974-.766c-.445.02-.865.305-.986.747-.422 1.518-1.267 2.447-2.661 2.923a1.02 1.02 0 0 0-.686.969c0 .436.278.824.686.961 1.4.479 2.243 1.414 2.657 2.946.12.442.523.75.978.75h.002Zm-1.788-4.66a5.334 5.334 0 0 0 1.78-1.867 5.323 5.323 0 0 0 1.792 1.87 5.256 5.256 0 0 0-1.787 1.88 5.326 5.326 0 0 0-1.785-1.883Zm4.668-12.884L18.19 2.091a1.9 1.9 0 0 0-2.687 0l-11.37 11.37a.9.9 0 0 0-.212.335L1.556 20.44a.9.9 0 0 0 1.15 1.15l6.644-2.365a.9.9 0 0 0 .335-.212l11.37-11.37a1.9 1.9 0 0 0 0-2.687ZM3.888 19.26l1.253-3.518 2.264 2.264-3.517 1.254ZM19.781 6.37 9.048 17.104 6.04 14.098l8.16-8.16 1.504 1.503a.9.9 0 1 0 1.273-1.273l-1.504-1.503 1.302-1.3a.1.1 0 0 1 .14 0l2.865 2.864a.1.1 0 0 1 0 .141Z\"/></svg>',\n keywords: [\"edit-ai\"],\n category: \"ai\"\n}, l = (a) => /* @__PURE__ */ i(o, { ...a, svg: t });\nl.displayName = \"IconEditAi\";\nexport {\n l as IconEditAi\n};\n//# sourceMappingURL=edit-ai.es.js.map\n","import { type MutableRefObject, useRef } from \"react\";\n\nexport const useMutableRefObject = <T>(value: T): MutableRefObject<T> => {\n return useRef<T>(value) as MutableRefObject<T>;\n};\n","import React, { forwardRef, type ReactNode, useId } from \"react\";\nimport { Button } from \"@purpur/button\";\nimport { FieldErrorText } from \"@purpur/field-error-text\";\nimport { FieldHelperText } from \"@purpur/field-helper-text\";\nimport { IconCheckCircleFilled } from \"@purpur/icon/check-circle-filled\";\nimport { IconClose } from \"@purpur/icon/close\";\nimport { Label } from \"@purpur/label\";\nimport { Spinner } from \"@purpur/spinner\";\nimport c from \"classnames/bind\";\n\nimport type { TextFieldBaseProps } from \"./text-field\";\nimport defaultStyles from \"./text-field.module.scss\";\nimport { useMutableRefObject } from \"./utils\";\n\nconst defaultRootClassName = \"purpur-text-field-default\";\n\n// Internal overrides for variant composition (not part of the public API)\nexport type TextFieldBaseInternalOverrides = {\n _styles?: Record<string, string>;\n _rootClassName?: string;\n _prependEndAdornments?: ReactNode[];\n _inputModifiers?: Record<string, boolean>;\n _frameModifiers?: Record<string, boolean>;\n _inputContainerRef?: React.Ref<HTMLDivElement>;\n};\n\nexport const TextFieldBase = forwardRef<\n HTMLInputElement,\n TextFieldBaseProps & TextFieldBaseInternalOverrides\n>(\n (\n {\n [\"data-testid\"]: dataTestId,\n className,\n clearButtonAriaLabel,\n beforeField,\n afterField,\n endAdornment,\n errorText,\n helperText,\n hideRequiredAsterisk = false,\n label,\n loading = false,\n onClear,\n startAdornment,\n valid = false,\n negative = false,\n _styles,\n _rootClassName,\n _prependEndAdornments,\n _inputModifiers,\n _frameModifiers,\n _inputContainerRef,\n ...inputProps\n },\n ref\n ) => {\n const cx = c.bind(_styles ?? defaultStyles);\n const rootClassName = _rootClassName ?? defaultRootClassName;\n const randomId = useId();\n const inputId = inputProps.id ?? randomId;\n const getTestId = (name: string) => (dataTestId ? `${dataTestId}-${name}` : undefined);\n const isValid = valid && !errorText;\n const helperTextId = helperText ? `${inputId}-helper-text` : undefined;\n const startAdornments: ReactNode[] = [startAdornment].filter((adornment) => !!adornment);\n const hasValue =\n typeof inputProps.value === \"number\"\n ? inputProps.value !== undefined\n : inputProps.value?.length;\n const hasClearButton =\n hasValue &&\n !inputProps.disabled &&\n !inputProps.readOnly &&\n !loading &&\n onClear &&\n clearButtonAriaLabel;\n\n const internalRef = useMutableRefObject<HTMLInputElement | null>(null);\n const setRef = (node: HTMLInputElement | null) => {\n internalRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n };\n const handleClear = () => {\n onClear?.();\n internalRef.current?.focus();\n };\n\n const localEndAdornments: ReactNode[] = [\n ...(_prependEndAdornments ?? []),\n loading && (\n <Spinner\n key=\"spinner\"\n disabled={inputProps.disabled}\n size=\"xs\"\n data-testid={getTestId(\"spinner\")}\n negative={negative}\n />\n ),\n hasClearButton && (\n <Button\n negative={negative}\n key=\"clear-button\"\n variant=\"tertiary-purple\"\n onClick={handleClear}\n iconOnly\n aria-label={clearButtonAriaLabel ?? \"\"}\n data-testid={getTestId(\"clear-button\")}\n tabIndex={-1}\n >\n <IconClose size=\"xs\" />\n </Button>\n ),\n isValid && (\n <IconCheckCircleFilled\n key=\"valid-icon\"\n data-testid={getTestId(\"valid-icon\")}\n className={cx(`${rootClassName}__valid-icon`, {\n [`${rootClassName}__valid-icon--negative`]: negative,\n })}\n />\n ),\n ].filter((adornment) => !!adornment);\n\n const inputContainerClassnames = cx(`${rootClassName}__input-container`, {\n [`${rootClassName}__input-container--start-adornment`]: startAdornments.length,\n [`${rootClassName}__input-container--end-adornment`]:\n localEndAdornments.length || endAdornment,\n [`${rootClassName}__input-container--disabled`]: inputProps.disabled,\n [`${rootClassName}__input-container--has-clear-button`]: hasClearButton,\n [`${rootClassName}__input-container--readonly`]: inputProps.readOnly && !inputProps.disabled,\n [`${rootClassName}__input-container--negative`]: negative,\n });\n\n return (\n <div className={cx(className, rootClassName)}>\n {label && (\n <Label\n htmlFor={inputId}\n className={cx(`${rootClassName}__label`)}\n data-testid={getTestId(\"label\")}\n disabled={inputProps.disabled}\n negative={negative}\n >\n {inputProps.required && !hideRequiredAsterisk && <span aria-hidden>*</span>}\n {label}\n </Label>\n )}\n <div className={cx(`${rootClassName}__field-row`)}>\n {!!beforeField && beforeField}\n <div ref={_inputContainerRef} className={inputContainerClassnames}>\n {!!startAdornments.length && (\n <div\n data-testid={getTestId(\"start-adornments\")}\n className={cx(`${rootClassName}__adornment-container`)}\n >\n {startAdornments}\n </div>\n )}\n <input\n {...inputProps}\n id={inputId}\n ref={setRef}\n data-testid={getTestId(\"input\")}\n aria-describedby={inputProps[\"aria-describedby\"] || helperTextId}\n aria-invalid={inputProps[\"aria-invalid\"] || !!errorText}\n className={cx([\n `${rootClassName}__input`,\n {\n [`${rootClassName}__input--valid`]: isValid,\n [`${rootClassName}__input--error`]: !!errorText,\n [`${rootClassName}__input--negative`]: negative,\n ...(_inputModifiers ?? {}),\n },\n ])}\n />\n <div\n className={cx(`${rootClassName}__frame`, {\n [`${rootClassName}__frame--negative`]: negative,\n ...(_frameModifiers ?? {}),\n })}\n />\n {(!!localEndAdornments.length || endAdornment) && (\n <div\n data-testid={getTestId(\"end-adornments\")}\n className={cx(`${rootClassName}__adornment-container`)}\n >\n {localEndAdornments}\n {endAdornment}\n </div>\n )}\n </div>\n {!!afterField && afterField}\n </div>\n {helperTextId && (\n <FieldHelperText\n data-testid={getTestId(\"helper-text\")}\n id={helperTextId}\n negative={negative}\n disabled={inputProps.disabled}\n >\n {helperText}\n </FieldHelperText>\n )}\n {errorText && (\n <FieldErrorText data-testid={getTestId(\"error-text\")} negative={negative}>\n {errorText}\n </FieldErrorText>\n )}\n </div>\n );\n }\n);\n\nTextFieldBase.displayName = \"TextField\";\n","import React, { forwardRef, type ReactNode, useCallback, useEffect, useRef, useState } from \"react\";\nimport { IconEditAi } from \"@purpur/icon/edit-ai\";\nimport c from \"classnames/bind\";\n\nimport type { TextFieldAiInternalProps } from \"./text-field\";\nimport aiStyles from \"./text-field-ai.module.scss\";\nimport { TextFieldBase } from \"./text-field-base\";\n\nconst cx = c.bind(aiStyles);\nconst rootClassName = \"purpur-text-field-ai\";\nconst defaultTypingAnimationDurationMs = 1400;\n\nconst hasInputValue = (value: unknown) => {\n if (typeof value === \"number\") {\n return !Number.isNaN(value);\n }\n\n if (typeof value === \"string\") {\n return value.length > 0;\n }\n\n if (Array.isArray(value)) {\n return value.length > 0;\n }\n\n return value !== undefined && value !== null;\n};\n\nexport const TextFieldAiInternal = forwardRef<HTMLInputElement, TextFieldAiInternalProps>(\n (\n {\n [\"data-testid\"]: dataTestId,\n animatePrepopulatedValue = false,\n typingAnimationDurationMs = defaultTypingAnimationDurationMs,\n endAdornment,\n value: controlledValue,\n defaultValue,\n onChange,\n disabled,\n readOnly,\n valid = false,\n negative = false,\n ...baseProps\n },\n ref\n ) => {\n const getTestId = (name: string) => (dataTestId ? `${dataTestId}-${name}` : undefined);\n const isControlled = controlledValue !== undefined;\n const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);\n const [hasUserEditedValue, setHasUserEditedValue] = useState(false);\n const [shouldAnimatePrepopulatedValue, setShouldAnimatePrepopulatedValue] = useState(false);\n const [hasAnimatedPrepopulatedValue, setHasAnimatedPrepopulatedValue] = useState(false);\n const [animatedTypingValue, setAnimatedTypingValue] = useState<string | null>(null);\n const typingAnimationTimerRef = useRef<number | null>(null);\n const inputContainerRef = useRef<HTMLDivElement | null>(null);\n\n const value = isControlled ? controlledValue : uncontrolledValue;\n const hasValue = hasInputValue(value);\n const isAiPresentationActive = hasValue && !hasUserEditedValue;\n const isTypingAnimationRunning = animatedTypingValue !== null;\n const displayValue = isTypingAnimationRunning ? animatedTypingValue : value ?? \"\";\n const shouldAnimatePrepopulated =\n isAiPresentationActive &&\n animatePrepopulatedValue &&\n !hasAnimatedPrepopulatedValue &&\n !disabled &&\n !readOnly;\n\n const clearTypingAnimation = useCallback(() => {\n if (typingAnimationTimerRef.current !== null) {\n window.clearInterval(typingAnimationTimerRef.current);\n typingAnimationTimerRef.current = null;\n }\n }, []);\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n clearTypingAnimation();\n setAnimatedTypingValue(null);\n\n if (!isControlled) {\n setUncontrolledValue(event.currentTarget.value);\n }\n\n setHasUserEditedValue(true);\n onChange?.(event);\n };\n\n useEffect(() => {\n if (!shouldAnimatePrepopulated || typeof IntersectionObserver === \"undefined\") {\n return;\n }\n\n const node = inputContainerRef.current;\n\n if (!node) {\n return;\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n const isVisible = entries.some((entry) => entry.isIntersecting);\n\n if (isVisible) {\n setShouldAnimatePrepopulatedValue(true);\n setHasAnimatedPrepopulatedValue(true);\n observer.disconnect();\n }\n },\n { threshold: 0.35 }\n );\n\n observer.observe(node);\n\n return () => observer.disconnect();\n }, [shouldAnimatePrepopulated]);\n\n useEffect(() => {\n if (!shouldAnimatePrepopulatedValue || hasUserEditedValue || typeof value !== \"string\") {\n return;\n }\n\n const shouldReduceMotion = window.matchMedia?.(\"(prefers-reduced-motion: reduce)\")?.matches;\n\n if (shouldReduceMotion || value.length === 0) {\n setShouldAnimatePrepopulatedValue(false);\n return;\n }\n\n clearTypingAnimation();\n setAnimatedTypingValue(\"\");\n\n let index = 0;\n const safeAnimationDuration =\n Number.isFinite(typingAnimationDurationMs) && typingAnimationDurationMs > 0\n ? typingAnimationDurationMs\n : defaultTypingAnimationDurationMs;\n const intervalDuration = Math.max(20, Math.floor(safeAnimationDuration / value.length));\n\n typingAnimationTimerRef.current = window.setInterval(() => {\n index += 1;\n setAnimatedTypingValue(value.slice(0, index));\n\n if (index >= value.length) {\n clearTypingAnimation();\n setAnimatedTypingValue(null);\n setShouldAnimatePrepopulatedValue(false);\n }\n }, intervalDuration);\n\n return clearTypingAnimation;\n }, [\n clearTypingAnimation,\n hasUserEditedValue,\n shouldAnimatePrepopulatedValue,\n typingAnimationDurationMs,\n value,\n ]);\n\n useEffect(() => clearTypingAnimation, [clearTypingAnimation]);\n\n const aiEndAdornments: ReactNode[] = [];\n\n if (endAdornment === undefined && isAiPresentationActive) {\n aiEndAdornments.push(\n <IconEditAi\n key=\"ai-icon\"\n size=\"xs\"\n data-testid={getTestId(\"edit-ai-icon\")}\n className={cx(`${rootClassName}__ai-icon`, {\n [`${rootClassName}__ai-icon--negative`]: negative,\n })}\n />\n );\n }\n\n return (\n <TextFieldBase\n ref={ref}\n data-testid={dataTestId}\n {...baseProps}\n endAdornment={endAdornment}\n value={displayValue}\n onChange={handleInputChange}\n disabled={disabled}\n readOnly={readOnly}\n valid={valid}\n negative={negative}\n _styles={aiStyles}\n _rootClassName={rootClassName}\n _prependEndAdornments={aiEndAdornments}\n _inputModifiers={{ [`${rootClassName}__input--ai`]: isAiPresentationActive }}\n _frameModifiers={{ [`${rootClassName}__frame--ai`]: isAiPresentationActive }}\n _inputContainerRef={inputContainerRef}\n />\n );\n }\n);\n\nTextFieldAiInternal.displayName = \"TextField\";\n","import React, {\n forwardRef,\n type HTMLInputTypeAttribute,\n isValidElement,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\n\nimport { TextFieldAiInternal } from \"./text-field-ai\";\nimport { TextFieldBase } from \"./text-field-base\";\n\nexport const textFieldVariants = [\"default\", \"ai\"] as const;\nexport type TextFieldVariant = (typeof textFieldVariants)[number];\n\ntype TextFieldCommonProps = {\n /**\n * Use to display e.g. a button before the text field.\n *\n * _NOTE: Should ideally only be used by other purpur components!_\n */\n beforeField?: ReactNode;\n /**\n * Use to display e.g. a button after the text field.\n *\n * _NOTE: Should ideally only be used by other purpur components!_\n */\n afterField?: ReactNode;\n /**\n * Use to display e.g. an icon at the end inside of the text field.\n *\n * _NOTE: Should ideally only be used by other purpur components!_\n */\n endAdornment?: ReactNode;\n /**\n * Use to render error message below the text field. The text field renders with error appearance.\n * */\n errorText?: string;\n /**\n * Use to give context about the field's input. Renders below the field.\n * */\n helperText?: string;\n /**\n * The label of the text field.\n * */\n label?: string;\n /**\n * Use to render a spinner at the end inside of the text field.\n */\n loading?: boolean;\n /**\n * Hide the asterisk for required fields.\n * This is useful when the field is required but the context already indicates that.\n */\n hideRequiredAsterisk?: boolean;\n /**\n * Use to display e.g. an icon at the start inside of the text field.\n *\n * _NOTE: Should ideally only be used by other purpur components!_\n */\n startAdornment?: ReactNode;\n /**\n * Use to set the type of the field.\n */\n type?: Extract<\n HTMLInputTypeAttribute,\n \"email\" | \"number\" | \"password\" | \"search\" | \"tel\" | \"text\"\n >;\n /**\n * Use to render text field with valid appearance. A check\n * icon will render at the start inside of the input.\n */\n valid?: boolean;\n negative?: boolean;\n};\n\ntype TextFieldClearProps =\n | {\n /**\n * An accessible label for the clear button.\n * */\n clearButtonAriaLabel: string;\n /**\n * Event handler called when the clear button is clicked.\n * */\n onClear: () => void;\n }\n | {\n /**\n * An accessible label for the clear button.\n * */\n clearButtonAriaLabel?: never;\n /**\n * Event handler called when the clear button is clicked.\n * */\n onClear?: never;\n };\n\ntype TextFieldAiProps = {\n /**\n * Animate prepopulated value once when the field scrolls into view.\n */\n animatePrepopulatedValue?: boolean;\n /**\n * Duration in milliseconds for the prepopulated typing animation.\n */\n typingAnimationDurationMs?: number;\n};\n\nexport type TextFieldBaseProps = Omit<BaseProps<\"input\">, \"type\"> &\n TextFieldCommonProps &\n TextFieldClearProps;\n\nexport type TextFieldAiInternalProps = Omit<BaseProps<\"input\">, \"type\"> &\n TextFieldCommonProps &\n TextFieldClearProps &\n TextFieldAiProps;\n\nexport type TextFieldProps = Omit<BaseProps<\"input\">, \"type\"> &\n TextFieldCommonProps &\n TextFieldClearProps &\n TextFieldAiProps & {\n /**\n * Use to select the text field variant.\n * - `\"default\"` renders a standard text field.\n * - `\"ai\"` renders a text field with AI presentation (gradient border, AI icon, typing animation).\n * @default \"default\"\n */\n variant?: TextFieldVariant;\n };\n\nexport const TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n ({ variant = \"default\", ...props }, ref) => {\n if (variant === \"ai\") {\n return <TextFieldAiInternal ref={ref} {...props} />;\n }\n\n return <TextFieldBase ref={ref} {...props} />;\n }\n);\n\nTextField.displayName = \"TextField\";\n\nexport const isTextField = (child?: ReactNode): child is ReactElement<TextFieldProps> =>\n isValidElement<TextFieldProps>(child) &&\n (child.type as any).displayName === TextField.displayName; // eslint-disable-line @typescript-eslint/no-explicit-any\n"],"names":["t","l","a","i","o","useMutableRefObject","value","useRef","defaultRootClassName","TextFieldBase","forwardRef","dataTestId","className","clearButtonAriaLabel","beforeField","afterField","endAdornment","errorText","helperText","hideRequiredAsterisk","label","loading","onClear","startAdornment","valid","negative","_styles","_rootClassName","_prependEndAdornments","_inputModifiers","_frameModifiers","_inputContainerRef","inputProps","ref","cx","c","defaultStyles","rootClassName","randomId","useId","inputId","getTestId","name","isValid","helperTextId","startAdornments","adornment","hasClearButton","internalRef","setRef","node","handleClear","localEndAdornments","jsx","Spinner","Button","IconClose","IconCheckCircleFilled","inputContainerClassnames","jsxs","Label","FieldHelperText","FieldErrorText","aiStyles","defaultTypingAnimationDurationMs","hasInputValue","TextFieldAiInternal","animatePrepopulatedValue","typingAnimationDurationMs","controlledValue","defaultValue","onChange","disabled","readOnly","baseProps","isControlled","uncontrolledValue","setUncontrolledValue","useState","hasUserEditedValue","setHasUserEditedValue","shouldAnimatePrepopulatedValue","setShouldAnimatePrepopulatedValue","hasAnimatedPrepopulatedValue","setHasAnimatedPrepopulatedValue","animatedTypingValue","setAnimatedTypingValue","typingAnimationTimerRef","inputContainerRef","isAiPresentationActive","displayValue","shouldAnimatePrepopulated","clearTypingAnimation","useCallback","handleInputChange","event","useEffect","observer","entries","entry","index","safeAnimationDuration","intervalDuration","aiEndAdornments","IconEditAi","textFieldVariants","TextField","variant","props","isTextField","child","isValidElement"],"mappings":"waAEMA,GAAI,CACR,KAAM,UACN,IAAK,k7BACL,SAAU,CAAC,SAAS,EACpB,SAAU,IACZ,EAAGC,EAAKC,GAAsBC,MAAEC,EAA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+1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./text-field-BwxGMWds.js");exports.TextField=e.TextField;exports.isTextField=e.isTextField;exports.textFieldVariants=e.textFieldVariants;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./text-field-CYJzQG3h.js");exports.TextField=e.TextField;exports.isTextField=e.isTextField;exports.textFieldVariants=e.textFieldVariants;
2
2
  //# sourceMappingURL=text-field.cjs.js.map
@@ -1,4 +1,4 @@
1
- import { T as i, i as a, t as s } from "./text-field-BQYzwIrG.mjs";
1
+ import { T as i, i as a, t as s } from "./text-field-BQfxJobW.mjs";
2
2
  export {
3
3
  i as TextField,
4
4
  a as isTextField,
package/dist/theme.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ThemeProvider-ipAIFRUi.js"),r=require("./useColorScheme-DNNu9bz0.js");exports.ThemeProvider=e.ThemeProvider;exports.teliaTheme=e.teliaTheme;exports.useApplyTheme=e.useApplyTheme;exports.useTheme=e.useTheme;exports.useColorScheme=r.useColorScheme;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ThemeProvider-5r7lDX-h.js"),r=require("./useColorScheme-0GMDl2GF.js");exports.ThemeProvider=e.ThemeProvider;exports.teliaTheme=e.teliaTheme;exports.useApplyTheme=e.useApplyTheme;exports.useTheme=e.useTheme;exports.useColorScheme=r.useColorScheme;
2
2
  //# sourceMappingURL=theme.cjs.js.map
package/dist/theme.es.js CHANGED
@@ -1,5 +1,5 @@
1
- import { T as a, t as m, u as o, a as r } from "./ThemeProvider-BR1hJQOD.mjs";
2
- import { u } from "./useColorScheme-9rgSgG0N.mjs";
1
+ import { T as a, t as m, u as o, a as r } from "./ThemeProvider-bkyFCeo6.mjs";
2
+ import { u } from "./useColorScheme-Di_Q0JR4.mjs";
3
3
  export {
4
4
  a as ThemeProvider,
5
5
  m as teliaTheme,
@@ -134,14 +134,14 @@
134
134
  --purpur-color-text-default-negative: var(--purpur-color-transparent-white-950);
135
135
  --purpur-color-text-medium-negative: var(--purpur-color-transparent-white-700);
136
136
  --purpur-color-text-weak-negative: var(--purpur-color-transparent-white-400);
137
- --purpur-color-text-interactive-primary: var(--purpur-color-purple-600);
138
- --purpur-color-text-interactive-primary-hover: var(--purpur-color-purple-700);
139
- --purpur-color-text-interactive-primary-active: var(--purpur-color-purple-800);
137
+ --purpur-color-text-interactive-primary: var(--purpur-color-purple-700);
138
+ --purpur-color-text-interactive-primary-hover: var(--purpur-color-purple-800);
139
+ --purpur-color-text-interactive-primary-active: var(--purpur-color-purple-900);
140
140
  --purpur-color-text-interactive-on-primary: var(--purpur-color-functional-white);
141
141
  --purpur-color-text-interactive-on-primary-negative: var(--purpur-color-purple-800);
142
- --purpur-color-text-interactive-primary-negative: var(--purpur-color-purple-200);
143
- --purpur-color-text-interactive-primary-hover-negative: var(--purpur-color-purple-100);
144
- --purpur-color-text-interactive-primary-active-negative: var(--purpur-color-purple-50);
142
+ --purpur-color-text-interactive-primary-negative: var(--purpur-color-purple-100);
143
+ --purpur-color-text-interactive-primary-hover-negative: var(--purpur-color-purple-50);
144
+ --purpur-color-text-interactive-primary-active-negative: var(--purpur-color-functional-white);
145
145
  --purpur-color-text-interactive-on-expressive: var(--purpur-color-functional-white);
146
146
  --purpur-color-text-interactive-on-expressive-negative: var(--purpur-color-functional-white);
147
147
  --purpur-color-text-interactive-on-expressive-hover: var(--purpur-color-functional-white);
@@ -235,12 +235,12 @@
235
235
  --purpur-color-border-weak: var(--purpur-color-transparent-black-150);
236
236
  --purpur-color-border-weak-negative: var(--purpur-color-transparent-white-150);
237
237
  --purpur-color-border-interactive-focus: var(--purpur-color-purple-500);
238
- --purpur-color-border-interactive-primary: var(--purpur-color-purple-600);
239
- --purpur-color-border-interactive-primary-negative: var(--purpur-color-purple-200);
240
- --purpur-color-border-interactive-primary-hover: var(--purpur-color-purple-700);
241
- --purpur-color-border-interactive-primary-active: var(--purpur-color-purple-800);
242
- --purpur-color-border-interactive-primary-hover-negative: var(--purpur-color-purple-100);
243
- --purpur-color-border-interactive-primary-active-negative: var(--purpur-color-purple-50);
238
+ --purpur-color-border-interactive-primary: var(--purpur-color-purple-700);
239
+ --purpur-color-border-interactive-primary-negative: var(--purpur-color-purple-100);
240
+ --purpur-color-border-interactive-primary-hover: var(--purpur-color-purple-800);
241
+ --purpur-color-border-interactive-primary-active: var(--purpur-color-purple-900);
242
+ --purpur-color-border-interactive-primary-hover-negative: var(--purpur-color-purple-50);
243
+ --purpur-color-border-interactive-primary-active-negative: var(--purpur-color-functional-white);
244
244
  --purpur-color-border-interactive-expressive: var(--purpur-color-purple-550);
245
245
  --purpur-color-border-interactive-selected: var(--purpur-color-purple-550);
246
246
  --purpur-color-border-interactive-subtle: var(--purpur-color-transparent-black-400);