@unif/react-native-design 0.17.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
8
8
  export const ThemeContext = /*#__PURE__*/createContext(null);
9
9
  export function ThemeProvider({
10
10
  children,
11
- forceScheme
11
+ forceScheme,
12
+ fontScale = 1
12
13
  }) {
13
14
  const sysScheme = useColorScheme();
14
15
  const scheme = forceScheme ?? (sysScheme === 'dark' ? 'dark' : 'light');
@@ -18,8 +19,9 @@ export function ThemeProvider({
18
19
  const value = useMemo(() => ({
19
20
  scheme,
20
21
  colors: scheme === 'dark' ? darkColors : lightColors,
21
- shadow: scheme === 'dark' ? darkShadow : lightShadow
22
- }), [scheme]);
22
+ shadow: scheme === 'dark' ? darkShadow : lightShadow,
23
+ fontScale
24
+ }), [scheme, fontScale]);
23
25
  return /*#__PURE__*/_jsx(ThemeContext.Provider, {
24
26
  value: value,
25
27
  children: children
@@ -1 +1 @@
1
- {"version":3,"names":["React","createContext","useMemo","useColorScheme","lightColors","darkColors","lightShadow","darkShadow","jsx","_jsx","ThemeContext","ThemeProvider","children","forceScheme","sysScheme","scheme","value","colors","shadow","Provider"],"sourceRoot":"../../../src","sources":["theme/ThemeProvider.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,aAAa,EAAEC,OAAO,QAAQ,OAAO;AACrD,SAASC,cAAc,QAAQ,cAAc;AAC7C,SAASC,WAAW,EAAEC,UAAU,QAA0B,aAAU;AACpE,SAASC,WAAW,EAAEC,UAAU,QAA2B,aAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAUtE,OAAO,MAAMC,YAAY,gBAAGT,aAAa,CAA2B,IAAI,CAAC;AAQzE,OAAO,SAASU,aAAaA,CAAC;EAAEC,QAAQ;EAAEC;AAAgC,CAAC,EAAE;EAC3E,MAAMC,SAAS,GAAGX,cAAc,CAAC,CAAC;EAClC,MAAMY,MAAmB,GACvBF,WAAW,KAAKC,SAAS,KAAK,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;;EAE1D;EACA;EACA,MAAME,KAAK,GAAGd,OAAO,CACnB,OAAO;IACLa,MAAM;IACNE,MAAM,EAAEF,MAAM,KAAK,MAAM,GAAGV,UAAU,GAAGD,WAAW;IACpDc,MAAM,EAAEH,MAAM,KAAK,MAAM,GAAGR,UAAU,GAAGD;EAC3C,CAAC,CAAC,EACF,CAACS,MAAM,CACT,CAAC;EAED,oBACEN,IAAA,CAACC,YAAY,CAACS,QAAQ;IAACH,KAAK,EAAEA,KAAM;IAAAJ,QAAA,EAAEA;EAAQ,CAAwB,CAAC;AAE3E","ignoreList":[]}
1
+ {"version":3,"names":["React","createContext","useMemo","useColorScheme","lightColors","darkColors","lightShadow","darkShadow","jsx","_jsx","ThemeContext","ThemeProvider","children","forceScheme","fontScale","sysScheme","scheme","value","colors","shadow","Provider"],"sourceRoot":"../../../src","sources":["theme/ThemeProvider.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,aAAa,EAAEC,OAAO,QAAQ,OAAO;AACrD,SAASC,cAAc,QAAQ,cAAc;AAC7C,SAASC,WAAW,EAAEC,UAAU,QAA0B,aAAU;AACpE,SAASC,WAAW,EAAEC,UAAU,QAA2B,aAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAatE,OAAO,MAAMC,YAAY,gBAAGT,aAAa,CAA2B,IAAI,CAAC;AAWzE,OAAO,SAASU,aAAaA,CAAC;EAC5BC,QAAQ;EACRC,WAAW;EACXC,SAAS,GAAG;AACM,CAAC,EAAE;EACrB,MAAMC,SAAS,GAAGZ,cAAc,CAAC,CAAC;EAClC,MAAMa,MAAmB,GACvBH,WAAW,KAAKE,SAAS,KAAK,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;;EAE1D;EACA;EACA,MAAME,KAAK,GAAGf,OAAO,CACnB,OAAO;IACLc,MAAM;IACNE,MAAM,EAAEF,MAAM,KAAK,MAAM,GAAGX,UAAU,GAAGD,WAAW;IACpDe,MAAM,EAAEH,MAAM,KAAK,MAAM,GAAGT,UAAU,GAAGD,WAAW;IACpDQ;EACF,CAAC,CAAC,EACF,CAACE,MAAM,EAAEF,SAAS,CACpB,CAAC;EAED,oBACEL,IAAA,CAACC,YAAY,CAACU,QAAQ;IAACH,KAAK,EAAEA,KAAM;IAAAL,QAAA,EAAEA;EAAQ,CAAwB,CAAC;AAE3E","ignoreList":[]}
@@ -7,7 +7,8 @@ import { lightShadow } from "./shadow.js";
7
7
  const FALLBACK = {
8
8
  scheme: 'light',
9
9
  colors: lightColors,
10
- shadow: lightShadow
10
+ shadow: lightShadow,
11
+ fontScale: 1
11
12
  };
12
13
 
13
14
  // 静默回退而非 throw:FALLBACK 是模块级稳定引用,useThemedStyles 缓存契约不受影响。
@@ -1 +1 @@
1
- {"version":3,"names":["useContext","ThemeContext","lightColors","lightShadow","FALLBACK","scheme","colors","shadow","_warnedMissingProvider","useTheme","ctx","undefined","__DEV__","console","warn","useColors","useShadow"],"sourceRoot":"../../../src","sources":["theme/useTheme.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,YAAY,QAAgC,oBAAiB;AACtE,SAASC,WAAW,QAAQ,aAAU;AACtC,SAASC,WAAW,QAAQ,aAAU;AAEtC,MAAMC,QAA2B,GAAG;EAClCC,MAAM,EAAE,OAAO;EACfC,MAAM,EAAEJ,WAAW;EACnBK,MAAM,EAAEJ;AACV,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,IAAIK,sBAAsB,GAAG,KAAK;AAElC,OAAO,SAASC,QAAQA,CAAA,EAAsB;EAC5C,MAAMC,GAAG,GAAGV,UAAU,CAACC,YAAY,CAAC;EACpC,IAAIS,GAAG,KAAKC,SAAS,IAAI,CAACH,sBAAsB,EAAE;IAChDA,sBAAsB,GAAG,IAAI;IAC7B,IAAI,OAAOI,OAAO,KAAK,WAAW,IAAIA,OAAO,EAAE;MAC7CC,OAAO,CAACC,IAAI,CACV,mFACF,CAAC;IACH;EACF;EACA,OAAOJ,GAAG,IAAIN,QAAQ;AACxB;AAEA,OAAO,SAASW,SAASA,CAAA,EAAG;EAC1B,OAAON,QAAQ,CAAC,CAAC,CAACH,MAAM;AAC1B;AAEA,OAAO,SAASU,SAASA,CAAA,EAAG;EAC1B,OAAOP,QAAQ,CAAC,CAAC,CAACF,MAAM;AAC1B","ignoreList":[]}
1
+ {"version":3,"names":["useContext","ThemeContext","lightColors","lightShadow","FALLBACK","scheme","colors","shadow","fontScale","_warnedMissingProvider","useTheme","ctx","undefined","__DEV__","console","warn","useColors","useShadow"],"sourceRoot":"../../../src","sources":["theme/useTheme.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,YAAY,QAAgC,oBAAiB;AACtE,SAASC,WAAW,QAAQ,aAAU;AACtC,SAASC,WAAW,QAAQ,aAAU;AAEtC,MAAMC,QAA2B,GAAG;EAClCC,MAAM,EAAE,OAAO;EACfC,MAAM,EAAEJ,WAAW;EACnBK,MAAM,EAAEJ,WAAW;EACnBK,SAAS,EAAE;AACb,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,IAAIC,sBAAsB,GAAG,KAAK;AAElC,OAAO,SAASC,QAAQA,CAAA,EAAsB;EAC5C,MAAMC,GAAG,GAAGX,UAAU,CAACC,YAAY,CAAC;EACpC,IAAIU,GAAG,KAAKC,SAAS,IAAI,CAACH,sBAAsB,EAAE;IAChDA,sBAAsB,GAAG,IAAI;IAC7B,IAAI,OAAOI,OAAO,KAAK,WAAW,IAAIA,OAAO,EAAE;MAC7CC,OAAO,CAACC,IAAI,CACV,mFACF,CAAC;IACH;EACF;EACA,OAAOJ,GAAG,IAAIP,QAAQ;AACxB;AAEA,OAAO,SAASY,SAASA,CAAA,EAAG;EAC1B,OAAON,QAAQ,CAAC,CAAC,CAACJ,MAAM;AAC1B;AAEA,OAAO,SAASW,SAASA,CAAA,EAAG;EAC1B,OAAOP,QAAQ,CAAC,CAAC,CAACH,MAAM;AAC1B","ignoreList":[]}
@@ -6,18 +6,60 @@ import { useTheme } from "./useTheme.js";
6
6
  /** RN 0.85 strict-api 不再导出 `StyleSheet.NamedStyles`,这里本地保留同名约束:
7
7
  * `{ [k]: ViewStyle | TextStyle | ImageStyle }` —— 给 maker 返回值兜底。 */
8
8
 
9
+ /** 应用级字号缩放只作用于文字三属性 —— 与 RN allowFontScaling 的原生缩放
10
+ * 范围一致(只缩文字,不缩 padding / 高度等布局尺寸)。无字号系属性的
11
+ * style 返回原引用。strict-api 下 TextStyle 只读,用条件展开构造新对象。 */
12
+ function scaleTextStyle(style, factor) {
13
+ const {
14
+ fontSize,
15
+ lineHeight,
16
+ letterSpacing
17
+ } = style;
18
+ if (typeof fontSize !== 'number' && typeof lineHeight !== 'number' && typeof letterSpacing !== 'number') {
19
+ return style;
20
+ }
21
+ return {
22
+ ...style,
23
+ ...(typeof fontSize === 'number' ? {
24
+ fontSize: fontSize * factor
25
+ } : null),
26
+ ...(typeof lineHeight === 'number' ? {
27
+ lineHeight: lineHeight * factor
28
+ } : null),
29
+ ...(typeof letterSpacing === 'number' ? {
30
+ letterSpacing: letterSpacing * factor
31
+ } : null)
32
+ };
33
+ }
34
+
35
+ /** maker 产物按 fontScale 缩放字号系属性。factor = 1 时恒等返回**原引用**——
36
+ * 未接入 fontScale 的消费方(web 文档站等)行为与引用完全不变。
37
+ * 导出仅供单测,不进 barrel。 */
38
+ export function scaleNamedStyles(styles, factor) {
39
+ if (factor === 1) return styles;
40
+ const out = {};
41
+ for (const [key, style] of Object.entries(styles)) {
42
+ // ViewStyle / ImageStyle 无字号三属性,按 TextStyle 探测后恒等返回原引用。
43
+ out[key] = style && typeof style === 'object' ? scaleTextStyle(style, factor) : style;
44
+ }
45
+ return out;
46
+ }
47
+
9
48
  /**
10
- * 接收 (colors, shadow) => StyleSheet 工厂,返回当前主题对应的 themed StyleSheet
49
+ * 接收 (colors, shadow) => StyleSheet 工厂,返回当前主题对应的 themed StyleSheet,
50
+ * 并按 ThemeProvider 的 fontScale 缩放字号系属性(fontSize / lineHeight /
51
+ * letterSpacing;fontScale = 1 时恒等)。
11
52
  *
12
- * 缓存依赖 [colors, shadow, maker]。`maker` 必须定义在模块顶层(不要写在组件内联),
13
- * 否则引用每次变,缓存失效。ThemeProvider 通过 useMemo([scheme]) 保证主题不变时
14
- * colors / shadow 引用稳定。
53
+ * 缓存依赖 [colors, shadow, fontScale, maker]。`maker` 必须定义在模块顶层
54
+ * (不要写在组件内联),否则引用每次变,缓存失效。ThemeProvider 通过
55
+ * useMemo([scheme, fontScale]) 保证主题不变时 colors / shadow 引用稳定。
15
56
  */
16
57
  export function useThemedStyles(maker) {
17
58
  const {
18
59
  colors,
19
- shadow
60
+ shadow,
61
+ fontScale
20
62
  } = useTheme();
21
- return useMemo(() => maker(colors, shadow), [colors, shadow, maker]);
63
+ return useMemo(() => scaleNamedStyles(maker(colors, shadow), fontScale), [colors, shadow, fontScale, maker]);
22
64
  }
23
65
  //# sourceMappingURL=useThemedStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useMemo","useTheme","useThemedStyles","maker","colors","shadow"],"sourceRoot":"../../../src","sources":["theme/useThemedStyles.ts"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,OAAO;AAI/B,SAASC,QAAQ,QAAQ,eAAY;;AAErC;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAC7BC,KAAqB,EAClB;EACH,MAAM;IAAEC,MAAM;IAAEC;EAAO,CAAC,GAAGJ,QAAQ,CAAC,CAAC;EACrC,OAAOD,OAAO,CAAC,MAAMG,KAAK,CAACC,MAAM,EAAEC,MAAM,CAAC,EAAE,CAACD,MAAM,EAAEC,MAAM,EAAEF,KAAK,CAAC,CAAC;AACtE","ignoreList":[]}
1
+ {"version":3,"names":["useMemo","useTheme","scaleTextStyle","style","factor","fontSize","lineHeight","letterSpacing","scaleNamedStyles","styles","out","key","Object","entries","useThemedStyles","maker","colors","shadow","fontScale"],"sourceRoot":"../../../src","sources":["theme/useThemedStyles.ts"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,OAAO;AAI/B,SAASC,QAAQ,QAAQ,eAAY;;AAErC;AACA;;AAQA;AACA;AACA;AACA,SAASC,cAAcA,CAACC,KAAgB,EAAEC,MAAc,EAAa;EACnE,MAAM;IAAEC,QAAQ;IAAEC,UAAU;IAAEC;EAAc,CAAC,GAAGJ,KAAK;EACrD,IACE,OAAOE,QAAQ,KAAK,QAAQ,IAC5B,OAAOC,UAAU,KAAK,QAAQ,IAC9B,OAAOC,aAAa,KAAK,QAAQ,EACjC;IACA,OAAOJ,KAAK;EACd;EACA,OAAO;IACL,GAAGA,KAAK;IACR,IAAI,OAAOE,QAAQ,KAAK,QAAQ,GAAG;MAAEA,QAAQ,EAAEA,QAAQ,GAAGD;IAAO,CAAC,GAAG,IAAI,CAAC;IAC1E,IAAI,OAAOE,UAAU,KAAK,QAAQ,GAC9B;MAAEA,UAAU,EAAEA,UAAU,GAAGF;IAAO,CAAC,GACnC,IAAI,CAAC;IACT,IAAI,OAAOG,aAAa,KAAK,QAAQ,GACjC;MAAEA,aAAa,EAAEA,aAAa,GAAGH;IAAO,CAAC,GACzC,IAAI;EACV,CAAC;AACH;;AAEA;AACA;AACA;AACA,OAAO,SAASI,gBAAgBA,CAC9BC,MAAS,EACTL,MAAc,EACX;EACH,IAAIA,MAAM,KAAK,CAAC,EAAE,OAAOK,MAAM;EAC/B,MAAMC,GAAuD,GAAG,CAAC,CAAC;EAClE,KAAK,MAAM,CAACC,GAAG,EAAER,KAAK,CAAC,IAAIS,MAAM,CAACC,OAAO,CACvCJ,MACF,CAAC,EAAE;IACD;IACAC,GAAG,CAACC,GAAG,CAAC,GACNR,KAAK,IAAI,OAAOA,KAAK,KAAK,QAAQ,GAC9BD,cAAc,CAACC,KAAK,EAAeC,MAAM,CAAC,GAC1CD,KAAK;EACb;EACA,OAAOO,GAAG;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASI,eAAeA,CAC7BC,KAAqB,EAClB;EACH,MAAM;IAAEC,MAAM;IAAEC,MAAM;IAAEC;EAAU,CAAC,GAAGjB,QAAQ,CAAC,CAAC;EAChD,OAAOD,OAAO,CACZ,MAAMQ,gBAAgB,CAACO,KAAK,CAACC,MAAM,EAAEC,MAAM,CAAC,EAAEC,SAAS,CAAC,EACxD,CAACF,MAAM,EAAEC,MAAM,EAAEC,SAAS,EAAEH,KAAK,CACnC,CAAC;AACH","ignoreList":[]}
@@ -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" | "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<{
139
+ }>, never>>, "style" | "experimental_accessibilityOrder">, "value" | "textAlign" | "style" | "onChange" | "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" | "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<{
156
+ }>, "value" | "textAlign" | "style" | "onChange" | "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" | "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<{
169
+ }>, "value" | "textAlign" | "style" | "onChange" | "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;
@@ -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" | "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<{
136
+ }>, never>>, "style" | "experimental_accessibilityOrder">, "value" | "textAlign" | "style" | "onChange" | "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" | "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<{
153
+ }>, "value" | "textAlign" | "style" | "onChange" | "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" | "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<{
166
+ }>, "value" | "textAlign" | "style" | "onChange" | "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;
@@ -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" | "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<{
147
+ }>, never>>, "style" | "experimental_accessibilityOrder">, "value" | "textAlign" | "style" | "onChange" | "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" | "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<{
164
+ }>, "value" | "textAlign" | "style" | "onChange" | "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" | "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<{
177
+ }>, "value" | "textAlign" | "style" | "onChange" | "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;
@@ -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" | "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<{
141
+ }>, never>>, "style" | "experimental_accessibilityOrder">, "value" | "textAlign" | "style" | "onChange" | "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" | "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<{
158
+ }>, "value" | "textAlign" | "style" | "onChange" | "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" | "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<{
171
+ }>, "value" | "textAlign" | "style" | "onChange" | "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;
@@ -6,13 +6,19 @@ export type ThemeContextValue = {
6
6
  scheme: ColorScheme;
7
7
  colors: ColorTokens;
8
8
  shadow: ShadowTokens;
9
+ /** 应用级字号缩放倍数(app 内字体大小档)。useThemedStyles 出口对
10
+ * fontSize / lineHeight / letterSpacing 生效;1 = 不缩放。 */
11
+ fontScale: number;
9
12
  };
10
13
  export declare const ThemeContext: React.Context<ThemeContextValue | null>;
11
14
  type ThemeProviderProps = {
12
15
  children: React.ReactNode;
13
16
  /** 强制使用某个 scheme(覆盖 useColorScheme)。用于测试或 settingsStore 接入。 */
14
17
  forceScheme?: ColorScheme;
18
+ /** 应用级字号缩放倍数,默认 1(不缩放)。接入方自持档位状态(persist
19
+ * store 等)并传入;变更即触发全树 themed 样式重算。 */
20
+ fontScale?: number;
15
21
  };
16
- export declare function ThemeProvider({ children, forceScheme }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
22
+ export declare function ThemeProvider({ children, forceScheme, fontScale, }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
17
23
  export {};
18
24
  //# sourceMappingURL=ThemeProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/theme/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiC,MAAM,OAAO,CAAC;AAEtD,OAAO,EAA2B,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,EAA2B,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAEtE,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;AAE3C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,WAAW,CAAC;IACpB,MAAM,EAAE,WAAW,CAAC;IACpB,MAAM,EAAE,YAAY,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,YAAY,yCAAgD,CAAC;AAE1E,KAAK,kBAAkB,GAAG;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,+DAA+D;IAC/D,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,kBAAkB,2CAmB1E"}
1
+ {"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/theme/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiC,MAAM,OAAO,CAAC;AAEtD,OAAO,EAA2B,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,EAA2B,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAEtE,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;AAE3C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,WAAW,CAAC;IACpB,MAAM,EAAE,WAAW,CAAC;IACpB,MAAM,EAAE,YAAY,CAAC;IACrB;4DACwD;IACxD,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,YAAY,yCAAgD,CAAC;AAE1E,KAAK,kBAAkB,GAAG;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,+DAA+D;IAC/D,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;2CACuC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,WAAW,EACX,SAAa,GACd,EAAE,kBAAkB,2CAoBpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../../src/theme/useTheme.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAiBvE,wBAAgB,QAAQ,IAAI,iBAAiB,CAW5C;AAED,wBAAgB,SAAS,mCAExB;AAED,wBAAgB,SAAS,oCAExB"}
1
+ {"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../../src/theme/useTheme.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAkBvE,wBAAgB,QAAQ,IAAI,iBAAiB,CAW5C;AAED,wBAAgB,SAAS,mCAExB;AAED,wBAAgB,SAAS,oCAExB"}
@@ -7,12 +7,18 @@ type NamedStyles<T> = {
7
7
  [P in keyof T]: ViewStyle | TextStyle | ImageStyle;
8
8
  };
9
9
  export type StylesMaker<S extends NamedStyles<S>> = (c: ColorTokens, s: ShadowTokens) => S;
10
+ /** maker 产物按 fontScale 缩放字号系属性。factor = 1 时恒等返回**原引用**——
11
+ * 未接入 fontScale 的消费方(web 文档站等)行为与引用完全不变。
12
+ * 导出仅供单测,不进 barrel。 */
13
+ export declare function scaleNamedStyles<S extends NamedStyles<S>>(styles: S, factor: number): S;
10
14
  /**
11
- * 接收 (colors, shadow) => StyleSheet 工厂,返回当前主题对应的 themed StyleSheet
15
+ * 接收 (colors, shadow) => StyleSheet 工厂,返回当前主题对应的 themed StyleSheet,
16
+ * 并按 ThemeProvider 的 fontScale 缩放字号系属性(fontSize / lineHeight /
17
+ * letterSpacing;fontScale = 1 时恒等)。
12
18
  *
13
- * 缓存依赖 [colors, shadow, maker]。`maker` 必须定义在模块顶层(不要写在组件内联),
14
- * 否则引用每次变,缓存失效。ThemeProvider 通过 useMemo([scheme]) 保证主题不变时
15
- * colors / shadow 引用稳定。
19
+ * 缓存依赖 [colors, shadow, fontScale, maker]。`maker` 必须定义在模块顶层
20
+ * (不要写在组件内联),否则引用每次变,缓存失效。ThemeProvider 通过
21
+ * useMemo([scheme, fontScale]) 保证主题不变时 colors / shadow 引用稳定。
16
22
  */
17
23
  export declare function useThemedStyles<S extends NamedStyles<S>>(maker: StylesMaker<S>): S;
18
24
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"useThemedStyles.d.ts","sourceRoot":"","sources":["../../../../src/theme/useThemedStyles.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAG7C;sEACsE;AACtE,KAAK,WAAW,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU;CAAE,CAAC;AAE7E,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,WAAW,CAAC,CAAC,CAAC,IAAI,CAClD,CAAC,EAAE,WAAW,EACd,CAAC,EAAE,YAAY,KACZ,CAAC,CAAC;AAEP;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,WAAW,CAAC,CAAC,CAAC,EACtD,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,GACpB,CAAC,CAGH"}
1
+ {"version":3,"file":"useThemedStyles.d.ts","sourceRoot":"","sources":["../../../../src/theme/useThemedStyles.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAG7C;sEACsE;AACtE,KAAK,WAAW,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU;CAAE,CAAC;AAE7E,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,WAAW,CAAC,CAAC,CAAC,IAAI,CAClD,CAAC,EAAE,WAAW,EACd,CAAC,EAAE,YAAY,KACZ,CAAC,CAAC;AA0BP;;wBAEwB;AACxB,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,WAAW,CAAC,CAAC,CAAC,EACvD,MAAM,EAAE,CAAC,EACT,MAAM,EAAE,MAAM,GACb,CAAC,CAaH;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,WAAW,CAAC,CAAC,CAAC,EACtD,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,GACpB,CAAC,CAMH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unif/react-native-design",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "description": "Unif 设计系统:theme + icons + utils + components",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -9,6 +9,9 @@ export type ThemeContextValue = {
9
9
  scheme: ColorScheme;
10
10
  colors: ColorTokens;
11
11
  shadow: ShadowTokens;
12
+ /** 应用级字号缩放倍数(app 内字体大小档)。useThemedStyles 出口对
13
+ * fontSize / lineHeight / letterSpacing 生效;1 = 不缩放。 */
14
+ fontScale: number;
12
15
  };
13
16
 
14
17
  export const ThemeContext = createContext<ThemeContextValue | null>(null);
@@ -17,9 +20,16 @@ type ThemeProviderProps = {
17
20
  children: React.ReactNode;
18
21
  /** 强制使用某个 scheme(覆盖 useColorScheme)。用于测试或 settingsStore 接入。 */
19
22
  forceScheme?: ColorScheme;
23
+ /** 应用级字号缩放倍数,默认 1(不缩放)。接入方自持档位状态(persist
24
+ * store 等)并传入;变更即触发全树 themed 样式重算。 */
25
+ fontScale?: number;
20
26
  };
21
27
 
22
- export function ThemeProvider({ children, forceScheme }: ThemeProviderProps) {
28
+ export function ThemeProvider({
29
+ children,
30
+ forceScheme,
31
+ fontScale = 1,
32
+ }: ThemeProviderProps) {
23
33
  const sysScheme = useColorScheme();
24
34
  const scheme: ColorScheme =
25
35
  forceScheme ?? (sysScheme === 'dark' ? 'dark' : 'light');
@@ -31,8 +41,9 @@ export function ThemeProvider({ children, forceScheme }: ThemeProviderProps) {
31
41
  scheme,
32
42
  colors: scheme === 'dark' ? darkColors : lightColors,
33
43
  shadow: scheme === 'dark' ? darkShadow : lightShadow,
44
+ fontScale,
34
45
  }),
35
- [scheme]
46
+ [scheme, fontScale]
36
47
  );
37
48
 
38
49
  return (
@@ -7,6 +7,7 @@ const FALLBACK: ThemeContextValue = {
7
7
  scheme: 'light',
8
8
  colors: lightColors,
9
9
  shadow: lightShadow,
10
+ fontScale: 1,
10
11
  };
11
12
 
12
13
  // 静默回退而非 throw:FALLBACK 是模块级稳定引用,useThemedStyles 缓存契约不受影响。
@@ -13,16 +13,66 @@ export type StylesMaker<S extends NamedStyles<S>> = (
13
13
  s: ShadowTokens
14
14
  ) => S;
15
15
 
16
+ /** 应用级字号缩放只作用于文字三属性 —— 与 RN allowFontScaling 的原生缩放
17
+ * 范围一致(只缩文字,不缩 padding / 高度等布局尺寸)。无字号系属性的
18
+ * style 返回原引用。strict-api 下 TextStyle 只读,用条件展开构造新对象。 */
19
+ function scaleTextStyle(style: TextStyle, factor: number): TextStyle {
20
+ const { fontSize, lineHeight, letterSpacing } = style;
21
+ if (
22
+ typeof fontSize !== 'number' &&
23
+ typeof lineHeight !== 'number' &&
24
+ typeof letterSpacing !== 'number'
25
+ ) {
26
+ return style;
27
+ }
28
+ return {
29
+ ...style,
30
+ ...(typeof fontSize === 'number' ? { fontSize: fontSize * factor } : null),
31
+ ...(typeof lineHeight === 'number'
32
+ ? { lineHeight: lineHeight * factor }
33
+ : null),
34
+ ...(typeof letterSpacing === 'number'
35
+ ? { letterSpacing: letterSpacing * factor }
36
+ : null),
37
+ };
38
+ }
39
+
40
+ /** maker 产物按 fontScale 缩放字号系属性。factor = 1 时恒等返回**原引用**——
41
+ * 未接入 fontScale 的消费方(web 文档站等)行为与引用完全不变。
42
+ * 导出仅供单测,不进 barrel。 */
43
+ export function scaleNamedStyles<S extends NamedStyles<S>>(
44
+ styles: S,
45
+ factor: number
46
+ ): S {
47
+ if (factor === 1) return styles;
48
+ const out: Record<string, ViewStyle | TextStyle | ImageStyle> = {};
49
+ for (const [key, style] of Object.entries(
50
+ styles as Record<string, ViewStyle | TextStyle | ImageStyle>
51
+ )) {
52
+ // ViewStyle / ImageStyle 无字号三属性,按 TextStyle 探测后恒等返回原引用。
53
+ out[key] =
54
+ style && typeof style === 'object'
55
+ ? scaleTextStyle(style as TextStyle, factor)
56
+ : style;
57
+ }
58
+ return out as S;
59
+ }
60
+
16
61
  /**
17
- * 接收 (colors, shadow) => StyleSheet 工厂,返回当前主题对应的 themed StyleSheet
62
+ * 接收 (colors, shadow) => StyleSheet 工厂,返回当前主题对应的 themed StyleSheet,
63
+ * 并按 ThemeProvider 的 fontScale 缩放字号系属性(fontSize / lineHeight /
64
+ * letterSpacing;fontScale = 1 时恒等)。
18
65
  *
19
- * 缓存依赖 [colors, shadow, maker]。`maker` 必须定义在模块顶层(不要写在组件内联),
20
- * 否则引用每次变,缓存失效。ThemeProvider 通过 useMemo([scheme]) 保证主题不变时
21
- * colors / shadow 引用稳定。
66
+ * 缓存依赖 [colors, shadow, fontScale, maker]。`maker` 必须定义在模块顶层
67
+ * (不要写在组件内联),否则引用每次变,缓存失效。ThemeProvider 通过
68
+ * useMemo([scheme, fontScale]) 保证主题不变时 colors / shadow 引用稳定。
22
69
  */
23
70
  export function useThemedStyles<S extends NamedStyles<S>>(
24
71
  maker: StylesMaker<S>
25
72
  ): S {
26
- const { colors, shadow } = useTheme();
27
- return useMemo(() => maker(colors, shadow), [colors, shadow, maker]);
73
+ const { colors, shadow, fontScale } = useTheme();
74
+ return useMemo(
75
+ () => scaleNamedStyles(maker(colors, shadow), fontScale),
76
+ [colors, shadow, fontScale, maker]
77
+ );
28
78
  }