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

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 (131) 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 +6 -5
  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 +3 -1
  19. package/components/Button/index.tsx +1 -5
  20. package/components/Button/utils.ts +5 -8
  21. package/components/Card/Card.tsx +8 -4
  22. package/components/Card/CardContent.tsx +5 -4
  23. package/components/Card/CardHeader.tsx +5 -3
  24. package/components/Card/CardMedia.tsx +5 -3
  25. package/components/Card/CardTypography.tsx +5 -3
  26. package/components/Card/index.tsx +1 -5
  27. package/components/Card/utils.ts +5 -6
  28. package/components/Checkbox/Checkbox.tsx +1 -0
  29. package/components/Checkbox/CheckboxBase.ios.tsx +1 -0
  30. package/components/Checkbox/CheckboxBase.tsx +1 -0
  31. package/components/Checkbox/index.tsx +1 -5
  32. package/components/Checkbox/utils.ts +6 -6
  33. package/components/Chip/index.tsx +1 -5
  34. package/components/Chip/utils.ts +2 -6
  35. package/components/DatePickerDocked/index.tsx +1 -5
  36. package/components/DatePickerDocked/utils.ts +21 -19
  37. package/components/DatePickerInline/index.tsx +1 -5
  38. package/components/DatePickerInline/utils.ts +41 -28
  39. package/components/DatePickerInput/index.tsx +2 -6
  40. package/components/DatePickerInput/utils.ts +5 -6
  41. package/components/DatePickerModal/index.tsx +1 -5
  42. package/components/DatePickerModal/utils.ts +17 -16
  43. package/components/DateTimePicker/index.tsx +1 -5
  44. package/components/DateTimePicker/utils.ts +5 -6
  45. package/components/Dialog/index.tsx +1 -5
  46. package/components/Dialog/utils.ts +22 -16
  47. package/components/Drawer/Collapsible/utils.ts +13 -13
  48. package/components/Drawer/Drawer.tsx +2 -3
  49. package/components/Drawer/DrawerContent.tsx +5 -3
  50. package/components/Drawer/DrawerFooter.tsx +5 -4
  51. package/components/Drawer/DrawerHeader.tsx +5 -4
  52. package/components/Drawer/DrawerItem.tsx +5 -3
  53. package/components/Drawer/DrawerItemGroup.tsx +5 -4
  54. package/components/Drawer/index.tsx +1 -5
  55. package/components/Drawer/utils.ts +7 -7
  56. package/components/ElementGroup/index.tsx +1 -5
  57. package/components/ElementGroup/utils.ts +5 -6
  58. package/components/FAB/index.tsx +1 -5
  59. package/components/FAB/utils.ts +3 -7
  60. package/components/FilePicker/index.tsx +1 -5
  61. package/components/FilePicker/utils.ts +5 -6
  62. package/components/HelperText/index.tsx +1 -5
  63. package/components/HelperText/utils.ts +5 -7
  64. package/components/HorizontalDivider/HorizontalDivider.tsx +5 -3
  65. package/components/HorizontalDivider/index.tsx +1 -5
  66. package/components/Icon/CrossFadeIcon.tsx +3 -5
  67. package/components/Icon/Icon.tsx +3 -14
  68. package/components/Icon/index.tsx +1 -5
  69. package/components/IconButton/IconButton.tsx +3 -1
  70. package/components/IconButton/index.tsx +1 -5
  71. package/components/IconButton/utils.ts +11 -16
  72. package/components/If/index.tsx +1 -5
  73. package/components/InputAddon/index.tsx +1 -5
  74. package/components/InputAddon/utils.ts +5 -6
  75. package/components/Link/index.tsx +1 -5
  76. package/components/Link/utils.ts +7 -9
  77. package/components/ListItem/index.tsx +1 -5
  78. package/components/ListItem/utils.ts +13 -11
  79. package/components/Menu/index.tsx +1 -5
  80. package/components/Menu/utils.ts +6 -8
  81. package/components/Modal/index.tsx +1 -5
  82. package/components/Modal/utils.ts +2 -6
  83. package/components/NavigationRail/NavigationRailHeader.tsx +1 -1
  84. package/components/NavigationRail/NavigationRailItem.tsx +2 -1
  85. package/components/NavigationRail/index.tsx +1 -5
  86. package/components/NavigationRail/utils.ts +21 -17
  87. package/components/NavigationStack/index.tsx +1 -5
  88. package/components/NavigationStack/utils.tsx +7 -1
  89. package/components/Portal/index.tsx +1 -5
  90. package/components/RadioButton/index.ts +5 -10
  91. package/components/RadioButton/utils.ts +9 -8
  92. package/components/Rating/RatingItem.tsx +2 -1
  93. package/components/Rating/index.tsx +1 -5
  94. package/components/Rating/utils.ts +6 -8
  95. package/components/StateLayer/index.tsx +1 -5
  96. package/components/StateLayer/utils.ts +5 -6
  97. package/components/Surface/index.tsx +1 -5
  98. package/components/Surface/utils.ts +5 -6
  99. package/components/Switch/index.tsx +1 -5
  100. package/components/Switch/utils.ts +2 -6
  101. package/components/Tabs/Tabs.tsx +14 -13
  102. package/components/Tabs/index.tsx +1 -5
  103. package/components/Tabs/utils.ts +10 -10
  104. package/components/Text/Text.tsx +2 -8
  105. package/components/TextInput/TextInput.tsx +1 -0
  106. package/components/TextInput/index.tsx +1 -5
  107. package/components/TextInput/utils.ts +8 -15
  108. package/components/TextInputWithMask/index.tsx +1 -5
  109. package/components/TimePicker/AmPmSwitcher.tsx +1 -1
  110. package/components/TimePicker/index.tsx +1 -5
  111. package/components/TimePicker/utils.ts +29 -21
  112. package/components/TimePickerField/index.tsx +1 -5
  113. package/components/TimePickerField/utils.ts +5 -6
  114. package/components/TimePickerModal/index.tsx +1 -5
  115. package/components/TimePickerModal/utils.ts +5 -6
  116. package/components/Tooltip/index.tsx +5 -9
  117. package/components/Tooltip/utils.ts +5 -6
  118. package/components/TouchableRipple/index.tsx +1 -5
  119. package/components/TouchableRipple/utils.ts +5 -6
  120. package/components/VerticalDivider/VerticalDivider.tsx +9 -8
  121. package/components/VerticalDivider/index.tsx +1 -5
  122. package/core/componentsRegistry.ts +31 -19
  123. package/hooks/index.tsx +0 -1
  124. package/package.json +1 -3
  125. package/shortcuts-manager/ShortcutsManager/utils.tsx +3 -2
  126. package/shortcuts-manager/useShortcut/index.tsx +1 -1
  127. package/shortcuts-manager/useShortcut/useShortcut.tsx +1 -1
  128. package/utils/lodash.ts +0 -1
  129. package/utils/repository.ts +2 -52
  130. package/utils/tokenStylesParser.ts +3 -1
  131. 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://github.com/webbeetechnologies/react-native-molecules/tree/main/docs">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
+ );
@@ -9,7 +9,7 @@ import {
9
9
  } from 'react-native';
10
10
  import { StyleSheet } from 'react-native-unistyles';
11
11
 
12
- import { getRegisteredMoleculesComponentStyles, registerComponentStyles } from '../../core';
12
+ import { getRegisteredComponentStylesWithFallback } from '../../core';
13
13
  import AnimatedSpinner from './AnimatedSpinner';
14
14
 
15
15
  export type Props = ActivityIndicatorProps & {
@@ -161,7 +161,7 @@ const ActivityIndicator = ({
161
161
  return (
162
162
  <AnimatedSpinner
163
163
  key={index}
164
- style={componentStyles.root}
164
+ style={componentStyles.layer}
165
165
  index={index}
166
166
  size={size}
167
167
  color={color}
@@ -193,8 +193,9 @@ export const activityIndicatorStylesDefault = StyleSheet.create(theme => ({
193
193
  },
194
194
  }));
195
195
 
196
- registerComponentStyles('ActivityIndicator', activityIndicatorStylesDefault);
197
-
198
- export const activityIndicatorStyles = getRegisteredMoleculesComponentStyles('ActivityIndicator');
196
+ export const activityIndicatorStyles = getRegisteredComponentStylesWithFallback(
197
+ 'ActivityIndicator',
198
+ activityIndicatorStylesDefault,
199
+ );
199
200
 
200
201
  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);
@@ -166,7 +166,8 @@ const Button = (
166
166
 
167
167
  defaultStyles.useVariants({
168
168
  variant,
169
- state,
169
+ // @ts-ignore // TODO - fix this
170
+ state: state as any,
170
171
  size,
171
172
  });
172
173
 
@@ -248,6 +249,7 @@ const Button = (
248
249
  ],
249
250
  iconContainerStyle: [defaultStyles.iconContainer, iconContainerStyleProp],
250
251
  textStyle: [
252
+ // @ts-ignore // TODO - fix this
251
253
  isVariant('text') ? (iconName || loading ? labelTextAddons : labelText) : label,
252
254
  textRelatedStyle,
253
255
  labelStyle,
@@ -1,10 +1,6 @@
1
- import { getRegisteredComponentWithFallback, registerMoleculesComponents } from '../../core';
1
+ import { getRegisteredComponentWithFallback } from '../../core';
2
2
  import ButtonDefault from './Button';
3
3
 
4
- registerMoleculesComponents({
5
- Button: ButtonDefault,
6
- });
7
-
8
4
  export const Button = getRegisteredComponentWithFallback('Button', ButtonDefault);
9
5
 
10
6
  export type { Props as ButtonProps } from './Button';
@@ -1,7 +1,7 @@
1
1
  import { Platform } from 'react-native';
2
2
  import { StyleSheet } from 'react-native-unistyles';
3
3
 
4
- import { getRegisteredMoleculesComponentStyles, registerComponentsStyles } from '../../core';
4
+ import { getRegisteredComponentStylesWithFallback } from '../../core';
5
5
 
6
6
  export const sizeToIconSizeMap = {
7
7
  xs: 18,
@@ -13,8 +13,6 @@ export const sizeToIconSizeMap = {
13
13
  const defaultStylesDefault = StyleSheet.create(theme => {
14
14
  return {
15
15
  root: {
16
- flexGrow: 1,
17
-
18
16
  variants: {
19
17
  size: {
20
18
  sm: {
@@ -409,8 +407,7 @@ const defaultStylesDefault = StyleSheet.create(theme => {
409
407
  };
410
408
  });
411
409
 
412
- registerComponentsStyles({
413
- Button: defaultStylesDefault,
414
- });
415
-
416
- export const defaultStyles = getRegisteredMoleculesComponentStyles('Button');
410
+ export const defaultStyles = getRegisteredComponentStylesWithFallback(
411
+ 'Button',
412
+ defaultStylesDefault,
413
+ );
@@ -2,7 +2,7 @@ import { forwardRef, memo, useMemo } from 'react';
2
2
  import type { ViewStyle } from 'react-native';
3
3
  import { StyleSheet } from 'react-native-unistyles';
4
4
 
5
- import { getRegisteredMoleculesComponentStyles, registerComponentStyles } from '../../core';
5
+ import { getRegisteredComponentStylesWithFallback } from '../../core';
6
6
  import { useActionState } from '../../hooks';
7
7
  import type { MD3Elevation } from '../../types/theme';
8
8
  import { resolveStateVariant } from '../../utils';
@@ -41,7 +41,7 @@ const Card = (
41
41
 
42
42
  cardStyles.useVariants({
43
43
  variant,
44
- state,
44
+ state: state as 'disabled' | 'hovered' | 'pressed',
45
45
  });
46
46
 
47
47
  const elevationLevel = variant === 'elevated' ? (hovered ? 2 : 1) : hovered ? 1 : 0;
@@ -84,6 +84,11 @@ const cardStylesDefault = StyleSheet.create(theme => ({
84
84
  outlined: {},
85
85
  undefined: {},
86
86
  },
87
+ state: {
88
+ disabled: {},
89
+ hovered: {},
90
+ pressed: {},
91
+ },
87
92
  },
88
93
  compoundVariants: [
89
94
  {
@@ -154,7 +159,6 @@ const cardStylesDefault = StyleSheet.create(theme => ({
154
159
  },
155
160
  }));
156
161
 
157
- registerComponentStyles('Card', cardStylesDefault);
158
- export const cardStyles = getRegisteredMoleculesComponentStyles('Card');
162
+ export const cardStyles = getRegisteredComponentStylesWithFallback('Card', cardStylesDefault);
159
163
 
160
164
  export default memo(forwardRef(Card));
@@ -2,7 +2,7 @@ import { forwardRef, memo, type ReactNode } from 'react';
2
2
  import { View, type ViewProps } from 'react-native';
3
3
  import { StyleSheet } from 'react-native-unistyles';
4
4
 
5
- import { getRegisteredMoleculesComponentStyles, registerComponentStyles } from '../../core';
5
+ import { getRegisteredComponentStylesWithFallback } from '../../core';
6
6
 
7
7
  export type Props = ViewProps & {
8
8
  children: ReactNode | ReactNode[];
@@ -22,8 +22,9 @@ const cardContentStylesDefault = StyleSheet.create(theme => ({
22
22
  },
23
23
  }));
24
24
 
25
- registerComponentStyles('Card_Content', cardContentStylesDefault);
26
-
27
- export const cardContentStyles = getRegisteredMoleculesComponentStyles('Card_Content');
25
+ export const cardContentStyles = getRegisteredComponentStylesWithFallback(
26
+ 'Card_Content',
27
+ cardContentStylesDefault,
28
+ );
28
29
 
29
30
  export default CardContent;
@@ -2,7 +2,7 @@ import { forwardRef, memo, type ReactNode } from 'react';
2
2
  import { View, type ViewProps } from 'react-native';
3
3
  import { StyleSheet } from 'react-native-unistyles';
4
4
 
5
- import { getRegisteredMoleculesComponentStyles, registerComponentStyles } from '../../core';
5
+ import { getRegisteredComponentStylesWithFallback } from '../../core';
6
6
 
7
7
  export type Props = ViewProps & {
8
8
  children: ReactNode | ReactNode[];
@@ -25,7 +25,9 @@ const cardHeaderStylesDefault = StyleSheet.create(theme => ({
25
25
  justifyContent: 'space-between',
26
26
  },
27
27
  }));
28
- registerComponentStyles('Card_Header', cardHeaderStylesDefault);
29
- export const cardHeaderStyles = getRegisteredMoleculesComponentStyles('Card_Header');
28
+ export const cardHeaderStyles = getRegisteredComponentStylesWithFallback(
29
+ 'Card_Header',
30
+ cardHeaderStylesDefault,
31
+ );
30
32
 
31
33
  export default CardHeader;
@@ -2,7 +2,7 @@ import { forwardRef, memo, type ReactNode } from 'react';
2
2
  import { type StyleProp, View, type ViewProps, type ViewStyle } from 'react-native';
3
3
  import { StyleSheet } from 'react-native-unistyles';
4
4
 
5
- import { getRegisteredMoleculesComponentStyles, registerComponentStyles } from '../../core';
5
+ import { getRegisteredComponentStylesWithFallback } from '../../core';
6
6
 
7
7
  export type Props = ViewProps & {
8
8
  style?: StyleProp<ViewStyle>;
@@ -28,8 +28,10 @@ const cardMediaStylesDefault = StyleSheet.create(theme => ({
28
28
  },
29
29
  }));
30
30
 
31
- registerComponentStyles('Card_Media', cardMediaStylesDefault);
32
- export const cardMediaStyles = getRegisteredMoleculesComponentStyles('Card_Media');
31
+ export const cardMediaStyles = getRegisteredComponentStylesWithFallback(
32
+ 'Card_Media',
33
+ cardMediaStylesDefault,
34
+ );
33
35
 
34
36
  CardMedia.displayName = 'Card_Media';
35
37
 
@@ -2,7 +2,7 @@ import { forwardRef, memo } from 'react';
2
2
  import { type TextProps } from 'react-native';
3
3
  import { StyleSheet } from 'react-native-unistyles';
4
4
 
5
- import { getRegisteredMoleculesComponentStyles, registerComponentStyles } from '../../core';
5
+ import { getRegisteredComponentStylesWithFallback } from '../../core';
6
6
  import { Text } from '../Text';
7
7
 
8
8
  export type Props = TextProps & {
@@ -107,7 +107,9 @@ const cardTypograhyStylesDefault = StyleSheet.create(theme => ({
107
107
  },
108
108
  }));
109
109
 
110
- registerComponentStyles('Card_Typography', cardTypograhyStylesDefault);
111
- export const cardTypograhyStyles = getRegisteredMoleculesComponentStyles('Card_Typography');
110
+ export const cardTypograhyStyles = getRegisteredComponentStylesWithFallback(
111
+ 'Card_Typography',
112
+ cardTypograhyStylesDefault,
113
+ );
112
114
 
113
115
  export default memo(forwardRef(CardTypography));