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
@@ -41,7 +41,7 @@ const SearchComponent = (props, ref) => {
41
41
  action,
42
42
  actionText,
43
43
  showAction = false,
44
- shape: shapeProp,
44
+ shape: shapeP,
45
45
  background,
46
46
  style: containerStyle,
47
47
  fieldStyle,
@@ -62,12 +62,12 @@ const SearchComponent = (props, ref) => {
62
62
  ...restFieldProps
63
63
  } = props;
64
64
  const tokens = (0, _tokens.useSearchTokens)(tokensOverride);
65
- const shape = shapeProp ?? tokens.defaults.shape;
65
+ const shape = shapeP ?? tokens.defaults.shape;
66
66
  const [value, triggerChange] = (0, _hooks.useControllableValue)(props, {
67
67
  defaultValue: ''
68
68
  });
69
69
  const inputValue = value ?? '';
70
- const resolvedInputAlign = align ?? inputAlign;
70
+ const rInputAlign = align ?? inputAlign;
71
71
  const onChangeTextRef = (0, _react().useRef)(onChangeText),
72
72
  onCancelRef = (0, _react().useRef)(onCancel),
73
73
  onSearchRef = (0, _react().useRef)(onSearch),
@@ -90,17 +90,17 @@ const SearchComponent = (props, ref) => {
90
90
  onSearchRef.current?.(inputValueRef.current);
91
91
  onSubmitEditingRef.current?.(event);
92
92
  }, []);
93
- const resolvedBackground = background ?? tokens.colors.background;
94
- const resolvedLeftIcon = leftIcon ?? /*#__PURE__*/_react().default.createElement(_reactNativeSystemIcon().Search, {
93
+ const rBg = background ?? tokens.colors.background;
94
+ const rLeftIcon = leftIcon ?? /*#__PURE__*/_react().default.createElement(_reactNativeSystemIcon().Search, {
95
95
  size: tokens.icon.size,
96
96
  fill: tokens.colors.icon,
97
97
  color: tokens.colors.icon
98
98
  });
99
- const resolvedClearTrigger = clearTrigger ?? tokens.defaults.clearTrigger;
100
- const resolvedReturnKeyType = returnKeyType ?? 'search';
101
- const shouldShowAction = !!action || showAction;
102
- const isCustomActionText = /*#__PURE__*/_react().default.isValidElement(actionText);
103
- const shouldRenderCancelAction = shouldShowAction && !action && !isCustomActionText;
99
+ const rClearTrigger = clearTrigger ?? tokens.defaults.clearTrigger;
100
+ const rReturnKey = returnKeyType ?? 'search';
101
+ const showAct = !!action || showAction;
102
+ const customActTxt = /*#__PURE__*/_react().default.isValidElement(actionText);
103
+ const renderCancelAct = showAct && !action && !customActTxt;
104
104
  const radius = shape === 'round' ? tokens.radius.round : tokens.radius.square;
105
105
  const inputRef = (0, _react().useRef)(null);
106
106
  (0, _react().useImperativeHandle)(ref, () => ({
@@ -108,26 +108,26 @@ const SearchComponent = (props, ref) => {
108
108
  blur: () => inputRef.current?.blur(),
109
109
  clear: () => handleChange('')
110
110
  }), [handleChange]);
111
- const cancelActionPress = (0, _hooks.useAriaPress)({
112
- disabled: !shouldRenderCancelAction,
111
+ const cancelActPress = (0, _hooks.useAriaPress)({
112
+ disabled: !renderCancelAct,
113
113
  onPress: handleCancel,
114
114
  extraProps: {
115
115
  accessibilityRole: 'button',
116
116
  testID: 'rnsu-search-action'
117
117
  }
118
118
  });
119
- const containerStyles = [S.ctr, {
119
+ const ctrStyles = [S.ctr, {
120
120
  paddingHorizontal: tokens.spacing.paddingHorizontal,
121
121
  paddingVertical: tokens.spacing.paddingVertical,
122
- backgroundColor: resolvedBackground
122
+ backgroundColor: rBg
123
123
  }, containerStyle];
124
- const contentStyles = [S.cnt, {
124
+ const cntStyles = [S.cnt, {
125
125
  borderRadius: radius,
126
126
  paddingHorizontal: tokens.spacing.contentPaddingHorizontal,
127
127
  paddingVertical: tokens.spacing.contentPaddingVertical,
128
128
  backgroundColor: tokens.colors.contentBackground
129
129
  }];
130
- const labelElement = !label ? null : (0, _validate.isText)(label) ? /*#__PURE__*/_react().default.createElement(_reactNative().Text, {
130
+ const labelEl = !label ? null : (0, _validate.isText)(label) ? /*#__PURE__*/_react().default.createElement(_reactNative().Text, {
131
131
  style: {
132
132
  marginRight: tokens.spacing.labelGap,
133
133
  color: tokens.colors.label,
@@ -139,20 +139,20 @@ const SearchComponent = (props, ref) => {
139
139
  marginRight: tokens.spacing.labelGap
140
140
  }
141
141
  }, label);
142
- const actionElement = action ? /*#__PURE__*/_react().default.createElement(_reactNative().View, {
142
+ const actEl = action ? /*#__PURE__*/_react().default.createElement(_reactNative().View, {
143
143
  style: [S.act, {
144
144
  marginLeft: tokens.spacing.actionGap
145
145
  }]
146
- }, action) : !shouldShowAction ? null : isCustomActionText ? /*#__PURE__*/_react().default.createElement(_reactNative().View, {
146
+ }, action) : !showAct ? null : customActTxt ? /*#__PURE__*/_react().default.createElement(_reactNative().View, {
147
147
  style: [S.act, {
148
148
  marginLeft: tokens.spacing.actionGap
149
149
  }]
150
150
  }, actionText) : /*#__PURE__*/_react().default.createElement(_reactNative().Pressable, _extends({
151
151
  style: [S.act, {
152
152
  marginLeft: tokens.spacing.actionGap,
153
- opacity: cancelActionPress.states.pressed ? tokens.opacity.actionPressed : 1
153
+ opacity: cancelActPress.states.pressed ? tokens.opacity.actionPressed : 1
154
154
  }]
155
- }, cancelActionPress.interactionProps), /*#__PURE__*/_react().default.createElement(_reactNative().Text, {
155
+ }, cancelActPress.interactionProps), /*#__PURE__*/_react().default.createElement(_reactNative().Text, {
156
156
  style: {
157
157
  color: tokens.colors.action,
158
158
  fontSize: tokens.typography.action,
@@ -160,10 +160,10 @@ const SearchComponent = (props, ref) => {
160
160
  }
161
161
  }, actionText ?? locale.cancel));
162
162
  return /*#__PURE__*/_react().default.createElement(_reactNative().View, {
163
- style: containerStyles
163
+ style: ctrStyles
164
164
  }, /*#__PURE__*/_react().default.createElement(_reactNative().View, {
165
- style: contentStyles
166
- }, labelElement, /*#__PURE__*/_react().default.createElement(_reactNative().View, {
165
+ style: cntStyles
166
+ }, labelEl, /*#__PURE__*/_react().default.createElement(_reactNative().View, {
167
167
  style: S.field
168
168
  }, /*#__PURE__*/_react().default.createElement(_field.default, _extends({
169
169
  ref: inputRef,
@@ -171,12 +171,12 @@ const SearchComponent = (props, ref) => {
171
171
  value: inputValue,
172
172
  onChangeText: handleChange,
173
173
  clearable: clearable,
174
- clearTrigger: resolvedClearTrigger,
175
- leftIcon: resolvedLeftIcon,
174
+ clearTrigger: rClearTrigger,
175
+ leftIcon: rLeftIcon,
176
176
  rightIcon: rightIcon,
177
177
  center: !errorMessage,
178
178
  errorMessage: errorMessage,
179
- inputAlign: resolvedInputAlign,
179
+ inputAlign: rInputAlign,
180
180
  border: false,
181
181
  style: [{
182
182
  paddingHorizontal: tokens.spacing.none,
@@ -189,8 +189,8 @@ const SearchComponent = (props, ref) => {
189
189
  paddingVertical: tokens.spacing.none
190
190
  }, inputStyle],
191
191
  onSubmitEditing: handleSubmit,
192
- returnKeyType: resolvedReturnKeyType
193
- }, restFieldProps)))), actionElement);
192
+ returnKeyType: rReturnKey
193
+ }, restFieldProps)))), actEl);
194
194
  };
195
195
  const SearchForwardRef = /*#__PURE__*/_react().default.forwardRef(SearchComponent);
196
196
  SearchForwardRef.displayName = 'Search';
@@ -122,10 +122,10 @@ const SelectorImpl = props => {
122
122
  const {
123
123
  tokensOverride,
124
124
  options,
125
- columns: columnsProp,
126
- multiple: multipleProp,
127
- showCheckMark: showCheckMarkProp,
128
- disabled: disabledProp,
125
+ columns: colP,
126
+ multiple: multP,
127
+ showCheckMark: showChkP,
128
+ disabled: disP,
129
129
  onChange,
130
130
  itemStyle,
131
131
  labelStyle,
@@ -134,37 +134,30 @@ const SelectorImpl = props => {
134
134
  ...rest
135
135
  } = props;
136
136
  const tokens = (0, _tokens.useSelectorTokens)(tokensOverride);
137
- const columns = columnsProp ?? tokens.defaults.columns ?? 1;
138
- const multiple = multipleProp ?? tokens.defaults.multiple;
139
- const showCheckMark = showCheckMarkProp ?? tokens.defaults.showCheckMark;
140
- const disabled = Boolean(disabledProp ?? tokens.defaults.disabled);
137
+ const columns = colP ?? tokens.defaults.columns ?? 1;
138
+ const multiple = multP ?? tokens.defaults.multiple;
139
+ const showCheckMark = showChkP ?? tokens.defaults.showCheckMark;
140
+ const disabled = Boolean(disP ?? tokens.defaults.disabled);
141
141
  const [value = [], triggerChange] = (0, _hooks.useControllableValue)(props, {
142
142
  defaultValue: []
143
143
  });
144
- const optionsByValue = (0, _react().useMemo)(() => {
145
- const map = new Map();
146
- for (const option of options) map.set(option.value, option);
147
- return map;
144
+ const optionsByVal = (0, _react().useMemo)(() => {
145
+ const m = new Map();
146
+ for (const o of options) m.set(o.value, o);
147
+ return m;
148
148
  }, [options]);
149
- const resolvedColumns = Math.max(1, Math.floor(columns));
150
- const basis = `${100 / resolvedColumns}%`;
149
+ const rCols = Math.max(1, Math.floor(columns));
150
+ const basis = `${100 / rCols}%`;
151
151
  const itemMargin = tokens.spacing.gap / 2;
152
152
  const selectedSet = (0, _react().useMemo)(() => new Set(value), [value]);
153
153
  const toggleOption = (0, _react().useCallback)(option => {
154
154
  if (disabled || option.disabled) return;
155
- const isActive = selectedSet.has(option.value);
156
- let nextValue;
157
- if (multiple) {
158
- nextValue = isActive ? value.filter(item => item !== option.value) : [...value, option.value];
159
- } else {
160
- nextValue = isActive ? [] : [option.value];
161
- }
162
- ;
163
- const items = nextValue.map(val => optionsByValue.get(val)).filter(Boolean);
164
- triggerChange(nextValue, {
165
- items
155
+ const active = selectedSet.has(option.value);
156
+ const nextVal = multiple ? active ? value.filter(item => item !== option.value) : [...value, option.value] : active ? [] : [option.value];
157
+ triggerChange(nextVal, {
158
+ items: nextVal.map(v => optionsByVal.get(v)).filter(Boolean)
166
159
  });
167
- }, [disabled, multiple, optionsByValue, selectedSet, triggerChange, value]);
160
+ }, [disabled, multiple, optionsByVal, selectedSet, triggerChange, value]);
168
161
  return /*#__PURE__*/_react().default.createElement(_reactNative().View, _extends({}, rest, {
169
162
  style: [tokens.layout.container, {
170
163
  marginHorizontal: -itemMargin,
@@ -55,18 +55,21 @@ const ShareSheetOptionItem = /*#__PURE__*/_react().default.memo(({
55
55
  testID: `rv-share-sheet-item-${i}`
56
56
  }
57
57
  });
58
+ const iconNode = (0, _validate.isText)(o.icon) ? (0, _utils.renderTextOrNode)(o.icon, []) : o.icon;
58
59
  return /*#__PURE__*/_react().default.createElement(_reactNative().Pressable, _extends({
59
60
  style: [S.o, ows]
60
61
  }, p.interactionProps), /*#__PURE__*/_react().default.createElement(_reactNative().View, {
61
62
  style: [S.ic, is, {
62
63
  marginHorizontal: t.spacing.iconMarginHorizontal
63
64
  }]
64
- }, o.icon), (0, _validate.isValidNode)(o.name) && (0, _utils.renderTextOrNode)(o.name, [S.ot, {
65
+ }, iconNode), (0, _validate.isValidNode)(o.name) && (0, _utils.renderTextOrNode)(o.name, [S.ot, {
65
66
  color: t.colors.option,
67
+ fontFamily: t.typography.fontFamily,
66
68
  fontSize: t.typography.option,
67
69
  paddingHorizontal: t.spacing.optionTextPaddingHorizontal
68
70
  }]), (0, _validate.isValidNode)(o.description) && ((0, _validate.isText)(o.description) ? (0, _utils.renderTextOrNode)(o.description, [S.od, {
69
71
  color: t.colors.optionDesc,
72
+ fontFamily: t.typography.fontFamily,
70
73
  marginTop: t.spacing.gap,
71
74
  fontSize: t.typography.optionDesc,
72
75
  paddingHorizontal: t.spacing.optionDescPaddingHorizontal
@@ -101,6 +104,7 @@ const ShareSheetCancel = /*#__PURE__*/_react().default.memo(({
101
104
  }]
102
105
  }, cp.interactionProps), (0, _utils.renderTextOrNode)(ct, [S.ct, {
103
106
  color: t.colors.option,
107
+ fontFamily: t.typography.fontFamily,
104
108
  fontSize: t.typography.cancel
105
109
  }])));
106
110
  });
@@ -193,6 +197,7 @@ const ShareSheetImpl = p => {
193
197
  }]
194
198
  }, ht && ((0, _validate.isText)(title) ? (0, _utils.renderTextOrNode)(title, [S.t, {
195
199
  color: t.colors.title,
200
+ fontFamily: t.typography.fontFamily,
196
201
  fontSize: t.typography.title,
197
202
  marginTop: t.spacing.titleMarginTop
198
203
  }]) : /*#__PURE__*/_react().default.createElement(_reactNative().View, {
@@ -201,6 +206,7 @@ const ShareSheetImpl = p => {
201
206
  }]
202
207
  }, title)), hd && ((0, _validate.isText)(description) ? (0, _utils.renderTextOrNode)(description, [S.d, {
203
208
  color: t.colors.description,
209
+ fontFamily: t.typography.fontFamily,
204
210
  fontSize: t.typography.description,
205
211
  marginTop: t.spacing.descriptionMarginTop
206
212
  }]) : /*#__PURE__*/_react().default.createElement(_reactNative().View, {
@@ -208,7 +214,7 @@ const ShareSheetImpl = p => {
208
214
  marginTop: t.spacing.nodeMarginTop
209
215
  }]
210
216
  }, description)));
211
- }, [description, hd, ht, title, t.colors.description, t.colors.title, t.spacing.descriptionMarginTop, t.spacing.headerPaddingBottom, t.spacing.headerPaddingHorizontal, t.spacing.headerPaddingTop, t.spacing.nodeMarginTop, t.spacing.titleMarginTop, t.typography.description, t.typography.title]);
217
+ }, [description, hd, ht, title, t.colors.description, t.colors.title, t.spacing.descriptionMarginTop, t.spacing.headerPaddingBottom, t.spacing.headerPaddingHorizontal, t.spacing.headerPaddingTop, t.spacing.nodeMarginTop, t.spacing.titleMarginTop, t.typography.description, t.typography.fontFamily, t.typography.title]);
212
218
  const psm = [{
213
219
  padding: t.spacing.popupPadding
214
220
  }, ps];
@@ -9,7 +9,8 @@ const createTokens = foundations => {
9
9
  const {
10
10
  palette,
11
11
  spacing,
12
- fontSize
12
+ fontSize,
13
+ typography
13
14
  } = foundations;
14
15
  return {
15
16
  colors: {
@@ -42,6 +43,7 @@ const createTokens = foundations => {
42
43
  icon: 48
43
44
  },
44
45
  typography: {
46
+ fontFamily: typography.fontFamily,
45
47
  title: fontSize.md,
46
48
  description: fontSize.xs,
47
49
  option: fontSize.xs,
@@ -39,38 +39,44 @@ const SidebarBaseImpl = props => {
39
39
  const dir = (0, _useDirection.useDirection)();
40
40
  const sidebarItems = (0, _react().useMemo)(() => {
41
41
  const items = [];
42
- _react().default.Children.toArray(children).forEach((child, index) => {
42
+ _react().default.Children.toArray(children).forEach((child, i) => {
43
43
  if (/*#__PURE__*/_react().default.isValidElement(child)) items.push({
44
44
  element: child,
45
- index
45
+ index: i
46
46
  });
47
47
  });
48
48
  return items;
49
49
  }, [children]);
50
- const firstIndex = sidebarItems[0]?.index ?? 0;
50
+ const firstIdx = sidebarItems[0]?.index ?? 0;
51
51
  const [activeIndex, setActiveIndex] = (0, _hooks.useControllableValue)(props, {
52
- defaultValue: firstIndex,
52
+ defaultValue: firstIdx,
53
53
  valuePropName: 'value',
54
54
  defaultValuePropName: 'defaultValue',
55
55
  trigger: 'onChange'
56
56
  });
57
- const currentIndex = (0, _react().useMemo)(() => {
57
+ const curIdx = (0, _react().useMemo)(() => {
58
58
  for (const item of sidebarItems) {
59
59
  if (item.index === activeIndex) return activeIndex;
60
60
  }
61
- return firstIndex;
62
- }, [activeIndex, firstIndex, sidebarItems]);
63
- const contextValue = (0, _react().useMemo)(() => ({
64
- activeIndex: currentIndex,
61
+ ;
62
+ return firstIdx;
63
+ }, [activeIndex, firstIdx, sidebarItems]);
64
+ const ctxVal = (0, _react().useMemo)(() => ({
65
+ activeIndex: curIdx,
65
66
  onSelect: setActiveIndex
66
- }), [currentIndex, setActiveIndex]);
67
- const clonedItems = (0, _react().useMemo)(() => sidebarItems.map(item => /*#__PURE__*/_react().default.cloneElement(item.element, {
67
+ }), [curIdx, setActiveIndex]);
68
+ const cloned = (0, _react().useMemo)(() => sidebarItems.map(item => /*#__PURE__*/_react().default.cloneElement(item.element, {
68
69
  key: item.element.key ?? item.index,
69
70
  index: item.index,
70
71
  tokensOverride: (0, _designSystem.mergeTokensOverride)(tokensOverride, item.element.props.tokensOverride)
71
72
  })), [sidebarItems, tokensOverride]);
72
- const activeItem = sidebarItems.find(item => item.index === currentIndex)?.element;
73
- const activeContentNode = !(0, _validate.isRenderable)(activeItem?.props?.children) ? null : (0, _utils.renderTextOrNode)(activeItem.props.children);
73
+ const activeItem = sidebarItems.find(item => item.index === curIdx)?.element;
74
+ const contentTxtStyle = (0, _react().useMemo)(() => ({
75
+ fontFamily: tokens.typography.fontFamily,
76
+ fontSize: tokens.typography.contentFontSize,
77
+ fontWeight: tokens.typography.fontWeight
78
+ }), [tokens.typography.fontFamily, tokens.typography.contentFontSize, tokens.typography.fontWeight]);
79
+ const activeContent = !(0, _validate.isRenderable)(activeItem?.props?.children) ? null : (0, _utils.renderTextOrNode)(activeItem.props.children, contentTxtStyle);
74
80
  return /*#__PURE__*/_react().default.createElement(_reactNative().View, _extends({}, rest, {
75
81
  style: [tokens.layout.container, {
76
82
  backgroundColor: tokens.colors.background
@@ -81,8 +87,8 @@ const SidebarBaseImpl = props => {
81
87
  }, sideStyle],
82
88
  accessibilityRole: "tablist"
83
89
  }, /*#__PURE__*/_react().default.createElement(_SidebarContext.SidebarContext.Provider, {
84
- value: contextValue
85
- }, clonedItems), /*#__PURE__*/_react().default.createElement(_reactNative().View, {
90
+ value: ctxVal
91
+ }, cloned), /*#__PURE__*/_react().default.createElement(_reactNative().View, {
86
92
  style: (0, _utils.createHairlineView)({
87
93
  position: dir === 'rtl' ? 'left' : 'right',
88
94
  color: tokens.colors.border,
@@ -91,7 +97,7 @@ const SidebarBaseImpl = props => {
91
97
  })
92
98
  })), /*#__PURE__*/_react().default.createElement(_reactNative().View, {
93
99
  style: [tokens.layout.content, activeItem?.props?.contentStyle]
94
- }, activeContentNode));
100
+ }, activeContent));
95
101
  };
96
102
  const SidebarBase = /*#__PURE__*/_react().default.memo(SidebarBaseImpl);
97
103
  var _default = exports.default = SidebarBase;
@@ -42,16 +42,16 @@ const SidebarItemImpl = props => {
42
42
  ...rest
43
43
  } = props;
44
44
  const tokens = (0, _tokens.useSidebarTokens)(tokensOverride);
45
- const context = (0, _SidebarContext.useSidebarContext)();
46
- if (!context) return null;
45
+ const ctx = (0, _SidebarContext.useSidebarContext)();
46
+ if (!ctx) return null;
47
47
  const disabled = disabledProp ?? tokens.defaults.disabled;
48
- const isActive = context.activeIndex === index;
49
- const titleColor = disabled ? tokens.colors.disabled : isActive ? tokens.colors.titleActive : tokens.colors.title;
48
+ const isActive = ctx.activeIndex === index;
49
+ const titleClr = disabled ? tokens.colors.disabled : isActive ? tokens.colors.titleActive : tokens.colors.title;
50
50
  const press = (0, _hooks.useAriaPress)({
51
51
  disabled,
52
52
  onPress: () => {
53
53
  onClick?.(index);
54
- context.onSelect(index);
54
+ ctx.onSelect(index);
55
55
  },
56
56
  extraProps: {
57
57
  accessibilityRole: 'tab',
@@ -62,14 +62,15 @@ const SidebarItemImpl = props => {
62
62
  testID: `rv-sidebar-item-${index}`
63
63
  }
64
64
  });
65
- const indicatorStyle = [tokens.layout.indicator, {
65
+ const indStyle = [tokens.layout.indicator, {
66
66
  width: tokens.sizing.indicatorWidth,
67
67
  borderRadius: tokens.sizing.indicatorWidth,
68
68
  backgroundColor: tokens.colors.indicator
69
69
  }];
70
70
  const titleNode = (0, _utils.isRenderable)(title) ? (0, _utils.isText)(title) ? /*#__PURE__*/_react().default.createElement(_reactNative().Text, {
71
71
  style: [tokens.layout.title, {
72
- color: titleColor,
72
+ color: titleClr,
73
+ fontFamily: tokens.typography.fontFamily,
73
74
  fontSize: tokens.typography.fontSize,
74
75
  fontWeight: tokens.typography.fontWeight
75
76
  }, textStyle]
@@ -91,7 +92,7 @@ const SidebarItemImpl = props => {
91
92
  }), /*#__PURE__*/_react().default.createElement(_reactNative().View, {
92
93
  style: tokens.layout.indicatorWrapper
93
94
  }, isActive && /*#__PURE__*/_react().default.createElement(_reactNative().View, {
94
- style: indicatorStyle
95
+ style: indStyle
95
96
  })), /*#__PURE__*/_react().default.createElement(_reactNative().View, {
96
97
  style: tokens.layout.itemContent
97
98
  }, /*#__PURE__*/_react().default.createElement(_reactNative().View, {
@@ -74,8 +74,10 @@ const createSidebarTokens = foundations => {
74
74
  indicator: palette.primary[600]
75
75
  },
76
76
  typography: {
77
+ fontFamily: typography.fontFamily,
77
78
  fontSize: fontSize.sm,
78
- fontWeight: typography.weight.medium
79
+ fontWeight: typography.weight.medium,
80
+ contentFontSize: fontSize.sm
79
81
  },
80
82
  sizing: {
81
83
  width: 120,
@@ -32,36 +32,36 @@ const SkeletonImpl = (props, ref) => {
32
32
  const {
33
33
  tokensOverride,
34
34
  isLoaded,
35
- loading: loadingProp,
36
- animate: animateProp,
35
+ loading: loadP,
36
+ animate: animP,
37
37
  startColor,
38
- speed: speedProp,
39
- avatar: avatarProp,
40
- avatarSize: avatarSizeProp,
41
- avatarShape: avatarShapeProp,
42
- title: titleProp,
43
- titleWidth: titleWidthProp,
44
- row: rowProp,
45
- rowWidth: rowWidthProp,
38
+ speed: speedP,
39
+ avatar: avP,
40
+ avatarSize: avSzP,
41
+ avatarShape: avShapeP,
42
+ title: titleP,
43
+ titleWidth: titleWP,
44
+ row: rowP,
45
+ rowWidth: rowWP,
46
46
  rowHeight,
47
- round: roundProp,
47
+ round: roundP,
48
48
  style,
49
49
  children,
50
50
  ...rest
51
51
  } = props;
52
52
  const tokens = (0, _tokens.useSkeletonTokens)(tokensOverride);
53
53
  const reducedMotion = (0, _animation.useReducedMotion)();
54
- const loading = loadingProp ?? (isLoaded != null ? !isLoaded : true);
55
- const animate = animateProp ?? true;
56
- const avatar = avatarProp ?? false;
57
- const avatarSize = avatarSizeProp ?? tokens.defaults.avatarSize;
58
- const avatarShape = avatarShapeProp ?? 'round';
59
- const title = titleProp ?? false;
60
- const titleWidth = titleWidthProp ?? tokens.defaults.titleWidth;
61
- const row = rowProp ?? tokens.defaults.rowCount;
62
- const rowWidth = rowWidthProp ?? tokens.defaults.rowWidth;
63
- const round = roundProp ?? false;
64
- const speed = (0, _utils.isFiniteNumber)(speedProp) ? Math.max(0.01, speedProp) : (0, _utils.isString)(speedProp) && Number.isFinite(Number(speedProp)) && Number(speedProp) > 0 ? Number(speedProp) : 1;
54
+ const loading = loadP ?? (isLoaded != null ? !isLoaded : true);
55
+ const animate = animP ?? true;
56
+ const avatar = avP ?? false;
57
+ const avatarSize = avSzP ?? tokens.defaults.avatarSize;
58
+ const avatarShape = avShapeP ?? 'round';
59
+ const title = titleP ?? false;
60
+ const titleWidth = titleWP ?? tokens.defaults.titleWidth;
61
+ const row = rowP ?? tokens.defaults.rowCount;
62
+ const rowWidth = rowWP ?? tokens.defaults.rowWidth;
63
+ const round = roundP ?? false;
64
+ const speed = (0, _utils.isFiniteNumber)(speedP) ? Math.max(0.01, speedP) : (0, _utils.isString)(speedP) && Number.isFinite(Number(speedP)) && Number(speedP) > 0 ? Number(speedP) : 1;
65
65
  const duration = Math.max(0, tokens.animation.duration / speed);
66
66
  const blockColor = startColor ?? tokens.colors.block;
67
67
  const rows = (0, _utils.isFiniteNumber)(row) ? Math.max(0, Math.floor(row)) : 0;
@@ -72,14 +72,15 @@ const SkeletonImpl = (props, ref) => {
72
72
  }, [props.rowWidth, rowWidth, rows, tokens.defaults.lastRowWidth, tokens.defaults.rowWidth]);
73
73
  const rowHeights = (0, _react().useMemo)(() => resolveSeries(rows, rowHeight, tokens.defaults.rowHeight), [rowHeight, rows, tokens.defaults.rowHeight]);
74
74
  const titleHeight = rowHeights[0] ?? tokens.defaults.rowHeight;
75
- const resolvedAvatarSize = normalize(avatarSize, tokens.defaults.avatarSize);
76
- const resolvedTitleWidth = normalize(titleWidth, tokens.defaults.titleWidth);
75
+ const rAvSz = normalize(avatarSize, tokens.defaults.avatarSize);
76
+ const rTitleW = normalize(titleWidth, tokens.defaults.titleWidth);
77
77
  const animated = (0, _react().useRef)(new (_reactNative().Animated.Value)(0)).current;
78
78
  (0, _react().useEffect)(() => {
79
79
  if (!loading || !animate || duration <= 0 || reducedMotion) {
80
80
  animated.setValue(0);
81
81
  return;
82
82
  }
83
+ ;
83
84
  const loop = _reactNative().Animated.loop(_reactNative().Animated.sequence([_reactNative().Animated.timing(animated, {
84
85
  toValue: 1,
85
86
  duration: duration / 2,
@@ -94,51 +95,51 @@ const SkeletonImpl = (props, ref) => {
94
95
  loop.start();
95
96
  return () => loop.stop();
96
97
  }, [animate, animated, duration, loading, reducedMotion]);
97
- const animatedStyle = (0, _react().useMemo)(() => !loading || !animate ? undefined : {
98
+ const animStyle = (0, _react().useMemo)(() => !loading || !animate ? undefined : {
98
99
  opacity: animated.interpolate({
99
100
  inputRange: [0, 1],
100
101
  outputRange: [tokens.animation.minOpacity, tokens.animation.maxOpacity]
101
102
  })
102
103
  }, [animate, animated, loading, tokens.animation.maxOpacity, tokens.animation.minOpacity]);
103
- const containerStyles = [S.ctr, {
104
+ const ctrStyles = [S.ctr, {
104
105
  gap: tokens.spacing.containerGap
105
106
  }, style];
106
107
  const avatarNode = (0, _react().useMemo)(() => !avatar ? null : /*#__PURE__*/_react().default.createElement(_reactNative().Animated.View, {
107
108
  style: [{
108
- width: resolvedAvatarSize,
109
- height: resolvedAvatarSize,
109
+ width: rAvSz,
110
+ height: rAvSz,
110
111
  borderRadius: avatarShape === 'round' ? 999 : tokens.radius,
111
112
  backgroundColor: blockColor
112
- }, animatedStyle]
113
- }), [animatedStyle, avatar, avatarShape, blockColor, resolvedAvatarSize, tokens.radius]);
113
+ }, animStyle]
114
+ }), [animStyle, avatar, avatarShape, blockColor, rAvSz, tokens.radius]);
114
115
  const titleNode = (0, _react().useMemo)(() => !title ? null : /*#__PURE__*/_react().default.createElement(_reactNative().Animated.View, {
115
116
  style: [{
116
- width: resolvedTitleWidth,
117
+ width: rTitleW,
117
118
  height: titleHeight,
118
119
  backgroundColor: blockColor,
119
120
  borderRadius: round ? tokens.radius : 0
120
- }, animatedStyle]
121
- }), [animatedStyle, blockColor, resolvedTitleWidth, round, title, titleHeight, tokens.radius]);
121
+ }, animStyle]
122
+ }), [animStyle, blockColor, rTitleW, round, title, titleHeight, tokens.radius]);
122
123
  const rowNodes = (0, _react().useMemo)(() => rows <= 0 ? null : /*#__PURE__*/_react().default.createElement(_reactNative().View, {
123
124
  style: S.rows
124
- }, rowWidths.map((width, index) => /*#__PURE__*/_react().default.createElement(_reactNative().Animated.View, {
125
- key: index,
126
- testID: `rv-skeleton-row-${index}`,
125
+ }, rowWidths.map((w, i) => /*#__PURE__*/_react().default.createElement(_reactNative().Animated.View, {
126
+ key: i,
127
+ testID: `rv-skeleton-row-${i}`,
127
128
  style: [{
128
- width: width,
129
- height: rowHeights[index],
130
- marginTop: index === 0 && !title ? 0 : tokens.spacing.rowGap,
129
+ width: w,
130
+ height: rowHeights[i],
131
+ marginTop: i === 0 && !title ? 0 : tokens.spacing.rowGap,
131
132
  backgroundColor: blockColor,
132
133
  borderRadius: round ? tokens.radius : 0
133
- }, animatedStyle]
134
- }))), [animatedStyle, blockColor, rowHeights, rowWidths, rows, round, title, tokens.radius, tokens.spacing.rowGap]);
134
+ }, animStyle]
135
+ }))), [animStyle, blockColor, rowHeights, rowWidths, rows, round, title, tokens.radius, tokens.spacing.rowGap]);
135
136
  if (!loading) return /*#__PURE__*/_react().default.createElement(_reactNative().View, _extends({
136
137
  ref: ref,
137
138
  style: style
138
139
  }, rest), children);
139
140
  return /*#__PURE__*/_react().default.createElement(_reactNative().View, _extends({
140
141
  ref: ref,
141
- style: containerStyles
142
+ style: ctrStyles
142
143
  }, rest), avatarNode, /*#__PURE__*/_react().default.createElement(_reactNative().View, {
143
144
  style: S.cnt
144
145
  }, titleNode, rowNodes));
@@ -205,7 +205,7 @@ const ThumbNode = /*#__PURE__*/_react().default.memo(({
205
205
  return /*#__PURE__*/_react().default.createElement(_reactNative().View, _extends({}, handlers, accessibilityProps, {
206
206
  pointerEvents: isDisabled ? 'none' : 'auto',
207
207
  style: [content ? S.thw : S.t, webGestureStyle, thumbStyle]
208
- }), content ?? /*#__PURE__*/_react().default.createElement(_reactNative().View, {
208
+ }), content != null ? (0, _validate.isText)(content) ? (0, _utils2.renderTextOrNode)(content, []) : content : /*#__PURE__*/_react().default.createElement(_reactNative().View, {
209
209
  style: indicatorStyle
210
210
  }), !content && /*#__PURE__*/_react().default.createElement(_reactNative().View, {
211
211
  style: (0, _hairline.createHairlineView)({