@hero-design/rn 7.8.0 → 7.10.1

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 (76) hide show
  1. package/.turbo/turbo-build.log +8 -8
  2. package/assets/fonts/hero-icons.ttf +0 -0
  3. package/es/index.js +741 -258
  4. package/lib/assets/fonts/hero-icons.ttf +0 -0
  5. package/lib/index.js +740 -257
  6. package/package.json +2 -2
  7. package/src/components/Button/Button.tsx +10 -2
  8. package/src/components/Button/LoadingIndicator/StyledLoadingIndicator.tsx +7 -1
  9. package/src/components/Button/LoadingIndicator/__tests__/StyledLoadingIndicator.spec.tsx +3 -0
  10. package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/StyledLoadingIndicator.spec.tsx.snap +60 -0
  11. package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/index.spec.tsx.snap +363 -0
  12. package/src/components/Button/LoadingIndicator/__tests__/index.spec.tsx +3 -0
  13. package/src/components/Button/LoadingIndicator/index.tsx +4 -1
  14. package/src/components/Button/StyledButton.tsx +57 -1
  15. package/src/components/Button/UtilityButton/__tests__/__snapshots__/index.spec.tsx.snap +167 -0
  16. package/src/components/Button/UtilityButton/__tests__/index.spec.tsx +55 -0
  17. package/src/components/Button/UtilityButton/index.tsx +53 -0
  18. package/src/components/Button/UtilityButton/styled.tsx +25 -0
  19. package/src/components/Button/__tests__/Button.spec.tsx +3 -0
  20. package/src/components/Button/__tests__/StyledButton.spec.tsx +18 -0
  21. package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +468 -0
  22. package/src/components/Button/index.tsx +3 -0
  23. package/src/components/Card/DataCard/StyledDataCard.tsx +1 -3
  24. package/src/components/Card/DataCard/__tests__/__snapshots__/StyledDataCard.spec.tsx.snap +0 -1
  25. package/src/components/Card/DataCard/__tests__/__snapshots__/index.spec.tsx.snap +0 -5
  26. package/src/components/Card/StyledCard.tsx +1 -3
  27. package/src/components/Card/__tests__/__snapshots__/StyledCard.spec.tsx.snap +0 -1
  28. package/src/components/Icon/HeroIcon/index.tsx +3 -1
  29. package/src/components/Icon/HeroIcon/selection.json +1 -1
  30. package/src/components/Icon/IconList.ts +2 -0
  31. package/src/components/Icon/index.tsx +2 -1
  32. package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +248 -94
  33. package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +248 -94
  34. package/src/components/TextInput/StyledTextInput.tsx +133 -11
  35. package/src/components/TextInput/__tests__/StyledTextInput.spec.tsx +143 -7
  36. package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +922 -15
  37. package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +2078 -0
  38. package/src/components/TextInput/__tests__/index.spec.tsx +302 -11
  39. package/src/components/TextInput/index.tsx +232 -28
  40. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +73 -3
  41. package/src/theme/components/button.ts +6 -0
  42. package/src/theme/components/card.ts +5 -1
  43. package/src/theme/components/icon.ts +1 -0
  44. package/src/theme/components/textInput.ts +62 -3
  45. package/src/theme/global/colors.ts +1 -0
  46. package/src/types.ts +8 -1
  47. package/types/components/Button/Button.d.ts +2 -2
  48. package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +1 -1
  49. package/types/components/Button/LoadingIndicator/index.d.ts +1 -1
  50. package/types/components/Button/StyledButton.d.ts +1 -1
  51. package/types/components/{Select/MultiSelect/__tests__/StyledMultiSelect.spec.d.ts → Button/UtilityButton/__tests__/index.spec.d.ts} +0 -0
  52. package/types/components/Button/UtilityButton/index.d.ts +23 -0
  53. package/types/components/Button/UtilityButton/styled.d.ts +17 -0
  54. package/types/components/Button/index.d.ts +2 -0
  55. package/types/components/Icon/HeroIcon/index.d.ts +1 -1
  56. package/types/components/Icon/IconList.d.ts +1 -1
  57. package/types/components/Icon/index.d.ts +1 -1
  58. package/types/components/Icon/utils.d.ts +1 -1
  59. package/types/components/TextInput/StyledTextInput.d.ts +82 -3
  60. package/types/components/TextInput/index.d.ts +33 -5
  61. package/types/theme/components/button.d.ts +6 -0
  62. package/types/theme/components/card.d.ts +3 -0
  63. package/types/theme/components/icon.d.ts +1 -0
  64. package/types/theme/components/textInput.d.ts +61 -2
  65. package/types/theme/global/colors.d.ts +1 -0
  66. package/types/theme/global/index.d.ts +1 -0
  67. package/types/types.d.ts +2 -1
  68. package/.expo/README.md +0 -15
  69. package/.expo/packager-info.json +0 -10
  70. package/.expo/prebuild/cached-packages.json +0 -4
  71. package/.expo/settings.json +0 -10
  72. package/.expo/xcodebuild-error.log +0 -2
  73. package/.expo/xcodebuild.log +0 -11199
  74. package/types/components/Select/MultiSelect/Footer.d.ts +0 -5
  75. package/types/components/Select/MultiSelect/StyledMultiSelect.d.ts +0 -26
  76. package/types/components/Select/MultiSelect/types.d.ts +0 -5
@@ -1,4 +1,6 @@
1
+ import React from 'react';
1
2
  import { TextInputProps as NativeTextInputProps, StyleProp, ViewStyle, TextStyle } from 'react-native';
3
+ import { Variant } from './StyledTextInput';
2
4
  import { IconName } from '../Icon';
3
5
  export interface TextInputProps extends NativeTextInputProps {
4
6
  /**
@@ -6,13 +8,13 @@ export interface TextInputProps extends NativeTextInputProps {
6
8
  */
7
9
  label?: string;
8
10
  /**
9
- * Name of Icon to render on the left side of the input, before the user's cursor.
11
+ * Name of Icon or ReactElement to render on the left side of the input, before the user's cursor.
10
12
  */
11
- prefix?: IconName;
13
+ prefix?: IconName | React.ReactElement;
12
14
  /**
13
- * Name of Icon to render on the right side of the input.
15
+ * Name of Icon or ReactElement to render on the right side of the input.
14
16
  */
15
- suffix?: IconName;
17
+ suffix?: IconName | React.ReactElement;
16
18
  /**
17
19
  * Additional wrapper style.
18
20
  */
@@ -29,6 +31,32 @@ export interface TextInputProps extends NativeTextInputProps {
29
31
  * Accessibility label for the input (Android).
30
32
  */
31
33
  accessibilityLabelledBy?: string;
34
+ /**
35
+ * Error message to display.
36
+ */
37
+ error?: string;
38
+ /**
39
+ * Whether the input is required, if true, an asterisk will be appended to the label.
40
+ * */
41
+ required?: boolean;
42
+ /**
43
+ * Placeholder text to display.
44
+ * */
45
+ placeholder?: string;
46
+ /**
47
+ * Whether the input is editable.
48
+ * */
49
+ editable?: boolean;
50
+ disabled?: boolean;
51
+ maxLength?: number;
52
+ helpText?: string;
32
53
  }
33
- declare const TextInput: ({ label, prefix, suffix, style, textStyle, testID, accessibilityLabelledBy, ...nativeProps }: TextInputProps) => JSX.Element;
54
+ export declare const getVariant: ({ disabled, error, editable, isFocused, isEmptyValue, }: {
55
+ disabled?: boolean | undefined;
56
+ error?: string | undefined;
57
+ editable?: boolean | undefined;
58
+ isFocused?: boolean | undefined;
59
+ isEmptyValue?: boolean | undefined;
60
+ }) => Variant;
61
+ declare const TextInput: ({ label, prefix, suffix, style, textStyle, testID, accessibilityLabelledBy, error, required, editable, disabled, maxLength, helpText, value, ...nativeProps }: TextInputProps) => JSX.Element;
34
62
  export default TextInput;
@@ -8,12 +8,15 @@ declare const getButtonTheme: (theme: GlobalTheme) => {
8
8
  };
9
9
  fontSize: {
10
10
  default: number;
11
+ utility: number;
12
+ textVariant: number;
11
13
  };
12
14
  sizes: {
13
15
  iconSize: number;
14
16
  };
15
17
  radii: {
16
18
  default: number;
19
+ utilityRadii: number;
17
20
  };
18
21
  colors: {
19
22
  primary: string;
@@ -27,6 +30,7 @@ declare const getButtonTheme: (theme: GlobalTheme) => {
27
30
  disabledBorder: string;
28
31
  disabledBackground: string;
29
32
  invertedText: string;
33
+ utilityBackground: string;
30
34
  };
31
35
  lineHeight: {
32
36
  default: number;
@@ -34,6 +38,8 @@ declare const getButtonTheme: (theme: GlobalTheme) => {
34
38
  space: {
35
39
  buttonPadding: number;
36
40
  iconPadding: number;
41
+ utilityPadding: number;
42
+ utilityIconPadding: number;
37
43
  };
38
44
  };
39
45
  export default getButtonTheme;
@@ -10,6 +10,9 @@ declare const getCardTheme: (theme: GlobalTheme) => {
10
10
  danger: string;
11
11
  };
12
12
  };
13
+ sizes: {
14
+ indicatorWidth: number;
15
+ };
13
16
  radii: {
14
17
  default: number;
15
18
  };
@@ -8,6 +8,7 @@ declare const getIconTheme: (theme: GlobalTheme) => {
8
8
  success: string;
9
9
  warning: string;
10
10
  disabledText: string;
11
+ invertedText: string;
11
12
  };
12
13
  sizes: {
13
14
  xsmall: number;
@@ -2,20 +2,79 @@ import { GlobalTheme } from '../global';
2
2
  declare const getTextInputTheme: (theme: GlobalTheme) => {
3
3
  colors: {
4
4
  labelBackground: string;
5
- border: string;
5
+ asterisks: {
6
+ default: string;
7
+ error: string;
8
+ disabled: string;
9
+ readonly: string;
10
+ filled: string;
11
+ focused: string;
12
+ };
13
+ error: string;
14
+ placeholderIfNotFocused: string;
15
+ placeholderIfFocued: string;
16
+ label: string;
17
+ readonlyLabel: string;
18
+ disabledLabel: string;
19
+ text: string;
20
+ borders: {
21
+ default: string;
22
+ error: string;
23
+ disabled: string;
24
+ readonly: string;
25
+ filled: string;
26
+ focused: string;
27
+ };
28
+ labels: {
29
+ default: string;
30
+ error: string;
31
+ disabled: string;
32
+ readonly: string;
33
+ filled: string;
34
+ focused: string;
35
+ };
36
+ labelsInsideTextInput: {
37
+ default: string;
38
+ error: string;
39
+ disabled: string;
40
+ readonly: string;
41
+ filled: string;
42
+ focused: string;
43
+ };
44
+ maxLengthLabels: {
45
+ default: string;
46
+ error: string;
47
+ disabled: string;
48
+ readonly: string;
49
+ filled: string;
50
+ focused: string;
51
+ };
6
52
  };
7
53
  space: {
8
54
  containerPadding: number;
9
55
  labelLeft: number;
10
56
  labelTop: number;
57
+ labelPaddingBottom: number;
11
58
  labelHorizontalPadding: number;
12
59
  inputHorizontalMargin: number;
60
+ containerMarginVertical: number;
61
+ errorContainerMarginLeft: number;
62
+ errorContainerMarginRight: number;
63
+ errorMarginLeft: number;
64
+ maxLengthLabelMarginLeft: number;
13
65
  };
14
66
  fontSizes: {
15
67
  text: number;
68
+ labelInsideTextInput: number;
69
+ error: number;
70
+ maxLength: number;
71
+ asteriskLabel: number;
16
72
  };
17
73
  borderWidths: {
18
- container: number;
74
+ container: {
75
+ normal: number;
76
+ focused: number;
77
+ };
19
78
  };
20
79
  radii: {
21
80
  container: number;
@@ -25,6 +25,7 @@ declare const systemPalette: {
25
25
  backgroundLight: string;
26
26
  backgroundDark: string;
27
27
  text: string;
28
+ subduedText: string;
28
29
  disabledText: string;
29
30
  disabledLightText: string;
30
31
  invertedText: string;
@@ -28,6 +28,7 @@ declare const getGlobalTheme: (scale: Scale, systemPalette: SystemPalette) => {
28
28
  backgroundLight: string;
29
29
  backgroundDark: string;
30
30
  text: string;
31
+ subduedText: string;
31
32
  disabledText: string;
32
33
  disabledLightText: string;
33
34
  invertedText: string;
package/types/types.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { BottomNavigationTabType } from './components/BottomNavigation';
2
2
  import { IconName } from './components/Icon';
3
3
  import { TabType } from './components/Tabs';
4
+ import { TextInputProps } from './components/TextInput';
4
5
  import { Theme } from './theme';
5
- export type { BottomNavigationTabType, IconName, TabType, Theme };
6
+ export type { BottomNavigationTabType, IconName, TabType, Theme, TextInputProps, };
package/.expo/README.md DELETED
@@ -1,15 +0,0 @@
1
- > Why do I have a folder named ".expo" in my project?
2
-
3
- The ".expo" folder is created when an Expo project is started using "expo start" command.
4
-
5
- > What do the files contain?
6
-
7
- - "devices.json": contains information about devices that have recently opened this project. This is used to populate the "Development sessions" list in your development builds.
8
- - "packager-info.json": contains port numbers and process PIDs that are used to serve the application to the mobile device/simulator.
9
- - "settings.json": contains the server configuration that is used to serve the application manifest.
10
-
11
- > Should I commit the ".expo" folder?
12
-
13
- No, you should not share the ".expo" folder. It does not contain any information that is relevant for other developers working on the project, it is specific to your machine.
14
-
15
- Upon project creation, the ".expo" folder is already added to your ".gitignore" file.
@@ -1,10 +0,0 @@
1
- {
2
- "devToolsPort": 19002,
3
- "expoServerPort": null,
4
- "packagerPort": 19000,
5
- "packagerPid": null,
6
- "expoServerNgrokUrl": null,
7
- "packagerNgrokUrl": null,
8
- "ngrokPid": null,
9
- "webpackServerPort": null
10
- }
@@ -1,4 +0,0 @@
1
- {
2
- "dependencies": "75a9d3d29379eb983d76968e2681af38c930ef79",
3
- "devDependencies": "843b58fa49ff6a9ac1aaf4f6f32cb9da88f61475"
4
- }
@@ -1,10 +0,0 @@
1
- {
2
- "hostType": "lan",
3
- "lanType": "ip",
4
- "dev": true,
5
- "minify": false,
6
- "urlRandomness": null,
7
- "https": false,
8
- "scheme": null,
9
- "devClient": false
10
- }
@@ -1,2 +0,0 @@
1
- 2022-08-15 16:30:43.312 xcodebuild[51962:564141] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2
- 2022-08-15 16:30:43.312 xcodebuild[51962:564141] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore