@telia-ace/widget-ui 1.0.8 → 1.0.11

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 (317) hide show
  1. package/LICENSE.txt +5 -5
  2. package/README.md +3 -3
  3. package/{lib-esm → dist}/components/anchor-link.d.ts +4 -4
  4. package/{lib → dist}/components/button.d.ts +4 -4
  5. package/{lib-esm → dist}/components/checkbox.d.ts +7 -7
  6. package/{lib-esm → dist}/components/drawer/drawer.d.ts +21 -21
  7. package/{lib-esm → dist}/components/drawer/index.d.ts +3 -3
  8. package/{lib-esm → dist}/components/dropdown/dropdown.d.ts +9 -9
  9. package/{lib → dist}/components/dropdown/index.d.ts +4 -4
  10. package/{lib-esm → dist}/components/dropdown/use-position.d.ts +5 -5
  11. package/{lib → dist}/components/empty.d.ts +4 -4
  12. package/{lib → dist}/components/grid.d.ts +7 -7
  13. package/{lib-esm → dist}/components/html.d.ts +12 -12
  14. package/{lib → dist}/components/icon.d.ts +7 -7
  15. package/{lib-esm → dist}/components/index.d.ts +58 -58
  16. package/{lib-esm → dist}/components/input.d.ts +10 -10
  17. package/{lib → dist}/components/item-list.d.ts +10 -10
  18. package/{lib → dist}/components/item-tree.d.ts +13 -13
  19. package/{lib-esm → dist}/components/lightbox.d.ts +6 -6
  20. package/{lib-esm → dist}/components/link.d.ts +11 -11
  21. package/{lib-esm → dist}/components/list.d.ts +9 -9
  22. package/{lib-esm → dist}/components/modal/confirm.d.ts +12 -12
  23. package/{lib → dist}/components/modal/index.d.ts +4 -4
  24. package/{lib-esm → dist}/components/modal/modal.d.ts +10 -10
  25. package/{lib → dist}/components/not-found.d.ts +9 -9
  26. package/{lib → dist}/components/overlay.d.ts +8 -8
  27. package/{lib-esm → dist}/components/paragraph.d.ts +11 -11
  28. package/{lib → dist}/components/portal.d.ts +7 -7
  29. package/{lib-esm → dist}/components/route-link.d.ts +11 -11
  30. package/{lib → dist}/components/symbol-badge.d.ts +15 -15
  31. package/{lib-esm → dist}/components/tab-stop.d.ts +18 -18
  32. package/{lib-esm → dist}/components/text-link.d.ts +8 -8
  33. package/{lib-esm → dist}/components/text.d.ts +4 -4
  34. package/{lib-esm → dist}/components/timestamp.d.ts +13 -13
  35. package/{lib-esm → dist}/components/tooltip.d.ts +8 -8
  36. package/{lib-esm → dist}/components/transition-component.d.ts +30 -30
  37. package/{lib → dist}/components/typography.d.ts +9 -9
  38. package/{lib → dist}/components/widget-link.d.ts +10 -10
  39. package/{lib → dist}/contexts/index.d.ts +9 -9
  40. package/{lib-esm → dist}/create-react-component.d.ts +11 -11
  41. package/{lib-esm → dist}/hooks/index.d.ts +27 -27
  42. package/{lib → dist}/hooks/use-action.d.ts +4 -4
  43. package/{lib-esm → dist}/hooks/use-children.d.ts +4 -4
  44. package/{lib-esm → dist}/hooks/use-columns.d.ts +2 -2
  45. package/{lib-esm → dist}/hooks/use-component-descriptor.d.ts +2 -2
  46. package/{lib-esm → dist}/hooks/use-component-node.d.ts +6 -6
  47. package/{lib → dist}/hooks/use-component-platform.d.ts +4 -4
  48. package/{lib → dist}/hooks/use-component.d.ts +3 -3
  49. package/{lib-esm → dist}/hooks/use-container.d.ts +2 -2
  50. package/{lib-esm → dist}/hooks/use-context.d.ts +3 -3
  51. package/{lib-esm → dist}/hooks/use-dispatch.d.ts +3 -3
  52. package/{lib-esm → dist}/hooks/use-event-listener.d.ts +2 -2
  53. package/{lib-esm → dist}/hooks/use-events.d.ts +3 -3
  54. package/{lib-esm → dist}/hooks/use-is-mounted.d.ts +3 -3
  55. package/{lib-esm → dist}/hooks/use-key-press.d.ts +2 -2
  56. package/{lib-esm → dist}/hooks/use-layout.d.ts +3 -3
  57. package/{lib-esm → dist}/hooks/use-previous.d.ts +2 -2
  58. package/{lib-esm → dist}/hooks/use-properties.d.ts +6 -6
  59. package/{lib-esm → dist}/hooks/use-render-state.d.ts +4 -4
  60. package/{lib → dist}/hooks/use-route-data.d.ts +4 -4
  61. package/{lib-esm → dist}/hooks/use-router.d.ts +3 -3
  62. package/{lib → dist}/hooks/use-scroll.d.ts +2 -2
  63. package/{lib-esm → dist}/hooks/use-settings.d.ts +3 -3
  64. package/{lib-esm → dist}/hooks/use-toggle.d.ts +2 -2
  65. package/{lib → dist}/hooks/use-transition-end.d.ts +2 -2
  66. package/{lib-esm → dist}/hooks/use-unique-menu.d.ts +2 -2
  67. package/{lib-esm → dist}/hooks/use-widget-event.d.ts +3 -3
  68. package/{lib-esm → dist}/index.d.ts +9 -9
  69. package/dist/index.js +2988 -0
  70. package/dist/index.js.map +1 -0
  71. package/{lib-esm → dist}/styles.d.ts +19 -19
  72. package/{lib-esm → dist}/utils/animations.d.ts +18 -18
  73. package/{lib → dist}/utils/browser.d.ts +12 -12
  74. package/{lib-esm → dist}/utils/convert-to-string-attributes.d.ts +2 -2
  75. package/{lib → dist}/utils/create-empty-component.d.ts +3 -3
  76. package/{lib → dist}/utils/embedded-link-mapper.d.ts +3 -3
  77. package/{lib-esm → dist}/utils/filter-css-props.d.ts +8 -8
  78. package/{lib → dist}/utils/generic-hash-link.d.ts +8 -8
  79. package/{lib-esm → dist}/utils/heading-styles.d.ts +1 -1
  80. package/{lib-esm → dist}/utils/index.d.ts +12 -12
  81. package/{lib → dist}/utils/process-html-string.d.ts +4 -4
  82. package/{lib-esm → dist}/utils/render-instructions.d.ts +8 -8
  83. package/package.json +11 -12
  84. package/lib/components/anchor-link.d.ts +0 -4
  85. package/lib/components/anchor-link.js +0 -7
  86. package/lib/components/button.js +0 -64
  87. package/lib/components/checkbox.d.ts +0 -7
  88. package/lib/components/checkbox.js +0 -39
  89. package/lib/components/drawer/drawer.d.ts +0 -21
  90. package/lib/components/drawer/drawer.js +0 -150
  91. package/lib/components/drawer/index.d.ts +0 -3
  92. package/lib/components/drawer/index.js +0 -29
  93. package/lib/components/dropdown/dropdown.d.ts +0 -9
  94. package/lib/components/dropdown/dropdown.js +0 -155
  95. package/lib/components/dropdown/index.js +0 -10
  96. package/lib/components/dropdown/use-position.d.ts +0 -5
  97. package/lib/components/dropdown/use-position.js +0 -57
  98. package/lib/components/empty.js +0 -40
  99. package/lib/components/grid.js +0 -64
  100. package/lib/components/html.d.ts +0 -12
  101. package/lib/components/html.js +0 -78
  102. package/lib/components/icon.js +0 -35
  103. package/lib/components/index.d.ts +0 -58
  104. package/lib/components/index.js +0 -69
  105. package/lib/components/input.d.ts +0 -10
  106. package/lib/components/input.js +0 -94
  107. package/lib/components/item-list.js +0 -62
  108. package/lib/components/item-tree.js +0 -55
  109. package/lib/components/lightbox.d.ts +0 -6
  110. package/lib/components/lightbox.js +0 -92
  111. package/lib/components/link.d.ts +0 -11
  112. package/lib/components/link.js +0 -99
  113. package/lib/components/list.d.ts +0 -9
  114. package/lib/components/list.js +0 -56
  115. package/lib/components/modal/confirm.d.ts +0 -12
  116. package/lib/components/modal/confirm.js +0 -61
  117. package/lib/components/modal/index.js +0 -10
  118. package/lib/components/modal/modal.d.ts +0 -10
  119. package/lib/components/modal/modal.js +0 -127
  120. package/lib/components/not-found.js +0 -55
  121. package/lib/components/overlay.js +0 -73
  122. package/lib/components/paragraph.d.ts +0 -11
  123. package/lib/components/paragraph.js +0 -66
  124. package/lib/components/portal.js +0 -61
  125. package/lib/components/route-link.d.ts +0 -11
  126. package/lib/components/route-link.js +0 -115
  127. package/lib/components/symbol-badge.js +0 -205
  128. package/lib/components/tab-stop.d.ts +0 -18
  129. package/lib/components/tab-stop.js +0 -100
  130. package/lib/components/text-link.d.ts +0 -8
  131. package/lib/components/text-link.js +0 -62
  132. package/lib/components/text.d.ts +0 -4
  133. package/lib/components/text.js +0 -35
  134. package/lib/components/timestamp.d.ts +0 -13
  135. package/lib/components/timestamp.js +0 -39
  136. package/lib/components/tooltip.d.ts +0 -8
  137. package/lib/components/tooltip.js +0 -127
  138. package/lib/components/transition-component.d.ts +0 -30
  139. package/lib/components/transition-component.js +0 -77
  140. package/lib/components/typography.js +0 -43
  141. package/lib/components/widget-link.js +0 -116
  142. package/lib/contexts/index.js +0 -15
  143. package/lib/create-react-component.d.ts +0 -11
  144. package/lib/create-react-component.js +0 -18
  145. package/lib/hooks/index.d.ts +0 -27
  146. package/lib/hooks/index.js +0 -58
  147. package/lib/hooks/use-action.js +0 -21
  148. package/lib/hooks/use-children.d.ts +0 -4
  149. package/lib/hooks/use-children.js +0 -70
  150. package/lib/hooks/use-columns.d.ts +0 -2
  151. package/lib/hooks/use-columns.js +0 -6
  152. package/lib/hooks/use-component-descriptor.d.ts +0 -2
  153. package/lib/hooks/use-component-descriptor.js +0 -6
  154. package/lib/hooks/use-component-node.d.ts +0 -6
  155. package/lib/hooks/use-component-node.js +0 -37
  156. package/lib/hooks/use-component-platform.js +0 -39
  157. package/lib/hooks/use-component.js +0 -57
  158. package/lib/hooks/use-container.d.ts +0 -2
  159. package/lib/hooks/use-container.js +0 -6
  160. package/lib/hooks/use-context.d.ts +0 -3
  161. package/lib/hooks/use-context.js +0 -50
  162. package/lib/hooks/use-dispatch.d.ts +0 -3
  163. package/lib/hooks/use-dispatch.js +0 -64
  164. package/lib/hooks/use-event-listener.d.ts +0 -2
  165. package/lib/hooks/use-event-listener.js +0 -21
  166. package/lib/hooks/use-events.d.ts +0 -3
  167. package/lib/hooks/use-events.js +0 -12
  168. package/lib/hooks/use-is-mounted.d.ts +0 -3
  169. package/lib/hooks/use-is-mounted.js +0 -14
  170. package/lib/hooks/use-key-press.d.ts +0 -2
  171. package/lib/hooks/use-key-press.js +0 -46
  172. package/lib/hooks/use-layout.d.ts +0 -3
  173. package/lib/hooks/use-layout.js +0 -50
  174. package/lib/hooks/use-previous.d.ts +0 -2
  175. package/lib/hooks/use-previous.js +0 -11
  176. package/lib/hooks/use-properties.d.ts +0 -6
  177. package/lib/hooks/use-properties.js +0 -9
  178. package/lib/hooks/use-render-state.d.ts +0 -4
  179. package/lib/hooks/use-render-state.js +0 -70
  180. package/lib/hooks/use-route-data.js +0 -58
  181. package/lib/hooks/use-router.d.ts +0 -3
  182. package/lib/hooks/use-router.js +0 -9
  183. package/lib/hooks/use-scroll.js +0 -71
  184. package/lib/hooks/use-settings.d.ts +0 -3
  185. package/lib/hooks/use-settings.js +0 -38
  186. package/lib/hooks/use-toggle.d.ts +0 -2
  187. package/lib/hooks/use-toggle.js +0 -28
  188. package/lib/hooks/use-transition-end.js +0 -62
  189. package/lib/hooks/use-unique-menu.d.ts +0 -2
  190. package/lib/hooks/use-unique-menu.js +0 -15
  191. package/lib/hooks/use-widget-event.d.ts +0 -3
  192. package/lib/hooks/use-widget-event.js +0 -21
  193. package/lib/index.d.ts +0 -9
  194. package/lib/index.js +0 -98
  195. package/lib/styles.d.ts +0 -19
  196. package/lib/styles.js +0 -53
  197. package/lib/utils/animations.d.ts +0 -18
  198. package/lib/utils/animations.js +0 -104
  199. package/lib/utils/browser.js +0 -54
  200. package/lib/utils/convert-to-string-attributes.d.ts +0 -2
  201. package/lib/utils/convert-to-string-attributes.js +0 -23
  202. package/lib/utils/create-empty-component.js +0 -25
  203. package/lib/utils/embedded-link-mapper.js +0 -62
  204. package/lib/utils/filter-css-props.d.ts +0 -8
  205. package/lib/utils/filter-css-props.js +0 -28
  206. package/lib/utils/generic-hash-link.js +0 -70
  207. package/lib/utils/heading-styles.d.ts +0 -1
  208. package/lib/utils/heading-styles.js +0 -48
  209. package/lib/utils/index.d.ts +0 -12
  210. package/lib/utils/index.js +0 -28
  211. package/lib/utils/process-html-string.js +0 -16
  212. package/lib/utils/render-instructions.d.ts +0 -8
  213. package/lib/utils/render-instructions.js +0 -19
  214. package/lib-esm/components/anchor-link.js +0 -5
  215. package/lib-esm/components/button.d.ts +0 -4
  216. package/lib-esm/components/button.js +0 -36
  217. package/lib-esm/components/checkbox.js +0 -34
  218. package/lib-esm/components/drawer/drawer.js +0 -121
  219. package/lib-esm/components/drawer/index.js +0 -3
  220. package/lib-esm/components/dropdown/dropdown.js +0 -127
  221. package/lib-esm/components/dropdown/index.d.ts +0 -4
  222. package/lib-esm/components/dropdown/index.js +0 -3
  223. package/lib-esm/components/dropdown/use-position.js +0 -53
  224. package/lib-esm/components/empty.d.ts +0 -4
  225. package/lib-esm/components/empty.js +0 -35
  226. package/lib-esm/components/grid.d.ts +0 -7
  227. package/lib-esm/components/grid.js +0 -36
  228. package/lib-esm/components/html.js +0 -53
  229. package/lib-esm/components/icon.d.ts +0 -7
  230. package/lib-esm/components/icon.js +0 -30
  231. package/lib-esm/components/index.js +0 -30
  232. package/lib-esm/components/input.js +0 -69
  233. package/lib-esm/components/item-list.d.ts +0 -10
  234. package/lib-esm/components/item-list.js +0 -34
  235. package/lib-esm/components/item-tree.d.ts +0 -13
  236. package/lib-esm/components/item-tree.js +0 -50
  237. package/lib-esm/components/lightbox.js +0 -64
  238. package/lib-esm/components/link.js +0 -71
  239. package/lib-esm/components/list.js +0 -31
  240. package/lib-esm/components/modal/confirm.js +0 -33
  241. package/lib-esm/components/modal/index.d.ts +0 -4
  242. package/lib-esm/components/modal/index.js +0 -3
  243. package/lib-esm/components/modal/modal.js +0 -99
  244. package/lib-esm/components/not-found.d.ts +0 -9
  245. package/lib-esm/components/not-found.js +0 -27
  246. package/lib-esm/components/overlay.d.ts +0 -8
  247. package/lib-esm/components/overlay.js +0 -45
  248. package/lib-esm/components/paragraph.js +0 -38
  249. package/lib-esm/components/portal.d.ts +0 -7
  250. package/lib-esm/components/portal.js +0 -36
  251. package/lib-esm/components/route-link.js +0 -90
  252. package/lib-esm/components/symbol-badge.d.ts +0 -15
  253. package/lib-esm/components/symbol-badge.js +0 -200
  254. package/lib-esm/components/tab-stop.js +0 -75
  255. package/lib-esm/components/text-link.js +0 -34
  256. package/lib-esm/components/text.js +0 -30
  257. package/lib-esm/components/timestamp.js +0 -33
  258. package/lib-esm/components/tooltip.js +0 -99
  259. package/lib-esm/components/transition-component.js +0 -72
  260. package/lib-esm/components/typography.d.ts +0 -9
  261. package/lib-esm/components/typography.js +0 -38
  262. package/lib-esm/components/widget-link.d.ts +0 -10
  263. package/lib-esm/components/widget-link.js +0 -88
  264. package/lib-esm/contexts/index.d.ts +0 -9
  265. package/lib-esm/contexts/index.js +0 -12
  266. package/lib-esm/create-react-component.js +0 -16
  267. package/lib-esm/hooks/index.js +0 -26
  268. package/lib-esm/hooks/use-action.d.ts +0 -4
  269. package/lib-esm/hooks/use-action.js +0 -14
  270. package/lib-esm/hooks/use-children.js +0 -65
  271. package/lib-esm/hooks/use-columns.js +0 -4
  272. package/lib-esm/hooks/use-component-descriptor.js +0 -4
  273. package/lib-esm/hooks/use-component-node.js +0 -35
  274. package/lib-esm/hooks/use-component-platform.d.ts +0 -4
  275. package/lib-esm/hooks/use-component-platform.js +0 -34
  276. package/lib-esm/hooks/use-component.d.ts +0 -3
  277. package/lib-esm/hooks/use-component.js +0 -52
  278. package/lib-esm/hooks/use-container.js +0 -4
  279. package/lib-esm/hooks/use-context.js +0 -45
  280. package/lib-esm/hooks/use-dispatch.js +0 -59
  281. package/lib-esm/hooks/use-event-listener.js +0 -19
  282. package/lib-esm/hooks/use-events.js +0 -7
  283. package/lib-esm/hooks/use-is-mounted.js +0 -12
  284. package/lib-esm/hooks/use-key-press.js +0 -41
  285. package/lib-esm/hooks/use-layout.js +0 -45
  286. package/lib-esm/hooks/use-previous.js +0 -9
  287. package/lib-esm/hooks/use-properties.js +0 -7
  288. package/lib-esm/hooks/use-render-state.js +0 -65
  289. package/lib-esm/hooks/use-route-data.d.ts +0 -4
  290. package/lib-esm/hooks/use-route-data.js +0 -53
  291. package/lib-esm/hooks/use-router.js +0 -7
  292. package/lib-esm/hooks/use-scroll.d.ts +0 -2
  293. package/lib-esm/hooks/use-scroll.js +0 -66
  294. package/lib-esm/hooks/use-settings.js +0 -33
  295. package/lib-esm/hooks/use-toggle.js +0 -26
  296. package/lib-esm/hooks/use-transition-end.d.ts +0 -2
  297. package/lib-esm/hooks/use-transition-end.js +0 -60
  298. package/lib-esm/hooks/use-unique-menu.js +0 -10
  299. package/lib-esm/hooks/use-widget-event.js +0 -16
  300. package/lib-esm/index.js +0 -7
  301. package/lib-esm/styles.js +0 -26
  302. package/lib-esm/utils/animations.js +0 -101
  303. package/lib-esm/utils/browser.d.ts +0 -12
  304. package/lib-esm/utils/browser.js +0 -51
  305. package/lib-esm/utils/convert-to-string-attributes.js +0 -21
  306. package/lib-esm/utils/create-empty-component.d.ts +0 -3
  307. package/lib-esm/utils/create-empty-component.js +0 -20
  308. package/lib-esm/utils/embedded-link-mapper.d.ts +0 -3
  309. package/lib-esm/utils/embedded-link-mapper.js +0 -57
  310. package/lib-esm/utils/filter-css-props.js +0 -25
  311. package/lib-esm/utils/generic-hash-link.d.ts +0 -8
  312. package/lib-esm/utils/generic-hash-link.js +0 -63
  313. package/lib-esm/utils/heading-styles.js +0 -44
  314. package/lib-esm/utils/index.js +0 -10
  315. package/lib-esm/utils/process-html-string.d.ts +0 -4
  316. package/lib-esm/utils/process-html-string.js +0 -10
  317. package/lib-esm/utils/render-instructions.js +0 -12
@@ -1,54 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Browsers = void 0;
4
- var Browsers;
5
- (function (Browsers) {
6
- Browsers["Opera"] = "opera";
7
- Browsers["Chrome"] = "chrome";
8
- Browsers["Firefox"] = "firefox";
9
- Browsers["Safari"] = "safari";
10
- Browsers["Edge"] = "edge";
11
- Browsers["EdgeChromium"] = "edge-chromium";
12
- Browsers["Blink"] = "blink";
13
- Browsers["IE"] = "internet-explorer";
14
- })(Browsers = exports.Browsers || (exports.Browsers = {}));
15
- exports.default = (function () {
16
- var opr = window.opr, opera = window.opera, InstallTrigger = window.InstallTrigger, HTMLElement = window.HTMLElement, safari = window.safari, documentMode = window.documentMode, StyleMedia = window.StyleMedia, chrome = window.chrome, CSS = window.CSS;
17
- // Opera 8.0+
18
- var isOpera = (!!opr && !!opr.addons) || !!opera || navigator.userAgent.indexOf(' OPR/') >= 0;
19
- if (isOpera) {
20
- return Browsers.Opera;
21
- }
22
- // Firefox 1.0+
23
- if (InstallTrigger) {
24
- return Browsers.Firefox;
25
- }
26
- // Safari 3.0+ '[object HTMLElementConstructor]'
27
- var safariCheck = (function (p) {
28
- return p.toString() === '[object SafariRemoteNotification]';
29
- })(!safari || (typeof safari !== 'undefined' && safari.pushNotification));
30
- if (/constructor/i.test(HTMLElement) || safariCheck) {
31
- return Browsers.Safari;
32
- }
33
- // Internet Explorer 6-11
34
- var isIE = /*@cc_on!@*/ false || !!documentMode;
35
- if (isIE) {
36
- return Browsers.IE;
37
- }
38
- // Edge 20+
39
- if (!isIE && !!StyleMedia) {
40
- return Browsers.Edge;
41
- }
42
- // Chrome 1 - 79
43
- var isChrome = !!chrome && (!!chrome.webstore || !!chrome.runtime);
44
- if (isChrome) {
45
- return Browsers.Chrome;
46
- }
47
- // Edge (based on chromium) detection
48
- if (isChrome && navigator.userAgent.indexOf('Edg') !== -1) {
49
- return Browsers.EdgeChromium;
50
- }
51
- if ((isChrome || isOpera) && !!CSS) {
52
- return Browsers.Blink;
53
- }
54
- });
@@ -1,2 +0,0 @@
1
- declare const _default: (props: any) => object;
2
- export default _default;
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var widget_utilities_1 = require("@telia-ace/widget-utilities");
4
- var types = ['string', 'number'];
5
- exports.default = (function (props) {
6
- return Object.keys(props).reduce(function (result, key) {
7
- var value = typeof props[key] === 'undefined' ? '' : props[key];
8
- var type = typeof value;
9
- if (types.indexOf(type) > -1) {
10
- var sub = key.substring(0, 5);
11
- if (sub === 'data-' || sub === 'aria-') {
12
- result[(0, widget_utilities_1.kebabCase)(key)] = value.toString();
13
- }
14
- else if (key.substring(0, 4) !== 'css-') {
15
- result[key] = value.toString();
16
- }
17
- }
18
- else {
19
- result[key] = value;
20
- }
21
- return result;
22
- }, {});
23
- });
@@ -1,25 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- var react_1 = __importDefault(require("react"));
18
- var components_1 = require("../components");
19
- var createEmptyComponent = function (container, props) {
20
- if (container.get('seoConfiguration')) {
21
- return react_1.default.createElement(components_1.Empty, __assign({}, props));
22
- }
23
- return null;
24
- };
25
- exports.default = createEmptyComponent;
@@ -1,62 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __rest = (this && this.__rest) || function (s, e) {
14
- var t = {};
15
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
- t[p] = s[p];
17
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
- t[p[i]] = s[p[i]];
21
- }
22
- return t;
23
- };
24
- var __importDefault = (this && this.__importDefault) || function (mod) {
25
- return (mod && mod.__esModule) ? mod : { "default": mod };
26
- };
27
- Object.defineProperty(exports, "__esModule", { value: true });
28
- var react_1 = __importDefault(require("react"));
29
- var components_1 = require("../components");
30
- // Determine if href starts with a hashtag
31
- var isAnchorLink = function (href) {
32
- var re = new RegExp('^#', 'i');
33
- var match = re.test(href);
34
- return match;
35
- };
36
- var embeddedLinkMapper = function (container) {
37
- return function (_a) {
38
- var children = _a.children, props = __rest(_a, ["children"]);
39
- var _b = container.get('$widget'), implementation = _b.implementation, currentWidgetName = _b.name;
40
- var _c = props.href, href = _c === void 0 ? '' : _c;
41
- if (isAnchorLink(href)) {
42
- return (react_1.default.createElement(components_1.AnchorLink, { smooth: true, to: href }, children));
43
- }
44
- var escapedBindings = implementation.bindings
45
- .map(function (binding) { return binding.replace(/\./g, '\\.'); })
46
- .join('|');
47
- var regexp = new RegExp("^((http[s]?:)?//)?(".concat(escapedBindings, ")/([^\\s]+)"));
48
- var expArray = regexp.exec(href);
49
- if (expArray && expArray.length >= 4) {
50
- var targetWidgetName = expArray[4];
51
- var targetWidget = implementation.widgets.get(targetWidgetName);
52
- // blob links should not be treated as a widget link
53
- if (targetWidget &&
54
- !targetWidgetName.startsWith('blob?') &&
55
- !targetWidgetName.startsWith(currentWidgetName)) {
56
- return react_1.default.createElement(components_1.WidgetLink, { widgetName: targetWidgetName }, children);
57
- }
58
- }
59
- return react_1.default.createElement("a", __assign({}, props), children);
60
- };
61
- };
62
- exports.default = embeddedLinkMapper;
@@ -1,8 +0,0 @@
1
- declare const filterCssProps: (props: any) => {
2
- [key: string]: any;
3
- };
4
- declare type FilterCssPropsStyle = {
5
- [key: string]: any;
6
- };
7
- export declare const filterCssPropsStyle: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<FilterCssPropsStyle, any>>;
8
- export default filterCssProps;
@@ -1,28 +0,0 @@
1
- "use strict";
2
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
- return cooked;
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.filterCssPropsStyle = void 0;
8
- var styled_components_1 = require("styled-components");
9
- var filterCssProps = function (props) {
10
- var cssProps = {};
11
- Object.keys(props).forEach(function (key) {
12
- if (key.indexOf('css-') > -1) {
13
- cssProps[key] = props[key];
14
- }
15
- });
16
- return cssProps;
17
- };
18
- exports.filterCssPropsStyle = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (p) {
19
- var css = '';
20
- Object.keys(filterCssProps(p)).forEach(function (key) {
21
- if (key.indexOf('css-') > -1) {
22
- css += "".concat(key.replace('css-', ''), ":").concat(p[key], ";");
23
- }
24
- });
25
- return css;
26
- });
27
- exports.default = filterCssProps;
28
- var templateObject_1;
@@ -1,70 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __rest = (this && this.__rest) || function (s, e) {
14
- var t = {};
15
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
- t[p] = s[p];
17
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
- t[p[i]] = s[p[i]];
21
- }
22
- return t;
23
- };
24
- var __importDefault = (this && this.__importDefault) || function (mod) {
25
- return (mod && mod.__esModule) ? mod : { "default": mod };
26
- };
27
- Object.defineProperty(exports, "__esModule", { value: true });
28
- exports.genericHashLink = void 0;
29
- var react_1 = __importDefault(require("react"));
30
- var genericHashLink = function (props, As) {
31
- var hashFragment = '';
32
- var reset = function () {
33
- hashFragment = '';
34
- };
35
- var getElementAndScroll = function (scrollFunction) {
36
- var element = document.getElementById(hashFragment);
37
- if (element !== null) {
38
- scrollFunction(element);
39
- reset();
40
- return true;
41
- }
42
- return false;
43
- };
44
- var handleClick = function (e) {
45
- e.preventDefault();
46
- reset();
47
- if (props.onClick)
48
- props.onClick(e);
49
- // try to get hash fragment
50
- if (typeof props.to === 'string') {
51
- hashFragment = props.to.split('#').slice(1).join('#');
52
- }
53
- // if hash fragment is present
54
- if (hashFragment !== '') {
55
- getElementAndScroll(props.scroll ||
56
- (function (el) {
57
- return props.smooth
58
- ? el.scrollIntoView({ behavior: 'smooth' })
59
- : el.scrollIntoView();
60
- }));
61
- }
62
- return false;
63
- };
64
- var scroll = props.scroll, smooth = props.smooth, to = props.to, filteredProps = __rest(props, ["scroll", "smooth", "to"]);
65
- if (As === 'a') {
66
- filteredProps.href = 'javascript:;';
67
- }
68
- return (react_1.default.createElement(As, __assign({}, filteredProps, { onClick: handleClick }), props.children));
69
- };
70
- exports.genericHashLink = genericHashLink;
@@ -1 +0,0 @@
1
- export declare const headingElement: (element: string, style: any) => import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<any>>;
@@ -1,48 +0,0 @@
1
- "use strict";
2
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
- return cooked;
5
- };
6
- var __read = (this && this.__read) || function (o, n) {
7
- var m = typeof Symbol === "function" && o[Symbol.iterator];
8
- if (!m) return o;
9
- var i = m.call(o), r, ar = [], e;
10
- try {
11
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
12
- }
13
- catch (error) { e = { error: error }; }
14
- finally {
15
- try {
16
- if (r && !r.done && (m = i["return"])) m.call(i);
17
- }
18
- finally { if (e) throw e.error; }
19
- }
20
- return ar;
21
- };
22
- Object.defineProperty(exports, "__esModule", { value: true });
23
- exports.headingElement = void 0;
24
- var styled_components_1 = require("styled-components");
25
- var headingElement = function (element, style) {
26
- var defaultTag = element;
27
- var prefix = '';
28
- if (['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(element)) {
29
- defaultTag = element;
30
- }
31
- else {
32
- var match = element.match(/h1|h2|h3|h4|h5|h6/);
33
- if (match === null || match === void 0 ? void 0 : match[0]) {
34
- defaultTag = match[0];
35
- var _a = __read(element.split(defaultTag), 1), pre = _a[0];
36
- prefix = pre;
37
- }
38
- }
39
- var renderTag = function (element, pre, mapping) {
40
- if (mapping[element]) {
41
- return "".concat(pre).concat(mapping[element]);
42
- }
43
- return "".concat(pre).concat(element);
44
- };
45
- return (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", " {\n ", "\n }\n "], ["\n ", " {\n ", "\n }\n "])), function (p) { return renderTag(defaultTag, prefix, p.theme.typographyVariantMapping || {}); }, style);
46
- };
47
- exports.headingElement = headingElement;
48
- var templateObject_1;
@@ -1,12 +0,0 @@
1
- export { transitionComposer } from './animations';
2
- export type { TransitionStateSettings } from './animations';
3
- export { Browsers, default as browser } from './browser';
4
- export { default as convertToStringAttributes } from './convert-to-string-attributes';
5
- export { default as createEmptyComponent } from './create-empty-component';
6
- export { default as embeddedLinkMapper } from './embedded-link-mapper';
7
- export { default as filterCssProps, filterCssPropsStyle } from './filter-css-props';
8
- export { genericHashLink } from './generic-hash-link';
9
- export type { Props as GenericHashLinkProps } from './generic-hash-link';
10
- export { headingElement } from './heading-styles';
11
- export { default as processHtmlString } from './process-html-string';
12
- export { defaultRenderInstructions } from './render-instructions';
@@ -1,28 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.defaultRenderInstructions = exports.processHtmlString = exports.headingElement = exports.genericHashLink = exports.filterCssPropsStyle = exports.filterCssProps = exports.embeddedLinkMapper = exports.createEmptyComponent = exports.convertToStringAttributes = exports.browser = exports.Browsers = exports.transitionComposer = void 0;
7
- var animations_1 = require("./animations");
8
- Object.defineProperty(exports, "transitionComposer", { enumerable: true, get: function () { return animations_1.transitionComposer; } });
9
- var browser_1 = require("./browser");
10
- Object.defineProperty(exports, "Browsers", { enumerable: true, get: function () { return browser_1.Browsers; } });
11
- Object.defineProperty(exports, "browser", { enumerable: true, get: function () { return __importDefault(browser_1).default; } });
12
- var convert_to_string_attributes_1 = require("./convert-to-string-attributes");
13
- Object.defineProperty(exports, "convertToStringAttributes", { enumerable: true, get: function () { return __importDefault(convert_to_string_attributes_1).default; } });
14
- var create_empty_component_1 = require("./create-empty-component");
15
- Object.defineProperty(exports, "createEmptyComponent", { enumerable: true, get: function () { return __importDefault(create_empty_component_1).default; } });
16
- var embedded_link_mapper_1 = require("./embedded-link-mapper");
17
- Object.defineProperty(exports, "embeddedLinkMapper", { enumerable: true, get: function () { return __importDefault(embedded_link_mapper_1).default; } });
18
- var filter_css_props_1 = require("./filter-css-props");
19
- Object.defineProperty(exports, "filterCssProps", { enumerable: true, get: function () { return __importDefault(filter_css_props_1).default; } });
20
- Object.defineProperty(exports, "filterCssPropsStyle", { enumerable: true, get: function () { return filter_css_props_1.filterCssPropsStyle; } });
21
- var generic_hash_link_1 = require("./generic-hash-link");
22
- Object.defineProperty(exports, "genericHashLink", { enumerable: true, get: function () { return generic_hash_link_1.genericHashLink; } });
23
- var heading_styles_1 = require("./heading-styles");
24
- Object.defineProperty(exports, "headingElement", { enumerable: true, get: function () { return heading_styles_1.headingElement; } });
25
- var process_html_string_1 = require("./process-html-string");
26
- Object.defineProperty(exports, "processHtmlString", { enumerable: true, get: function () { return __importDefault(process_html_string_1).default; } });
27
- var render_instructions_1 = require("./render-instructions");
28
- Object.defineProperty(exports, "defaultRenderInstructions", { enumerable: true, get: function () { return render_instructions_1.defaultRenderInstructions; } });
@@ -1,16 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- var htmr_1 = __importDefault(require("htmr"));
7
- /**
8
- * Converts a html chunk to managed React nodes.
9
- */
10
- function parseHtmlString(html, instruction) {
11
- if (instruction) {
12
- return (0, htmr_1.default)(html, instruction);
13
- }
14
- return (0, htmr_1.default)(html);
15
- }
16
- exports.default = parseHtmlString;
@@ -1,8 +0,0 @@
1
- import { Container } from '@webprovisions/platform';
2
- import React from 'react';
3
- export declare const defaultRenderInstructions: (container: Container) => {
4
- transform: {
5
- a: ({ children, ...props }: any) => JSX.Element;
6
- img: (attrs: React.DetailedHTMLProps<React.HtmlHTMLAttributes<HTMLImageElement>, HTMLImageElement>) => JSX.Element;
7
- };
8
- };
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.defaultRenderInstructions = void 0;
7
- var react_1 = __importDefault(require("react"));
8
- var components_1 = require("../components");
9
- var embedded_link_mapper_1 = __importDefault(require("./embedded-link-mapper"));
10
- var imageLightboxRenderer = function (attrs) { return react_1.default.createElement(components_1.Lightbox, { attrs: attrs }); };
11
- var defaultRenderInstructions = function (container) {
12
- return {
13
- transform: {
14
- a: (0, embedded_link_mapper_1.default)(container),
15
- img: imageLightboxRenderer,
16
- },
17
- };
18
- };
19
- exports.defaultRenderInstructions = defaultRenderInstructions;
@@ -1,5 +0,0 @@
1
- import { genericHashLink } from '../utils';
2
- var AnchorLink = function (props) {
3
- return genericHashLink(props, 'a');
4
- };
5
- export default AnchorLink;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- export declare type Props = React.ComponentProps<'button'>;
3
- declare const _default: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof React.ButtonHTMLAttributes<HTMLButtonElement>> & React.RefAttributes<HTMLButtonElement>>;
4
- export default _default;
@@ -1,36 +0,0 @@
1
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
- return cooked;
4
- };
5
- var __assign = (this && this.__assign) || function () {
6
- __assign = Object.assign || function(t) {
7
- for (var s, i = 1, n = arguments.length; i < n; i++) {
8
- s = arguments[i];
9
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10
- t[p] = s[p];
11
- }
12
- return t;
13
- };
14
- return __assign.apply(this, arguments);
15
- };
16
- var __rest = (this && this.__rest) || function (s, e) {
17
- var t = {};
18
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
19
- t[p] = s[p];
20
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
21
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
22
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
23
- t[p[i]] = s[p[i]];
24
- }
25
- return t;
26
- };
27
- import { appendClassNames } from '@telia-ace/widget-utilities';
28
- import React, { forwardRef } from 'react';
29
- import styled from 'styled-components';
30
- import { convertToStringAttributes } from '../utils';
31
- export default forwardRef(function (_a, ref) {
32
- var className = _a.className, children = _a.children, other = __rest(_a, ["className", "children"]);
33
- return (React.createElement(StyledButton, __assign({ type: "button", className: appendClassNames(className, 'humany-button') }, convertToStringAttributes(other), { ref: ref }), children));
34
- });
35
- var StyledButton = styled.button(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n -webkit-appearance: button;\n text-transform: none;\n overflow: visible;\n outline: none;\n border: none;\n background-color: transparent;\n cursor: pointer;\n font-family: inherit;\n font-size: inherit;\n line-height: normal;\n margin: 0;\n padding: 0;\n"], ["\n -webkit-appearance: button;\n text-transform: none;\n overflow: visible;\n outline: none;\n border: none;\n background-color: transparent;\n cursor: pointer;\n font-family: inherit;\n font-size: inherit;\n line-height: normal;\n margin: 0;\n padding: 0;\n"])));
36
- var templateObject_1;
@@ -1,34 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
- import { appendClassNames } from '@telia-ace/widget-utilities';
24
- import React from 'react';
25
- import { convertToStringAttributes } from '../utils';
26
- var Checkbox = function (_a) {
27
- var _b = _a.onChange, onChange = _b === void 0 ? function () { } : _b, _c = _a.onEnter, onEnter = _c === void 0 ? function () { } : _c, className = _a.className, other = __rest(_a, ["onChange", "onEnter", "className"]);
28
- return (React.createElement("input", __assign({ className: appendClassNames(className, 'humany-checkbox'), onKeyDown: function (e) {
29
- if (e.key === 'Enter') {
30
- onEnter(e);
31
- }
32
- }, onChange: function (e) { return onChange(e.target.value, e.currentTarget.checked); } }, convertToStringAttributes(other))));
33
- };
34
- export default Checkbox;
@@ -1,121 +0,0 @@
1
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
- return cooked;
4
- };
5
- var __read = (this && this.__read) || function (o, n) {
6
- var m = typeof Symbol === "function" && o[Symbol.iterator];
7
- if (!m) return o;
8
- var i = m.call(o), r, ar = [], e;
9
- try {
10
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
11
- }
12
- catch (error) { e = { error: error }; }
13
- finally {
14
- try {
15
- if (r && !r.done && (m = i["return"])) m.call(i);
16
- }
17
- finally { if (e) throw e.error; }
18
- }
19
- return ar;
20
- };
21
- var _a;
22
- import { appendClassNames, uuid } from '@telia-ace/widget-utilities';
23
- import React, { useEffect, useRef } from 'react';
24
- import { CSSTransition } from 'react-transition-group';
25
- import styled, { css } from 'styled-components';
26
- import { useEventListener, useKeyPress, usePrevious, useScroll, useToggle, useUniqueMenu, useWidgetEvent, } from '../../hooks';
27
- import { CloseButton } from '../../styles';
28
- import Portal from '../portal';
29
- import SymbolBadge from '../symbol-badge';
30
- import Typography from '../typography';
31
- export var AnimationType;
32
- (function (AnimationType) {
33
- AnimationType["SlideInLeft"] = "slide-in-left";
34
- AnimationType["SlideInRight"] = "slide-in-right";
35
- AnimationType["SlideInBottom"] = "slide-in-bottom";
36
- AnimationType["SlideInTop"] = "slide-in-top";
37
- // Fade = 'fade',
38
- })(AnimationType || (AnimationType = {}));
39
- var defaultDuration = 300;
40
- var Drawer = function (_a) {
41
- var className = _a.className, children = _a.children, header = _a.header, onToggle = _a.onToggle, trigger = _a.trigger, _b = _a.fullScreen, fullScreen = _b === void 0 ? false : _b, closeButtonAriaLabel = _a.closeButtonAriaLabel, _c = _a.animation, animation = _c === void 0 ? {
42
- type: AnimationType.SlideInBottom,
43
- } : _c;
44
- var _d = animation.duration, duration = _d === void 0 ? defaultDuration : _d;
45
- var closeButtonRef = useRef();
46
- var triggerRef = useRef();
47
- var _e = __read(useScroll(true), 2), css = _e[0], ref = _e[1];
48
- var _f = __read(useToggle(), 2), visible = _f[0], toggleVisible = _f[1];
49
- var previousVisible = usePrevious(visible);
50
- var id = useRef(uuid());
51
- useEffect(function () {
52
- if (onToggle) {
53
- onToggle(visible);
54
- }
55
- }, [visible]);
56
- var esc = useKeyPress('Escape');
57
- useEffect(function () {
58
- if (esc) {
59
- toggleVisible(false);
60
- }
61
- }, [esc]);
62
- useEventListener('click', function (event) {
63
- var target = event.target;
64
- if (!triggerRef.current || !ref.current || !target) {
65
- return;
66
- }
67
- if (triggerRef.current !== target &&
68
- ref.current !== target &&
69
- !ref.current.contains(target) &&
70
- !triggerRef.current.contains(target)) {
71
- toggleVisible(false);
72
- }
73
- }, window);
74
- var closeMenus = useUniqueMenu(id.current, function () {
75
- toggleVisible(false);
76
- });
77
- useWidgetEvent('router:changed', function () {
78
- toggleVisible(false);
79
- });
80
- useEffect(function () {
81
- if (visible && closeButtonRef.current) {
82
- closeButtonRef.current.focus();
83
- }
84
- else if (!visible && triggerRef.current && previousVisible) {
85
- triggerRef.current.focus();
86
- }
87
- }, [visible, closeButtonRef.current, triggerRef.current]);
88
- var WrapperWithAnimation = animations[animation.type];
89
- return (React.createElement(React.Fragment, null,
90
- React.createElement(CSSTransition, { in: visible, className: "humany-drawer-transition", classNames: "humany-drawer-transition", unmountOnExit: true, timeout: duration },
91
- React.createElement(Portal, null,
92
- React.createElement(WrapperWithAnimation, { duration: duration, fullScreen: fullScreen, className: appendClassNames(className, 'humany-drawer', "humany-drawer-".concat(id.current)), clientHeight: document.body.clientHeight, css: css, ref: ref },
93
- React.createElement(CloseButton, { onClick: function () { return toggleVisible(false); }, tabIndex: 0, ref: closeButtonRef, "aria-label": closeButtonAriaLabel },
94
- React.createElement(SymbolBadge, { symbol: { type: 'Svg', content: 'close' } })),
95
- !!header && (React.createElement(Header, { variant: "h1", className: "humany-drawer-header" }, header)),
96
- children))),
97
- React.cloneElement(trigger, {
98
- onClick: function (event) {
99
- toggleVisible();
100
- closeMenus();
101
- },
102
- ref: triggerRef,
103
- 'aria-label': trigger.props.title,
104
- 'aria-expanded': visible,
105
- })));
106
- };
107
- export default Drawer;
108
- var Wrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n position: fixed;\n bottom: 0;\n left: 0;\n border: ", ";\n width: 100%;\n box-shadow: ", ";\n background: #ffffff;\n ", "\n"], ["\n font-family: ", ";\n font-size: ", ";\n position: fixed;\n bottom: 0;\n left: 0;\n border: ", ";\n width: 100%;\n box-shadow: ", ";\n background: #ffffff;\n ", "\n"])), function (p) { var _a; return (_a = p.theme.fonts) === null || _a === void 0 ? void 0 : _a.type; }, function (p) { var _a; return (_a = p.theme.fonts) === null || _a === void 0 ? void 0 : _a.normal; }, function (p) { return p.theme.border; }, function (p) { return p.theme.boxShadow; }, function (p) { return p.css && p.css; });
109
- var Header = styled(Typography)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: ", ";\n margin: 0;\n text-align: center;\n border-bottom: #eeeeee 1px solid;\n background: #ffffff;\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n font-weight: bold;\n color: ", ";\n font-size: ", ";\n line-height: 1.2em;\n"], ["\n padding: ", ";\n margin: 0;\n text-align: center;\n border-bottom: #eeeeee 1px solid;\n background: #ffffff;\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n font-weight: bold;\n color: ", ";\n font-size: ", ";\n line-height: 1.2em;\n"])), function (p) { return p.theme.sizes.normal; }, function (p) { var _a; return (_a = p.theme.colors) === null || _a === void 0 ? void 0 : _a.text; }, function (p) { var _a; return (_a = p.theme.fonts) === null || _a === void 0 ? void 0 : _a.normal; });
110
- var AnimationBase = css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n transition: ", "ms;\n"], ["\n transition: ", "ms;\n"])), function (p) { return p.duration; });
111
- var WrapperWithSlideInBottom = styled(Wrapper)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n max-height: 0;\n ", "\n\n &.humany-drawer-transition-enter {\n max-height: 0;\n }\n &.humany-drawer-transition-enter-active,\n &.humany-drawer-transition-enter-done,\n &.humany-drawer-transition-exit {\n max-height: ", ";\n }\n\n &.humany-drawer-transition-exit-active,\n &.humany-drawer-transition-exit-done {\n max-height: 0;\n }\n"], ["\n max-height: 0;\n ", "\n\n &.humany-drawer-transition-enter {\n max-height: 0;\n }\n &.humany-drawer-transition-enter-active,\n &.humany-drawer-transition-enter-done,\n &.humany-drawer-transition-exit {\n max-height: ", ";\n }\n\n &.humany-drawer-transition-exit-active,\n &.humany-drawer-transition-exit-done {\n max-height: 0;\n }\n"])), AnimationBase, function (p) { return (p.fullScreen ? '100%' : '400px'); });
112
- var WrapperWithSlideInRight = styled(Wrapper)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n ", "\n transform: translateX(100%);\n height: ", ";\n\n &.humany-drawer-transition-enter {\n transform: translateX(100%);\n }\n &.humany-drawer-transition-enter-active,\n &.humany-drawer-transition-enter-done,\n &.humany-drawer-transition-exit {\n transform: translateX(0);\n }\n\n &.humany-drawer-transition-exit-active,\n &.humany-drawer-transition-exit-done {\n transform: translateX(100%);\n }\n"], ["\n ", "\n transform: translateX(100%);\n height: ", ";\n\n &.humany-drawer-transition-enter {\n transform: translateX(100%);\n }\n &.humany-drawer-transition-enter-active,\n &.humany-drawer-transition-enter-done,\n &.humany-drawer-transition-exit {\n transform: translateX(0);\n }\n\n &.humany-drawer-transition-exit-active,\n &.humany-drawer-transition-exit-done {\n transform: translateX(100%);\n }\n"])), AnimationBase, function (p) { return (p.fullScreen ? '100%' : 'auto'); });
113
- var WrapperWithSlideInLeft = styled(Wrapper)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n ", "\n transform: translateX(-100%);\n height: ", ";\n\n &.humany-drawer-transition-enter {\n transform: translateX(-100%);\n }\n &.humany-drawer-transition-enter-active,\n &.humany-drawer-transition-enter-done,\n &.humany-drawer-transition-exit {\n transform: translateX(0);\n }\n\n &.humany-drawer-transition-exit-active,\n &.humany-drawer-transition-exit-done {\n transform: translateX(-100%);\n }\n"], ["\n ", "\n transform: translateX(-100%);\n height: ", ";\n\n &.humany-drawer-transition-enter {\n transform: translateX(-100%);\n }\n &.humany-drawer-transition-enter-active,\n &.humany-drawer-transition-enter-done,\n &.humany-drawer-transition-exit {\n transform: translateX(0);\n }\n\n &.humany-drawer-transition-exit-active,\n &.humany-drawer-transition-exit-done {\n transform: translateX(-100%);\n }\n"])), AnimationBase, function (p) { return (p.fullScreen ? '100%' : 'auto'); });
114
- var WrapperWithSlideInTop = styled(Wrapper)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n ", "\n bottom: unset;\n top: 0;\n height: 0;\n\n &.humany-drawer-transition-enter {\n height: 0;\n }\n &.humany-drawer-transition-enter-active,\n &.humany-drawer-transition-enter-done,\n &.humany-drawer-transition-exit {\n height: ", "px;\n }\n\n &.humany-drawer-transition-exit-active,\n &.humany-drawer-transition-exit-done {\n height: 0;\n }\n"], ["\n ", "\n bottom: unset;\n top: 0;\n height: 0;\n\n &.humany-drawer-transition-enter {\n height: 0;\n }\n &.humany-drawer-transition-enter-active,\n &.humany-drawer-transition-enter-done,\n &.humany-drawer-transition-exit {\n height: ", "px;\n }\n\n &.humany-drawer-transition-exit-active,\n &.humany-drawer-transition-exit-done {\n height: 0;\n }\n"])), AnimationBase, function (p) { return p.clientHeight; });
115
- var animations = (_a = {},
116
- _a[AnimationType.SlideInBottom] = WrapperWithSlideInBottom,
117
- _a[AnimationType.SlideInRight] = WrapperWithSlideInRight,
118
- _a[AnimationType.SlideInLeft] = WrapperWithSlideInLeft,
119
- _a[AnimationType.SlideInTop] = WrapperWithSlideInTop,
120
- _a);
121
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
@@ -1,3 +0,0 @@
1
- import Drawer, { AnimationType } from './drawer';
2
- export { AnimationType };
3
- export default Drawer;