pxengine 0.1.93 → 0.1.94

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.cjs CHANGED
@@ -39672,6 +39672,19 @@ var DEFAULT_THEME = {
39672
39672
  secondary: "#a78bfa",
39673
39673
  accent: "#c4b5fd"
39674
39674
  };
39675
+ function readableOn(bg) {
39676
+ if (!bg || typeof bg !== "string") return "#ffffff";
39677
+ const hex = bg.replace("#", "");
39678
+ if (hex.length !== 6) return "#ffffff";
39679
+ const n = parseInt(hex, 16);
39680
+ if (Number.isNaN(n)) return "#ffffff";
39681
+ const ch = [n >> 16 & 255, n >> 8 & 255, n & 255].map((c) => {
39682
+ const x = c / 255;
39683
+ return x <= 0.03928 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);
39684
+ });
39685
+ const lum = 0.2126 * ch[0] + 0.7152 * ch[1] + 0.0722 * ch[2];
39686
+ return lum > 0.5 ? "#1a1a1a" : "#ffffff";
39687
+ }
39675
39688
  var DownloadIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round", children: [
39676
39689
  /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
39677
39690
  /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("polyline", { points: "7 10 12 15 17 10" }),
@@ -40094,8 +40107,8 @@ var ResearchReportJobCard = (props) => {
40094
40107
  {
40095
40108
  onClick: handleDownload,
40096
40109
  disabled: !hasHTML,
40097
- className: "flex items-center gap-1.5 px-2.5 h-7 text-white text-xs font-medium rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
40098
- style: { backgroundColor: primaryColor },
40110
+ className: "flex items-center gap-1.5 px-2.5 h-7 text-xs font-medium rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
40111
+ style: { backgroundColor: primaryColor, color: readableOn(primaryColor) },
40099
40112
  onMouseEnter: (e) => e.currentTarget.style.filter = "brightness(1.15)",
40100
40113
  onMouseLeave: (e) => e.currentTarget.style.filter = "brightness(1)",
40101
40114
  children: [