@orangecheck/design 0.28.8 → 0.28.9
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/index.js +107 -44
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +107 -44
- package/dist/index.mjs.map +1 -1
- package/dist/styles/sigil.css +113 -24
- package/dist/tokens.d.mts +2 -1
- package/dist/tokens.d.ts +2 -1
- package/dist/tokens.js +104 -41
- package/dist/tokens.js.map +1 -1
- package/dist/tokens.mjs +104 -41
- package/dist/tokens.mjs.map +1 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -1007,40 +1007,86 @@ var OC_GLYPHS = {
|
|
|
1007
1007
|
btc: `<path d="M373 1414V1676H531V1414ZM670 1414V1676H829V1414ZM373 -186V76H531V-186ZM670 -186V76H829V-186ZM129 0V1490H705Q863 1490 972.50 1441Q1082 1392 1139 1305.50Q1196 1219 1196 1103Q1196 1016 1164 951Q1132 886 1074 843Q1016 800 937 779V774Q1024 765 1095.50 721Q1167 677 1210 600.50Q1253 524 1253 416Q1253 293 1194.50 199Q1136 105 1020 52.50Q904 0 731 0ZM391 217H700Q838 217 910.50 272.50Q983 328 983 428Q983 497 950 547.50Q917 598 855.50 626Q794 654 707 654H391ZM391 858H688Q762 858 817 883.50Q872 909 902 956Q932 1003 932 1068Q932 1161 868 1217.50Q804 1274 689 1274H391Z" fill="__INK__" transform="translate(238.3907 806.9912) scale(0.395961 -0.395961)"/>`
|
|
1008
1008
|
};
|
|
1009
1009
|
var DEPTH = 22;
|
|
1010
|
-
var Z_STEP = 3;
|
|
1011
1010
|
var LAYERS = Array.from({ length: DEPTH }, (_, i) => i);
|
|
1012
|
-
|
|
1011
|
+
var FILL = /* @__PURE__ */ new Set(["orangecheck", "btc", "vote"]);
|
|
1012
|
+
var INK = "var(--oc-sigil-ink, var(--oc-sigil-ink-base, var(--primary)))";
|
|
1013
|
+
var LIFT = "var(--oc-sigil-lift, white)";
|
|
1014
|
+
var SHADE = `var(--oc-sigil-shade, color-mix(in oklab, black, ${INK} 30%))`;
|
|
1015
|
+
function layerStyle(i, relief) {
|
|
1013
1016
|
const t = i / (DEPTH - 1);
|
|
1014
|
-
const ink = "var(--oc-sigil-ink, var(--primary))";
|
|
1015
|
-
const bg = "var(--oc-sigil-bg, var(--background))";
|
|
1016
1017
|
let color;
|
|
1017
1018
|
if (t < 0.14) {
|
|
1018
|
-
color = `color-mix(in oklab, ${
|
|
1019
|
-
} else if (t < 0.
|
|
1020
|
-
const k = (t - 0.14) / 0.
|
|
1021
|
-
color = `color-mix(in oklab, ${
|
|
1019
|
+
color = `color-mix(in oklab, ${INK}, ${LIFT} ${Math.round((0.14 - t) / 0.14 * 18)}%)`;
|
|
1020
|
+
} else if (t < 0.55) {
|
|
1021
|
+
const k = (t - 0.14) / 0.41;
|
|
1022
|
+
color = `color-mix(in oklab, ${INK}, ${SHADE} ${Math.round(k * 45)}%)`;
|
|
1022
1023
|
} else {
|
|
1023
|
-
const k = (t - 0.
|
|
1024
|
-
color = `color-mix(in oklab, color-mix(in oklab, ${
|
|
1024
|
+
const k = (t - 0.55) / 0.45;
|
|
1025
|
+
color = `color-mix(in oklab, color-mix(in oklab, ${INK}, ${SHADE} 45%), transparent ${Math.round(Math.pow(k, 1.3) * 100)}%)`;
|
|
1025
1026
|
}
|
|
1026
|
-
return {
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1027
|
+
return { transform: `translateZ(${(-Math.pow(t, 1.4) * relief).toFixed(1)}px)`, color };
|
|
1028
|
+
}
|
|
1029
|
+
var TILE = /* @__PURE__ */ new Set(["stamp", "pledge", "cosign", "me", "fleet", "docs"]);
|
|
1030
|
+
var FOCUS = {
|
|
1031
|
+
stamp: "translate(512 512) scale(1.5) translate(-512 -512)",
|
|
1032
|
+
// anchor-cross
|
|
1033
|
+
pledge: "translate(512 512) scale(1.7) translate(-491 -512)",
|
|
1034
|
+
// ₱ mark, recentered
|
|
1035
|
+
cosign: "translate(512 512) scale(1.35) translate(-512 -512)",
|
|
1036
|
+
// two figures
|
|
1037
|
+
me: "translate(512 512) scale(1.45) translate(-512 -544)",
|
|
1038
|
+
// bust, recentered down
|
|
1039
|
+
fleet: "translate(512 512) scale(1.5) translate(-512 -512)",
|
|
1040
|
+
// play + bar
|
|
1041
|
+
docs: "translate(512 512) scale(1.4) translate(-512 -512)",
|
|
1042
|
+
// text lines
|
|
1043
|
+
vote: "translate(512 512) scale(0.92) translate(-512 -542)",
|
|
1044
|
+
// tall bars, nudged down
|
|
1045
|
+
btc: "translate(512 512) scale(1.25) translate(-512 -512)"
|
|
1046
|
+
// ₿
|
|
1047
|
+
};
|
|
1048
|
+
function normSw(w) {
|
|
1049
|
+
return w < 1.3 ? 1.3 : w > 1.8 ? 1.7 : w;
|
|
1033
1050
|
}
|
|
1034
|
-
function
|
|
1051
|
+
function prepare(glyph, markup) {
|
|
1052
|
+
let m = markup.split("__INK__").join("currentColor").split("__BG__").join("none").split("__FG__").join("none");
|
|
1053
|
+
if (TILE.has(glyph)) {
|
|
1054
|
+
m = m.replace(/<rect x="6" y="6" width="12" height="12"[^>]*\/>/, "");
|
|
1055
|
+
}
|
|
1056
|
+
m = m.replace(/stroke-width="([\d.]+)"/g, (_, w) => `stroke-width="${normSw(parseFloat(w))}"`);
|
|
1057
|
+
const focus = FOCUS[glyph];
|
|
1058
|
+
return focus ? `<g transform="${focus}">${m}</g>` : m;
|
|
1059
|
+
}
|
|
1060
|
+
var SEED = {
|
|
1061
|
+
attest: [-7, 2],
|
|
1062
|
+
lock: [-4, -2],
|
|
1063
|
+
vote: [6, 0],
|
|
1064
|
+
stamp: [2, -2],
|
|
1065
|
+
agent: [-2, 3],
|
|
1066
|
+
pledge: [5, 2],
|
|
1067
|
+
chat: [-6, -1],
|
|
1068
|
+
cosign: [1, -3],
|
|
1069
|
+
vault: [4, 1],
|
|
1070
|
+
me: [-3, 2],
|
|
1071
|
+
fleet: [7, -2],
|
|
1072
|
+
docs: [0, 0],
|
|
1073
|
+
analytics: [-5, 1],
|
|
1074
|
+
btc: [4, 3],
|
|
1075
|
+
orangecheck: [0, 0]
|
|
1076
|
+
};
|
|
1077
|
+
function OcSigil({
|
|
1078
|
+
glyph,
|
|
1079
|
+
corner = "bottom-left",
|
|
1080
|
+
parallax = true,
|
|
1081
|
+
band = false,
|
|
1082
|
+
className
|
|
1083
|
+
}) {
|
|
1035
1084
|
const rawId = React2.useId();
|
|
1036
1085
|
const id = React2.useMemo(() => `oc-sigil-${rawId.replace(/[^a-zA-Z0-9_-]/g, "")}`, [rawId]);
|
|
1037
1086
|
const parRef = React2.useRef(null);
|
|
1038
|
-
const
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
return (h % 7 - 3) * 1.5;
|
|
1042
|
-
}, [glyph]);
|
|
1043
|
-
const mark = React2.useMemo(() => sub(OC_GLYPHS[glyph]), [glyph]);
|
|
1087
|
+
const mark = React2.useMemo(() => prepare(glyph, OC_GLYPHS[glyph]), [glyph]);
|
|
1088
|
+
const relief = FILL.has(glyph) ? 30 : 48;
|
|
1089
|
+
const [seedY, seedX] = SEED[glyph];
|
|
1044
1090
|
React2.useEffect(() => {
|
|
1045
1091
|
if (!parallax) return;
|
|
1046
1092
|
const el = parRef.current;
|
|
@@ -1055,16 +1101,16 @@ function OcSigil({ glyph, corner = "bottom-left", parallax = true, className })
|
|
|
1055
1101
|
const allowed = () => !prm.matches && document.documentElement.getAttribute("data-oc-motion") !== "off";
|
|
1056
1102
|
const onMove = (e) => {
|
|
1057
1103
|
if (!allowed()) return;
|
|
1058
|
-
tx = (e.clientX / innerWidth - 0.5) *
|
|
1059
|
-
ty = (e.clientY / innerHeight - 0.5) * -
|
|
1104
|
+
tx = Math.tanh((e.clientX / innerWidth - 0.5) * 2 * 1.2) * 5;
|
|
1105
|
+
ty = Math.tanh((e.clientY / innerHeight - 0.5) * 2 * 1.2) * -5;
|
|
1060
1106
|
if (!raf) raf = requestAnimationFrame(step);
|
|
1061
1107
|
};
|
|
1062
1108
|
const step = () => {
|
|
1063
1109
|
raf = 0;
|
|
1064
|
-
cx += (tx - cx) * 0.
|
|
1065
|
-
cy += (ty - cy) * 0.
|
|
1066
|
-
el.style.setProperty("--oc-sigil-ry", `${
|
|
1067
|
-
el.style.setProperty("--oc-sigil-rx", `${
|
|
1110
|
+
cx += (tx - cx) * 0.045;
|
|
1111
|
+
cy += (ty - cy) * 0.045;
|
|
1112
|
+
el.style.setProperty("--oc-sigil-ry", `${cx.toFixed(2)}deg`);
|
|
1113
|
+
el.style.setProperty("--oc-sigil-rx", `${cy.toFixed(2)}deg`);
|
|
1068
1114
|
if (Math.abs(tx - cx) + Math.abs(ty - cy) > 0.05) raf = requestAnimationFrame(step);
|
|
1069
1115
|
};
|
|
1070
1116
|
const onPrm = () => {
|
|
@@ -1085,20 +1131,37 @@ function OcSigil({ glyph, corner = "bottom-left", parallax = true, className })
|
|
|
1085
1131
|
"div",
|
|
1086
1132
|
{
|
|
1087
1133
|
"aria-hidden": "true",
|
|
1088
|
-
className: cn("oc-sigil", `oc-sigil--${corner}`, className),
|
|
1089
|
-
style: {
|
|
1134
|
+
className: cn("oc-sigil", `oc-sigil--${corner}`, band && "oc-sigil--band", className),
|
|
1135
|
+
style: {
|
|
1136
|
+
"--oc-sigil-seed": `${seedY}deg`,
|
|
1137
|
+
"--oc-sigil-seed-x": `${seedX}deg`
|
|
1138
|
+
},
|
|
1090
1139
|
children: [
|
|
1091
1140
|
/* @__PURE__ */ jsxRuntime.jsx("svg", { width: "0", height: "0", style: { position: "absolute" }, "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("g", { id: `${id}-mark`, dangerouslySetInnerHTML: { __html: mark } }) }) }),
|
|
1092
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "oc-sigil__drift oc-ambient", children: /* @__PURE__ */ jsxRuntime.
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1141
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "oc-sigil__drift oc-ambient", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: parRef, className: "oc-sigil__par", children: [
|
|
1142
|
+
LAYERS.map((n) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1143
|
+
"svg",
|
|
1144
|
+
{
|
|
1145
|
+
viewBox: "0 0 1024 1024",
|
|
1146
|
+
className: "oc-sigil__layer",
|
|
1147
|
+
style: layerStyle(n, relief),
|
|
1148
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("use", { href: `#${id}-mark` })
|
|
1149
|
+
},
|
|
1150
|
+
n
|
|
1151
|
+
)),
|
|
1152
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1153
|
+
"svg",
|
|
1154
|
+
{
|
|
1155
|
+
viewBox: "0 0 1024 1024",
|
|
1156
|
+
className: "oc-sigil__layer oc-sigil__spec",
|
|
1157
|
+
style: {
|
|
1158
|
+
transform: "translateZ(1.5px)",
|
|
1159
|
+
color: `color-mix(in oklab, ${INK}, ${LIFT} 45%)`
|
|
1160
|
+
},
|
|
1161
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("use", { href: `#${id}-mark` })
|
|
1162
|
+
}
|
|
1163
|
+
)
|
|
1164
|
+
] }) })
|
|
1102
1165
|
]
|
|
1103
1166
|
}
|
|
1104
1167
|
);
|
|
@@ -2688,7 +2751,7 @@ function Sparkline({ data, width = 96, height = 24, area = false, className }) {
|
|
|
2688
2751
|
}
|
|
2689
2752
|
);
|
|
2690
2753
|
}
|
|
2691
|
-
function StatBlock({ label, value, sub
|
|
2754
|
+
function StatBlock({ label, value, sub, delta, tone = "default", className }) {
|
|
2692
2755
|
const toneClass = tone === "success" ? "text-success" : tone === "warning" ? "text-warning" : tone === "destructive" ? "text-destructive" : "text-foreground";
|
|
2693
2756
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col gap-1", className), children: [
|
|
2694
2757
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "label-mono text-muted-foreground text-[10px]", children: label }),
|
|
@@ -2703,7 +2766,7 @@ function StatBlock({ label, value, sub: sub2, delta, tone = "default", className
|
|
|
2703
2766
|
}
|
|
2704
2767
|
),
|
|
2705
2768
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline gap-2", children: [
|
|
2706
|
-
|
|
2769
|
+
sub && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground font-mono text-[11px] tracking-wide lowercase", children: sub }),
|
|
2707
2770
|
delta && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2708
2771
|
"span",
|
|
2709
2772
|
{
|