sapo-components-ui-rn 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/README.md +69 -0
  2. package/dist/assets/error.png +0 -0
  3. package/dist/assets/icon-checkbox-active.svg +4 -0
  4. package/dist/assets/icon-checkbox.svg +3 -0
  5. package/dist/assets/image_default.png +0 -0
  6. package/dist/assets/images/error.png +0 -0
  7. package/dist/assets/images/image_default.png +0 -0
  8. package/dist/assets/images/info.png +0 -0
  9. package/dist/assets/images/success.png +0 -0
  10. package/dist/assets/images/warning.png +0 -0
  11. package/dist/assets/info.png +0 -0
  12. package/dist/assets/success.png +0 -0
  13. package/dist/assets/svg/icon-checkbox-active.svg +4 -0
  14. package/dist/assets/svg/icon-checkbox.svg +3 -0
  15. package/dist/assets/warning.png +0 -0
  16. package/dist/components/ActivityIndicator.d.ts +28 -0
  17. package/dist/components/Avatar/index.d.ts +17 -0
  18. package/dist/components/Badge/index.d.ts +13 -0
  19. package/dist/components/Button/index.d.ts +23 -0
  20. package/dist/components/ButtonIcon/index.d.ts +18 -0
  21. package/dist/components/Checkbox/index.d.ts +14 -0
  22. package/dist/components/ChipBar/index.d.ts +16 -0
  23. package/dist/components/CountingDot/index.d.ts +13 -0
  24. package/dist/components/FloatingButton/index.d.ts +17 -0
  25. package/dist/components/Icon/index.d.ts +17 -0
  26. package/dist/components/IconSvg/index.d.ts +12 -0
  27. package/dist/components/Image/index.d.ts +14 -0
  28. package/dist/components/ProgressBar.d.ts +42 -0
  29. package/dist/components/RadioButton/index.d.ts +13 -0
  30. package/dist/components/ScaleButton/index.d.ts +4 -0
  31. package/dist/components/SelectionField/index.d.ts +24 -0
  32. package/dist/components/Spacer/index.d.ts +9 -0
  33. package/dist/components/Switch/Switch.d.ts +47 -0
  34. package/dist/components/Switch/utils.d.ts +14 -0
  35. package/dist/components/Text/index.d.ts +14 -0
  36. package/dist/components/TextInput/Addons/Outline.d.ts +15 -0
  37. package/dist/components/TextInput/Addons/Underline.d.ts +19 -0
  38. package/dist/components/TextInput/Adornment/TextInputAdornment.d.ts +43 -0
  39. package/dist/components/TextInput/Adornment/TextInputAffix.d.ts +72 -0
  40. package/dist/components/TextInput/Adornment/enums.d.ts +12 -0
  41. package/dist/components/TextInput/Adornment/types.d.ts +11 -0
  42. package/dist/components/TextInput/Adornment/utils.d.ts +11 -0
  43. package/dist/components/TextInput/Label/InputLabel.d.ts +4 -0
  44. package/dist/components/TextInput/Label/LabelBackground.d.ts +4 -0
  45. package/dist/components/TextInput/TextInput.d.ts +171 -0
  46. package/dist/components/TextInput/TextInputDefault.d.ts +4 -0
  47. package/dist/components/TextInput/TextInputFlat.d.ts +4 -0
  48. package/dist/components/TextInput/constants.d.ts +31 -0
  49. package/dist/components/TextInput/helpers.d.ts +95 -0
  50. package/dist/components/TextInput/types.d.ts +154 -0
  51. package/dist/components/Toast/ToastProvider.d.ts +21 -0
  52. package/dist/components/Toast/index.d.ts +3 -0
  53. package/dist/components/Typography/AnimatedText.d.ts +34 -0
  54. package/dist/components/Typography/StyledText.d.ts +12 -0
  55. package/dist/components/Typography/Text.d.ts +35 -0
  56. package/dist/components/Typography/types.d.ts +2 -0
  57. package/dist/components/View/index.d.ts +38 -0
  58. package/dist/components/ViewVisibleAnimated/index.d.ts +25 -0
  59. package/dist/constants.d.ts +1 -0
  60. package/dist/core/theming.d.ts +43 -0
  61. package/dist/icons/IconArrowDown.d.ts +4 -0
  62. package/dist/icons/IconCheckbox.d.ts +4 -0
  63. package/dist/icons/IconCheckboxActive.d.ts +4 -0
  64. package/dist/icons/IconClearText.d.ts +4 -0
  65. package/dist/icons/IconRadio.d.ts +4 -0
  66. package/dist/icons/IconRadioActive.d.ts +4 -0
  67. package/dist/icons/IconRadioDisable.d.ts +4 -0
  68. package/dist/index.d.ts +33 -0
  69. package/dist/index.esm.js +6758 -0
  70. package/dist/index.esm.js.map +1 -0
  71. package/dist/index.js +6823 -0
  72. package/dist/index.js.map +1 -0
  73. package/dist/styles/fonts.d.ts +78 -0
  74. package/dist/styles/overlay.d.ts +3 -0
  75. package/dist/styles/shadow.d.ts +18 -0
  76. package/dist/styles/themes/DarkTheme.d.ts +2 -0
  77. package/dist/styles/themes/LightTheme.d.ts +2 -0
  78. package/dist/styles/themes/index.d.ts +2 -0
  79. package/dist/styles/themes/tokens.d.ts +830 -0
  80. package/dist/theme/blue.d.ts +14 -0
  81. package/dist/theme/colors.d.ts +99 -0
  82. package/dist/theme/container-styles.d.ts +124 -0
  83. package/dist/theme/dimensions.d.ts +36 -0
  84. package/dist/theme/green.d.ts +15 -0
  85. package/dist/theme/icon.d.ts +5 -0
  86. package/dist/theme/ink.d.ts +11 -0
  87. package/dist/theme/orange.d.ts +14 -0
  88. package/dist/theme/purple.d.ts +6 -0
  89. package/dist/theme/red.d.ts +15 -0
  90. package/dist/theme/themes.d.ts +277 -0
  91. package/dist/theme/white.d.ts +10 -0
  92. package/dist/theme/yellow.d.ts +15 -0
  93. package/dist/types/index.d.ts +65 -0
  94. package/dist/types.d.ts +220 -0
  95. package/dist/utils/BackHandler/BackHandler.d.ts +9 -0
  96. package/dist/utils/BackHandler/BackHandler.native.d.ts +2 -0
  97. package/dist/utils/addEventListener.d.ts +12 -0
  98. package/dist/utils/forwardRef.d.ts +11 -0
  99. package/dist/utils/function-utils.d.ts +12 -0
  100. package/dist/utils/getContrastingColor.d.ts +2 -0
  101. package/dist/utils/hasTouchHandler.d.ts +5 -0
  102. package/dist/utils/roundLayoutSize.d.ts +1 -0
  103. package/dist/utils/splitStyles.d.ts +19 -0
  104. package/dist/utils/toast-manager.d.ts +21 -0
  105. package/dist/utils/useAnimatedValue.d.ts +2 -0
  106. package/dist/utils/useAnimatedValueArray.d.ts +2 -0
  107. package/dist/utils/useIsKeyboardShown.d.ts +6 -0
  108. package/dist/utils/useLayout.d.ts +6 -0
  109. package/dist/utils/useLazyRef.d.ts +2 -0
  110. package/package.json +104 -0
  111. package/src/.DS_Store +0 -0
  112. package/src/assets/images/error.png +0 -0
  113. package/src/assets/images/image_default.png +0 -0
  114. package/src/assets/images/info.png +0 -0
  115. package/src/assets/images/success.png +0 -0
  116. package/src/assets/images/warning.png +0 -0
  117. package/src/assets/svg/icon-checkbox-active.svg +4 -0
  118. package/src/assets/svg/icon-checkbox.svg +3 -0
  119. package/src/babel/.eslintrc +7 -0
  120. package/src/babel/index.js +63 -0
  121. package/src/components/.DS_Store +0 -0
  122. package/src/components/ActivityIndicator.tsx +238 -0
  123. package/src/components/Avatar/index.tsx +102 -0
  124. package/src/components/Badge/index.tsx +55 -0
  125. package/src/components/Button/index.tsx +162 -0
  126. package/src/components/ButtonIcon/index.tsx +98 -0
  127. package/src/components/Checkbox/index.tsx +107 -0
  128. package/src/components/ChipBar/index.tsx +112 -0
  129. package/src/components/CountingDot/index.tsx +63 -0
  130. package/src/components/FloatingButton/index.tsx +99 -0
  131. package/src/components/Icon/index.tsx +135 -0
  132. package/src/components/IconSvg/index.tsx +42 -0
  133. package/src/components/Image/index.tsx +127 -0
  134. package/src/components/ProgressBar.tsx +272 -0
  135. package/src/components/RadioButton/index.tsx +105 -0
  136. package/src/components/ScaleButton/index.tsx +17 -0
  137. package/src/components/SelectionField/index.tsx +166 -0
  138. package/src/components/Spacer/index.tsx +19 -0
  139. package/src/components/Switch/Switch.tsx +110 -0
  140. package/src/components/Switch/utils.ts +96 -0
  141. package/src/components/Text/index.tsx +69 -0
  142. package/src/components/TextInput/.DS_Store +0 -0
  143. package/src/components/TextInput/Addons/Outline.tsx +62 -0
  144. package/src/components/TextInput/Addons/Underline.tsx +71 -0
  145. package/src/components/TextInput/Adornment/TextInputAdornment.tsx +191 -0
  146. package/src/components/TextInput/Adornment/TextInputAffix.tsx +212 -0
  147. package/src/components/TextInput/Adornment/enums.tsx +12 -0
  148. package/src/components/TextInput/Adornment/types.tsx +11 -0
  149. package/src/components/TextInput/Adornment/utils.ts +39 -0
  150. package/src/components/TextInput/Label/InputLabel.tsx +216 -0
  151. package/src/components/TextInput/Label/LabelBackground.tsx +100 -0
  152. package/src/components/TextInput/TextInput.tsx +564 -0
  153. package/src/components/TextInput/TextInputDefault.tsx +187 -0
  154. package/src/components/TextInput/TextInputFlat.tsx +452 -0
  155. package/src/components/TextInput/constants.tsx +48 -0
  156. package/src/components/TextInput/helpers.tsx +546 -0
  157. package/src/components/TextInput/types.tsx +155 -0
  158. package/src/components/Toast/ToastProvider.tsx +69 -0
  159. package/src/components/Toast/index.tsx +239 -0
  160. package/src/components/Typography/AnimatedText.tsx +84 -0
  161. package/src/components/Typography/StyledText.tsx +53 -0
  162. package/src/components/Typography/Text.tsx +189 -0
  163. package/src/components/Typography/types.tsx +5 -0
  164. package/src/components/View/index.tsx +175 -0
  165. package/src/components/ViewVisibleAnimated/index.tsx +199 -0
  166. package/src/constants.tsx +16 -0
  167. package/src/core/theming.tsx +144 -0
  168. package/src/icons/IconArrowDown.tsx +14 -0
  169. package/src/icons/IconCheckbox.tsx +20 -0
  170. package/src/icons/IconCheckboxActive.tsx +18 -0
  171. package/src/icons/IconClearText.tsx +14 -0
  172. package/src/icons/IconRadio.tsx +11 -0
  173. package/src/icons/IconRadioActive.tsx +12 -0
  174. package/src/icons/IconRadioDisable.tsx +12 -0
  175. package/src/index.ts +51 -0
  176. package/src/index.tsx +50 -0
  177. package/src/styles/fonts.tsx +89 -0
  178. package/src/styles/overlay.tsx +69 -0
  179. package/src/styles/shadow.tsx +47 -0
  180. package/src/styles/themes/DarkTheme.tsx +157 -0
  181. package/src/styles/themes/LightTheme.tsx +160 -0
  182. package/src/styles/themes/index.ts +3 -0
  183. package/src/styles/themes/tokens.tsx +481 -0
  184. package/src/theme/blue.ts +25 -0
  185. package/src/theme/colors.ts +21 -0
  186. package/src/theme/container-styles.tsx +126 -0
  187. package/src/theme/dimensions.ts +44 -0
  188. package/src/theme/green.ts +27 -0
  189. package/src/theme/icon.ts +7 -0
  190. package/src/theme/ink.ts +18 -0
  191. package/src/theme/orange.ts +24 -0
  192. package/src/theme/purple.ts +8 -0
  193. package/src/theme/red.ts +26 -0
  194. package/src/theme/themes.tsx +287 -0
  195. package/src/theme/white.ts +16 -0
  196. package/src/theme/yellow.ts +26 -0
  197. package/src/types/index.ts +71 -0
  198. package/src/types/svg.d.ts +5 -0
  199. package/src/types.ts +259 -0
  200. package/src/types.tsx +284 -0
  201. package/src/utils/BackHandler/BackHandler.native.tsx +3 -0
  202. package/src/utils/BackHandler/BackHandler.tsx +11 -0
  203. package/src/utils/addEventListener.tsx +56 -0
  204. package/src/utils/forwardRef.tsx +23 -0
  205. package/src/utils/function-utils.tsx +108 -0
  206. package/src/utils/getContrastingColor.tsx +15 -0
  207. package/src/utils/hasTouchHandler.tsx +23 -0
  208. package/src/utils/roundLayoutSize.ts +2 -0
  209. package/src/utils/splitStyles.ts +60 -0
  210. package/src/utils/toast-manager.tsx +46 -0
  211. package/src/utils/useAnimatedValue.tsx +9 -0
  212. package/src/utils/useAnimatedValueArray.tsx +13 -0
  213. package/src/utils/useIsKeyboardShown.tsx +55 -0
  214. package/src/utils/useLayout.tsx +29 -0
  215. package/src/utils/useLazyRef.tsx +11 -0
@@ -0,0 +1,481 @@
1
+ import { Platform, StyleSheet, Dimensions } from "react-native";
2
+ import blue from "../../theme/blue";
3
+ import green from "../../theme/green";
4
+ import ink from "../../theme/ink";
5
+ import purple from "../../theme/purple";
6
+ import red from "../../theme/red";
7
+ import white from "../../theme/white";
8
+ import yellow from "../../theme/yellow";
9
+ import type { Font } from "../../types";
10
+
11
+ const ref = {
12
+ palette: {
13
+ dark: {
14
+ colors: {
15
+ primary: blue.BLUE100,
16
+ background: ink.INK100,
17
+ card: white.WHITE100,
18
+ text: white.WHITE100,
19
+ border: ink.INK10,
20
+ gray: ink.INK60,
21
+ backgroundLight: ink.INK80,
22
+ //new theme colors
23
+ backgroundPrimary: ink.INK100,
24
+ backgroundSecondary: white.WHITE100,
25
+ borderBrandDefault: blue.BLUE100,
26
+ borderCriticalDefault: red.RED100,
27
+ borderCriticalHover: red.RED80,
28
+ borderCriticalPressed: red.RED120,
29
+ borderErrorDefault: red.RED100,
30
+ borderInfoDefault: blue.BLUE100,
31
+ borderPrimaryDefault: ink.INK10,
32
+ borderPrimaryDisabled: ink.INK10,
33
+ borderPrimaryHovered: ink.INK20,
34
+ borderPrimaryInverseDefault: blue.BLUE100,
35
+ borderPrimaryPressed: blue.BLUE100,
36
+ borderSuccessDefault: green.GREEN100,
37
+ borderWarningDefault: yellow.YELLOW100,
38
+ iconBrandDefault: blue.BLUE100,
39
+ iconCriticalDefault: red.RED100,
40
+ iconErrorDefault: red.RED100,
41
+ iconInfoDefault: blue.BLUE100,
42
+ iconPrimaryDefault: ink.INK40,
43
+ iconPrimaryHover: ink.INK60,
44
+ iconPrimaryDisabled: ink.INK60,
45
+ iconPrimaryInverseDefault: white.WHITE100,
46
+ iconPrimaryInverseHover: white.WHITE80,
47
+ iconPrimaryInversePressed: white.WHITE80,
48
+ iconPrimaryPressed: ink.INK60,
49
+ iconSuccessDefault: green.GREEN100,
50
+ iconWarningDefault: yellow.YELLOW100,
51
+ surfaceBrandDefault: blue.BLUE100,
52
+ surfaceBrandDisabled: ink.INK10,
53
+ surfaceBrandHover: blue.BLUE80,
54
+ surfaceBrandInverseDefault: blue.BLUE10,
55
+ surfaceBrandInverseHover: blue.BLUE20,
56
+ surfaceBrandInversePressed: blue.BLUE40,
57
+ surfaceBrandPressed: blue.BLUE120,
58
+ surfaceCriticalDefault: red.RED100,
59
+ surfaceCriticalDisabled: ink.INK10,
60
+ surfaceCriticalHover: red.RED80,
61
+ surfaceCriticalInverseDefault: red.RED10,
62
+ surfaceCriticalInverseHover: red.RED20,
63
+ surfaceCriticalInversePressed: red.RED40,
64
+ surfaceCriticalPressed: red.RED120,
65
+ surfaceErrorDefault: red.RED100,
66
+ surfaceErrorDisabled: ink.INK10,
67
+ surfaceErrorHover: red.RED80,
68
+ surfaceErrorInverseDefault: red.RED10,
69
+ surfaceErrorInverseHover: red.RED20,
70
+ surfaceErrorInversePressed: red.RED40,
71
+ surfaceErrorPressed: red.RED_STATUS,
72
+ surfaceInfoDefault: blue.BLUE100,
73
+ surfaceInfoDisabled: ink.INK10,
74
+ surfaceInfoHover: blue.BLUE80,
75
+ surfaceInfoInverseDefault: blue.BLUE10,
76
+ surfaceInfoInverseHover: blue.BLUE20,
77
+ surfaceInfoInversePressed: blue.BLUE40,
78
+ surfaceInfoPressed: blue.BLUE120,
79
+ surfacePrimaryDefault: white.WHITE100,
80
+ surfacePrimaryDisabled: ink.INK10,
81
+ surfacePrimaryHover: ink.INK5,
82
+ surfacePrimaryInverseDefault: ink.INK80,
83
+ surfacePrimaryInverseHover: ink.INK60,
84
+ surfacePrimaryInversePressed: ink.INK40,
85
+ surfacePrimaryPressed: ink.INK10,
86
+ surfaceSecondaryDefault: ink.INK5,
87
+ surfaceSecondaryDisabled: ink.INK10,
88
+ surfaceSecondaryHover: ink.INK10,
89
+ surfaceSecondaryPressed: ink.INK20,
90
+ surfaceSuccessDefault: green.GREEN100,
91
+ surfaceSuccessDisabled: ink.INK10,
92
+ surfaceSuccessHover: green.GREEN80,
93
+ surfaceSuccessInverseDefault: green.GREEN10,
94
+ surfaceSuccessInverseHover: green.GREEN20,
95
+ surfaceSuccessInversePressed: green.GREEN40,
96
+ surfaceSuccessPressed: green.GREEN_STATUS,
97
+ surfaceWarningDefault: yellow.YELLOW100,
98
+ surfaceWarningDisabled: ink.INK10,
99
+ surfaceWarningHover: yellow.YELLOW80,
100
+ surfaceWarningInverseDefault: yellow.YELLOW10,
101
+ surfaceWarningInverseHover: yellow.YELLOW20,
102
+ surfaceWarningInversePressed: yellow.YELLOW40,
103
+ surfaceWarningPressed: yellow.YELLOW120,
104
+ textDefault: ink.INK5,
105
+ textDisabled: ink.INK20,
106
+ textPlaceholder: ink.INK40,
107
+ textSecondary: ink.INK60,
108
+ textBrandDefault: blue.BLUE100,
109
+ textBrandDisabled: ink.INK20,
110
+ textBrandHovered: blue.BLUE80,
111
+ textBrandPressed: blue.BLUE120,
112
+ textCriticalDefault: red.RED100,
113
+ textCriticalDisabled: ink.INK20,
114
+ textCriticalHovered: red.RED80,
115
+ textCriticalPressed: red.RED_STATUS,
116
+ textErrorDefault: red.RED100,
117
+ textErrorDisabled: ink.INK20,
118
+ textErrorHovered: red.RED80,
119
+ textErrorPressed: red.RED_STATUS,
120
+ textInfoDefault: blue.BLUE100,
121
+ textInfoDisabled: ink.INK20,
122
+ textInfoHovered: blue.BLUE80,
123
+ textInfoPressed: blue.BLUE120,
124
+ textLinkDefault: blue.BLUE100,
125
+ textLinkDisabled: ink.INK20,
126
+ textLinkHovered: blue.BLUE80,
127
+ textLinkPressed: blue.BLUE120,
128
+ textLinkVisitedDefault: purple.PURPLE100,
129
+ textLinkVisitedDisabled: purple.PURPLE_BG,
130
+ textLinkVisitedHovered: purple.PURPLE_BG,
131
+ textLinkVisitedPressed: purple.PURPLE_BG,
132
+ textOnFillDefault: white.WHITE100,
133
+ textOnFillDisabled: white.WHITE20,
134
+ textOnFillHovered: white.WHITE80,
135
+ textOnFillPressed: white.WHITE80,
136
+ textSuccessDefault: green.GREEN100,
137
+ textSuccessDisabled: ink.INK20,
138
+ textSuccessHovered: green.GREEN80,
139
+ textSuccessPressed: green.GREEN_STATUS,
140
+ textWarningDefault: yellow.YELLOW100,
141
+ textWarningDisabled: ink.INK20,
142
+ textWarningHovered: yellow.YELLOW80,
143
+ textWarningPressed: yellow.YELLOW_STATUS,
144
+ selectBackgroundDisabled: white.WHITE40,
145
+ selectIconDisabled: white.WHITE40,
146
+ },
147
+ },
148
+ light: {
149
+ colors: {
150
+ primary: blue.BLUE100,
151
+ background: white.WHITE100,
152
+ card: ink.INK100,
153
+ text: ink.INK100,
154
+ border: ink.INK40,
155
+ gray: ink.INK60,
156
+ backgroundLight: ink.INK10,
157
+ //new theme colors
158
+ backgroundPrimary: ink.INK5,
159
+ backgroundSecondary: white.WHITE100,
160
+ borderBrandDefault: blue.BLUE100,
161
+ borderCriticalDefault: red.RED100,
162
+ borderCriticalHover: red.RED80,
163
+ borderCriticalPressed: red.RED120,
164
+ borderErrorDefault: red.RED100,
165
+ borderInfoDefault: blue.BLUE100,
166
+ borderPrimaryDefault: ink.INK10,
167
+ borderPrimaryDisabled: ink.INK10,
168
+ borderPrimaryHovered: ink.INK20,
169
+ borderPrimaryInverseDefault: blue.BLUE100,
170
+ borderPrimaryPressed: blue.BLUE100,
171
+ borderSuccessDefault: green.GREEN100,
172
+ borderWarningDefault: yellow.YELLOW100,
173
+ iconBrandDefault: blue.BLUE100,
174
+ iconCriticalDefault: red.RED100,
175
+ iconErrorDefault: red.RED100,
176
+ iconInfoDefault: blue.BLUE100,
177
+ iconPrimaryDefault: ink.INK40,
178
+ iconPrimaryHover: ink.INK60,
179
+ iconPrimaryDisabled: ink.INK60,
180
+ iconPrimaryInverseDefault: white.WHITE100,
181
+ iconPrimaryInverseHover: white.WHITE80,
182
+ iconPrimaryInversePressed: white.WHITE80,
183
+ iconPrimaryPressed: ink.INK60,
184
+ iconSuccessDefault: green.GREEN100,
185
+ iconWarningDefault: yellow.YELLOW100,
186
+ surfaceBrandDefault: blue.BLUE100,
187
+ surfaceBrandDisabled: ink.INK10,
188
+ surfaceBrandHover: blue.BLUE80,
189
+ surfaceBrandInverseDefault: blue.BLUE10,
190
+ surfaceBrandInverseHover: blue.BLUE20,
191
+ surfaceBrandInversePressed: blue.BLUE40,
192
+ surfaceBrandPressed: blue.BLUE120,
193
+ surfaceCriticalDefault: red.RED100,
194
+ surfaceCriticalDisabled: ink.INK10,
195
+ surfaceCriticalHover: red.RED80,
196
+ surfaceCriticalInverseDefault: red.RED10,
197
+ surfaceCriticalInverseHover: red.RED20,
198
+ surfaceCriticalInversePressed: red.RED40,
199
+ surfaceCriticalPressed: red.RED120,
200
+ surfaceErrorDefault: red.RED100,
201
+ surfaceErrorDisabled: ink.INK10,
202
+ surfaceErrorHover: red.RED80,
203
+ surfaceErrorInverseDefault: red.RED10,
204
+ surfaceErrorInverseHover: red.RED20,
205
+ surfaceErrorInversePressed: red.RED40,
206
+ surfaceErrorPressed: red.RED_STATUS,
207
+ surfaceInfoDefault: blue.BLUE100,
208
+ surfaceInfoDisabled: ink.INK10,
209
+ surfaceInfoHover: blue.BLUE80,
210
+ surfaceInfoInverseDefault: blue.BLUE10,
211
+ surfaceInfoInverseHover: blue.BLUE20,
212
+ surfaceInfoInversePressed: blue.BLUE40,
213
+ surfaceInfoPressed: blue.BLUE120,
214
+ surfacePrimaryDefault: white.WHITE100,
215
+ surfacePrimaryDisabled: ink.INK5,
216
+ surfacePrimaryHover: ink.INK5,
217
+ surfacePrimaryInverseDefault: ink.INK80,
218
+ surfacePrimaryInverseHover: ink.INK60,
219
+ surfacePrimaryInversePressed: ink.INK40,
220
+ surfacePrimaryPressed: ink.INK10,
221
+ surfaceSecondaryDefault: ink.INK5,
222
+ surfaceSecondaryDisabled: ink.INK5,
223
+ surfaceSecondaryHover: ink.INK10,
224
+ surfaceSecondaryPressed: ink.INK20,
225
+ surfaceSuccessDefault: green.GREEN100,
226
+ surfaceSuccessDisabled: ink.INK10,
227
+ surfaceSuccessHover: green.GREEN80,
228
+ surfaceSuccessInverseDefault: green.GREEN10,
229
+ surfaceSuccessInverseHover: green.GREEN20,
230
+ surfaceSuccessInversePressed: green.GREEN40,
231
+ surfaceSuccessPressed: green.GREEN_STATUS,
232
+ surfaceWarningDefault: yellow.YELLOW100,
233
+ surfaceWarningDisabled: ink.INK10,
234
+ surfaceWarningHover: yellow.YELLOW80,
235
+ surfaceWarningInverseDefault: yellow.YELLOW10,
236
+ surfaceWarningInverseHover: yellow.YELLOW20,
237
+ surfaceWarningInversePressed: yellow.YELLOW40,
238
+ surfaceWarningPressed: yellow.YELLOW120,
239
+ textDefault: ink.INK100,
240
+ textDisabled: ink.INK20,
241
+ textPlaceholder: ink.INK40,
242
+ textSecondary: ink.INK60,
243
+ textBrandDefault: blue.BLUE100,
244
+ textBrandDisabled: ink.INK20,
245
+ textBrandHovered: blue.BLUE80,
246
+ textBrandPressed: blue.BLUE120,
247
+ textCriticalDefault: red.RED100,
248
+ textCriticalDisabled: ink.INK20,
249
+ textCriticalHovered: red.RED80,
250
+ textCriticalPressed: red.RED_STATUS,
251
+ textErrorDefault: red.RED100,
252
+ textErrorDisabled: ink.INK20,
253
+ textErrorHovered: red.RED80,
254
+ textErrorPressed: red.RED_STATUS,
255
+ textInfoDefault: blue.BLUE100,
256
+ textInfoDisabled: ink.INK20,
257
+ textInfoHovered: blue.BLUE80,
258
+ textInfoPressed: blue.BLUE120,
259
+ textLinkDefault: blue.BLUE100,
260
+ textLinkDisabled: ink.INK20,
261
+ textLinkHovered: blue.BLUE80,
262
+ textLinkPressed: blue.BLUE120,
263
+ textLinkVisitedDefault: purple.PURPLE100,
264
+ textLinkVisitedDisabled: purple.PURPLE_BG,
265
+ textLinkVisitedHovered: purple.PURPLE_BG,
266
+ textLinkVisitedPressed: purple.PURPLE_BG,
267
+ textOnFillDefault: white.WHITE100,
268
+ textOnFillDisabled: white.WHITE20,
269
+ textOnFillHovered: white.WHITE80,
270
+ textOnFillPressed: white.WHITE80,
271
+ textSuccessDefault: green.GREEN100,
272
+ textSuccessDisabled: ink.INK20,
273
+ textSuccessHovered: green.GREEN80,
274
+ textSuccessPressed: green.GREEN_STATUS,
275
+ textWarningDefault: yellow.YELLOW100,
276
+ textWarningDisabled: ink.INK20,
277
+ textWarningHovered: yellow.YELLOW80,
278
+ textWarningPressed: yellow.YELLOW_STATUS,
279
+ selectBackgroundDisabled: white.WHITE40,
280
+ selectIconDisabled: white.WHITE40,
281
+ },
282
+ },
283
+ },
284
+
285
+ typeface: {
286
+ brandRegular: Platform.select({
287
+ web: 'Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif',
288
+ ios: "System",
289
+ default: "sans-serif",
290
+ }),
291
+ weightRegular: "400" as Font["fontWeight"],
292
+
293
+ plainMedium: Platform.select({
294
+ web: 'Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif',
295
+ ios: "System",
296
+ default: "sans-serif-medium",
297
+ }),
298
+ weightMedium: "500" as Font["fontWeight"],
299
+ },
300
+
301
+ opacity: {
302
+ level1: 0.08,
303
+ level2: 0.12,
304
+ level3: 0.16,
305
+ level4: 0.38,
306
+ },
307
+ };
308
+
309
+ const regularType = {
310
+ fontFamily: ref.typeface.brandRegular,
311
+ letterSpacing: 0,
312
+ fontWeight: ref.typeface.weightRegular,
313
+ };
314
+
315
+ const mediumType = {
316
+ fontFamily: ref.typeface.plainMedium,
317
+ letterSpacing: 0.15,
318
+ fontWeight: ref.typeface.weightMedium,
319
+ };
320
+
321
+ export const typescale = {
322
+ displayLarge: {
323
+ ...regularType,
324
+ lineHeight: 64,
325
+ fontSize: 57,
326
+ },
327
+ displayMedium: {
328
+ ...regularType,
329
+ lineHeight: 52,
330
+ fontSize: 45,
331
+ },
332
+ displaySmall: {
333
+ ...regularType,
334
+ lineHeight: 44,
335
+ fontSize: 36,
336
+ },
337
+
338
+ headlineLarge: {
339
+ ...regularType,
340
+ lineHeight: 40,
341
+ fontSize: 32,
342
+ },
343
+ headlineMedium: {
344
+ ...regularType,
345
+ lineHeight: 36,
346
+ fontSize: 28,
347
+ },
348
+ headlineSmall: {
349
+ ...regularType,
350
+ lineHeight: 32,
351
+ fontSize: 24,
352
+ },
353
+
354
+ titleLarge: {
355
+ ...regularType,
356
+ lineHeight: 28,
357
+ fontSize: 22,
358
+ },
359
+ titleMedium: {
360
+ ...mediumType,
361
+ lineHeight: 24,
362
+ fontSize: 16,
363
+ },
364
+ titleSmall: {
365
+ ...mediumType,
366
+ letterSpacing: 0.1,
367
+ lineHeight: 20,
368
+ fontSize: 14,
369
+ },
370
+
371
+ labelLarge: {
372
+ ...mediumType,
373
+ letterSpacing: 0.1,
374
+ lineHeight: 20,
375
+ fontSize: 14,
376
+ },
377
+ labelMedium: {
378
+ ...mediumType,
379
+ letterSpacing: 0.5,
380
+ lineHeight: 16,
381
+ fontSize: 12,
382
+ },
383
+ labelSmall: {
384
+ ...mediumType,
385
+ letterSpacing: 0.5,
386
+ lineHeight: 16,
387
+ fontSize: 11,
388
+ },
389
+
390
+ bodyLarge: {
391
+ ...mediumType,
392
+ fontWeight: ref.typeface.weightRegular,
393
+ fontFamily: ref.typeface.brandRegular,
394
+ lineHeight: 24,
395
+ fontSize: 16,
396
+ },
397
+ bodyMedium: {
398
+ ...mediumType,
399
+ fontWeight: ref.typeface.weightRegular,
400
+ fontFamily: ref.typeface.brandRegular,
401
+ letterSpacing: 0.25,
402
+ lineHeight: 20,
403
+ fontSize: 14,
404
+ },
405
+ bodySmall: {
406
+ ...mediumType,
407
+ fontWeight: ref.typeface.weightRegular,
408
+ fontFamily: ref.typeface.brandRegular,
409
+ letterSpacing: 0.4,
410
+ lineHeight: 16,
411
+ fontSize: 12,
412
+ },
413
+
414
+ default: {
415
+ ...regularType,
416
+ },
417
+ };
418
+
419
+ export const tokens = {
420
+ md: {
421
+ ref,
422
+ sys: {
423
+ typescale,
424
+ },
425
+ },
426
+ };
427
+
428
+ export const ThemeColors = ref.palette;
429
+
430
+ export const CONSTANTS = {
431
+ DEVICE_HEIGHT: Dimensions.get("window").height,
432
+ DEVICE_WIDTH: Dimensions.get("window").width,
433
+ HEADER_HEIGHT: 50,
434
+ BUTTON_HEIGHT: 48,
435
+ BUTTON_HEIGHT_SMALL: 40,
436
+ RADIO_BUTTON_HEIGHT: 20,
437
+
438
+ SPACE_0: 0,
439
+ SPACE_2: 2,
440
+ SPACE_4: 4,
441
+ SPACE_6: 6,
442
+ SPACE_8: 8,
443
+ SPACE_12: 12,
444
+ SPACE_16: 16,
445
+ SPACE_20: 20,
446
+ SPACE_24: 24,
447
+ SPACE_28: 28,
448
+ SPACE_32: 32,
449
+ SPACE_36: 36,
450
+ SPACE_40: 40,
451
+ SPACE_48: 48,
452
+ SPACE_64: 64,
453
+ SPACE_80: 80,
454
+ SPACE_96: 96,
455
+ SPACE_112: 112,
456
+ SPACE_128: 128,
457
+ SPACE_BUTTON_GAP: 8,
458
+ SPACE_CARD_PADDING: 4,
459
+ SPACE_CARD_GAP: 12,
460
+
461
+ //MARK: Border radius
462
+ BORDER_RADIUS_6: 6,
463
+ BORDER_RADIUS_8: 8,
464
+ BORDER_RADIUS_12: 12,
465
+ BORDER_RADIUS_ROUNDED: 36,
466
+
467
+ //MARK: Border width
468
+ BORDER_WIDTH_05: StyleSheet.hairlineWidth, //0.3-0.5
469
+ BORDER_WIDTH_1: 1,
470
+ BORDER_WIDTH_2: 2,
471
+ BORDER_WIDTH_4: 4,
472
+
473
+ //MARK: Font weight
474
+ FONT_WEIGHT_LIGHT: "300",
475
+ FONT_WEIGHT_REGULAR: "400",
476
+ FONT_WEIGHT_MEDIUM: "500",
477
+ FONT_WEIGHT_SEMIBOLD: "600",
478
+ FONT_WEIGHT_BOLD: "700",
479
+ FONT_WEIGHT_EXTRABOLD: "800",
480
+ FONT_WEIGHT_BLACK: "900",
481
+ };
@@ -0,0 +1,25 @@
1
+ const BLUE180 = "#0B1826";
2
+ const BLUE160 = "#133457";
3
+ const BLUE140 = "#144E8E";
4
+ const BLUE120 = "#144E8E";
5
+ const BLUE100 = "#0071ED";
6
+ const BLUE80 = "#1F8DFF";
7
+ const BLUE60 = "#4DA5FF";
8
+ const BLUE40 = "#8CC9FE";
9
+ const BLUE20 = "#B2DDFF";
10
+ const BLUE10 = "#D9EEFF";
11
+ const BLUE5 = "#F2F7FF";
12
+
13
+ export default {
14
+ BLUE180,
15
+ BLUE160,
16
+ BLUE140,
17
+ BLUE120,
18
+ BLUE100,
19
+ BLUE80,
20
+ BLUE60,
21
+ BLUE40,
22
+ BLUE20,
23
+ BLUE10,
24
+ BLUE5,
25
+ };
@@ -0,0 +1,21 @@
1
+ import blue from "./blue";
2
+ import green from "./green";
3
+ import icon from "./icon";
4
+ import ink from "./ink";
5
+ import orange from "./orange";
6
+ import purple from "./purple";
7
+ import red from "./red";
8
+ import white from "./white";
9
+ import yellow from "./yellow";
10
+
11
+ export default {
12
+ blue,
13
+ green,
14
+ ink,
15
+ white,
16
+ red,
17
+ purple,
18
+ orange,
19
+ yellow,
20
+ icon,
21
+ };
@@ -0,0 +1,126 @@
1
+ import { Platform, StyleSheet } from "react-native";
2
+ import { SPACE_16, SPACE_8 } from "./dimensions";
3
+
4
+ import white from "./white";
5
+ import blue from "./blue";
6
+ import ink from "./ink";
7
+
8
+ export default StyleSheet.create({
9
+ container: { flex: 1 },
10
+ center: {
11
+ paddingHorizontal: SPACE_16,
12
+ alignItems: "center",
13
+ justifyContent: "center",
14
+ },
15
+ end: { alignItems: "flex-end" },
16
+ start: { alignItems: "flex-start" },
17
+ centerHorizontal: { justifyContent: "center" },
18
+ icon: {
19
+ backgroundColor: blue.BLUE100,
20
+ justifyContent: "center",
21
+ alignItems: "center",
22
+ },
23
+ row: {
24
+ flexDirection: "row",
25
+ },
26
+ txtSmallBold: {
27
+ fontSize: 12,
28
+ color: ink.INK80,
29
+ fontWeight: "600",
30
+ },
31
+ button: {
32
+ borderRadius: 20,
33
+ justifyContent: "center",
34
+ alignItems: "center",
35
+ width: 40,
36
+ height: 40,
37
+ backgroundColor: white.WHITE100,
38
+ marginHorizontal: SPACE_8,
39
+ },
40
+ shadow: {
41
+ shadowColor: "black",
42
+ shadowOffset: {
43
+ width: 1,
44
+ height: 2,
45
+ },
46
+ shadowOpacity: 0.3,
47
+ shadowRadius: 5,
48
+ },
49
+ hitSlop: {
50
+ top: 10,
51
+ right: 10,
52
+ bottom: 10,
53
+ left: 10,
54
+ },
55
+ transparent: {
56
+ backgroundColor: "transparent",
57
+ },
58
+
59
+ //MARK: text size
60
+ text10: {
61
+ fontSize: 10 + (Platform.OS === "android" ? 1 : 2),
62
+ lineHeight: 12 + (Platform.OS === "android" ? 2 : 4),
63
+ },
64
+ text12: {
65
+ fontSize: 12 + (Platform.OS === "android" ? 1 : 2),
66
+ lineHeight: 16 + (Platform.OS === "android" ? 2 : 4),
67
+ },
68
+ text14: {
69
+ fontSize: 14 + (Platform.OS === "android" ? 1 : 2),
70
+ lineHeight: 20 + (Platform.OS === "android" ? 2 : 4),
71
+ },
72
+ text16: {
73
+ fontSize: 16 + (Platform.OS === "android" ? 1 : 2),
74
+ lineHeight: 24 + (Platform.OS === "android" ? 2 : 4),
75
+ },
76
+ text18: {
77
+ fontSize: 18 + (Platform.OS === "android" ? 1 : 2),
78
+ lineHeight: 28 + (Platform.OS === "android" ? 1 : 2),
79
+ },
80
+ text20: {
81
+ fontSize: 20 + (Platform.OS === "android" ? 1 : 2),
82
+ lineHeight: 28 + (Platform.OS === "android" ? 1 : 2),
83
+ },
84
+ text22: {
85
+ fontSize: 22 + (Platform.OS === "android" ? 1 : 2),
86
+ lineHeight: 30 + (Platform.OS === "android" ? 1 : 2),
87
+ },
88
+ text24: {
89
+ fontSize: 24 + (Platform.OS === "android" ? 1 : 2),
90
+ lineHeight: 32 + (Platform.OS === "android" ? 1 : 2),
91
+ },
92
+ text26: {
93
+ fontSize: 26 + (Platform.OS === "android" ? 1 : 2),
94
+ lineHeight: 34 + (Platform.OS === "android" ? 1 : 2),
95
+ },
96
+ text28: {
97
+ fontSize: 28 + (Platform.OS === "android" ? 1 : 2),
98
+ lineHeight: 36 + (Platform.OS === "android" ? 1 : 2),
99
+ },
100
+ text30: {
101
+ fontSize: 30 + (Platform.OS === "android" ? 1 : 2),
102
+ lineHeight: 38 + (Platform.OS === "android" ? 1 : 2),
103
+ },
104
+ text32: {
105
+ fontSize: 32 + (Platform.OS === "android" ? 1 : 2),
106
+ lineHeight: 40 + (Platform.OS === "android" ? 1 : 2),
107
+ },
108
+
109
+ //MARK:fonts
110
+ textRegular: {
111
+ fontFamily: "Inter-Regular",
112
+ fontWeight: "400",
113
+ },
114
+ textMedium: {
115
+ fontFamily: "Inter-Medium",
116
+ fontWeight: "500",
117
+ },
118
+ textBold: {
119
+ fontFamily: "Inter-Bold",
120
+ fontWeight: "600",
121
+ },
122
+ styleIcon: {
123
+ width: 24,
124
+ height: 24,
125
+ },
126
+ });
@@ -0,0 +1,44 @@
1
+ import { Dimensions, StyleSheet } from "react-native";
2
+
3
+ export const DEVICE_HEIGHT = Dimensions.get("window").height;
4
+ export const DEVICE_WIDTH = Dimensions.get("window").width;
5
+ export const HEADER_HEIGHT = 50;
6
+ export const BUTTON_HEIGHT = 48;
7
+ export const BUTTON_HEIGHT_SMALL = 40;
8
+ export const RADIO_BUTTON_HEIGHT = 20;
9
+
10
+ //MARK: padding
11
+ export const SPACE_0 = 0;
12
+ export const SPACE_2 = 2;
13
+ export const SPACE_4 = 4;
14
+ export const SPACE_6 = 6;
15
+ export const SPACE_8 = 8;
16
+ export const SPACE_12 = 12;
17
+ export const SPACE_16 = 16;
18
+ export const SPACE_20 = 20;
19
+ export const SPACE_24 = 24;
20
+ export const SPACE_28 = 28;
21
+ export const SPACE_32 = 32;
22
+ export const SPACE_36 = 36;
23
+ export const SPACE_40 = 40;
24
+ export const SPACE_48 = 48;
25
+ export const SPACE_64 = 64;
26
+ export const SPACE_80 = 80;
27
+ export const SPACE_96 = 96;
28
+ export const SPACE_112 = 112;
29
+ export const SPACE_128 = 128;
30
+ export const SPACE_BUTTON_GAP = SPACE_8;
31
+ export const SPACE_CARD_PADDING = SPACE_24;
32
+ export const SPACE_CARD_GAP = SPACE_12;
33
+
34
+ //MARK: Border radius
35
+ export const BORDER_RADIUS_6 = 6;
36
+ export const BORDER_RADIUS_8 = 8;
37
+ export const BORDER_RADIUS_12 = 12;
38
+ export const BORDER_RADIUS_ROUNDED = 36;
39
+
40
+ //MARK: Border width
41
+ export const BORDER_WIDTH_05 = StyleSheet.hairlineWidth; //0.3-0.5
42
+ export const BORDER_WIDTH_1 = 1;
43
+ export const BORDER_WIDTH_2 = 2;
44
+ export const BORDER_WIDTH_4 = 4;