@qoretechnologies/reqraft 0.10.65 → 0.10.66-pr.145.g32331ea

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 (85) hide show
  1. package/dist/components/form/engine/CompactRow.d.ts.map +1 -1
  2. package/dist/components/form/engine/CompactRow.js +128 -24
  3. package/dist/components/form/engine/CompactRow.js.map +1 -1
  4. package/dist/components/form/engine/CompactToolbar.d.ts.map +1 -1
  5. package/dist/components/form/engine/CompactToolbar.js +78 -15
  6. package/dist/components/form/engine/CompactToolbar.js.map +1 -1
  7. package/dist/components/form/engine/FormEngine.d.ts +48 -1
  8. package/dist/components/form/engine/FormEngine.d.ts.map +1 -1
  9. package/dist/components/form/engine/FormEngine.js +243 -85
  10. package/dist/components/form/engine/FormEngine.js.map +1 -1
  11. package/dist/components/form/engine/OptionFieldMessages.d.ts +18 -2
  12. package/dist/components/form/engine/OptionFieldMessages.d.ts.map +1 -1
  13. package/dist/components/form/engine/OptionFieldMessages.js +22 -3
  14. package/dist/components/form/engine/OptionFieldMessages.js.map +1 -1
  15. package/dist/components/form/engine/_structuredData/SchemaDataView.d.ts.map +1 -1
  16. package/dist/components/form/engine/_structuredData/SchemaDataView.js +27 -1
  17. package/dist/components/form/engine/_structuredData/SchemaDataView.js.map +1 -1
  18. package/dist/components/form/engine/compactRowContext.d.ts +5 -0
  19. package/dist/components/form/engine/compactRowContext.d.ts.map +1 -1
  20. package/dist/components/form/engine/compactRowContext.js.map +1 -1
  21. package/dist/components/form/engine/compactRowStyles.d.ts +12 -0
  22. package/dist/components/form/engine/compactRowStyles.d.ts.map +1 -1
  23. package/dist/components/form/engine/compactRowStyles.js +72 -39
  24. package/dist/components/form/engine/compactRowStyles.js.map +1 -1
  25. package/dist/components/form/engine/compactToolbarContext.d.ts +3 -0
  26. package/dist/components/form/engine/compactToolbarContext.d.ts.map +1 -1
  27. package/dist/components/form/engine/compactToolbarContext.js.map +1 -1
  28. package/dist/components/form/engine/formAppearance.d.ts +48 -0
  29. package/dist/components/form/engine/formAppearance.d.ts.map +1 -0
  30. package/dist/components/form/engine/formAppearance.js +50 -0
  31. package/dist/components/form/engine/formAppearance.js.map +1 -0
  32. package/dist/components/form/engine/readFirst.d.ts +14 -2
  33. package/dist/components/form/engine/readFirst.d.ts.map +1 -1
  34. package/dist/components/form/engine/readFirst.js +6 -2
  35. package/dist/components/form/engine/readFirst.js.map +1 -1
  36. package/dist/components/form/engine/rowFocus.d.ts +9 -1
  37. package/dist/components/form/engine/rowFocus.d.ts.map +1 -1
  38. package/dist/components/form/engine/rowFocus.js +17 -5
  39. package/dist/components/form/engine/rowFocus.js.map +1 -1
  40. package/dist/components/form/fields/ChoiceGroupHeading.d.ts +21 -0
  41. package/dist/components/form/fields/ChoiceGroupHeading.d.ts.map +1 -0
  42. package/dist/components/form/fields/ChoiceGroupHeading.js +33 -0
  43. package/dist/components/form/fields/ChoiceGroupHeading.js.map +1 -0
  44. package/dist/components/form/fields/Field.d.ts.map +1 -1
  45. package/dist/components/form/fields/Field.js +5 -3
  46. package/dist/components/form/fields/Field.js.map +1 -1
  47. package/dist/components/form/fields/allowed-values/AllowedValues.d.ts.map +1 -1
  48. package/dist/components/form/fields/allowed-values/AllowedValues.js +4 -2
  49. package/dist/components/form/fields/allowed-values/AllowedValues.js.map +1 -1
  50. package/dist/components/form/fields/radio-group/RadioGroup.d.ts.map +1 -1
  51. package/dist/components/form/fields/radio-group/RadioGroup.js +13 -7
  52. package/dist/components/form/fields/radio-group/RadioGroup.js.map +1 -1
  53. package/dist/components/form/index.d.ts +1 -0
  54. package/dist/components/form/index.d.ts.map +1 -1
  55. package/dist/components/form/index.js +1 -0
  56. package/dist/components/form/index.js.map +1 -1
  57. package/dist/components/supportTicket/TicketHeader.d.ts.map +1 -1
  58. package/dist/components/supportTicket/TicketHeader.js +4 -1
  59. package/dist/components/supportTicket/TicketHeader.js.map +1 -1
  60. package/dist/components/supportTicket/TicketReplyBox.d.ts.map +1 -1
  61. package/dist/components/supportTicket/TicketReplyBox.js +29 -10
  62. package/dist/components/supportTicket/TicketReplyBox.js.map +1 -1
  63. package/package.json +1 -1
  64. package/src/components/form/engine/CompactRow.tsx +141 -22
  65. package/src/components/form/engine/CompactToolbar.tsx +85 -16
  66. package/src/components/form/engine/FormEngine.stories.tsx +25 -13
  67. package/src/components/form/engine/FormEngine.tsx +358 -77
  68. package/src/components/form/engine/FormEngineAppearance.stories.tsx +540 -0
  69. package/src/components/form/engine/FormEngineStickyHeaders.stories.tsx +5 -1
  70. package/src/components/form/engine/OptionFieldMessages.tsx +73 -2
  71. package/src/components/form/engine/_structuredData/SchemaDataView.tsx +17 -4
  72. package/src/components/form/engine/compactRowContext.ts +5 -0
  73. package/src/components/form/engine/compactRowStyles.ts +218 -38
  74. package/src/components/form/engine/compactToolbarContext.ts +3 -0
  75. package/src/components/form/engine/formAppearance.ts +78 -0
  76. package/src/components/form/engine/readFirst.ts +16 -3
  77. package/src/components/form/engine/rowFocus.ts +17 -6
  78. package/src/components/form/fields/ChoiceGroupHeading.tsx +38 -0
  79. package/src/components/form/fields/Field.tsx +6 -5
  80. package/src/components/form/fields/allowed-values/AllowedValues.tsx +7 -4
  81. package/src/components/form/fields/radio-group/RadioGroup.tsx +13 -7
  82. package/src/components/form/index.tsx +1 -0
  83. package/src/components/supportTicket/TicketHeader.tsx +2 -1
  84. package/src/components/supportTicket/TicketReplyBox.stories.tsx +17 -2
  85. package/src/components/supportTicket/TicketReplyBox.tsx +27 -5
@@ -1 +1 @@
1
- {"version":3,"file":"CompactRow.d.ts","sourceRoot":"","sources":["../../../../src/components/form/engine/CompactRow.tsx"],"names":[],"mappings":"AAeA,OAAO,EACL,eAAe,EAIhB,MAAM,8BAA8B,CAAC;AAItC,OAAO,KAAe,MAAM,OAAO,CAAC;AA8HpC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB,SAAU,OAAO,KAAG,MAAM,GAAG,SAG7C,CAAC;AAEd,eAAO,MAAM,UAAU,yHASlB;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,eAAe,CAAC;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;mBAGe;IACf,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAI1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,6CAy3EF,CAAC"}
1
+ {"version":3,"file":"CompactRow.d.ts","sourceRoot":"","sources":["../../../../src/components/form/engine/CompactRow.tsx"],"names":[],"mappings":"AAeA,OAAO,EACL,eAAe,EAIhB,MAAM,8BAA8B,CAAC;AAItC,OAAO,KAAe,MAAM,OAAO,CAAC;AA+HpC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB,SAAU,OAAO,KAAG,MAAM,GAAG,SAG7C,CAAC;AAEd,eAAO,MAAM,UAAU,yHASlB;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,eAAe,CAAC;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;mBAGe;IACf,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAI1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,6CA++EF,CAAC"}
@@ -114,6 +114,7 @@ var Description_1 = require("../../Description");
114
114
  var markdownRendererContext_1 = require("../../Description/markdownRendererContext");
115
115
  var FocusedEditing_1 = require("../../FocusedEditing");
116
116
  var compactRowContext_1 = require("./compactRowContext");
117
+ var formAppearance_1 = require("./formAppearance");
117
118
  var revealRow_1 = require("./revealRow");
118
119
  var compactRowStyles_1 = require("./compactRowStyles");
119
120
  var OptionFieldMessages_1 = require("./OptionFieldMessages");
@@ -214,8 +215,14 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
214
215
  var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
215
216
  var optionName = _a.optionName, optionField = _a.optionField, _r = _a.hidden, hidden = _r === void 0 ? false : _r, _s = _a.clustered, clustered = _s === void 0 ? false : _s, _t = _a.clusterFirst, clusterFirst = _t === void 0 ? false : _t, _u = _a.clusterLast, clusterLast = _u === void 0 ? false : _u, absorbedFields = _a.absorbedFields;
216
217
  var readOnly = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.readOnly; });
218
+ // The look only — see `TFormEngineAppearance`. Nothing a row DOES reads it.
219
+ var calm = (0, formAppearance_1.useIsCalmForm)();
217
220
  var commitMode = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.commitMode; });
218
221
  var options = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.options; });
222
+ // Whether this field's emptiness is a fault yet: the person has opened it and left,
223
+ // or the host reported a submit attempt. Before that a required field is only to
224
+ // fill in, and says so in the quiet colour.
225
+ var visited = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { var _a; return v.revealRequired || !!((_a = v.visitedOptions) === null || _a === void 0 ? void 0 : _a.includes(optionName)); });
219
226
  // An absorbed field keeps its own name — it is a different field, not a
220
227
  // property of its host — so the label comes from its schema exactly as it
221
228
  // would on its own row.
@@ -298,6 +305,11 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
298
305
  var cDanger = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.cDanger; });
299
306
  var cWarning = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.cWarning; });
300
307
  var cInfo = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.cInfo; });
308
+ var cText = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.cText; });
309
+ // A field's NAME: full text colour by default; grey in the calm look, so the
310
+ // value beside it is what the eye lands on. One colour for the read row, the
311
+ // open row and the edit card, so a name does not change as its field opens.
312
+ var cLabel = calm ? "".concat(cText, "b3") : cKey;
301
313
  // A markdown value renders as a document in the row's inset; the host's
302
314
  // renderer when it supplied one, reqraft's own otherwise.
303
315
  // Value-cell content: colour adds a swatch, file an icon + size; hash keeps
@@ -354,6 +366,11 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
354
366
  return ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { size: 'small', minimal: true, intent: 'info', icon: 'FileLine', label: formatted, labelKey: fileSize !== undefined ? (0, readFirst_1.formatBytes)(fileSize) : undefined }));
355
367
  }
356
368
  if (valueType === 'bool' || valueType === 'boolean') {
369
+ // Calm: Yes and No are words. Neither is a status — "No" is not a
370
+ // failure — so neither is coloured.
371
+ if (calm) {
372
+ return (0, jsx_runtime_1.jsx)("span", { style: textStyle, children: formatted });
373
+ }
357
374
  var truthy = (field === null || field === void 0 ? void 0 : field.value) === true || (field === null || field === void 0 ? void 0 : field.value) === 'true';
358
375
  return ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { size: 'small', minimal: true, intent: truthy ? 'success' : 'danger', label: formatted }));
359
376
  }
@@ -545,8 +562,11 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
545
562
  }, children: actionLabel }), "".concat(optionName, "-injected-action-").concat(index)));
546
563
  };
547
564
  var required = !!((schema === null || schema === void 0 ? void 0 : schema.required) || (schema === null || schema === void 0 ? void 0 : schema.required_groups));
548
- // The asterisk says "you have to fill this in". Read-only, nobody does.
549
- var requiredMark = required && !readOnly;
565
+ // The asterisk says "you have to fill this in". Read-only, nobody does. The
566
+ // calm look draws none at all: an empty required field says so in its
567
+ // value column instead ("Required · add a value"), and a filled one has
568
+ // nothing left to ask for.
569
+ var requiredMark = required && !readOnly && !calm;
550
570
  var removable = !readOnly && !(schema === null || schema === void 0 ? void 0 : schema.preselected) && !(schema === null || schema === void 0 ? void 0 : schema.required) && !(schema === null || schema === void 0 ? void 0 : schema.required_groups);
551
571
  var changed = !hidden && !readOnly && hasOptionChanged(optionField === null || optionField === void 0 ? void 0 : optionField.value, optionName);
552
572
  // "Has a value" = set to anything non-empty. Drives the edit-row Clear
@@ -589,7 +609,13 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
589
609
  var requiredGroupChip = !hidden && !readOnly && memberGroups.length && !(schema === null || schema === void 0 ? void 0 : schema.required) ?
590
610
  (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, role: 'presentation', onClick: function (e) { return e.stopPropagation(); }, onKeyDown: function (e) { return e.stopPropagation(); }, onMouseEnter: function () {
591
611
  return setHighlightedOptions(requiredGroupsInfo.members[chipGroups[0]] || []);
592
- }, onMouseLeave: function () { return setHighlightedOptions([]); }, children: (0, jsx_runtime_1.jsx)(reqore_1.ReqoreDropdown, { className: 'options-readfirst-required-group', size: 'tiny', minimal: true, flat: true, compact: true, effect: { uppercase: true, spaced: 1 }, intent: groupResolved ? 'success' : 'warning', icon: groupResolved ? 'CheckLine' : 'LinkM', label: !groupResolved ? 'One of'
612
+ }, onMouseLeave: function () { return setHighlightedOptions([]); }, children: (0, jsx_runtime_1.jsx)(reqore_1.ReqoreDropdown, { className: 'options-readfirst-required-group', size: 'tiny', minimal: true, flat: true, compact: true, effect: calm ? undefined : { uppercase: true, spaced: 1 },
613
+ // Calm: a met group is nothing to point at — only the unmet one is
614
+ // coloured.
615
+ intent: groupResolved ?
616
+ calm ? undefined
617
+ : 'success'
618
+ : 'warning', icon: groupResolved ? 'CheckLine' : 'LinkM', label: !groupResolved ? 'One of'
593
619
  : coveredByLabel ?
594
620
  "Covered by \u201C".concat(coveredByLabel, "\u201D")
595
621
  : 'Covers', filterable: chipGroups.reduce(function (n, g) { return n + requiredGroupsInfo.members[g].length; }, 0) > 6, items: chipGroups.flatMap(function (groupName) { return __spreadArray(__spreadArray([], (chipGroups.length > 1 ?
@@ -729,18 +755,43 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
729
755
  if (!editor)
730
756
  return undefined;
731
757
  var settled = false;
758
+ /* A control that is not a text box holds the caret PROVISIONALLY. An editor that
759
+ takes text can mount after the row opens (a code editor loads late), and until
760
+ it does the only control there is its chrome: a fullscreen toggle. When the
761
+ text box arrives it takes the caret, unless the reader has moved it since. A
762
+ row that never grows one (a pick-one) simply keeps its control. */
763
+ var provisional = null;
732
764
  var takeCaret = function () {
733
765
  var _a;
734
766
  if (settled)
735
767
  return true;
736
768
  var active = document.activeElement;
769
+ if (provisional) {
770
+ if (active !== provisional) {
771
+ // The reader moved the caret themselves. Leave it there.
772
+ settled = true;
773
+ return true;
774
+ }
775
+ var textEntry = (0, rowFocus_1.findRowFocusTarget)(editor, { textEntryOnly: true });
776
+ if (!textEntry)
777
+ return false;
778
+ textEntry.focus({ preventScroll: true });
779
+ // An editor's text box can be in the DOM before it can take focus (Monaco's
780
+ // edit area, mid-layout), and `focus()` then does nothing. Only a caret
781
+ // that landed counts; otherwise try again on the editor's next change.
782
+ if (document.activeElement !== textEntry)
783
+ return false;
784
+ settled = true;
785
+ return true;
786
+ }
737
787
  if (active && active !== document.body && !((_a = rowRef.current) === null || _a === void 0 ? void 0 : _a.contains(active))) {
738
788
  // Someone else holds the caret — a field the reader moved into while
739
789
  // this row's editor was still arriving. Leave it where it is.
740
790
  settled = true;
741
791
  return true;
742
792
  }
743
- var control = (0, rowFocus_1.findRowFocusTarget)(editor);
793
+ // A card hands the caret only to where text goes (see `findRowFocusTarget`).
794
+ var control = (0, rowFocus_1.findRowFocusTarget)(editor, { textEntryOnly: !inlineEditable });
744
795
  if (!control)
745
796
  return false;
746
797
  // The least scroll that shows the row clear of the pinned box header,
@@ -751,6 +802,10 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
751
802
  // `preventScroll`, because the reveal above has already put the row
752
803
  // where it belongs; letting focus scroll as well moves it twice.
753
804
  control.focus({ preventScroll: true });
805
+ // A control that cannot take focus yet (still laying out) did not take
806
+ // the caret: try again on the editor's next change.
807
+ if (document.activeElement !== control)
808
+ return false;
754
809
  /* …and if the control the row offers is a PICKER, open it.
755
810
  *
756
811
  * A closed picker prints the value it holds, which is exactly what the
@@ -768,6 +823,13 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
768
823
  if (openedByAuthor.current && inlineEditable && (0, rowFocus_1.isClosedPickerTrigger)(control)) {
769
824
  openedByAuthor.current = false;
770
825
  setOpenThePicker(true);
826
+ settled = true;
827
+ return true;
828
+ }
829
+ if ((0, rowFocus_1.findRowFocusTarget)(editor, { textEntryOnly: true }) !== control) {
830
+ // Not a text box: hold it until one arrives (see `provisional`).
831
+ provisional = control;
832
+ return false;
771
833
  }
772
834
  settled = true;
773
835
  return true;
@@ -778,7 +840,9 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
778
840
  if (takeCaret())
779
841
  observer.disconnect();
780
842
  });
781
- observer.observe(editor, { childList: true, subtree: true });
843
+ // Attributes too: an editor's text box can become focusable by an attribute or
844
+ // style change after it is inserted (see the `focus()` checks above).
845
+ observer.observe(editor, { childList: true, subtree: true, attributes: true });
782
846
  return function () { return observer.disconnect(); };
783
847
  }, [isExpanded, optionName, inlineEditable]);
784
848
  // What the field held when it was opened — the baseline Cancel restores.
@@ -921,7 +985,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
921
985
  // Batched commit: a changed row is a draft until Save — mark it with the
922
986
  // product's Draft chip (always visible, unlike the hover-revealed revert).
923
987
  var draftChip = commitMode === 'batched' && changed ?
924
- (0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { className: 'options-readfirst-draft', label: 'Draft', intent: 'warning', icon: 'EditLine', size: 'tiny', minimal: true, fixed: true, flat: true, compact: true, effect: { uppercase: true, spaced: 1 } })
988
+ (0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { className: 'options-readfirst-draft', label: 'Draft', intent: 'warning', icon: 'EditLine', size: 'tiny', minimal: true, fixed: true, flat: true, compact: true, effect: calm ? undefined : { uppercase: true, spaced: 1 } })
925
989
  : null;
926
990
  var isPassiveCloseAction = fixedAllowedValueOption;
927
991
  // Cancel — the counterpart to Done, and the answer to "how do I get out of
@@ -936,7 +1000,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
936
1000
  // Not offered when the close action is passive (a fixed choice) —
937
1001
  // nothing can have been typed, so there is nothing to cancel.
938
1002
  var cancelEditButton = !isPassiveCloseAction && editedSinceOpened ?
939
- (0, jsx_runtime_1.jsx)(reqore_1.ReqoreButton, { className: 'options-readfirst-cancel', size: 'small', flat: true, minimal: true, fixed: true, icon: 'CloseLine', intent: 'warning', "aria-label": 'Cancel edit', tooltip: 'Cancel edit \u2014 discard the changes made since this field was opened', onClick: function (event) {
1003
+ (0, jsx_runtime_1.jsx)(reqore_1.ReqoreButton, { className: 'options-readfirst-cancel', size: 'small', flat: true, minimal: true, fixed: true, icon: 'CloseLine', intent: calm ? undefined : 'warning', "aria-label": 'Cancel edit', tooltip: 'Cancel edit \u2014 discard the changes made since this field was opened', onClick: function (event) {
940
1004
  event.stopPropagation();
941
1005
  cancelEdit();
942
1006
  } })
@@ -945,7 +1009,10 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
945
1009
  var openedWithFormLoadValue = !editEntryValue.current ||
946
1010
  (0, isEqual_1.default)(editEntryValue.current.value, (_f = (_e = originalValue.current) === null || _e === void 0 ? void 0 : _e[optionName]) === null || _f === void 0 ? void 0 : _f.value);
947
1011
  var editRowRevertButton = openedWithFormLoadValue ? null : revertButton;
948
- var closeExpandedFieldButton = ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreButton, { className: 'options-readfirst-done', size: 'small', intent: !isPassiveCloseAction ? 'success' : undefined, flat: isPassiveCloseAction, minimal: isPassiveCloseAction, fixed: true, icon: isPassiveCloseAction ? 'CloseLine' : 'CheckLine', "aria-label": isPassiveCloseAction ? 'Close field' : 'Done', tooltip: isPassiveCloseAction ? 'Close field' : 'Done', onClick: function () { return toggleExpandedOption(optionName); } }));
1012
+ var closeExpandedFieldButton = ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreButton, { className: 'options-readfirst-done', size: 'small',
1013
+ // Calm: a neutral button. Closing a field is not a healthy figure and
1014
+ // not the page's one primary action, so it takes neither colour.
1015
+ intent: !isPassiveCloseAction && !calm ? 'success' : undefined, flat: isPassiveCloseAction, minimal: isPassiveCloseAction, fixed: true, icon: isPassiveCloseAction ? 'CloseLine' : 'CheckLine', "aria-label": isPassiveCloseAction ? 'Close field' : 'Done', tooltip: isPassiveCloseAction ? 'Close field' : 'Done', onClick: function () { return toggleExpandedOption(optionName); } }));
949
1016
  // Info tiers: Tier 1 (danger/warning + dependency hints) must be visible
950
1017
  // without interaction; Tier 2 (info/success, default notes) sits behind ⓘ.
951
1018
  var infoActive = !hidden;
@@ -971,6 +1038,10 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
971
1038
  allOptions: availableOptions,
972
1039
  getType: getTypeForOption,
973
1040
  isRendererOnly: isRendererOnly,
1041
+ calm: calm,
1042
+ readOnly: readOnly,
1043
+ // Until the person has been to the field, its requirement is stated plainly.
1044
+ requirementPending: !visited,
974
1045
  }).map(function (m) { return ({ intent: m.intent, content: String(m.label) }); })
975
1046
  : [];
976
1047
  // TWO display channels, matching the Focus prototype:
@@ -1025,7 +1096,13 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
1025
1096
  inside a row, never a page, and markdown authored as a document opens with
1026
1097
  a heading that would outgrow the field label above it. Without a host
1027
1098
  renderer the string is drawn as it always was. */
1028
- var renderInfoStrip = function (m, index) { return ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreMessage, { size: 'small', opaque: false, flat: true, intent: m.intent, title: m.title, style: { marginBottom: 8 }, children: markdownRenderer && typeof m.content === 'string' ?
1099
+ var renderInfoStrip = function (m, index) { return ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreMessage, { size: 'small', opaque: false, flat: true,
1100
+ // Calm: a note that only informs takes no colour — blue is kept for "a
1101
+ // filter is on", green for a healthy figure. A warning or a failure
1102
+ // keeps its intent: those are what a person has to act on.
1103
+ intent: (calm && (!m.intent || m.intent === 'info' || m.intent === 'success') ?
1104
+ undefined
1105
+ : m.intent), title: m.title, style: { marginBottom: 8 }, children: markdownRenderer && typeof m.content === 'string' ?
1029
1106
  markdownRenderer({ value: m.content, compact: true })
1030
1107
  : m.content }, "".concat(m.content, "-").concat(index))); };
1031
1108
  var reasonColor = function (intent) {
@@ -1133,16 +1210,16 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
1133
1210
  var collapse_1 = function () { return toggleExpandedOption(optionName); };
1134
1211
  var editingRow = ((0, jsx_runtime_1.jsxs)("div", __assign({ ref: rowRef, "data-field": optionName, className: 'readfirst-row readfirst-row-editing options-readfirst-inline options-readfirst-value', style: readRowHeights.current[optionName] ?
1135
1212
  { minHeight: readRowHeights.current[optionName] }
1136
- : undefined }, clusterHoverProps, { children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledLabelBlock, { className: 'options-readfirst-label-block', children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledRowLabel, { role: 'button', tabIndex: 0, "aria-label": "Collapse ".concat(label), title: (schema === null || schema === void 0 ? void 0 : schema.short_desc) || undefined, "$color": cKey, "$pointer": true, onClick: collapse_1, onKeyDown: function (event) {
1213
+ : undefined }, clusterHoverProps, { children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledLabelBlock, { className: 'options-readfirst-label-block', children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledRowLabel, { role: 'button', tabIndex: 0, "aria-label": "Collapse ".concat(label), title: (schema === null || schema === void 0 ? void 0 : schema.short_desc) || undefined, "$color": cLabel, "$pointer": true, onClick: collapse_1, onKeyDown: function (event) {
1137
1214
  if (event.key === 'Enter' || event.key === ' ') {
1138
1215
  event.preventDefault();
1139
1216
  collapse_1();
1140
1217
  }
1141
- }, children: [label, required ?
1218
+ }, children: [label, required && !calm ?
1142
1219
  (0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { icon: 'Asterisk', color: 'danger', size: '10px' })
1143
1220
  : null, helpIcon] }), labelShortDesc ?
1144
1221
  (0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledLabelDesc, { className: 'options-readfirst-label-desc', size: 'small', effect: { opacity: 0.55 }, children: labelShortDesc })
1145
- : null, codeSizeNode] }), (0, jsx_runtime_1.jsxs)("div", { ref: editorRef, style: { minWidth: 0 }, onKeyDown: function (event) {
1222
+ : null, codeSizeNode] }), (0, jsx_runtime_1.jsxs)("div", { ref: editorRef, className: 'options-readfirst-row-editor', style: { minWidth: 0 }, onKeyDown: function (event) {
1146
1223
  if (event.key === 'Escape') {
1147
1224
  event.stopPropagation();
1148
1225
  // Escape discards. It used to call `collapse()`, which closed
@@ -1177,17 +1254,17 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
1177
1254
  var schemaIntentColor = (schema === null || schema === void 0 ? void 0 : schema.intent) ?
1178
1255
  (_j = theme === null || theme === void 0 ? void 0 : theme.intents) === null || _j === void 0 ? void 0 : _j[schema.intent]
1179
1256
  : undefined;
1180
- return ((0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledEditCard, { "data-field": optionName, className: COMPACT_SINGLE_VALUE_TYPES.has(editType) ?
1257
+ return ((0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledEditCard, { ref: rowRef, "data-field": optionName, className: COMPACT_SINGLE_VALUE_TYPES.has(editType) ?
1181
1258
  'options-readfirst-card options-readfirst-card-single'
1182
- : 'options-readfirst-card', "$bg": cHover, "$border": schemaIntentColor ? "".concat(schemaIntentColor, "66") : "".concat(cInfo, "66"), children: [(0, jsx_runtime_1.jsxs)("div", { style: {
1259
+ : 'options-readfirst-card', "$bg": cHover, "$border": schemaIntentColor ? "".concat(schemaIntentColor, "66") : "".concat(cInfo, "66"), "$calm": calm, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
1183
1260
  display: 'flex',
1184
1261
  alignItems: 'flex-start',
1185
1262
  justifyContent: 'space-between',
1186
1263
  gap: 12,
1187
- }, children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledCardHeading, { children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledCardLabel, { "$color": cKey, children: [((schema === null || schema === void 0 ? void 0 : schema.icon) ||
1264
+ }, children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledCardHeading, { children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledCardLabel, { "$color": cLabel, children: [((schema === null || schema === void 0 ? void 0 : schema.icon) ||
1188
1265
  (schema === null || schema === void 0 ? void 0 : schema.image)) ?
1189
1266
  (0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { icon: schema === null || schema === void 0 ? void 0 : schema.icon, image: schema === null || schema === void 0 ? void 0 : schema.image, size: '14px' })
1190
- : null, (0, jsx_runtime_1.jsxs)("span", { children: [label, required ?
1267
+ : null, (0, jsx_runtime_1.jsxs)("span", { children: [label, required && !calm ?
1191
1268
  (0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { icon: 'Asterisk', color: 'danger', size: '10px' })
1192
1269
  : null, helpIcon] }), cardBadges.map(function (badge, index) {
1193
1270
  return typeof badge === 'object' ?
@@ -1204,7 +1281,11 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
1204
1281
  return renderInjectedOptionAction(action, index);
1205
1282
  }), editRowRevertButton, cancelEditButton, hasValue && !readOnly ?
1206
1283
  (0, jsx_runtime_1.jsx)(reqore_1.ReqoreButton, { size: 'small', icon: 'DeleteBinLine', minimal: true, flat: true, fixed: true, intent: 'danger', className: 'options-readfirst-clear', "aria-label": 'Clear value', tooltip: 'Clear value', onClick: confirmClearValue })
1207
- : null, moreMenu, closeExpandedFieldButton] })] }), absorbedNodes, (0, jsx_runtime_1.jsx)("div", { style: { display: 'contents' }, onKeyDown: function (event) {
1284
+ : null, moreMenu, closeExpandedFieldButton] })] }), absorbedNodes, (0, jsx_runtime_1.jsx)("div", {
1285
+ // The card's editor, as the inline row's is: an opened card takes the
1286
+ // caret too (the tap-to-edit rule above), so opening Description or
1287
+ // Source Code by a click or by a blocked submit puts the cursor in it.
1288
+ ref: editorRef, className: 'options-readfirst-row-editor', style: { display: 'contents' }, onKeyDown: function (event) {
1208
1289
  if (event.key === 'Escape') {
1209
1290
  event.stopPropagation();
1210
1291
  cancelEdit();
@@ -1238,7 +1319,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
1238
1319
  // default-value hints, plus a read-only covered-by note (editable covered rows
1239
1320
  // carry that in their chip instead).
1240
1321
  var valueReasons = __spreadArray(__spreadArray([], inlineMessages, true), (empty && coveredByLabel ?
1241
- [{ content: "Covered by \u201C".concat(coveredByLabel, "\u201D"), intent: 'success' }]
1322
+ [{ content: "Covered by \u201C".concat(coveredByLabel, "\u201D"), intent: calm ? undefined : 'success' }]
1242
1323
  : []), true);
1243
1324
  // A hash row reveals its sub-fields as read-only sub-rows under a "view
1244
1325
  // more" disclosure; the row itself still expands the real editor on click.
@@ -1518,10 +1599,26 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
1518
1599
  covered: !!coveredByLabel || groupResolved,
1519
1600
  invalid: worstIntent === 'danger',
1520
1601
  warned: worstIntent === 'warning',
1602
+ visited: visited,
1521
1603
  });
1522
1604
  // No dot at all in a read-only form: the dot reports progress on the
1523
1605
  // form, and a read view has no progress to report.
1524
- var dotStatus = hidden || fieldDisabled || readOnly ? undefined : rowStatus;
1606
+ //
1607
+ // Calm: no dot on a healthy row, and none on an empty required one either —
1608
+ // its value column already says "Required · add a value" in amber, and one
1609
+ // thing is said once. Only a failing value keeps the red dot beside the
1610
+ // reason it gives.
1611
+ var dotStatus = hidden || fieldDisabled || readOnly || (calm && rowStatus !== 'invalid') ?
1612
+ undefined
1613
+ : rowStatus;
1614
+ // Calm: an empty required value is said IN the value column, in amber,
1615
+ // where the value would be — instead of a dash plus a red reason beside it.
1616
+ // Not on a locked field (its lock and reason speak for it) or one that
1617
+ // shows the default it will fall back to.
1618
+ var calmRequiredWord = calm && empty && !hidden && !!(schema === null || schema === void 0 ? void 0 : schema.required) && !fieldDisabled && !formattedDefault ?
1619
+ readOnly ? formAppearance_1.CALM_REQUIRED_READ_LABEL
1620
+ : formAppearance_1.CALM_REQUIRED_LABEL
1621
+ : undefined;
1525
1622
  var dotColor = dotStatus === 'invalid' ? cDanger
1526
1623
  : dotStatus === 'todo' ? cWarning
1527
1624
  : dotStatus === 'set' ? cSuccess || cInfo
@@ -1539,7 +1636,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
1539
1636
  event.preventDefault();
1540
1637
  activate(event);
1541
1638
  }
1542
- }) }, clusterHoverProps, { children: [clusterNode, (0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledLabelBlock, { className: 'options-readfirst-label-block', children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledRowLabel, { title: (schema === null || schema === void 0 ? void 0 : schema.short_desc) || undefined, "$color": cKey, children: [rowChromeIcon, (0, jsx_runtime_1.jsxs)("span", { className: 'options-readfirst-label-text', style: { minWidth: 0 }, children: [label, requiredMark ?
1639
+ }) }, clusterHoverProps, { children: [clusterNode, (0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledLabelBlock, { className: 'options-readfirst-label-block', children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledRowLabel, { title: (schema === null || schema === void 0 ? void 0 : schema.short_desc) || undefined, "$color": cLabel, children: [rowChromeIcon, (0, jsx_runtime_1.jsxs)("span", { className: 'options-readfirst-label-text', style: { minWidth: 0 }, children: [label, requiredMark ?
1543
1640
  (0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { icon: 'Asterisk', color: 'danger', size: '10px', margin: 'left', marginSize: 'tiny' })
1544
1641
  : null, helpIcon] }), typeLabel ?
1545
1642
  (0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { size: 'tiny', minimal: true, label: typeLabel, labelEffect: { opacity: 0.55 } })
@@ -1574,13 +1671,20 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
1574
1671
  !showsTemplateText &&
1575
1672
  typeof formatted === 'string') ?
1576
1673
  formatted
1577
- : undefined, "$color": empty || hidden ? "".concat(cMuted, "66") : cKey, "$empty": empty || hidden, children: [(showMarkdownPreview || showLongTextInset || (previewWithSchema && showStructuredPreview)) ?
1674
+ : undefined, "$color": calmRequiredWord ?
1675
+ rowStatus === 'pending' ?
1676
+ "".concat(cMuted, "a6")
1677
+ : cWarning
1678
+ : empty || hidden ? "".concat(cMuted, "66")
1679
+ : cKey, "$empty": (empty || hidden) && !calmRequiredWord, children: [(showMarkdownPreview || showLongTextInset || (previewWithSchema && showStructuredPreview)) ?
1578
1680
  null
1579
1681
  : (0, jsx_runtime_1.jsx)("span", { className: 'options-readfirst-valuetext', children: hidden || empty ?
1580
- formattedDefault || '—'
1682
+ calmRequiredWord || formattedDefault || '—'
1581
1683
  : renderReadFirstValue(optionField, schema, formatted, readOnly) }), readOnlyChoiceDesc ?
1582
1684
  (0, jsx_runtime_1.jsx)("span", { className: 'options-readfirst-choice-desc', children: readOnlyChoiceDesc })
1583
- : null, valueReasons.map(function (m, i) { return ((0, jsx_runtime_1.jsx)("span", { className: 'options-readfirst-reason', style: { color: reasonColor(m.intent) }, children: m.content }, "".concat(m.content, "-").concat(i))); }), panelMessages.length ?
1685
+ : null, (calmRequiredWord ?
1686
+ valueReasons.filter(function (m) { return m.content !== calmRequiredWord; })
1687
+ : valueReasons).map(function (m, i) { return ((0, jsx_runtime_1.jsx)("span", { className: 'options-readfirst-reason', style: { color: reasonColor(m.intent) }, children: m.content }, "".concat(m.content, "-").concat(i))); }), panelMessages.length ?
1584
1688
  (0, jsx_runtime_1.jsx)(reqore_1.ReqoreControlGroup, { className: 'options-readfirst-info-panel', vertical: true, fluid: true, gapSize: 'normal', children: panelMessages.map(renderInfoStrip) })
1585
1689
  : null, showStructuredPreview ?
1586
1690
  // The inset lives inside the row now, so a click on a value chip would
@@ -1661,7 +1765,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
1661
1765
  handleValueChange(optionName, (_b = (_a = originalValue.current) === null || _a === void 0 ? void 0 : _a[optionName]) === null || _b === void 0 ? void 0 : _b.value, (_d = (_c = originalValue.current) === null || _c === void 0 ? void 0 : _c[optionName]) === null || _d === void 0 ? void 0 : _d.type);
1662
1766
  } })
1663
1767
  : dotColor ?
1664
- (0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledStatusDot, { "$color": dotColor, "$ring": dotStatus !== 'set', "aria-hidden": true })
1768
+ (0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledStatusDot, { className: 'options-readfirst-status-dot', "$color": dotColor, "$ring": dotStatus !== 'set', "aria-hidden": true })
1665
1769
  : null })] })] }), optionName));
1666
1770
  return row;
1667
1771
  });