material-plus-ui 1.3.1 → 1.4.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 (253) hide show
  1. package/README.md +2 -2
  2. package/dist/components/alert/MPAlert.d.ts +26 -0
  3. package/dist/components/alert/MPAlert.js +1 -1
  4. package/dist/components/alert/index.d.ts +1 -1
  5. package/dist/components/animate-marquee/MPAnimateMarquee.js +1 -1
  6. package/dist/components/avatar/MPAvatar.js +1 -1
  7. package/dist/components/avatar-group/MPAvatarGroup.d.ts +74 -0
  8. package/dist/components/avatar-group/MPAvatarGroup.js +2 -0
  9. package/dist/components/avatar-group/index.d.ts +2 -0
  10. package/dist/components/avatar-group/index.js +1 -0
  11. package/dist/components/breadcrumb/MPBreadcrumb.d.ts +10 -4
  12. package/dist/components/breadcrumb/MPBreadcrumb.js +1 -1
  13. package/dist/components/button/MPButton.js +1 -1
  14. package/dist/components/button-group/MPButtonGroup.d.ts +9 -0
  15. package/dist/components/button-group/MPButtonGroup.js +1 -1
  16. package/dist/components/carousel/MPCarousel.d.ts +12 -7
  17. package/dist/components/carousel/MPCarousel.js +1 -1
  18. package/dist/components/chat-bubble/MPChatBubble.d.ts +15 -2
  19. package/dist/components/chat-bubble/MPChatBubble.js +1 -1
  20. package/dist/components/color-picker/MPColorPicker.d.ts +20 -17
  21. package/dist/components/color-picker/MPColorPicker.js +1 -1
  22. package/dist/components/combobox/MPCombobox.d.ts +22 -4
  23. package/dist/components/combobox/MPCombobox.js +1 -1
  24. package/dist/components/command-palette/MPCommandPalette.d.ts +132 -0
  25. package/dist/components/command-palette/MPCommandPalette.js +2 -0
  26. package/dist/components/command-palette/index.d.ts +2 -0
  27. package/dist/components/command-palette/index.js +1 -0
  28. package/dist/components/container/MPContainer.js +1 -1
  29. package/dist/components/date-time-picker/MPDateTimePicker.d.ts +5 -0
  30. package/dist/components/dialog/MPDialog.js +1 -1
  31. package/dist/components/divider/MPDivider.js +1 -1
  32. package/dist/components/drawer/MPDrawer.js +1 -1
  33. package/dist/components/fieldset/MPFieldset.d.ts +52 -0
  34. package/dist/components/fieldset/MPFieldset.js +2 -0
  35. package/dist/components/fieldset/index.d.ts +2 -0
  36. package/dist/components/fieldset/index.js +1 -0
  37. package/dist/components/file-picker/MPFilePicker.d.ts +4 -3
  38. package/dist/components/file-picker/MPFilePicker.js +1 -1
  39. package/dist/components/floating-action-button/MPFloatingActionButton.js +1 -1
  40. package/dist/components/footer/MPFooter.d.ts +94 -0
  41. package/dist/components/footer/MPFooter.js +2 -0
  42. package/dist/components/footer/index.d.ts +2 -0
  43. package/dist/components/footer/index.js +1 -0
  44. package/dist/components/form/MPForm.d.ts +73 -0
  45. package/dist/components/form/MPForm.js +2 -0
  46. package/dist/components/form/index.d.ts +2 -0
  47. package/dist/components/form/index.js +1 -0
  48. package/dist/components/header/MPHeader.d.ts +122 -0
  49. package/dist/components/header/MPHeader.js +2 -0
  50. package/dist/components/header/index.d.ts +2 -0
  51. package/dist/components/header/index.js +1 -0
  52. package/dist/components/highlight/MPHighlight.d.ts +7 -0
  53. package/dist/components/menu/MPMenu.js +1 -1
  54. package/dist/components/menubar/MPMenubar.d.ts +82 -0
  55. package/dist/components/menubar/MPMenubar.js +2 -0
  56. package/dist/components/menubar/index.d.ts +2 -0
  57. package/dist/components/menubar/index.js +1 -0
  58. package/dist/components/navigation-menu/MPNavigationMenu.d.ts +151 -0
  59. package/dist/components/navigation-menu/MPNavigationMenu.js +2 -0
  60. package/dist/components/navigation-menu/index.d.ts +2 -0
  61. package/dist/components/navigation-menu/index.js +1 -0
  62. package/dist/components/number-field/MPNumberField.d.ts +12 -3
  63. package/dist/components/number-field/MPNumberField.js +1 -1
  64. package/dist/components/overlay/MPOverlay.d.ts +8 -2
  65. package/dist/components/overlay/MPOverlay.js +1 -1
  66. package/dist/components/page-layout/MPPageLayout.d.ts +145 -0
  67. package/dist/components/page-layout/MPPageLayout.js +2 -0
  68. package/dist/components/page-layout/index.d.ts +2 -0
  69. package/dist/components/page-layout/index.js +1 -0
  70. package/dist/components/panes/MPPanes.js +1 -1
  71. package/dist/components/popover/MPPopover.js +1 -1
  72. package/dist/components/progress-box/MPProgressBox.js +1 -1
  73. package/dist/components/progress-circular/MPProgressCircular.js +1 -1
  74. package/dist/components/progress-linear/MPProgressLinear.js +1 -1
  75. package/dist/components/radio-group/MPRadioGroup.js +1 -1
  76. package/dist/components/segmented-button/MPSegmentedButton.js +1 -1
  77. package/dist/components/select/MPSelect.d.ts +12 -1
  78. package/dist/components/select/MPSelect.js +1 -1
  79. package/dist/components/shortcut/MPShortcut.js +1 -1
  80. package/dist/components/sidebar/MPSidebar.d.ts +160 -0
  81. package/dist/components/sidebar/MPSidebar.js +2 -0
  82. package/dist/components/sidebar/MPSidebarTrigger.d.ts +45 -0
  83. package/dist/components/sidebar/MPSidebarTrigger.js +2 -0
  84. package/dist/components/sidebar/index.d.ts +4 -0
  85. package/dist/components/sidebar/index.js +1 -0
  86. package/dist/components/skeleton/MPSkeleton.js +1 -1
  87. package/dist/components/slider/MPSlider.js +1 -1
  88. package/dist/components/snackbar/MPSnackbar.js +1 -1
  89. package/dist/components/switch/MPSwitch.js +1 -1
  90. package/dist/components/table/MPTable.d.ts +27 -5
  91. package/dist/components/table/MPTable.js +1 -1
  92. package/dist/components/text-field/MPTextField.d.ts +13 -2
  93. package/dist/components/text-field/MPTextField.js +1 -1
  94. package/dist/components/text-link/MPTextLink.d.ts +7 -1
  95. package/dist/components/text-link/MPTextLink.js +1 -1
  96. package/dist/components/time-picker/MPTimePicker.d.ts +4 -0
  97. package/dist/components/toggle/MPToggle.d.ts +72 -0
  98. package/dist/components/toggle/MPToggle.js +2 -0
  99. package/dist/components/toggle/index.d.ts +2 -0
  100. package/dist/components/toggle/index.js +1 -0
  101. package/dist/components/toggle-group/MPToggleGroup.d.ts +74 -0
  102. package/dist/components/toggle-group/MPToggleGroup.js +2 -0
  103. package/dist/components/toggle-group/index.d.ts +2 -0
  104. package/dist/components/toggle-group/index.js +1 -0
  105. package/dist/components/tooltip/MPTooltip.js +1 -1
  106. package/dist/components/transfer/MPTransfer.d.ts +98 -0
  107. package/dist/components/transfer/MPTransfer.js +2 -0
  108. package/dist/components/transfer/index.d.ts +2 -0
  109. package/dist/components/transfer/index.js +1 -0
  110. package/dist/constants/glyphs.d.ts +10 -0
  111. package/dist/constants/glyphs.js +1 -1
  112. package/dist/constants/icons.d.ts +1 -0
  113. package/dist/constants/icons.js +1 -1
  114. package/dist/index.d.ts +13 -0
  115. package/dist/index.js +1 -1
  116. package/dist/internal/Calendar.js +1 -1
  117. package/dist/internal/FieldOutline.js +1 -1
  118. package/dist/internal/SupportingText.d.ts +1 -1
  119. package/dist/internal/SupportingText.js +1 -1
  120. package/dist/internal/animate.d.ts +0 -17
  121. package/dist/internal/animate.js +1 -1
  122. package/dist/internal/avatar-group.d.ts +22 -0
  123. package/dist/internal/avatar-group.js +2 -0
  124. package/dist/internal/button-group.d.ts +20 -1
  125. package/dist/internal/button-group.js +1 -1
  126. package/dist/internal/color.d.ts +0 -5
  127. package/dist/internal/color.js +1 -1
  128. package/dist/internal/date.js +1 -1
  129. package/dist/internal/i18n.d.ts +201 -4
  130. package/dist/internal/keys.d.ts +72 -0
  131. package/dist/internal/keys.js +2 -0
  132. package/dist/internal/length.d.ts +42 -0
  133. package/dist/internal/length.js +1 -0
  134. package/dist/internal/link.d.ts +44 -0
  135. package/dist/internal/link.js +1 -0
  136. package/dist/internal/locale.d.ts +20 -1
  137. package/dist/internal/locale.js +1 -1
  138. package/dist/internal/messages/breadcrumb.d.ts +3 -0
  139. package/dist/internal/messages/breadcrumb.js +1 -0
  140. package/dist/internal/messages/carousel.d.ts +3 -0
  141. package/dist/internal/messages/carousel.js +1 -0
  142. package/dist/internal/messages/color-picker.d.ts +3 -0
  143. package/dist/internal/messages/color-picker.js +1 -0
  144. package/dist/internal/messages/combobox.d.ts +3 -0
  145. package/dist/internal/messages/combobox.js +1 -0
  146. package/dist/internal/messages/command.d.ts +3 -0
  147. package/dist/internal/messages/command.js +1 -0
  148. package/dist/internal/messages/file-picker.d.ts +3 -0
  149. package/dist/internal/messages/file-picker.js +1 -0
  150. package/dist/internal/messages/layout.d.ts +3 -0
  151. package/dist/internal/messages/layout.js +1 -0
  152. package/dist/internal/messages/number-field.d.ts +3 -0
  153. package/dist/internal/messages/number-field.js +1 -0
  154. package/dist/internal/messages/overlay.d.ts +3 -0
  155. package/dist/internal/messages/overlay.js +1 -0
  156. package/dist/internal/messages/table.d.ts +3 -0
  157. package/dist/internal/messages/table.js +1 -0
  158. package/dist/internal/messages/text-link.d.ts +3 -0
  159. package/dist/internal/messages/text-link.js +1 -0
  160. package/dist/internal/messages/transfer.d.ts +3 -0
  161. package/dist/internal/messages/transfer.js +1 -0
  162. package/dist/internal/page-layout.d.ts +182 -0
  163. package/dist/internal/page-layout.js +2 -0
  164. package/dist/internal/scale.d.ts +17 -0
  165. package/dist/internal/scale.js +1 -1
  166. package/dist/locales/ar.js +1 -1
  167. package/dist/locales/de.js +1 -1
  168. package/dist/locales/es.js +1 -1
  169. package/dist/locales/fr.js +1 -1
  170. package/dist/locales/hi.js +1 -1
  171. package/dist/locales/id.js +1 -1
  172. package/dist/locales/it.js +1 -1
  173. package/dist/locales/ja.js +1 -1
  174. package/dist/locales/ko.js +1 -1
  175. package/dist/locales/nl.js +1 -1
  176. package/dist/locales/pl.js +1 -1
  177. package/dist/locales/pt.js +1 -1
  178. package/dist/locales/ru.js +1 -1
  179. package/dist/locales/th.js +1 -1
  180. package/dist/locales/tr.js +1 -1
  181. package/dist/locales/vi.js +1 -1
  182. package/dist/locales/zh-hans.js +1 -1
  183. package/dist/locales/zh-hant.js +1 -1
  184. package/dist/styles/accordion.css +1 -1
  185. package/dist/styles/alert.css +1 -1
  186. package/dist/styles/avatar-group.css +2 -0
  187. package/dist/styles/avatar.css +1 -1
  188. package/dist/styles/badge.css +1 -1
  189. package/dist/styles/blockquote.css +1 -1
  190. package/dist/styles/bottom-navigation.css +1 -1
  191. package/dist/styles/box.css +1 -1
  192. package/dist/styles/breadcrumb.css +1 -1
  193. package/dist/styles/button-group.css +1 -1
  194. package/dist/styles/button.css +1 -1
  195. package/dist/styles/card.css +1 -1
  196. package/dist/styles/carousel.css +1 -1
  197. package/dist/styles/chat-bubble.css +1 -1
  198. package/dist/styles/checkbox.css +1 -1
  199. package/dist/styles/chip.css +1 -1
  200. package/dist/styles/collapsible.css +1 -1
  201. package/dist/styles/color-picker.css +1 -1
  202. package/dist/styles/combobox.css +1 -1
  203. package/dist/styles/command-palette.css +2 -0
  204. package/dist/styles/date-picker.css +1 -1
  205. package/dist/styles/date-range-picker.css +1 -1
  206. package/dist/styles/date-time-picker.css +1 -1
  207. package/dist/styles/dialog.css +1 -1
  208. package/dist/styles/divider.css +1 -1
  209. package/dist/styles/drawer.css +1 -1
  210. package/dist/styles/empty.css +1 -1
  211. package/dist/styles/fieldset.css +2 -0
  212. package/dist/styles/file-picker.css +1 -1
  213. package/dist/styles/floating-action-button.css +1 -1
  214. package/dist/styles/footer.css +2 -0
  215. package/dist/styles/form.css +2 -0
  216. package/dist/styles/header.css +2 -0
  217. package/dist/styles/highlight.css +1 -1
  218. package/dist/styles/icon-button.css +1 -1
  219. package/dist/styles/list.css +1 -1
  220. package/dist/styles/locale.css +1 -1
  221. package/dist/styles/menu.css +1 -1
  222. package/dist/styles/menubar.css +2 -0
  223. package/dist/styles/navigation-menu.css +2 -0
  224. package/dist/styles/number-field.css +1 -1
  225. package/dist/styles/otp-field.css +1 -1
  226. package/dist/styles/overlay.css +1 -1
  227. package/dist/styles/page-layout.css +2 -0
  228. package/dist/styles/pagination.css +1 -1
  229. package/dist/styles/panes.css +1 -1
  230. package/dist/styles/pill.css +1 -1
  231. package/dist/styles/popover.css +1 -1
  232. package/dist/styles/progress-box.css +1 -1
  233. package/dist/styles/progress-circular.css +1 -1
  234. package/dist/styles/progress-linear.css +1 -1
  235. package/dist/styles/radio-group.css +1 -1
  236. package/dist/styles/segmented-button.css +1 -1
  237. package/dist/styles/select.css +1 -1
  238. package/dist/styles/sidebar.css +2 -0
  239. package/dist/styles/skeleton.css +1 -1
  240. package/dist/styles/slider.css +1 -1
  241. package/dist/styles/spoiler.css +1 -1
  242. package/dist/styles/switch.css +1 -1
  243. package/dist/styles/table.css +1 -1
  244. package/dist/styles/tabs.css +1 -1
  245. package/dist/styles/text-field.css +1 -1
  246. package/dist/styles/text-link.css +1 -1
  247. package/dist/styles/time-picker.css +1 -1
  248. package/dist/styles/timeline.css +1 -1
  249. package/dist/styles/toggle-group.css +2 -0
  250. package/dist/styles/toggle.css +2 -0
  251. package/dist/styles/transfer.css +2 -0
  252. package/dist/styles.css +1 -1
  253. package/package.json +2 -2
@@ -39,7 +39,7 @@
39
39
  * the languages it speaks. Once it has, `locale="ko"` resolves through exactly
40
40
  * the path it always did.
41
41
  *
42
- * English left too, for the same reason one step smaller. It is nine modules
42
+ * English left too, for the same reason one step smaller. It is thirteen modules
43
43
  * under `internal/messages/`, one per namespace, because a bundler that can drop
44
44
  * a module it can also drop an export — and cannot drop a property. Held as one
45
45
  * object, English was 1.75 kB that every component carried whole: `MPButton`
@@ -151,6 +151,101 @@ export interface MPMessages {
151
151
  start: string;
152
152
  end: string;
153
153
  };
154
+ /**
155
+ * MPNumberField.
156
+ *
157
+ * The two steppers, which are a plus and a minus and have no words of their
158
+ * own — the same case the pagination's chevrons and the chat's delivery marks
159
+ * are in. They are read out and never drawn.
160
+ */
161
+ numberField: {
162
+ increase: string;
163
+ decrease: string;
164
+ };
165
+ /**
166
+ * MPCarousel.
167
+ *
168
+ * Every string here is read out and never drawn: the strip is pictures, the
169
+ * arrows are chevrons and the marks under it are dots. `{index}` and
170
+ * `{total}` are filled in by `fillMessage`, and they are named rather than
171
+ * positional for the reason the pagination's are — a language that counts the
172
+ * total first is not a language this table can serve with an argument order.
173
+ */
174
+ carousel: {
175
+ /** The name of the `region` the strip is inside. */
176
+ label: string;
177
+ /** The two arrows. */
178
+ previous: string;
179
+ next: string;
180
+ /** One slide, and its own position mark. `Slide 2 of 5`. */
181
+ slide: string;
182
+ };
183
+ /**
184
+ * MPBreadcrumb.
185
+ *
186
+ * Both read out and never drawn: a trail's steps are the caller's words, and
187
+ * these are the two things around them that are not.
188
+ */
189
+ breadcrumb: {
190
+ /** The name of the `<nav>` the trail is inside. */
191
+ label: string;
192
+ /** The `…` that puts the folded middle back. */
193
+ expand: string;
194
+ };
195
+ /**
196
+ * MPCombobox.
197
+ *
198
+ * Both **drawn**, which is what makes them belong here rather than in a prop:
199
+ * a Korean page whose search box says *No matches* has answered in a language
200
+ * the reader did not ask a question in. `{label}` is the text they typed, and
201
+ * is filled in by `fillMessage`.
202
+ */
203
+ combobox: {
204
+ /** The line where the rows would be, when nothing matched. */
205
+ empty: string;
206
+ /** The row that offers what was typed as a value of its own. */
207
+ add: string;
208
+ };
209
+ /**
210
+ * MPTable.
211
+ *
212
+ * One string, drawn across the whole width where the rows would be. A table
213
+ * that says *No data* in the middle of a translated page is the one part of it
214
+ * that was not translated.
215
+ */
216
+ table: {
217
+ empty: string;
218
+ };
219
+ /**
220
+ * MPFilePicker.
221
+ *
222
+ * The line inside the box, and the largest piece of text this table holds. It
223
+ * is drawn, it is an instruction, and it is the whole of what the component
224
+ * tells a reader to do.
225
+ */
226
+ filePicker: {
227
+ prompt: string;
228
+ };
229
+ /**
230
+ * MPTextLink.
231
+ *
232
+ * The sentence after a link that takes over the window. Read out and never
233
+ * drawn — the arrow says it to a reader who can see it, and this says it to
234
+ * everybody else.
235
+ */
236
+ textLink: {
237
+ newTab: string;
238
+ };
239
+ /**
240
+ * MPOverlay.
241
+ *
242
+ * The name of a modal region that may hold nothing readable at all — a bare
243
+ * spinner, a `clear` sheet. Without it a screen reader announces the region as
244
+ * nothing, which is why the component defaults it rather than requiring it.
245
+ */
246
+ overlay: {
247
+ label: string;
248
+ };
154
249
  /** MPAlert. */
155
250
  alert: {
156
251
  /** The × in the corner, which has no text of its own. */
@@ -234,6 +329,108 @@ export interface MPMessages {
234
329
  /** The line above the button, saying why the content is covered. */
235
330
  notice: string;
236
331
  };
332
+ /**
333
+ * MPPageLayout, and the parts of a page it arranges.
334
+ *
335
+ * One namespace for the skeleton rather than one per component, for the reason
336
+ * the pickers share theirs: they are one vocabulary, written by whoever
337
+ * translates a page's chrome, and a caller who has translated the word for a
338
+ * sidebar has translated the button that opens it in the same breath.
339
+ */
340
+ layout: {
341
+ /**
342
+ * The link that jumps past the navigation, drawn only while it holds the
343
+ * focus.
344
+ *
345
+ * Drawn rather than only announced, which makes it one of the few strings
346
+ * here that a sighted keyboard reader actually sees — and the one it would
347
+ * be least forgivable to leave in English, because the readers it exists for
348
+ * are the ones who cannot skip it.
349
+ */
350
+ skipToContent: string;
351
+ /**
352
+ * What an `MPSidebar` is called when nothing named it.
353
+ *
354
+ * Read out and never drawn. Every `<aside>` needs a name and a page with two
355
+ * of them *must* have one each, or a screen reader offers two regions called
356
+ * "complementary" — which is exactly why this is a default rather than a
357
+ * required prop.
358
+ */
359
+ sidebar: string;
360
+ /** The hamburger, which is a drawing and has no word of its own. */
361
+ openSidebar: string;
362
+ /** The same button once the drawer is open. */
363
+ closeSidebar: string;
364
+ /** The handle on a resizable column's inner edge. */
365
+ resizeSidebar: string;
366
+ };
367
+ /**
368
+ * MPTransfer.
369
+ *
370
+ * Every string here is **drawn**, which is unusual in this table and is what
371
+ * makes the namespace necessary: the two headings, the filter's placeholder
372
+ * and the line an empty list shows are all read off the screen, and a Korean
373
+ * page with a column headed *Available* is a page the component broke.
374
+ *
375
+ * The two arrows are the exception and are read out rather than drawn, for the
376
+ * reason the pagination's steppers are.
377
+ */
378
+ transfer: {
379
+ /** The heading over the list of things that have not been chosen. */
380
+ source: string;
381
+ /** And over the list of things that have. */
382
+ target: string;
383
+ /** The arrow that sends the ticked rows across. */
384
+ toTarget: string;
385
+ /** And the one that brings them back. */
386
+ toSource: string;
387
+ /** The filter above each list. */
388
+ search: string;
389
+ /** What a list with nothing in it says. */
390
+ empty: string;
391
+ };
392
+ /**
393
+ * MPCommandPalette.
394
+ *
395
+ * Three strings, two of them drawn: a palette that says *Type a command or
396
+ * search…* to a Korean reader is a palette that has told them, in the first
397
+ * thing they see, that it is not for them.
398
+ */
399
+ command: {
400
+ /** The dialog's accessible name. It has no visible title to take one from. */
401
+ label: string;
402
+ /** The placeholder in the field. */
403
+ search: string;
404
+ /** The line where the rows would be, when nothing matched. */
405
+ empty: string;
406
+ };
407
+ /**
408
+ * MPColorPicker.
409
+ *
410
+ * The one control in the library whose parts have **nowhere to take a name
411
+ * from**: a saturation square, a hue rail and an opacity rail are three
412
+ * draggable rectangles, and without these they are three draggable rectangles
413
+ * to a screen reader too.
414
+ *
415
+ * `empty` is the exception and is drawn — it is what the trigger reads before
416
+ * a colour has been chosen.
417
+ */
418
+ colorPicker: {
419
+ /** The saturation/brightness square. */
420
+ area: string;
421
+ /** The hue rail beside it. */
422
+ hue: string;
423
+ /** The opacity rail, when `alpha` is on. */
424
+ alpha: string;
425
+ /** The field the value can be typed into. */
426
+ value: string;
427
+ /** The grid of ready-made colours. */
428
+ swatches: string;
429
+ /** The × that empties the control. */
430
+ clear: string;
431
+ /** What the trigger reads before anything has been chosen. */
432
+ empty: string;
433
+ };
237
434
  }
238
435
  /** A translation may fill in as much or as little of the table as it has. */
239
436
  export type MPPartialMessages = {
@@ -269,10 +466,10 @@ export interface MPLocale {
269
466
  /**
270
467
  * One namespace's English strings, carrying the name they answer to.
271
468
  *
272
- * The nine of them live in `internal/messages/`, one to a module, and a
469
+ * The thirteen of them live in `internal/messages/`, one to a module, and a
273
470
  * component imports the one it speaks. That is the whole reason this type
274
471
  * exists: `resolveNamespace` below is handed the English table rather than
275
- * looking it up, so the eight tables a component does not use are eight modules
472
+ * looking it up, so the twelve tables a component does not use are twelve modules
276
473
  * nothing imports.
277
474
  *
278
475
  * The name travels with the strings rather than beside them, so a call site is
@@ -313,7 +510,7 @@ export declare function registerMPMessages(...locales: MPLocale[]): void;
313
510
  * A namespace at a time, so a language that has one and not another keeps
314
511
  * English for the rest rather than losing both. That was already how the merge
315
512
  * worked; what changed is that the namespaces are no longer merged all at once,
316
- * because a component that reads one of them should not carry the other eight.
513
+ * because a component that reads one of them should not carry the other twelve.
317
514
  *
318
515
  * Note that this is only about the words in the table. The dates themselves are
319
516
  * formatted by `Intl` against the same tag, and `Intl` speaks every language the
@@ -0,0 +1,72 @@
1
+ /**
2
+ * What keyboard the reader is on, and how a shortcut is spelled.
3
+ *
4
+ * Two components speak this vocabulary and they speak it in opposite
5
+ * directions: [MPShortcut](../components/shortcut/MPShortcut.tsx) *writes* a
6
+ * shortcut down, and [MPCommandPalette](../components/command-palette/MPCommandPalette.tsx)
7
+ * *reads* one off a real keyboard event. Both files already said that the two
8
+ * had to agree — "a shortcut a component displays and one it binds have to be
9
+ * spelled the same way, or the label on the screen is a claim nobody checked" —
10
+ * and both then answered the question separately.
11
+ *
12
+ * They disagreed. The palette tested `navigator.userAgent` alone, which is the
13
+ * one of the three sources a browser is most willing to freeze or lie about, so
14
+ * a page could draw `⌘K` and bind Ctrl+K. Written once, they cannot.
15
+ *
16
+ * Nothing here is exported from `src/index.ts`. It is the library talking to
17
+ * itself, in the sense `internal/` always means.
18
+ */
19
+ /** The three real platforms a shortcut is spelled for. */
20
+ export type MPResolvedOS = 'mac' | 'windows' | 'linux';
21
+ /**
22
+ * What the browser says it is running on.
23
+ *
24
+ * `userAgentData.platform` is the modern spelling and `navigator.platform` the
25
+ * deprecated one that every browser still answers; the user agent string is the
26
+ * last resort. All three are matched at once because the question is coarse —
27
+ * which of three key caps to print — and getting it slightly wrong is a label,
28
+ * not a bug.
29
+ */
30
+ export declare function detectOS(): MPResolvedOS;
31
+ /**
32
+ * `useSyncExternalStore` rather than `useEffect` plus state, and rather than
33
+ * reading `navigator` during render.
34
+ *
35
+ * Reading it during render is a hydration mismatch waiting to happen: the server
36
+ * has no `navigator`, so it would render `Ctrl` and the client would render `⌘`
37
+ * into the same markup. This hook is the one API that tells React the two are
38
+ * *meant* to differ — it hydrates with the server's answer and re-renders with
39
+ * the browser's, which is exactly the sequence a Mac reader sees.
40
+ */
41
+ export declare function useDetectedOS(): MPResolvedOS;
42
+ /**
43
+ * Splits the string form. Empty segments are what `'Ctrl++'` leaves behind, and
44
+ * dropping them is why the array form exists for that case.
45
+ */
46
+ export declare function tokenizeShortcut(keys: string | string[]): string[];
47
+ /**
48
+ * Whether a keyboard event is the shortcut this string names.
49
+ *
50
+ * The same vocabulary `MPShortcut` draws, read rather than written — and the
51
+ * same tokenizer, so a shortcut that can be displayed is a shortcut that can be
52
+ * matched.
53
+ *
54
+ * ## `Mod` is a name for a key, not a fifth modifier
55
+ *
56
+ * It resolves to Command on a Mac and Control everywhere else, so `Mod+K` and
57
+ * `Ctrl+K` are the *same combination* on Windows — and the check has to say so.
58
+ * Tested as a modifier of its own, they contradicted each other: `Ctrl+K` on
59
+ * Windows held Control, `Mod` was not named, and "is Control down without Mod
60
+ * being asked for" answered no. `Ctrl+K` simply never matched anywhere except a
61
+ * Mac, on the component whose whole job is to answer a shortcut.
62
+ *
63
+ * So `Mod` is folded into whichever real key it stands for, and the four
64
+ * modifiers are then compared as themselves.
65
+ *
66
+ * Each is checked in **both** directions. A shortcut that fired with extra
67
+ * modifiers held would take a combination the page had given to something else.
68
+ *
69
+ * The platform is passed rather than sniffed, so a caller reads it through the
70
+ * same hook the label does and the two cannot end up on different answers.
71
+ */
72
+ export declare function matchesShortcut(event: KeyboardEvent, shortcut: string | string[], os: MPResolvedOS): boolean;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import*as t from"react";export function detectOS(){if("undefined"==typeof navigator)return"windows";const t=navigator.userAgentData,e=`${t?.platform??""} ${navigator.platform??""} ${navigator.userAgent??""}`;return/mac|iphone|ipad|ipod/i.test(e)?"mac":/win/i.test(e)?"windows":"linux"}function e(){return()=>{}}function r(){return"windows"}export function useDetectedOS(){return t.useSyncExternalStore(e,detectOS,r)}export function tokenizeShortcut(t){return Array.isArray(t)?t.map(t=>t.trim()).filter(Boolean):t.split("+").map(t=>t.trim()).filter(Boolean)}export function matchesShortcut(t,e,r){const n=tokenizeShortcut(e).map(t=>t.toLowerCase()),o=n[n.length-1];if(void 0===o)return!1;const a=new Set(n.slice(0,-1)),i=a.has("mod"),s=a.has("ctrl")||i&&"mac"!==r,c=a.has("meta")||i&&"mac"===r;return s===t.ctrlKey&&c===t.metaKey&&(a.has("shift")===t.shiftKey&&a.has("alt")===t.altKey&&t.key.toLowerCase()===o)}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * A length, said the way this library says lengths.
3
+ *
4
+ * One rule, everywhere: **a number is CSS pixels and a string is already a CSS
5
+ * length.** Twelve components had written it out inline and four more had a
6
+ * private `toLength` of their own, which is sixteen copies of a sentence that is
7
+ * either true of the whole library or true of nothing.
8
+ *
9
+ * They all happened to agree. That is the argument for collecting them rather
10
+ * than against it — sixteen agreeing copies are sixteen chances for the
11
+ * seventeenth to be written slightly differently, and the difference would be a
12
+ * prop that quietly took a number to mean something else.
13
+ *
14
+ * Nothing here is exported from `src/index.ts`. It is the library talking to
15
+ * itself, in the sense `internal/` always means.
16
+ */
17
+ /** A number is pixels; a string is whatever it says; nothing is nothing. */
18
+ export declare function cssLength(value: number | string): string;
19
+ export declare function cssLength(value: number | string | undefined | null): string | undefined;
20
+ /**
21
+ * A CSS length string, in pixels, or `undefined` for one this cannot resolve.
22
+ *
23
+ * The two components that let a reader *drag* a size — `MPSidebar` and
24
+ * `MPPanes` — both have to turn a written bound into a number to clamp against,
25
+ * and both had the same regex and the same unit arithmetic. This is that,
26
+ * once.
27
+ *
28
+ * `undefined` rather than a fallback, so each caller decides what an
29
+ * unresolvable bound means. They do not agree, and should not: a pane with an
30
+ * unreadable `minSize` is a pane with no minimum, and a sidebar with an
31
+ * unreadable one still has a default to fall back to. A parser that picked for
32
+ * them would have to pick wrongly for one of them.
33
+ *
34
+ * ## What the units are measured against
35
+ *
36
+ * `%` is a share of `extent`, which is whatever the caller is dividing up — the
37
+ * split's own width, the window's. `rem` is the document's font size and `em` is
38
+ * `root`'s, which is the distinction that makes `em` worth accepting at all: a
39
+ * bound written in `em` is a bound in the *component's* text, and a component
40
+ * inside a scaled-down panel means something different by it than the page does.
41
+ */
42
+ export declare function pixelsIn(value: string, extent?: number, root?: Element | null): number | undefined;
@@ -0,0 +1 @@
1
+ export function cssLength(e){if(null!=e)return"number"==typeof e?`${e}px`:e}const e=/^\s*(-?[\d.]+)\s*(px|rem|em|%)\s*$/;export function pixelsIn(t,n,o){const r=e.exec(t);if(!r)return;const u=Number(r[1]);if(!Number.isNaN(u))switch(r[2]){case"px":return u;case"%":return void 0===n?void 0:n*u/100;case"rem":return"undefined"==typeof document?void 0:u*(Number.parseFloat(getComputedStyle(document.documentElement).fontSize)||16);default:return"undefined"!=typeof document&&o?u*(Number.parseFloat(getComputedStyle(o).fontSize)||16):void 0}}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * The two questions a component has to ask about a URL it did not write.
3
+ *
4
+ * Four components render an `<a>` whose `target` a caller can set, and three of
5
+ * them had worked out the same `rel` independently — which is three chances for
6
+ * the fourth to forget, and the fourth did. One of them also renders a URL that
7
+ * arrives from somewhere else entirely, which is a different question with a
8
+ * worse failure.
9
+ *
10
+ * Nothing here is exported from `src/index.ts`. It is the library talking to
11
+ * itself, in the sense `internal/` always means.
12
+ */
13
+ /**
14
+ * The `rel` a link opening in a new tab needs, unless the caller named one.
15
+ *
16
+ * `target="_blank"` hands the opened page a `window.opener` back into this one
17
+ * unless it is told not to. Modern browsers imply `noopener` and older ones do
18
+ * not; `noreferrer` is never implied by anything, and is what stops the address
19
+ * of the page the reader was on travelling to wherever they just went.
20
+ *
21
+ * A caller's own `rel` **replaces** this rather than extending it, which is the
22
+ * bargain these components already documented: a row that also needs `nofollow`
23
+ * says `rel="noopener noreferrer nofollow"` and means it. The alternative —
24
+ * merging — is a component quietly adding tokens to an attribute the caller
25
+ * wrote out in full.
26
+ */
27
+ export declare function linkRel(target: string | undefined, rel: string | undefined): string | undefined;
28
+ /**
29
+ * A URL if it is one a reader can safely be sent to, and nothing if it is not.
30
+ *
31
+ * This is for the URLs that arrive from **somewhere else** — the link preview on
32
+ * a message somebody else sent — rather than for the ones an application writes
33
+ * into its own navigation. React renders a `javascript:` href with a development
34
+ * warning and no more, so on a page built out of user-generated content a
35
+ * hostile preview URL is a one-click script execution.
36
+ *
37
+ * A URL with no scheme at all is relative, and a relative URL cannot escalate to
38
+ * anything: it resolves against the page it is already on. Those pass.
39
+ *
40
+ * Rejected means `undefined`, so the element renders with no `href` — visibly
41
+ * not a link, rather than a link that quietly goes nowhere. Half-sanitising a
42
+ * URL into something that still navigates is how a filter becomes a bypass.
43
+ */
44
+ export declare function safeHref(href: string | undefined): string | undefined;
@@ -0,0 +1 @@
1
+ export function linkRel(e,t){return void 0!==t?t:"_blank"===e?"noopener noreferrer":void 0}const e=/[\u0000-\u0020\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]/g,t=/^([a-z][a-z0-9+.-]*):/i,u=new Set(["http:","https:","mailto:","tel:"]);export function safeHref(r){if(!r)return;const n=t.exec(r.replace(e,""));return n?u.has(`${n[1].toLowerCase()}:`)?r:void 0:r}
@@ -42,7 +42,26 @@ export declare function useMPLocale(locale?: string): string | undefined;
42
42
  *
43
43
  * The namespace is passed as the object from `internal/messages/`, not as its
44
44
  * name: it carries English with it, which is what lets a component that says one
45
- * word leave the other eight namespaces out of the bundle entirely. The objects
45
+ * word leave the other twelve namespaces out of the bundle entirely. The objects
46
46
  * are module constants, so the identity `useMemo` compares is stable.
47
+ *
48
+ * ## Why the overrides are keyed on what they say
49
+ *
50
+ * Because of how they are written. `labels={{ clear: 'Leeren' }}` is an object
51
+ * literal in JSX, which is a *new object every render* — so keyed on identity
52
+ * the memo missed every single time, and every component with a `labels` prop
53
+ * rebuilt its merged table on every render of its parent.
54
+ *
55
+ * That was not expensive on its own; what made it worth fixing is what the table
56
+ * is used for. It is handed straight back out of this hook, so a fresh object
57
+ * per render is a fresh prop for everything downstream — and the calendar keeps
58
+ * `labels` in a `useMemo` dependency of its own, where a new object per render
59
+ * of the page above meant re-deriving a month's worth of `Intl` names for a
60
+ * table that had not changed a word.
61
+ *
62
+ * `internal/Picker.ts` keys its display samples on `JSON.stringify` for exactly
63
+ * this reason, with the same trade written out there: two objects whose keys are
64
+ * in a different order read as two tables. That costs one extra miss and never a
65
+ * wrong answer.
47
66
  */
48
67
  export declare function useMPMessages<Name extends keyof MPMessages>(namespace: MPNamespace<Name>, locale: string | undefined, overrides?: Partial<MPMessages[Name]>): MPMessages[Name];
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import*as e from"react";import{resolveNamespace as t}from"./i18n.js";export const MPLocaleContext=/*@__PURE__*/e.createContext(void 0);export function useMPLocale(t){const o=e.useContext(MPLocaleContext);return t??o}export function useMPMessages(o,n,r){return e.useMemo(()=>{const e=t(o,n);return r?{...e,...r}:e},[o,n,r])}
2
+ import*as t from"react";import{resolveNamespace as e}from"./i18n.js";export const MPLocaleContext=/*@__PURE__*/t.createContext(void 0);export function useMPLocale(e){const o=t.useContext(MPLocaleContext);return e??o}export function useMPMessages(o,n,r){const s=void 0===r?"":JSON.stringify(r);return t.useMemo(()=>{const t=e(o,n);return r?{...t,...r}:t},[o,n,s])}
@@ -0,0 +1,3 @@
1
+ import type { MPNamespace } from '../i18n.js';
2
+ /** `MPBreadcrumb`'s two names — see `MPMessages['breadcrumb']`. */
3
+ export declare const BREADCRUMB: MPNamespace<'breadcrumb'>;
@@ -0,0 +1 @@
1
+ export const BREADCRUMB={name:"breadcrumb",en:{label:"Breadcrumb",expand:"Show hidden steps"}};
@@ -0,0 +1,3 @@
1
+ import type { MPNamespace } from '../i18n.js';
2
+ /** `MPCarousel`'s own names — see `MPMessages['carousel']`. */
3
+ export declare const CAROUSEL: MPNamespace<'carousel'>;
@@ -0,0 +1 @@
1
+ export const CAROUSEL={name:"carousel",en:{label:"Carousel",previous:"Previous slide",next:"Next slide",slide:"Slide {index} of {total}"}};
@@ -0,0 +1,3 @@
1
+ import type { MPNamespace } from '../i18n.js';
2
+ /** The names for the parts of the picker that have no text on them. */
3
+ export declare const COLOR_PICKER: MPNamespace<'colorPicker'>;
@@ -0,0 +1 @@
1
+ export const COLOR_PICKER={name:"colorPicker",en:{area:"Saturation and brightness",hue:"Hue",alpha:"Opacity",value:"Colour value",swatches:"Swatches",clear:"Clear",empty:"No colour"}};
@@ -0,0 +1,3 @@
1
+ import type { MPNamespace } from '../i18n.js';
2
+ /** `MPCombobox`'s two drawn lines — see `MPMessages['combobox']`. */
3
+ export declare const COMBOBOX: MPNamespace<'combobox'>;
@@ -0,0 +1 @@
1
+ export const COMBOBOX={name:"combobox",en:{empty:"No matches",add:"Add “{label}”"}};
@@ -0,0 +1,3 @@
1
+ import type { MPNamespace } from '../i18n.js';
2
+ /** `MPCommandPalette`'s three strings — see `MPMessages['command']`. */
3
+ export declare const COMMAND: MPNamespace<'command'>;
@@ -0,0 +1 @@
1
+ export const COMMAND={name:"command",en:{label:"Command palette",search:"Type a command or search…",empty:"No commands found"}};
@@ -0,0 +1,3 @@
1
+ import type { MPNamespace } from '../i18n.js';
2
+ /** `MPFilePicker`'s prompt — see `MPMessages['filePicker']`. */
3
+ export declare const FILE_PICKER: MPNamespace<'filePicker'>;
@@ -0,0 +1 @@
1
+ export const FILE_PICKER={name:"filePicker",en:{prompt:"Drop files here, or click to browse"}};
@@ -0,0 +1,3 @@
1
+ import type { MPNamespace } from '../i18n.js';
2
+ /** The words a page's skeleton says on its own behalf — see `MPMessages['layout']`. */
3
+ export declare const LAYOUT: MPNamespace<'layout'>;
@@ -0,0 +1 @@
1
+ export const LAYOUT={name:"layout",en:{skipToContent:"Skip to content",sidebar:"Sidebar",openSidebar:"Open sidebar",closeSidebar:"Close sidebar",resizeSidebar:"Resize sidebar"}};
@@ -0,0 +1,3 @@
1
+ import type { MPNamespace } from '../i18n.js';
2
+ /** `MPNumberField`'s two steppers — see `MPMessages['numberField']`. */
3
+ export declare const NUMBER_FIELD: MPNamespace<'numberField'>;
@@ -0,0 +1 @@
1
+ export const NUMBER_FIELD={name:"numberField",en:{increase:"Increase",decrease:"Decrease"}};
@@ -0,0 +1,3 @@
1
+ import type { MPNamespace } from '../i18n.js';
2
+ /** `MPOverlay`'s own name — see `MPMessages['overlay']`. */
3
+ export declare const OVERLAY: MPNamespace<'overlay'>;
@@ -0,0 +1 @@
1
+ export const OVERLAY={name:"overlay",en:{label:"Overlay"}};
@@ -0,0 +1,3 @@
1
+ import type { MPNamespace } from '../i18n.js';
2
+ /** `MPTable`'s empty row — see `MPMessages['table']`. */
3
+ export declare const TABLE: MPNamespace<'table'>;
@@ -0,0 +1 @@
1
+ export const TABLE={name:"table",en:{empty:"No data"}};
@@ -0,0 +1,3 @@
1
+ import type { MPNamespace } from '../i18n.js';
2
+ /** `MPTextLink`'s spoken warning — see `MPMessages['textLink']`. */
3
+ export declare const TEXT_LINK: MPNamespace<'textLink'>;
@@ -0,0 +1 @@
1
+ export const TEXT_LINK={name:"textLink",en:{newTab:"Opens in a new tab"}};
@@ -0,0 +1,3 @@
1
+ import type { MPNamespace } from '../i18n.js';
2
+ /** `MPTransfer`'s two headings and its arrows — see `MPMessages['transfer']`. */
3
+ export declare const TRANSFER: MPNamespace<'transfer'>;
@@ -0,0 +1 @@
1
+ export const TRANSFER={name:"transfer",en:{source:"Available",target:"Selected",toTarget:"Move to selected",toSource:"Move to available",search:"Search",empty:"Nothing here"}};