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
|
@@ -7,13 +7,11 @@ import { datePickerInputStyles } from './utils';
|
|
|
7
7
|
|
|
8
8
|
function DatePickerInputWithoutModal(
|
|
9
9
|
{
|
|
10
|
-
label,
|
|
11
10
|
value,
|
|
12
11
|
onChange: onChangeProp,
|
|
13
12
|
// locale = 'en',
|
|
14
13
|
validRange,
|
|
15
14
|
inputMode,
|
|
16
|
-
inputButtons,
|
|
17
15
|
dateFormat = 'dd/MM/yyyy',
|
|
18
16
|
style,
|
|
19
17
|
onBlur: onBlurProp,
|
|
@@ -61,14 +59,12 @@ function DatePickerInputWithoutModal(
|
|
|
61
59
|
onBlur={onBlur}
|
|
62
60
|
onFocus={onFocus}
|
|
63
61
|
ref={inputRef}
|
|
64
|
-
label={label}
|
|
65
62
|
value={formattedValue}
|
|
66
63
|
keyboardType={'number-pad'}
|
|
67
64
|
mask={dateFormat}
|
|
68
65
|
onChangeText={onChangeText}
|
|
69
66
|
// keyboardAppearance={theme.dark ? 'dark' : 'default'}
|
|
70
67
|
// error={formattedValue ? !!error : false}
|
|
71
|
-
right={inputButtons}
|
|
72
68
|
// supportingText={formattedValue ? error || undefined : undefined}
|
|
73
69
|
/>
|
|
74
70
|
);
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { getRegisteredComponentWithFallback
|
|
1
|
+
import { getRegisteredComponentWithFallback } from '../../core';
|
|
2
2
|
import DatePickerInputDefault from './DatePickerInput';
|
|
3
3
|
|
|
4
|
-
registerMoleculesComponents({
|
|
5
|
-
DatePickerInput: DatePickerInputDefault,
|
|
6
|
-
});
|
|
7
|
-
|
|
8
4
|
export const DatePickerInput = getRegisteredComponentWithFallback(
|
|
9
5
|
'DatePickerInput',
|
|
10
6
|
DatePickerInputDefault,
|
|
@@ -23,6 +23,4 @@ export interface DatePickerInputProps
|
|
|
23
23
|
endYear?: number;
|
|
24
24
|
dockedPopoverContentProps?: ViewProps;
|
|
25
25
|
}
|
|
26
|
-
export interface DatePickerInputWithoutModalProps extends Omit<DatePickerInputProps, 'withModal'> {
|
|
27
|
-
inputButtons?: any;
|
|
28
|
-
}
|
|
26
|
+
export interface DatePickerInputWithoutModalProps extends Omit<DatePickerInputProps, 'withModal'> {}
|
|
@@ -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
|
const datePickerInputStylesDefault = StyleSheet.create({
|
|
6
6
|
root: {
|
|
@@ -9,8 +9,7 @@ const datePickerInputStylesDefault = StyleSheet.create({
|
|
|
9
9
|
},
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
DatePickerInput
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export const datePickerInputStyles = getRegisteredMoleculesComponentStyles('DatePickerInput');
|
|
12
|
+
export const datePickerInputStyles = getRegisteredComponentStylesWithFallback(
|
|
13
|
+
'DatePickerInput',
|
|
14
|
+
datePickerInputStylesDefault,
|
|
15
|
+
);
|
|
@@ -3,6 +3,7 @@ import { Keyboard, TextInput as TextInputNative, View } from 'react-native';
|
|
|
3
3
|
|
|
4
4
|
import type { ModeType, ValidRangeType } from '../DatePickerInline';
|
|
5
5
|
import DatePickerInputWithoutModal from '../DatePickerInput/DatePickerInputWithoutModal';
|
|
6
|
+
import { TextInput } from '../TextInput';
|
|
6
7
|
import type { LocalState, LocalStateRange, LocalStateSingle } from './types';
|
|
7
8
|
import { datePickerModalEditStyles } from './utils';
|
|
8
9
|
|
|
@@ -91,14 +92,14 @@ Props) {
|
|
|
91
92
|
<DatePickerInputWithoutModal
|
|
92
93
|
inputMode="start"
|
|
93
94
|
ref={dateInput}
|
|
94
|
-
label={label}
|
|
95
95
|
value={(state as LocalStateSingle).date}
|
|
96
96
|
onChange={onSingleInputChange}
|
|
97
97
|
onSubmitEditing={onSubmitInput}
|
|
98
98
|
validRange={validRange}
|
|
99
99
|
// locale={locale}
|
|
100
|
-
autoComplete={'off'}
|
|
101
|
-
|
|
100
|
+
autoComplete={'off'}>
|
|
101
|
+
<TextInput.Label>{label}</TextInput.Label>
|
|
102
|
+
</DatePickerInputWithoutModal>
|
|
102
103
|
) : null}
|
|
103
104
|
</>
|
|
104
105
|
|
|
@@ -108,27 +109,27 @@ Props) {
|
|
|
108
109
|
<DatePickerInputWithoutModal
|
|
109
110
|
inputMode="start"
|
|
110
111
|
ref={startInput}
|
|
111
|
-
label={startLabel}
|
|
112
112
|
value={(state as LocalStateRange).startDate}
|
|
113
113
|
onChange={onStartDateChange}
|
|
114
114
|
returnKeyType={'next'}
|
|
115
115
|
onSubmitEditing={onSubmitStartInput}
|
|
116
116
|
validRange={validRange}
|
|
117
117
|
// locale={locale}
|
|
118
|
-
autoComplete={'off'}
|
|
119
|
-
|
|
118
|
+
autoComplete={'off'}>
|
|
119
|
+
<TextInput.Label>{startLabel}</TextInput.Label>
|
|
120
|
+
</DatePickerInputWithoutModal>
|
|
120
121
|
<View style={datePickerModalEditStyles.separator} />
|
|
121
122
|
<DatePickerInputWithoutModal
|
|
122
123
|
inputMode="end"
|
|
123
124
|
ref={endInput}
|
|
124
|
-
label={endLabel}
|
|
125
125
|
value={(state as LocalStateRange).endDate}
|
|
126
126
|
onChange={onEndDateChange}
|
|
127
127
|
onSubmitEditing={onSubmitEndInput}
|
|
128
128
|
validRange={validRange}
|
|
129
129
|
// locale={locale}
|
|
130
|
-
autoComplete="off"
|
|
131
|
-
|
|
130
|
+
autoComplete="off">
|
|
131
|
+
<TextInput.Label>{endLabel}</TextInput.Label>
|
|
132
|
+
</DatePickerInputWithoutModal>
|
|
132
133
|
</View>
|
|
133
134
|
) : null}
|
|
134
135
|
</>
|
|
@@ -64,7 +64,7 @@ export default function DatePickerModalHeader(props: DatePickerModalHeaderProps)
|
|
|
64
64
|
onPress={props.onSave}
|
|
65
65
|
disabled={props.saveLabelDisabled || false}
|
|
66
66
|
testID="dates-save">
|
|
67
|
-
{saveLabel}
|
|
67
|
+
<Button.Text>{saveLabel}</Button.Text>
|
|
68
68
|
</Button>
|
|
69
69
|
</View>
|
|
70
70
|
</SafeAreaView>
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { getRegisteredComponentWithFallback
|
|
1
|
+
import { getRegisteredComponentWithFallback } from '../../core';
|
|
2
2
|
import DatePickerModalDefault from './DatePickerModal';
|
|
3
3
|
|
|
4
|
-
registerMoleculesComponents({
|
|
5
|
-
DatePickerModal: DatePickerModalDefault,
|
|
6
|
-
});
|
|
7
|
-
|
|
8
4
|
export const DatePickerModal = getRegisteredComponentWithFallback(
|
|
9
5
|
'DatePickerModal',
|
|
10
6
|
DatePickerModalDefault,
|
|
@@ -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
|
const datePickerModalStylesDefault = StyleSheet.create(theme => ({
|
|
6
6
|
header: {
|
|
@@ -100,22 +100,23 @@ const datePickerModalEditStylesDefault = StyleSheet.create(theme => ({
|
|
|
100
100
|
separator: { width: 12 },
|
|
101
101
|
}));
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
DatePickerModal
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
export const
|
|
112
|
-
export const datePickerModalHeaderStyles =
|
|
113
|
-
getRegisteredMoleculesComponentStyles('DatePickerModal_Header');
|
|
114
|
-
export const datePickerModalContentHeaderStyles = getRegisteredMoleculesComponentStyles(
|
|
103
|
+
export const datePickerModalStyles = getRegisteredComponentStylesWithFallback(
|
|
104
|
+
'DatePickerModal',
|
|
105
|
+
datePickerModalStylesDefault,
|
|
106
|
+
);
|
|
107
|
+
export const datePickerModalHeaderStyles = getRegisteredComponentStylesWithFallback(
|
|
108
|
+
'DatePickerModal_Header',
|
|
109
|
+
datePickerModalHeaderStylesDefault,
|
|
110
|
+
);
|
|
111
|
+
export const datePickerModalContentHeaderStyles = getRegisteredComponentStylesWithFallback(
|
|
115
112
|
'DatePickerModal_ContentHeader',
|
|
113
|
+
datePickerModalContentHeaderStylesDefault,
|
|
116
114
|
);
|
|
117
|
-
export const datePickerModalHeaderBackgroundStyles =
|
|
115
|
+
export const datePickerModalHeaderBackgroundStyles = getRegisteredComponentStylesWithFallback(
|
|
118
116
|
'DatePickerModal_HeaderBackground',
|
|
117
|
+
datePickerModalHeaderBackgroundStylesDefault,
|
|
118
|
+
);
|
|
119
|
+
export const datePickerModalEditStyles = getRegisteredComponentStylesWithFallback(
|
|
120
|
+
'DatePickerModal_Edit',
|
|
121
|
+
datePickerModalEditStylesDefault,
|
|
119
122
|
);
|
|
120
|
-
export const datePickerModalEditStyles =
|
|
121
|
-
getRegisteredMoleculesComponentStyles('DatePickerModal_Edit');
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { getRegisteredComponentWithFallback
|
|
1
|
+
import { getRegisteredComponentWithFallback } from '../../core';
|
|
2
2
|
import DateTimePickerDefault from './DateTimePicker';
|
|
3
3
|
|
|
4
|
-
registerMoleculesComponents({
|
|
5
|
-
DateTimePicker: DateTimePickerDefault,
|
|
6
|
-
});
|
|
7
|
-
|
|
8
4
|
export const DateTimePicker = getRegisteredComponentWithFallback(
|
|
9
5
|
'DateTimePicker',
|
|
10
6
|
DateTimePickerDefault,
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { StyleSheet } from 'react-native-unistyles';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { getRegisteredComponentStylesWithFallback } from '../../core';
|
|
4
4
|
|
|
5
5
|
const dateTimePickerStylesDefault = StyleSheet.create({
|
|
6
6
|
container: {},
|
|
7
7
|
});
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
DateTimePicker
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export const dateTimePickerStyles = getRegisteredMoleculesComponentStyles('DateTimePicker');
|
|
9
|
+
export const dateTimePickerStyles = getRegisteredComponentStylesWithFallback(
|
|
10
|
+
'DateTimePicker',
|
|
11
|
+
dateTimePickerStylesDefault,
|
|
12
|
+
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getRegisteredComponentWithFallback
|
|
1
|
+
import { getRegisteredComponentWithFallback } from '../../core';
|
|
2
2
|
import DialogComponent from './Dialog';
|
|
3
3
|
import DialogActions from './DialogActions';
|
|
4
4
|
import DialogContent from './DialogContent';
|
|
@@ -17,10 +17,6 @@ export const DialogDefault = Object.assign(
|
|
|
17
17
|
},
|
|
18
18
|
);
|
|
19
19
|
|
|
20
|
-
registerMoleculesComponents({
|
|
21
|
-
Dialog: DialogDefault,
|
|
22
|
-
});
|
|
23
|
-
|
|
24
20
|
export const Dialog = getRegisteredComponentWithFallback('Dialog', DialogDefault);
|
|
25
21
|
|
|
26
22
|
export type { Props as DialogProps } from './Dialog';
|
|
@@ -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
|
const dialogStylesDefault = StyleSheet.create(theme => ({
|
|
6
6
|
root: {
|
|
@@ -63,18 +63,24 @@ const dialogActionsStylesDefault = StyleSheet.create(theme => ({
|
|
|
63
63
|
},
|
|
64
64
|
}));
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
Dialog_Title
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
export const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
export const dialogContentStyles =
|
|
80
|
-
|
|
66
|
+
export const dialogStyles = getRegisteredComponentStylesWithFallback('Dialog', dialogStylesDefault);
|
|
67
|
+
export const dialogTitleStyles = getRegisteredComponentStylesWithFallback(
|
|
68
|
+
'Dialog_Title',
|
|
69
|
+
dialogTitleStylesDefault,
|
|
70
|
+
);
|
|
71
|
+
export const dialogScrollAreaStyles = getRegisteredComponentStylesWithFallback(
|
|
72
|
+
'Dialog_ScrollArea',
|
|
73
|
+
dialogScrollAreaStylesDefault,
|
|
74
|
+
);
|
|
75
|
+
export const dialogIconStyles = getRegisteredComponentStylesWithFallback(
|
|
76
|
+
'Dialog_Icon',
|
|
77
|
+
dialogIconStylesDefault,
|
|
78
|
+
);
|
|
79
|
+
export const dialogContentStyles = getRegisteredComponentStylesWithFallback(
|
|
80
|
+
'Dialog_Content',
|
|
81
|
+
dialogContentStylesDefault,
|
|
82
|
+
);
|
|
83
|
+
export const dialogActionsStyles = getRegisteredComponentStylesWithFallback(
|
|
84
|
+
'Dialog_Actions',
|
|
85
|
+
dialogActionsStylesDefault,
|
|
86
|
+
);
|
|
@@ -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 const drawerCollapsibleStylesDefault = StyleSheet.create({
|
|
6
6
|
root: {},
|
|
@@ -31,19 +31,19 @@ export const drawerCollapsibleItemContentStylesDefault = StyleSheet.create({
|
|
|
31
31
|
root: {},
|
|
32
32
|
});
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
Drawer_Collapsible
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
export const
|
|
43
|
-
getRegisteredMoleculesComponentStyles('Drawer_CollapsibleItem');
|
|
44
|
-
export const drawerCollapsibleItemHeaderStyles = getRegisteredMoleculesComponentStyles(
|
|
34
|
+
export const drawerCollapsibleStyles = getRegisteredComponentStylesWithFallback(
|
|
35
|
+
'Drawer_Collapsible',
|
|
36
|
+
drawerCollapsibleStylesDefault,
|
|
37
|
+
);
|
|
38
|
+
export const drawerCollapsibleItemStyles = getRegisteredComponentStylesWithFallback(
|
|
39
|
+
'Drawer_CollapsibleItem',
|
|
40
|
+
drawerCollapsibleItemStylesDefault,
|
|
41
|
+
);
|
|
42
|
+
export const drawerCollapsibleItemHeaderStyles = getRegisteredComponentStylesWithFallback(
|
|
45
43
|
'Drawer_CollapsibleItem_Header',
|
|
44
|
+
drawerCollapsibleItemHeaderStylesDefault,
|
|
46
45
|
);
|
|
47
|
-
export const drawerCollapsibleItemContentStyles =
|
|
46
|
+
export const drawerCollapsibleItemContentStyles = getRegisteredComponentStylesWithFallback(
|
|
48
47
|
'Drawer_CollapsibleItem_Content',
|
|
48
|
+
drawerCollapsibleItemContentStylesDefault,
|
|
49
49
|
);
|
|
@@ -2,7 +2,7 @@ import { memo, type ReactElement } from 'react';
|
|
|
2
2
|
import { View, type ViewProps } from 'react-native';
|
|
3
3
|
import { StyleSheet } from 'react-native-unistyles';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { getRegisteredComponentStylesWithFallback } from '../../core';
|
|
6
6
|
import { useSubcomponents } from '../../hooks';
|
|
7
7
|
|
|
8
8
|
export type Props = Omit<ViewProps, 'children'> & {
|
|
@@ -37,7 +37,6 @@ const drawerStylesDefault = StyleSheet.create(theme => ({
|
|
|
37
37
|
},
|
|
38
38
|
}));
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
export const drawerStyles = getRegisteredMoleculesComponentStyles('Drawer');
|
|
40
|
+
export const drawerStyles = getRegisteredComponentStylesWithFallback('Drawer', drawerStylesDefault);
|
|
42
41
|
|
|
43
42
|
export default memo(Drawer);
|
|
@@ -2,7 +2,7 @@ import { type ComponentType, memo } from 'react';
|
|
|
2
2
|
import { ScrollView, type ScrollViewProps } from 'react-native';
|
|
3
3
|
import { StyleSheet } from 'react-native-unistyles';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { getRegisteredComponentStylesWithFallback } from '../../core';
|
|
6
6
|
|
|
7
7
|
export type Props = ScrollViewProps & {
|
|
8
8
|
/**
|
|
@@ -27,8 +27,10 @@ const drawerContentStylesDefault = StyleSheet.create(theme => ({
|
|
|
27
27
|
flex: 1,
|
|
28
28
|
},
|
|
29
29
|
}));
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
export const drawerContentStyles = getRegisteredComponentStylesWithFallback(
|
|
31
|
+
'Drawer_Content',
|
|
32
|
+
drawerContentStylesDefault,
|
|
33
|
+
);
|
|
32
34
|
|
|
33
35
|
DrawerContent.displayName = 'Drawer_Content';
|
|
34
36
|
|
|
@@ -2,7 +2,7 @@ import { memo } from 'react';
|
|
|
2
2
|
import { View, type ViewProps } from 'react-native';
|
|
3
3
|
import { StyleSheet } from 'react-native-unistyles';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { getRegisteredComponentStylesWithFallback } from '../../core';
|
|
6
6
|
|
|
7
7
|
export type Props = ViewProps & {};
|
|
8
8
|
|
|
@@ -20,8 +20,9 @@ const drawerFooterStylesDefault = StyleSheet.create({
|
|
|
20
20
|
root: {},
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
export const drawerFooterStyles = getRegisteredComponentStylesWithFallback(
|
|
24
|
+
'Drawer_Footer',
|
|
25
|
+
drawerFooterStylesDefault,
|
|
26
|
+
);
|
|
26
27
|
|
|
27
28
|
export default DrawerFooter;
|
|
@@ -2,7 +2,7 @@ import { memo } from 'react';
|
|
|
2
2
|
import { View, type ViewProps } from 'react-native';
|
|
3
3
|
import { StyleSheet } from 'react-native-unistyles';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { getRegisteredComponentStylesWithFallback } from '../../core';
|
|
6
6
|
|
|
7
7
|
export type Props = ViewProps & {};
|
|
8
8
|
|
|
@@ -20,8 +20,9 @@ const drawerHeaderStylesDefault = StyleSheet.create({
|
|
|
20
20
|
root: {},
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
export const drawerHeaderStyles = getRegisteredComponentStylesWithFallback(
|
|
24
|
+
'Drawer_Header',
|
|
25
|
+
drawerHeaderStylesDefault,
|
|
26
|
+
);
|
|
26
27
|
|
|
27
28
|
export default DrawerHeader;
|
|
@@ -2,7 +2,7 @@ import { forwardRef, memo, type ReactNode, useMemo } from 'react';
|
|
|
2
2
|
import { type TextProps, type TextStyle, View, type ViewStyle } from 'react-native';
|
|
3
3
|
import { StyleSheet } from 'react-native-unistyles';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { getRegisteredComponentStylesWithFallback } from '../../core';
|
|
6
6
|
import { useActionState } from '../../hooks';
|
|
7
7
|
import type { WithElements } from '../../types';
|
|
8
8
|
import { resolveStateVariant } from '../../utils';
|
|
@@ -200,7 +200,9 @@ const drawerItemStylesDefault = StyleSheet.create(theme => ({
|
|
|
200
200
|
},
|
|
201
201
|
}));
|
|
202
202
|
|
|
203
|
-
|
|
204
|
-
|
|
203
|
+
export const drawerItemStyles = getRegisteredComponentStylesWithFallback(
|
|
204
|
+
'Drawer_Item',
|
|
205
|
+
drawerItemStylesDefault,
|
|
206
|
+
);
|
|
205
207
|
|
|
206
208
|
export default memo(forwardRef(DrawerItem));
|
|
@@ -2,7 +2,7 @@ import { memo, type ReactNode, useMemo } from 'react';
|
|
|
2
2
|
import { type TextProps, View, type ViewProps } from 'react-native';
|
|
3
3
|
import { StyleSheet } from 'react-native-unistyles';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { getRegisteredComponentStylesWithFallback } from '../../core';
|
|
6
6
|
import { HorizontalDivider, type HorizontalDividerProps } from '../HorizontalDivider';
|
|
7
7
|
import { Text } from '../Text';
|
|
8
8
|
|
|
@@ -73,9 +73,10 @@ const drawerItemGroupStylesDefault = StyleSheet.create(theme => ({
|
|
|
73
73
|
},
|
|
74
74
|
}));
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
export const drawerItemGroupStyles = getRegisteredComponentStylesWithFallback(
|
|
77
|
+
'Drawer_ItemGroup',
|
|
78
|
+
drawerItemGroupStylesDefault,
|
|
79
|
+
);
|
|
79
80
|
|
|
80
81
|
DrawerItemGroup.displayName = 'Drawer_ItemGroup';
|
|
81
82
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getRegisteredComponentWithFallback
|
|
1
|
+
import { getRegisteredComponentWithFallback } from '../../core';
|
|
2
2
|
import { DrawerCollapsible, DrawerCollapsibleItem } from './Collapsible';
|
|
3
3
|
import DrawerComponent from './Drawer';
|
|
4
4
|
import DrawerContent from './DrawerContent';
|
|
@@ -17,10 +17,6 @@ const DrawerDefault = Object.assign(DrawerComponent, {
|
|
|
17
17
|
CollapsibleItem: DrawerCollapsibleItem,
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
-
registerMoleculesComponents({
|
|
21
|
-
Drawer: DrawerDefault,
|
|
22
|
-
});
|
|
23
|
-
|
|
24
20
|
export const Drawer = getRegisteredComponentWithFallback('Drawer', DrawerDefault);
|
|
25
21
|
|
|
26
22
|
export {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { registerComponentsStyles } from '../../core';
|
|
1
|
+
// import { registerComponentsStyles } from '../../core';
|
|
2
2
|
|
|
3
|
-
registerComponentsStyles({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
});
|
|
3
|
+
// registerComponentsStyles({
|
|
4
|
+
// Drawer_Collapsible: drawerCollapsibleStyles,
|
|
5
|
+
// Drawer_CollapsibleItem: drawerCollapsibleItemStyles,
|
|
6
|
+
// Drawer_CollapsibleItem_Header: drawerCollapsibleItemHeaderStyles,
|
|
7
|
+
// Drawer_CollapsibleItem_Content: drawerCollapsibleItemContentStyles,
|
|
8
|
+
// });
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Children, cloneElement, forwardRef, memo, type ReactElement, useMemo } from 'react';
|
|
2
2
|
import { View, type ViewProps, type ViewStyle } from 'react-native';
|
|
3
3
|
|
|
4
|
+
import { extractPropertiesFromStyles } from '../../utils/extractPropertiesFromStyles';
|
|
4
5
|
import { isNil } from '../../utils/lodash';
|
|
5
6
|
import { elementGroupStyles } from './utils';
|
|
6
7
|
|
|
@@ -44,24 +45,25 @@ export const ElementGroup = (
|
|
|
44
45
|
borderTopRightRadius,
|
|
45
46
|
borderBottomLeftRadius,
|
|
46
47
|
borderBottomRightRadius,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
} = extractPropertiesFromStyles(
|
|
49
|
+
[elementGroupStyles.root, style],
|
|
50
|
+
[
|
|
51
|
+
'borderRadius',
|
|
52
|
+
'borderTopLeftRadius',
|
|
53
|
+
'borderTopRightRadius',
|
|
54
|
+
'borderBottomLeftRadius',
|
|
55
|
+
'borderBottomRightRadius',
|
|
56
|
+
],
|
|
57
|
+
);
|
|
56
58
|
|
|
57
59
|
return {
|
|
58
|
-
containerStyle: [
|
|
60
|
+
containerStyle: [elementGroupStyles.root, style],
|
|
59
61
|
borderRadius: borderRadiusProp || _borderRadius,
|
|
60
62
|
borderRadiuses: {
|
|
61
|
-
borderTopLeftRadius: borderTopLeftRadius
|
|
62
|
-
borderTopRightRadius: borderTopRightRadius
|
|
63
|
-
borderBottomLeftRadius: borderBottomLeftRadius
|
|
64
|
-
borderBottomRightRadius: borderBottomRightRadius
|
|
63
|
+
borderTopLeftRadius: borderTopLeftRadius,
|
|
64
|
+
borderTopRightRadius: borderTopRightRadius,
|
|
65
|
+
borderBottomLeftRadius: borderBottomLeftRadius,
|
|
66
|
+
borderBottomRightRadius: borderBottomRightRadius,
|
|
65
67
|
},
|
|
66
68
|
};
|
|
67
69
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { getRegisteredComponentWithFallback
|
|
1
|
+
import { getRegisteredComponentWithFallback } from '../../core';
|
|
2
2
|
import ElementGroupDefault from './ElementGroup';
|
|
3
3
|
|
|
4
|
-
registerMoleculesComponents({
|
|
5
|
-
ElementGroup: ElementGroupDefault,
|
|
6
|
-
});
|
|
7
|
-
|
|
8
4
|
export const ElementGroup = getRegisteredComponentWithFallback('ElementGroup', ElementGroupDefault);
|
|
9
5
|
|
|
10
6
|
export type { Props as ElementGroupProps } from './ElementGroup';
|
|
@@ -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
|
const elementGroupStylesDefault = StyleSheet.create(theme => ({
|
|
6
6
|
root: {
|
|
@@ -18,8 +18,7 @@ const elementGroupStylesDefault = StyleSheet.create(theme => ({
|
|
|
18
18
|
},
|
|
19
19
|
}));
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
ElementGroup
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
export const elementGroupStyles = getRegisteredMoleculesComponentStyles('ElementGroup');
|
|
21
|
+
export const elementGroupStyles = getRegisteredComponentStylesWithFallback(
|
|
22
|
+
'ElementGroup',
|
|
23
|
+
elementGroupStylesDefault,
|
|
24
|
+
);
|
package/components/FAB/index.tsx
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { getRegisteredComponentWithFallback
|
|
1
|
+
import { getRegisteredComponentWithFallback } from '../../core';
|
|
2
2
|
import FABDefault from './FAB';
|
|
3
3
|
|
|
4
|
-
registerMoleculesComponents({
|
|
5
|
-
FAB: FABDefault,
|
|
6
|
-
});
|
|
7
|
-
|
|
8
4
|
export const FAB = getRegisteredComponentWithFallback('FAB', FABDefault);
|
|
9
5
|
|
|
10
6
|
export type { Props as FABProps } from './FAB';
|
package/components/FAB/utils.ts
CHANGED
|
@@ -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 const iconSizeMap = {
|
|
6
6
|
xs: 18,
|
|
@@ -212,10 +212,6 @@ const fabStylesDefault = StyleSheet.create(theme => ({
|
|
|
212
212
|
},
|
|
213
213
|
}));
|
|
214
214
|
|
|
215
|
-
|
|
216
|
-
FAB: fabStylesDefault,
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
export const fabStyles = getRegisteredMoleculesComponentStyles('FAB');
|
|
215
|
+
export const fabStyles = getRegisteredComponentStylesWithFallback('FAB', fabStylesDefault);
|
|
220
216
|
|
|
221
217
|
export type States = 'hovered' | 'disabled';
|