@raystack/frontier 0.0.3 → 0.0.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raystack/frontier",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "A js library for frontier",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -1,8 +1,7 @@
1
- import * as React$1 from 'react';
2
- import React__default, { ComponentPropsWithRef, Dispatch, SetStateAction } from 'react';
1
+ import React$1, { ComponentPropsWithRef, Dispatch, SetStateAction } from 'react';
3
2
 
4
3
  type ContainerProps = ComponentPropsWithRef<'div'> & {
5
- children?: React__default.ReactNode;
4
+ children?: React$1.ReactNode;
6
5
  shadow?: 'none' | 'xs' | 'sm' | 'md' | 'lg';
7
6
  radius?: 'none' | 'xs' | 'sm' | 'md' | 'lg';
8
7
  className?: string;
@@ -10,20 +9,20 @@ type ContainerProps = ComponentPropsWithRef<'div'> & {
10
9
  declare const Container: ({ children, shadow, radius, style, className }: ContainerProps) => JSX.Element;
11
10
 
12
11
  type MagicLinkVerifyProps = ComponentPropsWithRef<typeof Container> & {
13
- logo?: React__default.ReactNode;
12
+ logo?: React$1.ReactNode;
14
13
  title?: string;
15
14
  };
16
15
  declare const MagicLinkVerify: ({ logo, title, ...props }: MagicLinkVerifyProps) => JSX.Element;
17
16
 
18
17
  type SignedInProps = ComponentPropsWithRef<typeof Container> & {
19
- logo?: React__default.ReactNode;
18
+ logo?: React$1.ReactNode;
20
19
  title?: string;
21
20
  excludes?: string[];
22
21
  };
23
22
  declare const SignIn: ({ logo, title, excludes, ...props }: SignedInProps) => JSX.Element;
24
23
 
25
24
  type SignUpProps = ComponentPropsWithRef<typeof Container> & {
26
- logo?: React__default.ReactNode;
25
+ logo?: React$1.ReactNode;
27
26
  title?: string;
28
27
  excludes?: string[];
29
28
  };
@@ -60,7 +59,7 @@ interface InitialState {
60
59
  }
61
60
  interface FrontierProviderProps {
62
61
  config: FrontierClientOptions;
63
- children: React__default.ReactNode;
62
+ children: React$1.ReactNode;
64
63
  initialState?: InitialState;
65
64
  }
66
65
 
@@ -2668,6 +2667,9 @@ interface FrontierContextProviderProps {
2668
2667
  }
2669
2668
  declare function useFrontier(): FrontierContextProviderProps;
2670
2669
 
2671
- declare const FrontierProvider: React$1.ComponentType<FrontierProviderProps>;
2670
+ declare const FrontierProvider: {
2671
+ (props: FrontierProviderProps): JSX.Element;
2672
+ displayName: string;
2673
+ };
2672
2674
 
2673
2675
  export { Container, CreateOrganization, FrontierProvider, MagicLinkVerify, OrganizationProfile, SignIn, SignUp, Window, useFrontier };
@@ -6224,7 +6224,7 @@ var Window = (_a) => {
6224
6224
  var import_react28 = __toESM(require("react"));
6225
6225
  var import_jsx_runtime45 = require("react/jsx-runtime");
6226
6226
  var counts = /* @__PURE__ */ new Map();
6227
- function useMaxAllowedInstancesGuard(name, error, maxCount = 1) {
6227
+ function useMaxAllowedInstancesGuard(name, error, maxCount = 2) {
6228
6228
  import_react28.default.useEffect(() => {
6229
6229
  const count = counts.get(name) || 0;
6230
6230
  if (count == maxCount) {
@@ -6249,7 +6249,7 @@ function withMaxAllowedInstancesGuard(WrappedComponent, name, error) {
6249
6249
  // react/contexts/FrontierProvider.tsx
6250
6250
  var import_jsx_runtime46 = require("react/jsx-runtime");
6251
6251
  var multipleFrontierProvidersError = "Frontier: You've added multiple <FrontierProvider> components in your React component tree. Wrap your components in a single <FrontierProvider>.";
6252
- var FrontierProviderBase = (props) => {
6252
+ var FrontierProvider = (props) => {
6253
6253
  const _a = props, { children, initialState, config } = _a, options = __objRest(_a, ["children", "initialState", "config"]);
6254
6254
  return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
6255
6255
  FrontierContextProvider,
@@ -6261,12 +6261,12 @@ var FrontierProviderBase = (props) => {
6261
6261
  })
6262
6262
  );
6263
6263
  };
6264
- var FrontierProvider = withMaxAllowedInstancesGuard(
6265
- FrontierProviderBase,
6264
+ FrontierProvider.displayName = "FrontierProvider";
6265
+ var FrontierProviderGaurd = withMaxAllowedInstancesGuard(
6266
+ FrontierProvider,
6266
6267
  "FrontierProvider",
6267
6268
  multipleFrontierProvidersError
6268
6269
  );
6269
- FrontierProvider.displayName = "FrontierProvider";
6270
6270
  // Annotate the CommonJS export names for ESM import in node:
6271
6271
  0 && (module.exports = {
6272
6272
  Container,
@@ -6300,7 +6300,7 @@ var Window = (_a) => {
6300
6300
  import React6 from "react";
6301
6301
  import { jsx as jsx45 } from "react/jsx-runtime";
6302
6302
  var counts = /* @__PURE__ */ new Map();
6303
- function useMaxAllowedInstancesGuard(name, error, maxCount = 1) {
6303
+ function useMaxAllowedInstancesGuard(name, error, maxCount = 2) {
6304
6304
  React6.useEffect(() => {
6305
6305
  const count = counts.get(name) || 0;
6306
6306
  if (count == maxCount) {
@@ -6325,7 +6325,7 @@ function withMaxAllowedInstancesGuard(WrappedComponent, name, error) {
6325
6325
  // react/contexts/FrontierProvider.tsx
6326
6326
  import { jsx as jsx46 } from "react/jsx-runtime";
6327
6327
  var multipleFrontierProvidersError = "Frontier: You've added multiple <FrontierProvider> components in your React component tree. Wrap your components in a single <FrontierProvider>.";
6328
- var FrontierProviderBase = (props) => {
6328
+ var FrontierProvider = (props) => {
6329
6329
  const _a = props, { children, initialState, config } = _a, options = __objRest(_a, ["children", "initialState", "config"]);
6330
6330
  return /* @__PURE__ */ jsx46(
6331
6331
  FrontierContextProvider,
@@ -6337,12 +6337,12 @@ var FrontierProviderBase = (props) => {
6337
6337
  })
6338
6338
  );
6339
6339
  };
6340
- var FrontierProvider = withMaxAllowedInstancesGuard(
6341
- FrontierProviderBase,
6340
+ FrontierProvider.displayName = "FrontierProvider";
6341
+ var FrontierProviderGaurd = withMaxAllowedInstancesGuard(
6342
+ FrontierProvider,
6342
6343
  "FrontierProvider",
6343
6344
  multipleFrontierProvidersError
6344
6345
  );
6345
- FrontierProvider.displayName = "FrontierProvider";
6346
6346
  export {
6347
6347
  Container,
6348
6348
  CreateOrganization,
Binary file