@cosmicdrift/kumiko-renderer 0.415.0 → 0.416.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/app/action-form-body.d.ts +1 -1
- package/dist/app/action-form-body.js +43 -16
- package/dist/app/action-form-support.d.ts +4 -1
- package/dist/app/action-form-support.js +8 -4
- package/dist/app/client-actions.js +6 -4
- package/dist/app/config-edit-body.js +13 -4
- package/dist/app/extension-sections.d.ts +2 -0
- package/dist/app/projection-detail-body.js +8 -6
- package/dist/app/projection-detail-guidance.d.ts +1 -1
- package/dist/app/projection-detail-guidance.js +38 -26
- package/dist/app/projection-detail-header-model.d.ts +1 -1
- package/dist/app/projection-detail-header-model.js +10 -5
- package/dist/app/projection-detail-header.js +1 -1
- package/dist/app/projection-detail-navigation.d.ts +4 -0
- package/dist/app/projection-detail-navigation.js +5 -1
- package/dist/app/screen-shared.d.ts +1 -0
- package/dist/app/screen-shared.js +23 -3
- package/dist/app/use-projection-detail-actions.d.ts +13 -0
- package/dist/app/use-projection-detail-actions.js +14 -2
- package/dist/app/use-projection-detail-data.d.ts +2 -0
- package/dist/app/use-projection-detail-data.js +37 -10
- package/dist/components/ai-assist-payload.d.ts +2 -0
- package/dist/components/ai-assist-payload.js +8 -0
- package/dist/components/edit-mounts.d.ts +3 -2
- package/dist/components/edit-mounts.js +2 -2
- package/dist/components/multi-select-chips.d.ts +10 -0
- package/dist/components/multi-select-chips.js +18 -0
- package/dist/components/related-list-section.js +44 -32
- package/dist/components/related-photo-grid.d.ts +11 -0
- package/dist/components/related-photo-grid.js +40 -0
- package/dist/components/render-edit-action-button.d.ts +2 -2
- package/dist/components/render-edit-field-grid.js +3 -3
- package/dist/components/render-edit-header-actions.d.ts +2 -1
- package/dist/components/render-edit-header-actions.js +18 -1
- package/dist/components/render-edit-layout.js +2 -2
- package/dist/components/render-edit-logic.js +1 -0
- package/dist/components/render-edit-section-kinds.js +11 -0
- package/dist/components/render-edit-types.d.ts +11 -1
- package/dist/components/render-field-ai-assist.d.ts +13 -0
- package/dist/components/render-field-ai-assist.js +89 -0
- package/dist/components/render-field-choice-inputs.js +4 -0
- package/dist/components/render-field-control.d.ts +1 -1
- package/dist/components/render-field-control.js +18 -8
- package/dist/components/render-field-value-chips.d.ts +9 -0
- package/dist/components/render-field-value-chips.js +45 -0
- package/dist/components/render-field-write-only.js +12 -4
- package/dist/components/render-list-hint-columns.d.ts +1 -0
- package/dist/components/render-list-hint-columns.js +13 -0
- package/dist/components/use-render-edit-sections.js +5 -1
- package/dist/components/use-render-list-columns.js +3 -3
- package/dist/headless/format/index.d.ts +1 -0
- package/dist/headless/format/index.js +20 -0
- package/dist/headless/format/phone.d.ts +1 -0
- package/dist/headless/format/phone.js +8 -0
- package/dist/headless/format/relative-time.d.ts +13 -0
- package/dist/headless/format/relative-time.js +60 -0
- package/dist/headless/format/safe-locale.d.ts +1 -0
- package/dist/headless/format/safe-locale.js +13 -0
- package/dist/headless/index.d.ts +2 -2
- package/dist/headless/index.js +2 -2
- package/dist/headless/view-model/edit.d.ts +3 -2
- package/dist/headless/view-model/edit.js +78 -2
- package/dist/headless/view-model/field-text.d.ts +9 -0
- package/dist/headless/view-model/field-text.js +19 -0
- package/dist/headless/view-model/index.d.ts +1 -0
- package/dist/headless/view-model/index.js +1 -0
- package/dist/headless/view-model/types.d.ts +29 -3
- package/dist/i18n-defaults.js +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/primitives-record-guidance.d.ts +28 -1
- package/dist/primitives.d.ts +10 -3
- package/dist/web/app/dashboard-body.js +3 -2
- package/dist/web/app/dashboard-list-panel.js +1 -0
- package/dist/web/app/dashboard-panel-columns.d.ts +9 -0
- package/dist/web/app/dashboard-panel-columns.js +14 -0
- package/dist/web/app/dashboard-shared.js +1 -1
- package/dist/web/app/dashboard-stat-group-panel.js +9 -2
- package/dist/web/app/dashboard-text-panel.d.ts +1 -0
- package/dist/web/app/dashboard-text-panel.js +11 -9
- package/dist/web/app/relative-time.d.ts +0 -5
- package/dist/web/app/relative-time.js +1 -20
- package/dist/web/primitives/banner.js +11 -6
- package/dist/web/primitives/data-table/card-body.js +2 -2
- package/dist/web/primitives/data-table/card-row.js +7 -2
- package/dist/web/primitives/data-table/data-cell-props.d.ts +2 -0
- package/dist/web/primitives/data-table/data-cell-props.js +2 -0
- package/dist/web/primitives/data-table/row-click-guard.d.ts +2 -0
- package/dist/web/primitives/data-table/row-click-guard.js +19 -0
- package/dist/web/primitives/data-table/table-body.js +2 -1
- package/dist/web/primitives/data-table/table-content.js +6 -2
- package/dist/web/primitives/data-table-cell.d.ts +4 -1
- package/dist/web/primitives/data-table-cell.js +16 -2
- package/dist/web/primitives/default-form.js +6 -3
- package/dist/web/primitives/drawer.js +5 -1
- package/dist/web/primitives/form-footer-parts.js +4 -1
- package/dist/web/primitives/form.js +6 -8
- package/dist/web/primitives/index.js +4 -0
- package/dist/web/primitives/layout-elements.d.ts +1 -1
- package/dist/web/primitives/layout-elements.js +2 -2
- package/dist/web/primitives/locale-number.d.ts +0 -1
- package/dist/web/primitives/locale-number.js +1 -13
- package/dist/web/primitives/money-input.js +2 -1
- package/dist/web/primitives/narrow-pinned-footer.js +7 -3
- package/dist/web/primitives/number-input.js +2 -1
- package/dist/web/primitives/photo-grid.d.ts +3 -0
- package/dist/web/primitives/photo-grid.js +5 -0
- package/dist/web/primitives/record-steps.d.ts +1 -1
- package/dist/web/primitives/record-steps.js +4 -4
- package/dist/web/primitives/record-summary.d.ts +1 -1
- package/dist/web/primitives/record-summary.js +8 -3
- package/dist/web/primitives/step-list.d.ts +3 -0
- package/dist/web/primitives/step-list.js +11 -0
- package/dist/web/widgets/dashboard-list.d.ts +2 -0
- package/dist/web/widgets/dashboard-list.js +2 -2
- package/dist/web/widgets/drawer-panel-class.js +1 -1
- package/package.json +5 -5
- package/src/changes.json +54 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useContext } from "react";
|
|
3
|
+
import { Icon } from "../icons.js";
|
|
3
4
|
import { cn } from "../lib/cn.js";
|
|
4
5
|
import { InsideScreenFormColumnContext } from "./metric.js";
|
|
5
6
|
import { useIsBelowSmViewport } from "./use-narrow-viewport.js";
|
|
@@ -11,8 +12,12 @@ const SUMMARY_BORDER_CLASS = {
|
|
|
11
12
|
accent: "border-primary",
|
|
12
13
|
neutral: "border-border-strong",
|
|
13
14
|
};
|
|
14
|
-
export function DefaultRecordSummary({ text, narrowText, tone, testId, }) {
|
|
15
|
+
export function DefaultRecordSummary({ text, narrowText, tone, icon, testId, }) {
|
|
15
16
|
const insideScreenFormColumn = useContext(InsideScreenFormColumnContext);
|
|
16
17
|
const narrow = useIsBelowSmViewport();
|
|
17
|
-
|
|
18
|
+
const shownText = narrow && narrowText !== undefined ? narrowText : text;
|
|
19
|
+
if (icon !== undefined) {
|
|
20
|
+
return (_jsx("div", { className: cn("shrink-0", !insideScreenFormColumn && "px-6 py-2 max-sm:px-4"), children: _jsxs("p", { "data-testid": testId, "data-tone": tone, className: "m-0 flex items-start gap-2.5 font-heading text-[15px] leading-[1.5] sm:text-[17px] sm:leading-relaxed text-foreground", children: [_jsx(Icon, { name: icon, className: "mt-1 size-4 shrink-0 text-primary" }), _jsx("span", { children: shownText })] }) }));
|
|
21
|
+
}
|
|
22
|
+
return (_jsx("div", { className: cn("shrink-0", !insideScreenFormColumn && "px-6 py-2 max-sm:px-4"), children: _jsx("p", { "data-testid": testId, "data-tone": tone, className: cn("m-0 rounded-lg border border-l-[3px] bg-card px-3.5 py-2.5 sm:px-[18px] sm:py-3.5 font-heading text-[15px] leading-[1.5] sm:text-[17px] sm:leading-relaxed text-foreground", tone === undefined ? "border-l-primary" : SUMMARY_BORDER_CLASS[tone]), children: shownText }) }));
|
|
18
23
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { statusToneForOptionTone } from "../../status-tone.js";
|
|
3
|
+
import { StatusBadge } from "../widgets/status-badge.js";
|
|
4
|
+
export function DefaultStepList({ items, testId }) {
|
|
5
|
+
return (_jsx("ol", { "data-testid": testId, className: "m-0 flex list-none flex-col p-0", children: items.map((item, index) => {
|
|
6
|
+
const isLast = index === items.length - 1;
|
|
7
|
+
return (_jsxs("li", { "data-testid": testId !== undefined ? `${testId}-step-${item.id}` : undefined, className: "flex gap-3", children: [_jsxs("div", { className: "flex flex-col items-center", children: [_jsx("span", { className: "flex size-7 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-semibold text-muted-foreground", children: index + 1 }), !isLast && _jsx("span", { className: "my-1 w-px flex-1 bg-border" })] }), _jsxs("div", { className: isLast ? "flex flex-col gap-1" : "flex flex-col gap-1 pb-5", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx("span", { className: "text-sm font-medium", children: item.title }), item.status !== undefined && (_jsx(StatusBadge, { tone: (item.statusTone !== undefined
|
|
8
|
+
? statusToneForOptionTone(item.statusTone)
|
|
9
|
+
: undefined) ?? "muted", children: item.status }))] }), item.description !== undefined && (_jsx("span", { className: "text-sm text-muted-foreground", children: item.description }))] })] }, item.id));
|
|
10
|
+
}) }));
|
|
11
|
+
}
|
|
@@ -6,6 +6,8 @@ export type DashboardListColumn = {
|
|
|
6
6
|
/** Translated by the caller. */
|
|
7
7
|
readonly label: string;
|
|
8
8
|
readonly display?: "bar" | "badge" | "datetime" | "button";
|
|
9
|
+
/** `display: "button"` only: filled primary instead of outline. */
|
|
10
|
+
readonly buttonVariant?: "primary";
|
|
9
11
|
readonly badgeToneField?: string;
|
|
10
12
|
readonly badgeDot?: false;
|
|
11
13
|
/** `false` leaves an empty cell blank instead of drawing the placeholder. */
|
|
@@ -4,7 +4,7 @@ import { EMPTY_VALUE_PLACEHOLDER, } from "../../headless/index.js";
|
|
|
4
4
|
import { isSelectOptionTone } from "../../status-tone.js";
|
|
5
5
|
import { cn } from "../lib/cn.js";
|
|
6
6
|
import { HintCell } from "../primitives/data-table/hint-cell.js";
|
|
7
|
-
import { CellTextLink, LINK_BUTTON_CLASS, LIST_BADGE_TONE, rowToneClass, toneDotClass, } from "../primitives/data-table-cell.js";
|
|
7
|
+
import { CellTextLink, LINK_BUTTON_CLASS, LINK_BUTTON_PRIMARY_CLASS, LIST_BADGE_TONE, rowToneClass, toneDotClass, } from "../primitives/data-table-cell.js";
|
|
8
8
|
import { HintReasonRowScope, hintReasonOf } from "../primitives/hint-reason-row.js";
|
|
9
9
|
import { StatusBadge } from "./status-badge.js";
|
|
10
10
|
function fractionOf(raw) {
|
|
@@ -66,7 +66,7 @@ export function DashboardListCell({ column, row, formatPercent, formatNumber, fo
|
|
|
66
66
|
return empty;
|
|
67
67
|
const text = column.renderValue?.(raw, row) ?? String(raw);
|
|
68
68
|
const label = I18N_KEY_SHAPE.test(text) ? translate(text) : text;
|
|
69
|
-
return link === undefined ? (label) : (_jsx(CellTextLink, { link: link, className: LINK_BUTTON_CLASS, children: label }));
|
|
69
|
+
return link === undefined ? (label) : (_jsx(CellTextLink, { link: link, className: column.buttonVariant === "primary" ? LINK_BUTTON_PRIMARY_CLASS : LINK_BUTTON_CLASS, children: label }));
|
|
70
70
|
}
|
|
71
71
|
if (column.renderValue !== undefined) {
|
|
72
72
|
const text = column.renderValue(raw, row);
|
|
@@ -20,7 +20,7 @@ export function sidePanelClass(side, narrow, variant, belowHeader) {
|
|
|
20
20
|
return "inset-0 h-full w-full max-w-none rounded-none border-0 overflow-hidden";
|
|
21
21
|
}
|
|
22
22
|
if (narrow) {
|
|
23
|
-
return "inset-x-0 bottom-0 h-auto max-h-[
|
|
23
|
+
return "inset-x-0 bottom-0 h-auto max-h-[90vh] w-full max-w-none rounded-t-[2rem] border-t overflow-hidden";
|
|
24
24
|
}
|
|
25
25
|
if (variant === "flush") {
|
|
26
26
|
switch (side) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-renderer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.416.0",
|
|
4
4
|
"description": "React renderer for Kumiko screens. The root export holds the platform-agnostic logic (primitives contract, hooks, KumikoScreen, navigation and SSE abstractions); ./headless the DOM-free UI logic, ./live the HTTP dispatcher, ./web the browser bindings (HTML primitives, history navigation, EventSource live events, createKumikoApp).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@cosmicdrift/kumiko-framework": "0.
|
|
52
|
-
"@cosmicdrift/kumiko-types": "0.
|
|
51
|
+
"@cosmicdrift/kumiko-framework": "0.416.0",
|
|
52
|
+
"@cosmicdrift/kumiko-types": "0.416.0",
|
|
53
53
|
"@types/qrcode": "^1.5.6",
|
|
54
54
|
"class-variance-authority": "^0.7.1",
|
|
55
55
|
"clsx": "^2.1.1",
|
|
@@ -79,8 +79,8 @@
|
|
|
79
79
|
}
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
|
-
"@cosmicdrift/kumiko-locale-de": "0.
|
|
83
|
-
"@cosmicdrift/kumiko-testing": "0.
|
|
82
|
+
"@cosmicdrift/kumiko-locale-de": "0.416.0",
|
|
83
|
+
"@cosmicdrift/kumiko-testing": "0.416.0",
|
|
84
84
|
"@tailwindcss/cli": "^4.3.3",
|
|
85
85
|
"@testing-library/react": "^16.3.3",
|
|
86
86
|
"@testing-library/user-event": "^14.6.8",
|
package/src/changes.json
CHANGED
|
@@ -1,4 +1,58 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.416.0",
|
|
4
|
+
"type": "fix",
|
|
5
|
+
"title": "projectionDetail on a phone keeps metrics above the tabs and start-aligned footer actions visible",
|
|
6
|
+
"detail": "With `metricsPlacement: { narrow: \"after-guidance\" }` the metrics and tabs stay above the tab content on a phone. `footerActions` that mix an `align: \"start\"` action with others stay in the pinned footer instead of folding into the \"…\" menu; the start group fills the row."
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"version": "0.416.0",
|
|
10
|
+
"type": "improvement",
|
|
11
|
+
"title": "relativeTime options style, withTime, absoluteAfterDays, timeZone",
|
|
12
|
+
"detail": "A column renderer or metric format { format: \"relativeTime\" } accepts style \"short\" (41 min. ago), withTime (yesterday, 10:18 and the absolute date with the clock time), absoluteAfterDays n (absolute date such as 29 Oct 2026 from n days on) and timeZone. Boot validation rejects a bad style, a non-integer absoluteAfterDays below 1 and a non-boolean withTime. Without options the text is unchanged."
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"version": "0.416.0",
|
|
16
|
+
"type": "fix",
|
|
17
|
+
"title": "projectionDetail metrics format relativeTime in the UI locale",
|
|
18
|
+
"detail": "A metric with format { format: \"relativeTime\" } fell back to the browser language (\"42 minutes ago\" in a German UI). The metric now passes the UI locale, unless the format sets its own locale."
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"version": "0.416.0",
|
|
22
|
+
"type": "fix",
|
|
23
|
+
"title": "Inline card meta wraps instead of truncating equal-width columns",
|
|
24
|
+
"detail": "On phones, narrowInline list columns sit in a wrapping row with natural widths; only a single over-long element is truncated."
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"version": "0.416.0",
|
|
28
|
+
"type": "fix",
|
|
29
|
+
"title": "Banner actions wrap below the text on phones",
|
|
30
|
+
"detail": "A banner with actions (such as the projectionDetail banner) squeezed its text into a narrow column next to the buttons on phone widths. Below sm the row now wraps: the text keeps the line and the actions take their own line. Desktop is unchanged."
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"version": "0.416.0",
|
|
34
|
+
"type": "fix",
|
|
35
|
+
"title": "relativeTime counts calendar days and falls back to the browser language",
|
|
36
|
+
"detail": "\"Yesterday\" and the day count now come from calendar days in the format's timeZone (default: the runtime zone) instead of rounded hours, so a value from the day before yesterday no longer reads \"yesterday, 22:00\" shortly after midnight. Without a locale the format used en-US instead of the browser language."
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"version": "0.416.0",
|
|
40
|
+
"type": "fix",
|
|
41
|
+
"title": "Read-only settings fields offer no reset button",
|
|
42
|
+
"detail": "A configEdit field marked readOnly in the layout (including keys with mask.readOnly) no longer shows the \"reset override\" button in its cascade display."
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"version": "0.416.0",
|
|
46
|
+
"type": "fix",
|
|
47
|
+
"title": "Row click ignores controls inside custom cells and portaled content",
|
|
48
|
+
"detail": "A list with a row click opened the row when a button, link or input inside a custom cell was clicked, and also on clicks inside a drawer or menu portaled from that row. Those clicks now stay with their control."
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"version": "0.416.0",
|
|
52
|
+
"type": "improvement",
|
|
53
|
+
"title": "Column format relativeTime",
|
|
54
|
+
"detail": "A list column with renderer { format: \"relativeTime\" } shows an ISO timestamp or epoch ms as \"5 minutes ago\" in the user locale. The text is computed at render time and does not tick."
|
|
55
|
+
},
|
|
2
56
|
{
|
|
3
57
|
"version": "0.415.0",
|
|
4
58
|
"type": "fix",
|