@terreno/ui 0.13.0 → 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 +9 -8
- 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.d.ts +22 -10
- package/dist/PickerSelect.js +14 -9
- package/dist/PickerSelect.js.map +1 -1
- package/dist/SelectBadge.js +11 -1
- package/dist/SelectBadge.js.map +1 -1
- package/dist/SelectField.js +3 -3
- package/dist/SelectField.js.map +1 -1
- package/dist/SidebarNavigation.native.js.map +1 -1
- package/dist/Signature.js +4 -0
- package/dist/Signature.js.map +1 -1
- package/dist/Signature.native.js +4 -0
- package/dist/Signature.native.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/Theme.d.ts +1 -1
- package/dist/Theme.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/dist/useConsentForms.d.ts +4 -3
- package/dist/useConsentForms.js +26 -4
- package/dist/useConsentForms.js.map +1 -1
- package/dist/useConsentHistory.d.ts +4 -3
- package/dist/useConsentHistory.js +26 -4
- package/dist/useConsentHistory.js.map +1 -1
- package/dist/useSubmitConsent.d.ts +7 -6
- package/dist/useSubmitConsent.js +25 -3
- package/dist/useSubmitConsent.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 +149 -0
- package/src/ConsentFormScreen.tsx +20 -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.test.tsx +68 -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/Modal.tsx +2 -2
- 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 +48 -31
- package/src/SelectBadge.test.tsx +1 -0
- package/src/SelectBadge.tsx +7 -3
- package/src/SelectField.tsx +3 -3
- package/src/SidebarNavigation.native.tsx +6 -2
- package/src/Signature.native.tsx +4 -0
- package/src/Signature.test.tsx +11 -0
- package/src/Signature.tsx +4 -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/Theme.tsx +17 -14
- package/src/Toast.tsx +1 -1
- package/src/ToastNotifications.tsx +1 -4
- package/src/Tooltip.test.tsx +40 -28
- package/src/Unifier.ts +6 -5
- package/src/Utilities.tsx +9 -6
- package/src/__snapshots__/AddressField.test.tsx.snap +3 -2
- package/src/__snapshots__/Button.test.tsx.snap +92 -50
- package/src/__snapshots__/CustomSelectField.test.tsx.snap +21 -14
- 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 -12
- 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__/PickerSelect.test.tsx.snap +0 -7
- package/src/__snapshots__/SelectField.test.tsx.snap +18 -12
- package/src/__snapshots__/TerrenoProvider.test.tsx.snap +2 -18
- package/src/__snapshots__/TimezonePicker.test.tsx.snap +18 -12
- package/src/bunSetup.ts +45 -0
- 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 -2
- package/src/types/react-native-swiper-flatlist.d.ts +1 -0
- package/src/useConsentForms.test.ts +25 -0
- package/src/useConsentForms.ts +32 -7
- package/src/useConsentHistory.test.ts +99 -0
- package/src/useConsentHistory.ts +31 -6
- package/src/useSubmitConsent.test.ts +24 -0
- package/src/useSubmitConsent.ts +35 -10
package/src/Tooltip.test.tsx
CHANGED
|
@@ -1,22 +1,29 @@
|
|
|
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";
|
|
7
6
|
import {renderWithTheme} from "./test-utils";
|
|
8
7
|
|
|
9
|
-
//
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
// Minimal shape of the tree returned by toJSON() that we rely on here.
|
|
9
|
+
interface TestNode {
|
|
10
|
+
type: string;
|
|
11
|
+
props: {
|
|
12
|
+
onPointerEnter?: () => void;
|
|
13
|
+
onPointerLeave?: () => void;
|
|
14
|
+
onTouchStart?: (event?: {nativeEvent: object}) => void;
|
|
15
|
+
onLayout?: (event: {
|
|
16
|
+
nativeEvent: {layout: {height: number; width: number; x: number; y: number}};
|
|
17
|
+
}) => void;
|
|
18
|
+
};
|
|
19
|
+
children: null | Array<TestNode | string>;
|
|
20
|
+
}
|
|
14
21
|
|
|
15
22
|
beforeAll(() => {
|
|
16
|
-
|
|
23
|
+
globalThis.requestAnimationFrame = (callback: FrameRequestCallback) => {
|
|
17
24
|
return setTimeout(() => callback(Date.now()), 0) as unknown as number;
|
|
18
25
|
};
|
|
19
|
-
|
|
26
|
+
globalThis.cancelAnimationFrame = (id: number) => {
|
|
20
27
|
clearTimeout(id);
|
|
21
28
|
};
|
|
22
29
|
});
|
|
@@ -111,14 +118,14 @@ describe("Tooltip", () => {
|
|
|
111
118
|
</Tooltip>
|
|
112
119
|
);
|
|
113
120
|
|
|
114
|
-
const wrapper = toJSON()
|
|
121
|
+
const wrapper = toJSON();
|
|
115
122
|
expect(wrapper).toBeTruthy();
|
|
116
123
|
expect(queryByTestId("tooltip-container")).toBeNull();
|
|
117
124
|
|
|
118
|
-
const tree = toJSON();
|
|
125
|
+
const tree = toJSON() as TestNode | null;
|
|
119
126
|
await act(async () => {
|
|
120
127
|
// Trigger pointer enter on the wrapper
|
|
121
|
-
const root =
|
|
128
|
+
const root = tree?.children?.[0] as TestNode | undefined;
|
|
122
129
|
if (root?.props?.onPointerEnter) {
|
|
123
130
|
root.props.onPointerEnter();
|
|
124
131
|
}
|
|
@@ -138,8 +145,8 @@ describe("Tooltip", () => {
|
|
|
138
145
|
</Tooltip>
|
|
139
146
|
);
|
|
140
147
|
|
|
141
|
-
const tree = toJSON() as
|
|
142
|
-
const root = tree.children?.[0];
|
|
148
|
+
const tree = toJSON() as TestNode;
|
|
149
|
+
const root = tree.children?.[0] as TestNode;
|
|
143
150
|
|
|
144
151
|
await act(async () => {
|
|
145
152
|
root.props.onTouchStart?.({nativeEvent: {}});
|
|
@@ -151,8 +158,10 @@ describe("Tooltip", () => {
|
|
|
151
158
|
expect(queryByTestId("tooltip-container")).toBeTruthy();
|
|
152
159
|
|
|
153
160
|
// Second touch should hide
|
|
154
|
-
const treeAfterShow = toJSON() as
|
|
155
|
-
const updatedRoot = treeAfterShow.children
|
|
161
|
+
const treeAfterShow = toJSON() as TestNode;
|
|
162
|
+
const updatedRoot = (treeAfterShow.children as Array<TestNode | string>)[
|
|
163
|
+
(treeAfterShow.children as Array<TestNode | string>).length - 1
|
|
164
|
+
] as TestNode;
|
|
156
165
|
await act(async () => {
|
|
157
166
|
updatedRoot.props.onTouchStart?.({nativeEvent: {}});
|
|
158
167
|
});
|
|
@@ -167,8 +176,8 @@ describe("Tooltip", () => {
|
|
|
167
176
|
</Tooltip>
|
|
168
177
|
);
|
|
169
178
|
|
|
170
|
-
const tree = toJSON() as
|
|
171
|
-
const root = tree.children?.[0];
|
|
179
|
+
const tree = toJSON() as TestNode;
|
|
180
|
+
const root = tree.children?.[0] as TestNode;
|
|
172
181
|
|
|
173
182
|
await act(async () => {
|
|
174
183
|
root.props.onPointerEnter?.();
|
|
@@ -179,8 +188,10 @@ describe("Tooltip", () => {
|
|
|
179
188
|
|
|
180
189
|
expect(queryByTestId("tooltip-container")).toBeTruthy();
|
|
181
190
|
|
|
182
|
-
const treeAfter = toJSON() as
|
|
183
|
-
const wrapper = treeAfter.children
|
|
191
|
+
const treeAfter = toJSON() as TestNode;
|
|
192
|
+
const wrapper = (treeAfter.children as Array<TestNode | string>)[
|
|
193
|
+
(treeAfter.children as Array<TestNode | string>).length - 1
|
|
194
|
+
] as TestNode;
|
|
184
195
|
await act(async () => {
|
|
185
196
|
wrapper.props.onPointerLeave?.();
|
|
186
197
|
});
|
|
@@ -206,8 +217,8 @@ describe("Tooltip", () => {
|
|
|
206
217
|
</Tooltip>
|
|
207
218
|
);
|
|
208
219
|
|
|
209
|
-
const tree = toJSON() as
|
|
210
|
-
const root = tree.children?.[0];
|
|
220
|
+
const tree = toJSON() as TestNode;
|
|
221
|
+
const root = tree.children?.[0] as TestNode;
|
|
211
222
|
|
|
212
223
|
await act(async () => {
|
|
213
224
|
root.props.onPointerEnter?.();
|
|
@@ -227,8 +238,8 @@ describe("Tooltip", () => {
|
|
|
227
238
|
</Tooltip>
|
|
228
239
|
);
|
|
229
240
|
|
|
230
|
-
const tree = toJSON() as
|
|
231
|
-
const root = tree.children?.[0];
|
|
241
|
+
const tree = toJSON() as TestNode;
|
|
242
|
+
const root = tree.children?.[0] as TestNode;
|
|
232
243
|
|
|
233
244
|
// Show the tooltip
|
|
234
245
|
await act(async () => {
|
|
@@ -241,11 +252,12 @@ describe("Tooltip", () => {
|
|
|
241
252
|
|
|
242
253
|
// Find any views with onLayout to simulate layout event
|
|
243
254
|
const {View: ViewComp} = await import("react-native");
|
|
244
|
-
const allViews = UNSAFE_getAllByType(ViewComp
|
|
255
|
+
const allViews = UNSAFE_getAllByType(ViewComp);
|
|
245
256
|
for (const v of allViews) {
|
|
246
|
-
|
|
257
|
+
const props = v.props as TestNode["props"];
|
|
258
|
+
if (props.onLayout) {
|
|
247
259
|
await act(async () => {
|
|
248
|
-
|
|
260
|
+
props.onLayout?.({
|
|
249
261
|
nativeEvent: {
|
|
250
262
|
layout: {height: 100, width: 200, x: 0, y: 0},
|
|
251
263
|
},
|
|
@@ -280,8 +292,8 @@ describe("Tooltip", () => {
|
|
|
280
292
|
</Tooltip>
|
|
281
293
|
);
|
|
282
294
|
|
|
283
|
-
const tree = toJSON() as
|
|
284
|
-
const root = tree.children?.[0];
|
|
295
|
+
const tree = toJSON() as TestNode;
|
|
296
|
+
const root = tree.children?.[0] as TestNode;
|
|
285
297
|
await act(async () => {
|
|
286
298
|
root.props.onPointerEnter?.();
|
|
287
299
|
});
|
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 {
|
|
@@ -421,7 +421,6 @@ exports[`AddressField renders correctly with default props 1`] = `
|
|
|
421
421
|
},
|
|
422
422
|
],
|
|
423
423
|
"props": {
|
|
424
|
-
"activeOpacity": 1,
|
|
425
424
|
"onPress": [Function],
|
|
426
425
|
"style": {
|
|
427
426
|
"alignItems": "center",
|
|
@@ -1118,7 +1117,9 @@ exports[`AddressField renders correctly with default props 1`] = `
|
|
|
1118
1117
|
},
|
|
1119
1118
|
],
|
|
1120
1119
|
"props": {
|
|
1121
|
-
"style":
|
|
1120
|
+
"style": {
|
|
1121
|
+
"width": "100%",
|
|
1122
|
+
},
|
|
1122
1123
|
"testID": undefined,
|
|
1123
1124
|
},
|
|
1124
1125
|
"type": "View",
|
|
@@ -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
|
`;
|