@impulse-ui-native/data-state 9.1.1 → 9.1.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.
@@ -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":[]}
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": "9.1.2",
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,11 +28,11 @@
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/theme": "9.1.2",
32
+ "@impulse-ui-native/primitives": "9.1.2",
33
+ "@impulse-ui-native/core": "9.1.2",
34
+ "@impulse-ui-native/icon": "9.1.2",
35
+ "@impulse-ui-native/skeleton": "9.1.2"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/react": "~19.2.14",
@@ -44,8 +44,8 @@
44
44
  "react-native-worklets": "0.10.1",
45
45
  "typescript": "~6.0.3",
46
46
  "@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"
47
+ "@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",