@ai-matrx/associations 0.13.13 → 0.13.16

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