@tecsinapse/react-core 1.15.0 → 1.16.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 (250) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/components/atoms/Avatar/Avatar.js +1 -3
  3. package/dist/components/atoms/Avatar/Avatar.js.map +1 -1
  4. package/dist/components/atoms/Avatar/helpers.js +1 -3
  5. package/dist/components/atoms/Avatar/helpers.js.map +1 -1
  6. package/dist/components/atoms/Avatar/index.js +5 -15
  7. package/dist/components/atoms/Avatar/index.js.map +1 -1
  8. package/dist/components/atoms/Avatar/styled.js +1 -3
  9. package/dist/components/atoms/Avatar/styled.js.map +1 -1
  10. package/dist/components/atoms/Badge/Badge.js +1 -3
  11. package/dist/components/atoms/Badge/Badge.js.map +1 -1
  12. package/dist/components/atoms/Badge/index.js +5 -15
  13. package/dist/components/atoms/Badge/index.js.map +1 -1
  14. package/dist/components/atoms/Badge/styled.js +1 -3
  15. package/dist/components/atoms/Badge/styled.js.map +1 -1
  16. package/dist/components/atoms/BoxContent/BoxContent.js +1 -3
  17. package/dist/components/atoms/BoxContent/BoxContent.js.map +1 -1
  18. package/dist/components/atoms/BoxContent/index.js +5 -15
  19. package/dist/components/atoms/BoxContent/index.js.map +1 -1
  20. package/dist/components/atoms/BoxContent/styled.js +2 -4
  21. package/dist/components/atoms/BoxContent/styled.js.map +1 -1
  22. package/dist/components/atoms/Button/Button.js +1 -3
  23. package/dist/components/atoms/Button/Button.js.map +1 -1
  24. package/dist/components/atoms/Button/States/BaseState.js +1 -3
  25. package/dist/components/atoms/Button/States/BaseState.js.map +1 -1
  26. package/dist/components/atoms/Button/States/Error.js +1 -3
  27. package/dist/components/atoms/Button/States/Error.js.map +1 -1
  28. package/dist/components/atoms/Button/States/Loading.js +1 -3
  29. package/dist/components/atoms/Button/States/Loading.js.map +1 -1
  30. package/dist/components/atoms/Button/States/Success.js +1 -3
  31. package/dist/components/atoms/Button/States/Success.js.map +1 -1
  32. package/dist/components/atoms/Button/States/index.js +8 -21
  33. package/dist/components/atoms/Button/States/index.js.map +1 -1
  34. package/dist/components/atoms/Button/States/styled.js +1 -3
  35. package/dist/components/atoms/Button/States/styled.js.map +1 -1
  36. package/dist/components/atoms/Button/index.js +12 -51
  37. package/dist/components/atoms/Button/index.js.map +1 -1
  38. package/dist/components/atoms/Button/styled.js +1 -3
  39. package/dist/components/atoms/Button/styled.js.map +1 -1
  40. package/dist/components/atoms/Card/Card.js +1 -3
  41. package/dist/components/atoms/Card/Card.js.map +1 -1
  42. package/dist/components/atoms/Card/Footer/Footer.js +1 -3
  43. package/dist/components/atoms/Card/Footer/Footer.js.map +1 -1
  44. package/dist/components/atoms/Card/Footer/index.js +5 -15
  45. package/dist/components/atoms/Card/Footer/index.js.map +1 -1
  46. package/dist/components/atoms/Card/Header/Header.js +1 -3
  47. package/dist/components/atoms/Card/Header/Header.js.map +1 -1
  48. package/dist/components/atoms/Card/Header/index.js +5 -15
  49. package/dist/components/atoms/Card/Header/index.js.map +1 -1
  50. package/dist/components/atoms/Card/index.js +5 -15
  51. package/dist/components/atoms/Card/index.js.map +1 -1
  52. package/dist/components/atoms/Card/styled.js +1 -3
  53. package/dist/components/atoms/Card/styled.js.map +1 -1
  54. package/dist/components/atoms/Checkbox/Checkbox.js +1 -3
  55. package/dist/components/atoms/Checkbox/Checkbox.js.map +1 -1
  56. package/dist/components/atoms/Checkbox/index.js +5 -15
  57. package/dist/components/atoms/Checkbox/index.js.map +1 -1
  58. package/dist/components/atoms/Checkbox/styled.js +1 -3
  59. package/dist/components/atoms/Checkbox/styled.js.map +1 -1
  60. package/dist/components/atoms/Divider/Divider.js +1 -3
  61. package/dist/components/atoms/Divider/Divider.js.map +1 -1
  62. package/dist/components/atoms/Divider/index.js +5 -15
  63. package/dist/components/atoms/Divider/index.js.map +1 -1
  64. package/dist/components/atoms/Divider/styled.js +1 -3
  65. package/dist/components/atoms/Divider/styled.js.map +1 -1
  66. package/dist/components/atoms/GroupButton/GroupButton.js +7 -9
  67. package/dist/components/atoms/GroupButton/GroupButton.js.map +1 -1
  68. package/dist/components/atoms/GroupButton/GroupButtonOption.js +1 -3
  69. package/dist/components/atoms/GroupButton/GroupButtonOption.js.map +1 -1
  70. package/dist/components/atoms/GroupButton/index.js +9 -33
  71. package/dist/components/atoms/GroupButton/index.js.map +1 -1
  72. package/dist/components/atoms/GroupButton/styled.js +12 -14
  73. package/dist/components/atoms/GroupButton/styled.js.map +1 -1
  74. package/dist/components/atoms/Icon/Icon.js +1 -3
  75. package/dist/components/atoms/Icon/Icon.js.map +1 -1
  76. package/dist/components/atoms/Icon/helpers.js +1 -3
  77. package/dist/components/atoms/Icon/helpers.js.map +1 -1
  78. package/dist/components/atoms/Icon/index.js +5 -15
  79. package/dist/components/atoms/Icon/index.js.map +1 -1
  80. package/dist/components/atoms/Input/Hint.js +1 -3
  81. package/dist/components/atoms/Input/Hint.js.map +1 -1
  82. package/dist/components/atoms/Input/InputContainer/InputContainer.js +1 -3
  83. package/dist/components/atoms/Input/InputContainer/InputContainer.js.map +1 -1
  84. package/dist/components/atoms/Input/InputElement/InputElement.d.ts +2 -5
  85. package/dist/components/atoms/Input/InputElement/InputElement.js +5 -49
  86. package/dist/components/atoms/Input/InputElement/InputElement.js.map +1 -1
  87. package/dist/components/atoms/Input/InputMaskElement/InputMaskElement.d.ts +17 -0
  88. package/dist/components/atoms/Input/InputMaskElement/InputMaskElement.js +84 -0
  89. package/dist/components/atoms/Input/InputMaskElement/InputMaskElement.js.map +1 -0
  90. package/dist/components/atoms/Input/PressableInputContainer/PressableInputContainer.js +1 -3
  91. package/dist/components/atoms/Input/PressableInputContainer/PressableInputContainer.js.map +1 -1
  92. package/dist/components/atoms/Input/PressableInputContainer/index.js +5 -15
  93. package/dist/components/atoms/Input/PressableInputContainer/index.js.map +1 -1
  94. package/dist/components/atoms/Input/PressableInputContainer/styled.js +1 -3
  95. package/dist/components/atoms/Input/PressableInputContainer/styled.js.map +1 -1
  96. package/dist/components/atoms/Input/hooks/useInputFocus.js +1 -3
  97. package/dist/components/atoms/Input/hooks/useInputFocus.js.map +1 -1
  98. package/dist/components/atoms/Input/hooks/useNumberMask.js +3 -5
  99. package/dist/components/atoms/Input/hooks/useNumberMask.js.map +1 -1
  100. package/dist/components/atoms/Input/hooks/useStringMask.js +3 -5
  101. package/dist/components/atoms/Input/hooks/useStringMask.js.map +1 -1
  102. package/dist/components/atoms/Input/index.d.ts +1 -0
  103. package/dist/components/atoms/Input/index.js +28 -82
  104. package/dist/components/atoms/Input/index.js.map +1 -1
  105. package/dist/components/atoms/Input/styled.js +4 -6
  106. package/dist/components/atoms/Input/styled.js.map +1 -1
  107. package/dist/components/atoms/Paper/Paper.js +1 -3
  108. package/dist/components/atoms/Paper/Paper.js.map +1 -1
  109. package/dist/components/atoms/Paper/index.js +5 -15
  110. package/dist/components/atoms/Paper/index.js.map +1 -1
  111. package/dist/components/atoms/Paper/styled.js +1 -3
  112. package/dist/components/atoms/Paper/styled.js.map +1 -1
  113. package/dist/components/atoms/PressableSurface/PressableSurface.js +1 -3
  114. package/dist/components/atoms/PressableSurface/PressableSurface.js.map +1 -1
  115. package/dist/components/atoms/PressableSurface/index.js +5 -15
  116. package/dist/components/atoms/PressableSurface/index.js.map +1 -1
  117. package/dist/components/atoms/ProgressBar/ProgressBar.js +4 -8
  118. package/dist/components/atoms/ProgressBar/ProgressBar.js.map +1 -1
  119. package/dist/components/atoms/ProgressBar/index.js +5 -15
  120. package/dist/components/atoms/ProgressBar/index.js.map +1 -1
  121. package/dist/components/atoms/ProgressBar/styled.js +1 -3
  122. package/dist/components/atoms/ProgressBar/styled.js.map +1 -1
  123. package/dist/components/atoms/RadioButton/RadioButton.js +1 -3
  124. package/dist/components/atoms/RadioButton/RadioButton.js.map +1 -1
  125. package/dist/components/atoms/RadioButton/index.js +5 -15
  126. package/dist/components/atoms/RadioButton/index.js.map +1 -1
  127. package/dist/components/atoms/RadioButton/styled.js +1 -3
  128. package/dist/components/atoms/RadioButton/styled.js.map +1 -1
  129. package/dist/components/atoms/Switch/Switch.js +1 -3
  130. package/dist/components/atoms/Switch/Switch.js.map +1 -1
  131. package/dist/components/atoms/Switch/animation.js +1 -3
  132. package/dist/components/atoms/Switch/animation.js.map +1 -1
  133. package/dist/components/atoms/Switch/index.js +5 -15
  134. package/dist/components/atoms/Switch/index.js.map +1 -1
  135. package/dist/components/atoms/Switch/styled.js +1 -3
  136. package/dist/components/atoms/Switch/styled.js.map +1 -1
  137. package/dist/components/atoms/Tag/Tag.js +2 -4
  138. package/dist/components/atoms/Tag/Tag.js.map +1 -1
  139. package/dist/components/atoms/Tag/index.js +5 -15
  140. package/dist/components/atoms/Tag/index.js.map +1 -1
  141. package/dist/components/atoms/Tag/styled.js +1 -3
  142. package/dist/components/atoms/Tag/styled.js.map +1 -1
  143. package/dist/components/atoms/Text/Text.js +1 -3
  144. package/dist/components/atoms/Text/Text.js.map +1 -1
  145. package/dist/components/atoms/Text/index.js +5 -15
  146. package/dist/components/atoms/Text/index.js.map +1 -1
  147. package/dist/components/atoms/Text/styled.js +1 -3
  148. package/dist/components/atoms/Text/styled.js.map +1 -1
  149. package/dist/components/atoms/shared/PaperAndCard.js +1 -3
  150. package/dist/components/atoms/shared/PaperAndCard.js.map +1 -1
  151. package/dist/components/molecules/Calendar/Calendar.js +3 -5
  152. package/dist/components/molecules/Calendar/Calendar.js.map +1 -1
  153. package/dist/components/molecules/Calendar/components/MonthWeek.js +4 -6
  154. package/dist/components/molecules/Calendar/components/MonthWeek.js.map +1 -1
  155. package/dist/components/molecules/Calendar/components/Weekdays.js +1 -3
  156. package/dist/components/molecules/Calendar/components/Weekdays.js.map +1 -1
  157. package/dist/components/molecules/Calendar/components/index.js +6 -15
  158. package/dist/components/molecules/Calendar/components/index.js.map +1 -1
  159. package/dist/components/molecules/Calendar/index.js +8 -33
  160. package/dist/components/molecules/Calendar/index.js.map +1 -1
  161. package/dist/components/molecules/Calendar/styled.js +4 -6
  162. package/dist/components/molecules/Calendar/styled.js.map +1 -1
  163. package/dist/components/molecules/DatePicker/DatePicker.js +1 -3
  164. package/dist/components/molecules/DatePicker/DatePicker.js.map +1 -1
  165. package/dist/components/molecules/DatePicker/index.js +5 -15
  166. package/dist/components/molecules/DatePicker/index.js.map +1 -1
  167. package/dist/components/molecules/DatePicker/styled.js +2 -4
  168. package/dist/components/molecules/DatePicker/styled.js.map +1 -1
  169. package/dist/components/molecules/DateTimePicker/DateTimePicker.js +2 -4
  170. package/dist/components/molecules/DateTimePicker/DateTimePicker.js.map +1 -1
  171. package/dist/components/molecules/DateTimePicker/index.js +5 -15
  172. package/dist/components/molecules/DateTimePicker/index.js.map +1 -1
  173. package/dist/components/molecules/DateTimePicker/styled.js +1 -3
  174. package/dist/components/molecules/DateTimePicker/styled.js.map +1 -1
  175. package/dist/components/molecules/DateTimeSelector/DateTimeSelector.js +2 -4
  176. package/dist/components/molecules/DateTimeSelector/DateTimeSelector.js.map +1 -1
  177. package/dist/components/molecules/DateTimeSelector/Selector.js +1 -3
  178. package/dist/components/molecules/DateTimeSelector/Selector.js.map +1 -1
  179. package/dist/components/molecules/DateTimeSelector/index.js +6 -21
  180. package/dist/components/molecules/DateTimeSelector/index.js.map +1 -1
  181. package/dist/components/molecules/DateTimeSelector/styled.js +1 -3
  182. package/dist/components/molecules/DateTimeSelector/styled.js.map +1 -1
  183. package/dist/components/molecules/Grid/Grid.js +3 -5
  184. package/dist/components/molecules/Grid/Grid.js.map +1 -1
  185. package/dist/components/molecules/Grid/Item/Item.js +4 -6
  186. package/dist/components/molecules/Grid/Item/Item.js.map +1 -1
  187. package/dist/components/molecules/Grid/Item/index.js +5 -15
  188. package/dist/components/molecules/Grid/Item/index.js.map +1 -1
  189. package/dist/components/molecules/Grid/index.js +8 -27
  190. package/dist/components/molecules/Grid/index.js.map +1 -1
  191. package/dist/components/molecules/HintInputContainer/HintInputContainer.js +1 -3
  192. package/dist/components/molecules/HintInputContainer/HintInputContainer.js.map +1 -1
  193. package/dist/components/molecules/HintInputContainer/index.js +4 -9
  194. package/dist/components/molecules/HintInputContainer/index.js.map +1 -1
  195. package/dist/components/molecules/InputPassword/InputPasswordIcon.js +1 -3
  196. package/dist/components/molecules/InputPassword/InputPasswordIcon.js.map +1 -1
  197. package/dist/components/molecules/InputPassword/index.js +4 -9
  198. package/dist/components/molecules/InputPassword/index.js.map +1 -1
  199. package/dist/components/molecules/InputPassword/styled.js +1 -3
  200. package/dist/components/molecules/InputPassword/styled.js.map +1 -1
  201. package/dist/components/molecules/Snackbar/Snackbar.js +3 -5
  202. package/dist/components/molecules/Snackbar/Snackbar.js.map +1 -1
  203. package/dist/components/molecules/Snackbar/index.js +5 -15
  204. package/dist/components/molecules/Snackbar/index.js.map +1 -1
  205. package/dist/components/molecules/Snackbar/styled.js +1 -3
  206. package/dist/components/molecules/Snackbar/styled.js.map +1 -1
  207. package/dist/components/molecules/TextArea/TextArea.js +1 -3
  208. package/dist/components/molecules/TextArea/TextArea.js.map +1 -1
  209. package/dist/components/molecules/TextArea/index.js +7 -21
  210. package/dist/components/molecules/TextArea/index.js.map +1 -1
  211. package/dist/components/molecules/TextArea/styled.js +1 -3
  212. package/dist/components/molecules/TextArea/styled.js.map +1 -1
  213. package/dist/hooks/index.js +6 -15
  214. package/dist/hooks/index.js.map +1 -1
  215. package/dist/hooks/useDebouncedState.js +1 -3
  216. package/dist/hooks/useDebouncedState.js.map +1 -1
  217. package/dist/hooks/useTheme.js +1 -3
  218. package/dist/hooks/useTheme.js.map +1 -1
  219. package/dist/index.d.ts +1 -1
  220. package/dist/index.js +123 -531
  221. package/dist/index.js.map +1 -1
  222. package/dist/styles/ThemeProvider.js +1 -3
  223. package/dist/styles/ThemeProvider.js.map +1 -1
  224. package/dist/styles/definitions.js +1 -3
  225. package/dist/styles/definitions.js.map +1 -1
  226. package/dist/styles/light.js +1 -3
  227. package/dist/styles/light.js.map +1 -1
  228. package/dist/types/defaults.js +1 -3
  229. package/dist/utils/IPhoneXHelper.js +1 -3
  230. package/dist/utils/IPhoneXHelper.js.map +1 -1
  231. package/dist/utils/ResponsiveFontSize.js +1 -3
  232. package/dist/utils/ResponsiveFontSize.js.map +1 -1
  233. package/dist/utils/extractNumbersFromString.js +1 -3
  234. package/dist/utils/extractNumbersFromString.js.map +1 -1
  235. package/dist/utils/formatWithMask.js +1 -3
  236. package/dist/utils/formatWithMask.js.map +1 -1
  237. package/dist/utils/index.js +11 -45
  238. package/dist/utils/index.js.map +1 -1
  239. package/dist/utils/lightenDarkenColor.js +1 -3
  240. package/dist/utils/lightenDarkenColor.js.map +1 -1
  241. package/dist/utils/masks.js +3 -5
  242. package/dist/utils/masks.js.map +1 -1
  243. package/package.json +6 -6
  244. package/src/components/atoms/Input/InputElement/InputElement.tsx +5 -74
  245. package/src/components/atoms/Input/InputMaskElement/InputMaskElement.tsx +120 -0
  246. package/src/components/atoms/Input/hooks/useNumberMask.ts +1 -1
  247. package/src/components/atoms/Input/index.ts +4 -0
  248. package/src/components/atoms/Input/styled.ts +1 -1
  249. package/src/components/atoms/ProgressBar/ProgressBar.tsx +2 -1
  250. package/src/index.ts +2 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/ProgressBar/ProgressBar.tsx"],"names":["ProgressBar","segments","_segments","valueMin","valueNow","_valueNow","valueMax","color","colorTone","animate","animationParameters","rest","theme","totalProgress","Math","max","segmentWidth","items","Array","keys","segmentsRender","map","index","animationValue","React","useRef","Animated","Value","current","min","minmax","width","progressPercent","timing","toValue","duration","length","useNativeDriver","delay","direction","start","rangeAnimation","interpolate","inputRange","outputRange","borderRightWidth","backgroundColor"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAMA;;AACA;;;;;;AAqBA,MAAMA,WAAuC,GAAG,CAAC;AAC/CC,EAAAA,QAAQ,EAAEC,SAAS,GAAG,CADyB;AAE/CC,EAAAA,QAAQ,GAAG,CAFoC;AAG/CC,EAAAA,QAAQ,EAAEC,SAHqC;AAI/CC,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ELc,QAAAA,eAAe,EAAElC,KAAK,CAACL,KAAN,CAAYA,KAAZ,EAAmBC,SAAnB,CAFZ;AAGLqC,QAAAA,gBAAgB,EAAEd,KAAK,GAAG,CAAR,IAAaA,KAAK,GAAG,GAArB,GAA2B,CAA3B,GAA+B;AAH5C;AADT,MANF,CADF;AAgBD,GAjDsB,CAAvB;AAmDA,SAAO,oBAAC,iBAAD,EAAepB,IAAf,EAAsBS,cAAtB,CAAP;AACD,CA5ED;;eA8EepB,W","sourcesContent":["import { useTheme } from '@emotion/react';\nimport * as React from 'react';\nimport { Animated, ViewProps } from 'react-native';\nimport {\n ColorGradationType,\n ColorType,\n ThemeProp\n} from '../../../types/defaults';\nimport { extractNumbersFromString } from '../../../utils';\nimport { Container, Progress, Segment } from './styled';\n\nexport interface ProgressBarProps extends ViewProps {\n /** Number of segments. Defaults to 1. Set to 1 when 0 or less */\n segments?: number;\n /** Minimum possible value (0% of the bar). Defaults to 0 */\n valueMin?: number;\n /** Maximum possible value (100% of the bar). Defaults to 100 */\n valueMax?: number;\n /** Current value */\n valueNow: number | string;\n /** Filled partition color. Defaults to 'primary' */\n color?: ColorType;\n /** Filled partition color tone. Defaults to 'medium' */\n colorTone?: ColorGradationType;\n /** Animation */\n animate: boolean;\n /** Parameters animation */\n animationParameters?: { direction: 'left' | 'right'; duration: number };\n}\n\nconst ProgressBar: React.FC<ProgressBarProps> = ({\n segments: _segments = 1,\n valueMin = 0,\n valueNow: _valueNow,\n valueMax = 100,\n color = 'primary',\n colorTone = 'medium',\n animate,\n animationParameters,\n ...rest\n}) => {\n const theme = useTheme() as ThemeProp;\n\n const valueNow =\n typeof _valueNow === 'string'\n ? extractNumbersFromString(_valueNow)\n : _valueNow;\n\n const totalProgress = ((valueNow - valueMin) / (valueMax - valueMin)) * 100;\n const segments = Math.max(1, _segments);\n const segmentWidth = 100 / Math.max(segments);\n\n const items = [...Array(segments).keys()];\n\n const segmentsRender = items.map(index => {\n const animationValue = React.useRef(new Animated.Value(0)).current;\n\n const max = segmentWidth * (index + 1);\n const min = segmentWidth * index;\n const minmax = (totalProgress - min) / (max - min);\n const width = (minmax > 1 ? 1 : minmax < 0 ? 0 : minmax) * 100;\n\n let progressPercent: string | Animated.AnimatedInterpolation = `${width}%`;\n\n if (animate && animationParameters) {\n Animated.timing(animationValue, {\n toValue: 1,\n duration: animationParameters.duration / items.length,\n useNativeDriver: false,\n delay:\n animationParameters.direction === 'right'\n ? index * (animationParameters.duration / items.length)\n : (items.length - index - 1) *\n (animationParameters.duration / items.length),\n }).start();\n\n const rangeAnimation =\n animationParameters?.direction === 'right'\n ? [`${valueMin < 0 ? 0 : valueMin}%`, `${width}%`]\n : [`${valueMax}%`, `${width}%`];\n\n progressPercent = animationValue.interpolate?.({\n inputRange: [0, 1],\n outputRange: rangeAnimation,\n });\n }\n\n return (\n <Segment\n key={index}\n style={{\n borderRightWidth: index == segments - 1 ? 0 : 2,\n }}\n >\n <Progress\n style={{\n width: progressPercent,\n backgroundColor: theme.color[color][colorTone],\n borderRightWidth: width > 0 && width < 100 ? 2 : 0,\n }}\n />\n </Segment>\n );\n });\n\n return <Container {...rest}>{segmentsRender}</Container>;\n};\n\nexport default ProgressBar;\n"],"file":"ProgressBar.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/ProgressBar/ProgressBar.tsx"],"names":["ProgressBar","segments","_segments","valueMin","valueNow","_valueNow","valueMax","color","colorTone","animate","animationParameters","rest","theme","animationValue","React","useRef","Animated","Value","current","totalProgress","Math","max","segmentWidth","items","Array","keys","segmentsRender","map","index","min","minmax","width","progressPercent","timing","toValue","duration","length","useNativeDriver","delay","direction","start","rangeAnimation","interpolate","inputRange","outputRange","borderRightWidth","backgroundColor"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAMA;;AACA;;;;;;AAqBA,MAAMA,WAAuC,GAAG,CAAC;AAC/CC,EAAAA,QAAQ,EAAEC,SAAS,GAAG,CADyB;AAE/CC,EAAAA,QAAQ,GAAG,CAFoC;AAG/C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AAEC,eADF;AAELc,QAAAA,eAAe,EAAElC,KAAK,CAACL,KAAN,CAAYA,KAAZ,EAAmBC,SAAnB,CAFZ;AAGLqC,QAAAA,gBAAgB,EAAEd,KAAK,GAAG,CAAR,IAAaA,KAAK,GAAG,GAArB,GAA2B,CAA3B,GAA+B;AAH5C;AADT,MANF,CADF;AAgBD,GAjDsB,CAAvB;AAmDA,SAAO,oBAAC,iBAAD,EAAepB,IAAf,EAAsBe,cAAtB,CAAP;AACD,CA7ED;;eA+Ee1B,W","sourcesContent":["import { useTheme } from '@emotion/react';\nimport * as React from 'react';\nimport { Animated, ViewProps } from 'react-native';\nimport {\n ColorGradationType,\n ColorType,\n ThemeProp\n} from '../../../types/defaults';\nimport { extractNumbersFromString } from '../../../utils';\nimport { Container, Progress, Segment } from './styled';\n\nexport interface ProgressBarProps extends ViewProps {\n /** Number of segments. Defaults to 1. Set to 1 when 0 or less */\n segments?: number;\n /** Minimum possible value (0% of the bar). Defaults to 0 */\n valueMin?: number;\n /** Maximum possible value (100% of the bar). Defaults to 100 */\n valueMax?: number;\n /** Current value */\n valueNow: number | string;\n /** Filled partition color. Defaults to 'primary' */\n color?: ColorType;\n /** Filled partition color tone. Defaults to 'medium' */\n colorTone?: ColorGradationType;\n /** Animation */\n animate: boolean;\n /** Parameters animation */\n animationParameters?: { direction: 'left' | 'right'; duration: number };\n}\n\nconst ProgressBar: React.FC<ProgressBarProps> = ({\n segments: _segments = 1,\n valueMin = 0,\n valueNow: _valueNow,\n valueMax = 100,\n color = 'primary',\n colorTone = 'medium',\n animate,\n animationParameters,\n ...rest\n}) => {\n const theme = useTheme() as ThemeProp;\n const animationValue = React.useRef(new Animated.Value(0)).current;\n\n const valueNow =\n typeof _valueNow === 'string'\n ? extractNumbersFromString(_valueNow)\n : _valueNow;\n\n const totalProgress = ((valueNow - valueMin) / (valueMax - valueMin)) * 100;\n const segments = Math.max(1, _segments);\n const segmentWidth = 100 / Math.max(segments);\n\n const items = [...Array(segments).keys()];\n\n const segmentsRender = items.map(index => {\n \n\n const max = segmentWidth * (index + 1);\n const min = segmentWidth * index;\n const minmax = (totalProgress - min) / (max - min);\n const width = (minmax > 1 ? 1 : minmax < 0 ? 0 : minmax) * 100;\n\n let progressPercent: string | Animated.AnimatedInterpolation = `${width}%`;\n\n if (animate && animationParameters) {\n Animated.timing(animationValue, {\n toValue: 1,\n duration: animationParameters.duration / items.length,\n useNativeDriver: false,\n delay:\n animationParameters.direction === 'right'\n ? index * (animationParameters.duration / items.length)\n : (items.length - index - 1) *\n (animationParameters.duration / items.length),\n }).start();\n\n const rangeAnimation =\n animationParameters?.direction === 'right'\n ? [`${valueMin < 0 ? 0 : valueMin}%`, `${width}%`]\n : [`${valueMax}%`, `${width}%`];\n\n progressPercent = animationValue.interpolate?.({\n inputRange: [0, 1],\n outputRange: rangeAnimation,\n });\n }\n\n return (\n <Segment\n key={index}\n style={{\n borderRightWidth: index == segments - 1 ? 0 : 2,\n }}\n >\n <Progress\n style={{\n width: progressPercent,\n backgroundColor: theme.color[color][colorTone],\n borderRightWidth: width > 0 && width < 100 ? 2 : 0,\n }}\n />\n </Segment>\n );\n });\n\n return <Container {...rest}>{segmentsRender}</Container>;\n};\n\nexport default ProgressBar;\n"],"file":"ProgressBar.js"}
@@ -1,23 +1,13 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "ProgressBar", {
7
- enumerable: true,
8
- get: function () {
9
- return _ProgressBar.default;
10
- }
11
- });
12
- Object.defineProperty(exports, "ProgressBarProps", {
13
- enumerable: true,
14
- get: function () {
15
- return _ProgressBar.ProgressBarProps;
16
- }
17
- });
3
+ exports.__esModule = true;
4
+ exports.ProgressBarProps = exports.ProgressBar = void 0;
18
5
 
19
6
  var _ProgressBar = _interopRequireWildcard(require("./ProgressBar"));
20
7
 
8
+ exports.ProgressBar = _ProgressBar.default;
9
+ exports.ProgressBarProps = _ProgressBar.ProgressBarProps;
10
+
21
11
  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); }
22
12
 
23
13
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/ProgressBar/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA","sourcesContent":["export { default as ProgressBar, ProgressBarProps } from './ProgressBar';\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/ProgressBar/index.ts"],"names":[],"mappings":";;;;;AAAA","sourcesContent":["export { default as ProgressBar, ProgressBarProps } from './ProgressBar';\n"],"file":"index.js"}
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
3
+ exports.__esModule = true;
6
4
  exports.Progress = exports.Segment = exports.Container = void 0;
7
5
 
8
6
  var _native = _interopRequireDefault(require("@emotion/native"));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/ProgressBar/styled.ts"],"names":["Container","styled","View","theme","spacing","mili","Segment","color","secondary","light","xlight","Progress","Animated"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;;;AAEO,MAAMA,SAAS,GAAGC,gBAAOC,IAA0B;AAC1D;AACA,YAAY,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACC,OAAN,CAAcC,IAAK;AAC9C,mBAAmB,CAAC;AAAEF,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACC,OAAN,CAAcC,IAAK;AACrD;AACA;AACA;AACA,CAPO;;AASA,MAAMC,OAAO,GAAGL,gBAAOC,IAA0B;AACxD;AACA,sBAAsB,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACI,KAAN,CAAYC,SAAZ,CAAsBC,KAAM;AACjE,wBAAwB,uBAAW,KAAX,CAAkB;AAC1C,kBAAkB,CAAC;AAAEN,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACI,KAAN,CAAYC,SAAZ,CAAsBE,MAAO;AAC9D,CALO;;AAOA,MAAMC,QAAQ,GAAG,qBAAOC,sBAASV,IAAhB,CAA2C;AACnE;AACA,kBAAkB,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACI,KAAN,CAAYC,SAAZ,CAAsBE,MAAO;AAC9D,CAHO","sourcesContent":["import styled from '@emotion/native';\nimport { Animated } from 'react-native';\nimport { StyleProps } from '../../../types/defaults';\nimport { RFValueStr } from '../../../utils';\n\nexport const Container = styled.View<Partial<StyleProps>>`\n display: flex;\n height: ${({ theme }) => theme.spacing.mili};\n border-radius: ${({ theme }) => theme.spacing.mili};\n width: 100%;\n flex-direction: row;\n overflow: hidden;\n`;\n\nexport const Segment = styled.View<Partial<StyleProps>>`\n flex: 1;\n background-color: ${({ theme }) => theme.color.secondary.light};\n border-right-width: ${RFValueStr('2px')};\n border-color: ${({ theme }) => theme.color.secondary.xlight};\n`;\n\nexport const Progress = styled(Animated.View)<Partial<StyleProps>>`\n height: 100%;\n border-color: ${({ theme }) => theme.color.secondary.xlight};\n`;\n"],"file":"styled.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/ProgressBar/styled.ts"],"names":["Container","styled","View","theme","spacing","mili","Segment","color","secondary","light","xlight","Progress","Animated"],"mappings":";;;;;AAAA;;AACA;;AAEA;;;;AAEO,MAAMA,SAAS,GAAGC,gBAAOC,IAA0B;AAC1D;AACA,YAAY,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACC,OAAN,CAAcC,IAAK;AAC9C,mBAAmB,CAAC;AAAEF,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACC,OAAN,CAAcC,IAAK;AACrD;AACA;AACA;AACA,CAPO;;AASA,MAAMC,OAAO,GAAGL,gBAAOC,IAA0B;AACxD;AACA,sBAAsB,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACI,KAAN,CAAYC,SAAZ,CAAsBC,KAAM;AACjE,wBAAwB,uBAAW,KAAX,CAAkB;AAC1C,kBAAkB,CAAC;AAAEN,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACI,KAAN,CAAYC,SAAZ,CAAsBE,MAAO;AAC9D,CALO;;AAOA,MAAMC,QAAQ,GAAG,qBAAOC,sBAASV,IAAhB,CAA2C;AACnE;AACA,kBAAkB,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACI,KAAN,CAAYC,SAAZ,CAAsBE,MAAO;AAC9D,CAHO","sourcesContent":["import styled from '@emotion/native';\nimport { Animated } from 'react-native';\nimport { StyleProps } from '../../../types/defaults';\nimport { RFValueStr } from '../../../utils';\n\nexport const Container = styled.View<Partial<StyleProps>>`\n display: flex;\n height: ${({ theme }) => theme.spacing.mili};\n border-radius: ${({ theme }) => theme.spacing.mili};\n width: 100%;\n flex-direction: row;\n overflow: hidden;\n`;\n\nexport const Segment = styled.View<Partial<StyleProps>>`\n flex: 1;\n background-color: ${({ theme }) => theme.color.secondary.light};\n border-right-width: ${RFValueStr('2px')};\n border-color: ${({ theme }) => theme.color.secondary.xlight};\n`;\n\nexport const Progress = styled(Animated.View)<Partial<StyleProps>>`\n height: 100%;\n border-color: ${({ theme }) => theme.color.secondary.xlight};\n`;\n"],"file":"styled.js"}
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
3
+ exports.__esModule = true;
6
4
  exports.default = void 0;
7
5
 
8
6
  var _react = _interopRequireDefault(require("react"));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/RadioButton/RadioButton.tsx"],"names":["RadioButton","children","onChange","checked","labelPosition","disabled","color","colorTone","rest","handleChange"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;AAkBA,MAAMA,WAAiC,GAAG,CAAC;AACzCC,EAAAA,QADyC;AAEzCC,EAAAA,QAFyC;AAGzCC,EAAAA,OAHyC;AAIzCC,EAAAA,aAAa,GAAG,OAJyB;AAKzCC,EAAAA,QAAQ,GAAG,KAL8B;AAMzCC,EAAAA,KAAK,GAAG,SANiC;AAOzCC,EAAAA,SAAS,GAAG,QAP6B;AAQzC,KAAGC;AARsC,CAAD,KASvB;AACjB,QAAMC,YAAY,GAAG,MAAM;AACzBP,IAAAA,QAAQ,IAAIA,QAAQ,CAAC,CAACC,OAAF,CAApB;AACD,GAFD;;AAIA,SACE,6BAAC,sBAAD,eACMK,IADN;AAEE,IAAA,QAAQ,EAAEH,QAFZ;AAGE,IAAA,OAAO,EAAEI,YAHX;AAIE,IAAA,iBAAiB,EAAC;AAJpB,MAME,6BAAC,kBAAD,QACGL,aAAa,KAAK,MAAlB,IAA4BH,QAD/B,EAEGE,OAAO,IACN,6BAAC,sBAAD,QACE,6BAAC,mBAAD,QACE,6BAAC,kBAAD,QACE,6BAAC,UAAD;AACE,IAAA,IAAI,EAAC,QADP;AAEE,IAAA,YAAY,EAAEG,KAFhB;AAGE,IAAA,SAAS,EAAEC,SAHb;AAIE,IAAA,IAAI,EAAC,oBAJP;AAKE,IAAA,IAAI,EAAC;AALP,IADF,CADF,CADF,CAHJ,EAiBG,CAACJ,OAAD,IACC,6BAAC,sBAAD,QACE,6BAAC,mBAAD,QACE,6BAAC,kBAAD,QACE,6BAAC,UAAD;AACE,IAAA,IAAI,EAAC,QADP;AAEE,IAAA,SAAS,EAAC,OAFZ;AAGE,IAAA,IAAI,EAAC,oBAHP;AAIE,IAAA,IAAI,EAAC;AAJP,IADF,CADF,CADF,CAlBJ,EA+BGC,aAAa,KAAK,OAAlB,IAA6BH,QA/BhC,CANF,CADF;AA0CD,CAxDD;;eA0DeD,W","sourcesContent":["import React, { FC } from 'react';\nimport { Pressable, StyleProp, ViewStyle } from 'react-native';\nimport { ColorGradationType, ColorType } from '../../../types/defaults';\nimport { Icon } from '../Icon';\nimport { IconViewStyled, IconWrapper, ScaledView, ViewStyled } from './styled';\n\nexport interface RadioButtonProps {\n /** Element is checked */\n checked?: boolean;\n /** Change handler */\n onChange?: (checked: boolean) => void;\n /** Position of children */\n labelPosition?: 'left' | 'right';\n /** Element is not clickable */\n disabled?: boolean;\n /** Color definition from theme */\n color?: ColorType;\n /** Color gradation from theme */\n colorTone?: ColorGradationType;\n style?: StyleProp<ViewStyle>;\n}\n\nconst RadioButton: FC<RadioButtonProps> = ({\n children,\n onChange,\n checked,\n labelPosition = 'right',\n disabled = false,\n color = 'primary',\n colorTone = 'medium',\n ...rest\n}): JSX.Element => {\n const handleChange = () => {\n onChange && onChange(!checked);\n };\n\n return (\n <Pressable\n {...rest}\n disabled={disabled}\n onPress={handleChange}\n accessibilityRole=\"radio\"\n >\n <ViewStyled>\n {labelPosition === 'left' && children}\n {checked && (\n <IconViewStyled>\n <IconWrapper>\n <ScaledView>\n <Icon\n name=\"circle\"\n colorVariant={color}\n colorTone={colorTone}\n type=\"material-community\"\n size=\"centi\"\n />\n </ScaledView>\n </IconWrapper>\n </IconViewStyled>\n )}\n {!checked && (\n <IconViewStyled>\n <IconWrapper>\n <ScaledView>\n <Icon\n name=\"circle\"\n fontColor=\"light\"\n type=\"material-community\"\n size=\"centi\"\n />\n </ScaledView>\n </IconWrapper>\n </IconViewStyled>\n )}\n {labelPosition === 'right' && children}\n </ViewStyled>\n </Pressable>\n );\n};\n\nexport default RadioButton;\n"],"file":"RadioButton.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/RadioButton/RadioButton.tsx"],"names":["RadioButton","children","onChange","checked","labelPosition","disabled","color","colorTone","rest","handleChange"],"mappings":";;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;AAkBA,MAAMA,WAAiC,GAAG,CAAC;AACzCC,EAAAA,QADyC;AAEzCC,EAAAA,QAFyC;AAGzCC,EAAAA,OAHyC;AAIzCC,EAAAA,aAAa,GAAG,OAJyB;AAKzCC,EAAAA,QAAQ,GAAG,KAL8B;AAMzCC,EAAAA,KAAK,GAAG,SANiC;AAOzCC,EAAAA,SAAS,GAAG,QAP6B;AAQzC,KAAGC;AARsC,CAAD,KASvB;AACjB,QAAMC,YAAY,GAAG,MAAM;AACzBP,IAAAA,QAAQ,IAAIA,QAAQ,CAAC,CAACC,OAAF,CAApB;AACD,GAFD;;AAIA,SACE,6BAAC,sBAAD,eACMK,IADN;AAEE,IAAA,QAAQ,EAAEH,QAFZ;AAGE,IAAA,OAAO,EAAEI,YAHX;AAIE,IAAA,iBAAiB,EAAC;AAJpB,MAME,6BAAC,kBAAD,QACGL,aAAa,KAAK,MAAlB,IAA4BH,QAD/B,EAEGE,OAAO,IACN,6BAAC,sBAAD,QACE,6BAAC,mBAAD,QACE,6BAAC,kBAAD,QACE,6BAAC,UAAD;AACE,IAAA,IAAI,EAAC,QADP;AAEE,IAAA,YAAY,EAAEG,KAFhB;AAGE,IAAA,SAAS,EAAEC,SAHb;AAIE,IAAA,IAAI,EAAC,oBAJP;AAKE,IAAA,IAAI,EAAC;AALP,IADF,CADF,CADF,CAHJ,EAiBG,CAACJ,OAAD,IACC,6BAAC,sBAAD,QACE,6BAAC,mBAAD,QACE,6BAAC,kBAAD,QACE,6BAAC,UAAD;AACE,IAAA,IAAI,EAAC,QADP;AAEE,IAAA,SAAS,EAAC,OAFZ;AAGE,IAAA,IAAI,EAAC,oBAHP;AAIE,IAAA,IAAI,EAAC;AAJP,IADF,CADF,CADF,CAlBJ,EA+BGC,aAAa,KAAK,OAAlB,IAA6BH,QA/BhC,CANF,CADF;AA0CD,CAxDD;;eA0DeD,W","sourcesContent":["import React, { FC } from 'react';\nimport { Pressable, StyleProp, ViewStyle } from 'react-native';\nimport { ColorGradationType, ColorType } from '../../../types/defaults';\nimport { Icon } from '../Icon';\nimport { IconViewStyled, IconWrapper, ScaledView, ViewStyled } from './styled';\n\nexport interface RadioButtonProps {\n /** Element is checked */\n checked?: boolean;\n /** Change handler */\n onChange?: (checked: boolean) => void;\n /** Position of children */\n labelPosition?: 'left' | 'right';\n /** Element is not clickable */\n disabled?: boolean;\n /** Color definition from theme */\n color?: ColorType;\n /** Color gradation from theme */\n colorTone?: ColorGradationType;\n style?: StyleProp<ViewStyle>;\n}\n\nconst RadioButton: FC<RadioButtonProps> = ({\n children,\n onChange,\n checked,\n labelPosition = 'right',\n disabled = false,\n color = 'primary',\n colorTone = 'medium',\n ...rest\n}): JSX.Element => {\n const handleChange = () => {\n onChange && onChange(!checked);\n };\n\n return (\n <Pressable\n {...rest}\n disabled={disabled}\n onPress={handleChange}\n accessibilityRole=\"radio\"\n >\n <ViewStyled>\n {labelPosition === 'left' && children}\n {checked && (\n <IconViewStyled>\n <IconWrapper>\n <ScaledView>\n <Icon\n name=\"circle\"\n colorVariant={color}\n colorTone={colorTone}\n type=\"material-community\"\n size=\"centi\"\n />\n </ScaledView>\n </IconWrapper>\n </IconViewStyled>\n )}\n {!checked && (\n <IconViewStyled>\n <IconWrapper>\n <ScaledView>\n <Icon\n name=\"circle\"\n fontColor=\"light\"\n type=\"material-community\"\n size=\"centi\"\n />\n </ScaledView>\n </IconWrapper>\n </IconViewStyled>\n )}\n {labelPosition === 'right' && children}\n </ViewStyled>\n </Pressable>\n );\n};\n\nexport default RadioButton;\n"],"file":"RadioButton.js"}
@@ -1,23 +1,13 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "RadioButton", {
7
- enumerable: true,
8
- get: function () {
9
- return _RadioButton.default;
10
- }
11
- });
12
- Object.defineProperty(exports, "RadioButtonProps", {
13
- enumerable: true,
14
- get: function () {
15
- return _RadioButton.RadioButtonProps;
16
- }
17
- });
3
+ exports.__esModule = true;
4
+ exports.RadioButtonProps = exports.RadioButton = void 0;
18
5
 
19
6
  var _RadioButton = _interopRequireWildcard(require("./RadioButton"));
20
7
 
8
+ exports.RadioButton = _RadioButton.default;
9
+ exports.RadioButtonProps = _RadioButton.RadioButtonProps;
10
+
21
11
  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); }
22
12
 
23
13
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/RadioButton/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA","sourcesContent":["export { default as RadioButton, RadioButtonProps } from './RadioButton';\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/RadioButton/index.ts"],"names":[],"mappings":";;;;;AAAA","sourcesContent":["export { default as RadioButton, RadioButtonProps } from './RadioButton';\n"],"file":"index.js"}
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
3
+ exports.__esModule = true;
6
4
  exports.ViewStyled = exports.IconViewStyled = exports.ScaledView = exports.IconWrapper = void 0;
7
5
 
8
6
  var _native = _interopRequireDefault(require("@emotion/native"));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/RadioButton/styled.ts"],"names":["IconWrapper","View","theme","borderRadius","pill","color","colorTone","borderWidth","nano","miscellaneous","surfaceColor","ScaledView","IconViewStyled","spacing","mili","ViewStyled"],"mappings":";;;;;;;AAAA;;AACA;;;;AAIO,MAAMA,WAAW,GAAG,qBAAOC,iBAAP,CAAqD;AAChF,mBAAmB,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAA2BA,KAAK,CAACC,YAAN,CAAmBC,IAAK;AACtE,kBAAkB,CAAC;AACfF,EAAAA,KADe;AAEfG,EAAAA,KAAK,GAAG,SAFO;AAGfC,EAAAA,SAAS,GAAG;AAHG,CAAD,KAIqBJ,KAAK,CAACG,KAAN,CAAYA,KAAZ,EAAmBC,SAAnB,CAA8B;AACrE,kBAAkB,CAAC;AAAEJ,EAAAA;AAAF,CAAD,KAA2BA,KAAK,CAACK,WAAN,CAAkBC,IAAK;AACpE,sBAAsB,CAAC;AAAEN,EAAAA;AAAF,CAAD,KAClBA,KAAK,CAACO,aAAN,CAAoBC,YAAa;AACrC,CAVO;;AAYA,MAAMC,UAAU,GAAG,qBAAOV,iBAAP,CAAa;AACvC;AACA,CAFO;;AAIA,MAAMW,cAAc,GAAG,qBAAOX,iBAAP,CAAkC;AAChE,aAAa,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAA2BA,KAAK,CAACW,OAAN,CAAcC,IAAK;AAC3D,CAFO;;AAIA,MAAMC,UAAU,GAAG,qBAAOd,iBAAP,CAAa;AACvC;AACA;AACA,CAHO","sourcesContent":["import styled from '@emotion/native';\nimport { View } from 'react-native';\nimport { StyleProps } from '../../../types/defaults';\nimport { RadioButtonProps } from './RadioButton';\n\nexport const IconWrapper = styled(View)<Partial<RadioButtonProps & StyleProps>>`\n border-radius: ${({ theme }: StyleProps) => theme.borderRadius.pill};\n border-color: ${({\n theme,\n color = 'primary',\n colorTone = 'medium',\n }: StyleProps & RadioButtonProps) => theme.color[color][colorTone]};\n border-width: ${({ theme }: StyleProps) => theme.borderWidth.nano};\n background-color: ${({ theme }: StyleProps) =>\n theme.miscellaneous.surfaceColor};\n`;\n\nexport const ScaledView = styled(View)`\n transform: scale(0.8);\n`;\n\nexport const IconViewStyled = styled(View)<Partial<StyleProps>>`\n padding: ${({ theme }: StyleProps) => theme.spacing.mili};\n`;\n\nexport const ViewStyled = styled(View)`\n align-items: center;\n flex-direction: row;\n`;\n"],"file":"styled.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/RadioButton/styled.ts"],"names":["IconWrapper","View","theme","borderRadius","pill","color","colorTone","borderWidth","nano","miscellaneous","surfaceColor","ScaledView","IconViewStyled","spacing","mili","ViewStyled"],"mappings":";;;;;AAAA;;AACA;;;;AAIO,MAAMA,WAAW,GAAG,qBAAOC,iBAAP,CAAqD;AAChF,mBAAmB,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAA2BA,KAAK,CAACC,YAAN,CAAmBC,IAAK;AACtE,kBAAkB,CAAC;AACfF,EAAAA,KADe;AAEfG,EAAAA,KAAK,GAAG,SAFO;AAGfC,EAAAA,SAAS,GAAG;AAHG,CAAD,KAIqBJ,KAAK,CAACG,KAAN,CAAYA,KAAZ,EAAmBC,SAAnB,CAA8B;AACrE,kBAAkB,CAAC;AAAEJ,EAAAA;AAAF,CAAD,KAA2BA,KAAK,CAACK,WAAN,CAAkBC,IAAK;AACpE,sBAAsB,CAAC;AAAEN,EAAAA;AAAF,CAAD,KAClBA,KAAK,CAACO,aAAN,CAAoBC,YAAa;AACrC,CAVO;;AAYA,MAAMC,UAAU,GAAG,qBAAOV,iBAAP,CAAa;AACvC;AACA,CAFO;;AAIA,MAAMW,cAAc,GAAG,qBAAOX,iBAAP,CAAkC;AAChE,aAAa,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAA2BA,KAAK,CAACW,OAAN,CAAcC,IAAK;AAC3D,CAFO;;AAIA,MAAMC,UAAU,GAAG,qBAAOd,iBAAP,CAAa;AACvC;AACA;AACA,CAHO","sourcesContent":["import styled from '@emotion/native';\nimport { View } from 'react-native';\nimport { StyleProps } from '../../../types/defaults';\nimport { RadioButtonProps } from './RadioButton';\n\nexport const IconWrapper = styled(View)<Partial<RadioButtonProps & StyleProps>>`\n border-radius: ${({ theme }: StyleProps) => theme.borderRadius.pill};\n border-color: ${({\n theme,\n color = 'primary',\n colorTone = 'medium',\n }: StyleProps & RadioButtonProps) => theme.color[color][colorTone]};\n border-width: ${({ theme }: StyleProps) => theme.borderWidth.nano};\n background-color: ${({ theme }: StyleProps) =>\n theme.miscellaneous.surfaceColor};\n`;\n\nexport const ScaledView = styled(View)`\n transform: scale(0.8);\n`;\n\nexport const IconViewStyled = styled(View)<Partial<StyleProps>>`\n padding: ${({ theme }: StyleProps) => theme.spacing.mili};\n`;\n\nexport const ViewStyled = styled(View)`\n align-items: center;\n flex-direction: row;\n`;\n"],"file":"styled.js"}
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
3
+ exports.__esModule = true;
6
4
  exports.default = void 0;
7
5
 
8
6
  var _react = require("@emotion/react");
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Switch/Switch.tsx"],"names":["Switch","onChange","activeColor","activeColorTone","inactiveColor","inactiveColorTone","active","dotStyle","disabled","rest","theme","width","React","useRef","transitionValue","Animated","Value","current","animatedColor","calculateTranslate","spacing","micro","SWITCH_PIN_WIDTH","getBackgroundColor","color","interpolateColor","interpolate","inputRange","outputRange","translate","handleChange","handleSwitchLayout","lce","nativeEvent","layout","backgroundColor","transform","translateX"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAMA;;AACA;;AACA;;AACA;;;;;;;;AAcA,MAAMA,MAAuB,GAAG,CAAC;AAC/BC,EAAAA,QAD+B;AAE/BC,EAAAA,WAAW,GAAG,SAFiB;AAG/BC,EAAAA,eAAe,GAAG,QAHa;AAI/BC,EAAAA,aAAa,GAAG,WAJe;AAK/BC,EAAAA,iBAAiB,GAAG,OALW;AAM/BC,EAAAA,MAN+B;AAO/BC,EAAAA,QAP+B;AAQ/BC,EAAAA,QAAQ,GAAG,KARoB;AAS/B,KAAGC;AAT4B,CAAD,KAUb;AACjB,QAAMC,KAAK,GAAG,sBAAd;;AAEA,QAAMC,KAAK,GAAGC,gBAAMC,MAAN,CAAa,CAAb,CAAd;;AACA,QAAMC,eAAe,GAAGF,gBAAMC,MAAN,CAAa,IAAIE,sBAASC,KAAb,CAAmB,CAAnB,CAAb,EAAoCC,OAA5D;;AACA,QAAMC,aAAa,GAAGN,gBAAMC,MAAN,CAAa,IAAIE,sBAASC,KAAb,CAAmB,CAAnB,CAAb,EAAoCC,OAA1D;;AAEA,QAAME,kBAAkB,GAAG,MAAM;AAC/B,QAAIR,KAAK,CAACM,OAAN,GAAgB,CAApB,EAAuB;AACrB,aAAON,KAAK,CAACM,OAAN,GAAiB,qCAAyBP,KAAK,CAACU,OAAN,CAAcC,KAAvC,IAAgD,CAAjE,GAAuE,qCAAyB,uBAAWC,wBAAX,CAAzB,CAA9E;AACD;;AACD,WAAO,CAAP;AACD,GALD;;AAOA,QAAMC,kBAAkB,GAAIC,KAAD,IAAmB;AAC5C,WAAOhB,QAAQ,GAAG,+BAAmBE,KAAK,CAACc,KAAN,CAAYpB,aAAZ,EAA2BC,iBAA3B,CAAnB,EAAkE,EAAlE,CAAH,GAA2EmB,KAA1F;AACD,GAFD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AAS,EAAE,CAAC;AAAEC,QAAAA,UAAU,EAAEvB;AAAd,OAAD;AAAb,KAAX;AAArB,IADF,CANF,CADF;AAYD,CA/DD;;eAiEed,M","sourcesContent":["import { useTheme } from '@emotion/react';\nimport React, { FC, useCallback, useEffect } from 'react';\nimport { Animated, LayoutChangeEvent, StyleProp, ViewStyle } from 'react-native';\nimport {\n ColorGradationType,\n ColorType,\n ThemeProp\n} from '../../../types/defaults';\nimport { extractNumbersFromString, lightenDarkenColor, RFValueStr } from '../../../utils';\nimport { PressableSurface } from '../PressableSurface';\nimport { transitionSwitch } from './animation';\nimport { StyledSwitch, StyledSwitchContent, SWITCH_PIN_WIDTH } from './styled';\n\nexport interface SwitchProps {\n onChange: (active: boolean) => void;\n active: boolean;\n activeColor?: ColorType;\n activeColorTone?: ColorGradationType;\n inactiveColor?: ColorType;\n inactiveColorTone?: ColorGradationType;\n style?: StyleProp<ViewStyle>;\n dotStyle?: StyleProp<ViewStyle>;\n disabled?: boolean;\n}\n\nconst Switch: FC<SwitchProps> = ({\n onChange,\n activeColor = 'primary',\n activeColorTone = 'medium',\n inactiveColor = 'secondary',\n inactiveColorTone = 'light',\n active,\n dotStyle,\n disabled = false,\n ...rest\n}): JSX.Element => {\n const theme = useTheme() as ThemeProp;\n\n const width = React.useRef(0)\n const transitionValue = React.useRef(new Animated.Value(0)).current\n const animatedColor = React.useRef(new Animated.Value(0)).current\n \n const calculateTranslate = () => {\n if (width.current > 0) {\n return width.current - (extractNumbersFromString(theme.spacing.micro) * 2) - (extractNumbersFromString(RFValueStr(SWITCH_PIN_WIDTH)))\n }\n return 0\n }\n\n const getBackgroundColor = (color: string) => {\n return disabled ? lightenDarkenColor(theme.color[inactiveColor][inactiveColorTone], 20) : color;\n };\n\n const interpolateColor = animatedColor.interpolate({\n inputRange: [0, 1],\n outputRange: [\n getBackgroundColor(theme.color[inactiveColor][inactiveColorTone]),\n getBackgroundColor(theme.color[activeColor][activeColorTone]),\n ]\n });\n\n useEffect(() => {\n const translate = calculateTranslate()\n transitionSwitch(active, translate, transitionValue, animatedColor);\n }, [active]);\n\n const handleChange = useCallback(() => {\n onChange(!active);\n }, [active, onChange]);\n\n const handleSwitchLayout = (lce: LayoutChangeEvent) => {\n width.current = lce.nativeEvent.layout.width\n const translate = calculateTranslate()\n transitionSwitch(active, translate, transitionValue, animatedColor);\n }\n\n return (\n <PressableSurface\n {...rest}\n onPress={handleChange}\n effect=\"none\"\n disabled={disabled}\n >\n <StyledSwitchContent onLayout={handleSwitchLayout} style={{ backgroundColor: interpolateColor }}>\n <StyledSwitch style={[dotStyle, { transform: [{ translateX: transitionValue }] }]}/>\n </StyledSwitchContent>\n </PressableSurface>\n );\n};\n\nexport default Switch;\n"],"file":"Switch.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/Switch/Switch.tsx"],"names":["Switch","onChange","activeColor","activeColorTone","inactiveColor","inactiveColorTone","active","dotStyle","disabled","rest","theme","width","React","useRef","transitionValue","Animated","Value","current","animatedColor","calculateTranslate","spacing","micro","SWITCH_PIN_WIDTH","getBackgroundColor","color","interpolateColor","interpolate","inputRange","outputRange","translate","handleChange","handleSwitchLayout","lce","nativeEvent","layout","backgroundColor","transform","translateX"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAMA;;AACA;;AACA;;AACA;;;;;;;;AAcA,MAAMA,MAAuB,GAAG,CAAC;AAC/BC,EAAAA,QAD+B;AAE/BC,EAAAA,WAAW,GAAG,SAFiB;AAG/BC,EAAAA,eAAe,GAAG,QAHa;AAI/BC,EAAAA,aAAa,GAAG,WAJe;AAK/BC,EAAAA,iBAAiB,GAAG,OALW;AAM/BC,EAAAA,MAN+B;AAO/BC,EAAAA,QAP+B;AAQ/BC,EAAAA,QAAQ,GAAG,KARoB;AAS/B,KAAGC;AAT4B,CAAD,KAUb;AACjB,QAAMC,KAAK,GAAG,sBAAd;;AAEA,QAAMC,KAAK,GAAGC,gBAAMC,MAAN,CAAa,CAAb,CAAd;;AACA,QAAMC,eAAe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,CAACA,MAAD,EAASL,QAAT,CAFkB,CAArB;;AAIA,QAAM8B,kBAAkB,GAAIC,GAAD,IAA4B;AACrDrB,IAAAA,KAAK,CAACM,OAAN,GAAgBe,GAAG,CAACC,WAAJ,CAAgBC,MAAhB,CAAuBvB,KAAvC;AACA,UAAMkB,SAAS,GAAGV,kBAAkB,EAApC;AACA,qCAAiBb,MAAjB,EAAyBuB,SAAzB,EAAoCf,eAApC,EAAqDI,aAArD;AACD,GAJD;;AAMA,SACE,8BAAC,kCAAD,eACMT,IADN;AAEE,IAAA,OAAO,EAAEqB,YAFX;AAGE,IAAA,MAAM,EAAC,MAHT;AAIE,IAAA,QAAQ,EAAEtB;AAJZ,MAME,8BAAC,2BAAD;AAAqB,IAAA,QAAQ,EAAEuB,kBAA/B;AAAmD,IAAA,KAAK,EAAE;AAAEI,MAAAA,eAAe,EAAEV;AAAnB;AAA1D,KACE,8BAAC,oBAAD;AAAc,IAAA,KAAK,EAAE,CAAClB,QAAD,EAAW;AAAE6B,MAAAA,SAAS,EAAE,CAAC;AAAEC,QAAAA,UAAU,EAAEvB;AAAd,OAAD;AAAb,KAAX;AAArB,IADF,CANF,CADF;AAYD,CA/DD;;eAiEed,M","sourcesContent":["import { useTheme } from '@emotion/react';\nimport React, { FC, useCallback, useEffect } from 'react';\nimport { Animated, LayoutChangeEvent, StyleProp, ViewStyle } from 'react-native';\nimport {\n ColorGradationType,\n ColorType,\n ThemeProp\n} from '../../../types/defaults';\nimport { extractNumbersFromString, lightenDarkenColor, RFValueStr } from '../../../utils';\nimport { PressableSurface } from '../PressableSurface';\nimport { transitionSwitch } from './animation';\nimport { StyledSwitch, StyledSwitchContent, SWITCH_PIN_WIDTH } from './styled';\n\nexport interface SwitchProps {\n onChange: (active: boolean) => void;\n active: boolean;\n activeColor?: ColorType;\n activeColorTone?: ColorGradationType;\n inactiveColor?: ColorType;\n inactiveColorTone?: ColorGradationType;\n style?: StyleProp<ViewStyle>;\n dotStyle?: StyleProp<ViewStyle>;\n disabled?: boolean;\n}\n\nconst Switch: FC<SwitchProps> = ({\n onChange,\n activeColor = 'primary',\n activeColorTone = 'medium',\n inactiveColor = 'secondary',\n inactiveColorTone = 'light',\n active,\n dotStyle,\n disabled = false,\n ...rest\n}): JSX.Element => {\n const theme = useTheme() as ThemeProp;\n\n const width = React.useRef(0)\n const transitionValue = React.useRef(new Animated.Value(0)).current\n const animatedColor = React.useRef(new Animated.Value(0)).current\n \n const calculateTranslate = () => {\n if (width.current > 0) {\n return width.current - (extractNumbersFromString(theme.spacing.micro) * 2) - (extractNumbersFromString(RFValueStr(SWITCH_PIN_WIDTH)))\n }\n return 0\n }\n\n const getBackgroundColor = (color: string) => {\n return disabled ? lightenDarkenColor(theme.color[inactiveColor][inactiveColorTone], 20) : color;\n };\n\n const interpolateColor = animatedColor.interpolate({\n inputRange: [0, 1],\n outputRange: [\n getBackgroundColor(theme.color[inactiveColor][inactiveColorTone]),\n getBackgroundColor(theme.color[activeColor][activeColorTone]),\n ]\n });\n\n useEffect(() => {\n const translate = calculateTranslate()\n transitionSwitch(active, translate, transitionValue, animatedColor);\n }, [active]);\n\n const handleChange = useCallback(() => {\n onChange(!active);\n }, [active, onChange]);\n\n const handleSwitchLayout = (lce: LayoutChangeEvent) => {\n width.current = lce.nativeEvent.layout.width\n const translate = calculateTranslate()\n transitionSwitch(active, translate, transitionValue, animatedColor);\n }\n\n return (\n <PressableSurface\n {...rest}\n onPress={handleChange}\n effect=\"none\"\n disabled={disabled}\n >\n <StyledSwitchContent onLayout={handleSwitchLayout} style={{ backgroundColor: interpolateColor }}>\n <StyledSwitch style={[dotStyle, { transform: [{ translateX: transitionValue }] }]}/>\n </StyledSwitchContent>\n </PressableSurface>\n );\n};\n\nexport default Switch;\n"],"file":"Switch.js"}
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
3
+ exports.__esModule = true;
6
4
  exports.transitionSwitch = void 0;
7
5
 
8
6
  var _reactNative = require("react-native");
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Switch/animation.ts"],"names":["ANIMATION_SPEED","transitionSwitch","active","translate","transitionValue","animatedColor","Animated","timing","toValue","duration","easing","Easing","out","ease","useNativeDriver","start"],"mappings":";;;;;;;AAAA;;AAEA,MAAMA,eAAe,GAAG,GAAxB;;AAEO,MAAMC,gBAAgB,GAAG,CAC9BC,MAD8B,EAE9BC,SAF8B,EAG9BC,eAH8B,EAI9BC,aAJ8B,KAKrB;AAET,MAAIF,SAAS,IAAI,CAAjB,EAAoB;;AAEpB,MAAID,MAAJ,EAAY;AACVI,0BAASC,MAAT,CAAgBH,eAAhB,EAAiC;AAC/BI,MAAAA,OAAO,EAAEL,SADsB;AAE/BM,MAAAA,QAAQ,EAAET,eAFqB;AAG/BU,MAAAA,MAAM,EAAEC,oBAAOC,GAAP,CAAWD,oBAAOE,IAAlB,CAHuB;AAI/BC,MAAAA,eAAe,EAAE;AAJc,KAAjC,EAKGC,KALH;;AAMAT,0BAASC,MAAT,CAAgBF,aAAhB,EAA+B;AAC7BG,MAAAA,OAAO,EAAE,CADoB;AAE7BC,MAAAA,QAAQ,EAAET,eAFmB;AAG7Bc,MAAAA,eAAe,EAAE;AAHY,KAA/B,EAIGC,KAJH;;AAKA;AACD;;AAEDT,wBAASC,MAAT,CAAgBH,eAAhB,EAAiC;AAC/BI,IAAAA,OAAO,EAAE,CADsB;AAE/BC,IAAAA,QAAQ,EAAET,eAFqB;AAG/BU,IAAAA,MAAM,EAAEC,oBAAOC,GAAP,CAAWD,oBAAOE,IAAlB,CAHuB;AAI/BC,IAAAA,eAAe,EAAE;AAJc,GAAjC,EAKGC,KALH;;AAMAT,wBAASC,MAAT,CAAgBF,aAAhB,EAA+B;AAC7BG,IAAAA,OAAO,EAAE,CADoB;AAE7BC,IAAAA,QAAQ,EAAET,eAFmB;AAG7Bc,IAAAA,eAAe,EAAE;AAHY,GAA/B,EAIGC,KAJH;AAMD,CApCM","sourcesContent":["import { Animated, Easing } from 'react-native';\n\nconst ANIMATION_SPEED = 140\n\nexport const transitionSwitch = (\n active: boolean,\n translate: number,\n transitionValue: Animated.Value,\n animatedColor: Animated.Value\n): void => {\n\n if (translate <= 0) return\n \n if (active) {\n Animated.timing(transitionValue, {\n toValue: translate,\n duration: ANIMATION_SPEED,\n easing: Easing.out(Easing.ease),\n useNativeDriver: true,\n }).start();\n Animated.timing(animatedColor, {\n toValue: 1,\n duration: ANIMATION_SPEED,\n useNativeDriver: false,\n }).start();\n return\n } \n\n Animated.timing(transitionValue, {\n toValue: 0,\n duration: ANIMATION_SPEED,\n easing: Easing.out(Easing.ease),\n useNativeDriver: true,\n }).start();\n Animated.timing(animatedColor, {\n toValue: 0,\n duration: ANIMATION_SPEED,\n useNativeDriver: false,\n }).start();\n\n};\n"],"file":"animation.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/Switch/animation.ts"],"names":["ANIMATION_SPEED","transitionSwitch","active","translate","transitionValue","animatedColor","Animated","timing","toValue","duration","easing","Easing","out","ease","useNativeDriver","start"],"mappings":";;;;;AAAA;;AAEA,MAAMA,eAAe,GAAG,GAAxB;;AAEO,MAAMC,gBAAgB,GAAG,CAC9BC,MAD8B,EAE9BC,SAF8B,EAG9BC,eAH8B,EAI9BC,aAJ8B,KAKrB;AAET,MAAIF,SAAS,IAAI,CAAjB,EAAoB;;AAEpB,MAAID,MAAJ,EAAY;AACVI,0BAASC,MAAT,CAAgBH,eAAhB,EAAiC;AAC/BI,MAAAA,OAAO,EAAEL,SADsB;AAE/BM,MAAAA,QAAQ,EAAET,eAFqB;AAG/BU,MAAAA,MAAM,EAAEC,oBAAOC,GAAP,CAAWD,oBAAOE,IAAlB,CAHuB;AAI/BC,MAAAA,eAAe,EAAE;AAJc,KAAjC,EAKGC,KALH;;AAMAT,0BAASC,MAAT,CAAgBF,aAAhB,EAA+B;AAC7BG,MAAAA,OAAO,EAAE,CADoB;AAE7BC,MAAAA,QAAQ,EAAET,eAFmB;AAG7Bc,MAAAA,eAAe,EAAE;AAHY,KAA/B,EAIGC,KAJH;;AAKA;AACD;;AAEDT,wBAASC,MAAT,CAAgBH,eAAhB,EAAiC;AAC/BI,IAAAA,OAAO,EAAE,CADsB;AAE/BC,IAAAA,QAAQ,EAAET,eAFqB;AAG/BU,IAAAA,MAAM,EAAEC,oBAAOC,GAAP,CAAWD,oBAAOE,IAAlB,CAHuB;AAI/BC,IAAAA,eAAe,EAAE;AAJc,GAAjC,EAKGC,KALH;;AAMAT,wBAASC,MAAT,CAAgBF,aAAhB,EAA+B;AAC7BG,IAAAA,OAAO,EAAE,CADoB;AAE7BC,IAAAA,QAAQ,EAAET,eAFmB;AAG7Bc,IAAAA,eAAe,EAAE;AAHY,GAA/B,EAIGC,KAJH;AAMD,CApCM","sourcesContent":["import { Animated, Easing } from 'react-native';\n\nconst ANIMATION_SPEED = 140\n\nexport const transitionSwitch = (\n active: boolean,\n translate: number,\n transitionValue: Animated.Value,\n animatedColor: Animated.Value\n): void => {\n\n if (translate <= 0) return\n \n if (active) {\n Animated.timing(transitionValue, {\n toValue: translate,\n duration: ANIMATION_SPEED,\n easing: Easing.out(Easing.ease),\n useNativeDriver: true,\n }).start();\n Animated.timing(animatedColor, {\n toValue: 1,\n duration: ANIMATION_SPEED,\n useNativeDriver: false,\n }).start();\n return\n } \n\n Animated.timing(transitionValue, {\n toValue: 0,\n duration: ANIMATION_SPEED,\n easing: Easing.out(Easing.ease),\n useNativeDriver: true,\n }).start();\n Animated.timing(animatedColor, {\n toValue: 0,\n duration: ANIMATION_SPEED,\n useNativeDriver: false,\n }).start();\n\n};\n"],"file":"animation.js"}
@@ -1,23 +1,13 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "Switch", {
7
- enumerable: true,
8
- get: function () {
9
- return _Switch.default;
10
- }
11
- });
12
- Object.defineProperty(exports, "SwitchProps", {
13
- enumerable: true,
14
- get: function () {
15
- return _Switch.SwitchProps;
16
- }
17
- });
3
+ exports.__esModule = true;
4
+ exports.SwitchProps = exports.Switch = void 0;
18
5
 
19
6
  var _Switch = _interopRequireWildcard(require("./Switch"));
20
7
 
8
+ exports.Switch = _Switch.default;
9
+ exports.SwitchProps = _Switch.SwitchProps;
10
+
21
11
  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); }
22
12
 
23
13
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Switch/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA","sourcesContent":["export { default as Switch, SwitchProps } from './Switch';\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/Switch/index.ts"],"names":[],"mappings":";;;;;AAAA","sourcesContent":["export { default as Switch, SwitchProps } from './Switch';\n"],"file":"index.js"}
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
3
+ exports.__esModule = true;
6
4
  exports.StyledSwitch = exports.StyledSwitchContent = exports.SWITCH_PIN_WIDTH = exports.SWITCH_BODY_WIDTH = void 0;
7
5
 
8
6
  var _native = _interopRequireDefault(require("@emotion/native"));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Switch/styled.ts"],"names":["SWITCH_BODY_WIDTH","SWITCH_PIN_WIDTH","StyledSwitchContent","Animated","View","theme","borderRadius","pill","spacing","micro","StyledSwitch","miscellaneous","surfaceColor"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;;;AAEO,MAAMA,iBAAiB,GAAG,MAA1B;;AACA,MAAMC,gBAAgB,GAAG,MAAzB;;AAEA,MAAMC,mBAAmB,GAAG,qBAAOC,sBAASC,IAAhB,CAEjC;AACF,mBAAmB,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACC,YAAN,CAAmBC,IAAK;AAC1D,eAAe,CAAC;AAAEF,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACG,OAAN,CAAcC,KAAM;AAClD;AACA,WAAW,uBAAWT,iBAAX,CAA8B;AACzC,YAAY,uBAAW,MAAX,CAAmB;AAC/B,CARO;;AAUA,MAAMU,YAAY,GAAG,qBAAOP,sBAASC,IAAhB,CAA2C;AACvE,mBAAmB,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACC,YAAN,CAAmBC,IAAK;AAC1D,sBAAsB,CAAC;AAAEF,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACM,aAAN,CAAoBC,YAAa;AACtE,WAAW,uBAAWX,gBAAX,CAA6B;AACxC,YAAY,uBAAW,MAAX,CAAmB;AAC/B,CALO","sourcesContent":["import styled from '@emotion/native';\nimport { Animated } from 'react-native';\nimport { StyleProps } from '../../../types/defaults';\nimport { RFValueStr } from '../../../utils';\n\nexport const SWITCH_BODY_WIDTH = '40px'\nexport const SWITCH_PIN_WIDTH = '16px'\n\nexport const StyledSwitchContent = styled(Animated.View)<\n Partial<StyleProps>\n>`\n border-radius: ${({ theme }) => theme.borderRadius.pill};\n padding: 0 ${({ theme }) => theme.spacing.micro};\n justify-content: center;\n width: ${RFValueStr(SWITCH_BODY_WIDTH)};\n height: ${RFValueStr('22px')};\n`;\n\nexport const StyledSwitch = styled(Animated.View)<Partial<StyleProps>>`\n border-radius: ${({ theme }) => theme.borderRadius.pill};\n background-color: ${({ theme }) => theme.miscellaneous.surfaceColor};\n width: ${RFValueStr(SWITCH_PIN_WIDTH)};\n height: ${RFValueStr('16px')};\n`;\n"],"file":"styled.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/Switch/styled.ts"],"names":["SWITCH_BODY_WIDTH","SWITCH_PIN_WIDTH","StyledSwitchContent","Animated","View","theme","borderRadius","pill","spacing","micro","StyledSwitch","miscellaneous","surfaceColor"],"mappings":";;;;;AAAA;;AACA;;AAEA;;;;AAEO,MAAMA,iBAAiB,GAAG,MAA1B;;AACA,MAAMC,gBAAgB,GAAG,MAAzB;;AAEA,MAAMC,mBAAmB,GAAG,qBAAOC,sBAASC,IAAhB,CAEjC;AACF,mBAAmB,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACC,YAAN,CAAmBC,IAAK;AAC1D,eAAe,CAAC;AAAEF,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACG,OAAN,CAAcC,KAAM;AAClD;AACA,WAAW,uBAAWT,iBAAX,CAA8B;AACzC,YAAY,uBAAW,MAAX,CAAmB;AAC/B,CARO;;AAUA,MAAMU,YAAY,GAAG,qBAAOP,sBAASC,IAAhB,CAA2C;AACvE,mBAAmB,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACC,YAAN,CAAmBC,IAAK;AAC1D,sBAAsB,CAAC;AAAEF,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACM,aAAN,CAAoBC,YAAa;AACtE,WAAW,uBAAWX,gBAAX,CAA6B;AACxC,YAAY,uBAAW,MAAX,CAAmB;AAC/B,CALO","sourcesContent":["import styled from '@emotion/native';\nimport { Animated } from 'react-native';\nimport { StyleProps } from '../../../types/defaults';\nimport { RFValueStr } from '../../../utils';\n\nexport const SWITCH_BODY_WIDTH = '40px'\nexport const SWITCH_PIN_WIDTH = '16px'\n\nexport const StyledSwitchContent = styled(Animated.View)<\n Partial<StyleProps>\n>`\n border-radius: ${({ theme }) => theme.borderRadius.pill};\n padding: 0 ${({ theme }) => theme.spacing.micro};\n justify-content: center;\n width: ${RFValueStr(SWITCH_BODY_WIDTH)};\n height: ${RFValueStr('22px')};\n`;\n\nexport const StyledSwitch = styled(Animated.View)<Partial<StyleProps>>`\n border-radius: ${({ theme }) => theme.borderRadius.pill};\n background-color: ${({ theme }) => theme.miscellaneous.surfaceColor};\n width: ${RFValueStr(SWITCH_PIN_WIDTH)};\n height: ${RFValueStr('16px')};\n`;\n"],"file":"styled.js"}
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
3
+ exports.__esModule = true;
6
4
  exports.default = void 0;
7
5
 
8
6
  var _react = _interopRequireWildcard(require("react"));
@@ -43,7 +41,7 @@ const Tag = ({
43
41
  };
44
42
 
45
43
  const handleDismiss = (0, _react.useCallback)(() => {
46
- onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss();
44
+ onDismiss == null ? void 0 : onDismiss();
47
45
  fadeOut();
48
46
  setTimeout(() => setDismiss(true), duration);
49
47
  }, [onDismiss]);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Tag/Tag.tsx"],"names":["Tag","value","icon","variant","dismiss","canDismiss","onDismiss","style","rest","setDismiss","fadeAnim","React","useRef","Animated","Value","current","duration","fadeOut","timing","toValue","useNativeDriver","start","handleDismiss","setTimeout","opacity","size","colorVariant"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;;;AAUA,MAAMA,GAAuB,GAAG,CAAC;AAC/BC,EAAAA,KAD+B;AAE/BC,EAAAA,IAF+B;AAG/BC,EAAAA,OAAO,GAAG,OA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AAD;AACE,IAAA,IAAI,EAAC,eADP;AAEE,IAAA,IAAI,EAAC,SAFP;AAGE,IAAA,IAAI,EAAC,OAHP;AAIE,IAAA,SAAS,EAAC;AAJZ,IADF,CAfJ,CADF;AA2BD,CAtDD;;eAwDetB,G","sourcesContent":["import React, { useCallback, useState } from 'react';\nimport { Animated, ViewProps } from 'react-native';\nimport { IconProps } from '../Icon';\nimport { PressableSurface } from '../PressableSurface';\nimport { StyledCloseIcon, StyledLeftIcon, StyledTagContainer } from './styled';\n\nexport interface TagProps extends ViewProps {\n value: React.ReactNode;\n icon?: IconProps;\n dismiss?: boolean;\n onDismiss?: () => void;\n variant?: 'small' | 'default';\n}\n\nconst Tag: React.FC<TagProps> = ({\n value,\n icon,\n variant = 'small',\n dismiss: canDismiss = false,\n onDismiss,\n style,\n ...rest\n}): JSX.Element => {\n const [dismiss, setDismiss] = useState(false);\n const fadeAnim = React.useRef(new Animated.Value(1)).current;\n const duration = 300;\n\n const fadeOut = () => {\n Animated.timing(fadeAnim, {\n toValue: 0,\n duration,\n useNativeDriver: true,\n }).start();\n };\n\n const handleDismiss = useCallback(() => {\n onDismiss?.();\n fadeOut();\n setTimeout(() => setDismiss(true), duration);\n }, [onDismiss]);\n\n return (\n <StyledTagContainer\n {...rest}\n variant={variant}\n style={[{ opacity: (fadeAnim as unknown) as number }, style]}\n visible={!dismiss}\n >\n {icon && (\n <StyledLeftIcon\n size={icon.size || 'micro'}\n colorVariant={icon.colorVariant || 'primary'}\n {...icon}\n />\n )}\n {value}\n {canDismiss && (\n <PressableSurface onPress={handleDismiss}>\n <StyledCloseIcon\n name=\"close-outline\"\n type=\"ionicon\"\n size=\"centi\"\n fontColor=\"medium\"\n />\n </PressableSurface>\n )}\n </StyledTagContainer>\n );\n};\n\nexport default Tag;\n"],"file":"Tag.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/Tag/Tag.tsx"],"names":["Tag","value","icon","variant","dismiss","canDismiss","onDismiss","style","rest","setDismiss","fadeAnim","React","useRef","Animated","Value","current","duration","fadeOut","timing","toValue","useNativeDriver","start","handleDismiss","setTimeout","opacity","size","colorVariant"],"mappings":";;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;;;AAUA,MAAMA,GAAuB,GAAG,CAAC;AAC/BC,EAAAA,KAD+B;AAE/BC,EAAAA,IAF+B;AAG/BC,EAAAA,OAAO,GAAG,OAHqB;AAI/BC,EAAAA,OAAO,EAAEC,UAAU,GAAG,KAJS;AAK/BC,EAAAA,SAL+B;AAM/BC,EAAAA,KAN+B;AAO/B,KAAGC;AAP4B,CAAD,KAQb;AACjB,QAAM,CAACJ,OAAD,EAAUK,UAAV,IAAwB,qBAAS,KAAT,CAA9B;;AACA,QAAMC,QAAQ,GAAGC,eAAMC,MAAN,CAAa,IAAIC,sBAASC,KAAb,CAAmB,CAAnB,CAAb,EAAoCC,OAArD;;AACA,QAAMC,QAAQ,GAAG,GAAjB;;AAEA,QAAMC,OAAO,GAAG,MAAM;AACpBJ,0BAASK,MAAT,CAAgBR,QAAhB,EAA0B;AACxBS,MAAAA,OAAO,EAAE,CADe;AAExBH,MAAAA,QAFwB;AAGxBI,MAAAA,eAAe,EAAE;AAHO,KAA1B,EAIGC,KAJH;AAKD,GAND;;AAQA,QAAMC,aAAa,GAAG,wBAAY,MAAM;AACtChB,IAAAA,SAAS,QAAT,YAAAA,SAAS;AACTW,IAAAA,OAAO;AACPM,IAAAA,UAAU,CAAC,MAAMd,UAAU,CAAC,IAAD,CAAjB,EAAyBO,QAAzB,CAAV;AACD,GAJqB,EAInB,CAACV,SAAD,CAJmB,CAAtB;AAMA,SACE,6BAAC,0BAAD,eACME,IADN;AAEE,IAAA,OAAO,EAAEL,OAFX;AAGE,IAAA,KAAK,EAAE,CAAC;AAAEqB,MAAAA,OAAO,EAAGd;AAAZ,KAAD,EAA+CH,KAA/C,CAHT;AAIE,IAAA,OAAO,EAAE,CAACH;AAJZ,MAMGF,IAAI,IACH,6BAAC,sBAAD;AACE,IAAA,IAAI,EAAEA,IAAI,CAACuB,IAAL,IAAa,OADrB;AAEE,IAAA,YAAY,EAAEvB,IAAI,CAACwB,YAAL,IAAqB;AAFrC,KAGMxB,IAHN,EAPJ,EAaGD,KAbH,EAcGI,UAAU,IACT,6BAAC,kCAAD;AAAkB,IAAA,OAAO,EAAEiB;AAA3B,KACE,6BAAC,uBAAD;AACE,IAAA,IAAI,EAAC,eADP;AAEE,IAAA,IAAI,EAAC,SAFP;AAGE,IAAA,IAAI,EAAC,OAHP;AAIE,IAAA,SAAS,EAAC;AAJZ,IADF,CAfJ,CADF;AA2BD,CAtDD;;eAwDetB,G","sourcesContent":["import React, { useCallback, useState } from 'react';\nimport { Animated, ViewProps } from 'react-native';\nimport { IconProps } from '../Icon';\nimport { PressableSurface } from '../PressableSurface';\nimport { StyledCloseIcon, StyledLeftIcon, StyledTagContainer } from './styled';\n\nexport interface TagProps extends ViewProps {\n value: React.ReactNode;\n icon?: IconProps;\n dismiss?: boolean;\n onDismiss?: () => void;\n variant?: 'small' | 'default';\n}\n\nconst Tag: React.FC<TagProps> = ({\n value,\n icon,\n variant = 'small',\n dismiss: canDismiss = false,\n onDismiss,\n style,\n ...rest\n}): JSX.Element => {\n const [dismiss, setDismiss] = useState(false);\n const fadeAnim = React.useRef(new Animated.Value(1)).current;\n const duration = 300;\n\n const fadeOut = () => {\n Animated.timing(fadeAnim, {\n toValue: 0,\n duration,\n useNativeDriver: true,\n }).start();\n };\n\n const handleDismiss = useCallback(() => {\n onDismiss?.();\n fadeOut();\n setTimeout(() => setDismiss(true), duration);\n }, [onDismiss]);\n\n return (\n <StyledTagContainer\n {...rest}\n variant={variant}\n style={[{ opacity: (fadeAnim as unknown) as number }, style]}\n visible={!dismiss}\n >\n {icon && (\n <StyledLeftIcon\n size={icon.size || 'micro'}\n colorVariant={icon.colorVariant || 'primary'}\n {...icon}\n />\n )}\n {value}\n {canDismiss && (\n <PressableSurface onPress={handleDismiss}>\n <StyledCloseIcon\n name=\"close-outline\"\n type=\"ionicon\"\n size=\"centi\"\n fontColor=\"medium\"\n />\n </PressableSurface>\n )}\n </StyledTagContainer>\n );\n};\n\nexport default Tag;\n"],"file":"Tag.js"}
@@ -1,23 +1,13 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "Tag", {
7
- enumerable: true,
8
- get: function () {
9
- return _Tag.default;
10
- }
11
- });
12
- Object.defineProperty(exports, "TagProps", {
13
- enumerable: true,
14
- get: function () {
15
- return _Tag.TagProps;
16
- }
17
- });
3
+ exports.__esModule = true;
4
+ exports.TagProps = exports.Tag = void 0;
18
5
 
19
6
  var _Tag = _interopRequireWildcard(require("./Tag"));
20
7
 
8
+ exports.Tag = _Tag.default;
9
+ exports.TagProps = _Tag.TagProps;
10
+
21
11
  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); }
22
12
 
23
13
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Tag/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA","sourcesContent":["export { default as Tag, TagProps } from './Tag';\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/Tag/index.ts"],"names":[],"mappings":";;;;;AAAA","sourcesContent":["export { default as Tag, TagProps } from './Tag';\n"],"file":"index.js"}
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
3
+ exports.__esModule = true;
6
4
  exports.StyledCloseIcon = exports.StyledLeftIcon = exports.StyledTagContainer = void 0;
7
5
 
8
6
  var _native = _interopRequireWildcard(require("@emotion/native"));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Tag/styled.ts"],"names":["smallVariant","theme","variant","borderRadius","micro","spacing","nano","mili","defaultVariant","centi","StyledTagContainerBase","Animated","View","miscellaneous","bodyColor","visible","StyledTagContainer","props","StyledLeftIcon","Icon","StyledCloseIcon"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;;;;;AAGA,MAAMA,YAAY,GAAG,CAAC;AAAEC,EAAAA,KAAF;AAASC,EAAAA;AAAT,CAAD,KACnBA,OAAO,KAAK,OAAZ,IACA,gBAAI;AACN,qBAAqBD,KAAK,CAACE,YAAN,CAAmBC,KAAM;AAC9C,eAAeH,KAAK,CAACI,OAAN,CAAcC,IAAK,IAAGL,KAAK,CAACI,OAAN,CAAcE,IAAK;AACxD,GALA;;AAOA,MAAMC,cAAc,GAAG,CAAC;AAAEP,EAAAA,KAAF;AAASC,EAAAA;AAAT,CAAD,KACrBA,OAAO,KAAK,SAAZ,IACA,gBAAI;AACN,qBAAqBD,KAAK,CAACE,YAAN,CAAmBI,IAAK;AAC7C,eAAeN,KAAK,CAACI,OAAN,CAAcD,KAAM,IAAGH,KAAK,CAACI,OAAN,CAAcI,KAAM;AAC1D,GALA;;AAOA,MAAMC,sBAAsB,GAAG,qBAAOC,sBAASC,IAAhB,CAE7B;AACF,sBAAsB,CAAC;AAAEX,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACY,aAAN,CAAoBC,SAAU;AACnE;AACA;AACA;AACA;AACA,aAAa,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAkBA,OAAO,GAAG,MAAH,GAAY,MAAQ;AAC1D,CATA;AAWO,MAAMC,kBAAkB,GAAG,qBAAON,sBAAP,EAChCO,KAAK,IAAI,gBAAI;AACf,MAAMjB,YAAY,CAACiB,KAAD,CAAQ;AAC1B,MAAMT,cAAc,CAACS,KAAD,CAAQ;AAC5B,GAJkC,CAA3B;;AAOA,MAAMC,cAAc,GAAG,qBAAOC,UAAP,CAA8C;AAC5E,kBAAkB,CAAC;AAAElB,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACI,OAAN,CAAcD,KAAM;AACrD,CAFO;;AAIA,MAAMgB,eAAe,GAAG,qBAAOD,UAAP,CAA8C;AAC7E,iBAAiB,CAAC;AAAElB,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACI,OAAN,CAAcC,IAAK;AACnD,CAFO","sourcesContent":["import styled, { css } from '@emotion/native';\nimport { Animated, ViewProps } from 'react-native';\nimport { StyleProps } from '../../../types/defaults';\nimport { Icon, IconProps } from '../Icon';\nimport { TagProps } from './Tag';\n\nconst smallVariant = ({ theme, variant }: Partial<TagProps> & StyleProps) =>\n variant === 'small' &&\n css`\n border-radius: ${theme.borderRadius.micro};\n padding: ${theme.spacing.nano} ${theme.spacing.mili};\n `;\n\nconst defaultVariant = ({ theme, variant }: Partial<TagProps> & StyleProps) =>\n variant === 'default' &&\n css`\n border-radius: ${theme.borderRadius.mili};\n padding: ${theme.spacing.micro} ${theme.spacing.centi};\n `;\n\nconst StyledTagContainerBase = styled(Animated.View)<\n Partial<TagProps> & Partial<StyleProps> & ViewProps & { visible: boolean }\n>`\n background-color: ${({ theme }) => theme.miscellaneous.bodyColor};\n flex-direction: row;\n justify-content: center;\n align-items: center;\n align-self: center;\n display: ${({ visible }) => (visible ? 'flex' : 'none')};\n`;\n\nexport const StyledTagContainer = styled(StyledTagContainerBase)(\n props => css`\n ${smallVariant(props)}\n ${defaultVariant(props)}\n `\n);\n\nexport const StyledLeftIcon = styled(Icon)<Partial<StyleProps> & IconProps>`\n margin-right: ${({ theme }) => theme.spacing.micro};\n`;\n\nexport const StyledCloseIcon = styled(Icon)<Partial<StyleProps> & IconProps>`\n margin-left: ${({ theme }) => theme.spacing.nano};\n`;\n"],"file":"styled.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/Tag/styled.ts"],"names":["smallVariant","theme","variant","borderRadius","micro","spacing","nano","mili","defaultVariant","centi","StyledTagContainerBase","Animated","View","miscellaneous","bodyColor","visible","StyledTagContainer","props","StyledLeftIcon","Icon","StyledCloseIcon"],"mappings":";;;;;AAAA;;AACA;;AAEA;;;;;;AAGA,MAAMA,YAAY,GAAG,CAAC;AAAEC,EAAAA,KAAF;AAASC,EAAAA;AAAT,CAAD,KACnBA,OAAO,KAAK,OAAZ,IACA,gBAAI;AACN,qBAAqBD,KAAK,CAACE,YAAN,CAAmBC,KAAM;AAC9C,eAAeH,KAAK,CAACI,OAAN,CAAcC,IAAK,IAAGL,KAAK,CAACI,OAAN,CAAcE,IAAK;AACxD,GALA;;AAOA,MAAMC,cAAc,GAAG,CAAC;AAAEP,EAAAA,KAAF;AAASC,EAAAA;AAAT,CAAD,KACrBA,OAAO,KAAK,SAAZ,IACA,gBAAI;AACN,qBAAqBD,KAAK,CAACE,YAAN,CAAmBI,IAAK;AAC7C,eAAeN,KAAK,CAACI,OAAN,CAAcD,KAAM,IAAGH,KAAK,CAACI,OAAN,CAAcI,KAAM;AAC1D,GALA;;AAOA,MAAMC,sBAAsB,GAAG,qBAAOC,sBAASC,IAAhB,CAE7B;AACF,sBAAsB,CAAC;AAAEX,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACY,aAAN,CAAoBC,SAAU;AACnE;AACA;AACA;AACA;AACA,aAAa,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAkBA,OAAO,GAAG,MAAH,GAAY,MAAQ;AAC1D,CATA;AAWO,MAAMC,kBAAkB,GAAG,qBAAON,sBAAP,EAChCO,KAAK,IAAI,gBAAI;AACf,MAAMjB,YAAY,CAACiB,KAAD,CAAQ;AAC1B,MAAMT,cAAc,CAACS,KAAD,CAAQ;AAC5B,GAJkC,CAA3B;;AAOA,MAAMC,cAAc,GAAG,qBAAOC,UAAP,CAA8C;AAC5E,kBAAkB,CAAC;AAAElB,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACI,OAAN,CAAcD,KAAM;AACrD,CAFO;;AAIA,MAAMgB,eAAe,GAAG,qBAAOD,UAAP,CAA8C;AAC7E,iBAAiB,CAAC;AAAElB,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACI,OAAN,CAAcC,IAAK;AACnD,CAFO","sourcesContent":["import styled, { css } from '@emotion/native';\nimport { Animated, ViewProps } from 'react-native';\nimport { StyleProps } from '../../../types/defaults';\nimport { Icon, IconProps } from '../Icon';\nimport { TagProps } from './Tag';\n\nconst smallVariant = ({ theme, variant }: Partial<TagProps> & StyleProps) =>\n variant === 'small' &&\n css`\n border-radius: ${theme.borderRadius.micro};\n padding: ${theme.spacing.nano} ${theme.spacing.mili};\n `;\n\nconst defaultVariant = ({ theme, variant }: Partial<TagProps> & StyleProps) =>\n variant === 'default' &&\n css`\n border-radius: ${theme.borderRadius.mili};\n padding: ${theme.spacing.micro} ${theme.spacing.centi};\n `;\n\nconst StyledTagContainerBase = styled(Animated.View)<\n Partial<TagProps> & Partial<StyleProps> & ViewProps & { visible: boolean }\n>`\n background-color: ${({ theme }) => theme.miscellaneous.bodyColor};\n flex-direction: row;\n justify-content: center;\n align-items: center;\n align-self: center;\n display: ${({ visible }) => (visible ? 'flex' : 'none')};\n`;\n\nexport const StyledTagContainer = styled(StyledTagContainerBase)(\n props => css`\n ${smallVariant(props)}\n ${defaultVariant(props)}\n `\n);\n\nexport const StyledLeftIcon = styled(Icon)<Partial<StyleProps> & IconProps>`\n margin-right: ${({ theme }) => theme.spacing.micro};\n`;\n\nexport const StyledCloseIcon = styled(Icon)<Partial<StyleProps> & IconProps>`\n margin-left: ${({ theme }) => theme.spacing.nano};\n`;\n"],"file":"styled.js"}
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
3
+ exports.__esModule = true;
6
4
  exports.default = void 0;
7
5
 
8
6
  var _react = _interopRequireDefault(require("react"));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Text/Text.tsx"],"names":["Text","children","style","fontColor","colorTone","colorVariant","fontWeight","typography","numberOfLines","ellipsizeMode","rest"],"mappings":";;;;;;;AAAA;;AAUA;;;;;;AAqBA,MAAMA,IAAmB,GAAG,CAAC;AAC3BC,EAAAA,QAD2B;AAE3BC,EAAAA,KAF2B;AAG3BC,EAAAA,SAAS,GAAG,MAHe;AAI3BC,EAAAA,SAAS,GAAG,QAJe;AAK3BC,EAAAA,YAL2B;AAM3BC,EAAAA,UAAU,GAAG,SANc;AAO3BC,EAAAA,UAAU,GAAG,MAPc;AAQ3BC,EAAAA,aAR2B;AAS3BC,EAAAA,aAT2B;AAU3B,KAAGC;AAVwB,CAAD,KAWT;AACjB,SACE,6BAAC,yBAAD,eACMA,IADN;AAEE,IAAA,KAAK,EAAER,KAFT;AAGE,IAAA,SAAS,EAAEC,SAHb;AAIE,IAAA,SAAS,EAAEC,SAJb;AAKE,IAAA,YAAY,EAAEC,YALhB;AAME,IAAA,UAAU,EAAEC,UANd;AAOE,IAAA,UAAU,EAAEC,UAPd;AAQE,IAAA,aAAa,EAAEC,aARjB;AASE,IAAA,aAAa,EAAEC;AATjB,MAWGR,QAXH,CADF;AAeD,CA3BD;;eA6BeD,I","sourcesContent":["import React, { FC } from 'react';\nimport {\n ColorGradationType,\n ColorType,\n FontColorType,\n FontStackType,\n FontWeightType,\n TypographyVariationType,\n} from '@tecsinapse/react-core';\nimport { StyleProp, TextStyle } from 'react-native';\nimport { StyledColoredText } from './styled';\n\nexport interface TextProps {\n /** Font theme text color */\n fontColor?: FontColorType;\n /** Font theme weight */\n fontWeight?: FontWeightType;\n /** Font theme sizes */\n typography?: TypographyVariationType;\n /** Font theme stack */\n fontStack?: FontStackType;\n /** Palette theme colors. You can specify this prop to override theme fontColor */\n colorVariant?: ColorType;\n /** Palette theme colors gradation */\n colorTone?: ColorGradationType;\n numberOfLines?: number;\n ellipsizeMode?: 'head' | 'middle' | 'tail' | 'clip';\n style?: StyleProp<TextStyle>;\n}\n\n/** NOTE: When using colors, be careful to not override fontColor by using colorVariant and colorTone, referent to theme colors and not text colors. */\nconst Text: FC<TextProps> = ({\n children,\n style,\n fontColor = 'dark',\n colorTone = 'medium',\n colorVariant,\n fontWeight = 'regular',\n typography = 'base',\n numberOfLines,\n ellipsizeMode,\n ...rest\n}): JSX.Element => {\n return (\n <StyledColoredText\n {...rest}\n style={style}\n fontColor={fontColor}\n colorTone={colorTone}\n colorVariant={colorVariant}\n fontWeight={fontWeight}\n typography={typography}\n numberOfLines={numberOfLines}\n ellipsizeMode={ellipsizeMode}\n >\n {children}\n </StyledColoredText>\n );\n};\n\nexport default Text;\n"],"file":"Text.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/Text/Text.tsx"],"names":["Text","children","style","fontColor","colorTone","colorVariant","fontWeight","typography","numberOfLines","ellipsizeMode","rest"],"mappings":";;;;;AAAA;;AAUA;;;;;;AAqBA,MAAMA,IAAmB,GAAG,CAAC;AAC3BC,EAAAA,QAD2B;AAE3BC,EAAAA,KAF2B;AAG3BC,EAAAA,SAAS,GAAG,MAHe;AAI3BC,EAAAA,SAAS,GAAG,QAJe;AAK3BC,EAAAA,YAL2B;AAM3BC,EAAAA,UAAU,GAAG,SANc;AAO3BC,EAAAA,UAAU,GAAG,MAPc;AAQ3BC,EAAAA,aAR2B;AAS3BC,EAAAA,aAT2B;AAU3B,KAAGC;AAVwB,CAAD,KAWT;AACjB,SACE,6BAAC,yBAAD,eACMA,IADN;AAEE,IAAA,KAAK,EAAER,KAFT;AAGE,IAAA,SAAS,EAAEC,SAHb;AAIE,IAAA,SAAS,EAAEC,SAJb;AAKE,IAAA,YAAY,EAAEC,YALhB;AAME,IAAA,UAAU,EAAEC,UANd;AAOE,IAAA,UAAU,EAAEC,UAPd;AAQE,IAAA,aAAa,EAAEC,aARjB;AASE,IAAA,aAAa,EAAEC;AATjB,MAWGR,QAXH,CADF;AAeD,CA3BD;;eA6BeD,I","sourcesContent":["import React, { FC } from 'react';\nimport {\n ColorGradationType,\n ColorType,\n FontColorType,\n FontStackType,\n FontWeightType,\n TypographyVariationType,\n} from '@tecsinapse/react-core';\nimport { StyleProp, TextStyle } from 'react-native';\nimport { StyledColoredText } from './styled';\n\nexport interface TextProps {\n /** Font theme text color */\n fontColor?: FontColorType;\n /** Font theme weight */\n fontWeight?: FontWeightType;\n /** Font theme sizes */\n typography?: TypographyVariationType;\n /** Font theme stack */\n fontStack?: FontStackType;\n /** Palette theme colors. You can specify this prop to override theme fontColor */\n colorVariant?: ColorType;\n /** Palette theme colors gradation */\n colorTone?: ColorGradationType;\n numberOfLines?: number;\n ellipsizeMode?: 'head' | 'middle' | 'tail' | 'clip';\n style?: StyleProp<TextStyle>;\n}\n\n/** NOTE: When using colors, be careful to not override fontColor by using colorVariant and colorTone, referent to theme colors and not text colors. */\nconst Text: FC<TextProps> = ({\n children,\n style,\n fontColor = 'dark',\n colorTone = 'medium',\n colorVariant,\n fontWeight = 'regular',\n typography = 'base',\n numberOfLines,\n ellipsizeMode,\n ...rest\n}): JSX.Element => {\n return (\n <StyledColoredText\n {...rest}\n style={style}\n fontColor={fontColor}\n colorTone={colorTone}\n colorVariant={colorVariant}\n fontWeight={fontWeight}\n typography={typography}\n numberOfLines={numberOfLines}\n ellipsizeMode={ellipsizeMode}\n >\n {children}\n </StyledColoredText>\n );\n};\n\nexport default Text;\n"],"file":"Text.js"}
@@ -1,23 +1,13 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "Text", {
7
- enumerable: true,
8
- get: function () {
9
- return _Text.default;
10
- }
11
- });
12
- Object.defineProperty(exports, "TextProps", {
13
- enumerable: true,
14
- get: function () {
15
- return _Text.TextProps;
16
- }
17
- });
3
+ exports.__esModule = true;
4
+ exports.TextProps = exports.Text = void 0;
18
5
 
19
6
  var _Text = _interopRequireWildcard(require("./Text"));
20
7
 
8
+ exports.Text = _Text.default;
9
+ exports.TextProps = _Text.TextProps;
10
+
21
11
  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); }
22
12
 
23
13
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Text/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA","sourcesContent":["export { default as Text, TextProps } from './Text';\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/Text/index.ts"],"names":[],"mappings":";;;;;AAAA","sourcesContent":["export { default as Text, TextProps } from './Text';\n"],"file":"index.js"}
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
3
+ exports.__esModule = true;
6
4
  exports.StyledColoredText = exports.StyledText = void 0;
7
5
 
8
6
  var _native = _interopRequireWildcard(require("@emotion/native"));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Text/styled.ts"],"names":["StyledText","RNText","theme","fontColor","font","color","fontWeight","weight","typography","fontSize","lineHeight","fontStack","stack","colorStyles","colorVariant","colorTone","StyledColoredText"],"mappings":";;;;;;;AAAA;;AAEA;;;;;;AAEO,MAAMA,UAAU,GAAG,qBAAOC,iBAAP,CAAgD;AAC1E,WAAW,CAAC;AAAEC,EAAAA,KAAF;AAASC,EAAAA,SAAS,GAAG;AAArB,CAAD,KAAmCD,KAAK,CAACE,IAAN,CAAWC,KAAX,CAAiBF,SAAjB,CAA4B;AAC1E,iBAAiB,CAAC;AAAED,EAAAA,KAAF;AAASI,EAAAA,UAAU,GAAG;AAAtB,CAAD,KACbJ,KAAK,CAACE,IAAN,CAAWG,MAAX,CAAkBD,UAAlB,CAA8B;AAClC,eAAe,CAAC;AAAEJ,EAAAA,KAAF;AAASM,EAAAA,UAAU,GAAG;AAAtB,CAAD,KACXN,KAAK,CAACM,UAAN,CAAiBA,UAAjB,EAA6BC,QAAS;AAC1C,iBAAiB,CAAC;AAAEP,EAAAA,KAAF;AAASM,EAAAA,UAAU,GAAG;AAAtB,CAAD,KACbN,KAAK,CAACM,UAAN,CAAiBA,UAAjB,EAA6BE,UAAW;AAC5C,iBAAiB,CAAC;AAAER,EAAAA,KAAF;AAASS,EAAAA,SAAS,GAAG;AAArB,CAAD,KACZ,IAAGT,KAAK,CAACE,IAAN,CAAWQ,KAAX,CAAiBD,SAAjB,CAA4B,GAAG;AACvC,CAVO;;;AAYP,MAAME,WAAW,GAAG,CAAC;AACnBC,EAAAA,YADmB;AAEnBC,EAAAA,SAFmB;AAGnBb,EAAAA;AAHmB,CAAD,KAKlBY,YAAY,IACZC,SADA,IAEA,gBAAI;AACN,aAAab,KAAK,CAACG,KAAN,CAAYS,YAAZ,EAA0BC,SAA1B,CAAqC;AAClD,GATA;;AAWO,MAAMC,iBAAiB,GAAG,qBAAOhB,UAAP,EAE/Ba,WAF+B,CAA1B","sourcesContent":["import styled, { css } from '@emotion/native';\nimport { StyleProps, TextProps } from '@tecsinapse/react-core';\nimport { Text as RNText } from 'react-native';\n\nexport const StyledText = styled(RNText)<TextProps & Partial<StyleProps>>`\n color: ${({ theme, fontColor = 'dark' }) => theme.font.color[fontColor]};\n font-weight: ${({ theme, fontWeight = 'regular' }) =>\n theme.font.weight[fontWeight]};\n font-size: ${({ theme, typography = 'base' }) =>\n theme.typography[typography].fontSize};\n line-height: ${({ theme, typography = 'base' }) =>\n theme.typography[typography].lineHeight};\n font-family: ${({ theme, fontStack = 'default' }) =>\n `'${theme.font.stack[fontStack]}'`};\n`;\n\nconst colorStyles = ({\n colorVariant,\n colorTone,\n theme,\n}: TextProps & StyleProps) =>\n colorVariant &&\n colorTone &&\n css`\n color: ${theme.color[colorVariant][colorTone]};\n `;\n\nexport const StyledColoredText = styled(StyledText)<\n TextProps & Partial<StyleProps>\n>(colorStyles);\n"],"file":"styled.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/Text/styled.ts"],"names":["StyledText","RNText","theme","fontColor","font","color","fontWeight","weight","typography","fontSize","lineHeight","fontStack","stack","colorStyles","colorVariant","colorTone","StyledColoredText"],"mappings":";;;;;AAAA;;AAEA;;;;;;AAEO,MAAMA,UAAU,GAAG,qBAAOC,iBAAP,CAAgD;AAC1E,WAAW,CAAC;AAAEC,EAAAA,KAAF;AAASC,EAAAA,SAAS,GAAG;AAArB,CAAD,KAAmCD,KAAK,CAACE,IAAN,CAAWC,KAAX,CAAiBF,SAAjB,CAA4B;AAC1E,iBAAiB,CAAC;AAAED,EAAAA,KAAF;AAASI,EAAAA,UAAU,GAAG;AAAtB,CAAD,KACbJ,KAAK,CAACE,IAAN,CAAWG,MAAX,CAAkBD,UAAlB,CAA8B;AAClC,eAAe,CAAC;AAAEJ,EAAAA,KAAF;AAASM,EAAAA,UAAU,GAAG;AAAtB,CAAD,KACXN,KAAK,CAACM,UAAN,CAAiBA,UAAjB,EAA6BC,QAAS;AAC1C,iBAAiB,CAAC;AAAEP,EAAAA,KAAF;AAASM,EAAAA,UAAU,GAAG;AAAtB,CAAD,KACbN,KAAK,CAACM,UAAN,CAAiBA,UAAjB,EAA6BE,UAAW;AAC5C,iBAAiB,CAAC;AAAER,EAAAA,KAAF;AAASS,EAAAA,SAAS,GAAG;AAArB,CAAD,KACZ,IAAGT,KAAK,CAACE,IAAN,CAAWQ,KAAX,CAAiBD,SAAjB,CAA4B,GAAG;AACvC,CAVO;;;AAYP,MAAME,WAAW,GAAG,CAAC;AACnBC,EAAAA,YADmB;AAEnBC,EAAAA,SAFmB;AAGnBb,EAAAA;AAHmB,CAAD,KAKlBY,YAAY,IACZC,SADA,IAEA,gBAAI;AACN,aAAab,KAAK,CAACG,KAAN,CAAYS,YAAZ,EAA0BC,SAA1B,CAAqC;AAClD,GATA;;AAWO,MAAMC,iBAAiB,GAAG,qBAAOhB,UAAP,EAE/Ba,WAF+B,CAA1B","sourcesContent":["import styled, { css } from '@emotion/native';\nimport { StyleProps, TextProps } from '@tecsinapse/react-core';\nimport { Text as RNText } from 'react-native';\n\nexport const StyledText = styled(RNText)<TextProps & Partial<StyleProps>>`\n color: ${({ theme, fontColor = 'dark' }) => theme.font.color[fontColor]};\n font-weight: ${({ theme, fontWeight = 'regular' }) =>\n theme.font.weight[fontWeight]};\n font-size: ${({ theme, typography = 'base' }) =>\n theme.typography[typography].fontSize};\n line-height: ${({ theme, typography = 'base' }) =>\n theme.typography[typography].lineHeight};\n font-family: ${({ theme, fontStack = 'default' }) =>\n `'${theme.font.stack[fontStack]}'`};\n`;\n\nconst colorStyles = ({\n colorVariant,\n colorTone,\n theme,\n}: TextProps & StyleProps) =>\n colorVariant &&\n colorTone &&\n css`\n color: ${theme.color[colorVariant][colorTone]};\n `;\n\nexport const StyledColoredText = styled(StyledText)<\n TextProps & Partial<StyleProps>\n>(colorStyles);\n"],"file":"styled.js"}
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
3
+ exports.__esModule = true;
6
4
  exports.elevatedStyles = exports.baseStyles = void 0;
7
5
 
8
6
  var _native = require("@emotion/native");
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/shared/PaperAndCard.ts"],"names":["baseStyles","theme","borderRadius","mili","miscellaneous","surfaceColor","elevatedStyles","elevated","shadowColor","shadow","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation"],"mappings":";;;;;;;AAAA;;AAIO,MAAMA,UAAU,GAAG,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAgC,gBAAI;AAC9D,mBAAmBA,KAAK,CAACC,YAAN,CAAmBC,IAAK;AAC3C,sBAAsBF,KAAK,CAACG,aAAN,CAAoBC,YAAa;AACvD,CAHO;;;;AAMA,MAAMC,cAAc,GAAG,CAAC;AAC7BL,EAAAA,KAD6B;AAE7BM,EAAAA,QAAQ,GAAG;AAFkB,CAAD,KAI5BA,QAAQ,IAAI,CACV,iBAAI;AACFC,EAAAA,WAAW,EAAEP,KAAK,CAACG,aAAN,CAAoBK,MAD/B;AAEFC,EAAAA,YAAY,EAAE;AAAEC,IAAAA,KAAK,EAAE,CAAT;AAAYC,IAAAA,MAAM,EAAE;AAApB,GAFZ;AAGFC,EAAAA,aAAa,EAAE,IAHb;AAIFC,EAAAA,YAAY,EAAE,CAJZ;AAKFC,EAAAA,SAAS,EAAE;AALT,CAAJ,CADU,CAJP","sourcesContent":["import { css } from '@emotion/native';\nimport { StyleProps } from '@tecsinapse/react-core';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const baseStyles = ({ theme }: StyleProps): any => css`\n border-radius: ${theme.borderRadius.mili};\n background-color: ${theme.miscellaneous.surfaceColor};\n`;\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const elevatedStyles = ({\n theme,\n elevated = false,\n}: { elevated?: boolean } & StyleProps): any =>\n elevated && [\n css({\n shadowColor: theme.miscellaneous.shadow,\n shadowOffset: { width: 0, height: 2 },\n shadowOpacity: 0.05,\n shadowRadius: 5,\n elevation: 2\n }),\n ];\n/* eslint-enable @typescript-eslint/no-explicit-any */\n"],"file":"PaperAndCard.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/shared/PaperAndCard.ts"],"names":["baseStyles","theme","borderRadius","mili","miscellaneous","surfaceColor","elevatedStyles","elevated","shadowColor","shadow","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation"],"mappings":";;;;;AAAA;;AAIO,MAAMA,UAAU,GAAG,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAgC,gBAAI;AAC9D,mBAAmBA,KAAK,CAACC,YAAN,CAAmBC,IAAK;AAC3C,sBAAsBF,KAAK,CAACG,aAAN,CAAoBC,YAAa;AACvD,CAHO;;;;AAMA,MAAMC,cAAc,GAAG,CAAC;AAC7BL,EAAAA,KAD6B;AAE7BM,EAAAA,QAAQ,GAAG;AAFkB,CAAD,KAI5BA,QAAQ,IAAI,CACV,iBAAI;AACFC,EAAAA,WAAW,EAAEP,KAAK,CAACG,aAAN,CAAoBK,MAD/B;AAEFC,EAAAA,YAAY,EAAE;AAAEC,IAAAA,KAAK,EAAE,CAAT;AAAYC,IAAAA,MAAM,EAAE;AAApB,GAFZ;AAGFC,EAAAA,aAAa,EAAE,IAHb;AAIFC,EAAAA,YAAY,EAAE,CAJZ;AAKFC,EAAAA,SAAS,EAAE;AALT,CAAJ,CADU,CAJP","sourcesContent":["import { css } from '@emotion/native';\nimport { StyleProps } from '@tecsinapse/react-core';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const baseStyles = ({ theme }: StyleProps): any => css`\n border-radius: ${theme.borderRadius.mili};\n background-color: ${theme.miscellaneous.surfaceColor};\n`;\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const elevatedStyles = ({\n theme,\n elevated = false,\n}: { elevated?: boolean } & StyleProps): any =>\n elevated && [\n css({\n shadowColor: theme.miscellaneous.shadow,\n shadowOffset: { width: 0, height: 2 },\n shadowOpacity: 0.05,\n shadowRadius: 5,\n elevation: 2\n }),\n ];\n/* eslint-enable @typescript-eslint/no-explicit-any */\n"],"file":"PaperAndCard.js"}
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
3
+ exports.__esModule = true;
6
4
  exports.default = void 0;
7
5
 
8
6
  var _dateFns = require("date-fns");
@@ -51,13 +49,13 @@ function Calendar({
51
49
  const startingWeekDay = React.useMemo(() => {
52
50
  var _locale$options;
53
51
 
54
- return dayOfWeekFromWeekStart(referenceDate.getDay(), (locale === null || locale === void 0 ? void 0 : (_locale$options = locale.options) === null || _locale$options === void 0 ? void 0 : _locale$options.weekStartsOn) ?? 0);
52
+ return dayOfWeekFromWeekStart(referenceDate.getDay(), (locale == null ? void 0 : (_locale$options = locale.options) == null ? void 0 : _locale$options.weekStartsOn) ?? 0);
55
53
  }, [referenceDate, locale]);
56
54
  const weeksInMonth = React.useMemo(() => {
57
55
  var _locale$options2;
58
56
 
59
57
  return (0, _dateFns.getWeeksInMonth)(referenceDate, {
60
- weekStartsOn: (locale === null || locale === void 0 ? void 0 : (_locale$options2 = locale.options) === null || _locale$options2 === void 0 ? void 0 : _locale$options2.weekStartsOn) ?? 0
58
+ weekStartsOn: (locale == null ? void 0 : (_locale$options2 = locale.options) == null ? void 0 : _locale$options2.weekStartsOn) ?? 0
61
59
  });
62
60
  }, [referenceDate, locale]);
63
61
  const Capitalized = React.useMemo(() => (0, _styled.getCapitalizedTextComponent)(TextComponent), [TextComponent]);