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,192 @@
1
+ export declare const MODAL_TOKENS: readonly [{
2
+ readonly name: "--vk-layer-drawer";
3
+ readonly kind: "size";
4
+ readonly outright: "--layer-drawer";
5
+ }, {
6
+ readonly name: "--vk-layer-popup";
7
+ readonly kind: "size";
8
+ readonly outright: "--layer-popup";
9
+ }, {
10
+ readonly name: "--vk-backdrop-modal-light";
11
+ readonly kind: "colour";
12
+ readonly outright: "--backdrop-modal-light";
13
+ }, {
14
+ readonly name: "--vk-duration-base";
15
+ readonly kind: "motion";
16
+ readonly outright: "--duration-base";
17
+ }, {
18
+ readonly name: "--vk-ease-out";
19
+ readonly kind: "motion";
20
+ readonly outright: "--ease-out";
21
+ }, {
22
+ readonly name: "--vk-backdrop-modal-medium";
23
+ readonly kind: "colour";
24
+ readonly outright: "--backdrop-modal-medium";
25
+ }, {
26
+ readonly name: "--vk-backdrop-modal-deep";
27
+ readonly kind: "colour";
28
+ readonly outright: "--backdrop-modal-deep";
29
+ }, {
30
+ readonly name: "--vk-backdrop-modal-veil-light";
31
+ readonly kind: "colour";
32
+ readonly outright: "--backdrop-modal-veil-light";
33
+ }, {
34
+ readonly name: "--vk-backdrop-modal-veil-medium";
35
+ readonly kind: "colour";
36
+ readonly outright: "--backdrop-modal-veil-medium";
37
+ }, {
38
+ readonly name: "--vk-backdrop-modal-veil-deep";
39
+ readonly kind: "colour";
40
+ readonly outright: "--backdrop-modal-veil-deep";
41
+ }, {
42
+ readonly name: "--vk-blur-xs";
43
+ readonly kind: "size";
44
+ readonly outright: "--blur-xs";
45
+ }, {
46
+ readonly name: "--vk-blur-sm";
47
+ readonly kind: "size";
48
+ readonly outright: "--blur-sm";
49
+ }, {
50
+ readonly name: "--vk-blur-md";
51
+ readonly kind: "size";
52
+ readonly outright: "--blur-md";
53
+ }, {
54
+ readonly name: "--vk-blur-lg";
55
+ readonly kind: "size";
56
+ readonly outright: "--blur-lg";
57
+ }, {
58
+ readonly name: "--vk-spacing";
59
+ readonly kind: "size";
60
+ readonly outright: "--spacing";
61
+ }, {
62
+ readonly name: "--vk-radius-xl";
63
+ readonly kind: "size";
64
+ readonly outright: "--radius-xl";
65
+ }, {
66
+ readonly name: "--vk-container-2xl";
67
+ readonly kind: "size";
68
+ readonly outright: "--container-2xl";
69
+ }, {
70
+ readonly name: "--vk-overlay";
71
+ readonly kind: "colour";
72
+ readonly outright: "--surface-overlay";
73
+ }, {
74
+ readonly name: "--vk-shadow-2xl";
75
+ readonly kind: "shadow";
76
+ readonly outright: "--shadow-2xl";
77
+ }, {
78
+ readonly name: "--vk-fg";
79
+ readonly kind: "colour";
80
+ readonly outright: "--text";
81
+ }, {
82
+ readonly name: "--vk-container-lg";
83
+ readonly kind: "size";
84
+ readonly outright: "--container-lg";
85
+ }, {
86
+ readonly name: "--vk-container-4xl";
87
+ readonly kind: "size";
88
+ readonly outright: "--container-4xl";
89
+ }, {
90
+ readonly name: "--vk-container-5xl";
91
+ readonly kind: "size";
92
+ readonly outright: "--container-5xl";
93
+ }, {
94
+ readonly name: "--vk-push-scale";
95
+ readonly kind: "motion";
96
+ readonly outright: "--push-scale";
97
+ }, {
98
+ readonly name: "--vk-duration-fast";
99
+ readonly kind: "motion";
100
+ readonly outright: "--duration-fast";
101
+ }, {
102
+ readonly name: "--vk-ease-in";
103
+ readonly kind: "motion";
104
+ readonly outright: "--ease-in";
105
+ }, {
106
+ readonly name: "--vk-press-scale";
107
+ readonly kind: "motion";
108
+ readonly outright: "--press-scale";
109
+ }, {
110
+ readonly name: "--vk-radius-lg";
111
+ readonly kind: "size";
112
+ readonly outright: "--radius-lg";
113
+ }, {
114
+ readonly name: "--vk-radius-2xl";
115
+ readonly kind: "size";
116
+ readonly outright: "--radius-2xl";
117
+ }, {
118
+ readonly name: "--vk-shadow-lg";
119
+ readonly kind: "shadow";
120
+ readonly outright: "--shadow-lg";
121
+ }, {
122
+ readonly name: "--vk-shadow-xl";
123
+ readonly kind: "shadow";
124
+ readonly outright: "--shadow-xl";
125
+ }, {
126
+ readonly name: "--vk-border-modal-ring";
127
+ readonly kind: "colour";
128
+ readonly outright: "--border-modal-ring";
129
+ }, {
130
+ readonly name: "--vk-border-width";
131
+ readonly kind: "size";
132
+ readonly outright: "--border-width";
133
+ }, {
134
+ readonly name: "--vk-border-modal-edge";
135
+ readonly kind: "colour";
136
+ readonly outright: "--border-modal-edge";
137
+ }, {
138
+ readonly name: "--vk-border";
139
+ readonly kind: "colour";
140
+ readonly outright: "--border";
141
+ }, {
142
+ readonly name: "--vk-font-size-base";
143
+ readonly kind: "size";
144
+ readonly outright: "--text-base";
145
+ }, {
146
+ readonly name: "--vk-line-height-base";
147
+ readonly kind: "size";
148
+ readonly outright: "--text-base--line-height";
149
+ }, {
150
+ readonly name: "--vk-font-weight-medium";
151
+ readonly kind: "size";
152
+ readonly outright: "--font-weight-medium";
153
+ }, {
154
+ readonly name: "--vk-font-size-sm";
155
+ readonly kind: "size";
156
+ readonly outright: "--text-sm";
157
+ }, {
158
+ readonly name: "--vk-line-height-sm";
159
+ readonly kind: "size";
160
+ readonly outright: "--text-sm--line-height";
161
+ }, {
162
+ readonly name: "--vk-radius-sm";
163
+ readonly kind: "size";
164
+ readonly outright: "--radius-sm";
165
+ }, {
166
+ readonly name: "--vk-brand";
167
+ readonly kind: "colour";
168
+ readonly outright: "--background-brand-bold";
169
+ }, {
170
+ readonly name: "--vk-fg-on-brand";
171
+ readonly kind: "colour";
172
+ readonly outright: "--text-brand-inverse";
173
+ }, {
174
+ readonly name: "--vk-fg-subtle";
175
+ readonly kind: "colour";
176
+ readonly outright: "--text-subtle";
177
+ }, {
178
+ readonly name: "--vk-fg-subtlest";
179
+ readonly kind: "colour";
180
+ readonly outright: "--text-subtlest";
181
+ }, {
182
+ readonly name: "--vk-radius-full";
183
+ readonly kind: "size";
184
+ readonly outright: "--radius-full";
185
+ }, {
186
+ readonly name: "--vk-overlay-card";
187
+ readonly kind: "colour";
188
+ readonly outright: "--surface-overlay-card";
189
+ }];
190
+ /** The Modal's own machinery: its corners, padding and width as its options and its size set them, the edge's corner, and how
191
+ * far it keeps from the screen's edges (`--modal-room`, which a page that draws a screen sets). */
192
+ export declare const MODAL_PRIVATE: readonly ["--modal-"];
@@ -0,0 +1,50 @@
1
+ export const MODAL_TOKENS = [
2
+ { name: "--vk-layer-drawer", kind: "size", outright: "--layer-drawer" },
3
+ { name: "--vk-layer-popup", kind: "size", outright: "--layer-popup" },
4
+ { name: "--vk-backdrop-modal-light", kind: "colour", outright: "--backdrop-modal-light" },
5
+ { name: "--vk-duration-base", kind: "motion", outright: "--duration-base" },
6
+ { name: "--vk-ease-out", kind: "motion", outright: "--ease-out" },
7
+ { name: "--vk-backdrop-modal-medium", kind: "colour", outright: "--backdrop-modal-medium" },
8
+ { name: "--vk-backdrop-modal-deep", kind: "colour", outright: "--backdrop-modal-deep" },
9
+ { name: "--vk-backdrop-modal-veil-light", kind: "colour", outright: "--backdrop-modal-veil-light" },
10
+ { name: "--vk-backdrop-modal-veil-medium", kind: "colour", outright: "--backdrop-modal-veil-medium" },
11
+ { name: "--vk-backdrop-modal-veil-deep", kind: "colour", outright: "--backdrop-modal-veil-deep" },
12
+ { name: "--vk-blur-xs", kind: "size", outright: "--blur-xs" },
13
+ { name: "--vk-blur-sm", kind: "size", outright: "--blur-sm" },
14
+ { name: "--vk-blur-md", kind: "size", outright: "--blur-md" },
15
+ { name: "--vk-blur-lg", kind: "size", outright: "--blur-lg" },
16
+ { name: "--vk-spacing", kind: "size", outright: "--spacing" },
17
+ { name: "--vk-radius-xl", kind: "size", outright: "--radius-xl" },
18
+ { name: "--vk-container-2xl", kind: "size", outright: "--container-2xl" },
19
+ { name: "--vk-overlay", kind: "colour", outright: "--surface-overlay" },
20
+ { name: "--vk-shadow-2xl", kind: "shadow", outright: "--shadow-2xl" },
21
+ { name: "--vk-fg", kind: "colour", outright: "--text" },
22
+ { name: "--vk-container-lg", kind: "size", outright: "--container-lg" },
23
+ { name: "--vk-container-4xl", kind: "size", outright: "--container-4xl" },
24
+ { name: "--vk-container-5xl", kind: "size", outright: "--container-5xl" },
25
+ { name: "--vk-push-scale", kind: "motion", outright: "--push-scale" },
26
+ { name: "--vk-duration-fast", kind: "motion", outright: "--duration-fast" },
27
+ { name: "--vk-ease-in", kind: "motion", outright: "--ease-in" },
28
+ { name: "--vk-press-scale", kind: "motion", outright: "--press-scale" },
29
+ { name: "--vk-radius-lg", kind: "size", outright: "--radius-lg" },
30
+ { name: "--vk-radius-2xl", kind: "size", outright: "--radius-2xl" },
31
+ { name: "--vk-shadow-lg", kind: "shadow", outright: "--shadow-lg" },
32
+ { name: "--vk-shadow-xl", kind: "shadow", outright: "--shadow-xl" },
33
+ { name: "--vk-border-modal-ring", kind: "colour", outright: "--border-modal-ring" },
34
+ { name: "--vk-border-width", kind: "size", outright: "--border-width" },
35
+ { name: "--vk-border-modal-edge", kind: "colour", outright: "--border-modal-edge" },
36
+ { name: "--vk-border", kind: "colour", outright: "--border" },
37
+ { name: "--vk-font-size-base", kind: "size", outright: "--text-base" },
38
+ { name: "--vk-line-height-base", kind: "size", outright: "--text-base--line-height" },
39
+ { name: "--vk-font-weight-medium", kind: "size", outright: "--font-weight-medium" },
40
+ { name: "--vk-font-size-sm", kind: "size", outright: "--text-sm" },
41
+ { name: "--vk-line-height-sm", kind: "size", outright: "--text-sm--line-height" },
42
+ { name: "--vk-radius-sm", kind: "size", outright: "--radius-sm" },
43
+ { name: "--vk-brand", kind: "colour", outright: "--background-brand-bold" },
44
+ { name: "--vk-fg-on-brand", kind: "colour", outright: "--text-brand-inverse" },
45
+ { name: "--vk-fg-subtle", kind: "colour", outright: "--text-subtle" },
46
+ { name: "--vk-fg-subtlest", kind: "colour", outright: "--text-subtlest" },
47
+ { name: "--vk-radius-full", kind: "size", outright: "--radius-full" },
48
+ { name: "--vk-overlay-card", kind: "colour", outright: "--surface-overlay-card" },
49
+ ];
50
+ export const MODAL_PRIVATE = ["--modal-"];
@@ -0,0 +1,130 @@
1
+ /* The Modal. Every value it draws with is a public name (controls/modal/tokens.ts); this file only says which name each part takes. Its options
2
+ (looks.ts) are data attributes on the frame around it, and each one only chooses other names:
3
+
4
+ data-modal-edge ring · outline a hairline ring set inside its edge, or one clear edge
5
+ data-modal-lines shown · none a line under its head and one over its foot
6
+ data-modal-buttons own · pill its foot's buttons: the Button's own corners, or pills
7
+ data-modal-head bar · margin its head and foot as bars, or standing in its margin
8
+ data-modal-size 28 · 32 · 36 its foot's buttons' height
9
+ data-modal-corners lg · xl · 2xl which radius it takes
10
+ data-modal-smoothing round · smooth how its corners bend
11
+ data-modal-padding 16 · 20 · 24 how far what it holds stands from its edge
12
+ data-modal-behind dim · veil what stands over the page behind it: dark or light
13
+ data-modal-strength light · medium · deep how strong that is
14
+ data-modal-blur 0 · 4 · 8 · 12 · 24 how far the page blurs under it
15
+ data-modal-shadow none · lg · xl · 2xl its shadow
16
+
17
+ data-width on the Modal says how wide it stands, which each one is handed. On the phone a Modal is the Sheet, which none of these
18
+ reach. The rules sit in the components layer, so a utility class still wins. */
19
+ @layer components {
20
+
21
+ /* ── What's behind it, and where it stands: in the middle of the screen, under any popup but the Popover it opens from ──────────── */
22
+ .o-modal-backdrop, .o-modal-viewport { position: fixed; inset: 0; z-index: var(--vk-layer-drawer); }
23
+ /* Opened from inside a Popover, at the popups' layer: over the Popover, added before it, and under what opens from it. */
24
+ .o-modal-backdrop[data-over-popup], .o-modal-viewport[data-over-popup] { z-index: var(--vk-layer-popup); }
25
+ .o-modal-backdrop { background-color: var(--vk-backdrop-modal-light); transition: opacity var(--vk-duration-base) var(--vk-ease-out); }
26
+ .o-modal-backdrop:is([data-starting-style], [data-ending-style]) { opacity: 0; }
27
+ [data-modal-strength="medium"] .o-modal-backdrop { background-color: var(--vk-backdrop-modal-medium); }
28
+ [data-modal-strength="deep"] .o-modal-backdrop { background-color: var(--vk-backdrop-modal-deep); }
29
+ [data-modal-behind="veil"] .o-modal-backdrop { background-color: var(--vk-backdrop-modal-veil-light); }
30
+ [data-modal-behind="veil"][data-modal-strength="medium"] .o-modal-backdrop { background-color: var(--vk-backdrop-modal-veil-medium); }
31
+ [data-modal-behind="veil"][data-modal-strength="deep"] .o-modal-backdrop { background-color: var(--vk-backdrop-modal-veil-deep); }
32
+ /* No blur at all at none, since blur(0) still builds a backdrop root. */
33
+ [data-modal-blur="4"] .o-modal-backdrop { -webkit-backdrop-filter: blur(var(--vk-blur-xs)); backdrop-filter: blur(var(--vk-blur-xs)); }
34
+ [data-modal-blur="8"] .o-modal-backdrop { -webkit-backdrop-filter: blur(var(--vk-blur-sm)); backdrop-filter: blur(var(--vk-blur-sm)); }
35
+ [data-modal-blur="12"] .o-modal-backdrop { -webkit-backdrop-filter: blur(var(--vk-blur-md)); backdrop-filter: blur(var(--vk-blur-md)); }
36
+ [data-modal-blur="24"] .o-modal-backdrop { -webkit-backdrop-filter: blur(var(--vk-blur-lg)); backdrop-filter: blur(var(--vk-blur-lg)); }
37
+ /* It keeps 48 from the screen's edges; a screen drawn on a page sets --modal-room to keep less. */
38
+ .o-modal-viewport { box-sizing: border-box; display: flex; align-items: center; justify-content: center; padding: var(--modal-room, calc(var(--vk-spacing) * 12)); overflow-y: auto; outline: none; }
39
+
40
+ /* ── The shell: on the overlay's ground, as wide as it is handed, never taller than the screen ───────────────────────────────────── */
41
+ .o-modal {
42
+ --modal-corners: var(--vk-radius-xl); --modal-pad: calc(var(--vk-spacing) * 5); --modal-width: var(--vk-container-2xl);
43
+ box-sizing: border-box; position: relative; display: flex; flex-direction: column; width: 100%; max-width: var(--modal-width); max-height: 100%; min-width: 0;
44
+ border-radius: var(--modal-corners); background-color: var(--vk-overlay); box-shadow: var(--vk-shadow-2xl); color: var(--vk-fg); outline: none;
45
+ transition: opacity var(--vk-duration-base) var(--vk-ease-out), scale var(--vk-duration-base) var(--vk-ease-out);
46
+ }
47
+ .o-modal[data-width="sm"] { --modal-width: var(--vk-container-lg); }
48
+ .o-modal[data-width="lg"] { --modal-width: var(--vk-container-4xl); }
49
+ .o-modal[data-width="xl"] { --modal-width: var(--vk-container-5xl); }
50
+ .o-modal:is([data-starting-style], [data-ending-style]) { opacity: 0; scale: var(--vk-push-scale); }
51
+ .o-modal[data-ending-style] { transition-duration: var(--vk-duration-fast); transition-timing-function: var(--vk-ease-in); }
52
+ /* An Alert Dialog over it steps it back. */
53
+ .o-modal[data-nested-dialog-open] { scale: var(--vk-press-scale); }
54
+ [data-modal-corners="lg"] .o-modal { --modal-corners: var(--vk-radius-lg); }
55
+ [data-modal-corners="2xl"] .o-modal { --modal-corners: var(--vk-radius-2xl); }
56
+ [data-modal-padding="16"] .o-modal { --modal-pad: calc(var(--vk-spacing) * 4); }
57
+ [data-modal-padding="24"] .o-modal { --modal-pad: calc(var(--vk-spacing) * 6); }
58
+ [data-modal-shadow="none"] .o-modal { box-shadow: none; }
59
+ [data-modal-shadow="lg"] .o-modal { box-shadow: var(--vk-shadow-lg); }
60
+ [data-modal-shadow="xl"] .o-modal { box-shadow: var(--vk-shadow-xl); }
61
+
62
+ /* What it holds, inside its edge. Ring: no edge of its own, a hairline ring 3 inside it, and what it holds 4 in, so a line under the
63
+ head runs ring to ring. Outline: one clear edge, and what it holds reaches it. The line is drawn as two shapes, never a border: the
64
+ line's colour (::before), and the ground just inside it (::after), one line narrower. Each takes its own corner, its inset less, so
65
+ the line follows the edge's corners exactly, round or smooth. */
66
+ .o-modal-cut { position: relative; isolation: isolate; box-sizing: border-box; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; max-height: 100%; padding: var(--vk-spacing); border-radius: inherit; background-color: inherit; }
67
+ .o-modal-cut::before, .o-modal-cut::after { content: ""; position: absolute; z-index: -1; border-radius: var(--modal-c); pointer-events: none; }
68
+ .o-modal-cut::before { --modal-c: calc(var(--modal-corners) - var(--vk-spacing) * 0.75); inset: calc(var(--vk-spacing) * 0.75); background-color: var(--vk-border-modal-ring); }
69
+ .o-modal-cut::after { --modal-c: calc(var(--modal-corners) - var(--vk-spacing) * 0.75 - var(--vk-border-width)); inset: calc(var(--vk-spacing) * 0.75 + var(--vk-border-width)); background-color: var(--vk-overlay); }
70
+ [data-modal-edge="outline"] .o-modal-cut { padding: 0; }
71
+ [data-modal-edge="outline"] .o-modal-cut::before { --modal-c: var(--modal-corners); inset: 0; background-color: var(--vk-border-modal-edge); }
72
+ [data-modal-edge="outline"] .o-modal-cut::after { --modal-c: calc(var(--modal-corners) - var(--vk-border-width)); inset: var(--vk-border-width); }
73
+
74
+ /* ── Its head: a bar, or standing in its margin; its mark, where it was opened, its title, then Open as a page and the X ─────────── */
75
+ .o-modal-head { box-sizing: border-box; display: flex; align-items: center; gap: calc(var(--vk-spacing) * 2); flex: none; min-width: 0; min-height: calc(var(--vk-spacing) * 11); padding: 0 calc(var(--vk-spacing) * 2) 0 var(--modal-pad); }
76
+ [data-modal-head="margin"] .o-modal-head { min-height: 0; padding: calc(var(--vk-spacing) * 4) calc(var(--vk-spacing) * 3) 0 var(--modal-pad); }
77
+ [data-modal-lines="shown"] .o-modal-head { border-bottom: var(--vk-border-width) solid var(--vk-border); }
78
+ /* Its line under the head's height: the head is 11 tall above its line. */
79
+ [data-modal-lines="shown"]:not([data-modal-head="margin"]) .o-modal-head { min-height: calc(var(--vk-spacing) * 11 + var(--vk-border-width)); }
80
+ [data-modal-lines="shown"][data-modal-head="margin"] .o-modal-head { padding-bottom: calc(var(--vk-spacing) * 3); }
81
+ .o-modal-title { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--vk-font-size-base); line-height: calc(var(--vk-font-size-base) * var(--vk-line-height-base)); font-weight: var(--vk-font-weight-medium); }
82
+ .o-modal-path ~ .o-modal-title { font-size: var(--vk-font-size-sm); line-height: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm)); }
83
+ .o-modal-tools { display: flex; align-items: center; gap: calc(var(--vk-spacing) * 0.5); flex: none; margin-left: auto; }
84
+ .o-modal-mark { display: grid; place-items: center; flex: none; width: calc(var(--vk-spacing) * 5); height: calc(var(--vk-spacing) * 5); border-radius: var(--vk-radius-sm); background-color: var(--vk-brand); color: var(--vk-fg-on-brand); }
85
+ .o-modal-mark > svg { width: calc(var(--vk-spacing) * 3.25); height: calc(var(--vk-spacing) * 3.25); }
86
+ [data-modal-head="margin"] .o-modal-mark { width: calc(var(--vk-spacing) * 4); background-color: transparent; color: var(--vk-fg-subtle); }
87
+ [data-modal-head="margin"] .o-modal-mark > svg { width: calc(var(--vk-spacing) * 4); height: calc(var(--vk-spacing) * 4); }
88
+ /* Where it was opened gives way before its title: the path's words shorten first. */
89
+ .o-modal-path { display: flex; align-items: center; gap: calc(var(--vk-spacing) * 1.5); flex: 0 100 auto; min-width: calc(var(--vk-spacing) * 16); color: var(--vk-fg-subtlest); }
90
+ .o-modal-path > svg { flex: none; width: calc(var(--vk-spacing) * 3.5); height: calc(var(--vk-spacing) * 3.5); }
91
+ .o-modal-chip { display: inline-flex; align-items: center; gap: calc(var(--vk-spacing) * 1.5); min-width: 0; height: calc(var(--vk-spacing) * 6.5); padding: 0 calc(var(--vk-spacing) * 2.5) 0 calc(var(--vk-spacing) * 2); border-radius: var(--vk-radius-full); background-color: var(--vk-overlay-card); color: var(--vk-fg-subtle); font-size: var(--vk-font-size-sm); font-weight: var(--vk-font-weight-medium); white-space: nowrap; }
92
+ .o-modal-chip > :first-child { flex: none; }
93
+ .o-modal-chip > svg { width: calc(var(--vk-spacing) * 3.5); height: calc(var(--vk-spacing) * 3.5); }
94
+ .o-modal-chip-word { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
95
+
96
+ /* ── What it holds: it scrolls between a head and a foot that stay ───────────────────────────────────────────────────────────────── */
97
+ .o-modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--modal-pad); }
98
+ .o-modal-failed { margin-bottom: calc(var(--vk-spacing) * 4); }
99
+
100
+ /* ── Its foot: what stands at its start, then the way out and the action at its end ──────────────────────────────────────────────── */
101
+ .o-modal-foot { box-sizing: border-box; display: flex; align-items: center; gap: calc(var(--vk-spacing) * 2); flex: none; min-height: calc(var(--vk-spacing) * 11); padding: 0 calc(var(--vk-spacing) * 2); }
102
+ [data-modal-head="margin"] .o-modal-foot { min-height: 0; padding: calc(var(--vk-spacing) * 1) calc(var(--vk-spacing) * 4) calc(var(--vk-spacing) * 4); }
103
+ [data-modal-lines="shown"] .o-modal-foot { border-top: var(--vk-border-width) solid var(--vk-border); }
104
+ [data-modal-lines="shown"]:not([data-modal-head="margin"]) .o-modal-foot { min-height: calc(var(--vk-spacing) * 11 + var(--vk-border-width)); }
105
+ [data-modal-lines="shown"][data-modal-head="margin"] .o-modal-foot { padding-top: calc(var(--vk-spacing) * 3); }
106
+ .o-modal-start { display: flex; align-items: center; gap: calc(var(--vk-spacing) * 2); min-width: 0; }
107
+ .o-modal-end { display: flex; align-items: center; gap: calc(var(--vk-spacing) * 2); margin-left: auto; }
108
+ .o-modal-end > .o-button { height: calc(var(--vk-spacing) * 7); --button-side: calc(var(--vk-spacing) * 7); padding-inline: calc(var(--vk-spacing) * 3); }
109
+ [data-modal-size="32"] .o-modal-end > .o-button { height: calc(var(--vk-spacing) * 8); --button-side: calc(var(--vk-spacing) * 8); }
110
+ [data-modal-size="36"] .o-modal-end > .o-button { height: calc(var(--vk-spacing) * 9); --button-side: calc(var(--vk-spacing) * 9); padding-inline: calc(var(--vk-spacing) * 3.5); }
111
+ [data-modal-buttons="pill"] .o-modal-foot .o-button:not(.o-button-round) { --button-r: var(--vk-radius-full); }
112
+
113
+ /* ── Its corners smooth: the smooth outline (smooth.css), Apple's curve as measured, so every browser that knows shape() shows it; one that doesn't
114
+ keeps the corners above. The Modal keeps its shadow, which a cut would take with it, so .o-modal-cut inside it is cut instead, and
115
+ the line's two shapes each by the same outline at its own corner, so the ring stays the edge's curve, set inside it ───────────── */
116
+ @supports (clip-path: shape(from 0 0, curve by 1px 1px with 1px 0 / 1px 0, close)) {
117
+ [data-modal-smoothing="smooth"] .o-modal { background-color: transparent; }
118
+ [data-modal-smoothing="smooth"] .o-modal-cut { --modal-c: var(--modal-corners); background-color: var(--vk-overlay); }
119
+ [data-modal-smoothing="smooth"] .o-modal-cut::before, [data-modal-smoothing="smooth"] .o-modal-cut::after { border-radius: 0; }
120
+ [data-modal-smoothing="smooth"] .o-modal-cut, [data-modal-smoothing="smooth"] .o-modal-cut::before, [data-modal-smoothing="smooth"] .o-modal-cut::after {
121
+ --smooth-t: var(--modal-c); clip-path: shape(var(--smooth-outline));
122
+ }
123
+ }
124
+
125
+ /* Less motion: a fade, no scale. */
126
+ @media (prefers-reduced-motion: reduce) {
127
+ .o-modal { transition: opacity var(--vk-duration-base) var(--vk-ease-out); }
128
+ .o-modal:is([data-starting-style], [data-ending-style], [data-nested-dialog-open]) { scale: 1; }
129
+ }
130
+ }
@@ -0,0 +1,49 @@
1
+ import * as React from "react";
2
+ export type NoticeMeaning = "information" | "success" | "warning" | "danger";
3
+ export declare const NOTICE_ICONS: Record<NoticeMeaning, string[]>;
4
+ /** An action drawn from its words: the Button's text kind, extra small. */
5
+ export interface NoticeAction {
6
+ label: string;
7
+ onClick?: () => void;
8
+ }
9
+ /** The words a Notice draws of its own: Retry, while it retries, and the ×'s name. */
10
+ export type NoticeWords = {
11
+ retry: string;
12
+ retrying: string;
13
+ dismiss: string;
14
+ };
15
+ /** Its words in English. */
16
+ export declare const NOTICE_WORDS: NoticeWords;
17
+ export interface NoticeProps {
18
+ /** What it means: worth knowing (information, the default), done (success), careful (warning), wrong
19
+ * (danger), or a plain fact with no colour of its own (neutral: where something came from, who can see it).
20
+ * The icon and the ground say it; the words stay in the text colour. */
21
+ meaning?: NoticeMeaning | "neutral";
22
+ /** Its own icon (a 16px icon, drawn in its meaning's colour), or false for none. Left out, its meaning's. */
23
+ icon?: React.ReactNode | false;
24
+ /** A title over the sentence, when one line isn't enough. */
25
+ title?: React.ReactNode;
26
+ /** The sentence, or several paragraphs as <p>, 8px apart. Wrong says what still works, and how to fix it. */
27
+ children: React.ReactNode;
28
+ /** What to do about it, at most two: the verb that happens ("Assign owners"), the way out last ("Not now"). Each is
29
+ * { label } for the text Button, or any element: a kit Button is drawn at the notice's size (extra small) whatever it
30
+ * was given, so an outline first then words; a link is the Button drawn as a link. */
31
+ actions?: (NoticeAction | React.ReactElement)[];
32
+ /** Retry, first among the actions: it turns into "Retrying…" while it works, and when it works the notice goes. */
33
+ onRetry?: () => Promise<unknown>;
34
+ /** Put away once read: × at the end, named "Dismiss". A notice about something still wrong has none. */
35
+ dismissible?: boolean;
36
+ onDismiss?: () => void;
37
+ /** An error that has just happened: read out at once (role="alert") rather than politely. */
38
+ urgent?: boolean;
39
+ /** It appears because of something just done: it fades in. */
40
+ arrived?: boolean;
41
+ className?: string;
42
+ /** Its × drawn as under the pointer or in focus, as a page that shows it draws it. */
43
+ "data-force"?: "hover" | "focus";
44
+ /** Its own words, over the English: Retry, Retrying…, and the ×'s name. */
45
+ words?: Partial<NoticeWords>;
46
+ }
47
+ /** A sentence set into the page on its meaning's ground: worth knowing, done, careful, wrong or a plain fact (neutral). It can
48
+ * carry what to do about it, a title, or a way to put it away. */
49
+ export declare function Notice({ meaning, icon, title, children, actions, onRetry, dismissible, onDismiss, urgent, arrived, className, "data-force": force, words }: NoticeProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { cx } from "../../internal/cx.js";
4
+ import { Button } from "../button/button.js";
5
+ import { phoneMark, usePhoneForm } from "../internal/phone.js";
6
+ export const NOTICE_ICONS = {
7
+ information: ["M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0", "M12 9h.01", "M11 12h1v4h1"],
8
+ success: ["M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0", "M9 12l2 2l4 -4"],
9
+ warning: ["M12 9v4", "M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0", "M12 16h.01"],
10
+ danger: ["M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0", "M12 8v4", "M12 16h.01"],
11
+ };
12
+ const X = ["M18 6l-12 12", "M6 6l12 12"];
13
+ const glyph = (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)) }));
14
+ const still = () => typeof matchMedia !== "undefined" && matchMedia("(prefers-reduced-motion: reduce)").matches;
15
+ export const NOTICE_WORDS = { retry: "Retry", retrying: "Retrying…", dismiss: "Dismiss" };
16
+ export function Notice({ meaning = "information", icon, title, children, actions = [], onRetry, dismissible, onDismiss, urgent, arrived, className, "data-force": force, words }) {
17
+ const said = { ...NOTICE_WORDS, ...words }, phone = usePhoneForm();
18
+ const [phase, setPhase] = React.useState("here"), [retrying, setRetrying] = React.useState(false);
19
+ const away = () => { if (still()) {
20
+ setPhase("gone");
21
+ onDismiss?.();
22
+ }
23
+ else
24
+ setPhase("going"); };
25
+ const retry = () => { if (retrying || !onRetry)
26
+ return; setRetrying(true); onRetry().then(away, () => setRetrying(false)); };
27
+ if (phase === "gone")
28
+ return null;
29
+ const acts = (onRetry || actions.length > 0) && (_jsxs(_Fragment, { children: [onRetry && _jsx(Button, { kind: "text", size: "xs", "aria-busy": retrying || undefined, onClick: retry, children: retrying ? said.retrying : said.retry }), actions.map((a, i) => !React.isValidElement(a) ? _jsx(Button, { kind: "text", size: "xs", onClick: a.onClick, children: a.label }, a.label)
30
+ : React.cloneElement(a, { key: a.key ?? i, ...(a.type === Button ? { size: "xs" } : {}) }))] }));
31
+ return (_jsxs("div", { role: urgent ? "alert" : "status", "data-meaning": meaning, "data-kit": "notice", ...phoneMark(phone), className: cx("o-notice o-smooth o-smooth-ease", title != null && "o-notice-titled", arrived && "o-notice-arrived", phase === "going" && "o-notice-going", className), onTransitionEnd: (e) => { if (phase === "going" && e.target === e.currentTarget && e.propertyName === "opacity") {
32
+ setPhase("gone");
33
+ onDismiss?.();
34
+ } }, children: [icon === false ? null : icon != null ? _jsx("span", { className: "o-notice-icon", "aria-hidden": "true", children: icon }) : glyph(NOTICE_ICONS[meaning === "neutral" ? "information" : meaning], "o-notice-icon"), _jsxs("div", { className: "o-notice-body", children: [title != null && _jsx("p", { className: "o-notice-title", children: title }), _jsx("div", { className: "o-notice-text", children: children }), title != null && acts && _jsx("div", { className: "o-notice-below", children: acts })] }), title == null && acts && _jsx("div", { className: "o-notice-acts", children: acts }), dismissible && _jsx(Button, { kind: "quiet", size: "xs", shape: "icon", className: "o-notice-x", "aria-label": said.dismiss, "data-force": force, icon: glyph(X, "", 2.25), onClick: away })] }));
35
+ }
@@ -0,0 +1,99 @@
1
+ export declare const NOTICE_TOKENS: readonly [{
2
+ readonly name: "--vk-spacing";
3
+ readonly kind: "size";
4
+ readonly outright: "--spacing";
5
+ }, {
6
+ readonly name: "--vk-radius-lg";
7
+ readonly kind: "size";
8
+ readonly outright: "--radius-lg";
9
+ }, {
10
+ readonly name: "--vk-fg";
11
+ readonly kind: "colour";
12
+ readonly outright: "--text";
13
+ }, {
14
+ readonly name: "--vk-font-size-sm";
15
+ readonly kind: "size";
16
+ readonly outright: "--text-sm";
17
+ }, {
18
+ readonly name: "--vk-line-height-sm";
19
+ readonly kind: "size";
20
+ readonly outright: "--text-sm--line-height";
21
+ }, {
22
+ readonly name: "--vk-duration-fast";
23
+ readonly kind: "motion";
24
+ readonly outright: "--duration-fast";
25
+ }, {
26
+ readonly name: "--vk-ease-in";
27
+ readonly kind: "motion";
28
+ readonly outright: "--ease-in";
29
+ }, {
30
+ readonly name: "--vk-info-subtler";
31
+ readonly kind: "colour";
32
+ readonly outright: "--background-information-subtler";
33
+ }, {
34
+ readonly name: "--vk-info";
35
+ readonly kind: "colour";
36
+ readonly outright: "--text-information";
37
+ }, {
38
+ readonly name: "--vk-success-subtler";
39
+ readonly kind: "colour";
40
+ readonly outright: "--background-success-subtler";
41
+ }, {
42
+ readonly name: "--vk-success";
43
+ readonly kind: "colour";
44
+ readonly outright: "--text-success";
45
+ }, {
46
+ readonly name: "--vk-warning-subtler";
47
+ readonly kind: "colour";
48
+ readonly outright: "--background-warning-subtler";
49
+ }, {
50
+ readonly name: "--vk-warning";
51
+ readonly kind: "colour";
52
+ readonly outright: "--text-warning";
53
+ }, {
54
+ readonly name: "--vk-danger-subtler";
55
+ readonly kind: "colour";
56
+ readonly outright: "--background-danger-subtler";
57
+ }, {
58
+ readonly name: "--vk-danger";
59
+ readonly kind: "colour";
60
+ readonly outright: "--text-danger";
61
+ }, {
62
+ readonly name: "--vk-sunken";
63
+ readonly kind: "colour";
64
+ readonly outright: "--surface-sunken";
65
+ }, {
66
+ readonly name: "--vk-border-subtle";
67
+ readonly kind: "colour";
68
+ readonly outright: "--border-subtle";
69
+ }, {
70
+ readonly name: "--vk-border-width";
71
+ readonly kind: "size";
72
+ readonly outright: "--border-width";
73
+ }, {
74
+ readonly name: "--vk-fg-subtle";
75
+ readonly kind: "colour";
76
+ readonly outright: "--text-subtle";
77
+ }, {
78
+ readonly name: "--vk-fg-subtlest";
79
+ readonly kind: "colour";
80
+ readonly outright: "--text-subtlest";
81
+ }, {
82
+ readonly name: "--vk-font-weight-semibold";
83
+ readonly kind: "size";
84
+ readonly outright: "--font-weight-semibold";
85
+ }, {
86
+ readonly name: "--vk-duration-base";
87
+ readonly kind: "motion";
88
+ readonly outright: "--duration-base";
89
+ }, {
90
+ readonly name: "--vk-ease-out";
91
+ readonly kind: "motion";
92
+ readonly outright: "--ease-out";
93
+ }, {
94
+ readonly name: "--vk-corner-smoothing";
95
+ readonly kind: "size";
96
+ readonly outright: "--corner-smoothing";
97
+ }];
98
+ /** The Notice's own machinery: its meaning's ground and edge, and how it fits its actions. */
99
+ export declare const NOTICE_PRIVATE: readonly ["--notice-"];
@@ -0,0 +1,27 @@
1
+ export const NOTICE_TOKENS = [
2
+ { name: "--vk-spacing", kind: "size", outright: "--spacing" },
3
+ { name: "--vk-radius-lg", kind: "size", outright: "--radius-lg" },
4
+ { name: "--vk-fg", kind: "colour", outright: "--text" },
5
+ { name: "--vk-font-size-sm", kind: "size", outright: "--text-sm" },
6
+ { name: "--vk-line-height-sm", kind: "size", outright: "--text-sm--line-height" },
7
+ { name: "--vk-duration-fast", kind: "motion", outright: "--duration-fast" },
8
+ { name: "--vk-ease-in", kind: "motion", outright: "--ease-in" },
9
+ { name: "--vk-info-subtler", kind: "colour", outright: "--background-information-subtler" },
10
+ { name: "--vk-info", kind: "colour", outright: "--text-information" },
11
+ { name: "--vk-success-subtler", kind: "colour", outright: "--background-success-subtler" },
12
+ { name: "--vk-success", kind: "colour", outright: "--text-success" },
13
+ { name: "--vk-warning-subtler", kind: "colour", outright: "--background-warning-subtler" },
14
+ { name: "--vk-warning", kind: "colour", outright: "--text-warning" },
15
+ { name: "--vk-danger-subtler", kind: "colour", outright: "--background-danger-subtler" },
16
+ { name: "--vk-danger", kind: "colour", outright: "--text-danger" },
17
+ { name: "--vk-sunken", kind: "colour", outright: "--surface-sunken" },
18
+ { name: "--vk-border-subtle", kind: "colour", outright: "--border-subtle" },
19
+ { name: "--vk-border-width", kind: "size", outright: "--border-width" },
20
+ { name: "--vk-fg-subtle", kind: "colour", outright: "--text-subtle" },
21
+ { name: "--vk-fg-subtlest", kind: "colour", outright: "--text-subtlest" },
22
+ { name: "--vk-font-weight-semibold", kind: "size", outright: "--font-weight-semibold" },
23
+ { name: "--vk-duration-base", kind: "motion", outright: "--duration-base" },
24
+ { name: "--vk-ease-out", kind: "motion", outright: "--ease-out" },
25
+ { name: "--vk-corner-smoothing", kind: "size", outright: "--corner-smoothing" },
26
+ ];
27
+ export const NOTICE_PRIVATE = ["--notice-"];