@pega/cosmos-react-core 9.0.0-build.1.0 → 9.0.0-build.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 (690) hide show
  1. package/lib/components/AppShell/AppHeader.d.ts.map +1 -1
  2. package/lib/components/AppShell/AppHeader.js +4 -1
  3. package/lib/components/AppShell/AppHeader.js.map +1 -1
  4. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  5. package/lib/components/AppShell/AppShell.styles.js +3 -1
  6. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  7. package/lib/components/AppShell/NavigationListItemWrapper.d.ts.map +1 -1
  8. package/lib/components/AppShell/NavigationListItemWrapper.js +3 -4
  9. package/lib/components/AppShell/NavigationListItemWrapper.js.map +1 -1
  10. package/lib/components/AppShell/ThemeSwitcher.d.ts +9 -0
  11. package/lib/components/AppShell/ThemeSwitcher.d.ts.map +1 -0
  12. package/lib/components/AppShell/ThemeSwitcher.js +58 -0
  13. package/lib/components/AppShell/ThemeSwitcher.js.map +1 -0
  14. package/lib/components/AppShell/ThemeSwitcher.test-ids.d.ts +2 -0
  15. package/lib/components/AppShell/ThemeSwitcher.test-ids.d.ts.map +1 -0
  16. package/lib/components/AppShell/ThemeSwitcher.test-ids.js +3 -0
  17. package/lib/components/AppShell/ThemeSwitcher.test-ids.js.map +1 -0
  18. package/lib/components/Avatar/Avatar.d.ts.map +1 -1
  19. package/lib/components/Avatar/Avatar.js +10 -4
  20. package/lib/components/Avatar/Avatar.js.map +1 -1
  21. package/lib/components/Banner/Banner.js +1 -1
  22. package/lib/components/Banner/Banner.js.map +1 -1
  23. package/lib/components/Card/CardHeader.d.ts.map +1 -1
  24. package/lib/components/Card/CardHeader.js +2 -2
  25. package/lib/components/Card/CardHeader.js.map +1 -1
  26. package/lib/components/ComboBox/ComboBox.d.ts.map +1 -1
  27. package/lib/components/ComboBox/ComboBox.js +8 -3
  28. package/lib/components/ComboBox/ComboBox.js.map +1 -1
  29. package/lib/components/ComboBox/ComboBox.types.d.ts +5 -0
  30. package/lib/components/ComboBox/ComboBox.types.d.ts.map +1 -1
  31. package/lib/components/ComboBox/ComboBox.types.js.map +1 -1
  32. package/lib/components/CompositeInput/CompositeInput.d.ts.map +1 -1
  33. package/lib/components/CompositeInput/CompositeInput.js +3 -9
  34. package/lib/components/CompositeInput/CompositeInput.js.map +1 -1
  35. package/lib/components/Configuration/Configuration.d.ts +7 -2
  36. package/lib/components/Configuration/Configuration.d.ts.map +1 -1
  37. package/lib/components/Configuration/Configuration.js +6 -4
  38. package/lib/components/Configuration/Configuration.js.map +1 -1
  39. package/lib/components/CreditCard/CreditCardInput.d.ts +1 -1
  40. package/lib/components/Currency/CurrencyInput.d.ts.map +1 -1
  41. package/lib/components/Currency/CurrencyInput.js +8 -4
  42. package/lib/components/Currency/CurrencyInput.js.map +1 -1
  43. package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
  44. package/lib/components/DateTime/Input/DateInput.js +8 -6
  45. package/lib/components/DateTime/Input/DateInput.js.map +1 -1
  46. package/lib/components/DateTime/Input/DateTime.styles.d.ts.map +1 -1
  47. package/lib/components/DateTime/Input/DateTime.styles.js +0 -4
  48. package/lib/components/DateTime/Input/DateTime.styles.js.map +1 -1
  49. package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
  50. package/lib/components/DateTime/Input/DateTimeInput.js +29 -10
  51. package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
  52. package/lib/components/DateTime/Input/MonthInput.d.ts.map +1 -1
  53. package/lib/components/DateTime/Input/MonthInput.js +1 -1
  54. package/lib/components/DateTime/Input/MonthInput.js.map +1 -1
  55. package/lib/components/DateTime/Input/PartInput.d.ts.map +1 -1
  56. package/lib/components/DateTime/Input/PartInput.js +6 -1
  57. package/lib/components/DateTime/Input/PartInput.js.map +1 -1
  58. package/lib/components/DateTime/Input/QuarterInput.d.ts.map +1 -1
  59. package/lib/components/DateTime/Input/QuarterInput.js +1 -1
  60. package/lib/components/DateTime/Input/QuarterInput.js.map +1 -1
  61. package/lib/components/DateTime/Input/TimeInput.d.ts.map +1 -1
  62. package/lib/components/DateTime/Input/TimeInput.js +1 -1
  63. package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
  64. package/lib/components/DateTime/Input/WeekInput.d.ts.map +1 -1
  65. package/lib/components/DateTime/Input/WeekInput.js +7 -5
  66. package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
  67. package/lib/components/DateTime/Input/utils.d.ts +2 -2
  68. package/lib/components/DateTime/Input/utils.d.ts.map +1 -1
  69. package/lib/components/DateTime/Input/utils.js +4 -3
  70. package/lib/components/DateTime/Input/utils.js.map +1 -1
  71. package/lib/components/DateTime/Picker/utils.d.ts.map +1 -1
  72. package/lib/components/DateTime/Picker/utils.js +2 -6
  73. package/lib/components/DateTime/Picker/utils.js.map +1 -1
  74. package/lib/components/Dialog/Dialog.types.d.ts +4 -0
  75. package/lib/components/Dialog/Dialog.types.d.ts.map +1 -1
  76. package/lib/components/Dialog/Dialog.types.js.map +1 -1
  77. package/lib/components/Dialog/FormDialog.d.ts.map +1 -1
  78. package/lib/components/Dialog/FormDialog.js +7 -2
  79. package/lib/components/Dialog/FormDialog.js.map +1 -1
  80. package/lib/components/Dialog/InfoDialog.js +1 -1
  81. package/lib/components/Dialog/InfoDialog.js.map +1 -1
  82. package/lib/components/Drawer/Drawer.d.ts +8 -1
  83. package/lib/components/Drawer/Drawer.d.ts.map +1 -1
  84. package/lib/components/Drawer/Drawer.js +67 -8
  85. package/lib/components/Drawer/Drawer.js.map +1 -1
  86. package/lib/components/Drawer/ResizeHandle.d.ts +9 -0
  87. package/lib/components/Drawer/ResizeHandle.d.ts.map +1 -0
  88. package/lib/components/Drawer/ResizeHandle.js +109 -0
  89. package/lib/components/Drawer/ResizeHandle.js.map +1 -0
  90. package/lib/components/Drawer/index.d.ts +2 -0
  91. package/lib/components/Drawer/index.d.ts.map +1 -1
  92. package/lib/components/Drawer/index.js +1 -0
  93. package/lib/components/Drawer/index.js.map +1 -1
  94. package/lib/components/FieldGroup/FieldGroup.d.ts +5 -0
  95. package/lib/components/FieldGroup/FieldGroup.d.ts.map +1 -1
  96. package/lib/components/FieldGroup/FieldGroup.js +10 -6
  97. package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
  98. package/lib/components/FieldGroup/FieldGroupList.d.ts +17 -2
  99. package/lib/components/FieldGroup/FieldGroupList.d.ts.map +1 -1
  100. package/lib/components/FieldGroup/FieldGroupList.js +202 -50
  101. package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
  102. package/lib/components/FieldGroup/FieldGroupList.utils.d.ts +33 -0
  103. package/lib/components/FieldGroup/FieldGroupList.utils.d.ts.map +1 -0
  104. package/lib/components/FieldGroup/FieldGroupList.utils.js +74 -0
  105. package/lib/components/FieldGroup/FieldGroupList.utils.js.map +1 -0
  106. package/lib/components/FieldGroup/FieldGroupListContext.d.ts +8 -0
  107. package/lib/components/FieldGroup/FieldGroupListContext.d.ts.map +1 -0
  108. package/lib/components/FieldGroup/FieldGroupListContext.js +9 -0
  109. package/lib/components/FieldGroup/FieldGroupListContext.js.map +1 -0
  110. package/lib/components/FieldGroup/index.d.ts +2 -0
  111. package/lib/components/FieldGroup/index.d.ts.map +1 -1
  112. package/lib/components/FieldGroup/index.js +2 -0
  113. package/lib/components/FieldGroup/index.js.map +1 -1
  114. package/lib/components/FieldValueList/FieldValueList.d.ts.map +1 -1
  115. package/lib/components/FieldValueList/FieldValueList.js +11 -5
  116. package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
  117. package/lib/components/File/FileInput.d.ts.map +1 -1
  118. package/lib/components/File/FileInput.js +4 -3
  119. package/lib/components/File/FileInput.js.map +1 -1
  120. package/lib/components/File/FileItem.d.ts.map +1 -1
  121. package/lib/components/File/FileItem.js +2 -2
  122. package/lib/components/File/FileItem.js.map +1 -1
  123. package/lib/components/Form/Form.d.ts +2 -0
  124. package/lib/components/Form/Form.d.ts.map +1 -1
  125. package/lib/components/Form/Form.js +2 -2
  126. package/lib/components/Form/Form.js.map +1 -1
  127. package/lib/components/FormField/FormField.d.ts.map +1 -1
  128. package/lib/components/FormField/FormField.js +3 -2
  129. package/lib/components/FormField/FormField.js.map +1 -1
  130. package/lib/components/Fullscreen/Fullscreen.d.ts.map +1 -1
  131. package/lib/components/Fullscreen/Fullscreen.js +8 -5
  132. package/lib/components/Fullscreen/Fullscreen.js.map +1 -1
  133. package/lib/components/Icon/Icon.d.ts.map +1 -1
  134. package/lib/components/Icon/Icon.js +7 -2
  135. package/lib/components/Icon/Icon.js.map +1 -1
  136. package/lib/components/Icon/streamline-icons/archive-solid.icon.d.ts +5 -0
  137. package/lib/components/Icon/streamline-icons/archive-solid.icon.d.ts.map +1 -0
  138. package/lib/components/Icon/streamline-icons/archive-solid.icon.js +7 -0
  139. package/lib/components/Icon/streamline-icons/archive-solid.icon.js.map +1 -0
  140. package/lib/components/Icon/streamline-icons/archive.icon.d.ts +5 -0
  141. package/lib/components/Icon/streamline-icons/archive.icon.d.ts.map +1 -0
  142. package/lib/components/Icon/streamline-icons/archive.icon.js +7 -0
  143. package/lib/components/Icon/streamline-icons/archive.icon.js.map +1 -0
  144. package/lib/components/Icon/streamline-icons/article-solid.icon.d.ts +5 -0
  145. package/lib/components/Icon/streamline-icons/article-solid.icon.d.ts.map +1 -0
  146. package/lib/components/Icon/streamline-icons/article-solid.icon.js +7 -0
  147. package/lib/components/Icon/streamline-icons/article-solid.icon.js.map +1 -0
  148. package/lib/components/Icon/streamline-icons/article.icon.d.ts +5 -0
  149. package/lib/components/Icon/streamline-icons/article.icon.d.ts.map +1 -0
  150. package/lib/components/Icon/streamline-icons/article.icon.js +7 -0
  151. package/lib/components/Icon/streamline-icons/article.icon.js.map +1 -0
  152. package/lib/components/Icon/streamline-icons/bell-solid.icon.d.ts +5 -0
  153. package/lib/components/Icon/streamline-icons/bell-solid.icon.d.ts.map +1 -0
  154. package/lib/components/Icon/streamline-icons/bell-solid.icon.js +7 -0
  155. package/lib/components/Icon/streamline-icons/bell-solid.icon.js.map +1 -0
  156. package/lib/components/Icon/streamline-icons/browser-site.icon.d.ts +5 -0
  157. package/lib/components/Icon/streamline-icons/browser-site.icon.d.ts.map +1 -0
  158. package/lib/components/Icon/streamline-icons/browser-site.icon.js +7 -0
  159. package/lib/components/Icon/streamline-icons/browser-site.icon.js.map +1 -0
  160. package/lib/components/Icon/streamline-icons/circle-mixed-right.icon.d.ts +5 -0
  161. package/lib/components/Icon/streamline-icons/circle-mixed-right.icon.d.ts.map +1 -0
  162. package/lib/components/Icon/streamline-icons/circle-mixed-right.icon.js +7 -0
  163. package/lib/components/Icon/streamline-icons/circle-mixed-right.icon.js.map +1 -0
  164. package/lib/components/Icon/streamline-icons/circle-stacked-mixed.icon.d.ts +5 -0
  165. package/lib/components/Icon/streamline-icons/circle-stacked-mixed.icon.d.ts.map +1 -0
  166. package/lib/components/Icon/streamline-icons/circle-stacked-mixed.icon.js +7 -0
  167. package/lib/components/Icon/streamline-icons/circle-stacked-mixed.icon.js.map +1 -0
  168. package/lib/components/Icon/streamline-icons/circle-stacked.icon.d.ts +5 -0
  169. package/lib/components/Icon/streamline-icons/circle-stacked.icon.d.ts.map +1 -0
  170. package/lib/components/Icon/streamline-icons/circle-stacked.icon.js +7 -0
  171. package/lib/components/Icon/streamline-icons/circle-stacked.icon.js.map +1 -0
  172. package/lib/components/Icon/streamline-icons/cloud-nodes.icon.d.ts +5 -0
  173. package/lib/components/Icon/streamline-icons/cloud-nodes.icon.d.ts.map +1 -0
  174. package/lib/components/Icon/streamline-icons/cloud-nodes.icon.js +7 -0
  175. package/lib/components/Icon/streamline-icons/cloud-nodes.icon.js.map +1 -0
  176. package/lib/components/Icon/streamline-icons/condition-critical.icon.d.ts +5 -0
  177. package/lib/components/Icon/streamline-icons/condition-critical.icon.d.ts.map +1 -0
  178. package/lib/components/Icon/streamline-icons/condition-critical.icon.js +7 -0
  179. package/lib/components/Icon/streamline-icons/condition-critical.icon.js.map +1 -0
  180. package/lib/components/Icon/streamline-icons/condition-satisfactory.icon.d.ts +5 -0
  181. package/lib/components/Icon/streamline-icons/condition-satisfactory.icon.d.ts.map +1 -0
  182. package/lib/components/Icon/streamline-icons/condition-satisfactory.icon.js +7 -0
  183. package/lib/components/Icon/streamline-icons/condition-satisfactory.icon.js.map +1 -0
  184. package/lib/components/Icon/streamline-icons/disc-document.icon.d.ts +5 -0
  185. package/lib/components/Icon/streamline-icons/disc-document.icon.d.ts.map +1 -0
  186. package/lib/components/Icon/streamline-icons/disc-document.icon.js +7 -0
  187. package/lib/components/Icon/streamline-icons/disc-document.icon.js.map +1 -0
  188. package/lib/components/Icon/streamline-icons/disc-nodes.icon.d.ts +5 -0
  189. package/lib/components/Icon/streamline-icons/disc-nodes.icon.d.ts.map +1 -0
  190. package/lib/components/Icon/streamline-icons/disc-nodes.icon.js +7 -0
  191. package/lib/components/Icon/streamline-icons/disc-nodes.icon.js.map +1 -0
  192. package/lib/components/Icon/streamline-icons/document-doc.icon.d.ts +5 -0
  193. package/lib/components/Icon/streamline-icons/document-doc.icon.d.ts.map +1 -0
  194. package/lib/components/Icon/streamline-icons/document-doc.icon.js +7 -0
  195. package/lib/components/Icon/streamline-icons/document-doc.icon.js.map +1 -0
  196. package/lib/components/Icon/streamline-icons/document-json.icon.d.ts +5 -0
  197. package/lib/components/Icon/streamline-icons/document-json.icon.d.ts.map +1 -0
  198. package/lib/components/Icon/streamline-icons/document-json.icon.js +7 -0
  199. package/lib/components/Icon/streamline-icons/document-json.icon.js.map +1 -0
  200. package/lib/components/Icon/streamline-icons/document-xls.icon.d.ts +5 -0
  201. package/lib/components/Icon/streamline-icons/document-xls.icon.d.ts.map +1 -0
  202. package/lib/components/Icon/streamline-icons/document-xls.icon.js +7 -0
  203. package/lib/components/Icon/streamline-icons/document-xls.icon.js.map +1 -0
  204. package/lib/components/Icon/streamline-icons/documents.icon.d.ts +5 -0
  205. package/lib/components/Icon/streamline-icons/documents.icon.d.ts.map +1 -0
  206. package/lib/components/Icon/streamline-icons/documents.icon.js +7 -0
  207. package/lib/components/Icon/streamline-icons/documents.icon.js.map +1 -0
  208. package/lib/components/Icon/streamline-icons/field-cursor.icon.js +1 -1
  209. package/lib/components/Icon/streamline-icons/field-cursor.icon.js.map +1 -1
  210. package/lib/components/Icon/streamline-icons/filter-on.icon.d.ts +5 -0
  211. package/lib/components/Icon/streamline-icons/filter-on.icon.d.ts.map +1 -0
  212. package/lib/components/Icon/streamline-icons/filter-on.icon.js +7 -0
  213. package/lib/components/Icon/streamline-icons/filter-on.icon.js.map +1 -0
  214. package/lib/components/Icon/streamline-icons/freeze-column.icon.d.ts +5 -0
  215. package/lib/components/Icon/streamline-icons/freeze-column.icon.d.ts.map +1 -0
  216. package/lib/components/Icon/streamline-icons/freeze-column.icon.js +7 -0
  217. package/lib/components/Icon/streamline-icons/freeze-column.icon.js.map +1 -0
  218. package/lib/components/Icon/streamline-icons/galaxy.icon.d.ts +5 -0
  219. package/lib/components/Icon/streamline-icons/galaxy.icon.d.ts.map +1 -0
  220. package/lib/components/Icon/streamline-icons/galaxy.icon.js +7 -0
  221. package/lib/components/Icon/streamline-icons/galaxy.icon.js.map +1 -0
  222. package/lib/components/Icon/streamline-icons/grid-solid.icon.d.ts +5 -0
  223. package/lib/components/Icon/streamline-icons/grid-solid.icon.d.ts.map +1 -0
  224. package/lib/components/Icon/streamline-icons/grid-solid.icon.js +7 -0
  225. package/lib/components/Icon/streamline-icons/grid-solid.icon.js.map +1 -0
  226. package/lib/components/Icon/streamline-icons/grid.icon.d.ts +5 -0
  227. package/lib/components/Icon/streamline-icons/grid.icon.d.ts.map +1 -0
  228. package/lib/components/Icon/streamline-icons/grid.icon.js +7 -0
  229. package/lib/components/Icon/streamline-icons/grid.icon.js.map +1 -0
  230. package/lib/components/Icon/streamline-icons/language-pack.icon.d.ts +5 -0
  231. package/lib/components/Icon/streamline-icons/language-pack.icon.d.ts.map +1 -0
  232. package/lib/components/Icon/streamline-icons/language-pack.icon.js +7 -0
  233. package/lib/components/Icon/streamline-icons/language-pack.icon.js.map +1 -0
  234. package/lib/components/Icon/streamline-icons/layout.icon.d.ts +5 -0
  235. package/lib/components/Icon/streamline-icons/layout.icon.d.ts.map +1 -0
  236. package/lib/components/Icon/streamline-icons/layout.icon.js +7 -0
  237. package/lib/components/Icon/streamline-icons/layout.icon.js.map +1 -0
  238. package/lib/components/Icon/streamline-icons/lock-closed.icon.d.ts +5 -0
  239. package/lib/components/Icon/streamline-icons/lock-closed.icon.d.ts.map +1 -0
  240. package/lib/components/Icon/streamline-icons/lock-closed.icon.js +7 -0
  241. package/lib/components/Icon/streamline-icons/lock-closed.icon.js.map +1 -0
  242. package/lib/components/Icon/streamline-icons/mail-solid.icon.d.ts +5 -0
  243. package/lib/components/Icon/streamline-icons/mail-solid.icon.d.ts.map +1 -0
  244. package/lib/components/Icon/streamline-icons/mail-solid.icon.js +7 -0
  245. package/lib/components/Icon/streamline-icons/mail-solid.icon.js.map +1 -0
  246. package/lib/components/Icon/streamline-icons/mail.icon.d.ts.map +1 -1
  247. package/lib/components/Icon/streamline-icons/mail.icon.js +1 -1
  248. package/lib/components/Icon/streamline-icons/mail.icon.js.map +1 -1
  249. package/lib/components/Icon/streamline-icons/mobius.icon.d.ts +5 -0
  250. package/lib/components/Icon/streamline-icons/mobius.icon.d.ts.map +1 -0
  251. package/lib/components/Icon/streamline-icons/mobius.icon.js +7 -0
  252. package/lib/components/Icon/streamline-icons/mobius.icon.js.map +1 -0
  253. package/lib/components/Icon/streamline-icons/phone-in-solid.icon.d.ts +5 -0
  254. package/lib/components/Icon/streamline-icons/phone-in-solid.icon.d.ts.map +1 -0
  255. package/lib/components/Icon/streamline-icons/phone-in-solid.icon.js +7 -0
  256. package/lib/components/Icon/streamline-icons/phone-in-solid.icon.js.map +1 -0
  257. package/lib/components/Icon/streamline-icons/picture-solid.icon.d.ts +5 -0
  258. package/lib/components/Icon/streamline-icons/picture-solid.icon.d.ts.map +1 -0
  259. package/lib/components/Icon/streamline-icons/picture-solid.icon.js +7 -0
  260. package/lib/components/Icon/streamline-icons/picture-solid.icon.js.map +1 -0
  261. package/lib/components/Icon/streamline-icons/plug-connect.icon.d.ts +5 -0
  262. package/lib/components/Icon/streamline-icons/plug-connect.icon.d.ts.map +1 -0
  263. package/lib/components/Icon/streamline-icons/plug-connect.icon.js +7 -0
  264. package/lib/components/Icon/streamline-icons/plug-connect.icon.js.map +1 -0
  265. package/lib/components/Icon/streamline-icons/return.icon.d.ts +5 -0
  266. package/lib/components/Icon/streamline-icons/return.icon.d.ts.map +1 -0
  267. package/lib/components/Icon/streamline-icons/return.icon.js +7 -0
  268. package/lib/components/Icon/streamline-icons/return.icon.js.map +1 -0
  269. package/lib/components/Icon/streamline-icons/robot-solid.icon.d.ts +5 -0
  270. package/lib/components/Icon/streamline-icons/robot-solid.icon.d.ts.map +1 -0
  271. package/lib/components/Icon/streamline-icons/robot-solid.icon.js +7 -0
  272. package/lib/components/Icon/streamline-icons/robot-solid.icon.js.map +1 -0
  273. package/lib/components/Icon/streamline-icons/shapes.icon.d.ts +5 -0
  274. package/lib/components/Icon/streamline-icons/shapes.icon.d.ts.map +1 -0
  275. package/lib/components/Icon/streamline-icons/shapes.icon.js +7 -0
  276. package/lib/components/Icon/streamline-icons/shapes.icon.js.map +1 -0
  277. package/lib/components/Icon/streamline-icons/share-case.icon.d.ts +5 -0
  278. package/lib/components/Icon/streamline-icons/share-case.icon.d.ts.map +1 -0
  279. package/lib/components/Icon/streamline-icons/share-case.icon.js +7 -0
  280. package/lib/components/Icon/streamline-icons/share-case.icon.js.map +1 -0
  281. package/lib/components/Icon/streamline-icons/share-document.icon.d.ts +5 -0
  282. package/lib/components/Icon/streamline-icons/share-document.icon.d.ts.map +1 -0
  283. package/lib/components/Icon/streamline-icons/share-document.icon.js +7 -0
  284. package/lib/components/Icon/streamline-icons/share-document.icon.js.map +1 -0
  285. package/lib/components/Icon/streamline-icons/shield-lock.icon.d.ts +5 -0
  286. package/lib/components/Icon/streamline-icons/shield-lock.icon.d.ts.map +1 -0
  287. package/lib/components/Icon/streamline-icons/shield-lock.icon.js +7 -0
  288. package/lib/components/Icon/streamline-icons/shield-lock.icon.js.map +1 -0
  289. package/lib/components/Icon/streamline-icons/slideshow-solid.icon.d.ts +5 -0
  290. package/lib/components/Icon/streamline-icons/slideshow-solid.icon.d.ts.map +1 -0
  291. package/lib/components/Icon/streamline-icons/slideshow-solid.icon.js +7 -0
  292. package/lib/components/Icon/streamline-icons/slideshow-solid.icon.js.map +1 -0
  293. package/lib/components/Icon/streamline-icons/speaker-on-sold.icon.d.ts +5 -0
  294. package/lib/components/Icon/streamline-icons/speaker-on-sold.icon.d.ts.map +1 -0
  295. package/lib/components/Icon/streamline-icons/speaker-on-sold.icon.js +7 -0
  296. package/lib/components/Icon/streamline-icons/speaker-on-sold.icon.js.map +1 -0
  297. package/lib/components/Icon/streamline-icons/speaker-on.icon.d.ts +5 -0
  298. package/lib/components/Icon/streamline-icons/speaker-on.icon.d.ts.map +1 -0
  299. package/lib/components/Icon/streamline-icons/speaker-on.icon.js +7 -0
  300. package/lib/components/Icon/streamline-icons/speaker-on.icon.js.map +1 -0
  301. package/lib/components/Icon/streamline-icons/table-disc.icon.d.ts +5 -0
  302. package/lib/components/Icon/streamline-icons/table-disc.icon.d.ts.map +1 -0
  303. package/lib/components/Icon/streamline-icons/table-disc.icon.js +7 -0
  304. package/lib/components/Icon/streamline-icons/table-disc.icon.js.map +1 -0
  305. package/lib/components/Icon/streamline-icons/translate.icon.d.ts +5 -0
  306. package/lib/components/Icon/streamline-icons/translate.icon.d.ts.map +1 -0
  307. package/lib/components/Icon/streamline-icons/translate.icon.js +7 -0
  308. package/lib/components/Icon/streamline-icons/translate.icon.js.map +1 -0
  309. package/lib/components/Icon/streamline-icons/user-check-solid.icon.d.ts +5 -0
  310. package/lib/components/Icon/streamline-icons/user-check-solid.icon.d.ts.map +1 -0
  311. package/lib/components/Icon/streamline-icons/user-check-solid.icon.js +7 -0
  312. package/lib/components/Icon/streamline-icons/user-check-solid.icon.js.map +1 -0
  313. package/lib/components/Icon/streamline-icons/user-close-solid.icon.d.ts +5 -0
  314. package/lib/components/Icon/streamline-icons/user-close-solid.icon.d.ts.map +1 -0
  315. package/lib/components/Icon/streamline-icons/user-close-solid.icon.js +7 -0
  316. package/lib/components/Icon/streamline-icons/user-close-solid.icon.js.map +1 -0
  317. package/lib/components/Icon/streamline-icons/user-close.icon.d.ts +5 -0
  318. package/lib/components/Icon/streamline-icons/user-close.icon.d.ts.map +1 -0
  319. package/lib/components/Icon/streamline-icons/user-close.icon.js +7 -0
  320. package/lib/components/Icon/streamline-icons/user-close.icon.js.map +1 -0
  321. package/lib/components/Icon/streamline-icons/user-female-solid.icon.d.ts +5 -0
  322. package/lib/components/Icon/streamline-icons/user-female-solid.icon.d.ts.map +1 -0
  323. package/lib/components/Icon/streamline-icons/user-female-solid.icon.js +7 -0
  324. package/lib/components/Icon/streamline-icons/user-female-solid.icon.js.map +1 -0
  325. package/lib/components/Icon/streamline-icons/user-female.icon.d.ts +5 -0
  326. package/lib/components/Icon/streamline-icons/user-female.icon.d.ts.map +1 -0
  327. package/lib/components/Icon/streamline-icons/user-female.icon.js +7 -0
  328. package/lib/components/Icon/streamline-icons/user-female.icon.js.map +1 -0
  329. package/lib/components/Icon/streamline-icons/user-list-solid.icon.d.ts +5 -0
  330. package/lib/components/Icon/streamline-icons/user-list-solid.icon.d.ts.map +1 -0
  331. package/lib/components/Icon/streamline-icons/user-list-solid.icon.js +7 -0
  332. package/lib/components/Icon/streamline-icons/user-list-solid.icon.js.map +1 -0
  333. package/lib/components/Icon/streamline-icons/user-list.icon.d.ts +5 -0
  334. package/lib/components/Icon/streamline-icons/user-list.icon.d.ts.map +1 -0
  335. package/lib/components/Icon/streamline-icons/user-list.icon.js +7 -0
  336. package/lib/components/Icon/streamline-icons/user-list.icon.js.map +1 -0
  337. package/lib/components/Icon/streamline-icons/user-plus-solid.icon.d.ts +5 -0
  338. package/lib/components/Icon/streamline-icons/user-plus-solid.icon.d.ts.map +1 -0
  339. package/lib/components/Icon/streamline-icons/user-plus-solid.icon.js +7 -0
  340. package/lib/components/Icon/streamline-icons/user-plus-solid.icon.js.map +1 -0
  341. package/lib/components/Icon/streamline-icons/user-plus.icon.d.ts +5 -0
  342. package/lib/components/Icon/streamline-icons/user-plus.icon.d.ts.map +1 -0
  343. package/lib/components/Icon/streamline-icons/user-plus.icon.js +7 -0
  344. package/lib/components/Icon/streamline-icons/user-plus.icon.js.map +1 -0
  345. package/lib/components/Icon/streamline-icons/user-question-mark-solid.icon.d.ts +5 -0
  346. package/lib/components/Icon/streamline-icons/user-question-mark-solid.icon.d.ts.map +1 -0
  347. package/lib/components/Icon/streamline-icons/user-question-mark-solid.icon.js +7 -0
  348. package/lib/components/Icon/streamline-icons/user-question-mark-solid.icon.js.map +1 -0
  349. package/lib/components/Icon/streamline-icons/user-question-mark.icon.d.ts +5 -0
  350. package/lib/components/Icon/streamline-icons/user-question-mark.icon.d.ts.map +1 -0
  351. package/lib/components/Icon/streamline-icons/user-question-mark.icon.js +7 -0
  352. package/lib/components/Icon/streamline-icons/user-question-mark.icon.js.map +1 -0
  353. package/lib/components/Icon/streamline-icons/user-search-solid.icon.d.ts +5 -0
  354. package/lib/components/Icon/streamline-icons/user-search-solid.icon.d.ts.map +1 -0
  355. package/lib/components/Icon/streamline-icons/user-search-solid.icon.js +7 -0
  356. package/lib/components/Icon/streamline-icons/user-search-solid.icon.js.map +1 -0
  357. package/lib/components/Icon/streamline-icons/user-search.icon.d.ts +5 -0
  358. package/lib/components/Icon/streamline-icons/user-search.icon.d.ts.map +1 -0
  359. package/lib/components/Icon/streamline-icons/user-search.icon.js +7 -0
  360. package/lib/components/Icon/streamline-icons/user-search.icon.js.map +1 -0
  361. package/lib/components/Icon/streamline-icons/user-star-solid.icon.d.ts +5 -0
  362. package/lib/components/Icon/streamline-icons/user-star-solid.icon.d.ts.map +1 -0
  363. package/lib/components/Icon/streamline-icons/user-star-solid.icon.js +7 -0
  364. package/lib/components/Icon/streamline-icons/user-star-solid.icon.js.map +1 -0
  365. package/lib/components/Icon/streamline-icons/user-star.icon.js +2 -2
  366. package/lib/components/Icon/streamline-icons/user-star.icon.js.map +1 -1
  367. package/lib/components/Icon/streamline-icons/users-solid.icon.d.ts +5 -0
  368. package/lib/components/Icon/streamline-icons/users-solid.icon.d.ts.map +1 -0
  369. package/lib/components/Icon/streamline-icons/users-solid.icon.js +7 -0
  370. package/lib/components/Icon/streamline-icons/users-solid.icon.js.map +1 -0
  371. package/lib/components/Icon/streamline-icons/users.icon.d.ts +5 -0
  372. package/lib/components/Icon/streamline-icons/users.icon.d.ts.map +1 -0
  373. package/lib/components/Icon/streamline-icons/users.icon.js +7 -0
  374. package/lib/components/Icon/streamline-icons/users.icon.js.map +1 -0
  375. package/lib/components/Icon/streamline-icons/versions.icon.d.ts +5 -0
  376. package/lib/components/Icon/streamline-icons/versions.icon.d.ts.map +1 -0
  377. package/lib/components/Icon/streamline-icons/versions.icon.js +7 -0
  378. package/lib/components/Icon/streamline-icons/versions.icon.js.map +1 -0
  379. package/lib/components/Icon/streamline-icons/video-off.icon.d.ts +5 -0
  380. package/lib/components/Icon/streamline-icons/video-off.icon.d.ts.map +1 -0
  381. package/lib/components/Icon/streamline-icons/video-off.icon.js +7 -0
  382. package/lib/components/Icon/streamline-icons/video-off.icon.js.map +1 -0
  383. package/lib/components/Icon/streamline-icons/video-solid.icon.d.ts +5 -0
  384. package/lib/components/Icon/streamline-icons/video-solid.icon.d.ts.map +1 -0
  385. package/lib/components/Icon/streamline-icons/video-solid.icon.js +7 -0
  386. package/lib/components/Icon/streamline-icons/video-solid.icon.js.map +1 -0
  387. package/lib/components/Icon/streamline-icons/video.icon.d.ts +5 -0
  388. package/lib/components/Icon/streamline-icons/video.icon.d.ts.map +1 -0
  389. package/lib/components/Icon/streamline-icons/video.icon.js +7 -0
  390. package/lib/components/Icon/streamline-icons/video.icon.js.map +1 -0
  391. package/lib/components/Icon/streamline-icons/voicemail.icon.d.ts +5 -0
  392. package/lib/components/Icon/streamline-icons/voicemail.icon.d.ts.map +1 -0
  393. package/lib/components/Icon/streamline-icons/voicemail.icon.js +7 -0
  394. package/lib/components/Icon/streamline-icons/voicemail.icon.js.map +1 -0
  395. package/lib/components/Icon/streamline-icons/vr-solid.icon.d.ts +5 -0
  396. package/lib/components/Icon/streamline-icons/vr-solid.icon.d.ts.map +1 -0
  397. package/lib/components/Icon/streamline-icons/vr-solid.icon.js +7 -0
  398. package/lib/components/Icon/streamline-icons/vr-solid.icon.js.map +1 -0
  399. package/lib/components/Icon/streamline-icons/vr.icon.d.ts +5 -0
  400. package/lib/components/Icon/streamline-icons/vr.icon.d.ts.map +1 -0
  401. package/lib/components/Icon/streamline-icons/vr.icon.js +7 -0
  402. package/lib/components/Icon/streamline-icons/vr.icon.js.map +1 -0
  403. package/lib/components/Icon/streamline-icons/walkie-solid.icon.d.ts +5 -0
  404. package/lib/components/Icon/streamline-icons/walkie-solid.icon.d.ts.map +1 -0
  405. package/lib/components/Icon/streamline-icons/walkie-solid.icon.js +7 -0
  406. package/lib/components/Icon/streamline-icons/walkie-solid.icon.js.map +1 -0
  407. package/lib/components/Icon/streamline-icons/walkie.icon.d.ts +5 -0
  408. package/lib/components/Icon/streamline-icons/walkie.icon.d.ts.map +1 -0
  409. package/lib/components/Icon/streamline-icons/walkie.icon.js +7 -0
  410. package/lib/components/Icon/streamline-icons/walkie.icon.js.map +1 -0
  411. package/lib/components/Icon/streamline-icons/wallet-solid.icon.d.ts +5 -0
  412. package/lib/components/Icon/streamline-icons/wallet-solid.icon.d.ts.map +1 -0
  413. package/lib/components/Icon/streamline-icons/wallet-solid.icon.js +7 -0
  414. package/lib/components/Icon/streamline-icons/wallet-solid.icon.js.map +1 -0
  415. package/lib/components/Icon/streamline-icons/wallet.icon.d.ts +5 -0
  416. package/lib/components/Icon/streamline-icons/wallet.icon.d.ts.map +1 -0
  417. package/lib/components/Icon/streamline-icons/wallet.icon.js +7 -0
  418. package/lib/components/Icon/streamline-icons/wallet.icon.js.map +1 -0
  419. package/lib/components/Icon/streamline-icons/watch-solid.icon.d.ts +5 -0
  420. package/lib/components/Icon/streamline-icons/watch-solid.icon.d.ts.map +1 -0
  421. package/lib/components/Icon/streamline-icons/watch-solid.icon.js +7 -0
  422. package/lib/components/Icon/streamline-icons/watch-solid.icon.js.map +1 -0
  423. package/lib/components/Icon/streamline-icons/watch.icon.d.ts +5 -0
  424. package/lib/components/Icon/streamline-icons/watch.icon.d.ts.map +1 -0
  425. package/lib/components/Icon/streamline-icons/watch.icon.js +7 -0
  426. package/lib/components/Icon/streamline-icons/watch.icon.js.map +1 -0
  427. package/lib/components/Icon/streamline-icons/waypoint-solid.icon.d.ts +5 -0
  428. package/lib/components/Icon/streamline-icons/waypoint-solid.icon.d.ts.map +1 -0
  429. package/lib/components/Icon/streamline-icons/waypoint-solid.icon.js +7 -0
  430. package/lib/components/Icon/streamline-icons/waypoint-solid.icon.js.map +1 -0
  431. package/lib/components/Icon/streamline-icons/waypoint.icon.d.ts +5 -0
  432. package/lib/components/Icon/streamline-icons/waypoint.icon.d.ts.map +1 -0
  433. package/lib/components/Icon/streamline-icons/waypoint.icon.js +7 -0
  434. package/lib/components/Icon/streamline-icons/waypoint.icon.js.map +1 -0
  435. package/lib/components/Icon/streamline-icons/webcam-solid.icon.d.ts +5 -0
  436. package/lib/components/Icon/streamline-icons/webcam-solid.icon.d.ts.map +1 -0
  437. package/lib/components/Icon/streamline-icons/webcam-solid.icon.js +7 -0
  438. package/lib/components/Icon/streamline-icons/webcam-solid.icon.js.map +1 -0
  439. package/lib/components/Icon/streamline-icons/webcam.icon.d.ts +5 -0
  440. package/lib/components/Icon/streamline-icons/webcam.icon.d.ts.map +1 -0
  441. package/lib/components/Icon/streamline-icons/webcam.icon.js +7 -0
  442. package/lib/components/Icon/streamline-icons/webcam.icon.js.map +1 -0
  443. package/lib/components/Icon/streamline-icons/whatsapp.icon.d.ts +5 -0
  444. package/lib/components/Icon/streamline-icons/whatsapp.icon.d.ts.map +1 -0
  445. package/lib/components/Icon/streamline-icons/whatsapp.icon.js +7 -0
  446. package/lib/components/Icon/streamline-icons/whatsapp.icon.js.map +1 -0
  447. package/lib/components/Icon/streamline-icons/wifi-none.icon.d.ts +5 -0
  448. package/lib/components/Icon/streamline-icons/wifi-none.icon.d.ts.map +1 -0
  449. package/lib/components/Icon/streamline-icons/wifi-none.icon.js +7 -0
  450. package/lib/components/Icon/streamline-icons/wifi-none.icon.js.map +1 -0
  451. package/lib/components/Icon/streamline-icons/wifi-off.icon.d.ts +5 -0
  452. package/lib/components/Icon/streamline-icons/wifi-off.icon.d.ts.map +1 -0
  453. package/lib/components/Icon/streamline-icons/wifi-off.icon.js +7 -0
  454. package/lib/components/Icon/streamline-icons/wifi-off.icon.js.map +1 -0
  455. package/lib/components/Icon/streamline-icons/wizard-solid.icon.d.ts +5 -0
  456. package/lib/components/Icon/streamline-icons/wizard-solid.icon.d.ts.map +1 -0
  457. package/lib/components/Icon/streamline-icons/wizard-solid.icon.js +7 -0
  458. package/lib/components/Icon/streamline-icons/wizard-solid.icon.js.map +1 -0
  459. package/lib/components/Icon/streamline-icons/wizard.icon.d.ts +5 -0
  460. package/lib/components/Icon/streamline-icons/wizard.icon.d.ts.map +1 -0
  461. package/lib/components/Icon/streamline-icons/wizard.icon.js +7 -0
  462. package/lib/components/Icon/streamline-icons/wizard.icon.js.map +1 -0
  463. package/lib/components/Icon/streamline-icons/wrench-solid.icon.d.ts +5 -0
  464. package/lib/components/Icon/streamline-icons/wrench-solid.icon.d.ts.map +1 -0
  465. package/lib/components/Icon/streamline-icons/wrench-solid.icon.js +7 -0
  466. package/lib/components/Icon/streamline-icons/wrench-solid.icon.js.map +1 -0
  467. package/lib/components/Icon/streamline-icons/wrench.icon.d.ts +5 -0
  468. package/lib/components/Icon/streamline-icons/wrench.icon.d.ts.map +1 -0
  469. package/lib/components/Icon/streamline-icons/wrench.icon.js +7 -0
  470. package/lib/components/Icon/streamline-icons/wrench.icon.js.map +1 -0
  471. package/lib/components/Icon/streamlineIconNames.d.ts +1 -1
  472. package/lib/components/Icon/streamlineIconNames.d.ts.map +1 -1
  473. package/lib/components/Icon/streamlineIconNames.js +82 -0
  474. package/lib/components/Icon/streamlineIconNames.js.map +1 -1
  475. package/lib/components/IconPicker/IconPicker.d.ts +4 -4
  476. package/lib/components/IconPicker/IconPicker.d.ts.map +1 -1
  477. package/lib/components/IconPicker/IconPicker.js +19 -25
  478. package/lib/components/IconPicker/IconPicker.js.map +1 -1
  479. package/lib/components/Input/Input.styles.d.ts.map +1 -1
  480. package/lib/components/Input/Input.styles.js +2 -17
  481. package/lib/components/Input/Input.styles.js.map +1 -1
  482. package/lib/components/Lightbox/Lightbox.d.ts +1 -1
  483. package/lib/components/Lightbox/Lightbox.d.ts.map +1 -1
  484. package/lib/components/Lightbox/Lightbox.js +9 -3
  485. package/lib/components/Lightbox/Lightbox.js.map +1 -1
  486. package/lib/components/Lightbox/Lightbox.test-ids.d.ts +1 -1
  487. package/lib/components/Lightbox/Lightbox.test-ids.d.ts.map +1 -1
  488. package/lib/components/Lightbox/Lightbox.test-ids.js +1 -0
  489. package/lib/components/Lightbox/Lightbox.test-ids.js.map +1 -1
  490. package/lib/components/ListToolbar/ListToolbar.d.ts.map +1 -1
  491. package/lib/components/ListToolbar/ListToolbar.js +100 -39
  492. package/lib/components/ListToolbar/ListToolbar.js.map +1 -1
  493. package/lib/components/ListToolbar/ListToolbar.styles.d.ts.map +1 -1
  494. package/lib/components/ListToolbar/ListToolbar.styles.js +9 -14
  495. package/lib/components/ListToolbar/ListToolbar.styles.js.map +1 -1
  496. package/lib/components/ListToolbar/ListToolbar.types.d.ts +7 -3
  497. package/lib/components/ListToolbar/ListToolbar.types.d.ts.map +1 -1
  498. package/lib/components/ListToolbar/ListToolbar.types.js.map +1 -1
  499. package/lib/components/Location/CurrentLocationButton.d.ts.map +1 -1
  500. package/lib/components/Location/CurrentLocationButton.js +4 -2
  501. package/lib/components/Location/CurrentLocationButton.js.map +1 -1
  502. package/lib/components/Location/GoogleMapsAPI.d.ts +43 -0
  503. package/lib/components/Location/GoogleMapsAPI.d.ts.map +1 -0
  504. package/lib/components/Location/GoogleMapsAPI.js +244 -0
  505. package/lib/components/Location/GoogleMapsAPI.js.map +1 -0
  506. package/lib/components/Location/Location.types.d.ts +3 -2
  507. package/lib/components/Location/Location.types.d.ts.map +1 -1
  508. package/lib/components/Location/Location.types.js.map +1 -1
  509. package/lib/components/Location/LocationAPI.types.d.ts +23 -0
  510. package/lib/components/Location/LocationAPI.types.d.ts.map +1 -0
  511. package/lib/components/Location/LocationAPI.types.js +2 -0
  512. package/lib/components/Location/LocationAPI.types.js.map +1 -0
  513. package/lib/components/Location/LocationDisplay.d.ts.map +1 -1
  514. package/lib/components/Location/LocationDisplay.js +5 -3
  515. package/lib/components/Location/LocationDisplay.js.map +1 -1
  516. package/lib/components/Location/LocationInput.d.ts.map +1 -1
  517. package/lib/components/Location/LocationInput.js +24 -21
  518. package/lib/components/Location/LocationInput.js.map +1 -1
  519. package/lib/components/Location/LocationView.d.ts.map +1 -1
  520. package/lib/components/Location/LocationView.js +8 -5
  521. package/lib/components/Location/LocationView.js.map +1 -1
  522. package/lib/components/Location/index.d.ts +2 -1
  523. package/lib/components/Location/index.d.ts.map +1 -1
  524. package/lib/components/Location/index.js +2 -1
  525. package/lib/components/Location/index.js.map +1 -1
  526. package/lib/components/Location/utils.d.ts +3 -19
  527. package/lib/components/Location/utils.d.ts.map +1 -1
  528. package/lib/components/Location/utils.js +7 -161
  529. package/lib/components/Location/utils.js.map +1 -1
  530. package/lib/components/MetaList/MetaList.d.ts.map +1 -1
  531. package/lib/components/MetaList/MetaList.js +3 -2
  532. package/lib/components/MetaList/MetaList.js.map +1 -1
  533. package/lib/components/Modal/Modal.styles.d.ts.map +1 -1
  534. package/lib/components/Modal/Modal.styles.js +5 -1
  535. package/lib/components/Modal/Modal.styles.js.map +1 -1
  536. package/lib/components/MultiStepForm/MultiStepForm.d.ts.map +1 -1
  537. package/lib/components/MultiStepForm/MultiStepForm.js +29 -3
  538. package/lib/components/MultiStepForm/MultiStepForm.js.map +1 -1
  539. package/lib/components/Number/NumberInput.js +2 -2
  540. package/lib/components/Number/NumberInput.js.map +1 -1
  541. package/lib/components/Number/utils.d.ts +1 -1
  542. package/lib/components/Number/utils.d.ts.map +1 -1
  543. package/lib/components/Number/utils.js +1 -2
  544. package/lib/components/Number/utils.js.map +1 -1
  545. package/lib/components/PageTemplates/DashboardPage.js +2 -2
  546. package/lib/components/PageTemplates/DashboardPage.js.map +1 -1
  547. package/lib/components/PageTemplates/GridLayout/EditorBackground.js +1 -1
  548. package/lib/components/PageTemplates/GridLayout/EditorBackground.js.map +1 -1
  549. package/lib/components/PageTemplates/GridLayout/GridLayoutEditor.js +1 -1
  550. package/lib/components/PageTemplates/GridLayout/GridLayoutEditor.js.map +1 -1
  551. package/lib/components/PageTemplates/GridLayout/GridLayoutViewer.d.ts +5 -0
  552. package/lib/components/PageTemplates/GridLayout/GridLayoutViewer.d.ts.map +1 -1
  553. package/lib/components/PageTemplates/GridLayout/GridLayoutViewer.js +2 -2
  554. package/lib/components/PageTemplates/GridLayout/GridLayoutViewer.js.map +1 -1
  555. package/lib/components/PageTemplates/GridLayout/config.d.ts +1 -1
  556. package/lib/components/PageTemplates/GridLayout/config.d.ts.map +1 -1
  557. package/lib/components/PageTemplates/GridLayout/config.js +3 -3
  558. package/lib/components/PageTemplates/GridLayout/config.js.map +1 -1
  559. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
  560. package/lib/components/PageTemplates/PageTemplates.js +33 -5
  561. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  562. package/lib/components/Phone/PhoneInput.d.ts.map +1 -1
  563. package/lib/components/Phone/PhoneInput.js +1 -1
  564. package/lib/components/Phone/PhoneInput.js.map +1 -1
  565. package/lib/components/Popover/Popover.d.ts.map +1 -1
  566. package/lib/components/Popover/Popover.js +4 -22
  567. package/lib/components/Popover/Popover.js.map +1 -1
  568. package/lib/components/Popover/Popover.styles.d.ts.map +1 -1
  569. package/lib/components/Popover/Popover.styles.js +19 -4
  570. package/lib/components/Popover/Popover.styles.js.map +1 -1
  571. package/lib/components/Popover/modifiers.d.ts.map +1 -1
  572. package/lib/components/Popover/modifiers.js +10 -0
  573. package/lib/components/Popover/modifiers.js.map +1 -1
  574. package/lib/components/RadioCheck/RadioCheck.d.ts.map +1 -1
  575. package/lib/components/RadioCheck/RadioCheck.js +2 -2
  576. package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
  577. package/lib/components/Tabs/TabPanel.d.ts.map +1 -1
  578. package/lib/components/Tabs/TabPanel.js +8 -0
  579. package/lib/components/Tabs/TabPanel.js.map +1 -1
  580. package/lib/components/Toaster/Toaster.d.ts.map +1 -1
  581. package/lib/components/Toaster/Toaster.js +9 -5
  582. package/lib/components/Toaster/Toaster.js.map +1 -1
  583. package/lib/components/Toaster/Toaster.types.d.ts +3 -3
  584. package/lib/components/Toaster/Toaster.types.d.ts.map +1 -1
  585. package/lib/components/Toaster/Toaster.types.js.map +1 -1
  586. package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
  587. package/lib/components/Tooltip/Tooltip.js +3 -1
  588. package/lib/components/Tooltip/Tooltip.js.map +1 -1
  589. package/lib/components/Tree/Tree.js +1 -1
  590. package/lib/components/Tree/Tree.js.map +1 -1
  591. package/lib/hooks/index.d.ts +2 -0
  592. package/lib/hooks/index.d.ts.map +1 -1
  593. package/lib/hooks/index.js +2 -0
  594. package/lib/hooks/index.js.map +1 -1
  595. package/lib/hooks/useAnimatedText.d.ts +11 -0
  596. package/lib/hooks/useAnimatedText.d.ts.map +1 -0
  597. package/lib/hooks/useAnimatedText.js +96 -0
  598. package/lib/hooks/useAnimatedText.js.map +1 -0
  599. package/lib/hooks/useBreakpoint.d.ts.map +1 -1
  600. package/lib/hooks/useBreakpoint.js +5 -2
  601. package/lib/hooks/useBreakpoint.js.map +1 -1
  602. package/lib/hooks/useChToPxConversionFactor.d.ts +2 -2
  603. package/lib/hooks/useChToPxConversionFactor.d.ts.map +1 -1
  604. package/lib/hooks/useChToPxConversionFactor.js +4 -13
  605. package/lib/hooks/useChToPxConversionFactor.js.map +1 -1
  606. package/lib/hooks/useI18n.d.ts +182 -2
  607. package/lib/hooks/useI18n.d.ts.map +1 -1
  608. package/lib/hooks/useItemIntersection.d.ts +2 -1
  609. package/lib/hooks/useItemIntersection.d.ts.map +1 -1
  610. package/lib/hooks/useItemIntersection.js +10 -4
  611. package/lib/hooks/useItemIntersection.js.map +1 -1
  612. package/lib/hooks/usePopoverMap.d.ts +10 -0
  613. package/lib/hooks/usePopoverMap.d.ts.map +1 -0
  614. package/lib/hooks/usePopoverMap.js +34 -0
  615. package/lib/hooks/usePopoverMap.js.map +1 -0
  616. package/lib/hooks/useThemeMode.d.ts +10 -0
  617. package/lib/hooks/useThemeMode.d.ts.map +1 -0
  618. package/lib/hooks/useThemeMode.js +11 -0
  619. package/lib/hooks/useThemeMode.js.map +1 -0
  620. package/lib/i18n/default.d.ts +186 -2
  621. package/lib/i18n/default.d.ts.map +1 -1
  622. package/lib/i18n/default.js +200 -5
  623. package/lib/i18n/default.js.map +1 -1
  624. package/lib/i18n/i18n.d.ts +182 -2
  625. package/lib/i18n/i18n.d.ts.map +1 -1
  626. package/lib/styles/GlobalStyle.d.ts +2 -2
  627. package/lib/styles/GlobalStyle.d.ts.map +1 -1
  628. package/lib/styles/GlobalStyle.js +8 -3
  629. package/lib/styles/GlobalStyle.js.map +1 -1
  630. package/lib/styles/animations.d.ts +9 -0
  631. package/lib/styles/animations.d.ts.map +1 -0
  632. package/lib/styles/animations.js +78 -0
  633. package/lib/styles/animations.js.map +1 -0
  634. package/lib/styles/constants.d.ts +5 -0
  635. package/lib/styles/constants.d.ts.map +1 -0
  636. package/lib/styles/constants.js +5 -0
  637. package/lib/styles/constants.js.map +1 -0
  638. package/lib/styles/gradients.d.ts +2 -0
  639. package/lib/styles/gradients.d.ts.map +1 -1
  640. package/lib/styles/gradients.js +4 -1
  641. package/lib/styles/gradients.js.map +1 -1
  642. package/lib/styles/index.d.ts +1 -0
  643. package/lib/styles/index.d.ts.map +1 -1
  644. package/lib/styles/index.js +1 -0
  645. package/lib/styles/index.js.map +1 -1
  646. package/lib/styles/utils.d.ts +1 -1
  647. package/lib/styles/utils.d.ts.map +1 -1
  648. package/lib/styles/utils.js +1 -1
  649. package/lib/styles/utils.js.map +1 -1
  650. package/lib/theme/index.d.ts +2 -0
  651. package/lib/theme/index.d.ts.map +1 -1
  652. package/lib/theme/index.js +2 -0
  653. package/lib/theme/index.js.map +1 -1
  654. package/lib/theme/theme.d.ts +150 -0
  655. package/lib/theme/theme.d.ts.map +1 -1
  656. package/lib/theme/themeDefinition.json +82 -0
  657. package/lib/theme/themeOverrides.schema.json +102 -0
  658. package/lib/theme/themes/bootes2025Theme.json +3 -3
  659. package/lib/theme/themes/cygnus2025Theme.json +17 -17
  660. package/lib/theme/themes/studioDarkTheme.json +240 -0
  661. package/lib/theme/themes/studioTheme.json +240 -0
  662. package/lib/utils/focusNonInteractiveElement.d.ts +9 -0
  663. package/lib/utils/focusNonInteractiveElement.d.ts.map +1 -0
  664. package/lib/utils/focusNonInteractiveElement.js +27 -0
  665. package/lib/utils/focusNonInteractiveElement.js.map +1 -0
  666. package/lib/utils/getChToPxConversionFactor.d.ts +11 -0
  667. package/lib/utils/getChToPxConversionFactor.d.ts.map +1 -0
  668. package/lib/utils/getChToPxConversionFactor.js +18 -0
  669. package/lib/utils/getChToPxConversionFactor.js.map +1 -0
  670. package/lib/utils/getChildOfRootNode.d.ts +10 -0
  671. package/lib/utils/getChildOfRootNode.d.ts.map +1 -0
  672. package/lib/utils/getChildOfRootNode.js +19 -0
  673. package/lib/utils/getChildOfRootNode.js.map +1 -0
  674. package/lib/utils/getFocusables.d.ts +4 -2
  675. package/lib/utils/getFocusables.d.ts.map +1 -1
  676. package/lib/utils/getFocusables.js +9 -7
  677. package/lib/utils/getFocusables.js.map +1 -1
  678. package/lib/utils/index.d.ts +4 -0
  679. package/lib/utils/index.d.ts.map +1 -1
  680. package/lib/utils/index.js +4 -0
  681. package/lib/utils/index.js.map +1 -1
  682. package/lib/utils/isInstance.d.ts +4 -4
  683. package/lib/utils/isInstance.d.ts.map +1 -1
  684. package/lib/utils/isInstance.js +20 -8
  685. package/lib/utils/isInstance.js.map +1 -1
  686. package/lib/utils/markdownTokenizer.d.ts +3 -0
  687. package/lib/utils/markdownTokenizer.d.ts.map +1 -0
  688. package/lib/utils/markdownTokenizer.js +159 -0
  689. package/lib/utils/markdownTokenizer.js.map +1 -0
  690. package/package.json +5 -3
@@ -1 +1 @@
1
- {"version":3,"file":"Toaster.types.js","sourceRoot":"","sources":["../../../src/components/Toaster/Toaster.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { MouseEventHandler, ReactNode } from 'react';\n\nimport type { TestIdProp } from '../../types';\n\nexport type BaseToastMessage = {\n /** String to identify the specific message. Used as onDismiss callback arg. */\n id?: string;\n /** A short message to provide feedback based upon a user action. */\n content: string;\n /**\n * Time in milliseconds to automatically dismiss toast.\n * Can be set globally on Toaster and overridden individually at a message level.\n * @default Infinity\n */\n dismissAfter?: number;\n /** Called when user or timer dismisses toasts. Callback is passed the message id and boolean indicating if the dismissal was timed. */\n onDismiss?: ({ id, timeout }: { id: NonNullable<ToastMessage['id']>; timeout: boolean }) => void;\n};\n\nexport type CreatedMessage = Pick<BaseToastMessage, 'onDismiss'> & {\n /** String to identify the newly created record. Used as onDismiss callback arg. */\n id: string;\n /** Text of the link. */\n label: string;\n /** Link to newly created record. */\n href: string;\n /** Called when link is clicked. */\n onClick?: MouseEventHandler<HTMLAnchorElement>;\n dismissAfter?: never;\n content?: never;\n};\n\nexport type ToastMessage = BaseToastMessage | CreatedMessage;\n\nexport interface ToasterProps extends TestIdProp {\n /** The element(s) responsible for handling the Toaster state. */\n children: ReactNode;\n /**\n * Time in milliseconds to automatically dismiss toast.\n * Can be set globally on Toaster and overridden individually at a message level.\n * @default Infinity\n */\n dismissAfter?: ToastMessage['dismissAfter'];\n /** Called when user or timer dismisses Toasts. Callback is passed the message id and boolean indicating if the dismissal was timed. */\n onDismiss?: ToastMessage['onDismiss'];\n}\n"]}
1
+ {"version":3,"file":"Toaster.types.js","sourceRoot":"","sources":["../../../src/components/Toaster/Toaster.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { MouseEventHandler, ReactNode } from 'react';\n\nimport type { TestIdProp } from '../../types';\n\nexport type BaseToastMessage = {\n /** String to identify the specific message. Used as onDismiss callback arg. */\n id?: string;\n /** A short message to provide feedback based upon a user action. */\n content: string;\n /**\n * Time in milliseconds to automatically dismiss toast.\n * Can be set globally on Toaster and overridden individually at a message level.\n * @default Infinity\n */\n dismissAfter?: number;\n /** Called when user or timer dismisses toasts. Callback is passed the message id and boolean indicating if the dismissal was timed. */\n onDismiss?: ({ id, timeout }: { id: NonNullable<ToastMessage['id']>; timeout: boolean }) => void;\n};\n\nexport type CreatedMessage = Pick<BaseToastMessage, 'onDismiss' | 'id'> & {\n /** Short identifier prepended to the link text */\n caseId?: string;\n /** Text of the link. */\n label: string;\n /** Link to newly created record. */\n href: string;\n /** Called when link is clicked. */\n onClick?: MouseEventHandler<HTMLAnchorElement>;\n dismissAfter?: never;\n content?: never;\n};\n\nexport type ToastMessage = BaseToastMessage | CreatedMessage;\n\nexport interface ToasterProps extends TestIdProp {\n /** The element(s) responsible for handling the Toaster state. */\n children: ReactNode;\n /**\n * Time in milliseconds to automatically dismiss toast.\n * Can be set globally on Toaster and overridden individually at a message level.\n * @default Infinity\n */\n dismissAfter?: ToastMessage['dismissAfter'];\n /** Called when user or timer dismisses Toasts. Callback is passed the message id and boolean indicating if the dismissal was timed. */\n onDismiss?: ToastMessage['onDismiss'];\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/Toolt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;AAG1F,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAQtD,MAAM,WAAW,YAAa,SAAQ,SAAS,EAAE,UAAU;IACzD,oCAAoC;IACpC,QAAQ,EAAE,SAAS,CAAC;IACpB,gDAAgD;IAChD,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,2DAA2D;IAC3D,eAAe,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC;IAC3C;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB;;;OAGG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;IAChC;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,SAAS,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;IACtC;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IAClC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAED,eAAO,MAAM,aAAa,yGAcxB,CAAC;;;;AA4LH,wBAAuD"}
@@ -15,9 +15,11 @@ export const StyledTooltip = styled.div(({ theme }) => {
15
15
  color: ${theme.components.tooltip['foreground-color']};
16
16
  font-size: ${fontSize.xxs};
17
17
  max-width: 40ch;
18
- padding: ${theme.base.spacing};
18
+ padding: calc(${theme.base.spacing} / 2);
19
19
  white-space: pre-line;
20
20
  word-break: break-word;
21
+ --scale-in-size: 0;
22
+ --animation-duration: ${theme.base.animation.speed};
21
23
  `;
22
24
  });
23
25
  StyledTooltip.defaultProps = defaultThemeProp;
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":";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,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAC9B,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAC7C;aACF;SACF;KACF,CAAC;IAEF,OAAO,CACL,KAAC,aAAa,IAAC,KAAK,EAAE,YAAY,YAChC,KAAC,OAAO,mBACO,OAAO,CAAC,IAAI,EACzB,EAAE,EAAE,EAAE,EACN,OAAO,EAAE,OAAO,KACZ,SAAS,EACb,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC3C,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC3C,WAAW,EAAE,GAAG,EAAE;gBAChB,OAAO,CAAC,IAAI,CAAC,CAAC;YAChB,CAAC,EACD,UAAU,EAAE,GAAG,EAAE;gBACf,OAAO,CAAC,KAAK,CAAC,CAAC;YACjB,CAAC,EACD,QAAQ,EAAC,OAAO,EAChB,EAAE,EAAE,aAAa,EACjB,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,EAC9C,MAAM,EAAE,MAAM,EACd,KAAK,QACL,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,kBAAkB,QAClB,GAAG,EAAE,UAAU,YAEd,QAAQ,GACD,GACI,CACjB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["import { forwardRef, useCallback, useEffect, useRef, useState } from 'react';\nimport type { MutableRefObject, PropsWithoutRef, ReactNode, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport type { BaseProps, ForwardRefForwardPropsComponent, TestIdProp } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport Popover from '../Popover';\nimport type { Delay, PopoverProps } from '../Popover';\nimport { useConsolidatedRef, useTestIds, useTheme, useUID } from '../../hooks';\nimport { calculateFontSize, readableHue } from '../../styles';\nimport { getActiveElement, mouseState, testElForOverflow, withTestIds } from '../../utils';\nimport { ThemeOverride } from '../Configuration';\n\nimport { getTooltipTestIds } from './Tooltip.test-ids';\n\nexport interface TooltipProps extends BaseProps, TestIdProp {\n /** Text content for the tooltip. */\n children: ReactNode;\n /** Element to serve as the tooltip's target. */\n target: Element | null;\n /** Elements to ignore from within the tooltip's target. */\n ignoredElements?: TooltipProps['target'][];\n /**\n * Delay showing the tooltip on mouseenter.\n * @default 'short'\n */\n showDelay?: Delay;\n /**\n * Delay hiding the tooltip on mouseleave.\n * @default 'long'\n */\n hideDelay?: Delay;\n /**\n * If true, the Tooltip will render outside of the current DOM hierarchy in a [portal](https://reactjs.org/docs/portals.html).\n * @default true\n */\n portal?: PopoverProps['portal'];\n /**\n * If true, the Tooltip will automatically apply an aria-describedby attribute to its target.\n * @default true\n */\n describeTarget?: boolean;\n /**\n * Sets the placement of the tooltip relative to the target.\n * @default 'bottom'\n */\n placement?: PopoverProps['placement'];\n /**\n * Conditionally renders a tooltip only if the associated element's (or its descendants) text content is truncated.\n * To work, the associated element must be be displayed as a CSS \"block box\" i.e. block, inline-block, etc...\n * @default false\n */\n smart?: boolean;\n /**\n * The group that the Popover belongs to. Popovers in the same group will be closed when others open.\n * @default 'tooltip'\n */\n groupId?: PopoverProps['groupId'];\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const StyledTooltip = styled.div(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n background-color: ${theme.components.tooltip['background-color']};\n color: ${theme.components.tooltip['foreground-color']};\n font-size: ${fontSize.xxs};\n max-width: 40ch;\n padding: ${theme.base.spacing};\n white-space: pre-line;\n word-break: break-word;\n `;\n});\n\nStyledTooltip.defaultProps = defaultThemeProp;\n\nconst Tooltip: ForwardRefForwardPropsComponent<TooltipProps> = forwardRef(function Tooltip(\n {\n testId,\n children,\n target,\n ignoredElements = [],\n showDelay = 'short',\n hideDelay = 'long',\n placement = 'top',\n describeTarget = true,\n smart,\n groupId = 'tooltip',\n ...restProps\n }: PropsWithoutRef<TooltipProps>,\n ref: TooltipProps['ref']\n) {\n const id = useUID();\n const [show, setShow] = useState(false);\n const [ignoreDelay, setIgnoreDelay] = useState(false);\n const tooltipRef = useConsolidatedRef(ref);\n const lastClickedRef: MutableRefObject<EventTarget | null> = useRef(null);\n const testIds = useTestIds(testId, getTooltipTestIds);\n\n const stringContentOnly =\n typeof children === 'string' ||\n (Array.isArray(children) && children.every(child => typeof child === 'string'));\n\n const onMouseDown = useCallback(\n ({ target: eTarget }: MouseEvent) => {\n lastClickedRef.current = eTarget;\n if (eTarget === tooltipRef.current || eTarget === target) return;\n setShow(false);\n },\n [target]\n );\n\n useEffect(() => {\n if (!target) return;\n\n const showTooltip = () => {\n // This approach may result in a tooltip NOT appearing 1px before it should due to browser specifics. Enhance as needed.\n // https://stackoverflow.com/a/64747288\n\n const checkTruncation = (element: Element): boolean => {\n if (\n testElForOverflow(element).some(Boolean) &&\n !['absolute', 'fixed'].includes(window.getComputedStyle(element).position)\n )\n return true;\n\n for (const child of element.children) {\n if (checkTruncation(child)) return true;\n }\n\n return false;\n };\n\n setShow(smart ? checkTruncation(target) : true);\n };\n\n const onFocusIn = () => {\n showTooltip();\n };\n\n const onFocusOut = () => {\n if (!lastClickedRef.current || lastClickedRef.current !== tooltipRef.current) {\n setShow(false);\n }\n lastClickedRef.current = null;\n };\n\n const onMouseEnter = () => {\n if (ignoredElements.some(exclusion => exclusion?.matches(':hover')) || mouseState.primary) {\n return;\n }\n\n showTooltip();\n };\n\n const onMouseLeave = () => {\n if (getActiveElement() !== target) {\n setShow(false);\n }\n };\n\n const onKeyDown = ({ key }: KeyboardEvent) => {\n if (key === 'Escape' && show) {\n setIgnoreDelay(true);\n setShow(false);\n }\n };\n\n document.addEventListener('keydown', onKeyDown);\n document.addEventListener('mousedown', onMouseDown);\n\n target.addEventListener('focusin', onFocusIn);\n target.addEventListener('focusout', onFocusOut);\n target.addEventListener('mouseenter', onMouseEnter);\n target.addEventListener('mouseleave', onMouseLeave);\n\n return () => {\n document.removeEventListener('keydown', onKeyDown);\n document.removeEventListener('mousedown', onMouseDown);\n\n target.removeEventListener('focusin', onFocusIn);\n target.removeEventListener('focusout', onFocusOut);\n target.removeEventListener('mouseenter', onMouseEnter);\n target.removeEventListener('mouseleave', onMouseLeave);\n };\n }, [target, onMouseDown, smart, show]);\n\n useEffect(() => {\n if (target && describeTarget && show) {\n const describedBy = target.getAttribute('aria-describedby');\n // Set the attribute to the old attribute plus the id\n target.setAttribute('aria-describedby', describedBy ? `${describedBy} ${id}` : id);\n } else if (target) {\n // Get the old attribute\n const describedBy = target.getAttribute('aria-describedby');\n if (describedBy) {\n // If the old attribute matches the id just remove it entirely\n if (describedBy === id) {\n target.removeAttribute('aria-describedby');\n } else {\n // Otherwise we want to just remove the id that was added and reset the attribute to what it was before\n const oldDescribedBy = describedBy.replace(new RegExp(`(?:^|\\\\s+)${id}`), '');\n target.setAttribute('aria-describedby', oldDescribedBy);\n }\n }\n }\n }, [describeTarget, target, show]);\n\n useEffect(() => {\n if (!show && ignoreDelay) {\n setIgnoreDelay(false);\n }\n }, [show, ignoreDelay]);\n\n const theme = useTheme();\n const tooltipTheme = {\n base: {\n palette: {\n 'primary-background': theme.components.tooltip['background-color'],\n 'foreground-color': theme.components.tooltip['foreground-color'],\n interactive: readableHue(\n theme.base.palette.interactive,\n theme.components.tooltip['background-color']\n )\n }\n }\n };\n\n return (\n <ThemeOverride theme={tooltipTheme}>\n <Popover\n data-testid={testIds.root}\n id={id}\n groupId={groupId}\n {...restProps}\n show={show}\n showDelay={ignoreDelay ? 'none' : showDelay}\n hideDelay={ignoreDelay ? 'none' : hideDelay}\n onMouseOver={() => {\n setShow(true);\n }}\n onMouseOut={() => {\n setShow(false);\n }}\n strategy='fixed'\n as={StyledTooltip}\n role={stringContentOnly ? 'tooltip' : 'dialog'}\n target={target}\n arrow\n placement={placement}\n onMouseDown={onMouseDown}\n hideOnTargetHidden\n ref={tooltipRef}\n >\n {children}\n </Popover>\n </ThemeOverride>\n );\n});\n\nexport default withTestIds(Tooltip, getTooltipTestIds);\n"]}
1
+ {"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE7E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,OAAO,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC3F,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAgDvD,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACpD,MAAM,QAAQ,GAAG,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IAEtF,OAAO,GAAG,CAAA;wBACY,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,kBAAkB,CAAC;aACvD,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,kBAAkB,CAAC;iBACxC,QAAQ,CAAC,GAAG;;oBAET,KAA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C,CAAC","sourcesContent":["import { forwardRef, useCallback, useEffect, useRef, useState } from 'react';\nimport type { MutableRefObject, PropsWithoutRef, ReactNode, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport type { BaseProps, ForwardRefForwardPropsComponent, TestIdProp } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport Popover from '../Popover';\nimport type { Delay, PopoverProps } from '../Popover';\nimport { useConsolidatedRef, useTestIds, useTheme, useUID } from '../../hooks';\nimport { calculateFontSize, readableHue } from '../../styles';\nimport { getActiveElement, mouseState, testElForOverflow, withTestIds } from '../../utils';\nimport { ThemeOverride } from '../Configuration';\n\nimport { getTooltipTestIds } from './Tooltip.test-ids';\n\nexport interface TooltipProps extends BaseProps, TestIdProp {\n /** Text content for the tooltip. */\n children: ReactNode;\n /** Element to serve as the tooltip's target. */\n target: Element | null;\n /** Elements to ignore from within the tooltip's target. */\n ignoredElements?: TooltipProps['target'][];\n /**\n * Delay showing the tooltip on mouseenter.\n * @default 'short'\n */\n showDelay?: Delay;\n /**\n * Delay hiding the tooltip on mouseleave.\n * @default 'long'\n */\n hideDelay?: Delay;\n /**\n * If true, the Tooltip will render outside of the current DOM hierarchy in a [portal](https://reactjs.org/docs/portals.html).\n * @default true\n */\n portal?: PopoverProps['portal'];\n /**\n * If true, the Tooltip will automatically apply an aria-describedby attribute to its target.\n * @default true\n */\n describeTarget?: boolean;\n /**\n * Sets the placement of the tooltip relative to the target.\n * @default 'bottom'\n */\n placement?: PopoverProps['placement'];\n /**\n * Conditionally renders a tooltip only if the associated element's (or its descendants) text content is truncated.\n * To work, the associated element must be be displayed as a CSS \"block box\" i.e. block, inline-block, etc...\n * @default false\n */\n smart?: boolean;\n /**\n * The group that the Popover belongs to. Popovers in the same group will be closed when others open.\n * @default 'tooltip'\n */\n groupId?: PopoverProps['groupId'];\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const StyledTooltip = styled.div(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n background-color: ${theme.components.tooltip['background-color']};\n color: ${theme.components.tooltip['foreground-color']};\n font-size: ${fontSize.xxs};\n max-width: 40ch;\n padding: calc(${theme.base.spacing} / 2);\n white-space: pre-line;\n word-break: break-word;\n --scale-in-size: 0;\n --animation-duration: ${theme.base.animation.speed};\n `;\n});\n\nStyledTooltip.defaultProps = defaultThemeProp;\n\nconst Tooltip: ForwardRefForwardPropsComponent<TooltipProps> = forwardRef(function Tooltip(\n {\n testId,\n children,\n target,\n ignoredElements = [],\n showDelay = 'short',\n hideDelay = 'long',\n placement = 'top',\n describeTarget = true,\n smart,\n groupId = 'tooltip',\n ...restProps\n }: PropsWithoutRef<TooltipProps>,\n ref: TooltipProps['ref']\n) {\n const id = useUID();\n const [show, setShow] = useState(false);\n const [ignoreDelay, setIgnoreDelay] = useState(false);\n const tooltipRef = useConsolidatedRef(ref);\n const lastClickedRef: MutableRefObject<EventTarget | null> = useRef(null);\n const testIds = useTestIds(testId, getTooltipTestIds);\n\n const stringContentOnly =\n typeof children === 'string' ||\n (Array.isArray(children) && children.every(child => typeof child === 'string'));\n\n const onMouseDown = useCallback(\n ({ target: eTarget }: MouseEvent) => {\n lastClickedRef.current = eTarget;\n if (eTarget === tooltipRef.current || eTarget === target) return;\n setShow(false);\n },\n [target]\n );\n\n useEffect(() => {\n if (!target) return;\n\n const showTooltip = () => {\n // This approach may result in a tooltip NOT appearing 1px before it should due to browser specifics. Enhance as needed.\n // https://stackoverflow.com/a/64747288\n\n const checkTruncation = (element: Element): boolean => {\n if (\n testElForOverflow(element).some(Boolean) &&\n !['absolute', 'fixed'].includes(window.getComputedStyle(element).position)\n )\n return true;\n\n for (const child of element.children) {\n if (checkTruncation(child)) return true;\n }\n\n return false;\n };\n\n setShow(smart ? checkTruncation(target) : true);\n };\n\n const onFocusIn = () => {\n showTooltip();\n };\n\n const onFocusOut = () => {\n if (!lastClickedRef.current || lastClickedRef.current !== tooltipRef.current) {\n setShow(false);\n }\n lastClickedRef.current = null;\n };\n\n const onMouseEnter = () => {\n if (ignoredElements.some(exclusion => exclusion?.matches(':hover')) || mouseState.primary) {\n return;\n }\n\n showTooltip();\n };\n\n const onMouseLeave = () => {\n if (getActiveElement() !== target) {\n setShow(false);\n }\n };\n\n const onKeyDown = ({ key }: KeyboardEvent) => {\n if (key === 'Escape' && show) {\n setIgnoreDelay(true);\n setShow(false);\n }\n };\n\n document.addEventListener('keydown', onKeyDown);\n document.addEventListener('mousedown', onMouseDown);\n\n target.addEventListener('focusin', onFocusIn);\n target.addEventListener('focusout', onFocusOut);\n target.addEventListener('mouseenter', onMouseEnter);\n target.addEventListener('mouseleave', onMouseLeave);\n\n return () => {\n document.removeEventListener('keydown', onKeyDown);\n document.removeEventListener('mousedown', onMouseDown);\n\n target.removeEventListener('focusin', onFocusIn);\n target.removeEventListener('focusout', onFocusOut);\n target.removeEventListener('mouseenter', onMouseEnter);\n target.removeEventListener('mouseleave', onMouseLeave);\n };\n }, [target, onMouseDown, smart, show]);\n\n useEffect(() => {\n if (target && describeTarget && show) {\n const describedBy = target.getAttribute('aria-describedby');\n // Set the attribute to the old attribute plus the id\n target.setAttribute('aria-describedby', describedBy ? `${describedBy} ${id}` : id);\n } else if (target) {\n // Get the old attribute\n const describedBy = target.getAttribute('aria-describedby');\n if (describedBy) {\n // If the old attribute matches the id just remove it entirely\n if (describedBy === id) {\n target.removeAttribute('aria-describedby');\n } else {\n // Otherwise we want to just remove the id that was added and reset the attribute to what it was before\n const oldDescribedBy = describedBy.replace(new RegExp(`(?:^|\\\\s+)${id}`), '');\n target.setAttribute('aria-describedby', oldDescribedBy);\n }\n }\n }\n }, [describeTarget, target, show]);\n\n useEffect(() => {\n if (!show && ignoreDelay) {\n setIgnoreDelay(false);\n }\n }, [show, ignoreDelay]);\n\n const theme = useTheme();\n const tooltipTheme = {\n base: {\n palette: {\n 'primary-background': theme.components.tooltip['background-color'],\n 'foreground-color': theme.components.tooltip['foreground-color'],\n interactive: readableHue(\n theme.base.palette.interactive,\n theme.components.tooltip['background-color']\n )\n }\n }\n };\n\n return (\n <ThemeOverride theme={tooltipTheme}>\n <Popover\n data-testid={testIds.root}\n id={id}\n groupId={groupId}\n {...restProps}\n show={show}\n showDelay={ignoreDelay ? 'none' : showDelay}\n hideDelay={ignoreDelay ? 'none' : hideDelay}\n onMouseOver={() => {\n setShow(true);\n }}\n onMouseOut={() => {\n setShow(false);\n }}\n strategy='fixed'\n as={StyledTooltip}\n role={stringContentOnly ? 'tooltip' : 'dialog'}\n target={target}\n arrow\n placement={placement}\n onMouseDown={onMouseDown}\n hideOnTargetHidden\n ref={tooltipRef}\n >\n {children}\n </Popover>\n </ThemeOverride>\n );\n});\n\nexport default withTestIds(Tooltip, getTooltipTestIds);\n"]}
@@ -22,7 +22,7 @@ const DefaultNodeRenderer = ({ data, subTree }) => {
22
22
  };
23
23
  let TreeList;
24
24
  const TreeItem = ({ listItemProps, depth, nodes, nodeRenderer: NodeRenderer, ...restProps }) => {
25
- return (_jsx(StyledTreeListItem, { ...listItemProps, children: _jsx(NodeRenderer, { ...restProps, depth: depth, nodes: nodes, subTree: nodes && _jsx(TreeList, { depth: depth + 1, nodes: nodes, nodeRenderer: NodeRenderer }) }) }));
25
+ return (_jsx(StyledTreeListItem, { ...listItemProps, role: 'none', children: _jsx(NodeRenderer, { ...restProps, depth: depth, nodes: nodes, subTree: nodes && _jsx(TreeList, { depth: depth + 1, nodes: nodes, nodeRenderer: NodeRenderer }) }) }));
26
26
  };
27
27
  TreeList = forwardRef(function TreeListFunction({ nodes, depth, nodeRenderer, ...restProps }, ref) {
28
28
  const hasParentSibling = nodes.some(node => !!node.nodes);
@@ -1 +1 @@
1
- {"version":3,"file":"Tree.js","sourceRoot":"","sources":["../../../src/components/Tree/Tree.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAGvC,OAAO,EAAE,UAAU,EAA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S,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,YAC1E,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CACjB,eAAC,QAAQ,OACH,IAAI,EACR,GAAG,EAAE,IAAI,CAAC,EAAE,EACZ,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,YAAY,EAC1B,gBAAgB,EAAE,gBAAgB,GAClC,CACH,CAAC,GACa,CAClB,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CAAiC,CAAC;AAEnC,MAAM,IAAI,GAAG,UAAU,CAAC,SAAS,IAAI,CACnC,EAAE,MAAM,EAAE,YAAY,GAAG,mBAAmB,EAAE,GAAG,SAAS,EAA8B,EACxF,GAAqB;IAErB,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAEnD,OAAO,CACL,KAAC,QAAQ,mBACM,OAAO,CAAC,IAAI,KACrB,SAAS,EACb,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,CAAC,EACR,YAAY,EAAE,YAAY,GAC1B,CACH,CAAC;AACJ,CAAC,CAA8F,CAAC;AAEhG,eAAe,WAAW,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { PropsWithoutRef, Ref, ComponentType, ReactNode } from 'react';\nimport styled from 'styled-components';\n\nimport type { BaseProps, NoChildrenProp, ForwardProps, OmitStrict, TestIdProp } from '../../types';\nimport { useTestIds } from '../../hooks';\nimport { withTestIds } from '../../utils';\n\nimport { getTreeTestIds } from './Tree.test-ids';\n\nexport type TreeNode = {\n /** The id of the Node. Used as the key for the li element wrapping the Node. */\n id: string;\n /** Child nodes. */\n nodes?: TreeNode[];\n /** Props to apply to the li. */\n listItemProps?: ForwardProps;\n\n [key: string]: unknown;\n};\n\nexport interface TreeProps<T extends TreeNode = TreeNode>\n extends BaseProps,\n NoChildrenProp,\n TestIdProp {\n /** An array of ParentNodes and Nodes that compose the layout of the Tree. */\n nodes: T[];\n /** A function that allows custom styling and behavior for all Nodes. */\n nodeRenderer?: ComponentType<\n {\n depth: number;\n subTree?: ReactNode;\n hasParentSibling: TreeItemProps['hasParentSibling'];\n } & OmitStrict<T, 'listItemProps'>\n >;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLUListElement>;\n}\n\nexport const StyledTreeListItem = styled.li``;\n\nexport const StyledTreeList = styled.ul`\n &,\n & & {\n list-style: none;\n position: relative;\n }\n\n ${StyledTreeListItem} {\n position: relative;\n }\n`;\n\nconst DefaultNodeRenderer: TreeProps['nodeRenderer'] = ({ data, subTree }) => {\n return (\n <>\n {data}\n {subTree}\n </>\n );\n};\n\ninterface TreeItemProps extends TreeNode {\n nodeRenderer: NonNullable<TreeProps['nodeRenderer']>;\n depth: number;\n hasParentSibling: boolean;\n}\n\ninterface TreeListProps extends Pick<TreeProps, 'nodes' | 'ref'> {\n nodeRenderer: NonNullable<TreeProps['nodeRenderer']>;\n depth: number;\n}\n\nlet TreeList: ComponentType<TreeListProps>;\n\nconst TreeItem = ({\n listItemProps,\n depth,\n nodes,\n nodeRenderer: NodeRenderer,\n ...restProps\n}: TreeItemProps) => {\n return (\n <StyledTreeListItem {...listItemProps}>\n <NodeRenderer\n {...restProps}\n depth={depth}\n nodes={nodes}\n subTree={nodes && <TreeList depth={depth + 1} nodes={nodes} nodeRenderer={NodeRenderer} />}\n />\n </StyledTreeListItem>\n );\n};\n\nTreeList = forwardRef(function TreeListFunction(\n { nodes, depth, nodeRenderer, ...restProps }: PropsWithoutRef<TreeListProps>,\n ref?: TreeProps['ref']\n) {\n const hasParentSibling = nodes.some(node => !!node.nodes);\n return nodes.length > 0 ? (\n <StyledTreeList {...restProps} ref={ref} role={depth === 0 ? 'tree' : 'group'}>\n {nodes.map(node => (\n <TreeItem\n {...node}\n key={node.id}\n depth={depth}\n nodeRenderer={nodeRenderer}\n hasParentSibling={hasParentSibling}\n />\n ))}\n </StyledTreeList>\n ) : null;\n}) as ComponentType<TreeListProps>;\n\nconst Tree = forwardRef(function Tree(\n { testId, nodeRenderer = DefaultNodeRenderer, ...restProps }: PropsWithoutRef<TreeProps>,\n ref: TreeProps['ref']\n) {\n const testIds = useTestIds(testId, getTreeTestIds);\n\n return (\n <TreeList\n data-testid={testIds.root}\n {...restProps}\n ref={ref}\n depth={0}\n nodeRenderer={nodeRenderer}\n />\n );\n}) as <T extends TreeNode = TreeNode>(props: TreeProps<T> & ForwardProps) => JSX.Element | null;\n\nexport default withTestIds(Tree, getTreeTestIds);\n"]}
1
+ {"version":3,"file":"Tree.js","sourceRoot":"","sources":["../../../src/components/Tree/Tree.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAGvC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AA+BjD,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,EAAE,CAAA,EAAE,CAAC;AAE9C,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,EAAE,CAAA;;;;;;;IAOnC,kBAAkB;;;CAGrB,CAAC;AAEF,MAAM,mBAAmB,GAA8B,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;IAC3E,OAAO,CACL,8BACG,IAAI,EACJ,OAAO,IACP,CACJ,CAAC;AACJ,CAAC,CAAC;AAaF,IAAI,QAAsC,CAAC;AAE3C,MAAM,QAAQ,GAAG,CAAC,EAChB,aAAa,EACb,KAAK,EACL,KAAK,EACL,YAAY,EAAE,YAAY,EAC1B,GAAG,SAAS,EACE,EAAE,EAAE;IAClB,OAAO,CACL,KAAC,kBAAkB,OAAK,a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AAQ,mBACM,OAAO,CAAC,IAAI,KACrB,SAAS,EACb,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,CAAC,EACR,YAAY,EAAE,YAAY,GAC1B,CACH,CAAC;AACJ,CAAC,CAA8F,CAAC;AAEhG,eAAe,WAAW,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { PropsWithoutRef, Ref, ComponentType, ReactNode } from 'react';\nimport styled from 'styled-components';\n\nimport type { BaseProps, NoChildrenProp, ForwardProps, OmitStrict, TestIdProp } from '../../types';\nimport { useTestIds } from '../../hooks';\nimport { withTestIds } from '../../utils';\n\nimport { getTreeTestIds } from './Tree.test-ids';\n\nexport type TreeNode = {\n /** The id of the Node. Used as the key for the li element wrapping the Node. */\n id: string;\n /** Child nodes. */\n nodes?: TreeNode[];\n /** Props to apply to the li. */\n listItemProps?: ForwardProps;\n\n [key: string]: unknown;\n};\n\nexport interface TreeProps<T extends TreeNode = TreeNode>\n extends BaseProps,\n NoChildrenProp,\n TestIdProp {\n /** An array of ParentNodes and Nodes that compose the layout of the Tree. */\n nodes: T[];\n /** A function that allows custom styling and behavior for all Nodes. */\n nodeRenderer?: ComponentType<\n {\n depth: number;\n subTree?: ReactNode;\n hasParentSibling: TreeItemProps['hasParentSibling'];\n } & OmitStrict<T, 'listItemProps'>\n >;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLUListElement>;\n}\n\nexport const StyledTreeListItem = styled.li``;\n\nexport const StyledTreeList = styled.ul`\n &,\n & & {\n list-style: none;\n position: relative;\n }\n\n ${StyledTreeListItem} {\n position: relative;\n }\n`;\n\nconst DefaultNodeRenderer: TreeProps['nodeRenderer'] = ({ data, subTree }) => {\n return (\n <>\n {data}\n {subTree}\n </>\n );\n};\n\ninterface TreeItemProps extends TreeNode {\n nodeRenderer: NonNullable<TreeProps['nodeRenderer']>;\n depth: number;\n hasParentSibling: boolean;\n}\n\ninterface TreeListProps extends Pick<TreeProps, 'nodes' | 'ref'> {\n nodeRenderer: NonNullable<TreeProps['nodeRenderer']>;\n depth: number;\n}\n\nlet TreeList: ComponentType<TreeListProps>;\n\nconst TreeItem = ({\n listItemProps,\n depth,\n nodes,\n nodeRenderer: NodeRenderer,\n ...restProps\n}: TreeItemProps) => {\n return (\n <StyledTreeListItem {...listItemProps} role='none'>\n <NodeRenderer\n {...restProps}\n depth={depth}\n nodes={nodes}\n subTree={nodes && <TreeList depth={depth + 1} nodes={nodes} nodeRenderer={NodeRenderer} />}\n />\n </StyledTreeListItem>\n );\n};\n\nTreeList = forwardRef(function TreeListFunction(\n { nodes, depth, nodeRenderer, ...restProps }: PropsWithoutRef<TreeListProps>,\n ref?: TreeProps['ref']\n) {\n const hasParentSibling = nodes.some(node => !!node.nodes);\n return nodes.length > 0 ? (\n <StyledTreeList {...restProps} ref={ref} role={depth === 0 ? 'tree' : 'group'}>\n {nodes.map(node => (\n <TreeItem\n {...node}\n key={node.id}\n depth={depth}\n nodeRenderer={nodeRenderer}\n hasParentSibling={hasParentSibling}\n />\n ))}\n </StyledTreeList>\n ) : null;\n}) as ComponentType<TreeListProps>;\n\nconst Tree = forwardRef(function Tree(\n { testId, nodeRenderer = DefaultNodeRenderer, ...restProps }: PropsWithoutRef<TreeProps>,\n ref: TreeProps['ref']\n) {\n const testIds = useTestIds(testId, getTreeTestIds);\n\n return (\n <TreeList\n data-testid={testIds.root}\n {...restProps}\n ref={ref}\n depth={0}\n nodeRenderer={nodeRenderer}\n />\n );\n}) as <T extends TreeNode = TreeNode>(props: TreeProps<T> & ForwardProps) => JSX.Element | null;\n\nexport default withTestIds(Tree, getTreeTestIds);\n"]}
@@ -2,6 +2,7 @@ export { default as useAbortController } from './useAbortController';
2
2
  export { default as useActiveDescendant, useLazyDescendant } from './useActiveDescendant';
3
3
  export type { UseActiveDescendantConfig } from './useActiveDescendant';
4
4
  export { default as useAfterInitialEffect } from './useAfterInitialEffect';
5
+ export { default as useAnimatedText } from './useAnimatedText';
5
6
  export { default as useArrows } from './useArrows';
6
7
  export { default as useAutoResize } from './useAutoResize';
7
8
  export { default as useBreakpoint } from './useBreakpoint';
@@ -24,6 +25,7 @@ export { default as useModalContext } from './useModalContext';
24
25
  export { default as useModalManager } from './useModalManager';
25
26
  export { default as useOS } from './useOS';
26
27
  export { default as useOuterEvent } from './useOuterEvent';
28
+ export { default as usePopoverMap } from './usePopoverMap';
27
29
  export { default as usePrevious } from './usePrevious';
28
30
  export { default as useRefMap } from './useRefMap';
29
31
  export { default as useSimpleStore, createSimpleStore } from './useSimpleStore';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1F,YAAY,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACnF,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,U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C3D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAChF,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC"}
@@ -1,6 +1,7 @@
1
1
  export { default as useAbortController } from './useAbortController';
2
2
  export { default as useActiveDescendant, useLazyDescendant } from './useActiveDescendant';
3
3
  export { default as useAfterInitialEffect } from './useAfterInitialEffect';
4
+ export { default as useAnimatedText } from './useAnimatedText';
4
5
  export { default as useArrows } from './useArrows';
5
6
  export { default as useAutoResize } from './useAutoResize';
6
7
  export { default as useBreakpoint } from './useBreakpoint';
@@ -23,6 +24,7 @@ export { default as useModalContext } from './useModalContext';
23
24
  export { default as useModalManager } from './useModalManager';
24
25
  export { default as useOS } from './useOS';
25
26
  export { default as useOuterEvent } from './useOuterEvent';
27
+ export { default as usePopoverMap } from './usePopoverMap';
26
28
  export { default as usePrevious } from './usePrevious';
27
29
  export { default as useRefMap } from './useRefMap';
28
30
  export { default as useSimpleStore, createSimpleStore } from './useSimpleStore';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1F,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACnF,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAA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AE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export { default as useAbortController } from './useAbortController';\nexport { default as useActiveDescendant, useLazyDescendant } from './useActiveDescendant';\nexport type { UseActiveDescendantConfig } from './useActiveDescendant';\nexport { default as useAfterInitialEffect } from './useAfterInitialEffect';\nexport { default as useArrows } from './useArrows';\nexport { default as useAutoResize } from './useAutoResize';\nexport { default as useBreakpoint } from './useBreakpoint';\nexport { default as useChToPxConversionFactor } from './useChToPxConversionFactor';\nexport { default as useConfiguration } from './useConfiguration';\nexport { default as useConsolidatedRef } from './useConsolidatedRef';\nexport { default as useDirection } from './useDirection';\nexport { default as useDraggable } from './useDraggable';\nexport { default as useElement } from './useElement';\nexport { default as useEscape } from './useEscape';\nexport { default as useEvent } from './useEvent';\nexport { default as useFocusTrap } from './useFocusTrap';\nexport { default as useFocusWithin } from './useFocusWithin';\nexport { default as useI18n } from './useI18n';\nexport { default as useInputFormatter } from './useInputFormatter';\nexport { default as useItemIntersection } from './useItemIntersection';\nexport { default as useLiveLog } from './useLiveLog';\nexport { default as useLongPress } from './useLongPress';\nexport { default as useModalContext } from './useModalContext';\nexport { default as useModalManager } from './useModalManager';\nexport { default as useOS } from './useOS';\nexport { default as useOuterEvent } from './useOuterEvent';\nexport { default as usePrevious } from './usePrevious';\nexport { default as useRefMap } from './useRefMap';\nexport { default as useSimpleStore, createSimpleStore } from './useSimpleStore';\nexport type { SimpleStore } from './useSimpleStore';\nexport { default as useSimpleStoreInstance } from './useSimpleStoreInstance';\nexport { default as useScrollStick } from './useScrollStick';\nexport { default as useScrollToggle } from './useScrollToggle';\nexport { default as useShortcut } from './useShortcut';\nexport { default as useShortcutManager } from './useShortcutManager';\nexport { default as useTestIds } from './useTestIds';\nexport { default as useTheme } from './useTheme';\nexport { default as useToaster } from './useToaster';\nexport { default as useTransitionState } from './useTransitionState';\nexport { default as useTriggerableEffect } from './useTriggerableEffect';\nexport { default as useElementFocus } from './useElementFocus';\nexport { default as useTriggerableLayoutEffect } from './useTriggerableLayoutEffect';\nexport { default as useUID } from './useUID';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1F,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,yBAAy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O,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAEhF,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export { default as useAbortController } from './useAbortController';\nexport { default as useActiveDescendant, useLazyDescendant } from './useActiveDescendant';\nexport type { UseActiveDescendantConfig } from './useActiveDescendant';\nexport { default as useAfterInitialEffect } from './useAfterInitialEffect';\nexport { default as useAnimatedText } from './useAnimatedText';\nexport { default as useArrows } from './useArrows';\nexport { default as useAutoResize } from './useAutoResize';\nexport { default as useBreakpoint } from './useBreakpoint';\nexport { default as useChToPxConversionFactor } from './useChToPxConversionFactor';\nexport { default as useConfiguration } from './useConfiguration';\nexport { default as useConsolidatedRef } from './useConsolidatedRef';\nexport { default as useDirection } from './useDirection';\nexport { default as useDraggable } from './useDraggable';\nexport { default as useElement } from './useElement';\nexport { default as useEscape } from './useEscape';\nexport { default as useEvent } from './useEvent';\nexport { default as useFocusTrap } from './useFocusTrap';\nexport { default as useFocusWithin } from './useFocusWithin';\nexport { default as useI18n } from './useI18n';\nexport { default as useInputFormatter } from './useInputFormatter';\nexport { default as useItemIntersection } from './useItemIntersection';\nexport { default as useLiveLog } from './useLiveLog';\nexport { default as useLongPress } from './useLongPress';\nexport { default as useModalContext } from './useModalContext';\nexport { default as useModalManager } from './useModalManager';\nexport { default as useOS } from './useOS';\nexport { default as useOuterEvent } from './useOuterEvent';\nexport { default as usePopoverMap } from './usePopoverMap';\nexport { default as usePrevious } from './usePrevious';\nexport { default as useRefMap } from './useRefMap';\nexport { default as useSimpleStore, createSimpleStore } from './useSimpleStore';\nexport type { SimpleStore } from './useSimpleStore';\nexport { default as useSimpleStoreInstance } from './useSimpleStoreInstance';\nexport { default as useScrollStick } from './useScrollStick';\nexport { default as useScrollToggle } from './useScrollToggle';\nexport { default as useShortcut } from './useShortcut';\nexport { default as useShortcutManager } from './useShortcutManager';\nexport { default as useTestIds } from './useTestIds';\nexport { default as useTheme } from './useTheme';\nexport { default as useToaster } from './useToaster';\nexport { default as useTransitionState } from './useTransitionState';\nexport { default as useTriggerableEffect } from './useTriggerableEffect';\nexport { default as useElementFocus } from './useElementFocus';\nexport { default as useTriggerableLayoutEffect } from './useTriggerableLayoutEffect';\nexport { default as useUID } from './useUID';\n"]}
@@ -0,0 +1,11 @@
1
+ declare const useAnimatedText: ({ text, allContentReceived, enabled, tokenizeMarkdown }: {
2
+ text: string;
3
+ allContentReceived: boolean;
4
+ enabled?: boolean;
5
+ tokenizeMarkdown?: boolean;
6
+ }) => {
7
+ text: string;
8
+ isAnimationDone: boolean;
9
+ };
10
+ export default useAnimatedText;
11
+ //# sourceMappingURL=useAnimatedText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAnimatedText.d.ts","sourceRoot":"","sources":["../../src/hooks/useAnimatedText.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,eAAe,GAAI,yDAKtB;IACD,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB,EAAE,OAAO,CAAC;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;;;CAiHA,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -0,0 +1,96 @@
1
+ import { useEffect, useState, useRef } from 'react';
2
+ import tokenizeWithMarkdown from '../utils/markdownTokenizer';
3
+ const useAnimatedText = ({ text, allContentReceived = false, enabled = true, tokenizeMarkdown = false }) => {
4
+ const [cursor, setCursor] = useState(0); // End pointer
5
+ const [startingCursor, setStartingCursor] = useState(0); // animation starting point
6
+ const [prevText, setPrevText] = useState(text);
7
+ const [isAnimationDone, setIsAnimationDone] = useState(false);
8
+ const allContentReceivedRef = useRef(allContentReceived);
9
+ allContentReceivedRef.current = allContentReceived;
10
+ // Tokenize text based on markdown flag
11
+ const getTokens = (inputText) => {
12
+ if (tokenizeMarkdown) {
13
+ return tokenizeWithMarkdown(inputText);
14
+ }
15
+ return inputText.split('');
16
+ };
17
+ // A new chunk has arrived
18
+ if (prevText !== text) {
19
+ setPrevText(text);
20
+ setStartingCursor(text.startsWith(prevText) ? cursor : 0);
21
+ setIsAnimationDone(false);
22
+ }
23
+ useEffect(() => {
24
+ // If streaming is disabled just return the whole chunk back
25
+ if (!enabled) {
26
+ setCursor(getTokens(text).length);
27
+ setIsAnimationDone(true);
28
+ return;
29
+ }
30
+ const tokens = getTokens(text);
31
+ const targetLength = tokens.length;
32
+ const charactersToAnimate = targetLength - startingCursor;
33
+ // If there are no more characters to animate
34
+ if (charactersToAnimate <= 0) {
35
+ setCursor(targetLength);
36
+ // Only set animation done if we have all content AND no more characters to animate
37
+ if (allContentReceivedRef.current) {
38
+ setIsAnimationDone(true);
39
+ }
40
+ return;
41
+ }
42
+ let intervalId;
43
+ let startTime;
44
+ let isStopped = false;
45
+ let currentSpeed = 50; // Start with normal speed
46
+ let lastCursor = startingCursor;
47
+ const processTextAnimation = () => {
48
+ if (isStopped)
49
+ return;
50
+ const currentTime = performance.now();
51
+ if (!startTime) {
52
+ startTime = currentTime;
53
+ }
54
+ // When we have all content with us, speed up streaming animation
55
+ const targetSpeed = allContentReceivedRef.current ? 150 : 50;
56
+ // Smoothly transition to target speed
57
+ const speedDiff = targetSpeed - currentSpeed;
58
+ currentSpeed += speedDiff * 0.1; // Smooth transition
59
+ const elapsed = currentTime - startTime;
60
+ const timeStep = elapsed / 1000;
61
+ // Calculate how many characters we should have shown by now
62
+ const expectedCursor = Math.min(startingCursor + timeStep * currentSpeed, targetLength);
63
+ const newCursor = Math.min(Math.floor(expectedCursor), targetLength);
64
+ // Skip update if the cursor is at the same token
65
+ if (newCursor !== lastCursor) {
66
+ setCursor(newCursor);
67
+ lastCursor = newCursor;
68
+ }
69
+ // End condition - stop when we reach the target
70
+ if (newCursor >= targetLength && allContentReceivedRef.current) {
71
+ setIsAnimationDone(true);
72
+ return;
73
+ }
74
+ // Continue animation if not done
75
+ if (newCursor < targetLength || !allContentReceivedRef.current) {
76
+ // Use adaptive timing based on content state and visibility
77
+ const interval = allContentReceivedRef.current ? 20 : 50; // Faster when complete
78
+ intervalId = setTimeout(processTextAnimation, interval);
79
+ }
80
+ };
81
+ // Start the animation with initial delay
82
+ intervalId = setTimeout(processTextAnimation, 16);
83
+ return () => {
84
+ isStopped = true;
85
+ if (intervalId) {
86
+ clearTimeout(intervalId);
87
+ }
88
+ };
89
+ }, [startingCursor, text, tokenizeMarkdown]);
90
+ return {
91
+ text: getTokens(text).slice(0, cursor).join(''),
92
+ isAnimationDone
93
+ };
94
+ };
95
+ export default useAnimatedText;
96
+ //# sourceMappingURL=useAnimatedText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAnimatedText.js","sourceRoot":"","sources":["../../src/hooks/useAnimatedText.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,oBAAoB,MAAM,4BAA4B,CAAC;AAE9D,MAAM,eAAe,GAAG,CAAC,EACvB,IAAI,EACJ,kBAAkB,GAAG,KAAK,EAC1B,OAAO,GAAG,IAAI,EACd,gBAAgB,GAAG,KAAK,EAMzB,EAAE,EAAE;IACH,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc;IACvD,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,2BAA2B;IAEpF,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC/C,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE9D,MAAM,qBAAqB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;IAEzD,qBAAqB,CAAC,OAAO,GAAG,kBAAkB,CAAC;IAEnD,uCAAuC;IACvC,MAAM,SAAS,GAAG,CAAC,SAAiB,EAAY,EAAE;QAChD,IAAI,gBAAgB,EAAE,CAAC;YACrB,OAAO,oBAAoB,CAAC,SAAS,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC7B,CAAC,CAAC;IAEF,0BAA0B;IAC1B,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,WAAW,CAAC,IAAI,CAAC,CAAC;QAClB,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAA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CAAC;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,cAAc,EAAE,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAE7C,OAAO;QACL,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;QAC/C,eAAe;KAChB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { useEffect, useState, useRef } from 'react';\n\nimport tokenizeWithMarkdown from '../utils/markdownTokenizer';\n\nconst useAnimatedText = ({\n text,\n allContentReceived = false,\n enabled = true,\n tokenizeMarkdown = false\n}: {\n text: string;\n allContentReceived: boolean;\n enabled?: boolean;\n tokenizeMarkdown?: boolean;\n}) => {\n const [cursor, setCursor] = useState(0); // End pointer\n const [startingCursor, setStartingCursor] = useState(0); // animation starting point\n\n const [prevText, setPrevText] = useState(text);\n const [isAnimationDone, setIsAnimationDone] = useState(false);\n\n const allContentReceivedRef = useRef(allContentReceived);\n\n allContentReceivedRef.current = allContentReceived;\n\n // Tokenize text based on markdown flag\n const getTokens = (inputText: string): string[] => {\n if (tokenizeMarkdown) {\n return tokenizeWithMarkdown(inputText);\n }\n return inputText.split('');\n };\n\n // A new chunk has arrived\n if (prevText !== text) {\n setPrevText(text);\n setStartingCursor(text.startsWith(prevText) ? cursor : 0);\n setIsAnimationDone(false);\n }\n\n useEffect(() => {\n // If streaming is disabled just return the whole chunk back\n if (!enabled) {\n setCursor(getTokens(text).length);\n setIsAnimationDone(true);\n return;\n }\n\n const tokens = getTokens(text);\n const targetLength = tokens.length;\n const charactersToAnimate = targetLength - startingCursor;\n\n // If there are no more characters to animate\n if (charactersToAnimate <= 0) {\n setCursor(targetLength);\n // Only set animation done if we have all content AND no more characters to animate\n if (allContentReceivedRef.current) {\n setIsAnimationDone(true);\n }\n return;\n }\n\n let intervalId: ReturnType<typeof setTimeout>;\n let startTime: number;\n let isStopped = false;\n let currentSpeed = 50; // Start with normal speed\n let lastCursor = startingCursor;\n\n const processTextAnimation = () => {\n if (isStopped) return;\n\n const currentTime = performance.now();\n\n if (!startTime) {\n startTime = currentTime;\n }\n\n // When we have all content with us, speed up streaming animation\n const targetSpeed = allContentReceivedRef.current ? 150 : 50;\n\n // Smoothly transition to target speed\n const speedDiff = targetSpeed - currentSpeed;\n currentSpeed += speedDiff * 0.1; // Smooth transition\n\n const elapsed = currentTime - startTime;\n const timeStep = elapsed / 1000;\n\n // Calculate how many characters we should have shown by now\n const expectedCursor = Math.min(startingCursor + timeStep * currentSpeed, targetLength);\n\n const newCursor = Math.min(Math.floor(expectedCursor), targetLength);\n\n // Skip update if the cursor is at the same token\n if (newCursor !== lastCursor) {\n setCursor(newCursor);\n lastCursor = newCursor;\n }\n\n // End condition - stop when we reach the target\n if (newCursor >= targetLength && allContentReceivedRef.current) {\n setIsAnimationDone(true);\n return;\n }\n\n // Continue animation if not done\n if (newCursor < targetLength || !allContentReceivedRef.current) {\n // Use adaptive timing based on content state and visibility\n const interval = allContentReceivedRef.current ? 20 : 50; // Faster when complete\n intervalId = setTimeout(processTextAnimation, interval);\n }\n };\n\n // Start the animation with initial delay\n intervalId = setTimeout(processTextAnimation, 16);\n\n return () => {\n isStopped = true;\n if (intervalId) {\n clearTimeout(intervalId);\n }\n };\n }, [startingCursor, text, tokenizeMarkdown]);\n\n return {\n text: getTokens(text).slice(0, cursor).join(''),\n isAnimationDone\n };\n};\n\nexport default useAnimatedText;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"useBreakpoint.d.ts","sourceRoot":"","sources":["../../src/hooks/useBreakpoint.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAYvC;;;;;GAKG;AACH,QAAA,MAAM,aAAa,GACjB,YAAY,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,EAC5C,6CAIG;IACD,aAAa,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC;IAC/C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,aAAa,GAAG,eAAe,CAAC;CACxC,YAuEP,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"useBreakpoint.d.ts","sourceRoot":"","sources":["../../src/hooks/useBreakpoint.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAYvC;;;;;GAKG;AACH,QAAA,MAAM,aAAa,GACjB,YAAY,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,EAC5C,6CAIG;IACD,aAAa,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC;IAC/C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,aAAa,GAAG,eAAe,CAAC;CACxC,YA4EP,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { useState, useLayoutEffect, useCallback } from 'react';
2
- import { windowIsAvailable, debounce } from '../utils';
2
+ import { windowIsAvailable, debounce, testElForOverflow, getScrollbarWidth } from '../utils';
3
3
  import useChToPxConversionFactor from './useChToPxConversionFactor';
4
4
  import useTheme from './useTheme';
5
5
  // We should be able to safely capture once as the computed root font size is unlikely to change during normal runtime.
@@ -29,8 +29,11 @@ const useBreakpoint = (breakpoint, { breakpointRef, defaultValue = false, themeP
29
29
  const matchesBreakpoint = entries.some(({ target, contentRect }) => {
30
30
  if (target !== breakpointRef.current)
31
31
  return;
32
+ const scrollbarWidth = testElForOverflow(breakpointRef.current)[1]
33
+ ? getScrollbarWidth()
34
+ : 0;
32
35
  const multiplier = themeProp === 'breakpoints' ? parseFloat(rootFontSize) : chToPxConversionFactor;
33
- return contentRect.width >= parseFloat(breakpointVal) * multiplier;
36
+ return (Math.ceil(contentRect.width + scrollbarWidth) >= parseFloat(breakpointVal) * multiplier);
34
37
  });
35
38
  setMatches(matchesBreakpoint);
36
39
  }, 100);
@@ -1 +1 @@
1
- {"version":3,"file":"useBreakpoint.js","sourceRoot":"","sources":["../../src/hooks/useBreakpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAG/D,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEvD,OAAO,yBAAyB,MAAM,6BAA6B,CAAC;AACpE,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,uHAAuH;AACvH,MAAM,YAAY,GAAG,iBAAiB;IACpC,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,QAAQ,IAAI,MAAM;IACtE,CAAC,CAAC,MAAM,CAAC;AAEX;;;;;GAKG;AACH,MAAM,aAAa,GAAG,CACpB,UAA4C,EAC5C,EACE,aAAa,EACb,YAAY,GAAG,KAAK,EACpB,SAAS,GAAG,aAAa,KAKvB,EAAE,EACN,EAAE;IACF,MAAM,EACJ,IAAI,EAAE,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,EACrD,GAAG,QAAQ,EAAE,CAAC;IACf,MAAM,aAAa,GACjB,SAAS,KAAK,eAAe,CAAC,CAAC,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAErF,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CACpC,iBAAiB,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,eAAe,aAAa,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAChG,CAAC;IAEF,MAAM,sBAAsB,GAAG,yBAAyB,EAAE,CAAC;IAE3D,MAAM,QAAQ,GAAG,WAAW,CAAC,CAAC,CAAsB,EAAE,EAAE;Q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AM,CAAC,UAAU,IAAI,QAAQ,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC,CAAC;YAC/D,CAAC,EAAE,GAAG,CAAC,CAAC;YAER,+DAA+D;YAC/D,IAAI,mBAAmB,EAAE,CAAC;gBACxB,UAAU,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;gBAChD,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YACjC,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;gBACjD,UAAU,CAAC,MAAM,CAAC,UAAU,IAAI,QAAQ,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC,CAAC;YAC/D,CAAC;YAED,OAAO,GAAG,EAAE;gBACV,+DAA+D;gBAC/D,IAAI,mBAAmB;oBAAE,UAAU,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;qBACvE,CAAC;oBACJ,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;gBACtD,CAAC;YACH,CAAC,CAAC;QACJ,CAAC;IACH,CAAC,EAAE,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC;IAE7B,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { useState, useLayoutEffect, useCallback } from 'react';\nimport type { RefObject } from 'react';\n\nimport { windowIsAvailable, debounce } from '../utils';\n\nimport useChToPxConversionFactor from './useChToPxConversionFactor';\nimport useTheme from './useTheme';\n\n// We should be able to safely capture once as the computed root font size is unlikely to change during normal runtime.\nconst rootFontSize = windowIsAvailable\n ? window.getComputedStyle(document.documentElement).fontSize || '16px'\n : '16px';\n\n/**\n * @example const breakpointActive = useBreakpoint(breakpoint);\n * @param breakpoint The string indicator for the breakpoint that should be checked for validity.\n * @param options\n * @returns breakpointActive:: A boolean indicating if the given breakpoint is active or not. If false, the breakpoint is too big for the screen size.\n */\nconst useBreakpoint = (\n breakpoint: 'xs' | 'sm' | 'md' | 'lg' | 'xl',\n {\n breakpointRef,\n defaultValue = false,\n themeProp = 'breakpoints'\n }: {\n breakpointRef?: RefObject<Element> | undefined;\n defaultValue?: boolean;\n themeProp?: 'breakpoints' | 'content-width';\n } = {}\n) => {\n const {\n base: { breakpoints, 'content-width': contentWidth }\n } = useTheme();\n const breakpointVal =\n themeProp === 'content-width' ? contentWidth[breakpoint] : breakpoints[breakpoint];\n\n const [matches, setMatches] = useState(\n windowIsAvailable ? window.matchMedia(`(min-width: ${breakpointVal})`).matches : !!defaultValue\n );\n\n const chToPxConversionFactor = useChToPxConversionFactor();\n\n const onResize = useCallback((e: MediaQueryListEvent) => {\n setMatches(e.matches);\n }, []);\n\n useLayoutEffect(() => {\n // Breakpoint handling for contained elements\n if (breakpointRef && breakpointRef.current) {\n const debouncedResize = debounce((entries: ResizeObserverEntry[]) => {\n if (!breakpointRef.current?.checkVisibility()) return;\n const matchesBreakpoint = entries.some(({ target, contentRect }) => {\n if (target !== breakpointRef.current) return;\n\n const multiplier =\n themeProp === 'breakpoints' ? parseFloat(rootFontSize) : chToPxConversionFactor;\n return contentRect.width >= parseFloat(breakpointVal) * multiplier;\n });\n\n setMatches(matchesBreakpoint);\n }, 100);\n\n const observer = new ResizeObserver(debouncedResize);\n\n observer.observe(breakpointRef.current);\n\n return () => {\n observer.disconnect();\n };\n }\n\n // Breakpoint handling for viewport\n if (windowIsAvailable) {\n const mediaMatch = window.matchMedia(`(min-width: ${breakpointVal})`);\n const mediaMatchAvailable = 'addEventListener' in mediaMatch;\n const resizeHandler = debounce(() => {\n setMatches(window.innerWidth >= parseInt(breakpointVal, 10));\n }, 100);\n\n // Need to check useMatchMedia in order to support unit testing\n if (mediaMatchAvailable) {\n mediaMatch.addEventListener('change', onResize);\n setMatches(mediaMatch.matches);\n } else {\n window.addEventListener('resize', resizeHandler);\n setMatches(window.innerWidth >= parseInt(breakpointVal, 10));\n }\n\n return () => {\n // Need to check useMatchMedia in order to support unit testing\n if (mediaMatchAvailable) mediaMatch.removeEventListener('change', onResize);\n else {\n window.removeEventListener('resize', resizeHandler);\n }\n };\n }\n }, [breakpointRef?.current]);\n\n return matches;\n};\n\nexport default useBreakpoint;\n"]}
1
+ {"version":3,"file":"useBreakpoint.js","sourceRoot":"","sources":["../../src/hooks/useBreakpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAG/D,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7F,OAAO,yBAAyB,MAAM,6BAA6B,CAAC;AACpE,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,uHAAuH;AACvH,MAAM,YAAY,GAAG,iBAAiB;IACpC,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,QAAQ,IAAI,MAAM;IACtE,CAAC,CAAC,MAAM,CAAC;AAEX;;;;;GAKG;AACH,MAAM,aAAa,GAAG,CACpB,UAA4C,EAC5C,EACE,aAAa,EACb,YAAY,GAAG,KAAK,EACpB,SAAS,GAAG,aAAa,KAKvB,EAAE,EACN,EAAE;IACF,MAAM,EACJ,IAAI,EAAE,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,EACrD,GAAG,QAAQ,EAAE,CAAC;IACf,MAAM,aAAa,GACjB,SAAS,KAAK,eAAe,CAAC,CAAC,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAErF,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CACpC,iBAAiB,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,eAAe,aAAa,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,Y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windowIsAvailable, debounce, testElForOverflow, getScrollbarWidth } from '../utils';\n\nimport useChToPxConversionFactor from './useChToPxConversionFactor';\nimport useTheme from './useTheme';\n\n// We should be able to safely capture once as the computed root font size is unlikely to change during normal runtime.\nconst rootFontSize = windowIsAvailable\n ? window.getComputedStyle(document.documentElement).fontSize || '16px'\n : '16px';\n\n/**\n * @example const breakpointActive = useBreakpoint(breakpoint);\n * @param breakpoint The string indicator for the breakpoint that should be checked for validity.\n * @param options\n * @returns breakpointActive:: A boolean indicating if the given breakpoint is active or not. If false, the breakpoint is too big for the screen size.\n */\nconst useBreakpoint = (\n breakpoint: 'xs' | 'sm' | 'md' | 'lg' | 'xl',\n {\n breakpointRef,\n defaultValue = false,\n themeProp = 'breakpoints'\n }: {\n breakpointRef?: RefObject<Element> | undefined;\n defaultValue?: boolean;\n themeProp?: 'breakpoints' | 'content-width';\n } = {}\n) => {\n const {\n base: { breakpoints, 'content-width': contentWidth }\n } = useTheme();\n const breakpointVal =\n themeProp === 'content-width' ? contentWidth[breakpoint] : breakpoints[breakpoint];\n\n const [matches, setMatches] = useState(\n windowIsAvailable ? window.matchMedia(`(min-width: ${breakpointVal})`).matches : !!defaultValue\n );\n\n const chToPxConversionFactor = useChToPxConversionFactor();\n\n const onResize = useCallback((e: MediaQueryListEvent) => {\n setMatches(e.matches);\n }, []);\n\n useLayoutEffect(() => {\n // Breakpoint handling for contained elements\n if (breakpointRef && breakpointRef.current) {\n const debouncedResize = debounce((entries: ResizeObserverEntry[]) => {\n if (!breakpointRef.current?.checkVisibility()) return;\n const matchesBreakpoint = entries.some(({ target, contentRect }) => {\n if (target !== breakpointRef.current) return;\n\n const scrollbarWidth = testElForOverflow(breakpointRef.current)[1]\n ? getScrollbarWidth()\n : 0;\n const multiplier =\n themeProp === 'breakpoints' ? parseFloat(rootFontSize) : chToPxConversionFactor;\n return (\n Math.ceil(contentRect.width + scrollbarWidth) >= parseFloat(breakpointVal) * multiplier\n );\n });\n\n setMatches(matchesBreakpoint);\n }, 100);\n\n const observer = new ResizeObserver(debouncedResize);\n\n observer.observe(breakpointRef.current);\n\n return () => {\n observer.disconnect();\n };\n }\n\n // Breakpoint handling for viewport\n if (windowIsAvailable) {\n const mediaMatch = window.matchMedia(`(min-width: ${breakpointVal})`);\n const mediaMatchAvailable = 'addEventListener' in mediaMatch;\n const resizeHandler = debounce(() => {\n setMatches(window.innerWidth >= parseInt(breakpointVal, 10));\n }, 100);\n\n // Need to check useMatchMedia in order to support unit testing\n if (mediaMatchAvailable) {\n mediaMatch.addEventListener('change', onResize);\n setMatches(mediaMatch.matches);\n } else {\n window.addEventListener('resize', resizeHandler);\n setMatches(window.innerWidth >= parseInt(breakpointVal, 10));\n }\n\n return () => {\n // Need to check useMatchMedia in order to support unit testing\n if (mediaMatchAvailable) mediaMatch.removeEventListener('change', onResize);\n else {\n window.removeEventListener('resize', resizeHandler);\n }\n };\n }\n }, [breakpointRef?.current]);\n\n return matches;\n};\n\nexport default useBreakpoint;\n"]}
@@ -1,3 +1,3 @@
1
- declare const useChToPxConversionFactor: () => number;
2
- export default useChToPxConversionFactor;
1
+ declare const _default: () => number;
2
+ export default _default;
3
3
  //# sourceMappingURL=useChToPxConversionFactor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useChToPxConversionFactor.d.ts","sourceRoot":"","sources":["../../src/hooks/useChToPxConversionFactor.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,yBAAyB,cAW9B,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
1
+ {"version":3,"file":"useChToPxConversionFactor.d.ts","sourceRoot":"","sources":["../../src/hooks/useChToPxConversionFactor.ts"],"names":[],"mappings":";AAKA,wBAAsC"}
@@ -1,14 +1,5 @@
1
- import { useMemo } from 'react';
2
- const useChToPxConversionFactor = () => {
3
- return useMemo(() => {
4
- const chToPxDiv = document.createElement('div');
5
- chToPxDiv.style.width = '1ch';
6
- chToPxDiv.style.position = 'fixed';
7
- document.body.append(chToPxDiv);
8
- const conversionFactor = chToPxDiv.offsetWidth;
9
- chToPxDiv.remove();
10
- return conversionFactor;
11
- }, []);
12
- };
13
- export default useChToPxConversionFactor;
1
+ import { getChToPxConversionFactor, documentIsAvailable } from '../utils';
2
+ // Evaluate once at the module level and reuse value. This should be good enough for all known usage.
3
+ const conversionFactor = documentIsAvailable ? getChToPxConversionFactor() : 1;
4
+ export default () => conversionFactor;
14
5
  //# sourceMappingURL=useChToPxConversionFactor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useChToPxConversionFactor.js","sourceRoot":"","sources":["../../src/hooks/useChToPxConversionFactor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,MAAM,yBAAyB,GAAG,GAAG,EAAE;IACrC,OAAO,OAAO,CAAC,GAAG,EAAE;QAClB,MAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAChD,SAAS,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;QAC9B,SAAS,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC;QACnC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAChC,MAAM,gBAAgB,GAAG,SAAS,CAAC,WAAW,CAAC;QAC/C,SAAS,CAAC,MAAM,EAAE,CAAC;QAEnB,OAAO,gBAAgB,CAAC;IAC1B,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC,CAAC;AAEF,eAAe,yBAAyB,CAAC","sourcesContent":["import { useMemo } from 'react';\n\nconst useChToPxConversionFactor = () => {\n return useMemo(() => {\n const chToPxDiv = document.createElement('div');\n chToPxDiv.style.width = '1ch';\n chToPxDiv.style.position = 'fixed';\n document.body.append(chToPxDiv);\n const conversionFactor = chToPxDiv.offsetWidth;\n chToPxDiv.remove();\n\n return conversionFactor;\n }, []);\n};\n\nexport default useChToPxConversionFactor;\n"]}
1
+ {"version":3,"file":"useChToPxConversionFactor.js","sourceRoot":"","sources":["../../src/hooks/useChToPxConversionFactor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE1E,qGAAqG;AACrG,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,CAAC,CAAC,yBAAyB,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAE/E,eAAe,GAAG,EAAE,CAAC,gBAAgB,CAAC","sourcesContent":["import { getChToPxConversionFactor, documentIsAvailable } from '../utils';\n\n// Evaluate once at the module level and reuse value. This should be good enough for all known usage.\nconst conversionFactor = documentIsAvailable ? getChToPxConversionFactor() : 1;\n\nexport default () => conversionFactor;\n"]}