@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
@@ -2,6 +2,7 @@ import type { ReactNode } from 'react';
2
2
  import type { OmitStrict, WithAttributes } from '../../types';
3
3
  import type { PopoverProps } from '../Popover';
4
4
  import type { ProgressProps } from '../Progress';
5
+ import type { AdditionalInfoProps } from '../AdditionalInfo';
5
6
  export interface BaseDialogProps {
6
7
  /**
7
8
  * Certain uses of dialogs require a linear edge with an input like control.
@@ -59,11 +60,14 @@ export type FormDialogProps = WithAttributes<'div', BaseDialogProps & {
59
60
  } & ({
60
61
  /** A string to indicate context for the dialog. The dialog will be labelled by this value. */
61
62
  heading: string;
63
+ /** Show additional info in form dialog header. */
64
+ additionalInfo?: AdditionalInfoProps;
62
65
  'aria-label'?: never;
63
66
  } | {
64
67
  heading?: never;
65
68
  /** Provide a contextually sufficient aria label if a visible heading is not provided. */
66
69
  'aria-label': string;
70
+ additionalInfo?: never;
67
71
  })>;
68
72
  export type InfoDialogProps = WithAttributes<'div', OmitStrict<BaseDialogProps, 'arrow'> & {
69
73
  /** A string or summary item like props to indicate context for the dialog. The dialog will be labelled by either the heading element or primary property. */
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.types.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA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;IACrB,cAAc,CAAC,EAAE,KAAK,CAAC;CACxB,CACJ,CACJ,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,cAAc,CAC1C,KAAK,EACL,UAAU,CAAC,eAAe,EAAE,OAAO,CAAC,GAAG;IACrC,6JAA6J;IAC7J,OAAO,CAAC,EACJ,MAAM,GACN;QACE,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,MAAM,CAAC,EAAE,SAAS,CAAC;KACpB,CAAC;IAEN,2IAA2I;IAC3I,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB,CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.types.js","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react';\n\nimport type { OmitStrict, WithAttributes } from '../../types';\nimport type { PopoverProps } from '../Popover';\nimport type { ProgressProps } from '../Progress';\n\nexport interface BaseDialogProps {\n /**\n * Certain uses of dialogs require a linear edge with an input like control.\n * There an arrow is not desired.\n * @default true\n */\n arrow?: PopoverProps['arrow'];\n\n /**\n * An element the dialog is contextually and visually associated with. Normally a triggering button.\n * Components rendering Dialog should mount and unmount instances based on this value.\n */\n target: HTMLElement;\n\n /** Content for the dialog. Avoid form control buttons within as those should be rendered by way of onCancel and onSubmit with FormDialog. */\n children: PopoverProps['children'];\n\n /** If there is a progress state either on opening, or after submit, you must indicate as such. A custom message is supported as well. */\n progress?: boolean | ProgressProps['message'];\n\n /** Optionally render the dialog element at the end of the body or within a specified element. */\n portal?: PopoverProps['portal'];\n\n /** Positioning strategy for solving rendering scenarios. */\n strategy?: PopoverProps['strategy'];\n\n /**\n * Intended positioning placement for the dialog element.\n * Placement may auto adjust based on screen position and other layout variables.\n */\n placement?: PopoverProps['placement'];\n /**\n * Optionally determines whether to trap the focus inside the dialog, preventing it from being moved outside until the dialog is closed.\n * @default false\n */\n focusTrap?: boolean;\n\n /** Reference to the dialog's root element. */\n ref?: PopoverProps['ref'];\n}\n\nexport type DialogProps = WithAttributes<'div', BaseDialogProps>;\n\n/** A simple callback or an object to customize a subset button properties. */\ntype FormAction =\n | (() => void)\n | {\n text?: string;\n disabled?: boolean;\n handler: () => void;\n };\n\nexport type FormDialogProps = WithAttributes<\n 'div',\n BaseDialogProps & {\n /** Called when the user presses escape or clicks away. */\n onDismiss?: () => void;\n\n /**\n * Renders a standard design system cancel button.\n * If onDismiss is not provided, onCancel will be invoked when the user presses the Escape key or clicks outside of the dialog.\n * Invocation of this indicates the user wishes to cancel any changes and close the dialog.\n */\n onCancel: FormAction;\n\n /**\n * Renders a standard design system submit button.\n * Invocation of this indicates the user wishes to submit any changes and close the dialog. Please consider progress states after submit.\n */\n onSubmit: FormAction;\n } & (\n | {\n /** A string to indicate context for the dialog. The dialog will be labelled by this value. */\n heading: string;\n 'aria-label'?: never;\n }\n | {\n heading?: never;\n /** Provide a contextually sufficient aria label if a visible heading is not provided. */\n 'aria-label': string;\n }\n )\n>;\n\nexport type InfoDialogProps = WithAttributes<\n 'div',\n OmitStrict<BaseDialogProps, 'arrow'> & {\n /** A string or summary item like props to indicate context for the dialog. The dialog will be labelled by either the heading element or primary property. */\n heading?:\n | string\n | {\n primary: string;\n secondary?: string;\n visual?: ReactNode;\n };\n\n /** Renders a standard design system dismiss button to close the dialog when the user clicks this button, presses escape or clicks away. */\n onDismiss: () => void;\n }\n>;\n\n/**\n * Components which render Dialog internally may need to offer some control to consuming components.\n * Use this interface to offer an imperative handle for shared control.\n */\nexport interface DialogHandleValue {\n open: () => void;\n close: () => void;\n}\n"]}
1
+ {"version":3,"file":"Dialog.types.js","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react';\n\nimport type { OmitStrict, WithAttributes } from '../../types';\nimport type { PopoverProps } from '../Popover';\nimport type { ProgressProps } from '../Progress';\nimport type { AdditionalInfoProps } from '../AdditionalInfo';\n\nexport interface BaseDialogProps {\n /**\n * Certain uses of dialogs require a linear edge with an input like control.\n * There an arrow is not desired.\n * @default true\n */\n arrow?: PopoverProps['arrow'];\n\n /**\n * An element the dialog is contextually and visually associated with. Normally a triggering button.\n * Components rendering Dialog should mount and unmount instances based on this value.\n */\n target: HTMLElement;\n\n /** Content for the dialog. Avoid form control buttons within as those should be rendered by way of onCancel and onSubmit with FormDialog. */\n children: PopoverProps['children'];\n\n /** If there is a progress state either on opening, or after submit, you must indicate as such. A custom message is supported as well. */\n progress?: boolean | ProgressProps['message'];\n\n /** Optionally render the dialog element at the end of the body or within a specified element. */\n portal?: PopoverProps['portal'];\n\n /** Positioning strategy for solving rendering scenarios. */\n strategy?: PopoverProps['strategy'];\n\n /**\n * Intended positioning placement for the dialog element.\n * Placement may auto adjust based on screen position and other layout variables.\n */\n placement?: PopoverProps['placement'];\n /**\n * Optionally determines whether to trap the focus inside the dialog, preventing it from being moved outside until the dialog is closed.\n * @default false\n */\n focusTrap?: boolean;\n\n /** Reference to the dialog's root element. */\n ref?: PopoverProps['ref'];\n}\n\nexport type DialogProps = WithAttributes<'div', BaseDialogProps>;\n\n/** A simple callback or an object to customize a subset button properties. */\ntype FormAction =\n | (() => void)\n | {\n text?: string;\n disabled?: boolean;\n handler: () => void;\n };\n\nexport type FormDialogProps = WithAttributes<\n 'div',\n BaseDialogProps & {\n /** Called when the user presses escape or clicks away. */\n onDismiss?: () => void;\n\n /**\n * Renders a standard design system cancel button.\n * If onDismiss is not provided, onCancel will be invoked when the user presses the Escape key or clicks outside of the dialog.\n * Invocation of this indicates the user wishes to cancel any changes and close the dialog.\n */\n onCancel: FormAction;\n\n /**\n * Renders a standard design system submit button.\n * Invocation of this indicates the user wishes to submit any changes and close the dialog. Please consider progress states after submit.\n */\n onSubmit: FormAction;\n } & (\n | {\n /** A string to indicate context for the dialog. The dialog will be labelled by this value. */\n heading: string;\n /** Show additional info in form dialog header. */\n additionalInfo?: AdditionalInfoProps;\n 'aria-label'?: never;\n }\n | {\n heading?: never;\n /** Provide a contextually sufficient aria label if a visible heading is not provided. */\n 'aria-label': string;\n additionalInfo?: never;\n }\n )\n>;\n\nexport type InfoDialogProps = WithAttributes<\n 'div',\n OmitStrict<BaseDialogProps, 'arrow'> & {\n /** A string or summary item like props to indicate context for the dialog. The dialog will be labelled by either the heading element or primary property. */\n heading?:\n | string\n | {\n primary: string;\n secondary?: string;\n visual?: ReactNode;\n };\n\n /** Renders a standard design system dismiss button to close the dialog when the user clicks this button, presses escape or clicks away. */\n onDismiss: () => void;\n }\n>;\n\n/**\n * Components which render Dialog internally may need to offer some control to consuming components.\n * Use this interface to offer an imperative handle for shared control.\n */\nexport interface DialogHandleValue {\n open: () => void;\n close: () => void;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FormDialog.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/FormDialog.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAiB7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGtD,eAAO,MAAM,gBAAgB,gPAAmB,CAAC;AAEjD,QAAA,MAAM,UAAU,6HA+Jf,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"FormDialog.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/FormDialog.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAkB7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGtD,eAAO,MAAM,gBAAgB,gPAAmB,CAAC;AAEjD,QAAA,MAAM,UAAU,6HAyKf,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -6,11 +6,12 @@ import { getActiveElement, getFocusables } from '../../utils';
6
6
  import Button from '../Button';
7
7
  import Text from '../Text';
8
8
  import Progress from '../Progress';
9
+ import AdditionalInfo from '../AdditionalInfo';
9
10
  import Flex from '../Flex';
10
11
  import { StyledChildrenWrap, StyledDialogContent, StyledDialogFooter, StyledDialogHeader } from './Dialog.styles';
11
12
  import Dialog from './Dialog';
12
13
  export const StyledFormDialog = styled(Dialog) ``;
13
- const FormDialog = forwardRef(function FormDialog({ arrow = true, target, heading, 'aria-label': ariaLabel, children, progress, onDismiss, onCancel, onSubmit, ...restProps }, ref) {
14
+ const FormDialog = forwardRef(function FormDialog({ arrow = true, target, heading, 'aria-label': ariaLabel, children, progress, onDismiss, onCancel, onSubmit, additionalInfo, ...restProps }, ref) {
14
15
  const t = useI18n();
15
16
  const headingId = useUID();
16
17
  const dialogRef = useConsolidatedRef(ref);
@@ -78,7 +79,11 @@ const FormDialog = forwardRef(function FormDialog({ arrow = true, target, headin
78
79
  }, []);
79
80
  return (_jsxs(StyledFormDialog, { ...restProps, ...(heading === undefined
80
81
  ? { 'aria-label': ariaLabel }
81
- : { 'aria-labelledby': headingId }), arrow: arrow, target: target, progress: progress, ref: dialogRef, children: [heading !== undefined && (_jsx(Flex, { container: { alignItems: 'center', justify: 'between', pad: 2 }, item: { shrink: 0 }, as: StyledDialogHeader, children: _jsx(Text, { id: headingId, variant: 'h2', children: heading }) })), _jsxs(Flex, { item: { grow: 1 }, as: StyledDialogContent, ref: dialogContentRef, children: [children && (_jsx(StyledChildrenWrap, { inert: progress ? '' : undefined, children: children })), _jsx(Progress, { visible: !!progress, focusOnVisible: true, placement: 'local', message: typeof progress === 'string' ? progress : undefined })] }), _jsxs(Flex, { container: { alignItems: 'center', justify: 'between', pad: 2 }, item: { shrink: 0 }, as: StyledDialogFooter, children: [_jsx(Button, { onClick: () => {
82
+ : { 'aria-labelledby': headingId }), arrow: arrow, target: target, progress: progress, ref: dialogRef, children: [heading !== undefined && (_jsxs(Flex, { container: {
83
+ alignItems: 'center',
84
+ gap: additionalInfo?.heading ? 1 : undefined,
85
+ pad: 2
86
+ }, item: { shrink: 0 }, as: StyledDialogHeader, children: [_jsx(Text, { id: headingId, variant: 'h2', children: heading }), additionalInfo?.heading && (_jsx(AdditionalInfo, { heading: additionalInfo.heading, children: additionalInfo.children }))] })), _jsxs(Flex, { item: { grow: 1 }, as: StyledDialogContent, ref: dialogContentRef, children: [children && (_jsx(StyledChildrenWrap, { inert: progress ? '' : undefined, children: children })), _jsx(Progress, { visible: !!progress, focusOnVisible: true, placement: 'local', message: typeof progress === 'string' ? progress : undefined })] }), _jsxs(Flex, { container: { alignItems: 'center', justify: 'between', pad: 2 }, item: { shrink: 0 }, as: StyledDialogFooter, children: [_jsx(Button, { onClick: () => {
82
87
  onCancelHandler();
83
88
  }, disabled: typeof onCancel !== 'function' ? onCancel.disabled : undefined, ref: cancelButtonRef, children: typeof onCancel !== 'function' && onCancel.text ? onCancel.text : t('cancel') }), _jsx(Button, { variant: 'primary', onClick: () => {
84
89
  (typeof onSubmit !== 'function' ? onSubmit.handler : onSubmit)();
@@ -1 +1 @@
1
- {"version":3,"file":"FormDialog.js","sourceRoot":"","sources":["../../../src/components/Dialog/FormDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAEvE,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,QAAQ,MAAM,aAAa,CAAC;AAEnC,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,OAAO,EACL,kB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E,GAAG,EAAE,CAAC,EAAE,EAC/D,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,EACnB,EAAE,EAAE,kBAAkB,aAEtB,KAAC,MAAM,IACL,OAAO,EAAE,GAAG,EAAE;4BACZ,eAAe,EAAE,CAAC;wBACpB,CAAC,EACD,QAAQ,EAAE,OAAO,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EACxE,GAAG,EAAE,eAAe,YAEnB,OAAO,QAAQ,KAAK,UAAU,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GACvE,EAET,KAAC,MAAM,IACL,OAAO,EAAC,SAAS,EACjB,OAAO,EAAE,GAAG,EAAE;4BACZ,CAAC,OAAO,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;wBACnE,CAAC,EACD,QAAQ,EAAE,OAAO,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,YAEvE,OAAO,QAAQ,KAAK,UAAU,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GACvE,IACJ,IACU,CACpB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { forwardRef, useRef, useEffect, useLayoutEffect } from 'react';\nimport type { PropsWithoutRef } from 'react';\nimport styled from 'styled-components';\n\nimport { useConsolidatedRef, useEscape, useI18n, useOuterEvent, useUID } from '../../hooks';\nimport { getActiveElement, getFocusables } from '../../utils';\nimport Button from '../Button';\nimport Text from '../Text';\nimport Progress from '../Progress';\nimport type { RefElement } from '../../types';\nimport Flex from '../Flex';\n\nimport {\n StyledChildrenWrap,\n StyledDialogContent,\n StyledDialogFooter,\n StyledDialogHeader\n} from './Dialog.styles';\nimport type { FormDialogProps } from './Dialog.types';\nimport Dialog from './Dialog';\n\nexport const StyledFormDialog = styled(Dialog)``;\n\nconst FormDialog = forwardRef<RefElement<FormDialogProps>, PropsWithoutRef<FormDialogProps>>(\n function FormDialog(\n {\n arrow = true,\n target,\n heading,\n 'aria-label': ariaLabel,\n children,\n progress,\n onDismiss,\n onCancel,\n onSubmit,\n ...restProps\n },\n ref\n ) {\n const t = useI18n();\n const headingId = useUID();\n const dialogRef = useConsolidatedRef(ref);\n const dialogContentRef = useRef<HTMLDivElement>(null);\n const cancelButtonRef = useRef<HTMLButtonElement>(null);\n\n const setFocus = () => {\n if (progress) return;\n\n const focusables = getFocusables(dialogRef);\n\n const focusable =\n focusables.find(el => {\n return dialogContentRef.current?.contains(el);\n }) ??\n cancelButtonRef.current ??\n focusables[0];\n\n focusable?.focus();\n };\n\n const onCancelHandler = typeof onCancel === 'function' ? onCancel : onCancel.handler;\n\n useEscape(\n e => {\n if (onDismiss) {\n onDismiss();\n } else {\n onCancelHandler();\n }\n e.stopPropagation();\n },\n dialogRef,\n [onDismiss, onCancelHandler]\n );\n\n useOuterEvent('mousedown', [target, dialogRef], () => {\n if (onDismiss) {\n onDismiss();\n } else {\n onCancelHandler();\n }\n });\n\n // Using layout effect to capture the focused element prior to dialog elements taking focus.\n useLayoutEffect(() => {\n const initiatorElement = getActiveElement();\n\n return () => {\n if (initiatorElement instanceof HTMLElement && initiatorElement.isConnected) {\n initiatorElement.focus();\n }\n };\n }, []);\n\n useEffect(() => {\n if (!progress) {\n setFocus();\n }\n }, [progress]);\n\n useEffect(() => {\n const closeDialog = () => {\n setTimeout(() => {\n if (onDismiss) {\n onDismiss();\n } else {\n onCancelHandler();\n }\n // The 0 timeout ensures that the dialog will not re-open immediately after the close event is triggered.\n }, 0);\n };\n\n target.addEventListener('click', closeDialog);\n\n return () => {\n target.removeEventListener('click', closeDialog);\n };\n }, []);\n\n return (\n <StyledFormDialog\n {...restProps}\n {...(heading === undefined\n ? { 'aria-label': ariaLabel }\n : { 'aria-labelledby': headingId })}\n arrow={arrow}\n target={target}\n progress={progress}\n ref={dialogRef}\n >\n {heading !== undefined && (\n <Flex\n container={{ alignItems: 'center', justify: 'between', pad: 2 }}\n item={{ shrink: 0 }}\n as={StyledDialogHeader}\n >\n <Text id={headingId} variant='h2'>\n {heading}\n </Text>\n </Flex>\n )}\n\n <Flex item={{ grow: 1 }} as={StyledDialogContent} ref={dialogContentRef}>\n {children && (\n <StyledChildrenWrap inert={progress ? '' : undefined}>{children}</StyledChildrenWrap>\n )}\n <Progress\n visible={!!progress}\n focusOnVisible\n placement='local'\n message={typeof progress === 'string' ? progress : undefined}\n />\n </Flex>\n\n <Flex\n container={{ alignItems: 'center', justify: 'between', pad: 2 }}\n item={{ shrink: 0 }}\n as={StyledDialogFooter}\n >\n <Button\n onClick={() => {\n onCancelHandler();\n }}\n disabled={typeof onCancel !== 'function' ? onCancel.disabled : undefined}\n ref={cancelButtonRef}\n >\n {typeof onCancel !== 'function' && onCancel.text ? onCancel.text : t('cancel')}\n </Button>\n\n <Button\n variant='primary'\n onClick={() => {\n (typeof onSubmit !== 'function' ? onSubmit.handler : onSubmit)();\n }}\n disabled={typeof onSubmit !== 'function' ? onSubmit.disabled : undefined}\n >\n {typeof onSubmit !== 'function' && onSubmit.text ? onSubmit.text : t('submit')}\n </Button>\n </Flex>\n </StyledFormDialog>\n );\n }\n);\n\nexport default FormDialog;\n"]}
1
+ {"version":3,"file":"FormDialog.js","sourceRoot":"","sources":["../../../src/components/Dialog/FormDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAEvE,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAA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CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,YAEvE,OAAO,QAAQ,KAAK,UAAU,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GACvE,IACJ,IACU,CACpB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { forwardRef, useRef, useEffect, useLayoutEffect } from 'react';\nimport type { PropsWithoutRef } from 'react';\nimport styled from 'styled-components';\n\nimport { useConsolidatedRef, useEscape, useI18n, useOuterEvent, useUID } from '../../hooks';\nimport { getActiveElement, getFocusables } from '../../utils';\nimport Button from '../Button';\nimport Text from '../Text';\nimport Progress from '../Progress';\nimport AdditionalInfo from '../AdditionalInfo';\nimport type { RefElement } from '../../types';\nimport Flex from '../Flex';\n\nimport {\n StyledChildrenWrap,\n StyledDialogContent,\n StyledDialogFooter,\n StyledDialogHeader\n} from './Dialog.styles';\nimport type { FormDialogProps } from './Dialog.types';\nimport Dialog from './Dialog';\n\nexport const StyledFormDialog = styled(Dialog)``;\n\nconst FormDialog = forwardRef<RefElement<FormDialogProps>, PropsWithoutRef<FormDialogProps>>(\n function FormDialog(\n {\n arrow = true,\n target,\n heading,\n 'aria-label': ariaLabel,\n children,\n progress,\n onDismiss,\n onCancel,\n onSubmit,\n additionalInfo,\n ...restProps\n },\n ref\n ) {\n const t = useI18n();\n const headingId = useUID();\n const dialogRef = useConsolidatedRef(ref);\n const dialogContentRef = useRef<HTMLDivElement>(null);\n const cancelButtonRef = useRef<HTMLButtonElement>(null);\n\n const setFocus = () => {\n if (progress) return;\n\n const focusables = getFocusables(dialogRef);\n\n const focusable =\n focusables.find(el => {\n return dialogContentRef.current?.contains(el);\n }) ??\n cancelButtonRef.current ??\n focusables[0];\n\n focusable?.focus();\n };\n\n const onCancelHandler = typeof onCancel === 'function' ? onCancel : onCancel.handler;\n\n useEscape(\n e => {\n if (onDismiss) {\n onDismiss();\n } else {\n onCancelHandler();\n }\n e.stopPropagation();\n },\n dialogRef,\n [onDismiss, onCancelHandler]\n );\n\n useOuterEvent('mousedown', [target, dialogRef], () => {\n if (onDismiss) {\n onDismiss();\n } else {\n onCancelHandler();\n }\n });\n\n // Using layout effect to capture the focused element prior to dialog elements taking focus.\n useLayoutEffect(() => {\n const initiatorElement = getActiveElement();\n\n return () => {\n if (initiatorElement instanceof HTMLElement && initiatorElement.isConnected) {\n initiatorElement.focus();\n }\n };\n }, []);\n\n useEffect(() => {\n if (!progress) {\n setFocus();\n }\n }, [progress]);\n\n useEffect(() => {\n const closeDialog = () => {\n setTimeout(() => {\n if (onDismiss) {\n onDismiss();\n } else {\n onCancelHandler();\n }\n // The 0 timeout ensures that the dialog will not re-open immediately after the close event is triggered.\n }, 0);\n };\n\n target.addEventListener('click', closeDialog);\n\n return () => {\n target.removeEventListener('click', closeDialog);\n };\n }, []);\n\n return (\n <StyledFormDialog\n {...restProps}\n {...(heading === undefined\n ? { 'aria-label': ariaLabel }\n : { 'aria-labelledby': headingId })}\n arrow={arrow}\n target={target}\n progress={progress}\n ref={dialogRef}\n >\n {heading !== undefined && (\n <Flex\n container={{\n alignItems: 'center',\n gap: additionalInfo?.heading ? 1 : undefined,\n pad: 2\n }}\n item={{ shrink: 0 }}\n as={StyledDialogHeader}\n >\n <Text id={headingId} variant='h2'>\n {heading}\n </Text>\n {additionalInfo?.heading && (\n <AdditionalInfo heading={additionalInfo.heading}>\n {additionalInfo.children}\n </AdditionalInfo>\n )}\n </Flex>\n )}\n\n <Flex item={{ grow: 1 }} as={StyledDialogContent} ref={dialogContentRef}>\n {children && (\n <StyledChildrenWrap inert={progress ? '' : undefined}>{children}</StyledChildrenWrap>\n )}\n <Progress\n visible={!!progress}\n focusOnVisible\n placement='local'\n message={typeof progress === 'string' ? progress : undefined}\n />\n </Flex>\n\n <Flex\n container={{ alignItems: 'center', justify: 'between', pad: 2 }}\n item={{ shrink: 0 }}\n as={StyledDialogFooter}\n >\n <Button\n onClick={() => {\n onCancelHandler();\n }}\n disabled={typeof onCancel !== 'function' ? onCancel.disabled : undefined}\n ref={cancelButtonRef}\n >\n {typeof onCancel !== 'function' && onCancel.text ? onCancel.text : t('cancel')}\n </Button>\n\n <Button\n variant='primary'\n onClick={() => {\n (typeof onSubmit !== 'function' ? onSubmit.handler : onSubmit)();\n }}\n disabled={typeof onSubmit !== 'function' ? onSubmit.disabled : undefined}\n >\n {typeof onSubmit !== 'function' && onSubmit.text ? onSubmit.text : t('submit')}\n </Button>\n </Flex>\n </StyledFormDialog>\n );\n }\n);\n\nexport default FormDialog;\n"]}
@@ -66,7 +66,7 @@ const InfoDialog = forwardRef(function InfoDialog({ target, heading: headingProp
66
66
  }, label: t('close'), ref: closeButtonRef, children: _jsx(Icon, { name: 'times' }) }));
67
67
  return (_jsxs(StyledInfoDialog, { ...restProps, ...(typeof headingProp === 'string'
68
68
  ? { 'aria-labelledby': headingId }
69
- : { 'aria-label': headingProp?.primary }), arrow: true, target: target, progress: progressProp, ref: dialogRef, children: [headingProp && heading && (_jsxs(Flex, { container: { alignItems: 'center', justify: 'between', pad: 2, gap: 1 }, item: { shrink: 0 }, as: StyledDialogHeader, children: [typeof headingProp === 'string' ? (heading) : (_jsx(SummaryItem, { primary: heading, secondary: headingProp.secondary ? (_jsx(Text, { variant: 'secondary', children: headingProp.secondary })) : undefined, visual: headingProp.visual })), dismissButton] })), (!headingProp || children || progressProp) && (_jsxs(Flex, { container: { direction: 'column' }, item: { grow: 1 }, as: StyledDialogContent, ref: dialogContentRef, children: [!headingProp && dismissButton, children && (_jsx(StyledChildrenWrap, { inert: progressProp ? '' : undefined, children: children })), progress] }))] }));
69
+ : { 'aria-label': headingProp?.primary }), arrow: true, target: target, progress: progressProp, ref: dialogRef, children: [headingProp && heading && (_jsxs(Flex, { container: { alignItems: 'center', justify: 'between', pad: [1, 2], gap: 1 }, item: { shrink: 0 }, as: StyledDialogHeader, children: [typeof headingProp === 'string' ? (heading) : (_jsx(SummaryItem, { primary: heading, secondary: headingProp.secondary ? (_jsx(Text, { variant: 'secondary', children: headingProp.secondary })) : undefined, visual: headingProp.visual })), dismissButton] })), (!headingProp || children || progressProp) && (_jsxs(Flex, { container: { direction: 'column' }, item: { grow: 1 }, as: StyledDialogContent, ref: dialogContentRef, children: [!headingProp && dismissButton, children && (_jsx(StyledChildrenWrap, { inert: progressProp ? '' : undefined, children: children })), progress] }))] }));
70
70
  });
71
71
  export default InfoDialog;
72
72
  //# sourceMappingURL=InfoDialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InfoDialog.js","sourceRoot":"","sources":["../../../src/components/Dialog/InfoDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAGvE,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC5F,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG9D,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE9F,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,MAAM,UAAU,GAAG,UAAU,CAC3B,SAAS,UAAU,CACjB,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,EAC3F,GAAG;IAE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AAC,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,YACrD,QAAQ,GACU,CACtB,EACA,QAAQ,IACJ,CACR,IACgB,CACpB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { forwardRef, useRef, useEffect, useLayoutEffect } from 'react';\nimport type { PropsWithoutRef } from 'react';\n\nimport { useConsolidatedRef, useEscape, useI18n, useOuterEvent, useUID } from '../../hooks';\nimport Text from '../Text';\nimport Icon from '../Icon';\nimport Progress from '../Progress';\nimport Flex from '../Flex';\nimport SummaryItem from '../SummaryItem';\nimport { getActiveElement, getFocusables } from '../../utils';\nimport type { RefElement } from '../../types';\n\nimport { StyledChildrenWrap, StyledDialogContent, StyledDialogHeader } from './Dialog.styles';\nimport type { InfoDialogProps } from './Dialog.types';\nimport { StyledDismissButton, StyledInfoDialog } from './InfoDialog.styles';\n\nconst InfoDialog = forwardRef<RefElement<InfoDialogProps>, PropsWithoutRef<InfoDialogProps>>(\n function InfoDialog(\n { target, heading: headingProp, children, progress: progressProp, onDismiss, ...restProps },\n ref\n ) {\n const t = useI18n();\n const headingId = useUID();\n const dialogRef = useConsolidatedRef(ref);\n const dialogContentRef = useRef<HTMLDivElement>(null);\n const closeButtonRef = useRef<HTMLButtonElement>(null);\n\n const setFocus = () => {\n if (progressProp) return;\n\n const focusables = getFocusables(dialogRef);\n\n const focusable =\n focusables.find(el => {\n return dialogContentRef.current?.contains(el);\n }) ??\n closeButtonRef.current ??\n focusables[0];\n\n focusable?.focus();\n };\n\n useEscape(\n e => {\n onDismiss?.();\n e.stopPropagation();\n },\n dialogRef,\n [onDismiss]\n );\n\n useOuterEvent('mousedown', [target, dialogRef], () => {\n onDismiss?.();\n });\n\n // Using layout effect to capture the focused element prior to dialog elements taking focus.\n useLayoutEffect(() => {\n const initiatorElement = getActiveElement();\n\n return () => {\n if (initiatorElement instanceof HTMLElement && initiatorElement.isConnected) {\n initiatorElement.focus();\n }\n };\n }, []);\n\n useEffect(() => {\n if (!progressProp) {\n setFocus();\n }\n }, [progressProp]);\n\n useEffect(() => {\n const closeDialog = () => {\n setTimeout(() => {\n onDismiss?.();\n // The 0 timeout ensures that the dialog will not re-open immediately after the close event is triggered.\n }, 0);\n };\n\n target.addEventListener('click', closeDialog);\n\n return () => {\n target.removeEventListener('click', closeDialog);\n };\n }, []);\n\n const heading = headingProp ? (\n <Text id={headingId} variant='h2'>\n {typeof headingProp === 'string' ? headingProp : headingProp.primary}\n </Text>\n ) : null;\n\n const progress = (\n <Progress\n visible={!!progressProp}\n focusOnVisible\n placement='local'\n message={typeof progressProp === 'string' ? progressProp : undefined}\n />\n );\n\n const dismissButton = (\n <StyledDismissButton\n icon\n variant='simple'\n onClick={() => {\n onDismiss();\n }}\n label={t('close')}\n ref={closeButtonRef}\n >\n <Icon name='times' />\n </StyledDismissButton>\n );\n\n return (\n <StyledInfoDialog\n {...restProps}\n {...(typeof headingProp === 'string'\n ? { 'aria-labelledby': headingId }\n : { 'aria-label': headingProp?.primary })}\n arrow\n target={target}\n progress={progressProp}\n ref={dialogRef}\n >\n {headingProp && heading && (\n <Flex\n container={{ alignItems: 'center', justify: 'between', pad: 2, gap: 1 }}\n item={{ shrink: 0 }}\n as={StyledDialogHeader}\n >\n {typeof headingProp === 'string' ? (\n heading\n ) : (\n <SummaryItem\n primary={heading}\n secondary={\n headingProp.secondary ? (\n <Text variant='secondary'>{headingProp.secondary}</Text>\n ) : undefined\n }\n visual={headingProp.visual}\n />\n )}\n {dismissButton}\n </Flex>\n )}\n\n {(!headingProp || children || progressProp) && (\n <Flex\n container={{ direction: 'column' }}\n item={{ grow: 1 }}\n as={StyledDialogContent}\n ref={dialogContentRef}\n >\n {!headingProp && dismissButton}\n {children && (\n <StyledChildrenWrap inert={progressProp ? '' : undefined}>\n {children}\n </StyledChildrenWrap>\n )}\n {progress}\n </Flex>\n )}\n </StyledInfoDialog>\n );\n }\n);\n\nexport default InfoDial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I,CACzB,MAAC,IAAI,IACH,SAAS,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAC5E,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,EACnB,EAAE,EAAE,kBAAkB,aAErB,OAAO,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,CACjC,OAAO,CACR,CAAC,CAAC,CAAC,CACF,KAAC,WAAW,IACV,OAAO,EAAE,OAAO,EAChB,SAAS,EACP,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CACtB,KAAC,IAAI,IAAC,OAAO,EAAC,WAAW,YAAE,WAAW,CAAC,SAAS,GAAQ,CACzD,CAAC,CAAC,CAAC,SAAS,EAEf,MAAM,EAAE,WAAW,CAAC,MAAM,GAC1B,CACH,EACA,aAAa,IACT,CACR,EAEA,CAAC,CAAC,WAAW,IAAI,QAAQ,IAAI,YAAY,CAAC,IAAI,CAC7C,MAAC,IAAI,IACH,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAClC,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EACjB,EAAE,EAAE,mBAAmB,EACvB,GAAG,EAAE,gBAAgB,aAEpB,CAAC,WAAW,IAAI,aAAa,EAC7B,QAAQ,IAAI,CACX,KAAC,kBAAkB,IAAC,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,YACrD,QAAQ,GACU,CACtB,EACA,QAAQ,IACJ,CACR,IACgB,CACpB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { forwardRef, useRef, useEffect, useLayoutEffect } from 'react';\nimport type { PropsWithoutRef } from 'react';\n\nimport { useConsolidatedRef, useEscape, useI18n, useOuterEvent, useUID } from '../../hooks';\nimport Text from '../Text';\nimport Icon from '../Icon';\nimport Progress from '../Progress';\nimport Flex from '../Flex';\nimport SummaryItem from '../SummaryItem';\nimport { getActiveElement, getFocusables } from '../../utils';\nimport type { RefElement } from '../../types';\n\nimport { StyledChildrenWrap, StyledDialogContent, StyledDialogHeader } from './Dialog.styles';\nimport type { InfoDialogProps } from './Dialog.types';\nimport { StyledDismissButton, StyledInfoDialog } from './InfoDialog.styles';\n\nconst InfoDialog = forwardRef<RefElement<InfoDialogProps>, PropsWithoutRef<InfoDialogProps>>(\n function InfoDialog(\n { target, heading: headingProp, children, progress: progressProp, onDismiss, ...restProps },\n ref\n ) {\n const t = useI18n();\n const headingId = useUID();\n const dialogRef = useConsolidatedRef(ref);\n const dialogContentRef = useRef<HTMLDivElement>(null);\n const closeButtonRef = useRef<HTMLButtonElement>(null);\n\n const setFocus = () => {\n if (progressProp) return;\n\n const focusables = getFocusables(dialogRef);\n\n const focusable =\n focusables.find(el => {\n return dialogContentRef.current?.contains(el);\n }) ??\n closeButtonRef.current ??\n focusables[0];\n\n focusable?.focus();\n };\n\n useEscape(\n e => {\n onDismiss?.();\n e.stopPropagation();\n },\n dialogRef,\n [onDismiss]\n );\n\n useOuterEvent('mousedown', [target, dialogRef], () => {\n onDismiss?.();\n });\n\n // Using layout effect to capture the focused element prior to dialog elements taking focus.\n useLayoutEffect(() => {\n const initiatorElement = getActiveElement();\n\n return () => {\n if (initiatorElement instanceof HTMLElement && initiatorElement.isConnected) {\n initiatorElement.focus();\n }\n };\n }, []);\n\n useEffect(() => {\n if (!progressProp) {\n setFocus();\n }\n }, [progressProp]);\n\n useEffect(() => {\n const closeDialog = () => {\n setTimeout(() => {\n onDismiss?.();\n // The 0 timeout ensures that the dialog will not re-open immediately after the close event is triggered.\n }, 0);\n };\n\n target.addEventListener('click', closeDialog);\n\n return () => {\n target.removeEventListener('click', closeDialog);\n };\n }, []);\n\n const heading = headingProp ? (\n <Text id={headingId} variant='h2'>\n {typeof headingProp === 'string' ? headingProp : headingProp.primary}\n </Text>\n ) : null;\n\n const progress = (\n <Progress\n visible={!!progressProp}\n focusOnVisible\n placement='local'\n message={typeof progressProp === 'string' ? progressProp : undefined}\n />\n );\n\n const dismissButton = (\n <StyledDismissButton\n icon\n variant='simple'\n onClick={() => {\n onDismiss();\n }}\n label={t('close')}\n ref={closeButtonRef}\n >\n <Icon name='times' />\n </StyledDismissButton>\n );\n\n return (\n <StyledInfoDialog\n {...restProps}\n {...(typeof headingProp === 'string'\n ? { 'aria-labelledby': headingId }\n : { 'aria-label': headingProp?.primary })}\n arrow\n target={target}\n progress={progressProp}\n ref={dialogRef}\n >\n {headingProp && heading && (\n <Flex\n container={{ alignItems: 'center', justify: 'between', pad: [1, 2], gap: 1 }}\n item={{ shrink: 0 }}\n as={StyledDialogHeader}\n >\n {typeof headingProp === 'string' ? (\n heading\n ) : (\n <SummaryItem\n primary={heading}\n secondary={\n headingProp.secondary ? (\n <Text variant='secondary'>{headingProp.secondary}</Text>\n ) : undefined\n }\n visual={headingProp.visual}\n />\n )}\n {dismissButton}\n </Flex>\n )}\n\n {(!headingProp || children || progressProp) && (\n <Flex\n container={{ direction: 'column' }}\n item={{ grow: 1 }}\n as={StyledDialogContent}\n ref={dialogContentRef}\n >\n {!headingProp && dismissButton}\n {children && (\n <StyledChildrenWrap inert={progressProp ? '' : undefined}>\n {children}\n </StyledChildrenWrap>\n )}\n {progress}\n </Flex>\n )}\n </StyledInfoDialog>\n );\n }\n);\n\nexport default InfoDialog;\n"]}
@@ -30,9 +30,16 @@ export interface DrawerProps extends AsProp, BaseProps {
30
30
  transitionSpeed?: string;
31
31
  /**
32
32
  * The width or height that the Drawer will open to, depending on its placement.
33
+ * If `resizeable`, is true this value will be overridden by the width set by the user.
33
34
  * @default '100%'
34
35
  */
35
36
  size?: string;
37
+ /**
38
+ * If true, the Drawer will be resizable. Will not be applied if `placement` is set to `top` or `bottom`.
39
+ * @default false
40
+ * @internal Can only be used with one drawer at a time.
41
+ */
42
+ resizeable?: boolean;
36
43
  /** Callback fired after Drawer opens. */
37
44
  onAfterOpen?: () => void;
38
45
  /** Callback fired after Drawer closes. */
@@ -53,6 +60,6 @@ type State = 'open' | 'closed' | 'opening' | 'closing';
53
60
  export declare const StyledDrawer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, Partial<DrawerProps & {
54
61
  state: State;
55
62
  }>, never>;
56
- declare const Drawer: FunctionComponent<DrawerProps & ForwardProps>;
63
+ export declare const Drawer: FunctionComponent<DrawerProps & ForwardProps>;
57
64
  export default Drawer;
58
65
  //# sourceMappingURL=Drawer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAO,iBAAiB,EAAE,SAAS,EAAmB,MAAM,OAAO,CAAC;AAIhF,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAInE,MAAM,WAAW,WAAY,SAAQ,MAAM,EAAE,SAAS;IACpD;;;OAGG;IACH,IAAI,EAAE,OAAO,CAAC;IACd,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAChD;;;OAGG;IACH,QAAQ,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC;IAChC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,0CAA0C;IAC1C,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,2CAA2C;IAC3C,aAA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1C,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,2CAA2C;IAC3C,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,uEAAuE;IACvE,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,KAAK,KAAK,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;AAEvD,eAAO,MAAM,YAAY;WAA6C,KAAK;UAuCzE,CAAC;AAIH,eAAO,MAAM,MAAM,EAAE,iBAAiB,CAAC,WAAW,GAAG,YAAY,CA+J/D,CAAC;AAEH,eAAe,MAAM,CAAC"}
@@ -1,11 +1,15 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useEffect, useCallback, forwardRef, useState } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useCallback, forwardRef, useState, useRef } from 'react';
3
3
  import styled, { css } from 'styled-components';
4
- import { useOuterEvent, useConsolidatedRef, usePrevious } from '../../hooks';
5
- import { reflow } from '../../utils';
4
+ import { remToPx } from 'polished';
5
+ import { useOuterEvent, useConsolidatedRef, usePrevious, useDirection } from '../../hooks';
6
+ import { getChildOfRootNode, reflow } from '../../utils';
6
7
  import { defaultThemeProp } from '../../theme';
8
+ import { resizeDrawerKeyboardStep, resizeDrawerMaxWidth, resizeDrawerMinWidth } from '../../styles/constants';
9
+ import ResizeHandle from './ResizeHandle';
10
+ const drawerMinWidth = remToPx(resizeDrawerMinWidth);
7
11
  export const StyledDrawer = styled.div(props => {
8
- const { state, shadow, position, placement, transitionSpeed, size, theme } = props;
12
+ const { state, shadow, position, placement, transitionSpeed, size, resizeable, theme } = props;
9
13
  let dimension = 'horizontal';
10
14
  let axis = 'X';
11
15
  let anchor = 'top';
@@ -34,12 +38,18 @@ export const StyledDrawer = styled.div(props => {
34
38
  css `
35
39
  box-shadow: ${theme.base.shadow.high};
36
40
  `}
41
+
42
+ ${resizeable &&
43
+ css `
44
+ width: ${dimension === 'horizontal' ? 'var(--resize-drawer-width)' : '100%'};
45
+ `}
37
46
  `;
38
47
  });
39
48
  StyledDrawer.defaultProps = defaultThemeProp;
40
- const Drawer = forwardRef(function Drawer(props, ref) {
41
- const { open = false, shadow = false, position = 'absolute', children, placement = 'right', transitionSpeed, size = '100%', onAfterOpen, onAfterClose, onBeforeOpen, onBeforeClose, onOuterClick, nullWhenClosed = false, ...restProps } = props;
49
+ export const Drawer = forwardRef(function Drawer(props, ref) {
50
+ const { open = false, shadow = false, position = 'absolute', children, placement = 'right', transitionSpeed, size = '100%', resizeable = false, onAfterOpen, onAfterClose, onBeforeOpen, onBeforeClose, onOuterClick, nullWhenClosed = false, ...restProps } = props;
42
51
  const drawerRef = useConsolidatedRef(ref);
52
+ const { ltr, rtl } = useDirection();
43
53
  const [state, setState] = useState(open ? 'open' : 'closed');
44
54
  let prevState = usePrevious(state);
45
55
  if (!prevState)
@@ -70,7 +80,56 @@ const Drawer = forwardRef(function Drawer(props, ref) {
70
80
  return;
71
81
  setState(open ? 'open' : 'closed');
72
82
  }, [open]);
73
- return state === 'closed' && !open && nullWhenClosed ? null : (_jsx(StyledDrawer, { ref: drawerRef, position: position, shadow: shadow && open, transitionSpeed: transitionSpeed, placement: placement, size: size, open: open, state: state, onTransitionEnd: onTransitionEnd, ...restProps, children: children }));
83
+ const dragStartXRef = useRef();
84
+ useEffect(() => {
85
+ if (!resizeable || !drawerRef.current)
86
+ return;
87
+ const targetNode = getChildOfRootNode(drawerRef);
88
+ if (!targetNode)
89
+ return;
90
+ if (!targetNode.style.getPropertyValue('--resize-drawer-width')) {
91
+ targetNode.style.setProperty('--resize-drawer-width', size);
92
+ }
93
+ }, [drawerRef.current]);
94
+ const handleResize = useCallback((e) => {
95
+ const targetNode = getChildOfRootNode(drawerRef);
96
+ const rect = drawerRef.current?.getBoundingClientRect();
97
+ if (!rect || !targetNode)
98
+ return;
99
+ dragStartXRef.current = e.clientX;
100
+ const ac = new AbortController();
101
+ targetNode.addEventListener('mousemove', moveEvent => {
102
+ if (!dragStartXRef.current || !rect.width)
103
+ return;
104
+ const initialX = dragStartXRef.current;
105
+ const widthDiff = placement === 'right' ? initialX - moveEvent.clientX : moveEvent.clientX - initialX;
106
+ const newWidth = Math.max(widthDiff + rect.width, parseInt(drawerMinWidth, 10));
107
+ // Set root-level CSS variable to communicate width to AppShell
108
+ targetNode.style.setProperty('--resize-drawer-width', `clamp(${drawerMinWidth}, ${newWidth}px, ${resizeDrawerMaxWidth})`);
109
+ }, { passive: true, signal: ac.signal });
110
+ targetNode.addEventListener('mouseup', () => {
111
+ ac.abort();
112
+ }, { once: true });
113
+ }, [placement]);
114
+ const keyboardResize = useCallback((e, grabbed) => {
115
+ if (!grabbed)
116
+ return;
117
+ const targetNode = getChildOfRootNode(drawerRef);
118
+ const resizeStep = document.documentElement.clientWidth * resizeDrawerKeyboardStep;
119
+ const rect = drawerRef.current?.getBoundingClientRect();
120
+ if (!rect || !targetNode)
121
+ return;
122
+ if (e.code !== 'ArrowLeft' && e.code !== 'ArrowRight')
123
+ return;
124
+ e.preventDefault();
125
+ const resizeDirection = (e.code === 'ArrowLeft' ? 1 : -1) * (placement === 'right' ? 1 : -1);
126
+ const newWidth = Math.max(rect.width + resizeDirection * resizeStep, parseInt(drawerMinWidth, 10));
127
+ targetNode.style.setProperty('--resize-drawer-width', `clamp(${drawerMinWidth}, ${newWidth}px, ${resizeDrawerMaxWidth})`);
128
+ }, [placement]);
129
+ const renderResizeHandle = resizeable &&
130
+ state === 'open' &&
131
+ ((placement === 'left' && rtl) || (placement === 'right' && ltr));
132
+ return state === 'closed' && !open && nullWhenClosed ? null : (_jsxs(StyledDrawer, { ref: drawerRef, position: position, shadow: shadow && open, transitionSpeed: transitionSpeed, placement: placement, size: size, resizeable: resizeable, open: open, state: state, onTransitionEnd: onTransitionEnd, ...restProps, children: [children, renderResizeHandle && _jsx(ResizeHandle, { onMouseDown: handleResize, onKeyDown: keyboardResize })] }));
74
133
  });
75
134
  export default Drawer;
76
135
  //# sourceMappingURL=Drawer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.js","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAErE,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE7E,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAsD/C,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAA0C,KAAK,CAAC,EAAE;IACtF,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IACnF,IAAI,SAAS,GAAG,YAAY,CAAC;IAC7B,IAAI,IAAI,GAAG,GAAG,CAAC;IACf,IAAI,MAAM,GAAG,KAAK,CAAC;IAEnB,IAAI,SAAS,KAAK,KAAK,IAAI,SAAS,KAAK,QAAQ,EAAE,CAAC;QAClD,SAAS,GAAG,UAAU,CAAC;QACvB,IAAI,GAAG,GAAG,CAAC;QACX,MAAM,GAAG,MAAM,CAAC;IAClB,CAAC;IAED,MAAM,SAAS,GAAG,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IACvE,MAAM,KAAK,GAAG,eAAe,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;IAE5D,OAAO,GAAG,CAAA;eACG,KAAK,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E,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IACrC,CAAC,EACD,CAAC,IAAI,CAAC,CACP,CAAC;IAEF,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,IAAI,IAAI,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAC5D,KAAC,YAAY,IACX,GAAG,EAAE,SAAS,EACd,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,IAAI,IAAI,EACtB,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,eAAe,KAC5B,SAAS,YAEZ,QAAQ,GACI,CAChB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC","sourcesContent":["import { useEffect, useCallback, forwardRef, useState } from 'react';\nimport type { Ref, FunctionComponent, ReactNode, TransitionEvent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { useOuterEvent, useConsolidatedRef, usePrevious } from '../../hooks';\nimport type { AsProp, BaseProps, ForwardProps } from '../../types';\nimport { reflow } from '../../utils';\nimport { defaultThemeProp } from '../../theme';\n\nexport interface DrawerProps extends AsProp, BaseProps {\n /**\n * If true, the Drawer will be visible.\n * @default false\n */\n open: boolean;\n /** Content of the Drawer. */\n children?: ReactNode;\n /**\n * Determines whether a drop shadow should be visible along the edge of the Drawer for contrast purposes.\n * @default false\n */\n shadow?: boolean;\n /**\n * Used to determine which side of the viewport the Drawer should open from.\n * @default 'right'\n */\n placement?: 'top' | 'right' | 'bottom' | 'left';\n /**\n * The position of the Drawer.\n * @default 'absolute'\n */\n position?: 'absolute' | 'fixed';\n /**\n * Determines the speed of the transition. This value comes from `theme.base.animation.speed`.\n * @default '0.25s'\n */\n transitionSpeed?: string;\n /**\n * The width or height that the Drawer will open to, depending on its placement.\n * @default '100%'\n */\n size?: string;\n /** Callback fired after Drawer opens. */\n onAfterOpen?: () => void;\n /** Callback fired after Drawer closes. */\n onAfterClose?: () => void;\n /** Callback fired before Drawer opens. */\n onBeforeOpen?: () => void;\n /** Callback fired before Drawer closes. */\n onBeforeClose?: () => void;\n /** Callback fired when a click action occurs outside of the Drawer. */\n onOuterClick?: () => void;\n /**\n * If true, removes the component from the real DOM when closed. For full virtual DOM unmount(if necessary), perform at a parent level.\n * @default false\n */\n nullWhenClosed?: boolean;\n}\n\ntype State = 'open' | 'closed' | 'opening' | 'closing';\n\nexport const StyledDrawer = styled.div<Partial<DrawerProps & { state: State }>>(props => {\n const { state, shadow, position, placement, transitionSpeed, size, theme } = props;\n let dimension = 'horizontal';\n let axis = 'X';\n let anchor = 'top';\n\n if (placement === 'top' || placement === 'bottom') {\n dimension = 'vertical';\n axis = 'Y';\n anchor = 'left';\n }\n\n const translate = state === 'open' || state === 'opening' ? 0 : '100%';\n const speed = transitionSpeed || theme.base.animation.speed;\n\n return css`\n z-index: ${theme.base['z-index'].drawer};\n position: ${position};\n ${placement}: 0;\n ${anchor}: 0;\n height: ${dimension === 'vertical' ? size : '100%'};\n width: ${dimension === 'horizontal' ? size : '100%'};\n transition-property: transform, box-shadow, opacity;\n transition-duration: max(${speed}, 0.0001s);\n transition-timing-function: ${theme.base.animation.timing.ease};\n transform: ${state === 'open'\n ? 'none'\n : `translate${axis}(${placement === 'top' || placement === 'left' ? '-' : ''}${translate})`};\n\n ${shadow &&\n css`\n box-shadow: ${theme.base.shadow.high};\n `}\n `;\n});\n\nStyledDrawer.defaultProps = defaultThemeProp;\n\nconst Drawer: FunctionComponent<DrawerProps & ForwardProps> = forwardRef(function Drawer(\n props: DrawerProps,\n ref: Ref<HTMLElement>\n) {\n const {\n open = false,\n shadow = false,\n position = 'absolute',\n children,\n placement = 'right',\n transitionSpeed,\n size = '100%',\n onAfterOpen,\n onAfterClose,\n onBeforeOpen,\n onBeforeClose,\n onOuterClick,\n nullWhenClosed = false,\n ...restProps\n } = props;\n\n const drawerRef = useConsolidatedRef(ref);\n\n const [state, setState] = useState<State>(open ? 'open' : 'closed');\n\n let prevState = usePrevious(state);\n if (!prevState) prevState = state;\n\n useOuterEvent(\n 'mousedown',\n [drawerRef],\n useCallback(() => {\n if (open) onOuterClick?.();\n }, [open, onOuterClick])\n );\n\n useEffect(() => {\n if (open && (state === 'closed' || state === 'closing')) {\n onBeforeOpen?.();\n reflow(drawerRef.current);\n setState('opening');\n } else if (!open && (state === 'open' || state === 'opening')) {\n onBeforeClose?.();\n setState('closing');\n } else if (open && state === 'open' && prevState !== 'open') {\n onAfterOpen?.();\n } else if (!open && state === 'closed' && prevState !== 'closed') {\n onAfterClose?.();\n }\n }, [open, state, prevState, onBeforeOpen, onBeforeClose, onAfterOpen, onAfterClose]);\n\n const onTransitionEnd = useCallback(\n (e: TransitionEvent): void => {\n if (e.target !== drawerRef.current || e.propertyName !== 'transform') return;\n setState(open ? 'open' : 'closed');\n },\n [open]\n );\n\n return state === 'closed' && !open && nullWhenClosed ? null : (\n <StyledDrawer\n ref={drawerRef}\n position={position}\n shadow={shadow && open}\n transitionSpeed={transitionSpeed}\n placement={placement}\n size={size}\n open={open}\n state={state}\n onTransitionEnd={onTransitionEnd}\n {...restProps}\n >\n {children}\n </StyledDrawer>\n );\n});\n\nexport default Drawer;\n"]}
1
+ {"version":3,"file":"Drawer.js","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAS7E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3F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AAS,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAE7F,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CACvB,IAAI,CAAC,KAAK,GAAG,eAAe,GAAG,UAAU,EACzC,QAAQ,CAAC,cAAc,EAAE,EAAE,CAAC,CAC7B,CAAC;QACF,UAAU,CAAC,KAAK,CAAC,WAAW,CAC1B,uBAAuB,EACvB,SAAS,cAAc,KAAK,QAAQ,OAAO,oBAAoB,GAAG,CACnE,CAAC;IACJ,CAAC,EACD,CAAC,SAAS,CAAC,CACZ,CAAC;IAEF,MAAM,kBAAkB,GACtB,UAAU;QACV,KAAK,KAAK,MAAM;QAChB,CAAC,CAAC,SAAS,KAAK,MAAM,IAAI,GAAG,CAAC,IAAI,CAAC,SAAS,KAAK,OAAO,IAAI,GAAG,CAAC,CAAC,CAAC;IAEpE,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,IAAI,IAAI,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAC5D,MAAC,YAAY,IACX,GAAG,EAAE,SAAS,EACd,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,IAAI,IAAI,EACtB,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,eAAe,KAC5B,SAAS,aAEZ,QAAQ,EACR,kBAAkB,IAAI,KAAC,YAAY,IAAC,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,cAAc,GAAI,IAChF,CAChB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC","sourcesContent":["import { useEffect, useCallback, forwardRef, useState, useRef } from 'react';\nimport type {\n Ref,\n FunctionComponent,\n ReactNode,\n TransitionEvent,\n MouseEvent as ReactMouseEvent,\n KeyboardEvent as ReactKeyboardEvent\n} from 'react';\nimport styled, { css } from 'styled-components';\nimport { remToPx } from 'polished';\n\nimport { useOuterEvent, useConsolidatedRef, usePrevious, useDirection } from '../../hooks';\nimport type { AsProp, BaseProps, ForwardProps } from '../../types';\nimport { getChildOfRootNode, reflow } from '../../utils';\nimport { defaultThemeProp } from '../../theme';\nimport {\n resizeDrawerKeyboardStep,\n resizeDrawerMaxWidth,\n resizeDrawerMinWidth\n} from '../../styles/constants';\n\nimport ResizeHandle from './ResizeHandle';\n\nconst drawerMinWidth = remToPx(resizeDrawerMinWidth);\n\nexport interface DrawerProps extends AsProp, BaseProps {\n /**\n * If true, the Drawer will be visible.\n * @default false\n */\n open: boolean;\n /** Content of the Drawer. */\n children?: ReactNode;\n /**\n * Determines whether a drop shadow should be visible along the edge of the Drawer for contrast purposes.\n * @default false\n */\n shadow?: boolean;\n /**\n * Used to determine which side of the viewport the Drawer should open from.\n * @default 'right'\n */\n placement?: 'top' | 'right' | 'bottom' | 'left';\n /**\n * The position of the Drawer.\n * @default 'absolute'\n */\n position?: 'absolute' | 'fixed';\n /**\n * Determines the speed of the transition. This value comes from `theme.base.animation.speed`.\n * @default '0.25s'\n */\n transitionSpeed?: string;\n /**\n * The width or height that the Drawer will open to, depending on its placement.\n * If `resizeable`, is true this value will be overridden by the width set by the user.\n * @default '100%'\n */\n size?: string;\n /**\n * If true, the Drawer will be resizable. Will not be applied if `placement` is set to `top` or `bottom`.\n * @default false\n * @internal Can only be used with one drawer at a time.\n */\n resizeable?: boolean;\n /** Callback fired after Drawer opens. */\n onAfterOpen?: () => void;\n /** Callback fired after Drawer closes. */\n onAfterClose?: () => void;\n /** Callback fired before Drawer opens. */\n onBeforeOpen?: () => void;\n /** Callback fired before Drawer closes. */\n onBeforeClose?: () => void;\n /** Callback fired when a click action occurs outside of the Drawer. */\n onOuterClick?: () => void;\n /**\n * If true, removes the component from the real DOM when closed. For full virtual DOM unmount(if necessary), perform at a parent level.\n * @default false\n */\n nullWhenClosed?: boolean;\n}\n\ntype State = 'open' | 'closed' | 'opening' | 'closing';\n\nexport const StyledDrawer = styled.div<Partial<DrawerProps & { state: State }>>(props => {\n const { state, shadow, position, placement, transitionSpeed, size, resizeable, theme } = props;\n let dimension = 'horizontal';\n let axis = 'X';\n let anchor = 'top';\n\n if (placement === 'top' || placement === 'bottom') {\n dimension = 'vertical';\n axis = 'Y';\n anchor = 'left';\n }\n\n const translate = state === 'open' || state === 'opening' ? 0 : '100%';\n const speed = transitionSpeed || theme.base.animation.speed;\n\n return css`\n z-index: ${theme.base['z-index'].drawer};\n position: ${position};\n ${placement}: 0;\n ${anchor}: 0;\n height: ${dimension === 'vertical' ? size : '100%'};\n width: ${dimension === 'horizontal' ? size : '100%'};\n transition-property: transform, box-shadow, opacity;\n transition-duration: max(${speed}, 0.0001s);\n transition-timing-function: ${theme.base.animation.timing.ease};\n transform: ${state === 'open'\n ? 'none'\n : `translate${axis}(${placement === 'top' || placement === 'left' ? '-' : ''}${translate})`};\n\n ${shadow &&\n css`\n box-shadow: ${theme.base.shadow.high};\n `}\n\n ${resizeable &&\n css`\n width: ${dimension === 'horizontal' ? 'var(--resize-drawer-width)' : '100%'};\n `}\n `;\n});\n\nStyledDrawer.defaultProps = defaultThemeProp;\n\nexport const Drawer: FunctionComponent<DrawerProps & ForwardProps> = forwardRef(function Drawer(\n props: DrawerProps,\n ref: Ref<HTMLElement>\n) {\n const {\n open = false,\n shadow = false,\n position = 'absolute',\n children,\n placement = 'right',\n transitionSpeed,\n size = '100%',\n resizeable = false,\n onAfterOpen,\n onAfterClose,\n onBeforeOpen,\n onBeforeClose,\n onOuterClick,\n nullWhenClosed = false,\n ...restProps\n } = props;\n\n const drawerRef = useConsolidatedRef(ref);\n const { ltr, rtl } = useDirection();\n\n const [state, setState] = useState<State>(open ? 'open' : 'closed');\n\n let prevState = usePrevious(state);\n if (!prevState) prevState = state;\n\n useOuterEvent(\n 'mousedown',\n [drawerRef],\n useCallback(() => {\n if (open) onOuterClick?.();\n }, [open, onOuterClick])\n );\n\n useEffect(() => {\n if (open && (state === 'closed' || state === 'closing')) {\n onBeforeOpen?.();\n reflow(drawerRef.current);\n setState('opening');\n } else if (!open && (state === 'open' || state === 'opening')) {\n onBeforeClose?.();\n setState('closing');\n } else if (open && state === 'open' && prevState !== 'open') {\n onAfterOpen?.();\n } else if (!open && state === 'closed' && prevState !== 'closed') {\n onAfterClose?.();\n }\n }, [open, state, prevState, onBeforeOpen, onBeforeClose, onAfterOpen, onAfterClose]);\n\n const onTransitionEnd = useCallback(\n (e: TransitionEvent): void => {\n if (e.target !== drawerRef.current || e.propertyName !== 'transform') return;\n setState(open ? 'open' : 'closed');\n },\n [open]\n );\n\n const dragStartXRef = useRef<number>();\n\n useEffect(() => {\n if (!resizeable || !drawerRef.current) return;\n const targetNode = getChildOfRootNode(drawerRef);\n if (!targetNode) return;\n if (!targetNode.style.getPropertyValue('--resize-drawer-width')) {\n targetNode.style.setProperty('--resize-drawer-width', size);\n }\n }, [drawerRef.current]);\n\n const handleResize = useCallback(\n (e: ReactMouseEvent) => {\n const targetNode = getChildOfRootNode(drawerRef);\n const rect = drawerRef.current?.getBoundingClientRect();\n if (!rect || !targetNode) return;\n\n dragStartXRef.current = e.clientX;\n\n const ac = new AbortController();\n targetNode.addEventListener(\n 'mousemove',\n moveEvent => {\n if (!dragStartXRef.current || !rect.width) return;\n\n const initialX = dragStartXRef.current;\n const widthDiff =\n placement === 'right' ? initialX - moveEvent.clientX : moveEvent.clientX - initialX;\n\n const newWidth = Math.max(widthDiff + rect.width, parseInt(drawerMinWidth, 10));\n\n // Set root-level CSS variable to communicate width to AppShell\n targetNode.style.setProperty(\n '--resize-drawer-width',\n `clamp(${drawerMinWidth}, ${newWidth}px, ${resizeDrawerMaxWidth})`\n );\n },\n { passive: true, signal: ac.signal }\n );\n\n targetNode.addEventListener(\n 'mouseup',\n () => {\n ac.abort();\n },\n { once: true }\n );\n },\n [placement]\n );\n\n const keyboardResize = useCallback(\n (e: ReactKeyboardEvent, grabbed: boolean) => {\n if (!grabbed) return;\n const targetNode = getChildOfRootNode(drawerRef);\n const resizeStep = document.documentElement.clientWidth * resizeDrawerKeyboardStep;\n const rect = drawerRef.current?.getBoundingClientRect();\n if (!rect || !targetNode) return;\n if (e.code !== 'ArrowLeft' && e.code !== 'ArrowRight') return;\n e.preventDefault();\n\n const resizeDirection = (e.code === 'ArrowLeft' ? 1 : -1) * (placement === 'right' ? 1 : -1);\n\n const newWidth = Math.max(\n rect.width + resizeDirection * resizeStep,\n parseInt(drawerMinWidth, 10)\n );\n targetNode.style.setProperty(\n '--resize-drawer-width',\n `clamp(${drawerMinWidth}, ${newWidth}px, ${resizeDrawerMaxWidth})`\n );\n },\n [placement]\n );\n\n const renderResizeHandle =\n resizeable &&\n state === 'open' &&\n ((placement === 'left' && rtl) || (placement === 'right' && ltr));\n\n return state === 'closed' && !open && nullWhenClosed ? null : (\n <StyledDrawer\n ref={drawerRef}\n position={position}\n shadow={shadow && open}\n transitionSpeed={transitionSpeed}\n placement={placement}\n size={size}\n resizeable={resizeable}\n open={open}\n state={state}\n onTransitionEnd={onTransitionEnd}\n {...restProps}\n >\n {children}\n {renderResizeHandle && <ResizeHandle onMouseDown={handleResize} onKeyDown={keyboardResize} />}\n </StyledDrawer>\n );\n});\n\nexport default Drawer;\n"]}
@@ -0,0 +1,9 @@
1
+ import type { MouseEvent as ReactMouseEvent, KeyboardEvent as ReactKeyboardEvent } from 'react';
2
+ export interface ResizeHandleProps {
3
+ onKeyDown: (e: ReactKeyboardEvent, grabbed: boolean) => void;
4
+ onMouseDown: (e: ReactMouseEvent) => void;
5
+ }
6
+ export declare const StyledResizeHandle: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
7
+ declare const ResizeHandle: import("react").ForwardRefExoticComponent<ResizeHandleProps & import("react").RefAttributes<HTMLDivElement>>;
8
+ export default ResizeHandle;
9
+ //# sourceMappingURL=ResizeHandle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResizeHandle.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/ResizeHandle.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAGV,UAAU,IAAI,eAAe,EAC7B,aAAa,IAAI,kBAAkB,EACpC,MAAM,OAAO,CAAC;AAef,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,CAAC,CAAC,EAAE,kBAAkB,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7D,WAAW,EAAE,CAAC,CAAC,EAAE,eAAe,KAAK,IAAI,CAAC;CAC3C;AAyBD,eAAO,MAAM,kBAAkB,yGA8B7B,CAAC;AAIH,QAAA,MAAM,YAAY,8GAqEhB,CAAC;AAEH,eAAe,YAAY,CAAC"}
@@ -0,0 +1,109 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef, useState } from 'react';
3
+ import styled, { css } from 'styled-components';
4
+ import { hideVisually } from 'polished';
5
+ import Button, { StyledButton } from '../Button';
6
+ import Icon, { registerIcon, StyledIcon } from '../Icon';
7
+ import { useConsolidatedRef, useEscape, useI18n } from '../../hooks';
8
+ import { getChildOfRootNode } from '../../utils';
9
+ import { defaultThemeProp } from '../../theme';
10
+ import * as DragIcon from '../Icon/icons/drag.icon';
11
+ import * as ArrowUpDownIcon from '../Icon/icons/arrow-micro-up-down.icon';
12
+ registerIcon(DragIcon);
13
+ registerIcon(ArrowUpDownIcon);
14
+ const StyledResizeButton = styled(Button)(({ rotateIcon }) => {
15
+ return css `
16
+ cursor: grab;
17
+
18
+ &:active {
19
+ cursor: grabbing;
20
+ }
21
+
22
+ &:not(:focus) {
23
+ ${hideVisually};
24
+ }
25
+
26
+ ${rotateIcon &&
27
+ css `
28
+ ${StyledIcon} {
29
+ transform: rotate(90deg);
30
+ }
31
+ `}
32
+ `;
33
+ });
34
+ export const StyledResizeHandle = styled.div(({ theme }) => {
35
+ return css `
36
+ position: absolute;
37
+ inset-inline-start: 0;
38
+ inset-block: 0;
39
+ inline-size: 0.125rem;
40
+ background-color: transparent;
41
+ transition: background-color ${theme.base.animation.speed} ${theme.base.animation.timing.ease};
42
+ cursor: ew-resize;
43
+ z-index: ${theme.base['z-index'].max};
44
+
45
+ ::before {
46
+ content: '';
47
+ position: absolute;
48
+ inset: 0;
49
+ width: calc(${theme.base['hit-area'].compact} * 0.75);
50
+ }
51
+
52
+ &:hover {
53
+ background-color: ${theme.base.palette.interactive};
54
+ }
55
+
56
+ ${StyledButton} {
57
+ position: absolute;
58
+ inset-block-start: 50%;
59
+ inset-inline-start: calc(-2 * ${theme.base.spacing});
60
+ translate: 0 -50%;
61
+ box-shadow: ${theme.base.shadow.focus};
62
+ }
63
+ `;
64
+ });
65
+ StyledResizeHandle.defaultProps = defaultThemeProp;
66
+ const ResizeHandle = forwardRef(function ResizeHandle({ onMouseDown, onKeyDown }, ref) {
67
+ const resizeHandleRef = useConsolidatedRef(ref);
68
+ const t = useI18n();
69
+ const [mouseGrabbed, setMouseGrabbed] = useState(false);
70
+ const [keyboardGrabbed, setKeyboardGrabbed] = useState(false);
71
+ useEscape(() => {
72
+ setMouseGrabbed(false);
73
+ setKeyboardGrabbed(false);
74
+ });
75
+ const handleKeyDown = (e) => {
76
+ if (e.code === 'Space') {
77
+ e.preventDefault();
78
+ if (keyboardGrabbed) {
79
+ setKeyboardGrabbed(false);
80
+ }
81
+ else {
82
+ setKeyboardGrabbed(true);
83
+ }
84
+ }
85
+ onKeyDown?.(e, keyboardGrabbed);
86
+ };
87
+ const handleMouseDown = (e) => {
88
+ const targetNode = getChildOfRootNode(resizeHandleRef);
89
+ if (!targetNode)
90
+ return;
91
+ targetNode.style.setProperty('user-select', 'none');
92
+ setMouseGrabbed(true);
93
+ onMouseDown?.(e);
94
+ };
95
+ const handleMouseUp = () => {
96
+ const targetNode = getChildOfRootNode(resizeHandleRef);
97
+ if (!targetNode)
98
+ return;
99
+ targetNode.style.removeProperty('user-select');
100
+ setMouseGrabbed(false);
101
+ };
102
+ return (_jsx(StyledResizeHandle, { onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, ref: resizeHandleRef, children: _jsx(StyledResizeButton, { tabIndex: 0, icon: true, label: !mouseGrabbed && !keyboardGrabbed ? t('resize') : undefined, "aria-label": !mouseGrabbed && !keyboardGrabbed
103
+ ? t('drag_handle_activate_description')
104
+ : t('drag_handle_cancel_description'), onMouseDown: handleMouseDown, onKeyDown: handleKeyDown, onBlur: () => {
105
+ setKeyboardGrabbed(false);
106
+ }, rotateIcon: keyboardGrabbed, children: _jsx(Icon, { name: keyboardGrabbed ? 'arrow-micro-up-down' : 'drag' }) }) }));
107
+ });
108
+ export default ResizeHandle;
109
+ //# sourceMappingURL=ResizeHandle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResizeHandle.js","sourceRoot":"","sources":["../../../src/components/Drawer/ResizeHandle.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAO7C,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,MAAM,EAAE,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,eAAe,MAAM,wCAAwC,CAAC;AAE1E,YAAY,CAAC,QAAQ,CAAC,CAAC;AACvB,YAAY,CAAC,eAAe,CAAC,CAAC;AAO9B,MAAM,kBAAkB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,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,gBAEhE,CAAC,YAAY,IAAI,CAAC,eAAe;gBAC/B,CAAC,CAAC,CAAC,CAAC,kCAAkC,CAAC;gBACvC,CAAC,CAAC,CAAC,CAAC,gCAAgC,CAAC,EAEzC,WAAW,EAAE,eAAe,EAC5B,SAAS,EAAE,aAAa,EACxB,MAAM,EAAE,GAAG,EAAE;gBACX,kBAAkB,CAAC,KAAK,CAAC,CAAC;YAC5B,CAAC,EACD,UAAU,EAAE,eAAe,YAE3B,KAAC,IAAI,IAAC,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,MAAM,GAAI,GAC7C,GACF,CACtB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,YAAY,CAAC","sourcesContent":["import { forwardRef, useState } from 'react';\nimport type {\n PropsWithoutRef,\n Ref,\n MouseEvent as ReactMouseEvent,\n KeyboardEvent as ReactKeyboardEvent\n} from 'react';\nimport styled, { css } from 'styled-components';\nimport { hideVisually } from 'polished';\n\nimport Button, { StyledButton } from '../Button';\nimport Icon, { registerIcon, StyledIcon } from '../Icon';\nimport { useConsolidatedRef, useEscape, useI18n } from '../../hooks';\nimport { getChildOfRootNode } from '../../utils';\nimport { defaultThemeProp } from '../../theme';\nimport * as DragIcon from '../Icon/icons/drag.icon';\nimport * as ArrowUpDownIcon from '../Icon/icons/arrow-micro-up-down.icon';\n\nregisterIcon(DragIcon);\nregisterIcon(ArrowUpDownIcon);\n\nexport interface ResizeHandleProps {\n onKeyDown: (e: ReactKeyboardEvent, grabbed: boolean) => void;\n onMouseDown: (e: ReactMouseEvent) => void;\n}\n\nconst StyledResizeButton = styled(Button)<{\n rotateIcon?: boolean;\n}>(({ rotateIcon }) => {\n return css`\n cursor: grab;\n\n &:active {\n cursor: grabbing;\n }\n\n &:not(:focus) {\n ${hideVisually};\n }\n\n ${rotateIcon &&\n css`\n ${StyledIcon} {\n transform: rotate(90deg);\n }\n `}\n `;\n});\n\nexport const StyledResizeHandle = styled.div(({ theme }) => {\n return css`\n position: absolute;\n inset-inline-start: 0;\n inset-block: 0;\n inline-size: 0.125rem;\n background-color: transparent;\n transition: background-color ${theme.base.animation.speed} ${theme.base.animation.timing.ease};\n cursor: ew-resize;\n z-index: ${theme.base['z-index'].max};\n\n ::before {\n content: '';\n position: absolute;\n inset: 0;\n width: calc(${theme.base['hit-area'].compact} * 0.75);\n }\n\n &:hover {\n background-color: ${theme.base.palette.interactive};\n }\n\n ${StyledButton} {\n position: absolute;\n inset-block-start: 50%;\n inset-inline-start: calc(-2 * ${theme.base.spacing});\n translate: 0 -50%;\n box-shadow: ${theme.base.shadow.focus};\n }\n `;\n});\n\nStyledResizeHandle.defaultProps = defaultThemeProp;\n\nconst ResizeHandle = forwardRef(function ResizeHandle(\n { onMouseDown, onKeyDown }: PropsWithoutRef<ResizeHandleProps>,\n ref: Ref<HTMLDivElement>\n) {\n const resizeHandleRef = useConsolidatedRef<HTMLDivElement>(ref);\n const t = useI18n();\n\n const [mouseGrabbed, setMouseGrabbed] = useState(false);\n const [keyboardGrabbed, setKeyboardGrabbed] = useState(false);\n\n useEscape(() => {\n setMouseGrabbed(false);\n setKeyboardGrabbed(false);\n });\n\n const handleKeyDown = (e: ReactKeyboardEvent) => {\n if (e.code === 'Space') {\n e.preventDefault();\n if (keyboardGrabbed) {\n setKeyboardGrabbed(false);\n } else {\n setKeyboardGrabbed(true);\n }\n }\n\n onKeyDown?.(e, keyboardGrabbed);\n };\n\n const handleMouseDown = (e: ReactMouseEvent) => {\n const targetNode = getChildOfRootNode(resizeHandleRef);\n if (!targetNode) return;\n targetNode.style.setProperty('user-select', 'none');\n setMouseGrabbed(true);\n onMouseDown?.(e);\n };\n\n const handleMouseUp = () => {\n const targetNode = getChildOfRootNode(resizeHandleRef);\n if (!targetNode) return;\n targetNode.style.removeProperty('user-select');\n setMouseGrabbed(false);\n };\n\n return (\n <StyledResizeHandle\n onMouseDown={handleMouseDown}\n onMouseUp={handleMouseUp}\n ref={resizeHandleRef}\n >\n <StyledResizeButton\n tabIndex={0}\n icon\n label={!mouseGrabbed && !keyboardGrabbed ? t('resize') : undefined}\n aria-label={\n !mouseGrabbed && !keyboardGrabbed\n ? t('drag_handle_activate_description')\n : t('drag_handle_cancel_description')\n }\n onMouseDown={handleMouseDown}\n onKeyDown={handleKeyDown}\n onBlur={() => {\n setKeyboardGrabbed(false);\n }}\n rotateIcon={keyboardGrabbed}\n >\n <Icon name={keyboardGrabbed ? 'arrow-micro-up-down' : 'drag'} />\n </StyledResizeButton>\n </StyledResizeHandle>\n );\n});\n\nexport default ResizeHandle;\n"]}
@@ -1,3 +1,5 @@
1
1
  export { default, StyledDrawer } from './Drawer';
2
+ export { default as ResizeHandle } from './ResizeHandle';
2
3
  export type { DrawerProps } from './Drawer';
4
+ export type { ResizeHandleProps } from './ResizeHandle';
3
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACjD,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export { default, StyledDrawer } from './Drawer';
2
+ export { default as ResizeHandle } from './ResizeHandle';
2
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Drawer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export { default, StyledDrawer } from './Drawer';\nexport type { DrawerProps } from './Drawer';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Drawer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC","sourcesContent":["export { default, StyledDrawer } from './Drawer';\nexport { default as ResizeHandle } from './ResizeHandle';\nexport type { DrawerProps } from './Drawer';\nexport type { ResizeHandleProps } from './ResizeHandle';\n"]}
@@ -14,6 +14,8 @@ export type FieldGroupProps = BaseProps & {
14
14
  } & ({
15
15
  /** The name associated with the Field Group. */
16
16
  name: string;
17
+ /** Provides a contextual label for the name. */
18
+ contextualLabel?: string;
17
19
  /** Select the heading tag for header */
18
20
  headingTag?: HeadingTag;
19
21
  /** Provides additional info relevant to the field group. */
@@ -35,6 +37,7 @@ export type FieldGroupProps = BaseProps & {
35
37
  onToggleCollapsed?: () => void;
36
38
  } | {
37
39
  name?: undefined;
40
+ contextualLabel?: never;
38
41
  headingTag?: never;
39
42
  additionalInfo?: never;
40
43
  actions?: never;
@@ -42,6 +45,8 @@ export type FieldGroupProps = BaseProps & {
42
45
  onToggleCollapsed?: never;
43
46
  });
44
47
  export declare const StyledFieldGroupName: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
48
+ export declare const StyledFieldHeader: import("styled-components").StyledComponent<ForwardRefForwardPropsComponent<import("../Flex").FlexProps>, import("styled-components").DefaultTheme, {}, never>;
49
+ export declare const StyledFieldGroupContent: import("styled-components").StyledComponent<ForwardRefForwardPropsComponent<import("../Grid").GridProps>, import("styled-components").DefaultTheme, {}, never>;
45
50
  export declare const StyledFieldGroupLegend: import("styled-components").StyledComponent<"legend", import("styled-components").DefaultTheme, Pick<FieldGroupProps, "collapsed">, never>;
46
51
  export declare const StyledFieldGroup: import("styled-components").StyledComponent<"fieldset", import("styled-components").DefaultTheme, {}, never>;
47
52
  export declare const StyledGroupContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {