viewkitjs 0.27.0 → 0.28.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 (229) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/MIGRATION.md +40 -3
  3. package/package.json +1 -1
  4. package/views/dist/cells/cell-format.d.ts +3 -1
  5. package/views/dist/cells/cell-format.js +2 -2
  6. package/views/dist/cells/use-cell-format.d.ts +8 -1
  7. package/views/dist/cells/use-cell-format.js +13 -2
  8. package/views/dist/contract.d.ts +70 -3
  9. package/views/dist/contract.js +76 -0
  10. package/views/dist/controls/alert/alert.d.ts +46 -0
  11. package/views/dist/controls/alert/alert.js +11 -0
  12. package/views/dist/controls/alert/looks.d.ts +4 -0
  13. package/views/dist/controls/alert/looks.js +19 -0
  14. package/views/dist/controls/alert/tokens.d.ts +92 -0
  15. package/views/dist/controls/alert/tokens.js +25 -0
  16. package/views/dist/controls/alert-dialog/alert-dialog.d.ts +50 -0
  17. package/views/dist/controls/alert-dialog/alert-dialog.js +67 -0
  18. package/views/dist/controls/alert-dialog/confirm.d.ts +13 -0
  19. package/views/dist/controls/alert-dialog/confirm.js +11 -0
  20. package/views/dist/controls/alert-dialog/looks.d.ts +4 -0
  21. package/views/dist/controls/alert-dialog/looks.js +17 -0
  22. package/views/dist/controls/alert-dialog/tokens.d.ts +119 -0
  23. package/views/dist/controls/alert-dialog/tokens.js +32 -0
  24. package/views/dist/controls/alert-dialog.css +95 -0
  25. package/views/dist/controls/alert.css +51 -0
  26. package/views/dist/controls/collapsible/collapsible.d.ts +39 -0
  27. package/views/dist/controls/collapsible/collapsible.js +18 -0
  28. package/views/dist/controls/collapsible/looks.d.ts +4 -0
  29. package/views/dist/controls/collapsible/looks.js +5 -0
  30. package/views/dist/controls/collapsible/map-collapse.d.ts +2 -0
  31. package/views/dist/controls/collapsible/map-collapse.js +6 -0
  32. package/views/dist/controls/collapsible/tokens.d.ts +68 -0
  33. package/views/dist/controls/collapsible/tokens.js +19 -0
  34. package/views/dist/controls/collapsible.css +83 -0
  35. package/views/dist/controls/compound-editor/place-parts.js +5 -1
  36. package/views/dist/controls/controls.d.ts +9 -0
  37. package/views/dist/controls/controls.js +9 -0
  38. package/views/dist/controls/date-editor/date-editor.d.ts +2 -1
  39. package/views/dist/controls/date-editor/map-calendar.js +3 -1
  40. package/views/dist/controls/filter-editor/filter-editor.d.ts +56 -0
  41. package/views/dist/controls/filter-editor/filter-editor.js +208 -0
  42. package/views/dist/controls/filter-editor/how.d.ts +23 -0
  43. package/views/dist/controls/filter-editor/how.js +13 -0
  44. package/views/dist/controls/filter-editor/map-filter-body.d.ts +18 -0
  45. package/views/dist/controls/filter-editor/map-filter-body.js +164 -0
  46. package/views/dist/controls/filter-editor/map-rules.d.ts +85 -0
  47. package/views/dist/controls/filter-editor/map-rules.js +273 -0
  48. package/views/dist/controls/filter-editor/parts.d.ts +46 -0
  49. package/views/dist/controls/filter-editor/parts.js +75 -0
  50. package/views/dist/controls/filter-editor/rules.d.ts +104 -0
  51. package/views/dist/controls/filter-editor/rules.js +148 -0
  52. package/views/dist/controls/filter-editor/tokens.d.ts +83 -0
  53. package/views/dist/controls/filter-editor/tokens.js +23 -0
  54. package/views/dist/controls/filter-editor/words.d.ts +59 -0
  55. package/views/dist/controls/filter-editor/words.js +40 -0
  56. package/views/dist/controls/filter-editor.css +124 -0
  57. package/views/dist/controls/group-editor/group-editor.d.ts +56 -0
  58. package/views/dist/controls/group-editor/group-editor.js +126 -0
  59. package/views/dist/controls/group-editor/map-group-body.d.ts +19 -0
  60. package/views/dist/controls/group-editor/map-group-body.js +106 -0
  61. package/views/dist/controls/group-editor/rules.d.ts +48 -0
  62. package/views/dist/controls/group-editor/rules.js +41 -0
  63. package/views/dist/controls/group-editor/tokens.d.ts +15 -0
  64. package/views/dist/controls/group-editor/tokens.js +6 -0
  65. package/views/dist/controls/group-editor/words.d.ts +39 -0
  66. package/views/dist/controls/group-editor/words.js +21 -0
  67. package/views/dist/controls/group-editor.css +20 -0
  68. package/views/dist/controls/index.d.ts +19 -1
  69. package/views/dist/controls/index.js +19 -1
  70. package/views/dist/controls/internal/editor-parts.d.ts +8 -1
  71. package/views/dist/controls/internal/editor-parts.js +5 -0
  72. package/views/dist/controls/internal/step-return.d.ts +9 -0
  73. package/views/dist/controls/internal/step-return.js +27 -0
  74. package/views/dist/controls/links-editor/links-editor.d.ts +5 -3
  75. package/views/dist/controls/links-editor/links-editor.js +38 -17
  76. package/views/dist/controls/links-editor/map-links-body.js +4 -1
  77. package/views/dist/controls/links-editor.css +1 -1
  78. package/views/dist/controls/menu-list/menu-list.d.ts +17 -2
  79. package/views/dist/controls/menu-list/menu-list.js +25 -16
  80. package/views/dist/controls/modal/looks.d.ts +4 -0
  81. package/views/dist/controls/modal/looks.js +25 -0
  82. package/views/dist/controls/modal/modal.d.ts +69 -0
  83. package/views/dist/controls/modal/modal.js +62 -0
  84. package/views/dist/controls/modal/tokens.d.ts +192 -0
  85. package/views/dist/controls/modal/tokens.js +50 -0
  86. package/views/dist/controls/modal.css +130 -0
  87. package/views/dist/controls/notice/notice.d.ts +49 -0
  88. package/views/dist/controls/notice/notice.js +35 -0
  89. package/views/dist/controls/notice/tokens.d.ts +99 -0
  90. package/views/dist/controls/notice/tokens.js +27 -0
  91. package/views/dist/controls/notice.css +100 -0
  92. package/views/dist/controls/number-editor/number-editor.js +1 -1
  93. package/views/dist/controls/pane/looks.d.ts +4 -0
  94. package/views/dist/controls/pane/looks.js +11 -0
  95. package/views/dist/controls/pane/pane.d.ts +63 -0
  96. package/views/dist/controls/pane/pane.js +98 -0
  97. package/views/dist/controls/pane/state.d.ts +14 -0
  98. package/views/dist/controls/pane/state.js +7 -0
  99. package/views/dist/controls/pane/tokens.d.ts +79 -0
  100. package/views/dist/controls/pane/tokens.js +22 -0
  101. package/views/dist/controls/pane.css +104 -0
  102. package/views/dist/controls/picker/rows.d.ts +4 -2
  103. package/views/dist/controls/picker/rows.js +4 -3
  104. package/views/dist/controls/sort-editor/map-sort-body.d.ts +9 -0
  105. package/views/dist/controls/sort-editor/map-sort-body.js +81 -0
  106. package/views/dist/controls/sort-editor/rules.d.ts +48 -0
  107. package/views/dist/controls/sort-editor/rules.js +24 -0
  108. package/views/dist/controls/sort-editor/sort-editor.d.ts +58 -0
  109. package/views/dist/controls/sort-editor/sort-editor.js +180 -0
  110. package/views/dist/controls/sort-editor/tokens.d.ts +79 -0
  111. package/views/dist/controls/sort-editor/tokens.js +22 -0
  112. package/views/dist/controls/sort-editor/words.d.ts +48 -0
  113. package/views/dist/controls/sort-editor/words.js +25 -0
  114. package/views/dist/controls/sort-editor.css +96 -0
  115. package/views/dist/controls/toast/toast.d.ts +75 -0
  116. package/views/dist/controls/toast/toast.js +99 -0
  117. package/views/dist/controls/toast/tokens.d.ts +100 -0
  118. package/views/dist/controls/toast/tokens.js +27 -0
  119. package/views/dist/controls/toast.css +93 -0
  120. package/views/dist/controls/tokens.js +20 -0
  121. package/views/dist/controls/values-editor/values-editor.js +7 -1
  122. package/views/dist/display/date.js +2 -2
  123. package/views/dist/display/format.js +10 -2
  124. package/views/dist/display/options.d.ts +3 -1
  125. package/views/dist/display/use-display-options.d.ts +3 -0
  126. package/views/dist/display/use-display-options.js +10 -2
  127. package/views/dist/display/viewer.d.ts +1 -1
  128. package/views/dist/display/viewer.js +1 -1
  129. package/views/dist/editors/DateEditor.js +11 -9
  130. package/views/dist/editors/relation-panel.js +7 -1
  131. package/views/dist/editors/relation-picker.d.ts +2 -1
  132. package/views/dist/editors/relation-picker.js +4 -3
  133. package/views/dist/editors/relation-source.d.ts +4 -1
  134. package/views/dist/editors/relation-source.js +5 -2
  135. package/views/dist/field-row/editors/RowNumberEditor.js +2 -2
  136. package/views/dist/fields/number-edit.d.ts +6 -0
  137. package/views/dist/fields/number-edit.js +8 -1
  138. package/views/dist/grid/chrome/GridCellEditors.js +2 -2
  139. package/views/dist/grid/chrome/GridColumnDateSection.d.ts +4 -3
  140. package/views/dist/grid/chrome/GridColumnDateSection.js +4 -4
  141. package/views/dist/grid/chrome/GridColumnDurationSection.js +2 -2
  142. package/views/dist/grid/chrome/GridColumnMenu.js +6 -4
  143. package/views/dist/grid/chrome/GridFooter.js +2 -2
  144. package/views/dist/grid/chrome/grid-column-menu-items.js +4 -2
  145. package/views/dist/grid/chrome/useGridBandFigures.js +2 -2
  146. package/views/dist/grid/chrome/useGridFittedWidths.d.ts +3 -0
  147. package/views/dist/grid/chrome/useGridFittedWidths.js +9 -3
  148. package/views/dist/grid/chrome/useGridKeyboard.d.ts +4 -1
  149. package/views/dist/grid/chrome/useGridKeyboard.js +5 -2
  150. package/views/dist/grid/chrome/useGridTableInteractionModel.js +2 -1
  151. package/views/dist/grid/core/commit-model.d.ts +7 -0
  152. package/views/dist/grid/core/commit-model.js +5 -1
  153. package/views/dist/grid/core/editing-controller.js +10 -2
  154. package/views/dist/grid/core/editing-model.js +3 -7
  155. package/views/dist/grid/core/undo-owner.d.ts +6 -0
  156. package/views/dist/grid/core/undo-owner.js +13 -0
  157. package/views/dist/grid/core/useGridEditing.d.ts +2 -0
  158. package/views/dist/grid/core/useGridEditing.js +4 -0
  159. package/views/dist/looks/index.d.ts +5 -0
  160. package/views/dist/looks/index.js +5 -0
  161. package/views/dist/looks/pieces.js +10 -0
  162. package/views/dist/panels/model.d.ts +6 -1
  163. package/views/dist/panels/react/customize-body.d.ts +4 -2
  164. package/views/dist/panels/react/customize-body.js +3 -3
  165. package/views/dist/panels/react/customize.js +4 -2
  166. package/views/dist/panels/react/filter/FilterEditor.js +2 -2
  167. package/views/dist/panels/react/filter/PhoneFilterEditor.d.ts +8 -2
  168. package/views/dist/panels/react/filter/PhoneFilterEditor.js +9 -6
  169. package/views/dist/panels/react/filter/filter-body.d.ts +8 -5
  170. package/views/dist/panels/react/filter/filter-body.js +17 -6
  171. package/views/dist/panels/react/filter/filter-part-body.d.ts +4 -1
  172. package/views/dist/panels/react/filter/filter-part-body.js +3 -1
  173. package/views/dist/panels/react/panel-sheet.d.ts +5 -1
  174. package/views/dist/panels/react/panel-sheet.js +6 -2
  175. package/views/dist/panels/react/panel-step.d.ts +12 -0
  176. package/views/dist/panels/react/panel-step.js +26 -0
  177. package/views/dist/panels/react/sort/SortEditor.d.ts +4 -0
  178. package/views/dist/panels/react/sort/SortEditor.js +5 -2
  179. package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +8 -0
  180. package/views/dist/panels/react/toolbar/ReadyToolbar.js +84 -2
  181. package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +2 -2
  182. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.d.ts +16 -0
  183. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +49 -0
  184. package/views/dist/panels/react/toolbar/ToolbarFilterSheet.js +3 -1
  185. package/views/dist/panels/react/toolbar/ToolbarFilters.d.ts +4 -1
  186. package/views/dist/panels/react/toolbar/ToolbarFilters.js +36 -21
  187. package/views/dist/panels/react/toolbar/ToolbarQuickFilters.d.ts +4 -1
  188. package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +2 -2
  189. package/views/dist/panels/react/toolbar/ToolbarSortPill.d.ts +5 -0
  190. package/views/dist/panels/react/toolbar/ToolbarSortPill.js +15 -6
  191. package/views/dist/panels/react/toolbar/panel-part.d.ts +5 -1
  192. package/views/dist/panels/react/toolbar/panel-part.js +2 -2
  193. package/views/dist/panels/react/toolbar/use-filter-add.d.ts +16 -0
  194. package/views/dist/panels/react/toolbar/use-filter-add.js +32 -0
  195. package/views/dist/panels/react.d.ts +1 -0
  196. package/views/dist/panels/react.js +1 -0
  197. package/views/dist/panels/settings/filter-groups.js +35 -1
  198. package/views/dist/panels/settings/group-buckets.js +1 -0
  199. package/views/dist/provider/ViewsProvider.d.ts +7 -1
  200. package/views/dist/provider/ViewsProvider.js +23 -3
  201. package/views/dist/provider/components.d.ts +30 -4
  202. package/views/dist/provider/moment.d.ts +6 -0
  203. package/views/dist/provider/moment.js +10 -0
  204. package/views/dist/styles.css +847 -52
  205. package/views/dist/styles.unlayered.css +848 -52
  206. package/views/docs/contract.md +15 -9
  207. package/views/docs/controls/alert-dialog.md +37 -0
  208. package/views/docs/controls/alert.md +30 -0
  209. package/views/docs/controls/collapsible.md +22 -0
  210. package/views/docs/controls/filter-editor.md +28 -0
  211. package/views/docs/controls/group-editor.md +11 -0
  212. package/views/docs/controls/modal.md +55 -0
  213. package/views/docs/controls/notice.md +32 -0
  214. package/views/docs/controls/pane.md +25 -0
  215. package/views/docs/controls/sort-editor.md +27 -0
  216. package/views/docs/controls/toast.md +32 -0
  217. package/views/docs/guides/cells.md +1 -1
  218. package/views/docs/guides/display.md +1 -1
  219. package/views/docs/guides/the-grid.md +1 -1
  220. package/views/docs/guides/the-provider.md +19 -0
  221. package/views/docs/reference/cells.md +2 -2
  222. package/views/docs/reference/controls.md +213 -7
  223. package/views/docs/reference/display.md +2 -2
  224. package/views/docs/reference/editors-relation.md +1 -1
  225. package/views/docs/reference/looks.md +10 -0
  226. package/views/docs/reference/panels-react.md +7 -6
  227. package/views/docs/reference/panels.md +1 -1
  228. package/views/docs/reference/react.md +7 -7
  229. package/views/docs/reference/views.md +1 -0
@@ -0,0 +1,100 @@
1
+ /* The Notice. Every value it draws with is a public name (controls/notice/tokens.ts); this file only says which name
2
+ each part and meaning takes. Its actions are any
3
+ Button, a label's the Button's text kind; its × the quiet Button.
4
+
5
+ The rules sit in the components layer, so a utility class on a notice still wins. */
6
+ @layer components {
7
+
8
+ /* ── The notice: its meaning's ground, one step stronger than the palest, so it reads as its colour; no
9
+ edge (neutral, below, has a hairline); the radius's corners, 10px by 12px; the words in the text colour, never the meaning's ─────── */
10
+ .o-notice {
11
+ display: flex; align-items: flex-start; gap: calc(var(--vk-spacing) * 2.5); box-sizing: border-box; min-width: 0;
12
+ padding: calc(var(--vk-spacing) * 2.5) calc(var(--vk-spacing) * 3); border-radius: var(--vk-radius-lg); background-color: var(--notice-ground);
13
+ color: var(--vk-fg); font-size: var(--vk-font-size-sm); line-height: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm));
14
+ transition: opacity var(--vk-duration-fast) var(--vk-ease-in), translate var(--vk-duration-fast) var(--vk-ease-in);
15
+ }
16
+ /* The icon carries the meaning: 16px, level with the first line, 10px before the words. */
17
+ .o-notice-icon { flex: none; width: calc(var(--vk-spacing) * 4); height: calc(var(--vk-spacing) * 4); margin-top: calc(var(--vk-spacing) * 0.5); }
18
+ .o-notice[data-meaning="information"] { --notice-ground: var(--vk-info-subtler); }
19
+ .o-notice[data-meaning="information"] > .o-notice-icon { color: var(--vk-info); }
20
+ .o-notice[data-meaning="success"] { --notice-ground: var(--vk-success-subtler); }
21
+ .o-notice[data-meaning="success"] > .o-notice-icon { color: var(--vk-success); }
22
+ .o-notice[data-meaning="warning"] { --notice-ground: var(--vk-warning-subtler); }
23
+ .o-notice[data-meaning="warning"] > .o-notice-icon { color: var(--vk-warning); }
24
+ .o-notice[data-meaning="danger"] { --notice-ground: var(--vk-danger-subtler); }
25
+ .o-notice[data-meaning="danger"] > .o-notice-icon { color: var(--vk-danger); }
26
+ .o-notice-body { flex: 1 1 calc(var(--vk-spacing) * 55); min-width: 0; display: grid; gap: calc(var(--vk-spacing) * 0.5); }
27
+ .o-notice-body > p { margin: 0; }
28
+
29
+ /* ── Neutral: a plain fact with no colour of its own, a quiet well: the page's
30
+ sunken ground, a hairline edge inside, its icon in the quieter text colour ──────────────────────────────── */
31
+ .o-notice[data-meaning="neutral"] { --notice-ground: var(--vk-sunken); --notice-edge: var(--vk-border-subtle); box-shadow: inset 0 0 0 var(--vk-border-width) var(--vk-border-subtle); }
32
+ .o-notice[data-meaning="neutral"] > .o-notice-icon { color: var(--vk-fg-subtle); }
33
+ /* Its own icon, any 16px icon, in its meaning's colour like the meaning's own. */
34
+ span.o-notice-icon { display: grid; place-items: center; }
35
+ span.o-notice-icon > svg { width: 100%; height: 100%; }
36
+ /* Paragraphs, 8px apart; a link in its sentence underlined in the words' colour, as shadcn's. */
37
+ .o-notice-text > p { margin: 0; }
38
+ .o-notice-text > p + p { margin-top: calc(var(--vk-spacing) * 2); }
39
+ .o-notice-text a {
40
+ color: inherit; text-decoration: underline; text-decoration-thickness: var(--vk-border-width);
41
+ text-underline-offset: calc(var(--vk-spacing) * 0.75); text-decoration-color: var(--vk-fg-subtlest);
42
+ }
43
+ @media (hover: hover) { .o-notice-text a:hover { text-decoration-color: currentColor; } }
44
+
45
+ /* ── With a title: the title in semibold, the sentence under it quieter, 12px by 14px; its actions under
46
+ the sentence ──────────────────────────────────────────────────────────────────────────────────── */
47
+ .o-notice.o-notice-titled { gap: calc(var(--vk-spacing) * 3); padding: calc(var(--vk-spacing) * 3) calc(var(--vk-spacing) * 3.5); }
48
+ .o-notice-title { font-weight: var(--vk-font-weight-semibold); }
49
+ .o-notice-titled .o-notice-text { color: var(--vk-fg-subtle); }
50
+ .o-notice-below { display: flex; gap: calc(var(--vk-spacing) * 1); margin: calc(var(--vk-spacing) * 1.5) 0 0 calc(var(--vk-spacing) * -2.5); }
51
+ /* A first action that isn't the text kind (an outline) stands with its edge at the sentence's first letter. */
52
+ .o-notice-below:has(> :first-child:not(.o-button-text)) { margin-left: 0; }
53
+
54
+ /* ── Its actions at the end of its line; × puts it away: the Button, quiet, icon only, extra small ──── */
55
+ .o-notice-acts { flex: none; display: flex; align-items: center; gap: calc(var(--vk-spacing) * 0.5); margin: calc(var(--vk-spacing) * -1) calc(var(--vk-spacing) * -1.5) calc(var(--vk-spacing) * -1) 0; }
56
+ .o-button.o-notice-x { flex: none; margin: calc(var(--vk-spacing) * -1) calc(var(--vk-spacing) * -1.5) calc(var(--vk-spacing) * -1) 0; }
57
+ .o-notice-acts + .o-button.o-notice-x { margin-left: calc(var(--vk-spacing) * -2); }
58
+
59
+ /* ── Arrived because of something just done, it fades in; put away or resolved, it fades out ────────── */
60
+ .o-notice.o-notice-arrived { animation: vk-notice-fade-in var(--vk-duration-base) var(--vk-ease-out); }
61
+ .o-notice.o-notice-going { opacity: 0; translate: 0 calc(var(--vk-spacing) * -0.5); }
62
+
63
+ /* ── On the phone the actions drop under the sentence, lined up with it; × stays at the end of the first
64
+ line ────────────────────────────────────────────────────────────────────────────────────────────── */
65
+ .o-notice:where([data-vk-phone], [data-vk-phone] *) { flex-wrap: wrap; }
66
+ .o-notice-body:where([data-vk-phone], [data-vk-phone] *) { flex: 1 1 0; }
67
+ .o-notice:where([data-vk-phone], [data-vk-phone] *) > .o-notice-acts { order: 3; flex-basis: 100%; box-sizing: border-box; margin: calc(var(--vk-spacing) * 0.5) 0 calc(var(--vk-spacing) * -1.5); padding-left: calc(var(--vk-spacing) * 4); }
68
+ .o-notice-acts:where([data-vk-phone], [data-vk-phone] *) + .o-button.o-notice-x { margin-left: 0; }
69
+ /* A first action that isn't the text kind stands with its edge at the sentence's first letter: the icon and its gap. */
70
+ .o-notice:where([data-vk-phone], [data-vk-phone] *):has(> .o-notice-icon) > .o-notice-acts:has(> :first-child:not(.o-button-text)) { padding-left: calc(var(--vk-spacing) * 6.5); }
71
+ /* With no icon the sentence starts at the padding: so do the actions, the text kind's words with it. */
72
+ .o-notice:where([data-vk-phone], [data-vk-phone] *):not(:has(> .o-notice-icon)) > .o-notice-acts { padding-left: 0; }
73
+ .o-notice:where([data-vk-phone], [data-vk-phone] *):not(:has(> .o-notice-icon)) > .o-notice-acts:has(> :first-child.o-button-text) { margin-left: calc(var(--vk-spacing) * -2.5); }
74
+
75
+ /* Under reduced motion it just goes. */
76
+ @media (prefers-reduced-motion: reduce) { .o-notice { transition: none; } .o-notice.o-notice-arrived { animation: none; } }
77
+ /* ── Its corners smooth: following corner-smoothing, drawn with the smooth outline
78
+ (ViewKit's smooth.css) in every browser that knows shape(); one that doesn't keeps the corners above. Its round part is fitted to its
79
+ one line, as a control's is. Its ×, 6px in, rings itself 2px out, so the notice is never clipped: its edge (::before, neutral's
80
+ hairline, or its ground where it has none) and its ground (::after, a line in, its corner a line smaller) are layers inside it,
81
+ as the Popover's are. ── */
82
+ @supports (clip-path: shape(evenodd from 0 0, curve by 1px 1px with 1px 0 / 1px 0, close, move to 0 0, hline to 1px, close)) and (width: calc(tan(atan2(1px, 1px)) * 1px)) {
83
+ .o-notice {
84
+ --smooth-amount: var(--vk-corner-smoothing); --notice-side: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm) + var(--vk-spacing) * 5);
85
+ --notice-fit: min(var(--vk-radius-lg), var(--notice-side) / (2 + 2 * var(--smooth-amount, 0.7)));
86
+ --smooth-t: var(--notice-fit); --smooth-side: var(--notice-side);
87
+ position: relative; isolation: isolate; border-radius: var(--notice-fit); background-color: transparent; box-shadow: none;
88
+ }
89
+ .o-notice[data-meaning="neutral"] { box-shadow: none; }
90
+ .o-notice::before, .o-notice::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit; }
91
+ .o-notice::before { background-color: var(--notice-edge, var(--notice-ground)); clip-path: shape(var(--smooth-outline)); }
92
+ .o-notice::after {
93
+ --smooth-t: max(0px, var(--notice-fit) - var(--vk-border-width));
94
+ inset: var(--vk-border-width); border-radius: calc(var(--notice-fit) - var(--vk-border-width)); background-color: var(--notice-ground); clip-path: shape(var(--smooth-outline));
95
+ }
96
+ }
97
+ }
98
+
99
+ /* What arrives shows from nothing. */
100
+ @keyframes vk-notice-fade-in { from { opacity: 0; } }
@@ -92,7 +92,7 @@ export function useNumberEditor(props) {
92
92
  setChoosing(false);
93
93
  settled.current = false;
94
94
  } }, [wornAt, setDraft, setCode, setChoosing]);
95
- const items = list.map((c) => ({ value: c.code, label: c.name, ...(c.sign ? { as: { sign: c.sign } } : {}) }));
95
+ const items = list.map((c) => ({ value: c.code, label: c.name, also: [c.code], ...(c.sign ? { as: { sign: c.sign } } : {}) }));
96
96
  const back = () => { setChoosing(false); requestAnimationFrame(() => input.current?.focus({ preventScroll: true })); };
97
97
  const picker = usePicker({ label: words.name, items, value: code ?? null, onValueChange: (c) => { if (typeof c === "string")
98
98
  pick(c); }, onDone: back, search: phone ? words.search : words.find, form: phone ? "phone" : "computer", fromHeld: true, ...(w.picker ? { words: w.picker } : {}) });
@@ -0,0 +1,4 @@
1
+ import type { PieceLooks } from "../../looks/looks.js";
2
+ export type PaneOptionId = "place" | "corners" | "smoothing" | "shadow" | "edge" | "gap" | "padding";
3
+ /** The Pane's options. */
4
+ export declare const PANE_LOOKS: PieceLooks<PaneOptionId>;
@@ -0,0 +1,11 @@
1
+ const steps = (ids) => ids.map((id) => ({ id, name: id }));
2
+ const options = [
3
+ { id: "place", name: "Where it stands", device: "desktop", def: "list", values: [{ id: "list", name: "As tall as the list" }, { id: "fit", name: "Fitting what it holds" }] },
4
+ { id: "corners", name: "Corners", device: "desktop", def: "xl", kind: "steps", values: steps(["lg", "xl", "2xl"]) },
5
+ { id: "smoothing", name: "Corner smoothing", device: "desktop", def: "smooth", values: [{ id: "round", name: "Round" }, { id: "smooth", name: "Smooth" }] },
6
+ { id: "shadow", name: "Shadow", device: "desktop", def: "menu", kind: "steps", values: [{ id: "none", name: "None" }, { id: "menu", name: "Menu" }, { id: "lg", name: "Large" }, { id: "xl", name: "Extra large" }] },
7
+ { id: "edge", name: "Edge", device: "desktop", def: "outline", values: [{ id: "outline", name: "Outline" }, { id: "subtle", name: "Subtle" }, { id: "none", name: "None" }] },
8
+ { id: "gap", name: "Gap", device: "desktop", def: "8", kind: "steps", values: steps(["0", "4", "8", "12", "16"]) },
9
+ { id: "padding", name: "Padding", device: "desktop", def: "8", kind: "steps", values: steps(["0", "4", "8", "12", "16"]) },
10
+ ];
11
+ export const PANE_LOOKS = { id: "pane", name: "Pane", options, looks: [] };
@@ -0,0 +1,63 @@
1
+ import * as React from "react";
2
+ export { paneAfter, type PaneState, type PanePress } from "./state.js";
3
+ /** Why it closed, by the controls' one list of close reasons: Escape, its ✕; any other is `none`. What opened it,
4
+ * pressed again, closes it through usePane, never through onOpenChange. */
5
+ export type PaneCloseReason = "escape-key" | "close-press" | "none";
6
+ export interface PaneChangeDetails {
7
+ reason: PaneCloseReason;
8
+ /** What did it: the press, the key. */
9
+ event?: Event;
10
+ }
11
+ export interface PaneProps {
12
+ open: boolean;
13
+ /** It closes, and why: its holder sets `open` from it. */
14
+ onOpenChange: (open: boolean, details: PaneChangeDetails) => void;
15
+ /** The list's box it stands in: positioned, holding the list (which scrolls inside it) and never scrolling itself. Its portal
16
+ * takes no room there (display: contents). Until it is on the page (null), nothing is drawn. */
17
+ container: HTMLElement | null;
18
+ /** What opened it: the focus goes back to it as it closes. */
19
+ opener?: HTMLElement | null;
20
+ /** Whether the focus lands on it as it opens (the default); false where it stands open on a page that shows it, so the page
21
+ * takes no focus as it loads. */
22
+ initialFocus?: boolean;
23
+ /** What names it to a screen reader, when what stands in it has no PaneTitle. */
24
+ "aria-label"?: string;
25
+ className?: string;
26
+ /** What stands in it: a PaneHead, a PaneBody and a PaneFoot, each as it needs. */
27
+ children: React.ReactNode;
28
+ }
29
+ /** A list's panel at its right edge, the list in use beside it. */
30
+ export declare function Pane({ open, onOpenChange, container, opener, initialFocus, "aria-label": label, className, children }: PaneProps): import("react/jsx-runtime").JSX.Element | null;
31
+ type Slot = {
32
+ children: React.ReactNode;
33
+ className?: string;
34
+ };
35
+ /** Its head, which what stands in it fills: its title, its ✕. It stays at its top. */
36
+ export declare function PaneHead({ children, className }: Slot): import("react/jsx-runtime").JSX.Element;
37
+ /** What it holds, scrolling between its head and its foot. */
38
+ export declare function PaneBody({ children, className }: Slot): import("react/jsx-runtime").JSX.Element;
39
+ /** Its foot, under a line across the whole Pane, always at its foot. */
40
+ export declare function PaneFoot({ children, className }: Slot): import("react/jsx-runtime").JSX.Element;
41
+ /** Its title, which names it to a screen reader too. */
42
+ export declare function PaneTitle({ children, className }: Slot): import("react/jsx-runtime").JSX.Element;
43
+ /** What closes it from inside (a Button: `render`), with the reason close-press: what stands in it draws its own ✕. */
44
+ export declare function PaneClose({ render, children }: {
45
+ render: React.ReactElement;
46
+ children?: React.ReactNode;
47
+ }): import("react/jsx-runtime").JSX.Element;
48
+ /** A Pane's holder: what stands in it, one thing at a time, and what opened it. `opens(key)` is spread on each opener: its
49
+ * press puts its thing in the Pane, takes the place of another's, or closes its own. `pane` is spread on the Pane. `start`:
50
+ * what stands in it at first, open from the start (a page that shows it). */
51
+ export declare function usePane(start?: string | null): {
52
+ shown: string | null;
53
+ pane: {
54
+ open: boolean;
55
+ opener: HTMLElement | null;
56
+ onOpenChange: (next: boolean) => void;
57
+ };
58
+ opens: (key: string) => {
59
+ onClick: (e: React.MouseEvent<HTMLElement>) => void;
60
+ "aria-expanded": boolean;
61
+ };
62
+ close: () => void;
63
+ };
@@ -0,0 +1,98 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { Dialog } from "@base-ui/react/dialog";
4
+ import { cx } from "../../internal/cx.js";
5
+ import { closeReasonOf } from "../internal/close-reason.js";
6
+ import { Scrollbar } from "../scrollbar/scrollbar.js";
7
+ import { paneAfter } from "./state.js";
8
+ export { paneAfter } from "./state.js";
9
+ const REASONS = ["escape-key", "close-press"];
10
+ const reasonOf = (reason) => { const r = closeReasonOf(reason); return REASONS.find((x) => x === r) ?? "none"; };
11
+ const POPUP = "[role='menu'], [role='listbox'], [role='dialog'], [role='alertdialog'], [role='combobox'][aria-expanded='true']";
12
+ const opened = new Set();
13
+ let count = 0;
14
+ const inSight = (el) => !el.closest("[inert]") && (el.checkVisibility?.({ visibilityProperty: true }) ?? el.getClientRects().length > 0);
15
+ const depth = (el) => { let d = 0; for (let n = el; n; n = n.parentNode)
16
+ d++; return d; };
17
+ const nearness = (at, container) => { let n = container; while (n && !n.contains(at))
18
+ n = n.parentNode; return depth(n); };
19
+ function chosen(at, may) {
20
+ const all = [...opened].filter((o) => o.popup.current && may(o));
21
+ const seen = all.filter((o) => inSight(o.popup.current));
22
+ return (seen.length ? seen : all).reduce((best, o) => {
23
+ if (!best)
24
+ return o;
25
+ const a = nearness(at, o.container), b = nearness(at, best.container);
26
+ return a > b || (a === b && o.order > best.order) ? o : best;
27
+ }, undefined);
28
+ }
29
+ export function Pane({ open, onOpenChange, container, opener, initialFocus = true, "aria-label": label, className, children }) {
30
+ const popup = React.useRef(null);
31
+ const self = React.useRef(null);
32
+ React.useEffect(() => {
33
+ if (!open || !container)
34
+ return;
35
+ const entry = { popup, container, order: ++count };
36
+ self.current = entry;
37
+ opened.add(entry);
38
+ return () => { opened.delete(entry); self.current = null; };
39
+ }, [open, container]);
40
+ const change = (next, details) => {
41
+ if (next)
42
+ return;
43
+ if (details.reason === "escape-key") {
44
+ const at = details.event?.target instanceof Node ? details.event.target : document.activeElement ?? document.body;
45
+ const other = at instanceof Element ? at.closest(POPUP) : at.parentElement?.closest(POPUP) ?? null;
46
+ const mayClose = (box, list) => !other || other === box || !!box?.contains(other) || !!list && other.contains(list);
47
+ if (!mayClose(popup.current, container))
48
+ return details.cancel();
49
+ if (!popup.current?.contains(at) && chosen(at, (o) => mayClose(o.popup.current, o.container)) !== (self.current ?? undefined))
50
+ return details.cancel();
51
+ if (details.event?.defaultPrevented)
52
+ return details.cancel();
53
+ }
54
+ onOpenChange(false, { reason: reasonOf(details.reason), event: details.event });
55
+ };
56
+ const backTo = () => {
57
+ const now = document.activeElement;
58
+ if (now && now !== document.body && !popup.current?.contains(now))
59
+ return false;
60
+ return opener?.isConnected ? opener : true;
61
+ };
62
+ if (!container)
63
+ return null;
64
+ return (_jsx(Dialog.Root, { open: open, onOpenChange: change, modal: false, disablePointerDismissal: true, children: _jsx(Dialog.Portal, { container: container, className: "o-pane-portal", children: _jsx(Dialog.Popup, { ref: popup, className: cx("o-pane", className), "data-kit": "pane", "aria-label": label, initialFocus: initialFocus ? popup : false, finalFocus: backTo, children: _jsx("div", { className: "o-pane-cut o-smooth", children: children }) }) }) }));
65
+ }
66
+ export function PaneHead({ children, className }) {
67
+ return _jsx("div", { className: cx("o-pane-head", className), children: children });
68
+ }
69
+ export function PaneBody({ children, className }) {
70
+ return _jsxs(_Fragment, { children: [_jsx("div", { className: cx("o-pane-body", className), children: children }), _jsx(Scrollbar, {})] });
71
+ }
72
+ export function PaneFoot({ children, className }) {
73
+ return _jsx("div", { className: cx("o-pane-foot", className), children: children });
74
+ }
75
+ export function PaneTitle({ children, className }) {
76
+ return _jsx(Dialog.Title, { className: cx("o-pane-title", className), children: children });
77
+ }
78
+ export function PaneClose({ render, children }) {
79
+ return _jsx(Dialog.Close, { render: render, children: children });
80
+ }
81
+ export function usePane(start = null) {
82
+ const [state, setState] = React.useState({ shown: start, opener: null });
83
+ const step = (press) => setState((now) => paneAfter(now, press));
84
+ return {
85
+ shown: state.shown,
86
+ pane: {
87
+ open: state.shown !== null,
88
+ opener: state.opener,
89
+ onOpenChange: (next) => { if (!next)
90
+ step({ close: true }); },
91
+ },
92
+ opens: (key) => ({
93
+ onClick: (e) => step({ key, at: e.currentTarget }),
94
+ "aria-expanded": state.shown === key,
95
+ }),
96
+ close: () => step({ close: true }),
97
+ };
98
+ }
@@ -0,0 +1,14 @@
1
+ /** What stands in the Pane, by its key, or nothing; and what opened it last. */
2
+ export type PaneState<E = HTMLElement> = {
3
+ shown: string | null;
4
+ opener: E | null;
5
+ };
6
+ /** A press on an opener (its thing's key, and the opener itself), or a close from inside the Pane (its ✕, Escape). */
7
+ export type PanePress<E = HTMLElement> = {
8
+ key: string;
9
+ at: E | null;
10
+ } | {
11
+ close: true;
12
+ };
13
+ /** The state after a press. */
14
+ export declare function paneAfter<E>(state: PaneState<E>, press: PanePress<E>): PaneState<E>;
@@ -0,0 +1,7 @@
1
+ export function paneAfter(state, press) {
2
+ if ("close" in press)
3
+ return { shown: null, opener: state.opener };
4
+ if (state.shown === press.key)
5
+ return { shown: null, opener: state.opener };
6
+ return { shown: press.key, opener: press.at };
7
+ }
@@ -0,0 +1,79 @@
1
+ export declare const PANE_TOKENS: readonly [{
2
+ readonly name: "--vk-radius-xl";
3
+ readonly kind: "size";
4
+ readonly outright: "--radius-xl";
5
+ }, {
6
+ readonly name: "--vk-shadow-menu";
7
+ readonly kind: "shadow";
8
+ readonly outright: "--shadow-menu";
9
+ }, {
10
+ readonly name: "--vk-border";
11
+ readonly kind: "colour";
12
+ readonly outright: "--border";
13
+ }, {
14
+ readonly name: "--vk-spacing";
15
+ readonly kind: "size";
16
+ readonly outright: "--spacing";
17
+ }, {
18
+ readonly name: "--vk-layer-drawer";
19
+ readonly kind: "size";
20
+ readonly outright: "--layer-drawer";
21
+ }, {
22
+ readonly name: "--vk-overlay";
23
+ readonly kind: "colour";
24
+ readonly outright: "--surface-overlay";
25
+ }, {
26
+ readonly name: "--vk-fg";
27
+ readonly kind: "colour";
28
+ readonly outright: "--text";
29
+ }, {
30
+ readonly name: "--vk-font-size-sm";
31
+ readonly kind: "size";
32
+ readonly outright: "--text-sm";
33
+ }, {
34
+ readonly name: "--vk-line-height-sm";
35
+ readonly kind: "size";
36
+ readonly outright: "--text-sm--line-height";
37
+ }, {
38
+ readonly name: "--vk-duration-fast";
39
+ readonly kind: "motion";
40
+ readonly outright: "--duration-fast";
41
+ }, {
42
+ readonly name: "--vk-ease-out";
43
+ readonly kind: "motion";
44
+ readonly outright: "--ease-out";
45
+ }, {
46
+ readonly name: "--vk-border-width";
47
+ readonly kind: "size";
48
+ readonly outright: "--border-width";
49
+ }, {
50
+ readonly name: "--vk-border-subtle";
51
+ readonly kind: "colour";
52
+ readonly outright: "--border-subtle";
53
+ }, {
54
+ readonly name: "--vk-font-weight-medium";
55
+ readonly kind: "size";
56
+ readonly outright: "--font-weight-medium";
57
+ }, {
58
+ readonly name: "--vk-ease-in";
59
+ readonly kind: "motion";
60
+ readonly outright: "--ease-in";
61
+ }, {
62
+ readonly name: "--vk-radius-lg";
63
+ readonly kind: "size";
64
+ readonly outright: "--radius-lg";
65
+ }, {
66
+ readonly name: "--vk-radius-2xl";
67
+ readonly kind: "size";
68
+ readonly outright: "--radius-2xl";
69
+ }, {
70
+ readonly name: "--vk-shadow-lg";
71
+ readonly kind: "shadow";
72
+ readonly outright: "--shadow-lg";
73
+ }, {
74
+ readonly name: "--vk-shadow-xl";
75
+ readonly kind: "shadow";
76
+ readonly outright: "--shadow-xl";
77
+ }];
78
+ /** The Pane's own machinery: its corners, shadow, edge, gap and padding as its options set them, and its edge's corner. */
79
+ export declare const PANE_PRIVATE: readonly ["--pane-"];
@@ -0,0 +1,22 @@
1
+ export const PANE_TOKENS = [
2
+ { name: "--vk-radius-xl", kind: "size", outright: "--radius-xl" },
3
+ { name: "--vk-shadow-menu", kind: "shadow", outright: "--shadow-menu" },
4
+ { name: "--vk-border", kind: "colour", outright: "--border" },
5
+ { name: "--vk-spacing", kind: "size", outright: "--spacing" },
6
+ { name: "--vk-layer-drawer", kind: "size", outright: "--layer-drawer" },
7
+ { name: "--vk-overlay", kind: "colour", outright: "--surface-overlay" },
8
+ { name: "--vk-fg", kind: "colour", outright: "--text" },
9
+ { name: "--vk-font-size-sm", kind: "size", outright: "--text-sm" },
10
+ { name: "--vk-line-height-sm", kind: "size", outright: "--text-sm--line-height" },
11
+ { name: "--vk-duration-fast", kind: "motion", outright: "--duration-fast" },
12
+ { name: "--vk-ease-out", kind: "motion", outright: "--ease-out" },
13
+ { name: "--vk-border-width", kind: "size", outright: "--border-width" },
14
+ { name: "--vk-border-subtle", kind: "colour", outright: "--border-subtle" },
15
+ { name: "--vk-font-weight-medium", kind: "size", outright: "--font-weight-medium" },
16
+ { name: "--vk-ease-in", kind: "motion", outright: "--ease-in" },
17
+ { name: "--vk-radius-lg", kind: "size", outright: "--radius-lg" },
18
+ { name: "--vk-radius-2xl", kind: "size", outright: "--radius-2xl" },
19
+ { name: "--vk-shadow-lg", kind: "shadow", outright: "--shadow-lg" },
20
+ { name: "--vk-shadow-xl", kind: "shadow", outright: "--shadow-xl" },
21
+ ];
22
+ export const PANE_PRIVATE = ["--pane-"];
@@ -0,0 +1,104 @@
1
+ /* The Pane: a shell. Every value it draws with is a public name (controls/pane/tokens.ts); this file only says which
2
+ name each part takes. It
3
+ stands in the list's box it is handed (positioned, never scrolling), at its top right, a gap in from its edges. Base UI marks
4
+ it data-open, data-starting-style and data-ending-style as it comes and goes. What an app sets once is a data attribute on
5
+ the frame around it (looks.ts):
6
+
7
+ data-pane-place list · fit as tall as the list, or fitting what it holds
8
+ data-pane-corners lg · xl · 2xl which radius it takes
9
+ data-pane-smoothing round · smooth how its corners bend
10
+ data-pane-shadow none · menu · lg · xl its shadow
11
+ data-pane-edge outline · subtle · none one clear edge, a quieter one, or none
12
+ data-pane-gap 0 · 4 · 8 · 12 · 16 how far in from the list's top, right and bottom it stands
13
+ data-pane-padding 0 · 4 · 8 · 12 · 16 how far what it holds stands from its edge
14
+
15
+ 300 wide, as Customize stands at the list's edge. The rules sit in the components layer, so a
16
+ utility class on it still wins. */
17
+ @layer components {
18
+
19
+ /* Its portal, in the list's box, takes no room there, whatever the box lays out. */
20
+ .o-pane-portal { display: contents; }
21
+
22
+ /* ── The shell: over the list and under every popup (layer-popup), a Drawer or a Modal opened later standing over it ── */
23
+ .o-pane {
24
+ --pane-corners: var(--vk-radius-xl); --pane-shadow: var(--vk-shadow-menu); --pane-edge: var(--vk-border);
25
+ --pane-gap: calc(var(--vk-spacing) * 2); --pane-pad: calc(var(--vk-spacing) * 2);
26
+ position: absolute; z-index: var(--vk-layer-drawer); top: var(--pane-gap); right: var(--pane-gap); bottom: var(--pane-gap);
27
+ box-sizing: border-box; display: flex; flex-direction: column;
28
+ width: calc(var(--vk-spacing) * 75); max-width: calc(100% - var(--pane-gap) * 2);
29
+ border-radius: var(--pane-corners); background-color: var(--vk-overlay); box-shadow: var(--pane-shadow); color: var(--vk-fg);
30
+ font-size: var(--vk-font-size-sm); line-height: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm)); outline: none;
31
+ transition: opacity var(--vk-duration-fast) var(--vk-ease-out), translate var(--vk-duration-fast) var(--vk-ease-out);
32
+ }
33
+ /* Fitting what it holds: as tall as that, never past a gap over the list's foot. */
34
+ [data-pane-place="fit"] .o-pane { bottom: auto; max-height: calc(100% - var(--pane-gap) * 2); }
35
+
36
+ /* What it holds, inside its edge. The edge is drawn as two shapes, never a border, as the Popover's is: its colour (::before),
37
+ and the ground just inside it (::after), one line narrower, each with its own corner, so the edge follows the corners
38
+ exactly, round or smooth. */
39
+ .o-pane-cut { position: relative; isolation: isolate; box-sizing: border-box; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; padding: var(--pane-pad); border-radius: inherit; }
40
+ .o-pane-cut::before, .o-pane-cut::after { content: ""; position: absolute; z-index: -1; border-radius: var(--pane-c); pointer-events: none; }
41
+ .o-pane-cut::before { --pane-c: var(--pane-corners); inset: 0; background-color: var(--pane-edge); }
42
+ .o-pane-cut::after { --pane-c: calc(var(--pane-corners) - var(--vk-border-width)); inset: var(--vk-border-width); background-color: var(--vk-overlay); }
43
+
44
+ /* Its head stays at its top, its body scrolls, its foot stays at its foot under a line across the whole Pane. The body scrolls up and
45
+ down only: a control's press area standing past its edge (a Switch's, at a row's end) made it scroll sideways, and where
46
+ scrollbars take room that bar stood at its foot. What it holds is clipped at its sides, where the body clips it anyway, so nothing
47
+ overhangs it to scroll to. */
48
+ .o-pane-head { flex: none; }
49
+ .o-pane-body { flex: 1 1 auto; min-height: 0; overflow: hidden auto; }
50
+ .o-pane-body > * { overflow-x: clip; }
51
+ /* What scrolls runs right to the foot's line: the foot has no margin over
52
+ it, and a body with a foot after it takes the Pane's padding at its end, inside what scrolls, so that room shows only at the scroll's
53
+ end. */
54
+ .o-pane-foot { flex: none; margin: 0 calc(var(--pane-pad) * -1) calc(var(--pane-pad) * -1); padding: var(--pane-pad); border-top: var(--vk-border-width) solid var(--pane-edge); }
55
+ .o-pane-body:has(~ .o-pane-foot) { padding-bottom: var(--pane-pad); }
56
+ [data-pane-edge="none"] .o-pane-foot { border-top-color: var(--vk-border-subtle); }
57
+
58
+ /* Its title, when what stands in it has one: text-sm at medium weight. */
59
+ .o-pane-title { margin: 0; font-size: var(--vk-font-size-sm); line-height: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm)); font-weight: var(--vk-font-weight-medium); color: var(--vk-fg); }
60
+
61
+ /* It fades in and moves a step in from the right; it leaves faster than it came. */
62
+ .o-pane[data-ending-style] { transition-timing-function: var(--vk-ease-in); }
63
+ .o-pane:is([data-starting-style], [data-ending-style]) { opacity: 0; translate: var(--vk-spacing) 0; }
64
+
65
+ /* ── What an app sets once ───────────────────────────────────────────────────────────────────────────────────── */
66
+ [data-pane-corners="lg"] .o-pane { --pane-corners: var(--vk-radius-lg); }
67
+ [data-pane-corners="2xl"] .o-pane { --pane-corners: var(--vk-radius-2xl); }
68
+ [data-pane-shadow="none"] .o-pane { --pane-shadow: none; }
69
+ [data-pane-shadow="lg"] .o-pane { --pane-shadow: var(--vk-shadow-lg); }
70
+ [data-pane-shadow="xl"] .o-pane { --pane-shadow: var(--vk-shadow-xl); }
71
+ [data-pane-edge="subtle"] .o-pane { --pane-edge: var(--vk-border-subtle); }
72
+ [data-pane-edge="none"] .o-pane { --pane-edge: var(--vk-overlay); }
73
+ [data-pane-gap="0"] .o-pane { --pane-gap: 0px; }
74
+ [data-pane-gap="4"] .o-pane { --pane-gap: var(--vk-spacing); }
75
+ [data-pane-gap="12"] .o-pane { --pane-gap: calc(var(--vk-spacing) * 3); }
76
+ [data-pane-gap="16"] .o-pane { --pane-gap: calc(var(--vk-spacing) * 4); }
77
+ [data-pane-padding="0"] .o-pane { --pane-pad: 0px; }
78
+ [data-pane-padding="4"] .o-pane { --pane-pad: var(--vk-spacing); }
79
+ [data-pane-padding="12"] .o-pane { --pane-pad: calc(var(--vk-spacing) * 3); }
80
+ [data-pane-padding="16"] .o-pane { --pane-pad: calc(var(--vk-spacing) * 4); }
81
+
82
+ /* ── Its corners smooth: the smooth outline (smooth.css), as the Popover's. A cut would take the shadow with it, so
83
+ .o-pane-cut inside it is cut instead, and the edge's two shapes each by the same outline. The shadow is cast from a layer under
84
+ the cut that stands wholly inside the outline: cast by the shell's own round box, whose corner stands up to 0.02 of a
85
+ radius outside the smooth one, its edge and the cut's met in a light rim round the bend. Its corner a quarter
86
+ circle of 1.2 radii, which lies inside the smooth curve (from 1.2 radii on, by smooth.css's numbers; a larger one stands further
87
+ in and lightens the shadow at the corner), and half a line in, so the cut covers its edge everywhere and the shadow runs on from
88
+ under the edge, as dark as Round's ────── */
89
+ @supports (clip-path: shape(from 0 0, curve by 1px 1px with 1px 0 / 1px 0, close)) {
90
+ [data-pane-smoothing="smooth"] .o-pane { background-color: transparent; box-shadow: none; }
91
+ [data-pane-smoothing="smooth"] .o-pane::before {
92
+ content: ""; position: absolute; z-index: -1; inset: calc(var(--vk-border-width) / 2); border-radius: calc(var(--pane-corners) * 1.2);
93
+ box-shadow: var(--pane-shadow); pointer-events: none;
94
+ }
95
+ [data-pane-smoothing="smooth"] .o-pane-cut { --pane-c: var(--pane-corners); background-color: var(--vk-overlay); }
96
+ [data-pane-smoothing="smooth"] .o-pane-cut::before, [data-pane-smoothing="smooth"] .o-pane-cut::after { border-radius: 0; }
97
+ [data-pane-smoothing="smooth"] .o-pane-cut, [data-pane-smoothing="smooth"] .o-pane-cut::before, [data-pane-smoothing="smooth"] .o-pane-cut::after {
98
+ --smooth-t: var(--pane-c); clip-path: shape(var(--smooth-outline));
99
+ }
100
+ }
101
+
102
+ /* Under reduced motion it just appears. */
103
+ @media (prefers-reduced-motion: reduce) { .o-pane { transition: none; } }
104
+ }
@@ -23,11 +23,13 @@ export type PickerAs = {
23
23
  * rows it leads one level in (a deal's Company, its Name, Industry and Region), which it opens and never picks; and its
24
24
  * own menu, what can be done to that one row (a view's Rename…, Delete view…), ⋮ at its end opening it, never picking; and its
25
25
  * count, how many records hold it (a quick filter's value), at its end, right before what says it is held.
26
- * A row that leads one level in keeps its level's count and ›. And a mark after its name (a private view's lock), quieter.
26
+ * A row that leads one level in keeps its level's count and ›. And a mark after its name (a private view's lock), quieter. And
27
+ * `also`, words its search finds it by besides its name (a currency's code), never drawn.
27
28
  */
28
29
  export interface PickerItem {
29
30
  value: string;
30
31
  label: string;
32
+ also?: readonly string[];
31
33
  as?: PickerAs;
32
34
  line?: string;
33
35
  you?: boolean;
@@ -99,7 +101,7 @@ export interface RowsInput {
99
101
  /** The levels open, by their rows' values, outermost first, as far as the items still hold them. */
100
102
  export declare function openLevels(items: PickerItem[], values: string[]): PickerItem[];
101
103
  export declare const fold: (s: string) => string;
102
- /** The item whose name is what was typed, whatever its case and the spaces round it. */
104
+ /** The item whose name, or one of its `also` words, is what was typed, whatever its case and the spaces round it. */
103
105
  export declare function exactMatch(items: PickerItem[], query: string): PickerItem | undefined;
104
106
  export declare function pickerRows({ items, known, query, picked, empty, create, server, more, first, open, levelRow }: RowsInput): PickerRow[];
105
107
  /** Every item's value in its order after `value` moved to where `target` stands: before it, moving up; after it, moving
@@ -10,9 +10,10 @@ export function openLevels(items, values) {
10
10
  return out;
11
11
  }
12
12
  export const fold = (s) => s.normalize("NFD").replace(/\p{M}/gu, "").trim().toLowerCase();
13
+ const found = (i) => [i.label, ...(i.also ?? [])].map(fold);
13
14
  export function exactMatch(items, query) {
14
15
  const q = fold(query);
15
- return q ? items.find((i) => fold(i.label) === q) : undefined;
16
+ return q ? items.find((i) => found(i).includes(q)) : undefined;
16
17
  }
17
18
  const itemRow = (item, held) => (item.level ? { kind: "item", item, picked: held.has(item.value), opens: true, count: item.level.length } : { kind: "item", item, picked: held.has(item.value) });
18
19
  export function pickerRows({ items, known = items, query, picked, empty, create, server, more, first = [], open = [], levelRow = true }) {
@@ -25,12 +26,12 @@ export function pickerRows({ items, known = items, query, picked, empty, create,
25
26
  return [{ kind: "parent", item: level }, ...rows.map((r) => (r.kind === "item" ? { ...r, indent: true } : r))];
26
27
  }
27
28
  const q = fold(query), held = new Set(picked);
28
- const matching = server || !q ? items : items.filter((i) => fold(i.label).includes(q));
29
+ const matching = server || !q ? items : items.filter((i) => found(i).some((w) => w.includes(q)));
29
30
  const exact = q ? exactMatch(matching, query) : undefined;
30
31
  const ahead = new Set(q ? [] : first), top = matching.filter((i) => ahead.has(i.value));
31
32
  const shown = (exact ? matching.filter((i) => i !== exact) : matching).filter((i) => !ahead.has(i.value));
32
33
  const ranked = (list) => (server || !q ? list
33
- : [...list.filter((i) => fold(i.label).startsWith(q)), ...list.filter((i) => !fold(i.label).startsWith(q))]);
34
+ : [...list.filter((i) => found(i).some((w) => w.startsWith(q))), ...list.filter((i) => !found(i).some((w) => w.startsWith(q)))]);
34
35
  const rows = [];
35
36
  if (empty !== undefined && !q && held.size)
36
37
  rows.push({ kind: "empty", label: empty });
@@ -0,0 +1,9 @@
1
+ import { type ViewsMessageResolver } from "../../contract.js";
2
+ import type { ViewsSortBodyProps } from "../../provider/components.js";
3
+ import { type SortEditorProps } from "./sort-editor.js";
4
+ import type { SortEditorWords } from "./words.js";
5
+ /** The sort editor's words in the app's messages. */
6
+ export declare function sortEditorWordsOf(say: ViewsMessageResolver): SortEditorWords;
7
+ /** ViewKit's sort body's props as the sort editor's. */
8
+ export declare function sortEditorPropsOf(p: ViewsSortBodyProps, words: SortEditorWords, say?: ViewsMessageResolver): SortEditorProps;
9
+ export declare function MapSortBody(props: ViewsSortBodyProps): import("react/jsx-runtime").JSX.Element;