@fattureincloud-mobile/fic-mobile-ds 1.2.2 → 1.3.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 (105) hide show
  1. package/lib/commonjs/__tests__/index.test.js +4 -0
  2. package/lib/commonjs/__tests__/index.test.js.map +1 -0
  3. package/lib/commonjs/components/buttons/FicButton/FicButtonPrimary.js +63 -49
  4. package/lib/commonjs/components/buttons/FicButton/FicButtonPrimary.js.map +1 -1
  5. package/lib/commonjs/components/buttons/FicButton/FicButtonSecondary.js +8 -7
  6. package/lib/commonjs/components/buttons/FicButton/FicButtonSecondary.js.map +1 -1
  7. package/lib/commonjs/components/buttons/FicButton/FicButtonTertiary.js +6 -1
  8. package/lib/commonjs/components/buttons/FicButton/FicButtonTertiary.js.map +1 -1
  9. package/lib/module/__tests__/index.test.js +4 -0
  10. package/lib/module/__tests__/index.test.js.map +1 -0
  11. package/lib/module/components/buttons/FicButton/FicButtonPrimary.js +66 -52
  12. package/lib/module/components/buttons/FicButton/FicButtonPrimary.js.map +1 -1
  13. package/lib/module/components/buttons/FicButton/FicButtonSecondary.js +8 -7
  14. package/lib/module/components/buttons/FicButton/FicButtonSecondary.js.map +1 -1
  15. package/lib/module/components/buttons/FicButton/FicButtonTertiary.js +7 -2
  16. package/lib/module/components/buttons/FicButton/FicButtonTertiary.js.map +1 -1
  17. package/lib/typescript/commonjs/__tests__/index.test.d.ts +2 -0
  18. package/lib/typescript/commonjs/__tests__/index.test.d.ts.map +1 -0
  19. package/lib/typescript/commonjs/components/buttons/FicButton/FicButton.types.d.ts +2 -0
  20. package/lib/typescript/commonjs/components/buttons/FicButton/FicButton.types.d.ts.map +1 -1
  21. package/lib/typescript/commonjs/components/buttons/FicButton/FicButtonPrimary.d.ts +2 -2
  22. package/lib/typescript/commonjs/components/buttons/FicButton/FicButtonPrimary.d.ts.map +1 -1
  23. package/lib/typescript/commonjs/components/buttons/FicButton/FicButtonSecondary.d.ts.map +1 -1
  24. package/lib/typescript/commonjs/index.d.ts +1 -1
  25. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  26. package/lib/typescript/module/__tests__/index.test.d.ts +2 -0
  27. package/lib/typescript/module/__tests__/index.test.d.ts.map +1 -0
  28. package/lib/typescript/module/components/buttons/FicButton/FicButton.types.d.ts +2 -0
  29. package/lib/typescript/module/components/buttons/FicButton/FicButton.types.d.ts.map +1 -1
  30. package/lib/typescript/module/components/buttons/FicButton/FicButtonPrimary.d.ts +2 -2
  31. package/lib/typescript/module/components/buttons/FicButton/FicButtonPrimary.d.ts.map +1 -1
  32. package/lib/typescript/module/components/buttons/FicButton/FicButtonSecondary.d.ts.map +1 -1
  33. package/lib/typescript/module/index.d.ts +1 -1
  34. package/lib/typescript/module/index.d.ts.map +1 -1
  35. package/package.json +50 -102
  36. package/LICENSE +0 -20
  37. package/README.md +0 -31
  38. package/lib/package.json +0 -140
  39. package/src/components/Tag/Tag.tsx +0 -59
  40. package/src/components/Tag/index.ts +0 -3
  41. package/src/components/Touchable/Touchable.tsx +0 -110
  42. package/src/components/Touchable/index.ts +0 -3
  43. package/src/components/base/DatePicker/DatePicker.tsx +0 -427
  44. package/src/components/base/DatePicker/index.ts +0 -4
  45. package/src/components/base/HeaderArrows/HeaderArrows.tsx +0 -93
  46. package/src/components/base/HeaderArrows/index.ts +0 -3
  47. package/src/components/buttons/FicButton/FicButton.tsx +0 -33
  48. package/src/components/buttons/FicButton/FicButton.types.ts +0 -142
  49. package/src/components/buttons/FicButton/FicButtonIcon.tsx +0 -166
  50. package/src/components/buttons/FicButton/FicButtonPrimary.tsx +0 -179
  51. package/src/components/buttons/FicButton/FicButtonSecondary.tsx +0 -168
  52. package/src/components/buttons/FicButton/FicButtonTertiary.tsx +0 -198
  53. package/src/components/buttons/FicButton/constants.ts +0 -23
  54. package/src/components/buttons/FicButton/index.ts +0 -5
  55. package/src/components/buttons/FicButton/themes/dark.ts +0 -273
  56. package/src/components/buttons/FicButton/themes/index.ts +0 -4
  57. package/src/components/buttons/FicButton/themes/light.ts +0 -293
  58. package/src/components/buttons/FicButtonGroup/FicButtonGroup.tsx +0 -61
  59. package/src/components/buttons/FicButtonGroup/FicButtonGroup.types.ts +0 -11
  60. package/src/components/buttons/FicButtonGroup/index.ts +0 -2
  61. package/src/components/notifications/Banner/Banner.tsx +0 -111
  62. package/src/components/notifications/Banner/Banner.types.ts +0 -57
  63. package/src/components/notifications/Banner/index.ts +0 -3
  64. package/src/components/notifications/Banner/themes/dark.ts +0 -43
  65. package/src/components/notifications/Banner/themes/index.ts +0 -4
  66. package/src/components/notifications/Banner/themes/light.ts +0 -43
  67. package/src/components/typographies/Body/Body.tsx +0 -38
  68. package/src/components/typographies/Body/index.ts +0 -3
  69. package/src/components/typographies/ButtonTitle/ButtonTitle.tsx +0 -51
  70. package/src/components/typographies/ButtonTitle/index.ts +0 -3
  71. package/src/components/typographies/Callout/Callout.tsx +0 -38
  72. package/src/components/typographies/Callout/index.ts +0 -3
  73. package/src/components/typographies/CaptionOne/CaptionOne.tsx +0 -38
  74. package/src/components/typographies/CaptionOne/index.ts +0 -4
  75. package/src/components/typographies/CaptionTwo/CaptionTwo.tsx +0 -38
  76. package/src/components/typographies/CaptionTwo/index.ts +0 -4
  77. package/src/components/typographies/Footnote/Footnote.tsx +0 -38
  78. package/src/components/typographies/Footnote/index.ts +0 -4
  79. package/src/components/typographies/Headline/Headline.tsx +0 -38
  80. package/src/components/typographies/Headline/index.ts +0 -4
  81. package/src/components/typographies/LargeTitle/LargeTitle.tsx +0 -38
  82. package/src/components/typographies/LargeTitle/index.ts +0 -3
  83. package/src/components/typographies/README.md +0 -22
  84. package/src/components/typographies/Subhead/Subhead.tsx +0 -38
  85. package/src/components/typographies/Subhead/index.ts +0 -4
  86. package/src/components/typographies/TitleOne/TitleOne.tsx +0 -38
  87. package/src/components/typographies/TitleOne/index.ts +0 -4
  88. package/src/components/typographies/TitleThree/TitleThree.tsx +0 -38
  89. package/src/components/typographies/TitleThree/index.ts +0 -4
  90. package/src/components/typographies/TitleTwo/TitleTwo.tsx +0 -38
  91. package/src/components/typographies/TitleTwo/index.ts +0 -4
  92. package/src/components/typographies/font.ts +0 -25
  93. package/src/hooks/useTheme.ts +0 -17
  94. package/src/index.tsx +0 -49
  95. package/src/providers/DesignSystemProvider/DesignSystemProvider.tsx +0 -31
  96. package/src/providers/DesignSystemProvider/index.ts +0 -3
  97. package/src/providers/IconProvider/IconProvider.tsx +0 -46
  98. package/src/providers/IconProvider/index.ts +0 -4
  99. package/src/providers/ThemeProvider/ThemeProvider.tsx +0 -17
  100. package/src/styles/calendarTheme.ts +0 -24
  101. package/src/styles/colors.ts +0 -119
  102. package/src/styles/globalStyles.ts +0 -36
  103. package/src/styles/space.ts +0 -27
  104. package/src/styles/theme.ts +0 -615
  105. package/src/utils/locale.ts +0 -50
@@ -1,615 +0,0 @@
1
- import { StyleProp, ViewStyle } from 'react-native';
2
-
3
- // this is the right import but the package does not like it
4
- // we can use it to extends our CalendarThemeProps
5
- // import { Theme } from 'react-native-calendars/src/types';
6
-
7
- import { FicButtonTheme } from '../components/buttons/FicButton/FicButton.types';
8
- import { ficButtonLightTheme } from '../components/buttons/FicButton/themes';
9
- import ficButtonDarkTheme from '../components/buttons/FicButton/themes/dark';
10
- import { BannerThemeProp } from '../components/notifications/Banner/Banner.types';
11
- import {
12
- bannerDarkTheme,
13
- bannerLightTheme,
14
- } from '../components/notifications/Banner/themes';
15
- import { CalendarTheme } from './calendarTheme';
16
- import { Colors } from './colors';
17
-
18
- interface FlatButtonThemeProps {
19
- color?: string;
20
- disabledColor?: string;
21
- backgroundColor?: string;
22
- hasShadow?: boolean;
23
- shadowColor?: string;
24
- borderRadius?: number;
25
- disabledStyle?: StyleProp<ViewStyle>;
26
- containerStyle?: StyleProp<ViewStyle>;
27
- }
28
-
29
- interface GradientButtonThemeProps {
30
- isHorizontalGradient?: boolean;
31
- color?: string;
32
- disabledColor?: string;
33
- backgroundColors?: string[];
34
- disabledBackgroundColors?: string[];
35
- hasShadow?: boolean;
36
- shadowColor?: string;
37
- borderRadius?: number;
38
- disabledStyle?: StyleProp<ViewStyle>;
39
- containerStyle?: StyleProp<ViewStyle>;
40
- }
41
-
42
- interface OutlineButtonThemeProps {
43
- color?: string;
44
- disabledColor?: string;
45
- backgroundColor?: string;
46
- disabledBackgroundColor?: string;
47
- borderColor?: string;
48
- disabledBorderColor?: string;
49
- hasShadow?: boolean;
50
- shadowColor?: string;
51
- borderRadius?: number;
52
- disabledStyle?: StyleProp<ViewStyle>;
53
- containerStyle?: StyleProp<ViewStyle>;
54
- }
55
-
56
- export interface TextInputThemeProps {
57
- color?: string;
58
- labelColor?: string;
59
- disabledTextColor?: string;
60
- disabledLabelColor?: string;
61
- mandatoryIndicatorColor?: string;
62
- placeholderColor?: string;
63
- inlineLeadingColor?: string;
64
- fieldIconColor?: string;
65
- borderColor?: string;
66
- focusedBorderColor?: string;
67
- disabledBorderColor?: string;
68
- erroredBorderColor?: string;
69
- warningBorderColor?: string;
70
- backgroundColor?: string;
71
- disabledBackgroundColor?: string;
72
- }
73
-
74
- interface TypographiesThemeProps {
75
- bodyColor?: string;
76
- buttonTitleColor?: string;
77
- calloutColor?: string;
78
- captionOneColor?: string;
79
- captionTwoColor?: string;
80
- footnoteColor?: string;
81
- headlineColor?: string;
82
- largeTitleColor?: string;
83
- subheadColor?: string;
84
- titleOneColor?: string;
85
- titleTwoColor?: string;
86
- titleThreeColor?: string;
87
- }
88
-
89
- export interface TouchablesThemeProps {
90
- rippleColors?: string;
91
- highlightColor?: string;
92
- }
93
-
94
- export interface SearchBarThemeProps {
95
- color?: string;
96
- backgroundColor?: string;
97
- iconColor?: string;
98
- selectionColor?: string;
99
- useTextColor?: string;
100
- errorColor?: string;
101
- }
102
-
103
- export interface DurationPickerThemeProps {
104
- activeColor?: string;
105
- inactiveColor?: string;
106
- labelColor?: string;
107
- guidesColor?: string;
108
- }
109
-
110
- export interface BottomSheetHeaderThemeProps {
111
- backgroundColor?: string;
112
- emptyHeaderBackgroundColor?: string;
113
- handleColor?: string;
114
- darkHandleColor?: string;
115
- titleColor?: string;
116
- captionColor?: string;
117
- descriptionColor?: string;
118
- buttonsColor?: string;
119
- loaderColor?: string;
120
- }
121
-
122
- export interface BottomSheetThemeProps {
123
- backgroundColor?: string;
124
- backdropColor?: string;
125
- cancelButtonBackgroundColor?: string;
126
- header?: BottomSheetHeaderThemeProps;
127
- handleIndicator: ViewStyle;
128
- }
129
-
130
- export interface YearMonthPickerThemeProps {
131
- backgroundColor?: string;
132
- yearColor?: string;
133
- arrowsColor?: string;
134
- monthsTextColor?: string;
135
- monthsBackgroundColor?: string;
136
- currentMonthTextColor?: string;
137
- currentMonthBackgroundColor?: string;
138
- selectedMonthTextColor?: string;
139
- selectedMonthBackgroundColor?: string;
140
- }
141
-
142
- export interface ThemeProps {
143
- flatButton?: FlatButtonThemeProps;
144
- gradientButton?: GradientButtonThemeProps;
145
- outlineButton?: OutlineButtonThemeProps;
146
- textInput?: TextInputThemeProps;
147
- typographies?: TypographiesThemeProps;
148
- searchBar?: SearchBarThemeProps;
149
- datePickers?: CalendarTheme;
150
- pickers?: DurationPickerThemeProps;
151
- bottomSheetHeader?: BottomSheetHeaderThemeProps;
152
- yearMonthPickers?: YearMonthPickerThemeProps;
153
- }
154
-
155
- export interface GenericThemeProps {
156
- backgroundLevel0?: string;
157
- backgroundLevel1?: string;
158
- backgroundLevel2?: string;
159
- backgroundLevel3?: string;
160
- backgroundLevel4?: string;
161
- title?: string;
162
- description?: string;
163
- disabledTitle?: string;
164
- disabledDescription?: string;
165
- divider?: string;
166
- cardBackground?: string;
167
- }
168
-
169
- interface Primaries {
170
- azure: Colors;
171
- red: Colors;
172
- green: Colors;
173
- yellow: Colors;
174
- purple: Colors;
175
- blue: Colors;
176
- }
177
-
178
- export interface Theme {
179
- banner?: BannerThemeProp;
180
- ficButton?: FicButtonTheme;
181
- flatButton: Omit<
182
- Required<FlatButtonThemeProps>,
183
- 'disabledStyle' | 'containerStyle'
184
- > & {
185
- disabledStyle?: StyleProp<ViewStyle>;
186
- containerStyle?: StyleProp<ViewStyle>;
187
- };
188
- gradientButton: Omit<
189
- Required<GradientButtonThemeProps>,
190
- 'disabledStyle' | 'containerStyle'
191
- > & {
192
- disabledStyle?: StyleProp<ViewStyle>;
193
- containerStyle?: StyleProp<ViewStyle>;
194
- };
195
- outlineButton: Omit<
196
- Required<OutlineButtonThemeProps>,
197
- 'disabledStyle' | 'containerStyle'
198
- > & {
199
- disabledStyle?: StyleProp<ViewStyle>;
200
- containerStyle?: StyleProp<ViewStyle>;
201
- };
202
- textInput: Required<TextInputThemeProps>;
203
- typographies: Required<TypographiesThemeProps>;
204
- touchables: Required<TouchablesThemeProps>;
205
- searchBar: Required<SearchBarThemeProps>;
206
- datePickers: CalendarTheme;
207
- pickers: DurationPickerThemeProps;
208
- bottomSheet: Required<BottomSheetThemeProps>;
209
- yearMonthPickers: YearMonthPickerThemeProps;
210
- generic?: GenericThemeProps;
211
- primaries?: Primaries;
212
- primariesContrast?: Primaries;
213
- primariesLight?: Primaries;
214
- primariesDark?: Primaries;
215
- }
216
-
217
- export const ficTheme: Theme = {
218
- banner: bannerLightTheme,
219
-
220
- generic: {
221
- backgroundLevel0: Colors.WHITE,
222
- backgroundLevel1: Colors.GREY_1,
223
- backgroundLevel2: Colors.GREY_2,
224
- backgroundLevel3: Colors.GREY_3,
225
- backgroundLevel4: Colors.GREY_4,
226
- title: Colors.BLACK_80,
227
- description: Colors.BLACK_64,
228
- disabledTitle: Colors.BLACK_40,
229
- disabledDescription: Colors.BLACK_24,
230
- divider: Colors.GREY_2,
231
- cardBackground: Colors.WHITE,
232
- },
233
- primaries: {
234
- azure: Colors.AZURE,
235
- red: Colors.RED,
236
- green: Colors.GREEN,
237
- yellow: Colors.YELLOW,
238
- purple: Colors.PURPLE,
239
- blue: Colors.BLUE,
240
- },
241
- primariesContrast: {
242
- azure: Colors.WHITE,
243
- red: Colors.WHITE,
244
- green: Colors.WHITE,
245
- yellow: Colors.BLACK_80,
246
- purple: Colors.WHITE,
247
- blue: Colors.WHITE,
248
- },
249
- primariesLight: {
250
- azure: Colors.AZURE_L1,
251
- red: Colors.RED_L1,
252
- green: Colors.GREEN_L1,
253
- yellow: Colors.YELLOW_L1,
254
- purple: Colors.PURPLE_L1,
255
- blue: Colors.BLUE_L1,
256
- },
257
- primariesDark: {
258
- azure: Colors.AZURE_D1,
259
- red: Colors.RED_D2,
260
- green: Colors.GREEN_D2,
261
- yellow: Colors.YELLOW_D2,
262
- purple: Colors.PURPLE_D1,
263
- blue: Colors.BLUE_D1,
264
- },
265
- ficButton: ficButtonLightTheme,
266
- flatButton: {
267
- color: Colors.BLACK_80,
268
- disabledColor: Colors.GREY_2,
269
- backgroundColor: Colors.WHITE,
270
- hasShadow: true,
271
- shadowColor: Colors.BLACK,
272
- borderRadius: 4,
273
- disabledStyle: {
274
- backgroundColor: Colors.GREY_2,
275
- elevation: 0,
276
- shadowOffset: { width: 0, height: 0 },
277
- shadowOpacity: 0,
278
- },
279
- containerStyle: undefined,
280
- },
281
- gradientButton: {
282
- isHorizontalGradient: false,
283
- color: Colors.WHITE,
284
- disabledColor: Colors.GREY_2,
285
- backgroundColors: [Colors.AZURE_L2, Colors.AZURE],
286
- disabledBackgroundColors: [Colors.WHITE, Colors.WHITE],
287
- hasShadow: true,
288
- shadowColor: Colors.BLACK,
289
- borderRadius: 4,
290
- disabledStyle: undefined,
291
- containerStyle: undefined,
292
- },
293
- outlineButton: {
294
- color: Colors.AZURE,
295
- disabledColor: Colors.GREY_2,
296
- backgroundColor: Colors.WHITE,
297
- disabledBackgroundColor: Colors.WHITE,
298
- borderColor: Colors.AZURE_L2,
299
- disabledBorderColor: Colors.WHITE,
300
- hasShadow: true,
301
- shadowColor: Colors.BLACK,
302
- borderRadius: 4,
303
- disabledStyle: {
304
- backgroundColor: Colors.GREY_2,
305
- elevation: 0,
306
- shadowOffset: { width: 0, height: 0 },
307
- shadowOpacity: 0,
308
- },
309
- containerStyle: {
310
- justifyContent: 'center',
311
- alignItems: 'center',
312
- alignSelf: 'center',
313
- height: 40,
314
- backgroundColor: Colors.WHITE,
315
- borderRadius: 4,
316
- },
317
- },
318
- textInput: {
319
- color: Colors.BLACK_64,
320
- labelColor: Colors.BLACK_40,
321
- disabledTextColor: Colors.GREY_4,
322
- disabledLabelColor: Colors.GREY_3,
323
- mandatoryIndicatorColor: Colors.RED,
324
- placeholderColor: Colors.BLACK_40,
325
- inlineLeadingColor: Colors.BLACK_40,
326
- fieldIconColor: Colors.BLACK_40,
327
- borderColor: Colors.GREY_3,
328
- focusedBorderColor: Colors.AZURE,
329
- erroredBorderColor: Colors.RED,
330
- warningBorderColor: Colors.YELLOW_D1,
331
- disabledBorderColor: 'transparent',
332
- backgroundColor: Colors.WHITE,
333
- disabledBackgroundColor: Colors.GREY_1,
334
- },
335
- typographies: {
336
- bodyColor: Colors.BLACK_80,
337
- buttonTitleColor: Colors.BLACK_80,
338
- calloutColor: Colors.BLACK_64,
339
- captionOneColor: Colors.BLACK_64,
340
- captionTwoColor: Colors.BLACK_64,
341
- footnoteColor: Colors.BLACK_64,
342
- headlineColor: Colors.BLACK,
343
- largeTitleColor: Colors.BLACK,
344
- subheadColor: Colors.BLACK_64,
345
- titleOneColor: Colors.BLACK,
346
- titleTwoColor: Colors.BLACK,
347
- titleThreeColor: Colors.BLACK,
348
- },
349
- touchables: {
350
- rippleColors: Colors.GREY_2,
351
- highlightColor: Colors.GREY_3,
352
- },
353
- searchBar: {
354
- color: Colors.BLACK,
355
- backgroundColor: Colors.GREY_1,
356
- iconColor: Colors.GREY_4,
357
- selectionColor: Colors.AZURE,
358
- useTextColor: Colors.GREY_4,
359
- errorColor: Colors.RED,
360
- },
361
- datePickers: {
362
- calendarBackground: Colors.WHITE,
363
- backgroundColor: Colors.WHITE,
364
- arrowColor: Colors.AZURE,
365
- selectedDayBackgroundColor: Colors.AZURE,
366
- selectedDayTextColor: Colors.WHITE,
367
- selectedDotColor: Colors.WHITE,
368
- dayTextColor: Colors.BLACK,
369
- monthTextColor: Colors.AZURE,
370
- todayTextColor: Colors.AZURE,
371
- todayBackgroundColor: Colors.AZURE_L1,
372
- textMonthFontWeight: '500',
373
- textMonthFontSize: 17,
374
- textDayFontSize: 17,
375
- textSectionTitleColor: Colors.GREY_3,
376
- textDisabledColor: Colors.GREY_2,
377
- indicatorColor: Colors.AZURE,
378
- dotColor: Colors.AZURE,
379
- },
380
- pickers: {
381
- activeColor: Colors.BLACK,
382
- inactiveColor: Colors.BLACK_40,
383
- labelColor: Colors.BLACK_64,
384
- guidesColor: Colors.GREY_2,
385
- },
386
- bottomSheet: {
387
- backgroundColor: Colors.WHITE,
388
- backdropColor: Colors.BLACK,
389
- cancelButtonBackgroundColor: Colors.WHITE,
390
- handleIndicator: { backgroundColor: Colors.GREY_3 },
391
-
392
- header: {
393
- backgroundColor: Colors.AZURE,
394
- emptyHeaderBackgroundColor: Colors.WHITE,
395
- buttonsColor: Colors.WHITE,
396
- titleColor: Colors.WHITE,
397
- captionColor: Colors.WHITE_80,
398
- descriptionColor: Colors.WHITE_80,
399
- handleColor: Colors.AZURE_L3,
400
- darkHandleColor: Colors.GREY_3,
401
- loaderColor: Colors.AZURE,
402
- },
403
- },
404
- yearMonthPickers: {
405
- backgroundColor: Colors.WHITE,
406
- arrowsColor: Colors.AZURE,
407
- yearColor: Colors.AZURE,
408
- monthsTextColor: Colors.GREY_4,
409
- selectedMonthTextColor: Colors.WHITE,
410
- selectedMonthBackgroundColor: Colors.AZURE,
411
- currentMonthTextColor: Colors.AZURE,
412
- currentMonthBackgroundColor: Colors.AZURE_L1,
413
- },
414
- };
415
-
416
- export const ficDarkTheme: Theme = {
417
- banner: bannerDarkTheme,
418
-
419
- generic: {
420
- backgroundLevel0: Colors.ELEVATION_1,
421
- backgroundLevel1: Colors.ELEVATION_2,
422
- backgroundLevel2: Colors.ELEVATION_3,
423
- backgroundLevel3: Colors.ELEVATION_4,
424
- backgroundLevel4: Colors.ELEVATION_5,
425
- title: Colors.WHITE,
426
- description: Colors.WHITE_80,
427
- disabledTitle: Colors.WHITE_64,
428
- disabledDescription: Colors.WHITE_40,
429
- divider: Colors.WHITE_8,
430
- cardBackground: Colors.ELEVATION_3,
431
- },
432
- primaries: {
433
- azure: Colors.AZURE_K,
434
- red: Colors.RED_K_D1,
435
- green: Colors.GREEN_K,
436
- yellow: Colors.YELLOW,
437
- purple: Colors.PURPLE_K,
438
- blue: Colors.BLUE_K,
439
- },
440
- primariesContrast: {
441
- azure: Colors.WHITE,
442
- red: Colors.WHITE,
443
- green: Colors.BLACK_80,
444
- yellow: Colors.BLACK_80,
445
- purple: Colors.WHITE,
446
- blue: Colors.WHITE,
447
- },
448
- primariesLight: {
449
- azure: Colors.AZURE_K_L1,
450
- red: Colors.RED_K_L1,
451
- green: Colors.GREEN_K_L1,
452
- yellow: Colors.YELLOW_L1,
453
- purple: Colors.PURPLE_L1,
454
- blue: Colors.BLUE_K_L1,
455
- },
456
- primariesDark: {
457
- azure: Colors.AZURE_K_D1,
458
- red: Colors.RED_K_D2,
459
- green: Colors.GREEN_K_D2,
460
- yellow: Colors.YELLOW_D2,
461
- purple: Colors.PURPLE_D1,
462
- blue: Colors.BLUE_K_D1,
463
- },
464
- ficButton: ficButtonDarkTheme,
465
- flatButton: {
466
- color: Colors.WHITE,
467
- disabledColor: Colors.WHITE_40,
468
- backgroundColor: Colors.ELEVATION_1,
469
- hasShadow: true,
470
- shadowColor: Colors.BLACK,
471
- borderRadius: 4,
472
- disabledStyle: {
473
- backgroundColor: Colors.ELEVATION_2,
474
- elevation: 0,
475
- shadowOffset: { width: 0, height: 0 },
476
- shadowOpacity: 0,
477
- },
478
- containerStyle: undefined,
479
- },
480
- gradientButton: {
481
- isHorizontalGradient: false,
482
- color: Colors.WHITE,
483
- disabledColor: Colors.WHITE_40,
484
- backgroundColors: [Colors.AZURE_K_L2, Colors.AZURE_K],
485
- disabledBackgroundColors: [Colors.ELEVATION_2, Colors.ELEVATION_2],
486
- hasShadow: true,
487
- shadowColor: Colors.BLACK,
488
- borderRadius: 4,
489
- disabledStyle: undefined,
490
- containerStyle: undefined,
491
- },
492
- outlineButton: {
493
- color: Colors.AZURE_K,
494
- disabledColor: Colors.WHITE_40,
495
- backgroundColor: Colors.ELEVATION_1,
496
- disabledBackgroundColor: Colors.WHITE_24,
497
- borderColor: Colors.AZURE_K,
498
- disabledBorderColor: Colors.WHITE_24,
499
- hasShadow: true,
500
- shadowColor: Colors.BLACK,
501
- borderRadius: 4,
502
- disabledStyle: {
503
- backgroundColor: Colors.ELEVATION_2,
504
- elevation: 0,
505
- shadowOffset: { width: 0, height: 0 },
506
- shadowOpacity: 0,
507
- },
508
- containerStyle: {
509
- justifyContent: 'center',
510
- alignItems: 'center',
511
- alignSelf: 'center',
512
- height: 40,
513
- backgroundColor: Colors.ELEVATION_1,
514
- borderRadius: 4,
515
- },
516
- },
517
- textInput: {
518
- color: Colors.WHITE,
519
- labelColor: Colors.WHITE_64,
520
- disabledTextColor: Colors.WHITE_40,
521
- disabledLabelColor: Colors.WHITE_24,
522
- mandatoryIndicatorColor: Colors.RED_K,
523
- placeholderColor: Colors.WHITE_64,
524
- inlineLeadingColor: Colors.WHITE_80,
525
- fieldIconColor: Colors.WHITE_64,
526
- borderColor: Colors.ELEVATION_5,
527
- focusedBorderColor: Colors.AZURE_K_L3,
528
- erroredBorderColor: Colors.RED_K,
529
- warningBorderColor: Colors.YELLOW,
530
- disabledBorderColor: 'transparent',
531
- backgroundColor: Colors.ELEVATION_2,
532
- disabledBackgroundColor: Colors.WHITE_8,
533
- },
534
- typographies: {
535
- bodyColor: Colors.WHITE_80,
536
- buttonTitleColor: Colors.WHITE,
537
- calloutColor: Colors.WHITE_64,
538
- captionOneColor: Colors.WHITE_64,
539
- captionTwoColor: Colors.WHITE_64,
540
- footnoteColor: Colors.WHITE_64,
541
- headlineColor: Colors.WHITE,
542
- largeTitleColor: Colors.WHITE,
543
- subheadColor: Colors.WHITE_64,
544
- titleOneColor: Colors.WHITE,
545
- titleTwoColor: Colors.WHITE,
546
- titleThreeColor: Colors.WHITE,
547
- },
548
- touchables: {
549
- rippleColors: Colors.ELEVATION_3,
550
- highlightColor: Colors.ELEVATION_4,
551
- },
552
- searchBar: {
553
- color: Colors.WHITE_64,
554
- backgroundColor: Colors.ELEVATION_4,
555
- iconColor: Colors.WHITE_80,
556
- selectionColor: Colors.AZURE_K,
557
- useTextColor: Colors.WHITE_40,
558
- errorColor: Colors.RED_K,
559
- },
560
- datePickers: {
561
- calendarBackground: Colors.ELEVATION_1,
562
- backgroundColor: Colors.ELEVATION_1,
563
- arrowColor: Colors.AZURE_K,
564
- selectedDayBackgroundColor: Colors.AZURE_K,
565
- selectedDayTextColor: Colors.WHITE,
566
- selectedDotColor: Colors.WHITE,
567
- dayTextColor: Colors.WHITE,
568
- monthTextColor: Colors.AZURE_K,
569
- todayTextColor: Colors.AZURE_K,
570
- todayBackgroundColor: Colors.AZURE_K_L1,
571
- textMonthFontWeight: '500',
572
- textMonthFontSize: 17,
573
- textDayFontSize: 17,
574
- textSectionTitleColor: Colors.ELEVATION_3,
575
- textDisabledColor: Colors.ELEVATION_2,
576
- indicatorColor: Colors.AZURE_K,
577
- dotColor: Colors.AZURE_K,
578
- },
579
- pickers: {
580
- activeColor: Colors.WHITE,
581
- inactiveColor: Colors.WHITE_64,
582
- labelColor: Colors.WHITE_80,
583
- guidesColor: Colors.WHITE_8,
584
- },
585
- bottomSheet: {
586
- backgroundColor: Colors.ELEVATION_1,
587
- backdropColor: Colors.BACKDROP,
588
- cancelButtonBackgroundColor: Colors.ELEVATION_1,
589
- handleIndicator: { backgroundColor: Colors.ELEVATION_5 },
590
-
591
- header: {
592
- backgroundColor: Colors.AZURE_K,
593
- emptyHeaderBackgroundColor: Colors.ELEVATION_1,
594
- buttonsColor: Colors.WHITE,
595
- titleColor: Colors.WHITE,
596
- captionColor: Colors.WHITE_80,
597
- descriptionColor: Colors.WHITE_80,
598
- handleColor: Colors.AZURE_K,
599
- darkHandleColor: Colors.ELEVATION_4,
600
- loaderColor: Colors.AZURE_K,
601
- },
602
- },
603
- yearMonthPickers: {
604
- backgroundColor: Colors.ELEVATION_1,
605
- arrowsColor: Colors.AZURE_K,
606
- yearColor: Colors.AZURE_K,
607
- monthsTextColor: Colors.ELEVATION_2,
608
- selectedMonthTextColor: Colors.WHITE,
609
- selectedMonthBackgroundColor: Colors.AZURE_K,
610
- currentMonthTextColor: Colors.AZURE_K,
611
- currentMonthBackgroundColor: Colors.AZURE_K_L1,
612
- },
613
- };
614
-
615
- export const defaultTheme: Theme = ficTheme;
@@ -1,50 +0,0 @@
1
- import { capitalize, map } from 'lodash';
2
- import moment from 'moment';
3
- import 'moment/min/locales';
4
- import { NativeModules, Platform } from 'react-native';
5
- import { LocaleConfig } from 'react-native-calendars';
6
-
7
- const calendarLocaleConfig = (localeCode: string) => {
8
- const momentLocale = moment.localeData(localeCode);
9
-
10
- return {
11
- monthNames: capitalizeStringArray(momentLocale.months()),
12
- monthNamesShort: capitalizeStringArray(momentLocale.monthsShort()),
13
- dayNames: capitalizeStringArray(momentLocale.weekdays()),
14
- dayNamesShort: capitalizeStringArray(momentLocale.weekdaysShort()),
15
- today: 'Today'
16
- };
17
- };
18
-
19
- const capitalizeStringArray = (arr: string[]) => {
20
- return map(arr, element => capitalize(element));
21
- };
22
-
23
- /**
24
- * Retrieves the language and optionally the region settings of the device.
25
- *
26
- * @param {boolean} [withNoRegion] - If `true`, only the language is returned without the region.
27
- * @returns {string} The language and region settings of the device.
28
- * @example
29
- * // Returns "it_IT" or "it" if `withNoRegion` is `true`
30
- * const languageRegion = getDeviceLanguageAndRegion(true);
31
- */
32
- export const getDeviceLanguageAndRegion = (withNoRegion?: boolean): string => {
33
- const language_region =
34
- Platform.OS === 'ios'
35
- ? NativeModules.SettingsManager.settings.AppleLocale || NativeModules.SettingsManager.settings.AppleLanguages[0]
36
- : NativeModules.I18nManager.localeIdentifier;
37
- const language = language_region.split('_')[0];
38
- return withNoRegion ? language : language_region;
39
- };
40
-
41
- export let desiredLocale: string | undefined = undefined;
42
-
43
- const setLocale = (localeCode: string) => {
44
- moment.locale(localeCode);
45
- LocaleConfig.locales[localeCode] = calendarLocaleConfig(localeCode);
46
- LocaleConfig.defaultLocale = localeCode;
47
- desiredLocale = localeCode;
48
- };
49
-
50
- export default setLocale;