no-frills-ui 0.0.14-alpha.5 → 0.0.14-alpha.7

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 (323) hide show
  1. package/dist/index.js +2365 -3152
  2. package/dist/index.js.map +1 -1
  3. package/lib-esm/components/Accordion/Accordion.d.ts +0 -1
  4. package/lib-esm/components/Accordion/Accordion.js +26 -26
  5. package/lib-esm/components/Accordion/AccordionStep.d.ts +0 -1
  6. package/lib-esm/components/Accordion/AccordionStep.js +98 -96
  7. package/lib-esm/components/Accordion/index.d.ts +0 -1
  8. package/lib-esm/components/Badge/Badge.d.ts +0 -1
  9. package/lib-esm/components/Badge/Badge.js +32 -38
  10. package/lib-esm/components/Badge/index.d.ts +0 -1
  11. package/lib-esm/components/Button/ActionButton.d.ts +0 -1
  12. package/lib-esm/components/Button/ActionButton.js +6 -39
  13. package/lib-esm/components/Button/Button.d.ts +0 -1
  14. package/lib-esm/components/Button/Button.js +8 -44
  15. package/lib-esm/components/Button/IconButton.d.ts +0 -1
  16. package/lib-esm/components/Button/IconButton.js +6 -43
  17. package/lib-esm/components/Button/LinkButton.d.ts +0 -1
  18. package/lib-esm/components/Button/LinkButton.js +6 -34
  19. package/lib-esm/components/Button/RaisedButton.d.ts +0 -1
  20. package/lib-esm/components/Button/RaisedButton.js +6 -47
  21. package/lib-esm/components/Button/index.d.ts +0 -1
  22. package/lib-esm/components/Card/Card.d.ts +0 -1
  23. package/lib-esm/components/Card/Card.js +8 -13
  24. package/lib-esm/components/Card/index.d.ts +0 -1
  25. package/lib-esm/components/Chip/Chip.d.ts +0 -1
  26. package/lib-esm/components/Chip/Chip.js +35 -43
  27. package/lib-esm/components/Chip/index.d.ts +0 -1
  28. package/lib-esm/components/ChipInput/ChipInput.d.ts +0 -1
  29. package/lib-esm/components/ChipInput/ChipInput.js +102 -162
  30. package/lib-esm/components/ChipInput/index.d.ts +0 -1
  31. package/lib-esm/components/Dialog/AlertDialog.d.ts +0 -1
  32. package/lib-esm/components/Dialog/AlertDialog.js +45 -26
  33. package/lib-esm/components/Dialog/ConfirmDialog.d.ts +0 -1
  34. package/lib-esm/components/Dialog/ConfirmDialog.js +49 -31
  35. package/lib-esm/components/Dialog/Dialog.d.ts +1 -1
  36. package/lib-esm/components/Dialog/Dialog.js +76 -106
  37. package/lib-esm/components/Dialog/PromptDialog.d.ts +0 -1
  38. package/lib-esm/components/Dialog/PromptDialog.js +82 -44
  39. package/lib-esm/components/Dialog/index.d.ts +0 -1
  40. package/lib-esm/components/DragAndDrop/DragAndDrop.d.ts +0 -1
  41. package/lib-esm/components/DragAndDrop/DragAndDrop.js +66 -71
  42. package/lib-esm/components/DragAndDrop/DragItem.d.ts +0 -1
  43. package/lib-esm/components/DragAndDrop/DragItem.js +106 -118
  44. package/lib-esm/components/DragAndDrop/index.d.ts +0 -1
  45. package/lib-esm/components/DragAndDrop/types.d.ts +0 -1
  46. package/lib-esm/components/DragAndDrop/types.js +7 -5
  47. package/lib-esm/components/Drawer/Drawer.d.ts +0 -1
  48. package/lib-esm/components/Drawer/Drawer.js +143 -197
  49. package/lib-esm/components/Drawer/index.d.ts +0 -1
  50. package/lib-esm/components/Groups/Group.d.ts +0 -1
  51. package/lib-esm/components/Groups/Group.js +28 -86
  52. package/lib-esm/components/Groups/GroupLabel.d.ts +0 -1
  53. package/lib-esm/components/Groups/GroupLabel.js +7 -17
  54. package/lib-esm/components/Groups/index.d.ts +0 -1
  55. package/lib-esm/components/Input/Checkbox.d.ts +0 -1
  56. package/lib-esm/components/Input/Checkbox.js +39 -115
  57. package/lib-esm/components/Input/Dropdown.d.ts +0 -1
  58. package/lib-esm/components/Input/Dropdown.js +74 -37
  59. package/lib-esm/components/Input/Input.d.ts +0 -1
  60. package/lib-esm/components/Input/Input.js +52 -110
  61. package/lib-esm/components/Input/Radio.d.ts +0 -1
  62. package/lib-esm/components/Input/Radio.js +31 -92
  63. package/lib-esm/components/Input/RadioButton.d.ts +0 -1
  64. package/lib-esm/components/Input/RadioButton.js +30 -67
  65. package/lib-esm/components/Input/Select.d.ts +0 -1
  66. package/lib-esm/components/Input/Select.js +65 -123
  67. package/lib-esm/components/Input/TextArea.d.ts +0 -1
  68. package/lib-esm/components/Input/TextArea.js +51 -108
  69. package/lib-esm/components/Input/Toggle.d.ts +0 -1
  70. package/lib-esm/components/Input/Toggle.js +29 -80
  71. package/lib-esm/components/Input/index.d.ts +0 -1
  72. package/lib-esm/components/Menu/Menu.d.ts +0 -1
  73. package/lib-esm/components/Menu/Menu.js +47 -62
  74. package/lib-esm/components/Menu/MenuContext.d.ts +0 -1
  75. package/lib-esm/components/Menu/MenuContext.js +4 -2
  76. package/lib-esm/components/Menu/MenuItem.d.ts +0 -1
  77. package/lib-esm/components/Menu/MenuItem.js +34 -49
  78. package/lib-esm/components/Menu/index.d.ts +0 -1
  79. package/lib-esm/components/Modal/Modal.d.ts +0 -1
  80. package/lib-esm/components/Modal/Modal.js +117 -154
  81. package/lib-esm/components/Modal/index.d.ts +0 -1
  82. package/lib-esm/components/Notification/Notification.d.ts +0 -1
  83. package/lib-esm/components/Notification/Notification.js +54 -66
  84. package/lib-esm/components/Notification/NotificationManager.d.ts +4 -1
  85. package/lib-esm/components/Notification/NotificationManager.js +157 -100
  86. package/lib-esm/components/Notification/index.d.ts +0 -1
  87. package/lib-esm/components/Notification/style.d.ts +0 -1
  88. package/lib-esm/components/Notification/style.js +51 -145
  89. package/lib-esm/components/Notification/types.d.ts +0 -1
  90. package/lib-esm/components/Notification/types.js +8 -9
  91. package/lib-esm/components/Popover/Popover.d.ts +0 -1
  92. package/lib-esm/components/Popover/Popover.js +135 -115
  93. package/lib-esm/components/Popover/index.d.ts +0 -1
  94. package/lib-esm/components/Spinner/Spinner.d.ts +0 -1
  95. package/lib-esm/components/Spinner/Spinner.js +19 -39
  96. package/lib-esm/components/Spinner/index.d.ts +0 -1
  97. package/lib-esm/components/Stepper/Step.d.ts +0 -1
  98. package/lib-esm/components/Stepper/Step.js +15 -22
  99. package/lib-esm/components/Stepper/Stepper.d.ts +0 -1
  100. package/lib-esm/components/Stepper/Stepper.js +98 -119
  101. package/lib-esm/components/Stepper/index.d.ts +0 -1
  102. package/lib-esm/components/Tabs/Tab.d.ts +0 -1
  103. package/lib-esm/components/Tabs/Tab.js +11 -10
  104. package/lib-esm/components/Tabs/Tabs.d.ts +0 -1
  105. package/lib-esm/components/Tabs/Tabs.js +80 -75
  106. package/lib-esm/components/Tabs/index.d.ts +0 -1
  107. package/lib-esm/components/Toast/Toast.d.ts +5 -1
  108. package/lib-esm/components/Toast/Toast.js +127 -135
  109. package/lib-esm/components/Toast/ToastStory.d.ts +0 -1
  110. package/lib-esm/components/Toast/index.d.ts +0 -1
  111. package/lib-esm/components/Tooltip/Tooltip.d.ts +0 -1
  112. package/lib-esm/components/Tooltip/Tooltip.js +57 -69
  113. package/lib-esm/components/Tooltip/index.d.ts +0 -1
  114. package/lib-esm/components/index.d.ts +0 -1
  115. package/lib-esm/components/index.js +42 -21
  116. package/lib-esm/icons/CheckCircle.d.ts +0 -1
  117. package/lib-esm/icons/CheckCircle.js +21 -4
  118. package/lib-esm/icons/Close.d.ts +0 -1
  119. package/lib-esm/icons/Close.js +21 -4
  120. package/lib-esm/icons/DragIndicator.d.ts +0 -1
  121. package/lib-esm/icons/DragIndicator.js +21 -4
  122. package/lib-esm/icons/ErrorOutline.d.ts +0 -1
  123. package/lib-esm/icons/ErrorOutline.js +15 -4
  124. package/lib-esm/icons/ExpandMore.d.ts +0 -1
  125. package/lib-esm/icons/ExpandMore.js +21 -4
  126. package/lib-esm/icons/FiberManualRecord.d.ts +0 -1
  127. package/lib-esm/icons/FiberManualRecord.js +23 -4
  128. package/lib-esm/icons/Info.d.ts +0 -1
  129. package/lib-esm/icons/Info.js +21 -4
  130. package/lib-esm/icons/ReportProblem.d.ts +0 -1
  131. package/lib-esm/icons/ReportProblem.js +21 -4
  132. package/lib-esm/icons/index.d.ts +0 -1
  133. package/lib-esm/index.d.ts +0 -1
  134. package/lib-esm/shared/LayerManager.d.ts +3 -1
  135. package/lib-esm/shared/LayerManager.js +105 -96
  136. package/lib-esm/shared/constants.d.ts +0 -1
  137. package/lib-esm/shared/constants.js +33 -61
  138. package/lib-esm/shared/styles.d.ts +0 -1
  139. package/lib-esm/shared/styles.js +20 -26
  140. package/package.json +15 -5
  141. package/lib-esm/components/Accordion/Accordion.d.ts.map +0 -1
  142. package/lib-esm/components/Accordion/Accordion.js.map +0 -1
  143. package/lib-esm/components/Accordion/AccordionStep.d.ts.map +0 -1
  144. package/lib-esm/components/Accordion/AccordionStep.js.map +0 -1
  145. package/lib-esm/components/Accordion/index.d.ts.map +0 -1
  146. package/lib-esm/components/Accordion/index.js +0 -3
  147. package/lib-esm/components/Accordion/index.js.map +0 -1
  148. package/lib-esm/components/Badge/Badge.d.ts.map +0 -1
  149. package/lib-esm/components/Badge/Badge.js.map +0 -1
  150. package/lib-esm/components/Badge/index.d.ts.map +0 -1
  151. package/lib-esm/components/Badge/index.js +0 -2
  152. package/lib-esm/components/Badge/index.js.map +0 -1
  153. package/lib-esm/components/Button/ActionButton.d.ts.map +0 -1
  154. package/lib-esm/components/Button/ActionButton.js.map +0 -1
  155. package/lib-esm/components/Button/Button.d.ts.map +0 -1
  156. package/lib-esm/components/Button/Button.js.map +0 -1
  157. package/lib-esm/components/Button/IconButton.d.ts.map +0 -1
  158. package/lib-esm/components/Button/IconButton.js.map +0 -1
  159. package/lib-esm/components/Button/LinkButton.d.ts.map +0 -1
  160. package/lib-esm/components/Button/LinkButton.js.map +0 -1
  161. package/lib-esm/components/Button/RaisedButton.d.ts.map +0 -1
  162. package/lib-esm/components/Button/RaisedButton.js.map +0 -1
  163. package/lib-esm/components/Button/index.d.ts.map +0 -1
  164. package/lib-esm/components/Button/index.js +0 -6
  165. package/lib-esm/components/Button/index.js.map +0 -1
  166. package/lib-esm/components/Card/Card.d.ts.map +0 -1
  167. package/lib-esm/components/Card/Card.js.map +0 -1
  168. package/lib-esm/components/Card/index.d.ts.map +0 -1
  169. package/lib-esm/components/Card/index.js +0 -3
  170. package/lib-esm/components/Card/index.js.map +0 -1
  171. package/lib-esm/components/Chip/Chip.d.ts.map +0 -1
  172. package/lib-esm/components/Chip/Chip.js.map +0 -1
  173. package/lib-esm/components/Chip/index.d.ts.map +0 -1
  174. package/lib-esm/components/Chip/index.js +0 -2
  175. package/lib-esm/components/Chip/index.js.map +0 -1
  176. package/lib-esm/components/ChipInput/ChipInput.d.ts.map +0 -1
  177. package/lib-esm/components/ChipInput/ChipInput.js.map +0 -1
  178. package/lib-esm/components/ChipInput/index.d.ts.map +0 -1
  179. package/lib-esm/components/ChipInput/index.js +0 -2
  180. package/lib-esm/components/ChipInput/index.js.map +0 -1
  181. package/lib-esm/components/Dialog/AlertDialog.d.ts.map +0 -1
  182. package/lib-esm/components/Dialog/AlertDialog.js.map +0 -1
  183. package/lib-esm/components/Dialog/ConfirmDialog.d.ts.map +0 -1
  184. package/lib-esm/components/Dialog/ConfirmDialog.js.map +0 -1
  185. package/lib-esm/components/Dialog/Dialog.d.ts.map +0 -1
  186. package/lib-esm/components/Dialog/Dialog.js.map +0 -1
  187. package/lib-esm/components/Dialog/PromptDialog.d.ts.map +0 -1
  188. package/lib-esm/components/Dialog/PromptDialog.js.map +0 -1
  189. package/lib-esm/components/Dialog/index.d.ts.map +0 -1
  190. package/lib-esm/components/Dialog/index.js +0 -5
  191. package/lib-esm/components/Dialog/index.js.map +0 -1
  192. package/lib-esm/components/DragAndDrop/DragAndDrop.d.ts.map +0 -1
  193. package/lib-esm/components/DragAndDrop/DragAndDrop.js.map +0 -1
  194. package/lib-esm/components/DragAndDrop/DragItem.d.ts.map +0 -1
  195. package/lib-esm/components/DragAndDrop/DragItem.js.map +0 -1
  196. package/lib-esm/components/DragAndDrop/index.d.ts.map +0 -1
  197. package/lib-esm/components/DragAndDrop/index.js +0 -3
  198. package/lib-esm/components/DragAndDrop/index.js.map +0 -1
  199. package/lib-esm/components/DragAndDrop/types.d.ts.map +0 -1
  200. package/lib-esm/components/DragAndDrop/types.js.map +0 -1
  201. package/lib-esm/components/Drawer/Drawer.d.ts.map +0 -1
  202. package/lib-esm/components/Drawer/Drawer.js.map +0 -1
  203. package/lib-esm/components/Drawer/index.d.ts.map +0 -1
  204. package/lib-esm/components/Drawer/index.js +0 -2
  205. package/lib-esm/components/Drawer/index.js.map +0 -1
  206. package/lib-esm/components/Groups/Group.d.ts.map +0 -1
  207. package/lib-esm/components/Groups/Group.js.map +0 -1
  208. package/lib-esm/components/Groups/GroupLabel.d.ts.map +0 -1
  209. package/lib-esm/components/Groups/GroupLabel.js.map +0 -1
  210. package/lib-esm/components/Groups/index.d.ts.map +0 -1
  211. package/lib-esm/components/Groups/index.js +0 -3
  212. package/lib-esm/components/Groups/index.js.map +0 -1
  213. package/lib-esm/components/Input/Checkbox.d.ts.map +0 -1
  214. package/lib-esm/components/Input/Checkbox.js.map +0 -1
  215. package/lib-esm/components/Input/Dropdown.d.ts.map +0 -1
  216. package/lib-esm/components/Input/Dropdown.js.map +0 -1
  217. package/lib-esm/components/Input/Input.d.ts.map +0 -1
  218. package/lib-esm/components/Input/Input.js.map +0 -1
  219. package/lib-esm/components/Input/Radio.d.ts.map +0 -1
  220. package/lib-esm/components/Input/Radio.js.map +0 -1
  221. package/lib-esm/components/Input/RadioButton.d.ts.map +0 -1
  222. package/lib-esm/components/Input/RadioButton.js.map +0 -1
  223. package/lib-esm/components/Input/Select.d.ts.map +0 -1
  224. package/lib-esm/components/Input/Select.js.map +0 -1
  225. package/lib-esm/components/Input/TextArea.d.ts.map +0 -1
  226. package/lib-esm/components/Input/TextArea.js.map +0 -1
  227. package/lib-esm/components/Input/Toggle.d.ts.map +0 -1
  228. package/lib-esm/components/Input/Toggle.js.map +0 -1
  229. package/lib-esm/components/Input/index.d.ts.map +0 -1
  230. package/lib-esm/components/Input/index.js +0 -9
  231. package/lib-esm/components/Input/index.js.map +0 -1
  232. package/lib-esm/components/Menu/Menu.d.ts.map +0 -1
  233. package/lib-esm/components/Menu/Menu.js.map +0 -1
  234. package/lib-esm/components/Menu/MenuContext.d.ts.map +0 -1
  235. package/lib-esm/components/Menu/MenuContext.js.map +0 -1
  236. package/lib-esm/components/Menu/MenuItem.d.ts.map +0 -1
  237. package/lib-esm/components/Menu/MenuItem.js.map +0 -1
  238. package/lib-esm/components/Menu/index.d.ts.map +0 -1
  239. package/lib-esm/components/Menu/index.js +0 -3
  240. package/lib-esm/components/Menu/index.js.map +0 -1
  241. package/lib-esm/components/Modal/Modal.d.ts.map +0 -1
  242. package/lib-esm/components/Modal/Modal.js.map +0 -1
  243. package/lib-esm/components/Modal/index.d.ts.map +0 -1
  244. package/lib-esm/components/Modal/index.js +0 -2
  245. package/lib-esm/components/Modal/index.js.map +0 -1
  246. package/lib-esm/components/Notification/Notification.d.ts.map +0 -1
  247. package/lib-esm/components/Notification/Notification.js.map +0 -1
  248. package/lib-esm/components/Notification/NotificationManager.d.ts.map +0 -1
  249. package/lib-esm/components/Notification/NotificationManager.js.map +0 -1
  250. package/lib-esm/components/Notification/index.d.ts.map +0 -1
  251. package/lib-esm/components/Notification/index.js +0 -3
  252. package/lib-esm/components/Notification/index.js.map +0 -1
  253. package/lib-esm/components/Notification/style.d.ts.map +0 -1
  254. package/lib-esm/components/Notification/style.js.map +0 -1
  255. package/lib-esm/components/Notification/types.d.ts.map +0 -1
  256. package/lib-esm/components/Notification/types.js.map +0 -1
  257. package/lib-esm/components/Popover/Popover.d.ts.map +0 -1
  258. package/lib-esm/components/Popover/Popover.js.map +0 -1
  259. package/lib-esm/components/Popover/index.d.ts.map +0 -1
  260. package/lib-esm/components/Popover/index.js +0 -2
  261. package/lib-esm/components/Popover/index.js.map +0 -1
  262. package/lib-esm/components/Spinner/Spinner.d.ts.map +0 -1
  263. package/lib-esm/components/Spinner/Spinner.js.map +0 -1
  264. package/lib-esm/components/Spinner/index.d.ts.map +0 -1
  265. package/lib-esm/components/Spinner/index.js +0 -2
  266. package/lib-esm/components/Spinner/index.js.map +0 -1
  267. package/lib-esm/components/Stepper/Step.d.ts.map +0 -1
  268. package/lib-esm/components/Stepper/Step.js.map +0 -1
  269. package/lib-esm/components/Stepper/Stepper.d.ts.map +0 -1
  270. package/lib-esm/components/Stepper/Stepper.js.map +0 -1
  271. package/lib-esm/components/Stepper/index.d.ts.map +0 -1
  272. package/lib-esm/components/Stepper/index.js +0 -4
  273. package/lib-esm/components/Stepper/index.js.map +0 -1
  274. package/lib-esm/components/Tabs/Tab.d.ts.map +0 -1
  275. package/lib-esm/components/Tabs/Tab.js.map +0 -1
  276. package/lib-esm/components/Tabs/Tabs.d.ts.map +0 -1
  277. package/lib-esm/components/Tabs/Tabs.js.map +0 -1
  278. package/lib-esm/components/Tabs/index.d.ts.map +0 -1
  279. package/lib-esm/components/Tabs/index.js +0 -3
  280. package/lib-esm/components/Tabs/index.js.map +0 -1
  281. package/lib-esm/components/Toast/Toast.d.ts.map +0 -1
  282. package/lib-esm/components/Toast/Toast.js.map +0 -1
  283. package/lib-esm/components/Toast/ToastStory.d.ts.map +0 -1
  284. package/lib-esm/components/Toast/ToastStory.js +0 -35
  285. package/lib-esm/components/Toast/ToastStory.js.map +0 -1
  286. package/lib-esm/components/Toast/index.d.ts.map +0 -1
  287. package/lib-esm/components/Toast/index.js +0 -2
  288. package/lib-esm/components/Toast/index.js.map +0 -1
  289. package/lib-esm/components/Tooltip/Tooltip.d.ts.map +0 -1
  290. package/lib-esm/components/Tooltip/Tooltip.js.map +0 -1
  291. package/lib-esm/components/Tooltip/index.d.ts.map +0 -1
  292. package/lib-esm/components/Tooltip/index.js +0 -2
  293. package/lib-esm/components/Tooltip/index.js.map +0 -1
  294. package/lib-esm/components/index.d.ts.map +0 -1
  295. package/lib-esm/components/index.js.map +0 -1
  296. package/lib-esm/icons/CheckCircle.d.ts.map +0 -1
  297. package/lib-esm/icons/CheckCircle.js.map +0 -1
  298. package/lib-esm/icons/Close.d.ts.map +0 -1
  299. package/lib-esm/icons/Close.js.map +0 -1
  300. package/lib-esm/icons/DragIndicator.d.ts.map +0 -1
  301. package/lib-esm/icons/DragIndicator.js.map +0 -1
  302. package/lib-esm/icons/ErrorOutline.d.ts.map +0 -1
  303. package/lib-esm/icons/ErrorOutline.js.map +0 -1
  304. package/lib-esm/icons/ExpandMore.d.ts.map +0 -1
  305. package/lib-esm/icons/ExpandMore.js.map +0 -1
  306. package/lib-esm/icons/FiberManualRecord.d.ts.map +0 -1
  307. package/lib-esm/icons/FiberManualRecord.js.map +0 -1
  308. package/lib-esm/icons/Info.d.ts.map +0 -1
  309. package/lib-esm/icons/Info.js.map +0 -1
  310. package/lib-esm/icons/ReportProblem.d.ts.map +0 -1
  311. package/lib-esm/icons/ReportProblem.js.map +0 -1
  312. package/lib-esm/icons/index.d.ts.map +0 -1
  313. package/lib-esm/icons/index.js +0 -9
  314. package/lib-esm/icons/index.js.map +0 -1
  315. package/lib-esm/index.d.ts.map +0 -1
  316. package/lib-esm/index.js +0 -2
  317. package/lib-esm/index.js.map +0 -1
  318. package/lib-esm/shared/LayerManager.d.ts.map +0 -1
  319. package/lib-esm/shared/LayerManager.js.map +0 -1
  320. package/lib-esm/shared/constants.d.ts.map +0 -1
  321. package/lib-esm/shared/constants.js.map +0 -1
  322. package/lib-esm/shared/styles.d.ts.map +0 -1
  323. package/lib-esm/shared/styles.js.map +0 -1
@@ -1,63 +1,135 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
1
+ import { jsxs, jsx } from '@emotion/react/jsx-runtime';
11
2
  import React from 'react';
12
- import { Close, Info, ReportProblem, ErrorOutline, CheckCircle } from '../../icons';
13
- import { ActionButton } from '../Button';
14
- import { Container, Notice, Title, IconContainer, FillParent, Body, CloseButton, Footer, VisuallyHidden, } from './style';
15
- import { NOTIFICATION_TYPE } from './types';
3
+ import { Container, VisuallyHidden, Notice, IconContainer, FillParent, Title, Body, Footer, CloseButton } from './style.js';
4
+ import { NOTIFICATION_TYPE } from './types.js';
5
+ import CheckCircle from '../../icons/Info.js';
6
+ import CheckCircle$1 from '../../icons/CheckCircle.js';
7
+ import CheckCircle$2 from '../../icons/ReportProblem.js';
8
+ import CheckCircle$3 from '../../icons/ErrorOutline.js';
9
+ import ActionButton from '../Button/ActionButton.js';
10
+ import Close from '../../icons/Close.js';
11
+
16
12
  const DEFAULT_DURATION = 5000;
17
13
  /**
18
14
  * Notification Manager class
19
- */
20
- class NotificationManager extends React.Component {
21
- constructor() {
22
- super(...arguments);
23
- this.state = {
24
- notices: [],
25
- };
26
- // bookkeeping for timeouts
15
+ */ class NotificationManager extends React.Component {
16
+ /**
17
+ * Clean up all pending timeouts when component unmounts
18
+ */ componentWillUnmount() {
19
+ // Clear all pending timeouts
20
+ Object.keys(this.timeouts).forEach((id)=>{
21
+ clearTimeout(this.timeouts[id]);
22
+ });
27
23
  this.timeouts = {};
28
- // Set of notification ids
29
- this.set = new Set();
30
- // Refs for live regions to ensure they exist before updates
31
- this.politeRegionRef = React.createRef();
32
- this.assertiveRegionRef = React.createRef();
33
- /**
34
- * Removes a notification from stack if the notification with the given id is found.
35
- *
36
- * @param id
37
- */
38
- this.remove = (id) => {
24
+ this.set.clear();
25
+ }
26
+ render() {
27
+ return /*#__PURE__*/ jsxs(Container, {
28
+ position: this.props.position,
29
+ children: [
30
+ /*#__PURE__*/ jsx(VisuallyHidden, {
31
+ ref: this.politeRegionRef,
32
+ role: "log",
33
+ "aria-live": "polite",
34
+ "aria-atomic": "false",
35
+ "aria-relevant": "additions text"
36
+ }),
37
+ /*#__PURE__*/ jsx(VisuallyHidden, {
38
+ ref: this.assertiveRegionRef,
39
+ role: "alert",
40
+ "aria-live": "assertive",
41
+ "aria-atomic": "true"
42
+ }),
43
+ /*#__PURE__*/ jsx("div", {
44
+ role: "list",
45
+ "aria-label": this.props.ariaLabel,
46
+ children: this.state.notices.map((notice)=>{
47
+ const { id, title, description, leaving, type = NOTIFICATION_TYPE.INFO, buttonText, buttonClick, closeButtonAriaLabel } = notice;
48
+ return /*#__PURE__*/ jsxs(Notice, {
49
+ ...notice,
50
+ position: this.props.position,
51
+ className: leaving ? 'leave' : '',
52
+ onMouseEnter: this.pause(id),
53
+ onMouseLeave: this.resume(id),
54
+ role: "listitem",
55
+ children: [
56
+ /*#__PURE__*/ jsxs(IconContainer, {
57
+ type: type,
58
+ "aria-hidden": "true",
59
+ children: [
60
+ type === NOTIFICATION_TYPE.INFO && /*#__PURE__*/ jsx(CheckCircle, {}),
61
+ type === NOTIFICATION_TYPE.SUCCESS && /*#__PURE__*/ jsx(CheckCircle$1, {}),
62
+ type === NOTIFICATION_TYPE.WARNING && /*#__PURE__*/ jsx(CheckCircle$2, {}),
63
+ type === NOTIFICATION_TYPE.DANGER && /*#__PURE__*/ jsx(CheckCircle$3, {})
64
+ ]
65
+ }),
66
+ /*#__PURE__*/ jsxs(FillParent, {
67
+ children: [
68
+ /*#__PURE__*/ jsx(Title, {
69
+ type: type,
70
+ children: title
71
+ }),
72
+ /*#__PURE__*/ jsx(Body, {
73
+ children: description
74
+ }),
75
+ buttonText && /*#__PURE__*/ jsx(Footer, {
76
+ children: /*#__PURE__*/ jsx(ActionButton, {
77
+ onClick: ()=>{
78
+ buttonClick?.();
79
+ },
80
+ children: buttonText
81
+ })
82
+ })
83
+ ]
84
+ }),
85
+ /*#__PURE__*/ jsx(CloseButton, {
86
+ onClick: this.closeClickHandler(id),
87
+ "aria-label": closeButtonAriaLabel || 'Close notification',
88
+ tabIndex: 0,
89
+ children: /*#__PURE__*/ jsx(Close, {})
90
+ })
91
+ ]
92
+ }, id);
93
+ })
94
+ })
95
+ ]
96
+ });
97
+ }
98
+ constructor(...args){
99
+ super(...args), this.state = {
100
+ notices: []
101
+ }, // bookkeeping for timeouts
102
+ this.timeouts = {}, // Set of notification ids
103
+ this.set = new Set(), // Refs for live regions to ensure they exist before updates
104
+ this.politeRegionRef = /*#__PURE__*/ React.createRef(), this.assertiveRegionRef = /*#__PURE__*/ React.createRef(), /**
105
+ * Removes a notification from stack if the notification with the given id is found.
106
+ *
107
+ * @param id
108
+ */ this.remove = (id)=>{
39
109
  // Trigger leaving animation.
40
110
  this.setState({
41
- notices: this.state.notices.map((notice) => (Object.assign(Object.assign({}, notice), { leaving: notice.id === id ? true : notice.leaving }))),
111
+ notices: this.state.notices.map((notice)=>({
112
+ ...notice,
113
+ leaving: notice.id === id ? true : notice.leaving
114
+ }))
42
115
  });
43
116
  this.set.delete(id);
44
117
  // Remove notification on animation completion.
45
- setTimeout(() => {
46
- const notice = this.state.notices.find((notice) => notice.id === id);
118
+ setTimeout(()=>{
119
+ const notice = this.state.notices.find((notice)=>notice.id === id);
47
120
  if (notice) {
48
121
  // call close callback, ignore any errors in callback.
49
122
  if (notice.onClose) {
50
123
  try {
51
124
  notice.onClose();
52
- }
53
- catch (e) {
125
+ } catch (e) {
54
126
  console.warn('Error in notification close callback', e.message);
55
127
  }
56
128
  }
57
129
  // Remove the notification
58
130
  this.setState({
59
- notices: this.state.notices.filter((notice) => notice.id !== id),
60
- }, () => {
131
+ notices: this.state.notices.filter((notice)=>notice.id !== id)
132
+ }, ()=>{
61
133
  // Check if the stack is empty and then call the
62
134
  // empty callback function.
63
135
  if (this.state.notices.length === 0) {
@@ -66,15 +138,13 @@ class NotificationManager extends React.Component {
66
138
  });
67
139
  }
68
140
  }, 550);
69
- };
70
- /**
71
- * Adds a notification to stack.
72
- *
73
- * @param notice
74
- */
75
- this.add = (notice) => __awaiter(this, void 0, void 0, function* () {
141
+ }, /**
142
+ * Adds a notification to stack.
143
+ *
144
+ * @param notice
145
+ */ this.add = async (notice)=>{
76
146
  // Generate unique id if not provided.
77
- const id = notice.id || (Math.random() * Math.pow(10, 7)).toFixed(0);
147
+ const id = notice.id || (Math.random() * 10 ** 7).toFixed(0);
78
148
  // De-dupe on id
79
149
  if (!this.set.has(id)) {
80
150
  const type = notice.type || NOTIFICATION_TYPE.INFO;
@@ -82,76 +152,63 @@ class NotificationManager extends React.Component {
82
152
  // Add notice to the top of stack.
83
153
  this.setState({
84
154
  notices: [
85
- Object.assign(Object.assign({}, notice), { id }),
86
- ...this.state.notices,
87
- ],
88
- }, () => {
155
+ {
156
+ ...notice,
157
+ id
158
+ },
159
+ ...this.state.notices
160
+ ]
161
+ }, ()=>{
89
162
  // Update live region after state update
90
163
  const announcement = `${notice.title} ${notice.description}`;
91
164
  this.updateLiveRegion(announcement, isUrgent);
92
165
  });
93
166
  // set timeout for closing the notification.
94
167
  if (!notice.sticky) {
95
- this.timeouts[id] = setTimeout(() => this.remove(id), notice.duration || DEFAULT_DURATION);
168
+ this.timeouts[id] = setTimeout(()=>this.remove(id), notice.duration || DEFAULT_DURATION);
96
169
  }
97
170
  // Add id to the set.
98
171
  this.set.add(id);
99
172
  }
100
173
  return id;
101
- });
102
- /**
103
- * Update live region content with clear-then-set pattern for reliable VoiceOver announcements.
104
- *
105
- * @param content - The text content to announce
106
- * @param isAssertive - Whether to use assertive (alert) or polite (log) live region
107
- */
108
- this.updateLiveRegion = (content, isAssertive) => {
174
+ }, /**
175
+ * Update live region content with clear-then-set pattern for reliable VoiceOver announcements.
176
+ *
177
+ * @param content - The text content to announce
178
+ * @param isAssertive - Whether to use assertive (alert) or polite (log) live region
179
+ */ this.updateLiveRegion = (content, isAssertive)=>{
109
180
  const region = isAssertive ? this.assertiveRegionRef.current : this.politeRegionRef.current;
110
181
  if (region) {
111
182
  // Add content after delay
112
- setTimeout(() => {
183
+ setTimeout(()=>{
113
184
  if (region) {
114
185
  region.textContent = content;
115
186
  }
116
187
  }, 150);
117
188
  }
118
- };
119
- /**
120
- * Handler for close button click.
121
- *
122
- * @param id
123
- */
124
- this.closeClickHandler = (id) => () => {
125
- this.remove(id);
126
- };
127
- /**
128
- * Pause notification when user is hovering over it.
129
- *
130
- * @param id
131
- */
132
- this.pause = (id) => () => {
133
- clearTimeout(this.timeouts[id]);
134
- };
135
- /**
136
- * Restart the removal of notification.
137
- *
138
- * @param id
139
- */
140
- this.resume = (id) => () => {
141
- const notice = this.state.notices.find((notice) => notice.id === id);
142
- if (!notice.sticky) {
143
- this.timeouts[id] = setTimeout(() => this.remove(id), DEFAULT_DURATION);
144
- }
145
- };
146
- }
147
- render() {
148
- return (_jsxs(Container, { position: this.props.position, children: [_jsx(VisuallyHidden, { ref: this.politeRegionRef, role: "log", "aria-live": "polite", "aria-atomic": "false", "aria-relevant": "additions text" }), _jsx(VisuallyHidden, { ref: this.assertiveRegionRef, role: "alert", "aria-live": "assertive", "aria-atomic": "true" }), _jsx("div", { role: "list", "aria-label": this.props.ariaLabel, children: this.state.notices.map((notice) => {
149
- const { id, title, description, leaving, type = NOTIFICATION_TYPE.INFO, buttonText, buttonClick, closeButtonAriaLabel, } = notice;
150
- return (_jsxs(Notice, Object.assign({}, notice, { position: this.props.position, className: leaving ? 'leave' : '', onMouseEnter: this.pause(id), onMouseLeave: this.resume(id), role: "listitem", children: [_jsxs(IconContainer, { type: type, "aria-hidden": "true", children: [type === NOTIFICATION_TYPE.INFO && _jsx(Info, {}), type === NOTIFICATION_TYPE.SUCCESS && _jsx(CheckCircle, {}), type === NOTIFICATION_TYPE.WARNING && _jsx(ReportProblem, {}), type === NOTIFICATION_TYPE.DANGER && _jsx(ErrorOutline, {})] }), _jsxs(FillParent, { children: [_jsx(Title, { type: type, children: title }), _jsx(Body, { children: description }), buttonText && (_jsx(Footer, { children: _jsx(ActionButton, { onClick: () => {
151
- buttonClick === null || buttonClick === void 0 ? void 0 : buttonClick();
152
- }, children: buttonText }) }))] }), _jsx(CloseButton, { onClick: this.closeClickHandler(id), "aria-label": closeButtonAriaLabel || 'Close notification', tabIndex: 0, children: _jsx(Close, {}) })] }), id));
153
- }) })] }));
189
+ }, /**
190
+ * Handler for close button click.
191
+ *
192
+ * @param id
193
+ */ this.closeClickHandler = (id)=>()=>{
194
+ this.remove(id);
195
+ }, /**
196
+ * Pause notification when user is hovering over it.
197
+ *
198
+ * @param id
199
+ */ this.pause = (id)=>()=>{
200
+ clearTimeout(this.timeouts[id]);
201
+ }, /**
202
+ * Restart the removal of notification.
203
+ *
204
+ * @param id
205
+ */ this.resume = (id)=>()=>{
206
+ const notice = this.state.notices.find((notice)=>notice.id === id);
207
+ if (!notice.sticky) {
208
+ this.timeouts[id] = setTimeout(()=>this.remove(id), DEFAULT_DURATION);
209
+ }
210
+ };
154
211
  }
155
212
  }
156
- export default NotificationManager;
157
- //# sourceMappingURL=NotificationManager.js.map
213
+
214
+ export { NotificationManager as default };
@@ -1,3 +1,2 @@
1
1
  export { default as Notification } from './Notification';
2
2
  export { NOTIFICATION_POSITION, NOTIFICATION_TYPE } from './types';
3
- //# sourceMappingURL=index.d.ts.map
@@ -47,4 +47,3 @@ export declare const VisuallyHidden: import("@emotion/styled").StyledComponent<{
47
47
  as?: React.ElementType;
48
48
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
49
49
  export {};
50
- //# sourceMappingURL=style.d.ts.map