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.
- package/README.md +87 -0
- package/components/Accordion/index.tsx +1 -6
- package/components/Accordion/utils.ts +17 -14
- package/components/ActivityIndicator/ActivityIndicator.tsx +12 -20
- package/components/ActivityIndicator/index.tsx +1 -5
- package/components/Appbar/index.tsx +1 -4
- package/components/Appbar/utils.ts +33 -21
- package/components/Avatar/index.tsx +1 -5
- package/components/Avatar/utils.ts +2 -6
- package/components/Backdrop/Backdrop.tsx +2 -2
- package/components/Backdrop/index.tsx +1 -5
- package/components/Backdrop/utils.ts +5 -6
- package/components/Badge/index.tsx +1 -5
- package/components/Badge/utils.ts +2 -6
- package/components/Button/Button.tsx +211 -264
- package/components/Button/index.tsx +9 -7
- package/components/Button/types.ts +16 -2
- package/components/Button/utils.ts +231 -210
- package/components/Card/Card.tsx +8 -4
- package/components/Card/CardContent.tsx +5 -4
- package/components/Card/CardHeader.tsx +5 -3
- package/components/Card/CardMedia.tsx +5 -3
- package/components/Card/CardTypography.tsx +5 -3
- package/components/Card/index.tsx +1 -5
- package/components/Card/utils.ts +5 -6
- package/components/Checkbox/Checkbox.tsx +1 -0
- package/components/Checkbox/CheckboxBase.ios.tsx +1 -0
- package/components/Checkbox/CheckboxBase.tsx +24 -128
- package/components/Checkbox/index.tsx +1 -5
- package/components/Checkbox/utils.ts +6 -31
- package/components/Chip/Chip.tsx +40 -52
- package/components/Chip/index.tsx +1 -5
- package/components/Chip/utils.ts +5 -13
- package/components/DatePickerDocked/index.tsx +1 -5
- package/components/DatePickerDocked/utils.ts +21 -19
- package/components/DatePickerInline/index.tsx +1 -5
- package/components/DatePickerInline/utils.ts +41 -28
- package/components/DatePickerInput/DatePickerInput.tsx +4 -2
- package/components/DatePickerInput/DatePickerInputWithoutModal.tsx +0 -4
- package/components/DatePickerInput/index.tsx +1 -5
- package/components/DatePickerInput/types.ts +1 -3
- package/components/DatePickerInput/utils.ts +5 -6
- package/components/DatePickerModal/CalendarEdit.tsx +10 -9
- package/components/DatePickerModal/DatePickerModalHeader.tsx +1 -1
- package/components/DatePickerModal/index.tsx +1 -5
- package/components/DatePickerModal/utils.ts +17 -16
- package/components/DateTimePicker/index.tsx +1 -5
- package/components/DateTimePicker/utils.ts +5 -6
- package/components/Dialog/index.tsx +1 -5
- package/components/Dialog/utils.ts +22 -16
- package/components/Drawer/Collapsible/utils.ts +13 -13
- package/components/Drawer/Drawer.tsx +2 -3
- package/components/Drawer/DrawerContent.tsx +5 -3
- package/components/Drawer/DrawerFooter.tsx +5 -4
- package/components/Drawer/DrawerHeader.tsx +5 -4
- package/components/Drawer/DrawerItem.tsx +5 -3
- package/components/Drawer/DrawerItemGroup.tsx +5 -4
- package/components/Drawer/index.tsx +1 -5
- package/components/Drawer/utils.ts +7 -7
- package/components/ElementGroup/ElementGroup.tsx +16 -14
- package/components/ElementGroup/index.tsx +1 -5
- package/components/ElementGroup/utils.ts +5 -6
- package/components/FAB/index.tsx +1 -5
- package/components/FAB/utils.ts +2 -6
- package/components/FilePicker/FilePicker.tsx +47 -76
- package/components/FilePicker/index.tsx +1 -5
- package/components/FilePicker/utils.ts +5 -6
- package/components/HelperText/HelperText.tsx +0 -35
- package/components/HelperText/index.tsx +1 -5
- package/components/HelperText/utils.ts +5 -7
- package/components/HorizontalDivider/HorizontalDivider.tsx +5 -3
- package/components/HorizontalDivider/index.tsx +1 -5
- package/components/Icon/CrossFadeIcon.tsx +3 -5
- package/components/Icon/Icon.tsx +2 -4
- package/components/Icon/iconFactory.tsx +3 -3
- package/components/Icon/index.tsx +2 -6
- package/components/Icon/types.ts +17 -6
- package/components/IconButton/IconButton.tsx +45 -58
- package/components/IconButton/index.tsx +1 -5
- package/components/IconButton/utils.ts +153 -49
- package/components/If/index.tsx +1 -5
- package/components/InputAddon/index.tsx +1 -5
- package/components/InputAddon/utils.ts +5 -6
- package/components/Link/index.tsx +1 -5
- package/components/Link/utils.ts +2 -6
- package/components/ListItem/index.tsx +1 -5
- package/components/ListItem/utils.ts +13 -11
- package/components/LoadingIndicator/LoadingIndicator.tsx +253 -0
- package/components/LoadingIndicator/LoadingIndicator.web.tsx +136 -0
- package/components/LoadingIndicator/index.tsx +13 -0
- package/components/LoadingIndicator/utils.ts +117 -0
- package/components/Menu/index.tsx +1 -5
- package/components/Menu/utils.ts +6 -8
- package/components/Modal/index.tsx +1 -5
- package/components/Modal/utils.ts +2 -6
- package/components/NavigationRail/NavigationRailHeader.tsx +1 -1
- package/components/NavigationRail/index.tsx +1 -5
- package/components/NavigationRail/utils.ts +21 -17
- package/components/NavigationStack/index.tsx +1 -5
- package/components/NavigationStack/utils.tsx +7 -1
- package/components/Portal/index.tsx +1 -5
- package/components/RadioButton/index.ts +1 -5
- package/components/RadioButton/utils.ts +9 -8
- package/components/Rating/index.tsx +1 -5
- package/components/Rating/utils.ts +6 -8
- package/components/Select/Select.tsx +369 -507
- package/components/Select/index.ts +7 -14
- package/components/Select/types.ts +2 -4
- package/components/Select/utils.ts +215 -0
- package/components/Slot/Slot.tsx +244 -0
- package/components/Slot/compose-refs.tsx +60 -0
- package/components/Slot/index.tsx +8 -0
- package/components/StateLayer/index.tsx +1 -5
- package/components/StateLayer/utils.ts +5 -6
- package/components/Surface/Surface.android.tsx +34 -8
- package/components/Surface/Surface.ios.tsx +36 -29
- package/components/Surface/Surface.tsx +31 -4
- package/components/Surface/index.tsx +1 -5
- package/components/Surface/utils.ts +49 -36
- package/components/Switch/Switch.tsx +8 -2
- package/components/Switch/index.tsx +1 -5
- package/components/Switch/utils.ts +2 -6
- package/components/Tabs/TabItem.tsx +35 -58
- package/components/Tabs/TabLabel.tsx +5 -9
- package/components/Tabs/Tabs.tsx +154 -149
- package/components/Tabs/index.tsx +1 -5
- package/components/Tabs/utils.ts +25 -12
- package/components/Text/Text.tsx +2 -8
- package/components/TextInput/TextInput.tsx +655 -571
- package/components/TextInput/index.tsx +19 -7
- package/components/TextInput/types.ts +76 -27
- package/components/TextInput/utils.ts +232 -159
- package/components/TextInputWithMask/index.tsx +1 -5
- package/components/TimePicker/AmPmSwitcher.tsx +1 -1
- package/components/TimePicker/index.tsx +1 -5
- package/components/TimePicker/utils.ts +29 -21
- package/components/TimePickerField/TimePickerField.tsx +7 -5
- package/components/TimePickerField/index.tsx +1 -5
- package/components/TimePickerField/utils.ts +5 -6
- package/components/TimePickerModal/TimePickerModal.tsx +6 -2
- package/components/TimePickerModal/index.tsx +1 -5
- package/components/TimePickerModal/utils.ts +5 -6
- package/components/Tooltip/TooltipTrigger.tsx +25 -16
- package/components/Tooltip/index.tsx +1 -5
- package/components/Tooltip/utils.ts +5 -6
- package/components/TouchableRipple/TouchableRipple.native.tsx +50 -14
- package/components/TouchableRipple/TouchableRipple.tsx +137 -47
- package/components/TouchableRipple/index.tsx +1 -5
- package/components/TouchableRipple/utils.ts +5 -6
- package/components/VerticalDivider/VerticalDivider.tsx +9 -8
- package/components/VerticalDivider/index.tsx +1 -5
- package/core/componentsRegistry.ts +31 -19
- package/hocs/withPortal.tsx +1 -1
- package/hooks/index.tsx +0 -5
- package/hooks/useControlledValue.tsx +20 -4
- package/hooks/useSubcomponents.tsx +63 -31
- package/hooks/useWhatHasUpdated.tsx +48 -0
- package/package.json +12 -15
- package/shortcuts-manager/ShortcutsManager/ShortcutsManager.tsx +5 -2
- package/styles/shadow.ts +2 -1
- package/styles/themes/LightTheme.tsx +1 -1
- package/utils/extractPropertiesFromStyles.ts +25 -0
- package/utils/lodash.ts +77 -6
- package/utils/repository.ts +2 -52
- package/hooks/useSearchable.tsx +0 -74
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getRegisteredComponentWithFallback
|
|
1
|
+
import { getRegisteredComponentWithFallback } from '../../core';
|
|
2
2
|
import NavigationStackComponent from './NavigationStack';
|
|
3
3
|
import NavigationStackItem from './NavigationStackItem';
|
|
4
4
|
|
|
@@ -6,10 +6,6 @@ export const NavigationStackDefault = Object.assign(NavigationStackComponent, {
|
|
|
6
6
|
Item: NavigationStackItem,
|
|
7
7
|
});
|
|
8
8
|
|
|
9
|
-
registerMoleculesComponents({
|
|
10
|
-
NavigationStack: NavigationStackDefault,
|
|
11
|
-
});
|
|
12
|
-
|
|
13
9
|
export const NavigationStack = getRegisteredComponentWithFallback(
|
|
14
10
|
'NavigationStack',
|
|
15
11
|
NavigationStackDefault,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
2
|
import { StyleSheet } from 'react-native-unistyles';
|
|
3
3
|
|
|
4
|
+
import { getRegisteredComponentStylesWithFallback } from '../../core';
|
|
4
5
|
import { NavigationStackContext } from './NavigationStack';
|
|
5
6
|
|
|
6
7
|
export const useNavigation = () => {
|
|
@@ -11,6 +12,11 @@ export const useRoute = () => {
|
|
|
11
12
|
return useContext(NavigationStackContext).currentRoute;
|
|
12
13
|
};
|
|
13
14
|
|
|
14
|
-
export const
|
|
15
|
+
export const navigationStackItemStylesDefault = StyleSheet.create({
|
|
15
16
|
root: {},
|
|
16
17
|
});
|
|
18
|
+
|
|
19
|
+
export const navigationStackItemStyles = getRegisteredComponentStylesWithFallback(
|
|
20
|
+
'NavigationStack_Item',
|
|
21
|
+
navigationStackItemStylesDefault,
|
|
22
|
+
);
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { getRegisteredComponentWithFallback
|
|
1
|
+
import { getRegisteredComponentWithFallback } from '../../core';
|
|
2
2
|
import PortalDefault from './Portal';
|
|
3
3
|
|
|
4
|
-
registerMoleculesComponents({
|
|
5
|
-
Portal: PortalDefault,
|
|
6
|
-
});
|
|
7
|
-
|
|
8
4
|
// @ts-ignore TODO - fix this error
|
|
9
5
|
export const Portal = getRegisteredComponentWithFallback('Portal', PortalDefault);
|
|
10
6
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getRegisteredComponentWithFallback
|
|
1
|
+
import { getRegisteredComponentWithFallback } from '../../core';
|
|
2
2
|
import RadioButtonComponent from './RadioButton';
|
|
3
3
|
import RadioButtonGroup from './RadioButtonGroup';
|
|
4
4
|
import RadioButtonItem from './RadioButtonItem';
|
|
@@ -14,10 +14,6 @@ const RadioButtonDefault = Object.assign(
|
|
|
14
14
|
},
|
|
15
15
|
);
|
|
16
16
|
|
|
17
|
-
registerMoleculesComponents({
|
|
18
|
-
RadioButton: RadioButtonDefault,
|
|
19
|
-
});
|
|
20
|
-
|
|
21
17
|
export const RadioButton = getRegisteredComponentWithFallback('RadioButton', RadioButtonDefault);
|
|
22
18
|
|
|
23
19
|
export type { Props as RadioButtonProps } from './RadioButton';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StyleSheet } from 'react-native-unistyles';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { getRegisteredComponentStylesWithFallback } from '../../core';
|
|
4
4
|
|
|
5
5
|
// type States = 'disabled' | 'checked' | 'hovered' | 'checkedAndHovered';
|
|
6
6
|
|
|
@@ -121,13 +121,14 @@ const radioButtonItemStylesDefault = StyleSheet.create(theme => ({
|
|
|
121
121
|
},
|
|
122
122
|
}));
|
|
123
123
|
|
|
124
|
-
|
|
125
|
-
RadioButton
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
124
|
+
export const radioButtonStyles = getRegisteredComponentStylesWithFallback(
|
|
125
|
+
'RadioButton',
|
|
126
|
+
radioButtonStylesDefault,
|
|
127
|
+
);
|
|
128
|
+
export const radioButtonItemStyles = getRegisteredComponentStylesWithFallback(
|
|
129
|
+
'RadioButton_Item',
|
|
130
|
+
radioButtonItemStylesDefault,
|
|
131
|
+
);
|
|
131
132
|
|
|
132
133
|
export const handlePress = ({
|
|
133
134
|
onPress,
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { getRegisteredComponentWithFallback
|
|
1
|
+
import { getRegisteredComponentWithFallback } from '../../core';
|
|
2
2
|
import RatingDefault from './Rating';
|
|
3
3
|
|
|
4
|
-
registerMoleculesComponents({
|
|
5
|
-
Rating: RatingDefault,
|
|
6
|
-
});
|
|
7
|
-
|
|
8
4
|
export const Rating = getRegisteredComponentWithFallback('Rating', RatingDefault);
|
|
9
5
|
|
|
10
6
|
export type { Props as RatingProps } from './Rating';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StyleSheet } from 'react-native-unistyles';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { getRegisteredComponentStylesWithFallback } from '../../core';
|
|
4
4
|
|
|
5
5
|
export type States = 'activeAndDisabled' | 'active' | 'disabled' | 'readonly' | 'activeAndReadonly';
|
|
6
6
|
|
|
@@ -29,10 +29,8 @@ const ratingItemStylesDefault = StyleSheet.create(theme => ({
|
|
|
29
29
|
},
|
|
30
30
|
}));
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
Rating_Item
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
export const ratingStyles = getRegisteredMoleculesComponentStyles('Rating');
|
|
38
|
-
export const ratingItemStyles = getRegisteredMoleculesComponentStyles('Rating_Item');
|
|
32
|
+
export const ratingStyles = getRegisteredComponentStylesWithFallback('Rating', ratingStylesDefault);
|
|
33
|
+
export const ratingItemStyles = getRegisteredComponentStylesWithFallback(
|
|
34
|
+
'Rating_Item',
|
|
35
|
+
ratingItemStylesDefault,
|
|
36
|
+
);
|