@mirai/ui 2.0.42 → 2.1.1

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 (362) hide show
  1. package/build/components/Action/Action.js +24 -30
  2. package/build/components/Action/Action.js.map +1 -1
  3. package/build/components/Action/Action.stories.js +3 -6
  4. package/build/components/Action/Action.stories.js.map +1 -1
  5. package/build/components/Action/index.js +1 -1
  6. package/build/components/Action/index.js.map +1 -1
  7. package/build/components/Button/Button.js +32 -39
  8. package/build/components/Button/Button.js.map +1 -1
  9. package/build/components/Button/Button.stories.js +25 -48
  10. package/build/components/Button/Button.stories.js.map +1 -1
  11. package/build/components/Button/index.js +1 -1
  12. package/build/components/Button/index.js.map +1 -1
  13. package/build/components/Calendar/Calendar.Month.js +45 -57
  14. package/build/components/Calendar/Calendar.Month.js.map +1 -1
  15. package/build/components/Calendar/Calendar.Week.js +54 -83
  16. package/build/components/Calendar/Calendar.Week.js.map +1 -1
  17. package/build/components/Calendar/Calendar.Weekdays.js +15 -15
  18. package/build/components/Calendar/Calendar.Weekdays.js.map +1 -1
  19. package/build/components/Calendar/Calendar.constants.js +2 -4
  20. package/build/components/Calendar/Calendar.constants.js.map +1 -1
  21. package/build/components/Calendar/Calendar.js +110 -162
  22. package/build/components/Calendar/Calendar.js.map +1 -1
  23. package/build/components/Calendar/Calendar.stories.js +75 -90
  24. package/build/components/Calendar/Calendar.stories.js.map +1 -1
  25. package/build/components/Calendar/helpers/getFirstDateOfMonth.js +2 -2
  26. package/build/components/Calendar/helpers/getFirstDateOfMonth.js.map +1 -1
  27. package/build/components/Calendar/helpers/getFirstDateOfWeek.js +6 -6
  28. package/build/components/Calendar/helpers/getFirstDateOfWeek.js.map +1 -1
  29. package/build/components/Calendar/helpers/getFirstDayOfWeek.js +5 -5
  30. package/build/components/Calendar/helpers/getFirstDayOfWeek.js.map +1 -1
  31. package/build/components/Calendar/helpers/getHeader.js +6 -6
  32. package/build/components/Calendar/helpers/getHeader.js.map +1 -1
  33. package/build/components/Calendar/helpers/getMonthRef.js +9 -8
  34. package/build/components/Calendar/helpers/getMonthRef.js.map +1 -1
  35. package/build/components/Calendar/helpers/getScrollTo.js +8 -15
  36. package/build/components/Calendar/helpers/getScrollTo.js.map +1 -1
  37. package/build/components/Calendar/helpers/getToday.js +1 -3
  38. package/build/components/Calendar/helpers/getToday.js.map +1 -1
  39. package/build/components/Calendar/helpers/getWeekDays.js +8 -8
  40. package/build/components/Calendar/helpers/getWeekDays.js.map +1 -1
  41. package/build/components/Calendar/helpers/getWeekNumber.js +3 -3
  42. package/build/components/Calendar/helpers/getWeekNumber.js.map +1 -1
  43. package/build/components/Calendar/helpers/index.js +9 -9
  44. package/build/components/Calendar/helpers/index.js.map +1 -1
  45. package/build/components/Calendar/index.js +1 -1
  46. package/build/components/Calendar/index.js.map +1 -1
  47. package/build/components/Form/Form.constants.js +5 -10
  48. package/build/components/Form/Form.constants.js.map +1 -1
  49. package/build/components/Form/Form.js +86 -118
  50. package/build/components/Form/Form.js.map +1 -1
  51. package/build/components/Form/Form.stories.js +47 -83
  52. package/build/components/Form/Form.stories.js.map +1 -1
  53. package/build/components/Form/helpers/getChildrenErrors.js +18 -22
  54. package/build/components/Form/helpers/getChildrenErrors.js.map +1 -1
  55. package/build/components/Form/helpers/getChildrenValues.js +15 -22
  56. package/build/components/Form/helpers/getChildrenValues.js.map +1 -1
  57. package/build/components/Form/helpers/getField.js +5 -4
  58. package/build/components/Form/helpers/getField.js.map +1 -1
  59. package/build/components/Form/helpers/groupState.js +8 -10
  60. package/build/components/Form/helpers/groupState.js.map +1 -1
  61. package/build/components/Form/helpers/index.js +4 -4
  62. package/build/components/Form/helpers/index.js.map +1 -1
  63. package/build/components/Form/index.js +1 -1
  64. package/build/components/Form/index.js.map +1 -1
  65. package/build/components/InputDate/InputDate.js +23 -38
  66. package/build/components/InputDate/InputDate.js.map +1 -1
  67. package/build/components/InputDate/InputDate.stories.js +18 -34
  68. package/build/components/InputDate/InputDate.stories.js.map +1 -1
  69. package/build/components/InputDate/helpers/formatValue.js +11 -13
  70. package/build/components/InputDate/helpers/formatValue.js.map +1 -1
  71. package/build/components/InputDate/helpers/index.js +1 -1
  72. package/build/components/InputDate/helpers/index.js.map +1 -1
  73. package/build/components/InputDate/index.js +1 -1
  74. package/build/components/InputDate/index.js.map +1 -1
  75. package/build/components/InputNumber/InputNumber.js +31 -44
  76. package/build/components/InputNumber/InputNumber.js.map +1 -1
  77. package/build/components/InputNumber/InputNumber.stories.js +8 -20
  78. package/build/components/InputNumber/InputNumber.stories.js.map +1 -1
  79. package/build/components/InputNumber/index.js +1 -1
  80. package/build/components/InputNumber/index.js.map +1 -1
  81. package/build/components/InputOption/InputOption.constants.js +3 -6
  82. package/build/components/InputOption/InputOption.constants.js.map +1 -1
  83. package/build/components/InputOption/InputOption.js +34 -38
  84. package/build/components/InputOption/InputOption.js.map +1 -1
  85. package/build/components/InputOption/InputOption.stories.js +8 -20
  86. package/build/components/InputOption/InputOption.stories.js.map +1 -1
  87. package/build/components/InputOption/index.js +2 -2
  88. package/build/components/InputOption/index.js.map +1 -1
  89. package/build/components/InputPhone/InputPhone.js +99 -143
  90. package/build/components/InputPhone/InputPhone.js.map +1 -1
  91. package/build/components/InputPhone/InputPhone.stories.js +22 -45
  92. package/build/components/InputPhone/InputPhone.stories.js.map +1 -1
  93. package/build/components/InputPhone/helpers/index.js +2 -2
  94. package/build/components/InputPhone/helpers/index.js.map +1 -1
  95. package/build/components/InputPhone/helpers/parseValue.js +8 -17
  96. package/build/components/InputPhone/helpers/parseValue.js.map +1 -1
  97. package/build/components/InputPhone/helpers/sanitizePrefixes.js +4 -12
  98. package/build/components/InputPhone/helpers/sanitizePrefixes.js.map +1 -1
  99. package/build/components/InputPhone/index.js +1 -1
  100. package/build/components/InputPhone/index.js.map +1 -1
  101. package/build/components/InputSelect/InputSelect.js +47 -70
  102. package/build/components/InputSelect/InputSelect.js.map +1 -1
  103. package/build/components/InputSelect/InputSelect.stories.js +12 -26
  104. package/build/components/InputSelect/InputSelect.stories.js.map +1 -1
  105. package/build/components/InputSelect/index.js +1 -1
  106. package/build/components/InputSelect/index.js.map +1 -1
  107. package/build/components/InputSelect/partials/InputSelect.Expand.js +3 -3
  108. package/build/components/InputSelect/partials/InputSelect.Expand.js.map +1 -1
  109. package/build/components/InputSelect/partials/index.js +1 -1
  110. package/build/components/InputSelect/partials/index.js.map +1 -1
  111. package/build/components/InputText/InputText.js +54 -87
  112. package/build/components/InputText/InputText.js.map +1 -1
  113. package/build/components/InputText/InputText.stories.js +17 -36
  114. package/build/components/InputText/InputText.stories.js.map +1 -1
  115. package/build/components/InputText/index.js +1 -1
  116. package/build/components/InputText/index.js.map +1 -1
  117. package/build/components/InputText/partials/InputText.Hint.js +8 -9
  118. package/build/components/InputText/partials/InputText.Hint.js.map +1 -1
  119. package/build/components/InputText/partials/InputText.IconState.js +10 -8
  120. package/build/components/InputText/partials/InputText.IconState.js.map +1 -1
  121. package/build/components/InputText/partials/InputText.Label.js +13 -15
  122. package/build/components/InputText/partials/InputText.Label.js.map +1 -1
  123. package/build/components/InputText/partials/index.js +3 -3
  124. package/build/components/InputText/partials/index.js.map +1 -1
  125. package/build/components/Menu/Menu.Option.js +14 -15
  126. package/build/components/Menu/Menu.Option.js.map +1 -1
  127. package/build/components/Menu/Menu.js +30 -41
  128. package/build/components/Menu/Menu.js.map +1 -1
  129. package/build/components/Menu/Menu.stories.js +9 -23
  130. package/build/components/Menu/Menu.stories.js.map +1 -1
  131. package/build/components/Menu/index.js +1 -1
  132. package/build/components/Menu/index.js.map +1 -1
  133. package/build/components/Modal/Modal.constants.js +2 -4
  134. package/build/components/Modal/Modal.constants.js.map +1 -1
  135. package/build/components/Modal/Modal.js +70 -103
  136. package/build/components/Modal/Modal.js.map +1 -1
  137. package/build/components/Modal/Modal.stories.js +15 -36
  138. package/build/components/Modal/Modal.stories.js.map +1 -1
  139. package/build/components/Modal/index.js +2 -2
  140. package/build/components/Modal/index.js.map +1 -1
  141. package/build/components/Notification/Notification.js +24 -26
  142. package/build/components/Notification/Notification.js.map +1 -1
  143. package/build/components/Notification/Notification.stories.js +14 -17
  144. package/build/components/Notification/Notification.stories.js.map +1 -1
  145. package/build/components/Notification/index.js +1 -1
  146. package/build/components/Notification/index.js.map +1 -1
  147. package/build/components/Progress/Progress.js +11 -15
  148. package/build/components/Progress/Progress.js.map +1 -1
  149. package/build/components/Progress/Progress.stories.js +4 -7
  150. package/build/components/Progress/Progress.stories.js.map +1 -1
  151. package/build/components/Progress/index.js +1 -1
  152. package/build/components/Progress/index.js.map +1 -1
  153. package/build/components/Slider/Slider.Item.js +17 -25
  154. package/build/components/Slider/Slider.Item.js.map +1 -1
  155. package/build/components/Slider/Slider.constants.js +2 -4
  156. package/build/components/Slider/Slider.constants.js.map +1 -1
  157. package/build/components/Slider/Slider.js +78 -130
  158. package/build/components/Slider/Slider.js.map +1 -1
  159. package/build/components/Slider/Slider.stories.js +25 -30
  160. package/build/components/Slider/Slider.stories.js.map +1 -1
  161. package/build/components/Slider/index.js +1 -1
  162. package/build/components/Slider/index.js.map +1 -1
  163. package/build/components/Table/Table.ColumnFilter.js +77 -116
  164. package/build/components/Table/Table.ColumnFilter.js.map +1 -1
  165. package/build/components/Table/Table.Filter.js +31 -41
  166. package/build/components/Table/Table.Filter.js.map +1 -1
  167. package/build/components/Table/Table.Row.js +48 -65
  168. package/build/components/Table/Table.Row.js.map +1 -1
  169. package/build/components/Table/Table.constants.js +4 -7
  170. package/build/components/Table/Table.constants.js.map +1 -1
  171. package/build/components/Table/Table.js +96 -125
  172. package/build/components/Table/Table.js.map +1 -1
  173. package/build/components/Table/Table.stories.js +38 -70
  174. package/build/components/Table/Table.stories.js.map +1 -1
  175. package/build/components/Table/helpers/index.js +2 -2
  176. package/build/components/Table/helpers/index.js.map +1 -1
  177. package/build/components/Table/helpers/select.js +54 -68
  178. package/build/components/Table/helpers/select.js.map +1 -1
  179. package/build/components/Table/helpers/storage.js +5 -6
  180. package/build/components/Table/helpers/storage.js.map +1 -1
  181. package/build/components/Table/index.js +1 -1
  182. package/build/components/Table/index.js.map +1 -1
  183. package/build/components/Tooltip/Tooltip.js +63 -84
  184. package/build/components/Tooltip/Tooltip.js.map +1 -1
  185. package/build/components/Tooltip/Tooltip.stories.js +87 -100
  186. package/build/components/Tooltip/Tooltip.stories.js.map +1 -1
  187. package/build/components/Tooltip/helpers/index.js +1 -1
  188. package/build/components/Tooltip/helpers/index.js.map +1 -1
  189. package/build/components/Tooltip/helpers/isPressableInstance.js +6 -5
  190. package/build/components/Tooltip/helpers/isPressableInstance.js.map +1 -1
  191. package/build/components/Tooltip/index.js +1 -1
  192. package/build/components/Tooltip/index.js.map +1 -1
  193. package/build/components/components.customElements.js.map +1 -1
  194. package/build/components/index.js +17 -17
  195. package/build/components/index.js.map +1 -1
  196. package/build/helpers/CustomElement.js +9 -29
  197. package/build/helpers/CustomElement.js.map +1 -1
  198. package/build/helpers/getIconState.js +6 -5
  199. package/build/helpers/getIconState.js.map +1 -1
  200. package/build/helpers/getInputDateErrors.js +10 -10
  201. package/build/helpers/getInputDateErrors.js.map +1 -1
  202. package/build/helpers/getInputErrors.js +25 -28
  203. package/build/helpers/getInputErrors.js.map +1 -1
  204. package/build/helpers/getInputPhoneErrors.js +11 -13
  205. package/build/helpers/getInputPhoneErrors.js.map +1 -1
  206. package/build/helpers/getNavigator.js +10 -10
  207. package/build/helpers/getNavigator.js.map +1 -1
  208. package/build/helpers/index.js +9 -9
  209. package/build/helpers/index.js.map +1 -1
  210. package/build/helpers/isJest.js +4 -6
  211. package/build/helpers/isJest.js.map +1 -1
  212. package/build/helpers/isPlaywright.js +3 -4
  213. package/build/helpers/isPlaywright.js.map +1 -1
  214. package/build/helpers/isValidDate.js +21 -38
  215. package/build/helpers/isValidDate.js.map +1 -1
  216. package/build/helpers/isValidEmail.js +3 -3
  217. package/build/helpers/isValidEmail.js.map +1 -1
  218. package/build/helpers/isValidPhone.js +9 -8
  219. package/build/helpers/isValidPhone.js.map +1 -1
  220. package/build/helpers/styles.js +3 -7
  221. package/build/helpers/styles.js.map +1 -1
  222. package/build/hooks/helpers/getResolution.js +7 -8
  223. package/build/hooks/helpers/getResolution.js.map +1 -1
  224. package/build/hooks/helpers/index.js +2 -2
  225. package/build/hooks/helpers/index.js.map +1 -1
  226. package/build/hooks/helpers/sanitizePx.js +1 -3
  227. package/build/hooks/helpers/sanitizePx.js.map +1 -1
  228. package/build/hooks/index.js +1 -1
  229. package/build/hooks/index.js.map +1 -1
  230. package/build/hooks/useDevice.js +21 -39
  231. package/build/hooks/useDevice.js.map +1 -1
  232. package/build/hooks/useDevice.stories.js +7 -16
  233. package/build/hooks/useDevice.stories.js.map +1 -1
  234. package/build/index.js +5 -5
  235. package/build/index.js.map +1 -1
  236. package/build/primitives/Checkbox/Checkbox.js +18 -18
  237. package/build/primitives/Checkbox/Checkbox.js.map +1 -1
  238. package/build/primitives/Checkbox/Checkbox.stories.js +8 -20
  239. package/build/primitives/Checkbox/Checkbox.stories.js.map +1 -1
  240. package/build/primitives/Checkbox/index.js +1 -1
  241. package/build/primitives/Checkbox/index.js.map +1 -1
  242. package/build/primitives/Icon/Icon.constants.js +1 -2
  243. package/build/primitives/Icon/Icon.constants.js.map +1 -1
  244. package/build/primitives/Icon/Icon.js +34 -41
  245. package/build/primitives/Icon/Icon.js.map +1 -1
  246. package/build/primitives/Icon/Icon.stories.js +8 -10
  247. package/build/primitives/Icon/Icon.stories.js.map +1 -1
  248. package/build/primitives/Icon/index.js +2 -2
  249. package/build/primitives/Icon/index.js.map +1 -1
  250. package/build/primitives/Input/Input.js +49 -63
  251. package/build/primitives/Input/Input.js.map +1 -1
  252. package/build/primitives/Input/Input.stories.js +14 -29
  253. package/build/primitives/Input/Input.stories.js.map +1 -1
  254. package/build/primitives/Input/helpers/index.js +1 -1
  255. package/build/primitives/Input/helpers/index.js.map +1 -1
  256. package/build/primitives/Input/helpers/parseValue.js +5 -5
  257. package/build/primitives/Input/helpers/parseValue.js.map +1 -1
  258. package/build/primitives/Input/index.js +1 -1
  259. package/build/primitives/Input/index.js.map +1 -1
  260. package/build/primitives/Layer/Layer.js +79 -93
  261. package/build/primitives/Layer/Layer.js.map +1 -1
  262. package/build/primitives/Layer/Layer.stories.js +10 -13
  263. package/build/primitives/Layer/Layer.stories.js.map +1 -1
  264. package/build/primitives/Layer/LayerContent.js +5 -3
  265. package/build/primitives/Layer/LayerContent.js.map +1 -1
  266. package/build/primitives/Layer/helpers/getElementLayout.js +18 -15
  267. package/build/primitives/Layer/helpers/getElementLayout.js.map +1 -1
  268. package/build/primitives/Layer/helpers/getLayerPosition.js +66 -69
  269. package/build/primitives/Layer/helpers/getLayerPosition.js.map +1 -1
  270. package/build/primitives/Layer/helpers/getModalParent.js +10 -9
  271. package/build/primitives/Layer/helpers/getModalParent.js.map +1 -1
  272. package/build/primitives/Layer/helpers/getScrollParent.js +4 -3
  273. package/build/primitives/Layer/helpers/getScrollParent.js.map +1 -1
  274. package/build/primitives/Layer/helpers/index.js +5 -5
  275. package/build/primitives/Layer/helpers/index.js.map +1 -1
  276. package/build/primitives/Layer/helpers/isComponentFixed.js +8 -19
  277. package/build/primitives/Layer/helpers/isComponentFixed.js.map +1 -1
  278. package/build/primitives/Layer/index.js +2 -2
  279. package/build/primitives/Layer/index.js.map +1 -1
  280. package/build/primitives/Pressable/Pressable.constants.js +1 -2
  281. package/build/primitives/Pressable/Pressable.constants.js.map +1 -1
  282. package/build/primitives/Pressable/Pressable.js +34 -44
  283. package/build/primitives/Pressable/Pressable.js.map +1 -1
  284. package/build/primitives/Pressable/Pressable.stories.js +5 -8
  285. package/build/primitives/Pressable/Pressable.stories.js.map +1 -1
  286. package/build/primitives/Pressable/index.js +1 -1
  287. package/build/primitives/Pressable/index.js.map +1 -1
  288. package/build/primitives/Primitive/Primitive.constants.js +4 -8
  289. package/build/primitives/Primitive/Primitive.constants.js.map +1 -1
  290. package/build/primitives/Primitive/Primitive.js +20 -28
  291. package/build/primitives/Primitive/Primitive.js.map +1 -1
  292. package/build/primitives/Primitive/Primitive.stories.js +7 -10
  293. package/build/primitives/Primitive/Primitive.stories.js.map +1 -1
  294. package/build/primitives/Primitive/helpers/getProps.js +8 -17
  295. package/build/primitives/Primitive/helpers/getProps.js.map +1 -1
  296. package/build/primitives/Primitive/helpers/getTag.js +4 -4
  297. package/build/primitives/Primitive/helpers/getTag.js.map +1 -1
  298. package/build/primitives/Primitive/helpers/index.js +2 -2
  299. package/build/primitives/Primitive/helpers/index.js.map +1 -1
  300. package/build/primitives/Primitive/index.js +1 -1
  301. package/build/primitives/Primitive/index.js.map +1 -1
  302. package/build/primitives/Radio/Radio.js +11 -15
  303. package/build/primitives/Radio/Radio.js.map +1 -1
  304. package/build/primitives/Radio/Radio.stories.js +8 -20
  305. package/build/primitives/Radio/Radio.stories.js.map +1 -1
  306. package/build/primitives/Radio/index.js +1 -1
  307. package/build/primitives/Radio/index.js.map +1 -1
  308. package/build/primitives/ScrollView/ScrollView.js +73 -96
  309. package/build/primitives/ScrollView/ScrollView.js.map +1 -1
  310. package/build/primitives/ScrollView/ScrollView.stories.js +12 -17
  311. package/build/primitives/ScrollView/ScrollView.stories.js.map +1 -1
  312. package/build/primitives/ScrollView/index.js +1 -1
  313. package/build/primitives/ScrollView/index.js.map +1 -1
  314. package/build/primitives/Select/Select.js +44 -54
  315. package/build/primitives/Select/Select.js.map +1 -1
  316. package/build/primitives/Select/Select.stories.js +14 -29
  317. package/build/primitives/Select/Select.stories.js.map +1 -1
  318. package/build/primitives/Select/index.js +1 -1
  319. package/build/primitives/Select/index.js.map +1 -1
  320. package/build/primitives/Switch/Switch.js +14 -16
  321. package/build/primitives/Switch/Switch.js.map +1 -1
  322. package/build/primitives/Switch/Switch.stories.js +8 -20
  323. package/build/primitives/Switch/Switch.stories.js.map +1 -1
  324. package/build/primitives/Switch/index.js +1 -1
  325. package/build/primitives/Switch/index.js.map +1 -1
  326. package/build/primitives/Text/Text.js +43 -55
  327. package/build/primitives/Text/Text.js.map +1 -1
  328. package/build/primitives/Text/Text.stories.js +8 -10
  329. package/build/primitives/Text/Text.stories.js.map +1 -1
  330. package/build/primitives/Text/helpers/color.js +13 -12
  331. package/build/primitives/Text/helpers/color.js.map +1 -1
  332. package/build/primitives/Text/helpers/index.js +2 -2
  333. package/build/primitives/Text/helpers/index.js.map +1 -1
  334. package/build/primitives/Text/helpers/parseMarkdown.js +41 -54
  335. package/build/primitives/Text/helpers/parseMarkdown.js.map +1 -1
  336. package/build/primitives/Text/index.js +1 -1
  337. package/build/primitives/Text/index.js.map +1 -1
  338. package/build/primitives/View/View.js +16 -25
  339. package/build/primitives/View/View.js.map +1 -1
  340. package/build/primitives/View/View.stories.js +7 -10
  341. package/build/primitives/View/View.stories.js.map +1 -1
  342. package/build/primitives/View/index.js +1 -1
  343. package/build/primitives/View/index.js.map +1 -1
  344. package/build/primitives/index.js +12 -12
  345. package/build/primitives/index.js.map +1 -1
  346. package/build/primitives/primitives.customElements.js.map +1 -1
  347. package/build/theme/default.theme.css +4 -4
  348. package/build/theme/helpers/camelcase.js +3 -5
  349. package/build/theme/helpers/camelcase.js.map +1 -1
  350. package/build/theme/helpers/index.js +2 -2
  351. package/build/theme/helpers/index.js.map +1 -1
  352. package/build/theme/helpers/palette.js +18 -32
  353. package/build/theme/helpers/palette.js.map +1 -1
  354. package/build/theme/index.js +2 -2
  355. package/build/theme/index.js.map +1 -1
  356. package/build/theme/theme.constants.js +16 -23
  357. package/build/theme/theme.constants.js.map +1 -1
  358. package/build/theme/theme.js +61 -81
  359. package/build/theme/theme.js.map +1 -1
  360. package/build/theme/theme.stories.js +25 -38
  361. package/build/theme/theme.stories.js.map +1 -1
  362. package/package.json +18 -15
@@ -1,37 +1,25 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.default = exports.Story = void 0;
8
7
  var _react = _interopRequireWildcard(require("react"));
9
8
  var _Input = require("./Input");
10
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(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
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
13
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
14
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
16
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
17
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
18
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
19
- var _default = {
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 && {}.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
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
12
+ var _default = exports.default = {
20
13
  title: 'Primitives'
21
14
  };
22
- exports.default = _default;
23
- var Story = function Story(props) {
24
- var _useState = (0, _react.useState)(),
25
- _useState2 = _slicedToArray(_useState, 2),
26
- value = _useState2[0],
27
- setValue = _useState2[1];
28
- var handleChange = function handleChange(next) {
29
- var _console;
15
+ const Story = props => {
16
+ const [value, setValue] = (0, _react.useState)();
17
+ const handleChange = function (next) {
30
18
  setValue(next);
31
19
  for (var _len = arguments.length, others = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
32
20
  others[_key - 1] = arguments[_key];
33
21
  }
34
- (_console = console).log.apply(_console, ['<Input>::onChange', next].concat(others));
22
+ console.log('<Input>::onChange', next, ...others);
35
23
  };
36
24
  return /*#__PURE__*/_react.default.createElement(_Input.Input, _extends({}, props, {
37
25
  value: value,
@@ -49,26 +37,23 @@ Story.args = {
49
37
  name: 'Input',
50
38
  placeholder: 'placeholder',
51
39
  type: 'text',
52
- onEnter: function onEnter() {
53
- var _console2;
40
+ onEnter: function () {
54
41
  for (var _len2 = arguments.length, props = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
55
42
  props[_key2] = arguments[_key2];
56
43
  }
57
- return (_console2 = console).log.apply(_console2, ['<Select>::onEnter'].concat(props));
44
+ return console.log('<Select>::onEnter', ...props);
58
45
  },
59
- onError: function onError() {
60
- var _console3;
46
+ onError: function () {
61
47
  for (var _len3 = arguments.length, props = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
62
48
  props[_key3] = arguments[_key3];
63
49
  }
64
- return (_console3 = console).log.apply(_console3, ['<Select>::onError'].concat(props));
50
+ return console.log('<Select>::onError', ...props);
65
51
  },
66
- onLeave: function onLeave() {
67
- var _console4;
52
+ onLeave: function () {
68
53
  for (var _len4 = arguments.length, props = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
69
54
  props[_key4] = arguments[_key4];
70
55
  }
71
- return (_console4 = console).log.apply(_console4, ['<Select>::onLeave'].concat(props));
56
+ return console.log('<Select>::onLeave', ...props);
72
57
  },
73
58
  // inherited properties
74
59
  testId: 'test-story',
@@ -1 +1 @@
1
- {"version":3,"file":"Input.stories.js","names":["title","Story","props","useState","value","setValue","handleChange","next","others","console","log","storyName","args","autoResize","disabled","max","min","multiLine","name","placeholder","type","onEnter","onError","onLeave","testId","style","argTypes","options","control","defaultValue"],"sources":["../../../src/primitives/Input/Input.stories.jsx"],"sourcesContent":["import React, { useState } from 'react';\n\nimport { Input } from './Input';\n\nexport default { title: 'Primitives' };\n\nexport const Story = (props) => {\n const [value, setValue] = useState();\n\n const handleChange = (next, ...others) => {\n setValue(next);\n console.log('<Input>::onChange', next, ...others);\n };\n\n return <Input {...props} value={value} onChange={handleChange} />;\n};\n\nStory.storyName = 'Input';\n\nStory.args = {\n autoResize: false,\n disabled: false,\n max: 100,\n min: 1,\n multiLine: false,\n name: 'Input',\n placeholder: 'placeholder',\n type: 'text',\n onEnter: (...props) => console.log('<Select>::onEnter', ...props),\n onError: (...props) => console.log('<Select>::onError', ...props),\n onLeave: (...props) => console.log('<Select>::onLeave', ...props),\n // inherited properties\n testId: 'test-story',\n style: {},\n};\n\nStory.argTypes = {\n type: {\n options: ['text', 'password', 'number', 'email', 'date'],\n control: { type: 'select' },\n defaultValue: 'text',\n },\n};\n"],"mappings":";;;;;;;AAAA;AAEA;AAAgC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAEjB;EAAEA,KAAK,EAAE;AAAa,CAAC;AAAA;AAE/B,IAAMC,KAAK,GAAG,SAARA,KAAK,CAAIC,KAAK,EAAK;EAC9B,gBAA0B,IAAAC,eAAQ,GAAE;IAAA;IAA7BC,KAAK;IAAEC,QAAQ;EAEtB,IAAMC,YAAY,GAAG,SAAfA,YAAY,CAAIC,IAAI,EAAgB;IAAA;IACxCF,QAAQ,CAACE,IAAI,CAAC;IAAC,kCADc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"version":3,"file":"Input.stories.js","names":["_react","_interopRequireWildcard","require","_Input","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","_default","exports","title","Story","props","value","setValue","useState","handleChange","next","_len","others","Array","_key","console","log","createElement","Input","onChange","storyName","args","autoResize","disabled","max","min","multiLine","name","placeholder","type","onEnter","_len2","_key2","onError","_len3","_key3","onLeave","_len4","_key4","testId","style","argTypes","options","control","defaultValue"],"sources":["../../../src/primitives/Input/Input.stories.jsx"],"sourcesContent":["import React, { useState } from 'react';\n\nimport { Input } from './Input';\n\nexport default { title: 'Primitives' };\n\nexport const Story = (props) => {\n const [value, setValue] = useState();\n\n const handleChange = (next, ...others) => {\n setValue(next);\n console.log('<Input>::onChange', next, ...others);\n };\n\n return <Input {...props} value={value} onChange={handleChange} />;\n};\n\nStory.storyName = 'Input';\n\nStory.args = {\n autoResize: false,\n disabled: false,\n max: 100,\n min: 1,\n multiLine: false,\n name: 'Input',\n placeholder: 'placeholder',\n type: 'text',\n onEnter: (...props) => console.log('<Select>::onEnter', ...props),\n onError: (...props) => console.log('<Select>::onError', ...props),\n onLeave: (...props) => console.log('<Select>::onLeave', ...props),\n // inherited properties\n testId: 'test-story',\n style: {},\n};\n\nStory.argTypes = {\n type: {\n options: ['text', 'password', 'number', 'email', 'date'],\n control: { type: 'select' },\n defaultValue: 'text',\n },\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAAgC,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,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.defineProperty(exports, key, {
11
11
  enumerable: true,
12
- get: function get() {
12
+ get: function () {
13
13
  return _parseValue[key];
14
14
  }
15
15
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../src/primitives/Input/helpers/index.js"],"sourcesContent":["export * from './parseValue';\n"],"mappings":";;;;;AAAA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
1
+ {"version":3,"file":"index.js","names":["_parseValue","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["../../../../src/primitives/Input/helpers/index.js"],"sourcesContent":["export * from './parseValue';\n"],"mappings":";;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,WAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,WAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,WAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -4,11 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.parseValue = void 0;
7
- var EMOJI_REGEX = /(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDFF\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFF]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])/g;
8
- var parseValue = function parseValue(value, type) {
9
- var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
10
- _ref$trimSpaces = _ref.trimSpaces,
11
- trimSpaces = _ref$trimSpaces === void 0 ? false : _ref$trimSpaces;
7
+ const EMOJI_REGEX = /[\p{Emoji_Presentation}\p{Extended_Pictographic}]/gu;
8
+ const parseValue = function (value, type) {
9
+ let {
10
+ trimSpaces = false
11
+ } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
12
12
  return value && value.toString().trim().length > 0 ? type !== 'number' ? (trimSpaces ? value.trim() : value).toString().replace(EMOJI_REGEX, '') : !isNaN(value) ? parseFloat(value, 10) : undefined : undefined;
13
13
  };
14
14
  exports.parseValue = parseValue;
@@ -1 +1 @@
1
- {"version":3,"file":"parseValue.js","names":["EMOJI_REGEX","parseValue","value","type","trimSpaces","toString","trim","length","replace","isNaN","parseFloat","undefined"],"sources":["../../../../src/primitives/Input/helpers/parseValue.js"],"sourcesContent":["const EMOJI_REGEX = /[\\p{Emoji_Presentation}\\p{Extended_Pictographic}]/gu;\n\nexport const parseValue = (value, type, { trimSpaces = false } = {}) =>\n value && value.toString().trim().length > 0\n ? type !== 'number'\n ? (trimSpaces ? value.trim() : value).toString().replace(EMOJI_REGEX, '')\n : !isNaN(value)\n ? parseFloat(value, 10)\n : undefined\n : undefined;\n"],"mappings":";;;;;;AAAA,IAAMA,WAAW,GAAG,myBAAqD;AAElE,IAAMC,UAAU,GAAG,SAAbA,UAAU,CAAIC,KAAK,EAAEC,IAAI;EAAA,+EAA2B,CAAC,CAAC;IAAA,uBAAzBC,UAAU;IAAVA,UAAU,gCAAG,KAAK;EAAA,OAC1DF,KAAK,IAAIA,KAAK,CAACG,QAAQ,EAAE,CAACC,IAAI,EAAE,CAACC,MAAM,GAAG,CAAC,GACvCJ,IAAI,KAAK,QAAQ,GACf,CAACC,UAAU,GAAGF,KAAK,CAACI,IAAI,EAAE,GAAGJ,KAAK,EAAEG,QAAQ,EAAE,CAACG,OAAO,CAACR,WAAW,EAAE,EAAE,CAAC,GACvE,CAACS,KAAK,CAACP,KAAK,CAAC,GACbQ,UAAU,CAACR,KAAK,EAAE,EAAE,CAAC,GACrBS,SAAS,GACXA,SAAS;AAAA;AAAC"}
1
+ {"version":3,"file":"parseValue.js","names":["EMOJI_REGEX","parseValue","value","type","trimSpaces","arguments","length","undefined","toString","trim","replace","isNaN","parseFloat","exports"],"sources":["../../../../src/primitives/Input/helpers/parseValue.js"],"sourcesContent":["const EMOJI_REGEX = /[\\p{Emoji_Presentation}\\p{Extended_Pictographic}]/gu;\n\nexport const parseValue = (value, type, { trimSpaces = false } = {}) =>\n value && value.toString().trim().length > 0\n ? type !== 'number'\n ? (trimSpaces ? value.trim() : value).toString().replace(EMOJI_REGEX, '')\n : !isNaN(value)\n ? parseFloat(value, 10)\n : undefined\n : undefined;\n"],"mappings":";;;;;;AAAA,MAAMA,WAAW,GAAG,qDAAqD;AAElE,MAAMC,UAAU,GAAG,SAAAA,CAACC,KAAK,EAAEC,IAAI;EAAA,IAAE;IAAEC,UAAU,GAAG;EAAM,CAAC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAAA,OACjEH,KAAK,IAAIA,KAAK,CAACM,QAAQ,CAAC,CAAC,CAACC,IAAI,CAAC,CAAC,CAACH,MAAM,GAAG,CAAC,GACvCH,IAAI,KAAK,QAAQ,GACf,CAACC,UAAU,GAAGF,KAAK,CAACO,IAAI,CAAC,CAAC,GAAGP,KAAK,EAAEM,QAAQ,CAAC,CAAC,CAACE,OAAO,CAACV,WAAW,EAAE,EAAE,CAAC,GACvE,CAACW,KAAK,CAACT,KAAK,CAAC,GACbU,UAAU,CAACV,KAAK,EAAE,EAAE,CAAC,GACrBK,SAAS,GACXA,SAAS;AAAA;AAACM,OAAA,CAAAZ,UAAA,GAAAA,UAAA","ignoreList":[]}
@@ -9,7 +9,7 @@ Object.keys(_Input).forEach(function (key) {
9
9
  if (key in exports && exports[key] === _Input[key]) return;
10
10
  Object.defineProperty(exports, key, {
11
11
  enumerable: true,
12
- get: function get() {
12
+ get: function () {
13
13
  return _Input[key];
14
14
  }
15
15
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/primitives/Input/index.js"],"sourcesContent":["export * from './Input';\n"],"mappings":";;;;;AAAA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
1
+ {"version":3,"file":"index.js","names":["_Input","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["../../../src/primitives/Input/index.js"],"sourcesContent":["export * from './Input';\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,MAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
@@ -13,123 +12,110 @@ var _Primitive = require("../Primitive");
13
12
  var _helpers2 = require("./helpers");
14
13
  var _LayerModule = _interopRequireDefault(require("./Layer.module.css"));
15
14
  var _LayerContent = require("./LayerContent");
16
- var _excluded = ["bottom", "centered", "fixed", "forceRender", "left", "right", "tag", "top", "timestamp", "visible", "onPosition"];
17
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
18
- 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; }
19
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
21
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
22
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
24
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
25
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
26
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
27
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
28
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
29
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
30
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
31
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
32
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
33
- var Layer = function Layer(_ref) {
34
- var forceBottom = _ref.bottom,
35
- centered = _ref.centered,
36
- propFixed = _ref.fixed,
37
- _ref$forceRender = _ref.forceRender,
38
- forceRender = _ref$forceRender === void 0 ? true : _ref$forceRender,
39
- forceLeft = _ref.left,
40
- forceRight = _ref.right,
41
- _ref$tag = _ref.tag,
42
- tag = _ref$tag === void 0 ? 'layer' : _ref$tag,
43
- forceTop = _ref.top,
44
- timestamp = _ref.timestamp,
45
- visible = _ref.visible,
46
- _ref$onPosition = _ref.onPosition,
47
- onPosition = _ref$onPosition === void 0 ? function () {} : _ref$onPosition,
48
- others = _objectWithoutProperties(_ref, _excluded);
49
- var device = (0, _hooks.useDevice)();
50
- var componentRef = (0, _react.useRef)();
51
- var contentRef = (0, _react.useRef)();
52
- var _useState = (0, _react.useState)(),
53
- _useState2 = _slicedToArray(_useState, 2),
54
- fixed = _useState2[0],
55
- setFixed = _useState2[1];
56
- var _useState3 = (0, _react.useState)(),
57
- _useState4 = _slicedToArray(_useState3, 2),
58
- position = _useState4[0],
59
- setPosition = _useState4[1];
60
- (0, _react.useLayoutEffect)(function () {
61
- var content = contentRef === null || contentRef === void 0 ? void 0 : contentRef.current;
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 && {}.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
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
+ const Layer = _ref => {
19
+ let {
20
+ bottom: forceBottom,
21
+ centered,
22
+ fixed: propFixed,
23
+ forceRender = true,
24
+ left: forceLeft,
25
+ right: forceRight,
26
+ tag = 'layer',
27
+ top: forceTop,
28
+ timestamp,
29
+ visible,
30
+ onPosition = () => {},
31
+ ...others
32
+ } = _ref;
33
+ const device = (0, _hooks.useDevice)();
34
+ const componentRef = (0, _react.useRef)();
35
+ const contentRef = (0, _react.useRef)();
36
+ const [fixed, setFixed] = (0, _react.useState)();
37
+ const [position, setPosition] = (0, _react.useState)();
38
+ (0, _react.useLayoutEffect)(() => {
39
+ const content = contentRef?.current;
62
40
  if (!content || typeof ResizeObserver === 'undefined') return;
63
- var observer = new ResizeObserver(calcPosition);
41
+ const observer = new ResizeObserver(calcPosition);
64
42
  observer.observe(content);
65
- return function () {
66
- return observer.unobserve(content);
67
- };
43
+ return () => observer.unobserve(content);
68
44
  // eslint-disable-next-line react-hooks/exhaustive-deps
69
45
  }, []);
70
- (0, _react.useLayoutEffect)(function () {
71
- return calcPosition();
72
- },
46
+ (0, _react.useLayoutEffect)(() => calcPosition(),
73
47
  // eslint-disable-next-line react-hooks/exhaustive-deps
74
48
  [centered, device, forceBottom, forceLeft, forceRight, forceTop, timestamp, visible]);
75
- var calcPosition = function calcPosition() {
76
- var _getScrollParent;
77
- var _componentRef$current = componentRef.current;
78
- _componentRef$current = _componentRef$current === void 0 ? {} : _componentRef$current;
79
- var componentEl = _componentRef$current.firstChild;
80
- var contentEl = contentRef.current;
49
+ const calcPosition = () => {
50
+ const {
51
+ current: {
52
+ firstChild: componentEl
53
+ } = {}
54
+ } = componentRef;
55
+ const {
56
+ current: contentEl
57
+ } = contentRef;
81
58
  if (!componentEl || !contentEl) return setPosition();
82
- var componentLayout = _objectSpread(_objectSpread({}, (0, _helpers2.getElementLayout)(componentEl)), {}, {
83
- scrollTop: (_getScrollParent = (0, _helpers2.getScrollParent)(componentEl)) === null || _getScrollParent === void 0 ? void 0 : _getScrollParent.scrollTop
59
+ const componentLayout = {
60
+ ...(0, _helpers2.getElementLayout)(componentEl),
61
+ scrollTop: (0, _helpers2.getScrollParent)(componentEl)?.scrollTop
62
+ };
63
+ const contentLayout = (0, _helpers2.getElementLayout)(contentEl);
64
+ const modal = (0, _helpers2.getModalParent)(componentEl);
65
+ const {
66
+ left = 0,
67
+ top = 0,
68
+ orientation = {}
69
+ } = (0, _helpers2.getLayerPosition)(componentLayout, contentLayout, device, modal, {
70
+ centered,
71
+ forceBottom,
72
+ forceLeft,
73
+ forceRight,
74
+ forceTop
84
75
  });
85
- var contentLayout = (0, _helpers2.getElementLayout)(contentEl);
86
- var modal = (0, _helpers2.getModalParent)(componentEl);
87
- var _getLayerPosition = (0, _helpers2.getLayerPosition)(componentLayout, contentLayout, device, modal, {
88
- centered: centered,
89
- forceBottom: forceBottom,
90
- forceLeft: forceLeft,
91
- forceRight: forceRight,
92
- forceTop: forceTop
93
- }),
94
- _getLayerPosition$lef = _getLayerPosition.left,
95
- left = _getLayerPosition$lef === void 0 ? 0 : _getLayerPosition$lef,
96
- _getLayerPosition$top = _getLayerPosition.top,
97
- top = _getLayerPosition$top === void 0 ? 0 : _getLayerPosition$top,
98
- _getLayerPosition$ori = _getLayerPosition.orientation,
99
- orientation = _getLayerPosition$ori === void 0 ? {} : _getLayerPosition$ori;
100
76
  setFixed(propFixed || (0, _helpers2.isComponentFixed)(componentEl));
101
77
  setPosition({
102
- left: "".concat(left, "px"),
103
- top: "".concat(top, "px")
78
+ left: `${left}px`,
79
+ top: `${top}px`
104
80
  });
105
81
  onPosition(orientation);
106
82
  };
107
- var children = _react.default.Children.map(others.children || [], function (child) {
108
- return child;
109
- });
110
- var className = others.className,
111
- contentStyle = others.style;
112
- var createWrapper = className || contentStyle;
83
+ const children = _react.default.Children.map(others.children || [], child => child);
84
+ const {
85
+ className,
86
+ style: contentStyle
87
+ } = others;
88
+ const createWrapper = className || contentStyle;
113
89
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Primitive.Primitive, {
114
90
  ref: componentRef,
115
91
  role: others.role,
116
92
  tag: tag,
117
93
  className: _LayerModule.default.container,
118
94
  testId: others.testId
119
- }, children.find(function (_ref2) {
120
- var name = _ref2.type.name;
95
+ }, children.find(_ref2 => {
96
+ let {
97
+ type: {
98
+ name
99
+ }
100
+ } = _ref2;
121
101
  return name !== _LayerContent.LayerContent.name;
122
102
  })), (forceRender || visible) && /*#__PURE__*/_react.default.createElement(_Primitive.Primitive, {
123
103
  ref: contentRef,
124
- role: others.role ? "".concat(others.role, "-content") : undefined,
125
- tag: "".concat(tag, "-content"),
104
+ role: others.role ? `${others.role}-content` : undefined,
105
+ tag: `${tag}-content`,
126
106
  className: (0, _helpers.styles)(_LayerModule.default.layer, fixed && _LayerModule.default.fixed, !visible && _LayerModule.default.hidden),
127
- style: _objectSpread({}, position)
107
+ style: {
108
+ ...position
109
+ }
128
110
  }, /*#__PURE__*/_react.default.createElement(createWrapper ? 'div' : _react.default.Fragment, createWrapper ? {
129
- className: className,
111
+ className,
130
112
  style: contentStyle
131
- } : undefined, children === null || children === void 0 ? void 0 : children.find(function (_ref3) {
132
- var name = _ref3.type.name;
113
+ } : undefined, children?.find(_ref3 => {
114
+ let {
115
+ type: {
116
+ name
117
+ }
118
+ } = _ref3;
133
119
  return name === _LayerContent.LayerContent.name;
134
120
  }))));
135
121
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Layer.js","names":["Layer","forceBottom","bottom","centered","propFixed","fixed","forceRender","forceLeft","left","forceRight","right","tag","forceTop","top","timestamp","visible","onPosition","others","device","useDevice","componentRef","useRef","contentRef","useState","setFixed","position","setPosition","useLayoutEffect","content","current","ResizeObserver","observer","calcPosition","observe","unobserve","componentEl","firstChild","contentEl","componentLayout","getElementLayout","scrollTop","getScrollParent","contentLayout","modal","getModalParent","getLayerPosition","orientation","isComponentFixed","children","React","Children","map","child","className","contentStyle","style","createWrapper","role","container","testId","find","name","type","LayerContent","undefined","styles","layer","hidden","createElement","Fragment","displayName","propTypes","PropTypes","bool","node","number","string","func"],"sources":["../../../src/primitives/Layer/Layer.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useLayoutEffect, useRef, useState } from 'react';\n\nimport { styles } from '../../helpers';\nimport { useDevice } from '../../hooks';\nimport { Primitive } from '../Primitive';\nimport { getElementLayout, getLayerPosition, getModalParent, getScrollParent, isComponentFixed } from './helpers';\nimport style from './Layer.module.css';\nimport { LayerContent } from './LayerContent';\n\nconst Layer = ({\n bottom: forceBottom,\n centered,\n fixed: propFixed,\n forceRender = true,\n left: forceLeft,\n right: forceRight,\n tag = 'layer',\n top: forceTop,\n timestamp,\n visible,\n onPosition = () => {},\n ...others\n}) => {\n const device = useDevice();\n const componentRef = useRef();\n const contentRef = useRef();\n\n const [fixed, setFixed] = useState();\n const [position, setPosition] = useState();\n\n useLayoutEffect(() => {\n const content = contentRef?.current;\n if (!content || typeof ResizeObserver === 'undefined') return;\n\n const observer = new ResizeObserver(calcPosition);\n observer.observe(content);\n\n return () => observer.unobserve(content);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useLayoutEffect(\n () => calcPosition(),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [centered, device, forceBottom, forceLeft, forceRight, forceTop, timestamp, visible],\n );\n\n const calcPosition = () => {\n const { current: { firstChild: componentEl } = {} } = componentRef;\n const { current: contentEl } = contentRef;\n\n if (!componentEl || !contentEl) return setPosition();\n\n const componentLayout = { ...getElementLayout(componentEl), scrollTop: getScrollParent(componentEl)?.scrollTop };\n const contentLayout = getElementLayout(contentEl);\n const modal = getModalParent(componentEl);\n const {\n left = 0,\n top = 0,\n orientation = {},\n } = getLayerPosition(componentLayout, contentLayout, device, modal, {\n centered,\n forceBottom,\n forceLeft,\n forceRight,\n forceTop,\n });\n\n setFixed(propFixed || isComponentFixed(componentEl));\n setPosition({ left: `${left}px`, top: `${top}px` });\n onPosition(orientation);\n };\n\n const children = React.Children.map(others.children || [], (child) => child);\n const { className, style: contentStyle } = others;\n const createWrapper = className || contentStyle;\n\n return (\n <>\n <Primitive ref={componentRef} role={others.role} tag={tag} className={style.container} testId={others.testId}>\n {children.find(({ type: { name } }) => name !== LayerContent.name)}\n </Primitive>\n\n {(forceRender || visible) && (\n <Primitive\n ref={contentRef}\n role={others.role ? `${others.role}-content` : undefined}\n tag={`${tag}-content`}\n className={styles(style.layer, fixed && style.fixed, !visible && style.hidden)}\n style={{ ...position }}\n >\n {React.createElement(\n createWrapper ? 'div' : React.Fragment,\n createWrapper ? { className, style: contentStyle } : undefined,\n children?.find(({ type: { name } }) => name === LayerContent.name),\n )}\n </Primitive>\n )}\n </>\n );\n};\n\nLayer.displayName = 'Primitive:Layer';\n\nLayer.propTypes = {\n bottom: PropTypes.bool,\n centered: PropTypes.bool,\n children: PropTypes.node,\n fixed: PropTypes.bool,\n forceRender: PropTypes.bool,\n left: PropTypes.bool,\n right: PropTypes.bool,\n timestamp: PropTypes.number,\n tag: PropTypes.string,\n top: PropTypes.bool,\n visible: PropTypes.bool,\n onPosition: PropTypes.func,\n};\n\nexport { Layer };\n"],"mappings":";;;;;;;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAA8C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAE9C,IAAMA,KAAK,GAAG,SAARA,KAAK,OAaL;EAAA,IAZIC,WAAW,QAAnBC,MAAM;IACNC,QAAQ,QAARA,QAAQ;IACDC,SAAS,QAAhBC,KAAK;IAAA,wBACLC,WAAW;IAAXA,WAAW,iCAAG,IAAI;IACZC,SAAS,QAAfC,IAAI;IACGC,UAAU,QAAjBC,KAAK;IAAA,gBACLC,GAAG;IAAHA,GAAG,yBAAG,OAAO;IACRC,QAAQ,QAAbC,GAAG;IACHC,SAAS,QAATA,SAAS;IACTC,OAAO,QAAPA,OAAO;IAAA,uBACPC,UAAU;IAAVA,UAAU,gCAAG,YAAM,CAAC,CAAC;IAClBC,MAAM;EAET,IAAMC,MAAM,GAAG,IAAAC,gBAAS,GAAE;EAC1B,IAAMC,YAAY,GAAG,IAAAC,aAAM,GAAE;EAC7B,IAAMC,UAAU,GAAG,IAAAD,aAAM,GAAE;EAE3B,gBAA0B,IAAAE,eAAQ,GAAE;IAAA;IAA7BlB,KAAK;IAAEmB,QAAQ;EACtB,iBAAgC,IAAAD,eAAQ,GAAE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AC"}
1
+ {"version":3,"file":"Layer.js","names":["_propTypes","_interopRequireDefault","require","_react","_interopRequireWildcard","_helpers","_hooks","_Primitive","_helpers2","_LayerModule","_LayerContent","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Layer","_ref","bottom","forceBottom","centered","fixed","propFixed","forceRender","left","forceLeft","right","forceRight","tag","top","forceTop","timestamp","visible","onPosition","others","device","useDevice","componentRef","useRef","contentRef","setFixed","useState","position","setPosition","useLayoutEffect","content","current","ResizeObserver","observer","calcPosition","observe","unobserve","firstChild","componentEl","contentEl","componentLayout","getElementLayout","scrollTop","getScrollParent","contentLayout","modal","getModalParent","orientation","getLayerPosition","isComponentFixed","children","React","Children","map","child","className","style","contentStyle","createWrapper","createElement","Fragment","Primitive","ref","role","container","testId","find","_ref2","type","name","LayerContent","undefined","styles","layer","hidden","_ref3","exports","displayName","propTypes","PropTypes","bool","node","number","string","func"],"sources":["../../../src/primitives/Layer/Layer.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useLayoutEffect, useRef, useState } from 'react';\n\nimport { styles } from '../../helpers';\nimport { useDevice } from '../../hooks';\nimport { Primitive } from '../Primitive';\nimport { getElementLayout, getLayerPosition, getModalParent, getScrollParent, isComponentFixed } from './helpers';\nimport style from './Layer.module.css';\nimport { LayerContent } from './LayerContent';\n\nconst Layer = ({\n bottom: forceBottom,\n centered,\n fixed: propFixed,\n forceRender = true,\n left: forceLeft,\n right: forceRight,\n tag = 'layer',\n top: forceTop,\n timestamp,\n visible,\n onPosition = () => {},\n ...others\n}) => {\n const device = useDevice();\n const componentRef = useRef();\n const contentRef = useRef();\n\n const [fixed, setFixed] = useState();\n const [position, setPosition] = useState();\n\n useLayoutEffect(() => {\n const content = contentRef?.current;\n if (!content || typeof ResizeObserver === 'undefined') return;\n\n const observer = new ResizeObserver(calcPosition);\n observer.observe(content);\n\n return () => observer.unobserve(content);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useLayoutEffect(\n () => calcPosition(),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [centered, device, forceBottom, forceLeft, forceRight, forceTop, timestamp, visible],\n );\n\n const calcPosition = () => {\n const { current: { firstChild: componentEl } = {} } = componentRef;\n const { current: contentEl } = contentRef;\n\n if (!componentEl || !contentEl) return setPosition();\n\n const componentLayout = { ...getElementLayout(componentEl), scrollTop: getScrollParent(componentEl)?.scrollTop };\n const contentLayout = getElementLayout(contentEl);\n const modal = getModalParent(componentEl);\n const {\n left = 0,\n top = 0,\n orientation = {},\n } = getLayerPosition(componentLayout, contentLayout, device, modal, {\n centered,\n forceBottom,\n forceLeft,\n forceRight,\n forceTop,\n });\n\n setFixed(propFixed || isComponentFixed(componentEl));\n setPosition({ left: `${left}px`, top: `${top}px` });\n onPosition(orientation);\n };\n\n const children = React.Children.map(others.children || [], (child) => child);\n const { className, style: contentStyle } = others;\n const createWrapper = className || contentStyle;\n\n return (\n <>\n <Primitive ref={componentRef} role={others.role} tag={tag} className={style.container} testId={others.testId}>\n {children.find(({ type: { name } }) => name !== LayerContent.name)}\n </Primitive>\n\n {(forceRender || visible) && (\n <Primitive\n ref={contentRef}\n role={others.role ? `${others.role}-content` : undefined}\n tag={`${tag}-content`}\n className={styles(style.layer, fixed && style.fixed, !visible && style.hidden)}\n style={{ ...position }}\n >\n {React.createElement(\n createWrapper ? 'div' : React.Fragment,\n createWrapper ? { className, style: contentStyle } : undefined,\n children?.find(({ type: { name } }) => name === LayerContent.name),\n )}\n </Primitive>\n )}\n </>\n );\n};\n\nLayer.displayName = 'Primitive:Layer';\n\nLayer.propTypes = {\n bottom: PropTypes.bool,\n centered: PropTypes.bool,\n children: PropTypes.node,\n fixed: PropTypes.bool,\n forceRender: PropTypes.bool,\n left: PropTypes.bool,\n right: PropTypes.bool,\n timestamp: PropTypes.number,\n tag: PropTypes.string,\n top: PropTypes.bool,\n visible: PropTypes.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,CAAE;IAC/ElB,KAAK,EAAE;MAAE,GAAG7B;IAAS;EAAE,gBAEtBwB,cAAK,CAACQ,aAAa,CAClBD,aAAa,GAAG,KAAK,GAAGP,cAAK,CAACS,QAAQ,EACtCF,aAAa,GAAG;IAAEH,SAAS;IAAEC,KAAK,EAAEC;EAAa,CAAC,GAAGc,SAAS,EAC9DrB,QAAQ,EAAEgB,IAAI,CAACS,KAAA;IAAA,IAAC;MAAEP,IAAI,EAAE;QAAEC;MAAK;IAAE,CAAC,GAAAM,KAAA;IAAA,OAAKN,IAAI,KAAKC,0BAAY,CAACD,IAAI;EAAA,EACnE,CACS,CAEb,CAAC;AAEP,CAAC;AAACO,OAAA,CAAA3E,KAAA,GAAAA,KAAA;AAEFA,KAAK,CAAC4E,WAAW,GAAG,iBAAiB;AAErC5E,KAAK,CAAC6E,SAAS,GAAG;EAChB3E,MAAM,EAAE4E,kBAAS,CAACC,IAAI;EACtB3E,QAAQ,EAAE0E,kBAAS,CAACC,IAAI;EACxB9B,QAAQ,EAAE6B,kBAAS,CAACE,IAAI;EACxB3E,KAAK,EAAEyE,kBAAS,CAACC,IAAI;EACrBxE,WAAW,EAAEuE,kBAAS,CAACC,IAAI;EAC3BvE,IAAI,EAAEsE,kBAAS,CAACC,IAAI;EACpBrE,KAAK,EAAEoE,kBAAS,CAACC,IAAI;EACrBhE,SAAS,EAAE+D,kBAAS,CAACG,MAAM;EAC3BrE,GAAG,EAAEkE,kBAAS,CAACI,MAAM;EACrBrE,GAAG,EAAEiE,kBAAS,CAACC,IAAI;EACnB/D,OAAO,EAAE8D,kBAAS,CAACC,IAAI;EACvB9D,UAAU,EAAE6D,kBAAS,CAACK;AACxB,CAAC","ignoreList":[]}
@@ -8,21 +8,18 @@ var _react = _interopRequireDefault(require("react"));
8
8
  var _ = require("../../");
9
9
  var _Layer = require("./Layer");
10
10
  var _LayerContent = require("./LayerContent");
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
13
- var _default = {
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
13
+ var _default = exports.default = {
14
14
  title: 'Primitives'
15
15
  };
16
- exports.default = _default;
17
- var Story = function Story(props) {
18
- return /*#__PURE__*/_react.default.createElement(_Layer.Layer, _extends({}, props, {
19
- className: "children"
20
- }), /*#__PURE__*/_react.default.createElement(_.Action, {
21
- style: {
22
- margin: '0 auto'
23
- }
24
- }, "Parent element"), /*#__PURE__*/_react.default.createElement(_LayerContent.LayerContent, null, /*#__PURE__*/_react.default.createElement("span", null, "Lorem ipsum, dolor sit amet consectetur adipisicing elit.")));
25
- };
16
+ const Story = props => /*#__PURE__*/_react.default.createElement(_Layer.Layer, _extends({}, props, {
17
+ className: "children"
18
+ }), /*#__PURE__*/_react.default.createElement(_.Action, {
19
+ style: {
20
+ margin: '0 auto'
21
+ }
22
+ }, "Parent element"), /*#__PURE__*/_react.default.createElement(_LayerContent.LayerContent, null, /*#__PURE__*/_react.default.createElement("span", null, "Lorem ipsum, dolor sit amet consectetur adipisicing elit.")));
26
23
  exports.Story = Story;
27
24
  Story.storyName = 'Layer';
28
25
  Story.args = {
@@ -1 +1 @@
1
- {"version":3,"file":"Layer.stories.js","names":["title","Story","props","margin","storyName","args","bottom","centered","fixed","forceRender","left","right","top","visible","testId","style"],"sources":["../../../src/primitives/Layer/Layer.stories.jsx"],"sourcesContent":["import React from 'react';\n\nimport { Action } from '../../';\nimport { Layer } from './Layer';\nimport { LayerContent } from './LayerContent';\n\nexport default { title: 'Primitives' };\n\nexport const Story = (props) => (\n <Layer {...props} className=\"children\">\n <Action style={{ margin: '0 auto' }}>Parent element</Action>\n\n <LayerContent>\n <span>Lorem ipsum, dolor sit amet consectetur adipisicing elit.</span>\n </LayerContent>\n </Layer>\n);\n\nStory.storyName = 'Layer';\n\nStory.args = {\n bottom: false,\n centered: false,\n fixed: false,\n forceRender: true,\n left: false,\n right: false,\n top: false,\n visible: true,\n // inherited properties\n testId: 'test-story',\n style: {},\n};\n"],"mappings":";;;;;;AAAA;AAEA;AACA;AACA;AAA8C;AAAA;AAAA,eAE/B;EAAEA,KAAK,EAAE;AAAa,CAAC;AAAA;AAE/B,IAAMC,KAAK,GAAG,SAARA,KAAK,CAAIC,KAAK;EAAA,oBACzB,6BAAC,YAAK,eAAKA,KAAK;IAAE,SAAS,EAAC;EAAU,iBACpC,6BAAC,QAAM;IAAC,KAAK,EAAE;MAAEC,MAAM,EAAE;IAAS;EAAE,oBAAwB,eAE5D,6BAAC,0BAAY,qBACX,uGAAsE,CACzD,CACT;AAAA,CACT;AAAC;AAEFF,KAAK,CAACG,SAAS,GAAG,OAAO;AAEzBH,KAAK,CAACI,IAAI,GAAG;EACXC,MAAM,EAAE,KAAK;EACbC,QAAQ,EAAE,KAAK;EACfC,KAAK,EAAE,KAAK;EACZC,WAAW,EAAE,IAAI;EACjBC,IAAI,EAAE,KAAK;EACXC,KAAK,EAAE,KAAK;EACZC,GAAG,EAAE,KAAK;EACVC,OAAO,EAAE,IAAI;EACb;EACAC,MAAM,EAAE,YAAY;EACpBC,KAAK,EAAE,CAAC;AACV,CAAC"}
1
+ {"version":3,"file":"Layer.stories.js","names":["_react","_interopRequireDefault","require","_","_Layer","_LayerContent","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","_default","exports","title","Story","props","createElement","Layer","className","Action","style","margin","LayerContent","storyName","args","bottom","centered","fixed","forceRender","left","right","top","visible","testId"],"sources":["../../../src/primitives/Layer/Layer.stories.jsx"],"sourcesContent":["import React from 'react';\n\nimport { Action } from '../../';\nimport { Layer } from './Layer';\nimport { LayerContent } from './LayerContent';\n\nexport default { title: 'Primitives' };\n\nexport const Story = (props) => (\n <Layer {...props} className=\"children\">\n <Action style={{ margin: '0 auto' }}>Parent element</Action>\n\n <LayerContent>\n <span>Lorem ipsum, dolor sit amet consectetur adipisicing elit.</span>\n </LayerContent>\n </Layer>\n);\n\nStory.storyName = 'Layer';\n\nStory.args = {\n bottom: false,\n centered: false,\n fixed: false,\n forceRender: true,\n left: false,\n right: false,\n top: false,\n visible: true,\n // inherited properties\n testId: 'test-story',\n style: {},\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,CAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AAA8C,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,SAAA,WAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,CAAA,aAAAP,CAAA,MAAAA,CAAA,GAAAQ,SAAA,CAAAC,MAAA,EAAAT,CAAA,UAAAU,CAAA,GAAAF,SAAA,CAAAR,CAAA,YAAAW,CAAA,IAAAD,CAAA,OAAAE,cAAA,CAAAC,IAAA,CAAAH,CAAA,EAAAC,CAAA,MAAAJ,CAAA,CAAAI,CAAA,IAAAD,CAAA,CAAAC,CAAA,aAAAJ,CAAA,KAAAJ,QAAA,CAAAW,KAAA,OAAAN,SAAA;AAAA,IAAAO,QAAA,GAAAC,OAAA,CAAAd,OAAA,GAE/B;EAAEe,KAAK,EAAE;AAAa,CAAC;AAE/B,MAAMC,KAAK,GAAIC,KAAK,iBACzBzB,MAAA,CAAAQ,OAAA,CAAAkB,aAAA,CAACtB,MAAA,CAAAuB,KAAK,EAAAlB,QAAA,KAAKgB,KAAK;EAAEG,SAAS,EAAC;AAAU,iBACpC5B,MAAA,CAAAQ,OAAA,CAAAkB,aAAA,CAACvB,CAAA,CAAA0B,MAAM;EAACC,KAAK,EAAE;IAAEC,MAAM,EAAE;EAAS;AAAE,GAAC,gBAAsB,CAAC,eAE5D/B,MAAA,CAAAQ,OAAA,CAAAkB,aAAA,CAACrB,aAAA,CAAA2B,YAAY,qBACXhC,MAAA,CAAAQ,OAAA,CAAAkB,aAAA,eAAM,2DAA+D,CACzD,CACT,CACR;AAACJ,OAAA,CAAAE,KAAA,GAAAA,KAAA;AAEFA,KAAK,CAACS,SAAS,GAAG,OAAO;AAEzBT,KAAK,CAACU,IAAI,GAAG;EACXC,MAAM,EAAE,KAAK;EACbC,QAAQ,EAAE,KAAK;EACfC,KAAK,EAAE,KAAK;EACZC,WAAW,EAAE,IAAI;EACjBC,IAAI,EAAE,KAAK;EACXC,KAAK,EAAE,KAAK;EACZC,GAAG,EAAE,KAAK;EACVC,OAAO,EAAE,IAAI;EACb;EACAC,MAAM,EAAE,YAAY;EACpBb,KAAK,EAAE,CAAC;AACV,CAAC","ignoreList":[]}
@@ -5,9 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.LayerContent = void 0;
7
7
  var _propTypes = _interopRequireDefault(require("prop-types"));
8
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
- var LayerContent = function LayerContent(_ref) {
10
- var children = _ref.children;
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ const LayerContent = _ref => {
10
+ let {
11
+ children
12
+ } = _ref;
11
13
  return children;
12
14
  };
13
15
  exports.LayerContent = LayerContent;
@@ -1 +1 @@
1
- {"version":3,"file":"LayerContent.js","names":["LayerContent","children","displayName","propTypes","PropTypes","node"],"sources":["../../../src/primitives/Layer/LayerContent.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\n\nconst LayerContent = ({ children }) => children;\n\nLayerContent.displayName = 'Primitive:Layer:Content';\n\nLayerContent.propTypes = {\n children: PropTypes.node,\n};\n\nexport { LayerContent };\n"],"mappings":";;;;;;AAAA;AAAmC;AAEnC,IAAMA,YAAY,GAAG,SAAfA,YAAY;EAAA,IAAMC,QAAQ,QAARA,QAAQ;EAAA,OAAOA,QAAQ;AAAA;AAAC;AAEhDD,YAAY,CAACE,WAAW,GAAG,yBAAyB;AAEpDF,YAAY,CAACG,SAAS,GAAG;EACvBF,QAAQ,EAAEG,kBAAS,CAACC;AACtB,CAAC"}
1
+ {"version":3,"file":"LayerContent.js","names":["_propTypes","_interopRequireDefault","require","e","__esModule","default","LayerContent","_ref","children","exports","displayName","propTypes","PropTypes","node"],"sources":["../../../src/primitives/Layer/LayerContent.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\n\nconst LayerContent = ({ children }) => children;\n\nLayerContent.displayName = 'Primitive:Layer:Content';\n\nLayerContent.propTypes = {\n children: PropTypes.node,\n};\n\nexport { LayerContent };\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAmC,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEnC,MAAMG,YAAY,GAAGC,IAAA;EAAA,IAAC;IAAEC;EAAS,CAAC,GAAAD,IAAA;EAAA,OAAKC,QAAQ;AAAA;AAACC,OAAA,CAAAH,YAAA,GAAAA,YAAA;AAEhDA,YAAY,CAACI,WAAW,GAAG,yBAAyB;AAEpDJ,YAAY,CAACK,SAAS,GAAG;EACvBH,QAAQ,EAAEI,kBAAS,CAACC;AACtB,CAAC","ignoreList":[]}
@@ -4,22 +4,25 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getElementLayout = void 0;
7
- var getElementLayout = function getElementLayout() {
8
- var element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
9
- var left = element.offsetLeft,
10
- top = element.offsetTop,
11
- height = element.offsetHeight,
12
- width = element.offsetWidth;
13
- var _ref = element.getBoundingClientRect && element.getBoundingClientRect() || {},
14
- screenLeft = _ref.left,
15
- screenTop = _ref.top;
7
+ const getElementLayout = function () {
8
+ let element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
9
+ const {
10
+ offsetLeft: left,
11
+ offsetTop: top,
12
+ offsetHeight: height,
13
+ offsetWidth: width
14
+ } = element;
15
+ const {
16
+ left: screenLeft,
17
+ top: screenTop
18
+ } = element.getBoundingClientRect && element.getBoundingClientRect() || {};
16
19
  return {
17
- left: left,
18
- top: top,
19
- height: height,
20
- width: width,
21
- screenLeft: screenLeft,
22
- screenTop: screenTop
20
+ left,
21
+ top,
22
+ height,
23
+ width,
24
+ screenLeft,
25
+ screenTop
23
26
  };
24
27
  };
25
28
  exports.getElementLayout = getElementLayout;
@@ -1 +1 @@
1
- {"version":3,"file":"getElementLayout.js","names":["getElementLayout","element","left","offsetLeft","top","offsetTop","height","offsetHeight","width","offsetWidth","getBoundingClientRect","screenLeft","screenTop"],"sources":["../../../../src/primitives/Layer/helpers/getElementLayout.js"],"sourcesContent":["export const getElementLayout = (element = {}) => {\n const { offsetLeft: left, offsetTop: top, offsetHeight: height, offsetWidth: width } = element;\n const { left: screenLeft, top: screenTop } = (element.getBoundingClientRect && element.getBoundingClientRect()) || {};\n\n return { left, top, height, width, screenLeft, screenTop };\n};\n"],"mappings":";;;;;;AAAO,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAgB,GAAqB;EAAA,IAAjBC,OAAO,uEAAG,CAAC,CAAC;EAC3C,IAAoBC,IAAI,GAA+DD,OAAO,CAAtFE,UAAU;IAAmBC,GAAG,GAA+CH,OAAO,CAApEI,SAAS;IAAqBC,MAAM,GAAyBL,OAAO,CAApDM,YAAY;IAAuBC,KAAK,GAAKP,OAAO,CAA9BQ,WAAW;EAC3E,WAA8CR,OAAO,CAACS,qBAAqB,IAAIT,OAAO,CAACS,qBAAqB,EAAE,IAAK,CAAC,CAAC;IAAvGC,UAAU,QAAhBT,IAAI;IAAmBU,SAAS,QAAdR,GAAG;EAE7B,OAAO;IAAEF,IAAI,EAAJA,IAAI;IAAEE,GAAG,EAAHA,GAAG;IAAEE,MAAM,EAANA,MAAM;IAAEE,KAAK,EAALA,KAAK;IAAEG,UAAU,EAAVA,UAAU;IAAEC,SAAS,EAATA;EAAU,CAAC;AAC5D,CAAC;AAAC"}
1
+ {"version":3,"file":"getElementLayout.js","names":["getElementLayout","element","arguments","length","undefined","offsetLeft","left","offsetTop","top","offsetHeight","height","offsetWidth","width","screenLeft","screenTop","getBoundingClientRect","exports"],"sources":["../../../../src/primitives/Layer/helpers/getElementLayout.js"],"sourcesContent":["export const getElementLayout = (element = {}) => {\n const { offsetLeft: left, offsetTop: top, offsetHeight: height, offsetWidth: width } = element;\n const { left: screenLeft, top: screenTop } = (element.getBoundingClientRect && element.getBoundingClientRect()) || {};\n\n return { left, top, height, width, screenLeft, screenTop };\n};\n"],"mappings":";;;;;;AAAO,MAAMA,gBAAgB,GAAG,SAAAA,CAAA,EAAkB;EAAA,IAAjBC,OAAO,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAC3C,MAAM;IAAEG,UAAU,EAAEC,IAAI;IAAEC,SAAS,EAAEC,GAAG;IAAEC,YAAY,EAAEC,MAAM;IAAEC,WAAW,EAAEC;EAAM,CAAC,GAAGX,OAAO;EAC9F,MAAM;IAAEK,IAAI,EAAEO,UAAU;IAAEL,GAAG,EAAEM;EAAU,CAAC,GAAIb,OAAO,CAACc,qBAAqB,IAAId,OAAO,CAACc,qBAAqB,CAAC,CAAC,IAAK,CAAC,CAAC;EAErH,OAAO;IAAET,IAAI;IAAEE,GAAG;IAAEE,MAAM;IAAEE,KAAK;IAAEC,UAAU;IAAEC;EAAU,CAAC;AAC5D,CAAC;AAACE,OAAA,CAAAhB,gBAAA,GAAAA,gBAAA","ignoreList":[]}