@cosmicdrift/kumiko-renderer 0.416.0 → 0.418.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 (191) hide show
  1. package/dist/app/action-form-body.d.ts +1 -4
  2. package/dist/app/action-form-body.js +14 -9
  3. package/dist/app/action-form-preview.d.ts +13 -0
  4. package/dist/app/action-form-preview.js +66 -0
  5. package/dist/app/action-form-support.d.ts +6 -1
  6. package/dist/app/action-form-support.js +26 -9
  7. package/dist/app/config-edit-body.js +71 -79
  8. package/dist/app/entity-list-screen.js +1 -1
  9. package/dist/app/header-actions-bar.d.ts +3 -1
  10. package/dist/app/header-actions-bar.js +12 -4
  11. package/dist/app/list-bulk-actions.d.ts +8 -1
  12. package/dist/app/list-bulk-actions.js +28 -4
  13. package/dist/app/locked-screen-header.d.ts +2 -0
  14. package/dist/app/locked-screen-header.js +8 -1
  15. package/dist/app/projection-detail-body.js +24 -5
  16. package/dist/app/projection-detail-guidance.d.ts +1 -0
  17. package/dist/app/projection-detail-guidance.js +7 -4
  18. package/dist/app/projection-detail-header-model.js +4 -1
  19. package/dist/app/projection-detail-header-region.js +25 -9
  20. package/dist/app/projection-detail-header.d.ts +2 -0
  21. package/dist/app/projection-detail-header.js +30 -3
  22. package/dist/app/projection-list-shim.js +1 -0
  23. package/dist/app/row-actions.d.ts +4 -0
  24. package/dist/app/row-actions.js +19 -3
  25. package/dist/app/use-projection-detail-actions.d.ts +3 -1
  26. package/dist/app/use-projection-detail-actions.js +9 -1
  27. package/dist/app/use-projection-detail-data.js +17 -1
  28. package/dist/app/use-projection-list-data.js +1 -1
  29. package/dist/card-options.d.ts +2 -0
  30. package/dist/components/choice-chip-class.d.ts +1 -0
  31. package/dist/components/choice-chip-class.js +9 -0
  32. package/dist/components/edit-mounts.d.ts +1 -1
  33. package/dist/components/embedded-list-paste.js +2 -2
  34. package/dist/components/grid-cell-for-field.js +1 -1
  35. package/dist/components/multi-select-chips.js +7 -2
  36. package/dist/components/multi-select-count.d.ts +5 -0
  37. package/dist/components/multi-select-count.js +10 -0
  38. package/dist/components/narrow-description.d.ts +3 -0
  39. package/dist/components/narrow-description.js +12 -0
  40. package/dist/components/related-list-section.d.ts +5 -3
  41. package/dist/components/related-list-section.js +9 -4
  42. package/dist/components/related-photo-grid.js +17 -3
  43. package/dist/components/render-edit-field-grid.d.ts +12 -3
  44. package/dist/components/render-edit-field-grid.js +60 -18
  45. package/dist/components/render-edit-fields-section.js +45 -11
  46. package/dist/components/render-edit-header-actions.js +1 -1
  47. package/dist/components/render-edit-layout.js +5 -3
  48. package/dist/components/render-edit-section-kinds.js +50 -12
  49. package/dist/components/render-edit-titles.js +1 -1
  50. package/dist/components/render-edit-types.d.ts +13 -0
  51. package/dist/components/render-field-ai-assist.js +26 -7
  52. package/dist/components/render-field-choice-inputs.js +3 -0
  53. package/dist/components/render-field-control.js +1 -1
  54. package/dist/components/render-field-value-chips.js +6 -4
  55. package/dist/components/render-field-values.js +3 -3
  56. package/dist/components/render-list-hint-columns.d.ts +1 -0
  57. package/dist/components/render-list-hint-columns.js +30 -5
  58. package/dist/components/render-list-reference-columns.js +2 -4
  59. package/dist/components/render-list-row-tone.d.ts +2 -0
  60. package/dist/components/render-list-row-tone.js +6 -0
  61. package/dist/components/render-list-table-props.d.ts +13 -2
  62. package/dist/components/render-list-table-props.js +9 -3
  63. package/dist/components/render-list-types.d.ts +4 -0
  64. package/dist/components/render-list.js +12 -4
  65. package/dist/components/use-render-list-columns.js +3 -3
  66. package/dist/components/write-form-registry.d.ts +13 -0
  67. package/dist/components/write-form-registry.js +6 -0
  68. package/dist/components/write-form-section.d.ts +5 -1
  69. package/dist/components/write-form-section.js +55 -16
  70. package/dist/data-table-bulk-types.d.ts +11 -2
  71. package/dist/data-table-bulk-types.js +3 -1
  72. package/dist/headless/form/form-controller.d.ts +2 -0
  73. package/dist/headless/form/form-controller.js +2 -2
  74. package/dist/headless/format/index.d.ts +1 -1
  75. package/dist/headless/format/index.js +6 -5
  76. package/dist/headless/format/money.d.ts +5 -0
  77. package/dist/headless/format/money.js +10 -0
  78. package/dist/headless/format/relative-time.d.ts +2 -0
  79. package/dist/headless/format/relative-time.js +4 -1
  80. package/dist/headless/index.d.ts +1 -1
  81. package/dist/headless/index.js +1 -1
  82. package/dist/headless/view-model/edit.js +87 -37
  83. package/dist/headless/view-model/list.js +6 -0
  84. package/dist/headless/view-model/types.d.ts +50 -5
  85. package/dist/hooks/use-bulk-run.d.ts +2 -2
  86. package/dist/hooks/use-list-table.js +11 -6
  87. package/dist/i18n-defaults.js +8 -2
  88. package/dist/primitives-record-guidance.d.ts +4 -0
  89. package/dist/primitives-share-types.d.ts +82 -0
  90. package/dist/primitives-share-types.js +1 -0
  91. package/dist/primitives.d.ts +34 -83
  92. package/dist/web/app/bold-markup.d.ts +3 -0
  93. package/dist/web/app/bold-markup.js +14 -0
  94. package/dist/web/app/dashboard-body.js +5 -1
  95. package/dist/web/app/dashboard-list-panel.js +7 -4
  96. package/dist/web/app/dashboard-panels.js +31 -3
  97. package/dist/web/app/dashboard-shared.d.ts +3 -1
  98. package/dist/web/app/dashboard-shared.js +3 -3
  99. package/dist/web/app/dashboard-stat-group-panel.d.ts +1 -1
  100. package/dist/web/app/dashboard-stat-group-panel.js +16 -2
  101. package/dist/web/app/dashboard-text-panel.js +11 -6
  102. package/dist/web/app/relative-time.js +10 -1
  103. package/dist/web/components/config-cascade.d.ts +2 -1
  104. package/dist/web/components/config-cascade.js +16 -4
  105. package/dist/web/drawn-icons.js +2 -1
  106. package/dist/web/layout/header-action-pinned.d.ts +4 -2
  107. package/dist/web/layout/header-action-pinned.js +13 -4
  108. package/dist/web/layout/header-overflow-menu.d.ts +2 -0
  109. package/dist/web/layout/header-overflow-menu.js +2 -0
  110. package/dist/web/layout/nav-tree.js +1 -1
  111. package/dist/web/layout/notification-bell.js +13 -4
  112. package/dist/web/layout/page-header-slot.d.ts +2 -0
  113. package/dist/web/layout/page-header-slot.js +4 -0
  114. package/dist/web/layout/screen-focus.js +4 -1
  115. package/dist/web/layout/shell-header.js +15 -7
  116. package/dist/web/primitives/banner.js +14 -3
  117. package/dist/web/primitives/card.js +5 -3
  118. package/dist/web/primitives/combobox.js +2 -2
  119. package/dist/web/primitives/data-table/actions-column.js +1 -1
  120. package/dist/web/primitives/data-table/card-body.d.ts +1 -1
  121. package/dist/web/primitives/data-table/card-body.js +37 -14
  122. package/dist/web/primitives/data-table/card-frame.d.ts +2 -0
  123. package/dist/web/primitives/data-table/card-frame.js +3 -0
  124. package/dist/web/primitives/data-table/card-row.js +28 -9
  125. package/dist/web/primitives/data-table/card-sort-select.js +1 -1
  126. package/dist/web/primitives/data-table/card-view.js +1 -1
  127. package/dist/web/primitives/data-table/data-cell-props.d.ts +2 -1
  128. package/dist/web/primitives/data-table/data-cell-props.js +1 -0
  129. package/dist/web/primitives/data-table/density.d.ts +3 -1
  130. package/dist/web/primitives/data-table/density.js +11 -4
  131. package/dist/web/primitives/data-table/row-render-parts.d.ts +1 -1
  132. package/dist/web/primitives/data-table/row-render-parts.js +3 -5
  133. package/dist/web/primitives/data-table/sort-options-select.js +2 -2
  134. package/dist/web/primitives/data-table/sortable-header.js +4 -4
  135. package/dist/web/primitives/data-table/table-body.js +2 -1
  136. package/dist/web/primitives/data-table/table-chrome.js +1 -3
  137. package/dist/web/primitives/data-table/table-content.js +7 -11
  138. package/dist/web/primitives/data-table/table-data-cell.js +31 -17
  139. package/dist/web/primitives/data-table/table-header-row.js +1 -1
  140. package/dist/web/primitives/data-table/table-view.js +1 -1
  141. package/dist/web/primitives/data-table/toolbar.js +6 -7
  142. package/dist/web/primitives/data-table/use-bulk-selection.d.ts +1 -1
  143. package/dist/web/primitives/data-table/use-bulk-selection.js +5 -0
  144. package/dist/web/primitives/data-table/use-data-table-state.d.ts +6 -1
  145. package/dist/web/primitives/data-table/use-data-table-state.js +12 -2
  146. package/dist/web/primitives/data-table-cell.d.ts +13 -2
  147. package/dist/web/primitives/data-table-cell.js +125 -53
  148. package/dist/web/primitives/data-table.js +1 -1
  149. package/dist/web/primitives/default-form.d.ts +1 -1
  150. package/dist/web/primitives/default-form.js +11 -10
  151. package/dist/web/primitives/drawer.js +2 -7
  152. package/dist/web/primitives/facet-filter.d.ts +1 -1
  153. package/dist/web/primitives/facet-filter.js +2 -5
  154. package/dist/web/primitives/facet-search-filter.js +1 -1
  155. package/dist/web/primitives/facet-trigger-label.d.ts +1 -4
  156. package/dist/web/primitives/facet-trigger-label.js +4 -7
  157. package/dist/web/primitives/field.js +15 -8
  158. package/dist/web/primitives/form-footer-parts.js +2 -2
  159. package/dist/web/primitives/inline-suffix.d.ts +2 -0
  160. package/dist/web/primitives/inline-suffix.js +5 -0
  161. package/dist/web/primitives/input-choice-kinds.js +12 -2
  162. package/dist/web/primitives/input-number-kinds.js +2 -2
  163. package/dist/web/primitives/input-text-kinds.js +1 -1
  164. package/dist/web/primitives/layout-elements.d.ts +4 -4
  165. package/dist/web/primitives/layout-elements.js +49 -12
  166. package/dist/web/primitives/layout.d.ts +1 -1
  167. package/dist/web/primitives/layout.js +1 -1
  168. package/dist/web/primitives/metric.js +4 -5
  169. package/dist/web/primitives/money-input.js +8 -7
  170. package/dist/web/primitives/number-input.d.ts +2 -1
  171. package/dist/web/primitives/number-input.js +9 -4
  172. package/dist/web/primitives/page-header.d.ts +1 -1
  173. package/dist/web/primitives/page-header.js +8 -1
  174. package/dist/web/primitives/pager.js +12 -21
  175. package/dist/web/primitives/photo-grid.js +2 -1
  176. package/dist/web/primitives/record-steps.d.ts +1 -1
  177. package/dist/web/primitives/record-steps.js +6 -15
  178. package/dist/web/primitives/row-actions.js +38 -24
  179. package/dist/web/primitives/use-container-narrow.d.ts +12 -0
  180. package/dist/web/primitives/use-container-narrow.js +42 -0
  181. package/dist/web/pwa/pwa-support.js +13 -7
  182. package/dist/web/ui/input.js +1 -1
  183. package/dist/web/ui/textarea.js +1 -1
  184. package/dist/web/widgets/dashboard-list-cards.js +6 -3
  185. package/dist/web/widgets/dashboard-list.d.ts +4 -1
  186. package/dist/web/widgets/dashboard-list.js +10 -5
  187. package/dist/web/widgets/progress-list.js +1 -1
  188. package/dist/web/widgets/stat-box-cell.js +1 -1
  189. package/package.json +5 -5
  190. package/src/changes.json +51 -0
  191. package/src/web/styles.css +3 -2
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useContext } from "react";
3
3
  import { InsideDrawerProvider, useInsideDrawer, useTranslation, } from "../../index.js";
4
4
  import { cn } from "../lib/cn.js";
@@ -15,17 +15,18 @@ import { unsavedStatusText } from "./form-footer-parts.js";
15
15
  function FormSummaryBox({ summary, testId }) {
16
16
  if (summary === undefined)
17
17
  return null;
18
- return (_jsxs("div", { "data-testid": testId !== undefined ? `${testId}-summary` : undefined, className: "flex flex-col gap-0.5 rounded-lg bg-muted px-3.5 py-3", children: [_jsx("span", { className: "text-sm font-semibold text-foreground", children: summary.title }), summary.subtitle !== undefined && (_jsx("span", { className: "text-[13px] text-foreground-secondary", children: summary.subtitle }))] }));
18
+ return (_jsxs("div", { "data-testid": testId !== undefined ? `${testId}-summary` : undefined, className: "flex flex-col gap-[3px] rounded-[9px] border border-l-[3px] border-border-strong border-l-primary bg-card px-4 py-[13px]", children: [_jsx("span", { className: "text-[15px] leading-[21px] font-semibold text-foreground", children: summary.title }), summary.subtitle !== undefined && (_jsx("span", { className: "text-[13.5px] text-foreground-secondary", children: summary.subtitle }))] }));
19
19
  }
20
- function DrawerFormLayout({ onSubmit, focusFirstErrorKey, subtitle, actions, secondaryActions, summary, testId, children, }) {
21
- return (_jsxs(FormRoot, { onSubmit: onSubmit, focusFirstErrorKey: focusFirstErrorKey, testId: testId, className: "flex h-full min-h-0 w-full flex-col", children: [_jsxs("div", { "data-testid": testId !== undefined ? `${testId}-scroll` : undefined, className: "flex min-h-0 flex-1 flex-col gap-5 overflow-y-auto px-6 py-5", children: [_jsx(FormSummaryBox, { summary: summary, testId: testId }), subtitle !== undefined && (_jsx("p", { "data-testid": testId !== undefined ? `${testId}-subtitle` : undefined, className: "text-[13px] text-foreground-secondary", children: subtitle })), _jsx(InsideFormContext.Provider, { value: true, children: _jsx(ScreenFormContext.Provider, { value: true, children: _jsx(InsideDrawerProvider, { value: false, children: _jsx(DrawerBodyContext.Provider, { value: true, children: _jsx("div", { className: "flex flex-col gap-5", children: children }) }) }) }) })] }), (actions !== undefined || secondaryActions !== undefined) && (_jsxs("div", { "data-testid": testId !== undefined ? `${testId}-footer` : undefined, className: "flex h-16 shrink-0 items-center justify-end gap-2 border-t border-border px-6", children: [secondaryActions, actions] }))] }));
20
+ function DrawerFormLayout({ onSubmit, focusFirstErrorKey, subtitle, actions, secondaryActions, summary, topBanner, testId, children, }) {
21
+ return (_jsxs(FormRoot, { onSubmit: onSubmit, focusFirstErrorKey: focusFirstErrorKey, testId: testId, className: "flex h-full min-h-0 w-full flex-col", children: [_jsxs("div", { "data-testid": testId !== undefined ? `${testId}-scroll` : undefined, className: "flex min-h-0 flex-1 flex-col gap-5 overflow-y-auto px-6 py-5", children: [topBanner, _jsx(FormSummaryBox, { summary: summary, testId: testId }), subtitle !== undefined && (_jsx("p", { "data-testid": testId !== undefined ? `${testId}-subtitle` : undefined, className: "text-[13px] text-foreground-secondary", children: subtitle })), _jsx(InsideFormContext.Provider, { value: true, children: _jsx(ScreenFormContext.Provider, { value: true, children: _jsx(InsideDrawerProvider, { value: false, children: _jsx(DrawerBodyContext.Provider, { value: true, children: _jsx("div", { className: "flex flex-col gap-5", children: children }) }) }) }) })] }), (actions !== undefined || secondaryActions !== undefined) && (_jsxs("div", { "data-testid": testId !== undefined ? `${testId}-footer` : undefined, className: "flex h-16 shrink-0 items-center justify-end gap-2 border-t border-border px-6", children: [secondaryActions, actions] }))] }));
22
22
  }
23
23
  function EmbeddedFormLayout({ onSubmit, focusFirstErrorKey, actions, secondaryActions, unsavedCount, testId, children, }) {
24
24
  const t = useTranslation();
25
25
  return (_jsxs(FormRoot, { onSubmit: onSubmit, focusFirstErrorKey: focusFirstErrorKey, testId: testId, className: "flex w-full flex-col gap-6", children: [_jsx(FormSections, { chromeless: true, stickyActions: undefined, fillHeight: false, screenForm: true, children: children }), (actions !== undefined || secondaryActions !== undefined) && (_jsxs("div", { "data-testid": testId !== undefined ? `${testId}-footer` : undefined, className: "flex flex-wrap items-center gap-2", children: [actions, secondaryActions, unsavedCount !== undefined && unsavedCount > 0 && (_jsxs("span", { "data-testid": testId !== undefined ? `${testId}-unsaved` : undefined, className: "flex items-center gap-2 text-[13px] text-foreground-secondary", children: [_jsx("span", { className: "size-1.5 shrink-0 rounded-full bg-status-active", "aria-hidden": "true" }), unsavedStatusText(t, unsavedCount)] }))] }))] }));
26
26
  }
27
- export function DefaultForm({ onSubmit, focusFirstErrorKey, children, title, subtitle, actions, secondaryActions, testId, width, stickyActions, headerRegion, titleAction, fillHeight, chromeless, screenForm, unsavedCount, sectionNav, sideRail, summary, }) {
27
+ export function DefaultForm({ onSubmit, focusFirstErrorKey, children, title, subtitle, actions, secondaryActions, testId, width, stickyActions, headerRegion, titleAction, fillHeight, chromeless, screenForm, unsavedCount, sectionNav, sideRail, summary, topBanner, }) {
28
28
  const insideDrawer = useInsideDrawer();
29
+ const bodyWithTopBanner = topBanner === undefined ? (children) : (_jsxs(_Fragment, { children: [topBanner, children] }));
29
30
  const isEmbeddedForm = useContext(EmbeddedFormContext);
30
31
  const contextWidth = useContext(ScreenWidthContext);
31
32
  // Embedded (AuthCard etc.): bare <form>, stacked fields with gap; the
@@ -34,17 +35,17 @@ export function DefaultForm({ onSubmit, focusFirstErrorKey, children, title, sub
34
35
  return (_jsxs(FormRoot, { onSubmit: onSubmit, focusFirstErrorKey: focusFirstErrorKey, testId: testId, className: cn("flex flex-col gap-4",
35
36
  // Bare forms stack sections without a card; without a divider a
36
37
  // section boundary reads as a layout gap, not structure.
37
- "[&>section:not(:first-child)]:border-t"), children: [headerRegion, _jsx(InsideFormContext.Provider, { value: true, children: children }), (secondaryActions !== undefined || actions !== undefined) && (_jsxs("div", { className: "flex items-center justify-end gap-2", children: [secondaryActions, actions] }))] }));
38
+ "[&>section:not(:first-child)]:border-t"), children: [headerRegion, _jsx(InsideFormContext.Provider, { value: true, children: bodyWithTopBanner }), (secondaryActions !== undefined || actions !== undefined) && (_jsxs("div", { className: "flex items-center justify-end gap-2", children: [secondaryActions, actions] }))] }));
38
39
  }
39
40
  if (insideDrawer) {
40
- return (_jsx(DrawerFormLayout, { onSubmit: onSubmit, focusFirstErrorKey: focusFirstErrorKey, subtitle: subtitle, actions: actions, secondaryActions: secondaryActions, summary: summary, testId: testId, children: children }));
41
+ return (_jsx(DrawerFormLayout, { onSubmit: onSubmit, focusFirstErrorKey: focusFirstErrorKey, subtitle: subtitle, actions: actions, secondaryActions: secondaryActions, summary: summary, topBanner: topBanner, testId: testId, children: children }));
41
42
  }
42
43
  if (isEmbeddedForm) {
43
- return (_jsx(EmbeddedFormLayout, { onSubmit: onSubmit, focusFirstErrorKey: focusFirstErrorKey, actions: actions, secondaryActions: secondaryActions, unsavedCount: unsavedCount, testId: testId, children: children }));
44
+ return (_jsx(EmbeddedFormLayout, { onSubmit: onSubmit, focusFirstErrorKey: focusFirstErrorKey, actions: actions, secondaryActions: secondaryActions, unsavedCount: unsavedCount, testId: testId, children: bodyWithTopBanner }));
44
45
  }
45
46
  const isScreenForm = screenForm === true && fillHeight === true && chromeless !== true;
46
47
  const screenFormWidth = width ?? contextWidth;
47
- const sections = (_jsx(FormSections, { chromeless: chromeless === true, stickyActions: stickyActions, fillHeight: fillHeight, screenForm: isScreenForm, children: children }));
48
+ const sections = (_jsx(FormSections, { chromeless: chromeless === true, stickyActions: stickyActions, fillHeight: fillHeight, screenForm: isScreenForm, children: isScreenForm ? children : bodyWithTopBanner }));
48
49
  const footer = (_jsx(FormFooter, { actions: actions, secondaryActions: secondaryActions, testId: testId, chromeless: chromeless === true, stickyActions: stickyActions, fillHeight: fillHeight, ...(unsavedCount !== undefined && { unsavedCount }), railed: sideRail !== undefined }));
49
50
  // Screen form: no card. A padded scroll surface holds the form column and,
50
51
  // from xl, the section navigation; the footer stays pinned below it.
@@ -52,7 +53,7 @@ export function DefaultForm({ onSubmit, focusFirstErrorKey, children, title, sub
52
53
  const showsSectionNav = sectionNav !== undefined && sectionNav.length >= SECTION_NAV_MIN_ITEMS;
53
54
  return (_jsxs(FormRoot, { onSubmit: onSubmit, focusFirstErrorKey: focusFirstErrorKey, testId: testId, className: "flex h-full min-h-0 w-full flex-col", children: [_jsxs("div", { className: "flex min-h-0 flex-1 flex-col lg:flex-row", children: [sideRail, _jsx("div", { "data-testid": testId !== undefined ? `${testId}-scroll` : undefined, className: cn("min-h-0 flex-1 overflow-y-auto", screenPaddingClassName), children: _jsxs("div", { className: "flex gap-18", children: [_jsxs("div", { className: cn("flex w-full min-w-0 flex-col gap-9", screenFormWidth !== undefined
54
55
  ? screenFormColumnWidthClassName[screenFormWidth]
55
- : "max-w-[640px]"), children: [headerRegion !== undefined && (_jsx("div", { className: "flex flex-col gap-9", children: _jsx(InsideScreenFormColumnContext.Provider, { value: true, children: headerRegion }) })), _jsx(FormTitleBlock, { title: title, subtitle: subtitle, titleAction: titleAction, testId: testId, bordered: false, fillHeight: false }), _jsx(FormSummaryBox, { summary: summary, testId: testId }), sections] }), showsSectionNav && _jsx(FormSectionNav, { items: sectionNav })] }) })] }), footer] }));
56
+ : "max-w-[640px]"), children: [headerRegion !== undefined && (_jsx("div", { className: "flex flex-col gap-9", children: _jsx(InsideScreenFormColumnContext.Provider, { value: true, children: headerRegion }) })), _jsx(FormTitleBlock, { title: title, subtitle: subtitle, titleAction: titleAction, testId: testId, bordered: false, fillHeight: false }), topBanner, _jsx(FormSummaryBox, { summary: summary, testId: testId }), sections] }), showsSectionNav && _jsx(FormSectionNav, { items: sectionNav })] }) })] }), footer] }));
56
57
  }
57
58
  // Pinned footer (fillHeight + stickyActions): the footer is a full-bleed
58
59
  // sibling BELOW the padded shell, so the shell's bottom inset does not float
@@ -8,14 +8,9 @@ import { XIcon } from "lucide-react";
8
8
  import { useTranslation } from "../../index.js";
9
9
  import { SheetTitle } from "../ui/sheet.js";
10
10
  import { Drawer } from "../widgets/drawer.js";
11
- import { useIsNarrowViewport } from "./use-narrow-viewport.js";
12
- const DRAWER_WIDTH_PX = 480;
13
11
  const DRAWER_DIM_PERCENT = 32;
14
- const PANEL_CLASS = "bg-card border-border-strong shadow-[-12px_0_32px_rgb(0_0_0/0.14)]";
12
+ const PANEL_CLASS = "bg-background border-border-strong shadow-[-12px_0_32px_rgb(0_0_0/0.14)]";
15
13
  export function DefaultDrawer({ open, onOpenChange, title, subtitle, children, testId, }) {
16
14
  const t = useTranslation();
17
- // On a phone the panel is a bottom sheet (up to 90% of the height, page visible above it)
18
- // instead of a full-screen takeover.
19
- const narrow = useIsNarrowViewport();
20
- return (_jsxs(Drawer, { open: open, onOpenChange: onOpenChange, testId: testId, variant: "flush", side: narrow ? "bottom" : "right", width: DRAWER_WIDTH_PX, backdrop: { dimPercent: DRAWER_DIM_PERCENT }, showCloseButton: false, panelClassName: narrow ? undefined : PANEL_CLASS, fillBody: true, children: [_jsxs("div", { "data-testid": testId !== undefined ? `${testId}-header` : undefined, className: "flex min-h-14 shrink-0 items-center gap-3 border-b border-border py-2 pr-3 pl-6", children: [_jsxs("div", { className: "flex min-w-0 flex-1 flex-col", children: [_jsx(SheetTitle, { className: "text-base font-semibold", children: title ?? "" }), subtitle !== undefined && (_jsx("p", { "data-testid": testId !== undefined ? `${testId}-subtitle` : undefined, className: "text-sm text-muted-foreground", children: subtitle }))] }), _jsx("button", { type: "button", "aria-label": t("kumiko.dialog.close"), onClick: () => onOpenChange(false), className: "flex size-8 items-center justify-center rounded-md text-foreground-secondary hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-hidden", children: _jsx(XIcon, { className: "size-4" }) })] }), _jsx("div", { "data-testid": testId !== undefined ? `${testId}-body` : undefined, onSubmit: (e) => e.stopPropagation(), className: "flex min-h-0 flex-1 flex-col", children: children })] }));
15
+ return (_jsxs(Drawer, { open: open, onOpenChange: onOpenChange, testId: testId, variant: "flush", side: "right", backdrop: { dimPercent: DRAWER_DIM_PERCENT }, showCloseButton: false, panelClassName: PANEL_CLASS, fillBody: true, children: [_jsxs("div", { "data-testid": testId !== undefined ? `${testId}-header` : undefined, className: "flex min-h-14 shrink-0 items-center gap-3 border-b border-border py-2 pr-3 pl-6", children: [_jsxs("div", { className: "flex min-w-0 flex-1 flex-col", children: [_jsx(SheetTitle, { className: "text-base font-semibold", children: title ?? "" }), subtitle !== undefined && (_jsx("p", { "data-testid": testId !== undefined ? `${testId}-subtitle` : undefined, className: "text-sm text-muted-foreground", children: subtitle }))] }), _jsx("button", { type: "button", "aria-label": t("kumiko.dialog.close"), onClick: () => onOpenChange(false), className: "flex size-8 items-center justify-center rounded-md text-foreground-secondary hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-hidden", children: _jsx(XIcon, { className: "size-4" }) })] }), _jsx("div", { "data-testid": testId !== undefined ? `${testId}-body` : undefined, onSubmit: (e) => e.stopPropagation(), className: "flex min-h-0 flex-1 flex-col", children: children })] }));
21
16
  }
@@ -1,5 +1,5 @@
1
1
  import { type ReactNode } from "react";
2
- import { type DataTableDateRangeFacet, type DataTableFacet } from "../../index.ts";
2
+ import type { DataTableDateRangeFacet, DataTableFacet } from "../../index.ts";
3
3
  import "../react-css-custom-properties.ts";
4
4
  export declare function FacetFilter({ facet, selected, onChange, dense, pill, }: {
5
5
  facet: DataTableFacet;
@@ -1,7 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { ChevronDown } from "lucide-react";
3
3
  import { Fragment } from "react";
4
- import { useOptionalTranslation, } from "../../index.js";
5
4
  import { cn } from "../lib/cn.js";
6
5
  import { Badge } from "../ui/badge.js";
7
6
  import { Button as UiButton } from "../ui/button.js";
@@ -35,7 +34,7 @@ function FacetSelect({ facet, selected, onChange, dense, pill, }) {
35
34
  // A stale URL can name an entry the facet does not offer; showing "all" then would misstate the list.
36
35
  const active = chips.find((chip) => sameValueSet(selected, chip.values)) ??
37
36
  (isFiltered ? undefined : chips[0]);
38
- return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(UiButton, { variant: "outline", size: "sm", className: cn("h-9", dense && "border-border-strong px-2.5", pill && FACET_PILL_CLASSES, isFiltered && "border-primary"), "data-testid": `facet-${facet.field}`, children: [_jsx("span", { className: "text-muted-foreground", children: active === undefined ? facet.label : `${facet.label}: ` }), active !== undefined && (_jsx("span", { "data-testid": `facet-${facet.field}-value`, className: isFiltered ? "font-medium text-primary" : "text-foreground", children: active.label })), _jsx(ChevronDown, { className: "text-muted-foreground" })] }) }), _jsx(DropdownMenuContent, { align: "start", className: "max-h-[var(--radix-dropdown-menu-content-available-height)] w-56 overflow-y-auto", children: _jsx(DropdownMenuRadioGroup, { value: active?.id ?? "", onValueChange: (id) => {
37
+ return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(UiButton, { variant: "outline", size: "sm", className: cn("h-9", dense && "border-border-strong px-2.5", pill && FACET_PILL_CLASSES, isFiltered && "border-primary"), "data-testid": `facet-${facet.field}`, children: [_jsx("span", { className: "text-muted-foreground", children: active === undefined || !isFiltered ? facet.label : `${facet.label}: ` }), active !== undefined && isFiltered && (_jsx("span", { "data-testid": `facet-${facet.field}-value`, className: isFiltered ? "font-medium text-primary" : "text-foreground", children: active.label })), _jsx(ChevronDown, { className: "text-muted-foreground" })] }) }), _jsx(DropdownMenuContent, { align: "start", className: "max-h-[var(--radix-dropdown-menu-content-available-height)] w-56 overflow-y-auto", children: _jsx(DropdownMenuRadioGroup, { value: active?.id ?? "", onValueChange: (id) => {
39
38
  if (id === active?.id)
40
39
  return;
41
40
  const chip = chips.find((candidate) => candidate.id === id);
@@ -46,8 +45,6 @@ function FacetSelect({ facet, selected, onChange, dense, pill, }) {
46
45
  // Faceted filter dropdown: outline button (like shadcn's "Columns" toggle) +
47
46
  // multi-select checkboxes. Active selection -> count badge on the button.
48
47
  export function FacetFilter({ facet, selected, onChange, dense = false, pill = false, }) {
49
- const translate = useOptionalTranslation();
50
- const allLabel = translate?.("kumiko.list.filter.all") ?? "All";
51
48
  const toggle = (value, checked) => {
52
49
  const next = checked ? [...selected, value] : selected.filter((v) => v !== value);
53
50
  onChange(facet.field, next);
@@ -61,7 +58,7 @@ export function FacetFilter({ facet, selected, onChange, dense = false, pill = f
61
58
  if (facet.onSearchChange !== undefined) {
62
59
  return (_jsx(FacetSearchFilter, { facet: facet, onSearchChange: facet.onSearchChange, selected: selected, onChange: onChange, dense: dense, pill: pill }));
63
60
  }
64
- return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(UiButton, { variant: "outline", size: "sm", className: cn("h-9", dense && "border-border-strong px-2.5", pill && FACET_PILL_CLASSES), "data-testid": `facet-${facet.field}`, children: [selected.length === 0 ? (_jsx(FacetTriggerLabel, { field: facet.field, label: facet.label, emptyValueLabel: allLabel, showEmptyValue: !pill })) : (facet.label), selected.length > 0 && (_jsx(Badge, { variant: "secondary", className: "ml-1 rounded-sm px-1 font-normal tabular-nums", children: selected.length })), _jsx(ChevronDown, { className: "text-muted-foreground" })] }) }), _jsx(DropdownMenuContent, { align: "start", className: "max-h-[var(--radix-dropdown-menu-content-available-height)] w-44 overflow-y-auto", children: facet.options.map((opt) => (_jsx(DropdownMenuCheckboxItem, { checked: selected.includes(opt.value), onCheckedChange: (checked) => toggle(opt.value, checked), onSelect: (e) => e.preventDefault(), "data-testid": `facet-${facet.field}-${opt.value}`, children: opt.label }, opt.value))) })] }));
61
+ return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(UiButton, { variant: "outline", size: "sm", className: cn("h-9", dense && "border-border-strong px-2.5", pill && FACET_PILL_CLASSES), "data-testid": `facet-${facet.field}`, children: [selected.length === 0 ? _jsx(FacetTriggerLabel, { label: facet.label }) : facet.label, selected.length > 0 && (_jsx(Badge, { variant: "secondary", className: "ml-1 rounded-sm px-1 font-normal tabular-nums", children: selected.length })), _jsx(ChevronDown, { className: "text-muted-foreground" })] }) }), _jsx(DropdownMenuContent, { align: "start", className: "max-h-[var(--radix-dropdown-menu-content-available-height)] w-44 overflow-y-auto", children: facet.options.map((opt) => (_jsx(DropdownMenuCheckboxItem, { checked: selected.includes(opt.value), onCheckedChange: (checked) => toggle(opt.value, checked), onSelect: (e) => e.preventDefault(), "data-testid": `facet-${facet.field}-${opt.value}`, children: opt.label }, opt.value))) })] }));
65
62
  }
66
63
  // Time-range filter: two native <input type="date"> instead of a
67
64
  // dropdown — the browser supplies the calendar, the locale and the keyboard
@@ -26,7 +26,7 @@ export function FacetSearchFilter({ facet, onSearchChange, selected, onChange, d
26
26
  const toggle = (value) => {
27
27
  onChange(facet.field, selected.includes(value) ? selected.filter((v) => v !== value) : [...selected, value]);
28
28
  };
29
- return (_jsxs(PopoverPrimitive.Root, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverPrimitive.Trigger, { asChild: true, children: _jsxs(UiButton, { variant: "outline", size: "sm", className: cn("h-9", dense && "border-border-strong px-2.5", pill && FACET_PILL_CLASSES), "data-testid": `facet-${facet.field}`, children: [selected.length === 0 ? (_jsx(FacetTriggerLabel, { field: facet.field, label: facet.label, emptyValueLabel: t("kumiko.list.filter.all"), showEmptyValue: !pill })) : (facet.label), selected.length > 0 && (_jsx(Badge, { variant: "secondary", className: "ml-1 rounded-sm px-1 font-normal tabular-nums", children: selected.length })), _jsx(ChevronDown, { className: "text-muted-foreground" })] }) }), _jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Content, { align: "start", sideOffset: 4, className: "z-50 w-64 rounded-md border bg-popover p-0 text-popover-foreground shadow-md outline-none", children: _jsxs(Command, { shouldFilter: false, children: [_jsxs("div", { className: "relative", children: [_jsx(Command.Input, { value: searchTerm, onValueChange: setSearchTerm, placeholder: t("kumiko.combobox.search-placeholder"), "data-testid": `facet-${facet.field}-search`, className: "flex h-9 w-full border-0 border-b border-border bg-transparent px-3 py-1 text-sm outline-none placeholder:text-muted-foreground" }), facet.searching === true && (_jsx(Loader2, { className: "absolute right-2 top-2.5 h-4 w-4 animate-spin text-muted-foreground" }))] }), _jsxs(Command.List, { className: "max-h-64 overflow-y-auto p-1", children: [_jsx(Command.Empty, { className: "py-3 text-center text-sm text-muted-foreground", children: facet.searching === true
29
+ return (_jsxs(PopoverPrimitive.Root, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverPrimitive.Trigger, { asChild: true, children: _jsxs(UiButton, { variant: "outline", size: "sm", className: cn("h-9", dense && "border-border-strong px-2.5", pill && FACET_PILL_CLASSES), "data-testid": `facet-${facet.field}`, children: [selected.length === 0 ? _jsx(FacetTriggerLabel, { label: facet.label }) : facet.label, selected.length > 0 && (_jsx(Badge, { variant: "secondary", className: "ml-1 rounded-sm px-1 font-normal tabular-nums", children: selected.length })), _jsx(ChevronDown, { className: "text-muted-foreground" })] }) }), _jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Content, { align: "start", sideOffset: 4, className: "z-50 w-64 rounded-md border bg-popover p-0 text-popover-foreground shadow-md outline-none", children: _jsxs(Command, { shouldFilter: false, children: [_jsxs("div", { className: "relative", children: [_jsx(Command.Input, { value: searchTerm, onValueChange: setSearchTerm, placeholder: t("kumiko.combobox.search-placeholder"), "data-testid": `facet-${facet.field}-search`, className: "flex h-9 w-full border-0 border-b border-border bg-transparent px-3 py-1 text-sm outline-none placeholder:text-muted-foreground" }), facet.searching === true && (_jsx(Loader2, { className: "absolute right-2 top-2.5 h-4 w-4 animate-spin text-muted-foreground" }))] }), _jsxs(Command.List, { className: "max-h-64 overflow-y-auto p-1", children: [_jsx(Command.Empty, { className: "py-3 text-center text-sm text-muted-foreground", children: facet.searching === true
30
30
  ? t("kumiko.combobox.loading")
31
31
  : t("kumiko.combobox.empty") }), facet.options.map((opt) => (_jsxs(Command.Item, { value: opt.value, onSelect: () => toggle(opt.value), "data-testid": `facet-${facet.field}-${opt.value}`, className: "relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground", children: [selected.includes(opt.value) && (_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(Check, { className: "h-4 w-4" }) })), opt.label] }, opt.value)))] })] }) }) })] }));
32
32
  }
@@ -1,8 +1,5 @@
1
1
  import type { ReactNode } from "react";
2
2
  export declare const FACET_PILL_CLASSES = "h-9 rounded-full border-border-strong px-3";
3
- export declare function FacetTriggerLabel({ field, label, emptyValueLabel, showEmptyValue, }: {
4
- readonly field: string;
3
+ export declare function FacetTriggerLabel({ label }: {
5
4
  readonly label: string;
6
- readonly emptyValueLabel: string;
7
- readonly showEmptyValue: boolean;
8
5
  }): ReactNode;
@@ -1,9 +1,6 @@
1
- import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  export const FACET_PILL_CLASSES = "h-9 rounded-full border-border-strong px-3";
3
- // The label keeps its trailing ": " so textContent reads "Label: Value"; the button gap draws the space.
4
- // A pill with nothing chosen names the facet only, like the boards ("Property ▾").
5
- export function FacetTriggerLabel({ field, label, emptyValueLabel, showEmptyValue, }) {
6
- if (!showEmptyValue)
7
- return _jsx("span", { className: "text-muted-foreground", children: label });
8
- return (_jsxs(_Fragment, { children: [_jsx("span", { className: "text-muted-foreground", children: `${label}: ` }), _jsx("span", { "data-testid": `facet-${field}-value`, className: "text-foreground", children: emptyValueLabel })] }));
3
+ // A facet with nothing chosen names itself only, like the boards ("Property ▾").
4
+ export function FacetTriggerLabel({ label }) {
5
+ return _jsx("span", { className: "text-muted-foreground", children: label });
9
6
  }
@@ -39,12 +39,19 @@ export function DefaultField(props) {
39
39
  .join(" ");
40
40
  return (_jsx(FieldLabelledContext.Provider, { value: props.label !== "", children: _jsx(FieldDescriptionContext.Provider, { value: describedBy === "" ? undefined : describedBy, children: _jsx(DefaultFieldBody, { ...props }) }) }));
41
41
  }
42
+ function FieldLabelElement({ id, label, required, layout, hideLabel, hasError, }) {
43
+ const hideRequiredMarker = useContext(HideRequiredMarkerContext);
44
+ return (_jsxs(UiLabel, { id: fieldLabelId(id), htmlFor: id, className: cn("min-w-0 gap-0 text-[13px]", hasError ? "text-destructive" : "text-foreground", hideLabel === true && "sr-only"), children: [_jsx("span", { className: layout === "inline" || layout === "row" ? undefined : "truncate", title: typeof label === "string" ? label : undefined, children: label }), required === true && !hideRequiredMarker && (_jsx("span", { "data-required": true, className: "ml-0.5 shrink-0 text-destructive", children: "*" }))] }));
45
+ }
46
+ function FieldErrors({ id, testId, issues, }) {
47
+ const t = useTranslation();
48
+ return (_jsx("div", { id: fieldErrorId(id), role: "alert", "data-testid": testId !== undefined ? `${testId}-errors` : undefined, className: "order-1 text-xs text-destructive", children: issues.map((issue) => (_jsx("div", { children: fieldIssueText(t, issue) }, `${issue.path}:${issue.code}`))) }));
49
+ }
42
50
  function DefaultFieldBody({ id, label, required, issues, labelAppendix, fieldAppendix, appendixPlacement, description, status, children, layout, accent, hideLabel, testId, changed, }) {
43
51
  const t = useTranslation();
44
- const hideRequiredMarker = useContext(HideRequiredMarkerContext);
45
52
  const hasError = issues !== undefined && issues.length > 0;
46
- const labelEl = (_jsxs(UiLabel, { id: fieldLabelId(id), htmlFor: id, className: cn("min-w-0 gap-0 text-[13px]", hasError ? "text-destructive" : "text-foreground", hideLabel === true && "sr-only"), children: [_jsx("span", { className: layout === "inline" ? undefined : "truncate", title: typeof label === "string" ? label : undefined, children: label }), required === true && !hideRequiredMarker && (_jsx("span", { "data-required": true, className: "ml-0.5 shrink-0 text-destructive", children: "*" }))] }));
47
- const errorsEl = hasError ? (_jsx("div", { id: fieldErrorId(id), role: "alert", "data-testid": testId !== undefined ? `${testId}-errors` : undefined, className: "text-xs text-destructive", children: issues.map((issue) => (_jsx("div", { children: fieldIssueText(t, issue) }, `${issue.path}:${issue.code}`))) })) : null;
53
+ const labelEl = (_jsx(FieldLabelElement, { id: id, label: label, required: required, layout: layout, hideLabel: hideLabel, hasError: hasError }));
54
+ const errorsEl = hasError ? _jsx(FieldErrors, { id: id, testId: testId, issues: issues }) : null;
48
55
  // Inline (boolean/checkbox): Control links, Label rechts — shadcn-Muster.
49
56
  if (layout === "inline") {
50
57
  return (_jsxs("div", { "data-testid": testId, className: "flex flex-col gap-1.5", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(FieldLayoutContext.Provider, { value: "inline", children: children }), labelEl, labelAppendix !== undefined && labelAppendix] }), errorsEl] }));
@@ -55,14 +62,14 @@ function DefaultFieldBody({ id, label, required, issues, labelAppendix, fieldApp
55
62
  // Settings row: label/help/origin on the left, control on the right. The
56
63
  // hairlines between rows come from the list Grid, not from the row itself.
57
64
  if (layout === "row") {
58
- return (_jsxs("div", { "data-testid": testId, className: cn("group/row relative grid gap-x-6 gap-y-2 py-4 @2xl:grid-cols-[minmax(0,3fr)_minmax(0,2fr)] @2xl:grid-rows-[auto_auto_auto_1fr] @2xl:gap-y-0",
65
+ return (_jsxs("div", { "data-testid": testId, className: cn("group/row relative grid gap-x-6 gap-y-2 py-4 @sm:grid-cols-[minmax(0,1fr)_minmax(0,1fr)] @sm:grid-rows-[auto_auto_auto_1fr] @sm:gap-y-0",
59
66
  // Switch rows keep label left / switch right when stacked.
60
- "@max-2xl:has-[[data-slot=switch]]:grid-cols-[minmax(0,1fr)_auto]", accent === true && "@max-2xl:pl-3"), children: [accent === true && (_jsx("span", { "aria-hidden": "true", "data-testid": testId !== undefined ? `${testId}-accent` : undefined, className: "absolute inset-y-3 w-0.5 bg-status-active @max-2xl:left-0 @2xl:-left-4" })), _jsxs("div", { className: "flex min-w-0 items-center gap-2 @2xl:col-start-1 @2xl:row-start-1", children: [labelEl, changedMarker, labelAppendix !== undefined && labelAppendix, statusEl] }), description !== undefined && (_jsx("div", { id: fieldDescriptionId(id), "data-testid": testId !== undefined ? `${testId}-description` : undefined, className: "min-w-0 text-sm text-muted-foreground @2xl:col-start-1 @2xl:row-start-2 @2xl:mt-1 @max-2xl:group-has-[[data-slot=switch]]/row:col-span-2", children: description })), _jsxs("div", { className: "flex min-w-0 flex-col gap-1.5 has-[[data-slot=switch]]:items-end @2xl:col-start-2 @2xl:row-span-4 @2xl:row-start-1 @max-2xl:group-has-[[data-slot=switch]]/row:col-start-2 @max-2xl:group-has-[[data-slot=switch]]/row:row-start-1", children: [_jsx(FieldLayoutContext.Provider, { value: "row", children: children }), errorsEl] }), fieldAppendix !== undefined && (_jsx("div", { className: "min-w-0 @2xl:col-start-1 @2xl:row-start-3 @2xl:mt-1 @max-2xl:group-has-[[data-slot=switch]]/row:col-span-2", children: fieldAppendix }))] }));
67
+ "@max-sm:has-[[data-slot=switch]]:grid-cols-[minmax(0,1fr)_auto]", accent === true && "@max-sm:pl-3"), children: [accent === true && (_jsx("span", { "aria-hidden": "true", "data-testid": testId !== undefined ? `${testId}-accent` : undefined, className: "absolute inset-y-3 w-0.5 bg-status-active @max-sm:left-0 @sm:-left-4" })), _jsxs("div", { className: "flex min-w-0 items-center gap-2 @sm:col-start-1 @sm:row-start-1", children: [labelEl, changedMarker, labelAppendix !== undefined && labelAppendix, statusEl !== null && _jsx("span", { className: "ml-auto", children: statusEl })] }), description !== undefined && (_jsx("div", { id: fieldDescriptionId(id), "data-testid": testId !== undefined ? `${testId}-description` : undefined, className: "min-w-0 text-sm text-muted-foreground @sm:col-start-1 @sm:row-start-2 @sm:mt-1 @max-sm:group-has-[[data-slot=switch]]/row:col-span-2", children: description })), _jsxs("div", { className: "flex min-w-0 flex-col gap-1.5 has-[[data-slot=switch]]:items-end @sm:col-start-2 @sm:row-span-4 @sm:row-start-1 @max-sm:group-has-[[data-slot=switch]]/row:col-start-2 @max-sm:group-has-[[data-slot=switch]]/row:row-start-1", children: [_jsx(FieldLayoutContext.Provider, { value: "row", children: children }), errorsEl] }), fieldAppendix !== undefined && (_jsx("div", { className: "min-w-0 @sm:col-start-1 @sm:row-start-3 @sm:mt-1 @max-sm:group-has-[[data-slot=switch]]/row:col-span-2", children: fieldAppendix }))] }));
61
68
  }
62
69
  return (_jsxs("div", { "data-testid": testId, ...(belowControl && fieldAppendix !== undefined && { "data-appendix-below": "" }), className: "flex flex-col gap-1.5", children: [hideLabel === true &&
63
70
  changedMarker === null &&
64
71
  labelAppendix === undefined &&
65
- statusEl === null ? (labelEl) : (_jsxs("div", { className: "flex items-center justify-between gap-2", children: [changedMarker !== null ? (_jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [labelEl, changedMarker] })) : (labelEl), labelAppendix !== undefined && labelAppendix, statusEl] })), description !== undefined && (_jsx("div", { id: fieldDescriptionId(id), "data-testid": testId !== undefined ? `${testId}-description` : undefined, className: "text-sm text-muted-foreground", children: description })), !belowControl && fieldAppendix !== undefined && fieldAppendix, children, errorsEl, belowControl && fieldAppendix !== undefined && fieldAppendix] }));
72
+ statusEl === null ? (labelEl) : (_jsxs("div", { className: "flex items-center gap-2", children: [changedMarker !== null ? (_jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [labelEl, changedMarker] })) : (labelEl), labelAppendix !== undefined && labelAppendix, statusEl] })), !belowControl && fieldAppendix !== undefined && fieldAppendix, children, description !== undefined && (_jsx("div", { id: fieldDescriptionId(id), "data-testid": testId !== undefined ? `${testId}-description` : undefined, className: "order-1 text-[13px] text-muted-foreground", children: description })), errorsEl, belowControl && fieldAppendix !== undefined && (_jsx("div", { className: "order-1", children: fieldAppendix }))] }));
66
73
  }
67
74
  // ---- Input ----
68
75
  // Field-icon registry: `EditFieldSpec.icon`/`InputProps.icon` sets a
@@ -171,9 +178,9 @@ export function RadioListSelect({ id, name, value, onChange, options, variant =
171
178
  // the box height from the content and makes the `rows` attribute inert.
172
179
  // A declared row count therefore only survives as a min-height floor: the field
173
180
  // starts at `rows` lines tall and still grows with its content. The addend is
174
- // the textarea frame — py-2 top+bottom plus the 1px borders.
181
+ // the textarea frame: py-2 top+bottom plus the 1.5px borders.
175
182
  export function textareaMinHeight(rows) {
176
- return { minHeight: `calc(${rows} * 1lh + 1rem + 2px)` };
183
+ return { minHeight: `calc(${rows} * 1lh + 1rem + 3px)` };
177
184
  }
178
185
  export function withInlineDisabledHint(option) {
179
186
  if (option.disabled !== true || option.description === undefined)
@@ -19,9 +19,9 @@ export function renderNarrowPinnedFooter(model, nodes, keyboardInset) {
19
19
  : undefined, testId: testId, keyboardInset: keyboardInset }));
20
20
  }
21
21
  export function footerRowClassName(model) {
22
- const { pinned, chromeless, fillHeight, railed } = model;
22
+ const { pinned, chromeless, fillHeight } = model;
23
23
  return cn(pinned
24
- ? cn("flex h-14 shrink-0 items-center justify-end gap-2 border-t border-border bg-card px-6", !railed && "md:pl-10")
24
+ ? "flex h-14 shrink-0 items-center justify-end gap-2 border-t border-border bg-card px-6"
25
25
  : "flex flex-col-reverse gap-3 py-3 sm:flex-row sm:items-center sm:justify-between sm:py-4", !pinned && !chromeless && "px-[var(--card-padding)]", !pinned && !chromeless && cardFooterBorder, !pinned && fillHeight === true && "shrink-0");
26
26
  }
27
27
  export function renderUnsavedStatus(model, unsavedCount) {
@@ -0,0 +1,2 @@
1
+ import type { CSSProperties } from "react";
2
+ export declare function inlineSuffixStyle(text: string): CSSProperties;
@@ -0,0 +1,5 @@
1
+ // Places a suffix right behind the typed text of a full-width input. Digits are
2
+ // ~1ch wide with tabular-nums, so the text length approximates its width.
3
+ export function inlineSuffixStyle(text) {
4
+ return { left: `calc(0.75rem + ${text.length}ch + 0.375rem)` };
5
+ }
@@ -1,14 +1,24 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useTranslation } from "../../index.js";
2
3
  import { Checkbox } from "../ui/checkbox.js";
3
4
  import { Switch } from "../ui/switch.js";
4
5
  import { ComboboxInput } from "./combobox.js";
5
- import { RadioListSelect, SegmentedSelect, withInlineDisabledHint, withoutSegmentedSelectPlaceholder, } from "./field.js";
6
+ import { fieldLabelId, RadioListSelect, SegmentedSelect, withInlineDisabledHint, withoutSegmentedSelectPlaceholder, } from "./field.js";
6
7
  import { stateProps } from "./input-optional-props.js";
7
8
  import { resolveSelectPresentation } from "./input-select-presentation.js";
9
+ import { SegmentedControl } from "./segmented-select.js";
8
10
  // layout="inline" (checkbox lists like MultiSelectCheckboxes, the
9
11
  // BooleanField widget) keeps the checkbox optics; the standard form
10
12
  // field (render-field.tsx, layout="stacked") gets the switch.
11
- export const renderBooleanKind = (props, { booleanLayout }) => booleanLayout === "inline" ? (_jsx(Checkbox, { id: props.id, name: props.name, disabled: props.disabled, "aria-required": props.required, "aria-invalid": props.hasError === true ? true : undefined, checked: props.value, onCheckedChange: (checked) => props.onChange(checked === true) })) : (_jsx(Switch, { id: props.id, name: props.name, disabled: props.disabled, "aria-required": props.required, "aria-invalid": props.hasError === true ? true : undefined, checked: props.value, onCheckedChange: (checked) => props.onChange(checked === true), className: "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40" }));
13
+ // A settings row (layout="row") shows the flag as an Off/On segment, not a switch.
14
+ function BooleanSegment(props) {
15
+ const t = useTranslation();
16
+ return (_jsx(SegmentedControl, { id: props.id, name: props.name, value: props.value ? "on" : "off", onChange: (next) => props.onChange(next === "on"), options: [
17
+ { value: "off", label: t("kumiko.config.cascade.off") },
18
+ { value: "on", label: t("kumiko.config.cascade.on") },
19
+ ], disabled: props.disabled, required: props.required, hasError: props.hasError, labelProps: { "aria-labelledby": fieldLabelId(props.id) } }));
20
+ }
21
+ export const renderBooleanKind = (props, { booleanLayout }) => booleanLayout === "row" ? (_jsx(BooleanSegment, { ...props })) : booleanLayout === "inline" ? (_jsx(Checkbox, { id: props.id, name: props.name, disabled: props.disabled, "aria-required": props.required, "aria-invalid": props.hasError === true ? true : undefined, checked: props.value, onCheckedChange: (checked) => props.onChange(checked === true) })) : (_jsx(Switch, { id: props.id, name: props.name, disabled: props.disabled, "aria-required": props.required, "aria-invalid": props.hasError === true ? true : undefined, checked: props.value, onCheckedChange: (checked) => props.onChange(checked === true), className: "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40" }));
12
22
  function normalizeSelectOptions(options) {
13
23
  return options.map((o) => (typeof o === "string" ? { value: o, label: o } : o));
14
24
  }
@@ -9,8 +9,8 @@ export const renderNumberKind = (props) => {
9
9
  // Icon, input and unit share this one box, and the grid cell sizes the
10
10
  // box rather than the bare input: anchored to a wider wrapper, the unit
11
11
  // would sit next to a narrower input instead of inside it.
12
- const numberField = (_jsxs("div", { "data-slot": "number-field", className: "relative", children: [NumberIcon !== undefined && _jsx(NumberIcon, { "aria-hidden": "true", className: FIELD_ICON_CLASS }), _jsx(NumberInput, { id: props.id, name: props.name, value: props.value, onChange: props.onChange, disabled: props.disabled, required: props.required, hasError: props.hasError, testId: props.testId, ...(props.unit !== undefined && { ariaDescribedBy: unitSuffixId(props.id) }), ...(props.locale !== undefined && { locale: props.locale }), ...(props.grouping !== undefined && { grouping: props.grouping }), ...(props.integer !== undefined && { integer: props.integer }), ...(props.placeholder !== undefined && { placeholder: props.placeholder }), className: cn(NumberIcon !== undefined ? "pl-8" : undefined, props.unit !== undefined ? "pr-8" : undefined) }), props.unit !== undefined && (_jsx("span", { id: unitSuffixId(props.id), className: "pointer-events-none absolute right-2.5 top-1/2 max-w-[40%] -translate-y-1/2 truncate text-sm text-muted-foreground", children: props.unit }))] }));
13
- return withInputAddons(props, numberField);
12
+ const numberField = (_jsxs("div", { "data-slot": "number-field", className: "relative", children: [NumberIcon !== undefined && _jsx(NumberIcon, { "aria-hidden": "true", className: FIELD_ICON_CLASS }), _jsx(NumberInput, { id: props.id, name: props.name, value: props.value, onChange: props.onChange, disabled: props.disabled, required: props.required, hasError: props.hasError, testId: props.testId, ...(props.unit !== undefined && { ariaDescribedBy: unitSuffixId(props.id) }), ...(props.locale !== undefined && { locale: props.locale }), ...(props.grouping !== undefined && { grouping: props.grouping }), ...(props.integer !== undefined && { integer: props.integer }), ...(props.suffix !== undefined && { suffix: props.suffix }), ...(props.placeholder !== undefined && { placeholder: props.placeholder }), className: cn(NumberIcon !== undefined ? "pl-8" : undefined, props.unit !== undefined ? "pr-8" : undefined) }), props.unit !== undefined && (_jsx("span", { id: unitSuffixId(props.id), className: "pointer-events-none absolute right-2.5 top-1/2 max-w-[40%] -translate-y-1/2 truncate text-sm text-muted-foreground", children: props.unit }))] }));
13
+ return withInputAddons({ ...props, suffix: undefined }, numberField);
14
14
  };
15
15
  export const renderRangeKind = (props, { common }) => (_jsx("input", { type: "range", ...common, min: props.min, max: props.max, step: props.step ?? 1, value: props.value, onChange: (e) => props.onChange(Number(e.target.value)), className: "w-full accent-primary" }));
16
16
  export const renderMoneyKind = (props) => (_jsx(MoneyInput, { id: props.id, name: props.name, value: props.value, onChange: props.onChange, currency: props.currency ?? "EUR", ...(props.locale !== undefined && { locale: props.locale }), ...stateProps(props) }));
@@ -36,4 +36,4 @@ function textareaShortcutProps({ onKeyDown, onSubmitShortcut }) {
36
36
  },
37
37
  };
38
38
  }
39
- export const renderTextareaKind = (props, { common }) => (_jsx(Textarea, { ...common, ...props.dataAttributes, readOnly: props.readOnly, value: props.value, onChange: (e) => props.onChange(e.target.value), rows: props.rows ?? 4, className: "resize-y", ...(props.placeholder !== undefined && { placeholder: props.placeholder }), ...(props.rows !== undefined && { style: textareaMinHeight(props.rows) }), ...textareaShortcutProps(props) }));
39
+ export const renderTextareaKind = (props, { common }) => (_jsx(Textarea, { ...common, ...props.dataAttributes, readOnly: props.readOnly, value: props.value, onChange: (e) => props.onChange(e.target.value), rows: props.rows ?? 4, className: "resize-y", ...(props.placeholder !== undefined && { placeholder: props.placeholder }), style: textareaMinHeight(props.rows ?? 4), ...textareaShortcutProps(props) }));
@@ -1,11 +1,11 @@
1
1
  import { type MouseEvent, type ReactNode } from "react";
2
2
  import type { FillContainerProps, GridCellProps, GridProps, HeadingProps, LinkProps, ProgressProps, SectionProps, StepBarProps, TextProps, WizardStepGroupProps } from "../../index.ts";
3
3
  import "../react-css-custom-properties.ts";
4
- export declare function DefaultSection({ id, title, subtitle, subtitleBelowLgOnly, children, actions, variant, layout, testId, icon, }: SectionProps): ReactNode;
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, }: GridProps): ReactNode;
7
- export declare function DefaultGridCell({ span, width, children }: GridCellProps): ReactNode;
8
- export declare function DefaultText({ variant, decorative, children, testId, }: TextProps): ReactNode;
6
+ export declare function DefaultGrid({ columns, children, testId, maxRows, flow, list, ariaLabelledBy, tight, facts, }: GridProps): ReactNode;
7
+ export declare function DefaultGridCell({ span, width, hideOnNarrow, children }: GridCellProps): ReactNode;
8
+ export declare function DefaultText({ variant, decorative, concealed, narrow, children, testId, }: TextProps): ReactNode;
9
9
  export declare function isPlainPrimaryClick(event: MouseEvent): boolean;
10
10
  export declare function DefaultLink({ href, variant, target, rel, onPress, className, children, testId, dataAttributes, }: LinkProps): ReactNode;
11
11
  export declare function DefaultProgress({ value, tone, ariaLabel, testId }: ProgressProps): ReactNode;
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Children, useContext } from "react";
3
3
  import { isSafeHref } from "../../headless/index.js";
4
4
  import { Icon } from "../icons.js";
@@ -9,7 +9,28 @@ import { StepBar } from "../widgets/step-bar.js";
9
9
  import "../react-css-custom-properties.js";
10
10
  import { cardSurface } from "./card-styles.js";
11
11
  import { DrawerBodyContext, InsideFormContext, ScreenFormContext } from "./contexts.js";
12
- export function DefaultSection({ id, title, subtitle, subtitleBelowLgOnly, children, actions, variant = "default", layout = "stacked", testId, icon, }) {
12
+ // Desktop boards print the hint under the data, phone boards above it.
13
+ const SECTION_HINT_CLASS = "m-0 mt-3 text-[12.5px] text-muted-foreground max-sm:order-first max-sm:mb-3 max-sm:mt-0";
14
+ function SectionHint({ text, textNarrow, testId }) {
15
+ if (textNarrow !== undefined) {
16
+ return (_jsx("p", { "data-testid": testId, className: SECTION_HINT_CLASS, children: _jsx(NarrowText, { text: text, narrow: textNarrow }) }));
17
+ }
18
+ const end = text.indexOf(". ");
19
+ const first = end === -1 ? text : text.slice(0, end + 1);
20
+ const rest = end === -1 ? "" : text.slice(end + 1);
21
+ return (_jsxs("p", { "data-testid": testId, className: SECTION_HINT_CLASS, children: [_jsx("strong", { className: "font-semibold", children: first }), rest] }));
22
+ }
23
+ // The flex column lets the phone hint jump above the content via `order-first`.
24
+ function withSectionHint(children, hint) {
25
+ if (hint === undefined)
26
+ return children;
27
+ return (_jsxs("div", { className: "flex flex-col", children: [children, _jsx(SectionHint, { ...hint })] }));
28
+ }
29
+ function NarrowText({ text, narrow }) {
30
+ return (_jsxs(_Fragment, { children: [_jsx("span", { className: "max-sm:hidden", children: text }), _jsx("span", { className: "sm:hidden", children: narrow })] }));
31
+ }
32
+ export function DefaultSection({ id, title, subtitle, subtitleBelowLgOnly, children, actions, variant = "default", layout = "stacked", titleStyle = "heading", hint, testId, icon, }) {
33
+ const labelTitle = titleStyle === "label";
13
34
  const insideForm = useContext(InsideFormContext);
14
35
  const insideScreenForm = useContext(ScreenFormContext);
15
36
  // h3 instead of CardTitle (= div): keeps the heading semantics for
@@ -21,7 +42,9 @@ export function DefaultSection({ id, title, subtitle, subtitleBelowLgOnly, child
21
42
  // footer — a title-less section still draws the row when actions are
22
43
  // present, so a hideTitle tabs-Section with `actions` isn't stranded.
23
44
  const TitleTag = insideScreenForm ? "h2" : "h3";
24
- const titleBlock = title !== undefined || subtitle !== undefined ? (_jsxs("div", { className: "flex min-w-48 flex-1 flex-col gap-1", children: [title !== undefined && (_jsxs(TitleTag, { "data-testid": testId !== undefined ? `${testId}-title` : undefined, className: "flex items-center gap-2 text-base font-semibold leading-none tracking-tight", children: [icon !== undefined && _jsx(Icon, { name: icon, className: "size-4 text-muted-foreground" }), title] })), subtitle !== undefined && (_jsx("div", { "data-testid": testId !== undefined ? `${testId}-subtitle` : undefined, className: cn("text-sm text-muted-foreground", insideScreenForm && "text-[13px] text-foreground-secondary", subtitleBelowLgOnly === true && "lg:hidden"), children: subtitle }))] })) : null;
45
+ const titleBlock = title !== undefined || subtitle !== undefined ? (_jsxs("div", { className: "flex min-w-48 flex-1 flex-col gap-1", children: [title !== undefined && (_jsxs(TitleTag, { "data-section-title": "", "data-testid": testId !== undefined ? `${testId}-title` : undefined, className: cn("flex items-center gap-2", labelTitle
46
+ ? "text-[12.5px] font-semibold uppercase leading-none tracking-[0.06em] text-muted-foreground"
47
+ : "text-base font-semibold leading-none tracking-tight"), children: [icon !== undefined && _jsx(Icon, { name: icon, className: "size-4 text-muted-foreground" }), title] })), subtitle !== undefined && (_jsx("div", { "data-testid": testId !== undefined ? `${testId}-subtitle` : undefined, className: cn("text-sm text-muted-foreground", insideScreenForm && "text-[13px] text-foreground-secondary", subtitleBelowLgOnly === true && "lg:hidden"), children: subtitle }))] })) : null;
25
48
  const header = titleBlock !== null || actions !== undefined ? (_jsxs("div", { className: "flex flex-wrap items-start justify-between gap-x-4 gap-y-3", children: [titleBlock, actions !== undefined && (_jsx("div", { "data-testid": testId !== undefined ? `${testId}-actions` : undefined, className: "ml-auto flex shrink-0 items-center gap-2", children: actions }))] })) : null;
26
49
  // Inside a form: divider-less section WITHOUT a card surface of its own.
27
50
  // The separator lines BETWEEN sections come from the divide-y wrapper in
@@ -33,8 +56,10 @@ export function DefaultSection({ id, title, subtitle, subtitleBelowLgOnly, child
33
56
  // gap only needs to read as roughly double the gap-4 field row
34
57
  // spacing, not triple it.
35
58
  insideScreenForm
36
- ? "flex scroll-mt-4 flex-col gap-4 [&:not(:first-of-type)]:border-t [&:not(:first-of-type)]:border-border [&:not(:first-of-type)]:pt-7"
37
- : "flex flex-col gap-4 px-6 py-4", variant === "destructive" && "border-l-2 border-destructive/40", layout === "settings-list" && "@container max-w-4xl"), children: [header, children] }));
59
+ ? labelTitle
60
+ ? "flex scroll-mt-4 flex-col gap-2 [&:not(:first-of-type)]:pt-6"
61
+ : "flex scroll-mt-4 flex-col gap-4 [&:not(:first-of-type)]:border-t [&:not(:first-of-type)]:border-border [&:not(:first-of-type)]:pt-7"
62
+ : "flex flex-col gap-4 px-6 py-4", variant === "destructive" && "border-l-2 border-destructive/40", layout === "settings-list" && "@container max-w-[944px]"), children: [header, withSectionHint(children, hint)] }));
38
63
  }
39
64
  // Standalone: own card, header flows into the body (no divider).
40
65
  // overflow-hidden clips the card's own corner radius correctly for
@@ -43,7 +68,7 @@ export function DefaultSection({ id, title, subtitle, subtitleBelowLgOnly, child
43
68
  // directly into `children`) WOULD get silently clipped — verify this
44
69
  // against any new standalone-section content that renders its own
45
70
  // non-portaled overlay.
46
- return (_jsx("div", { "data-slot": "card", "data-testid": testId, className: cn(cardSurface(), "overflow-hidden", variant === "destructive" && "border-destructive/40"), children: _jsxs("div", { className: "flex flex-col gap-4 px-6 py-6", children: [header, children] }) }));
71
+ return (_jsx("div", { "data-slot": "card", "data-testid": testId, className: cn(cardSurface(), "overflow-hidden", variant === "destructive" && "border-destructive/40"), children: _jsxs("div", { className: "flex flex-col gap-4 px-6 py-6", children: [header, withSectionHint(children, hint)] }) }));
47
72
  }
48
73
  export function DefaultFillContainer({ children, testId, grow, className, }) {
49
74
  // flex-1 only on request (`grow`, set under fillScreenHeight): without it the
@@ -52,7 +77,7 @@ export function DefaultFillContainer({ children, testId, grow, className, }) {
52
77
  return (_jsx("div", { "data-testid": testId, className: cn("flex min-h-0 flex-col", grow === true && "flex-1", className), children: children }));
53
78
  }
54
79
  const DRAWER_FIELD_CELL_WIDTH_CLASS = {
55
- money: "w-full sm:w-[200px] [&_label]:whitespace-nowrap",
80
+ money: "w-full [&_label]:whitespace-nowrap",
56
81
  select: "w-full",
57
82
  };
58
83
  const FIELD_CELL_WIDTH_CLASS = {
@@ -67,7 +92,7 @@ const FIELD_CELL_WIDTH_CLASS = {
67
92
  // switch (1.15rem) gets (h-9 input − switch) / 2 margin to sit on the input line.
68
93
  toggle: "w-auto min-w-40 shrink-0 self-start [&_[data-slot=switch]]:my-[0.55rem]",
69
94
  };
70
- export function DefaultGrid({ columns, children, testId, maxRows, flow, list, ariaLabelledBy, tight, }) {
95
+ export function DefaultGrid({ columns, children, testId, maxRows, flow, list, ariaLabelledBy, tight, facts, }) {
71
96
  const insideDrawerBody = useContext(DrawerBodyContext);
72
97
  const groupProps = ariaLabelledBy !== undefined
73
98
  ? { role: "group", "aria-labelledby": ariaLabelledBy }
@@ -75,6 +100,13 @@ export function DefaultGrid({ columns, children, testId, maxRows, flow, list, ar
75
100
  if (list === true) {
76
101
  return (_jsx("div", { ...groupProps, "data-testid": testId, className: "flex flex-col divide-y divide-border", children: children }));
77
102
  }
103
+ if (facts === true && typeof columns === "number") {
104
+ const factStyle = {
105
+ "--grid-cols": `repeat(${columns}, minmax(0, 1fr))`,
106
+ "--grid-cols-narrow": `repeat(${Math.min(columns, 2)}, minmax(0, 1fr))`,
107
+ };
108
+ return (_jsx("div", { ...groupProps, "data-testid": testId, "data-facts": "", className: "grid gap-x-6 gap-y-3 [grid-template-columns:var(--grid-cols-narrow)] sm:[grid-template-columns:var(--grid-cols)] [&_label]:text-[12.5px] [&_label]:font-normal [&_label]:text-muted-foreground [&_[data-testid^=field-value-]]:text-sm [&_[data-testid^=field-value-]:not([data-concealed])]:font-medium [&_[data-testid^=field-value-]:not([data-concealed])]:text-foreground", style: factStyle, children: children }));
109
+ }
78
110
  if (flow === true) {
79
111
  return (_jsx("div", { ...groupProps, "data-testid": testId, className: cn("flex gap-4", insideDrawerBody
80
112
  ? "flex-col items-start"
@@ -118,10 +150,10 @@ export function DefaultGrid({ columns, children, testId, maxRows, flow, list, ar
118
150
  };
119
151
  return (_jsx("div", { ...groupProps, "data-testid": testId, className: "grid gap-[var(--kumiko-grid-gap,1rem)] grid-cols-1 sm:[grid-template-columns:var(--grid-cols)]", style: style, children: children }));
120
152
  }
121
- export function DefaultGridCell({ span, width, children }) {
153
+ export function DefaultGridCell({ span, width, hideOnNarrow, children }) {
122
154
  const insideDrawerBody = useContext(DrawerBodyContext);
123
155
  if (width !== undefined) {
124
- return (_jsx("div", { className: cn("min-w-0 max-w-full", width === "full" && "sm:[grid-column:1/-1]", insideDrawerBody
156
+ return (_jsx("div", { className: cn("min-w-0 max-w-full", hideOnNarrow === true && "max-sm:hidden", width === "full" && "sm:[grid-column:1/-1]", insideDrawerBody
125
157
  ? (DRAWER_FIELD_CELL_WIDTH_CLASS[width] ?? FIELD_CELL_WIDTH_CLASS[width])
126
158
  : FIELD_CELL_WIDTH_CLASS[width]), children: children }));
127
159
  }
@@ -129,9 +161,14 @@ export function DefaultGridCell({ span, width, children }) {
129
161
  // Below `sm` the grid has one explicit column (see DefaultGrid); an unconditional
130
162
  // `span N` there would add implicit auto columns that squeeze the fr column.
131
163
  const style = { "--grid-span": s };
132
- return (_jsx("div", { className: "min-w-0 sm:[grid-column:span_var(--grid-span)]", style: style, children: children }));
164
+ return (_jsx("div", { className: cn("min-w-0 sm:[grid-column:span_var(--grid-span)]", hideOnNarrow === true && "max-sm:hidden"), style: style, children: children }));
133
165
  }
134
- export function DefaultText({ variant = "body", decorative, children, testId, }) {
166
+ export function DefaultText({ variant = "body", decorative, concealed, narrow, children, testId, }) {
167
+ if (narrow !== undefined)
168
+ return _jsx(NarrowText, { text: children, narrow: narrow });
169
+ if (concealed === true) {
170
+ return (_jsxs("span", { "data-testid": testId, "data-concealed": "", className: "inline-flex items-center gap-1.5 text-muted-foreground", children: [_jsx(Icon, { name: "lock", className: "size-3.5 shrink-0" }), children] }));
171
+ }
135
172
  switch (variant) {
136
173
  case "code":
137
174
  return (_jsx("code", { "data-testid": testId, className: "relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm", children: children }));
@@ -3,7 +3,7 @@ import type { FormWidth } from "../../index.ts";
3
3
  export type ScreenWidth = FormWidth;
4
4
  export declare const screenWidthClassName: Record<ScreenWidth, string>;
5
5
  export declare const screenFormColumnWidthClassName: Record<ScreenWidth, string>;
6
- export declare const screenPaddingClassName = "px-4 pb-6 pt-5 md:px-10 md:pb-10 md:pt-7";
6
+ export declare const screenPaddingClassName = "px-4 pb-6 pt-5 md:px-6 md:pb-10 md:pt-7";
7
7
  export declare const screenDockedBottomClassName = "sticky -bottom-6 -mb-6 mt-auto bg-card pb-6 md:-bottom-10 md:-mb-10 md:pb-10";
8
8
  declare const STACK_GAP: {
9
9
  readonly sm: "gap-2";
@@ -20,7 +20,7 @@ export const screenFormColumnWidthClassName = {
20
20
  // is the one the settings screens use, so a list, a dashboard and a form start
21
21
  // at the same edge. The bottom inset keeps the last field or table row off the
22
22
  // viewport edge.
23
- export const screenPaddingClassName = "px-4 pb-6 pt-5 md:px-10 md:pb-10 md:pt-7";
23
+ export const screenPaddingClassName = "px-4 pb-6 pt-5 md:px-6 md:pb-10 md:pt-7";
24
24
  // Sticky element at the bottom of a screen scroll that covers the bottom padding of
25
25
  // screenPaddingClassName (sticky stops at the content box) and overlaps it at rest (negative margin).
26
26
  // Keep offsets, margin and padding in step with it; bg-card is the surface of the main content area.
@@ -21,20 +21,19 @@ export function DefaultMetricBand({ lead, subtitle, children, testId, tiles, })
21
21
  // Below sm the narrow sub line replaces the regular one (board phone metrics are shorter).
22
22
  function useMetricSub({ sub, narrowSub }) {
23
23
  const narrow = useIsBelowSmViewport();
24
- return narrow && narrowSub !== undefined ? narrowSub : sub;
24
+ const beside = narrow && narrowSub !== undefined;
25
+ return { sub: beside ? narrowSub : sub, beside };
25
26
  }
26
27
  function MetricTile(props) {
27
28
  const { label, value, testId, onPress, tone, icon } = props;
28
- const sub = useMetricSub(props);
29
- const narrow = useIsBelowSmViewport();
30
29
  // The phone's short sub line ("of 2,850") stands beside the value like the board; the full one sits below.
31
- const subBeside = narrow && props.narrowSub !== undefined;
30
+ const { sub, beside: subBeside } = useMetricSub(props);
32
31
  const card = (_jsx(StatCard, { label: label, value: value, boardPadding: true, ...(sub !== undefined && { sub, subBelow: !subBeside }), ...(onPress !== undefined && { navigable: true }), ...(icon !== undefined && { icon: _jsx(Icon, { name: icon, className: "size-4" }) }), ...(tone !== undefined && { tone }), ...(testId !== undefined && { testId }) }));
33
32
  return onPress !== undefined ? (_jsx("button", { type: "button", className: "text-left", onClick: onPress, children: card })) : (card);
34
33
  }
35
34
  export function DefaultMetric(props) {
36
35
  const insideBand = useContext(InsideMetricBandContext);
37
- const sub = useMetricSub(props);
36
+ const { sub } = useMetricSub(props);
38
37
  if (props.tile === true)
39
38
  return _jsx(MetricTile, { ...props });
40
39
  const { label, value, testId, onPress } = props;
@@ -11,6 +11,7 @@ import { useLayoutEffect, useMemo, useRef, useState } from "react";
11
11
  import { resolveSafeLocale } from "../../headless/format/safe-locale.js";
12
12
  import { currencyDecimals, formatMoney as formatMoneyForLocale } from "../../headless/index.js";
13
13
  import { cn } from "../lib/cn.js";
14
+ import { inlineSuffixStyle } from "./inline-suffix.js";
14
15
  import { parseLocaleNumber } from "./locale-number.js";
15
16
  // Re-exported for backward compat — callers used to import this from here
16
17
  // before it moved to headless (shared with RenderField).
@@ -18,13 +19,10 @@ export { currencyDecimals, parseLocaleNumber };
18
19
  // The border and focus ring live on the wrapper so the currency symbol can be
19
20
  // a flex sibling of the input: a symbol of any width ("€", "CHF", "R$") takes
20
21
  // its own space instead of overlapping the digits.
21
- const wrapperClass = "flex h-9 w-full items-center rounded-md border border-input bg-transparent text-sm shadow-sm " +
22
+ const wrapperClass = "flex min-h-[38px] w-full items-center rounded-[7px] border-[1.5px] border-input bg-transparent text-sm shadow-sm " +
22
23
  "transition-colors focus-within:ring-1 focus-within:ring-ring";
23
24
  const inputClass = "h-full min-w-0 flex-1 bg-transparent px-3 placeholder:text-muted-foreground " +
24
- "focus-visible:outline-none disabled:cursor-not-allowed " +
25
- // Right-aligns the value like a native type=number input so amounts align at the thousands
26
- // separators in list columns.
27
- "text-right tabular-nums";
25
+ "focus-visible:outline-none disabled:cursor-not-allowed text-left tabular-nums";
28
26
  export function MoneyInput({ id, name, value, onChange, currency, locale, disabled, required, hasError, ariaLabel, }) {
29
27
  const decimals = currencyDecimals(currency);
30
28
  const factor = 10 ** decimals;
@@ -75,8 +73,11 @@ export function MoneyInput({ id, name, value, onChange, currency, locale, disabl
75
73
  return;
76
74
  onChange(Math.round(parsed * factor));
77
75
  };
78
- const symbolEl = symbol !== "" ? (_jsx("span", { id: `${id}-currency`, "data-testid": `${id}-currency`, className: cn("shrink-0 select-none text-muted-foreground", symbolPosition === "prefix" ? "pl-3" : "pr-3"), children: symbol })) : null;
79
- return (_jsxs("div", { className: cn(wrapperClass, hasError === true && "border-destructive focus-within:ring-destructive", disabled === true && "cursor-not-allowed opacity-50"), children: [symbolPosition === "prefix" && symbolEl, _jsx("input", { ref: inputRef, id: id, name: name, type: "text", inputMode: "decimal", autoComplete: "off", disabled: disabled, "aria-required": required, "aria-invalid": hasError === true ? true : undefined, "aria-label": ariaLabel, "aria-describedby": symbol !== "" ? `${id}-currency` : undefined, value: focused ? draft : formatted, onFocus: handleFocus, onBlur: handleBlur, onChange: (e) => setDraft(e.target.value), className: cn(inputClass, symbolPosition === "prefix" ? "pl-2" : "pr-2") }), symbolPosition === "suffix" && symbolEl] }));
76
+ const shownText = focused ? draft : formatted;
77
+ const symbolEl = symbol !== "" ? (_jsx("span", { id: `${id}-currency`, "data-testid": `${id}-currency`, ...(symbolPosition === "suffix" && { style: inlineSuffixStyle(shownText) }), className: cn("select-none text-muted-foreground", symbolPosition === "prefix"
78
+ ? "shrink-0 pl-3"
79
+ : "pointer-events-none absolute top-1/2 -translate-y-1/2"), children: symbol })) : null;
80
+ return (_jsxs("div", { className: cn(wrapperClass, "relative", hasError === true && "border-destructive focus-within:ring-destructive", disabled === true && "cursor-not-allowed opacity-50"), children: [symbolPosition === "prefix" && symbolEl, _jsx("input", { ref: inputRef, id: id, name: name, type: "text", inputMode: "decimal", autoComplete: "off", disabled: disabled, "aria-required": required, "aria-invalid": hasError === true ? true : undefined, "aria-label": ariaLabel, "aria-describedby": symbol !== "" ? `${id}-currency` : undefined, value: shownText, onFocus: handleFocus, onBlur: handleBlur, onChange: (e) => setDraft(e.target.value), className: cn(inputClass, symbolPosition === "prefix" ? "pl-2" : "pr-8") }), symbolPosition === "suffix" && symbolEl] }));
80
81
  }
81
82
  // Shared with defaultCellRender (index.tsx) so both formatting paths stay
82
83
  // identical. Resolves the browser locale here; headless stays navigator-free.