@hero-design/rn 8.59.0 → 8.60.1-alpha.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 (35) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/CHANGELOG.md +15 -0
  3. package/es/index.js +240 -116
  4. package/lib/index.js +240 -116
  5. package/package.json +2 -2
  6. package/src/components/AnimatedScroller/AnimatedFAB.tsx +99 -49
  7. package/src/components/AnimatedScroller/AnimatedScrollable.tsx +18 -3
  8. package/src/components/AnimatedScroller/__tests__/ScrollablesWithFAB.spec.tsx +30 -9
  9. package/src/components/AnimatedScroller/__tests__/__snapshots__/ScrollablesWithFAB.spec.tsx.snap +474 -447
  10. package/src/components/FAB/ActionGroup/ActionItem.tsx +3 -1
  11. package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +216 -211
  12. package/src/components/FAB/ActionGroup/index.tsx +34 -28
  13. package/src/components/FAB/FAB.tsx +102 -41
  14. package/src/components/FAB/StyledFAB.tsx +10 -8
  15. package/src/components/FAB/__tests__/__snapshots__/StyledFAB.spec.tsx.snap +34 -38
  16. package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +191 -170
  17. package/src/components/Radio/Radio.tsx +16 -4
  18. package/src/components/Radio/RadioGroup.tsx +10 -3
  19. package/src/components/Radio/StyledRadio.tsx +20 -3
  20. package/src/components/Radio/__tests__/Radio.spec.tsx +46 -13
  21. package/src/components/Radio/__tests__/RadioGroup.spec.tsx +40 -7
  22. package/src/components/Radio/__tests__/__snapshots__/Radio.spec.tsx.snap +446 -77
  23. package/src/components/Radio/__tests__/__snapshots__/RadioGroup.spec.tsx.snap +946 -112
  24. package/src/components/Radio/types.ts +6 -1
  25. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +8 -2
  26. package/src/theme/components/radio.ts +8 -2
  27. package/types/components/AnimatedScroller/AnimatedFAB.d.ts +3 -1
  28. package/types/components/AnimatedScroller/AnimatedScrollable.d.ts +1 -1
  29. package/types/components/FAB/StyledFAB.d.ts +4 -6
  30. package/types/components/Radio/Radio.d.ts +9 -1
  31. package/types/components/Radio/RadioGroup.d.ts +5 -1
  32. package/types/components/Radio/StyledRadio.d.ts +11 -1
  33. package/types/components/Radio/index.d.ts +1 -1
  34. package/types/components/Radio/types.d.ts +1 -0
  35. package/types/theme/components/radio.d.ts +7 -1
@@ -1 +1,6 @@
1
- export type OptionType<T> = { value: T; text: string; key?: string };
1
+ export type OptionType<T> = {
2
+ value: T;
3
+ text: string;
4
+ subText?: string;
5
+ key?: string;
6
+ };
@@ -712,7 +712,12 @@ exports[`theme returns correct theme object 1`] = `
712
712
  "circle": 2,
713
713
  },
714
714
  "colors": {
715
- "circle": "#001f23",
715
+ "checked": "#ece8ef",
716
+ "circle": "#401960",
717
+ "intents": {
718
+ "dark": "#f6f6f7",
719
+ "light": "#ffffff",
720
+ },
716
721
  },
717
722
  "sizes": {
718
723
  "circle": 20,
@@ -720,7 +725,8 @@ exports[`theme returns correct theme object 1`] = `
720
725
  },
721
726
  "space": {
722
727
  "circleLeftMargin": 8,
723
- "groupTopMargin": 4,
728
+ "groupTopMarginMedium": 16,
729
+ "groupTopMarginSmall": 4,
724
730
  },
725
731
  },
726
732
  "rate": {
@@ -2,12 +2,18 @@ import type { GlobalTheme } from '../global';
2
2
 
3
3
  const getRadioTheme = (theme: GlobalTheme) => {
4
4
  const colors = {
5
- circle: theme.colors.onDefaultGlobalSurface,
5
+ circle: theme.colors.primary,
6
+ checked: theme.colors.highlightedSurface,
7
+ intents: {
8
+ light: theme.colors.defaultGlobalSurface,
9
+ dark: theme.colors.neutralGlobalSurface,
10
+ },
6
11
  };
7
12
 
8
13
  const space = {
9
14
  circleLeftMargin: theme.space.small,
10
- groupTopMargin: theme.space.xsmall,
15
+ groupTopMarginSmall: theme.space.xsmall,
16
+ groupTopMarginMedium: theme.space.medium,
11
17
  };
12
18
 
13
19
  const boundingBoxSize = theme.sizes.large;
@@ -5,6 +5,8 @@ import { FABProps } from '../FAB/FAB';
5
5
  interface AnimatedFABProps {
6
6
  fabProps: FABProps | ActionGroupProps;
7
7
  contentOffsetY: Animated.Value;
8
+ contentHeight: Animated.Value;
9
+ layoutHeight: Animated.Value;
8
10
  }
9
- declare const AnimatedFAB: ({ fabProps, contentOffsetY }: AnimatedFABProps) => React.JSX.Element;
11
+ declare const AnimatedFAB: ({ fabProps, contentOffsetY, contentHeight, layoutHeight, }: AnimatedFABProps) => React.JSX.Element;
10
12
  export default AnimatedFAB;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { FlatListProps, ScrollViewProps as RnScrollViewProps, SectionListProps } from 'react-native';
3
- import { FABProps } from '../FAB/FAB';
4
3
  import { ActionGroupProps } from '../FAB/ActionGroup';
4
+ import { FABProps } from '../FAB/FAB';
5
5
  export interface AnimatedScrollerProps<T> {
6
6
  /**
7
7
  * Scroll component, it can be ScrollView, FlatList or SectionList.
@@ -1,15 +1,13 @@
1
1
  /// <reference types="react" />
2
- import type { TextProps, TouchableHighlightProps } from 'react-native';
3
- import { TouchableHighlight } from 'react-native';
2
+ import type { TextProps } from 'react-native';
3
+ import { Animated, TouchableHighlight } from 'react-native';
4
4
  import type { IconProps } from '../Icon';
5
- declare const StyledFAB: import("@emotion/native").StyledComponent<TouchableHighlightProps & {
5
+ declare const StyledFAB: import("@emotion/native").StyledComponent<Animated.AnimatedProps<import("react-native").TouchableHighlightProps & import("react").RefAttributes<TouchableHighlight>> & {
6
6
  theme?: import("@emotion/react").Theme | undefined;
7
7
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
8
8
  } & {
9
9
  themeActive?: boolean | undefined;
10
- }, {}, {
11
- ref?: import("react").Ref<TouchableHighlight> | undefined;
12
- }>;
10
+ }, {}, {}>;
13
11
  declare const StyledFABIcon: import("@emotion/native").StyledComponent<IconProps & {
14
12
  theme?: import("@emotion/react").Theme | undefined;
15
13
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
@@ -17,10 +17,18 @@ export interface RadioProps {
17
17
  * Additional style.
18
18
  */
19
19
  style?: StyleProp<ViewStyle>;
20
+ /**
21
+ * Radio subtext.
22
+ */
23
+ subText?: string;
20
24
  /**
21
25
  * Testing id of the component.
22
26
  */
23
27
  testID?: string;
28
+ /**
29
+ * Idle background color of the Radio.
30
+ */
31
+ inactiveIntent?: 'light' | 'dark';
24
32
  }
25
- declare const Radio: ({ text, checked, onPress, style, testID, }: RadioProps) => ReactElement;
33
+ declare const Radio: ({ text, checked, onPress, style, subText, testID, inactiveIntent, }: RadioProps) => ReactElement;
26
34
  export default Radio;
@@ -27,6 +27,10 @@ export interface RadioGroupProps<T> {
27
27
  * Testing id of the component.
28
28
  */
29
29
  testID?: string;
30
+ /**
31
+ * Idle background color of the Radio.
32
+ */
33
+ inactiveIntent?: 'light' | 'dark';
30
34
  }
31
- declare const RadioGroup: <T>({ value, onPress, options, keyExtractor, style, testID, }: RadioGroupProps<T>) => ReactElement;
35
+ declare const RadioGroup: <T>({ value, onPress, options, keyExtractor, style, testID, inactiveIntent, }: RadioGroupProps<T>) => ReactElement;
32
36
  export default RadioGroup;
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { View } from 'react-native';
3
+ declare type RadioIntent = 'light' | 'dark';
3
4
  declare const Circle: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
4
5
  theme?: import("@emotion/react").Theme | undefined;
5
6
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
@@ -15,7 +16,16 @@ declare const InnerCircle: import("@emotion/native").StyledComponent<import("rea
15
16
  declare const Spacer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
16
17
  theme?: import("@emotion/react").Theme | undefined;
17
18
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
19
+ } & {
20
+ themeIntent: RadioIntent;
18
21
  }, {}, {
19
22
  ref?: import("react").Ref<View> | undefined;
20
23
  }>;
21
- export { Circle, InnerCircle, Spacer };
24
+ declare const StyledRadio: import("@emotion/native").StyledComponent<import("../List/ListItem").ListItemProps & {
25
+ theme?: import("@emotion/react").Theme | undefined;
26
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
27
+ } & {
28
+ themeIntent: RadioIntent;
29
+ themeChecked: boolean;
30
+ }, {}, {}>;
31
+ export { Circle, InnerCircle, Spacer, StyledRadio };
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  declare const CompoundRadio: {
3
- readonly Group: <T>({ value, onPress, options, keyExtractor, style, testID, }: import("./RadioGroup").RadioGroupProps<T>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
3
+ readonly Group: <T>({ value, onPress, options, keyExtractor, style, testID, inactiveIntent, }: import("./RadioGroup").RadioGroupProps<T>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
4
4
  };
5
5
  export default CompoundRadio;
@@ -1,5 +1,6 @@
1
1
  export declare type OptionType<T> = {
2
2
  value: T;
3
3
  text: string;
4
+ subText?: string;
4
5
  key?: string;
5
6
  };
@@ -9,10 +9,16 @@ declare const getRadioTheme: (theme: GlobalTheme) => {
9
9
  };
10
10
  space: {
11
11
  circleLeftMargin: number;
12
- groupTopMargin: number;
12
+ groupTopMarginSmall: number;
13
+ groupTopMarginMedium: number;
13
14
  };
14
15
  colors: {
15
16
  circle: string;
17
+ checked: string;
18
+ intents: {
19
+ light: string;
20
+ dark: string;
21
+ };
16
22
  };
17
23
  };
18
24
  export default getRadioTheme;