@unif/react-native-design 0.13.0 → 0.14.1
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/lib/module/components/ui/Confirm/ConfirmHost.js +30 -4
- package/lib/module/components/ui/Confirm/ConfirmHost.js.map +1 -1
- package/lib/module/components/ui/Confirm/styles.js +12 -2
- package/lib/module/components/ui/Confirm/styles.js.map +1 -1
- package/lib/module/components/ui/Segmented/Segmented.js +14 -6
- package/lib/module/components/ui/Segmented/Segmented.js.map +1 -1
- package/lib/module/components/ui/Segmented/styles.js +34 -7
- package/lib/module/components/ui/Segmented/styles.js.map +1 -1
- package/lib/typescript/src/components/business/AvatarWithRing/styles.d.ts +5 -5
- package/lib/typescript/src/components/business/AvatarWithRing/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Confirm/ConfirmHost.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Confirm/styles.d.ts +10 -2
- package/lib/typescript/src/components/ui/Confirm/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Input/Input.d.ts +6 -6
- package/lib/typescript/src/components/ui/Search/Search.d.ts +3 -3
- package/lib/typescript/src/components/ui/Segmented/Segmented.d.ts +4 -2
- package/lib/typescript/src/components/ui/Segmented/Segmented.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Segmented/index.d.ts +1 -1
- package/lib/typescript/src/components/ui/Segmented/index.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Segmented/styles.d.ts +13 -5
- package/lib/typescript/src/components/ui/Segmented/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Segmented/types.d.ts +14 -0
- package/lib/typescript/src/components/ui/Segmented/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/TextField/TextFieldBase.d.ts +6 -6
- package/lib/typescript/src/components/ui/Textarea/Textarea.d.ts +6 -6
- package/lib/typescript/src/components/ui/index.d.ts +1 -1
- package/lib/typescript/src/components/ui/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/ui/Confirm/ConfirmHost.tsx +38 -1
- package/src/components/ui/Confirm/styles.ts +12 -2
- package/src/components/ui/Segmented/Segmented.tsx +13 -10
- package/src/components/ui/Segmented/index.ts +1 -1
- package/src/components/ui/Segmented/styles.ts +27 -7
- package/src/components/ui/Segmented/types.ts +16 -0
- package/src/components/ui/index.ts +1 -1
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
4
|
-
import { Modal, Pressable, Text, View } from 'react-native';
|
|
4
|
+
import { Animated, Easing, Modal, Pressable, Text, View, useWindowDimensions } from 'react-native';
|
|
5
5
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
6
|
import { space, useThemedStyles } from "../../../theme/index.js";
|
|
7
7
|
import { Button } from "../Button/index.js";
|
|
8
8
|
import { _subs } from "./confirm.js";
|
|
9
9
|
import { makeStyles } from "./styles.js";
|
|
10
10
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
|
+
/** 遮罩淡入 / 淡出时长(ms)—— 出场略长于入场,与 Modal slide 退场(~300ms)大致同步收完。 */
|
|
12
|
+
const SCRIM_IN_MS = 220;
|
|
13
|
+
const SCRIM_OUT_MS = 260;
|
|
14
|
+
|
|
11
15
|
/**
|
|
12
16
|
* Confirm 对话框宿主 —— App 根挂一次,监听 `confirm()` 调用并渲染。
|
|
13
17
|
*
|
|
@@ -18,6 +22,9 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
18
22
|
export function ConfirmHost() {
|
|
19
23
|
const styles = useThemedStyles(makeStyles);
|
|
20
24
|
const insets = useSafeAreaInsets();
|
|
25
|
+
const {
|
|
26
|
+
height: screenH
|
|
27
|
+
} = useWindowDimensions();
|
|
21
28
|
const [entry, setEntry] = useState(null);
|
|
22
29
|
|
|
23
30
|
// 跟踪当前未决 entry,供 unmount cleanup resolve(false)。
|
|
@@ -48,20 +55,39 @@ export function ConfirmHost() {
|
|
|
48
55
|
entry?.resolve(false);
|
|
49
56
|
setEntry(null);
|
|
50
57
|
}, [entry]);
|
|
58
|
+
|
|
59
|
+
// 遮罩自持淡入 / 淡出(不蹭 Modal 的位移动画,理由见下方 scrim 注释)。退场也要淡:
|
|
60
|
+
// entry 置 null 后 Modal 仍在滑出、本层仍挂载,不淡的话遮罩会在滑出末尾硬切消失。
|
|
61
|
+
const scrimOpacity = useRef(new Animated.Value(0)).current;
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
Animated.timing(scrimOpacity, {
|
|
64
|
+
toValue: entry ? 1 : 0,
|
|
65
|
+
duration: entry ? SCRIM_IN_MS : SCRIM_OUT_MS,
|
|
66
|
+
easing: Easing.out(Easing.quad),
|
|
67
|
+
useNativeDriver: true
|
|
68
|
+
}).start();
|
|
69
|
+
}, [entry, scrimOpacity]);
|
|
51
70
|
return /*#__PURE__*/_jsx(Modal, {
|
|
52
71
|
visible: !!entry,
|
|
53
72
|
transparent: true,
|
|
54
73
|
animationType: "slide",
|
|
55
74
|
statusBarTranslucent: true,
|
|
56
75
|
onRequestClose: handleCancel,
|
|
57
|
-
children: /*#__PURE__*/
|
|
76
|
+
children: /*#__PURE__*/_jsxs(Pressable, {
|
|
58
77
|
style: styles.backdrop,
|
|
59
78
|
onPress: handleCancel
|
|
60
79
|
// [M-16] accessible={false}:否则 backdrop 把整个子树合并成单一「关闭, 按钮」,
|
|
61
80
|
// 遮蔽 sheet 内的 title/message/按钮。SR 取消路径走 cancel 按钮 + onRequestClose。
|
|
62
81
|
,
|
|
63
82
|
accessible: false,
|
|
64
|
-
children: /*#__PURE__*/_jsx(
|
|
83
|
+
children: [/*#__PURE__*/_jsx(Animated.View, {
|
|
84
|
+
pointerEvents: "none",
|
|
85
|
+
style: [styles.scrim, {
|
|
86
|
+
top: -screenH,
|
|
87
|
+
opacity: scrimOpacity
|
|
88
|
+
}],
|
|
89
|
+
testID: "confirm-scrim"
|
|
90
|
+
}), /*#__PURE__*/_jsx(Pressable, {
|
|
65
91
|
style: [styles.sheet, {
|
|
66
92
|
paddingBottom: insets.bottom + space['7']
|
|
67
93
|
}],
|
|
@@ -95,7 +121,7 @@ export function ConfirmHost() {
|
|
|
95
121
|
})]
|
|
96
122
|
})]
|
|
97
123
|
}) : null
|
|
98
|
-
})
|
|
124
|
+
})]
|
|
99
125
|
})
|
|
100
126
|
});
|
|
101
127
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useEffect","useRef","useState","Modal","Pressable","Text","View","useSafeAreaInsets","space","useThemedStyles","Button","_subs","makeStyles","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","ConfirmHost","styles","insets","entry","setEntry","pendingRef","current","lastEntryRef","display","sub","next","add","delete","resolve","handleConfirm","handleCancel","visible","transparent","animationType","statusBarTranslucent","onRequestClose","children","style","backdrop","onPress","accessible","sheet","paddingBottom","bottom","body","title","accessibilityRole","message","actions","
|
|
1
|
+
{"version":3,"names":["React","useCallback","useEffect","useRef","useState","Animated","Easing","Modal","Pressable","Text","View","useWindowDimensions","useSafeAreaInsets","space","useThemedStyles","Button","_subs","makeStyles","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","SCRIM_IN_MS","SCRIM_OUT_MS","ConfirmHost","styles","insets","height","screenH","entry","setEntry","pendingRef","current","lastEntryRef","display","sub","next","add","delete","resolve","handleConfirm","handleCancel","scrimOpacity","Value","timing","toValue","duration","easing","out","quad","useNativeDriver","start","visible","transparent","animationType","statusBarTranslucent","onRequestClose","children","style","backdrop","onPress","accessible","pointerEvents","scrim","top","opacity","testID","sheet","paddingBottom","bottom","body","title","accessibilityRole","message","actions","label","cancelLabel","variant","block","confirmLabel","destructive"],"sourceRoot":"../../../../../src","sources":["components/ui/Confirm/ConfirmHost.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,SAAS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AO,EAAC,WAAW;cACnBC,KAAK;cACLlB,OAAO,EAAEnB;YAAa,CACvB,CAAC,eACFxB,IAAA,CAACJ,MAAM;cACLqD,MAAM,EAAC,YAAY;cACnBS,KAAK,EAAEzC,OAAO,CAAC6C,YAAY,IAAI,IAAK;cACpCF,OAAO,EAAE3C,OAAO,CAAC8C,WAAW,GAAG,QAAQ,GAAG,SAAU;cACpDF,KAAK;cACLlB,OAAO,EAAEpB;YAAc,CACxB,CAAC;UAAA,CACE,CAAC;QAAA,CACP,CAAC,GACD;MAAI,CACC,CAAC;IAAA,CACH;EAAC,CACP,CAAC;AAEZ","ignoreList":[]}
|
|
@@ -3,13 +3,23 @@
|
|
|
3
3
|
import { StyleSheet } from 'react-native';
|
|
4
4
|
import { fw, r, space, type as t } from "../../../theme/index.js";
|
|
5
5
|
/** Confirm 对话框 styles —— 原生 Modal(transparent + slide)底部弹出卡片:
|
|
6
|
-
* backdrop
|
|
6
|
+
* backdrop 铺满、点击取消(**不挂半透黑** —— 见 ConfirmHost 的 scrim 注释);
|
|
7
|
+
* scrim 半透黑独立一层;sheet 贴底圆角顶。不依赖 @gorhom。 */
|
|
7
8
|
export const makeStyles = c => StyleSheet.create({
|
|
8
9
|
backdrop: {
|
|
9
10
|
flex: 1,
|
|
10
|
-
backgroundColor: c.scrim,
|
|
11
11
|
justifyContent: 'flex-end'
|
|
12
12
|
},
|
|
13
|
+
// 半透黑遮罩层(纯视觉,不接触控):绝对定位四边贴合 backdrop,`top` 由 ConfirmHost 内联
|
|
14
|
+
// 覆写成 -屏高(向上外扩一屏,盖住 Modal slide 位移期露出的顶部)。
|
|
15
|
+
scrim: {
|
|
16
|
+
position: 'absolute',
|
|
17
|
+
top: 0,
|
|
18
|
+
left: 0,
|
|
19
|
+
right: 0,
|
|
20
|
+
bottom: 0,
|
|
21
|
+
backgroundColor: c.scrim
|
|
22
|
+
},
|
|
13
23
|
sheet: {
|
|
14
24
|
backgroundColor: c.surface,
|
|
15
25
|
borderTopLeftRadius: r(20),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","fw","r","space","type","t","makeStyles","c","create","backdrop","flex","
|
|
1
|
+
{"version":3,"names":["StyleSheet","fw","r","space","type","t","makeStyles","c","create","backdrop","flex","justifyContent","scrim","position","top","left","right","bottom","backgroundColor","sheet","surface","borderTopLeftRadius","borderTopRightRadius","paddingTop","body","paddingHorizontal","gap","title","fontSize","heroSm","fontWeight","semi","color","foreground","letterSpacing","message","foregroundMuted","lineHeight","actions","flexDirection"],"sourceRoot":"../../../../../src","sources":["components/ui/Confirm/styles.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;AACzC,SAASC,EAAE,EAAEC,CAAC,EAAEC,KAAK,EAAEC,IAAI,IAAIC,CAAC,QAAQ,yBAAgB;AAGxD;AACA;AACA;AACA,OAAO,MAAMC,UAAU,GAAIC,CAAc,IACvCP,UAAU,CAACQ,MAAM,CAAC;EAChBC,QAAQ,EAAE;IACRC,IAAI,EAAE,CAAC;IACPC,cAAc,EAAE;EAClB,CAAC;EACD;EACA;EACAC,KAAK,EAAE;IACLC,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE,CAAC;IACTC,eAAe,EAAEX,CAAC,CAACK;EACrB,CAAC;EACDO,KAAK,EAAE;IACLD,eAAe,EAAEX,CAAC,CAACa,OAAO;IAC1BC,mBAAmB,EAAEnB,CAAC,CAAC,EAAE,CAAC;IAC1BoB,oBAAoB,EAAEpB,CAAC,CAAC,EAAE,CAAC;IAC3BqB,UAAU,EAAEpB,KAAK,CAAC,GAAG;EACvB,CAAC;EACDqB,IAAI,EAAE;IACJC,iBAAiB,EAAEtB,KAAK,CAAC,GAAG,CAAC;IAC7BuB,GAAG,EAAEvB,KAAK,CAAC,GAAG;EAChB,CAAC;EACDwB,KAAK,EAAE;IACLC,QAAQ,EAAEvB,CAAC,CAACwB,MAAM;IAClBC,UAAU,EAAE7B,EAAE,CAAC8B,IAAI;IACnBC,KAAK,EAAEzB,CAAC,CAAC0B,UAAU;IACnBC,aAAa,EAAE,CAAC;EAClB,CAAC;EACDC,OAAO,EAAE;IACPP,QAAQ,EAAEvB,CAAC,CAACmB,IAAI;IAChBQ,KAAK,EAAEzB,CAAC,CAAC6B,eAAe;IACxBC,UAAU,EAAEhC,CAAC,CAACmB,IAAI,GAAG;EACvB,CAAC;EACDc,OAAO,EAAE;IACPC,aAAa,EAAE,KAAK;IACpBb,GAAG,EAAEvB,KAAK,CAAC,GAAG,CAAC;IACfsB,iBAAiB,EAAEtB,KAAK,CAAC,GAAG,CAAC;IAC7BoB,UAAU,EAAEpB,KAAK,CAAC,GAAG;EACvB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React from 'react';
|
|
3
|
+
import React, { useMemo } from 'react';
|
|
4
4
|
import { Text, View } from 'react-native';
|
|
5
5
|
import { Pressable } from 'react-native-gesture-handler';
|
|
6
6
|
import { fw, useTheme, useThemedStyles } from "../../../theme/index.js";
|
|
7
7
|
import { childTestID } from "../../../utils/testID/index.js";
|
|
8
|
-
import { makeStyles } from "./styles.js";
|
|
8
|
+
import { makeStyles, sizingFor } from "./styles.js";
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
10
|
/**
|
|
11
|
-
* 局部分段控件 ——
|
|
11
|
+
* 局部分段控件 —— pill 在 track 上,激活项是亮色 thumb。
|
|
12
12
|
*
|
|
13
13
|
* **active thumb 必须比 track 亮一档** —— shadow 只在亮色态显示,
|
|
14
14
|
* 暗色态由 surface 明度差表达层级。
|
|
15
|
+
*
|
|
16
|
+
* `size`:默认 `'md'`(44pt 触控达标);`'sm'` 紧凑(28pt)给模型下拉等局促位用。
|
|
15
17
|
*/
|
|
16
18
|
export function Segmented({
|
|
17
19
|
value,
|
|
18
20
|
onChange,
|
|
19
21
|
items,
|
|
22
|
+
size = 'md',
|
|
20
23
|
disabled = false,
|
|
21
24
|
testID
|
|
22
25
|
}) {
|
|
@@ -26,6 +29,7 @@ export function Segmented({
|
|
|
26
29
|
shadow
|
|
27
30
|
} = useTheme();
|
|
28
31
|
const styles = useThemedStyles(makeStyles);
|
|
32
|
+
const sizing = useMemo(() => sizingFor(size), [size]);
|
|
29
33
|
const activeBg = scheme === 'dark' ? c.surfaceContainerHighest : c.surface;
|
|
30
34
|
const activeShadow = scheme === 'dark' ? null : shadow.subtle;
|
|
31
35
|
return (
|
|
@@ -52,16 +56,20 @@ export function Segmented({
|
|
|
52
56
|
testID: itemTestID,
|
|
53
57
|
style: ({
|
|
54
58
|
pressed
|
|
55
|
-
}) => [styles.segItem,
|
|
59
|
+
}) => [styles.segItem, {
|
|
60
|
+
minHeight: sizing.minHeight,
|
|
61
|
+
paddingHorizontal: sizing.px
|
|
62
|
+
}, on && {
|
|
56
63
|
backgroundColor: activeBg
|
|
57
64
|
}, on && activeShadow, {
|
|
58
65
|
opacity: pressed ? 0.85 : 1
|
|
59
66
|
}],
|
|
60
67
|
children: /*#__PURE__*/_jsx(Text, {
|
|
61
|
-
style:
|
|
68
|
+
style: {
|
|
69
|
+
fontSize: sizing.fs,
|
|
62
70
|
color: on ? c.foreground : c.foregroundSubtle,
|
|
63
71
|
fontWeight: on ? fw.semi : fw.medium
|
|
64
|
-
}
|
|
72
|
+
},
|
|
65
73
|
numberOfLines: 1,
|
|
66
74
|
children: it.label
|
|
67
75
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Text","View","Pressable","fw","useTheme","useThemedStyles","childTestID","makeStyles","jsx","_jsx","Segmented","value","onChange","items","disabled","testID","colors","c","scheme","shadow","styles","activeBg","surfaceContainerHighest","surface","activeShadow","subtle","style","seg","accessibilityRole","children","map","it","on","id","itemTestID","itemDisabled","onPress","accessibilityState","selected","accessibilityLabel","label","pressed","segItem","backgroundColor","opacity","
|
|
1
|
+
{"version":3,"names":["React","useMemo","Text","View","Pressable","fw","useTheme","useThemedStyles","childTestID","makeStyles","sizingFor","jsx","_jsx","Segmented","value","onChange","items","size","disabled","testID","colors","c","scheme","shadow","styles","sizing","activeBg","surfaceContainerHighest","surface","activeShadow","subtle","style","seg","accessibilityRole","children","map","it","on","id","itemTestID","itemDisabled","onPress","accessibilityState","selected","accessibilityLabel","label","pressed","segItem","minHeight","paddingHorizontal","px","backgroundColor","opacity","fontSize","fs","color","foreground","foregroundSubtle","fontWeight","semi","medium","numberOfLines"],"sourceRoot":"../../../../../src","sources":["components/ui/Segmented/Segmented.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzC,SAASC,SAAS,QAAQ,8BAA8B;AACxD,SAASC,EAAE,EAAEC,QAAQ,EAAEC,eAAe,QAAQ,yBAAgB;AAC9D,SAASC,WAAW,QAAQ,gCAAuB;AACnD,SAASC,UAAU,EAAEC,SAAS,QAAQ,aAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,SAASA,CAAC;EACxBC,KAAK;EACLC,QAAQ;EACRC,KAAK;EACLC,IAAI,GAAG,IAAI;EACXC,QAAQ,GAAG,KAAK;EAChBC;AACc,CAAC,EAAqB;EACpC,MAAM;IAAEC,MAAM,EAAEC,CAAC;IAAEC,MAAM;IAAEC;EAAO,CAAC,GAAGjB,QAAQ,CAAC,CAAC;EAChD,MAAMkB,MAAM,GAAGjB,eAAe,CAACE,UAAU,CAAC;EAC1C,MAAMgB,MAAM,GAAGxB,OAAO,CAAC,MAAMS,SAAS,CAACO,IAAI,CAAC,EAAE,CAACA,IAAI,CAAC,CAAC;EACrD,MAAMS,QAAQ,GAAGJ,MAAM,KAAK,MAAM,GAAGD,CAAC,CAACM,uBAAuB,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FtB,IAAA,CAACV,IAAI;YACH6B,KAAK,EAAE;cACLsB,QAAQ,EAAE5B,MAAM,CAAC6B,EAAE;cACnBC,KAAK,EAAElB,EAAE,GAAGhB,CAAC,CAACmC,UAAU,GAAGnC,CAAC,CAACoC,gBAAgB;cAC7CC,UAAU,EAAErB,EAAE,GAAGhC,EAAE,CAACsD,IAAI,GAAGtD,EAAE,CAACuD;YAChC,CAAE;YACFC,aAAa,EAAE,CAAE;YAAA3B,QAAA,EAEhBE,EAAE,CAACS;UAAK,CACL;QAAC,GAxBFT,EAAE,CAACE,EAyBC,CAAC;MAEhB,CAAC;IAAC,CACE;EAAC;AAEX","ignoreList":[]}
|
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
import { StyleSheet } from 'react-native';
|
|
4
4
|
import { fixed, r, radius, space, type as t } from "../../../theme/index.js";
|
|
5
|
+
/** sm 紧凑高 —— 取 control.sm 的设计基准值 28,但**物理常量、不缩放**
|
|
6
|
+
* (与 md 的 fixed.hitTarget 同基准)。
|
|
7
|
+
* 为何不直接用 scaled `control.sm`:大屏 `r(28)` 会涨过 md 的 44(size 语义反转,
|
|
8
|
+
* sm 反而比 md 高)。固定 28:各屏恒 < 44、与 md 维持稳定比例。 */
|
|
9
|
+
const SM_MIN_HEIGHT = 28;
|
|
10
|
+
|
|
11
|
+
/** Segmented 静态 base —— track chrome 与 item 居中/圆角(size-invariant)。
|
|
12
|
+
* 随 size 变化的 minHeight / paddingHorizontal / fontSize 由 sizingFor(size) 注入。 */
|
|
5
13
|
export const makeStyles = c => StyleSheet.create({
|
|
6
14
|
seg: {
|
|
7
15
|
flexDirection: 'row',
|
|
@@ -11,16 +19,35 @@ export const makeStyles = c => StyleSheet.create({
|
|
|
11
19
|
alignSelf: 'flex-start'
|
|
12
20
|
},
|
|
13
21
|
segItem: {
|
|
14
|
-
// [M-7] Segmented item 高原为 control.sm≈28pt < 44pt;
|
|
15
|
-
// hitSlop 不越父 seg 容器边界 → 改用 minHeight 直接对齐 fixed.hitTarget(44pt)
|
|
16
|
-
minHeight: fixed.hitTarget,
|
|
17
|
-
paddingHorizontal: space[7],
|
|
18
22
|
alignItems: 'center',
|
|
19
23
|
justifyContent: 'center',
|
|
20
24
|
borderRadius: radius.sm
|
|
21
|
-
},
|
|
22
|
-
segLabel: {
|
|
23
|
-
fontSize: t.xs
|
|
24
25
|
}
|
|
25
26
|
});
|
|
27
|
+
|
|
28
|
+
/** Segmented 尺寸推导:2 档 size → { minHeight, px, fs }。
|
|
29
|
+
* 新增 size 在 types.ts 扩 union + 这里加 case(与 Button.sizingFor 同范式)。
|
|
30
|
+
*
|
|
31
|
+
* [M-7] 触控目标:item 嵌在 seg track 内,hitSlop 不越父 track 边界
|
|
32
|
+
* (≠ Button/Chip 能向外补 hitSlop)→ 只能靠 item minHeight 自撑高 track。
|
|
33
|
+
* - md(默认):minHeight = fixed.hitTarget(44pt 物理常量),触控达标,行为同改前。
|
|
34
|
+
* - sm(紧凑):minHeight = SM_MIN_HEIGHT(28pt 物理常量),为模型下拉等局促位主动小一号,
|
|
35
|
+
* 接受 sub-44pt 触控(调用方按场景 opt-in);a11y role/state 不变。
|
|
36
|
+
* px / fs 走 scaled token(space/type),与 md 同基准 → sm 恒小于 md。 */
|
|
37
|
+
export function sizingFor(size) {
|
|
38
|
+
switch (size) {
|
|
39
|
+
case 'sm':
|
|
40
|
+
return {
|
|
41
|
+
minHeight: SM_MIN_HEIGHT,
|
|
42
|
+
px: space['5'],
|
|
43
|
+
fs: t.xxs
|
|
44
|
+
};
|
|
45
|
+
case 'md':
|
|
46
|
+
return {
|
|
47
|
+
minHeight: fixed.hitTarget,
|
|
48
|
+
px: space['7'],
|
|
49
|
+
fs: t.xs
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
26
53
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","fixed","r","radius","space","type","t","makeStyles","c","create","seg","flexDirection","backgroundColor","surfaceContainerHigh","borderRadius","md","padding","alignSelf","segItem","
|
|
1
|
+
{"version":3,"names":["StyleSheet","fixed","r","radius","space","type","t","SM_MIN_HEIGHT","makeStyles","c","create","seg","flexDirection","backgroundColor","surfaceContainerHigh","borderRadius","md","padding","alignSelf","segItem","alignItems","justifyContent","sm","sizingFor","size","minHeight","px","fs","xxs","hitTarget","xs"],"sourceRoot":"../../../../../src","sources":["components/ui/Segmented/styles.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;AAEzC,SAASC,KAAK,EAAEC,CAAC,EAAEC,MAAM,EAAEC,KAAK,EAAEC,IAAI,IAAIC,CAAC,QAAQ,yBAAgB;AAGnE;AACA;AACA;AACA;AACA,MAAMC,aAAa,GAAG,EAAE;;AAExB;AACA;AACA,OAAO,MAAMC,UAAU,GAAIC,CAAc,IACvCT,UAAU,CAACU,MAAM,CAAC;EAChBC,GAAG,EAAE;IACHC,aAAa,EAAE,KAAK;IACpBC,eAAe,EAAEJ,CAAC,CAACK,oBAAoB;IACvCC,YAAY,EAAEZ,MAAM,CAACa,EAAE;IACvBC,OAAO,EAAEf,CAAC,CAAC,CAAC,CAAC;IACbgB,SAAS,EAAE;EACb,CAAC;EACDC,OAAO,EAAE;IACPC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBN,YAAY,EAAEZ,MAAM,CAACmB;EACvB;AACF,CAAC,CAAC;;AAEJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,SAASA,CAACC,IAAmB,EAAmB;EAC9D,QAAQA,IAAI;IACV,KAAK,IAAI;MACP,OAAO;QAAEC,SAAS,EAAElB,aAAa;QAAEmB,EAAE,EAAEtB,KAAK,CAAC,GAAG,CAAC;QAAEuB,EAAE,EAAErB,CAAC,CAACsB;MAAI,CAAC;IAChE,KAAK,IAAI;MACP,OAAO;QAAEH,SAAS,EAAExB,KAAK,CAAC4B,SAAS;QAAEH,EAAE,EAAEtB,KAAK,CAAC,GAAG,CAAC;QAAEuB,EAAE,EAAErB,CAAC,CAACwB;MAAG,CAAC;EACnE;AACF","ignoreList":[]}
|
|
@@ -27,12 +27,7 @@ export declare const makeAvatarStyles: (size: number, ringColor: string, shadowS
|
|
|
27
27
|
shell: {
|
|
28
28
|
alignItems: "center";
|
|
29
29
|
justifyContent: "center";
|
|
30
|
-
top?: import("react-native").DimensionValue;
|
|
31
|
-
bottom?: import("react-native").DimensionValue;
|
|
32
30
|
filter?: ReadonlyArray<import("react-native").FilterFunction> | string;
|
|
33
|
-
opacity?: number;
|
|
34
|
-
width: import("react-native").DimensionValue;
|
|
35
|
-
height: import("react-native").DimensionValue;
|
|
36
31
|
shadowColor?: import("react-native/types_generated/Libraries/StyleSheet/StyleSheetTypes").____ColorValue_Internal;
|
|
37
32
|
shadowOffset?: Readonly<{
|
|
38
33
|
width?: number;
|
|
@@ -104,6 +99,7 @@ export declare const makeAvatarStyles: (size: number, ringColor: string, shadowS
|
|
|
104
99
|
borderRightWidth?: number;
|
|
105
100
|
borderStartWidth?: number;
|
|
106
101
|
borderTopWidth?: number;
|
|
102
|
+
opacity?: number;
|
|
107
103
|
outlineColor?: import("react-native/types_generated/Libraries/StyleSheet/StyleSheetTypes").____ColorValue_Internal;
|
|
108
104
|
outlineOffset?: number;
|
|
109
105
|
outlineStyle?: "solid" | "dotted" | "dashed";
|
|
@@ -119,10 +115,14 @@ export declare const makeAvatarStyles: (size: number, ringColor: string, shadowS
|
|
|
119
115
|
experimental_backgroundRepeat?: ReadonlyArray<import("react-native/types_generated/Libraries/StyleSheet/StyleSheetTypes").BackgroundRepeatValue> | string;
|
|
120
116
|
isolation?: "auto" | "isolate";
|
|
121
117
|
display?: "none" | "flex" | "contents";
|
|
118
|
+
width: import("react-native").DimensionValue;
|
|
119
|
+
height: import("react-native").DimensionValue;
|
|
120
|
+
bottom?: import("react-native").DimensionValue;
|
|
122
121
|
end?: import("react-native").DimensionValue;
|
|
123
122
|
left?: import("react-native").DimensionValue;
|
|
124
123
|
right?: import("react-native").DimensionValue;
|
|
125
124
|
start?: import("react-native").DimensionValue;
|
|
125
|
+
top?: import("react-native").DimensionValue;
|
|
126
126
|
inset?: import("react-native").DimensionValue;
|
|
127
127
|
insetBlock?: import("react-native").DimensionValue;
|
|
128
128
|
insetBlockEnd?: import("react-native").DimensionValue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/business/AvatarWithRing/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAS,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAKzD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,gBAAgB,GAC3B,MAAM,MAAM,EACZ,WAAW,MAAM,EACjB,aAAa,SAAS,EACtB,GAAG,WAAW
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/business/AvatarWithRing/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAS,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAKzD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,gBAAgB,GAC3B,MAAM,MAAM,EACZ,WAAW,MAAM,EACjB,aAAa,SAAS,EACtB,GAAG,WAAW;;;;;;;;;;;qBAkDu9tB,CAAC;sBAAoB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAD5/tB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmHost.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ui/Confirm/ConfirmHost.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ConfirmHost.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ui/Confirm/ConfirmHost.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAqBxE;;;;;;GAMG;AACH,wBAAgB,WAAW,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAmHtD"}
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import type { ColorTokens } from '../../../theme';
|
|
2
2
|
/** Confirm 对话框 styles —— 原生 Modal(transparent + slide)底部弹出卡片:
|
|
3
|
-
* backdrop
|
|
3
|
+
* backdrop 铺满、点击取消(**不挂半透黑** —— 见 ConfirmHost 的 scrim 注释);
|
|
4
|
+
* scrim 半透黑独立一层;sheet 贴底圆角顶。不依赖 @gorhom。 */
|
|
4
5
|
export declare const makeStyles: (c: ColorTokens) => Readonly<{
|
|
5
6
|
backdrop: {
|
|
6
7
|
flex: number;
|
|
7
|
-
backgroundColor: string;
|
|
8
8
|
justifyContent: "flex-end";
|
|
9
9
|
};
|
|
10
|
+
scrim: {
|
|
11
|
+
position: "absolute";
|
|
12
|
+
top: number;
|
|
13
|
+
left: number;
|
|
14
|
+
right: number;
|
|
15
|
+
bottom: number;
|
|
16
|
+
backgroundColor: string;
|
|
17
|
+
};
|
|
10
18
|
sheet: {
|
|
11
19
|
backgroundColor: string;
|
|
12
20
|
borderTopLeftRadius: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ui/Confirm/styles.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ui/Confirm/styles.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD;;6CAE6C;AAC7C,eAAO,MAAM,UAAU,GAAI,GAAG,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CrC,CAAC"}
|
|
@@ -136,7 +136,7 @@ export declare const Input: import("react").ForwardRefExoticComponent<Omit<Reado
|
|
|
136
136
|
pointerEvents?: ("auto" | "box-none" | "box-only" | "none") | undefined;
|
|
137
137
|
removeClippedSubviews?: boolean | undefined;
|
|
138
138
|
experimental_accessibilityOrder?: Array<string> | undefined;
|
|
139
|
-
}>, never>>, "style" | "experimental_accessibilityOrder">, "value" | "textAlign" | "style" | "onBlur" | "onFocus" | "lineBreakStrategyIOS" | "selectionColor" | "textBreakStrategy" | "allowFontScaling" | "maxFontSizeMultiplier" | "numberOfLines" | "
|
|
139
|
+
}>, never>>, "style" | "experimental_accessibilityOrder">, "value" | "textAlign" | "onChange" | "style" | "onBlur" | "onFocus" | "onPress" | "lineBreakStrategyIOS" | "selectionColor" | "textBreakStrategy" | "allowFontScaling" | "maxFontSizeMultiplier" | "numberOfLines" | "onPressIn" | "onPressOut" | "disableKeyboardShortcuts" | "clearButtonMode" | "clearTextOnFocus" | "dataDetectorTypes" | "enablesReturnKeyAutomatically" | "inputAccessoryViewID" | "inputAccessoryViewButtonLabel" | "keyboardAppearance" | "passwordRules" | "rejectResponderTermination" | "scrollEnabled" | "spellCheck" | "textContentType" | "lineBreakModeIOS" | "smartInsertDelete" | "cursorColor" | "selectionHandleColor" | "disableFullscreenUI" | "importantForAutofill" | "inlineImageLeft" | "inlineImagePadding" | "returnKeyLabel" | "rows" | "showSoftInputOnFocus" | "underlineColorAndroid" | "experimental_acceptDragAndDropTypes" | "autoCapitalize" | "autoComplete" | "autoCorrect" | "autoFocus" | "caretHidden" | "contextMenuHidden" | "defaultValue" | "editable" | "forwardedRef" | "enterKeyHint" | "inputMode" | "keyboardType" | "maxLength" | "multiline" | "onChangeText" | "onContentSizeChange" | "onEndEditing" | "onKeyPress" | "onSelectionChange" | "onSubmitEditing" | "onScroll" | "placeholder" | "placeholderTextColor" | "readOnly" | "returnKeyType" | "secureTextEntry" | "selection" | "selectTextOnFocus" | "blurOnSubmit" | "submitBehavior"> & Omit<Readonly<{
|
|
140
140
|
disableKeyboardShortcuts?: boolean | undefined;
|
|
141
141
|
clearButtonMode?: ("never" | "while-editing" | "unless-editing" | "always") | undefined;
|
|
142
142
|
clearTextOnFocus?: boolean | undefined;
|
|
@@ -153,7 +153,7 @@ export declare const Input: import("react").ForwardRefExoticComponent<Omit<Reado
|
|
|
153
153
|
lineBreakStrategyIOS?: ("none" | "standard" | "hangul-word" | "push-out") | undefined;
|
|
154
154
|
lineBreakModeIOS?: ("wordWrapping" | "char" | "clip" | "head" | "middle" | "tail") | undefined;
|
|
155
155
|
smartInsertDelete?: boolean | undefined;
|
|
156
|
-
}>, "value" | "textAlign" | "style" | "onBlur" | "onFocus" | "selectionColor" | "textBreakStrategy" | "allowFontScaling" | "maxFontSizeMultiplier" | "numberOfLines" | "
|
|
156
|
+
}>, "value" | "textAlign" | "onChange" | "style" | "onBlur" | "onFocus" | "onPress" | "selectionColor" | "textBreakStrategy" | "allowFontScaling" | "maxFontSizeMultiplier" | "numberOfLines" | "onPressIn" | "onPressOut" | "cursorColor" | "selectionHandleColor" | "disableFullscreenUI" | "importantForAutofill" | "inlineImageLeft" | "inlineImagePadding" | "returnKeyLabel" | "rows" | "showSoftInputOnFocus" | "underlineColorAndroid" | "experimental_acceptDragAndDropTypes" | "autoCapitalize" | "autoComplete" | "autoCorrect" | "autoFocus" | "caretHidden" | "contextMenuHidden" | "defaultValue" | "editable" | "forwardedRef" | "enterKeyHint" | "inputMode" | "keyboardType" | "maxLength" | "multiline" | "onChangeText" | "onContentSizeChange" | "onEndEditing" | "onKeyPress" | "onSelectionChange" | "onSubmitEditing" | "onScroll" | "placeholder" | "placeholderTextColor" | "readOnly" | "returnKeyType" | "secureTextEntry" | "selection" | "selectTextOnFocus" | "blurOnSubmit" | "submitBehavior"> & Omit<Readonly<{
|
|
157
157
|
cursorColor?: import("react-native").ColorValue | undefined;
|
|
158
158
|
selectionHandleColor?: import("react-native").ColorValue | undefined;
|
|
159
159
|
disableFullscreenUI?: boolean | undefined;
|
|
@@ -166,7 +166,7 @@ export declare const Input: import("react").ForwardRefExoticComponent<Omit<Reado
|
|
|
166
166
|
showSoftInputOnFocus?: boolean | undefined;
|
|
167
167
|
textBreakStrategy?: ("simple" | "highQuality" | "balanced") | undefined;
|
|
168
168
|
underlineColorAndroid?: import("react-native").ColorValue | undefined;
|
|
169
|
-
}>, "value" | "textAlign" | "style" | "onBlur" | "onFocus" | "
|
|
169
|
+
}>, "value" | "textAlign" | "onChange" | "style" | "onBlur" | "onFocus" | "onPress" | "selectionColor" | "allowFontScaling" | "maxFontSizeMultiplier" | "onPressIn" | "onPressOut" | "experimental_acceptDragAndDropTypes" | "autoCapitalize" | "autoComplete" | "autoCorrect" | "autoFocus" | "caretHidden" | "contextMenuHidden" | "defaultValue" | "editable" | "forwardedRef" | "enterKeyHint" | "inputMode" | "keyboardType" | "maxLength" | "multiline" | "onChangeText" | "onContentSizeChange" | "onEndEditing" | "onKeyPress" | "onSelectionChange" | "onSubmitEditing" | "onScroll" | "placeholder" | "placeholderTextColor" | "readOnly" | "returnKeyType" | "secureTextEntry" | "selection" | "selectTextOnFocus" | "blurOnSubmit" | "submitBehavior"> & Omit<Readonly<{
|
|
170
170
|
experimental_acceptDragAndDropTypes?: ReadonlyArray<string> | undefined;
|
|
171
171
|
autoCapitalize?: import("react-native").AutoCapitalize | undefined;
|
|
172
172
|
autoComplete?: ("additional-name" | "address-line1" | "address-line2" | "birthdate-day" | "birthdate-full" | "birthdate-month" | "birthdate-year" | "cc-csc" | "cc-exp" | "cc-exp-day" | "cc-exp-month" | "cc-exp-year" | "cc-number" | "cc-name" | "cc-given-name" | "cc-middle-name" | "cc-family-name" | "cc-type" | "country" | "current-password" | "email" | "family-name" | "gender" | "given-name" | "honorific-prefix" | "honorific-suffix" | "name" | "name-family" | "name-given" | "name-middle" | "name-middle-initial" | "name-prefix" | "name-suffix" | "new-password" | "nickname" | "one-time-code" | "organization" | "organization-title" | "password" | "password-new" | "postal-address" | "postal-address-country" | "postal-address-extended" | "postal-address-extended-postal-code" | "postal-address-locality" | "postal-address-region" | "postal-code" | "street-address" | "sms-otp" | "tel" | "tel-country-code" | "tel-national" | "tel-device" | "url" | "username" | "username-new" | "off") | undefined;
|
|
@@ -295,7 +295,7 @@ export declare const Input: import("react").ForwardRefExoticComponent<Omit<Reado
|
|
|
295
295
|
rowGap?: number | string;
|
|
296
296
|
columnGap?: number | string;
|
|
297
297
|
gap?: number | string;
|
|
298
|
-
}>, "filter" | "
|
|
298
|
+
}>, "filter" | "shadowColor" | "shadowOffset" | "shadowOpacity" | "shadowRadius" | "transform" | "transformOrigin" | "backfaceVisibility" | "backgroundColor" | "borderColor" | "borderCurve" | "borderBottomColor" | "borderEndColor" | "borderLeftColor" | "borderRightColor" | "borderStartColor" | "borderTopColor" | "borderBlockColor" | "borderBlockEndColor" | "borderBlockStartColor" | "borderRadius" | "borderBottomEndRadius" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStartRadius" | "borderEndEndRadius" | "borderEndStartRadius" | "borderStartEndRadius" | "borderStartStartRadius" | "borderTopEndRadius" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStartRadius" | "borderStyle" | "borderWidth" | "borderBottomWidth" | "borderEndWidth" | "borderLeftWidth" | "borderRightWidth" | "borderStartWidth" | "borderTopWidth" | "opacity" | "outlineColor" | "outlineOffset" | "outlineStyle" | "outlineWidth" | "elevation" | "pointerEvents" | "cursor" | "boxShadow" | "mixBlendMode" | "experimental_backgroundImage" | "experimental_backgroundSize" | "experimental_backgroundPosition" | "experimental_backgroundRepeat" | "isolation"> & Omit<Readonly<Omit<Readonly<{
|
|
299
299
|
shadowColor?: import("react-native/types_generated/Libraries/StyleSheet/StyleSheetTypes").____ColorValue_Internal;
|
|
300
300
|
shadowOffset?: Readonly<{
|
|
301
301
|
width?: number;
|
|
@@ -303,7 +303,7 @@ export declare const Input: import("react").ForwardRefExoticComponent<Omit<Reado
|
|
|
303
303
|
}>;
|
|
304
304
|
shadowOpacity?: number;
|
|
305
305
|
shadowRadius?: number;
|
|
306
|
-
}>, never> & Omit<Readonly<{}>, never>>, "filter" | "
|
|
306
|
+
}>, never> & Omit<Readonly<{}>, never>>, "filter" | "transform" | "transformOrigin" | "backfaceVisibility" | "backgroundColor" | "borderColor" | "borderCurve" | "borderBottomColor" | "borderEndColor" | "borderLeftColor" | "borderRightColor" | "borderStartColor" | "borderTopColor" | "borderBlockColor" | "borderBlockEndColor" | "borderBlockStartColor" | "borderRadius" | "borderBottomEndRadius" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStartRadius" | "borderEndEndRadius" | "borderEndStartRadius" | "borderStartEndRadius" | "borderStartStartRadius" | "borderTopEndRadius" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStartRadius" | "borderStyle" | "borderWidth" | "borderBottomWidth" | "borderEndWidth" | "borderLeftWidth" | "borderRightWidth" | "borderStartWidth" | "borderTopWidth" | "opacity" | "outlineColor" | "outlineOffset" | "outlineStyle" | "outlineWidth" | "elevation" | "pointerEvents" | "cursor" | "boxShadow" | "mixBlendMode" | "experimental_backgroundImage" | "experimental_backgroundSize" | "experimental_backgroundPosition" | "experimental_backgroundRepeat" | "isolation"> & Omit<Readonly<{
|
|
307
307
|
transform?: ReadonlyArray<Readonly<import("react-native/types_generated/Libraries/StyleSheet/private/_TransformStyle").MaximumOneOf<import("react-native/types_generated/Libraries/StyleSheet/private/_TransformStyle").MergeUnion<{
|
|
308
308
|
readonly perspective: number | import("react-native/types_generated/Libraries/Animated/AnimatedExports").Node;
|
|
309
309
|
} | {
|
|
@@ -334,7 +334,7 @@ export declare const Input: import("react").ForwardRefExoticComponent<Omit<Reado
|
|
|
334
334
|
readonly matrix: ReadonlyArray<number | import("react-native/types_generated/Libraries/Animated/AnimatedExports").Node> | import("react-native/types_generated/Libraries/Animated/AnimatedExports").Node;
|
|
335
335
|
}>>>> | string;
|
|
336
336
|
transformOrigin?: [string | number, string | number, string | number] | string;
|
|
337
|
-
}>, "filter" | "
|
|
337
|
+
}>, "filter" | "backfaceVisibility" | "backgroundColor" | "borderColor" | "borderCurve" | "borderBottomColor" | "borderEndColor" | "borderLeftColor" | "borderRightColor" | "borderStartColor" | "borderTopColor" | "borderBlockColor" | "borderBlockEndColor" | "borderBlockStartColor" | "borderRadius" | "borderBottomEndRadius" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStartRadius" | "borderEndEndRadius" | "borderEndStartRadius" | "borderStartEndRadius" | "borderStartStartRadius" | "borderTopEndRadius" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStartRadius" | "borderStyle" | "borderWidth" | "borderBottomWidth" | "borderEndWidth" | "borderLeftWidth" | "borderRightWidth" | "borderStartWidth" | "borderTopWidth" | "opacity" | "outlineColor" | "outlineOffset" | "outlineStyle" | "outlineWidth" | "elevation" | "pointerEvents" | "cursor" | "boxShadow" | "mixBlendMode" | "experimental_backgroundImage" | "experimental_backgroundSize" | "experimental_backgroundPosition" | "experimental_backgroundRepeat" | "isolation"> & Omit<Readonly<{
|
|
338
338
|
backfaceVisibility?: "visible" | "hidden";
|
|
339
339
|
backgroundColor?: import("react-native/types_generated/Libraries/StyleSheet/StyleSheetTypes").____ColorValue_Internal;
|
|
340
340
|
borderColor?: import("react-native/types_generated/Libraries/StyleSheet/StyleSheetTypes").____ColorValue_Internal;
|
|
@@ -133,7 +133,7 @@ export declare const Search: React.ForwardRefExoticComponent<Omit<Readonly<Omit<
|
|
|
133
133
|
pointerEvents?: ("auto" | "box-none" | "box-only" | "none") | undefined;
|
|
134
134
|
removeClippedSubviews?: boolean | undefined;
|
|
135
135
|
experimental_accessibilityOrder?: Array<string> | undefined;
|
|
136
|
-
}>, never>>, "style" | "experimental_accessibilityOrder">, "value" | "textAlign" | "style" | "onBlur" | "onFocus" | "lineBreakStrategyIOS" | "selectionColor" | "textBreakStrategy" | "allowFontScaling" | "maxFontSizeMultiplier" | "numberOfLines" | "
|
|
136
|
+
}>, never>>, "style" | "experimental_accessibilityOrder">, "value" | "textAlign" | "onChange" | "style" | "onBlur" | "onFocus" | "onPress" | "lineBreakStrategyIOS" | "selectionColor" | "textBreakStrategy" | "allowFontScaling" | "maxFontSizeMultiplier" | "numberOfLines" | "onPressIn" | "onPressOut" | "disableKeyboardShortcuts" | "clearButtonMode" | "clearTextOnFocus" | "dataDetectorTypes" | "enablesReturnKeyAutomatically" | "inputAccessoryViewID" | "inputAccessoryViewButtonLabel" | "keyboardAppearance" | "passwordRules" | "rejectResponderTermination" | "scrollEnabled" | "spellCheck" | "textContentType" | "lineBreakModeIOS" | "smartInsertDelete" | "cursorColor" | "selectionHandleColor" | "disableFullscreenUI" | "importantForAutofill" | "inlineImageLeft" | "inlineImagePadding" | "returnKeyLabel" | "rows" | "showSoftInputOnFocus" | "underlineColorAndroid" | "experimental_acceptDragAndDropTypes" | "autoCapitalize" | "autoComplete" | "autoCorrect" | "autoFocus" | "caretHidden" | "contextMenuHidden" | "defaultValue" | "editable" | "forwardedRef" | "enterKeyHint" | "inputMode" | "keyboardType" | "maxLength" | "multiline" | "onChangeText" | "onContentSizeChange" | "onEndEditing" | "onKeyPress" | "onSelectionChange" | "onSubmitEditing" | "onScroll" | "placeholder" | "placeholderTextColor" | "readOnly" | "returnKeyType" | "secureTextEntry" | "selection" | "selectTextOnFocus" | "blurOnSubmit" | "submitBehavior"> & Omit<Readonly<{
|
|
137
137
|
disableKeyboardShortcuts?: boolean | undefined;
|
|
138
138
|
clearButtonMode?: ("never" | "while-editing" | "unless-editing" | "always") | undefined;
|
|
139
139
|
clearTextOnFocus?: boolean | undefined;
|
|
@@ -150,7 +150,7 @@ export declare const Search: React.ForwardRefExoticComponent<Omit<Readonly<Omit<
|
|
|
150
150
|
lineBreakStrategyIOS?: ("none" | "standard" | "hangul-word" | "push-out") | undefined;
|
|
151
151
|
lineBreakModeIOS?: ("wordWrapping" | "char" | "clip" | "head" | "middle" | "tail") | undefined;
|
|
152
152
|
smartInsertDelete?: boolean | undefined;
|
|
153
|
-
}>, "value" | "textAlign" | "style" | "onBlur" | "onFocus" | "selectionColor" | "textBreakStrategy" | "allowFontScaling" | "maxFontSizeMultiplier" | "numberOfLines" | "
|
|
153
|
+
}>, "value" | "textAlign" | "onChange" | "style" | "onBlur" | "onFocus" | "onPress" | "selectionColor" | "textBreakStrategy" | "allowFontScaling" | "maxFontSizeMultiplier" | "numberOfLines" | "onPressIn" | "onPressOut" | "cursorColor" | "selectionHandleColor" | "disableFullscreenUI" | "importantForAutofill" | "inlineImageLeft" | "inlineImagePadding" | "returnKeyLabel" | "rows" | "showSoftInputOnFocus" | "underlineColorAndroid" | "experimental_acceptDragAndDropTypes" | "autoCapitalize" | "autoComplete" | "autoCorrect" | "autoFocus" | "caretHidden" | "contextMenuHidden" | "defaultValue" | "editable" | "forwardedRef" | "enterKeyHint" | "inputMode" | "keyboardType" | "maxLength" | "multiline" | "onChangeText" | "onContentSizeChange" | "onEndEditing" | "onKeyPress" | "onSelectionChange" | "onSubmitEditing" | "onScroll" | "placeholder" | "placeholderTextColor" | "readOnly" | "returnKeyType" | "secureTextEntry" | "selection" | "selectTextOnFocus" | "blurOnSubmit" | "submitBehavior"> & Omit<Readonly<{
|
|
154
154
|
cursorColor?: import("react-native").ColorValue | undefined;
|
|
155
155
|
selectionHandleColor?: import("react-native").ColorValue | undefined;
|
|
156
156
|
disableFullscreenUI?: boolean | undefined;
|
|
@@ -163,7 +163,7 @@ export declare const Search: React.ForwardRefExoticComponent<Omit<Readonly<Omit<
|
|
|
163
163
|
showSoftInputOnFocus?: boolean | undefined;
|
|
164
164
|
textBreakStrategy?: ("simple" | "highQuality" | "balanced") | undefined;
|
|
165
165
|
underlineColorAndroid?: import("react-native").ColorValue | undefined;
|
|
166
|
-
}>, "value" | "textAlign" | "style" | "onBlur" | "onFocus" | "
|
|
166
|
+
}>, "value" | "textAlign" | "onChange" | "style" | "onBlur" | "onFocus" | "onPress" | "selectionColor" | "allowFontScaling" | "maxFontSizeMultiplier" | "onPressIn" | "onPressOut" | "experimental_acceptDragAndDropTypes" | "autoCapitalize" | "autoComplete" | "autoCorrect" | "autoFocus" | "caretHidden" | "contextMenuHidden" | "defaultValue" | "editable" | "forwardedRef" | "enterKeyHint" | "inputMode" | "keyboardType" | "maxLength" | "multiline" | "onChangeText" | "onContentSizeChange" | "onEndEditing" | "onKeyPress" | "onSelectionChange" | "onSubmitEditing" | "onScroll" | "placeholder" | "placeholderTextColor" | "readOnly" | "returnKeyType" | "secureTextEntry" | "selection" | "selectTextOnFocus" | "blurOnSubmit" | "submitBehavior"> & Omit<Readonly<{
|
|
167
167
|
experimental_acceptDragAndDropTypes?: ReadonlyArray<string> | undefined;
|
|
168
168
|
autoCapitalize?: import("react-native").AutoCapitalize | undefined;
|
|
169
169
|
autoComplete?: ("additional-name" | "address-line1" | "address-line2" | "birthdate-day" | "birthdate-full" | "birthdate-month" | "birthdate-year" | "cc-csc" | "cc-exp" | "cc-exp-day" | "cc-exp-month" | "cc-exp-year" | "cc-number" | "cc-name" | "cc-given-name" | "cc-middle-name" | "cc-family-name" | "cc-type" | "country" | "current-password" | "email" | "family-name" | "gender" | "given-name" | "honorific-prefix" | "honorific-suffix" | "name" | "name-family" | "name-given" | "name-middle" | "name-middle-initial" | "name-prefix" | "name-suffix" | "new-password" | "nickname" | "one-time-code" | "organization" | "organization-title" | "password" | "password-new" | "postal-address" | "postal-address-country" | "postal-address-extended" | "postal-address-extended-postal-code" | "postal-address-locality" | "postal-address-region" | "postal-code" | "street-address" | "sms-otp" | "tel" | "tel-country-code" | "tel-national" | "tel-device" | "url" | "username" | "username-new" | "off") | undefined;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { SegmentedProps } from './types';
|
|
3
3
|
/**
|
|
4
|
-
* 局部分段控件 ——
|
|
4
|
+
* 局部分段控件 —— pill 在 track 上,激活项是亮色 thumb。
|
|
5
5
|
*
|
|
6
6
|
* **active thumb 必须比 track 亮一档** —— shadow 只在亮色态显示,
|
|
7
7
|
* 暗色态由 surface 明度差表达层级。
|
|
8
|
+
*
|
|
9
|
+
* `size`:默认 `'md'`(44pt 触控达标);`'sm'` 紧凑(28pt)给模型下拉等局促位用。
|
|
8
10
|
*/
|
|
9
|
-
export declare function Segmented({ value, onChange, items, disabled, testID, }: SegmentedProps): React.JSX.Element;
|
|
11
|
+
export declare function Segmented({ value, onChange, items, size, disabled, testID, }: SegmentedProps): React.JSX.Element;
|
|
10
12
|
//# sourceMappingURL=Segmented.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Segmented.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ui/Segmented/Segmented.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Segmented.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ui/Segmented/Segmented.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAMvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,QAAQ,EACR,KAAK,EACL,IAAW,EACX,QAAgB,EAChB,MAAM,GACP,EAAE,cAAc,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA+CpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ui/Segmented/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ui/Segmented/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { ColorTokens } from '../../../theme';
|
|
2
|
+
import type { SegmentedSize, SegmentedSizing } from './types';
|
|
3
|
+
/** Segmented 静态 base —— track chrome 与 item 居中/圆角(size-invariant)。
|
|
4
|
+
* 随 size 变化的 minHeight / paddingHorizontal / fontSize 由 sizingFor(size) 注入。 */
|
|
2
5
|
export declare const makeStyles: (c: ColorTokens) => Readonly<{
|
|
3
6
|
seg: {
|
|
4
7
|
flexDirection: "row";
|
|
@@ -8,14 +11,19 @@ export declare const makeStyles: (c: ColorTokens) => Readonly<{
|
|
|
8
11
|
alignSelf: "flex-start";
|
|
9
12
|
};
|
|
10
13
|
segItem: {
|
|
11
|
-
minHeight: 44;
|
|
12
|
-
paddingHorizontal: number;
|
|
13
14
|
alignItems: "center";
|
|
14
15
|
justifyContent: "center";
|
|
15
16
|
borderRadius: number;
|
|
16
17
|
};
|
|
17
|
-
segLabel: {
|
|
18
|
-
fontSize: number;
|
|
19
|
-
};
|
|
20
18
|
}>;
|
|
19
|
+
/** Segmented 尺寸推导:2 档 size → { minHeight, px, fs }。
|
|
20
|
+
* 新增 size 在 types.ts 扩 union + 这里加 case(与 Button.sizingFor 同范式)。
|
|
21
|
+
*
|
|
22
|
+
* [M-7] 触控目标:item 嵌在 seg track 内,hitSlop 不越父 track 边界
|
|
23
|
+
* (≠ Button/Chip 能向外补 hitSlop)→ 只能靠 item minHeight 自撑高 track。
|
|
24
|
+
* - md(默认):minHeight = fixed.hitTarget(44pt 物理常量),触控达标,行为同改前。
|
|
25
|
+
* - sm(紧凑):minHeight = SM_MIN_HEIGHT(28pt 物理常量),为模型下拉等局促位主动小一号,
|
|
26
|
+
* 接受 sub-44pt 触控(调用方按场景 opt-in);a11y role/state 不变。
|
|
27
|
+
* px / fs 走 scaled token(space/type),与 md 同基准 → sm 恒小于 md。 */
|
|
28
|
+
export declare function sizingFor(size: SegmentedSize): SegmentedSizing;
|
|
21
29
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ui/Segmented/styles.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ui/Segmented/styles.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAQ9D;gFACgF;AAChF,eAAO,MAAM,UAAU,GAAI,GAAG,WAAW;;;;;;;;;;;;;EAcrC,CAAC;AAEL;;;;;;;;+DAQ+D;AAC/D,wBAAgB,SAAS,CAAC,IAAI,EAAE,aAAa,GAAG,eAAe,CAO9D"}
|
|
@@ -1,12 +1,26 @@
|
|
|
1
1
|
import type { TabItem } from '../Tabs';
|
|
2
|
+
/** Segmented 尺寸:`md`=默认(达标 44pt 触控) / `sm`=紧凑(28pt,模型下拉等局促位)。 */
|
|
3
|
+
export type SegmentedSize = 'sm' | 'md';
|
|
2
4
|
/** Segmented 与 Tabs 共用 item 形状;命名独立以表达控件意图差异。 */
|
|
3
5
|
export type SegmentedProps = {
|
|
4
6
|
value: string;
|
|
5
7
|
onChange: (id: string) => void;
|
|
6
8
|
items: TabItem[];
|
|
9
|
+
/** 尺寸,默认 `'md'`。`'sm'` 给模型下拉等局促位用——更小,触控 < 44pt(见 styles.sizingFor) */
|
|
10
|
+
size?: SegmentedSize;
|
|
7
11
|
/** [L-82] 整体禁用 —— 所有 item 不可点击,a11y state 同步 */
|
|
8
12
|
disabled?: boolean;
|
|
9
13
|
/** 容器 testID;item testID 自动派生为 `${testID}-${id}` */
|
|
10
14
|
testID?: string;
|
|
11
15
|
};
|
|
16
|
+
/** sizingFor(size) 的返回:Segmented item 随 size 变化的 3 个量。
|
|
17
|
+
* 形状只取 Segmented 实际可变的维度(圆角固定 radius.sm、item 间无 gap,故无 br/gap)。 */
|
|
18
|
+
export type SegmentedSizing = {
|
|
19
|
+
/** item 最小高度(撑起 track 高度;也是触控目标——见 sizingFor 的 [M-7] 注释) */
|
|
20
|
+
minHeight: number;
|
|
21
|
+
/** item 水平 padding */
|
|
22
|
+
px: number;
|
|
23
|
+
/** label 字号 */
|
|
24
|
+
fs: number;
|
|
25
|
+
};
|
|
12
26
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ui/Segmented/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEvC,iDAAiD;AACjD,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,gDAAgD;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oDAAoD;IACpD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ui/Segmented/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEvC,iEAAiE;AACjE,MAAM,MAAM,aAAa,GAAG,IAAI,GAAG,IAAI,CAAC;AAExC,iDAAiD;AACjD,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,uEAAuE;IACvE,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,gDAAgD;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oDAAoD;IACpD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;oEACoE;AACpE,MAAM,MAAM,eAAe,GAAG;IAC5B,4DAA4D;IAC5D,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,eAAe;IACf,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC"}
|
|
@@ -144,7 +144,7 @@ export declare const TextFieldBase: React.ForwardRefExoticComponent<Readonly<Omi
|
|
|
144
144
|
pointerEvents?: ("auto" | "box-none" | "box-only" | "none") | undefined;
|
|
145
145
|
removeClippedSubviews?: boolean | undefined;
|
|
146
146
|
experimental_accessibilityOrder?: Array<string> | undefined;
|
|
147
|
-
}>, never>>, "style" | "experimental_accessibilityOrder">, "value" | "textAlign" | "style" | "onBlur" | "onFocus" | "lineBreakStrategyIOS" | "selectionColor" | "textBreakStrategy" | "allowFontScaling" | "maxFontSizeMultiplier" | "numberOfLines" | "
|
|
147
|
+
}>, never>>, "style" | "experimental_accessibilityOrder">, "value" | "textAlign" | "onChange" | "style" | "onBlur" | "onFocus" | "onPress" | "lineBreakStrategyIOS" | "selectionColor" | "textBreakStrategy" | "allowFontScaling" | "maxFontSizeMultiplier" | "numberOfLines" | "onPressIn" | "onPressOut" | "disableKeyboardShortcuts" | "clearButtonMode" | "clearTextOnFocus" | "dataDetectorTypes" | "enablesReturnKeyAutomatically" | "inputAccessoryViewID" | "inputAccessoryViewButtonLabel" | "keyboardAppearance" | "passwordRules" | "rejectResponderTermination" | "scrollEnabled" | "spellCheck" | "textContentType" | "lineBreakModeIOS" | "smartInsertDelete" | "cursorColor" | "selectionHandleColor" | "disableFullscreenUI" | "importantForAutofill" | "inlineImageLeft" | "inlineImagePadding" | "returnKeyLabel" | "rows" | "showSoftInputOnFocus" | "underlineColorAndroid" | "experimental_acceptDragAndDropTypes" | "autoCapitalize" | "autoComplete" | "autoCorrect" | "autoFocus" | "caretHidden" | "contextMenuHidden" | "defaultValue" | "editable" | "forwardedRef" | "enterKeyHint" | "inputMode" | "keyboardType" | "maxLength" | "multiline" | "onChangeText" | "onContentSizeChange" | "onEndEditing" | "onKeyPress" | "onSelectionChange" | "onSubmitEditing" | "onScroll" | "placeholder" | "placeholderTextColor" | "readOnly" | "returnKeyType" | "secureTextEntry" | "selection" | "selectTextOnFocus" | "blurOnSubmit" | "submitBehavior"> & Omit<Readonly<{
|
|
148
148
|
disableKeyboardShortcuts?: boolean | undefined;
|
|
149
149
|
clearButtonMode?: ("never" | "while-editing" | "unless-editing" | "always") | undefined;
|
|
150
150
|
clearTextOnFocus?: boolean | undefined;
|
|
@@ -161,7 +161,7 @@ export declare const TextFieldBase: React.ForwardRefExoticComponent<Readonly<Omi
|
|
|
161
161
|
lineBreakStrategyIOS?: ("none" | "standard" | "hangul-word" | "push-out") | undefined;
|
|
162
162
|
lineBreakModeIOS?: ("wordWrapping" | "char" | "clip" | "head" | "middle" | "tail") | undefined;
|
|
163
163
|
smartInsertDelete?: boolean | undefined;
|
|
164
|
-
}>, "value" | "textAlign" | "style" | "onBlur" | "onFocus" | "selectionColor" | "textBreakStrategy" | "allowFontScaling" | "maxFontSizeMultiplier" | "numberOfLines" | "
|
|
164
|
+
}>, "value" | "textAlign" | "onChange" | "style" | "onBlur" | "onFocus" | "onPress" | "selectionColor" | "textBreakStrategy" | "allowFontScaling" | "maxFontSizeMultiplier" | "numberOfLines" | "onPressIn" | "onPressOut" | "cursorColor" | "selectionHandleColor" | "disableFullscreenUI" | "importantForAutofill" | "inlineImageLeft" | "inlineImagePadding" | "returnKeyLabel" | "rows" | "showSoftInputOnFocus" | "underlineColorAndroid" | "experimental_acceptDragAndDropTypes" | "autoCapitalize" | "autoComplete" | "autoCorrect" | "autoFocus" | "caretHidden" | "contextMenuHidden" | "defaultValue" | "editable" | "forwardedRef" | "enterKeyHint" | "inputMode" | "keyboardType" | "maxLength" | "multiline" | "onChangeText" | "onContentSizeChange" | "onEndEditing" | "onKeyPress" | "onSelectionChange" | "onSubmitEditing" | "onScroll" | "placeholder" | "placeholderTextColor" | "readOnly" | "returnKeyType" | "secureTextEntry" | "selection" | "selectTextOnFocus" | "blurOnSubmit" | "submitBehavior"> & Omit<Readonly<{
|
|
165
165
|
cursorColor?: import("react-native").ColorValue | undefined;
|
|
166
166
|
selectionHandleColor?: import("react-native").ColorValue | undefined;
|
|
167
167
|
disableFullscreenUI?: boolean | undefined;
|
|
@@ -174,7 +174,7 @@ export declare const TextFieldBase: React.ForwardRefExoticComponent<Readonly<Omi
|
|
|
174
174
|
showSoftInputOnFocus?: boolean | undefined;
|
|
175
175
|
textBreakStrategy?: ("simple" | "highQuality" | "balanced") | undefined;
|
|
176
176
|
underlineColorAndroid?: import("react-native").ColorValue | undefined;
|
|
177
|
-
}>, "value" | "textAlign" | "style" | "onBlur" | "onFocus" | "
|
|
177
|
+
}>, "value" | "textAlign" | "onChange" | "style" | "onBlur" | "onFocus" | "onPress" | "selectionColor" | "allowFontScaling" | "maxFontSizeMultiplier" | "onPressIn" | "onPressOut" | "experimental_acceptDragAndDropTypes" | "autoCapitalize" | "autoComplete" | "autoCorrect" | "autoFocus" | "caretHidden" | "contextMenuHidden" | "defaultValue" | "editable" | "forwardedRef" | "enterKeyHint" | "inputMode" | "keyboardType" | "maxLength" | "multiline" | "onChangeText" | "onContentSizeChange" | "onEndEditing" | "onKeyPress" | "onSelectionChange" | "onSubmitEditing" | "onScroll" | "placeholder" | "placeholderTextColor" | "readOnly" | "returnKeyType" | "secureTextEntry" | "selection" | "selectTextOnFocus" | "blurOnSubmit" | "submitBehavior"> & Omit<Readonly<{
|
|
178
178
|
experimental_acceptDragAndDropTypes?: ReadonlyArray<string> | undefined;
|
|
179
179
|
autoCapitalize?: import("react-native").AutoCapitalize | undefined;
|
|
180
180
|
autoComplete?: ("additional-name" | "address-line1" | "address-line2" | "birthdate-day" | "birthdate-full" | "birthdate-month" | "birthdate-year" | "cc-csc" | "cc-exp" | "cc-exp-day" | "cc-exp-month" | "cc-exp-year" | "cc-number" | "cc-name" | "cc-given-name" | "cc-middle-name" | "cc-family-name" | "cc-type" | "country" | "current-password" | "email" | "family-name" | "gender" | "given-name" | "honorific-prefix" | "honorific-suffix" | "name" | "name-family" | "name-given" | "name-middle" | "name-middle-initial" | "name-prefix" | "name-suffix" | "new-password" | "nickname" | "one-time-code" | "organization" | "organization-title" | "password" | "password-new" | "postal-address" | "postal-address-country" | "postal-address-extended" | "postal-address-extended-postal-code" | "postal-address-locality" | "postal-address-region" | "postal-code" | "street-address" | "sms-otp" | "tel" | "tel-country-code" | "tel-national" | "tel-device" | "url" | "username" | "username-new" | "off") | undefined;
|
|
@@ -307,7 +307,7 @@ export declare const TextFieldBase: React.ForwardRefExoticComponent<Readonly<Omi
|
|
|
307
307
|
rowGap?: number | string;
|
|
308
308
|
columnGap?: number | string;
|
|
309
309
|
gap?: number | string;
|
|
310
|
-
}>, "filter" | "
|
|
310
|
+
}>, "filter" | "shadowColor" | "shadowOffset" | "shadowOpacity" | "shadowRadius" | "transform" | "transformOrigin" | "backfaceVisibility" | "backgroundColor" | "borderColor" | "borderCurve" | "borderBottomColor" | "borderEndColor" | "borderLeftColor" | "borderRightColor" | "borderStartColor" | "borderTopColor" | "borderBlockColor" | "borderBlockEndColor" | "borderBlockStartColor" | "borderRadius" | "borderBottomEndRadius" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStartRadius" | "borderEndEndRadius" | "borderEndStartRadius" | "borderStartEndRadius" | "borderStartStartRadius" | "borderTopEndRadius" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStartRadius" | "borderStyle" | "borderWidth" | "borderBottomWidth" | "borderEndWidth" | "borderLeftWidth" | "borderRightWidth" | "borderStartWidth" | "borderTopWidth" | "opacity" | "outlineColor" | "outlineOffset" | "outlineStyle" | "outlineWidth" | "elevation" | "pointerEvents" | "cursor" | "boxShadow" | "mixBlendMode" | "experimental_backgroundImage" | "experimental_backgroundSize" | "experimental_backgroundPosition" | "experimental_backgroundRepeat" | "isolation"> & Omit<Readonly<Omit<Readonly<{
|
|
311
311
|
shadowColor?: import("react-native/types_generated/Libraries/StyleSheet/StyleSheetTypes").____ColorValue_Internal;
|
|
312
312
|
shadowOffset?: Readonly<{
|
|
313
313
|
width?: number;
|
|
@@ -315,7 +315,7 @@ export declare const TextFieldBase: React.ForwardRefExoticComponent<Readonly<Omi
|
|
|
315
315
|
}>;
|
|
316
316
|
shadowOpacity?: number;
|
|
317
317
|
shadowRadius?: number;
|
|
318
|
-
}>, never> & Omit<Readonly<{}>, never>>, "filter" | "
|
|
318
|
+
}>, never> & Omit<Readonly<{}>, never>>, "filter" | "transform" | "transformOrigin" | "backfaceVisibility" | "backgroundColor" | "borderColor" | "borderCurve" | "borderBottomColor" | "borderEndColor" | "borderLeftColor" | "borderRightColor" | "borderStartColor" | "borderTopColor" | "borderBlockColor" | "borderBlockEndColor" | "borderBlockStartColor" | "borderRadius" | "borderBottomEndRadius" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStartRadius" | "borderEndEndRadius" | "borderEndStartRadius" | "borderStartEndRadius" | "borderStartStartRadius" | "borderTopEndRadius" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStartRadius" | "borderStyle" | "borderWidth" | "borderBottomWidth" | "borderEndWidth" | "borderLeftWidth" | "borderRightWidth" | "borderStartWidth" | "borderTopWidth" | "opacity" | "outlineColor" | "outlineOffset" | "outlineStyle" | "outlineWidth" | "elevation" | "pointerEvents" | "cursor" | "boxShadow" | "mixBlendMode" | "experimental_backgroundImage" | "experimental_backgroundSize" | "experimental_backgroundPosition" | "experimental_backgroundRepeat" | "isolation"> & Omit<Readonly<{
|
|
319
319
|
transform?: ReadonlyArray<Readonly<import("react-native/types_generated/Libraries/StyleSheet/private/_TransformStyle").MaximumOneOf<import("react-native/types_generated/Libraries/StyleSheet/private/_TransformStyle").MergeUnion<{
|
|
320
320
|
readonly perspective: number | import("react-native/types_generated/Libraries/Animated/AnimatedExports").Node;
|
|
321
321
|
} | {
|
|
@@ -346,7 +346,7 @@ export declare const TextFieldBase: React.ForwardRefExoticComponent<Readonly<Omi
|
|
|
346
346
|
readonly matrix: ReadonlyArray<number | import("react-native/types_generated/Libraries/Animated/AnimatedExports").Node> | import("react-native/types_generated/Libraries/Animated/AnimatedExports").Node;
|
|
347
347
|
}>>>> | string;
|
|
348
348
|
transformOrigin?: [string | number, string | number, string | number] | string;
|
|
349
|
-
}>, "filter" | "
|
|
349
|
+
}>, "filter" | "backfaceVisibility" | "backgroundColor" | "borderColor" | "borderCurve" | "borderBottomColor" | "borderEndColor" | "borderLeftColor" | "borderRightColor" | "borderStartColor" | "borderTopColor" | "borderBlockColor" | "borderBlockEndColor" | "borderBlockStartColor" | "borderRadius" | "borderBottomEndRadius" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStartRadius" | "borderEndEndRadius" | "borderEndStartRadius" | "borderStartEndRadius" | "borderStartStartRadius" | "borderTopEndRadius" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStartRadius" | "borderStyle" | "borderWidth" | "borderBottomWidth" | "borderEndWidth" | "borderLeftWidth" | "borderRightWidth" | "borderStartWidth" | "borderTopWidth" | "opacity" | "outlineColor" | "outlineOffset" | "outlineStyle" | "outlineWidth" | "elevation" | "pointerEvents" | "cursor" | "boxShadow" | "mixBlendMode" | "experimental_backgroundImage" | "experimental_backgroundSize" | "experimental_backgroundPosition" | "experimental_backgroundRepeat" | "isolation"> & Omit<Readonly<{
|
|
350
350
|
backfaceVisibility?: "visible" | "hidden";
|
|
351
351
|
backgroundColor?: import("react-native/types_generated/Libraries/StyleSheet/StyleSheetTypes").____ColorValue_Internal;
|
|
352
352
|
borderColor?: import("react-native/types_generated/Libraries/StyleSheet/StyleSheetTypes").____ColorValue_Internal;
|
|
@@ -138,7 +138,7 @@ export declare const Textarea: import("react").ForwardRefExoticComponent<Omit<Re
|
|
|
138
138
|
pointerEvents?: ("auto" | "box-none" | "box-only" | "none") | undefined;
|
|
139
139
|
removeClippedSubviews?: boolean | undefined;
|
|
140
140
|
experimental_accessibilityOrder?: Array<string> | undefined;
|
|
141
|
-
}>, never>>, "style" | "experimental_accessibilityOrder">, "value" | "textAlign" | "style" | "onBlur" | "onFocus" | "lineBreakStrategyIOS" | "selectionColor" | "textBreakStrategy" | "allowFontScaling" | "maxFontSizeMultiplier" | "numberOfLines" | "
|
|
141
|
+
}>, never>>, "style" | "experimental_accessibilityOrder">, "value" | "textAlign" | "onChange" | "style" | "onBlur" | "onFocus" | "onPress" | "lineBreakStrategyIOS" | "selectionColor" | "textBreakStrategy" | "allowFontScaling" | "maxFontSizeMultiplier" | "numberOfLines" | "onPressIn" | "onPressOut" | "disableKeyboardShortcuts" | "clearButtonMode" | "clearTextOnFocus" | "dataDetectorTypes" | "enablesReturnKeyAutomatically" | "inputAccessoryViewID" | "inputAccessoryViewButtonLabel" | "keyboardAppearance" | "passwordRules" | "rejectResponderTermination" | "scrollEnabled" | "spellCheck" | "textContentType" | "lineBreakModeIOS" | "smartInsertDelete" | "cursorColor" | "selectionHandleColor" | "disableFullscreenUI" | "importantForAutofill" | "inlineImageLeft" | "inlineImagePadding" | "returnKeyLabel" | "rows" | "showSoftInputOnFocus" | "underlineColorAndroid" | "experimental_acceptDragAndDropTypes" | "autoCapitalize" | "autoComplete" | "autoCorrect" | "autoFocus" | "caretHidden" | "contextMenuHidden" | "defaultValue" | "editable" | "forwardedRef" | "enterKeyHint" | "inputMode" | "keyboardType" | "maxLength" | "multiline" | "onChangeText" | "onContentSizeChange" | "onEndEditing" | "onKeyPress" | "onSelectionChange" | "onSubmitEditing" | "onScroll" | "placeholder" | "placeholderTextColor" | "readOnly" | "returnKeyType" | "secureTextEntry" | "selection" | "selectTextOnFocus" | "blurOnSubmit" | "submitBehavior"> & Omit<Readonly<{
|
|
142
142
|
disableKeyboardShortcuts?: boolean | undefined;
|
|
143
143
|
clearButtonMode?: ("never" | "while-editing" | "unless-editing" | "always") | undefined;
|
|
144
144
|
clearTextOnFocus?: boolean | undefined;
|
|
@@ -155,7 +155,7 @@ export declare const Textarea: import("react").ForwardRefExoticComponent<Omit<Re
|
|
|
155
155
|
lineBreakStrategyIOS?: ("none" | "standard" | "hangul-word" | "push-out") | undefined;
|
|
156
156
|
lineBreakModeIOS?: ("wordWrapping" | "char" | "clip" | "head" | "middle" | "tail") | undefined;
|
|
157
157
|
smartInsertDelete?: boolean | undefined;
|
|
158
|
-
}>, "value" | "textAlign" | "style" | "onBlur" | "onFocus" | "selectionColor" | "textBreakStrategy" | "allowFontScaling" | "maxFontSizeMultiplier" | "numberOfLines" | "
|
|
158
|
+
}>, "value" | "textAlign" | "onChange" | "style" | "onBlur" | "onFocus" | "onPress" | "selectionColor" | "textBreakStrategy" | "allowFontScaling" | "maxFontSizeMultiplier" | "numberOfLines" | "onPressIn" | "onPressOut" | "cursorColor" | "selectionHandleColor" | "disableFullscreenUI" | "importantForAutofill" | "inlineImageLeft" | "inlineImagePadding" | "returnKeyLabel" | "rows" | "showSoftInputOnFocus" | "underlineColorAndroid" | "experimental_acceptDragAndDropTypes" | "autoCapitalize" | "autoComplete" | "autoCorrect" | "autoFocus" | "caretHidden" | "contextMenuHidden" | "defaultValue" | "editable" | "forwardedRef" | "enterKeyHint" | "inputMode" | "keyboardType" | "maxLength" | "multiline" | "onChangeText" | "onContentSizeChange" | "onEndEditing" | "onKeyPress" | "onSelectionChange" | "onSubmitEditing" | "onScroll" | "placeholder" | "placeholderTextColor" | "readOnly" | "returnKeyType" | "secureTextEntry" | "selection" | "selectTextOnFocus" | "blurOnSubmit" | "submitBehavior"> & Omit<Readonly<{
|
|
159
159
|
cursorColor?: import("react-native").ColorValue | undefined;
|
|
160
160
|
selectionHandleColor?: import("react-native").ColorValue | undefined;
|
|
161
161
|
disableFullscreenUI?: boolean | undefined;
|
|
@@ -168,7 +168,7 @@ export declare const Textarea: import("react").ForwardRefExoticComponent<Omit<Re
|
|
|
168
168
|
showSoftInputOnFocus?: boolean | undefined;
|
|
169
169
|
textBreakStrategy?: ("simple" | "highQuality" | "balanced") | undefined;
|
|
170
170
|
underlineColorAndroid?: import("react-native").ColorValue | undefined;
|
|
171
|
-
}>, "value" | "textAlign" | "style" | "onBlur" | "onFocus" | "
|
|
171
|
+
}>, "value" | "textAlign" | "onChange" | "style" | "onBlur" | "onFocus" | "onPress" | "selectionColor" | "allowFontScaling" | "maxFontSizeMultiplier" | "onPressIn" | "onPressOut" | "experimental_acceptDragAndDropTypes" | "autoCapitalize" | "autoComplete" | "autoCorrect" | "autoFocus" | "caretHidden" | "contextMenuHidden" | "defaultValue" | "editable" | "forwardedRef" | "enterKeyHint" | "inputMode" | "keyboardType" | "maxLength" | "multiline" | "onChangeText" | "onContentSizeChange" | "onEndEditing" | "onKeyPress" | "onSelectionChange" | "onSubmitEditing" | "onScroll" | "placeholder" | "placeholderTextColor" | "readOnly" | "returnKeyType" | "secureTextEntry" | "selection" | "selectTextOnFocus" | "blurOnSubmit" | "submitBehavior"> & Omit<Readonly<{
|
|
172
172
|
experimental_acceptDragAndDropTypes?: ReadonlyArray<string> | undefined;
|
|
173
173
|
autoCapitalize?: import("react-native").AutoCapitalize | undefined;
|
|
174
174
|
autoComplete?: ("additional-name" | "address-line1" | "address-line2" | "birthdate-day" | "birthdate-full" | "birthdate-month" | "birthdate-year" | "cc-csc" | "cc-exp" | "cc-exp-day" | "cc-exp-month" | "cc-exp-year" | "cc-number" | "cc-name" | "cc-given-name" | "cc-middle-name" | "cc-family-name" | "cc-type" | "country" | "current-password" | "email" | "family-name" | "gender" | "given-name" | "honorific-prefix" | "honorific-suffix" | "name" | "name-family" | "name-given" | "name-middle" | "name-middle-initial" | "name-prefix" | "name-suffix" | "new-password" | "nickname" | "one-time-code" | "organization" | "organization-title" | "password" | "password-new" | "postal-address" | "postal-address-country" | "postal-address-extended" | "postal-address-extended-postal-code" | "postal-address-locality" | "postal-address-region" | "postal-code" | "street-address" | "sms-otp" | "tel" | "tel-country-code" | "tel-national" | "tel-device" | "url" | "username" | "username-new" | "off") | undefined;
|
|
@@ -298,7 +298,7 @@ export declare const Textarea: import("react").ForwardRefExoticComponent<Omit<Re
|
|
|
298
298
|
rowGap?: number | string;
|
|
299
299
|
columnGap?: number | string;
|
|
300
300
|
gap?: number | string;
|
|
301
|
-
}>, "filter" | "
|
|
301
|
+
}>, "filter" | "shadowColor" | "shadowOffset" | "shadowOpacity" | "shadowRadius" | "transform" | "transformOrigin" | "backfaceVisibility" | "backgroundColor" | "borderColor" | "borderCurve" | "borderBottomColor" | "borderEndColor" | "borderLeftColor" | "borderRightColor" | "borderStartColor" | "borderTopColor" | "borderBlockColor" | "borderBlockEndColor" | "borderBlockStartColor" | "borderRadius" | "borderBottomEndRadius" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStartRadius" | "borderEndEndRadius" | "borderEndStartRadius" | "borderStartEndRadius" | "borderStartStartRadius" | "borderTopEndRadius" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStartRadius" | "borderStyle" | "borderWidth" | "borderBottomWidth" | "borderEndWidth" | "borderLeftWidth" | "borderRightWidth" | "borderStartWidth" | "borderTopWidth" | "opacity" | "outlineColor" | "outlineOffset" | "outlineStyle" | "outlineWidth" | "elevation" | "pointerEvents" | "cursor" | "boxShadow" | "mixBlendMode" | "experimental_backgroundImage" | "experimental_backgroundSize" | "experimental_backgroundPosition" | "experimental_backgroundRepeat" | "isolation"> & Omit<Readonly<Omit<Readonly<{
|
|
302
302
|
shadowColor?: import("react-native/types_generated/Libraries/StyleSheet/StyleSheetTypes").____ColorValue_Internal;
|
|
303
303
|
shadowOffset?: Readonly<{
|
|
304
304
|
width?: number;
|
|
@@ -306,7 +306,7 @@ export declare const Textarea: import("react").ForwardRefExoticComponent<Omit<Re
|
|
|
306
306
|
}>;
|
|
307
307
|
shadowOpacity?: number;
|
|
308
308
|
shadowRadius?: number;
|
|
309
|
-
}>, never> & Omit<Readonly<{}>, never>>, "filter" | "
|
|
309
|
+
}>, never> & Omit<Readonly<{}>, never>>, "filter" | "transform" | "transformOrigin" | "backfaceVisibility" | "backgroundColor" | "borderColor" | "borderCurve" | "borderBottomColor" | "borderEndColor" | "borderLeftColor" | "borderRightColor" | "borderStartColor" | "borderTopColor" | "borderBlockColor" | "borderBlockEndColor" | "borderBlockStartColor" | "borderRadius" | "borderBottomEndRadius" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStartRadius" | "borderEndEndRadius" | "borderEndStartRadius" | "borderStartEndRadius" | "borderStartStartRadius" | "borderTopEndRadius" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStartRadius" | "borderStyle" | "borderWidth" | "borderBottomWidth" | "borderEndWidth" | "borderLeftWidth" | "borderRightWidth" | "borderStartWidth" | "borderTopWidth" | "opacity" | "outlineColor" | "outlineOffset" | "outlineStyle" | "outlineWidth" | "elevation" | "pointerEvents" | "cursor" | "boxShadow" | "mixBlendMode" | "experimental_backgroundImage" | "experimental_backgroundSize" | "experimental_backgroundPosition" | "experimental_backgroundRepeat" | "isolation"> & Omit<Readonly<{
|
|
310
310
|
transform?: ReadonlyArray<Readonly<import("react-native/types_generated/Libraries/StyleSheet/private/_TransformStyle").MaximumOneOf<import("react-native/types_generated/Libraries/StyleSheet/private/_TransformStyle").MergeUnion<{
|
|
311
311
|
readonly perspective: number | import("react-native/types_generated/Libraries/Animated/AnimatedExports").Node;
|
|
312
312
|
} | {
|
|
@@ -337,7 +337,7 @@ export declare const Textarea: import("react").ForwardRefExoticComponent<Omit<Re
|
|
|
337
337
|
readonly matrix: ReadonlyArray<number | import("react-native/types_generated/Libraries/Animated/AnimatedExports").Node> | import("react-native/types_generated/Libraries/Animated/AnimatedExports").Node;
|
|
338
338
|
}>>>> | string;
|
|
339
339
|
transformOrigin?: [string | number, string | number, string | number] | string;
|
|
340
|
-
}>, "filter" | "
|
|
340
|
+
}>, "filter" | "backfaceVisibility" | "backgroundColor" | "borderColor" | "borderCurve" | "borderBottomColor" | "borderEndColor" | "borderLeftColor" | "borderRightColor" | "borderStartColor" | "borderTopColor" | "borderBlockColor" | "borderBlockEndColor" | "borderBlockStartColor" | "borderRadius" | "borderBottomEndRadius" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStartRadius" | "borderEndEndRadius" | "borderEndStartRadius" | "borderStartEndRadius" | "borderStartStartRadius" | "borderTopEndRadius" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStartRadius" | "borderStyle" | "borderWidth" | "borderBottomWidth" | "borderEndWidth" | "borderLeftWidth" | "borderRightWidth" | "borderStartWidth" | "borderTopWidth" | "opacity" | "outlineColor" | "outlineOffset" | "outlineStyle" | "outlineWidth" | "elevation" | "pointerEvents" | "cursor" | "boxShadow" | "mixBlendMode" | "experimental_backgroundImage" | "experimental_backgroundSize" | "experimental_backgroundPosition" | "experimental_backgroundRepeat" | "isolation"> & Omit<Readonly<{
|
|
341
341
|
backfaceVisibility?: "visible" | "hidden";
|
|
342
342
|
backgroundColor?: import("react-native/types_generated/Libraries/StyleSheet/StyleSheetTypes").____ColorValue_Internal;
|
|
343
343
|
borderColor?: import("react-native/types_generated/Libraries/StyleSheet/StyleSheetTypes").____ColorValue_Internal;
|
|
@@ -49,7 +49,7 @@ export type { SearchProps } from './Search';
|
|
|
49
49
|
export { Skeleton } from './Skeleton';
|
|
50
50
|
export type { SkeletonProps, SkeletonShape } from './Skeleton';
|
|
51
51
|
export { Segmented } from './Segmented';
|
|
52
|
-
export type { SegmentedProps } from './Segmented';
|
|
52
|
+
export type { SegmentedProps, SegmentedSize } from './Segmented';
|
|
53
53
|
export { Spinner } from './Spinner';
|
|
54
54
|
export type { SpinnerProps } from './Spinner';
|
|
55
55
|
export { StatusDot } from './StatusDot';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACvE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACpC,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACjD,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,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,eAAe,EACf,aAAa,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC3C,YAAY,EACV,UAAU,EACV,cAAc,EACd,UAAU,EACV,SAAS,EACT,aAAa,GACd,MAAM,SAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Animated,
|
|
4
|
+
Easing,
|
|
5
|
+
Modal,
|
|
6
|
+
Pressable,
|
|
7
|
+
Text,
|
|
8
|
+
View,
|
|
9
|
+
useWindowDimensions,
|
|
10
|
+
} from 'react-native';
|
|
3
11
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
12
|
import { space, useThemedStyles } from '../../../theme';
|
|
5
13
|
import { Button } from '../Button';
|
|
@@ -7,6 +15,10 @@ import { _subs } from './confirm';
|
|
|
7
15
|
import { makeStyles } from './styles';
|
|
8
16
|
import type { ConfirmEntry, Subscriber } from './types';
|
|
9
17
|
|
|
18
|
+
/** 遮罩淡入 / 淡出时长(ms)—— 出场略长于入场,与 Modal slide 退场(~300ms)大致同步收完。 */
|
|
19
|
+
const SCRIM_IN_MS = 220;
|
|
20
|
+
const SCRIM_OUT_MS = 260;
|
|
21
|
+
|
|
10
22
|
/**
|
|
11
23
|
* Confirm 对话框宿主 —— App 根挂一次,监听 `confirm()` 调用并渲染。
|
|
12
24
|
*
|
|
@@ -17,6 +29,7 @@ import type { ConfirmEntry, Subscriber } from './types';
|
|
|
17
29
|
export function ConfirmHost(): React.JSX.Element | null {
|
|
18
30
|
const styles = useThemedStyles(makeStyles);
|
|
19
31
|
const insets = useSafeAreaInsets();
|
|
32
|
+
const { height: screenH } = useWindowDimensions();
|
|
20
33
|
const [entry, setEntry] = useState<ConfirmEntry | null>(null);
|
|
21
34
|
|
|
22
35
|
// 跟踪当前未决 entry,供 unmount cleanup resolve(false)。
|
|
@@ -51,6 +64,18 @@ export function ConfirmHost(): React.JSX.Element | null {
|
|
|
51
64
|
setEntry(null);
|
|
52
65
|
}, [entry]);
|
|
53
66
|
|
|
67
|
+
// 遮罩自持淡入 / 淡出(不蹭 Modal 的位移动画,理由见下方 scrim 注释)。退场也要淡:
|
|
68
|
+
// entry 置 null 后 Modal 仍在滑出、本层仍挂载,不淡的话遮罩会在滑出末尾硬切消失。
|
|
69
|
+
const scrimOpacity = useRef(new Animated.Value(0)).current;
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
Animated.timing(scrimOpacity, {
|
|
72
|
+
toValue: entry ? 1 : 0,
|
|
73
|
+
duration: entry ? SCRIM_IN_MS : SCRIM_OUT_MS,
|
|
74
|
+
easing: Easing.out(Easing.quad),
|
|
75
|
+
useNativeDriver: true,
|
|
76
|
+
}).start();
|
|
77
|
+
}, [entry, scrimOpacity]);
|
|
78
|
+
|
|
54
79
|
return (
|
|
55
80
|
<Modal
|
|
56
81
|
visible={!!entry}
|
|
@@ -67,6 +92,18 @@ export function ConfirmHost(): React.JSX.Element | null {
|
|
|
67
92
|
// 遮蔽 sheet 内的 title/message/按钮。SR 取消路径走 cancel 按钮 + onRequestClose。
|
|
68
93
|
accessible={false}
|
|
69
94
|
>
|
|
95
|
+
{/* 半透黑遮罩 —— 两点都是必需的,少一点就露白:
|
|
96
|
+
① **向上外扩一屏**:animationType="slide" 位移的是 Modal 的**整个容器**(遮罩也在其中),
|
|
97
|
+
位移 t 时屏幕 [0, t) 这段根本没有遮罩 —— 顶部挂着一条未压暗的白带,一路缩到动画
|
|
98
|
+
结束才没(缓出末段最慢,细白带在状态栏那儿赖得最久)。外扩后任意 t 都盖满视口。
|
|
99
|
+
② **自持淡入淡出**:外扩解决了「盖不到」,但遮罩会随容器一起硬切出现 —— 故不蹭容器的
|
|
100
|
+
位移动画,自己走 opacity。sheet 的 slide 仍由 Modal 原生驱动。
|
|
101
|
+
pointerEvents=none:点击穿透到 backdrop(取消路径不变)。 */}
|
|
102
|
+
<Animated.View
|
|
103
|
+
pointerEvents="none"
|
|
104
|
+
style={[styles.scrim, { top: -screenH, opacity: scrimOpacity }]}
|
|
105
|
+
testID="confirm-scrim"
|
|
106
|
+
/>
|
|
70
107
|
<Pressable
|
|
71
108
|
style={[styles.sheet, { paddingBottom: insets.bottom + space['7'] }]}
|
|
72
109
|
onPress={() => {}}
|
|
@@ -3,14 +3,24 @@ import { fw, r, space, type as t } from '../../../theme';
|
|
|
3
3
|
import type { ColorTokens } from '../../../theme';
|
|
4
4
|
|
|
5
5
|
/** Confirm 对话框 styles —— 原生 Modal(transparent + slide)底部弹出卡片:
|
|
6
|
-
* backdrop
|
|
6
|
+
* backdrop 铺满、点击取消(**不挂半透黑** —— 见 ConfirmHost 的 scrim 注释);
|
|
7
|
+
* scrim 半透黑独立一层;sheet 贴底圆角顶。不依赖 @gorhom。 */
|
|
7
8
|
export const makeStyles = (c: ColorTokens) =>
|
|
8
9
|
StyleSheet.create({
|
|
9
10
|
backdrop: {
|
|
10
11
|
flex: 1,
|
|
11
|
-
backgroundColor: c.scrim,
|
|
12
12
|
justifyContent: 'flex-end',
|
|
13
13
|
},
|
|
14
|
+
// 半透黑遮罩层(纯视觉,不接触控):绝对定位四边贴合 backdrop,`top` 由 ConfirmHost 内联
|
|
15
|
+
// 覆写成 -屏高(向上外扩一屏,盖住 Modal slide 位移期露出的顶部)。
|
|
16
|
+
scrim: {
|
|
17
|
+
position: 'absolute',
|
|
18
|
+
top: 0,
|
|
19
|
+
left: 0,
|
|
20
|
+
right: 0,
|
|
21
|
+
bottom: 0,
|
|
22
|
+
backgroundColor: c.scrim,
|
|
23
|
+
},
|
|
14
24
|
sheet: {
|
|
15
25
|
backgroundColor: c.surface,
|
|
16
26
|
borderTopLeftRadius: r(20),
|
|
@@ -1,26 +1,30 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
2
|
import { Text, View } from 'react-native';
|
|
3
3
|
import { Pressable } from 'react-native-gesture-handler';
|
|
4
4
|
import { fw, useTheme, useThemedStyles } from '../../../theme';
|
|
5
5
|
import { childTestID } from '../../../utils/testID';
|
|
6
|
-
import { makeStyles } from './styles';
|
|
6
|
+
import { makeStyles, sizingFor } from './styles';
|
|
7
7
|
import type { SegmentedProps } from './types';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* 局部分段控件 ——
|
|
10
|
+
* 局部分段控件 —— pill 在 track 上,激活项是亮色 thumb。
|
|
11
11
|
*
|
|
12
12
|
* **active thumb 必须比 track 亮一档** —— shadow 只在亮色态显示,
|
|
13
13
|
* 暗色态由 surface 明度差表达层级。
|
|
14
|
+
*
|
|
15
|
+
* `size`:默认 `'md'`(44pt 触控达标);`'sm'` 紧凑(28pt)给模型下拉等局促位用。
|
|
14
16
|
*/
|
|
15
17
|
export function Segmented({
|
|
16
18
|
value,
|
|
17
19
|
onChange,
|
|
18
20
|
items,
|
|
21
|
+
size = 'md',
|
|
19
22
|
disabled = false,
|
|
20
23
|
testID,
|
|
21
24
|
}: SegmentedProps): React.JSX.Element {
|
|
22
25
|
const { colors: c, scheme, shadow } = useTheme();
|
|
23
26
|
const styles = useThemedStyles(makeStyles);
|
|
27
|
+
const sizing = useMemo(() => sizingFor(size), [size]);
|
|
24
28
|
const activeBg = scheme === 'dark' ? c.surfaceContainerHighest : c.surface;
|
|
25
29
|
const activeShadow = scheme === 'dark' ? null : shadow.subtle;
|
|
26
30
|
|
|
@@ -43,19 +47,18 @@ export function Segmented({
|
|
|
43
47
|
testID={itemTestID}
|
|
44
48
|
style={({ pressed }) => [
|
|
45
49
|
styles.segItem,
|
|
50
|
+
{ minHeight: sizing.minHeight, paddingHorizontal: sizing.px },
|
|
46
51
|
on && { backgroundColor: activeBg },
|
|
47
52
|
on && activeShadow,
|
|
48
53
|
{ opacity: pressed ? 0.85 : 1 },
|
|
49
54
|
]}
|
|
50
55
|
>
|
|
51
56
|
<Text
|
|
52
|
-
style={
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
},
|
|
58
|
-
]}
|
|
57
|
+
style={{
|
|
58
|
+
fontSize: sizing.fs,
|
|
59
|
+
color: on ? c.foreground : c.foregroundSubtle,
|
|
60
|
+
fontWeight: on ? fw.semi : fw.medium,
|
|
61
|
+
}}
|
|
59
62
|
numberOfLines={1}
|
|
60
63
|
>
|
|
61
64
|
{it.label}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Segmented } from './Segmented';
|
|
2
|
-
export type { SegmentedProps } from './types';
|
|
2
|
+
export type { SegmentedProps, SegmentedSize } from './types';
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { StyleSheet } from 'react-native';
|
|
2
2
|
import type { ColorTokens } from '../../../theme';
|
|
3
3
|
import { fixed, r, radius, space, type as t } from '../../../theme';
|
|
4
|
+
import type { SegmentedSize, SegmentedSizing } from './types';
|
|
4
5
|
|
|
6
|
+
/** sm 紧凑高 —— 取 control.sm 的设计基准值 28,但**物理常量、不缩放**
|
|
7
|
+
* (与 md 的 fixed.hitTarget 同基准)。
|
|
8
|
+
* 为何不直接用 scaled `control.sm`:大屏 `r(28)` 会涨过 md 的 44(size 语义反转,
|
|
9
|
+
* sm 反而比 md 高)。固定 28:各屏恒 < 44、与 md 维持稳定比例。 */
|
|
10
|
+
const SM_MIN_HEIGHT = 28;
|
|
11
|
+
|
|
12
|
+
/** Segmented 静态 base —— track chrome 与 item 居中/圆角(size-invariant)。
|
|
13
|
+
* 随 size 变化的 minHeight / paddingHorizontal / fontSize 由 sizingFor(size) 注入。 */
|
|
5
14
|
export const makeStyles = (c: ColorTokens) =>
|
|
6
15
|
StyleSheet.create({
|
|
7
16
|
seg: {
|
|
@@ -12,15 +21,26 @@ export const makeStyles = (c: ColorTokens) =>
|
|
|
12
21
|
alignSelf: 'flex-start',
|
|
13
22
|
},
|
|
14
23
|
segItem: {
|
|
15
|
-
// [M-7] Segmented item 高原为 control.sm≈28pt < 44pt;
|
|
16
|
-
// hitSlop 不越父 seg 容器边界 → 改用 minHeight 直接对齐 fixed.hitTarget(44pt)
|
|
17
|
-
minHeight: fixed.hitTarget,
|
|
18
|
-
paddingHorizontal: space[7],
|
|
19
24
|
alignItems: 'center',
|
|
20
25
|
justifyContent: 'center',
|
|
21
26
|
borderRadius: radius.sm,
|
|
22
27
|
},
|
|
23
|
-
segLabel: {
|
|
24
|
-
fontSize: t.xs,
|
|
25
|
-
},
|
|
26
28
|
});
|
|
29
|
+
|
|
30
|
+
/** Segmented 尺寸推导:2 档 size → { minHeight, px, fs }。
|
|
31
|
+
* 新增 size 在 types.ts 扩 union + 这里加 case(与 Button.sizingFor 同范式)。
|
|
32
|
+
*
|
|
33
|
+
* [M-7] 触控目标:item 嵌在 seg track 内,hitSlop 不越父 track 边界
|
|
34
|
+
* (≠ Button/Chip 能向外补 hitSlop)→ 只能靠 item minHeight 自撑高 track。
|
|
35
|
+
* - md(默认):minHeight = fixed.hitTarget(44pt 物理常量),触控达标,行为同改前。
|
|
36
|
+
* - sm(紧凑):minHeight = SM_MIN_HEIGHT(28pt 物理常量),为模型下拉等局促位主动小一号,
|
|
37
|
+
* 接受 sub-44pt 触控(调用方按场景 opt-in);a11y role/state 不变。
|
|
38
|
+
* px / fs 走 scaled token(space/type),与 md 同基准 → sm 恒小于 md。 */
|
|
39
|
+
export function sizingFor(size: SegmentedSize): SegmentedSizing {
|
|
40
|
+
switch (size) {
|
|
41
|
+
case 'sm':
|
|
42
|
+
return { minHeight: SM_MIN_HEIGHT, px: space['5'], fs: t.xxs };
|
|
43
|
+
case 'md':
|
|
44
|
+
return { minHeight: fixed.hitTarget, px: space['7'], fs: t.xs };
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
import type { TabItem } from '../Tabs';
|
|
2
2
|
|
|
3
|
+
/** Segmented 尺寸:`md`=默认(达标 44pt 触控) / `sm`=紧凑(28pt,模型下拉等局促位)。 */
|
|
4
|
+
export type SegmentedSize = 'sm' | 'md';
|
|
5
|
+
|
|
3
6
|
/** Segmented 与 Tabs 共用 item 形状;命名独立以表达控件意图差异。 */
|
|
4
7
|
export type SegmentedProps = {
|
|
5
8
|
value: string;
|
|
6
9
|
onChange: (id: string) => void;
|
|
7
10
|
items: TabItem[];
|
|
11
|
+
/** 尺寸,默认 `'md'`。`'sm'` 给模型下拉等局促位用——更小,触控 < 44pt(见 styles.sizingFor) */
|
|
12
|
+
size?: SegmentedSize;
|
|
8
13
|
/** [L-82] 整体禁用 —— 所有 item 不可点击,a11y state 同步 */
|
|
9
14
|
disabled?: boolean;
|
|
10
15
|
/** 容器 testID;item testID 自动派生为 `${testID}-${id}` */
|
|
11
16
|
testID?: string;
|
|
12
17
|
};
|
|
18
|
+
|
|
19
|
+
/** sizingFor(size) 的返回:Segmented item 随 size 变化的 3 个量。
|
|
20
|
+
* 形状只取 Segmented 实际可变的维度(圆角固定 radius.sm、item 间无 gap,故无 br/gap)。 */
|
|
21
|
+
export type SegmentedSizing = {
|
|
22
|
+
/** item 最小高度(撑起 track 高度;也是触控目标——见 sizingFor 的 [M-7] 注释) */
|
|
23
|
+
minHeight: number;
|
|
24
|
+
/** item 水平 padding */
|
|
25
|
+
px: number;
|
|
26
|
+
/** label 字号 */
|
|
27
|
+
fs: number;
|
|
28
|
+
};
|
|
@@ -49,7 +49,7 @@ export type { SearchProps } from './Search';
|
|
|
49
49
|
export { Skeleton } from './Skeleton';
|
|
50
50
|
export type { SkeletonProps, SkeletonShape } from './Skeleton';
|
|
51
51
|
export { Segmented } from './Segmented';
|
|
52
|
-
export type { SegmentedProps } from './Segmented';
|
|
52
|
+
export type { SegmentedProps, SegmentedSize } from './Segmented';
|
|
53
53
|
export { Spinner } from './Spinner';
|
|
54
54
|
export type { SpinnerProps } from './Spinner';
|
|
55
55
|
export { StatusDot } from './StatusDot';
|