@mistriwork/kit 1.0.0-rc.58 → 1.0.0-rc.59

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 (158) hide show
  1. package/dist/client/app.js +14 -2
  2. package/dist/client/audience.d.ts +1 -0
  3. package/dist/client/audience.js +10 -0
  4. package/dist/client/brandLook.css +49 -1
  5. package/dist/client/components/AppColumnMenuPopups.js +41 -11
  6. package/dist/client/components/AppList.d.ts +3 -1
  7. package/dist/client/components/AppList.js +77 -15
  8. package/dist/client/components/CardsList.js +14 -1
  9. package/dist/client/components/Chart.css +4 -0
  10. package/dist/client/components/Chart.d.ts +4 -4
  11. package/dist/client/components/Chart.js +30 -9
  12. package/dist/client/components/Content.js +3 -1
  13. package/dist/client/components/DateField.css +1 -1
  14. package/dist/client/components/DateField.js +1 -0
  15. package/dist/client/components/DefinedFields.js +2 -2
  16. package/dist/client/components/Diagram.css +82 -0
  17. package/dist/client/components/Diagram.d.ts +1 -0
  18. package/dist/client/components/Diagram.js +1 -0
  19. package/dist/client/components/Dressed.js +1 -1
  20. package/dist/client/components/Editable.js +7 -3
  21. package/dist/client/components/Export.js +1 -1
  22. package/dist/client/components/FilterBoxes.js +2 -2
  23. package/dist/client/components/FilterRail.css +1 -1
  24. package/dist/client/components/FilterRail.js +6 -4
  25. package/dist/client/components/Gallery.css +171 -0
  26. package/dist/client/components/Gallery.d.ts +1 -0
  27. package/dist/client/components/Gallery.js +1 -0
  28. package/dist/client/components/Grid.d.ts +2 -1
  29. package/dist/client/components/Grid.js +78 -24
  30. package/dist/client/components/GridCellEditor.js +4 -2
  31. package/dist/client/components/GridSelection.d.ts +4 -1
  32. package/dist/client/components/GridSelection.js +20 -3
  33. package/dist/client/components/LandingSurface.css +2 -2
  34. package/dist/client/components/LayoutBuilder.css +225 -0
  35. package/dist/client/components/LayoutBuilder.d.ts +1 -0
  36. package/dist/client/components/LayoutBuilder.js +1 -0
  37. package/dist/client/components/ListColumns.d.ts +12 -0
  38. package/dist/client/components/ListColumns.js +61 -0
  39. package/dist/client/components/ListFilterBar.css +39 -14
  40. package/dist/client/components/ListFilterBar.js +39 -23
  41. package/dist/client/components/MultiStepForm.css +22 -22
  42. package/dist/client/components/NewRecord.js +120 -104
  43. package/dist/client/components/Notes.css +9 -0
  44. package/dist/client/components/Notes.d.ts +6 -2
  45. package/dist/client/components/Notes.js +10 -6
  46. package/dist/client/components/OverflowMenu.js +16 -11
  47. package/dist/client/components/PageFields.js +19 -4
  48. package/dist/client/components/PageRelated.d.ts +8 -1
  49. package/dist/client/components/PageRelated.js +46 -33
  50. package/dist/client/components/PageSections.js +18 -5
  51. package/dist/client/components/Palette.js +1 -1
  52. package/dist/client/components/Prefs.d.ts +10 -0
  53. package/dist/client/components/Prefs.js +33 -23
  54. package/dist/client/components/PresentationSwitch.js +4 -0
  55. package/dist/client/components/Prompt.js +4 -4
  56. package/dist/client/components/RecordGone.js +4 -4
  57. package/dist/client/components/RecordPicker.js +24 -6
  58. package/dist/client/components/RecordSummaries.js +31 -5
  59. package/dist/client/components/RecordTrailNav.js +4 -0
  60. package/dist/client/components/RichTextEditor.css +2 -2
  61. package/dist/client/components/RichTextEditor.js +18 -19
  62. package/dist/client/components/Rooms.js +22 -4
  63. package/dist/client/components/SectionPeriod.css +1 -1
  64. package/dist/client/components/SetFieldDialog.js +1 -1
  65. package/dist/client/components/Sidebar.js +8 -5
  66. package/dist/client/components/SuggestBox.js +2 -2
  67. package/dist/client/components/TableRoom.d.ts +5 -1
  68. package/dist/client/components/TableRoom.js +29 -10
  69. package/dist/client/components/TableView.js +1 -1
  70. package/dist/client/components/ThMenu.js +26 -15
  71. package/dist/client/components/Tour.css +96 -0
  72. package/dist/client/components/Tour.d.ts +1 -0
  73. package/dist/client/components/Tour.js +1 -0
  74. package/dist/client/components/TreePicker.css +1 -1
  75. package/dist/client/components/TreePicker.js +27 -20
  76. package/dist/client/components/Value.js +4 -1
  77. package/dist/client/components/WorkflowStatus.js +8 -4
  78. package/dist/client/components/appListModel.d.ts +4 -0
  79. package/dist/client/components/appRooms.d.ts +2 -0
  80. package/dist/client/components/appRooms.js +2 -0
  81. package/dist/client/components/boardNew.d.ts +5 -0
  82. package/dist/client/components/boardNew.js +5 -0
  83. package/dist/client/components/conditionWords.d.ts +10 -0
  84. package/dist/client/components/conditionWords.js +20 -0
  85. package/dist/client/components/dashboardModel.d.ts +8 -0
  86. package/dist/client/components/dashboardModel.js +28 -1
  87. package/dist/client/components/editInteraction.d.ts +1 -1
  88. package/dist/client/components/editInteraction.js +1 -1
  89. package/dist/client/components/gridSizing.d.ts +14 -20
  90. package/dist/client/components/gridSizing.js +147 -108
  91. package/dist/client/components/pageContext.d.ts +3 -2
  92. package/dist/client/components/pageModel.d.ts +2 -0
  93. package/dist/client/components/pickerStaleness.d.ts +11 -1
  94. package/dist/client/components/pickerStaleness.js +12 -2
  95. package/dist/client/components/rowTitle.d.ts +2 -0
  96. package/dist/client/components/rowTitle.js +10 -0
  97. package/dist/client/components/textMeasure.js +72 -3
  98. package/dist/client/components/useConditionWords.d.ts +5 -0
  99. package/dist/client/components/useConditionWords.js +3 -1
  100. package/dist/client/components/useGridKeyboard.js +5 -0
  101. package/dist/client/components/valueModel.d.ts +1 -0
  102. package/dist/client/components/valueModel.js +39 -4
  103. package/dist/client/composer.css +2 -2
  104. package/dist/client/copy/es.js +3 -3
  105. package/dist/client/copy/filters/components/ListFilterBar.d.ts +1 -0
  106. package/dist/client/copy/filters/components/ListFilterBar.js +1 -0
  107. package/dist/client/copy/forms/components/DateField.d.ts +2 -0
  108. package/dist/client/copy/forms/components/DateField.js +2 -0
  109. package/dist/client/copy/forms/components/NewRecord.d.ts +8 -0
  110. package/dist/client/copy/forms/components/NewRecord.js +2 -0
  111. package/dist/client/copy/lists/components/AppList.d.ts +2 -0
  112. package/dist/client/copy/lists/components/AppList.js +2 -0
  113. package/dist/client/copy/lists/components/GridSelection.d.ts +1 -0
  114. package/dist/client/copy/lists/components/GridSelection.js +1 -0
  115. package/dist/client/copy/lists/components/ListColumns.d.ts +5 -0
  116. package/dist/client/copy/lists/components/ListColumns.js +7 -0
  117. package/dist/client/copy/lists/components/TableRoom.d.ts +3 -1
  118. package/dist/client/copy/lists/components/TableRoom.js +3 -1
  119. package/dist/client/copy/record/components/PageHistory.d.ts +2 -2
  120. package/dist/client/copy/record/components/PageHistory.js +4 -2
  121. package/dist/client/copy/record/components/WorkflowStatus.d.ts +1 -0
  122. package/dist/client/copy/record/components/WorkflowStatus.js +1 -0
  123. package/dist/client/copy/shell/components/MobileNavDrawer.d.ts +1 -0
  124. package/dist/client/copy/shell/components/MobileNavDrawer.js +2 -0
  125. package/dist/client/customThemes.css +3 -3
  126. package/dist/client/dom.js +5 -5
  127. package/dist/client/features.css +216 -356
  128. package/dist/client/fonts/Manrope-OFL.txt +93 -0
  129. package/dist/client/fonts/faces.css +10 -1
  130. package/dist/client/fonts/manrope-latin.woff2 +0 -0
  131. package/dist/client/formControls.css +4 -4
  132. package/dist/client/help.css +2 -2
  133. package/dist/client/ledgerLook.css +28 -0
  134. package/dist/client/locale.d.ts +2 -10
  135. package/dist/client/locale.js +0 -0
  136. package/dist/client/lumenLook.css +295 -105
  137. package/dist/client/manropeFace.css +32 -0
  138. package/dist/client/messages.d.ts +3 -3
  139. package/dist/client/messages.js +3 -3
  140. package/dist/client/page.css +98 -354
  141. package/dist/client/palette.js +31 -6
  142. package/dist/client/partsLook.css +60 -60
  143. package/dist/client/sageLook.css +101 -32
  144. package/dist/client/shellHost.d.ts +2 -2
  145. package/dist/client/shellHost.js +2 -2
  146. package/dist/client/shellMode.d.ts +9 -0
  147. package/dist/client/shellMode.js +2 -0
  148. package/dist/client/structure.css +281 -201
  149. package/dist/client/style.css +75 -224
  150. package/dist/client/themeFamilies.css +471 -66
  151. package/dist/client/tilesLook.css +502 -0
  152. package/dist/client/visualTheme.js +5 -2
  153. package/dist/client/visualThemes.css +38 -34
  154. package/dist/client/workbenchLook.css +12 -12
  155. package/dist/client/workshopLook.css +3 -8
  156. package/dist/vite.d.ts +1 -20
  157. package/dist/vite.js +33 -3
  158. package/package.json +8 -7
@@ -0,0 +1,61 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Which of a list's columns a reader draws: "Columns", at the end of the list's bar, opens them as a checklist, drawn
4
+ * as a filter's picker is (ListFilterBar.tsx). The choice is how they like to read the list, not a question about
5
+ * it: kept in their browser per view, as the layout is (LayoutSwitch.tsx), never in the address, a saved view or the
6
+ * query, so the rows are asked for as they were and another reader sees the list as the App wrote it. The first
7
+ * column is the one a row is known by and always stays.
8
+ */
9
+ import { useCallback, useEffect, useRef, useState } from 'react';
10
+ import { Popover, PopoverContent, PopoverTrigger } from '@ui-sdk/react/popover';
11
+ import { popupContainer, portalRoot } from '../shellHost.js';
12
+ import { say } from '../copy/lists/components/ListColumns.js';
13
+ const KEY = 'mistri.listColumns';
14
+ function kept(view) {
15
+ if (!view)
16
+ return [];
17
+ try {
18
+ const all = JSON.parse(localStorage.getItem(KEY) ?? '{}');
19
+ const hidden = all[view];
20
+ return Array.isArray(hidden) ? hidden.filter((name) => typeof name === 'string') : [];
21
+ }
22
+ catch {
23
+ return [];
24
+ }
25
+ }
26
+ function keep(view, hidden) {
27
+ try {
28
+ const all = JSON.parse(localStorage.getItem(KEY) ?? '{}');
29
+ if (hidden.length)
30
+ all[view] = hidden;
31
+ else
32
+ delete all[view];
33
+ localStorage.setItem(KEY, JSON.stringify(all));
34
+ }
35
+ catch {
36
+ /* A browser that keeps nothing still hides the column; it forgets on the next visit. */
37
+ }
38
+ }
39
+ /** The columns a reader left out of a view, among the ones it offers, and the way to change them. */
40
+ export function useListColumns(view, offered) {
41
+ const [hidden, setHidden] = useState(() => kept(view));
42
+ const change = useCallback((next) => {
43
+ setHidden(next);
44
+ if (view)
45
+ keep(view, next);
46
+ }, [view]);
47
+ // A column the view no longer shows, or its first, is not one a reader can have left out.
48
+ const mayHide = offered.slice(1);
49
+ return [hidden.filter((name) => mayHide.includes(name)), change];
50
+ }
51
+ export function ListColumns({ columns, hidden, onChange, caption, }) {
52
+ const trigger = useRef(null);
53
+ const [open, setOpen] = useState(false);
54
+ const [container, setContainer] = useState(null);
55
+ useEffect(() => {
56
+ setContainer(trigger.current?.closest('dialog, [role="dialog"]'));
57
+ }, []);
58
+ return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsxs(PopoverTrigger, { className: "applist-columns", "data-own": "", ref: trigger, children: [_jsxs("svg", { viewBox: "0 0 16 16", width: "14", height: "14", "aria-hidden": "true", fill: "none", stroke: "currentColor", strokeWidth: "1.4", children: [_jsx("path", { d: "M2 5h6.5M12.5 5H14M2 11h1.5M7.5 11H14" }), _jsx("circle", { cx: "10.5", cy: "5", r: "1.75" }), _jsx("circle", { cx: "5.5", cy: "11", r: "1.75" })] }), say('columns')] }), _jsx(PopoverContent, { className: "filter-pop", "aria-label": say('columnsOf', { caption }), render: (drawn) => _jsx("div", { ...drawn, "aria-labelledby": undefined }), side: "bottom", align: "end", sideOffset: 6, collisionPadding: 8,
59
+ /* Out of the bar, by name, as a filter's picker is: the bar is a form, and Enter in it asks the list. */
60
+ container: container ?? popupContainer() ?? portalRoot(), children: _jsxs("fieldset", { className: "facet", children: [_jsx("legend", { className: "facet-label", children: say('columns') }), hidden.length > 0 && (_jsx("button", { type: "button", className: "facet-clear", onClick: () => onChange([]), children: say('showAll') })), _jsx("ul", { className: "facet-values", children: columns.map((column, at) => (_jsx("li", { children: _jsxs("label", { className: "facet-option", children: [_jsx("input", { type: "checkbox", checked: !hidden.includes(column.name), disabled: at === 0, onChange: (event) => onChange(event.target.checked ? hidden.filter((name) => name !== column.name) : [...hidden, column.name]) }), _jsx("span", { className: "facet-option-label", children: column.label })] }) }, column.name))) })] }) })] }));
61
+ }
@@ -6,7 +6,7 @@
6
6
  the rest are buttons, quiet until they are pressed. */
7
7
  .applist-search { display: inline-flex; flex: 0 1 17rem; min-width: 10rem; }
8
8
  .applist-search-input {
9
- box-sizing: border-box; width: 100%; min-height: 30px; margin: 0; padding: 0 var(--space-3h);
9
+ box-sizing: border-box; width: 100%; min-height: var(--control-h-sm); margin: 0; padding: 0 var(--space-3h);
10
10
  font: var(--text-base) var(--sans); color: var(--ink);
11
11
  background: var(--ground);
12
12
  border: 1px solid var(--line-control); border-radius: var(--radius);
@@ -19,26 +19,49 @@
19
19
  .applist-search-input:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: 1px; }
20
20
 
21
21
  .applist-slot { display: inline-flex; }
22
- /* A filter not yet asked for: its name behind a +, on a dashed hairline that
23
- says "a place for a filter" without being a field. */
22
+ /* A filter not yet asked for: its name before a caret, on a quiet solid edge, as any control that opens a list is.
23
+ A + before it on a dashed edge read as "add a building", or as a place left empty, to people who had not met the
24
+ list. The caret stands in the box the set chip's × takes, so setting a filter adds the value's width alone. */
24
25
  .applist-add {
25
- display: inline-flex; align-items: center; gap: var(--space-2);
26
- box-sizing: border-box; min-height: 30px; margin: 0; padding: 0 var(--space-3h);
26
+ display: inline-flex; align-items: center; gap: 0;
27
+ box-sizing: border-box; min-height: var(--control-h-sm); margin: 0; padding: 0 var(--space-1) 0 var(--space-3h);
27
28
  font: var(--text-sm) var(--sans); color: var(--ink-muted); white-space: nowrap;
28
29
  background: transparent; cursor: pointer;
29
- border: 1px dashed var(--line-strong); border-radius: var(--radius);
30
+ border: 1px solid var(--line-strong); border-radius: var(--pill-radius, 999px);
31
+ }
32
+ .applist-add-mark { min-width: 24px; text-align: center; color: var(--ink-subtle); font-size: var(--text-xs); line-height: 1; }
33
+ /* How many of the filters behind More are set: said on the button, so none narrows the rows unseen. */
34
+ .applist-add-count {
35
+ margin-left: var(--space-2); padding: 0 var(--space-2); border-radius: 999px;
36
+ background: var(--accent-soft, var(--raised)); color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums;
30
37
  }
31
- .applist-add-mark { color: var(--ink-subtle); font-size: var(--text-md); line-height: 1; }
32
38
  .applist-add:hover, .applist-add[aria-expanded="true"] { color: var(--ink); border-color: var(--ink-muted); }
39
+ /* The list's own control at the bar's end (ListColumns.tsx): a mark and a word, no edge until it is pointed at, so it
40
+ reads apart from the filters before it. */
41
+ .applist-columns {
42
+ display: inline-flex; align-items: center; gap: var(--space-2); box-sizing: border-box;
43
+ min-height: var(--control-h-sm); margin: 0; padding: 0 var(--space-3);
44
+ border: 0; border-radius: var(--radius); background: none; cursor: pointer;
45
+ font: 500 var(--text-sm) var(--sans); color: var(--ink-muted); white-space: nowrap;
46
+ }
47
+ .applist-columns[aria-expanded="true"] { background: var(--raised); color: var(--ink); }
48
+ @media (hover: hover) { .applist-columns:hover { background: var(--raised); color: var(--ink); } }
49
+ .applist-columns:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: 1px; }
33
50
  /* The phone's one button for every picker is a control, not a place: a solid hairline. */
34
- .applist-sheet-open { border-style: solid; color: var(--ink); }
51
+ .applist-sheet-open { padding-inline: var(--space-3h); color: var(--ink); }
35
52
  @media (prefers-reduced-motion: no-preference) {
36
53
  .applist-add, .applist-chip-open { transition: color var(--t-hover) var(--ease-out), border-color var(--t-hover) var(--ease-out); }
37
54
  }
38
55
 
39
56
  /* The list's chips, at the height of the row they sit in; a chip's words open its picker. */
40
- .applist-fields .applist-chip { box-sizing: border-box; min-height: 30px; padding: 0 var(--space-1) 0 0; gap: 0; font-size: var(--text-sm); }
57
+ .applist-fields .applist-chip { box-sizing: border-box; min-height: var(--control-h-sm); padding: 0 var(--space-1) 0 0; gap: 0; font-size: var(--text-sm); }
41
58
  .applist-fields .applist-chip > .applist-chip-text { padding: 0 var(--space-2h) 0 var(--space-3h); }
59
+ /* A set filter: the label where the unset one said it, never cut; then what is asked, cut at a cap with the whole
60
+ phrase in the chip's title and name; then a count of the values after the first. */
61
+ .applist-chip-text { gap: var(--space-2); }
62
+ .applist-chip-label { flex: none; color: var(--ink-muted); }
63
+ .applist-chip-value { min-width: 0; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 500; }
64
+ .applist-chip-more { flex: none; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
42
65
  .applist-chip-open {
43
66
  align-self: stretch; display: inline-flex; align-items: center; margin: 0;
44
67
  border: 0; border-radius: var(--radius); background: none; color: inherit; font: inherit; cursor: pointer;
@@ -50,14 +73,16 @@
50
73
  /* On a phone the row's controls are the large size (a Button's 40px), the sort's with them: a thumb's target. */
51
74
  @media (max-width: 600px) {
52
75
  .applist-search { flex: 1 1 10rem; }
53
- .applist-search-input, .applist-sheet-open, .applist-sort .dd-button { min-height: 40px; }
76
+ .applist-search-input, .applist-sheet-open, .applist-sort [data-slot='select-trigger'] { min-height: 40px; }
54
77
  }
55
78
 
56
- /* A picker: one box over the page, hairlines inside. */
79
+ /* A picker: one box over the page, hairlines inside. Its parts pad themselves, so the popover's own padding is none:
80
+ a facet's rule runs edge to edge. */
57
81
  .filter-pop {
58
82
  box-sizing: border-box; width: max-content; min-width: 15rem; max-width: min(22rem, var(--available-width, 22rem));
83
+ padding: 0;
59
84
  background: var(--surface); color: var(--ink);
60
- border: 1px solid var(--line-strong); border-radius: var(--radius);
85
+ border: 1px solid var(--line-strong); border-radius: var(--radius-pop, var(--radius));
61
86
  box-shadow: var(--shadow-pop);
62
87
  }
63
88
  .filter-pop:focus, .filter-pop:focus-visible { outline: none; }
@@ -70,7 +95,7 @@
70
95
  .filter-pop .facet { border-top: 0; padding: var(--space-4) var(--space-4h) var(--space-3h); }
71
96
  .filter-pop .facet-clear { top: 12px; right: 14px; }
72
97
  .filter-pop .facet-values { max-height: min(18rem, 50vh); overflow-y: auto; }
73
- .filter-pop .applist-quick-text { box-sizing: border-box; width: 100%; min-height: 30px; }
98
+ .filter-pop .applist-quick-text { box-sizing: border-box; width: 100%; min-height: var(--control-h-sm); }
74
99
  .filter-pop-foot { display: flex; justify-content: flex-end; padding: var(--space-3h) var(--space-4h) var(--space-4); border-top: 1px solid var(--line); }
75
- .filter-pop-foot .primary { min-height: 30px; }
100
+ .filter-pop-foot .primary { min-height: var(--control-h-sm); }
76
101
  }
@@ -7,11 +7,12 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
7
7
  * Advanced — the heaviest thing above a quiet table, and on a phone more than
8
8
  * half the first screen. So the list's name column keeps one search box, a
9
9
  * real field with the 3:1 edge; every other filter the view declares is a
10
- * quiet "+ Status" that opens, in a popover, the picker the rail draws for it
10
+ * quiet "Status ▾" that opens, in a popover, the picker the rail draws for it
11
11
  * (a checklist, Min/Max, date presets; a reference is the typeahead its box
12
12
  * was); and what is applied is said in the same row as chips, each in its
13
- * filter's place: a chip opens its picker again, its × (or Backspace) takes
14
- * it out, and two or more earn one Clear all. On a phone the pickers are the
13
+ * filter's place and under its filter's label ("Status: Open +1"): a chip
14
+ * opens its picker again, its × (or Backspace) takes it out, and two or more
15
+ * earn one Clear all. On a phone the pickers are the
15
16
  * rail's sheet, behind one Filters button that says how many apply.
16
17
  *
17
18
  * No picker writes a new kind of question. Each hands a condition tail to
@@ -23,11 +24,10 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
23
24
  */
24
25
  import { useEffect, useLayoutEffect, useRef, useState } from 'react';
25
26
  import { Button } from '@mistriwork/ui/Button.js';
26
- import { Popover } from '@base-ui/react/popover';
27
+ import { Popover, PopoverContent, PopoverTrigger } from '@ui-sdk/react/popover';
27
28
  import { WHOLE, canonicalize, conditionTail, mentionsColumn, ownedTails, squeeze, stripCondition, withCondition } from '../filterbar.js';
28
29
  import { formatNumber } from '../locale.js';
29
30
  import { columnKind } from '@mistriwork/engine/shared/schema.js';
30
- import { layoutViewport, zoomAnchor } from '@mistriwork/ui/internal/anchor.js';
31
31
  import { RefBox, boxTail, boxText, wrongForNumber } from './FilterBoxes.js';
32
32
  import { useConditionWords } from './useConditionWords.js';
33
33
  import { useArrived } from './onDemand.js';
@@ -35,7 +35,7 @@ import { SuggestBox } from './suggestPart.js';
35
35
  import { FacetFor, useDraftCount } from './FilterRail.js';
36
36
  import { clearFacets, facetActive } from './filterRailModel.js';
37
37
  import { say } from '../copy/filters/components/ListFilterBar.js';
38
- import { popupContainer } from '../shellHost.js';
38
+ import { popupContainer, portalRoot } from '../shellHost.js';
39
39
  export function ListFilterBar(props) {
40
40
  const { boxes, search, refinement, tabQuery, apply, residue, phone, onSheet } = props;
41
41
  const pickers = boxes.filter((box) => box !== search);
@@ -46,14 +46,16 @@ export function ListFilterBar(props) {
46
46
  lit tab's own conditions stay, as the rail's Clear all leaves them. The
47
47
  focus goes to the row's first control, not the page. */
48
48
  const clearAll = active >= 2 ? (_jsx("button", { type: "button", className: "applist-chips-clear", onClick: () => apply(clearFacets(refinement, columns, tabQuery), search?.column ?? pickers[0]?.column), children: say('list.clearAll') })) : null;
49
- const residueChip = residue ? (_jsxs("span", { className: "applist-chip", children: [_jsx("span", { className: "applist-chip-text", children: residue.text }), _jsx("button", { type: "button", className: "applist-chip-x", "aria-label": say('common.remove2', { text: residue.text }), onClick: residue.remove, children: "\u00D7" })] })) : null;
49
+ const residueChip = residue ? (_jsxs("span", { className: "applist-chip", title: residue.text, children: [_jsx("span", { className: "applist-chip-text", children: residue.text }), _jsx("button", { type: "button", className: "applist-chip-x", "aria-label": say('common.remove2', { text: residue.text }), onClick: residue.remove, children: "\u00D7" })] })) : null;
50
50
  const searchBox = search ? _jsx(SearchBox, { ...props, box: search }) : null;
51
- /* On a desk the row keeps one line: the filters not yet asked for give way
52
- from the end, into one "+ Filter" that opens every picker in the sheet,
53
- rather than the last of them standing cut at the window's edge ("+ Orde…").
54
- A chip never gives way — it says what the rows are. Counted before the
55
- row is painted, so nothing is seen to jump. */
56
- const idle = pickers.filter((box) => !facetActive(refinement, box.column, tabQuery));
51
+ /* On a desk the row keeps one line: the filters give way from the end, into
52
+ one "More filters" that opens every picker in the sheet, rather than the
53
+ last of them standing cut at the window's edge ("Orde…") or the row taking
54
+ a second line and moving the table down. A filter that is set gives way as
55
+ one not yet asked for does, and the button counts the set ones it holds, so
56
+ none narrows the rows unsaid; a filter never changes place, set or not.
57
+ Counted before the row is painted, so nothing is seen to jump. */
58
+ const idle = pickers;
57
59
  const [folded, setFolded] = useState(0);
58
60
  /* A new width is measured afresh even where nothing was folded: the fold
59
61
  below runs after a render, and unfolding nothing renders nothing. */
@@ -79,7 +81,7 @@ export function ListFilterBar(props) {
79
81
  and the one before them. Never more than are needed — the "+ Filter" that folding brings takes room of its own —
80
82
  so a row still too wide folds again on its next render. One a render, it was a render and a measure of the whole
81
83
  row per picker, in every sort, filter and tab (test/built-client-vitals.mjs). */
82
- const slots = [...row.querySelectorAll('.applist-slot[data-column]')];
84
+ const slots = [...row.querySelectorAll(':is(.applist-slot, .applist-chip)[data-column]')].filter((slot) => idle.some((box) => box.column === slot.dataset.column));
83
85
  const end = (node) => (node ? node.offsetLeft + node.offsetWidth : 0);
84
86
  const limit = end(slots.at(-1)) - over;
85
87
  setFolded(folded + 1 + slots.filter((slot) => end(slot.previousSibling) > limit).length);
@@ -117,9 +119,10 @@ export function ListFilterBar(props) {
117
119
  return (_jsxs(_Fragment, { children: [searchBox, pickers.length > 0 && (_jsx("button", { type: "button", className: "applist-add applist-sheet-open", "aria-haspopup": "dialog", onClick: onSheet, children: narrowed ? say('common.filters', { narrowed }) : say('common.filtersButton') })), _jsxs("div", { className: "applist-bar-chips", children: [search && _jsx(FilterSlot, { ...props, box: search, chipOnly: true }), pickers.map((box) => (_jsx(FilterSlot, { ...props, box: box, chipOnly: true }, box.column))), residueChip, clearAll] })] }));
118
120
  }
119
121
  const rest = idle.filter((box) => hidden.has(box.column));
122
+ const heldSet = rest.filter((box) => facetActive(refinement, box.column, tabQuery)).length;
120
123
  return (_jsxs(_Fragment, { children: [_jsx("span", { ref: mark, hidden: true }), searchBox, search && _jsx(FilterSlot, { ...props, box: search }), pickers
121
124
  .filter((box) => !hidden.has(box.column))
122
- .map((box) => (_jsx(FilterSlot, { ...props, box: box }, box.column))), rest.length > 0 && (_jsx("span", { className: "applist-slot applist-slot-more", children: _jsxs("button", { type: "button", className: "applist-add", "aria-haspopup": "dialog", "aria-label": say('moreFilters', { filter: say('common.filter'), map: rest.map((box) => box.label).join(', ') }), onClick: onSheet, children: [_jsx("span", { className: "applist-add-mark", "aria-hidden": "true", children: "+" }), say('common.filter')] }) })), residueChip, clearAll] }));
125
+ .map((box) => (_jsx(FilterSlot, { ...props, box: box }, box.column))), rest.length > 0 && (_jsx("span", { className: "applist-slot applist-slot-more", children: _jsxs("button", { type: "button", className: "applist-add", "aria-haspopup": "dialog", "aria-label": say('moreFilters', { filter: say('moreFiltersButton'), map: rest.map((box) => box.label).join(', ') }), onClick: onSheet, children: [say('moreFiltersButton'), heldSet > 0 && _jsx("span", { className: "applist-add-count", children: heldSet }), _jsx("span", { className: "applist-add-mark", "aria-hidden": "true", children: "\u25BE" })] }) })), residueChip, clearAll] }));
123
126
  }
124
127
  /**
125
128
  * One declared filter in its place in the row: its chip when it narrows the
@@ -133,7 +136,7 @@ function FilterSlot(props) {
133
136
  const tails = owned ? [] : ownedTails(refinement, box.column);
134
137
  /* In the App's words: the label, the rule's word for a value, and a
135
138
  reference by the name its box shows, not the id beneath it. */
136
- const { speaker, sayTails } = useConditionWords(props.table, tails.map((tail) => `${box.column} ${tail}`));
139
+ const { speaker, sayTails, sayChip } = useConditionWords(props.table, tails.map((tail) => `${box.column} ${tail}`));
137
140
  const isSearch = box === search;
138
141
  /* The search's own condition is in its box; a chip only for what the box cannot say. */
139
142
  const chipped = tails.length > 0 && !(isSearch && tails.length === 1 && boxText(box, tails[0]));
@@ -146,12 +149,17 @@ function FilterSlot(props) {
146
149
  e.preventDefault();
147
150
  remove();
148
151
  };
149
- const open = isSearch ? (_jsx("span", { className: "applist-chip-text", children: text })) : phone ? (_jsx("button", { type: "button", className: "applist-chip-text applist-chip-open", "aria-haspopup": "dialog", onClick: onSheet, onKeyDown: onKeyDown, children: text })) : (_jsx(Picker, { ...props, owned: false, className: "applist-chip-text applist-chip-open", onKeyDown: onKeyDown, children: text }));
150
- return (_jsxs("span", { className: "applist-chip", "data-column": box.column, children: [open, _jsx("button", { type: "button", className: "applist-chip-x", "aria-label": say('common.remove2', { text }), onClick: remove, onKeyDown: onKeyDown, children: "\u00D7" })] }));
152
+ /* The label stays where the unset filter said it, then what is asked: the first value and a count of the rest,
153
+ a long one cut at a cap, so setting a filter adds the value's width and moves nothing before it. The whole
154
+ phrase is the chip's name and its title. */
155
+ const { label, value, values } = sayChip(speaker, box.column, tails);
156
+ const words = (_jsxs(_Fragment, { children: [label && _jsx("span", { className: "applist-chip-label", children: value ? `${label}: ` : label }), value && _jsx("span", { className: "applist-chip-value", children: values ? values[0] : value }), values && values.length > 1 && _jsx("span", { className: "applist-chip-more", children: ` +${values.length - 1}` })] }));
157
+ const open = isSearch ? (_jsx("span", { className: "applist-chip-text", children: words })) : phone ? (_jsx("button", { type: "button", className: "applist-chip-text applist-chip-open", "aria-haspopup": "dialog", "aria-label": text, onClick: onSheet, onKeyDown: onKeyDown, children: words })) : (_jsx(Picker, { ...props, owned: false, className: "applist-chip-text applist-chip-open", label: text, onKeyDown: onKeyDown, children: words }));
158
+ return (_jsxs("span", { className: "applist-chip", "data-column": box.column, title: text, children: [open, _jsx("button", { type: "button", className: "applist-chip-x", "aria-label": say('common.remove2', { text }), onClick: remove, onKeyDown: onKeyDown, children: "\u00D7" })] }));
151
159
  }
152
160
  if (chipOnly || isSearch)
153
161
  return null;
154
- const plus = (_jsxs(_Fragment, { children: [_jsx("span", { className: "applist-add-mark", "aria-hidden": "true", children: "+" }), box.label] }));
162
+ const plus = (_jsxs(_Fragment, { children: [box.label, _jsx("span", { className: "applist-add-mark", "aria-hidden": "true", children: "\u25BE" })] }));
155
163
  if (box.kind === 'flag') {
156
164
  return (_jsx("span", { className: "applist-slot", "data-column": box.column, children: _jsx("button", { type: "button", className: "applist-add", "aria-label": say('common.only', { label: box.label }), onClick: () => apply(withCondition(refinement, box.column, box.has?.segment ? WHOLE : '= true'), box.column), children: plus }) }));
157
165
  }
@@ -207,9 +215,10 @@ function SearchBox({ box, table, standing, refinement, typed, onType, onSearch,
207
215
  }, inputProps: inputProps, inputRef: input })) : (_jsx("input", { ref: input, ...inputProps, value: typed ?? said, onChange: (e) => onType(e.target.value) })) }));
208
216
  }
209
217
  /**
210
- * A "+" or a chip, and the popover it opens: anchored on the zoom-aware
211
- * ruler, drawn inside the enclosing dialog when there is one, the focus on
212
- * its first field as it opens and back on its button when Escape closes it.
218
+ * A "+" or a chip, and the popover it opens, over UI SDK's Popover: placed
219
+ * under its button, drawn inside the enclosing dialog when there is one, the
220
+ * focus on its first field as it opens and back on its button when Escape
221
+ * closes it.
213
222
  */
214
223
  function Picker({ className, label, onKeyDown, owned, children, ...props }) {
215
224
  const { box, refinement } = props;
@@ -220,7 +229,14 @@ function Picker({ className, label, onKeyDown, owned, children, ...props }) {
220
229
  useEffect(() => {
221
230
  setContainer(trigger.current?.closest('dialog, [role="dialog"]'));
222
231
  }, []);
223
- return (_jsxs(Popover.Root, { open: open, onOpenChange: setOpen, children: [_jsx(Popover.Trigger, { render: _jsx("button", { type: "button", className: className, "aria-label": label, ref: trigger, onKeyDown: onKeyDown }), children: children }), _jsx(Popover.Portal, { container: container ?? popupContainer(), children: _jsx(Popover.Positioner, { anchor: () => (trigger.current ? zoomAnchor(trigger.current) : null), positionMethod: "fixed", side: "bottom", align: "start", sideOffset: 6, collisionBoundary: layoutViewport(), collisionPadding: 8, style: { zIndex: 40 }, children: _jsx(Popover.Popup, { ref: popup, className: "filter-pop", "aria-label": say('common.filter2', { label: box.label }), "data-column": box.column, initialFocus: () => popup.current?.querySelector('input:not([type="hidden"]):not([aria-hidden="true"])') ?? true, children: _jsx(FilterPicker, { box: box, table: props.table, refinement: refinement, standing: props.standing, unit: props.unitOf(box.column), owned: owned, apply: props.apply, close: () => setOpen(false) }) }) }) })] }));
232
+ return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { className: className, "data-own": "", "aria-label": label, ref: trigger, onKeyDown: onKeyDown, children: children }), _jsx(PopoverContent, { ref: popup, className: "filter-pop", "aria-label": say('common.filter2', { label: box.label }),
233
+ /* Named for the column it filters, not by the chip that opened it, whose words are the filter as it
234
+ stands ("Status is Open or Done"): UI SDK's `aria-labelledby` would outrank the label. */
235
+ render: (drawn) => _jsx("div", { ...drawn, "aria-labelledby": undefined }), "data-column": box.column, side: "bottom", align: "start", sideOffset: 6, collisionPadding: 8,
236
+ /* Out of the bar, by name: the picker is a form and the bar is one, and UI SDK draws a popover where its
237
+ trigger is unless it is told where. A form in a form is not HTML, and its Show sent the page instead of
238
+ the filter. */
239
+ container: container ?? popupContainer() ?? portalRoot(), initialFocus: () => popup.current?.querySelector('input:not([type="hidden"]):not([aria-hidden="true"])'), children: _jsx(FilterPicker, { box: box, table: props.table, refinement: refinement, standing: props.standing, unit: props.unitOf(box.column), owned: owned, apply: props.apply, close: () => setOpen(false) }) })] }));
224
240
  }
225
241
  /** One column's picker: a reference's typeahead, or the rail's facet over a draft. */
226
242
  export function FilterPicker(props) {
@@ -22,8 +22,8 @@
22
22
  /* The title runs a display size, not a record's: at 411px a record title's 21px sat barely above a 16px help line,
23
23
  and a two-line question at 1.1 read as two sentences. The step's help is one size and one color wherever it
24
24
  appears, a step's lead or a section's words under the title, well under the title and never bold. */
25
- .intake-head .step-header { gap: var(--space-3); }
26
- .intake-head .step-title {
25
+ .intake-head [data-slot='step-header'] { gap: var(--space-3); }
26
+ .intake-head :is([data-slot='step-header'] > :is(h1, h2)) {
27
27
  font-size: calc(28px * var(--type-k)); /* off-scale: the question's display size on a phone (docs/design.md, the intake style) */
28
28
  font-family: var(--type-title-font, inherit);
29
29
  font-weight: var(--heading-weight, 600);
@@ -35,8 +35,8 @@
35
35
  outline: none;
36
36
  }
37
37
  /* off-scale: the question's display size at a desk, above the scale's 20px like the landing's display */
38
- @media (min-width: 601px) { .intake-head .step-title { font-size: calc(32px * var(--type-k)); } }
39
- .intake-head .step-lead,
38
+ @media (min-width: 601px) { .intake-head :is([data-slot='step-header'] > :is(h1, h2)) { font-size: calc(32px * var(--type-k)); } }
39
+ .intake-head [data-slot='step-lead'],
40
40
  .multi-step-form[data-style='intake'] .command-group > legend {
41
41
  max-width: 60ch; text-wrap: pretty; font-size: var(--text-lg); font-weight: 400; line-height: 1.45; color: var(--ink-muted);
42
42
  }
@@ -44,7 +44,7 @@
44
44
  (a checkbox's words beside it) are answers, in the regular weight (formDress.css). */
45
45
  .multi-step-form[data-style='intake'] .command-group { border-top: 0; padding-top: 0; }
46
46
  .multi-step-form[data-style='intake'] .command-group-body { padding-top: var(--space-5); }
47
- .multi-step-form[data-style='intake'] .form-field-check-row > .form-field-label { font-size: var(--text-lg); }
47
+ .multi-step-form[data-style='intake'] [data-slot='field-check-row'] > [data-slot='field-label'] { font-size: var(--text-lg); }
48
48
 
49
49
  /* The fields. A label stands a step clear of its well, and a field three times that clear of the next label. */
50
50
  .multi-step-form[data-style='intake'] {
@@ -52,15 +52,15 @@
52
52
  }
53
53
  .multi-step-form[data-style='intake'] :is(.multi-step-panel, .intake-actions) { --control-h: var(--intake-h); }
54
54
  .multi-step-form[data-style='intake'] .command-fields { gap: var(--space-6); }
55
- .multi-step-form[data-style='intake'] .form-columns { column-gap: var(--space-4); row-gap: var(--space-6); }
56
- .multi-step-form[data-style='intake'] .form-field { gap: var(--space-3); }
57
- .multi-step-form[data-style='intake'] .form-field-label { font-size: var(--text-md); }
58
- .multi-step-form[data-style='intake'] .form-field-problem { font-size: var(--text-base); }
59
- .multi-step-form[data-style='intake'] .date-field .date-field-trigger { inset-inline-end: var(--space-2); }
55
+ .multi-step-form[data-style='intake'] [data-slot='columns'] { column-gap: var(--space-4); row-gap: var(--space-6); }
56
+ .multi-step-form[data-style='intake'] [data-slot='field'] { gap: var(--space-3); }
57
+ .multi-step-form[data-style='intake'] [data-slot='field-label'] { font-size: var(--text-md); }
58
+ .multi-step-form[data-style='intake'] [data-slot='field-error'] { font-size: var(--text-base); }
59
+ .multi-step-form[data-style='intake'] [data-slot='date-field'] :is([data-slot='date-field'] > [data-slot='popover-trigger']) { inset-inline-end: var(--space-2); }
60
60
 
61
61
  /* Show, at the intake's larger box. */
62
- .multi-step-form[data-style='intake'] .field-with-action > .btn { min-height: 32px; margin-inline-end: var(--space-2); font-size: var(--text-base); }
63
- .multi-step-form[data-style='intake'] .field-hidden { letter-spacing: 0.12em; }
62
+ .multi-step-form[data-style='intake'] [data-slot='field-with-action'] > [data-slot='button'] { min-height: 32px; margin-inline-end: var(--space-2); font-size: var(--text-base); }
63
+ .multi-step-form[data-style='intake'] [data-slot='input'][data-hidden] { letter-spacing: 0.12em; }
64
64
 
65
65
  /* The actions: Back a quiet word, the primary the one filled thing on the page, in the theme's primary-action color
66
66
  (formDress.css). No rule over them. */
@@ -71,14 +71,14 @@
71
71
  background: var(--ground);
72
72
  align-items: center;
73
73
  }
74
- .intake-actions .btn { min-height: var(--control-h); }
74
+ .intake-actions [data-slot='button'] { min-height: var(--control-h); }
75
75
  /* Back's words stand on the content's edge; its press area reaches past it. */
76
- .intake-actions .action-bar-back { flex: none; margin-inline-start: calc(-1 * var(--space-3)); padding-inline: var(--space-3); }
77
- @media (pointer: coarse) { .intake-actions .btn { min-height: max(var(--control-h), 44px); } }
76
+ .intake-actions :is([data-slot='action-bar'] > [data-slot='button'][data-variant='quiet']) { flex: none; margin-inline-start: calc(-1 * var(--space-3)); padding-inline: var(--space-3); }
77
+ @media (pointer: coarse) { .intake-actions [data-slot='button'] { min-height: max(var(--control-h), 44px); } }
78
78
  /* At a desk the primary is weighted to the right, at its words' width, with Back at the left. */
79
79
  @media (min-width: 601px) {
80
80
  .intake-actions { justify-content: space-between; }
81
- .intake-actions .action-bar-primary { flex: 0 1 auto; min-width: 10rem; margin-inline-start: auto; }
81
+ .intake-actions :is([data-slot='action-bar'] > [data-slot='button'][data-variant='solid']) { flex: 0 1 auto; min-width: 10rem; margin-inline-start: auto; }
82
82
  }
83
83
  /* On a phone the bar is the screen's foot, not the end of the form: a short step left it floating mid-screen. The
84
84
  page fills the scrolling container it is in (the shell's <main>), the form fills the page, and the bar takes the
@@ -109,14 +109,14 @@
109
109
  /* The intake field's own size, outside the layer, ranked by the :root it stands under over every look's field dress,
110
110
  and only on this on-demand sheet, so no first page carries an exception for it. Its colors, edge and ring are the
111
111
  quiet form's (formDress.css). */
112
- /* Every box a row can hold is one height: the command form's listbox is the shell's (.dd-button, without @mistriwork/ui's
113
- .field-select), and stood 8px short of the text box beside it. */
114
- :root .multi-step-form[data-style='intake'] :is(.field-control, .dd-button, .date-field .date-field-input) {
112
+ /* Every box a row can hold is one height: the command form's listbox is the shell's (a bare listbox button, not one
113
+ inside a field of @mistriwork/ui's), and stood 8px short of the text box beside it. */
114
+ :root .multi-step-form[data-style='intake'] :is(:is([data-slot='input'], [data-slot='textarea']),[data-slot='select-trigger'],[data-slot='date-field'] :is([data-slot='date-field'] > [data-slot='input'])) {
115
115
  min-height: var(--control-h);
116
116
  padding-inline: var(--space-4);
117
117
  font-size: var(--text-lg);
118
118
  border-radius: var(--field-radius, var(--radius));
119
119
  }
120
- :root .multi-step-form[data-style='intake'] .field-control[readonly]:not(:disabled) { background: var(--raised); }
121
- :root .multi-step-form[data-style='intake'] .date-field .date-field-input { padding-inline-end: 40px; /* off-scale: the calendar button's 30px and its inset */ }
122
- :root .multi-step-form[data-style='intake'] .field-with-action .field-control { padding-inline-end: calc(5.5em + var(--space-3)); }
120
+ :root .multi-step-form[data-style='intake'] :is([data-slot='input'], [data-slot='textarea'])[readonly]:not(:disabled) { background: var(--raised); }
121
+ :root .multi-step-form[data-style='intake'] [data-slot='date-field'] :is([data-slot='date-field'] > [data-slot='input']) { padding-inline-end: 40px; /* off-scale: the calendar button's 30px and its inset */ }
122
+ :root .multi-step-form[data-style='intake'] [data-slot='field-with-action'] :is([data-slot='input'], [data-slot='textarea']) { padding-inline-end: calc(5.5em + var(--space-3)); }