@chayns-components/core 5.0.0-beta.23 → 5.0.0-beta.231

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 (353) hide show
  1. package/README.md +3 -9
  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/video/post.d.ts +16 -0
  6. package/lib/api/video/post.js +31 -0
  7. package/lib/api/video/post.js.map +1 -0
  8. package/lib/components/accordion/Accordion.d.ts +35 -2
  9. package/lib/components/accordion/Accordion.js +84 -79
  10. package/lib/components/accordion/Accordion.js.map +1 -1
  11. package/lib/components/accordion/Accordion.styles.d.ts +3 -2
  12. package/lib/components/accordion/Accordion.styles.js +95 -26
  13. package/lib/components/accordion/Accordion.styles.js.map +1 -1
  14. package/lib/components/accordion/accordion-body/AccordionBody.d.ts +17 -2
  15. package/lib/components/accordion/accordion-body/AccordionBody.js +22 -13
  16. package/lib/components/accordion/accordion-body/AccordionBody.js.map +1 -1
  17. package/lib/components/accordion/accordion-body/AccordionBody.styles.d.ts +4 -1
  18. package/lib/components/accordion/accordion-body/AccordionBody.styles.js +15 -10
  19. package/lib/components/accordion/accordion-body/AccordionBody.styles.js.map +1 -1
  20. package/lib/components/accordion/accordion-content/AccordionContent.d.ts +16 -2
  21. package/lib/components/accordion/accordion-content/AccordionContent.js +13 -11
  22. package/lib/components/accordion/accordion-content/AccordionContent.js.map +1 -1
  23. package/lib/components/accordion/accordion-content/AccordionContent.styles.d.ts +2 -1
  24. package/lib/components/accordion/accordion-content/AccordionContent.styles.js +24 -14
  25. package/lib/components/accordion/accordion-content/AccordionContent.styles.js.map +1 -1
  26. package/lib/components/accordion/accordion-group/AccordionGroup.d.ts +12 -3
  27. package/lib/components/accordion/accordion-group/AccordionGroup.js +33 -44
  28. package/lib/components/accordion/accordion-group/AccordionGroup.js.map +1 -1
  29. package/lib/components/accordion/accordion-head/AccordionHead.d.ts +1 -1
  30. package/lib/components/accordion/accordion-head/AccordionHead.js +26 -54
  31. package/lib/components/accordion/accordion-head/AccordionHead.js.map +1 -1
  32. package/lib/components/accordion/accordion-head/AccordionHead.styles.js +136 -49
  33. package/lib/components/accordion/accordion-head/AccordionHead.styles.js.map +1 -1
  34. package/lib/components/accordion/accordion-intro/AccordionIntro.d.ts +8 -2
  35. package/lib/components/accordion/accordion-intro/AccordionIntro.js +4 -7
  36. package/lib/components/accordion/accordion-intro/AccordionIntro.js.map +1 -1
  37. package/lib/components/accordion/accordion-intro/AccordionIntro.styles.js +3 -9
  38. package/lib/components/accordion/accordion-intro/AccordionIntro.styles.js.map +1 -1
  39. package/lib/components/accordion/accordion-item/AccordionItem.d.ts +9 -0
  40. package/lib/components/accordion/accordion-item/AccordionItem.js +28 -0
  41. package/lib/components/accordion/accordion-item/AccordionItem.js.map +1 -0
  42. package/lib/components/accordion/accordion-item/AccordionItem.styles.d.ts +5 -0
  43. package/lib/components/accordion/accordion-item/AccordionItem.styles.js +34 -0
  44. package/lib/components/accordion/accordion-item/AccordionItem.styles.js.map +1 -0
  45. package/lib/components/accordion/utils.js +10 -12
  46. package/lib/components/accordion/utils.js.map +1 -1
  47. package/lib/components/amount-control/AmountControl.d.ts +22 -0
  48. package/lib/components/amount-control/AmountControl.js +186 -0
  49. package/lib/components/amount-control/AmountControl.js.map +1 -0
  50. package/lib/components/amount-control/AmountControl.styles.d.ts +14 -0
  51. package/lib/components/amount-control/AmountControl.styles.js +61 -0
  52. package/lib/components/amount-control/AmountControl.styles.js.map +1 -0
  53. package/lib/components/amount-control/utils.d.ts +7 -0
  54. package/lib/components/amount-control/utils.js +22 -0
  55. package/lib/components/amount-control/utils.js.map +1 -0
  56. package/lib/components/badge/Badge.d.ts +9 -1
  57. package/lib/components/badge/Badge.js +12 -12
  58. package/lib/components/badge/Badge.js.map +1 -1
  59. package/lib/components/badge/Badge.styles.d.ts +4 -1
  60. package/lib/components/badge/Badge.styles.js +22 -15
  61. package/lib/components/badge/Badge.styles.js.map +1 -1
  62. package/lib/components/button/Button.d.ts +6 -2
  63. package/lib/components/button/Button.js +65 -22
  64. package/lib/components/button/Button.js.map +1 -1
  65. package/lib/components/button/Button.styles.d.ts +2 -0
  66. package/lib/components/button/Button.styles.js +57 -24
  67. package/lib/components/button/Button.styles.js.map +1 -1
  68. package/lib/components/checkbox/Checkbox.d.ts +25 -0
  69. package/lib/components/checkbox/Checkbox.js +44 -0
  70. package/lib/components/checkbox/Checkbox.js.map +1 -0
  71. package/lib/components/checkbox/Checkbox.styles.d.ts +6 -0
  72. package/lib/components/checkbox/Checkbox.styles.js +131 -0
  73. package/lib/components/checkbox/Checkbox.styles.js.map +1 -0
  74. package/lib/components/color-scheme-provider/ColorSchemeProvider.d.ts +2 -2
  75. package/lib/components/color-scheme-provider/ColorSchemeProvider.js +44 -78
  76. package/lib/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
  77. package/lib/components/color-scheme-provider/font.d.ts +6 -0
  78. package/lib/components/color-scheme-provider/font.js +59 -0
  79. package/lib/components/color-scheme-provider/font.js.map +1 -0
  80. package/lib/components/combobox/ComboBox.d.ts +25 -0
  81. package/lib/components/combobox/ComboBox.js +144 -0
  82. package/lib/components/combobox/ComboBox.js.map +1 -0
  83. package/lib/components/combobox/ComboBox.styles.d.ts +17 -0
  84. package/lib/components/combobox/ComboBox.styles.js +128 -0
  85. package/lib/components/combobox/ComboBox.styles.js.map +1 -0
  86. package/lib/components/combobox/combobox-item/ComboBoxItem.d.ts +18 -0
  87. package/lib/components/combobox/combobox-item/ComboBoxItem.js +30 -0
  88. package/lib/components/combobox/combobox-item/ComboBoxItem.js.map +1 -0
  89. package/lib/components/combobox/combobox-item/ComboBoxItem.styles.d.ts +6 -0
  90. package/lib/components/combobox/combobox-item/ComboBoxItem.styles.js +30 -0
  91. package/lib/components/combobox/combobox-item/ComboBoxItem.styles.js.map +1 -0
  92. package/lib/components/content-card/ContentCard.d.ts +9 -0
  93. package/lib/components/content-card/ContentCard.js +19 -0
  94. package/lib/components/content-card/ContentCard.js.map +1 -0
  95. package/lib/components/content-card/ContentCard.styles.d.ts +1 -0
  96. package/lib/components/content-card/ContentCard.styles.js +23 -0
  97. package/lib/components/content-card/ContentCard.styles.js.map +1 -0
  98. package/lib/components/context-menu/ContextMenu.d.ts +6 -6
  99. package/lib/components/context-menu/ContextMenu.js +82 -98
  100. package/lib/components/context-menu/ContextMenu.js.map +1 -1
  101. package/lib/components/context-menu/ContextMenu.styles.js +3 -9
  102. package/lib/components/context-menu/ContextMenu.styles.js.map +1 -1
  103. package/lib/components/context-menu/constants/alignment.js +4 -5
  104. package/lib/components/context-menu/constants/alignment.js.map +1 -1
  105. package/lib/components/context-menu/context-menu-content/ContextMenuContent.d.ts +1 -1
  106. package/lib/components/context-menu/context-menu-content/ContextMenuContent.js +32 -28
  107. package/lib/components/context-menu/context-menu-content/ContextMenuContent.js.map +1 -1
  108. package/lib/components/context-menu/context-menu-content/ContextMenuContent.styles.js +92 -41
  109. package/lib/components/context-menu/context-menu-content/ContextMenuContent.styles.js.map +1 -1
  110. package/lib/components/date-info/DateInfo.d.ts +40 -0
  111. package/lib/components/date-info/DateInfo.js +109 -0
  112. package/lib/components/date-info/DateInfo.js.map +1 -0
  113. package/lib/components/date-info/utils/format.d.ts +43 -0
  114. package/lib/components/date-info/utils/format.js +288 -0
  115. package/lib/components/date-info/utils/format.js.map +1 -0
  116. package/lib/components/date-info/utils/language.d.ts +1 -0
  117. package/lib/components/date-info/utils/language.js +34 -0
  118. package/lib/components/date-info/utils/language.js.map +1 -0
  119. package/lib/components/filter-button/FilterButton.d.ts +22 -0
  120. package/lib/components/filter-button/FilterButton.js +89 -0
  121. package/lib/components/filter-button/FilterButton.js.map +1 -0
  122. package/lib/components/filter-button/FilterButton.styles.d.ts +1 -0
  123. package/lib/components/filter-button/FilterButton.styles.js +15 -0
  124. package/lib/components/filter-button/FilterButton.styles.js.map +1 -0
  125. package/lib/components/filter-button/filter-button-item/FilterButtonItem.d.ts +14 -0
  126. package/lib/components/filter-button/filter-button-item/FilterButtonItem.js +48 -0
  127. package/lib/components/filter-button/filter-button-item/FilterButtonItem.js.map +1 -0
  128. package/lib/components/filter-button/filter-button-item/FilterButtonItem.styles.d.ts +26 -0
  129. package/lib/components/filter-button/filter-button-item/FilterButtonItem.styles.js +109 -0
  130. package/lib/components/filter-button/filter-button-item/FilterButtonItem.styles.js.map +1 -0
  131. package/lib/components/filter-button/types.d.ts +15 -0
  132. package/lib/components/filter-button/types.js +19 -0
  133. package/lib/components/filter-button/types.js.map +1 -0
  134. package/lib/components/grid-image/GridImage.d.ts +1 -1
  135. package/lib/components/grid-image/GridImage.js +15 -52
  136. package/lib/components/grid-image/GridImage.js.map +1 -1
  137. package/lib/components/grid-image/GridImage.styles.d.ts +3 -3
  138. package/lib/components/grid-image/GridImage.styles.js +82 -38
  139. package/lib/components/grid-image/GridImage.styles.js.map +1 -1
  140. package/lib/components/icon/Icon.d.ts +2 -2
  141. package/lib/components/icon/Icon.js +22 -34
  142. package/lib/components/icon/Icon.js.map +1 -1
  143. package/lib/components/icon/Icon.styles.d.ts +1 -1
  144. package/lib/components/icon/Icon.styles.js +61 -39
  145. package/lib/components/icon/Icon.styles.js.map +1 -1
  146. package/lib/components/icon/utils.js +2 -5
  147. package/lib/components/icon/utils.js.map +1 -1
  148. package/lib/components/input/Input.d.ts +44 -0
  149. package/lib/components/input/Input.js +85 -0
  150. package/lib/components/input/Input.js.map +1 -0
  151. package/lib/components/input/Input.styles.d.ts +7 -0
  152. package/lib/components/input/Input.styles.js +71 -0
  153. package/lib/components/input/Input.styles.js.map +1 -0
  154. package/lib/components/list/List.d.ts +1 -1
  155. package/lib/components/list/List.js +26 -63
  156. package/lib/components/list/List.js.map +1 -1
  157. package/lib/components/list/list-item/ListItem.d.ts +10 -1
  158. package/lib/components/list/list-item/ListItem.js +37 -47
  159. package/lib/components/list/list-item/ListItem.js.map +1 -1
  160. package/lib/components/list/list-item/ListItem.styles.js +44 -26
  161. package/lib/components/list/list-item/ListItem.styles.js.map +1 -1
  162. package/lib/components/list/list-item/list-item-body/ListItemBody.d.ts +4 -1
  163. package/lib/components/list/list-item/list-item-body/ListItemBody.js +31 -12
  164. package/lib/components/list/list-item/list-item-body/ListItemBody.js.map +1 -1
  165. package/lib/components/list/list-item/list-item-body/ListItemBody.styles.js +3 -9
  166. package/lib/components/list/list-item/list-item-body/ListItemBody.styles.js.map +1 -1
  167. package/lib/components/list/list-item/list-item-content/ListItemContent.js +4 -7
  168. package/lib/components/list/list-item/list-item-content/ListItemContent.js.map +1 -1
  169. package/lib/components/list/list-item/list-item-content/ListItemContent.styles.js +8 -11
  170. package/lib/components/list/list-item/list-item-content/ListItemContent.styles.js.map +1 -1
  171. package/lib/components/list/list-item/list-item-head/ListItemHead.d.ts +2 -1
  172. package/lib/components/list/list-item/list-item-head/ListItemHead.js +37 -88
  173. package/lib/components/list/list-item/list-item-head/ListItemHead.js.map +1 -1
  174. package/lib/components/list/list-item/list-item-head/ListItemHead.styles.d.ts +1 -11
  175. package/lib/components/list/list-item/list-item-head/ListItemHead.styles.js +88 -81
  176. package/lib/components/list/list-item/list-item-head/ListItemHead.styles.js.map +1 -1
  177. package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.d.ts +6 -0
  178. package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.js +23 -0
  179. package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.js.map +1 -0
  180. package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.styles.d.ts +1 -0
  181. package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.styles.js +32 -0
  182. package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.styles.js.map +1 -0
  183. package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.d.ts +7 -0
  184. package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.js +44 -0
  185. package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.js.map +1 -0
  186. package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.styles.d.ts +10 -0
  187. package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.styles.js +52 -0
  188. package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.styles.js.map +1 -0
  189. package/lib/components/mention-finder/MentionFinder.d.ts +31 -0
  190. package/lib/components/mention-finder/MentionFinder.js +141 -0
  191. package/lib/components/mention-finder/MentionFinder.js.map +1 -0
  192. package/lib/components/mention-finder/MentionFinder.styles.d.ts +5 -0
  193. package/lib/components/mention-finder/MentionFinder.styles.js +94 -0
  194. package/lib/components/mention-finder/MentionFinder.styles.js.map +1 -0
  195. package/lib/components/mention-finder/constants/alignment.d.ts +4 -0
  196. package/lib/components/mention-finder/constants/alignment.js +13 -0
  197. package/lib/components/mention-finder/constants/alignment.js.map +1 -0
  198. package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.d.ts +10 -0
  199. package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.js +32 -0
  200. package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.js.map +1 -0
  201. package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.styles.d.ts +8 -0
  202. package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.styles.js +100 -0
  203. package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.styles.js.map +1 -0
  204. package/lib/components/number-input/NumberInput.d.ts +30 -0
  205. package/lib/components/number-input/NumberInput.js +109 -0
  206. package/lib/components/number-input/NumberInput.js.map +1 -0
  207. package/lib/components/number-input/constants/number.d.ts +4 -0
  208. package/lib/components/number-input/constants/number.js +15 -0
  209. package/lib/components/number-input/constants/number.js.map +1 -0
  210. package/lib/components/number-input/utils/number.d.ts +10 -0
  211. package/lib/components/number-input/utils/number.js +32 -0
  212. package/lib/components/number-input/utils/number.js.map +1 -0
  213. package/lib/components/popup/Popup.d.ts +26 -0
  214. package/lib/components/popup/Popup.js +145 -0
  215. package/lib/components/popup/Popup.js.map +1 -0
  216. package/lib/components/popup/Popup.styles.d.ts +2 -0
  217. package/lib/components/popup/Popup.styles.js +22 -0
  218. package/lib/components/popup/Popup.styles.js.map +1 -0
  219. package/lib/components/popup/popup-content/PopupContent.d.ts +9 -0
  220. package/lib/components/popup/popup-content/PopupContent.js +64 -0
  221. package/lib/components/popup/popup-content/PopupContent.js.map +1 -0
  222. package/lib/components/popup/popup-content/PopupContent.styles.d.ts +6 -0
  223. package/lib/components/popup/popup-content/PopupContent.styles.js +90 -0
  224. package/lib/components/popup/popup-content/PopupContent.styles.js.map +1 -0
  225. package/lib/components/popup/types.d.ts +16 -0
  226. package/lib/components/popup/types.js +17 -0
  227. package/lib/components/popup/types.js.map +1 -0
  228. package/lib/components/progress-bar/ProgressBar.d.ts +9 -0
  229. package/lib/components/progress-bar/ProgressBar.js +39 -0
  230. package/lib/components/progress-bar/ProgressBar.js.map +1 -0
  231. package/lib/components/progress-bar/ProgressBar.styles.d.ts +7 -0
  232. package/lib/components/progress-bar/ProgressBar.styles.js +39 -0
  233. package/lib/components/progress-bar/ProgressBar.styles.js.map +1 -0
  234. package/lib/components/radio-button/RadioButton.d.ts +26 -0
  235. package/lib/components/radio-button/RadioButton.js +86 -0
  236. package/lib/components/radio-button/RadioButton.js.map +1 -0
  237. package/lib/components/radio-button/RadioButton.styles.d.ts +22 -0
  238. package/lib/components/radio-button/RadioButton.styles.js +100 -0
  239. package/lib/components/radio-button/RadioButton.styles.js.map +1 -0
  240. package/lib/components/radio-button/radio-button-group/RadioButtonGroup.d.ts +22 -0
  241. package/lib/components/radio-button/radio-button-group/RadioButtonGroup.js +56 -0
  242. package/lib/components/radio-button/radio-button-group/RadioButtonGroup.js.map +1 -0
  243. package/lib/components/radio-button/types.d.ts +4 -0
  244. package/lib/components/radio-button/types.js +6 -0
  245. package/lib/components/radio-button/types.js.map +1 -0
  246. package/lib/components/scroll-view/ScrollView.d.ts +9 -0
  247. package/lib/components/scroll-view/ScrollView.js +23 -0
  248. package/lib/components/scroll-view/ScrollView.js.map +1 -0
  249. package/lib/components/scroll-view/ScrollView.styles.d.ts +6 -0
  250. package/lib/components/scroll-view/ScrollView.styles.js +27 -0
  251. package/lib/components/scroll-view/ScrollView.styles.js.map +1 -0
  252. package/lib/components/search-box/SearchBox.d.ts +26 -0
  253. package/lib/components/search-box/SearchBox.js +166 -0
  254. package/lib/components/search-box/SearchBox.js.map +1 -0
  255. package/lib/components/search-box/SearchBox.styles.d.ts +7 -0
  256. package/lib/components/search-box/SearchBox.styles.js +58 -0
  257. package/lib/components/search-box/SearchBox.styles.js.map +1 -0
  258. package/lib/components/search-box/search-box-item/SearchBoxItem.d.ts +9 -0
  259. package/lib/components/search-box/search-box-item/SearchBoxItem.js +30 -0
  260. package/lib/components/search-box/search-box-item/SearchBoxItem.js.map +1 -0
  261. package/lib/components/search-box/search-box-item/SearchBoxItem.styles.d.ts +6 -0
  262. package/lib/components/search-box/search-box-item/SearchBoxItem.styles.js +30 -0
  263. package/lib/components/search-box/search-box-item/SearchBoxItem.styles.js.map +1 -0
  264. package/lib/components/search-box/types.d.ts +4 -0
  265. package/lib/components/search-box/types.js +6 -0
  266. package/lib/components/search-box/types.js.map +1 -0
  267. package/lib/components/search-box/utils.d.ts +7 -0
  268. package/lib/components/search-box/utils.js +23 -0
  269. package/lib/components/search-box/utils.js.map +1 -0
  270. package/lib/components/search-input/SearchInput.d.ts +25 -0
  271. package/lib/components/search-input/SearchInput.js +96 -0
  272. package/lib/components/search-input/SearchInput.js.map +1 -0
  273. package/lib/components/search-input/SearchInput.styles.d.ts +4 -0
  274. package/lib/components/search-input/SearchInput.styles.js +30 -0
  275. package/lib/components/search-input/SearchInput.styles.js.map +1 -0
  276. package/lib/components/sharing-bar/SharingBar.d.ts +18 -0
  277. package/lib/components/sharing-bar/SharingBar.js +114 -0
  278. package/lib/components/sharing-bar/SharingBar.js.map +1 -0
  279. package/lib/components/sharing-bar/SharingBar.styles.d.ts +5 -0
  280. package/lib/components/sharing-bar/SharingBar.styles.js +27 -0
  281. package/lib/components/sharing-bar/SharingBar.styles.js.map +1 -0
  282. package/lib/components/slider/Slider.d.ts +21 -0
  283. package/lib/components/slider/Slider.js +52 -0
  284. package/lib/components/slider/Slider.js.map +1 -0
  285. package/lib/components/slider/Slider.styles.d.ts +8 -0
  286. package/lib/components/slider/Slider.styles.js +77 -0
  287. package/lib/components/slider/Slider.styles.js.map +1 -0
  288. package/lib/components/small-wait-cursor/SmallWaitCursor.d.ts +31 -0
  289. package/lib/components/small-wait-cursor/SmallWaitCursor.js +45 -0
  290. package/lib/components/small-wait-cursor/SmallWaitCursor.js.map +1 -0
  291. package/lib/components/small-wait-cursor/SmallWaitCursor.styles.d.ts +18 -0
  292. package/lib/components/small-wait-cursor/SmallWaitCursor.styles.js +105 -0
  293. package/lib/components/small-wait-cursor/SmallWaitCursor.styles.js.map +1 -0
  294. package/lib/components/text-area/TextArea.d.ts +25 -0
  295. package/lib/components/text-area/TextArea.js +72 -0
  296. package/lib/components/text-area/TextArea.js.map +1 -0
  297. package/lib/components/text-area/TextArea.styles.d.ts +8 -0
  298. package/lib/components/text-area/TextArea.styles.js +46 -0
  299. package/lib/components/text-area/TextArea.styles.js.map +1 -0
  300. package/lib/components/textstring/TextString.d.ts +22 -0
  301. package/lib/components/textstring/TextString.js +63 -0
  302. package/lib/components/textstring/TextString.js.map +1 -0
  303. package/lib/components/textstring/TextString.styles.d.ts +1 -0
  304. package/lib/components/textstring/TextString.styles.js +11 -0
  305. package/lib/components/textstring/TextString.styles.js.map +1 -0
  306. package/lib/components/textstring/types.d.ts +8 -0
  307. package/lib/components/textstring/types.js +6 -0
  308. package/lib/components/textstring/types.js.map +1 -0
  309. package/lib/components/textstring-provider/TextStringProvider.d.ts +21 -0
  310. package/lib/components/textstring-provider/TextStringProvider.js +39 -0
  311. package/lib/components/textstring-provider/TextStringProvider.js.map +1 -0
  312. package/lib/components/textstring-provider/utils.d.ts +11 -0
  313. package/lib/components/textstring-provider/utils.js +32 -0
  314. package/lib/components/textstring-provider/utils.js.map +1 -0
  315. package/lib/components/tooltip/Tooltip.d.ts +18 -0
  316. package/lib/components/tooltip/Tooltip.js +33 -0
  317. package/lib/components/tooltip/Tooltip.js.map +1 -0
  318. package/lib/components/tooltip/Tooltip.styles.d.ts +1 -0
  319. package/lib/components/tooltip/Tooltip.styles.js +11 -0
  320. package/lib/components/tooltip/Tooltip.styles.js.map +1 -0
  321. package/lib/components/tooltip/interface.d.ts +4 -0
  322. package/lib/components/tooltip/interface.js +6 -0
  323. package/lib/components/tooltip/interface.js.map +1 -0
  324. package/lib/components/tooltip/tooltip-item/TooltipItem.d.ts +7 -0
  325. package/lib/components/tooltip/tooltip-item/TooltipItem.js +21 -0
  326. package/lib/components/tooltip/tooltip-item/TooltipItem.js.map +1 -0
  327. package/lib/components/tooltip/tooltip-item/TooltipItem.styles.d.ts +7 -0
  328. package/lib/components/tooltip/tooltip-item/TooltipItem.styles.js +32 -0
  329. package/lib/components/tooltip/tooltip-item/TooltipItem.styles.js.map +1 -0
  330. package/lib/hooks/uuid.js +2 -21
  331. package/lib/hooks/uuid.js.map +1 -1
  332. package/lib/index.d.ts +36 -0
  333. package/lib/index.js +223 -27
  334. package/lib/index.js.map +1 -1
  335. package/lib/types/chayns.d.ts +98 -0
  336. package/lib/types/chayns.js +14 -0
  337. package/lib/types/chayns.js.map +1 -0
  338. package/lib/types/file.d.ts +42 -0
  339. package/lib/types/file.js +6 -0
  340. package/lib/types/file.js.map +1 -0
  341. package/lib/utils/calculate.d.ts +2 -0
  342. package/lib/utils/calculate.js +40 -0
  343. package/lib/utils/calculate.js.map +1 -0
  344. package/lib/utils/fileDialog.d.ts +7 -0
  345. package/lib/utils/fileDialog.js +70 -0
  346. package/lib/utils/fileDialog.js.map +1 -0
  347. package/lib/utils/isTobitEmployee.d.ts +1 -0
  348. package/lib/utils/isTobitEmployee.js +29 -0
  349. package/lib/utils/isTobitEmployee.js.map +1 -0
  350. package/lib/utils/uploadFile.d.ts +9 -0
  351. package/lib/utils/uploadFile.js +48 -0
  352. package/lib/utils/uploadFile.js.map +1 -0
  353. package/package.json +23 -19
@@ -0,0 +1,18 @@
1
+ import type { SmallWaitCursorProps, SmallWaitCursorSize, SmallWaitCursorSpeed } from './SmallWaitCursor';
2
+ export declare const StyledSmallWaitCursor: import("styled-components").StyledComponent<"div", any, {
3
+ shouldShowWaitCursor: boolean;
4
+ size: SmallWaitCursorSize;
5
+ } & {
6
+ theme: import("../color-scheme-provider/ColorSchemeProvider").Theme;
7
+ }, never>;
8
+ export declare const StyledSmallWaitCursorBackground: import("styled-components").StyledComponent<"div", any, {
9
+ theme: import("../color-scheme-provider/ColorSchemeProvider").Theme;
10
+ }, never>;
11
+ export declare const StyledSmallWaitCursorWaitCursor: import("styled-components").StyledComponent<"div", any, {
12
+ color: SmallWaitCursorProps['color'];
13
+ shouldHideBackground: SmallWaitCursorProps['shouldHideBackground'];
14
+ size: SmallWaitCursorSize;
15
+ speed: SmallWaitCursorSpeed;
16
+ } & {
17
+ theme: import("../color-scheme-provider/ColorSchemeProvider").Theme;
18
+ }, never>;
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StyledSmallWaitCursorWaitCursor = exports.StyledSmallWaitCursorBackground = exports.StyledSmallWaitCursor = void 0;
7
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
8
+ require("./SmallWaitCursor");
9
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
10
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
11
+ const StyledSmallWaitCursor = _styledComponents.default.div`
12
+ position: relative;
13
+ height: ${_ref => {
14
+ let {
15
+ size
16
+ } = _ref;
17
+ return size;
18
+ }}px;
19
+ width: ${_ref2 => {
20
+ let {
21
+ size
22
+ } = _ref2;
23
+ return size;
24
+ }}px;
25
+ opacity: ${_ref3 => {
26
+ let {
27
+ shouldShowWaitCursor
28
+ } = _ref3;
29
+ return shouldShowWaitCursor ? 1 : 0;
30
+ }};
31
+ `;
32
+ exports.StyledSmallWaitCursor = StyledSmallWaitCursor;
33
+ const StyledSmallWaitCursorBackground = _styledComponents.default.div`
34
+ background-color: ${_ref4 => {
35
+ let {
36
+ theme
37
+ } = _ref4;
38
+ return theme['100'];
39
+ }};
40
+ border-radius: 50%;
41
+ height: 100%;
42
+ width: 100%;
43
+ position: relative;
44
+ z-index: 1;
45
+ `;
46
+ exports.StyledSmallWaitCursorBackground = StyledSmallWaitCursorBackground;
47
+ const spin = (0, _styledComponents.keyframes)`
48
+ from {
49
+ transform: rotate(0deg);
50
+ }
51
+ to {
52
+ transform: rotate(360deg);
53
+ }
54
+ `;
55
+ const StyledSmallWaitCursorWaitCursor = _styledComponents.default.div`
56
+ position: absolute;
57
+ top: ${_ref5 => {
58
+ let {
59
+ shouldHideBackground
60
+ } = _ref5;
61
+ return shouldHideBackground ? 0 : 5;
62
+ }}px;
63
+ left: ${_ref6 => {
64
+ let {
65
+ shouldHideBackground
66
+ } = _ref6;
67
+ return shouldHideBackground ? 0 : 5;
68
+ }}px;
69
+ z-index: 2;
70
+ border-style: solid;
71
+ border-width: 3px;
72
+ border-color: ${_ref7 => {
73
+ let {
74
+ color,
75
+ theme
76
+ } = _ref7;
77
+ return color !== null && color !== void 0 ? color : theme.headline;
78
+ }};
79
+ height: ${_ref8 => {
80
+ let {
81
+ shouldHideBackground,
82
+ size
83
+ } = _ref8;
84
+ return shouldHideBackground ? '100%' : `${size - 10}px`;
85
+ }};
86
+ width: ${_ref9 => {
87
+ let {
88
+ shouldHideBackground,
89
+ size
90
+ } = _ref9;
91
+ return shouldHideBackground ? '100%' : `${size - 10}px`;
92
+ }};
93
+ border-radius: 50%;
94
+ display: inline-block;
95
+ border-top: 3px solid transparent;
96
+
97
+ animation: ${spin} ${_ref10 => {
98
+ let {
99
+ speed
100
+ } = _ref10;
101
+ return speed;
102
+ }}s linear infinite;
103
+ `;
104
+ exports.StyledSmallWaitCursorWaitCursor = StyledSmallWaitCursorWaitCursor;
105
+ //# sourceMappingURL=SmallWaitCursor.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SmallWaitCursor.styles.js","names":["_styledComponents","_interopRequireWildcard","require","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","StyledSmallWaitCursor","styled","div","_ref","size","_ref2","_ref3","shouldShowWaitCursor","exports","StyledSmallWaitCursorBackground","_ref4","theme","spin","keyframes","StyledSmallWaitCursorWaitCursor","_ref5","shouldHideBackground","_ref6","_ref7","color","headline","_ref8","_ref9","_ref10","speed"],"sources":["../../../src/components/small-wait-cursor/SmallWaitCursor.styles.ts"],"sourcesContent":["import styled, { keyframes } from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\nimport type {\n SmallWaitCursorProps,\n SmallWaitCursorSize,\n SmallWaitCursorSpeed,\n} from './SmallWaitCursor';\nimport {} from './SmallWaitCursor';\n\ntype StyledSmallWaitCursorProps = WithTheme<{\n shouldShowWaitCursor: boolean;\n size: SmallWaitCursorSize;\n}>;\n\nexport const StyledSmallWaitCursor = styled.div<StyledSmallWaitCursorProps>`\n position: relative;\n height: ${({ size }) => size}px;\n width: ${({ size }) => size}px;\n opacity: ${({ shouldShowWaitCursor }) => (shouldShowWaitCursor ? 1 : 0)};\n`;\n\ntype StyledSmallWaitCursorBackgroundProps = WithTheme<unknown>;\n\nexport const StyledSmallWaitCursorBackground = styled.div<StyledSmallWaitCursorBackgroundProps>`\n background-color: ${({ theme }: StyledSmallWaitCursorBackgroundProps) => theme['100']};\n border-radius: 50%;\n height: 100%;\n width: 100%;\n position: relative;\n z-index: 1;\n`;\n\ntype StyledSmallWaitCursorWaitCursorProps = WithTheme<{\n color: SmallWaitCursorProps['color'];\n shouldHideBackground: SmallWaitCursorProps['shouldHideBackground'];\n size: SmallWaitCursorSize;\n speed: SmallWaitCursorSpeed;\n}>;\n\nconst spin = keyframes`\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n`;\n\nexport const StyledSmallWaitCursorWaitCursor = styled.div<StyledSmallWaitCursorWaitCursorProps>`\n position: absolute;\n top: ${({ shouldHideBackground }) => (shouldHideBackground ? 0 : 5)}px;\n left: ${({ shouldHideBackground }) => (shouldHideBackground ? 0 : 5)}px;\n z-index: 2;\n border-style: solid;\n border-width: 3px;\n border-color: ${({ color, theme }: StyledSmallWaitCursorWaitCursorProps) =>\n color ?? theme.headline};\n height: ${({ shouldHideBackground, size }) =>\n shouldHideBackground ? '100%' : `${size - 10}px`};\n width: ${({ shouldHideBackground, size }) =>\n shouldHideBackground ? '100%' : `${size - 10}px`};\n border-radius: 50%;\n display: inline-block;\n border-top: 3px solid transparent;\n\n animation: ${spin} ${({ speed }) => speed}s linear infinite;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAOAA,OAAA;AAAmC,SAAAC,yBAAAC,W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zD,aAAakB,KAAA;EAAA,IAAC;IAAEN,oBAAoB;IAAEZ;EAAK,CAAC,GAAAkB,KAAA;EAAA,OACpCN,oBAAoB,GAAG,MAAM,GAAI,GAAEZ,IAAI,GAAG,EAAG,IAAG;AAAA,CAAC;AACzD;AACA;AACA;AACA;AACA,iBAAiBQ,IAAK,IAAGW,MAAA;EAAA,IAAC;IAAEC;EAAM,CAAC,GAAAD,MAAA;EAAA,OAAKC,KAAK;AAAA,CAAC;AAC9C,CAAC;AAAChB,OAAA,CAAAM,+BAAA,GAAAA,+BAAA"}
@@ -0,0 +1,25 @@
1
+ import { ChangeEventHandler, CSSProperties, FC, FocusEventHandler } from 'react';
2
+ export type TextAreaProps = {
3
+ /**
4
+ * The maximum height of the text area.
5
+ */
6
+ maxHeight?: CSSProperties['maxHeight'];
7
+ /**
8
+ * Function that is executed when the text area loses focus.
9
+ */
10
+ onBlur?: FocusEventHandler<HTMLTextAreaElement>;
11
+ /**
12
+ * Function that is executed when the text of the text area changes.
13
+ */
14
+ onChange?: ChangeEventHandler<HTMLTextAreaElement>;
15
+ /**
16
+ * Placeholder for the text area field.
17
+ */
18
+ placeholder?: string;
19
+ /**
20
+ * Value if the text area should be controlled.
21
+ */
22
+ value?: string;
23
+ };
24
+ declare const TextArea: FC<TextAreaProps>;
25
+ export default TextArea;
@@ -0,0 +1,72 @@
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 _TextArea = require("./TextArea.styles");
9
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
10
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
11
+ const TextArea = _ref => {
12
+ let {
13
+ placeholder,
14
+ value,
15
+ onChange,
16
+ onBlur,
17
+ maxHeight = '120px'
18
+ } = _ref;
19
+ const [displayedValue, setDisplayedValue] = (0, _react.useState)('');
20
+ const [isOverflowing, setIsOverflowing] = (0, _react.useState)(false);
21
+ const textareaRef = (0, _react.useRef)(null);
22
+ const adjustTextareaHeight = (0, _react.useCallback)(() => {
23
+ if (textareaRef.current) {
24
+ textareaRef.current.style.height = 'auto';
25
+ textareaRef.current.style.height = `${textareaRef.current.scrollHeight}px`;
26
+ setIsOverflowing(textareaRef.current.scrollHeight > parseInt(maxHeight.toString(), 10));
27
+ }
28
+ }, [maxHeight]);
29
+
30
+ /**
31
+ * This hook calculates the height of the TextArea after the displayValue is changed and the content is inside the "textareaRef".
32
+ * To maintain the functionality while clearing the input, the length need to be greater than -1.
33
+ */
34
+ (0, _react.useEffect)(() => {
35
+ if (displayedValue.length > -1) {
36
+ adjustTextareaHeight();
37
+ }
38
+ }, [adjustTextareaHeight, displayedValue]);
39
+
40
+ /**
41
+ * This function sets the external value
42
+ */
43
+ (0, _react.useEffect)(() => {
44
+ if (typeof value === 'string') {
45
+ setDisplayedValue(value);
46
+ }
47
+ }, [value]);
48
+
49
+ /**
50
+ * This function updates the value
51
+ */
52
+ const handleChange = (0, _react.useCallback)(event => {
53
+ setDisplayedValue(event.target.value);
54
+ if (onChange) {
55
+ onChange(event);
56
+ }
57
+ }, [onChange]);
58
+ return (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_TextArea.StyledTextArea, null, /*#__PURE__*/_react.default.createElement(_TextArea.StyledTextAreaInput, {
59
+ ref: textareaRef,
60
+ value: displayedValue,
61
+ placeholder: placeholder,
62
+ onBlur: onBlur,
63
+ onChange: handleChange,
64
+ maxHeight: maxHeight,
65
+ isOverflowing: isOverflowing,
66
+ rows: 1
67
+ })), [displayedValue, handleChange, isOverflowing, maxHeight, onBlur, placeholder]);
68
+ };
69
+ TextArea.displayName = 'TextArea';
70
+ var _default = TextArea;
71
+ exports.default = _default;
72
+ //# sourceMappingURL=TextArea.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextArea.js","names":["_react","_interopRequireWildcard","require","_TextArea","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","TextArea","_ref","placeholder","value","onChange","onBlur","maxHeight","displayedValue","setDisplayedValue","useState","isOverflowing","setIsOverflowing","textareaRef","useRef","adjustTextareaHeight","useCallback","current","style","height","scrollHeight","parseInt","toString","useEffect","length","handleChange","event","target","useMemo","createElement","StyledTextArea","StyledTextAreaInput","ref","rows","displayName","_default","exports"],"sources":["../../../src/components/text-area/TextArea.tsx"],"sourcesContent":["import React, {\n ChangeEvent,\n ChangeEventHandler,\n CSSProperties,\n FC,\n FocusEventHandler,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { StyledTextArea, StyledTextAreaInput } from './TextArea.styles';\n\nexport type TextAreaProps = {\n /**\n * The maximum height of the text area.\n */\n maxHeight?: CSSProperties['maxHeight'];\n /**\n * Function that is executed when the text area loses focus.\n */\n onBlur?: FocusEventHandler<HTMLTextAreaElement>;\n /**\n * Function that is executed when the text of the text area changes.\n */\n onChange?: ChangeEventHandler<HTMLTextAreaElement>;\n /**\n * Placeholder for the text area field.\n */\n placeholder?: string;\n /**\n * Value if the text area should be controlled.\n */\n value?: string;\n};\n\nconst TextArea: FC<TextAreaProps> = ({\n placeholder,\n value,\n onChange,\n onBlur,\n maxHeight = '120px',\n}) => {\n const [displayedValue, setDisplayedValue] = useState('');\n const [isOverflowing, setIsOverflowing] = useState(false);\n\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n\n const adjustTextareaHeight = useCallback(() => {\n if (textareaRef.current) {\n textareaRef.current.style.height = 'auto';\n textareaRef.current.style.height = `${textareaRef.current.scrollHeight}px`;\n\n setIsOverflowing(textareaRef.current.scrollHeight > parseInt(maxHeight.toString(), 10));\n }\n }, [maxHeight]);\n\n /**\n * This hook calculates the height of the TextArea after the displayValue is changed and the content is inside the \"textareaRef\".\n * To maintain the functionality while clearing the input, the length need to be greater than -1.\n */\n useEffect(() => {\n if (displayedValue.length > -1) {\n adjustTextareaHeight();\n }\n }, [adjustTextareaHeight, displayedValue]);\n\n /**\n * This function sets the external value\n */\n useEffect(() => {\n if (typeof value === 'string') {\n setDisplayedValue(value);\n }\n }, [value]);\n\n /**\n * This function updates the value\n */\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLTextAreaElement>) => {\n setDisplayedValue(event.target.value);\n\n if (onChange) {\n onChange(event);\n }\n },\n [onChange]\n );\n\n return useMemo(\n () => (\n <StyledTextArea>\n <StyledTextAreaInput\n ref={textareaRef}\n value={displayedValue}\n placeholder={placeholder}\n onBlur={onBlur}\n onChange={handleChange}\n maxHeight={maxHeight}\n isOverflowing={isOverflowing}\n rows={1}\n />\n </StyledTextArea>\n ),\n [displayedValue, handleChange, isOverflowing, maxHeight, onBlur, placeholder]\n );\n};\n\nTextArea.displayName = 'TextArea';\n\nexport default TextArea;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAYA,IAAAC,SAAA,GAAAD,OAAA;AAAwE,SAAAE,yBAAAC,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C;IACnB;EACJ,CAAC,EACD,CAACrB,QAAQ,CACb,CAAC;EAED,OAAO,IAAAuB,cAAO,EACV,mBACIrD,MAAA,CAAAW,OAAA,CAAA2C,aAAA,CAACnD,SAAA,CAAAoD,cAAc,qBACXvD,MAAA,CAAAW,OAAA,CAAA2C,aAAA,CAACnD,SAAA,CAAAqD,mBAAmB;IAChBC,GAAG,EAAEnB,WAAY;IACjBT,KAAK,EAAEI,cAAe;IACtBL,WAAW,EAAEA,WAAY;IACzBG,MAAM,EAAEA,MAAO;IACfD,QAAQ,EAAEoB,YAAa;IACvBlB,SAAS,EAAEA,SAAU;IACrBI,aAAa,EAAEA,aAAc;IAC7BsB,IAAI,EAAE;EAAE,CACX,CACW,CACnB,EACD,CAACzB,cAAc,EAAEiB,YAAY,EAAEd,aAAa,EAAEJ,SAAS,EAAED,MAAM,EAAEH,WAAW,CAChF,CAAC;AACL,CAAC;AAEDF,QAAQ,CAACiC,WAAW,GAAG,UAAU;AAAC,IAAAC,QAAA,GAEnBlC,QAAQ;AAAAmC,OAAA,CAAAlD,OAAA,GAAAiD,QAAA"}
@@ -0,0 +1,8 @@
1
+ import type { CSSProperties } from 'react';
2
+ export declare const StyledTextArea: import("styled-components").StyledComponent<"div", any, {}, never>;
3
+ export declare const StyledTextAreaInput: import("styled-components").StyledComponent<"textarea", any, {
4
+ maxHeight: CSSProperties['maxHeight'];
5
+ isOverflowing: boolean;
6
+ } & {
7
+ theme: import("../color-scheme-provider/ColorSchemeProvider").Theme;
8
+ }, never>;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StyledTextAreaInput = exports.StyledTextArea = void 0;
7
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+ const StyledTextArea = _styledComponents.default.div``;
10
+ exports.StyledTextArea = StyledTextArea;
11
+ const StyledTextAreaInput = _styledComponents.default.textarea`
12
+ border-radius: 3px;
13
+ border: 1px solid rgba(160, 160, 160, 0.3);
14
+ color: ${_ref => {
15
+ let {
16
+ theme
17
+ } = _ref;
18
+ return theme['006'];
19
+ }};
20
+ resize: none;
21
+ overflow-y: ${_ref2 => {
22
+ let {
23
+ isOverflowing
24
+ } = _ref2;
25
+ return isOverflowing ? 'scroll' : 'hidden';
26
+ }};
27
+ max-height: ${_ref3 => {
28
+ let {
29
+ maxHeight
30
+ } = _ref3;
31
+ return maxHeight;
32
+ }};
33
+ width: 100%;
34
+ padding: 8px 10px;
35
+
36
+ &::-webkit-scrollbar {
37
+ width: 5px;
38
+ }
39
+
40
+ &::-webkit-scrollbar-thumb {
41
+ background: rgba(160, 160, 160, 1);
42
+ border-radius: 3px;
43
+ }
44
+ `;
45
+ exports.StyledTextAreaInput = StyledTextAreaInput;
46
+ //# sourceMappingURL=TextArea.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextArea.styles.js","names":["_styledComponents","_interopRequireDefault","require","obj","__esModule","default","StyledTextArea","styled","div","exports","StyledTextAreaInput","textarea","_ref","theme","_ref2","isOverflowing","_ref3","maxHeight"],"sources":["../../../src/components/text-area/TextArea.styles.ts"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport styled from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\nexport const StyledTextArea = styled.div``;\n\ntype StyledTextAreaInputProps = WithTheme<{\n maxHeight: CSSProperties['maxHeight'];\n isOverflowing: boolean;\n}>;\n\nexport const StyledTextAreaInput = styled.textarea<StyledTextAreaInputProps>`\n border-radius: 3px;\n border: 1px solid rgba(160, 160, 160, 0.3);\n color: ${({ theme }: StyledTextAreaInputProps) => theme['006']};\n resize: none;\n overflow-y: ${({ isOverflowing }) => (isOverflowing ? 'scroll' : 'hidden')};\n max-height: ${({ maxHeight }: StyledTextAreaInputProps) => maxHeight};\n width: 100%;\n padding: 8px 10px;\n\n &::-webkit-scrollbar {\n width: 5px;\n }\n\n &::-webkit-scrollbar-thumb {\n background: rgba(160, 160, 160, 1);\n border-radius: 3px;\n }\n`;\n"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAuC,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAGhC,MAAMG,cAAc,GAAGC,yBAAM,CAACC,GAAI,EAAC;AAACC,OAAA,CAAAH,cAAA,GAAAA,cAAA;AAOpC,MAAMI,mBAAmB,GAAGH,yBAAM,CAACI,QAAmC;AAC7E;AACA;AACA,aAAaC,IAAA;EAAA,IAAC;IAAEC;EAAgC,CAAC,GAAAD,IAAA;EAAA,OAAKC,KAAK,CAAC,KAAK,CAAC;AAAA,CAAC;AACnE;AACA,kBAAkBC,KAAA;EAAA,IAAC;IAAEC;EAAc,CAAC,GAAAD,KAAA;EAAA,OAAMC,aAAa,GAAG,QAAQ,GAAG,QAAQ;AAAA,CAAE;AAC/E,kBAAkBC,KAAA;EAAA,IAAC;IAAEC;EAAoC,CAAC,GAAAD,KAAA;EAAA,OAAKC,SAAS;AAAA,CAAC;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAACR,OAAA,CAAAC,mBAAA,GAAAA,mBAAA"}
@@ -0,0 +1,22 @@
1
+ import { FC, ReactHTML, ReactNode } from 'react';
2
+ import type { ITextstring, TextstringReplacement } from './types';
3
+ export type TextStringProps = {
4
+ /**
5
+ * The element that the text should be displayed in.
6
+ */
7
+ children?: ReactNode;
8
+ /**
9
+ * The tag of the HTML element that the text should be displayed in.
10
+ */
11
+ childrenTagName?: keyof ReactHTML;
12
+ /**
13
+ * A part of the text that should be replaced.
14
+ */
15
+ replacements?: TextstringReplacement[];
16
+ /**
17
+ * The text that should be displayed.
18
+ */
19
+ textString: ITextstring;
20
+ };
21
+ declare const TextString: FC<TextStringProps>;
22
+ export default TextString;
@@ -0,0 +1,63 @@
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 _isTobitEmployee = require("../../utils/isTobitEmployee");
9
+ var _TextStringProvider = require("../textstring-provider/TextStringProvider");
10
+ var _utils = require("../textstring-provider/utils");
11
+ var _TextString = require("./TextString.styles");
12
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
14
+ const TextString = _ref => {
15
+ let {
16
+ textString,
17
+ replacements,
18
+ childrenTagName,
19
+ children
20
+ } = _ref;
21
+ const textStrings = (0, _react.useContext)(_TextStringProvider.TextStringContext);
22
+ const text = (0, _react.useMemo)(() => {
23
+ var _textStrings$textStri;
24
+ const value = (_textStrings$textStri = textStrings[textString.name]) !== null && _textStrings$textStri !== void 0 ? _textStrings$textStri : textString.fallback;
25
+ if (!replacements) {
26
+ return value;
27
+ }
28
+ let newValue = value;
29
+ replacements.forEach(_ref2 => {
30
+ let {
31
+ replacement,
32
+ key
33
+ } = _ref2;
34
+ newValue = newValue.replace(key, replacement);
35
+ });
36
+ return newValue;
37
+ }, [replacements, textString, textStrings]);
38
+ const childElement = (0, _react.useMemo)(() => {
39
+ let element = /*#__PURE__*/(0, _react.createElement)('', null, children);
40
+ if (!children) {
41
+ element = /*#__PURE__*/(0, _react.createElement)(childrenTagName || 'span', null, text);
42
+ }
43
+ return element;
44
+ }, [children, childrenTagName, text]);
45
+ const handleClick = (0, _react.useCallback)(event => {
46
+ if (event.ctrlKey) {
47
+ void (0, _isTobitEmployee.isTobitEmployee)().then(inGroup => {
48
+ if (inGroup) {
49
+ (0, _utils.selectLanguageToChange)({
50
+ textstringName: textString.name
51
+ });
52
+ }
53
+ });
54
+ }
55
+ }, [textString.name]);
56
+ return (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_TextString.StyledTextString, {
57
+ onClick: handleClick
58
+ }, childElement), [childElement, handleClick]);
59
+ };
60
+ TextString.displayName = 'TextString';
61
+ var _default = TextString;
62
+ exports.default = _default;
63
+ //# sourceMappingURL=TextString.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextString.js","names":["_react","_interopRequireWildcard","require","_isTobitEmployee","_TextStringProvider","_utils","_TextString","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","TextString","_ref","textString","replacements","childrenTagName","children","textStrings","useContext","TextStringContext","text","useMemo","_textStrings$textStri","value","name","fallback","newValue","forEach","_ref2","replacement","replace","childElement","element","createElement","handleClick","useCallback","event","ctrlKey","isTobitEmployee","then","inGroup","selectLanguageToChange","textstringName","StyledTextString","onClick","displayName","_default","exports"],"sources":["../../../src/components/textstring/TextString.tsx"],"sourcesContent":["import React, {\n createElement,\n FC,\n MouseEventHandler,\n ReactHTML,\n ReactNode,\n useCallback,\n useContext,\n useMemo,\n} from 'react';\nimport { isTobitEmployee } from '../../utils/isTobitEmployee';\nimport { TextStringContext } from '../textstring-provider/TextStringProvider';\nimport { selectLanguageToChange } from '../textstring-provider/utils';\nimport { StyledTextString } from './TextString.styles';\nimport type { ITextstring, TextstringReplacement } from './types';\n\nexport type TextStringProps = {\n /**\n * The element that the text should be displayed in.\n */\n children?: ReactNode;\n /**\n * The tag of the HTML element that the text should be displayed in.\n */\n childrenTagName?: keyof ReactHTML;\n /**\n * A part of the text that should be replaced.\n */\n replacements?: TextstringReplacement[];\n /**\n * The text that should be displayed.\n */\n textString: ITextstring;\n};\n\nconst TextString: FC<TextStringProps> = ({\n textString,\n replacements,\n childrenTagName,\n children,\n}) => {\n const textStrings = useContext(TextStringContext);\n\n const text = useMemo(() => {\n const value = textStrings[textString.name] ?? textString.fallback;\n\n if (!replacements) {\n return value;\n }\n\n let newValue = value;\n\n replacements.forEach(({ replacement, key }) => {\n newValue = newValue.replace(key, replacement);\n });\n\n return newValue;\n }, [replacements, textString, textStrings]);\n\n const childElement = useMemo(() => {\n let element = createElement('', null, children);\n\n if (!children) {\n element = createElement(childrenTagName || 'span', null, text);\n }\n\n return element;\n }, [children, childrenTagName, text]);\n\n const handleClick: MouseEventHandler<HTMLDivElement> = useCallback(\n (event) => {\n if (event.ctrlKey) {\n void isTobitEmployee().then((inGroup) => {\n if (inGroup) {\n selectLanguageToChange({\n textstringName: textString.name,\n });\n }\n });\n }\n },\n [textString.name]\n );\n\n return useMemo(\n () => <StyledTextString onClick={handleClick}>{childElement}</StyledTextString>,\n [childElement, handleClick]\n );\n};\n\nTextString.displayName = 'TextString';\n\nexport default TextString;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAUA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,mBAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAAuD,SAAAK,yB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,CAAC;QACN;MACJ,CAAC,CAAC;IACN;EACJ,CAAC,EACD,CAACX,UAAU,CAACW,IAAI,CACpB,CAAC;EAED,OAAO,IAAAH,cAAO,EACV,mBAAMvC,MAAA,CAAAc,OAAA,CAAAqC,aAAA,CAAC7C,WAAA,CAAAuD,gBAAgB;IAACC,OAAO,EAAEV;EAAY,GAAEH,YAA+B,CAAC,EAC/E,CAACA,YAAY,EAAEG,WAAW,CAC9B,CAAC;AACL,CAAC;AAEDvB,UAAU,CAACkC,WAAW,GAAG,YAAY;AAAC,IAAAC,QAAA,GAEvBnC,UAAU;AAAAoC,OAAA,CAAAnD,OAAA,GAAAkD,QAAA"}
@@ -0,0 +1 @@
1
+ export declare const StyledTextString: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StyledTextString = void 0;
7
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+ const StyledTextString = _styledComponents.default.div``;
10
+ exports.StyledTextString = StyledTextString;
11
+ //# sourceMappingURL=TextString.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextString.styles.js","names":["_styledComponents","_interopRequireDefault","require","obj","__esModule","default","StyledTextString","styled","div","exports"],"sources":["../../../src/components/textstring/TextString.styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nexport const StyledTextString = 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,gBAAgB,GAAGC,yBAAM,CAACC,GAAI,EAAC;AAACC,OAAA,CAAAH,gBAAA,GAAAA,gBAAA"}
@@ -0,0 +1,8 @@
1
+ export interface TextstringReplacement {
2
+ key: string;
3
+ replacement: string;
4
+ }
5
+ export interface ITextstring {
6
+ fallback: string;
7
+ name: string;
8
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../src/components/textstring/types.ts"],"sourcesContent":["export interface TextstringReplacement {\n key: string;\n replacement: string;\n}\n\nexport interface ITextstring {\n fallback: string;\n name: string;\n}\n"],"mappings":""}
@@ -0,0 +1,21 @@
1
+ import React, { FC, ReactNode } from 'react';
2
+ export type TextStringValue = {
3
+ [key: string]: string;
4
+ };
5
+ export declare const TextStringContext: React.Context<TextStringValue>;
6
+ export type TextStringProviderProps = {
7
+ /**
8
+ * The element that should use the library.
9
+ */
10
+ children?: ReactNode;
11
+ /**
12
+ * The language that should be used.
13
+ */
14
+ language: string;
15
+ /**
16
+ * The name of the library.
17
+ */
18
+ libraryName: string;
19
+ };
20
+ declare const TextStringProvider: FC<TextStringProviderProps>;
21
+ export default TextStringProvider;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.TextStringContext = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _utils = require("./utils");
9
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
10
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
11
+ const TextStringContext = /*#__PURE__*/(0, _react.createContext)({});
12
+ exports.TextStringContext = TextStringContext;
13
+ const TextStringProvider = _ref => {
14
+ let {
15
+ children,
16
+ libraryName,
17
+ language
18
+ } = _ref;
19
+ const [textStrings, setTextStrings] = (0, _react.useState)({});
20
+ (0, _react.useEffect)(() => {
21
+ const loadData = async () => {
22
+ const textStringResult = await (0, _utils.loadLibrary)({
23
+ libraryName,
24
+ language
25
+ });
26
+ if (textStringResult) {
27
+ setTextStrings(textStringResult);
28
+ }
29
+ };
30
+ void loadData();
31
+ }, [language, libraryName]);
32
+ return /*#__PURE__*/_react.default.createElement(TextStringContext.Provider, {
33
+ value: textStrings
34
+ }, children);
35
+ };
36
+ TextStringProvider.displayName = 'TextStringProvider';
37
+ var _default = TextStringProvider;
38
+ exports.default = _default;
39
+ //# sourceMappingURL=TextStringProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextStringProvider.js","names":["_react","_interopRequireWildcard","require","_utils","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","TextStringContext","createContext","exports","TextStringProvider","_ref","children","libraryName","language","textStrings","setTextStrings","useState","useEffect","loadData","textStringResult","loadLibrary","createElement","Provider","value","displayName","_default"],"sources":["../../../src/components/textstring-provider/TextStringProvider.tsx"],"sourcesContent":["import React, { createContext, FC, ReactNode, useEffect, useState } from 'react';\nimport { loadLibrary } from './utils';\n\nexport type TextStringValue = {\n [key: string]: string;\n};\n\nexport const TextStringContext = createContext<TextStringValue>({});\n\nexport type TextStringProviderProps = {\n /**\n * The element that should use the library.\n */\n children?: ReactNode;\n /**\n * The language that should be used.\n */\n language: string;\n /**\n * The name of the library.\n */\n libraryName: string;\n};\n\nconst TextStringProvider: FC<TextStringProviderProps> = ({ children, libraryName, language }) => {\n const [textStrings, setTextStrings] = useState<TextStringValue>({});\n\n useEffect(() => {\n const loadData = async () => {\n const textStringResult = await loadLibrary({ libraryName, language });\n\n if (textStringResult) {\n setTextStrings(textStringResult);\n }\n };\n\n void loadData();\n }, [language, libraryName]);\n\n return <TextStringContext.Provider value={textStrings}>{children}</TextStringContext.Provider>;\n};\n\nTextStringProvider.displayName = 'TextStringProvider';\n\nexport default TextStringProvider;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAAsC,SAAAE,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAJ,wBAAAQ,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,M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,CAAC;AAClG,CAAC;AAEDF,kBAAkB,CAACe,WAAW,GAAG,oBAAoB;AAAC,IAAAC,QAAA,GAEvChB,kBAAkB;AAAAD,OAAA,CAAAjB,OAAA,GAAAkC,QAAA"}
@@ -0,0 +1,11 @@
1
+ import type { TextStringValue } from './TextStringProvider';
2
+ interface LoadLibraryOptions {
3
+ libraryName: string;
4
+ language: string;
5
+ }
6
+ export declare const loadLibrary: ({ language, libraryName }: LoadLibraryOptions) => Promise<TextStringValue | null>;
7
+ interface SelectLanguageToChangeOptions {
8
+ textstringName: string;
9
+ }
10
+ export declare const selectLanguageToChange: ({ textstringName }: SelectLanguageToChangeOptions) => void;
11
+ export {};
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.selectLanguageToChange = exports.loadLibrary = void 0;
7
+ const loadLibrary = async _ref => {
8
+ let {
9
+ language,
10
+ libraryName
11
+ } = _ref;
12
+ const response = await fetch(`https://webapi.tobit.com/TextStringService/v1.0/LangStrings/${libraryName}?language=${language}`);
13
+ if (response.status !== 200) {
14
+ return null;
15
+ }
16
+ return await response.json();
17
+ };
18
+ exports.loadLibrary = loadLibrary;
19
+ const selectLanguageToChange = _ref2 => {
20
+ let {
21
+ textstringName
22
+ } = _ref2;
23
+ void chayns.dialog.iFrame({
24
+ url: 'https://tapp-staging.chayns-static.space/text-string-tapp/v1/iframe-edit.html',
25
+ buttons: [],
26
+ input: {
27
+ textstring: textstringName
28
+ }
29
+ });
30
+ };
31
+ exports.selectLanguageToChange = selectLanguageToChange;
32
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","names":["loadLibrary","_ref","language","libraryName","response","fetch","status","json","exports","selectLanguageToChange","_ref2","textstringName","chayns","dialog","iFrame","url","buttons","input","textstring"],"sources":["../../../src/components/textstring-provider/utils.ts"],"sourcesContent":["import type { TextStringValue } from './TextStringProvider';\n\ninterface LoadLibraryOptions {\n libraryName: string;\n language: string;\n}\n\nexport const loadLibrary = async ({ language, libraryName }: LoadLibraryOptions) => {\n const response = await fetch(\n `https://webapi.tobit.com/TextStringService/v1.0/LangStrings/${libraryName}?language=${language}`\n );\n\n if (response.status !== 200) {\n return null;\n }\n\n return (await response.json()) as TextStringValue;\n};\n\ninterface SelectLanguageToChangeOptions {\n textstringName: string;\n}\n\nexport const selectLanguageToChange = ({ textstringName }: SelectLanguageToChangeOptions) => {\n void chayns.dialog.iFrame({\n url: 'https://tapp-staging.chayns-static.space/text-string-tapp/v1/iframe-edit.html',\n buttons: [],\n input: { textstring: textstringName },\n });\n};\n"],"mappings":";;;;;;AAOO,MAAMA,WAAW,GAAG,MAAAC,IAAA,IAAyD;EAAA,IAAlD;IAAEC,QAAQ;IAAEC;EAAgC,CAAC,GAAAF,IAAA;EAC3E,MAAMG,QAAQ,GAAG,MAAMC,KAAK,CACvB,+DAA8DF,WAAY,aAAYD,QAAS,EACpG,CAAC;EAED,IAAIE,QAAQ,CAACE,MAAM,KAAK,GAAG,EAAE;IACzB,OAAO,IAAI;EACf;EAEA,OAAQ,MAAMF,QAAQ,CAACG,IAAI,CAAC,CAAC;AACjC,CAAC;AAACC,OAAA,CAAAR,WAAA,GAAAA,WAAA;AAMK,MAAMS,sBAAsB,GAAGC,KAAA,IAAuD;EAAA,IAAtD;IAAEC;EAA8C,CAAC,GAAAD,KAAA;EACpF,KAAKE,MAAM,CAACC,MAAM,CAACC,MAAM,CAAC;IACtBC,GAAG,EAAE,+EAA+E;IACpFC,OAAO,EAAE,EAAE;IACXC,KAAK,EAAE;MAAEC,UAAU,EAAEP;IAAe;EACxC,CAAC,CAAC;AACN,CAAC;AAACH,OAAA,CAAAC,sBAAA,GAAAA,sBAAA"}
@@ -0,0 +1,18 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import type { ITooltipItem } from './interface';
3
+ export type TooltipProps = {
4
+ /**
5
+ * The elements that the tooltip should surround.
6
+ */
7
+ children: ReactNode;
8
+ /**
9
+ * The content that should be displayed.
10
+ */
11
+ item: ITooltipItem;
12
+ /**
13
+ * whether the tooltip should be shown.
14
+ */
15
+ isDisabled?: boolean;
16
+ };
17
+ declare const Tooltip: FC<TooltipProps>;
18
+ export default Tooltip;