@estiva-app/ui 0.91.0 → 0.91.2

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.
Files changed (51) hide show
  1. package/dist/AttachedCard.d.ts +2 -2
  2. package/dist/AttachedCard.d.ts.map +1 -1
  3. package/dist/Card.d.ts +4 -1
  4. package/dist/Card.d.ts.map +1 -1
  5. package/dist/LinkCard.d.ts.map +1 -1
  6. package/dist/LinkParts.d.ts.map +1 -1
  7. package/dist/LinkRow.d.ts +1 -1
  8. package/dist/LinkRow.d.ts.map +1 -1
  9. package/dist/PartCard.d.ts +10 -2
  10. package/dist/PartCard.d.ts.map +1 -1
  11. package/dist/Select.d.ts +7 -1
  12. package/dist/Select.d.ts.map +1 -1
  13. package/dist/ShowMore.d.ts +8 -3
  14. package/dist/ShowMore.d.ts.map +1 -1
  15. package/dist/eslint/index.js +1 -1
  16. package/dist/eslint/index.js.map +2 -2
  17. package/dist/index.js +71 -38
  18. package/dist/index.js.map +3 -3
  19. package/dist/linkedFrom.d.ts +5 -0
  20. package/dist/linkedFrom.d.ts.map +1 -1
  21. package/package.json +1 -1
  22. package/registry.json +51 -19
  23. package/src/AttachedCard.test.tsx +3 -3
  24. package/src/AttachedCard.tsx +5 -7
  25. package/src/Card.test.tsx +1 -1
  26. package/src/Card.tsx +5 -2
  27. package/src/CommentBox.test.tsx +1 -1
  28. package/src/LinkCard.mdx +5 -4
  29. package/src/LinkCard.stories.tsx +3 -0
  30. package/src/LinkCard.test.tsx +8 -2
  31. package/src/LinkCard.tsx +28 -21
  32. package/src/LinkChip.mdx +1 -1
  33. package/src/LinkChip.test.tsx +1 -1
  34. package/src/LinkChip.tsx +1 -1
  35. package/src/LinkParts.tsx +3 -0
  36. package/src/LinkRow.mdx +2 -2
  37. package/src/LinkRow.test.tsx +1 -1
  38. package/src/LinkRow.tsx +6 -7
  39. package/src/PartCard.mdx +2 -1
  40. package/src/PartCard.stories.tsx +24 -0
  41. package/src/PartCard.test.tsx +1 -1
  42. package/src/PartCard.tsx +21 -6
  43. package/src/Select.mdx +4 -0
  44. package/src/Select.stories.tsx +11 -1
  45. package/src/Select.tsx +10 -2
  46. package/src/ShowMore.mdx +4 -4
  47. package/src/ShowMore.tsx +11 -6
  48. package/src/eslint/no-restyled-part.ts +1 -1
  49. package/src/linked.examples.ts +1 -1
  50. package/src/linkedFrom.test.tsx +55 -3
  51. package/src/linkedFrom.ts +46 -2
package/dist/index.js CHANGED
@@ -125,7 +125,7 @@ import { jsx as jsx3 } from "react/jsx-runtime";
125
125
  var FILL_CLASSES = {
126
126
  surface: "bg-bg-surface border-border-default",
127
127
  elevated: "bg-bg-elevated border-border-default",
128
- inset: "bg-bg-inset border-border-subtle",
128
+ inset: "bg-bg-wash border-border-subtle",
129
129
  none: "border-border-subtle"
130
130
  };
131
131
  var HAIRLINE_HOVER_CLASSES = {
@@ -2927,7 +2927,7 @@ import { Select as BaseSelect } from "@base-ui/react/select";
2927
2927
  import { jsx as jsx40, jsxs as jsxs29 } from "react/jsx-runtime";
2928
2928
  var GAP4 = 4;
2929
2929
  var VIEWPORT_PAD4 = 8;
2930
- function Select({ value, onChange, options, size = "default", ariaLabel, placeholder = "Select\u2026", disabled, disabledReason, className, ...aria }) {
2930
+ function Select({ value, onChange, options, size = "default", fill = "field", ariaLabel, placeholder = "Select\u2026", disabled, disabledReason, className, ...aria }) {
2931
2931
  const selected = options.find((o) => o.value === value);
2932
2932
  const held = Boolean(disabledReason);
2933
2933
  const trigger = (
@@ -2947,7 +2947,9 @@ function Select({ value, onChange, options, size = "default", ariaLabel, placeho
2947
2947
  * `truncate` from ever engaging; in a block container max-w-full is
2948
2948
  * the cap. Full-width callers are unaffected.
2949
2949
  */
2950
- "flex w-full min-w-0 max-w-full items-center justify-between gap-2 rounded-lg border bg-bg-field shadow-field text-left",
2950
+ "flex w-full min-w-0 max-w-full items-center justify-between gap-2 rounded-lg border text-left",
2951
+ // Leaf's fields are white, raised on their shadow, and stay so on a card: they never read as a hole (Katerina, 30 Oct).
2952
+ fill === "wash" ? "bg-bg-wash leaf:bg-bg-field leaf:shadow-field" : "bg-bg-field shadow-field",
2951
2953
  "border-border-field outline-none transition-colors",
2952
2954
  FIELD_TEXT_CLASSES,
2953
2955
  // The focused border survives a hover: hover alone strengthens the
@@ -3935,8 +3937,8 @@ function SuggestionMenu({ rect, editorElement, ariaLabel, width, maxHeight, sect
3935
3937
  import { useLayoutEffect as useLayoutEffect5, useRef as useRef13, useState as useState12 } from "react";
3936
3938
  import { IconChevronDown as IconChevronDown4, IconChevronUp } from "@tabler/icons-react";
3937
3939
  import { jsx as jsx56, jsxs as jsxs39 } from "react/jsx-runtime";
3938
- var FADE_CLASSES = { surface: "from-bg-surface", inset: "from-bg-inset" };
3939
- function ShowMore({ children, maxHeight = 96, surface = "surface", action, className }) {
3940
+ var FADE = "linear-gradient(to top, transparent, black 40px)";
3941
+ function ShowMore({ children, maxHeight = 96, action, contentClassName, className }) {
3940
3942
  const box = useRef13(null);
3941
3943
  const [open, setOpen] = useState12(false);
3942
3944
  const [overflows, setOverflows] = useState12(false);
@@ -3952,10 +3954,7 @@ function ShowMore({ children, maxHeight = 96, surface = "surface", action, class
3952
3954
  }, [maxHeight]);
3953
3955
  const cut = overflows && !open;
3954
3956
  return /* @__PURE__ */ jsxs39("div", { className: cn("flex flex-col items-start", className), children: [
3955
- /* @__PURE__ */ jsxs39("div", { ref: box, className: cn("relative w-full", cut && "overflow-hidden"), style: cut ? { maxHeight } : void 0, onFocus: cut ? () => setOpen(true) : void 0, children: [
3956
- children,
3957
- cut && /* @__PURE__ */ jsx56("div", { "aria-hidden": true, className: cn("pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t to-transparent", FADE_CLASSES[surface]) })
3958
- ] }),
3957
+ /* @__PURE__ */ jsx56("div", { ref: box, className: cn("relative w-full", cut && "overflow-hidden", contentClassName), style: cut ? { maxHeight, maskImage: FADE, WebkitMaskImage: FADE } : void 0, onFocus: cut ? () => setOpen(true) : void 0, children }),
3959
3958
  action ? /* @__PURE__ */ jsxs39("div", { className: cn("mt-1 flex w-full items-center gap-2", overflows ? "justify-between" : "justify-end"), children: [
3960
3959
  overflows && /* @__PURE__ */ jsx56(Toggle, { open, onToggle: () => setOpen((o) => !o) }),
3961
3960
  /* @__PURE__ */ jsx56("div", { className: "-mr-2 flex shrink-0", children: action })
@@ -4157,6 +4156,16 @@ function archivedLine(archive, noun, options = {}) {
4157
4156
  var archivedLine2 = archivedLine;
4158
4157
 
4159
4158
  // src/linkedFrom.ts
4159
+ function agoOf(seconds, now = Date.now()) {
4160
+ const gone = Math.max(0, Math.floor(now / 1e3 - seconds));
4161
+ if (gone < 60) return "just now";
4162
+ if (gone < 3600) return `${Math.floor(gone / 60)}m ago`;
4163
+ if (gone < 86400) return `${Math.floor(gone / 3600)}h ago`;
4164
+ if (gone < 7 * 86400) return `${Math.floor(gone / 86400)}d ago`;
4165
+ const date = new Date(seconds * 1e3);
4166
+ const year = date.getFullYear() === new Date(now).getFullYear() ? {} : { year: "numeric" };
4167
+ return date.toLocaleDateString(void 0, { day: "numeric", month: "short", ...year });
4168
+ }
4160
4169
  var CARD_ROWS = 7;
4161
4170
  var KIND_PAGE = 30842;
4162
4171
  var KIND_CHANNEL2 = 39e3;
@@ -4258,15 +4267,32 @@ function ownerOf(object, options, onAct) {
4258
4267
  ...slot.label ? { ownerLabel: slot.label } : {}
4259
4268
  };
4260
4269
  }
4270
+ function authorOf(object, directory) {
4271
+ if (object.kind === KIND_CHANNEL2 || !object.address) return void 0;
4272
+ const pubkey = object.address.split(":")[1];
4273
+ if (!pubkey || !/^[0-9a-f]{64}$/.test(pubkey)) return void 0;
4274
+ const profile = object.people?.[pubkey] ?? directory?.[pubkey];
4275
+ if (!profile?.displayName) return void 0;
4276
+ return { name: profile.displayName, ...profile.picture ? { picture: profile.picture } : {} };
4277
+ }
4261
4278
  function linkedFrom(object, options) {
4262
4279
  const { slots, people } = object;
4263
4280
  const id = idOf(object);
4264
4281
  const href = options.hrefOf(object, true);
4282
+ const updated = object.changedAt !== void 0 ? (options.whenOf ?? agoOf)(object.changedAt) : void 0;
4265
4283
  if (isMessage(object) && slots.title?.isPubkey) {
4266
4284
  const person = people?.[slots.title.value];
4267
4285
  const name = person?.displayName ?? "\u2014";
4268
4286
  const body = slots.body?.value ? options.previewText(slots.body.value, people) : "";
4269
- return { id, kind: "message", title: name, href, author: { name, ...person?.picture ? { picture: person.picture } : {} }, ...body ? { body } : {} };
4287
+ return {
4288
+ id,
4289
+ kind: "message",
4290
+ title: name,
4291
+ href,
4292
+ author: { name, ...person?.picture ? { picture: person.picture } : {} },
4293
+ ...body ? { body } : {},
4294
+ ...updated ? { updated } : {}
4295
+ };
4270
4296
  }
4271
4297
  const onAct = object.archived ? void 0 : options.onAct;
4272
4298
  const key = keyOf(object);
@@ -4274,6 +4300,7 @@ function linkedFrom(object, options) {
4274
4300
  const owner = ownerOf(object, options, onAct);
4275
4301
  const children = childrenOf(object, options);
4276
4302
  const done = doneOf(object);
4303
+ const author = owner ? void 0 : authorOf(object, options.directory);
4277
4304
  return {
4278
4305
  id,
4279
4306
  kind: linkedKindOfKind(object.kind),
@@ -4287,7 +4314,9 @@ function linkedFrom(object, options) {
4287
4314
  ...owner ?? {},
4288
4315
  ...options.conversation ? { conversation: options.conversation } : {},
4289
4316
  ...children ? { children } : {},
4290
- ...done ? { done } : {}
4317
+ ...done ? { done } : {},
4318
+ ...author ? { authors: [author] } : {},
4319
+ ...updated ? { updated } : {}
4291
4320
  };
4292
4321
  }
4293
4322
  function linkStateFrom(object, unread, options) {
@@ -4380,6 +4409,7 @@ function LinkPickers({ status, owner, ownerLabel = "Owner", readOnly = false })
4380
4409
  const ownerWords = owner && (readOnly || !owner.onChange);
4381
4410
  return (
4382
4411
  // As words, 16px apart, so the status and the person read as two things; as boxed pickers their borders already part them (Katerina, 29 Oct).
4412
+ // Boxed, they are see-through as the card they sit in is: a field's fill was a dark hole on a selected message (Katerina, 30 Oct).
4383
4413
  /* @__PURE__ */ jsxs41("span", { className: cn("flex h-6 min-w-0 items-center text-caption text-text-secondary", statusWords || ownerWords ? "gap-4" : "gap-2"), children: [
4384
4414
  status && (statusWords ? /* @__PURE__ */ jsxs41("span", { className: "inline-flex shrink-0 items-center gap-1", children: [
4385
4415
  statusNow?.colour && /* @__PURE__ */ jsx60(StatusIcon, { colour: statusNow.colour }),
@@ -4388,6 +4418,7 @@ function LinkPickers({ status, owner, ownerLabel = "Owner", readOnly = false })
4388
4418
  Select,
4389
4419
  {
4390
4420
  size: "small",
4421
+ fill: "wash",
4391
4422
  className: "w-auto",
4392
4423
  value: status.value ?? "",
4393
4424
  onChange: (value) => status.onChange?.(value),
@@ -4402,6 +4433,7 @@ function LinkPickers({ status, owner, ownerLabel = "Owner", readOnly = false })
4402
4433
  Select,
4403
4434
  {
4404
4435
  size: "small",
4436
+ fill: "wash",
4405
4437
  className: "w-auto",
4406
4438
  value: owner.value ?? "",
4407
4439
  placeholder: "Unassigned",
@@ -4426,11 +4458,11 @@ import { jsx as jsx61, jsxs as jsxs42 } from "react/jsx-runtime";
4426
4458
  var ROW_CLASSES2 = "flex items-center gap-3 p-1.5 pr-3";
4427
4459
  function LinkUnavailable({ kind, noun, openIn, card = false }) {
4428
4460
  const wide = useContext7(inTheBox);
4429
- return /* @__PURE__ */ jsxs42(Card, { fill: wide ? "elevated" : "inset", className: cn(card ? "flex items-center gap-3 p-3" : ROW_CLASSES2, !wide && "max-w-[480px]"), children: [
4461
+ return /* @__PURE__ */ jsxs42(Card, { fill: wide ? "elevated" : "inset", className: cn(card ? "flex items-center gap-3 p-3" : ROW_CLASSES2, "max-w-[480px]"), children: [
4430
4462
  /* @__PURE__ */ jsx61("span", { className: TYPE_TILE_CLASSES, children: /* @__PURE__ */ jsx61(LinkedIcon, { kind }) }),
4431
4463
  /* @__PURE__ */ jsxs42("span", { className: "min-w-0 flex-1 truncate text-body-2 text-text-muted", children: [
4432
4464
  noun,
4433
- " \u2014 not available."
4465
+ " not available"
4434
4466
  ] }),
4435
4467
  openIn && /* @__PURE__ */ jsx61("span", { className: "shrink-0 text-caption text-text-secondary", children: /* @__PURE__ */ jsxs42(Link, { href: openIn.href, variant: "quiet", external: true, children: [
4436
4468
  "Open in ",
@@ -4443,8 +4475,7 @@ function linkMetaOf(linked, withWhen = false) {
4443
4475
  return [linked.key, kindNounOf(linked), linked.subtitle, withWhen ? linked.updated : void 0].filter(Boolean).join(" \xB7 ");
4444
4476
  }
4445
4477
  function LinkRow({ link, preview = true }) {
4446
- const wide = useContext7(inTheBox);
4447
- const width = !wide && "max-w-[480px]";
4478
+ const width = "max-w-[480px]";
4448
4479
  if (link.state === "loading") {
4449
4480
  return /* @__PURE__ */ jsx61("div", { className: "animate-skeleton-in", "aria-busy": true, children: /* @__PURE__ */ jsxs42(Card, { fill: "inset", "aria-hidden": true, className: cn(ROW_CLASSES2, width), children: [
4450
4481
  /* @__PURE__ */ jsx61("span", { className: TYPE_TILE_CLASSES, children: /* @__PURE__ */ jsx61(LinkedIcon, { kind: link.kind }) }),
@@ -4493,12 +4524,13 @@ function LinkCard({ link, readOnly = false, bare = false }) {
4493
4524
  const { linked } = link;
4494
4525
  const body = linked.kind === "message" && linked.author ? /* @__PURE__ */ jsx62(SaidBody, { linked }) : /* @__PURE__ */ jsx62(CardBody, { linked, readOnly: readOnly || boxed });
4495
4526
  if (bare) return /* @__PURE__ */ jsx62("div", { className: CARD_CLASSES, children: body });
4496
- return /* @__PURE__ */ jsx62(Card, { fill: boxed ? "elevated" : "inset", className: cn(CARD_CLASSES, !boxed && "max-w-[480px]"), children: body });
4527
+ return /* @__PURE__ */ jsx62(Card, { fill: boxed ? "elevated" : "inset", className: cn(CARD_CLASSES, "max-w-[480px]"), children: body });
4497
4528
  }
4498
4529
  function CardBody({ linked, readOnly }) {
4499
4530
  const boxed = useContext8(inTheBox);
4500
4531
  const on = boxed ? "elevated" : "inset";
4501
4532
  const meta = linkMetaOf(linked);
4533
+ const footed = Boolean(linked.status || linked.owner || linked.authors || linked.updated);
4502
4534
  return /* @__PURE__ */ jsxs43(Fragment15, { children: [
4503
4535
  /* @__PURE__ */ jsxs43("div", { className: "flex items-center gap-3", children: [
4504
4536
  /* @__PURE__ */ jsx62(LinkTile, { kind: linked.kind }),
@@ -4506,9 +4538,10 @@ function CardBody({ linked, readOnly }) {
4506
4538
  /* @__PURE__ */ jsx62("span", { className: "block min-w-0 text-body-2-strong text-text-primary", children: /* @__PURE__ */ jsx62(Link, { href: linked.href, variant: "quiet", truncate: true, className: "block", children: linked.title }) }),
4507
4539
  meta && /* @__PURE__ */ jsx62("span", { className: "truncate text-caption text-text-secondary", children: meta })
4508
4540
  ] }),
4509
- (linked.done || linked.members) && // On the title's line, not halfway down the header.
4541
+ (linked.done || linked.conversation || linked.members) && // On the title's line, not halfway down the header: the ring, the count, the faces, as a row's (Katerina, 30 Oct).
4510
4542
  /* @__PURE__ */ jsxs43("span", { className: "flex h-[19.6px] shrink-0 items-center gap-2 self-start", children: [
4511
4543
  linked.done && /* @__PURE__ */ jsx62(ProgressRing, { done: linked.done.done, total: linked.done.total }),
4544
+ linked.conversation && /* @__PURE__ */ jsx62(CommentCount, { conversation: linked.conversation, noun: linked.conversation.noun }),
4512
4545
  linked.members && /* @__PURE__ */ jsx62(AvatarGroup, { members: linked.members, size: 16, on })
4513
4546
  ] })
4514
4547
  ] }),
@@ -4532,16 +4565,18 @@ function CardBody({ linked, readOnly }) {
4532
4565
  /* @__PURE__ */ jsx62("p", { className: "line-clamp-2 text-body-2 text-text-secondary", children: linked.latest.body })
4533
4566
  ] })
4534
4567
  ] }),
4535
- /* @__PURE__ */ jsxs43("div", { className: "flex min-h-6 items-center gap-2", children: [
4568
+ footed && /* @__PURE__ */ jsxs43("div", { className: "flex min-h-6 items-center gap-2", children: [
4536
4569
  (linked.status || linked.owner) && /* @__PURE__ */ jsx62(LinkPickers, { status: linked.status, owner: linked.owner, ownerLabel: linked.ownerLabel, readOnly }),
4537
4570
  linked.authors ? /* @__PURE__ */ jsxs43("span", { className: "flex min-w-0 items-center gap-2 text-caption text-text-secondary", children: [
4538
4571
  /* @__PURE__ */ jsx62(AvatarGroup, { members: linked.authors, size: 16, on }),
4539
- linked.updated && /* @__PURE__ */ jsx62("span", { className: "shrink-0", children: linked.updated })
4572
+ linked.updated && /* @__PURE__ */ jsxs43("span", { className: "shrink-0 italic", children: [
4573
+ "Updated ",
4574
+ linked.updated
4575
+ ] })
4540
4576
  ] }) : !linked.status && !linked.owner && linked.updated && /* @__PURE__ */ jsxs43("span", { className: "text-caption italic text-text-secondary", children: [
4541
4577
  "Updated ",
4542
4578
  linked.updated
4543
- ] }),
4544
- linked.conversation && /* @__PURE__ */ jsx62("span", { className: "ml-auto flex", children: /* @__PURE__ */ jsx62(CommentCount, { conversation: linked.conversation, noun: linked.conversation.noun }) })
4579
+ ] })
4545
4580
  ] })
4546
4581
  ] });
4547
4582
  }
@@ -4550,8 +4585,8 @@ function SaidBody({ linked }) {
4550
4585
  return /* @__PURE__ */ jsxs43(Fragment15, { children: [
4551
4586
  /* @__PURE__ */ jsxs43("div", { className: "flex items-center gap-2", children: [
4552
4587
  /* @__PURE__ */ jsx62(Avatar, { name: author.name, src: author.picture, size: 24 }),
4553
- /* @__PURE__ */ jsx62("span", { className: "text-body-2-strong text-text-primary", children: author.name }),
4554
- /* @__PURE__ */ jsx62("span", { className: cn("text-caption text-text-muted", TIME_CLASSES), children: /* @__PURE__ */ jsx62(Link, { href: linked.href, variant: "quiet", children: linked.updated ?? "Open" }) })
4588
+ /* @__PURE__ */ jsx62("span", { className: "text-body-2-strong text-text-primary", children: linked.updated ? author.name : /* @__PURE__ */ jsx62(Link, { href: linked.href, variant: "quiet", children: author.name }) }),
4589
+ linked.updated && /* @__PURE__ */ jsx62("span", { className: cn("text-caption text-text-muted", TIME_CLASSES), children: /* @__PURE__ */ jsx62(Link, { href: linked.href, variant: "quiet", children: linked.updated }) })
4555
4590
  ] }),
4556
4591
  /* @__PURE__ */ jsx62("p", { className: "line-clamp-4 text-body-2 text-text-secondary", children: linked.body ?? linked.title })
4557
4592
  ] });
@@ -4567,7 +4602,7 @@ var KIND_SHAPE = {
4567
4602
  function LinkCardLoading({ kind, shape }) {
4568
4603
  const { subtitle = false, summary = true, rows = 0, latest = false, ring = false, footer = "line" } = shape ?? KIND_SHAPE[kind];
4569
4604
  const boxed = useContext8(inTheBox);
4570
- return /* @__PURE__ */ jsx62("div", { className: "animate-skeleton-in", "aria-busy": true, children: /* @__PURE__ */ jsxs43(Card, { fill: boxed ? "elevated" : "inset", "aria-hidden": true, className: cn(CARD_CLASSES, !boxed && "max-w-[480px]"), children: [
4605
+ return /* @__PURE__ */ jsx62("div", { className: "animate-skeleton-in", "aria-busy": true, children: /* @__PURE__ */ jsxs43(Card, { fill: boxed ? "elevated" : "inset", "aria-hidden": true, className: cn(CARD_CLASSES, "max-w-[480px]"), children: [
4571
4606
  /* @__PURE__ */ jsxs43("div", { className: "flex items-center gap-3", children: [
4572
4607
  /* @__PURE__ */ jsx62("span", { className: TYPE_TILE_CLASSES, children: /* @__PURE__ */ jsx62(LinkedIcon, { kind }) }),
4573
4608
  /* @__PURE__ */ jsxs43("span", { className: "flex min-w-0 flex-1 flex-col gap-1.5", children: [
@@ -4631,7 +4666,7 @@ function LinkChip({ link, preview = true }) {
4631
4666
  if (link.state === "unavailable") {
4632
4667
  return /* @__PURE__ */ jsxs44(InlineChip, { tone: "muted", icon: /* @__PURE__ */ jsx64(LinkedIcon, { kind: link.kind, size: 14, tone: "inherit" }), children: [
4633
4668
  link.noun,
4634
- ", not available"
4669
+ " not available"
4635
4670
  ] });
4636
4671
  }
4637
4672
  const { linked } = link;
@@ -4655,18 +4690,16 @@ function LinkChip({ link, preview = true }) {
4655
4690
  }
4656
4691
 
4657
4692
  // src/AttachedCard.tsx
4658
- import { useContext as useContext9 } from "react";
4659
4693
  import { jsx as jsx65, jsxs as jsxs45 } from "react/jsx-runtime";
4660
4694
  function AttachedCard({ link, children, onRemove }) {
4661
- const boxed = useContext9(inTheBox);
4662
4695
  return (
4663
- // At most 480px under a message or in a document, so it never runs the column's whole width; in a box it fills the box (Katerina, 29 Oct).
4664
- /* @__PURE__ */ jsxs45("div", { className: cn("group/card relative", !boxed && "max-w-[480px]"), children: [
4696
+ // At most 480px, so it never runs a column's or a wide box's whole width (Katerina, 29 and 30 Oct).
4697
+ /* @__PURE__ */ jsxs45("div", { className: "group/card relative max-w-[480px]", children: [
4665
4698
  link ? /* @__PURE__ */ jsx65(LinkCard, { link }) : children,
4666
4699
  onRemove && /* @__PURE__ */ jsx65(
4667
4700
  RemoveBadge,
4668
4701
  {
4669
- label: "Remove card",
4702
+ label: "Remove",
4670
4703
  onRemove,
4671
4704
  className: "opacity-0 group-hover/card:opacity-100 group-focus-within/card:opacity-100 focus-visible:opacity-100 [@media(hover:none)]:opacity-100"
4672
4705
  }
@@ -4676,16 +4709,16 @@ function AttachedCard({ link, children, onRemove }) {
4676
4709
  }
4677
4710
 
4678
4711
  // src/PartCard.tsx
4679
- import { useContext as useContext10 } from "react";
4712
+ import { useContext as useContext9 } from "react";
4680
4713
  import { jsx as jsx66, jsxs as jsxs46 } from "react/jsx-runtime";
4681
- function PartCard({ state = "ready", kind, heading, href, partKey, noun, openIn, children }) {
4714
+ function PartCard({ state = "ready", kind, heading, href, partKey, noun, openIn, children, action, maxHeight }) {
4682
4715
  const word = noun ?? kindNounOf({ kind }) ?? "File";
4683
- const boxed = useContext10(inTheBox);
4716
+ const boxed = useContext9(inTheBox);
4684
4717
  if (state === "loading") return /* @__PURE__ */ jsx66(LinkCardLoading, { kind, shape: { summary: true, rows: 0, footer: "none" } });
4685
4718
  if (state === "unavailable") return /* @__PURE__ */ jsx66(LinkUnavailable, { kind, noun: `A part of this ${word.toLowerCase()}`, openIn, card: true });
4686
4719
  return (
4687
- // In a box being written in, on the files' fill as the card beside it is; elsewhere at most 480px.
4688
- /* @__PURE__ */ jsxs46(Card, { fill: boxed ? "elevated" : "inset", className: cn("flex flex-col gap-3 p-3", !boxed && "max-w-[480px]"), children: [
4720
+ // At most 480px wide, in a box too; in a box being written in, on the files' fill as the card beside it is.
4721
+ /* @__PURE__ */ jsxs46(Card, { fill: boxed ? "elevated" : "inset", className: "flex max-w-[480px] flex-col gap-3 p-3", children: [
4689
4722
  /* @__PURE__ */ jsxs46("div", { className: "flex items-center gap-3", children: [
4690
4723
  /* @__PURE__ */ jsx66(LinkTile, { kind }),
4691
4724
  /* @__PURE__ */ jsxs46("span", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
@@ -4693,7 +4726,7 @@ function PartCard({ state = "ready", kind, heading, href, partKey, noun, openIn,
4693
4726
  /* @__PURE__ */ jsx66("span", { className: "truncate text-caption text-text-secondary", children: partKey ? `A part of ${partKey}` : `A part of this ${word.toLowerCase()}` })
4694
4727
  ] })
4695
4728
  ] }),
4696
- /* @__PURE__ */ jsx66("div", { className: QUOTE_BAR_CLASSES, children })
4729
+ action || maxHeight !== void 0 ? /* @__PURE__ */ jsx66(ShowMore, { maxHeight: maxHeight ?? Infinity, surface: boxed ? "elevated" : "inset", action, contentClassName: QUOTE_BAR_CLASSES, children }) : /* @__PURE__ */ jsx66("div", { className: QUOTE_BAR_CLASSES, children })
4697
4730
  ] })
4698
4731
  );
4699
4732
  }
@@ -5007,7 +5040,7 @@ function Tabs({ tabs, active, onChange, size = "default", className, ...aria })
5007
5040
  }
5008
5041
 
5009
5042
  // src/Toast.tsx
5010
- import { createContext as createContext8, useContext as useContext11, useMemo as useMemo6 } from "react";
5043
+ import { createContext as createContext8, useContext as useContext10, useMemo as useMemo6 } from "react";
5011
5044
  import { Toast as BaseToast } from "@base-ui/react/toast";
5012
5045
  import { IconAlertCircle as IconAlertCircle2, IconCircleCheck as IconCircleCheck2, IconCircleX as IconCircleX2 } from "@tabler/icons-react";
5013
5046
  import { jsx as jsx76, jsxs as jsxs55 } from "react/jsx-runtime";
@@ -5114,7 +5147,7 @@ function ToastList() {
5114
5147
  });
5115
5148
  }
5116
5149
  function useToast() {
5117
- const ctx = useContext11(ToastContext);
5150
+ const ctx = useContext10(ToastContext);
5118
5151
  if (!ctx) throw new Error("useToast must be used within ToastProvider");
5119
5152
  return ctx;
5120
5153
  }