react-native-molecules 0.5.0-beta.0 → 0.5.0-beta.10

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 (164) hide show
  1. package/README.md +87 -0
  2. package/components/Accordion/AccordionItem.tsx +3 -2
  3. package/components/Accordion/AccordionItemContent.tsx +1 -0
  4. package/components/Accordion/AccordionItemHeader.tsx +6 -5
  5. package/components/Accordion/index.tsx +8 -14
  6. package/components/Accordion/utils.ts +17 -14
  7. package/components/ActivityIndicator/ActivityIndicator.tsx +12 -20
  8. package/components/ActivityIndicator/index.tsx +1 -5
  9. package/components/Appbar/index.tsx +1 -4
  10. package/components/Appbar/utils.ts +33 -21
  11. package/components/Avatar/index.tsx +1 -5
  12. package/components/Avatar/utils.ts +2 -6
  13. package/components/Backdrop/Backdrop.tsx +2 -2
  14. package/components/Backdrop/index.tsx +1 -5
  15. package/components/Backdrop/utils.ts +5 -6
  16. package/components/Badge/index.tsx +1 -5
  17. package/components/Badge/utils.ts +2 -6
  18. package/components/Button/Button.tsx +211 -264
  19. package/components/Button/index.tsx +9 -7
  20. package/components/Button/types.ts +16 -2
  21. package/components/Button/utils.ts +231 -212
  22. package/components/Card/Card.tsx +8 -4
  23. package/components/Card/CardContent.tsx +5 -4
  24. package/components/Card/CardHeader.tsx +5 -3
  25. package/components/Card/CardMedia.tsx +5 -3
  26. package/components/Card/CardTypography.tsx +5 -3
  27. package/components/Card/index.tsx +1 -5
  28. package/components/Card/utils.ts +5 -6
  29. package/components/Checkbox/Checkbox.tsx +1 -0
  30. package/components/Checkbox/CheckboxBase.ios.tsx +1 -0
  31. package/components/Checkbox/CheckboxBase.tsx +1 -0
  32. package/components/Checkbox/index.tsx +1 -5
  33. package/components/Checkbox/utils.ts +6 -6
  34. package/components/Chip/Chip.tsx +40 -52
  35. package/components/Chip/index.tsx +1 -5
  36. package/components/Chip/utils.ts +5 -13
  37. package/components/DatePickerDocked/index.tsx +1 -5
  38. package/components/DatePickerDocked/utils.ts +21 -19
  39. package/components/DatePickerInline/index.tsx +1 -5
  40. package/components/DatePickerInline/utils.ts +41 -28
  41. package/components/DatePickerInput/index.tsx +2 -6
  42. package/components/DatePickerInput/utils.ts +5 -6
  43. package/components/DatePickerModal/DatePickerModalHeader.tsx +1 -1
  44. package/components/DatePickerModal/index.tsx +1 -5
  45. package/components/DatePickerModal/utils.ts +17 -16
  46. package/components/DateTimePicker/index.tsx +1 -5
  47. package/components/DateTimePicker/utils.ts +5 -6
  48. package/components/Dialog/index.tsx +1 -5
  49. package/components/Dialog/utils.ts +22 -16
  50. package/components/Drawer/Collapsible/utils.ts +13 -13
  51. package/components/Drawer/Drawer.tsx +2 -3
  52. package/components/Drawer/DrawerContent.tsx +5 -3
  53. package/components/Drawer/DrawerFooter.tsx +5 -4
  54. package/components/Drawer/DrawerHeader.tsx +5 -4
  55. package/components/Drawer/DrawerItem.tsx +5 -3
  56. package/components/Drawer/DrawerItemGroup.tsx +5 -4
  57. package/components/Drawer/index.tsx +1 -5
  58. package/components/Drawer/utils.ts +7 -7
  59. package/components/ElementGroup/ElementGroup.tsx +16 -14
  60. package/components/ElementGroup/index.tsx +1 -5
  61. package/components/ElementGroup/utils.ts +5 -6
  62. package/components/FAB/index.tsx +1 -5
  63. package/components/FAB/utils.ts +3 -7
  64. package/components/FilePicker/index.tsx +1 -5
  65. package/components/FilePicker/utils.ts +5 -6
  66. package/components/HelperText/index.tsx +1 -5
  67. package/components/HelperText/utils.ts +5 -7
  68. package/components/HorizontalDivider/HorizontalDivider.tsx +5 -3
  69. package/components/HorizontalDivider/index.tsx +1 -5
  70. package/components/Icon/CrossFadeIcon.tsx +3 -5
  71. package/components/Icon/Icon.tsx +3 -14
  72. package/components/Icon/iconFactory.tsx +3 -3
  73. package/components/Icon/index.tsx +2 -6
  74. package/components/Icon/types.ts +17 -6
  75. package/components/IconButton/IconButton.tsx +45 -58
  76. package/components/IconButton/index.tsx +1 -5
  77. package/components/IconButton/utils.ts +15 -26
  78. package/components/If/index.tsx +1 -5
  79. package/components/InputAddon/index.tsx +1 -5
  80. package/components/InputAddon/utils.ts +5 -6
  81. package/components/Link/index.tsx +1 -5
  82. package/components/Link/utils.ts +7 -9
  83. package/components/ListItem/index.tsx +1 -5
  84. package/components/ListItem/utils.ts +13 -11
  85. package/components/LoadingIndicator/LoadingIndicator.tsx +253 -0
  86. package/components/LoadingIndicator/LoadingIndicator.web.tsx +136 -0
  87. package/components/LoadingIndicator/index.tsx +13 -0
  88. package/components/LoadingIndicator/utils.ts +117 -0
  89. package/components/Menu/index.tsx +1 -5
  90. package/components/Menu/utils.ts +6 -8
  91. package/components/Modal/index.tsx +1 -5
  92. package/components/Modal/utils.ts +2 -6
  93. package/components/NavigationRail/NavigationRailHeader.tsx +1 -1
  94. package/components/NavigationRail/NavigationRailItem.tsx +2 -1
  95. package/components/NavigationRail/index.tsx +1 -5
  96. package/components/NavigationRail/utils.ts +21 -17
  97. package/components/NavigationStack/index.tsx +1 -5
  98. package/components/NavigationStack/utils.tsx +7 -1
  99. package/components/Portal/index.tsx +1 -5
  100. package/components/RadioButton/index.ts +5 -10
  101. package/components/RadioButton/utils.ts +9 -8
  102. package/components/Rating/RatingItem.tsx +2 -1
  103. package/components/Rating/index.tsx +1 -5
  104. package/components/Rating/utils.ts +6 -8
  105. package/components/Select/Select.tsx +360 -501
  106. package/components/Select/index.ts +7 -14
  107. package/components/Select/types.ts +2 -4
  108. package/components/Select/utils.ts +215 -0
  109. package/components/Slot/Slot.tsx +244 -0
  110. package/components/Slot/compose-refs.tsx +60 -0
  111. package/components/Slot/index.tsx +8 -0
  112. package/components/StateLayer/index.tsx +1 -5
  113. package/components/StateLayer/utils.ts +5 -6
  114. package/components/Surface/Surface.android.tsx +34 -8
  115. package/components/Surface/Surface.ios.tsx +36 -29
  116. package/components/Surface/Surface.tsx +31 -4
  117. package/components/Surface/index.tsx +1 -5
  118. package/components/Surface/utils.ts +49 -36
  119. package/components/Switch/Switch.tsx +8 -2
  120. package/components/Switch/index.tsx +1 -5
  121. package/components/Switch/utils.ts +2 -6
  122. package/components/Tabs/Tabs.tsx +14 -13
  123. package/components/Tabs/index.tsx +1 -5
  124. package/components/Tabs/utils.ts +10 -10
  125. package/components/Text/Text.tsx +2 -8
  126. package/components/TextInput/TextInput.tsx +5 -4
  127. package/components/TextInput/index.tsx +1 -5
  128. package/components/TextInput/utils.ts +8 -15
  129. package/components/TextInputWithMask/index.tsx +1 -5
  130. package/components/TimePicker/AmPmSwitcher.tsx +1 -1
  131. package/components/TimePicker/index.tsx +1 -5
  132. package/components/TimePicker/utils.ts +29 -21
  133. package/components/TimePickerField/index.tsx +1 -5
  134. package/components/TimePickerField/utils.ts +5 -6
  135. package/components/TimePickerModal/TimePickerModal.tsx +6 -2
  136. package/components/TimePickerModal/index.tsx +1 -5
  137. package/components/TimePickerModal/utils.ts +5 -6
  138. package/components/Tooltip/TooltipTrigger.tsx +25 -16
  139. package/components/Tooltip/index.tsx +5 -9
  140. package/components/Tooltip/utils.ts +5 -6
  141. package/components/TouchableRipple/TouchableRipple.native.tsx +49 -13
  142. package/components/TouchableRipple/TouchableRipple.tsx +136 -46
  143. package/components/TouchableRipple/index.tsx +1 -5
  144. package/components/TouchableRipple/utils.ts +5 -6
  145. package/components/VerticalDivider/VerticalDivider.tsx +9 -8
  146. package/components/VerticalDivider/index.tsx +1 -5
  147. package/core/componentsRegistry.ts +31 -19
  148. package/hocs/withPortal.tsx +1 -1
  149. package/hooks/index.tsx +0 -1
  150. package/hooks/useControlledValue.tsx +20 -4
  151. package/hooks/useSubcomponents.tsx +56 -22
  152. package/hooks/useWhatHasUpdated.tsx +48 -0
  153. package/package.json +10 -13
  154. package/shortcuts-manager/ShortcutsManager/ShortcutsManager.tsx +5 -2
  155. package/shortcuts-manager/ShortcutsManager/utils.tsx +3 -2
  156. package/shortcuts-manager/useShortcut/index.tsx +1 -1
  157. package/shortcuts-manager/useShortcut/useShortcut.tsx +1 -1
  158. package/styles/shadow.ts +2 -1
  159. package/styles/themes/LightTheme.tsx +1 -1
  160. package/utils/extractPropertiesFromStyles.ts +25 -0
  161. package/utils/lodash.ts +77 -6
  162. package/utils/repository.ts +2 -52
  163. package/utils/tokenStylesParser.ts +3 -1
  164. package/hooks/useBreakpoints.tsx +0 -7
package/README.md ADDED
@@ -0,0 +1,87 @@
1
+ React Native Molecules
2
+ ================
3
+
4
+
5
+ <h3 align="center">
6
+ Material 3-powered primitives for React Native + Web.<br/>
7
+ <a href="https://molecules.taylordb.ai">Explore the docs</a>
8
+ </h3>
9
+
10
+ ---
11
+
12
+ [![Version][version-badge]][package] [![MIT License][license-badge]][license]
13
+
14
+ <p align="center"><i>React Native Molecules ships a comprehensive library of React Native + Web components powered by Material 3 tokens. Every component includes production-ready props, sensible defaults, and playground docs in the `/docs` site.</i></p>
15
+
16
+ Why React Native Molecules?
17
+ ---------------------
18
+
19
+ - High performance – built on top of `react-native-unistyles`, with CSS variables on the web.
20
+ - Modular & lightweight – no barrel files, self-registerable components, and optional peer deps.
21
+ - Fully customizable – swap internal implementations or override styles using your own tokens.
22
+ - Unified design – ships with Material 3 light/dark themes out-of-the-box.
23
+
24
+ Quick start
25
+ -----------
26
+
27
+ ```tsx
28
+ import { Button } from 'react-native-molecules/components/Button';
29
+
30
+ export function MyComponent() {
31
+ return <Button onPress={() => console.log('Pressed!')}>Click me</Button>;
32
+ }
33
+ ```
34
+
35
+ Installation overview
36
+ ---------------------
37
+
38
+ > Refer to `docs/docs/getting-started/installation.mdx` for the full walkthrough.
39
+
40
+ 1. **Prerequisites**
41
+ - React Native New Architecture (Fabric)
42
+ - React 19 or higher
43
+ 2. **Install the package**
44
+ ```bash
45
+ pnpm add react-native-molecules
46
+ ```
47
+ (npm and yarn examples are in the docs; pnpm is recommended for the monorepo.)
48
+ 3. **Add peer dependencies**
49
+ Required:
50
+ ```bash
51
+ pnpm add react-native-unistyles
52
+ ```
53
+ Optional per-component deps, e.g. `FilePicker` requires `@react-native-documents/picker`.
54
+ 4. **Configure fonts & icons (web)**
55
+ - Copy `MaterialDesignIcons.ttf` from `@react-native-vector-icons/material-design-icons/Fonts/` into your public assets.
56
+ - Register the font via `@font-face`.
57
+ 5. **Register Unistyles themes**
58
+ Set up `StyleSheet.configure` with provided MD3 light/dark themes and your breakpoints for typed theme access.
59
+ 6. **Wrap with `PortalProvider` (optional)**
60
+ Needed for components that render inside portals (e.g., `Popover`, `Tooltip`, `Menu`, `Modal`).
61
+
62
+ Next steps
63
+ ----------
64
+
65
+ 1. Read `docs/docs/getting-started/introduction.mdx` for an overview of the component catalog, hooks, and customization guides.
66
+ 2. Follow the Installation guide above to wire up peer dependencies, fonts, and theming.
67
+ 3. Explore the rest of the docs to dive into components, hooks, and utilities. Each entry includes prop tables, behavior notes, and playground examples.
68
+
69
+ Contributing
70
+ ------------
71
+
72
+ We welcome issues and pull requests. Please ensure any new component stories and docs accompany your changes so they appear in the React Native Molecules docs site.
73
+
74
+ [build-badge]: https://github.com/webbeetechnologies/react-native-molecules/actions/workflows/lint.yml/badge.svg
75
+ [build]: https://github.com/webbeetechnologies/react-native-molecules/actions/workflows/lint.yml
76
+ [version-badge]: https://img.shields.io/npm/v/react-native-molecules.svg
77
+ [package]: https://www.npmjs.com/package/react-native-molecules
78
+ [license-badge]: https://img.shields.io/badge/license-MIT-green.svg
79
+ [license]: https://github.com/webbeetechnologies/react-native-molecules/blob/main/LICENSE
80
+ [all-contributors-badge]: https://img.shields.io/badge/all_contributors-7-orange.svg?style=flat-square
81
+ [all-contributors]: #contributors
82
+ [prs-welcome-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg
83
+ [prs-welcome]: https://github.com/webbeetechnologies/react-native-molecules/issues
84
+ [chat-badge]: https://img.shields.io/badge/chat-Discussions-5865F2.svg
85
+ [chat]: https://github.com/webbeetechnologies/react-native-molecules/discussions
86
+ [taylordb-badge]: https://img.shields.io/badge/sponsored%20by-TaylorDB-000000.svg
87
+ [taylordb]: https://taylordb.com/
@@ -2,13 +2,14 @@ import {
2
2
  createContext,
3
3
  forwardRef,
4
4
  memo,
5
- ReactElement,
6
- ReactNode,
5
+ type ReactElement,
6
+ type ReactNode,
7
7
  useContext,
8
8
  useEffect,
9
9
  useMemo,
10
10
  } from 'react';
11
11
  import { View, type ViewProps } from 'react-native';
12
+
12
13
  import { useControlledValue, useSubcomponents } from '../../hooks';
13
14
  import type { WithElements } from '../../types';
14
15
  import { AccordionContext } from './Accordion';
@@ -1,5 +1,6 @@
1
1
  import { memo } from 'react';
2
2
  import { View, type ViewProps } from 'react-native';
3
+
3
4
  import { accordionItemContentStyles } from './utils';
4
5
 
5
6
  export type Props = ViewProps & {};
@@ -1,12 +1,13 @@
1
- import { forwardRef, memo, ReactNode, useCallback, useContext, useMemo } from 'react';
1
+ import { forwardRef, memo, type ReactNode, useCallback, useContext, useMemo } from 'react';
2
+ import { type GestureResponderEvent, type TextStyle, View, type ViewStyle } from 'react-native';
3
+
4
+ import { useActionState } from '../../hooks';
2
5
  import type { WithElements } from '../../types';
6
+ import { resolveStateVariant } from '../../utils';
7
+ import { Text } from '../Text';
3
8
  import { TouchableRipple, type TouchableRippleProps } from '../TouchableRipple';
4
9
  import { AccordionItemContext } from './AccordionItem';
5
- import { View, type GestureResponderEvent, type TextStyle, type ViewStyle } from 'react-native';
6
- import { Text } from '../Text';
7
10
  import { accordionItemHeaderStyles } from './utils';
8
- import { resolveStateVariant } from '../../utils';
9
- import { useActionState } from '../../hooks';
10
11
 
11
12
  export type AccordionHeaderElementProps = {
12
13
  color: string;
@@ -1,19 +1,14 @@
1
+ import { getRegisteredComponentWithFallback } from '../../core';
2
+ import AccordionDefault from './Accordion';
1
3
  import AccordionItemComponent from './AccordionItem';
2
- import AccordionItemHeader from './AccordionItemHeader';
3
4
  import AccordionItemContent from './AccordionItemContent';
4
- import AccordionDefault from './Accordion';
5
- import { getRegisteredComponentWithFallback, registerMoleculesComponents } from '../../core';
5
+ import AccordionItemHeader from './AccordionItemHeader';
6
6
 
7
7
  const AccordionItemDefault = Object.assign(AccordionItemComponent, {
8
8
  Header: AccordionItemHeader,
9
9
  Content: AccordionItemContent,
10
10
  });
11
11
 
12
- registerMoleculesComponents({
13
- Accordion: AccordionDefault,
14
- AccordionItem: AccordionItemDefault,
15
- });
16
-
17
12
  export const Accordion = getRegisteredComponentWithFallback('Accordion', AccordionDefault);
18
13
  export const AccordionItem = getRegisteredComponentWithFallback(
19
14
  'AccordionItem',
@@ -22,15 +17,14 @@ export const AccordionItem = getRegisteredComponentWithFallback(
22
17
 
23
18
  export type { Props as AccordionProps } from './Accordion';
24
19
  export type { Props as AccordionItemProps } from './AccordionItem';
20
+ export type { Props as AccordionItemContentProps } from './AccordionItemContent';
25
21
  export type {
26
- Props as AccordionItemHeaderProps,
27
22
  AccordionHeaderElementProps,
23
+ Props as AccordionItemHeaderProps,
28
24
  } from './AccordionItemHeader';
29
- export type { Props as AccordionItemContentProps } from './AccordionItemContent';
30
-
31
25
  export {
32
- accordionStyles,
33
- accordionItemStyles,
34
- accordionItemHeaderStyles,
35
26
  accordionItemContentStyles,
27
+ accordionItemHeaderStyles,
28
+ accordionItemStyles,
29
+ accordionStyles,
36
30
  } from './utils';
@@ -1,6 +1,6 @@
1
1
  import { StyleSheet } from 'react-native-unistyles';
2
2
 
3
- import { getRegisteredMoleculesComponentStyles, registerComponentsStyles } from '../../core';
3
+ import { getRegisteredComponentStylesWithFallback } from '../../core';
4
4
 
5
5
  const accordionStylesDefault = StyleSheet.create({
6
6
  root: {},
@@ -47,16 +47,19 @@ const accordionItemContentStylesDefault = StyleSheet.create(theme => ({
47
47
  },
48
48
  }));
49
49
 
50
- registerComponentsStyles({
51
- Accordion: accordionStylesDefault,
52
- AccordionItem: accordionItemStylesDefault,
53
- AccordionItem_Header: accordionItemHeaderStylesDefault,
54
- AccordionItem_Content: accordionItemContentStylesDefault,
55
- });
56
-
57
- export const accordionStyles = getRegisteredMoleculesComponentStyles('Accordion');
58
- export const accordionItemStyles = getRegisteredMoleculesComponentStyles('AccordionItem');
59
- export const accordionItemHeaderStyles =
60
- getRegisteredMoleculesComponentStyles('AccordionItem_Header');
61
- export const accordionItemContentStyles =
62
- getRegisteredMoleculesComponentStyles('AccordionItem_Content');
50
+ export const accordionStyles = getRegisteredComponentStylesWithFallback(
51
+ 'Accordion',
52
+ accordionStylesDefault,
53
+ );
54
+ export const accordionItemStyles = getRegisteredComponentStylesWithFallback(
55
+ 'AccordionItem',
56
+ accordionItemStylesDefault,
57
+ );
58
+ export const accordionItemHeaderStyles = getRegisteredComponentStylesWithFallback(
59
+ 'AccordionItem_Header',
60
+ accordionItemHeaderStylesDefault,
61
+ );
62
+ export const accordionItemContentStyles = getRegisteredComponentStylesWithFallback(
63
+ 'AccordionItem_Content',
64
+ accordionItemContentStylesDefault,
65
+ );
@@ -1,25 +1,17 @@
1
1
  import { memo, useCallback, useEffect, useMemo, useRef } from 'react';
2
- import {
3
- type ActivityIndicatorProps,
4
- Animated,
5
- Easing,
6
- Platform,
7
- View,
8
- type ViewStyle,
9
- } from 'react-native';
2
+ import { type ActivityIndicatorProps, Animated, Easing, Platform, View } from 'react-native';
10
3
  import { StyleSheet } from 'react-native-unistyles';
11
4
 
12
- import { getRegisteredMoleculesComponentStyles, registerComponentStyles } from '../../core';
5
+ import { getRegisteredComponentStylesWithFallback } from '../../core';
13
6
  import AnimatedSpinner from './AnimatedSpinner';
14
7
 
15
- export type Props = ActivityIndicatorProps & {
8
+ export type Props = Omit<ActivityIndicatorProps, 'color'> & {
16
9
  /**
17
10
  * Whether to show the indicator or hide it.
18
11
  */
19
12
  animating?: boolean;
20
13
  /**
21
14
  * The color of the spinner.
22
- */
23
15
  color?: string;
24
16
  /**
25
17
  * Size of the indicator.
@@ -29,7 +21,7 @@ export type Props = ActivityIndicatorProps & {
29
21
  * Whether the indicator should hide when not animating.
30
22
  */
31
23
  hidesWhenStopped?: boolean;
32
- style?: ViewStyle;
24
+ color?: string;
33
25
  };
34
26
 
35
27
  const DURATION = 2400;
@@ -63,7 +55,7 @@ const mapIndicatorSize = (indicatorSize: 'small' | 'large' | number | undefined)
63
55
  */
64
56
  const ActivityIndicator = ({
65
57
  animating = true,
66
- color: indicatorColorProp,
58
+ color,
67
59
  hidesWhenStopped = true,
68
60
  size: indicatorSize = 'small',
69
61
  style: styleProp,
@@ -83,13 +75,12 @@ const ActivityIndicator = ({
83
75
 
84
76
  const size = mapIndicatorSize(indicatorSize);
85
77
 
86
- const { color, viewStyle, animatedViewStyle } = useMemo(() => {
78
+ const { viewStyle, animatedViewStyle } = useMemo(() => {
87
79
  return {
88
- color: indicatorColorProp,
89
80
  viewStyle: [componentStyles.container, styleProp],
90
81
  animatedViewStyle: [{ width: size, height: size, opacity: fade }],
91
82
  };
92
- }, [componentStyles.container, fade, indicatorColorProp, size, styleProp]);
83
+ }, [componentStyles.container, fade, size, styleProp]);
93
84
 
94
85
  const startRotation = useCallback(() => {
95
86
  // Show indicator
@@ -161,7 +152,7 @@ const ActivityIndicator = ({
161
152
  return (
162
153
  <AnimatedSpinner
163
154
  key={index}
164
- style={componentStyles.root}
155
+ style={componentStyles.layer}
165
156
  index={index}
166
157
  size={size}
167
158
  color={color}
@@ -193,8 +184,9 @@ export const activityIndicatorStylesDefault = StyleSheet.create(theme => ({
193
184
  },
194
185
  }));
195
186
 
196
- registerComponentStyles('ActivityIndicator', activityIndicatorStylesDefault);
197
-
198
- export const activityIndicatorStyles = getRegisteredMoleculesComponentStyles('ActivityIndicator');
187
+ export const activityIndicatorStyles = getRegisteredComponentStylesWithFallback(
188
+ 'ActivityIndicator',
189
+ activityIndicatorStylesDefault,
190
+ );
199
191
 
200
192
  export default memo(ActivityIndicator);
@@ -1,10 +1,6 @@
1
- import { getRegisteredComponentWithFallback, registerMoleculesComponents } from '../../core';
1
+ import { getRegisteredComponentWithFallback } from '../../core';
2
2
  import ActivityIndicatorDefault from './ActivityIndicator';
3
3
 
4
- registerMoleculesComponents({
5
- ActivityIndicator: ActivityIndicatorDefault,
6
- });
7
-
8
4
  export const ActivityIndicator = getRegisteredComponentWithFallback(
9
5
  'ActivityIndicator',
10
6
  ActivityIndicatorDefault,
@@ -1,6 +1,6 @@
1
1
  import type { ComponentType } from 'react';
2
2
 
3
- import { getRegisteredComponentWithFallback, registerMoleculesComponents } from '../../core';
3
+ import { getRegisteredComponentWithFallback } from '../../core';
4
4
  import AppbarActions from './AppbarActions';
5
5
  import AppbarBase from './AppbarBase';
6
6
  import AppbarCenterAligned from './AppbarCenterAligned';
@@ -23,9 +23,6 @@ export const AppbarDefault = Object.assign(AppbarBase as ComponentType<AppbarPro
23
23
  Title: AppbarTitle,
24
24
  Actions: AppbarActions,
25
25
  });
26
- registerMoleculesComponents({
27
- Appbar: AppbarDefault,
28
- });
29
26
 
30
27
  export const Appbar = getRegisteredComponentWithFallback('Appbar', AppbarDefault);
31
28
 
@@ -1,6 +1,6 @@
1
1
  import { StyleSheet } from 'react-native-unistyles';
2
2
 
3
- import { getRegisteredMoleculesComponentStyles, registerComponentsStyles } from '../../core';
3
+ import { getRegisteredComponentStylesWithFallback } from '../../core';
4
4
 
5
5
  const appbarBaseStylesDefault = StyleSheet.create(theme => ({
6
6
  root: {
@@ -105,23 +105,35 @@ const appbarLeftDefault = StyleSheet.create(theme => ({
105
105
  },
106
106
  }));
107
107
 
108
- registerComponentsStyles({
109
- Appbar: appbarBaseStylesDefault,
110
- Appbar_CenterAligned: appbarCenterAlignedStylesDefault,
111
- Appbar_Small: appbarSmallStylesDefault,
112
- Appbar_Medium: appbarMediumStylesDefault,
113
- Appbar_Large: appbarLargeStylesDefault,
114
- Appbar_Left: appbarLeftDefault,
115
- Appbar_Right: appbarRightDefault,
116
- Appbar_Title: appbarTitleDefault,
117
- });
118
-
119
- export const appbarBaseStyles = getRegisteredMoleculesComponentStyles('Appbar');
120
- export const appbarCenterAlignedStyles =
121
- getRegisteredMoleculesComponentStyles('Appbar_CenterAligned');
122
- export const appbarSmallStyles = getRegisteredMoleculesComponentStyles('Appbar_Small');
123
- export const appbarMediumStyles = getRegisteredMoleculesComponentStyles('Appbar_Medium');
124
- export const appbarLargeStyles = getRegisteredMoleculesComponentStyles('Appbar_Large');
125
- export const appbarTitle = getRegisteredMoleculesComponentStyles('Appbar_Title');
126
- export const appbarRight = getRegisteredMoleculesComponentStyles('Appbar_Right');
127
- export const appbarLeft = getRegisteredMoleculesComponentStyles('Appbar_Left');
108
+ export const appbarBaseStyles = getRegisteredComponentStylesWithFallback(
109
+ 'Appbar',
110
+ appbarBaseStylesDefault,
111
+ );
112
+ export const appbarCenterAlignedStyles = getRegisteredComponentStylesWithFallback(
113
+ 'Appbar_CenterAligned',
114
+ appbarCenterAlignedStylesDefault,
115
+ );
116
+ export const appbarSmallStyles = getRegisteredComponentStylesWithFallback(
117
+ 'Appbar_Small',
118
+ appbarSmallStylesDefault,
119
+ );
120
+ export const appbarMediumStyles = getRegisteredComponentStylesWithFallback(
121
+ 'Appbar_Medium',
122
+ appbarMediumStylesDefault,
123
+ );
124
+ export const appbarLargeStyles = getRegisteredComponentStylesWithFallback(
125
+ 'Appbar_Large',
126
+ appbarLargeStylesDefault,
127
+ );
128
+ export const appbarTitle = getRegisteredComponentStylesWithFallback(
129
+ 'Appbar_Title',
130
+ appbarTitleDefault,
131
+ );
132
+ export const appbarRight = getRegisteredComponentStylesWithFallback(
133
+ 'Appbar_Right',
134
+ appbarRightDefault,
135
+ );
136
+ export const appbarLeft = getRegisteredComponentStylesWithFallback(
137
+ 'Appbar_Left',
138
+ appbarLeftDefault,
139
+ );
@@ -1,10 +1,6 @@
1
- import { getRegisteredComponentWithFallback, registerMoleculesComponents } from '../../core';
1
+ import { getRegisteredComponentWithFallback } from '../../core';
2
2
  import AvatarDefault from './Avatar';
3
3
 
4
- registerMoleculesComponents({
5
- Avatar: AvatarDefault,
6
- });
7
-
8
4
  export const Avatar = getRegisteredComponentWithFallback('Avatar', AvatarDefault);
9
5
 
10
6
  export type { Props as AvatarProps } from './Avatar';
@@ -1,6 +1,6 @@
1
1
  import { StyleSheet } from 'react-native-unistyles';
2
2
 
3
- import { getRegisteredMoleculesComponentStyles, registerComponentsStyles } from '../../core';
3
+ import { getRegisteredComponentStylesWithFallback } from '../../core';
4
4
 
5
5
  const avatarStylesDefault = StyleSheet.create(theme => ({
6
6
  root: {
@@ -28,8 +28,4 @@ const avatarStylesDefault = StyleSheet.create(theme => ({
28
28
  },
29
29
  }));
30
30
 
31
- registerComponentsStyles({
32
- Avatar: avatarStylesDefault,
33
- });
34
-
35
- export const avatarStyles = getRegisteredMoleculesComponentStyles('Avatar');
31
+ export const avatarStyles = getRegisteredComponentStylesWithFallback('Avatar', avatarStylesDefault);
@@ -1,5 +1,5 @@
1
1
  import { memo } from 'react';
2
- import { Pressable } from 'react-native';
2
+ import { Pressable, type ViewStyle } from 'react-native';
3
3
 
4
4
  import type { BackdropProps } from './types';
5
5
  import { backdropStyles } from './utils';
@@ -10,7 +10,7 @@ const Backdrop = ({ style, ...rest }: BackdropProps) => {
10
10
  accessible={false}
11
11
  importantForAccessibility="no"
12
12
  {...rest}
13
- style={[backdropStyles.root, style]}
13
+ style={[backdropStyles.root, style as ViewStyle]}
14
14
  />
15
15
  );
16
16
  };
@@ -1,10 +1,6 @@
1
- import { getRegisteredComponentWithFallback, registerMoleculesComponents } from '../../core';
1
+ import { getRegisteredComponentWithFallback } from '../../core';
2
2
  import BackdropDefault from './Backdrop';
3
3
 
4
- registerMoleculesComponents({
5
- Backdrop: BackdropDefault,
6
- });
7
-
8
4
  export const Backdrop = getRegisteredComponentWithFallback('Backdrop', BackdropDefault);
9
5
 
10
6
  export type { BackdropProps } from './types';
@@ -1,6 +1,6 @@
1
1
  import { StyleSheet } from 'react-native-unistyles';
2
2
 
3
- import { getRegisteredMoleculesComponentStyles, registerComponentsStyles } from '../../core';
3
+ import { getRegisteredComponentStylesWithFallback } from '../../core';
4
4
 
5
5
  const backdropStylesDefault = StyleSheet.create({
6
6
  root: {
@@ -14,8 +14,7 @@ const backdropStylesDefault = StyleSheet.create({
14
14
  },
15
15
  });
16
16
 
17
- registerComponentsStyles({
18
- Backdrop: backdropStylesDefault,
19
- });
20
-
21
- export const backdropStyles = getRegisteredMoleculesComponentStyles('Backdrop');
17
+ export const backdropStyles = getRegisteredComponentStylesWithFallback(
18
+ 'Backdrop',
19
+ backdropStylesDefault,
20
+ );
@@ -1,10 +1,6 @@
1
- import { getRegisteredComponentWithFallback, registerMoleculesComponents } from '../../core';
1
+ import { getRegisteredComponentWithFallback } from '../../core';
2
2
  import BadgeDefault from './Badge';
3
3
 
4
- registerMoleculesComponents({
5
- Badge: BadgeDefault,
6
- });
7
-
8
4
  export const Badge = getRegisteredComponentWithFallback('Badge', BadgeDefault);
9
5
 
10
6
  export type { Props as BadgeProps } from './Badge';
@@ -1,6 +1,6 @@
1
1
  import { StyleSheet } from 'react-native-unistyles';
2
2
 
3
- import { getRegisteredMoleculesComponentStyles, registerComponentsStyles } from '../../core';
3
+ import { getRegisteredComponentStylesWithFallback } from '../../core';
4
4
 
5
5
  const badgeStylesDefault = StyleSheet.create(theme => ({
6
6
  root: {
@@ -31,8 +31,4 @@ const badgeStylesDefault = StyleSheet.create(theme => ({
31
31
  },
32
32
  }));
33
33
 
34
- registerComponentsStyles({
35
- Badge: badgeStylesDefault,
36
- });
37
-
38
- export const badgeStyles = getRegisteredMoleculesComponentStyles('Badge');
34
+ export const badgeStyles = getRegisteredComponentStylesWithFallback('Badge', badgeStylesDefault);