@terreno/ui 0.13.3 → 0.14.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/ActionSheet.d.ts +4 -4
- package/dist/ActionSheet.js.map +1 -1
- package/dist/Avatar.js +1 -1
- package/dist/Avatar.js.map +1 -1
- package/dist/Banner.js.map +1 -1
- package/dist/Box.js +2 -0
- package/dist/Box.js.map +1 -1
- package/dist/Button.d.ts +2 -2
- package/dist/Button.js +35 -23
- package/dist/Button.js.map +1 -1
- package/dist/Common.d.ts +8 -2
- package/dist/Common.js.map +1 -1
- package/dist/ConsentFormScreen.js +1 -1
- package/dist/ConsentFormScreen.js.map +1 -1
- package/dist/ConsentNavigator.d.ts +1 -1
- package/dist/ConsentNavigator.js +2 -1
- package/dist/ConsentNavigator.js.map +1 -1
- package/dist/CustomSelectField.js +3 -1
- package/dist/CustomSelectField.js.map +1 -1
- package/dist/DataTable.js +1 -1
- package/dist/DataTable.js.map +1 -1
- package/dist/DateTimeActionSheet.js +2 -1
- package/dist/DateTimeActionSheet.js.map +1 -1
- package/dist/DateTimeField.js +3 -2
- package/dist/DateTimeField.js.map +1 -1
- package/dist/DateUtilities.js.map +1 -1
- package/dist/HeightField.js.map +1 -1
- package/dist/Hyperlink.js +19 -9
- package/dist/Hyperlink.js.map +1 -1
- package/dist/IconButton.js.map +1 -1
- package/dist/ImageBackground.d.ts +2 -5
- package/dist/ImageBackground.js +1 -1
- package/dist/ImageBackground.js.map +1 -1
- package/dist/ModalSheet.d.ts +3 -2
- package/dist/ModalSheet.js +1 -1
- package/dist/ModalSheet.js.map +1 -1
- package/dist/OfflineBanner.d.ts +21 -0
- package/dist/OfflineBanner.js +25 -0
- package/dist/OfflineBanner.js.map +1 -0
- package/dist/OpenAPIContext.js +1 -1
- package/dist/OpenAPIContext.js.map +1 -1
- package/dist/Page.js +1 -0
- package/dist/Page.js.map +1 -1
- package/dist/Pagination.js.map +1 -1
- package/dist/Permissions.js +3 -0
- package/dist/Permissions.js.map +1 -1
- package/dist/PickerSelect.js +7 -4
- package/dist/PickerSelect.js.map +1 -1
- package/dist/SelectField.js +1 -1
- package/dist/SelectField.js.map +1 -1
- package/dist/SplitPage.js +7 -2
- package/dist/SplitPage.js.map +1 -1
- package/dist/SplitPage.native.js +4 -1
- package/dist/SplitPage.native.js.map +1 -1
- package/dist/TapToEdit.js +10 -11
- package/dist/TapToEdit.js.map +1 -1
- package/dist/Toast.js.map +1 -1
- package/dist/ToastNotifications.js.map +1 -1
- package/dist/Unifier.d.ts +2 -2
- package/dist/Unifier.js +1 -1
- package/dist/Unifier.js.map +1 -1
- package/dist/Utilities.d.ts +8 -4
- package/dist/Utilities.js +1 -1
- package/dist/Utilities.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/src/ActionSheet.test.tsx +1 -0
- package/src/ActionSheet.tsx +6 -4
- package/src/Avatar.tsx +9 -2
- package/src/Badge.test.tsx +1 -0
- package/src/Banner.tsx +1 -1
- package/src/Box.test.tsx +1 -0
- package/src/Box.tsx +10 -6
- package/src/Button.test.tsx +35 -0
- package/src/Button.tsx +65 -34
- package/src/Common.ts +32 -15
- package/src/ConsentFormScreen.test.tsx +102 -0
- package/src/ConsentFormScreen.tsx +9 -3
- package/src/ConsentNavigator.test.tsx +1 -0
- package/src/ConsentNavigator.tsx +5 -3
- package/src/CustomSelectField.tsx +3 -1
- package/src/DataTable.test.tsx +1 -0
- package/src/DataTable.tsx +1 -1
- package/src/DateTimeActionSheet.tsx +7 -3
- package/src/DateTimeField.test.tsx +1 -0
- package/src/DateTimeField.tsx +3 -2
- package/src/DateUtilities.test.ts +111 -0
- package/src/DateUtilities.tsx +6 -6
- package/src/DecimalRangeActionSheet.test.tsx +28 -0
- package/src/ErrorBoundary.test.tsx +1 -0
- package/src/HeightField.tsx +2 -1
- package/src/Hyperlink.tsx +83 -52
- package/src/IconButton.tsx +1 -1
- package/src/ImageBackground.tsx +5 -6
- package/src/ModalSheet.test.tsx +1 -5
- package/src/ModalSheet.tsx +15 -6
- package/src/NumberField.test.tsx +14 -0
- package/src/OfflineBanner.test.tsx +70 -0
- package/src/OfflineBanner.tsx +54 -0
- package/src/OpenAPIContext.tsx +3 -2
- package/src/Page.tsx +1 -0
- package/src/Pagination.tsx +1 -1
- package/src/Permissions.ts +3 -0
- package/src/PickerSelect.tsx +17 -14
- package/src/SelectBadge.test.tsx +1 -0
- package/src/SelectField.tsx +1 -1
- package/src/Signature.test.tsx +1 -0
- package/src/SplitPage.native.tsx +2 -0
- package/src/SplitPage.tsx +6 -1
- package/src/TapToEdit.test.tsx +17 -0
- package/src/TapToEdit.tsx +11 -11
- package/src/Toast.tsx +1 -1
- package/src/ToastNotifications.tsx +1 -4
- package/src/Tooltip.test.tsx +0 -7
- package/src/Unifier.ts +6 -5
- package/src/Utilities.tsx +9 -6
- package/src/__snapshots__/AddressField.test.tsx.snap +3 -1
- package/src/__snapshots__/Button.test.tsx.snap +92 -50
- package/src/__snapshots__/CustomSelectField.test.tsx.snap +21 -7
- package/src/__snapshots__/DecimalRangeActionSheet.test.tsx.snap +14 -8
- package/src/__snapshots__/ErrorPage.test.tsx.snap +7 -4
- package/src/__snapshots__/Field.test.tsx.snap +18 -6
- package/src/__snapshots__/HeightActionSheet.test.tsx.snap +14 -8
- package/src/__snapshots__/HeightField.test.tsx.snap +35 -20
- package/src/__snapshots__/InfoModalIcon.test.tsx.snap +28 -16
- package/src/__snapshots__/Modal.test.tsx.snap +19 -10
- package/src/__snapshots__/ModalSheet.test.tsx.snap +0 -1
- package/src/__snapshots__/NumberPickerActionSheet.test.tsx.snap +14 -8
- package/src/__snapshots__/Page.test.tsx.snap +7 -4
- package/src/__snapshots__/SelectField.test.tsx.snap +18 -6
- package/src/__snapshots__/TerrenoProvider.test.tsx.snap +0 -2
- package/src/__snapshots__/TimezonePicker.test.tsx.snap +18 -6
- package/src/bunSetup.ts +25 -2
- package/src/index.tsx +1 -0
- package/src/login/__snapshots__/LoginScreen.test.tsx.snap +15 -6
- package/src/signUp/__snapshots__/SignUpScreen.test.tsx.snap +10 -4
- package/src/table/__snapshots__/TableBadge.test.tsx.snap +3 -1
- package/src/types/react-native-swiper-flatlist.d.ts +1 -0
package/src/SplitPage.tsx
CHANGED
|
@@ -40,6 +40,7 @@ export const SplitPage = ({
|
|
|
40
40
|
const elementArray = Children.toArray(children).filter((c) => c !== null);
|
|
41
41
|
|
|
42
42
|
const onItemSelect = useCallback(
|
|
43
|
+
// biome-ignore lint/suspicious/noExplicitAny: SplitPage accepts heterogeneous list item shapes from consumers; the generic propagates from listViewData
|
|
43
44
|
async (item: ListRenderItemInfo<any>): Promise<void> => {
|
|
44
45
|
setSelectedId(item.index);
|
|
45
46
|
await onSelectionChange(item);
|
|
@@ -69,6 +70,7 @@ export const SplitPage = ({
|
|
|
69
70
|
return null;
|
|
70
71
|
}
|
|
71
72
|
|
|
73
|
+
// biome-ignore lint/suspicious/noExplicitAny: SplitPage accepts heterogeneous list item shapes from consumers; the generic propagates from listViewData
|
|
72
74
|
const renderItem = (itemInfo: ListRenderItemInfo<any>) => {
|
|
73
75
|
return (
|
|
74
76
|
<Box
|
|
@@ -297,7 +299,10 @@ export const SplitPage = ({
|
|
|
297
299
|
padding={2}
|
|
298
300
|
width="100%"
|
|
299
301
|
>
|
|
300
|
-
{loading === true &&
|
|
302
|
+
{loading === true && (
|
|
303
|
+
// biome-ignore lint/suspicious/noExplicitAny: Spinner color is a token enum but the legacy code passes theme.text.primary (a resolved hex string); preserving original behavior
|
|
304
|
+
<Spinner color={theme.text.primary as any} size="md" />
|
|
305
|
+
)}
|
|
301
306
|
{isMobileDevice ? renderMobileSplitPage() : renderSplitPage()}
|
|
302
307
|
</Box>
|
|
303
308
|
);
|
package/src/TapToEdit.test.tsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// biome-ignore-all lint/suspicious/noExplicitAny: test mock typing
|
|
1
2
|
import {describe, expect, it, mock} from "bun:test";
|
|
2
3
|
import {act, fireEvent} from "@testing-library/react-native";
|
|
3
4
|
import {Linking} from "react-native";
|
|
@@ -211,6 +212,22 @@ describe("TapToEdit", () => {
|
|
|
211
212
|
expect(setValue).toHaveBeenCalled();
|
|
212
213
|
});
|
|
213
214
|
|
|
215
|
+
it("reverts to original value (not edited value) when Cancel is pressed", async () => {
|
|
216
|
+
const setValue = mock((_v: unknown) => {});
|
|
217
|
+
const {getByLabelText, getByText} = renderWithTheme(
|
|
218
|
+
<TapToEdit setValue={setValue} title="Name" value="Jane" />
|
|
219
|
+
);
|
|
220
|
+
await act(async () => {
|
|
221
|
+
fireEvent.press(getByLabelText("Edit"));
|
|
222
|
+
});
|
|
223
|
+
// Simulate user having changed the value during editing
|
|
224
|
+
setValue("Edited Value");
|
|
225
|
+
await act(async () => {
|
|
226
|
+
fireEvent.press(getByText("Cancel"));
|
|
227
|
+
});
|
|
228
|
+
expect(setValue).toHaveBeenLastCalledWith("Jane");
|
|
229
|
+
});
|
|
230
|
+
|
|
214
231
|
it("clears value when Clear button is pressed", async () => {
|
|
215
232
|
const setValue = mock(() => {});
|
|
216
233
|
const onSave = mock(() => Promise.resolve());
|
package/src/TapToEdit.tsx
CHANGED
|
@@ -81,15 +81,11 @@ export const TapToEdit: FC<TapToEditProps> = ({
|
|
|
81
81
|
...fieldProps
|
|
82
82
|
}) => {
|
|
83
83
|
const [editing, setEditing] = useState(false);
|
|
84
|
-
const
|
|
84
|
+
const initialValueRef = useRef<unknown>(undefined);
|
|
85
85
|
const helperText: string | undefined = propsHelperText;
|
|
86
|
-
// setInitialValue is called after initial render to handle the case where the value is updated
|
|
87
|
-
useEffect(() => {
|
|
88
|
-
setInitialValue(value);
|
|
89
|
-
// do not update if value changes
|
|
90
|
-
}, [value]);
|
|
91
86
|
|
|
92
87
|
// TODO: Auto focus on input when editing for field types other than text for accessibility
|
|
88
|
+
// biome-ignore lint/suspicious/noExplicitAny: inputRef references various RN input components (TextInput, etc.) depending on the field type
|
|
93
89
|
const inputRef = useRef<any>(null);
|
|
94
90
|
|
|
95
91
|
// bring the bring the input into focus when editing from within the component,
|
|
@@ -116,13 +112,16 @@ export const TapToEdit: FC<TapToEditProps> = ({
|
|
|
116
112
|
helperText={helperText}
|
|
117
113
|
inputRef={
|
|
118
114
|
["text", "textarea", "url", "email", "number"].includes(fieldProps?.type)
|
|
119
|
-
? (ref:
|
|
115
|
+
? (ref: unknown) => {
|
|
116
|
+
inputRef.current = ref;
|
|
117
|
+
}
|
|
120
118
|
: undefined
|
|
121
119
|
}
|
|
122
120
|
onChange={setValue ?? (() => {})}
|
|
123
121
|
row={fieldProps?.type === "textarea" ? 5 : undefined}
|
|
124
122
|
type={(fieldProps?.type ?? "text") as NonNullable<FieldProps["type"]>}
|
|
125
123
|
value={value}
|
|
124
|
+
// biome-ignore lint/suspicious/noExplicitAny: fieldProps is a discriminated union (FieldProps) but the spread loses narrowing; type-checking each variant individually is impractical here
|
|
126
125
|
{...(fieldProps as any)}
|
|
127
126
|
/>
|
|
128
127
|
{editing && !isEditing && (
|
|
@@ -130,7 +129,7 @@ export const TapToEdit: FC<TapToEditProps> = ({
|
|
|
130
129
|
<Button
|
|
131
130
|
onClick={(): void => {
|
|
132
131
|
if (setValue) {
|
|
133
|
-
setValue(
|
|
132
|
+
setValue(initialValueRef.current);
|
|
134
133
|
}
|
|
135
134
|
setEditing(false);
|
|
136
135
|
}}
|
|
@@ -142,7 +141,6 @@ export const TapToEdit: FC<TapToEditProps> = ({
|
|
|
142
141
|
onClick={(): void => {
|
|
143
142
|
if (setValue) {
|
|
144
143
|
setValue("");
|
|
145
|
-
setInitialValue("" as any);
|
|
146
144
|
}
|
|
147
145
|
if (onSave) {
|
|
148
146
|
onSave("");
|
|
@@ -161,7 +159,6 @@ export const TapToEdit: FC<TapToEditProps> = ({
|
|
|
161
159
|
if (!onSave) {
|
|
162
160
|
console.error("No onSave provided for editable TapToEdit");
|
|
163
161
|
} else {
|
|
164
|
-
setInitialValue(value);
|
|
165
162
|
await onSave(value);
|
|
166
163
|
}
|
|
167
164
|
setEditing(false);
|
|
@@ -271,7 +268,10 @@ export const TapToEdit: FC<TapToEditProps> = ({
|
|
|
271
268
|
accessibilityHint=""
|
|
272
269
|
accessibilityLabel="Edit"
|
|
273
270
|
marginLeft={2}
|
|
274
|
-
onClick={(): void =>
|
|
271
|
+
onClick={(): void => {
|
|
272
|
+
initialValueRef.current = value;
|
|
273
|
+
setEditing(true);
|
|
274
|
+
}}
|
|
275
275
|
width={16}
|
|
276
276
|
>
|
|
277
277
|
<Icon iconName="pencil" size="md" />
|
package/src/Toast.tsx
CHANGED
|
@@ -48,7 +48,7 @@ export const useToast = (): {
|
|
|
48
48
|
};
|
|
49
49
|
return {
|
|
50
50
|
catch: (error: unknown, message?: string, options?: UseToastVariantOptions): void => {
|
|
51
|
-
let exceptionMsg;
|
|
51
|
+
let exceptionMsg: string;
|
|
52
52
|
if (isAPIError(error)) {
|
|
53
53
|
// Get the error without details.
|
|
54
54
|
exceptionMsg = `${message}: ${printAPIError(error)}`;
|
|
@@ -177,10 +177,7 @@ export interface ToastOptions {
|
|
|
177
177
|
/**
|
|
178
178
|
* Payload data for custom toasts. You can pass whatever you want
|
|
179
179
|
*/
|
|
180
|
-
// noExplicitAny: This is the public API of a vendored 3rd-party library
|
|
181
|
-
// (react-native-toast-notifications); the `data` field is an opaque
|
|
182
|
-
// user-provided payload. Tightening to `unknown` breaks downstream consumers
|
|
183
|
-
// that spread `data` into `Toast` (e.g. TerrenoProvider) without refactor.
|
|
180
|
+
// biome-ignore lint/suspicious/noExplicitAny: This is the public API of a vendored 3rd-party library (react-native-toast-notifications); the data field is an opaque user-provided payload. Tightening to unknown breaks downstream consumers that spread data into Toast (e.g. TerrenoProvider) without refactor.
|
|
184
181
|
data?: any;
|
|
185
182
|
|
|
186
183
|
swipeEnabled?: boolean;
|
package/src/Tooltip.test.tsx
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {beforeAll, describe, expect, it, mock} from "bun:test";
|
|
2
2
|
import {act} from "@testing-library/react-native";
|
|
3
|
-
import {View} from "react-native";
|
|
4
3
|
|
|
5
4
|
import {Text} from "./Text";
|
|
6
5
|
import {Tooltip} from "./Tooltip";
|
|
@@ -20,12 +19,6 @@ interface TestNode {
|
|
|
20
19
|
children: null | Array<TestNode | string>;
|
|
21
20
|
}
|
|
22
21
|
|
|
23
|
-
// Mock react-native-portalize so Portal renders inline in tests
|
|
24
|
-
mock.module("react-native-portalize", () => ({
|
|
25
|
-
Host: ({children}: {children: React.ReactNode}) => <View testID="portal-host">{children}</View>,
|
|
26
|
-
Portal: ({children}: {children: React.ReactNode}) => <View testID="portal">{children}</View>,
|
|
27
|
-
}));
|
|
28
|
-
|
|
29
22
|
beforeAll(() => {
|
|
30
23
|
globalThis.requestAnimationFrame = (callback: FrameRequestCallback) => {
|
|
31
24
|
return setTimeout(() => callback(Date.now()), 0) as unknown as number;
|
package/src/Unifier.ts
CHANGED
|
@@ -8,6 +8,7 @@ import {requestPermissions} from "./Permissions";
|
|
|
8
8
|
|
|
9
9
|
declare global {
|
|
10
10
|
interface Window {
|
|
11
|
+
// biome-ignore lint/suspicious/noExplicitAny: Google Maps JS SDK global type is loaded dynamically and not bundled as a typed dependency
|
|
11
12
|
google: any;
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -25,7 +26,7 @@ export function changeColorLuminance(hex: string, luminanceChange: Luminance) {
|
|
|
25
26
|
} else if (hex.length !== 6) {
|
|
26
27
|
throw new Error(`Invalid color hex: ${hex}`);
|
|
27
28
|
}
|
|
28
|
-
let luminance;
|
|
29
|
+
let luminance: number;
|
|
29
30
|
switch (luminanceChange) {
|
|
30
31
|
case "light":
|
|
31
32
|
luminance = -0.2;
|
|
@@ -127,7 +128,7 @@ class UnifierClass {
|
|
|
127
128
|
};
|
|
128
129
|
|
|
129
130
|
storage = {
|
|
130
|
-
getItem: async (key: string, defaultValue?:
|
|
131
|
+
getItem: async (key: string, defaultValue?: unknown) => {
|
|
131
132
|
try {
|
|
132
133
|
const jsonValue = await AsyncStorage.getItem(key);
|
|
133
134
|
if (jsonValue) {
|
|
@@ -147,13 +148,13 @@ class UnifierClass {
|
|
|
147
148
|
return defaultValue || null;
|
|
148
149
|
}
|
|
149
150
|
},
|
|
150
|
-
setItem: async (key: string, item:
|
|
151
|
+
setItem: async (key: string, item: unknown) => {
|
|
151
152
|
try {
|
|
152
153
|
const jsonValue = JSON.stringify(item);
|
|
153
154
|
await AsyncStorage.setItem(key, jsonValue);
|
|
154
|
-
} catch (error:
|
|
155
|
+
} catch (error: unknown) {
|
|
155
156
|
console.error(`[storage] Error storing ${key}`, item, error);
|
|
156
|
-
throw new Error(error);
|
|
157
|
+
throw new Error(error instanceof Error ? error.message : String(error));
|
|
157
158
|
}
|
|
158
159
|
},
|
|
159
160
|
};
|
package/src/Utilities.tsx
CHANGED
|
@@ -6,7 +6,10 @@ import {Platform} from "react-native";
|
|
|
6
6
|
import type {APIError, BaseProfile, IconSize} from "./Common";
|
|
7
7
|
import {COUNTY_AND_COUNTY_EQUIVALENT_ENTITIES} from "./Constants";
|
|
8
8
|
|
|
9
|
-
export function mergeInlineStyles(
|
|
9
|
+
export function mergeInlineStyles(
|
|
10
|
+
inlineStyle?: {__style?: Record<string, unknown>} | undefined,
|
|
11
|
+
newStyle?: Record<string, unknown> | undefined
|
|
12
|
+
) {
|
|
10
13
|
const inline = get(inlineStyle, "__style");
|
|
11
14
|
return {
|
|
12
15
|
__style: {
|
|
@@ -104,7 +107,7 @@ export const toProps = ({
|
|
|
104
107
|
className,
|
|
105
108
|
inlineStyle,
|
|
106
109
|
}: Style): {className: string; style: InlineStyle} => {
|
|
107
|
-
const props:
|
|
110
|
+
const props: {className?: string; style?: InlineStyle} = {};
|
|
108
111
|
|
|
109
112
|
if (className.size > 0) {
|
|
110
113
|
// Sorting here ensures that classNames are always stable, reducing diff
|
|
@@ -117,7 +120,7 @@ export const toProps = ({
|
|
|
117
120
|
props.style = inlineStyle;
|
|
118
121
|
}
|
|
119
122
|
|
|
120
|
-
return props;
|
|
123
|
+
return props as {className: string; style: InlineStyle};
|
|
121
124
|
};
|
|
122
125
|
|
|
123
126
|
/*
|
|
@@ -173,7 +176,7 @@ export function bind<T>(
|
|
|
173
176
|
| {
|
|
174
177
|
readonly [key: string]: string;
|
|
175
178
|
}
|
|
176
|
-
|
|
|
179
|
+
| Record<string, string>
|
|
177
180
|
): (val: T) => Style {
|
|
178
181
|
const map = mapClassName((name) => scope[name]);
|
|
179
182
|
return (val: T): Style => map(fn(val));
|
|
@@ -316,8 +319,8 @@ export function formattedCountyCode(state: string, countyName: string): string {
|
|
|
316
319
|
return `${countyData.stateFP}${countyData.countyFP}`;
|
|
317
320
|
}
|
|
318
321
|
|
|
319
|
-
export function isAPIError(error:
|
|
320
|
-
return error?.data?.title;
|
|
322
|
+
export function isAPIError(error: unknown): error is APIError {
|
|
323
|
+
return Boolean((error as {data?: {title?: unknown}} | null | undefined)?.data?.title);
|
|
321
324
|
}
|
|
322
325
|
|
|
323
326
|
export function printAPIError(error: APIError, details = true): string {
|
|
@@ -45,9 +45,12 @@ exports[`Button renders correctly with default props 1`] = `
|
|
|
45
45
|
],
|
|
46
46
|
"props": {
|
|
47
47
|
"accessibilityHint": "Press to perform action",
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
48
|
+
"accessibilityLabel": "Click me",
|
|
49
|
+
"accessibilityRole": "button",
|
|
50
|
+
"accessibilityState": {
|
|
51
|
+
"disabled": false,
|
|
52
|
+
},
|
|
53
|
+
"disabled": false,
|
|
51
54
|
"onPress": [Function: debounced],
|
|
52
55
|
"style": {
|
|
53
56
|
"alignItems": "center",
|
|
@@ -64,7 +67,7 @@ exports[`Button renders correctly with default props 1`] = `
|
|
|
64
67
|
},
|
|
65
68
|
"testID": undefined,
|
|
66
69
|
},
|
|
67
|
-
"type": "
|
|
70
|
+
"type": "PressableScale",
|
|
68
71
|
}
|
|
69
72
|
`;
|
|
70
73
|
|
|
@@ -113,9 +116,12 @@ exports[`Button renders primary variant 1`] = `
|
|
|
113
116
|
],
|
|
114
117
|
"props": {
|
|
115
118
|
"accessibilityHint": "Press to perform action",
|
|
116
|
-
"
|
|
117
|
-
"
|
|
118
|
-
"
|
|
119
|
+
"accessibilityLabel": "Primary",
|
|
120
|
+
"accessibilityRole": "button",
|
|
121
|
+
"accessibilityState": {
|
|
122
|
+
"disabled": false,
|
|
123
|
+
},
|
|
124
|
+
"disabled": false,
|
|
119
125
|
"onPress": [Function: debounced],
|
|
120
126
|
"style": {
|
|
121
127
|
"alignItems": "center",
|
|
@@ -132,7 +138,7 @@ exports[`Button renders primary variant 1`] = `
|
|
|
132
138
|
},
|
|
133
139
|
"testID": undefined,
|
|
134
140
|
},
|
|
135
|
-
"type": "
|
|
141
|
+
"type": "PressableScale",
|
|
136
142
|
}
|
|
137
143
|
`;
|
|
138
144
|
|
|
@@ -181,9 +187,12 @@ exports[`Button renders secondary variant 1`] = `
|
|
|
181
187
|
],
|
|
182
188
|
"props": {
|
|
183
189
|
"accessibilityHint": "Press to perform action",
|
|
184
|
-
"
|
|
185
|
-
"
|
|
186
|
-
"
|
|
190
|
+
"accessibilityLabel": "Secondary",
|
|
191
|
+
"accessibilityRole": "button",
|
|
192
|
+
"accessibilityState": {
|
|
193
|
+
"disabled": false,
|
|
194
|
+
},
|
|
195
|
+
"disabled": false,
|
|
187
196
|
"onPress": [Function: debounced],
|
|
188
197
|
"style": {
|
|
189
198
|
"alignItems": "center",
|
|
@@ -200,7 +209,7 @@ exports[`Button renders secondary variant 1`] = `
|
|
|
200
209
|
},
|
|
201
210
|
"testID": undefined,
|
|
202
211
|
},
|
|
203
|
-
"type": "
|
|
212
|
+
"type": "PressableScale",
|
|
204
213
|
}
|
|
205
214
|
`;
|
|
206
215
|
|
|
@@ -249,9 +258,12 @@ exports[`Button renders muted variant 1`] = `
|
|
|
249
258
|
],
|
|
250
259
|
"props": {
|
|
251
260
|
"accessibilityHint": "Press to perform action",
|
|
252
|
-
"
|
|
253
|
-
"
|
|
254
|
-
"
|
|
261
|
+
"accessibilityLabel": "Muted",
|
|
262
|
+
"accessibilityRole": "button",
|
|
263
|
+
"accessibilityState": {
|
|
264
|
+
"disabled": false,
|
|
265
|
+
},
|
|
266
|
+
"disabled": false,
|
|
255
267
|
"onPress": [Function: debounced],
|
|
256
268
|
"style": {
|
|
257
269
|
"alignItems": "center",
|
|
@@ -268,7 +280,7 @@ exports[`Button renders muted variant 1`] = `
|
|
|
268
280
|
},
|
|
269
281
|
"testID": undefined,
|
|
270
282
|
},
|
|
271
|
-
"type": "
|
|
283
|
+
"type": "PressableScale",
|
|
272
284
|
}
|
|
273
285
|
`;
|
|
274
286
|
|
|
@@ -317,9 +329,12 @@ exports[`Button renders outline variant 1`] = `
|
|
|
317
329
|
],
|
|
318
330
|
"props": {
|
|
319
331
|
"accessibilityHint": "Press to perform action",
|
|
320
|
-
"
|
|
321
|
-
"
|
|
322
|
-
"
|
|
332
|
+
"accessibilityLabel": "Outline",
|
|
333
|
+
"accessibilityRole": "button",
|
|
334
|
+
"accessibilityState": {
|
|
335
|
+
"disabled": false,
|
|
336
|
+
},
|
|
337
|
+
"disabled": false,
|
|
323
338
|
"onPress": [Function: debounced],
|
|
324
339
|
"style": {
|
|
325
340
|
"alignItems": "center",
|
|
@@ -336,7 +351,7 @@ exports[`Button renders outline variant 1`] = `
|
|
|
336
351
|
},
|
|
337
352
|
"testID": undefined,
|
|
338
353
|
},
|
|
339
|
-
"type": "
|
|
354
|
+
"type": "PressableScale",
|
|
340
355
|
}
|
|
341
356
|
`;
|
|
342
357
|
|
|
@@ -385,9 +400,12 @@ exports[`Button renders destructive variant 1`] = `
|
|
|
385
400
|
],
|
|
386
401
|
"props": {
|
|
387
402
|
"accessibilityHint": "Press to perform action",
|
|
388
|
-
"
|
|
389
|
-
"
|
|
390
|
-
"
|
|
403
|
+
"accessibilityLabel": "Delete",
|
|
404
|
+
"accessibilityRole": "button",
|
|
405
|
+
"accessibilityState": {
|
|
406
|
+
"disabled": false,
|
|
407
|
+
},
|
|
408
|
+
"disabled": false,
|
|
391
409
|
"onPress": [Function: debounced],
|
|
392
410
|
"style": {
|
|
393
411
|
"alignItems": "center",
|
|
@@ -404,7 +422,7 @@ exports[`Button renders destructive variant 1`] = `
|
|
|
404
422
|
},
|
|
405
423
|
"testID": undefined,
|
|
406
424
|
},
|
|
407
|
-
"type": "
|
|
425
|
+
"type": "PressableScale",
|
|
408
426
|
}
|
|
409
427
|
`;
|
|
410
428
|
|
|
@@ -453,8 +471,11 @@ exports[`Button renders disabled state 1`] = `
|
|
|
453
471
|
],
|
|
454
472
|
"props": {
|
|
455
473
|
"accessibilityHint": "Press to perform action",
|
|
456
|
-
"
|
|
457
|
-
"
|
|
474
|
+
"accessibilityLabel": "Disabled",
|
|
475
|
+
"accessibilityRole": "button",
|
|
476
|
+
"accessibilityState": {
|
|
477
|
+
"disabled": true,
|
|
478
|
+
},
|
|
458
479
|
"disabled": true,
|
|
459
480
|
"onPress": [Function: debounced],
|
|
460
481
|
"style": {
|
|
@@ -521,8 +542,11 @@ exports[`Button applies disabled styles when disabled 1`] = `
|
|
|
521
542
|
],
|
|
522
543
|
"props": {
|
|
523
544
|
"accessibilityHint": "Press to perform action",
|
|
524
|
-
"
|
|
525
|
-
"
|
|
545
|
+
"accessibilityLabel": "Disabled",
|
|
546
|
+
"accessibilityRole": "button",
|
|
547
|
+
"accessibilityState": {
|
|
548
|
+
"disabled": true,
|
|
549
|
+
},
|
|
526
550
|
"disabled": true,
|
|
527
551
|
"onPress": [Function: debounced],
|
|
528
552
|
"style": {
|
|
@@ -612,8 +636,11 @@ exports[`Button renders loading state 1`] = `
|
|
|
612
636
|
],
|
|
613
637
|
"props": {
|
|
614
638
|
"accessibilityHint": "Press to perform action",
|
|
615
|
-
"
|
|
616
|
-
"
|
|
639
|
+
"accessibilityLabel": "Loading",
|
|
640
|
+
"accessibilityRole": "button",
|
|
641
|
+
"accessibilityState": {
|
|
642
|
+
"disabled": true,
|
|
643
|
+
},
|
|
617
644
|
"disabled": true,
|
|
618
645
|
"onPress": [Function: debounced],
|
|
619
646
|
"style": {
|
|
@@ -680,9 +707,12 @@ exports[`Button renders fullWidth button 1`] = `
|
|
|
680
707
|
],
|
|
681
708
|
"props": {
|
|
682
709
|
"accessibilityHint": "Press to perform action",
|
|
683
|
-
"
|
|
684
|
-
"
|
|
685
|
-
"
|
|
710
|
+
"accessibilityLabel": "Full Width",
|
|
711
|
+
"accessibilityRole": "button",
|
|
712
|
+
"accessibilityState": {
|
|
713
|
+
"disabled": false,
|
|
714
|
+
},
|
|
715
|
+
"disabled": false,
|
|
686
716
|
"onPress": [Function: debounced],
|
|
687
717
|
"style": {
|
|
688
718
|
"alignItems": "center",
|
|
@@ -699,7 +729,7 @@ exports[`Button renders fullWidth button 1`] = `
|
|
|
699
729
|
},
|
|
700
730
|
"testID": undefined,
|
|
701
731
|
},
|
|
702
|
-
"type": "
|
|
732
|
+
"type": "PressableScale",
|
|
703
733
|
}
|
|
704
734
|
`;
|
|
705
735
|
|
|
@@ -761,9 +791,12 @@ exports[`Button renders with icon on left 1`] = `
|
|
|
761
791
|
],
|
|
762
792
|
"props": {
|
|
763
793
|
"accessibilityHint": "Press to perform action",
|
|
764
|
-
"
|
|
765
|
-
"
|
|
766
|
-
"
|
|
794
|
+
"accessibilityLabel": "With Icon",
|
|
795
|
+
"accessibilityRole": "button",
|
|
796
|
+
"accessibilityState": {
|
|
797
|
+
"disabled": false,
|
|
798
|
+
},
|
|
799
|
+
"disabled": false,
|
|
767
800
|
"onPress": [Function: debounced],
|
|
768
801
|
"style": {
|
|
769
802
|
"alignItems": "center",
|
|
@@ -780,7 +813,7 @@ exports[`Button renders with icon on left 1`] = `
|
|
|
780
813
|
},
|
|
781
814
|
"testID": undefined,
|
|
782
815
|
},
|
|
783
|
-
"type": "
|
|
816
|
+
"type": "PressableScale",
|
|
784
817
|
}
|
|
785
818
|
`;
|
|
786
819
|
|
|
@@ -842,9 +875,12 @@ exports[`Button renders with icon on right 1`] = `
|
|
|
842
875
|
],
|
|
843
876
|
"props": {
|
|
844
877
|
"accessibilityHint": "Press to perform action",
|
|
845
|
-
"
|
|
846
|
-
"
|
|
847
|
-
"
|
|
878
|
+
"accessibilityLabel": "Next",
|
|
879
|
+
"accessibilityRole": "button",
|
|
880
|
+
"accessibilityState": {
|
|
881
|
+
"disabled": false,
|
|
882
|
+
},
|
|
883
|
+
"disabled": false,
|
|
848
884
|
"onPress": [Function: debounced],
|
|
849
885
|
"style": {
|
|
850
886
|
"alignItems": "center",
|
|
@@ -861,7 +897,7 @@ exports[`Button renders with icon on right 1`] = `
|
|
|
861
897
|
},
|
|
862
898
|
"testID": undefined,
|
|
863
899
|
},
|
|
864
|
-
"type": "
|
|
900
|
+
"type": "PressableScale",
|
|
865
901
|
}
|
|
866
902
|
`;
|
|
867
903
|
|
|
@@ -910,9 +946,12 @@ exports[`Button renders with confirmation modal props 1`] = `
|
|
|
910
946
|
],
|
|
911
947
|
"props": {
|
|
912
948
|
"accessibilityHint": "Opens a confirmation dialog",
|
|
913
|
-
"
|
|
914
|
-
"
|
|
915
|
-
"
|
|
949
|
+
"accessibilityLabel": "Delete",
|
|
950
|
+
"accessibilityRole": "button",
|
|
951
|
+
"accessibilityState": {
|
|
952
|
+
"disabled": false,
|
|
953
|
+
},
|
|
954
|
+
"disabled": false,
|
|
916
955
|
"onPress": [Function: debounced],
|
|
917
956
|
"style": {
|
|
918
957
|
"alignItems": "center",
|
|
@@ -929,7 +968,7 @@ exports[`Button renders with confirmation modal props 1`] = `
|
|
|
929
968
|
},
|
|
930
969
|
"testID": undefined,
|
|
931
970
|
},
|
|
932
|
-
"type": "
|
|
971
|
+
"type": "PressableScale",
|
|
933
972
|
}
|
|
934
973
|
`;
|
|
935
974
|
|
|
@@ -978,9 +1017,12 @@ exports[`Button renders with tooltip on desktop (wrapped in Tooltip) 1`] = `
|
|
|
978
1017
|
],
|
|
979
1018
|
"props": {
|
|
980
1019
|
"accessibilityHint": "Press to perform action",
|
|
981
|
-
"
|
|
982
|
-
"
|
|
983
|
-
"
|
|
1020
|
+
"accessibilityLabel": "Hover me",
|
|
1021
|
+
"accessibilityRole": "button",
|
|
1022
|
+
"accessibilityState": {
|
|
1023
|
+
"disabled": false,
|
|
1024
|
+
},
|
|
1025
|
+
"disabled": false,
|
|
984
1026
|
"onPress": [Function: debounced],
|
|
985
1027
|
"style": {
|
|
986
1028
|
"alignItems": "center",
|
|
@@ -997,6 +1039,6 @@ exports[`Button renders with tooltip on desktop (wrapped in Tooltip) 1`] = `
|
|
|
997
1039
|
},
|
|
998
1040
|
"testID": undefined,
|
|
999
1041
|
},
|
|
1000
|
-
"type": "
|
|
1042
|
+
"type": "PressableScale",
|
|
1001
1043
|
}
|
|
1002
1044
|
`;
|
|
@@ -283,7 +283,9 @@ exports[`CustomSelectField renders correctly with default props 1`] = `
|
|
|
283
283
|
},
|
|
284
284
|
],
|
|
285
285
|
"props": {
|
|
286
|
-
"style":
|
|
286
|
+
"style": {
|
|
287
|
+
"width": "100%",
|
|
288
|
+
},
|
|
287
289
|
"testID": undefined,
|
|
288
290
|
},
|
|
289
291
|
"type": "View",
|
|
@@ -610,7 +612,9 @@ exports[`CustomSelectField renders with title 1`] = `
|
|
|
610
612
|
},
|
|
611
613
|
],
|
|
612
614
|
"props": {
|
|
613
|
-
"style":
|
|
615
|
+
"style": {
|
|
616
|
+
"width": "100%",
|
|
617
|
+
},
|
|
614
618
|
"testID": undefined,
|
|
615
619
|
},
|
|
616
620
|
"type": "View",
|
|
@@ -922,7 +926,9 @@ exports[`CustomSelectField renders with placeholder 1`] = `
|
|
|
922
926
|
},
|
|
923
927
|
],
|
|
924
928
|
"props": {
|
|
925
|
-
"style":
|
|
929
|
+
"style": {
|
|
930
|
+
"width": "100%",
|
|
931
|
+
},
|
|
926
932
|
"testID": undefined,
|
|
927
933
|
},
|
|
928
934
|
"type": "View",
|
|
@@ -1234,7 +1240,9 @@ exports[`CustomSelectField renders with selected value 1`] = `
|
|
|
1234
1240
|
},
|
|
1235
1241
|
],
|
|
1236
1242
|
"props": {
|
|
1237
|
-
"style":
|
|
1243
|
+
"style": {
|
|
1244
|
+
"width": "100%",
|
|
1245
|
+
},
|
|
1238
1246
|
"testID": undefined,
|
|
1239
1247
|
},
|
|
1240
1248
|
"type": "View",
|
|
@@ -1546,7 +1554,9 @@ exports[`CustomSelectField renders with custom value (not in options) 1`] = `
|
|
|
1546
1554
|
},
|
|
1547
1555
|
],
|
|
1548
1556
|
"props": {
|
|
1549
|
-
"style":
|
|
1557
|
+
"style": {
|
|
1558
|
+
"width": "100%",
|
|
1559
|
+
},
|
|
1550
1560
|
"testID": undefined,
|
|
1551
1561
|
},
|
|
1552
1562
|
"type": "View",
|
|
@@ -1964,7 +1974,9 @@ exports[`CustomSelectField renders disabled state 1`] = `
|
|
|
1964
1974
|
},
|
|
1965
1975
|
],
|
|
1966
1976
|
"props": {
|
|
1967
|
-
"style":
|
|
1977
|
+
"style": {
|
|
1978
|
+
"width": "100%",
|
|
1979
|
+
},
|
|
1968
1980
|
"testID": undefined,
|
|
1969
1981
|
},
|
|
1970
1982
|
"type": "View",
|
|
@@ -2276,7 +2288,9 @@ exports[`CustomSelectField includes custom option in dropdown 1`] = `
|
|
|
2276
2288
|
},
|
|
2277
2289
|
],
|
|
2278
2290
|
"props": {
|
|
2279
|
-
"style":
|
|
2291
|
+
"style": {
|
|
2292
|
+
"width": "100%",
|
|
2293
|
+
},
|
|
2280
2294
|
"testID": undefined,
|
|
2281
2295
|
},
|
|
2282
2296
|
"type": "View",
|