@asgardeo/nextjs 0.1.13 → 0.1.14

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.
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ 'use client';
19
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
20
+ import useAsgardeo from '../../../contexts/Asgardeo/useAsgardeo';
21
+ /**
22
+ * A component that only renders its children when the Asgardeo is loading.
23
+ *
24
+ * @remarks This component is only supported in browser based React applications (CSR).
25
+ *
26
+ * @example
27
+ * ```tsx
28
+ * import { Loading } from '@asgardeo/auth-react';
29
+ *
30
+ * const App = () => {
31
+ * return (
32
+ * <Loading fallback={<p>Finished Loading...</p>}>
33
+ * <p>Loading...</p>
34
+ * </Loading>
35
+ * );
36
+ * }
37
+ * ```
38
+ */
39
+ const Loading = ({ children, fallback = null }) => {
40
+ const { isLoading } = useAsgardeo();
41
+ if (!isLoading) {
42
+ return _jsx(_Fragment, { children: fallback });
43
+ }
44
+ return _jsx(_Fragment, { children: children });
45
+ };
46
+ Loading.displayName = 'Loading';
47
+ export default Loading;
48
+ //# sourceMappingURL=Loading.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Loading.js","sourceRoot":"","sources":["../../../../../../src/client/components/control/Loading/Loading.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,YAAY,CAAC;;AAGb,OAAO,WAAW,MAAM,wCAAwC,CAAC;AAYjE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,GAAwC,CAAC,EAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,EAAkC,EAAE,EAAE;IACpH,MAAM,EAAC,SAAS,EAAC,GAAG,WAAW,EAAE,CAAC;IAElC,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,4BAAG,QAAQ,GAAI,CAAC;IACzB,CAAC;IAED,OAAO,4BAAG,QAAQ,GAAI,CAAC;AACzB,CAAC,CAAC;AAEF,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;AAEhC,eAAe,OAAO,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ import { FC, PropsWithChildren, ReactNode } from 'react';
19
+ /**
20
+ * Props for the Loading component.
21
+ */
22
+ export interface LoadingProps {
23
+ /**
24
+ * Content to show when the user is not signed in.
25
+ */
26
+ fallback?: ReactNode;
27
+ }
28
+ /**
29
+ * A component that only renders its children when the Asgardeo is loading.
30
+ *
31
+ * @remarks This component is only supported in browser based React applications (CSR).
32
+ *
33
+ * @example
34
+ * ```tsx
35
+ * import { Loading } from '@asgardeo/auth-react';
36
+ *
37
+ * const App = () => {
38
+ * return (
39
+ * <Loading fallback={<p>Finished Loading...</p>}>
40
+ * <p>Loading...</p>
41
+ * </Loading>
42
+ * );
43
+ * }
44
+ * ```
45
+ */
46
+ declare const Loading: FC<PropsWithChildren<LoadingProps>>;
47
+ export default Loading;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asgardeo/nextjs",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "description": "Next.js implementation of Asgardeo JavaScript SDK.",
5
5
  "keywords": [
6
6
  "asgardeo",
@@ -45,8 +45,8 @@
45
45
  "@types/react": "^19.1.4",
46
46
  "jose": "^5.10.0",
47
47
  "tslib": "^2.8.1",
48
- "@asgardeo/node": "^0.0.10",
49
- "@asgardeo/react": "^0.5.12"
48
+ "@asgardeo/node": "^0.0.11",
49
+ "@asgardeo/react": "^0.5.13"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/node": "^22.15.3",