@stll/workspace-ui 0.15.7 → 0.16.0
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.
- package/dist/calculation-format.d.ts +1 -3
- package/dist/calculation-format.js +1 -2
- package/dist/calculation-selection.d.ts +1 -3
- package/dist/calculation-selection.js +1 -2
- package/dist/calculations.d.ts +0 -2
- package/dist/calculations.js +1 -2
- package/dist/column-sort.d.ts +1 -3
- package/dist/column-sort.js +1 -2
- package/dist/conditions/builder.d.ts +1 -3
- package/dist/conditions/builder.js +31 -19
- package/dist/conditions/index.js +1 -1
- package/dist/conditions/logic.d.ts +0 -2
- package/dist/conditions/logic.js +1 -2
- package/dist/feature-previews/billing-preview.d.ts +1 -3
- package/dist/feature-previews/billing-preview.js +1 -2
- package/dist/feature-previews/contacts-preview.d.ts +1 -3
- package/dist/feature-previews/contacts-preview.js +1 -2
- package/dist/feature-previews/documents-preview.d.ts +1 -3
- package/dist/feature-previews/documents-preview.js +1 -2
- package/dist/feature-previews/format.d.ts +0 -2
- package/dist/feature-previews/format.js +1 -2
- package/dist/feature-previews/matters-preview.d.ts +1 -3
- package/dist/feature-previews/matters-preview.js +2 -3
- package/dist/feature-previews/mock-data.d.ts +1 -3
- package/dist/feature-previews/mock-data.js +1 -2
- package/dist/feature-previews/research-preview.d.ts +1 -3
- package/dist/feature-previews/research-preview.js +1 -2
- package/dist/feature-previews/surface.d.ts +0 -2
- package/dist/feature-previews/surface.js +1 -2
- package/dist/feature-previews/time-tracking-preview.d.ts +1 -3
- package/dist/feature-previews/time-tracking-preview.js +1 -2
- package/dist/field-value-logic.d.ts +25 -2
- package/dist/field-value-logic.js +36 -3
- package/dist/field-value.d.ts +7 -3
- package/dist/field-value.js +50 -12
- package/dist/formatting.d.ts +0 -2
- package/dist/formatting.js +1 -2
- package/dist/index.js +5 -5
- package/dist/kanban-grouping-picker.d.ts +1 -3
- package/dist/kanban-grouping-picker.js +1 -2
- package/dist/kanban-view.d.ts +0 -2
- package/dist/kanban-view.js +1 -2
- package/dist/property-icon.d.ts +1 -3
- package/dist/property-icon.js +6 -3
- package/dist/responsive-action-toolbar.d.ts +0 -2
- package/dist/responsive-action-toolbar.js +1 -2
- package/dist/sorts.d.ts +1 -3
- package/dist/sorts.js +1 -2
- package/dist/table-skeleton-rows.d.ts +0 -2
- package/dist/table-skeleton-rows.js +1 -2
- package/dist/task-status.d.ts +1 -3
- package/dist/task-status.js +1 -2
- package/dist/types.d.ts +49 -4
- package/dist/types.js +2 -2
- package/dist/view-switcher.d.ts +1 -3
- package/dist/view-switcher.js +1 -2
- package/dist/workspace-frame.d.ts +1 -3
- package/dist/workspace-frame.js +3 -3
- package/dist/workspace-frame.logic.d.ts +1 -3
- package/dist/workspace-frame.logic.js +1 -2
- package/package.json +5 -5
package/dist/field-value.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useFormatter, useFormattingLocale } from "./formatting.js";
|
|
2
1
|
import { emptyColor, resolveOptionColor } from "./colors.js";
|
|
3
|
-
import { getClipFieldValueLabel } from "./field-value-logic.js";
|
|
4
|
-
import {
|
|
2
|
+
import { getClipFieldValueLabel, summarizeRecordField } from "./field-value-logic.js";
|
|
3
|
+
import { useFormatter, useFormattingLocale } from "./formatting.js";
|
|
4
|
+
import { Result, panic } from "better-result";
|
|
5
5
|
import { formatMoneyCents } from "@stll/money";
|
|
6
6
|
import { SquareMinusIcon } from "@stll/ui/icons";
|
|
7
7
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -10,7 +10,7 @@ import { useTranslations } from "use-intl";
|
|
|
10
10
|
import { BidiText } from "@stll/ui/bidi-text";
|
|
11
11
|
import { Skeleton } from "@stll/ui/skeleton";
|
|
12
12
|
import { cn } from "@stll/ui/utils";
|
|
13
|
-
|
|
13
|
+
// src/field-value.tsx
|
|
14
14
|
const FieldValue = ({ content, property, pendingPreview, variant }) => {
|
|
15
15
|
const resolvedVariant = variant ?? "default";
|
|
16
16
|
if (!content) return resolvedVariant === "table" ? null : /* @__PURE__ */ jsx(EmptyFieldValue, { variant: resolvedVariant });
|
|
@@ -56,11 +56,50 @@ const FieldValue = ({ content, property, pendingPreview, variant }) => {
|
|
|
56
56
|
value: content.value,
|
|
57
57
|
variant: resolvedVariant
|
|
58
58
|
});
|
|
59
|
+
if (content.type === "record") return /* @__PURE__ */ jsx(RecordFieldValue, {
|
|
60
|
+
content,
|
|
61
|
+
variant: resolvedVariant
|
|
62
|
+
});
|
|
59
63
|
return /* @__PURE__ */ jsx(ClipFieldValue, {
|
|
60
64
|
content,
|
|
61
65
|
variant: resolvedVariant
|
|
62
66
|
});
|
|
63
67
|
};
|
|
68
|
+
const RecordFieldValue = ({ content, variant }) => {
|
|
69
|
+
const t = useTranslations();
|
|
70
|
+
const locale = useFormattingLocale();
|
|
71
|
+
if (variant === "kanban") return null;
|
|
72
|
+
const summary = summarizeRecordField(content.state, ({ amountMinor, currency }) => formatMoneyCents({
|
|
73
|
+
amountCents: amountMinor,
|
|
74
|
+
currency,
|
|
75
|
+
locale
|
|
76
|
+
}));
|
|
77
|
+
const className = variant === "table" ? "line-clamp-2" : "line-clamp-2 text-sm";
|
|
78
|
+
switch (summary.type) {
|
|
79
|
+
case "text": return /* @__PURE__ */ jsx(BidiText, {
|
|
80
|
+
as: "span",
|
|
81
|
+
className,
|
|
82
|
+
children: summary.text
|
|
83
|
+
});
|
|
84
|
+
case "records": return /* @__PURE__ */ jsx("span", {
|
|
85
|
+
className,
|
|
86
|
+
children: t("workspaces.fields.recordCount", { count: summary.count })
|
|
87
|
+
});
|
|
88
|
+
case "choose": return /* @__PURE__ */ jsx("span", {
|
|
89
|
+
className: cn(className, "text-warning-foreground italic"),
|
|
90
|
+
children: t("workspaces.fields.recordChoose", { count: summary.count })
|
|
91
|
+
});
|
|
92
|
+
case "needs-review": return /* @__PURE__ */ jsx("span", {
|
|
93
|
+
className: cn(className, "text-warning-foreground italic"),
|
|
94
|
+
children: t("workspaces.table.flags.needsReview")
|
|
95
|
+
});
|
|
96
|
+
case "not-found": return /* @__PURE__ */ jsx("span", {
|
|
97
|
+
className: cn(className, "text-muted-foreground italic"),
|
|
98
|
+
children: t("workspaces.fields.recordNotFound")
|
|
99
|
+
});
|
|
100
|
+
default: return panic("Unknown record field summary");
|
|
101
|
+
}
|
|
102
|
+
};
|
|
64
103
|
const IntFieldValue = ({ content, variant }) => {
|
|
65
104
|
const format = useFormatter();
|
|
66
105
|
return /* @__PURE__ */ jsx("span", {
|
|
@@ -97,7 +136,7 @@ const MoneyFieldValue = ({ content, variant }) => {
|
|
|
97
136
|
};
|
|
98
137
|
const PersonFieldValue = ({ content, variant }) => {
|
|
99
138
|
return /* @__PURE__ */ jsxs("span", {
|
|
100
|
-
className: cn("flex max-w-full min-w-0 items-center truncate", (variant ?? "default") === "kanban" ? "text-muted-foreground bg-muted/60 gap-1 rounded px-1.5 py-0.5 text-xs leading-none" : "gap-1.5 text-sm"),
|
|
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"),
|
|
101
140
|
children: [/* @__PURE__ */ jsx(PersonAvatar, {
|
|
102
141
|
image: content.image,
|
|
103
142
|
name: content.name
|
|
@@ -224,7 +263,7 @@ const DateFieldValue = ({ content, property, variant }) => {
|
|
|
224
263
|
timeZone: "UTC"
|
|
225
264
|
});
|
|
226
265
|
if (variant === "kanban") return /* @__PURE__ */ jsx("span", {
|
|
227
|
-
className: "text-muted-foreground bg-muted/60 rounded px-1.5 py-0.5 text-xs leading-none",
|
|
266
|
+
className: "text-muted-foreground bg-muted/60 rounded-sm px-1.5 py-0.5 text-xs leading-none",
|
|
228
267
|
children: formatted
|
|
229
268
|
});
|
|
230
269
|
return /* @__PURE__ */ jsx("span", {
|
|
@@ -237,7 +276,7 @@ const SelectFieldValue = ({ property, value, variant }) => {
|
|
|
237
276
|
const color = getSelectPropertyColor(property, value);
|
|
238
277
|
if (variant === "kanban") return /* @__PURE__ */ jsx(BidiText, {
|
|
239
278
|
as: "span",
|
|
240
|
-
className: "max-w-full truncate rounded px-1.5 py-0.5 text-xs leading-none font-medium",
|
|
279
|
+
className: "max-w-full truncate rounded-sm px-1.5 py-0.5 text-xs leading-none font-medium",
|
|
241
280
|
style: {
|
|
242
281
|
backgroundColor: color?.background,
|
|
243
282
|
color: color?.foreground
|
|
@@ -245,7 +284,7 @@ const SelectFieldValue = ({ property, value, variant }) => {
|
|
|
245
284
|
children: value ?? t("common.empty")
|
|
246
285
|
});
|
|
247
286
|
return /* @__PURE__ */ jsxs("span", {
|
|
248
|
-
className: variant === "table" ? "flex max-w-full items-center gap-x-1 rounded px-1 py-0.25 font-medium" : "flex w-max max-w-full items-center gap-x-1 rounded px-1 py-0.25 text-sm font-medium",
|
|
287
|
+
className: variant === "table" ? "flex max-w-full items-center gap-x-1 rounded-sm px-1 py-0.25 font-medium" : "flex w-max max-w-full items-center gap-x-1 rounded-sm px-1 py-0.25 text-sm font-medium",
|
|
249
288
|
style: {
|
|
250
289
|
backgroundColor: color?.background,
|
|
251
290
|
color: color?.foreground
|
|
@@ -282,7 +321,7 @@ const ClipFieldValue = ({ content, variant }) => {
|
|
|
282
321
|
});
|
|
283
322
|
if (variant === "kanban") return /* @__PURE__ */ jsx(BidiText, {
|
|
284
323
|
as: "span",
|
|
285
|
-
className: "text-muted-foreground bg-muted/60 truncate rounded px-1.5 py-0.5 text-xs leading-none",
|
|
324
|
+
className: "text-muted-foreground bg-muted/60 truncate rounded-sm px-1.5 py-0.5 text-xs leading-none",
|
|
286
325
|
children: value
|
|
287
326
|
});
|
|
288
327
|
return /* @__PURE__ */ jsx(BidiText, {
|
|
@@ -313,9 +352,8 @@ const getSelectPropertyColor = (property, option) => {
|
|
|
313
352
|
return resolveOptionColor(color);
|
|
314
353
|
};
|
|
315
354
|
const getIntClassName = (variant) => {
|
|
316
|
-
if (variant === "kanban") return "text-muted-foreground bg-muted/60 rounded px-1.5 py-0.5 text-xs leading-none tabular-nums";
|
|
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";
|
|
317
356
|
if (variant === "table") return "block max-w-full min-w-0 truncate text-start tabular-nums";
|
|
318
357
|
return "block min-w-0 max-w-full truncate text-start text-sm tabular-nums";
|
|
319
358
|
};
|
|
320
|
-
|
|
321
|
-
export { ClipFieldValue, EmptyFieldValue, ErrorFieldValue, FieldValue, IntFieldValue, MoneyFieldValue, PendingSkeleton, PersonAvatar, PersonFieldValue, UnsupportedFieldValue, formatIntFieldValue, getIntClassName, getSelectPropertyColor };
|
|
359
|
+
export { ClipFieldValue, EmptyFieldValue, ErrorFieldValue, FieldValue, IntFieldValue, MoneyFieldValue, PendingSkeleton, PersonAvatar, PersonFieldValue, RecordFieldValue, UnsupportedFieldValue, formatIntFieldValue, getIntClassName, getSelectPropertyColor };
|
package/dist/formatting.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PropsWithChildren } from "react";
|
|
2
2
|
import { createFormatter } from "use-intl/core";
|
|
3
|
-
//#region src/formatting.d.ts
|
|
4
3
|
type Formatter = ReturnType<typeof createFormatter>;
|
|
5
4
|
export type WorkspaceUiFormattingProviderProps = PropsWithChildren<{
|
|
6
5
|
/**
|
|
@@ -19,5 +18,4 @@ export type WorkspaceUiFormattingProviderProps = PropsWithChildren<{
|
|
|
19
18
|
export declare const WorkspaceUiFormattingProvider: ({ children, locale, timeZone }: WorkspaceUiFormattingProviderProps) => import("react").JSX.Element;
|
|
20
19
|
export declare const useFormatter: () => Formatter;
|
|
21
20
|
export declare const useFormattingLocale: () => string;
|
|
22
|
-
//#endregion
|
|
23
21
|
export {};
|
package/dist/formatting.js
CHANGED
|
@@ -2,7 +2,7 @@ import { panic } from "better-result";
|
|
|
2
2
|
import { createContext, useContext, useMemo } from "react";
|
|
3
3
|
import { createFormatter } from "use-intl/core";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
|
|
5
|
+
// src/formatting.tsx
|
|
6
6
|
const FormattingContext = createContext(void 0);
|
|
7
7
|
/**
|
|
8
8
|
* Supplies the locale this package formats numbers, money and dates in.
|
|
@@ -29,5 +29,4 @@ const useFormatting = () => {
|
|
|
29
29
|
};
|
|
30
30
|
const useFormatter = () => useFormatting().formatter;
|
|
31
31
|
const useFormattingLocale = () => useFormatting().locale;
|
|
32
|
-
//#endregion
|
|
33
32
|
export { WorkspaceUiFormattingProvider, useFormatter, useFormattingLocale };
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { CalculationKindPicker, CalculationPicker, CalculationSummary, ColumnCalculation, useCalculation } from "./calculations.js";
|
|
1
2
|
import { formatCalculationResult } from "./calculation-format.js";
|
|
2
3
|
import { applyCalculationSelection } from "./calculation-selection.js";
|
|
3
|
-
import { WorkspaceUiFormattingProvider } from "./formatting.js";
|
|
4
|
-
import { CalculationKindPicker, CalculationPicker, CalculationSummary, ColumnCalculation, useCalculation } from "./calculations.js";
|
|
5
4
|
import { emptyColor, optionColors, resolveOptionColor } from "./colors.js";
|
|
6
|
-
import { getClipFieldValueLabel } from "./field-value-logic.js";
|
|
7
|
-
import { FieldValue, IntFieldValue, MoneyFieldValue, PersonFieldValue } from "./field-value.js";
|
|
8
|
-
import { CONDITION_OPERATORS, appendChild, asGroup, buildLeaf, fieldForNode, isConditionOperator, isMultiValue, leafFromField, leafOperand, leafOperator, leafValueList, leafValueString, operandsEqual, operatorsFor, removeChild, replaceChild, valueEditorFor } from "./conditions/logic.js";
|
|
9
5
|
import { ConditionBuilder } from "./conditions/builder.js";
|
|
6
|
+
import { CONDITION_OPERATORS, appendChild, asGroup, buildLeaf, fieldForNode, isConditionOperator, isMultiValue, leafFromField, leafOperand, leafOperator, leafValueList, leafValueString, operandsEqual, operatorsFor, removeChild, replaceChild, valueEditorFor } from "./conditions/logic.js";
|
|
7
|
+
import { FieldValue, IntFieldValue, MoneyFieldValue, PersonFieldValue } from "./field-value.js";
|
|
8
|
+
import { getClipFieldValueLabel } from "./field-value-logic.js";
|
|
9
|
+
import { WorkspaceUiFormattingProvider } from "./formatting.js";
|
|
10
10
|
import { PropertyIcon } from "./property-icon.js";
|
|
11
11
|
import { SortChips } from "./sorts.js";
|
|
12
12
|
import { TableSkeletonRows } from "./table-skeleton-rows.js";
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { WorkspaceKanbanGroupingPickerProps, WorkspaceKanbanProperty } from "./kanban-view.js";
|
|
2
|
-
//#region src/kanban-grouping-picker.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Accessible picker shared by the board's Group and Sub-group controls. The
|
|
5
4
|
* caller labels built-ins because only its domain owns their human names.
|
|
6
5
|
*/
|
|
7
|
-
export declare const WorkspaceKanbanGroupingPicker: <TRow, TProperty extends WorkspaceKanbanProperty<TGroupId>, TGroupId extends string = string>({ allowNone, excludedGroupBy, getBuiltInGroupLabel, labels, onValueChange, schema, value }: WorkspaceKanbanGroupingPickerProps<TRow, TProperty, TGroupId>) => import("react").JSX.Element;
|
|
8
|
-
//#endregion
|
|
6
|
+
export declare const WorkspaceKanbanGroupingPicker: <TRow, TProperty extends WorkspaceKanbanProperty<TGroupId>, TGroupId extends string = string>({ allowNone, excludedGroupBy, getBuiltInGroupLabel, labels, onValueChange, schema, value }: WorkspaceKanbanGroupingPickerProps<TRow, TProperty, TGroupId>) => import("react").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getWorkspaceKanbanGroupingChoices } from "./kanban-view.js";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Select, SelectItem, SelectPopup, SelectTrigger, SelectValue } from "@stll/ui/select";
|
|
4
|
-
|
|
4
|
+
// src/kanban-grouping-picker.tsx
|
|
5
5
|
const NO_GROUPING_VALUE = "";
|
|
6
6
|
const toSelectTransportValue = (value) => value;
|
|
7
7
|
/**
|
|
@@ -42,5 +42,4 @@ const WorkspaceKanbanGroupingPicker = ({ allowNone, excludedGroupBy, getBuiltInG
|
|
|
42
42
|
}, choice.id))] })]
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
|
-
//#endregion
|
|
46
45
|
export { WorkspaceKanbanGroupingPicker };
|
package/dist/kanban-view.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { GenericProperty } from "./types.js";
|
|
2
2
|
import { KanbanBoardCell, KanbanBoardColumn, KanbanBoardLane, KanbanBoardMatrix, KanbanBuiltInGroup, KanbanColumnBandSpan, KanbanGrouping, KanbanSchema } from "@stll/ui/kanban";
|
|
3
|
-
//#region src/kanban-view.d.ts
|
|
4
3
|
export declare const KANBAN_EMPTY_GROUP_VISIBILITIES: {
|
|
5
4
|
readonly hide: "hide";
|
|
6
5
|
readonly show: "show";
|
|
@@ -130,5 +129,4 @@ export declare const presentKanbanBoard: <TRow>({ matrix, state }: {
|
|
|
130
129
|
matrix: KanbanBoardMatrix<TRow>;
|
|
131
130
|
state: KanbanSavedViewState;
|
|
132
131
|
}) => KanbanBoardPresentation<TRow>;
|
|
133
|
-
//#endregion
|
|
134
132
|
export {};
|
package/dist/kanban-view.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { panic } from "better-result";
|
|
2
2
|
import { orderKanbanCellsByColumns, resolveKanbanColumnBands, resolveKanbanGrouping } from "@stll/ui/kanban";
|
|
3
|
-
|
|
3
|
+
// src/kanban-view.ts
|
|
4
4
|
const KANBAN_EMPTY_GROUP_VISIBILITIES = {
|
|
5
5
|
hide: "hide",
|
|
6
6
|
show: "show"
|
|
@@ -139,5 +139,4 @@ const presentKanbanBoard = ({ matrix, state }) => {
|
|
|
139
139
|
matrix
|
|
140
140
|
};
|
|
141
141
|
};
|
|
142
|
-
//#endregion
|
|
143
142
|
export { KANBAN_EMPTY_GROUP_VISIBILITIES, KANBAN_SAVED_VIEW_STATE_VERSION, createWorkspaceKanbanSchema, getWorkspaceKanbanGroupingChoices, normalizeKanbanSavedViewState, presentKanbanBoard, resolveWorkspaceKanbanView };
|
package/dist/property-icon.d.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { FieldContent } from "./types.js";
|
|
2
|
-
//#region src/property-icon.d.ts
|
|
3
2
|
type FieldTypeWithoutPending = Exclude<FieldContent["type"], "pending">;
|
|
4
|
-
type PropertyContentType = "file" | "text" | "single-select" | "multi-select" | "date" | "int" | "money" | "person";
|
|
3
|
+
type PropertyContentType = "file" | "text" | "single-select" | "multi-select" | "date" | "int" | "money" | "person" | "record";
|
|
5
4
|
export type PropertyIconType = FieldTypeWithoutPending | PropertyContentType;
|
|
6
5
|
type PropertyHelperProps = {
|
|
7
6
|
type: PropertyIconType;
|
|
8
7
|
className?: string;
|
|
9
8
|
};
|
|
10
9
|
export declare const PropertyIcon: ({ type, className }: PropertyHelperProps) => import("react").JSX.Element;
|
|
11
|
-
//#endregion
|
|
12
10
|
export {};
|
package/dist/property-icon.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AlertCircleIcon, BanknoteIcon, CalendarIcon, CircleDotIcon, FileIcon, FileQuestionIcon, HashIcon, LinkIcon, ListChecksIcon, TextIcon, UserIcon } from "@stll/ui/icons";
|
|
1
|
+
import { AlertCircleIcon, BanknoteIcon, CalendarIcon, CircleDotIcon, DatabaseIcon, FileIcon, FileQuestionIcon, HashIcon, LinkIcon, ListChecksIcon, TextIcon, UserIcon } from "@stll/ui/icons";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { cn } from "@stll/ui/utils";
|
|
4
|
-
|
|
4
|
+
// src/property-icon.tsx
|
|
5
5
|
const propertyMap = {
|
|
6
6
|
text: {
|
|
7
7
|
icon: TextIcon,
|
|
@@ -15,6 +15,10 @@ const propertyMap = {
|
|
|
15
15
|
icon: UserIcon,
|
|
16
16
|
label: "Person"
|
|
17
17
|
},
|
|
18
|
+
record: {
|
|
19
|
+
icon: DatabaseIcon,
|
|
20
|
+
label: "Record"
|
|
21
|
+
},
|
|
18
22
|
file: {
|
|
19
23
|
icon: FileIcon,
|
|
20
24
|
label: "File"
|
|
@@ -52,5 +56,4 @@ const PropertyIcon = ({ type, className }) => {
|
|
|
52
56
|
const Icon = propertyMap[type].icon;
|
|
53
57
|
return /* @__PURE__ */ jsx(Icon, { className: cn("size-3.5 shrink-0", className) });
|
|
54
58
|
};
|
|
55
|
-
//#endregion
|
|
56
59
|
export { PropertyIcon };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
//#region src/responsive-action-toolbar.d.ts
|
|
3
2
|
export type ResponsiveActionToolbarSlot = "primary" | "secondary" | "action";
|
|
4
3
|
export declare const ResponsiveActionToolbar: ({ className, ...props }: React.ComponentProps<"div">) => React.JSX.Element;
|
|
5
4
|
type ResponsiveActionToolbarItemProps = React.PropsWithChildren<{
|
|
@@ -7,5 +6,4 @@ type ResponsiveActionToolbarItemProps = React.PropsWithChildren<{
|
|
|
7
6
|
className?: string | undefined;
|
|
8
7
|
}>;
|
|
9
8
|
export declare const ResponsiveActionToolbarItem: ({ slot, className, children }: ResponsiveActionToolbarItemProps) => React.JSX.Element;
|
|
10
|
-
//#endregion
|
|
11
9
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "@stll/ui/utils";
|
|
3
|
-
|
|
3
|
+
// src/responsive-action-toolbar.tsx
|
|
4
4
|
const RESPONSIVE_ACTION_TOOLBAR_SLOT_CLASS = {
|
|
5
5
|
primary: "min-w-56 flex-1",
|
|
6
6
|
secondary: "min-w-0 max-w-full",
|
|
@@ -14,5 +14,4 @@ const ResponsiveActionToolbarItem = ({ slot, className, children }) => /* @__PUR
|
|
|
14
14
|
className: cn(RESPONSIVE_ACTION_TOOLBAR_SLOT_CLASS[slot], className),
|
|
15
15
|
children
|
|
16
16
|
});
|
|
17
|
-
//#endregion
|
|
18
17
|
export { ResponsiveActionToolbar, ResponsiveActionToolbarItem };
|
package/dist/sorts.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ColumnSortKind, SortDirectionLabels } from "./column-sort.js";
|
|
2
2
|
import { PropertyIconType } from "./property-icon.js";
|
|
3
|
-
//#region src/sorts.d.ts
|
|
4
3
|
/** One sort a view carries. */
|
|
5
4
|
export type SortDescriptor = {
|
|
6
5
|
propertyId: string;
|
|
@@ -41,5 +40,4 @@ export type SortChipsProps = {
|
|
|
41
40
|
* the caller's answer, so this reads nothing but the three fields a chip
|
|
42
41
|
* draws.
|
|
43
42
|
*/
|
|
44
|
-
export declare const SortChips: ({ sorts, properties, onUpdate, labels, maxSorts }: SortChipsProps) => import("react").JSX.Element;
|
|
45
|
-
//#endregion
|
|
43
|
+
export declare const SortChips: ({ sorts, properties, onUpdate, labels, maxSorts }: SortChipsProps) => import("react").JSX.Element;
|
package/dist/sorts.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Button } from "@stll/ui/button";
|
|
|
4
4
|
import { ArrowUpDownIcon, XIcon } from "@stll/ui/icons";
|
|
5
5
|
import { Menu, MenuItem, MenuPopup, MenuTrigger } from "@stll/ui/menu";
|
|
6
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
|
|
7
|
+
// src/sorts.tsx
|
|
8
8
|
/**
|
|
9
9
|
* The view's sorts as chips, plus the menu that adds one.
|
|
10
10
|
*
|
|
@@ -71,5 +71,4 @@ const AddSortButton = ({ properties, sortedPropertyIds, onAdd, labels, disabled
|
|
|
71
71
|
}),
|
|
72
72
|
children: [/* @__PURE__ */ jsx(PropertyIcon, { type: property.type }), property.name]
|
|
73
73
|
}, property.id)) })] });
|
|
74
|
-
//#endregion
|
|
75
74
|
export { SortChips };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Column, RowData, TableFeatures } from "@tanstack/react-table";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
|
-
//#region src/table-skeleton-rows.d.ts
|
|
4
3
|
type TableSkeletonRowsProps<TFeatures extends TableFeatures, TData extends RowData> = {
|
|
5
4
|
columns: readonly Column<TFeatures, TData>[];
|
|
6
5
|
rowCount?: number;
|
|
@@ -14,5 +13,4 @@ type TableSkeletonRowsProps<TFeatures extends TableFeatures, TData extends RowDa
|
|
|
14
13
|
* columns (e.g. `table.getAllLeafColumns()`).
|
|
15
14
|
*/
|
|
16
15
|
export declare const TableSkeletonRows: <TFeatures extends TableFeatures, TData extends RowData>({ columns, rowCount, renderCell }: TableSkeletonRowsProps<TFeatures, TData>) => import("react").JSX.Element[];
|
|
17
|
-
//#endregion
|
|
18
16
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Skeleton } from "@stll/ui/skeleton";
|
|
3
3
|
import { TableCell, TableRow } from "@stll/ui/table";
|
|
4
|
-
|
|
4
|
+
// src/table-skeleton-rows.tsx
|
|
5
5
|
const SKELETON_ROW_KEYS = [
|
|
6
6
|
"a",
|
|
7
7
|
"b",
|
|
@@ -30,5 +30,4 @@ const TableSkeletonRows = ({ columns, rowCount = DEFAULT_SKELETON_ROW_COUNT, ren
|
|
|
30
30
|
return /* @__PURE__ */ jsx(TableCell, { children: custom === void 0 ? /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-3/5" }) : custom }, column.id);
|
|
31
31
|
}) }, rowKey));
|
|
32
32
|
};
|
|
33
|
-
//#endregion
|
|
34
33
|
export { TableSkeletonRows };
|
package/dist/task-status.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { LucideIcon } from "@stll/ui/icons";
|
|
2
|
-
//#region src/task-status.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* How a task's status is drawn: one glyph and one colour per status.
|
|
5
4
|
*
|
|
@@ -17,5 +16,4 @@ export declare const TASK_STATUS_COLORS: {
|
|
|
17
16
|
readonly done: "text-success dark:text-success";
|
|
18
17
|
readonly cancelled: "text-destructive dark:text-destructive";
|
|
19
18
|
};
|
|
20
|
-
export type TaskStatusGlyph = keyof typeof TASK_STATUS_ICONS;
|
|
21
|
-
//#endregion
|
|
19
|
+
export type TaskStatusGlyph = keyof typeof TASK_STATUS_ICONS;
|
package/dist/task-status.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CheckCircle2Icon, CircleDotIcon, CircleIcon, XCircleIcon } from "@stll/ui/icons";
|
|
2
|
-
|
|
2
|
+
// src/task-status.ts
|
|
3
3
|
/**
|
|
4
4
|
* How a task's status is drawn: one glyph and one colour per status.
|
|
5
5
|
*
|
|
@@ -23,5 +23,4 @@ const TASK_STATUS_COLORS = {
|
|
|
23
23
|
done: "text-success dark:text-success",
|
|
24
24
|
cancelled: "text-destructive dark:text-destructive"
|
|
25
25
|
};
|
|
26
|
-
//#endregion
|
|
27
26
|
export { TASK_STATUS_COLORS, TASK_STATUS_ICONS };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { KanbanColumnBand } from "@stll/ui/kanban";
|
|
2
2
|
import { OptionColor, OptionColor as OptionColor$1 } from "@stll/ui/option-color";
|
|
3
|
-
//#region src/types.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Why a document could not be converted. Mirrors the API contract type; the
|
|
6
5
|
* web app asserts both declarations stay equal.
|
|
@@ -92,9 +91,56 @@ export type FieldContent = {
|
|
|
92
91
|
citation?: string;
|
|
93
92
|
jurisdiction?: string;
|
|
94
93
|
sourceType?: string;
|
|
94
|
+
} | {
|
|
95
|
+
/**
|
|
96
|
+
* Typed records from a data source or a structured AI answer. The
|
|
97
|
+
* column's schema names the fields; the cell holds their values.
|
|
98
|
+
*/
|
|
99
|
+
type: "record";
|
|
100
|
+
version: 1;
|
|
101
|
+
schemaVersion: number;
|
|
102
|
+
state: RecordFieldState;
|
|
103
|
+
};
|
|
104
|
+
export type RecordFieldScalar = string | number | boolean | {
|
|
105
|
+
amountMinor: number;
|
|
106
|
+
currency: string;
|
|
107
|
+
} | null;
|
|
108
|
+
export type RecordFieldRecord = Record<string, RecordFieldScalar>;
|
|
109
|
+
export type RecordFieldProvenance = {
|
|
110
|
+
url: string;
|
|
111
|
+
retrievedAt: string;
|
|
112
|
+
sha256: string;
|
|
113
|
+
sourceDataAsOf?: string;
|
|
114
|
+
};
|
|
115
|
+
export type RecordFieldState = {
|
|
116
|
+
/** The tool refused its input; the source was not called. */
|
|
117
|
+
status: "input-needs-review";
|
|
118
|
+
input: RecordFieldRecord;
|
|
119
|
+
issues: {
|
|
120
|
+
key: string;
|
|
121
|
+
code: "missing" | "invalid" | "uncertain";
|
|
122
|
+
message: string;
|
|
123
|
+
}[];
|
|
124
|
+
} | {
|
|
125
|
+
status: "not-found";
|
|
126
|
+
input: RecordFieldRecord;
|
|
127
|
+
provenance: RecordFieldProvenance;
|
|
128
|
+
} | {
|
|
129
|
+
status: "resolved";
|
|
130
|
+
input?: RecordFieldRecord;
|
|
131
|
+
provenance?: RecordFieldProvenance;
|
|
132
|
+
result: {
|
|
133
|
+
kind: "one";
|
|
134
|
+
record: RecordFieldRecord;
|
|
135
|
+
} | {
|
|
136
|
+
/** Ambiguous for `candidates` until a person selects one. */
|
|
137
|
+
kind: "many" | "candidates";
|
|
138
|
+
records: RecordFieldRecord[];
|
|
139
|
+
selected: number | null;
|
|
140
|
+
};
|
|
95
141
|
};
|
|
96
142
|
/** Runtime names for every content arm the field renderer understands. */
|
|
97
|
-
export declare const FIELD_CONTENT_TYPES: readonly ["error", "pending", "unsupported", "text", "single-select", "multi-select", "file", "date", "int", "money", "person", "clip"];
|
|
143
|
+
export declare const FIELD_CONTENT_TYPES: readonly ["error", "pending", "unsupported", "text", "single-select", "multi-select", "file", "date", "int", "money", "person", "clip", "record"];
|
|
98
144
|
export type WorkspaceFieldContent = FieldContent & {
|
|
99
145
|
truncated?: true;
|
|
100
146
|
};
|
|
@@ -105,7 +151,7 @@ export type WorkspaceFieldContent = FieldContent & {
|
|
|
105
151
|
*/
|
|
106
152
|
export type GenericProperty = {
|
|
107
153
|
content: {
|
|
108
|
-
type: "file" | "text" | "date" | "int" | "money" | "person";
|
|
154
|
+
type: "file" | "text" | "date" | "int" | "money" | "person" | "record";
|
|
109
155
|
} | {
|
|
110
156
|
type: "single-select" | "multi-select";
|
|
111
157
|
options: {
|
|
@@ -116,5 +162,4 @@ export type GenericProperty = {
|
|
|
116
162
|
}[];
|
|
117
163
|
};
|
|
118
164
|
};
|
|
119
|
-
//#endregion
|
|
120
165
|
export type { OptionColor };
|
package/dist/types.js
CHANGED
package/dist/view-switcher.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { InlineDirection } from "@stll/ui/inline-reorder";
|
|
2
|
-
//#region src/view-switcher.d.ts
|
|
3
2
|
export type WorkspaceViewSwitcherItem = {
|
|
4
3
|
id: string;
|
|
5
4
|
name: string;
|
|
@@ -32,5 +31,4 @@ export type WorkspaceViewSwitcherProps<View extends WorkspaceViewSwitcherItem> =
|
|
|
32
31
|
};
|
|
33
32
|
renderIcon: (view: View) => React.ReactNode;
|
|
34
33
|
};
|
|
35
|
-
export declare const WorkspaceViewSwitcher: <View extends WorkspaceViewSwitcherItem>({ activeViewId, ariaLabel, direction, reorder, views, addControl, editing, onViewChange, onViewContextMenu, onViewDoubleClick, actionMenu, renderIcon }: WorkspaceViewSwitcherProps<View>) => import("react").JSX.Element;
|
|
36
|
-
//#endregion
|
|
34
|
+
export declare const WorkspaceViewSwitcher: <View extends WorkspaceViewSwitcherItem>({ activeViewId, ariaLabel, direction, reorder, views, addControl, editing, onViewChange, onViewContextMenu, onViewDoubleClick, actionMenu, renderIcon }: WorkspaceViewSwitcherProps<View>) => import("react").JSX.Element;
|
package/dist/view-switcher.js
CHANGED
|
@@ -14,7 +14,7 @@ import { InlineDropIndicator } from "@stll/ui/inline-drop-indicator";
|
|
|
14
14
|
import { reorderInlineIds, toInlineDropPosition } from "@stll/ui/inline-reorder";
|
|
15
15
|
import { TOOLBAR_ROW_HEIGHT } from "@stll/ui/inspector";
|
|
16
16
|
import { Tabs, TabsList, TabsTab } from "@stll/ui/tabs";
|
|
17
|
-
|
|
17
|
+
// src/view-switcher.tsx
|
|
18
18
|
const VIEW_DRAG_TYPE = "@stll/workspace-ui/view-switcher/drag-type";
|
|
19
19
|
const VIEW_DRAG_ID = "@stll/workspace-ui/view-switcher/view-id";
|
|
20
20
|
const VIEW_DRAG_INSTANCE = "@stll/workspace-ui/view-switcher/instance";
|
|
@@ -197,5 +197,4 @@ const WorkspaceViewTab = ({ actions, canReorder, direction, getDragData, getDrop
|
|
|
197
197
|
]
|
|
198
198
|
});
|
|
199
199
|
};
|
|
200
|
-
//#endregion
|
|
201
200
|
export { WorkspaceViewSwitcher };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ComponentProps, ReactElement, ReactNode } from "react";
|
|
2
2
|
import { InspectorDock } from "@stll/ui/inspector";
|
|
3
3
|
import { WorkspaceEndRail, WorkspaceShell } from "@stll/ui/workspace-shell";
|
|
4
|
-
//#region src/workspace-frame.d.ts
|
|
5
4
|
export type WorkspaceFrameNavigationItem = {
|
|
6
5
|
id: string;
|
|
7
6
|
label: string;
|
|
@@ -115,5 +114,4 @@ export type WorkspaceFrameTopBar = {
|
|
|
115
114
|
* mounts the shell from `@stll/ui/sidebar` there, as this app's `AppSidebar`
|
|
116
115
|
* does.
|
|
117
116
|
*/
|
|
118
|
-
export declare const WorkspaceFrame: (props: WorkspaceFrameProps) => import("react").JSX.Element;
|
|
119
|
-
//#endregion
|
|
117
|
+
export declare const WorkspaceFrame: (props: WorkspaceFrameProps) => import("react").JSX.Element;
|
package/dist/workspace-frame.js
CHANGED
|
@@ -12,7 +12,7 @@ import { Sheet, SheetPopup, SheetTitle } from "@stll/ui/sheet";
|
|
|
12
12
|
import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarHeader, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarProvider, useSidebar } from "@stll/ui/sidebar";
|
|
13
13
|
import { useIsMobile } from "@stll/ui/use-mobile";
|
|
14
14
|
import { WorkspaceEndRail, WorkspaceShell } from "@stll/ui/workspace-shell";
|
|
15
|
-
|
|
15
|
+
// src/workspace-frame.tsx
|
|
16
16
|
/**
|
|
17
17
|
* Stella's complete workspace frame. Hosts provide route descriptors and
|
|
18
18
|
* actions; this component owns the shell, application rail, end rail, and
|
|
@@ -90,7 +90,8 @@ const DescribedWorkspaceFrame = ({ children, endRail, inspector, navigation, top
|
|
|
90
90
|
...resolveSidebarProviderProps(navigation.sidebar),
|
|
91
91
|
children: shell
|
|
92
92
|
});
|
|
93
|
-
if (inspector
|
|
93
|
+
if (inspector === void 0) return frame;
|
|
94
|
+
if (inspector.mobile === void 0) return frame;
|
|
94
95
|
return /* @__PURE__ */ jsxs(Sheet, {
|
|
95
96
|
open: inspectorPresentation === "mobile" && inspector.mobile.open,
|
|
96
97
|
onOpenChange: (open) => {
|
|
@@ -194,5 +195,4 @@ const DescribedSidebar = ({ navigation, sidebar }) => {
|
|
|
194
195
|
]
|
|
195
196
|
});
|
|
196
197
|
};
|
|
197
|
-
//#endregion
|
|
198
198
|
export { WorkspaceFrame };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
//#region src/workspace-frame.logic.d.ts
|
|
2
1
|
export declare const resolveWorkspaceInspectorPresentation: ({ hasMobilePresentation, isCompact }: {
|
|
3
2
|
hasMobilePresentation: boolean;
|
|
4
3
|
isCompact: boolean;
|
|
5
|
-
}) => "desktop" | "mobile";
|
|
6
|
-
//#endregion
|
|
4
|
+
}) => "desktop" | "mobile";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
// src/workspace-frame.logic.ts
|
|
2
2
|
const resolveWorkspaceInspectorPresentation = ({ hasMobilePresentation, isCompact }) => hasMobilePresentation && isCompact ? "mobile" : "desktop";
|
|
3
|
-
//#endregion
|
|
4
3
|
export { resolveWorkspaceInspectorPresentation };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stll/workspace-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Reusable workspace presentation components and view helpers for Stella.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"calculations",
|
|
@@ -130,9 +130,9 @@
|
|
|
130
130
|
"@stll/calculations": "^0.1.3",
|
|
131
131
|
"@stll/conditions": "^0.4.0",
|
|
132
132
|
"@stll/money": "^0.3.1",
|
|
133
|
-
"@stll/ui": "^0.
|
|
133
|
+
"@stll/ui": "^0.67.0",
|
|
134
134
|
"better-result": "3.0.1",
|
|
135
|
-
"temporal-polyfill": "1.0.
|
|
135
|
+
"temporal-polyfill": "1.0.6",
|
|
136
136
|
"use-intl": "4.14.9"
|
|
137
137
|
},
|
|
138
138
|
"devDependencies": {
|
|
@@ -149,8 +149,8 @@
|
|
|
149
149
|
"react": "^19.3.1",
|
|
150
150
|
"react-dom": "^19.3.1",
|
|
151
151
|
"tailwindcss": "4.3.3",
|
|
152
|
-
"tsdown": "0.23.
|
|
153
|
-
"tsrs": "0.
|
|
152
|
+
"tsdown": "0.23.4",
|
|
153
|
+
"tsrs": "0.20.1-ts7.1.0-beta"
|
|
154
154
|
},
|
|
155
155
|
"peerDependencies": {
|
|
156
156
|
"@atlaskit/pragmatic-drag-and-drop": "^4.0.0",
|