footprint-explainable-ui 0.25.3 → 0.25.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/flowchart.cjs +25 -10
- package/dist/flowchart.cjs.map +1 -1
- package/dist/flowchart.js +25 -10
- package/dist/flowchart.js.map +1 -1
- package/dist/index.cjs +28 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +28 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -68,6 +68,11 @@ interface ThemeTokens {
|
|
|
68
68
|
success?: string;
|
|
69
69
|
error?: string;
|
|
70
70
|
warning?: string;
|
|
71
|
+
/** Semantic node-state roles (a runtime overlay maps onto these): the scrub
|
|
72
|
+
* cursor, the visited path, and a group's lead node. */
|
|
73
|
+
nodeCursor?: string;
|
|
74
|
+
nodeVisited?: string;
|
|
75
|
+
nodeMain?: string;
|
|
71
76
|
bgPrimary?: string;
|
|
72
77
|
bgSecondary?: string;
|
|
73
78
|
bgTertiary?: string;
|
|
@@ -91,6 +96,9 @@ declare const rawDefaults: {
|
|
|
91
96
|
readonly success: "#22c55e";
|
|
92
97
|
readonly error: "#ef4444";
|
|
93
98
|
readonly warning: "#f59e0b";
|
|
99
|
+
readonly nodeCursor: "#f59e0b";
|
|
100
|
+
readonly nodeVisited: "#22c55e";
|
|
101
|
+
readonly nodeMain: "#6366f1";
|
|
94
102
|
readonly bgPrimary: "#0f172a";
|
|
95
103
|
readonly bgSecondary: "#1e293b";
|
|
96
104
|
readonly bgTertiary: "#334155";
|
package/dist/index.d.ts
CHANGED
|
@@ -68,6 +68,11 @@ interface ThemeTokens {
|
|
|
68
68
|
success?: string;
|
|
69
69
|
error?: string;
|
|
70
70
|
warning?: string;
|
|
71
|
+
/** Semantic node-state roles (a runtime overlay maps onto these): the scrub
|
|
72
|
+
* cursor, the visited path, and a group's lead node. */
|
|
73
|
+
nodeCursor?: string;
|
|
74
|
+
nodeVisited?: string;
|
|
75
|
+
nodeMain?: string;
|
|
71
76
|
bgPrimary?: string;
|
|
72
77
|
bgSecondary?: string;
|
|
73
78
|
bgTertiary?: string;
|
|
@@ -91,6 +96,9 @@ declare const rawDefaults: {
|
|
|
91
96
|
readonly success: "#22c55e";
|
|
92
97
|
readonly error: "#ef4444";
|
|
93
98
|
readonly warning: "#f59e0b";
|
|
99
|
+
readonly nodeCursor: "#f59e0b";
|
|
100
|
+
readonly nodeVisited: "#22c55e";
|
|
101
|
+
readonly nodeMain: "#6366f1";
|
|
94
102
|
readonly bgPrimary: "#0f172a";
|
|
95
103
|
readonly bgSecondary: "#1e293b";
|
|
96
104
|
readonly bgTertiary: "#334155";
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,9 @@ function tokensToCSSVars(tokens) {
|
|
|
10
10
|
if (c.success) vars["--fp-color-success"] = c.success;
|
|
11
11
|
if (c.error) vars["--fp-color-error"] = c.error;
|
|
12
12
|
if (c.warning) vars["--fp-color-warning"] = c.warning;
|
|
13
|
+
if (c.nodeCursor) vars["--fp-node-cursor"] = c.nodeCursor;
|
|
14
|
+
if (c.nodeVisited) vars["--fp-node-visited"] = c.nodeVisited;
|
|
15
|
+
if (c.nodeMain) vars["--fp-node-main"] = c.nodeMain;
|
|
13
16
|
if (c.bgPrimary) vars["--fp-bg-primary"] = c.bgPrimary;
|
|
14
17
|
if (c.bgSecondary) vars["--fp-bg-secondary"] = c.bgSecondary;
|
|
15
18
|
if (c.bgTertiary) vars["--fp-bg-tertiary"] = c.bgTertiary;
|
|
@@ -29,6 +32,9 @@ var rawDefaults = {
|
|
|
29
32
|
success: "#22c55e",
|
|
30
33
|
error: "#ef4444",
|
|
31
34
|
warning: "#f59e0b",
|
|
35
|
+
nodeCursor: "#f59e0b",
|
|
36
|
+
nodeVisited: "#22c55e",
|
|
37
|
+
nodeMain: "#6366f1",
|
|
32
38
|
bgPrimary: "#0f172a",
|
|
33
39
|
bgSecondary: "#1e293b",
|
|
34
40
|
bgTertiary: "#334155",
|
|
@@ -49,6 +55,9 @@ var defaultTokens = {
|
|
|
49
55
|
success: `var(--fp-color-success, ${rawDefaults.colors.success})`,
|
|
50
56
|
error: `var(--fp-color-error, ${rawDefaults.colors.error})`,
|
|
51
57
|
warning: `var(--fp-color-warning, ${rawDefaults.colors.warning})`,
|
|
58
|
+
nodeCursor: `var(--fp-node-cursor, ${rawDefaults.colors.nodeCursor})`,
|
|
59
|
+
nodeVisited: `var(--fp-node-visited, ${rawDefaults.colors.nodeVisited})`,
|
|
60
|
+
nodeMain: `var(--fp-node-main, ${rawDefaults.colors.nodeMain})`,
|
|
52
61
|
bgPrimary: `var(--fp-bg-primary, ${rawDefaults.colors.bgPrimary})`,
|
|
53
62
|
bgSecondary: `var(--fp-bg-secondary, ${rawDefaults.colors.bgSecondary})`,
|
|
54
63
|
bgTertiary: `var(--fp-bg-tertiary, ${rawDefaults.colors.bgTertiary})`,
|
|
@@ -91,6 +100,15 @@ var theme = {
|
|
|
91
100
|
success: v("--fp-color-success", "#22c55e"),
|
|
92
101
|
error: v("--fp-color-error", "#ef4444"),
|
|
93
102
|
warning: v("--fp-color-warning", "#f59e0b"),
|
|
103
|
+
// Semantic NODE-STATE colors — first-class, themeable roles a runtime overlay
|
|
104
|
+
// maps onto (scrub cursor / executed / a group's lead node). Distinct from the
|
|
105
|
+
// generic `primary` accent so the three read as three different things.
|
|
106
|
+
nodeCursor: v("--fp-node-cursor", "#f59e0b"),
|
|
107
|
+
// the current / scrubbed-to step
|
|
108
|
+
nodeVisited: v("--fp-node-visited", "#22c55e"),
|
|
109
|
+
// executed up to the cursor
|
|
110
|
+
nodeMain: v("--fp-node-main", "#6366f1"),
|
|
111
|
+
// the lead / "hero" node of a group
|
|
94
112
|
bgPrimary: v("--fp-bg-primary", "#0f172a"),
|
|
95
113
|
bgSecondary: v("--fp-bg-secondary", "#1e293b"),
|
|
96
114
|
bgTertiary: v("--fp-bg-tertiary", "#334155"),
|
|
@@ -3869,13 +3887,13 @@ var StageNode = memo3(function StageNode2({
|
|
|
3869
3887
|
const isHero = data.emphasis === "hero";
|
|
3870
3888
|
const isMuted = data.emphasis === "muted";
|
|
3871
3889
|
const sizeScale = data.size === "lg" ? 1.3 : data.size === "sm" ? 0.85 : 1;
|
|
3872
|
-
const restingBg = isHero ? `color-mix(in srgb, ${theme.
|
|
3873
|
-
const restingBorder = isHero ? theme.
|
|
3874
|
-
const restingShadow = isHero ? `0 0 10px color-mix(in srgb, ${theme.
|
|
3875
|
-
const bg = active ? theme.
|
|
3876
|
-
const borderColor = active ? theme.
|
|
3877
|
-
const shadow = active ? `0 0 22px color-mix(in srgb, ${theme.
|
|
3878
|
-
const textColor = active
|
|
3890
|
+
const restingBg = isHero ? `color-mix(in srgb, ${theme.nodeMain} 12%, ${theme.bgSecondary})` : theme.bgSecondary;
|
|
3891
|
+
const restingBorder = isHero ? theme.nodeMain : theme.border;
|
|
3892
|
+
const restingShadow = isHero ? `0 0 10px color-mix(in srgb, ${theme.nodeMain} 22%, transparent)` : `0 2px 8px rgba(0,0,0,0.15)`;
|
|
3893
|
+
const bg = active ? theme.nodeCursor : isHero && done ? theme.nodeMain : done ? theme.nodeVisited : error ? theme.error : restingBg;
|
|
3894
|
+
const borderColor = active ? theme.nodeCursor : isHero && done ? theme.nodeMain : done ? theme.nodeVisited : error ? theme.error : restingBorder;
|
|
3895
|
+
const shadow = active ? `0 0 22px color-mix(in srgb, ${theme.nodeCursor} 55%, transparent)` : isHero && done ? `0 0 12px color-mix(in srgb, ${theme.nodeMain} 30%, transparent)` : done ? `0 0 8px color-mix(in srgb, ${theme.nodeVisited} 20%, transparent)` : error ? `0 0 12px color-mix(in srgb, ${theme.error} 30%, transparent)` : restingShadow;
|
|
3896
|
+
const textColor = active ? "#1a1a1a" : done || error ? "#fff" : theme.textPrimary;
|
|
3879
3897
|
return /* @__PURE__ */ jsxs15(Fragment5, { children: [
|
|
3880
3898
|
/* @__PURE__ */ jsx16(Handle, { type: "target", position: Position.Top, style: { opacity: 0 } }),
|
|
3881
3899
|
/* @__PURE__ */ jsx16("div", { style: { width: "100%", display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ jsxs15(
|
|
@@ -3904,8 +3922,8 @@ var StageNode = memo3(function StageNode2({
|
|
|
3904
3922
|
},
|
|
3905
3923
|
children: stepNumbers.map((num, i) => {
|
|
3906
3924
|
const isLatest = i === stepNumbers.length - 1;
|
|
3907
|
-
const badgeBg = isLatest && active ? theme.
|
|
3908
|
-
const glow = isLatest && active ? `color-mix(in srgb, ${theme.
|
|
3925
|
+
const badgeBg = isLatest && active ? theme.nodeCursor : theme.nodeVisited;
|
|
3926
|
+
const glow = isLatest && active ? `color-mix(in srgb, ${theme.nodeCursor} 50%, transparent)` : `color-mix(in srgb, ${theme.nodeVisited} 40%, transparent)`;
|
|
3909
3927
|
return /* @__PURE__ */ jsx16(
|
|
3910
3928
|
"div",
|
|
3911
3929
|
{
|
|
@@ -3951,7 +3969,7 @@ var StageNode = memo3(function StageNode2({
|
|
|
3951
3969
|
inset: -6,
|
|
3952
3970
|
borderRadius: isDecider ? 0 : `calc(${theme.radius} + 4px)`,
|
|
3953
3971
|
clipPath: isDecider ? "polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)" : void 0,
|
|
3954
|
-
border: `2px solid ${theme.
|
|
3972
|
+
border: `2px solid ${theme.nodeCursor}`,
|
|
3955
3973
|
opacity: 0.3,
|
|
3956
3974
|
animation: "fp-pulse 1.5s ease-out infinite"
|
|
3957
3975
|
}
|