react-native-system-ui 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/README.md +3 -3
  2. package/dist/cjs/components/action-sheet/ActionSheet.js +51 -53
  3. package/dist/cjs/components/area/Area.js +22 -22
  4. package/dist/cjs/components/avatar/Avatar.js +23 -23
  5. package/dist/cjs/components/badge/Badge.js +56 -61
  6. package/dist/cjs/components/button/Button.js +87 -92
  7. package/dist/cjs/components/button/ButtonGroup.js +4 -4
  8. package/dist/cjs/components/calendar/Calendar.js +28 -28
  9. package/dist/cjs/components/cascader/Cascader.js +206 -212
  10. package/dist/cjs/components/cell/Cell.js +54 -51
  11. package/dist/cjs/components/cell/CellGroup.js +26 -25
  12. package/dist/cjs/components/checkbox/Checkbox.js +1 -0
  13. package/dist/cjs/components/checkbox/CheckboxGroup.js +20 -19
  14. package/dist/cjs/components/circle/Circle.js +66 -54
  15. package/dist/cjs/components/collapse/Collapse.js +18 -18
  16. package/dist/cjs/components/config-provider/ConfigProvider.js +5 -5
  17. package/dist/cjs/components/count-down/CountDown.js +17 -17
  18. package/dist/cjs/components/datetime-picker/DatetimePicker.js +34 -35
  19. package/dist/cjs/components/dialog/Dialog.js +16 -10
  20. package/dist/cjs/components/dialog/imperative.js +8 -14
  21. package/dist/cjs/components/dialog/tokens.js +1 -0
  22. package/dist/cjs/components/divider/Divider.js +48 -51
  23. package/dist/cjs/components/empty/Empty.js +30 -25
  24. package/dist/cjs/components/error-boundary/ErrorBoundary.js +3 -2
  25. package/dist/cjs/components/flex/Flex.js +27 -27
  26. package/dist/cjs/components/flex/FlexItem.js +1 -0
  27. package/dist/cjs/components/form/Form.js +94 -93
  28. package/dist/cjs/components/form/FormItem.js +60 -54
  29. package/dist/cjs/components/form/FormList.js +35 -35
  30. package/dist/cjs/components/grid/Grid.js +48 -48
  31. package/dist/cjs/components/grid/GridItem.js +9 -2
  32. package/dist/cjs/components/image/Image.js +25 -24
  33. package/dist/cjs/components/image/tokens.js +3 -1
  34. package/dist/cjs/components/image-preview/ImagePreview.js +38 -28
  35. package/dist/cjs/components/image-preview/tokens.js +3 -1
  36. package/dist/cjs/components/input/Input.js +16 -19
  37. package/dist/cjs/components/loading/Loading.js +27 -27
  38. package/dist/cjs/components/nav-bar/NavBar.js +21 -18
  39. package/dist/cjs/components/nav-bar/tokens.js +3 -1
  40. package/dist/cjs/components/notice-bar/NoticeBar.js +7 -3
  41. package/dist/cjs/components/notice-bar/tokens.js +3 -1
  42. package/dist/cjs/components/notify/Notify.js +2 -1
  43. package/dist/cjs/components/notify/imperative.js +17 -17
  44. package/dist/cjs/components/notify/tokens.js +1 -0
  45. package/dist/cjs/components/number-keyboard/NumberKeyboard.js +217 -201
  46. package/dist/cjs/components/number-keyboard/tokens.js +7 -1
  47. package/dist/cjs/components/overlay/Overlay.js +15 -15
  48. package/dist/cjs/components/password-input/PasswordInput.js +49 -49
  49. package/dist/cjs/components/picker/Picker.js +50 -58
  50. package/dist/cjs/components/popup/Popup.js +10 -10
  51. package/dist/cjs/components/popup/tokens.js +1 -0
  52. package/dist/cjs/components/portal/Portal.js +3 -4
  53. package/dist/cjs/components/progress/Progress.js +94 -95
  54. package/dist/cjs/components/progress/tokens.js +1 -0
  55. package/dist/cjs/components/radio/Radio.js +67 -63
  56. package/dist/cjs/components/radio/RadioGroup.js +6 -6
  57. package/dist/cjs/components/safe-area-view/SafeAreaView.js +7 -7
  58. package/dist/cjs/components/search/Search.js +28 -28
  59. package/dist/cjs/components/selector/Selector.js +19 -26
  60. package/dist/cjs/components/share-sheet/ShareSheet.js +8 -2
  61. package/dist/cjs/components/share-sheet/tokens.js +3 -1
  62. package/dist/cjs/components/sidebar/Sidebar.js +22 -16
  63. package/dist/cjs/components/sidebar/SidebarItem.js +9 -8
  64. package/dist/cjs/components/sidebar/tokens.js +3 -1
  65. package/dist/cjs/components/skeleton/Skeleton.js +43 -42
  66. package/dist/cjs/components/slider/Slider.js +1 -1
  67. package/dist/cjs/components/space/Space.js +45 -41
  68. package/dist/cjs/components/space/tokens.js +7 -1
  69. package/dist/cjs/components/stepper/Stepper.js +17 -15
  70. package/dist/cjs/components/stepper/tokens.js +1 -0
  71. package/dist/cjs/components/swiper/Swiper.js +10 -7
  72. package/dist/cjs/components/swiper/SwiperPagIndicator.js +3 -2
  73. package/dist/cjs/components/switch/Switch.js +23 -23
  74. package/dist/cjs/components/tabbar/Tabbar.js +26 -26
  75. package/dist/cjs/components/tabbar/TabbarItem.js +6 -0
  76. package/dist/cjs/components/tabs/Tabs.js +143 -153
  77. package/dist/cjs/components/tabs/tokens.js +3 -1
  78. package/dist/cjs/components/tag/Tag.js +38 -38
  79. package/dist/cjs/components/toast/Toast.js +7 -3
  80. package/dist/cjs/components/toast/tokens.js +1 -0
  81. package/dist/cjs/components/typography/Typography.js +23 -21
  82. package/dist/cjs/components/water-mark/WaterMark.js +65 -65
  83. package/dist/cjs/design-system/Text.js +38 -0
  84. package/dist/cjs/design-system/createComponentTokensHook.js +2 -2
  85. package/dist/cjs/design-system/index.js +7 -0
  86. package/dist/cjs/design-system/mergeTokensOverride.js +1 -4
  87. package/dist/cjs/hooks/useControllableValue.js +11 -11
  88. package/dist/cjs/hooks/useCountDown.js +18 -18
  89. package/dist/cjs/platform/measure.js +4 -2
  90. package/dist/cjs/utils/color.js +2 -7
  91. package/dist/cjs/utils/compare.js +3 -3
  92. package/dist/cjs/utils/date.js +2 -2
  93. package/dist/cjs/utils/deepMerge.js +5 -5
  94. package/dist/cjs/utils/hairline.js +1 -0
  95. package/dist/cjs/utils/render.js +2 -8
  96. package/dist/cjs/utils/validate.js +2 -4
  97. package/dist/es/components/action-sheet/ActionSheet.js +51 -53
  98. package/dist/es/components/area/Area.js +22 -22
  99. package/dist/es/components/avatar/Avatar.js +23 -23
  100. package/dist/es/components/badge/Badge.js +56 -61
  101. package/dist/es/components/button/Button.js +87 -92
  102. package/dist/es/components/button/ButtonGroup.js +4 -4
  103. package/dist/es/components/calendar/Calendar.js +28 -28
  104. package/dist/es/components/cascader/Cascader.js +206 -212
  105. package/dist/es/components/cell/Cell.js +55 -52
  106. package/dist/es/components/cell/CellGroup.js +26 -25
  107. package/dist/es/components/checkbox/Checkbox.js +1 -0
  108. package/dist/es/components/checkbox/CheckboxGroup.js +20 -19
  109. package/dist/es/components/circle/Circle.js +66 -54
  110. package/dist/es/components/collapse/Collapse.js +18 -18
  111. package/dist/es/components/config-provider/ConfigProvider.js +5 -5
  112. package/dist/es/components/count-down/CountDown.js +17 -17
  113. package/dist/es/components/datetime-picker/DatetimePicker.js +34 -35
  114. package/dist/es/components/dialog/Dialog.js +16 -10
  115. package/dist/es/components/dialog/imperative.js +8 -14
  116. package/dist/es/components/dialog/tokens.js +1 -0
  117. package/dist/es/components/divider/Divider.js +48 -51
  118. package/dist/es/components/empty/Empty.js +30 -25
  119. package/dist/es/components/error-boundary/ErrorBoundary.js +3 -2
  120. package/dist/es/components/flex/Flex.js +27 -27
  121. package/dist/es/components/flex/FlexItem.js +1 -0
  122. package/dist/es/components/form/Form.js +95 -94
  123. package/dist/es/components/form/FormItem.js +60 -54
  124. package/dist/es/components/form/FormList.js +35 -35
  125. package/dist/es/components/grid/Grid.js +48 -48
  126. package/dist/es/components/grid/GridItem.js +10 -3
  127. package/dist/es/components/image/Image.js +25 -24
  128. package/dist/es/components/image/tokens.js +3 -1
  129. package/dist/es/components/image-preview/ImagePreview.js +39 -29
  130. package/dist/es/components/image-preview/tokens.js +3 -1
  131. package/dist/es/components/input/Input.js +16 -19
  132. package/dist/es/components/loading/Loading.js +27 -27
  133. package/dist/es/components/nav-bar/NavBar.js +21 -18
  134. package/dist/es/components/nav-bar/tokens.js +3 -1
  135. package/dist/es/components/notice-bar/NoticeBar.js +7 -3
  136. package/dist/es/components/notice-bar/tokens.js +3 -1
  137. package/dist/es/components/notify/Notify.js +2 -1
  138. package/dist/es/components/notify/imperative.js +17 -17
  139. package/dist/es/components/notify/tokens.js +1 -0
  140. package/dist/es/components/number-keyboard/NumberKeyboard.js +217 -201
  141. package/dist/es/components/number-keyboard/tokens.js +7 -1
  142. package/dist/es/components/overlay/Overlay.js +15 -15
  143. package/dist/es/components/password-input/PasswordInput.js +49 -49
  144. package/dist/es/components/picker/Picker.js +50 -58
  145. package/dist/es/components/popup/Popup.js +10 -10
  146. package/dist/es/components/popup/tokens.js +1 -0
  147. package/dist/es/components/portal/Portal.js +3 -4
  148. package/dist/es/components/progress/Progress.js +94 -95
  149. package/dist/es/components/progress/tokens.js +1 -0
  150. package/dist/es/components/radio/Radio.js +67 -63
  151. package/dist/es/components/radio/RadioGroup.js +6 -6
  152. package/dist/es/components/safe-area-view/SafeAreaView.js +7 -7
  153. package/dist/es/components/search/Search.js +28 -28
  154. package/dist/es/components/selector/Selector.js +19 -26
  155. package/dist/es/components/share-sheet/ShareSheet.js +8 -2
  156. package/dist/es/components/share-sheet/tokens.js +3 -1
  157. package/dist/es/components/sidebar/Sidebar.js +22 -16
  158. package/dist/es/components/sidebar/SidebarItem.js +9 -8
  159. package/dist/es/components/sidebar/tokens.js +3 -1
  160. package/dist/es/components/skeleton/Skeleton.js +43 -42
  161. package/dist/es/components/slider/Slider.js +3 -3
  162. package/dist/es/components/space/Space.js +45 -41
  163. package/dist/es/components/space/tokens.js +7 -1
  164. package/dist/es/components/stepper/Stepper.js +17 -15
  165. package/dist/es/components/stepper/tokens.js +1 -0
  166. package/dist/es/components/swiper/Swiper.js +11 -8
  167. package/dist/es/components/swiper/SwiperPagIndicator.js +3 -2
  168. package/dist/es/components/switch/Switch.js +23 -23
  169. package/dist/es/components/tabbar/Tabbar.js +26 -26
  170. package/dist/es/components/tabbar/TabbarItem.js +6 -0
  171. package/dist/es/components/tabs/Tabs.js +144 -154
  172. package/dist/es/components/tabs/tokens.js +3 -1
  173. package/dist/es/components/tag/Tag.js +38 -38
  174. package/dist/es/components/toast/Toast.js +7 -3
  175. package/dist/es/components/toast/tokens.js +1 -0
  176. package/dist/es/components/typography/Typography.js +23 -21
  177. package/dist/es/components/water-mark/WaterMark.js +65 -65
  178. package/dist/es/design-system/Text.js +19 -0
  179. package/dist/es/design-system/createComponentTokensHook.js +2 -2
  180. package/dist/es/design-system/index.js +1 -0
  181. package/dist/es/design-system/mergeTokensOverride.js +1 -4
  182. package/dist/es/hooks/useControllableValue.js +11 -11
  183. package/dist/es/hooks/useCountDown.js +18 -18
  184. package/dist/es/platform/measure.js +4 -2
  185. package/dist/es/utils/color.js +1 -4
  186. package/dist/es/utils/compare.js +3 -3
  187. package/dist/es/utils/date.js +2 -2
  188. package/dist/es/utils/deepMerge.js +5 -5
  189. package/dist/es/utils/hairline.js +1 -0
  190. package/dist/es/utils/render.js +1 -1
  191. package/dist/es/utils/validate.js +1 -2
  192. package/dist/types/components/dialog/tokens.d.ts +1 -0
  193. package/dist/types/components/image-preview/tokens.d.ts +1 -0
  194. package/dist/types/components/nav-bar/tokens.d.ts +1 -1
  195. package/dist/types/components/notice-bar/tokens.d.ts +1 -0
  196. package/dist/types/components/number-keyboard/tokens.d.ts +5 -0
  197. package/dist/types/components/picker/Picker.d.ts +1 -1
  198. package/dist/types/components/popup/tokens.d.ts +1 -0
  199. package/dist/types/components/share-sheet/tokens.d.ts +1 -0
  200. package/dist/types/components/stepper/tokens.d.ts +1 -0
  201. package/dist/types/components/tabs/tokens.d.ts +1 -0
  202. package/dist/types/components/toast/tokens.d.ts +1 -0
  203. package/dist/types/design-system/Text.d.ts +3 -0
  204. package/dist/types/design-system/index.d.ts +1 -0
  205. package/dist/types/hooks/useCountDown.d.ts +1 -1
  206. package/dist/types/utils/color.d.ts +0 -2
  207. package/dist/types/utils/date.d.ts +1 -1
  208. package/dist/types/utils/render.d.ts +1 -1
  209. package/dist/types/utils/validate.d.ts +0 -1
  210. package/package.json +17 -3
@@ -38,18 +38,18 @@ const IS_WEB = _reactNative().Platform.OS === 'web';
38
38
  const OverlayImpl = (props, ref) => {
39
39
  const {
40
40
  children,
41
- isOpen: isOpenProp,
42
- visible: visibleProp,
43
- useRNModal: useRNModalProp,
44
- useRNModalOnAndroid: useRNModalOnAndroidProp = false,
45
- isKeyboardDismissable: isKeyboardDismissableProp = true,
46
- animationPreset: animationPresetProp = 'fade',
41
+ isOpen: openP,
42
+ visible: visP,
43
+ useRNModal: useModalP,
44
+ useRNModalOnAndroid: useModalAndroidP = false,
45
+ isKeyboardDismissable: kbDismissP = true,
46
+ animationPreset: animP = 'fade',
47
47
  onRequestClose,
48
48
  style
49
49
  } = props;
50
50
  const tokens = (0, _tokens.useOverlayTokens)();
51
- const shouldUseModal = useRNModalProp ?? !IS_WEB;
52
- const webOverlayStyle = IS_WEB ? {
51
+ const useModal = useModalP ?? !IS_WEB;
52
+ const webStyle = IS_WEB ? {
53
53
  zIndex: tokens.layer.zIndex,
54
54
  position: 'fixed',
55
55
  top: 0,
@@ -57,22 +57,22 @@ const OverlayImpl = (props, ref) => {
57
57
  right: 0,
58
58
  bottom: 0
59
59
  } : undefined;
60
- const resolvedOpen = isOpenProp ?? visibleProp ?? false;
60
+ const open = openP ?? visP ?? false;
61
61
  (0, _interactions().useKeyboardDismissable)({
62
- enabled: !IS_WEB && resolvedOpen && isKeyboardDismissableProp,
62
+ enabled: !IS_WEB && open && kbDismissP,
63
63
  callback: onRequestClose ?? (() => {})
64
64
  });
65
- if (!resolvedOpen) return null;
66
- if (shouldUseModal || useRNModalOnAndroidProp && _reactNative().Platform.OS === 'android') return /*#__PURE__*/_react().default.createElement(_reactNative().Modal, {
65
+ if (!open) return null;
66
+ if (useModal || useModalAndroidP && _reactNative().Platform.OS === 'android') return /*#__PURE__*/_react().default.createElement(_reactNative().Modal, {
67
67
  statusBarTranslucent: true,
68
68
  transparent: true,
69
- visible: resolvedOpen,
69
+ visible: open,
70
70
  onRequestClose: onRequestClose,
71
- animationType: animationPresetProp,
71
+ animationType: animP,
72
72
  ref: ref
73
73
  }, children);
74
74
  return /*#__PURE__*/_react().default.createElement(_overlays().OverlayContainer, {
75
- style: [style, webOverlayStyle]
75
+ style: [style, webStyle]
76
76
  }, children);
77
77
  };
78
78
  const OverlayForwardRef = /*#__PURE__*/_react().default.forwardRef(OverlayImpl);
@@ -61,7 +61,7 @@ const PasswordInputImpl = (props, ref) => {
61
61
  onBlur,
62
62
  ...rest
63
63
  } = props;
64
- const lengthValue = Math.max(1, Math.floor((0, _number.parseNumberLike)(length, 6) ?? 6));
64
+ const lenVal = Math.max(1, Math.floor((0, _number.parseNumberLike)(length, 6) ?? 6));
65
65
  const tokens = (0, _tokens.usePasswordInputTokens)(tokensOverride);
66
66
  const {
67
67
  colors,
@@ -71,36 +71,36 @@ const PasswordInputImpl = (props, ref) => {
71
71
  opacity,
72
72
  spacing
73
73
  } = tokens;
74
- const inputRef = (0, _react().useRef)(null),
75
- [cursorVisible, setCursorVisible] = (0, _react().useState)(true),
76
- blinkTimer = (0, _react().useRef)(null),
77
- [focused, setFocused] = (0, _react().useState)(autoFocus);
74
+ const inputRef = (0, _react().useRef)(null);
75
+ const [cursorVisible, setCursorVisible] = (0, _react().useState)(true);
76
+ const blinkTimer = (0, _react().useRef)(null);
77
+ const [focused, setFocused] = (0, _react().useState)(autoFocus);
78
78
  const keyboardType = type === 'number' ? 'number-pad' : 'default';
79
79
  const inputMode = type === 'number' ? 'numeric' : 'text';
80
80
  const [code = '', setCode] = (0, _hooks.useControllableValue)(props, {
81
81
  defaultValue: ''
82
82
  });
83
83
  const normalizeValue = (0, _react().useCallback)(v => {
84
- let normalized = v === null || v === undefined ? '' : (0, _validate.isString)(v) ? v : String(v);
85
- if (type === 'number') normalized = stripNonNumeric(normalized);
86
- if (lengthValue > 0 && normalized.length > lengthValue) normalized = normalized.slice(0, lengthValue);
87
- return normalized;
88
- }, [lengthValue, type]);
89
- const normalizedCode = normalizeValue(code);
90
- const validatorRef = (0, _react().useRef)(validator),
91
- onFocusRef = (0, _react().useRef)(onFocus),
92
- onBlurRef = (0, _react().useRef)(onBlur),
93
- onSubmitRef = (0, _react().useRef)(onSubmit);
84
+ let n = v === null || v === undefined ? '' : (0, _validate.isString)(v) ? v : String(v);
85
+ if (type === 'number') n = stripNonNumeric(n);
86
+ if (lenVal > 0 && n.length > lenVal) n = n.slice(0, lenVal);
87
+ return n;
88
+ }, [lenVal, type]);
89
+ const normCode = normalizeValue(code);
90
+ const validatorRef = (0, _react().useRef)(validator);
91
+ const onFocusRef = (0, _react().useRef)(onFocus);
92
+ const onBlurRef = (0, _react().useRef)(onBlur);
93
+ const onSubmitRef = (0, _react().useRef)(onSubmit);
94
94
  validatorRef.current = validator;
95
95
  onFocusRef.current = onFocus;
96
96
  onBlurRef.current = onBlur;
97
97
  onSubmitRef.current = onSubmit;
98
98
  const updateValue = (0, _react().useCallback)(v => {
99
- const normalized = normalizeValue(v);
100
- if (normalized === normalizedCode) return;
101
- if (validatorRef.current && !validatorRef.current(normalized)) return;
102
- setCode(normalized);
103
- }, [normalizeValue, normalizedCode, setCode]);
99
+ const n = normalizeValue(v);
100
+ if (n === normCode) return;
101
+ if (validatorRef.current && !validatorRef.current(n)) return;
102
+ setCode(n);
103
+ }, [normalizeValue, normCode, setCode]);
104
104
  const focusInput = (0, _react().useCallback)(() => {
105
105
  if (disabled) return;
106
106
  inputRef.current?.focus();
@@ -118,10 +118,10 @@ const PasswordInputImpl = (props, ref) => {
118
118
  }), [blurInput, clearInput, focusInput]);
119
119
  (0, _react().useEffect)(() => {
120
120
  if (!autoFocus || disabled) return;
121
- const timer = setTimeout(() => {
121
+ const t = setTimeout(() => {
122
122
  inputRef.current?.focus();
123
123
  }, 60);
124
- return () => clearTimeout(timer);
124
+ return () => clearTimeout(t);
125
125
  }, [autoFocus, disabled]);
126
126
  const handleChangeText = (0, _react().useCallback)(txt => {
127
127
  updateValue(txt ?? '');
@@ -135,22 +135,22 @@ const PasswordInputImpl = (props, ref) => {
135
135
  onBlurRef.current?.();
136
136
  }, []);
137
137
  const prevSubmitRef = (0, _react().useRef)({
138
- value: normalizedCode,
139
- length: lengthValue
138
+ value: normCode,
139
+ length: lenVal
140
140
  });
141
141
  (0, _react().useEffect)(() => {
142
142
  const prev = prevSubmitRef.current;
143
143
  prevSubmitRef.current = {
144
- value: normalizedCode,
145
- length: lengthValue
144
+ value: normCode,
145
+ length: lenVal
146
146
  };
147
147
  if (!onSubmitRef.current) return;
148
- if (prev.length !== lengthValue) return;
149
- if (lengthValue <= 0 || normalizedCode.length !== lengthValue) return;
150
- if (prev.value === normalizedCode) return;
151
- onSubmitRef.current(normalizedCode);
148
+ if (prev.length !== lenVal) return;
149
+ if (lenVal <= 0 || normCode.length !== lenVal) return;
150
+ if (prev.value === normCode) return;
151
+ onSubmitRef.current(normCode);
152
152
  inputRef.current?.blur();
153
- }, [lengthValue, normalizedCode]);
153
+ }, [lenVal, normCode]);
154
154
  (0, _react().useEffect)(() => {
155
155
  const shouldBlink = showCursor && focused && !disabled;
156
156
  if (blinkTimer.current) {
@@ -175,11 +175,11 @@ const PasswordInputImpl = (props, ref) => {
175
175
  };
176
176
  }, [disabled, focused, showCursor]);
177
177
  const cells = Array.from({
178
- length: lengthValue
178
+ length: lenVal
179
179
  }, (_, i) => {
180
- const char = normalizedCode?.[i];
180
+ const char = normCode?.[i];
181
181
  const isFilled = !!char;
182
- const showBlink = showCursor && focused && !disabled && normalizedCode.length === i && i < lengthValue;
182
+ const showBlink = showCursor && focused && !disabled && normCode.length === i && i < lenVal;
183
183
  return {
184
184
  key: i,
185
185
  char,
@@ -187,35 +187,35 @@ const PasswordInputImpl = (props, ref) => {
187
187
  showBlink
188
188
  };
189
189
  });
190
- const gutterValue = Math.max(0, (0, _number.parseNumberLike)(gutter, 0) ?? 0);
191
- const hasGutter = gutterValue > 0;
190
+ const gutterVal = Math.max(0, (0, _number.parseNumberLike)(gutter, 0) ?? 0);
191
+ const hasGutter = gutterVal > 0;
192
192
  const tipInfo = errorInfo ?? info;
193
- const tipColor = errorInfo ? colors.error : colors.muted;
194
- const backgroundColor = hasGutter ? colors.transparent : colors.background;
193
+ const tipClr = errorInfo ? colors.error : colors.muted;
194
+ const bgClr = hasGutter ? colors.transparent : colors.background;
195
195
  const hiddenInputProps = {
196
196
  ...HIP,
197
197
  underlineColorAndroid: colors.transparent
198
198
  };
199
- const cellTextBase = {
199
+ const cellTxtBase = {
200
200
  color: colors.text,
201
201
  fontSize: sizing.cellTextSize,
202
202
  fontWeight: typography.cellTextWeight,
203
203
  fontFamily: typography.fontFamily
204
204
  };
205
- const wrapperStyle = [S.w, {
206
- backgroundColor,
205
+ const wrapStyle = [S.w, {
206
+ backgroundColor: bgClr,
207
207
  borderRadius: radii.wrapper,
208
208
  paddingHorizontal: spacing.none,
209
209
  opacity: disabled ? opacity.disabled : 1
210
210
  }];
211
211
  const sheetStyle = [S.s, {
212
212
  borderRadius: hasGutter ? 0 : radii.wrapper,
213
- backgroundColor
213
+ backgroundColor: bgClr
214
214
  }];
215
215
  return /*#__PURE__*/_react().default.createElement(_reactNative().View, {
216
216
  style: style
217
217
  }, /*#__PURE__*/_react().default.createElement(_reactNative().Pressable, _extends({}, rest, {
218
- style: wrapperStyle,
218
+ style: wrapStyle,
219
219
  onPress: focusInput,
220
220
  disabled: disabled,
221
221
  accessibilityRole: "button",
@@ -225,7 +225,7 @@ const PasswordInputImpl = (props, ref) => {
225
225
  }), /*#__PURE__*/_react().default.createElement(_reactNative().View, {
226
226
  style: sheetStyle
227
227
  }, cells.map((item, i) => {
228
- const filledTextStyle = [cellTextBase, cellTextStyle, !mask && item.isFilled && highlightTextStyle];
228
+ const filledTextStyle = [cellTxtBase, cellTextStyle, !mask && item.isFilled && highlightTextStyle];
229
229
  const baseCell = [S.c, {
230
230
  backgroundColor: colors.background,
231
231
  height: sizing.cellHeight
@@ -234,7 +234,7 @@ const PasswordInputImpl = (props, ref) => {
234
234
  baseCell.push(S.cg, {
235
235
  borderRadius: radii.cellGutter
236
236
  }, i > 0 && {
237
- marginLeft: gutterValue
237
+ marginLeft: gutterVal
238
238
  });
239
239
  }
240
240
  ;
@@ -269,7 +269,7 @@ const PasswordInputImpl = (props, ref) => {
269
269
  color: colors.border,
270
270
  borderRadius: radii.cellGutter
271
271
  })
272
- }), !hasGutter && i < lengthValue - 1 && /*#__PURE__*/_react().default.createElement(_reactNative().View, {
272
+ }), !hasGutter && i < lenVal - 1 && /*#__PURE__*/_react().default.createElement(_reactNative().View, {
273
273
  style: (0, _hairline.createHairlineView)({
274
274
  position: 'right',
275
275
  color: colors.border,
@@ -279,11 +279,11 @@ const PasswordInputImpl = (props, ref) => {
279
279
  }));
280
280
  }), /*#__PURE__*/_react().default.createElement(_reactNative().TextInput, _extends({
281
281
  ref: inputRef,
282
- value: normalizedCode,
282
+ value: normCode,
283
283
  editable: !disabled,
284
284
  keyboardType: keyboardType,
285
285
  inputMode: inputMode,
286
- maxLength: lengthValue,
286
+ maxLength: lenVal,
287
287
  autoFocus: false,
288
288
  secureTextEntry: mask
289
289
  }, hiddenInputProps, {
@@ -306,7 +306,7 @@ const PasswordInputImpl = (props, ref) => {
306
306
  }]
307
307
  }, (0, _validate.isText)(tipInfo) ? /*#__PURE__*/_react().default.createElement(_reactNative().Text, {
308
308
  style: [S.it, {
309
- color: tipColor
309
+ color: tipClr
310
310
  }]
311
311
  }, tipInfo) : tipInfo) : null);
312
312
  };
@@ -634,17 +634,15 @@ function usePickerValue({
634
634
  onChange,
635
635
  onConfirm
636
636
  }) {
637
- const preparedColumns = (0, _react().useMemo)(() => prepareColumns(columns), [columns]);
637
+ const prep = (0, _react().useMemo)(() => prepareColumns(columns), [columns]);
638
638
  const isControlled = valueProp !== undefined;
639
639
  const onChangeRef = (0, _react().useRef)(onChange);
640
- onChangeRef.current = onChange;
641
640
  const onConfirmRef = (0, _react().useRef)(onConfirm);
641
+ onChangeRef.current = onChange;
642
642
  onConfirmRef.current = onConfirm;
643
- const [innerValue, setInnerValue] = (0, _react().useState)(() => {
644
- const initial = toArrayValue(valueProp ?? defaultValue);
645
- return normalizePicker(preparedColumns, initial).values;
646
- });
643
+ const [innerValue, setInnerValue] = (0, _react().useState)(() => normalizePicker(prep, toArrayValue(valueProp ?? defaultValue)).values);
647
644
  const innerValueRef = (0, _react().useRef)(innerValue);
645
+ innerValueRef.current = innerValue;
648
646
  const commitValue = (0, _react().useCallback)(next => {
649
647
  innerValueRef.current = next;
650
648
  setInnerValue(next);
@@ -652,38 +650,32 @@ function usePickerValue({
652
650
  (0, _react().useEffect)(() => {
653
651
  if (!isControlled) return;
654
652
  const next = toArrayValue(valueProp);
655
- if (!(0, _utils.shallowEqualArray)(innerValueRef.current, next)) {
656
- commitValue(next);
657
- }
653
+ if (!(0, _utils.shallowEqualArray)(innerValueRef.current, next)) commitValue(next);
658
654
  }, [commitValue, isControlled, valueProp]);
659
- const normalized = (0, _react().useMemo)(() => normalizePicker(preparedColumns, innerValue), [preparedColumns, innerValue]);
655
+ const norm = (0, _react().useMemo)(() => normalizePicker(prep, innerValue), [prep, innerValue]);
660
656
  (0, _react().useEffect)(() => {
661
657
  if (isControlled) return;
662
- if (!(0, _utils.shallowEqualArray)(innerValue, normalized.values)) {
663
- commitValue(normalized.values);
664
- onChangeRef.current?.(normalized.values, normalized.options);
665
- if (emitConfirmOnAutoSelect) {
666
- onConfirmRef.current?.(normalized.values, normalized.options);
667
- }
658
+ if (!(0, _utils.shallowEqualArray)(innerValue, norm.values)) {
659
+ commitValue(norm.values);
660
+ onChangeRef.current?.(norm.values, norm.options);
661
+ if (emitConfirmOnAutoSelect) onConfirmRef.current?.(norm.values, norm.options);
668
662
  }
669
- }, [commitValue, emitConfirmOnAutoSelect, innerValue, isControlled, normalized]);
663
+ }, [commitValue, emitConfirmOnAutoSelect, innerValue, isControlled, norm]);
670
664
  const handleSelect = (0, _react().useCallback)((option, colIdx) => {
671
665
  const next = [...innerValueRef.current];
672
666
  next[colIdx] = option.value;
673
- if (preparedColumns.type === 'cascade') {
674
- next.length = colIdx + 1;
675
- }
676
- const final = normalizePicker(preparedColumns, next);
667
+ if (prep.type === 'cascade') next.length = colIdx + 1;
668
+ const final = normalizePicker(prep, next);
677
669
  if ((0, _utils.shallowEqualArray)(innerValueRef.current, final.values)) return;
678
670
  commitValue(final.values);
679
671
  onChangeRef.current?.(final.values, final.options);
680
- }, [commitValue, preparedColumns]);
672
+ }, [commitValue, prep]);
681
673
  const handleConfirm = (0, _react().useCallback)(() => {
682
- onConfirmRef.current?.(normalized.values, normalized.options);
683
- }, [normalized]);
674
+ onConfirmRef.current?.(norm.values, norm.options);
675
+ }, [norm]);
684
676
  return {
685
- preparedColumns,
686
- normalized,
677
+ preparedColumns: prep,
678
+ normalized: norm,
687
679
  handleSelect,
688
680
  handleConfirm
689
681
  };
@@ -756,7 +748,7 @@ const PickerColumn = /*#__PURE__*/_react().default.memo(props => {
756
748
  swipeDuration
757
749
  } = props;
758
750
  const restVisible = Math.max(1, Math.floor((visibleItemCount - 1) / 2));
759
- const valueIndexMap = (0, _react().useMemo)(() => new Map(options.map((option, idx) => [option.value, idx])), [options]);
751
+ const valueIndexMap = (0, _react().useMemo)(() => new Map(options.map((opt, idx) => [opt.value, idx])), [options]);
760
752
  const selIdx = (0, _react().useMemo)(() => {
761
753
  if (!options.length) return 0;
762
754
  const idx = valueIndexMap.get(value);
@@ -764,17 +756,17 @@ const PickerColumn = /*#__PURE__*/_react().default.memo(props => {
764
756
  return findEnabledIndex(options, startIdx);
765
757
  }, [options, value, valueIndexMap]);
766
758
  const handleChange = (0, _react().useCallback)(index => {
767
- const target = findEnabledIndex(options, index);
768
- const option = options[target];
769
- if (!option || option.disabled) return;
770
- onSelect(option, columnIndex, target);
759
+ const tgt = findEnabledIndex(options, index);
760
+ const opt = options[tgt];
761
+ if (!opt || opt.disabled) return;
762
+ onSelect(opt, columnIndex, tgt);
771
763
  }, [columnIndex, onSelect, options]);
772
764
  const {
773
765
  text: cText,
774
766
  textDisabled: cDisabled,
775
767
  textMuted: cMuted
776
768
  } = tokens.colors;
777
- const optionFont = {
769
+ const optFont = {
778
770
  fontSize: tokens.typography.optionSize,
779
771
  fontFamily: tokens.typography.fontFamily,
780
772
  fontWeight: tokens.typography.optionWeight
@@ -784,8 +776,8 @@ const PickerColumn = /*#__PURE__*/_react().default.memo(props => {
784
776
  active = false,
785
777
  disabled = false
786
778
  } = meta ?? {};
787
- const color = disabled ? cDisabled : active ? cText : cMuted;
788
- const content = optionRender ? optionRender(item, {
779
+ const clr = disabled ? cDisabled : active ? cText : cMuted;
780
+ const cnt = optionRender ? optionRender(item, {
789
781
  columnIndex,
790
782
  active
791
783
  }) : item.label ?? item.value;
@@ -793,7 +785,7 @@ const PickerColumn = /*#__PURE__*/_react().default.memo(props => {
793
785
  columnIndex,
794
786
  active
795
787
  });
796
- const a11yLabel = getOptionA11yLabel?.(item, {
788
+ const a11y = getOptionA11yLabel?.(item, {
797
789
  columnIndex,
798
790
  active
799
791
  });
@@ -803,15 +795,15 @@ const PickerColumn = /*#__PURE__*/_react().default.memo(props => {
803
795
  minHeight: itemHeight
804
796
  }],
805
797
  testID: testID,
806
- accessible: !!a11yLabel,
807
- accessibilityLabel: a11yLabel
808
- }, (0, _validate.isText)(content) ? /*#__PURE__*/_react().default.createElement(_reactNative().Text, {
798
+ accessible: !!a11y,
799
+ accessibilityLabel: a11y
800
+ }, (0, _validate.isText)(cnt) ? /*#__PURE__*/_react().default.createElement(_reactNative().Text, {
809
801
  numberOfLines: 1,
810
- style: [S.optTxt, optionFont, {
811
- color
802
+ style: [S.optTxt, optFont, {
803
+ color: clr
812
804
  }]
813
- }, content) : content);
814
- }, [cText, cDisabled, cMuted, columnIndex, getOptionA11yLabel, getOptionTestID, itemHeight, optionFont, optionRender]);
805
+ }, cnt) : cnt);
806
+ }, [cText, cDisabled, cMuted, columnIndex, getOptionA11yLabel, getOptionTestID, itemHeight, optFont, optionRender]);
815
807
  return /*#__PURE__*/_react().default.createElement(_reactNative().View, {
816
808
  style: [W.column, {
817
809
  height: itemHeight * visibleItemCount
@@ -871,12 +863,12 @@ const PickerImpl = props => {
871
863
  testID,
872
864
  ...rest
873
865
  } = props;
874
- const visibleItemCount = getVisibleCount(visibleItemCountProp ?? tokens.defaults.visibleItemCount);
866
+ const visCnt = getVisibleCount(visibleItemCountProp ?? tokens.defaults.visibleItemCount);
875
867
  const {
876
- normalized,
868
+ normalized: norm,
877
869
  handleSelect,
878
870
  handleConfirm,
879
- preparedColumns
871
+ preparedColumns: prep
880
872
  } = usePickerValue({
881
873
  columns,
882
874
  valueProp,
@@ -885,7 +877,7 @@ const PickerImpl = props => {
885
877
  onChange,
886
878
  onConfirm
887
879
  });
888
- const isCascade = preparedColumns.type === 'cascade';
880
+ const isCascade = prep.type === 'cascade';
889
881
  const toolbarFont = {
890
882
  fontSize: tokens.typography.toolbarSize,
891
883
  fontFamily: tokens.typography.fontFamily,
@@ -928,21 +920,21 @@ const PickerImpl = props => {
928
920
  right: 0
929
921
  })
930
922
  })) : null;
931
- const wrapperH = itemHeight * visibleItemCount;
932
- const maskVisibleCnt = Math.max(1, Math.floor((visibleItemCount - 1) / 2));
933
- const indicatorOff = itemHeight * maskVisibleCnt;
923
+ const wrapperH = itemHeight * visCnt;
924
+ const maskVisCnt = Math.max(1, Math.floor((visCnt - 1) / 2));
925
+ const indicatorOff = itemHeight * maskVisCnt;
934
926
  const maskH = indicatorOff;
935
- const hasColumns = normalized.columns.length > 0;
936
- const effectiveMaskColor = maskColor ?? tokens.colors.mask;
937
- const columnsContent = hasColumns ? normalized.columns.map((column, colIdx) => {
938
- const key = isCascade ? `${colIdx}-${normalized.values.slice(0, colIdx).map(String).join('|')}` : String(colIdx);
927
+ const hasCols = norm.columns.length > 0;
928
+ const effMaskColor = maskColor ?? tokens.colors.mask;
929
+ const columnsContent = hasCols ? norm.columns.map((column, colIdx) => {
930
+ const key = isCascade ? `${colIdx}-${norm.values.slice(0, colIdx).map(String).join('|')}` : String(colIdx);
939
931
  return /*#__PURE__*/_react().default.createElement(PickerColumn, {
940
932
  key: key,
941
933
  columnIndex: colIdx,
942
934
  options: column,
943
- value: normalized.values[colIdx],
935
+ value: norm.values[colIdx],
944
936
  itemHeight: itemHeight,
945
- visibleItemCount: visibleItemCount,
937
+ visibleItemCount: visCnt,
946
938
  decelerationRate: decelerationRate,
947
939
  scrollEventThrottle: scrollEventThrottle,
948
940
  optionRender: optionRender,
@@ -967,7 +959,7 @@ const PickerImpl = props => {
967
959
  }, /*#__PURE__*/_react().default.createElement(_reactNative().View, {
968
960
  style: S.columns,
969
961
  pointerEvents: loading ? 'none' : 'auto'
970
- }, columnsTop, columnsContent, columnsBottom, hasColumns && /*#__PURE__*/_react().default.createElement(_react().default.Fragment, null, /*#__PURE__*/_react().default.createElement(_reactNative().View, {
962
+ }, columnsTop, columnsContent, columnsBottom, hasCols && /*#__PURE__*/_react().default.createElement(_react().default.Fragment, null, /*#__PURE__*/_react().default.createElement(_reactNative().View, {
971
963
  pointerEvents: "none",
972
964
  style: [S.indicator, {
973
965
  top: indicatorOff,
@@ -990,12 +982,12 @@ const PickerImpl = props => {
990
982
  })), /*#__PURE__*/_react().default.createElement(GradientMask, {
991
983
  position: "top",
992
984
  height: maskH,
993
- color: effectiveMaskColor,
985
+ color: effMaskColor,
994
986
  maskType: maskType
995
987
  }), /*#__PURE__*/_react().default.createElement(GradientMask, {
996
988
  position: "bottom",
997
989
  height: maskH,
998
- color: effectiveMaskColor,
990
+ color: effMaskColor,
999
991
  maskType: maskType
1000
992
  }))), loading && /*#__PURE__*/_react().default.createElement(_reactNative().View, {
1001
993
  style: [S.loading, {
@@ -129,7 +129,7 @@ const PopupImpl = props => {
129
129
  round,
130
130
  safeArea = false,
131
131
  safeAreaInsetTop = false,
132
- safeAreaInsetBottom: safeAreaInsetBottomProp,
132
+ safeAreaInsetBottom: safeBottomP,
133
133
  lockScroll = true,
134
134
  destroyOnClose = true,
135
135
  duration = 300,
@@ -149,9 +149,9 @@ const PopupImpl = props => {
149
149
  ...rest
150
150
  } = props;
151
151
  const placement = placementProp ?? position ?? 'center';
152
- const shouldCloseOnOverlay = closeOnClickOverlay ?? closeOnOverlayPress ?? true;
152
+ const closeOvl = closeOnClickOverlay ?? closeOnOverlayPress ?? true;
153
153
  const isCenter = placement === 'center';
154
- const safeAreaInsetBottom = safeAreaInsetBottomProp ?? false;
154
+ const safeAreaInsetBottom = safeBottomP ?? false;
155
155
  const tokens = (0, _tokens.usePopupTokens)(tokensOverride);
156
156
  const reducedMotion = (0, _animation.useReducedMotion)();
157
157
  const cbRef = (0, _react().useRef)({
@@ -186,6 +186,7 @@ const PopupImpl = props => {
186
186
  },
187
187
  title: {
188
188
  color: c.title,
189
+ fontFamily: t.fontFamily,
189
190
  fontSize: t.titleSize,
190
191
  fontWeight: t.titleWeight,
191
192
  marginHorizontal: s.descriptionHorizontal,
@@ -199,6 +200,7 @@ const PopupImpl = props => {
199
200
  },
200
201
  desc: {
201
202
  color: c.description,
203
+ fontFamily: t.fontFamily,
202
204
  fontSize: t.descriptionSize,
203
205
  lineHeight: t.descriptionLineHeight
204
206
  },
@@ -228,7 +230,7 @@ const PopupImpl = props => {
228
230
  const [mounted, setMounted] = (0, _react().useState)(visible);
229
231
  const [interVis, setInterVis] = (0, _react().useState)(visible);
230
232
  const isOpen = visible || interVis;
231
- const canCloseOvl = shouldCloseOnOverlay && (onClose || beforeClose);
233
+ const canCloseOvl = closeOvl && (onClose || beforeClose);
232
234
  const progress = (0, _react().useRef)(new (_reactNative().Animated.Value)(0)).current;
233
235
  const animRef = (0, _react().useRef)(null);
234
236
  const seqRef = (0, _react().useRef)(0);
@@ -254,9 +256,7 @@ const PopupImpl = props => {
254
256
  finished
255
257
  }) => {
256
258
  if (!finished || seq !== seqRef.current) return;
257
- if (show) {
258
- cbRef.current.onOpened?.();
259
- } else {
259
+ if (show) cbRef.current.onOpened?.();else {
260
260
  setInterVis(false);
261
261
  if (destroyOnClose) setMounted(false);
262
262
  cbRef.current.onClosed?.();
@@ -301,8 +301,8 @@ const PopupImpl = props => {
301
301
  }, [closeOnPopstate, requestClose, visible]);
302
302
  const handleOvlPress = (0, _react().useCallback)(() => {
303
303
  cbRef.current.onClickOverlay?.();
304
- if (shouldCloseOnOverlay) requestClose('overlay');
305
- }, [requestClose, shouldCloseOnOverlay]);
304
+ if (closeOvl) requestClose('overlay');
305
+ }, [requestClose, closeOvl]);
306
306
  const handleClosePress = (0, _react().useCallback)(() => requestClose('close-icon'), [requestClose]);
307
307
  const handleEscape = (0, _react().useCallback)(() => requestClose('close'), [requestClose]);
308
308
  const {
@@ -321,7 +321,7 @@ const PopupImpl = props => {
321
321
  } = (0, _hooks.useAriaOverlay)({
322
322
  isOpen,
323
323
  onClose: () => requestClose('overlay'),
324
- isDismissable: shouldCloseOnOverlay,
324
+ isDismissable: closeOvl,
325
325
  overlayProps: {
326
326
  ...(_reactNative().Platform.OS === 'android' ? {} : {
327
327
  accessibilityRole: 'dialog'
@@ -37,6 +37,7 @@ const createPopupTokens = foundations => {
37
37
  closeIconPadding: spacing.ssm
38
38
  },
39
39
  typography: {
40
+ fontFamily: typography.fontFamily,
40
41
  titleSize: fontSize.md,
41
42
  titleWeight: typography.weight.medium,
42
43
  descriptionSize: fontSize.sm,
@@ -21,13 +21,12 @@ const PortalComponentImpl = ({
21
21
  }, _ref) => {
22
22
  const manager = (0, _react().useContext)(_PortalContext.PortalContext) ?? _PortalHost.portalManager;
23
23
  const keyRef = (0, _react().useRef)(null);
24
- const shouldRender = isOpen ?? visible ?? true;
25
- const content = shouldRender ? children : null;
24
+ const content = isOpen ?? visible ?? true ? children : null;
26
25
  (0, _react().useLayoutEffect)(() => {
27
- if (keyRef.current === null) keyRef.current = manager.mount(content);else manager.update(keyRef.current, content);
26
+ keyRef.current === null ? keyRef.current = manager.mount(content) : manager.update(keyRef.current, content);
28
27
  }, [manager, content]);
29
28
  (0, _react().useLayoutEffect)(() => () => {
30
- if (keyRef.current !== null) {
29
+ if (keyRef.current != null) {
31
30
  manager.unmount(keyRef.current);
32
31
  keyRef.current = null;
33
32
  }