@ai-matrx/associations 0.13.12 → 0.13.15

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.
@@ -2610,12 +2610,6 @@ function ExternalLinkIcon(props) {
2610
2610
  function ChevronDownIcon(props) {
2611
2611
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { ...base(props), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "m6 9 6 6 6-6" }) });
2612
2612
  }
2613
- function ChevronsUpDownIcon(props) {
2614
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { ...base(props), children: [
2615
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "m7 15 5 5 5-5" }),
2616
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "m7 9 5-5 5 5" })
2617
- ] });
2618
- }
2619
2613
  function CornerDownRightIcon(props) {
2620
2614
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { ...base(props), children: [
2621
2615
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("polyline", { points: "15 10 20 15 15 20" }),
@@ -3843,6 +3837,7 @@ function AttachedItemsBody({
3843
3837
  // src/react/components/AssociationCard.tsx
3844
3838
  var import_react16 = require("react");
3845
3839
  var import_design_system7 = require("@ai-matrx/design-system");
3840
+ var import_tap_target = require("@ai-matrx/design-system/tap-target");
3846
3841
  var import_jsx_runtime11 = require("react/jsx-runtime");
3847
3842
  function AssociationCard({
3848
3843
  token,
@@ -3878,12 +3873,14 @@ function AssociationCard({
3878
3873
  const filing = container.direction === "outgoing";
3879
3874
  const canAttach = info.canListCandidates && (!filing || isAssociationTargetType(token));
3880
3875
  const canDrillIn = count > 0;
3876
+ const countWord = filing ? "filed under" : "attached";
3881
3877
  return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
3882
3878
  /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
3883
3879
  "div",
3884
3880
  {
3881
+ "data-association-card": token,
3885
3882
  className: (0, import_design_system7.cn)(
3886
- "group relative flex items-center gap-3 overflow-hidden rounded-xl border border-border bg-card transition-all hover:border-primary/30 hover:bg-accent/40",
3883
+ "flex min-h-8 items-center gap-x-1.5 rounded-md border border-border bg-card px-2.5 py-1 lg:pointer-fine:[--matrx-tap-target-size:1.75rem]",
3887
3884
  className
3888
3885
  ),
3889
3886
  children: [
@@ -3894,31 +3891,26 @@ function AssociationCard({
3894
3891
  disabled: !canDrillIn,
3895
3892
  onClick: () => setListOpen(true),
3896
3893
  title: canDrillIn ? `View the ${info.labelPlural.toLowerCase()} attached to ${container.label ?? "this"}` : void 0,
3894
+ "aria-label": loading ? info.labelPlural : `${info.labelPlural}: ${count} ${countWord}`,
3897
3895
  className: (0, import_design_system7.cn)(
3898
- "flex min-w-0 flex-1 items-center gap-3 px-3 py-2.5 text-left",
3899
- canDrillIn ? "cursor-pointer" : "cursor-default"
3896
+ "flex min-h-8 min-w-0 flex-1 items-center gap-x-1.5 text-left",
3897
+ canDrillIn ? "cursor-pointer hover:text-foreground" : "cursor-default"
3900
3898
  ),
3901
3899
  children: [
3902
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Icon, { className: "h-4 w-4" }) }),
3903
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "min-w-0 flex-1", children: [
3904
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "block truncate text-sm font-medium text-foreground", children: info.labelPlural }),
3905
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "block text-xs text-muted-foreground tabular-nums", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "inline-flex items-center gap-1", children: [
3906
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SpinnerIcon, { className: "h-3 w-3 animate-spin" }),
3907
- "Loading\u2026"
3908
- ] }) : `${count} ${container.direction === "outgoing" ? "filed under" : "attached"}` })
3909
- ] })
3900
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Icon, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
3901
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "min-w-0 truncate text-xs font-semibold uppercase tracking-wider text-foreground", children: info.labelPlural }),
3902
+ loading ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SpinnerIcon, { className: "h-3 w-3 animate-spin text-muted-foreground" }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "text-xs tabular-nums text-muted-foreground", children: count })
3910
3903
  ]
3911
3904
  }
3912
3905
  ),
3913
3906
  canAttach && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3914
- "button",
3907
+ import_tap_target.TapTargetButton,
3915
3908
  {
3916
- type: "button",
3909
+ ariaLabel: `Attach ${info.labelPlural.toLowerCase()}`,
3910
+ tooltip: false,
3917
3911
  onClick: () => setOpen(true),
3918
- "aria-label": `Attach ${info.labelPlural.toLowerCase()}`,
3919
- title: `Attach ${info.labelPlural.toLowerCase()}`,
3920
- className: "mr-2 flex h-11 w-11 shrink-0 items-center justify-center rounded-md border border-border text-muted-foreground transition-colors hover:border-primary/60 hover:text-foreground lg:mr-3 lg:h-7 lg:w-7",
3921
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PlusIcon, { className: "h-4 w-4" })
3912
+ className: "ml-auto shrink-0",
3913
+ icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PlusIcon, { className: "h-4 w-4" })
3922
3914
  }
3923
3915
  )
3924
3916
  ]
@@ -4012,6 +4004,8 @@ function getContentRoleMeta(role) {
4012
4004
 
4013
4005
  // src/react/components/AssociationCardGrid.tsx
4014
4006
  var import_jsx_runtime12 = require("react/jsx-runtime");
4007
+ var GROUP_LABEL = "mb-1 text-xs font-medium uppercase tracking-wider text-muted-foreground";
4008
+ var TILE_ROW = "flex flex-wrap gap-2 [&>*]:min-w-[16rem] [&>*]:flex-1";
4015
4009
  function AssociationCardGrid({
4016
4010
  tokens,
4017
4011
  excludeTokens,
@@ -4037,20 +4031,20 @@ function AssociationCardGrid({
4037
4031
  const role = store.registry.getEntityInfo(token).contentRole;
4038
4032
  return !role || !roleIds.has(role);
4039
4033
  }) : [];
4040
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: (0, import_design_system8.cn)("@container space-y-5", className), children: [
4034
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: (0, import_design_system8.cn)("@container space-y-3", className), children: [
4041
4035
  CONTENT_ROLES.map((role) => {
4042
4036
  const inRole = list.filter(
4043
4037
  (token) => store.registry.getEntityInfo(token).contentRole === role.id
4044
4038
  );
4045
4039
  if (inRole.length === 0) return null;
4046
4040
  return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("section", { children: [
4047
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h3", { className: "mb-2 text-sm font-semibold text-foreground", children: role.title }),
4048
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex flex-wrap gap-2 [&>*]:min-w-[16rem] [&>*]:flex-1", children: inRole.map((token) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(AssociationCard, { token }, token)) })
4041
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h3", { className: GROUP_LABEL, children: role.title }),
4042
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: TILE_ROW, children: inRole.map((token) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(AssociationCard, { token }, token)) })
4049
4043
  ] }, role.id);
4050
4044
  }),
4051
4045
  roleless.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("section", { children: [
4052
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h3", { className: "mb-2 text-sm font-semibold text-foreground", children: "Filed under" }),
4053
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex flex-wrap gap-2 [&>*]:min-w-[16rem] [&>*]:flex-1", children: roleless.map((token) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(AssociationCard, { token }, token)) })
4046
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h3", { className: GROUP_LABEL, children: "Filed under" }),
4047
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: TILE_ROW, children: roleless.map((token) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(AssociationCard, { token }, token)) })
4054
4048
  ] })
4055
4049
  ] });
4056
4050
  }
@@ -5563,7 +5557,7 @@ function CategoryTagPicker({
5563
5557
  children: [
5564
5558
  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Icon, { className: "h-3.5 w-3.5" }),
5565
5559
  selected.length === 0 ? addLabel : "Edit",
5566
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ChevronsUpDownIcon, { className: "h-3 w-3 opacity-50" })
5560
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system13.SelectChevron, { size: "sm" })
5567
5561
  ]
5568
5562
  }
5569
5563
  ) }),