@originallyus/feedback-rn-sdk 4.0.0-beta.6 → 4.0.0-beta.8
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.
Potentially problematic release.
This version of @originallyus/feedback-rn-sdk might be problematic. Click here for more details.
- package/lib/module/AIAContentUsefulness.js +1 -1
- package/lib/module/AIAContentUsefulness.js.map +1 -1
- package/lib/module/AIAFeedback.js +8 -8
- package/lib/module/AIAFeedback.js.map +1 -1
- package/lib/module/AIAFeedbackForm.js.map +1 -1
- package/lib/module/AIAFeedbackSplash.js.map +1 -1
- package/lib/module/AIAFeedbackStyles.js.map +1 -1
- package/lib/module/AIAFeedbackSuccess.js.map +1 -1
- package/lib/module/component/ButtonSubmit.js +2 -2
- package/lib/module/component/ButtonSubmit.js.map +1 -1
- package/lib/module/component/Input.js +3 -3
- package/lib/module/component/Input.js.map +1 -1
- package/lib/module/component/MultiSelectButtons.js +5 -5
- package/lib/module/component/MultiSelectButtons.js.map +1 -1
- package/lib/module/component/Rating.js +4 -4
- package/lib/module/component/Rating.js.map +1 -1
- package/lib/module/component/RatingNumber.js +3 -3
- package/lib/module/component/RatingNumber.js.map +1 -1
- package/lib/module/component/Textarea.js +3 -3
- package/lib/module/component/Textarea.js.map +1 -1
- package/lib/module/component/YesNoButtons.js +2 -2
- package/lib/module/component/YesNoButtons.js.map +1 -1
- package/lib/module/index.js +8 -8
- package/lib/module/index.js.map +1 -1
- package/lib/module/service/feedbackService.js +1 -1
- package/lib/module/service/feedbackService.js.map +1 -1
- package/lib/module/utils/networking.js +3 -3
- package/lib/module/utils/networking.js.map +1 -1
- package/package.json +4 -4
- package/src/AIAContentUsefulness.tsx +0 -296
- package/src/AIAFeedback.tsx +0 -354
- package/src/AIAFeedbackForm.tsx +0 -267
- package/src/AIAFeedbackSplash.tsx +0 -49
- package/src/AIAFeedbackStyles.ts +0 -311
- package/src/AIAFeedbackSuccess.tsx +0 -67
- package/src/assets/CheckIcon.tsx +0 -18
- package/src/assets/CloseIcon.tsx +0 -18
- package/src/assets/ErrorIcon.tsx +0 -18
- package/src/assets/PlusIcon.tsx +0 -18
- package/src/assets/StarIcon.tsx +0 -18
- package/src/component/Button.tsx +0 -68
- package/src/component/ButtonSubmit.tsx +0 -335
- package/src/component/Input.tsx +0 -288
- package/src/component/MultiSelectButtons.tsx +0 -272
- package/src/component/README.md +0 -215
- package/src/component/READMEVI.md +0 -192
- package/src/component/Rating.tsx +0 -248
- package/src/component/RatingNumber.tsx +0 -421
- package/src/component/Textarea.tsx +0 -282
- package/src/component/YesNoButtons.tsx +0 -236
- package/src/index.tsx +0 -33
- package/src/service/feedbackService.ts +0 -108
- package/src/utils/common.ts +0 -241
- package/src/utils/constants.ts +0 -60
- package/src/utils/index.ts +0 -167
- package/src/utils/networking.ts +0 -134
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
import {useMemo} from 'react'
|
|
2
|
-
import {View, Text, StyleSheet, type TextStyle, type ViewStyle} from 'react-native'
|
|
3
|
-
import * as f from '@utils/common'
|
|
4
|
-
import ButtonSubmit from '@component/ButtonSubmit'
|
|
5
|
-
import CheckIcon from '@/assets/CheckIcon'
|
|
6
|
-
import PlusIcon from '@/assets/PlusIcon'
|
|
7
|
-
import {
|
|
8
|
-
BG_DEFAULT,
|
|
9
|
-
BG_SECONDARY,
|
|
10
|
-
BORDER_DEFAULT,
|
|
11
|
-
BORDER_SELECTED,
|
|
12
|
-
ERROR_COLOR,
|
|
13
|
-
PRIMARY_COLOR,
|
|
14
|
-
TEXT_DARK,
|
|
15
|
-
TEXT_DEFAULT,
|
|
16
|
-
TEXT_WHITE,
|
|
17
|
-
} from '@utils/constants'
|
|
18
|
-
import * as Haptics from 'expo-haptics'
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Visual variant for selected tags in `MultiSelectButtons`.
|
|
22
|
-
*
|
|
23
|
-
* - `'primary'` – solid primary background with white text.
|
|
24
|
-
* - `'secondary'` – light background with colored border and dark text.
|
|
25
|
-
*/
|
|
26
|
-
export type MultiSelectSelectedVariant = 'primary' | 'secondary'
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Single option for `MultiSelectButtons`.
|
|
30
|
-
*/
|
|
31
|
-
export interface MultiSelectOption {
|
|
32
|
-
/**
|
|
33
|
-
* Value emitted in `value` and `onSelect`.
|
|
34
|
-
*/
|
|
35
|
-
value: string
|
|
36
|
-
/**
|
|
37
|
-
* Label shown on the tag button.
|
|
38
|
-
*/
|
|
39
|
-
label: string
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Props for the `MultiSelectButtons` component.
|
|
44
|
-
*
|
|
45
|
-
* Renders a question and a wrap layout of tag-like buttons allowing multiple selections.
|
|
46
|
-
*/
|
|
47
|
-
export interface MultiSelectButtonsProps {
|
|
48
|
-
/**
|
|
49
|
-
* Question text displayed above the options.
|
|
50
|
-
*/
|
|
51
|
-
question: string
|
|
52
|
-
/**
|
|
53
|
-
* List of options to render.
|
|
54
|
-
*/
|
|
55
|
-
options: MultiSelectOption[]
|
|
56
|
-
/**
|
|
57
|
-
* Array of currently selected option values.
|
|
58
|
-
*/
|
|
59
|
-
value: string[]
|
|
60
|
-
/**
|
|
61
|
-
* Called when the selection changes (toggle behavior).
|
|
62
|
-
*
|
|
63
|
-
* @param selected The new list of selected values.
|
|
64
|
-
*/
|
|
65
|
-
onSelect: (selected: string[]) => void
|
|
66
|
-
/**
|
|
67
|
-
* App width, passed to underlying `ButtonSubmit` components.
|
|
68
|
-
*/
|
|
69
|
-
appWidth: number
|
|
70
|
-
/**
|
|
71
|
-
* Visual variant for the selected tags.
|
|
72
|
-
*
|
|
73
|
-
* @default 'secondary'
|
|
74
|
-
*/
|
|
75
|
-
selectedVariant?: MultiSelectSelectedVariant
|
|
76
|
-
/**
|
|
77
|
-
* Error message; when present, shown below the options.
|
|
78
|
-
*/
|
|
79
|
-
error?: string
|
|
80
|
-
/**
|
|
81
|
-
* Override background color when an option is selected.
|
|
82
|
-
*/
|
|
83
|
-
selectedBackgroundColor?: string
|
|
84
|
-
/**
|
|
85
|
-
* Override border color when an option is selected.
|
|
86
|
-
*/
|
|
87
|
-
selectedBorderColor?: string
|
|
88
|
-
/**
|
|
89
|
-
* Override text color when an option is selected.
|
|
90
|
-
*/
|
|
91
|
-
selectedTextColor?: string
|
|
92
|
-
/**
|
|
93
|
-
* Style for the question text.
|
|
94
|
-
*/
|
|
95
|
-
questionStyle?: TextStyle
|
|
96
|
-
/**
|
|
97
|
-
* Style for the error text.
|
|
98
|
-
*/
|
|
99
|
-
errorStyle?: TextStyle
|
|
100
|
-
/**
|
|
101
|
-
* Color for the error text and "!" icon.
|
|
102
|
-
*/
|
|
103
|
-
errorColor?: string
|
|
104
|
-
/**
|
|
105
|
-
* Size of the plus/check icons (px).
|
|
106
|
-
*
|
|
107
|
-
* @default 16
|
|
108
|
-
*/
|
|
109
|
-
iconSize?: number
|
|
110
|
-
/**
|
|
111
|
-
* Maximum number of lines for Each option label.
|
|
112
|
-
*
|
|
113
|
-
* @default 2
|
|
114
|
-
*/
|
|
115
|
-
optionNumberOfLines?: number
|
|
116
|
-
/**
|
|
117
|
-
* Style for the outer wrapper view.
|
|
118
|
-
*/
|
|
119
|
-
style?: ViewStyle
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function MultiSelectButtons({
|
|
123
|
-
question,
|
|
124
|
-
options,
|
|
125
|
-
value,
|
|
126
|
-
onSelect,
|
|
127
|
-
appWidth,
|
|
128
|
-
selectedVariant = 'secondary',
|
|
129
|
-
error,
|
|
130
|
-
selectedBackgroundColor,
|
|
131
|
-
selectedBorderColor,
|
|
132
|
-
selectedTextColor,
|
|
133
|
-
questionStyle,
|
|
134
|
-
errorStyle,
|
|
135
|
-
errorColor = ERROR_COLOR,
|
|
136
|
-
iconSize = 16,
|
|
137
|
-
optionNumberOfLines = 1,
|
|
138
|
-
style,
|
|
139
|
-
}: MultiSelectButtonsProps) {
|
|
140
|
-
const hasError = useMemo(() => error != null && error !== '', [error])
|
|
141
|
-
const selectedSet = useMemo(() => new Set(value), [value])
|
|
142
|
-
|
|
143
|
-
const isPrimary = selectedVariant === 'primary'
|
|
144
|
-
|
|
145
|
-
const selectedBg = useMemo(
|
|
146
|
-
() => selectedBackgroundColor ?? (isPrimary ? PRIMARY_COLOR : BG_SECONDARY),
|
|
147
|
-
[selectedBackgroundColor, isPrimary],
|
|
148
|
-
)
|
|
149
|
-
|
|
150
|
-
const selectedBorder = useMemo(
|
|
151
|
-
() => (isPrimary ? selectedBg : selectedBorderColor ?? BORDER_SELECTED),
|
|
152
|
-
[isPrimary, selectedBg, selectedBorderColor],
|
|
153
|
-
)
|
|
154
|
-
|
|
155
|
-
const selectedText = useMemo(
|
|
156
|
-
() => selectedTextColor ?? (isPrimary ? TEXT_WHITE : TEXT_DEFAULT),
|
|
157
|
-
[selectedTextColor, isPrimary],
|
|
158
|
-
)
|
|
159
|
-
|
|
160
|
-
const toggle = (optionValue: string) => {
|
|
161
|
-
if (selectedSet.has(optionValue)) {
|
|
162
|
-
onSelect(value.filter(v => v !== optionValue))
|
|
163
|
-
} else {
|
|
164
|
-
onSelect([...value, optionValue])
|
|
165
|
-
}
|
|
166
|
-
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light)
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
const marginTop = useMemo(() => [styles.optionsRow, {marginTop: f.w_p(appWidth, 10)}], [appWidth])
|
|
170
|
-
|
|
171
|
-
return (
|
|
172
|
-
<View style={[styles.wrapper, style]}>
|
|
173
|
-
{question != null && question !== '' && <Text style={[styles.question, questionStyle]}>{question}</Text>}
|
|
174
|
-
<View style={marginTop}>
|
|
175
|
-
{options.map(opt => {
|
|
176
|
-
const isSelected = selectedSet.has(opt.value)
|
|
177
|
-
|
|
178
|
-
const buttonStyles = (() => {
|
|
179
|
-
if (isSelected) {
|
|
180
|
-
return {
|
|
181
|
-
bg: selectedBg,
|
|
182
|
-
text: selectedText,
|
|
183
|
-
border: selectedBorder,
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
if (hasError) {
|
|
187
|
-
return {bg: BG_DEFAULT, text: errorColor, border: errorColor}
|
|
188
|
-
}
|
|
189
|
-
return {
|
|
190
|
-
bg: BG_DEFAULT,
|
|
191
|
-
text: TEXT_DARK,
|
|
192
|
-
border: BORDER_DEFAULT,
|
|
193
|
-
}
|
|
194
|
-
})()
|
|
195
|
-
|
|
196
|
-
return (
|
|
197
|
-
<View key={opt.value} style={styles.optionSlot}>
|
|
198
|
-
<ButtonSubmit
|
|
199
|
-
appWidth={appWidth}
|
|
200
|
-
title={opt.label}
|
|
201
|
-
leftIcon={
|
|
202
|
-
isSelected ? (
|
|
203
|
-
<CheckIcon size={iconSize} color={buttonStyles.text} />
|
|
204
|
-
) : (
|
|
205
|
-
<PlusIcon size={iconSize} color={buttonStyles.text} />
|
|
206
|
-
)
|
|
207
|
-
}
|
|
208
|
-
onPress={() => toggle(opt.value)}
|
|
209
|
-
variant="secondary"
|
|
210
|
-
fullWidth={false}
|
|
211
|
-
backgroundColor={buttonStyles.bg}
|
|
212
|
-
textColor={buttonStyles.text}
|
|
213
|
-
borderColor={buttonStyles.border}
|
|
214
|
-
containerStyle={styles.tagContainer}
|
|
215
|
-
numberOfLines={optionNumberOfLines}
|
|
216
|
-
style={styles.tagButton}
|
|
217
|
-
/>
|
|
218
|
-
</View>
|
|
219
|
-
)
|
|
220
|
-
})}
|
|
221
|
-
</View>
|
|
222
|
-
{hasError && (
|
|
223
|
-
<View style={styles.errorRow}>
|
|
224
|
-
<Text style={[styles.errorIcon, {color: errorColor}]}>!</Text>
|
|
225
|
-
<Text style={[styles.errorText, {color: errorColor}, errorStyle]}>{error}</Text>
|
|
226
|
-
</View>
|
|
227
|
-
)}
|
|
228
|
-
</View>
|
|
229
|
-
)
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
export default MultiSelectButtons
|
|
233
|
-
|
|
234
|
-
const styles = StyleSheet.create({
|
|
235
|
-
wrapper: {
|
|
236
|
-
width: '100%',
|
|
237
|
-
},
|
|
238
|
-
question: {
|
|
239
|
-
fontSize: 16,
|
|
240
|
-
fontWeight: '600',
|
|
241
|
-
color: '#000000',
|
|
242
|
-
marginBottom: 4,
|
|
243
|
-
},
|
|
244
|
-
optionsRow: {
|
|
245
|
-
flexDirection: 'row',
|
|
246
|
-
flexWrap: 'wrap',
|
|
247
|
-
gap: 10,
|
|
248
|
-
},
|
|
249
|
-
optionSlot: {
|
|
250
|
-
alignSelf: 'flex-start',
|
|
251
|
-
},
|
|
252
|
-
tagContainer: {
|
|
253
|
-
marginTop: 0,
|
|
254
|
-
},
|
|
255
|
-
tagButton: {
|
|
256
|
-
paddingVertical: 8,
|
|
257
|
-
paddingHorizontal: 12,
|
|
258
|
-
},
|
|
259
|
-
errorRow: {
|
|
260
|
-
flexDirection: 'row',
|
|
261
|
-
alignItems: 'center',
|
|
262
|
-
marginTop: 8,
|
|
263
|
-
gap: 6,
|
|
264
|
-
},
|
|
265
|
-
errorIcon: {
|
|
266
|
-
fontSize: 14,
|
|
267
|
-
fontWeight: '700',
|
|
268
|
-
},
|
|
269
|
-
errorText: {
|
|
270
|
-
fontSize: 12,
|
|
271
|
-
},
|
|
272
|
-
})
|
package/src/component/README.md
DELETED
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
# Components – Props reference
|
|
2
|
-
|
|
3
|
-
Documentation for all components and their props in `@originallyus/feedback-rn-sdk`. Tables: **Prop** | **Type** | **Default** | **Description**.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Button
|
|
8
|
-
|
|
9
|
-
Basic pressable button (Pressable + Text).
|
|
10
|
-
|
|
11
|
-
| Prop | Type | Default | Description |
|
|
12
|
-
| ----------- | ------------ | ------- | --------------------------------------- |
|
|
13
|
-
| `title` | `string` | — | **Required.** Text shown on the button. |
|
|
14
|
-
| `onPress` | `() => void` | — | **Required.** Callback when pressed. |
|
|
15
|
-
| `disabled` | `boolean` | `false` | Disables the button. |
|
|
16
|
-
| `style` | `ViewStyle` | — | Style for the button container. |
|
|
17
|
-
| `textStyle` | `TextStyle` | — | Style for the label text. |
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
## ButtonSubmit
|
|
22
|
-
|
|
23
|
-
Submit button for forms: primary (red background) or secondary (red border + red text, light pink background). Supports loading state, left icon, and full width or content-based width.
|
|
24
|
-
|
|
25
|
-
| Prop | Type | Default | Description |
|
|
26
|
-
| ------------------------- | -------------------------- | ----------- | ----------------------------------------------------------------------- |
|
|
27
|
-
| `onPress` | `() => void` | — | **Required.** Callback when pressed. |
|
|
28
|
-
| `title` | `string` | — | **Required.** Button label. |
|
|
29
|
-
| `leftIcon` | `string` | — | Character shown to the left of the title (e.g. `"+"`, `"✓"`). |
|
|
30
|
-
| `variant` | `'primary' \| 'secondary'` | `'primary'` | primary = red background; secondary = red border + text, light pink bg. |
|
|
31
|
-
| `fullWidth` | `boolean` | `true` | `true` = full width, `false` = width by content. |
|
|
32
|
-
| `disabled` | `boolean` | `false` | Disables the button. |
|
|
33
|
-
| `loading` | `boolean` | `false` | Shows ActivityIndicator and blocks press. |
|
|
34
|
-
| `appWidth` | `number` | — | **Required.** Screen width (used for margin). |
|
|
35
|
-
| `isTabletInstrusive` | `boolean` | — | On tablet: fixed 200px width instead of full width. |
|
|
36
|
-
| `fontFamily` | `string` | — | Font family. |
|
|
37
|
-
| `fontSize` | `number` | `16` | Font size. |
|
|
38
|
-
| `textColor` | `string` | — | Text color (primary = white, secondary = red). |
|
|
39
|
-
| `backgroundColor` | `string` | — | Background color. |
|
|
40
|
-
| `pressedColor` | `string` | — | Color when pressed. |
|
|
41
|
-
| `disabledBackgroundColor` | `string` | — | Background color when disabled. |
|
|
42
|
-
| `disabledTextColor` | `string` | — | Text color when disabled. |
|
|
43
|
-
| `borderColor` | `string` | — | Border color (secondary variant). |
|
|
44
|
-
| `containerStyle` | `ViewStyle` | — | Style for the wrapper view. |
|
|
45
|
-
| `style` | `ViewStyle` | — | Style for the Pressable. |
|
|
46
|
-
| `textStyle` | `TextStyle` | — | Style for the text. |
|
|
47
|
-
|
|
48
|
-
---
|
|
49
|
-
|
|
50
|
-
## RatingNumber
|
|
51
|
-
|
|
52
|
-
Numeric rating scale: a row of buttons from `rating_min` to `rating_max` with optional left/right labels. Buttons are full width per device; supports size presets and compact mode.
|
|
53
|
-
|
|
54
|
-
| Prop | Type | Default | Description |
|
|
55
|
-
| ------------------------------------- | -------------------------------- | ----------- | ------------------------------------------------------- |
|
|
56
|
-
| `scale_label_color` | `string` | — | **Required.** Text color for left/right labels. |
|
|
57
|
-
| `scale_label_left` | `string` | — | Left label (e.g. "Strongly disagree"). |
|
|
58
|
-
| `scale_label_right` | `string` | — | Right label (e.g. "Strongly agree"). |
|
|
59
|
-
| `scale_label_font` | `string` | — | Font for labels. |
|
|
60
|
-
| `scale_label_fontsize` | `number` | — | Font size for labels. |
|
|
61
|
-
| `handlePressRating` | `(rating: number) => void` | — | **Required.** Callback when a number is selected. |
|
|
62
|
-
| `numStar` | `number` | — | **Required.** Currently selected value. |
|
|
63
|
-
| `rating_min` | `number` | — | **Required.** Minimum value. |
|
|
64
|
-
| `rating_max` | `number` | — | **Required.** Maximum value. |
|
|
65
|
-
| `appWidth` | `number` | — | **Required.** App width (for layout). |
|
|
66
|
-
| `size` | `'small' \| 'medium' \| 'large'` | `'medium'` | Preset for height and spacing. |
|
|
67
|
-
| `compact` | `boolean` | `true` | `true` = no gap between buttons; `false` = gap between. |
|
|
68
|
-
| `error` | `string` | — | Error message; red border on buttons and text below. |
|
|
69
|
-
| `errorBorderColor` | `string` | `'#D32F2F'` | Border color when error is set. |
|
|
70
|
-
| `rating_number_font` | `string` | — | Font for the number inside each button. |
|
|
71
|
-
| `rating_number_fontsize` | `number` | — | Font size for the number. |
|
|
72
|
-
| `rating_number_bg_color` | `string` | — | Background color when not selected. |
|
|
73
|
-
| `rating_number_border_color` | `string` | — | Border color when not selected. |
|
|
74
|
-
| `rating_number_selected_bg_color` | `string` | — | Background color when selected (default #082065). |
|
|
75
|
-
| `rating_number_selected_border_color` | `string` | — | Border color when selected. |
|
|
76
|
-
| `rating_number_selected_text_color` | `string` | — | Text color when selected. |
|
|
77
|
-
| `rating_number_text_color` | `string` | — | Text color when not selected. |
|
|
78
|
-
| `errorStyle` | `TextStyle` | — | Style for the error text. |
|
|
79
|
-
|
|
80
|
-
---
|
|
81
|
-
|
|
82
|
-
## Rating
|
|
83
|
-
|
|
84
|
-
Star rating block: title, question/subtitle, and a row of tappable stars (1–5 by default). Uses `RatingStar` internally. Selected stars are filled (e.g. golden), unselected are grey. Optional error message below.
|
|
85
|
-
|
|
86
|
-
| Prop | Type | Default | Description |
|
|
87
|
-
| ------------------- | -------------------------- | ---------------------------------- | ------------------------------------------------- |
|
|
88
|
-
| `title` | `string` | `'Help us get better'` | Main heading above the question. |
|
|
89
|
-
| `question` | `string` | `'How was your experience today?'` | Subtitle or question text. |
|
|
90
|
-
| `value` | `number` | — | **Required.** Current star value (1..rating_max). |
|
|
91
|
-
| `onRate` | `(rating: number) => void` | — | **Required.** Callback when user selects a star. |
|
|
92
|
-
| `rating_min` | `number` | `1` | Minimum star value. |
|
|
93
|
-
| `rating_max` | `number` | `5` | Maximum star value. |
|
|
94
|
-
| `disabled` | `boolean` | `false` | Disables star taps. |
|
|
95
|
-
| `error` | `string` | — | Error message; shown below the stars. |
|
|
96
|
-
| `normalStarColor` | `string` | `'#D0D0D0'` | Color for unselected stars. |
|
|
97
|
-
| `selectedStarColor` | `string` | `'#FFC107'` | Color for selected stars (e.g. golden). |
|
|
98
|
-
| `titleStyle` | `TextStyle` | — | Style for the title. |
|
|
99
|
-
| `questionStyle` | `TextStyle` | — | Style for the question. |
|
|
100
|
-
| `errorStyle` | `TextStyle` | — | Style for the error text. |
|
|
101
|
-
| `style` | `ViewStyle` | — | Style for the wrapper. |
|
|
102
|
-
|
|
103
|
-
---
|
|
104
|
-
|
|
105
|
-
## Textarea
|
|
106
|
-
|
|
107
|
-
Multi-line text input: label on top, note below, placeholder, and optional character count (maxLength). Supports focus and error states.
|
|
108
|
-
|
|
109
|
-
| Prop | Type | Default | Description |
|
|
110
|
-
| ---------------------- | ------------------------ | --------------- | ----------------------------------------------------- |
|
|
111
|
-
| `value` | `string` | — | **Required.** Current value. |
|
|
112
|
-
| `onChangeText` | `(text: string) => void` | — | **Required.** Callback when text changes. |
|
|
113
|
-
| `placeholder` | `string` | `'Placeholder'` | Placeholder text. |
|
|
114
|
-
| `label` | `string` | — | Label above the field. |
|
|
115
|
-
| `note` | `string` | — | Helper text below the field. |
|
|
116
|
-
| `error` | `string` | — | Error message; red border and text below. |
|
|
117
|
-
| `maxLength` | `number` | — | Max characters; shows count 0/maxLength bottom-right. |
|
|
118
|
-
| `appWidth` | `number` | — | **Required.** App width (for padding). |
|
|
119
|
-
| `minHeight` | `number` | `120` | Minimum height of the input area. |
|
|
120
|
-
| `backgroundColor` | `string` | — | Background color of the field. |
|
|
121
|
-
| `borderColor` | `string` | — | Border color (unfocused). |
|
|
122
|
-
| `focusBackgroundColor` | `string` | — | Background color when focused. |
|
|
123
|
-
| `focusBorderColor` | `string` | — | Border color when focused. |
|
|
124
|
-
| `errorBorderColor` | `string` | `'#D32F2F'` | Border color when error is set. |
|
|
125
|
-
| `fontFamily` | `string` | — | Font family. |
|
|
126
|
-
| `fontSize` | `number` | `16` | Font size. |
|
|
127
|
-
| `placeholderTextColor` | `string` | — | Placeholder text color. |
|
|
128
|
-
| `textColor` | `string` | — | Text color. |
|
|
129
|
-
| `labelStyle` | `TextStyle` | — | Style for the label. |
|
|
130
|
-
| `captionStyle` | `TextStyle` | — | Style for caption. |
|
|
131
|
-
| `noteStyle` | `TextStyle` | — | Style for the note. |
|
|
132
|
-
| `errorStyle` | `TextStyle` | — | Style for the error text. |
|
|
133
|
-
| `counterStyle` | `TextStyle` | — | Style for the character counter. |
|
|
134
|
-
| `style` | `ViewStyle` | — | Style for the wrapper. |
|
|
135
|
-
|
|
136
|
-
---
|
|
137
|
-
|
|
138
|
-
## Input
|
|
139
|
-
|
|
140
|
-
Single-line text input: same structure as Textarea (label, note, error), with optional character counter when `maxLength` is set.
|
|
141
|
-
|
|
142
|
-
| Prop | Type | Default | Description |
|
|
143
|
-
| ---------------------- | ------------------------ | --------------- | -------------------------------------------------------- |
|
|
144
|
-
| `value` | `string` | — | **Required.** Current value. |
|
|
145
|
-
| `onChangeText` | `(text: string) => void` | — | **Required.** Callback when text changes. |
|
|
146
|
-
| `placeholder` | `string` | `'Placeholder'` | Placeholder text. |
|
|
147
|
-
| `label` | `string` | — | Label above the field. |
|
|
148
|
-
| `note` | `string` | — | Helper text below the field. |
|
|
149
|
-
| `error` | `string` | — | Error message; red border and text below. |
|
|
150
|
-
| `maxLength` | `number` | — | Max characters. |
|
|
151
|
-
| `showCounter` | `boolean` | `true` | Show 0/maxLength when maxLength is set; `false` to hide. |
|
|
152
|
-
| `appWidth` | `number` | — | **Required.** App width (for padding). |
|
|
153
|
-
| `backgroundColor` | `string` | — | Background color. |
|
|
154
|
-
| `borderColor` | `string` | — | Border color. |
|
|
155
|
-
| `focusBackgroundColor` | `string` | — | Background color when focused. |
|
|
156
|
-
| `focusBorderColor` | `string` | — | Border color when focused. |
|
|
157
|
-
| `errorBorderColor` | `string` | `'#D32F2F'` | Border color when error is set. |
|
|
158
|
-
| `fontFamily` | `string` | — | Font family. |
|
|
159
|
-
| `fontSize` | `number` | `16` | Font size. |
|
|
160
|
-
| `placeholderTextColor` | `string` | — | Placeholder text color. |
|
|
161
|
-
| `textColor` | `string` | — | Text color. |
|
|
162
|
-
| `labelStyle` | `TextStyle` | — | Style for the label. |
|
|
163
|
-
| `noteStyle` | `TextStyle` | — | Style for the note. |
|
|
164
|
-
| `errorStyle` | `TextStyle` | — | Style for the error text. |
|
|
165
|
-
| `counterStyle` | `TextStyle` | — | Style for the counter. |
|
|
166
|
-
| `style` | `ViewStyle` | — | Style for the wrapper. |
|
|
167
|
-
|
|
168
|
-
---
|
|
169
|
-
|
|
170
|
-
## YesNoButtons
|
|
171
|
-
|
|
172
|
-
Two Yes / No buttons built with ButtonSubmit. Single selection; selected style can be primary (red background) or secondary (light background + bold border).
|
|
173
|
-
|
|
174
|
-
| Prop | Type | Default | Description |
|
|
175
|
-
| ------------------------- | -------------------------------- | ----------- | ----------------------------------------------------------------- |
|
|
176
|
-
| `question` | `string` | — | **Required.** Question text above the buttons. |
|
|
177
|
-
| `value` | `'yes' \| 'no' \| null` | — | **Required.** Current selection. |
|
|
178
|
-
| `onSelect` | `(value: 'yes' \| 'no') => void` | — | **Required.** Callback when an option is selected. |
|
|
179
|
-
| `selectedVariant` | `'primary' \| 'secondary'` | `'primary'` | primary = red bg, white text; secondary = light bg + bold border. |
|
|
180
|
-
| `yesLabel` | `string` | `'Yes'` | Label for the Yes button. |
|
|
181
|
-
| `noLabel` | `string` | `'No'` | Label for the No button. |
|
|
182
|
-
| `error` | `string` | — | Error message; shown below the two buttons with "!". |
|
|
183
|
-
| `appWidth` | `number` | — | **Required.** App width (for ButtonSubmit). |
|
|
184
|
-
| `selectedBackgroundColor` | `string` | — | Override background when selected (secondary). |
|
|
185
|
-
| `selectedBorderColor` | `string` | — | Override border when selected (secondary). |
|
|
186
|
-
| `selectedTextColor` | `string` | — | Override text color when selected (secondary). |
|
|
187
|
-
| `questionStyle` | `TextStyle` | — | Style for the question. |
|
|
188
|
-
| `errorStyle` | `TextStyle` | — | Style for the error text. |
|
|
189
|
-
| `errorColor` | `string` | — | Error text color (default red). |
|
|
190
|
-
| `style` | `ViewStyle` | — | Style for the wrapper. |
|
|
191
|
-
|
|
192
|
-
---
|
|
193
|
-
|
|
194
|
-
## MultiSelectButtons
|
|
195
|
-
|
|
196
|
-
Multiple choice (tag) buttons: select several options, wrap layout. Uses ButtonSubmit with "+" / "✓" icon on the left. Selected variant: primary (red background) or secondary (light background + bold border, black text).
|
|
197
|
-
|
|
198
|
-
| Prop | Type | Default | Description |
|
|
199
|
-
| ------------------------- | ------------------------------ | ------------- | ----------------------------------------------------------------------------- |
|
|
200
|
-
| `question` | `string` | — | **Required.** Question text above the options. |
|
|
201
|
-
| `options` | `MultiSelectOption[]` | — | **Required.** List of options. Each: `{ value: string, label: string }`. |
|
|
202
|
-
| `value` | `string[]` | — | **Required.** Array of selected values. |
|
|
203
|
-
| `onSelect` | `(selected: string[]) => void` | — | **Required.** Callback when selection changes (toggles per option). |
|
|
204
|
-
| `appWidth` | `number` | — | **Required.** App width. |
|
|
205
|
-
| `selectedVariant` | `'primary' \| 'secondary'` | `'secondary'` | primary = red bg, white text; secondary = light bg + blue border, black text. |
|
|
206
|
-
| `error` | `string` | — | Error message; shown below the buttons. |
|
|
207
|
-
| `selectedBackgroundColor` | `string` | — | Override background when selected. |
|
|
208
|
-
| `selectedBorderColor` | `string` | — | Override border when selected. |
|
|
209
|
-
| `selectedTextColor` | `string` | — | Override text color when selected. |
|
|
210
|
-
| `questionStyle` | `TextStyle` | — | Style for the question. |
|
|
211
|
-
| `errorStyle` | `TextStyle` | — | Style for the error text. |
|
|
212
|
-
| `errorColor` | `string` | — | Error text color. |
|
|
213
|
-
| `style` | `ViewStyle` | — | Style for the wrapper. |
|
|
214
|
-
|
|
215
|
-
**MultiSelectOption:** `{ value: string; label: string }`
|