@hero-design/rn 8.71.0 → 8.72.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 (67) hide show
  1. package/.turbo/turbo-build.log +3 -3
  2. package/CHANGELOG.md +23 -0
  3. package/es/index.js +353 -208
  4. package/lib/index.js +353 -208
  5. package/package.json +1 -1
  6. package/src/components/Accordion/AccordionItem.tsx +1 -1
  7. package/src/components/Accordion/__tests__/__snapshots__/AccordionItem.spec.tsx.snap +8 -8
  8. package/src/components/Accordion/__tests__/__snapshots__/index.spec.tsx.snap +12 -12
  9. package/src/components/Badge/StyledBadge.tsx +17 -2
  10. package/src/components/Badge/__tests__/Badge.spec.tsx +15 -0
  11. package/src/components/Badge/__tests__/__snapshots__/Badge.spec.tsx.snap +187 -0
  12. package/src/components/Badge/index.tsx +20 -36
  13. package/src/components/Badge/types.ts +55 -0
  14. package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/StyledLoadingIndicator.spec.tsx.snap +3 -3
  15. package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/index.spec.tsx.snap +9 -9
  16. package/src/components/Button/__tests__/__snapshots__/Button.spec.tsx.snap +7 -7
  17. package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +6 -6
  18. package/src/components/FAB/FAB.tsx +6 -1
  19. package/src/components/FAB/Pair/StyledFAB.tsx +19 -0
  20. package/src/components/FAB/Pair/__tests__/__snapshots__/index.spec.tsx.snap +276 -0
  21. package/src/components/FAB/Pair/__tests__/index.spec.tsx +39 -0
  22. package/src/components/FAB/Pair/index.tsx +46 -0
  23. package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +31 -14
  24. package/src/components/FAB/index.tsx +3 -1
  25. package/src/components/Progress/ProgressStep.tsx +3 -1
  26. package/src/components/Progress/StyledStep.tsx +13 -11
  27. package/src/components/Progress/__tests__/__snapshots__/index.spec.js.snap +215 -4
  28. package/src/components/Progress/__tests__/index.spec.js +16 -4
  29. package/src/components/Search/SearchOneLine.tsx +7 -1
  30. package/src/components/Search/SearchSuffixIcon.tsx +12 -1
  31. package/src/components/Search/SearchTwoLine.tsx +7 -1
  32. package/src/components/Search/StyledSearch.tsx +42 -16
  33. package/src/components/Search/__tests__/SearchOneLine.spec.tsx +30 -0
  34. package/src/components/Search/__tests__/SearchTwoLine.spec.tsx +15 -0
  35. package/src/components/Search/__tests__/__snapshots__/SearchOneLine.spec.tsx.snap +166 -10
  36. package/src/components/Search/__tests__/__snapshots__/SearchSuffixIcon.spec.tsx.snap +3 -0
  37. package/src/components/Search/__tests__/__snapshots__/SearchTwoLine.spec.tsx.snap +182 -2
  38. package/src/components/Switch/__tests__/__snapshots__/StyledSwitch.spec.tsx.snap +1 -1
  39. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +9 -0
  40. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabsHeader.spec.tsx.snap +6 -0
  41. package/src/components/Tabs/__tests__/__snapshots__/TabWithBadge.spec.tsx.snap +3 -0
  42. package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +9 -0
  43. package/src/components/Toolbar/StyledToolbar.tsx +11 -0
  44. package/src/components/Toolbar/ToolbarItem.tsx +3 -3
  45. package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.spec.tsx.snap +24 -4
  46. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +46 -9
  47. package/src/theme/components/badge.ts +10 -1
  48. package/src/theme/components/button.ts +2 -2
  49. package/src/theme/components/fab.ts +3 -0
  50. package/src/theme/components/search.ts +30 -5
  51. package/src/theme/components/switch.ts +2 -2
  52. package/src/theme/components/toolbar.ts +1 -1
  53. package/stats/8.72.0/rn-stats.html +4844 -0
  54. package/types/components/Badge/StyledBadge.d.ts +9 -1
  55. package/types/components/Badge/index.d.ts +3 -34
  56. package/types/components/Badge/types.d.ts +53 -0
  57. package/types/components/FAB/Pair/StyledFAB.d.ts +12 -0
  58. package/types/components/FAB/Pair/index.d.ts +16 -0
  59. package/types/components/FAB/index.d.ts +1 -0
  60. package/types/components/Progress/StyledStep.d.ts +2 -0
  61. package/types/components/Search/SearchOneLine.d.ts +5 -0
  62. package/types/components/Search/SearchTwoLine.d.ts +5 -0
  63. package/types/components/Search/StyledSearch.d.ts +7 -2
  64. package/types/components/Toolbar/StyledToolbar.d.ts +9 -2
  65. package/types/theme/components/badge.d.ts +8 -0
  66. package/types/theme/components/fab.d.ts +3 -0
  67. package/types/theme/components/search.d.ts +31 -5
@@ -2,6 +2,7 @@ import { Animated } from 'react-native';
2
2
  declare type ThemeIntent = 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'archived';
3
3
  declare type ThemePadding = 'narrowContent' | 'wideContent';
4
4
  declare type ThemeSize = 'medium' | 'small';
5
+ declare type ThemeVariant = 'filled' | 'outlined';
5
6
  declare const StyledView: import("@emotion/native").StyledComponent<Animated.AnimatedProps<import("react-native").ViewProps & import("react").RefAttributes<import("react-native").View>> & {
6
7
  theme?: import("@emotion/react").Theme | undefined;
7
8
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
@@ -9,6 +10,7 @@ declare const StyledView: import("@emotion/native").StyledComponent<Animated.Ani
9
10
  themeIntent: ThemeIntent;
10
11
  themePadding: ThemePadding;
11
12
  themeSize: ThemeSize;
13
+ themeVariant: ThemeVariant;
12
14
  }, {}, {}>;
13
15
  declare const StyledText: import("@emotion/native").StyledComponent<import("../Typography/Caption").CaptionProps & {
14
16
  theme?: import("@emotion/react").Theme | undefined;
@@ -22,4 +24,10 @@ declare const StyledStatus: import("@emotion/native").StyledComponent<Animated.A
22
24
  } & {
23
25
  themeIntent: ThemeIntent;
24
26
  }, {}, {}>;
25
- export { StyledView, StyledText, StyledStatus };
27
+ declare const StyledIcon: import("@emotion/native").StyledComponent<import("../Icon").IconProps & {
28
+ theme?: import("@emotion/react").Theme | undefined;
29
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
30
+ } & {
31
+ themeSize: ThemeSize;
32
+ }, {}, {}>;
33
+ export { StyledView, StyledText, StyledStatus, StyledIcon };
@@ -1,37 +1,6 @@
1
- import { Animated } from 'react-native';
2
- import React from 'react';
3
- import type { StyleProp, ViewStyle } from 'react-native';
4
- export interface BadgeProps extends React.ComponentProps<typeof Animated.View> {
5
- /**
6
- * Content of the Badge.
7
- */
8
- content: string | number;
9
- /**
10
- * Whether the Badge is visible.
11
- */
12
- visible?: boolean;
13
- /**
14
- * The maximum number displayed on the badge. If number exceeds this value, `${max}+` are displayed instead. (Only applied when content is number.)
15
- */
16
- max?: number;
17
- /**
18
- * Visual intent color to apply to Badge.
19
- */
20
- intent?: 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'archived';
21
- /**
22
- * Additional style.
23
- */
24
- style?: StyleProp<ViewStyle>;
25
- /**
26
- * Testing id of the component.
27
- */
28
- testID?: string;
29
- /**
30
- * Size of the badge
31
- */
32
- size?: 'medium' | 'small';
33
- }
34
- declare const _default: (({ content: originalContent, visible, max, intent, style, testID, size, ...nativeProps }: BadgeProps) => JSX.Element) & {
1
+ import { BasicBadgeProps, IconBadgeProps } from './types';
2
+ export declare type BadgeProps = BasicBadgeProps | IconBadgeProps;
3
+ declare const _default: (({ content: originalContent, visible, max, intent, style, testID, size, variant, icon, ...nativeProps }: BadgeProps) => JSX.Element) & {
35
4
  Status: ({ children, visible, intent, style, testID, ...nativeProps }: import("./Status").StatusProps) => JSX.Element;
36
5
  };
37
6
  export default _default;
@@ -0,0 +1,53 @@
1
+ import { Animated, StyleProp, ViewStyle } from 'react-native';
2
+ import { IconName } from '../Icon';
3
+ interface BaseBadgeProps extends React.ComponentProps<typeof Animated.View> {
4
+ /**
5
+ * Whether the Badge is visible.
6
+ */
7
+ visible?: boolean;
8
+ /**
9
+ * The maximum number displayed on the badge. If number exceeds this value, `${max}+` are displayed instead. (Only applied when content is number.)
10
+ */
11
+ max?: number;
12
+ /**
13
+ * Visual intent color to apply to Badge.
14
+ */
15
+ intent?: 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'archived';
16
+ /**
17
+ * Additional style.
18
+ */
19
+ style?: StyleProp<ViewStyle>;
20
+ /**
21
+ * Testing id of the component.
22
+ */
23
+ testID?: string;
24
+ /**
25
+ * Size of the badge
26
+ */
27
+ size?: 'medium' | 'small';
28
+ /**
29
+ * Variant of the badge
30
+ */
31
+ variant?: 'filled' | 'outlined';
32
+ }
33
+ export interface BasicBadgeProps extends BaseBadgeProps {
34
+ /**
35
+ * Content of the Badge.
36
+ */
37
+ content: string | number;
38
+ /**
39
+ * Use Icon as the content of the Badge.
40
+ */
41
+ icon?: never;
42
+ }
43
+ export interface IconBadgeProps extends BaseBadgeProps {
44
+ /**
45
+ * Content of the Badge.
46
+ */
47
+ content?: never;
48
+ /**
49
+ * Use Icon as the content of the Badge.
50
+ */
51
+ icon: IconName;
52
+ }
53
+ export {};
@@ -0,0 +1,12 @@
1
+ declare const StyledFABPairWrapper: import("@emotion/native").StyledComponent<import("../../Box").BoxProps & {
2
+ theme?: import("@emotion/react").Theme | undefined;
3
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
4
+ }, {}, {}>;
5
+ declare const StyledFAB: import("@emotion/native").StyledComponent<import("../FAB").FABProps & import("react").RefAttributes<import("../FAB").FABHandles> & {
6
+ theme?: import("@emotion/react").Theme | undefined;
7
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
8
+ } & {
9
+ iconOnly?: boolean | undefined;
10
+ isLast?: boolean | undefined;
11
+ }, {}, {}>;
12
+ export { StyledFABPairWrapper, StyledFAB };
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { ViewProps } from 'react-native';
3
+ import { FABProps } from '../FAB';
4
+ export declare type InnerFABProps = Pick<FABProps, 'icon' | 'title' | 'onPress' | 'testID'>;
5
+ export interface FABPairProps extends ViewProps {
6
+ /**
7
+ * Configuration for the main FAB.
8
+ */
9
+ fabConfig: InnerFABProps;
10
+ /**
11
+ * Callback to be called when the cancel FAB is pressed.
12
+ */
13
+ onCancel: () => void;
14
+ }
15
+ declare const Pair: ({ fabConfig, onCancel, ...props }: FABPairProps) => React.JSX.Element;
16
+ export default Pair;
@@ -1,4 +1,5 @@
1
1
  declare const _default: import("react").ForwardRefExoticComponent<import("./FAB").FABProps & import("react").RefAttributes<import("./FAB").FABHandles>> & {
2
2
  ActionGroup: import("react").ForwardRefExoticComponent<import("./ActionGroup").ActionGroupProps & import("react").RefAttributes<import("./ActionGroup").ActionGroupHandles>>;
3
+ Pair: ({ fabConfig, onCancel, ...props }: import("./Pair").FABPairProps) => import("react").JSX.Element;
3
4
  };
4
5
  export default _default;
@@ -17,5 +17,7 @@ declare const StyledSingleStepContainer: import("@emotion/native").StyledCompone
17
17
  declare const StyledSingleStep: import("@emotion/native").StyledComponent<import("../Box").BoxProps & {
18
18
  theme?: import("@emotion/react").Theme | undefined;
19
19
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
20
+ } & {
21
+ themeState: 'complete' | 'incomplete';
20
22
  }, {}, {}>;
21
23
  export { StyledStepContainer, StyledStep, StyledSingleStepContainer, StyledSingleStep, };
@@ -49,6 +49,11 @@ interface SearchOneLineProps extends NativeTextInputProps {
49
49
  * Whether to hide the character count.
50
50
  * */
51
51
  renderInputValue?: (inputProps: NativeTextInputProps) => React.ReactNode;
52
+ /**
53
+ * Variant of the SearchTwo
54
+ * @default 'basic'
55
+ */
56
+ variant?: 'basic' | 'reversed';
52
57
  }
53
58
  export declare const getState: ({ disabled, editable, isEmptyValue, }: {
54
59
  disabled?: boolean | undefined;
@@ -26,6 +26,11 @@ interface SearchTwoLineProps {
26
26
  * Testing id of the component.
27
27
  */
28
28
  testID?: string;
29
+ /**
30
+ * Variant of the SearchTwo
31
+ * @default 'basic'
32
+ */
33
+ variant?: 'basic' | 'reversed';
29
34
  }
30
35
  declare const SearchTwoLine: (props: SearchTwoLineProps) => React.JSX.Element;
31
36
  export default SearchTwoLine;
@@ -1,5 +1,6 @@
1
1
  import { TextInput, View } from 'react-native';
2
2
  export declare type State = 'default' | 'filled' | 'disabled' | 'readonly';
3
+ export declare type Variant = 'basic' | 'reversed';
3
4
  export declare const StyledContainer: 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;
@@ -11,6 +12,7 @@ export declare const StyledInputContainer: import("@emotion/native").StyledCompo
11
12
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
12
13
  } & {
13
14
  themeFocused: boolean;
15
+ themeVariant: Variant;
14
16
  }, {}, {
15
17
  ref?: import("react").Ref<View> | undefined;
16
18
  }>;
@@ -38,7 +40,10 @@ export declare const StyledHandlerContainer: import("@emotion/native").StyledCom
38
40
  }, {}, {
39
41
  ref?: import("react").Ref<View> | undefined;
40
42
  }>;
41
- export declare const StyledBadge: import("@emotion/native").StyledComponent<import("../Badge").BadgeProps & {
43
+ export declare const StyledBadge: import("@emotion/native").StyledComponent<(import("../Badge/types").BasicBadgeProps & {
42
44
  theme?: import("@emotion/react").Theme | undefined;
43
45
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
44
- }, {}, {}>;
46
+ }) | (import("../Badge/types").IconBadgeProps & {
47
+ theme?: import("@emotion/react").Theme | undefined;
48
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
49
+ }), {}, {}>;
@@ -1,5 +1,6 @@
1
1
  import { TouchableOpacity, View } from 'react-native';
2
2
  import type { ViewProps } from 'react-native';
3
+ import { BodyProps } from '../Typography/Body';
3
4
  declare const ToolbarWrapper: import("@emotion/native").StyledComponent<ViewProps & {
4
5
  theme?: import("@emotion/react").Theme | undefined;
5
6
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
@@ -26,8 +27,14 @@ declare const IconButtonWrapper: import("@emotion/native").StyledComponent<ViewP
26
27
  }, {}, {
27
28
  ref?: import("react").Ref<View> | undefined;
28
29
  }>;
29
- declare const IconButtonLabel: import("@emotion/native").StyledComponent<import("../Typography/Body").BodyProps & {
30
+ declare const IconButtonLabel: import("@emotion/native").StyledComponent<BodyProps & {
30
31
  theme?: import("@emotion/react").Theme | undefined;
31
32
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
32
33
  }, {}, {}>;
33
- export { ToolbarWrapper, ToolbarGroupWrapper, ToolbarItemWrapper, IconButtonWrapper, IconButtonLabel, };
34
+ declare const StyledLabel: import("@emotion/native").StyledComponent<BodyProps & {
35
+ theme?: import("@emotion/react").Theme | undefined;
36
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
37
+ } & {
38
+ intent: Exclude<BodyProps['intent'], undefined>;
39
+ }, {}, {}>;
40
+ export { ToolbarWrapper, ToolbarGroupWrapper, ToolbarItemWrapper, IconButtonWrapper, IconButtonLabel, StyledLabel, };
@@ -8,6 +8,7 @@ declare const getBadgeTheme: (theme: GlobalTheme) => {
8
8
  warning: string;
9
9
  archived: string;
10
10
  text: string;
11
+ border: string;
11
12
  };
12
13
  fonts: {
13
14
  medium: string;
@@ -16,6 +17,10 @@ declare const getBadgeTheme: (theme: GlobalTheme) => {
16
17
  fontSizes: {
17
18
  medium: number;
18
19
  small: number;
20
+ icon: {
21
+ medium: number;
22
+ small: number;
23
+ };
19
24
  };
20
25
  sizes: {
21
26
  medium: {
@@ -43,6 +48,9 @@ declare const getBadgeTheme: (theme: GlobalTheme) => {
43
48
  medium: number;
44
49
  small: number;
45
50
  };
51
+ borderWidths: {
52
+ default: number;
53
+ };
46
54
  };
47
55
  export declare type BadgeThemeType = ReturnType<typeof getBadgeTheme>;
48
56
  export default getBadgeTheme;
@@ -27,6 +27,8 @@ declare const getFABTheme: (theme: GlobalTheme) => {
27
27
  height: number;
28
28
  iconContainerWidth: number;
29
29
  iconContainerHeight: number;
30
+ fabPairHeight: number;
31
+ fabPairIconOnlyWidth: number;
30
32
  };
31
33
  lineHeights: {
32
34
  actionItemText: number;
@@ -52,6 +54,7 @@ declare const getFABTheme: (theme: GlobalTheme) => {
52
54
  buttonMarginRight: number;
53
55
  containerPadding: number;
54
56
  titleMarginHorizontal: number;
57
+ fabPairMarginRight: number;
55
58
  };
56
59
  };
57
60
  declare type GetFABThemeReturnType = ReturnType<typeof getFABTheme>;
@@ -1,15 +1,25 @@
1
1
  import type { GlobalTheme } from '../global';
2
2
  declare const getSearchTheme: (theme: GlobalTheme) => {
3
3
  colors: {
4
- containerBackground: string;
5
- surfixBackground: string;
4
+ basic: {
5
+ containerBackground: string;
6
+ border: string;
7
+ focusedBorder: string;
8
+ };
9
+ reversed: {
10
+ containerBackground: string;
11
+ border: string;
12
+ focusedBorder: string;
13
+ };
14
+ suffixBackground: string;
6
15
  text: string;
7
- borders: string;
16
+ shadow: string;
8
17
  };
9
18
  space: {
10
19
  containerHorizontalPadding: number;
11
20
  containerVerticalPadding: number;
12
21
  inputHorizontalMargin: number;
22
+ inputVerticalPadding: number;
13
23
  prefixHorizontalPadding: number;
14
24
  surfixPadding: number;
15
25
  badgeTop: number;
@@ -23,8 +33,14 @@ declare const getSearchTheme: (theme: GlobalTheme) => {
23
33
  };
24
34
  borderWidths: {
25
35
  container: {
26
- normal: number;
27
- focused: number;
36
+ basic: {
37
+ normal: number;
38
+ focused: number;
39
+ };
40
+ reversed: {
41
+ normal: number;
42
+ focused: number;
43
+ };
28
44
  };
29
45
  };
30
46
  radii: {
@@ -34,5 +50,15 @@ declare const getSearchTheme: (theme: GlobalTheme) => {
34
50
  sizes: {
35
51
  surfixSize: number;
36
52
  };
53
+ shadows: {
54
+ offset: {
55
+ width: number;
56
+ height: number;
57
+ };
58
+ opacity: number;
59
+ radius: number;
60
+ elevation: number;
61
+ color: string;
62
+ };
37
63
  };
38
64
  export default getSearchTheme;