@ai-matrx/detail 0.1.166 → 0.1.167
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/CHANGELOG.md +1 -1
- package/dist/{host-DrnEXBfp.d.cts → host-Doo4S3OG.d.cts} +6 -0
- package/dist/{host-DrnEXBfp.d.ts → host-Doo4S3OG.d.ts} +6 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +13 -5
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +13 -5
- package/dist/react.js.map +1 -1
- package/dist/testing.d.cts +1 -1
- package/dist/testing.d.ts +1 -1
- package/package.json +3 -3
package/dist/react.cjs
CHANGED
|
@@ -653,29 +653,37 @@ var PRESENTATIONS = [
|
|
|
653
653
|
{ value: "page", label: "Open as page", Icon: ExpandIcon }
|
|
654
654
|
];
|
|
655
655
|
function TypeChip({ core, className }) {
|
|
656
|
-
const
|
|
656
|
+
const color = identityColor(core.recordType?.color);
|
|
657
|
+
const accent = color ? null : core.recordType?.accent ?? null;
|
|
657
658
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
658
659
|
"span",
|
|
659
660
|
{
|
|
660
661
|
className: (0, import_design_system.cn)(
|
|
661
662
|
TYPE_CHIP,
|
|
662
|
-
accent?.bg ?? "bg-muted",
|
|
663
|
-
accent?.text ?? "text-muted-foreground",
|
|
664
|
-
accent?.ring ?? "ring-border",
|
|
663
|
+
color ? "text-foreground" : [accent?.bg ?? "bg-muted", accent?.text ?? "text-muted-foreground", accent?.ring ?? "ring-border"],
|
|
665
664
|
className
|
|
666
665
|
),
|
|
666
|
+
style: color ? {
|
|
667
|
+
backgroundColor: `color-mix(in oklab, ${color} 14%, transparent)`,
|
|
668
|
+
["--tw-ring-color"]: `color-mix(in oklab, ${color} 30%, transparent)`
|
|
669
|
+
} : void 0,
|
|
667
670
|
"data-detail-type-chip": true,
|
|
668
671
|
children: core.recordLabel
|
|
669
672
|
}
|
|
670
673
|
);
|
|
671
674
|
}
|
|
675
|
+
var IDENTITY_HEX = /^#[0-9a-f]{6}$/i;
|
|
676
|
+
function identityColor(c) {
|
|
677
|
+
return c && IDENTITY_HEX.test(c) ? c : null;
|
|
678
|
+
}
|
|
672
679
|
function DetailTitle({ core }) {
|
|
673
680
|
const host = useDetailHost();
|
|
674
681
|
const Icon = core.recordType?.icon ?? null;
|
|
682
|
+
const color = identityColor(core.recordType?.color);
|
|
675
683
|
const accent = core.recordType?.accent ?? null;
|
|
676
684
|
const RecordDoors = host.doors.RecordDoors;
|
|
677
685
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
678
|
-
Icon ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Icon, { className: (0, import_design_system.cn)("h-4 w-4 shrink-0", accent?.text) }) : null,
|
|
686
|
+
Icon ? color ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "inline-flex shrink-0", style: { color }, "data-detail-identity-color": color, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Icon, { className: "h-4 w-4 shrink-0" }) }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Icon, { className: (0, import_design_system.cn)("h-4 w-4 shrink-0", accent?.text) }) : null,
|
|
679
687
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
680
688
|
"span",
|
|
681
689
|
{
|