@utilitywarehouse/hearth-react-native 0.5.0 → 0.7.0

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 (213) hide show
  1. package/.storybook/main.ts +33 -7
  2. package/.turbo/turbo-build.log +1 -1
  3. package/.turbo/turbo-lint.log +1 -1
  4. package/CHANGELOG.md +14 -0
  5. package/build/components/BottomSheet/BottomSheetBackdrop.js +2 -2
  6. package/build/components/BottomSheet/BottomSheetFlatList.js +2 -2
  7. package/build/components/BottomSheet/BottomSheetHandle.js +2 -2
  8. package/build/components/Button/ButtonIcon.js +2 -1
  9. package/build/components/Button/ButtonRoot.js +2 -6
  10. package/build/components/Button/ButtonText.js +4 -1
  11. package/build/components/Card/Card.context.d.ts +7 -0
  12. package/build/components/Card/CardAction/CardAction.context.d.ts +9 -0
  13. package/build/components/Card/{CardAction.context.js → CardAction/CardAction.context.js} +7 -1
  14. package/build/components/Card/CardAction/CardAction.d.ts +18 -0
  15. package/build/components/Card/CardAction/CardAction.js +7 -0
  16. package/build/components/Card/CardAction/CardAction.props.d.ts +63 -0
  17. package/build/components/Card/CardAction/CardAction.props.js +1 -0
  18. package/build/components/Card/CardAction/CardActionContent.d.ts +6 -0
  19. package/build/components/Card/CardAction/CardActionContent.js +13 -0
  20. package/build/components/Card/CardAction/CardActionHelperText.d.ts +6 -0
  21. package/build/components/Card/CardAction/CardActionHelperText.js +13 -0
  22. package/build/components/Card/CardAction/CardActionIcon.d.ts +9 -0
  23. package/build/components/Card/CardAction/CardActionIcon.js +19 -0
  24. package/build/components/Card/CardAction/CardActionLeadingContent.d.ts +6 -0
  25. package/build/components/Card/CardAction/CardActionLeadingContent.js +5 -0
  26. package/build/components/Card/CardAction/CardActionRoot.d.ts +12 -0
  27. package/build/components/Card/CardAction/CardActionRoot.js +155 -0
  28. package/build/components/Card/CardAction/CardActionText.d.ts +6 -0
  29. package/build/components/Card/CardAction/CardActionText.js +9 -0
  30. package/build/components/Card/CardAction/CardActionTrailingContent.d.ts +6 -0
  31. package/build/components/Card/CardAction/CardActionTrailingContent.js +5 -0
  32. package/build/components/Card/CardAction/CardActionTrailingIcon.d.ts +9 -0
  33. package/build/components/Card/CardAction/CardActionTrailingIcon.js +19 -0
  34. package/build/components/Card/CardAction/index.d.ts +10 -0
  35. package/build/components/Card/CardAction/index.js +9 -0
  36. package/build/components/Card/CardContent.d.ts +6 -0
  37. package/build/components/Card/CardContent.js +33 -0
  38. package/build/components/Card/CardPressHandler.context.d.ts +6 -0
  39. package/build/components/Card/CardPressHandler.context.js +6 -0
  40. package/build/components/Card/{CardAction.d.ts → CardPressHandler.d.ts} +3 -3
  41. package/build/components/Card/CardPressHandler.js +13 -0
  42. package/build/components/Card/CardRoot.js +103 -11
  43. package/build/components/Card/index.d.ts +3 -2
  44. package/build/components/Card/index.js +3 -2
  45. package/build/components/Checkbox/CheckboxIcon.js +2 -1
  46. package/build/components/Container/Container.d.ts +6 -0
  47. package/build/components/Container/Container.js +40 -0
  48. package/build/components/Container/Container.props.d.ts +85 -0
  49. package/build/components/Container/Container.props.js +1 -0
  50. package/build/components/Container/index.d.ts +2 -0
  51. package/build/components/Container/index.js +1 -0
  52. package/build/components/CurrencyInput/CurrencyInput.js +1 -1
  53. package/build/components/Helper/HelperIcon.js +2 -1
  54. package/build/components/Icon/Icon.d.ts +2 -6
  55. package/build/components/IconButton/IconButtonIcon.js +2 -1
  56. package/build/components/IconContainer/IconContainer.d.ts +4 -3
  57. package/build/components/IconContainer/IconContainer.js +3 -3
  58. package/build/components/Input/InputField.js +4 -2
  59. package/build/components/Input/InputIcon.js +2 -1
  60. package/build/components/Link/LinkIcon.js +3 -2
  61. package/build/components/List/ListAction/ListActionTrailingIcon.js +2 -1
  62. package/build/components/List/ListItem/ListItemIcon.js +2 -1
  63. package/build/components/List/ListItem/ListItemTrailingIcon.js +2 -3
  64. package/build/components/ProgressStepper/ProgressStep.d.ts +1 -1
  65. package/build/components/ProgressStepper/ProgressStep.js +6 -6
  66. package/build/components/ProgressStepper/ProgressStepper.props.d.ts +3 -3
  67. package/build/components/ProgressStepper/index.d.ts +1 -1
  68. package/build/components/Radio/RadioIcon.js +7 -2
  69. package/build/components/RadioCard/RadioCardIcon.js +3 -2
  70. package/build/components/Spinner/Spinner.js +2 -0
  71. package/build/components/Spinner/Spinner.web.js +2 -0
  72. package/build/components/Switch/Switch.js +5 -3
  73. package/build/components/Switch/Switch.web.js +1 -0
  74. package/build/components/Tabs/TabsList.js +6 -1
  75. package/build/components/Textarea/TextareaField.js +1 -1
  76. package/build/components/ThemedImage/ThemedImage.d.ts +12 -0
  77. package/build/components/ThemedImage/ThemedImage.js +27 -0
  78. package/build/components/ThemedImage/ThemedImage.props.d.ts +13 -0
  79. package/build/components/ThemedImage/ThemedImage.props.js +1 -0
  80. package/build/components/ThemedImage/index.d.ts +2 -0
  81. package/build/components/ThemedImage/index.js +1 -0
  82. package/build/components/ToggleButton/ToggleButtonIcon.js +2 -1
  83. package/build/components/ToggleButton/ToggleButtonRoot.js +2 -2
  84. package/build/components/UnstyledIconButton/UnstyledIconButtonIcon.js +2 -1
  85. package/build/components/index.d.ts +3 -1
  86. package/build/components/index.js +3 -1
  87. package/build/core/index.d.ts +3 -3
  88. package/build/core/index.js +3 -3
  89. package/build/core/themes.d.ts +24 -12
  90. package/build/hooks/useColorMode.d.ts +1 -1
  91. package/build/hooks/useColorMode.js +7 -8
  92. package/build/hooks/useStyleProps.js +1 -1
  93. package/build/tokens/components/dark/banner.d.ts +19 -0
  94. package/build/tokens/components/dark/banner.js +19 -0
  95. package/build/tokens/components/dark/card-action.d.ts +11 -0
  96. package/build/tokens/components/dark/card-action.js +10 -0
  97. package/build/tokens/components/dark/card-content.d.ts +25 -0
  98. package/build/tokens/components/dark/card-content.js +24 -0
  99. package/build/tokens/components/dark/drawer.d.ts +29 -0
  100. package/build/tokens/components/dark/drawer.js +28 -0
  101. package/build/tokens/components/dark/illustrations.d.ts +0 -1
  102. package/build/tokens/components/dark/illustrations.js +0 -1
  103. package/build/tokens/components/dark/index.d.ts +3 -0
  104. package/build/tokens/components/dark/index.js +3 -0
  105. package/build/tokens/components/light/banner.d.ts +19 -0
  106. package/build/tokens/components/light/banner.js +19 -0
  107. package/build/tokens/components/light/card-action.d.ts +11 -0
  108. package/build/tokens/components/light/card-action.js +10 -0
  109. package/build/tokens/components/light/card-content.d.ts +25 -0
  110. package/build/tokens/components/light/card-content.js +24 -0
  111. package/build/tokens/components/light/drawer.d.ts +29 -0
  112. package/build/tokens/components/light/drawer.js +28 -0
  113. package/build/tokens/components/light/illustrations.d.ts +0 -1
  114. package/build/tokens/components/light/illustrations.js +0 -1
  115. package/build/tokens/components/light/index.d.ts +3 -0
  116. package/build/tokens/components/light/index.js +3 -0
  117. package/build/tokens/layout.d.ts +6 -6
  118. package/build/tokens/layout.js +3 -3
  119. package/build/tokens/typography.d.ts +6 -0
  120. package/build/tokens/typography.js +3 -0
  121. package/docs/components/AllComponents.web.tsx +38 -3
  122. package/docs/components/NextPrevPage.tsx +5 -5
  123. package/docs/components/VariantTitle.tsx +17 -7
  124. package/docs/layout-components.docs.mdx +30 -0
  125. package/package.json +18 -14
  126. package/src/components/BottomSheet/BottomSheetBackdrop.tsx +2 -2
  127. package/src/components/BottomSheet/BottomSheetFlatList.tsx +2 -3
  128. package/src/components/BottomSheet/BottomSheetHandle.tsx +1 -1
  129. package/src/components/Button/ButtonIcon.tsx +2 -1
  130. package/src/components/Button/ButtonRoot.tsx +2 -6
  131. package/src/components/Button/ButtonText.tsx +4 -1
  132. package/src/components/Card/Card.context.ts +7 -0
  133. package/src/components/Card/Card.docs.mdx +212 -14
  134. package/src/components/Card/Card.stories.tsx +50 -3
  135. package/src/components/Card/CardAction/CardAction.context.ts +22 -0
  136. package/src/components/Card/CardAction/CardAction.props.ts +87 -0
  137. package/src/components/Card/CardAction/CardAction.stories.tsx +265 -0
  138. package/src/components/Card/CardAction/CardAction.tsx +10 -0
  139. package/src/components/Card/CardAction/CardActionContent.tsx +20 -0
  140. package/src/components/Card/CardAction/CardActionHelperText.tsx +21 -0
  141. package/src/components/Card/CardAction/CardActionIcon.tsx +32 -0
  142. package/src/components/Card/CardAction/CardActionLeadingContent.tsx +9 -0
  143. package/src/components/Card/CardAction/CardActionRoot.tsx +258 -0
  144. package/src/components/Card/CardAction/CardActionText.tsx +17 -0
  145. package/src/components/Card/CardAction/CardActionTrailingContent.tsx +9 -0
  146. package/src/components/Card/CardAction/CardActionTrailingIcon.tsx +32 -0
  147. package/src/components/Card/CardAction/index.ts +10 -0
  148. package/src/components/Card/CardContent.tsx +40 -0
  149. package/src/components/Card/CardPressHandler.context.ts +12 -0
  150. package/src/components/Card/CardPressHandler.tsx +20 -0
  151. package/src/components/Card/CardRoot.tsx +128 -13
  152. package/src/components/Card/index.ts +3 -2
  153. package/src/components/Checkbox/CheckboxIcon.tsx +2 -1
  154. package/src/components/Container/Container.docs.mdx +168 -0
  155. package/src/components/Container/Container.props.ts +89 -0
  156. package/src/components/Container/Container.stories.tsx +274 -0
  157. package/src/components/Container/Container.tsx +52 -0
  158. package/src/components/Container/index.tsx +2 -0
  159. package/src/components/CurrencyInput/CurrencyInput.tsx +1 -1
  160. package/src/components/Helper/HelperIcon.tsx +2 -1
  161. package/src/components/Icon/Icon.tsx +4 -3
  162. package/src/components/IconButton/IconButtonIcon.tsx +2 -1
  163. package/src/components/IconContainer/IconContainer.tsx +17 -19
  164. package/src/components/Input/InputField.tsx +2 -1
  165. package/src/components/Input/InputIcon.tsx +2 -1
  166. package/src/components/Link/LinkIcon.tsx +3 -2
  167. package/src/components/List/ListAction/ListActionTrailingIcon.tsx +2 -1
  168. package/src/components/List/ListItem/ListItemIcon.tsx +2 -1
  169. package/src/components/List/ListItem/ListItemTrailingIcon.tsx +2 -3
  170. package/src/components/ProgressStepper/ProgressStep.tsx +8 -8
  171. package/src/components/ProgressStepper/ProgressStepper.docs.mdx +11 -11
  172. package/src/components/ProgressStepper/ProgressStepper.props.ts +3 -3
  173. package/src/components/ProgressStepper/ProgressStepper.stories.tsx +27 -27
  174. package/src/components/ProgressStepper/index.ts +1 -1
  175. package/src/components/Radio/RadioIcon.tsx +8 -3
  176. package/src/components/RadioCard/RadioCardIcon.tsx +4 -3
  177. package/src/components/Spinner/Spinner.tsx +2 -0
  178. package/src/components/Spinner/Spinner.web.tsx +2 -0
  179. package/src/components/Switch/Switch.tsx +10 -5
  180. package/src/components/Switch/Switch.web.tsx +5 -0
  181. package/src/components/Tabs/TabsList.tsx +2 -0
  182. package/src/components/Textarea/TextareaField.tsx +1 -1
  183. package/src/components/ThemedImage/ThemedImage.docs.mdx +208 -0
  184. package/src/components/ThemedImage/ThemedImage.props.ts +15 -0
  185. package/src/components/ThemedImage/ThemedImage.stories.tsx +175 -0
  186. package/src/components/ThemedImage/ThemedImage.tsx +34 -0
  187. package/src/components/ThemedImage/index.tsx +2 -0
  188. package/src/components/ToggleButton/ToggleButtonIcon.tsx +2 -1
  189. package/src/components/ToggleButton/ToggleButtonRoot.tsx +2 -2
  190. package/src/components/UnstyledIconButton/UnstyledIconButtonIcon.tsx +2 -1
  191. package/src/components/index.ts +3 -9
  192. package/src/core/index.ts +14 -11
  193. package/src/hooks/useColorMode.ts +9 -12
  194. package/src/hooks/useStyleProps.ts +1 -1
  195. package/src/tokens/components/dark/banner.ts +19 -0
  196. package/src/tokens/components/dark/card-action.ts +11 -0
  197. package/src/tokens/components/dark/card-content.ts +25 -0
  198. package/src/tokens/components/dark/drawer.ts +29 -0
  199. package/src/tokens/components/dark/illustrations.ts +0 -1
  200. package/src/tokens/components/dark/index.ts +3 -0
  201. package/src/tokens/components/light/banner.ts +19 -0
  202. package/src/tokens/components/light/card-action.ts +11 -0
  203. package/src/tokens/components/light/card-content.ts +25 -0
  204. package/src/tokens/components/light/drawer.ts +29 -0
  205. package/src/tokens/components/light/illustrations.ts +0 -1
  206. package/src/tokens/components/light/index.ts +3 -0
  207. package/src/tokens/layout.ts +3 -3
  208. package/src/tokens/typography.ts +3 -0
  209. package/src/vite-env.d.ts +6 -0
  210. package/build/components/Card/CardAction.context.d.ts +0 -6
  211. package/build/components/Card/CardAction.js +0 -13
  212. package/src/components/Card/CardAction.context.ts +0 -12
  213. package/src/components/Card/CardAction.tsx +0 -18
@@ -4,12 +4,12 @@ import { StyleSheet } from 'react-native-unistyles';
4
4
  import { TickSmallIcon } from '@utilitywarehouse/hearth-react-native-icons';
5
5
  import { Icon } from '../Icon';
6
6
  import { BodyText } from '../BodyText';
7
- const ProgressStep = ({ state, index = 0, isLast = false, ...rest }) => {
8
- styles.useVariants({ state, isLast });
7
+ const ProgressStep = ({ status, index = 0, isLast = false, ...rest }) => {
8
+ styles.useVariants({ status, isLast });
9
9
  const renderStepNumber = () => {
10
10
  return (_jsx(BodyText, { size: "md", weight: "semibold", style: styles.text, children: index + 1 }));
11
11
  };
12
- return (_jsxs(View, { style: styles.container, accessible: true, "aria-label": `Step ${index + 1}, ${rest.id}, ${state}`, ...rest, children: [_jsx(View, { style: styles.step, children: state === 'complete' ? (_jsx(Icon, { as: TickSmallIcon, width: 20, height: 20, style: styles.text })) : state === 'active' ? (_jsx(View, { style: styles.inner, children: renderStepNumber() })) : (renderStepNumber()) }), !isLast && _jsx(View, { style: styles.connector })] }));
12
+ return (_jsxs(View, { style: styles.container, accessible: true, "aria-label": `Step ${index + 1}, ${rest.id}, ${status}`, ...rest, children: [_jsx(View, { style: styles.step, children: status === 'complete' ? (_jsx(Icon, { as: TickSmallIcon, width: 20, height: 20, style: styles.text })) : status === 'active' ? (_jsx(View, { style: styles.inner, children: renderStepNumber() })) : (renderStepNumber()) }), !isLast && _jsx(View, { style: styles.connector })] }));
13
13
  };
14
14
  ProgressStep.displayName = 'ProgressStep';
15
15
  const styles = StyleSheet.create(theme => ({
@@ -37,7 +37,7 @@ const styles = StyleSheet.create(theme => ({
37
37
  alignItems: 'center',
38
38
  justifyContent: 'center',
39
39
  variants: {
40
- state: {
40
+ status: {
41
41
  complete: {
42
42
  backgroundColor: theme.color.surface.brand.default,
43
43
  },
@@ -64,7 +64,7 @@ const styles = StyleSheet.create(theme => ({
64
64
  },
65
65
  text: {
66
66
  variants: {
67
- state: {
67
+ status: {
68
68
  complete: {
69
69
  color: theme.color.text.inverted,
70
70
  },
@@ -83,7 +83,7 @@ const styles = StyleSheet.create(theme => ({
83
83
  flex: 1,
84
84
  height: theme.components.progressStepper.bar.height,
85
85
  variants: {
86
- state: {
86
+ status: {
87
87
  complete: {
88
88
  backgroundColor: theme.components.progressStepper.bar.complete.backgroundColor,
89
89
  },
@@ -1,5 +1,5 @@
1
1
  import { ViewProps } from 'react-native';
2
- export type StepState = 'complete' | 'active' | 'incomplete';
2
+ export type StepStatus = 'complete' | 'active' | 'incomplete';
3
3
  export interface ProgressStepperProps extends ViewProps {
4
4
  /**
5
5
  * Child ProgressStep components
@@ -12,9 +12,9 @@ export interface ProgressStepProps extends ViewProps {
12
12
  */
13
13
  id: string;
14
14
  /**
15
- * Current state of the step
15
+ * Current status of the step
16
16
  */
17
- state: StepState;
17
+ status: StepStatus;
18
18
  }
19
19
  export interface ProgressStepperRootProps extends ViewProps {
20
20
  children: React.ReactNode;
@@ -1,3 +1,3 @@
1
1
  export { default as ProgressStepper } from './ProgressStepper';
2
2
  export { default as ProgressStep } from './ProgressStep';
3
- export type { ProgressStepperProps, ProgressStepProps, StepState } from './ProgressStepper.props';
3
+ export type { ProgressStepperProps, ProgressStepProps, StepStatus } from './ProgressStepper.props';
@@ -1,11 +1,16 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Platform } from 'react-native';
2
3
  import { StyleSheet } from 'react-native-unistyles';
3
4
  import { Icon } from '../Icon';
4
5
  import { CircleIcon } from '../Icons';
5
- import { Platform } from 'react-native';
6
6
  const RadioIcon = ({ style, ...props }) => {
7
7
  return (_jsx(Icon, { as: CircleIcon, ...props, style: Platform.OS === 'web'
8
- ? StyleSheet.compose(styles.container, style)
8
+ ? {
9
+ // @ts-expect-error - style prop type issue
10
+ ...styles.container,
11
+ // @ts-expect-error - style prop type issue
12
+ ...props.style,
13
+ }
9
14
  : [styles.container, style] }));
10
15
  };
11
16
  RadioIcon.displayName = 'RadioIcon';
@@ -1,11 +1,12 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Platform } from 'react-native';
2
3
  import { StyleSheet } from 'react-native-unistyles';
3
4
  import { Icon } from '../Icon';
4
5
  import { CircleIcon } from '../Icons';
5
- import { Platform } from 'react-native';
6
6
  const RadioCardIcon = ({ style, ...props }) => {
7
7
  return (_jsx(Icon, { as: CircleIcon, ...props, style: Platform.OS === 'web'
8
- ? StyleSheet.compose(styles.container, style)
8
+ ? // @ts-expect-error - style prop type issue
9
+ { ...styles.container, ...props.style }
9
10
  : [styles.container, style] }));
10
11
  };
11
12
  RadioCardIcon.displayName = 'RadioCardIcon';
@@ -7,7 +7,9 @@ import { Circle, G, Svg } from 'react-native-svg';
7
7
  import { StyleSheet } from 'react-native-unistyles';
8
8
  import { useTheme } from '../../hooks';
9
9
  import { getFlattenedColorValue } from '../../utils';
10
+ // @ts-expect-error - Animated.View type issue
10
11
  const AnimatedSvg = Animated.createAnimatedComponent(Svg);
12
+ // @ts-expect-error - Animated.View type issue
11
13
  const AnimatedCircle = Animated.createAnimatedComponent(Circle);
12
14
  const SpinnerRoot = ({ size = 'md', color, ...props }) => {
13
15
  const { components } = useTheme();
@@ -8,7 +8,9 @@ import { Circle, G, Svg } from 'react-native-svg';
8
8
  import { StyleSheet } from 'react-native-unistyles';
9
9
  import { useTheme } from '../../hooks';
10
10
  import { getFlattenedColorValue } from '../../utils';
11
+ // @ts-expect-error - Animated.View type issue
11
12
  const AnimatedSvg = Animated.createAnimatedComponent(Svg);
13
+ // @ts-expect-error - Animated.View type issue
12
14
  const AnimatedCircle = Animated.createAnimatedComponent(Circle);
13
15
  const SpinnerRoot = ({ size = 'md', color, ...props }) => {
14
16
  const { components } = useTheme();
@@ -4,10 +4,12 @@ import { useEffect } from 'react';
4
4
  import { Pressable } from 'react-native';
5
5
  import Animated, { Easing, interpolateColor, useAnimatedStyle, useReducedMotion, useSharedValue, withSpring, withTiming, } from 'react-native-reanimated';
6
6
  import { StyleSheet } from 'react-native-unistyles';
7
+ import { useAnimatedTheme } from 'react-native-unistyles/reanimated';
7
8
  import { useTheme } from '../../hooks';
8
9
  import { Icon } from '../Icon';
9
10
  const CustomSwitch = ({ value = false, onValueChange, disabled = false, size = 'medium', ...accessibilityProps }) => {
10
11
  const { components, color } = useTheme();
12
+ const theme = useAnimatedTheme();
11
13
  const SWITCH_WIDTH = size === 'medium' ? components.switch.md.width : components.switch.sm.width;
12
14
  const THUMB_SIZE = size === 'medium' ? components.switch.md.circle.size : components.switch.sm.circle.size;
13
15
  const PADDING = components.switch.padding;
@@ -17,11 +19,11 @@ const CustomSwitch = ({ value = false, onValueChange, disabled = false, size = '
17
19
  const progress = useSharedValue(value ? 1 : 0);
18
20
  const animatedThumbStyle = useAnimatedStyle(() => ({
19
21
  transform: [{ translateX: offset.value }],
20
- }));
22
+ }), [offset]);
21
23
  const animatedSwitchBackgroundStyle = useAnimatedStyle(() => {
22
24
  const backgroundColor = interpolateColor(progress.value, [0, 1], [
23
- color.interactive.functional.surface.strong.default,
24
- color.interactive.brand.surface.strong.default,
25
+ theme.value.color.interactive.functional.surface.strong.default,
26
+ theme.value.color.interactive.brand.surface.strong.default,
25
27
  ]);
26
28
  return { backgroundColor };
27
29
  });
@@ -6,6 +6,7 @@ import Animated, { Easing, interpolateColor, useAnimatedStyle, useReducedMotion,
6
6
  import { StyleSheet } from 'react-native-unistyles';
7
7
  import { useTheme } from '../../hooks';
8
8
  import { Icon } from '../Icon';
9
+ // @ts-expect-error - Animated.View type issue
9
10
  const AnimatedView = Animated.createAnimatedComponent(View);
10
11
  const CustomSwitch = ({ value = false, onValueChange, disabled = false, size = 'medium', ...accessibilityProps }) => {
11
12
  const { components, color } = useTheme();
@@ -6,6 +6,7 @@ import Animated, { runOnJS, useAnimatedScrollHandler, useAnimatedStyle, useShare
6
6
  import { StyleSheet } from 'react-native-unistyles';
7
7
  import { UnstyledIconButton } from '../UnstyledIconButton';
8
8
  import { useTabsContext } from './Tabs.context';
9
+ // @ts-expect-error - Animated.View type issue
9
10
  const Indicator = Animated.createAnimatedComponent(View);
10
11
  const SCROLL_STEP_RATIO = 0.6;
11
12
  const SCROLL_BUTTON_HITSLOP = { top: 10, bottom: 10, left: 10, right: 10 };
@@ -59,7 +60,11 @@ const TabsList = ({ children, style, ...rest }) => {
59
60
  }
60
61
  return;
61
62
  }, [updateScrollState]);
62
- return (_jsxs(View, { style: [styles.wrapper, style], ...rest, accessibilityRole: "tablist", children: [canScrollLeft && (_jsx(View, { style: [styles.iconButtonWrap, styles.scrollButtonLeft], accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", ...(Platform.OS === 'web' ? { 'aria-hidden': true } : {}), children: _jsx(UnstyledIconButton, { accessibilityLabel: undefined, icon: ChevronLeftSmallIcon, onPress: () => scrollBy(-1), style: styles.iconButton, accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", hitSlop: SCROLL_BUTTON_HITSLOP, ...(Platform.OS === 'web' ? { 'aria-hidden': true, tabIndex: -1 } : {}) }) })), _jsx(Animated.ScrollView, { ref: scrollRef, horizontal: true, showsHorizontalScrollIndicator: false, onLayout: onLayoutContainer, onContentSizeChange: onContentSizeChange, onScroll: onScrollHandler, scrollEventThrottle: 16, bounces: false, contentContainerStyle: styles.scrollContent, children: _jsxs(View, { style: styles.container, children: [children, _jsx(Indicator, { accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", style: [styles.indicator, indicatorStyle] })] }) }), canScrollRight && (_jsx(View, { style: [styles.iconButtonWrap, styles.scrollButtonRight], accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", ...(Platform.OS === 'web' ? { 'aria-hidden': true } : {}), children: _jsx(UnstyledIconButton, { accessibilityLabel: undefined, icon: ChevronRightSmallIcon, onPress: () => scrollBy(1), style: styles.iconButton, accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", hitSlop: SCROLL_BUTTON_HITSLOP, ...(Platform.OS === 'web' ? { 'aria-hidden': true, tabIndex: -1 } : {}) }) }))] }));
63
+ return (_jsxs(View, { style: [styles.wrapper, style], ...rest, accessibilityRole: "tablist", children: [canScrollLeft && (_jsx(View, { style: [styles.iconButtonWrap, styles.scrollButtonLeft], accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", ...(Platform.OS === 'web' ? { 'aria-hidden': true } : {}), children: _jsx(UnstyledIconButton, { accessibilityLabel: undefined, icon: ChevronLeftSmallIcon, onPress: () => scrollBy(-1), style: styles.iconButton, accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", hitSlop: SCROLL_BUTTON_HITSLOP, ...(Platform.OS === 'web' ? { 'aria-hidden': true, tabIndex: -1 } : {}) }) })), _jsx(Animated.ScrollView, { ref: scrollRef, horizontal: true, showsHorizontalScrollIndicator: false, onLayout: onLayoutContainer, onContentSizeChange: onContentSizeChange, onScroll: onScrollHandler, scrollEventThrottle: 16, bounces: false, contentContainerStyle: styles.scrollContent, children: _jsxs(View, { style: styles.container, children: [children, _jsx(Indicator
64
+ // @ts-expect-error - Animated.View type issue
65
+ , {
66
+ // @ts-expect-error - Animated.View type issue
67
+ accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", style: [styles.indicator, indicatorStyle] })] }) }), canScrollRight && (_jsx(View, { style: [styles.iconButtonWrap, styles.scrollButtonRight], accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", ...(Platform.OS === 'web' ? { 'aria-hidden': true } : {}), children: _jsx(UnstyledIconButton, { accessibilityLabel: undefined, icon: ChevronRightSmallIcon, onPress: () => scrollBy(1), style: styles.iconButton, accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", hitSlop: SCROLL_BUTTON_HITSLOP, ...(Platform.OS === 'web' ? { 'aria-hidden': true, tabIndex: -1 } : {}) }) }))] }));
63
68
  };
64
69
  TabsList.displayName = 'TabsList';
65
70
  const styles = StyleSheet.create(theme => ({
@@ -20,7 +20,7 @@ const styles = StyleSheet.create(theme => ({
20
20
  color: theme.color.text.primary,
21
21
  fontSize: theme.typography.mobile.bodyText.md.fontSize,
22
22
  fontFamily: theme.typography.mobile.bodyText.fontFamily,
23
- fontWeight: theme.typography.mobile.bodyText.fontWeight,
23
+ fontWeight: `${theme.typography.mobile.bodyText.fontWeight}`,
24
24
  borderWidth: 0,
25
25
  outlineWidth: 0,
26
26
  _web: {
@@ -0,0 +1,12 @@
1
+ import type ThemedImageProps from './ThemedImage.props';
2
+ /**
3
+ * ThemedImage component that displays different images or components based on the current theme
4
+ * @param light - Image source or SVG component to display in light mode
5
+ * @param dark - Image source or SVG component to display in dark mode
6
+ * @param ...rest - All other Image props including width/height for SVG components
7
+ */
8
+ declare const ThemedImage: {
9
+ ({ light, dark, ...props }: ThemedImageProps): import("react/jsx-runtime").JSX.Element;
10
+ displayName: string;
11
+ };
12
+ export default ThemedImage;
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { isValidElement } from 'react';
3
+ import { Image } from 'react-native';
4
+ import useColorMode from '../../hooks/useColorMode';
5
+ /**
6
+ * ThemedImage component that displays different images or components based on the current theme
7
+ * @param light - Image source or SVG component to display in light mode
8
+ * @param dark - Image source or SVG component to display in dark mode
9
+ * @param ...rest - All other Image props including width/height for SVG components
10
+ */
11
+ const ThemedImage = ({ light, dark, ...props }) => {
12
+ const [colorMode] = useColorMode();
13
+ const source = colorMode === 'light' ? light : dark;
14
+ // If the source is a React element (like an SVG component), render it directly
15
+ if (isValidElement(source)) {
16
+ return source;
17
+ }
18
+ // If the source is a component type (function/class), instantiate it with props
19
+ if (typeof source === 'function') {
20
+ const Source = source;
21
+ return _jsx(Source, { ...props });
22
+ }
23
+ // Otherwise, render as a regular Image with the source
24
+ return _jsx(Image, { source: source, ...props });
25
+ };
26
+ ThemedImage.displayName = 'ThemedImage';
27
+ export default ThemedImage;
@@ -0,0 +1,13 @@
1
+ import type { ComponentType, ReactElement } from 'react';
2
+ import type { ImageProps, ImageSourcePropType } from 'react-native';
3
+ interface ThemedImageProps extends Omit<ImageProps, 'source'> {
4
+ /**
5
+ * Image source or component to display in light mode
6
+ */
7
+ light: ImageSourcePropType | ReactElement | ComponentType<any>;
8
+ /**
9
+ * Image source or component to display in dark mode
10
+ */
11
+ dark: ImageSourcePropType | ReactElement | ComponentType<any>;
12
+ }
13
+ export default ThemedImageProps;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export { default as ThemedImage } from './ThemedImage';
2
+ export type { default as ThemedImageProps } from './ThemedImage.props';
@@ -0,0 +1 @@
1
+ export { default as ThemedImage } from './ThemedImage';
@@ -7,7 +7,8 @@ const ButtonIcon = ({ children, toggled, as = TickSmallIcon, ...props }) => {
7
7
  styles.useVariants({ toggled });
8
8
  const IconAny = Icon;
9
9
  return (_jsx(IconAny, { as: as, ...props, style: Platform.OS === 'web'
10
- ? StyleSheet.compose(styles.icon, props.style)
10
+ ? // @ts-ignore
11
+ { ...styles.icon, ...props.style }
11
12
  : [styles.icon, props.style], children: children }));
12
13
  };
13
14
  ButtonIcon.displayName = 'ButtonIcon';
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Pressable } from 'react-native';
3
3
  import { StyleSheet } from 'react-native-unistyles';
4
- import { useCardActionContext } from '../Card';
4
+ import { useCardPressHandlerContext } from '../Card';
5
5
  const ButtonRoot = ({ children, onToggle, toggled, states, onPress, ...props }) => {
6
6
  const { active } = states || {};
7
- const { pressed } = useCardActionContext();
7
+ const { pressed } = useCardPressHandlerContext();
8
8
  styles.useVariants({
9
9
  toggled,
10
10
  active: active || pressed,
@@ -7,7 +7,8 @@ const UnstyledIconButtonIcon = ({ children, ...props }) => {
7
7
  const { active, inverted, size } = useUnstyledIconButtonContext();
8
8
  styles.useVariants({ active, inverted, size });
9
9
  return (_jsx(Icon, { ...props, style: Platform.OS === 'web'
10
- ? StyleSheet.compose(styles.icon, props.style)
10
+ ? // @ts-ignore
11
+ { ...styles.icon, ...props.style }
11
12
  : [styles.icon, props.style], children: children }));
12
13
  };
13
14
  UnstyledIconButtonIcon.displayName = 'UnstyledIconButtonIcon';
@@ -9,6 +9,7 @@ export * from './Card';
9
9
  export * from './Carousel';
10
10
  export * from './Center';
11
11
  export * from './Checkbox';
12
+ export * from './Container';
12
13
  export * from './CurrencyInput';
13
14
  export * from './DatePicker';
14
15
  export * from './DatePickerInput';
@@ -41,7 +42,8 @@ export * from './Spinner';
41
42
  export * from './Switch';
42
43
  export * from './Tabs';
43
44
  export * from './Textarea';
45
+ export * from './ThemedImage';
44
46
  export * from './ToggleButtonCard';
45
- export { FlatList, Image, KeyboardAvoidingView, ScrollView, SectionList, StatusBar, View, } from 'react-native';
47
+ export { FlatList, Image, KeyboardAvoidingView, ScrollView, SectionList, View } from 'react-native';
46
48
  export { Pressable } from 'react-native';
47
49
  export { createIcon } from '@gluestack-ui/icon';
@@ -10,6 +10,7 @@ export * from './Card';
10
10
  export * from './Carousel';
11
11
  export * from './Center';
12
12
  export * from './Checkbox';
13
+ export * from './Container';
13
14
  export * from './CurrencyInput';
14
15
  export * from './DatePicker';
15
16
  export * from './DatePickerInput';
@@ -42,7 +43,8 @@ export * from './Spinner';
42
43
  export * from './Switch';
43
44
  export * from './Tabs';
44
45
  export * from './Textarea';
46
+ export * from './ThemedImage';
45
47
  export * from './ToggleButtonCard';
46
- export { FlatList, Image, KeyboardAvoidingView, ScrollView, SectionList, StatusBar, View, } from 'react-native';
48
+ export { FlatList, Image, KeyboardAvoidingView, ScrollView, SectionList, View } from 'react-native';
47
49
  export { Pressable } from 'react-native';
48
50
  export { createIcon } from '@gluestack-ui/icon';
@@ -1,5 +1,5 @@
1
- export * from './themes';
2
- export * from './breakpoints';
3
- export { StyleSheet, UnistylesRuntime, withUnistyles, Hide, Display, ScopedTheme, mq, getServerUnistyles, useUnistyles, hydrateServerUnistyles, useServerUnistyles, resetServerUnistyles, } from 'react-native-unistyles';
1
+ export { createUnistylesElement, Display, getServerUnistyles, Hide, hydrateServerUnistyles, mq, NavigationBar, resetServerUnistyles, ScopedTheme, StatusBar, StyleSheet, UnistylesRuntime, useServerUnistyles, useUnistyles, withUnistyles, } from 'react-native-unistyles';
4
2
  export type { UnistylesBreakpoints, UnistylesThemes, UnistylesVariants, } from 'react-native-unistyles';
3
+ export * from './breakpoints';
4
+ export * from './themes';
5
5
  export type * from '../types/unistyles';
@@ -1,9 +1,9 @@
1
1
  import { StyleSheet } from 'react-native-unistyles';
2
- import { themes } from './themes';
3
2
  import { breakpoints } from './breakpoints';
4
- export * from './themes';
3
+ import { themes } from './themes';
4
+ export { createUnistylesElement, Display, getServerUnistyles, Hide, hydrateServerUnistyles, mq, NavigationBar, resetServerUnistyles, ScopedTheme, StatusBar, StyleSheet, UnistylesRuntime, useServerUnistyles, useUnistyles, withUnistyles, } from 'react-native-unistyles';
5
5
  export * from './breakpoints';
6
- export { StyleSheet, UnistylesRuntime, withUnistyles, Hide, Display, ScopedTheme, mq, getServerUnistyles, useUnistyles, hydrateServerUnistyles, useServerUnistyles, resetServerUnistyles, } from 'react-native-unistyles';
6
+ export * from './themes';
7
7
  StyleSheet.configure({
8
8
  breakpoints,
9
9
  themes,
@@ -285,6 +285,7 @@ export declare const lightTheme: {
285
285
  readonly lineHeight: 36;
286
286
  };
287
287
  };
288
+ readonly listSpacing: 16;
288
289
  };
289
290
  readonly tablet: {
290
291
  readonly bodyText: {
@@ -370,6 +371,7 @@ export declare const lightTheme: {
370
371
  readonly lineHeight: 36;
371
372
  };
372
373
  };
374
+ readonly listSpacing: 16;
373
375
  };
374
376
  readonly desktop: {
375
377
  readonly bodyText: {
@@ -455,6 +457,7 @@ export declare const lightTheme: {
455
457
  readonly lineHeight: 48;
456
458
  };
457
459
  };
460
+ readonly listSpacing: 16;
458
461
  };
459
462
  };
460
463
  readonly layout: {
@@ -464,7 +467,7 @@ export declare const lightTheme: {
464
467
  readonly minWidth: 320;
465
468
  };
466
469
  readonly container: {
467
- readonly margin: 16;
470
+ readonly marginHorizontal: 16;
468
471
  readonly paddingBottom: 32;
469
472
  readonly paddingTop: 24;
470
473
  readonly width: 360;
@@ -492,7 +495,7 @@ export declare const lightTheme: {
492
495
  readonly minWidth: 740;
493
496
  };
494
497
  readonly container: {
495
- readonly margin: 32;
498
+ readonly marginHorizontal: 32;
496
499
  readonly paddingBottom: 32;
497
500
  readonly paddingTop: 24;
498
501
  readonly width: 744;
@@ -520,7 +523,7 @@ export declare const lightTheme: {
520
523
  readonly minWidth: 992;
521
524
  };
522
525
  readonly container: {
523
- readonly margin: 32;
526
+ readonly marginHorizontal: 32;
524
527
  readonly paddingBottom: 48;
525
528
  readonly paddingTop: 32;
526
529
  readonly width: 1096;
@@ -1632,6 +1635,7 @@ export declare const darkTheme: {
1632
1635
  readonly lineHeight: 36;
1633
1636
  };
1634
1637
  };
1638
+ readonly listSpacing: 16;
1635
1639
  };
1636
1640
  readonly tablet: {
1637
1641
  readonly bodyText: {
@@ -1717,6 +1721,7 @@ export declare const darkTheme: {
1717
1721
  readonly lineHeight: 36;
1718
1722
  };
1719
1723
  };
1724
+ readonly listSpacing: 16;
1720
1725
  };
1721
1726
  readonly desktop: {
1722
1727
  readonly bodyText: {
@@ -1802,6 +1807,7 @@ export declare const darkTheme: {
1802
1807
  readonly lineHeight: 48;
1803
1808
  };
1804
1809
  };
1810
+ readonly listSpacing: 16;
1805
1811
  };
1806
1812
  };
1807
1813
  readonly layout: {
@@ -1811,7 +1817,7 @@ export declare const darkTheme: {
1811
1817
  readonly minWidth: 320;
1812
1818
  };
1813
1819
  readonly container: {
1814
- readonly margin: 16;
1820
+ readonly marginHorizontal: 16;
1815
1821
  readonly paddingBottom: 32;
1816
1822
  readonly paddingTop: 24;
1817
1823
  readonly width: 360;
@@ -1839,7 +1845,7 @@ export declare const darkTheme: {
1839
1845
  readonly minWidth: 740;
1840
1846
  };
1841
1847
  readonly container: {
1842
- readonly margin: 32;
1848
+ readonly marginHorizontal: 32;
1843
1849
  readonly paddingBottom: 32;
1844
1850
  readonly paddingTop: 24;
1845
1851
  readonly width: 744;
@@ -1867,7 +1873,7 @@ export declare const darkTheme: {
1867
1873
  readonly minWidth: 992;
1868
1874
  };
1869
1875
  readonly container: {
1870
- readonly margin: 32;
1876
+ readonly marginHorizontal: 32;
1871
1877
  readonly paddingBottom: 48;
1872
1878
  readonly paddingTop: 32;
1873
1879
  readonly width: 1096;
@@ -2991,6 +2997,7 @@ export declare const themes: {
2991
2997
  readonly lineHeight: 36;
2992
2998
  };
2993
2999
  };
3000
+ readonly listSpacing: 16;
2994
3001
  };
2995
3002
  readonly tablet: {
2996
3003
  readonly bodyText: {
@@ -3076,6 +3083,7 @@ export declare const themes: {
3076
3083
  readonly lineHeight: 36;
3077
3084
  };
3078
3085
  };
3086
+ readonly listSpacing: 16;
3079
3087
  };
3080
3088
  readonly desktop: {
3081
3089
  readonly bodyText: {
@@ -3161,6 +3169,7 @@ export declare const themes: {
3161
3169
  readonly lineHeight: 48;
3162
3170
  };
3163
3171
  };
3172
+ readonly listSpacing: 16;
3164
3173
  };
3165
3174
  };
3166
3175
  readonly layout: {
@@ -3170,7 +3179,7 @@ export declare const themes: {
3170
3179
  readonly minWidth: 320;
3171
3180
  };
3172
3181
  readonly container: {
3173
- readonly margin: 16;
3182
+ readonly marginHorizontal: 16;
3174
3183
  readonly paddingBottom: 32;
3175
3184
  readonly paddingTop: 24;
3176
3185
  readonly width: 360;
@@ -3198,7 +3207,7 @@ export declare const themes: {
3198
3207
  readonly minWidth: 740;
3199
3208
  };
3200
3209
  readonly container: {
3201
- readonly margin: 32;
3210
+ readonly marginHorizontal: 32;
3202
3211
  readonly paddingBottom: 32;
3203
3212
  readonly paddingTop: 24;
3204
3213
  readonly width: 744;
@@ -3226,7 +3235,7 @@ export declare const themes: {
3226
3235
  readonly minWidth: 992;
3227
3236
  };
3228
3237
  readonly container: {
3229
- readonly margin: 32;
3238
+ readonly marginHorizontal: 32;
3230
3239
  readonly paddingBottom: 48;
3231
3240
  readonly paddingTop: 32;
3232
3241
  readonly width: 1096;
@@ -4338,6 +4347,7 @@ export declare const themes: {
4338
4347
  readonly lineHeight: 36;
4339
4348
  };
4340
4349
  };
4350
+ readonly listSpacing: 16;
4341
4351
  };
4342
4352
  readonly tablet: {
4343
4353
  readonly bodyText: {
@@ -4423,6 +4433,7 @@ export declare const themes: {
4423
4433
  readonly lineHeight: 36;
4424
4434
  };
4425
4435
  };
4436
+ readonly listSpacing: 16;
4426
4437
  };
4427
4438
  readonly desktop: {
4428
4439
  readonly bodyText: {
@@ -4508,6 +4519,7 @@ export declare const themes: {
4508
4519
  readonly lineHeight: 48;
4509
4520
  };
4510
4521
  };
4522
+ readonly listSpacing: 16;
4511
4523
  };
4512
4524
  };
4513
4525
  readonly layout: {
@@ -4517,7 +4529,7 @@ export declare const themes: {
4517
4529
  readonly minWidth: 320;
4518
4530
  };
4519
4531
  readonly container: {
4520
- readonly margin: 16;
4532
+ readonly marginHorizontal: 16;
4521
4533
  readonly paddingBottom: 32;
4522
4534
  readonly paddingTop: 24;
4523
4535
  readonly width: 360;
@@ -4545,7 +4557,7 @@ export declare const themes: {
4545
4557
  readonly minWidth: 740;
4546
4558
  };
4547
4559
  readonly container: {
4548
- readonly margin: 32;
4560
+ readonly marginHorizontal: 32;
4549
4561
  readonly paddingBottom: 32;
4550
4562
  readonly paddingTop: 24;
4551
4563
  readonly width: 744;
@@ -4573,7 +4585,7 @@ export declare const themes: {
4573
4585
  readonly minWidth: 992;
4574
4586
  };
4575
4587
  readonly container: {
4576
- readonly margin: 32;
4588
+ readonly marginHorizontal: 32;
4577
4589
  readonly paddingBottom: 48;
4578
4590
  readonly paddingTop: 32;
4579
4591
  readonly width: 1096;
@@ -1,2 +1,2 @@
1
- declare const useColorMode: () => readonly ["light" | "dark", import("react").Dispatch<import("react").SetStateAction<"light" | "dark">>];
1
+ declare const useColorMode: () => readonly ["light" | "dark", (mode: "light" | "dark") => void];
2
2
  export default useColorMode;
@@ -1,13 +1,12 @@
1
- import { useEffect, useState } from 'react';
1
+ import { useCallback } from 'react';
2
2
  import { UnistylesRuntime, useUnistyles } from 'react-native-unistyles';
3
3
  const useColorMode = () => {
4
- const { theme: { colorMode: themeColorMode }, } = useUnistyles();
5
- const [colorMode, setColorMode] = useState(UnistylesRuntime.themeName);
6
- useEffect(() => {
7
- if (colorMode === themeColorMode)
4
+ const { theme } = useUnistyles();
5
+ const setColorModeWrapper = useCallback((mode) => {
6
+ if (mode === theme.colorMode)
8
7
  return;
9
- setColorMode(themeColorMode);
10
- }, [themeColorMode, colorMode]);
11
- return [colorMode, setColorMode];
8
+ UnistylesRuntime.setTheme(mode);
9
+ }, [theme.colorMode]);
10
+ return [theme.colorMode, setColorModeWrapper];
12
11
  };
13
12
  export default useColorMode;
@@ -1,6 +1,6 @@
1
1
  import { useMemo } from 'react';
2
- import useTheme from './useTheme';
3
2
  import { propStyleMapping, resolveThemeValue, themeStyleMapping, viewStyleProps } from '../utils';
3
+ import useTheme from './useTheme';
4
4
  /**
5
5
  * Hook to process utility style props and resolve theme values
6
6
  * @param props Component props to process
@@ -30,5 +30,24 @@ declare const _default: {
30
30
  readonly padding: 16;
31
31
  };
32
32
  readonly imageContainerBorderColor: "#ebebeb";
33
+ readonly banner: {
34
+ readonly illustration: {
35
+ readonly lg: {
36
+ readonly width: 100;
37
+ };
38
+ readonly md: {
39
+ readonly width: 80;
40
+ };
41
+ readonly sm: {
42
+ readonly width: 60;
43
+ };
44
+ readonly xl: {
45
+ readonly width: 120;
46
+ };
47
+ readonly xs: {
48
+ readonly width: 40;
49
+ };
50
+ };
51
+ };
33
52
  };
34
53
  export default _default;