@impulse-ui-native/data-state 9.1.1 → 10.0.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/README.md CHANGED
@@ -17,6 +17,12 @@ Complete the Reanimated and Worklets setup required by your React Native or Expo
17
17
  - `DataView` coordinates loading, error, empty, and successful-content states and renders the configured state copy and actions.
18
18
  - Public prop types describe each state view and its action footer.
19
19
 
20
+ `EmptyView` and `ErrorView` always render their supplied children. Their only
21
+ container-specific option is `contentContainerStyle`, which styles the inner
22
+ content separately from the outer `style`. They accept native/themed View props
23
+ and children; text, action, `variant`, `isEmpty`, and `error` props are not part
24
+ of their API. Use `DataView` for automatic state selection and configured details.
25
+
20
26
  ## Usage
21
27
 
22
28
  ```tsx
@@ -1,11 +1,10 @@
1
1
  import * as react from 'react';
2
2
  import { PropsWithChildren } from 'react';
3
- import * as react_jsx_runtime from 'react/jsx-runtime';
4
3
  import { DataViewProps } from '../types/state-view.types.mjs';
5
4
  import 'react-native';
6
5
  import '@impulse-ui-native/icon/types';
7
6
  import '@impulse-ui-native/primitives';
8
7
 
9
- declare const DataView: react.MemoExoticComponent<(props: PropsWithChildren<DataViewProps>) => react_jsx_runtime.JSX.Element>;
8
+ declare const DataView: react.MemoExoticComponent<(props: PropsWithChildren<DataViewProps>) => react.JSX.Element>;
10
9
 
11
10
  export { DataView };
@@ -42,6 +42,7 @@ const DataView = memo((props) => {
42
42
  errorViewProps,
43
43
  isEmpty
44
44
  ]);
45
+ const showContent = !error && !isEmpty;
45
46
  return /* @__PURE__ */ jsxs(
46
47
  LoadingView,
47
48
  {
@@ -50,7 +51,7 @@ const DataView = memo((props) => {
50
51
  contentContainerStyle,
51
52
  loading,
52
53
  children: [
53
- !error && !isEmpty ? children : null,
54
+ showContent ? children : null,
54
55
  content
55
56
  ]
56
57
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/data-view.tsx"],"sourcesContent":["import { memo, PropsWithChildren, useMemo } from \"react\";\n\nimport { View } from \"@impulse-ui-native/primitives\";\nimport { useComponentsTokens } from \"@impulse-ui-native/theme\";\n\nimport { DataViewProps } from \"../types\";\nimport { EmptyDetails } from \"./empty-details\";\nimport { ErrorDetails } from \"./error-details\";\nimport { LoadingView } from \"./loading-view\";\n\nexport const DataView = memo((props: PropsWithChildren<DataViewProps>) => {\n const tokens = useComponentsTokens();\n\n const dataStateTokens = tokens.dataState;\n const {\n error,\n isEmpty,\n loading,\n errorViewProps,\n emptyViewProps,\n LoadingComponent,\n contentContainerStyle,\n children,\n ...rest\n } = props;\n\n const content = useMemo(() => {\n if (!error && !isEmpty) {\n return null;\n }\n\n return (\n <View\n alignItems=\"center\"\n justifyContent=\"center\"\n zIndex={dataStateTokens.content.zIndex}\n >\n {error ? <ErrorDetails {...errorViewProps} /> : null}\n {isEmpty ? <EmptyDetails {...emptyViewProps} /> : null}\n </View>\n );\n }, [\n dataStateTokens.content.zIndex,\n emptyViewProps,\n error,\n errorViewProps,\n isEmpty,\n ]);\n\n return (\n <LoadingView\n {...rest}\n LoadingComponent={LoadingComponent}\n contentContainerStyle={contentContainerStyle}\n loading={loading}\n >\n {!error && !isEmpty ? children : null}\n {content}\n </LoadingView>\n );\n});\n"],"mappings":"AAgCM,SAKW,KALX;AAhCN,SAAS,MAAyB,eAAe;AAEjD,SAAS,YAAY;AACrB,SAAS,2BAA2B;AAGpC,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAErB,MAAM,WAAW,KAAK,CAAC,UAA4C;AACxE,QAAM,SAAS,oBAAoB;AAEnC,QAAM,kBAAkB,OAAO;AAC/B,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AAEJ,QAAM,UAAU,QAAQ,MAAM;AAC5B,QAAI,CAAC,SAAS,CAAC,SAAS;AACtB,aAAO;AAAA,IACT;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,YAAW;AAAA,QACX,gBAAe;AAAA,QACf,QAAQ,gBAAgB,QAAQ;AAAA,QAE/B;AAAA,kBAAQ,oBAAC,gBAAc,GAAG,gBAAgB,IAAK;AAAA,UAC/C,UAAU,oBAAC,gBAAc,GAAG,gBAAgB,IAAK;AAAA;AAAA;AAAA,IACpD;AAAA,EAEJ,GAAG;AAAA,IACD,gBAAgB,QAAQ;AAAA,IACxB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MAEC;AAAA,SAAC,SAAS,CAAC,UAAU,WAAW;AAAA,QAChC;AAAA;AAAA;AAAA,EACH;AAEJ,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../src/components/data-view.tsx"],"sourcesContent":["import { memo, PropsWithChildren, useMemo } from \"react\";\n\nimport { View } from \"@impulse-ui-native/primitives\";\nimport { useComponentsTokens } from \"@impulse-ui-native/theme\";\n\nimport { DataViewProps } from \"../types\";\nimport { EmptyDetails } from \"./empty-details\";\nimport { ErrorDetails } from \"./error-details\";\nimport { LoadingView } from \"./loading-view\";\n\nexport const DataView = memo((props: PropsWithChildren<DataViewProps>) => {\n const tokens = useComponentsTokens();\n\n const dataStateTokens = tokens.dataState;\n const {\n error,\n isEmpty,\n loading,\n errorViewProps,\n emptyViewProps,\n LoadingComponent,\n contentContainerStyle,\n children,\n ...rest\n } = props;\n\n const content = useMemo(() => {\n if (!error && !isEmpty) {\n return null;\n }\n\n return (\n <View\n alignItems=\"center\"\n justifyContent=\"center\"\n zIndex={dataStateTokens.content.zIndex}\n >\n {error ? <ErrorDetails {...errorViewProps} /> : null}\n {isEmpty ? <EmptyDetails {...emptyViewProps} /> : null}\n </View>\n );\n }, [\n dataStateTokens.content.zIndex,\n emptyViewProps,\n error,\n errorViewProps,\n isEmpty,\n ]);\n\n const showContent = !error && !isEmpty;\n\n return (\n <LoadingView\n {...rest}\n LoadingComponent={LoadingComponent}\n contentContainerStyle={contentContainerStyle}\n loading={loading}\n >\n {showContent ? children : null}\n {content}\n </LoadingView>\n );\n});\n"],"mappings":"AAgCM,SAKW,KALX;AAhCN,SAAS,MAAyB,eAAe;AAEjD,SAAS,YAAY;AACrB,SAAS,2BAA2B;AAGpC,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAErB,MAAM,WAAW,KAAK,CAAC,UAA4C;AACxE,QAAM,SAAS,oBAAoB;AAEnC,QAAM,kBAAkB,OAAO;AAC/B,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AAEJ,QAAM,UAAU,QAAQ,MAAM;AAC5B,QAAI,CAAC,SAAS,CAAC,SAAS;AACtB,aAAO;AAAA,IACT;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,YAAW;AAAA,QACX,gBAAe;AAAA,QACf,QAAQ,gBAAgB,QAAQ;AAAA,QAE/B;AAAA,kBAAQ,oBAAC,gBAAc,GAAG,gBAAgB,IAAK;AAAA,UAC/C,UAAU,oBAAC,gBAAc,GAAG,gBAAgB,IAAK;AAAA;AAAA;AAAA,IACpD;AAAA,EAEJ,GAAG;AAAA,IACD,gBAAgB,QAAQ;AAAA,IACxB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,QAAM,cAAc,CAAC,SAAS,CAAC;AAE/B,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MAEC;AAAA,sBAAc,WAAW;AAAA,QACzB;AAAA;AAAA;AAAA,EACH;AAEJ,CAAC;","names":[]}
@@ -1,10 +1,9 @@
1
1
  import * as react from 'react';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
2
  import { StateViewProps } from '../types/state-view.types.mjs';
4
3
  import 'react-native';
5
4
  import '@impulse-ui-native/icon/types';
6
5
  import '@impulse-ui-native/primitives';
7
6
 
8
- declare const EmptyDetails: react.MemoExoticComponent<(props: StateViewProps) => react_jsx_runtime.JSX.Element>;
7
+ declare const EmptyDetails: react.MemoExoticComponent<(props: StateViewProps) => react.JSX.Element>;
9
8
 
10
9
  export { EmptyDetails };
@@ -1,10 +1,9 @@
1
1
  import * as react from 'react';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
2
  import { EmptyViewProps } from '../types/state-view.types.mjs';
4
3
  import 'react-native';
5
4
  import '@impulse-ui-native/icon/types';
6
5
  import '@impulse-ui-native/primitives';
7
6
 
8
- declare const EmptyView: react.MemoExoticComponent<(props: EmptyViewProps) => react_jsx_runtime.JSX.Element>;
7
+ declare const EmptyView: react.MemoExoticComponent<(props: EmptyViewProps) => react.JSX.Element>;
9
8
 
10
9
  export { EmptyView };
@@ -1,20 +1,8 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { memo } from "react";
3
- import { View } from "@impulse-ui-native/primitives";
3
+ import { StateViewContainer } from "./state-view-container";
4
4
  const EmptyView = memo(function EmptyView2(props) {
5
- const {
6
- variant,
7
- text,
8
- isEmpty,
9
- onPressPrimaryAction,
10
- primaryActionLabel,
11
- onPressSecondaryAction,
12
- secondaryActionLabel,
13
- contentContainerStyle,
14
- children,
15
- ...rest
16
- } = props;
17
- return /* @__PURE__ */ jsx(View, { ...rest, children: /* @__PURE__ */ jsx(View, { style: contentContainerStyle, children }) });
5
+ return /* @__PURE__ */ jsx(StateViewContainer, { ...props });
18
6
  });
19
7
  export {
20
8
  EmptyView
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/empty-view.tsx"],"sourcesContent":["import { memo } from \"react\";\n\nimport { View } from \"@impulse-ui-native/primitives\";\n\nimport { EmptyViewProps } from \"../types\";\n\nexport const EmptyView = memo(function EmptyView(props: EmptyViewProps) {\n const {\n variant,\n text,\n isEmpty,\n onPressPrimaryAction,\n primaryActionLabel,\n onPressSecondaryAction,\n secondaryActionLabel,\n contentContainerStyle,\n children,\n ...rest\n } = props;\n\n return (\n <View {...rest}>\n <View style={contentContainerStyle}>{children}</View>\n </View>\n );\n});\n"],"mappings":"AAsBM;AAtBN,SAAS,YAAY;AAErB,SAAS,YAAY;AAId,MAAM,YAAY,KAAK,SAASA,WAAU,OAAuB;AACtE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AAEJ,SACE,oBAAC,QAAM,GAAG,MACR,8BAAC,QAAK,OAAO,uBAAwB,UAAS,GAChD;AAEJ,CAAC;","names":["EmptyView"]}
1
+ {"version":3,"sources":["../../src/components/empty-view.tsx"],"sourcesContent":["import { memo } from \"react\";\n\nimport type { EmptyViewProps } from \"../types\";\nimport { StateViewContainer } from \"./state-view-container\";\n\nexport const EmptyView = memo(function EmptyView(props: EmptyViewProps) {\n return <StateViewContainer {...props} />;\n});\n"],"mappings":"AAMS;AANT,SAAS,YAAY;AAGrB,SAAS,0BAA0B;AAE5B,MAAM,YAAY,KAAK,SAASA,WAAU,OAAuB;AACtE,SAAO,oBAAC,sBAAoB,GAAG,OAAO;AACxC,CAAC;","names":["EmptyView"]}
@@ -1,10 +1,9 @@
1
1
  import * as react from 'react';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
2
  import { StateViewProps } from '../types/state-view.types.mjs';
4
3
  import 'react-native';
5
4
  import '@impulse-ui-native/icon/types';
6
5
  import '@impulse-ui-native/primitives';
7
6
 
8
- declare const ErrorDetails: react.MemoExoticComponent<(props: StateViewProps) => react_jsx_runtime.JSX.Element>;
7
+ declare const ErrorDetails: react.MemoExoticComponent<(props: StateViewProps) => react.JSX.Element>;
9
8
 
10
9
  export { ErrorDetails };
@@ -1,10 +1,9 @@
1
1
  import * as react from 'react';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
2
  import { ErrorViewProps } from '../types/state-view.types.mjs';
4
3
  import 'react-native';
5
4
  import '@impulse-ui-native/icon/types';
6
5
  import '@impulse-ui-native/primitives';
7
6
 
8
- declare const ErrorView: react.MemoExoticComponent<(props: ErrorViewProps) => react_jsx_runtime.JSX.Element>;
7
+ declare const ErrorView: react.MemoExoticComponent<(props: ErrorViewProps) => react.JSX.Element>;
9
8
 
10
9
  export { ErrorView };
@@ -1,20 +1,8 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { memo } from "react";
3
- import { View } from "@impulse-ui-native/primitives";
3
+ import { StateViewContainer } from "./state-view-container";
4
4
  const ErrorView = memo(function ErrorView2(props) {
5
- const {
6
- variant,
7
- text,
8
- error,
9
- onPressPrimaryAction,
10
- onPressSecondaryAction,
11
- primaryActionLabel,
12
- secondaryActionLabel,
13
- contentContainerStyle,
14
- children,
15
- ...rest
16
- } = props;
17
- return /* @__PURE__ */ jsx(View, { ...rest, children: /* @__PURE__ */ jsx(View, { style: contentContainerStyle, children }) });
5
+ return /* @__PURE__ */ jsx(StateViewContainer, { ...props });
18
6
  });
19
7
  export {
20
8
  ErrorView
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/error-view.tsx"],"sourcesContent":["import { memo } from \"react\";\n\nimport { View } from \"@impulse-ui-native/primitives\";\n\nimport { ErrorViewProps } from \"../types\";\n\nexport const ErrorView = memo(function ErrorView(props: ErrorViewProps) {\n const {\n variant,\n text,\n error,\n onPressPrimaryAction,\n onPressSecondaryAction,\n primaryActionLabel,\n secondaryActionLabel,\n contentContainerStyle,\n children,\n ...rest\n } = props;\n\n return (\n <View {...rest}>\n <View style={contentContainerStyle}>{children}</View>\n </View>\n );\n});\n"],"mappings":"AAsBM;AAtBN,SAAS,YAAY;AAErB,SAAS,YAAY;AAId,MAAM,YAAY,KAAK,SAASA,WAAU,OAAuB;AACtE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AAEJ,SACE,oBAAC,QAAM,GAAG,MACR,8BAAC,QAAK,OAAO,uBAAwB,UAAS,GAChD;AAEJ,CAAC;","names":["ErrorView"]}
1
+ {"version":3,"sources":["../../src/components/error-view.tsx"],"sourcesContent":["import { memo } from \"react\";\n\nimport type { ErrorViewProps } from \"../types\";\nimport { StateViewContainer } from \"./state-view-container\";\n\nexport const ErrorView = memo(function ErrorView(props: ErrorViewProps) {\n return <StateViewContainer {...props} />;\n});\n"],"mappings":"AAMS;AANT,SAAS,YAAY;AAGrB,SAAS,0BAA0B;AAE5B,MAAM,YAAY,KAAK,SAASA,WAAU,OAAuB;AACtE,SAAO,oBAAC,sBAAoB,GAAG,OAAO;AACxC,CAAC;","names":["ErrorView"]}
@@ -4,7 +4,6 @@ export { LoadingView } from './loading-view.mjs';
4
4
  export { DataView } from './data-view.mjs';
5
5
  import '../types/state-view.types.mjs';
6
6
  import 'react';
7
- import 'react/jsx-runtime';
8
7
  import 'react-native';
9
8
  import '@impulse-ui-native/icon/types';
10
9
  import '@impulse-ui-native/primitives';
@@ -1,10 +1,9 @@
1
1
  import * as react from 'react';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
2
  import { LoadingViewProps } from '../types/state-view.types.mjs';
4
3
  import 'react-native';
5
4
  import '@impulse-ui-native/icon/types';
6
5
  import '@impulse-ui-native/primitives';
7
6
 
8
- declare const LoadingView: react.MemoExoticComponent<(props: LoadingViewProps) => react_jsx_runtime.JSX.Element>;
7
+ declare const LoadingView: react.MemoExoticComponent<(props: LoadingViewProps) => react.JSX.Element>;
9
8
 
10
9
  export { LoadingView };
@@ -1,10 +1,9 @@
1
1
  import * as react from 'react';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
2
  import { StateActionsFooterProps } from '../types/state-view.types.mjs';
4
3
  import 'react-native';
5
4
  import '@impulse-ui-native/icon/types';
6
5
  import '@impulse-ui-native/primitives';
7
6
 
8
- declare const StateActionsFooter: react.MemoExoticComponent<(props: StateActionsFooterProps) => react_jsx_runtime.JSX.Element>;
7
+ declare const StateActionsFooter: react.MemoExoticComponent<(props: StateActionsFooterProps) => react.JSX.Element>;
9
8
 
10
9
  export { StateActionsFooter };
@@ -0,0 +1,9 @@
1
+ import * as react from 'react';
2
+ import { StateContainerProps } from '../types/state-view.types.mjs';
3
+ import 'react-native';
4
+ import '@impulse-ui-native/icon/types';
5
+ import '@impulse-ui-native/primitives';
6
+
7
+ declare const StateViewContainer: react.MemoExoticComponent<({ children, contentContainerStyle, ...props }: StateContainerProps) => react.JSX.Element>;
8
+
9
+ export { StateViewContainer };
@@ -0,0 +1,14 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { memo } from "react";
3
+ import { View } from "@impulse-ui-native/primitives";
4
+ const StateViewContainer = memo(function StateViewContainer2({
5
+ children,
6
+ contentContainerStyle,
7
+ ...props
8
+ }) {
9
+ return /* @__PURE__ */ jsx(View, { ...props, children: /* @__PURE__ */ jsx(View, { style: contentContainerStyle, children }) });
10
+ });
11
+ export {
12
+ StateViewContainer
13
+ };
14
+ //# sourceMappingURL=state-view-container.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/state-view-container.tsx"],"sourcesContent":["import { memo } from \"react\";\n\nimport { View } from \"@impulse-ui-native/primitives\";\n\nimport type { StateContainerProps } from \"../types\";\n\nexport const StateViewContainer = memo(function StateViewContainer({\n children,\n contentContainerStyle,\n ...props\n}: StateContainerProps) {\n return (\n <View {...props}>\n <View style={contentContainerStyle}>{children}</View>\n </View>\n );\n});\n"],"mappings":"AAaM;AAbN,SAAS,YAAY;AAErB,SAAS,YAAY;AAId,MAAM,qBAAqB,KAAK,SAASA,oBAAmB;AAAA,EACjE;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAwB;AACtB,SACE,oBAAC,QAAM,GAAG,OACR,8BAAC,QAAK,OAAO,uBAAwB,UAAS,GAChD;AAEJ,CAAC;","names":["StateViewContainer"]}
package/dist/index.d.mts CHANGED
@@ -2,9 +2,8 @@ export { ErrorView } from './components/error-view.mjs';
2
2
  export { EmptyView } from './components/empty-view.mjs';
3
3
  export { LoadingView } from './components/loading-view.mjs';
4
4
  export { DataView } from './components/data-view.mjs';
5
- export { DataViewProps, EmptyViewProps, ErrorViewProps, LoadingViewProps, StateActionsFooterProps, StateViewProps } from './types/state-view.types.mjs';
5
+ export { DataViewProps, EmptyViewProps, ErrorViewProps, LoadingViewProps, StateActionsFooterProps, StateContainerProps, StateViewProps } from './types/state-view.types.mjs';
6
6
  import 'react';
7
- import 'react/jsx-runtime';
8
7
  import 'react-native';
9
8
  import '@impulse-ui-native/icon/types';
10
9
  import '@impulse-ui-native/primitives';
@@ -1,4 +1,4 @@
1
- export { DataViewProps, EmptyViewProps, ErrorViewProps, LoadingViewProps, StateActionsFooterProps, StateViewProps } from './state-view.types.mjs';
1
+ export { DataViewProps, EmptyViewProps, ErrorViewProps, LoadingViewProps, StateActionsFooterProps, StateContainerProps, StateViewProps } from './state-view.types.mjs';
2
2
  import 'react';
3
3
  import 'react-native';
4
4
  import '@impulse-ui-native/icon/types';
@@ -1,5 +1,5 @@
1
1
  import { ComponentType } from 'react';
2
- import { PressableProps, ViewStyle } from 'react-native';
2
+ import { ViewStyle, PressableProps } from 'react-native';
3
3
  import { IconProps } from '@impulse-ui-native/icon/types';
4
4
  import { ViewProps } from '@impulse-ui-native/primitives';
5
5
 
@@ -14,20 +14,19 @@ interface StateViewProps extends StateActionsFooterProps, ViewProps {
14
14
  variant?: IconProps["variant"];
15
15
  contentContainerStyle?: ViewStyle;
16
16
  }
17
- interface EmptyViewProps extends StateViewProps {
18
- isEmpty: boolean;
19
- }
20
- interface ErrorViewProps extends StateViewProps {
21
- error: Error | null;
17
+ interface StateContainerProps extends ViewProps {
18
+ contentContainerStyle?: ViewStyle;
22
19
  }
20
+ type EmptyViewProps = StateContainerProps;
21
+ type ErrorViewProps = StateContainerProps;
23
22
  interface LoadingViewProps extends ViewProps {
24
23
  loading: boolean;
25
24
  LoadingComponent: ComponentType;
26
25
  contentContainerStyle?: ViewStyle;
27
26
  }
28
27
  interface DataViewProps extends ViewProps {
29
- error: ErrorViewProps["error"];
30
- isEmpty: EmptyViewProps["isEmpty"];
28
+ error: Error | null;
29
+ isEmpty: boolean;
31
30
  LoadingComponent: ComponentType;
32
31
  loading: LoadingViewProps["loading"];
33
32
  contentContainerStyle?: ViewStyle;
@@ -35,4 +34,4 @@ interface DataViewProps extends ViewProps {
35
34
  emptyViewProps: StateViewProps;
36
35
  }
37
36
 
38
- export type { DataViewProps, EmptyViewProps, ErrorViewProps, LoadingViewProps, StateActionsFooterProps, StateViewProps };
37
+ export type { DataViewProps, EmptyViewProps, ErrorViewProps, LoadingViewProps, StateActionsFooterProps, StateContainerProps, StateViewProps };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@impulse-ui-native/data-state",
3
- "version": "9.1.1",
3
+ "version": "10.0.0",
4
4
  "description": "Loading, empty, and error state components for ImpulseUI Native applications.",
5
5
  "keywords": [
6
6
  "react-native",
@@ -13,11 +13,11 @@
13
13
  "source": "src/index.ts",
14
14
  "module": "dist/index.js",
15
15
  "types": "dist/index.d.mts",
16
- "react-native": "src/index.ts",
16
+ "react-native": "dist/index.js",
17
17
  "exports": {
18
18
  ".": {
19
19
  "types": "./dist/index.d.mts",
20
- "react-native": "./src/index.ts",
20
+ "react-native": "./dist/index.js",
21
21
  "import": "./dist/index.js"
22
22
  }
23
23
  },
@@ -28,24 +28,24 @@
28
28
  ],
29
29
  "sideEffects": false,
30
30
  "dependencies": {
31
- "@impulse-ui-native/core": "9.1.1",
32
- "@impulse-ui-native/icon": "9.1.1",
33
- "@impulse-ui-native/skeleton": "9.1.1",
34
- "@impulse-ui-native/theme": "9.1.1",
35
- "@impulse-ui-native/primitives": "9.1.1"
31
+ "@impulse-ui-native/core": "10.0.0",
32
+ "@impulse-ui-native/skeleton": "10.0.0",
33
+ "@impulse-ui-native/icon": "10.0.0",
34
+ "@impulse-ui-native/theme": "10.0.0",
35
+ "@impulse-ui-native/primitives": "10.0.0"
36
36
  },
37
37
  "devDependencies": {
38
- "@types/react": "~19.2.14",
38
+ "@types/react": "~19.3.0",
39
39
  "eslint": "^9.38.0",
40
40
  "prettier": "^3.6.2",
41
- "react": "19.2.3",
42
- "react-native": "0.86.2",
43
- "react-native-reanimated": "4.5.1",
44
- "react-native-worklets": "0.10.1",
41
+ "react": "19.3.0",
42
+ "react-native": "0.88.0",
43
+ "react-native-reanimated": "4.7.1",
44
+ "react-native-worklets": "0.13.0",
45
45
  "typescript": "~6.0.3",
46
+ "@impulse-ui-native/prettier-config": "1.0.0",
46
47
  "@impulse-ui-native/eslint-config": "1.0.0",
47
- "@impulse-ui-native/tsconfig": "1.0.0",
48
- "@impulse-ui-native/prettier-config": "1.0.0"
48
+ "@impulse-ui-native/tsconfig": "1.0.0"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "react": ">=18",