react-native-earl-accessory-view 1.0.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.
@@ -0,0 +1,17 @@
1
+ /**
2
+ * react-native-earl-accessory-view
3
+ *
4
+ * A keyboard input preview bar for React Native.
5
+ * Works on iOS, Android, and Web.
6
+ *
7
+ * @author ORDOVEZ, E,R
8
+ * @license MIT
9
+ */
10
+ export { AccessoryView, ACCESSORY_VIEW_NATIVE_ID } from "./AccessoryView";
11
+ export { DismissButton } from "./DismissButton";
12
+ export { CharacterCounter } from "./CharacterCounter";
13
+ export { ActionButton } from "./ActionButton";
14
+ export { useKeyboardAccessory } from "./useKeyboardAccessory";
15
+ export type { AccessoryViewProps, AccessoryActionButton, DismissButtonProps, CharacterCounterProps, KeyboardAccessoryState, UseKeyboardAccessoryOptions, Position, CharCountPosition, DismissButtonPosition, } from "./types";
16
+ export { AccessoryView as default } from "./AccessoryView";
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAG1E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG9D,YAAY,EACX,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,2BAA2B,EAC3B,QAAQ,EACR,iBAAiB,EACjB,qBAAqB,GACrB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,aAAa,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ /**
3
+ * react-native-earl-accessory-view
4
+ *
5
+ * A keyboard input preview bar for React Native.
6
+ * Works on iOS, Android, and Web.
7
+ *
8
+ * @author ORDOVEZ, E,R
9
+ * @license MIT
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.default = exports.useKeyboardAccessory = exports.ActionButton = exports.CharacterCounter = exports.DismissButton = exports.ACCESSORY_VIEW_NATIVE_ID = exports.AccessoryView = void 0;
13
+ // ─── Main Component ──────────────────────────────────────────────
14
+ var AccessoryView_1 = require("./AccessoryView");
15
+ Object.defineProperty(exports, "AccessoryView", { enumerable: true, get: function () { return AccessoryView_1.AccessoryView; } });
16
+ Object.defineProperty(exports, "ACCESSORY_VIEW_NATIVE_ID", { enumerable: true, get: function () { return AccessoryView_1.ACCESSORY_VIEW_NATIVE_ID; } });
17
+ // ─── Sub-Components ──────────────────────────────────────────────
18
+ var DismissButton_1 = require("./DismissButton");
19
+ Object.defineProperty(exports, "DismissButton", { enumerable: true, get: function () { return DismissButton_1.DismissButton; } });
20
+ var CharacterCounter_1 = require("./CharacterCounter");
21
+ Object.defineProperty(exports, "CharacterCounter", { enumerable: true, get: function () { return CharacterCounter_1.CharacterCounter; } });
22
+ var ActionButton_1 = require("./ActionButton");
23
+ Object.defineProperty(exports, "ActionButton", { enumerable: true, get: function () { return ActionButton_1.ActionButton; } });
24
+ // ─── Hook ────────────────────────────────────────────────────────
25
+ var useKeyboardAccessory_1 = require("./useKeyboardAccessory");
26
+ Object.defineProperty(exports, "useKeyboardAccessory", { enumerable: true, get: function () { return useKeyboardAccessory_1.useKeyboardAccessory; } });
27
+ // ─── Default Export ──────────────────────────────────────────────
28
+ var AccessoryView_2 = require("./AccessoryView");
29
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return AccessoryView_2.AccessoryView; } });
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAEH,oEAAoE;AACpE,iDAA0E;AAAjE,8GAAA,aAAa,OAAA;AAAE,yHAAA,wBAAwB,OAAA;AAEhD,oEAAoE;AACpE,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AACtB,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AACzB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AAErB,oEAAoE;AACpE,+DAA8D;AAArD,4HAAA,oBAAoB,OAAA;AAe7B,oEAAoE;AACpE,iDAA2D;AAAlD,wGAAA,aAAa,OAAW"}
@@ -0,0 +1,173 @@
1
+ /**
2
+ * Default styles for all accessory view components.
3
+ * Platform-specific shadow and elevation are handled automatically.
4
+ */
5
+ export declare const styles: {
6
+ outerContainer: {
7
+ position: "absolute";
8
+ left: number;
9
+ right: number;
10
+ bottom: number;
11
+ zIndex: number;
12
+ };
13
+ iosContainer: {
14
+ position: "relative";
15
+ };
16
+ container: {
17
+ shadowColor: string;
18
+ shadowOffset: {
19
+ width: number;
20
+ height: number;
21
+ };
22
+ shadowOpacity: number;
23
+ shadowRadius: number;
24
+ elevation?: undefined;
25
+ backgroundColor: string;
26
+ borderTopWidth: number;
27
+ borderTopColor: string;
28
+ } | {
29
+ elevation: number;
30
+ shadowColor?: undefined;
31
+ shadowOffset?: undefined;
32
+ shadowOpacity?: undefined;
33
+ shadowRadius?: undefined;
34
+ backgroundColor: string;
35
+ borderTopWidth: number;
36
+ borderTopColor: string;
37
+ };
38
+ contentContainer: {
39
+ flexDirection: "row";
40
+ alignItems: "center";
41
+ justifyContent: "space-between";
42
+ paddingHorizontal: number;
43
+ height: number;
44
+ };
45
+ contentContainerReverse: {
46
+ flexDirection: "row-reverse";
47
+ };
48
+ previewValue: {
49
+ flex: number;
50
+ fontSize: number;
51
+ fontWeight: "400";
52
+ color: string;
53
+ letterSpacing: number;
54
+ };
55
+ previewPlaceholder: {
56
+ flex: number;
57
+ fontSize: number;
58
+ fontWeight: "400";
59
+ color: string;
60
+ fontStyle: "italic";
61
+ };
62
+ previewScroll: {
63
+ flex: number;
64
+ };
65
+ previewScrollContent: {
66
+ alignItems: "center";
67
+ flexGrow: number;
68
+ };
69
+ previewInput: {
70
+ flex: number;
71
+ fontSize: number;
72
+ fontWeight: "400";
73
+ color: string;
74
+ letterSpacing: number;
75
+ padding: number;
76
+ margin: number;
77
+ minWidth: "100%";
78
+ };
79
+ label: {
80
+ fontSize: number;
81
+ fontWeight: "600";
82
+ color: string;
83
+ marginRight: number;
84
+ textTransform: "uppercase";
85
+ letterSpacing: number;
86
+ };
87
+ text: {
88
+ flex: number;
89
+ fontSize: number;
90
+ fontWeight: "500";
91
+ color: string;
92
+ letterSpacing: number;
93
+ };
94
+ textRight: {
95
+ textAlign: "right";
96
+ };
97
+ dismissButton: {
98
+ minWidth: number;
99
+ minHeight: number;
100
+ alignItems: "center";
101
+ justifyContent: "center";
102
+ borderRadius: number;
103
+ marginLeft: number;
104
+ };
105
+ dismissButtonLeft: {
106
+ marginLeft: number;
107
+ marginRight: number;
108
+ };
109
+ dismissButtonText: {
110
+ fontSize: number;
111
+ fontWeight: "600";
112
+ color: string;
113
+ lineHeight: number;
114
+ };
115
+ dismissButtonPressed: {
116
+ opacity: number;
117
+ backgroundColor: string;
118
+ };
119
+ charCountContainer: {
120
+ paddingHorizontal: number;
121
+ paddingBottom: number;
122
+ paddingTop: number;
123
+ };
124
+ charCountContainerLeft: {
125
+ alignItems: "flex-start";
126
+ };
127
+ charCountContainerRight: {
128
+ alignItems: "flex-end";
129
+ };
130
+ charCountContainerCenter: {
131
+ alignItems: "center";
132
+ };
133
+ charCountText: {
134
+ fontSize: number;
135
+ fontWeight: "400";
136
+ color: string;
137
+ letterSpacing: number;
138
+ };
139
+ safeAreaSpacer: {
140
+ backgroundColor: string;
141
+ };
142
+ childrenContainer: {
143
+ flex: number;
144
+ alignSelf: "stretch";
145
+ justifyContent: "center";
146
+ };
147
+ actionButton: {
148
+ minWidth: number;
149
+ minHeight: number;
150
+ alignItems: "center";
151
+ justifyContent: "center";
152
+ borderRadius: number;
153
+ };
154
+ actionButtonLeft: {
155
+ marginRight: number;
156
+ };
157
+ actionButtonRight: {
158
+ marginLeft: number;
159
+ };
160
+ actionButtonPressed: {
161
+ opacity: number;
162
+ backgroundColor: string;
163
+ };
164
+ actionButtonDisabled: {
165
+ opacity: number;
166
+ };
167
+ actionButtonText: {
168
+ fontSize: number;
169
+ fontWeight: "600";
170
+ color: string;
171
+ };
172
+ };
173
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../src/styles.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgNjB,CAAC"}
package/dist/styles.js ADDED
@@ -0,0 +1,184 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.styles = void 0;
4
+ const react_native_1 = require("react-native");
5
+ /**
6
+ * Default styles for all accessory view components.
7
+ * Platform-specific shadow and elevation are handled automatically.
8
+ */
9
+ exports.styles = react_native_1.StyleSheet.create({
10
+ // ─── Outer Wrapper ─────────────────────────────────────────────────
11
+ outerContainer: {
12
+ position: "absolute",
13
+ left: 0,
14
+ right: 0,
15
+ bottom: 0,
16
+ zIndex: 9999,
17
+ },
18
+ // ─── iOS — InputAccessoryView handles positioning ──────────────────
19
+ iosContainer: {
20
+ position: "relative",
21
+ },
22
+ // ─── Main Container ────────────────────────────────────────────────
23
+ container: Object.assign({ backgroundColor: "#FFFFFF", borderTopWidth: react_native_1.StyleSheet.hairlineWidth, borderTopColor: "#E0E0E0" }, react_native_1.Platform.select({
24
+ ios: {
25
+ shadowColor: "#000000",
26
+ shadowOffset: { width: 0, height: -2 },
27
+ shadowOpacity: 0.08,
28
+ shadowRadius: 4,
29
+ },
30
+ android: {
31
+ elevation: 4,
32
+ },
33
+ default: {
34
+ // Web fallback
35
+ shadowColor: "#000000",
36
+ shadowOffset: { width: 0, height: -2 },
37
+ shadowOpacity: 0.08,
38
+ shadowRadius: 4,
39
+ },
40
+ })),
41
+ // ─── Content Row ───────────────────────────────────────────────────
42
+ contentContainer: {
43
+ flexDirection: "row",
44
+ alignItems: "center",
45
+ justifyContent: "space-between",
46
+ paddingHorizontal: 16,
47
+ height: 44,
48
+ },
49
+ contentContainerReverse: {
50
+ flexDirection: "row-reverse",
51
+ },
52
+ // ─── Preview Text ────────────────────────────────────────────────
53
+ previewValue: {
54
+ flex: 1,
55
+ fontSize: 15,
56
+ fontWeight: "400",
57
+ color: "#111111",
58
+ letterSpacing: 0.1,
59
+ },
60
+ previewPlaceholder: {
61
+ flex: 1,
62
+ fontSize: 15,
63
+ fontWeight: "400",
64
+ color: "#AAAAAA",
65
+ fontStyle: "italic",
66
+ },
67
+ previewScroll: {
68
+ flex: 1,
69
+ },
70
+ previewScrollContent: {
71
+ alignItems: "center",
72
+ flexGrow: 1,
73
+ },
74
+ previewInput: {
75
+ flex: 1,
76
+ fontSize: 15,
77
+ fontWeight: "400",
78
+ color: "#111111",
79
+ letterSpacing: 0.1,
80
+ padding: 0,
81
+ margin: 0,
82
+ minWidth: "100%",
83
+ },
84
+ label: {
85
+ fontSize: 12,
86
+ fontWeight: "600",
87
+ color: "#888888",
88
+ marginRight: 10,
89
+ textTransform: "uppercase",
90
+ letterSpacing: 0.5,
91
+ },
92
+ // ─── Text ──────────────────────────────────────────────────────────
93
+ text: {
94
+ flex: 1,
95
+ fontSize: 15,
96
+ fontWeight: "500",
97
+ color: "#333333",
98
+ letterSpacing: 0.2,
99
+ },
100
+ textRight: {
101
+ textAlign: "right",
102
+ },
103
+ // ─── Dismiss Button ────────────────────────────────────────────────
104
+ dismissButton: {
105
+ minWidth: 44,
106
+ minHeight: 44,
107
+ alignItems: "center",
108
+ justifyContent: "center",
109
+ borderRadius: 22,
110
+ marginLeft: 8,
111
+ },
112
+ dismissButtonLeft: {
113
+ marginLeft: 0,
114
+ marginRight: 8,
115
+ },
116
+ dismissButtonText: {
117
+ fontSize: 18,
118
+ fontWeight: "600",
119
+ color: "#666666",
120
+ lineHeight: 20,
121
+ },
122
+ dismissButtonPressed: {
123
+ opacity: 0.5,
124
+ backgroundColor: "rgba(0, 0, 0, 0.05)",
125
+ },
126
+ // ─── Character Counter ─────────────────────────────────────────────
127
+ charCountContainer: {
128
+ paddingHorizontal: 16,
129
+ paddingBottom: 6,
130
+ paddingTop: 2,
131
+ },
132
+ charCountContainerLeft: {
133
+ alignItems: "flex-start",
134
+ },
135
+ charCountContainerRight: {
136
+ alignItems: "flex-end",
137
+ },
138
+ charCountContainerCenter: {
139
+ alignItems: "center",
140
+ },
141
+ charCountText: {
142
+ fontSize: 11,
143
+ fontWeight: "400",
144
+ color: "#999999",
145
+ letterSpacing: 0.3,
146
+ },
147
+ // ─── Safe Area Spacer ──────────────────────────────────────────────
148
+ safeAreaSpacer: {
149
+ backgroundColor: "#FFFFFF",
150
+ },
151
+ // ─── Children wrapper ──────────────────────────────────────────────
152
+ childrenContainer: {
153
+ flex: 1,
154
+ alignSelf: "stretch",
155
+ justifyContent: "center",
156
+ },
157
+ // ─── Action Button ────────────────────────────────────────────────
158
+ actionButton: {
159
+ minWidth: 44,
160
+ minHeight: 44,
161
+ alignItems: "center",
162
+ justifyContent: "center",
163
+ borderRadius: 22,
164
+ },
165
+ actionButtonLeft: {
166
+ marginRight: 8,
167
+ },
168
+ actionButtonRight: {
169
+ marginLeft: 8,
170
+ },
171
+ actionButtonPressed: {
172
+ opacity: 0.5,
173
+ backgroundColor: "rgba(0, 0, 0, 0.05)",
174
+ },
175
+ actionButtonDisabled: {
176
+ opacity: 0.35,
177
+ },
178
+ actionButtonText: {
179
+ fontSize: 15,
180
+ fontWeight: "600",
181
+ color: "#007AFF",
182
+ },
183
+ });
184
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../src/styles.ts"],"names":[],"mappings":";;;AAAA,+CAAoD;AAEpD;;;GAGG;AACU,QAAA,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IACvC,sEAAsE;IACtE,cAAc,EAAE;QACf,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;QACT,MAAM,EAAE,IAAI;KACZ;IAED,sEAAsE;IACtE,YAAY,EAAE;QACb,QAAQ,EAAE,UAAmB;KAC7B;IAED,sEAAsE;IACtE,SAAS,kBACR,eAAe,EAAE,SAAS,EAC1B,cAAc,EAAE,yBAAU,CAAC,aAAa,EACxC,cAAc,EAAE,SAAS,IACtB,uBAAQ,CAAC,MAAM,CAAC;QAClB,GAAG,EAAE;YACJ,WAAW,EAAE,SAAS;YACtB,YAAY,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE;YACtC,aAAa,EAAE,IAAI;YACnB,YAAY,EAAE,CAAC;SACf;QACD,OAAO,EAAE;YACR,SAAS,EAAE,CAAC;SACZ;QACD,OAAO,EAAE;YACR,eAAe;YACf,WAAW,EAAE,SAAS;YACtB,YAAY,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE;YACtC,aAAa,EAAE,IAAI;YACnB,YAAY,EAAE,CAAC;SACf;KACD,CAAC,CACF;IAED,sEAAsE;IACtE,gBAAgB,EAAE;QACjB,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,eAAe;QAC/B,iBAAiB,EAAE,EAAE;QACrB,MAAM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AAgB,EAAE;QACjB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,SAAS;KAChB;CACD,CAAC,CAAC"}
@@ -0,0 +1,229 @@
1
+ import { ReactNode } from "react";
2
+ import { TextStyle, ViewStyle, StyleProp } from "react-native";
3
+ /**
4
+ * Position options for text and dismiss button placement.
5
+ */
6
+ export type Position = "left" | "right";
7
+ /**
8
+ * Position options for the character counter.
9
+ */
10
+ export type CharCountPosition = "left" | "right" | "center";
11
+ /**
12
+ * Dismiss button position — 'auto' places it opposite to the text.
13
+ */
14
+ export type DismissButtonPosition = "auto" | "left" | "right";
15
+ /**
16
+ * Configuration for a single action button in the accessory bar.
17
+ *
18
+ * Use action buttons to add custom functionality like sending messages,
19
+ * switching between text inputs, toggling formatting, etc.
20
+ */
21
+ export interface AccessoryActionButton {
22
+ /** Unique key for this button (used as React key). */
23
+ id: string;
24
+ /** Callback fired when the button is pressed. */
25
+ onPress: () => void;
26
+ /**
27
+ * Content to display inside the button.
28
+ * Can be a string (rendered as text), or any ReactNode (icons, images, etc.).
29
+ */
30
+ content: ReactNode | string;
31
+ /** Where to place this button. Default: 'right'. */
32
+ position?: Position;
33
+ /** Whether the button is disabled. Default: false. */
34
+ disabled?: boolean;
35
+ /** Style overrides for the button container. */
36
+ style?: StyleProp<ViewStyle>;
37
+ /** Style for text content (only used when `content` is a string). */
38
+ textStyle?: StyleProp<TextStyle>;
39
+ /** Accessibility label for the button. */
40
+ accessibilityLabel?: string;
41
+ /** Test ID for testing frameworks. */
42
+ testID?: string;
43
+ }
44
+ /**
45
+ * Props for the DismissButton sub-component.
46
+ */
47
+ export interface DismissButtonProps {
48
+ /** Whether the dismiss button is visible. */
49
+ visible?: boolean;
50
+ /** Callback when dismiss is pressed. Defaults to Keyboard.dismiss. */
51
+ onPress?: () => void;
52
+ /** Custom content to render inside the button (replaces default ×). */
53
+ children?: ReactNode;
54
+ /** Style for the button container. */
55
+ style?: StyleProp<ViewStyle>;
56
+ /** Style for the default × text. Only used when no children are provided. */
57
+ textStyle?: StyleProp<TextStyle>;
58
+ /** Size of the touchable hit area. Default: 44. */
59
+ hitSlop?: number;
60
+ /** Accessibility label. Default: 'Dismiss keyboard'. */
61
+ accessibilityLabel?: string;
62
+ /** Test ID for testing frameworks. */
63
+ testID?: string;
64
+ }
65
+ /**
66
+ * Props for the CharacterCounter sub-component.
67
+ */
68
+ export interface CharacterCounterProps {
69
+ /** Current character count. */
70
+ current: number;
71
+ /** Maximum character limit. */
72
+ max: number;
73
+ /** Position of the counter. Default: 'right'. */
74
+ position?: CharCountPosition;
75
+ /** Style overrides for the counter text. */
76
+ style?: StyleProp<TextStyle>;
77
+ /** Container style overrides. */
78
+ containerStyle?: StyleProp<ViewStyle>;
79
+ /** Percentage threshold (0-1) at which the counter turns warning color. Default: 0.9. */
80
+ warningThreshold?: number;
81
+ /** Color when approaching the limit. Default: '#FF9800'. */
82
+ warningColor?: string;
83
+ /** Color when over the limit. Default: '#F44336'. */
84
+ errorColor?: string;
85
+ /** Default color. Default: '#999999'. */
86
+ defaultColor?: string;
87
+ /** Format function for custom display. Default: (current, max) => `${current}/${max}`. */
88
+ formatLabel?: (current: number, max: number) => string;
89
+ /** Test ID for testing frameworks. */
90
+ testID?: string;
91
+ }
92
+ /**
93
+ * Main AccessoryView component props.
94
+ */
95
+ export interface AccessoryViewProps {
96
+ /** The current input value to preview above the keyboard. */
97
+ value?: string;
98
+ /** Placeholder text shown when value is empty. Default: 'Type something...' */
99
+ placeholder?: string;
100
+ /** Style overrides for the preview value text. */
101
+ valueStyle?: StyleProp<TextStyle>;
102
+ /** Style overrides for the placeholder text. */
103
+ placeholderStyle?: StyleProp<TextStyle>;
104
+ /** Whether the preview text is editable (enables paste and direct editing). Default: true. */
105
+ editable?: boolean;
106
+ /** Called when the preview value changes (e.g. user pastes or edits in the preview). */
107
+ onValueChange?: (newValue: string) => void;
108
+ /** Called when the preview area is tapped. Typically used to focus the original TextInput. */
109
+ onPress?: () => void;
110
+ /** Optional static label (e.g. field name) displayed alongside the preview. */
111
+ label?: string;
112
+ /** Style overrides for the label text. */
113
+ labelStyle?: StyleProp<TextStyle>;
114
+ /** Position of the preview text. Default: 'left'. */
115
+ textPosition?: Position;
116
+ /** Style overrides for the text wrapper. */
117
+ textStyle?: StyleProp<TextStyle>;
118
+ /** Custom content — when provided, overrides the default preview layout entirely. */
119
+ children?: ReactNode;
120
+ /**
121
+ * Array of action buttons to display in the accessory bar.
122
+ *
123
+ * Each button can perform any function (send, switch input, navigate, etc.)
124
+ * and display any icon or text. Buttons are placed according to their
125
+ * `position` ('left' or 'right').
126
+ *
127
+ * When `actionButtons` are provided, the dismiss button is hidden by default
128
+ * unless `showDismissButton` is explicitly set to `true`.
129
+ *
130
+ * @example
131
+ * ```tsx
132
+ * <AccessoryView
133
+ * value={text}
134
+ * actionButtons={[
135
+ * { id: 'send', onPress: handleSend, content: <SendIcon /> },
136
+ * { id: 'attach', onPress: handleAttach, content: '📎', position: 'left' },
137
+ * ]}
138
+ * />
139
+ * ```
140
+ */
141
+ actionButtons?: AccessoryActionButton[];
142
+ /** Whether to show the dismiss (×) button. Default: true. */
143
+ showDismissButton?: boolean;
144
+ /** Position for the dismiss button. 'auto' places it opposite to textPosition. Default: 'auto'. */
145
+ dismissButtonPosition?: DismissButtonPosition;
146
+ /** Callback when dismiss is pressed. Defaults to Keyboard.dismiss(). */
147
+ onDismiss?: () => void;
148
+ /** Custom content to render as the dismiss button (replaces default ×). */
149
+ dismissButtonContent?: ReactNode;
150
+ /** Style for the dismiss button container. */
151
+ dismissButtonStyle?: StyleProp<ViewStyle>;
152
+ /** Style for the default dismiss button × text. */
153
+ dismissButtonTextStyle?: StyleProp<TextStyle>;
154
+ /** Hit slop for the dismiss button. Default: 44. */
155
+ dismissButtonHitSlop?: number;
156
+ /** Current character count. When set along with maxCharCount, the counter is displayed. */
157
+ charCount?: number;
158
+ /** Maximum character count. Required together with charCount to show the counter. */
159
+ maxCharCount?: number;
160
+ /** Position of the character counter. Default: 'right'. */
161
+ charCountPosition?: CharCountPosition;
162
+ /** Style overrides for the character counter text. */
163
+ charCountStyle?: StyleProp<TextStyle>;
164
+ /** Container style for the character counter. */
165
+ charCountContainerStyle?: StyleProp<ViewStyle>;
166
+ /** Threshold (0-1) at which counter turns warning color. Default: 0.9. */
167
+ charCountWarningThreshold?: number;
168
+ /** Color when approaching the limit. Default: '#FF9800'. */
169
+ charCountWarningColor?: string;
170
+ /** Color when over the limit. Default: '#F44336'. */
171
+ charCountErrorColor?: string;
172
+ /** Default counter color. Default: '#999999'. */
173
+ charCountDefaultColor?: string;
174
+ /** Custom format function for the character count label. */
175
+ charCountFormatLabel?: (current: number, max: number) => string;
176
+ /** Background color of the accessory bar. Default: '#FFFFFF'. */
177
+ backgroundColor?: string;
178
+ /** Main container style overrides. */
179
+ containerStyle?: StyleProp<ViewStyle>;
180
+ /** Inner content wrapper style overrides. */
181
+ contentContainerStyle?: StyleProp<ViewStyle>;
182
+ /** Height of the accessory bar in dp. Default: 44. */
183
+ height?: number;
184
+ /** Top border width. Default: StyleSheet.hairlineWidth. */
185
+ borderTopWidth?: number;
186
+ /** Top border color. Default: '#E0E0E0'. */
187
+ borderTopColor?: string;
188
+ /** Elevation for Android / shadow for iOS. Default: 4. */
189
+ elevation?: number;
190
+ /** Keep the accessory visible even when the keyboard is hidden. Default: false. */
191
+ alwaysVisible?: boolean;
192
+ /** Respect the bottom safe area on notched devices. Default: true (iOS). */
193
+ safeAreaEnabled?: boolean;
194
+ /** Enable slide/fade animation when showing and hiding. Default: true. */
195
+ animationEnabled?: boolean;
196
+ /** Duration of the show/hide animation in milliseconds. Default: 250. */
197
+ animationDuration?: number;
198
+ /** Called when the keyboard becomes visible. */
199
+ onKeyboardShow?: (keyboardHeight: number) => void;
200
+ /** Called when the keyboard hides. */
201
+ onKeyboardHide?: () => void;
202
+ /** Called when the accessory view becomes visible. */
203
+ onAccessoryShow?: () => void;
204
+ /** Called when the accessory view hides. */
205
+ onAccessoryHide?: () => void;
206
+ /** Accessibility label for the entire accessory bar. */
207
+ accessibilityLabel?: string;
208
+ /** Test ID for testing frameworks. */
209
+ testID?: string;
210
+ }
211
+ /**
212
+ * Return type for the useKeyboardAccessory hook.
213
+ */
214
+ export interface KeyboardAccessoryState {
215
+ /** Whether the keyboard is currently visible. */
216
+ keyboardVisible: boolean;
217
+ /** The current keyboard height in dp. */
218
+ keyboardHeight: number;
219
+ }
220
+ /**
221
+ * Options for the useKeyboardAccessory hook.
222
+ */
223
+ export interface UseKeyboardAccessoryOptions {
224
+ /** Keyboard show callback. */
225
+ onKeyboardShow?: (keyboardHeight: number) => void;
226
+ /** Keyboard hide callback. */
227
+ onKeyboardHide?: () => void;
228
+ }
229
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE/D;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAExC;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE9D;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACrC,sDAAsD;IACtD,EAAE,EAAE,MAAM,CAAC;IAEX,iDAAiD;IACjD,OAAO,EAAE,MAAM,IAAI,CAAC;IAEpB;;;OAGG;IACH,OAAO,EAAE,SAAS,GAAG,MAAM,CAAC;IAE5B,oDAAoD;IACpD,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,g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MAAM,CAAC;IAExB,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;IAInB,mFAAmF;IACnF,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,4EAA4E;IAC5E,eAAe,CAAC,EAAE,OAAO,CAAC;IAI1B,0EAA0E;IAC1E,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,yEAAyE;IACzE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAI3B,gDAAgD;IAChD,cAAc,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;IAElD,sCAAsC;IACtC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAE5B,sDAAsD;IACtD,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAE7B,4CAA4C;IAC5C,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAI7B,wDAAwD;IACxD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC,iDAAiD;IACjD,eAAe,EAAE,OAAO,CAAC;IAEzB,yCAAyC;IACzC,cAAc,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC3C,8BAA8B;IAC9B,cAAc,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;IAElD,8BAA8B;IAC9B,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B"}
package/dist/types.js ADDED
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}