@decentrys/ui-sdk 0.1.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/LICENSE +21 -0
- package/README.md +51 -0
- package/dist/browser/decentrys-ui.js +1733 -0
- package/dist/browser/decentrys-ui.mjs +1681 -0
- package/dist/browser/react-dom-global.d.ts +6 -0
- package/dist/browser/react-dom-global.d.ts.map +1 -0
- package/dist/browser/react-dom-global.js +18 -0
- package/dist/browser/react-dom-global.js.map +1 -0
- package/dist/browser/react-global.d.ts +25 -0
- package/dist/browser/react-global.d.ts.map +1 -0
- package/dist/browser/react-global.js +39 -0
- package/dist/browser/react-global.js.map +1 -0
- package/dist/browser/react-jsx-runtime.d.ts +17 -0
- package/dist/browser/react-jsx-runtime.d.ts.map +1 -0
- package/dist/browser/react-jsx-runtime.js +27 -0
- package/dist/browser/react-jsx-runtime.js.map +1 -0
- package/dist/components/AddressRiskBadge.d.ts +39 -0
- package/dist/components/AddressRiskBadge.d.ts.map +1 -0
- package/dist/components/AddressRiskBadge.js +26 -0
- package/dist/components/AddressRiskBadge.js.map +1 -0
- package/dist/components/ApprovalWarning.d.ts +29 -0
- package/dist/components/ApprovalWarning.d.ts.map +1 -0
- package/dist/components/ApprovalWarning.js +18 -0
- package/dist/components/ApprovalWarning.js.map +1 -0
- package/dist/components/ContractFacts.d.ts +27 -0
- package/dist/components/ContractFacts.d.ts.map +1 -0
- package/dist/components/ContractFacts.js +15 -0
- package/dist/components/ContractFacts.js.map +1 -0
- package/dist/components/RiskDetailsModal.d.ts +35 -0
- package/dist/components/RiskDetailsModal.d.ts.map +1 -0
- package/dist/components/RiskDetailsModal.js +74 -0
- package/dist/components/RiskDetailsModal.js.map +1 -0
- package/dist/components/ThreatSignalList.d.ts +28 -0
- package/dist/components/ThreatSignalList.d.ts.map +1 -0
- package/dist/components/ThreatSignalList.js +28 -0
- package/dist/components/ThreatSignalList.js.map +1 -0
- package/dist/components/TokenSecurityPanel.d.ts +28 -0
- package/dist/components/TokenSecurityPanel.d.ts.map +1 -0
- package/dist/components/TokenSecurityPanel.js +26 -0
- package/dist/components/TokenSecurityPanel.js.map +1 -0
- package/dist/components/TransactionRiskBanner.d.ts +36 -0
- package/dist/components/TransactionRiskBanner.d.ts.map +1 -0
- package/dist/components/TransactionRiskBanner.js +20 -0
- package/dist/components/TransactionRiskBanner.js.map +1 -0
- package/dist/context.d.ts +51 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +47 -0
- package/dist/context.js.map +1 -0
- package/dist/copy.d.ts +72 -0
- package/dist/copy.d.ts.map +1 -0
- package/dist/copy.js +77 -0
- package/dist/copy.js.map +1 -0
- package/dist/index.d.ts +57 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +107 -0
- package/dist/index.js.map +1 -0
- package/dist/presentation.d.ts +316 -0
- package/dist/presentation.d.ts.map +1 -0
- package/dist/presentation.js +533 -0
- package/dist/presentation.js.map +1 -0
- package/dist/primitives.d.ts +139 -0
- package/dist/primitives.d.ts.map +1 -0
- package/dist/primitives.js +150 -0
- package/dist/primitives.js.map +1 -0
- package/dist/styles.d.ts +15 -0
- package/dist/styles.d.ts.map +1 -0
- package/dist/styles.js +285 -0
- package/dist/styles.js.map +1 -0
- package/dist/theme.d.ts +52 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +90 -0
- package/dist/theme.js.map +1 -0
- package/package.json +70 -0
- package/src/browser/react-dom-global.ts +20 -0
- package/src/browser/react-global.ts +42 -0
- package/src/browser/react-jsx-runtime.ts +23 -0
- package/src/components/AddressRiskBadge.tsx +94 -0
- package/src/components/ApprovalWarning.tsx +144 -0
- package/src/components/ContractFacts.tsx +119 -0
- package/src/components/RiskDetailsModal.tsx +229 -0
- package/src/components/ThreatSignalList.tsx +76 -0
- package/src/components/TokenSecurityPanel.tsx +168 -0
- package/src/components/TransactionRiskBanner.tsx +123 -0
- package/src/context.tsx +89 -0
- package/src/copy.test.ts +214 -0
- package/src/copy.ts +151 -0
- package/src/index.ts +84 -0
- package/src/presentation.test.ts +521 -0
- package/src/presentation.ts +846 -0
- package/src/primitives.tsx +384 -0
- package/src/styles.ts +281 -0
- package/src/theme.test.ts +105 -0
- package/src/theme.ts +117 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-dom-global.d.ts","sourceRoot":"","sources":["../../src/browser/react-dom-global.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAeH,eAAO,MAAM,YAAY,GAAI,GAAG,MAAM,OAAO,EAAE,KAAG,OACT,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* `react-dom` for the script-tag build. Only `createPortal` is used, by the
|
|
4
|
+
* details modal, and only when its `portal` prop is left on.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.createPortal = void 0;
|
|
8
|
+
function resolveReactDom() {
|
|
9
|
+
const candidate = globalThis.ReactDOM;
|
|
10
|
+
if (!candidate || typeof candidate.createPortal !== 'function') {
|
|
11
|
+
throw new Error('DecentrysUI: RiskDetailsModal needs ReactDOM on the page (window.ReactDOM) to portal into '
|
|
12
|
+
+ 'document.body. Load ReactDOM, or pass portal={false} to render the dialog in place.');
|
|
13
|
+
}
|
|
14
|
+
return candidate;
|
|
15
|
+
}
|
|
16
|
+
const createPortal = (...args) => resolveReactDom().createPortal(...args);
|
|
17
|
+
exports.createPortal = createPortal;
|
|
18
|
+
//# sourceMappingURL=react-dom-global.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-dom-global.js","sourceRoot":"","sources":["../../src/browser/react-dom-global.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,SAAS,eAAe;IACtB,MAAM,SAAS,GAAI,UAA4C,CAAC,QAAQ,CAAC;IACzE,IAAI,CAAC,SAAS,IAAI,OAAO,SAAS,CAAC,YAAY,KAAK,UAAU,EAAE,CAAC;QAC/D,MAAM,IAAI,KAAK,CACb,4FAA4F;cAC1F,qFAAqF,CACxF,CAAC;IACJ,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAEM,MAAM,YAAY,GAAG,CAAC,GAAG,IAAe,EAAW,EAAE,CAC1D,eAAe,EAAE,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,CAAC;AAD7B,QAAA,YAAY,gBACiB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How the script-tag build gets React.
|
|
3
|
+
*
|
|
4
|
+
* The ESM browser build leaves `react` as a bare import, which is right: an
|
|
5
|
+
* ESM consumer has a bundler or an import map. The IIFE build has neither, and
|
|
6
|
+
* esbuild's `--external` would leave a `require("react")` call in it that
|
|
7
|
+
* throws the moment the file loads. Bundling React instead is not an option —
|
|
8
|
+
* two copies of React in one application is a real and confusing breakage, and
|
|
9
|
+
* this file is aliased in precisely so that never happens.
|
|
10
|
+
*
|
|
11
|
+
* So the IIFE build resolves React from the page, the way every UMD component
|
|
12
|
+
* library has always done.
|
|
13
|
+
*/
|
|
14
|
+
type ReactModule = Record<string, any>;
|
|
15
|
+
declare const React: ReactModule;
|
|
16
|
+
export default React;
|
|
17
|
+
export declare const createContext: any;
|
|
18
|
+
export declare const useContext: any;
|
|
19
|
+
export declare const useState: any;
|
|
20
|
+
export declare const useEffect: any;
|
|
21
|
+
export declare const useId: any;
|
|
22
|
+
export declare const useRef: any;
|
|
23
|
+
export declare const createElement: any;
|
|
24
|
+
export declare const Fragment: any;
|
|
25
|
+
//# sourceMappingURL=react-global.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-global.d.ts","sourceRoot":"","sources":["../../src/browser/react-global.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAiBvC,QAAA,MAAM,KAAK,EAAE,WAA4B,CAAC;AAE1C,eAAe,KAAK,CAAC;AACrB,eAAO,MAAM,aAAa,KAAsB,CAAC;AACjD,eAAO,MAAM,UAAU,KAAmB,CAAC;AAC3C,eAAO,MAAM,QAAQ,KAAiB,CAAC;AACvC,eAAO,MAAM,SAAS,KAAkB,CAAC;AACzC,eAAO,MAAM,KAAK,KAAc,CAAC;AACjC,eAAO,MAAM,MAAM,KAAe,CAAC;AACnC,eAAO,MAAM,aAAa,KAAsB,CAAC;AACjD,eAAO,MAAM,QAAQ,KAAiB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* How the script-tag build gets React.
|
|
4
|
+
*
|
|
5
|
+
* The ESM browser build leaves `react` as a bare import, which is right: an
|
|
6
|
+
* ESM consumer has a bundler or an import map. The IIFE build has neither, and
|
|
7
|
+
* esbuild's `--external` would leave a `require("react")` call in it that
|
|
8
|
+
* throws the moment the file loads. Bundling React instead is not an option —
|
|
9
|
+
* two copies of React in one application is a real and confusing breakage, and
|
|
10
|
+
* this file is aliased in precisely so that never happens.
|
|
11
|
+
*
|
|
12
|
+
* So the IIFE build resolves React from the page, the way every UMD component
|
|
13
|
+
* library has always done.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.Fragment = exports.createElement = exports.useRef = exports.useId = exports.useEffect = exports.useState = exports.useContext = exports.createContext = void 0;
|
|
17
|
+
function resolveReact() {
|
|
18
|
+
const candidate = globalThis.React;
|
|
19
|
+
if (!candidate || typeof candidate.createElement !== 'function') {
|
|
20
|
+
// Loud and immediate, with the fix in the message. The alternative is
|
|
21
|
+
// "cannot read property createElement of undefined" from inside a bundle,
|
|
22
|
+
// several frames away from the missing script tag that caused it.
|
|
23
|
+
throw new Error('DecentrysUI: the script-tag build expects React on the page already '
|
|
24
|
+
+ '(window.React, and window.ReactDOM for the details modal). Load React first, '
|
|
25
|
+
+ 'or use the ESM build / the npm package if you have a bundler.');
|
|
26
|
+
}
|
|
27
|
+
return candidate;
|
|
28
|
+
}
|
|
29
|
+
const React = resolveReact();
|
|
30
|
+
exports.default = React;
|
|
31
|
+
exports.createContext = React.createContext;
|
|
32
|
+
exports.useContext = React.useContext;
|
|
33
|
+
exports.useState = React.useState;
|
|
34
|
+
exports.useEffect = React.useEffect;
|
|
35
|
+
exports.useId = React.useId;
|
|
36
|
+
exports.useRef = React.useRef;
|
|
37
|
+
exports.createElement = React.createElement;
|
|
38
|
+
exports.Fragment = React.Fragment;
|
|
39
|
+
//# sourceMappingURL=react-global.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-global.js","sourceRoot":"","sources":["../../src/browser/react-global.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAIH,SAAS,YAAY;IACnB,MAAM,SAAS,GAAI,UAAsC,CAAC,KAAK,CAAC;IAChE,IAAI,CAAC,SAAS,IAAI,OAAO,SAAS,CAAC,aAAa,KAAK,UAAU,EAAE,CAAC;QAChE,sEAAsE;QACtE,0EAA0E;QAC1E,kEAAkE;QAClE,MAAM,IAAI,KAAK,CACb,sEAAsE;cACpE,+EAA+E;cAC/E,+DAA+D,CAClE,CAAC;IACJ,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,KAAK,GAAgB,YAAY,EAAE,CAAC;AAE1C,kBAAe,KAAK,CAAC;AACR,QAAA,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC;AACpC,QAAA,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;AAC9B,QAAA,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;AAC1B,QAAA,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;AAC5B,QAAA,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;AACpB,QAAA,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;AACtB,QAAA,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC;AACpC,QAAA,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The automatic JSX runtime, expressed through `createElement`.
|
|
3
|
+
*
|
|
4
|
+
* React 17+ ships `react/jsx-runtime` as its own entry point, and a page that
|
|
5
|
+
* loaded React from a CDN script tag has the global but not that entry. The
|
|
6
|
+
* two are equivalent for everything this package emits: `jsx(type, props,
|
|
7
|
+
* key)` is `createElement` with `children` already inside `props`, which is
|
|
8
|
+
* exactly what `createElement` does with a config object when no variadic
|
|
9
|
+
* children are passed.
|
|
10
|
+
*/
|
|
11
|
+
export declare const Fragment: any;
|
|
12
|
+
declare function create(type: unknown, props: Record<string, unknown> | null, key?: unknown): unknown;
|
|
13
|
+
export declare const jsx: typeof create;
|
|
14
|
+
export declare const jsxs: typeof create;
|
|
15
|
+
export declare const jsxDEV: typeof create;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=react-jsx-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-jsx-runtime.d.ts","sourceRoot":"","sources":["../../src/browser/react-jsx-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,eAAO,MAAM,QAAQ,KAAiB,CAAC;AAEvC,iBAAS,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,EAAE,GAAG,CAAC,EAAE,OAAO,GAAG,OAAO,CAG5F;AAED,eAAO,MAAM,GAAG,eAAS,CAAC;AAC1B,eAAO,MAAM,IAAI,eAAS,CAAC;AAC3B,eAAO,MAAM,MAAM,eAAS,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* The automatic JSX runtime, expressed through `createElement`.
|
|
4
|
+
*
|
|
5
|
+
* React 17+ ships `react/jsx-runtime` as its own entry point, and a page that
|
|
6
|
+
* loaded React from a CDN script tag has the global but not that entry. The
|
|
7
|
+
* two are equivalent for everything this package emits: `jsx(type, props,
|
|
8
|
+
* key)` is `createElement` with `children` already inside `props`, which is
|
|
9
|
+
* exactly what `createElement` does with a config object when no variadic
|
|
10
|
+
* children are passed.
|
|
11
|
+
*/
|
|
12
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
|
+
};
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.jsxDEV = exports.jsxs = exports.jsx = exports.Fragment = void 0;
|
|
17
|
+
const react_global_1 = __importDefault(require("./react-global"));
|
|
18
|
+
exports.Fragment = react_global_1.default.Fragment;
|
|
19
|
+
function create(type, props, key) {
|
|
20
|
+
if (key === undefined || key === null)
|
|
21
|
+
return react_global_1.default.createElement(type, props);
|
|
22
|
+
return react_global_1.default.createElement(type, { ...(props ?? {}), key });
|
|
23
|
+
}
|
|
24
|
+
exports.jsx = create;
|
|
25
|
+
exports.jsxs = create;
|
|
26
|
+
exports.jsxDEV = create;
|
|
27
|
+
//# sourceMappingURL=react-jsx-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-jsx-runtime.js","sourceRoot":"","sources":["../../src/browser/react-jsx-runtime.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;;;;AAEH,kEAAmC;AAEtB,QAAA,QAAQ,GAAG,sBAAK,CAAC,QAAQ,CAAC;AAEvC,SAAS,MAAM,CAAC,IAAa,EAAE,KAAqC,EAAE,GAAa;IACjF,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI;QAAE,OAAO,sBAAK,CAAC,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC/E,OAAO,sBAAK,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;AAC9D,CAAC;AAEY,QAAA,GAAG,GAAG,MAAM,CAAC;AACb,QAAA,IAAI,GAAG,MAAM,CAAC;AACd,QAAA,MAAM,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The compact form — an inline badge beside an address.
|
|
3
|
+
*
|
|
4
|
+
* Small enough that it is tempting to reduce to a coloured dot, which would be
|
|
5
|
+
* the single worst thing this package could ship: a colour with no words is
|
|
6
|
+
* unreadable to a colour-blind user and unfalsifiable to everyone else. So the
|
|
7
|
+
* badge always carries the level's label as text, always carries an ordinal
|
|
8
|
+
* glyph that does not depend on colour, and always carries the model's own
|
|
9
|
+
* meaning in a screen-reader-only span, so the short label is never the only
|
|
10
|
+
* thing a non-sighted user gets.
|
|
11
|
+
*/
|
|
12
|
+
import { type ReactNode } from 'react';
|
|
13
|
+
import type { Assessment, RiskLevel } from '@decentrys/protect';
|
|
14
|
+
import { type CommonProps } from '../primitives';
|
|
15
|
+
interface AddressRiskBadgeBaseProps extends CommonProps {
|
|
16
|
+
/** Rendered in short form beside the badge when supplied. */
|
|
17
|
+
address?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Turns the badge into a button — for opening details, never for blocking.
|
|
20
|
+
* Nothing in this package disables a host application's controls.
|
|
21
|
+
*/
|
|
22
|
+
onSelect?: () => void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* One of `assessment` or `level` is required, enforced by the type rather than
|
|
26
|
+
* by a runtime throw: a component that throws inside a wallet's render tree
|
|
27
|
+
* takes that wallet's screen down, which is a worse failure than the wiring
|
|
28
|
+
* mistake it was reporting.
|
|
29
|
+
*/
|
|
30
|
+
export type AddressRiskBadgeProps = AddressRiskBadgeBaseProps & ({
|
|
31
|
+
assessment: Assessment;
|
|
32
|
+
level?: never;
|
|
33
|
+
} | {
|
|
34
|
+
level: RiskLevel;
|
|
35
|
+
assessment?: never;
|
|
36
|
+
});
|
|
37
|
+
export declare function AddressRiskBadge(props: AddressRiskBadgeProps): ReactNode;
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=AddressRiskBadge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AddressRiskBadge.d.ts","sourceRoot":"","sources":["../../src/components/AddressRiskBadge.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGhE,OAAO,EAAiD,KAAK,WAAW,EAAM,MAAM,eAAe,CAAC;AAGpG,UAAU,yBAA0B,SAAQ,WAAW;IACrD,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,GAAG,yBAAyB,GAC3D,CAAC;IAAE,UAAU,EAAE,UAAU,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,UAAU,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC;AAEzF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,SAAS,CAuDxE"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AddressRiskBadge = AddressRiskBadge;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const context_1 = require("../context");
|
|
6
|
+
const theme_1 = require("../theme");
|
|
7
|
+
const primitives_1 = require("../primitives");
|
|
8
|
+
const presentation_1 = require("../presentation");
|
|
9
|
+
function AddressRiskBadge(props) {
|
|
10
|
+
const { assessment, level, address, onSelect, className, style, theme, copy, levelLabels } = props;
|
|
11
|
+
const { theme: mergedTheme, emitStyles } = (0, context_1.useUiConfig)({ theme, copy });
|
|
12
|
+
const resolved = assessment?.riskLevel ?? level;
|
|
13
|
+
if (!resolved)
|
|
14
|
+
return null;
|
|
15
|
+
const presentation = (0, presentation_1.levelPresentation)(resolved, { labels: levelLabels });
|
|
16
|
+
const rootClass = (0, primitives_1.cx)('dcy', 'dcy-inline', className);
|
|
17
|
+
const rootStyle = (0, theme_1.themeStyle)(mergedTheme, style);
|
|
18
|
+
const content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(primitives_1.LevelBadge, { level: presentation }), address ? (0, jsx_runtime_1.jsx)(primitives_1.Mono, { children: (0, presentation_1.shortenAddress)(address) }) : null, (0, jsx_runtime_1.jsx)(primitives_1.ScreenReaderText, { children: presentation.meaning })] }));
|
|
19
|
+
// The stylesheet is emitted as a sibling rather than a child: a <style> tag
|
|
20
|
+
// inside a <button> is legal but pointless clutter in the accessibility tree.
|
|
21
|
+
if (onSelect) {
|
|
22
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(primitives_1.StyleGate, { emit: emitStyles }), (0, jsx_runtime_1.jsx)("button", { type: "button", className: rootClass, style: rootStyle, title: presentation.meaning, onClick: onSelect, "data-dcy-component": "address-risk-badge", "data-dcy-level": resolved, "data-dcy-tone": presentation.tone, children: content })] }));
|
|
23
|
+
}
|
|
24
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(primitives_1.StyleGate, { emit: emitStyles }), (0, jsx_runtime_1.jsx)("span", { className: rootClass, style: rootStyle, title: presentation.meaning, "data-dcy-component": "address-risk-badge", "data-dcy-level": resolved, "data-dcy-tone": presentation.tone, children: content })] }));
|
|
25
|
+
}
|
|
26
|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QACb,OAAO,CACL,6DACE,uBAAC,sBAAS,IAAC,IAAI,EAAE,UAAU,GAAI,EAC/B,mCACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,SAAS,EAChB,KAAK,EAAE,YAAY,CAAC,OAAO,EAC3B,OAAO,EAAE,QAAQ,wBACE,oBAAoB,oBACvB,QAAQ,mBACT,YAAY,CAAC,IAAI,YAE/B,OAAO,GACD,IACR,CACJ,CAAC;IACJ,CAAC;IAED,OAAO,CACL,6DACE,uBAAC,sBAAS,IAAC,IAAI,EAAE,UAAU,GAAI,EAC/B,iCACE,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,SAAS,EAChB,KAAK,EAAE,YAAY,CAAC,OAAO,wBACR,oBAAoB,oBACvB,QAAQ,mBACT,YAAY,CAAC,IAAI,YAE/B,OAAO,GACH,IACN,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The approval screen's component.
|
|
3
|
+
*
|
|
4
|
+
* The bar this has to clear is the one Stage 5 of the plan set: it shows
|
|
5
|
+
* "unlimited approval requested", not "scam detected". An unlimited allowance
|
|
6
|
+
* is a *scope*, and describing that scope precisely — who, over what, for how
|
|
7
|
+
* long, and that it survives until revoked — is more useful than any verdict,
|
|
8
|
+
* because it is the part a person can actually act on.
|
|
9
|
+
*
|
|
10
|
+
* So the scope block renders in the capability tone, never the threat tone,
|
|
11
|
+
* at any allowance size. Threat signals about the spender appear too, in their
|
|
12
|
+
* own section, looking nothing like the scope block. If those two ever merged
|
|
13
|
+
* visually, an unlimited approval to a perfectly ordinary DEX router would
|
|
14
|
+
* look identical to one to a confirmed drainer.
|
|
15
|
+
*/
|
|
16
|
+
import { type ReactNode } from 'react';
|
|
17
|
+
import type { ProtectResult } from '@decentrys/protect';
|
|
18
|
+
import { type CommonProps } from '../primitives';
|
|
19
|
+
import { type ApprovalDetails } from '../presentation';
|
|
20
|
+
export interface ApprovalWarningProps extends CommonProps {
|
|
21
|
+
result: ProtectResult;
|
|
22
|
+
/** The allowance itself: token, spender and amount. */
|
|
23
|
+
approval: ApprovalDetails;
|
|
24
|
+
/** The integrator's own controls. Rendered untouched and never disabled. */
|
|
25
|
+
actions?: ReactNode;
|
|
26
|
+
onViewDetails?: () => void;
|
|
27
|
+
}
|
|
28
|
+
export declare function ApprovalWarning({ result, approval, actions, onViewDetails, className, style, theme, copy: copyOverrides, levelLabels, }: ApprovalWarningProps): ReactNode;
|
|
29
|
+
//# sourceMappingURL=ApprovalWarning.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApprovalWarning.d.ts","sourceRoot":"","sources":["../../src/components/ApprovalWarning.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD,OAAO,EACmB,KAAK,WAAW,EAEzC,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,KAAK,eAAe,EAErB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,oBAAqB,SAAQ,WAAW;IACvD,MAAM,EAAE,aAAa,CAAC;IACtB,uDAAuD;IACvD,QAAQ,EAAE,eAAe,CAAC;IAC1B,4EAA4E;IAC5E,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED,wBAAgB,eAAe,CAAC,EAC9B,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EACxC,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,GAC1D,EAAE,oBAAoB,GAAG,SAAS,CAsGlC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApprovalWarning = ApprovalWarning;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const context_1 = require("../context");
|
|
6
|
+
const theme_1 = require("../theme");
|
|
7
|
+
const primitives_1 = require("../primitives");
|
|
8
|
+
const presentation_1 = require("../presentation");
|
|
9
|
+
function ApprovalWarning({ result, approval, actions, onViewDetails, className, style, theme, copy: copyOverrides, levelLabels, }) {
|
|
10
|
+
const { copy, theme: mergedTheme, emitStyles } = (0, context_1.useUiConfig)({ theme, copy: copyOverrides });
|
|
11
|
+
const { assessment, decision, demotedSignals } = result;
|
|
12
|
+
const level = (0, presentation_1.levelPresentation)(assessment.riskLevel, { labels: levelLabels });
|
|
13
|
+
const scope = (0, presentation_1.approvalPresentation)(approval);
|
|
14
|
+
const sections = (0, presentation_1.assessmentSections)(assessment, copy);
|
|
15
|
+
const policy = (0, presentation_1.decisionPresentation)(decision);
|
|
16
|
+
return ((0, jsx_runtime_1.jsxs)("section", { className: (0, primitives_1.cx)('dcy', 'dcy-card', className), style: (0, theme_1.themeStyle)(mergedTheme, style), "data-dcy-component": "approval-warning", "data-dcy-level": assessment.riskLevel, "data-dcy-tone": level.tone, "data-dcy-unlimited": String(scope.unlimited), role: level.liveRegionRole, "aria-label": `${scope.scopeLabel}. ${level.ariaLabel}`, children: [(0, jsx_runtime_1.jsx)(primitives_1.StyleGate, { emit: emitStyles }), (0, jsx_runtime_1.jsx)(primitives_1.LevelHeader, { assessment: assessment, copy: copy, levelLabels: levelLabels }), (0, jsx_runtime_1.jsx)(primitives_1.AvailabilityNote, { assessment: assessment }), (0, jsx_runtime_1.jsxs)(primitives_1.Section, { title: copy.approvalHeading, children: [(0, jsx_runtime_1.jsxs)("div", { className: "dcy-row", "data-dcy-kind": "capability", "data-dcy-tone": scope.tone, "data-dcy-rule": "dashed", children: [(0, jsx_runtime_1.jsx)("span", { className: "dcy-glyph", "aria-hidden": "true", children: "\u25C7" }), (0, jsx_runtime_1.jsxs)("div", { className: "dcy-row-body", children: [(0, jsx_runtime_1.jsxs)("p", { className: (0, primitives_1.cx)('dcy-row-statement', scope.emphasis === 'strong' && 'dcy-row-strong'), children: [(0, jsx_runtime_1.jsx)(primitives_1.Chip, { children: scope.scopeLabel }), " ", scope.statement] }), (0, jsx_runtime_1.jsx)("p", { className: "dcy-note", children: copy.approvalRevocation })] })] }), (0, jsx_runtime_1.jsxs)("dl", { className: "dcy-kv", children: [(0, jsx_runtime_1.jsx)("dt", { children: copy.spenderLabel }), (0, jsx_runtime_1.jsxs)("dd", { children: [(0, jsx_runtime_1.jsx)(primitives_1.Mono, { children: approval.spender }), approval.spenderLabel ? ` — ${approval.spenderLabel}` : null] }), (0, jsx_runtime_1.jsx)("dt", { children: copy.tokenLabel }), (0, jsx_runtime_1.jsxs)("dd", { children: [(0, jsx_runtime_1.jsx)(primitives_1.Mono, { children: approval.token }), approval.symbol ? ` — ${approval.symbol}` : null] }), (0, jsx_runtime_1.jsx)("dt", { children: "Amount" }), (0, jsx_runtime_1.jsx)("dd", { children: scope.amountLabel })] })] }), (0, jsx_runtime_1.jsx)(primitives_1.Section, { title: copy.signalsHeading, children: (0, jsx_runtime_1.jsx)(primitives_1.SignalList, { signals: [...sections.activeSignals, ...sections.inertSignals], copy: copy, subjectNoun: "spender" }) }), sections.unknowns.length > 0 ? ((0, jsx_runtime_1.jsx)(primitives_1.Section, { title: copy.unknownsHeading, note: copy.unknownsAreNotRisk, children: (0, jsx_runtime_1.jsx)("ul", { className: "dcy-list", children: sections.unknowns.map((unknown) => ((0, jsx_runtime_1.jsx)(primitives_1.UnknownRow, { unknown: unknown, copy: copy }, unknown.field))) }) })) : null, (0, jsx_runtime_1.jsx)(primitives_1.HistoryNote, { status: assessment.historyStatus, copy: copy }), demotedSignals && demotedSignals.length > 0 ? ((0, jsx_runtime_1.jsxs)(primitives_1.EmptyNote, { children: [copy.demotedHeading, ": ", demotedSignals.join(', '), ". ", copy.demotedExplanation] })) : null, (0, jsx_runtime_1.jsxs)("p", { className: "dcy-note", "data-dcy-decision": policy.action, children: [(0, jsx_runtime_1.jsx)("span", { className: "dcy-chip", children: policy.label }), " ", policy.statement] }), onViewDetails || actions ? ((0, jsx_runtime_1.jsxs)("div", { className: "dcy-head", children: [onViewDetails ? ((0, jsx_runtime_1.jsx)("button", { type: "button", className: "dcy-btn dcy-btn-quiet", onClick: onViewDetails, children: copy.viewDetails })) : null, actions] })) : null] }));
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=ApprovalWarning.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApprovalWarning.js","sourceRoot":"","sources":["../../src/components/ApprovalWarning.tsx"],"names":[],"mappings":";;AAsCA,0CAyGC;;AA7HD,wCAAyC;AACzC,oCAAsC;AACtC,8CAGuB;AACvB,kDAGyB;AAWzB,SAAgB,eAAe,CAAC,EAC9B,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EACxC,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,GACpC;IACrB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,IAAA,qBAAW,EAAC,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,CAAC;IAC7F,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC;IACxD,MAAM,KAAK,GAAG,IAAA,gCAAiB,EAAC,UAAU,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC;IAC/E,MAAM,KAAK,GAAG,IAAA,mCAAoB,EAAC,QAAQ,CAAC,CAAC;IAC7C,MAAM,QAAQ,GAAG,IAAA,iCAAkB,EAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IACtD,MAAM,MAAM,GAAG,IAAA,mCAAoB,EAAC,QAAQ,CAAC,CAAC;IAE9C,OAAO,CACL,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,CAAC,IAAI,EAER,+BAAG,SAAS,EAAC,UAAU,uBAAoB,MAAM,CAAC,MAAM,aACtD,iCAAM,SAAS,EAAC,UAAU,YAAE,MAAM,CAAC,KAAK,GAAQ,OAAE,MAAM,CAAC,SAAS,IAChE,EAEH,aAAa,IAAI,OAAO,CAAC,CAAC,CAAC,CAC1B,iCAAK,SAAS,EAAC,UAAU,aACtB,aAAa,CAAC,CAAC,CAAC,CACf,mCAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,uBAAuB,EAAC,OAAO,EAAE,aAAa,YAC3E,IAAI,CAAC,WAAW,GACV,CACV,CAAC,CAAC,CAAC,IAAI,EACP,OAAO,IACJ,CACP,CAAC,CAAC,CAAC,IAAI,IACA,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a contract is and what it can do — and nothing about what it might be
|
|
3
|
+
* accused of.
|
|
4
|
+
*
|
|
5
|
+
* The separation is the point. This component renders facts, capabilities and
|
|
6
|
+
* unknowns; threat signals are rendered by `ThreatSignalList`, in a visually
|
|
7
|
+
* different shape, because "deployed 3 days ago" and "attributed to a drainer
|
|
8
|
+
* family" appearing as two grey rows in the same list is exactly the confusion
|
|
9
|
+
* this product exists to remove.
|
|
10
|
+
*
|
|
11
|
+
* It does not therefore *hide* signals. When the assessment carries any, this
|
|
12
|
+
* component says how many and that they are shown separately, so nobody
|
|
13
|
+
* embeds this panel alone and unwittingly presents a partial picture.
|
|
14
|
+
*/
|
|
15
|
+
import { type ReactNode } from 'react';
|
|
16
|
+
import type { Assessment } from '@decentrys/protect';
|
|
17
|
+
import { type CommonProps } from '../primitives';
|
|
18
|
+
export interface ContractFactsProps extends CommonProps {
|
|
19
|
+
assessment: Assessment;
|
|
20
|
+
/** Coverage signals the SDK refused to score, from `ProtectResult`. */
|
|
21
|
+
demotedSignals?: string[];
|
|
22
|
+
/** Called when a reader asks to see the threat signals shown elsewhere. */
|
|
23
|
+
onViewSignals?: () => void;
|
|
24
|
+
title?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function ContractFacts({ assessment, demotedSignals, onViewSignals, title, className, style, theme, copy: copyOverrides, }: ContractFactsProps): ReactNode;
|
|
27
|
+
//# sourceMappingURL=ContractFacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContractFacts.d.ts","sourceRoot":"","sources":["../../src/components/ContractFacts.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGrD,OAAO,EAC4B,KAAK,WAAW,EAElD,MAAM,eAAe,CAAC;AAGvB,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD,UAAU,EAAE,UAAU,CAAC;IACvB,uEAAuE;IACvE,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,2EAA2E;IAC3E,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,aAAa,CAAC,EAC5B,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,KAAK,EAChD,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,GAC7C,EAAE,kBAAkB,GAAG,SAAS,CAiFhC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ContractFacts = ContractFacts;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const context_1 = require("../context");
|
|
6
|
+
const theme_1 = require("../theme");
|
|
7
|
+
const primitives_1 = require("../primitives");
|
|
8
|
+
const presentation_1 = require("../presentation");
|
|
9
|
+
function ContractFacts({ assessment, demotedSignals, onViewSignals, title, className, style, theme, copy: copyOverrides, }) {
|
|
10
|
+
const { copy, theme: mergedTheme, emitStyles } = (0, context_1.useUiConfig)({ theme, copy: copyOverrides });
|
|
11
|
+
const sections = (0, presentation_1.assessmentSections)(assessment, copy);
|
|
12
|
+
const signalCount = sections.activeSignals.length + sections.inertSignals.length;
|
|
13
|
+
return ((0, jsx_runtime_1.jsxs)("section", { className: (0, primitives_1.cx)('dcy', 'dcy-card', className), style: (0, theme_1.themeStyle)(mergedTheme, style), "data-dcy-component": "contract-facts", "aria-label": title ?? 'Contract facts and capabilities', children: [(0, jsx_runtime_1.jsx)(primitives_1.StyleGate, { emit: emitStyles }), title ? (0, jsx_runtime_1.jsx)("h3", { className: "dcy-title", children: title }) : null, (0, jsx_runtime_1.jsx)(primitives_1.AvailabilityNote, { assessment: assessment }), (0, jsx_runtime_1.jsx)(primitives_1.Section, { title: copy.capabilitiesHeading, note: copy.capabilitiesAreNotFindings, children: sections.capabilities.length === 0 ? ((0, jsx_runtime_1.jsx)(primitives_1.EmptyNote, { children: copy.noCapabilities })) : ((0, jsx_runtime_1.jsx)("ul", { className: "dcy-list", children: sections.capabilities.map((capability, index) => ((0, jsx_runtime_1.jsx)(primitives_1.CapabilityRow, { capability: capability, copy: copy }, `${capability.type}:${index}`))) })) }), (0, jsx_runtime_1.jsx)(primitives_1.Section, { title: copy.factsHeading, note: copy.factsAreNotFindings, children: sections.facts.length === 0 ? ((0, jsx_runtime_1.jsx)(primitives_1.EmptyNote, { children: copy.noFacts })) : ((0, jsx_runtime_1.jsx)("ul", { className: "dcy-list", children: sections.facts.map((fact, index) => ((0, jsx_runtime_1.jsx)(primitives_1.FactRow, { fact: fact, copy: copy }, `${fact.type}:${index}`))) })) }), (0, jsx_runtime_1.jsx)(primitives_1.Section, { title: copy.unknownsHeading, note: copy.unknownsAreNotRisk, children: sections.unknowns.length === 0 ? ((0, jsx_runtime_1.jsx)(primitives_1.EmptyNote, { children: copy.noUnknowns })) : ((0, jsx_runtime_1.jsx)("ul", { className: "dcy-list", children: sections.unknowns.map((unknown) => ((0, jsx_runtime_1.jsx)(primitives_1.UnknownRow, { unknown: unknown, copy: copy }, unknown.field))) })) }), (0, jsx_runtime_1.jsx)(primitives_1.HistoryNote, { status: assessment.historyStatus, copy: copy }), (0, jsx_runtime_1.jsx)(primitives_1.DemotedNote, { demotedSignals: demotedSignals, copy: copy }), signalCount > 0 ? ((0, jsx_runtime_1.jsxs)("p", { className: "dcy-note", "data-dcy-signals-elsewhere": "", children: [signalCount, " ", (0, presentation_1.plural)(signalCount, 'threat signal is', 'threat signals are'), " reported for this subject and ", (0, presentation_1.plural)(signalCount, 'is', 'are'), " shown separately.", onViewSignals ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [' ', (0, jsx_runtime_1.jsx)("button", { type: "button", className: "dcy-btn dcy-btn-quiet", onClick: onViewSignals, children: copy.signalsHeading })] })) : null] })) : ((0, jsx_runtime_1.jsx)("p", { className: "dcy-note", children: copy.noSignals }))] }));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=ContractFacts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContractFacts.js","sourceRoot":"","sources":["../../src/components/ContractFacts.tsx"],"names":[],"mappings":";;AAkCA,sCAoFC;;AArGD,wCAAyC;AACzC,oCAAsC;AACtC,8CAGuB;AACvB,kDAA6D;AAW7D,SAAgB,aAAa,CAAC,EAC5B,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,KAAK,EAChD,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,GACzB;IACnB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,IAAA,qBAAW,EAAC,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,CAAC;IAC7F,MAAM,QAAQ,GAAG,IAAA,iCAAkB,EAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IACtD,MAA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EAAC,uBAAuB,EAAC,OAAO,EAAE,aAAa,YAC3E,IAAI,CAAC,cAAc,GACb,IACR,CACJ,CAAC,CAAC,CAAC,IAAI,IACN,CACL,CAAC,CAAC,CAAC,CACF,8BAAG,SAAS,EAAC,UAAU,YAAE,IAAI,CAAC,SAAS,GAAK,CAC7C,IACO,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Why?" — answered completely.
|
|
3
|
+
*
|
|
4
|
+
* Everything the banner had to summarise is here in full: every explanation
|
|
5
|
+
* line, every fact with its source and timestamp, every capability, every
|
|
6
|
+
* signal including the ones that did not count, every evidence item with the
|
|
7
|
+
* source that produced it and whether an analyst confirmed it, every unknown,
|
|
8
|
+
* the score components with coverage labelled as coverage, and the model
|
|
9
|
+
* version the classification came from.
|
|
10
|
+
*
|
|
11
|
+
* This is the component that makes "nothing unexplained" true rather than
|
|
12
|
+
* aspirational. If a user disagrees with an assessment, this dialog is where
|
|
13
|
+
* they find the specific claim to disagree with.
|
|
14
|
+
*
|
|
15
|
+
* Accessibility here is functional, not decorative: the dialog takes focus on
|
|
16
|
+
* open and returns it on close, Escape closes it, the backdrop closes it, and
|
|
17
|
+
* it is labelled by its own heading. A modal that traps a wallet user with no
|
|
18
|
+
* keyboard route out is a worse bug than anything it was going to explain.
|
|
19
|
+
*/
|
|
20
|
+
import { type ReactNode } from 'react';
|
|
21
|
+
import type { ProtectResult } from '@decentrys/protect';
|
|
22
|
+
import { type CommonProps } from '../primitives';
|
|
23
|
+
export interface RiskDetailsModalProps extends CommonProps {
|
|
24
|
+
result: ProtectResult;
|
|
25
|
+
open: boolean;
|
|
26
|
+
onClose: () => void;
|
|
27
|
+
subjectNoun?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Render into `document.body` rather than in place. Disable it for a shadow
|
|
30
|
+
* root, a React Native-style renderer or a server render.
|
|
31
|
+
*/
|
|
32
|
+
portal?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare function RiskDetailsModal({ result, open, onClose, subjectNoun, portal, className, style, theme, copy: copyOverrides, levelLabels, }: RiskDetailsModalProps): ReactNode;
|
|
35
|
+
//# sourceMappingURL=RiskDetailsModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RiskDetailsModal.d.ts","sourceRoot":"","sources":["../../src/components/RiskDetailsModal.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD,OAAO,EAC4B,KAAK,WAAW,EAElD,MAAM,eAAe,CAAC;AAMvB,MAAM,WAAW,qBAAsB,SAAQ,WAAW;IACxD,MAAM,EAAE,aAAa,CAAC;IACtB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,WAAuB,EAAE,MAAa,EAC7D,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,GAC1D,EAAE,qBAAqB,GAAG,SAAS,CAqKnC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RiskDetailsModal = RiskDetailsModal;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
/**
|
|
6
|
+
* "Why?" — answered completely.
|
|
7
|
+
*
|
|
8
|
+
* Everything the banner had to summarise is here in full: every explanation
|
|
9
|
+
* line, every fact with its source and timestamp, every capability, every
|
|
10
|
+
* signal including the ones that did not count, every evidence item with the
|
|
11
|
+
* source that produced it and whether an analyst confirmed it, every unknown,
|
|
12
|
+
* the score components with coverage labelled as coverage, and the model
|
|
13
|
+
* version the classification came from.
|
|
14
|
+
*
|
|
15
|
+
* This is the component that makes "nothing unexplained" true rather than
|
|
16
|
+
* aspirational. If a user disagrees with an assessment, this dialog is where
|
|
17
|
+
* they find the specific claim to disagree with.
|
|
18
|
+
*
|
|
19
|
+
* Accessibility here is functional, not decorative: the dialog takes focus on
|
|
20
|
+
* open and returns it on close, Escape closes it, the backdrop closes it, and
|
|
21
|
+
* it is labelled by its own heading. A modal that traps a wallet user with no
|
|
22
|
+
* keyboard route out is a worse bug than anything it was going to explain.
|
|
23
|
+
*/
|
|
24
|
+
const react_1 = require("react");
|
|
25
|
+
const react_dom_1 = require("react-dom");
|
|
26
|
+
const context_1 = require("../context");
|
|
27
|
+
const theme_1 = require("../theme");
|
|
28
|
+
const primitives_1 = require("../primitives");
|
|
29
|
+
const presentation_1 = require("../presentation");
|
|
30
|
+
function RiskDetailsModal({ result, open, onClose, subjectNoun = 'address', portal = true, className, style, theme, copy: copyOverrides, levelLabels, }) {
|
|
31
|
+
const { copy, theme: mergedTheme, emitStyles } = (0, context_1.useUiConfig)({ theme, copy: copyOverrides });
|
|
32
|
+
const titleId = (0, react_1.useId)();
|
|
33
|
+
const dialogRef = (0, react_1.useRef)(null);
|
|
34
|
+
const restoreFocusTo = (0, react_1.useRef)(null);
|
|
35
|
+
(0, react_1.useEffect)(() => {
|
|
36
|
+
if (!open)
|
|
37
|
+
return undefined;
|
|
38
|
+
restoreFocusTo.current = typeof document === 'undefined' ? null : document.activeElement;
|
|
39
|
+
dialogRef.current?.focus();
|
|
40
|
+
const onKeyDown = (event) => {
|
|
41
|
+
if (event.key === 'Escape') {
|
|
42
|
+
event.stopPropagation();
|
|
43
|
+
onClose();
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
document.addEventListener('keydown', onKeyDown);
|
|
47
|
+
return () => {
|
|
48
|
+
document.removeEventListener('keydown', onKeyDown);
|
|
49
|
+
// Returning focus is the half of this that is usually skipped, and the
|
|
50
|
+
// half a keyboard user actually notices.
|
|
51
|
+
const previous = restoreFocusTo.current;
|
|
52
|
+
if (previous instanceof HTMLElement)
|
|
53
|
+
previous.focus();
|
|
54
|
+
};
|
|
55
|
+
}, [open, onClose]);
|
|
56
|
+
if (!open)
|
|
57
|
+
return null;
|
|
58
|
+
const { assessment, subject, decision, cached, demotedSignals } = result;
|
|
59
|
+
const level = (0, presentation_1.levelPresentation)(assessment.riskLevel, { labels: levelLabels });
|
|
60
|
+
const sections = (0, presentation_1.assessmentSections)(assessment, copy);
|
|
61
|
+
const policy = (0, presentation_1.decisionPresentation)(decision);
|
|
62
|
+
const dialog = ((0, jsx_runtime_1.jsxs)("div", { className: (0, primitives_1.cx)('dcy', 'dcy-backdrop'), style: (0, theme_1.themeStyle)(mergedTheme), "data-dcy-component": "risk-details-modal", onClick: (event) => {
|
|
63
|
+
if (event.target === event.currentTarget)
|
|
64
|
+
onClose();
|
|
65
|
+
}, children: [(0, jsx_runtime_1.jsx)(primitives_1.StyleGate, { emit: emitStyles }), (0, jsx_runtime_1.jsxs)("div", { ref: dialogRef, role: "dialog", "aria-modal": "true", "aria-labelledby": titleId, tabIndex: -1, className: (0, primitives_1.cx)('dcy-modal', className), style: style, "data-dcy-level": assessment.riskLevel, "data-dcy-tone": level.tone, children: [(0, jsx_runtime_1.jsxs)("div", { className: "dcy-modal-head", children: [(0, jsx_runtime_1.jsx)("h2", { className: "dcy-title", id: titleId, children: copy.detailsTitle }), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "dcy-btn", onClick: onClose, children: copy.close })] }), (0, jsx_runtime_1.jsxs)("div", { className: "dcy-head", children: [(0, jsx_runtime_1.jsxs)("div", { className: "dcy-head-main", children: [(0, jsx_runtime_1.jsx)("h3", { className: "dcy-title", children: level.label }), (0, jsx_runtime_1.jsx)("p", { className: "dcy-meaning", children: level.meaning })] }), (0, jsx_runtime_1.jsx)(primitives_1.LevelBadge, { level: level })] }), (0, jsx_runtime_1.jsxs)("dl", { className: "dcy-kv", children: [(0, jsx_runtime_1.jsx)("dt", { children: "Subject" }), (0, jsx_runtime_1.jsx)("dd", { children: (0, jsx_runtime_1.jsx)(primitives_1.Mono, { children: subject.identifier }) }), (0, jsx_runtime_1.jsx)("dt", { children: "Chain" }), (0, jsx_runtime_1.jsx)("dd", { children: subject.chain }), (0, jsx_runtime_1.jsx)("dt", { children: "Kind" }), (0, jsx_runtime_1.jsx)("dd", { children: subject.kind }), (0, jsx_runtime_1.jsx)("dt", { children: copy.confidenceLabel }), (0, jsx_runtime_1.jsxs)("dd", { children: [(0, presentation_1.formatConfidence)(assessment.confidence), " \u2014 ", copy.confidenceCaveat] }), (0, jsx_runtime_1.jsx)("dt", { children: copy.modelLabel }), (0, jsx_runtime_1.jsx)("dd", { children: (0, jsx_runtime_1.jsx)(primitives_1.Mono, { children: assessment.modelVersion }) }), (0, jsx_runtime_1.jsx)("dt", { children: copy.assessedLabel }), (0, jsx_runtime_1.jsx)("dd", { children: (0, presentation_1.formatTimestamp)(assessment.assessedAt) })] }), (0, jsx_runtime_1.jsx)(primitives_1.AvailabilityNote, { assessment: assessment }), (0, jsx_runtime_1.jsx)(primitives_1.Section, { title: "Why this level", children: (0, jsx_runtime_1.jsx)(primitives_1.ExplanationList, { explanation: assessment.explanation }) }), sections.isEmpty ? (0, jsx_runtime_1.jsx)(primitives_1.EmptyNote, { children: sections.emptyStatement }) : null, (0, jsx_runtime_1.jsx)(primitives_1.Section, { title: copy.signalsHeading, children: (0, jsx_runtime_1.jsx)(primitives_1.SignalList, { signals: [...sections.activeSignals, ...sections.inertSignals], copy: copy, subjectNoun: subjectNoun, showEvidence: true }) }), (0, jsx_runtime_1.jsx)(primitives_1.Section, { title: copy.capabilitiesHeading, note: copy.capabilitiesAreNotFindings, children: sections.capabilities.length === 0 ? ((0, jsx_runtime_1.jsx)(primitives_1.EmptyNote, { children: copy.noCapabilities })) : ((0, jsx_runtime_1.jsx)("ul", { className: "dcy-list", children: sections.capabilities.map((capability, index) => ((0, jsx_runtime_1.jsx)(primitives_1.CapabilityRow, { capability: capability, copy: copy }, `${capability.type}:${index}`))) })) }), (0, jsx_runtime_1.jsx)(primitives_1.Section, { title: copy.factsHeading, note: copy.factsAreNotFindings, children: sections.facts.length === 0 ? ((0, jsx_runtime_1.jsx)(primitives_1.EmptyNote, { children: copy.noFacts })) : ((0, jsx_runtime_1.jsx)("ul", { className: "dcy-list", children: sections.facts.map((fact, index) => ((0, jsx_runtime_1.jsx)(primitives_1.FactRow, { fact: fact, copy: copy }, `${fact.type}:${index}`))) })) }), (0, jsx_runtime_1.jsx)(primitives_1.Section, { title: copy.unknownsHeading, note: copy.unknownsAreNotRisk, children: sections.unknowns.length === 0 ? ((0, jsx_runtime_1.jsx)(primitives_1.EmptyNote, { children: copy.noUnknowns })) : ((0, jsx_runtime_1.jsx)("ul", { className: "dcy-list", children: sections.unknowns.map((unknown) => ((0, jsx_runtime_1.jsx)(primitives_1.UnknownRow, { unknown: unknown, copy: copy }, unknown.field))) })) }), (0, jsx_runtime_1.jsx)(primitives_1.Section, { title: copy.historyHeading, children: (0, jsx_runtime_1.jsx)(primitives_1.HistoryNote, { status: assessment.historyStatus, copy: copy }) }), (0, jsx_runtime_1.jsx)(primitives_1.Section, { title: copy.componentsHeading, children: (0, jsx_runtime_1.jsx)("dl", { className: "dcy-kv", children: (0, presentation_1.componentRows)(assessment.components, copy).map((row) => ((0, jsx_runtime_1.jsx)(ComponentEntry, { label: row.label, value: row.value, caveat: row.caveat }, row.key))) }) }), (0, jsx_runtime_1.jsx)(primitives_1.DemotedNote, { demotedSignals: demotedSignals, copy: copy }), (0, jsx_runtime_1.jsx)("hr", { className: "dcy-hr" }), (0, jsx_runtime_1.jsxs)("p", { className: "dcy-note", "data-dcy-decision": policy.action, children: [(0, jsx_runtime_1.jsx)("span", { className: "dcy-chip", children: policy.label }), " ", policy.statement, " ", copy.policyIsYours] }), cached ? (0, jsx_runtime_1.jsx)("p", { className: "dcy-note", children: copy.cachedNotice }) : null] })] }));
|
|
66
|
+
if (portal && typeof document !== 'undefined') {
|
|
67
|
+
return (0, react_dom_1.createPortal)(dialog, document.body);
|
|
68
|
+
}
|
|
69
|
+
return dialog;
|
|
70
|
+
}
|
|
71
|
+
function ComponentEntry({ label, value, caveat, }) {
|
|
72
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("dt", { children: label }), (0, jsx_runtime_1.jsxs)("dd", { children: [Math.round(value), " / 100", caveat ? (0, jsx_runtime_1.jsxs)("span", { className: "dcy-note", children: [" ", caveat] }) : null] })] }));
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=RiskDetailsModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RiskDetailsModal.js","sourceRoot":"","sources":["../../src/components/RiskDetailsModal.tsx"],"names":[],"mappings":";;AA8CA,4CAwKC;;AAtND;;;;;;;;;;;;;;;;;;GAkBG;AAEH,iCAAiE;AACjE,yCAAyC;AAEzC,wCAAyC;AACzC,oCAAsC;AACtC,8CAGuB;AACvB,kDAGyB;AAczB,SAAgB,gBAAgB,CAAC,EAC/B,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,GAAG,SAAS,EAAE,MAAM,GAAG,IAAI,EAC7D,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,GACnC;IACtB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,IAAA,qBAAW,EAAC,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,CAAC;IAC7F,MAAM,OAAO,GAAG,IAAA,aAAK,GAAE,CAAC;IACxB,MAAM,SAAS,GAAG,IAAA,cAAM,EAAwB,IAAI,CAAC,CAAC;IACtD,MAAM,c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,EAChB,2CACG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,YACjB,MAAM,CAAC,CAAC,CAAC,kCAAM,SAAS,EAAC,UAAU,kBAAG,MAAM,IAAQ,CAAC,CAAC,CAAC,IAAI,IACzD,IACJ,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Threat signals, with the reasons they do or do not count.
|
|
3
|
+
*
|
|
4
|
+
* Everything a signal carries is rendered: severity, confidence as a
|
|
5
|
+
* percentage rather than a word, hop distance as a sentence, status, and the
|
|
6
|
+
* evidence with its source and whether an analyst confirmed it. That is the
|
|
7
|
+
* "users should be shown why" half of the rule, and it is also what keeps the
|
|
8
|
+
* accusation honest — a claim rendered without its evidence is just a score.
|
|
9
|
+
*
|
|
10
|
+
* A signal that did not raise the level is still listed, and toned `inactive`
|
|
11
|
+
* with the reason attached. Dropping it would hide an observation; colouring
|
|
12
|
+
* it like one that counted would misstate the assessment.
|
|
13
|
+
*/
|
|
14
|
+
import { type ReactNode } from 'react';
|
|
15
|
+
import type { ThreatSignal } from '@decentrys/protect';
|
|
16
|
+
import { type CommonProps } from '../primitives';
|
|
17
|
+
export interface ThreatSignalListProps extends CommonProps {
|
|
18
|
+
signals: ThreatSignal[];
|
|
19
|
+
/** Used in hop wording: "an inference about a counterparty of this token". */
|
|
20
|
+
subjectNoun?: string;
|
|
21
|
+
/** Start with the evidence expanded. */
|
|
22
|
+
defaultShowEvidence?: boolean;
|
|
23
|
+
/** Remove the toggle and pin evidence to `defaultShowEvidence`. */
|
|
24
|
+
showEvidenceToggle?: boolean;
|
|
25
|
+
title?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare function ThreatSignalList({ signals, subjectNoun, defaultShowEvidence, showEvidenceToggle, title, className, style, theme, copy: copyOverrides, }: ThreatSignalListProps): ReactNode;
|
|
28
|
+
//# sourceMappingURL=ThreatSignalList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThreatSignalList.d.ts","sourceRoot":"","sources":["../../src/components/ThreatSignalList.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD,OAAO,EAAE,KAAK,WAAW,EAAiD,MAAM,eAAe,CAAC;AAEhG,MAAM,WAAW,qBAAsB,SAAQ,WAAW;IACxD,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wCAAwC;IACxC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,mEAAmE;IACnE,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,OAAO,EAAE,WAAuB,EAAE,mBAA2B,EAAE,kBAAyB,EAAE,KAAK,EAC/F,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,GAC7C,EAAE,qBAAqB,GAAG,SAAS,CAyCnC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ThreatSignalList = ThreatSignalList;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
/**
|
|
6
|
+
* Threat signals, with the reasons they do or do not count.
|
|
7
|
+
*
|
|
8
|
+
* Everything a signal carries is rendered: severity, confidence as a
|
|
9
|
+
* percentage rather than a word, hop distance as a sentence, status, and the
|
|
10
|
+
* evidence with its source and whether an analyst confirmed it. That is the
|
|
11
|
+
* "users should be shown why" half of the rule, and it is also what keeps the
|
|
12
|
+
* accusation honest — a claim rendered without its evidence is just a score.
|
|
13
|
+
*
|
|
14
|
+
* A signal that did not raise the level is still listed, and toned `inactive`
|
|
15
|
+
* with the reason attached. Dropping it would hide an observation; colouring
|
|
16
|
+
* it like one that counted would misstate the assessment.
|
|
17
|
+
*/
|
|
18
|
+
const react_1 = require("react");
|
|
19
|
+
const context_1 = require("../context");
|
|
20
|
+
const theme_1 = require("../theme");
|
|
21
|
+
const primitives_1 = require("../primitives");
|
|
22
|
+
function ThreatSignalList({ signals, subjectNoun = 'address', defaultShowEvidence = false, showEvidenceToggle = true, title, className, style, theme, copy: copyOverrides, }) {
|
|
23
|
+
const { copy, theme: mergedTheme, emitStyles } = (0, context_1.useUiConfig)({ theme, copy: copyOverrides });
|
|
24
|
+
const [showEvidence, setShowEvidence] = (0, react_1.useState)(defaultShowEvidence);
|
|
25
|
+
const evidenceVisible = showEvidenceToggle ? showEvidence : defaultShowEvidence;
|
|
26
|
+
return ((0, jsx_runtime_1.jsxs)("section", { className: (0, primitives_1.cx)('dcy', 'dcy-card', className), style: (0, theme_1.themeStyle)(mergedTheme, style), "data-dcy-component": "threat-signal-list", "data-dcy-signal-count": String(signals.length), "aria-label": title ?? copy.signalsHeading, children: [(0, jsx_runtime_1.jsx)(primitives_1.StyleGate, { emit: emitStyles }), (0, jsx_runtime_1.jsx)(primitives_1.Section, { title: title ?? copy.signalsHeading, children: signals.length === 0 ? ((0, jsx_runtime_1.jsx)(primitives_1.EmptyNote, { children: copy.noSignals })) : ((0, jsx_runtime_1.jsx)(primitives_1.SignalList, { signals: signals, copy: copy, subjectNoun: subjectNoun, showEvidence: evidenceVisible })) }), signals.length > 0 && showEvidenceToggle ? ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("button", { type: "button", className: "dcy-btn dcy-btn-quiet", "aria-expanded": evidenceVisible, onClick: () => setShowEvidence((value) => !value), children: evidenceVisible ? copy.hideEvidence : copy.showEvidence }) })) : null] }));
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=ThreatSignalList.js.map
|
|
@@ -0,0 +1 @@
|
|
|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