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.
Files changed (93) hide show
  1. package/dist/Accordion.js +3 -3
  2. package/dist/Accordion.js.map +1 -1
  3. package/dist/ActionSheet.d.ts +1 -9
  4. package/dist/ActionSheet.js +2 -7
  5. package/dist/ActionSheet.js.map +1 -1
  6. package/dist/Avatar.js +3 -3
  7. package/dist/Avatar.js.map +1 -1
  8. package/dist/Banner.js +1 -1
  9. package/dist/Banner.js.map +1 -1
  10. package/dist/BooleanField.js +1 -1
  11. package/dist/BooleanField.js.map +1 -1
  12. package/dist/Box.js +2 -10
  13. package/dist/Box.js.map +1 -1
  14. package/dist/Button.js +1 -1
  15. package/dist/Button.js.map +1 -1
  16. package/dist/CheckBox.js +1 -1
  17. package/dist/CheckBox.js.map +1 -1
  18. package/dist/Common.d.ts +8 -7
  19. package/dist/Common.js.map +1 -1
  20. package/dist/CustomSelectField.js +3 -3
  21. package/dist/CustomSelectField.js.map +1 -1
  22. package/dist/DateTimeActionSheet.js +3 -3
  23. package/dist/DateTimeActionSheet.js.map +1 -1
  24. package/dist/DismissButton.js +1 -1
  25. package/dist/DismissButton.js.map +1 -1
  26. package/dist/Icon.js +1 -1
  27. package/dist/Icon.js.map +1 -1
  28. package/dist/IconButton.js +2 -2
  29. package/dist/IconButton.js.map +1 -1
  30. package/dist/Link.js +1 -1
  31. package/dist/Link.js.map +1 -1
  32. package/dist/MobileAddressAutoComplete.js +1 -1
  33. package/dist/MobileAddressAutoComplete.js.map +1 -1
  34. package/dist/Modal.js +7 -13
  35. package/dist/Modal.js.map +1 -1
  36. package/dist/MultiselectField.js +2 -2
  37. package/dist/MultiselectField.js.map +1 -1
  38. package/dist/Pagination.js +1 -1
  39. package/dist/Pagination.js.map +1 -1
  40. package/dist/PickerSelect.js +4 -4
  41. package/dist/PickerSelect.js.map +1 -1
  42. package/dist/RadioField.js +1 -1
  43. package/dist/RadioField.js.map +1 -1
  44. package/dist/SegmentedControl.js +1 -1
  45. package/dist/SegmentedControl.js.map +1 -1
  46. package/dist/Text.js +1 -1
  47. package/dist/Text.js.map +1 -1
  48. package/dist/TextField.js +9 -21
  49. package/dist/TextField.js.map +1 -1
  50. package/dist/Toast.js +1 -1
  51. package/dist/Toast.js.map +1 -1
  52. package/dist/Tooltip.js +1 -1
  53. package/dist/Tooltip.js.map +1 -1
  54. package/dist/Unifier.d.ts +0 -1
  55. package/dist/Unifier.js +6 -7
  56. package/dist/Unifier.js.map +1 -1
  57. package/dist/table/TableBoolean.js +2 -2
  58. package/dist/table/TableBoolean.js.map +1 -1
  59. package/dist/table/TableHeaderCell.js +1 -1
  60. package/dist/table/TableHeaderCell.js.map +1 -1
  61. package/dist/table/TableTitle.js +1 -1
  62. package/dist/table/TableTitle.js.map +1 -1
  63. package/package.json +2 -1
  64. package/src/Accordion.tsx +3 -2
  65. package/src/ActionSheet.tsx +2 -7
  66. package/src/Avatar.tsx +4 -4
  67. package/src/Banner.tsx +2 -2
  68. package/src/BooleanField.tsx +10 -4
  69. package/src/Box.tsx +3 -11
  70. package/src/Button.tsx +2 -2
  71. package/src/CheckBox.tsx +1 -1
  72. package/src/Common.ts +12 -11
  73. package/src/CustomSelectField.tsx +5 -5
  74. package/src/DateTimeActionSheet.tsx +4 -4
  75. package/src/DismissButton.tsx +2 -2
  76. package/src/Icon.tsx +1 -0
  77. package/src/IconButton.tsx +3 -2
  78. package/src/Link.tsx +2 -2
  79. package/src/MobileAddressAutoComplete.tsx +1 -1
  80. package/src/Modal.tsx +12 -18
  81. package/src/MultiselectField.tsx +4 -4
  82. package/src/Pagination.tsx +1 -1
  83. package/src/PickerSelect.tsx +4 -4
  84. package/src/RadioField.tsx +2 -2
  85. package/src/SegmentedControl.tsx +1 -1
  86. package/src/Text.tsx +1 -1
  87. package/src/TextField.tsx +9 -20
  88. package/src/Toast.tsx +1 -1
  89. package/src/Tooltip.tsx +2 -2
  90. package/src/Unifier.ts +0 -4
  91. package/src/table/TableBoolean.tsx +4 -4
  92. package/src/table/TableHeaderCell.tsx +1 -0
  93. 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
- shadowColor: "#000",
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
- accessibilityLabel="Close modal"
90
- accessibilityRole="button"
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
- accessibilityLabel={title}
110
- accessibilityRole="header"
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
- accessibilityLabel={subtitle}
120
- accessibilityRole="text"
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
- accessibilityLabel={text}
130
- accessibilityRole="text"
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 accessibilityRole="text" style={{marginTop: text ? 0 : 12}}>
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
- accessibilityLabel="Pull down bar"
225
- accessibilityRole="adjustable"
218
+ aria-label="Pull down bar"
219
+ aria-role="adjustable"
226
220
  style={{
227
221
  justifyContent: "center",
228
222
  alignItems: "center",
@@ -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
- accessibilityLabel={label ?? value}
35
- accessibilityRole="checkbox"
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
- accessibilityLabel={title}
84
- accessibilityRole="combobox"
83
+ aria-label={title}
84
+ aria-role="combobox"
85
85
  style={{
86
86
  display: "flex",
87
87
  width: "100%",
@@ -36,7 +36,7 @@ const PaginationButton = ({
36
36
  return (
37
37
  <Pressable
38
38
  accessibilityHint={`Click to go to ${type} page`}
39
- accessibilityLabel="Pagination Button"
39
+ aria-label="Pagination Button"
40
40
  disabled={disabled}
41
41
  style={{
42
42
  width: 32,
@@ -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
- editable={false}
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
- accessibilityRole="button"
414
+ aria-role="button"
415
415
  style={{
416
416
  flex: 1,
417
417
  }}
@@ -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
- accessibilityLabel={option.label ?? option.value}
25
- accessibilityRole="button"
24
+ aria-label={option.label ?? option.value}
25
+ aria-role="button"
26
26
  style={{
27
27
  flexDirection: "row",
28
28
  justifyContent: "space-between",
@@ -33,7 +33,7 @@ export const SegmentedControl = ({
33
33
  {items.map((item, index) => (
34
34
  <Pressable
35
35
  key={index}
36
- accessibilityRole="button"
36
+ aria-role="button"
37
37
  style={{
38
38
  display: "flex",
39
39
  paddingHorizontal: size === "md" ? theme.spacing.sm : theme.spacing.md,
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
- const borderColor = useMemo(() => {
93
- if (disabled) {
94
- return theme.border.activeNeutral;
95
- } else if (errorText) {
96
- return theme.border.error;
97
- } else {
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 accessibilityRole="button" onPress={onIconClick}>
216
+ <Pressable aria-role="button" onPress={onIconClick}>
228
217
  <Icon iconName={iconName!} size="md" />
229
218
  </Pressable>
230
219
  )}
package/src/Toast.tsx CHANGED
@@ -214,7 +214,7 @@ export const Toast = ({
214
214
  </View>
215
215
  {Boolean(persistent && onDismiss) && (
216
216
  <Pressable
217
- accessibilityRole="button"
217
+ aria-role="button"
218
218
  style={{
219
219
  display: "flex",
220
220
  alignItems: "center",
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
- accessibilityLabel={text}
343
- accessibilityRole="button"
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
@@ -75,10 +75,6 @@ class UnifierClass {
75
75
  return this._dev;
76
76
  }
77
77
 
78
- constructor() {
79
- console.debug("[unifier] Setting up Unifier");
80
- }
81
-
82
78
  navigation = {
83
79
  dismissOverlay: () => {
84
80
  console.warn("Dismiss overlay not supported.");
@@ -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
- accessibilityLabel={`Checkbox is currently ${valueString}`}
28
- accessibilityRole="checkbox"
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
- accessibilityLabel={`The checkbox is ${valueString}`}
53
- accessibilityRole="image"
52
+ aria-label={`The checkbox is ${valueString}`}
53
+ aria-role="image"
54
54
  style={{
55
55
  height: 32,
56
56
  width: 32,
@@ -82,6 +82,7 @@ export const TableHeaderCell = ({
82
82
  <FontAwesome6
83
83
  color={theme.text.inverted}
84
84
  name={sort === "asc" ? "arrow-down" : "arrow-up"}
85
+ selectable={undefined}
85
86
  size={10}
86
87
  solid
87
88
  />
@@ -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
- accessibilityLabel={`Table title: ${title}`}
14
- accessibilityRole="header"
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={{