react-native-system-ui 1.0.4 → 1.0.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.
- package/README.md +23 -23
- package/dist/cjs/components/action-sheet/ActionSheet.js +1 -1
- package/dist/cjs/components/action-sheet/types.js +1 -0
- package/dist/cjs/components/area/types.js +1 -0
- package/dist/cjs/components/avatar/types.js +1 -0
- package/dist/cjs/components/badge/types.js +1 -0
- package/dist/cjs/components/button/types.js +1 -0
- package/dist/cjs/components/calendar/types.js +1 -0
- package/dist/cjs/components/cascader/types.js +1 -0
- package/dist/cjs/components/cell/types.js +1 -0
- package/dist/cjs/components/checkbox/Checkbox.js +1 -1
- package/dist/cjs/components/checkbox/types.js +1 -0
- package/dist/cjs/components/circle/types.js +1 -0
- package/dist/cjs/components/collapse/Collapse.js +1 -1
- package/dist/cjs/components/collapse/types.js +1 -0
- package/dist/cjs/components/config-provider/locale/types.js +1 -0
- package/dist/cjs/components/config-provider/types.js +1 -0
- package/dist/cjs/components/count-down/types.js +1 -0
- package/dist/cjs/components/datetime-picker/types.js +1 -0
- package/dist/cjs/components/dialog/Dialog.js +1 -1
- package/dist/cjs/components/dialog/types.js +1 -0
- package/dist/cjs/components/divider/types.js +1 -0
- package/dist/cjs/components/empty/types.js +1 -0
- package/dist/cjs/components/error-boundary/types.js +1 -0
- package/dist/cjs/components/field/types.js +1 -0
- package/dist/cjs/components/flex/Flex.js +1 -1
- package/dist/cjs/components/flex/FlexItem.js +1 -1
- package/dist/cjs/components/flex/types.js +1 -0
- package/dist/cjs/components/form/Form.js +1 -1
- package/dist/cjs/components/form/FormItem.js +1 -1
- package/dist/cjs/components/form/FormList.js +1 -1
- package/dist/cjs/components/form/types.js +1 -0
- package/dist/cjs/components/grid/Grid.js +1 -1
- package/dist/cjs/components/grid/GridItem.js +1 -1
- package/dist/cjs/components/grid/types.js +1 -0
- package/dist/cjs/components/image/types.js +1 -0
- package/dist/cjs/components/image-preview/ImagePreview.js +1 -1
- package/dist/cjs/components/image-preview/types.js +1 -0
- package/dist/cjs/components/input/types.js +1 -0
- package/dist/cjs/components/loading/types.js +1 -0
- package/dist/cjs/components/nav-bar/NavBar.js +1 -1
- package/dist/cjs/components/nav-bar/types.js +1 -0
- package/dist/cjs/components/notice-bar/NoticeBar.js +1 -1
- package/dist/cjs/components/notice-bar/types.js +1 -0
- package/dist/cjs/components/notify/types.js +1 -0
- package/dist/cjs/components/number-keyboard/types.js +1 -0
- package/dist/cjs/components/overlay/types.js +1 -0
- package/dist/cjs/components/password-input/types.js +1 -0
- package/dist/cjs/components/picker/Picker.js +1 -1
- package/dist/cjs/components/picker/types.js +1 -0
- package/dist/cjs/components/popup/Popup.js +1 -1
- package/dist/cjs/components/popup/types.js +1 -0
- package/dist/cjs/components/portal/types.js +1 -0
- package/dist/cjs/components/progress/types.js +1 -0
- package/dist/cjs/components/radio/types.js +1 -0
- package/dist/cjs/components/safe-area-view/types.js +1 -0
- package/dist/cjs/components/search/types.js +1 -0
- package/dist/cjs/components/selector/Selector.js +1 -1
- package/dist/cjs/components/selector/types.js +1 -0
- package/dist/cjs/components/share-sheet/ShareSheet.js +1 -1
- package/dist/cjs/components/share-sheet/types.js +1 -0
- package/dist/cjs/components/sidebar/types.js +1 -0
- package/dist/cjs/components/skeleton/types.js +1 -0
- package/dist/cjs/components/slider/Slider.js +1 -1
- package/dist/cjs/components/slider/types.js +1 -0
- package/dist/cjs/components/space/types.js +1 -0
- package/dist/cjs/components/stepper/types.js +1 -0
- package/dist/cjs/components/swiper/types.js +1 -0
- package/dist/cjs/components/switch/types.js +1 -0
- package/dist/cjs/components/tabbar/types.js +1 -0
- package/dist/cjs/components/tabs/Tabs.js +1 -1
- package/dist/cjs/components/tabs/types.js +1 -0
- package/dist/cjs/components/tag/types.js +1 -0
- package/dist/cjs/components/theme.js +1 -0
- package/dist/cjs/components/toast/Toast.js +1 -1
- package/dist/cjs/components/toast/types.js +1 -0
- package/dist/cjs/components/typography/types.js +1 -0
- package/dist/cjs/components/water-mark/types.js +1 -0
- package/dist/es/components/action-sheet/ActionSheet.js +1 -1
- package/dist/es/components/action-sheet/types.js +1 -0
- package/dist/es/components/area/types.js +1 -0
- package/dist/es/components/avatar/types.js +1 -0
- package/dist/es/components/badge/types.js +1 -0
- package/dist/es/components/button/types.js +1 -0
- package/dist/es/components/calendar/types.js +1 -0
- package/dist/es/components/cascader/types.js +1 -0
- package/dist/es/components/cell/types.js +1 -0
- package/dist/es/components/checkbox/Checkbox.js +1 -1
- package/dist/es/components/checkbox/types.js +1 -0
- package/dist/es/components/circle/types.js +1 -0
- package/dist/es/components/collapse/Collapse.js +1 -1
- package/dist/es/components/collapse/types.js +1 -0
- package/dist/es/components/config-provider/locale/types.js +1 -0
- package/dist/es/components/config-provider/types.js +1 -0
- package/dist/es/components/count-down/types.js +1 -0
- package/dist/es/components/datetime-picker/types.js +1 -0
- package/dist/es/components/dialog/Dialog.js +1 -1
- package/dist/es/components/dialog/types.js +1 -0
- package/dist/es/components/divider/types.js +1 -0
- package/dist/es/components/empty/types.js +1 -0
- package/dist/es/components/error-boundary/types.js +1 -0
- package/dist/es/components/field/types.js +1 -0
- package/dist/es/components/flex/Flex.js +1 -1
- package/dist/es/components/flex/FlexItem.js +1 -1
- package/dist/es/components/flex/types.js +1 -0
- package/dist/es/components/form/Form.js +1 -1
- package/dist/es/components/form/FormItem.js +1 -1
- package/dist/es/components/form/FormList.js +1 -1
- package/dist/es/components/form/types.js +1 -0
- package/dist/es/components/grid/Grid.js +1 -1
- package/dist/es/components/grid/GridItem.js +1 -1
- package/dist/es/components/grid/types.js +1 -0
- package/dist/es/components/image/types.js +1 -0
- package/dist/es/components/image-preview/ImagePreview.js +1 -1
- package/dist/es/components/image-preview/types.js +1 -0
- package/dist/es/components/input/types.js +1 -0
- package/dist/es/components/loading/types.js +1 -0
- package/dist/es/components/nav-bar/NavBar.js +1 -1
- package/dist/es/components/nav-bar/types.js +1 -0
- package/dist/es/components/notice-bar/NoticeBar.js +1 -1
- package/dist/es/components/notice-bar/types.js +1 -0
- package/dist/es/components/notify/types.js +1 -0
- package/dist/es/components/number-keyboard/types.js +1 -0
- package/dist/es/components/overlay/types.js +1 -0
- package/dist/es/components/password-input/types.js +1 -0
- package/dist/es/components/picker/Picker.js +1 -1
- package/dist/es/components/picker/types.js +1 -0
- package/dist/es/components/popup/Popup.js +1 -1
- package/dist/es/components/popup/types.js +1 -0
- package/dist/es/components/portal/types.js +1 -0
- package/dist/es/components/progress/types.js +1 -0
- package/dist/es/components/radio/types.js +1 -0
- package/dist/es/components/safe-area-view/types.js +1 -0
- package/dist/es/components/search/types.js +1 -0
- package/dist/es/components/selector/Selector.js +1 -1
- package/dist/es/components/selector/types.js +1 -0
- package/dist/es/components/share-sheet/ShareSheet.js +1 -1
- package/dist/es/components/share-sheet/types.js +1 -0
- package/dist/es/components/sidebar/types.js +1 -0
- package/dist/es/components/skeleton/types.js +1 -0
- package/dist/es/components/slider/Slider.js +1 -1
- package/dist/es/components/slider/types.js +1 -0
- package/dist/es/components/space/types.js +1 -0
- package/dist/es/components/stepper/types.js +1 -0
- package/dist/es/components/swiper/types.js +1 -0
- package/dist/es/components/switch/types.js +1 -0
- package/dist/es/components/tabbar/types.js +1 -0
- package/dist/es/components/tabs/Tabs.js +1 -1
- package/dist/es/components/tabs/types.js +1 -0
- package/dist/es/components/tag/types.js +1 -0
- package/dist/es/components/theme.js +1 -0
- package/dist/es/components/toast/Toast.js +1 -1
- package/dist/es/components/toast/types.js +1 -0
- package/dist/es/components/typography/types.js +1 -0
- package/dist/es/components/water-mark/types.js +1 -0
- package/dist/types/components/action-sheet/types.d.ts +87 -0
- package/dist/types/components/area/types.d.ts +20 -0
- package/dist/types/components/avatar/types.d.ts +62 -0
- package/dist/types/components/badge/types.d.ts +57 -0
- package/dist/types/components/button/types.d.ts +109 -0
- package/dist/types/components/calendar/types.d.ts +111 -0
- package/dist/types/components/cascader/types.d.ts +142 -0
- package/dist/types/components/cell/types.d.ts +112 -0
- package/dist/types/components/checkbox/types.d.ts +99 -0
- package/dist/types/components/circle/types.d.ts +51 -0
- package/dist/types/components/collapse/types.d.ts +45 -0
- package/dist/types/components/config-provider/locale/types.d.ts +130 -0
- package/dist/types/components/config-provider/types.d.ts +10 -0
- package/dist/types/components/count-down/types.d.ts +29 -0
- package/dist/types/components/datetime-picker/types.d.ts +38 -0
- package/dist/types/components/dialog/types.d.ts +70 -0
- package/dist/types/components/divider/types.d.ts +48 -0
- package/dist/types/components/empty/types.d.ts +44 -0
- package/dist/types/components/error-boundary/types.d.ts +18 -0
- package/dist/types/components/field/types.d.ts +86 -0
- package/dist/types/components/flex/types.d.ts +37 -0
- package/dist/types/components/form/Form.d.ts +6 -0
- package/dist/types/components/form/types.d.ts +68 -0
- package/dist/types/components/grid/Grid.d.ts +1 -0
- package/dist/types/components/grid/types.d.ts +77 -0
- package/dist/types/components/image/types.d.ts +53 -0
- package/dist/types/components/image-preview/types.d.ts +55 -0
- package/dist/types/components/input/types.d.ts +42 -0
- package/dist/types/components/loading/types.d.ts +32 -0
- package/dist/types/components/nav-bar/types.d.ts +67 -0
- package/dist/types/components/notice-bar/types.d.ts +26 -0
- package/dist/types/components/notify/types.d.ts +64 -0
- package/dist/types/components/number-keyboard/types.d.ts +35 -0
- package/dist/types/components/overlay/types.d.ts +13 -0
- package/dist/types/components/password-input/types.d.ts +35 -0
- package/dist/types/components/picker/types.d.ts +73 -0
- package/dist/types/components/popup/types.d.ts +41 -0
- package/dist/types/components/portal/types.d.ts +1 -0
- package/dist/types/components/progress/types.d.ts +51 -0
- package/dist/types/components/radio/types.d.ts +95 -0
- package/dist/types/components/safe-area-view/types.d.ts +1 -0
- package/dist/types/components/search/types.d.ts +28 -0
- package/dist/types/components/selector/types.d.ts +74 -0
- package/dist/types/components/share-sheet/types.d.ts +26 -0
- package/dist/types/components/sidebar/types.d.ts +64 -0
- package/dist/types/components/skeleton/types.d.ts +45 -0
- package/dist/types/components/slider/types.d.ts +38 -0
- package/dist/types/components/space/types.d.ts +39 -0
- package/dist/types/components/stepper/types.d.ts +46 -0
- package/dist/types/components/swiper/types.d.ts +29 -0
- package/dist/types/components/switch/types.d.ts +33 -0
- package/dist/types/components/tabbar/types.d.ts +39 -0
- package/dist/types/components/tabs/types.d.ts +64 -0
- package/dist/types/components/tag/types.d.ts +69 -0
- package/dist/types/components/theme.d.ts +112 -0
- package/dist/types/components/toast/types.d.ts +1 -0
- package/dist/types/components/typography/types.d.ts +66 -0
- package/dist/types/components/water-mark/types.d.ts +58 -0
- package/package.json +3 -3
- package/dist/cjs/components/form/FormContext.js +0 -1
- package/dist/cjs/components/form/utils.js +0 -1
- package/dist/es/components/form/FormContext.js +0 -1
- package/dist/es/components/form/utils.js +0 -1
- package/dist/types/components/form/FormContext.d.ts +0 -2
- package/dist/types/components/form/utils.d.ts +0 -7
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
3
|
+
import type { DeepPartial } from '../../types';
|
|
4
|
+
export type CircleStartPosition = 'top' | 'right' | 'bottom' | 'left';
|
|
5
|
+
export type CircleLineCap = 'round' | 'butt' | 'square';
|
|
6
|
+
export interface CircleTokens {
|
|
7
|
+
defaults: {
|
|
8
|
+
rate: number;
|
|
9
|
+
size: number;
|
|
10
|
+
strokeWidth: number;
|
|
11
|
+
fill: string;
|
|
12
|
+
clockwise: boolean;
|
|
13
|
+
startPosition: CircleStartPosition;
|
|
14
|
+
lineCap: CircleLineCap;
|
|
15
|
+
animated: boolean;
|
|
16
|
+
animationDuration: number;
|
|
17
|
+
};
|
|
18
|
+
layout: {
|
|
19
|
+
root: ViewStyle;
|
|
20
|
+
content: ViewStyle;
|
|
21
|
+
text: TextStyle;
|
|
22
|
+
webRing: ViewStyle;
|
|
23
|
+
webInner: ViewStyle;
|
|
24
|
+
};
|
|
25
|
+
colors: {
|
|
26
|
+
color: string;
|
|
27
|
+
layerColor: string;
|
|
28
|
+
text: string;
|
|
29
|
+
};
|
|
30
|
+
typography: {
|
|
31
|
+
fontSize: number;
|
|
32
|
+
lineHeight: number;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export interface CircleProps {
|
|
36
|
+
rate?: number | string;
|
|
37
|
+
size?: number | string;
|
|
38
|
+
strokeWidth?: number | string;
|
|
39
|
+
color?: string;
|
|
40
|
+
layerColor?: string;
|
|
41
|
+
fill?: string;
|
|
42
|
+
clockwise?: boolean;
|
|
43
|
+
startPosition?: CircleStartPosition;
|
|
44
|
+
lineCap?: CircleLineCap;
|
|
45
|
+
animated?: boolean;
|
|
46
|
+
animationDuration?: number;
|
|
47
|
+
style?: StyleProp<ViewStyle>;
|
|
48
|
+
textStyle?: StyleProp<TextStyle>;
|
|
49
|
+
children?: React.ReactNode;
|
|
50
|
+
tokensOverride?: DeepPartial<CircleTokens>;
|
|
51
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { TextStyle, ViewStyle } from 'react-native';
|
|
2
|
+
export interface CollapseTokens {
|
|
3
|
+
defaults: {
|
|
4
|
+
accordion: boolean;
|
|
5
|
+
border: boolean;
|
|
6
|
+
iconPosition: 'left' | 'right';
|
|
7
|
+
panelBorder: boolean;
|
|
8
|
+
panelIsLink: boolean;
|
|
9
|
+
panelSize: 'normal' | 'large';
|
|
10
|
+
animationDuration: number;
|
|
11
|
+
};
|
|
12
|
+
layout: {
|
|
13
|
+
container: ViewStyle;
|
|
14
|
+
panel: ViewStyle;
|
|
15
|
+
hairline: ViewStyle;
|
|
16
|
+
headerWrapper: ViewStyle;
|
|
17
|
+
bodyWrapper: ViewStyle;
|
|
18
|
+
headerIconRow: ViewStyle;
|
|
19
|
+
bodyContent: ViewStyle;
|
|
20
|
+
};
|
|
21
|
+
colors: {
|
|
22
|
+
border: string;
|
|
23
|
+
title: string;
|
|
24
|
+
description: string;
|
|
25
|
+
background: string;
|
|
26
|
+
active: string;
|
|
27
|
+
arrow: string;
|
|
28
|
+
disabled: string;
|
|
29
|
+
};
|
|
30
|
+
typography: {
|
|
31
|
+
titleSize: number;
|
|
32
|
+
descriptionSize: number;
|
|
33
|
+
fontFamily: string;
|
|
34
|
+
titleWeight: NonNullable<TextStyle['fontWeight']>;
|
|
35
|
+
};
|
|
36
|
+
panel: {
|
|
37
|
+
borderRadius: number;
|
|
38
|
+
};
|
|
39
|
+
spacing: {
|
|
40
|
+
paddingVertical: number;
|
|
41
|
+
paddingHorizontal: number;
|
|
42
|
+
descriptionTop: number;
|
|
43
|
+
iconGap: number;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
export interface Locale {
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
/** Common */
|
|
4
|
+
name?: string;
|
|
5
|
+
tel?: string;
|
|
6
|
+
save?: string;
|
|
7
|
+
confirm?: string;
|
|
8
|
+
cancel?: string;
|
|
9
|
+
delete?: string;
|
|
10
|
+
loading?: string;
|
|
11
|
+
noCoupon?: string;
|
|
12
|
+
nameEmpty?: string;
|
|
13
|
+
telInvalid?: string;
|
|
14
|
+
/** Form */
|
|
15
|
+
vanForm?: {
|
|
16
|
+
validationFailed?: string;
|
|
17
|
+
};
|
|
18
|
+
/** Popup */
|
|
19
|
+
vanPopup?: {
|
|
20
|
+
closeOverlay?: string;
|
|
21
|
+
closeHint?: string;
|
|
22
|
+
};
|
|
23
|
+
/** Toast */
|
|
24
|
+
vanToast?: {
|
|
25
|
+
closeHint?: string;
|
|
26
|
+
};
|
|
27
|
+
/** ShareSheet */
|
|
28
|
+
vanShareSheet?: {
|
|
29
|
+
cancel?: string;
|
|
30
|
+
};
|
|
31
|
+
/** NumberKeyboard */
|
|
32
|
+
vanNumberKeyboard?: {
|
|
33
|
+
close?: string;
|
|
34
|
+
};
|
|
35
|
+
/** NoticeBar */
|
|
36
|
+
vanNoticeBar?: {
|
|
37
|
+
close?: string;
|
|
38
|
+
};
|
|
39
|
+
/** NavBar */
|
|
40
|
+
vanNavBar?: {
|
|
41
|
+
back?: string;
|
|
42
|
+
action?: string;
|
|
43
|
+
};
|
|
44
|
+
/** Image */
|
|
45
|
+
vanImage?: {
|
|
46
|
+
loading?: string;
|
|
47
|
+
error?: string;
|
|
48
|
+
};
|
|
49
|
+
/** Cascader */
|
|
50
|
+
vanCascader?: {
|
|
51
|
+
placeholder?: string;
|
|
52
|
+
loading?: string;
|
|
53
|
+
close?: string;
|
|
54
|
+
};
|
|
55
|
+
/** Calendar */
|
|
56
|
+
vanCalendar?: {
|
|
57
|
+
end?: string;
|
|
58
|
+
start?: string;
|
|
59
|
+
title?: string;
|
|
60
|
+
confirm?: string;
|
|
61
|
+
startEnd?: string;
|
|
62
|
+
weekdays?: string[];
|
|
63
|
+
monthTitle?: (year: number, month: number) => string;
|
|
64
|
+
rangePrompt?: (maxRange: number) => string;
|
|
65
|
+
};
|
|
66
|
+
/** Picker */
|
|
67
|
+
vanPicker?: {
|
|
68
|
+
select?: string;
|
|
69
|
+
};
|
|
70
|
+
/** ContactCard */
|
|
71
|
+
vanContactCard?: {
|
|
72
|
+
addText?: string;
|
|
73
|
+
};
|
|
74
|
+
/** ContactList */
|
|
75
|
+
vanContactList?: {
|
|
76
|
+
addText?: string;
|
|
77
|
+
};
|
|
78
|
+
/** Pagination */
|
|
79
|
+
vanPagination?: {
|
|
80
|
+
prev?: string;
|
|
81
|
+
next?: string;
|
|
82
|
+
};
|
|
83
|
+
/** PullRefresh */
|
|
84
|
+
vanPullRefresh?: {
|
|
85
|
+
pulling?: string;
|
|
86
|
+
loosing?: string;
|
|
87
|
+
loading?: string;
|
|
88
|
+
};
|
|
89
|
+
/** SubmitBar */
|
|
90
|
+
vanSubmitBar?: {
|
|
91
|
+
label?: string;
|
|
92
|
+
};
|
|
93
|
+
/** Coupon */
|
|
94
|
+
vanCoupon?: {
|
|
95
|
+
unlimited?: string;
|
|
96
|
+
discount?: (discount: number) => string;
|
|
97
|
+
condition?: (condition: number) => string;
|
|
98
|
+
};
|
|
99
|
+
/** CouponCell */
|
|
100
|
+
vanCouponCell?: {
|
|
101
|
+
title?: string;
|
|
102
|
+
count?: (count: number) => string;
|
|
103
|
+
};
|
|
104
|
+
/** CouponList */
|
|
105
|
+
vanCouponList?: {
|
|
106
|
+
exchange?: string;
|
|
107
|
+
close?: string;
|
|
108
|
+
enable?: string;
|
|
109
|
+
disabled?: string;
|
|
110
|
+
placeholder?: string;
|
|
111
|
+
};
|
|
112
|
+
/** AddressEdit */
|
|
113
|
+
vanAddressEdit?: {
|
|
114
|
+
area?: string;
|
|
115
|
+
postal?: string;
|
|
116
|
+
areaEmpty?: string;
|
|
117
|
+
addressEmpty?: string;
|
|
118
|
+
postalEmpty?: string;
|
|
119
|
+
defaultAddress?: string;
|
|
120
|
+
};
|
|
121
|
+
/** AddressEditDetail */
|
|
122
|
+
vanAddressEditDetail?: {
|
|
123
|
+
label?: string;
|
|
124
|
+
placeholder?: string;
|
|
125
|
+
};
|
|
126
|
+
/** AddressList */
|
|
127
|
+
vanAddressList?: {
|
|
128
|
+
add?: string;
|
|
129
|
+
};
|
|
130
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { ThemeProviderValue } from '../../design-system/ThemeProvider';
|
|
3
|
+
import type { Locale } from './locale/types';
|
|
4
|
+
export type Direction = 'ltr' | 'rtl';
|
|
5
|
+
export interface ConfigProviderProps {
|
|
6
|
+
theme?: ThemeProviderValue;
|
|
7
|
+
locale?: Locale;
|
|
8
|
+
direction?: Direction;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { TextStyle, ViewProps } from 'react-native';
|
|
2
|
+
import type { CountDownCurrentTime } from '../../hooks';
|
|
3
|
+
import type { DeepPartial } from '../../types';
|
|
4
|
+
export type CountDownInstance = {
|
|
5
|
+
start: () => void;
|
|
6
|
+
pause: () => void;
|
|
7
|
+
reset: () => void;
|
|
8
|
+
};
|
|
9
|
+
export interface CountDownTokens {
|
|
10
|
+
defaults: {
|
|
11
|
+
autoStart: boolean;
|
|
12
|
+
millisecond: boolean;
|
|
13
|
+
time: number;
|
|
14
|
+
format: string;
|
|
15
|
+
};
|
|
16
|
+
layout: {
|
|
17
|
+
text: TextStyle;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface CountDownProps extends Omit<ViewProps, 'children'> {
|
|
21
|
+
autoStart?: boolean;
|
|
22
|
+
millisecond?: boolean;
|
|
23
|
+
time?: number | string;
|
|
24
|
+
format?: string;
|
|
25
|
+
children?: (current: CountDownCurrentTime) => React.ReactNode;
|
|
26
|
+
onChange?: (current: CountDownCurrentTime) => void;
|
|
27
|
+
onFinish?: () => void;
|
|
28
|
+
tokensOverride?: DeepPartial<CountDownTokens>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { PickerProps } from '../picker/types';
|
|
3
|
+
import type { PopupProps } from '../popup/Popup';
|
|
4
|
+
export type DatetimePickerColumnType = 'year' | 'month' | 'day' | 'hour' | 'minute';
|
|
5
|
+
export type DatetimePickerType = 'date' | 'time' | 'datetime' | 'datehour' | 'month-day' | 'year-month';
|
|
6
|
+
export interface DatetimePickerSharedProps extends Omit<PickerProps, 'columns' | 'value' | 'defaultValue' | 'onChange' | 'onConfirm'> {
|
|
7
|
+
type?: DatetimePickerType;
|
|
8
|
+
formatter?: (type: DatetimePickerColumnType, value: string) => string;
|
|
9
|
+
filter?: (type: DatetimePickerColumnType, values: string[]) => string[];
|
|
10
|
+
columnsOrder?: DatetimePickerColumnType[];
|
|
11
|
+
popup?: boolean;
|
|
12
|
+
popupVisible?: boolean;
|
|
13
|
+
defaultPopupVisible?: boolean;
|
|
14
|
+
popupProps?: Omit<PopupProps, 'visible' | 'children'>;
|
|
15
|
+
onPopupVisibleChange?: (visible: boolean) => void;
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export interface DatetimePickerDateProps extends DatetimePickerSharedProps {
|
|
19
|
+
type?: Exclude<DatetimePickerType, 'time'>;
|
|
20
|
+
value?: Date;
|
|
21
|
+
defaultValue?: Date;
|
|
22
|
+
minDate?: Date;
|
|
23
|
+
maxDate?: Date;
|
|
24
|
+
onChange?: (value: Date) => void;
|
|
25
|
+
onConfirm?: (value: Date) => void;
|
|
26
|
+
}
|
|
27
|
+
export interface DatetimePickerTimeProps extends DatetimePickerSharedProps {
|
|
28
|
+
type: 'time';
|
|
29
|
+
value?: string;
|
|
30
|
+
defaultValue?: string;
|
|
31
|
+
minHour?: number;
|
|
32
|
+
maxHour?: number;
|
|
33
|
+
minMinute?: number;
|
|
34
|
+
maxMinute?: number;
|
|
35
|
+
onChange?: (value: string) => void;
|
|
36
|
+
onConfirm?: (value: string) => void;
|
|
37
|
+
}
|
|
38
|
+
export type DatetimePickerProps = DatetimePickerDateProps | DatetimePickerTimeProps;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { StyleProp, TextStyle, ViewProps, ViewStyle } from 'react-native';
|
|
3
|
+
import type { DeepPartial } from '../../types';
|
|
4
|
+
import type { DialogTokens } from './tokens';
|
|
5
|
+
export type DialogTheme = 'default' | 'round-button';
|
|
6
|
+
export type DialogMessageAlign = 'left' | 'center' | 'right';
|
|
7
|
+
export type DialogBeforeCloseAction = 'confirm' | 'cancel' | 'close';
|
|
8
|
+
export interface DialogActionState {
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface DialogProps extends Omit<ViewProps, 'children'> {
|
|
13
|
+
visible: boolean;
|
|
14
|
+
title?: React.ReactNode;
|
|
15
|
+
message?: React.ReactNode;
|
|
16
|
+
messageAlign?: DialogMessageAlign;
|
|
17
|
+
theme?: DialogTheme;
|
|
18
|
+
width?: number | string;
|
|
19
|
+
closeable?: boolean;
|
|
20
|
+
closeIcon?: React.ReactNode;
|
|
21
|
+
overlay?: boolean;
|
|
22
|
+
overlayStyle?: StyleProp<ViewStyle>;
|
|
23
|
+
overlayTestID?: string;
|
|
24
|
+
closeOnBackPress?: boolean;
|
|
25
|
+
closeOnPopstate?: boolean;
|
|
26
|
+
closeOnOverlayPress?: boolean;
|
|
27
|
+
closeOnClickOverlay?: boolean;
|
|
28
|
+
onClickOverlay?: () => void;
|
|
29
|
+
onClickCloseIcon?: () => void;
|
|
30
|
+
beforeClose?: (action: DialogBeforeCloseAction) => boolean | Promise<boolean>;
|
|
31
|
+
showCancelButton?: boolean;
|
|
32
|
+
cancelButtonText?: React.ReactNode;
|
|
33
|
+
cancelButtonColor?: string;
|
|
34
|
+
cancelProps?: DialogActionState;
|
|
35
|
+
showConfirmButton?: boolean;
|
|
36
|
+
confirmButtonText?: React.ReactNode;
|
|
37
|
+
confirmButtonColor?: string;
|
|
38
|
+
confirmProps?: DialogActionState;
|
|
39
|
+
footer?: React.ReactNode;
|
|
40
|
+
contentStyle?: StyleProp<ViewStyle>;
|
|
41
|
+
titleStyle?: StyleProp<TextStyle>;
|
|
42
|
+
messageStyle?: StyleProp<TextStyle>;
|
|
43
|
+
tokensOverride?: DeepPartial<DialogTokens>;
|
|
44
|
+
style?: StyleProp<ViewStyle>;
|
|
45
|
+
children?: React.ReactNode;
|
|
46
|
+
onCancel?: () => void | boolean | Promise<void | boolean>;
|
|
47
|
+
onConfirm?: () => void | boolean | Promise<void | boolean>;
|
|
48
|
+
onClose?: () => void | boolean | Promise<void | boolean>;
|
|
49
|
+
onClosed?: () => void;
|
|
50
|
+
}
|
|
51
|
+
export type DialogShowOptions = Omit<DialogProps, 'visible'>;
|
|
52
|
+
export type DialogAlertOptions = Omit<DialogShowOptions, 'showCancelButton' | 'onCancel'>;
|
|
53
|
+
export type DialogConfirmOptions = DialogShowOptions;
|
|
54
|
+
export type DialogImperativeMode = 'show' | 'alert' | 'confirm';
|
|
55
|
+
export type DialogSetDefaultOptions = {
|
|
56
|
+
(options: DialogShowOptions): void;
|
|
57
|
+
(mode: DialogImperativeMode, options: DialogShowOptions): void;
|
|
58
|
+
};
|
|
59
|
+
export type DialogResetDefaultOptions = {
|
|
60
|
+
(mode?: DialogImperativeMode): void;
|
|
61
|
+
};
|
|
62
|
+
export interface DialogStatic {
|
|
63
|
+
Host: React.ComponentType<any>;
|
|
64
|
+
show: (options?: DialogShowOptions) => () => void;
|
|
65
|
+
alert: (options?: DialogAlertOptions) => Promise<void>;
|
|
66
|
+
confirm: (options?: DialogConfirmOptions) => Promise<boolean>;
|
|
67
|
+
clear: () => void;
|
|
68
|
+
setDefaultOptions: DialogSetDefaultOptions;
|
|
69
|
+
resetDefaultOptions: DialogResetDefaultOptions;
|
|
70
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { StyleProp, TextStyle, ViewProps, ViewStyle } from 'react-native';
|
|
2
|
+
import type { DeepPartial } from '../../types';
|
|
3
|
+
export type DividerContentPosition = 'left' | 'center' | 'right';
|
|
4
|
+
export interface DividerTokens {
|
|
5
|
+
defaults: {
|
|
6
|
+
dashed: boolean;
|
|
7
|
+
hairline: boolean;
|
|
8
|
+
contentPosition: DividerContentPosition;
|
|
9
|
+
};
|
|
10
|
+
layout: {
|
|
11
|
+
container: ViewStyle;
|
|
12
|
+
contentWrapper: ViewStyle;
|
|
13
|
+
text: TextStyle;
|
|
14
|
+
hairlineWrapper: ViewStyle;
|
|
15
|
+
};
|
|
16
|
+
colors: {
|
|
17
|
+
line: string;
|
|
18
|
+
text: string;
|
|
19
|
+
};
|
|
20
|
+
typography: {
|
|
21
|
+
fontSize: number;
|
|
22
|
+
lineHeight: number;
|
|
23
|
+
fontFamily: string;
|
|
24
|
+
fontWeight: TextStyle['fontWeight'];
|
|
25
|
+
};
|
|
26
|
+
sizing: {
|
|
27
|
+
sideMinFlex: number;
|
|
28
|
+
};
|
|
29
|
+
borders: {
|
|
30
|
+
thickness: number;
|
|
31
|
+
};
|
|
32
|
+
spacing: {
|
|
33
|
+
vertical: number;
|
|
34
|
+
contentPadding: number;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export interface DividerProps extends ViewProps {
|
|
38
|
+
children?: React.ReactNode;
|
|
39
|
+
type?: 'horizontal' | 'vertical';
|
|
40
|
+
orientation?: 'horizontal' | 'vertical';
|
|
41
|
+
dashed?: boolean;
|
|
42
|
+
hairline?: boolean;
|
|
43
|
+
contentPosition?: DividerContentPosition;
|
|
44
|
+
textStyle?: StyleProp<TextStyle>;
|
|
45
|
+
contentStyle?: StyleProp<ViewStyle>;
|
|
46
|
+
lineColor?: string;
|
|
47
|
+
tokensOverride?: DeepPartial<DividerTokens>;
|
|
48
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { StyleProp, TextStyle, ViewProps, ViewStyle } from 'react-native';
|
|
2
|
+
import type { DeepPartial } from '../../types';
|
|
3
|
+
export type EmptyImage = 'default' | 'error' | 'network' | 'search';
|
|
4
|
+
export interface EmptyTokens {
|
|
5
|
+
defaults: {
|
|
6
|
+
image: EmptyImage;
|
|
7
|
+
gap: number;
|
|
8
|
+
};
|
|
9
|
+
layout: {
|
|
10
|
+
container: ViewStyle;
|
|
11
|
+
imageWrapper: ViewStyle;
|
|
12
|
+
descriptionText: TextStyle;
|
|
13
|
+
footer: ViewStyle;
|
|
14
|
+
};
|
|
15
|
+
colors: {
|
|
16
|
+
description: string;
|
|
17
|
+
icon: string;
|
|
18
|
+
imageBackground: string;
|
|
19
|
+
};
|
|
20
|
+
typography: {
|
|
21
|
+
descriptionSize: number;
|
|
22
|
+
descriptionLineHeight: number;
|
|
23
|
+
descriptionFontFamily: string;
|
|
24
|
+
descriptionFontWeight: TextStyle['fontWeight'];
|
|
25
|
+
};
|
|
26
|
+
sizing: {
|
|
27
|
+
image: number;
|
|
28
|
+
iconScale: number;
|
|
29
|
+
};
|
|
30
|
+
spacing: {
|
|
31
|
+
descriptionPaddingHorizontal: number;
|
|
32
|
+
footerMarginTop: number;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export interface EmptyProps extends ViewProps {
|
|
36
|
+
image?: EmptyImage | string | React.ReactNode;
|
|
37
|
+
imageSize?: number;
|
|
38
|
+
imageStyle?: StyleProp<ViewStyle>;
|
|
39
|
+
description?: React.ReactNode;
|
|
40
|
+
descriptionStyle?: StyleProp<TextStyle>;
|
|
41
|
+
children?: React.ReactNode;
|
|
42
|
+
gap?: number;
|
|
43
|
+
tokensOverride?: DeepPartial<EmptyTokens>;
|
|
44
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export interface ErrorBoundaryProps {
|
|
3
|
+
/** Fallback UI when an error is caught. Can be a ReactNode or a render function */
|
|
4
|
+
fallback?: React.ReactNode | ((error: Error, reset: () => void) => React.ReactNode);
|
|
5
|
+
/** Callback when an error is caught */
|
|
6
|
+
onError?: (error: Error, errorInfo: React.ErrorInfo) => void;
|
|
7
|
+
/** Callback when the error state is reset */
|
|
8
|
+
onReset?: () => void;
|
|
9
|
+
/** Children to render */
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export interface ErrorBoundaryState {
|
|
13
|
+
error: Error | null;
|
|
14
|
+
}
|
|
15
|
+
export interface ErrorBoundaryRef {
|
|
16
|
+
/** Reset the error boundary to re-render children */
|
|
17
|
+
reset: () => void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { PressableProps, StyleProp, TextInput, TextInputProps, TextStyle, ViewStyle } from 'react-native';
|
|
3
|
+
import type { DeepPartial } from '../../types';
|
|
4
|
+
import type { FieldTokens } from './tokens';
|
|
5
|
+
import type { DialogShowOptions } from '../dialog/types';
|
|
6
|
+
import type { CellArrowDirection, CellGroupProps, CellSize } from '../cell/types';
|
|
7
|
+
export type FieldType = 'tel' | 'text' | 'digit' | 'number' | 'search' | 'password' | 'textarea';
|
|
8
|
+
export type FieldInputAlign = 'left' | 'center' | 'right';
|
|
9
|
+
export type FieldControlAlign = 'left' | 'center' | 'right';
|
|
10
|
+
export type FieldClearTrigger = 'always' | 'focus';
|
|
11
|
+
export type FieldFormatTrigger = 'onBlur' | 'onChange';
|
|
12
|
+
export type FieldAutosizeConfig = {
|
|
13
|
+
maxRows?: number;
|
|
14
|
+
minRows?: number;
|
|
15
|
+
};
|
|
16
|
+
export type FieldTooltipProps = DialogShowOptions & {
|
|
17
|
+
icon?: React.ReactNode;
|
|
18
|
+
};
|
|
19
|
+
export type FieldShowWordLimit = boolean | ((params: {
|
|
20
|
+
currentCount: number;
|
|
21
|
+
maxLength?: number;
|
|
22
|
+
}) => React.ReactNode);
|
|
23
|
+
export interface FieldProps extends Omit<TextInputProps, 'style' | 'value' | 'defaultValue' | 'editable' | 'onChange' | 'onChangeText'> {
|
|
24
|
+
label?: React.ReactNode;
|
|
25
|
+
labelWidth?: number;
|
|
26
|
+
labelAlign?: FieldInputAlign;
|
|
27
|
+
inputAlign?: FieldInputAlign;
|
|
28
|
+
controlAlign?: FieldControlAlign;
|
|
29
|
+
required?: boolean;
|
|
30
|
+
colon?: boolean;
|
|
31
|
+
intro?: React.ReactNode;
|
|
32
|
+
description?: React.ReactNode;
|
|
33
|
+
tooltip?: React.ReactNode | FieldTooltipProps;
|
|
34
|
+
error?: boolean;
|
|
35
|
+
errorMessage?: React.ReactNode;
|
|
36
|
+
errorMessageAlign?: FieldInputAlign;
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
readOnly?: boolean;
|
|
39
|
+
clearable?: boolean;
|
|
40
|
+
clearTrigger?: FieldClearTrigger;
|
|
41
|
+
clearIcon?: React.ReactNode;
|
|
42
|
+
leftIcon?: React.ReactNode;
|
|
43
|
+
rightIcon?: React.ReactNode;
|
|
44
|
+
prefix?: React.ReactNode;
|
|
45
|
+
suffix?: React.ReactNode;
|
|
46
|
+
button?: React.ReactNode;
|
|
47
|
+
extra?: React.ReactNode;
|
|
48
|
+
value?: string;
|
|
49
|
+
defaultValue?: string;
|
|
50
|
+
type?: FieldType;
|
|
51
|
+
rows?: number;
|
|
52
|
+
autoSize?: boolean | FieldAutosizeConfig;
|
|
53
|
+
formatter?: (value: string) => string;
|
|
54
|
+
formatTrigger?: FieldFormatTrigger;
|
|
55
|
+
showWordLimit?: FieldShowWordLimit;
|
|
56
|
+
onOverlimit?: (value: string) => void;
|
|
57
|
+
onChangeText?: (value: string) => void;
|
|
58
|
+
onClear?: () => void;
|
|
59
|
+
onClick?: () => void;
|
|
60
|
+
onClickInput?: () => void;
|
|
61
|
+
onClickLeftIcon?: () => void;
|
|
62
|
+
onClickRightIcon?: () => void;
|
|
63
|
+
border?: boolean;
|
|
64
|
+
center?: boolean;
|
|
65
|
+
clickable?: boolean;
|
|
66
|
+
isLink?: boolean;
|
|
67
|
+
arrowDirection?: CellArrowDirection;
|
|
68
|
+
size?: CellSize;
|
|
69
|
+
titleStyle?: StyleProp<TextStyle>;
|
|
70
|
+
contentStyle?: StyleProp<ViewStyle>;
|
|
71
|
+
inputStyle?: StyleProp<TextStyle>;
|
|
72
|
+
labelStyle?: StyleProp<TextStyle>;
|
|
73
|
+
introStyle?: StyleProp<TextStyle>;
|
|
74
|
+
errorMessageStyle?: StyleProp<TextStyle>;
|
|
75
|
+
tokensOverride?: DeepPartial<FieldTokens>;
|
|
76
|
+
style?: StyleProp<ViewStyle>;
|
|
77
|
+
androidRipple?: PressableProps['android_ripple'];
|
|
78
|
+
children?: React.ReactNode;
|
|
79
|
+
}
|
|
80
|
+
export interface FieldInstance {
|
|
81
|
+
focus: () => void;
|
|
82
|
+
blur: () => void;
|
|
83
|
+
clear: () => void;
|
|
84
|
+
nativeElement: TextInput | null;
|
|
85
|
+
}
|
|
86
|
+
export type FieldGroupProps = CellGroupProps;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import type { DeepPartial } from '../../types';
|
|
4
|
+
export type FlexDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
|
|
5
|
+
export type FlexWrap = 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
6
|
+
export type FlexAlign = 'start' | 'center' | 'end' | 'baseline' | 'stretch';
|
|
7
|
+
export type FlexJustify = 'start' | 'end' | 'center' | 'around' | 'between';
|
|
8
|
+
export interface FlexTokens {
|
|
9
|
+
defaults: {
|
|
10
|
+
direction: FlexDirection;
|
|
11
|
+
wrap: FlexWrap;
|
|
12
|
+
gutter: number | [number, number];
|
|
13
|
+
align: FlexAlign;
|
|
14
|
+
justify: FlexJustify;
|
|
15
|
+
columns: number;
|
|
16
|
+
};
|
|
17
|
+
layout: {
|
|
18
|
+
container: ViewStyle;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export interface FlexProps {
|
|
22
|
+
children?: React.ReactNode;
|
|
23
|
+
direction?: FlexDirection;
|
|
24
|
+
wrap?: FlexWrap;
|
|
25
|
+
gutter?: number | [number, number];
|
|
26
|
+
align?: FlexAlign;
|
|
27
|
+
justify?: FlexJustify;
|
|
28
|
+
style?: StyleProp<ViewStyle>;
|
|
29
|
+
columns?: number;
|
|
30
|
+
tokensOverride?: DeepPartial<FlexTokens>;
|
|
31
|
+
}
|
|
32
|
+
export interface FlexItemProps {
|
|
33
|
+
span?: number;
|
|
34
|
+
flex?: number | string;
|
|
35
|
+
style?: StyleProp<ViewStyle>;
|
|
36
|
+
children?: React.ReactNode;
|
|
37
|
+
}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { FormInstance, FormProps, FormSubscribeProps, NamePath, RegisteredFieldOptions } from './types';
|
|
3
|
+
export declare const normalizeTrigger: (trigger?: string | string[]) => string[];
|
|
4
|
+
export declare const FORM_ALL_FIELDS_KEY = "__form_all__";
|
|
5
|
+
export declare const toNamePath: (name?: NamePath) => (string | number)[];
|
|
6
|
+
export declare const serializeNamePath: (name?: NamePath) => string;
|
|
7
|
+
export declare const getValueByName: (source: unknown, name: NamePath) => unknown;
|
|
8
|
+
export declare const setValueByName: (source: Record<string, unknown>, name: NamePath, value: unknown) => Record<string, unknown>;
|
|
3
9
|
export interface FormContextValue {
|
|
4
10
|
getFieldValue: (name: NamePath) => unknown;
|
|
5
11
|
setFieldValue: (name: NamePath, value: unknown, trigger?: string) => void;
|