react-native-system-ui 1.0.0 → 1.0.2
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 +3 -3
- package/dist/cjs/components/action-sheet/ActionSheet.js +51 -53
- package/dist/cjs/components/area/Area.js +22 -22
- package/dist/cjs/components/avatar/Avatar.js +23 -23
- package/dist/cjs/components/badge/Badge.js +56 -61
- package/dist/cjs/components/button/Button.js +87 -92
- package/dist/cjs/components/button/ButtonGroup.js +4 -4
- package/dist/cjs/components/calendar/Calendar.js +28 -28
- package/dist/cjs/components/cascader/Cascader.js +206 -212
- package/dist/cjs/components/cell/Cell.js +54 -51
- package/dist/cjs/components/cell/CellGroup.js +26 -25
- package/dist/cjs/components/checkbox/Checkbox.js +1 -0
- package/dist/cjs/components/checkbox/CheckboxGroup.js +20 -19
- package/dist/cjs/components/circle/Circle.js +66 -54
- package/dist/cjs/components/collapse/Collapse.js +18 -18
- package/dist/cjs/components/config-provider/ConfigProvider.js +5 -5
- package/dist/cjs/components/count-down/CountDown.js +17 -17
- package/dist/cjs/components/datetime-picker/DatetimePicker.js +34 -35
- package/dist/cjs/components/dialog/Dialog.js +16 -10
- package/dist/cjs/components/dialog/imperative.js +8 -14
- package/dist/cjs/components/dialog/tokens.js +1 -0
- package/dist/cjs/components/divider/Divider.js +48 -51
- package/dist/cjs/components/empty/Empty.js +30 -25
- package/dist/cjs/components/error-boundary/ErrorBoundary.js +3 -2
- package/dist/cjs/components/flex/Flex.js +27 -27
- package/dist/cjs/components/flex/FlexItem.js +1 -0
- package/dist/cjs/components/form/Form.js +94 -93
- package/dist/cjs/components/form/FormItem.js +60 -54
- package/dist/cjs/components/form/FormList.js +35 -35
- package/dist/cjs/components/grid/Grid.js +48 -48
- package/dist/cjs/components/grid/GridItem.js +9 -2
- package/dist/cjs/components/image/Image.js +25 -24
- package/dist/cjs/components/image/tokens.js +3 -1
- package/dist/cjs/components/image-preview/ImagePreview.js +38 -28
- package/dist/cjs/components/image-preview/tokens.js +3 -1
- package/dist/cjs/components/input/Input.js +16 -19
- package/dist/cjs/components/loading/Loading.js +27 -27
- package/dist/cjs/components/nav-bar/NavBar.js +21 -18
- package/dist/cjs/components/nav-bar/tokens.js +3 -1
- package/dist/cjs/components/notice-bar/NoticeBar.js +7 -3
- package/dist/cjs/components/notice-bar/tokens.js +3 -1
- package/dist/cjs/components/notify/Notify.js +2 -1
- package/dist/cjs/components/notify/imperative.js +17 -17
- package/dist/cjs/components/notify/tokens.js +1 -0
- package/dist/cjs/components/number-keyboard/NumberKeyboard.js +217 -201
- package/dist/cjs/components/number-keyboard/tokens.js +7 -1
- package/dist/cjs/components/overlay/Overlay.js +15 -15
- package/dist/cjs/components/password-input/PasswordInput.js +49 -49
- package/dist/cjs/components/picker/Picker.js +50 -58
- package/dist/cjs/components/popup/Popup.js +10 -10
- package/dist/cjs/components/popup/tokens.js +1 -0
- package/dist/cjs/components/portal/Portal.js +3 -4
- package/dist/cjs/components/progress/Progress.js +94 -95
- package/dist/cjs/components/progress/tokens.js +1 -0
- package/dist/cjs/components/radio/Radio.js +67 -63
- package/dist/cjs/components/radio/RadioGroup.js +6 -6
- package/dist/cjs/components/safe-area-view/SafeAreaView.js +7 -7
- package/dist/cjs/components/search/Search.js +28 -28
- package/dist/cjs/components/selector/Selector.js +19 -26
- package/dist/cjs/components/share-sheet/ShareSheet.js +8 -2
- package/dist/cjs/components/share-sheet/tokens.js +3 -1
- package/dist/cjs/components/sidebar/Sidebar.js +22 -16
- package/dist/cjs/components/sidebar/SidebarItem.js +9 -8
- package/dist/cjs/components/sidebar/tokens.js +3 -1
- package/dist/cjs/components/skeleton/Skeleton.js +43 -42
- package/dist/cjs/components/slider/Slider.js +1 -1
- package/dist/cjs/components/space/Space.js +45 -41
- package/dist/cjs/components/space/tokens.js +7 -1
- package/dist/cjs/components/stepper/Stepper.js +17 -15
- package/dist/cjs/components/stepper/tokens.js +1 -0
- package/dist/cjs/components/swiper/Swiper.js +10 -7
- package/dist/cjs/components/swiper/SwiperPagIndicator.js +3 -2
- package/dist/cjs/components/switch/Switch.js +23 -23
- package/dist/cjs/components/tabbar/Tabbar.js +26 -26
- package/dist/cjs/components/tabbar/TabbarItem.js +6 -0
- package/dist/cjs/components/tabs/Tabs.js +143 -153
- package/dist/cjs/components/tabs/tokens.js +3 -1
- package/dist/cjs/components/tag/Tag.js +38 -38
- package/dist/cjs/components/toast/Toast.js +7 -3
- package/dist/cjs/components/toast/tokens.js +1 -0
- package/dist/cjs/components/typography/Typography.js +23 -21
- package/dist/cjs/components/water-mark/WaterMark.js +65 -65
- package/dist/cjs/design-system/Text.js +38 -0
- package/dist/cjs/design-system/createComponentTokensHook.js +2 -2
- package/dist/cjs/design-system/index.js +7 -0
- package/dist/cjs/design-system/mergeTokensOverride.js +1 -4
- package/dist/cjs/hooks/useControllableValue.js +11 -11
- package/dist/cjs/hooks/useCountDown.js +18 -18
- package/dist/cjs/platform/measure.js +4 -2
- package/dist/cjs/utils/color.js +2 -7
- package/dist/cjs/utils/compare.js +3 -3
- package/dist/cjs/utils/date.js +2 -2
- package/dist/cjs/utils/deepMerge.js +5 -5
- package/dist/cjs/utils/hairline.js +1 -0
- package/dist/cjs/utils/render.js +2 -8
- package/dist/cjs/utils/validate.js +2 -4
- package/dist/es/components/action-sheet/ActionSheet.js +51 -53
- package/dist/es/components/area/Area.js +22 -22
- package/dist/es/components/avatar/Avatar.js +23 -23
- package/dist/es/components/badge/Badge.js +56 -61
- package/dist/es/components/button/Button.js +87 -92
- package/dist/es/components/button/ButtonGroup.js +4 -4
- package/dist/es/components/calendar/Calendar.js +28 -28
- package/dist/es/components/cascader/Cascader.js +206 -212
- package/dist/es/components/cell/Cell.js +55 -52
- package/dist/es/components/cell/CellGroup.js +26 -25
- package/dist/es/components/checkbox/Checkbox.js +1 -0
- package/dist/es/components/checkbox/CheckboxGroup.js +20 -19
- package/dist/es/components/circle/Circle.js +66 -54
- package/dist/es/components/collapse/Collapse.js +18 -18
- package/dist/es/components/config-provider/ConfigProvider.js +5 -5
- package/dist/es/components/count-down/CountDown.js +17 -17
- package/dist/es/components/datetime-picker/DatetimePicker.js +34 -35
- package/dist/es/components/dialog/Dialog.js +16 -10
- package/dist/es/components/dialog/imperative.js +8 -14
- package/dist/es/components/dialog/tokens.js +1 -0
- package/dist/es/components/divider/Divider.js +48 -51
- package/dist/es/components/empty/Empty.js +30 -25
- package/dist/es/components/error-boundary/ErrorBoundary.js +3 -2
- package/dist/es/components/flex/Flex.js +27 -27
- package/dist/es/components/flex/FlexItem.js +1 -0
- package/dist/es/components/form/Form.js +95 -94
- package/dist/es/components/form/FormItem.js +60 -54
- package/dist/es/components/form/FormList.js +35 -35
- package/dist/es/components/grid/Grid.js +48 -48
- package/dist/es/components/grid/GridItem.js +10 -3
- package/dist/es/components/image/Image.js +25 -24
- package/dist/es/components/image/tokens.js +3 -1
- package/dist/es/components/image-preview/ImagePreview.js +39 -29
- package/dist/es/components/image-preview/tokens.js +3 -1
- package/dist/es/components/input/Input.js +16 -19
- package/dist/es/components/loading/Loading.js +27 -27
- package/dist/es/components/nav-bar/NavBar.js +21 -18
- package/dist/es/components/nav-bar/tokens.js +3 -1
- package/dist/es/components/notice-bar/NoticeBar.js +7 -3
- package/dist/es/components/notice-bar/tokens.js +3 -1
- package/dist/es/components/notify/Notify.js +2 -1
- package/dist/es/components/notify/imperative.js +17 -17
- package/dist/es/components/notify/tokens.js +1 -0
- package/dist/es/components/number-keyboard/NumberKeyboard.js +217 -201
- package/dist/es/components/number-keyboard/tokens.js +7 -1
- package/dist/es/components/overlay/Overlay.js +15 -15
- package/dist/es/components/password-input/PasswordInput.js +49 -49
- package/dist/es/components/picker/Picker.js +50 -58
- package/dist/es/components/popup/Popup.js +10 -10
- package/dist/es/components/popup/tokens.js +1 -0
- package/dist/es/components/portal/Portal.js +3 -4
- package/dist/es/components/progress/Progress.js +94 -95
- package/dist/es/components/progress/tokens.js +1 -0
- package/dist/es/components/radio/Radio.js +67 -63
- package/dist/es/components/radio/RadioGroup.js +6 -6
- package/dist/es/components/safe-area-view/SafeAreaView.js +7 -7
- package/dist/es/components/search/Search.js +28 -28
- package/dist/es/components/selector/Selector.js +19 -26
- package/dist/es/components/share-sheet/ShareSheet.js +8 -2
- package/dist/es/components/share-sheet/tokens.js +3 -1
- package/dist/es/components/sidebar/Sidebar.js +22 -16
- package/dist/es/components/sidebar/SidebarItem.js +9 -8
- package/dist/es/components/sidebar/tokens.js +3 -1
- package/dist/es/components/skeleton/Skeleton.js +43 -42
- package/dist/es/components/slider/Slider.js +3 -3
- package/dist/es/components/space/Space.js +45 -41
- package/dist/es/components/space/tokens.js +7 -1
- package/dist/es/components/stepper/Stepper.js +17 -15
- package/dist/es/components/stepper/tokens.js +1 -0
- package/dist/es/components/swiper/Swiper.js +11 -8
- package/dist/es/components/swiper/SwiperPagIndicator.js +3 -2
- package/dist/es/components/switch/Switch.js +23 -23
- package/dist/es/components/tabbar/Tabbar.js +26 -26
- package/dist/es/components/tabbar/TabbarItem.js +6 -0
- package/dist/es/components/tabs/Tabs.js +144 -154
- package/dist/es/components/tabs/tokens.js +3 -1
- package/dist/es/components/tag/Tag.js +38 -38
- package/dist/es/components/toast/Toast.js +7 -3
- package/dist/es/components/toast/tokens.js +1 -0
- package/dist/es/components/typography/Typography.js +23 -21
- package/dist/es/components/water-mark/WaterMark.js +65 -65
- package/dist/es/design-system/Text.js +19 -0
- package/dist/es/design-system/createComponentTokensHook.js +2 -2
- package/dist/es/design-system/index.js +1 -0
- package/dist/es/design-system/mergeTokensOverride.js +1 -4
- package/dist/es/hooks/useControllableValue.js +11 -11
- package/dist/es/hooks/useCountDown.js +18 -18
- package/dist/es/platform/measure.js +4 -2
- package/dist/es/utils/color.js +1 -4
- package/dist/es/utils/compare.js +3 -3
- package/dist/es/utils/date.js +2 -2
- package/dist/es/utils/deepMerge.js +5 -5
- package/dist/es/utils/hairline.js +1 -0
- package/dist/es/utils/render.js +1 -1
- package/dist/es/utils/validate.js +1 -2
- package/dist/types/components/dialog/tokens.d.ts +1 -0
- package/dist/types/components/image-preview/tokens.d.ts +1 -0
- package/dist/types/components/nav-bar/tokens.d.ts +1 -1
- package/dist/types/components/notice-bar/tokens.d.ts +1 -0
- package/dist/types/components/number-keyboard/tokens.d.ts +5 -0
- package/dist/types/components/picker/Picker.d.ts +1 -1
- package/dist/types/components/popup/tokens.d.ts +1 -0
- package/dist/types/components/share-sheet/tokens.d.ts +1 -0
- package/dist/types/components/stepper/tokens.d.ts +1 -0
- package/dist/types/components/tabs/tokens.d.ts +1 -0
- package/dist/types/components/toast/tokens.d.ts +1 -0
- package/dist/types/design-system/Text.d.ts +3 -0
- package/dist/types/design-system/index.d.ts +1 -0
- package/dist/types/hooks/useCountDown.d.ts +1 -1
- package/dist/types/utils/color.d.ts +0 -2
- package/dist/types/utils/date.d.ts +1 -1
- package/dist/types/utils/render.d.ts +1 -1
- package/dist/types/utils/validate.d.ts +0 -1
- package/package.json +17 -3
|
@@ -30,15 +30,15 @@ const ConfigProviderBase = ({
|
|
|
30
30
|
children
|
|
31
31
|
}) => {
|
|
32
32
|
const ctxLocale = (0, _react().useContext)(_LocaleContext.LocaleContext);
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
const
|
|
33
|
+
const ctxDir = (0, _react().useContext)(_DirectionContext.DirectionContext);
|
|
34
|
+
const rLocale = locale ?? ctxLocale;
|
|
35
|
+
const rDir = direction ?? ctxDir ?? (_reactNative().I18nManager.isRTL ? 'rtl' : 'ltr');
|
|
36
36
|
return /*#__PURE__*/_react().default.createElement(_ThemeProvider.ThemeProvider, {
|
|
37
37
|
value: theme
|
|
38
38
|
}, /*#__PURE__*/_react().default.createElement(_DirectionContext.DirectionContext.Provider, {
|
|
39
|
-
value:
|
|
39
|
+
value: rDir
|
|
40
40
|
}, /*#__PURE__*/_react().default.createElement(_LocaleContext.LocaleContext.Provider, {
|
|
41
|
-
value:
|
|
41
|
+
value: rLocale
|
|
42
42
|
}, /*#__PURE__*/_react().default.createElement(_portal.PortalHost, null, children))));
|
|
43
43
|
};
|
|
44
44
|
const ConfigProvider = exports.ConfigProvider = /*#__PURE__*/_react().default.memo(ConfigProviderBase);
|
|
@@ -27,10 +27,10 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
27
27
|
const CountDownImpl = (props, ref) => {
|
|
28
28
|
const {
|
|
29
29
|
tokensOverride,
|
|
30
|
-
autoStart:
|
|
31
|
-
millisecond:
|
|
32
|
-
time:
|
|
33
|
-
format:
|
|
30
|
+
autoStart: autoStartP,
|
|
31
|
+
millisecond: msP,
|
|
32
|
+
time: timeP,
|
|
33
|
+
format: fmtP,
|
|
34
34
|
children,
|
|
35
35
|
onChange,
|
|
36
36
|
onFinish,
|
|
@@ -38,32 +38,32 @@ const CountDownImpl = (props, ref) => {
|
|
|
38
38
|
...rest
|
|
39
39
|
} = props;
|
|
40
40
|
const tokens = (0, _tokens.useCountDownTokens)(tokensOverride);
|
|
41
|
-
const autoStart =
|
|
42
|
-
const millisecond =
|
|
43
|
-
const time =
|
|
44
|
-
const format =
|
|
45
|
-
const
|
|
41
|
+
const autoStart = autoStartP ?? tokens.defaults.autoStart;
|
|
42
|
+
const millisecond = msP ?? tokens.defaults.millisecond;
|
|
43
|
+
const time = timeP ?? tokens.defaults.time;
|
|
44
|
+
const format = fmtP ?? tokens.defaults.format;
|
|
45
|
+
const normTime = Math.max(0, Number(time) || 0);
|
|
46
46
|
const {
|
|
47
47
|
start,
|
|
48
48
|
pause,
|
|
49
49
|
reset,
|
|
50
50
|
current
|
|
51
51
|
} = (0, _hooks.useCountDown)({
|
|
52
|
-
time:
|
|
52
|
+
time: normTime,
|
|
53
53
|
millisecond,
|
|
54
54
|
onChange,
|
|
55
55
|
onFinish
|
|
56
56
|
});
|
|
57
57
|
const resetTimer = (0, _react().useCallback)(() => {
|
|
58
|
-
reset(
|
|
59
|
-
if (autoStart &&
|
|
60
|
-
}, [autoStart,
|
|
58
|
+
reset(normTime);
|
|
59
|
+
if (autoStart && normTime > 0) start();
|
|
60
|
+
}, [autoStart, normTime, reset, start]);
|
|
61
61
|
(0, _react().useEffect)(() => {
|
|
62
62
|
resetTimer();
|
|
63
63
|
return () => {
|
|
64
64
|
pause();
|
|
65
65
|
};
|
|
66
|
-
}, [autoStart,
|
|
66
|
+
}, [autoStart, normTime, pause, reset, start]);
|
|
67
67
|
(0, _react().useImperativeHandle)(ref, () => ({
|
|
68
68
|
start,
|
|
69
69
|
pause,
|
|
@@ -71,13 +71,13 @@ const CountDownImpl = (props, ref) => {
|
|
|
71
71
|
}));
|
|
72
72
|
const content = (0, _utils.isFunction)(children) ? children(current) : (0, _utils.formatDuration)(format, current);
|
|
73
73
|
const contentNode = (0, _utils.renderTextOrNode)(content, tokens.layout.text);
|
|
74
|
-
const
|
|
74
|
+
const accLabel = (0, _validate.isText)(content) ? String(content) : `${current.hours}h ${current.minutes}m ${current.seconds}s`;
|
|
75
75
|
return /*#__PURE__*/_react().default.createElement(_reactNative().View, _extends({
|
|
76
76
|
accessibilityRole: "timer",
|
|
77
77
|
accessibilityLiveRegion: "polite",
|
|
78
|
-
accessibilityLabel:
|
|
78
|
+
accessibilityLabel: accLabel,
|
|
79
79
|
accessibilityValue: {
|
|
80
|
-
text:
|
|
80
|
+
text: accLabel
|
|
81
81
|
},
|
|
82
82
|
style: style
|
|
83
83
|
}, rest), contentNode);
|
|
@@ -32,16 +32,13 @@ const DatetimePickerImpl = props => {
|
|
|
32
32
|
trigger: 'onPopupVisibleChange'
|
|
33
33
|
});
|
|
34
34
|
const handleClose = (0, _react().useCallback)(() => setPopupVisible(false), [setPopupVisible]);
|
|
35
|
-
const renderPopup = (0, _react().useCallback)((node, popup, popupProps) => {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
safeAreaInsetBottom: tokens.defaults.popupSafeAreaInsetBottom
|
|
43
|
-
}, popupProps), node);
|
|
44
|
-
}, [handleClose, popupVisible, tokens.defaults.popupPlacement, tokens.defaults.popupRound, tokens.defaults.popupSafeAreaInsetBottom]);
|
|
35
|
+
const renderPopup = (0, _react().useCallback)((node, popup, popupProps) => !popup ? node : /*#__PURE__*/_react().default.createElement(_Popup.Popup, _extends({
|
|
36
|
+
visible: popupVisible,
|
|
37
|
+
onClose: handleClose,
|
|
38
|
+
placement: tokens.defaults.popupPlacement,
|
|
39
|
+
round: tokens.defaults.popupRound,
|
|
40
|
+
safeAreaInsetBottom: tokens.defaults.popupSafeAreaInsetBottom
|
|
41
|
+
}, popupProps), node), [handleClose, popupVisible, tokens.defaults.popupPlacement, tokens.defaults.popupRound, tokens.defaults.popupSafeAreaInsetBottom]);
|
|
45
42
|
const {
|
|
46
43
|
popup,
|
|
47
44
|
popupVisible: _popupVisible,
|
|
@@ -52,8 +49,8 @@ const DatetimePickerImpl = props => {
|
|
|
52
49
|
onCancel,
|
|
53
50
|
...pickerProps
|
|
54
51
|
} = props;
|
|
55
|
-
const onConfirmRef = (0, _react().useRef)(onConfirm)
|
|
56
|
-
|
|
52
|
+
const onConfirmRef = (0, _react().useRef)(onConfirm);
|
|
53
|
+
const onCancelRef = (0, _react().useRef)(onCancel);
|
|
57
54
|
onConfirmRef.current = onConfirm;
|
|
58
55
|
onCancelRef.current = onCancel;
|
|
59
56
|
const handleConfirm = (0, _react().useCallback)(value => {
|
|
@@ -89,8 +86,8 @@ const DatePicker = props => {
|
|
|
89
86
|
...pickerProps
|
|
90
87
|
} = props;
|
|
91
88
|
const formatValue = (0, _react().useCallback)(dateValue => {
|
|
92
|
-
const
|
|
93
|
-
const date = new Date((0, _utils.clamp)(
|
|
89
|
+
const fb = (0, _utils.isValidDate)(dateValue) ? dateValue : new Date();
|
|
90
|
+
const date = new Date((0, _utils.clamp)(fb.getTime(), minDate.getTime(), maxDate.getTime()));
|
|
94
91
|
if (type === 'year-month') {
|
|
95
92
|
date.setDate(1);
|
|
96
93
|
date.setHours(0, 0, 0, 0);
|
|
@@ -99,6 +96,7 @@ const DatePicker = props => {
|
|
|
99
96
|
} else if (type === 'datehour') {
|
|
100
97
|
date.setMinutes(0, 0, 0);
|
|
101
98
|
}
|
|
99
|
+
;
|
|
102
100
|
return date;
|
|
103
101
|
}, [maxDate, minDate, type]);
|
|
104
102
|
const [currentDate, setCurrentDate] = (0, _react().useState)(() => formatValue(value ?? defaultValue));
|
|
@@ -227,8 +225,8 @@ const DatePicker = props => {
|
|
|
227
225
|
if (type === 'datetime') minute = getValue('minute') || 0;
|
|
228
226
|
return formatValue(new Date(year, month - 1, day, hour, minute));
|
|
229
227
|
}, [currentDate, formatValue, originColumns, type]);
|
|
230
|
-
const onChangeRef = (0, _react().useRef)(onChange)
|
|
231
|
-
|
|
228
|
+
const onChangeRef = (0, _react().useRef)(onChange);
|
|
229
|
+
const onConfirmRef = (0, _react().useRef)(onConfirm);
|
|
232
230
|
onChangeRef.current = onChange;
|
|
233
231
|
onConfirmRef.current = onConfirm;
|
|
234
232
|
const handleChange = (0, _react().useCallback)(values => {
|
|
@@ -236,9 +234,9 @@ const DatePicker = props => {
|
|
|
236
234
|
setCurrentDate(next);
|
|
237
235
|
onChangeRef.current?.(next);
|
|
238
236
|
}, [buildDateFromValues]);
|
|
239
|
-
const
|
|
240
|
-
|
|
241
|
-
const handleConfirm = (0, _react().useCallback)(() => onConfirmRef.current?.(
|
|
237
|
+
const curDateRef = (0, _react().useRef)(currentDate);
|
|
238
|
+
curDateRef.current = currentDate;
|
|
239
|
+
const handleConfirm = (0, _react().useCallback)(() => onConfirmRef.current?.(curDateRef.current), []);
|
|
242
240
|
return /*#__PURE__*/_react().default.createElement(_picker.default, _extends({}, pickerProps, {
|
|
243
241
|
columns: columns,
|
|
244
242
|
interactionMode: interactionMode,
|
|
@@ -270,9 +268,9 @@ const TimePicker = props => {
|
|
|
270
268
|
return `${(0, _utils.padZero)((0, _utils.clamp)(Number.isNaN(hour) ? minHour : hour, minHour, maxHour))}:${(0, _utils.padZero)((0, _utils.clamp)(Number.isNaN(minute) ? minMinute : minute, minMinute, maxMinute))}`;
|
|
271
269
|
}, [maxHour, maxMinute, minHour, minMinute]);
|
|
272
270
|
const [currentTime, setCurrentTime] = (0, _react().useState)(() => {
|
|
273
|
-
const
|
|
274
|
-
timeRef.current =
|
|
275
|
-
return
|
|
271
|
+
const init = formatTime(value ?? defaultValue);
|
|
272
|
+
timeRef.current = init;
|
|
273
|
+
return init;
|
|
276
274
|
});
|
|
277
275
|
(0, _react().useEffect)(() => {
|
|
278
276
|
const next = (0, _utils.isString)(value) ? formatTime(value) : formatTime(timeRef.current);
|
|
@@ -282,23 +280,24 @@ const TimePicker = props => {
|
|
|
282
280
|
}
|
|
283
281
|
}, [formatTime, value]);
|
|
284
282
|
const [hourValues, minuteValues] = (0, _react().useMemo)(() => {
|
|
285
|
-
let
|
|
286
|
-
let
|
|
283
|
+
let h = (0, _utils.times)(maxHour - minHour + 1, i => (0, _utils.padZero)(minHour + i));
|
|
284
|
+
let m = (0, _utils.times)(maxMinute - minMinute + 1, i => (0, _utils.padZero)(minMinute + i));
|
|
287
285
|
if (filter) {
|
|
288
|
-
|
|
289
|
-
|
|
286
|
+
h = filter('hour', h);
|
|
287
|
+
m = filter('minute', m);
|
|
290
288
|
}
|
|
291
|
-
|
|
289
|
+
;
|
|
290
|
+
return [h, m];
|
|
292
291
|
}, [filter, maxHour, maxMinute, minHour, minMinute]);
|
|
293
|
-
const columns = (0, _react().useMemo)(() => [hourValues.map(
|
|
294
|
-
label: formatter('hour',
|
|
295
|
-
value
|
|
296
|
-
})), minuteValues.map(
|
|
297
|
-
label: formatter('minute',
|
|
298
|
-
value
|
|
292
|
+
const columns = (0, _react().useMemo)(() => [hourValues.map(v => ({
|
|
293
|
+
label: formatter('hour', v),
|
|
294
|
+
value: v
|
|
295
|
+
})), minuteValues.map(v => ({
|
|
296
|
+
label: formatter('minute', v),
|
|
297
|
+
value: v
|
|
299
298
|
}))], [formatter, hourValues, minuteValues]);
|
|
300
|
-
const onChangeRef = (0, _react().useRef)(onChange)
|
|
301
|
-
|
|
299
|
+
const onChangeRef = (0, _react().useRef)(onChange);
|
|
300
|
+
const onConfirmRef = (0, _react().useRef)(onConfirm);
|
|
302
301
|
onChangeRef.current = onChange;
|
|
303
302
|
onConfirmRef.current = onConfirm;
|
|
304
303
|
const handleChange = (0, _react().useCallback)(values => {
|
|
@@ -76,6 +76,7 @@ const ActionButton = props => {
|
|
|
76
76
|
color: txtColor
|
|
77
77
|
}) : (0, _utils.renderTextOrNode)(text ?? '', {
|
|
78
78
|
color: txtColor,
|
|
79
|
+
fontFamily: tokens.typography.fontFamily,
|
|
79
80
|
fontSize: tokens.typography.actionSize,
|
|
80
81
|
fontWeight: tokens.typography.actionWeight
|
|
81
82
|
}));
|
|
@@ -157,6 +158,7 @@ const DialogImpl = props => {
|
|
|
157
158
|
handler?.();
|
|
158
159
|
return;
|
|
159
160
|
}
|
|
161
|
+
;
|
|
160
162
|
let result;
|
|
161
163
|
try {
|
|
162
164
|
result = bc(action);
|
|
@@ -164,6 +166,7 @@ const DialogImpl = props => {
|
|
|
164
166
|
handler?.();
|
|
165
167
|
return;
|
|
166
168
|
}
|
|
169
|
+
;
|
|
167
170
|
if (result === false) return;
|
|
168
171
|
if ((0, _promise.isPromiseLike)(result)) {
|
|
169
172
|
void result.then(resolved => {
|
|
@@ -176,6 +179,7 @@ const DialogImpl = props => {
|
|
|
176
179
|
});
|
|
177
180
|
return;
|
|
178
181
|
}
|
|
182
|
+
;
|
|
179
183
|
handler?.();
|
|
180
184
|
}, []);
|
|
181
185
|
const handleCloseIcon = (0, _react().useCallback)(() => {
|
|
@@ -191,9 +195,9 @@ const DialogImpl = props => {
|
|
|
191
195
|
run('confirm', () => onConfirmRef.current?.());
|
|
192
196
|
}, [run]);
|
|
193
197
|
const scaleAnim = (0, _react().useRef)(new (_reactNative().Animated.Value)(0.7)).current;
|
|
194
|
-
const
|
|
198
|
+
const scaleRef = (0, _react().useRef)(null);
|
|
195
199
|
(0, _react().useEffect)(() => {
|
|
196
|
-
|
|
200
|
+
scaleRef.current?.stop();
|
|
197
201
|
scaleAnim.setValue(visible ? 0.7 : 1);
|
|
198
202
|
const anim = _reactNative().Animated.timing(scaleAnim, {
|
|
199
203
|
toValue: visible ? 1 : 0.9,
|
|
@@ -202,11 +206,11 @@ const DialogImpl = props => {
|
|
|
202
206
|
useNativeDriver: _platform.nativeDriverEnabled,
|
|
203
207
|
isInteraction: false
|
|
204
208
|
});
|
|
205
|
-
|
|
209
|
+
scaleRef.current = anim;
|
|
206
210
|
anim.start();
|
|
207
211
|
}, [scaleAnim, visible, reducedMotion]);
|
|
208
212
|
(0, _react().useEffect)(() => () => {
|
|
209
|
-
|
|
213
|
+
scaleRef.current?.stop();
|
|
210
214
|
}, []);
|
|
211
215
|
const widthStyle = (0, _react().useMemo)(() => width ? (0, _validate.isNumber)(width) ? {
|
|
212
216
|
width
|
|
@@ -224,16 +228,18 @@ const DialogImpl = props => {
|
|
|
224
228
|
}] : null, [hContent, hTitle, tokens.spacing.paddingHorizontal, tokens.spacing.titleGap, tokens.spacing.titleIsolatedPadding, tokens.spacing.titlePaddingTop]);
|
|
225
229
|
const titleTxtStyle = (0, _react().useMemo)(() => hTitle ? [S.title, {
|
|
226
230
|
color: tokens.colors.title,
|
|
231
|
+
fontFamily: tokens.typography.fontFamily,
|
|
227
232
|
fontSize: tokens.typography.titleSize,
|
|
228
233
|
lineHeight: tokens.typography.titleLineHeight,
|
|
229
234
|
fontWeight: tokens.typography.titleWeight
|
|
230
|
-
}, titleStyle] : null, [hTitle, titleStyle, tokens.colors.title, tokens.typography.titleLineHeight, tokens.typography.titleSize, tokens.typography.titleWeight]);
|
|
235
|
+
}, titleStyle] : null, [hTitle, titleStyle, tokens.colors.title, tokens.typography.fontFamily, tokens.typography.titleLineHeight, tokens.typography.titleSize, tokens.typography.titleWeight]);
|
|
231
236
|
const msgTxtStyle = (0, _react().useMemo)(() => [S.msg, {
|
|
232
237
|
color: isRound ? tokens.colors.title : tokens.colors.message,
|
|
238
|
+
fontFamily: tokens.typography.fontFamily,
|
|
233
239
|
fontSize: tokens.typography.messageSize,
|
|
234
240
|
lineHeight: tokens.typography.messageLineHeight,
|
|
235
241
|
textAlign: messageAlign
|
|
236
|
-
}, messageStyle], [isRound, messageAlign, messageStyle, tokens.colors.message, tokens.colors.title, tokens.typography.messageLineHeight, tokens.typography.messageSize]);
|
|
242
|
+
}, messageStyle], [isRound, messageAlign, messageStyle, tokens.colors.message, tokens.colors.title, tokens.typography.fontFamily, tokens.typography.messageLineHeight, tokens.typography.messageSize]);
|
|
237
243
|
const msgContentStyle = (0, _react().useMemo)(() => !hChildren ? {
|
|
238
244
|
alignItems: messageAlign === 'center' ? 'center' : messageAlign === 'left' ? 'flex-start' : 'flex-end'
|
|
239
245
|
} : null, [hChildren, messageAlign]);
|
|
@@ -249,7 +255,7 @@ const DialogImpl = props => {
|
|
|
249
255
|
right: 0,
|
|
250
256
|
top: 0
|
|
251
257
|
})], [tokens.colors.divider]);
|
|
252
|
-
const
|
|
258
|
+
const mergeOverlay = closeOnOverlayPress || closeOnClickOverlay;
|
|
253
259
|
const animStyle = (0, _react().useMemo)(() => ({
|
|
254
260
|
transform: [{
|
|
255
261
|
scale: scaleAnim
|
|
@@ -260,7 +266,7 @@ const DialogImpl = props => {
|
|
|
260
266
|
paddingHorizontal: tokens.spacing.messagePaddingHorizontal,
|
|
261
267
|
paddingBottom: tokens.spacing.roundFooterPadding
|
|
262
268
|
}], [tokens.spacing.messagePaddingHorizontal, tokens.spacing.messagePaddingTop, tokens.spacing.roundFooterPadding]);
|
|
263
|
-
const
|
|
269
|
+
const popupBc = (0, _react().useCallback)(() => {
|
|
264
270
|
const bc = beforeCloseRef.current;
|
|
265
271
|
if (!bc) return true;
|
|
266
272
|
try {
|
|
@@ -341,9 +347,9 @@ const DialogImpl = props => {
|
|
|
341
347
|
overlayTestID: overlayTestID,
|
|
342
348
|
closeOnBackPress: closeOnBackPress,
|
|
343
349
|
closeOnPopstate: closeOnPopstate,
|
|
344
|
-
closeOnClickOverlay:
|
|
350
|
+
closeOnClickOverlay: mergeOverlay,
|
|
345
351
|
onClickOverlay: onClickOverlay,
|
|
346
|
-
beforeClose:
|
|
352
|
+
beforeClose: popupBc,
|
|
347
353
|
onClose: onClose,
|
|
348
354
|
onClosed: onClosed,
|
|
349
355
|
contentAnimationStyle: animStyle,
|
|
@@ -76,34 +76,28 @@ const DialogPortalInstance = ({
|
|
|
76
76
|
if (!portalKeyRef.current) return;
|
|
77
77
|
attachCloser(portalKeyRef.current, close);
|
|
78
78
|
return () => {
|
|
79
|
-
const
|
|
80
|
-
if (
|
|
79
|
+
const e = dialogRegistry.get(portalKeyRef.current ?? -1);
|
|
80
|
+
if (e && e.close === close) e.close = undefined;
|
|
81
81
|
};
|
|
82
82
|
}, [close, portalKeyRef]);
|
|
83
83
|
(0, _react().useEffect)(() => () => {
|
|
84
84
|
if (portalKeyRef.current) unregisterEntry(portalKeyRef.current);
|
|
85
85
|
}, [portalKeyRef]);
|
|
86
86
|
const handleCancel = (0, _react().useCallback)(async () => {
|
|
87
|
-
|
|
88
|
-
if (!
|
|
89
|
-
const shouldClose = await runHook(options.onCancel);
|
|
90
|
-
if (!shouldClose) return;
|
|
87
|
+
if (!(await runHook(() => options.beforeClose?.('cancel')))) return;
|
|
88
|
+
if (!(await runHook(options.onCancel))) return;
|
|
91
89
|
if (meta.mode === 'confirm') meta.resolve?.(false);
|
|
92
90
|
close();
|
|
93
91
|
}, [close, meta, options.beforeClose, options.onCancel]);
|
|
94
92
|
const handleConfirm = (0, _react().useCallback)(async () => {
|
|
95
|
-
|
|
96
|
-
if (!
|
|
97
|
-
const shouldClose = await runHook(options.onConfirm);
|
|
98
|
-
if (!shouldClose) return;
|
|
93
|
+
if (!(await runHook(() => options.beforeClose?.('confirm')))) return;
|
|
94
|
+
if (!(await runHook(options.onConfirm))) return;
|
|
99
95
|
if (meta.mode === 'alert' || meta.mode === 'confirm') meta.resolve?.(true);
|
|
100
96
|
close();
|
|
101
97
|
}, [close, meta, options.beforeClose, options.onConfirm]);
|
|
102
98
|
const handleClose = (0, _react().useCallback)(async () => {
|
|
103
|
-
|
|
104
|
-
if (!
|
|
105
|
-
const shouldClose = await runHook(options.onClose);
|
|
106
|
-
if (!shouldClose) return;
|
|
99
|
+
if (!(await runHook(() => options.beforeClose?.('close')))) return;
|
|
100
|
+
if (!(await runHook(options.onClose))) return;
|
|
107
101
|
if (meta.mode === 'confirm') meta.resolve?.(false);
|
|
108
102
|
close();
|
|
109
103
|
}, [close, meta, options.beforeClose, options.onClose]);
|
|
@@ -49,6 +49,7 @@ const createDialogTokens = foundations => {
|
|
|
49
49
|
roundButtonHeight: 40
|
|
50
50
|
},
|
|
51
51
|
typography: {
|
|
52
|
+
fontFamily: typography.fontFamily,
|
|
52
53
|
titleSize: fontSize.md,
|
|
53
54
|
titleLineHeight: fontSize.md * typography.lineHeightMultiplier,
|
|
54
55
|
titleWeight: typography.weight.semiBold,
|
|
@@ -26,11 +26,11 @@ const DividerImpl = props => {
|
|
|
26
26
|
const {
|
|
27
27
|
tokensOverride,
|
|
28
28
|
children,
|
|
29
|
-
type:
|
|
30
|
-
orientation:
|
|
31
|
-
dashed:
|
|
32
|
-
hairline:
|
|
33
|
-
contentPosition:
|
|
29
|
+
type: typeP,
|
|
30
|
+
orientation: oriP,
|
|
31
|
+
dashed: dashP,
|
|
32
|
+
hairline: hlP,
|
|
33
|
+
contentPosition: posP,
|
|
34
34
|
textStyle,
|
|
35
35
|
contentStyle,
|
|
36
36
|
lineColor,
|
|
@@ -38,51 +38,48 @@ const DividerImpl = props => {
|
|
|
38
38
|
...rest
|
|
39
39
|
} = props;
|
|
40
40
|
const tokens = (0, _tokens.useDividerTokens)(tokensOverride);
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
const
|
|
41
|
+
const dash = dashP ?? tokens.defaults.dashed;
|
|
42
|
+
const hl = hlP ?? tokens.defaults.hairline;
|
|
43
|
+
const pos = posP ?? tokens.defaults.contentPosition;
|
|
44
|
+
const ori = typeP ?? oriP ?? 'horizontal';
|
|
45
|
+
const clr = lineColor ?? tokens.colors.line;
|
|
46
|
+
const bStyle = dash ? 'dashed' : 'solid';
|
|
47
|
+
const hasCnt = ori === 'horizontal' && (0, _utils.isRenderable)(children);
|
|
48
|
+
const cnt = hasCnt ? (0, _utils.renderTextOrNode)(children, [tokens.layout.text, {
|
|
49
49
|
color: tokens.colors.text,
|
|
50
50
|
fontSize: tokens.typography.fontSize,
|
|
51
51
|
lineHeight: tokens.typography.lineHeight,
|
|
52
52
|
fontFamily: tokens.typography.fontFamily,
|
|
53
53
|
fontWeight: tokens.typography.fontWeight
|
|
54
54
|
}, textStyle]) : null;
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
};
|
|
84
|
-
if (orientation === 'vertical') {
|
|
85
|
-
const line = hairline ? /*#__PURE__*/_react().default.createElement(_reactNative().View, {
|
|
55
|
+
const leftG = pos === 'left' ? tokens.sizing.sideMinFlex : 1;
|
|
56
|
+
const rightG = pos === 'right' ? tokens.sizing.sideMinFlex : 1;
|
|
57
|
+
const line = g => hl ? /*#__PURE__*/_react().default.createElement(_reactNative().View, {
|
|
58
|
+
style: [tokens.layout.hairlineWrapper, {
|
|
59
|
+
flexGrow: g
|
|
60
|
+
}]
|
|
61
|
+
}, /*#__PURE__*/_react().default.createElement(_reactNative().View, {
|
|
62
|
+
style: [(0, _utils.createHairlineView)({
|
|
63
|
+
position: 'bottom',
|
|
64
|
+
color: clr,
|
|
65
|
+
left: 0,
|
|
66
|
+
right: 0,
|
|
67
|
+
bottom: 0
|
|
68
|
+
}), {
|
|
69
|
+
borderStyle: bStyle
|
|
70
|
+
}]
|
|
71
|
+
})) : /*#__PURE__*/_react().default.createElement(_reactNative().View, {
|
|
72
|
+
style: {
|
|
73
|
+
flexGrow: g,
|
|
74
|
+
flexShrink: 1,
|
|
75
|
+
height: tokens.borders.thickness,
|
|
76
|
+
borderBottomWidth: tokens.borders.thickness,
|
|
77
|
+
borderBottomColor: clr,
|
|
78
|
+
borderStyle: bStyle
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
if (ori === 'vertical') {
|
|
82
|
+
const vLine = hl ? /*#__PURE__*/_react().default.createElement(_reactNative().View, {
|
|
86
83
|
style: [tokens.layout.hairlineWrapper, {
|
|
87
84
|
width: tokens.borders.thickness,
|
|
88
85
|
height: '100%'
|
|
@@ -90,20 +87,20 @@ const DividerImpl = props => {
|
|
|
90
87
|
}, /*#__PURE__*/_react().default.createElement(_reactNative().View, {
|
|
91
88
|
style: [(0, _utils.createHairlineView)({
|
|
92
89
|
position: 'left',
|
|
93
|
-
color:
|
|
90
|
+
color: clr,
|
|
94
91
|
top: 0,
|
|
95
92
|
bottom: 0,
|
|
96
93
|
left: 0
|
|
97
94
|
}), {
|
|
98
|
-
borderStyle
|
|
95
|
+
borderStyle: bStyle
|
|
99
96
|
}]
|
|
100
97
|
})) : /*#__PURE__*/_react().default.createElement(_reactNative().View, {
|
|
101
98
|
style: {
|
|
102
99
|
width: tokens.borders.thickness,
|
|
103
100
|
height: '100%',
|
|
104
101
|
borderLeftWidth: tokens.borders.thickness,
|
|
105
|
-
borderLeftColor:
|
|
106
|
-
borderStyle
|
|
102
|
+
borderLeftColor: clr,
|
|
103
|
+
borderStyle: bStyle
|
|
107
104
|
}
|
|
108
105
|
});
|
|
109
106
|
return /*#__PURE__*/_react().default.createElement(_reactNative().View, _extends({
|
|
@@ -112,18 +109,18 @@ const DividerImpl = props => {
|
|
|
112
109
|
marginVertical: tokens.spacing.vertical,
|
|
113
110
|
flexDirection: 'column'
|
|
114
111
|
}, style]
|
|
115
|
-
}, rest),
|
|
112
|
+
}, rest), vLine);
|
|
116
113
|
}
|
|
117
114
|
return /*#__PURE__*/_react().default.createElement(_reactNative().View, _extends({
|
|
118
115
|
accessibilityRole: 'separator',
|
|
119
116
|
style: [tokens.layout.container, {
|
|
120
117
|
marginVertical: tokens.spacing.vertical
|
|
121
118
|
}, style]
|
|
122
|
-
}, rest),
|
|
119
|
+
}, rest), line(hasCnt ? leftG : 1), hasCnt && /*#__PURE__*/_react().default.createElement(_react().default.Fragment, null, /*#__PURE__*/_react().default.createElement(_reactNative().View, {
|
|
123
120
|
style: [tokens.layout.contentWrapper, {
|
|
124
121
|
paddingHorizontal: tokens.spacing.contentPadding
|
|
125
122
|
}, contentStyle]
|
|
126
|
-
},
|
|
123
|
+
}, cnt), line(rightG)));
|
|
127
124
|
};
|
|
128
125
|
const Divider = exports.Divider = /*#__PURE__*/_react().default.memo(DividerImpl);
|
|
129
126
|
Divider.displayName = 'Divider';
|
|
@@ -39,32 +39,32 @@ const PRESET_ICONS = {
|
|
|
39
39
|
const EmptyImpl = props => {
|
|
40
40
|
const {
|
|
41
41
|
tokensOverride,
|
|
42
|
-
image:
|
|
43
|
-
imageSize:
|
|
42
|
+
image: imgP,
|
|
43
|
+
imageSize: sizeP,
|
|
44
44
|
imageStyle,
|
|
45
45
|
description,
|
|
46
46
|
descriptionStyle,
|
|
47
47
|
children,
|
|
48
48
|
style,
|
|
49
|
-
gap:
|
|
49
|
+
gap: gapP,
|
|
50
50
|
...rest
|
|
51
51
|
} = props;
|
|
52
52
|
const tokens = (0, _tokens.useEmptyTokens)(tokensOverride);
|
|
53
|
-
const
|
|
54
|
-
const gap =
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
-
if (/*#__PURE__*/_react().default.isValidElement(
|
|
53
|
+
const img = imgP ?? tokens.defaults.image;
|
|
54
|
+
const gap = gapP ?? tokens.defaults.gap;
|
|
55
|
+
const imgSize = sizeP ?? tokens.sizing.image;
|
|
56
|
+
const rImg = () => {
|
|
57
|
+
if (/*#__PURE__*/_react().default.isValidElement(img)) return /*#__PURE__*/_react().default.createElement(_reactNative().View, {
|
|
58
58
|
style: [tokens.layout.imageWrapper, {
|
|
59
|
-
width:
|
|
60
|
-
height:
|
|
59
|
+
width: imgSize,
|
|
60
|
+
height: imgSize
|
|
61
61
|
}, imageStyle]
|
|
62
|
-
},
|
|
63
|
-
if ((0, _utils.isString)(
|
|
64
|
-
if (/^https?:/.test(
|
|
65
|
-
src:
|
|
66
|
-
width:
|
|
67
|
-
height:
|
|
62
|
+
}, img);
|
|
63
|
+
if ((0, _utils.isString)(img)) {
|
|
64
|
+
if (/^https?:/.test(img)) return /*#__PURE__*/_react().default.createElement(_image.default, {
|
|
65
|
+
src: img,
|
|
66
|
+
width: imgSize,
|
|
67
|
+
height: imgSize,
|
|
68
68
|
fit: "contain",
|
|
69
69
|
showLoading: false,
|
|
70
70
|
showError: false,
|
|
@@ -72,21 +72,21 @@ const EmptyImpl = props => {
|
|
|
72
72
|
backgroundColor: tokens.colors.imageBackground
|
|
73
73
|
}, imageStyle]
|
|
74
74
|
});
|
|
75
|
-
const
|
|
76
|
-
const iconSize = resolvedImageSize * tokens.sizing.iconScale;
|
|
75
|
+
const Icon = PRESET_ICONS[img] || PRESET_ICONS.default;
|
|
77
76
|
return /*#__PURE__*/_react().default.createElement(_reactNative().View, {
|
|
78
77
|
style: [tokens.layout.imageWrapper, {
|
|
79
|
-
width:
|
|
80
|
-
height:
|
|
78
|
+
width: imgSize,
|
|
79
|
+
height: imgSize
|
|
81
80
|
}, imageStyle]
|
|
82
|
-
}, /*#__PURE__*/_react().default.createElement(
|
|
83
|
-
size:
|
|
81
|
+
}, /*#__PURE__*/_react().default.createElement(Icon, {
|
|
82
|
+
size: imgSize * tokens.sizing.iconScale,
|
|
84
83
|
color: tokens.colors.icon
|
|
85
84
|
}));
|
|
86
85
|
}
|
|
86
|
+
;
|
|
87
87
|
return null;
|
|
88
88
|
};
|
|
89
|
-
const
|
|
89
|
+
const rDesc = () => {
|
|
90
90
|
if (!(0, _utils.isRenderable)(description)) return null;
|
|
91
91
|
if ((0, _utils.isText)(description)) return /*#__PURE__*/_react().default.createElement(_reactNative().Text, {
|
|
92
92
|
style: [tokens.layout.descriptionText, {
|
|
@@ -106,15 +106,20 @@ const EmptyImpl = props => {
|
|
|
106
106
|
}
|
|
107
107
|
}, description);
|
|
108
108
|
};
|
|
109
|
+
const footStyle = {
|
|
110
|
+
fontFamily: tokens.typography.descriptionFontFamily,
|
|
111
|
+
fontSize: tokens.typography.descriptionSize,
|
|
112
|
+
fontWeight: tokens.typography.descriptionFontWeight
|
|
113
|
+
};
|
|
109
114
|
return /*#__PURE__*/_react().default.createElement(_reactNative().View, _extends({
|
|
110
115
|
accessibilityRole: "summary",
|
|
111
116
|
accessibilityLabel: (0, _utils.isText)(description) ? String(description) : undefined,
|
|
112
117
|
style: [tokens.layout.container, style]
|
|
113
|
-
}, rest),
|
|
118
|
+
}, rest), rImg(), rDesc(), (0, _utils.isRenderable)(children) && /*#__PURE__*/_react().default.createElement(_reactNative().View, {
|
|
114
119
|
style: {
|
|
115
120
|
marginTop: tokens.spacing.footerMarginTop
|
|
116
121
|
}
|
|
117
|
-
}, (0, _utils.renderTextOrNode)(children)));
|
|
122
|
+
}, (0, _utils.renderTextOrNode)(children, footStyle)));
|
|
118
123
|
};
|
|
119
124
|
const Empty = exports.Empty = /*#__PURE__*/_react().default.memo(EmptyImpl);
|
|
120
125
|
Empty.displayName = 'Empty';
|
|
@@ -39,10 +39,10 @@ class ErrorBoundaryClass extends _react().default.Component {
|
|
|
39
39
|
forwardedRef
|
|
40
40
|
} = this.props;
|
|
41
41
|
if (!forwardedRef) return;
|
|
42
|
-
const
|
|
42
|
+
const refVal = {
|
|
43
43
|
reset: this.reset
|
|
44
44
|
};
|
|
45
|
-
if (typeof forwardedRef === 'function') forwardedRef(
|
|
45
|
+
if (typeof forwardedRef === 'function') forwardedRef(refVal);else if (forwardedRef && typeof forwardedRef === 'object') forwardedRef.current = refVal;
|
|
46
46
|
}
|
|
47
47
|
reset = () => {
|
|
48
48
|
this.props.onReset?.();
|
|
@@ -63,6 +63,7 @@ class ErrorBoundaryClass extends _react().default.Component {
|
|
|
63
63
|
if (fallback !== undefined) return fallback;
|
|
64
64
|
return null;
|
|
65
65
|
}
|
|
66
|
+
;
|
|
66
67
|
return children ?? null;
|
|
67
68
|
}
|
|
68
69
|
}
|