@fattureincloud-mobile/fic-mobile-ds 1.2.3 → 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,198 +0,0 @@
1
- import * as React from 'react';
2
- import { useCallback, useMemo } from 'react';
3
- import {
4
- GestureResponderEvent,
5
- Platform,
6
- Pressable as PressableIOS,
7
- StyleProp,
8
- TextStyle,
9
- View,
10
- ViewStyle,
11
- } from 'react-native';
12
- import { TouchableHighlight } from 'react-native-gesture-handler';
13
- import Animated, {
14
- runOnUI,
15
- useAnimatedStyle,
16
- useSharedValue,
17
- withTiming,
18
- } from 'react-native-reanimated';
19
- import { useTheme } from '../../../hooks/useTheme';
20
- import { Icon } from '../../../providers/IconProvider';
21
- import { PADDING } from '../../../styles/space';
22
- import { Body } from '../../typographies/Body';
23
- import {
24
- DEFAULT_ICON,
25
- DEFAULT_ICON_SIZE,
26
- DEFAULT_TITLE,
27
- HIT_SLOP,
28
- ICON_HORIZONTAL_MARGIN,
29
- } from './constants';
30
- import {
31
- FicButtonTextProps,
32
- FicButtonThemeProps,
33
- onPressType,
34
- } from './FicButton.types';
35
-
36
- const FicButtonTertiary: React.FC<FicButtonTextProps> = ({
37
- title,
38
- iconName,
39
- iconSize,
40
- onPress,
41
- onPressIn,
42
- onPressOut,
43
- disabled,
44
- error,
45
- iconPosition,
46
- colorContrastForLightTheme,
47
- fullWidth,
48
- small,
49
- solid,
50
- regular,
51
- light,
52
- duotone,
53
- containerStyle,
54
- }) => {
55
- const { ficButton: theme } = useTheme() || {};
56
-
57
- const Pressable = Platform.OS === 'ios' ? PressableIOS : TouchableHighlight;
58
-
59
- const buttonTheme = (theme?.['tertiary'] as FicButtonThemeProps) || {};
60
- const themeProps = disabled
61
- ? buttonTheme.disabled
62
- : error
63
- ? buttonTheme.error
64
- : buttonTheme.default;
65
- const _containerStyle = containerStyle ?? {};
66
-
67
- const pressedOpacity = useSharedValue(0);
68
-
69
- const iconColor = useMemo(() => {
70
- return colorContrastForLightTheme && !error
71
- ? themeProps?.icon.colorContrastForLightTheme
72
- ? themeProps?.icon.colorContrastForLightTheme
73
- : themeProps?.icon.color
74
- : themeProps?.icon.color;
75
- }, [themeProps, colorContrastForLightTheme, error]);
76
-
77
- const bodyColor = useMemo(() => {
78
- return colorContrastForLightTheme && !error
79
- ? themeProps?.text.colorContrastForLightTheme
80
- ? themeProps?.text.colorContrastForLightTheme
81
- : themeProps?.text.color
82
- : themeProps?.text.color;
83
- }, [themeProps, colorContrastForLightTheme, error]);
84
-
85
- const bodyStyle: StyleProp<TextStyle> = useMemo(
86
- () => ({
87
- marginLeft: iconPosition === 'left' ? ICON_HORIZONTAL_MARGIN : 0,
88
- marginRight: iconPosition === 'right' ? ICON_HORIZONTAL_MARGIN : 0,
89
- textDecorationLine: themeProps?.text.textDecorationLine ?? 'underline',
90
- }),
91
- [themeProps, iconPosition, disabled]
92
- );
93
-
94
- const pressableAreaStyle = useAnimatedStyle<ViewStyle>(() => ({
95
- top: small ? -PADDING.SM : -PADDING.LG,
96
- bottom: small ? -PADDING.SM : -PADDING.LG,
97
- left: fullWidth ? 0 : PADDING.LG * -1,
98
- right: fullWidth ? 0 : PADDING.LG * -1,
99
- position: 'absolute',
100
- opacity: pressedOpacity.value,
101
- ...themeProps?.pressedStyle?.container,
102
- }));
103
-
104
- const animate = (value: number) => {
105
- 'worklet';
106
- pressedOpacity.value = withTiming(value, { duration: 0 });
107
- };
108
-
109
- const handleOnPressIn: onPressType = useCallback(
110
- (e: GestureResponderEvent | undefined) => {
111
- runOnUI(animate)(1);
112
- if (onPressIn) onPressIn(e);
113
- },
114
- [pressedOpacity, onPressIn]
115
- );
116
-
117
- const handleOnPressOut: onPressType = useCallback(
118
- (e: GestureResponderEvent | undefined) => {
119
- runOnUI(animate)(0);
120
- if (onPressOut) onPressOut(e);
121
- },
122
- [pressedOpacity, onPressOut]
123
- );
124
-
125
- const handleOnPress: onPressType = (e: GestureResponderEvent | undefined) => {
126
- if (onPress) onPress(e);
127
- };
128
-
129
- const FicTertiary = useCallback(() => {
130
- return (
131
- <>
132
- {iconPosition === 'left' ? (
133
- <Icon
134
- name={iconName || DEFAULT_ICON}
135
- size={iconSize ?? DEFAULT_ICON_SIZE}
136
- color={iconColor}
137
- solid={solid}
138
- regular={regular}
139
- light={light}
140
- duotone={duotone}
141
- />
142
- ) : null}
143
- <Body
144
- text={title ?? DEFAULT_TITLE}
145
- style={bodyStyle}
146
- color={bodyColor}
147
- />
148
- {iconPosition === 'right' ? (
149
- <Icon
150
- name={iconName || DEFAULT_ICON}
151
- size={iconSize ?? DEFAULT_ICON_SIZE}
152
- color={iconColor}
153
- solid={solid}
154
- regular={regular}
155
- light={light}
156
- duotone={duotone}
157
- />
158
- ) : null}
159
- </>
160
- );
161
- }, [
162
- iconPosition,
163
- iconName,
164
- iconSize,
165
- buttonTheme,
166
- disabled,
167
- error,
168
- bodyStyle,
169
- title,
170
- ]);
171
-
172
- return (
173
- <View
174
- style={[
175
- {
176
- width: fullWidth ? '100%' : 'auto',
177
- alignSelf: fullWidth ? 'stretch' : 'flex-start',
178
- },
179
- _containerStyle,
180
- ]}
181
- >
182
- <Animated.View style={pressableAreaStyle} />
183
- <Pressable
184
- style={themeProps?.container}
185
- onPress={handleOnPress}
186
- onPressIn={handleOnPressIn}
187
- onPressOut={handleOnPressOut}
188
- disabled={disabled}
189
- hitSlop={HIT_SLOP}
190
- underlayColor={'transparent'}
191
- >
192
- {FicTertiary()}
193
- </Pressable>
194
- </View>
195
- );
196
- };
197
-
198
- export default FicButtonTertiary;
@@ -1,23 +0,0 @@
1
- import { Insets } from 'react-native';
2
- import { Colors } from '../../../styles/colors';
3
- import { PADDING } from '../../../styles/space';
4
-
5
- export const FONT_SIZE = 17;
6
-
7
- export const ICON_HORIZONTAL_MARGIN = 8;
8
- export const ICON_SIZE_BIG = 24;
9
-
10
- export const DEFAULT_ICON_SIZE = 16;
11
- export const DEFAULT_PRESSED_BG_COLOR = Colors.GREY_2;
12
-
13
- export const DEFAULT_TITLE = 'Button';
14
- export const DEFAULT_ICON = 'heart';
15
-
16
- export const BUTTON_INTERNAL_PADDING_HORIZONTAL = PADDING.LG;
17
-
18
- export const HIT_SLOP: Insets = {
19
- top: 16,
20
- left: 16,
21
- right: 16,
22
- bottom: 16,
23
- };
@@ -1,5 +0,0 @@
1
- import FicButton from './FicButton';
2
- import { FicButtonProps } from './FicButton.types';
3
-
4
- export { FicButton };
5
- export type { FicButtonProps };
@@ -1,273 +0,0 @@
1
- import { FlexAlignType } from 'react-native';
2
- import { Colors } from '../../../../styles/colors';
3
- import { BORDER_RADIUS } from '../../../../styles/space';
4
- import { FicButtonTheme, GenericViewStyle } from '../FicButton.types';
5
- import { FONT_SIZE } from '../constants';
6
-
7
- const defaultContainerProps: GenericViewStyle = {
8
- flexDirection: 'row',
9
- alignSelf: 'flex-start',
10
- justifyContent: 'center',
11
- alignContent: 'center',
12
- alignItems: 'center',
13
- borderRadius: BORDER_RADIUS.SM,
14
- };
15
-
16
- const { alignContent, ...defaultIconContainerProps } = defaultContainerProps;
17
-
18
- const iconContainerProps = {
19
- ...defaultIconContainerProps,
20
- borderRadius: 1000,
21
- alignSelf: 'center' as FlexAlignType,
22
- };
23
-
24
- const ficButtonDarkTheme: FicButtonTheme = {
25
- primary: {
26
- default: {
27
- container: {
28
- ...defaultContainerProps,
29
- backgroundColor: Colors.AZURE_K,
30
- },
31
- text: {
32
- color: Colors.ELEVATION_1,
33
- },
34
- icon: {
35
- color: Colors.ELEVATION_1,
36
- },
37
- pressedStyle: {
38
- container: {
39
- ...defaultContainerProps,
40
- backgroundColor: Colors.AZURE_K_D1,
41
- },
42
- text: {
43
- color: Colors.ELEVATION_1,
44
- },
45
- icon: {
46
- color: Colors.ELEVATION_1,
47
- },
48
- },
49
- },
50
- disabled: {
51
- container: {
52
- ...defaultContainerProps,
53
- backgroundColor: Colors.ELEVATION_4,
54
- },
55
- text: {
56
- color: Colors.ELEVATION_2,
57
- },
58
- icon: {
59
- color: Colors.ELEVATION_2,
60
- },
61
- },
62
- error: {
63
- container: {
64
- ...defaultContainerProps,
65
- backgroundColor: Colors.RED,
66
- },
67
- text: {
68
- color: Colors.WHITE,
69
- },
70
- icon: {
71
- color: Colors.WHITE,
72
- },
73
- pressedStyle: {
74
- container: {
75
- ...defaultContainerProps,
76
- backgroundColor: Colors.RED_D1,
77
- },
78
- text: {
79
- color: Colors.WHITE,
80
- },
81
- icon: {
82
- color: Colors.WHITE,
83
- },
84
- },
85
- },
86
- },
87
- secondary: {
88
- default: {
89
- container: {
90
- ...defaultContainerProps,
91
- backgroundColor: Colors.ELEVATION_1,
92
- borderWidth: 1,
93
- borderColor: Colors.AZURE_K,
94
- },
95
- text: {
96
- color: Colors.AZURE_K,
97
- },
98
- icon: {
99
- color: Colors.AZURE_K,
100
- },
101
- pressedStyle: {
102
- container: {
103
- ...defaultContainerProps,
104
- backgroundColor: Colors.ELEVATION_2,
105
- borderWidth: 1,
106
- borderColor: Colors.AZURE_K,
107
- },
108
- text: {
109
- color: Colors.AZURE_K,
110
- },
111
- icon: {
112
- color: Colors.AZURE_K,
113
- },
114
- },
115
- },
116
- disabled: {
117
- container: {
118
- ...defaultContainerProps,
119
- backgroundColor: Colors.ELEVATION_1,
120
- borderWidth: 1,
121
- borderColor: Colors.ELEVATION_4,
122
- },
123
- text: {
124
- color: Colors.ELEVATION_4,
125
- },
126
- icon: {
127
- color: Colors.ELEVATION_4,
128
- },
129
- },
130
- error: {
131
- container: {
132
- ...defaultContainerProps,
133
- backgroundColor: Colors.ELEVATION_1,
134
- borderWidth: 1,
135
- borderColor: Colors.RED_K_D1,
136
- },
137
- text: {
138
- color: Colors.RED_K_D1,
139
- },
140
- icon: {
141
- color: Colors.RED_K_D1,
142
- },
143
- pressedStyle: {
144
- container: {
145
- ...defaultContainerProps,
146
- backgroundColor: Colors.ELEVATION_2,
147
- borderWidth: 1,
148
- borderColor: Colors.RED_K_D1,
149
- },
150
- text: {
151
- color: Colors.RED_K_D1,
152
- },
153
- icon: {
154
- color: Colors.RED_K_D1,
155
- },
156
- },
157
- },
158
- },
159
- tertiary: {
160
- default: {
161
- container: { ...defaultContainerProps, alignSelf: 'center' },
162
- text: {
163
- textDecorationLine: 'underline',
164
- fontSize: FONT_SIZE,
165
- color: Colors.AZURE_K,
166
- },
167
- icon: {
168
- color: Colors.AZURE_K,
169
- },
170
- pressedStyle: {
171
- container: {
172
- ...defaultContainerProps,
173
- alignSelf: 'center',
174
- backgroundColor: Colors.ELEVATION_4,
175
- },
176
- text: {
177
- textDecorationLine: 'underline',
178
- fontSize: FONT_SIZE,
179
- color: Colors.AZURE_K,
180
- },
181
- icon: {
182
- color: Colors.AZURE_K,
183
- },
184
- },
185
- },
186
- disabled: {
187
- container: { ...defaultContainerProps, alignSelf: 'center' },
188
- text: {
189
- textDecorationLine: 'underline',
190
- fontSize: FONT_SIZE,
191
- color: Colors.ELEVATION_4,
192
- },
193
- icon: {
194
- color: Colors.ELEVATION_4,
195
- },
196
- },
197
- error: {
198
- container: { ...defaultContainerProps, alignSelf: 'center' },
199
- text: {
200
- textDecorationLine: 'underline',
201
- fontSize: FONT_SIZE,
202
- color: Colors.RED_K_D1,
203
- },
204
- icon: {
205
- color: Colors.RED_K_D1,
206
- },
207
- pressedStyle: {
208
- container: {
209
- ...defaultContainerProps,
210
- alignSelf: 'center',
211
- backgroundColor: Colors.ELEVATION_4,
212
- },
213
- text: {
214
- textDecorationLine: 'underline',
215
- fontSize: FONT_SIZE,
216
- color: Colors.RED_K_D1,
217
- },
218
- icon: {
219
- color: Colors.RED_K_D1,
220
- },
221
- },
222
- },
223
- },
224
- icon: {
225
- default: {
226
- container: { ...iconContainerProps, alignSelf: 'flex-start' },
227
- text: {},
228
- icon: {
229
- color: Colors.WHITE_80,
230
- },
231
- pressedStyle: {
232
- container: {
233
- backgroundColor: Colors.ELEVATION_4,
234
- justifyContent: 'center',
235
- alignItems: 'center',
236
- },
237
- text: {},
238
- icon: {
239
- color: Colors.WHITE_80,
240
- },
241
- },
242
- },
243
- disabled: {
244
- container: { ...iconContainerProps },
245
- text: {},
246
- icon: {
247
- color: Colors.ELEVATION_4,
248
- },
249
- },
250
- error: {
251
- container: { ...iconContainerProps },
252
- text: {},
253
- icon: {
254
- color: Colors.RED_K_D1,
255
- },
256
- pressedStyle: {
257
- container: {
258
- position: 'absolute',
259
- justifyContent: 'center',
260
- alignItems: 'center',
261
- borderRadius: 1000,
262
- backgroundColor: Colors.ELEVATION_4,
263
- },
264
- text: {},
265
- icon: {
266
- color: Colors.RED_K_D1,
267
- },
268
- },
269
- },
270
- },
271
- };
272
-
273
- export default ficButtonDarkTheme;
@@ -1,4 +0,0 @@
1
- import ficButtonDarkTheme from './dark';
2
- import ficButtonLightTheme from './light';
3
-
4
- export { ficButtonDarkTheme, ficButtonLightTheme };