@hero-design/rn 8.120.2 → 8.121.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 (45) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/es/index.js +281 -32
  3. package/jest.config.js +1 -1
  4. package/lib/index.js +280 -30
  5. package/package.json +5 -1
  6. package/rollup.config.mjs +2 -0
  7. package/src/components/Icon/AnimatedIcon.tsx +7 -40
  8. package/src/components/Icon/GradientIcon/index.tsx +71 -0
  9. package/src/components/Icon/SpinWrapper.tsx +39 -0
  10. package/src/components/Icon/index.tsx +22 -1
  11. package/src/components/Toolbar/StyledToolbar.tsx +2 -2
  12. package/src/components/Typography/Body/StyledBody.tsx +2 -2
  13. package/src/components/Typography/Body/index.tsx +20 -2
  14. package/src/components/Typography/Caption/StyledCaption.tsx +2 -2
  15. package/src/components/Typography/Caption/index.tsx +20 -2
  16. package/src/components/Typography/GradientText/index.tsx +85 -0
  17. package/src/components/Typography/Label/StyledLabel.tsx +2 -2
  18. package/src/components/Typography/Label/index.tsx +20 -2
  19. package/src/components/Typography/Title/StyledTitle.tsx +2 -2
  20. package/src/components/Typography/Title/index.tsx +32 -13
  21. package/src/components/Typography/types.ts +3 -1
  22. package/src/components/Typography/utils.ts +31 -0
  23. package/src/theme/global/colors/gradients.ts +78 -0
  24. package/src/theme/global/colors/types.ts +22 -0
  25. package/src/theme/global/index.ts +5 -2
  26. package/testUtils/setup.tsx +34 -0
  27. package/types/components/Icon/GradientIcon/index.d.ts +12 -0
  28. package/types/components/Icon/SpinWrapper.d.ts +9 -0
  29. package/types/components/Icon/index.d.ts +1 -1
  30. package/types/components/TextInput/StyledTextInput.d.ts +1 -1
  31. package/types/components/Toolbar/StyledToolbar.d.ts +4 -4
  32. package/types/components/Typography/Body/StyledBody.d.ts +2 -2
  33. package/types/components/Typography/Body/index.d.ts +1 -1
  34. package/types/components/Typography/Caption/StyledCaption.d.ts +2 -2
  35. package/types/components/Typography/Caption/index.d.ts +1 -1
  36. package/types/components/Typography/GradientText/index.d.ts +7 -0
  37. package/types/components/Typography/Label/StyledLabel.d.ts +2 -2
  38. package/types/components/Typography/Label/index.d.ts +1 -1
  39. package/types/components/Typography/Title/StyledTitle.d.ts +2 -2
  40. package/types/components/Typography/Title/index.d.ts +1 -1
  41. package/types/components/Typography/types.d.ts +2 -1
  42. package/types/components/Typography/utils.d.ts +2 -0
  43. package/types/theme/global/colors/gradients.d.ts +3 -0
  44. package/types/theme/global/colors/types.d.ts +21 -0
  45. package/types/theme/global/index.d.ts +3 -2
@@ -44,7 +44,7 @@ declare const StyledMaxLengthMessage: import("@emotion/native").StyledComponent<
44
44
  } & {
45
45
  themeState: State;
46
46
  }, {}, {}>;
47
- declare const StyledHelperText: ({ children, fontWeight, intent, allowFontScaling, fontStyle, ...nativeProps }: import("../..").CaptionProps) => import("react").JSX.Element;
47
+ declare const StyledHelperText: ({ children, fontWeight, intent, allowFontScaling, fontStyle, style, testID, ...nativeProps }: import("../..").CaptionProps) => import("react").JSX.Element;
48
48
  declare const StyledTextInput: import("@emotion/native").StyledComponent<import("react-native").TextInputProps & {
49
49
  theme?: import("@emotion/react").Theme;
50
50
  as?: React.ElementType;
@@ -1,6 +1,6 @@
1
1
  import { TextInput, View } from 'react-native';
2
2
  import type { ViewProps } from 'react-native';
3
- import type { BodyProps } from '../Typography/Body';
3
+ import type { TypographyColorIntent } from '../Typography/types';
4
4
  export type ToolbarMessageState = 'default' | 'filled' | 'disabled' | 'readonly';
5
5
  declare const ToolbarWrapper: import("@emotion/native").StyledComponent<ViewProps & {
6
6
  theme?: import("@emotion/react").Theme;
@@ -26,15 +26,15 @@ declare const IconButtonWrapper: import("@emotion/native").StyledComponent<ViewP
26
26
  }, {}, {
27
27
  ref?: import("react").Ref<View> | undefined;
28
28
  }>;
29
- declare const IconButtonLabel: import("@emotion/native").StyledComponent<BodyProps & {
29
+ declare const IconButtonLabel: import("@emotion/native").StyledComponent<import("../..").BodyProps & {
30
30
  theme?: import("@emotion/react").Theme;
31
31
  as?: React.ElementType;
32
32
  }, {}, {}>;
33
- declare const StyledLabel: import("@emotion/native").StyledComponent<BodyProps & {
33
+ declare const StyledLabel: import("@emotion/native").StyledComponent<import("../..").BodyProps & {
34
34
  theme?: import("@emotion/react").Theme;
35
35
  as?: React.ElementType;
36
36
  } & {
37
- intent: Exclude<BodyProps["intent"], undefined>;
37
+ intent: TypographyColorIntent;
38
38
  }, {}, {}>;
39
39
  declare const ToolbarMessageWrapper: import("@emotion/native").StyledComponent<ViewProps & {
40
40
  theme?: import("@emotion/react").Theme;
@@ -1,11 +1,11 @@
1
1
  import { Text } from 'react-native';
2
- import type { TypographyIntent } from '../types';
2
+ import type { TypographyColorIntent } from '../types';
3
3
  type ThemeVariant = 'small' | 'small-bold' | 'regular' | 'regular-bold';
4
4
  declare const StyledBody: import("@emotion/native").StyledComponent<import("react-native").TextProps & {
5
5
  theme?: import("@emotion/react").Theme;
6
6
  as?: React.ElementType;
7
7
  } & {
8
- themeIntent: TypographyIntent;
8
+ themeIntent: TypographyColorIntent;
9
9
  themeTypeface: "neutral" | "playful";
10
10
  themeVariant: ThemeVariant;
11
11
  themeIsItalic?: boolean;
@@ -34,5 +34,5 @@ export interface BodyProps extends NativeTextProps {
34
34
  */
35
35
  fontStyle?: 'normal' | 'italic';
36
36
  }
37
- declare const Body: ({ children, intent, allowFontScaling, typeface, variant, fontStyle, ...nativeProps }: BodyProps) => React.JSX.Element;
37
+ declare const Body: ({ children, intent, allowFontScaling, typeface, variant, fontStyle, style, testID, ...nativeProps }: BodyProps) => React.JSX.Element;
38
38
  export default Body;
@@ -1,11 +1,11 @@
1
1
  import { Text } from 'react-native';
2
- import type { TypographyIntent } from '../types';
2
+ import type { TypographyColorIntent } from '../types';
3
3
  declare const StyledCaption: import("@emotion/native").StyledComponent<import("react-native").TextProps & {
4
4
  theme?: import("@emotion/react").Theme;
5
5
  as?: React.ElementType;
6
6
  } & {
7
7
  themeFontWeight: "regular" | "semi-bold";
8
- themeIntent: TypographyIntent;
8
+ themeIntent: TypographyColorIntent;
9
9
  themeIsItalic?: boolean;
10
10
  }, {}, {
11
11
  ref?: import("react").Ref<Text> | undefined;
@@ -28,5 +28,5 @@ export interface CaptionProps extends NativeTextProps {
28
28
  */
29
29
  fontStyle?: 'normal' | 'italic';
30
30
  }
31
- declare const Caption: ({ children, fontWeight, intent, allowFontScaling, fontStyle, ...nativeProps }: CaptionProps) => React.JSX.Element;
31
+ declare const Caption: ({ children, fontWeight, intent, allowFontScaling, fontStyle, style, testID, ...nativeProps }: CaptionProps) => React.JSX.Element;
32
32
  export default Caption;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { AccessibilityProps } from 'react-native';
3
+ interface GradientTextProps extends AccessibilityProps {
4
+ children: React.ReactNode;
5
+ }
6
+ declare const GradientText: ({ children, ...accessibilityProps }: GradientTextProps) => React.JSX.Element;
7
+ export default GradientText;
@@ -1,10 +1,10 @@
1
1
  import { Text } from 'react-native';
2
- import type { TypographyIntent } from '../types';
2
+ import type { TypographyColorIntent } from '../types';
3
3
  declare const StyledLabel: import("@emotion/native").StyledComponent<import("react-native").TextProps & {
4
4
  theme?: import("@emotion/react").Theme;
5
5
  as?: React.ElementType;
6
6
  } & {
7
- themeIntent: TypographyIntent;
7
+ themeIntent: TypographyColorIntent;
8
8
  themeIsItalic?: boolean;
9
9
  }, {}, {
10
10
  ref?: import("react").Ref<Text> | undefined;
@@ -24,5 +24,5 @@ export interface LabelProps extends NativeTextProps {
24
24
  */
25
25
  fontStyle?: 'normal' | 'italic';
26
26
  }
27
- declare const Label: ({ children, intent, allowFontScaling, fontStyle, ...nativeProps }: LabelProps) => React.JSX.Element;
27
+ declare const Label: ({ children, intent, allowFontScaling, fontStyle, style, testID, ...nativeProps }: LabelProps) => React.JSX.Element;
28
28
  export default Label;
@@ -1,11 +1,11 @@
1
1
  import { Text } from 'react-native';
2
- import type { TypographyIntent } from '../types';
2
+ import type { TypographyColorIntent } from '../types';
3
3
  type ThemeLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
4
4
  declare const StyledTitle: import("@emotion/native").StyledComponent<import("react-native").TextProps & {
5
5
  theme?: import("@emotion/react").Theme;
6
6
  as?: React.ElementType;
7
7
  } & {
8
- themeIntent: TypographyIntent;
8
+ themeIntent: TypographyColorIntent;
9
9
  themeLevel: ThemeLevel;
10
10
  themeTypeface: "neutral" | "playful";
11
11
  themeIsItalic?: boolean;
@@ -34,5 +34,5 @@ export interface TitleProps extends NativeTextProps {
34
34
  */
35
35
  fontStyle?: 'normal' | 'italic';
36
36
  }
37
- declare const Title: ({ children, intent, allowFontScaling, level, typeface, fontStyle, ...nativeProps }: TitleProps) => React.JSX.Element;
37
+ declare const Title: ({ children, intent, allowFontScaling, level, typeface, fontStyle, style, testID, ...nativeProps }: TitleProps) => React.JSX.Element;
38
38
  export default Title;
@@ -3,4 +3,5 @@ export declare const FONTWEIGHT_MAP: {
3
3
  readonly regular: "regular";
4
4
  readonly 'semi-bold': "semiBold";
5
5
  };
6
- export type TypographyIntent = 'body' | 'subdued' | 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'danger' | 'inverted' | 'archived' | 'disabled' | 'muted' | 'inactive';
6
+ export type TypographyColorIntent = 'body' | 'subdued' | 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'danger' | 'inverted' | 'archived' | 'disabled' | 'muted' | 'inactive';
7
+ export type TypographyIntent = TypographyColorIntent | 'ai';
@@ -0,0 +1,2 @@
1
+ import type { AccessibilityProps, TextProps } from 'react-native';
2
+ export declare const pickAccessibilityProps: (props: TextProps) => AccessibilityProps;
@@ -0,0 +1,3 @@
1
+ import type { Gradients, SystemPalette } from './types';
2
+ declare const getGradients: (systemPalette: SystemPalette) => Gradients;
3
+ export default getGradients;
@@ -1,3 +1,4 @@
1
+ import type { ColorValue } from 'react-native';
1
2
  export type GlobalSystemPalette = {
2
3
  defaultGlobalSurface: string;
3
4
  onDefaultGlobalSurface: string;
@@ -49,6 +50,26 @@ export type BrandSystemPalette = {
49
50
  decorativeSecondary?: string;
50
51
  decorativeSecondarySurface?: string;
51
52
  };
53
+ export type GradientPoint = {
54
+ x: number;
55
+ y: number;
56
+ };
57
+ export type GradientToken = {
58
+ angle: number;
59
+ start: GradientPoint;
60
+ end: GradientPoint;
61
+ colors: readonly [ColorValue, ColorValue, ...ColorValue[]];
62
+ locations: readonly [number, number, ...number[]];
63
+ opacity?: number;
64
+ backgroundFallback?: string;
65
+ };
66
+ export type Gradients = {
67
+ aiDiagonal: GradientToken;
68
+ aiDiagonal8: GradientToken;
69
+ aiDiagonal16: GradientToken;
70
+ aiDiagonal24: GradientToken;
71
+ aiHorizontal: GradientToken;
72
+ };
52
73
  export type ThemeMode = 'light' | 'dark';
53
74
  type ThemeName = 'swagLight' | 'swagLightJobs' | 'ehWorkDark' | 'ehWork' | 'ehJobs';
54
75
  export type SystemPalette = GlobalSystemPalette & BrandSystemPalette & {
@@ -11,9 +11,10 @@ import ehWorkDarkSystemPalette from './colors/ehWorkDark';
11
11
  import ehWorkSystemPalette from './colors/ehWork';
12
12
  import ehJobsSystemPalette from './colors/ehJobs';
13
13
  import type { Scale } from './scale';
14
- import type { SystemPalette } from './colors/types';
14
+ import type { GradientToken, Gradients, SystemPalette } from './colors/types';
15
15
  declare const getGlobalTheme: (scale: Scale, systemPalette: SystemPalette) => {
16
16
  colors: {
17
+ gradients: Gradients;
17
18
  defaultGlobalSurface: string;
18
19
  onDefaultGlobalSurface: string;
19
20
  neutralGlobalSurface: string;
@@ -74,5 +75,5 @@ declare const getGlobalTheme: (scale: Scale, systemPalette: SystemPalette) => {
74
75
  shadows: import("./shadows/types").ShadowPalette;
75
76
  };
76
77
  type GlobalTheme = ReturnType<typeof getGlobalTheme>;
77
- export type { GlobalTheme, Scale, SystemPalette };
78
+ export type { GlobalTheme, GradientToken, Gradients, Scale, SystemPalette };
78
79
  export { getGlobalTheme, defaultScale, swagSystemPalette, swagLightSystemPalette, swagLightJobsSystemPalette, swagDarkSystemPalette, workSystemPalette, jobsSystemPalette, walletSystemPalette, eBensSystemPalette, ehWorkDarkSystemPalette, ehWorkSystemPalette, ehJobsSystemPalette, };