@chayns-components/core 5.0.0-beta.22 → 5.0.0-beta.220

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 (344) 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 +87 -78
  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 +64 -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 +143 -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/popup/Popup.d.ts +26 -0
  205. package/lib/components/popup/Popup.js +145 -0
  206. package/lib/components/popup/Popup.js.map +1 -0
  207. package/lib/components/popup/Popup.styles.d.ts +2 -0
  208. package/lib/components/popup/Popup.styles.js +22 -0
  209. package/lib/components/popup/Popup.styles.js.map +1 -0
  210. package/lib/components/popup/popup-content/PopupContent.d.ts +9 -0
  211. package/lib/components/popup/popup-content/PopupContent.js +64 -0
  212. package/lib/components/popup/popup-content/PopupContent.js.map +1 -0
  213. package/lib/components/popup/popup-content/PopupContent.styles.d.ts +6 -0
  214. package/lib/components/popup/popup-content/PopupContent.styles.js +90 -0
  215. package/lib/components/popup/popup-content/PopupContent.styles.js.map +1 -0
  216. package/lib/components/popup/types.d.ts +16 -0
  217. package/lib/components/popup/types.js +17 -0
  218. package/lib/components/popup/types.js.map +1 -0
  219. package/lib/components/progress-bar/ProgressBar.d.ts +9 -0
  220. package/lib/components/progress-bar/ProgressBar.js +39 -0
  221. package/lib/components/progress-bar/ProgressBar.js.map +1 -0
  222. package/lib/components/progress-bar/ProgressBar.styles.d.ts +7 -0
  223. package/lib/components/progress-bar/ProgressBar.styles.js +39 -0
  224. package/lib/components/progress-bar/ProgressBar.styles.js.map +1 -0
  225. package/lib/components/radio-button/RadioButton.d.ts +26 -0
  226. package/lib/components/radio-button/RadioButton.js +81 -0
  227. package/lib/components/radio-button/RadioButton.js.map +1 -0
  228. package/lib/components/radio-button/RadioButton.styles.d.ts +22 -0
  229. package/lib/components/radio-button/RadioButton.styles.js +100 -0
  230. package/lib/components/radio-button/RadioButton.styles.js.map +1 -0
  231. package/lib/components/radio-button/radio-button-group/RadioButtonGroup.d.ts +21 -0
  232. package/lib/components/radio-button/radio-button-group/RadioButtonGroup.js +54 -0
  233. package/lib/components/radio-button/radio-button-group/RadioButtonGroup.js.map +1 -0
  234. package/lib/components/radio-button/types.d.ts +4 -0
  235. package/lib/components/radio-button/types.js +6 -0
  236. package/lib/components/radio-button/types.js.map +1 -0
  237. package/lib/components/scroll-view/ScrollView.d.ts +9 -0
  238. package/lib/components/scroll-view/ScrollView.js +23 -0
  239. package/lib/components/scroll-view/ScrollView.js.map +1 -0
  240. package/lib/components/scroll-view/ScrollView.styles.d.ts +6 -0
  241. package/lib/components/scroll-view/ScrollView.styles.js +27 -0
  242. package/lib/components/scroll-view/ScrollView.styles.js.map +1 -0
  243. package/lib/components/search-box/SearchBox.d.ts +26 -0
  244. package/lib/components/search-box/SearchBox.js +166 -0
  245. package/lib/components/search-box/SearchBox.js.map +1 -0
  246. package/lib/components/search-box/SearchBox.styles.d.ts +7 -0
  247. package/lib/components/search-box/SearchBox.styles.js +58 -0
  248. package/lib/components/search-box/SearchBox.styles.js.map +1 -0
  249. package/lib/components/search-box/search-box-item/SearchBoxItem.d.ts +9 -0
  250. package/lib/components/search-box/search-box-item/SearchBoxItem.js +30 -0
  251. package/lib/components/search-box/search-box-item/SearchBoxItem.js.map +1 -0
  252. package/lib/components/search-box/search-box-item/SearchBoxItem.styles.d.ts +6 -0
  253. package/lib/components/search-box/search-box-item/SearchBoxItem.styles.js +30 -0
  254. package/lib/components/search-box/search-box-item/SearchBoxItem.styles.js.map +1 -0
  255. package/lib/components/search-box/types.d.ts +4 -0
  256. package/lib/components/search-box/types.js +6 -0
  257. package/lib/components/search-box/types.js.map +1 -0
  258. package/lib/components/search-box/utils.d.ts +7 -0
  259. package/lib/components/search-box/utils.js +23 -0
  260. package/lib/components/search-box/utils.js.map +1 -0
  261. package/lib/components/search-input/SearchInput.d.ts +18 -0
  262. package/lib/components/search-input/SearchInput.js +94 -0
  263. package/lib/components/search-input/SearchInput.js.map +1 -0
  264. package/lib/components/search-input/SearchInput.styles.d.ts +4 -0
  265. package/lib/components/search-input/SearchInput.styles.js +30 -0
  266. package/lib/components/search-input/SearchInput.styles.js.map +1 -0
  267. package/lib/components/sharing-bar/SharingBar.d.ts +18 -0
  268. package/lib/components/sharing-bar/SharingBar.js +114 -0
  269. package/lib/components/sharing-bar/SharingBar.js.map +1 -0
  270. package/lib/components/sharing-bar/SharingBar.styles.d.ts +5 -0
  271. package/lib/components/sharing-bar/SharingBar.styles.js +27 -0
  272. package/lib/components/sharing-bar/SharingBar.styles.js.map +1 -0
  273. package/lib/components/slider/Slider.d.ts +21 -0
  274. package/lib/components/slider/Slider.js +52 -0
  275. package/lib/components/slider/Slider.js.map +1 -0
  276. package/lib/components/slider/Slider.styles.d.ts +8 -0
  277. package/lib/components/slider/Slider.styles.js +77 -0
  278. package/lib/components/slider/Slider.styles.js.map +1 -0
  279. package/lib/components/small-wait-cursor/SmallWaitCursor.d.ts +31 -0
  280. package/lib/components/small-wait-cursor/SmallWaitCursor.js +45 -0
  281. package/lib/components/small-wait-cursor/SmallWaitCursor.js.map +1 -0
  282. package/lib/components/small-wait-cursor/SmallWaitCursor.styles.d.ts +18 -0
  283. package/lib/components/small-wait-cursor/SmallWaitCursor.styles.js +105 -0
  284. package/lib/components/small-wait-cursor/SmallWaitCursor.styles.js.map +1 -0
  285. package/lib/components/text-area/TextArea.d.ts +25 -0
  286. package/lib/components/text-area/TextArea.js +63 -0
  287. package/lib/components/text-area/TextArea.js.map +1 -0
  288. package/lib/components/text-area/TextArea.styles.d.ts +8 -0
  289. package/lib/components/text-area/TextArea.styles.js +46 -0
  290. package/lib/components/text-area/TextArea.styles.js.map +1 -0
  291. package/lib/components/textstring/TextString.d.ts +22 -0
  292. package/lib/components/textstring/TextString.js +63 -0
  293. package/lib/components/textstring/TextString.js.map +1 -0
  294. package/lib/components/textstring/TextString.styles.d.ts +1 -0
  295. package/lib/components/textstring/TextString.styles.js +11 -0
  296. package/lib/components/textstring/TextString.styles.js.map +1 -0
  297. package/lib/components/textstring/types.d.ts +8 -0
  298. package/lib/components/textstring/types.js +6 -0
  299. package/lib/components/textstring/types.js.map +1 -0
  300. package/lib/components/textstring-provider/TextStringProvider.d.ts +21 -0
  301. package/lib/components/textstring-provider/TextStringProvider.js +39 -0
  302. package/lib/components/textstring-provider/TextStringProvider.js.map +1 -0
  303. package/lib/components/textstring-provider/utils.d.ts +11 -0
  304. package/lib/components/textstring-provider/utils.js +32 -0
  305. package/lib/components/textstring-provider/utils.js.map +1 -0
  306. package/lib/components/tooltip/Tooltip.d.ts +18 -0
  307. package/lib/components/tooltip/Tooltip.js +33 -0
  308. package/lib/components/tooltip/Tooltip.js.map +1 -0
  309. package/lib/components/tooltip/Tooltip.styles.d.ts +1 -0
  310. package/lib/components/tooltip/Tooltip.styles.js +11 -0
  311. package/lib/components/tooltip/Tooltip.styles.js.map +1 -0
  312. package/lib/components/tooltip/interface.d.ts +4 -0
  313. package/lib/components/tooltip/interface.js +6 -0
  314. package/lib/components/tooltip/interface.js.map +1 -0
  315. package/lib/components/tooltip/tooltip-item/TooltipItem.d.ts +7 -0
  316. package/lib/components/tooltip/tooltip-item/TooltipItem.js +21 -0
  317. package/lib/components/tooltip/tooltip-item/TooltipItem.js.map +1 -0
  318. package/lib/components/tooltip/tooltip-item/TooltipItem.styles.d.ts +7 -0
  319. package/lib/components/tooltip/tooltip-item/TooltipItem.styles.js +32 -0
  320. package/lib/components/tooltip/tooltip-item/TooltipItem.styles.js.map +1 -0
  321. package/lib/hooks/uuid.js +2 -21
  322. package/lib/hooks/uuid.js.map +1 -1
  323. package/lib/index.d.ts +35 -0
  324. package/lib/index.js +216 -27
  325. package/lib/index.js.map +1 -1
  326. package/lib/types/chayns.d.ts +98 -0
  327. package/lib/types/chayns.js +14 -0
  328. package/lib/types/chayns.js.map +1 -0
  329. package/lib/types/file.d.ts +42 -0
  330. package/lib/types/file.js +6 -0
  331. package/lib/types/file.js.map +1 -0
  332. package/lib/utils/calculate.d.ts +2 -0
  333. package/lib/utils/calculate.js +40 -0
  334. package/lib/utils/calculate.js.map +1 -0
  335. package/lib/utils/fileDialog.d.ts +7 -0
  336. package/lib/utils/fileDialog.js +70 -0
  337. package/lib/utils/fileDialog.js.map +1 -0
  338. package/lib/utils/isTobitEmployee.d.ts +1 -0
  339. package/lib/utils/isTobitEmployee.js +29 -0
  340. package/lib/utils/isTobitEmployee.js.map +1 -0
  341. package/lib/utils/uploadFile.d.ts +9 -0
  342. package/lib/utils/uploadFile.js +48 -0
  343. package/lib/utils/uploadFile.js.map +1 -0
  344. package/package.json +23 -19
@@ -0,0 +1,81 @@
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 _RadioButtonGroup = require("./radio-button-group/RadioButtonGroup");
9
+ var _RadioButton = require("./RadioButton.styles");
10
+ 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); }
11
+ 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; }
12
+ const RadioButton = _ref => {
13
+ let {
14
+ isChecked,
15
+ label,
16
+ onChange,
17
+ id,
18
+ isDisabled = false
19
+ } = _ref;
20
+ const {
21
+ selectedRadioButtonId,
22
+ updateSelectedRadioButtonId
23
+ } = (0, _react.useContext)(_RadioButtonGroup.RadioButtonGroupContext);
24
+ const [internalIsChecked, setInternalIsChecked] = (0, _react.useState)(false);
25
+ const [isHovered, setIsHovered] = (0, _react.useState)(false);
26
+ const isInGroup = typeof updateSelectedRadioButtonId === 'function';
27
+ const isMarked = isInGroup ? selectedRadioButtonId === id : internalIsChecked;
28
+ const isInitialRenderRef = (0, _react.useRef)(true);
29
+ (0, _react.useEffect)(() => {
30
+ if (isChecked) {
31
+ setInternalIsChecked(isChecked);
32
+ }
33
+ }, [isChecked]);
34
+ (0, _react.useEffect)(() => {
35
+ if (isInitialRenderRef.current) {
36
+ isInitialRenderRef.current = false;
37
+ } else if (typeof onChange === 'function') {
38
+ onChange({
39
+ isChecked: isMarked,
40
+ id
41
+ });
42
+ }
43
+ }, [id, isMarked, onChange]);
44
+ const handleClick = (0, _react.useCallback)(() => {
45
+ if (isDisabled) {
46
+ return;
47
+ }
48
+ if (typeof updateSelectedRadioButtonId === 'function') {
49
+ updateSelectedRadioButtonId(id);
50
+ }
51
+ setInternalIsChecked(prevState => !prevState);
52
+ }, [id, isDisabled, updateSelectedRadioButtonId]);
53
+ const handleMouseEnter = (0, _react.useCallback)(() => {
54
+ if (!isDisabled) {
55
+ setIsHovered(true);
56
+ }
57
+ }, [isDisabled]);
58
+ const handleMouseLeave = () => {
59
+ setIsHovered(false);
60
+ };
61
+ return (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_RadioButton.StyledRadioButton, {
62
+ isDisabled: isDisabled,
63
+ onClick: handleClick,
64
+ onMouseEnter: handleMouseEnter,
65
+ onMouseLeave: handleMouseLeave
66
+ }, /*#__PURE__*/_react.default.createElement(_RadioButton.StyledRadioButtonPseudoCheckBox, {
67
+ isChecked: isMarked
68
+ }, /*#__PURE__*/_react.default.createElement(_RadioButton.StyledRadioButtonCheckBoxMark, {
69
+ isHovered: isHovered,
70
+ isSelected: isMarked
71
+ })), /*#__PURE__*/_react.default.createElement(_RadioButton.StyledRadioButtonCheckBox, {
72
+ disabled: isDisabled,
73
+ type: "radio",
74
+ checked: isMarked,
75
+ onChange: () => {}
76
+ }), label && /*#__PURE__*/_react.default.createElement(_RadioButton.StyledRadioButtonLabel, null, label)), [handleClick, handleMouseEnter, isDisabled, isHovered, isMarked, label]);
77
+ };
78
+ RadioButton.displayName = 'RadioButton';
79
+ var _default = RadioButton;
80
+ exports.default = _default;
81
+ //# sourceMappingURL=RadioButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RadioButton.js","names":["_react","_interopRequireWildcard","require","_RadioButtonGroup","_RadioButton","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","RadioButton","_ref","isChecked","label","onChange","id","isDisabled","selectedRadioButtonId","updateSelectedRadioButtonId","useContext","RadioButtonGroupContext","internalIsChecked","setInternalIsChecked","useState","isHovered","setIsHovered","isInGroup","isMarked","isInitialRenderRef","useRef","useEffect","current","handleClick","useCallback","prevState","handleMouseEnter","handleMouseLeave","useMemo","createElement","StyledRadioButton","onClick","onMouseEnter","onMouseLeave","StyledRadioButtonPseudoCheckBox","StyledRadioButtonCheckBoxMark","isSelected","StyledRadioButtonCheckBox","disabled","type","checked","StyledRadioButtonLabel","displayName","_default","exports"],"sources":["../../../src/components/radio-button/RadioButton.tsx"],"sourcesContent":["import React, { FC, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport { RadioButtonGroupContext } from './radio-button-group/RadioButtonGroup';\nimport {\n StyledRadioButton,\n StyledRadioButtonCheckBox,\n StyledRadioButtonCheckBoxMark,\n StyledRadioButtonLabel,\n StyledRadioButtonPseudoCheckBox,\n} from './RadioButton.styles';\nimport type { RadioButtonItem } from './types';\n\nexport type RadioButtonProps = {\n /**\n * Whether the radio button should be checked.\n */\n isChecked?: boolean;\n /**\n * whether the RadioButton should be shown.\n */\n isDisabled?: boolean;\n /**\n * The id of the radio button.\n */\n id: string;\n /**\n * The label that should be displayed next to the radio button.\n */\n label?: string;\n /**\n * Function to be executed when a button is checked.\n */\n onChange?: (item: RadioButtonItem) => void;\n};\n\nconst RadioButton: FC<RadioButtonProps> = ({\n isChecked,\n label,\n onChange,\n id,\n isDisabled = false,\n}) => {\n const { selectedRadioButtonId, updateSelectedRadioButtonId } =\n useContext(RadioButtonGroupContext);\n\n const [internalIsChecked, setInternalIsChecked] = useState(false);\n const [isHovered, setIsHovered] = useState(false);\n\n const isInGroup = typeof updateSelectedRadioButtonId === 'function';\n\n const isMarked = isInGroup ? selectedRadioButtonId === id : internalIsChecked;\n\n const isInitialRenderRef = useRef(true);\n\n useEffect(() => {\n if (isChecked) {\n setInternalIsChecked(isChecked);\n }\n }, [isChecked]);\n\n useEffect(() => {\n if (isInitialRenderRef.current) {\n isInitialRenderRef.current = false;\n } else if (typeof onChange === 'function') {\n onChange({ isChecked: isMarked, id });\n }\n }, [id, isMarked, onChange]);\n\n const handleClick = useCallback(() => {\n if (isDisabled) {\n return;\n }\n\n if (typeof updateSelectedRadioButtonId === 'function') {\n updateSelectedRadioButtonId(id);\n }\n\n setInternalIsChecked((prevState) => !prevState);\n }, [id, isDisabled, updateSelectedRadioButtonId]);\n\n const handleMouseEnter = useCallback(() => {\n if (!isDisabled) {\n setIsHovered(true);\n }\n }, [isDisabled]);\n\n const handleMouseLeave = () => {\n setIsHovered(false);\n };\n\n return useMemo(\n () => (\n <StyledRadioButton\n isDisabled={isDisabled}\n onClick={handleClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n <StyledRadioButtonPseudoCheckBox isChecked={isMarked}>\n <StyledRadioButtonCheckBoxMark isHovered={isHovered} isSelected={isMarked} />\n </StyledRadioButtonPseudoCheckBox>\n <StyledRadioButtonCheckBox\n disabled={isDisabled}\n type=\"radio\"\n checked={isMarked}\n onChange={() => {}}\n />\n {label && <StyledRadioButtonLabel>{label}</StyledRadioButtonLabel>}\n </StyledRadioButton>\n ),\n [handleClick, handleMouseEnter, isDisabled, isHovered, isMarked, label]\n );\n};\n\nRadioButton.displayName = 'RadioButton';\n\nexport default RadioButton;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAM8B,SAAAG,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,SAAAL,wBAAAS,GAAA,EAAAJ,WA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AAK,CAAC;EACvB,CAAC;EAED,OAAO,IAAAY,cAAO,EACV,mBACItD,MAAA,CAAAY,OAAA,CAAA2C,aAAA,CAACnD,YAAA,CAAAoD,iBAAiB;IACdvB,UAAU,EAAEA,UAAW;IACvBwB,OAAO,EAAER,WAAY;IACrBS,YAAY,EAAEN,gBAAiB;IAC/BO,YAAY,EAAEN;EAAiB,gBAE/BrD,MAAA,CAAAY,OAAA,CAAA2C,aAAA,CAACnD,YAAA,CAAAwD,+BAA+B;IAAC/B,SAAS,EAAEe;EAAS,gBACjD5C,MAAA,CAAAY,OAAA,CAAA2C,aAAA,CAACnD,YAAA,CAAAyD,6BAA6B;IAACpB,SAAS,EAAEA,SAAU;IAACqB,UAAU,EAAElB;EAAS,CAAE,CAC/C,CAAC,eAClC5C,MAAA,CAAAY,OAAA,CAAA2C,aAAA,CAACnD,YAAA,CAAA2D,yBAAyB;IACtBC,QAAQ,EAAE/B,UAAW;IACrBgC,IAAI,EAAC,OAAO;IACZC,OAAO,EAAEtB,QAAS;IAClBb,QAAQ,EAAEA,CAAA,KAAM,CAAC;EAAE,CACtB,CAAC,EACDD,KAAK,iBAAI9B,MAAA,CAAAY,OAAA,CAAA2C,aAAA,CAACnD,YAAA,CAAA+D,sBAAsB,QAAErC,KAA8B,CAClD,CACtB,EACD,CAACmB,WAAW,EAAEG,gBAAgB,EAAEnB,UAAU,EAAEQ,SAAS,EAAEG,QAAQ,EAAEd,KAAK,CAC1E,CAAC;AACL,CAAC;AAEDH,WAAW,CAACyC,WAAW,GAAG,aAAa;AAAC,IAAAC,QAAA,GAEzB1C,WAAW;AAAA2C,OAAA,CAAA1D,OAAA,GAAAyD,QAAA"}
@@ -0,0 +1,22 @@
1
+ export declare const StyledRadioButton: import("styled-components").StyledComponent<"span", any, {
2
+ isDisabled: boolean;
3
+ } & {
4
+ theme: import("../color-scheme-provider/ColorSchemeProvider").Theme;
5
+ }, never>;
6
+ export declare const StyledRadioButtonCheckBox: import("styled-components").StyledComponent<"input", any, {
7
+ theme: import("../color-scheme-provider/ColorSchemeProvider").Theme;
8
+ }, never>;
9
+ export declare const StyledRadioButtonPseudoCheckBox: import("styled-components").StyledComponent<"div", any, {
10
+ isChecked: boolean;
11
+ } & {
12
+ theme: import("../color-scheme-provider/ColorSchemeProvider").Theme;
13
+ }, never>;
14
+ export declare const StyledRadioButtonCheckBoxMark: import("styled-components").StyledComponent<"span", any, {
15
+ isHovered: boolean;
16
+ isSelected: boolean;
17
+ } & {
18
+ theme: import("../color-scheme-provider/ColorSchemeProvider").Theme;
19
+ }, never>;
20
+ export declare const StyledRadioButtonLabel: import("styled-components").StyledComponent<"p", any, {
21
+ theme: import("../color-scheme-provider/ColorSchemeProvider").Theme;
22
+ }, never>;
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StyledRadioButtonPseudoCheckBox = exports.StyledRadioButtonLabel = exports.StyledRadioButtonCheckBoxMark = exports.StyledRadioButtonCheckBox = exports.StyledRadioButton = void 0;
7
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
8
+ 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); }
9
+ 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; }
10
+ const StyledRadioButton = _styledComponents.default.span`
11
+ display: flex;
12
+ gap: 5px;
13
+ user-select: none;
14
+ width: fit-content;
15
+ align-items: center;
16
+ position: relative;
17
+ cursor: ${_ref => {
18
+ let {
19
+ isDisabled
20
+ } = _ref;
21
+ return isDisabled ? 'default !important' : 'pointer';
22
+ }};
23
+ opacity: ${_ref2 => {
24
+ let {
25
+ isDisabled
26
+ } = _ref2;
27
+ return isDisabled ? 0.5 : 1;
28
+ }};
29
+ `;
30
+ exports.StyledRadioButton = StyledRadioButton;
31
+ const StyledRadioButtonCheckBox = _styledComponents.default.input`
32
+ opacity: 0;
33
+ `;
34
+ exports.StyledRadioButtonCheckBox = StyledRadioButtonCheckBox;
35
+ const StyledRadioButtonPseudoCheckBox = _styledComponents.default.div`
36
+ background-color: ${_ref3 => {
37
+ let {
38
+ theme,
39
+ isChecked
40
+ } = _ref3;
41
+ return isChecked ? theme.secondary : theme['secondary-103'];
42
+ }};
43
+ opacity: 0.5;
44
+ border: 1px solid rgba(160, 160, 160, 0.3);
45
+ width: 13px;
46
+ height: 13px;
47
+ position: absolute;
48
+ border-radius: 100%;
49
+ top: 22%;
50
+ left: -1%;
51
+ cursor: pointer !important;
52
+ `;
53
+ exports.StyledRadioButtonPseudoCheckBox = StyledRadioButtonPseudoCheckBox;
54
+ const StyledRadioButtonCheckBoxMark = _styledComponents.default.span`
55
+ cursor: pointer;
56
+ background-color: transparent;
57
+ position: absolute;
58
+ top: 0;
59
+ left: 2.925px;
60
+ display: inline-block;
61
+ transform: rotate(35deg);
62
+ height: 9px;
63
+ width: 5px;
64
+ border-bottom: 2px solid white;
65
+ border-right: 2px solid white;
66
+ border-top: transparent;
67
+ border-left: transparent;
68
+ z-index: 2;
69
+
70
+ ${_ref4 => {
71
+ let {
72
+ isHovered,
73
+ isSelected
74
+ } = _ref4;
75
+ if (isSelected) {
76
+ return (0, _styledComponents.css)`
77
+ opacity: 1;
78
+ `;
79
+ }
80
+ if (isHovered) {
81
+ return (0, _styledComponents.css)`
82
+ opacity: 0.5;
83
+ `;
84
+ }
85
+ return (0, _styledComponents.css)`
86
+ opacity: 0;
87
+ `;
88
+ }}
89
+ `;
90
+ exports.StyledRadioButtonCheckBoxMark = StyledRadioButtonCheckBoxMark;
91
+ const StyledRadioButtonLabel = _styledComponents.default.p`
92
+ color: ${_ref5 => {
93
+ let {
94
+ theme
95
+ } = _ref5;
96
+ return theme.text;
97
+ }};
98
+ `;
99
+ exports.StyledRadioButtonLabel = StyledRadioButtonLabel;
100
+ //# sourceMappingURL=RadioButton.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RadioButton.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","StyledRadioButton","styled","span","_ref","isDisabled","_ref2","exports","StyledRadioButtonCheckBox","input","StyledRadioButtonPseudoCheckBox","div","_ref3","theme","isChecked","secondary","StyledRadioButtonCheckBoxMark","_ref4","isHovered","isSelected","css","StyledRadioButtonLabel","p","_ref5","text"],"sources":["../../../src/components/radio-button/RadioButton.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledRadioButtonProps = WithTheme<{ isDisabled: boolean }>;\n\nexport const StyledRadioButton = styled.span<StyledRadioButtonProps>`\n display: flex;\n gap: 5px;\n user-select: none;\n width: fit-content;\n align-items: center;\n position: relative;\n cursor: ${({ isDisabled }: StyledRadioButtonProps) =>\n isDisabled ? 'default !important' : 'pointer'};\n opacity: ${({ isDisabled }: StyledRadioButtonProps) => (isDisabled ? 0.5 : 1)};\n`;\n\ntype StyledRadioButtonCheckBoxProps = WithTheme<unknown>;\n\nexport const StyledRadioButtonCheckBox = styled.input<StyledRadioButtonCheckBoxProps>`\n opacity: 0;\n`;\n\ntype StyledRadioButtonPseudoCheckBoxProps = WithTheme<{ isChecked: boolean }>;\n\nexport const StyledRadioButtonPseudoCheckBox = styled.div<StyledRadioButtonPseudoCheckBoxProps>`\n background-color: ${({ theme, isChecked }: StyledRadioButtonPseudoCheckBoxProps) =>\n isChecked ? theme.secondary : theme['secondary-103']};\n opacity: 0.5;\n border: 1px solid rgba(160, 160, 160, 0.3);\n width: 13px;\n height: 13px;\n position: absolute;\n border-radius: 100%;\n top: 22%;\n left: -1%;\n cursor: pointer !important;\n`;\n\ntype StyledRadioButtonCheckBoxMarkProps = WithTheme<{\n isHovered: boolean;\n isSelected: boolean;\n}>;\n\nexport const StyledRadioButtonCheckBoxMark = styled.span<StyledRadioButtonCheckBoxMarkProps>`\n cursor: pointer;\n background-color: transparent;\n position: absolute;\n top: 0;\n left: 2.925px;\n display: inline-block;\n transform: rotate(35deg);\n height: 9px;\n width: 5px;\n border-bottom: 2px solid white;\n border-right: 2px solid white;\n border-top: transparent;\n border-left: transparent;\n z-index: 2;\n\n ${({ isHovered, isSelected }) => {\n if (isSelected) {\n return css`\n opacity: 1;\n `;\n }\n\n if (isHovered) {\n return css`\n opacity: 0.5;\n `;\n }\n\n return css`\n opacity: 0;\n `;\n }}\n`;\n\ntype StyledRadioButtonLabelProps = WithTheme<unknown>;\n\nexport const StyledRadioButtonLabel = styled.p<StyledRadioButtonLabelProps>`\n color: ${({ theme }: StyledRadioButtonLabelProps) => theme.text};\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAgD,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAA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ioButtonItem } from '../types';
3
+ type IUpdateSelectedRadioButtonId = (id: string) => void;
4
+ interface IRadioButtonGroupContext {
5
+ selectedRadioButtonId: string | undefined;
6
+ updateSelectedRadioButtonId?: IUpdateSelectedRadioButtonId;
7
+ }
8
+ export declare const RadioButtonGroupContext: React.Context<IRadioButtonGroupContext>;
9
+ export type RadioButtonGroupProps = {
10
+ /**
11
+ * The RadioButtons that should be grouped. Radio buttons with the same group are
12
+ * automatically unchecked when an `RadioButton` of the group is checked.
13
+ */
14
+ children: ReactNode;
15
+ /**
16
+ * Function to be executed when a button is checked.
17
+ */
18
+ onChange?: (item: RadioButtonItem) => void;
19
+ };
20
+ declare const RadioButtonGroup: FC<RadioButtonGroupProps>;
21
+ export default RadioButtonGroup;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.RadioButtonGroupContext = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ 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); }
9
+ 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; }
10
+ const RadioButtonGroupContext = /*#__PURE__*/_react.default.createContext({
11
+ selectedRadioButtonId: undefined,
12
+ updateSelectedRadioButtonId: undefined
13
+ });
14
+ exports.RadioButtonGroupContext = RadioButtonGroupContext;
15
+ RadioButtonGroupContext.displayName = 'RadioButtonGroupContext';
16
+ const RadioButtonGroup = _ref => {
17
+ let {
18
+ children,
19
+ onChange
20
+ } = _ref;
21
+ const [selectedRadioButtonId, setSelectedRadioButtonId] = (0, _react.useState)(undefined);
22
+ const isInitialRenderRef = (0, _react.useRef)(true);
23
+ const updateSelectedRadioButtonId = (0, _react.useCallback)(id => {
24
+ setSelectedRadioButtonId(currentSelectedRadioButtonId => {
25
+ if (currentSelectedRadioButtonId === id) {
26
+ return undefined;
27
+ }
28
+ return id;
29
+ });
30
+ }, []);
31
+ (0, _react.useEffect)(() => {
32
+ if (isInitialRenderRef.current) {
33
+ isInitialRenderRef.current = false;
34
+ } else if (typeof selectedRadioButtonId === 'string') {
35
+ if (typeof onChange === 'function') {
36
+ onChange({
37
+ id: selectedRadioButtonId !== null && selectedRadioButtonId !== void 0 ? selectedRadioButtonId : '',
38
+ isChecked: true
39
+ });
40
+ }
41
+ }
42
+ }, [onChange, selectedRadioButtonId]);
43
+ const providerValue = (0, _react.useMemo)(() => ({
44
+ selectedRadioButtonId,
45
+ updateSelectedRadioButtonId
46
+ }), [selectedRadioButtonId, updateSelectedRadioButtonId]);
47
+ return /*#__PURE__*/_react.default.createElement(RadioButtonGroupContext.Provider, {
48
+ value: providerValue
49
+ }, children);
50
+ };
51
+ RadioButtonGroup.displayName = 'RadioButtonGroup';
52
+ var _default = RadioButtonGroup;
53
+ exports.default = _default;
54
+ //# sourceMappingURL=RadioButtonGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RadioButtonGroup.js","names":["_react","_interopRequireWildcard","require","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","RadioButtonGroupContext","React","createContext","selectedRadioButtonId","undefined","updateSelectedRadioButtonId","exports","displayName","RadioButtonGroup","_ref","children","onChange","setSelectedRadioButtonId","useState","isInitialRenderRef","useRef","useCallback","id","currentSelectedRadioButtonId","useEffect","current","isChecked","providerValue","useMemo","createElement","Provider","value","_default"],"sources":["../../../../src/components/radio-button/radio-button-group/RadioButtonGroup.tsx"],"sourcesContent":["import React, { FC, ReactNode, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport type { RadioButtonItem } from '../types';\n\ntype IUpdateSelectedRadioButtonId = (id: string) => void;\n\ninterface IRadioButtonGroupContext {\n selectedRadioButtonId: string | undefined;\n updateSelectedRadioButtonId?: IUpdateSelectedRadioButtonId;\n}\n\nexport const RadioButtonGroupContext = React.createContext<IRadioButtonGroupContext>({\n selectedRadioButtonId: undefined,\n updateSelectedRadioButtonId: undefined,\n});\n\nRadioButtonGroupContext.displayName = 'RadioButtonGroupContext';\n\nexport type RadioButtonGroupProps = {\n /**\n * The RadioButtons that should be grouped. Radio buttons with the same group are\n * automatically unchecked when an `RadioButton` of the group is checked.\n */\n children: ReactNode;\n /**\n * Function to be executed when a button is checked.\n */\n onChange?: (item: RadioButtonItem) => void;\n};\n\nconst RadioButtonGroup: FC<RadioButtonGroupProps> = ({ children, onChange }) => {\n const [selectedRadioButtonId, setSelectedRadioButtonId] =\n useState<IRadioButtonGroupContext['selectedRadioButtonId']>(undefined);\n\n const isInitialRenderRef = useRef(true);\n\n const updateSelectedRadioButtonId = useCallback<IUpdateSelectedRadioButtonId>((id) => {\n setSelectedRadioButtonId((currentSelectedRadioButtonId) => {\n if (currentSelectedRadioButtonId === id) {\n return undefined;\n }\n\n return id;\n });\n }, []);\n\n useEffect(() => {\n if (isInitialRenderRef.current) {\n isInitialRenderRef.current = false;\n } else if (typeof selectedRadioButtonId === 'string') {\n if (typeof onChange === 'function') {\n onChange({ id: selectedRadioButtonId ?? '', isChecked: true });\n }\n }\n }, [onChange, selectedRadioButtonId]);\n\n const providerValue = useMemo<IRadioButtonGroupContext>(\n () => ({\n selectedRadioButtonId,\n updateSelectedRadioButtonId,\n }),\n [selectedRadioButtonId, updateSelectedRadioButtonId]\n );\n\n return (\n <RadioButtonGroupContext.Provider value={providerValue}>\n {children}\n </RadioButtonGroupContext.Provider>\n );\n};\n\nRadioButtonGroup.displayName = 'RadioButtonGroup';\n\nexport default RadioButtonGroup;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAgG,SAAAC,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,SAAAH,wBAAAO,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,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CA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EkB,SAAS,EAAE;QAAK,CAAC,CAAC;MAClE;IACJ;EACJ,CAAC,EAAE,CAACV,QAAQ,EAAER,qBAAqB,CAAC,CAAC;EAErC,MAAMmB,aAAa,GAAG,IAAAC,cAAO,EACzB,OAAO;IACHpB,qBAAqB;IACrBE;EACJ,CAAC,CAAC,EACF,CAACF,qBAAqB,EAAEE,2BAA2B,CACvD,CAAC;EAED,oBACI9B,MAAA,CAAAU,OAAA,CAAAuC,aAAA,CAACxB,uBAAuB,CAACyB,QAAQ;IAACC,KAAK,EAAEJ;EAAc,GAClDZ,QAC6B,CAAC;AAE3C,CAAC;AAEDF,gBAAgB,CAACD,WAAW,GAAG,kBAAkB;AAAC,IAAAoB,QAAA,GAEnCnB,gBAAgB;AAAAF,OAAA,CAAArB,OAAA,GAAA0C,QAAA"}
@@ -0,0 +1,4 @@
1
+ export interface RadioButtonItem {
2
+ id: string;
3
+ isChecked: boolean;
4
+ }
@@ -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/radio-button/types.ts"],"sourcesContent":["export interface RadioButtonItem {\n id: string;\n isChecked: boolean;\n}\n"],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { CSSProperties, FC } from 'react';
2
+ export type ScrollViewProps = {
3
+ /**
4
+ * The maximum height of the scroll view.
5
+ */
6
+ maxHeight: CSSProperties['height'];
7
+ };
8
+ declare const ScrollView: FC<ScrollViewProps>;
9
+ export default ScrollView;
@@ -0,0 +1,23 @@
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 _ScrollView = require("./ScrollView.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 ScrollView = _ref => {
12
+ let {
13
+ maxHeight = '300px',
14
+ children
15
+ } = _ref;
16
+ return (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_ScrollView.StyledScrollView, {
17
+ maxHeight: maxHeight
18
+ }, children), [children, maxHeight]);
19
+ };
20
+ ScrollView.displayName = 'ScrollView';
21
+ var _default = ScrollView;
22
+ exports.default = _default;
23
+ //# sourceMappingURL=ScrollView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScrollView.js","names":["_react","_interopRequireWildcard","require","_ScrollView","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ScrollView","_ref","maxHeight","children","useMemo","createElement","StyledScrollView","displayName","_default","exports"],"sources":["../../../src/components/scroll-view/ScrollView.tsx"],"sourcesContent":["import React, { CSSProperties, FC, useMemo } from 'react';\nimport { StyledScrollView } from './ScrollView.styles';\n\nexport type ScrollViewProps = {\n /**\n * The maximum height of the scroll view.\n */\n maxHeight: CSSProperties['height'];\n};\n\nconst ScrollView: FC<ScrollViewProps> = ({ maxHeight = '300px', children }) =>\n useMemo(\n () => <StyledScrollView maxHeight={maxHeight}>{children}</StyledScrollView>,\n [children, maxHeight]\n );\n\nScrollView.displayName = 'ScrollView';\n\nexport default ScrollView;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAAuD,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,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA;AASvD,MAAMW,UAA+B,GAAGC,IAAA;EAAA,IAAC;IAAEC,SAAS,GAAG,OAAO;IAAEC;EAAS,CAAC,GAAAF,IAAA;EAAA,OACtE,IAAAG,cAAO,EACH,mBAAM9B,MAAA,CAAAW,OAAA,CAAAoB,aAAA,CAAC5B,WAAA,CAAA6B,gBAAgB;IAACJ,SAAS,EAAEA;EAAU,GAAEC,QAA2B,CAAC,EAC3E,CAACA,QAAQ,EAAED,SAAS,CACxB,CAAC;AAAA;AAELF,UAAU,CAACO,WAAW,GAAG,YAAY;AAAC,IAAAC,QAAA,GAEvBR,UAAU;AAAAS,OAAA,CAAAxB,OAAA,GAAAuB,QAAA"}
@@ -0,0 +1,6 @@
1
+ import type { CSSProperties } from 'react';
2
+ export declare const StyledScrollView: import("styled-components").StyledComponent<"div", any, {
3
+ maxHeight: CSSProperties['height'];
4
+ } & {
5
+ theme: import("../color-scheme-provider/ColorSchemeProvider").Theme;
6
+ }, never>;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StyledScrollView = void 0;
7
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+ const StyledScrollView = _styledComponents.default.div`
10
+ max-height: ${_ref => {
11
+ let {
12
+ maxHeight
13
+ } = _ref;
14
+ return maxHeight;
15
+ }};
16
+ overflow-y: scroll;
17
+
18
+ &::-webkit-scrollbar {
19
+ width: 5px;
20
+ }
21
+
22
+ &::-webkit-scrollbar-thumb {
23
+ background: rgba(160, 160, 160, 1);
24
+ }
25
+ `;
26
+ exports.StyledScrollView = StyledScrollView;
27
+ //# sourceMappingURL=ScrollView.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScrollView.styles.js","names":["_styledComponents","_interopRequireDefault","require","obj","__esModule","default","StyledScrollView","styled","div","_ref","maxHeight","exports"],"sources":["../../../src/components/scroll-view/ScrollView.styles.ts"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport styled from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledScrollViewProps = WithTheme<{ maxHeight: CSSProperties['height'] }>;\n\nexport const StyledScrollView = styled.div<StyledScrollViewProps>`\n max-height: ${({ maxHeight }) => maxHeight};\n overflow-y: scroll;\n\n &::-webkit-scrollbar {\n width: 5px;\n }\n\n &::-webkit-scrollbar-thumb {\n background: rgba(160, 160, 160, 1);\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;AAKhC,MAAMG,gBAAgB,GAAGC,yBAAM,CAACC,GAA2B;AAClE,kBAAkBC,IAAA;EAAA,IAAC;IAAEC;EAAU,CAAC,GAAAD,IAAA;EAAA,OAAKC,SAAS;AAAA,CAAC;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAACC,OAAA,CAAAL,gBAAA,GAAAA,gBAAA"}
@@ -0,0 +1,26 @@
1
+ import { ChangeEventHandler, FC, FocusEventHandler } from 'react';
2
+ import type { ISearchBoxItem } from './types';
3
+ export type SearchBoxProps = {
4
+ /**
5
+ * A list of items that can be searched.
6
+ */
7
+ list: ISearchBoxItem[];
8
+ /**
9
+ * The placeholder that should be displayed.
10
+ */
11
+ placeholder?: string;
12
+ /**
13
+ * Function to be executed when the input lost focus.
14
+ */
15
+ onBlur?: FocusEventHandler<HTMLInputElement>;
16
+ /**
17
+ * Function to be executed when the input is changed.
18
+ */
19
+ onChange?: ChangeEventHandler<HTMLInputElement>;
20
+ /**
21
+ * Function to be executed when an item is selected.
22
+ */
23
+ onSelect?: (item: ISearchBoxItem) => void;
24
+ };
25
+ declare const SearchBox: FC<SearchBoxProps>;
26
+ export default SearchBox;
@@ -0,0 +1,166 @@
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 _calculate = require("../../utils/calculate");
10
+ var _Input = _interopRequireDefault(require("../input/Input"));
11
+ var _SearchBoxItem = _interopRequireDefault(require("./search-box-item/SearchBoxItem"));
12
+ var _SearchBox = require("./SearchBox.styles");
13
+ var _utils = require("./utils");
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+ 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); }
16
+ 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; }
17
+ const SearchBox = _ref => {
18
+ let {
19
+ placeholder,
20
+ list,
21
+ onChange,
22
+ onBlur,
23
+ onSelect
24
+ } = _ref;
25
+ const [matchingItems, setMatchingItems] = (0, _react.useState)([]);
26
+ const [value, setValue] = (0, _react.useState)('');
27
+ const [isAnimating, setIsAnimating] = (0, _react.useState)(false);
28
+ const [height, setHeight] = (0, _react.useState)(0);
29
+ const [width, setWidth] = (0, _react.useState)(0);
30
+ const boxRef = (0, _react.useRef)(null);
31
+ const contentRef = (0, _react.useRef)(null);
32
+ const inputRef = (0, _react.useRef)(null);
33
+
34
+ /**
35
+ * This function closes the list of items
36
+ */
37
+ const handleOutsideClick = (0, _react.useCallback)(event => {
38
+ if (boxRef.current && !boxRef.current.contains(event.target)) {
39
+ setIsAnimating(false);
40
+ }
41
+ }, [boxRef]);
42
+
43
+ /**
44
+ * This hook listens for clicks
45
+ */
46
+ (0, _react.useEffect)(() => {
47
+ document.addEventListener('click', handleOutsideClick);
48
+ return () => {
49
+ document.removeEventListener('click', handleOutsideClick);
50
+ };
51
+ }, [handleOutsideClick, boxRef]);
52
+
53
+ /**
54
+ * This hook calculates the height
55
+ */
56
+ (0, _react.useEffect)(() => {
57
+ const textArray = list.map(_ref2 => {
58
+ let {
59
+ text
60
+ } = _ref2;
61
+ return text;
62
+ });
63
+ setHeight((0, _calculate.calculateContentHeight)(textArray));
64
+ }, [list, placeholder]);
65
+
66
+ /**
67
+ * This hook calculates the width
68
+ */
69
+ (0, _react.useEffect)(() => {
70
+ const input = document.getElementById('search_box_input');
71
+ if (input) {
72
+ setWidth(input.offsetWidth);
73
+ }
74
+ }, []);
75
+
76
+ /**
77
+ * This function handles changes of the input
78
+ */
79
+ const handleChange = (0, _react.useCallback)(event => {
80
+ const searchedItems = (0, _utils.searchList)({
81
+ items: list,
82
+ searchString: event.target.value
83
+ });
84
+ setMatchingItems(searchedItems);
85
+ setIsAnimating(searchedItems.length !== 0);
86
+ setValue(event.target.value);
87
+ if (typeof onChange === 'function') {
88
+ onChange(event);
89
+ }
90
+ }, [list, onChange]);
91
+
92
+ /**
93
+ * This function handles the blur event of the input
94
+ */
95
+ const handleBlur = (0, _react.useCallback)(event => {
96
+ if (typeof onBlur === 'function') {
97
+ onBlur(event);
98
+ }
99
+ }, [onBlur]);
100
+
101
+ /**
102
+ * This function handles the item selection
103
+ */
104
+ const handleSelect = (0, _react.useCallback)(item => {
105
+ setValue(item.text);
106
+ setIsAnimating(false);
107
+ if (typeof onSelect === 'function') {
108
+ onSelect(item);
109
+ }
110
+ }, [onSelect]);
111
+ const content = (0, _react.useMemo)(() => {
112
+ const items = [];
113
+ matchingItems.sort((a, b) => a.text.localeCompare(b.text));
114
+ matchingItems.forEach(_ref3 => {
115
+ let {
116
+ id,
117
+ text
118
+ } = _ref3;
119
+ items.push( /*#__PURE__*/_react.default.createElement(_SearchBoxItem.default, {
120
+ key: id,
121
+ text: text,
122
+ id: id,
123
+ onSelect: handleSelect
124
+ }));
125
+ });
126
+ return items;
127
+ }, [handleSelect, matchingItems]);
128
+ return (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_SearchBox.StyledSearchBox, {
129
+ ref: boxRef
130
+ }, /*#__PURE__*/_react.default.createElement("div", {
131
+ id: "search_box_input"
132
+ }, /*#__PURE__*/_react.default.createElement(_Input.default, {
133
+ ref: inputRef,
134
+ onChange: handleChange,
135
+ onBlur: handleBlur,
136
+ placeholder: placeholder,
137
+ value: value
138
+ })), /*#__PURE__*/_react.default.createElement(_framerMotion.AnimatePresence, {
139
+ initial: false
140
+ }, /*#__PURE__*/_react.default.createElement(_SearchBox.StyledMotionSearchBoxBody, {
141
+ key: "content",
142
+ height: height,
143
+ width: width,
144
+ initial: {
145
+ height: 0,
146
+ opacity: 0
147
+ },
148
+ animate: isAnimating ? {
149
+ height: 'fit-content',
150
+ opacity: 1
151
+ } : {
152
+ height: 0,
153
+ opacity: 0
154
+ },
155
+ transition: {
156
+ duration: 0.2,
157
+ type: 'tween'
158
+ }
159
+ }, /*#__PURE__*/_react.default.createElement("div", {
160
+ ref: contentRef
161
+ }, content)))), [content, handleBlur, handleChange, height, isAnimating, placeholder, value, width]);
162
+ };
163
+ SearchBox.displayName = 'SearchBox';
164
+ var _default = SearchBox;
165
+ exports.default = _default;
166
+ //# sourceMappingURL=SearchBox.js.map