@stll/workspace-ui 0.17.0 → 0.18.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.
@@ -4,6 +4,7 @@ import { FeaturePreviewSurface } from "./surface.js";
4
4
  import { cents, formatMoneyCents, timeEntryAmount } from "@stll/money";
5
5
  import { BanknoteIcon } from "@stll/ui/icons";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { TruncatedText } from "@stll/ui/truncated-text";
7
8
  import { MatterIcon } from "@stll/ui/matter-icon";
8
9
  // src/feature-previews/billing-preview.tsx
9
10
  /** An invoice draft: the matter's time entries in date order with hours,
@@ -40,10 +41,7 @@ const BillingPreview = ({ labels, locale, data = DEFAULT_DATA, className }) => {
40
41
  children: [/* @__PURE__ */ jsx(MatterIcon, {
41
42
  className: "size-3.5 shrink-0",
42
43
  matter: data.matter
43
- }), /* @__PURE__ */ jsx("span", {
44
- className: "truncate",
45
- children: data.matter.name
46
- })]
44
+ }), /* @__PURE__ */ jsx(TruncatedText, { children: data.matter.name })]
47
45
  }), /* @__PURE__ */ jsxs("div", {
48
46
  className: "grid grid-cols-[auto_minmax(0,1fr)_auto_auto_auto] gap-x-4",
49
47
  children: [
@@ -81,10 +79,7 @@ const BillingPreview = ({ labels, locale, data = DEFAULT_DATA, className }) => {
81
79
  }
82
80
  })
83
81
  }),
84
- /* @__PURE__ */ jsx("span", {
85
- className: "truncate",
86
- children: row.description
87
- }),
82
+ /* @__PURE__ */ jsx(TruncatedText, { children: row.description }),
88
83
  /* @__PURE__ */ jsx("span", {
89
84
  className: "text-end tabular-nums",
90
85
  children: formatPreviewHours(locale, row.billedMinutes)
@@ -3,6 +3,7 @@ import { PREVIEW_MATTERS } from "./mock-data.js";
3
3
  import { FeaturePreviewSurface } from "./surface.js";
4
4
  import { Building2Icon, ShieldCheckIcon } from "@stll/ui/icons";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { TruncatedText } from "@stll/ui/truncated-text";
6
7
  import { MatterIcon } from "@stll/ui/matter-icon";
7
8
  import { DetailsGrid, DetailsItem } from "@stll/ui/details-grid";
8
9
  // src/feature-previews/contacts-preview.tsx
@@ -17,10 +18,7 @@ const ContactsPreview = ({ labels, locale, data: { company, linkedMatters } = DE
17
18
  children: [
18
19
  /* @__PURE__ */ jsxs("div", {
19
20
  className: "flex min-w-0 items-center gap-2 text-sm",
20
- children: [/* @__PURE__ */ jsx("span", {
21
- className: "truncate",
22
- children: company.legalForm
23
- }), /* @__PURE__ */ jsxs("span", {
21
+ children: [/* @__PURE__ */ jsx(TruncatedText, { children: company.legalForm }), /* @__PURE__ */ jsxs("span", {
24
22
  className: "text-success flex shrink-0 items-center gap-1 font-medium",
25
23
  children: [/* @__PURE__ */ jsx("span", { className: "size-1.5 rounded-full bg-current" }), company.status]
26
24
  })]
@@ -68,10 +66,7 @@ const ContactsPreview = ({ labels, locale, data: { company, linkedMatters } = DE
68
66
  children: [/* @__PURE__ */ jsx(MatterIcon, {
69
67
  className: "size-3.5 shrink-0",
70
68
  matter
71
- }), /* @__PURE__ */ jsx("span", {
72
- className: "truncate",
73
- children: matter.name
74
- })]
69
+ }), /* @__PURE__ */ jsx(TruncatedText, { children: matter.name })]
75
70
  }, matter.id))
76
71
  })]
77
72
  })
@@ -4,6 +4,7 @@ import { PREVIEW_MATTERS, PREVIEW_PEOPLE } from "./mock-data.js";
4
4
  import { FeaturePreviewSurface, PreviewAvatar, PreviewAvatarStack } from "./surface.js";
5
5
  import { CalendarIcon, FileTextIcon } from "@stll/ui/icons";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { TruncatedText } from "@stll/ui/truncated-text";
7
8
  import { cn } from "@stll/ui/utils";
8
9
  import { KanbanCardShell, KanbanColumnHeader } from "@stll/ui/kanban";
9
10
  import { MatterIcon } from "@stll/ui/matter-icon";
@@ -50,17 +51,14 @@ const PreviewTaskCard = ({ task, locale }) => {
50
51
  children: [
51
52
  /* @__PURE__ */ jsxs("span", {
52
53
  className: "flex min-w-0 items-start gap-1.5 leading-snug font-medium",
53
- children: [/* @__PURE__ */ jsx(Icon, { className: cn("mt-px size-3.5 shrink-0", TASK_STATUS_COLORS[task.status]) }), /* @__PURE__ */ jsx("span", {
54
- className: "line-clamp-2 min-w-0",
54
+ children: [/* @__PURE__ */ jsx(Icon, { className: cn("mt-px size-3.5 shrink-0", TASK_STATUS_COLORS[task.status]) }), /* @__PURE__ */ jsx(TruncatedText, {
55
+ lines: 2,
55
56
  children: task.name
56
57
  })]
57
58
  }),
58
59
  task.attachment === null ? null : /* @__PURE__ */ jsxs("span", {
59
60
  className: "text-muted-foreground flex min-w-0 items-center gap-1.5",
60
- children: [/* @__PURE__ */ jsx(FileTextIcon, { className: "size-3 shrink-0" }), /* @__PURE__ */ jsx("span", {
61
- className: "truncate",
62
- children: task.attachment
63
- })]
61
+ children: [/* @__PURE__ */ jsx(FileTextIcon, { className: "size-3 shrink-0" }), /* @__PURE__ */ jsx(TruncatedText, { children: task.attachment })]
64
62
  }),
65
63
  /* @__PURE__ */ jsxs("div", {
66
64
  className: "text-muted-foreground flex min-w-0 items-center gap-1.5 leading-none",
@@ -2,6 +2,7 @@ import { formatPreviewDate } from "./format.js";
2
2
  import { FeaturePreviewSurface } from "./surface.js";
3
3
  import { CaseLawIcon, SearchIcon } from "@stll/ui/icons";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { TruncatedText } from "@stll/ui/truncated-text";
5
6
  import { SEARCH_HIT_MARK, TextMark } from "@stll/ui/text-mark";
6
7
  import { DocumentIdentityBadge } from "@stll/ui/document-identity-badge";
7
8
  // src/feature-previews/research-preview.tsx
@@ -15,10 +16,7 @@ const ResearchPreview = ({ labels, locale, data = DEFAULT_DATA, className }) =>
15
16
  className: "flex h-full min-h-0 flex-col gap-2 p-3",
16
17
  children: [/* @__PURE__ */ jsxs("div", {
17
18
  className: "bg-card flex h-9 shrink-0 items-center gap-2 rounded-md border px-2.5 text-sm shadow-xs",
18
- children: [/* @__PURE__ */ jsx(SearchIcon, { className: "text-muted-foreground size-4 shrink-0" }), /* @__PURE__ */ jsx("span", {
19
- className: "truncate",
20
- children: data.query
21
- })]
19
+ children: [/* @__PURE__ */ jsx(SearchIcon, { className: "text-muted-foreground size-4 shrink-0" }), /* @__PURE__ */ jsx(TruncatedText, { children: data.query })]
22
20
  }), /* @__PURE__ */ jsx("ol", {
23
21
  className: "flex min-h-0 flex-col divide-y",
24
22
  children: data.decisions.map((decision) => /* @__PURE__ */ jsxs("li", {
@@ -32,8 +30,8 @@ const ResearchPreview = ({ labels, locale, data = DEFAULT_DATA, className }) =>
32
30
  courtAbbreviation: decision.court.abbreviation,
33
31
  courtTier: decision.court.tier
34
32
  } }),
35
- /* @__PURE__ */ jsx("span", {
36
- className: "truncate text-sm font-medium",
33
+ /* @__PURE__ */ jsx(TruncatedText, {
34
+ className: "text-sm font-medium",
37
35
  children: decision.court.name
38
36
  }),
39
37
  /* @__PURE__ */ jsx("span", {
@@ -54,8 +52,10 @@ const ResearchPreview = ({ labels, locale, data = DEFAULT_DATA, className }) =>
54
52
  className: "text-muted-foreground text-2xs font-mono",
55
53
  children: decision.fileNumber
56
54
  }),
57
- /* @__PURE__ */ jsxs("p", {
58
- className: "text-foreground-strong-muted line-clamp-2 leading-relaxed",
55
+ /* @__PURE__ */ jsxs(TruncatedText, {
56
+ className: "text-foreground-strong-muted leading-relaxed",
57
+ lines: 2,
58
+ render: /* @__PURE__ */ jsx("p", {}),
59
59
  children: [
60
60
  decision.before,
61
61
  /* @__PURE__ */ jsx(TextMark, {
@@ -1,4 +1,5 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { TruncatedText } from "@stll/ui/truncated-text";
2
3
  import { cn } from "@stll/ui/utils";
3
4
  import { ReviewAuthorAvatar } from "@stll/ui/review-author-avatar";
4
5
  // src/feature-previews/surface.tsx
@@ -15,8 +16,8 @@ const FeaturePreviewSurface = ({ icon, title, meta, className, children }) => /*
15
16
  className: "flex h-10 shrink-0 items-center gap-2 border-b px-3",
16
17
  children: [
17
18
  icon,
18
- /* @__PURE__ */ jsx("span", {
19
- className: "min-w-0 truncate text-sm font-medium",
19
+ /* @__PURE__ */ jsx(TruncatedText, {
20
+ className: "text-sm font-medium",
20
21
  children: title
21
22
  }),
22
23
  meta === void 0 ? null : /* @__PURE__ */ jsx("span", {
@@ -3,6 +3,7 @@ import { PREVIEW_MATTERS } from "./mock-data.js";
3
3
  import { FeaturePreviewSurface } from "./surface.js";
4
4
  import { ClockIcon, SquareIcon } from "@stll/ui/icons";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { TruncatedText } from "@stll/ui/truncated-text";
6
7
  import { MatterIcon } from "@stll/ui/matter-icon";
7
8
  // src/feature-previews/time-tracking-preview.tsx
8
9
  /** A running timer on a matter above the day's recorded entries and their
@@ -37,8 +38,8 @@ const TimeTrackingPreview = ({ labels, locale, data: { day, running, entries } =
37
38
  }),
38
39
  /* @__PURE__ */ jsxs("div", {
39
40
  className: "flex min-w-0 flex-1 flex-col gap-1",
40
- children: [/* @__PURE__ */ jsx("span", {
41
- className: "truncate text-sm font-medium",
41
+ children: [/* @__PURE__ */ jsx(TruncatedText, {
42
+ className: "text-sm font-medium",
42
43
  children: running.description
43
44
  }), /* @__PURE__ */ jsx(PreviewMatterLabel, { matter: running.matter })]
44
45
  }),
@@ -67,10 +68,7 @@ const TimeTrackingPreview = ({ labels, locale, data: { day, running, entries } =
67
68
  }),
68
69
  /* @__PURE__ */ jsxs("div", {
69
70
  className: "flex min-w-0 flex-1 flex-col gap-0.5",
70
- children: [/* @__PURE__ */ jsx("span", {
71
- className: "truncate",
72
- children: entry.description
73
- }), /* @__PURE__ */ jsx(PreviewMatterLabel, { matter: entry.matter })]
71
+ children: [/* @__PURE__ */ jsx(TruncatedText, { children: entry.description }), /* @__PURE__ */ jsx(PreviewMatterLabel, { matter: entry.matter })]
74
72
  }),
75
73
  /* @__PURE__ */ jsx("span", {
76
74
  className: "shrink-0 tabular-nums",
@@ -95,10 +93,7 @@ const PreviewMatterLabel = ({ matter }) => /* @__PURE__ */ jsxs("span", {
95
93
  children: [/* @__PURE__ */ jsx(MatterIcon, {
96
94
  className: "size-3 shrink-0",
97
95
  matter
98
- }), /* @__PURE__ */ jsx("span", {
99
- className: "truncate",
100
- children: matter.name
101
- })]
96
+ }), /* @__PURE__ */ jsx(TruncatedText, { children: matter.name })]
102
97
  });
103
98
  const DEFAULT_DATA = {
104
99
  day: "2026-10-19",
@@ -73,5 +73,12 @@ type PendingSkeletonProps = {
73
73
  };
74
74
  export declare const PendingSkeleton: ({ contentType }: PendingSkeletonProps) => import("react").JSX.Element;
75
75
  export declare const getSelectPropertyColor: (property: GenericProperty, option: string | null) => import("@stll/ui/option-color").ColorVariants | undefined;
76
- export declare const getIntClassName: (variant: FieldValueVariant) => "block max-w-full min-w-0 truncate text-start tabular-nums" | "block min-w-0 max-w-full truncate text-start text-sm tabular-nums" | "text-muted-foreground bg-muted/60 rounded-sm px-1.5 py-0.5 text-xs leading-none tabular-nums";
76
+ /**
77
+ * A formatted int or money value: a small chip on a card, one line cut at
78
+ * its container everywhere else.
79
+ */
80
+ export declare const NumericFieldText: ({ children, variant }: {
81
+ children: string;
82
+ variant: FieldValueVariant;
83
+ }) => import("react").JSX.Element;
77
84
  export {};
@@ -9,6 +9,7 @@ import { Temporal } from "temporal-polyfill/full";
9
9
  import { useTranslations } from "use-intl";
10
10
  import { BidiText } from "@stll/ui/bidi-text";
11
11
  import { Skeleton } from "@stll/ui/skeleton";
12
+ import { TruncatedText } from "@stll/ui/truncated-text";
12
13
  import { cn } from "@stll/ui/utils";
13
14
  // src/field-value.tsx
14
15
  const FieldValue = ({ content, property, pendingPreview, variant }) => {
@@ -74,27 +75,32 @@ const RecordFieldValue = ({ content, variant }) => {
74
75
  currency,
75
76
  locale
76
77
  }));
77
- const className = variant === "table" ? "line-clamp-2" : "line-clamp-2 text-sm";
78
+ const className = variant === "table" ? void 0 : "text-sm";
78
79
  switch (summary.type) {
79
- case "text": return /* @__PURE__ */ jsx(BidiText, {
80
- as: "span",
80
+ case "text": return /* @__PURE__ */ jsx(TruncatedText, {
81
81
  className,
82
+ lines: 2,
83
+ render: /* @__PURE__ */ jsx(BidiText, { as: "span" }),
82
84
  children: summary.text
83
85
  });
84
- case "records": return /* @__PURE__ */ jsx("span", {
86
+ case "records": return /* @__PURE__ */ jsx(TruncatedText, {
85
87
  className,
88
+ lines: 2,
86
89
  children: t("workspaces.fields.recordCount", { count: summary.count })
87
90
  });
88
- case "choose": return /* @__PURE__ */ jsx("span", {
91
+ case "choose": return /* @__PURE__ */ jsx(TruncatedText, {
89
92
  className: cn(className, "text-warning-foreground italic"),
93
+ lines: 2,
90
94
  children: t("workspaces.fields.recordChoose", { count: summary.count })
91
95
  });
92
- case "needs-review": return /* @__PURE__ */ jsx("span", {
96
+ case "needs-review": return /* @__PURE__ */ jsx(TruncatedText, {
93
97
  className: cn(className, "text-warning-foreground italic"),
98
+ lines: 2,
94
99
  children: t("workspaces.table.flags.needsReview")
95
100
  });
96
- case "not-found": return /* @__PURE__ */ jsx("span", {
101
+ case "not-found": return /* @__PURE__ */ jsx(TruncatedText, {
97
102
  className: cn(className, "text-muted-foreground italic"),
103
+ lines: 2,
98
104
  children: t("workspaces.fields.recordNotFound")
99
105
  });
100
106
  default: return panic("Unknown record field summary");
@@ -102,8 +108,8 @@ const RecordFieldValue = ({ content, variant }) => {
102
108
  };
103
109
  const IntFieldValue = ({ content, variant }) => {
104
110
  const format = useFormatter();
105
- return /* @__PURE__ */ jsx("span", {
106
- className: getIntClassName(variant ?? "default"),
111
+ return /* @__PURE__ */ jsx(NumericFieldText, {
112
+ variant: variant ?? "default",
107
113
  children: formatIntFieldValue({
108
114
  content,
109
115
  format
@@ -125,8 +131,8 @@ const formatIntFieldValue = ({ content, format }) => {
125
131
  };
126
132
  const MoneyFieldValue = ({ content, variant }) => {
127
133
  const locale = useFormattingLocale();
128
- return /* @__PURE__ */ jsx("span", {
129
- className: cn(getIntClassName(variant ?? "default")),
134
+ return /* @__PURE__ */ jsx(NumericFieldText, {
135
+ variant: variant ?? "default",
130
136
  children: formatMoneyCents({
131
137
  amountCents: content.amountCents,
132
138
  currency: content.currency,
@@ -136,14 +142,11 @@ const MoneyFieldValue = ({ content, variant }) => {
136
142
  };
137
143
  const PersonFieldValue = ({ content, variant }) => {
138
144
  return /* @__PURE__ */ jsxs("span", {
139
- className: cn("flex max-w-full min-w-0 items-center truncate", (variant ?? "default") === "kanban" ? "text-muted-foreground bg-muted/60 gap-1 rounded-sm px-1.5 py-0.5 text-xs leading-none" : "gap-1.5 text-sm"),
145
+ className: cn("flex max-w-full min-w-0 items-center", (variant ?? "default") === "kanban" ? "text-muted-foreground bg-muted/60 gap-1 rounded-sm px-1.5 py-0.5 text-xs leading-none" : "gap-1.5 text-sm"),
140
146
  children: [/* @__PURE__ */ jsx(PersonAvatar, {
141
147
  image: content.image,
142
148
  name: content.name
143
- }), /* @__PURE__ */ jsx("span", {
144
- className: "truncate",
145
- children: content.name
146
- })]
149
+ }), /* @__PURE__ */ jsx(TruncatedText, { children: content.name })]
147
150
  });
148
151
  };
149
152
  /**
@@ -189,9 +192,9 @@ const PendingFieldValue = ({ contentType, preview, variant }) => {
189
192
  "aria-label": t("workspaces.fields.calculating"),
190
193
  className: "flex min-w-0 flex-col gap-1",
191
194
  role: "status",
192
- children: hasPreview ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(BidiText, {
193
- as: "span",
194
- className: "line-clamp-2 min-w-0",
195
+ children: hasPreview ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(TruncatedText, {
196
+ lines: 2,
197
+ render: /* @__PURE__ */ jsx(BidiText, { as: "span" }),
195
198
  children: trimmedPreview
196
199
  }), /* @__PURE__ */ jsx(Skeleton, { className: "h-2.5 w-2/5" })] }) : /* @__PURE__ */ jsx(PendingSkeleton, { contentType })
197
200
  });
@@ -205,39 +208,47 @@ const PendingFieldValue = ({ contentType, preview, variant }) => {
205
208
  const ErrorFieldValue = ({ variant }) => {
206
209
  const t = useTranslations();
207
210
  if (variant === "kanban") return null;
208
- return /* @__PURE__ */ jsx("span", {
209
- className: "text-destructive line-clamp-2 text-sm italic",
211
+ return /* @__PURE__ */ jsx(TruncatedText, {
212
+ className: "text-destructive text-sm italic",
213
+ lines: 2,
210
214
  children: t("workspaces.fields.errored")
211
215
  });
212
216
  };
213
217
  const UnsupportedFieldValue = ({ variant }) => {
214
218
  const t = useTranslations();
215
219
  if (variant === "kanban") return null;
216
- return /* @__PURE__ */ jsx("span", {
217
- className: "text-muted-foreground line-clamp-2 text-sm italic",
220
+ return /* @__PURE__ */ jsx(TruncatedText, {
221
+ className: "text-muted-foreground text-sm italic",
222
+ lines: 2,
218
223
  children: t("workspaces.fields.formatNotSupported")
219
224
  });
220
225
  };
221
226
  const FileFieldValue = ({ content, variant }) => {
222
227
  if (variant === "kanban") return null;
228
+ if (variant === "table") return /* @__PURE__ */ jsx(TruncatedText, {
229
+ render: /* @__PURE__ */ jsx(BidiText, { as: "span" }),
230
+ children: content.fileName
231
+ });
223
232
  return /* @__PURE__ */ jsx(BidiText, {
224
233
  as: "span",
225
- className: variant === "table" ? "truncate" : "text-sm",
234
+ className: "text-sm",
226
235
  children: content.fileName
227
236
  });
228
237
  };
229
238
  const TextFieldValue = ({ content, variant }) => {
230
239
  if (variant === "kanban") {
231
240
  if (!content.value.trim()) return null;
232
- return /* @__PURE__ */ jsx(BidiText, {
233
- as: "span",
234
- className: "text-muted-foreground line-clamp-2 min-w-0 basis-full text-xs leading-4",
241
+ return /* @__PURE__ */ jsx(TruncatedText, {
242
+ className: "text-muted-foreground basis-full text-xs leading-4",
243
+ lines: 2,
244
+ render: /* @__PURE__ */ jsx(BidiText, { as: "span" }),
235
245
  children: content.value
236
246
  });
237
247
  }
238
- return /* @__PURE__ */ jsx(BidiText, {
239
- as: "span",
240
- className: variant === "table" ? "line-clamp-2" : "line-clamp-2 text-sm",
248
+ return /* @__PURE__ */ jsx(TruncatedText, {
249
+ className: variant === "table" ? void 0 : "text-sm",
250
+ lines: 2,
251
+ render: /* @__PURE__ */ jsx(BidiText, { as: "span" }),
241
252
  children: content.value
242
253
  });
243
254
  };
@@ -274,9 +285,9 @@ const DateFieldValue = ({ content, property, variant }) => {
274
285
  const SelectFieldValue = ({ property, value, variant }) => {
275
286
  const t = useTranslations();
276
287
  const color = getSelectPropertyColor(property, value);
277
- if (variant === "kanban") return /* @__PURE__ */ jsx(BidiText, {
278
- as: "span",
279
- className: "max-w-full truncate rounded-sm px-1.5 py-0.5 text-xs leading-none font-medium",
288
+ if (variant === "kanban") return /* @__PURE__ */ jsx(TruncatedText, {
289
+ className: "rounded-sm px-1.5 py-0.5 text-xs leading-none font-medium",
290
+ render: /* @__PURE__ */ jsx(BidiText, { as: "span" }),
280
291
  style: {
281
292
  backgroundColor: color?.background,
282
293
  color: color?.foreground
@@ -289,9 +300,8 @@ const SelectFieldValue = ({ property, value, variant }) => {
289
300
  backgroundColor: color?.background,
290
301
  color: color?.foreground
291
302
  },
292
- children: [variant === "table" && !value && /* @__PURE__ */ jsx(SquareMinusIcon, { className: "size-4" }), /* @__PURE__ */ jsx(BidiText, {
293
- as: "span",
294
- className: "truncate",
303
+ children: [variant === "table" && !value && /* @__PURE__ */ jsx(SquareMinusIcon, { className: "size-4" }), /* @__PURE__ */ jsx(TruncatedText, {
304
+ render: /* @__PURE__ */ jsx(BidiText, { as: "span" }),
295
305
  children: value ?? t("common.empty")
296
306
  })]
297
307
  });
@@ -319,14 +329,14 @@ const ClipFieldValue = ({ content, variant }) => {
319
329
  citation: content.citation,
320
330
  url: content.url
321
331
  });
322
- if (variant === "kanban") return /* @__PURE__ */ jsx(BidiText, {
323
- as: "span",
324
- className: "text-muted-foreground bg-muted/60 truncate rounded-sm px-1.5 py-0.5 text-xs leading-none",
332
+ if (variant === "kanban") return /* @__PURE__ */ jsx(TruncatedText, {
333
+ className: "text-muted-foreground bg-muted/60 rounded-sm px-1.5 py-0.5 text-xs leading-none",
334
+ render: /* @__PURE__ */ jsx(BidiText, { as: "span" }),
325
335
  children: value
326
336
  });
327
- return /* @__PURE__ */ jsx(BidiText, {
328
- as: "span",
329
- className: "text-muted-foreground block truncate text-sm",
337
+ return /* @__PURE__ */ jsx(TruncatedText, {
338
+ className: "text-muted-foreground text-sm",
339
+ render: /* @__PURE__ */ jsx(BidiText, { as: "span" }),
330
340
  children: value
331
341
  });
332
342
  };
@@ -351,9 +361,18 @@ const getSelectPropertyColor = (property, option) => {
351
361
  if (color === void 0) return;
352
362
  return resolveOptionColor(color);
353
363
  };
354
- const getIntClassName = (variant) => {
355
- if (variant === "kanban") return "text-muted-foreground bg-muted/60 rounded-sm px-1.5 py-0.5 text-xs leading-none tabular-nums";
356
- if (variant === "table") return "block max-w-full min-w-0 truncate text-start tabular-nums";
357
- return "block min-w-0 max-w-full truncate text-start text-sm tabular-nums";
364
+ /**
365
+ * A formatted int or money value: a small chip on a card, one line cut at
366
+ * its container everywhere else.
367
+ */
368
+ const NumericFieldText = ({ children, variant }) => {
369
+ if (variant === "kanban") return /* @__PURE__ */ jsx("span", {
370
+ className: "text-muted-foreground bg-muted/60 rounded-sm px-1.5 py-0.5 text-xs leading-none tabular-nums",
371
+ children
372
+ });
373
+ return /* @__PURE__ */ jsx(TruncatedText, {
374
+ className: cn("text-start tabular-nums", variant === "default" && "text-sm"),
375
+ children
376
+ });
358
377
  };
359
- export { ClipFieldValue, EmptyFieldValue, ErrorFieldValue, FieldValue, IntFieldValue, MoneyFieldValue, PendingSkeleton, PersonAvatar, PersonFieldValue, RecordFieldValue, UnsupportedFieldValue, formatIntFieldValue, getIntClassName, getSelectPropertyColor };
378
+ export { ClipFieldValue, EmptyFieldValue, ErrorFieldValue, FieldValue, IntFieldValue, MoneyFieldValue, NumericFieldText, PendingSkeleton, PersonAvatar, PersonFieldValue, RecordFieldValue, UnsupportedFieldValue, formatIntFieldValue, getSelectPropertyColor };
@@ -5,6 +5,7 @@ import { Menu, MenuPopup, MenuTrigger } from "@stll/ui/menu";
5
5
  import { useCallback, useEffect, useRef, useState } from "react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  import { BidiText } from "@stll/ui/bidi-text";
8
+ import { TruncatedText } from "@stll/ui/truncated-text";
8
9
  import { cn } from "@stll/ui/utils";
9
10
  import { attachClosestEdge } from "@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge/attach-closest-edge";
10
11
  import { extractClosestEdge } from "@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge/extract-closest-edge";
@@ -184,9 +185,9 @@ const WorkspaceViewTab = ({ actions, canReorder, direction, getDragData, getDrop
184
185
  onContextMenu: (event) => onContextMenu?.(view, event),
185
186
  onDoubleClick: (event) => onDoubleClick?.(view, event),
186
187
  value: view.id,
187
- children: [renderIcon(view), /* @__PURE__ */ jsx(BidiText, {
188
- as: "span",
189
- className: "max-w-36 overflow-hidden text-ellipsis whitespace-pre",
188
+ children: [renderIcon(view), /* @__PURE__ */ jsx(TruncatedText, {
189
+ className: "max-w-36 whitespace-pre",
190
+ render: /* @__PURE__ */ jsx(BidiText, { as: "span" }),
190
191
  children: view.name
191
192
  })]
192
193
  }),
@@ -4,6 +4,7 @@ import { Button } from "@stll/ui/button";
4
4
  import { PanelLeftIcon } from "@stll/ui/icons";
5
5
  import { Tooltip, TooltipPopup, TooltipTrigger } from "@stll/ui/tooltip";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { TruncatedText } from "@stll/ui/truncated-text";
7
8
  import { cn } from "@stll/ui/utils";
8
9
  import { InspectorDock, SIDE_RAIL_ICON_BUTTON_SIZE, TOOLBAR_ROW_HEIGHT } from "@stll/ui/inspector";
9
10
  import { ApplicationRail, ApplicationRailButton, ApplicationRailContent, ApplicationRailFooter, ApplicationRailHeader, ApplicationRailMenu } from "@stll/ui/application-rail";
@@ -184,8 +185,8 @@ const DescribedSidebar = ({ navigation, sidebar }) => {
184
185
  size: "rail",
185
186
  tooltip: item.label,
186
187
  onClick: item.onActivate,
187
- children: [item.icon, /* @__PURE__ */ jsx("span", {
188
- className: "truncate",
188
+ children: [item.icon, /* @__PURE__ */ jsx(TruncatedText, {
189
+ hint: false,
189
190
  children: item.label
190
191
  })]
191
192
  }) }, item.id)) })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stll/workspace-ui",
3
- "version": "0.17.0",
3
+ "version": "0.18.1",
4
4
  "description": "Reusable workspace presentation components and view helpers for Stella.",
5
5
  "keywords": [
6
6
  "calculations",
@@ -121,8 +121,8 @@
121
121
  "pack:dry-run": "bun pm pack --dry-run",
122
122
  "test": "bun test src",
123
123
  "typecheck": "bun check --no-pretty --all --project=tsconfig.json",
124
- "lint": "cd ../.. && bun --bun oxlint -c oxlint.config.ts --report-unused-disable-directives-severity=error --type-aware --type-check packages/workspace-ui",
125
- "lint:fix": "cd ../.. && bun --bun oxlint -c oxlint.config.ts --type-aware --fix packages/workspace-ui",
124
+ "lint": "cd ../.. && bun scripts/lint.ts packages/workspace-ui",
125
+ "lint:fix": "cd ../.. && bun scripts/lint.ts --fix packages/workspace-ui",
126
126
  "prepack": "bun run build",
127
127
  "test:property": "bun test --preload @stll/property-testing/preload $(grep -rlE 'fc\\.assert|assertProperty' src --include='*.test.ts')"
128
128
  },
@@ -130,7 +130,7 @@
130
130
  "@stll/calculations": "^0.1.4",
131
131
  "@stll/conditions": "^0.4.0",
132
132
  "@stll/money": "^0.4.0",
133
- "@stll/ui": "^0.68.0",
133
+ "@stll/ui": "^0.71.0",
134
134
  "better-result": "3.0.1",
135
135
  "temporal-polyfill": "1.0.6",
136
136
  "use-intl": "4.14.9"