@hero-design/rn 8.36.2 → 8.37.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 (41) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/es/index.js +54 -90
  3. package/lib/index.js +54 -90
  4. package/package.json +7 -7
  5. package/src/components/Carousel/StyledCardCarousel.tsx +1 -1
  6. package/src/components/Carousel/__tests__/__snapshots__/CardCarousel.spec.tsx.snap +8 -8
  7. package/src/components/Checkbox/StyledCheckbox.tsx +7 -14
  8. package/src/components/Checkbox/__tests__/StyledCheckbox.spec.tsx +8 -12
  9. package/src/components/Checkbox/__tests__/__snapshots__/StyledCheckbox.spec.tsx.snap +4 -88
  10. package/src/components/Checkbox/__tests__/__snapshots__/index.spec.tsx.snap +12 -324
  11. package/src/components/Checkbox/__tests__/index.spec.tsx +7 -12
  12. package/src/components/Checkbox/index.tsx +7 -1
  13. package/src/components/Drawer/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
  14. package/src/components/Drawer/index.tsx +3 -3
  15. package/src/components/FAB/ActionGroup/StyledActionGroup.tsx +4 -15
  16. package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +18 -48
  17. package/src/components/FAB/ActionGroup/__tests__/index.spec.tsx +36 -29
  18. package/src/components/FAB/ActionGroup/index.tsx +18 -29
  19. package/src/components/FAB/StyledFAB.tsx +1 -1
  20. package/src/components/FAB/__tests__/__snapshots__/StyledFAB.spec.tsx.snap +4 -4
  21. package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +6 -6
  22. package/src/components/List/StyledListItem.tsx +5 -5
  23. package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +6 -6
  24. package/src/components/TextInput/__tests__/StyledTextInput.spec.tsx +2 -2
  25. package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +5 -14
  26. package/src/components/Toast/StyledToast.tsx +1 -1
  27. package/src/components/Toast/__tests__/__snapshots__/Toast.spec.tsx.snap +7 -7
  28. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +20 -23
  29. package/src/theme/components/cardCarousel.ts +5 -5
  30. package/src/theme/components/fab.ts +5 -11
  31. package/src/theme/components/list.ts +7 -4
  32. package/src/theme/components/toast.ts +5 -5
  33. package/src/theme/global/shadows.ts +3 -3
  34. package/types/components/Checkbox/StyledCheckbox.d.ts +0 -1
  35. package/types/components/Checkbox/index.d.ts +1 -0
  36. package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +2 -7
  37. package/types/components/FAB/ActionGroup/index.d.ts +5 -0
  38. package/types/theme/components/cardCarousel.d.ts +1 -1
  39. package/types/theme/components/fab.d.ts +1 -7
  40. package/types/theme/components/list.d.ts +9 -6
  41. package/types/theme/components/toast.d.ts +1 -1
@@ -6,13 +6,11 @@ const getFABTheme = (theme: GlobalTheme) => {
6
6
  buttonPressedBackground: theme.colors.pressedSurface,
7
7
  buttonActiveBackground: theme.colors.pressedSurface,
8
8
  icon: theme.colors.onPrimary,
9
- headerText: theme.colors.onDefaultGlobalSurface,
10
9
  actionItemBackground: theme.colors.secondary,
11
10
  actionItemPressedBackground: theme.colors.pressedSurface,
12
11
  backdropBackground: theme.colors.overlayGlobalSurface,
13
12
  titleText: theme.colors.onPrimary,
14
13
  actionItemText: theme.colors.onPrimary,
15
- shadow: theme.colors.primaryOutline,
16
14
  };
17
15
 
18
16
  const sizes = {
@@ -23,29 +21,27 @@ const getFABTheme = (theme: GlobalTheme) => {
23
21
  };
24
22
 
25
23
  const fonts = {
26
- header: theme.fonts.neutral.semiBold,
27
24
  actionItemText: theme.fonts.neutral.regular,
28
25
  title: theme.fonts.neutral.semiBold,
29
26
  };
30
27
 
31
28
  const fontSizes = {
32
- header: theme.fontSizes.xxxlarge,
33
29
  actionItemText: theme.fontSizes.large,
34
30
  title: theme.fontSizes.large,
35
31
  };
36
32
 
37
33
  const lineHeights = {
38
- header: theme.lineHeights.xxxlarge,
39
34
  actionItemText: theme.lineHeights.medium,
40
35
  title: theme.lineHeights.large,
41
36
  icon: theme.lineHeights.large,
42
37
  };
43
38
 
44
39
  const shadows = {
45
- offset: { width: 0, height: 2 },
46
- opacity: 0.12,
47
- radius: theme.radii.medium,
48
- elevation: 2,
40
+ offset: theme.shadows.default.shadowOffset,
41
+ opacity: theme.shadows.default.shadowOpacity,
42
+ radius: theme.shadows.default.shadowRadius,
43
+ elevation: theme.shadows.default.elevation,
44
+ color: theme.shadows.default.shadowColor,
49
45
  };
50
46
 
51
47
  const space = {
@@ -55,8 +51,6 @@ const getFABTheme = (theme: GlobalTheme) => {
55
51
  actionItemTextPaddingLeft: theme.space.xsmall,
56
52
  buttonMarginTop: theme.space.large,
57
53
  buttonMarginRight: theme.space.large,
58
- headerTextMarginRight: theme.space.large,
59
- headerTextMarginBottom: theme.space.large,
60
54
  containerPadding: theme.space.large - theme.space.xsmall,
61
55
  titleMarginHorizontal: theme.space.small,
62
56
  };
@@ -23,13 +23,17 @@ const getListTheme = (theme: GlobalTheme) => {
23
23
  const radii = {
24
24
  item: theme.radii.medium,
25
25
  basicItem: theme.radii.base,
26
- cardShadow: theme.radii.base,
27
26
  leadingStatus: theme.radii.rounded,
28
27
  };
29
28
 
30
29
  const shadows = {
31
- cardOffset: theme.shadows.default.shadowOffset,
32
- cardElevation: theme.shadows.default.elevation,
30
+ card: {
31
+ offset: theme.shadows.default.shadowOffset,
32
+ elevation: theme.shadows.default.elevation,
33
+ color: theme.shadows.default.shadowColor,
34
+ radius: theme.shadows.default.shadowRadius,
35
+ opacity: theme.shadows.default.shadowOpacity,
36
+ },
33
37
  };
34
38
 
35
39
  const widths = {
@@ -39,7 +43,6 @@ const getListTheme = (theme: GlobalTheme) => {
39
43
  const opacity = {
40
44
  disabled: 0.38,
41
45
  enabled: 1,
42
- cardShadow: theme.shadows.default.shadowOpacity,
43
46
  };
44
47
 
45
48
  return { colors, space, radii, widths, opacity, shadows };
@@ -9,7 +9,6 @@ const getToastTheme = (theme: GlobalTheme) => {
9
9
  notification: theme.colors.defaultGlobalSurface,
10
10
  snackbar: theme.colors.darkGlobalSurface,
11
11
  divider: theme.colors.secondaryOutline,
12
- shadow: theme.colors.primaryOutline,
13
12
  };
14
13
 
15
14
  const sizes = {
@@ -34,10 +33,11 @@ const getToastTheme = (theme: GlobalTheme) => {
34
33
  };
35
34
 
36
35
  const shadows = {
37
- offset: { width: 0, height: 2 },
38
- opacity: 0.12,
39
- radius: 4,
40
- elevation: 4,
36
+ offset: theme.shadows.default.shadowOffset,
37
+ opacity: theme.shadows.default.shadowOpacity,
38
+ radius: theme.shadows.default.shadowRadius,
39
+ elevation: theme.shadows.default.elevation,
40
+ color: theme.shadows.default.shadowColor,
41
41
  };
42
42
 
43
43
  return { colors, radii, sizes, space, borderWidths, shadows };
@@ -6,10 +6,10 @@ const getShadows = (systemPalette: SystemPalette) => ({
6
6
  width: 0,
7
7
  height: 2,
8
8
  },
9
- shadowColor: systemPalette.secondaryOutline,
10
- shadowOpacity: 1,
9
+ shadowColor: systemPalette.primaryOutline,
10
+ shadowOpacity: 0.12,
11
11
  shadowRadius: 4,
12
- elevation: 10,
12
+ elevation: 3,
13
13
  },
14
14
  });
15
15
 
@@ -5,7 +5,6 @@ export declare const StyledWrapper: import("@emotion/native").StyledComponent<im
5
5
  theme?: import("@emotion/react").Theme | undefined;
6
6
  as?: import("react").ElementType<any> | undefined;
7
7
  } & {
8
- themeWithBorder: boolean;
9
8
  themeState: CheckboxThemeState;
10
9
  }, {}, {
11
10
  ref?: import("react").Ref<TouchableOpacity> | undefined;
@@ -9,6 +9,7 @@ export interface CheckboxProps {
9
9
  */
10
10
  description?: string;
11
11
  /**
12
+ * @deprecated This prop will be removed in the next major release. Checkboxes will always have border.
12
13
  * Whether the border is shown.
13
14
  */
14
15
  withBorder?: boolean;
@@ -1,7 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { Animated, View } from 'react-native';
3
3
  import type { ViewProps } from 'react-native';
4
- import type { TextProps } from '../../Typography/Text';
5
4
  declare const StyledContainer: import("@emotion/native").StyledComponent<ViewProps & {
6
5
  theme?: import("@emotion/react").Theme | undefined;
7
6
  as?: import("react").ElementType<any> | undefined;
@@ -24,14 +23,10 @@ declare const StyledFAB: import("@emotion/native").StyledComponent<import("../FA
24
23
  theme?: import("@emotion/react").Theme | undefined;
25
24
  as?: import("react").ElementType<any> | undefined;
26
25
  }, {}, {}>;
27
- declare const StyledBackdrop: import("@emotion/native").StyledComponent<Animated.AnimatedProps<ViewProps & import("react").RefAttributes<View>> & {
26
+ declare const StyledBackdrop: import("@emotion/native").StyledComponent<Animated.AnimatedProps<import("react-native").PressableProps & import("react").RefAttributes<View>> & {
28
27
  children?: import("react").ReactNode;
29
28
  } & {
30
29
  theme?: import("@emotion/react").Theme | undefined;
31
30
  as?: import("react").ElementType<any> | undefined;
32
31
  }, {}, {}>;
33
- declare const StyledHeaderText: import("@emotion/native").StyledComponent<import("../../Typography/Title").TitleProps & {
34
- theme?: import("@emotion/react").Theme | undefined;
35
- as?: import("react").ElementType<any> | undefined;
36
- } & TextProps, {}, {}>;
37
- export { StyledHeaderText, StyledBackdrop, StyledContainer, StyledContainerInModal, StyledActionGroupContainer, StyledFAB, };
32
+ export { StyledActionGroupContainer, StyledBackdrop, StyledContainer, StyledContainerInModal, StyledFAB, };
@@ -9,6 +9,7 @@ export type ActionGroupHandles = {
9
9
  };
10
10
  export interface ActionGroupProps {
11
11
  /**
12
+ * @deprecated headerTitle will be removed in the next major release.
12
13
  * Title of the action group header.
13
14
  */
14
15
  headerTitle?: string;
@@ -16,6 +17,10 @@ export interface ActionGroupProps {
16
17
  * This function is called on pressing the FAB button.
17
18
  * */
18
19
  onPress?: () => void;
20
+ /**
21
+ * This function is called on pressing the FAB backdrop.
22
+ * */
23
+ onBackdropPress?: () => void;
19
24
  /**
20
25
  * Specify if the FAB button is in active state and the action group is shown.
21
26
  * */
@@ -1,6 +1,7 @@
1
1
  import type { GlobalTheme } from '../global';
2
2
  declare const getCardCarouselTheme: (theme: GlobalTheme) => {
3
3
  shadows: {
4
+ color: string;
4
5
  offset: {
5
6
  width: number;
6
7
  height: number;
@@ -10,7 +11,6 @@ declare const getCardCarouselTheme: (theme: GlobalTheme) => {
10
11
  elevation: number;
11
12
  };
12
13
  colors: {
13
- shadow: string;
14
14
  carouselItemBackground: string;
15
15
  };
16
16
  space: {
@@ -4,12 +4,10 @@ declare const getFABTheme: (theme: GlobalTheme) => {
4
4
  actionItem: number;
5
5
  };
6
6
  fonts: {
7
- header: string;
8
7
  actionItemText: string;
9
8
  title: string;
10
9
  };
11
10
  fontSizes: {
12
- header: number;
13
11
  actionItemText: number;
14
12
  title: number;
15
13
  };
@@ -18,13 +16,11 @@ declare const getFABTheme: (theme: GlobalTheme) => {
18
16
  buttonPressedBackground: string;
19
17
  buttonActiveBackground: string;
20
18
  icon: string;
21
- headerText: string;
22
19
  actionItemBackground: string;
23
20
  actionItemPressedBackground: string;
24
21
  backdropBackground: string;
25
22
  titleText: string;
26
23
  actionItemText: string;
27
- shadow: string;
28
24
  };
29
25
  sizes: {
30
26
  width: number;
@@ -33,7 +29,6 @@ declare const getFABTheme: (theme: GlobalTheme) => {
33
29
  iconContainerHeight: number;
34
30
  };
35
31
  lineHeights: {
36
- header: number;
37
32
  actionItemText: number;
38
33
  title: number;
39
34
  icon: number;
@@ -46,6 +41,7 @@ declare const getFABTheme: (theme: GlobalTheme) => {
46
41
  opacity: number;
47
42
  radius: number;
48
43
  elevation: number;
44
+ color: string;
49
45
  };
50
46
  space: {
51
47
  actionItemPadding: number;
@@ -54,8 +50,6 @@ declare const getFABTheme: (theme: GlobalTheme) => {
54
50
  actionItemTextPaddingLeft: number;
55
51
  buttonMarginTop: number;
56
52
  buttonMarginRight: number;
57
- headerTextMarginRight: number;
58
- headerTextMarginBottom: number;
59
53
  containerPadding: number;
60
54
  titleMarginHorizontal: number;
61
55
  };
@@ -20,7 +20,6 @@ declare const getListTheme: (theme: GlobalTheme) => {
20
20
  radii: {
21
21
  item: number;
22
22
  basicItem: number;
23
- cardShadow: number;
24
23
  leadingStatus: number;
25
24
  };
26
25
  widths: {
@@ -29,14 +28,18 @@ declare const getListTheme: (theme: GlobalTheme) => {
29
28
  opacity: {
30
29
  disabled: number;
31
30
  enabled: number;
32
- cardShadow: number;
33
31
  };
34
32
  shadows: {
35
- cardOffset: {
36
- width: number;
37
- height: number;
33
+ card: {
34
+ offset: {
35
+ width: number;
36
+ height: number;
37
+ };
38
+ elevation: number;
39
+ color: string;
40
+ radius: number;
41
+ opacity: number;
38
42
  };
39
- cardElevation: number;
40
43
  };
41
44
  };
42
45
  export default getListTheme;
@@ -8,7 +8,6 @@ declare const getToastTheme: (theme: GlobalTheme) => {
8
8
  notification: string;
9
9
  snackbar: string;
10
10
  divider: string;
11
- shadow: string;
12
11
  };
13
12
  radii: {
14
13
  default: number;
@@ -35,6 +34,7 @@ declare const getToastTheme: (theme: GlobalTheme) => {
35
34
  opacity: number;
36
35
  radius: number;
37
36
  elevation: number;
37
+ color: string;
38
38
  };
39
39
  };
40
40
  export default getToastTheme;