@cosmicdrift/kumiko-renderer 0.405.0 → 0.409.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.
Files changed (143) hide show
  1. package/dist/app/action-form-body.js +23 -8
  2. package/dist/app/action-form-support.d.ts +7 -0
  3. package/dist/app/action-form-support.js +14 -1
  4. package/dist/app/config-edit-action-row.d.ts +7 -0
  5. package/dist/app/config-edit-action-row.js +45 -0
  6. package/dist/app/config-edit-body.js +32 -4
  7. package/dist/app/entity-list-screen.js +8 -11
  8. package/dist/app/nav.js +2 -1
  9. package/dist/app/projection-detail-body.js +3 -1
  10. package/dist/app/projection-detail-header.d.ts +1 -0
  11. package/dist/app/projection-detail-header.js +1 -1
  12. package/dist/app/projection-detail-navigation.d.ts +2 -1
  13. package/dist/app/projection-detail-navigation.js +6 -3
  14. package/dist/app/projection-detail-shim.js +3 -1
  15. package/dist/app/projection-list-render-props.d.ts +1 -1
  16. package/dist/app/projection-list-render-props.js +4 -2
  17. package/dist/app/projection-list-render.js +1 -1
  18. package/dist/app/screen-access.js +4 -2
  19. package/dist/app/screen-shared.d.ts +3 -2
  20. package/dist/app/screen-shared.js +29 -1
  21. package/dist/app/use-embedded-screen.d.ts +2 -0
  22. package/dist/app/use-embedded-screen.js +7 -1
  23. package/dist/components/edit-mounts.d.ts +3 -1
  24. package/dist/components/edit-mounts.js +3 -3
  25. package/dist/components/related-list-section.d.ts +3 -1
  26. package/dist/components/related-list-section.js +2 -2
  27. package/dist/components/render-edit-field-grid.d.ts +2 -2
  28. package/dist/components/render-edit-field-grid.js +12 -4
  29. package/dist/components/render-edit-fields-section.js +6 -7
  30. package/dist/components/render-edit-helpers.d.ts +4 -0
  31. package/dist/components/render-edit-helpers.js +5 -0
  32. package/dist/components/render-edit-section-kinds.js +6 -4
  33. package/dist/components/render-edit-submit.js +18 -1
  34. package/dist/components/render-edit-titles.js +6 -6
  35. package/dist/components/render-edit-types.d.ts +6 -0
  36. package/dist/components/render-field-control.d.ts +2 -0
  37. package/dist/components/render-field-control.js +23 -1
  38. package/dist/components/render-field-write-only.d.ts +1 -1
  39. package/dist/components/render-field-write-only.js +12 -2
  40. package/dist/components/render-field.js +2 -1
  41. package/dist/components/use-render-edit-sections.js +4 -4
  42. package/dist/format-when.d.ts +1 -1
  43. package/dist/format-when.js +2 -2
  44. package/dist/headless/format/escape.js +3 -2
  45. package/dist/headless/view-model/edit.js +0 -2
  46. package/dist/headless/view-model/types.d.ts +0 -3
  47. package/dist/i18n-defaults.js +38 -0
  48. package/dist/index.d.ts +2 -1
  49. package/dist/index.js +1 -0
  50. package/dist/primitives.d.ts +30 -7
  51. package/dist/primitives.js +1 -51
  52. package/dist/status-tone.d.ts +6 -0
  53. package/dist/status-tone.js +51 -0
  54. package/dist/toggle-set-member.d.ts +1 -0
  55. package/dist/toggle-set-member.js +8 -0
  56. package/dist/web/app/dashboard-header.js +5 -1
  57. package/dist/web/app/dashboard-screen-tiles.js +19 -3
  58. package/dist/web/icons.d.ts +2 -0
  59. package/dist/web/icons.js +3 -1
  60. package/dist/web/index.d.ts +3 -2
  61. package/dist/web/index.js +2 -1
  62. package/dist/web/layout/default-app-shell.d.ts +4 -1
  63. package/dist/web/layout/default-app-shell.js +5 -2
  64. package/dist/web/layout/focus-aware-sidebar.d.ts +27 -0
  65. package/dist/web/layout/focus-aware-sidebar.js +23 -0
  66. package/dist/web/layout/focus-rail.d.ts +16 -0
  67. package/dist/web/layout/focus-rail.js +61 -0
  68. package/dist/web/layout/nav-tree.d.ts +2 -1
  69. package/dist/web/layout/nav-tree.js +3 -9
  70. package/dist/web/layout/shell-focus.d.ts +19 -0
  71. package/dist/web/layout/shell-focus.js +35 -0
  72. package/dist/web/layout/shell-header.d.ts +1 -1
  73. package/dist/web/layout/shell-header.js +12 -9
  74. package/dist/web/layout/sidebar-brand.js +1 -1
  75. package/dist/web/layout/workspace-shell.d.ts +4 -1
  76. package/dist/web/layout/workspace-shell.js +5 -2
  77. package/dist/web/primitives/banner.js +3 -1
  78. package/dist/web/primitives/data-table/toolbar.js +2 -2
  79. package/dist/web/primitives/default-form.js +12 -5
  80. package/dist/web/primitives/field.js +4 -1
  81. package/dist/web/primitives/input-text-kinds.js +8 -2
  82. package/dist/web/primitives/layout-elements.js +2 -4
  83. package/dist/web/primitives/tabs.d.ts +1 -1
  84. package/dist/web/primitives/tabs.js +21 -4
  85. package/dist/web/theme-plugin.d.ts +1 -1
  86. package/dist/web/theme-plugin.js +7 -0
  87. package/dist/web/ui/sidebar.js +5 -2
  88. package/dist/web/widgets/ai-text-end-action.d.ts +12 -0
  89. package/dist/web/widgets/ai-text-end-action.js +15 -0
  90. package/dist/web/widgets/ai-text-field.d.ts +3 -0
  91. package/dist/web/widgets/ai-text-field.js +4 -3
  92. package/dist/web/widgets/attachment-card.d.ts +6 -0
  93. package/dist/web/widgets/attachment-card.js +11 -0
  94. package/dist/web/widgets/attachment-chip.d.ts +8 -0
  95. package/dist/web/widgets/attachment-chip.js +21 -0
  96. package/dist/web/widgets/clamped-text.d.ts +11 -0
  97. package/dist/web/widgets/clamped-text.js +38 -0
  98. package/dist/web/widgets/html-mail-frame.d.ts +17 -0
  99. package/dist/web/widgets/html-mail-frame.js +56 -0
  100. package/dist/web/widgets/index.d.ts +10 -1
  101. package/dist/web/widgets/index.js +9 -1
  102. package/dist/web/widgets/infinity-list.d.ts +3 -1
  103. package/dist/web/widgets/infinity-list.js +2 -2
  104. package/dist/web/widgets/message-body-view.d.ts +10 -0
  105. package/dist/web/widgets/message-body-view.js +36 -0
  106. package/dist/web/widgets/message-reader.d.ts +4 -0
  107. package/dist/web/widgets/message-reader.js +31 -0
  108. package/dist/web/widgets/message-thread.d.ts +5 -0
  109. package/dist/web/widgets/message-thread.js +66 -0
  110. package/dist/web/widgets/message-types.d.ts +68 -0
  111. package/dist/web/widgets/message-types.js +1 -0
  112. package/dist/web/widgets/mobile-top-bar.d.ts +21 -0
  113. package/dist/web/widgets/mobile-top-bar.js +8 -0
  114. package/dist/web/widgets/pdf-document.d.ts +19 -0
  115. package/dist/web/widgets/pdf-document.js +70 -0
  116. package/dist/web/widgets/pdf-page.d.ts +35 -0
  117. package/dist/web/widgets/pdf-page.js +155 -0
  118. package/dist/web/widgets/pdf-preview.d.ts +27 -7
  119. package/dist/web/widgets/pdf-preview.js +21 -133
  120. package/dist/web/widgets/pdf-search.d.ts +43 -0
  121. package/dist/web/widgets/pdf-search.js +178 -0
  122. package/dist/web/widgets/pdf-thumbnails.d.ts +10 -0
  123. package/dist/web/widgets/pdf-thumbnails.js +35 -0
  124. package/dist/web/widgets/pdf-viewer-toolbar.d.ts +22 -0
  125. package/dist/web/widgets/pdf-viewer-toolbar.js +35 -0
  126. package/dist/web/widgets/pdf-viewer.d.ts +21 -0
  127. package/dist/web/widgets/pdf-viewer.js +176 -0
  128. package/dist/web/widgets/quoted-text.d.ts +16 -0
  129. package/dist/web/widgets/quoted-text.js +76 -0
  130. package/dist/web/widgets/status-badge.js +3 -1
  131. package/dist/web/widgets/step-list-fit.d.ts +25 -0
  132. package/dist/web/widgets/step-list-fit.js +79 -0
  133. package/dist/web/widgets/step-list-row.d.ts +50 -0
  134. package/dist/web/widgets/step-list-row.js +97 -0
  135. package/dist/web/widgets/step-list.d.ts +33 -0
  136. package/dist/web/widgets/step-list.js +36 -0
  137. package/dist/web/widgets/surfaces.d.ts +23 -0
  138. package/dist/web/widgets/surfaces.js +15 -0
  139. package/dist/web/widgets/use-in-view.d.ts +5 -0
  140. package/dist/web/widgets/use-in-view.js +18 -0
  141. package/package.json +5 -5
  142. package/src/changes.json +186 -0
  143. package/src/web/styles.css +22 -0
@@ -98,7 +98,7 @@ function pickEmptyStateText(emptyState, record) {
98
98
  return undefined;
99
99
  return (emptyState.variants?.find((variant) => evalFieldCondition(variant.when, record)) ?? emptyState);
100
100
  }
101
- export function RelatedListSection({ section, parentId, record, featureName, translate, hideTitle, grow, onOpenDrawer, actions, embedded, onAfterWrite, refreshToken, }) {
101
+ export function RelatedListSection({ section, parentId, record, featureName, translate, hideTitle, grow, onOpenDrawer, actions, anchorId, embedded, onAfterWrite, refreshToken, }) {
102
102
  const { Banner, Section, Card, FillContainer, Text, Button, Dialog } = usePrimitives();
103
103
  const [emptyStateActionError, setEmptyStateActionError] = useState(null);
104
104
  const t = useTranslation();
@@ -343,5 +343,5 @@ export function RelatedListSection({ section, parentId, record, featureName, tra
343
343
  if (hideTitle) {
344
344
  return (_jsxs(_Fragment, { children: [bridges, FillContainer !== undefined ? (_jsx(FillContainer, { ...(grow === true && { grow: true }), children: content })) : (content)] }));
345
345
  }
346
- return (_jsxs(_Fragment, { children: [bridges, _jsx(Section, { title: section.title, ...(actions !== undefined && { actions }), testId: `related-list-${section.title}`, children: content })] }));
346
+ return (_jsxs(_Fragment, { children: [bridges, _jsx(Section, { title: section.title, ...(anchorId !== undefined && { id: anchorId }), ...(actions !== undefined && { actions }), testId: `related-list-${section.title}`, children: content })] }));
347
347
  }
@@ -1,4 +1,4 @@
1
- import type { ReactNode } from "react";
1
+ import { type ReactNode } from "react";
2
2
  import type { EditFieldViewModel, FormValues } from "../headless/index.ts";
3
3
  import type { FieldsSection, RenderEditModel } from "./render-edit-render-model.ts";
4
- export declare function renderFieldGrid<TValues extends FormValues, TCtx>(model: RenderEditModel<TValues, TCtx>, section: FieldsSection, fields: readonly EditFieldViewModel[], columns: number, gridKey: string, columnsDeclared: boolean | undefined): ReactNode;
4
+ export declare function renderFieldGrid<TValues extends FormValues, TCtx>(model: RenderEditModel<TValues, TCtx>, section: FieldsSection, fields: readonly EditFieldViewModel[], columns: number, gridKey: string): ReactNode;
@@ -1,4 +1,5 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Fragment } from "react";
2
3
  import { GridCellForField } from "./grid-cell-for-field.js";
3
4
  function appendixCellProps(props, fieldName) {
4
5
  const { labelAppendix, fieldAppendix, fieldAppendixPlacement, fieldDescription } = props;
@@ -33,10 +34,17 @@ function createFieldCellRenderer(model, section, columns) {
33
34
  }), GridCell: GridCell, featureName: props.featureName, ...appendixCellProps(props, field.field), allIssues: snapshot.errors, valueDisplay: props.valueDisplay, row: snapshot.values, ...(disabled && { fillDisabled: true }), ...(props.hideSectionTitles !== true &&
34
35
  section.title !== undefined && { sectionTitle: section.title }), ...(showsChangedMarker && field.field in snapshot.changes && { changed: true }) }, field.field));
35
36
  }
36
- export function renderFieldGrid(model, section, fields, columns, gridKey, columnsDeclared) {
37
- const { Grid } = model.engine.state.primitives;
37
+ export function renderFieldGrid(model, section, fields, columns, gridKey) {
38
+ const { Grid, GridCell } = model.engine.state.primitives;
39
+ const { rowAfterField } = model.engine.props;
40
+ const dirty = Object.keys(model.engine.form.snapshot.changes).length > 0;
38
41
  const { isSettingsList } = model.footer;
39
42
  const { usesFieldFlow } = model.titles;
40
43
  const renderCell = createFieldCellRenderer(model, section, columns);
41
- return (_jsx(Grid, { columns: usesFieldFlow && columnsDeclared !== true ? 1 : columns, ...(isSettingsList ? { list: true } : usesFieldFlow && { flow: true }), children: fields.map((field) => renderCell(field)) }, gridKey));
44
+ return (_jsx(Grid, { columns: columns, ...(isSettingsList ? { list: true } : usesFieldFlow && { flow: true }), children: fields.map((field) => {
45
+ const extraRow = rowAfterField?.(field.field, { dirty });
46
+ if (extraRow === undefined)
47
+ return renderCell(field);
48
+ return (_jsxs(Fragment, { children: [renderCell(field), _jsx(GridCell, { span: columns, children: extraRow })] }, field.field));
49
+ }) }, gridKey));
42
50
  }
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { renderAllRequiredHint } from "./render-edit-banners.js";
3
3
  import { renderFieldGrid } from "./render-edit-field-grid.js";
4
- import { formSectionDomId } from "./render-edit-helpers.js";
4
+ import { sectionNavAnchorId } from "./render-edit-helpers.js";
5
5
  function renderTabbedGroupsSection(rc, section, sectionKey) {
6
6
  const { Grid, Card } = rc.model.engine.state.primitives;
7
- const groupsGrid = (_jsx(Grid, { columns: 1, children: section.groups?.map((group, groupIndex) => (_jsx(Card, { slots: { title: group.title }, testId: `section-${sectionKey}-group-${groupIndex}`, children: renderFieldGrid(rc.model, section, group.fields, group.columns, `${sectionKey}-group-${groupIndex}-grid`, group.columnsDeclared) }, group.title))) }, `${sectionKey}-groups`));
7
+ const groupsGrid = (_jsx(Grid, { columns: 1, children: section.groups?.map((group, groupIndex) => (_jsx(Card, { slots: { title: group.title }, testId: `section-${sectionKey}-group-${groupIndex}`, children: renderFieldGrid(rc.model, section, group.fields, group.columns, `${sectionKey}-group-${groupIndex}-grid`) }, group.title))) }, `${sectionKey}-groups`));
8
8
  // `actions` on a `groups` section has no group of its own to
9
9
  // sit in and would need an extra title-less Card around the
10
10
  // group cards (Card-in-Card) — the boot-validator rejects that
@@ -26,7 +26,7 @@ function renderTabbedFieldsSection(rc, section, sectionKey) {
26
26
  ...(section.description !== undefined && { subtitle: section.description }),
27
27
  ...(sectionActionsEl !== undefined && { headerActions: sectionActionsEl }),
28
28
  },
29
- }), testId: `section-${sectionKey}`, children: renderFieldGrid(rc.model, section, section.fields, section.columns, `${sectionKey}-grid`, section.columnsDeclared) }, sectionKey));
29
+ }), testId: `section-${sectionKey}`, children: renderFieldGrid(rc.model, section, section.fields, section.columns, `${sectionKey}-grid`) }, sectionKey));
30
30
  return rc.wrapWizardStep(sectionKey, cardEl);
31
31
  }
32
32
  // Suppress the section header when it would just repeat the form
@@ -48,14 +48,13 @@ function resolveSectionSubtitle({ model, sectionIndex }, section) {
48
48
  function renderDefaultFieldsSection(rc, section, sectionKey) {
49
49
  const { model, sectionIndex, sectionActionsEl } = rc;
50
50
  const { Section } = model.engine.state.primitives;
51
+ const anchorId = sectionNavAnchorId(model.titles.sectionNavItems, sectionIndex);
51
52
  const sectionTitle = resolveSectionTitle(rc, section);
52
53
  const sectionSubtitle = resolveSectionSubtitle(rc, section);
53
- const sectionEl = (_jsxs(Section, { ...(model.titles.sectionNavItems.some((item) => item.id === formSectionDomId(sectionIndex)) && {
54
- id: formSectionDomId(sectionIndex),
55
- }), ...(sectionTitle !== undefined && { title: sectionTitle }), ...(sectionSubtitle !== undefined && { subtitle: sectionSubtitle }), ...(section.icon !== undefined && { icon: section.icon }), ...(sectionActionsEl !== undefined && { actions: sectionActionsEl }), ...(model.footer.isSettingsList && { layout: "settings-list" }), testId: `section-${sectionKey}`, children: [model.engine.sections.showsAllRequiredHint &&
54
+ const sectionEl = (_jsxs(Section, { ...(anchorId !== undefined && { id: anchorId }), ...(sectionTitle !== undefined && { title: sectionTitle }), ...(sectionSubtitle !== undefined && { subtitle: sectionSubtitle }), ...(section.icon !== undefined && { icon: section.icon }), ...(sectionActionsEl !== undefined && { actions: sectionActionsEl }), ...(model.footer.isSettingsList && { layout: "settings-list" }), testId: `section-${sectionKey}`, children: [model.engine.sections.showsAllRequiredHint &&
56
55
  model.engine.state.insideDrawer &&
57
56
  sectionIndex === 0 &&
58
- renderAllRequiredHint(model), renderFieldGrid(model, section, section.fields, section.columns, `${sectionKey}-grid`, section.columnsDeclared)] }, sectionKey));
57
+ renderAllRequiredHint(model), renderFieldGrid(model, section, section.fields, section.columns, `${sectionKey}-grid`)] }, sectionKey));
59
58
  return rc.wrapWizardStep(sectionKey, sectionEl);
60
59
  }
61
60
  export function renderFieldsSection(rc, section) {
@@ -23,6 +23,10 @@ export declare function wizardStepKey(section: EditSectionViewModel, index: numb
23
23
  export declare function isFieldsStepFilled(section: FieldsSectionViewModel, parse: DryRunParse | undefined): boolean;
24
24
  export type FormErrorSource = "submit" | "delete";
25
25
  export declare function formSectionDomId(sectionIndex: number): string;
26
+ /** The scroll-anchor id of a section, only when the "on this page" navigation lists it. */
27
+ export declare function sectionNavAnchorId(sectionNavItems: readonly {
28
+ readonly id: string;
29
+ }[], sectionIndex: number): string | undefined;
26
30
  /** A record title is a non-blank string; anything else leaves the screen title alone. */
27
31
  export declare function resolveRecordTitle(value: unknown): string | undefined;
28
32
  export declare function resolveTitleTemplate(template: string | undefined, values: FormValues, translate: Translate, fallback: string): string;
@@ -100,6 +100,11 @@ export function isFieldsStepFilled(section, parse) {
100
100
  export function formSectionDomId(sectionIndex) {
101
101
  return `form-section-${sectionIndex}`;
102
102
  }
103
+ /** The scroll-anchor id of a section, only when the "on this page" navigation lists it. */
104
+ export function sectionNavAnchorId(sectionNavItems, sectionIndex) {
105
+ const id = formSectionDomId(sectionIndex);
106
+ return sectionNavItems.some((item) => item.id === id) ? id : undefined;
107
+ }
103
108
  /** A record title is a non-blank string; anything else leaves the screen title alone. */
104
109
  export function resolveRecordTitle(value) {
105
110
  return typeof value === "string" && value.trim() !== "" ? value : undefined;
@@ -3,14 +3,15 @@ import { ExtensionSectionMount } from "./edit-mounts.js";
3
3
  import { RelatedListSection } from "./related-list-section.js";
4
4
  import { RenderEditActionButton } from "./render-edit-action-button.js";
5
5
  import { renderFieldsSection } from "./render-edit-fields-section.js";
6
- import { wizardStepKey } from "./render-edit-helpers.js";
6
+ import { sectionNavAnchorId, wizardStepKey } from "./render-edit-helpers.js";
7
7
  import { resolveExtensionEntityId } from "./render-edit-logic.js";
8
8
  import { WriteFormSection } from "./write-form-section.js";
9
9
  function renderExtensionSection({ model, sectionIndex, sectionActionsEl, wrapWizardStep }, section) {
10
10
  const { props, state, form, draft, sections } = model.engine;
11
11
  const { hideSectionTitles } = props;
12
12
  const { Card } = state.primitives;
13
- const mount = (_jsx(ExtensionSectionMount, { section: section, entityName: sections.vm.entityName, entityId: resolveExtensionEntityId(props.entityId, sections.vm.id), initialValues: props.extensionInitialValues, values: form.snapshot.values, patch: model.patchForExtension, validate: draft.scopedValidate, markSaved: draft.markSaved, hideTitle: hideSectionTitles, ...(state.isWizard &&
13
+ const anchorId = sectionNavAnchorId(model.titles.sectionNavItems, sectionIndex);
14
+ const mount = (_jsx(ExtensionSectionMount, { ...(anchorId !== undefined && { anchorId }), section: section, entityName: sections.vm.entityName, entityId: resolveExtensionEntityId(props.entityId, sections.vm.id), initialValues: props.extensionInitialValues, values: form.snapshot.values, patch: model.patchForExtension, validate: draft.scopedValidate, markSaved: draft.markSaved, hideTitle: hideSectionTitles, ...(state.isWizard &&
14
15
  !state.isCreateMode && {
15
16
  stepKey: wizardStepKey(section, sectionIndex),
16
17
  onReportStepComplete: state.reportExtensionStepComplete,
@@ -26,7 +27,7 @@ function renderExtensionSection({ model, sectionIndex, sectionActionsEl, wrapWiz
26
27
  }), children: mount }, section.title));
27
28
  return wrapWizardStep(section.title, wrapped);
28
29
  }
29
- function renderRelatedListSection({ model, sectionActionsEl }, section) {
30
+ function renderRelatedListSection({ model, sectionIndex, sectionActionsEl }, section) {
30
31
  const { props, form, sections } = model.engine;
31
32
  const { hideSectionTitles, fillScreenHeight, refreshToken, onRelatedListDrawerAction } = props;
32
33
  // parentId is the displayed record's id — without it there's no
@@ -35,7 +36,8 @@ function renderRelatedListSection({ model, sectionActionsEl }, section) {
35
36
  const parentId = resolveExtensionEntityId(props.entityId, sections.vm.id);
36
37
  if (parentId === null)
37
38
  return null;
38
- const mount = (_jsx(RelatedListSection, { section: section, parentId: parentId,
39
+ const anchorId = sectionNavAnchorId(model.titles.sectionNavItems, sectionIndex);
40
+ const mount = (_jsx(RelatedListSection, { ...(anchorId !== undefined && { anchorId }), section: section, parentId: parentId,
39
41
  // @cast-boundary form-values: TValues is structurally a Record.
40
42
  record: form.snapshot.values, featureName: props.featureName, translate: model.engine.state.translate, hideTitle: hideSectionTitles, ...(refreshToken !== undefined && { refreshToken }), ...(fillScreenHeight === true && { grow: true }), ...(hideSectionTitles !== true &&
41
43
  sectionActionsEl !== undefined && { actions: sectionActionsEl }), ...(onRelatedListDrawerAction !== undefined && {
@@ -43,6 +43,21 @@ export function createHandleSubmit(engine) {
43
43
  };
44
44
  return blocked;
45
45
  }
46
+ // A typed secret was just written; keeping the plaintext in form state would
47
+ // leave it readable in memory and re-sendable. Back to the write-only wire
48
+ // shape "set" (true), so the field shows the masked row again.
49
+ function dropSavedSecrets() {
50
+ const values = controller.getSnapshot().values;
51
+ const saved = {};
52
+ for (const [name, def] of Object.entries(props.entity.fields)) {
53
+ if ("writeOnly" in def && def.writeOnly === true && typeof values[name] === "string") {
54
+ if (values[name] !== "")
55
+ saved[name] = true;
56
+ }
57
+ }
58
+ if (Object.keys(saved).length > 0)
59
+ controller.setValues({ ...values, ...saved });
60
+ }
46
61
  // Enter in the active step triggers the native form submit (Next is
47
62
  // type="submit" for Enter support) — on intermediate steps that means
48
63
  // "Next", not "Save". Checked BEFORE the `disabled` guard below:
@@ -87,8 +102,10 @@ export function createHandleSubmit(engine) {
87
102
  let result = customSubmit !== undefined ? blockedCustomSubmitResult() : undefined;
88
103
  if (result === undefined && customSubmit !== undefined) {
89
104
  result = await customSubmit(controller.getSnapshot());
90
- if (result.isSuccess)
105
+ if (result.isSuccess) {
106
+ dropSavedSecrets();
91
107
  controller.rebase();
108
+ }
92
109
  }
93
110
  else if (result === undefined) {
94
111
  result = await controller.submit();
@@ -31,12 +31,12 @@ function resolveFormSubtitle(hideSectionTitles, explicitSubtitle, descriptionSub
31
31
  return explicitSubtitle !== descriptionSubtitle ? explicitSubtitle : undefined;
32
32
  }
33
33
  function sectionNavItemsFor(section, index, formTitle) {
34
- const isNavigable = section.kind === "fields" &&
35
- section.visible &&
36
- section.title !== undefined &&
37
- section.title !== formTitle;
38
- return isNavigable && section.title !== undefined
39
- ? [{ id: formSectionDomId(index), title: section.title }]
34
+ const isListed = section.kind === "relatedList" ||
35
+ section.kind === "extension" ||
36
+ (section.kind === "fields" && section.visible);
37
+ const title = section.title;
38
+ return isListed && title !== undefined && title !== formTitle
39
+ ? [{ id: formSectionDomId(index), title }]
40
40
  : [];
41
41
  }
42
42
  function deriveSectionNavItems(filteredSections, formTitle) {
@@ -112,6 +112,12 @@ export type RenderEditProps<TValues extends FormValues, TCtx = unknown> = {
112
112
  readonly fieldAppendixPlacement?: "above-control" | "below-control";
113
113
  /** Per-field help text rendered under the label (translated by the caller). */
114
114
  readonly fieldDescription?: (fieldName: string) => ReactNode | undefined;
115
+ /** Extra full-width row drawn right after a field's cell (configEdit actions). `dirty` is true
116
+ * while the form has unsaved changes. Called with the field name, returns a ReactNode or
117
+ * undefined. */
118
+ readonly rowAfterField?: (fieldName: string, state: {
119
+ readonly dirty: boolean;
120
+ }) => ReactNode | undefined;
115
121
  /** Marks fields whose value is set at this level; drawn by `settings-list` rows. */
116
122
  readonly fieldAccent?: (fieldName: string) => boolean;
117
123
  /** Edit-mode "changed" markers also for screens without an entity id
@@ -1,7 +1,9 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { EditFieldViewModel, FieldIssue } from "../headless/index.ts";
3
+ import type { usePrimitives } from "../primitives.tsx";
3
4
  import type { RenderInputArgs } from "./render-field-input-shared.ts";
4
5
  export type ControlContext = RenderInputArgs & {
6
+ readonly Link: ReturnType<typeof usePrimitives>["Link"];
5
7
  readonly readOnlyText: boolean;
6
8
  readonly featureName: string | undefined;
7
9
  readonly allIssues: Readonly<Record<string, readonly FieldIssue[]>> | undefined;
@@ -55,10 +55,32 @@ const selectAvailabilityRule = (ctx) => {
55
55
  return undefined;
56
56
  return (_jsx(AvailabilityOptionsSelect, { field: field, query: source.query, payload: source.payload, row: rowOf(ctx), id: id, hasError: hasError, onChange: onChange }));
57
57
  };
58
- const readOnlyTextRule = ({ field, Text, appLocale, t, readOnlyText }) => {
58
+ // Only digits and a leading "+" survive into the tel: href, so a stored
59
+ // "+49 (30) 123-45" dials but can never smuggle other URI parts.
60
+ function telHrefDigits(value) {
61
+ const digits = value.replace(/[^\d]/g, "");
62
+ return value.trim().startsWith("+") ? `+${digits}` : digits;
63
+ }
64
+ function contactHref(field) {
65
+ if (field.type !== "text" || typeof field.value !== "string" || field.value.trim() === "") {
66
+ return undefined;
67
+ }
68
+ if (field.format === "email")
69
+ return `mailto:${field.value.trim()}`;
70
+ if (field.format === "phone") {
71
+ const digits = telHrefDigits(field.value);
72
+ return digits.replace("+", "") === "" ? undefined : `tel:${digits}`;
73
+ }
74
+ return undefined;
75
+ }
76
+ const readOnlyTextRule = ({ field, Text, Link, appLocale, t, readOnlyText }) => {
59
77
  if (!readOnlyText || isComplexFieldType(field.type) || isFileFieldType(field.type)) {
60
78
  return undefined;
61
79
  }
80
+ const href = contactHref(field);
81
+ if (href !== undefined) {
82
+ return (_jsx(Link, { href: href, className: "underline", testId: `field-value-${field.field}`, children: readOnlyDisplayText(field, appLocale, t) }));
83
+ }
62
84
  return (_jsx(Text, { testId: `field-value-${field.field}`, children: readOnlyDisplayText(field, appLocale, t) }));
63
85
  };
64
86
  const writeOnlyRule = ({ field, id, hasError, onChange, changed, readOnlyText }) => {
@@ -1,4 +1,4 @@
1
- import type { ReactNode } from "react";
1
+ import { type ReactNode } from "react";
2
2
  import type { EditFieldViewModel } from "../headless/index.ts";
3
3
  export declare function WriteOnlyTextInput({ field, id, hasError, onChange, changed, }: {
4
4
  readonly field: EditFieldViewModel;
@@ -1,4 +1,5 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useState } from "react";
2
3
  import { useTranslation } from "../i18n.js";
3
4
  import { usePrimitives } from "../primitives.js";
4
5
  // Wire value of a writeOnly field is `true` (set) / `null` (empty), never the
@@ -6,10 +7,19 @@ import { usePrimitives } from "../primitives.js";
6
7
  // nothing / "" which the server reads as "keep". `null` after a loaded `true`
7
8
  // (changed) means "remove on save".
8
9
  export function WriteOnlyTextInput({ field, id, hasError, onChange, changed, }) {
9
- const { Input } = usePrimitives();
10
+ const { Input, Button, Text, Grid } = usePrimitives();
10
11
  const t = useTranslation();
11
12
  const isSet = field.value === true;
12
13
  const isMarkedForRemoval = field.value === null && changed;
14
+ const [replacing, setReplacing] = useState(false);
15
+ // A save turns the wire value back into `true`; the masked row returns with it.
16
+ useEffect(() => {
17
+ if (isSet)
18
+ setReplacing(false);
19
+ }, [isSet]);
20
+ if (isSet && !replacing && !field.readOnly) {
21
+ return (_jsxs(Grid, { columns: "auto", children: [_jsx(Text, { testId: `field-write-only-set-${field.field}`, children: t("kumiko.field.writeOnly.maskedSet") }), _jsx(Button, { type: "button", variant: "secondary", onClick: () => setReplacing(true), testId: `field-write-only-replace-${field.field}`, children: t("kumiko.field.writeOnly.replace") })] }));
22
+ }
13
23
  if (isMarkedForRemoval) {
14
24
  return (_jsx(Input, { kind: "password", id: id, name: field.field, disabled: true, hasError: hasError, value: "", onChange: () => { }, autoComplete: "new-password", placeholder: t("kumiko.field.writeOnly.willRemove"), testId: `field-write-only-removal-${field.field}`, trailingAction: {
15
25
  icon: "undo",
@@ -21,7 +21,7 @@ function fieldOptionalProps({ issues, printsIssues, labelAppendix, fieldAppendix
21
21
  };
22
22
  }
23
23
  export function RenderField({ field, issues, onChange, onSuggest, featureName, labelAppendix, fieldAppendix, appendixPlacement, description, status, allIssues, valueDisplay = "form", row, changed, layout, accent, fillDisabled, hideLabel, }) {
24
- const { Field, Input, Banner, Text, JsonView } = usePrimitives();
24
+ const { Field, Input, Banner, Text, JsonView, Link } = usePrimitives();
25
25
  // The app locale is required for money/date inputs; otherwise they fall back
26
26
  // to navigator.language instead of the selected app language. RenderField is
27
27
  // publicly exported and therefore requires a LocaleProvider; standalone
@@ -48,6 +48,7 @@ export function RenderField({ field, issues, onChange, onSuggest, featureName, l
48
48
  appLocale,
49
49
  Banner,
50
50
  Text,
51
+ Link,
51
52
  JsonView,
52
53
  t,
53
54
  readOnlyText,
@@ -49,10 +49,10 @@ function useFilteredSections(vm, fieldsFilter) {
49
49
  }
50
50
  function useAllFieldsRequired(filteredSections) {
51
51
  return useMemo(() => {
52
- const fillable = filteredSections.flatMap((section) => section.kind === "fields"
53
- ? section.fields.filter((field) => field.visible && !field.readOnly && field.type !== "boolean")
54
- : []);
55
- return fillable.length > 0 && fillable.every((field) => field.required);
52
+ const shown = filteredSections.flatMap((section) => section.kind === "fields" ? section.fields.filter((field) => field.visible) : []);
53
+ const fillable = shown.filter((field) => !field.readOnly && field.type !== "boolean");
54
+ // A lone field carries its own required marker; "all required" only says something for several.
55
+ return shown.length >= 2 && fillable.length > 0 && fillable.every((field) => field.required);
56
56
  }, [filteredSections]);
57
57
  }
58
58
  export function useRenderEditSections(core) {
@@ -1 +1 @@
1
- export declare function formatWhen(value: string): string;
1
+ export declare function formatWhen(value: string, locale?: string): string;
@@ -1,9 +1,9 @@
1
1
  import { toInstant } from "./headless/index.js";
2
2
  // Shared timestamp formatter for operator screens (audit log, job runs) —
3
3
  // falls back to the raw ISO string on an unparseable value instead of "Invalid Date".
4
- export function formatWhen(value) {
4
+ export function formatWhen(value, locale) {
5
5
  try {
6
- return toInstant(value).toLocaleString();
6
+ return toInstant(value).toLocaleString(locale);
7
7
  }
8
8
  catch {
9
9
  return value;
@@ -37,7 +37,7 @@ export function stripControlChars(value) {
37
37
  }
38
38
  return result;
39
39
  }
40
- // http(s)/mailto or scheme-less (relative/anchor) allowed; javascript:,
40
+ // http(s)/mailto/tel or scheme-less (relative/anchor) allowed; javascript:,
41
41
  // data:, vbscript:, etc. rejected. Shared between renderer/web's Link
42
42
  // primitive and page-render's server-side markdown renderer (both take
43
43
  // untrusted tenant-authored hrefs) — no sanitizer dependency needed for a
@@ -71,5 +71,6 @@ export function isSafeHref(href) {
71
71
  const trimmed = stripControlChars(decodeHtmlEntities(href)).toLowerCase();
72
72
  if (!/^[a-z][a-z0-9+.-]*:/.test(trimmed))
73
73
  return true;
74
- return /^(?:https?|mailto):/.test(trimmed);
74
+ // tel: only dials a number; USSD codes like tel:*#06# and anything with letters stay blocked.
75
+ return /^(?:https?|mailto):/.test(trimmed) || /^tel:\+?[\d ()./-]+$/.test(trimmed);
75
76
  }
@@ -470,7 +470,6 @@ export function computeEditViewModel(input) {
470
470
  .map((group) => ({
471
471
  title: translate(group.title),
472
472
  columns: group.columns ?? 2,
473
- columnsDeclared: group.columns !== undefined,
474
473
  fields: group.fields.map((fieldSpec) => {
475
474
  const fieldName = normalizeEditField(fieldSpec).field;
476
475
  const fieldView = fields.find((f) => f.field === fieldName);
@@ -493,7 +492,6 @@ export function computeEditViewModel(input) {
493
492
  }),
494
493
  ...(sectionSpec.subtitle !== undefined && { subtitle: translate(sectionSpec.subtitle) }),
495
494
  columns: sectionSpec.columns ?? defaultColumns,
496
- columnsDeclared: sectionSpec.columns !== undefined,
497
495
  fields,
498
496
  ...(groups !== undefined && { groups }),
499
497
  ...(sectionSpec.icon !== undefined && { icon: sectionSpec.icon }),
@@ -317,15 +317,12 @@ export type EditFieldsSectionViewModel = {
317
317
  /** Translated `EditFieldsSection.subtitle` (wizard step rail / up-next box). */
318
318
  readonly subtitle?: string;
319
319
  readonly columns: number;
320
- /** True when the author declared `columns`; false means the tabs/stacked default. */
321
- readonly columnsDeclared?: boolean;
322
320
  readonly fields: readonly EditFieldViewModel[];
323
321
  /** From `EditFieldsSection.groups` — each entry's `fields` are the same
324
322
  * view-model objects as `fields` above, re-grouped (not recomputed). */
325
323
  readonly groups?: readonly {
326
324
  readonly title: string;
327
325
  readonly columns: number;
328
- readonly columnsDeclared?: boolean;
329
326
  readonly fields: readonly EditFieldViewModel[];
330
327
  }[];
331
328
  /** From `EditFieldsSection.icon` — closed IconKey vocabulary, renders
@@ -13,6 +13,7 @@ export const kumikoDefaultTranslations = {
13
13
  "kumiko.actions.delete-confirm": "Confirm delete?",
14
14
  "kumiko.actions.reload": "Reload",
15
15
  "kumiko.actionForm.success": "Done.",
16
+ "kumiko.configEdit.action.saveFirst": "Save first",
16
17
  "kumiko.actions.retry": "Try again",
17
18
  "kumiko.actions.create": "New",
18
19
  "kumiko.actions.edit": "Edit",
@@ -44,6 +45,8 @@ export const kumikoDefaultTranslations = {
44
45
  "kumiko.field.fillAction.failed": "Could not fetch a suggestion.",
45
46
  "kumiko.field.writeOnly.remove": "Remove stored value",
46
47
  "kumiko.field.writeOnly.set": "Set",
48
+ "kumiko.field.writeOnly.maskedSet": "•••••••••• set",
49
+ "kumiko.field.writeOnly.replace": "Replace",
47
50
  "kumiko.pii.erased": "Deleted",
48
51
  "kumiko.field.writeOnly.setPlaceholder": "Set — leave empty to keep it",
49
52
  "kumiko.field.writeOnly.undo": "Undo",
@@ -144,6 +147,7 @@ export const kumikoDefaultTranslations = {
144
147
  "kumiko.page-header.actions": "Page actions",
145
148
  "kumiko.list.actions": "Actions",
146
149
  "kumiko.sidebar.toggle": "Toggle sidebar",
150
+ "kumiko.focusRail.more": "More",
147
151
  "kumiko.sidebar.title": "Navigation",
148
152
  "kumiko.sidebar.description": "The app's main navigation.",
149
153
  "kumiko.breadcrumb.label": "Breadcrumb",
@@ -231,6 +235,39 @@ export const kumikoDefaultTranslations = {
231
235
  "kumiko.widget.pdf-preview.loading": "Loading PDF…",
232
236
  "kumiko.widget.pdf-preview.pageOf": "Page {page} of {pages}",
233
237
  "kumiko.widget.pdf-preview.renderFailed": "The PDF could not be displayed.",
238
+ "kumiko.widget.pdf-preview.page": "Page",
239
+ "kumiko.widget.pdf-preview.pageCount": "of {pages}",
240
+ "kumiko.widget.pdf-preview.pageInput": "Page number",
241
+ "kumiko.widget.pdf-preview.zoomOut": "Zoom out",
242
+ "kumiko.widget.pdf-preview.zoomIn": "Zoom in",
243
+ "kumiko.widget.pdf-preview.search": "Search in document",
244
+ "kumiko.widget.pdf-preview.matchCount": "Match {index} of {total}",
245
+ "kumiko.widget.pdf-preview.noMatch": "No match",
246
+ "kumiko.widget.pdf-preview.previousMatch": "Previous match",
247
+ "kumiko.widget.pdf-preview.nextMatch": "Next match",
248
+ "kumiko.widget.pdf-preview.pages": "Pages",
249
+ "kumiko.widget.pdf-preview.thumbnail": "Page {page}",
250
+ "kumiko.widget.message-thread.showMore": "Show more",
251
+ "kumiko.widget.message-thread.readWholeMail": "Read the whole mail",
252
+ "kumiko.widget.attachment-card.openOriginal": "View original",
253
+ "kumiko.widget.message-thread.showEarlier": "{count} earlier mails",
254
+ "kumiko.widget.message-thread.showEarlierOne": "1 earlier mail",
255
+ "kumiko.widget.message-thread.showLess": "Show less",
256
+ "kumiko.widget.message-thread.showQuoted": "Show quoted text ({lines} lines)",
257
+ "kumiko.widget.message-thread.hideQuoted": "Hide quoted text",
258
+ "kumiko.widget.message-thread.imagesBlocked": "HTML mail, shown sanitized. External images blocked.",
259
+ "kumiko.widget.message-thread.showImages": "Load images",
260
+ "kumiko.widget.message-reader.mail": "Mail",
261
+ "kumiko.widget.step-list.progress": "{done} of {total} done",
262
+ "kumiko.widget.step-list.progressLabel": "Progress",
263
+ "kumiko.widget.step-list.moreSteps": "and {count} more steps",
264
+ "kumiko.widget.step-list.waitingFor": "Waiting for: {reason}",
265
+ "kumiko.widget.step-list.statusDone": "Done",
266
+ "kumiko.widget.step-list.statusOpen": "Open",
267
+ "kumiko.widget.step-list.statusLocked": "Locked",
268
+ "kumiko.widget.step-list.statusRunning": "Running",
269
+ "kumiko.widget.step-list.statusRejected": "Rejected",
270
+ "kumiko.widget.step-list.statusFailed": "Failed",
234
271
  "kumiko.widget.step-bar.done": "Done",
235
272
  "kumiko.widget.drawer.restore": "Restore drawer width",
236
273
  "kumiko.widget.drawer.maximize": "Maximize drawer width",
@@ -355,6 +392,7 @@ export const kumikoDefaultTranslations = {
355
392
  "errors.validation.invalid_element": "Invalid entry.",
356
393
  "errors.validation.invalid_value": "Invalid choice.",
357
394
  "errors.validation.custom": "Invalid value.",
395
+ "errors.validation.onlyDeleted": "The trash list is not available here.",
358
396
  "errors.validation.unexpected_field": "Unknown field.",
359
397
  "errors.validation.out_of_bounds": "Value out of allowed range.",
360
398
  "errors.validation.invalid_option": "Invalid choice.",
package/dist/index.d.ts CHANGED
@@ -88,7 +88,7 @@ export { InsideDrawerProvider, useInsideDrawer } from "./inside-drawer.ts";
88
88
  export { hasUnsavedInput, registerUnsavedInputSource, requestLeave, setLeaveConfirmer, useUnsavedInputSource, } from "./leave-guard.ts";
89
89
  export { LeaveGuardDialog } from "./leave-guard-dialog.tsx";
90
90
  export { PageHeaderCompactProvider, PageHeaderSlotAvailableProvider, usePageHeaderCompact, usePageHeaderSlotAvailable, } from "./page-header-slot.ts";
91
- export type { ActionMenuItemSpec, ActionOverflowMenuProps, AppPrimitives, BannerProps, BulkRowOutcome, ButtonProps, CardOptions, CardProps, CardSlots, CopyButtonProps, CorePrimitives, DataTableBulk, DataTableBulkAction, DataTableDateRangeFacet, DataTableFacet, DataTableFacetChip, DataTableProps, DataTableRowAction, DataTableRowActionMode, DataTableSort, DataTableSortDir, DialogProps, DrawerProps, EmbeddedListCellType, EmbeddedListColumn, EmbeddedListInputProps, EmbeddedListTotal, FieldCellWidth, FieldProps, FileValueListProps, FillContainerProps, FooterActionMarker, FooterActionRole, FormProps, FormSectionNavItem, FormWidth, GridCellProps, GridProps, HeadingProps, InputFillAction, InputProps, JsonViewProps, LightboxImage, LightboxProps, LinkProps, MetricBandProps, MetricProps, ModalProps, PageHeaderProps, PickedFile, PrimitivesProviderProps, PrimitivesRegistry, ProgressProps, ProgressTone, PromoPanelAction, PromoPanelProps, RuntimeRenderer, SecretRevealProps, SecretRevealValue, SectionProps, ShareButtonProps, StatusBadgeProps, StatusTone, StepBarProps, StickyActionBarProps, StickyPrimaryActionMarker, TabsProps, TextProps, TrailingInputAction, WizardStepGroupProps, } from "./primitives.tsx";
91
+ export type { ActionMenuItemSpec, ActionOverflowMenuProps, AppPrimitives, BannerProps, BulkRowOutcome, ButtonProps, CardOptions, CardProps, CardSlots, CopyButtonProps, CorePrimitives, DataTableBulk, DataTableBulkAction, DataTableDateRangeFacet, DataTableFacet, DataTableFacetChip, DataTableProps, DataTableRowAction, DataTableRowActionMode, DataTableSort, DataTableSortDir, DialogProps, DrawerProps, EmbeddedListCellType, EmbeddedListColumn, EmbeddedListInputProps, EmbeddedListTotal, FieldCellWidth, FieldProps, FileValueListProps, FillContainerProps, FooterActionMarker, FooterActionRole, FormProps, FormSectionNavItem, FormWidth, GridCellProps, GridProps, HeadingProps, InputEndAction, InputFillAction, InputProps, JsonViewProps, LightboxImage, LightboxProps, LinkProps, MetricBandProps, MetricProps, ModalProps, PageHeaderProps, PickedFile, PrimitivesProviderProps, PrimitivesRegistry, ProgressProps, ProgressTone, PromoPanelAction, PromoPanelProps, RuntimeRenderer, SecretRevealProps, SecretRevealValue, SectionProps, ShareButtonProps, StatusBadgeProps, StatusTone, StepBarProps, StickyActionBarProps, StickyPrimaryActionMarker, TabsProps, TextProps, TrailingInputAction, WizardStepGroupProps, } from "./primitives.tsx";
92
92
  export { FOOTER_ACTION_ROLE_PROP, NARROW_LABEL_PROP, PrimitivesProvider, STICKY_PRIMARY_ACTION_PROP, shouldRenderActionsIconOnly, statusToneForOptionTone, statusToneForValue, useOptionalPrimitives, usePrimitives, } from "./primitives.tsx";
93
93
  export type { SessionEndedSignal, SessionEndedSignalProviderProps, } from "./session/session-ended.tsx";
94
94
  export { createSessionEndedSignal, isSessionEndedError, SESSION_ENDED_ERROR_CODES, SessionEndedSignalProvider, useSessionEndedSignal, withSessionEndedDetection, } from "./session/session-ended.tsx";
@@ -96,5 +96,6 @@ export { buildWhatsAppShareUrl } from "./share-links.ts";
96
96
  export { sortByAccessor } from "./sort-by-accessor.ts";
97
97
  export type { LiveEvent, LiveEventSubscriber, LiveEventsProviderProps, } from "./sse/live-events.tsx";
98
98
  export { LIVE_RESYNC_EVENT_TYPE, LiveEventsProvider, useLiveEvents } from "./sse/live-events.tsx";
99
+ export { toggleSetMember } from "./toggle-set-member.ts";
99
100
  export type { AppTokens, ColorTokens, CoreTokens, FontTokens, RadiusTokens, ShadowTokens, SpacingTokens, ThemeMode, ThemePreference, Tokens, TokensApi, TokensProviderProps, } from "./tokens.tsx";
100
101
  export { cssVarTokens, TokensProvider, useTokenController, useTokens } from "./tokens.tsx";
package/dist/index.js CHANGED
@@ -70,4 +70,5 @@ export { createSessionEndedSignal, isSessionEndedError, SESSION_ENDED_ERROR_CODE
70
70
  export { buildWhatsAppShareUrl } from "./share-links.js";
71
71
  export { sortByAccessor } from "./sort-by-accessor.js";
72
72
  export { LIVE_RESYNC_EVENT_TYPE, LiveEventsProvider, useLiveEvents } from "./sse/live-events.js";
73
+ export { toggleSetMember } from "./toggle-set-member.js";
73
74
  export { cssVarTokens, TokensProvider, useTokenController, useTokens } from "./tokens.js";
@@ -7,6 +7,7 @@ import type { DataTableTableBlock } from "./data-table-view-types.ts";
7
7
  import type { EmbeddedListInputProps } from "./embedded-list-types.ts";
8
8
  import type { FieldIssue, ListColumnViewModel, ListRowViewModel, RuntimeRenderer } from "./headless/index.ts";
9
9
  import type { MetricBandProps, MetricProps } from "./metric-types.ts";
10
+ import type { StatusBadgeOptionTone, StatusTone } from "./status-tone.ts";
10
11
  export type { EmbeddedListCellType, EmbeddedListColumn, EmbeddedListInputProps, EmbeddedListTotal, } from "./embedded-list-types.ts";
11
12
  export type { RuntimeRenderer };
12
13
  /** Escape hatch for `data-*` test hooks (e.g. an E2E selector) that don't
@@ -113,8 +114,10 @@ export type BannerProps = {
113
114
  * placeholders (not-found, loading), "loading" for load states, "warning"
114
115
  * for a non-blocking but attention-grabbing notice (e.g. secretMint's
115
116
  * "this is shown only once"), "primary" for a call-to-action notice (neutral
116
- * background, accent in the primary color; pair it with `title` and `actions`). */
117
- readonly variant?: "error" | "info" | "loading" | "warning" | "primary";
117
+ * background, accent in the primary color; pair it with `title` and `actions`),
118
+ * "hint" for a quiet aside on a muted background (e.g. per-entry results of
119
+ * a submit, with an "Open" link in `actions`). */
120
+ readonly variant?: "error" | "info" | "loading" | "warning" | "primary" | "hint";
118
121
  /** Bold heading above `children`, inside the text column. */
119
122
  readonly title?: ReactNode;
120
123
  readonly titleTestId?: string;
@@ -178,6 +181,21 @@ export type FieldProps = {
178
181
  * signature. Custom implementations can dispatch internally, render a
179
182
  * different control (toggle instead of checkbox), or customize individual
180
183
  * kinds. */
184
+ /** Button inside the right edge of a text input: an icon (e.g. a microphone)
185
+ * or, with `label`, a small primary text button that submits what was typed. */
186
+ export type InputEndAction = {
187
+ readonly onClick: () => void;
188
+ /** Toggle state, e.g. a microphone that is currently recording. */
189
+ readonly pressed?: boolean;
190
+ } & ({
191
+ readonly icon: ReactNode;
192
+ readonly ariaLabel: string;
193
+ readonly label?: undefined;
194
+ } | {
195
+ readonly label: string;
196
+ readonly icon?: undefined;
197
+ readonly ariaLabel?: undefined;
198
+ });
181
199
  /** Button beside a single-line text/number input that fills it with a
182
200
  * suggestion. Stays usable on a `disabled` input (the readOnly+fill case). */
183
201
  export type InputFillAction = {
@@ -231,6 +249,7 @@ export type InputProps = {
231
249
  readonly prefix?: string;
232
250
  readonly suffix?: string;
233
251
  readonly fill?: InputFillAction;
252
+ readonly endAction?: InputEndAction;
234
253
  readonly dataAttributes?: DataAttributes;
235
254
  /** Raw keydown access (e.g. Enter-to-submit at the field instead of
236
255
  * the surrounding Form). Forwarded to the element. */
@@ -1244,22 +1263,26 @@ export type TabsProps = {
1244
1263
  /** Shown dimmed after the label (e.g. an open-items count). Omit for
1245
1264
  * tabs without a counter. */
1246
1265
  readonly count?: number;
1266
+ /** Rendered before the label. */
1267
+ readonly icon?: ReactNode;
1268
+ /** Small muted text after the label, e.g. "4 Seiten". */
1269
+ readonly detail?: string;
1247
1270
  }[];
1248
1271
  readonly activeId: string;
1249
1272
  readonly onSelect: (id: string) => void;
1273
+ /** "pill" (default) = count badge, 44px strip. "plain" = count as plain muted number, 40px strip
1274
+ * flush with its content (tabs that switch a reader). "filter" = the plain look inset by 6px with
1275
+ * no gap between tabs (the filter strip of a list pane). */
1276
+ readonly appearance?: "pill" | "plain" | "filter";
1250
1277
  readonly testId?: string;
1251
1278
  };
1252
- export type StatusTone = "ok" | "warn" | "bad" | "critical" | "muted";
1253
- /** Tones a select option can request: the status tones plus the brand `accent`. */
1254
- export type StatusBadgeOptionTone = StatusTone | "accent";
1279
+ export { type StatusBadgeOptionTone, type StatusTone, statusToneForOptionTone, statusToneForValue, } from "./status-tone.ts";
1255
1280
  /** Status pill. `value` is the raw column value — tone-mapping is the app's job. */
1256
1281
  export type StatusBadgeProps = {
1257
1282
  readonly value: string;
1258
1283
  readonly tone?: StatusBadgeOptionTone;
1259
1284
  readonly testId?: string;
1260
1285
  };
1261
- export declare function statusToneForOptionTone(tone: SelectOptionTone): StatusBadgeOptionTone | undefined;
1262
- export declare function statusToneForValue(value: string): StatusTone | undefined;
1263
1286
  /** Structured JSON display (audit payload/metadata, job logs, unsupported
1264
1287
  * jsonb/embedded field fallback). Takes the raw value, not a pre-stringified
1265
1288
  * one — the implementation owns `JSON.stringify` (and must not throw on