@nibssplc/cams-sdk-react 1.0.0-rc.60 → 1.0.0-rc.62

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.
@@ -1,10 +1,10 @@
1
1
  import * as React from "react";
2
- type ButtonVariant = 'default' | 'outline' | 'destructive' | 'secondary' | 'ghost' | 'link';
3
- type ButtonSize = 'default' | 'sm' | 'lg' | 'icon';
4
- interface ButtonProps extends React.ComponentProps<"button"> {
5
- variant?: ButtonVariant;
6
- size?: ButtonSize;
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const buttonVariants: (props?: ({
4
+ variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
5
+ size?: "default" | "sm" | "lg" | "icon" | null | undefined;
6
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
7
+ declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
7
8
  asChild?: boolean;
8
- }
9
- declare function Button({ variant, size, asChild, style, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
10
- export { Button };
9
+ }): import("react/jsx-runtime").JSX.Element;
10
+ export { Button, buttonVariants };
@@ -1,9 +1,9 @@
1
1
  import * as React from "react";
2
- declare function Card({ style, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
3
- declare function CardHeader({ style, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
4
- declare function CardTitle({ style, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
5
- declare function CardDescription({ style, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
6
- declare function CardAction({ style, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
7
- declare function CardContent({ style, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
8
- declare function CardFooter({ style, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
2
+ declare function Card({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
3
+ declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
4
+ declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
5
+ declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
6
+ declare function CardAction({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
7
+ declare function CardContent({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
8
+ declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
9
9
  export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
package/dist/index.cjs.js CHANGED
@@ -14,6 +14,7 @@ var clsx = require('clsx');
14
14
  var tailwindMerge = require('tailwind-merge');
15
15
  var reactSlot = require('@radix-ui/react-slot');
16
16
  var LabelPrimitive = require('@radix-ui/react-label');
17
+ var classVarianceAuthority = require('class-variance-authority');
17
18
  var DialogPrimitive = require('@radix-ui/react-dialog');
18
19
  var sonner = require('sonner');
19
20
  var framerMotion = require('framer-motion');
@@ -1303,77 +1304,33 @@ function FormMessage(_a) {
1303
1304
  return (jsxRuntime.jsx("p", __assign({ "data-slot": "form-message", id: formMessageId, className: cn("text-destructive text-sm", className) }, props, { children: body })));
1304
1305
  }
1305
1306
 
1306
- // CSS-in-JS styles to replace Tailwind classes for maximum compatibility
1307
- var styles = {
1308
- button: {
1309
- base: {
1310
- display: 'inline-flex',
1311
- alignItems: 'center',
1312
- justifyContent: 'center',
1313
- gap: '0.5rem',
1314
- whiteSpace: 'nowrap',
1315
- borderRadius: '0.375rem',
1316
- fontSize: '0.875rem',
1317
- fontWeight: '500',
1318
- transition: 'all 0.2s',
1319
- outline: 'none',
1320
- cursor: 'pointer',
1321
- border: 'none',
1322
- },
1323
- variants: {
1324
- default: {
1325
- backgroundColor: '#3b82f6',
1326
- color: 'white',
1327
- padding: '0.5rem 1rem',
1328
- height: '2.25rem',
1329
- },
1330
- outline: {
1331
- backgroundColor: 'transparent',
1332
- border: '1px solid #d1d5db',
1333
- color: '#374151',
1334
- padding: '0.5rem 1rem',
1335
- height: '2.25rem',
1336
- },
1337
- },
1338
- },
1339
- card: {
1340
- base: {
1341
- backgroundColor: 'white',
1342
- border: '1px solid #e5e7eb',
1343
- borderRadius: '0.75rem',
1344
- padding: '1.5rem',
1345
- boxShadow: '0 1px 3px 0 rgba(0, 0, 0, 0.1)',
1346
- },
1347
- },
1348
- };
1349
-
1350
1307
  function Card(_a) {
1351
- var style = _a.style, props = __rest(_a, ["style"]);
1352
- return (jsxRuntime.jsx("div", __assign({ "data-slot": "card", style: __assign(__assign(__assign({}, styles.card.base), { display: 'flex', flexDirection: 'column', gap: '1.5rem', paddingTop: '1.5rem', paddingBottom: '1.5rem' }), style) }, props)));
1308
+ var className = _a.className, props = __rest(_a, ["className"]);
1309
+ return (jsxRuntime.jsx("div", __assign({ "data-slot": "card", className: cn("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm", className) }, props)));
1353
1310
  }
1354
1311
  function CardHeader(_a) {
1355
- var style = _a.style, props = __rest(_a, ["style"]);
1356
- return (jsxRuntime.jsx("div", __assign({ "data-slot": "card-header", style: __assign({ display: 'grid', gap: '0.375rem', paddingLeft: '1.5rem', paddingRight: '1.5rem' }, style) }, props)));
1312
+ var className = _a.className, props = __rest(_a, ["className"]);
1313
+ return (jsxRuntime.jsx("div", __assign({ "data-slot": "card-header", className: cn("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6", className) }, props)));
1357
1314
  }
1358
1315
  function CardTitle(_a) {
1359
- var style = _a.style, props = __rest(_a, ["style"]);
1360
- return (jsxRuntime.jsx("div", __assign({ "data-slot": "card-title", style: __assign({ lineHeight: '1', fontWeight: '600' }, style) }, props)));
1316
+ var className = _a.className, props = __rest(_a, ["className"]);
1317
+ return (jsxRuntime.jsx("div", __assign({ "data-slot": "card-title", className: cn("leading-none font-semibold", className) }, props)));
1361
1318
  }
1362
1319
  function CardDescription(_a) {
1363
- var style = _a.style, props = __rest(_a, ["style"]);
1364
- return (jsxRuntime.jsx("div", __assign({ "data-slot": "card-description", style: __assign({ color: '#6b7280', fontSize: '0.875rem' }, style) }, props)));
1320
+ var className = _a.className, props = __rest(_a, ["className"]);
1321
+ return (jsxRuntime.jsx("div", __assign({ "data-slot": "card-description", className: cn("text-muted-foreground text-sm", className) }, props)));
1365
1322
  }
1366
1323
  function CardAction(_a) {
1367
- var style = _a.style, props = __rest(_a, ["style"]);
1368
- return (jsxRuntime.jsx("div", __assign({ "data-slot": "card-action", style: __assign({ alignSelf: 'flex-start', justifySelf: 'flex-end' }, style) }, props)));
1324
+ var className = _a.className, props = __rest(_a, ["className"]);
1325
+ return (jsxRuntime.jsx("div", __assign({ "data-slot": "card-action", className: cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className) }, props)));
1369
1326
  }
1370
1327
  function CardContent(_a) {
1371
- var style = _a.style, props = __rest(_a, ["style"]);
1372
- return (jsxRuntime.jsx("div", __assign({ "data-slot": "card-content", style: __assign({ paddingLeft: '1.5rem', paddingRight: '1.5rem' }, style) }, props)));
1328
+ var className = _a.className, props = __rest(_a, ["className"]);
1329
+ return (jsxRuntime.jsx("div", __assign({ "data-slot": "card-content", className: cn("px-6", className) }, props)));
1373
1330
  }
1374
1331
  function CardFooter(_a) {
1375
- var style = _a.style, props = __rest(_a, ["style"]);
1376
- return (jsxRuntime.jsx("div", __assign({ "data-slot": "card-footer", style: __assign({ display: 'flex', alignItems: 'center', paddingLeft: '1.5rem', paddingRight: '1.5rem' }, style) }, props)));
1332
+ var className = _a.className, props = __rest(_a, ["className"]);
1333
+ return (jsxRuntime.jsx("div", __assign({ "data-slot": "card-footer", className: cn("flex items-center px-6 [.border-t]:pt-6", className) }, props)));
1377
1334
  }
1378
1335
 
1379
1336
  var GenericOTPVerifier = function (_a) {
@@ -1406,11 +1363,32 @@ var OTPAuthenticationImg = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2F
1406
1363
 
1407
1364
  var MicrosoftAuthenticatorImg = "data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3Csvg%20fill%3D%22%23228BE6%22%20version%3D%221.1%22%20baseProfile%3D%22basic%22%20id%3D%22%26%23x421%3B%26%23x43B%3B%26%23x43E%3B%26%23x439%3B_1%22%20%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%2050%2050%22%20%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20marker-start%3D%22none%22%20marker-end%3D%22none%22%20style%3D%22fill%3Anone%3Bstroke%3A%23000000%3Bstroke-width%3A2%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A79.8403%3B%22%20d%3D%22%20M25.001%2C48.001c-9.877%2C0-19-14.025-19-26c0-7.007%2C7.025-9%2C19-9c11.975%2C0%2C19%2C1.993%2C19%2C9C44.001%2C33.975%2C34.878%2C48.001%2C25.001%2C48.001z%22%20%2F%3E%3Cpath%20style%3D%22fill%3Anone%3Bstroke%3A%23000000%3Bstroke-width%3A2%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A79.8403%3B%22%20d%3D%22%20M12.009%2C14.495c0.235-6.781%2C5.185-12.495%2C12.992-12.495c7.805%2C0%2C12.756%2C5.713%2C12.991%2C12.495%22%2F%3E%3Cpath%20style%3D%22fill%3Anone%3Bstroke%3A%23000000%3Bstroke-width%3A2%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A79.8403%3B%22%20d%3D%22%20M17.205%2C13.394c0.761-3.087%2C3.597-6.393%2C7.796-6.393c4.197%2C0%2C7.033%2C3.307%2C7.795%2C6.393%22%2F%3E%3Cpath%20marker-start%3D%22none%22%20marker-end%3D%22none%22%20style%3D%22fill%3Anone%3Bstroke%3A%23000000%3Bstroke-width%3A2%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A79.8403%3B%22%20d%3D%22%20M24.995%2C17.011c3.304%2C0%2C5.987%2C2.681%2C5.987%2C5.984c0%2C3.303-2.683%2C5.984-5.987%2C5.984c-3.304%2C0-5.987-2.681-5.987-5.984%20C19.009%2C19.693%2C21.691%2C17.011%2C24.995%2C17.011z%22%2F%3E%3Cpath%20style%3D%22fill%3Anone%3Bstroke%3A%23000000%3Bstroke-width%3A2%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A79.8403%3B%22%20d%3D%22%20M37.017%2C41.054c-2.4-4.805-6.885-8.041-12.016-8.041c-5.133%2C0-9.617%2C3.235-12.017%2C8.04%22%2F%3E%3C%2Fsvg%3E";
1408
1365
 
1366
+ var buttonVariants = classVarianceAuthority.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", {
1367
+ variants: {
1368
+ variant: {
1369
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
1370
+ destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
1371
+ outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
1372
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
1373
+ ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
1374
+ link: "text-primary underline-offset-4 hover:underline",
1375
+ },
1376
+ size: {
1377
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
1378
+ sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
1379
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
1380
+ icon: "size-9",
1381
+ },
1382
+ },
1383
+ defaultVariants: {
1384
+ variant: "default",
1385
+ size: "default",
1386
+ },
1387
+ });
1409
1388
  function Button(_a) {
1410
- var _b = _a.variant, variant = _b === void 0 ? 'default' : _b; _a.size; var _d = _a.asChild, asChild = _d === void 0 ? false : _d, style = _a.style, props = __rest(_a, ["variant", "size", "asChild", "style"]);
1389
+ var className = _a.className, variant = _a.variant, size = _a.size, _b = _a.asChild, asChild = _b === void 0 ? false : _b, props = __rest(_a, ["className", "variant", "size", "asChild"]);
1411
1390
  var Comp = asChild ? reactSlot.Slot : "button";
1412
- var buttonStyle = __assign(__assign(__assign({}, styles.button.base), styles.button.variants[variant]), style);
1413
- return (jsxRuntime.jsx(Comp, __assign({ "data-slot": "button", style: buttonStyle }, props)));
1391
+ return (jsxRuntime.jsx(Comp, __assign({ "data-slot": "button", className: cn(buttonVariants({ variant: variant, size: size, className: className })) }, props)));
1414
1392
  }
1415
1393
 
1416
1394
  function Dialog(_a) {
@@ -1442,7 +1420,7 @@ var a="container_f782f4",i="inner_37f4c9",c="bar_409d0f";const r=({size:r=35,col
1442
1420
 
1443
1421
  var LoadingSpinner = function (_a) {
1444
1422
  var loadingText = _a.loadingText;
1445
- return (jsxRuntime.jsxs("div", { style: { display: 'flex', flexDirection: 'column', justifyContent: 'center', alignItems: 'center', height: '100%', width: '100%', paddingTop: '2.5rem', paddingBottom: '2.5rem' }, children: [jsxRuntime.jsx("script", { type: "module", defer: true, src: "https://cdn.jsdelivr.net/npm/ldrs/dist/auto/waveform.js" }), jsxRuntime.jsx(r, { size: "35", stroke: "3.5", speed: "1", color: "green" }), loadingText && (jsxRuntime.jsx("p", { style: { textAlign: 'center', fontWeight: '600', marginTop: '0.75rem' }, children: "Loading..." }))] }));
1423
+ return (jsxRuntime.jsxs("div", { className: "flex flex-col justify-center items-center h-full w-full py-10", children: [jsxRuntime.jsx("script", { type: "module", defer: true, src: "https://cdn.jsdelivr.net/npm/ldrs/dist/auto/waveform.js" }), jsxRuntime.jsx(r, { size: "35", stroke: "3.5", speed: "1", color: "green" }), loadingText && (jsxRuntime.jsx("p", { className: "text-center font-semibold mt-3", children: "Loading..." }))] }));
1446
1424
  };
1447
1425
 
1448
1426
  var AuthSuccessAnimation = function (_a) {
@@ -1999,7 +1977,7 @@ var DefaultLoginPage = function (_a) {
1999
1977
 
2000
1978
  var ErrorFallback = function (_a) {
2001
1979
  var message = _a.message;
2002
- return (jsxRuntime.jsx("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'center', minHeight: '100vh', backgroundColor: '#f9fafb' }, children: jsxRuntime.jsxs("div", { style: { backgroundColor: 'white', padding: '1.5rem', borderRadius: '0.5rem', boxShadow: '0 10px 15px -3px rgba(0, 0, 0, 0.1)', border: '1px solid #fecaca', maxWidth: '28rem' }, children: [jsxRuntime.jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '0.75rem', marginBottom: '0.5rem' }, children: [jsxRuntime.jsx("svg", { style: { width: '1.5rem', height: '1.5rem', color: '#ef4444' }, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), jsxRuntime.jsx("h2", { style: { fontSize: '1.125rem', fontWeight: '600', color: '#111827' }, children: "Configuration Error" })] }), jsxRuntime.jsx("p", { style: { color: '#dc2626' }, children: message })] }) }));
1980
+ return (jsxRuntime.jsx("div", { className: "flex items-center justify-center min-h-screen bg-gray-50", children: jsxRuntime.jsxs("div", { className: "bg-white p-6 rounded-lg shadow-lg border border-red-200 max-w-md", children: [jsxRuntime.jsxs("div", { className: "flex items-center gap-3 mb-2", children: [jsxRuntime.jsx("svg", { className: "w-6 h-6 text-red-500", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-gray-900", children: "Configuration Error" })] }), jsxRuntime.jsx("p", { className: "text-red-600", children: message })] }) }));
2003
1981
  };
2004
1982
 
2005
1983
  var MFAEndpointsSchema = z.object({
@@ -2010,7 +1988,7 @@ var MFAEndpointsSchema = z.object({
2010
1988
  AuthChallengeVerify: z.url("MFA AuthChallengeVerify must be a valid URL"),
2011
1989
  });
2012
1990
  var MFAGate = function (_a) {
2013
- var children = _a.children, _b = _a.fallback, fallback = _b === void 0 ? jsxRuntime.jsx("div", { style: { height: '100vh', display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: jsxRuntime.jsx(LoadingSpinner, {}) }) : _b,
1991
+ var children = _a.children, _b = _a.fallback, fallback = _b === void 0 ? jsxRuntime.jsx("div", { className: 'h-screen flex items-center justify-center', children: jsxRuntime.jsx(LoadingSpinner, {}) }) : _b,
2014
1992
  // loginComponent: LoginComponent = DefaultLoginPage,
2015
1993
  _c = _a.usePassKey,
2016
1994
  // loginComponent: LoginComponent = DefaultLoginPage,