@cosmicdrift/kumiko-renderer 0.418.0 → 0.420.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.js +7 -3
- package/dist/app/action-form-preview.d.ts +1 -1
- package/dist/app/action-form-preview.js +1 -1
- package/dist/app/action-form-support.d.ts +2 -0
- package/dist/app/action-form-support.js +16 -2
- package/dist/app/content-editors.d.ts +2 -0
- package/dist/app/entity-edit-prefill.js +24 -26
- package/dist/app/projection-detail-body.js +22 -1
- package/dist/app/projection-detail-header-model.js +2 -6
- package/dist/app/projection-detail-header-region.js +32 -21
- package/dist/app/projection-detail-header.d.ts +1 -0
- package/dist/app/use-projection-detail-layout.d.ts +2 -0
- package/dist/app/use-projection-detail-layout.js +2 -2
- package/dist/components/document-field-editor.d.ts +7 -0
- package/dist/components/document-field-editor.js +9 -0
- package/dist/components/document-text.d.ts +3 -0
- package/dist/components/document-text.js +32 -0
- package/dist/components/page-help-button.d.ts +43 -0
- package/dist/components/page-help-button.js +84 -0
- package/dist/components/render-edit-field-grid.js +10 -6
- package/dist/components/render-edit-section-kinds.js +8 -2
- package/dist/components/render-edit-types.d.ts +2 -0
- package/dist/components/render-field-ai-assist.js +19 -5
- package/dist/components/render-field-control.js +25 -3
- package/dist/components/render-list-toolbar.d.ts +1 -1
- package/dist/components/render-list-toolbar.js +2 -2
- package/dist/components/render-list.js +12 -2
- package/dist/headless/form/index.d.ts +1 -1
- package/dist/headless/form/index.js +1 -1
- package/dist/headless/format/document-values.d.ts +3 -0
- package/dist/headless/format/document-values.js +19 -8
- package/dist/headless/format/index.d.ts +1 -1
- package/dist/headless/index.d.ts +3 -3
- package/dist/headless/index.js +2 -2
- package/dist/headless/view-model/edit.js +15 -0
- package/dist/headless/view-model/index.d.ts +1 -1
- package/dist/headless/view-model/index.js +1 -1
- package/dist/headless/view-model/list.d.ts +1 -0
- package/dist/headless/view-model/list.js +3 -0
- package/dist/headless/view-model/types.d.ts +8 -1
- package/dist/i18n-defaults.js +3 -0
- package/dist/primitives.d.ts +17 -1
- package/dist/primitives.js +1 -1
- package/dist/status-tone.d.ts +4 -0
- package/dist/status-tone.js +6 -0
- package/dist/web/editor/editor-rail.js +1 -1
- package/dist/web/editor/editor-toolbar-pill.d.ts +4 -0
- package/dist/web/editor/editor-toolbar-pill.js +5 -0
- package/dist/web/editor/index.d.ts +1 -0
- package/dist/web/editor/index.js +1 -0
- package/dist/web/icons.d.ts +1 -0
- package/dist/web/icons.js +2 -1
- package/dist/web/index.d.ts +1 -1
- package/dist/web/index.js +1 -1
- package/dist/web/primitives/action-menu.d.ts +2 -0
- package/dist/web/primitives/action-menu.js +1 -1
- package/dist/web/primitives/button.d.ts +1 -1
- package/dist/web/primitives/button.js +3 -3
- package/dist/web/primitives/dialog.d.ts +1 -1
- package/dist/web/primitives/dialog.js +2 -2
- package/dist/web/primitives/layout-elements.d.ts +1 -1
- package/dist/web/primitives/layout-elements.js +8 -1
- package/dist/web/primitives/modal.d.ts +1 -1
- package/dist/web/primitives/modal.js +2 -2
- package/dist/web/primitives/page-header.d.ts +1 -1
- package/dist/web/primitives/page-header.js +5 -5
- package/dist/web/primitives/row-actions.d.ts +1 -1
- package/dist/web/primitives/row-actions.js +3 -3
- package/package.json +5 -5
- package/src/changes.json +24 -0
package/dist/web/icons.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { AlertTriangle, Archive, ArrowLeft, ArrowRight, BarChart3, Bell, BookOpen, Building, Calculator, CalendarDays, Camera, Check, CheckCircle2, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, CircleStop, ClipboardList, Clock, Coins, Copy, CreditCard, Download, Euro, ExternalLink, Eye, EyeOff, FileText, Filter, Flag, Folder, FolderOpen, Gauge, Hash, Headphones, Home, ImageIcon, Info, KeyRound, Languages, Layers, LayoutDashboard, LayoutGrid, LineChart, Link, List, Loader2, Lock, Mail, MapPin, Mic, MoreHorizontal, MoreVertical, Package, Palette, Phone, PiggyBank, Plus, Printer, Receipt, RefreshCw, Rocket, Save, Send, Server, Settings, Share2, Shield, ShieldCheck, Star, Table, Tag, Trash2, TrendingUp, Undo2, Upload, User, Users, Wallet, Warehouse, X, XCircle, } from "lucide-react";
|
|
2
|
+
import { AlertTriangle, Archive, ArrowLeft, ArrowRight, BarChart3, Bell, BookOpen, Building, Calculator, CalendarDays, Camera, Check, CheckCircle2, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, CircleHelp, CircleStop, ClipboardList, Clock, Coins, Copy, CreditCard, Download, Euro, ExternalLink, Eye, EyeOff, FileText, Filter, Flag, Folder, FolderOpen, Gauge, Hash, Headphones, Home, ImageIcon, Info, KeyRound, Languages, Layers, LayoutDashboard, LayoutGrid, LineChart, Link, List, Loader2, Lock, Mail, MapPin, Mic, MoreHorizontal, MoreVertical, Package, Palette, Phone, PiggyBank, Plus, Printer, Receipt, RefreshCw, Rocket, Save, Send, Server, Settings, Share2, Shield, ShieldCheck, Star, Table, Tag, Trash2, TrendingUp, Undo2, Upload, User, Users, Wallet, Warehouse, X, XCircle, } from "lucide-react";
|
|
3
3
|
import { DrawnPencil, DrawnSearch, DrawnSparkles, DrawnWand } from "./drawn-icons.js";
|
|
4
4
|
import { cn } from "./lib/cn.js";
|
|
5
5
|
export const NAV_ICONS = {
|
|
@@ -83,6 +83,7 @@ export const NAV_ICONS = {
|
|
|
83
83
|
"alert-triangle": AlertTriangle,
|
|
84
84
|
info: Info,
|
|
85
85
|
"check-circle": CheckCircle2,
|
|
86
|
+
"help-circle": CircleHelp,
|
|
86
87
|
"x-circle": XCircle,
|
|
87
88
|
loader: Loader2,
|
|
88
89
|
mic: Mic,
|
package/dist/web/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export { useResolvers } from "./app/resolvers-context.tsx";
|
|
|
15
15
|
export { clearRememberedListState } from "./app/session-list-state-store.ts";
|
|
16
16
|
export { DrawnFilter, DrawnPanel, DrawnPencil, DrawnSearch, DrawnSparkles, DrawnWand, } from "./drawn-icons.ts";
|
|
17
17
|
export type { EditorActionTestIds, EditorHeaderTestIds, EditorMode, EditorSaveActions, EditorWorkbenchProps, FooterTone, InfoBarTone, WorkbenchSave, } from "./editor/index.ts";
|
|
18
|
-
export { EditorBody, EditorFooter, EditorFrame, EditorHeader, EditorInfoBar, EditorLocaleSwitch, EditorModeSwitch, EditorWorkbench, formatRelativeWhen, RailField, RailHint, RailRow, RailSection, } from "./editor/index.ts";
|
|
18
|
+
export { EditorBody, EditorFooter, EditorFrame, EditorHeader, EditorInfoBar, EditorLocaleSwitch, EditorModeSwitch, EditorToolbarPill, EditorWorkbench, formatRelativeWhen, RailField, RailHint, RailRow, RailSection, } from "./editor/index.ts";
|
|
19
19
|
export type { NavIconKey } from "./icons.tsx";
|
|
20
20
|
export { Icon } from "./icons.tsx";
|
|
21
21
|
export type { AppLayoutProps } from "./layout/app-layout.tsx";
|
package/dist/web/index.js
CHANGED
|
@@ -13,7 +13,7 @@ export { PlainContentEditor } from "./app/plain-content-editor.js";
|
|
|
13
13
|
export { useResolvers } from "./app/resolvers-context.js";
|
|
14
14
|
export { clearRememberedListState } from "./app/session-list-state-store.js";
|
|
15
15
|
export { DrawnFilter, DrawnPanel, DrawnPencil, DrawnSearch, DrawnSparkles, DrawnWand, } from "./drawn-icons.js";
|
|
16
|
-
export { EditorBody, EditorFooter, EditorFrame, EditorHeader, EditorInfoBar, EditorLocaleSwitch, EditorModeSwitch, EditorWorkbench, formatRelativeWhen, RailField, RailHint, RailRow, RailSection, } from "./editor/index.js";
|
|
16
|
+
export { EditorBody, EditorFooter, EditorFrame, EditorHeader, EditorInfoBar, EditorLocaleSwitch, EditorModeSwitch, EditorToolbarPill, EditorWorkbench, formatRelativeWhen, RailField, RailHint, RailRow, RailSection, } from "./editor/index.js";
|
|
17
17
|
export { Icon } from "./icons.js";
|
|
18
18
|
export { AppLayout } from "./layout/app-layout.js";
|
|
19
19
|
export { Avatar } from "./layout/avatar.js";
|
|
@@ -3,6 +3,8 @@ export type MenuItemDef = {
|
|
|
3
3
|
readonly kind: "item";
|
|
4
4
|
readonly id: string;
|
|
5
5
|
readonly label: string;
|
|
6
|
+
readonly description?: string;
|
|
7
|
+
readonly testId?: string;
|
|
6
8
|
/** Optional icon displayed before the label (16px). */
|
|
7
9
|
readonly icon?: ReactNode;
|
|
8
10
|
/** Display-only shortcut hint on the right (monospace, muted).
|
|
@@ -26,6 +26,6 @@ export function ActionMenu({ trigger, triggerLabel, items, align = "end", minWid
|
|
|
26
26
|
// biome-ignore lint/suspicious/noArrayIndexKey: labels have no ID either, so their position provides identity
|
|
27
27
|
return _jsx(DropdownMenuLabel, { children: item.label }, `label-${idx}`);
|
|
28
28
|
}
|
|
29
|
-
return (_jsxs(DropdownMenuItem, { onSelect: item.onSelect, disabled: item.disabled === true, "data-testid": `action-menu-item-${item.id}`, className: item.variant === "danger" ? "text-destructive focus:text-destructive" : undefined, children: [item.icon !== undefined && _jsx("span", { className: "size-4 shrink-0", children: item.icon }),
|
|
29
|
+
return (_jsxs(DropdownMenuItem, { onSelect: item.onSelect, disabled: item.disabled === true, "data-testid": item.testId ?? `action-menu-item-${item.id}`, className: item.variant === "danger" ? "text-destructive focus:text-destructive" : undefined, children: [item.icon !== undefined && _jsx("span", { className: "size-4 shrink-0", children: item.icon }), _jsxs("span", { className: "flex flex-1 flex-col", children: [item.label, item.description !== undefined && (_jsx("span", { className: "text-xs text-muted-foreground", children: item.description }))] }), item.shortcut !== undefined && (_jsx("span", { className: "ml-auto text-xs text-muted-foreground tracking-wider font-mono", children: item.shortcut }))] }, item.id));
|
|
30
30
|
}) })] }));
|
|
31
31
|
}
|
|
@@ -4,4 +4,4 @@ import type { ButtonProps } from "../../index.ts";
|
|
|
4
4
|
import "../react-css-custom-properties.ts";
|
|
5
5
|
export declare function actionIconFor(icon: IconKey | undefined): IconKey | undefined;
|
|
6
6
|
export declare const SECONDARY_BUTTON_EXTRA_CLASSES = "border-input hover:bg-muted";
|
|
7
|
-
export declare function DefaultButton({ type, onClick, disabled, loading, variant, size, ariaLabel, title, pressed, expanded, width, children, testId, className, ref, icon, iconEnd, dataAttributes, }: ButtonProps): ReactNode;
|
|
7
|
+
export declare function DefaultButton({ type, onClick, disabled, loading, variant, size, ariaLabel, title, collapseLabel, pressed, expanded, width, children, testId, className, ref, icon, iconEnd, dataAttributes, }: ButtonProps): ReactNode;
|
|
@@ -31,18 +31,18 @@ export function actionIconFor(icon) {
|
|
|
31
31
|
// Shared by DefaultButton's `secondary` variant and triggers that need Radix `asChild`
|
|
32
32
|
// prop forwarding (which DefaultButton does not support), so both stay visually identical.
|
|
33
33
|
export const SECONDARY_BUTTON_EXTRA_CLASSES = "border-input hover:bg-muted";
|
|
34
|
-
export function DefaultButton({ type = "button", onClick, disabled, loading, variant = "primary", size = "md", ariaLabel, title, pressed, expanded, width = "auto", children, testId, className, ref, icon, iconEnd, dataAttributes, }) {
|
|
34
|
+
export function DefaultButton({ type = "button", onClick, disabled, loading, variant = "primary", size = "md", ariaLabel, title, collapseLabel, pressed, expanded, width = "auto", children, testId, className, ref, icon, iconEnd, dataAttributes, }) {
|
|
35
35
|
// The link variant renders text-like (inline link in running text/banner),
|
|
36
36
|
// not as a padded surface; width="full" stretches CTA buttons in cards/panels.
|
|
37
37
|
const resolvedClassName = cn(variant === "link" ? "h-auto px-0 py-0" : "", variant === "danger-ghost"
|
|
38
38
|
? "text-destructive hover:text-destructive hover:bg-destructive/10"
|
|
39
39
|
: "", variant === "ghost" ? "text-primary hover:text-primary hover:bg-primary/10" : "", variant === "secondary" ? SECONDARY_BUTTON_EXTRA_CLASSES : "", pressed === true
|
|
40
40
|
? "border-primary/40 bg-accent text-accent-foreground ring-1 ring-primary/30"
|
|
41
|
-
: "", width === "full" ? "w-full" : "", className);
|
|
41
|
+
: "", width === "full" ? "w-full" : "", collapseLabel === true ? "max-sm:size-10 max-sm:px-0" : "", className);
|
|
42
42
|
const IconStart = icon !== undefined ? NAV_ICONS[icon] : undefined;
|
|
43
43
|
const IconEnd = iconEnd !== undefined ? NAV_ICONS[iconEnd] : undefined;
|
|
44
44
|
// Loading swaps the leading icon slot for a spinner and keeps `children` —
|
|
45
45
|
// replacing the label would shift the button's width mid-submit.
|
|
46
46
|
const leading = loading === true ? (_jsx(Loader2, { className: "size-4 animate-spin", "aria-hidden": "true" })) : IconStart !== undefined ? (_jsx(IconStart, { className: "size-4", "aria-hidden": "true" })) : null;
|
|
47
|
-
return (_jsxs(UiButton, { ref: ref, type: type, onClick: onClick, disabled: disabled === true || loading === true, ...dataAttributes, "data-testid": testId, "data-loading": loading === true ? "true" : undefined, variant: BUTTON_VARIANT[variant], size: BUTTON_SIZE[size], "aria-label": ariaLabel, "aria-pressed": pressed, "aria-expanded": expanded, title: title ?? (size === "icon" ? ariaLabel : undefined), className: resolvedClassName, children: [leading, children, IconEnd !== undefined && _jsx(IconEnd, { className: "size-4", "aria-hidden": "true" })] }));
|
|
47
|
+
return (_jsxs(UiButton, { ref: ref, type: type, onClick: onClick, disabled: disabled === true || loading === true, ...dataAttributes, "data-testid": testId, "data-loading": loading === true ? "true" : undefined, variant: BUTTON_VARIANT[variant], size: BUTTON_SIZE[size], "aria-label": ariaLabel, "aria-pressed": pressed, "aria-expanded": expanded, title: title ?? (size === "icon" ? ariaLabel : undefined), className: resolvedClassName, children: [leading, collapseLabel === true ? _jsx("span", { className: "max-sm:sr-only", children: children }) : children, IconEnd !== undefined && _jsx(IconEnd, { className: "size-4", "aria-hidden": "true" })] }));
|
|
48
48
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import type { DialogProps } from "../../index.ts";
|
|
3
|
-
export declare function DefaultDialog({ open, onOpenChange, title, description, confirmLabel, cancelLabel, variant, initialFocus, onConfirm, children, testId, }: DialogProps): ReactNode;
|
|
3
|
+
export declare function DefaultDialog({ open, onOpenChange, title, description, confirmLabel, cancelLabel, hideCancel, variant, initialFocus, onConfirm, children, testId, }: DialogProps): ReactNode;
|
|
@@ -7,7 +7,7 @@ import { useRef, useState } from "react";
|
|
|
7
7
|
import { useTranslation } from "../../index.js";
|
|
8
8
|
import { cn } from "../lib/cn.js";
|
|
9
9
|
import { ModalShell } from "./modal-shell.js";
|
|
10
|
-
export function DefaultDialog({ open, onOpenChange, title, description, confirmLabel, cancelLabel, variant = "default", initialFocus, onConfirm, children, testId, }) {
|
|
10
|
+
export function DefaultDialog({ open, onOpenChange, title, description, confirmLabel, cancelLabel, hideCancel = false, variant = "default", initialFocus, onConfirm, children, testId, }) {
|
|
11
11
|
const t = useTranslation();
|
|
12
12
|
const [loading, setLoading] = useState(false);
|
|
13
13
|
const confirmButtonRef = useRef(null);
|
|
@@ -38,5 +38,5 @@ export function DefaultDialog({ open, onOpenChange, title, description, confirmL
|
|
|
38
38
|
event.preventDefault();
|
|
39
39
|
(focusTarget === "cancel" ? cancelButtonRef : confirmButtonRef).current?.focus();
|
|
40
40
|
},
|
|
41
|
-
}), children: [_jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx(DialogPrimitive.Title, { className: "text-lg font-semibold tracking-tight", children: title }), description !== undefined && (_jsx(DialogPrimitive.Description, { className: "text-sm text-muted-foreground", children: description }))] }), children !== undefined && _jsx("div", { children: children }), _jsxs("div", { className: "flex items-center justify-end gap-2", children: [_jsx(DialogPrimitive.Close, { asChild: true, children: _jsx("button", { ref: cancelButtonRef, type: "button", disabled: loading, "data-testid": testId !== undefined ? `${testId}-cancel` : undefined, className: "inline-flex h-9 items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium shadow-sm hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50", children: effectiveCancelLabel }) }), _jsxs("button", { ref: confirmButtonRef, type: "button", onClick: () => void handleConfirm(), disabled: loading, "data-testid": testId !== undefined ? `${testId}-confirm` : undefined, className: cn("inline-flex h-9 items-center justify-center gap-2 rounded-md px-4 py-2 text-sm font-medium", "disabled:pointer-events-none disabled:opacity-50", confirmClass), children: [loading && _jsx(Loader2, { className: "size-4 animate-spin", "aria-hidden": "true" }), effectiveConfirmLabel] })] })] }));
|
|
41
|
+
}), children: [_jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx(DialogPrimitive.Title, { className: "text-lg font-semibold tracking-tight", children: title }), description !== undefined && (_jsx(DialogPrimitive.Description, { className: "text-sm text-muted-foreground", children: description }))] }), children !== undefined && _jsx("div", { children: children }), _jsxs("div", { className: "flex items-center justify-end gap-2", children: [!hideCancel && (_jsx(DialogPrimitive.Close, { asChild: true, children: _jsx("button", { ref: cancelButtonRef, type: "button", disabled: loading, "data-testid": testId !== undefined ? `${testId}-cancel` : undefined, className: "inline-flex h-9 items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium shadow-sm hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50", children: effectiveCancelLabel }) })), _jsxs("button", { ref: confirmButtonRef, type: "button", onClick: () => void handleConfirm(), disabled: loading, "data-testid": testId !== undefined ? `${testId}-confirm` : undefined, className: cn("inline-flex h-9 items-center justify-center gap-2 rounded-md px-4 py-2 text-sm font-medium", "disabled:pointer-events-none disabled:opacity-50", confirmClass), children: [loading && _jsx(Loader2, { className: "size-4 animate-spin", "aria-hidden": "true" }), effectiveConfirmLabel] })] })] }));
|
|
42
42
|
}
|
|
@@ -3,7 +3,7 @@ import type { FillContainerProps, GridCellProps, GridProps, HeadingProps, LinkPr
|
|
|
3
3
|
import "../react-css-custom-properties.ts";
|
|
4
4
|
export declare function DefaultSection({ id, title, subtitle, subtitleBelowLgOnly, children, actions, variant, layout, titleStyle, hint, testId, icon, }: SectionProps): ReactNode;
|
|
5
5
|
export declare function DefaultFillContainer({ children, testId, grow, className, }: FillContainerProps): ReactNode;
|
|
6
|
-
export declare function DefaultGrid({ columns, children, testId, maxRows, flow, list, ariaLabelledBy, tight, facts, }: GridProps): ReactNode;
|
|
6
|
+
export declare function DefaultGrid({ columns, children, testId, maxRows, flow, list, ariaLabelledBy, tight, facts, legend, ruled, }: GridProps): ReactNode;
|
|
7
7
|
export declare function DefaultGridCell({ span, width, hideOnNarrow, children }: GridCellProps): ReactNode;
|
|
8
8
|
export declare function DefaultText({ variant, decorative, concealed, narrow, children, testId, }: TextProps): ReactNode;
|
|
9
9
|
export declare function isPlainPrimaryClick(event: MouseEvent): boolean;
|
|
@@ -92,7 +92,7 @@ const FIELD_CELL_WIDTH_CLASS = {
|
|
|
92
92
|
// switch (1.15rem) gets (h-9 input − switch) / 2 margin to sit on the input line.
|
|
93
93
|
toggle: "w-auto min-w-40 shrink-0 self-start [&_[data-slot=switch]]:my-[0.55rem]",
|
|
94
94
|
};
|
|
95
|
-
export function DefaultGrid({ columns, children, testId, maxRows, flow, list, ariaLabelledBy, tight, facts, }) {
|
|
95
|
+
export function DefaultGrid({ columns, children, testId, maxRows, flow, list, ariaLabelledBy, tight, facts, legend, ruled, }) {
|
|
96
96
|
const insideDrawerBody = useContext(DrawerBodyContext);
|
|
97
97
|
const groupProps = ariaLabelledBy !== undefined
|
|
98
98
|
? { role: "group", "aria-labelledby": ariaLabelledBy }
|
|
@@ -100,6 +100,13 @@ export function DefaultGrid({ columns, children, testId, maxRows, flow, list, ar
|
|
|
100
100
|
if (list === true) {
|
|
101
101
|
return (_jsx("div", { ...groupProps, "data-testid": testId, className: "flex flex-col divide-y divide-border", children: children }));
|
|
102
102
|
}
|
|
103
|
+
if (legend === true) {
|
|
104
|
+
return (_jsx("div", { ...groupProps, "data-testid": testId, "data-legend": "", className: cn("grid items-start [&>:nth-child(odd)]:whitespace-nowrap", ruled === true
|
|
105
|
+
? "grid-cols-[13rem_minmax(0,1fr)]"
|
|
106
|
+
: "grid-cols-[max-content_minmax(0,1fr)] gap-x-4 gap-y-3"), children: ruled === true
|
|
107
|
+
? Children.map(children, (child, index) => (_jsx("div", { className: cn("flex flex-wrap items-baseline border-t border-border py-3", index % 2 === 0 ? "pr-4" : "", index < 2 ? "border-t-0" : ""), children: child })))
|
|
108
|
+
: children }));
|
|
109
|
+
}
|
|
103
110
|
if (facts === true && typeof columns === "number") {
|
|
104
111
|
const factStyle = {
|
|
105
112
|
"--grid-cols": `repeat(${columns}, minmax(0, 1fr))`,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import type { ModalProps } from "../../index.ts";
|
|
3
|
-
export declare function DefaultModal({ open, onOpenChange, title, children, testId, }: ModalProps): ReactNode;
|
|
3
|
+
export declare function DefaultModal({ open, onOpenChange, title, children, testId, size, }: ModalProps): ReactNode;
|
|
@@ -7,7 +7,7 @@ import { useTranslation } from "../../index.js";
|
|
|
7
7
|
import { cn } from "../lib/cn.js";
|
|
8
8
|
import { BareFormProvider } from "./contexts.js";
|
|
9
9
|
import { ModalShell } from "./modal-shell.js";
|
|
10
|
-
export function DefaultModal({ open, onOpenChange, title, children, testId, }) {
|
|
10
|
+
export function DefaultModal({ open, onOpenChange, title, children, testId, size = "default", }) {
|
|
11
11
|
const t = useTranslation();
|
|
12
|
-
return (_jsxs(ModalShell, { open: open, onOpenChange: onOpenChange, testId: testId, closeLabel: t("kumiko.dialog.close"), noAriaDescription: true, contentClassName: cn("grid w-full
|
|
12
|
+
return (_jsxs(ModalShell, { open: open, onOpenChange: onOpenChange, testId: testId, closeLabel: t("kumiko.dialog.close"), noAriaDescription: true, contentClassName: cn("grid w-full gap-4 border bg-card p-6 shadow-lg rounded-lg", size === "wide" ? "max-w-[min(830px,calc(100vw-2rem))]" : "max-w-lg"), children: [_jsx(DialogPrimitive.Title, { className: "text-lg font-semibold leading-none tracking-tight", children: title }), _jsx("div", { onSubmit: (e) => e.stopPropagation(), children: _jsx(BareFormProvider, { children: children }) })] }));
|
|
13
13
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import type { PageHeaderProps } from "../../index.ts";
|
|
3
|
-
export declare function DefaultPageHeader({ title, recordTitle, narrowRecordTitle, status, actions, bodyTitle, overflowItems, hideBreadcrumb, breadcrumbScreenId, }: PageHeaderProps): ReactNode;
|
|
3
|
+
export declare function DefaultPageHeader({ title, recordTitle, narrowRecordTitle, status, help, actions, bodyTitle, overflowItems, hideBreadcrumb, breadcrumbScreenId, }: PageHeaderProps): ReactNode;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Fragment as _Fragment,
|
|
1
|
+
import { Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useLayoutEffect } from "react";
|
|
3
3
|
import { createPortal } from "react-dom";
|
|
4
4
|
import { usePageHeaderSlot } from "../layout/page-header-slot.js";
|
|
5
5
|
import { UNIFORM_BAR_CONTROLS_CLASSES } from "../layout/uniform-bar-controls.js";
|
|
6
6
|
import { cn } from "../lib/cn.js";
|
|
7
|
-
export function DefaultPageHeader({ title, recordTitle, narrowRecordTitle, status, actions, bodyTitle, overflowItems, hideBreadcrumb, breadcrumbScreenId, }) {
|
|
7
|
+
export function DefaultPageHeader({ title, recordTitle, narrowRecordTitle, status, help, actions, bodyTitle, overflowItems, hideBreadcrumb, breadcrumbScreenId, }) {
|
|
8
8
|
const slot = usePageHeaderSlot();
|
|
9
9
|
const setOverflowItems = slot?.setOverflowItems;
|
|
10
10
|
const setTitle = slot?.setTitle;
|
|
@@ -59,11 +59,11 @@ export function DefaultPageHeader({ title, recordTitle, narrowRecordTitle, statu
|
|
|
59
59
|
return () => setOverflowItems(undefined);
|
|
60
60
|
}, [setOverflowItems, overflowItems]);
|
|
61
61
|
if (slot === null) {
|
|
62
|
-
return (_jsxs("div", { "data-kumiko-layout": "page-header-inline", className: "flex items-center gap-2 px-4 py-2", children: [status,
|
|
62
|
+
return (_jsxs("div", { "data-kumiko-layout": "page-header-inline", className: "flex items-center gap-2 px-4 py-2", children: [status, _jsxs("div", { className: cn("ml-auto flex items-center gap-2", UNIFORM_BAR_CONTROLS_CLASSES), children: [actions, help] })] }));
|
|
63
63
|
}
|
|
64
64
|
return (_jsxs(_Fragment, { children: [status !== undefined &&
|
|
65
65
|
slot.statusElement !== null &&
|
|
66
|
-
createPortal(status, slot.statusElement), actions !== undefined &&
|
|
66
|
+
createPortal(status, slot.statusElement), (actions !== undefined || help !== undefined) &&
|
|
67
67
|
slot.actionsElement !== null &&
|
|
68
|
-
createPortal(actions, slot.actionsElement)] }));
|
|
68
|
+
createPortal(_jsxs(_Fragment, { children: [actions, help] }), slot.actionsElement)] }));
|
|
69
69
|
}
|
|
@@ -12,4 +12,4 @@ export declare function RowActionsCell({ row, actions, mode, rowIsLink, compact,
|
|
|
12
12
|
/** Small bordered buttons without the phone touch height; for buttons sitting inside a card. */
|
|
13
13
|
readonly small?: boolean;
|
|
14
14
|
}): ReactNode;
|
|
15
|
-
export declare function ActionOverflowMenu({ items, label, testId }: ActionOverflowMenuProps): ReactNode;
|
|
15
|
+
export declare function ActionOverflowMenu({ items, label, triggerLabel, testId, }: ActionOverflowMenuProps): ReactNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Loader2, MoreHorizontal } from "lucide-react";
|
|
2
|
+
import { ChevronDown, Loader2, MoreHorizontal, Plus } from "lucide-react";
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import { COMPACT_TAP_CLASSES } from "../../compact-tap-classes.js";
|
|
5
5
|
import { needsActionConfirm, shouldRenderActionsIconOnly, useTranslation, WriteFailedError, } from "../../index.js";
|
|
@@ -187,9 +187,9 @@ function RowActionsKebab({ row, actions, }) {
|
|
|
187
187
|
// secondary icon Button so it matches neighbouring icon buttons, including
|
|
188
188
|
// the 44 px touch size on phones. Generic ActionMenuItemSpec items instead of
|
|
189
189
|
// the DataTableRowAction schema (callers own confirm/danger handling per item).
|
|
190
|
-
export function ActionOverflowMenu({ items, label, testId }) {
|
|
190
|
+
export function ActionOverflowMenu({ items, label, triggerLabel, testId, }) {
|
|
191
191
|
const [open, setOpen] = useState(false);
|
|
192
|
-
return (_jsxs(DropdownMenu, { open: open, onOpenChange: setOpen, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(UiButton, { type: "button", variant: "outline", size: "icon", className: SECONDARY_BUTTON_EXTRA_CLASSES, "aria-label": label, "data-testid": testId ?? "action-overflow-menu-trigger", children: _jsx(MoreHorizontal, { className: "size-4", "aria-hidden": "true" }) }) }), _jsx(DropdownMenuContent, { align: "end", children: items.map((item) => {
|
|
192
|
+
return (_jsxs(DropdownMenu, { open: open, onOpenChange: setOpen, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(UiButton, { type: "button", variant: "outline", size: triggerLabel === undefined ? "icon" : "sm", className: SECONDARY_BUTTON_EXTRA_CLASSES, "aria-label": label, "data-testid": testId ?? "action-overflow-menu-trigger", children: triggerLabel === undefined ? (_jsx(MoreHorizontal, { className: "size-4", "aria-hidden": "true" })) : (_jsxs(_Fragment, { children: [_jsx(Plus, { className: "size-4", "aria-hidden": "true" }), triggerLabel, _jsx(ChevronDown, { className: "size-3", "aria-hidden": "true" })] })) }) }), _jsx(DropdownMenuContent, { align: "end", children: items.map((item) => {
|
|
193
193
|
const resolvedIcon = actionIconFor(item.icon);
|
|
194
194
|
return (_jsxs(DropdownMenuItem, { "data-testid": item.testId ?? `${testId ?? "action-overflow-menu"}-item-${item.id}`, disabled: item.disabled === true, onSelect: (e) => {
|
|
195
195
|
e.preventDefault();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-renderer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.420.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.420.0",
|
|
52
|
+
"@cosmicdrift/kumiko-types": "0.420.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.420.0",
|
|
83
|
+
"@cosmicdrift/kumiko-testing": "0.420.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,28 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.420.0",
|
|
4
|
+
"type": "improvement",
|
|
5
|
+
"title": "Action-form facts can show a stored file",
|
|
6
|
+
"detail": "A preview or success fact with type \"file\" reads a FileRef id or an array of ids from the result and renders the file list with name, download link and inline PDF preview."
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"version": "0.420.0",
|
|
10
|
+
"type": "improvement",
|
|
11
|
+
"title": "Document editor for longText fields, preview inside a section",
|
|
12
|
+
"detail": "Field option `editor: \"document\"` (longText only; works with `aiAssist`: the text is inserted as paragraphs) renders the registered document editor instead of a textarea; boot rule `form/editor-field-type`. New fields-section option `flow: false` gives a screen form or drawer section a grid of `columns` equal cells; without it the flow layout (field width by type) stays as before. `ActionFormPreview.section` places the preview panel at the end of a fields section with that id (boot rule `action-form-preview/section-unknown`); without it the panel stays below the form, and without `title` it has no title row."
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"version": "0.420.0",
|
|
16
|
+
"type": "improvement",
|
|
17
|
+
"title": "General page help",
|
|
18
|
+
"detail": "Set `pageHelp: { sections: [{ kind: \"status\", field: \"status\" }] }` on an entityList or a projectionDetail (with `entity` on the detail) and the page gets an \"Explanations\" button in the shell header. Its drawer shows each option of the select field with the same badge as the list and a sentence from the i18n key `<option label key>:help`; `{ kind: \"text\", title, text }` adds free text. relatedList sections contribute their sections to the page's help instead of rendering a button. Boot fails when a status field is not a select field or an option has no help text in a locale its label has. New `PageHeader.help`, `Dialog.hideCancel` and icon key `help-circle`."
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"version": "0.420.0",
|
|
22
|
+
"type": "fix",
|
|
23
|
+
"title": "A null field value no longer blocks AI-assist regeneration",
|
|
24
|
+
"detail": "A `null` field value no longer blocks AI-assist regeneration. `isCurrencyOnlyMoney` is exported from the renderer headless barrel."
|
|
25
|
+
},
|
|
2
26
|
{
|
|
3
27
|
"version": "0.417.0",
|
|
4
28
|
"type": "breaking",
|