@hero-design/rn 8.75.0 → 8.76.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.
@@ -1,6 +1,7 @@
1
- import { TouchableOpacity, View } from 'react-native';
1
+ import { TextInput, TouchableOpacity, View } from 'react-native';
2
2
  import type { ViewProps } from 'react-native';
3
3
  import { BodyProps } from '../Typography/Body';
4
+ export declare type ToolbarMessageState = 'default' | 'filled' | 'disabled' | 'readonly';
4
5
  declare const ToolbarWrapper: import("@emotion/native").StyledComponent<ViewProps & {
5
6
  theme?: import("@emotion/react").Theme | undefined;
6
7
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
@@ -37,4 +38,34 @@ declare const StyledLabel: import("@emotion/native").StyledComponent<BodyProps &
37
38
  } & {
38
39
  intent: Exclude<BodyProps['intent'], undefined>;
39
40
  }, {}, {}>;
40
- export { ToolbarWrapper, ToolbarGroupWrapper, ToolbarItemWrapper, IconButtonWrapper, IconButtonLabel, StyledLabel, };
41
+ declare const ToolbarMessageWrapper: import("@emotion/native").StyledComponent<ViewProps & {
42
+ theme?: import("@emotion/react").Theme | undefined;
43
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
44
+ }, {}, {
45
+ ref?: import("react").Ref<View> | undefined;
46
+ }>;
47
+ export declare const StyledInputContainer: import("@emotion/native").StyledComponent<ViewProps & {
48
+ theme?: import("@emotion/react").Theme | undefined;
49
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
50
+ }, {}, {
51
+ ref?: import("react").Ref<View> | undefined;
52
+ }>;
53
+ export declare const StyledInput: import("@emotion/native").StyledComponent<import("react-native").TextInputProps & {
54
+ theme?: import("@emotion/react").Theme | undefined;
55
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
56
+ }, {}, {
57
+ ref?: import("react").Ref<TextInput> | undefined;
58
+ }>;
59
+ export declare const StyledPrefix: import("@emotion/native").StyledComponent<ViewProps & {
60
+ theme?: import("@emotion/react").Theme | undefined;
61
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
62
+ }, {}, {
63
+ ref?: import("react").Ref<View> | undefined;
64
+ }>;
65
+ export declare const StyledSuffix: import("@emotion/native").StyledComponent<ViewProps & {
66
+ theme?: import("@emotion/react").Theme | undefined;
67
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
68
+ }, {}, {
69
+ ref?: import("react").Ref<View> | undefined;
70
+ }>;
71
+ export { ToolbarWrapper, ToolbarGroupWrapper, ToolbarItemWrapper, IconButtonWrapper, IconButtonLabel, StyledLabel, ToolbarMessageWrapper, };
@@ -0,0 +1,59 @@
1
+ import React from 'react';
2
+ import { TextInput as RNTextInput } from 'react-native';
3
+ import type { TextInputProps as NativeTextInputProps, StyleProp, ViewStyle, TextStyle } from 'react-native';
4
+ import { ToolbarMessageState } from './StyledToolbar';
5
+ export declare type ToolbarMessageHandles = Pick<RNTextInput, 'focus' | 'clear' | 'blur' | 'isFocused' | 'setNativeProps'>;
6
+ export interface ToolbarMessageProps extends NativeTextInputProps {
7
+ /**
8
+ * Element to render on the left side of the input, before the user's cursor.
9
+ */
10
+ prefix?: React.ReactNode;
11
+ /**
12
+ * Element to render on the right side of the input.
13
+ */
14
+ suffix?: React.ReactNode;
15
+ /**
16
+ * Additional wrapper style.
17
+ */
18
+ style?: StyleProp<ViewStyle>;
19
+ /**
20
+ * Input text style.
21
+ */
22
+ textStyle?: StyleProp<TextStyle>;
23
+ /**
24
+ * Testing id of the component.
25
+ */
26
+ testID?: string;
27
+ /**
28
+ * Accessibility label for the input (Android).
29
+ */
30
+ accessibilityLabelledBy?: string;
31
+ /**
32
+ * Placeholder text to display.
33
+ * */
34
+ placeholder?: string;
35
+ /**
36
+ * Whether the input is editable.
37
+ * */
38
+ editable?: boolean;
39
+ /**
40
+ * Whether the input is disabled.
41
+ */
42
+ disabled?: boolean;
43
+ /**
44
+ * The max length of the input.
45
+ * If the max length is set, the input will display the current length and the max length.
46
+ * */
47
+ maxLength?: number;
48
+ /**
49
+ * Component ref.
50
+ */
51
+ ref?: React.Ref<ToolbarMessageHandles>;
52
+ }
53
+ export declare const getState: ({ disabled, editable, isEmptyValue, }: {
54
+ disabled?: boolean | undefined;
55
+ editable?: boolean | undefined;
56
+ isEmptyValue?: boolean | undefined;
57
+ }) => ToolbarMessageState;
58
+ declare const ToolbarMessage: React.ForwardRefExoticComponent<Omit<ToolbarMessageProps, "ref"> & React.RefAttributes<ToolbarMessageHandles>>;
59
+ export default ToolbarMessage;
@@ -9,5 +9,6 @@ export interface ToolbarProps extends Omit<ViewProps, 'style'> {
9
9
  }
10
10
  declare const _default: (({ children, ...rest }: ToolbarProps) => React.JSX.Element) & {
11
11
  Group: ({ align, items }: import("./ToolbarGroup").ToolbarGroupProps) => React.JSX.Element;
12
+ Message: React.ForwardRefExoticComponent<Omit<import("./ToolbarMessage").ToolbarMessageProps, "ref"> & React.RefAttributes<import("./ToolbarMessage").ToolbarMessageHandles>>;
12
13
  };
13
14
  export default _default;
@@ -11,21 +11,37 @@ declare const getToolbarTheme: (theme: GlobalTheme) => {
11
11
  error: string;
12
12
  disabled: string;
13
13
  iconButtonBackground: string;
14
+ inputContainerBackground: string;
14
15
  };
15
16
  space: {
16
17
  verticalPadding: number;
17
18
  horizontalPadding: number;
18
19
  iconButtonLabelMarginLeft: number;
19
20
  iconButtonWrapperPadding: number;
21
+ messageWrapperMarginHorizontal: number;
22
+ messageWrapperPaddingVertical: number;
23
+ messageWrapperPaddingHorizontal: number;
24
+ messageInputPaddingHorizontal: number;
25
+ messageInputPaddingVertical: number;
26
+ affixInnerMargin: number;
20
27
  };
21
28
  borderWidths: {
22
29
  default: number;
23
30
  };
24
31
  sizes: {
25
32
  itemWrapperHeight: number;
33
+ messageWrapperHeight: number;
34
+ messageInputHeight: number;
26
35
  };
27
36
  radii: {
28
37
  iconButtonWrapperBorderRadius: number;
38
+ messageContainer: number;
39
+ };
40
+ fontSizes: {
41
+ text: number;
42
+ };
43
+ fonts: {
44
+ text: string;
29
45
  };
30
46
  };
31
47
  export default getToolbarTheme;