@ai-matrx/records-ui 0.116.29 → 0.116.30

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/pickers.cjs CHANGED
@@ -6749,8 +6749,8 @@ function colorPairContrast(pair, format, context) {
6749
6749
  }
6750
6750
  return out;
6751
6751
  }
6752
- function ContrastMark({ ratio }) {
6753
- const level = (0, import_field_formats3.contrastLevel)(ratio);
6752
+ function ContrastMark({ ratio, min }) {
6753
+ const level = (0, import_field_formats3.contrastLevel)(ratio, min);
6754
6754
  const said2 = `${ratio}:1`;
6755
6755
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
6756
6756
  "span",
@@ -6773,12 +6773,12 @@ function ColorPairView({ value, format }) {
6773
6773
  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "inline-flex items-center gap-1.5", children: [
6774
6774
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Swatch, { color: pair.light }),
6775
6775
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("code", { className: "font-mono text-xs uppercase", children: pair.light }),
6776
- contrast.light !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ContrastMark, { ratio: contrast.light }) : null
6776
+ contrast.light !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ContrastMark, { ratio: contrast.light, min: pair.min }) : null
6777
6777
  ] }),
6778
6778
  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "inline-flex items-center gap-1.5", children: [
6779
6779
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Swatch, { color: pair.dark ?? pair.light }),
6780
6780
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("code", { className: (0, import_design_system15.cn)("font-mono text-xs uppercase", !pair.dark && "text-muted-foreground"), children: pair.dark ?? "Inherits light" }),
6781
- contrast.dark !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ContrastMark, { ratio: contrast.dark }) : null
6781
+ contrast.dark !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ContrastMark, { ratio: contrast.dark, min: pair.min }) : null
6782
6782
  ] })
6783
6783
  ] });
6784
6784
  }
@@ -6880,14 +6880,15 @@ function colorPairChecks(value, format, context) {
6880
6880
  const out = [];
6881
6881
  for (const part of ["light", "dark"]) {
6882
6882
  const ratio = contrast[part];
6883
- if (ratio === void 0 || (0, import_field_formats3.contrastLevel)(ratio) === "pass") continue;
6883
+ if (ratio === void 0 || (0, import_field_formats3.contrastLevel)(ratio, pair.min) === "pass") continue;
6884
6884
  const color = part === "light" ? pair.light : pair.dark ?? pair.light;
6885
+ const need = pair.min ?? import_field_formats3.TEXT_CONTRAST;
6885
6886
  out.push({
6886
6887
  part,
6887
6888
  message: `hard to read on ${ground}`,
6888
6889
  fix: {
6889
6890
  label: "Fix with AI",
6890
- ask: `The ${part} color ${color} reads at ${ratio}:1 on ${ground}. Suggest the nearest color that reaches 4.5:1 and keeps its hue.`
6891
+ ask: `The ${part} color ${color} reads at ${ratio}:1 on ${ground}. Suggest the nearest color that reaches ${need}:1 and keeps its hue.`
6891
6892
  }
6892
6893
  });
6893
6894
  }