@chayns-components/core 5.0.0-beta.44 → 5.0.0-beta.441

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 (444) hide show
  1. package/README.md +3 -19
  2. package/lib/api/image/post.d.ts +16 -0
  3. package/lib/api/image/post.js +34 -0
  4. package/lib/api/image/post.js.map +1 -0
  5. package/lib/api/signature/delete.d.ts +1 -0
  6. package/lib/api/signature/delete.js +34 -0
  7. package/lib/api/signature/delete.js.map +1 -0
  8. package/lib/api/signature/get.d.ts +1 -0
  9. package/lib/api/signature/get.js +40 -0
  10. package/lib/api/signature/get.js.map +1 -0
  11. package/lib/api/signature/put.d.ts +1 -0
  12. package/lib/api/signature/put.js +38 -0
  13. package/lib/api/signature/put.js.map +1 -0
  14. package/lib/api/theme/get.d.ts +2 -0
  15. package/lib/api/theme/get.js +21 -0
  16. package/lib/api/theme/get.js.map +1 -0
  17. package/lib/api/video/post.d.ts +16 -0
  18. package/lib/api/video/post.js +31 -0
  19. package/lib/api/video/post.js.map +1 -0
  20. package/lib/components/accordion/Accordion.d.ts +32 -3
  21. package/lib/components/accordion/Accordion.js +61 -22
  22. package/lib/components/accordion/Accordion.js.map +1 -1
  23. package/lib/components/accordion/Accordion.styles.d.ts +6 -4
  24. package/lib/components/accordion/Accordion.styles.js +55 -33
  25. package/lib/components/accordion/Accordion.styles.js.map +1 -1
  26. package/lib/components/accordion/accordion-body/AccordionBody.d.ts +21 -2
  27. package/lib/components/accordion/accordion-body/AccordionBody.js +17 -11
  28. package/lib/components/accordion/accordion-body/AccordionBody.js.map +1 -1
  29. package/lib/components/accordion/accordion-body/AccordionBody.styles.d.ts +268 -1
  30. package/lib/components/accordion/accordion-body/AccordionBody.styles.js +14 -4
  31. package/lib/components/accordion/accordion-body/AccordionBody.styles.js.map +1 -1
  32. package/lib/components/accordion/accordion-content/AccordionContent.d.ts +9 -2
  33. package/lib/components/accordion/accordion-content/AccordionContent.js +5 -4
  34. package/lib/components/accordion/accordion-content/AccordionContent.js.map +1 -1
  35. package/lib/components/accordion/accordion-content/AccordionContent.styles.d.ts +6 -4
  36. package/lib/components/accordion/accordion-content/AccordionContent.styles.js +3 -4
  37. package/lib/components/accordion/accordion-content/AccordionContent.styles.js.map +1 -1
  38. package/lib/components/accordion/accordion-group/AccordionGroup.d.ts +4 -3
  39. package/lib/components/accordion/accordion-group/AccordionGroup.js +6 -6
  40. package/lib/components/accordion/accordion-group/AccordionGroup.js.map +1 -1
  41. package/lib/components/accordion/accordion-head/AccordionHead.d.ts +3 -1
  42. package/lib/components/accordion/accordion-head/AccordionHead.js +32 -14
  43. package/lib/components/accordion/accordion-head/AccordionHead.js.map +1 -1
  44. package/lib/components/accordion/accordion-head/AccordionHead.styles.d.ts +2421 -12
  45. package/lib/components/accordion/accordion-head/AccordionHead.styles.js +56 -39
  46. package/lib/components/accordion/accordion-head/AccordionHead.styles.js.map +1 -1
  47. package/lib/components/accordion/accordion-intro/AccordionIntro.d.ts +1 -1
  48. package/lib/components/accordion/accordion-intro/AccordionIntro.js +1 -2
  49. package/lib/components/accordion/accordion-intro/AccordionIntro.js.map +1 -1
  50. package/lib/components/accordion/accordion-intro/AccordionIntro.styles.d.ts +2 -1
  51. package/lib/components/accordion/accordion-intro/AccordionIntro.styles.js +1 -2
  52. package/lib/components/accordion/accordion-intro/AccordionIntro.styles.js.map +1 -1
  53. package/lib/components/accordion/accordion-item/AccordionItem.d.ts +9 -0
  54. package/lib/components/accordion/accordion-item/AccordionItem.js +27 -0
  55. package/lib/components/accordion/accordion-item/AccordionItem.js.map +1 -0
  56. package/lib/components/accordion/accordion-item/AccordionItem.styles.d.ts +7 -0
  57. package/lib/components/accordion/accordion-item/AccordionItem.styles.js +33 -0
  58. package/lib/components/accordion/accordion-item/AccordionItem.styles.js.map +1 -0
  59. package/lib/components/amount-control/AmountControl.d.ts +22 -0
  60. package/lib/components/amount-control/AmountControl.js +185 -0
  61. package/lib/components/amount-control/AmountControl.js.map +1 -0
  62. package/lib/components/amount-control/AmountControl.styles.d.ts +288 -0
  63. package/lib/components/amount-control/AmountControl.styles.js +58 -0
  64. package/lib/components/amount-control/AmountControl.styles.js.map +1 -0
  65. package/lib/components/badge/Badge.d.ts +1 -1
  66. package/lib/components/badge/Badge.js +1 -2
  67. package/lib/components/badge/Badge.js.map +1 -1
  68. package/lib/components/badge/Badge.styles.d.ts +5 -3
  69. package/lib/components/badge/Badge.styles.js +3 -4
  70. package/lib/components/badge/Badge.styles.js.map +1 -1
  71. package/lib/components/button/Button.d.ts +6 -2
  72. package/lib/components/button/Button.js +56 -4
  73. package/lib/components/button/Button.js.map +1 -1
  74. package/lib/components/button/Button.styles.d.ts +539 -4
  75. package/lib/components/button/Button.styles.js +43 -17
  76. package/lib/components/button/Button.styles.js.map +1 -1
  77. package/lib/components/checkbox/Checkbox.d.ts +11 -3
  78. package/lib/components/checkbox/Checkbox.js +13 -8
  79. package/lib/components/checkbox/Checkbox.js.map +1 -1
  80. package/lib/components/checkbox/Checkbox.styles.d.ts +12 -5
  81. package/lib/components/checkbox/Checkbox.styles.js +51 -36
  82. package/lib/components/checkbox/Checkbox.styles.js.map +1 -1
  83. package/lib/components/color-scheme-provider/ColorSchemeProvider.d.ts +8 -2
  84. package/lib/components/color-scheme-provider/ColorSchemeProvider.js +56 -24
  85. package/lib/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
  86. package/lib/components/combobox/ComboBox.d.ts +43 -0
  87. package/lib/components/combobox/ComboBox.js +192 -0
  88. package/lib/components/combobox/ComboBox.js.map +1 -0
  89. package/lib/components/combobox/ComboBox.styles.d.ts +291 -0
  90. package/lib/components/combobox/ComboBox.styles.js +206 -0
  91. package/lib/components/combobox/ComboBox.styles.js.map +1 -0
  92. package/lib/components/combobox/combobox-item/ComboBoxItem.d.ts +12 -0
  93. package/lib/components/combobox/combobox-item/ComboBoxItem.js +40 -0
  94. package/lib/components/combobox/combobox-item/ComboBoxItem.js.map +1 -0
  95. package/lib/components/combobox/combobox-item/ComboBoxItem.styles.d.ts +11 -0
  96. package/lib/components/combobox/combobox-item/ComboBoxItem.styles.js +62 -0
  97. package/lib/components/combobox/combobox-item/ComboBoxItem.styles.js.map +1 -0
  98. package/lib/components/content-card/ContentCard.d.ts +13 -0
  99. package/lib/components/content-card/ContentCard.js +21 -0
  100. package/lib/components/content-card/ContentCard.js.map +1 -0
  101. package/lib/components/content-card/ContentCard.styles.d.ts +2 -0
  102. package/lib/components/content-card/ContentCard.styles.js +39 -0
  103. package/lib/components/content-card/ContentCard.styles.js.map +1 -0
  104. package/lib/components/context-menu/ContextMenu.d.ts +6 -6
  105. package/lib/components/context-menu/ContextMenu.js +25 -26
  106. package/lib/components/context-menu/ContextMenu.js.map +1 -1
  107. package/lib/components/context-menu/ContextMenu.styles.d.ts +2 -1
  108. package/lib/components/context-menu/ContextMenu.styles.js +1 -2
  109. package/lib/components/context-menu/ContextMenu.styles.js.map +1 -1
  110. package/lib/components/context-menu/context-menu-content/ContextMenuContent.d.ts +2 -2
  111. package/lib/components/context-menu/context-menu-content/ContextMenuContent.js +9 -8
  112. package/lib/components/context-menu/context-menu-content/ContextMenuContent.js.map +1 -1
  113. package/lib/components/context-menu/context-menu-content/ContextMenuContent.styles.d.ts +274 -9
  114. package/lib/components/context-menu/context-menu-content/ContextMenuContent.styles.js +19 -24
  115. package/lib/components/context-menu/context-menu-content/ContextMenuContent.styles.js.map +1 -1
  116. package/lib/components/file-input/FileInput.d.ts +29 -0
  117. package/lib/components/file-input/FileInput.js +121 -0
  118. package/lib/components/file-input/FileInput.js.map +1 -0
  119. package/lib/components/file-input/FileInput.styles.d.ts +277 -0
  120. package/lib/components/file-input/FileInput.styles.js +46 -0
  121. package/lib/components/file-input/FileInput.styles.js.map +1 -0
  122. package/lib/components/file-input/file-list/FileListItem.d.ts +9 -0
  123. package/lib/components/file-input/file-list/FileListItem.js +36 -0
  124. package/lib/components/file-input/file-list/FileListItem.js.map +1 -0
  125. package/lib/components/file-input/file-list/FileListItem.styles.d.ts +2 -0
  126. package/lib/components/file-input/file-list/FileListItem.styles.js +10 -0
  127. package/lib/components/file-input/file-list/FileListItem.styles.js.map +1 -0
  128. package/lib/components/filter-buttons/FilterButtons.d.ts +22 -0
  129. package/lib/components/filter-buttons/FilterButtons.js +88 -0
  130. package/lib/components/filter-buttons/FilterButtons.js.map +1 -0
  131. package/lib/components/filter-buttons/FilterButtons.styles.d.ts +2 -0
  132. package/lib/components/filter-buttons/FilterButtons.styles.js +14 -0
  133. package/lib/components/filter-buttons/FilterButtons.styles.js.map +1 -0
  134. package/lib/components/filter-buttons/filter-button/FilterButton.d.ts +14 -0
  135. package/lib/components/filter-buttons/filter-button/FilterButton.js +47 -0
  136. package/lib/components/filter-buttons/filter-button/FilterButton.js.map +1 -0
  137. package/lib/components/filter-buttons/filter-button/FilterButton.styles.d.ts +287 -0
  138. package/lib/components/filter-buttons/filter-button/FilterButton.styles.js +106 -0
  139. package/lib/components/filter-buttons/filter-button/FilterButton.styles.js.map +1 -0
  140. package/lib/components/grid-image/GridImage.d.ts +1 -1
  141. package/lib/components/grid-image/GridImage.js +3 -4
  142. package/lib/components/grid-image/GridImage.js.map +1 -1
  143. package/lib/components/grid-image/GridImage.styles.d.ts +12 -11
  144. package/lib/components/grid-image/GridImage.styles.js +4 -8
  145. package/lib/components/grid-image/GridImage.styles.js.map +1 -1
  146. package/lib/components/icon/Icon.d.ts +1 -1
  147. package/lib/components/icon/Icon.js +7 -6
  148. package/lib/components/icon/Icon.js.map +1 -1
  149. package/lib/components/icon/Icon.styles.d.ts +7 -7
  150. package/lib/components/icon/Icon.styles.js +6 -8
  151. package/lib/components/icon/Icon.styles.js.map +1 -1
  152. package/lib/components/input/Input.d.ts +43 -3
  153. package/lib/components/input/Input.js +65 -15
  154. package/lib/components/input/Input.js.map +1 -1
  155. package/lib/components/input/Input.styles.d.ts +548 -6
  156. package/lib/components/input/Input.styles.js +104 -34
  157. package/lib/components/input/Input.styles.js.map +1 -1
  158. package/lib/components/list/List.d.ts +1 -1
  159. package/lib/components/list/List.js +4 -6
  160. package/lib/components/list/List.js.map +1 -1
  161. package/lib/components/list/list-item/ListItem.d.ts +2 -2
  162. package/lib/components/list/list-item/ListItem.js +7 -6
  163. package/lib/components/list/list-item/ListItem.js.map +1 -1
  164. package/lib/components/list/list-item/ListItem.styles.d.ts +6 -4
  165. package/lib/components/list/list-item/ListItem.styles.js +14 -26
  166. package/lib/components/list/list-item/ListItem.styles.js.map +1 -1
  167. package/lib/components/list/list-item/list-item-body/ListItemBody.d.ts +6 -2
  168. package/lib/components/list/list-item/list-item-body/ListItemBody.js +28 -7
  169. package/lib/components/list/list-item/list-item-body/ListItemBody.js.map +1 -1
  170. package/lib/components/list/list-item/list-item-body/ListItemBody.styles.d.ts +267 -1
  171. package/lib/components/list/list-item/list-item-body/ListItemBody.styles.js +1 -2
  172. package/lib/components/list/list-item/list-item-body/ListItemBody.styles.js.map +1 -1
  173. package/lib/components/list/list-item/list-item-content/ListItemContent.d.ts +8 -2
  174. package/lib/components/list/list-item/list-item-content/ListItemContent.js +1 -2
  175. package/lib/components/list/list-item/list-item-content/ListItemContent.js.map +1 -1
  176. package/lib/components/list/list-item/list-item-content/ListItemContent.styles.d.ts +2 -1
  177. package/lib/components/list/list-item/list-item-content/ListItemContent.styles.js +1 -2
  178. package/lib/components/list/list-item/list-item-content/ListItemContent.styles.js.map +1 -1
  179. package/lib/components/list/list-item/list-item-head/ListItemHead.d.ts +1 -1
  180. package/lib/components/list/list-item/list-item-head/ListItemHead.js +4 -5
  181. package/lib/components/list/list-item/list-item-head/ListItemHead.js.map +1 -1
  182. package/lib/components/list/list-item/list-item-head/ListItemHead.styles.d.ts +544 -14
  183. package/lib/components/list/list-item/list-item-head/ListItemHead.styles.js +13 -24
  184. package/lib/components/list/list-item/list-item-head/ListItemHead.styles.js.map +1 -1
  185. package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.d.ts +1 -1
  186. package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.js +1 -2
  187. package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.js.map +1 -1
  188. package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.styles.d.ts +2 -1
  189. package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.styles.js +1 -2
  190. package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.styles.js.map +1 -1
  191. package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.d.ts +1 -1
  192. package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.js +3 -4
  193. package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.js.map +1 -1
  194. package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.styles.d.ts +8 -7
  195. package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.styles.js +2 -4
  196. package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.styles.js.map +1 -1
  197. package/lib/components/mention-finder/MentionFinder.d.ts +31 -0
  198. package/lib/components/mention-finder/MentionFinder.js +139 -0
  199. package/lib/components/mention-finder/MentionFinder.js.map +1 -0
  200. package/lib/components/mention-finder/MentionFinder.styles.d.ts +270 -0
  201. package/lib/components/mention-finder/MentionFinder.styles.js +92 -0
  202. package/lib/components/mention-finder/MentionFinder.styles.js.map +1 -0
  203. package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.d.ts +10 -0
  204. package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.js +31 -0
  205. package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.js.map +1 -0
  206. package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.styles.d.ts +10 -0
  207. package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.styles.js +91 -0
  208. package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.styles.js.map +1 -0
  209. package/lib/components/number-input/NumberInput.d.ts +54 -0
  210. package/lib/components/number-input/NumberInput.js +142 -0
  211. package/lib/components/number-input/NumberInput.js.map +1 -0
  212. package/lib/components/popup/Popup.d.ts +30 -0
  213. package/lib/components/popup/Popup.js +161 -0
  214. package/lib/components/popup/Popup.js.map +1 -0
  215. package/lib/components/popup/Popup.styles.d.ts +5 -0
  216. package/lib/components/popup/Popup.styles.js +28 -0
  217. package/lib/components/popup/Popup.styles.js.map +1 -0
  218. package/lib/components/popup/popup-content/PopupContent.d.ts +10 -0
  219. package/lib/components/popup/popup-content/PopupContent.js +69 -0
  220. package/lib/components/popup/popup-content/PopupContent.js.map +1 -0
  221. package/lib/components/popup/popup-content/PopupContent.styles.d.ts +274 -0
  222. package/lib/components/popup/popup-content/PopupContent.styles.js +92 -0
  223. package/lib/components/popup/popup-content/PopupContent.styles.js.map +1 -0
  224. package/lib/components/progress-bar/ProgressBar.d.ts +13 -0
  225. package/lib/components/progress-bar/ProgressBar.js +39 -0
  226. package/lib/components/progress-bar/ProgressBar.js.map +1 -0
  227. package/lib/components/progress-bar/ProgressBar.styles.d.ts +272 -0
  228. package/lib/components/progress-bar/ProgressBar.styles.js +37 -0
  229. package/lib/components/progress-bar/ProgressBar.styles.js.map +1 -0
  230. package/lib/components/radio-button/RadioButton.d.ts +30 -0
  231. package/lib/components/radio-button/RadioButton.js +100 -0
  232. package/lib/components/radio-button/RadioButton.js.map +1 -0
  233. package/lib/components/radio-button/RadioButton.styles.d.ts +287 -0
  234. package/lib/components/radio-button/RadioButton.styles.js +105 -0
  235. package/lib/components/radio-button/RadioButton.styles.js.map +1 -0
  236. package/lib/components/radio-button/radio-button-group/RadioButtonGroup.d.ts +17 -0
  237. package/lib/components/radio-button/radio-button-group/RadioButtonGroup.js +46 -0
  238. package/lib/components/radio-button/radio-button-group/RadioButtonGroup.js.map +1 -0
  239. package/lib/components/scroll-view/ScrollView.d.ts +13 -0
  240. package/lib/components/scroll-view/ScrollView.js +27 -0
  241. package/lib/components/scroll-view/ScrollView.js.map +1 -0
  242. package/lib/components/scroll-view/ScrollView.styles.d.ts +9 -0
  243. package/lib/components/scroll-view/ScrollView.styles.js +49 -0
  244. package/lib/components/scroll-view/ScrollView.styles.js.map +1 -0
  245. package/lib/components/search-box/SearchBox.d.ts +38 -0
  246. package/lib/components/search-box/SearchBox.js +255 -0
  247. package/lib/components/search-box/SearchBox.js.map +1 -0
  248. package/lib/components/search-box/SearchBox.styles.d.ts +274 -0
  249. package/lib/components/search-box/SearchBox.styles.js +79 -0
  250. package/lib/components/search-box/SearchBox.styles.js.map +1 -0
  251. package/lib/components/search-box/search-box-item/SearchBoxItem.d.ts +11 -0
  252. package/lib/components/search-box/search-box-item/SearchBoxItem.js +35 -0
  253. package/lib/components/search-box/search-box-item/SearchBoxItem.js.map +1 -0
  254. package/lib/components/search-box/search-box-item/SearchBoxItem.styles.d.ts +13 -0
  255. package/lib/components/search-box/search-box-item/SearchBoxItem.styles.js +63 -0
  256. package/lib/components/search-box/search-box-item/SearchBoxItem.styles.js.map +1 -0
  257. package/lib/components/search-input/SearchInput.d.ts +33 -0
  258. package/lib/components/search-input/SearchInput.js +102 -0
  259. package/lib/components/search-input/SearchInput.js.map +1 -0
  260. package/lib/components/search-input/SearchInput.styles.d.ts +534 -0
  261. package/lib/components/search-input/SearchInput.styles.js +26 -0
  262. package/lib/components/search-input/SearchInput.styles.js.map +1 -0
  263. package/lib/components/select-button/SelectButton.d.ts +34 -0
  264. package/lib/components/select-button/SelectButton.js +65 -0
  265. package/lib/components/select-button/SelectButton.js.map +1 -0
  266. package/lib/components/select-button/SelectButton.styles.d.ts +2 -0
  267. package/lib/components/select-button/SelectButton.styles.js +10 -0
  268. package/lib/components/select-button/SelectButton.styles.js.map +1 -0
  269. package/lib/components/setup-wizard/SetupWizard.d.ts +23 -0
  270. package/lib/components/setup-wizard/SetupWizard.js +79 -0
  271. package/lib/components/setup-wizard/SetupWizard.js.map +1 -0
  272. package/lib/components/setup-wizard/SetupWizard.styles.d.ts +2 -0
  273. package/lib/components/setup-wizard/SetupWizard.styles.js +10 -0
  274. package/lib/components/setup-wizard/SetupWizard.styles.js.map +1 -0
  275. package/lib/components/setup-wizard/setup-wizard-item/SetupWizardItem.d.ts +25 -0
  276. package/lib/components/setup-wizard/setup-wizard-item/SetupWizardItem.js +60 -0
  277. package/lib/components/setup-wizard/setup-wizard-item/SetupWizardItem.js.map +1 -0
  278. package/lib/components/setup-wizard/setup-wizard-item/SetupWizardItem.styles.d.ts +3 -0
  279. package/lib/components/setup-wizard/setup-wizard-item/SetupWizardItem.styles.js +14 -0
  280. package/lib/components/setup-wizard/setup-wizard-item/SetupWizardItem.styles.js.map +1 -0
  281. package/lib/components/sharing-bar/SharingBar.d.ts +18 -0
  282. package/lib/components/sharing-bar/SharingBar.js +110 -0
  283. package/lib/components/sharing-bar/SharingBar.js.map +1 -0
  284. package/lib/components/sharing-bar/SharingBar.styles.d.ts +6 -0
  285. package/lib/components/sharing-bar/SharingBar.styles.js +24 -0
  286. package/lib/components/sharing-bar/SharingBar.styles.js.map +1 -0
  287. package/lib/components/signature/Signature.d.ts +33 -0
  288. package/lib/components/signature/Signature.js +104 -0
  289. package/lib/components/signature/Signature.js.map +1 -0
  290. package/lib/components/signature/Signature.styles.d.ts +5 -0
  291. package/lib/components/signature/Signature.styles.js +21 -0
  292. package/lib/components/signature/Signature.styles.js.map +1 -0
  293. package/lib/components/slider/Slider.d.ts +45 -0
  294. package/lib/components/slider/Slider.js +183 -0
  295. package/lib/components/slider/Slider.js.map +1 -0
  296. package/lib/components/slider/Slider.styles.d.ts +16 -0
  297. package/lib/components/slider/Slider.styles.js +106 -0
  298. package/lib/components/slider/Slider.styles.js.map +1 -0
  299. package/lib/components/slider-button/SliderButton.d.ts +23 -0
  300. package/lib/components/slider-button/SliderButton.js +156 -0
  301. package/lib/components/slider-button/SliderButton.js.map +1 -0
  302. package/lib/components/slider-button/SliderButton.styles.d.ts +279 -0
  303. package/lib/components/slider-button/SliderButton.styles.js +69 -0
  304. package/lib/components/slider-button/SliderButton.styles.js.map +1 -0
  305. package/lib/components/small-wait-cursor/SmallWaitCursor.d.ts +31 -0
  306. package/lib/components/small-wait-cursor/SmallWaitCursor.js +42 -0
  307. package/lib/components/small-wait-cursor/SmallWaitCursor.js.map +1 -0
  308. package/lib/components/small-wait-cursor/SmallWaitCursor.styles.d.ts +19 -0
  309. package/lib/components/small-wait-cursor/SmallWaitCursor.styles.js +101 -0
  310. package/lib/components/small-wait-cursor/SmallWaitCursor.styles.js.map +1 -0
  311. package/lib/components/tag-input/TagInput.d.ts +22 -0
  312. package/lib/components/tag-input/TagInput.js +88 -0
  313. package/lib/components/tag-input/TagInput.js.map +1 -0
  314. package/lib/components/tag-input/TagInput.styles.d.ts +9 -0
  315. package/lib/components/tag-input/TagInput.styles.js +48 -0
  316. package/lib/components/tag-input/TagInput.styles.js.map +1 -0
  317. package/lib/components/text-area/TextArea.d.ts +29 -0
  318. package/lib/components/text-area/TextArea.js +57 -0
  319. package/lib/components/text-area/TextArea.js.map +1 -0
  320. package/lib/components/text-area/TextArea.styles.d.ts +15 -0
  321. package/lib/components/text-area/TextArea.styles.js +101 -0
  322. package/lib/components/text-area/TextArea.styles.js.map +1 -0
  323. package/lib/components/tooltip/Tooltip.d.ts +22 -0
  324. package/lib/components/tooltip/Tooltip.js +36 -0
  325. package/lib/components/tooltip/Tooltip.js.map +1 -0
  326. package/lib/components/tooltip/Tooltip.styles.d.ts +2 -0
  327. package/lib/components/tooltip/Tooltip.styles.js +10 -0
  328. package/lib/components/tooltip/Tooltip.styles.js.map +1 -0
  329. package/lib/components/tooltip/tooltip-item/TooltipItem.d.ts +13 -0
  330. package/lib/components/tooltip/tooltip-item/TooltipItem.js +31 -0
  331. package/lib/components/tooltip/tooltip-item/TooltipItem.js.map +1 -0
  332. package/lib/components/tooltip/tooltip-item/TooltipItem.styles.d.ts +15 -0
  333. package/lib/components/tooltip/tooltip-item/TooltipItem.styles.js +44 -0
  334. package/lib/components/tooltip/tooltip-item/TooltipItem.styles.js.map +1 -0
  335. package/lib/components/truncation/Truncation.d.ts +29 -0
  336. package/lib/components/truncation/Truncation.js +136 -0
  337. package/lib/components/truncation/Truncation.js.map +1 -0
  338. package/lib/components/truncation/Truncation.styles.d.ts +270 -0
  339. package/lib/components/truncation/Truncation.styles.js +27 -0
  340. package/lib/components/truncation/Truncation.styles.js.map +1 -0
  341. package/lib/constants/mentionFinder.d.ts +4 -0
  342. package/lib/constants/mentionFinder.js +12 -0
  343. package/lib/constants/mentionFinder.js.map +1 -0
  344. package/lib/constants/numberInput.d.ts +5 -0
  345. package/lib/constants/numberInput.js +12 -0
  346. package/lib/constants/numberInput.js.map +1 -0
  347. package/lib/constants/signature.d.ts +1 -0
  348. package/lib/constants/signature.js +8 -0
  349. package/lib/constants/signature.js.map +1 -0
  350. package/lib/hooks/colorMode.d.ts +2 -0
  351. package/lib/hooks/colorMode.js +20 -0
  352. package/lib/hooks/colorMode.js.map +1 -0
  353. package/lib/hooks/uuid.js.map +1 -1
  354. package/lib/index.d.ts +42 -0
  355. package/lib/index.js +237 -0
  356. package/lib/index.js.map +1 -1
  357. package/lib/types/chayns.d.ts +67 -1
  358. package/lib/types/chayns.js +3 -4
  359. package/lib/types/chayns.js.map +1 -1
  360. package/lib/types/colorSchemeProvider.d.ts +15 -0
  361. package/lib/types/colorSchemeProvider.js +15 -0
  362. package/lib/types/colorSchemeProvider.js.map +1 -0
  363. package/lib/types/comboBox.d.ts +4 -0
  364. package/lib/types/comboBox.js +12 -0
  365. package/lib/types/comboBox.js.map +1 -0
  366. package/lib/{components/context-menu/constants/alignment.js → types/contextMenu.js} +4 -5
  367. package/lib/types/contextMenu.js.map +1 -0
  368. package/lib/types/file.d.ts +42 -0
  369. package/lib/types/file.js +2 -0
  370. package/lib/types/file.js.map +1 -0
  371. package/lib/types/filterButtons.d.ts +15 -0
  372. package/lib/types/filterButtons.js +17 -0
  373. package/lib/types/filterButtons.js.map +1 -0
  374. package/lib/types/popup.d.ts +16 -0
  375. package/lib/types/popup.js +16 -0
  376. package/lib/types/popup.js.map +1 -0
  377. package/lib/types/radioButton.d.ts +4 -0
  378. package/lib/types/radioButton.js +2 -0
  379. package/lib/types/radioButton.js.map +1 -0
  380. package/lib/types/searchBox.d.ts +5 -0
  381. package/lib/types/searchBox.js +2 -0
  382. package/lib/types/searchBox.js.map +1 -0
  383. package/lib/types/selectButton.d.ts +4 -0
  384. package/lib/types/selectButton.js +2 -0
  385. package/lib/types/selectButton.js.map +1 -0
  386. package/lib/types/signature.d.ts +10 -0
  387. package/lib/types/signature.js +2 -0
  388. package/lib/types/signature.js.map +1 -0
  389. package/lib/types/slider-button.d.ts +4 -0
  390. package/lib/types/slider-button.js +2 -0
  391. package/lib/types/slider-button.js.map +1 -0
  392. package/lib/types/tagInput.d.ts +4 -0
  393. package/lib/types/tagInput.js +2 -0
  394. package/lib/types/tagInput.js.map +1 -0
  395. package/lib/types/tooltip.d.ts +9 -0
  396. package/lib/types/tooltip.js +2 -0
  397. package/lib/types/tooltip.js.map +1 -0
  398. package/lib/{components/accordion/utils.js → utils/accordion.js} +1 -1
  399. package/lib/utils/accordion.js.map +1 -0
  400. package/lib/utils/amountControl.d.ts +7 -0
  401. package/lib/utils/amountControl.js +22 -0
  402. package/lib/utils/amountControl.js.map +1 -0
  403. package/lib/utils/calculate.d.ts +5 -0
  404. package/lib/utils/calculate.js +73 -0
  405. package/lib/utils/calculate.js.map +1 -0
  406. package/lib/utils/file.d.ts +363 -0
  407. package/lib/utils/file.js +402 -0
  408. package/lib/utils/file.js.map +1 -0
  409. package/lib/utils/fileDialog.d.ts +7 -0
  410. package/lib/utils/fileDialog.js +73 -0
  411. package/lib/utils/fileDialog.js.map +1 -0
  412. package/lib/utils/font.d.ts +8 -0
  413. package/lib/utils/font.js +75 -0
  414. package/lib/utils/font.js.map +1 -0
  415. package/lib/{components/icon/utils.js → utils/icon.js} +2 -3
  416. package/lib/utils/icon.js.map +1 -0
  417. package/lib/utils/isTobitEmployee.d.ts +1 -0
  418. package/lib/utils/isTobitEmployee.js +28 -0
  419. package/lib/utils/isTobitEmployee.js.map +1 -0
  420. package/lib/utils/numberInput.d.ts +23 -0
  421. package/lib/utils/numberInput.js +92 -0
  422. package/lib/utils/numberInput.js.map +1 -0
  423. package/lib/utils/searchBox.d.ts +7 -0
  424. package/lib/utils/searchBox.js +23 -0
  425. package/lib/utils/searchBox.js.map +1 -0
  426. package/lib/utils/slider.d.ts +7 -0
  427. package/lib/utils/slider.js +35 -0
  428. package/lib/utils/slider.js.map +1 -0
  429. package/lib/utils/sliderButton.d.ts +15 -0
  430. package/lib/utils/sliderButton.js +53 -0
  431. package/lib/utils/sliderButton.js.map +1 -0
  432. package/lib/utils/truncation.d.ts +1 -0
  433. package/lib/utils/truncation.js +34 -0
  434. package/lib/utils/truncation.js.map +1 -0
  435. package/lib/utils/uploadFile.d.ts +9 -0
  436. package/lib/utils/uploadFile.js +47 -0
  437. package/lib/utils/uploadFile.js.map +1 -0
  438. package/package.json +24 -21
  439. package/lib/components/accordion/utils.js.map +0 -1
  440. package/lib/components/context-menu/constants/alignment.js.map +0 -1
  441. package/lib/components/icon/utils.js.map +0 -1
  442. /package/lib/{components/context-menu/constants/alignment.d.ts → types/contextMenu.d.ts} +0 -0
  443. /package/lib/{components/accordion/utils.d.ts → utils/accordion.d.ts} +0 -0
  444. /package/lib/{components/icon/utils.d.ts → utils/icon.d.ts} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tooltip.js","names":["_react","_interopRequireWildcard","require","_Popup","_interopRequireDefault","_TooltipItem","_Tooltip","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","Tooltip","_ref","item","children","isDisabled","itemWidth","tooltipRef","useRef","useMemo","createElement","StyledTooltip","shouldShowOnHover","content","width","text","headline","imageUrl","button","ref","displayName","_default","exports"],"sources":["../../../src/components/tooltip/Tooltip.tsx"],"sourcesContent":["import React, { FC, ReactNode, useMemo, useRef, type CSSProperties } from 'react';\nimport type { PopupRef } from '../../types/popup';\nimport type { ITooltipItem } from '../../types/tooltip';\nimport Popup from '../popup/Popup';\nimport TooltipItem from './tooltip-item/TooltipItem';\nimport { StyledTooltip } from './Tooltip.styles';\n\nexport type TooltipProps = {\n /**\n * The elements that the tooltip should surround.\n */\n children: ReactNode;\n /**\n * The content that should be displayed.\n */\n item: ITooltipItem;\n /**\n * The width of an item.\n */\n itemWidth?: CSSProperties['width'];\n /**\n * whether the tooltip should be shown.\n */\n isDisabled?: boolean;\n};\n\nconst Tooltip: FC<TooltipProps> = ({ item, children, isDisabled, itemWidth }) => {\n const tooltipRef = useRef<PopupRef>(null);\n\n return useMemo(\n () => (\n <StyledTooltip>\n {isDisabled ? (\n children\n ) : (\n <Popup\n shouldShowOnHover\n content={\n <TooltipItem\n width={itemWidth}\n text={item.text}\n headline={item.headline}\n imageUrl={item.imageUrl}\n button={item.button}\n />\n }\n ref={tooltipRef}\n >\n {children}\n </Popup>\n )}\n </StyledTooltip>\n ),\n [isDisabled, children, itemWidth, item.text, item.headline, item.imageUrl, item.button],\n );\n};\n\nTooltip.displayName = 'Tooltip';\n\nexport default Tooltip;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAAiD,SAAAE,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAV,wBAAAU,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAA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M,OAAK;IACF+B,iBAAiB;IACjBC,OAAO,eACHzC,MAAA,CAAAS,OAAA,CAAA6B,aAAA,CAACjC,YAAA,CAAAI,OAAW;MACRiC,KAAK,EAAER,SAAU;MACjBS,IAAI,EAAEZ,IAAI,CAACY,IAAK;MAChBC,QAAQ,EAAEb,IAAI,CAACa,QAAS;MACxBC,QAAQ,EAAEd,IAAI,CAACc,QAAS;MACxBC,MAAM,EAAEf,IAAI,CAACe;IAAO,CACvB,CACJ;IACDC,GAAG,EAAEZ;EAAW,GAEfH,QACE,CAEA,CAClB,EACD,CAACC,UAAU,EAAED,QAAQ,EAAEE,SAAS,EAAEH,IAAI,CAACY,IAAI,EAAEZ,IAAI,CAACa,QAAQ,EAAEb,IAAI,CAACc,QAAQ,EAAEd,IAAI,CAACe,MAAM,CAC1F,CAAC;AACL,CAAC;AAEDjB,OAAO,CAACmB,WAAW,GAAG,SAAS;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAzC,OAAA,GAEjBoB,OAAO"}
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const StyledTooltip: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StyledTooltip = void 0;
7
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+ const StyledTooltip = exports.StyledTooltip = _styledComponents.default.div``;
10
+ //# sourceMappingURL=Tooltip.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tooltip.styles.js","names":["_styledComponents","_interopRequireDefault","require","obj","__esModule","default","StyledTooltip","exports","styled","div"],"sources":["../../../src/components/tooltip/Tooltip.styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nexport const StyledTooltip = styled.div``;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAuC,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEhC,MAAMG,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAGE,yBAAM,CAACC,GAAI,EAAC"}
@@ -0,0 +1,13 @@
1
+ import { FC, type CSSProperties } from 'react';
2
+ export type TooltipProps = {
3
+ headline?: string;
4
+ text: string;
5
+ imageUrl?: string;
6
+ button?: {
7
+ text: string;
8
+ onClick: () => void;
9
+ };
10
+ width?: CSSProperties['width'];
11
+ };
12
+ declare const TooltipItem: FC<TooltipProps>;
13
+ export default TooltipItem;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _Button = _interopRequireDefault(require("../../button/Button"));
9
+ var _TooltipItem = require("./TooltipItem.styles");
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
12
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
13
+ const TooltipItem = _ref => {
14
+ let {
15
+ headline,
16
+ text,
17
+ button,
18
+ imageUrl,
19
+ width
20
+ } = _ref;
21
+ return (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_TooltipItem.StyledTooltipItem, {
22
+ width: width
23
+ }, headline && /*#__PURE__*/_react.default.createElement(_TooltipItem.StyledTooltipItemHeadline, null, headline), imageUrl && /*#__PURE__*/_react.default.createElement(_TooltipItem.StyledTooltipItemImage, {
24
+ src: imageUrl
25
+ }), /*#__PURE__*/_react.default.createElement(_TooltipItem.StyledTooltipItemText, null, text), button && /*#__PURE__*/_react.default.createElement(_TooltipItem.StyledTooltipItemButtonWrapper, null, /*#__PURE__*/_react.default.createElement(_Button.default, {
26
+ onClick: button.onClick
27
+ }, button.text))), [button, headline, imageUrl, text]);
28
+ };
29
+ TooltipItem.displayName = 'TooltipItem';
30
+ var _default = exports.default = TooltipItem;
31
+ //# sourceMappingURL=TooltipItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TooltipItem.js","names":["_react","_interopRequireWildcard","require","_Button","_interopRequireDefault","_TooltipItem","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","TooltipItem","_ref","headline","text","button","imageUrl","width","useMemo","createElement","StyledTooltipItem","StyledTooltipItemHeadline","StyledTooltipItemImage","src","StyledTooltipItemText","StyledTooltipItemButtonWrapper","onClick","displayName","_default","exports"],"sources":["../../../../src/components/tooltip/tooltip-item/TooltipItem.tsx"],"sourcesContent":["import React, { FC, useMemo, type CSSProperties } from 'react';\nimport Button from '../../button/Button';\nimport {\n StyledTooltipItem,\n StyledTooltipItemButtonWrapper,\n StyledTooltipItemHeadline,\n StyledTooltipItemImage,\n StyledTooltipItemText,\n} from './TooltipItem.styles';\n\nexport type TooltipProps = {\n headline?: string;\n text: string;\n imageUrl?: string;\n button?: { text: string; onClick: () => void };\n width?: CSSProperties['width'];\n};\n\nconst TooltipItem: FC<TooltipProps> = ({ headline, text, button, imageUrl, width }) =>\n useMemo(\n () => (\n <StyledTooltipItem width={width}>\n {headline && <StyledTooltipItemHeadline>{headline}</StyledTooltipItemHeadline>}\n {imageUrl && <StyledTooltipItemImage src={imageUrl} />}\n <StyledTooltipItemText>{text}</StyledTooltipItemText>\n {button && (\n <StyledTooltipItemButtonWrapper>\n <Button onClick={button.onClick}>{button.text}</Button>\n </StyledTooltipItemButtonWrapper>\n )}\n </StyledTooltipItem>\n ),\n [button, headline, imageUrl, text],\n );\n\nTooltipItem.displayName = 'TooltipItem';\n\nexport default TooltipItem;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAM8B,SAAAE,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAH,UAAA,SAAAG,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAF,OAAA,EAAAE,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAJ,CAAA,UAAAG,CAAA,CAAAE,GAAA,CAAAL,CAAA,OAAAM,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAA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,OAAA,CAAAK,OAAM;IAACmC,OAAO,EAAEX,MAAM,CAACW;EAAQ,GAAEX,MAAM,CAACD,IAAa,CAC1B,CAErB,CACtB,EACD,CAACC,MAAM,EAAEF,QAAQ,EAAEG,QAAQ,EAAEF,IAAI,CACrC,CAAC;AAAA;AAELH,WAAW,CAACgB,WAAW,GAAG,aAAa;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAtC,OAAA,GAEzBoB,WAAW"}
@@ -0,0 +1,15 @@
1
+ import type { CSSProperties } from 'react';
2
+ import type { WithTheme } from '../../color-scheme-provider/ColorSchemeProvider';
3
+ type StyledTooltipItemProps = WithTheme<{
4
+ width?: CSSProperties['width'];
5
+ }>;
6
+ export declare const StyledTooltipItem: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledTooltipItemProps>>;
7
+ export declare const StyledTooltipItemHeadline: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, {
8
+ theme: import("../../color-scheme-provider/ColorSchemeProvider").Theme;
9
+ }>>;
10
+ export declare const StyledTooltipItemImage: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, never>>;
11
+ export declare const StyledTooltipItemButtonWrapper: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
12
+ export declare const StyledTooltipItemText: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, {
13
+ theme: import("../../color-scheme-provider/ColorSchemeProvider").Theme;
14
+ }>>;
15
+ export {};
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StyledTooltipItemText = exports.StyledTooltipItemImage = exports.StyledTooltipItemHeadline = exports.StyledTooltipItemButtonWrapper = exports.StyledTooltipItem = void 0;
7
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
8
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
9
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
10
+ const StyledTooltipItem = exports.StyledTooltipItem = _styledComponents.default.div`
11
+ padding: 5px;
12
+
13
+ ${_ref => {
14
+ let {
15
+ width
16
+ } = _ref;
17
+ return width && (0, _styledComponents.css)`
18
+ width: ${width};
19
+ `;
20
+ }}
21
+ `;
22
+ const StyledTooltipItemHeadline = exports.StyledTooltipItemHeadline = _styledComponents.default.h5`
23
+ color: ${_ref2 => {
24
+ let {
25
+ theme
26
+ } = _ref2;
27
+ return theme.headline;
28
+ }};
29
+ margin: 0;
30
+ `;
31
+ const StyledTooltipItemImage = exports.StyledTooltipItemImage = _styledComponents.default.img``;
32
+ const StyledTooltipItemButtonWrapper = exports.StyledTooltipItemButtonWrapper = _styledComponents.default.div`
33
+ display: flex;
34
+ justify-content: center;
35
+ `;
36
+ const StyledTooltipItemText = exports.StyledTooltipItemText = _styledComponents.default.p`
37
+ color: ${_ref3 => {
38
+ let {
39
+ theme
40
+ } = _ref3;
41
+ return theme.text;
42
+ }};
43
+ `;
44
+ //# sourceMappingURL=TooltipItem.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TooltipItem.styles.js","names":["_styledComponents","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","StyledTooltipItem","exports","styled","div","_ref","width","css","StyledTooltipItemHeadline","h5","_ref2","theme","headline","StyledTooltipItemImage","img","StyledTooltipItemButtonWrapper","StyledTooltipItemText","p","_ref3","text"],"sources":["../../../../src/components/tooltip/tooltip-item/TooltipItem.styles.ts"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport styled, { css } from 'styled-components';\nimport type { WithTheme } from '../../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledTooltipItemProps = WithTheme<{ width?: CSSProperties['width'] }>;\n\nexport const StyledTooltipItem = styled.div<StyledTooltipItemProps>`\n padding: 5px;\n\n ${({ width }) =>\n width &&\n css`\n width: ${width};\n `}\n`;\n\ntype StyledTooltipItemHeadlineProps = WithTheme<unknown>;\n\nexport const StyledTooltipItemHeadline = styled.h5<StyledTooltipItemHeadlineProps>`\n color: ${({ theme }: StyledTooltipItemHeadlineProps) => theme.headline};\n margin: 0;\n`;\n\nexport const StyledTooltipItemImage = styled.img``;\n\nexport const StyledTooltipItemButtonWrapper = styled.div`\n display: flex;\n justify-content: center;\n`;\n\ntype StyledTooltipItemTextProps = WithTheme<unknown>;\n\nexport const StyledTooltipItemText = styled.p<StyledTooltipItemTextProps>`\n color: ${({ theme }: StyledTooltipItemTextProps) => theme.text};\n`;\n"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAgD,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,C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AC;AAIM,MAAME,yBAAyB,GAAAN,OAAA,CAAAM,yBAAA,GAAGL,yBAAM,CAACM,EAAmC;AACnF,aAAaC,KAAA;EAAA,IAAC;IAAEC;EAAsC,CAAC,GAAAD,KAAA;EAAA,OAAKC,KAAK,CAACC,QAAQ;AAAA,CAAC;AAC3E;AACA,CAAC;AAEM,MAAMC,sBAAsB,GAAAX,OAAA,CAAAW,sBAAA,GAAGV,yBAAM,CAACW,GAAI,EAAC;AAE3C,MAAMC,8BAA8B,GAAAb,OAAA,CAAAa,8BAAA,GAAGZ,yBAAM,CAACC,GAAI;AACzD;AACA;AACA,CAAC;AAIM,MAAMY,qBAAqB,GAAAd,OAAA,CAAAc,qBAAA,GAAGb,yBAAM,CAACc,CAA8B;AAC1E,aAAaC,KAAA;EAAA,IAAC;IAAEP;EAAkC,CAAC,GAAAO,KAAA;EAAA,OAAKP,KAAK,CAACQ,IAAI;AAAA,CAAC;AACnE,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { FC, MouseEvent, ReactElement } from 'react';
2
+ export type TruncationProps = {
3
+ /**
4
+ * The elements that should be expanding or collapsing.
5
+ */
6
+ children: ReactElement;
7
+ /**
8
+ * The height of the children Element in it`s collapsed state.
9
+ */
10
+ collapsedHeight?: number;
11
+ /**
12
+ * If set to true, the content is exposed.
13
+ */
14
+ isOpen?: boolean;
15
+ /**
16
+ * A text that should be displayed if the content is expanded.
17
+ */
18
+ lessLabel?: string;
19
+ /**
20
+ * A text that should be displayed if the content is collapsed.
21
+ */
22
+ moreLabel?: string;
23
+ /**
24
+ * Function to be executed when the component is expanding or collapsing.
25
+ */
26
+ onChange?: (event: MouseEvent<HTMLAnchorElement>, isOpen: boolean) => void;
27
+ };
28
+ declare const Truncation: FC<TruncationProps>;
29
+ export default Truncation;
@@ -0,0 +1,136 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _truncation = require("../../utils/truncation");
9
+ var _Truncation = require("./Truncation.styles");
10
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
11
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
+ const Truncation = _ref => {
13
+ let {
14
+ collapsedHeight = 150,
15
+ isOpen,
16
+ moreLabel = 'Mehr',
17
+ lessLabel = 'Weniger',
18
+ onChange,
19
+ children
20
+ } = _ref;
21
+ const [internalIsOpen, setInternalIsOpen] = (0, _react.useState)(false);
22
+ const [showClamp, setShowClamp] = (0, _react.useState)(true);
23
+ const [newCollapsedHeight, setNewCollapsedHeight] = (0, _react.useState)(collapsedHeight);
24
+ const [originalHeight, setOriginalHeight] = (0, _react.useState)(0);
25
+ const [shouldShowCollapsedElement, setShouldShowCollapsedElement] = (0, _react.useState)(true);
26
+ const [hasSizeChanged, setHasSizeChanged] = (0, _react.useState)(false);
27
+ const [initialRender, setInitialRender] = (0, _react.useState)(true);
28
+ const [originalSmallHeight, setOriginalSmallHeight] = (0, _react.useState)(0);
29
+ const [originalBigHeight, setOriginalBigHeight] = (0, _react.useState)(0);
30
+ (0, _react.useEffect)(() => {
31
+ setInitialRender(false);
32
+ }, []);
33
+ const pseudoChildrenRef = (0, _react.useRef)(null);
34
+ const childrenRef = (0, _react.useRef)(null);
35
+ const originalChildrenRef = (0, _react.useRef)(null);
36
+ (0, _react.useEffect)(() => {
37
+ if (typeof isOpen === 'boolean') {
38
+ setInternalIsOpen(isOpen);
39
+ setShowClamp(!isOpen);
40
+ }
41
+ }, [isOpen]);
42
+
43
+ // Changes the state of the truncation
44
+ const handleClampClick = (0, _react.useCallback)(event => {
45
+ setInternalIsOpen(current => {
46
+ if (typeof onChange === 'function') {
47
+ onChange(event, !current);
48
+ }
49
+ return !current;
50
+ });
51
+ }, [onChange]);
52
+ const handleAnimationEnd = (0, _react.useCallback)(() => {
53
+ setHasSizeChanged(false);
54
+ setShouldShowCollapsedElement(!internalIsOpen);
55
+ }, [internalIsOpen]);
56
+ (0, _react.useEffect)(() => {
57
+ if (!pseudoChildrenRef.current) {
58
+ return;
59
+ }
60
+ setOriginalHeight(pseudoChildrenRef.current.offsetHeight);
61
+ setOriginalBigHeight(pseudoChildrenRef.current.offsetHeight);
62
+ (0, _truncation.truncateElement)(pseudoChildrenRef.current, collapsedHeight);
63
+ setNewCollapsedHeight(pseudoChildrenRef.current.offsetHeight);
64
+ setOriginalSmallHeight(pseudoChildrenRef.current.offsetHeight);
65
+ }, [collapsedHeight, pseudoChildrenRef]);
66
+
67
+ // Checks if the clamp should be shown
68
+ (0, _react.useEffect)(() => {
69
+ if (pseudoChildrenRef.current && !hasSizeChanged && !initialRender) {
70
+ setShowClamp(originalHeight > newCollapsedHeight);
71
+ }
72
+ }, [collapsedHeight, hasSizeChanged, initialRender, newCollapsedHeight, originalHeight]);
73
+ (0, _react.useEffect)(() => {
74
+ if (childrenRef.current && pseudoChildrenRef.current && originalChildrenRef.current) {
75
+ while (childrenRef.current.firstChild) {
76
+ childrenRef.current.removeChild(childrenRef.current.firstChild);
77
+ }
78
+ childrenRef.current.appendChild(shouldShowCollapsedElement && !internalIsOpen ? pseudoChildrenRef.current : originalChildrenRef.current);
79
+ childrenRef.current.children[0].style.visibility = 'visible';
80
+ }
81
+ }, [children, internalIsOpen, shouldShowCollapsedElement]);
82
+ (0, _react.useEffect)(() => {
83
+ if (originalChildrenRef.current) {
84
+ const resizeObserver = new ResizeObserver(entries => {
85
+ if (entries && entries[0]) {
86
+ const observedHeight = entries[0].contentRect.height;
87
+ setOriginalHeight(observedHeight < originalBigHeight ? originalBigHeight : observedHeight);
88
+ setHasSizeChanged(true);
89
+ }
90
+ });
91
+ resizeObserver.observe(originalChildrenRef.current);
92
+ return () => {
93
+ resizeObserver.disconnect();
94
+ };
95
+ }
96
+ return () => {};
97
+ }, [originalBigHeight]);
98
+ (0, _react.useEffect)(() => {
99
+ if (pseudoChildrenRef.current) {
100
+ const resizeObserver = new ResizeObserver(entries => {
101
+ if (entries && entries[0]) {
102
+ const observedHeight = entries[0].contentRect.height;
103
+ setNewCollapsedHeight(observedHeight < originalSmallHeight ? originalSmallHeight : observedHeight);
104
+ setHasSizeChanged(true);
105
+ }
106
+ });
107
+ resizeObserver.observe(pseudoChildrenRef.current);
108
+ return () => {
109
+ resizeObserver.disconnect();
110
+ };
111
+ }
112
+ return () => {};
113
+ }, [originalSmallHeight]);
114
+ return (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_Truncation.StyledTruncation, {
115
+ className: "beta-chayns-truncation"
116
+ }, /*#__PURE__*/_react.default.createElement(_Truncation.StyledTruncationPseudoContent, {
117
+ ref: pseudoChildrenRef
118
+ }, children), /*#__PURE__*/_react.default.createElement(_Truncation.StyledTruncationPseudoContent, {
119
+ ref: originalChildrenRef
120
+ }, children), /*#__PURE__*/_react.default.createElement(_Truncation.StyledMotionTruncationContent, {
121
+ animate: {
122
+ height: internalIsOpen ? originalHeight : newCollapsedHeight
123
+ },
124
+ initial: false,
125
+ transition: {
126
+ type: 'tween',
127
+ duration: hasSizeChanged ? 0 : 0.2
128
+ },
129
+ onAnimationComplete: handleAnimationEnd,
130
+ ref: childrenRef
131
+ }), showClamp && /*#__PURE__*/_react.default.createElement(_Truncation.StyledTruncationClamp, {
132
+ onClick: handleClampClick
133
+ }, internalIsOpen ? lessLabel : moreLabel)), [children, handleAnimationEnd, handleClampClick, hasSizeChanged, internalIsOpen, lessLabel, moreLabel, newCollapsedHeight, originalHeight, showClamp]);
134
+ };
135
+ var _default = exports.default = Truncation;
136
+ //# sourceMappingURL=Truncation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Truncation.js","names":["_react","_interopRequireWildcard","require","_truncation","_Truncation","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","Truncation","_ref","collapsedHeight","isOpen","moreLabel","lessLabel","onChange","children","internalIsOpen","setInternalIsOpen","useState","showClamp","setShowClamp","newCollapsedHeight","setNewCollapsedHeight","originalHeight","setOriginalHeight","shouldShowCollapsedElement","setShouldShowCollapsedElement","hasSizeChanged","setHasSizeChanged","initialRender","setInitialRender","originalSmallHeight","setOriginalSmallHeight","originalBigHeight","setOriginalBigHeight","useEffect","pseudoChildrenRef","useRef","childrenRef","originalChildrenRef","handleClampClick","useCallback","event","current","handleAnimationEnd","offsetHeight","truncateElement","firstChild","removeChild","appendChild","style","visibility","resizeObserver","ResizeObserver","entries","observedHeight","contentRect","height","observe","disconnect","useMemo","createElement","StyledTruncation","className","StyledTruncationPseudoContent","ref","StyledMotionTruncationContent","animate","initial","transition","type","duration","onAnimationComplete","StyledTruncationClamp","onClick","_default","exports"],"sources":["../../../src/components/truncation/Truncation.tsx"],"sourcesContent":["import React, {\n FC,\n MouseEvent,\n MouseEventHandler,\n ReactElement,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { truncateElement } from '../../utils/truncation';\nimport {\n StyledMotionTruncationContent,\n StyledTruncation,\n StyledTruncationClamp,\n StyledTruncationPseudoContent,\n} from './Truncation.styles';\n\nexport type TruncationProps = {\n /**\n * The elements that should be expanding or collapsing.\n */\n children: ReactElement;\n /**\n * The height of the children Element in it`s collapsed state.\n */\n collapsedHeight?: number;\n /**\n * If set to true, the content is exposed.\n */\n isOpen?: boolean;\n /**\n * A text that should be displayed if the content is expanded.\n */\n lessLabel?: string;\n /**\n * A text that should be displayed if the content is collapsed.\n */\n moreLabel?: string;\n /**\n * Function to be executed when the component is expanding or collapsing.\n */\n onChange?: (event: MouseEvent<HTMLAnchorElement>, isOpen: boolean) => void;\n};\n\nconst Truncation: FC<TruncationProps> = ({\n collapsedHeight = 150,\n isOpen,\n moreLabel = 'Mehr',\n lessLabel = 'Weniger',\n onChange,\n children,\n}) => {\n const [internalIsOpen, setInternalIsOpen] = useState(false);\n const [showClamp, setShowClamp] = useState(true);\n const [newCollapsedHeight, setNewCollapsedHeight] = useState(collapsedHeight);\n const [originalHeight, setOriginalHeight] = useState(0);\n const [shouldShowCollapsedElement, setShouldShowCollapsedElement] = useState(true);\n const [hasSizeChanged, setHasSizeChanged] = useState(false);\n const [initialRender, setInitialRender] = useState(true);\n\n const [originalSmallHeight, setOriginalSmallHeight] = useState(0);\n const [originalBigHeight, setOriginalBigHeight] = useState(0);\n\n useEffect(() => {\n setInitialRender(false);\n }, []);\n\n const pseudoChildrenRef = useRef<HTMLDivElement>(null);\n const childrenRef = useRef<HTMLDivElement>(null);\n const originalChildrenRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (typeof isOpen === 'boolean') {\n setInternalIsOpen(isOpen);\n setShowClamp(!isOpen);\n }\n }, [isOpen]);\n\n // Changes the state of the truncation\n const handleClampClick = useCallback<MouseEventHandler<HTMLAnchorElement>>(\n (event) => {\n setInternalIsOpen((current) => {\n if (typeof onChange === 'function') {\n onChange(event, !current);\n }\n\n return !current;\n });\n },\n [onChange],\n );\n\n const handleAnimationEnd = useCallback(() => {\n setHasSizeChanged(false);\n setShouldShowCollapsedElement(!internalIsOpen);\n }, [internalIsOpen]);\n\n useEffect(() => {\n if (!pseudoChildrenRef.current) {\n return;\n }\n\n setOriginalHeight(pseudoChildrenRef.current.offsetHeight);\n setOriginalBigHeight(pseudoChildrenRef.current.offsetHeight);\n\n truncateElement(pseudoChildrenRef.current, collapsedHeight);\n\n setNewCollapsedHeight(pseudoChildrenRef.current.offsetHeight);\n setOriginalSmallHeight(pseudoChildrenRef.current.offsetHeight);\n }, [collapsedHeight, pseudoChildrenRef]);\n\n // Checks if the clamp should be shown\n useEffect(() => {\n if (pseudoChildrenRef.current && !hasSizeChanged && !initialRender) {\n setShowClamp(originalHeight > newCollapsedHeight);\n }\n }, [collapsedHeight, hasSizeChanged, initialRender, newCollapsedHeight, originalHeight]);\n\n useEffect(() => {\n if (childrenRef.current && pseudoChildrenRef.current && originalChildrenRef.current) {\n while (childrenRef.current.firstChild) {\n childrenRef.current.removeChild(childrenRef.current.firstChild);\n }\n\n childrenRef.current.appendChild(\n shouldShowCollapsedElement && !internalIsOpen\n ? pseudoChildrenRef.current\n : originalChildrenRef.current,\n );\n\n (childrenRef.current.children[0] as HTMLDivElement).style.visibility = 'visible';\n }\n }, [children, internalIsOpen, shouldShowCollapsedElement]);\n\n useEffect(() => {\n if (originalChildrenRef.current) {\n const resizeObserver = new ResizeObserver((entries) => {\n if (entries && entries[0]) {\n const observedHeight = entries[0].contentRect.height;\n setOriginalHeight(\n observedHeight < originalBigHeight ? originalBigHeight : observedHeight,\n );\n setHasSizeChanged(true);\n }\n });\n\n resizeObserver.observe(originalChildrenRef.current);\n\n return () => {\n resizeObserver.disconnect();\n };\n }\n\n return () => {};\n }, [originalBigHeight]);\n\n useEffect(() => {\n if (pseudoChildrenRef.current) {\n const resizeObserver = new ResizeObserver((entries) => {\n if (entries && entries[0]) {\n const observedHeight = entries[0].contentRect.height;\n setNewCollapsedHeight(\n observedHeight < originalSmallHeight ? originalSmallHeight : observedHeight,\n );\n setHasSizeChanged(true);\n }\n });\n\n resizeObserver.observe(pseudoChildrenRef.current);\n\n return () => {\n resizeObserver.disconnect();\n };\n }\n\n return () => {};\n }, [originalSmallHeight]);\n\n return useMemo(\n () => (\n <StyledTruncation className=\"beta-chayns-truncation\">\n <StyledTruncationPseudoContent ref={pseudoChildrenRef}>\n {children}\n </StyledTruncationPseudoContent>\n <StyledTruncationPseudoContent ref={originalChildrenRef}>\n {children}\n </StyledTruncationPseudoContent>\n <StyledMotionTruncationContent\n animate={{ height: internalIsOpen ? originalHeight : newCollapsedHeight }}\n initial={false}\n transition={{ type: 'tween', duration: hasSizeChanged ? 0 : 0.2 }}\n onAnimationComplete={handleAnimationEnd}\n ref={childrenRef}\n />\n {showClamp && (\n <StyledTruncationClamp onClick={handleClampClick}>\n {internalIsOpen ? lessLabel : moreLabel}\n </StyledTruncationClamp>\n )}\n </StyledTruncation>\n ),\n [\n children,\n handleAnimationEnd,\n handleClampClick,\n hasSizeChanged,\n internalIsOpen,\n lessLabel,\n moreLabel,\n newCollapsedHeight,\n originalHeight,\n showClamp,\n ],\n );\n};\n\nexport default Truncation;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAWA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAK6B,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,IAAAH,M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