viewkitjs 0.30.1 → 0.32.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 (298) hide show
  1. package/CHANGELOG.md +143 -0
  2. package/MIGRATION.md +40 -6
  3. package/README.md +1 -1
  4. package/fields/dist/query/index.d.ts +2 -0
  5. package/fields/dist/query/index.js +2 -0
  6. package/fields/dist/query/list-request.d.ts +148 -0
  7. package/fields/dist/query/list-request.js +125 -0
  8. package/fields/dist/query/saved-view.d.ts +15 -0
  9. package/fields/dist/query/saved-view.js +11 -0
  10. package/fields/dist/query/settings.d.ts +9 -0
  11. package/fields/dist/query/settings.js +9 -0
  12. package/fields/docs/reference/query.md +66 -0
  13. package/package.json +8 -2
  14. package/postgres/README.md +1 -0
  15. package/postgres/dist/handler.d.ts +53 -0
  16. package/postgres/dist/handler.js +211 -0
  17. package/postgres/dist/ids.d.ts +1 -1
  18. package/postgres/dist/ids.js +19 -1
  19. package/postgres/dist/index.d.ts +1 -0
  20. package/postgres/dist/index.js +1 -0
  21. package/postgres/dist/limits.d.ts +3 -1
  22. package/postgres/dist/limits.js +1 -1
  23. package/postgres/dist/list-fields.d.ts +10 -0
  24. package/postgres/dist/list-fields.js +36 -0
  25. package/postgres/dist/readable.d.ts +4 -0
  26. package/postgres/dist/readable.js +4 -0
  27. package/postgres/dist/refusals.d.ts +9 -2
  28. package/postgres/dist/refusals.js +6 -0
  29. package/postgres/docs/guides/field-map.md +2 -2
  30. package/postgres/docs/guides/list-handler.md +99 -0
  31. package/postgres/docs/index.md +1 -0
  32. package/postgres/docs/reference/postgres.md +11 -3
  33. package/views/README.md +2 -2
  34. package/views/dist/atoms/RowMenu.d.ts +7 -0
  35. package/views/dist/atoms/RowMenu.js +18 -16
  36. package/views/dist/atoms/carried.d.ts +5 -0
  37. package/views/dist/atoms/carried.js +7 -0
  38. package/views/dist/atoms/types.d.ts +3 -0
  39. package/views/dist/contract.d.ts +26 -6
  40. package/views/dist/contract.js +25 -0
  41. package/views/dist/controls/alert-dialog/alert-dialog.js +2 -1
  42. package/views/dist/controls/atoms.d.ts +2 -0
  43. package/views/dist/controls/atoms.js +2 -0
  44. package/views/dist/controls/avatar/avatar.d.ts +10 -4
  45. package/views/dist/controls/avatar/avatar.js +5 -3
  46. package/views/dist/controls/avatar/tokens.d.ts +104 -0
  47. package/views/dist/controls/avatar/tokens.js +26 -0
  48. package/views/dist/controls/avatar.css +46 -15
  49. package/views/dist/controls/choice/tokens.d.ts +0 -4
  50. package/views/dist/controls/choice/tokens.js +0 -1
  51. package/views/dist/controls/choice.css +3 -3
  52. package/views/dist/controls/controls.d.ts +6 -0
  53. package/views/dist/controls/controls.js +10 -2
  54. package/views/dist/controls/customize/map-customize-body.js +1 -1
  55. package/views/dist/controls/field/field.d.ts +19 -4
  56. package/views/dist/controls/field/field.js +63 -5
  57. package/views/dist/controls/field/tokens.d.ts +4 -0
  58. package/views/dist/controls/field/tokens.js +1 -0
  59. package/views/dist/controls/field.css +41 -16
  60. package/views/dist/controls/glyphs/glyphs.d.ts +10 -0
  61. package/views/dist/controls/glyphs/glyphs.js +173 -0
  62. package/views/dist/controls/index.d.ts +4 -2
  63. package/views/dist/controls/index.js +3 -1
  64. package/views/dist/controls/input/input.d.ts +12 -1
  65. package/views/dist/controls/input/input.js +10 -6
  66. package/views/dist/controls/input/save-mark.d.ts +8 -0
  67. package/views/dist/controls/input/save-mark.js +26 -0
  68. package/views/dist/controls/input/tokens.d.ts +20 -0
  69. package/views/dist/controls/input/tokens.js +5 -0
  70. package/views/dist/controls/input.css +49 -3
  71. package/views/dist/controls/internal/icons.js +10 -0
  72. package/views/dist/controls/internal/keep-focus.d.ts +2 -0
  73. package/views/dist/controls/internal/keep-focus.js +17 -0
  74. package/views/dist/controls/internal/watch-frame.d.ts +2 -0
  75. package/views/dist/controls/internal/watch-frame.js +33 -0
  76. package/views/dist/controls/markdown/map-markdown.d.ts +4 -0
  77. package/views/dist/controls/markdown/map-markdown.js +5 -0
  78. package/views/dist/controls/menu/map-menu.js +2 -2
  79. package/views/dist/controls/menu-list/menu-list.d.ts +3 -0
  80. package/views/dist/controls/menu-list/menu-list.js +5 -4
  81. package/views/dist/controls/modal/modal.js +5 -1
  82. package/views/dist/controls/pane/pane.js +2 -1
  83. package/views/dist/controls/phone-header/header-bar.d.ts +5 -1
  84. package/views/dist/controls/phone-header/header-bar.js +2 -2
  85. package/views/dist/controls/phone-header.css +11 -1
  86. package/views/dist/controls/picker/map-picker.js +3 -0
  87. package/views/dist/controls/picker/picker.d.ts +14 -0
  88. package/views/dist/controls/picker/picker.js +30 -10
  89. package/views/dist/controls/picker.css +2 -0
  90. package/views/dist/controls/popover/popover.js +2 -1
  91. package/views/dist/controls/radio/radio.d.ts +12 -3
  92. package/views/dist/controls/radio/radio.js +25 -5
  93. package/views/dist/controls/radio/tokens.d.ts +84 -0
  94. package/views/dist/controls/radio/tokens.js +21 -0
  95. package/views/dist/controls/radio.css +130 -3
  96. package/views/dist/controls/select/select.d.ts +12 -2
  97. package/views/dist/controls/select/select.js +15 -7
  98. package/views/dist/controls/select/tokens.d.ts +8 -0
  99. package/views/dist/controls/select/tokens.js +2 -0
  100. package/views/dist/controls/select.css +17 -0
  101. package/views/dist/controls/setting-row/looks.d.ts +10 -0
  102. package/views/dist/controls/setting-row/looks.js +22 -0
  103. package/views/dist/controls/setting-row/setting-row.d.ts +100 -0
  104. package/views/dist/controls/setting-row/setting-row.js +133 -0
  105. package/views/dist/controls/setting-row/tokens.d.ts +156 -0
  106. package/views/dist/controls/setting-row/tokens.js +41 -0
  107. package/views/dist/controls/setting-row.css +215 -0
  108. package/views/dist/controls/sheet/bottom-sheet.d.ts +10 -2
  109. package/views/dist/controls/sheet/bottom-sheet.js +6 -3
  110. package/views/dist/controls/sheet.css +4 -1
  111. package/views/dist/controls/sort-editor/sort-editor.js +3 -2
  112. package/views/dist/controls/sort-editor.css +8 -2
  113. package/views/dist/controls/switch-row/switch-row.d.ts +1 -15
  114. package/views/dist/controls/switch-row/switch-row.js +1 -9
  115. package/views/dist/controls/switch-row/tokens.d.ts +0 -12
  116. package/views/dist/controls/switch-row/tokens.js +0 -3
  117. package/views/dist/controls/switch-row.css +3 -7
  118. package/views/dist/controls/switch.css +17 -7
  119. package/views/dist/controls/tag/tag.d.ts +3 -1
  120. package/views/dist/controls/tag/tag.js +2 -2
  121. package/views/dist/controls/tag/tokens.d.ts +4 -0
  122. package/views/dist/controls/tag/tokens.js +1 -0
  123. package/views/dist/controls/tag-field/tag-field.d.ts +5 -1
  124. package/views/dist/controls/tag-field/tag-field.js +11 -5
  125. package/views/dist/controls/tag-field/tokens.d.ts +16 -0
  126. package/views/dist/controls/tag-field/tokens.js +4 -0
  127. package/views/dist/controls/tag-field.css +19 -0
  128. package/views/dist/controls/tag.css +2 -0
  129. package/views/dist/controls/tokens.js +2 -0
  130. package/views/dist/controls/toolbar/toolbar.d.ts +15 -3
  131. package/views/dist/controls/toolbar/toolbar.js +22 -15
  132. package/views/dist/controls/toolbar-button/atom-toolbar-button.d.ts +14 -0
  133. package/views/dist/controls/toolbar-button/atom-toolbar-button.js +51 -0
  134. package/views/dist/controls/toolbar-button/toolbar-button.d.ts +1 -1
  135. package/views/dist/controls/toolbar-button/toolbar-button.js +2 -3
  136. package/views/dist/controls/toolbar-button.css +4 -0
  137. package/views/dist/controls/toolbar.css +5 -0
  138. package/views/dist/controls/views-list/map-view-menu.d.ts +3 -0
  139. package/views/dist/controls/views-list/map-view-menu.js +25 -0
  140. package/views/dist/controls/views-list/map-views-list-body.d.ts +28 -1
  141. package/views/dist/controls/views-list/map-views-list-body.js +39 -21
  142. package/views/dist/controls/views-list/rules.d.ts +2 -0
  143. package/views/dist/controls/views-list/view-menu.d.ts +7 -0
  144. package/views/dist/controls/views-list/view-menu.js +28 -24
  145. package/views/dist/controls/views-list/words.d.ts +2 -0
  146. package/views/dist/controls/views-list/words.js +1 -1
  147. package/views/dist/editors/EditorPanel.js +2 -1
  148. package/views/dist/editors/edit-session.js +2 -5
  149. package/views/dist/field-row/FieldRow.d.ts +4 -2
  150. package/views/dist/field-row/FieldRow.js +67 -20
  151. package/views/dist/field-row/FieldRowLane.d.ts +7 -2
  152. package/views/dist/field-row/FieldRowLane.js +4 -3
  153. package/views/dist/field-row/editors/RowEditor.d.ts +12 -0
  154. package/views/dist/field-row/editors/RowEditor.js +31 -1
  155. package/views/dist/field-row/editors/RowValueListEditor.d.ts +5 -1
  156. package/views/dist/field-row/editors/RowValueListEditor.js +4 -1
  157. package/views/dist/field-row/field-row-button.d.ts +5 -0
  158. package/views/dist/field-row/field-row-button.js +2 -0
  159. package/views/dist/fields/binding.d.ts +3 -2
  160. package/views/dist/fields/binding.js +38 -5
  161. package/views/dist/grid/chrome/GridColumnMenu.d.ts +4 -2
  162. package/views/dist/grid/chrome/GridColumnMenu.js +3 -2
  163. package/views/dist/grid/chrome/GridGroupMenu.d.ts +4 -1
  164. package/views/dist/grid/chrome/GridGroupMenu.js +4 -3
  165. package/views/dist/grid/chrome/GridHeader.d.ts +4 -1
  166. package/views/dist/grid/chrome/GridHeader.js +2 -2
  167. package/views/dist/grid/chrome/GridRow.js +6 -5
  168. package/views/dist/grid/chrome/GridRowCells.js +6 -9
  169. package/views/dist/grid/chrome/GridStructure.d.ts +4 -1
  170. package/views/dist/grid/chrome/GridStructure.js +4 -4
  171. package/views/dist/grid/chrome/GridTable.js +5 -2
  172. package/views/dist/grid/chrome/grid-column-menu-items.js +1 -1
  173. package/views/dist/grid/chrome/grid-row-menu-items.d.ts +27 -3
  174. package/views/dist/grid/chrome/grid-row-menu-items.js +92 -6
  175. package/views/dist/grid/chrome/grid-row-props.d.ts +7 -2
  176. package/views/dist/grid/chrome/grid-rows-menu.js +34 -6
  177. package/views/dist/grid/chrome/grid-table-props.d.ts +38 -7
  178. package/views/dist/grid/chrome/useGridBatchApi.d.ts +3 -1
  179. package/views/dist/grid/chrome/useGridBatchApi.js +4 -2
  180. package/views/dist/grid/chrome/useGridKeyboard.d.ts +4 -2
  181. package/views/dist/grid/chrome/useGridKeyboard.js +15 -9
  182. package/views/dist/grid/chrome/useGridPendingReconciliation.js +1 -2
  183. package/views/dist/grid/chrome/useGridTableInteractionModel.d.ts +1 -1
  184. package/views/dist/grid/chrome/useGridTableInteractionModel.js +11 -5
  185. package/views/dist/grid/core/commit-model.d.ts +20 -2
  186. package/views/dist/grid/core/editing-controller.d.ts +18 -0
  187. package/views/dist/grid/core/editing-controller.js +188 -42
  188. package/views/dist/grid/core/editing-model.d.ts +3 -0
  189. package/views/dist/grid/core/editing-model.js +3 -0
  190. package/views/dist/grid/core/save-path.d.ts +24 -0
  191. package/views/dist/grid/core/save-path.js +122 -0
  192. package/views/dist/grid/core/spreadsheet-operations.d.ts +3 -0
  193. package/views/dist/grid/core/spreadsheet-operations.js +23 -0
  194. package/views/dist/grid/index.d.ts +3 -2
  195. package/views/dist/grid/index.js +1 -0
  196. package/views/dist/internal/field-rows.d.ts +26 -0
  197. package/views/dist/internal/field-rows.js +8 -0
  198. package/views/dist/internal/page-close.d.ts +7 -0
  199. package/views/dist/internal/page-close.js +43 -0
  200. package/views/dist/list/browser-views-store.d.ts +10 -0
  201. package/views/dist/list/browser-views-store.js +182 -0
  202. package/views/dist/list/index.d.ts +23 -0
  203. package/views/dist/list/index.js +8 -0
  204. package/views/dist/list/menu.d.ts +31 -0
  205. package/views/dist/list/menu.js +76 -0
  206. package/views/dist/list/parts.d.ts +6 -0
  207. package/views/dist/list/parts.js +59 -0
  208. package/views/dist/list/registry.d.ts +11 -0
  209. package/views/dist/list/registry.js +31 -0
  210. package/views/dist/list/root.d.ts +40 -0
  211. package/views/dist/list/root.js +128 -0
  212. package/views/dist/list/slot.d.ts +14 -0
  213. package/views/dist/list/slot.js +22 -0
  214. package/views/dist/list/source.d.ts +11 -0
  215. package/views/dist/list/source.js +31 -0
  216. package/views/dist/list/store.d.ts +87 -0
  217. package/views/dist/list/store.js +115 -0
  218. package/views/dist/list/toolbar.d.ts +6 -0
  219. package/views/dist/list/toolbar.js +359 -0
  220. package/views/dist/list/views-axis.d.ts +5 -0
  221. package/views/dist/list/views-axis.js +96 -0
  222. package/views/dist/list/views-store.d.ts +41 -0
  223. package/views/dist/list/views-store.js +1 -0
  224. package/views/dist/list/views.d.ts +67 -0
  225. package/views/dist/list/views.js +400 -0
  226. package/views/dist/looks/index.d.ts +1 -0
  227. package/views/dist/looks/index.js +1 -0
  228. package/views/dist/looks/pieces.js +2 -0
  229. package/views/dist/model/preferences.js +1 -1
  230. package/views/dist/model/prefs-buckets.js +1 -1
  231. package/views/dist/panels/index.d.ts +3 -1
  232. package/views/dist/panels/index.js +1 -0
  233. package/views/dist/panels/react/customize-body.js +1 -0
  234. package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +41 -4
  235. package/views/dist/panels/react/toolbar/ReadyToolbar.js +6 -326
  236. package/views/dist/panels/react/toolbar/Toolbar.d.ts +9 -1
  237. package/views/dist/panels/react/toolbar/Toolbar.js +34 -23
  238. package/views/dist/panels/react/toolbar/ToolbarButton.js +4 -1
  239. package/views/dist/panels/react/toolbar/ToolbarNew.js +1 -1
  240. package/views/dist/panels/react/toolbar/ToolbarQuickFilters.d.ts +2 -2
  241. package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +3 -1
  242. package/views/dist/panels/react/toolbar/ToolbarSearch.js +1 -1
  243. package/views/dist/panels/react/toolbar/context.d.ts +10 -2
  244. package/views/dist/panels/react/toolbar/context.js +3 -1
  245. package/views/dist/panels/react/views-row/FoldingViewRow.d.ts +1 -1
  246. package/views/dist/panels/react/views-row/FoldingViewRow.js +15 -4
  247. package/views/dist/panels/react/views-row/PillGroup.d.ts +5 -2
  248. package/views/dist/panels/react/views-row/PillGroup.js +16 -7
  249. package/views/dist/panels/react/views-row/ViewPicker.js +2 -12
  250. package/views/dist/panels/react/views-row/ViewPickerRow.d.ts +4 -2
  251. package/views/dist/panels/react/views-row/ViewPickerRow.js +9 -5
  252. package/views/dist/panels/react.d.ts +2 -2
  253. package/views/dist/panels/toolbar/edit-view.d.ts +7 -1
  254. package/views/dist/panels/toolbar/edit-view.js +14 -0
  255. package/views/dist/panels/toolbar/model.d.ts +5 -0
  256. package/views/dist/panels/toolbar/model.js +7 -3
  257. package/views/dist/panels/view-state.d.ts +5 -3
  258. package/views/dist/panels/views-row/model.d.ts +19 -2
  259. package/views/dist/panels/views-row/model.js +14 -0
  260. package/views/dist/provider/ViewsProvider.d.ts +16 -7
  261. package/views/dist/provider/ViewsProvider.js +23 -5
  262. package/views/dist/provider/components.d.ts +43 -2
  263. package/views/dist/provider/context.d.ts +2 -1
  264. package/views/dist/provider/context.js +1 -1
  265. package/views/dist/provider/ports.d.ts +19 -12
  266. package/views/dist/provider/ports.js +69 -1
  267. package/views/dist/react.d.ts +1 -1
  268. package/views/dist/styles.css +583 -61
  269. package/views/dist/styles.unlayered.css +583 -61
  270. package/views/docs/contract.md +42 -31
  271. package/views/docs/controls/avatar.md +26 -0
  272. package/views/docs/controls/choice.md +0 -1
  273. package/views/docs/controls/field.md +3 -0
  274. package/views/docs/controls/input.md +9 -0
  275. package/views/docs/controls/radio.md +33 -0
  276. package/views/docs/controls/select.md +6 -0
  277. package/views/docs/controls/setting-row.md +44 -0
  278. package/views/docs/controls/switch-row.md +0 -3
  279. package/views/docs/controls/tag-field.md +4 -0
  280. package/views/docs/controls/tag.md +1 -0
  281. package/views/docs/getting-started.md +2 -2
  282. package/views/docs/guides/atoms.md +2 -2
  283. package/views/docs/guides/columns.md +1 -1
  284. package/views/docs/guides/ports.md +1 -1
  285. package/views/docs/guides/the-grid.md +34 -7
  286. package/views/docs/guides/the-provider.md +4 -2
  287. package/views/docs/index.md +1 -0
  288. package/views/docs/reference/controls.md +54 -27
  289. package/views/docs/reference/editors-session.md +1 -1
  290. package/views/docs/reference/field-row.md +9 -1
  291. package/views/docs/reference/grid.md +14 -8
  292. package/views/docs/reference/list.md +227 -0
  293. package/views/docs/reference/looks.md +3 -0
  294. package/views/docs/reference/panels-react.md +17 -12
  295. package/views/docs/reference/panels.md +8 -5
  296. package/views/docs/reference/react.md +11 -9
  297. package/views/docs/reference/views.md +2 -2
  298. package/views/skills/views/SKILL.md +9 -6
@@ -1,9 +1,11 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
+ import { createPortal } from "react-dom";
3
4
  import { Field as BaseField } from "@base-ui/react/field";
4
5
  import { Fieldset as BaseFieldset } from "@base-ui/react/fieldset";
5
6
  import { FieldRootContext, useFieldRootContext } from "@base-ui/react/internals/field-root-context";
6
7
  import { cx } from "../../internal/cx.js";
8
+ import { AtSettingRowEnd, FieldRowsCardContext, InFieldRow, OutOfFieldRows, SettingRowField } from "../../internal/field-rows.js";
7
9
  import { phoneMark, usePhoneForm } from "../internal/phone.js";
8
10
  import { fieldRowsAttrs } from "./looks.js";
9
11
  export function errorsOf(error) {
@@ -13,10 +15,27 @@ export function errorsOf(error) {
13
15
  export function ErrorWords({ errors }) {
14
16
  return errors.length > 1 ? _jsx("ul", { className: "o-field-errors", children: errors.map((e, i) => _jsx("li", { children: e }, i)) }) : _jsx(_Fragment, { children: errors[0] });
15
17
  }
16
- export function Field({ label, required = false, note, error, keepNote = false, orientation = "vertical", disabled, nativeLabel = true, labelId, quietLabel = false, form, className, children }) {
18
+ export function Field(props) {
19
+ const card = React.useContext(FieldRowsCardContext), settingRow = React.useContext(SettingRowField);
20
+ return card ? _jsx(FieldAsRow, { ...props, card: card }) : settingRow ? _jsx(FieldAsSettingRow, { ...props }) : _jsx(FieldBox, { ...props });
21
+ }
22
+ function FieldAsSettingRow({ label, required = false, note, error, keepNote = false, disabled, nativeLabel = true, labelId, className, children }) {
23
+ const errors = errorsOf(error), invalid = errors.length > 0, name = typeof label === "string" ? label : undefined;
24
+ const end = React.useMemo(() => ({ name }), [name]);
25
+ return (_jsxs(BaseField.Root, { className: cx("o-setting-row o-setting-row-field", className), "data-setting-row-kind": "field", invalid: invalid, disabled: disabled, "data-kit": "field", children: [_jsxs("span", { className: "o-choice-text", children: [label != null && _jsxs(BaseField.Label, { className: "o-choice-label", id: labelId, ...(nativeLabel ? {} : { nativeLabel: false, render: _jsx("span", {}) }), children: [label, required && _jsx("span", { className: "o-field-req", "aria-hidden": "true", children: "*" })] }), note != null && (!invalid || keepNote) && _jsx(BaseField.Description, { className: "o-choice-note", children: note }), invalid && _jsx(BaseField.Error, { className: "o-choice-note o-setting-row-error", match: true, children: _jsx(ErrorWords, { errors: errors }) })] }), _jsx("span", { className: "o-setting-row-end", children: _jsx(SettingRowField.Provider, { value: false, children: _jsx(AtSettingRowEnd.Provider, { value: end, children: children }) }) })] }));
26
+ }
27
+ const useBeforePaint = typeof window === "undefined" ? React.useEffect : React.useLayoutEffect;
28
+ function FieldAsRow({ card, label, required = false, note, error, disabled, nativeLabel = true, labelId, className, children }) {
29
+ const errors = errorsOf(error), invalid = errors.length > 0, device = usePhoneForm();
30
+ const id = React.useId(), noted = note != null && !invalid, wants = noted || invalid, { enter, need, slot } = card, at = slot(id);
31
+ useBeforePaint(() => enter(id), [enter, id]);
32
+ useBeforePaint(() => { need(id, wants); return () => need(id, false); }, [need, id, wants]);
33
+ return (_jsxs(BaseField.Root, { className: cx("o-field o-field-row", className), "data-field-in": "rows", ...phoneMark(device), invalid: invalid, disabled: disabled, "data-kit": "field", children: [label != null && _jsxs(BaseField.Label, { className: "o-field-row-label", id: labelId, ...(nativeLabel ? {} : { nativeLabel: false, render: _jsx("span", {}) }), children: [label, required && _jsx("span", { className: "o-field-req", "aria-hidden": "true", children: "*" })] }), _jsx(FieldRowsCardContext.Provider, { value: null, children: _jsx(InFieldRow.Provider, { value: true, children: children }) }), at && wants && createPortal(_jsxs(_Fragment, { children: [noted && _jsx(BaseField.Description, { className: "o-field-note", children: note }), invalid && _jsx(BaseField.Error, { className: "o-field-error", match: true, children: _jsx(ErrorWords, { errors: errors }) })] }), at)] }));
34
+ }
35
+ function FieldBox({ label, required = false, note, error, keepNote = false, orientation = "vertical", disabled, nativeLabel = true, labelId, quietLabel = false, form, className, children }) {
17
36
  const errors = errorsOf(error), invalid = errors.length > 0;
18
- const phone = usePhoneForm(form), device = usePhoneForm();
19
- return (_jsxs(BaseField.Root, { className: cx("o-field", className), "data-orientation": orientation === "vertical" ? undefined : orientation, "data-field-label": quietLabel ? "quiet" : undefined, "data-field-form": quietLabel && phone ? "phone" : undefined, ...phoneMark(device), invalid: invalid, disabled: disabled, "data-kit": "field", children: [label != null && _jsxs(BaseField.Label, { className: "o-field-label", id: labelId, ...(nativeLabel ? {} : { nativeLabel: false, render: _jsx("span", {}) }), children: [label, required && _jsx("span", { className: "o-field-req", "aria-hidden": "true", children: "*" })] }), children, note != null && (!invalid || keepNote) && _jsx(BaseField.Description, { className: "o-field-note", children: note }), invalid && _jsx(BaseField.Error, { className: "o-field-error", match: true, children: _jsx(ErrorWords, { errors: errors }) })] }));
37
+ const phone = usePhoneForm(form), device = usePhoneForm(), inRow = React.useContext(InFieldRow);
38
+ return (_jsxs(BaseField.Root, { className: cx("o-field", className), "data-orientation": orientation === "vertical" ? undefined : orientation, "data-field-label": quietLabel ? "quiet" : undefined, "data-field-form": quietLabel && phone ? "phone" : undefined, ...phoneMark(device), invalid: invalid, disabled: disabled, "data-kit": "field", children: [label != null && _jsxs(BaseField.Label, { className: "o-field-label", id: labelId, ...(nativeLabel ? {} : { nativeLabel: false, render: _jsx("span", {}) }), children: [label, required && _jsx("span", { className: "o-field-req", "aria-hidden": "true", children: "*" })] }), inRow ? _jsx(InFieldRow.Provider, { value: false, children: children }) : children, note != null && (!invalid || keepNote) && _jsx(BaseField.Description, { className: "o-field-note", children: note }), invalid && _jsx(BaseField.Error, { className: "o-field-error", match: true, children: _jsx(ErrorWords, { errors: errors }) })] }));
20
39
  }
21
40
  function SetDisabled({ disabled, children }) {
22
41
  const outer = useFieldRootContext();
@@ -34,10 +53,49 @@ export function FieldSeparator({ children, className }) {
34
53
  return (_jsxs("div", { className: cx("o-field-sep", className), role: "separator", children: [_jsx("span", { className: "o-field-sep-line" }), children != null && _jsxs(_Fragment, { children: [_jsx("span", { className: "o-field-sep-words", children: children }), _jsx("span", { className: "o-field-sep-line" })] })] }));
35
54
  }
36
55
  export function FieldRows({ look, className, children, ...props }) {
37
- return _jsx("div", { className: cx("o-field-rows", className), "data-kit": "field", ...(look ? fieldRowsAttrs(look) : {}), ...props, children: children });
56
+ const { card, foot } = useFieldRowsCard();
57
+ return (_jsxs(FieldRowsCardContext.Provider, { value: card, children: [_jsx("div", { className: cx("o-field-rows", className), "data-kit": "field", ...(look ? fieldRowsAttrs(look) : {}), ...props, children: children }), foot] }));
58
+ }
59
+ export function useFieldRowsCard() {
60
+ const [order, setOrder] = React.useState([]);
61
+ const [needs, setNeeds] = React.useState(() => new Set());
62
+ const [slots, setSlots] = React.useState(() => new Map());
63
+ const enter = React.useCallback((id) => {
64
+ setOrder((was) => (was.includes(id) ? was : [...was, id]));
65
+ return () => setOrder((was) => was.filter((x) => x !== id));
66
+ }, []);
67
+ const need = React.useCallback((id, on) => setNeeds((was) => {
68
+ if (was.has(id) === on)
69
+ return was;
70
+ const now = new Set(was);
71
+ if (on)
72
+ now.add(id);
73
+ else
74
+ now.delete(id);
75
+ return now;
76
+ }), []);
77
+ const place = React.useCallback((id, el) => setSlots((was) => {
78
+ if ((was.get(id) ?? null) === el)
79
+ return was;
80
+ const now = new Map(was);
81
+ if (el)
82
+ now.set(id, el);
83
+ else
84
+ now.delete(id);
85
+ return now;
86
+ }), []);
87
+ const slot = React.useCallback((id) => slots.get(id) ?? null, [slots]);
88
+ const card = React.useMemo(() => ({ enter, need, slot }), [enter, need, slot]);
89
+ const shown = order.filter((id) => needs.has(id));
90
+ const foot = shown.length > 0 ? _jsx("div", { className: "o-field-rows-foot", children: shown.map((id) => _jsx(FootSlot, { id: id, place: place }, id)) }) : null;
91
+ return { card, foot };
92
+ }
93
+ function FootSlot({ id, place }) {
94
+ const ref = React.useCallback((el) => place(id, el), [id, place]);
95
+ return _jsx("span", { className: "o-field-rows-slot", ref: ref });
38
96
  }
39
97
  export const FieldRowsRow = React.forwardRef(function FieldRowsRow({ as = "label", label, labelClassName, required = false, className, children, ...props }, ref) {
40
- const inner = _jsxs(_Fragment, { children: [label != null && _jsxs("span", { className: cx("o-field-row-label", labelClassName), children: [label, required && _jsx("span", { className: "o-field-req", "aria-hidden": "true", children: "*" })] }), children] });
98
+ const inner = _jsxs(_Fragment, { children: [label != null && _jsxs("span", { className: cx("o-field-row-label", labelClassName), children: [label, required && _jsx("span", { className: "o-field-req", "aria-hidden": "true", children: "*" })] }), _jsx(OutOfFieldRows, { children: children })] });
41
99
  const cls = cx("o-field-row", className);
42
100
  if (as === "button")
43
101
  return _jsx("button", { ref: ref, type: "button", className: cls, ...props, children: inner });
@@ -26,6 +26,10 @@ export declare const FIELD_TOKENS: readonly [{
26
26
  readonly name: "--vk-fg-subtle";
27
27
  readonly kind: "colour";
28
28
  readonly outright: "--text-subtle";
29
+ }, {
30
+ readonly name: "--vk-fg-subtlest";
31
+ readonly kind: "colour";
32
+ readonly outright: "--text-subtlest";
29
33
  }, {
30
34
  readonly name: "--vk-font-size-base";
31
35
  readonly kind: "size";
@@ -6,6 +6,7 @@ export const FIELD_TOKENS = [
6
6
  { name: "--vk-fg", kind: "colour", outright: "--text" },
7
7
  { name: "--vk-fg-disabled", kind: "colour", outright: "--text-disabled" },
8
8
  { name: "--vk-fg-subtle", kind: "colour", outright: "--text-subtle" },
9
+ { name: "--vk-fg-subtlest", kind: "colour", outright: "--text-subtlest" },
9
10
  { name: "--vk-font-size-base", kind: "size", outright: "--text-base" },
10
11
  { name: "--vk-font-size-sm", kind: "size", outright: "--text-sm" },
11
12
  { name: "--vk-font-size-xs", kind: "size", outright: "--text-xs" },
@@ -51,27 +51,31 @@
51
51
  Each option, on a frame or on the card itself (the look its place hands it, whole, which wins), sets the card's and
52
52
  its rows' variables; nothing set is Card: one card on the overlay's card ground, its edge, rows 52, the label 104, the line
53
53
  between rows from the words. What stands inside a row and where is its place's: a place may set a row's inset and gap. A row
54
- typed into shows the caret alone. */
55
- [data-field-rows-edge="on"] { --field-rows-edge: var(--vk-border-width) solid var(--vk-border-subtle); }
56
- [data-field-rows-edge="off"] { --field-rows-edge: 0 none; }
57
- [data-field-rows-cards="one"] {
54
+ typed into shows the caret alone. Each option is declared again on every card under its pick that carries no pick of its own, so
55
+ the card resolves its colours, edge and corners where it stands, and a place that sets a token again round it (a settings group
56
+ on a phone, its white ground) reaches it. A place may stop a row's rule --field-rows-line-end short of its right edge. A row may
57
+ open with a glyph lane, 20 wide, its glyph centred; a row holding one starts its rule from the words, after the lane and the gap
58
+ (--field-rows-line-start, the lane and the 12 gap: a place that sets another gap sets it too). A label's one long word breaks. */
59
+ [data-field-rows-edge="on"], :where([data-field-rows-edge="on"]) .o-field-rows:not([data-field-rows-edge]) { --field-rows-edge: var(--vk-border-width) solid var(--vk-border-subtle); }
60
+ [data-field-rows-edge="off"], :where([data-field-rows-edge="off"]) .o-field-rows:not([data-field-rows-edge]) { --field-rows-edge: 0 none; }
61
+ [data-field-rows-cards="one"], :where([data-field-rows-cards="one"]) .o-field-rows:not([data-field-rows-cards]) {
58
62
  --field-rows-card-display: block; --field-rows-card-gap: 0px; --field-rows-card-overflow: hidden; --field-rows-card-edge: var(--field-rows-edge);
59
63
  --field-rows-card-corners: var(--vk-radius-xl); --field-rows-card-ground: var(--vk-overlay-card);
60
64
  --field-rows-row-edge: 0 none; --field-rows-row-corners: 0px; --field-rows-row-ground: transparent;
61
65
  }
62
- [data-field-rows-cards="each"] {
66
+ [data-field-rows-cards="each"], :where([data-field-rows-cards="each"]) .o-field-rows:not([data-field-rows-cards]) {
63
67
  --field-rows-card-display: grid; --field-rows-card-gap: calc(var(--vk-spacing) * 2.5); --field-rows-card-overflow: visible; --field-rows-card-edge: 0 none;
64
68
  --field-rows-card-corners: 0px; --field-rows-card-ground: transparent;
65
69
  --field-rows-row-edge: var(--field-rows-edge); --field-rows-row-corners: var(--vk-radius-xl); --field-rows-row-ground: var(--vk-overlay-card);
66
70
  }
67
- [data-field-rows-height="48"] { --field-rows-row: calc(var(--vk-spacing) * 12); }
68
- [data-field-rows-height="52"] { --field-rows-row: calc(var(--vk-spacing) * 13); }
69
- [data-field-rows-height="56"] { --field-rows-row: calc(var(--vk-spacing) * 14); }
70
- [data-field-rows-label="104"] { --field-rows-label: block; }
71
- [data-field-rows-label="none"] { --field-rows-label: none; }
72
- [data-field-rows-lines="words"] { --field-rows-line-image: linear-gradient(var(--vk-border-overlay-card), var(--vk-border-overlay-card)); --field-rows-line-shadow: none; }
73
- [data-field-rows-lines="across"] { --field-rows-line-image: none; --field-rows-line-shadow: inset 0 var(--vk-border-width) 0 var(--vk-border-overlay-card); }
74
- [data-field-rows-lines="none"] { --field-rows-line-image: none; --field-rows-line-shadow: none; }
71
+ [data-field-rows-height="48"], :where([data-field-rows-height="48"]) .o-field-rows:not([data-field-rows-height]) { --field-rows-row: calc(var(--vk-spacing) * 12); }
72
+ [data-field-rows-height="52"], :where([data-field-rows-height="52"]) .o-field-rows:not([data-field-rows-height]) { --field-rows-row: calc(var(--vk-spacing) * 13); }
73
+ [data-field-rows-height="56"], :where([data-field-rows-height="56"]) .o-field-rows:not([data-field-rows-height]) { --field-rows-row: calc(var(--vk-spacing) * 14); }
74
+ [data-field-rows-label="104"], :where([data-field-rows-label="104"]) .o-field-rows:not([data-field-rows-label]) { --field-rows-label: block; }
75
+ [data-field-rows-label="none"], :where([data-field-rows-label="none"]) .o-field-rows:not([data-field-rows-label]) { --field-rows-label: none; }
76
+ [data-field-rows-lines="words"], :where([data-field-rows-lines="words"]) .o-field-rows:not([data-field-rows-lines]) { --field-rows-line-image: linear-gradient(var(--vk-border-overlay-card), var(--vk-border-overlay-card)); --field-rows-line-shadow: none; }
77
+ [data-field-rows-lines="across"], :where([data-field-rows-lines="across"]) .o-field-rows:not([data-field-rows-lines]) { --field-rows-line-image: none; --field-rows-line-shadow: inset 0 var(--vk-border-width) 0 var(--vk-border-overlay-card); }
78
+ [data-field-rows-lines="none"], :where([data-field-rows-lines="none"]) .o-field-rows:not([data-field-rows-lines]) { --field-rows-line-image: none; --field-rows-line-shadow: none; }
75
79
 
76
80
  .o-field-rows {
77
81
  display: var(--field-rows-card-display, block); grid-template-columns: minmax(0, 1fr); gap: var(--field-rows-card-gap, 0px); min-width: 0;
@@ -85,8 +89,29 @@
85
89
  }
86
90
  button.o-field-row { cursor: pointer; }
87
91
  .o-field-row + .o-field-row {
88
- background-image: var(--field-rows-line-image, linear-gradient(var(--vk-border-overlay-card), var(--vk-border-overlay-card))); background-size: calc(100% - var(--vk-spacing) * 4) var(--vk-border-width);
89
- background-position: calc(var(--vk-spacing) * 4) 0; background-repeat: no-repeat; box-shadow: var(--field-rows-line-shadow, none);
92
+ background-image: var(--field-rows-line-image, linear-gradient(var(--vk-border-overlay-card), var(--vk-border-overlay-card))); background-size: calc(100% - var(--vk-spacing) * 4 - var(--field-rows-line-start, 0px) - var(--field-rows-line-end, 0px)) var(--vk-border-width);
93
+ background-position: calc(var(--vk-spacing) * 4 + var(--field-rows-line-start, 0px)) 0; background-repeat: no-repeat; box-shadow: var(--field-rows-line-shadow, none);
90
94
  }
91
- .o-field-row-label { display: var(--field-rows-label, block); flex: none; width: calc(var(--vk-spacing) * 26); color: var(--vk-fg-subtle); }
95
+ .o-field-row-label { display: var(--field-rows-label, block); flex: none; width: calc(var(--vk-spacing) * 26); color: var(--vk-fg-subtle); overflow-wrap: anywhere; }
96
+ .o-field-row-glyph {
97
+ display: flex; flex: none; align-items: center; justify-content: center; width: calc(var(--vk-spacing) * 5);
98
+ }
99
+ .o-field-row:has(> .o-field-row-glyph) { --field-rows-line-start: calc(var(--vk-spacing) * 8); }
100
+
101
+ /* ── A Field placed in Field rows is the card's row (VK-960; the settings canvas, round 3: look-ios.mjs .fl, .fv, .nt): its label
102
+ in the row's column, its control typed in place beside it (input.css, In a row of Field rows), the value 116 in from the row's
103
+ words (the label's 104 and the row's 12). Its note and error stand under the card, in the foot FieldRows draws after it while
104
+ any Field in it has one: 7 under the card, inset 16 as the rows' words, small and in the quietest text, the notes running on
105
+ as one note; an error in the danger colour, standing in place of every note. ─────────────────────────────────────────── */
106
+ .o-field.o-field-row { display: flex; gap: calc(var(--vk-spacing) * 3); }
107
+ .o-field-rows-foot {
108
+ margin: 0; padding: calc(var(--vk-spacing) * 1.75) calc(var(--vk-spacing) * 4) 0; overflow-wrap: anywhere;
109
+ font-size: var(--vk-font-size-xs); line-height: calc(var(--vk-font-size-xs) * var(--vk-line-height-xs)); color: var(--vk-fg-subtlest);
110
+ }
111
+ /* Each Field's place in it, in its row's order, standing as its words only: they run on, a space between. */
112
+ .o-field-rows-slot { display: contents; }
113
+ .o-field-rows-slot > * { display: inline; color: inherit; }
114
+ .o-field-rows-slot + .o-field-rows-slot::before { content: " "; }
115
+ .o-field-rows-slot > .o-field-error { color: var(--vk-danger); }
116
+ .o-field-rows-foot:has(.o-field-error) .o-field-note { display: none; }
92
117
  }
@@ -0,0 +1,10 @@
1
+ import type { ViewsIcons } from "../../provider/icons.js";
2
+ /** ViewKit's default glyphs by meaning: what `CONTROLS.AppIcon` draws, and what an app with an `AppIcon` of its own hands
3
+ * as `icons` to keep them. */
4
+ export declare const CONTROL_ICONS: ViewsIcons;
5
+ /** The components map's default `AppIcon`: ViewKit's glyph of that name, and nothing for a name it doesn't draw. A
6
+ * provider handed no `icons` draws every meaning through it. */
7
+ export declare function MapAppIcon({ name, className }: {
8
+ name: string;
9
+ className?: string;
10
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,173 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Spinner } from "../spinner/spinner.js";
4
+ function glyph(paths, filled = false) {
5
+ return function ViewsGlyph({ className }) {
6
+ return (_jsx("svg", { className: className, viewBox: "0 0 24 24", fill: filled ? "currentColor" : "none", stroke: filled ? "none" : "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: paths.map((d) => _jsx("path", { d: d }, d)) }));
7
+ };
8
+ }
9
+ const IconAdjustments = glyph(["M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0", "M4 6l8 0", "M16 6l4 0", "M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0", "M4 12l2 0", "M10 12l10 0", "M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0", "M4 18l11 0", "M19 18l1 0"]);
10
+ const IconDotsVertical = glyph(["M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", "M11 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", "M11 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"]);
11
+ const IconLayout = glyph(["M4 4m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v1a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z", "M4 13m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v3a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z", "M14 4m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z"]);
12
+ const IconColumns = glyph(["M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z", "M12 4l0 16"]);
13
+ const IconDownload = glyph(["M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2", "M7 11l5 5l5 -5", "M12 4l0 12"]);
14
+ const IconShare = glyph(["M6 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0", "M18 6m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0", "M18 18m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0", "M8.7 10.7l6.6 -3.4", "M8.7 13.3l6.6 3.4"]);
15
+ const IconFilter = glyph(["M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z"]);
16
+ function ViewsLoading({ className }) {
17
+ return _jsx(Spinner, { className: className, label: "" });
18
+ }
19
+ const IconLetterT = glyph(["M6 4l12 0", "M12 4l0 16"]);
20
+ const IconAlignLeft = glyph(["M4 6l16 0", "M4 12l10 0", "M4 18l14 0"]);
21
+ const IconHash = glyph(["M5 9l14 0", "M5 15l14 0", "M11 4l-4 16", "M17 4l-4 16"]);
22
+ const IconPercentage = glyph(["M16 17a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", "M6 7a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", "M6 18l12 -12"]);
23
+ const IconCurrencyDollar = glyph(["M16.7 8a3 3 0 0 0 -2.7 -2h-4a3 3 0 0 0 0 6h4a3 3 0 0 1 0 6h-4a3 3 0 0 1 -2.7 -2", "M12 3v3m0 12v3"]);
24
+ const IconCalendar = glyph(["M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12", "M16 3v4", "M8 3v4", "M4 11h16", "M11 15h1", "M12 15v3"]);
25
+ const IconCalendarTime = glyph(["M11.795 21h-6.795a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v4", "M14 18a4 4 0 1 0 8 0a4 4 0 1 0 -8 0", "M15 3v4", "M7 3v4", "M3 11h16", "M18 16.496v1.504l1 1"]);
26
+ const IconHourglass = glyph(["M6.5 7h11", "M6.5 17h11", "M6 20v-2a6 6 0 1 1 12 0v2a1 1 0 0 1 -1 1h-10a1 1 0 0 1 -1 -1", "M6 4v2a6 6 0 1 0 12 0v-2a1 1 0 0 0 -1 -1h-10a1 1 0 0 0 -1 1"]);
27
+ const IconToggleLeft = glyph(["M6 12a2 2 0 1 0 4 0a2 2 0 1 0 -4 0", "M2 12a6 6 0 0 1 6 -6h8a6 6 0 0 1 6 6a6 6 0 0 1 -6 6h-8a6 6 0 0 1 -6 -6"]);
28
+ const IconSelector = glyph(["M8 9l4 -4l4 4", "M16 15l-4 4l-4 -4"]);
29
+ const IconCircleDot = glyph(["M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", "M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"]);
30
+ const IconTags = glyph(["M3 8v4.172a2 2 0 0 0 .586 1.414l5.71 5.71a2.41 2.41 0 0 0 3.408 0l3.592 -3.592a2.41 2.41 0 0 0 0 -3.408l-5.71 -5.71a2 2 0 0 0 -1.414 -.586h-4.172a2 2 0 0 0 -2 2", "M18 19l1.592 -1.592a4.82 4.82 0 0 0 0 -6.816l-4.592 -4.592", "M7 10h-.01"]);
31
+ const IconArrowsLeftRight = glyph(["M21 17l-18 0", "M6 10l-3 -3l3 -3", "M3 7l18 0", "M18 20l3 -3l-3 -3"]);
32
+ const IconUser = glyph(["M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0", "M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2"]);
33
+ const IconLink = glyph(["M9 15l6 -6", "M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464", "M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463"]);
34
+ const IconWorld = glyph(["M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0", "M3.6 9h16.8", "M3.6 15h16.8", "M11.5 3a17 17 0 0 0 0 18", "M12.5 3a17 17 0 0 1 0 18"]);
35
+ const IconMail = glyph(["M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10", "M3 7l9 6l9 -6"]);
36
+ const IconPhone = glyph(["M5 4h4l2 5l-2.5 1.5a11 11 0 0 0 5 5l1.5 -2.5l5 2v4a2 2 0 0 1 -2 2a16 16 0 0 1 -15 -15a2 2 0 0 1 2 -2"]);
37
+ const IconMapPin = glyph(["M9 11a3 3 0 1 0 6 0a3 3 0 0 0 -6 0", "M17.657 16.657l-4.243 4.243a2 2 0 0 1 -2.827 0l-4.244 -4.243a8 8 0 1 1 11.314 0"]);
38
+ const IconId = glyph(["M3 7a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v10a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3l0 -10", "M7 10a2 2 0 1 0 4 0a2 2 0 1 0 -4 0", "M15 8l2 0", "M15 12l2 0", "M7 16l10 0"]);
39
+ const IconUserCircle = glyph(["M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0", "M9 10a3 3 0 1 0 6 0a3 3 0 1 0 -6 0", "M6.168 18.849a4 4 0 0 1 3.832 -2.849h4a4 4 0 0 1 3.834 2.855"]);
40
+ const IconTextCaption = glyph(["M4 15h16", "M4 5a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4", "M4 20h12"]);
41
+ const IconArrowsHorizontal = glyph(["M7 8l-4 4l4 4", "M17 8l4 4l-4 4", "M3 12l18 0"]);
42
+ const IconSearch = glyph(["M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0", "M21 21l-6 -6"]);
43
+ const IconSum = glyph(["M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2"]);
44
+ const IconMathFunction = glyph(["M3 19a2 2 0 0 0 2 2c2 0 2 -4 3 -9s1 -9 3 -9a2 2 0 0 1 2 2", "M5 12h6", "M15 12l6 6", "M15 18l6 -6"]);
45
+ const IconCalculator = glyph(["M4 5a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -14", "M8 8a1 1 0 0 1 1 -1h6a1 1 0 0 1 1 1v1a1 1 0 0 1 -1 1h-6a1 1 0 0 1 -1 -1l0 -1", "M8 14l0 .01", "M12 14l0 .01", "M16 14l0 .01", "M8 17l0 .01", "M12 17l0 .01", "M16 17l0 .01"]);
46
+ const IconBolt = glyph(["M13 3l0 7l6 0l-8 11l0 -7l-6 0l8 -11"]);
47
+ const IconKey = glyph(["M16.555 3.843l3.602 3.602a2.877 2.877 0 0 1 0 4.069l-2.643 2.643a2.877 2.877 0 0 1 -4.069 0l-.301 -.301l-6.558 6.558a2 2 0 0 1 -1.239 .578l-.175 .008h-1.172a1 1 0 0 1 -.993 -.883l-.007 -.117v-1.172a2 2 0 0 1 .467 -1.284l.119 -.13l.414 -.414h2v-2h2v-2l2.144 -2.144l-.301 -.301a2.877 2.877 0 0 1 0 -4.069l2.643 -2.643a2.877 2.877 0 0 1 4.069 0", "M15 9h.01"]);
48
+ const IconSettings = glyph(["M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065", "M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0"]);
49
+ const IconPlus = glyph(["M12 5l0 14", "M5 12l14 0"]);
50
+ const IconPencil = glyph(["M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4", "M13.5 6.5l4 4"]);
51
+ const IconTrash = glyph(["M4 7l16 0", "M10 11l0 6", "M14 11l0 6", "M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12", "M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"]);
52
+ const IconCopy = glyph(["M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666", "M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1"]);
53
+ const IconCut = glyph(["M4 17a3 3 0 1 0 6 0a3 3 0 1 0 -6 0", "M14 17a3 3 0 1 0 6 0a3 3 0 1 0 -6 0", "M9.15 14.85l8.85 -10.85", "M6 4l8.85 10.85"]);
54
+ const IconClipboard = glyph(["M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2", "M9 5a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2"]);
55
+ const IconEraser = glyph(["M19 20h-10.5l-4.21 -4.3a1 1 0 0 1 0 -1.41l10 -10a1 1 0 0 1 1.41 0l5 5a1 1 0 0 1 0 1.41l-9.2 9.3", "M18 13.3l-6.3 -6.3"]);
56
+ const IconEyeOff = glyph(["M10.585 10.587a2 2 0 0 0 2.829 2.828", "M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87", "M3 3l18 18"]);
57
+ const IconEye = glyph(["M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0", "M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6"]);
58
+ const IconLock = glyph(["M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6", "M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0", "M8 11v-4a4 4 0 1 1 8 0v4"]);
59
+ const IconPin = glyph(["M15 4.5l-4 4l-4 1.5l-1.5 1.5l7 7l1.5 -1.5l1.5 -4l4 -4", "M9 15l-4.5 4.5", "M14.5 4l5.5 5.5"]);
60
+ const IconTextWrap = glyph(["M4 6l16 0", "M4 18l5 0", "M4 12h13a3 3 0 0 1 0 6h-4l2 -2m0 4l-2 -2"]);
61
+ const IconDots = glyph(["M4 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", "M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", "M18 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"]);
62
+ const IconX = glyph(["M18 6l-12 12", "M6 6l12 12"]);
63
+ const IconCheck = glyph(["M5 12l5 5l10 -10"]);
64
+ const IconAlertTriangle = glyph(["M12 9v4", "M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0", "M12 16h.01"]);
65
+ const IconGripVertical = glyph(["M8 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", "M8 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", "M8 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", "M14 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", "M14 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", "M14 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"]);
66
+ const IconArrowUpRight = glyph(["M17 7l-10 10", "M8 7l9 0l0 9"]);
67
+ const IconSquareCheck = glyph(["M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14", "M9 12l2 2l4 -4"]);
68
+ const IconChevronDown = glyph(["M6 9l6 6l6 -6"]);
69
+ const IconChevronRight = glyph(["M9 6l6 6l-6 6"]);
70
+ const IconCaretDownFilled = glyph(["M18 9c.852 0 1.297 .986 .783 1.623l-.076 .084l-6 6a1 1 0 0 1 -1.32 .083l-.094 -.083l-6 -6l-.083 -.094l-.054 -.077l-.054 -.096l-.017 -.036l-.027 -.067l-.032 -.108l-.01 -.053l-.01 -.06l-.004 -.057v-.118l.005 -.058l.009 -.06l.01 -.052l.032 -.108l.027 -.067l.07 -.132l.065 -.09l.073 -.081l.094 -.083l.077 -.054l.096 -.054l.036 -.017l.067 -.027l.108 -.032l.053 -.01l.06 -.01l.057 -.004l12.059 -.002z"], true);
71
+ const IconCaretRightFilled = glyph(["M9 6c0 -.852 .986 -1.297 1.623 -.783l.084 .076l6 6a1 1 0 0 1 .083 1.32l-.083 .094l-6 6l-.094 .083l-.077 .054l-.096 .054l-.036 .017l-.067 .027l-.108 .032l-.053 .01l-.06 .01l-.057 .004l-.059 .002l-.059 -.002l-.058 -.005l-.06 -.009l-.052 -.01l-.108 -.032l-.067 -.027l-.132 -.07l-.09 -.065l-.081 -.073l-.083 -.094l-.054 -.077l-.054 -.096l-.017 -.036l-.027 -.067l-.032 -.108l-.01 -.053l-.01 -.06l-.004 -.057l-.002 -12.059z"], true);
72
+ const IconArrowUp = glyph(["M12 5l0 14", "M18 11l-6 -6", "M6 11l6 -6"]);
73
+ const IconArrowDown = glyph(["M12 5l0 14", "M18 13l-6 6", "M6 13l6 6"]);
74
+ const IconCornerDownLeft = glyph(["M18 6v6a3 3 0 0 1 -3 3h-10l4 -4m0 8l-4 -4"]);
75
+ const IconClock = glyph(["M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0", "M12 7v5l3 3"]);
76
+ const IconProgress = glyph(["M10 20.777a8.942 8.942 0 0 1 -2.48 -.969", "M14 3.223a9.003 9.003 0 0 1 0 17.554", "M4.579 17.093a8.961 8.961 0 0 1 -1.227 -2.592", "M3.124 10.5c.16 -.95 .468 -1.85 .9 -2.675l.169 -.305", "M6.907 4.579a8.954 8.954 0 0 1 3.093 -1.356"]);
77
+ const IconArrowLeft = glyph(["M5 12l14 0", "M5 12l6 6", "M5 12l6 -6"]);
78
+ const IconArrowRight = glyph(["M5 12l14 0", "M13 18l6 -6", "M13 6l6 6"]);
79
+ const IconLayoutRows = glyph(["M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12", "M4 12l16 0"]);
80
+ const IconArrowsSort = glyph(["M3 9l4 -4l4 4m-4 -4v14", "M21 15l-4 4l-4 -4m4 4v-14"]);
81
+ const IconSortAscending = glyph(["M4 6l7 0", "M4 12l7 0", "M4 18l9 0", "M15 9l3 -3l3 3", "M18 6l0 12"]);
82
+ const IconSortDescending = glyph(["M4 6l9 0", "M4 12l7 0", "M4 18l7 0", "M15 15l3 3l3 -3", "M18 6l0 12"]);
83
+ const IconRotate = glyph(["M19.95 11a8 8 0 1 0 -.5 4m.5 5v-5h-5"]);
84
+ export const CONTROL_ICONS = {
85
+ text: IconLetterT,
86
+ longText: IconAlignLeft,
87
+ number: IconHash,
88
+ percent: IconPercentage,
89
+ currency: IconCurrencyDollar,
90
+ date: IconCalendar,
91
+ datetime: IconCalendarTime,
92
+ duration: IconHourglass,
93
+ boolean: IconToggleLeft,
94
+ select: IconSelector,
95
+ status: IconCircleDot,
96
+ multiselect: IconTags,
97
+ relation: IconArrowsLeftRight,
98
+ user: IconUser,
99
+ url: IconLink,
100
+ domain: IconWorld,
101
+ email: IconMail,
102
+ phone: IconPhone,
103
+ location: IconMapPin,
104
+ name: IconId,
105
+ actor: IconUserCircle,
106
+ rich_text: IconTextCaption,
107
+ range: IconArrowsHorizontal,
108
+ lookup: IconSearch,
109
+ rollup: IconSum,
110
+ formula: IconMathFunction,
111
+ computed: IconCalculator,
112
+ automation: IconBolt,
113
+ apiKey: IconKey,
114
+ system: IconSettings,
115
+ add: IconPlus,
116
+ edit: IconPencil,
117
+ delete: IconTrash,
118
+ copy: IconCopy,
119
+ cut: IconCut,
120
+ paste: IconClipboard,
121
+ clear: IconEraser,
122
+ hide: IconEyeOff,
123
+ show: IconEye,
124
+ lock: IconLock,
125
+ pin: IconPin,
126
+ wrap: IconTextWrap,
127
+ more: IconDots,
128
+ close: IconX,
129
+ check: IconCheck,
130
+ warning: IconAlertTriangle,
131
+ drag: IconGripVertical,
132
+ resize: IconArrowsHorizontal,
133
+ open: IconArrowUpRight,
134
+ selectRow: IconSquareCheck,
135
+ chevronDown: IconChevronDown,
136
+ chevronRight: IconChevronRight,
137
+ caretDown: IconCaretDownFilled,
138
+ caretRight: IconCaretRightFilled,
139
+ sortAsc: IconArrowUp,
140
+ sortDesc: IconArrowDown,
141
+ enter: IconCornerDownLeft,
142
+ calendar: IconCalendar,
143
+ time: IconClock,
144
+ progress: IconProgress,
145
+ moveLeft: IconArrowLeft,
146
+ moveRight: IconArrowRight,
147
+ group: IconLayoutRows,
148
+ clearSort: IconArrowsSort,
149
+ sortRowsUp: IconSortAscending,
150
+ sortRowsDown: IconSortDescending,
151
+ search: IconSearch,
152
+ reset: IconRotate,
153
+ options: IconAdjustments,
154
+ person: IconUser,
155
+ moreVertical: IconDotsVertical,
156
+ layout: IconLayout,
157
+ columns: IconColumns,
158
+ sort: IconArrowsSort,
159
+ back: IconArrowLeft,
160
+ copyLink: IconLink,
161
+ export: IconDownload,
162
+ share: IconShare,
163
+ loading: ViewsLoading,
164
+ filter: IconFilter,
165
+ filterStatus: IconCircleDot,
166
+ filterCategory: IconSelector,
167
+ filterMetric: IconHash,
168
+ };
169
+ const BY_NAME = CONTROL_ICONS;
170
+ export function MapAppIcon({ name, className }) {
171
+ const Glyph = Object.hasOwn(BY_NAME, name) ? BY_NAME[name] : undefined;
172
+ return Glyph ? _jsx(Glyph, { className: className }) : null;
173
+ }
@@ -9,6 +9,7 @@ export { Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonClass
9
9
  export { leadingGlyph } from "./button/map-button.js";
10
10
  export { buttonOwnAttrs, buttonOwnOptions, type ButtonOwnLook } from "./button/own-look.js";
11
11
  export { LoadingBar, Spinner, type LoadingBarProps, type SpinnerProps } from "./spinner/spinner.js";
12
+ export { CONTROL_ICONS } from "./glyphs/glyphs.js";
12
13
  export { POPUP_HOST, popupHostOf } from "./internal/popup-host.js";
13
14
  export type { Anchor } from "./internal/anchor.js";
14
15
  export { Scrollbar } from "./scrollbar/scrollbar.js";
@@ -45,7 +46,7 @@ export { COMPUTER_HOST, ComputerHost, PHONE_MARK, PhoneHost, PhoneLine, phoneMar
45
46
  export { drawnAt, focusWhereItStands, focusesInPlace, holdsThePage, keepsToItsList, overflows, scaleOf, scrollInList, scrollTopFor, scrollTopForDrag, staysInView, tapsInPlace, typesInto, } from "./internal/scroll.js";
46
47
  export { ContextMenu, Menu, MenuDots, useSheetMenus, type MenuChangeDetails, type MenuProps, type MenuWords, } from "./menu/menu.js";
47
48
  export { MapMenu, menuEntries } from "./menu/map-menu.js";
48
- export { Avatar, AvatarStack, initials, toneOf, type AvatarPresence, type AvatarProps, type AvatarSize, type AvatarStackPerson, type AvatarStackProps, } from "./avatar/avatar.js";
49
+ export { Avatar, AvatarStack, initials, toneOf, type AvatarColour, type AvatarPresence, type AvatarProps, type AvatarSize, type AvatarStackPerson, type AvatarStackProps, } from "./avatar/avatar.js";
49
50
  export { PICKER_WORDS, Picker, PickerUnder, usePicker, type PickerAction, type PickerBoxSearch, type PickerDoing, type PickerLead, type PickerParts, type PickerProps, type PickerUnderProps, type PickerWords, } from "./picker/picker.js";
50
51
  export { exactMatch, findItem, fold, itemLabel, openLevels, orderMoved, pickerRows, searchShown, type PickerAs, type PickerItem, type PickerRow, type RowsInput, } from "./picker/rows.js";
51
52
  export { pickerRead, pickerWornOf, type PickerWorn } from "./picker/looks.js";
@@ -130,4 +131,5 @@ export { LinksEditor, useLinksEditor, type LinksEditorAction, type LinksEditorLe
130
131
  export { found, heldOf, leadAfter, offered, removed, said, saidShort, setValue, ticked, type LinkChoice, type LinkField, type LinkFieldKind, type LinkValue, } from "./links-editor/links.js";
131
132
  export { LINKS_EDITOR_WORDS, linksWords, type LinksEditorWords } from "./links-editor/words.js";
132
133
  export { TagField, type TagFieldProps } from "./tag-field/tag-field.js";
133
- export { SwitchRow, SwitchRows, type SwitchRowProps } from "./switch-row/switch-row.js";
134
+ export { SettingChevron, SettingIcon, SettingRow, SettingRows, SwitchRow, SwitchRows, useSettingRowWorn, useSettingRowsRow, type SettingAction, type SettingRowProps, type SettingRowsProps, type SettingState, type SwitchRowProps } from "./setting-row/setting-row.js";
135
+ export { SETTING_ROW_ATTRS, settingRowWornOf } from "./setting-row/looks.js";
@@ -4,6 +4,7 @@ export { Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonClass
4
4
  export { leadingGlyph } from "./button/map-button.js";
5
5
  export { buttonOwnAttrs, buttonOwnOptions } from "./button/own-look.js";
6
6
  export { LoadingBar, Spinner } from "./spinner/spinner.js";
7
+ export { CONTROL_ICONS } from "./glyphs/glyphs.js";
7
8
  export { POPUP_HOST, popupHostOf } from "./internal/popup-host.js";
8
9
  export { Scrollbar } from "./scrollbar/scrollbar.js";
9
10
  export { Kbd } from "./kbd/kbd.js";
@@ -122,4 +123,5 @@ export { LinksEditor, useLinksEditor, } from "./links-editor/links-editor.js";
122
123
  export { found, heldOf, leadAfter, offered, removed, said, saidShort, setValue, ticked, } from "./links-editor/links.js";
123
124
  export { LINKS_EDITOR_WORDS, linksWords } from "./links-editor/words.js";
124
125
  export { TagField } from "./tag-field/tag-field.js";
125
- export { SwitchRow, SwitchRows } from "./switch-row/switch-row.js";
126
+ export { SettingChevron, SettingIcon, SettingRow, SettingRows, SwitchRow, SwitchRows, useSettingRowWorn, useSettingRowsRow } from "./setting-row/setting-row.js";
127
+ export { SETTING_ROW_ATTRS, settingRowWornOf } from "./setting-row/looks.js";
@@ -54,6 +54,12 @@ export interface InputProps extends Omit<BaseInput.Props, "className" | "size">
54
54
  /** Bare, whether it fills its line (the rest of a flex line, its full height): on unless said. Off, it stands at the width
55
55
  * and height its place gives it, as the editors size their boxes. In its field, nothing. */
56
56
  fills?: boolean;
57
+ /** In its field, the app saving what was typed (VK-921): the Spinner at the box's end, the field busy and still typed
58
+ * into. It wins over saved. Inside an InputGroup, the group's. */
59
+ saving?: boolean;
60
+ /** In its field, the save took: a check and Saved at the box's end, announced, fading after --vk-saved-hold and then
61
+ * gone; it shows again each time it turns on. A save that fails is the Field's error instead. */
62
+ saved?: boolean;
57
63
  /** The Input's list: see InputComboboxProps. */
58
64
  combobox?: false;
59
65
  /** In its field, the box's classes, not the control's: a lone Input is a box round its control, so a utility class lands
@@ -86,13 +92,18 @@ export interface InputGroupProps extends React.HTMLAttributes<HTMLDivElement> {
86
92
  className?: string;
87
93
  /** Its Input and its InputGroupAddons, as its own children. */
88
94
  children: React.ReactNode;
95
+ /** The app saving what was typed (VK-921): the Spinner at the group's end, after its end side, the group busy. It wins
96
+ * over saved. */
97
+ saving?: boolean;
98
+ /** The save took: a check and Saved at the group's end, fading after --vk-saved-hold and then gone. */
99
+ saved?: boolean;
89
100
  }
90
101
  /** A field with something inside it beside the words: an icon, words before or after them, a button
91
102
  * (clear, show the password, copy); or rows above and below long text. It draws the field around its
92
103
  * Input and addons, in every state and every look, and a press anywhere in it but a button puts the
93
104
  * cursor in its Input. A value typed in parts holds InputGroupSegments instead of an Input: the group shows its focus while
94
105
  * any has it, and a press off them puts the focus in the first. */
95
- export declare function InputGroup({ size, look: lookGiven, chrome, className, children, onMouseDown, ...props }: InputGroupProps): import("react/jsx-runtime").JSX.Element;
106
+ export declare function InputGroup({ size, look: lookGiven, chrome, saving, saved, className, children, onMouseDown, ...props }: InputGroupProps): import("react/jsx-runtime").JSX.Element;
96
107
  export interface InputGroupAddonProps extends React.HTMLAttributes<HTMLDivElement> {
97
108
  /** Where it sits: before the words or after them (start, end), or a row above or below long text (top,
98
109
  * bottom). */
@@ -1,13 +1,15 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import { Input as BaseInput } from "@base-ui/react/input";
4
4
  import { Combobox as BaseCombobox } from "@base-ui/react/combobox";
5
5
  import { cx } from "../../internal/cx.js";
6
6
  import { Button } from "../button/button.js";
7
+ import { InFieldRow } from "../../internal/field-rows.js";
7
8
  import { phoneMark, usePhoneForm } from "../internal/phone.js";
8
9
  import { useAutofill } from "./autofill.js";
9
10
  import { inputOwnAttrs, kindLook } from "./looks.js";
10
11
  import { keepTypedRun } from "../internal/typed-run.js";
12
+ import { SaveMark } from "./save-mark.js";
11
13
  const sized = (size) => size !== "md" && `o-input-${size}`;
12
14
  const InGroup = React.createContext(null);
13
15
  export const InputGroupContext = InGroup;
@@ -76,9 +78,10 @@ function useKeptCursor(el, type) {
76
78
  return () => cancelAnimationFrame(f);
77
79
  }, [el, type]);
78
80
  }
79
- export const Input = React.forwardRef(function Input({ size = "md", numeric = false, multiline = false, grow = false, maxLines, minLines, lines: linesGiven, autofill = true, look: lookGiven, chrome = "field", fills = true, combobox = false, className, style, ...props }, ref) {
81
+ export const Input = React.forwardRef(function Input({ size = "md", numeric = false, multiline = false, grow = false, maxLines, minLines, lines: linesGiven, autofill = true, look: lookGiven, chrome = "field", fills = true, combobox = false, saving = false, saved = false, className, style, ...props }, ref) {
80
82
  const fill = useAutofill(), look = kindLook(chrome, lookGiven), phone = usePhoneForm();
81
83
  const group = React.useContext(InGroup), grouped = group != null;
84
+ const inRow = React.useContext(InFieldRow) && chrome === "field";
82
85
  const lines = linesGiven ?? look?.lines ?? group?.lines;
83
86
  const long = multiline && !combobox;
84
87
  const bare = grouped || chrome === "bare", field = !bare, set = long && lines != null, grows = long && !set && (field ? grow : bare);
@@ -101,13 +104,13 @@ export const Input = React.forwardRef(function Input({ size = "md", numeric = fa
101
104
  if (field) {
102
105
  const { "data-force": force, ...rest } = props;
103
106
  props = rest;
104
- return (_jsx("span", { className: cx("o-input o-input-lone o-smooth o-smooth-ease", sized(size), long && "o-input-long", grows && "o-input-grow", className), style: start || style ? { ...start, ...style } : undefined, "data-kit": "input", ...phoneMark(phone), ...(force != null ? { "data-force": force } : {}), ...(look ? inputOwnAttrs(look) : {}), onMouseDown: (e) => {
107
+ return (_jsxs("span", { className: cx("o-input o-input-lone", inRow ? "o-input-inrow" : "o-smooth o-smooth-ease", sized(size), long && "o-input-long", grows && "o-input-grow", className), style: start || style ? { ...start, ...style } : undefined, "data-kit": "input", ...phoneMark(phone), ...(force != null ? { "data-force": force } : {}), ...(look ? inputOwnAttrs(look) : {}), onMouseDown: (e) => {
105
108
  const box = own.current;
106
109
  if (e.target !== e.currentTarget || !box || box.disabled)
107
110
  return;
108
111
  e.preventDefault();
109
112
  box.focus();
110
- }, children: control({ className: cx("o-input-control", set && "o-input-lines", numeric && "o-input-num"), ...(most ? { style: most } : {}) }) }));
113
+ }, children: [control({ className: cx("o-input-control", set && "o-input-lines", numeric && "o-input-num"), ...(most ? { style: most } : {}), ...(saving ? { "aria-busy": true } : {}) }), _jsx(SaveMark, { saving: saving, saved: saved })] }));
111
114
  }
112
115
  return control({
113
116
  className: cx("o-input-control", set && "o-input-lines", numeric && "o-input-num", className),
@@ -117,11 +120,12 @@ export const Input = React.forwardRef(function Input({ size = "md", numeric = fa
117
120
  ...(bare && !fills ? { "data-fills": "off" } : {}),
118
121
  });
119
122
  });
120
- export function InputGroup({ size = "md", look: lookGiven, chrome, className, children, onMouseDown, ...props }) {
123
+ export function InputGroup({ size = "md", look: lookGiven, chrome, saving = false, saved = false, className, children, onMouseDown, ...props }) {
121
124
  const look = kindLook(chrome, lookGiven), phone = usePhoneForm();
125
+ const inRow = React.useContext(InFieldRow) && (chrome ?? "field") === "field";
122
126
  const tall = React.Children.toArray(children).some((c) => React.isValidElement(c)
123
127
  && ((c.type === Input && c.props.multiline) || (c.type === InputGroupAddon && (c.props.side === "top" || c.props.side === "bottom"))));
124
- return (_jsx(InGroup.Provider, { value: { size, cell: false, lines: look?.lines }, children: _jsx("div", { role: "group", className: cx("o-input o-input-group o-smooth o-smooth-ease", sized(size), tall && "o-input-long", className), ...phoneMark(phone), ...(look ? inputOwnAttrs(look) : {}), onMouseDown: (e) => { onMouseDown?.(e); pressGroup(e); }, ...props, children: children }) }));
128
+ return (_jsx(InGroup.Provider, { value: { size, cell: false, lines: look?.lines }, children: _jsxs("div", { role: "group", className: cx("o-input o-input-group", inRow ? "o-input-inrow" : "o-smooth o-smooth-ease", sized(size), tall && "o-input-long", className), ...phoneMark(phone), ...(look ? inputOwnAttrs(look) : {}), onMouseDown: (e) => { onMouseDown?.(e); pressGroup(e); }, ...(saving ? { "aria-busy": true } : {}), ...props, children: [children, _jsx(SaveMark, { saving: saving, saved: saved })] }) }));
125
129
  }
126
130
  export function InputGroupAddon({ side = "start", flush = false, className, children, ...props }) {
127
131
  return _jsx("div", { "data-side": side, ...(flush ? { "data-flush": "" } : {}), className: cx("o-input-addon", className), ...props, children: children });
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ export interface SaveMarkProps {
3
+ /** The app is saving: the Spinner. It wins over saved. */
4
+ saving?: boolean;
5
+ /** The save took: a check and Saved, for a moment. */
6
+ saved?: boolean;
7
+ }
8
+ export declare function SaveMark({ saving, saved }: SaveMarkProps): React.ReactElement | null;
@@ -0,0 +1,26 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { Icon } from "../internal/icons.js";
5
+ import { Spinner } from "../spinner/spinner.js";
6
+ export function SaveMark({ saving = false, saved = false }) {
7
+ const [left, setLeft] = React.useState(false);
8
+ if (left && !saved)
9
+ setLeft(false);
10
+ const own = React.useRef(null);
11
+ const shows = !saving && saved && !left;
12
+ React.useEffect(() => {
13
+ const el = own.current;
14
+ if (!shows || !el)
15
+ return;
16
+ const end = (e) => { if (e.target === el)
17
+ setLeft(true); };
18
+ el.addEventListener("animationend", end);
19
+ return () => el.removeEventListener("animationend", end);
20
+ }, [shows]);
21
+ if (saving)
22
+ return _jsx("span", { className: "o-input-save", "data-save": "saving", children: _jsx(Spinner, { size: 14, label: "Saving" }) });
23
+ if (!saved || left)
24
+ return null;
25
+ return (_jsxs("span", { ref: own, className: "o-input-save", "data-save": "saved", role: "status", children: [_jsx(Icon, { name: "check", size: 14 }), "Saved"] }));
26
+ }