@jamadd/react-native-template-ui 0.8.5 → 0.8.6

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 (144) hide show
  1. package/lib/module/components/overlay/actionSheet/ActionSheet.web.js +31 -0
  2. package/lib/module/components/overlay/actionSheet/ActionSheet.web.js.map +1 -0
  3. package/lib/module/components/overlay/actionSheet/ActionSheetHeader.web.js +57 -0
  4. package/lib/module/components/overlay/actionSheet/ActionSheetHeader.web.js.map +1 -0
  5. package/lib/module/components/overlay/actionSheet/ActionSheetListView.js +1 -1
  6. package/lib/module/components/overlay/actionSheet/ActionSheetListView.js.map +1 -1
  7. package/lib/module/components/overlay/actionSheet/ActionSheetOptions.js +1 -1
  8. package/lib/module/components/overlay/actionSheet/ActionSheetOptions.js.map +1 -1
  9. package/lib/module/components/overlay/actionSheet/ActionSheetScrollView.js +1 -1
  10. package/lib/module/components/overlay/actionSheet/ActionSheetScrollView.js.map +1 -1
  11. package/lib/module/components/slider/ThemedSlider.web.js +82 -0
  12. package/lib/module/components/slider/ThemedSlider.web.js.map +1 -0
  13. package/lib/module/index.js +2 -2
  14. package/lib/module/index.js.map +1 -1
  15. package/lib/typescript/src/components/overlay/actionSheet/ActionSheet.web.d.ts +5 -0
  16. package/lib/typescript/src/components/overlay/actionSheet/ActionSheet.web.d.ts.map +1 -0
  17. package/lib/typescript/src/components/overlay/actionSheet/ActionSheetContentGesture.d.ts +0 -2
  18. package/lib/typescript/src/components/overlay/actionSheet/ActionSheetContentGesture.d.ts.map +1 -1
  19. package/lib/typescript/src/components/overlay/actionSheet/ActionSheetHeader.d.ts +0 -2
  20. package/lib/typescript/src/components/overlay/actionSheet/ActionSheetHeader.d.ts.map +1 -1
  21. package/lib/typescript/src/components/overlay/actionSheet/ActionSheetHeader.web.d.ts +4 -0
  22. package/lib/typescript/src/components/overlay/actionSheet/ActionSheetHeader.web.d.ts.map +1 -0
  23. package/lib/typescript/src/components/overlay/actionSheet/ActionSheetListView.d.ts +0 -2
  24. package/lib/typescript/src/components/overlay/actionSheet/ActionSheetListView.d.ts.map +1 -1
  25. package/lib/typescript/src/components/overlay/actionSheet/ActionSheetListViewContent.d.ts +0 -2
  26. package/lib/typescript/src/components/overlay/actionSheet/ActionSheetListViewContent.d.ts.map +1 -1
  27. package/lib/typescript/src/components/overlay/actionSheet/ActionSheetOptionList.d.ts +0 -2
  28. package/lib/typescript/src/components/overlay/actionSheet/ActionSheetOptionList.d.ts.map +1 -1
  29. package/lib/typescript/src/components/overlay/actionSheet/ActionSheetOptionListItem.d.ts +0 -2
  30. package/lib/typescript/src/components/overlay/actionSheet/ActionSheetOptionListItem.d.ts.map +1 -1
  31. package/lib/typescript/src/components/overlay/actionSheet/ActionSheetOptions.d.ts +0 -2
  32. package/lib/typescript/src/components/overlay/actionSheet/ActionSheetOptions.d.ts.map +1 -1
  33. package/lib/typescript/src/components/overlay/actionSheet/ActionSheetScrollView.d.ts +0 -2
  34. package/lib/typescript/src/components/overlay/actionSheet/ActionSheetScrollView.d.ts.map +1 -1
  35. package/lib/typescript/src/components/overlay/actionSheet/ActionSheetScrollViewContent.d.ts +0 -2
  36. package/lib/typescript/src/components/overlay/actionSheet/ActionSheetScrollViewContent.d.ts.map +1 -1
  37. package/lib/typescript/src/components/overlay/actionSheet/ActionSheetWrap.d.ts +0 -2
  38. package/lib/typescript/src/components/overlay/actionSheet/ActionSheetWrap.d.ts.map +1 -1
  39. package/lib/typescript/src/components/slider/ThemedSlider.web.d.ts +5 -0
  40. package/lib/typescript/src/components/slider/ThemedSlider.web.d.ts.map +1 -0
  41. package/lib/typescript/src/components/view/AnimatedView.d.ts +0 -2
  42. package/lib/typescript/src/components/view/AnimatedView.d.ts.map +1 -1
  43. package/lib/typescript/src/hooks/overlay.d.ts +0 -27
  44. package/lib/typescript/src/hooks/overlay.d.ts.map +1 -1
  45. package/lib/typescript/src/hooks/switch.d.ts +1 -20
  46. package/lib/typescript/src/hooks/switch.d.ts.map +1 -1
  47. package/lib/typescript/src/types/list.d.ts +1 -10
  48. package/lib/typescript/src/types/list.d.ts.map +1 -1
  49. package/lib/typescript/src/types/overlay.d.ts +1 -31
  50. package/lib/typescript/src/types/overlay.d.ts.map +1 -1
  51. package/lib/typescript/src/utils/overlay/const.d.ts +0 -33
  52. package/lib/typescript/src/utils/overlay/const.d.ts.map +1 -1
  53. package/lib/typescript/src/utils/reanimated/func.d.ts +1 -5
  54. package/lib/typescript/src/utils/reanimated/func.d.ts.map +1 -1
  55. package/lib/typescript/src/utils/switch/const.d.ts +1 -2
  56. package/lib/typescript/src/utils/switch/const.d.ts.map +1 -1
  57. package/package.json +1 -2
  58. package/src/components/button/AnimatedPressable.tsx +0 -7
  59. package/src/components/button/AnimatedThemedPressable.tsx +0 -12
  60. package/src/components/button/ThemedButton.tsx +0 -45
  61. package/src/components/button/ThemedIconButton.tsx +0 -33
  62. package/src/components/button/ThemedIconTextButton.tsx +0 -56
  63. package/src/components/button/ThemedPressable.tsx +0 -12
  64. package/src/components/icon/ThemedIcon.tsx +0 -31
  65. package/src/components/list/List.tsx +0 -55
  66. package/src/components/loading/ThemedLoading.tsx +0 -29
  67. package/src/components/overlay/actionSheet/ActionSheet.tsx +0 -31
  68. package/src/components/overlay/actionSheet/ActionSheetContentGesture.tsx +0 -15
  69. package/src/components/overlay/actionSheet/ActionSheetHeader.tsx +0 -72
  70. package/src/components/overlay/actionSheet/ActionSheetListView.tsx +0 -54
  71. package/src/components/overlay/actionSheet/ActionSheetListViewContent.tsx +0 -32
  72. package/src/components/overlay/actionSheet/ActionSheetOptionList.tsx +0 -51
  73. package/src/components/overlay/actionSheet/ActionSheetOptionListItem.tsx +0 -43
  74. package/src/components/overlay/actionSheet/ActionSheetOptions.tsx +0 -61
  75. package/src/components/overlay/actionSheet/ActionSheetScrollView.tsx +0 -57
  76. package/src/components/overlay/actionSheet/ActionSheetScrollViewContent.tsx +0 -38
  77. package/src/components/overlay/actionSheet/ActionSheetWrap.tsx +0 -75
  78. package/src/components/overlay/alert/Alert.tsx +0 -86
  79. package/src/components/overlay/alert/AlertButton.tsx +0 -41
  80. package/src/components/overlay/alert/AlertButtons.tsx +0 -32
  81. package/src/components/overlay/alert/AlertContent.tsx +0 -60
  82. package/src/components/overlay/alert/AlertWrap.tsx +0 -93
  83. package/src/components/overlay/modal/ThemedLoadingModal.tsx +0 -47
  84. package/src/components/overlay/modal/ThemedModal.tsx +0 -42
  85. package/src/components/overlay/toast/ThemedToast.tsx +0 -160
  86. package/src/components/provider/GestureProvider.tsx +0 -9
  87. package/src/components/provider/InsetsProvider.tsx +0 -11
  88. package/src/components/provider/ReactNativeTemplateProviders.tsx +0 -20
  89. package/src/components/provider/ThemeProvider.tsx +0 -8
  90. package/src/components/separator/ThemedSeparator.tsx +0 -24
  91. package/src/components/slider/Slider.tsx +0 -229
  92. package/src/components/slider/ThemedSlider.tsx +0 -103
  93. package/src/components/slider/ThemedSliderStepIndicator.tsx +0 -24
  94. package/src/components/switch/ThemedSwitch.tsx +0 -49
  95. package/src/components/text/Text.tsx +0 -7
  96. package/src/components/text/ThemedIconText.tsx +0 -58
  97. package/src/components/text/ThemedText.tsx +0 -7
  98. package/src/components/view/AnimatedThemedView.tsx +0 -18
  99. package/src/components/view/AnimatedView.tsx +0 -7
  100. package/src/components/view/Box.tsx +0 -7
  101. package/src/components/view/ThemedScreenWrap.tsx +0 -48
  102. package/src/components/view/ThemedScreenWrap.web.tsx +0 -41
  103. package/src/components/view/ThemedScrollView.tsx +0 -54
  104. package/src/components/view/ThemedView.tsx +0 -19
  105. package/src/hooks/button.ts +0 -152
  106. package/src/hooks/list.ts +0 -42
  107. package/src/hooks/overlay.ts +0 -471
  108. package/src/hooks/react.ts +0 -34
  109. package/src/hooks/reanimated.ts +0 -6
  110. package/src/hooks/separator.ts +0 -29
  111. package/src/hooks/style.ts +0 -79
  112. package/src/hooks/switch.ts +0 -119
  113. package/src/hooks/theme.ts +0 -65
  114. package/src/hooks/view.ts +0 -28
  115. package/src/index.ts +0 -59
  116. package/src/test/utils/const.ts +0 -9
  117. package/src/test/utils/func.ts +0 -55
  118. package/src/test/utils/testingLib.tsx +0 -17
  119. package/src/types/button.ts +0 -50
  120. package/src/types/global.d.ts +0 -5
  121. package/src/types/icon.ts +0 -21
  122. package/src/types/list.ts +0 -61
  123. package/src/types/loading.ts +0 -14
  124. package/src/types/overlay.ts +0 -216
  125. package/src/types/provider.ts +0 -6
  126. package/src/types/react.ts +0 -8
  127. package/src/types/reanimated.ts +0 -11
  128. package/src/types/separator.ts +0 -28
  129. package/src/types/slider.ts +0 -59
  130. package/src/types/style.ts +0 -26
  131. package/src/types/switch.ts +0 -31
  132. package/src/types/text.ts +0 -25
  133. package/src/types/theme.ts +0 -39
  134. package/src/types/view.ts +0 -58
  135. package/src/utils/button/const.ts +0 -10
  136. package/src/utils/overlay/const.ts +0 -77
  137. package/src/utils/overlay/func.ts +0 -107
  138. package/src/utils/reanimated/func.ts +0 -39
  139. package/src/utils/slider/const.ts +0 -23
  140. package/src/utils/style/const.ts +0 -4
  141. package/src/utils/style/func.ts +0 -37
  142. package/src/utils/switch/const.ts +0 -2
  143. package/src/utils/theme/const.ts +0 -189
  144. package/src/utils/theme/restyle.ts +0 -87
@@ -1,216 +0,0 @@
1
- import type { ModalProps, ViewStyle } from 'react-native';
2
- import type { SharedValue } from 'react-native-reanimated';
3
- import type {
4
- AlertButtonType,
5
- OverlayDismissResultType,
6
- ToastDuration,
7
- ToastType,
8
- } from '../utils/overlay/const';
9
- import type { ThemedButtonProps } from './button';
10
- import type { ListAnimatedRefObj, ListProps } from './list';
11
- import type { CustomThemedLoadingProps } from './loading';
12
- import type { SetState } from './react';
13
- import type { CustomAnimation } from './reanimated';
14
- import type { InsetsStyleConfig } from './style';
15
- import type { CustomThemedTextProps, ThemedTextProps } from './text';
16
- import type {
17
- AnimatedThemedViewProps,
18
- PropsWithRequiredChildren,
19
- ScrollViewAnimatedRefObj,
20
- ScrollViewProps,
21
- ThemedViewProps,
22
- ViewRefObj,
23
- } from './view';
24
-
25
- type OverlayProps = {
26
- onDismiss: () => void;
27
- dismissable?: boolean;
28
- };
29
-
30
- type OverlayDismissBaseResult = {
31
- resultType: OverlayDismissResultType;
32
- };
33
-
34
- export type OverlayOnDismiss<T> = (result: T) => void;
35
-
36
- type OverlayDismissToastResult = OverlayDismissBaseResult &
37
- Pick<ThemedToastProps, 'type' | 'text' | 'duration'> & {
38
- resultType: OverlayDismissResultType.Toast;
39
- };
40
-
41
- export type OverlayDismissAlertResult = OverlayDismissBaseResult &
42
- Pick<AlertProps, 'title' | 'description'> &
43
- Pick<AlertButtonProps, 'text' | 'type'> & {
44
- resultType: OverlayDismissResultType.Alert;
45
- };
46
-
47
- /** @internal */
48
- export type OverlayDismissActionSheetResult = OverlayDismissBaseResult &
49
- Pick<ActionSheetProps, 'title'> &
50
- Pick<ActionSheetOption, 'text'> & {
51
- resultType: OverlayDismissResultType.ActionSheet;
52
- };
53
-
54
- export type ThemedToastProps = Omit<OverlayProps, 'onDismiss'> &
55
- Omit<AnimatedThemedViewProps, 'children'> &
56
- CustomThemedTextProps &
57
- Pick<
58
- InsetsStyleConfig,
59
- | 'insetsPadding'
60
- | 'insetPaddingTop'
61
- | 'insetPaddingBottom'
62
- | 'insetPaddingLeft'
63
- | 'insetPaddingRight'
64
- > & {
65
- type?: ToastType;
66
- duration?: ToastDuration;
67
- onDismiss?: OverlayOnDismiss<OverlayDismissToastResult>;
68
- };
69
-
70
- export type ThemedModalProps = Partial<OverlayProps> &
71
- ModalProps & { contentWrapProps?: ThemedViewProps };
72
-
73
- export type ThemedLoadingModalProps = Omit<ThemedModalProps, 'children'> &
74
- CustomThemedLoadingProps &
75
- Partial<CustomThemedTextProps>;
76
-
77
- export type AlertContextVal = Partial<
78
- Pick<AlertProps, 'buttonProps'> & {
79
- onDismiss: (result?: Partial<OverlayDismissAlertResult>) => void;
80
- }
81
- >;
82
-
83
- export type AlertProps = Omit<OverlayProps, 'onDismiss'> &
84
- Pick<ModalProps, 'visible'> & {
85
- customShowAnimation?: CustomAnimation<1>;
86
- customHideAnimation?: CustomAnimation<0>;
87
- wrapProps?: Omit<AnimatedThemedViewProps, 'children'>;
88
- title: string;
89
- titleTextProps?: Omit<CustomThemedTextProps, 'text'>;
90
- description?: string;
91
- descriptionTextProps?: Omit<CustomThemedTextProps, 'text'>;
92
- buttons?: AlertButtonProps[][];
93
- buttonsWrapProps?: Omit<ThemedViewProps, 'children'>;
94
- buttonProps?: Omit<ThemedButtonProps, 'onPress' | 'text'>;
95
- onDismiss?: OverlayOnDismiss<OverlayDismissAlertResult>;
96
- };
97
-
98
- export type AlertButtonsProps = Pick<
99
- AlertProps,
100
- 'buttons' | 'buttonsWrapProps'
101
- >;
102
-
103
- export type AlertButtonProps = Pick<ThemedButtonProps, 'text'> & {
104
- type?: AlertButtonType;
105
- onPress?: ThemedButtonProps['onPress'];
106
- props?: Omit<ThemedButtonProps, 'onPress' | 'text'>;
107
- };
108
-
109
- export type ActionSheetProps = (Omit<OverlayProps, 'onDismiss'> &
110
- Omit<ActionSheetWrapProps, 'children'> &
111
- ActionSheetHeaderProps & {
112
- title?: string;
113
- expandable?: boolean;
114
- onDismiss?: OverlayOnDismiss<OverlayDismissActionSheetResult>;
115
- }) &
116
- (
117
- | {
118
- options: ActionSheetOptions;
119
- optionListProps?: ActionSheetOptionListProps;
120
- optionListItemProps?: ActionSheetOptionListItemProps;
121
- scrollViewProps?: never;
122
- children?: never;
123
- listProps?: never;
124
- }
125
- | PropsWithRequiredChildren<{
126
- scrollViewProps?: Omit<ScrollViewProps, 'ref'> & {
127
- ref?: ScrollViewAnimatedRefObj;
128
- };
129
- options?: never;
130
- optionListProps?: never;
131
- optionListItemProps?: never;
132
- listProps?: never;
133
- }>
134
- | {
135
- listProps: Omit<ListProps<any>, 'ref'> & {
136
- ref?: ListAnimatedRefObj<any>;
137
- };
138
- options?: never;
139
- optionListProps?: never;
140
- optionListItemProps?: never;
141
- scrollViewProps?: never;
142
- children?: never;
143
- }
144
- );
145
-
146
- export type ActionSheetWrapProps = PropsWithRequiredChildren<
147
- Pick<ModalProps, 'visible'> & {
148
- wrapViewProps?: Omit<AnimatedThemedViewProps, 'children' | 'style'> & {
149
- style?: ViewStyle;
150
- };
151
- }
152
- >;
153
-
154
- export type ActionSheetHeaderProps = {
155
- headerShowIcon?: boolean;
156
- headerWrapProps?: Omit<ThemedViewProps, 'children'>;
157
- headerTextProps?: Omit<ThemedTextProps, 'children'>;
158
- headerIconButtonProps?: Omit<ThemedButtonProps, 'onPress'>;
159
- };
160
-
161
- /** @internal */
162
- export type ActionSheetContextVal = Pick<
163
- ActionSheetProps,
164
- 'title' | 'expandable' | 'onDismiss' | 'dismissable'
165
- > & {
166
- headerViewRef: ViewRefObj;
167
- contentAnimatedRefObj: ListAnimatedRefObj<any> | ScrollViewAnimatedRefObj;
168
- height: number;
169
- setContentHeight?: SetState<number>;
170
- translateYSharedVal: SharedValue<number>;
171
- heightSharedVal: SharedValue<number>;
172
- expandableHeightSharedVal: SharedValue<number>;
173
- contentOffsetSharedVal: SharedValue<number>;
174
- };
175
-
176
- /** @internal */
177
- export type ActionSheetOptionsProps = ActionSheetProps &
178
- Required<Pick<ActionSheetProps, 'options'>>;
179
-
180
- export type ActionSheetOptionListProps = Omit<
181
- ListProps<ActionSheetOption>,
182
- 'ref' | 'data' | 'Item' | 'keyExtractor' | 'extraData'
183
- > & {
184
- ref?: ActionSheetOptionListRefObj;
185
- };
186
-
187
- export type ActionSheetOptionListItemProps = Omit<
188
- ThemedButtonProps,
189
- 'onPress' | 'text'
190
- >;
191
-
192
- export type ActionSheetOptionListRefObj = ListAnimatedRefObj<ActionSheetOption>;
193
-
194
- /** @internal */
195
- export type ActionSheetOptionListExtraData = {
196
- optionListItemProps?: ActionSheetOptionListItemProps;
197
- onDismiss: (text?: string) => void;
198
- };
199
-
200
- export type ActionSheetOption = Partial<Pick<ThemedButtonProps, 'onPress'>> & {
201
- text: string;
202
- props?: ActionSheetOptionListItemProps;
203
- };
204
-
205
- export type ActionSheetOptions = ActionSheetOption[];
206
-
207
- /** @internal */
208
- export type ActionSheetScrollViewProps = ActionSheetProps &
209
- Required<Pick<ActionSheetProps, 'children'>>;
210
-
211
- /** @internal */
212
- export type ActionSheetListViewProps = ActionSheetProps &
213
- Required<Pick<ActionSheetProps, 'listProps'>>;
214
-
215
- /** @internal */
216
- export type ActionSheetListViewListRefObj = ListAnimatedRefObj<any>;
@@ -1,6 +0,0 @@
1
- import type { Theme } from './theme';
2
- import type { PropsWithRequiredChildren } from './view';
3
-
4
- export type ReactNativeTemplateProvidersProps = PropsWithRequiredChildren<{
5
- theme: Theme;
6
- }>;
@@ -1,8 +0,0 @@
1
- import type { Dispatch, SetStateAction } from 'react';
2
- import type { LayoutChangeEvent } from 'react-native';
3
-
4
- export type Timeout = ReturnType<typeof setTimeout>;
5
-
6
- export type SetState<T> = Dispatch<SetStateAction<T>>;
7
-
8
- export type OnLayout = (event: LayoutChangeEvent) => void;
@@ -1,11 +0,0 @@
1
- import type { SharedValue } from 'react-native-reanimated';
2
-
3
- export type AnimationValue = 0 | 1;
4
-
5
- export type AnimationSharedValue = SharedValue<AnimationValue>;
6
-
7
- export type CustomAnimation<T = AnimationValue> = (
8
- sharedValue: AnimationSharedValue,
9
- toValue: T,
10
- animationCompletedCallback?: () => void
11
- ) => void;
@@ -1,28 +0,0 @@
1
- import type { BorderSize } from '../utils/theme/const';
2
- import type { ThemeBackgroundColorProps, ThemeSpacingProps } from './theme';
3
-
4
- export type ThemedSeparatorProps = ThemeBackgroundColorProps &
5
- Pick<
6
- ThemeSpacingProps,
7
- | 'margin'
8
- | 'marginVertical'
9
- | 'marginHorizontal'
10
- | 'marginTop'
11
- | 'marginBottom'
12
- | 'marginLeft'
13
- | 'marginRight'
14
- | 'marginStart'
15
- | 'marginEnd'
16
- | 'm'
17
- | 'my'
18
- | 'mx'
19
- | 'mt'
20
- | 'mb'
21
- | 'ml'
22
- | 'mr'
23
- | 'ms'
24
- | 'me'
25
- > & {
26
- size?: BorderSize | number;
27
- vertical?: boolean;
28
- };
@@ -1,59 +0,0 @@
1
- import type { SharedValue } from 'react-native-reanimated';
2
- import type {
3
- SliderThumbSize,
4
- SliderTrackSize,
5
- SliderValueDisplayMode,
6
- } from '../utils/slider/const';
7
- import type { SetState } from './react';
8
- import type { ThemedTextProps } from './text';
9
- import type { ThemeColors } from './theme';
10
- import type { AnimatedThemedViewProps, ThemedViewProps } from './view';
11
-
12
- export type NumberSlider = {
13
- range: [number, number];
14
- steps: number;
15
- defaultValue?: number;
16
- stepIndicator?: never;
17
- stepIndicatorProps?: never;
18
- };
19
-
20
- export type StringSlider = {
21
- range: string[];
22
- steps?: never;
23
- defaultValue?: string;
24
- stepIndicator?: boolean;
25
- stepIndicatorProps?: ThemedSliderStepIndicatorProps;
26
- };
27
-
28
- export type SliderProps = (NumberSlider | StringSlider) & {
29
- snapToStepAnimated?: boolean;
30
- onValueChange: (value: number | string) => void;
31
- sliderWrapProps?: ThemedViewProps;
32
- trackSize?: SliderTrackSize | number;
33
- trackActiveColor?: ThemeColors;
34
- trackActiveProps?: ThemedViewProps;
35
- trackInactiveColor?: ThemeColors;
36
- trackInactiveProps?: AnimatedThemedViewProps;
37
- thumbSize?: SliderThumbSize | number;
38
- thumbColor?: ThemeColors;
39
- thumbProps?: AnimatedThemedViewProps;
40
- valueDisplayMode?: SliderValueDisplayMode;
41
- valueDisplayWrapProps?: ThemedViewProps;
42
- valueTextProps?: Omit<ThemedTextProps, 'children'>;
43
- valueDescription?: string;
44
- valueDescriptionTextProps?: Omit<ThemedTextProps, 'children'>;
45
- gestureActivateDuration?: number;
46
- setSelectedVal: SetState<number | string | undefined>;
47
- selectedValSharedVal: SharedValue<number | string | undefined>;
48
- };
49
-
50
- export type ThemedSliderProps = Omit<
51
- SliderProps,
52
- 'setSelectedVal' | 'selectedValSharedVal'
53
- > & {
54
- snapToStepAnimated?: boolean;
55
- onValueChange: (value: number | string) => void;
56
- wrapProps?: ThemedViewProps;
57
- };
58
-
59
- export type ThemedSliderStepIndicatorProps = ThemedViewProps;
@@ -1,26 +0,0 @@
1
- import type {
2
- ImageStyle,
3
- StyleProp as RNStyleProp,
4
- TextStyle,
5
- ViewStyle,
6
- } from 'react-native';
7
- import type { ThemeSpacing } from './theme';
8
-
9
- export type Style = ViewStyle | TextStyle | ImageStyle;
10
-
11
- export type StyleProp<T = Style> = RNStyleProp<T>;
12
-
13
- export type StyleOrStyleProp<T = Style> = T | StyleProp<T>;
14
-
15
- export type InsetsStyleConfig = {
16
- insets?: boolean;
17
- insetTop?: boolean;
18
- insetBottom?: boolean;
19
- insetLeft?: boolean;
20
- insetRight?: boolean;
21
- insetsPadding?: ThemeSpacing;
22
- insetPaddingTop?: ThemeSpacing;
23
- insetPaddingBottom?: ThemeSpacing;
24
- insetPaddingLeft?: ThemeSpacing;
25
- insetPaddingRight?: ThemeSpacing;
26
- };
@@ -1,31 +0,0 @@
1
- import type { SwitchSize } from '../utils/theme/const';
2
- import type {
3
- AnimatedThemedPressableProps,
4
- OnPressDelayConfig,
5
- } from './button';
6
- import type { CustomAnimation } from './reanimated';
7
- import type { ThemeColors } from './theme';
8
- import type { AnimatedThemedViewProps } from './view';
9
-
10
- export type CustomSwitchColors = {
11
- border?: ThemeColors;
12
- borderEnabled?: ThemeColors;
13
- background?: ThemeColors;
14
- backgroundEnabled?: ThemeColors;
15
- thumb?: ThemeColors;
16
- thumbEnabled?: ThemeColors;
17
- };
18
-
19
- export type ThemedSwitchProps = Omit<
20
- AnimatedThemedPressableProps,
21
- 'onPress' | 'children'
22
- > & {
23
- onPress: (enabled: boolean) => void;
24
- enabled?: boolean;
25
- size?: SwitchSize | number;
26
- onPressDelayConfig?: OnPressDelayConfig;
27
- customEnableAnimation?: CustomAnimation<1>;
28
- customDisableAnimation?: CustomAnimation<0>;
29
- customColors?: CustomSwitchColors;
30
- thumbProps?: AnimatedThemedViewProps;
31
- };
package/src/types/text.ts DELETED
@@ -1,25 +0,0 @@
1
- import type { TextProps } from '@shopify/restyle';
2
- import type { TextProps as RNTextProps } from 'react-native';
3
- import type { CustomThemedIconProps } from './icon';
4
- import type { Theme } from './theme';
5
- import type { ThemedViewProps } from './view';
6
-
7
- export type ThemedTextProps = RNTextProps & TextProps<Theme>;
8
-
9
- export type CustomThemedTextProps = {
10
- text: ThemedTextProps['children'];
11
- textVariant?: ThemedTextProps['variant'];
12
- textFontSize?: ThemedTextProps['fontSize'];
13
- textFontWeight?: ThemedTextProps['fontWeight'];
14
- textColor?: ThemedTextProps['color'];
15
- textStyle?: ThemedTextProps['style'];
16
- textProps?: Omit<
17
- ThemedTextProps,
18
- 'children' | 'variant' | 'fontSize' | 'fontWeight' | 'color' | 'style'
19
- >;
20
- };
21
-
22
- export type IconTextProps = CustomThemedIconProps &
23
- CustomThemedTextProps & { flip?: boolean };
24
-
25
- export type ThemedIconTextProps = IconTextProps & ThemedViewProps;
@@ -1,39 +0,0 @@
1
- import type {
2
- BackgroundColorProps,
3
- BackgroundColorShorthandProps,
4
- BoxProps,
5
- ColorProps,
6
- LayoutProps,
7
- PositionProps,
8
- SpacingProps,
9
- SpacingShorthandProps,
10
- } from '@shopify/restyle';
11
-
12
- export type Theme = globalThis.ReactNativeTemplateTheme;
13
-
14
- export type ThemeColors = keyof Theme['colors'];
15
-
16
- export type ThemeSpacing = keyof Theme['spacing'];
17
-
18
- export type ThemeBreakpoints = keyof Theme['breakpoints'];
19
-
20
- export type ThemeZIndices = keyof Theme['zIndices'];
21
-
22
- export type ThemeBorderRadii = keyof Theme['borderRadii'];
23
-
24
- export type ThemeTextVariants = keyof Theme['textVariants'];
25
-
26
- export type ThemeViewProps = BoxProps<Theme>;
27
-
28
- export type ThemeColorProps = ColorProps<Theme>;
29
-
30
- export type ThemeSpacingProps = SpacingProps<Theme> &
31
- SpacingShorthandProps<Theme>;
32
-
33
- export type ThemeBackgroundColorProps = BackgroundColorProps<Theme> &
34
- BackgroundColorShorthandProps<Theme>;
35
-
36
- export type ThemeBaseProps = ThemeSpacingProps &
37
- ThemeBackgroundColorProps &
38
- LayoutProps<Theme> &
39
- PositionProps<Theme>;
package/src/types/view.ts DELETED
@@ -1,58 +0,0 @@
1
- import type { BoxProps } from '@shopify/restyle';
2
- import type {
3
- ComponentProps,
4
- DependencyList,
5
- ReactNode,
6
- RefObject,
7
- } from 'react';
8
- import type {
9
- NativeScrollEvent,
10
- NativeSyntheticEvent,
11
- ScrollViewProps as RNScrollViewProps,
12
- ScrollView,
13
- View,
14
- ViewProps,
15
- } from 'react-native';
16
- import type { AnimatedRef } from 'react-native-reanimated';
17
- import type AnimatedView from '../components/view/AnimatedView';
18
- import type { InsetsStyleConfig } from './style';
19
- import type { Theme } from './theme';
20
-
21
- export type ViewRefObj = RefObject<View | null>;
22
-
23
- export type ScrollViewRefObj = RefObject<ScrollView | null>;
24
-
25
- export type ScrollViewAnimatedRefObj = AnimatedRef<ScrollView>;
26
-
27
- export type OnScroll = (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
28
-
29
- export type OnContentSizeChange = (width: number, height: number) => void;
30
-
31
- export type ThemedViewProps = ViewProps &
32
- BoxProps<Theme> & {
33
- ref?: ViewRefObj;
34
- };
35
-
36
- export type AnimatedViewProps = ComponentProps<typeof AnimatedView>;
37
-
38
- export type AnimatedThemedViewProps = Omit<ThemedViewProps, 'ref'> &
39
- Omit<AnimatedViewProps, 'key' | 'style'> & {
40
- animatedStyle?: AnimatedViewProps['style'];
41
- };
42
-
43
- export type ThemedScreenWrapProps = ThemedViewProps &
44
- InsetsStyleConfig & {
45
- effectSetup?: () => void;
46
- effectCleanup?: () => void;
47
- effectDependencies?: DependencyList;
48
- };
49
-
50
- export type ScrollViewProps = RNScrollViewProps &
51
- InsetsStyleConfig & { ref?: ScrollViewRefObj };
52
-
53
- export type ThemedScrollViewProps = ScrollViewProps &
54
- Omit<ThemedViewProps, 'ref'>;
55
-
56
- export type PropsWithRequiredChildren<P = unknown> = P & {
57
- children: NonNullable<ReactNode>;
58
- };
@@ -1,10 +0,0 @@
1
- export enum ButtonScaleRatio {
2
- Square = 0.9,
3
- Rectangle = 0.98,
4
- None = 1,
5
- }
6
-
7
- export enum OnPressDelayType {
8
- Throttle,
9
- Debounce,
10
- }
@@ -1,77 +0,0 @@
1
- import { IconSize } from '@jamadd/react-native-template-icons';
2
- import { createContext } from 'react';
3
- import type {
4
- ActionSheetContextVal,
5
- AlertContextVal,
6
- } from '../../types/overlay';
7
- import type { ThemeSpacing, ThemeTextVariants } from '../../types/theme';
8
-
9
- /** @internal */
10
- export const overlayMaxWidthPercent = '80%';
11
-
12
- export enum OverlayDismissResultType {
13
- Toast = 'toast',
14
- Alert = 'alert',
15
- ActionSheet = 'actionSheet',
16
- }
17
-
18
- export const overlayDismissResultDefaultText = 'cancelByUser';
19
-
20
- export enum ToastType {
21
- Top = 'top',
22
- TopLeft = 'topLeft',
23
- TopRight = 'topRight',
24
- Bottom = 'bottom',
25
- BottomLeft = 'bottomLeft',
26
- BottomRight = 'bottomRight',
27
- }
28
-
29
- export enum ToastDuration {
30
- Short = 3000,
31
- Long = 5000,
32
- }
33
-
34
- /** @internal */
35
- export const AlertContext = createContext<AlertContextVal>({});
36
-
37
- export enum AlertButtonType {
38
- Primary = 'primary',
39
- Secondary = 'secondary',
40
- Destructive = 'destructive',
41
- }
42
-
43
- /** @internal */
44
- export const ActionSheetContext = createContext<Partial<ActionSheetContextVal>>(
45
- {}
46
- );
47
-
48
- /** @internal */
49
- export const actionSheetOpenDuration = 300;
50
-
51
- /** @internal */
52
- export const actionSheetSnapDuration = 300;
53
-
54
- /** @internal */
55
- export const actionSheetDismissDuration = 150;
56
-
57
- /** @internal */
58
- export const actionSheetMaxHeightRatio = 0.6;
59
-
60
- /** @internal */
61
- export enum ActionSheetExpandableHeightRatio {
62
- Top = 0.9,
63
- Middle = 0.6,
64
- Bottom = 0.3,
65
- }
66
-
67
- /** @internal */
68
- export const actionSheetHeaderIconSize: IconSize = IconSize.M;
69
-
70
- /** @internal */
71
- export const actionSheetHeaderPadding: ThemeSpacing = 'm';
72
-
73
- /** @internal */
74
- export const actionSheetOptionListItemPadding: ThemeSpacing = 'm';
75
-
76
- /** @internal */
77
- export const actionSheetOptionListItemTextVariant: ThemeTextVariants = 'textM';