react-native-molecules 0.5.0-beta.3 → 0.5.0-beta.30
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/components/Accordion/Accordion.tsx +2 -6
- package/components/Accordion/AccordionItem.tsx +16 -12
- package/components/Accordion/AccordionItemContent.tsx +6 -1
- package/components/Accordion/AccordionItemHeader.tsx +1 -1
- package/components/Accordion/utils.ts +6 -0
- package/components/ActivityIndicator/ActivityIndicator.tsx +6 -15
- package/components/Appbar/AppbarBase.tsx +18 -13
- package/components/Button/Button.tsx +211 -264
- package/components/Button/index.tsx +9 -3
- package/components/Button/types.ts +16 -2
- package/components/Button/utils.ts +230 -208
- package/components/Card/Card.tsx +1 -1
- package/components/Checkbox/Checkbox.tsx +125 -88
- package/components/Checkbox/CheckboxBase.ios.tsx +14 -23
- package/components/Checkbox/CheckboxBase.tsx +21 -137
- package/components/Checkbox/context.tsx +14 -0
- package/components/Checkbox/index.tsx +11 -4
- package/components/Checkbox/types.ts +63 -29
- package/components/Checkbox/utils.ts +25 -108
- package/components/Chip/Chip.tsx +41 -52
- package/components/Chip/utils.ts +3 -7
- package/components/DateField/DateField.tsx +111 -0
- package/components/DateField/index.tsx +6 -0
- package/components/{DatePickerInput/inputUtils.ts → DateField/useDateFieldState.ts} +19 -51
- package/components/DatePicker/DateCalendar.tsx +83 -0
- package/components/DatePicker/DatePickerActions.tsx +73 -0
- package/components/DatePicker/DatePickerModal.tsx +246 -0
- package/components/DatePicker/DatePickerPopover.tsx +79 -0
- package/components/DatePicker/DatePickerProvider.tsx +158 -0
- package/components/DatePicker/DatePickerTrigger.tsx +23 -0
- package/components/DatePicker/context.tsx +83 -0
- package/components/DatePicker/index.tsx +45 -0
- package/components/DatePicker/utils.ts +295 -0
- package/components/DatePickerInline/DatePickerDockedHeader.tsx +117 -0
- package/components/DatePickerInline/DatePickerInline.tsx +17 -16
- package/components/DatePickerInline/DatePickerInlineBase.tsx +11 -5
- package/components/DatePickerInline/DatePickerInlineHeader.tsx +50 -20
- package/components/DatePickerInline/Day.tsx +25 -1
- package/components/DatePickerInline/DayNames.tsx +13 -10
- package/components/DatePickerInline/DayRange.tsx +2 -4
- package/components/DatePickerInline/HeaderItem.tsx +44 -29
- package/components/DatePickerInline/Month.tsx +48 -67
- package/components/DatePickerInline/MonthPicker.tsx +80 -92
- package/components/DatePickerInline/Swiper.native.tsx +21 -4
- package/components/DatePickerInline/Swiper.tsx +169 -14
- package/components/DatePickerInline/SwiperUtils.ts +1 -1
- package/components/DatePickerInline/Week.tsx +6 -1
- package/components/DatePickerInline/YearPicker.tsx +220 -78
- package/components/DatePickerInline/dateUtils.tsx +18 -13
- package/components/DatePickerInline/store.tsx +27 -0
- package/components/DatePickerInline/types.ts +6 -2
- package/components/DatePickerInline/utils.ts +66 -29
- package/components/Divider/Divider.tsx +192 -0
- package/components/Divider/index.tsx +10 -0
- package/components/Drawer/Drawer.tsx +17 -6
- package/components/Drawer/DrawerItemGroup.tsx +3 -7
- package/components/ElementGroup/ElementGroup.tsx +1 -1
- package/components/FilePicker/FilePicker.tsx +48 -78
- package/components/FilePicker/index.tsx +2 -1
- package/components/FilePicker/utils.ts +9 -0
- package/components/HelperText/HelperText.tsx +0 -35
- package/components/Icon/iconFactory.tsx +5 -4
- package/components/Icon/index.tsx +1 -1
- package/components/Icon/types.ts +17 -6
- package/components/IconButton/IconButton.tsx +84 -84
- package/components/IconButton/index.tsx +1 -0
- package/components/IconButton/types.ts +10 -0
- package/components/IconButton/utils.ts +167 -33
- package/components/List/List.tsx +276 -0
- package/components/List/context.tsx +27 -0
- package/components/List/index.ts +8 -0
- package/components/List/types.ts +117 -0
- package/components/List/utils.ts +79 -0
- 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/Menu.tsx +162 -39
- package/components/Menu/index.tsx +10 -7
- package/components/Menu/utils.ts +21 -70
- package/components/NavigationRail/NavigationRail.tsx +15 -9
- package/components/Popover/Popover.tsx +119 -145
- package/components/Popover/PopoverRoot.tsx +60 -0
- package/components/Popover/common.ts +54 -34
- package/components/Popover/index.ts +12 -1
- package/components/Popover/usePlatformMeasure.native.ts +90 -0
- package/components/Popover/usePlatformMeasure.ts +120 -0
- package/components/Popover/utils.ts +34 -0
- package/components/Portal/Portal.tsx +1 -2
- package/components/Radio/Radio.tsx +188 -0
- package/components/Radio/RadioBase.ios.tsx +69 -0
- package/components/Radio/RadioBase.tsx +136 -0
- package/components/Radio/context.tsx +23 -0
- package/components/Radio/index.tsx +20 -0
- package/components/Radio/types.ts +101 -0
- package/components/Radio/utils.ts +115 -0
- package/components/Rating/Rating.tsx +1 -1
- package/components/Select/Select.tsx +521 -785
- package/components/Select/context.tsx +81 -0
- package/components/Select/index.ts +26 -14
- package/components/Select/types.ts +65 -58
- package/components/Select/utils.ts +126 -0
- package/components/Slot/Slot.tsx +244 -0
- package/components/Slot/compose-refs.tsx +62 -0
- package/components/Slot/index.tsx +8 -0
- package/components/Surface/Surface.android.tsx +32 -7
- package/components/Surface/Surface.ios.tsx +34 -29
- package/components/Surface/Surface.tsx +31 -4
- package/components/Surface/utils.ts +44 -6
- package/components/Switch/Switch.ios.tsx +1 -1
- package/components/Switch/Switch.tsx +10 -3
- package/components/Tabs/TabItem.tsx +35 -58
- package/components/Tabs/TabLabel.tsx +5 -9
- package/components/Tabs/Tabs.tsx +156 -150
- package/components/Tabs/utils.ts +15 -2
- package/components/Text/textFactory.tsx +17 -5
- package/components/TextInput/TextInput.tsx +663 -579
- package/components/TextInput/index.tsx +19 -3
- package/components/TextInput/types.ts +77 -28
- package/components/TextInput/utils.ts +235 -145
- package/components/TimeField/TimeField.tsx +75 -0
- package/components/TimeField/index.tsx +6 -0
- package/components/TimeField/useTimeFieldState.ts +70 -0
- package/components/{TimePickerField/sanitizeTime.ts → TimeField/utils.ts} +77 -10
- package/components/TimePicker/AnalogClock.tsx +1 -1
- package/components/TimePicker/TimeInput.tsx +87 -42
- package/components/TimePicker/TimeInputs.tsx +138 -50
- package/components/TimePicker/TimePicker.tsx +74 -11
- package/components/TimePicker/TimePickerModal.tsx +186 -0
- package/components/TimePicker/context.tsx +17 -0
- package/components/TimePicker/index.tsx +15 -3
- package/components/TimePicker/utils.ts +93 -4
- package/components/Tooltip/Tooltip.tsx +42 -67
- package/components/Tooltip/TooltipContent.tsx +32 -5
- package/components/Tooltip/TooltipTrigger.tsx +20 -20
- package/components/Tooltip/index.tsx +1 -1
- package/components/TouchableRipple/TouchableRipple.native.tsx +83 -16
- package/components/TouchableRipple/TouchableRipple.tsx +150 -102
- package/components/TouchableRipple/rippleFromForegroundColor.ts +21 -0
- package/hocs/index.tsx +1 -1
- package/hocs/withKeyboardAccessibility.tsx +2 -3
- package/hocs/withPortal.tsx +1 -1
- package/hooks/index.tsx +2 -12
- package/hooks/useActionState.tsx +19 -8
- package/hooks/useContrastColor.ts +1 -2
- package/hooks/useFilePicker.tsx +7 -17
- package/hooks/useHandleNumberFormat.tsx +2 -2
- package/hooks/useMediaQuery.tsx +1 -2
- package/package.json +95 -111
- package/shortcuts-manager/ShortcutsManager/ShortcutsManager.tsx +6 -3
- package/shortcuts-manager/ShortcutsManager/utils.tsx +1 -1
- package/shortcuts-manager/useSetScopes/useSetScopes.tsx +1 -1
- package/shortcuts-manager/useShortcut/useShortcut.tsx +1 -1
- package/styles/shadow.ts +2 -1
- package/styles/themes/LightTheme.tsx +1 -1
- package/utils/DocumentPicker/documentPicker.ts +78 -27
- package/utils/DocumentPicker/types.ts +0 -1
- package/utils/extractSubcomponents.ts +89 -0
- package/utils/extractTextStyles.ts +1 -2
- package/utils/formatNumberWithMask/formatNumberWithMask.ts +2 -1
- package/utils/index.ts +0 -3
- package/utils/normalizeToNumberString/normalizeToNumberString.ts +1 -1
- package/components/DatePickerDocked/DatePickerDocked.tsx +0 -30
- package/components/DatePickerDocked/DatePickerDockedHeader.tsx +0 -129
- package/components/DatePickerDocked/index.tsx +0 -17
- package/components/DatePickerDocked/types.ts +0 -11
- package/components/DatePickerDocked/utils.ts +0 -157
- package/components/DatePickerInline/DatePickerContext.tsx +0 -21
- package/components/DatePickerInput/DatePickerInput.tsx +0 -139
- package/components/DatePickerInput/DatePickerInputModal.tsx +0 -48
- package/components/DatePickerInput/DatePickerInputWithoutModal.tsx +0 -77
- package/components/DatePickerInput/DateRangeInput.tsx +0 -88
- package/components/DatePickerInput/index.tsx +0 -10
- package/components/DatePickerInput/types.ts +0 -28
- package/components/DatePickerInput/utils.ts +0 -15
- package/components/DatePickerModal/AnimatedCrossView.tsx +0 -94
- package/components/DatePickerModal/CalendarEdit.tsx +0 -139
- package/components/DatePickerModal/DatePickerModal.tsx +0 -85
- package/components/DatePickerModal/DatePickerModalContent.tsx +0 -155
- package/components/DatePickerModal/DatePickerModalContentHeader.tsx +0 -213
- package/components/DatePickerModal/DatePickerModalHeader.tsx +0 -74
- package/components/DatePickerModal/DatePickerModalHeaderBackground.tsx +0 -13
- package/components/DatePickerModal/index.tsx +0 -16
- package/components/DatePickerModal/types.ts +0 -92
- package/components/DatePickerModal/utils.ts +0 -122
- package/components/DateTimePicker/DateTimePicker.tsx +0 -172
- package/components/DateTimePicker/index.tsx +0 -10
- package/components/DateTimePicker/utils.ts +0 -12
- package/components/HorizontalDivider/HorizontalDivider.tsx +0 -103
- package/components/HorizontalDivider/index.tsx +0 -9
- package/components/ListItem/ListItem.tsx +0 -136
- package/components/ListItem/ListItemDescription.tsx +0 -25
- package/components/ListItem/ListItemTitle.tsx +0 -25
- package/components/ListItem/index.tsx +0 -14
- package/components/ListItem/utils.ts +0 -115
- package/components/Menu/MenuDivider.tsx +0 -13
- package/components/Menu/MenuItem.tsx +0 -128
- package/components/Popover/Popover.native.tsx +0 -185
- package/components/RadioButton/RadioButton.tsx +0 -138
- package/components/RadioButton/RadioButtonAndroid.tsx +0 -188
- package/components/RadioButton/RadioButtonGroup.tsx +0 -98
- package/components/RadioButton/RadioButtonIOS.tsx +0 -106
- package/components/RadioButton/RadioButtonItem.tsx +0 -232
- package/components/RadioButton/index.ts +0 -22
- package/components/RadioButton/utils.ts +0 -165
- package/components/TimePickerField/TimePickerField.tsx +0 -152
- package/components/TimePickerField/index.tsx +0 -10
- package/components/TimePickerField/utils.ts +0 -94
- package/components/TimePickerModal/TimePickerModal.tsx +0 -115
- package/components/TimePickerModal/index.tsx +0 -10
- package/components/TimePickerModal/utils.ts +0 -47
- package/components/VerticalDivider/VerticalDivider.tsx +0 -100
- package/components/VerticalDivider/index.tsx +0 -9
- package/context-bridge/index.tsx +0 -87
- package/fast-context/index.tsx +0 -190
- package/hocs/typedMemo.tsx +0 -5
- package/hooks/useControlledValue.tsx +0 -68
- package/hooks/useLatest.tsx +0 -9
- package/hooks/useMergedRefs.ts +0 -14
- package/hooks/usePrevious.ts +0 -13
- package/hooks/useSearchable.tsx +0 -74
- package/hooks/useSubcomponents.tsx +0 -59
- package/hooks/useToggle.tsx +0 -24
- package/utils/color.ts +0 -22
- package/utils/compare/index.ts +0 -54
- package/utils/lodash.ts +0 -49
- package/utils/repository.ts +0 -53
|
@@ -1,32 +1,109 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createContext } from 'react';
|
|
2
2
|
import { StyleSheet } from 'react-native-unistyles';
|
|
3
3
|
|
|
4
4
|
import { getRegisteredComponentStylesWithFallback } from '../../core';
|
|
5
|
+
import type { ButtonContextType } from './types';
|
|
5
6
|
|
|
6
7
|
export const sizeToIconSizeMap = {
|
|
7
|
-
xs:
|
|
8
|
-
sm:
|
|
8
|
+
xs: 20,
|
|
9
|
+
sm: 20,
|
|
9
10
|
md: 24,
|
|
10
|
-
lg:
|
|
11
|
+
lg: 32,
|
|
12
|
+
xl: 40,
|
|
11
13
|
};
|
|
12
14
|
|
|
13
|
-
const
|
|
15
|
+
export const sizeToHeightMap = {
|
|
16
|
+
xs: 32,
|
|
17
|
+
sm: 40,
|
|
18
|
+
md: 56,
|
|
19
|
+
lg: 96,
|
|
20
|
+
xl: 136,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const sizeToPaddingMap = {
|
|
24
|
+
xs: 12,
|
|
25
|
+
sm: 16,
|
|
26
|
+
md: 24,
|
|
27
|
+
lg: 48,
|
|
28
|
+
xl: 64,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const sizeToIconGapMap = {
|
|
32
|
+
xs: 4,
|
|
33
|
+
sm: 8,
|
|
34
|
+
md: 8,
|
|
35
|
+
lg: 12,
|
|
36
|
+
xl: 16,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const elevationMap: Record<string, Record<string, number>> = {
|
|
40
|
+
true: {
|
|
41
|
+
contained: 1,
|
|
42
|
+
'contained-tonal': 1,
|
|
43
|
+
elevated: 2,
|
|
44
|
+
},
|
|
45
|
+
false: {
|
|
46
|
+
elevated: 1,
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const ButtonContext = createContext<ButtonContextType>({
|
|
51
|
+
variant: 'text',
|
|
52
|
+
size: 'sm',
|
|
53
|
+
state: 'default',
|
|
54
|
+
disabled: false,
|
|
55
|
+
labelColor: undefined,
|
|
56
|
+
iconSize: undefined,
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const buttonStylesDefault = StyleSheet.create(theme => {
|
|
14
60
|
return {
|
|
15
61
|
root: {
|
|
62
|
+
flexDirection: 'row',
|
|
63
|
+
alignItems: 'center',
|
|
64
|
+
justifyContent: 'center',
|
|
65
|
+
borderStyle: 'solid',
|
|
16
66
|
variants: {
|
|
17
67
|
size: {
|
|
68
|
+
xs: {
|
|
69
|
+
minWidth: 64,
|
|
70
|
+
height: 32,
|
|
71
|
+
paddingHorizontal: 12,
|
|
72
|
+
gap: 4,
|
|
73
|
+
},
|
|
18
74
|
sm: {
|
|
19
75
|
minWidth: 64,
|
|
20
|
-
|
|
76
|
+
height: 40,
|
|
77
|
+
paddingHorizontal: 16,
|
|
78
|
+
gap: 8,
|
|
21
79
|
},
|
|
22
80
|
md: {
|
|
23
81
|
minWidth: 64,
|
|
24
|
-
|
|
82
|
+
height: 56,
|
|
83
|
+
paddingHorizontal: 24,
|
|
84
|
+
gap: 8,
|
|
25
85
|
},
|
|
26
86
|
lg: {
|
|
27
|
-
minWidth:
|
|
87
|
+
minWidth: 96,
|
|
88
|
+
height: 96,
|
|
89
|
+
paddingHorizontal: 48,
|
|
90
|
+
gap: 12,
|
|
91
|
+
},
|
|
92
|
+
xl: {
|
|
93
|
+
minWidth: 136,
|
|
94
|
+
height: 136,
|
|
95
|
+
paddingHorizontal: 64,
|
|
96
|
+
gap: 16,
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
shape: {
|
|
100
|
+
rounded: {
|
|
28
101
|
borderRadius: theme.shapes.corner.full,
|
|
29
102
|
},
|
|
103
|
+
square: {
|
|
104
|
+
// Base - will be overridden by compoundVariants for size-specific radii
|
|
105
|
+
borderRadius: 12,
|
|
106
|
+
},
|
|
30
107
|
},
|
|
31
108
|
|
|
32
109
|
state: {
|
|
@@ -128,6 +205,42 @@ const defaultStylesDefault = StyleSheet.create(theme => {
|
|
|
128
205
|
// elevationLevel: theme.elevations.level1,
|
|
129
206
|
},
|
|
130
207
|
},
|
|
208
|
+
// Square shape + size compound variants for border radius
|
|
209
|
+
{
|
|
210
|
+
shape: 'square',
|
|
211
|
+
size: 'xs',
|
|
212
|
+
styles: {
|
|
213
|
+
borderRadius: theme.shapes.corner.small,
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
shape: 'square',
|
|
218
|
+
size: 'sm',
|
|
219
|
+
styles: {
|
|
220
|
+
borderRadius: theme.shapes.corner.medium,
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
shape: 'square',
|
|
225
|
+
size: 'md',
|
|
226
|
+
styles: {
|
|
227
|
+
borderRadius: theme.shapes.corner.large,
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
shape: 'square',
|
|
232
|
+
size: 'lg',
|
|
233
|
+
styles: {
|
|
234
|
+
borderRadius: theme.shapes.corner.extraLarge,
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
shape: 'square',
|
|
239
|
+
size: 'xl',
|
|
240
|
+
styles: {
|
|
241
|
+
borderRadius: theme.shapes.corner.extraLarge,
|
|
242
|
+
},
|
|
243
|
+
},
|
|
131
244
|
],
|
|
132
245
|
},
|
|
133
246
|
stateLayer: {
|
|
@@ -184,230 +297,139 @@ const defaultStylesDefault = StyleSheet.create(theme => {
|
|
|
184
297
|
},
|
|
185
298
|
],
|
|
186
299
|
},
|
|
300
|
+
};
|
|
301
|
+
});
|
|
187
302
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
? { marginLeft: theme.spacings['4'], marginRight: theme.spacings._4 }
|
|
205
|
-
: {}),
|
|
206
|
-
variants: {
|
|
207
|
-
state: {
|
|
208
|
-
disabled: {
|
|
209
|
-
color: theme.colors.onSurfaceDisabled,
|
|
210
|
-
},
|
|
211
|
-
hovered: {},
|
|
212
|
-
default: {},
|
|
303
|
+
/**
|
|
304
|
+
* Styles for Button.Icon component
|
|
305
|
+
*/
|
|
306
|
+
const buttonIconStylesDefault = StyleSheet.create(theme => ({
|
|
307
|
+
root: {
|
|
308
|
+
variants: {
|
|
309
|
+
state: {
|
|
310
|
+
disabled: {
|
|
311
|
+
color: theme.colors.onSurfaceDisabled,
|
|
312
|
+
},
|
|
313
|
+
hovered: {},
|
|
314
|
+
default: {},
|
|
315
|
+
},
|
|
316
|
+
variant: {
|
|
317
|
+
outlined: {
|
|
318
|
+
color: theme.colors.primary,
|
|
213
319
|
},
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
color: theme.colors.primary,
|
|
217
|
-
},
|
|
218
|
-
text: {
|
|
219
|
-
color: theme.colors.primary,
|
|
220
|
-
},
|
|
221
|
-
contained: {
|
|
222
|
-
color: theme.colors.onPrimary,
|
|
223
|
-
},
|
|
224
|
-
elevated: {
|
|
225
|
-
color: theme.colors.primary,
|
|
226
|
-
},
|
|
227
|
-
'contained-tonal': {
|
|
228
|
-
color: theme.colors.onSecondaryContainer,
|
|
229
|
-
},
|
|
320
|
+
text: {
|
|
321
|
+
color: theme.colors.primary,
|
|
230
322
|
},
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
iconTextMode: {
|
|
234
|
-
marginLeft: theme.spacings['3'],
|
|
235
|
-
marginRight: theme.spacings._2,
|
|
236
|
-
},
|
|
237
|
-
label: {
|
|
238
|
-
display: 'flex',
|
|
239
|
-
alignItems: 'center',
|
|
240
|
-
textAlign: 'center',
|
|
241
|
-
marginVertical: theme.spacings['2l'],
|
|
242
|
-
marginHorizontal: theme.spacings['6'],
|
|
243
|
-
...theme.typescale.labelLarge,
|
|
244
|
-
|
|
245
|
-
variants: {
|
|
246
|
-
size: {
|
|
247
|
-
sm: {
|
|
248
|
-
...theme.typescale.labelMedium,
|
|
249
|
-
},
|
|
250
|
-
md: {
|
|
251
|
-
...theme.typescale.labelLarge,
|
|
252
|
-
},
|
|
253
|
-
lg: {
|
|
254
|
-
...theme.typescale.labelLarge,
|
|
255
|
-
fontSize: theme.typescale.bodyLarge.fontSize,
|
|
256
|
-
},
|
|
323
|
+
contained: {
|
|
324
|
+
color: theme.colors.onPrimary,
|
|
257
325
|
},
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
color: theme.colors.primary,
|
|
261
|
-
},
|
|
262
|
-
text: {
|
|
263
|
-
color: theme.colors.primary,
|
|
264
|
-
},
|
|
265
|
-
contained: {
|
|
266
|
-
color: theme.colors.onPrimary,
|
|
267
|
-
},
|
|
268
|
-
elevated: {
|
|
269
|
-
color: theme.colors.primary,
|
|
270
|
-
},
|
|
271
|
-
'contained-tonal': {
|
|
272
|
-
color: theme.colors.onSecondaryContainer,
|
|
273
|
-
},
|
|
326
|
+
elevated: {
|
|
327
|
+
color: theme.colors.primary,
|
|
274
328
|
},
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
color: theme.colors.onSurfaceDisabled,
|
|
278
|
-
},
|
|
279
|
-
hovered: {},
|
|
280
|
-
default: {},
|
|
329
|
+
'contained-tonal': {
|
|
330
|
+
color: theme.colors.onSecondaryContainer,
|
|
281
331
|
},
|
|
282
332
|
},
|
|
333
|
+
},
|
|
334
|
+
},
|
|
335
|
+
}));
|
|
283
336
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
337
|
+
/**
|
|
338
|
+
* Styles for Button.Text component
|
|
339
|
+
*/
|
|
340
|
+
const buttonTextStylesDefault = StyleSheet.create(theme => ({
|
|
341
|
+
root: {
|
|
342
|
+
...theme.typescale.labelLarge,
|
|
343
|
+
variants: {
|
|
344
|
+
size: {
|
|
345
|
+
xs: {
|
|
346
|
+
...theme.typescale.labelLarge,
|
|
291
347
|
},
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
variant: 'text',
|
|
295
|
-
state: 'disabled',
|
|
296
|
-
styles: {
|
|
297
|
-
color: theme.colors.stateLayer.disabled.onSurface_Level4,
|
|
298
|
-
},
|
|
348
|
+
sm: {
|
|
349
|
+
...theme.typescale.labelLarge,
|
|
299
350
|
},
|
|
300
|
-
{
|
|
301
|
-
|
|
302
|
-
state: 'disabled',
|
|
303
|
-
styles: {
|
|
304
|
-
color: theme.colors.stateLayer.disabled.onSurface_Level4,
|
|
305
|
-
},
|
|
351
|
+
md: {
|
|
352
|
+
...theme.typescale.titleMedium,
|
|
306
353
|
},
|
|
307
|
-
{
|
|
308
|
-
|
|
309
|
-
state: 'disabled',
|
|
310
|
-
styles: {
|
|
311
|
-
color: theme.colors.stateLayer.disabled.onSurface_Level4,
|
|
312
|
-
},
|
|
354
|
+
lg: {
|
|
355
|
+
...theme.typescale.headlineSmall,
|
|
313
356
|
},
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
variant: 'contained-tonal',
|
|
317
|
-
state: 'disabled',
|
|
318
|
-
styles: {
|
|
319
|
-
color: theme.colors.stateLayer.disabled.onSurface_Level4,
|
|
320
|
-
},
|
|
357
|
+
xl: {
|
|
358
|
+
...theme.typescale.headlineLarge,
|
|
321
359
|
},
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
marginHorizontal: theme.spacings['3'],
|
|
327
|
-
...theme.typescale.labelLarge,
|
|
328
|
-
|
|
329
|
-
variants: {
|
|
330
|
-
variant: {
|
|
331
|
-
text: {
|
|
332
|
-
color: theme.colors.primary,
|
|
333
|
-
},
|
|
360
|
+
},
|
|
361
|
+
variant: {
|
|
362
|
+
text: {
|
|
363
|
+
color: theme.colors.primary,
|
|
334
364
|
},
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
color: theme.colors.onSurfaceDisabled,
|
|
338
|
-
},
|
|
339
|
-
hovered: {},
|
|
340
|
-
default: {},
|
|
365
|
+
outlined: {
|
|
366
|
+
color: theme.colors.primary,
|
|
341
367
|
},
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
...theme.typescale.labelLarge,
|
|
351
|
-
fontSize: theme.typescale.bodyLarge.fontSize,
|
|
352
|
-
},
|
|
368
|
+
contained: {
|
|
369
|
+
color: theme.colors.onPrimary,
|
|
370
|
+
},
|
|
371
|
+
elevated: {
|
|
372
|
+
color: theme.colors.primary,
|
|
373
|
+
},
|
|
374
|
+
'contained-tonal': {
|
|
375
|
+
color: theme.colors.onSecondaryContainer,
|
|
353
376
|
},
|
|
354
377
|
},
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
variant: 'text',
|
|
359
|
-
state: 'disabled',
|
|
360
|
-
styles: {
|
|
361
|
-
color: theme.colors.stateLayer.disabled.onSurface_Level4,
|
|
362
|
-
},
|
|
378
|
+
state: {
|
|
379
|
+
disabled: {
|
|
380
|
+
color: theme.colors.onSurfaceDisabled,
|
|
363
381
|
},
|
|
364
|
-
|
|
382
|
+
hovered: {},
|
|
383
|
+
default: {},
|
|
384
|
+
},
|
|
365
385
|
},
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
marginHorizontal: theme.spacings['4'],
|
|
386
|
+
},
|
|
387
|
+
}));
|
|
369
388
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
389
|
+
const buttonActivityIndicatorStylesDefault = StyleSheet.create(theme => ({
|
|
390
|
+
root: {
|
|
391
|
+
variants: {
|
|
392
|
+
state: {
|
|
393
|
+
disabled: {
|
|
394
|
+
color: theme.colors.onSurfaceDisabled,
|
|
395
|
+
},
|
|
396
|
+
hovered: {},
|
|
397
|
+
default: {},
|
|
398
|
+
},
|
|
399
|
+
variant: {
|
|
400
|
+
outlined: {
|
|
401
|
+
color: theme.colors.primary,
|
|
375
402
|
},
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
color: theme.colors.onSurfaceDisabled,
|
|
379
|
-
},
|
|
380
|
-
hovered: {},
|
|
381
|
-
default: {},
|
|
403
|
+
text: {
|
|
404
|
+
color: theme.colors.primary,
|
|
382
405
|
},
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
...theme.typescale.labelMedium,
|
|
386
|
-
},
|
|
387
|
-
md: {
|
|
388
|
-
...theme.typescale.labelLarge,
|
|
389
|
-
},
|
|
390
|
-
lg: {
|
|
391
|
-
...theme.typescale.labelLarge,
|
|
392
|
-
fontSize: theme.typescale.bodyLarge.fontSize,
|
|
393
|
-
},
|
|
406
|
+
contained: {
|
|
407
|
+
color: theme.colors.onPrimary,
|
|
394
408
|
},
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
compoundVariants: [
|
|
398
|
-
{
|
|
399
|
-
variant: 'text',
|
|
400
|
-
state: 'disabled',
|
|
401
|
-
styles: {
|
|
402
|
-
color: theme.colors.stateLayer.disabled.onSurface_Level4,
|
|
403
|
-
},
|
|
409
|
+
elevated: {
|
|
410
|
+
color: theme.colors.primary,
|
|
404
411
|
},
|
|
405
|
-
|
|
412
|
+
'contained-tonal': {
|
|
413
|
+
color: theme.colors.onSecondaryContainer,
|
|
414
|
+
},
|
|
415
|
+
},
|
|
406
416
|
},
|
|
407
|
-
}
|
|
408
|
-
});
|
|
417
|
+
},
|
|
418
|
+
}));
|
|
419
|
+
|
|
420
|
+
export const buttonStyles = getRegisteredComponentStylesWithFallback('Button', buttonStylesDefault);
|
|
421
|
+
|
|
422
|
+
export const buttonIconStyles = getRegisteredComponentStylesWithFallback(
|
|
423
|
+
'ButtonIcon',
|
|
424
|
+
buttonIconStylesDefault,
|
|
425
|
+
);
|
|
426
|
+
|
|
427
|
+
export const buttonTextStyles = getRegisteredComponentStylesWithFallback(
|
|
428
|
+
'ButtonText',
|
|
429
|
+
buttonTextStylesDefault,
|
|
430
|
+
);
|
|
409
431
|
|
|
410
|
-
export const
|
|
411
|
-
'
|
|
412
|
-
|
|
432
|
+
export const buttonActivityIndicatorStyles = getRegisteredComponentStylesWithFallback(
|
|
433
|
+
'ButtonActivityIndicator',
|
|
434
|
+
buttonActivityIndicatorStylesDefault,
|
|
413
435
|
);
|
package/components/Card/Card.tsx
CHANGED
|
@@ -51,7 +51,7 @@ const Card = (
|
|
|
51
51
|
container: [cardStyles.container, cardStyles.root, style],
|
|
52
52
|
innerContainer: [cardStyles.innerContainer, touchableContainerStyle],
|
|
53
53
|
};
|
|
54
|
-
// eslint-disable-next-line
|
|
54
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
55
55
|
}, [variant, state, style, touchableContainerStyle]);
|
|
56
56
|
|
|
57
57
|
const elevation = elevationProp === undefined ? elevationLevel ?? 0 : elevationProp;
|