viewkitjs 0.22.0 → 0.24.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 (231) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/package.json +2 -4
  3. package/views/dist/contract.d.ts +6 -289
  4. package/views/dist/contract.js +1 -96
  5. package/views/dist/controls/atoms.d.ts +8 -0
  6. package/views/dist/controls/atoms.js +8 -0
  7. package/views/dist/controls/button/tokens.d.ts +351 -0
  8. package/views/dist/controls/button/tokens.js +90 -0
  9. package/views/dist/controls/checkbox/checkbox.d.ts +28 -0
  10. package/views/dist/controls/checkbox/checkbox.js +15 -0
  11. package/views/dist/controls/checkbox/looks.d.ts +3 -0
  12. package/views/dist/controls/checkbox/looks.js +8 -0
  13. package/views/dist/controls/checkbox/map-checkbox.d.ts +2 -0
  14. package/views/dist/controls/checkbox/map-checkbox.js +5 -0
  15. package/views/dist/controls/checkbox/tokens.d.ts +131 -0
  16. package/views/dist/controls/checkbox/tokens.js +35 -0
  17. package/views/dist/controls/checkbox.css +133 -0
  18. package/views/dist/controls/controls.d.ts +12 -3
  19. package/views/dist/controls/controls.js +13 -1
  20. package/views/dist/controls/field/field.d.ts +94 -0
  21. package/views/dist/controls/field/field.js +46 -0
  22. package/views/dist/controls/field/looks.d.ts +13 -0
  23. package/views/dist/controls/field/looks.js +22 -0
  24. package/views/dist/controls/field/tokens.d.ts +75 -0
  25. package/views/dist/controls/field/tokens.js +21 -0
  26. package/views/dist/controls/field.css +98 -0
  27. package/views/dist/controls/glass-button/glass-button.d.ts +40 -0
  28. package/views/dist/controls/glass-button/glass-button.js +16 -0
  29. package/views/dist/controls/glass-button/looks.d.ts +4 -0
  30. package/views/dist/controls/glass-button/looks.js +4 -0
  31. package/views/dist/controls/glass-button/tokens.d.ts +127 -0
  32. package/views/dist/controls/glass-button/tokens.js +34 -0
  33. package/views/dist/controls/glass-button.css +111 -0
  34. package/views/dist/controls/grip/grip.d.ts +14 -0
  35. package/views/dist/controls/grip/grip.js +9 -0
  36. package/views/dist/controls/index.d.ts +32 -0
  37. package/views/dist/controls/index.js +31 -0
  38. package/views/dist/controls/inline-input/inline-input.d.ts +14 -0
  39. package/views/dist/controls/inline-input/inline-input.js +10 -0
  40. package/views/dist/controls/inline-input/looks.d.ts +3 -0
  41. package/views/dist/controls/inline-input/looks.js +16 -0
  42. package/views/dist/controls/inline-input/tokens.d.ts +79 -0
  43. package/views/dist/controls/inline-input/tokens.js +22 -0
  44. package/views/dist/controls/inline-input.css +78 -0
  45. package/views/dist/controls/input/autofill.d.ts +25 -0
  46. package/views/dist/controls/input/autofill.js +17 -0
  47. package/views/dist/controls/input/input.d.ts +119 -0
  48. package/views/dist/controls/input/input.js +127 -0
  49. package/views/dist/controls/input/looks.d.ts +41 -0
  50. package/views/dist/controls/input/looks.js +48 -0
  51. package/views/dist/controls/input/map-input.d.ts +2 -0
  52. package/views/dist/controls/input/map-input.js +5 -0
  53. package/views/dist/controls/input/tokens.d.ts +171 -0
  54. package/views/dist/controls/input/tokens.js +45 -0
  55. package/views/dist/controls/input.css +381 -0
  56. package/views/dist/controls/internal/anchor.d.ts +16 -0
  57. package/views/dist/controls/internal/anchor.js +8 -0
  58. package/views/dist/controls/internal/close-reason.d.ts +5 -0
  59. package/views/dist/controls/internal/close-reason.js +2 -0
  60. package/views/dist/controls/internal/hold.d.ts +25 -0
  61. package/views/dist/controls/internal/hold.js +81 -0
  62. package/views/dist/controls/internal/icons.d.ts +8 -0
  63. package/views/dist/controls/internal/icons.js +65 -0
  64. package/views/dist/controls/internal/popup-host.d.ts +7 -0
  65. package/views/dist/controls/internal/popup-host.js +10 -0
  66. package/views/dist/controls/internal/read-token.d.ts +6 -0
  67. package/views/dist/controls/internal/read-token.js +11 -0
  68. package/views/dist/controls/internal/reorder.d.ts +44 -0
  69. package/views/dist/controls/internal/reorder.js +83 -0
  70. package/views/dist/controls/internal/scroll.d.ts +11 -0
  71. package/views/dist/controls/internal/scroll.js +14 -0
  72. package/views/dist/controls/kbd/kbd.d.ts +13 -0
  73. package/views/dist/controls/kbd/kbd.js +10 -0
  74. package/views/dist/controls/kbd/looks.d.ts +4 -0
  75. package/views/dist/controls/kbd/looks.js +4 -0
  76. package/views/dist/controls/kbd/tokens.d.ts +47 -0
  77. package/views/dist/controls/kbd/tokens.js +14 -0
  78. package/views/dist/controls/kbd.css +46 -0
  79. package/views/dist/controls/list/tokens.d.ts +139 -0
  80. package/views/dist/controls/list/tokens.js +37 -0
  81. package/views/dist/controls/list.css +188 -0
  82. package/views/dist/controls/menu-list/keys.d.ts +7 -0
  83. package/views/dist/controls/menu-list/keys.js +29 -0
  84. package/views/dist/controls/menu-list/looks.d.ts +4 -0
  85. package/views/dist/controls/menu-list/looks.js +20 -0
  86. package/views/dist/controls/menu-list/menu-list.d.ts +196 -0
  87. package/views/dist/controls/menu-list/menu-list.js +346 -0
  88. package/views/dist/controls/menu-list/tokens.d.ts +187 -0
  89. package/views/dist/controls/menu-list/tokens.js +49 -0
  90. package/views/dist/controls/menu-list.css +259 -0
  91. package/views/dist/controls/number-field/number-field.d.ts +48 -0
  92. package/views/dist/controls/number-field/number-field.js +34 -0
  93. package/views/dist/controls/number-field/tokens.d.ts +47 -0
  94. package/views/dist/controls/number-field/tokens.js +14 -0
  95. package/views/dist/controls/number-field.css +54 -0
  96. package/views/dist/controls/option/atom-tag.d.ts +6 -0
  97. package/views/dist/controls/option/atom-tag.js +6 -0
  98. package/views/dist/controls/option/looks.d.ts +7 -0
  99. package/views/dist/controls/option/looks.js +21 -0
  100. package/views/dist/controls/option/option.d.ts +35 -0
  101. package/views/dist/controls/option/option.js +32 -0
  102. package/views/dist/controls/option/tokens.d.ts +223 -0
  103. package/views/dist/controls/option/tokens.js +58 -0
  104. package/views/dist/controls/option.css +92 -0
  105. package/views/dist/controls/phone-header/header-bar.d.ts +18 -0
  106. package/views/dist/controls/phone-header/header-bar.js +9 -0
  107. package/views/dist/controls/phone-header/looks.d.ts +4 -0
  108. package/views/dist/controls/phone-header/looks.js +4 -0
  109. package/views/dist/controls/phone-header/soft-edge.d.ts +5 -0
  110. package/views/dist/controls/phone-header/soft-edge.js +3 -0
  111. package/views/dist/controls/phone-header/tokens.d.ts +59 -0
  112. package/views/dist/controls/phone-header/tokens.js +17 -0
  113. package/views/dist/controls/phone-header.css +51 -0
  114. package/views/dist/controls/popover/looks.d.ts +4 -0
  115. package/views/dist/controls/popover/looks.js +10 -0
  116. package/views/dist/controls/popover/map-popover.d.ts +3 -0
  117. package/views/dist/controls/popover/map-popover.js +5 -0
  118. package/views/dist/controls/popover/popover.d.ts +74 -0
  119. package/views/dist/controls/popover/popover.js +106 -0
  120. package/views/dist/controls/popover/tokens.d.ts +83 -0
  121. package/views/dist/controls/popover/tokens.js +23 -0
  122. package/views/dist/controls/popover.css +94 -0
  123. package/views/dist/controls/scrollbar/scrollbar.d.ts +10 -0
  124. package/views/dist/controls/scrollbar/scrollbar.js +143 -0
  125. package/views/dist/controls/scrollbar/tokens.d.ts +43 -0
  126. package/views/dist/controls/scrollbar/tokens.js +13 -0
  127. package/views/dist/controls/scrollbar.css +47 -0
  128. package/views/dist/controls/sheet/bottom-sheet.d.ts +98 -0
  129. package/views/dist/controls/sheet/bottom-sheet.js +375 -0
  130. package/views/dist/controls/sheet/forms.d.ts +38 -0
  131. package/views/dist/controls/sheet/forms.js +26 -0
  132. package/views/dist/controls/sheet/looks.d.ts +4 -0
  133. package/views/dist/controls/sheet/looks.js +10 -0
  134. package/views/dist/controls/sheet/map-sheet.d.ts +3 -0
  135. package/views/dist/controls/sheet/map-sheet.js +12 -0
  136. package/views/dist/controls/sheet/spring.d.ts +22 -0
  137. package/views/dist/controls/sheet/spring.js +48 -0
  138. package/views/dist/controls/sheet/tokens.d.ts +143 -0
  139. package/views/dist/controls/sheet/tokens.js +38 -0
  140. package/views/dist/controls/sheet.css +223 -0
  141. package/views/dist/controls/spinner/tokens.d.ts +55 -0
  142. package/views/dist/controls/spinner/tokens.js +16 -0
  143. package/views/dist/controls/status/atom-status-badge.d.ts +10 -0
  144. package/views/dist/controls/status/atom-status-badge.js +13 -0
  145. package/views/dist/controls/status/looks.d.ts +4 -0
  146. package/views/dist/controls/status/looks.js +22 -0
  147. package/views/dist/controls/status/marks.d.ts +26 -0
  148. package/views/dist/controls/status/marks.js +73 -0
  149. package/views/dist/controls/status/status.d.ts +43 -0
  150. package/views/dist/controls/status/status.js +26 -0
  151. package/views/dist/controls/status/tokens.d.ts +407 -0
  152. package/views/dist/controls/status/tokens.js +104 -0
  153. package/views/dist/controls/status.css +164 -0
  154. package/views/dist/controls/switch/looks.d.ts +4 -0
  155. package/views/dist/controls/switch/looks.js +19 -0
  156. package/views/dist/controls/switch/switch.d.ts +15 -0
  157. package/views/dist/controls/switch/switch.js +11 -0
  158. package/views/dist/controls/switch/tokens.d.ts +139 -0
  159. package/views/dist/controls/switch/tokens.js +37 -0
  160. package/views/dist/controls/switch.css +169 -0
  161. package/views/dist/controls/tag/atom-cell-more.d.ts +3 -0
  162. package/views/dist/controls/tag/atom-cell-more.js +5 -0
  163. package/views/dist/controls/tag/looks.d.ts +4 -0
  164. package/views/dist/controls/tag/looks.js +4 -0
  165. package/views/dist/controls/tag/tag.d.ts +25 -0
  166. package/views/dist/controls/tag/tag.js +19 -0
  167. package/views/dist/controls/tag/tokens.d.ts +63 -0
  168. package/views/dist/controls/tag/tokens.js +18 -0
  169. package/views/dist/controls/tag.css +81 -0
  170. package/views/dist/controls/toggle/looks.d.ts +3 -0
  171. package/views/dist/controls/toggle/looks.js +12 -0
  172. package/views/dist/controls/toggle/toggle.d.ts +47 -0
  173. package/views/dist/controls/toggle/toggle.js +23 -0
  174. package/views/dist/controls/toggle/tokens.d.ts +55 -0
  175. package/views/dist/controls/toggle/tokens.js +16 -0
  176. package/views/dist/controls/toggle.css +67 -0
  177. package/views/dist/controls/tokens.d.ts +16 -0
  178. package/views/dist/controls/tokens.js +49 -0
  179. package/views/dist/controls/tooltip/looks.d.ts +4 -0
  180. package/views/dist/controls/tooltip/looks.js +4 -0
  181. package/views/dist/controls/tooltip/map-tooltip.d.ts +3 -0
  182. package/views/dist/controls/tooltip/map-tooltip.js +5 -0
  183. package/views/dist/controls/tooltip/tokens.d.ts +75 -0
  184. package/views/dist/controls/tooltip/tokens.js +21 -0
  185. package/views/dist/controls/tooltip/tooltip.d.ts +54 -0
  186. package/views/dist/controls/tooltip/tooltip.js +78 -0
  187. package/views/dist/controls/tooltip.css +94 -0
  188. package/views/dist/grid/chrome/GridTable.js +21 -19
  189. package/views/dist/grid/chrome/grid-caret-keys.d.ts +7 -0
  190. package/views/dist/grid/chrome/grid-caret-keys.js +22 -0
  191. package/views/dist/grid/chrome/grid-row-window.js +3 -0
  192. package/views/dist/grid/chrome/useGridColumnLayout.d.ts +4 -1
  193. package/views/dist/grid/chrome/useGridColumnLayout.js +17 -2
  194. package/views/dist/grid/chrome/useGridFittedWidths.d.ts +32 -0
  195. package/views/dist/grid/chrome/useGridFittedWidths.js +59 -0
  196. package/views/dist/grid/chrome/useGridKeyboard.js +3 -0
  197. package/views/dist/looks/index.d.ts +16 -0
  198. package/views/dist/looks/index.js +16 -0
  199. package/views/dist/looks/looks.d.ts +10 -9
  200. package/views/dist/looks/pieces.js +38 -2
  201. package/views/dist/model/column-schema.d.ts +3 -2
  202. package/views/dist/model/column-state.d.ts +11 -1
  203. package/views/dist/model/column-state.js +8 -2
  204. package/views/dist/styles.css +2362 -7
  205. package/views/dist/styles.unlayered.css +2362 -7
  206. package/views/docs/contract.md +5 -97
  207. package/views/docs/controls/button.md +93 -0
  208. package/views/docs/controls/checkbox.md +38 -0
  209. package/views/docs/controls/field.md +26 -0
  210. package/views/docs/controls/glass-button.md +37 -0
  211. package/views/docs/controls/inline-input.md +27 -0
  212. package/views/docs/controls/input.md +48 -0
  213. package/views/docs/controls/kbd.md +17 -0
  214. package/views/docs/controls/list.md +40 -0
  215. package/views/docs/controls/menu-list.md +52 -0
  216. package/views/docs/controls/number-field.md +17 -0
  217. package/views/docs/controls/option.md +61 -0
  218. package/views/docs/controls/phone-header.md +20 -0
  219. package/views/docs/controls/popover.md +26 -0
  220. package/views/docs/controls/scrollbar.md +16 -0
  221. package/views/docs/controls/sheet.md +41 -0
  222. package/views/docs/controls/spinner.md +19 -0
  223. package/views/docs/controls/status.md +107 -0
  224. package/views/docs/controls/switch.md +40 -0
  225. package/views/docs/controls/tag.md +21 -0
  226. package/views/docs/controls/toggle.md +19 -0
  227. package/views/docs/controls/tooltip.md +24 -0
  228. package/views/docs/getting-started.md +1 -1
  229. package/views/docs/reference/controls.md +213 -2
  230. package/views/docs/reference/looks.md +70 -3
  231. package/views/docs/reference/views.md +7 -2
@@ -0,0 +1,346 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Button as BaseButton } from "@base-ui/react/button";
3
+ import { Menu as BaseMenu } from "@base-ui/react/menu";
4
+ import * as React from "react";
5
+ import { cx } from "../../internal/cx.js";
6
+ import { CheckboxMark } from "../checkbox/checkbox.js";
7
+ import { GRIP, Grip } from "../grip/grip.js";
8
+ import { useHoldDrag } from "../internal/hold.js";
9
+ import { Icon, iconPaths } from "../internal/icons.js";
10
+ import { msOf, pxOf, spacingPx } from "../internal/read-token.js";
11
+ import { useReorder } from "../internal/reorder.js";
12
+ import { Scrollbar } from "../scrollbar/scrollbar.js";
13
+ import { Switch } from "../switch/switch.js";
14
+ import { rowFor, rowStarting } from "./keys.js";
15
+ import { MENU_LIST_LOOKS } from "./looks.js";
16
+ const optionOf = (el, id) => el?.closest(`[data-menu-list-${id}]`)?.getAttribute(`data-menu-list-${id}`) ?? MENU_LIST_LOOKS.options.find((o) => o.id === id).def;
17
+ export const menuListRowsOf = (el) => optionOf(el, "rows");
18
+ export const sheetFormOf = (el) => (menuListRowsOf(el) === "plain" || menuListRowsOf(el) === "words" ? "floating" : "edge");
19
+ export const menuListCloseOf = (el) => optionOf(el, "close") === "shown" && menuListRowsOf(el) !== "words";
20
+ export function useMenuListOption(frame, id) {
21
+ const [value, setValue] = React.useState(() => optionOf(null, id));
22
+ React.useLayoutEffect(() => {
23
+ if (!frame)
24
+ return;
25
+ const read = () => setValue(optionOf(frame, id));
26
+ read();
27
+ const watch = new MutationObserver(read);
28
+ watch.observe(document.documentElement, { attributes: true, subtree: true, attributeFilter: [`data-menu-list-${id}`] });
29
+ return () => watch.disconnect();
30
+ }, [frame, id]);
31
+ return value;
32
+ }
33
+ export const useMenuListRows = (frame) => useMenuListOption(frame, "rows");
34
+ const glyph = (paths, className) => _jsx("svg", { className: className, viewBox: "0 0 24 24", "aria-hidden": "true", children: paths.map((d) => _jsx("path", { d: d }, d)) });
35
+ const EYE_OUTLINE = iconPaths("eye")[1];
36
+ const EYE_SLASH = "M3 3l18 18", EYE_CUT = "M3.424 2.576l18 18", EYE_LOWER = "M10.586 10.586a2 2 0 0 0 2.828 2.828", EYE_UPPER = "M13.414 13.414a2 2 0 0 0 -2.828 -2.828";
37
+ function Eye({ on, className }) {
38
+ const cut = `o-eye-${React.useId().replace(/[^A-Za-z0-9_-]/g, "")}`;
39
+ return (_jsx("span", { className: className, "data-on": on ? "" : undefined, children: _jsxs("svg", { width: 15, height: 15, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsxs("mask", { id: cut, maskUnits: "userSpaceOnUse", x: "0", y: "0", width: "24", height: "24", children: [_jsx("rect", { width: "24", height: "24", fill: "white", stroke: "none" }), _jsx("path", { className: "o-eye-cut", d: EYE_CUT, pathLength: 1, stroke: "black", strokeWidth: 3.2, strokeLinecap: "butt" })] }), _jsxs("g", { className: "o-eye-outline", mask: `url(#${cut})`, children: [_jsx("path", { d: EYE_OUTLINE }), _jsx("path", { d: EYE_LOWER })] }), _jsx("path", { className: "o-eye-upper", d: EYE_UPPER }), _jsx("path", { className: "o-eye-slash", d: EYE_SLASH, pathLength: 1 })] }) }));
40
+ }
41
+ const eyeOf = (on, className) => _jsx(Eye, { on: on, className: className });
42
+ const MORE = ["M9 6l6 6l-6 6"], TICK = ["M5 12l5 5l10 -10"], AWAY = ["M17 7l-10 10", "M8 7l9 0l0 9"];
43
+ const strokeGlyph = (paths, className, strokeWidth = 2) => (_jsx("svg", { className: className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: paths.map((d) => _jsx("path", { d: d }, d)) }));
44
+ const part = (id, p) => (id ? `${id}-${p}` : undefined);
45
+ const named = (id) => ["n", "v", "k", "c"].map((p) => `${id}-${p}`).join(" ");
46
+ const actionBody = (e, id) => (_jsxs(_Fragment, { children: [e.icon, _jsx("span", { className: "o-menu-name", id: part(id, "n"), children: e.label }), e.keys && _jsx("span", { className: "o-menu-keys", id: part(id, "k"), children: e.keys.map((k) => _jsx("kbd", { children: k }, k)) }), e.count != null && _jsx("span", { className: "o-menu-count", id: part(id, "c"), children: e.count })] }));
47
+ const linkBody = (e, id) => _jsxs(_Fragment, { children: [e.icon, _jsx("span", { className: "o-menu-name", id: part(id, "n"), children: e.label }), e.external && strokeGlyph(AWAY, "o-menu-away")] });
48
+ const checkBody = (e, id) => _jsxs(_Fragment, { children: [_jsx(CheckboxMark, {}), _jsx("span", { className: "o-menu-name", id: part(id, "n"), children: e.label })] });
49
+ const actionsBody = (e, id) => _jsxs(_Fragment, { children: [e.icon, _jsx("span", { className: "o-menu-name", id: part(id, "n"), children: e.label }), e.detail != null && _jsx("span", { className: "o-menu-value", id: part(id, "v"), "data-on": e.inForce ? "" : undefined, children: e.detail }), strokeGlyph(MORE, "o-menu-more")] });
50
+ const choicesBody = (e, id) => (_jsxs(_Fragment, { children: [e.icon, _jsx("span", { className: "o-menu-name", id: part(id, "n"), children: e.label }), _jsx("span", { className: "o-menu-value", id: part(id, "v"), children: e.detail ?? e.choices.find((c) => c.value === e.value)?.label }), strokeGlyph(MORE, "o-menu-more")] }));
51
+ const HOW_KEYS = "Left arrow for its grip, then up or down arrow to move it";
52
+ const HOW_HOLD = "Hold, then drag to move it";
53
+ const HOLD = { delay: (row) => msOf(row, "--menu-list-hold"), swipe: (row) => spacingPx(2, row) };
54
+ const movedTo = (list, from, to) => `${"label" in list[from] ? list[from].label : ""}, ${to + 1} of ${list.length}`;
55
+ function Says({ id, how, said }) {
56
+ return _jsxs(_Fragment, { children: [_jsx("span", { id: id, hidden: true, children: how }), _jsx("span", { role: "status", className: "o-menu-said", children: said })] });
57
+ }
58
+ const choiceBody = (c) => _jsxs(_Fragment, { children: [c.mark, _jsx("span", { className: "o-menu-name", children: c.label }), c.detail != null && _jsx("span", { className: "o-menu-detail", children: c.detail }), strokeGlyph(TICK, "o-list-tick", 2.25)] });
59
+ const rowClass = (e) => cx("o-list-row o-smooth o-smooth-ease o-menu-row", e.danger && "o-menu-danger");
60
+ export const MenuScroll = ({ children }) => _jsxs(_Fragment, { children: [_jsx("div", { className: "o-menu-list-scroll", children: children }), _jsx(Scrollbar, {})] });
61
+ function Sub({ trigger, host, children }) {
62
+ const row = React.useRef(null);
63
+ const [at, setAt] = React.useState({ delay: 0, step: 0, edge: 0 });
64
+ React.useLayoutEffect(() => {
65
+ const el = row.current;
66
+ if (el)
67
+ setAt({ delay: msOf(el, "--menu-sub-wait"), step: spacingPx(1, el), edge: pxOf(el, "--vk-border-width") });
68
+ }, []);
69
+ return (_jsxs(BaseMenu.SubmenuRoot, { children: [_jsx(BaseMenu.SubmenuTrigger, { ref: row, delay: at.delay, className: "o-list-row o-smooth o-smooth-ease o-menu-row", children: trigger }), _jsx(BaseMenu.Portal, { container: host, className: "o-menu-portal", children: _jsx(BaseMenu.Positioner, { className: "o-list-positioner", side: "right", align: "start", sideOffset: at.step, alignOffset: -(at.step + at.edge), children: _jsx(BaseMenu.Popup, { className: "o-list o-menu o-smooth o-smooth-ease", "data-kit": "menu", children: _jsx(MenuScroll, { children: children }) }) }) })] }));
70
+ }
71
+ export function MenuListRows({ entries, host }) {
72
+ return _jsx(_Fragment, { children: entries.map((e, i) => {
73
+ if (e.kind === "separator")
74
+ return _jsx(BaseMenu.Separator, { className: "o-list-sep" }, i);
75
+ if (e.kind === "group")
76
+ return (_jsxs(BaseMenu.Group, { children: [_jsx(BaseMenu.GroupLabel, { className: "o-list-heading", children: e.heading }), _jsx(MenuListRows, { entries: e.entries, host: host })] }, i));
77
+ if (e.kind === "check")
78
+ return (_jsx(BaseMenu.CheckboxItem, { label: e.label, checked: e.checked, defaultChecked: e.defaultChecked, onCheckedChange: (c) => e.onCheckedChange?.(c), disabled: !!e.disabled, title: e.disabled, className: "o-list-row o-smooth o-smooth-ease o-menu-row o-menu-check", children: checkBody(e) }, i));
79
+ if (e.kind === "link")
80
+ return (_jsx(BaseMenu.LinkItem, { href: e.href, render: e.render, label: e.label, onClick: e.onSelect, closeOnClick: true, className: "o-list-row o-smooth o-smooth-ease o-menu-row", ...(e.external ? { target: "_blank", rel: "noreferrer" } : {}), children: linkBody(e) }, i));
81
+ if (e.kind === "actions")
82
+ return _jsx(Sub, { trigger: actionsBody(e), host: host, children: _jsx(MenuListRows, { entries: e.entries, host: host }) }, i);
83
+ if (e.kind === "pick")
84
+ return (_jsxs(BaseMenu.Group, { children: [e.heading && _jsx(BaseMenu.GroupLabel, { className: "o-list-heading", children: e.heading }), _jsx(BaseMenu.RadioGroup, { value: e.value, onValueChange: (v) => e.onChoose?.(v), children: e.choices.map((c) => _jsx(BaseMenu.RadioItem, { value: c.value, closeOnClick: true, className: "o-list-row o-smooth o-smooth-ease o-menu-row", children: choiceBody(c) }, c.value)) })] }, i));
85
+ if (e.kind === "choices")
86
+ return (_jsx(Sub, { trigger: choicesBody(e), host: host, children: _jsx(BaseMenu.RadioGroup, { value: e.value, onValueChange: (v) => e.onChoose?.(v), children: e.choices.map((c) => _jsx(BaseMenu.RadioItem, { value: c.value, label: c.label, closeOnClick: true, className: "o-list-row o-smooth o-smooth-ease o-menu-row", children: choiceBody(c) }, c.value)) }) }, i));
87
+ return _jsx(BaseMenu.Item, { label: e.label, className: rowClass(e), disabled: !!e.disabled, title: e.disabled, onClick: e.onSelect, children: actionBody(e) }, i);
88
+ }) });
89
+ }
90
+ export function MenuListShown({ entries, label, open, on = [], className }) {
91
+ const lit = (name) => (on.includes(name) ? { "data-force": "hover" } : {});
92
+ const panel = (rows, cls = "") => _jsx("div", { className: cx("o-list o-menu o-smooth o-smooth-ease", cls), role: "menu", "aria-label": label, "data-kit": "menu", children: rows });
93
+ const choiceRows = (e, prefix = "") => e.choices.map((c) => (_jsx("div", { role: "menuitemradio", "aria-checked": c.value === e.value, className: "o-list-row o-smooth o-smooth-ease o-menu-row", ...lit(prefix + c.label), children: choiceBody(c) }, c.value)));
94
+ const rows = (list, prefix = "") => list.map((e, i) => {
95
+ if (e.kind === "separator")
96
+ return _jsx("div", { role: "separator", className: "o-list-sep" }, i);
97
+ if (e.kind === "pick")
98
+ return _jsxs(React.Fragment, { children: [e.heading && _jsx("p", { className: "o-list-heading", children: e.heading }), choiceRows(e, prefix)] }, i);
99
+ if (e.kind === "group")
100
+ return _jsxs(React.Fragment, { children: [_jsx("p", { className: "o-list-heading", children: e.heading }), rows(e.entries, prefix)] }, i);
101
+ if (e.kind === "check") {
102
+ const ticked = !!(e.checked ?? e.defaultChecked);
103
+ return _jsx("div", { role: "menuitemcheckbox", "aria-checked": ticked, "aria-disabled": e.disabled ? true : undefined, title: e.disabled, ...(e.disabled ? { "data-disabled": "" } : {}), className: "o-list-row o-smooth o-smooth-ease o-menu-row o-menu-check", ...lit(prefix + e.label), children: checkBody(e) }, i);
104
+ }
105
+ if (e.kind === "link")
106
+ return _jsx("div", { role: "menuitem", className: "o-list-row o-smooth o-smooth-ease o-menu-row", ...lit(prefix + e.label), children: linkBody(e) }, i);
107
+ if (e.kind === "choices" || e.kind === "actions")
108
+ return (_jsxs("div", { className: "o-menu-subwrap", children: [_jsx("div", { role: "menuitem", "aria-haspopup": "menu", "aria-expanded": open === e.label, className: "o-list-row o-smooth o-smooth-ease o-menu-row", ...(open === e.label ? { "data-popup-open": "" } : lit(prefix + e.label)), children: e.kind === "choices" ? choicesBody(e) : actionsBody(e) }), open === e.label && panel(e.kind === "choices" ? choiceRows(e, `${e.label}/`) : rows(e.entries, `${e.label}/`), "o-menu-sub")] }, i));
109
+ return _jsx("div", { role: "menuitem", "aria-disabled": e.disabled ? true : undefined, title: e.disabled, ...(e.disabled ? { "data-disabled": "" } : {}), className: rowClass(e), ...lit(prefix + e.label), children: actionBody(e) }, i);
110
+ });
111
+ const menu = panel(rows(entries), className);
112
+ return open ? _jsx("div", { className: "o-menu-pair", children: menu }) : menu;
113
+ }
114
+ const grippedOf = (list) => list.flatMap((e) => (e.kind === "group" ? grippedOf(e.entries) : e.kind !== "separator" && e.kind !== "pick" && e.grip && !("disabled" in e && e.disabled) ? [e] : []));
115
+ const disabledProps = (why) => (why ? { "aria-disabled": true, "data-disabled": "", title: why } : {});
116
+ function PanelCheck({ e, item, ticks, grip, id }) {
117
+ const [own, setOwn] = React.useState(!!e.defaultChecked), on = e.checked ?? own;
118
+ const press = () => { if (e.disabled)
119
+ return; const next = !on; if (e.checked === undefined)
120
+ setOwn(next); e.onCheckedChange?.(next); };
121
+ if (ticks === "eye")
122
+ return (_jsxs("div", { role: "menuitemcheckbox", "aria-checked": on, ...disabledProps(e.disabled), ...item, onClick: press, className: "o-list-row o-smooth o-smooth-ease o-menu-row o-menu-eyed", children: [grip, e.icon, _jsx("span", { className: "o-menu-name", id: part(id, "n"), children: e.label }), eyeOf(on, "o-menu-eye")] }));
123
+ return ticks === "switch" ? (_jsxs("div", { role: "menuitemcheckbox", "aria-checked": on, ...disabledProps(e.disabled), ...item, onClick: press, className: "o-list-row o-smooth o-smooth-ease o-menu-row o-menu-switch", children: [grip, e.icon, _jsx("span", { className: "o-menu-name", id: part(id, "n"), children: e.label }), _jsx(Switch, { size: "sm", checked: on, onCheckedChange: () => { }, disabled: !!e.disabled, tabIndex: -1, "aria-hidden": true, onMouseDown: (ev) => { ev.preventDefault(); ev.currentTarget.closest("[data-item]")?.focus({ preventScroll: true }); } })] })) : (_jsxs("div", { role: "menuitemcheckbox", "aria-checked": on, ...disabledProps(e.disabled), ...item, onClick: press, className: "o-list-row o-smooth o-smooth-ease o-menu-row o-menu-check", children: [grip, checkBody(e, id)] }));
124
+ }
125
+ export function MenuListPanelRows({ label, entries, onOpen, ticks = "box", onMove, className }) {
126
+ const root = React.useRef(null);
127
+ const [lit, setLit] = React.useState(null), [stop, setStop] = React.useState(0);
128
+ const typed = React.useRef({ text: "", at: 0 });
129
+ const focusIn = React.useRef(false);
130
+ const gripped = grippedOf(entries);
131
+ const firstGrip = React.useRef(0);
132
+ const ids = React.useId(), [said, setSaid] = React.useState("");
133
+ const idOf = (e) => { const g = gripped.indexOf(e); return g >= 0 ? `${ids}r${g}` : undefined; };
134
+ const { gripProps, lift, dragging } = useReorder({ count: gripped.length, grip: ".o-menu-grip", onMove: (from, to) => {
135
+ const at = (x) => {
136
+ const k = x - firstGrip.current;
137
+ if (k < 0 || k >= gripped.length)
138
+ return x;
139
+ return firstGrip.current + (k === from ? to : from < to && k > from && k <= to ? k - 1 : from > to && k >= to && k < from ? k + 1 : k);
140
+ };
141
+ setLit((l) => (l == null ? l : at(l)));
142
+ setStop(at);
143
+ setSaid(movedTo(gripped, from, to));
144
+ onMove?.(from, to);
145
+ } });
146
+ const rowsNow = () => [...(root.current?.querySelectorAll("[data-item]") ?? [])];
147
+ const offIn = (rows) => (i) => rows[i]?.getAttribute("aria-disabled") === "true";
148
+ React.useLayoutEffect(() => {
149
+ const rows = rowsNow(), off = offIn(rows), lost = focusIn.current && !root.current?.contains(document.activeElement);
150
+ if (stop < rows.length && !off(stop)) {
151
+ if (lost)
152
+ rows[stop].focus({ preventScroll: true });
153
+ return;
154
+ }
155
+ const to = rowFor("Home", -1, rows.length, off) ?? 0;
156
+ setStop(to);
157
+ setLit((l) => (l != null && l < rows.length ? l : null));
158
+ if (lost)
159
+ rows[to]?.focus({ preventScroll: true });
160
+ });
161
+ const focusAt = (i) => { setStop(i); setLit(i); rowsNow()[i]?.focus({ preventScroll: true }); };
162
+ const onKeyDown = (ev) => {
163
+ const rows = rowsNow(), at = rows.findIndex((r) => r.contains(ev.target)), row = rows[at];
164
+ if (at < 0 || ev.metaKey || ev.ctrlKey || ev.altKey)
165
+ return;
166
+ const off = offIn(rows), to = rowFor(ev.key, at, rows.length, off);
167
+ if (to != null) {
168
+ ev.preventDefault();
169
+ focusAt(to);
170
+ return;
171
+ }
172
+ if (ev.key === "ArrowLeft" && ev.target === row) {
173
+ const grip = row.querySelector(":scope > .o-menu-grip");
174
+ if (grip) {
175
+ ev.preventDefault();
176
+ grip.focus({ preventScroll: true });
177
+ }
178
+ return;
179
+ }
180
+ if (ev.key === "Enter" || ev.key === " " || (ev.key === "ArrowRight" && row.hasAttribute("data-level"))) {
181
+ if (ev.key === "Enter" && row.tagName === "A")
182
+ return;
183
+ ev.preventDefault();
184
+ row.click();
185
+ return;
186
+ }
187
+ if (ev.key.length === 1 && ev.key !== " ") {
188
+ const now = Date.now(), t = typed.current;
189
+ t.text = now - t.at > 500 ? ev.key : t.text + ev.key;
190
+ t.at = now;
191
+ const names = rows.map((r) => r.querySelector(".o-menu-name")?.textContent ?? "");
192
+ const found = rowStarting(names, at, t.text, off);
193
+ if (found != null) {
194
+ ev.preventDefault();
195
+ focusAt(found);
196
+ }
197
+ }
198
+ };
199
+ const onPointerLeave = () => { const rows = rowsNow(), at = rows.indexOf(document.activeElement); setLit(at >= 0 ? at : null); };
200
+ const onBlur = (ev) => { if (!root.current?.contains(ev.relatedTarget)) {
201
+ setLit(null);
202
+ focusIn.current = false;
203
+ } };
204
+ let n = 0;
205
+ const item = (e) => {
206
+ const i = n++, g = e ? gripped.indexOf(e) : -1;
207
+ if (g === 0)
208
+ firstGrip.current = i;
209
+ return {
210
+ ...(g >= 0 ? { "data-row": g, ...(dragging === g ? { "data-lifted": "" } : {}), style: lift(g), "aria-labelledby": named(`${ids}r${g}`), "aria-describedby": `${ids}how` } : {}),
211
+ "data-item": "", tabIndex: i === stop ? 0 : -1, ...(lit === i ? { "data-highlighted": "" } : {}),
212
+ onFocus: () => { setStop(i); setLit(i); focusIn.current = true; },
213
+ onPointerMove: (ev) => {
214
+ if (lit !== i)
215
+ setLit(i);
216
+ if (root.current?.contains(document.activeElement) && document.activeElement !== ev.currentTarget)
217
+ ev.currentTarget.focus({ preventScroll: true });
218
+ },
219
+ };
220
+ };
221
+ const ROW = "o-list-row o-smooth o-smooth-ease o-menu-row";
222
+ const gripFor = (e) => {
223
+ const g = gripped.indexOf(e);
224
+ if (g < 0 && gripped.length)
225
+ return _jsx("span", { className: "o-menu-grip-room", "aria-hidden": "true", inert: true, children: _jsx(Grip, { label: "", tabIndex: -1 }) });
226
+ if (g < 0 || !("label" in e))
227
+ return null;
228
+ const own = gripProps(g);
229
+ return (_jsx(Grip, { label: `Move ${e.label}`, className: "o-menu-grip", tabIndex: -1, ...own, onClick: (ev) => ev.stopPropagation(), onKeyDown: (ev) => {
230
+ if (ev.key === "ArrowRight" || ev.key === "Escape") {
231
+ ev.preventDefault();
232
+ ev.stopPropagation();
233
+ ev.currentTarget.closest("[data-item]")?.focus({ preventScroll: true });
234
+ return;
235
+ }
236
+ if (ev.key === "Enter" || ev.key === " ") {
237
+ ev.stopPropagation();
238
+ return;
239
+ }
240
+ own.onKeyDown(ev);
241
+ } }));
242
+ };
243
+ const rows = (list) => list.map((e, at) => {
244
+ const k = "label" in e ? `${e.kind ?? "action"}:${e.label}` : "heading" in e && e.heading ? `${e.kind}:${e.heading}` : at;
245
+ if (e.kind === "separator")
246
+ return _jsx("div", { role: "separator", className: "o-list-sep" }, k);
247
+ if (e.kind === "group")
248
+ return _jsxs("div", { role: "group", "aria-label": e.heading, children: [_jsx("p", { className: "o-list-heading", children: e.heading }), rows(e.entries)] }, k);
249
+ if (e.kind === "pick")
250
+ return (_jsxs("div", { role: "group", "aria-label": e.heading, children: [e.heading && _jsx("p", { className: "o-list-heading", children: e.heading }), e.choices.map((c) => _jsx("div", { role: "menuitemradio", "aria-checked": c.value === e.value, ...item(), onClick: () => e.onChoose?.(c.value), className: ROW, children: choiceBody(c) }, c.value))] }, k));
251
+ if (e.kind === "check")
252
+ return _jsx(PanelCheck, { e: e, item: item(e), ticks: ticks, grip: gripFor(e), id: idOf(e) }, k);
253
+ if (e.kind === "link") {
254
+ const attrs = { role: "menuitem", ...item(e), className: ROW, onClick: e.onSelect, ...(e.external ? { target: "_blank", rel: "noreferrer" } : {}) };
255
+ return e.render ? React.cloneElement(e.render, { key: k, ...attrs }, gripFor(e), linkBody(e, idOf(e))) : _jsxs("a", { href: e.href, ...attrs, children: [gripFor(e), linkBody(e, idOf(e))] }, k);
256
+ }
257
+ if (e.kind === "actions" || e.kind === "choices")
258
+ return (_jsxs("div", { role: "menuitem", "data-level": "", ...item(e), onClick: () => onOpen?.(e), className: ROW, children: [gripFor(e), e.kind === "choices" ? choicesBody(e, idOf(e)) : actionsBody(e, idOf(e))] }, k));
259
+ return _jsxs("div", { role: "menuitem", ...disabledProps(e.disabled), ...item(e), onClick: () => { if (!e.disabled)
260
+ e.onSelect?.(); }, className: rowClass(e), children: [gripFor(e), actionBody(e, idOf(e))] }, k);
261
+ });
262
+ return (_jsxs("div", { ref: root, role: "menu", "aria-label": label, className: cx("o-menu-rows", className), "data-kit": "menu-list", onKeyDown: onKeyDown, onPointerLeave: onPointerLeave, onBlur: onBlur, children: [rows(entries), gripped.length > 0 && _jsx(Says, { id: `${ids}how`, how: HOW_KEYS, said: said })] }));
263
+ }
264
+ export function tilesOf(entries, allRows) {
265
+ if (allRows)
266
+ return { entries };
267
+ const plain = entries.filter((e) => (e.kind === undefined || e.kind === "action") && !e.danger && !e.disabled && e.count == null).slice(0, 4);
268
+ if (plain.length < 3)
269
+ return { entries };
270
+ return { tiles: plain.map((e) => ({ icon: e.icon, label: e.label, onSelect: e.onSelect })), entries: entries.filter((e) => !plain.includes(e)) };
271
+ }
272
+ function sectionsOf(entries) {
273
+ const out = [];
274
+ let now = [];
275
+ const end = () => { if (now.length)
276
+ out.push({ rows: now }); now = []; };
277
+ for (const e of entries) {
278
+ if (e.kind === "separator") {
279
+ end();
280
+ continue;
281
+ }
282
+ if (e.kind === "group") {
283
+ end();
284
+ out.push({ name: e.heading, rows: sectionsOf(e.entries).flatMap((s) => s.rows) });
285
+ continue;
286
+ }
287
+ if (e.kind === "pick") {
288
+ end();
289
+ out.push({ name: e.heading, rows: e.choices.map((c) => ({ kind: "picked", label: c.label, icon: c.mark, chosen: c.value === e.value, onSelect: () => e.onChoose?.(c.value), end: c.detail })) });
290
+ continue;
291
+ }
292
+ now.push(e);
293
+ }
294
+ end();
295
+ return out;
296
+ }
297
+ const body = (r, why) => (_jsxs(_Fragment, { children: [r.icon && _jsx("span", { className: "o-menu-list-mark", children: r.icon }), _jsxs("span", { className: "o-menu-list-name", children: [_jsx("span", { children: r.label }), (why ?? r.note) != null && _jsx("span", { className: "o-menu-list-note", children: why ?? r.note })] })] }));
298
+ const endOf = (r) => {
299
+ const end = r.end ?? (r.kind === "actions" ? r.detail : r.kind === undefined || r.kind === "action" ? r.count : undefined);
300
+ return end != null ? _jsx("span", { className: "o-menu-list-end", "data-on": r.kind === "actions" && r.inForce ? "" : undefined, children: end }) : null;
301
+ };
302
+ function PhoneRow({ row, onOpen, move, room, ticks = "switch" }) {
303
+ const mv = move ? { "data-row": move.at, ...(move.lifted ? { "data-lifted": "" } : {}), style: move.style, ...move.drag } : {};
304
+ const how = move ? { "aria-describedby": move.how } : {};
305
+ const lead = move ? glyph(GRIP, "o-menu-list-grip") : room ? React.cloneElement(glyph(GRIP, "o-menu-list-grip"), { "data-room": "" }) : null;
306
+ if (row.kind === "check" && ticks === "eye")
307
+ return _jsx(PhoneEye, { row: row, lead: lead, mv: mv, how: how });
308
+ if (row.kind === "check")
309
+ return (_jsxs("label", { className: "o-menu-list-row", ...mv, children: [lead, row.icon && _jsx("span", { className: "o-menu-list-mark", children: row.icon }), _jsxs("span", { className: "o-menu-list-name", children: [_jsx("span", { children: row.label }), (row.disabled ?? row.note) != null && _jsx("span", { className: "o-menu-list-note", children: row.disabled ?? row.note })] }), _jsx(Switch, { size: "lg", checked: row.checked, defaultChecked: row.defaultChecked, onCheckedChange: (c) => row.onCheckedChange?.(c), disabled: !!row.disabled, ...how })] }));
310
+ if (row.kind === "link") {
311
+ const attrs = { className: "o-menu-list-row", ...mv, ...how, ...(row.external ? { target: "_blank", rel: "noreferrer" } : {}) };
312
+ const inside = _jsxs(_Fragment, { children: [lead, body(row), endOf(row), row.external ? glyph(AWAY, "o-menu-list-more") : glyph(MORE, "o-menu-list-more")] });
313
+ return row.render ? React.cloneElement(row.render, attrs, inside) : _jsx("a", { href: row.href, ...attrs, children: inside });
314
+ }
315
+ if (row.kind === "picked")
316
+ return _jsxs(BaseButton, { className: "o-menu-list-row", "aria-pressed": row.chosen, onClick: row.onSelect, children: [body(row), endOf(row), row.chosen && glyph(TICK, "o-menu-list-tick")] });
317
+ if (row.kind === "actions")
318
+ return _jsxs(BaseButton, { className: "o-menu-list-row", ...mv, ...how, onClick: () => onOpen?.(row), children: [lead, body(row), endOf(row), glyph(MORE, "o-menu-list-more")] });
319
+ if (row.kind === "choices")
320
+ return (_jsxs(BaseButton, { className: "o-menu-list-row", ...mv, ...how, onClick: () => onOpen?.(row), children: [lead, body(row), endOf(row), _jsx("span", { className: "o-menu-list-value", children: row.detail ?? row.choices.find((c) => c.value === row.value)?.label }), glyph(MORE, "o-menu-list-more")] }));
321
+ return _jsxs(BaseButton, { className: cx("o-menu-list-row", row.danger && "o-menu-list-danger"), ...mv, ...how, disabled: !!row.disabled, onClick: row.onSelect, children: [lead, body(row, row.disabled), endOf(row)] });
322
+ }
323
+ export function MenuListRow({ label, value, onSelect, className }) {
324
+ return _jsxs(BaseButton, { className: cx("o-menu-list-row", className), onClick: onSelect, children: [_jsx("span", { className: "o-menu-list-name", children: _jsx("span", { children: label }) }), _jsx("span", { className: "o-menu-list-value", children: value })] });
325
+ }
326
+ function PhoneEye({ row, lead, mv, how }) {
327
+ const [own, setOwn] = React.useState(!!row.defaultChecked), on = row.checked ?? own;
328
+ const press = () => { const next = !on; if (row.checked === undefined)
329
+ setOwn(next); row.onCheckedChange?.(next); };
330
+ return (_jsxs(BaseButton, { className: "o-menu-list-row", ...mv, ...how, role: "switch", "aria-checked": on, disabled: !!row.disabled, focusableWhenDisabled: true, onClick: press, children: [lead, row.icon && _jsx("span", { className: "o-menu-list-mark", children: row.icon }), _jsxs("span", { className: "o-menu-list-name", children: [_jsx("span", { children: row.label }), (row.disabled ?? row.note) != null && _jsx("span", { className: "o-menu-list-note", children: row.disabled ?? row.note })] }), eyeOf(on, "o-menu-list-eye")] }));
331
+ }
332
+ export function MenuList({ label, entries, tiles, onOpen, onClose, onMove, ticks, className }) {
333
+ const sections = React.useMemo(() => sectionsOf(entries).filter((s) => s.rows.length), [entries]);
334
+ const root = React.useRef(null), gripped = grippedOf(entries);
335
+ const ids = React.useId(), [said, setSaid] = React.useState("");
336
+ const { gripProps, lift, dragging } = useReorder({ count: gripped.length, grip: "[data-drag-start]", onMove: (from, to) => { setSaid(movedTo(gripped, from, to)); onMove?.(from, to); } });
337
+ const phoneDrag = useHoldDrag(root, gripProps, HOLD, gripped.length > 0);
338
+ const moveOf = (r) => {
339
+ const at = gripped.indexOf(r);
340
+ return at < 0 ? undefined : { at, lifted: dragging === at, style: lift(at), drag: phoneDrag(at), how: `${ids}how` };
341
+ };
342
+ return (_jsxs("div", { ref: root, role: "group", "aria-label": label, className: cx("o-menu-list", className), "data-kit": "menu-list", children: [onClose && _jsx("div", { className: "o-menu-list-section", children: _jsx(PhoneRow, { row: { icon: _jsx(Icon, { name: "x", size: 22 }), label: "Close", onSelect: onClose } }) }), tiles && (_jsx("div", { className: "o-menu-list-tiles", children: tiles.map((t) => _jsxs(BaseButton, { className: "o-menu-list-tile", disabled: t.disabled, onClick: t.onSelect, children: [_jsx("span", { className: "o-menu-list-mark", children: t.icon }), _jsx("span", { className: "o-menu-list-tile-name", children: t.label })] }, t.label)) })), sections.map((s, i) => {
343
+ const card = (_jsx("div", { role: s.name ? "group" : undefined, "aria-labelledby": s.name ? `${ids}h${i}` : undefined, className: "o-menu-list-section", children: s.rows.map((r) => _jsx(PhoneRow, { row: r, onOpen: onOpen, move: moveOf(r), room: gripped.length > 0, ticks: ticks }, r.label)) }, s.name ?? i));
344
+ return s.name ? _jsxs("div", { className: "o-menu-list-group", children: [_jsx("p", { id: `${ids}h${i}`, className: "o-list-heading", children: s.name }), card] }, `${i}${s.name}`) : card;
345
+ }), gripped.length > 0 && _jsx(Says, { id: `${ids}how`, how: HOW_HOLD, said: said })] }));
346
+ }
@@ -0,0 +1,187 @@
1
+ export declare const MENU_LIST_TOKENS: readonly [{
2
+ readonly name: "--vk-border";
3
+ readonly kind: "colour";
4
+ readonly outright: "--border";
5
+ }, {
6
+ readonly name: "--vk-border-brand";
7
+ readonly kind: "colour";
8
+ readonly outright: "--border-focused";
9
+ }, {
10
+ readonly name: "--vk-border-overlay-card";
11
+ readonly kind: "colour";
12
+ readonly outright: "--border-overlay-card";
13
+ }, {
14
+ readonly name: "--vk-danger";
15
+ readonly kind: "colour";
16
+ readonly outright: "--text-danger";
17
+ }, {
18
+ readonly name: "--vk-danger-subtlest";
19
+ readonly kind: "colour";
20
+ readonly outright: "--background-danger-subtlest";
21
+ }, {
22
+ readonly name: "--vk-fg";
23
+ readonly kind: "colour";
24
+ readonly outright: "--text";
25
+ }, {
26
+ readonly name: "--vk-fg-accent";
27
+ readonly kind: "colour";
28
+ readonly outright: "--text-brand";
29
+ }, {
30
+ readonly name: "--vk-fg-disabled";
31
+ readonly kind: "colour";
32
+ readonly outright: "--text-disabled";
33
+ }, {
34
+ readonly name: "--vk-fg-inverse";
35
+ readonly kind: "colour";
36
+ readonly outright: "--text-inverse";
37
+ }, {
38
+ readonly name: "--vk-fg-subtle";
39
+ readonly kind: "colour";
40
+ readonly outright: "--text-subtle";
41
+ }, {
42
+ readonly name: "--vk-fg-subtlest";
43
+ readonly kind: "colour";
44
+ readonly outright: "--text-subtlest";
45
+ }, {
46
+ readonly name: "--vk-label-amber";
47
+ readonly kind: "colour";
48
+ readonly outright: "--label-amber";
49
+ }, {
50
+ readonly name: "--vk-label-amber-pressed";
51
+ readonly kind: "colour";
52
+ readonly outright: "--label-amber-pressed";
53
+ }, {
54
+ readonly name: "--vk-label-blue";
55
+ readonly kind: "colour";
56
+ readonly outright: "--label-blue";
57
+ }, {
58
+ readonly name: "--vk-label-blue-pressed";
59
+ readonly kind: "colour";
60
+ readonly outright: "--label-blue-pressed";
61
+ }, {
62
+ readonly name: "--vk-label-green";
63
+ readonly kind: "colour";
64
+ readonly outright: "--label-green";
65
+ }, {
66
+ readonly name: "--vk-label-green-pressed";
67
+ readonly kind: "colour";
68
+ readonly outright: "--label-green-pressed";
69
+ }, {
70
+ readonly name: "--vk-label-purple";
71
+ readonly kind: "colour";
72
+ readonly outright: "--label-purple";
73
+ }, {
74
+ readonly name: "--vk-label-purple-pressed";
75
+ readonly kind: "colour";
76
+ readonly outright: "--label-purple-pressed";
77
+ }, {
78
+ readonly name: "--vk-neutral";
79
+ readonly kind: "colour";
80
+ readonly outright: "--background-neutral";
81
+ }, {
82
+ readonly name: "--vk-overlay";
83
+ readonly kind: "colour";
84
+ readonly outright: "--surface-overlay";
85
+ }, {
86
+ readonly name: "--vk-overlay-card";
87
+ readonly kind: "colour";
88
+ readonly outright: "--surface-overlay-card";
89
+ }, {
90
+ readonly name: "--vk-overlay-card-pressed";
91
+ readonly kind: "colour";
92
+ readonly outright: "--surface-overlay-card-pressed";
93
+ }, {
94
+ readonly name: "--vk-overlay-pressed";
95
+ readonly kind: "colour";
96
+ readonly outright: "--surface-overlay-pressed";
97
+ }, {
98
+ readonly name: "--vk-shadow-2xl";
99
+ readonly kind: "shadow";
100
+ readonly outright: "--shadow-2xl";
101
+ }, {
102
+ readonly name: "--vk-shadow-lg";
103
+ readonly kind: "shadow";
104
+ readonly outright: "--shadow-lg";
105
+ }, {
106
+ readonly name: "--vk-border-width";
107
+ readonly kind: "size";
108
+ readonly outright: "--border-width";
109
+ }, {
110
+ readonly name: "--vk-focus-width";
111
+ readonly kind: "size";
112
+ readonly outright: "--focus-width";
113
+ }, {
114
+ readonly name: "--vk-font-size-base";
115
+ readonly kind: "size";
116
+ readonly outright: "--text-base";
117
+ }, {
118
+ readonly name: "--vk-font-size-sm";
119
+ readonly kind: "size";
120
+ readonly outright: "--text-sm";
121
+ }, {
122
+ readonly name: "--vk-font-size-xs";
123
+ readonly kind: "size";
124
+ readonly outright: "--text-xs";
125
+ }, {
126
+ readonly name: "--vk-font-weight-medium";
127
+ readonly kind: "size";
128
+ readonly outright: "--font-weight-medium";
129
+ }, {
130
+ readonly name: "--vk-layer-popup";
131
+ readonly kind: "size";
132
+ readonly outright: "--layer-popup";
133
+ }, {
134
+ readonly name: "--vk-line-height-base";
135
+ readonly kind: "size";
136
+ readonly outright: "--text-base--line-height";
137
+ }, {
138
+ readonly name: "--vk-line-height-sm";
139
+ readonly kind: "size";
140
+ readonly outright: "--text-sm--line-height";
141
+ }, {
142
+ readonly name: "--vk-radius-2xl";
143
+ readonly kind: "size";
144
+ readonly outright: "--radius-2xl";
145
+ }, {
146
+ readonly name: "--vk-radius-full";
147
+ readonly kind: "size";
148
+ readonly outright: "--radius-full";
149
+ }, {
150
+ readonly name: "--vk-radius-lg";
151
+ readonly kind: "size";
152
+ readonly outright: "--radius-lg";
153
+ }, {
154
+ readonly name: "--vk-radius-sm";
155
+ readonly kind: "size";
156
+ readonly outright: "--radius-sm";
157
+ }, {
158
+ readonly name: "--vk-radius-xl";
159
+ readonly kind: "size";
160
+ readonly outright: "--radius-xl";
161
+ }, {
162
+ readonly name: "--vk-spacing";
163
+ readonly kind: "size";
164
+ readonly outright: "--spacing";
165
+ }, {
166
+ readonly name: "--vk-duration-fast";
167
+ readonly kind: "motion";
168
+ readonly outright: "--duration-fast";
169
+ }, {
170
+ readonly name: "--vk-ease-in";
171
+ readonly kind: "motion";
172
+ readonly outright: "--ease-in";
173
+ }, {
174
+ readonly name: "--vk-ease-out";
175
+ readonly kind: "motion";
176
+ readonly outright: "--ease-out";
177
+ }, {
178
+ readonly name: "--vk-hold-delay";
179
+ readonly kind: "motion";
180
+ readonly outright: "--hold-delay";
181
+ }, {
182
+ readonly name: "--vk-submenu-delay";
183
+ readonly kind: "motion";
184
+ readonly outright: "--submenu-delay";
185
+ }];
186
+ /** The menu list's own machinery: its rows' height, inset, corners and lines, and the times it hands its script. */
187
+ export declare const MENU_LIST_PRIVATE: readonly ["--menu-list-", "--menu-sub-"];
@@ -0,0 +1,49 @@
1
+ export const MENU_LIST_TOKENS = [
2
+ { name: "--vk-border", kind: "colour", outright: "--border" },
3
+ { name: "--vk-border-brand", kind: "colour", outright: "--border-focused" },
4
+ { name: "--vk-border-overlay-card", kind: "colour", outright: "--border-overlay-card" },
5
+ { name: "--vk-danger", kind: "colour", outright: "--text-danger" },
6
+ { name: "--vk-danger-subtlest", kind: "colour", outright: "--background-danger-subtlest" },
7
+ { name: "--vk-fg", kind: "colour", outright: "--text" },
8
+ { name: "--vk-fg-accent", kind: "colour", outright: "--text-brand" },
9
+ { name: "--vk-fg-disabled", kind: "colour", outright: "--text-disabled" },
10
+ { name: "--vk-fg-inverse", kind: "colour", outright: "--text-inverse" },
11
+ { name: "--vk-fg-subtle", kind: "colour", outright: "--text-subtle" },
12
+ { name: "--vk-fg-subtlest", kind: "colour", outright: "--text-subtlest" },
13
+ { name: "--vk-label-amber", kind: "colour", outright: "--label-amber" },
14
+ { name: "--vk-label-amber-pressed", kind: "colour", outright: "--label-amber-pressed" },
15
+ { name: "--vk-label-blue", kind: "colour", outright: "--label-blue" },
16
+ { name: "--vk-label-blue-pressed", kind: "colour", outright: "--label-blue-pressed" },
17
+ { name: "--vk-label-green", kind: "colour", outright: "--label-green" },
18
+ { name: "--vk-label-green-pressed", kind: "colour", outright: "--label-green-pressed" },
19
+ { name: "--vk-label-purple", kind: "colour", outright: "--label-purple" },
20
+ { name: "--vk-label-purple-pressed", kind: "colour", outright: "--label-purple-pressed" },
21
+ { name: "--vk-neutral", kind: "colour", outright: "--background-neutral" },
22
+ { name: "--vk-overlay", kind: "colour", outright: "--surface-overlay" },
23
+ { name: "--vk-overlay-card", kind: "colour", outright: "--surface-overlay-card" },
24
+ { name: "--vk-overlay-card-pressed", kind: "colour", outright: "--surface-overlay-card-pressed" },
25
+ { name: "--vk-overlay-pressed", kind: "colour", outright: "--surface-overlay-pressed" },
26
+ { name: "--vk-shadow-2xl", kind: "shadow", outright: "--shadow-2xl" },
27
+ { name: "--vk-shadow-lg", kind: "shadow", outright: "--shadow-lg" },
28
+ { name: "--vk-border-width", kind: "size", outright: "--border-width" },
29
+ { name: "--vk-focus-width", kind: "size", outright: "--focus-width" },
30
+ { name: "--vk-font-size-base", kind: "size", outright: "--text-base" },
31
+ { name: "--vk-font-size-sm", kind: "size", outright: "--text-sm" },
32
+ { name: "--vk-font-size-xs", kind: "size", outright: "--text-xs" },
33
+ { name: "--vk-font-weight-medium", kind: "size", outright: "--font-weight-medium" },
34
+ { name: "--vk-layer-popup", kind: "size", outright: "--layer-popup" },
35
+ { name: "--vk-line-height-base", kind: "size", outright: "--text-base--line-height" },
36
+ { name: "--vk-line-height-sm", kind: "size", outright: "--text-sm--line-height" },
37
+ { name: "--vk-radius-2xl", kind: "size", outright: "--radius-2xl" },
38
+ { name: "--vk-radius-full", kind: "size", outright: "--radius-full" },
39
+ { name: "--vk-radius-lg", kind: "size", outright: "--radius-lg" },
40
+ { name: "--vk-radius-sm", kind: "size", outright: "--radius-sm" },
41
+ { name: "--vk-radius-xl", kind: "size", outright: "--radius-xl" },
42
+ { name: "--vk-spacing", kind: "size", outright: "--spacing" },
43
+ { name: "--vk-duration-fast", kind: "motion", outright: "--duration-fast" },
44
+ { name: "--vk-ease-in", kind: "motion", outright: "--ease-in" },
45
+ { name: "--vk-ease-out", kind: "motion", outright: "--ease-out" },
46
+ { name: "--vk-hold-delay", kind: "motion", outright: "--hold-delay" },
47
+ { name: "--vk-submenu-delay", kind: "motion", outright: "--submenu-delay" },
48
+ ];
49
+ export const MENU_LIST_PRIVATE = ["--menu-list-", "--menu-sub-"];