ferns-ui 1.1.2 → 1.2.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.
- package/dist/Accordion.js +3 -3
- package/dist/Accordion.js.map +1 -1
- package/dist/ActionSheet.d.ts +1 -9
- package/dist/ActionSheet.js +2 -7
- package/dist/ActionSheet.js.map +1 -1
- package/dist/Avatar.js +3 -3
- package/dist/Avatar.js.map +1 -1
- package/dist/Banner.js +1 -1
- package/dist/Banner.js.map +1 -1
- package/dist/BooleanField.js +1 -1
- package/dist/BooleanField.js.map +1 -1
- package/dist/Box.js +2 -10
- package/dist/Box.js.map +1 -1
- package/dist/Button.js +1 -1
- package/dist/Button.js.map +1 -1
- package/dist/CheckBox.js +1 -1
- package/dist/CheckBox.js.map +1 -1
- package/dist/Common.d.ts +8 -7
- package/dist/Common.js.map +1 -1
- package/dist/CustomSelectField.js +3 -3
- package/dist/CustomSelectField.js.map +1 -1
- package/dist/DateTimeActionSheet.js +3 -3
- package/dist/DateTimeActionSheet.js.map +1 -1
- package/dist/DismissButton.js +1 -1
- package/dist/DismissButton.js.map +1 -1
- package/dist/Icon.js +1 -1
- package/dist/Icon.js.map +1 -1
- package/dist/IconButton.js +2 -2
- package/dist/IconButton.js.map +1 -1
- package/dist/Link.js +1 -1
- package/dist/Link.js.map +1 -1
- package/dist/MobileAddressAutoComplete.js +1 -1
- package/dist/MobileAddressAutoComplete.js.map +1 -1
- package/dist/Modal.js +7 -13
- package/dist/Modal.js.map +1 -1
- package/dist/MultiselectField.js +2 -2
- package/dist/MultiselectField.js.map +1 -1
- package/dist/Pagination.js +1 -1
- package/dist/Pagination.js.map +1 -1
- package/dist/PickerSelect.js +4 -4
- package/dist/PickerSelect.js.map +1 -1
- package/dist/RadioField.js +1 -1
- package/dist/RadioField.js.map +1 -1
- package/dist/SegmentedControl.js +1 -1
- package/dist/SegmentedControl.js.map +1 -1
- package/dist/Text.js +1 -1
- package/dist/Text.js.map +1 -1
- package/dist/TextField.js +9 -21
- package/dist/TextField.js.map +1 -1
- package/dist/Toast.js +1 -1
- package/dist/Toast.js.map +1 -1
- package/dist/Tooltip.js +1 -1
- package/dist/Tooltip.js.map +1 -1
- package/dist/Unifier.d.ts +0 -1
- package/dist/Unifier.js +6 -7
- package/dist/Unifier.js.map +1 -1
- package/dist/table/TableBoolean.js +2 -2
- package/dist/table/TableBoolean.js.map +1 -1
- package/dist/table/TableHeaderCell.js +1 -1
- package/dist/table/TableHeaderCell.js.map +1 -1
- package/dist/table/TableTitle.js +1 -1
- package/dist/table/TableTitle.js.map +1 -1
- package/package.json +2 -1
- package/src/Accordion.tsx +3 -2
- package/src/ActionSheet.tsx +2 -7
- package/src/Avatar.tsx +4 -4
- package/src/Banner.tsx +2 -2
- package/src/BooleanField.tsx +10 -4
- package/src/Box.tsx +3 -11
- package/src/Button.tsx +2 -2
- package/src/CheckBox.tsx +1 -1
- package/src/Common.ts +12 -11
- package/src/CustomSelectField.tsx +5 -5
- package/src/DateTimeActionSheet.tsx +4 -4
- package/src/DismissButton.tsx +2 -2
- package/src/Icon.tsx +1 -0
- package/src/IconButton.tsx +3 -2
- package/src/Link.tsx +2 -2
- package/src/MobileAddressAutoComplete.tsx +1 -1
- package/src/Modal.tsx +12 -18
- package/src/MultiselectField.tsx +4 -4
- package/src/Pagination.tsx +1 -1
- package/src/PickerSelect.tsx +4 -4
- package/src/RadioField.tsx +2 -2
- package/src/SegmentedControl.tsx +1 -1
- package/src/Text.tsx +1 -1
- package/src/TextField.tsx +9 -20
- package/src/Toast.tsx +1 -1
- package/src/Tooltip.tsx +2 -2
- package/src/Unifier.ts +0 -4
- package/src/table/TableBoolean.tsx +4 -4
- package/src/table/TableHeaderCell.tsx +1 -0
- package/src/table/TableTitle.tsx +2 -2
package/src/Modal.tsx
CHANGED
|
@@ -72,13 +72,7 @@ const ModalContent: FC<{
|
|
|
72
72
|
...(isMobile
|
|
73
73
|
? {}
|
|
74
74
|
: {
|
|
75
|
-
|
|
76
|
-
shadowOffset: {
|
|
77
|
-
width: 0,
|
|
78
|
-
height: 4,
|
|
79
|
-
},
|
|
80
|
-
shadowOpacity: 0.5,
|
|
81
|
-
shadowRadius: 24,
|
|
75
|
+
boxShadow: "0px 4px 24px rgba(0, 0, 0, 0.5)",
|
|
82
76
|
elevation: 24,
|
|
83
77
|
}),
|
|
84
78
|
}}
|
|
@@ -86,8 +80,8 @@ const ModalContent: FC<{
|
|
|
86
80
|
<View style={{alignSelf: "flex-end", position: "relative"}}>
|
|
87
81
|
<Pressable
|
|
88
82
|
accessibilityHint="Closes the modal"
|
|
89
|
-
|
|
90
|
-
|
|
83
|
+
aria-label="Close modal"
|
|
84
|
+
aria-role="button"
|
|
91
85
|
style={{
|
|
92
86
|
flex: 1,
|
|
93
87
|
justifyContent: "center",
|
|
@@ -106,8 +100,8 @@ const ModalContent: FC<{
|
|
|
106
100
|
{title && (
|
|
107
101
|
<View
|
|
108
102
|
accessibilityHint="Modal title"
|
|
109
|
-
|
|
110
|
-
|
|
103
|
+
aria-label={title}
|
|
104
|
+
aria-role="header"
|
|
111
105
|
style={{alignSelf: "flex-start"}}
|
|
112
106
|
>
|
|
113
107
|
<Heading size="lg">{title}</Heading>
|
|
@@ -116,8 +110,8 @@ const ModalContent: FC<{
|
|
|
116
110
|
{subtitle && (
|
|
117
111
|
<View
|
|
118
112
|
accessibilityHint="Modal Sub Heading Text"
|
|
119
|
-
|
|
120
|
-
|
|
113
|
+
aria-label={subtitle}
|
|
114
|
+
aria-role="text"
|
|
121
115
|
style={{alignSelf: "flex-start", marginTop: subtitle ? 8 : 0}}
|
|
122
116
|
>
|
|
123
117
|
<Text size="lg">{subtitle}</Text>
|
|
@@ -126,15 +120,15 @@ const ModalContent: FC<{
|
|
|
126
120
|
{text && (
|
|
127
121
|
<View
|
|
128
122
|
accessibilityHint="Modal body text"
|
|
129
|
-
|
|
130
|
-
|
|
123
|
+
aria-label={text}
|
|
124
|
+
aria-role="text"
|
|
131
125
|
style={{marginVertical: text ? 12 : 0, alignSelf: "flex-start"}}
|
|
132
126
|
>
|
|
133
127
|
<Text>{text}</Text>
|
|
134
128
|
</View>
|
|
135
129
|
)}
|
|
136
130
|
{children && (
|
|
137
|
-
<View
|
|
131
|
+
<View aria-role="text" style={{marginTop: text ? 0 : 12}}>
|
|
138
132
|
{children}
|
|
139
133
|
</View>
|
|
140
134
|
)}
|
|
@@ -221,8 +215,8 @@ export const Modal: FC<ModalProps> = ({
|
|
|
221
215
|
<View>
|
|
222
216
|
<View
|
|
223
217
|
accessibilityHint="Pull down to close the modal"
|
|
224
|
-
|
|
225
|
-
|
|
218
|
+
aria-label="Pull down bar"
|
|
219
|
+
aria-role="adjustable"
|
|
226
220
|
style={{
|
|
227
221
|
justifyContent: "center",
|
|
228
222
|
alignItems: "center",
|
package/src/MultiselectField.tsx
CHANGED
|
@@ -31,8 +31,8 @@ const Option: FC<OptionProps> = ({value, label, isDefault, selected, onSelect})
|
|
|
31
31
|
<TouchableOpacity
|
|
32
32
|
key={value}
|
|
33
33
|
accessibilityHint={`Select ${label ?? value} from list of options`}
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
aria-label={label ?? value}
|
|
35
|
+
aria-role="checkbox"
|
|
36
36
|
hitSlop={{top: 10, bottom: 10, left: 10, right: 10}}
|
|
37
37
|
style={{
|
|
38
38
|
justifyContent: "center",
|
|
@@ -80,8 +80,8 @@ export const MultiselectField: FC<MultiselectFieldProps> = ({
|
|
|
80
80
|
return (
|
|
81
81
|
<View
|
|
82
82
|
accessibilityHint="Contains a prompt and list of options to select"
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
aria-label={title}
|
|
84
|
+
aria-role="combobox"
|
|
85
85
|
style={{
|
|
86
86
|
display: "flex",
|
|
87
87
|
width: "100%",
|
package/src/Pagination.tsx
CHANGED
package/src/PickerSelect.tsx
CHANGED
|
@@ -253,8 +253,8 @@ export function RNPickerSelect({
|
|
|
253
253
|
>
|
|
254
254
|
{Boolean(onUpArrow) && (
|
|
255
255
|
<TouchableOpacity
|
|
256
|
-
accessibilityRole="button"
|
|
257
256
|
activeOpacity={onUpArrow ? 0.5 : 1}
|
|
257
|
+
aria-role="button"
|
|
258
258
|
onPress={onUpArrow ? onUpArrowEvent : undefined}
|
|
259
259
|
>
|
|
260
260
|
<View
|
|
@@ -272,8 +272,8 @@ export function RNPickerSelect({
|
|
|
272
272
|
)}
|
|
273
273
|
{Boolean(onDownArrow) && (
|
|
274
274
|
<TouchableOpacity
|
|
275
|
-
accessibilityRole="button"
|
|
276
275
|
activeOpacity={onDownArrow ? 0.5 : 1}
|
|
276
|
+
aria-role="button"
|
|
277
277
|
onPress={onDownArrow ? onDownArrowEvent : undefined}
|
|
278
278
|
>
|
|
279
279
|
<View
|
|
@@ -359,7 +359,7 @@ export function RNPickerSelect({
|
|
|
359
359
|
}}
|
|
360
360
|
>
|
|
361
361
|
<TextInput
|
|
362
|
-
|
|
362
|
+
readOnly
|
|
363
363
|
style={{color: disabled ? theme.text.secondaryLight : theme.text.primary}}
|
|
364
364
|
testID="text_input"
|
|
365
365
|
value={selectedItem?.inputLabel ? selectedItem?.inputLabel : selectedItem?.label}
|
|
@@ -411,7 +411,7 @@ export function RNPickerSelect({
|
|
|
411
411
|
{...modalProps}
|
|
412
412
|
>
|
|
413
413
|
<Pressable
|
|
414
|
-
|
|
414
|
+
aria-role="button"
|
|
415
415
|
style={{
|
|
416
416
|
flex: 1,
|
|
417
417
|
}}
|
package/src/RadioField.tsx
CHANGED
|
@@ -21,8 +21,8 @@ export const RadioField = ({
|
|
|
21
21
|
<TouchableOpacity
|
|
22
22
|
key={option.key ?? option.value}
|
|
23
23
|
accessibilityHint={`Select ${option} from list of options`}
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
aria-label={option.label ?? option.value}
|
|
25
|
+
aria-role="button"
|
|
26
26
|
style={{
|
|
27
27
|
flexDirection: "row",
|
|
28
28
|
justifyContent: "space-between",
|
package/src/SegmentedControl.tsx
CHANGED
package/src/Text.tsx
CHANGED
|
@@ -105,7 +105,7 @@ export const Text = ({
|
|
|
105
105
|
lines = 1;
|
|
106
106
|
}
|
|
107
107
|
const inner = (
|
|
108
|
-
<NativeText numberOfLines={lines} style={style} testID={testID}>
|
|
108
|
+
<NativeText numberOfLines={lines} selectable={undefined} style={style} testID={testID}>
|
|
109
109
|
{children}
|
|
110
110
|
</NativeText>
|
|
111
111
|
);
|
package/src/TextField.tsx
CHANGED
|
@@ -89,23 +89,12 @@ export const TextField: FC<TextFieldProps> = ({
|
|
|
89
89
|
const [focused, setFocused] = useState(false);
|
|
90
90
|
const [height, setHeight] = useState(rows * 40);
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
return focused ? theme.border.focus : theme.border.dark;
|
|
99
|
-
}
|
|
100
|
-
}, [
|
|
101
|
-
disabled,
|
|
102
|
-
errorText,
|
|
103
|
-
focused,
|
|
104
|
-
theme.border.activeNeutral,
|
|
105
|
-
theme.border.dark,
|
|
106
|
-
theme.border.error,
|
|
107
|
-
theme.border.focus,
|
|
108
|
-
]);
|
|
92
|
+
let borderColor = focused ? theme.border.focus : theme.border.dark;
|
|
93
|
+
if (disabled) {
|
|
94
|
+
borderColor = theme.border.activeNeutral;
|
|
95
|
+
} else if (errorText) {
|
|
96
|
+
borderColor = theme.border.error;
|
|
97
|
+
}
|
|
109
98
|
|
|
110
99
|
const calculatedHeight: DimensionValue = useMemo(() => {
|
|
111
100
|
if (grow) {
|
|
@@ -174,18 +163,18 @@ export const TextField: FC<TextFieldProps> = ({
|
|
|
174
163
|
}
|
|
175
164
|
}}
|
|
176
165
|
accessibilityHint="Enter text here"
|
|
177
|
-
accessibilityLabel="Text input field"
|
|
178
166
|
accessibilityState={{disabled}}
|
|
167
|
+
aria-label="Text input field"
|
|
179
168
|
autoCapitalize={type === "text" ? "sentences" : "none"}
|
|
180
169
|
autoCorrect={shouldAutocorrect}
|
|
181
170
|
blurOnSubmit={blurOnSubmit}
|
|
182
|
-
editable={!disabled}
|
|
183
171
|
enterKeyHint={returnKeyType}
|
|
184
172
|
keyboardType={keyboardType as KeyboardTypeOptions}
|
|
185
173
|
multiline={multiline}
|
|
186
174
|
numberOfLines={rows || 4}
|
|
187
175
|
placeholder={placeholder}
|
|
188
176
|
placeholderTextColor={theme.text.secondaryLight}
|
|
177
|
+
readOnly={disabled}
|
|
189
178
|
secureTextEntry={type === "password"}
|
|
190
179
|
style={defaultTextInputStyles}
|
|
191
180
|
testID={testID}
|
|
@@ -224,7 +213,7 @@ export const TextField: FC<TextFieldProps> = ({
|
|
|
224
213
|
}}
|
|
225
214
|
/>
|
|
226
215
|
{Boolean(iconName) && (
|
|
227
|
-
<Pressable
|
|
216
|
+
<Pressable aria-role="button" onPress={onIconClick}>
|
|
228
217
|
<Icon iconName={iconName!} size="md" />
|
|
229
218
|
</Pressable>
|
|
230
219
|
)}
|
package/src/Toast.tsx
CHANGED
package/src/Tooltip.tsx
CHANGED
|
@@ -339,8 +339,8 @@ export const Tooltip: FC<TooltipProps> = ({text, children, idealPosition, includ
|
|
|
339
339
|
>
|
|
340
340
|
<Pressable
|
|
341
341
|
accessibilityHint="Tooltip information"
|
|
342
|
-
|
|
343
|
-
|
|
342
|
+
aria-label={text}
|
|
343
|
+
aria-role="button"
|
|
344
344
|
style={{
|
|
345
345
|
backgroundColor: theme.surface.secondaryExtraDark,
|
|
346
346
|
borderRadius: theme.radius.default,
|
package/src/Unifier.ts
CHANGED
|
@@ -24,8 +24,8 @@ export const TableBoolean: FC<TableBooleanProps> = ({value, isEditing = false})
|
|
|
24
24
|
return (
|
|
25
25
|
<TouchableOpacity
|
|
26
26
|
accessibilityHint={`Tap to change the checkbox from ${oppositeValueString} to ${valueString}`}
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
aria-label={`Checkbox is currently ${valueString}`}
|
|
28
|
+
aria-role="checkbox"
|
|
29
29
|
hitSlop={{top: 10, bottom: 10, left: 10, right: 10}}
|
|
30
30
|
style={
|
|
31
31
|
{
|
|
@@ -49,8 +49,8 @@ export const TableBoolean: FC<TableBooleanProps> = ({value, isEditing = false})
|
|
|
49
49
|
>
|
|
50
50
|
<View
|
|
51
51
|
accessibilityHint={value ? "Checked icon" : "Unchecked icon"}
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
aria-label={`The checkbox is ${valueString}`}
|
|
53
|
+
aria-role="image"
|
|
54
54
|
style={{
|
|
55
55
|
height: 32,
|
|
56
56
|
width: 32,
|
package/src/table/TableTitle.tsx
CHANGED
|
@@ -10,8 +10,8 @@ export const TableTitle: FC<TableTitleProps> = ({title, align = "left"}) => {
|
|
|
10
10
|
// No hint needed for a title.
|
|
11
11
|
// eslint-disable-next-line react-native-a11y/has-accessibility-hint
|
|
12
12
|
<Text
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
aria-label={`Table title: ${title}`}
|
|
14
|
+
aria-role="header"
|
|
15
15
|
ellipsizeMode="tail" // ensures that the text is clipped at the end of the line for all platforms
|
|
16
16
|
numberOfLines={3}
|
|
17
17
|
style={{
|