react-native-molecules 0.5.0-beta.1 → 0.5.0-beta.11

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 (165) hide show
  1. package/README.md +87 -0
  2. package/components/Accordion/index.tsx +1 -6
  3. package/components/Accordion/utils.ts +17 -14
  4. package/components/ActivityIndicator/ActivityIndicator.tsx +12 -20
  5. package/components/ActivityIndicator/index.tsx +1 -5
  6. package/components/Appbar/index.tsx +1 -4
  7. package/components/Appbar/utils.ts +33 -21
  8. package/components/Avatar/index.tsx +1 -5
  9. package/components/Avatar/utils.ts +2 -6
  10. package/components/Backdrop/Backdrop.tsx +2 -2
  11. package/components/Backdrop/index.tsx +1 -5
  12. package/components/Backdrop/utils.ts +5 -6
  13. package/components/Badge/index.tsx +1 -5
  14. package/components/Badge/utils.ts +2 -6
  15. package/components/Button/Button.tsx +211 -264
  16. package/components/Button/index.tsx +9 -7
  17. package/components/Button/types.ts +16 -2
  18. package/components/Button/utils.ts +231 -210
  19. package/components/Card/Card.tsx +8 -4
  20. package/components/Card/CardContent.tsx +5 -4
  21. package/components/Card/CardHeader.tsx +5 -3
  22. package/components/Card/CardMedia.tsx +5 -3
  23. package/components/Card/CardTypography.tsx +5 -3
  24. package/components/Card/index.tsx +1 -5
  25. package/components/Card/utils.ts +5 -6
  26. package/components/Checkbox/Checkbox.tsx +1 -0
  27. package/components/Checkbox/CheckboxBase.ios.tsx +1 -0
  28. package/components/Checkbox/CheckboxBase.tsx +24 -128
  29. package/components/Checkbox/index.tsx +1 -5
  30. package/components/Checkbox/utils.ts +6 -31
  31. package/components/Chip/Chip.tsx +40 -52
  32. package/components/Chip/index.tsx +1 -5
  33. package/components/Chip/utils.ts +5 -13
  34. package/components/DatePickerDocked/index.tsx +1 -5
  35. package/components/DatePickerDocked/utils.ts +21 -19
  36. package/components/DatePickerInline/index.tsx +1 -5
  37. package/components/DatePickerInline/utils.ts +41 -28
  38. package/components/DatePickerInput/DatePickerInput.tsx +4 -2
  39. package/components/DatePickerInput/DatePickerInputWithoutModal.tsx +0 -4
  40. package/components/DatePickerInput/index.tsx +1 -5
  41. package/components/DatePickerInput/types.ts +1 -3
  42. package/components/DatePickerInput/utils.ts +5 -6
  43. package/components/DatePickerModal/CalendarEdit.tsx +10 -9
  44. package/components/DatePickerModal/DatePickerModalHeader.tsx +1 -1
  45. package/components/DatePickerModal/index.tsx +1 -5
  46. package/components/DatePickerModal/utils.ts +17 -16
  47. package/components/DateTimePicker/index.tsx +1 -5
  48. package/components/DateTimePicker/utils.ts +5 -6
  49. package/components/Dialog/index.tsx +1 -5
  50. package/components/Dialog/utils.ts +22 -16
  51. package/components/Drawer/Collapsible/utils.ts +13 -13
  52. package/components/Drawer/Drawer.tsx +2 -3
  53. package/components/Drawer/DrawerContent.tsx +5 -3
  54. package/components/Drawer/DrawerFooter.tsx +5 -4
  55. package/components/Drawer/DrawerHeader.tsx +5 -4
  56. package/components/Drawer/DrawerItem.tsx +5 -3
  57. package/components/Drawer/DrawerItemGroup.tsx +5 -4
  58. package/components/Drawer/index.tsx +1 -5
  59. package/components/Drawer/utils.ts +7 -7
  60. package/components/ElementGroup/ElementGroup.tsx +16 -14
  61. package/components/ElementGroup/index.tsx +1 -5
  62. package/components/ElementGroup/utils.ts +5 -6
  63. package/components/FAB/index.tsx +1 -5
  64. package/components/FAB/utils.ts +2 -6
  65. package/components/FilePicker/FilePicker.tsx +47 -76
  66. package/components/FilePicker/index.tsx +1 -5
  67. package/components/FilePicker/utils.ts +5 -6
  68. package/components/HelperText/HelperText.tsx +0 -35
  69. package/components/HelperText/index.tsx +1 -5
  70. package/components/HelperText/utils.ts +5 -7
  71. package/components/HorizontalDivider/HorizontalDivider.tsx +5 -3
  72. package/components/HorizontalDivider/index.tsx +1 -5
  73. package/components/Icon/CrossFadeIcon.tsx +3 -5
  74. package/components/Icon/Icon.tsx +2 -4
  75. package/components/Icon/iconFactory.tsx +3 -3
  76. package/components/Icon/index.tsx +2 -6
  77. package/components/Icon/types.ts +17 -6
  78. package/components/IconButton/IconButton.tsx +45 -58
  79. package/components/IconButton/index.tsx +1 -5
  80. package/components/IconButton/utils.ts +153 -49
  81. package/components/If/index.tsx +1 -5
  82. package/components/InputAddon/index.tsx +1 -5
  83. package/components/InputAddon/utils.ts +5 -6
  84. package/components/Link/index.tsx +1 -5
  85. package/components/Link/utils.ts +2 -6
  86. package/components/ListItem/index.tsx +1 -5
  87. package/components/ListItem/utils.ts +13 -11
  88. package/components/LoadingIndicator/LoadingIndicator.tsx +253 -0
  89. package/components/LoadingIndicator/LoadingIndicator.web.tsx +136 -0
  90. package/components/LoadingIndicator/index.tsx +13 -0
  91. package/components/LoadingIndicator/utils.ts +117 -0
  92. package/components/Menu/index.tsx +1 -5
  93. package/components/Menu/utils.ts +6 -8
  94. package/components/Modal/index.tsx +1 -5
  95. package/components/Modal/utils.ts +2 -6
  96. package/components/NavigationRail/NavigationRailHeader.tsx +1 -1
  97. package/components/NavigationRail/index.tsx +1 -5
  98. package/components/NavigationRail/utils.ts +21 -17
  99. package/components/NavigationStack/index.tsx +1 -5
  100. package/components/NavigationStack/utils.tsx +7 -1
  101. package/components/Portal/index.tsx +1 -5
  102. package/components/RadioButton/index.ts +1 -5
  103. package/components/RadioButton/utils.ts +9 -8
  104. package/components/Rating/index.tsx +1 -5
  105. package/components/Rating/utils.ts +6 -8
  106. package/components/Select/Select.tsx +369 -507
  107. package/components/Select/index.ts +7 -14
  108. package/components/Select/types.ts +2 -4
  109. package/components/Select/utils.ts +215 -0
  110. package/components/Slot/Slot.tsx +244 -0
  111. package/components/Slot/compose-refs.tsx +60 -0
  112. package/components/Slot/index.tsx +8 -0
  113. package/components/StateLayer/index.tsx +1 -5
  114. package/components/StateLayer/utils.ts +5 -6
  115. package/components/Surface/Surface.android.tsx +34 -8
  116. package/components/Surface/Surface.ios.tsx +36 -29
  117. package/components/Surface/Surface.tsx +31 -4
  118. package/components/Surface/index.tsx +1 -5
  119. package/components/Surface/utils.ts +49 -36
  120. package/components/Switch/Switch.tsx +8 -2
  121. package/components/Switch/index.tsx +1 -5
  122. package/components/Switch/utils.ts +2 -6
  123. package/components/Tabs/TabItem.tsx +35 -58
  124. package/components/Tabs/TabLabel.tsx +5 -9
  125. package/components/Tabs/Tabs.tsx +154 -149
  126. package/components/Tabs/index.tsx +1 -5
  127. package/components/Tabs/utils.ts +25 -12
  128. package/components/Text/Text.tsx +2 -8
  129. package/components/TextInput/TextInput.tsx +655 -571
  130. package/components/TextInput/index.tsx +19 -7
  131. package/components/TextInput/types.ts +76 -27
  132. package/components/TextInput/utils.ts +232 -159
  133. package/components/TextInputWithMask/index.tsx +1 -5
  134. package/components/TimePicker/AmPmSwitcher.tsx +1 -1
  135. package/components/TimePicker/index.tsx +1 -5
  136. package/components/TimePicker/utils.ts +29 -21
  137. package/components/TimePickerField/TimePickerField.tsx +7 -5
  138. package/components/TimePickerField/index.tsx +1 -5
  139. package/components/TimePickerField/utils.ts +5 -6
  140. package/components/TimePickerModal/TimePickerModal.tsx +6 -2
  141. package/components/TimePickerModal/index.tsx +1 -5
  142. package/components/TimePickerModal/utils.ts +5 -6
  143. package/components/Tooltip/TooltipTrigger.tsx +25 -16
  144. package/components/Tooltip/index.tsx +1 -5
  145. package/components/Tooltip/utils.ts +5 -6
  146. package/components/TouchableRipple/TouchableRipple.native.tsx +50 -14
  147. package/components/TouchableRipple/TouchableRipple.tsx +137 -47
  148. package/components/TouchableRipple/index.tsx +1 -5
  149. package/components/TouchableRipple/utils.ts +5 -6
  150. package/components/VerticalDivider/VerticalDivider.tsx +9 -8
  151. package/components/VerticalDivider/index.tsx +1 -5
  152. package/core/componentsRegistry.ts +31 -19
  153. package/hocs/withPortal.tsx +1 -1
  154. package/hooks/index.tsx +0 -5
  155. package/hooks/useControlledValue.tsx +20 -4
  156. package/hooks/useSubcomponents.tsx +63 -31
  157. package/hooks/useWhatHasUpdated.tsx +48 -0
  158. package/package.json +12 -15
  159. package/shortcuts-manager/ShortcutsManager/ShortcutsManager.tsx +5 -2
  160. package/styles/shadow.ts +2 -1
  161. package/styles/themes/LightTheme.tsx +1 -1
  162. package/utils/extractPropertiesFromStyles.ts +25 -0
  163. package/utils/lodash.ts +77 -6
  164. package/utils/repository.ts +2 -52
  165. package/hooks/useSearchable.tsx +0 -74
@@ -1,15 +1,6 @@
1
1
  import setColor from 'color';
2
- import {
3
- forwardRef,
4
- memo,
5
- type PropsWithoutRef,
6
- useCallback,
7
- useEffect,
8
- useMemo,
9
- useRef,
10
- } from 'react';
11
- import { Animated, Platform, View, type ViewProps } from 'react-native';
12
- import { StyleSheet } from 'react-native-unistyles';
2
+ import { forwardRef, memo, type PropsWithoutRef, useCallback, useMemo } from 'react';
3
+ import { Platform, type ViewProps } from 'react-native';
13
4
 
14
5
  import { useActionState } from '../../hooks';
15
6
  import { resolveStateVariant } from '../../utils';
@@ -44,9 +35,6 @@ const CheckboxAndroid = (
44
35
  }: Props,
45
36
  ref: any,
46
37
  ) => {
47
- const { current: scaleAnim } = useRef<Animated.Value>(new Animated.Value(1));
48
- const isFirstRendering = useRef<boolean>(true);
49
-
50
38
  const { actionsRef, hovered } = useActionState({ ref, actionsToListen: ['hover'] });
51
39
 
52
40
  const state = resolveStateVariant({
@@ -58,105 +46,25 @@ const CheckboxAndroid = (
58
46
 
59
47
  styles.useVariants({
60
48
  variant: 'android',
49
+ // @ts-ignore // TODO - fix this
61
50
  state: state as States,
62
51
  size,
63
52
  });
64
53
 
65
- // const componentStyles = useComponentStyles('Checkbox', style, {
66
- // variant: 'android',
67
- // state: resolveStateVariant({
68
- // disabled,
69
- // checkedAndHovered: checked && !indeterminate && hovered,
70
- // checked: checked && !indeterminate,
71
- // hovered,
72
- // }),
73
- // size,
74
- // });
75
-
76
- const borderWidth = scaleAnim.interpolate({
77
- inputRange: [0.8, 1],
78
- outputRange: [7, 0],
79
- });
80
-
81
- const {
82
- iconSize,
83
- rippleColor,
84
- scale,
85
- animationDuration,
86
- rippleContainerStyles,
87
- filledContainerStyles,
88
- animatedContainerStyles,
89
- animatedFillStyles,
90
- stateLayerStyle,
91
- iconStyle,
92
- } = useMemo(() => {
93
- // const {
94
- // color: checkedColor,
95
- // uncheckedColor,
96
- // animationScale: _scale,
97
- // animationDuration: _animationDuration,
98
- // iconSize: _iconSize,
99
- // padding,
100
- // width,
101
- // height,
102
- // borderRadius,
103
- // ...checkboxStyles
104
- // // @ts-ignore
105
- // } = styles.root;
106
-
107
- const _color = tokenStylesParser.getColor(checked ? colorProp : uncheckedColorProp);
108
-
109
- return {
110
- iconStyle: [styles.icon, _color],
111
- iconSize: iconSizeMap[size],
112
- // TODO - fix this on web
113
- rippleColor:
114
- Platform.OS === 'web' ? undefined : setColor(_color).fade(0.32).rgb().string(),
115
- checkboxStyle: [styles.root, style],
116
- scale: 1,
117
- animationDuration: 100,
118
- rippleContainerStyles: [styles.root],
119
- animatedContainerStyles: { transform: [{ scale: scaleAnim }] },
120
- filledContainerStyles: [StyleSheet.absoluteFill, styles.fillContainer],
121
- // for toggle animation // This needs to be computed because it's opinionated animation
122
- animatedFillStyles: [
123
- styles.animatedFill, // 4 because padding - border(which is 1px each side)
124
- tokenStylesParser.getColor(checked ? colorProp : uncheckedColorProp, 'borderColor'),
125
- { borderWidth },
126
- ],
127
- stateLayerStyle: [styles.stateLayer, stateLayerProps?.style],
128
- };
129
- }, [
130
- borderWidth,
131
- checked,
132
- colorProp,
133
- scaleAnim,
134
- stateLayerProps?.style,
135
- style,
136
- uncheckedColorProp,
137
- size,
138
- ]);
139
-
140
- useEffect(() => {
141
- // Do not run animation on very first rendering
142
- if (isFirstRendering.current) {
143
- isFirstRendering.current = false;
144
- return;
145
- }
146
-
147
- Animated.sequence([
148
- Animated.timing(scaleAnim, {
149
- toValue: 0.85,
150
- duration: checked ? animationDuration * scale : 0,
151
- useNativeDriver: false,
152
- }),
153
- Animated.timing(scaleAnim, {
154
- toValue: 1,
155
- duration: checked ? animationDuration * scale : animationDuration * scale * 1.75,
156
- useNativeDriver: false,
157
- }),
158
- ]).start();
159
- }, [checked, scaleAnim, scale, animationDuration]);
54
+ const { iconSize, rippleColor, rippleContainerStyles, stateLayerStyle, iconStyle } =
55
+ useMemo(() => {
56
+ const _color = tokenStylesParser.getColor(checked ? colorProp : uncheckedColorProp);
57
+
58
+ return {
59
+ iconStyle: [styles.icon, _color],
60
+ iconSize: iconSizeMap[size],
61
+ // TODO - fix this on web
62
+ rippleColor:
63
+ Platform.OS === 'web' ? undefined : setColor(_color).fade(0.32).rgb().string(),
64
+ rippleContainerStyles: [styles.root, style],
65
+ stateLayerStyle: [styles.stateLayer, stateLayerProps?.style],
66
+ };
67
+ }, [checked, colorProp, uncheckedColorProp, size, style, stateLayerProps?.style]);
160
68
 
161
69
  const onChange = useCallback(() => {
162
70
  onChangeProp?.(!checked);
@@ -184,18 +92,13 @@ const CheckboxAndroid = (
184
92
  testID={testID}
185
93
  ref={actionsRef}>
186
94
  <>
187
- <Animated.View style={animatedContainerStyles}>
188
- <Icon
189
- allowFontScaling={false}
190
- type="material-community"
191
- name={icon}
192
- size={iconSize}
193
- style={iconStyle}
194
- />
195
- <View style={filledContainerStyles}>
196
- <Animated.View style={animatedFillStyles} />
197
- </View>
198
- </Animated.View>
95
+ <Icon
96
+ allowFontScaling={false}
97
+ type="material-community"
98
+ name={icon}
99
+ size={iconSize}
100
+ style={iconStyle}
101
+ />
199
102
  <StateLayer
200
103
  testID={testID ? `${testID}-stateLayer` : ''}
201
104
  {...stateLayerProps}
@@ -206,11 +109,4 @@ const CheckboxAndroid = (
206
109
  );
207
110
  };
208
111
 
209
- // const styles = StyleSheet.create({
210
- // fillContainer: {
211
- // alignItems: 'center',
212
- // justifyContent: 'center',
213
- // },
214
- // });
215
-
216
112
  export default memo(forwardRef(CheckboxAndroid));
@@ -1,10 +1,6 @@
1
- import { getRegisteredComponentWithFallback, registerMoleculesComponents } from '../../core';
1
+ import { getRegisteredComponentWithFallback } from '../../core';
2
2
  import CheckboxComponent from './Checkbox';
3
3
 
4
- registerMoleculesComponents({
5
- Checkbox: CheckboxComponent,
6
- });
7
-
8
4
  export const Checkbox = getRegisteredComponentWithFallback('Checkbox', CheckboxComponent);
9
5
 
10
6
  export type { Props as CheckboxProps } from './Checkbox';
@@ -1,6 +1,6 @@
1
1
  import { StyleSheet } from 'react-native-unistyles';
2
2
 
3
- import { getRegisteredMoleculesComponentStyles, registerComponentsStyles } from '../../core';
3
+ import { getRegisteredComponentStylesWithFallback } from '../../core';
4
4
 
5
5
  const PADDING = 6;
6
6
 
@@ -13,6 +13,10 @@ export const iconSizeMap = {
13
13
  const checkboxStylesDefault = StyleSheet.create(theme => ({
14
14
  root: {
15
15
  variants: {
16
+ variant: {
17
+ android: {},
18
+ ios: {},
19
+ },
16
20
  size: {
17
21
  sm: {
18
22
  padding: PADDING,
@@ -128,31 +132,6 @@ const checkboxStylesDefault = StyleSheet.create(theme => ({
128
132
  },
129
133
  ],
130
134
  },
131
- fillContainer: {
132
- alignItems: 'center',
133
- justifyContent: 'center',
134
- },
135
- animatedFill: {
136
- width: 24 / 2 + (PADDING - 2),
137
- height: 24 / 2 + (PADDING - 2),
138
-
139
- variants: {
140
- size: {
141
- sm: {
142
- width: iconSizeMap.sm / 2 + (PADDING - 2),
143
- height: iconSizeMap.sm / 2 + (PADDING - 2),
144
- },
145
- md: {
146
- width: iconSizeMap.md / 2 + (PADDING - 2),
147
- height: iconSizeMap.md / 2 + (PADDING - 2),
148
- },
149
- lg: {
150
- width: iconSizeMap.lg / 2 + (PADDING - 2),
151
- height: iconSizeMap.lg / 2 + (PADDING - 2),
152
- },
153
- },
154
- },
155
- },
156
135
  icon: {
157
136
  color: theme.colors.onSurfaceVariant,
158
137
 
@@ -203,8 +182,4 @@ const checkboxStylesDefault = StyleSheet.create(theme => ({
203
182
  // },
204
183
  }));
205
184
 
206
- registerComponentsStyles({
207
- Checkbox: checkboxStylesDefault,
208
- });
209
-
210
- export const styles = getRegisteredMoleculesComponentStyles('Checkbox') ?? checkboxStylesDefault;
185
+ export const styles = getRegisteredComponentStylesWithFallback('Checkbox', checkboxStylesDefault);
@@ -97,10 +97,6 @@ export type Props = Omit<TouchableRippleProps, 'children'> &
97
97
  * Whether to show the ActivityIndicator or not
98
98
  */
99
99
  loading?: boolean;
100
- /**
101
- * container style
102
- */
103
- containerStyle?: ViewStyle;
104
100
  /**
105
101
  * left element container style
106
102
  */
@@ -132,7 +128,6 @@ export type Props = Omit<TouchableRippleProps, 'children'> &
132
128
  const Chip = (
133
129
  {
134
130
  style,
135
- containerStyle: containerStyleProp,
136
131
  label: _label,
137
132
  labelCharacterLimit = 20,
138
133
  variant = 'outlined',
@@ -158,11 +153,13 @@ const Chip = (
158
153
  leftElementIconProps,
159
154
  invertLabelColor,
160
155
  backgroundColor,
156
+ onPress,
161
157
  ...rest
162
158
  }: Props,
163
159
  ref: any,
164
160
  ) => {
165
161
  const { hovered, actionsRef } = useActionState({ ref, actionsToListen: ['hover'] });
162
+ const Wrapper = onPress ? TouchableRipple : View;
166
163
 
167
164
  const state = resolveStateVariant({
168
165
  disabled: !!disabled,
@@ -192,47 +189,39 @@ const Chip = (
192
189
  // selectedColorProp ? { selectedColor: selectedColorProp } : {},
193
190
  // ]);
194
191
 
195
- const {
196
- containerStyle,
197
- touchableRippleStyle,
198
- leftElementStyle,
199
- rightElementStyle,
200
- labelStyle,
201
- stateLayerStyle,
202
- } = useMemo(() => {
203
- return {
204
- containerStyle: [
205
- styles.container,
206
- selected && selectionBackgroundColor
207
- ? { backgroundColor: selectionBackgroundColor }
208
- : {},
209
- containerStyleProp,
210
- ],
211
- touchableRippleStyle: [styles.touchableRippleContainer, style],
212
- leftElementStyle: [styles.leftElement, leftElementContainerStyle],
213
- rightElementStyle: [styles.rightElement, rightElementContainerStyle],
214
- labelStyle: [
215
- styles.label,
216
- selected && selectedColor ? { color: selectedColor } : {},
217
- labelStyleProp,
218
- ],
219
- stateLayerStyle: [styles.stateLayer, stateLayerProps?.style],
220
- };
221
- // eslint-disable-next-line react-hooks/exhaustive-deps
222
- }, [
223
- leftElementContainerStyle,
224
- rightElementContainerStyle,
225
- selected,
226
- selectedColor,
227
- selectionBackgroundColor,
228
- stateLayerProps?.style,
229
- style,
230
- containerStyleProp,
231
- labelStyleProp,
232
- state,
233
- size,
234
- variant,
235
- ]);
192
+ const { containerStyle, leftElementStyle, rightElementStyle, labelStyle, stateLayerStyle } =
193
+ useMemo(() => {
194
+ return {
195
+ containerStyle: [
196
+ styles.container,
197
+ selected && selectionBackgroundColor
198
+ ? { backgroundColor: selectionBackgroundColor }
199
+ : {},
200
+ style,
201
+ ],
202
+ leftElementStyle: [styles.leftElement, leftElementContainerStyle],
203
+ rightElementStyle: [styles.rightElement, rightElementContainerStyle],
204
+ labelStyle: [
205
+ styles.label,
206
+ selected && selectedColor ? { color: selectedColor } : {},
207
+ labelStyleProp,
208
+ ],
209
+ stateLayerStyle: [styles.stateLayer, stateLayerProps?.style],
210
+ };
211
+ // eslint-disable-next-line react-hooks/exhaustive-deps
212
+ }, [
213
+ leftElementContainerStyle,
214
+ rightElementContainerStyle,
215
+ selected,
216
+ selectedColor,
217
+ selectionBackgroundColor,
218
+ stateLayerProps?.style,
219
+ style,
220
+ labelStyleProp,
221
+ state,
222
+ size,
223
+ variant,
224
+ ]);
236
225
 
237
226
  const { accessibilityState, elevation } = useMemo(
238
227
  () => ({
@@ -251,14 +240,13 @@ const Chip = (
251
240
  {...containerProps}
252
241
  elevation={elevation}
253
242
  style={containerStyle}
254
- backgroundColor={backgroundColor}>
255
- <TouchableRipple
243
+ backgroundColor={backgroundColor}
244
+ asChild>
245
+ <Wrapper
256
246
  borderless
257
247
  {...rest}
258
248
  disabled={disabled}
259
- style={touchableRippleStyle}
260
249
  accessibilityLabel={accessibilityLabel}
261
- accessibilityRole="button"
262
250
  accessibilityState={accessibilityState}
263
251
  ref={actionsRef}
264
252
  testID={testID}>
@@ -297,7 +285,7 @@ const Chip = (
297
285
  style={stateLayerStyle}
298
286
  />
299
287
  </>
300
- </TouchableRipple>
288
+ </Wrapper>
301
289
  </Surface>
302
290
  );
303
291
  };
@@ -362,7 +350,7 @@ const RightElement = memo(
362
350
  {onClose ? (
363
351
  <IconButtonWithContrastColor
364
352
  name="close"
365
- size={18}
353
+ size={14}
366
354
  accessibilityLabel="Close"
367
355
  disabled={disabled}
368
356
  onPress={onClose}
@@ -1,6 +1,6 @@
1
1
  import type { ComponentType } from 'react';
2
2
 
3
- import { getRegisteredComponentWithFallback, registerMoleculesComponents } from '../../core';
3
+ import { getRegisteredComponentWithFallback } from '../../core';
4
4
  import { default as ChipComponent, type Props as ChipProps } from './Chip';
5
5
 
6
6
  export const ChipDefault = Object.assign(
@@ -40,10 +40,6 @@ export const ChipDefault = Object.assign(
40
40
  },
41
41
  );
42
42
 
43
- registerMoleculesComponents({
44
- Chip: ChipDefault,
45
- });
46
-
47
43
  export const Chip = getRegisteredComponentWithFallback('Chip', ChipDefault);
48
44
 
49
45
  export type { Props as ChipProps } from './Chip';
@@ -1,11 +1,14 @@
1
1
  import { StyleSheet } from 'react-native-unistyles';
2
2
 
3
- import { getRegisteredMoleculesComponentStyles, registerComponentsStyles } from '../../core';
3
+ import { getRegisteredComponentStylesWithFallback } from '../../core';
4
4
 
5
5
  const chipStylesDefault = StyleSheet.create(theme => ({
6
6
  container: {
7
7
  borderRadius: theme.shapes.corner.small,
8
8
  backgroundColor: theme.colors.surface,
9
+ paddingHorizontal: theme.spacings['2'],
10
+ flexDirection: 'row',
11
+ alignItems: 'center',
9
12
 
10
13
  variants: {
11
14
  variant: {
@@ -47,13 +50,6 @@ const chipStylesDefault = StyleSheet.create(theme => ({
47
50
  },
48
51
  },
49
52
  },
50
- touchableRippleContainer: {
51
- flex: 1,
52
- paddingHorizontal: theme.spacings['2'],
53
- borderRadius: theme.shapes.corner.small,
54
- flexDirection: 'row',
55
- alignItems: 'center',
56
- },
57
53
  label: {
58
54
  display: 'flex',
59
55
  color: theme.colors.onSurfaceVariant,
@@ -91,10 +87,6 @@ const chipStylesDefault = StyleSheet.create(theme => ({
91
87
  },
92
88
  }));
93
89
 
94
- registerComponentsStyles({
95
- Chip: chipStylesDefault,
96
- });
97
-
98
- export const styles = getRegisteredMoleculesComponentStyles('Chip');
90
+ export const styles = getRegisteredComponentStylesWithFallback('Chip', chipStylesDefault);
99
91
 
100
92
  export type States = 'hovered' | 'selectedAndHovered' | 'selected' | 'disabled';
@@ -1,10 +1,6 @@
1
- import { getRegisteredComponentWithFallback, registerMoleculesComponents } from '../../core';
1
+ import { getRegisteredComponentWithFallback } from '../../core';
2
2
  import DatePickerDockedDefault from './DatePickerDocked';
3
3
 
4
- registerMoleculesComponents({
5
- DatePickerDocked: DatePickerDockedDefault,
6
- });
7
-
8
4
  export const DatePickerDocked = getRegisteredComponentWithFallback(
9
5
  'DatePickerDocked',
10
6
  DatePickerDockedDefault,
@@ -1,6 +1,6 @@
1
1
  import { StyleSheet } from 'react-native-unistyles';
2
2
 
3
- import { getRegisteredMoleculesComponentStyles, registerComponentsStyles } from '../../core';
3
+ import { getRegisteredComponentStylesWithFallback } from '../../core';
4
4
 
5
5
  const datePickerDockedStylesDefault = StyleSheet.create(theme => ({
6
6
  root: {
@@ -131,25 +131,27 @@ const datePickerDockedMonthStylesDefault = StyleSheet.create(theme => ({
131
131
  },
132
132
  }));
133
133
 
134
- registerComponentsStyles({
135
- DatePickerDocked: datePickerDockedStylesDefault,
136
- DatePickerDocked_Header: datePickerDockedHeaderStylesDefault,
137
- DatePicker_HeaderItem: datePickerHeaderItemStylesDefault,
138
- DatePickerDocked_MonthPicker: datePickerMonthPickerStylesDefault,
139
- DatePickerDocked_MonthItem: datePickerDockedMonthItemStylesDefault,
140
- DatePickerDocked_Month: datePickerDockedMonthStylesDefault,
141
- });
142
-
143
- export const datePickerDockedStyles = getRegisteredMoleculesComponentStyles('DatePickerDocked');
144
- export const datePickerDockedHeaderStyles =
145
- getRegisteredMoleculesComponentStyles('DatePickerDocked_Header');
146
- export const datePickerHeaderItemStyles =
147
- getRegisteredMoleculesComponentStyles('DatePicker_HeaderItem');
148
- export const datePickerMonthPickerStyles = getRegisteredMoleculesComponentStyles(
134
+ export const datePickerDockedStyles = getRegisteredComponentStylesWithFallback(
135
+ 'DatePickerDocked',
136
+ datePickerDockedStylesDefault,
137
+ );
138
+ export const datePickerDockedHeaderStyles = getRegisteredComponentStylesWithFallback(
139
+ 'DatePickerDocked_Header',
140
+ datePickerDockedHeaderStylesDefault,
141
+ );
142
+ export const datePickerHeaderItemStyles = getRegisteredComponentStylesWithFallback(
143
+ 'DatePicker_HeaderItem',
144
+ datePickerHeaderItemStylesDefault,
145
+ );
146
+ export const datePickerMonthPickerStyles = getRegisteredComponentStylesWithFallback(
149
147
  'DatePickerDocked_MonthPicker',
148
+ datePickerMonthPickerStylesDefault,
150
149
  );
151
- export const datePickerDockedMonthItemStyles = getRegisteredMoleculesComponentStyles(
150
+ export const datePickerDockedMonthItemStyles = getRegisteredComponentStylesWithFallback(
152
151
  'DatePickerDocked_MonthItem',
152
+ datePickerDockedMonthItemStylesDefault,
153
+ );
154
+ export const datePickerDockedMonthStyles = getRegisteredComponentStylesWithFallback(
155
+ 'DatePickerDocked_Month',
156
+ datePickerDockedMonthStylesDefault,
153
157
  );
154
- export const datePickerDockedMonthStyles =
155
- getRegisteredMoleculesComponentStyles('DatePickerDocked_Month');
@@ -1,10 +1,6 @@
1
- import { getRegisteredComponentWithFallback, registerMoleculesComponents } from '../../core';
1
+ import { getRegisteredComponentWithFallback } from '../../core';
2
2
  import DatePickerInlineDefault from './DatePickerInline';
3
3
 
4
- registerMoleculesComponents({
5
- DatePickerInline: DatePickerInlineDefault,
6
- });
7
-
8
4
  export const DatePickerInline = getRegisteredComponentWithFallback(
9
5
  'DatePickerInline',
10
6
  DatePickerInlineDefault,
@@ -1,6 +1,6 @@
1
1
  import { StyleSheet } from 'react-native-unistyles';
2
2
 
3
- import { getRegisteredMoleculesComponentStyles, registerComponentsStyles } from '../../core';
3
+ import { getRegisteredComponentStylesWithFallback } from '../../core';
4
4
  import { daySize } from './dateUtils';
5
5
 
6
6
  export const dayNamesHeight = 44;
@@ -338,30 +338,43 @@ const datePickerYearItemStylesDefault = StyleSheet.create(theme => ({
338
338
  },
339
339
  }));
340
340
 
341
- registerComponentsStyles({
342
- DatePickerInline: datePickerStylesDefault,
343
- DatePicker_Month: datePickerMonthStylesDefault,
344
- DatePicker_YearPicker: datePickerYearPickerStylesDefault,
345
- DatePicker_Day: datePickerDayStylesDefault,
346
- DatePicker_DayEmpty: datePickerDayEmptyStylesDefault,
347
- DatePicker_Week: datePickerWeekStylesDefault,
348
- DatePicker_Header: datePickerHeaderStylesDefault,
349
- DatePicker_DayName: dateDayNameStylesDefault,
350
- DatePicker_DayRange: datePickerDayRangeStylesDefault,
351
- DatePicker_YearItem: datePickerYearItemStylesDefault,
352
- });
353
-
354
- export const datePickerStyles = getRegisteredMoleculesComponentStyles('DatePickerInline');
355
- export const datePickerMonthStyles = getRegisteredMoleculesComponentStyles('DatePicker_Month');
356
- export const datePickerYearPickerStyles =
357
- getRegisteredMoleculesComponentStyles('DatePicker_YearPicker');
358
- export const datePickerDayStyles = getRegisteredMoleculesComponentStyles('DatePicker_Day');
359
- export const datePickerDayEmptyStyles =
360
- getRegisteredMoleculesComponentStyles('DatePicker_DayEmpty');
361
- export const datePickerWeekStyles = getRegisteredMoleculesComponentStyles('DatePicker_Week');
362
- export const datePickerHeaderStyles = getRegisteredMoleculesComponentStyles('DatePicker_Header');
363
- export const dateDayNameStyles = getRegisteredMoleculesComponentStyles('DatePicker_DayName');
364
- export const datePickerDayRangeStyles =
365
- getRegisteredMoleculesComponentStyles('DatePicker_DayRange');
366
- export const datePickerYearItemStyles =
367
- getRegisteredMoleculesComponentStyles('DatePicker_YearItem');
341
+ export const datePickerStyles = getRegisteredComponentStylesWithFallback(
342
+ 'DatePickerInline',
343
+ datePickerStylesDefault,
344
+ );
345
+ export const datePickerMonthStyles = getRegisteredComponentStylesWithFallback(
346
+ 'DatePicker_Month',
347
+ datePickerMonthStylesDefault,
348
+ );
349
+ export const datePickerYearPickerStyles = getRegisteredComponentStylesWithFallback(
350
+ 'DatePicker_YearPicker',
351
+ datePickerYearPickerStylesDefault,
352
+ );
353
+ export const datePickerDayStyles = getRegisteredComponentStylesWithFallback(
354
+ 'DatePicker_Day',
355
+ datePickerDayStylesDefault,
356
+ );
357
+ export const datePickerDayEmptyStyles = getRegisteredComponentStylesWithFallback(
358
+ 'DatePicker_DayEmpty',
359
+ datePickerDayEmptyStylesDefault,
360
+ );
361
+ export const datePickerWeekStyles = getRegisteredComponentStylesWithFallback(
362
+ 'DatePicker_Week',
363
+ datePickerWeekStylesDefault,
364
+ );
365
+ export const datePickerHeaderStyles = getRegisteredComponentStylesWithFallback(
366
+ 'DatePicker_Header',
367
+ datePickerHeaderStylesDefault,
368
+ );
369
+ export const dateDayNameStyles = getRegisteredComponentStylesWithFallback(
370
+ 'DatePicker_DayName',
371
+ dateDayNameStylesDefault,
372
+ );
373
+ export const datePickerDayRangeStyles = getRegisteredComponentStylesWithFallback(
374
+ 'DatePicker_DayRange',
375
+ datePickerDayRangeStylesDefault,
376
+ );
377
+ export const datePickerYearItemStyles = getRegisteredComponentStylesWithFallback(
378
+ 'DatePicker_YearItem',
379
+ datePickerYearItemStylesDefault,
380
+ );
@@ -5,6 +5,7 @@ import { useLatest, useToggle } from '../../hooks';
5
5
  import { noop } from '../../utils/lodash';
6
6
  import { DatePickerDocked } from '../DatePickerDocked';
7
7
  import { IconButton } from '../IconButton';
8
+ import { TextInput } from '../TextInput';
8
9
  import DatePickerInputModal from './DatePickerInputModal';
9
10
  import DatePickerInputWithoutModal from './DatePickerInputWithoutModal';
10
11
  import type { DatePickerInputProps } from './types';
@@ -125,8 +126,9 @@ function DatePickerInput(
125
126
  validRange={validRange}
126
127
  onChange={onChange}
127
128
  // locale={locale}
128
- inputButtons={rightElement}
129
- />
129
+ >
130
+ <TextInput.Right>{rightElement}</TextInput.Right>
131
+ </DatePickerInputWithoutModal>
130
132
  );
131
133
  }
132
134