@pipelex/mthds-form 0.36.0 → 0.36.1

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.
@@ -7168,11 +7168,12 @@ function FileRef({
7168
7168
  storageUrl,
7169
7169
  mimeType,
7170
7170
  filename,
7171
+ label: named,
7171
7172
  file
7172
7173
  }) {
7173
7174
  const s = useFieldStrings();
7174
7175
  const encoded = encodedFileSummary(url, s);
7175
- const label = filename ? filename : encoded ?? pathLabel(url);
7176
+ const label = named ?? (filename ? filename : encoded ?? pathLabel(url));
7176
7177
  const reference = encoded ?? url;
7177
7178
  const title = mimeType ? `${reference} \xB7 ${mimeType}` : reference;
7178
7179
  const href = viewableUrl(url);
@@ -7194,7 +7195,7 @@ function FileRef({
7194
7195
  "span",
7195
7196
  {
7196
7197
  title,
7197
- className: "min-w-0 truncate font-mono text-[12px] text-muted-foreground",
7198
+ className: "min-w-0 truncate font-mono text-[12px] text-muted-foreground max-sm:leading-11",
7198
7199
  children: label
7199
7200
  }
7200
7201
  ),
@@ -7459,7 +7460,10 @@ function DocumentValue({ value, whole = false }) {
7459
7460
  const file = useStuffFile("document", value);
7460
7461
  const content = readDocumentContent(value);
7461
7462
  if (!content) return /* @__PURE__ */ jsx(Absent, {});
7462
- const name = content.title ?? content.filename ?? fileLabel(content.url, content.filename, s);
7463
+ const label = fileLabel(content.url, content.filename, s);
7464
+ const title = content.title?.trim();
7465
+ const heading = title && title !== label ? title : void 0;
7466
+ const name = title || label;
7463
7467
  const preview = previewableUrl(content, resolve);
7464
7468
  const pdf = preview !== void 0 && isPdfDocument(content, preview);
7465
7469
  const opened = whole && isApp && pdf;
@@ -7469,13 +7473,23 @@ function DocumentValue({ value, whole = false }) {
7469
7473
  }) : void 0;
7470
7474
  return /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
7471
7475
  /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-start gap-2.5", children: [
7472
- /* @__PURE__ */ jsx(FileText, { "aria-hidden": true, className: "mt-0.5 size-4 shrink-0 text-muted-foreground" }),
7476
+ /* @__PURE__ */ jsx(
7477
+ FileText,
7478
+ {
7479
+ "aria-hidden": true,
7480
+ className: cn(
7481
+ "mt-0.5 size-4 shrink-0 text-muted-foreground",
7482
+ !heading && "max-sm:mt-3.5"
7483
+ )
7484
+ }
7485
+ ),
7473
7486
  /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1 space-y-0.5", children: [
7474
- name && /* @__PURE__ */ jsx("span", { className: "block truncate text-[13px] text-foreground", children: name }),
7487
+ heading && /* @__PURE__ */ jsx("span", { className: "block truncate text-[13px] text-foreground", children: heading }),
7475
7488
  /* @__PURE__ */ jsx(
7476
7489
  FileRef,
7477
7490
  {
7478
7491
  url: paintableUrl(content, resolve) ?? content.url,
7492
+ label,
7479
7493
  storageUrl: content.url,
7480
7494
  mimeType: content.mimeType,
7481
7495
  ...content.filename ? { filename: content.filename } : {},
@@ -9127,5 +9141,5 @@ function pdfFileName(field, value, baseName) {
9127
9141
  }
9128
9142
 
9129
9143
  export { BooleanField, ConceptPill, DEFAULT_FIELD_STRINGS, DateField, DocumentField, EN_FIELD_STRINGS, EnumField, FIELD_STRINGS_BY_LOCALE, FR_FIELD_STRINGS, FieldDomIdProvider, FieldPresentationProvider, FieldRenderer, FieldShell, FieldStringsProvider, FilePicker, FilePickerEntry, FillWithExample, HtmlPreview, ImageField, JsonView, ListField, Markdown, MethodForm, NumberField, ObjectField, OptionalToggle, PdfDownloadButton, ProseField, ResultEnvProvider, ResultField, ResultRoot, SUPPORTED_LOCALES, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, StuffViewer, Switch, TextField, ToggleGroup, ToggleGroupItem, UnknownField, actionShadowClass, checkedAccentClass, cn, enumLabeler, fieldControlClass, fieldLabel, fieldStringsFor, focusOutlineClass, headingClass, isThenable, linkTextClass, panelFlatShadowClass, panelRaisedShadowClass, panelSurfaceClass, renderHtmlPdf, resolveHtmlStorageUrls, saveInBrowser, selectedBorderClass, selectedFillClass, selectedFillStrongClass, useFieldDomId, useFieldPresentation, useFieldStrings, useMethodForm, useProseImages, useResolveDocumentPdf, useResolveRendition, useResolveShareUrl, useResolveUrl, useResolvedUrl };
9130
- //# sourceMappingURL=chunk-ROM2KLQD.js.map
9131
- //# sourceMappingURL=chunk-ROM2KLQD.js.map
9144
+ //# sourceMappingURL=chunk-TPHIENRU.js.map
9145
+ //# sourceMappingURL=chunk-TPHIENRU.js.map