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.
Files changed (227) hide show
  1. package/components/Accordion/Accordion.tsx +2 -6
  2. package/components/Accordion/AccordionItem.tsx +16 -12
  3. package/components/Accordion/AccordionItemContent.tsx +6 -1
  4. package/components/Accordion/AccordionItemHeader.tsx +1 -1
  5. package/components/Accordion/utils.ts +6 -0
  6. package/components/ActivityIndicator/ActivityIndicator.tsx +6 -15
  7. package/components/Appbar/AppbarBase.tsx +18 -13
  8. package/components/Button/Button.tsx +211 -264
  9. package/components/Button/index.tsx +9 -3
  10. package/components/Button/types.ts +16 -2
  11. package/components/Button/utils.ts +230 -208
  12. package/components/Card/Card.tsx +1 -1
  13. package/components/Checkbox/Checkbox.tsx +125 -88
  14. package/components/Checkbox/CheckboxBase.ios.tsx +14 -23
  15. package/components/Checkbox/CheckboxBase.tsx +21 -137
  16. package/components/Checkbox/context.tsx +14 -0
  17. package/components/Checkbox/index.tsx +11 -4
  18. package/components/Checkbox/types.ts +63 -29
  19. package/components/Checkbox/utils.ts +25 -108
  20. package/components/Chip/Chip.tsx +41 -52
  21. package/components/Chip/utils.ts +3 -7
  22. package/components/DateField/DateField.tsx +111 -0
  23. package/components/DateField/index.tsx +6 -0
  24. package/components/{DatePickerInput/inputUtils.ts → DateField/useDateFieldState.ts} +19 -51
  25. package/components/DatePicker/DateCalendar.tsx +83 -0
  26. package/components/DatePicker/DatePickerActions.tsx +73 -0
  27. package/components/DatePicker/DatePickerModal.tsx +246 -0
  28. package/components/DatePicker/DatePickerPopover.tsx +79 -0
  29. package/components/DatePicker/DatePickerProvider.tsx +158 -0
  30. package/components/DatePicker/DatePickerTrigger.tsx +23 -0
  31. package/components/DatePicker/context.tsx +83 -0
  32. package/components/DatePicker/index.tsx +45 -0
  33. package/components/DatePicker/utils.ts +295 -0
  34. package/components/DatePickerInline/DatePickerDockedHeader.tsx +117 -0
  35. package/components/DatePickerInline/DatePickerInline.tsx +17 -16
  36. package/components/DatePickerInline/DatePickerInlineBase.tsx +11 -5
  37. package/components/DatePickerInline/DatePickerInlineHeader.tsx +50 -20
  38. package/components/DatePickerInline/Day.tsx +25 -1
  39. package/components/DatePickerInline/DayNames.tsx +13 -10
  40. package/components/DatePickerInline/DayRange.tsx +2 -4
  41. package/components/DatePickerInline/HeaderItem.tsx +44 -29
  42. package/components/DatePickerInline/Month.tsx +48 -67
  43. package/components/DatePickerInline/MonthPicker.tsx +80 -92
  44. package/components/DatePickerInline/Swiper.native.tsx +21 -4
  45. package/components/DatePickerInline/Swiper.tsx +169 -14
  46. package/components/DatePickerInline/SwiperUtils.ts +1 -1
  47. package/components/DatePickerInline/Week.tsx +6 -1
  48. package/components/DatePickerInline/YearPicker.tsx +220 -78
  49. package/components/DatePickerInline/dateUtils.tsx +18 -13
  50. package/components/DatePickerInline/store.tsx +27 -0
  51. package/components/DatePickerInline/types.ts +6 -2
  52. package/components/DatePickerInline/utils.ts +66 -29
  53. package/components/Divider/Divider.tsx +192 -0
  54. package/components/Divider/index.tsx +10 -0
  55. package/components/Drawer/Drawer.tsx +17 -6
  56. package/components/Drawer/DrawerItemGroup.tsx +3 -7
  57. package/components/ElementGroup/ElementGroup.tsx +1 -1
  58. package/components/FilePicker/FilePicker.tsx +48 -78
  59. package/components/FilePicker/index.tsx +2 -1
  60. package/components/FilePicker/utils.ts +9 -0
  61. package/components/HelperText/HelperText.tsx +0 -35
  62. package/components/Icon/iconFactory.tsx +5 -4
  63. package/components/Icon/index.tsx +1 -1
  64. package/components/Icon/types.ts +17 -6
  65. package/components/IconButton/IconButton.tsx +84 -84
  66. package/components/IconButton/index.tsx +1 -0
  67. package/components/IconButton/types.ts +10 -0
  68. package/components/IconButton/utils.ts +167 -33
  69. package/components/List/List.tsx +276 -0
  70. package/components/List/context.tsx +27 -0
  71. package/components/List/index.ts +8 -0
  72. package/components/List/types.ts +117 -0
  73. package/components/List/utils.ts +79 -0
  74. package/components/LoadingIndicator/LoadingIndicator.tsx +253 -0
  75. package/components/LoadingIndicator/LoadingIndicator.web.tsx +136 -0
  76. package/components/LoadingIndicator/index.tsx +13 -0
  77. package/components/LoadingIndicator/utils.ts +117 -0
  78. package/components/Menu/Menu.tsx +162 -39
  79. package/components/Menu/index.tsx +10 -7
  80. package/components/Menu/utils.ts +21 -70
  81. package/components/NavigationRail/NavigationRail.tsx +15 -9
  82. package/components/Popover/Popover.tsx +119 -145
  83. package/components/Popover/PopoverRoot.tsx +60 -0
  84. package/components/Popover/common.ts +54 -34
  85. package/components/Popover/index.ts +12 -1
  86. package/components/Popover/usePlatformMeasure.native.ts +90 -0
  87. package/components/Popover/usePlatformMeasure.ts +120 -0
  88. package/components/Popover/utils.ts +34 -0
  89. package/components/Portal/Portal.tsx +1 -2
  90. package/components/Radio/Radio.tsx +188 -0
  91. package/components/Radio/RadioBase.ios.tsx +69 -0
  92. package/components/Radio/RadioBase.tsx +136 -0
  93. package/components/Radio/context.tsx +23 -0
  94. package/components/Radio/index.tsx +20 -0
  95. package/components/Radio/types.ts +101 -0
  96. package/components/Radio/utils.ts +115 -0
  97. package/components/Rating/Rating.tsx +1 -1
  98. package/components/Select/Select.tsx +521 -785
  99. package/components/Select/context.tsx +81 -0
  100. package/components/Select/index.ts +26 -14
  101. package/components/Select/types.ts +65 -58
  102. package/components/Select/utils.ts +126 -0
  103. package/components/Slot/Slot.tsx +244 -0
  104. package/components/Slot/compose-refs.tsx +62 -0
  105. package/components/Slot/index.tsx +8 -0
  106. package/components/Surface/Surface.android.tsx +32 -7
  107. package/components/Surface/Surface.ios.tsx +34 -29
  108. package/components/Surface/Surface.tsx +31 -4
  109. package/components/Surface/utils.ts +44 -6
  110. package/components/Switch/Switch.ios.tsx +1 -1
  111. package/components/Switch/Switch.tsx +10 -3
  112. package/components/Tabs/TabItem.tsx +35 -58
  113. package/components/Tabs/TabLabel.tsx +5 -9
  114. package/components/Tabs/Tabs.tsx +156 -150
  115. package/components/Tabs/utils.ts +15 -2
  116. package/components/Text/textFactory.tsx +17 -5
  117. package/components/TextInput/TextInput.tsx +663 -579
  118. package/components/TextInput/index.tsx +19 -3
  119. package/components/TextInput/types.ts +77 -28
  120. package/components/TextInput/utils.ts +235 -145
  121. package/components/TimeField/TimeField.tsx +75 -0
  122. package/components/TimeField/index.tsx +6 -0
  123. package/components/TimeField/useTimeFieldState.ts +70 -0
  124. package/components/{TimePickerField/sanitizeTime.ts → TimeField/utils.ts} +77 -10
  125. package/components/TimePicker/AnalogClock.tsx +1 -1
  126. package/components/TimePicker/TimeInput.tsx +87 -42
  127. package/components/TimePicker/TimeInputs.tsx +138 -50
  128. package/components/TimePicker/TimePicker.tsx +74 -11
  129. package/components/TimePicker/TimePickerModal.tsx +186 -0
  130. package/components/TimePicker/context.tsx +17 -0
  131. package/components/TimePicker/index.tsx +15 -3
  132. package/components/TimePicker/utils.ts +93 -4
  133. package/components/Tooltip/Tooltip.tsx +42 -67
  134. package/components/Tooltip/TooltipContent.tsx +32 -5
  135. package/components/Tooltip/TooltipTrigger.tsx +20 -20
  136. package/components/Tooltip/index.tsx +1 -1
  137. package/components/TouchableRipple/TouchableRipple.native.tsx +83 -16
  138. package/components/TouchableRipple/TouchableRipple.tsx +150 -102
  139. package/components/TouchableRipple/rippleFromForegroundColor.ts +21 -0
  140. package/hocs/index.tsx +1 -1
  141. package/hocs/withKeyboardAccessibility.tsx +2 -3
  142. package/hocs/withPortal.tsx +1 -1
  143. package/hooks/index.tsx +2 -12
  144. package/hooks/useActionState.tsx +19 -8
  145. package/hooks/useContrastColor.ts +1 -2
  146. package/hooks/useFilePicker.tsx +7 -17
  147. package/hooks/useHandleNumberFormat.tsx +2 -2
  148. package/hooks/useMediaQuery.tsx +1 -2
  149. package/package.json +95 -111
  150. package/shortcuts-manager/ShortcutsManager/ShortcutsManager.tsx +6 -3
  151. package/shortcuts-manager/ShortcutsManager/utils.tsx +1 -1
  152. package/shortcuts-manager/useSetScopes/useSetScopes.tsx +1 -1
  153. package/shortcuts-manager/useShortcut/useShortcut.tsx +1 -1
  154. package/styles/shadow.ts +2 -1
  155. package/styles/themes/LightTheme.tsx +1 -1
  156. package/utils/DocumentPicker/documentPicker.ts +78 -27
  157. package/utils/DocumentPicker/types.ts +0 -1
  158. package/utils/extractSubcomponents.ts +89 -0
  159. package/utils/extractTextStyles.ts +1 -2
  160. package/utils/formatNumberWithMask/formatNumberWithMask.ts +2 -1
  161. package/utils/index.ts +0 -3
  162. package/utils/normalizeToNumberString/normalizeToNumberString.ts +1 -1
  163. package/components/DatePickerDocked/DatePickerDocked.tsx +0 -30
  164. package/components/DatePickerDocked/DatePickerDockedHeader.tsx +0 -129
  165. package/components/DatePickerDocked/index.tsx +0 -17
  166. package/components/DatePickerDocked/types.ts +0 -11
  167. package/components/DatePickerDocked/utils.ts +0 -157
  168. package/components/DatePickerInline/DatePickerContext.tsx +0 -21
  169. package/components/DatePickerInput/DatePickerInput.tsx +0 -139
  170. package/components/DatePickerInput/DatePickerInputModal.tsx +0 -48
  171. package/components/DatePickerInput/DatePickerInputWithoutModal.tsx +0 -77
  172. package/components/DatePickerInput/DateRangeInput.tsx +0 -88
  173. package/components/DatePickerInput/index.tsx +0 -10
  174. package/components/DatePickerInput/types.ts +0 -28
  175. package/components/DatePickerInput/utils.ts +0 -15
  176. package/components/DatePickerModal/AnimatedCrossView.tsx +0 -94
  177. package/components/DatePickerModal/CalendarEdit.tsx +0 -139
  178. package/components/DatePickerModal/DatePickerModal.tsx +0 -85
  179. package/components/DatePickerModal/DatePickerModalContent.tsx +0 -155
  180. package/components/DatePickerModal/DatePickerModalContentHeader.tsx +0 -213
  181. package/components/DatePickerModal/DatePickerModalHeader.tsx +0 -74
  182. package/components/DatePickerModal/DatePickerModalHeaderBackground.tsx +0 -13
  183. package/components/DatePickerModal/index.tsx +0 -16
  184. package/components/DatePickerModal/types.ts +0 -92
  185. package/components/DatePickerModal/utils.ts +0 -122
  186. package/components/DateTimePicker/DateTimePicker.tsx +0 -172
  187. package/components/DateTimePicker/index.tsx +0 -10
  188. package/components/DateTimePicker/utils.ts +0 -12
  189. package/components/HorizontalDivider/HorizontalDivider.tsx +0 -103
  190. package/components/HorizontalDivider/index.tsx +0 -9
  191. package/components/ListItem/ListItem.tsx +0 -136
  192. package/components/ListItem/ListItemDescription.tsx +0 -25
  193. package/components/ListItem/ListItemTitle.tsx +0 -25
  194. package/components/ListItem/index.tsx +0 -14
  195. package/components/ListItem/utils.ts +0 -115
  196. package/components/Menu/MenuDivider.tsx +0 -13
  197. package/components/Menu/MenuItem.tsx +0 -128
  198. package/components/Popover/Popover.native.tsx +0 -185
  199. package/components/RadioButton/RadioButton.tsx +0 -138
  200. package/components/RadioButton/RadioButtonAndroid.tsx +0 -188
  201. package/components/RadioButton/RadioButtonGroup.tsx +0 -98
  202. package/components/RadioButton/RadioButtonIOS.tsx +0 -106
  203. package/components/RadioButton/RadioButtonItem.tsx +0 -232
  204. package/components/RadioButton/index.ts +0 -22
  205. package/components/RadioButton/utils.ts +0 -165
  206. package/components/TimePickerField/TimePickerField.tsx +0 -152
  207. package/components/TimePickerField/index.tsx +0 -10
  208. package/components/TimePickerField/utils.ts +0 -94
  209. package/components/TimePickerModal/TimePickerModal.tsx +0 -115
  210. package/components/TimePickerModal/index.tsx +0 -10
  211. package/components/TimePickerModal/utils.ts +0 -47
  212. package/components/VerticalDivider/VerticalDivider.tsx +0 -100
  213. package/components/VerticalDivider/index.tsx +0 -9
  214. package/context-bridge/index.tsx +0 -87
  215. package/fast-context/index.tsx +0 -190
  216. package/hocs/typedMemo.tsx +0 -5
  217. package/hooks/useControlledValue.tsx +0 -68
  218. package/hooks/useLatest.tsx +0 -9
  219. package/hooks/useMergedRefs.ts +0 -14
  220. package/hooks/usePrevious.ts +0 -13
  221. package/hooks/useSearchable.tsx +0 -74
  222. package/hooks/useSubcomponents.tsx +0 -59
  223. package/hooks/useToggle.tsx +0 -24
  224. package/utils/color.ts +0 -22
  225. package/utils/compare/index.ts +0 -54
  226. package/utils/lodash.ts +0 -49
  227. package/utils/repository.ts +0 -53
@@ -1,32 +1,109 @@
1
- import { Platform } from 'react-native';
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: 18,
8
- sm: 22,
8
+ xs: 20,
9
+ sm: 20,
9
10
  md: 24,
10
- lg: 26,
11
+ lg: 32,
12
+ xl: 40,
11
13
  };
12
14
 
13
- const defaultStylesDefault = StyleSheet.create(theme => {
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
- borderRadius: theme.shapes.corner.full,
76
+ height: 40,
77
+ paddingHorizontal: 16,
78
+ gap: 8,
21
79
  },
22
80
  md: {
23
81
  minWidth: 64,
24
- borderRadius: theme.shapes.corner.full,
82
+ height: 56,
83
+ paddingHorizontal: 24,
84
+ gap: 8,
25
85
  },
26
86
  lg: {
27
- minWidth: 64,
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
- button: {
189
- borderStyle: 'solid',
190
- },
191
- content: {
192
- flexDirection: 'row',
193
- alignItems: 'center',
194
- justifyContent: 'center',
195
- flexGrow: 1,
196
- },
197
- iconContainer: {
198
- ...(Platform.OS !== 'web'
199
- ? { marginLeft: theme.spacings['4'], marginRight: theme.spacings._4 }
200
- : {}),
201
- },
202
- icon: {
203
- ...(Platform.OS === 'web'
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
- variant: {
215
- outlined: {
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
- variant: {
259
- outlined: {
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
- state: {
276
- disabled: {
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
- compoundVariants: [
285
- {
286
- variant: 'outlined',
287
- state: 'disabled',
288
- styles: {
289
- color: theme.colors.stateLayer.disabled.onSurface_Level4,
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
- variant: 'contained',
302
- state: 'disabled',
303
- styles: {
304
- color: theme.colors.stateLayer.disabled.onSurface_Level4,
305
- },
351
+ md: {
352
+ ...theme.typescale.titleMedium,
306
353
  },
307
- {
308
- variant: 'elevated',
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
- labelText: {
325
- marginVertical: theme.spacings['2l'],
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
- state: {
336
- disabled: {
337
- color: theme.colors.onSurfaceDisabled,
338
- },
339
- hovered: {},
340
- default: {},
365
+ outlined: {
366
+ color: theme.colors.primary,
341
367
  },
342
- size: {
343
- sm: {
344
- ...theme.typescale.labelMedium,
345
- },
346
- md: {
347
- ...theme.typescale.labelLarge,
348
- },
349
- lg: {
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
- compoundVariants: [
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
- labelTextAddons: {
367
- marginVertical: theme.spacings['2l'],
368
- marginHorizontal: theme.spacings['4'],
386
+ },
387
+ }));
369
388
 
370
- variants: {
371
- variant: {
372
- text: {
373
- color: theme.colors.primary,
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
- state: {
377
- disabled: {
378
- color: theme.colors.onSurfaceDisabled,
379
- },
380
- hovered: {},
381
- default: {},
403
+ text: {
404
+ color: theme.colors.primary,
382
405
  },
383
- size: {
384
- sm: {
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 defaultStyles = getRegisteredComponentStylesWithFallback(
411
- 'Button',
412
- defaultStylesDefault,
432
+ export const buttonActivityIndicatorStyles = getRegisteredComponentStylesWithFallback(
433
+ 'ButtonActivityIndicator',
434
+ buttonActivityIndicatorStylesDefault,
413
435
  );
@@ -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;