@purpur/library 9.10.0 → 9.10.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 (251) hide show
  1. package/CHANGELOG.json +18 -0
  2. package/CHANGELOG.md +10 -1
  3. package/dist/LICENSE.txt +40 -0
  4. package/dist/{RichText-D4vznH1B.mjs → RichText-2_z57EYi.mjs} +2 -2
  5. package/dist/{RichText-D4vznH1B.mjs.map → RichText-2_z57EYi.mjs.map} +1 -1
  6. package/dist/{RichText-BAVZadzi.js → RichText-IejAKqm2.js} +2 -2
  7. package/dist/{RichText-BAVZadzi.js.map → RichText-IejAKqm2.js.map} +1 -1
  8. package/dist/{autocomplete-CmLzmWp4.mjs → autocomplete-C6AqdYaZ.mjs} +2 -2
  9. package/dist/{autocomplete-CmLzmWp4.mjs.map → autocomplete-C6AqdYaZ.mjs.map} +1 -1
  10. package/dist/{autocomplete-BX1KDZqL.js → autocomplete-yrPbF5gq.js} +2 -2
  11. package/dist/{autocomplete-BX1KDZqL.js.map → autocomplete-yrPbF5gq.js.map} +1 -1
  12. package/dist/autocomplete.cjs.js +1 -1
  13. package/dist/autocomplete.es.js +1 -1
  14. package/dist/button-DZgtrGqN.js +2 -0
  15. package/dist/{button-DmybVApa.js.map → button-DZgtrGqN.js.map} +1 -1
  16. package/dist/button-EVRfctR8.mjs +109 -0
  17. package/dist/{button-4-yWOgtD.mjs.map → button-EVRfctR8.mjs.map} +1 -1
  18. package/dist/button.cjs.js +1 -1
  19. package/dist/button.es.js +1 -1
  20. package/dist/{calendar-Cru-p6gC.mjs → calendar-CTWhxuS4.mjs} +2 -2
  21. package/dist/{calendar-Cru-p6gC.mjs.map → calendar-CTWhxuS4.mjs.map} +1 -1
  22. package/dist/{calendar-DDR8CQYo.js → calendar-Cwzqytai.js} +2 -2
  23. package/dist/{calendar-DDR8CQYo.js.map → calendar-Cwzqytai.js.map} +1 -1
  24. package/dist/calendar.cjs.js +1 -1
  25. package/dist/calendar.es.js +1 -1
  26. package/dist/{carousel-BIKcwvYz.mjs → carousel-DiKGSL-7.mjs} +2 -2
  27. package/dist/{carousel-BIKcwvYz.mjs.map → carousel-DiKGSL-7.mjs.map} +1 -1
  28. package/dist/{carousel-DnSaLDZf.js → carousel-Dz_bUGo4.js} +2 -2
  29. package/dist/{carousel-DnSaLDZf.js.map → carousel-Dz_bUGo4.js.map} +1 -1
  30. package/dist/carousel.cjs.js +1 -1
  31. package/dist/carousel.es.js +1 -1
  32. package/dist/{chat-field-CVF4DooY.mjs → chat-field-8cKqYcKi.mjs} +2 -2
  33. package/dist/{chat-field-CVF4DooY.mjs.map → chat-field-8cKqYcKi.mjs.map} +1 -1
  34. package/dist/{chat-field-Wjvh2J6C.js → chat-field-B2jmpVNr.js} +2 -2
  35. package/dist/{chat-field-Wjvh2J6C.js.map → chat-field-B2jmpVNr.js.map} +1 -1
  36. package/dist/chat-field.cjs.js +1 -1
  37. package/dist/chat-field.es.js +1 -1
  38. package/dist/{comparison-table-D1evE0ri.mjs → comparison-table-CmtSOUfK.mjs} +2 -2
  39. package/dist/{comparison-table-D1evE0ri.mjs.map → comparison-table-CmtSOUfK.mjs.map} +1 -1
  40. package/dist/{comparison-table-Dtqxz8vL.js → comparison-table-N5G3k2kr.js} +2 -2
  41. package/dist/{comparison-table-Dtqxz8vL.js.map → comparison-table-N5G3k2kr.js.map} +1 -1
  42. package/dist/comparison-table.cjs.js +1 -1
  43. package/dist/comparison-table.es.js +1 -1
  44. package/dist/components/accordion/src/accordion-item.d.ts +2 -2
  45. package/dist/components/accordion/src/accordion.d.ts +2 -2
  46. package/dist/components/avatar/src/avatar.d.ts +1 -1
  47. package/dist/components/button/src/button.d.ts +5 -5
  48. package/dist/components/card/src/card-badge.d.ts +1 -1
  49. package/dist/components/card/src/card-cta.d.ts +1 -1
  50. package/dist/components/card/src/card-heading.d.ts +1 -1
  51. package/dist/components/card/src/card-media-layout.d.ts +1 -1
  52. package/dist/components/card/src/card-media.d.ts +1 -1
  53. package/dist/components/checkbox/src/checkbox.d.ts +1 -1
  54. package/dist/components/comparison-table/src/components/OptionCard/option-card.d.ts +1 -1
  55. package/dist/components/content-block/src/content-block.d.ts +2 -2
  56. package/dist/components/counter-badge/src/counter-badge.d.ts +1 -1
  57. package/dist/components/country-flag-icon/src/country-flag-icon.d.ts +1 -1
  58. package/dist/components/date-field/src/date-field.d.ts +1 -1
  59. package/dist/components/date-picker/src/date-picker.d.ts +4 -4
  60. package/dist/components/dismissable-chip-group/src/dismissable-chip-group-item.d.ts +1 -1
  61. package/dist/components/dismissable-chip-group/src/dismissable-chip-group.d.ts +2 -2
  62. package/dist/components/drawer/src/drawer-content.d.ts +2 -2
  63. package/dist/components/drawer/src/drawer-frame.d.ts +1 -1
  64. package/dist/components/drawer/src/drawer-trigger.d.ts +1 -1
  65. package/dist/components/field-error-text/src/field-error-text.d.ts +2 -2
  66. package/dist/components/field-helper-text/src/field-helper-text.d.ts +1 -1
  67. package/dist/components/footer/src/footer-navigation.d.ts +1 -1
  68. package/dist/components/footer/src/footer-social-link.d.ts +3 -3
  69. package/dist/components/footer/src/footer.d.ts +3 -3
  70. package/dist/components/grid/src/grid.item.d.ts +1 -1
  71. package/dist/components/heading/src/heading.d.ts +2 -2
  72. package/dist/components/hero-banner/src/hero-banner-actions.d.ts +1 -1
  73. package/dist/components/hero-banner/src/hero-banner-media.d.ts +1 -1
  74. package/dist/components/hero-banner/src/hero-banner-types.d.ts +2 -2
  75. package/dist/components/illustrative-icon/src/static-illustrative-icon.d.ts +2 -2
  76. package/dist/components/listbox/src/listbox-item.d.ts +1 -1
  77. package/dist/components/listbox/src/listbox.d.ts +1 -1
  78. package/dist/components/logo/src/logo.types.d.ts +1 -1
  79. package/dist/components/notification-banner/src/notification-banner.d.ts +2 -2
  80. package/dist/components/pagination/src/pagination-page-selector.d.ts +2 -2
  81. package/dist/components/pagination/src/pagination-page-size-selector.d.ts +2 -2
  82. package/dist/components/pagination/src/pagination-pages.d.ts +2 -2
  83. package/dist/components/pagination/src/use-page-options.hook.d.ts +2 -2
  84. package/dist/components/pagination/src/use-page-size-options.hook.d.ts +2 -2
  85. package/dist/components/paragraph/src/paragraph.d.ts +1 -1
  86. package/dist/components/password-field/src/password-strength-indicator.d.ts +2 -2
  87. package/dist/components/password-field/src/password-strength.d.ts +2 -2
  88. package/dist/components/popover/src/popover-button.d.ts +2 -2
  89. package/dist/components/product-card/src/product-card.d.ts +1 -1
  90. package/dist/components/promotion-card/src/promotion-card.d.ts +1 -1
  91. package/dist/components/quantity-selector/src/quantity-selector.d.ts +1 -1
  92. package/dist/components/radio-button-group/src/radio-button-group-root.d.ts +1 -1
  93. package/dist/components/radio-card-group/src/radio-card-group.d.ts +2 -2
  94. package/dist/components/search-field/src/search-field-autocomplete.d.ts +1 -1
  95. package/dist/components/search-field/src/search-field-base.d.ts +1 -1
  96. package/dist/components/search-field/src/search-field.d.ts +6 -6
  97. package/dist/components/select/src/select.d.ts +1 -1
  98. package/dist/components/spacer/src/spacer.d.ts +2 -2
  99. package/dist/components/spinner/src/spinner.d.ts +1 -1
  100. package/dist/components/stepper/src/stepper-content.d.ts +1 -1
  101. package/dist/components/stepper/src/stepper.d.ts +2 -2
  102. package/dist/components/table/src/cell-types/button-group-cell.d.ts +1 -1
  103. package/dist/components/table/src/empty-table.d.ts +2 -2
  104. package/dist/components/table/src/table-content.d.ts +2 -2
  105. package/dist/components/table/src/table.d.ts +1 -1
  106. package/dist/components/table/src/test-utils/table-data.d.ts +3 -3
  107. package/dist/components/tabs/src/tab-content.d.ts +1 -1
  108. package/dist/components/text-area/src/text-area.d.ts +1 -1
  109. package/dist/components/text-spacing/src/text-spacing.d.ts +1 -1
  110. package/dist/components/toggle/src/toggle.d.ts +1 -1
  111. package/dist/{date-field-DVp_RMNm.mjs → date-field-ChYx0N2j.mjs} +2 -2
  112. package/dist/{date-field-DVp_RMNm.mjs.map → date-field-ChYx0N2j.mjs.map} +1 -1
  113. package/dist/{date-field-hA79n6mP.js → date-field-CwZ64buh.js} +2 -2
  114. package/dist/{date-field-hA79n6mP.js.map → date-field-CwZ64buh.js.map} +1 -1
  115. package/dist/date-field.cjs.js +1 -1
  116. package/dist/date-field.es.js +1 -1
  117. package/dist/{date-picker-Dzoo_hhQ.js → date-picker-BWMKTOq6.js} +2 -2
  118. package/dist/{date-picker-Dzoo_hhQ.js.map → date-picker-BWMKTOq6.js.map} +1 -1
  119. package/dist/{date-picker-B8ta-Q8V.mjs → date-picker-CTyqgBRB.mjs} +5 -5
  120. package/dist/{date-picker-B8ta-Q8V.mjs.map → date-picker-CTyqgBRB.mjs.map} +1 -1
  121. package/dist/date-picker.cjs.js +1 -1
  122. package/dist/date-picker.es.js +1 -1
  123. package/dist/{date-range-field-Dqqgj41u.js → date-range-field-CvzOl-eC.js} +2 -2
  124. package/dist/{date-range-field-Dqqgj41u.js.map → date-range-field-CvzOl-eC.js.map} +1 -1
  125. package/dist/{date-range-field-BZUjfftV.mjs → date-range-field-DDr-qEGX.mjs} +2 -2
  126. package/dist/{date-range-field-BZUjfftV.mjs.map → date-range-field-DDr-qEGX.mjs.map} +1 -1
  127. package/dist/date-range-field.cjs.js +1 -1
  128. package/dist/date-range-field.es.js +1 -1
  129. package/dist/{drawer-DyLQfvEh.js → drawer-BnqxUIPM.js} +2 -2
  130. package/dist/{drawer-DyLQfvEh.js.map → drawer-BnqxUIPM.js.map} +1 -1
  131. package/dist/{drawer-cIUx6WSZ.mjs → drawer-Cnk2OKgi.mjs} +2 -2
  132. package/dist/{drawer-cIUx6WSZ.mjs.map → drawer-Cnk2OKgi.mjs.map} +1 -1
  133. package/dist/drawer.cjs.js +1 -1
  134. package/dist/drawer.es.js +1 -1
  135. package/dist/{footer-Cn1-zG1v.js → footer-B8rzVSrZ.js} +2 -2
  136. package/dist/{footer-Cn1-zG1v.js.map → footer-B8rzVSrZ.js.map} +1 -1
  137. package/dist/{footer-D-2b7UIB.mjs → footer-D5YkHmCo.mjs} +2 -2
  138. package/dist/{footer-D-2b7UIB.mjs.map → footer-D5YkHmCo.mjs.map} +1 -1
  139. package/dist/footer.cjs.js +1 -1
  140. package/dist/footer.es.js +1 -1
  141. package/dist/{hero-banner-n9K-Jsdz.mjs → hero-banner-BXRArPWP.mjs} +2 -2
  142. package/dist/{hero-banner-n9K-Jsdz.mjs.map → hero-banner-BXRArPWP.mjs.map} +1 -1
  143. package/dist/{hero-banner--v-ezYMr.js → hero-banner-CW7DIEZe.js} +2 -2
  144. package/dist/{hero-banner--v-ezYMr.js.map → hero-banner-CW7DIEZe.js.map} +1 -1
  145. package/dist/hero-banner.cjs.js +1 -1
  146. package/dist/hero-banner.es.js +1 -1
  147. package/dist/libraries/library/src/library.d.ts +1 -0
  148. package/dist/libraries/library/src/library.d.ts.map +1 -1
  149. package/dist/libraries/library/src/password-field.d.ts +6 -2
  150. package/dist/libraries/library/src/password-field.d.ts.map +1 -1
  151. package/dist/libraries/library/src/radio-button-group.d.ts +1 -1
  152. package/dist/libraries/library/src/radio-card-group.d.ts +1 -1
  153. package/dist/libraries/library/src/spinner.d.ts +1 -1
  154. package/dist/libraries/library/src/stepper.d.ts +1 -1
  155. package/dist/libraries/library/src/tooltip.d.ts +1 -1
  156. package/dist/libraries/library/src/visually-hidden.d.ts +1 -1
  157. package/dist/libraries/theme/src/ThemeProvider.d.ts +2 -2
  158. package/dist/library.cjs.js +1 -1
  159. package/dist/library.es.js +546 -543
  160. package/dist/library.es.js.map +1 -1
  161. package/dist/link-Dzqd0QuD.js +2 -0
  162. package/dist/{link-DhWVrkTz.js.map → link-Dzqd0QuD.js.map} +1 -1
  163. package/dist/link-ccCdDvBc.mjs +72 -0
  164. package/dist/{link-DY5WLpyc.mjs.map → link-ccCdDvBc.mjs.map} +1 -1
  165. package/dist/link.cjs.js +1 -1
  166. package/dist/link.es.js +1 -1
  167. package/dist/main-B501z9Ql.js +2 -0
  168. package/dist/main-B501z9Ql.js.map +1 -0
  169. package/dist/main-L71Sqg3s.mjs +1016 -0
  170. package/dist/main-L71Sqg3s.mjs.map +1 -0
  171. package/dist/{modal-Bu1Zv5Ic.mjs → modal-BuUQrUYJ.mjs} +2 -2
  172. package/dist/{modal-Bu1Zv5Ic.mjs.map → modal-BuUQrUYJ.mjs.map} +1 -1
  173. package/dist/{modal-D0Qxrvx5.js → modal-CnC4Zyjk.js} +2 -2
  174. package/dist/{modal-D0Qxrvx5.js.map → modal-CnC4Zyjk.js.map} +1 -1
  175. package/dist/modal.cjs.js +1 -1
  176. package/dist/modal.es.js +1 -1
  177. package/dist/{notification-DiVdy6E_.mjs → notification-C3f3N1K1.mjs} +2 -2
  178. package/dist/{notification-DiVdy6E_.mjs.map → notification-C3f3N1K1.mjs.map} +1 -1
  179. package/dist/{notification-D2oClkX2.js → notification-CeoAXDXq.js} +2 -2
  180. package/dist/{notification-D2oClkX2.js.map → notification-CeoAXDXq.js.map} +1 -1
  181. package/dist/{notification-banner-CZTQZ5Le.mjs → notification-banner-BvAy8dlg.mjs} +2 -2
  182. package/dist/{notification-banner-CZTQZ5Le.mjs.map → notification-banner-BvAy8dlg.mjs.map} +1 -1
  183. package/dist/{notification-banner-BxHwTFnH.js → notification-banner-DUe4fT1r.js} +2 -2
  184. package/dist/{notification-banner-BxHwTFnH.js.map → notification-banner-DUe4fT1r.js.map} +1 -1
  185. package/dist/notification-banner.cjs.js +1 -1
  186. package/dist/notification-banner.es.js +1 -1
  187. package/dist/notification.cjs.js +1 -1
  188. package/dist/notification.es.js +1 -1
  189. package/dist/password-field-BjKdBoIK.js +2 -0
  190. package/dist/password-field-BjKdBoIK.js.map +1 -0
  191. package/dist/password-field-C_E4563x.mjs +200 -0
  192. package/dist/password-field-C_E4563x.mjs.map +1 -0
  193. package/dist/password-field.cjs.js +2 -0
  194. package/dist/password-field.cjs.js.map +1 -0
  195. package/dist/password-field.es.js +6 -0
  196. package/dist/password-field.es.js.map +1 -0
  197. package/dist/{popover-CY75TnbA.js → popover-4phnhJLj.js} +2 -2
  198. package/dist/{popover-CY75TnbA.js.map → popover-4phnhJLj.js.map} +1 -1
  199. package/dist/{popover-wiiwtqWE.mjs → popover-DhObSx97.mjs} +2 -2
  200. package/dist/{popover-wiiwtqWE.mjs.map → popover-DhObSx97.mjs.map} +1 -1
  201. package/dist/popover.cjs.js +1 -1
  202. package/dist/popover.es.js +1 -1
  203. package/dist/purpur.css +1 -1
  204. package/dist/{quantity-selector-BEYMDsBM.js → quantity-selector-Ds7d4MnV.js} +2 -2
  205. package/dist/{quantity-selector-BEYMDsBM.js.map → quantity-selector-Ds7d4MnV.js.map} +1 -1
  206. package/dist/{quantity-selector-Cp-e5xKJ.mjs → quantity-selector-DwkKKmFy.mjs} +3 -3
  207. package/dist/{quantity-selector-Cp-e5xKJ.mjs.map → quantity-selector-DwkKKmFy.mjs.map} +1 -1
  208. package/dist/quantity-selector.cjs.js +1 -1
  209. package/dist/quantity-selector.es.js +1 -1
  210. package/dist/rich-text.cjs.js +1 -1
  211. package/dist/rich-text.es.js +1 -1
  212. package/dist/{search-field-afhtC6q5.mjs → search-field-BTqVE1-l.mjs} +3 -3
  213. package/dist/{search-field-afhtC6q5.mjs.map → search-field-BTqVE1-l.mjs.map} +1 -1
  214. package/dist/{search-field-WJBtiK0K.js → search-field-DkJrwzJB.js} +2 -2
  215. package/dist/{search-field-WJBtiK0K.js.map → search-field-DkJrwzJB.js.map} +1 -1
  216. package/dist/search-field.cjs.js +1 -1
  217. package/dist/search-field.es.js +1 -1
  218. package/dist/{stepper-VDiR2I8F.js → stepper-5rQ3cK18.js} +2 -2
  219. package/dist/{stepper-VDiR2I8F.js.map → stepper-5rQ3cK18.js.map} +1 -1
  220. package/dist/{stepper-20s8dnPA.mjs → stepper-B3p9r3gv.mjs} +3 -3
  221. package/dist/{stepper-20s8dnPA.mjs.map → stepper-B3p9r3gv.mjs.map} +1 -1
  222. package/dist/stepper.cjs.js +1 -1
  223. package/dist/stepper.es.js +1 -1
  224. package/dist/{table-B5ZitZoL.js → table-BIyaTsOh.js} +2 -2
  225. package/dist/{table-B5ZitZoL.js.map → table-BIyaTsOh.js.map} +1 -1
  226. package/dist/{table-CNIL-60s.mjs → table-BtymEUG4.mjs} +6 -6
  227. package/dist/{table-CNIL-60s.mjs.map → table-BtymEUG4.mjs.map} +1 -1
  228. package/dist/table.cjs.js +1 -1
  229. package/dist/table.es.js +1 -1
  230. package/dist/{text-field-D0e-cRbG.mjs → text-field-C9LX7LBf.mjs} +2 -2
  231. package/dist/{text-field-D0e-cRbG.mjs.map → text-field-C9LX7LBf.mjs.map} +1 -1
  232. package/dist/{text-field-VW8ObP83.js → text-field-CS0PT5T6.js} +2 -2
  233. package/dist/{text-field-VW8ObP83.js.map → text-field-CS0PT5T6.js.map} +1 -1
  234. package/dist/text-field.cjs.js +1 -1
  235. package/dist/text-field.es.js +1 -1
  236. package/dist/{tooltip-B-11qk-0.js → tooltip-COFCRUKv.js} +2 -2
  237. package/dist/{tooltip-B-11qk-0.js.map → tooltip-COFCRUKv.js.map} +1 -1
  238. package/dist/{tooltip-DngYHn5W.mjs → tooltip-FH9R2MAA.mjs} +2 -2
  239. package/dist/{tooltip-DngYHn5W.mjs.map → tooltip-FH9R2MAA.mjs.map} +1 -1
  240. package/dist/tooltip.cjs.js +1 -1
  241. package/dist/tooltip.es.js +1 -1
  242. package/package.json +24 -29
  243. package/scripts/generate.mts +1 -4
  244. package/src/aliases.ts +4 -0
  245. package/src/entries.js +1 -0
  246. package/src/library.ts +1 -1
  247. package/src/password-field.ts +0 -1
  248. package/dist/button-4-yWOgtD.mjs +0 -109
  249. package/dist/button-DmybVApa.js +0 -2
  250. package/dist/link-DY5WLpyc.mjs +0 -72
  251. package/dist/link-DhWVrkTz.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-B5ZitZoL.js");exports.Table=e.Table;exports.createColumnHelper=e.createColumnHelper;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./table-BIyaTsOh.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-CNIL-60s.mjs";
1
+ import { T as r, c as l } from "./table-BtymEUG4.mjs";
2
2
  export {
3
3
  r as Table,
4
4
  l as createColumnHelper
@@ -2,7 +2,7 @@ import { jsx as n, jsxs as C } from "react/jsx-runtime";
2
2
  import te, { useRef as q, forwardRef as D, useId as ie, useState as A, useCallback as ae, useEffect as U, isValidElement as ne } 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 le } from "./button-4-yWOgtD.mjs";
5
+ import { b as le } from "./button-EVRfctR8.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 _e } from "./check-circle-filled.es-umBwOv5_.mjs";
@@ -319,4 +319,4 @@ export {
319
319
  Ie as i,
320
320
  Fe as t
321
321
  };
322
- //# sourceMappingURL=text-field-D0e-cRbG.mjs.map
322
+ //# sourceMappingURL=text-field-C9LX7LBf.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-field-D0e-cRbG.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[] = Array.isArray(startAdornment)\n ? startAdornment.filter((adornment) => !!adornment)\n : startAdornment\n ? [startAdornment]\n : [];\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)} data-testid={dataTestId}>\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.map((adornment, index) => (\n <React.Fragment key={index}>{adornment}</React.Fragment>\n ))}\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","index","React","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","safeAnimationDuration","intervalDuration","aiEndAdornments","IconEditAi","textFieldVariants","TextField","variant","props","isTextField","child","isValidElement"],"mappings":";;;;;;;;;;;AAEA,MAAMA,KAAI;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU,CAAC,SAAS;AAAA,EACpB,UAAU;AACZ,GAAGC,IAAI,CAACC,MAAsBC,gBAAAA,EAAEC,IAAG,EAAE,GAAGF,GAAG,KAAKF,IAAG;AACnDC,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GCNHI,KAAsB,CAAIC,MAC9BC,EAAUD,CAAK,GCWlBE,KAAuB,6BAYhBC,IAAgBC;AAAA,EAI3B,CACE;AAAA,IACE,CAAC,gBAAgBC;AAAA,IACjB,WAAAC;AAA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9LX7LBf.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[] = Array.isArray(startAdornment)\n ? startAdornment.filter((adornment) => !!adornment)\n : startAdornment\n ? [startAdornment]\n : [];\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)} data-testid={dataTestId}>\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.map((adornment, index) => (\n <React.Fragment key={index}>{adornment}</React.Fragment>\n ))}\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","index","React","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","safeAnimationDuration","intervalDuration","aiEndAdornments","IconEditAi","textFieldVariants","TextField","variant","props","isTextField","child","isValidElement"],"mappings":";;;;;;;;;;;AAEA,MAAM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AAC,WAAW,IAAI,GAuHpCC,IAAYjG;AAAA,EACvB,CAAC,EAAE,SAAAkG,IAAU,WAAW,GAAGC,EAAA,GAAS5E,MAC9B2E,MAAY,OACP,gBAAAvD,EAACe,GAAA,EAAoB,KAAAnC,GAAW,GAAG4E,EAAA,CAAO,IAG5C,gBAAAxD,EAAC5C,GAAA,EAAc,KAAAwB,GAAW,GAAG4E,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"),r=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"),ne=require("./label-yHK80hhV.js"),ae=require("./spinner-tKunS_o-.js"),re={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=e=>i.jsx(X.b,{...e,svg:re});J.displayName="IconEditAi";const K={"purpur-text-field-ai":"_purpur-text-field-ai_endw5_1","purpur-text-field-ai__label":"_purpur-text-field-ai__label_endw5_7","purpur-text-field-ai__label-text":"_purpur-text-field-ai__label-text_endw5_12","purpur-text-field-ai__field-row":"_purpur-text-field-ai__field-row_endw5_15","purpur-text-field-ai__frame":"_purpur-text-field-ai__frame_endw5_19","purpur-text-field-ai__frame--negative":"_purpur-text-field-ai__frame--negative_endw5_26","purpur-text-field-ai__input-container":"_purpur-text-field-ai__input-container_endw5_29","purpur-text-field-ai__input-container--disabled":"_purpur-text-field-ai__input-container--disabled_endw5_40","purpur-text-field-ai__input-container--readonly":"_purpur-text-field-ai__input-container--readonly_endw5_43","purpur-text-field-ai__input-container--has-clear-button":"_purpur-text-field-ai__input-container--has-clear-button_endw5_46","purpur-text-field-ai__input-container--end-adornment":"_purpur-text-field-ai__input-container--end-adornment_endw5_49","purpur-text-field-ai__input":"_purpur-text-field-ai__input_endw5_29","purpur-text-field-ai__input-container--start-adornment":"_purpur-text-field-ai__input-container--start-adornment_endw5_55","purpur-text-field-ai__input-container--negative":"_purpur-text-field-ai__input-container--negative_endw5_61","purpur-text-field-ai__valid-icon":"_purpur-text-field-ai__valid-icon_endw5_97","purpur-text-field-ai__valid-icon--negative":"_purpur-text-field-ai__valid-icon--negative_endw5_100","purpur-text-field-ai__frame--ai":"_purpur-text-field-ai__frame--ai_endw5_106","purpur-text-field-ai__ai-icon":"_purpur-text-field-ai__ai-icon_endw5_123","purpur-text-field-ai__input--ai":"_purpur-text-field-ai__input--ai_endw5_180","purpur-text-field-ai__input--valid":"_purpur-text-field-ai__input--valid_endw5_193","purpur-text-field-ai__input--error":"_purpur-text-field-ai__input--error_endw5_193","purpur-text-field-ai__input--negative":"_purpur-text-field-ai__input--negative_endw5_241","purpur-text-field-ai__adornment-container":"_purpur-text-field-ai__adornment-container_endw5_272","purpur-text-field-ai__ai-icon--negative":"_purpur-text-field-ai__ai-icon--negative_endw5_282"},le={"purpur-text-field-default":"_purpur-text-field-default_zmlgg_1","purpur-text-field-default__label":"_purpur-text-field-default__label_zmlgg_7","purpur-text-field-default__label-text":"_purpur-text-field-default__label-text_zmlgg_12","purpur-text-field-default__field-row":"_purpur-text-field-default__field-row_zmlgg_15","purpur-text-field-default__frame":"_purpur-text-field-default__frame_zmlgg_19","purpur-text-field-default__frame--negative":"_purpur-text-field-default__frame--negative_zmlgg_26","purpur-text-field-default__input-container":"_purpur-text-field-default__input-container_zmlgg_29","purpur-text-field-default__input-container--disabled":"_purpur-text-field-default__input-container--disabled_zmlgg_40","purpur-text-field-default__input-container--readonly":"_purpur-text-field-default__input-container--readonly_zmlgg_43","purpur-text-field-default__input-container--has-clear-button":"_purpur-text-field-default__input-container--has-clear-button_zmlgg_46","purpur-text-field-default__input-container--end-adornment":"_purpur-text-field-default__input-container--end-adornment_zmlgg_49","purpur-text-field-default__input":"_purpur-text-field-default__input_zmlgg_29","purpur-text-field-default__input-container--start-adornment":"_purpur-text-field-default__input-container--start-adornment_zmlgg_55","purpur-text-field-default__input-container--negative":"_purpur-text-field-default__input-container--negative_zmlgg_61","purpur-text-field-default__valid-icon":"_purpur-text-field-default__valid-icon_zmlgg_97","purpur-text-field-default__valid-icon--negative":"_purpur-text-field-default__valid-icon--negative_zmlgg_100","purpur-text-field-default__input--valid":"_purpur-text-field-default__input--valid_zmlgg_131","purpur-text-field-default__input--error":"_purpur-text-field-default__input--error_zmlgg_131","purpur-text-field-default__input--negative":"_purpur-text-field-default__input--negative_zmlgg_149","purpur-text-field-default__adornment-container":"_purpur-text-field-default__adornment-container_zmlgg_176"},ue=e=>r.useRef(e),de="purpur-text-field-default",B=r.forwardRef(({["data-testid"]:e,className:x,clearButtonAriaLabel:s,beforeField:b,afterField:w,endAdornment:y,errorText:c,helperText:$,hideRequiredAsterisk:C=!1,label:T,loading:N=!1,onClear:F,startAdornment:m,valid:M=!1,negative:u=!1,_styles:S,_rootClassName:H,_prependEndAdornments:j,_inputModifiers:O,_frameModifiers:A,_inputContainerRef:z,...n},g)=>{const d=G.c.bind(S??le),t=H??de,v=r.useId(),h=n.id??v,a=l=>e?`${e}-${l}`:void 0,Z=M&&!c,f=$?`${h}-helper-text`:void 0,q=Array.isArray(m)?m.filter(l=>!!l):m?[m]:[],V=(typeof n.value=="number"?n.value!==void 0:n.value?.length)&&!n.disabled&&!n.readOnly&&!N&&F&&s,p=ue(null),k=l=>{p.current=l,typeof g=="function"?g(l):g&&(g.current=l)},E=()=>{F?.(),p.current?.focus()},_=[...j??[],N&&i.jsx(ae.Spinner,{disabled:n.disabled,size:"xs","data-testid":a("spinner"),negative:u},"spinner"),V&&i.jsx(Y.Button,{negative:u,variant:"tertiary-purple",onClick:E,iconOnly:!0,"aria-label":s??"","data-testid":a("clear-button"),tabIndex:-1,children:i.jsx(ie.r,{size:"xs"})},"clear-button"),Z&&i.jsx(te.r,{"data-testid":a("valid-icon"),className:d(`${t}__valid-icon`,{[`${t}__valid-icon--negative`]:u})},"valid-icon")].filter(l=>!!l),o=d(`${t}__input-container`,{[`${t}__input-container--start-adornment`]:q.length,[`${t}__input-container--end-adornment`]:_.length||y,[`${t}__input-container--disabled`]:n.disabled,[`${t}__input-container--has-clear-button`]:V,[`${t}__input-container--readonly`]:n.readOnly&&!n.disabled,[`${t}__input-container--negative`]:u});return i.jsxs("div",{className:d(x,t),"data-testid":e,children:[T&&i.jsxs(ne.Label,{htmlFor:h,className:d(`${t}__label`),"data-testid":a("label"),disabled:n.disabled,negative:u,children:[n.required&&!C&&i.jsx("span",{"aria-hidden":!0,children:"*"}),T]}),i.jsxs("div",{className:d(`${t}__field-row`),children:[!!b&&b,i.jsxs("div",{ref:z,className:o,children:[!!q.length&&i.jsx("div",{"data-testid":a("start-adornments"),className:d(`${t}__adornment-container`),children:q.map((l,I)=>i.jsx(r.Fragment,{children:l},I))}),i.jsx("input",{...n,id:h,ref:k,"data-testid":a("input"),"aria-describedby":n["aria-describedby"]||f,"aria-invalid":n["aria-invalid"]||!!c,className:d([`${t}__input`,{[`${t}__input--valid`]:Z,[`${t}__input--error`]:!!c,[`${t}__input--negative`]:u,...O??{}}])}),i.jsx("div",{className:d(`${t}__frame`,{[`${t}__frame--negative`]:u,...A??{}})}),(!!_.length||y)&&i.jsxs("div",{"data-testid":a("end-adornments"),className:d(`${t}__adornment-container`),children:[_,y]})]}),!!w&&w]}),f&&i.jsx(ee.FieldHelperText,{"data-testid":a("helper-text"),id:f,negative:u,disabled:n.disabled,children:$}),c&&i.jsx(P.FieldErrorText,{"data-testid":a("error-text"),negative:u,children:c})]})});B.displayName="TextField";const _e=G.c.bind(K),R="purpur-text-field-ai",D=1400,se=e=>typeof e=="number"?!Number.isNaN(e):typeof e=="string"||Array.isArray(e)?e.length>0:e!=null,Q=r.forwardRef(({["data-testid"]:e,animatePrepopulatedValue:x=!1,typingAnimationDurationMs:s=D,endAdornment:b,value:w,defaultValue:y,onChange:c,disabled:$,readOnly:C,valid:T=!1,negative:N=!1,...F},m)=>{const M=_=>e?`${e}-${_}`:void 0,u=w!==void 0,[S,H]=r.useState(y),[j,O]=r.useState(!1),[A,z]=r.useState(!1),[n,g]=r.useState(!1),[d,t]=r.useState(null),v=r.useRef(null),h=r.useRef(null),a=u?w:S,f=se(a)&&!j,L=d!==null?d:a??"",V=f&&x&&!n&&!$&&!C,p=r.useCallback(()=>{v.current!==null&&(window.clearInterval(v.current),v.current=null)},[]),k=_=>{p(),t(null),u||H(_.currentTarget.value),O(!0),c?.(_)};r.useEffect(()=>{if(!V||typeof IntersectionObserver>"u")return;const _=h.current;if(!_)return;const o=new IntersectionObserver(l=>{l.some(W=>W.isIntersecting)&&(z(!0),g(!0),o.disconnect())},{threshold:.35});return o.observe(_),()=>o.disconnect()},[V]),r.useEffect(()=>{if(!A||j||typeof a!="string")return;if(window.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches||a.length===0){z(!1);return}p(),t("");let o=0;const l=Number.isFinite(s)&&s>0?s:D,I=Math.max(20,Math.floor(l/a.length));return v.current=window.setInterval(()=>{o+=1,t(a.slice(0,o)),o>=a.length&&(p(),t(null),z(!1))},I),p},[p,j,A,s,a]),r.useEffect(()=>p,[p]);const E=[];return b===void 0&&f&&E.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:m,"data-testid":e,...F,endAdornment:b,value:L,onChange:k,disabled:$,readOnly:C,valid:T,negative:N,_styles:K,_rootClassName:R,_prependEndAdornments:E,_inputModifiers:{[`${R}__input--ai`]:f},_frameModifiers:{[`${R}__frame--ai`]:f},_inputContainerRef:h})});Q.displayName="TextField";const pe=["default","ai"],U=r.forwardRef(({variant:e="default",...x},s)=>e==="ai"?i.jsx(Q,{ref:s,...x}):i.jsx(B,{ref:s,...x}));U.displayName="TextField";const oe=e=>r.isValidElement(e)&&e.type.displayName===U.displayName;exports.TextField=U;exports.isTextField=oe;exports.textFieldVariants=pe;
2
- //# sourceMappingURL=text-field-VW8ObP83.js.map
1
+ "use strict";const i=require("react/jsx-runtime"),r=require("react"),X=require("./icon-DNHpBTHs-faYHqTXU.js"),G=require("./bind-DeUYJ6m9.js"),Y=require("./button-DZgtrGqN.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"),ne=require("./label-yHK80hhV.js"),ae=require("./spinner-tKunS_o-.js"),re={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=e=>i.jsx(X.b,{...e,svg:re});J.displayName="IconEditAi";const K={"purpur-text-field-ai":"_purpur-text-field-ai_endw5_1","purpur-text-field-ai__label":"_purpur-text-field-ai__label_endw5_7","purpur-text-field-ai__label-text":"_purpur-text-field-ai__label-text_endw5_12","purpur-text-field-ai__field-row":"_purpur-text-field-ai__field-row_endw5_15","purpur-text-field-ai__frame":"_purpur-text-field-ai__frame_endw5_19","purpur-text-field-ai__frame--negative":"_purpur-text-field-ai__frame--negative_endw5_26","purpur-text-field-ai__input-container":"_purpur-text-field-ai__input-container_endw5_29","purpur-text-field-ai__input-container--disabled":"_purpur-text-field-ai__input-container--disabled_endw5_40","purpur-text-field-ai__input-container--readonly":"_purpur-text-field-ai__input-container--readonly_endw5_43","purpur-text-field-ai__input-container--has-clear-button":"_purpur-text-field-ai__input-container--has-clear-button_endw5_46","purpur-text-field-ai__input-container--end-adornment":"_purpur-text-field-ai__input-container--end-adornment_endw5_49","purpur-text-field-ai__input":"_purpur-text-field-ai__input_endw5_29","purpur-text-field-ai__input-container--start-adornment":"_purpur-text-field-ai__input-container--start-adornment_endw5_55","purpur-text-field-ai__input-container--negative":"_purpur-text-field-ai__input-container--negative_endw5_61","purpur-text-field-ai__valid-icon":"_purpur-text-field-ai__valid-icon_endw5_97","purpur-text-field-ai__valid-icon--negative":"_purpur-text-field-ai__valid-icon--negative_endw5_100","purpur-text-field-ai__frame--ai":"_purpur-text-field-ai__frame--ai_endw5_106","purpur-text-field-ai__ai-icon":"_purpur-text-field-ai__ai-icon_endw5_123","purpur-text-field-ai__input--ai":"_purpur-text-field-ai__input--ai_endw5_180","purpur-text-field-ai__input--valid":"_purpur-text-field-ai__input--valid_endw5_193","purpur-text-field-ai__input--error":"_purpur-text-field-ai__input--error_endw5_193","purpur-text-field-ai__input--negative":"_purpur-text-field-ai__input--negative_endw5_241","purpur-text-field-ai__adornment-container":"_purpur-text-field-ai__adornment-container_endw5_272","purpur-text-field-ai__ai-icon--negative":"_purpur-text-field-ai__ai-icon--negative_endw5_282"},le={"purpur-text-field-default":"_purpur-text-field-default_zmlgg_1","purpur-text-field-default__label":"_purpur-text-field-default__label_zmlgg_7","purpur-text-field-default__label-text":"_purpur-text-field-default__label-text_zmlgg_12","purpur-text-field-default__field-row":"_purpur-text-field-default__field-row_zmlgg_15","purpur-text-field-default__frame":"_purpur-text-field-default__frame_zmlgg_19","purpur-text-field-default__frame--negative":"_purpur-text-field-default__frame--negative_zmlgg_26","purpur-text-field-default__input-container":"_purpur-text-field-default__input-container_zmlgg_29","purpur-text-field-default__input-container--disabled":"_purpur-text-field-default__input-container--disabled_zmlgg_40","purpur-text-field-default__input-container--readonly":"_purpur-text-field-default__input-container--readonly_zmlgg_43","purpur-text-field-default__input-container--has-clear-button":"_purpur-text-field-default__input-container--has-clear-button_zmlgg_46","purpur-text-field-default__input-container--end-adornment":"_purpur-text-field-default__input-container--end-adornment_zmlgg_49","purpur-text-field-default__input":"_purpur-text-field-default__input_zmlgg_29","purpur-text-field-default__input-container--start-adornment":"_purpur-text-field-default__input-container--start-adornment_zmlgg_55","purpur-text-field-default__input-container--negative":"_purpur-text-field-default__input-container--negative_zmlgg_61","purpur-text-field-default__valid-icon":"_purpur-text-field-default__valid-icon_zmlgg_97","purpur-text-field-default__valid-icon--negative":"_purpur-text-field-default__valid-icon--negative_zmlgg_100","purpur-text-field-default__input--valid":"_purpur-text-field-default__input--valid_zmlgg_131","purpur-text-field-default__input--error":"_purpur-text-field-default__input--error_zmlgg_131","purpur-text-field-default__input--negative":"_purpur-text-field-default__input--negative_zmlgg_149","purpur-text-field-default__adornment-container":"_purpur-text-field-default__adornment-container_zmlgg_176"},ue=e=>r.useRef(e),de="purpur-text-field-default",B=r.forwardRef(({["data-testid"]:e,className:x,clearButtonAriaLabel:s,beforeField:b,afterField:w,endAdornment:y,errorText:c,helperText:$,hideRequiredAsterisk:C=!1,label:T,loading:N=!1,onClear:F,startAdornment:m,valid:M=!1,negative:u=!1,_styles:S,_rootClassName:H,_prependEndAdornments:j,_inputModifiers:O,_frameModifiers:A,_inputContainerRef:z,...n},g)=>{const d=G.c.bind(S??le),t=H??de,v=r.useId(),h=n.id??v,a=l=>e?`${e}-${l}`:void 0,Z=M&&!c,f=$?`${h}-helper-text`:void 0,q=Array.isArray(m)?m.filter(l=>!!l):m?[m]:[],V=(typeof n.value=="number"?n.value!==void 0:n.value?.length)&&!n.disabled&&!n.readOnly&&!N&&F&&s,p=ue(null),k=l=>{p.current=l,typeof g=="function"?g(l):g&&(g.current=l)},E=()=>{F?.(),p.current?.focus()},_=[...j??[],N&&i.jsx(ae.Spinner,{disabled:n.disabled,size:"xs","data-testid":a("spinner"),negative:u},"spinner"),V&&i.jsx(Y.Button,{negative:u,variant:"tertiary-purple",onClick:E,iconOnly:!0,"aria-label":s??"","data-testid":a("clear-button"),tabIndex:-1,children:i.jsx(ie.r,{size:"xs"})},"clear-button"),Z&&i.jsx(te.r,{"data-testid":a("valid-icon"),className:d(`${t}__valid-icon`,{[`${t}__valid-icon--negative`]:u})},"valid-icon")].filter(l=>!!l),o=d(`${t}__input-container`,{[`${t}__input-container--start-adornment`]:q.length,[`${t}__input-container--end-adornment`]:_.length||y,[`${t}__input-container--disabled`]:n.disabled,[`${t}__input-container--has-clear-button`]:V,[`${t}__input-container--readonly`]:n.readOnly&&!n.disabled,[`${t}__input-container--negative`]:u});return i.jsxs("div",{className:d(x,t),"data-testid":e,children:[T&&i.jsxs(ne.Label,{htmlFor:h,className:d(`${t}__label`),"data-testid":a("label"),disabled:n.disabled,negative:u,children:[n.required&&!C&&i.jsx("span",{"aria-hidden":!0,children:"*"}),T]}),i.jsxs("div",{className:d(`${t}__field-row`),children:[!!b&&b,i.jsxs("div",{ref:z,className:o,children:[!!q.length&&i.jsx("div",{"data-testid":a("start-adornments"),className:d(`${t}__adornment-container`),children:q.map((l,I)=>i.jsx(r.Fragment,{children:l},I))}),i.jsx("input",{...n,id:h,ref:k,"data-testid":a("input"),"aria-describedby":n["aria-describedby"]||f,"aria-invalid":n["aria-invalid"]||!!c,className:d([`${t}__input`,{[`${t}__input--valid`]:Z,[`${t}__input--error`]:!!c,[`${t}__input--negative`]:u,...O??{}}])}),i.jsx("div",{className:d(`${t}__frame`,{[`${t}__frame--negative`]:u,...A??{}})}),(!!_.length||y)&&i.jsxs("div",{"data-testid":a("end-adornments"),className:d(`${t}__adornment-container`),children:[_,y]})]}),!!w&&w]}),f&&i.jsx(ee.FieldHelperText,{"data-testid":a("helper-text"),id:f,negative:u,disabled:n.disabled,children:$}),c&&i.jsx(P.FieldErrorText,{"data-testid":a("error-text"),negative:u,children:c})]})});B.displayName="TextField";const _e=G.c.bind(K),R="purpur-text-field-ai",D=1400,se=e=>typeof e=="number"?!Number.isNaN(e):typeof e=="string"||Array.isArray(e)?e.length>0:e!=null,Q=r.forwardRef(({["data-testid"]:e,animatePrepopulatedValue:x=!1,typingAnimationDurationMs:s=D,endAdornment:b,value:w,defaultValue:y,onChange:c,disabled:$,readOnly:C,valid:T=!1,negative:N=!1,...F},m)=>{const M=_=>e?`${e}-${_}`:void 0,u=w!==void 0,[S,H]=r.useState(y),[j,O]=r.useState(!1),[A,z]=r.useState(!1),[n,g]=r.useState(!1),[d,t]=r.useState(null),v=r.useRef(null),h=r.useRef(null),a=u?w:S,f=se(a)&&!j,L=d!==null?d:a??"",V=f&&x&&!n&&!$&&!C,p=r.useCallback(()=>{v.current!==null&&(window.clearInterval(v.current),v.current=null)},[]),k=_=>{p(),t(null),u||H(_.currentTarget.value),O(!0),c?.(_)};r.useEffect(()=>{if(!V||typeof IntersectionObserver>"u")return;const _=h.current;if(!_)return;const o=new IntersectionObserver(l=>{l.some(W=>W.isIntersecting)&&(z(!0),g(!0),o.disconnect())},{threshold:.35});return o.observe(_),()=>o.disconnect()},[V]),r.useEffect(()=>{if(!A||j||typeof a!="string")return;if(window.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches||a.length===0){z(!1);return}p(),t("");let o=0;const l=Number.isFinite(s)&&s>0?s:D,I=Math.max(20,Math.floor(l/a.length));return v.current=window.setInterval(()=>{o+=1,t(a.slice(0,o)),o>=a.length&&(p(),t(null),z(!1))},I),p},[p,j,A,s,a]),r.useEffect(()=>p,[p]);const E=[];return b===void 0&&f&&E.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:m,"data-testid":e,...F,endAdornment:b,value:L,onChange:k,disabled:$,readOnly:C,valid:T,negative:N,_styles:K,_rootClassName:R,_prependEndAdornments:E,_inputModifiers:{[`${R}__input--ai`]:f},_frameModifiers:{[`${R}__frame--ai`]:f},_inputContainerRef:h})});Q.displayName="TextField";const pe=["default","ai"],U=r.forwardRef(({variant:e="default",...x},s)=>e==="ai"?i.jsx(Q,{ref:s,...x}):i.jsx(B,{ref:s,...x}));U.displayName="TextField";const oe=e=>r.isValidElement(e)&&e.type.displayName===U.displayName;exports.TextField=U;exports.isTextField=oe;exports.textFieldVariants=pe;
2
+ //# sourceMappingURL=text-field-CS0PT5T6.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-field-VW8ObP83.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[] = Array.isArray(startAdornment)\n ? startAdornment.filter((adornment) => !!adornment)\n : startAdornment\n ? [startAdornment]\n : [];\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)} data-testid={dataTestId}>\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.map((adornment, index) => (\n <React.Fragment key={index}>{adornment}</React.Fragment>\n ))}\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","index","React","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","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,EAAAA,EAAG,CAAE,GAAGF,EAAG,IAAKF,GAAG,EACnDC,EAAE,YAAc,kpICNHI,GAA0BC,GAC9BC,EAAAA,OAAUD,CAAK,ECWlBE,GAAuB,4BAYhBC,EAAgBC,EAAAA,WAI3B,CACE,CACE,CAAC,eAAgBC,EACjB,UAAAC,EACA,qBAAAC,EACA,YAAAC,EACA,WAAAC,EACA,aAAAC,EACA,UAAAC,EACA,WAAAC,EACA,qBAAAC,EAAuB,GAAA,MACvBC,EACA,QAAAC,EAAU,GACV,QAAAC,EACA,eAAAC,EACA,MAAAC,EAAQ,GACR,SAAAC,EAAW,GACX,QAAAC,EACA,eAAAC,EACA,sBAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,mBAAAC,EACA,GAAGC,CAAA,EAELC,IACG,CACH,MAAMC,EAAKC,EAAAA,EAAE,KAAKT,GAAWU,EAAa,EACpCC,EAAgBV,GAAkBnB,GAClC8B,EAAWC,EAAAA,MAAA,EACXC,EAAUR,EAAW,IAAMM,EAC3BG,EAAaC,GAAkB/B,EAAa,GAAGA,CAAU,IAAI+B,CAAI,GAAK,OACtEC,EAAUnB,GAAS,CAACP,EACpB2B,EAAe1B,EAAa,GAAGsB,CAAO,eAAiB,OACvDK,EAA+B,MAAM,QAAQtB,CAAc,EAC7DA,EAAe,OAA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AAuBmE,EACvB,gBAAiB,CAAE,CAAC,GAAGnE,CAAa,aAAa,EAAGsD,CAAA,EACpD,gBAAiB,CAAE,CAAC,GAAGtD,CAAa,aAAa,EAAGsD,CAAA,EACpD,mBAAoBD,CAAA,CAAA,CAG1B,CACF,EAEAtB,EAAoB,YAAc,YC1L3B,MAAMsC,GAAoB,CAAC,UAAW,IAAI,EAuHpCC,EAAYjG,EAAAA,WACvB,CAAC,CAAE,QAAAkG,EAAU,UAAW,GAAGC,CAAA,EAAS5E,IAC9B2E,IAAY,KACPvD,EAAAA,IAACe,EAAA,CAAoB,IAAAnC,EAAW,GAAG4E,CAAA,CAAO,EAG5CxD,EAAAA,IAAC5C,EAAA,CAAc,IAAAwB,EAAW,GAAG4E,CAAA,CAAO,CAE/C,EAEAF,EAAU,YAAc,YAEjB,MAAMG,GAAeC,GAC1BC,iBAA+BD,CAAK,GACnCA,EAAM,KAAa,cAAgBJ,EAAU"}
1
+ {"version":3,"file":"text-field-CS0PT5T6.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[] = Array.isArray(startAdornment)\n ? startAdornment.filter((adornment) => !!adornment)\n : startAdornment\n ? [startAdornment]\n : [];\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)} data-testid={dataTestId}>\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.map((adornment, index) => (\n <React.Fragment key={index}>{adornment}</React.Fragment>\n ))}\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","index","React","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","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,EAAAA,EAAG,CAAE,GAAGF,EAAG,IAAKF,GAAG,EACnDC,EAAE,YAAc,kpICNHI,GAA0BC,GAC9BC,EAAAA,OAAUD,CAAK,ECWlBE,GAAuB,4BAYhBC,EAAgBC,EAAAA,WAI3B,CACE,CACE,CAAC,eAAgBC,EACjB,UAAAC,EACA,qBAAAC,EACA,YAAAC,EACA,WAAAC,EACA,aAAAC,EACA,UAAAC,EACA,WAAAC,EACA,qBAAAC,EAAuB,GAAA,MACvBC,EACA,QAAAC,EAAU,GACV,QAAAC,EACA,eAAAC,EACA,MAAAC,EAAQ,GACR,SAAAC,EAAW,GACX,QAAAC,EACA,eAAAC,EACA,sBAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,mBAAAC,EACA,GAAGC,CAAA,EAELC,IACG,CACH,MAAMC,EAAKC,EAAAA,EAAE,KAAKT,GAAWU,EAAa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ACzC,CAAC,GAAGA,CAAa,qBAAqB,EAAGZ,CAAA,CAC1C,CAAA,EALG,SAAA,CAMN,EAKF4B,EAAAA,IAAC5C,EAAA,CACC,IAAAwB,EACA,cAAatB,EACZ,GAAGiE,EACJ,aAAA5D,EACA,MAAO4E,EACP,SAAUI,EACV,SAAAtB,EACA,SAAAC,EACA,MAAAnD,EACA,SAAAC,EACA,QAASwC,EACT,eAAgB5B,EAChB,sBAAuBmE,EACvB,gBAAiB,CAAE,CAAC,GAAGnE,CAAa,aAAa,EAAGsD,CAAA,EACpD,gBAAiB,CAAE,CAAC,GAAGtD,CAAa,aAAa,EAAGsD,CAAA,EACpD,mBAAoBD,CAAA,CAAA,CAG1B,CACF,EAEAtB,EAAoB,YAAc,YC1L3B,MAAMsC,GAAoB,CAAC,UAAW,IAAI,EAuHpCC,EAAYjG,EAAAA,WACvB,CAAC,CAAE,QAAAkG,EAAU,UAAW,GAAGC,CAAA,EAAS5E,IAC9B2E,IAAY,KACPvD,EAAAA,IAACe,EAAA,CAAoB,IAAAnC,EAAW,GAAG4E,CAAA,CAAO,EAG5CxD,EAAAA,IAAC5C,EAAA,CAAc,IAAAwB,EAAW,GAAG4E,CAAA,CAAO,CAE/C,EAEAF,EAAU,YAAc,YAEjB,MAAMG,GAAeC,GAC1BC,iBAA+BD,CAAK,GACnCA,EAAM,KAAa,cAAgBJ,EAAU"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./text-field-VW8ObP83.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-CS0PT5T6.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-D0e-cRbG.mjs";
1
+ import { T as i, i as a, t as s } from "./text-field-C9LX7LBf.mjs";
2
2
  export {
3
3
  i as TextField,
4
4
  a as isTextField,
@@ -1,2 +1,2 @@
1
- "use strict";const p=require("react/jsx-runtime"),Y=require("react"),le=require("./button-DmybVApa.js"),at=require("./info.es-Br84jly5.js"),ue=require("./paragraph-B8HFdNne.js"),ct=require("./variables-BSBunpiY.js");require("./ThemeProvider-BJGm3zai.js");const lt=require("./useThemePortalContainer-CUcqV327.js"),he=require("react-dom"),T=require("./floating-ui.react-dom-Cc_YSprQ.js"),ut=require("./bind-DeUYJ6m9.js");function ve(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const s=ve(Y),dt=ve(he);function _(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function de(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function me(...e){return t=>{let n=!1;const r=e.map(o=>{const i=de(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():de(e[o],null)}}}}function S(...e){return s.useCallback(me(...e),e)}function ye(e,t=[]){let n=[];function r(i,a){const u=s.createContext(a),c=n.length;n=[...n,a];const l=f=>{const{scope:v,children:h,...m}=f,y=v?.[e]?.[c]||u,x=s.useMemo(()=>m,Object.values(m));return p.jsx(y.Provider,{value:x,children:h})};l.displayName=i+"Provider";function d(f,v){const h=v?.[e]?.[c]||u,m=s.useContext(h);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[l,d]}const o=()=>{const i=n.map(a=>s.createContext(a));return function(u){const c=u?.[e]||i;return s.useMemo(()=>({[`__scope${e}`]:{...u,[e]:c}}),[u,c])}};return o.scopeName=e,[r,pt(o,...t)]}function pt(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=r.reduce((u,{useScope:c,scopeName:l})=>{const f=c(i)[`__scope${l}`];return{...u,...f}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var ge=s.forwardRef((e,t)=>{const{children:n,...r}=e,o=s.Children.toArray(n),i=o.find(ft);if(i){const a=i.props.children,u=o.map(c=>c===i?s.Children.count(a)>1?s.Children.only(null):s.isValidElement(a)?a.props.children:null:c);return p.jsx(X,{...r,ref:t,children:s.isValidElement(a)?s.cloneElement(a,void 0,u):null})}return p.jsx(X,{...r,ref:t,children:n})});ge.displayName="Slot";var X=s.forwardRef((e,t)=>{const{children:n,...r}=e;if(s.isValidElement(n)){const o=vt(n),i=ht(r,n.props);return n.type!==s.Fragment&&(i.ref=t?me(t,o):o),s.cloneElement(n,i)}return s.Children.count(n)>1?s.Children.only(null):null});X.displayName="SlotClone";var xe=({children:e})=>p.jsx(p.Fragment,{children:e});function ft(e){return s.isValidElement(e)&&e.type===xe}function ht(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...u)=>{i(...u),o(...u)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function vt(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var mt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],A=mt.reduce((e,t)=>{const n=s.forwardRef((r,o)=>{const{asChild:i,...a}=r,u=i?ge:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(u,{...a,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function yt(e,t){e&&dt.flushSync(()=>e.dispatchEvent(t))}function j(e){const t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>(...n)=>t.current?.(...n),[])}function gt(e,t=globalThis?.document){const n=j(e);s.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var xt="DismissableLayer",K="dismissableLayer.update",wt="dismissableLayer.pointerDownOutside",Pt="dismissableLayer.focusOutside",pe,we=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Pe=s.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:u,...c}=e,l=s.useContext(we),[d,f]=s.useState(null),v=d?.ownerDocument??globalThis?.document,[,h]=s.useState({}),m=S(t,g=>f(g)),y=Array.from(l.layers),[x]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),P=y.indexOf(x),w=d?y.indexOf(d):-1,C=l.layersWithOutsidePointerEventsDisabled.size>0,E=w>=P,b=bt(g=>{const R=g.target,$=[...l.branches].some(k=>k.contains(R));!E||$||(o?.(g),a?.(g),g.defaultPrevented||u?.())},v),O=Tt(g=>{const R=g.target;[...l.branches].some(k=>k.contains(R))||(i?.(g),a?.(g),g.defaultPrevented||u?.())},v);return gt(g=>{w===l.layers.size-1&&(r?.(g),!g.defaultPrevented&&u&&(g.preventDefault(),u()))},v),s.useEffect(()=>{if(d)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(pe=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(d)),l.layers.add(d),fe(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=pe)}},[d,v,n,l]),s.useEffect(()=>()=>{d&&(l.layers.delete(d),l.layersWithOutsidePointerEventsDisabled.delete(d),fe())},[d,l]),s.useEffect(()=>{const g=()=>h({});return document.addEventListener(K,g),()=>document.removeEventListener(K,g)},[]),p.jsx(A.div,{...c,ref:m,style:{pointerEvents:C?E?"auto":"none":void 0,...e.style},onFocusCapture:_(e.onFocusCapture,O.onFocusCapture),onBlurCapture:_(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:_(e.onPointerDownCapture,b.onPointerDownCapture)})});Pe.displayName=xt;var Et="DismissableLayerBranch",Ct=s.forwardRef((e,t)=>{const n=s.useContext(we),r=s.useRef(null),o=S(t,r);return s.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),p.jsx(A.div,{...e,ref:o})});Ct.displayName=Et;function bt(e,t=globalThis?.document){const n=j(e),r=s.useRef(!1),o=s.useRef(()=>{});return s.useEffect(()=>{const i=u=>{if(u.target&&!r.current){let c=function(){Ee(wt,n,l,{discrete:!0})};const l={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Tt(e,t=globalThis?.document){const n=j(e),r=s.useRef(!1);return s.useEffect(()=>{const o=i=>{i.target&&!r.current&&Ee(Pt,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function fe(){const e=new CustomEvent(K);document.dispatchEvent(e)}function Ee(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?yt(o,i):o.dispatchEvent(i)}var N=globalThis?.document?s.useLayoutEffect:()=>{},_t=s.useId||(()=>{}),Ot=0;function At(e){const[t,n]=s.useState(_t());return N(()=>{n(r=>r??String(Ot++))},[e]),t?`radix-${t}`:""}var Rt="Arrow",Ce=s.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return p.jsx(A.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ce.displayName=Rt;var Nt=Ce;function St(e){const[t,n]=s.useState(void 0);return N(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let a,u;if("borderBoxSize"in i){const c=i.borderBoxSize,l=Array.isArray(c)?c[0]:c;a=l.inlineSize,u=l.blockSize}else a=e.offsetWidth,u=e.offsetHeight;n({width:a,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Q="Popper",[be,Te]=ye(Q),[Dt,_e]=be(Q),Oe=e=>{const{__scopePopper:t,children:n}=e,[r,o]=s.useState(null);return p.jsx(Dt,{scope:t,anchor:r,onAnchorChange:o,children:n})};Oe.displayName=Q;var Ae="PopperAnchor",Re=s.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=_e(Ae,n),a=s.useRef(null),u=S(t,a);return s.useEffect(()=>{i.onAnchorChange(r?.current||a.current)}),r?null:p.jsx(A.div,{...o,ref:u})});Re.displayName=Ae;var ee="PopperContent",[Lt,It]=be(ee),Ne=s.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:a=0,arrowPadding:u=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:v=!1,updatePositionStrategy:h="optimized",onPlaced:m,...y}=e,x=_e(ee,n),[P,w]=s.useState(null),C=S(t,M=>w(M)),[E,b]=s.useState(null),O=St(E),g=O?.width??0,R=O?.height??0,$=r+(i!=="center"?"-"+i:""),k=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},oe=Array.isArray(l)?l:[l],Ye=oe.length>0,H={padding:k,boundary:oe.filter(kt),altBoundary:Ye},{refs:Xe,floatingStyles:se,placement:Ke,isPositioned:W,middlewareData:D}=T.useFloating({strategy:"fixed",placement:$,whileElementsMounted:(...M)=>T.autoUpdate(...M,{animationFrame:h==="always"}),elements:{reference:x.anchor},middleware:[T.offset({mainAxis:o+R,alignmentAxis:a}),c&&T.shift({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?T.limitShift():void 0,...H}),c&&T.flip({...H}),T.size({...H,apply:({elements:M,rects:ce,availableWidth:rt,availableHeight:ot})=>{const{width:st,height:it}=ce.reference,B=M.floating.style;B.setProperty("--radix-popper-available-width",`${rt}px`),B.setProperty("--radix-popper-available-height",`${ot}px`),B.setProperty("--radix-popper-anchor-width",`${st}px`),B.setProperty("--radix-popper-anchor-height",`${it}px`)}}),E&&T.arrow({element:E,padding:u}),Mt({arrowWidth:g,arrowHeight:R}),v&&T.hide({strategy:"referenceHidden",...H})]}),[ie,Ze]=Le(Ke),ae=j(m);N(()=>{W&&ae?.()},[W,ae]);const Je=D.arrow?.x,Qe=D.arrow?.y,et=D.arrow?.centerOffset!==0,[tt,nt]=s.useState();return N(()=>{P&&nt(window.getComputedStyle(P).zIndex)},[P]),p.jsx("div",{ref:Xe.setFloating,"data-radix-popper-content-wrapper":"",style:{...se,transform:W?se.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:tt,"--radix-popper-transform-origin":[D.transformOrigin?.x,D.transformOrigin?.y].join(" "),...D.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(Lt,{scope:n,placedSide:ie,onArrowChange:b,arrowX:Je,arrowY:Qe,shouldHideArrow:et,children:p.jsx(A.div,{"data-side":ie,"data-align":Ze,...y,ref:C,style:{...y.style,animation:W?void 0:"none"}})})})});Ne.displayName=ee;var Se="PopperArrow",jt={top:"bottom",right:"left",bottom:"top",left:"right"},De=s.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=It(Se,r),a=jt[i.placedSide];return p.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:p.jsx(Nt,{...o,ref:n,style:{...o.style,display:"block"}})})});De.displayName=Se;function kt(e){return e!==null}var Mt=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,a=o.arrow?.centerOffset!==0,u=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[l,d]=Le(n),f={start:"0%",center:"50%",end:"100%"}[d],v=(o.arrow?.x??0)+u/2,h=(o.arrow?.y??0)+c/2;let m="",y="";return l==="bottom"?(m=a?f:`${v}px`,y=`${-c}px`):l==="top"?(m=a?f:`${v}px`,y=`${r.floating.height+c}px`):l==="right"?(m=`${-c}px`,y=a?f:`${h}px`):l==="left"&&(m=`${r.floating.width+c}px`,y=a?f:`${h}px`),{data:{x:m,y}}}});function Le(e){const[t,n="center"]=e.split("-");return[t,n]}var Ft=Oe,$t=Re,Ht=Ne,Wt=De,Bt="Portal",Ie=s.forwardRef((e,t)=>{const{container:n,...r}=e,[o,i]=s.useState(!1);N(()=>i(!0),[]);const a=n||o&&globalThis?.document?.body;return a?he.createPortal(p.jsx(A.div,{...r,ref:t}),a):null});Ie.displayName=Bt;function Ut(e,t){return s.useReducer((n,r)=>t[n][r]??n,e)}var te=e=>{const{present:t,children:n}=e,r=zt(t),o=typeof n=="function"?n({present:r.isPresent}):s.Children.only(n),i=S(r.ref,qt(o));return typeof n=="function"||r.isPresent?s.cloneElement(o,{ref:i}):null};te.displayName="Presence";function zt(e){const[t,n]=s.useState(),r=s.useRef({}),o=s.useRef(e),i=s.useRef("none"),a=e?"mounted":"unmounted",[u,c]=Ut(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{const l=U(r.current);i.current=u==="mounted"?l:"none"},[u]),N(()=>{const l=r.current,d=o.current;if(d!==e){const v=i.current,h=U(l);e?c("MOUNT"):h==="none"||l?.display==="none"?c("UNMOUNT"):c(d&&v!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),N(()=>{if(t){let l;const d=t.ownerDocument.defaultView??window,f=h=>{const y=U(r.current).includes(h.animationName);if(h.target===t&&y&&(c("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",l=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},v=h=>{h.target===t&&(i.current=U(r.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(l),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:s.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function U(e){return e?.animationName||"none"}function qt(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Vt({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Gt({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:r,u=j(n),c=s.useCallback(l=>{if(i){const f=typeof l=="function"?l(e):l;f!==e&&u(f)}else o(l)},[i,e,o,u]);return[a,c]}function Gt({defaultProp:e,onChange:t}){const n=s.useState(e),[r]=n,o=s.useRef(r),i=j(t);return s.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var Yt="VisuallyHidden",je=s.forwardRef((e,t)=>p.jsx(A.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));je.displayName=Yt;var Xt=je,[z]=ye("Tooltip",[Te]),q=Te(),ke="TooltipProvider",Kt=700,Z="tooltip.open",[Zt,ne]=z(ke),Me=e=>{const{__scopeTooltip:t,delayDuration:n=Kt,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[a,u]=s.useState(!0),c=s.useRef(!1),l=s.useRef(0);return s.useEffect(()=>{const d=l.current;return()=>window.clearTimeout(d)},[]),p.jsx(Zt,{scope:t,isOpenDelayed:a,delayDuration:n,onOpen:s.useCallback(()=>{window.clearTimeout(l.current),u(!1)},[]),onClose:s.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>u(!0),r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:s.useCallback(d=>{c.current=d},[]),disableHoverableContent:o,children:i})};Me.displayName=ke;var V="Tooltip",[Jt,F]=z(V),Fe=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:a,delayDuration:u}=e,c=ne(V,e.__scopeTooltip),l=q(t),[d,f]=s.useState(null),v=At(),h=s.useRef(0),m=a??c.disableHoverableContent,y=u??c.delayDuration,x=s.useRef(!1),[P=!1,w]=Vt({prop:r,defaultProp:o,onChange:g=>{g?(c.onOpen(),document.dispatchEvent(new CustomEvent(Z))):c.onClose(),i?.(g)}}),C=s.useMemo(()=>P?x.current?"delayed-open":"instant-open":"closed",[P]),E=s.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x.current=!1,w(!0)},[w]),b=s.useCallback(()=>{window.clearTimeout(h.current),h.current=0,w(!1)},[w]),O=s.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{x.current=!0,w(!0),h.current=0},y)},[y,w]);return s.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),p.jsx(Ft,{...l,children:p.jsx(Jt,{scope:t,contentId:v,open:P,stateAttribute:C,trigger:d,onTriggerChange:f,onTriggerEnter:s.useCallback(()=>{c.isOpenDelayed?O():E()},[c.isOpenDelayed,O,E]),onTriggerLeave:s.useCallback(()=>{m?b():(window.clearTimeout(h.current),h.current=0)},[b,m]),onOpen:E,onClose:b,disableHoverableContent:m,children:n})})};Fe.displayName=V;var J="TooltipTrigger",$e=s.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=F(J,n),i=ne(J,n),a=q(n),u=s.useRef(null),c=S(t,u,o.onTriggerChange),l=s.useRef(!1),d=s.useRef(!1),f=s.useCallback(()=>l.current=!1,[]);return s.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),p.jsx($t,{asChild:!0,...a,children:p.jsx(A.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:c,onPointerMove:_(e.onPointerMove,v=>{v.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:_(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:_(e.onPointerDown,()=>{l.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:_(e.onFocus,()=>{l.current||o.onOpen()}),onBlur:_(e.onBlur,o.onClose),onClick:_(e.onClick,o.onClose)})})});$e.displayName=J;var re="TooltipPortal",[Qt,en]=z(re,{forceMount:void 0}),He=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,i=F(re,t);return p.jsx(Qt,{scope:t,forceMount:n,children:p.jsx(te,{present:n||i.open,children:p.jsx(Ie,{asChild:!0,container:o,children:r})})})};He.displayName=re;var I="TooltipContent",We=s.forwardRef((e,t)=>{const n=en(I,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,a=F(I,e.__scopeTooltip);return p.jsx(te,{present:r||a.open,children:a.disableHoverableContent?p.jsx(Be,{side:o,...i,ref:t}):p.jsx(tn,{side:o,...i,ref:t})})}),tn=s.forwardRef((e,t)=>{const n=F(I,e.__scopeTooltip),r=ne(I,e.__scopeTooltip),o=s.useRef(null),i=S(t,o),[a,u]=s.useState(null),{trigger:c,onClose:l}=n,d=o.current,{onPointerInTransitChange:f}=r,v=s.useCallback(()=>{u(null),f(!1)},[f]),h=s.useCallback((m,y)=>{const x=m.currentTarget,P={x:m.clientX,y:m.clientY},w=on(P,x.getBoundingClientRect()),C=sn(P,w),E=an(y.getBoundingClientRect()),b=ln([...C,...E]);u(b),f(!0)},[f]);return s.useEffect(()=>()=>v(),[v]),s.useEffect(()=>{if(c&&d){const m=x=>h(x,d),y=x=>h(x,c);return c.addEventListener("pointerleave",m),d.addEventListener("pointerleave",y),()=>{c.removeEventListener("pointerleave",m),d.removeEventListener("pointerleave",y)}}},[c,d,h,v]),s.useEffect(()=>{if(a){const m=y=>{const x=y.target,P={x:y.clientX,y:y.clientY},w=c?.contains(x)||d?.contains(x),C=!cn(P,a);w?v():C&&(v(),l())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[c,d,a,l,v]),p.jsx(Be,{...e,ref:i})}),[nn,rn]=z(V,{isInside:!1}),Be=s.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:a,...u}=e,c=F(I,n),l=q(n),{onClose:d}=c;return s.useEffect(()=>(document.addEventListener(Z,d),()=>document.removeEventListener(Z,d)),[d]),s.useEffect(()=>{if(c.trigger){const f=v=>{v.target?.contains(c.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,d]),p.jsx(Pe,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:p.jsxs(Ht,{"data-state":c.stateAttribute,...l,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[p.jsx(xe,{children:r}),p.jsx(nn,{scope:n,isInside:!0,children:p.jsx(Xt,{id:c.contentId,role:"tooltip",children:o||r})})]})})});We.displayName=I;var Ue="TooltipArrow",ze=s.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=q(n);return rn(Ue,n).isInside?null:p.jsx(Wt,{...o,...r,ref:t})});ze.displayName=Ue;function on(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function sn(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function an(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function cn(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const u=t[i].x,c=t[i].y,l=t[a].x,d=t[a].y;c>r!=d>r&&n<(l-u)*(r-c)/(d-c)+u&&(o=!o)}return o}function ln(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),un(t)}function un(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],a=t[t.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var dn=Me,pn=Fe,fn=$e,hn=He,vn=We,mn=ze;const yn="_slideDownAndFade_fkagk_1",gn="_slideLeftAndFade_fkagk_1",xn="_slideUpAndFade_fkagk_1",wn="_slideRightAndFade_fkagk_1",Pn={"purpur-tooltip":"_purpur-tooltip_fkagk_1","purpur-tooltip__content":"_purpur-tooltip__content_fkagk_4","purpur-tooltip__content--primary":"_purpur-tooltip__content--primary_fkagk_14","purpur-tooltip__content--primary-negative":"_purpur-tooltip__content--primary-negative_fkagk_17",slideDownAndFade:yn,slideLeftAndFade:gn,slideUpAndFade:xn,slideRightAndFade:wn,"purpur-tooltip__arrow--primary":"_purpur-tooltip__arrow--primary_fkagk_32","purpur-tooltip__arrow--primary-negative":"_purpur-tooltip__arrow--primary-negative_fkagk_35"},G=ut.c.bind(Pn),qe={TOP:"top",BOTTOM:"bottom",LEFT:"left",RIGHT:"right"},Ve={START:"start",CENTER:"center",END:"end"},L="purpur-tooltip",Ge=Y.forwardRef(({["data-testid"]:e,buttonSize:t="md",children:n,className:r,container:o,contentClassName:i,negative:a=!1,position:u=qe.TOP,align:c=Ve.CENTER,triggerAriaLabel:l,triggerElement:d,...f},v)=>{const[h,m]=Y.useState(!1),y=lt.useThemePortalContainer(),x=o===void 0?y:o??void 0,P=G(r,L,`${L}--primary${a?"-negative":""}`),w=p.jsx(le.Button,{ref:v,"aria-label":l??"","aria-expanded":h,variant:le.BUTTON_VARIANT.TERTIARY_PURPLE,negative:a,iconOnly:!0,"data-testid":`${e}-trigger-button`,size:t,children:p.jsx(at.r,{size:"md"})});return p.jsx("div",{"data-testid":e,className:P,children:p.jsx(dn,{delayDuration:parseInt(ct.purpurMotionDuration400),children:p.jsxs(pn,{open:h,onOpenChange:m,...f,children:[p.jsx(fn,{asChild:!0,onClick:C=>{C.preventDefault(),m(!0)},children:d??w}),p.jsx(hn,{container:x,children:p.jsxs(vn,{side:u,align:c,className:G(i,`${L}__content`,`${L}__content--primary${a?"-negative":""}`),sideOffset:-5,"data-testid":`${e}-content`,children:[typeof n=="string"?p.jsx(ue.Paragraph,{variant:ue.ParagraphVariant.PARAGRAPH100,negative:!a,"data-testid":`${e}-paragraph`,children:n}):n,p.jsx(mn,{className:G(`${L}__arrow`,`${L}__arrow--primary${a?"-negative":""}`)})]})})]})})})});Ge.displayName="Tooltip";exports.TOOLTIP_ALIGN=Ve;exports.TOOLTIP_POSITION=qe;exports.Tooltip=Ge;
2
- //# sourceMappingURL=tooltip-B-11qk-0.js.map
1
+ "use strict";const p=require("react/jsx-runtime"),Y=require("react"),le=require("./button-DZgtrGqN.js"),at=require("./info.es-Br84jly5.js"),ue=require("./paragraph-B8HFdNne.js"),ct=require("./variables-BSBunpiY.js");require("./ThemeProvider-BJGm3zai.js");const lt=require("./useThemePortalContainer-CUcqV327.js"),he=require("react-dom"),T=require("./floating-ui.react-dom-Cc_YSprQ.js"),ut=require("./bind-DeUYJ6m9.js");function ve(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const s=ve(Y),dt=ve(he);function _(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function de(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function me(...e){return t=>{let n=!1;const r=e.map(o=>{const i=de(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():de(e[o],null)}}}}function S(...e){return s.useCallback(me(...e),e)}function ye(e,t=[]){let n=[];function r(i,a){const u=s.createContext(a),c=n.length;n=[...n,a];const l=f=>{const{scope:v,children:h,...m}=f,y=v?.[e]?.[c]||u,x=s.useMemo(()=>m,Object.values(m));return p.jsx(y.Provider,{value:x,children:h})};l.displayName=i+"Provider";function d(f,v){const h=v?.[e]?.[c]||u,m=s.useContext(h);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[l,d]}const o=()=>{const i=n.map(a=>s.createContext(a));return function(u){const c=u?.[e]||i;return s.useMemo(()=>({[`__scope${e}`]:{...u,[e]:c}}),[u,c])}};return o.scopeName=e,[r,pt(o,...t)]}function pt(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=r.reduce((u,{useScope:c,scopeName:l})=>{const f=c(i)[`__scope${l}`];return{...u,...f}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var ge=s.forwardRef((e,t)=>{const{children:n,...r}=e,o=s.Children.toArray(n),i=o.find(ft);if(i){const a=i.props.children,u=o.map(c=>c===i?s.Children.count(a)>1?s.Children.only(null):s.isValidElement(a)?a.props.children:null:c);return p.jsx(X,{...r,ref:t,children:s.isValidElement(a)?s.cloneElement(a,void 0,u):null})}return p.jsx(X,{...r,ref:t,children:n})});ge.displayName="Slot";var X=s.forwardRef((e,t)=>{const{children:n,...r}=e;if(s.isValidElement(n)){const o=vt(n),i=ht(r,n.props);return n.type!==s.Fragment&&(i.ref=t?me(t,o):o),s.cloneElement(n,i)}return s.Children.count(n)>1?s.Children.only(null):null});X.displayName="SlotClone";var xe=({children:e})=>p.jsx(p.Fragment,{children:e});function ft(e){return s.isValidElement(e)&&e.type===xe}function ht(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...u)=>{i(...u),o(...u)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function vt(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var mt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],A=mt.reduce((e,t)=>{const n=s.forwardRef((r,o)=>{const{asChild:i,...a}=r,u=i?ge:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(u,{...a,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function yt(e,t){e&&dt.flushSync(()=>e.dispatchEvent(t))}function j(e){const t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>(...n)=>t.current?.(...n),[])}function gt(e,t=globalThis?.document){const n=j(e);s.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var xt="DismissableLayer",K="dismissableLayer.update",wt="dismissableLayer.pointerDownOutside",Pt="dismissableLayer.focusOutside",pe,we=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Pe=s.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:u,...c}=e,l=s.useContext(we),[d,f]=s.useState(null),v=d?.ownerDocument??globalThis?.document,[,h]=s.useState({}),m=S(t,g=>f(g)),y=Array.from(l.layers),[x]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),P=y.indexOf(x),w=d?y.indexOf(d):-1,C=l.layersWithOutsidePointerEventsDisabled.size>0,E=w>=P,b=bt(g=>{const R=g.target,$=[...l.branches].some(k=>k.contains(R));!E||$||(o?.(g),a?.(g),g.defaultPrevented||u?.())},v),O=Tt(g=>{const R=g.target;[...l.branches].some(k=>k.contains(R))||(i?.(g),a?.(g),g.defaultPrevented||u?.())},v);return gt(g=>{w===l.layers.size-1&&(r?.(g),!g.defaultPrevented&&u&&(g.preventDefault(),u()))},v),s.useEffect(()=>{if(d)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(pe=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(d)),l.layers.add(d),fe(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=pe)}},[d,v,n,l]),s.useEffect(()=>()=>{d&&(l.layers.delete(d),l.layersWithOutsidePointerEventsDisabled.delete(d),fe())},[d,l]),s.useEffect(()=>{const g=()=>h({});return document.addEventListener(K,g),()=>document.removeEventListener(K,g)},[]),p.jsx(A.div,{...c,ref:m,style:{pointerEvents:C?E?"auto":"none":void 0,...e.style},onFocusCapture:_(e.onFocusCapture,O.onFocusCapture),onBlurCapture:_(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:_(e.onPointerDownCapture,b.onPointerDownCapture)})});Pe.displayName=xt;var Et="DismissableLayerBranch",Ct=s.forwardRef((e,t)=>{const n=s.useContext(we),r=s.useRef(null),o=S(t,r);return s.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),p.jsx(A.div,{...e,ref:o})});Ct.displayName=Et;function bt(e,t=globalThis?.document){const n=j(e),r=s.useRef(!1),o=s.useRef(()=>{});return s.useEffect(()=>{const i=u=>{if(u.target&&!r.current){let c=function(){Ee(wt,n,l,{discrete:!0})};const l={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Tt(e,t=globalThis?.document){const n=j(e),r=s.useRef(!1);return s.useEffect(()=>{const o=i=>{i.target&&!r.current&&Ee(Pt,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function fe(){const e=new CustomEvent(K);document.dispatchEvent(e)}function Ee(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?yt(o,i):o.dispatchEvent(i)}var N=globalThis?.document?s.useLayoutEffect:()=>{},_t=s.useId||(()=>{}),Ot=0;function At(e){const[t,n]=s.useState(_t());return N(()=>{n(r=>r??String(Ot++))},[e]),t?`radix-${t}`:""}var Rt="Arrow",Ce=s.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return p.jsx(A.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ce.displayName=Rt;var Nt=Ce;function St(e){const[t,n]=s.useState(void 0);return N(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let a,u;if("borderBoxSize"in i){const c=i.borderBoxSize,l=Array.isArray(c)?c[0]:c;a=l.inlineSize,u=l.blockSize}else a=e.offsetWidth,u=e.offsetHeight;n({width:a,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Q="Popper",[be,Te]=ye(Q),[Dt,_e]=be(Q),Oe=e=>{const{__scopePopper:t,children:n}=e,[r,o]=s.useState(null);return p.jsx(Dt,{scope:t,anchor:r,onAnchorChange:o,children:n})};Oe.displayName=Q;var Ae="PopperAnchor",Re=s.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=_e(Ae,n),a=s.useRef(null),u=S(t,a);return s.useEffect(()=>{i.onAnchorChange(r?.current||a.current)}),r?null:p.jsx(A.div,{...o,ref:u})});Re.displayName=Ae;var ee="PopperContent",[Lt,It]=be(ee),Ne=s.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:a=0,arrowPadding:u=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:v=!1,updatePositionStrategy:h="optimized",onPlaced:m,...y}=e,x=_e(ee,n),[P,w]=s.useState(null),C=S(t,M=>w(M)),[E,b]=s.useState(null),O=St(E),g=O?.width??0,R=O?.height??0,$=r+(i!=="center"?"-"+i:""),k=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},oe=Array.isArray(l)?l:[l],Ye=oe.length>0,H={padding:k,boundary:oe.filter(kt),altBoundary:Ye},{refs:Xe,floatingStyles:se,placement:Ke,isPositioned:W,middlewareData:D}=T.useFloating({strategy:"fixed",placement:$,whileElementsMounted:(...M)=>T.autoUpdate(...M,{animationFrame:h==="always"}),elements:{reference:x.anchor},middleware:[T.offset({mainAxis:o+R,alignmentAxis:a}),c&&T.shift({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?T.limitShift():void 0,...H}),c&&T.flip({...H}),T.size({...H,apply:({elements:M,rects:ce,availableWidth:rt,availableHeight:ot})=>{const{width:st,height:it}=ce.reference,B=M.floating.style;B.setProperty("--radix-popper-available-width",`${rt}px`),B.setProperty("--radix-popper-available-height",`${ot}px`),B.setProperty("--radix-popper-anchor-width",`${st}px`),B.setProperty("--radix-popper-anchor-height",`${it}px`)}}),E&&T.arrow({element:E,padding:u}),Mt({arrowWidth:g,arrowHeight:R}),v&&T.hide({strategy:"referenceHidden",...H})]}),[ie,Ze]=Le(Ke),ae=j(m);N(()=>{W&&ae?.()},[W,ae]);const Je=D.arrow?.x,Qe=D.arrow?.y,et=D.arrow?.centerOffset!==0,[tt,nt]=s.useState();return N(()=>{P&&nt(window.getComputedStyle(P).zIndex)},[P]),p.jsx("div",{ref:Xe.setFloating,"data-radix-popper-content-wrapper":"",style:{...se,transform:W?se.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:tt,"--radix-popper-transform-origin":[D.transformOrigin?.x,D.transformOrigin?.y].join(" "),...D.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(Lt,{scope:n,placedSide:ie,onArrowChange:b,arrowX:Je,arrowY:Qe,shouldHideArrow:et,children:p.jsx(A.div,{"data-side":ie,"data-align":Ze,...y,ref:C,style:{...y.style,animation:W?void 0:"none"}})})})});Ne.displayName=ee;var Se="PopperArrow",jt={top:"bottom",right:"left",bottom:"top",left:"right"},De=s.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=It(Se,r),a=jt[i.placedSide];return p.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:p.jsx(Nt,{...o,ref:n,style:{...o.style,display:"block"}})})});De.displayName=Se;function kt(e){return e!==null}var Mt=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,a=o.arrow?.centerOffset!==0,u=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[l,d]=Le(n),f={start:"0%",center:"50%",end:"100%"}[d],v=(o.arrow?.x??0)+u/2,h=(o.arrow?.y??0)+c/2;let m="",y="";return l==="bottom"?(m=a?f:`${v}px`,y=`${-c}px`):l==="top"?(m=a?f:`${v}px`,y=`${r.floating.height+c}px`):l==="right"?(m=`${-c}px`,y=a?f:`${h}px`):l==="left"&&(m=`${r.floating.width+c}px`,y=a?f:`${h}px`),{data:{x:m,y}}}});function Le(e){const[t,n="center"]=e.split("-");return[t,n]}var Ft=Oe,$t=Re,Ht=Ne,Wt=De,Bt="Portal",Ie=s.forwardRef((e,t)=>{const{container:n,...r}=e,[o,i]=s.useState(!1);N(()=>i(!0),[]);const a=n||o&&globalThis?.document?.body;return a?he.createPortal(p.jsx(A.div,{...r,ref:t}),a):null});Ie.displayName=Bt;function Ut(e,t){return s.useReducer((n,r)=>t[n][r]??n,e)}var te=e=>{const{present:t,children:n}=e,r=zt(t),o=typeof n=="function"?n({present:r.isPresent}):s.Children.only(n),i=S(r.ref,qt(o));return typeof n=="function"||r.isPresent?s.cloneElement(o,{ref:i}):null};te.displayName="Presence";function zt(e){const[t,n]=s.useState(),r=s.useRef({}),o=s.useRef(e),i=s.useRef("none"),a=e?"mounted":"unmounted",[u,c]=Ut(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{const l=U(r.current);i.current=u==="mounted"?l:"none"},[u]),N(()=>{const l=r.current,d=o.current;if(d!==e){const v=i.current,h=U(l);e?c("MOUNT"):h==="none"||l?.display==="none"?c("UNMOUNT"):c(d&&v!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),N(()=>{if(t){let l;const d=t.ownerDocument.defaultView??window,f=h=>{const y=U(r.current).includes(h.animationName);if(h.target===t&&y&&(c("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",l=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},v=h=>{h.target===t&&(i.current=U(r.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(l),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:s.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function U(e){return e?.animationName||"none"}function qt(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Vt({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Gt({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:r,u=j(n),c=s.useCallback(l=>{if(i){const f=typeof l=="function"?l(e):l;f!==e&&u(f)}else o(l)},[i,e,o,u]);return[a,c]}function Gt({defaultProp:e,onChange:t}){const n=s.useState(e),[r]=n,o=s.useRef(r),i=j(t);return s.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var Yt="VisuallyHidden",je=s.forwardRef((e,t)=>p.jsx(A.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));je.displayName=Yt;var Xt=je,[z]=ye("Tooltip",[Te]),q=Te(),ke="TooltipProvider",Kt=700,Z="tooltip.open",[Zt,ne]=z(ke),Me=e=>{const{__scopeTooltip:t,delayDuration:n=Kt,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[a,u]=s.useState(!0),c=s.useRef(!1),l=s.useRef(0);return s.useEffect(()=>{const d=l.current;return()=>window.clearTimeout(d)},[]),p.jsx(Zt,{scope:t,isOpenDelayed:a,delayDuration:n,onOpen:s.useCallback(()=>{window.clearTimeout(l.current),u(!1)},[]),onClose:s.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>u(!0),r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:s.useCallback(d=>{c.current=d},[]),disableHoverableContent:o,children:i})};Me.displayName=ke;var V="Tooltip",[Jt,F]=z(V),Fe=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:a,delayDuration:u}=e,c=ne(V,e.__scopeTooltip),l=q(t),[d,f]=s.useState(null),v=At(),h=s.useRef(0),m=a??c.disableHoverableContent,y=u??c.delayDuration,x=s.useRef(!1),[P=!1,w]=Vt({prop:r,defaultProp:o,onChange:g=>{g?(c.onOpen(),document.dispatchEvent(new CustomEvent(Z))):c.onClose(),i?.(g)}}),C=s.useMemo(()=>P?x.current?"delayed-open":"instant-open":"closed",[P]),E=s.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x.current=!1,w(!0)},[w]),b=s.useCallback(()=>{window.clearTimeout(h.current),h.current=0,w(!1)},[w]),O=s.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{x.current=!0,w(!0),h.current=0},y)},[y,w]);return s.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),p.jsx(Ft,{...l,children:p.jsx(Jt,{scope:t,contentId:v,open:P,stateAttribute:C,trigger:d,onTriggerChange:f,onTriggerEnter:s.useCallback(()=>{c.isOpenDelayed?O():E()},[c.isOpenDelayed,O,E]),onTriggerLeave:s.useCallback(()=>{m?b():(window.clearTimeout(h.current),h.current=0)},[b,m]),onOpen:E,onClose:b,disableHoverableContent:m,children:n})})};Fe.displayName=V;var J="TooltipTrigger",$e=s.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=F(J,n),i=ne(J,n),a=q(n),u=s.useRef(null),c=S(t,u,o.onTriggerChange),l=s.useRef(!1),d=s.useRef(!1),f=s.useCallback(()=>l.current=!1,[]);return s.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),p.jsx($t,{asChild:!0,...a,children:p.jsx(A.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:c,onPointerMove:_(e.onPointerMove,v=>{v.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:_(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:_(e.onPointerDown,()=>{l.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:_(e.onFocus,()=>{l.current||o.onOpen()}),onBlur:_(e.onBlur,o.onClose),onClick:_(e.onClick,o.onClose)})})});$e.displayName=J;var re="TooltipPortal",[Qt,en]=z(re,{forceMount:void 0}),He=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,i=F(re,t);return p.jsx(Qt,{scope:t,forceMount:n,children:p.jsx(te,{present:n||i.open,children:p.jsx(Ie,{asChild:!0,container:o,children:r})})})};He.displayName=re;var I="TooltipContent",We=s.forwardRef((e,t)=>{const n=en(I,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,a=F(I,e.__scopeTooltip);return p.jsx(te,{present:r||a.open,children:a.disableHoverableContent?p.jsx(Be,{side:o,...i,ref:t}):p.jsx(tn,{side:o,...i,ref:t})})}),tn=s.forwardRef((e,t)=>{const n=F(I,e.__scopeTooltip),r=ne(I,e.__scopeTooltip),o=s.useRef(null),i=S(t,o),[a,u]=s.useState(null),{trigger:c,onClose:l}=n,d=o.current,{onPointerInTransitChange:f}=r,v=s.useCallback(()=>{u(null),f(!1)},[f]),h=s.useCallback((m,y)=>{const x=m.currentTarget,P={x:m.clientX,y:m.clientY},w=on(P,x.getBoundingClientRect()),C=sn(P,w),E=an(y.getBoundingClientRect()),b=ln([...C,...E]);u(b),f(!0)},[f]);return s.useEffect(()=>()=>v(),[v]),s.useEffect(()=>{if(c&&d){const m=x=>h(x,d),y=x=>h(x,c);return c.addEventListener("pointerleave",m),d.addEventListener("pointerleave",y),()=>{c.removeEventListener("pointerleave",m),d.removeEventListener("pointerleave",y)}}},[c,d,h,v]),s.useEffect(()=>{if(a){const m=y=>{const x=y.target,P={x:y.clientX,y:y.clientY},w=c?.contains(x)||d?.contains(x),C=!cn(P,a);w?v():C&&(v(),l())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[c,d,a,l,v]),p.jsx(Be,{...e,ref:i})}),[nn,rn]=z(V,{isInside:!1}),Be=s.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:a,...u}=e,c=F(I,n),l=q(n),{onClose:d}=c;return s.useEffect(()=>(document.addEventListener(Z,d),()=>document.removeEventListener(Z,d)),[d]),s.useEffect(()=>{if(c.trigger){const f=v=>{v.target?.contains(c.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,d]),p.jsx(Pe,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:p.jsxs(Ht,{"data-state":c.stateAttribute,...l,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[p.jsx(xe,{children:r}),p.jsx(nn,{scope:n,isInside:!0,children:p.jsx(Xt,{id:c.contentId,role:"tooltip",children:o||r})})]})})});We.displayName=I;var Ue="TooltipArrow",ze=s.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=q(n);return rn(Ue,n).isInside?null:p.jsx(Wt,{...o,...r,ref:t})});ze.displayName=Ue;function on(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function sn(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function an(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function cn(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const u=t[i].x,c=t[i].y,l=t[a].x,d=t[a].y;c>r!=d>r&&n<(l-u)*(r-c)/(d-c)+u&&(o=!o)}return o}function ln(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),un(t)}function un(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],a=t[t.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var dn=Me,pn=Fe,fn=$e,hn=He,vn=We,mn=ze;const yn="_slideDownAndFade_fkagk_1",gn="_slideLeftAndFade_fkagk_1",xn="_slideUpAndFade_fkagk_1",wn="_slideRightAndFade_fkagk_1",Pn={"purpur-tooltip":"_purpur-tooltip_fkagk_1","purpur-tooltip__content":"_purpur-tooltip__content_fkagk_4","purpur-tooltip__content--primary":"_purpur-tooltip__content--primary_fkagk_14","purpur-tooltip__content--primary-negative":"_purpur-tooltip__content--primary-negative_fkagk_17",slideDownAndFade:yn,slideLeftAndFade:gn,slideUpAndFade:xn,slideRightAndFade:wn,"purpur-tooltip__arrow--primary":"_purpur-tooltip__arrow--primary_fkagk_32","purpur-tooltip__arrow--primary-negative":"_purpur-tooltip__arrow--primary-negative_fkagk_35"},G=ut.c.bind(Pn),qe={TOP:"top",BOTTOM:"bottom",LEFT:"left",RIGHT:"right"},Ve={START:"start",CENTER:"center",END:"end"},L="purpur-tooltip",Ge=Y.forwardRef(({["data-testid"]:e,buttonSize:t="md",children:n,className:r,container:o,contentClassName:i,negative:a=!1,position:u=qe.TOP,align:c=Ve.CENTER,triggerAriaLabel:l,triggerElement:d,...f},v)=>{const[h,m]=Y.useState(!1),y=lt.useThemePortalContainer(),x=o===void 0?y:o??void 0,P=G(r,L,`${L}--primary${a?"-negative":""}`),w=p.jsx(le.Button,{ref:v,"aria-label":l??"","aria-expanded":h,variant:le.BUTTON_VARIANT.TERTIARY_PURPLE,negative:a,iconOnly:!0,"data-testid":`${e}-trigger-button`,size:t,children:p.jsx(at.r,{size:"md"})});return p.jsx("div",{"data-testid":e,className:P,children:p.jsx(dn,{delayDuration:parseInt(ct.purpurMotionDuration400),children:p.jsxs(pn,{open:h,onOpenChange:m,...f,children:[p.jsx(fn,{asChild:!0,onClick:C=>{C.preventDefault(),m(!0)},children:d??w}),p.jsx(hn,{container:x,children:p.jsxs(vn,{side:u,align:c,className:G(i,`${L}__content`,`${L}__content--primary${a?"-negative":""}`),sideOffset:-5,"data-testid":`${e}-content`,children:[typeof n=="string"?p.jsx(ue.Paragraph,{variant:ue.ParagraphVariant.PARAGRAPH100,negative:!a,"data-testid":`${e}-paragraph`,children:n}):n,p.jsx(mn,{className:G(`${L}__arrow`,`${L}__arrow--primary${a?"-negative":""}`)})]})})]})})})});Ge.displayName="Tooltip";exports.TOOLTIP_ALIGN=Ve;exports.TOOLTIP_POSITION=qe;exports.Tooltip=Ge;
2
+ //# sourceMappingURL=tooltip-COFCRUKv.js.map