@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.
Files changed (93) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +51 -0
  3. package/dist/browser/decentrys-ui.js +1733 -0
  4. package/dist/browser/decentrys-ui.mjs +1681 -0
  5. package/dist/browser/react-dom-global.d.ts +6 -0
  6. package/dist/browser/react-dom-global.d.ts.map +1 -0
  7. package/dist/browser/react-dom-global.js +18 -0
  8. package/dist/browser/react-dom-global.js.map +1 -0
  9. package/dist/browser/react-global.d.ts +25 -0
  10. package/dist/browser/react-global.d.ts.map +1 -0
  11. package/dist/browser/react-global.js +39 -0
  12. package/dist/browser/react-global.js.map +1 -0
  13. package/dist/browser/react-jsx-runtime.d.ts +17 -0
  14. package/dist/browser/react-jsx-runtime.d.ts.map +1 -0
  15. package/dist/browser/react-jsx-runtime.js +27 -0
  16. package/dist/browser/react-jsx-runtime.js.map +1 -0
  17. package/dist/components/AddressRiskBadge.d.ts +39 -0
  18. package/dist/components/AddressRiskBadge.d.ts.map +1 -0
  19. package/dist/components/AddressRiskBadge.js +26 -0
  20. package/dist/components/AddressRiskBadge.js.map +1 -0
  21. package/dist/components/ApprovalWarning.d.ts +29 -0
  22. package/dist/components/ApprovalWarning.d.ts.map +1 -0
  23. package/dist/components/ApprovalWarning.js +18 -0
  24. package/dist/components/ApprovalWarning.js.map +1 -0
  25. package/dist/components/ContractFacts.d.ts +27 -0
  26. package/dist/components/ContractFacts.d.ts.map +1 -0
  27. package/dist/components/ContractFacts.js +15 -0
  28. package/dist/components/ContractFacts.js.map +1 -0
  29. package/dist/components/RiskDetailsModal.d.ts +35 -0
  30. package/dist/components/RiskDetailsModal.d.ts.map +1 -0
  31. package/dist/components/RiskDetailsModal.js +74 -0
  32. package/dist/components/RiskDetailsModal.js.map +1 -0
  33. package/dist/components/ThreatSignalList.d.ts +28 -0
  34. package/dist/components/ThreatSignalList.d.ts.map +1 -0
  35. package/dist/components/ThreatSignalList.js +28 -0
  36. package/dist/components/ThreatSignalList.js.map +1 -0
  37. package/dist/components/TokenSecurityPanel.d.ts +28 -0
  38. package/dist/components/TokenSecurityPanel.d.ts.map +1 -0
  39. package/dist/components/TokenSecurityPanel.js +26 -0
  40. package/dist/components/TokenSecurityPanel.js.map +1 -0
  41. package/dist/components/TransactionRiskBanner.d.ts +36 -0
  42. package/dist/components/TransactionRiskBanner.d.ts.map +1 -0
  43. package/dist/components/TransactionRiskBanner.js +20 -0
  44. package/dist/components/TransactionRiskBanner.js.map +1 -0
  45. package/dist/context.d.ts +51 -0
  46. package/dist/context.d.ts.map +1 -0
  47. package/dist/context.js +47 -0
  48. package/dist/context.js.map +1 -0
  49. package/dist/copy.d.ts +72 -0
  50. package/dist/copy.d.ts.map +1 -0
  51. package/dist/copy.js +77 -0
  52. package/dist/copy.js.map +1 -0
  53. package/dist/index.d.ts +57 -0
  54. package/dist/index.d.ts.map +1 -0
  55. package/dist/index.js +107 -0
  56. package/dist/index.js.map +1 -0
  57. package/dist/presentation.d.ts +316 -0
  58. package/dist/presentation.d.ts.map +1 -0
  59. package/dist/presentation.js +533 -0
  60. package/dist/presentation.js.map +1 -0
  61. package/dist/primitives.d.ts +139 -0
  62. package/dist/primitives.d.ts.map +1 -0
  63. package/dist/primitives.js +150 -0
  64. package/dist/primitives.js.map +1 -0
  65. package/dist/styles.d.ts +15 -0
  66. package/dist/styles.d.ts.map +1 -0
  67. package/dist/styles.js +285 -0
  68. package/dist/styles.js.map +1 -0
  69. package/dist/theme.d.ts +52 -0
  70. package/dist/theme.d.ts.map +1 -0
  71. package/dist/theme.js +90 -0
  72. package/dist/theme.js.map +1 -0
  73. package/package.json +70 -0
  74. package/src/browser/react-dom-global.ts +20 -0
  75. package/src/browser/react-global.ts +42 -0
  76. package/src/browser/react-jsx-runtime.ts +23 -0
  77. package/src/components/AddressRiskBadge.tsx +94 -0
  78. package/src/components/ApprovalWarning.tsx +144 -0
  79. package/src/components/ContractFacts.tsx +119 -0
  80. package/src/components/RiskDetailsModal.tsx +229 -0
  81. package/src/components/ThreatSignalList.tsx +76 -0
  82. package/src/components/TokenSecurityPanel.tsx +168 -0
  83. package/src/components/TransactionRiskBanner.tsx +123 -0
  84. package/src/context.tsx +89 -0
  85. package/src/copy.test.ts +214 -0
  86. package/src/copy.ts +151 -0
  87. package/src/index.ts +84 -0
  88. package/src/presentation.test.ts +521 -0
  89. package/src/presentation.ts +846 -0
  90. package/src/primitives.tsx +384 -0
  91. package/src/styles.ts +281 -0
  92. package/src/theme.test.ts +105 -0
  93. package/src/theme.ts +117 -0
@@ -0,0 +1,28 @@
1
+ /**
2
+ * A token, described in full.
3
+ *
4
+ * The panel most likely to be embedded on a swap screen, and therefore the one
5
+ * most under pressure to become a green tick or a red cross. It is neither.
6
+ * The four buckets stay four buckets — capabilities, facts, threat signals,
7
+ * unknowns — each with its own heading, its own row shape and its own tone
8
+ * family, and the coverage figure is labelled as coverage rather than folded
9
+ * into anything that looks like a score.
10
+ *
11
+ * A token deployed this morning by an anonymous team with no audit renders
12
+ * here as a list of true statements and a `LIMITED` history note in ordinary
13
+ * body type. That is the whole argument, in one component.
14
+ */
15
+ import { type ReactNode } from 'react';
16
+ import type { ProtectResult } from '@decentrys/protect';
17
+ import { type CommonProps } from '../primitives';
18
+ export interface TokenSecurityPanelProps extends CommonProps {
19
+ result: ProtectResult;
20
+ /** Shown beside the address when the integrator already knows it. */
21
+ tokenName?: string;
22
+ tokenSymbol?: string;
23
+ onViewDetails?: () => void;
24
+ /** Hide the numeric components. They are for developers more than users. */
25
+ showComponents?: boolean;
26
+ }
27
+ export declare function TokenSecurityPanel({ result, tokenName, tokenSymbol, onViewDetails, showComponents, className, style, theme, copy: copyOverrides, levelLabels, }: TokenSecurityPanelProps): ReactNode;
28
+ //# sourceMappingURL=TokenSecurityPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TokenSecurityPanel.d.ts","sourceRoot":"","sources":["../../src/components/TokenSecurityPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD,OAAO,EACkC,KAAK,WAAW,EAExD,MAAM,eAAe,CAAC;AAGvB,MAAM,WAAW,uBAAwB,SAAQ,WAAW;IAC1D,MAAM,EAAE,aAAa,CAAC;IACtB,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,4EAA4E;IAC5E,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,cAAqB,EACpE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,GAC1D,EAAE,uBAAuB,GAAG,SAAS,CA6GrC"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TokenSecurityPanel = TokenSecurityPanel;
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 TokenSecurityPanel({ result, tokenName, tokenSymbol, onViewDetails, showComponents = true, className, style, theme, copy: copyOverrides, levelLabels, }) {
10
+ const { copy, theme: mergedTheme, emitStyles } = (0, context_1.useUiConfig)({ theme, copy: copyOverrides });
11
+ const { assessment, subject, decision, cached, demotedSignals } = result;
12
+ const level = (0, presentation_1.levelPresentation)(assessment.riskLevel, { labels: levelLabels });
13
+ const sections = (0, presentation_1.assessmentSections)(assessment, copy);
14
+ const policy = (0, presentation_1.decisionPresentation)(decision);
15
+ 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": "token-security-panel", "data-dcy-level": assessment.riskLevel, "data-dcy-tone": level.tone, "aria-label": 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.jsxs)("p", { className: "dcy-note", children: [tokenName || tokenSymbol ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(primitives_1.Chip, { children: tokenSymbol ?? tokenName }), ' ', tokenName && tokenSymbol ? `${tokenName} — ` : null] })) : null, (0, jsx_runtime_1.jsx)(primitives_1.Mono, { children: subject.identifier }), " on ", subject.chain] }), (0, jsx_runtime_1.jsx)(primitives_1.AvailabilityNote, { assessment: assessment }), (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.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.signalsHeading, children: (0, jsx_runtime_1.jsx)(primitives_1.SignalList, { signals: [...sections.activeSignals, ...sections.inertSignals], copy: copy, subjectNoun: "token" }) }), (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 }), showComponents ? ((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))) }) })) : null, (0, jsx_runtime_1.jsx)(primitives_1.DemotedNote, { demotedSignals: demotedSignals, copy: copy }), (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] }), cached ? (0, jsx_runtime_1.jsx)("p", { className: "dcy-note", children: copy.cachedNotice }) : null, onViewDetails ? ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("button", { type: "button", className: "dcy-btn dcy-btn-quiet", onClick: onViewDetails, children: copy.viewDetails }) })) : null] }));
16
+ }
17
+ /**
18
+ * `historyConfidence` arrives here labelled "Coverage" and carrying its own
19
+ * caveat, because the one thing that must never happen to it is being read as
20
+ * a fourth risk number. Low coverage means we know little; it says nothing
21
+ * about the subject.
22
+ */
23
+ function ComponentEntry({ label, value, caveat, }) {
24
+ 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] })] }));
25
+ }
26
+ //# sourceMappingURL=TokenSecurityPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TokenSecurityPanel.js","sourceRoot":"","sources":["../../src/components/TokenSecurityPanel.tsx"],"names":[],"mappings":";;AAmCA,gDAgHC;;AAlID,wCAAyC;AACzC,oCAAsC;AACtC,8CAGuB;AACvB,kDAA6G;AAY7G,SAAgB,kBAAkB,CAAC,EACjC,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,GAAG,IAAI,EACpE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,GACjC;IACxB,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,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC;IACzE,MAAM,KAAK,GAAG,IAAA,gCAAiB,EAAC,UAAU,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC;IAC/E,MAAM,QAAQ,GAAG,IAAA,iCAAkB,EAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IACtD,MAAM,MAAM,GAAG,IAAA,mCAAoB,EAAC,QAAQ,CAAC,CAAC;IAE9C,OAAO,CACL,qCACE,SAAS,EAAE,IAAA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A,CACX,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAS,cAAc,CAAC,EACtB,KAAK,EAAE,KAAK,EAAE,MAAM,GAC8B;IAClD,OAAO,CACL,6DACE,yCAAK,KAAK,GAAM,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,36 @@
1
+ /**
2
+ * The pre-signature banner.
3
+ *
4
+ * This is the component that will be seen the most, on the screen where a
5
+ * person is about to give away money, so it is also where the model is most
6
+ * easily betrayed. Three things it deliberately does not do:
7
+ *
8
+ * - It does not render a verdict. The level label and the model's own words
9
+ * for what that level means appear together, always, so "Informational"
10
+ * never has to be interpreted from a colour.
11
+ * - It does not hide what did not count. Signals below the confidence floor,
12
+ * stale signals and unknowns are reported with the reason they did not
13
+ * affect the assessment. Silence would read as "we checked and found
14
+ * nothing", which is a different and stronger claim.
15
+ * - It does not disable anything. `actions` is rendered as given; the
16
+ * integrator's policy decides what a user may do, and this banner's job
17
+ * ends at telling them why.
18
+ */
19
+ import { type ReactNode } from 'react';
20
+ import type { ProtectResult } from '@decentrys/protect';
21
+ import { type CommonProps } from '../primitives';
22
+ export interface TransactionRiskBannerProps extends CommonProps {
23
+ result: ProtectResult;
24
+ /** What the subject should be called in hop wording. */
25
+ subjectNoun?: string;
26
+ /**
27
+ * The integrator's own controls. Rendered untouched — this package never
28
+ * supplies, styles or disables a proceed button.
29
+ */
30
+ actions?: ReactNode;
31
+ onViewDetails?: () => void;
32
+ /** Inline explanation lines. The rest remain available in the details view. */
33
+ maxExplanationLines?: number;
34
+ }
35
+ export declare function TransactionRiskBanner({ result, subjectNoun, actions, onViewDetails, maxExplanationLines, className, style, theme, copy: copyOverrides, levelLabels, }: TransactionRiskBannerProps): ReactNode;
36
+ //# sourceMappingURL=TransactionRiskBanner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TransactionRiskBanner.d.ts","sourceRoot":"","sources":["../../src/components/TransactionRiskBanner.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD,OAAO,EACa,KAAK,WAAW,EAEnC,MAAM,eAAe,CAAC;AAGvB,MAAM,WAAW,0BAA2B,SAAQ,WAAW;IAC7D,MAAM,EAAE,aAAa,CAAC;IACtB,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,+EAA+E;IAC/E,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,wBAAgB,qBAAqB,CAAC,EACpC,MAAM,EAAE,WAA2B,EAAE,OAAO,EAAE,aAAa,EAAE,mBAAuB,EACpF,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,GAC1D,EAAE,0BAA0B,GAAG,SAAS,CA4ExC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TransactionRiskBanner = TransactionRiskBanner;
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 TransactionRiskBanner({ result, subjectNoun = 'transaction', actions, onViewDetails, maxExplanationLines = 4, className, style, theme, copy: copyOverrides, levelLabels, }) {
10
+ const { copy, theme: mergedTheme, emitStyles } = (0, context_1.useUiConfig)({ theme, copy: copyOverrides });
11
+ const { assessment, decision, cached, demotedSignals } = result;
12
+ const level = (0, presentation_1.levelPresentation)(assessment.riskLevel, { labels: levelLabels });
13
+ const sections = (0, presentation_1.assessmentSections)(assessment, copy);
14
+ const policy = (0, presentation_1.decisionPresentation)(decision);
15
+ 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": "transaction-risk-banner", "data-dcy-level": assessment.riskLevel, "data-dcy-tone": level.tone,
16
+ /* Only levels the classifier can reach on threat evidence interrupt a
17
+ screen reader. Nothing at INFORMATIONAL has earned that. */
18
+ role: level.liveRegionRole, "aria-label": 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.jsx)(primitives_1.ExplanationList, { explanation: assessment.explanation.slice(0, maxExplanationLines) }), sections.isEmpty ? (0, jsx_runtime_1.jsx)(primitives_1.EmptyNote, { children: sections.emptyStatement }) : ((0, jsx_runtime_1.jsx)("p", { className: "dcy-note", "data-dcy-summary": "", children: sections.summary })), sections.activeSignals.length > 0 ? ((0, jsx_runtime_1.jsx)(primitives_1.Section, { title: copy.signalsHeading, children: (0, jsx_runtime_1.jsx)(primitives_1.SignalList, { signals: sections.activeSignals, copy: copy, subjectNoun: subjectNoun }) })) : null, sections.inertSignals.length > 0 ? ((0, jsx_runtime_1.jsxs)(primitives_1.EmptyNote, { children: [sections.inertSignals.length, ' ', (0, presentation_1.plural)(sections.inertSignals.length, 'further signal was', 'further signals were'), ' ', "observed and did not affect this assessment. They are listed in full in the details."] })) : null, 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 }), (0, jsx_runtime_1.jsx)(primitives_1.DemotedNote, { demotedSignals: demotedSignals, copy: copy }), (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] }), cached ? (0, jsx_runtime_1.jsx)("p", { className: "dcy-note", children: copy.cachedNotice }) : null, 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] }));
19
+ }
20
+ //# sourceMappingURL=TransactionRiskBanner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TransactionRiskBanner.js","sourceRoot":"","sources":["../../src/components/TransactionRiskBanner.tsx"],"names":[],"mappings":";;AA2CA,sDA+EC;;AArGD,wCAAyC;AACzC,oCAAsC;AACtC,8CAGuB;AACvB,kDAAsG;AAgBtG,SAAgB,qBAAqB,CAAC,EACpC,MAAM,EAAE,WAAW,GAAG,aAAa,EAAE,OAAO,EAAE,aAAa,EAAE,mBAAmB,GAAG,CAAC,EACpF,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,GAC9B;IAC3B,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,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CA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AI,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,51 @@
1
+ /**
2
+ * Shared configuration, and where the stylesheet comes from.
3
+ *
4
+ * Every component works standalone — drop `<AddressRiskBadge>` into a page and
5
+ * it renders correctly with no provider, because it emits the stylesheet
6
+ * itself. Wrapping a tree in `<DecentrysUiProvider>` does two things: it sets
7
+ * theme and copy once for everything inside, and it emits the stylesheet a
8
+ * single time so the components inside stop emitting their own.
9
+ *
10
+ * The alternative — a module-level "have I injected yet" flag — is the pattern
11
+ * that breaks under server rendering and hydration, because the flag is set
12
+ * during the server pass and the client then renders a tree with no styles in
13
+ * it. A context read is correct in both passes.
14
+ */
15
+ import { type ReactNode } from 'react';
16
+ import { type UiCopy } from './copy';
17
+ import type { DecentrysTheme } from './theme';
18
+ /** The default stylesheet as a `<style>` element. Safe to render more than once. */
19
+ export declare function DecentrysUiStyles(): ReactNode;
20
+ export interface DecentrysUiProviderProps {
21
+ /** Token overrides applied to every component beneath. */
22
+ theme?: DecentrysTheme;
23
+ /** Copy overrides — including translation — applied to every component beneath. */
24
+ copy?: Partial<UiCopy>;
25
+ /**
26
+ * Set false when placing `DECENTRYS_UI_CSS` yourself, in a `<head>`, a
27
+ * bundled stylesheet or a shadow root. Components beneath still will not
28
+ * emit their own, because the provider has taken responsibility for it.
29
+ */
30
+ injectStyles?: boolean;
31
+ children?: ReactNode;
32
+ }
33
+ export declare function DecentrysUiProvider({ theme, copy, injectStyles, children, }: DecentrysUiProviderProps): ReactNode;
34
+ export interface UiConfigInput {
35
+ theme?: DecentrysTheme;
36
+ copy?: Partial<UiCopy>;
37
+ }
38
+ export interface ResolvedUiConfig {
39
+ theme?: DecentrysTheme;
40
+ copy: UiCopy;
41
+ /** True when this component must emit the stylesheet itself. */
42
+ emitStyles: boolean;
43
+ }
44
+ /**
45
+ * Merge provider configuration with a component's own props.
46
+ *
47
+ * The component's props win, so a single banner can be re-themed inside an
48
+ * otherwise uniform tree without unpicking the provider.
49
+ */
50
+ export declare function useUiConfig(local?: UiConfigInput): ResolvedUiConfig;
51
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAElE,OAAO,EAAe,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAU9C,oFAAoF;AACpF,wBAAgB,iBAAiB,IAAI,SAAS,CAE7C;AAED,MAAM,WAAW,wBAAwB;IACvC,0DAA0D;IAC1D,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,mFAAmF;IACnF,IAAI,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACvB;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,IAAI,EACJ,YAAmB,EACnB,QAAQ,GACT,EAAE,wBAAwB,GAAG,SAAS,CAOtC;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,GAAE,aAAkB,GAAG,gBAAgB,CASvE"}
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DecentrysUiStyles = DecentrysUiStyles;
4
+ exports.DecentrysUiProvider = DecentrysUiProvider;
5
+ exports.useUiConfig = useUiConfig;
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ /**
8
+ * Shared configuration, and where the stylesheet comes from.
9
+ *
10
+ * Every component works standalone — drop `<AddressRiskBadge>` into a page and
11
+ * it renders correctly with no provider, because it emits the stylesheet
12
+ * itself. Wrapping a tree in `<DecentrysUiProvider>` does two things: it sets
13
+ * theme and copy once for everything inside, and it emits the stylesheet a
14
+ * single time so the components inside stop emitting their own.
15
+ *
16
+ * The alternative — a module-level "have I injected yet" flag — is the pattern
17
+ * that breaks under server rendering and hydration, because the flag is set
18
+ * during the server pass and the client then renders a tree with no styles in
19
+ * it. A context read is correct in both passes.
20
+ */
21
+ const react_1 = require("react");
22
+ const styles_1 = require("./styles");
23
+ const copy_1 = require("./copy");
24
+ const UiContext = (0, react_1.createContext)(null);
25
+ /** The default stylesheet as a `<style>` element. Safe to render more than once. */
26
+ function DecentrysUiStyles() {
27
+ return (0, jsx_runtime_1.jsx)("style", { "data-decentrys-ui": "", children: styles_1.DECENTRYS_UI_CSS });
28
+ }
29
+ function DecentrysUiProvider({ theme, copy, injectStyles = true, children, }) {
30
+ return ((0, jsx_runtime_1.jsxs)(UiContext.Provider, { value: { theme, copy, stylesProvided: true }, children: [injectStyles ? (0, jsx_runtime_1.jsx)(DecentrysUiStyles, {}) : null, children] }));
31
+ }
32
+ /**
33
+ * Merge provider configuration with a component's own props.
34
+ *
35
+ * The component's props win, so a single banner can be re-themed inside an
36
+ * otherwise uniform tree without unpicking the provider.
37
+ */
38
+ function useUiConfig(local = {}) {
39
+ const ctx = (0, react_1.useContext)(UiContext);
40
+ const theme = ctx?.theme || local.theme ? { ...(ctx?.theme ?? {}), ...(local.theme ?? {}) } : undefined;
41
+ return {
42
+ theme,
43
+ copy: (0, copy_1.resolveCopy)({ ...(ctx?.copy ?? {}), ...(local.copy ?? {}) }),
44
+ emitStyles: !ctx?.stylesProvided,
45
+ };
46
+ }
47
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.tsx"],"names":[],"mappings":";;AA6BA,8CAEC;AAgBD,kDAYC;AAoBD,kCASC;;AAxFD;;;;;;;;;;;;;GAaG;AAEH,iCAAkE;AAClE,qCAA4C;AAC5C,iCAAkD;AASlD,MAAM,SAAS,GAAG,IAAA,qBAAa,EAAwB,IAAI,CAAC,CAAC;AAE7D,oFAAoF;AACpF,SAAgB,iBAAiB;IAC/B,OAAO,uDAAyB,EAAE,YAAE,yBAAgB,GAAS,CAAC;AAChE,CAAC;AAgBD,SAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,IAAI,EACJ,YAAY,GAAG,IAAI,EACnB,QAAQ,GACiB;IACzB,OAAO,CACL,wBAAC,SAAS,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAC7D,YAAY,CAAC,CAAC,CAAC,uBAAC,iBAAiB,KAAG,CAAC,CAAC,CAAC,IAAI,EAC3C,QAAQ,IACU,CACtB,CAAC;AACJ,CAAC;AAcD;;;;;GAKG;AACH,SAAgB,WAAW,CAAC,QAAuB,EAAE;IACnD,MAAM,GAAG,GAAG,IAAA,kBAAU,EAAC,SAAS,CAAC,CAAC;IAClC,MAAM,KAAK,GACT,GAAG,EAAE,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,KAAK,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IAC5F,OAAO;QACL,KAAK;QACL,IAAI,EAAE,IAAA,kBAAW,EAAC,EAAE,GAAG,CAAC,GAAG,EAAE,IAAI,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,EAAE,CAAC;QAClE,UAAU,EAAE,CAAC,GAAG,EAAE,cAAc;KACjC,CAAC;AACJ,CAAC"}
package/dist/copy.d.ts ADDED
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Every fixed string these components can put in front of a user.
3
+ *
4
+ * It lives in one object for two reasons. The first is customisation: an
5
+ * integrator passes `copy` to any component and overrides whatever it needs,
6
+ * including into another language, without forking a component. The second is
7
+ * enforcement — a single object is something a test can walk end to end, and
8
+ * `copy.test.ts` does exactly that, because the language rules are far easier
9
+ * to break in a sentence than in a type.
10
+ *
11
+ * The rules these strings are held to:
12
+ *
13
+ * - Never "safe", "scam", "trusted" or "verified" as a claim about a subject.
14
+ * "Safe" is a claim no analysis supports, "scam" is an accusation needing
15
+ * evidence, and "verified"/"trusted" imply a registry Decentrys does not
16
+ * run and will never sell a place in.
17
+ * - Limited or absent history is stated, never warned about.
18
+ * - An absence of findings is described as an absence, never as a clean bill.
19
+ * - Anything above zero hops is described as an inference about a
20
+ * counterparty, because that is what it is.
21
+ */
22
+ export interface UiCopy {
23
+ factsHeading: string;
24
+ capabilitiesHeading: string;
25
+ signalsHeading: string;
26
+ unknownsHeading: string;
27
+ evidenceHeading: string;
28
+ componentsHeading: string;
29
+ historyHeading: string;
30
+ demotedHeading: string;
31
+ factLabel: string;
32
+ capabilityLabel: string;
33
+ signalLabel: string;
34
+ unknownLabel: string;
35
+ notAnAssurance: string;
36
+ factsAreNotFindings: string;
37
+ capabilitiesAreNotFindings: string;
38
+ unknownsAreNotRisk: string;
39
+ coverageIsNotRisk: string;
40
+ policyIsYours: string;
41
+ demotedExplanation: string;
42
+ noFacts: string;
43
+ noCapabilities: string;
44
+ noSignals: string;
45
+ noUnknowns: string;
46
+ nothingReturned: string;
47
+ viewDetails: string;
48
+ close: string;
49
+ detailsTitle: string;
50
+ showEvidence: string;
51
+ hideEvidence: string;
52
+ confidenceLabel: string;
53
+ confidenceCaveat: string;
54
+ sourceLabel: string;
55
+ observedLabel: string;
56
+ grantedByLabel: string;
57
+ hopsLabel: string;
58
+ statusLabel: string;
59
+ analystConfirmed: string;
60
+ notAnalystConfirmed: string;
61
+ cachedNotice: string;
62
+ modelLabel: string;
63
+ assessedLabel: string;
64
+ approvalHeading: string;
65
+ approvalRevocation: string;
66
+ spenderLabel: string;
67
+ tokenLabel: string;
68
+ }
69
+ export declare const DEFAULT_COPY: UiCopy;
70
+ /** Merge an integrator's overrides over the defaults. */
71
+ export declare function resolveCopy(overrides?: Partial<UiCopy>): UiCopy;
72
+ //# sourceMappingURL=copy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy.d.ts","sourceRoot":"","sources":["../src/copy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,WAAW,MAAM;IAErB,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IAIvB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IAGrB,cAAc,EAAE,MAAM,CAAC;IACvB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,0BAA0B,EAAE,MAAM,CAAC;IACnC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;IAI3B,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IAGxB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IAGrB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,YAAY,EAAE,MA8D1B,CAAC;AAEF,yDAAyD;AACzD,wBAAgB,WAAW,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAE/D"}
package/dist/copy.js ADDED
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ /**
3
+ * Every fixed string these components can put in front of a user.
4
+ *
5
+ * It lives in one object for two reasons. The first is customisation: an
6
+ * integrator passes `copy` to any component and overrides whatever it needs,
7
+ * including into another language, without forking a component. The second is
8
+ * enforcement — a single object is something a test can walk end to end, and
9
+ * `copy.test.ts` does exactly that, because the language rules are far easier
10
+ * to break in a sentence than in a type.
11
+ *
12
+ * The rules these strings are held to:
13
+ *
14
+ * - Never "safe", "scam", "trusted" or "verified" as a claim about a subject.
15
+ * "Safe" is a claim no analysis supports, "scam" is an accusation needing
16
+ * evidence, and "verified"/"trusted" imply a registry Decentrys does not
17
+ * run and will never sell a place in.
18
+ * - Limited or absent history is stated, never warned about.
19
+ * - An absence of findings is described as an absence, never as a clean bill.
20
+ * - Anything above zero hops is described as an inference about a
21
+ * counterparty, because that is what it is.
22
+ */
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.DEFAULT_COPY = void 0;
25
+ exports.resolveCopy = resolveCopy;
26
+ exports.DEFAULT_COPY = {
27
+ factsHeading: 'Observed facts',
28
+ capabilitiesHeading: 'What this contract can do',
29
+ signalsHeading: 'Threat signals',
30
+ unknownsHeading: 'Not known',
31
+ evidenceHeading: 'Evidence',
32
+ componentsHeading: 'Score components',
33
+ historyHeading: 'History',
34
+ demotedHeading: 'Reported as facts, not as risk',
35
+ factLabel: 'Fact',
36
+ capabilityLabel: 'Capability',
37
+ signalLabel: 'Threat signal',
38
+ unknownLabel: 'Unknown',
39
+ notAnAssurance: 'An absence of findings is an absence of findings. It is not an assurance about this subject.',
40
+ factsAreNotFindings: 'These are directly observed and carry no accusation. None of them raises a risk level on its own.',
41
+ capabilitiesAreNotFindings: 'What the code is able to do. A capability is not evidence that it has been or will be used.',
42
+ unknownsAreNotRisk: 'Reported as unknown rather than guessed at. An unknown never contributes to a risk level.',
43
+ coverageIsNotRisk: 'Coverage measures how much Decentrys knows about this subject. It is reported separately and is never added to a risk total.',
44
+ policyIsYours: 'Decentrys reports evidence. What happens next is this application’s decision, not ours.',
45
+ demotedExplanation: 'These arrived labelled as risk signals and describe how much is known rather than what was found, so they are shown as facts and cannot raise a risk level.',
46
+ noFacts: 'No facts were returned for this subject.',
47
+ noCapabilities: 'No security-sensitive capabilities were identified.',
48
+ noSignals: 'No threat signals were found. That is an absence of findings, not a finding that there is nothing to find.',
49
+ noUnknowns: 'Every attribute checked returned an answer.',
50
+ nothingReturned: 'Decentrys returned no facts, capabilities, threat signals or unknowns for this subject.',
51
+ viewDetails: 'View details',
52
+ close: 'Close',
53
+ detailsTitle: 'Assessment details',
54
+ showEvidence: 'Show evidence',
55
+ hideEvidence: 'Hide evidence',
56
+ confidenceLabel: 'Confidence',
57
+ confidenceCaveat: 'How well the evidence supports this classification. It is not a measure of how much harm the subject could do.',
58
+ sourceLabel: 'Source',
59
+ observedLabel: 'Observed',
60
+ grantedByLabel: 'Granted by',
61
+ hopsLabel: 'Distance',
62
+ statusLabel: 'Status',
63
+ analystConfirmed: 'Confirmed by a Decentrys analyst against the evidence above.',
64
+ notAnalystConfirmed: 'Automated finding. No analyst has confirmed it.',
65
+ cachedNotice: 'Served from a local cache rather than a fresh lookup.',
66
+ modelLabel: 'Model',
67
+ assessedLabel: 'Assessed',
68
+ approvalHeading: 'What you are about to grant',
69
+ approvalRevocation: 'An allowance stays in place until it is revoked, whether or not the application is used again.',
70
+ spenderLabel: 'Spender',
71
+ tokenLabel: 'Token',
72
+ };
73
+ /** Merge an integrator's overrides over the defaults. */
74
+ function resolveCopy(overrides) {
75
+ return overrides ? { ...exports.DEFAULT_COPY, ...overrides } : exports.DEFAULT_COPY;
76
+ }
77
+ //# sourceMappingURL=copy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy.js","sourceRoot":"","sources":["../src/copy.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAgIH,kCAEC;AAnEY,QAAA,YAAY,GAAW;IAClC,YAAY,EAAE,gBAAgB;IAC9B,mBAAmB,EAAE,2BAA2B;IAChD,cAAc,EAAE,gBAAgB;IAChC,eAAe,EAAE,WAAW;IAC5B,eAAe,EAAE,UAAU;IAC3B,iBAAiB,EAAE,kBAAkB;IACrC,cAAc,EAAE,SAAS;I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— the drop-in React components integrators embed.
3
+ *
4
+ * ## Naming
5
+ *
6
+ * The plan calls this package `@decentrys/ui`. That name is already taken by
7
+ * `packages/ui`, the platform's internal component library, and two packages
8
+ * sharing a name in one pnpm workspace makes `workspace:*` ambiguous and
9
+ * breaks install for the whole repository. The `-sdk` suffix follows the
10
+ * convention already set by `@decentrys/risk-sdk` and `@decentrys/sentinel-sdk`,
11
+ * which collided with `packages/risk` and `packages/sentinel` the same way.
12
+ *
13
+ * ## The rule these components exist to keep
14
+ *
15
+ * Unknown is neutral. Risk requires evidence. Malicious requires stronger
16
+ * evidence. Users should be shown why.
17
+ *
18
+ * A classifier that honours that rule and a UI that renders "deployed 3 days
19
+ * ago" in the same amber as "attributed to a drainer family" has still told
20
+ * the user the wrong thing. So the presentation decisions live in
21
+ * `presentation.ts` as pure functions, and they are what the tests target.
22
+ *
23
+ * ## Usage
24
+ *
25
+ * ```tsx
26
+ * import { Decentrys } from '@decentrys/protect';
27
+ * import { DecentrysUiProvider, TransactionRiskBanner } from '@decentrys/ui-sdk';
28
+ *
29
+ * const decentrys = new Decentrys({ apiKey, failMode: 'warn' });
30
+ * const result = await decentrys.assessTransaction(tx);
31
+ *
32
+ * <DecentrysUiProvider theme={{ surface: '#0b0d10', text: '#e8ebef' }}>
33
+ * <TransactionRiskBanner
34
+ * result={result}
35
+ * // Your button, your policy. This package never disables it.
36
+ * actions={<button onClick={sign}>Sign</button>}
37
+ * />
38
+ * </DecentrysUiProvider>
39
+ * ```
40
+ *
41
+ * React and react-dom are peer dependencies and are never bundled. Two copies
42
+ * of React in one application is a real, common and confusing breakage.
43
+ */
44
+ export { TransactionRiskBanner, type TransactionRiskBannerProps } from './components/TransactionRiskBanner';
45
+ export { ApprovalWarning, type ApprovalWarningProps } from './components/ApprovalWarning';
46
+ export { ContractFacts, type ContractFactsProps } from './components/ContractFacts';
47
+ export { ThreatSignalList, type ThreatSignalListProps } from './components/ThreatSignalList';
48
+ export { RiskDetailsModal, type RiskDetailsModalProps } from './components/RiskDetailsModal';
49
+ export { TokenSecurityPanel, type TokenSecurityPanelProps } from './components/TokenSecurityPanel';
50
+ export { AddressRiskBadge, type AddressRiskBadgeProps } from './components/AddressRiskBadge';
51
+ export { DecentrysUiProvider, DecentrysUiStyles, useUiConfig, type DecentrysUiProviderProps, type ResolvedUiConfig, type UiConfigInput, } from './context';
52
+ export { DECENTRYS_UI_CSS } from './styles';
53
+ export { THEME_TOKENS, themeStyle, toneBgVar, toneVar, type DecentrysTheme, type ThemeToken, type Tone, } from './theme';
54
+ export { DEFAULT_COPY, resolveCopy, type UiCopy } from './copy';
55
+ export { MIN_RAISING_CONFIDENCE, RISK_LEVEL_LABEL, approvalPresentation, assessmentSections, availabilityPresentation, capabilityPresentation, componentRows, decisionPresentation, evidencePresentation, factPresentation, formatConfidence, formatTimestamp, formatTokenAmount, historyPresentation, hopPresentation, isUnlimitedAllowance, kindPresentation, levelPresentation, levelRank, plural, shortenAddress, signalPresentation, unknownPresentation, type ApprovalDetails, type ApprovalPresentation, type AssessmentSections, type AvailabilityPresentation, type CapabilityPresentation, type ComponentRow, type DecisionPresentation, type EvidenceKind, type EvidencePresentation, type FactPresentation, type HistoryPresentation, type HopPresentation, type KindPresentation, type LevelPresentation, type SignalPresentation, type UnknownPresentation, } from './presentation';
56
+ export { Chip, EmptyNote, LevelBadge, Mono, ScreenReaderText, Section, cx, type CommonProps, } from './primitives';
57
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,EAAE,qBAAqB,EAAE,KAAK,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAC5G,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAk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AAK,oBAAoB,EAAE,KAAK,gBAAgB,EAC9F,KAAK,mBAAmB,EAAE,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,KAAK,iBAAiB,EAC7F,KAAK,kBAAkB,EAAE,KAAK,mBAAmB,GAClD,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,EAAE,EAChE,KAAK,WAAW,GACjB,MAAM,cAAc,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+ /**
3
+ * `@decentrys/ui-sdk` — the drop-in React components integrators embed.
4
+ *
5
+ * ## Naming
6
+ *
7
+ * The plan calls this package `@decentrys/ui`. That name is already taken by
8
+ * `packages/ui`, the platform's internal component library, and two packages
9
+ * sharing a name in one pnpm workspace makes `workspace:*` ambiguous and
10
+ * breaks install for the whole repository. The `-sdk` suffix follows the
11
+ * convention already set by `@decentrys/risk-sdk` and `@decentrys/sentinel-sdk`,
12
+ * which collided with `packages/risk` and `packages/sentinel` the same way.
13
+ *
14
+ * ## The rule these components exist to keep
15
+ *
16
+ * Unknown is neutral. Risk requires evidence. Malicious requires stronger
17
+ * evidence. Users should be shown why.
18
+ *
19
+ * A classifier that honours that rule and a UI that renders "deployed 3 days
20
+ * ago" in the same amber as "attributed to a drainer family" has still told
21
+ * the user the wrong thing. So the presentation decisions live in
22
+ * `presentation.ts` as pure functions, and they are what the tests target.
23
+ *
24
+ * ## Usage
25
+ *
26
+ * ```tsx
27
+ * import { Decentrys } from '@decentrys/protect';
28
+ * import { DecentrysUiProvider, TransactionRiskBanner } from '@decentrys/ui-sdk';
29
+ *
30
+ * const decentrys = new Decentrys({ apiKey, failMode: 'warn' });
31
+ * const result = await decentrys.assessTransaction(tx);
32
+ *
33
+ * <DecentrysUiProvider theme={{ surface: '#0b0d10', text: '#e8ebef' }}>
34
+ * <TransactionRiskBanner
35
+ * result={result}
36
+ * // Your button, your policy. This package never disables it.
37
+ * actions={<button onClick={sign}>Sign</button>}
38
+ * />
39
+ * </DecentrysUiProvider>
40
+ * ```
41
+ *
42
+ * React and react-dom are peer dependencies and are never bundled. Two copies
43
+ * of React in one application is a real, common and confusing breakage.
44
+ */
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.cx = exports.Section = exports.ScreenReaderText = exports.Mono = exports.LevelBadge = exports.EmptyNote = exports.Chip = exports.unknownPresentation = exports.signalPresentation = exports.shortenAddress = exports.plural = exports.levelRank = exports.levelPresentation = exports.kindPresentation = exports.isUnlimitedAllowance = exports.hopPresentation = exports.historyPresentation = exports.formatTokenAmount = exports.formatTimestamp = exports.formatConfidence = exports.factPresentation = exports.evidencePresentation = exports.decisionPresentation = exports.componentRows = exports.capabilityPresentation = exports.availabilityPresentation = exports.assessmentSections = exports.approvalPresentation = exports.RISK_LEVEL_LABEL = exports.MIN_RAISING_CONFIDENCE = exports.resolveCopy = exports.DEFAULT_COPY = exports.toneVar = exports.toneBgVar = exports.themeStyle = exports.THEME_TOKENS = exports.DECENTRYS_UI_CSS = exports.useUiConfig = exports.DecentrysUiStyles = exports.DecentrysUiProvider = exports.AddressRiskBadge = exports.TokenSecurityPanel = exports.RiskDetailsModal = exports.ThreatSignalList = exports.ContractFacts = exports.ApprovalWarning = exports.TransactionRiskBanner = void 0;
47
+ var TransactionRiskBanner_1 = require("./components/TransactionRiskBanner");
48
+ Object.defineProperty(exports, "TransactionRiskBanner", { enumerable: true, get: function () { return TransactionRiskBanner_1.TransactionRiskBanner; } });
49
+ var ApprovalWarning_1 = require("./components/ApprovalWarning");
50
+ Object.defineProperty(exports, "ApprovalWarning", { enumerable: true, get: function () { return ApprovalWarning_1.ApprovalWarning; } });
51
+ var ContractFacts_1 = require("./components/ContractFacts");
52
+ Object.defineProperty(exports, "ContractFacts", { enumerable: true, get: function () { return ContractFacts_1.ContractFacts; } });
53
+ var ThreatSignalList_1 = require("./components/ThreatSignalList");
54
+ Object.defineProperty(exports, "ThreatSignalList", { enumerable: true, get: function () { return ThreatSignalList_1.ThreatSignalList; } });
55
+ var RiskDetailsModal_1 = require("./components/RiskDetailsModal");
56
+ Object.defineProperty(exports, "RiskDetailsModal", { enumerable: true, get: function () { return RiskDetailsModal_1.RiskDetailsModal; } });
57
+ var TokenSecurityPanel_1 = require("./components/TokenSecurityPanel");
58
+ Object.defineProperty(exports, "TokenSecurityPanel", { enumerable: true, get: function () { return TokenSecurityPanel_1.TokenSecurityPanel; } });
59
+ var AddressRiskBadge_1 = require("./components/AddressRiskBadge");
60
+ Object.defineProperty(exports, "AddressRiskBadge", { enumerable: true, get: function () { return AddressRiskBadge_1.AddressRiskBadge; } });
61
+ var context_1 = require("./context");
62
+ Object.defineProperty(exports, "DecentrysUiProvider", { enumerable: true, get: function () { return context_1.DecentrysUiProvider; } });
63
+ Object.defineProperty(exports, "DecentrysUiStyles", { enumerable: true, get: function () { return context_1.DecentrysUiStyles; } });
64
+ Object.defineProperty(exports, "useUiConfig", { enumerable: true, get: function () { return context_1.useUiConfig; } });
65
+ var styles_1 = require("./styles");
66
+ Object.defineProperty(exports, "DECENTRYS_UI_CSS", { enumerable: true, get: function () { return styles_1.DECENTRYS_UI_CSS; } });
67
+ var theme_1 = require("./theme");
68
+ Object.defineProperty(exports, "THEME_TOKENS", { enumerable: true, get: function () { return theme_1.THEME_TOKENS; } });
69
+ Object.defineProperty(exports, "themeStyle", { enumerable: true, get: function () { return theme_1.themeStyle; } });
70
+ Object.defineProperty(exports, "toneBgVar", { enumerable: true, get: function () { return theme_1.toneBgVar; } });
71
+ Object.defineProperty(exports, "toneVar", { enumerable: true, get: function () { return theme_1.toneVar; } });
72
+ var copy_1 = require("./copy");
73
+ Object.defineProperty(exports, "DEFAULT_COPY", { enumerable: true, get: function () { return copy_1.DEFAULT_COPY; } });
74
+ Object.defineProperty(exports, "resolveCopy", { enumerable: true, get: function () { return copy_1.resolveCopy; } });
75
+ var presentation_1 = require("./presentation");
76
+ Object.defineProperty(exports, "MIN_RAISING_CONFIDENCE", { enumerable: true, get: function () { return presentation_1.MIN_RAISING_CONFIDENCE; } });
77
+ Object.defineProperty(exports, "RISK_LEVEL_LABEL", { enumerable: true, get: function () { return presentation_1.RISK_LEVEL_LABEL; } });
78
+ Object.defineProperty(exports, "approvalPresentation", { enumerable: true, get: function () { return presentation_1.approvalPresentation; } });
79
+ Object.defineProperty(exports, "assessmentSections", { enumerable: true, get: function () { return presentation_1.assessmentSections; } });
80
+ Object.defineProperty(exports, "availabilityPresentation", { enumerable: true, get: function () { return presentation_1.availabilityPresentation; } });
81
+ Object.defineProperty(exports, "capabilityPresentation", { enumerable: true, get: function () { return presentation_1.capabilityPresentation; } });
82
+ Object.defineProperty(exports, "componentRows", { enumerable: true, get: function () { return presentation_1.componentRows; } });
83
+ Object.defineProperty(exports, "decisionPresentation", { enumerable: true, get: function () { return presentation_1.decisionPresentation; } });
84
+ Object.defineProperty(exports, "evidencePresentation", { enumerable: true, get: function () { return presentation_1.evidencePresentation; } });
85
+ Object.defineProperty(exports, "factPresentation", { enumerable: true, get: function () { return presentation_1.factPresentation; } });
86
+ Object.defineProperty(exports, "formatConfidence", { enumerable: true, get: function () { return presentation_1.formatConfidence; } });
87
+ Object.defineProperty(exports, "formatTimestamp", { enumerable: true, get: function () { return presentation_1.formatTimestamp; } });
88
+ Object.defineProperty(exports, "formatTokenAmount", { enumerable: true, get: function () { return presentation_1.formatTokenAmount; } });
89
+ Object.defineProperty(exports, "historyPresentation", { enumerable: true, get: function () { return presentation_1.historyPresentation; } });
90
+ Object.defineProperty(exports, "hopPresentation", { enumerable: true, get: function () { return presentation_1.hopPresentation; } });
91
+ Object.defineProperty(exports, "isUnlimitedAllowance", { enumerable: true, get: function () { return presentation_1.isUnlimitedAllowance; } });
92
+ Object.defineProperty(exports, "kindPresentation", { enumerable: true, get: function () { return presentation_1.kindPresentation; } });
93
+ Object.defineProperty(exports, "levelPresentation", { enumerable: true, get: function () { return presentation_1.levelPresentation; } });
94
+ Object.defineProperty(exports, "levelRank", { enumerable: true, get: function () { return presentation_1.levelRank; } });
95
+ Object.defineProperty(exports, "plural", { enumerable: true, get: function () { return presentation_1.plural; } });
96
+ Object.defineProperty(exports, "shortenAddress", { enumerable: true, get: function () { return presentation_1.shortenAddress; } });
97
+ Object.defineProperty(exports, "signalPresentation", { enumerable: true, get: function () { return presentation_1.signalPresentation; } });
98
+ Object.defineProperty(exports, "unknownPresentation", { enumerable: true, get: function () { return presentation_1.unknownPresentation; } });
99
+ var primitives_1 = require("./primitives");
100
+ Object.defineProperty(exports, "Chip", { enumerable: true, get: function () { return primitives_1.Chip; } });
101
+ Object.defineProperty(exports, "EmptyNote", { enumerable: true, get: function () { return primitives_1.EmptyNote; } });
102
+ Object.defineProperty(exports, "LevelBadge", { enumerable: true, get: function () { return primitives_1.LevelBadge; } });
103
+ Object.defineProperty(exports, "Mono", { enumerable: true, get: function () { return primitives_1.Mono; } });
104
+ Object.defineProperty(exports, "ScreenReaderText", { enumerable: true, get: function () { return primitives_1.ScreenReaderText; } });
105
+ Object.defineProperty(exports, "Section", { enumerable: true, get: function () { return primitives_1.Section; } });
106
+ Object.defineProperty(exports, "cx", { enumerable: true, get: function () { return primitives_1.cx; } });
107
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;;;AAEH,4EAA4G;AAAnG,8HAAA,qBAAqB,OAAA;AAC9B,gEAA0F;AAAjF,kHAAA,eAAe,OAAA;AACxB,4DAAoF;AAA3E,8GAAA,aAAa,OAAA;AACtB,kEAA6F;AAApF,oHAAA,gBAAgB,OAAA;AACzB,kEAA6F;AAApF,oHAAA,gBAAgB,OAAA;AACzB,sEAAmG;AAA1F,wHAAA,kBAAkB,OAAA;AAC3B,kEAA6F;AAApF,oHAAA,gBAAgB,OA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