@tern-secure/nextjs 3.3.3 → 3.4.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 +33 -33
- package/dist/types/index.d.ts +1 -0
- package/package.json +79 -79
- package/dist/cjs/app-router/client/TernSecureProvider.js +0 -33
- package/dist/cjs/app-router/client/TernSecureProvider.js.map +0 -1
- package/dist/cjs/app-router/client/actions.js +0 -97
- package/dist/cjs/app-router/client/actions.js.map +0 -1
- package/dist/cjs/app-router/server/auth.js +0 -71
- package/dist/cjs/app-router/server/auth.js.map +0 -1
- package/dist/cjs/app-router/server/index.js +0 -42
- package/dist/cjs/app-router/server/index.js.map +0 -1
- package/dist/cjs/app-router/server/sessionTernSecure.js +0 -159
- package/dist/cjs/app-router/server/sessionTernSecure.js.map +0 -1
- package/dist/cjs/app-router/server/ternSecureMiddleware.js +0 -50
- package/dist/cjs/app-router/server/ternSecureMiddleware.js.map +0 -1
- package/dist/cjs/boundary/TernSecureClientProvider.js +0 -94
- package/dist/cjs/boundary/TernSecureClientProvider.js.map +0 -1
- package/dist/cjs/boundary/TernSecureCtx.js +0 -49
- package/dist/cjs/boundary/TernSecureCtx.js.map +0 -1
- package/dist/cjs/boundary/hooks/useAuth.js +0 -51
- package/dist/cjs/boundary/hooks/useAuth.js.map +0 -1
- package/dist/cjs/boundary/hooks/useUser.js +0 -44
- package/dist/cjs/boundary/hooks/useUser.js.map +0 -1
- package/dist/cjs/components/background.js +0 -65
- package/dist/cjs/components/background.js.map +0 -1
- package/dist/cjs/components/sign-in.js +0 -243
- package/dist/cjs/components/sign-in.js.map +0 -1
- package/dist/cjs/components/sign-out.js +0 -69
- package/dist/cjs/components/sign-out.js.map +0 -1
- package/dist/cjs/components/ui/alert.js +0 -88
- package/dist/cjs/components/ui/alert.js.map +0 -1
- package/dist/cjs/components/ui/button.js +0 -84
- package/dist/cjs/components/ui/button.js.map +0 -1
- package/dist/cjs/components/ui/card.js +0 -101
- package/dist/cjs/components/ui/card.js.map +0 -1
- package/dist/cjs/components/ui/input.js +0 -58
- package/dist/cjs/components/ui/input.js.map +0 -1
- package/dist/cjs/components/ui/label.js +0 -55
- package/dist/cjs/components/ui/label.js.map +0 -1
- package/dist/cjs/components/ui/separator.js +0 -59
- package/dist/cjs/components/ui/separator.js.map +0 -1
- package/dist/cjs/errors.js +0 -41
- package/dist/cjs/errors.js.map +0 -1
- package/dist/cjs/index.js +0 -56
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/lib/utils.d.js +0 -17
- package/dist/cjs/lib/utils.d.js.map +0 -1
- package/dist/cjs/lib/utils.js +0 -33
- package/dist/cjs/lib/utils.js.map +0 -1
- package/dist/cjs/types.js +0 -17
- package/dist/cjs/types.js.map +0 -1
- package/dist/cjs/utils/admin-init.js +0 -57
- package/dist/cjs/utils/admin-init.js.map +0 -1
- package/dist/cjs/utils/client-init.js +0 -49
- package/dist/cjs/utils/client-init.js.map +0 -1
- package/dist/cjs/utils/config.js +0 -113
- package/dist/cjs/utils/config.js.map +0 -1
- package/dist/cjs/utils/construct.js +0 -63
- package/dist/cjs/utils/construct.js.map +0 -1
- package/dist/cjs/utils/create-styles.js +0 -149
- package/dist/cjs/utils/create-styles.js.map +0 -1
- package/dist/esm/app-router/client/TernSecureProvider.js +0 -9
- package/dist/esm/app-router/client/TernSecureProvider.js.map +0 -1
- package/dist/esm/app-router/client/actions.js +0 -70
- package/dist/esm/app-router/client/actions.js.map +0 -1
- package/dist/esm/app-router/server/auth.js +0 -47
- package/dist/esm/app-router/server/auth.js.map +0 -1
- package/dist/esm/app-router/server/index.js +0 -13
- package/dist/esm/app-router/server/index.js.map +0 -1
- package/dist/esm/app-router/server/sessionTernSecure.js +0 -129
- package/dist/esm/app-router/server/sessionTernSecure.js.map +0 -1
- package/dist/esm/app-router/server/ternSecureMiddleware.js +0 -26
- package/dist/esm/app-router/server/ternSecureMiddleware.js.map +0 -1
- package/dist/esm/boundary/TernSecureClientProvider.js +0 -70
- package/dist/esm/boundary/TernSecureClientProvider.js.map +0 -1
- package/dist/esm/boundary/TernSecureCtx.js +0 -23
- package/dist/esm/boundary/TernSecureCtx.js.map +0 -1
- package/dist/esm/boundary/hooks/useAuth.js +0 -27
- package/dist/esm/boundary/hooks/useAuth.js.map +0 -1
- package/dist/esm/boundary/hooks/useUser.js +0 -20
- package/dist/esm/boundary/hooks/useUser.js.map +0 -1
- package/dist/esm/components/background.js +0 -41
- package/dist/esm/components/background.js.map +0 -1
- package/dist/esm/components/sign-in.js +0 -219
- package/dist/esm/components/sign-in.js.map +0 -1
- package/dist/esm/components/sign-out.js +0 -45
- package/dist/esm/components/sign-out.js.map +0 -1
- package/dist/esm/components/ui/alert.js +0 -52
- package/dist/esm/components/ui/alert.js.map +0 -1
- package/dist/esm/components/ui/button.js +0 -49
- package/dist/esm/components/ui/button.js.map +0 -1
- package/dist/esm/components/ui/card.js +0 -62
- package/dist/esm/components/ui/card.js.map +0 -1
- package/dist/esm/components/ui/input.js +0 -24
- package/dist/esm/components/ui/input.js.map +0 -1
- package/dist/esm/components/ui/label.js +0 -21
- package/dist/esm/components/ui/label.js.map +0 -1
- package/dist/esm/components/ui/separator.js +0 -25
- package/dist/esm/components/ui/separator.js.map +0 -1
- package/dist/esm/errors.js +0 -16
- package/dist/esm/errors.js.map +0 -1
- package/dist/esm/index.js +0 -22
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/lib/utils.d.js +0 -1
- package/dist/esm/lib/utils.d.js.map +0 -1
- package/dist/esm/lib/utils.js +0 -9
- package/dist/esm/lib/utils.js.map +0 -1
- package/dist/esm/types.js +0 -1
- package/dist/esm/types.js.map +0 -1
- package/dist/esm/utils/admin-init.js +0 -22
- package/dist/esm/utils/admin-init.js.map +0 -1
- package/dist/esm/utils/client-init.js +0 -22
- package/dist/esm/utils/client-init.js.map +0 -1
- package/dist/esm/utils/config.js +0 -84
- package/dist/esm/utils/config.js.map +0 -1
- package/dist/esm/utils/construct.js +0 -37
- package/dist/esm/utils/construct.js.map +0 -1
- package/dist/esm/utils/create-styles.js +0 -123
- package/dist/esm/utils/create-styles.js.map +0 -1
- package/dist/types/app-router/client/TernSecureProvider.d.ts +0 -26
- package/dist/types/app-router/client/TernSecureProvider.d.ts.map +0 -1
- package/dist/types/app-router/client/actions.d.ts +0 -39
- package/dist/types/app-router/client/actions.d.ts.map +0 -1
- package/dist/types/app-router/server/auth.d.ts +0 -7
- package/dist/types/app-router/server/auth.d.ts.map +0 -1
- package/dist/types/app-router/server/index.d.ts +0 -5
- package/dist/types/app-router/server/index.d.ts.map +0 -1
- package/dist/types/app-router/server/sessionTernSecure.d.ts +0 -37
- package/dist/types/app-router/server/sessionTernSecure.d.ts.map +0 -1
- package/dist/types/app-router/server/ternSecureMiddleware.d.ts +0 -7
- package/dist/types/app-router/server/ternSecureMiddleware.d.ts.map +0 -1
- package/dist/types/boundary/TernSecureClientProvider.d.ts +0 -11
- package/dist/types/boundary/TernSecureClientProvider.d.ts.map +0 -1
- package/dist/types/boundary/TernSecureCtx.d.ts +0 -15
- package/dist/types/boundary/TernSecureCtx.d.ts.map +0 -1
- package/dist/types/boundary/hooks/useAuth.d.ts +0 -11
- package/dist/types/boundary/hooks/useAuth.d.ts.map +0 -1
- package/dist/types/boundary/hooks/useUser.d.ts +0 -7
- package/dist/types/boundary/hooks/useUser.d.ts.map +0 -1
- package/dist/types/components/background.d.ts +0 -2
- package/dist/types/components/background.d.ts.map +0 -1
- package/dist/types/components/sign-in.d.ts +0 -18
- package/dist/types/components/sign-in.d.ts.map +0 -1
- package/dist/types/components/sign-out.d.ts +0 -10
- package/dist/types/components/sign-out.d.ts.map +0 -1
- package/dist/types/components/ui/alert.d.ts +0 -9
- package/dist/types/components/ui/alert.d.ts.map +0 -1
- package/dist/types/components/ui/button.d.ts +0 -12
- package/dist/types/components/ui/button.d.ts.map +0 -1
- package/dist/types/components/ui/card.d.ts +0 -9
- package/dist/types/components/ui/card.d.ts.map +0 -1
- package/dist/types/components/ui/input.d.ts +0 -4
- package/dist/types/components/ui/input.d.ts.map +0 -1
- package/dist/types/components/ui/label.d.ts +0 -6
- package/dist/types/components/ui/label.d.ts.map +0 -1
- package/dist/types/components/ui/separator.d.ts +0 -5
- package/dist/types/components/ui/separator.d.ts.map +0 -1
- package/dist/types/errors.d.ts +0 -9
- package/dist/types/errors.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/lib/utils.d.ts +0 -3
- package/dist/types/lib/utils.d.ts.map +0 -1
- package/dist/types/types.d.ts +0 -63
- package/dist/types/types.d.ts.map +0 -1
- package/dist/types/utils/admin-init.d.ts +0 -4
- package/dist/types/utils/admin-init.d.ts.map +0 -1
- package/dist/types/utils/client-init.d.ts +0 -5
- package/dist/types/utils/client-init.d.ts.map +0 -1
- package/dist/types/utils/config.d.ts +0 -35
- package/dist/types/utils/config.d.ts.map +0 -1
- package/dist/types/utils/construct.d.ts +0 -22
- package/dist/types/utils/construct.d.ts.map +0 -1
- package/dist/types/utils/create-styles.d.ts +0 -99
- package/dist/types/utils/create-styles.d.ts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/button.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default:\n \"bg-primary text-primary-foreground shadow hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90\",\n outline:\n \"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 px-4 py-2\",\n sm: \"h-8 rounded-md px-3 text-xs\",\n lg: \"h-10 rounded-md px-8\",\n icon: \"h-9 w-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\"\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n {...props}\n />\n )\n }\n)\nButton.displayName = \"Button\"\n\nexport { Button, buttonVariants }\n"],"mappings":"AA8CM;AA9CN,YAAY,WAAW;AACvB,SAAS,YAAY;AACrB,SAAS,WAA8B;AAEvC,SAAS,UAAU;AAEnB,MAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SACE;AAAA,QACF,aACE;AAAA,QACF,SACE;AAAA,QACF,WACE;AAAA,QACF,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAQA,MAAM,SAAS,MAAM;AAAA,EACnB,CAAC,EAAE,WAAW,SAAS,MAAM,UAAU,OAAO,GAAG,MAAM,GAAG,QAAQ;AAChE,UAAM,OAAO,UAAU,OAAO;AAC9B,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAW,GAAG,eAAe,EAAE,SAAS,MAAM,UAAU,CAAC,CAAC;AAAA,QAC1D;AAAA,QACC,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AACA,OAAO,cAAc;","names":[]}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { cn } from "../../lib/utils";
|
|
4
|
-
const Card = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5
|
-
"div",
|
|
6
|
-
{
|
|
7
|
-
ref,
|
|
8
|
-
className: cn(
|
|
9
|
-
"rounded-xl border bg-card text-card-foreground shadow",
|
|
10
|
-
className
|
|
11
|
-
),
|
|
12
|
-
...props
|
|
13
|
-
}
|
|
14
|
-
));
|
|
15
|
-
Card.displayName = "Card";
|
|
16
|
-
const CardHeader = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
17
|
-
"div",
|
|
18
|
-
{
|
|
19
|
-
ref,
|
|
20
|
-
className: cn("flex flex-col space-y-1.5 p-6", className),
|
|
21
|
-
...props
|
|
22
|
-
}
|
|
23
|
-
));
|
|
24
|
-
CardHeader.displayName = "CardHeader";
|
|
25
|
-
const CardTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
26
|
-
"div",
|
|
27
|
-
{
|
|
28
|
-
ref,
|
|
29
|
-
className: cn("font-semibold leading-none tracking-tight", className),
|
|
30
|
-
...props
|
|
31
|
-
}
|
|
32
|
-
));
|
|
33
|
-
CardTitle.displayName = "CardTitle";
|
|
34
|
-
const CardDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
35
|
-
"div",
|
|
36
|
-
{
|
|
37
|
-
ref,
|
|
38
|
-
className: cn("text-sm text-muted-foreground", className),
|
|
39
|
-
...props
|
|
40
|
-
}
|
|
41
|
-
));
|
|
42
|
-
CardDescription.displayName = "CardDescription";
|
|
43
|
-
const CardContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("p-6 pt-0", className), ...props }));
|
|
44
|
-
CardContent.displayName = "CardContent";
|
|
45
|
-
const CardFooter = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
46
|
-
"div",
|
|
47
|
-
{
|
|
48
|
-
ref,
|
|
49
|
-
className: cn("flex items-center p-6 pt-0", className),
|
|
50
|
-
...props
|
|
51
|
-
}
|
|
52
|
-
));
|
|
53
|
-
CardFooter.displayName = "CardFooter";
|
|
54
|
-
export {
|
|
55
|
-
Card,
|
|
56
|
-
CardContent,
|
|
57
|
-
CardDescription,
|
|
58
|
-
CardFooter,
|
|
59
|
-
CardHeader,
|
|
60
|
-
CardTitle
|
|
61
|
-
};
|
|
62
|
-
//# sourceMappingURL=card.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/card.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst Card = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n \"rounded-xl border bg-card text-card-foreground shadow\",\n className\n )}\n {...props}\n />\n))\nCard.displayName = \"Card\"\n\nconst CardHeader = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex flex-col space-y-1.5 p-6\", className)}\n {...props}\n />\n))\nCardHeader.displayName = \"CardHeader\"\n\nconst CardTitle = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n))\nCardTitle.displayName = \"CardTitle\"\n\nconst CardDescription = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n))\nCardDescription.displayName = \"CardDescription\"\n\nconst CardContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"p-6 pt-0\", className)} {...props} />\n))\nCardContent.displayName = \"CardContent\"\n\nconst CardFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex items-center p-6 pt-0\", className)}\n {...props}\n />\n))\nCardFooter.displayName = \"CardFooter\"\n\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }\n"],"mappings":"AAQE;AARF,YAAY,WAAW;AAEvB,SAAS,UAAU;AAEnB,MAAM,OAAO,MAAM,WAGjB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,KAAK,cAAc;AAEnB,MAAM,aAAa,MAAM,WAGvB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,WAAW,GAAG,iCAAiC,SAAS;AAAA,IACvD,GAAG;AAAA;AACN,CACD;AACD,WAAW,cAAc;AAEzB,MAAM,YAAY,MAAM,WAGtB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,WAAW,GAAG,6CAA6C,SAAS;AAAA,IACnE,GAAG;AAAA;AACN,CACD;AACD,UAAU,cAAc;AAExB,MAAM,kBAAkB,MAAM,WAG5B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,WAAW,GAAG,iCAAiC,SAAS;AAAA,IACvD,GAAG;AAAA;AACN,CACD;AACD,gBAAgB,cAAc;AAE9B,MAAM,cAAc,MAAM,WAGxB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B,oBAAC,SAAI,KAAU,WAAW,GAAG,YAAY,SAAS,GAAI,GAAG,OAAO,CACjE;AACD,YAAY,cAAc;AAE1B,MAAM,aAAa,MAAM,WAGvB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,WAAW,GAAG,8BAA8B,SAAS;AAAA,IACpD,GAAG;AAAA;AACN,CACD;AACD,WAAW,cAAc;","names":[]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { cn } from "../../lib/utils";
|
|
4
|
-
const Input = React.forwardRef(
|
|
5
|
-
({ className, type, ...props }, ref) => {
|
|
6
|
-
return /* @__PURE__ */ jsx(
|
|
7
|
-
"input",
|
|
8
|
-
{
|
|
9
|
-
type,
|
|
10
|
-
className: cn(
|
|
11
|
-
"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
12
|
-
className
|
|
13
|
-
),
|
|
14
|
-
ref,
|
|
15
|
-
...props
|
|
16
|
-
}
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
);
|
|
20
|
-
Input.displayName = "Input";
|
|
21
|
-
export {
|
|
22
|
-
Input
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=input.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/input.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst Input = React.forwardRef<HTMLInputElement, React.ComponentProps<\"input\">>(\n ({ className, type, ...props }, ref) => {\n return (\n <input\n type={type}\n className={cn(\n \"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n className\n )}\n ref={ref}\n {...props}\n />\n )\n }\n)\nInput.displayName = \"Input\"\n\nexport { Input }\n"],"mappings":"AAOM;AAPN,YAAY,WAAW;AAEvB,SAAS,UAAU;AAEnB,MAAM,QAAQ,MAAM;AAAA,EAClB,CAAC,EAAE,WAAW,MAAM,GAAG,MAAM,GAAG,QAAQ;AACtC,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QACF;AAAA,QACA;AAAA,QACC,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AACA,MAAM,cAAc;","names":[]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
4
|
-
import { cva } from "class-variance-authority";
|
|
5
|
-
import { cn } from "../../lib/utils";
|
|
6
|
-
const labelVariants = cva(
|
|
7
|
-
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
8
|
-
);
|
|
9
|
-
const Label = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
10
|
-
LabelPrimitive.Root,
|
|
11
|
-
{
|
|
12
|
-
ref,
|
|
13
|
-
className: cn(labelVariants(), className),
|
|
14
|
-
...props
|
|
15
|
-
}
|
|
16
|
-
));
|
|
17
|
-
Label.displayName = LabelPrimitive.Root.displayName;
|
|
18
|
-
export {
|
|
19
|
-
Label
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=label.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/label.tsx"],"sourcesContent":["import * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst labelVariants = cva(\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n)\n\nconst Label = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &\n VariantProps<typeof labelVariants>\n>(({ className, ...props }, ref) => (\n <LabelPrimitive.Root\n ref={ref}\n className={cn(labelVariants(), className)}\n {...props}\n />\n))\nLabel.displayName = LabelPrimitive.Root.displayName\n\nexport { Label }\n"],"mappings":"AAeE;AAfF,YAAY,WAAW;AACvB,YAAY,oBAAoB;AAChC,SAAS,WAA8B;AAEvC,SAAS,UAAU;AAEnB,MAAM,gBAAgB;AAAA,EACpB;AACF;AAEA,MAAM,QAAQ,MAAM,WAIlB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC,eAAe;AAAA,EAAf;AAAA,IACC;AAAA,IACA,WAAW,GAAG,cAAc,GAAG,SAAS;AAAA,IACvC,GAAG;AAAA;AACN,CACD;AACD,MAAM,cAAc,eAAe,KAAK;","names":[]}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
4
|
-
import { cn } from "../../lib/utils";
|
|
5
|
-
const Separator = React.forwardRef(
|
|
6
|
-
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7
|
-
SeparatorPrimitive.Root,
|
|
8
|
-
{
|
|
9
|
-
ref,
|
|
10
|
-
decorative,
|
|
11
|
-
orientation,
|
|
12
|
-
className: cn(
|
|
13
|
-
"shrink-0 bg-border",
|
|
14
|
-
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
15
|
-
className
|
|
16
|
-
),
|
|
17
|
-
...props
|
|
18
|
-
}
|
|
19
|
-
)
|
|
20
|
-
);
|
|
21
|
-
Separator.displayName = SeparatorPrimitive.Root.displayName;
|
|
22
|
-
export {
|
|
23
|
-
Separator
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=separator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/separator.tsx"],"sourcesContent":["import * as React from \"react\"\nimport * as SeparatorPrimitive from \"@radix-ui/react-separator\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst Separator = React.forwardRef<\n React.ElementRef<typeof SeparatorPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(\n (\n { className, orientation = \"horizontal\", decorative = true, ...props },\n ref\n ) => (\n <SeparatorPrimitive.Root\n ref={ref}\n decorative={decorative}\n orientation={orientation}\n className={cn(\n \"shrink-0 bg-border\",\n orientation === \"horizontal\" ? \"h-[1px] w-full\" : \"h-full w-[1px]\",\n className\n )}\n {...props}\n />\n )\n)\nSeparator.displayName = SeparatorPrimitive.Root.displayName\n\nexport { Separator }\n"],"mappings":"AAaI;AAbJ,YAAY,WAAW;AACvB,YAAY,wBAAwB;AAEpC,SAAS,UAAU;AAEnB,MAAM,YAAY,MAAM;AAAA,EAItB,CACE,EAAE,WAAW,cAAc,cAAc,aAAa,MAAM,GAAG,MAAM,GACrE,QAEA;AAAA,IAAC,mBAAmB;AAAA,IAAnB;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA,gBAAgB,eAAe,mBAAmB;AAAA,QAClD;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,UAAU,cAAc,mBAAmB,KAAK;","names":[]}
|
package/dist/esm/errors.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
const ERRORS = {
|
|
2
|
-
SERVER_SIDE_INITIALIZATION: "TernSecure must be initialized on the client side",
|
|
3
|
-
NOT_INITIALIZED: "TernSecure services are not initialized. Call initializeTernSecure() first",
|
|
4
|
-
HOOK_CONTEXT: (hookName) => `${hookName} must be used within TernSecureProvider`
|
|
5
|
-
};
|
|
6
|
-
class TernSecureError extends Error {
|
|
7
|
-
constructor(message) {
|
|
8
|
-
super(message);
|
|
9
|
-
this.name = "TernSecureError";
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
export {
|
|
13
|
-
ERRORS,
|
|
14
|
-
TernSecureError
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=errors.js.map
|
package/dist/esm/errors.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/errors.ts"],"sourcesContent":["export const ERRORS = {\r\n SERVER_SIDE_INITIALIZATION: 'TernSecure must be initialized on the client side',\r\n NOT_INITIALIZED: 'TernSecure services are not initialized. Call initializeTernSecure() first',\r\n HOOK_CONTEXT: (hookName: string) => `${hookName} must be used within TernSecureProvider`,\r\n } as const;\r\n \r\n export class TernSecureError extends Error {\r\n constructor(message: string) {\r\n super(message);\r\n this.name = 'TernSecureError';\r\n }\r\n }"],"mappings":"AAAO,MAAM,SAAS;AAAA,EAClB,4BAA4B;AAAA,EAC5B,iBAAiB;AAAA,EACjB,cAAc,CAAC,aAAqB,GAAG,QAAQ;AACjD;AAEO,MAAM,wBAAwB,MAAM;AAAA,EACzC,YAAY,SAAiB;AAC3B,UAAM,OAAO;AACb,SAAK,OAAO;AAAA,EACd;AACF;","names":[]}
|
package/dist/esm/index.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { TernSecureAuth, TernSecureFirestore, ternSecureAuth } from "./utils/client-init";
|
|
2
|
-
import { loadFireConfig, validateConfig } from "./utils/config";
|
|
3
|
-
import { signInWithEmail } from "./app-router/client/actions";
|
|
4
|
-
import { TernSecureProvider } from "./app-router/client/TernSecureProvider";
|
|
5
|
-
import { useAuth } from "./boundary/hooks/useAuth";
|
|
6
|
-
import { useUser } from "./boundary/hooks/useUser";
|
|
7
|
-
import { SignIn } from "./components/sign-in";
|
|
8
|
-
import { SignOut } from "./components/sign-out";
|
|
9
|
-
export {
|
|
10
|
-
SignIn,
|
|
11
|
-
SignOut,
|
|
12
|
-
TernSecureAuth,
|
|
13
|
-
TernSecureFirestore,
|
|
14
|
-
TernSecureProvider,
|
|
15
|
-
loadFireConfig,
|
|
16
|
-
signInWithEmail,
|
|
17
|
-
ternSecureAuth,
|
|
18
|
-
useAuth,
|
|
19
|
-
useUser,
|
|
20
|
-
validateConfig
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["\r\n//import { TernSecureServerProvider } from './app-router/server/TernSecureServerProvider'\r\n//import type { TernSecureState } from './app-router/client/TernSecureProvider'\r\nexport { TernSecureAuth, TernSecureFirestore, ternSecureAuth } from './utils/client-init'\r\nexport { loadFireConfig, validateConfig } from './utils/config'\r\nexport { signInWithEmail } from './app-router/client/actions'\r\n//export { useInternalContext } from './boundary/TernSecureCtx'\r\n//export { TernSecureClientProvider } from './app-router/client/TernSecureProvider'\r\nexport { TernSecureProvider } from './app-router/client/TernSecureProvider'\r\nexport { useAuth } from './boundary/hooks/useAuth' \r\nexport { useUser } from './boundary/hooks/useUser'\r\nexport { SignIn } from './components/sign-in'\r\nexport { SignOut } from './components/sign-out'\r\n\r\n//export const TernSecureProvider = TernSecureServerProvider\r\n//export type { TernSecureState }"],"mappings":"AAGA,SAAS,gBAAgB,qBAAqB,sBAAsB;AACpE,SAAS,gBAAgB,sBAAsB;AAC/C,SAAS,uBAAuB;AAGhC,SAAS,0BAA0B;AACnC,SAAS,eAAe;AACxB,SAAS,eAAe;AACxB,SAAS,cAAc;AACvB,SAAS,eAAe;","names":[]}
|
package/dist/esm/lib/utils.d.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=utils.d.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/esm/lib/utils.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/utils.ts"],"sourcesContent":["import { clsx, type ClassValue } from \"clsx\"\r\nimport { twMerge } from \"tailwind-merge\"\r\n\r\nexport function cn(...inputs: ClassValue[]) {\r\n return twMerge(clsx(inputs))\r\n}\r\n"],"mappings":"AAAA,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;","names":[]}
|
package/dist/esm/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=types.js.map
|
package/dist/esm/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import admin from "firebase-admin";
|
|
2
|
-
import { initializeAdminConfig } from "./config";
|
|
3
|
-
if (!admin.apps.length) {
|
|
4
|
-
try {
|
|
5
|
-
const config = initializeAdminConfig();
|
|
6
|
-
admin.initializeApp({
|
|
7
|
-
credential: admin.credential.cert({
|
|
8
|
-
...config,
|
|
9
|
-
privateKey: config.privateKey.replace(/\\n/g, "\n")
|
|
10
|
-
})
|
|
11
|
-
});
|
|
12
|
-
} catch (error) {
|
|
13
|
-
console.error("Firebase admin initialization error", error);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
const adminTernSecureAuth = admin.auth();
|
|
17
|
-
const adminTernSecureDb = admin.firestore();
|
|
18
|
-
export {
|
|
19
|
-
adminTernSecureAuth,
|
|
20
|
-
adminTernSecureDb
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=admin-init.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/admin-init.ts"],"sourcesContent":["import admin from 'firebase-admin';\r\nimport { initializeAdminConfig } from './config';\r\n\r\nif (!admin.apps.length) {\r\n try {\r\n const config = initializeAdminConfig();\r\n admin.initializeApp({\r\n credential: admin.credential.cert({\r\n ...config,\r\n privateKey: config.privateKey.replace(/\\\\n/g, '\\n'),\r\n }),\r\n });\r\n } catch (error) {\r\n console.error('Firebase admin initialization error', error);\r\n }\r\n}\r\n\r\nexport const adminTernSecureAuth = admin.auth();\r\nexport const adminTernSecureDb = admin.firestore();"],"mappings":"AAAA,OAAO,WAAW;AAClB,SAAS,6BAA6B;AAEtC,IAAI,CAAC,MAAM,KAAK,QAAQ;AACtB,MAAI;AACF,UAAM,SAAS,sBAAsB;AACrC,UAAM,cAAc;AAAA,MAClB,YAAY,MAAM,WAAW,KAAK;AAAA,QAChC,GAAG;AAAA,QACH,YAAY,OAAO,WAAW,QAAQ,QAAQ,IAAI;AAAA,MACpD,CAAC;AAAA,IACH,CAAC;AAAA,EACH,SAAS,OAAO;AACd,YAAQ,MAAM,uCAAuC,KAAK;AAAA,EAC5D;AACF;AAEO,MAAM,sBAAsB,MAAM,KAAK;AACvC,MAAM,oBAAoB,MAAM,UAAU;","names":[]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { initializeApp, getApps } from "firebase/app";
|
|
2
|
-
import { getAuth, setPersistence, browserSessionPersistence } from "firebase/auth";
|
|
3
|
-
import { getFirestore } from "firebase/firestore";
|
|
4
|
-
import { getStorage } from "firebase/storage";
|
|
5
|
-
import { initializeConfig } from "./config";
|
|
6
|
-
const APP_NAME = process.env.NEXT_PUBLIC_APP_NAME;
|
|
7
|
-
const config = initializeConfig();
|
|
8
|
-
const clientApp = getApps().length === 0 ? initializeApp(config, APP_NAME) : getApps()[0];
|
|
9
|
-
const ternSecureAuth = getAuth(clientApp);
|
|
10
|
-
setPersistence(ternSecureAuth, browserSessionPersistence);
|
|
11
|
-
const firestore = getFirestore(clientApp);
|
|
12
|
-
const storage = getStorage(clientApp);
|
|
13
|
-
const TernSecureAuth = () => ternSecureAuth;
|
|
14
|
-
const TernSecureFirestore = () => firestore;
|
|
15
|
-
const TernSecureStorage = () => storage;
|
|
16
|
-
export {
|
|
17
|
-
TernSecureAuth,
|
|
18
|
-
TernSecureFirestore,
|
|
19
|
-
TernSecureStorage,
|
|
20
|
-
ternSecureAuth
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=client-init.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/client-init.ts"],"sourcesContent":["import { initializeApp, getApps } from 'firebase/app';\r\nimport { getAuth, setPersistence, browserSessionPersistence } from 'firebase/auth';\r\nimport { getFirestore } from 'firebase/firestore';\r\nimport { getStorage } from 'firebase/storage';\r\nimport { initializeConfig} from './config';\r\n\r\nconst APP_NAME = process.env.NEXT_PUBLIC_APP_NAME;\r\n\r\n// Initialize immediately\r\nconst config = initializeConfig();\r\nconst clientApp = getApps().length === 0 ? initializeApp(config, APP_NAME) : getApps()[0];\r\nexport const ternSecureAuth = getAuth(clientApp);\r\nsetPersistence(ternSecureAuth, browserSessionPersistence); //to change later user should be able to choose persistance\r\nconst firestore = getFirestore(clientApp);\r\nconst storage = getStorage(clientApp);\r\n\r\n\r\n\r\nexport const TernSecureAuth = () => ternSecureAuth;\r\nexport const TernSecureFirestore = () => firestore;\r\nexport const TernSecureStorage = () => storage;\r\n"],"mappings":"AAAA,SAAS,eAAe,eAAe;AACvC,SAAS,SAAS,gBAAgB,iCAAiC;AACnE,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAC3B,SAAS,wBAAuB;AAEhC,MAAM,WAAW,QAAQ,IAAI;AAG7B,MAAM,SAAS,iBAAiB;AAChC,MAAM,YAAY,QAAQ,EAAE,WAAW,IAAI,cAAc,QAAQ,QAAQ,IAAI,QAAQ,EAAE,CAAC;AACjF,MAAM,iBAAiB,QAAQ,SAAS;AAC/C,eAAe,gBAAgB,yBAAyB;AACxD,MAAM,YAAY,aAAa,SAAS;AACxC,MAAM,UAAU,WAAW,SAAS;AAI7B,MAAM,iBAAiB,MAAM;AAC7B,MAAM,sBAAsB,MAAM;AAClC,MAAM,oBAAoB,MAAM;","names":[]}
|
package/dist/esm/utils/config.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
const loadFireConfig = () => ({
|
|
2
|
-
apiKey: process.env.NEXT_PUBLIC_FIREBASE_API_KEY || "",
|
|
3
|
-
authDomain: process.env.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN || "",
|
|
4
|
-
projectId: process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID || "",
|
|
5
|
-
storageBucket: process.env.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET || "",
|
|
6
|
-
messagingSenderId: process.env.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID || "",
|
|
7
|
-
appId: process.env.NEXT_PUBLIC_FIREBASE_APP_ID || "",
|
|
8
|
-
measurementId: process.env.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID || void 0
|
|
9
|
-
});
|
|
10
|
-
const validateConfig = (config) => {
|
|
11
|
-
const requiredFields = [
|
|
12
|
-
"apiKey",
|
|
13
|
-
"authDomain",
|
|
14
|
-
"projectId",
|
|
15
|
-
"storageBucket",
|
|
16
|
-
"messagingSenderId",
|
|
17
|
-
"appId"
|
|
18
|
-
];
|
|
19
|
-
const errors = [];
|
|
20
|
-
requiredFields.forEach((field) => {
|
|
21
|
-
if (!config[field]) {
|
|
22
|
-
errors.push(`Missing required field: NEXT_PUBLIC_FIREBASE_${String(field).toUpperCase()}`);
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
return {
|
|
26
|
-
isValid: errors.length === 0,
|
|
27
|
-
errors,
|
|
28
|
-
config
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
const initializeConfig = () => {
|
|
32
|
-
const config = loadFireConfig();
|
|
33
|
-
const validationResult = validateConfig(config);
|
|
34
|
-
if (!validationResult.isValid) {
|
|
35
|
-
throw new Error(
|
|
36
|
-
`Firebase configuration validation failed:
|
|
37
|
-
${validationResult.errors.join("\n")}`
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
return config;
|
|
41
|
-
};
|
|
42
|
-
const loadAdminConfig = () => ({
|
|
43
|
-
projectId: process.env.FIREBASE_PROJECT_ID || "",
|
|
44
|
-
clientEmail: process.env.FIREBASE_CLIENT_EMAIL || "",
|
|
45
|
-
privateKey: process.env.FIREBASE_PRIVATE_KEY || ""
|
|
46
|
-
});
|
|
47
|
-
const validateAdminConfig = (config) => {
|
|
48
|
-
const requiredFields = [
|
|
49
|
-
"projectId",
|
|
50
|
-
"clientEmail",
|
|
51
|
-
"privateKey"
|
|
52
|
-
];
|
|
53
|
-
const errors = [];
|
|
54
|
-
requiredFields.forEach((field) => {
|
|
55
|
-
if (!config[field]) {
|
|
56
|
-
errors.push(`Missing required field: FIREBASE_${String(field).toUpperCase()}`);
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
return {
|
|
60
|
-
isValid: errors.length === 0,
|
|
61
|
-
errors,
|
|
62
|
-
config
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
const initializeAdminConfig = () => {
|
|
66
|
-
const config = loadAdminConfig();
|
|
67
|
-
const validationResult = validateAdminConfig(config);
|
|
68
|
-
if (!validationResult.isValid) {
|
|
69
|
-
throw new Error(
|
|
70
|
-
`Firebase Admin configuration validation failed:
|
|
71
|
-
${validationResult.errors.join("\n")}`
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
return config;
|
|
75
|
-
};
|
|
76
|
-
export {
|
|
77
|
-
initializeAdminConfig,
|
|
78
|
-
initializeConfig,
|
|
79
|
-
loadAdminConfig,
|
|
80
|
-
loadFireConfig,
|
|
81
|
-
validateAdminConfig,
|
|
82
|
-
validateConfig
|
|
83
|
-
};
|
|
84
|
-
//# sourceMappingURL=config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/config.ts"],"sourcesContent":["import { TernSecureConfig, ConfigValidationResult, TernSecureAdminConfig, AdminConfigValidationResult } from '../types'\r\n\r\n/**\r\n * Loads Firebase configuration from environment variables\r\n * @returns {TernSecureConfig} Firebase configuration object\r\n */\r\nexport const loadFireConfig = (): TernSecureConfig => ({\r\n apiKey: process.env.NEXT_PUBLIC_FIREBASE_API_KEY || '',\r\n authDomain: process.env.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN || '',\r\n projectId: process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID || '',\r\n storageBucket: process.env.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET || '',\r\n messagingSenderId: process.env.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID || '',\r\n appId: process.env.NEXT_PUBLIC_FIREBASE_APP_ID || '',\r\n measurementId: process.env.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID || undefined,\r\n})\r\n\r\n/**\r\n * Validates Firebase configuration\r\n * @param {TernSecureConfig} config - Firebase configuration object\r\n * @throws {Error} If required configuration values are missing\r\n * @returns {TernSecureConfig} Validated configuration object\r\n */\r\nexport const validateConfig = (config: TernSecureConfig): ConfigValidationResult => {\r\n const requiredFields: (keyof TernSecureConfig)[] = [\r\n 'apiKey',\r\n 'authDomain',\r\n 'projectId',\r\n 'storageBucket',\r\n 'messagingSenderId',\r\n 'appId'\r\n ]\r\n\r\n const errors: string[] = []\r\n \r\n requiredFields.forEach(field => {\r\n if (!config[field]) {\r\n errors.push(`Missing required field: NEXT_PUBLIC_FIREBASE_${String(field).toUpperCase()}`)\r\n }\r\n })\r\n\r\n return {\r\n isValid: errors.length === 0,\r\n errors,\r\n config\r\n }\r\n}\r\n\r\n/**\r\n * Initializes configuration with validation\r\n * @throws {Error} If configuration is invalid\r\n */\r\nexport const initializeConfig = (): TernSecureConfig => {\r\n const config = loadFireConfig()\r\n const validationResult = validateConfig(config)\r\n\r\n if (!validationResult.isValid) {\r\n throw new Error(\r\n `Firebase configuration validation failed:\\n${validationResult.errors.join('\\n')}`\r\n )\r\n }\r\n\r\n return config\r\n}\r\n\r\n/**\r\n * Loads Firebase Admin configuration from environment variables\r\n * @returns {AdminConfig} Firebase Admin configuration object\r\n */\r\nexport const loadAdminConfig = (): TernSecureAdminConfig => ({\r\n projectId: process.env.FIREBASE_PROJECT_ID || '',\r\n clientEmail: process.env.FIREBASE_CLIENT_EMAIL || '',\r\n privateKey: process.env.FIREBASE_PRIVATE_KEY || '',\r\n})\r\n\r\n/**\r\n * Validates Firebase Admin configuration\r\n * @param {AdminConfig} config - Firebase Admin configuration object\r\n * @returns {ConfigValidationResult} Validation result\r\n */\r\nexport const validateAdminConfig = (config: TernSecureAdminConfig): AdminConfigValidationResult => {\r\n const requiredFields: (keyof TernSecureAdminConfig)[] = [\r\n 'projectId',\r\n 'clientEmail',\r\n 'privateKey'\r\n ]\r\n\r\n const errors: string[] = []\r\n \r\n requiredFields.forEach(field => {\r\n if (!config[field]) {\r\n errors.push(`Missing required field: FIREBASE_${String(field).toUpperCase()}`)\r\n }\r\n })\r\n\r\n return {\r\n isValid: errors.length === 0,\r\n errors,\r\n config\r\n }\r\n}\r\n\r\n/**\r\n * Initializes admin configuration with validation\r\n * @throws {Error} If configuration is invalid\r\n */\r\nexport const initializeAdminConfig = (): TernSecureAdminConfig => {\r\n const config = loadAdminConfig()\r\n const validationResult = validateAdminConfig(config)\r\n\r\n if (!validationResult.isValid) {\r\n throw new Error(\r\n `Firebase Admin configuration validation failed:\\n${validationResult.errors.join('\\n')}`\r\n )\r\n }\r\n\r\n return config\r\n}"],"mappings":"AAMO,MAAM,iBAAiB,OAAyB;AAAA,EACrD,QAAQ,QAAQ,IAAI,gCAAgC;AAAA,EACpD,YAAY,QAAQ,IAAI,oCAAoC;AAAA,EAC5D,WAAW,QAAQ,IAAI,mCAAmC;AAAA,EAC1D,eAAe,QAAQ,IAAI,uCAAuC;AAAA,EAClE,mBAAmB,QAAQ,IAAI,4CAA4C;AAAA,EAC3E,OAAO,QAAQ,IAAI,+BAA+B;AAAA,EAClD,eAAe,QAAQ,IAAI,uCAAuC;AACpE;AAQO,MAAM,iBAAiB,CAAC,WAAqD;AAClF,QAAM,iBAA6C;AAAA,IACjD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,SAAmB,CAAC;AAE1B,iBAAe,QAAQ,WAAS;AAC9B,QAAI,CAAC,OAAO,KAAK,GAAG;AAClB,aAAO,KAAK,gDAAgD,OAAO,KAAK,EAAE,YAAY,CAAC,EAAE;AAAA,IAC3F;AAAA,EACF,CAAC;AAED,SAAO;AAAA,IACL,SAAS,OAAO,WAAW;AAAA,IAC3B;AAAA,IACA;AAAA,EACF;AACF;AAMO,MAAM,mBAAmB,MAAwB;AACtD,QAAM,SAAS,eAAe;AAC9B,QAAM,mBAAmB,eAAe,MAAM;AAE9C,MAAI,CAAC,iBAAiB,SAAS;AAC7B,UAAM,IAAI;AAAA,MACR;AAAA,EAA8C,iBAAiB,OAAO,KAAK,IAAI,CAAC;AAAA,IAClF;AAAA,EACF;AAEA,SAAO;AACT;AAMO,MAAM,kBAAkB,OAA8B;AAAA,EAC3D,WAAW,QAAQ,IAAI,uBAAuB;AAAA,EAC9C,aAAa,QAAQ,IAAI,yBAAyB;AAAA,EAClD,YAAY,QAAQ,IAAI,wBAAwB;AAClD;AAOO,MAAM,sBAAsB,CAAC,WAA+D;AACjG,QAAM,iBAAkD;AAAA,IACtD;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,SAAmB,CAAC;AAE1B,iBAAe,QAAQ,WAAS;AAC9B,QAAI,CAAC,OAAO,KAAK,GAAG;AAClB,aAAO,KAAK,oCAAoC,OAAO,KAAK,EAAE,YAAY,CAAC,EAAE;AAAA,IAC/E;AAAA,EACF,CAAC;AAED,SAAO;AAAA,IACL,SAAS,OAAO,WAAW;AAAA,IAC3B;AAAA,IACA;AAAA,EACF;AACF;AAMO,MAAM,wBAAwB,MAA6B;AAChE,QAAM,SAAS,gBAAgB;AAC/B,QAAM,mBAAmB,oBAAoB,MAAM;AAEnD,MAAI,CAAC,iBAAiB,SAAS;AAC7B,UAAM,IAAI;AAAA,MACR;AAAA,EAAoD,iBAAiB,OAAO,KAAK,IAAI,CAAC;AAAA,IACxF;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
const constructFullUrl = (path) => {
|
|
2
|
-
const baseUrl = window.location.origin;
|
|
3
|
-
if (path.startsWith("http")) {
|
|
4
|
-
return path;
|
|
5
|
-
}
|
|
6
|
-
return `${baseUrl}${path.startsWith("/") ? path : `/${path}`}`;
|
|
7
|
-
};
|
|
8
|
-
const constructUrlWithRedirect = (path, redirectUrl, loginPath) => {
|
|
9
|
-
const url = new URL(path, window.location.origin);
|
|
10
|
-
if (redirectUrl && !redirectUrl.startsWith(loginPath)) {
|
|
11
|
-
const fullRedirectUrl = redirectUrl.startsWith("http") ? redirectUrl : constructFullUrl(redirectUrl);
|
|
12
|
-
url.searchParams.set("redirect_url", fullRedirectUrl);
|
|
13
|
-
}
|
|
14
|
-
return url.toString();
|
|
15
|
-
};
|
|
16
|
-
const getValidRedirectUrl = (redirectUrl, searchParams) => {
|
|
17
|
-
const redirect = redirectUrl || searchParams.get("redirect_url") || "/";
|
|
18
|
-
try {
|
|
19
|
-
if (redirect.startsWith("http")) {
|
|
20
|
-
const url = new URL(redirect);
|
|
21
|
-
if (url.origin === window.location.origin) {
|
|
22
|
-
return redirect;
|
|
23
|
-
}
|
|
24
|
-
return "/";
|
|
25
|
-
}
|
|
26
|
-
return constructFullUrl(redirect);
|
|
27
|
-
} catch (e) {
|
|
28
|
-
console.error("Invalid redirect URL:", e);
|
|
29
|
-
return constructFullUrl("/");
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
export {
|
|
33
|
-
constructFullUrl,
|
|
34
|
-
constructUrlWithRedirect,
|
|
35
|
-
getValidRedirectUrl
|
|
36
|
-
};
|
|
37
|
-
//# sourceMappingURL=construct.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/construct.ts"],"sourcesContent":["/**\r\n * Constructs a full URL with the current origin\r\n * @param path - The path to construct the URL for\r\n * @returns The full URL with origin\r\n */\r\nexport const constructFullUrl = (path: string) => {\r\n const baseUrl = window.location.origin\r\n if (path.startsWith('http')) {\r\n return path\r\n }\r\n return `${baseUrl}${path.startsWith('/') ? path : `/${path}`}`\r\n }\r\n \r\n /**\r\n * Constructs a URL with redirect parameters\r\n * @param path - The base path (usually login path)\r\n * @param redirectUrl - The URL to redirect to after action completes\r\n * @param loginPath - The login path to check against\r\n * @returns The full URL with redirect parameters\r\n */\r\n export const constructUrlWithRedirect = (path: string, redirectUrl: string, loginPath: string) => {\r\n // Create the URL with the full origin\r\n const url = new URL(path, window.location.origin)\r\n \r\n // Add redirect parameter if provided and not redirecting to login\r\n if (redirectUrl && !redirectUrl.startsWith(loginPath)) {\r\n // Ensure redirect URL is also absolute if it's not already\r\n const fullRedirectUrl = redirectUrl.startsWith('http') \r\n ? redirectUrl \r\n : constructFullUrl(redirectUrl)\r\n \r\n url.searchParams.set('redirect_url', fullRedirectUrl)\r\n }\r\n \r\n return url.toString()\r\n }\r\n \r\n /**\r\n * Gets a validated redirect URL ensuring it's from the same origin\r\n * @param redirectUrl - The URL to validate\r\n * @param searchParams - The search parameters to check for redirect_url\r\n * @returns A validated redirect URL\r\n */\r\n export const getValidRedirectUrl = (\r\n redirectUrl: string | undefined,\r\n searchParams: URLSearchParams\r\n ): string => {\r\n const redirect = redirectUrl || searchParams.get('redirect_url') || '/'\r\n \r\n try {\r\n if (redirect.startsWith('http')) {\r\n const url = new URL(redirect)\r\n if (url.origin === window.location.origin) {\r\n return redirect\r\n }\r\n return '/'\r\n }\r\n return constructFullUrl(redirect)\r\n } catch (e) {\r\n console.error('Invalid redirect URL:', e)\r\n return constructFullUrl('/')\r\n }\r\n }\r\n \r\n "],"mappings":"AAKO,MAAM,mBAAmB,CAAC,SAAiB;AAC9C,QAAM,UAAU,OAAO,SAAS;AAChC,MAAI,KAAK,WAAW,MAAM,GAAG;AAC3B,WAAO;AAAA,EACT;AACA,SAAO,GAAG,OAAO,GAAG,KAAK,WAAW,GAAG,IAAI,OAAO,IAAI,IAAI,EAAE;AAC9D;AASO,MAAM,2BAA2B,CAAC,MAAc,aAAqB,cAAsB;AAEhG,QAAM,MAAM,IAAI,IAAI,MAAM,OAAO,SAAS,MAAM;AAGhD,MAAI,eAAe,CAAC,YAAY,WAAW,SAAS,GAAG;AAErD,UAAM,kBAAkB,YAAY,WAAW,MAAM,IACjD,cACA,iBAAiB,WAAW;AAEhC,QAAI,aAAa,IAAI,gBAAgB,eAAe;AAAA,EACtD;AAEA,SAAO,IAAI,SAAS;AACtB;AAQO,MAAM,sBAAsB,CACjC,aACA,iBACW;AACX,QAAM,WAAW,eAAe,aAAa,IAAI,cAAc,KAAK;AAEpE,MAAI;AACF,QAAI,SAAS,WAAW,MAAM,GAAG;AAC/B,YAAM,MAAM,IAAI,IAAI,QAAQ;AAC5B,UAAI,IAAI,WAAW,OAAO,SAAS,QAAQ;AACzC,eAAO;AAAA,MACT;AACA,aAAO;AAAA,IACT;AACA,WAAO,iBAAiB,QAAQ;AAAA,EAClC,SAAS,GAAG;AACV,YAAQ,MAAM,yBAAyB,CAAC;AACxC,WAAO,iBAAiB,GAAG;AAAA,EAC7B;AACF;","names":[]}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
const PREFIX = "tern";
|
|
3
|
-
const styleInjection = {
|
|
4
|
-
isInjected: false,
|
|
5
|
-
styleElement: null
|
|
6
|
-
};
|
|
7
|
-
const defaultClassNames = {
|
|
8
|
-
container: `${PREFIX}-container`,
|
|
9
|
-
header: `${PREFIX}-header`,
|
|
10
|
-
title: `${PREFIX}-title`,
|
|
11
|
-
formWrapper: `${PREFIX}-formWrapper`,
|
|
12
|
-
formContainer: `${PREFIX}-formContainer`,
|
|
13
|
-
form: `${PREFIX}-form`,
|
|
14
|
-
label: `${PREFIX}-label`,
|
|
15
|
-
input: `${PREFIX}-input`,
|
|
16
|
-
button: `${PREFIX}-button`,
|
|
17
|
-
error: `${PREFIX}-error`
|
|
18
|
-
};
|
|
19
|
-
function createStyleSheet(styles2) {
|
|
20
|
-
if (typeof window === "undefined") return defaultClassNames;
|
|
21
|
-
if (styleInjection.isInjected) {
|
|
22
|
-
return defaultClassNames;
|
|
23
|
-
}
|
|
24
|
-
let styleElement = document.querySelector("[data-tern-secure]");
|
|
25
|
-
if (!styleElement) {
|
|
26
|
-
styleElement = document.createElement("style");
|
|
27
|
-
styleElement.setAttribute("data-tern-secure", "");
|
|
28
|
-
document.head.appendChild(styleElement);
|
|
29
|
-
styleInjection.styleElement = styleElement;
|
|
30
|
-
}
|
|
31
|
-
const cssRules = Object.entries(styles2).map(([key, rules]) => {
|
|
32
|
-
const className = defaultClassNames[key];
|
|
33
|
-
const cssProperties = Object.entries(rules).map(([prop, value]) => {
|
|
34
|
-
const cssProperty = prop.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
35
|
-
return `${cssProperty}: ${value};`;
|
|
36
|
-
}).join(" ");
|
|
37
|
-
return `.${className} { ${cssProperties} }`;
|
|
38
|
-
}).join("\n");
|
|
39
|
-
styleElement.textContent = cssRules;
|
|
40
|
-
styleInjection.isInjected = true;
|
|
41
|
-
return defaultClassNames;
|
|
42
|
-
}
|
|
43
|
-
const styleConfig = {
|
|
44
|
-
container: {
|
|
45
|
-
display: "flex",
|
|
46
|
-
minHeight: "100%",
|
|
47
|
-
flex: "1",
|
|
48
|
-
flexDirection: "column",
|
|
49
|
-
justifyContent: "center",
|
|
50
|
-
padding: "3rem 1.5rem"
|
|
51
|
-
},
|
|
52
|
-
header: {
|
|
53
|
-
margin: "0 auto",
|
|
54
|
-
width: "100%",
|
|
55
|
-
maxWidth: "28rem"
|
|
56
|
-
},
|
|
57
|
-
title: {
|
|
58
|
-
marginTop: "1.5rem",
|
|
59
|
-
textAlign: "center",
|
|
60
|
-
fontSize: "1.875rem",
|
|
61
|
-
fontWeight: "700",
|
|
62
|
-
lineHeight: "2.25rem",
|
|
63
|
-
letterSpacing: "-0.025em",
|
|
64
|
-
color: "var(--tern-text-primary, #111827)"
|
|
65
|
-
},
|
|
66
|
-
formWrapper: {
|
|
67
|
-
marginTop: "2.5rem",
|
|
68
|
-
margin: "0 auto",
|
|
69
|
-
width: "100%",
|
|
70
|
-
maxWidth: "30rem"
|
|
71
|
-
},
|
|
72
|
-
formContainer: {
|
|
73
|
-
padding: "3rem 1.5rem",
|
|
74
|
-
boxShadow: "0 1px 3px 0 rgb(0 0 0 / 0.1)",
|
|
75
|
-
borderRadius: "0.5rem",
|
|
76
|
-
backgroundColor: "var(--tern-background, white)"
|
|
77
|
-
},
|
|
78
|
-
form: {
|
|
79
|
-
display: "flex",
|
|
80
|
-
flexDirection: "column",
|
|
81
|
-
gap: "1rem"
|
|
82
|
-
},
|
|
83
|
-
label: {
|
|
84
|
-
display: "block",
|
|
85
|
-
fontSize: "0.875rem",
|
|
86
|
-
fontWeight: "500",
|
|
87
|
-
color: "var(--tern-text-secondary, #374151)"
|
|
88
|
-
},
|
|
89
|
-
input: {
|
|
90
|
-
marginTop: "0.25rem",
|
|
91
|
-
display: "block",
|
|
92
|
-
width: "100%",
|
|
93
|
-
padding: "0.5rem 0.75rem",
|
|
94
|
-
borderRadius: "0.375rem",
|
|
95
|
-
border: "1px solid var(--tern-border, #D1D5DB)",
|
|
96
|
-
backgroundColor: "var(--tern-input-background, white)",
|
|
97
|
-
color: "var(--tern-text-primary, #111827)"
|
|
98
|
-
},
|
|
99
|
-
button: {
|
|
100
|
-
display: "flex",
|
|
101
|
-
width: "100%",
|
|
102
|
-
justifyContent: "center",
|
|
103
|
-
padding: "0.5rem 1rem",
|
|
104
|
-
fontSize: "0.875rem",
|
|
105
|
-
fontWeight: "500",
|
|
106
|
-
color: "white",
|
|
107
|
-
backgroundColor: "var(--tern-primary, #2563EB)",
|
|
108
|
-
border: "none",
|
|
109
|
-
borderRadius: "0.375rem",
|
|
110
|
-
cursor: "pointer"
|
|
111
|
-
},
|
|
112
|
-
error: {
|
|
113
|
-
color: "var(--tern-error, #DC2626)",
|
|
114
|
-
fontSize: "0.875rem"
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
const styles = createStyleSheet(styleConfig);
|
|
118
|
-
export {
|
|
119
|
-
defaultClassNames,
|
|
120
|
-
styleConfig,
|
|
121
|
-
styles
|
|
122
|
-
};
|
|
123
|
-
//# sourceMappingURL=create-styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/create-styles.ts"],"sourcesContent":["'use client'\r\n\r\nconst PREFIX = 'tern'\r\n\r\n// Singleton to track style injection\r\nconst styleInjection = {\r\n isInjected: false,\r\n styleElement: null as HTMLStyleElement | null\r\n}\r\n\r\nexport const defaultClassNames = {\r\n container: `${PREFIX}-container`,\r\n header: `${PREFIX}-header`,\r\n title: `${PREFIX}-title`,\r\n formWrapper: `${PREFIX}-formWrapper`,\r\n formContainer: `${PREFIX}-formContainer`,\r\n form: `${PREFIX}-form`,\r\n label: `${PREFIX}-label`,\r\n input: `${PREFIX}-input`,\r\n button: `${PREFIX}-button`,\r\n error: `${PREFIX}-error`\r\n} as const\r\n\r\n// Create styles once and cache them\r\nfunction createStyleSheet(styles: Record<string, React.CSSProperties>) {\r\n if (typeof window === 'undefined') return defaultClassNames\r\n\r\n // Return early if styles are already injected\r\n if (styleInjection.isInjected) {\r\n return defaultClassNames\r\n }\r\n\r\n // Find existing style element or create new one\r\n let styleElement = document.querySelector<HTMLStyleElement>('[data-tern-secure]')\r\n \r\n if (!styleElement) {\r\n styleElement = document.createElement('style')\r\n styleElement.setAttribute('data-tern-secure', '')\r\n document.head.appendChild(styleElement)\r\n styleInjection.styleElement = styleElement\r\n }\r\n\r\n // Create CSS rules\r\n const cssRules = Object.entries(styles).map(([key, rules]) => {\r\n const className = defaultClassNames[key as keyof typeof defaultClassNames]\r\n const cssProperties = Object.entries(rules).map(([prop, value]) => {\r\n const cssProperty = prop.replace(/([A-Z])/g, '-$1').toLowerCase()\r\n return `${cssProperty}: ${value};`\r\n }).join(' ')\r\n\r\n return `.${className} { ${cssProperties} }`\r\n }).join('\\n')\r\n\r\n // Insert styles only once\r\n styleElement.textContent = cssRules\r\n styleInjection.isInjected = true\r\n\r\n return defaultClassNames\r\n}\r\n\r\n// Style configuration\r\nexport const styleConfig = {\r\n container: {\r\n display: 'flex',\r\n minHeight: '100%',\r\n flex: '1',\r\n flexDirection: 'column',\r\n justifyContent: 'center',\r\n padding: '3rem 1.5rem'\r\n },\r\n header: {\r\n margin: '0 auto',\r\n width: '100%',\r\n maxWidth: '28rem'\r\n },\r\n title: {\r\n marginTop: '1.5rem',\r\n textAlign: 'center',\r\n fontSize: '1.875rem',\r\n fontWeight: '700',\r\n lineHeight: '2.25rem',\r\n letterSpacing: '-0.025em',\r\n color: 'var(--tern-text-primary, #111827)'\r\n },\r\n formWrapper: {\r\n marginTop: '2.5rem',\r\n margin: '0 auto',\r\n width: '100%',\r\n maxWidth: '30rem'\r\n },\r\n formContainer: {\r\n padding: '3rem 1.5rem',\r\n boxShadow: '0 1px 3px 0 rgb(0 0 0 / 0.1)',\r\n borderRadius: '0.5rem',\r\n backgroundColor: 'var(--tern-background, white)'\r\n },\r\n form: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n gap: '1rem'\r\n },\r\n label: {\r\n display: 'block',\r\n fontSize: '0.875rem',\r\n fontWeight: '500',\r\n color: 'var(--tern-text-secondary, #374151)'\r\n },\r\n input: {\r\n marginTop: '0.25rem',\r\n display: 'block',\r\n width: '100%',\r\n padding: '0.5rem 0.75rem',\r\n borderRadius: '0.375rem',\r\n border: '1px solid var(--tern-border, #D1D5DB)',\r\n backgroundColor: 'var(--tern-input-background, white)',\r\n color: 'var(--tern-text-primary, #111827)'\r\n },\r\n button: {\r\n display: 'flex',\r\n width: '100%',\r\n justifyContent: 'center',\r\n padding: '0.5rem 1rem',\r\n fontSize: '0.875rem',\r\n fontWeight: '500',\r\n color: 'white',\r\n backgroundColor: 'var(--tern-primary, #2563EB)',\r\n border: 'none',\r\n borderRadius: '0.375rem',\r\n cursor: 'pointer'\r\n },\r\n error: {\r\n color: 'var(--tern-error, #DC2626)',\r\n fontSize: '0.875rem'\r\n }\r\n} as const\r\n\r\n// Export pre-created styles\r\nexport const styles = createStyleSheet(styleConfig)\r\n\r\n"],"mappings":";AAEA,MAAM,SAAS;AAGf,MAAM,iBAAiB;AAAA,EACrB,YAAY;AAAA,EACZ,cAAc;AAChB;AAEO,MAAM,oBAAoB;AAAA,EAC/B,WAAW,GAAG,MAAM;AAAA,EACpB,QAAQ,GAAG,MAAM;AAAA,EACjB,OAAO,GAAG,MAAM;AAAA,EAChB,aAAa,GAAG,MAAM;AAAA,EACtB,eAAe,GAAG,MAAM;AAAA,EACxB,MAAM,GAAG,MAAM;AAAA,EACf,OAAO,GAAG,MAAM;AAAA,EAChB,OAAO,GAAG,MAAM;AAAA,EAChB,QAAQ,GAAG,MAAM;AAAA,EACjB,OAAO,GAAG,MAAM;AAClB;AAGA,SAAS,iBAAiBA,SAA6C;AACrE,MAAI,OAAO,WAAW,YAAa,QAAO;AAG1C,MAAI,eAAe,YAAY;AAC7B,WAAO;AAAA,EACT;AAGA,MAAI,eAAe,SAAS,cAAgC,oBAAoB;AAEhF,MAAI,CAAC,cAAc;AACjB,mBAAe,SAAS,cAAc,OAAO;AAC7C,iBAAa,aAAa,oBAAoB,EAAE;AAChD,aAAS,KAAK,YAAY,YAAY;AACtC,mBAAe,eAAe;AAAA,EAChC;AAGA,QAAM,WAAW,OAAO,QAAQA,OAAM,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM;AAC5D,UAAM,YAAY,kBAAkB,GAAqC;AACzE,UAAM,gBAAgB,OAAO,QAAQ,KAAK,EAAE,IAAI,CAAC,CAAC,MAAM,KAAK,MAAM;AACjE,YAAM,cAAc,KAAK,QAAQ,YAAY,KAAK,EAAE,YAAY;AAChE,aAAO,GAAG,WAAW,KAAK,KAAK;AAAA,IACjC,CAAC,EAAE,KAAK,GAAG;AAEX,WAAO,IAAI,SAAS,MAAM,aAAa;AAAA,EACzC,CAAC,EAAE,KAAK,IAAI;AAGZ,eAAa,cAAc;AAC3B,iBAAe,aAAa;AAE5B,SAAO;AACT;AAGO,MAAM,cAAc;AAAA,EACzB,WAAW;AAAA,IACT,SAAS;AAAA,IACT,WAAW;AAAA,IACX,MAAM;AAAA,IACN,eAAe;AAAA,IACf,gBAAgB;AAAA,IAChB,SAAS;AAAA,EACX;AAAA,EACA,QAAQ;AAAA,IACN,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,UAAU;AAAA,EACZ;AAAA,EACA,OAAO;AAAA,IACL,WAAW;AAAA,IACX,WAAW;AAAA,IACX,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,OAAO;AAAA,EACT;AAAA,EACA,aAAa;AAAA,IACX,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,UAAU;AAAA,EACZ;AAAA,EACA,eAAe;AAAA,IACb,SAAS;AAAA,IACT,WAAW;AAAA,IACX,cAAc;AAAA,IACd,iBAAiB;AAAA,EACnB;AAAA,EACA,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,eAAe;AAAA,IACf,KAAK;AAAA,EACP;AAAA,EACA,OAAO;AAAA,IACL,SAAS;AAAA,IACT,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,OAAO;AAAA,EACT;AAAA,EACA,OAAO;AAAA,IACL,WAAW;AAAA,IACX,SAAS;AAAA,IACT,OAAO;AAAA,IACP,SAAS;AAAA,IACT,cAAc;AAAA,IACd,QAAQ;AAAA,IACR,iBAAiB;AAAA,IACjB,OAAO;AAAA,EACT;AAAA,EACA,QAAQ;AAAA,IACN,SAAS;AAAA,IACT,OAAO;AAAA,IACP,gBAAgB;AAAA,IAChB,SAAS;AAAA,IACT,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,iBAAiB;AAAA,IACjB,QAAQ;AAAA,IACR,cAAc;AAAA,IACd,QAAQ;AAAA,EACV;AAAA,EACA,OAAO;AAAA,IACL,OAAO;AAAA,IACP,UAAU;AAAA,EACZ;AACF;AAGO,MAAM,SAAS,iBAAiB,WAAW;","names":["styles"]}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
/**
|
|
3
|
-
* Root Provider for TernSecure
|
|
4
|
-
* Use this in your Next.js App Router root layout
|
|
5
|
-
* Automatically handles client/server boundary and authentication state
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* /// app/layout.tsx
|
|
9
|
-
* import { TernSecureProvider } from '@tern/secure'
|
|
10
|
-
*
|
|
11
|
-
* export default function RootLayout({ children }) {
|
|
12
|
-
* return (
|
|
13
|
-
* <html>
|
|
14
|
-
* <body>
|
|
15
|
-
* <TernSecureProvider>
|
|
16
|
-
* {children}
|
|
17
|
-
* </TernSecureProvider>
|
|
18
|
-
* </body>
|
|
19
|
-
* </html>
|
|
20
|
-
* )
|
|
21
|
-
* }
|
|
22
|
-
*/
|
|
23
|
-
export declare function TernSecureProvider({ children }: {
|
|
24
|
-
children: React.ReactNode;
|
|
25
|
-
}): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
26
|
-
//# sourceMappingURL=TernSecureProvider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TernSecureProvider.d.ts","sourceRoot":"","sources":["../../../../src/app-router/client/TernSecureProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAYzB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,oDAMnF"}
|