@stll/ui 0.94.0 → 0.96.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/README.md +2 -1
- package/dist/components/control-face.d.ts +10 -0
- package/dist/components/control-face.js +13 -1
- package/dist/components/task-name.d.ts +13 -0
- package/dist/components/task-name.js +22 -0
- package/dist/components/task-name.native.d.ts +7 -0
- package/dist/components/task-name.native.js +14 -0
- package/dist/components/task-name.shared.d.ts +11 -0
- package/dist/components/task-name.shared.js +16 -0
- package/dist/inspector/entity-tab.d.ts +2 -1
- package/dist/inspector/entity-tab.js +2 -2
- package/dist/kanban/cell-action.d.ts +1 -16
- package/dist/kanban/cell-action.js +2 -17
- package/dist/kanban/column-header-shell.d.ts +4 -0
- package/dist/kanban/column-header-shell.js +7 -1
- package/dist/kanban/matrix.d.ts +1 -1
- package/dist/kanban/matrix.js +2 -2
- package/dist/kanban/subgroup-board.d.ts +1 -3
- package/dist/kanban/subgroup-board.js +10 -27
- package/dist/kanban/virtual-cell.d.ts +2 -5
- package/dist/kanban/virtual-cell.js +16 -14
- package/package.json +15 -2
package/README.md
CHANGED
|
@@ -215,7 +215,8 @@ const matrix = buildKanbanBoardMatrix({
|
|
|
215
215
|
subgroup,
|
|
216
216
|
rows,
|
|
217
217
|
resolveGroupValue,
|
|
218
|
-
uncategorizedLabel:
|
|
218
|
+
uncategorizedLabel: (propertyId) =>
|
|
219
|
+
propertyId === "status" ? "No status" : "No value",
|
|
219
220
|
});
|
|
220
221
|
|
|
221
222
|
<KanbanSubgroupBoard
|
|
@@ -95,6 +95,16 @@ export declare const LabelFace: ({ children, className }: {
|
|
|
95
95
|
children: ReactNode;
|
|
96
96
|
className?: string | undefined;
|
|
97
97
|
}) => import("react").JSX.Element;
|
|
98
|
+
/**
|
|
99
|
+
* One row of a list of choices, as `Label` draws it (its `choice` variant),
|
|
100
|
+
* for a pending list whose options wait on data: the same row box, holding
|
|
101
|
+
* the faces the view draws in place of the control and its caption. It is
|
|
102
|
+
* no control: it takes no pointer and is hidden from assistive technology.
|
|
103
|
+
*/
|
|
104
|
+
export declare const ChoiceFace: ({ children, className }: {
|
|
105
|
+
children: ReactNode;
|
|
106
|
+
className?: string | undefined;
|
|
107
|
+
}) => import("react").JSX.Element;
|
|
98
108
|
/**
|
|
99
109
|
* How a field's face lays out its parts, in `Form`'s names: `stack` puts the
|
|
100
110
|
* caption over the control over its lines (the field's column), `inline` a
|
|
@@ -118,6 +118,18 @@ const LabelFace = ({ children, className }) => /* @__PURE__ */ jsx("span", {
|
|
|
118
118
|
"data-slot": "label-face",
|
|
119
119
|
children
|
|
120
120
|
});
|
|
121
|
+
/**
|
|
122
|
+
* One row of a list of choices, as `Label` draws it (its `choice` variant),
|
|
123
|
+
* for a pending list whose options wait on data: the same row box, holding
|
|
124
|
+
* the faces the view draws in place of the control and its caption. It is
|
|
125
|
+
* no control: it takes no pointer and is hidden from assistive technology.
|
|
126
|
+
*/
|
|
127
|
+
const ChoiceFace = ({ children, className }) => /* @__PURE__ */ jsx("span", {
|
|
128
|
+
"aria-hidden": "true",
|
|
129
|
+
className: cn(LABEL_VARIANT_CLASS_NAME.choice, FACE_UNAVAILABLE_CLASS, className),
|
|
130
|
+
"data-slot": "choice-face",
|
|
131
|
+
children
|
|
132
|
+
});
|
|
121
133
|
const FIELD_FACE_LAYOUT_CLASS_NAMES = {
|
|
122
134
|
stack: "",
|
|
123
135
|
inline: "flex-row items-center"
|
|
@@ -189,4 +201,4 @@ const SplitButtonFace = ({ children, size = "md" }) => /* @__PURE__ */ jsxs("spa
|
|
|
189
201
|
children: /* @__PURE__ */ jsx(SplitButtonChevron, {})
|
|
190
202
|
})]
|
|
191
203
|
});
|
|
192
|
-
export { ButtonFace, CheckboxFace, FaceLabelPending, FieldDescriptionFace, FieldFace, FieldTriggerFace, InputFace, LabelFace, SPLIT_BUTTON_PRIMARY_CLASS, SPLIT_BUTTON_ROOT_CLASS, SPLIT_BUTTON_TRIGGER_CLASS, SegmentedIconToggleFace, SelectTriggerFace, SplitButtonChevron, SplitButtonFace, SwitchFace, TabsFace, buttonFaceClassName };
|
|
204
|
+
export { ButtonFace, CheckboxFace, ChoiceFace, FaceLabelPending, FieldDescriptionFace, FieldFace, FieldTriggerFace, InputFace, LabelFace, SPLIT_BUTTON_PRIMARY_CLASS, SPLIT_BUTTON_ROOT_CLASS, SPLIT_BUTTON_TRIGGER_CLASS, SegmentedIconToggleFace, SelectTriggerFace, SplitButtonChevron, SplitButtonFace, SwitchFace, TabsFace, buttonFaceClassName };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import "./text.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
import { TaskNameValue, useTaskDisplayName } from "./task-name.shared.js";
|
|
4
|
+
import { TextVariant } from "./text.shared.js";
|
|
5
|
+
import { TruncatedTextLines } from "./truncated-text-face.js";
|
|
6
|
+
export declare const TaskName: ({ className, name, numberOfLines, renderName, variant }: {
|
|
7
|
+
className?: string;
|
|
8
|
+
name: TaskNameValue;
|
|
9
|
+
numberOfLines?: Exclude<TruncatedTextLines, "none">;
|
|
10
|
+
renderName?: (name: string) => ReactNode;
|
|
11
|
+
variant?: TextVariant;
|
|
12
|
+
}) => import("react").JSX.Element;
|
|
13
|
+
export { useTaskDisplayName };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { BidiText } from "./bidi-text.js";
|
|
3
|
+
import { useTaskDisplayName } from "./task-name.shared.js";
|
|
4
|
+
import { Text } from "./text.js";
|
|
5
|
+
import { TRUNCATED_TEXT_LINES_CLASS } from "./truncated-text-face.js";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
// src/components/task-name.tsx
|
|
8
|
+
const TaskName = ({ className, name, numberOfLines, renderName, variant }) => {
|
|
9
|
+
const { label, isPlaceholder } = useTaskDisplayName(name);
|
|
10
|
+
const classes = cn(numberOfLines !== void 0 && TRUNCATED_TEXT_LINES_CLASS[numberOfLines], className, isPlaceholder && "text-muted-foreground");
|
|
11
|
+
const content = isPlaceholder || renderName === void 0 ? label : renderName(label);
|
|
12
|
+
if (variant !== void 0) return /* @__PURE__ */ jsx(Text, {
|
|
13
|
+
className: classes,
|
|
14
|
+
variant,
|
|
15
|
+
children: /* @__PURE__ */ jsx(BidiText, { children: content })
|
|
16
|
+
});
|
|
17
|
+
return /* @__PURE__ */ jsx(BidiText, {
|
|
18
|
+
className: classes || void 0,
|
|
19
|
+
children: content
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
export { TaskName, useTaskDisplayName };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
import { TaskNameValue, useTaskDisplayName } from "./task-name.shared.js";
|
|
3
|
+
import { Text } from "./text.native.js";
|
|
4
|
+
export declare const TaskName: ({ name, className, ...props }: Omit<ComponentProps<typeof Text>, "children"> & {
|
|
5
|
+
name: TaskNameValue;
|
|
6
|
+
}) => import("react").JSX.Element;
|
|
7
|
+
export { useTaskDisplayName };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { useTaskDisplayName } from "./task-name.shared.js";
|
|
3
|
+
import { Text } from "./text.native.js";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
// src/components/task-name.native.tsx
|
|
6
|
+
const TaskName = ({ name, className, ...props }) => {
|
|
7
|
+
const { label, isPlaceholder } = useTaskDisplayName(name);
|
|
8
|
+
return /* @__PURE__ */ jsx(Text, {
|
|
9
|
+
className: cn(className, isPlaceholder && "text-muted-foreground"),
|
|
10
|
+
...props,
|
|
11
|
+
children: label
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
export { TaskName, useTaskDisplayName };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type TaskNameValue = string | null | undefined;
|
|
2
|
+
export declare const TASK_NAME_PLACEHOLDER_CLASS_NAME = "text-muted-foreground";
|
|
3
|
+
/** Resolve a display label without replacing any user-authored name. */
|
|
4
|
+
export declare const taskDisplayName: (name: TaskNameValue, untitled: () => string) => {
|
|
5
|
+
label: string;
|
|
6
|
+
isPlaceholder: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const useTaskDisplayName: (name: TaskNameValue) => {
|
|
9
|
+
label: string;
|
|
10
|
+
isPlaceholder: boolean;
|
|
11
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useTranslations } from "use-intl";
|
|
2
|
+
// src/components/task-name.shared.ts
|
|
3
|
+
const TASK_NAME_PLACEHOLDER_CLASS_NAME = "text-muted-foreground";
|
|
4
|
+
/** Resolve a display label without replacing any user-authored name. */
|
|
5
|
+
const taskDisplayName = (name, untitled) => typeof name !== "string" || name.trim() === "" ? {
|
|
6
|
+
label: untitled(),
|
|
7
|
+
isPlaceholder: true
|
|
8
|
+
} : {
|
|
9
|
+
label: name,
|
|
10
|
+
isPlaceholder: false
|
|
11
|
+
};
|
|
12
|
+
const useTaskDisplayName = (name) => {
|
|
13
|
+
const t = useTranslations();
|
|
14
|
+
return taskDisplayName(name, () => t("tasks.untitled"));
|
|
15
|
+
};
|
|
16
|
+
export { TASK_NAME_PLACEHOLDER_CLASS_NAME, taskDisplayName, useTaskDisplayName };
|
|
@@ -7,7 +7,7 @@ import { ComponentProps, ReactNode } from "react";
|
|
|
7
7
|
* inactive-state glyph; this only owns the cell's shared shape and
|
|
8
8
|
* affordances.
|
|
9
9
|
*/
|
|
10
|
-
export declare const InspectorEntityTab: ({ active, label, glyph, icon, inactiveIcon, onClose, onSelect, ...props }: InspectorEntityTabProps) => import("react").JSX.Element;
|
|
10
|
+
export declare const InspectorEntityTab: ({ active, label, tooltipContent, glyph, icon, inactiveIcon, onClose, onSelect, ...props }: InspectorEntityTabProps) => import("react").JSX.Element;
|
|
11
11
|
type InspectorEntityTabPassthroughProps = Omit<ComponentProps<"button">, "children" | "onAuxClick" | "onClick">;
|
|
12
12
|
/**
|
|
13
13
|
* What an inactive tab does to an `icon` it has no `glyph` to swap to.
|
|
@@ -28,6 +28,7 @@ export type InspectorEntityTabProps = {
|
|
|
28
28
|
/** Full entity name. Both the button's accessible name and the tooltip
|
|
29
29
|
* text — the cell itself never has room to show it. */
|
|
30
30
|
label: string;
|
|
31
|
+
tooltipContent?: ReactNode;
|
|
31
32
|
/**
|
|
32
33
|
* Short text shown in the cell instead of `icon` while the tab is
|
|
33
34
|
* inactive (e.g. a 3-character stem the host derives with
|
|
@@ -13,7 +13,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
13
13
|
* inactive-state glyph; this only owns the cell's shared shape and
|
|
14
14
|
* affordances.
|
|
15
15
|
*/
|
|
16
|
-
const InspectorEntityTab = ({ active, label, glyph, icon, inactiveIcon = "dim", onClose, onSelect, ...props }) => /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsx(InspectorRailTab, {
|
|
16
|
+
const InspectorEntityTab = ({ active, label, tooltipContent, glyph, icon, inactiveIcon = "dim", onClose, onSelect, ...props }) => /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsx(InspectorRailTab, {
|
|
17
17
|
...props,
|
|
18
18
|
active,
|
|
19
19
|
"aria-label": label,
|
|
@@ -34,7 +34,7 @@ const InspectorEntityTab = ({ active, label, glyph, icon, inactiveIcon = "dim",
|
|
|
34
34
|
})
|
|
35
35
|
}) }), /* @__PURE__ */ jsx(TooltipPopup, {
|
|
36
36
|
side: "left",
|
|
37
|
-
children: label
|
|
37
|
+
children: tooltipContent ?? label
|
|
38
38
|
})] });
|
|
39
39
|
/**
|
|
40
40
|
* Short abbreviation for a rail tab's inactive glyph: the filename stem,
|
|
@@ -1,20 +1,5 @@
|
|
|
1
1
|
import { Button } from "../components/button.js";
|
|
2
2
|
import { ComponentProps } from "react";
|
|
3
3
|
export type KanbanCellActionProps = Omit<ComponentProps<typeof Button>, "variant">;
|
|
4
|
-
/**
|
|
5
|
-
* The quiet action at the end of a cell: a full-width row that adds a card to
|
|
6
|
-
* that column and lane.
|
|
7
|
-
*
|
|
8
|
-
* Every board rendered its own copy of this row and the copies drifted in
|
|
9
|
-
* height, tone, and icon size. One primitive keeps the footer of every cell on
|
|
10
|
-
* the same rhythm as a card, so an empty cell and a full one end the same way.
|
|
11
|
-
*
|
|
12
|
-
* It is drawn as the outline of a card rather than as a button: the row stands
|
|
13
|
-
* where the next card will, so a dashed card-shaped slot says what pressing it
|
|
14
|
-
* produces, which a ghost button in the same place never did. It stays a
|
|
15
|
-
* `Button` underneath for the focus ring and the coarse-pointer touch target
|
|
16
|
-
* the variant already carries; only the height is restated per breakpoint,
|
|
17
|
-
* since the button's own size drops a step at `sm` and the row has to hold the
|
|
18
|
-
* board's chrome rhythm at every width.
|
|
19
|
-
*/
|
|
4
|
+
/** A quiet add-card action on the same row rhythm as the board chrome. */
|
|
20
5
|
export declare const KanbanCellAction: ({ children, className, ...props }: KanbanCellActionProps) => import("react").JSX.Element;
|
|
@@ -4,24 +4,9 @@ import { cn } from "../lib/utils.js";
|
|
|
4
4
|
import "./layout-tokens.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
// src/kanban/cell-action.tsx
|
|
7
|
-
/**
|
|
8
|
-
* The quiet action at the end of a cell: a full-width row that adds a card to
|
|
9
|
-
* that column and lane.
|
|
10
|
-
*
|
|
11
|
-
* Every board rendered its own copy of this row and the copies drifted in
|
|
12
|
-
* height, tone, and icon size. One primitive keeps the footer of every cell on
|
|
13
|
-
* the same rhythm as a card, so an empty cell and a full one end the same way.
|
|
14
|
-
*
|
|
15
|
-
* It is drawn as the outline of a card rather than as a button: the row stands
|
|
16
|
-
* where the next card will, so a dashed card-shaped slot says what pressing it
|
|
17
|
-
* produces, which a ghost button in the same place never did. It stays a
|
|
18
|
-
* `Button` underneath for the focus ring and the coarse-pointer touch target
|
|
19
|
-
* the variant already carries; only the height is restated per breakpoint,
|
|
20
|
-
* since the button's own size drops a step at `sm` and the row has to hold the
|
|
21
|
-
* board's chrome rhythm at every width.
|
|
22
|
-
*/
|
|
7
|
+
/** A quiet add-card action on the same row rhythm as the board chrome. */
|
|
23
8
|
const KanbanCellAction = ({ children, className, ...props }) => /* @__PURE__ */ jsxs(Button, {
|
|
24
|
-
className: cn("
|
|
9
|
+
className: cn("text-muted-foreground hover:text-foreground gap-1.5 px-3 text-sm", "h-9", "sm:h-9", className),
|
|
25
10
|
"data-slot": "kanban-cell-action",
|
|
26
11
|
...props,
|
|
27
12
|
variant: "ghost",
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { KANBAN_COLUMN_WIDTH_CLASS } from "./layout-tokens.js";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
|
+
/** The existing colour dot, shared by live headers and their loading faces. */
|
|
4
|
+
export declare const KanbanColumnColorSwatch: ({ color }: {
|
|
5
|
+
color: string;
|
|
6
|
+
}) => import("react").JSX.Element;
|
|
3
7
|
/** The column name and its count, as one cut line of text. */
|
|
4
8
|
export declare const KANBAN_COLUMN_NAME_CLASS = "flex flex-1 items-center gap-1.5 text-sm font-medium";
|
|
5
9
|
/**
|
|
@@ -3,6 +3,12 @@ import { cn } from "../lib/utils.js";
|
|
|
3
3
|
import { KANBAN_COLUMN_WIDTH_CLASS } from "./layout-tokens.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
// src/kanban/column-header-shell.tsx
|
|
6
|
+
/** The existing colour dot, shared by live headers and their loading faces. */
|
|
7
|
+
const KanbanColumnColorSwatch = ({ color }) => /* @__PURE__ */ jsx("span", {
|
|
8
|
+
"aria-hidden": "true",
|
|
9
|
+
className: "block size-2.5 shrink-0 rounded-full",
|
|
10
|
+
style: { backgroundColor: color }
|
|
11
|
+
});
|
|
6
12
|
/** The column name and its count, as one cut line of text. */
|
|
7
13
|
const KANBAN_COLUMN_NAME_CLASS = "flex flex-1 items-center gap-1.5 text-sm font-medium";
|
|
8
14
|
/**
|
|
@@ -45,4 +51,4 @@ const KanbanColumnHeaderShell = ({ swatch, name, calculation, dragHandle, action
|
|
|
45
51
|
actions
|
|
46
52
|
]
|
|
47
53
|
});
|
|
48
|
-
export { KANBAN_COLUMN_NAME_CLASS, KANBAN_COLUMN_WIDTH_CLASS, KanbanColumnHeaderShell, KanbanColumnNameFace, KanbanColumnTitleSlot };
|
|
54
|
+
export { KANBAN_COLUMN_NAME_CLASS, KANBAN_COLUMN_WIDTH_CLASS, KanbanColumnColorSwatch, KanbanColumnHeaderShell, KanbanColumnNameFace, KanbanColumnTitleSlot };
|
package/dist/kanban/matrix.d.ts
CHANGED
|
@@ -55,7 +55,7 @@ export type BuildKanbanBoardMatrixParams<TRow, TProperty, TGroupId extends strin
|
|
|
55
55
|
/** Terminal columns, rendered after grouping columns and empty by default. */
|
|
56
56
|
destinations?: readonly KanbanBoardDestination[];
|
|
57
57
|
rows: readonly TRow[];
|
|
58
|
-
uncategorizedLabel: string;
|
|
58
|
+
uncategorizedLabel: (propertyId: string) => string;
|
|
59
59
|
resolveGroupValue: (params: ResolveKanbanGroupValueParams<TRow, TProperty, TGroupId>) => string | null;
|
|
60
60
|
};
|
|
61
61
|
export type OrderKanbanCellsByColumnsParams<TRow> = {
|
package/dist/kanban/matrix.js
CHANGED
|
@@ -31,8 +31,8 @@ const cellKey = ({ column, lane }) => `${getKanbanBoardColumnIdentity(column)}|$
|
|
|
31
31
|
const groupContainsValue = (groups, value) => groups.some((group) => group.value === value);
|
|
32
32
|
const normalizeGroupValue = (groups, value) => groupContainsValue(groups, value) ? value : null;
|
|
33
33
|
const getRenderableGroups = (grouping, uncategorizedLabel) => {
|
|
34
|
-
if (!isKanbanGroupingRenderable(grouping)) return [];
|
|
35
|
-
return getKanbanGroups(resolveKanbanGroupOptions(grouping), uncategorizedLabel);
|
|
34
|
+
if (grouping.type === "none" || !isKanbanGroupingRenderable(grouping)) return [];
|
|
35
|
+
return getKanbanGroups(resolveKanbanGroupOptions(grouping), uncategorizedLabel(grouping.propertyId));
|
|
36
36
|
};
|
|
37
37
|
const makeLanes = (subgroup, uncategorizedLabel) => {
|
|
38
38
|
if (subgroup.type === "none") return [{ type: "none" }];
|
|
@@ -79,9 +79,7 @@ export type KanbanSubgroupBoardProps<TRow> = {
|
|
|
79
79
|
renderCell: (context: KanbanSubgroupCellContext<TRow>) => ReactNode;
|
|
80
80
|
/**
|
|
81
81
|
* What a lane's own row says about one column: its count by default. The
|
|
82
|
-
*
|
|
83
|
-
* scroll down a lane hundreds of cards tall — a calculation belongs here
|
|
84
|
-
* rather than at the end of a cell nobody reaches.
|
|
82
|
+
* summary stands in for the hidden cards of a collapsed lane.
|
|
85
83
|
*/
|
|
86
84
|
renderLaneColumnSummary?: ((context: KanbanSubgroupLaneColumnSummaryContext) => ReactNode) | undefined;
|
|
87
85
|
/**
|
|
@@ -11,17 +11,6 @@ import { KANBAN_STICKY_TOP_CLASS, KANBAN_STICKY_TOP_VAR, KanbanCollapsedBandCapt
|
|
|
11
11
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
12
|
import { useMemo, useRef, useState } from "react";
|
|
13
13
|
// src/kanban/subgroup-board.tsx
|
|
14
|
-
/**
|
|
15
|
-
* How far a lane's own pinned row reaches: its identity line over the line of
|
|
16
|
-
* per-column summaries, each fixed at the chrome row height.
|
|
17
|
-
*
|
|
18
|
-
* Stated rather than measured, because both lines are fixed by construction —
|
|
19
|
-
* a caller's summary or action renders inside a row that cannot grow — and the
|
|
20
|
-
* cells below have to know the offset before the first paint, or every card's
|
|
21
|
-
* pinned identity row spends that frame parked where the lane row is about
|
|
22
|
-
* to be.
|
|
23
|
-
*/
|
|
24
|
-
const LANE_ROW_HEIGHT_PX = 72;
|
|
25
14
|
const groupValueKey = (value) => value === null ? "null" : `value:${value.length}:${value}`;
|
|
26
15
|
const columnKey = (column) => column.type === "group" ? `group:${groupValueKey(column.group.value)}` : `destination:${column.destination.id}`;
|
|
27
16
|
const spanKey = (span) => span.band === null ? `single:${span.columns.map(columnKey).join("|")}` : `band:${span.band.id}`;
|
|
@@ -175,8 +164,7 @@ const KanbanSubgroupBoard = ({ scrollRef, matrix, renderColumnHeader, renderLane
|
|
|
175
164
|
* One row of the board, span by span. A folded band takes one narrow slot
|
|
176
165
|
* in every row; an open span lays its columns out at the column width.
|
|
177
166
|
*/
|
|
178
|
-
const renderRow = ({ className: rowClassName,
|
|
179
|
-
"aria-label": label,
|
|
167
|
+
const renderRow = ({ className: rowClassName, renderColumn, renderFoldedBand }) => /* @__PURE__ */ jsx("div", {
|
|
180
168
|
className: cn("flex gap-3", rowClassName),
|
|
181
169
|
children: spans.map((span) => {
|
|
182
170
|
const band = span.band;
|
|
@@ -253,10 +241,10 @@ const KanbanSubgroupBoard = ({ scrollRef, matrix, renderColumnHeader, renderLane
|
|
|
253
241
|
});
|
|
254
242
|
};
|
|
255
243
|
/** One column's cell in a lane's row: what it holds, then what it offers. */
|
|
256
|
-
const laneColumnCell = ({ group, column, count,
|
|
244
|
+
const laneColumnCell = ({ group, column, count, showSummary }) => /* @__PURE__ */ jsxs("div", {
|
|
257
245
|
className: cn("flex items-center gap-1 px-3", "h-9"),
|
|
258
|
-
"data-kanban-lane-column-count": count,
|
|
259
|
-
children: [
|
|
246
|
+
"data-kanban-lane-column-count": showSummary ? count : void 0,
|
|
247
|
+
children: [showSummary && (renderLaneColumnSummary ? renderLaneColumnSummary({
|
|
260
248
|
column,
|
|
261
249
|
count,
|
|
262
250
|
lane: group
|
|
@@ -272,13 +260,6 @@ const KanbanSubgroupBoard = ({ scrollRef, matrix, renderColumnHeader, renderLane
|
|
|
272
260
|
})]
|
|
273
261
|
});
|
|
274
262
|
const stickyTopStyle = { [KANBAN_STICKY_TOP_VAR]: `${String(headerHeight)}px` };
|
|
275
|
-
/**
|
|
276
|
-
* What a lane's cells find pinned above them: the board's header and the
|
|
277
|
-
* lane's own row. Restating the offset rather than adding to the inherited
|
|
278
|
-
* one, because a custom property that reads itself is a cycle and resolves
|
|
279
|
-
* to nothing at all.
|
|
280
|
-
*/
|
|
281
|
-
const laneCellsStickyTopStyle = { [KANBAN_STICKY_TOP_VAR]: `${String(headerHeight + LANE_ROW_HEIGHT_PX)}px` };
|
|
282
263
|
return /* @__PURE__ */ jsx("div", {
|
|
283
264
|
className: cn("h-full overflow-auto px-4 pb-4", className),
|
|
284
265
|
ref: scrollRef,
|
|
@@ -350,6 +331,9 @@ const KanbanSubgroupBoard = ({ scrollRef, matrix, renderColumnHeader, renderLane
|
|
|
350
331
|
const count = rowsIn(cells);
|
|
351
332
|
const defaultCollapsed = count === 0 ? !expandedEmptyLaneValues.has(group.value) : collapsedLaneValues.has(group.value);
|
|
352
333
|
const collapsed = isLaneCollapsed ? isLaneCollapsed(group, count) : defaultCollapsed;
|
|
334
|
+
const showSummaries = collapsed && count > 0;
|
|
335
|
+
const showColumnRow = showSummaries || !collapsed && renderLaneColumnAction !== void 0;
|
|
336
|
+
const laneCellsStickyTopStyle = { [KANBAN_STICKY_TOP_VAR]: `${String(headerHeight + 36 * (showColumnRow ? 2 : 1))}px` };
|
|
353
337
|
const cellFor = (column) => cells.find((candidate) => columnKey(candidate.coordinate.column) === columnKey(column));
|
|
354
338
|
return /* @__PURE__ */ jsxs("section", {
|
|
355
339
|
className: "border-border/60 border-b py-1 first:pt-0 last:border-b-0",
|
|
@@ -380,15 +364,14 @@ const KanbanSubgroupBoard = ({ scrollRef, matrix, renderColumnHeader, renderLane
|
|
|
380
364
|
})
|
|
381
365
|
]
|
|
382
366
|
})
|
|
383
|
-
}), renderRow({
|
|
384
|
-
label: "Lane column summaries",
|
|
367
|
+
}), showColumnRow && renderRow({
|
|
385
368
|
renderColumn: (column) => laneColumnCell({
|
|
386
369
|
group,
|
|
387
370
|
column,
|
|
388
371
|
count: cellFor(column)?.rows.length ?? 0,
|
|
389
|
-
|
|
372
|
+
showSummary: showSummaries
|
|
390
373
|
}),
|
|
391
|
-
renderFoldedBand: (_band, span) =>
|
|
374
|
+
renderFoldedBand: (_band, span) => showSummaries ? foldedCount(span, cells) : null
|
|
392
375
|
})]
|
|
393
376
|
}), !collapsed && /* @__PURE__ */ jsx("div", {
|
|
394
377
|
style: laneCellsStickyTopStyle,
|
|
@@ -39,11 +39,8 @@ export type KanbanVirtualCellProps<TRow> = {
|
|
|
39
39
|
active?: boolean | undefined;
|
|
40
40
|
backgroundColor?: string | undefined;
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* stronger accent-coloured wash and ring while `active` is also set. Omit
|
|
45
|
-
* for the plain neutral surface; `backgroundColor` still wins outright
|
|
46
|
-
* when both are given, since that prop is the caller's explicit override.
|
|
42
|
+
* Colour for the wash and ring while a card is dragged over the cell.
|
|
43
|
+
* An explicit `backgroundColor` still overrides the wash.
|
|
47
44
|
*/
|
|
48
45
|
accent?: OptionColor | undefined;
|
|
49
46
|
footer?: ReactNode;
|
|
@@ -15,10 +15,6 @@ const DEFAULT_LOAD_MORE_THRESHOLD_PX = 200;
|
|
|
15
15
|
/** The CSS custom property every accent tint and the active accent ring are
|
|
16
16
|
* derived from, so both stay in lockstep with the resolved colour token. */
|
|
17
17
|
const KANBAN_CELL_ACCENT_VAR = "--kanban-cell-accent";
|
|
18
|
-
/** Faint resting wash: matches the alpha `option-color` already uses for its
|
|
19
|
-
* own subtle background token, so a tinted cell reads at the same weight as
|
|
20
|
-
* the swatch and badges that carry the same colour. */
|
|
21
|
-
const KANBAN_CELL_ACCENT_RESTING_ALPHA = 12;
|
|
22
18
|
/** Stronger wash while a card is dragged over an accented cell. */
|
|
23
19
|
const KANBAN_CELL_ACCENT_ACTIVE_ALPHA = 22;
|
|
24
20
|
/** Ring alpha for the active accent frame, well above the wash so the frame
|
|
@@ -90,12 +86,14 @@ const KanbanVirtualCell = ({ rows, getRowKey, renderRow, pagination, sortable, c
|
|
|
90
86
|
if (containerRef) containerRef.current = element;
|
|
91
87
|
dropTarget.setNodeRef(element);
|
|
92
88
|
};
|
|
93
|
-
const { surface, style, hasAccent } = resolveKanbanCellAppearance({
|
|
89
|
+
const { surface, style, hasAccent, hasContent, hasFooter } = resolveKanbanCellAppearance({
|
|
94
90
|
accent,
|
|
95
91
|
active,
|
|
96
|
-
backgroundColor
|
|
92
|
+
backgroundColor,
|
|
93
|
+
footer,
|
|
94
|
+
hasRows: rows.length > 0
|
|
97
95
|
});
|
|
98
|
-
const hasStickyFooter = footerPlacement === "sticky-start" &&
|
|
96
|
+
const hasStickyFooter = footerPlacement === "sticky-start" && hasFooter;
|
|
99
97
|
const [stickyFooterElement, setStickyFooterElement] = useState(null);
|
|
100
98
|
const stickyFooterHeight = useLayoutMeasurement(stickyFooterElement, measureHeight, [], 0);
|
|
101
99
|
const stickyFooter = hasStickyFooter ? /* @__PURE__ */ jsx("div", {
|
|
@@ -108,7 +106,7 @@ const KanbanVirtualCell = ({ rows, getRowKey, renderRow, pagination, sortable, c
|
|
|
108
106
|
})
|
|
109
107
|
}) : null;
|
|
110
108
|
const content = /* @__PURE__ */ jsxs("div", {
|
|
111
|
-
className: cn(KANBAN_CELL_SURFACE_CLASS, "min-h-20 rounded-xl p-2", rows.length === 0 ? "overflow-visible" : "max-h-[min(60dvh,40rem)] overflow-y-auto overscroll-y-contain", active && !hasAccent && "bg-primary/5 ring-primary/50 ring-2", className),
|
|
109
|
+
className: cn(hasContent && KANBAN_CELL_SURFACE_CLASS, "min-h-20 rounded-xl p-2", rows.length === 0 ? "overflow-visible" : "max-h-[min(60dvh,40rem)] overflow-y-auto overscroll-y-contain", active && !hasAccent && "bg-primary/5 ring-primary/50 ring-2", className),
|
|
112
110
|
"data-kanban-cell": sortable?.dropTarget.id,
|
|
113
111
|
"data-kanban-cell-accent": hasAccent ? "true" : void 0,
|
|
114
112
|
onScroll: handleScroll,
|
|
@@ -153,11 +151,13 @@ const KanbanVirtualCell = ({ rows, getRowKey, renderRow, pagination, sortable, c
|
|
|
153
151
|
function measureHeight(element) {
|
|
154
152
|
return element.getBoundingClientRect().height;
|
|
155
153
|
}
|
|
156
|
-
function resolveKanbanCellAppearance({ accent, active, backgroundColor }) {
|
|
157
|
-
const
|
|
158
|
-
const
|
|
159
|
-
const
|
|
160
|
-
const
|
|
154
|
+
function resolveKanbanCellAppearance({ accent, active, backgroundColor, footer, hasRows }) {
|
|
155
|
+
const hasFooter = footer !== null && footer !== void 0 && typeof footer !== "boolean";
|
|
156
|
+
const hasContent = hasRows || hasFooter;
|
|
157
|
+
const accentVariants = active && accent !== void 0 ? resolveOptionColor(accent) : void 0;
|
|
158
|
+
const accentBackground = accentVariants === void 0 ? void 0 : `color-mix(in srgb, var(${KANBAN_CELL_ACCENT_VAR}) ${KANBAN_CELL_ACCENT_ACTIVE_ALPHA}%, var(--background))`;
|
|
159
|
+
const activeAccentRing = accentVariants !== void 0 ? `0 0 0 2px color-mix(in srgb, var(${KANBAN_CELL_ACCENT_VAR}) ${KANBAN_CELL_ACCENT_ACTIVE_RING_ALPHA}%, transparent)` : void 0;
|
|
160
|
+
const surface = (hasContent || active ? backgroundColor : void 0) ?? accentBackground;
|
|
161
161
|
return {
|
|
162
162
|
surface,
|
|
163
163
|
style: surface === void 0 ? void 0 : {
|
|
@@ -166,7 +166,9 @@ function resolveKanbanCellAppearance({ accent, active, backgroundColor }) {
|
|
|
166
166
|
...activeAccentRing === void 0 ? void 0 : { boxShadow: activeAccentRing },
|
|
167
167
|
...accentVariants === void 0 ? void 0 : { [KANBAN_CELL_ACCENT_VAR]: accentVariants.color }
|
|
168
168
|
},
|
|
169
|
-
hasAccent: accentVariants !== void 0
|
|
169
|
+
hasAccent: accentVariants !== void 0,
|
|
170
|
+
hasContent,
|
|
171
|
+
hasFooter
|
|
170
172
|
};
|
|
171
173
|
}
|
|
172
174
|
export { KANBAN_VIRTUAL_CELL_PAGINATION, KanbanVirtualCell };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stll/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.96.0",
|
|
4
4
|
"description": "Stella's design system: bidi-aware React primitives built on Base UI, the dockable inspector pane, and the Tailwind v4 theme they are styled with.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"base-ui",
|
|
@@ -82,6 +82,14 @@
|
|
|
82
82
|
"types": "./dist/components/bidi-text.d.ts",
|
|
83
83
|
"import": "./dist/components/bidi-text.js"
|
|
84
84
|
},
|
|
85
|
+
"./task-name": {
|
|
86
|
+
"react-native": {
|
|
87
|
+
"types": "./dist/components/task-name.native.d.ts",
|
|
88
|
+
"import": "./dist/components/task-name.native.js"
|
|
89
|
+
},
|
|
90
|
+
"types": "./dist/components/task-name.d.ts",
|
|
91
|
+
"import": "./dist/components/task-name.js"
|
|
92
|
+
},
|
|
85
93
|
"./brand-icons": {
|
|
86
94
|
"types": "./dist/components/brand-icons.d.ts",
|
|
87
95
|
"import": "./dist/components/brand-icons.js"
|
|
@@ -1054,6 +1062,7 @@
|
|
|
1054
1062
|
"tailwindcss": "4.3.5",
|
|
1055
1063
|
"tsdown": "0.23.7",
|
|
1056
1064
|
"tsrs": "7.1.0-beta.tsrs5",
|
|
1065
|
+
"use-intl": "4.15.1",
|
|
1057
1066
|
"vite": "8.3.8"
|
|
1058
1067
|
},
|
|
1059
1068
|
"peerDependencies": {
|
|
@@ -1072,7 +1081,8 @@
|
|
|
1072
1081
|
"react-native": ">=0.88.0",
|
|
1073
1082
|
"react-native-svg": ">=15.16.0",
|
|
1074
1083
|
"tailwindcss": "^4.3.0",
|
|
1075
|
-
"uniwind": ">=1.13.0"
|
|
1084
|
+
"uniwind": ">=1.13.0",
|
|
1085
|
+
"use-intl": "^4.0.0"
|
|
1076
1086
|
},
|
|
1077
1087
|
"peerDependenciesMeta": {
|
|
1078
1088
|
"@playwright/test": {
|
|
@@ -1095,6 +1105,9 @@
|
|
|
1095
1105
|
},
|
|
1096
1106
|
"uniwind": {
|
|
1097
1107
|
"optional": true
|
|
1108
|
+
},
|
|
1109
|
+
"use-intl": {
|
|
1110
|
+
"optional": true
|
|
1098
1111
|
}
|
|
1099
1112
|
},
|
|
1100
1113
|
"main": "./dist/index.js",
|