@datatechsolutions/ui 2.11.86 → 2.11.88
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/dist/billing-panel-DsHhhJqG.d.mts +18 -0
- package/dist/billing-panel-DsHhhJqG.d.ts +18 -0
- package/dist/chunk-4667D2ZT.mjs +61 -0
- package/dist/chunk-4667D2ZT.mjs.map +1 -0
- package/dist/chunk-5HXDJBVX.mjs +1330 -0
- package/dist/chunk-5HXDJBVX.mjs.map +1 -0
- package/dist/chunk-DJ33CSGJ.mjs +126 -0
- package/dist/chunk-DJ33CSGJ.mjs.map +1 -0
- package/dist/chunk-F4TOOARV.mjs +503 -0
- package/dist/chunk-F4TOOARV.mjs.map +1 -0
- package/dist/chunk-GEUGFYLO.mjs +237 -0
- package/dist/chunk-GEUGFYLO.mjs.map +1 -0
- package/dist/chunk-LBALE4JX.js +1342 -0
- package/dist/chunk-LBALE4JX.js.map +1 -0
- package/dist/chunk-MXFEU7A6.js +148 -0
- package/dist/chunk-MXFEU7A6.js.map +1 -0
- package/dist/chunk-NBCOVUQP.mjs +142 -0
- package/dist/chunk-NBCOVUQP.mjs.map +1 -0
- package/dist/chunk-P4RVGMZL.js +128 -0
- package/dist/chunk-P4RVGMZL.js.map +1 -0
- package/dist/chunk-Q2MG7S2E.js +239 -0
- package/dist/chunk-Q2MG7S2E.js.map +1 -0
- package/dist/chunk-RV555OEO.mjs +1009 -0
- package/dist/chunk-RV555OEO.mjs.map +1 -0
- package/dist/chunk-SAYVWIMJ.js +63 -0
- package/dist/chunk-SAYVWIMJ.js.map +1 -0
- package/dist/chunk-SUHNSUMH.mjs +1021 -0
- package/dist/chunk-SUHNSUMH.mjs.map +1 -0
- package/dist/chunk-TOEMSC4P.mjs +99 -0
- package/dist/chunk-TOEMSC4P.mjs.map +1 -0
- package/dist/chunk-UUHV5KHF.js +505 -0
- package/dist/chunk-UUHV5KHF.js.map +1 -0
- package/dist/chunk-UVEPTYZC.js +101 -0
- package/dist/chunk-UVEPTYZC.js.map +1 -0
- package/dist/chunk-X2KCCQPL.js +1049 -0
- package/dist/chunk-X2KCCQPL.js.map +1 -0
- package/dist/chunk-ZARCUQA6.js +1015 -0
- package/dist/chunk-ZARCUQA6.js.map +1 -0
- package/dist/platform/admin/index.d.mts +17 -0
- package/dist/platform/admin/index.d.ts +17 -0
- package/dist/platform/admin/index.js +39 -0
- package/dist/platform/admin/index.js.map +1 -0
- package/dist/platform/admin/index.mjs +10 -0
- package/dist/platform/admin/index.mjs.map +1 -0
- package/dist/platform/auth/index.d.mts +73 -0
- package/dist/platform/auth/index.d.ts +73 -0
- package/dist/platform/auth/index.js +107 -0
- package/dist/platform/auth/index.js.map +1 -0
- package/dist/platform/auth/index.mjs +10 -0
- package/dist/platform/auth/index.mjs.map +1 -0
- package/dist/platform/billing/index.d.mts +29 -0
- package/dist/platform/billing/index.d.ts +29 -0
- package/dist/platform/billing/index.js +22 -0
- package/dist/platform/billing/index.js.map +1 -0
- package/dist/platform/billing/index.mjs +9 -0
- package/dist/platform/billing/index.mjs.map +1 -0
- package/dist/platform/impersonation/index.d.mts +19 -0
- package/dist/platform/impersonation/index.d.ts +19 -0
- package/dist/platform/impersonation/index.js +17 -0
- package/dist/platform/impersonation/index.js.map +1 -0
- package/dist/platform/impersonation/index.mjs +8 -0
- package/dist/platform/impersonation/index.mjs.map +1 -0
- package/dist/platform/index.d.mts +45 -2
- package/dist/platform/index.d.ts +45 -2
- package/dist/platform/index.js +4850 -0
- package/dist/platform/index.js.map +1 -1
- package/dist/platform/index.mjs +4716 -3
- package/dist/platform/index.mjs.map +1 -1
- package/dist/platform/settings/index.d.mts +31 -0
- package/dist/platform/settings/index.d.ts +31 -0
- package/dist/platform/settings/index.js +21 -0
- package/dist/platform/settings/index.js.map +1 -0
- package/dist/platform/settings/index.mjs +12 -0
- package/dist/platform/settings/index.mjs.map +1 -0
- package/package.json +26 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
interface BillingPanelProps {
|
|
4
|
+
/**
|
|
5
|
+
* Which billing interval to prefer when starting checkout. Defaults to
|
|
6
|
+
* `'monthly'`. Surface a toggle in the host app if both matter.
|
|
7
|
+
*/
|
|
8
|
+
defaultBillingInterval?: 'monthly' | 'yearly';
|
|
9
|
+
/**
|
|
10
|
+
* Called after the portal/checkout URL is resolved. Defaults to
|
|
11
|
+
* `window.location.assign(url)`. Override to open in a new tab, use a
|
|
12
|
+
* router, etc.
|
|
13
|
+
*/
|
|
14
|
+
onRedirect?: (url: string) => void;
|
|
15
|
+
}
|
|
16
|
+
declare function BillingPanel({ defaultBillingInterval, onRedirect, }: BillingPanelProps): react_jsx_runtime.JSX.Element;
|
|
17
|
+
|
|
18
|
+
export { BillingPanel as B, type BillingPanelProps as a };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
interface BillingPanelProps {
|
|
4
|
+
/**
|
|
5
|
+
* Which billing interval to prefer when starting checkout. Defaults to
|
|
6
|
+
* `'monthly'`. Surface a toggle in the host app if both matter.
|
|
7
|
+
*/
|
|
8
|
+
defaultBillingInterval?: 'monthly' | 'yearly';
|
|
9
|
+
/**
|
|
10
|
+
* Called after the portal/checkout URL is resolved. Defaults to
|
|
11
|
+
* `window.location.assign(url)`. Override to open in a new tab, use a
|
|
12
|
+
* router, etc.
|
|
13
|
+
*/
|
|
14
|
+
onRedirect?: (url: string) => void;
|
|
15
|
+
}
|
|
16
|
+
declare function BillingPanel({ defaultBillingInterval, onRedirect, }: BillingPanelProps): react_jsx_runtime.JSX.Element;
|
|
17
|
+
|
|
18
|
+
export { BillingPanel as B, type BillingPanelProps as a };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Button } from './chunk-ZJQ5RLGK.mjs';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { useImpersonation } from '@datatechsolutions/windsock/client';
|
|
5
|
+
import { EyeIcon, XMarkIcon } from '@heroicons/react/24/outline';
|
|
6
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
function ImpersonationBanner({ onExit, className }) {
|
|
9
|
+
const { isImpersonating, claim, exit } = useImpersonation();
|
|
10
|
+
const [isExiting, setIsExiting] = useState(false);
|
|
11
|
+
if (!isImpersonating || !claim) return null;
|
|
12
|
+
const handleExit = async () => {
|
|
13
|
+
setIsExiting(true);
|
|
14
|
+
try {
|
|
15
|
+
await exit();
|
|
16
|
+
onExit?.();
|
|
17
|
+
} finally {
|
|
18
|
+
setIsExiting(false);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
return /* @__PURE__ */ jsxs(
|
|
22
|
+
"div",
|
|
23
|
+
{
|
|
24
|
+
role: "status",
|
|
25
|
+
"aria-live": "polite",
|
|
26
|
+
className: "sticky top-0 z-50 flex items-center justify-between gap-3 border-b border-amber-300 bg-amber-100 px-4 py-2 text-sm text-amber-900 shadow-sm " + (className ?? ""),
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
29
|
+
/* @__PURE__ */ jsx(EyeIcon, { "aria-hidden": "true", className: "h-5 w-5 shrink-0" }),
|
|
30
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
31
|
+
"Impersonating session \u2014 signed in as the target user by",
|
|
32
|
+
" ",
|
|
33
|
+
/* @__PURE__ */ jsx("strong", { children: claim.email ?? claim.sub }),
|
|
34
|
+
claim.reason ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
35
|
+
" \xB7 ",
|
|
36
|
+
/* @__PURE__ */ jsx("span", { className: "italic", children: claim.reason })
|
|
37
|
+
] }) : null
|
|
38
|
+
] })
|
|
39
|
+
] }),
|
|
40
|
+
/* @__PURE__ */ jsxs(
|
|
41
|
+
Button,
|
|
42
|
+
{
|
|
43
|
+
size: "sm",
|
|
44
|
+
color: "ios-glass-red",
|
|
45
|
+
onClick: handleExit,
|
|
46
|
+
disabled: isExiting,
|
|
47
|
+
"aria-label": "Exit impersonation",
|
|
48
|
+
children: [
|
|
49
|
+
/* @__PURE__ */ jsx(XMarkIcon, { "aria-hidden": "true", className: "h-4 w-4" }),
|
|
50
|
+
isExiting ? "Exiting\u2026" : "Exit impersonation"
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export { ImpersonationBanner };
|
|
60
|
+
//# sourceMappingURL=chunk-4667D2ZT.mjs.map
|
|
61
|
+
//# sourceMappingURL=chunk-4667D2ZT.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/platform/impersonation/impersonation-banner.tsx"],"names":[],"mappings":";;;;;;AAoBO,SAAS,mBAAA,CAAoB,EAAE,MAAA,EAAQ,SAAA,EAAU,EAA6B;AACnF,EAAA,MAAM,EAAE,eAAA,EAAiB,KAAA,EAAO,IAAA,KAAS,gBAAA,EAAiB;AAC1D,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAI,SAAS,KAAK,CAAA;AAEhD,EAAA,IAAI,CAAC,eAAA,IAAmB,CAAC,KAAA,EAAO,OAAO,IAAA;AAEvC,EAAA,MAAM,aAAa,YAAY;AAC7B,IAAA,YAAA,CAAa,IAAI,CAAA;AACjB,IAAA,IAAI;AACF,MAAA,MAAM,IAAA,EAAK;AACX,MAAA,MAAA,IAAS;AAAA,IACX,CAAA,SAAE;AACA,MAAA,YAAA,CAAa,KAAK,CAAA;AAAA,IACpB;AAAA,EACF,CAAA;AAEA,EAAA,uBACE,IAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAK,QAAA;AAAA,MACL,WAAA,EAAU,QAAA;AAAA,MACV,SAAA,EACE,kJAEC,SAAA,IAAa,EAAA,CAAA;AAAA,MAGhB,QAAA,EAAA;AAAA,wBAAA,IAAA,CAAC,KAAA,EAAA,EAAI,WAAU,yBAAA,EACb,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,OAAA,EAAA,EAAQ,aAAA,EAAY,MAAA,EAAO,SAAA,EAAU,kBAAA,EAAmB,CAAA;AAAA,+BACxD,MAAA,EAAA,EAAK,QAAA,EAAA;AAAA,YAAA,8DAAA;AAAA,YACoD,GAAA;AAAA,4BACxD,GAAA,CAAC,QAAA,EAAA,EAAQ,QAAA,EAAA,KAAA,CAAM,KAAA,IAAS,MAAM,GAAA,EAAI,CAAA;AAAA,YACjC,KAAA,CAAM,yBACL,IAAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA;AAAA,cAAA,QAAA;AAAA,8BACD,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,QAAA,EAAU,gBAAM,MAAA,EAAO;AAAA,aAAA,EACzC,CAAA,GACE;AAAA,WAAA,EACN;AAAA,SAAA,EACF,CAAA;AAAA,wBACA,IAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,IAAA,EAAK,IAAA;AAAA,YACL,KAAA,EAAM,eAAA;AAAA,YACN,OAAA,EAAS,UAAA;AAAA,YACT,QAAA,EAAU,SAAA;AAAA,YACV,YAAA,EAAW,oBAAA;AAAA,YAEX,QAAA,EAAA;AAAA,8BAAA,GAAA,CAAC,SAAA,EAAA,EAAU,aAAA,EAAY,MAAA,EAAO,SAAA,EAAU,SAAA,EAAU,CAAA;AAAA,cACjD,YAAY,eAAA,GAAa;AAAA;AAAA;AAAA;AAC5B;AAAA;AAAA,GACF;AAEJ","file":"chunk-4667D2ZT.mjs","sourcesContent":["import { useState } from 'react'\nimport { useImpersonation } from '@datatechsolutions/windsock/client'\nimport { Button } from '@ui/index'\nimport { EyeIcon, XMarkIcon } from '@heroicons/react/24/outline'\n\nexport interface ImpersonationBannerProps {\n /**\n * Callback fired after the impersonation session ends (after the admin\n * token is restored). Useful for refreshing the UI or navigating home.\n */\n onExit?: () => void\n /** Optional extra classes on the outer bar. */\n className?: string\n}\n\n/**\n * Persistent banner shown while the current session is an impersonation\n * session. Shows the admin's identity + target, and an Exit button that\n * terminates the session. Invisible when not impersonating.\n */\nexport function ImpersonationBanner({ onExit, className }: ImpersonationBannerProps) {\n const { isImpersonating, claim, exit } = useImpersonation()\n const [isExiting, setIsExiting] = useState(false)\n\n if (!isImpersonating || !claim) return null\n\n const handleExit = async () => {\n setIsExiting(true)\n try {\n await exit()\n onExit?.()\n } finally {\n setIsExiting(false)\n }\n }\n\n return (\n <div\n role=\"status\"\n aria-live=\"polite\"\n className={\n 'sticky top-0 z-50 flex items-center justify-between gap-3 border-b border-amber-300 ' +\n 'bg-amber-100 px-4 py-2 text-sm text-amber-900 shadow-sm ' +\n (className ?? '')\n }\n >\n <div className=\"flex items-center gap-2\">\n <EyeIcon aria-hidden=\"true\" className=\"h-5 w-5 shrink-0\" />\n <span>\n Impersonating session — signed in as the target user by{' '}\n <strong>{claim.email ?? claim.sub}</strong>\n {claim.reason ? (\n <>\n {' · '}\n <span className=\"italic\">{claim.reason}</span>\n </>\n ) : null}\n </span>\n </div>\n <Button\n size=\"sm\"\n color=\"ios-glass-red\"\n onClick={handleExit}\n disabled={isExiting}\n aria-label=\"Exit impersonation\"\n >\n <XMarkIcon aria-hidden=\"true\" className=\"h-4 w-4\" />\n {isExiting ? 'Exiting…' : 'Exit impersonation'}\n </Button>\n </div>\n )\n}\n"]}
|