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
@@ -43,154 +43,153 @@ export const ProgressFilledTrack = ({
43
43
  export const Progress = /*#__PURE__*/memo(props => {
44
44
  const {
45
45
  tokensOverride,
46
- percentage: percentageProp,
46
+ percentage: pctP,
47
47
  strokeWidth,
48
48
  color,
49
49
  trackColor,
50
50
  pivotText,
51
51
  pivotColor,
52
52
  textColor,
53
- inactive: inactiveProp,
54
- showPivot: showPivotProp,
53
+ inactive: inactP,
54
+ showPivot: showPivotP,
55
55
  animated,
56
- transition: transitionProp,
57
- animationDuration: animationDurationProp,
56
+ transition: transP,
57
+ animationDuration: durP,
58
58
  style,
59
59
  pivotStyle,
60
60
  indicatorStyle,
61
- orientation: orientationProp,
61
+ orientation: oriP,
62
62
  children,
63
63
  ...rest
64
64
  } = props;
65
65
  const tokens = useProgressTokens(tokensOverride);
66
66
  const reducedMotion = useReducedMotion();
67
- const percentageClamped = clamp(parsePercentage(percentageProp ?? tokens.defaults.percentage), 0, 100);
68
- const height = parseNumberLike(strokeWidth, tokens.sizing.height) ?? tokens.sizing.height;
69
- const inactive = inactiveProp ?? tokens.defaults.inactive;
70
- const orientation = orientationProp ?? 'horizontal';
71
- const showPivotValue = orientation === 'vertical' ? false : showPivotProp ?? tokens.defaults.showPivot;
72
- const shouldAnimate = (animated ?? transitionProp ?? tokens.defaults.transition) && !inactive;
73
- const duration = Math.max(0, animationDurationProp ?? tokens.defaults.animationDuration);
74
- const isGradient = Platform.OS === 'web' && isString(color) && GRADIENT_REGEX.test(color);
75
- const resolvedTrackColor = trackColor ?? tokens.colors.track;
76
- const resolvedIndicatorColor = inactive ? tokens.colors.track : !isGradient ? color ?? tokens.colors.indicator : undefined;
77
- const resolvedPivotBackground = pivotColor ?? (isGradient ? inactive ? tokens.colors.track : tokens.colors.indicator : resolvedIndicatorColor);
78
- const resolvedPivotTextColor = textColor ?? tokens.colors.pivotText;
79
- const pivotContentText = pivotText ?? `${percentageClamped}%`;
80
- const hasPivot = showPivotValue && pivotContentText !== null && pivotContentText !== false;
81
- const animatedValue = useRef(new Animated.Value(percentageClamped)).current;
67
+ const pct = clamp(parsePercentage(pctP ?? tokens.defaults.percentage), 0, 100);
68
+ const h = parseNumberLike(strokeWidth, tokens.sizing.height) ?? tokens.sizing.height;
69
+ const inact = inactP ?? tokens.defaults.inactive;
70
+ const ori = oriP ?? 'horizontal';
71
+ const showPivot = ori === 'vertical' ? false : showPivotP ?? tokens.defaults.showPivot;
72
+ const doAnim = (animated ?? transP ?? tokens.defaults.transition) && !inact;
73
+ const dur = Math.max(0, durP ?? tokens.defaults.animationDuration);
74
+ const isGrad = Platform.OS === 'web' && isString(color) && GRADIENT_REGEX.test(color);
75
+ const trackClr = trackColor ?? tokens.colors.track;
76
+ const indClr = inact ? tokens.colors.track : !isGrad ? color ?? tokens.colors.indicator : undefined;
77
+ const pivotBg = pivotColor ?? (isGrad ? inact ? tokens.colors.track : tokens.colors.indicator : indClr);
78
+ const pivotTxtClr = textColor ?? tokens.colors.pivotText;
79
+ const pivotCnt = pivotText ?? `${pct}%`;
80
+ const hasPiv = showPivot && pivotCnt !== null && pivotCnt !== false;
81
+ const animVal = useRef(new Animated.Value(pct)).current;
82
82
  useEffect(() => {
83
- if (shouldAnimate && duration > 0 && !reducedMotion) {
84
- const animation = Animated.timing(animatedValue, {
85
- toValue: percentageClamped,
86
- duration,
83
+ if (doAnim && dur > 0 && !reducedMotion) {
84
+ const anim = Animated.timing(animVal, {
85
+ toValue: pct,
86
+ duration: dur,
87
87
  useNativeDriver: false,
88
88
  isInteraction: false
89
89
  });
90
- animation.start();
91
- return () => animation.stop();
92
- } else {
93
- animatedValue.setValue(percentageClamped);
94
- }
95
- }, [percentageClamped, shouldAnimate, duration, animatedValue, reducedMotion]);
96
- const [layout, setLayout] = useState({
90
+ anim.start();
91
+ return () => anim.stop();
92
+ } else animVal.setValue(pct);
93
+ }, [pct, doAnim, dur, animVal, reducedMotion]);
94
+ const [lay, setLay] = useState({
97
95
  track: 0,
98
96
  pivot: 0
99
97
  });
100
- const onTrackLayout = useCallback(event => {
101
- const width = event.nativeEvent.layout.width;
102
- setLayout(prev => prev.track === width ? prev : {
98
+ const onTrackLay = useCallback(e => {
99
+ const w = e.nativeEvent.layout.width;
100
+ setLay(prev => prev.track === w ? prev : {
103
101
  ...prev,
104
- track: width
102
+ track: w
105
103
  });
106
104
  }, []);
107
- const onPivotLayout = useCallback(event => {
108
- const width = event.nativeEvent.layout.width;
109
- setLayout(prev => prev.pivot === width ? prev : {
105
+ const onPivotLay = useCallback(e => {
106
+ const w = e.nativeEvent.layout.width;
107
+ setLay(prev => prev.pivot === w ? prev : {
110
108
  ...prev,
111
- pivot: width
109
+ pivot: w
112
110
  });
113
111
  }, []);
114
- const trackStyle = [tokens.layout.track, orientation === 'vertical' ? {
115
- width: height,
112
+ const trackStyle = [tokens.layout.track, ori === 'vertical' ? {
113
+ width: h,
116
114
  height: '100%',
117
- backgroundColor: resolvedTrackColor,
118
- borderRadius: height / 2
115
+ backgroundColor: trackClr,
116
+ borderRadius: h / 2
119
117
  } : {
120
- height: height,
121
- backgroundColor: resolvedTrackColor,
122
- borderRadius: height / 2
118
+ height: h,
119
+ backgroundColor: trackClr,
120
+ borderRadius: h / 2
123
121
  }];
124
122
  const pivotNode = useMemo(() => {
125
- if (!hasPivot) return null;
123
+ if (!hasPiv) return null;
126
124
  const {
127
- track: trackWidth,
128
- pivot: pivotWidth
129
- } = layout;
130
- const pivotContainerStyle = [tokens.layout.pivot, {
131
- bottom: height + tokens.sizing.pivotPaddingVertical * 2,
132
- backgroundColor: resolvedPivotBackground,
125
+ track: tw,
126
+ pivot: pw
127
+ } = lay;
128
+ const ctrStyle = [tokens.layout.pivot, {
129
+ bottom: h + tokens.sizing.pivotPaddingVertical * 2,
130
+ backgroundColor: pivotBg,
133
131
  paddingHorizontal: tokens.sizing.pivotPaddingHorizontal,
134
132
  paddingVertical: tokens.sizing.pivotPaddingVertical,
135
- borderRadius: height,
136
- opacity: trackWidth > 0 ? 1 : 0
133
+ borderRadius: h,
134
+ opacity: tw > 0 ? 1 : 0
137
135
  }];
138
- let transformStyle = null;
139
- if (trackWidth > 0 && pivotWidth > 0) {
140
- const pivotPosition1 = pivotWidth / 2 / trackWidth * 100;
141
- const pivotPosition2 = (trackWidth - pivotWidth / 2) / trackWidth * 100;
142
- if (pivotPosition1 < pivotPosition2) {
143
- transformStyle = {
144
- transform: [{
145
- translateX: animatedValue.interpolate({
146
- inputRange: [0, pivotPosition1, pivotPosition2, 100],
147
- outputRange: [0, 0, trackWidth - pivotWidth, trackWidth - pivotWidth],
148
- extrapolate: 'clamp'
149
- })
150
- }]
151
- };
152
- } else {
153
- transformStyle = {
154
- transform: [{
155
- translateX: (trackWidth - pivotWidth) / 2
156
- }]
157
- };
158
- }
159
- }
136
+ let transStyle = null;
137
+ if (tw > 0 && pw > 0) {
138
+ const p1 = pw / 2 / tw * 100;
139
+ const p2 = (tw - pw / 2) / tw * 100;
140
+ transStyle = p1 < p2 ? {
141
+ transform: [{
142
+ translateX: animVal.interpolate({
143
+ inputRange: [0, p1, p2, 100],
144
+ outputRange: [0, 0, tw - pw, tw - pw],
145
+ extrapolate: 'clamp'
146
+ })
147
+ }]
148
+ } : {
149
+ transform: [{
150
+ translateX: (tw - pw) / 2
151
+ }]
152
+ };
153
+ } else transStyle = {
154
+ transform: [{
155
+ translateX: (tw - pw) / 2
156
+ }]
157
+ };
160
158
  return /*#__PURE__*/React.createElement(Animated.View, {
161
- style: [pivotContainerStyle, transformStyle],
159
+ style: [ctrStyle, transStyle],
162
160
  pointerEvents: "none",
163
- onLayout: onPivotLayout
164
- }, isText(pivotContentText) ? /*#__PURE__*/React.createElement(Text, {
161
+ onLayout: onPivotLay
162
+ }, isText(pivotCnt) ? /*#__PURE__*/React.createElement(Text, {
165
163
  style: [tokens.layout.pivotText, {
166
- color: resolvedPivotTextColor,
164
+ color: pivotTxtClr,
165
+ fontFamily: tokens.typography.fontFamily,
167
166
  fontSize: tokens.typography.pivotFontSize
168
167
  }, pivotStyle]
169
- }, pivotContentText) : pivotContentText);
170
- }, [animatedValue, hasPivot, height, layout, onPivotLayout, pivotContentText, pivotStyle, resolvedPivotBackground, resolvedPivotTextColor, tokens.layout.pivot, tokens.layout.pivotText, tokens.sizing.pivotPaddingHorizontal, tokens.sizing.pivotPaddingVertical, tokens.typography.pivotFontSize]);
171
- const progressContextValue = useMemo(() => ({
172
- animatedValue: animatedValue,
173
- orientation: orientation,
174
- height: height,
175
- indicatorColor: resolvedIndicatorColor,
168
+ }, pivotCnt) : pivotCnt);
169
+ }, [animVal, hasPiv, h, lay, onPivotLay, pivotCnt, pivotStyle, pivotBg, pivotTxtClr, tokens.layout.pivot, tokens.layout.pivotText, tokens.sizing.pivotPaddingHorizontal, tokens.sizing.pivotPaddingVertical, tokens.typography.fontFamily, tokens.typography.pivotFontSize]);
170
+ const ctxVal = useMemo(() => ({
171
+ animatedValue: animVal,
172
+ orientation: ori,
173
+ height: h,
174
+ indicatorColor: indClr,
176
175
  indicatorStyle: indicatorStyle,
177
- isGradient: isGradient,
178
- gradientColor: isGradient ? color : undefined,
176
+ isGradient: isGrad,
177
+ gradientColor: isGrad ? color : undefined,
179
178
  layoutIndicator: tokens.layout.indicator
180
- }), [animatedValue, color, height, indicatorStyle, isGradient, orientation, resolvedIndicatorColor, tokens.layout.indicator]);
179
+ }), [animVal, color, h, indicatorStyle, isGrad, ori, indClr, tokens.layout.indicator]);
181
180
  return /*#__PURE__*/React.createElement(ProgressContext.Provider, {
182
- value: progressContextValue
181
+ value: ctxVal
183
182
  }, /*#__PURE__*/React.createElement(View, _extends({
184
183
  style: style,
185
184
  accessibilityRole: "progressbar",
186
185
  accessibilityValue: {
187
186
  min: 0,
188
187
  max: 100,
189
- now: percentageClamped
188
+ now: pct
190
189
  }
191
190
  }, rest), /*#__PURE__*/React.createElement(View, {
192
191
  style: trackStyle,
193
- onLayout: hasPivot ? onTrackLayout : undefined
192
+ onLayout: hasPiv ? onTrackLay : undefined
194
193
  }, children ?? /*#__PURE__*/React.createElement(ProgressFilledTrack, null)), pivotNode));
195
194
  });
196
195
  Progress.displayName = 'Progress';
@@ -32,6 +32,7 @@ export const createProgressTokens = foundations => {
32
32
  pivotText: onPrimary
33
33
  },
34
34
  typography: {
35
+ fontFamily: foundations.typography.fontFamily,
35
36
  pivotFontSize: foundations.fontSize.xs
36
37
  },
37
38
  sizing: {
@@ -17,7 +17,7 @@ export const Radio = /*#__PURE__*/React.memo(props => {
17
17
  iconSize,
18
18
  checkedColor,
19
19
  iconRender,
20
- shape: shapeProp,
20
+ shape: shapeP,
21
21
  labelPosition,
22
22
  labelDisabled,
23
23
  disabled,
@@ -32,129 +32,133 @@ export const Radio = /*#__PURE__*/React.memo(props => {
32
32
  } = props;
33
33
  const tokens = useRadioTokens(tokensOverride);
34
34
  const group = useContext(RadioGroupContext);
35
- const optionValue = value ?? name;
36
- const serializedValue = optionValue == null ? undefined : String(optionValue);
37
- const isGroup = !!group && serializedValue !== undefined;
38
- const resolvedIconSize = parseNumber(iconSize ?? group?.iconSize, tokens.defaults.iconSize);
39
- const resolvedCheckedColor = checkedColor ?? group?.checkedColor ?? tokens.colors.checkedBackground;
40
- const resolvedLabelPosition = labelPosition ?? tokens.defaults.labelPosition;
41
- const resolvedLabelDisabled = labelDisabled ?? group?.labelDisabled ?? tokens.defaults.labelDisabled;
42
- const resolvedDisabled = Boolean(disabled || group?.state.isDisabled);
43
- const shape = shapeProp ?? tokens.defaults.shape;
44
- const standaloneKey = serializedValue ?? 'standalone';
35
+ const optVal = value ?? name;
36
+ const sv = optVal == null ? undefined : String(optVal);
37
+ const isGroup = !!group && sv !== undefined;
38
+ const rIconSz = parseNumber(iconSize ?? group?.iconSize, tokens.defaults.iconSize);
39
+ const rCheckedClr = checkedColor ?? group?.checkedColor ?? tokens.colors.checkedBackground;
40
+ const rLabelPos = labelPosition ?? tokens.defaults.labelPosition;
41
+ const rLabelDis = labelDisabled ?? group?.labelDisabled ?? tokens.defaults.labelDisabled;
42
+ const rDis = Boolean(disabled || group?.state.isDisabled);
43
+ const shape = shapeP ?? tokens.defaults.shape;
44
+ const standKey = sv ?? 'standalone';
45
45
  const inputRef = useRef(null);
46
- const inputElementRef = useRef(null);
46
+ const inputElRef = useRef(null);
47
47
  const onChangeRef = useRef(onChange);
48
48
  onChangeRef.current = onChange;
49
49
  const onClickRef = useRef(onClick);
50
50
  onClickRef.current = onClick;
51
- const resolvedAccessibilityLabel = accessibilityLabel ?? ariaLabel ?? (isText(children) ? String(children) : undefined) ?? serializedValue ?? 'radio';
51
+ const rAccLabel = accessibilityLabel ?? ariaLabel ?? (isText(children) ? String(children) : undefined) ?? sv ?? 'radio';
52
52
  const {
53
- isSelected: standaloneSelected,
54
- setSelected: setStandaloneSelected
53
+ isSelected: standSel,
54
+ setSelected: setStandSel
55
55
  } = useToggleState({
56
56
  isSelected: checked,
57
57
  defaultSelected: defaultChecked,
58
58
  onChange: next => onChange?.(next)
59
59
  });
60
60
  const pseudoState = {
61
- selectedValue: standaloneSelected ? standaloneKey : null,
61
+ selectedValue: standSel ? standKey : null,
62
62
  setSelectedValue: next => {
63
- setStandaloneSelected(next === standaloneKey);
63
+ setStandSel(next === standKey);
64
64
  }
65
65
  };
66
66
  useEffect(() => {
67
- if (isGroup && group && serializedValue !== undefined) {
68
- group.registerValue(serializedValue, optionValue ?? serializedValue);
69
- return () => group.unregisterValue(serializedValue);
67
+ if (isGroup && group && sv !== undefined) {
68
+ group.registerValue(sv, optVal ?? sv);
69
+ return () => group.unregisterValue(sv);
70
70
  }
71
+ ;
71
72
  return undefined;
72
- }, [group, isGroup, optionValue, serializedValue]);
73
+ }, [group, isGroup, optVal, sv]);
73
74
  const state = isGroup && group ? group.state : pseudoState;
74
- const radioValue = isGroup ? serializedValue : standaloneKey;
75
+ const radioVal = isGroup ? sv : standKey;
75
76
  const {
76
77
  onBlur,
77
78
  onFocus,
78
- ...compatibleRest
79
+ ...compRest
79
80
  } = rest;
80
- const ariaRef = Platform.OS === 'web' ? inputElementRef : inputRef;
81
+ const ariaRef = Platform.OS === 'web' ? inputElRef : inputRef;
81
82
  const {
82
83
  inputProps
83
84
  } = useRadio({
84
- value: radioValue,
85
- isDisabled: resolvedDisabled,
86
- 'aria-label': resolvedAccessibilityLabel,
87
- accessibilityLabel: resolvedAccessibilityLabel,
88
- ...compatibleRest
85
+ value: radioVal,
86
+ isDisabled: rDis,
87
+ 'aria-label': rAccLabel,
88
+ accessibilityLabel: rAccLabel,
89
+ ...compRest
89
90
  }, state, ariaRef);
90
- const isChecked = isGroup && group && serializedValue !== undefined ? group.state.selectedValue === serializedValue : checked !== undefined ? checked : standaloneSelected;
91
+ const isChecked = isGroup && group && sv !== undefined ? group.state.selectedValue === sv : checked !== undefined ? checked : standSel;
91
92
  const inputOnPress = inputProps?.onPress;
92
93
  const handlePress = useCallback(e => {
93
94
  onClickRef.current?.(e);
94
- if (resolvedDisabled) return;
95
- if (isGroup && group && serializedValue !== undefined) {
96
- if (!isChecked) group.state.setSelectedValue(serializedValue);
95
+ if (rDis) return;
96
+ if (isGroup && group && sv !== undefined) {
97
+ if (!isChecked) group.state.setSelectedValue(sv);
97
98
  return;
98
99
  }
100
+ ;
99
101
  if (checked !== undefined) {
100
102
  onChangeRef.current?.(!checked);
101
103
  return;
102
104
  }
105
+ ;
103
106
  if (onChangeRef.current) {
104
- setStandaloneSelected(!standaloneSelected);
107
+ setStandSel(!standSel);
105
108
  return;
106
109
  }
110
+ ;
107
111
  inputOnPress?.(e);
108
- }, [checked, group, inputOnPress, isChecked, isGroup, resolvedDisabled, serializedValue, setStandaloneSelected, standaloneSelected]);
112
+ }, [checked, group, inputOnPress, isChecked, isGroup, rDis, sv, setStandSel, standSel]);
109
113
  const mergedInputProps = inputProps ? {
110
114
  ...inputProps,
111
115
  onPress: handlePress
112
116
  } : {};
113
- const borderColor = resolvedDisabled ? tokens.colors.disabledBorder : isChecked ? resolvedCheckedColor : tokens.colors.border;
114
- const backgroundColor = resolvedDisabled ? tokens.colors.disabledBackground : tokens.colors.background;
115
- const spacingStyle = resolvedLabelPosition === 'left' ? {
117
+ const borderClr = rDis ? tokens.colors.disabledBorder : isChecked ? rCheckedClr : tokens.colors.border;
118
+ const bgClr = rDis ? tokens.colors.disabledBackground : tokens.colors.background;
119
+ const spacingStyle = rLabelPos === 'left' ? {
116
120
  marginRight: tokens.spacing.gap
117
121
  } : {
118
122
  marginLeft: tokens.spacing.gap
119
123
  };
120
- const labelColor = resolvedDisabled ? tokens.colors.labelDisabled : tokens.colors.label;
121
- const borderRadius = shape === 'square' ? tokens.radii.square : tokens.radii.round;
124
+ const labelClr = rDis ? tokens.colors.labelDisabled : tokens.colors.label;
125
+ const radius = shape === 'square' ? tokens.radii.square : tokens.radii.round;
122
126
  const labelNode = useMemo(() => !isRenderable(children) ? null : /*#__PURE__*/React.createElement(View, {
123
127
  style: [tokens.layout.labelWrapper, spacingStyle],
124
128
  pointerEvents: "none",
125
129
  accessible: false
126
130
  }, renderTextOrNode(children, [tokens.layout.label, {
127
- color: labelColor,
131
+ color: labelClr,
128
132
  fontSize: tokens.typography.fontSize,
129
133
  lineHeight: tokens.typography.fontSize * tokens.typography.lineHeightMultiplier,
130
134
  fontFamily: tokens.typography.fontFamily,
131
135
  fontWeight: tokens.typography.fontWeight
132
- }, labelStyle].filter(Boolean))), [children, labelColor, labelStyle, spacingStyle, tokens.layout.label, tokens.layout.labelWrapper, tokens.typography.fontFamily, tokens.typography.fontSize, tokens.typography.fontWeight, tokens.typography.lineHeightMultiplier]);
133
- const interactive = !resolvedDisabled && !resolvedLabelDisabled;
136
+ }, labelStyle].filter(Boolean))), [children, labelClr, labelStyle, spacingStyle, tokens.layout.label, tokens.layout.labelWrapper, tokens.typography.fontFamily, tokens.typography.fontSize, tokens.typography.fontWeight, tokens.typography.lineHeightMultiplier]);
137
+ const interactive = !rDis && !rLabelDis;
134
138
  const defaultIcon = useMemo(() => /*#__PURE__*/React.createElement(View, {
135
139
  style: [tokens.layout.icon, {
136
- width: resolvedIconSize,
137
- height: resolvedIconSize,
138
- borderRadius,
139
- backgroundColor
140
+ width: rIconSz,
141
+ height: rIconSz,
142
+ borderRadius: radius,
143
+ backgroundColor: bgClr
140
144
  }]
141
145
  }, isChecked && /*#__PURE__*/React.createElement(View, {
142
146
  style: {
143
- width: resolvedIconSize * tokens.sizing.dotScale,
144
- height: resolvedIconSize * tokens.sizing.dotScale,
145
- borderRadius,
146
- backgroundColor: resolvedCheckedColor
147
+ width: rIconSz * tokens.sizing.dotScale,
148
+ height: rIconSz * tokens.sizing.dotScale,
149
+ borderRadius: radius,
150
+ backgroundColor: rCheckedClr
147
151
  }
148
152
  }), /*#__PURE__*/React.createElement(View, {
149
153
  style: createHairlineView({
150
154
  position: 'all',
151
- color: borderColor,
152
- borderRadius
155
+ color: borderClr,
156
+ borderRadius: radius
153
157
  })
154
- })), [backgroundColor, borderColor, borderRadius, isChecked, resolvedCheckedColor, resolvedIconSize, tokens.layout.icon, tokens.sizing.dotScale]);
158
+ })), [bgClr, borderClr, radius, isChecked, rCheckedClr, rIconSz, tokens.layout.icon, tokens.sizing.dotScale]);
155
159
  const iconVisual = iconRender ? iconRender({
156
160
  checked: Boolean(isChecked),
157
- disabled: Boolean(resolvedDisabled)
161
+ disabled: Boolean(rDis)
158
162
  }) ?? null : defaultIcon;
159
163
  const webInputStyle = {
160
164
  position: 'absolute',
@@ -173,7 +177,7 @@ export const Radio = /*#__PURE__*/React.memo(props => {
173
177
  ...webInputProps
174
178
  } = inputProps ?? {};
175
179
  const webInputNode = Platform.OS === 'web' ? /*#__PURE__*/React.createElement("input", _extends({
176
- ref: inputElementRef
180
+ ref: inputElRef
177
181
  }, webInputProps, {
178
182
  style: webInputStyle
179
183
  })) : null;
@@ -181,26 +185,26 @@ export const Radio = /*#__PURE__*/React.memo(props => {
181
185
  style: tokens.layout.iconWrapper
182
186
  }, iconVisual, webInputNode) : /*#__PURE__*/React.createElement(Pressable, _extends({}, mergedInputProps, {
183
187
  ref: inputRef,
184
- testID: serializedValue !== undefined ? `radio-icon-${serializedValue}` : undefined,
185
- disabled: resolvedDisabled,
188
+ testID: sv !== undefined ? `radio-icon-${sv}` : undefined,
189
+ disabled: rDis,
186
190
  accessibilityRole: "radio",
187
191
  accessibilityState: {
188
192
  selected: isChecked,
189
- disabled: resolvedDisabled
193
+ disabled: rDis
190
194
  },
191
195
  style: tokens.layout.iconWrapper
192
196
  }), iconVisual, webInputNode);
193
- const isLeft = resolvedLabelPosition === 'left';
197
+ const isLeft = rLabelPos === 'left';
194
198
  const first = isLeft ? labelNode : iconNode;
195
199
  const second = isLeft ? iconNode : labelNode;
196
200
  if (interactive) return /*#__PURE__*/React.createElement(Pressable, _extends({}, mergedInputProps, {
197
201
  ref: inputRef,
198
- testID: serializedValue !== undefined ? `radio-icon-${serializedValue}` : undefined,
199
- disabled: resolvedDisabled,
202
+ testID: sv !== undefined ? `radio-icon-${sv}` : undefined,
203
+ disabled: rDis,
200
204
  accessibilityRole: "radio",
201
205
  accessibilityState: {
202
206
  selected: isChecked,
203
- disabled: resolvedDisabled
207
+ disabled: rDis
204
208
  },
205
209
  style: [tokens.layout.container, style]
206
210
  }), first, second);
@@ -51,14 +51,14 @@ const RadioGroupImpl = props => {
51
51
  'aria-label': accessibilityLabel,
52
52
  name
53
53
  }, state);
54
- const resolvedRadioGroupProps = useMemo(() => ({
54
+ const rProps = useMemo(() => ({
55
55
  ...(radioGroupProps ?? {}),
56
56
  ...(accessibilityHint && {
57
57
  'aria-describedby': accessibilityHint
58
58
  }),
59
59
  'aria-disabled': disabled
60
60
  }), [accessibilityHint, disabled, radioGroupProps]);
61
- const contextValue = useMemo(() => ({
61
+ const ctxVal = useMemo(() => ({
62
62
  state,
63
63
  direction,
64
64
  iconSize,
@@ -67,16 +67,16 @@ const RadioGroupImpl = props => {
67
67
  registerValue,
68
68
  unregisterValue
69
69
  }), [checkedColor, direction, iconSize, labelDisabled, registerValue, state, unregisterValue]);
70
- const containerStyle = [direction === 'horizontal' ? tokens.layout.groupHorizontal : tokens.layout.groupVertical, {
70
+ const ctrStyle = [direction === 'horizontal' ? tokens.layout.groupHorizontal : tokens.layout.groupVertical, {
71
71
  columnGap: direction === 'horizontal' ? gap : undefined,
72
72
  rowGap: gap
73
73
  }, style];
74
74
  return /*#__PURE__*/React.createElement(RadioGroupContext.Provider, {
75
- value: contextValue
76
- }, /*#__PURE__*/React.createElement(View, _extends({}, resolvedRadioGroupProps, viewProps, {
75
+ value: ctxVal
76
+ }, /*#__PURE__*/React.createElement(View, _extends({}, rProps, viewProps, {
77
77
  accessibilityLabel: accessibilityLabel,
78
78
  accessibilityHint: accessibilityHint,
79
- style: containerStyle
79
+ style: ctrStyle
80
80
  }), children));
81
81
  };
82
82
  export const RadioGroup = /*#__PURE__*/React.memo(RadioGroupImpl);
@@ -8,11 +8,11 @@ const SafeAreaViewImpl = ({
8
8
  onLayout,
9
9
  pointerEvents
10
10
  }) => {
11
- const padding = useSafeAreaPadding({});
11
+ const pad = useSafeAreaPadding({});
12
12
  if (edge === 'top') return /*#__PURE__*/React.createElement(View, {
13
13
  style: [{
14
14
  width: '100%',
15
- minHeight: padding.paddingTop
15
+ minHeight: pad.paddingTop
16
16
  }, style],
17
17
  onLayout: onLayout,
18
18
  pointerEvents: pointerEvents ?? 'none'
@@ -20,17 +20,17 @@ const SafeAreaViewImpl = ({
20
20
  if (edge === 'bottom') return /*#__PURE__*/React.createElement(View, {
21
21
  style: [{
22
22
  width: '100%',
23
- minHeight: padding.paddingBottom
23
+ minHeight: pad.paddingBottom
24
24
  }, style],
25
25
  pointerEvents: pointerEvents ?? 'none'
26
26
  });
27
27
  return /*#__PURE__*/React.createElement(View, {
28
28
  style: [{
29
29
  width: '100%',
30
- paddingTop: padding.paddingTop,
31
- paddingBottom: padding.paddingBottom,
32
- paddingLeft: padding.paddingLeft,
33
- paddingRight: padding.paddingRight
30
+ paddingTop: pad.paddingTop,
31
+ paddingBottom: pad.paddingBottom,
32
+ paddingLeft: pad.paddingLeft,
33
+ paddingRight: pad.paddingRight
34
34
  }, style],
35
35
  onLayout: onLayout,
36
36
  pointerEvents: pointerEvents