@tecsinapse/react-native-kit 1.18.6 → 1.21.0

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 (225) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/components/atoms/Avatar/Avatar.js +4 -2
  3. package/dist/components/atoms/Avatar/Avatar.js.map +1 -1
  4. package/dist/components/atoms/Avatar/index.js +9 -4
  5. package/dist/components/atoms/Avatar/index.js.map +1 -1
  6. package/dist/components/atoms/Badge/Badge.js +11 -8
  7. package/dist/components/atoms/Badge/Badge.js.map +1 -1
  8. package/dist/components/atoms/Badge/index.js +15 -5
  9. package/dist/components/atoms/Badge/index.js.map +1 -1
  10. package/dist/components/atoms/BottomNavigator/BottomNavigator.js +13 -10
  11. package/dist/components/atoms/BottomNavigator/BottomNavigator.js.map +1 -1
  12. package/dist/components/atoms/BottomNavigator/Item.js +11 -8
  13. package/dist/components/atoms/BottomNavigator/Item.js.map +1 -1
  14. package/dist/components/atoms/BottomNavigator/index.js +21 -7
  15. package/dist/components/atoms/BottomNavigator/index.js.map +1 -1
  16. package/dist/components/atoms/BottomNavigator/styled.js +64 -45
  17. package/dist/components/atoms/BottomNavigator/styled.js.map +1 -1
  18. package/dist/components/atoms/Button/Button.d.ts +2 -2
  19. package/dist/components/atoms/Button/Button.js +11 -8
  20. package/dist/components/atoms/Button/Button.js.map +1 -1
  21. package/dist/components/atoms/Button/States/Error.js +4 -2
  22. package/dist/components/atoms/Button/States/Error.js.map +1 -1
  23. package/dist/components/atoms/Button/States/Loading.js +4 -2
  24. package/dist/components/atoms/Button/States/Loading.js.map +1 -1
  25. package/dist/components/atoms/Button/States/Success.js +4 -2
  26. package/dist/components/atoms/Button/States/Success.js.map +1 -1
  27. package/dist/components/atoms/Button/States/index.js +21 -8
  28. package/dist/components/atoms/Button/States/index.js.map +1 -1
  29. package/dist/components/atoms/Button/index.js +33 -9
  30. package/dist/components/atoms/Button/index.js.map +1 -1
  31. package/dist/components/atoms/GroupButton/GroupButtonOption.js +4 -2
  32. package/dist/components/atoms/GroupButton/GroupButtonOption.js.map +1 -1
  33. package/dist/components/atoms/GroupButton/index.js +9 -4
  34. package/dist/components/atoms/GroupButton/index.js.map +1 -1
  35. package/dist/components/atoms/Header/Header.js +19 -16
  36. package/dist/components/atoms/Header/Header.js.map +1 -1
  37. package/dist/components/atoms/Header/index.js +15 -5
  38. package/dist/components/atoms/Header/index.js.map +1 -1
  39. package/dist/components/atoms/Header/styled.js +17 -17
  40. package/dist/components/atoms/Header/styled.js.map +1 -1
  41. package/dist/components/atoms/Input/Input.d.ts +3 -2
  42. package/dist/components/atoms/Input/Input.js +31 -28
  43. package/dist/components/atoms/Input/Input.js.map +1 -1
  44. package/dist/components/atoms/Input/index.js +15 -5
  45. package/dist/components/atoms/Input/index.js.map +1 -1
  46. package/dist/components/atoms/Input/styled.js +13 -8
  47. package/dist/components/atoms/Input/styled.js.map +1 -1
  48. package/dist/components/atoms/InputMask/InputMask.js +32 -28
  49. package/dist/components/atoms/InputMask/InputMask.js.map +1 -1
  50. package/dist/components/atoms/InputMask/index.js +15 -5
  51. package/dist/components/atoms/InputMask/index.js.map +1 -1
  52. package/dist/components/atoms/InputMask/styled.js +14 -11
  53. package/dist/components/atoms/InputMask/styled.js.map +1 -1
  54. package/dist/components/atoms/Modal/ModalGroupManager.js +10 -7
  55. package/dist/components/atoms/Modal/ModalGroupManager.js.map +1 -1
  56. package/dist/components/atoms/Modal/ModalLifecycleHandler.d.ts +2 -2
  57. package/dist/components/atoms/Modal/ModalLifecycleHandler.js +31 -25
  58. package/dist/components/atoms/Modal/ModalLifecycleHandler.js.map +1 -1
  59. package/dist/components/atoms/Modal/index.js +45 -8
  60. package/dist/components/atoms/Modal/index.js.map +1 -1
  61. package/dist/components/atoms/Modal/ui/BaseModalView.d.ts +2 -2
  62. package/dist/components/atoms/Modal/ui/BaseModalView.js +19 -16
  63. package/dist/components/atoms/Modal/ui/BaseModalView.js.map +1 -1
  64. package/dist/components/atoms/Modal/ui/styled.js +19 -21
  65. package/dist/components/atoms/Modal/ui/styled.js.map +1 -1
  66. package/dist/components/atoms/Modal/ui/types.d.ts +1 -1
  67. package/dist/components/atoms/Modal/ui/types.js +3 -1
  68. package/dist/components/atoms/Modal/ui/types.js.map +1 -1
  69. package/dist/components/atoms/Modal/useLazyModalManager.d.ts +2 -2
  70. package/dist/components/atoms/Modal/useLazyModalManager.js +4 -2
  71. package/dist/components/atoms/Modal/useLazyModalManager.js.map +1 -1
  72. package/dist/components/atoms/Modal/useModalManager.d.ts +2 -2
  73. package/dist/components/atoms/Modal/useModalManager.js +4 -2
  74. package/dist/components/atoms/Modal/useModalManager.js.map +1 -1
  75. package/dist/components/atoms/Modal/useModalRemoteControl.js +3 -1
  76. package/dist/components/atoms/Modal/useModalRemoteControl.js.map +1 -1
  77. package/dist/components/atoms/Skeleton/Pulse.js +16 -11
  78. package/dist/components/atoms/Skeleton/Pulse.js.map +1 -1
  79. package/dist/components/atoms/Skeleton/Skeleton.js +14 -11
  80. package/dist/components/atoms/Skeleton/Skeleton.js.map +1 -1
  81. package/dist/components/atoms/Skeleton/Wave.js +17 -12
  82. package/dist/components/atoms/Skeleton/Wave.js.map +1 -1
  83. package/dist/components/atoms/Skeleton/animation.js +4 -2
  84. package/dist/components/atoms/Skeleton/animation.js.map +1 -1
  85. package/dist/components/atoms/Skeleton/index.js +15 -5
  86. package/dist/components/atoms/Skeleton/index.js.map +1 -1
  87. package/dist/components/atoms/Skeleton/styled.js +25 -15
  88. package/dist/components/atoms/Skeleton/styled.js.map +1 -1
  89. package/dist/components/atoms/Skeleton/types.js +3 -1
  90. package/dist/components/atoms/Skeleton/types.js.map +1 -1
  91. package/dist/components/atoms/SnappingSlider/SnappingSlider.js +12 -9
  92. package/dist/components/atoms/SnappingSlider/SnappingSlider.js.map +1 -1
  93. package/dist/components/atoms/SnappingSlider/index.js +15 -5
  94. package/dist/components/atoms/SnappingSlider/index.js.map +1 -1
  95. package/dist/components/atoms/Tag/Tag.js +9 -6
  96. package/dist/components/atoms/Tag/Tag.js.map +1 -1
  97. package/dist/components/atoms/Tag/index.js +15 -5
  98. package/dist/components/atoms/Tag/index.js.map +1 -1
  99. package/dist/components/atoms/Text/Text.js +8 -5
  100. package/dist/components/atoms/Text/Text.js.map +1 -1
  101. package/dist/components/atoms/Text/index.js +15 -5
  102. package/dist/components/atoms/Text/index.js.map +1 -1
  103. package/dist/components/atoms/Text/styled.js +17 -13
  104. package/dist/components/atoms/Text/styled.js.map +1 -1
  105. package/dist/components/atoms/TextArea/TextArea.js +31 -28
  106. package/dist/components/atoms/TextArea/TextArea.js.map +1 -1
  107. package/dist/components/atoms/TextArea/index.js +15 -5
  108. package/dist/components/atoms/TextArea/index.js.map +1 -1
  109. package/dist/components/atoms/TextArea/styled.js +3 -1
  110. package/dist/components/atoms/TextArea/styled.js.map +1 -1
  111. package/dist/components/molecules/Calendar/Calendar.js +10 -7
  112. package/dist/components/molecules/Calendar/Calendar.js.map +1 -1
  113. package/dist/components/molecules/Calendar/index.js +9 -4
  114. package/dist/components/molecules/Calendar/index.js.map +1 -1
  115. package/dist/components/molecules/DatePicker/DatePicker.js +17 -13
  116. package/dist/components/molecules/DatePicker/DatePicker.js.map +1 -1
  117. package/dist/components/molecules/DatePicker/index.js +15 -5
  118. package/dist/components/molecules/DatePicker/index.js.map +1 -1
  119. package/dist/components/molecules/DatePicker/styled.js +13 -6
  120. package/dist/components/molecules/DatePicker/styled.js.map +1 -1
  121. package/dist/components/molecules/DateTimePicker/DateTimePicker.js +15 -11
  122. package/dist/components/molecules/DateTimePicker/DateTimePicker.js.map +1 -1
  123. package/dist/components/molecules/DateTimePicker/index.js +15 -5
  124. package/dist/components/molecules/DateTimePicker/index.js.map +1 -1
  125. package/dist/components/molecules/DateTimeSelector/DateTimeSelector.js +10 -7
  126. package/dist/components/molecules/DateTimeSelector/DateTimeSelector.js.map +1 -1
  127. package/dist/components/molecules/DateTimeSelector/index.js +9 -4
  128. package/dist/components/molecules/DateTimeSelector/index.js.map +1 -1
  129. package/dist/components/molecules/Grid/Grid.d.ts +5 -0
  130. package/dist/components/molecules/Grid/Grid.js +63 -0
  131. package/dist/components/molecules/Grid/Grid.js.map +1 -0
  132. package/dist/components/molecules/Grid/Item/Item.d.ts +7 -0
  133. package/dist/components/molecules/Grid/Item/Item.js +81 -0
  134. package/dist/components/molecules/Grid/Item/Item.js.map +1 -0
  135. package/dist/components/molecules/Grid/Item/index.d.ts +1 -0
  136. package/dist/components/molecules/Grid/Item/index.js +24 -0
  137. package/dist/components/molecules/Grid/Item/index.js.map +1 -0
  138. package/dist/components/molecules/Grid/index.d.ts +2 -0
  139. package/dist/components/molecules/Grid/index.js +24 -0
  140. package/dist/components/molecules/Grid/index.js.map +1 -0
  141. package/dist/components/molecules/IconTextButton/IconTextButton.d.ts +6 -0
  142. package/dist/components/molecules/IconTextButton/IconTextButton.js +53 -0
  143. package/dist/components/molecules/IconTextButton/IconTextButton.js.map +1 -0
  144. package/dist/components/molecules/IconTextButton/TextComponent.d.ts +12 -0
  145. package/dist/components/molecules/IconTextButton/TextComponent.js +39 -0
  146. package/dist/components/molecules/IconTextButton/TextComponent.js.map +1 -0
  147. package/dist/components/molecules/IconTextButton/index.d.ts +1 -0
  148. package/dist/components/molecules/IconTextButton/index.js +24 -0
  149. package/dist/components/molecules/IconTextButton/index.js.map +1 -0
  150. package/dist/components/molecules/IconTextButton/styled.d.ts +2 -0
  151. package/dist/components/molecules/IconTextButton/styled.js +48 -0
  152. package/dist/components/molecules/IconTextButton/styled.js.map +1 -0
  153. package/dist/components/molecules/InputPassword/InputPassword.d.ts +3 -2
  154. package/dist/components/molecules/InputPassword/InputPassword.js +9 -6
  155. package/dist/components/molecules/InputPassword/InputPassword.js.map +1 -1
  156. package/dist/components/molecules/InputPassword/index.js +15 -5
  157. package/dist/components/molecules/InputPassword/index.js.map +1 -1
  158. package/dist/components/molecules/LabeledSwitch/LabelComponent.d.ts +13 -0
  159. package/dist/components/molecules/LabeledSwitch/LabelComponent.js +41 -0
  160. package/dist/components/molecules/LabeledSwitch/LabelComponent.js.map +1 -0
  161. package/dist/components/molecules/LabeledSwitch/LabeledSwitch.d.ts +8 -0
  162. package/dist/components/molecules/LabeledSwitch/LabeledSwitch.js +56 -0
  163. package/dist/components/molecules/LabeledSwitch/LabeledSwitch.js.map +1 -0
  164. package/dist/components/molecules/LabeledSwitch/index.d.ts +1 -0
  165. package/dist/components/molecules/LabeledSwitch/index.js +24 -0
  166. package/dist/components/molecules/LabeledSwitch/index.js.map +1 -0
  167. package/dist/components/molecules/LabeledSwitch/styled.d.ts +9 -0
  168. package/dist/components/molecules/LabeledSwitch/styled.js +32 -0
  169. package/dist/components/molecules/LabeledSwitch/styled.js.map +1 -0
  170. package/dist/components/molecules/Select/Modal.d.ts +1 -1
  171. package/dist/components/molecules/Select/Modal.js +45 -39
  172. package/dist/components/molecules/Select/Modal.js.map +1 -1
  173. package/dist/components/molecules/Select/Select.js +39 -36
  174. package/dist/components/molecules/Select/Select.js.map +1 -1
  175. package/dist/components/molecules/Select/index.js +15 -5
  176. package/dist/components/molecules/Select/index.js.map +1 -1
  177. package/dist/components/molecules/Select/styled.js +78 -85
  178. package/dist/components/molecules/Select/styled.js.map +1 -1
  179. package/dist/components/molecules/Snackbar/Snackbar.js +14 -11
  180. package/dist/components/molecules/Snackbar/Snackbar.js.map +1 -1
  181. package/dist/components/molecules/Snackbar/index.js +15 -5
  182. package/dist/components/molecules/Snackbar/index.js.map +1 -1
  183. package/dist/components/molecules/Snackbar/styled.js +18 -9
  184. package/dist/components/molecules/Snackbar/styled.js.map +1 -1
  185. package/dist/index.d.ts +17 -14
  186. package/dist/index.js +379 -116
  187. package/dist/index.js.map +1 -1
  188. package/dist/utils/date.js +3 -1
  189. package/dist/utils/date.js.map +1 -1
  190. package/package.json +5 -5
  191. package/src/components/atoms/BottomNavigator/BottomNavigator.tsx +3 -6
  192. package/src/components/atoms/Button/Button.tsx +19 -13
  193. package/src/components/atoms/Button/index.ts +1 -1
  194. package/src/components/atoms/Input/Input.tsx +8 -6
  195. package/src/components/atoms/Input/styled.ts +1 -3
  196. package/src/components/atoms/Modal/ModalGroupManager.tsx +22 -17
  197. package/src/components/atoms/Modal/ModalLifecycleHandler.ts +139 -126
  198. package/src/components/atoms/Modal/index.ts +7 -7
  199. package/src/components/atoms/Modal/ui/BaseModalView.tsx +150 -127
  200. package/src/components/atoms/Modal/ui/styled.ts +17 -17
  201. package/src/components/atoms/Modal/ui/types.ts +9 -8
  202. package/src/components/atoms/Modal/useLazyModalManager.ts +32 -31
  203. package/src/components/atoms/Modal/useModalManager.ts +28 -26
  204. package/src/components/atoms/Modal/useModalRemoteControl.ts +16 -18
  205. package/src/components/molecules/Calendar/Calendar.tsx +5 -1
  206. package/src/components/molecules/DatePicker/DatePicker.tsx +26 -17
  207. package/src/components/molecules/DatePicker/styled.ts +4 -4
  208. package/src/components/molecules/DateTimePicker/DateTimePicker.tsx +18 -16
  209. package/src/components/molecules/DateTimeSelector/DateTimeSelector.tsx +4 -1
  210. package/src/components/molecules/Grid/Grid.tsx +68 -0
  211. package/src/components/molecules/Grid/Item/Item.tsx +77 -0
  212. package/src/components/molecules/Grid/Item/index.ts +1 -0
  213. package/src/components/molecules/Grid/index.ts +2 -0
  214. package/src/components/molecules/IconTextButton/IconTextButton.tsx +55 -0
  215. package/src/components/molecules/IconTextButton/TextComponent.tsx +43 -0
  216. package/src/components/molecules/IconTextButton/index.ts +4 -0
  217. package/src/components/molecules/IconTextButton/styled.ts +35 -0
  218. package/src/components/molecules/InputPassword/InputPassword.tsx +3 -2
  219. package/src/components/molecules/LabeledSwitch/LabelComponent.tsx +46 -0
  220. package/src/components/molecules/LabeledSwitch/LabeledSwitch.tsx +59 -0
  221. package/src/components/molecules/LabeledSwitch/index.ts +4 -0
  222. package/src/components/molecules/LabeledSwitch/styled.ts +27 -0
  223. package/src/components/molecules/Select/Modal.tsx +88 -66
  224. package/src/components/molecules/Select/Select.tsx +1 -1
  225. package/src/index.ts +38 -29
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/components/atoms/Modal/ui/styled.ts"],"names":["StyledPressableBackDrop","styled","Pressable","BackDropView","Animated","View","CloseBar","theme","color","secondary","light"],"mappings":";;;;;AAAA;;AACA;;AACA;;;;AAEO,MAAMA,uBAAuB,GAAGC,gBAAOC,SAA+B;AAC7E;AACA;AACA;AACA;AACA,CALO;;AAOA,MAAMC,YAAY,GAAG,qBAAOC,sBAASC,IAAhB,CAA2C;AACvE;AACA;AACA,CAHO;;AAKA,MAAMC,QAAQ,GAAGL,gBAAOI,IAA0B;AACzD,wBAAwB,CAAC;AAAEE,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACC,KAAN,CAAYC,SAAZ,CAAsBC,KAAM;AACnE,qBAAqB,2BAAW,MAAX,CAAmB;AACxC,cAAe,GAAE,2BAAW,KAAX,CAAkB,OAAO;AAC1C,aAAa,2BAAW,MAAX,CAAmB;AAChC,cAAc,2BAAW,KAAX,CAAkB;AAChC,CANO","sourcesContent":["import styled from \"@emotion/native\";\nimport { RFValueStr, StyleProps } from \"@tecsinapse/react-core\";\nimport { Animated } from \"react-native\";\n\nexport const StyledPressableBackDrop = styled.Pressable<Partial<StyleProps>>`\n flex: 1;\n position: absolute;\n width: 100%;\n height: 100%;\n`\n\nexport const BackDropView = styled(Animated.View)<Partial<StyleProps>>`\n justify-content: flex-end;\n flex: 1;\n`\n\nexport const CloseBar = styled.View<Partial<StyleProps>>`\n background-color: ${({ theme }) => theme.color.secondary.light};\n border-radius: ${RFValueStr('10px')};\n margin: ${`${RFValueStr('5px')} auto`};\n width: ${RFValueStr('42px')};\n height: ${RFValueStr('5px')};\n`"],"file":"styled.js"}
1
+ {"version":3,"file":"styled.js","names":["StyledPressableBackDrop","styled","Pressable","BackDropView","Animated","View","CloseBar","theme","color","secondary","light","RFValueStr"],"sources":["../../../../../src/components/atoms/Modal/ui/styled.ts"],"sourcesContent":["import styled from '@emotion/native';\nimport { RFValueStr, StyleProps } from '@tecsinapse/react-core';\nimport { Animated } from 'react-native';\n\nexport const StyledPressableBackDrop = styled.Pressable<Partial<StyleProps>>`\n flex: 1;\n position: absolute;\n width: 100%;\n height: 100%;\n`;\n\nexport const BackDropView = styled(Animated.View)<Partial<StyleProps>>`\n justify-content: flex-end;\n flex: 1;\n`;\n\nexport const CloseBar = styled.View<Partial<StyleProps>>`\n background-color: ${({ theme }) => theme.color.secondary.light};\n border-radius: ${RFValueStr('10px')};\n margin: ${`${RFValueStr('5px')} auto`};\n width: ${RFValueStr('42px')};\n height: ${RFValueStr('5px')};\n`;\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;;;AAEO,MAAMA,uBAAuB,GAAGC,eAAA,CAAOC,SAAV,2IAA7B;;;AAOA,MAAMC,YAAY,GAAG,IAAAF,eAAA,EAAOG,qBAAA,CAASC,IAAhB,CAAH,mHAAlB;;;AAKA,MAAMC,QAAQ,GAAGL,eAAA,CAAOI,IAAV,+KACC;EAAA,IAAC;IAAEE;EAAF,CAAD;EAAA,OAAeA,KAAK,CAACC,KAAN,CAAYC,SAAZ,CAAsBC,KAArC;AAAA,CADD,EAEF,IAAAC,qBAAA,EAAW,MAAX,CAFE,YAGN,IAAAA,qBAAA,EAAW,KAAX,CAHM,YAIV,IAAAA,qBAAA,EAAW,MAAX,CAJU,EAKT,IAAAA,qBAAA,EAAW,KAAX,CALS,CAAd"}
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  export interface IBaseModal {
3
3
  visible?: boolean;
4
4
  BoxComponent?: React.FC<any>;
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
2
 
3
- exports.__esModule = true;
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
4
6
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"types.js"}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../../src/components/atoms/Modal/ui/types.ts"],"sourcesContent":["/**\n * Defines a modal interface and allows you implement your own modal component.\n */\nimport React from 'react';\n\nexport interface IBaseModal {\n visible?: boolean;\n BoxComponent?: React.FC<any>;\n frozen?: boolean;\n isLastShown?: boolean;\n showCloseBar?: boolean;\n close?: () => void;\n onClose?: () => void;\n}\n"],"mappings":""}
@@ -1,5 +1,5 @@
1
- import { ReactElement } from "react";
2
- import { IBaseModal } from "./ui/types";
1
+ import { ReactElement } from 'react';
2
+ import { IBaseModal } from './ui/types';
3
3
  export declare const useLazyModalManager: (modalId?: string | undefined) => {
4
4
  requestUpdate: () => void;
5
5
  sync: (modal: ReactElement<IBaseModal>) => null;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
 
3
- exports.__esModule = true;
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
4
6
  exports.useLazyModalManager = void 0;
5
7
 
6
8
  var _react = require("react");
@@ -10,7 +12,7 @@ var _uuid = require("uuid");
10
12
  var _ModalGroupManager = require("./ModalGroupManager");
11
13
 
12
14
  const useLazyModalManager = modalId => {
13
- const [id] = (0, _react.useState)(modalId ?? (0, _uuid.v4)());
15
+ const [id] = (0, _react.useState)(modalId !== null && modalId !== void 0 ? modalId : (0, _uuid.v4)());
14
16
  const requestUpdate = (0, _react.useCallback)(() => _ModalGroupManager.modalLifecycle.update(), []);
15
17
  const sync = (0, _react.useCallback)(modal => {
16
18
  _ModalGroupManager.modalLifecycle.sync(id, () => modal);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Modal/useLazyModalManager.ts"],"names":["useLazyModalManager","modalId","id","requestUpdate","modalLifecycle","update","sync","modal","show","close","destroy"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAWO,MAAMA,mBAAmB,GAAIC,OAAD,IAAsB;AAErD,QAAM,CAACC,EAAD,IAAO,qBAASD,OAAO,IAAI,eAApB,CAAb;AAEA,QAAME,aAAa,GAAG,wBAAY,MAAMC,kCAAeC,MAAf,EAAlB,EAA2C,EAA3C,CAAtB;AAEA,QAAMC,IAAI,GAAG,wBAAaC,KAAD,IAAqC;AAC1DH,sCAAeE,IAAf,CAAoBJ,EAApB,EAAwB,MAAMK,KAA9B;;AACA,WAAO,IAAP;AACH,GAHY,EAGV,CAACL,EAAD,CAHU,CAAb;AAKA,QAAMM,IAAI,GAAG,wBAAY,MAAM;AAC3BJ,sCAAeI,IAAf,CAAoBN,EAApB;AACH,GAFY,EAEV,CAACA,EAAD,CAFU,CAAb;AAIA,QAAMO,KAAK,GAAG,wBAAY,MAAM;AAC5BL,sCAAeK,KAAf,CAAqBP,EAArB;AACH,GAFa,EAEX,CAACA,EAAD,CAFW,CAAd;AAIA,wBAAU,MAAM;AACZ,WAAO,MAAME,kCAAeM,OAAf,CAAuBR,EAAvB,CAAb;AACH,GAFD,EAEG,EAFH;AAIA,SAAO;AACHC,IAAAA,aADG;AAEHG,IAAAA,IAFG;AAGHE,IAAAA,IAHG;AAIHC,IAAAA;AAJG,GAAP;AAMH,CA7BM","sourcesContent":["import { ReactElement, useCallback, useEffect, useState } from \"react\"\nimport { v4 as uuidv4 } from 'uuid'\nimport { modalLifecycle } from \"./ModalGroupManager\"\nimport { IBaseModal } from \"./ui/types\"\n\n/**\n * Use this hook to tell the modal lifecycle handler that you want to add\n * a new modal component. \n * \n * @param id \n * @param modal \n * @returns\n */\nexport const useLazyModalManager = (modalId?: string) => {\n\n const [id] = useState(modalId ?? uuidv4())\n\n const requestUpdate = useCallback(() => modalLifecycle.update(), [])\n\n const sync = useCallback((modal: ReactElement<IBaseModal>) => {\n modalLifecycle.sync(id, () => modal)\n return null\n }, [id])\n\n const show = useCallback(() => {\n modalLifecycle.show(id)\n }, [id])\n\n const close = useCallback(() => {\n modalLifecycle.close(id)\n }, [id])\n \n useEffect(() => {\n return () => modalLifecycle.destroy(id)\n }, [])\n\n return {\n requestUpdate,\n sync,\n show,\n close\n }\n}"],"file":"useLazyModalManager.js"}
1
+ {"version":3,"file":"useLazyModalManager.js","names":["useLazyModalManager","modalId","id","useState","uuidv4","requestUpdate","useCallback","modalLifecycle","update","sync","modal","show","close","useEffect","destroy"],"sources":["../../../../src/components/atoms/Modal/useLazyModalManager.ts"],"sourcesContent":["import { ReactElement, useCallback, useEffect, useState } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\nimport { modalLifecycle } from './ModalGroupManager';\nimport { IBaseModal } from './ui/types';\n\n/**\n * Use this hook to tell the modal lifecycle handler that you want to add\n * a new modal component.\n *\n * @returns\n * @param modalId\n */\nexport const useLazyModalManager = (modalId?: string) => {\n const [id] = useState(modalId ?? uuidv4());\n\n const requestUpdate = useCallback(() => modalLifecycle.update(), []);\n\n const sync = useCallback(\n (modal: ReactElement<IBaseModal>) => {\n modalLifecycle.sync(id, () => modal);\n return null;\n },\n [id]\n );\n\n const show = useCallback(() => {\n modalLifecycle.show(id);\n }, [id]);\n\n const close = useCallback(() => {\n modalLifecycle.close(id);\n }, [id]);\n\n useEffect(() => {\n return () => modalLifecycle.destroy(id);\n }, []);\n\n return {\n requestUpdate,\n sync,\n show,\n close,\n };\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAUO,MAAMA,mBAAmB,GAAIC,OAAD,IAAsB;EACvD,MAAM,CAACC,EAAD,IAAO,IAAAC,eAAA,EAASF,OAAT,aAASA,OAAT,cAASA,OAAT,GAAoB,IAAAG,QAAA,GAApB,CAAb;EAEA,MAAMC,aAAa,GAAG,IAAAC,kBAAA,EAAY,MAAMC,iCAAA,CAAeC,MAAf,EAAlB,EAA2C,EAA3C,CAAtB;EAEA,MAAMC,IAAI,GAAG,IAAAH,kBAAA,EACVI,KAAD,IAAqC;IACnCH,iCAAA,CAAeE,IAAf,CAAoBP,EAApB,EAAwB,MAAMQ,KAA9B;;IACA,OAAO,IAAP;EACD,CAJU,EAKX,CAACR,EAAD,CALW,CAAb;EAQA,MAAMS,IAAI,GAAG,IAAAL,kBAAA,EAAY,MAAM;IAC7BC,iCAAA,CAAeI,IAAf,CAAoBT,EAApB;EACD,CAFY,EAEV,CAACA,EAAD,CAFU,CAAb;EAIA,MAAMU,KAAK,GAAG,IAAAN,kBAAA,EAAY,MAAM;IAC9BC,iCAAA,CAAeK,KAAf,CAAqBV,EAArB;EACD,CAFa,EAEX,CAACA,EAAD,CAFW,CAAd;EAIA,IAAAW,gBAAA,EAAU,MAAM;IACd,OAAO,MAAMN,iCAAA,CAAeO,OAAf,CAAuBZ,EAAvB,CAAb;EACD,CAFD,EAEG,EAFH;EAIA,OAAO;IACLG,aADK;IAELI,IAFK;IAGLE,IAHK;IAILC;EAJK,CAAP;AAMD,CA/BM"}
@@ -1,5 +1,5 @@
1
- import { ReactElement } from "react";
2
- import { IBaseModal } from "./ui/types";
1
+ import { ReactElement } from 'react';
2
+ import { IBaseModal } from './ui/types';
3
3
  export declare const useModalManager: (modal: () => ReactElement<IBaseModal>, modalId?: string | undefined) => {
4
4
  show: () => void;
5
5
  close: () => void;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
 
3
- exports.__esModule = true;
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
4
6
  exports.useModalManager = void 0;
5
7
 
6
8
  var _react = require("react");
@@ -10,7 +12,7 @@ var _uuid = require("uuid");
10
12
  var _ModalGroupManager = require("./ModalGroupManager");
11
13
 
12
14
  const useModalManager = (modal, modalId) => {
13
- const [id] = (0, _react.useState)(modalId ?? (0, _uuid.v4)());
15
+ const [id] = (0, _react.useState)(modalId !== null && modalId !== void 0 ? modalId : (0, _uuid.v4)());
14
16
 
15
17
  _ModalGroupManager.modalLifecycle.sync(id, modal);
16
18
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Modal/useModalManager.ts"],"names":["useModalManager","modal","modalId","id","modalLifecycle","sync","show","close","destroy"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAWO,MAAMA,eAAe,GAAG,CAACC,KAAD,EAAwCC,OAAxC,KAA6D;AAExF,QAAM,CAACC,EAAD,IAAO,qBAASD,OAAO,IAAI,eAApB,CAAb;;AACAE,oCAAeC,IAAf,CAAoBF,EAApB,EAAwBF,KAAxB;;AAEA,QAAMK,IAAI,GAAG,wBAAY,MAAM;AAC3BF,sCAAeE,IAAf,CAAoBH,EAApB;AACH,GAFY,EAEV,CAACA,EAAD,CAFU,CAAb;AAIA,QAAMI,KAAK,GAAG,wBAAY,MAAM;AAC5BH,sCAAeG,KAAf,CAAqBJ,EAArB;AACH,GAFa,EAEX,CAACA,EAAD,CAFW,CAAd;AAIA,wBAAU,MAAM;AACZ,WAAO,MAAMC,kCAAeI,OAAf,CAAuBL,EAAvB,CAAb;AACH,GAFD,EAEG,EAFH;AAIA,SAAO;AACHG,IAAAA,IADG;AAEHC,IAAAA;AAFG,GAAP;AAIH,CArBM","sourcesContent":["import { ReactElement, useCallback, useEffect, useState } from \"react\"\nimport { v4 as uuidv4 } from 'uuid'\nimport { modalLifecycle } from \"./ModalGroupManager\"\nimport { IBaseModal } from \"./ui/types\"\n\n/**\n * Use this hook to tell the modal lifecycle handler that you want to add\n * a new modal component. \n * \n * @param id \n * @param modal \n * @returns\n */\nexport const useModalManager = (modal: () => ReactElement<IBaseModal>, modalId?: string) => {\n\n const [id] = useState(modalId ?? uuidv4())\n modalLifecycle.sync(id, modal)\n\n const show = useCallback(() => {\n modalLifecycle.show(id)\n }, [id])\n\n const close = useCallback(() => {\n modalLifecycle.close(id)\n }, [id])\n \n useEffect(() => {\n return () => modalLifecycle.destroy(id)\n }, [])\n\n return {\n show,\n close\n }\n}"],"file":"useModalManager.js"}
1
+ {"version":3,"file":"useModalManager.js","names":["useModalManager","modal","modalId","id","useState","uuidv4","modalLifecycle","sync","show","useCallback","close","useEffect","destroy"],"sources":["../../../../src/components/atoms/Modal/useModalManager.ts"],"sourcesContent":["import { ReactElement, useCallback, useEffect, useState } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\nimport { modalLifecycle } from './ModalGroupManager';\nimport { IBaseModal } from './ui/types';\n\n/**\n * Use this hook to tell the modal lifecycle handler that you want to add\n * a new modal component.\n *\n * @param id\n * @param modal\n * @returns\n */\nexport const useModalManager = (\n modal: () => ReactElement<IBaseModal>,\n modalId?: string\n) => {\n const [id] = useState(modalId ?? uuidv4());\n modalLifecycle.sync(id, modal);\n\n const show = useCallback(() => {\n modalLifecycle.show(id);\n }, [id]);\n\n const close = useCallback(() => {\n modalLifecycle.close(id);\n }, [id]);\n\n useEffect(() => {\n return () => modalLifecycle.destroy(id);\n }, []);\n\n return {\n show,\n close,\n };\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAWO,MAAMA,eAAe,GAAG,CAC7BC,KAD6B,EAE7BC,OAF6B,KAG1B;EACH,MAAM,CAACC,EAAD,IAAO,IAAAC,eAAA,EAASF,OAAT,aAASA,OAAT,cAASA,OAAT,GAAoB,IAAAG,QAAA,GAApB,CAAb;;EACAC,iCAAA,CAAeC,IAAf,CAAoBJ,EAApB,EAAwBF,KAAxB;;EAEA,MAAMO,IAAI,GAAG,IAAAC,kBAAA,EAAY,MAAM;IAC7BH,iCAAA,CAAeE,IAAf,CAAoBL,EAApB;EACD,CAFY,EAEV,CAACA,EAAD,CAFU,CAAb;EAIA,MAAMO,KAAK,GAAG,IAAAD,kBAAA,EAAY,MAAM;IAC9BH,iCAAA,CAAeI,KAAf,CAAqBP,EAArB;EACD,CAFa,EAEX,CAACA,EAAD,CAFW,CAAd;EAIA,IAAAQ,gBAAA,EAAU,MAAM;IACd,OAAO,MAAML,iCAAA,CAAeM,OAAf,CAAuBT,EAAvB,CAAb;EACD,CAFD,EAEG,EAFH;EAIA,OAAO;IACLK,IADK;IAELE;EAFK,CAAP;AAID,CAvBM"}
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
 
3
- exports.__esModule = true;
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
4
6
  exports.useModalRemoteControl = void 0;
5
7
 
6
8
  var _react = require("react");
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Modal/useModalRemoteControl.ts"],"names":["useModalRemoteControl","modalId","show","modalLifecycle","close"],"mappings":";;;;;AAAA;;AACA;;AASO,MAAMA,qBAAqB,GAAIC,OAAD,IAAqB;AAEtD,QAAMC,IAAI,GAAG,wBAAY,MAAM;AAC3BC,sCAAeD,IAAf,CAAoBD,OAApB;AACH,GAFY,EAEV,CAACA,OAAD,CAFU,CAAb;AAIA,QAAMG,KAAK,GAAG,wBAAY,MAAM;AAC5BD,sCAAeC,KAAf,CAAqBH,OAArB;AACH,GAFa,EAEX,CAACA,OAAD,CAFW,CAAd;AAIA,SAAO;AACHC,IAAAA,IADG;AAEHE,IAAAA;AAFG,GAAP;AAKH,CAfM","sourcesContent":["import { useCallback } from \"react\"\nimport { modalLifecycle } from \"./ModalGroupManager\"\n\n/**\n * Use it to control a specific modal wherever it's.\n * Just provide an id of a specific instance.\n * \n * @param modalId \n * @returns \n */\nexport const useModalRemoteControl = (modalId: string) => {\n\n const show = useCallback(() => {\n modalLifecycle.show(modalId)\n }, [modalId])\n\n const close = useCallback(() => {\n modalLifecycle.close(modalId)\n }, [modalId])\n\n return {\n show,\n close\n }\n\n}"],"file":"useModalRemoteControl.js"}
1
+ {"version":3,"file":"useModalRemoteControl.js","names":["useModalRemoteControl","modalId","show","useCallback","modalLifecycle","close"],"sources":["../../../../src/components/atoms/Modal/useModalRemoteControl.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { modalLifecycle } from './ModalGroupManager';\n\n/**\n * Use it to control a specific modal wherever it's.\n * Just provide an id of a specific instance.\n *\n * @param modalId\n * @returns\n */\nexport const useModalRemoteControl = (modalId: string) => {\n const show = useCallback(() => {\n modalLifecycle.show(modalId);\n }, [modalId]);\n\n const close = useCallback(() => {\n modalLifecycle.close(modalId);\n }, [modalId]);\n\n return {\n show,\n close,\n };\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AASO,MAAMA,qBAAqB,GAAIC,OAAD,IAAqB;EACxD,MAAMC,IAAI,GAAG,IAAAC,kBAAA,EAAY,MAAM;IAC7BC,iCAAA,CAAeF,IAAf,CAAoBD,OAApB;EACD,CAFY,EAEV,CAACA,OAAD,CAFU,CAAb;EAIA,MAAMI,KAAK,GAAG,IAAAF,kBAAA,EAAY,MAAM;IAC9BC,iCAAA,CAAeC,KAAf,CAAqBJ,OAArB;EACD,CAFa,EAEX,CAACA,OAAD,CAFW,CAAd;EAIA,OAAO;IACLC,IADK;IAELG;EAFK,CAAP;AAID,CAbM"}
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
 
3
- exports.__esModule = true;
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
4
6
  exports.Pulse = void 0;
5
7
 
6
8
  var _reactNative = require("react-native");
@@ -13,24 +15,27 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
13
15
 
14
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; }
15
17
 
16
- const Pulse = ({
17
- active = true,
18
- width,
19
- height,
20
- childrenLayout
21
- }) => {
18
+ const Pulse = _ref => {
19
+ var _childrenLayout$x, _childrenLayout$y;
20
+
21
+ let {
22
+ active = true,
23
+ width,
24
+ height,
25
+ childrenLayout
26
+ } = _ref;
22
27
  const animatedValue = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
23
28
  (0, _react.useEffect)(() => {
24
29
  (0, _animation.pulseAnimation)(active, animatedValue);
25
30
  }, [active]);
26
31
  return _react.default.createElement(_reactNative.Animated.View, {
27
32
  style: {
28
- width: width ?? childrenLayout.width,
29
- height: height ?? childrenLayout.height,
33
+ width: width !== null && width !== void 0 ? width : childrenLayout.width,
34
+ height: height !== null && height !== void 0 ? height : childrenLayout.height,
30
35
  backgroundColor: 'rgba(0,0,0,0.05)',
31
36
  position: 'absolute',
32
- top: childrenLayout.x ?? 0,
33
- left: childrenLayout.y ?? 0,
37
+ top: (_childrenLayout$x = childrenLayout.x) !== null && _childrenLayout$x !== void 0 ? _childrenLayout$x : 0,
38
+ left: (_childrenLayout$y = childrenLayout.y) !== null && _childrenLayout$y !== void 0 ? _childrenLayout$y : 0,
34
39
  zIndex: 2,
35
40
  overflow: 'hidden',
36
41
  opacity: animatedValue
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Skeleton/Pulse.tsx"],"names":["Pulse","active","width","height","childrenLayout","animatedValue","Animated","Value","current","backgroundColor","position","top","x","left","y","zIndex","overflow","opacity"],"mappings":";;;;;AAAA;;AACA;;AACA;;;;;;AAGO,MAAMA,KAAK,GAAG,CAAC;AACpBC,EAAAA,MAAM,GAAG,IADW;AAEpBC,EAAAA,KAFoB;AAGpBC,EAAAA,MAHoB;AAIpBC,EAAAA;AAJoB,CAAD,KAKM;AACzB,QAAMC,aAAa,GAAG,mBAAO,IAAIC,sBAASC,KAAb,CAAmB,CAAnB,CAAP,EAA8BC,OAApD;AAEA,wBAAU,MAAM;AACd,mCAAeP,MAAf,EAAuBI,aAAvB;AACD,GAFD,EAEG,CAACJ,MAAD,CAFH;AAIA,SACE,6BAAC,qBAAD,CAAU,IAAV;AACE,IAAA,KAAK,EAAE;AACLC,MAAAA,KAAK,EAAEA,KAAK,IAAIE,cAAc,CAACF,KAD1B;AAELC,MAAAA,MAAM,EAAEA,MAAM,IAAIC,cAAc,CAACD,MAF5B;AAGLM,MAAAA,eAAe,EAAE,kBAHZ;AAILC,MAAAA,QAAQ,EAAE,UAJL;AAKLC,MAAAA,GAAG,EAAEP,cAAc,CAACQ,CAAf,IAAoB,CALpB;AAMLC,MAAAA,IAAI,EAAET,cAAc,CAACU,CAAf,IAAoB,CANrB;AAOLC,MAAAA,MAAM,EAAE,CAPH;AAQLC,MAAAA,QAAQ,EAAE,QARL;AASLC,MAAAA,OAAO,EAAEZ;AATJ;AADT,IADF;AAeD,CA3BM","sourcesContent":["import { Animated } from 'react-native';\nimport React, { useEffect, useRef } from 'react';\nimport { pulseAnimation } from './animation';\nimport { IAnimationComponent } from './types';\n\nexport const Pulse = ({\n active = true,\n width,\n height,\n childrenLayout,\n}: IAnimationComponent) => {\n const animatedValue = useRef(new Animated.Value(0)).current;\n\n useEffect(() => {\n pulseAnimation(active, animatedValue);\n }, [active]);\n\n return (\n <Animated.View\n style={{\n width: width ?? childrenLayout.width,\n height: height ?? childrenLayout.height,\n backgroundColor: 'rgba(0,0,0,0.05)',\n position: 'absolute',\n top: childrenLayout.x ?? 0,\n left: childrenLayout.y ?? 0,\n zIndex: 2,\n overflow: 'hidden',\n opacity: animatedValue,\n }}\n />\n );\n};\n"],"file":"Pulse.js"}
1
+ {"version":3,"file":"Pulse.js","names":["Pulse","active","width","height","childrenLayout","animatedValue","useRef","Animated","Value","current","useEffect","pulseAnimation","backgroundColor","position","top","x","left","y","zIndex","overflow","opacity"],"sources":["../../../../src/components/atoms/Skeleton/Pulse.tsx"],"sourcesContent":["import { Animated } from 'react-native';\nimport React, { useEffect, useRef } from 'react';\nimport { pulseAnimation } from './animation';\nimport { IAnimationComponent } from './types';\n\nexport const Pulse = ({\n active = true,\n width,\n height,\n childrenLayout,\n}: IAnimationComponent) => {\n const animatedValue = useRef(new Animated.Value(0)).current;\n\n useEffect(() => {\n pulseAnimation(active, animatedValue);\n }, [active]);\n\n return (\n <Animated.View\n style={{\n width: width ?? childrenLayout.width,\n height: height ?? childrenLayout.height,\n backgroundColor: 'rgba(0,0,0,0.05)',\n position: 'absolute',\n top: childrenLayout.x ?? 0,\n left: childrenLayout.y ?? 0,\n zIndex: 2,\n overflow: 'hidden',\n opacity: animatedValue,\n }}\n />\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;AAGO,MAAMA,KAAK,GAAG,QAKM;EAAA;;EAAA,IALL;IACpBC,MAAM,GAAG,IADW;IAEpBC,KAFoB;IAGpBC,MAHoB;IAIpBC;EAJoB,CAKK;EACzB,MAAMC,aAAa,GAAG,IAAAC,aAAA,EAAO,IAAIC,qBAAA,CAASC,KAAb,CAAmB,CAAnB,CAAP,EAA8BC,OAApD;EAEA,IAAAC,gBAAA,EAAU,MAAM;IACd,IAAAC,yBAAA,EAAeV,MAAf,EAAuBI,aAAvB;EACD,CAFD,EAEG,CAACJ,MAAD,CAFH;EAIA,OACE,6BAAC,qBAAD,CAAU,IAAV;IACE,KAAK,EAAE;MACLC,KAAK,EAAEA,KAAF,aAAEA,KAAF,cAAEA,KAAF,GAAWE,cAAc,CAACF,KAD1B;MAELC,MAAM,EAAEA,MAAF,aAAEA,MAAF,cAAEA,MAAF,GAAYC,cAAc,CAACD,MAF5B;MAGLS,eAAe,EAAE,kBAHZ;MAILC,QAAQ,EAAE,UAJL;MAKLC,GAAG,uBAAEV,cAAc,CAACW,CAAjB,iEAAsB,CALpB;MAMLC,IAAI,uBAAEZ,cAAc,CAACa,CAAjB,iEAAsB,CANrB;MAOLC,MAAM,EAAE,CAPH;MAQLC,QAAQ,EAAE,QARL;MASLC,OAAO,EAAEf;IATJ;EADT,EADF;AAeD,CA3BM"}
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
 
3
- exports.__esModule = true;
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
4
6
  exports.default = void 0;
5
7
 
6
8
  var _react = _interopRequireWildcard(require("react"));
@@ -17,17 +19,18 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
17
19
 
18
20
  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
21
 
20
- function _extends() { _extends = Object.assign || 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); }
22
+ 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); }
21
23
 
22
- const Skeleton = ({
23
- children,
24
- width,
25
- height,
26
- radius,
27
- active = true,
28
- animation = 'wave',
29
- ...rest
30
- }) => {
24
+ const Skeleton = _ref => {
25
+ let {
26
+ children,
27
+ width,
28
+ height,
29
+ radius,
30
+ active = true,
31
+ animation = 'wave',
32
+ ...rest
33
+ } = _ref;
31
34
  const [childrenLayout, setChildrenLayout] = (0, _react.useState)({
32
35
  width: 0,
33
36
  height: 0,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Skeleton/Skeleton.tsx"],"names":["Skeleton","children","width","height","radius","active","animation","rest","childrenLayout","setChildrenLayout","y","x","Error","getChildrenLayout","event","nativeEvent","layout","opacity"],"mappings":";;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;AAWA,MAAMA,QAAiC,GAAG,CAAC;AACzCC,EAAAA,QADyC;AAEzCC,EAAAA,KAFyC;AAGzCC,EAAAA,MAHyC;AAIzCC,EAAAA,MAJyC;AAKzCC,EAAAA,MAAM,GAAG,IALgC;AAMzCC,EAAAA,SAAS,GAAG,MAN6B;AAOzC,KAAGC;AAPsC,CAAD,KAQpC;AACJ,QAAM,CAACC,cAAD,EAAiBC,iBAAjB,IAAsC,qBAAyB;AACnEP,IAAAA,KAAK,EAAE,CAD4D;AAEnEC,IAAAA,MAAM,EAAE,CAF2D;AAGnEO,IAAAA,CAAC,EAAE,CAHgE;AAInEC,IAAAA,CAAC,EAAE;AAJgE,GAAzB,CAA5C;;AAOA,MAAI,CAACT,KAAD,IAAU,CAACC,MAAX,IAAqB,CAACF,QAA1B,EAAoC;AAClC,UAAM,IAAIW,KAAJ,CACJ,oEADI,CAAN;AAGD;;AAED,QAAMC,iBAAiB,GAAIC,KAAD,IAA8B;AACtDL,IAAAA,iBAAiB,CAACK,KAAK,CAACC,WAAN,CAAkBC,MAAnB,CAAjB;AACD,GAFD;;AAIA,SACE,6BAAC,eAAD;AAAS,IAAA,KAAK,EAAEd,KAAhB;AAAuB,IAAA,MAAM,EAAEC,MAA/B;AAAuC,IAAA,MAAM,EAAEC;AAA/C,KAA2DG,IAA3D,GACGF,MAAM,IAAIC,SAAS,KAAK,MAAxB,GACC,6BAAC,UAAD;AACE,IAAA,MAAM,EAAED,MADV;AAEE,IAAA,KAAK,EAAEH,KAFT;AAGE,IAAA,MAAM,EAAEC,MAHV;AAIE,IAAA,cAAc,EAAEK;AAJlB,IADD,GAQC,2DATJ,EAYGH,MAAM,IAAIC,SAAS,KAAK,OAAxB,GACC,6BAAC,YAAD;AACE,IAAA,MAAM,EAAED,MADV;AAEE,IAAA,KAAK,EAAEH,KAFT;AAGE,IAAA,MAAM,EAAEC,MAHV;AAIE,IAAA,cAAc,EAAEK;AAJlB,IADD,GAQC,2DApBJ,EAsBE,6BAAC,iBAAD;AACE,IAAA,QAAQ,EAAEM,KAAK,IAAID,iBAAiB,CAACC,KAAD,CADtC;AAEE,IAAA,KAAK,EAAE;AAAEG,MAAAA,OAAO,EAAEZ,MAAM,GAAG,CAAH,GAAO;AAAxB,KAFT;AAGE,IAAA,aAAa,EAAEA,MAAM,GAAG,MAAH,GAAY;AAHnC,KAKGJ,QALH,CAtBF,CADF;AAgCD,CA1DD;;eA4DeD,Q","sourcesContent":["import React, { useState } from 'react';\nimport { BorderRadiusType } from '@tecsinapse/react-core';\nimport { LayoutChangeEvent, View, ViewProps } from 'react-native';\nimport { Wrapper } from './styled';\nimport { Wave } from './Wave';\nimport { Pulse } from './Pulse';\nimport { ChildrenLayout } from './types';\n\nexport interface SkeletonProps extends ViewProps {\n width?: number;\n height?: number;\n radius?: BorderRadiusType;\n active?: boolean;\n animation?: 'wave' | 'pulse';\n}\n\nconst Skeleton: React.FC<SkeletonProps> = ({\n children,\n width,\n height,\n radius,\n active = true,\n animation = 'wave',\n ...rest\n}) => {\n const [childrenLayout, setChildrenLayout] = useState<ChildrenLayout>({\n width: 0,\n height: 0,\n y: 0,\n x: 0,\n });\n\n if (!width && !height && !children) {\n throw new Error(\n '[Skeleton] You should provide children or specify width and height'\n );\n }\n\n const getChildrenLayout = (event: LayoutChangeEvent) => {\n setChildrenLayout(event.nativeEvent.layout);\n };\n\n return (\n <Wrapper width={width} height={height} radius={radius} {...rest}>\n {active && animation === 'wave' ? (\n <Wave\n active={active}\n width={width}\n height={height}\n childrenLayout={childrenLayout}\n />\n ) : (\n <></>\n )}\n\n {active && animation === 'pulse' ? (\n <Pulse\n active={active}\n width={width}\n height={height}\n childrenLayout={childrenLayout}\n />\n ) : (\n <></>\n )}\n <View\n onLayout={event => getChildrenLayout(event)}\n style={{ opacity: active ? 0 : 1 }}\n pointerEvents={active ? 'none' : 'auto'}\n >\n {children}\n </View>\n </Wrapper>\n );\n};\n\nexport default Skeleton;\n"],"file":"Skeleton.js"}
1
+ {"version":3,"file":"Skeleton.js","names":["Skeleton","children","width","height","radius","active","animation","rest","childrenLayout","setChildrenLayout","useState","y","x","Error","getChildrenLayout","event","nativeEvent","layout","opacity"],"sources":["../../../../src/components/atoms/Skeleton/Skeleton.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { BorderRadiusType } from '@tecsinapse/react-core';\nimport { LayoutChangeEvent, View, ViewProps } from 'react-native';\nimport { Wrapper } from './styled';\nimport { Wave } from './Wave';\nimport { Pulse } from './Pulse';\nimport { ChildrenLayout } from './types';\n\nexport interface SkeletonProps extends ViewProps {\n width?: number;\n height?: number;\n radius?: BorderRadiusType;\n active?: boolean;\n animation?: 'wave' | 'pulse';\n}\n\nconst Skeleton: React.FC<SkeletonProps> = ({\n children,\n width,\n height,\n radius,\n active = true,\n animation = 'wave',\n ...rest\n}) => {\n const [childrenLayout, setChildrenLayout] = useState<ChildrenLayout>({\n width: 0,\n height: 0,\n y: 0,\n x: 0,\n });\n\n if (!width && !height && !children) {\n throw new Error(\n '[Skeleton] You should provide children or specify width and height'\n );\n }\n\n const getChildrenLayout = (event: LayoutChangeEvent) => {\n setChildrenLayout(event.nativeEvent.layout);\n };\n\n return (\n <Wrapper width={width} height={height} radius={radius} {...rest}>\n {active && animation === 'wave' ? (\n <Wave\n active={active}\n width={width}\n height={height}\n childrenLayout={childrenLayout}\n />\n ) : (\n <></>\n )}\n\n {active && animation === 'pulse' ? (\n <Pulse\n active={active}\n width={width}\n height={height}\n childrenLayout={childrenLayout}\n />\n ) : (\n <></>\n )}\n <View\n onLayout={event => getChildrenLayout(event)}\n style={{ opacity: active ? 0 : 1 }}\n pointerEvents={active ? 'none' : 'auto'}\n >\n {children}\n </View>\n </Wrapper>\n );\n};\n\nexport default Skeleton;\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;AAWA,MAAMA,QAAiC,GAAG,QAQpC;EAAA,IARqC;IACzCC,QADyC;IAEzCC,KAFyC;IAGzCC,MAHyC;IAIzCC,MAJyC;IAKzCC,MAAM,GAAG,IALgC;IAMzCC,SAAS,GAAG,MAN6B;IAOzC,GAAGC;EAPsC,CAQrC;EACJ,MAAM,CAACC,cAAD,EAAiBC,iBAAjB,IAAsC,IAAAC,eAAA,EAAyB;IACnER,KAAK,EAAE,CAD4D;IAEnEC,MAAM,EAAE,CAF2D;IAGnEQ,CAAC,EAAE,CAHgE;IAInEC,CAAC,EAAE;EAJgE,CAAzB,CAA5C;;EAOA,IAAI,CAACV,KAAD,IAAU,CAACC,MAAX,IAAqB,CAACF,QAA1B,EAAoC;IAClC,MAAM,IAAIY,KAAJ,CACJ,oEADI,CAAN;EAGD;;EAED,MAAMC,iBAAiB,GAAIC,KAAD,IAA8B;IACtDN,iBAAiB,CAACM,KAAK,CAACC,WAAN,CAAkBC,MAAnB,CAAjB;EACD,CAFD;;EAIA,OACE,6BAAC,eAAD;IAAS,KAAK,EAAEf,KAAhB;IAAuB,MAAM,EAAEC,MAA/B;IAAuC,MAAM,EAAEC;EAA/C,GAA2DG,IAA3D,GACGF,MAAM,IAAIC,SAAS,KAAK,MAAxB,GACC,6BAAC,UAAD;IACE,MAAM,EAAED,MADV;IAEE,KAAK,EAAEH,KAFT;IAGE,MAAM,EAAEC,MAHV;IAIE,cAAc,EAAEK;EAJlB,EADD,GAQC,2DATJ,EAYGH,MAAM,IAAIC,SAAS,KAAK,OAAxB,GACC,6BAAC,YAAD;IACE,MAAM,EAAED,MADV;IAEE,KAAK,EAAEH,KAFT;IAGE,MAAM,EAAEC,MAHV;IAIE,cAAc,EAAEK;EAJlB,EADD,GAQC,2DApBJ,EAsBE,6BAAC,iBAAD;IACE,QAAQ,EAAEO,KAAK,IAAID,iBAAiB,CAACC,KAAD,CADtC;IAEE,KAAK,EAAE;MAAEG,OAAO,EAAEb,MAAM,GAAG,CAAH,GAAO;IAAxB,CAFT;IAGE,aAAa,EAAEA,MAAM,GAAG,MAAH,GAAY;EAHnC,GAKGJ,QALH,CAtBF,CADF;AAgCD,CA1DD;;eA4DeD,Q"}
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
 
3
- exports.__esModule = true;
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
4
6
  exports.Wave = void 0;
5
7
 
6
8
  var _react = _interopRequireWildcard(require("react"));
@@ -19,13 +21,16 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
19
21
 
20
22
  const AnimatedLinearGradient = _reactNative.Animated.createAnimatedComponent(_reactNativeLinearGradient.default);
21
23
 
22
- const Wave = ({
23
- active = true,
24
- width,
25
- height,
26
- childrenLayout
27
- }) => {
28
- const range = width ?? childrenLayout.width;
24
+ const Wave = _ref => {
25
+ var _childrenLayout$y, _childrenLayout$x;
26
+
27
+ let {
28
+ active = true,
29
+ width,
30
+ height,
31
+ childrenLayout
32
+ } = _ref;
33
+ const range = width !== null && width !== void 0 ? width : childrenLayout.width;
29
34
  const animatedValue = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
30
35
  const translateX = animatedValue.interpolate({
31
36
  inputRange: [0, 1],
@@ -45,11 +50,11 @@ const Wave = ({
45
50
  y: 0
46
51
  },
47
52
  style: {
48
- width: width ?? childrenLayout.width,
49
- height: height ?? childrenLayout.height,
53
+ width: width !== null && width !== void 0 ? width : childrenLayout.width,
54
+ height: height !== null && height !== void 0 ? height : childrenLayout.height,
50
55
  position: 'absolute',
51
- top: childrenLayout.y ?? 0,
52
- left: childrenLayout.x ?? 0,
56
+ top: (_childrenLayout$y = childrenLayout.y) !== null && _childrenLayout$y !== void 0 ? _childrenLayout$y : 0,
57
+ left: (_childrenLayout$x = childrenLayout.x) !== null && _childrenLayout$x !== void 0 ? _childrenLayout$x : 0,
53
58
  zIndex: 2,
54
59
  overflow: 'hidden',
55
60
  transform: [{
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Skeleton/Wave.tsx"],"names":["AnimatedLinearGradient","Animated","createAnimatedComponent","LinearGradient","Wave","active","width","height","childrenLayout","range","animatedValue","Value","current","translateX","interpolate","inputRange","outputRange","x","y","position","top","left","zIndex","overflow","transform"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;AAGA,MAAMA,sBAAsB,GAAGC,sBAASC,uBAAT,CAAiCC,kCAAjC,CAA/B;;AAEO,MAAMC,IAAI,GAAG,CAAC;AACnBC,EAAAA,MAAM,GAAG,IADU;AAEnBC,EAAAA,KAFmB;AAGnBC,EAAAA,MAHmB;AAInBC,EAAAA;AAJmB,CAAD,KAKO;AACzB,QAAMC,KAAK,GAAGH,KAAK,IAAIE,cAAc,CAACF,KAAtC;AACA,QAAMI,aAAa,GAAG,mBAAO,IAAIT,sBAASU,KAAb,CAAmB,CAAnB,CAAP,EAA8BC,OAApD;AAEA,QAAMC,UAAU,GAAGH,aAAa,CAACI,WAAd,CAA0B;AAC3CC,IAAAA,UAAU,EAAE,CAAC,CAAD,EAAI,CAAJ,CAD+B;AAE3CC,IAAAA,WAAW,EAAE,CAAC,CAACP,KAAF,EAASA,KAAT;AAF8B,GAA1B,CAAnB;AAKA,wBAAU,MAAM;AACd,kCAAcJ,MAAd,EAAsBK,aAAtB;AACD,GAFD,EAEG,CAACL,MAAD,CAFH;AAIA,SACE,6BAAC,sBAAD;AACE,IAAA,MAAM,EAAE,CACN,aADM,EAEN,kBAFM,EAGN,iBAHM,EAIN,aAJM,CADV;AAOE,IAAA,KAAK,EAAE;AAAEY,MAAAA,CAAC,EAAE,CAAL;AAAQC,MAAAA,CAAC,EAAE;AAAX,KAPT;AAQE,IAAA,GAAG,EAAE;AAAED,MAAAA,CAAC,EAAE,CAAL;AAAQC,MAAAA,CAAC,EAAE;AAAX,KARP;AASE,IAAA,KAAK,EAAE;AACLZ,MAAAA,KAAK,EAAEA,KAAK,IAAIE,cAAc,CAACF,KAD1B;AAELC,MAAAA,MAAM,EAAEA,MAAM,IAAIC,cAAc,CAACD,MAF5B;AAGLY,MAAAA,QAAQ,EAAE,UAHL;AAILC,MAAAA,GAAG,EAAEZ,cAAc,CAACU,CAAf,IAAoB,CAJpB;AAKLG,MAAAA,IAAI,EAAEb,cAAc,CAACS,CAAf,IAAoB,CALrB;AAMLK,MAAAA,MAAM,EAAE,CANH;AAOLC,MAAAA,QAAQ,EAAE,QAPL;AAQLC,MAAAA,SAAS,EAAE,CACT;AACEX,QAAAA,UAAU,EAAEA;AADd,OADS;AARN;AATT,IADF;AA0BD,CA5CM","sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport { Animated } from 'react-native';\nimport LinearGradient from 'react-native-linear-gradient';\nimport { waveAnimation } from './animation';\nimport { IAnimationComponent } from './types';\n\nconst AnimatedLinearGradient = Animated.createAnimatedComponent(LinearGradient);\n\nexport const Wave = ({\n active = true,\n width,\n height,\n childrenLayout,\n}: IAnimationComponent) => {\n const range = width ?? childrenLayout.width;\n const animatedValue = useRef(new Animated.Value(0)).current;\n\n const translateX = animatedValue.interpolate({\n inputRange: [0, 1],\n outputRange: [-range, range],\n });\n\n useEffect(() => {\n waveAnimation(active, animatedValue);\n }, [active]);\n\n return (\n <AnimatedLinearGradient\n colors={[\n 'transparent',\n 'rgba(0,0,0,0.05)',\n 'rgba(0,0,0,0.1)',\n 'transparent',\n ]}\n start={{ x: 0, y: 0 }}\n end={{ x: 1, y: 0 }}\n style={{\n width: width ?? childrenLayout.width,\n height: height ?? childrenLayout.height,\n position: 'absolute',\n top: childrenLayout.y ?? 0,\n left: childrenLayout.x ?? 0,\n zIndex: 2,\n overflow: 'hidden',\n transform: [\n {\n translateX: translateX,\n },\n ],\n }}\n />\n );\n};\n"],"file":"Wave.js"}
1
+ {"version":3,"file":"Wave.js","names":["AnimatedLinearGradient","Animated","createAnimatedComponent","LinearGradient","Wave","active","width","height","childrenLayout","range","animatedValue","useRef","Value","current","translateX","interpolate","inputRange","outputRange","useEffect","waveAnimation","x","y","position","top","left","zIndex","overflow","transform"],"sources":["../../../../src/components/atoms/Skeleton/Wave.tsx"],"sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport { Animated } from 'react-native';\nimport LinearGradient from 'react-native-linear-gradient';\nimport { waveAnimation } from './animation';\nimport { IAnimationComponent } from './types';\n\nconst AnimatedLinearGradient = Animated.createAnimatedComponent(LinearGradient);\n\nexport const Wave = ({\n active = true,\n width,\n height,\n childrenLayout,\n}: IAnimationComponent) => {\n const range = width ?? childrenLayout.width;\n const animatedValue = useRef(new Animated.Value(0)).current;\n\n const translateX = animatedValue.interpolate({\n inputRange: [0, 1],\n outputRange: [-range, range],\n });\n\n useEffect(() => {\n waveAnimation(active, animatedValue);\n }, [active]);\n\n return (\n <AnimatedLinearGradient\n colors={[\n 'transparent',\n 'rgba(0,0,0,0.05)',\n 'rgba(0,0,0,0.1)',\n 'transparent',\n ]}\n start={{ x: 0, y: 0 }}\n end={{ x: 1, y: 0 }}\n style={{\n width: width ?? childrenLayout.width,\n height: height ?? childrenLayout.height,\n position: 'absolute',\n top: childrenLayout.y ?? 0,\n left: childrenLayout.x ?? 0,\n zIndex: 2,\n overflow: 'hidden',\n transform: [\n {\n translateX: translateX,\n },\n ],\n }}\n />\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;AAGA,MAAMA,sBAAsB,GAAGC,qBAAA,CAASC,uBAAT,CAAiCC,kCAAjC,CAA/B;;AAEO,MAAMC,IAAI,GAAG,QAKO;EAAA;;EAAA,IALN;IACnBC,MAAM,GAAG,IADU;IAEnBC,KAFmB;IAGnBC,MAHmB;IAInBC;EAJmB,CAKM;EACzB,MAAMC,KAAK,GAAGH,KAAH,aAAGA,KAAH,cAAGA,KAAH,GAAYE,cAAc,CAACF,KAAtC;EACA,MAAMI,aAAa,GAAG,IAAAC,aAAA,EAAO,IAAIV,qBAAA,CAASW,KAAb,CAAmB,CAAnB,CAAP,EAA8BC,OAApD;EAEA,MAAMC,UAAU,GAAGJ,aAAa,CAACK,WAAd,CAA0B;IAC3CC,UAAU,EAAE,CAAC,CAAD,EAAI,CAAJ,CAD+B;IAE3CC,WAAW,EAAE,CAAC,CAACR,KAAF,EAASA,KAAT;EAF8B,CAA1B,CAAnB;EAKA,IAAAS,gBAAA,EAAU,MAAM;IACd,IAAAC,wBAAA,EAAcd,MAAd,EAAsBK,aAAtB;EACD,CAFD,EAEG,CAACL,MAAD,CAFH;EAIA,OACE,6BAAC,sBAAD;IACE,MAAM,EAAE,CACN,aADM,EAEN,kBAFM,EAGN,iBAHM,EAIN,aAJM,CADV;IAOE,KAAK,EAAE;MAAEe,CAAC,EAAE,CAAL;MAAQC,CAAC,EAAE;IAAX,CAPT;IAQE,GAAG,EAAE;MAAED,CAAC,EAAE,CAAL;MAAQC,CAAC,EAAE;IAAX,CARP;IASE,KAAK,EAAE;MACLf,KAAK,EAAEA,KAAF,aAAEA,KAAF,cAAEA,KAAF,GAAWE,cAAc,CAACF,KAD1B;MAELC,MAAM,EAAEA,MAAF,aAAEA,MAAF,cAAEA,MAAF,GAAYC,cAAc,CAACD,MAF5B;MAGLe,QAAQ,EAAE,UAHL;MAILC,GAAG,uBAAEf,cAAc,CAACa,CAAjB,iEAAsB,CAJpB;MAKLG,IAAI,uBAAEhB,cAAc,CAACY,CAAjB,iEAAsB,CALrB;MAMLK,MAAM,EAAE,CANH;MAOLC,QAAQ,EAAE,QAPL;MAQLC,SAAS,EAAE,CACT;QACEb,UAAU,EAAEA;MADd,CADS;IARN;EATT,EADF;AA0BD,CA5CM"}
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
 
3
- exports.__esModule = true;
4
- exports.pulseAnimation = exports.waveAnimation = void 0;
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.waveAnimation = exports.pulseAnimation = void 0;
5
7
 
6
8
  var _reactNative = require("react-native");
7
9
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Skeleton/animation.ts"],"names":["waveAnimation","active","animatedValue","Animated","loop","timing","toValue","duration","easing","Easing","inOut","linear","useNativeDriver","start","pulseAnimation","sequence"],"mappings":";;;;;AAAA;;AAEO,MAAMA,aAAa,GAAG,CAC3BC,MAD2B,EAE3BC,aAF2B,KAGlB;AACT,MAAID,MAAJ,EAAY;AACVE,0BAASC,IAAT,CACED,sBAASE,MAAT,CAAgBH,aAAhB,EAA+B;AAC7BI,MAAAA,OAAO,EAAE,CADoB;AAE7BC,MAAAA,QAAQ,EAAE,IAFmB;AAG7BC,MAAAA,MAAM,EAAEC,oBAAOC,KAAP,CAAaD,oBAAOE,MAApB,CAHqB;AAI7BC,MAAAA,eAAe,EAAE;AAJY,KAA/B,CADF,EAOEC,KAPF;;AAQA;AACD;;AACDV,wBAASE,MAAT,CAAgBH,aAAhB,EAA+B;AAC7BI,IAAAA,OAAO,EAAE,CADoB;AAE7BM,IAAAA,eAAe,EAAE;AAFY,GAA/B,EAGGC,KAHH;AAID,CAnBM;;;;AAqBA,MAAMC,cAAc,GAAG,CAC5Bb,MAD4B,EAE5BC,aAF4B,KAGnB;AACT,MAAID,MAAJ,EAAY;AACVE,0BAASC,IAAT,CACED,sBAASY,QAAT,CAAkB,CAChBZ,sBAASE,MAAT,CAAgBH,aAAhB,EAA+B;AAC7BI,MAAAA,OAAO,EAAE,CADoB;AAE7BC,MAAAA,QAAQ,EAAE,GAFmB;AAG7BK,MAAAA,eAAe,EAAE;AAHY,KAA/B,CADgB,EAMhBT,sBAASE,MAAT,CAAgBH,aAAhB,EAA+B;AAC7BI,MAAAA,OAAO,EAAE,CADoB;AAE7BC,MAAAA,QAAQ,EAAE,GAFmB;AAG7BK,MAAAA,eAAe,EAAE;AAHY,KAA/B,CANgB,CAAlB,CADF,EAaEC,KAbF;;AAcA;AACD;;AACDV,wBAASE,MAAT,CAAgBH,aAAhB,EAA+B;AAC7BI,IAAAA,OAAO,EAAE,CADoB;AAE7BM,IAAAA,eAAe,EAAE;AAFY,GAA/B,EAGGC,KAHH;AAID,CAzBM","sourcesContent":["import { Animated, Easing } from 'react-native';\n\nexport const waveAnimation = (\n active: boolean,\n animatedValue: Animated.Value\n): void => {\n if (active) {\n Animated.loop(\n Animated.timing(animatedValue, {\n toValue: 1,\n duration: 1600,\n easing: Easing.inOut(Easing.linear),\n useNativeDriver: true,\n })\n ).start();\n return;\n }\n Animated.timing(animatedValue, {\n toValue: 0,\n useNativeDriver: true,\n }).start();\n};\n\nexport const pulseAnimation = (\n active: boolean,\n animatedValue: Animated.Value\n): void => {\n if (active) {\n Animated.loop(\n Animated.sequence([\n Animated.timing(animatedValue, {\n toValue: 1,\n duration: 800,\n useNativeDriver: true,\n }),\n Animated.timing(animatedValue, {\n toValue: 0,\n duration: 800,\n useNativeDriver: true,\n }),\n ])\n ).start();\n return;\n }\n Animated.timing(animatedValue, {\n toValue: 0,\n useNativeDriver: true,\n }).start();\n};\n"],"file":"animation.js"}
1
+ {"version":3,"file":"animation.js","names":["waveAnimation","active","animatedValue","Animated","loop","timing","toValue","duration","easing","Easing","inOut","linear","useNativeDriver","start","pulseAnimation","sequence"],"sources":["../../../../src/components/atoms/Skeleton/animation.ts"],"sourcesContent":["import { Animated, Easing } from 'react-native';\n\nexport const waveAnimation = (\n active: boolean,\n animatedValue: Animated.Value\n): void => {\n if (active) {\n Animated.loop(\n Animated.timing(animatedValue, {\n toValue: 1,\n duration: 1600,\n easing: Easing.inOut(Easing.linear),\n useNativeDriver: true,\n })\n ).start();\n return;\n }\n Animated.timing(animatedValue, {\n toValue: 0,\n useNativeDriver: true,\n }).start();\n};\n\nexport const pulseAnimation = (\n active: boolean,\n animatedValue: Animated.Value\n): void => {\n if (active) {\n Animated.loop(\n Animated.sequence([\n Animated.timing(animatedValue, {\n toValue: 1,\n duration: 800,\n useNativeDriver: true,\n }),\n Animated.timing(animatedValue, {\n toValue: 0,\n duration: 800,\n useNativeDriver: true,\n }),\n ])\n ).start();\n return;\n }\n Animated.timing(animatedValue, {\n toValue: 0,\n useNativeDriver: true,\n }).start();\n};\n"],"mappings":";;;;;;;AAAA;;AAEO,MAAMA,aAAa,GAAG,CAC3BC,MAD2B,EAE3BC,aAF2B,KAGlB;EACT,IAAID,MAAJ,EAAY;IACVE,qBAAA,CAASC,IAAT,CACED,qBAAA,CAASE,MAAT,CAAgBH,aAAhB,EAA+B;MAC7BI,OAAO,EAAE,CADoB;MAE7BC,QAAQ,EAAE,IAFmB;MAG7BC,MAAM,EAAEC,mBAAA,CAAOC,KAAP,CAAaD,mBAAA,CAAOE,MAApB,CAHqB;MAI7BC,eAAe,EAAE;IAJY,CAA/B,CADF,EAOEC,KAPF;;IAQA;EACD;;EACDV,qBAAA,CAASE,MAAT,CAAgBH,aAAhB,EAA+B;IAC7BI,OAAO,EAAE,CADoB;IAE7BM,eAAe,EAAE;EAFY,CAA/B,EAGGC,KAHH;AAID,CAnBM;;;;AAqBA,MAAMC,cAAc,GAAG,CAC5Bb,MAD4B,EAE5BC,aAF4B,KAGnB;EACT,IAAID,MAAJ,EAAY;IACVE,qBAAA,CAASC,IAAT,CACED,qBAAA,CAASY,QAAT,CAAkB,CAChBZ,qBAAA,CAASE,MAAT,CAAgBH,aAAhB,EAA+B;MAC7BI,OAAO,EAAE,CADoB;MAE7BC,QAAQ,EAAE,GAFmB;MAG7BK,eAAe,EAAE;IAHY,CAA/B,CADgB,EAMhBT,qBAAA,CAASE,MAAT,CAAgBH,aAAhB,EAA+B;MAC7BI,OAAO,EAAE,CADoB;MAE7BC,QAAQ,EAAE,GAFmB;MAG7BK,eAAe,EAAE;IAHY,CAA/B,CANgB,CAAlB,CADF,EAaEC,KAbF;;IAcA;EACD;;EACDV,qBAAA,CAASE,MAAT,CAAgBH,aAAhB,EAA+B;IAC7BI,OAAO,EAAE,CADoB;IAE7BM,eAAe,EAAE;EAFY,CAA/B,EAGGC,KAHH;AAID,CAzBM"}
@@ -1,13 +1,23 @@
1
1
  "use strict";
2
2
 
3
- exports.__esModule = true;
4
- exports.SkeletonProps = exports.Skeleton = void 0;
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "Skeleton", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _Skeleton.default;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "SkeletonProps", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _Skeleton.SkeletonProps;
16
+ }
17
+ });
5
18
 
6
19
  var _Skeleton = _interopRequireWildcard(require("./Skeleton"));
7
20
 
8
- exports.Skeleton = _Skeleton.default;
9
- exports.SkeletonProps = _Skeleton.SkeletonProps;
10
-
11
21
  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); }
12
22
 
13
23
  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; }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Skeleton/index.ts"],"names":[],"mappings":";;;;;AAAA","sourcesContent":["export { default as Skeleton, SkeletonProps } from './Skeleton';\n"],"file":"index.js"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/atoms/Skeleton/index.ts"],"sourcesContent":["export { default as Skeleton, SkeletonProps } from './Skeleton';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA"}
@@ -1,27 +1,37 @@
1
1
  "use strict";
2
2
 
3
- exports.__esModule = true;
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
4
6
  exports.Wrapper = void 0;
5
7
 
6
8
  var _native = _interopRequireDefault(require("@emotion/native"));
7
9
 
8
10
  var _reactCore = require("@tecsinapse/react-core");
9
11
 
12
+ var _templateObject;
13
+
10
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
15
 
12
- const Wrapper = _native.default.View`
13
- width: ${({
14
- width
15
- }) => width ? `${(0, _reactCore.RFValueStr)(`${width}px`)}` : '100%'};
16
- height: ${({
17
- height
18
- }) => height ? `${(0, _reactCore.RFValueStr)(`${height}px`)}` : 'auto'};
19
- border-radius: ${({
20
- theme,
21
- radius
22
- }) => radius ? theme.borderRadius[radius] : 0};
23
- overflow: hidden;
24
- position: relative;
25
- `;
16
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
17
+
18
+ const Wrapper = _native.default.View(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: ", ";\n height: ", ";\n border-radius: ", ";\n overflow: hidden;\n position: relative;\n"])), _ref => {
19
+ let {
20
+ width
21
+ } = _ref;
22
+ return width ? "".concat((0, _reactCore.RFValueStr)("".concat(width, "px"))) : '100%';
23
+ }, _ref2 => {
24
+ let {
25
+ height
26
+ } = _ref2;
27
+ return height ? "".concat((0, _reactCore.RFValueStr)("".concat(height, "px"))) : 'auto';
28
+ }, _ref3 => {
29
+ let {
30
+ theme,
31
+ radius
32
+ } = _ref3;
33
+ return radius ? theme.borderRadius[radius] : 0;
34
+ });
35
+
26
36
  exports.Wrapper = Wrapper;
27
37
  //# sourceMappingURL=styled.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Skeleton/styled.ts"],"names":["Wrapper","styled","View","width","height","theme","radius","borderRadius"],"mappings":";;;;;AAAA;;AACA;;;;AAGO,MAAMA,OAAO,GAAGC,gBAAOC,IAA0C;AACxE,WAAW,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAgBA,KAAK,GAAI,GAAE,2BAAY,GAAEA,KAAM,IAApB,CAAyB,EAA/B,GAAmC,MAAQ;AAC3E,YAAY,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAiBA,MAAM,GAAI,GAAE,2BAAY,GAAEA,MAAO,IAArB,CAA0B,EAAhC,GAAoC,MAAQ;AAC/E,mBAAmB,CAAC;AAAEC,EAAAA,KAAF;AAASC,EAAAA;AAAT,CAAD,KACfA,MAAM,GAAGD,KAAK,CAACE,YAAN,CAAmBD,MAAnB,CAAH,GAAgC,CAAE;AAC5C;AACA;AACA,CAPO","sourcesContent":["import styled from '@emotion/native';\nimport { RFValueStr, StyleProps } from '@tecsinapse/react-core';\nimport { SkeletonProps } from './Skeleton';\n\nexport const Wrapper = styled.View<Partial<StyleProps & SkeletonProps>>`\n width: ${({ width }) => (width ? `${RFValueStr(`${width}px`)}` : '100%')};\n height: ${({ height }) => (height ? `${RFValueStr(`${height}px`)}` : 'auto')};\n border-radius: ${({ theme, radius }: StyleProps & Partial<SkeletonProps>) =>\n radius ? theme.borderRadius[radius] : 0};\n overflow: hidden;\n position: relative;\n`;\n"],"file":"styled.js"}
1
+ {"version":3,"file":"styled.js","names":["Wrapper","styled","View","width","RFValueStr","height","theme","radius","borderRadius"],"sources":["../../../../src/components/atoms/Skeleton/styled.ts"],"sourcesContent":["import styled from '@emotion/native';\nimport { RFValueStr, StyleProps } from '@tecsinapse/react-core';\nimport { SkeletonProps } from './Skeleton';\n\nexport const Wrapper = styled.View<Partial<StyleProps & SkeletonProps>>`\n width: ${({ width }) => (width ? `${RFValueStr(`${width}px`)}` : '100%')};\n height: ${({ height }) => (height ? `${RFValueStr(`${height}px`)}` : 'auto')};\n border-radius: ${({ theme, radius }: StyleProps & Partial<SkeletonProps>) =>\n radius ? theme.borderRadius[radius] : 0};\n overflow: hidden;\n position: relative;\n`;\n"],"mappings":";;;;;;;AAAA;;AACA;;;;;;;;AAGO,MAAMA,OAAO,GAAGC,eAAA,CAAOC,IAAV,6KACT;EAAA,IAAC;IAAEC;EAAF,CAAD;EAAA,OAAgBA,KAAK,aAAM,IAAAC,qBAAA,YAAcD,KAAd,QAAN,IAAmC,MAAxD;AAAA,CADS,EAER;EAAA,IAAC;IAAEE;EAAF,CAAD;EAAA,OAAiBA,MAAM,aAAM,IAAAD,qBAAA,YAAcC,MAAd,QAAN,IAAoC,MAA3D;AAAA,CAFQ,EAGD;EAAA,IAAC;IAAEC,KAAF;IAASC;EAAT,CAAD;EAAA,OACfA,MAAM,GAAGD,KAAK,CAACE,YAAN,CAAmBD,MAAnB,CAAH,GAAgC,CADvB;AAAA,CAHC,CAAb"}
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
2
 
3
- exports.__esModule = true;
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
4
6
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"types.js"}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../src/components/atoms/Skeleton/types.ts"],"sourcesContent":["export type ChildrenLayout = {\n width: number;\n height: number;\n x: number;\n y: number;\n};\n\nexport interface IAnimationComponent {\n width?: number;\n height?: number;\n active?: boolean;\n childrenLayout: ChildrenLayout;\n}\n"],"mappings":""}
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
 
3
- exports.__esModule = true;
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
4
6
  exports.default = void 0;
5
7
 
6
8
  var React = _interopRequireWildcard(require("react"));
@@ -15,15 +17,16 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
15
17
 
16
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; }
17
19
 
18
- function _extends() { _extends = Object.assign || 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); }
20
+ 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); }
19
21
 
20
- const SnappingSlider = ({
21
- children,
22
- showAmount,
23
- scrollAmount,
24
- spacing,
25
- ...rest
26
- }) => {
22
+ const SnappingSlider = _ref => {
23
+ let {
24
+ children,
25
+ showAmount,
26
+ scrollAmount,
27
+ spacing,
28
+ ...rest
29
+ } = _ref;
27
30
  const theme = (0, _react2.useTheme)();
28
31
  const childCount = React.Children.count(children);
29
32
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/SnappingSlider/SnappingSlider.tsx"],"names":["SnappingSlider","children","showAmount","scrollAmount","spacing","rest","theme","childCount","React","Children","count","screenWidth","Dimensions","get","width","totalSlideWidth","Math","round","horizontalPadding","snapToOffsets","Array","ceil","keys","map","index","offset","padCompensation","sign","child","isFirst","isLast","paddingHorizontal","paddingLeft","paddingRight"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAKA;;;;;;;;AAuBA,MAAMA,cAA6C,GAAG,CAAC;AACrDC,EAAAA,QADqD;AAErDC,EAAAA,UAFqD;AAGrDC,EAAAA,YAHqD;AAIrDC,EAAAA,OAJqD;AAKrD,KAAGC;AALkD,CAAD,KAMhD;AACJ,QAAMC,KAAK,GAAG,uBAAd;AAEA,QAAMC,UAAU,GAAGC,KAAK,CAACC,QAAN,CAAeC,KAAf,CAAqBT,QAArB,CAAnB;;AACA,QAAMU,WAAW,GAAGC,wBAAWC,GAAX,CAAe,QAAf,EAAyBC,KAA7C;;AACA,QAAMC,eAAe,GAAGC,IAAI,CAACC,KAAL,CAAWN,WAAW,GAAGT,UAAzB,CAAxB;AACA,QAAMgB,iBAAiB,GAAGd,OAAO,GAC7B,yCAAyBE,KAAK,CAACF,OAAN,CAAcA,OAAd,CAAzB,IAAmD,CADtB,GAE7B,CAFJ;AAIA,QAAMe,aAAa,GAAG,CACpB,GAAGC,KAAK,CAACJ,IAAI,CAACK,IAAL,CAAUd,UAAU,GAAGJ,YAAvB,CAAD,CAAL,CAA4CmB,IAA5C,EADiB,EAEpBC,GAFoB,CAEhBC,KAAK,IAAI;AACb,UAAMC,MAAM,GAAGV,eAAe,GAAGZ,YAAlB,GAAiCqB,KAAhD;AACA,UAAME,eAAe,GAAGR,iBAAiB,GAAGF,IAAI,CAACW,IAAL,CAAUH,KAAV,CAA5C;AACA,WAAOC,MAAM,GAAGC,eAAhB;AACD,GANqB,CAAtB;AAQA,SACE,oBAAC,uBAAD;AACE,IAAA,UAAU,MADZ;AAEE,IAAA,aAAa,EAAEP,aAFjB;AAGE,IAAA,WAAW,MAHb;AAIE,IAAA,SAAS,MAJX;AAKE,IAAA,8BAA8B,EAAE;AALlC,KAMMd,IANN,GAQGG,KAAK,CAACC,QAAN,CAAec,GAAf,CAAmBtB,QAAnB,EAA6B,CAAC2B,KAAD,EAAQJ,KAAR,KAAkB;AAC9C,UAAMK,OAAO,GAAGL,KAAK,KAAK,CAA1B;AACA,UAAMM,MAAM,GAAGN,KAAK,KAAKjB,UAAU,GAAG,CAAtC;AAEA,WACE,oBAAC,iBAAD;AACE,MAAA,KAAK,EAAE;AACLO,QAAAA,KAAK,EAAEC,eADF;AAELgB,QAAAA,iBAAiB,EAAEb,iBAFd;AAGLc,QAAAA,WAAW,EAAEH,OAAO,GAAG,CAAH,GAAOX,iBAHtB;AAILe,QAAAA,YAAY,EAAEH,MAAM,GAAG,CAAH,GAAOZ;AAJtB;AADT,OAQGU,KARH,CADF;AAYD,GAhBA,CARH,CADF;AA4BD,CApDD;;eAsDe5B,c","sourcesContent":["import * as React from 'react';\nimport { Dimensions, ScrollView, ScrollViewProps, View } from 'react-native';\nimport {\n extractNumbersFromString,\n SpacingType,\n ThemeProp,\n} from '@tecsinapse/react-core';\nimport { useTheme } from '@emotion/react';\n\nexport interface SnappingSliderProps\n extends Omit<ScrollViewProps, 'horizontal' | 'snapToOffsets'> {\n /**\n * Amount in screen elements.\n * Should never be lower than scrollAmount, otherwise some elements will be skipped.\n */\n showAmount: number;\n\n /**\n * Amount of items to scroll within a single swipe.\n * Should never be greater than showAmount, otherwise some elements will be skipped.\n */\n scrollAmount: number;\n\n /**\n * Spacing between elements.\n * Must be one of [nano, micro, mili, centi, deca, kilo, mega, giga, tera, peta, hexa]\n */\n spacing?: SpacingType;\n}\n\nconst SnappingSlider: React.FC<SnappingSliderProps> = ({\n children,\n showAmount,\n scrollAmount,\n spacing,\n ...rest\n}) => {\n const theme = useTheme() as ThemeProp;\n\n const childCount = React.Children.count(children);\n const screenWidth = Dimensions.get('window').width;\n const totalSlideWidth = Math.round(screenWidth / showAmount);\n const horizontalPadding = spacing\n ? extractNumbersFromString(theme.spacing[spacing]) / 2\n : 0;\n\n const snapToOffsets = [\n ...Array(Math.ceil(childCount / scrollAmount)).keys(),\n ].map(index => {\n const offset = totalSlideWidth * scrollAmount * index;\n const padCompensation = horizontalPadding * Math.sign(index);\n return offset + padCompensation;\n });\n\n return (\n <ScrollView\n horizontal\n snapToOffsets={snapToOffsets}\n snapToStart\n snapToEnd\n showsHorizontalScrollIndicator={false}\n {...rest}\n >\n {React.Children.map(children, (child, index) => {\n const isFirst = index === 0;\n const isLast = index === childCount - 1;\n\n return (\n <View\n style={{\n width: totalSlideWidth,\n paddingHorizontal: horizontalPadding,\n paddingLeft: isFirst ? 0 : horizontalPadding,\n paddingRight: isLast ? 0 : horizontalPadding,\n }}\n >\n {child}\n </View>\n );\n })}\n </ScrollView>\n );\n};\n\nexport default SnappingSlider;\n"],"file":"SnappingSlider.js"}
1
+ {"version":3,"file":"SnappingSlider.js","names":["SnappingSlider","children","showAmount","scrollAmount","spacing","rest","theme","useTheme","childCount","React","Children","count","screenWidth","Dimensions","get","width","totalSlideWidth","Math","round","horizontalPadding","extractNumbersFromString","snapToOffsets","Array","ceil","keys","map","index","offset","padCompensation","sign","child","isFirst","isLast","paddingHorizontal","paddingLeft","paddingRight"],"sources":["../../../../src/components/atoms/SnappingSlider/SnappingSlider.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Dimensions, ScrollView, ScrollViewProps, View } from 'react-native';\nimport {\n extractNumbersFromString,\n SpacingType,\n ThemeProp,\n} from '@tecsinapse/react-core';\nimport { useTheme } from '@emotion/react';\n\nexport interface SnappingSliderProps\n extends Omit<ScrollViewProps, 'horizontal' | 'snapToOffsets'> {\n /**\n * Amount in screen elements.\n * Should never be lower than scrollAmount, otherwise some elements will be skipped.\n */\n showAmount: number;\n\n /**\n * Amount of items to scroll within a single swipe.\n * Should never be greater than showAmount, otherwise some elements will be skipped.\n */\n scrollAmount: number;\n\n /**\n * Spacing between elements.\n * Must be one of [nano, micro, mili, centi, deca, kilo, mega, giga, tera, peta, hexa]\n */\n spacing?: SpacingType;\n}\n\nconst SnappingSlider: React.FC<SnappingSliderProps> = ({\n children,\n showAmount,\n scrollAmount,\n spacing,\n ...rest\n}) => {\n const theme = useTheme() as ThemeProp;\n\n const childCount = React.Children.count(children);\n const screenWidth = Dimensions.get('window').width;\n const totalSlideWidth = Math.round(screenWidth / showAmount);\n const horizontalPadding = spacing\n ? extractNumbersFromString(theme.spacing[spacing]) / 2\n : 0;\n\n const snapToOffsets = [\n ...Array(Math.ceil(childCount / scrollAmount)).keys(),\n ].map(index => {\n const offset = totalSlideWidth * scrollAmount * index;\n const padCompensation = horizontalPadding * Math.sign(index);\n return offset + padCompensation;\n });\n\n return (\n <ScrollView\n horizontal\n snapToOffsets={snapToOffsets}\n snapToStart\n snapToEnd\n showsHorizontalScrollIndicator={false}\n {...rest}\n >\n {React.Children.map(children, (child, index) => {\n const isFirst = index === 0;\n const isLast = index === childCount - 1;\n\n return (\n <View\n style={{\n width: totalSlideWidth,\n paddingHorizontal: horizontalPadding,\n paddingLeft: isFirst ? 0 : horizontalPadding,\n paddingRight: isLast ? 0 : horizontalPadding,\n }}\n >\n {child}\n </View>\n );\n })}\n </ScrollView>\n );\n};\n\nexport default SnappingSlider;\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAKA;;;;;;;;AAuBA,MAAMA,cAA6C,GAAG,QAMhD;EAAA,IANiD;IACrDC,QADqD;IAErDC,UAFqD;IAGrDC,YAHqD;IAIrDC,OAJqD;IAKrD,GAAGC;EALkD,CAMjD;EACJ,MAAMC,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,MAAMC,UAAU,GAAGC,KAAK,CAACC,QAAN,CAAeC,KAAf,CAAqBV,QAArB,CAAnB;;EACA,MAAMW,WAAW,GAAGC,uBAAA,CAAWC,GAAX,CAAe,QAAf,EAAyBC,KAA7C;;EACA,MAAMC,eAAe,GAAGC,IAAI,CAACC,KAAL,CAAWN,WAAW,GAAGV,UAAzB,CAAxB;EACA,MAAMiB,iBAAiB,GAAGf,OAAO,GAC7B,IAAAgB,mCAAA,EAAyBd,KAAK,CAACF,OAAN,CAAcA,OAAd,CAAzB,IAAmD,CADtB,GAE7B,CAFJ;EAIA,MAAMiB,aAAa,GAAG,CACpB,GAAGC,KAAK,CAACL,IAAI,CAACM,IAAL,CAAUf,UAAU,GAAGL,YAAvB,CAAD,CAAL,CAA4CqB,IAA5C,EADiB,EAEpBC,GAFoB,CAEhBC,KAAK,IAAI;IACb,MAAMC,MAAM,GAAGX,eAAe,GAAGb,YAAlB,GAAiCuB,KAAhD;IACA,MAAME,eAAe,GAAGT,iBAAiB,GAAGF,IAAI,CAACY,IAAL,CAAUH,KAAV,CAA5C;IACA,OAAOC,MAAM,GAAGC,eAAhB;EACD,CANqB,CAAtB;EAQA,OACE,oBAAC,uBAAD;IACE,UAAU,MADZ;IAEE,aAAa,EAAEP,aAFjB;IAGE,WAAW,MAHb;IAIE,SAAS,MAJX;IAKE,8BAA8B,EAAE;EALlC,GAMMhB,IANN,GAQGI,KAAK,CAACC,QAAN,CAAee,GAAf,CAAmBxB,QAAnB,EAA6B,CAAC6B,KAAD,EAAQJ,KAAR,KAAkB;IAC9C,MAAMK,OAAO,GAAGL,KAAK,KAAK,CAA1B;IACA,MAAMM,MAAM,GAAGN,KAAK,KAAKlB,UAAU,GAAG,CAAtC;IAEA,OACE,oBAAC,iBAAD;MACE,KAAK,EAAE;QACLO,KAAK,EAAEC,eADF;QAELiB,iBAAiB,EAAEd,iBAFd;QAGLe,WAAW,EAAEH,OAAO,GAAG,CAAH,GAAOZ,iBAHtB;QAILgB,YAAY,EAAEH,MAAM,GAAG,CAAH,GAAOb;MAJtB;IADT,GAQGW,KARH,CADF;EAYD,CAhBA,CARH,CADF;AA4BD,CApDD;;eAsDe9B,c"}
@@ -1,13 +1,23 @@
1
1
  "use strict";
2
2
 
3
- exports.__esModule = true;
4
- exports.SnappingSliderProps = exports.SnappingSlider = void 0;
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "SnappingSlider", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _SnappingSlider.default;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "SnappingSliderProps", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _SnappingSlider.SnappingSliderProps;
16
+ }
17
+ });
5
18
 
6
19
  var _SnappingSlider = _interopRequireWildcard(require("./SnappingSlider"));
7
20
 
8
- exports.SnappingSlider = _SnappingSlider.default;
9
- exports.SnappingSliderProps = _SnappingSlider.SnappingSliderProps;
10
-
11
21
  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); }
12
22
 
13
23
  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; }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/SnappingSlider/index.ts"],"names":[],"mappings":";;;;;AAAA","sourcesContent":["export {\n default as SnappingSlider,\n SnappingSliderProps,\n} from './SnappingSlider';\n"],"file":"index.js"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/atoms/SnappingSlider/index.ts"],"sourcesContent":["export {\n default as SnappingSlider,\n SnappingSliderProps,\n} from './SnappingSlider';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA"}