@chayns-components/core 5.0.0-beta.3 → 5.0.0-beta.300

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 (350) 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 +72 -6
  9. package/lib/components/accordion/Accordion.js +109 -166
  10. package/lib/components/accordion/Accordion.js.map +1 -1
  11. package/lib/components/accordion/Accordion.styles.d.ts +7 -0
  12. package/lib/components/accordion/Accordion.styles.js +108 -0
  13. package/lib/components/accordion/Accordion.styles.js.map +1 -0
  14. package/lib/components/accordion/accordion-body/AccordionBody.d.ts +16 -2
  15. package/lib/components/accordion/accordion-body/AccordionBody.js +25 -25
  16. package/lib/components/accordion/accordion-body/AccordionBody.js.map +1 -1
  17. package/lib/components/accordion/accordion-body/AccordionBody.styles.d.ts +4 -0
  18. package/lib/components/accordion/accordion-body/AccordionBody.styles.js +24 -0
  19. package/lib/components/accordion/accordion-body/AccordionBody.styles.js.map +1 -0
  20. package/lib/components/accordion/accordion-content/AccordionContent.d.ts +14 -3
  21. package/lib/components/accordion/accordion-content/AccordionContent.js +20 -24
  22. package/lib/components/accordion/accordion-content/AccordionContent.js.map +1 -1
  23. package/lib/components/accordion/accordion-content/AccordionContent.styles.d.ts +6 -0
  24. package/lib/components/accordion/accordion-content/AccordionContent.styles.js +34 -0
  25. package/lib/components/accordion/accordion-content/AccordionContent.styles.js.map +1 -0
  26. package/lib/components/accordion/accordion-group/AccordionGroup.d.ts +27 -0
  27. package/lib/components/accordion/accordion-group/AccordionGroup.js +57 -0
  28. package/lib/components/accordion/accordion-group/AccordionGroup.js.map +1 -0
  29. package/lib/components/accordion/accordion-head/AccordionHead.d.ts +10 -4
  30. package/lib/components/accordion/accordion-head/AccordionHead.js +94 -127
  31. package/lib/components/accordion/accordion-head/AccordionHead.js.map +1 -1
  32. package/lib/components/accordion/accordion-head/AccordionHead.styles.d.ts +19 -0
  33. package/lib/components/accordion/accordion-head/AccordionHead.styles.js +153 -0
  34. package/lib/components/accordion/accordion-head/AccordionHead.styles.js.map +1 -0
  35. package/lib/components/accordion/accordion-intro/AccordionIntro.d.ts +9 -0
  36. package/lib/components/accordion/accordion-intro/AccordionIntro.js +20 -0
  37. package/lib/components/accordion/accordion-intro/AccordionIntro.js.map +1 -0
  38. package/lib/components/accordion/accordion-intro/AccordionIntro.styles.d.ts +1 -0
  39. package/lib/components/accordion/accordion-intro/AccordionIntro.styles.js +12 -0
  40. package/lib/components/accordion/accordion-intro/AccordionIntro.styles.js.map +1 -0
  41. package/lib/components/accordion/accordion-item/AccordionItem.d.ts +9 -0
  42. package/lib/components/accordion/accordion-item/AccordionItem.js +27 -0
  43. package/lib/components/accordion/accordion-item/AccordionItem.js.map +1 -0
  44. package/lib/components/accordion/accordion-item/AccordionItem.styles.d.ts +5 -0
  45. package/lib/components/accordion/accordion-item/AccordionItem.styles.js +33 -0
  46. package/lib/components/accordion/accordion-item/AccordionItem.styles.js.map +1 -0
  47. package/lib/components/accordion/utils.d.ts +11 -0
  48. package/lib/components/accordion/utils.js +36 -0
  49. package/lib/components/accordion/utils.js.map +1 -0
  50. package/lib/components/amount-control/AmountControl.d.ts +22 -0
  51. package/lib/components/amount-control/AmountControl.js +185 -0
  52. package/lib/components/amount-control/AmountControl.js.map +1 -0
  53. package/lib/components/amount-control/AmountControl.styles.d.ts +14 -0
  54. package/lib/components/amount-control/AmountControl.styles.js +58 -0
  55. package/lib/components/amount-control/AmountControl.styles.js.map +1 -0
  56. package/lib/components/amount-control/utils.d.ts +7 -0
  57. package/lib/components/amount-control/utils.js +22 -0
  58. package/lib/components/amount-control/utils.js.map +1 -0
  59. package/lib/components/badge/Badge.d.ts +9 -1
  60. package/lib/components/badge/Badge.js +15 -28
  61. package/lib/components/badge/Badge.js.map +1 -1
  62. package/lib/components/badge/Badge.styles.d.ts +4 -0
  63. package/lib/components/badge/Badge.styles.js +31 -0
  64. package/lib/components/badge/Badge.styles.js.map +1 -0
  65. package/lib/components/button/Button.d.ts +6 -2
  66. package/lib/components/button/Button.js +68 -47
  67. package/lib/components/button/Button.js.map +1 -1
  68. package/lib/components/button/Button.styles.d.ts +9 -0
  69. package/lib/components/button/Button.styles.js +66 -0
  70. package/lib/components/button/Button.styles.js.map +1 -0
  71. package/lib/components/checkbox/Checkbox.d.ts +25 -0
  72. package/lib/components/checkbox/Checkbox.js +43 -0
  73. package/lib/components/checkbox/Checkbox.js.map +1 -0
  74. package/lib/components/checkbox/Checkbox.styles.d.ts +6 -0
  75. package/lib/components/checkbox/Checkbox.styles.js +128 -0
  76. package/lib/components/checkbox/Checkbox.styles.js.map +1 -0
  77. package/lib/components/color-scheme-provider/ColorSchemeProvider.d.ts +7 -1
  78. package/lib/components/color-scheme-provider/ColorSchemeProvider.js +45 -83
  79. package/lib/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
  80. package/lib/components/color-scheme-provider/font.d.ts +6 -0
  81. package/lib/components/color-scheme-provider/font.js +59 -0
  82. package/lib/components/color-scheme-provider/font.js.map +1 -0
  83. package/lib/components/combobox/ComboBox.d.ts +25 -0
  84. package/lib/components/combobox/ComboBox.js +143 -0
  85. package/lib/components/combobox/ComboBox.js.map +1 -0
  86. package/lib/components/combobox/ComboBox.styles.d.ts +17 -0
  87. package/lib/components/combobox/ComboBox.styles.js +123 -0
  88. package/lib/components/combobox/ComboBox.styles.js.map +1 -0
  89. package/lib/components/combobox/combobox-item/ComboBoxItem.d.ts +18 -0
  90. package/lib/components/combobox/combobox-item/ComboBoxItem.js +29 -0
  91. package/lib/components/combobox/combobox-item/ComboBoxItem.js.map +1 -0
  92. package/lib/components/combobox/combobox-item/ComboBoxItem.styles.d.ts +6 -0
  93. package/lib/components/combobox/combobox-item/ComboBoxItem.styles.js +28 -0
  94. package/lib/components/combobox/combobox-item/ComboBoxItem.styles.js.map +1 -0
  95. package/lib/components/content-card/ContentCard.d.ts +9 -0
  96. package/lib/components/content-card/ContentCard.js +18 -0
  97. package/lib/components/content-card/ContentCard.js.map +1 -0
  98. package/lib/components/content-card/ContentCard.styles.d.ts +1 -0
  99. package/lib/components/content-card/ContentCard.styles.js +22 -0
  100. package/lib/components/content-card/ContentCard.styles.js.map +1 -0
  101. package/lib/components/context-menu/ContextMenu.d.ts +51 -0
  102. package/lib/components/context-menu/ContextMenu.js +156 -0
  103. package/lib/components/context-menu/ContextMenu.js.map +1 -0
  104. package/lib/components/context-menu/ContextMenu.styles.d.ts +1 -0
  105. package/lib/components/context-menu/ContextMenu.styles.js +12 -0
  106. package/lib/components/context-menu/ContextMenu.styles.js.map +1 -0
  107. package/lib/components/context-menu/constants/alignment.d.ts +8 -0
  108. package/lib/components/context-menu/constants/alignment.js +16 -0
  109. package/lib/components/context-menu/constants/alignment.js.map +1 -0
  110. package/lib/components/context-menu/context-menu-content/ContextMenuContent.d.ts +10 -0
  111. package/lib/components/context-menu/context-menu-content/ContextMenuContent.js +77 -0
  112. package/lib/components/context-menu/context-menu-content/ContextMenuContent.js.map +1 -0
  113. package/lib/components/context-menu/context-menu-content/ContextMenuContent.styles.d.ts +11 -0
  114. package/lib/components/context-menu/context-menu-content/ContextMenuContent.styles.js +113 -0
  115. package/lib/components/context-menu/context-menu-content/ContextMenuContent.styles.js.map +1 -0
  116. package/lib/components/date-info/DateInfo.d.ts +40 -0
  117. package/lib/components/date-info/DateInfo.js +108 -0
  118. package/lib/components/date-info/DateInfo.js.map +1 -0
  119. package/lib/components/date-info/utils/format.d.ts +43 -0
  120. package/lib/components/date-info/utils/format.js +287 -0
  121. package/lib/components/date-info/utils/format.js.map +1 -0
  122. package/lib/components/date-info/utils/language.d.ts +1 -0
  123. package/lib/components/date-info/utils/language.js +35 -0
  124. package/lib/components/date-info/utils/language.js.map +1 -0
  125. package/lib/components/filter-button/FilterButton.d.ts +22 -0
  126. package/lib/components/filter-button/FilterButton.js +88 -0
  127. package/lib/components/filter-button/FilterButton.js.map +1 -0
  128. package/lib/components/filter-button/FilterButton.styles.d.ts +1 -0
  129. package/lib/components/filter-button/FilterButton.styles.js +14 -0
  130. package/lib/components/filter-button/FilterButton.styles.js.map +1 -0
  131. package/lib/components/filter-button/filter-button-item/FilterButtonItem.d.ts +14 -0
  132. package/lib/components/filter-button/filter-button-item/FilterButtonItem.js +47 -0
  133. package/lib/components/filter-button/filter-button-item/FilterButtonItem.js.map +1 -0
  134. package/lib/components/filter-button/filter-button-item/FilterButtonItem.styles.d.ts +26 -0
  135. package/lib/components/filter-button/filter-button-item/FilterButtonItem.styles.js +104 -0
  136. package/lib/components/filter-button/filter-button-item/FilterButtonItem.styles.js.map +1 -0
  137. package/lib/components/filter-button/types.d.ts +15 -0
  138. package/lib/components/filter-button/types.js +17 -0
  139. package/lib/components/filter-button/types.js.map +1 -0
  140. package/lib/components/grid-image/GridImage.d.ts +19 -0
  141. package/lib/components/grid-image/GridImage.js +45 -0
  142. package/lib/components/grid-image/GridImage.js.map +1 -0
  143. package/lib/components/grid-image/GridImage.styles.d.ts +21 -0
  144. package/lib/components/grid-image/GridImage.styles.js +101 -0
  145. package/lib/components/grid-image/GridImage.styles.js.map +1 -0
  146. package/lib/components/icon/Icon.d.ts +11 -3
  147. package/lib/components/icon/Icon.js +37 -82
  148. package/lib/components/icon/Icon.js.map +1 -1
  149. package/lib/components/icon/Icon.styles.d.ts +15 -0
  150. package/lib/components/icon/Icon.styles.js +74 -0
  151. package/lib/components/icon/Icon.styles.js.map +1 -0
  152. package/lib/components/icon/utils.d.ts +1 -0
  153. package/lib/components/icon/utils.js +13 -0
  154. package/lib/components/icon/utils.js.map +1 -0
  155. package/lib/components/input/Input.d.ts +65 -0
  156. package/lib/components/input/Input.js +119 -0
  157. package/lib/components/input/Input.js.map +1 -0
  158. package/lib/components/input/Input.styles.d.ts +15 -0
  159. package/lib/components/input/Input.styles.js +98 -0
  160. package/lib/components/input/Input.styles.js.map +1 -0
  161. package/lib/components/list/List.d.ts +18 -0
  162. package/lib/components/list/List.js +52 -0
  163. package/lib/components/list/List.js.map +1 -0
  164. package/lib/components/list/list-item/ListItem.d.ts +67 -0
  165. package/lib/components/list/list-item/ListItem.js +91 -0
  166. package/lib/components/list/list-item/ListItem.js.map +1 -0
  167. package/lib/components/list/list-item/ListItem.styles.d.ts +6 -0
  168. package/lib/components/list/list-item/ListItem.styles.js +55 -0
  169. package/lib/components/list/list-item/ListItem.styles.js.map +1 -0
  170. package/lib/components/list/list-item/list-item-body/ListItemBody.d.ts +6 -0
  171. package/lib/components/list/list-item/list-item-body/ListItemBody.js +57 -0
  172. package/lib/components/list/list-item/list-item-body/ListItemBody.js.map +1 -0
  173. package/lib/components/list/list-item/list-item-body/ListItemBody.styles.d.ts +1 -0
  174. package/lib/components/list/list-item/list-item-body/ListItemBody.styles.js +13 -0
  175. package/lib/components/list/list-item/list-item-body/ListItemBody.styles.js.map +1 -0
  176. package/lib/components/list/list-item/list-item-content/ListItemContent.d.ts +3 -0
  177. package/lib/components/list/list-item/list-item-content/ListItemContent.js +20 -0
  178. package/lib/components/list/list-item/list-item-content/ListItemContent.js.map +1 -0
  179. package/lib/components/list/list-item/list-item-content/ListItemContent.styles.d.ts +1 -0
  180. package/lib/components/list/list-item/list-item-content/ListItemContent.styles.js +18 -0
  181. package/lib/components/list/list-item/list-item-content/ListItemContent.styles.js.map +1 -0
  182. package/lib/components/list/list-item/list-item-head/ListItemHead.d.ts +18 -0
  183. package/lib/components/list/list-item/list-item-head/ListItemHead.js +99 -0
  184. package/lib/components/list/list-item/list-item-head/ListItemHead.js.map +1 -0
  185. package/lib/components/list/list-item/list-item-head/ListItemHead.styles.d.ts +20 -0
  186. package/lib/components/list/list-item/list-item-head/ListItemHead.styles.js +99 -0
  187. package/lib/components/list/list-item/list-item-head/ListItemHead.styles.js.map +1 -0
  188. package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.d.ts +6 -0
  189. package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.js +22 -0
  190. package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.js.map +1 -0
  191. package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.styles.d.ts +1 -0
  192. package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.styles.js +31 -0
  193. package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.styles.js.map +1 -0
  194. package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.d.ts +7 -0
  195. package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.js +43 -0
  196. package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.js.map +1 -0
  197. package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.styles.d.ts +10 -0
  198. package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.styles.js +50 -0
  199. package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.styles.js.map +1 -0
  200. package/lib/components/mention-finder/MentionFinder.d.ts +31 -0
  201. package/lib/components/mention-finder/MentionFinder.js +140 -0
  202. package/lib/components/mention-finder/MentionFinder.js.map +1 -0
  203. package/lib/components/mention-finder/MentionFinder.styles.d.ts +5 -0
  204. package/lib/components/mention-finder/MentionFinder.styles.js +92 -0
  205. package/lib/components/mention-finder/MentionFinder.styles.js.map +1 -0
  206. package/lib/components/mention-finder/constants/alignment.d.ts +4 -0
  207. package/lib/components/mention-finder/constants/alignment.js +12 -0
  208. package/lib/components/mention-finder/constants/alignment.js.map +1 -0
  209. package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.d.ts +10 -0
  210. package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.js +31 -0
  211. package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.js.map +1 -0
  212. package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.styles.d.ts +8 -0
  213. package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.styles.js +95 -0
  214. package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.styles.js.map +1 -0
  215. package/lib/components/number-input/NumberInput.d.ts +46 -0
  216. package/lib/components/number-input/NumberInput.js +123 -0
  217. package/lib/components/number-input/NumberInput.js.map +1 -0
  218. package/lib/components/number-input/constants/number.d.ts +4 -0
  219. package/lib/components/number-input/constants/number.js +11 -0
  220. package/lib/components/number-input/constants/number.js.map +1 -0
  221. package/lib/components/number-input/utils/number.d.ts +21 -0
  222. package/lib/components/number-input/utils/number.js +64 -0
  223. package/lib/components/number-input/utils/number.js.map +1 -0
  224. package/lib/components/popup/Popup.d.ts +26 -0
  225. package/lib/components/popup/Popup.js +154 -0
  226. package/lib/components/popup/Popup.js.map +1 -0
  227. package/lib/components/popup/Popup.styles.d.ts +4 -0
  228. package/lib/components/popup/Popup.styles.js +25 -0
  229. package/lib/components/popup/Popup.styles.js.map +1 -0
  230. package/lib/components/popup/popup-content/PopupContent.d.ts +9 -0
  231. package/lib/components/popup/popup-content/PopupContent.js +63 -0
  232. package/lib/components/popup/popup-content/PopupContent.js.map +1 -0
  233. package/lib/components/popup/popup-content/PopupContent.styles.d.ts +7 -0
  234. package/lib/components/popup/popup-content/PopupContent.styles.js +92 -0
  235. package/lib/components/popup/popup-content/PopupContent.styles.js.map +1 -0
  236. package/lib/components/popup/types.d.ts +16 -0
  237. package/lib/components/popup/types.js +16 -0
  238. package/lib/components/popup/types.js.map +1 -0
  239. package/lib/components/progress-bar/ProgressBar.d.ts +9 -0
  240. package/lib/components/progress-bar/ProgressBar.js +38 -0
  241. package/lib/components/progress-bar/ProgressBar.js.map +1 -0
  242. package/lib/components/progress-bar/ProgressBar.styles.d.ts +7 -0
  243. package/lib/components/progress-bar/ProgressBar.styles.js +36 -0
  244. package/lib/components/progress-bar/ProgressBar.styles.js.map +1 -0
  245. package/lib/components/radio-button/RadioButton.d.ts +26 -0
  246. package/lib/components/radio-button/RadioButton.js +85 -0
  247. package/lib/components/radio-button/RadioButton.js.map +1 -0
  248. package/lib/components/radio-button/RadioButton.styles.d.ts +22 -0
  249. package/lib/components/radio-button/RadioButton.styles.js +95 -0
  250. package/lib/components/radio-button/RadioButton.styles.js.map +1 -0
  251. package/lib/components/radio-button/radio-button-group/RadioButtonGroup.d.ts +17 -0
  252. package/lib/components/radio-button/radio-button-group/RadioButtonGroup.js +46 -0
  253. package/lib/components/radio-button/radio-button-group/RadioButtonGroup.js.map +1 -0
  254. package/lib/components/radio-button/types.d.ts +4 -0
  255. package/lib/components/radio-button/types.js +6 -0
  256. package/lib/components/radio-button/types.js.map +1 -0
  257. package/lib/components/scroll-view/ScrollView.d.ts +9 -0
  258. package/lib/components/scroll-view/ScrollView.js +22 -0
  259. package/lib/components/scroll-view/ScrollView.js.map +1 -0
  260. package/lib/components/scroll-view/ScrollView.styles.d.ts +6 -0
  261. package/lib/components/scroll-view/ScrollView.styles.js +26 -0
  262. package/lib/components/scroll-view/ScrollView.styles.js.map +1 -0
  263. package/lib/components/search-box/SearchBox.d.ts +30 -0
  264. package/lib/components/search-box/SearchBox.js +179 -0
  265. package/lib/components/search-box/SearchBox.js.map +1 -0
  266. package/lib/components/search-box/SearchBox.styles.d.ts +7 -0
  267. package/lib/components/search-box/SearchBox.styles.js +56 -0
  268. package/lib/components/search-box/SearchBox.styles.js.map +1 -0
  269. package/lib/components/search-box/search-box-item/SearchBoxItem.d.ts +9 -0
  270. package/lib/components/search-box/search-box-item/SearchBoxItem.js +29 -0
  271. package/lib/components/search-box/search-box-item/SearchBoxItem.js.map +1 -0
  272. package/lib/components/search-box/search-box-item/SearchBoxItem.styles.d.ts +6 -0
  273. package/lib/components/search-box/search-box-item/SearchBoxItem.styles.js +28 -0
  274. package/lib/components/search-box/search-box-item/SearchBoxItem.styles.js.map +1 -0
  275. package/lib/components/search-box/types.d.ts +4 -0
  276. package/lib/components/search-box/types.js +6 -0
  277. package/lib/components/search-box/types.js.map +1 -0
  278. package/lib/components/search-box/utils.d.ts +7 -0
  279. package/lib/components/search-box/utils.js +23 -0
  280. package/lib/components/search-box/utils.js.map +1 -0
  281. package/lib/components/search-input/SearchInput.d.ts +25 -0
  282. package/lib/components/search-input/SearchInput.js +95 -0
  283. package/lib/components/search-input/SearchInput.js.map +1 -0
  284. package/lib/components/search-input/SearchInput.styles.d.ts +4 -0
  285. package/lib/components/search-input/SearchInput.styles.js +26 -0
  286. package/lib/components/search-input/SearchInput.styles.js.map +1 -0
  287. package/lib/components/sharing-bar/SharingBar.d.ts +18 -0
  288. package/lib/components/sharing-bar/SharingBar.js +113 -0
  289. package/lib/components/sharing-bar/SharingBar.js.map +1 -0
  290. package/lib/components/sharing-bar/SharingBar.styles.d.ts +5 -0
  291. package/lib/components/sharing-bar/SharingBar.styles.js +24 -0
  292. package/lib/components/sharing-bar/SharingBar.styles.js.map +1 -0
  293. package/lib/components/slider/Slider.d.ts +21 -0
  294. package/lib/components/slider/Slider.js +51 -0
  295. package/lib/components/slider/Slider.js.map +1 -0
  296. package/lib/components/slider/Slider.styles.d.ts +8 -0
  297. package/lib/components/slider/Slider.styles.js +75 -0
  298. package/lib/components/slider/Slider.styles.js.map +1 -0
  299. package/lib/components/small-wait-cursor/SmallWaitCursor.d.ts +31 -0
  300. package/lib/components/small-wait-cursor/SmallWaitCursor.js +42 -0
  301. package/lib/components/small-wait-cursor/SmallWaitCursor.js.map +1 -0
  302. package/lib/components/small-wait-cursor/SmallWaitCursor.styles.d.ts +18 -0
  303. package/lib/components/small-wait-cursor/SmallWaitCursor.styles.js +102 -0
  304. package/lib/components/small-wait-cursor/SmallWaitCursor.styles.js.map +1 -0
  305. package/lib/components/text-area/TextArea.d.ts +25 -0
  306. package/lib/components/text-area/TextArea.js +70 -0
  307. package/lib/components/text-area/TextArea.js.map +1 -0
  308. package/lib/components/text-area/TextArea.styles.d.ts +11 -0
  309. package/lib/components/text-area/TextArea.styles.js +73 -0
  310. package/lib/components/text-area/TextArea.styles.js.map +1 -0
  311. package/lib/components/tooltip/Tooltip.d.ts +18 -0
  312. package/lib/components/tooltip/Tooltip.js +32 -0
  313. package/lib/components/tooltip/Tooltip.js.map +1 -0
  314. package/lib/components/tooltip/Tooltip.styles.d.ts +1 -0
  315. package/lib/components/tooltip/Tooltip.styles.js +10 -0
  316. package/lib/components/tooltip/Tooltip.styles.js.map +1 -0
  317. package/lib/components/tooltip/interface.d.ts +4 -0
  318. package/lib/components/tooltip/interface.js +6 -0
  319. package/lib/components/tooltip/interface.js.map +1 -0
  320. package/lib/components/tooltip/tooltip-item/TooltipItem.d.ts +7 -0
  321. package/lib/components/tooltip/tooltip-item/TooltipItem.js +20 -0
  322. package/lib/components/tooltip/tooltip-item/TooltipItem.js.map +1 -0
  323. package/lib/components/tooltip/tooltip-item/TooltipItem.styles.d.ts +7 -0
  324. package/lib/components/tooltip/tooltip-item/TooltipItem.styles.js +29 -0
  325. package/lib/components/tooltip/tooltip-item/TooltipItem.styles.js.map +1 -0
  326. package/lib/hooks/uuid.d.ts +1 -0
  327. package/lib/hooks/uuid.js +14 -0
  328. package/lib/hooks/uuid.js.map +1 -0
  329. package/lib/index.d.ts +41 -0
  330. package/lib/index.js +263 -11
  331. package/lib/index.js.map +1 -1
  332. package/lib/types/chayns.d.ts +112 -0
  333. package/lib/types/chayns.js +13 -0
  334. package/lib/types/chayns.js.map +1 -0
  335. package/lib/types/file.d.ts +42 -0
  336. package/lib/types/file.js +6 -0
  337. package/lib/types/file.js.map +1 -0
  338. package/lib/utils/calculate.d.ts +2 -0
  339. package/lib/utils/calculate.js +40 -0
  340. package/lib/utils/calculate.js.map +1 -0
  341. package/lib/utils/fileDialog.d.ts +7 -0
  342. package/lib/utils/fileDialog.js +74 -0
  343. package/lib/utils/fileDialog.js.map +1 -0
  344. package/lib/utils/isTobitEmployee.d.ts +1 -0
  345. package/lib/utils/isTobitEmployee.js +31 -0
  346. package/lib/utils/isTobitEmployee.js.map +1 -0
  347. package/lib/utils/uploadFile.d.ts +9 -0
  348. package/lib/utils/uploadFile.js +48 -0
  349. package/lib/utils/uploadFile.js.map +1 -0
  350. package/package.json +68 -62
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Input.js","names":["_react","_interopRequireWildcard","require","_Icon","_interopRequireDefault","_Input","_styledComponents","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","Input","forwardRef","_ref","ref","iconElement","inputMode","isDisabled","onBlur","onChange","onFocus","onKeyDown","placeholder","placeholderElement","shouldShowClearIcon","type","value","shouldUseAutoFocus","isInvalid","hasValue","setHasValue","useState","theme","useTheme","inputRef","useRef","handleClearIconClick","useCallback","current","target","handleInputFieldChange","event","useImperativeHandle","focus","_inputRef$current","useEffect","labelPosition","useMemo","bottom","right","left","top","createElement","StyledInput","className","StyledInputIconWrapper","StyledInputContent","StyledInputField","disabled","autoFocus","StyledMotionInputLabel","animate","scale","initial","layout","style","transition","StyledMotionInputClearIcon","opacity","onClick","icons","color","wrong","undefined","displayName","_default","exports"],"sources":["../../../src/components/input/Input.tsx"],"sourcesContent":["import React, {\n ChangeEvent,\n ChangeEventHandler,\n FocusEventHandler,\n forwardRef,\n HTMLInputTypeAttribute,\n KeyboardEventHandler,\n ReactNode,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport Icon from '../icon/Icon';\nimport {\n StyledInput,\n StyledInputContent,\n StyledInputField,\n StyledInputIconWrapper,\n StyledMotionInputClearIcon,\n StyledMotionInputLabel,\n} from './Input.styles';\nimport type { Theme } from '../color-scheme-provider/ColorSchemeProvider';\nimport { useTheme } from 'styled-components';\n\nexport type InputRef = {\n focus: VoidFunction;\n};\n\ntype InputMode =\n | 'email'\n | 'search'\n | 'tel'\n | 'text'\n | 'url'\n | 'none'\n | 'numeric'\n | 'decimal'\n | undefined;\n\nexport type InputProps = {\n /**\n * Icon element to be displayed on the left side of the input field\n */\n iconElement?: ReactNode;\n /**\n * Defines the input mode of the input\n */\n inputMode?: InputMode;\n /**\n * Disables the input so that it cannot be changed anymore\n */\n isDisabled?: boolean;\n /**\n * Function that is executed when the input field loses focus\n */\n onBlur?: FocusEventHandler<HTMLInputElement>;\n /**\n * Function that is executed when the text of the input changes\n */\n onChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Function that is executed when the input field is focused\n */\n onFocus?: FocusEventHandler<HTMLInputElement>;\n /**\n * Function that is executed when a letter is pressed\n */\n onKeyDown?: KeyboardEventHandler<HTMLInputElement>;\n /**\n * Placeholder for the input field\n */\n placeholder?: string;\n /**\n * Element to be displayed next to or instead of the \"placeholder\"\n */\n placeholderElement?: ReactNode;\n /**\n * If true, a clear icon is displayed at the end of the input field\n */\n shouldShowClearIcon?: boolean;\n /**\n * Input type set for input element (e.g. 'text', 'number' or 'password')\n */\n type?: HTMLInputTypeAttribute;\n /**\n * Value if the input field should be controlled\n */\n value?: string;\n /**\n * If true, the input field is focused when the component is mounted\n */\n shouldUseAutoFocus?: boolean;\n /**\n * If true, the input field is marked as invalid\n */\n isInvalid?: boolean;\n};\n\nconst Input = forwardRef<InputRef, InputProps>(\n (\n {\n iconElement,\n inputMode,\n isDisabled,\n onBlur,\n onChange,\n onFocus,\n onKeyDown,\n placeholder,\n placeholderElement,\n shouldShowClearIcon = false,\n type = 'text',\n value,\n shouldUseAutoFocus = false,\n isInvalid = false\n },\n ref\n ) => {\n const [hasValue, setHasValue] = useState(typeof value === 'string' && value !== '');\n const theme = useTheme() as Theme;\n const inputRef = useRef<HTMLInputElement>(null);\n\n const handleClearIconClick = useCallback(() => {\n if (inputRef.current) {\n inputRef.current.value = '';\n\n if (typeof onChange === 'function') {\n onChange({ target: inputRef.current } as ChangeEvent<HTMLInputElement>);\n }\n }\n }, [onChange]);\n\n const handleInputFieldChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n setHasValue(event.target.value !== '');\n\n if (typeof onChange === 'function') {\n onChange(event);\n }\n },\n [onChange]\n );\n\n useImperativeHandle(\n ref,\n () => ({\n focus: () => inputRef.current?.focus(),\n }),\n []\n );\n\n useEffect(() => {\n if (typeof value === 'string') {\n setHasValue(value !== '');\n }\n }, [value]);\n\n const labelPosition = useMemo(() => {\n if (hasValue) {\n return { bottom: -8, right: -6 };\n }\n\n return { left: 0, top: 0 };\n }, [hasValue]);\n\n return (\n <StyledInput className=\"beta-chayns-input\" isDisabled={isDisabled} isInvalid={isInvalid}>\n {iconElement && <StyledInputIconWrapper>{iconElement}</StyledInputIconWrapper>}\n <StyledInputContent>\n <StyledInputField\n disabled={isDisabled}\n onBlur={onBlur}\n onChange={handleInputFieldChange}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n ref={inputRef}\n type={type}\n value={value}\n autoFocus={shouldUseAutoFocus}\n inputMode={inputMode}\n isInvalid={isInvalid}\n />\n <StyledMotionInputLabel\n animate={{ scale: hasValue ? 0.6 : 1 }}\n initial={false}\n layout\n style={{ ...labelPosition }}\n transition={{ type: 'tween' }}\n isInvalid={isInvalid}\n >\n {placeholderElement}\n {placeholder}\n </StyledMotionInputLabel>\n </StyledInputContent>\n {shouldShowClearIcon && (\n <StyledMotionInputClearIcon\n animate={{ opacity: hasValue ? 1 : 0 }}\n initial={false}\n onClick={handleClearIconClick}\n transition={{ type: 'tween' }}\n isInvalid={isInvalid}\n >\n <Icon icons={['fa fa-times']} color={isInvalid ? theme.wrong : undefined}/>\n </StyledMotionInputClearIcon>\n )}\n </StyledInput>\n );\n }\n);\n\nInput.displayName = 'Input';\n\nexport default Input;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAeA,IAAAC,KAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AASA,IAAAI,iBAAA,GAAAJ,OAAA;AAA6C,SAAAE,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAA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EAAEA;EAAU,CACxB,CAAC,eACF9C,MAAA,CAAAS,OAAA,CAAA6D,aAAA,CAACjE,MAAA,CAAAyE,sBAAsB;IACnBC,OAAO,EAAE;MAAEC,KAAK,EAAEjC,QAAQ,GAAG,GAAG,GAAG;IAAE,CAAE;IACvCkC,OAAO,EAAE,KAAM;IACfC,MAAM;IACNC,KAAK,EAAE;MAAE,GAAGnB;IAAc,CAAE;IAC5BoB,UAAU,EAAE;MAAEzC,IAAI,EAAE;IAAQ,CAAE;IAC9BG,SAAS,EAAEA;EAAU,GAEpBL,kBAAkB,EAClBD,WACmB,CACR,CAAC,EACpBE,mBAAmB,iBAChB1C,MAAA,CAAAS,OAAA,CAAA6D,aAAA,CAACjE,MAAA,CAAAgF,0BAA0B;IACvBN,OAAO,EAAE;MAAEO,OAAO,EAAEvC,QAAQ,GAAG,CAAC,GAAG;IAAE,CAAE;IACvCkC,OAAO,EAAE,KAAM;IACfM,OAAO,EAAEjC,oBAAqB;IAC9B8B,UAAU,EAAE;MAAEzC,IAAI,EAAE;IAAQ,CAAE;IAC9BG,SAAS,EAAEA;EAAU,gBAErB9C,MAAA,CAAAS,OAAA,CAAA6D,aAAA,CAACnE,KAAA,CAAAM,OAAI;IAAC+E,KAAK,EAAE,CAAC,aAAa,CAAE;IAACC,KAAK,EAAE3C,SAAS,GAAGI,KAAK,CAACwC,KAAK,GAAGC;EAAU,CAAC,CAClD,CAEvB,CAAC;AAEtB,CACJ,CAAC;AAED9D,KAAK,CAAC+D,WAAW,GAAG,OAAO;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAArF,OAAA,GAEboB,KAAK"}
@@ -0,0 +1,15 @@
1
+ import type { InputProps } from './Input';
2
+ export declare const StyledInput: import("styled-components").StyledComponent<"div", any, Pick<InputProps, "isDisabled" | "isInvalid"> & {
3
+ theme: import("../color-scheme-provider/ColorSchemeProvider").Theme;
4
+ }, never>;
5
+ export declare const StyledInputContent: import("styled-components").StyledComponent<"div", any, {}, never>;
6
+ export declare const StyledInputField: import("styled-components").StyledComponent<"input", any, Pick<InputProps, "isInvalid"> & {
7
+ theme: import("../color-scheme-provider/ColorSchemeProvider").Theme;
8
+ }, never>;
9
+ export declare const StyledMotionInputLabel: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLLabelElement, import("framer-motion").HTMLMotionProps<"label">>, any, Pick<InputProps, "isInvalid"> & {
10
+ theme: import("../color-scheme-provider/ColorSchemeProvider").Theme;
11
+ }, never>;
12
+ export declare const StyledMotionInputClearIcon: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, any, Pick<InputProps, "isInvalid"> & {
13
+ theme: import("../color-scheme-provider/ColorSchemeProvider").Theme;
14
+ }, never>;
15
+ export declare const StyledInputIconWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StyledMotionInputLabel = exports.StyledMotionInputClearIcon = exports.StyledInputIconWrapper = exports.StyledInputField = exports.StyledInputContent = exports.StyledInput = void 0;
7
+ var _framerMotion = require("framer-motion");
8
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
9
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+ const StyledInput = exports.StyledInput = _styledComponents.default.div`
11
+ align-items: center;
12
+ background-color: ${_ref => {
13
+ let {
14
+ theme
15
+ } = _ref;
16
+ return theme['100'];
17
+ }};
18
+ border: 1px solid ${_ref2 => {
19
+ let {
20
+ theme,
21
+ isInvalid
22
+ } = _ref2;
23
+ return isInvalid ? theme.wrong : 'rgba(160, 160, 160, 0.3)';
24
+ }};
25
+ border-radius: 3px;
26
+ color: ${_ref3 => {
27
+ let {
28
+ theme
29
+ } = _ref3;
30
+ return theme['006'];
31
+ }};
32
+ display: flex;
33
+ justify-content: space-between;
34
+ min-height: 42px;
35
+ opacity: ${_ref4 => {
36
+ let {
37
+ isDisabled
38
+ } = _ref4;
39
+ return isDisabled ? 0.5 : 1;
40
+ }};
41
+ transition: opacity 0.3s ease;
42
+ width: 100%;
43
+ `;
44
+ const StyledInputContent = exports.StyledInputContent = _styledComponents.default.div`
45
+ display: flex;
46
+ flex: 1 1 auto;
47
+ min-width: 0;
48
+ margin: 8px 10px;
49
+ position: relative;
50
+ `;
51
+ const StyledInputField = exports.StyledInputField = _styledComponents.default.input`
52
+ background: none;
53
+ border: none;
54
+ color: ${_ref5 => {
55
+ let {
56
+ theme,
57
+ isInvalid
58
+ } = _ref5;
59
+ return isInvalid ? theme.wrong : theme.text;
60
+ }};
61
+ padding: 0;
62
+ width: 100%;
63
+ `;
64
+ const StyledMotionInputLabel = exports.StyledMotionInputLabel = (0, _styledComponents.default)(_framerMotion.motion.label)`
65
+ align-items: baseline;
66
+ display: flex;
67
+ flex: 0 0 auto;
68
+ gap: 4px;
69
+ line-height: 1.3;
70
+ pointer-events: none;
71
+ position: absolute;
72
+ user-select: none;
73
+ color: ${_ref6 => {
74
+ let {
75
+ theme,
76
+ isInvalid
77
+ } = _ref6;
78
+ return isInvalid ? theme.wrong : undefined;
79
+ }}
80
+ `;
81
+ const StyledMotionInputClearIcon = exports.StyledMotionInputClearIcon = (0, _styledComponents.default)(_framerMotion.motion.div)`
82
+ align-items: center;
83
+ border-left: 1px solid rgba(160, 160, 160, 0.3);
84
+ cursor: pointer;
85
+ display: flex;
86
+ flex: 0 0 auto;
87
+ height: 40px;
88
+ justify-content: center;
89
+ width: 40px;
90
+ `;
91
+ const StyledInputIconWrapper = exports.StyledInputIconWrapper = _styledComponents.default.div`
92
+ align-items: baseline;
93
+ display: flex;
94
+ flex: 0 0 auto;
95
+ justify-content: center;
96
+ margin-left: 10px;
97
+ `;
98
+ //# sourceMappingURL=Input.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Input.styles.js","names":["_framerMotion","require","_styledComponents","_interopRequireDefault","obj","__esModule","default","StyledInput","exports","styled","div","_ref","theme","_ref2","isInvalid","wrong","_ref3","_ref4","isDisabled","StyledInputContent","StyledInputField","input","_ref5","text","StyledMotionInputLabel","motion","label","_ref6","undefined","StyledMotionInputClearIcon","StyledInputIconWrapper"],"sources":["../../../src/components/input/Input.styles.ts"],"sourcesContent":["import { motion } from 'framer-motion';\nimport styled from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\nimport type { InputProps } from './Input';\n\ntype StyledInputProps = WithTheme<Pick<InputProps, 'isDisabled'| 'isInvalid'>>;\n\nexport const StyledInput = styled.div<StyledInputProps>`\n align-items: center;\n background-color: ${({ theme }: StyledInputProps) => theme['100']};\n border: 1px solid ${({theme, isInvalid}:StyledInputProps ) => isInvalid ? theme.wrong : 'rgba(160, 160, 160, 0.3)'};\n border-radius: 3px;\n color: ${({ theme }: StyledInputProps) => theme['006']};\n display: flex;\n justify-content: space-between;\n min-height: 42px;\n opacity: ${({ isDisabled }) => (isDisabled ? 0.5 : 1)};\n transition: opacity 0.3s ease;\n width: 100%;\n`;\n\nexport const StyledInputContent = styled.div`\n display: flex;\n flex: 1 1 auto;\n min-width: 0;\n margin: 8px 10px;\n position: relative;\n`;\n\ntype StyledInputFieldProps = WithTheme<Pick<InputProps, 'isInvalid'>>;\n\nexport const StyledInputField = styled.input<StyledInputFieldProps>`\n background: none;\n border: none;\n color: ${({ theme, isInvalid }: StyledInputFieldProps) => isInvalid ? theme.wrong : theme.text};\n padding: 0;\n width: 100%;\n`;\n\ntype StyledMotionInputLabelProps = WithTheme<Pick<InputProps, 'isInvalid'>>;\n\nexport const StyledMotionInputLabel = styled(motion.label)<StyledMotionInputLabelProps>`\n align-items: baseline;\n display: flex;\n flex: 0 0 auto;\n gap: 4px;\n line-height: 1.3;\n pointer-events: none;\n position: absolute;\n user-select: none;\n color: ${({theme, isInvalid}: StyledMotionInputLabelProps)=> isInvalid ? theme.wrong : undefined}\n`;\n\ntype StyledMotionInputClearIconProps = WithTheme<Pick<InputProps, 'isInvalid'>>;\n\nexport const StyledMotionInputClearIcon = styled(motion.div)<StyledMotionInputClearIconProps>`\n align-items: center;\n border-left: 1px solid rgba(160, 160, 160, 0.3);\n cursor: pointer;\n display: flex;\n flex: 0 0 auto;\n height: 40px;\n justify-content: center;\n width: 40px;\n`;\n\nexport const StyledInputIconWrapper = styled.div`\n align-items: baseline;\n display: flex;\n flex: 0 0 auto;\n justify-content: center;\n margin-left: 10px;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAuC,SAAAE,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAMhC,MAAMG,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAGE,yBAAM,CAACC,GAAsB;AACxD;AACA,wBAAwBC,IAAA;EAAA,IAAC;IAAEC;EAAwB,CAAC,GAAAD,IAAA;EAAA,OAAKC,KAAK,CAAC,KAAK,CAAC;AAAA,CAAC;AACtE,wBAAwBC,KAAA;EAAA,IAAC;IAACD,KAAK;IAAEE;EAA0B,CAAC,GAAAD,KAAA;EAAA,OAAMC,SAAS,GAAGF,KAAK,CAACG,KAAK,GAAG,0BAA0B;AAAA,CAAC;AACvH;AACA,aAAaC,KAAA;EAAA,IAAC;IAAEJ;EAAwB,CAAC,GAAAI,KAAA;EAAA,OAAKJ,KAAK,CAAC,KAAK,CAAC;AAAA,CAAC;AAC3D;AACA;AACA;AACA,eAAeK,KAAA;EAAA,IAAC;IAAEC;EAAW,CAAC,GAAAD,KAAA;EAAA,OAAMC,UAAU,GAAG,GAAG,GAAG,CAAC;AAAA,CAAE;AAC1D;AACA;AACA,CAAC;AAEM,MAAMC,kBAAkB,GAAAX,OAAA,CAAAW,kBAAA,GAAGV,yBAAM,CAACC,GAAI;AAC7C;AACA;AACA;AACA;AACA;AACA,CAAC;AAIM,MAAMU,gBAAgB,GAAAZ,OAAA,CAAAY,gBAAA,GAAGX,yBAAM,CAACY,KAA6B;AACpE;AACA;AACA,aAAaC,KAAA;EAAA,IAAC;IAAEV,KAAK;IAAEE;EAAiC,CAAC,GAAAQ,KAAA;EAAA,OAAKR,SAAS,GAAGF,KAAK,CAACG,KAAK,GAAGH,KAAK,CAACW,IAAI;AAAA,CAAC;AACnG;AACA;AACA,CAAC;AAIM,MAAMC,sBAAsB,GAAAhB,OAAA,CAAAgB,sBAAA,GAAG,IAAAf,yBAAM,EAACgB,oBAAM,CAACC,KAAK,CAA+B;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAaC,KAAA;EAAA,IAAC;IAACf,KAAK;IAAEE;EAAsC,CAAC,GAAAa,KAAA;EAAA,OAAIb,SAAS,GAAGF,KAAK,CAACG,KAAK,GAAGa,SAAS;AAAA,CAAC;AACrG,CAAC;AAIM,MAAMC,0BAA0B,GAAArB,OAAA,CAAAqB,0BAAA,GAAG,IAAApB,yBAAM,EAACgB,oBAAM,CAACf,GAAG,CAAmC;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAEM,MAAMoB,sBAAsB,GAAAtB,OAAA,CAAAsB,sBAAA,GAAGrB,yBAAM,CAACC,GAAI;AACjD;AACA;AACA;AACA;AACA;AACA,CAAC"}
@@ -0,0 +1,18 @@
1
+ import React, { FC, ReactNode } from 'react';
2
+ interface IListContext {
3
+ incrementExpandableItemCount: () => () => void;
4
+ isAnyItemExpandable: boolean;
5
+ openItemUuid: string | undefined;
6
+ updateOpenItemUuid: (uuid: string, options?: {
7
+ shouldOnlyOpen?: boolean;
8
+ }) => void;
9
+ }
10
+ export declare const ListContext: React.Context<IListContext>;
11
+ type ListProps = {
12
+ /**
13
+ * The items of the list
14
+ */
15
+ children: ReactNode;
16
+ };
17
+ declare const List: FC<ListProps>;
18
+ export default List;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.ListContext = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
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 ListContext = exports.ListContext = /*#__PURE__*/_react.default.createContext({
11
+ incrementExpandableItemCount: () => () => {},
12
+ isAnyItemExpandable: false,
13
+ openItemUuid: undefined,
14
+ updateOpenItemUuid: () => {}
15
+ });
16
+ ListContext.displayName = 'ListContext';
17
+ const List = _ref => {
18
+ let {
19
+ children
20
+ } = _ref;
21
+ const [openItemUuid, setOpenItemUuid] = (0, _react.useState)(undefined);
22
+ const [expandableItemCount, setExpandableItemCount] = (0, _react.useState)(0);
23
+ const updateOpenItemUuid = (0, _react.useCallback)(function (uuid) {
24
+ let {
25
+ shouldOnlyOpen
26
+ } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
27
+ setOpenItemUuid(currentOpenItemUuid => {
28
+ if (currentOpenItemUuid === uuid && shouldOnlyOpen !== true) {
29
+ return undefined;
30
+ }
31
+ return uuid;
32
+ });
33
+ }, [setOpenItemUuid]);
34
+ const incrementExpandableItemCount = (0, _react.useCallback)(() => {
35
+ setExpandableItemCount(count => count + 1);
36
+ return () => {
37
+ setExpandableItemCount(count => count - 1);
38
+ };
39
+ }, [setExpandableItemCount]);
40
+ const providerValue = (0, _react.useMemo)(() => ({
41
+ isAnyItemExpandable: expandableItemCount > 0,
42
+ updateOpenItemUuid,
43
+ openItemUuid,
44
+ incrementExpandableItemCount
45
+ }), [expandableItemCount, incrementExpandableItemCount, openItemUuid, updateOpenItemUuid]);
46
+ return /*#__PURE__*/_react.default.createElement(ListContext.Provider, {
47
+ value: providerValue
48
+ }, children);
49
+ };
50
+ List.displayName = 'List';
51
+ var _default = exports.default = List;
52
+ //# sourceMappingURL=List.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"List.js","names":["_react","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","ListContext","exports","React","createContext","incrementExpandableItemCount","isAnyItemExpandable","openItemUuid","undefined","updateOpenItemUuid","displayName","List","_ref","children","setOpenItemUuid","useState","expandableItemCount","setExpandableItemCount","useCallback","uuid","shouldOnlyOpen","arguments","length","currentOpenItemUuid","count","providerValue","useMemo","createElement","Provider","value","_default"],"sources":["../../../src/components/list/List.tsx"],"sourcesContent":["import React, { FC, ReactNode, useCallback, useMemo, useState } from 'react';\n\ninterface IListContext {\n incrementExpandableItemCount: () => () => void;\n isAnyItemExpandable: boolean;\n openItemUuid: string | undefined;\n updateOpenItemUuid: (uuid: string, options?: { shouldOnlyOpen?: boolean }) => void;\n}\n\nexport const ListContext = React.createContext<IListContext>({\n incrementExpandableItemCount: () => () => {},\n isAnyItemExpandable: false,\n openItemUuid: undefined,\n updateOpenItemUuid: () => {},\n});\n\nListContext.displayName = 'ListContext';\n\ntype ListProps = {\n /**\n * The items of the list\n */\n children: ReactNode;\n};\n\nconst List: FC<ListProps> = ({ children }) => {\n const [openItemUuid, setOpenItemUuid] = useState<IListContext['openItemUuid']>(undefined);\n const [expandableItemCount, setExpandableItemCount] = useState<number>(0);\n\n const updateOpenItemUuid = useCallback<IListContext['updateOpenItemUuid']>(\n (uuid, { shouldOnlyOpen } = {}) => {\n setOpenItemUuid((currentOpenItemUuid) => {\n if (currentOpenItemUuid === uuid && shouldOnlyOpen !== true) {\n return undefined;\n }\n\n return uuid;\n });\n },\n [setOpenItemUuid]\n );\n\n const incrementExpandableItemCount = useCallback(() => {\n setExpandableItemCount((count) => count + 1);\n\n return () => {\n setExpandableItemCount((count) => count - 1);\n };\n }, [setExpandableItemCount]);\n\n const providerValue = useMemo<IListContext>(\n () => ({\n isAnyItemExpandable: expandableItemCount > 0,\n updateOpenItemUuid,\n openItemUuid,\n incrementExpandableItemCount,\n }),\n [expandableItemCount, incrementExpandableItemCount, openItemUuid, updateOpenItemUuid]\n );\n\n return <ListContext.Provider value={providerValue}>{children}</ListContext.Provider>;\n};\n\nList.displayName = 'List';\n\nexport default List;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA6E,SAAAC,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,SAAAH,wBAAAG,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,MAAA,CAAAI,SAAA,CA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J,IAAI,IAAIC,cAAc,KAAK,IAAI,EAAE;QACzD,OAAOZ,SAAS;MACpB;MAEA,OAAOW,IAAI;IACf,CAAC,CAAC;EACN,CAAC,EACD,CAACL,eAAe,CACpB,CAAC;EAED,MAAMT,4BAA4B,GAAG,IAAAa,kBAAW,EAAC,MAAM;IACnDD,sBAAsB,CAAEO,KAAK,IAAKA,KAAK,GAAG,CAAC,CAAC;IAE5C,OAAO,MAAM;MACTP,sBAAsB,CAAEO,KAAK,IAAKA,KAAK,GAAG,CAAC,CAAC;IAChD,CAAC;EACL,CAAC,EAAE,CAACP,sBAAsB,CAAC,CAAC;EAE5B,MAAMQ,aAAa,GAAG,IAAAC,cAAO,EACzB,OAAO;IACHpB,mBAAmB,EAAEU,mBAAmB,GAAG,CAAC;IAC5CP,kBAAkB;IAClBF,YAAY;IACZF;EACJ,CAAC,CAAC,EACF,CAACW,mBAAmB,EAAEX,4BAA4B,EAAEE,YAAY,EAAEE,kBAAkB,CACxF,CAAC;EAED,oBAAOhC,MAAA,CAAAS,OAAA,CAAAyC,aAAA,CAAC1B,WAAW,CAAC2B,QAAQ;IAACC,KAAK,EAAEJ;EAAc,GAAEZ,QAA+B,CAAC;AACxF,CAAC;AAEDF,IAAI,CAACD,WAAW,GAAG,MAAM;AAAC,IAAAoB,QAAA,GAAA5B,OAAA,CAAAhB,OAAA,GAEXyB,IAAI"}
@@ -0,0 +1,67 @@
1
+ import { FC, MouseEventHandler, ReactNode, TouchEventHandler } from 'react';
2
+ type ListItemProps = {
3
+ /**
4
+ * The content of the `ListItem` body. When the `ListItem` has children,
5
+ * it can be opened and also gets an icon as an indicator automatically.
6
+ */
7
+ children?: ReactNode;
8
+ /**
9
+ * Element that is displayed when hovering over the `ListItem` on the right
10
+ * side. On mobile devices, this element is not displayed.
11
+ */
12
+ hoverItem?: ReactNode;
13
+ /**
14
+ * The FontAwesome or tobit icons to render like an image on the left side
15
+ * of the header. Multiple icons are stacked. See the `Icon` component
16
+ * documentation for more information.
17
+ */
18
+ icons?: string[];
19
+ /**
20
+ * A list of image URLs that are displayed on the left side of the header.
21
+ * If multiple URLs are passed, the image is assembled from the first three
22
+ * image URLs as a puzzle.
23
+ */
24
+ images?: string[];
25
+ /**
26
+ * This can be used to automatically expand the `ListItem` during the first render.
27
+ */
28
+ isDefaultOpen?: boolean;
29
+ /**
30
+ * This overrides the internal opening state of the item and makes it controlled.
31
+ */
32
+ isOpen?: boolean;
33
+ /**
34
+ * Function to be executed when the header of the `ListItem` was clicked
35
+ */
36
+ onClick?: MouseEventHandler<HTMLDivElement>;
37
+ /**
38
+ * Function to be executed when the header of the `ListItem` is pressed for
39
+ * 400 milliseconds.
40
+ */
41
+ onLongPress?: TouchEventHandler<HTMLDivElement>;
42
+ /**
43
+ * Elements that are displayed on the left side of the header. If multiple
44
+ * elements are specified, they are displayed one aside the other.
45
+ */
46
+ leftElements?: [ReactNode, ...ReactNode[]];
47
+ /**
48
+ * Elements that are displayed on the right side of the header. If multiple
49
+ * elements are specified, they are displayed one below the other.
50
+ */
51
+ rightElements?: [ReactNode, ...ReactNode[]];
52
+ /**
53
+ * Images of users should always be displayed in a round shape. Therefore
54
+ * this property can be set to true.
55
+ */
56
+ shouldShowRoundImage?: boolean;
57
+ /**
58
+ * Subtitle of the `ListItem` displayed in the head below the title
59
+ */
60
+ subtitle?: ReactNode;
61
+ /**
62
+ * Title of the `ListItem` displayed in the head
63
+ */
64
+ title: ReactNode;
65
+ };
66
+ declare const ListItem: FC<ListItemProps>;
67
+ export default ListItem;
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _framerMotion = require("framer-motion");
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var _uuid = require("../../../hooks/uuid");
10
+ var _List = require("../List");
11
+ var _ListItemBody = _interopRequireDefault(require("./list-item-body/ListItemBody"));
12
+ var _ListItemHead = _interopRequireDefault(require("./list-item-head/ListItemHead"));
13
+ var _ListItem = require("./ListItem.styles");
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+ 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); }
16
+ 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; }
17
+ const ListItem = _ref => {
18
+ let {
19
+ children,
20
+ hoverItem,
21
+ icons,
22
+ images,
23
+ isDefaultOpen,
24
+ isOpen,
25
+ onClick,
26
+ onLongPress,
27
+ leftElements,
28
+ rightElements,
29
+ subtitle,
30
+ shouldShowRoundImage,
31
+ title
32
+ } = _ref;
33
+ const {
34
+ incrementExpandableItemCount,
35
+ isAnyItemExpandable,
36
+ openItemUuid,
37
+ updateOpenItemUuid
38
+ } = (0, _react.useContext)(_List.ListContext);
39
+ const uuid = (0, _uuid.useUuid)();
40
+ const isExpandable = children !== undefined;
41
+ const isItemOpen = isOpen !== null && isOpen !== void 0 ? isOpen : openItemUuid === uuid;
42
+ const handleHeadClick = (0, _react.useCallback)(event => {
43
+ if (isExpandable) {
44
+ updateOpenItemUuid(uuid);
45
+ }
46
+ if (typeof onClick === 'function') {
47
+ onClick(event);
48
+ }
49
+ }, [isExpandable, onClick, updateOpenItemUuid, uuid]);
50
+ (0, _react.useEffect)(() => {
51
+ if (isExpandable) {
52
+ // The incrementExpandableItemCount function returns an cleanup
53
+ // function to decrement expandableItemCount if component unmounts
54
+ return incrementExpandableItemCount();
55
+ }
56
+ return undefined;
57
+ }, [incrementExpandableItemCount, isExpandable]);
58
+ (0, _react.useEffect)(() => {
59
+ if (isDefaultOpen) {
60
+ updateOpenItemUuid(uuid, {
61
+ shouldOnlyOpen: true
62
+ });
63
+ }
64
+ }, [isDefaultOpen, updateOpenItemUuid, uuid]);
65
+ return /*#__PURE__*/_react.default.createElement(_ListItem.StyledListItem, {
66
+ className: "beta-chayns-list-item",
67
+ isClickable: typeof onClick === 'function' || isExpandable,
68
+ isOpen: isItemOpen
69
+ }, /*#__PURE__*/_react.default.createElement(_ListItemHead.default, {
70
+ hoverItem: hoverItem,
71
+ icons: icons,
72
+ images: images,
73
+ isAnyItemExpandable: isAnyItemExpandable,
74
+ isExpandable: isExpandable,
75
+ isOpen: isItemOpen,
76
+ onClick: handleHeadClick,
77
+ onLongPress: onLongPress,
78
+ leftElements: leftElements,
79
+ rightElements: rightElements,
80
+ subtitle: subtitle,
81
+ shouldShowRoundImage: shouldShowRoundImage,
82
+ title: title
83
+ }), /*#__PURE__*/_react.default.createElement(_framerMotion.AnimatePresence, {
84
+ initial: false
85
+ }, isExpandable && isItemOpen && /*#__PURE__*/_react.default.createElement(_ListItemBody.default, {
86
+ id: uuid
87
+ }, children)));
88
+ };
89
+ ListItem.displayName = 'ListItem';
90
+ var _default = exports.default = ListItem;
91
+ //# sourceMappingURL=ListItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItem.js","names":["_framerMotion","require","_react","_interopRequireWildcard","_uuid","_List","_ListItemBody","_interopRequireDefault","_ListItemHead","_ListItem","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","ListItem","_ref","children","hoverItem","icons","images","isDefaultOpen","isOpen","onClick","onLongPress","leftElements","rightElements","subtitle","shouldShowRoundImage","title","incrementExpandableItemCount","isAnyItemExpandable","openItemUuid","updateOpenItemUuid","useContext","ListContext","uuid","useUuid","isExpandable","undefined","isItemOpen","handleHeadClick","useCallback","event","useEffect","shouldOnlyOpen","createElement","StyledListItem","className","isClickable","AnimatePresence","initial","id","displayName","_default","exports"],"sources":["../../../../src/components/list/list-item/ListItem.tsx"],"sourcesContent":["import { AnimatePresence } from 'framer-motion';\nimport React, {\n FC,\n MouseEventHandler,\n ReactNode,\n TouchEventHandler,\n useCallback,\n useContext,\n useEffect,\n} from 'react';\nimport { useUuid } from '../../../hooks/uuid';\nimport { ListContext } from '../List';\nimport ListItemBody from './list-item-body/ListItemBody';\nimport ListItemHead from './list-item-head/ListItemHead';\nimport { StyledListItem } from './ListItem.styles';\n\ntype ListItemProps = {\n /**\n * The content of the `ListItem` body. When the `ListItem` has children,\n * it can be opened and also gets an icon as an indicator automatically.\n */\n children?: ReactNode;\n /**\n * Element that is displayed when hovering over the `ListItem` on the right\n * side. On mobile devices, this element is not displayed.\n */\n hoverItem?: ReactNode;\n /**\n * The FontAwesome or tobit icons to render like an image on the left side\n * of the header. Multiple icons are stacked. See the `Icon` component\n * documentation for more information.\n */\n icons?: string[];\n /**\n * A list of image URLs that are displayed on the left side of the header.\n * If multiple URLs are passed, the image is assembled from the first three\n * image URLs as a puzzle.\n */\n images?: string[];\n /**\n * This can be used to automatically expand the `ListItem` during the first render.\n */\n isDefaultOpen?: boolean;\n /**\n * This overrides the internal opening state of the item and makes it controlled.\n */\n isOpen?: boolean;\n /**\n * Function to be executed when the header of the `ListItem` was clicked\n */\n onClick?: MouseEventHandler<HTMLDivElement>;\n /**\n * Function to be executed when the header of the `ListItem` is pressed for\n * 400 milliseconds.\n */\n onLongPress?: TouchEventHandler<HTMLDivElement>;\n /**\n * Elements that are displayed on the left side of the header. If multiple\n * elements are specified, they are displayed one aside the other.\n */\n leftElements?: [ReactNode, ...ReactNode[]];\n /**\n * Elements that are displayed on the right side of the header. If multiple\n * elements are specified, they are displayed one below the other.\n */\n rightElements?: [ReactNode, ...ReactNode[]];\n /**\n * Images of users should always be displayed in a round shape. Therefore\n * this property can be set to true.\n */\n shouldShowRoundImage?: boolean;\n /**\n * Subtitle of the `ListItem` displayed in the head below the title\n */\n subtitle?: ReactNode;\n /**\n * Title of the `ListItem` displayed in the head\n */\n title: ReactNode;\n};\n\nconst ListItem: FC<ListItemProps> = ({\n children,\n hoverItem,\n icons,\n images,\n isDefaultOpen,\n isOpen,\n onClick,\n onLongPress,\n leftElements,\n rightElements,\n subtitle,\n shouldShowRoundImage,\n title,\n}) => {\n const { incrementExpandableItemCount, isAnyItemExpandable, openItemUuid, updateOpenItemUuid } =\n useContext(ListContext);\n\n const uuid = useUuid();\n\n const isExpandable = children !== undefined;\n const isItemOpen = isOpen ?? openItemUuid === uuid;\n\n const handleHeadClick = useCallback<MouseEventHandler<HTMLDivElement>>(\n (event) => {\n if (isExpandable) {\n updateOpenItemUuid(uuid);\n }\n\n if (typeof onClick === 'function') {\n onClick(event);\n }\n },\n [isExpandable, onClick, updateOpenItemUuid, uuid]\n );\n\n useEffect(() => {\n if (isExpandable) {\n // The incrementExpandableItemCount function returns an cleanup\n // function to decrement expandableItemCount if component unmounts\n return incrementExpandableItemCount();\n }\n\n return undefined;\n }, [incrementExpandableItemCount, isExpandable]);\n\n useEffect(() => {\n if (isDefaultOpen) {\n updateOpenItemUuid(uuid, { shouldOnlyOpen: true });\n }\n }, [isDefaultOpen, updateOpenItemUuid, uuid]);\n\n return (\n <StyledListItem\n className=\"beta-chayns-list-item\"\n isClickable={typeof onClick === 'function' || isExpandable}\n isOpen={isItemOpen}\n >\n <ListItemHead\n hoverItem={hoverItem}\n icons={icons}\n images={images}\n isAnyItemExpandable={isAnyItemExpandable}\n isExpandable={isExpandable}\n isOpen={isItemOpen}\n onClick={handleHeadClick}\n onLongPress={onLongPress}\n leftElements={leftElements}\n rightElements={rightElements}\n subtitle={subtitle}\n shouldShowRoundImage={shouldShowRoundImage}\n title={title}\n />\n <AnimatePresence initial={false}>\n {isExpandable && isItemOpen && <ListItemBody id={uuid}>{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,CAAC;AAEDF,QAAQ,CAACsC,WAAW,GAAG,UAAU;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA5D,OAAA,GAEnBoB,QAAQ"}
@@ -0,0 +1,6 @@
1
+ export declare const StyledListItem: import("styled-components").StyledComponent<"div", any, {
2
+ isClickable: boolean;
3
+ isOpen: boolean;
4
+ } & {
5
+ theme: import("../../color-scheme-provider/ColorSchemeProvider").Theme;
6
+ }, never>;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StyledListItem = 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 StyledListItem = exports.StyledListItem = _styledComponents.default.div`
11
+ ${_ref => {
12
+ let {
13
+ isOpen
14
+ } = _ref;
15
+ return isOpen && (0, _styledComponents.css)`
16
+ background-color: rgba(${_ref2 => {
17
+ let {
18
+ theme
19
+ } = _ref2;
20
+ return theme['100-rgb'];
21
+ }}, 0.85);
22
+ `;
23
+ }}
24
+
25
+ transition: background-color 0.3s ease;
26
+
27
+ ${_ref3 => {
28
+ let {
29
+ isClickable
30
+ } = _ref3;
31
+ return isClickable && (0, _styledComponents.css)`
32
+ :hover {
33
+ background-color: rgba(
34
+ ${_ref4 => {
35
+ let {
36
+ theme
37
+ } = _ref4;
38
+ return theme['100-rgb'];
39
+ }},
40
+ 0.85
41
+ );
42
+ }
43
+ `;
44
+ }}
45
+
46
+ :not(:last-child) {
47
+ border-bottom: 1px solid ${_ref5 => {
48
+ let {
49
+ theme
50
+ } = _ref5;
51
+ return theme.headline;
52
+ }};
53
+ }
54
+ `;
55
+ //# sourceMappingURL=ListItem.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItem.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","StyledListItem","exports","styled","div","_ref","isOpen","css","_ref2","theme","_ref3","isClickable","_ref4","_ref5","headline"],"sources":["../../../../src/components/list/list-item/ListItem.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport type { WithTheme } from '../../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledListItemProps = WithTheme<{\n isClickable: boolean;\n isOpen: boolean;\n}>;\n\nexport const StyledListItem = styled.div<StyledListItemProps>`\n ${({ isOpen }) =>\n isOpen &&\n css`\n background-color: rgba(${({ theme }: StyledListItemProps) => theme['100-rgb']}, 0.85);\n `}\n\n transition: background-color 0.3s ease;\n\n ${({ isClickable }) =>\n isClickable &&\n css`\n :hover {\n background-color: rgba(\n ${({ theme }: StyledListItemProps) => theme['100-rgb']},\n 0.85\n );\n }\n `}\n\n :not(:last-child) {\n border-bottom: 1px solid ${({ theme }: StyledListItemProps) => theme.headline};\n }\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAgD,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD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CAAC;AAC1F,SAAS;AAAA,CAAC;AACV;AACA;AACA;AACA,MAAMC,KAAA;EAAA,IAAC;IAAEC;EAAY,CAAC,GAAAD,KAAA;EAAA,OACdC,WAAW,IACX,IAAAJ,qBAAG,CAAC;AACZ;AACA;AACA,sBAAsBK,KAAA;IAAA,IAAC;MAAEH;IAA2B,CAAC,GAAAG,KAAA;IAAA,OAAKH,KAAK,CAAC,SAAS,CAAC;EAAA,CAAC;AAC3E;AACA;AACA;AACA,SAAS;AAAA,CAAC;AACV;AACA;AACA,mCAAmCI,KAAA;EAAA,IAAC;IAAEJ;EAA2B,CAAC,GAAAI,KAAA;EAAA,OAAKJ,KAAK,CAACK,QAAQ;AAAA,CAAC;AACtF;AACA,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { FC } from 'react';
2
+ interface ListItemBodyProps {
3
+ id: string;
4
+ }
5
+ declare const ListItemBody: FC<ListItemBodyProps>;
6
+ export default ListItemBody;
@@ -0,0 +1,57 @@
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 _ListItemBody = require("./ListItemBody.styles");
9
+ 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); }
10
+ 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; }
11
+ const ListItemBody = _ref => {
12
+ let {
13
+ children,
14
+ id
15
+ } = _ref;
16
+ const containerRef = (0, _react.useRef)(null);
17
+ const [height, setHeight] = (0, _react.useState)('auto');
18
+ (0, _react.useEffect)(() => {
19
+ if (containerRef.current) {
20
+ const resizeObserver = new ResizeObserver(entries => {
21
+ if (entries && entries[0]) {
22
+ const observedHeight = entries[0].contentRect.height;
23
+ setHeight(observedHeight);
24
+ }
25
+ });
26
+ resizeObserver.observe(containerRef.current);
27
+ return () => {
28
+ resizeObserver.disconnect();
29
+ };
30
+ }
31
+ return () => {};
32
+ }, []);
33
+ return /*#__PURE__*/_react.default.createElement(_ListItemBody.StyledMotionListItemBody, {
34
+ key: id,
35
+ animate: {
36
+ height,
37
+ opacity: 1
38
+ },
39
+ className: "beta-chayns-list-item-body",
40
+ exit: {
41
+ height: 0,
42
+ opacity: 0
43
+ },
44
+ initial: {
45
+ height: 0,
46
+ opacity: 0
47
+ },
48
+ transition: {
49
+ type: 'tween'
50
+ }
51
+ }, /*#__PURE__*/_react.default.createElement("div", {
52
+ ref: containerRef
53
+ }, children));
54
+ };
55
+ ListItemBody.displayName = 'ListItemBody';
56
+ var _default = exports.default = ListItemBody;
57
+ //# sourceMappingURL=ListItemBody.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItemBody.js","names":["_react","_interopRequireWildcard","require","_ListItemBody","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","ListItemBody","_ref","children","id","containerRef","useRef","height","setHeight","useState","useEffect","current","resizeObserver","ResizeObserver","entries","observedHeight","contentRect","observe","disconnect","createElement","StyledMotionListItemBody","key","animate","opacity","className","exit","initial","transition","type","ref","displayName","_default","exports"],"sources":["../../../../../src/components/list/list-item/list-item-body/ListItemBody.tsx"],"sourcesContent":["import React, { FC, useEffect, useRef, useState } from 'react';\nimport { StyledMotionListItemBody } from './ListItemBody.styles';\n\ninterface ListItemBodyProps {\n id: string;\n}\n\nconst ListItemBody: FC<ListItemBodyProps> = ({ children, id }) => {\n const containerRef = useRef<HTMLDivElement | null>(null);\n const [height, setHeight] = useState<number | 'auto'>('auto');\n\n useEffect(() => {\n if (containerRef.current) {\n const resizeObserver = new ResizeObserver((entries) => {\n if (entries && entries[0]) {\n const observedHeight = entries[0].contentRect.height;\n setHeight(observedHeight);\n }\n });\n\n resizeObserver.observe(containerRef.current);\n\n return () => {\n resizeObserver.disconnect();\n };\n }\n\n return () => {};\n }, []);\n\n return (\n <StyledMotionListItemBody\n key={id}\n animate={{ height, opacity: 1 }}\n className=\"beta-chayns-list-item-body\"\n exit={{ height: 0, opacity: 0 }}\n initial={{ height: 0, opacity: 0 }}\n transition={{ type: 'tween' }}\n >\n <div ref={containerRef}>{children}</div>\n </StyledMotionListItemBody>\n );\n};\n\nListItemBody.displayName = 'ListItemBody';\n\nexport default ListItemBody;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAAiE,SAAAE,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,SAAAJ,wBAAAI,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,wBA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;EACnB,CAAC,EAAE,EAAE,CAAC;EAEN,oBACI1C,MAAA,CAAAU,OAAA,CAAAiC,aAAA,CAACxC,aAAA,CAAAyC,wBAAwB;IACrBC,GAAG,EAAEjB,EAAG;IACRkB,OAAO,EAAE;MAAEf,MAAM;MAAEgB,OAAO,EAAE;IAAE,CAAE;IAChCC,SAAS,EAAC,4BAA4B;IACtCC,IAAI,EAAE;MAAElB,MAAM,EAAE,CAAC;MAAEgB,OAAO,EAAE;IAAE,CAAE;IAChCG,OAAO,EAAE;MAAEnB,MAAM,EAAE,CAAC;MAAEgB,OAAO,EAAE;IAAE,CAAE;IACnCI,UAAU,EAAE;MAAEC,IAAI,EAAE;IAAQ;EAAE,gBAE9BpD,MAAA,CAAAU,OAAA,CAAAiC,aAAA;IAAKU,GAAG,EAAExB;EAAa,GAAEF,QAAc,CACjB,CAAC;AAEnC,CAAC;AAEDF,YAAY,CAAC6B,WAAW,GAAG,cAAc;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA9C,OAAA,GAE3Be,YAAY"}
@@ -0,0 +1 @@
1
+ export declare const StyledMotionListItemBody: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, any, {}, never>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StyledMotionListItemBody = void 0;
7
+ var _framerMotion = require("framer-motion");
8
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
9
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+ const StyledMotionListItemBody = exports.StyledMotionListItemBody = (0, _styledComponents.default)(_framerMotion.motion.div)`
11
+ overflow: hidden;
12
+ `;
13
+ //# sourceMappingURL=ListItemBody.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItemBody.styles.js","names":["_framerMotion","require","_styledComponents","_interopRequireDefault","obj","__esModule","default","StyledMotionListItemBody","exports","styled","motion","div"],"sources":["../../../../../src/components/list/list-item/list-item-body/ListItemBody.styles.ts"],"sourcesContent":["import { motion } from 'framer-motion';\nimport styled from 'styled-components';\n\nexport const StyledMotionListItemBody = styled(motion.div)`\n overflow: hidden;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAuC,SAAAE,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEhC,MAAMG,wBAAwB,GAAAC,OAAA,CAAAD,wBAAA,GAAG,IAAAE,yBAAM,EAACC,oBAAM,CAACC,GAAG,CAAE;AAC3D;AACA,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ declare const ListItemContent: FC;
3
+ export default ListItemContent;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _ListItemContent = require("./ListItemContent.styles");
9
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+ const ListItemContent = _ref => {
11
+ let {
12
+ children
13
+ } = _ref;
14
+ return /*#__PURE__*/_react.default.createElement(_ListItemContent.StyledListItemContent, {
15
+ className: "beta-chayns-list-item-content"
16
+ }, children);
17
+ };
18
+ ListItemContent.displayName = 'ListItemContent';
19
+ var _default = exports.default = ListItemContent;
20
+ //# sourceMappingURL=ListItemContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItemContent.js","names":["_react","_interopRequireDefault","require","_ListItemContent","obj","__esModule","default","ListItemContent","_ref","children","createElement","StyledListItemContent","className","displayName","_default","exports"],"sources":["../../../../../src/components/list/list-item/list-item-content/ListItemContent.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { StyledListItemContent } from './ListItemContent.styles';\n\nconst ListItemContent: FC = ({ children }) => (\n <StyledListItemContent className=\"beta-chayns-list-item-content\">\n {children}\n </StyledListItemContent>\n);\n\nListItemContent.displayName = 'ListItemContent';\n\nexport default ListItemContent;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AAAiE,SAAAD,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEjE,MAAMG,eAAmB,GAAGC,IAAA;EAAA,IAAC;IAAEC;EAAS,CAAC,GAAAD,IAAA;EAAA,oBACrCR,MAAA,CAAAM,OAAA,CAAAI,aAAA,CAACP,gBAAA,CAAAQ,qBAAqB;IAACC,SAAS,EAAC;EAA+B,GAC3DH,QACkB,CAAC;AAAA,CAC3B;AAEDF,eAAe,CAACM,WAAW,GAAG,iBAAiB;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAT,OAAA,GAEjCC,eAAe"}