@terreno/ui 57.17.0 → 57.19.2

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 (95) hide show
  1. package/CHANGELOG.md +1681 -0
  2. package/dist/AreaChart.d.ts.map +1 -1
  3. package/dist/AreaChart.js +2 -2
  4. package/dist/AreaChart.js.map +1 -1
  5. package/dist/BarChart.d.ts.map +1 -1
  6. package/dist/BarChart.js +2 -2
  7. package/dist/BarChart.js.map +1 -1
  8. package/dist/Box.d.ts.map +1 -1
  9. package/dist/Box.js +28 -6
  10. package/dist/Box.js.map +1 -1
  11. package/dist/Card.d.ts.map +1 -1
  12. package/dist/Card.js +3 -2
  13. package/dist/Card.js.map +1 -1
  14. package/dist/ChartCard.d.ts.map +1 -1
  15. package/dist/ChartCard.js +4 -2
  16. package/dist/ChartCard.js.map +1 -1
  17. package/dist/Common.d.ts +120 -7
  18. package/dist/Common.d.ts.map +1 -1
  19. package/dist/Common.js.map +1 -1
  20. package/dist/DonutChart.d.ts.map +1 -1
  21. package/dist/DonutChart.js +2 -2
  22. package/dist/DonutChart.js.map +1 -1
  23. package/dist/LineChart.d.ts.map +1 -1
  24. package/dist/LineChart.js +2 -2
  25. package/dist/LineChart.js.map +1 -1
  26. package/dist/Page.d.ts +1 -0
  27. package/dist/Page.d.ts.map +1 -1
  28. package/dist/Page.js +10 -1
  29. package/dist/Page.js.map +1 -1
  30. package/dist/Scorecard.d.ts.map +1 -1
  31. package/dist/Scorecard.js +5 -2
  32. package/dist/Scorecard.js.map +1 -1
  33. package/dist/Skeleton.d.ts +39 -0
  34. package/dist/Skeleton.d.ts.map +1 -0
  35. package/dist/Skeleton.js +195 -0
  36. package/dist/Skeleton.js.map +1 -0
  37. package/dist/SplitPage.d.ts +1 -1
  38. package/dist/SplitPage.d.ts.map +1 -1
  39. package/dist/SplitPage.js +3 -2
  40. package/dist/SplitPage.js.map +1 -1
  41. package/dist/SplitPage.native.d.ts +1 -1
  42. package/dist/SplitPage.native.d.ts.map +1 -1
  43. package/dist/SplitPage.native.js +3 -2
  44. package/dist/SplitPage.native.js.map +1 -1
  45. package/dist/SplitPageLoading.d.ts +14 -0
  46. package/dist/SplitPageLoading.d.ts.map +1 -0
  47. package/dist/SplitPageLoading.js +19 -0
  48. package/dist/SplitPageLoading.js.map +1 -0
  49. package/dist/Text.d.ts +3 -1
  50. package/dist/Text.d.ts.map +1 -1
  51. package/dist/Text.js +2 -0
  52. package/dist/Text.js.map +1 -1
  53. package/dist/charts/ChartFrame.d.ts +2 -2
  54. package/dist/charts/ChartFrame.d.ts.map +1 -1
  55. package/dist/charts/ChartFrame.js +9 -2
  56. package/dist/charts/ChartFrame.js.map +1 -1
  57. package/dist/index.d.ts +2 -0
  58. package/dist/index.d.ts.map +1 -1
  59. package/dist/index.js +2 -0
  60. package/dist/index.js.map +1 -1
  61. package/dist/withLoading.d.ts +20 -0
  62. package/dist/withLoading.d.ts.map +1 -0
  63. package/dist/withLoading.js +24 -0
  64. package/dist/withLoading.js.map +1 -0
  65. package/package.json +3 -2
  66. package/src/AreaChart.tsx +6 -0
  67. package/src/BarChart.tsx +6 -0
  68. package/src/Box.test.tsx +70 -0
  69. package/src/Box.tsx +33 -6
  70. package/src/Card.test.tsx +48 -0
  71. package/src/Card.tsx +11 -0
  72. package/src/ChartCard.test.tsx +30 -0
  73. package/src/ChartCard.tsx +18 -1
  74. package/src/Common.ts +129 -7
  75. package/src/DonutChart.tsx +6 -0
  76. package/src/IconButton.test.tsx +178 -0
  77. package/src/LineChart.test.tsx +18 -0
  78. package/src/LineChart.tsx +6 -0
  79. package/src/Page.test.tsx +38 -0
  80. package/src/Page.tsx +38 -19
  81. package/src/Scorecard.test.tsx +11 -0
  82. package/src/Scorecard.tsx +21 -0
  83. package/src/Skeleton.test.tsx +262 -0
  84. package/src/Skeleton.tsx +430 -0
  85. package/src/SplitPage.native.tsx +13 -2
  86. package/src/SplitPage.tsx +18 -7
  87. package/src/SplitPageLoading.test.tsx +51 -0
  88. package/src/SplitPageLoading.tsx +53 -0
  89. package/src/Text.tsx +4 -1
  90. package/src/__snapshots__/Page.test.tsx.snap +28 -5
  91. package/src/__snapshots__/SplitPage.test.tsx.snap +16 -0
  92. package/src/charts/ChartFrame.tsx +19 -8
  93. package/src/index.tsx +2 -0
  94. package/src/withLoading.test.tsx +61 -0
  95. package/src/withLoading.tsx +50 -0
@@ -9,11 +9,15 @@ import type {SplitPageListItem, SplitPageProps} from "./Common";
9
9
  import {FlatList} from "./FlatList";
10
10
  import {IconButton} from "./IconButton";
11
11
  import {Spinner} from "./Spinner";
12
+ import {SplitPageLoading} from "./SplitPageLoading";
12
13
  import {Unifier} from "./Unifier";
13
14
 
14
15
  export const SplitPage = <TItem extends SplitPageListItem = SplitPageListItem>({
15
16
  children,
16
17
  loading = false,
18
+ loadingAnimation,
19
+ loadingComponent,
20
+ loadingLabel,
17
21
  color,
18
22
  keyboardOffset,
19
23
  renderListViewItem,
@@ -156,8 +160,15 @@ export const SplitPage = <TItem extends SplitPageListItem = SplitPageListItem>({
156
160
  keyboardOffset={keyboardOffset}
157
161
  width="100%"
158
162
  >
159
- {loading === true && <Spinner color="light" size="md" />}
160
- {selectedId === undefined ? renderList() : renderMainContent}
163
+ <SplitPageLoading
164
+ loading={loading}
165
+ loadingAnimation={loadingAnimation}
166
+ loadingComponent={loadingComponent}
167
+ loadingLabel={loadingLabel}
168
+ spinner={<Spinner color="light" size="md" />}
169
+ >
170
+ {selectedId === undefined ? renderList() : renderMainContent}
171
+ </SplitPageLoading>
161
172
  </Box>
162
173
  );
163
174
  };
package/src/SplitPage.tsx CHANGED
@@ -26,6 +26,7 @@ import {IconButton} from "./IconButton";
26
26
  import {isNarrowViewport} from "./MediaQuery";
27
27
  import {SegmentedControl} from "./SegmentedControl";
28
28
  import {Spinner} from "./Spinner";
29
+ import {SplitPageLoading} from "./SplitPageLoading";
29
30
  import {useTheme} from "./Theme";
30
31
 
31
32
  // flex: 1 (basis 0, shrink 1) sizes the content container to the pane. A height: "100%"
@@ -85,6 +86,9 @@ export const SplitPage = <TItem extends SplitPageListItem = SplitPageListItem>({
85
86
  children,
86
87
  tabs = [],
87
88
  loading = false,
89
+ loadingAnimation,
90
+ loadingComponent,
91
+ loadingLabel,
88
92
  color,
89
93
  keyboardOffset,
90
94
  renderListViewItem,
@@ -671,13 +675,20 @@ export const SplitPage = <TItem extends SplitPageListItem = SplitPageListItem>({
671
675
  padding={isLabeledPagerBody ? 0 : 2}
672
676
  width="100%"
673
677
  >
674
- {loading === true && (
675
- <Spinner
676
- color={theme.text.primary as unknown as ComponentProps<typeof Spinner>["color"]}
677
- size="md"
678
- />
679
- )}
680
- {isNarrowLayout ? renderMobileSplitPage() : renderSplitPage()}
678
+ <SplitPageLoading
679
+ loading={loading}
680
+ loadingAnimation={loadingAnimation}
681
+ loadingComponent={loadingComponent}
682
+ loadingLabel={loadingLabel}
683
+ spinner={
684
+ <Spinner
685
+ color={theme.text.primary as unknown as ComponentProps<typeof Spinner>["color"]}
686
+ size="md"
687
+ />
688
+ }
689
+ >
690
+ {isNarrowLayout ? renderMobileSplitPage() : renderSplitPage()}
691
+ </SplitPageLoading>
681
692
  </Box>
682
693
  );
683
694
  };
@@ -0,0 +1,51 @@
1
+ import {describe, expect, it} from "bun:test";
2
+ import {View} from "react-native";
3
+
4
+ import {SkeletonList} from "./Skeleton";
5
+ import {SplitPageLoading} from "./SplitPageLoading";
6
+ import {renderWithTheme} from "./test-utils";
7
+
8
+ // Skeletons are hidden from assistive tech, so queries opt in to hidden elements.
9
+ const HIDDEN = {includeHiddenElements: true};
10
+
11
+ describe("SplitPageLoading", () => {
12
+ it("renders only the content when not loading", () => {
13
+ const {getByTestId, queryByTestId} = renderWithTheme(
14
+ <SplitPageLoading loading={false} spinner={<View testID="spinner" />}>
15
+ <View testID="content" />
16
+ </SplitPageLoading>
17
+ );
18
+ expect(getByTestId("content")).toBeTruthy();
19
+ expect(queryByTestId("split-page-loading")).toBeNull();
20
+ expect(queryByTestId("spinner")).toBeNull();
21
+ });
22
+
23
+ it("shows a busy, labeled spinner beside the content without a loadingComponent", () => {
24
+ const {getByTestId} = renderWithTheme(
25
+ <SplitPageLoading loading loadingLabel="Loading inbox" spinner={<View testID="spinner" />}>
26
+ <View testID="content" />
27
+ </SplitPageLoading>
28
+ );
29
+ const region = getByTestId("split-page-loading");
30
+ expect(region.props["aria-busy"]).toBe(true);
31
+ expect(region.props.accessibilityLabel).toBe("Loading inbox");
32
+ expect(getByTestId("spinner")).toBeTruthy();
33
+ expect(getByTestId("content")).toBeTruthy();
34
+ });
35
+
36
+ it("replaces the content with the loadingComponent", () => {
37
+ const {getByTestId, queryByTestId} = renderWithTheme(
38
+ <SplitPageLoading
39
+ loading
40
+ loadingComponent={<SkeletonList testID="skeleton" />}
41
+ spinner={<View testID="spinner" />}
42
+ >
43
+ <View testID="content" />
44
+ </SplitPageLoading>
45
+ );
46
+ expect(getByTestId("split-page-loading").props["aria-busy"]).toBe(true);
47
+ expect(getByTestId("skeleton", HIDDEN)).toBeTruthy();
48
+ expect(queryByTestId("content")).toBeNull();
49
+ expect(queryByTestId("spinner")).toBeNull();
50
+ });
51
+ });
@@ -0,0 +1,53 @@
1
+ import type {FC, ReactNode} from "react";
2
+
3
+ import {Box} from "./Box";
4
+ import type {LoadingProps} from "./Common";
5
+
6
+ interface SplitPageLoadingProps extends LoadingProps {
7
+ children: ReactNode;
8
+ spinner: ReactNode;
9
+ }
10
+
11
+ // Every SplitPage test id is a fixed `split-page-*` value because SplitPage takes no testID prop.
12
+ const SPLIT_PAGE_LOADING_TEST_ID = "split-page-loading";
13
+
14
+ /**
15
+ * SplitPage's loading region, shared by the web and native SplitPage. Without a
16
+ * `loadingComponent`, a busy spinner sits beside the content; with one, the placeholder replaces
17
+ * the list and detail. Both paths announce `loadingLabel` and set the busy state.
18
+ */
19
+ export const SplitPageLoading: FC<SplitPageLoadingProps> = ({
20
+ children,
21
+ loading,
22
+ loadingAnimation,
23
+ loadingComponent,
24
+ loadingLabel,
25
+ spinner,
26
+ }) => {
27
+ if (!loading) {
28
+ return <>{children}</>;
29
+ }
30
+ if (!loadingComponent) {
31
+ return (
32
+ <>
33
+ <Box
34
+ loading
35
+ loadingComponent={spinner}
36
+ loadingLabel={loadingLabel}
37
+ testID={SPLIT_PAGE_LOADING_TEST_ID}
38
+ />
39
+ {children}
40
+ </>
41
+ );
42
+ }
43
+ return (
44
+ <Box
45
+ flex="grow"
46
+ loading
47
+ loadingAnimation={loadingAnimation}
48
+ loadingComponent={loadingComponent}
49
+ loadingLabel={loadingLabel}
50
+ testID={SPLIT_PAGE_LOADING_TEST_ID}
51
+ />
52
+ );
53
+ };
package/src/Text.tsx CHANGED
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import {Text as NativeText, Platform, type TextStyle} from "react-native";
3
3
 
4
- import type {TextProps} from "./Common";
4
+ import type {TextProps, TextSize} from "./Common";
5
5
  import {Hyperlink} from "./Hyperlink";
6
6
  import {useTerrenoFontsLoaded} from "./TerrenoFontProvider";
7
7
  import {useTheme} from "./Theme";
@@ -24,6 +24,9 @@ const fontSizeAndWeighMobile = {
24
24
 
25
25
  const fontSizes = Platform.OS === "web" ? fontSizeAndWeightWeb : fontSizeAndWeighMobile;
26
26
 
27
+ /** Font size in pixels that `Text` renders at `size` on the current platform. */
28
+ export const getTextFontSize = (size: TextSize): number => fontSizes[size].size;
29
+
27
30
  const TextComponent = ({
28
31
  accessibilityRole,
29
32
  align = "left",
@@ -969,19 +969,42 @@ exports[`Page renders loading state 1`] = `
969
969
  "children": [
970
970
  {
971
971
  "$$typeof": Symbol(react.test.json),
972
- "children": null,
972
+ "children": [
973
+ {
974
+ "$$typeof": Symbol(react.test.json),
975
+ "children": null,
976
+ "props": {
977
+ "onPointerEnter": [Function: AsyncFunction],
978
+ "onPointerLeave": [Function: AsyncFunction],
979
+ "style": {
980
+ "alignItems": "center",
981
+ "display": "flex",
982
+ "flex": undefined,
983
+ "flexDirection": "column",
984
+ "flexGrow": 1,
985
+ "flexShrink": 1,
986
+ "justifyContent": "center",
987
+ "marginTop": 48,
988
+ },
989
+ "testID": undefined,
990
+ },
991
+ "type": "View",
992
+ },
993
+ ],
973
994
  "props": {
995
+ "accessibilityLabel": "Loading",
996
+ "accessibilityState": {
997
+ "busy": true,
998
+ },
999
+ "aria-busy": true,
974
1000
  "onPointerEnter": [Function: AsyncFunction],
975
1001
  "onPointerLeave": [Function: AsyncFunction],
976
1002
  "style": {
977
- "alignItems": "center",
978
1003
  "display": "flex",
979
- "flex": undefined,
980
1004
  "flexDirection": "column",
981
1005
  "flexGrow": 1,
982
1006
  "flexShrink": 1,
983
- "justifyContent": "center",
984
- "marginTop": 48,
1007
+ "width": "100%",
985
1008
  },
986
1009
  "testID": undefined,
987
1010
  },
@@ -393,6 +393,22 @@ exports[`SplitPage renders with loading state 1`] = `
393
393
  {
394
394
  "$$typeof": Symbol(react.test.json),
395
395
  "children": [
396
+ {
397
+ "$$typeof": Symbol(react.test.json),
398
+ "children": null,
399
+ "props": {
400
+ "accessibilityLabel": "Loading",
401
+ "accessibilityState": {
402
+ "busy": true,
403
+ },
404
+ "aria-busy": true,
405
+ "onPointerEnter": [Function: AsyncFunction],
406
+ "onPointerLeave": [Function: AsyncFunction],
407
+ "style": {},
408
+ "testID": "split-page-loading",
409
+ },
410
+ "type": "View",
411
+ },
396
412
  {
397
413
  "$$typeof": Symbol(react.test.json),
398
414
  "children": [
@@ -1,19 +1,20 @@
1
1
  import type {FC, ReactNode} from "react";
2
2
 
3
3
  import {Box} from "../Box";
4
+ import type {LoadingProps} from "../Common";
5
+ import {getLoadingAccessibilityProps, resolveLoadingContent} from "../Skeleton";
4
6
  import {Spinner} from "../Spinner";
5
7
  import {Text} from "../Text";
6
8
  import {resolveTestID, toTestProps} from "../testing/resolveTestId";
7
9
  import {CHART_FOOTER_ROW_HEIGHT} from "./layout";
8
10
 
9
- export interface ChartFrameProps {
11
+ export interface ChartFrameProps extends LoadingProps {
10
12
  accessibilityLabel?: string;
11
13
  children: ReactNode;
12
14
  emptyText: string;
13
15
  isEmpty: boolean;
14
16
  legendItems?: Array<{color: string; label: string}>;
15
17
  legendLabel?: string;
16
- loading?: boolean;
17
18
  testID?: string;
18
19
  tooltipText?: string;
19
20
  }
@@ -26,26 +27,36 @@ export const ChartFrame: FC<ChartFrameProps> = ({
26
27
  legendItems,
27
28
  legendLabel,
28
29
  loading = false,
30
+ loadingAnimation,
31
+ loadingComponent,
32
+ loadingLabel,
29
33
  testID,
30
34
  tooltipText,
31
35
  }) => {
32
36
  const showPlot = !loading && !isEmpty;
37
+ const loadingAccessibilityProps = getLoadingAccessibilityProps({loading, loadingLabel});
33
38
 
34
39
  // alignSelf stretch keeps the frame full width even when a parent centers its children, so the
35
40
  // measured plot width comes from the container instead of the chart's own content.
36
41
  return (
37
42
  <Box
38
- accessibilityLabel={accessibilityLabel}
43
+ accessibilityLabel={loadingAccessibilityProps.accessibilityLabel ?? accessibilityLabel}
44
+ accessibilityState={loadingAccessibilityProps.accessibilityState}
39
45
  alignSelf="stretch"
40
46
  minWidth={0}
41
47
  width="100%"
42
48
  {...toTestProps(testID)}
43
49
  >
44
- {loading ? (
45
- <Box padding={4}>
46
- <Spinner testID={resolveTestID(testID, "spinner")} />
47
- </Box>
48
- ) : null}
50
+ {resolveLoadingContent({
51
+ defaultLoadingComponent: (
52
+ <Box padding={4}>
53
+ <Spinner testID={resolveTestID(testID, "spinner")} />
54
+ </Box>
55
+ ),
56
+ loading,
57
+ loadingAnimation,
58
+ loadingComponent,
59
+ })}
49
60
  {isEmpty && !loading ? <Text skipLinking>{emptyText}</Text> : null}
50
61
  {showPlot ? children : null}
51
62
  {showPlot ? (
package/src/index.tsx CHANGED
@@ -134,6 +134,7 @@ export * from "./SideDrawer";
134
134
  export * from "./Signature";
135
135
  export * from "./SignatureCaptureField";
136
136
  export * from "./SignatureField";
137
+ export * from "./Skeleton";
137
138
  export * from "./Slider";
138
139
  export * from "./SocialLoginButton";
139
140
  export type * from "./SparklineChart";
@@ -192,6 +193,7 @@ export * from "./useStoredState";
192
193
  export * from "./useSubmitConsent";
193
194
  export * from "./WebAddressAutocomplete";
194
195
  export * from "./WhatsNewBanner";
196
+ export * from "./withLoading";
195
197
 
196
198
  // export * from "./Layout";
197
199
  // export * from "./Drawer";
@@ -0,0 +1,61 @@
1
+ import {describe, expect, it} from "bun:test";
2
+ import type {FC} from "react";
3
+
4
+ import {SkeletonList} from "./Skeleton";
5
+ import {Text} from "./Text";
6
+ import {renderWithTheme} from "./test-utils";
7
+ import {withLoading} from "./withLoading";
8
+
9
+ // Skeletons are hidden from assistive tech, so queries opt in to hidden elements.
10
+ const HIDDEN = {includeHiddenElements: true};
11
+
12
+ interface UserRowProps {
13
+ name: string;
14
+ testID?: string;
15
+ }
16
+
17
+ const UserRow: FC<UserRowProps> = ({name, testID}) => <Text testID={testID}>{name}</Text>;
18
+
19
+ describe("withLoading", () => {
20
+ it("renders the wrapped component when not loading", () => {
21
+ const UserRowWithLoading = withLoading(UserRow);
22
+ const {getByText} = renderWithTheme(<UserRowWithLoading name="Ada" />);
23
+ expect(getByText("Ada")).toBeTruthy();
24
+ });
25
+
26
+ it("renders the default placeholder in a busy box while loading", () => {
27
+ const UserRowWithLoading = withLoading(UserRow, {
28
+ loadingComponent: <SkeletonList rows={1} testID="row-skeleton" />,
29
+ });
30
+ const {getByTestId, queryByText} = renderWithTheme(
31
+ <UserRowWithLoading loading name="Ada" testID="user-row" />
32
+ );
33
+ expect(queryByText("Ada")).toBeNull();
34
+ expect(getByTestId("row-skeleton", HIDDEN)).toBeTruthy();
35
+ const container = getByTestId("user-row-loading", HIDDEN);
36
+ expect(container.props["aria-busy"]).toBe(true);
37
+ expect(container.props.accessibilityLabel).toBe("Loading");
38
+ });
39
+
40
+ it("lets the caller override the placeholder and label", () => {
41
+ const UserRowWithLoading = withLoading(UserRow, {
42
+ loadingComponent: <SkeletonList testID="default-skeleton" />,
43
+ });
44
+ const {getByTestId, queryByTestId} = renderWithTheme(
45
+ <UserRowWithLoading
46
+ loading
47
+ loadingComponent={<SkeletonList rows={1} testID="custom-skeleton" />}
48
+ loadingLabel="Loading user"
49
+ name="Ada"
50
+ testID="user-row"
51
+ />
52
+ );
53
+ expect(getByTestId("custom-skeleton", HIDDEN)).toBeTruthy();
54
+ expect(queryByTestId("default-skeleton", HIDDEN)).toBeNull();
55
+ expect(getByTestId("user-row-loading", HIDDEN).props.accessibilityLabel).toBe("Loading user");
56
+ });
57
+
58
+ it("names the wrapper after the wrapped component", () => {
59
+ expect(withLoading(UserRow).displayName).toBe("withLoading(UserRow)");
60
+ });
61
+ });
@@ -0,0 +1,50 @@
1
+ import type {ComponentType, FC, ReactNode} from "react";
2
+
3
+ import {Box} from "./Box";
4
+ import type {LoadingProps, SkeletonAnimation} from "./Common";
5
+
6
+ export interface WithLoadingOptions {
7
+ /** Animation used when the caller does not pass `loadingAnimation`. */
8
+ loadingAnimation?: SkeletonAnimation;
9
+ /** Placeholder used when the caller does not pass `loadingComponent`. */
10
+ loadingComponent?: ReactNode;
11
+ }
12
+
13
+ /**
14
+ * Gives a custom component the shared `LoadingProps` contract. While `loading` is true it renders
15
+ * `loadingComponent` in a busy `Box` instead of the component. Use it for components that do not
16
+ * already take a `loading` prop of their own, since the wrapper consumes it.
17
+ *
18
+ * ```tsx
19
+ * const UserRowWithLoading = withLoading(UserRow, {loadingComponent: <SkeletonList rows={1} />});
20
+ * <UserRowWithLoading loading={isLoading} user={user} />
21
+ * ```
22
+ */
23
+ export const withLoading = <P extends object>(
24
+ Component: ComponentType<P>,
25
+ options: WithLoadingOptions = {}
26
+ ): FC<P & LoadingProps> => {
27
+ const WithLoading: FC<P & LoadingProps> = ({
28
+ loading,
29
+ loadingAnimation,
30
+ loadingComponent,
31
+ loadingLabel,
32
+ ...props
33
+ }) => {
34
+ if (!loading) {
35
+ return <Component {...(props as P)} />;
36
+ }
37
+ const testID = (props as {testID?: string}).testID;
38
+ return (
39
+ <Box
40
+ loading
41
+ loadingAnimation={loadingAnimation ?? options.loadingAnimation}
42
+ loadingComponent={loadingComponent ?? options.loadingComponent}
43
+ loadingLabel={loadingLabel}
44
+ testID={testID ? `${testID}-loading` : undefined}
45
+ />
46
+ );
47
+ };
48
+ WithLoading.displayName = `withLoading(${Component.displayName ?? Component.name ?? "Component"})`;
49
+ return WithLoading;
50
+ };