@telia-ace/widget-ui 1.0.6 → 1.0.9

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 (315) hide show
  1. package/{lib-esm → dist}/components/anchor-link.d.ts +0 -0
  2. package/{lib-esm → dist}/components/button.d.ts +0 -0
  3. package/{lib-esm → dist}/components/checkbox.d.ts +0 -0
  4. package/{lib-esm → dist}/components/drawer/drawer.d.ts +0 -0
  5. package/{lib-esm → dist}/components/drawer/index.d.ts +0 -0
  6. package/{lib-esm → dist}/components/dropdown/dropdown.d.ts +0 -0
  7. package/{lib-esm → dist}/components/dropdown/index.d.ts +0 -0
  8. package/{lib-esm → dist}/components/dropdown/use-position.d.ts +0 -0
  9. package/{lib-esm → dist}/components/empty.d.ts +0 -0
  10. package/{lib-esm → dist}/components/grid.d.ts +0 -0
  11. package/{lib-esm → dist}/components/html.d.ts +0 -0
  12. package/{lib-esm → dist}/components/icon.d.ts +0 -0
  13. package/{lib-esm → dist}/components/index.d.ts +0 -0
  14. package/{lib-esm → dist}/components/input.d.ts +0 -0
  15. package/{lib-esm → dist}/components/item-list.d.ts +0 -0
  16. package/{lib-esm → dist}/components/item-tree.d.ts +0 -0
  17. package/{lib-esm → dist}/components/lightbox.d.ts +0 -0
  18. package/{lib-esm → dist}/components/link.d.ts +0 -0
  19. package/{lib-esm → dist}/components/list.d.ts +0 -0
  20. package/{lib-esm → dist}/components/modal/confirm.d.ts +0 -0
  21. package/{lib-esm → dist}/components/modal/index.d.ts +0 -0
  22. package/{lib-esm → dist}/components/modal/modal.d.ts +0 -0
  23. package/{lib-esm → dist}/components/not-found.d.ts +0 -0
  24. package/{lib-esm → dist}/components/overlay.d.ts +0 -0
  25. package/{lib-esm → dist}/components/paragraph.d.ts +0 -0
  26. package/{lib-esm → dist}/components/portal.d.ts +0 -0
  27. package/{lib-esm → dist}/components/route-link.d.ts +0 -0
  28. package/{lib-esm → dist}/components/symbol-badge.d.ts +0 -0
  29. package/{lib-esm → dist}/components/tab-stop.d.ts +0 -0
  30. package/{lib-esm → dist}/components/text-link.d.ts +0 -0
  31. package/{lib-esm → dist}/components/text.d.ts +0 -0
  32. package/{lib-esm → dist}/components/timestamp.d.ts +0 -0
  33. package/{lib-esm → dist}/components/tooltip.d.ts +0 -0
  34. package/{lib-esm → dist}/components/transition-component.d.ts +0 -0
  35. package/{lib-esm → dist}/components/typography.d.ts +0 -0
  36. package/{lib-esm → dist}/components/widget-link.d.ts +0 -0
  37. package/{lib-esm → dist}/contexts/index.d.ts +0 -0
  38. package/{lib-esm → dist}/create-react-component.d.ts +0 -0
  39. package/{lib-esm → dist}/hooks/index.d.ts +0 -0
  40. package/{lib-esm → dist}/hooks/use-action.d.ts +0 -0
  41. package/{lib-esm → dist}/hooks/use-children.d.ts +0 -0
  42. package/{lib-esm → dist}/hooks/use-columns.d.ts +0 -0
  43. package/{lib-esm → dist}/hooks/use-component-descriptor.d.ts +0 -0
  44. package/{lib-esm → dist}/hooks/use-component-node.d.ts +0 -0
  45. package/{lib-esm → dist}/hooks/use-component-platform.d.ts +0 -0
  46. package/{lib-esm → dist}/hooks/use-component.d.ts +0 -0
  47. package/{lib-esm → dist}/hooks/use-container.d.ts +0 -0
  48. package/{lib-esm → dist}/hooks/use-context.d.ts +0 -0
  49. package/{lib-esm → dist}/hooks/use-dispatch.d.ts +0 -0
  50. package/{lib-esm → dist}/hooks/use-event-listener.d.ts +0 -0
  51. package/{lib-esm → dist}/hooks/use-events.d.ts +0 -0
  52. package/{lib-esm → dist}/hooks/use-is-mounted.d.ts +0 -0
  53. package/{lib-esm → dist}/hooks/use-key-press.d.ts +0 -0
  54. package/{lib-esm → dist}/hooks/use-layout.d.ts +0 -0
  55. package/{lib-esm → dist}/hooks/use-previous.d.ts +0 -0
  56. package/{lib-esm → dist}/hooks/use-properties.d.ts +0 -0
  57. package/{lib-esm → dist}/hooks/use-render-state.d.ts +0 -0
  58. package/{lib-esm → dist}/hooks/use-route-data.d.ts +0 -0
  59. package/{lib-esm → dist}/hooks/use-router.d.ts +0 -0
  60. package/{lib-esm → dist}/hooks/use-scroll.d.ts +0 -0
  61. package/{lib-esm → dist}/hooks/use-settings.d.ts +0 -0
  62. package/{lib-esm → dist}/hooks/use-toggle.d.ts +0 -0
  63. package/{lib-esm → dist}/hooks/use-transition-end.d.ts +0 -0
  64. package/{lib-esm → dist}/hooks/use-unique-menu.d.ts +0 -0
  65. package/{lib-esm → dist}/hooks/use-widget-event.d.ts +0 -0
  66. package/{lib-esm → dist}/index.d.ts +0 -0
  67. package/dist/index.js +2988 -0
  68. package/dist/index.js.map +1 -0
  69. package/{lib-esm → dist}/styles.d.ts +0 -0
  70. package/{lib-esm → dist}/utils/animations.d.ts +0 -0
  71. package/{lib-esm → dist}/utils/browser.d.ts +0 -0
  72. package/{lib-esm → dist}/utils/convert-to-string-attributes.d.ts +0 -0
  73. package/{lib-esm → dist}/utils/create-empty-component.d.ts +0 -0
  74. package/{lib-esm → dist}/utils/embedded-link-mapper.d.ts +0 -0
  75. package/{lib-esm → dist}/utils/filter-css-props.d.ts +0 -0
  76. package/{lib-esm → dist}/utils/generic-hash-link.d.ts +0 -0
  77. package/{lib-esm → dist}/utils/heading-styles.d.ts +0 -0
  78. package/{lib-esm → dist}/utils/index.d.ts +0 -0
  79. package/{lib-esm → dist}/utils/process-html-string.d.ts +0 -0
  80. package/{lib-esm → dist}/utils/render-instructions.d.ts +0 -0
  81. package/package.json +10 -11
  82. package/lib/components/anchor-link.d.ts +0 -4
  83. package/lib/components/anchor-link.js +0 -7
  84. package/lib/components/button.d.ts +0 -4
  85. package/lib/components/button.js +0 -64
  86. package/lib/components/checkbox.d.ts +0 -7
  87. package/lib/components/checkbox.js +0 -39
  88. package/lib/components/drawer/drawer.d.ts +0 -21
  89. package/lib/components/drawer/drawer.js +0 -150
  90. package/lib/components/drawer/index.d.ts +0 -3
  91. package/lib/components/drawer/index.js +0 -29
  92. package/lib/components/dropdown/dropdown.d.ts +0 -9
  93. package/lib/components/dropdown/dropdown.js +0 -155
  94. package/lib/components/dropdown/index.d.ts +0 -4
  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.d.ts +0 -4
  99. package/lib/components/empty.js +0 -40
  100. package/lib/components/grid.d.ts +0 -7
  101. package/lib/components/grid.js +0 -64
  102. package/lib/components/html.d.ts +0 -12
  103. package/lib/components/html.js +0 -78
  104. package/lib/components/icon.d.ts +0 -7
  105. package/lib/components/icon.js +0 -35
  106. package/lib/components/index.d.ts +0 -58
  107. package/lib/components/index.js +0 -69
  108. package/lib/components/input.d.ts +0 -10
  109. package/lib/components/input.js +0 -94
  110. package/lib/components/item-list.d.ts +0 -10
  111. package/lib/components/item-list.js +0 -62
  112. package/lib/components/item-tree.d.ts +0 -13
  113. package/lib/components/item-tree.js +0 -55
  114. package/lib/components/lightbox.d.ts +0 -6
  115. package/lib/components/lightbox.js +0 -92
  116. package/lib/components/link.d.ts +0 -11
  117. package/lib/components/link.js +0 -99
  118. package/lib/components/list.d.ts +0 -9
  119. package/lib/components/list.js +0 -56
  120. package/lib/components/modal/confirm.d.ts +0 -12
  121. package/lib/components/modal/confirm.js +0 -61
  122. package/lib/components/modal/index.d.ts +0 -4
  123. package/lib/components/modal/index.js +0 -10
  124. package/lib/components/modal/modal.d.ts +0 -10
  125. package/lib/components/modal/modal.js +0 -127
  126. package/lib/components/not-found.d.ts +0 -9
  127. package/lib/components/not-found.js +0 -55
  128. package/lib/components/overlay.d.ts +0 -8
  129. package/lib/components/overlay.js +0 -73
  130. package/lib/components/paragraph.d.ts +0 -11
  131. package/lib/components/paragraph.js +0 -66
  132. package/lib/components/portal.d.ts +0 -7
  133. package/lib/components/portal.js +0 -61
  134. package/lib/components/route-link.d.ts +0 -11
  135. package/lib/components/route-link.js +0 -115
  136. package/lib/components/symbol-badge.d.ts +0 -15
  137. package/lib/components/symbol-badge.js +0 -197
  138. package/lib/components/tab-stop.d.ts +0 -18
  139. package/lib/components/tab-stop.js +0 -100
  140. package/lib/components/text-link.d.ts +0 -8
  141. package/lib/components/text-link.js +0 -62
  142. package/lib/components/text.d.ts +0 -4
  143. package/lib/components/text.js +0 -35
  144. package/lib/components/timestamp.d.ts +0 -13
  145. package/lib/components/timestamp.js +0 -39
  146. package/lib/components/tooltip.d.ts +0 -8
  147. package/lib/components/tooltip.js +0 -127
  148. package/lib/components/transition-component.d.ts +0 -30
  149. package/lib/components/transition-component.js +0 -77
  150. package/lib/components/typography.d.ts +0 -9
  151. package/lib/components/typography.js +0 -43
  152. package/lib/components/widget-link.d.ts +0 -10
  153. package/lib/components/widget-link.js +0 -116
  154. package/lib/contexts/index.d.ts +0 -9
  155. package/lib/contexts/index.js +0 -15
  156. package/lib/create-react-component.d.ts +0 -11
  157. package/lib/create-react-component.js +0 -18
  158. package/lib/hooks/index.d.ts +0 -27
  159. package/lib/hooks/index.js +0 -58
  160. package/lib/hooks/use-action.d.ts +0 -4
  161. package/lib/hooks/use-action.js +0 -21
  162. package/lib/hooks/use-children.d.ts +0 -4
  163. package/lib/hooks/use-children.js +0 -70
  164. package/lib/hooks/use-columns.d.ts +0 -2
  165. package/lib/hooks/use-columns.js +0 -6
  166. package/lib/hooks/use-component-descriptor.d.ts +0 -2
  167. package/lib/hooks/use-component-descriptor.js +0 -6
  168. package/lib/hooks/use-component-node.d.ts +0 -6
  169. package/lib/hooks/use-component-node.js +0 -37
  170. package/lib/hooks/use-component-platform.d.ts +0 -4
  171. package/lib/hooks/use-component-platform.js +0 -39
  172. package/lib/hooks/use-component.d.ts +0 -3
  173. package/lib/hooks/use-component.js +0 -57
  174. package/lib/hooks/use-container.d.ts +0 -2
  175. package/lib/hooks/use-container.js +0 -6
  176. package/lib/hooks/use-context.d.ts +0 -3
  177. package/lib/hooks/use-context.js +0 -50
  178. package/lib/hooks/use-dispatch.d.ts +0 -3
  179. package/lib/hooks/use-dispatch.js +0 -64
  180. package/lib/hooks/use-event-listener.d.ts +0 -2
  181. package/lib/hooks/use-event-listener.js +0 -21
  182. package/lib/hooks/use-events.d.ts +0 -3
  183. package/lib/hooks/use-events.js +0 -12
  184. package/lib/hooks/use-is-mounted.d.ts +0 -3
  185. package/lib/hooks/use-is-mounted.js +0 -14
  186. package/lib/hooks/use-key-press.d.ts +0 -2
  187. package/lib/hooks/use-key-press.js +0 -46
  188. package/lib/hooks/use-layout.d.ts +0 -3
  189. package/lib/hooks/use-layout.js +0 -50
  190. package/lib/hooks/use-previous.d.ts +0 -2
  191. package/lib/hooks/use-previous.js +0 -11
  192. package/lib/hooks/use-properties.d.ts +0 -6
  193. package/lib/hooks/use-properties.js +0 -9
  194. package/lib/hooks/use-render-state.d.ts +0 -4
  195. package/lib/hooks/use-render-state.js +0 -70
  196. package/lib/hooks/use-route-data.d.ts +0 -4
  197. package/lib/hooks/use-route-data.js +0 -58
  198. package/lib/hooks/use-router.d.ts +0 -3
  199. package/lib/hooks/use-router.js +0 -9
  200. package/lib/hooks/use-scroll.d.ts +0 -2
  201. package/lib/hooks/use-scroll.js +0 -71
  202. package/lib/hooks/use-settings.d.ts +0 -3
  203. package/lib/hooks/use-settings.js +0 -38
  204. package/lib/hooks/use-toggle.d.ts +0 -2
  205. package/lib/hooks/use-toggle.js +0 -28
  206. package/lib/hooks/use-transition-end.d.ts +0 -2
  207. package/lib/hooks/use-transition-end.js +0 -62
  208. package/lib/hooks/use-unique-menu.d.ts +0 -2
  209. package/lib/hooks/use-unique-menu.js +0 -15
  210. package/lib/hooks/use-widget-event.d.ts +0 -3
  211. package/lib/hooks/use-widget-event.js +0 -21
  212. package/lib/index.d.ts +0 -9
  213. package/lib/index.js +0 -98
  214. package/lib/styles.d.ts +0 -19
  215. package/lib/styles.js +0 -53
  216. package/lib/utils/animations.d.ts +0 -18
  217. package/lib/utils/animations.js +0 -104
  218. package/lib/utils/browser.d.ts +0 -12
  219. package/lib/utils/browser.js +0 -54
  220. package/lib/utils/convert-to-string-attributes.d.ts +0 -2
  221. package/lib/utils/convert-to-string-attributes.js +0 -23
  222. package/lib/utils/create-empty-component.d.ts +0 -3
  223. package/lib/utils/create-empty-component.js +0 -25
  224. package/lib/utils/embedded-link-mapper.d.ts +0 -3
  225. package/lib/utils/embedded-link-mapper.js +0 -62
  226. package/lib/utils/filter-css-props.d.ts +0 -8
  227. package/lib/utils/filter-css-props.js +0 -28
  228. package/lib/utils/generic-hash-link.d.ts +0 -8
  229. package/lib/utils/generic-hash-link.js +0 -70
  230. package/lib/utils/heading-styles.d.ts +0 -1
  231. package/lib/utils/heading-styles.js +0 -48
  232. package/lib/utils/index.d.ts +0 -12
  233. package/lib/utils/index.js +0 -28
  234. package/lib/utils/process-html-string.d.ts +0 -4
  235. package/lib/utils/process-html-string.js +0 -16
  236. package/lib/utils/render-instructions.d.ts +0 -8
  237. package/lib/utils/render-instructions.js +0 -19
  238. package/lib-esm/components/anchor-link.js +0 -5
  239. package/lib-esm/components/button.js +0 -36
  240. package/lib-esm/components/checkbox.js +0 -34
  241. package/lib-esm/components/drawer/drawer.js +0 -121
  242. package/lib-esm/components/drawer/index.js +0 -3
  243. package/lib-esm/components/dropdown/dropdown.js +0 -127
  244. package/lib-esm/components/dropdown/index.js +0 -3
  245. package/lib-esm/components/dropdown/use-position.js +0 -53
  246. package/lib-esm/components/empty.js +0 -35
  247. package/lib-esm/components/grid.js +0 -36
  248. package/lib-esm/components/html.js +0 -53
  249. package/lib-esm/components/icon.js +0 -30
  250. package/lib-esm/components/index.js +0 -30
  251. package/lib-esm/components/input.js +0 -69
  252. package/lib-esm/components/item-list.js +0 -34
  253. package/lib-esm/components/item-tree.js +0 -50
  254. package/lib-esm/components/lightbox.js +0 -64
  255. package/lib-esm/components/link.js +0 -71
  256. package/lib-esm/components/list.js +0 -31
  257. package/lib-esm/components/modal/confirm.js +0 -33
  258. package/lib-esm/components/modal/index.js +0 -3
  259. package/lib-esm/components/modal/modal.js +0 -99
  260. package/lib-esm/components/not-found.js +0 -27
  261. package/lib-esm/components/overlay.js +0 -45
  262. package/lib-esm/components/paragraph.js +0 -38
  263. package/lib-esm/components/portal.js +0 -36
  264. package/lib-esm/components/route-link.js +0 -90
  265. package/lib-esm/components/symbol-badge.js +0 -192
  266. package/lib-esm/components/tab-stop.js +0 -75
  267. package/lib-esm/components/text-link.js +0 -34
  268. package/lib-esm/components/text.js +0 -30
  269. package/lib-esm/components/timestamp.js +0 -33
  270. package/lib-esm/components/tooltip.js +0 -99
  271. package/lib-esm/components/transition-component.js +0 -72
  272. package/lib-esm/components/typography.js +0 -38
  273. package/lib-esm/components/widget-link.js +0 -88
  274. package/lib-esm/contexts/index.js +0 -12
  275. package/lib-esm/create-react-component.js +0 -16
  276. package/lib-esm/hooks/index.js +0 -26
  277. package/lib-esm/hooks/use-action.js +0 -14
  278. package/lib-esm/hooks/use-children.js +0 -65
  279. package/lib-esm/hooks/use-columns.js +0 -4
  280. package/lib-esm/hooks/use-component-descriptor.js +0 -4
  281. package/lib-esm/hooks/use-component-node.js +0 -35
  282. package/lib-esm/hooks/use-component-platform.js +0 -34
  283. package/lib-esm/hooks/use-component.js +0 -52
  284. package/lib-esm/hooks/use-container.js +0 -4
  285. package/lib-esm/hooks/use-context.js +0 -45
  286. package/lib-esm/hooks/use-dispatch.js +0 -59
  287. package/lib-esm/hooks/use-event-listener.js +0 -19
  288. package/lib-esm/hooks/use-events.js +0 -7
  289. package/lib-esm/hooks/use-is-mounted.js +0 -12
  290. package/lib-esm/hooks/use-key-press.js +0 -41
  291. package/lib-esm/hooks/use-layout.js +0 -45
  292. package/lib-esm/hooks/use-previous.js +0 -9
  293. package/lib-esm/hooks/use-properties.js +0 -7
  294. package/lib-esm/hooks/use-render-state.js +0 -65
  295. package/lib-esm/hooks/use-route-data.js +0 -53
  296. package/lib-esm/hooks/use-router.js +0 -7
  297. package/lib-esm/hooks/use-scroll.js +0 -66
  298. package/lib-esm/hooks/use-settings.js +0 -33
  299. package/lib-esm/hooks/use-toggle.js +0 -26
  300. package/lib-esm/hooks/use-transition-end.js +0 -60
  301. package/lib-esm/hooks/use-unique-menu.js +0 -10
  302. package/lib-esm/hooks/use-widget-event.js +0 -16
  303. package/lib-esm/index.js +0 -7
  304. package/lib-esm/styles.js +0 -26
  305. package/lib-esm/utils/animations.js +0 -101
  306. package/lib-esm/utils/browser.js +0 -51
  307. package/lib-esm/utils/convert-to-string-attributes.js +0 -21
  308. package/lib-esm/utils/create-empty-component.js +0 -20
  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.js +0 -63
  312. package/lib-esm/utils/heading-styles.js +0 -44
  313. package/lib-esm/utils/index.js +0 -10
  314. package/lib-esm/utils/process-html-string.js +0 -10
  315. package/lib-esm/utils/render-instructions.js +0 -12
@@ -1,35 +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 React from 'react';
28
- import styled from 'styled-components';
29
- var Empty = function (_a) {
30
- var other = __rest(_a, []);
31
- return React.createElement(Wrapper, __assign({}, other));
32
- };
33
- export default Empty;
34
- var Wrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: none;\n"], ["\n display: none;\n"])));
35
- var templateObject_1;
@@ -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, filterCssProps, filterCssPropsStyle } from '../utils';
31
- export default forwardRef(function (_a, ref) {
32
- var children = _a.children, columns = _a.columns, gap = _a.gap, className = _a.className, other = __rest(_a, ["children", "columns", "gap", "className"]);
33
- return (React.createElement(Div, __assign({ className: appendClassNames(className, 'humany-grid'), "data-columns": columns, "data-gap": gap }, filterCssProps(other), convertToStringAttributes(other), { ref: ref }), children));
34
- });
35
- var Div = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: grid;\n grid-template-columns: repeat(", ", 1fr);\n grid-gap: ", ";\n justify-content: center;\n grid-auto-rows: max-content;\n ", "\n"], ["\n display: grid;\n grid-template-columns: repeat(", ", 1fr);\n grid-gap: ", ";\n justify-content: center;\n grid-auto-rows: max-content;\n ", "\n"])), function (p) { return p['data-columns']; }, function (p) { return p['data-gap']; }, filterCssPropsStyle);
36
- var templateObject_1;
@@ -1,53 +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
- var __read = (this && this.__read) || function (o, n) {
24
- var m = typeof Symbol === "function" && o[Symbol.iterator];
25
- if (!m) return o;
26
- var i = m.call(o), r, ar = [], e;
27
- try {
28
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
29
- }
30
- catch (error) { e = { error: error }; }
31
- finally {
32
- try {
33
- if (r && !r.done && (m = i["return"])) m.call(i);
34
- }
35
- finally { if (e) throw e.error; }
36
- }
37
- return ar;
38
- };
39
- import { appendClassNames } from '@telia-ace/widget-utilities';
40
- import React, { forwardRef, useEffect, useState } from 'react';
41
- import { useContainer } from '../hooks';
42
- import { convertToStringAttributes, defaultRenderInstructions, processHtmlString } from '../utils';
43
- export default forwardRef(function (_a, ref) {
44
- var _b = _a.htmlParseInstruction, htmlParseInstruction = _b === void 0 ? null : _b, className = _a.className, html = _a.html, other = __rest(_a, ["htmlParseInstruction", "className", "html"]);
45
- var container = useContainer();
46
- var _c = __read(useState(), 2), processedHtml = _c[0], setProcessedHtml = _c[1];
47
- useEffect(function () {
48
- var instructions = htmlParseInstruction || defaultRenderInstructions(container);
49
- var processed = processHtmlString(html, instructions);
50
- setProcessedHtml(processed);
51
- }, [html, htmlParseInstruction]);
52
- return (React.createElement("div", __assign({ className: appendClassNames(className, 'humany-html') }, convertToStringAttributes(other), { ref: ref }), processedHtml));
53
- });
@@ -1,30 +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 Icon = function (_a) {
27
- var faIcon = _a.faIcon, title = _a.title, _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.role, role = _c === void 0 ? 'presentation' : _c, other = __rest(_a, ["faIcon", "title", "className", "role"]);
28
- return (React.createElement("i", __assign({ className: appendClassNames(className, "fa fa-".concat(faIcon)), title: title, role: role }, convertToStringAttributes(other))));
29
- };
30
- export default Icon;
@@ -1,30 +0,0 @@
1
- export { default as AnchorLink } from './anchor-link';
2
- export { default as Button } from './button';
3
- export { default as Checkbox } from './checkbox';
4
- export { AnimationType as DrawerAnimationType, default as Drawer } from './drawer';
5
- export { default as Dropdown } from './dropdown';
6
- export { default as Empty } from './empty';
7
- export { default as Grid } from './grid';
8
- export { default as Html } from './html';
9
- export { default as Icon } from './icon';
10
- export { default as Input } from './input';
11
- export { default as ItemList } from './item-list';
12
- export { default as ItemTree } from './item-tree';
13
- export { default as Lightbox } from './lightbox';
14
- export { default as Link } from './link';
15
- export { default as List } from './list';
16
- export { Confirm, default as Modal } from './modal';
17
- export { default as NotFound } from './not-found';
18
- export { default as Overlay } from './overlay';
19
- export { default as Paragraph } from './paragraph';
20
- export { default as Portal } from './portal';
21
- export { default as RouteLink } from './route-link';
22
- export { default as SymbolBadge } from './symbol-badge';
23
- export { default as TabStop } from './tab-stop';
24
- export { default as Text } from './text';
25
- export { default as TextLink } from './text-link';
26
- export { DateFormats, default as Timestamp } from './timestamp';
27
- export { default as Tooltip } from './tooltip';
28
- export { default as TransitionComponent } from './transition-component';
29
- export { default as Typography } from './typography';
30
- export { default as WidgetLink } from './widget-link';
@@ -1,69 +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
- var __read = (this && this.__read) || function (o, n) {
24
- var m = typeof Symbol === "function" && o[Symbol.iterator];
25
- if (!m) return o;
26
- var i = m.call(o), r, ar = [], e;
27
- try {
28
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
29
- }
30
- catch (error) { e = { error: error }; }
31
- finally {
32
- try {
33
- if (r && !r.done && (m = i["return"])) m.call(i);
34
- }
35
- finally { if (e) throw e.error; }
36
- }
37
- return ar;
38
- };
39
- import { appendClassNames } from '@telia-ace/widget-utilities';
40
- import React, { forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react';
41
- import { convertToStringAttributes } from '../utils';
42
- export default forwardRef(function (_a, ref) {
43
- var _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.autoFocus, autoFocus = _c === void 0 ? false : _c, _d = _a.onFocusChange, onFocusChange = _d === void 0 ? function () { } : _d, _e = _a.onEnter, onEnter = _e === void 0 ? function () { } : _e, _f = _a.onEscape, onEscape = _f === void 0 ? function () { } : _f, selectAllOnFocus = _a.selectAllOnFocus, _g = _a.onChange, onChange = _g === void 0 ? function () { } : _g, _h = _a.disabled, disabled = _h === void 0 ? false : _h, type = _a.type, other = __rest(_a, ["className", "autoFocus", "onFocusChange", "onEnter", "onEscape", "selectAllOnFocus", "onChange", "disabled", "type"]);
44
- var _j = __read(useState(autoFocus), 2), hasFocus = _j[0], setHasFocus = _j[1];
45
- var innerRef = useRef();
46
- useImperativeHandle(ref, function () { return innerRef.current; });
47
- useEffect(function () {
48
- var _a;
49
- if (autoFocus) {
50
- (_a = innerRef === null || innerRef === void 0 ? void 0 : innerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
51
- }
52
- }, [autoFocus, ref, innerRef]);
53
- var handleFocus = function (inFocus, event) {
54
- setHasFocus(inFocus);
55
- onFocusChange && onFocusChange(inFocus);
56
- if (selectAllOnFocus && inFocus) {
57
- event.target.select();
58
- }
59
- };
60
- var props = __assign(__assign({}, convertToStringAttributes(other)), { disabled: disabled, autoFocus: autoFocus, type: type, onKeyDown: function (e) {
61
- if (e.key === 'Enter' && hasFocus) {
62
- onEnter(e);
63
- }
64
- if (e.key === 'Escape' && hasFocus) {
65
- onEscape(e);
66
- }
67
- }, onFocus: function (e) { return handleFocus(true, e); }, onBlur: function (e) { return handleFocus(false, e); }, onChange: function (e) { return onChange(e.target.value || ''); }, className: appendClassNames(className, 'humany-input'), 'data-type': type });
68
- return type !== 'textarea' ? (React.createElement("input", __assign({}, props, { ref: innerRef }))) : (React.createElement("textarea", __assign({}, props, { ref: innerRef })));
69
- });
@@ -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, { forwardRef } from 'react';
25
- import { convertToStringAttributes } from '../utils';
26
- import List from './list';
27
- import Paragraph from './paragraph';
28
- export default forwardRef(function (_a, ref) {
29
- var header = _a.header, customHeader = _a.customHeader, text = _a.text, html = _a.html, className = _a.className, children = _a.children, symbol = _a.symbol, items = _a.items, renderItem = _a.renderItem, renderLi = _a.renderLi, ulProps = _a.ulProps, other = __rest(_a, ["header", "customHeader", "text", "html", "className", "children", "symbol", "items", "renderItem", "renderLi", "ulProps"]);
30
- return (React.createElement("div", __assign({ className: appendClassNames(className, 'humany-item-list'), "data-item-count": items.length }, convertToStringAttributes(other), { ref: ref }),
31
- customHeader ? (customHeader) : header || text || html ? (React.createElement(Paragraph, { symbol: symbol, header: header, text: text, html: html })) : null,
32
- items.length ? (React.createElement(List, __assign({ items: items, renderItem: renderItem, renderLi: renderLi }, ulProps))) : null,
33
- children));
34
- });
@@ -1,50 +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
- import { appendClassNames } from '@telia-ace/widget-utilities';
13
- import React from 'react';
14
- import { ItemList } from '.';
15
- import { convertToStringAttributes } from '../utils';
16
- var ItemTree = function (_a) {
17
- var _b = _a.className, className = _b === void 0 ? '' : _b, tree = _a.tree, renderItem = _a.renderItem, rootItem = _a.rootItem, _c = _a.renderUnselected, renderUnselected = _c === void 0 ? true : _c, _d = _a.renderEmpty, renderEmpty = _d === void 0 ? true : _d, ulProps = _a.ulProps, liProps = _a.liProps;
18
- var hasSelectedChildren = function (items) {
19
- return !checkIfSelected(items);
20
- };
21
- /**
22
- * Checks if the selected item is actually selected or just expanded by
23
- * checking if any of its immediate children has selection active
24
- * @param items
25
- */
26
- var checkIfSelected = function (items) {
27
- if (!items || items.length < 1) {
28
- return true;
29
- }
30
- return !items.some(function (item) { return !!item.selected; });
31
- };
32
- var renderTreeItems = function (treeItems, level) {
33
- return (React.createElement(ItemList, { className: appendClassNames("humany-item-tree-level-".concat(level)), items: treeItems, ulProps: ulProps, renderItem: function (itemProps) {
34
- var id = itemProps.id, selected = itemProps.selected, items = itemProps.items, matches = itemProps.matches;
35
- var isSelected = selected && checkIfSelected(items);
36
- if (!renderEmpty && !matches) {
37
- return null;
38
- }
39
- return (React.createElement("li", __assign({}, convertToStringAttributes(liProps), { key: id, className: 'humany-item-tree-item' }),
40
- renderItem && renderItem(itemProps, level, isSelected),
41
- items &&
42
- (renderUnselected || isSelected) &&
43
- renderTreeItems(items, level + 1)));
44
- } }));
45
- };
46
- return (React.createElement("div", { className: appendClassNames(className, 'humany-item-tree') },
47
- rootItem && rootItem(!hasSelectedChildren(tree || [])),
48
- tree && renderTreeItems(tree, 1)));
49
- };
50
- export default ItemTree;
@@ -1,64 +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 __read = (this && this.__read) || function (o, n) {
17
- var m = typeof Symbol === "function" && o[Symbol.iterator];
18
- if (!m) return o;
19
- var i = m.call(o), r, ar = [], e;
20
- try {
21
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
22
- }
23
- catch (error) { e = { error: error }; }
24
- finally {
25
- try {
26
- if (r && !r.done && (m = i["return"])) m.call(i);
27
- }
28
- finally { if (e) throw e.error; }
29
- }
30
- return ar;
31
- };
32
- import React, { useCallback, useEffect } from 'react';
33
- import styled from 'styled-components';
34
- import { useKeyPress, useToggle } from '../hooks';
35
- import Button from './button';
36
- import Overlay from './overlay';
37
- import SymbolBadge from './symbol-badge';
38
- var Lightbox = function (_a) {
39
- var attrs = _a.attrs;
40
- var _b = __read(useToggle(false), 2), visible = _b[0], toggleVisible = _b[1];
41
- var esc = useKeyPress('Escape');
42
- useEffect(function () {
43
- if (esc) {
44
- toggleVisible(false);
45
- }
46
- }, [esc]);
47
- var overlayClick = useCallback(function (e) {
48
- toggleVisible(false);
49
- }, [toggleVisible]);
50
- return (React.createElement(React.Fragment, null,
51
- React.createElement(Overlay, { visible: visible, onClick: overlayClick },
52
- React.createElement(CloseButton, { onClick: function () { return toggleVisible(false); } },
53
- React.createElement(StyledSymbolBadge, { size: 24, symbol: { type: 'Svg', content: 'close' } })),
54
- React.createElement(Content, null,
55
- React.createElement("img", __assign({}, attrs)))),
56
- React.createElement("a", { onClick: function () { return toggleVisible(); } },
57
- React.createElement(Thumbnail, __assign({}, attrs)))));
58
- };
59
- var Content = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: ", ";\n max-width: 80%;\n max-height: 80%;\n\n img {\n width: auto !important;\n height: auto !important;\n max-width: 100%;\n max-height: 100%;\n }\n"], ["\n padding: ", ";\n max-width: 80%;\n max-height: 80%;\n\n img {\n width: auto !important;\n height: auto !important;\n max-width: 100%;\n max-height: 100%;\n }\n"])), function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.normal; });
60
- var CloseButton = styled(Button)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: fixed;\n top: 50px;\n right: 50px;\n transition: opacity 300ms ease-in-out;\n opacity: 0.7;\n\n &:hover {\n opacity: 1;\n }\n"], ["\n position: fixed;\n top: 50px;\n right: 50px;\n transition: opacity 300ms ease-in-out;\n opacity: 0.7;\n\n &:hover {\n opacity: 1;\n }\n"])));
61
- var StyledSymbolBadge = styled(SymbolBadge)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n path {\n stroke: #ffffff;\n }\n"], ["\n path {\n stroke: #ffffff;\n }\n"])));
62
- var Thumbnail = styled.img(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n cursor: pointer;\n"], ["\n cursor: pointer;\n"])));
63
- export default Lightbox;
64
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
@@ -1,71 +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
- import RouteLink from './route-link';
32
- export default forwardRef(function (_a, ref) {
33
- var className = _a.className, _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.role, role = _c === void 0 ? 'link' : _c, _d = _a.tabIndex, tabIndex = _d === void 0 ? 0 : _d, _e = _a.onClick, onClick = _e === void 0 ? function () { } : _e, _f = _a.onKeyDown, onKeyDown = _f === void 0 ? function () { } : _f, title = _a.title, href = _a.href, children = _a.children, target = _a.target, routeName = _a.routeName, params = _a.params, other = __rest(_a, ["className", "disabled", "role", "tabIndex", "onClick", "onKeyDown", "title", "href", "children", "target", "routeName", "params"]);
34
- var props = {
35
- title: title,
36
- disabled: disabled,
37
- role: role,
38
- tabIndex: tabIndex,
39
- className: appendClassNames(className, 'humany-link', [!!disabled, 'humany-disabled']),
40
- onClick: function (e) {
41
- e.persist();
42
- if (disabled) {
43
- e.preventDefault();
44
- return;
45
- }
46
- onClick(e);
47
- },
48
- onKeyDown: function (e) {
49
- e.persist();
50
- if (disabled) {
51
- if (e.key !== 'Tab') {
52
- e.preventDefault();
53
- }
54
- return;
55
- }
56
- onKeyDown(e);
57
- },
58
- };
59
- return routeName ? (React.createElement(StyledRouteLink, __assign({ name: routeName, params: params }, props, convertToStringAttributes(other), { ref: ref }), children)) : (React.createElement(StyledLink, __assign({ href: href, target: target }, props, convertToStringAttributes(other), { ref: ref }), children));
60
- });
61
- var StyledRouteLink = styled(RouteLink)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (p) {
62
- return p.disabled
63
- ? "\n pointer-events: none;\n opacity: .7;\n "
64
- : 'cursor: pointer;';
65
- });
66
- var StyledLink = styled.a(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (p) {
67
- return p.disabled
68
- ? "\n pointer-events: none;\n opacity: .7;\n "
69
- : 'cursor: pointer;';
70
- });
71
- var templateObject_1, templateObject_2;
@@ -1,31 +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, { forwardRef } from 'react';
25
- import { convertToStringAttributes } from '../utils';
26
- export default forwardRef(function (_a, ref) {
27
- var className = _a.className, items = _a.items, renderItem = _a.renderItem, _b = _a.renderLi, renderLi = _b === void 0 ? false : _b, other = __rest(_a, ["className", "items", "renderItem", "renderLi"]);
28
- return (React.createElement("ul", __assign({ className: appendClassNames(className, 'humany-list'), "data-item-count": items.length }, convertToStringAttributes(other), { ref: ref }), items.map(function (item, index, items) {
29
- return renderLi ? (React.createElement("li", { className: "humany-list-item", key: item.id }, renderItem(item, index, items))) : (renderItem(item, index, items));
30
- })));
31
- });
@@ -1,33 +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
- import React, { useCallback, useRef } from 'react';
6
- import styled from 'styled-components';
7
- import { Button } from '..';
8
- import { borderTabStyle, StyledText } from '../../styles';
9
- import Modal from './modal';
10
- var Confirm = function (_a) {
11
- var className = _a.className, trigger = _a.trigger, _b = _a.header, header = _b === void 0 ? '' : _b, _c = _a.text, text = _c === void 0 ? '' : _c, _d = _a.onCancel, onCancel = _d === void 0 ? function () { } : _d, _e = _a.onConfirm, onConfirm = _e === void 0 ? function () { } : _e, _f = _a.cancelLabel, cancelLabel = _f === void 0 ? '' : _f, _g = _a.confirmLabel, confirmLabel = _g === void 0 ? '' : _g;
12
- var ref = useRef();
13
- var cancel = useCallback(function () {
14
- var _a;
15
- onCancel();
16
- (_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.close();
17
- }, [onCancel]);
18
- var confirm = useCallback(function () {
19
- var _a;
20
- onConfirm();
21
- (_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.close();
22
- }, [onConfirm]);
23
- return (React.createElement(StyledModal, { className: className, trigger: trigger, ref: ref, onOverlayClick: cancel },
24
- header && React.createElement(StyledText, null, header),
25
- text && React.createElement(StyledText, null, text),
26
- confirmLabel && (React.createElement(StyledConfirmButton, { onClick: confirm }, confirmLabel)),
27
- cancelLabel && React.createElement(StyledCancelButton, { onClick: cancel }, cancelLabel)));
28
- };
29
- export default Confirm;
30
- var StyledModal = styled(Modal)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: block;\n\n span {\n display: block;\n margin: 0 0 ", ";\n\n &:first-of-type:not(:only-of-type) {\n font-weight: 700;\n margin: 0 0 ", ";\n }\n }\n"], ["\n display: block;\n\n span {\n display: block;\n margin: 0 0 ", ";\n\n &:first-of-type:not(:only-of-type) {\n font-weight: 700;\n margin: 0 0 ", ";\n }\n }\n"])), function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.normal; }, function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.small; });
31
- var StyledConfirmButton = styled(Button)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: inline-block;\n min-width: 50px;\n ", "\n ", "\n color: #FFFFFF;\n background-color: ", ";\n border: 1px solid ", ";\n\n margin: 0 ", " 0 0;\n\n &:focus {\n ", ";\n background-color: transparent;\n }\n"], ["\n display: inline-block;\n min-width: 50px;\n ", "\n ", "\n color: #FFFFFF;\n background-color: ", ";\n border: 1px solid ", ";\n\n margin: 0 ", " 0 0;\n\n &:focus {\n ", ";\n background-color: transparent;\n }\n"])), function (p) { var _a, _b; return "padding: ".concat((_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.small, " ").concat((_b = p.theme.sizes) === null || _b === void 0 ? void 0 : _b.normal, ";"); }, function (p) { return p.theme.borderRadius && "border-radius: ".concat(p.theme.borderRadius, ";"); }, function (p) { var _a; return (_a = p.theme.colors) === null || _a === void 0 ? void 0 : _a.primary; }, function (p) { var _a; return (_a = p.theme.colors) === null || _a === void 0 ? void 0 : _a.primary; }, function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.small; }, function (p) { var _a; return ((_a = p.theme.accessibility) === null || _a === void 0 ? void 0 : _a.isTabbing) && borderTabStyle; });
32
- var StyledCancelButton = styled(Button)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: inline-block;\n min-width: 50px;\n ", "\n ", "\n background-color: transparent;\n color: ", ";\n border: 1px solid ", ";\n\n &:focus {\n ", ";\n }\n"], ["\n display: inline-block;\n min-width: 50px;\n ", "\n ", "\n background-color: transparent;\n color: ", ";\n border: 1px solid ", ";\n\n &:focus {\n ", ";\n }\n"])), function (p) { var _a, _b; return "padding: ".concat((_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.small, " ").concat((_b = p.theme.sizes) === null || _b === void 0 ? void 0 : _b.normal, ";"); }, function (p) { return p.theme.borderRadius && "border-radius: ".concat(p.theme.borderRadius, ";"); }, 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.colors) === null || _a === void 0 ? void 0 : _a.text; }, function (p) { var _a; return ((_a = p.theme.accessibility) === null || _a === void 0 ? void 0 : _a.isTabbing) && borderTabStyle; });
33
- var templateObject_1, templateObject_2, templateObject_3;
@@ -1,3 +0,0 @@
1
- import Modal from './modal';
2
- export { default as Confirm } from './confirm';
3
- export default Modal;