@12-apps/ui 6.23.0 → 6.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. package/NATIVE.md +2 -1
  2. package/dist/_internal/components/data-display/Avatar/Avatar.js +3 -3
  3. package/dist/_internal/components/data-display/Avatar/Avatar.view.js +2 -2
  4. package/dist/_internal/components/data-display/Badge/Badge.js +2 -2
  5. package/dist/_internal/components/data-display/Chart/Chart.js +3 -3
  6. package/dist/_internal/components/data-display/Chart/SpecChart.js +6 -6
  7. package/dist/_internal/components/data-display/Chart/chart-renderers.js +2 -2
  8. package/dist/_internal/components/data-display/Chart/chart-spec.js +2 -2
  9. package/dist/_internal/components/data-display/Chip/Chip.js +3 -3
  10. package/dist/_internal/components/data-display/Chip/Chip.styles.js +2 -2
  11. package/dist/_internal/components/data-display/DataGrid/DataGrid.js +2 -2
  12. package/dist/_internal/components/data-display/DataViews/DataViewsGrid.js +24 -24
  13. package/dist/_internal/components/data-display/DataViews/DataViewsTableBase.js +30 -30
  14. package/dist/_internal/components/data-display/DataViews/base-list-card-geometry.js +4 -4
  15. package/dist/_internal/components/data-display/DataViews/base-list-card-slots.js +3 -3
  16. package/dist/_internal/components/data-display/DataViews/base-list-card.js +6 -6
  17. package/dist/_internal/components/data-display/DataViews/data-views-display-panel.js +3 -3
  18. package/dist/_internal/components/data-display/DataViews/data-views-filter-panel.js +4 -4
  19. package/dist/_internal/components/data-display/DataViews/data-views-grid-bodies.js +6 -6
  20. package/dist/_internal/components/data-display/DataViews/data-views-grid-parts.js +21 -21
  21. package/dist/_internal/components/data-display/DataViews/data-views-inline-bar.js +6 -6
  22. package/dist/_internal/components/data-display/DataViews/data-views-more-fields.js +4 -4
  23. package/dist/_internal/components/data-display/DataViews/data-views-more-filters.js +5 -5
  24. package/dist/_internal/components/data-display/DataViews/data-views-range-pill.js +3 -3
  25. package/dist/_internal/components/data-display/DataViews/data-views-scope-tabs.js +2 -2
  26. package/dist/_internal/components/data-display/DataViews/data-views-shell-toolbar.js +6 -6
  27. package/dist/_internal/components/data-display/DataViews/data-views-table-parts.js +2 -2
  28. package/dist/_internal/components/data-display/DataViews/data-views-toolbar.js +5 -5
  29. package/dist/_internal/components/data-display/DataViews/list-card-rails.js +2 -2
  30. package/dist/_internal/components/data-display/DataViews/use-data-views-state.js +2 -2
  31. package/dist/_internal/components/data-display/FleetMap/FleetBody.js +4 -3
  32. package/dist/_internal/components/data-display/FleetMap/FleetMap.base.js +1 -0
  33. package/dist/_internal/components/data-display/FleetMap/FleetMap.base.js.map +1 -0
  34. package/dist/_internal/components/data-display/FleetMap/FleetMap.helpers.js +1 -1
  35. package/dist/_internal/components/data-display/FleetMap/FleetMap.hooks.js +2 -2
  36. package/dist/_internal/components/data-display/FleetMap/FleetMap.js +6 -5
  37. package/dist/_internal/components/data-display/FleetMap/FleetMap.metrics.js +20 -0
  38. package/dist/_internal/components/data-display/FleetMap/FleetMap.metrics.js.map +1 -0
  39. package/dist/_internal/components/data-display/FleetMap/FleetRoster.js +3 -2
  40. package/dist/_internal/components/data-display/index.js +26 -25
  41. package/dist/_internal/components/index.js +26 -25
  42. package/dist/_internal/platform/aria.js.map +1 -1
  43. package/dist/_internal/user-avatar/user-avatar.js +4 -4
  44. package/dist/charts.js +10 -10
  45. package/dist/{chunk-WGRS4PGY.js → chunk-2C47DEVU.js} +4 -4
  46. package/dist/{chunk-KHWCX4LI.js → chunk-6LGWJFQK.js} +2 -2
  47. package/dist/{chunk-XSF6AXEU.js → chunk-6RZDDUSM.js} +2 -2
  48. package/dist/{chunk-L4U23SBX.js → chunk-B7DKSBAE.js} +13 -13
  49. package/dist/{chunk-3FLVIVOK.js → chunk-BHIGHSXA.js} +2 -2
  50. package/dist/chunk-BTQZ3EX3.js +45 -0
  51. package/dist/chunk-BTQZ3EX3.js.map +1 -0
  52. package/dist/{chunk-ACFGEZ4Q.js → chunk-C6KTQF4F.js} +3 -3
  53. package/dist/{chunk-LYSSO6WC.js → chunk-CZPU5TW3.js} +4 -4
  54. package/dist/{chunk-BZTFPSWT.js → chunk-DFLTUI7W.js} +7 -7
  55. package/dist/{chunk-URXT5TOY.js → chunk-E46PG577.js} +4 -4
  56. package/dist/{chunk-4XZXLB4I.js → chunk-EMUBMZMA.js} +3 -3
  57. package/dist/{chunk-DRHIIUDO.js → chunk-FPWB5ILF.js} +5 -5
  58. package/dist/{chunk-R6SBP5M5.js → chunk-GOWBYHYW.js} +4 -4
  59. package/dist/{chunk-MQNKRIGC.js → chunk-HMV4QMXS.js} +25 -11
  60. package/dist/chunk-HMV4QMXS.js.map +1 -0
  61. package/dist/{chunk-N2TUX4A5.js → chunk-I3E2QHTH.js} +3 -3
  62. package/dist/{chunk-I7HYGIEJ.js → chunk-JUHUKZGU.js} +2 -2
  63. package/dist/{chunk-TWQYDKCA.js → chunk-JZXWCEH5.js} +12 -9
  64. package/dist/chunk-JZXWCEH5.js.map +1 -0
  65. package/dist/{chunk-WQA4LIIK.js → chunk-KT6HWAEN.js} +4 -4
  66. package/dist/{chunk-2UGJIKVA.js → chunk-MZQTHSLN.js} +3 -3
  67. package/dist/{chunk-4SQFO4GW.js → chunk-NA7MIEG6.js} +7 -7
  68. package/dist/{chunk-MYGNIFZC.js → chunk-O4VCZTK4.js} +2 -2
  69. package/dist/{chunk-LS4FMSHY.js → chunk-OAYX4XN7.js} +4 -4
  70. package/dist/{chunk-Y5UCOBQN.js → chunk-OGGHD64H.js} +4 -4
  71. package/dist/{chunk-CBTY36TU.js → chunk-OH3YGJT5.js} +2 -2
  72. package/dist/{chunk-VNNG46TS.js → chunk-ORSLFKKZ.js} +6 -6
  73. package/dist/{chunk-VON4BFK4.js → chunk-PN5CQKA2.js} +2 -2
  74. package/dist/{chunk-CF3FAAPC.js → chunk-RP5FK3SO.js} +2 -2
  75. package/dist/{chunk-X5MPHXG5.js → chunk-RPWEXIAW.js} +6 -6
  76. package/dist/{chunk-YQ6TNHAC.js → chunk-TTLI6PF7.js} +5 -5
  77. package/dist/{chunk-OIKQO73C.js → chunk-TX5V42AY.js} +5 -5
  78. package/dist/{chunk-AJGYHDA5.js → chunk-U2YJCNRU.js} +4 -4
  79. package/dist/{chunk-W7Y6RA6W.js → chunk-WR5JFDQ5.js} +4 -4
  80. package/dist/{chunk-5V4UPOWK.js → chunk-XPMGFAJ3.js} +1 -1
  81. package/dist/chunk-XPMGFAJ3.js.map +1 -0
  82. package/dist/{chunk-AEGXHZQT.js → chunk-YW5T6KZ5.js} +7 -7
  83. package/dist/{chunk-F7VBGS4C.js → chunk-ZCPSND5Y.js} +2 -2
  84. package/dist/chunk-ZCPSND5Y.js.map +1 -0
  85. package/dist/{chunk-4LRFGB3K.js → chunk-ZRPGVHTR.js} +2 -2
  86. package/dist/data-display/Avatar.js +3 -3
  87. package/dist/data-display/Badge.js +2 -2
  88. package/dist/data-display/CardKit.js +10 -10
  89. package/dist/data-display/Chart.js +10 -10
  90. package/dist/data-display/Chip.js +3 -3
  91. package/dist/data-display/DataGrid.js +2 -2
  92. package/dist/data-display/DataViews.js +48 -48
  93. package/dist/data-display/FleetMap.js +6 -5
  94. package/dist/native/chunks/{chunk-T6BJPP3E.js → chunk-DN73KYIZ.js} +1 -1
  95. package/dist/native/chunks/chunk-DN73KYIZ.js.map +1 -0
  96. package/dist/native/chunks/chunk-GW7TQ7HO.js +215 -0
  97. package/dist/native/chunks/chunk-GW7TQ7HO.js.map +1 -0
  98. package/dist/native/chunks/chunk-MJVSQXOD.js +9 -0
  99. package/dist/native/chunks/chunk-MJVSQXOD.js.map +1 -0
  100. package/dist/native/chunks/chunk-ZAQ3AZJM.js +292 -0
  101. package/dist/native/chunks/chunk-ZAQ3AZJM.js.map +1 -0
  102. package/dist/native/data-display/Alert.js +4 -4
  103. package/dist/native/data-display/Avatar.js +3 -3
  104. package/dist/native/data-display/Badge.js +4 -4
  105. package/dist/native/data-display/Chip.js +3 -5
  106. package/dist/native/data-display/Chip.js.map +1 -1
  107. package/dist/native/data-display/EmptyState.js +9 -286
  108. package/dist/native/data-display/EmptyState.js.map +1 -1
  109. package/dist/native/data-display/ErrorState.js +6 -6
  110. package/dist/native/data-display/FleetMap.js +498 -0
  111. package/dist/native/data-display/FleetMap.js.map +1 -0
  112. package/dist/native/data-display/LoadingState.js +3 -3
  113. package/dist/native/feedback/Dialog.js +3 -3
  114. package/dist/native/form/Checkbox.js +1 -1
  115. package/dist/native/form/Input.js +1 -1
  116. package/dist/native/form/Select.js +1 -1
  117. package/dist/native/form/Switch.js +1 -1
  118. package/dist/native/layout/Card.js +3 -3
  119. package/dist/native/layout/Skeleton.js +6 -209
  120. package/dist/native/layout/Skeleton.js.map +1 -1
  121. package/dist/types/components/data-display/FleetMap/FleetMap.base.d.ts +141 -0
  122. package/dist/types/components/data-display/FleetMap/FleetMap.base.d.ts.map +1 -0
  123. package/dist/types/components/data-display/FleetMap/FleetMap.d.ts.map +1 -1
  124. package/dist/types/components/data-display/FleetMap/FleetMap.helpers.d.ts +1 -1
  125. package/dist/types/components/data-display/FleetMap/FleetMap.helpers.d.ts.map +1 -1
  126. package/dist/types/components/data-display/FleetMap/FleetMap.hooks.d.ts +20 -3
  127. package/dist/types/components/data-display/FleetMap/FleetMap.hooks.d.ts.map +1 -1
  128. package/dist/types/components/data-display/FleetMap/FleetMap.metrics.d.ts +76 -0
  129. package/dist/types/components/data-display/FleetMap/FleetMap.metrics.d.ts.map +1 -0
  130. package/dist/types/components/data-display/FleetMap/FleetMap.types.d.ts +13 -113
  131. package/dist/types/components/data-display/FleetMap/FleetMap.types.d.ts.map +1 -1
  132. package/dist/types/components/data-display/FleetMap/FleetRoster.d.ts.map +1 -1
  133. package/dist/types/platform/aria.d.ts +13 -0
  134. package/dist/types/platform/aria.d.ts.map +1 -1
  135. package/dist/types-native/components/data-display/FleetMap/FleetMap.base.d.ts +141 -0
  136. package/dist/types-native/components/data-display/FleetMap/FleetMap.base.d.ts.map +1 -0
  137. package/dist/types-native/components/data-display/FleetMap/FleetMap.helpers.d.ts +45 -0
  138. package/dist/types-native/components/data-display/FleetMap/FleetMap.helpers.d.ts.map +1 -0
  139. package/dist/types-native/components/data-display/FleetMap/FleetMap.hooks.d.ts +71 -0
  140. package/dist/types-native/components/data-display/FleetMap/FleetMap.hooks.d.ts.map +1 -0
  141. package/dist/types-native/components/data-display/FleetMap/FleetMap.metrics.d.ts +76 -0
  142. package/dist/types-native/components/data-display/FleetMap/FleetMap.metrics.d.ts.map +1 -0
  143. package/dist/types-native/components/data-display/FleetMap/FleetMap.native.d.ts +30 -0
  144. package/dist/types-native/components/data-display/FleetMap/FleetMap.native.d.ts.map +1 -0
  145. package/dist/types-native/components/data-display/FleetMap/FleetMap.types.native.d.ts +36 -0
  146. package/dist/types-native/components/data-display/FleetMap/FleetMap.types.native.d.ts.map +1 -0
  147. package/dist/types-native/components/data-display/FleetMap/FleetRoster.native.d.ts +17 -0
  148. package/dist/types-native/components/data-display/FleetMap/FleetRoster.native.d.ts.map +1 -0
  149. package/dist/types-native/components/data-display/FleetMap/index.native.d.ts +4 -0
  150. package/dist/types-native/components/data-display/FleetMap/index.native.d.ts.map +1 -0
  151. package/dist/types-native/platform/aria.d.ts +13 -0
  152. package/dist/types-native/platform/aria.d.ts.map +1 -1
  153. package/dist/user-avatar.js +4 -4
  154. package/package.json +5 -1
  155. package/src/components/data-display/FleetMap/FleetMap.base.ts +144 -0
  156. package/src/components/data-display/FleetMap/FleetMap.helpers.ts +1 -1
  157. package/src/components/data-display/FleetMap/FleetMap.hooks.ts +23 -4
  158. package/src/components/data-display/FleetMap/FleetMap.md +15 -8
  159. package/src/components/data-display/FleetMap/FleetMap.metrics.ts +81 -0
  160. package/src/components/data-display/FleetMap/FleetMap.native.tsx +185 -0
  161. package/src/components/data-display/FleetMap/FleetMap.tsx +8 -14
  162. package/src/components/data-display/FleetMap/FleetMap.types.native.ts +44 -0
  163. package/src/components/data-display/FleetMap/FleetMap.types.ts +19 -114
  164. package/src/components/data-display/FleetMap/FleetRoster.native.tsx +382 -0
  165. package/src/components/data-display/FleetMap/FleetRoster.tsx +17 -11
  166. package/src/components/data-display/FleetMap/NATIVE-NOTES.md +14 -0
  167. package/src/components/data-display/FleetMap/index.native.ts +10 -0
  168. package/src/components/data-display/FleetMap/tests.md +6 -1
  169. package/src/platform/aria.ts +13 -0
  170. package/dist/chunk-5V4UPOWK.js.map +0 -1
  171. package/dist/chunk-F7VBGS4C.js.map +0 -1
  172. package/dist/chunk-MQNKRIGC.js.map +0 -1
  173. package/dist/chunk-TWQYDKCA.js.map +0 -1
  174. package/dist/native/chunks/chunk-T6BJPP3E.js.map +0 -1
  175. /package/dist/{chunk-WGRS4PGY.js.map → chunk-2C47DEVU.js.map} +0 -0
  176. /package/dist/{chunk-KHWCX4LI.js.map → chunk-6LGWJFQK.js.map} +0 -0
  177. /package/dist/{chunk-XSF6AXEU.js.map → chunk-6RZDDUSM.js.map} +0 -0
  178. /package/dist/{chunk-L4U23SBX.js.map → chunk-B7DKSBAE.js.map} +0 -0
  179. /package/dist/{chunk-3FLVIVOK.js.map → chunk-BHIGHSXA.js.map} +0 -0
  180. /package/dist/{chunk-ACFGEZ4Q.js.map → chunk-C6KTQF4F.js.map} +0 -0
  181. /package/dist/{chunk-LYSSO6WC.js.map → chunk-CZPU5TW3.js.map} +0 -0
  182. /package/dist/{chunk-BZTFPSWT.js.map → chunk-DFLTUI7W.js.map} +0 -0
  183. /package/dist/{chunk-URXT5TOY.js.map → chunk-E46PG577.js.map} +0 -0
  184. /package/dist/{chunk-4XZXLB4I.js.map → chunk-EMUBMZMA.js.map} +0 -0
  185. /package/dist/{chunk-DRHIIUDO.js.map → chunk-FPWB5ILF.js.map} +0 -0
  186. /package/dist/{chunk-R6SBP5M5.js.map → chunk-GOWBYHYW.js.map} +0 -0
  187. /package/dist/{chunk-N2TUX4A5.js.map → chunk-I3E2QHTH.js.map} +0 -0
  188. /package/dist/{chunk-I7HYGIEJ.js.map → chunk-JUHUKZGU.js.map} +0 -0
  189. /package/dist/{chunk-WQA4LIIK.js.map → chunk-KT6HWAEN.js.map} +0 -0
  190. /package/dist/{chunk-2UGJIKVA.js.map → chunk-MZQTHSLN.js.map} +0 -0
  191. /package/dist/{chunk-4SQFO4GW.js.map → chunk-NA7MIEG6.js.map} +0 -0
  192. /package/dist/{chunk-MYGNIFZC.js.map → chunk-O4VCZTK4.js.map} +0 -0
  193. /package/dist/{chunk-LS4FMSHY.js.map → chunk-OAYX4XN7.js.map} +0 -0
  194. /package/dist/{chunk-Y5UCOBQN.js.map → chunk-OGGHD64H.js.map} +0 -0
  195. /package/dist/{chunk-CBTY36TU.js.map → chunk-OH3YGJT5.js.map} +0 -0
  196. /package/dist/{chunk-VNNG46TS.js.map → chunk-ORSLFKKZ.js.map} +0 -0
  197. /package/dist/{chunk-VON4BFK4.js.map → chunk-PN5CQKA2.js.map} +0 -0
  198. /package/dist/{chunk-CF3FAAPC.js.map → chunk-RP5FK3SO.js.map} +0 -0
  199. /package/dist/{chunk-X5MPHXG5.js.map → chunk-RPWEXIAW.js.map} +0 -0
  200. /package/dist/{chunk-YQ6TNHAC.js.map → chunk-TTLI6PF7.js.map} +0 -0
  201. /package/dist/{chunk-OIKQO73C.js.map → chunk-TX5V42AY.js.map} +0 -0
  202. /package/dist/{chunk-AJGYHDA5.js.map → chunk-U2YJCNRU.js.map} +0 -0
  203. /package/dist/{chunk-W7Y6RA6W.js.map → chunk-WR5JFDQ5.js.map} +0 -0
  204. /package/dist/{chunk-AEGXHZQT.js.map → chunk-YW5T6KZ5.js.map} +0 -0
  205. /package/dist/{chunk-4LRFGB3K.js.map → chunk-ZRPGVHTR.js.map} +0 -0
@@ -1,67 +1,22 @@
1
1
  import type { MapPreviewCopy } from '../../../copy';
2
+ import type { FleetMapBaseProps, FleetMapCopyBase } from './FleetMap.base';
2
3
  /**
3
- * One tracked unit's newest position, as the caller resolved it.
4
+ * The WEB half of `FleetMap`'s contract.
4
5
  *
5
- * Deliberately says nothing about WHAT is being tracked. A courier, a service
6
- * van, a field engineer — the component draws a labelled dot with a freshness,
7
- * and every word that names the domain arrives through {@link FleetMapCopy}.
6
+ * Everything platform-neutral lives in `FleetMap.base.ts` and is re-exported
7
+ * here unchanged, so a consumer's `import type { FleetUnit } from
8
+ * '@12-apps/ui/data-display/FleetMap'` keeps resolving exactly as it did. What
9
+ * this file adds is what only the web has: the map.
8
10
  */
9
- export interface FleetUnit {
10
- id: string;
11
- /** The name a human reads, on the pin and in the roster. */
12
- label: string;
13
- latitude: number;
14
- longitude: number;
15
- /**
16
- * The fix's accuracy radius in metres, when the platform reported one.
17
- *
18
- * Kept because it is what separates a rooftop GPS fix from a cell-tower guess
19
- * three blocks wide, and a map that draws both identically tells its reader
20
- * something false.
21
- */
22
- accuracyM?: number | null;
23
- /**
24
- * Seconds since the fix was ACCEPTED, on the server's clock.
25
- *
26
- * The caller computes it, and the distinction matters: a device whose own
27
- * clock is an hour slow would otherwise report itself as an hour stale while
28
- * reporting perfectly.
29
- */
30
- staleSeconds: number;
31
- /** A short pre-formatted badge beside the name, e.g. `"2 entregas"`. */
32
- badge?: string;
33
- }
34
- /** How current a unit's newest fix is, derived from the thresholds below. */
35
- export type FleetFreshness = 'live' | 'lagging' | 'stale';
11
+ export type { FleetFreshness, FleetMapBaseProps, FleetMapCopyBase, FleetUnit, } from './FleetMap.base';
36
12
  /**
37
- * Every word the board prints, and the two it FORMATS.
13
+ * Every word the board prints, plus the map control bar's own six.
38
14
  *
39
- * `lastSeen` and `accuracy` are functions rather than strings because a
40
- * duration and a distance are locale rules, and this package holds the same
41
- * line `StatCard` does: presentation only, the caller owns the formatting. A
42
- * `lastSeenMinutes: string` template would have made "há 2 min" the only
43
- * shape any consumer could ever render.
15
+ * `map` is web-only because the map half is: `MapPreview` has no React Native
16
+ * build yet, so the native copy interface stops at the roster's words rather
17
+ * than asking a caller to name controls nothing renders. See `NATIVE-NOTES.md`.
44
18
  */
45
- export interface FleetMapCopy {
46
- /** The panel's heading. */
47
- title: string;
48
- /** What the roster says when nobody is reporting. */
49
- emptyTitle: string;
50
- emptyDescription?: string;
51
- /** The roster list's accessible name — it is the map's readable half. */
52
- rosterLabel: string;
53
- /**
54
- * What a screen reader hears while the roster reloads, e.g. "Atualizando a
55
- * frota". OPTIONAL, and silence is the honest default: `aria-busy` marks the
56
- * region stale without uttering anything, the skeletons are `aria-hidden`,
57
- * and this component cannot invent the sentence in the reader's language.
58
- * Set it and the panel announces politely; leave it and it stays quiet.
59
- *
60
- * Announced on a TRANSITION into loading. A board mounted already loading is
61
- * silent — as any live region is at mount, since there is no change for a
62
- * reader to observe.
63
- */
64
- loading?: string;
19
+ export interface FleetMapCopy extends FleetMapCopyBase {
65
20
  /**
66
21
  * The map region's accessible name.
67
22
  *
@@ -77,69 +32,14 @@ export interface FleetMapCopy {
77
32
  * re-centre. See `FleetCanvas` for why that is stated rather than fixed here.
78
33
  */
79
34
  mapLabel: string;
80
- /** The three freshness words, as a reader sees them on a row. */
81
- freshness: Record<FleetFreshness, string>;
82
- /** `(seconds) => "há 2 min"`. */
83
- lastSeen: (staleSeconds: number) => string;
84
- /** `(metres) => "±12 m"`. A unit with no accuracy renders none. */
85
- accuracy: (metres: number) => string;
86
35
  /** The map control bar's own six names. */
87
36
  map: MapPreviewCopy;
88
37
  }
89
38
  /** Props for the {@link FleetMap} live board. */
90
- export interface FleetMapProps {
91
- /** Everyone currently reporting. An empty array renders the empty state. */
92
- units: readonly FleetUnit[];
39
+ export interface FleetMapProps extends FleetMapBaseProps {
93
40
  copy: FleetMapCopy;
94
- /**
95
- * Which unit is highlighted: the map centres on it and the roster marks it
96
- * selected. `null` selects nobody and centres on the whole fleet.
97
- *
98
- * PASSING IT AT ALL IS THE DECISION. Present on the first render — `null`
99
- * included — and the board is controlled for life: it renders what you pass
100
- * and never moves the selection itself. Absent on the first render and it
101
- * keeps its own, reporting each change through {@link onSelect}. The mode is
102
- * latched on that first render, the way React latches an `<input>`, so the
103
- * component cannot change its own semantics halfway through a session.
104
- *
105
- * A controlled board reads `undefined` as "nobody is selected", so
106
- * `useState<string>()` in the caller behaves: clearing it clears the roster.
107
- */
108
- selectedId?: string | null;
109
- /**
110
- * A click on a row or a pin, and each arrow-key move. Fires in both modes, so
111
- * an uncontrolled board can still be observed.
112
- *
113
- * Passing {@link selectedId} WITHOUT this is a selection nothing can move:
114
- * the arrow keys then decline to act and leave the page to scroll, rather
115
- * than swallowing a keypress that would do nothing.
116
- */
117
- onSelect?: (id: string) => void;
118
- /**
119
- * Seconds after which a unit stops reading as `live`, and then as `lagging`.
120
- *
121
- * Both carry a GENERIC default (90s and 300s, sized for a phone reporting
122
- * every twenty seconds) and no domain one, because the answer is entirely a
123
- * property of the fleet's own ping cadence: a phone reporting every twenty
124
- * seconds is late at ninety, and a tracker reporting every five minutes is
125
- * not. A component that picked one would be picking it for every consumer.
126
- */
127
- laggingAfterSeconds?: number;
128
- staleAfterSeconds?: number;
129
41
  /** Map height, any CSS length. */
130
42
  height?: string;
131
- /**
132
- * While true the map and roster are marked `aria-busy`, and the roster renders
133
- * skeletons IF no units have landed yet — a poll over a populated roster keeps
134
- * the list, because unmounting it throws away the focus inside it.
135
- *
136
- * It only ANNOUNCES if {@link FleetMapCopy.loading} is set — `aria-busy` is a
137
- * state, not an utterance. The panel root is deliberately not the busy
138
- * element, so that announcement sits outside the busy subtree.
139
- */
140
- loading?: boolean;
141
43
  className?: string;
142
- /** Test id for the panel root; every child id is derived from it. */
143
- dataTestId?: string;
144
44
  }
145
45
  //# sourceMappingURL=FleetMap.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FleetMap.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/FleetMap/FleetMap.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD;;;;;;GAMG;AACH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,4DAA4D;IAC5D,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE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C,EAAE,MAAM,CAAC;IAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
1
+ {"version":3,"file":"FleetMap.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/FleetMap/FleetMap.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAE3E;;;;;;;GAOG;AACH,YAAY,EACV,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,SAAS,GACV,MAAM,iBAAiB,CAAC;AAEzB;;;;;;GAMG;AACH,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACpD;;;;;;;;;;;;;OAaG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,GAAG,EAAE,cAAc,CAAC;CACrB;AAED,iDAAiD;AACjD,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD,IAAI,EAAE,YAAY,CAAC;IACnB,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"FleetRoster.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/FleetMap/FleetRoster.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAkB,YAAY,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAsOhF,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,SAAS,SAAS,EAAE,CAAC;I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AAW,CAAC,EAC1B,KAAK,EACL,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,mBAAmB,EACnB,iBAAiB,EACjB,OAAO,EACP,MAAM,EACN,SAAS,GACV,EAAE,gBAAgB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA2DtC"}
@@ -27,6 +27,19 @@ export interface WebAria {
27
27
  * it expands is a listbox — which is what the web's own trigger carries.
28
28
  */
29
29
  'aria-haspopup'?: 'listbox' | 'menu' | 'dialog' | 'true';
30
+ /**
31
+ * Which option a composite widget's single tab stop is currently on — the
32
+ * listbox pattern, where the LIST holds focus and the selection moves inside
33
+ * it. React Native has no equivalent because it has no roving focus to
34
+ * describe: a device selects by touching the row.
35
+ *
36
+ * Note the interaction with `aria-atomic` documented on {@link webAria}:
37
+ * react-native-web reads THIS value when it means the atomic flag, so a
38
+ * component that sets both gets the descendant id emitted as `aria-atomic`.
39
+ * Nothing here sets both, and a component that needs to should pass its own
40
+ * atomic flag directly rather than through this helper.
41
+ */
42
+ 'aria-activedescendant'?: string;
30
43
  }
31
44
  /**
32
45
  * `attrs` as something JSX can spread onto a react-native element without
@@ -1 +1 @@
1
- {"version":3,"file":"aria.d.ts","sourceRoot":"","sources":["../../../src/platform/aria.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,WAAW,OAAO;IACtB,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACrC,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACjC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,eAAe,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;CAC1D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB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AQ,EAAE,OAAO,GAAG,MAAM,CAErD;AAED;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC,GAAG,SAAS,GAAG,MAAM,CAE7E;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED,+EAA+E;AAC/E,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,GAAG,MAAM,CAExE"}
@@ -0,0 +1,141 @@
1
+ /**
2
+ * THE CONTRACT BOTH `FleetMap` RENDERERS HONOUR — and nothing else.
3
+ *
4
+ * This file imports no MUI and no react-native, on purpose: it ships in BOTH
5
+ * declaration outputs (`dist/types` and `dist/types-native`), and a native
6
+ * consumer has no `@mui/material` to resolve a type import against.
7
+ *
8
+ * What is NOT here is as deliberate as what is. `map` (the map control bar's
9
+ * six words) lives on the web copy alone, because the map half is web-only
10
+ * until `MapPreview` is ported — see `NATIVE-NOTES.md`. A native caller that
11
+ * had to supply words for a bar no renderer draws would be asked to describe
12
+ * something it cannot see.
13
+ */
14
+ /**
15
+ * One tracked unit's newest position, as the caller resolved it.
16
+ *
17
+ * Deliberately says nothing about WHAT is being tracked. A courier, a service
18
+ * van, a field engineer — the component draws a labelled dot with a freshness,
19
+ * and every word that names the domain arrives through the copy object.
20
+ */
21
+ export interface FleetUnit {
22
+ id: string;
23
+ /** The name a human reads, on the pin and in the roster. */
24
+ label: string;
25
+ latitude: number;
26
+ longitude: number;
27
+ /**
28
+ * The fix's accuracy radius in metres, when the platform reported one.
29
+ *
30
+ * Kept because it is what separates a rooftop GPS fix from a cell-tower guess
31
+ * three blocks wide, and a map that draws both identically tells its reader
32
+ * something false.
33
+ */
34
+ accuracyM?: number | null;
35
+ /**
36
+ * Seconds since the fix was ACCEPTED, on the server's clock.
37
+ *
38
+ * The caller computes it, and the distinction matters: a device whose own
39
+ * clock is an hour slow would otherwise report itself as an hour stale while
40
+ * reporting perfectly.
41
+ */
42
+ staleSeconds: number;
43
+ /** A short pre-formatted badge beside the name, e.g. `"2 entregas"`. */
44
+ badge?: string;
45
+ }
46
+ /** How current a unit's newest fix is, derived from the thresholds below. */
47
+ export type FleetFreshness = 'live' | 'lagging' | 'stale';
48
+ /**
49
+ * Every word the board prints, and the two it FORMATS — minus the map's own.
50
+ *
51
+ * `lastSeen` and `accuracy` are functions rather than strings because a
52
+ * duration and a distance are locale rules, and this package holds the same
53
+ * line `StatCard` does: presentation only, the caller owns the formatting. A
54
+ * `lastSeenMinutes: string` template would have made "há 2 min" the only
55
+ * shape any consumer could ever render.
56
+ */
57
+ export interface FleetMapCopyBase {
58
+ /** The panel's heading. */
59
+ title: string;
60
+ /** What the roster says when nobody is reporting. */
61
+ emptyTitle: string;
62
+ emptyDescription?: string;
63
+ /** The roster list's accessible name — it is the map's readable half. */
64
+ rosterLabel: string;
65
+ /**
66
+ * What a screen reader hears while the roster reloads, e.g. "Atualizando a
67
+ * frota". OPTIONAL, and silence is the honest default: the busy state marks
68
+ * the region stale without uttering anything, the skeletons are hidden from
69
+ * the reader, and this component cannot invent the sentence in the reader's
70
+ * language. Set it and the panel announces politely; leave it and it stays
71
+ * quiet.
72
+ *
73
+ * Announced on a TRANSITION into loading. A board mounted already loading is
74
+ * silent — as any live region is at mount, since there is no change for a
75
+ * reader to observe.
76
+ */
77
+ loading?: string;
78
+ /** The three freshness words, as a reader sees them on a row. */
79
+ freshness: Record<FleetFreshness, string>;
80
+ /** `(seconds) => "há 2 min"`. */
81
+ lastSeen: (staleSeconds: number) => string;
82
+ /** `(metres) => "±12 m"`. A unit with no accuracy renders none. */
83
+ accuracy: (metres: number) => string;
84
+ }
85
+ /**
86
+ * The props both renderers take.
87
+ *
88
+ * `height` and `className` are NOT here: the first is a CSS length the web
89
+ * gives the map, and the second is a DOM class. Each side declares its own
90
+ * layout escape hatch beside its own extras.
91
+ */
92
+ export interface FleetMapBaseProps {
93
+ /** Everyone currently reporting. An empty array renders the empty state. */
94
+ units: readonly FleetUnit[];
95
+ /**
96
+ * Which unit is highlighted: the roster marks it selected, and on the web the
97
+ * map centres on it. `null` selects nobody.
98
+ *
99
+ * PASSING IT AT ALL IS THE DECISION. Present on the first render — `null`
100
+ * included — and the board is controlled for life: it renders what you pass
101
+ * and never moves the selection itself. Absent on the first render and it
102
+ * keeps its own, reporting each change through {@link onSelect}. The mode is
103
+ * latched on that first render, the way React latches an `<input>`, so the
104
+ * component cannot change its own semantics halfway through a session.
105
+ *
106
+ * A controlled board reads `undefined` as "nobody is selected", so
107
+ * `useState<string>()` in the caller behaves: clearing it clears the roster.
108
+ */
109
+ selectedId?: string | null;
110
+ /**
111
+ * A click or press on a row, and each arrow-key move on the web.
112
+ *
113
+ * Passing {@link selectedId} WITHOUT this is a selection nothing can move:
114
+ * the arrow keys then decline to act and leave the page to scroll, rather
115
+ * than swallowing a keypress that would do nothing.
116
+ */
117
+ onSelect?: (id: string) => void;
118
+ /**
119
+ * Seconds after which a unit stops reading as `live`, and then as `lagging`.
120
+ *
121
+ * Both carry a GENERIC default (90s and 300s, sized for a phone reporting
122
+ * every twenty seconds) and no domain one, because the answer is entirely a
123
+ * property of the fleet's own ping cadence: a phone reporting every twenty
124
+ * seconds is late at ninety, and a tracker reporting every five minutes is
125
+ * not. A component that picked one would be picking it for every consumer.
126
+ */
127
+ laggingAfterSeconds?: number;
128
+ staleAfterSeconds?: number;
129
+ /**
130
+ * While true the roster is marked busy, and renders skeletons IF no units
131
+ * have landed yet — a poll over a populated roster keeps the list, because
132
+ * unmounting it throws away the focus inside it.
133
+ *
134
+ * It only ANNOUNCES if the copy's `loading` sentence is set: busy is a state,
135
+ * not an utterance.
136
+ */
137
+ loading?: boolean;
138
+ /** Test id for the panel root; every child id is derived from it. */
139
+ dataTestId?: string;
140
+ }
141
+ //# sourceMappingURL=FleetMap.base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FleetMap.base.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/FleetMap/FleetMap.base.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;;;GAMG;AACH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,4DAA4D;IAC5D,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;;;;OAMG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,6EAA6E;AAC7E,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAE1D;;;;;;;;GAQG;AACH,MAAM,WAAW,gBAAgB;IAC/B,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,yEAAyE;IACzE,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iEAAiE;IACjE,SAAS,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;IAC1C,iCAAiC;IACjC,QAAQ,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3C,mEAAmE;IACnE,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;CACtC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC,4EAA4E;IAC5E,KAAK,EAAE,SAAS,SAAS,EAAE,CAAC;IAC5B;;;;;;;;;;;;;OAaG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC;;;;;;;;OAQG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
@@ -0,0 +1,45 @@
1
+ import type { FleetFreshness, FleetUnit } from './FleetMap.base';
2
+ /**
3
+ * How current a fix is, on the two thresholds the caller supplied.
4
+ *
5
+ * Inclusive at both boundaries in the direction that reads better on a screen:
6
+ * a unit exactly at the lagging threshold is already lagging. A boundary has to
7
+ * fall somewhere, and the conservative side is the one that does not tell a
8
+ * dispatcher somebody is live when they are on the edge of not being.
9
+ */
10
+ export declare function freshnessOf(staleSeconds: number, laggingAfterSeconds: number, staleAfterSeconds: number): FleetFreshness;
11
+ /** A latitude/longitude pair, as the map wants its centre. */
12
+ export interface LatLng {
13
+ lat: number;
14
+ lng: number;
15
+ }
16
+ /**
17
+ * Where the map should point.
18
+ *
19
+ * The selected unit when there is one — a dispatcher who clicked a name is
20
+ * asking to look at them. Otherwise the fleet's own centroid, which keeps
21
+ * everybody in frame without the caller having to compute a bounding box.
22
+ *
23
+ * `null` for an empty fleet rather than a coordinate: (0, 0) is a real place in
24
+ * the Atlantic, and a map that quietly sails there is worse than one that says
25
+ * it has nothing to show.
26
+ */
27
+ export declare function mapCentre(units: readonly FleetUnit[], selectedId?: string | null): LatLng | null;
28
+ /**
29
+ * The roster's order: freshest first, then alphabetically.
30
+ *
31
+ * Not the caller's order, deliberately. The one question this panel answers is
32
+ * *who is moving right now*, and a list sorted by anything else buries the
33
+ * answer under whoever happens to sort first. Ties break on the label so the
34
+ * list does not reshuffle between polls when two units share a staleness.
35
+ */
36
+ export declare function rosterOrder(units: readonly FleetUnit[]): FleetUnit[];
37
+ /**
38
+ * Move the selection by one row, wrapping at both ends.
39
+ *
40
+ * Wrapping rather than stopping: this is a short list a dispatcher arrows
41
+ * through repeatedly, and a selection that sticks at the last row makes the
42
+ * keyboard path feel broken next to the mouse one.
43
+ */
44
+ export declare function nextSelection(units: readonly FleetUnit[], currentId: string | null | undefined, step: 1 | -1): string | null;
45
+ //# sourceMappingURL=FleetMap.helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FleetMap.helpers.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/FleetMap/FleetMap.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjE;;;;;;;GAOG;AACH,wBAAgB,WAAW,CACzB,YAAY,EAAE,MAAM,EACpB,mBAAmB,EAAE,MAAM,EAC3B,iBAAiB,EAAE,MAAM,GACxB,cAAc,CAIhB;AAED,8DAA8D;AAC9D,MAAM,WAAW,MAAM;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,GACzB,MAAM,GAAG,IAAI,CASf;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,GAAG,SAAS,EAAE,CAIpE;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,GACX,MAAM,GAAG,IAAI,CAQf"}
@@ -0,0 +1,71 @@
1
+ import { type LatLng } from './FleetMap.helpers';
2
+ import type { FleetUnit } from './FleetMap.base';
3
+ /**
4
+ * The half of a key event this hook reads, spelled structurally.
5
+ *
6
+ * NOT `React.KeyboardEvent<HTMLDivElement>`: the native type program is checked
7
+ * without the DOM lib (`tsconfig.native.json`), so a DOM type here would put
8
+ * the whole hook out of reach of the React Native renderer that shares it. A
9
+ * DOM event satisfies this shape, and a handler taking the wider type is
10
+ * assignable wherever the narrower one is expected — so the web passes its own
11
+ * `onKeyDown` unchanged.
12
+ */
13
+ export interface FleetKeyEvent {
14
+ key: string;
15
+ altKey?: boolean;
16
+ ctrlKey?: boolean;
17
+ metaKey?: boolean;
18
+ shiftKey?: boolean;
19
+ preventDefault: () => void;
20
+ }
21
+ /**
22
+ * Everything the board derives from its props, in one hook.
23
+ *
24
+ * Split out of the component so the component is layout and nothing else.
25
+ *
26
+ * The memos are honest about what they buy, which is less than it looks. `units`
27
+ * arrives as a fresh array on every poll, so `ordered` and `markers` are
28
+ * recomputed on every poll whatever these do — a new array is a new identity.
29
+ * What they buy is stability across the renders a poll does NOT cause: a parent
30
+ * re-render, a selection change (which re-runs `centre` but not `ordered`), a
31
+ * theme flip. Sorting a fleet is cheap either way; this is tidiness, not a
32
+ * measured win, and it should not be read as one.
33
+ *
34
+ * `centre` is the exception, and there it is load-bearing rather than tidy —
35
+ * see {@link useFleetMap}.
36
+ *
37
+ * ## Selection works with, without, or half-way through a handler
38
+ *
39
+ * `selectedId` and `onSelect` are both optional, so all four combinations
40
+ * arrive. Left purely controlled, the two useful ones broke: with neither prop
41
+ * the roster was a listbox that answered nothing, and arrowing it called
42
+ * `preventDefault` before a no-op `select`, so the keys did not move a
43
+ * selection AND did not scroll the page either.
44
+ *
45
+ * So the hook keeps its own selection and defers to `selectedId` only when the
46
+ * caller passes one — the ordinary controlled/uncontrolled split, the same one
47
+ * an `<input>` makes. `onSelect` still fires either way, so a consumer can
48
+ * observe the selection without owning it.
49
+ */
50
+ /** One pin, in the shape `MapPreview` takes. */
51
+ export interface FleetMarker {
52
+ position: LatLng;
53
+ title: string;
54
+ onClick: () => void;
55
+ }
56
+ export interface FleetMapState {
57
+ /** The units, freshest first — see {@link rosterOrder}. */
58
+ ordered: FleetUnit[];
59
+ /**
60
+ * The selection in force — the caller's when they own it, this hook's when
61
+ * they do not. Everything downstream reads THIS and never the raw prop.
62
+ */
63
+ active: string | null;
64
+ /** Where the map points, or `null` when there is nothing to show. */
65
+ centre: LatLng | null;
66
+ select: (id: string) => void;
67
+ markers: FleetMarker[];
68
+ onKeyDown: (event: FleetKeyEvent) => void;
69
+ }
70
+ export declare function useFleetMap(units: readonly FleetUnit[], selectedId: string | null | undefined, onSelect: ((id: string) => void) | undefined): FleetMapState;
71
+ //# sourceMappingURL=FleetMap.hooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FleetMap.hooks.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/FleetMap/FleetMap.hooks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAyC,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACxF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;;;;;;;;GASG;AACH,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,gDAAgD;AAChD,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,2DAA2D;IAC3D,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB;;;OAGG;IACH,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,qEAAqE;IACrE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,SAAS,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;CAC3C;AAiDD,wBAAgB,WAAW,CACzB,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACrC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,GAC3C,aAAa,CAuDf"}
@@ -0,0 +1,76 @@
1
+ /**
2
+ * THE NUMBERS BOTH `FleetMap` RENDERERS DRAW WITH.
3
+ *
4
+ * `FleetRoster.tsx` / `FleetMap.tsx` (web, MUI `sx`) and `FleetRoster.native.tsx`
5
+ * / `FleetMap.native.tsx` (React Native) read this one table. The web hands the
6
+ * spacing UNITS to `theme.spacing()` and the radius MULTIPLES to `sx`; native
7
+ * multiplies the units by the theme's own spacing step and the multiples by
8
+ * `shape.borderRadius`.
9
+ *
10
+ * Nothing here imports a renderer, a theme or a colour: a freshness dot's
11
+ * COLOUR is the theme's (`success.main`, `warning.main`, `text.disabled`), and
12
+ * the two sides reach the same palette through different doors.
13
+ *
14
+ * ## Why the radii are MULTIPLES and never pixels
15
+ *
16
+ * MUI's `sx` reads a bare number for `borderRadius` as a multiple of
17
+ * `theme.shape.borderRadius`, so a value that already had the theme's radius
18
+ * divided out of it is applied twice. Measured: `theme.shape.borderRadius / 4`
19
+ * drew 4px on the default theme — which is why it looked right — and 36px on a
20
+ * host that sets its own radius to 12. In a package whose whole premise is
21
+ * being re-themed, only the multiple is portable, and it is the multiple that
22
+ * both renderers store here.
23
+ */
24
+ /** `theme.spacing(n)` for the panel's own stack. */
25
+ export declare const FLEET_PANEL: {
26
+ /** Between the heading, the status region and the body. */
27
+ readonly gapUnits: 1.5;
28
+ };
29
+ /** The roster list box. */
30
+ export declare const FLEET_ROSTER: {
31
+ /** Between rows. */
32
+ readonly gapUnits: 0.5;
33
+ /** `:focus-visible` ring on the web; a device has no focus ring to draw. */
34
+ readonly focusRingWidth: 2;
35
+ readonly focusRingOffset: 2;
36
+ };
37
+ /** One roster row. */
38
+ export declare const FLEET_ROW: {
39
+ /** Between the dot, the text block and the badge. */
40
+ readonly gapUnits: 1.5;
41
+ /** `theme.spacing(y, x)`. */
42
+ readonly paddingYUnits: 1;
43
+ readonly paddingXUnits: 1.5;
44
+ /** A MULTIPLE of `theme.shape.borderRadius` — see the note above. */
45
+ readonly radiusMultiple: 1;
46
+ };
47
+ /**
48
+ * The freshness dot.
49
+ *
50
+ * A perfect circle, so the radius is half the box on both sides rather than
51
+ * the web's `50%`: React Native resolves a percentage radius against the box
52
+ * it is given, and a square box makes the two spellings agree.
53
+ */
54
+ export declare const FLEET_DOT: {
55
+ readonly size: 10;
56
+ };
57
+ /** What stands in for the roster before any unit has landed. */
58
+ export declare const FLEET_SKELETON: {
59
+ /** Three bars, the height of a row with its padding. */
60
+ readonly rows: 3;
61
+ readonly height: 44;
62
+ /** A MULTIPLE, for the same reason the row's is. */
63
+ readonly radiusMultiple: 1;
64
+ readonly gapUnits: 1;
65
+ };
66
+ /**
67
+ * How long a fix stays `live`, and then `lagging`, when the caller says nothing.
68
+ *
69
+ * Ninety seconds and five minutes: sized for a phone reporting every twenty
70
+ * seconds, which is the densest cadence a battery tolerates all day. They are
71
+ * DEFAULTS and not a rule — a fleet on five-minute trackers passes its own, and
72
+ * the props exist so it can.
73
+ */
74
+ export declare const FLEET_DEFAULT_LAGGING_AFTER_SECONDS = 90;
75
+ export declare const FLEET_DEFAULT_STALE_AFTER_SECONDS = 300;
76
+ //# sourceMappingURL=FleetMap.metrics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FleetMap.metrics.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/FleetMap/FleetMap.metrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,oDAAoD;AACpD,eAAO,MAAM,WAAW;IACtB,2DAA2D;;CAEnD,CAAC;AAEX,2BAA2B;AAC3B,eAAO,MAAM,YAAY;IACvB,oBAAoB;;IAEpB,4EAA4E;;;CAGpE,CAAC;AAEX,sBAAsB;AACtB,eAAO,MAAM,SAAS;IACpB,qDAAqD;;IAErD,6BAA6B;;;IAG7B,qEAAqE;;CAE7D,CAAC;AAEX;;;;;;GAMG;AACH,eAAO,MAAM,SAAS;;CAEZ,CAAC;AAEX,gEAAgE;AAChE,eAAO,MAAM,cAAc;IACzB,wDAAwD;;;IAGxD,oDAAoD;;;CAG5C,CAAC;AAEX;;;;;;;GAOG;AACH,eAAO,MAAM,mCAAmC,KAAK,CAAC;AACtD,eAAO,MAAM,iCAAiC,MAAM,CAAC"}
@@ -0,0 +1,30 @@
1
+ import * as React from 'react';
2
+ import type { FleetMapProps } from './FleetMap.types.native';
3
+ /**
4
+ * FleetMap on React Native — where a set of tracked units is right now.
5
+ *
6
+ * Product-free by construction: it draws a labelled row with a freshness, and
7
+ * every word — the heading, the three freshness states, how a duration and a
8
+ * distance are written — arrives through `copy`. Couriers, service vans and
9
+ * field engineers are all the same list.
10
+ *
11
+ * ## What this renderer does NOT draw, and why
12
+ *
13
+ * There is no map. `MapPreview` — 2,200 lines that project, tile and decorate
14
+ * their own surface — has no React Native build, and porting it is its own
15
+ * change with its own consumers. What that costs is smaller than it sounds,
16
+ * because the web half already calls this list "the accessible representation,
17
+ * not a sidebar": every fact a pin carries — who, how recently, how precisely,
18
+ * what they are carrying — is on a row, in an order the map cannot express. So
19
+ * a native board is the half a screen reader was always given, and a device
20
+ * gets the same answers a dispatcher asks for. The gap is stated in
21
+ * `NATIVE-NOTES.md` rather than claimed away, and it is where the map goes when
22
+ * `MapPreview` is ported.
23
+ *
24
+ * The consequence for the API is one line in `FleetMap.types.native.ts`: the
25
+ * native copy interface has no `map` and no `mapLabel`, because a caller should
26
+ * not be asked to name controls nothing renders.
27
+ */
28
+ export declare const FleetMap: React.FC<FleetMapProps>;
29
+ export default FleetMap;
30
+ //# sourceMappingURL=FleetMap.native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FleetMap.native.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/FleetMap/FleetMap.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAsD7D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA+E5C,CAAC;AAeF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,36 @@
1
+ import type { StyleProp, ViewStyle } from 'react-native';
2
+ import type { FleetMapBaseProps, FleetMapCopyBase } from './FleetMap.base';
3
+ /**
4
+ * The REACT NATIVE half of `FleetMap`'s contract.
5
+ *
6
+ * Everything platform-neutral is re-exported from `FleetMap.base.ts` unchanged.
7
+ * What differs is at both ends of the file: there is no `map` copy and no
8
+ * `mapLabel`, because there is no map — `MapPreview` has no native build, and
9
+ * the roster is this component's own stated "accessible representation, not a
10
+ * sidebar", which is exactly the half that ports. And `style` stands where the
11
+ * web takes `className`, which is the ordinary `sx`/`style` split.
12
+ */
13
+ export type { FleetFreshness, FleetMapBaseProps, FleetMapCopyBase, FleetUnit, } from './FleetMap.base';
14
+ /**
15
+ * Every word the native board prints.
16
+ *
17
+ * An alias rather than an empty `extends`, so that the day `MapPreview` is
18
+ * ported this becomes an interface with the map's words in it and no consumer
19
+ * import has to move.
20
+ */
21
+ export type FleetMapCopy = FleetMapCopyBase;
22
+ /** Props for the native {@link FleetMap} board. */
23
+ export interface FleetMapProps extends FleetMapBaseProps {
24
+ copy: FleetMapCopy;
25
+ /**
26
+ * A ceiling for the roster, so a fleet of thirty scrolls inside the panel
27
+ * rather than pushing everything below it off the screen.
28
+ *
29
+ * A NUMBER of pixels, where the web takes any CSS length: React Native has no
30
+ * `calc`, no viewport units and no `%` that resolves against a parent which
31
+ * has not sized itself.
32
+ */
33
+ maxHeight?: number;
34
+ style?: StyleProp<ViewStyle>;
35
+ }
36
+ //# sourceMappingURL=FleetMap.types.native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FleetMap.types.native.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/FleetMap/FleetMap.types.native.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAE3E;;;;;;;;;GASG;AACH,YAAY,EACV,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,SAAS,GACV,MAAM,iBAAiB,CAAC;AAEzB;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,gBAAgB,CAAC;AAE5C,mDAAmD;AACnD,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD,IAAI,EAAE,YAAY,CAAC;IACnB;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B"}
@@ -0,0 +1,17 @@
1
+ import * as React from 'react';
2
+ import type { FleetKeyEvent } from './FleetMap.hooks';
3
+ import type { FleetMapCopy, FleetUnit } from './FleetMap.types.native';
4
+ export interface FleetRosterProps {
5
+ units: readonly FleetUnit[];
6
+ copy: FleetMapCopy;
7
+ selectedId: string | null | undefined;
8
+ onSelect: (id: string) => void;
9
+ laggingAfterSeconds: number;
10
+ staleAfterSeconds: number;
11
+ loading: boolean;
12
+ maxHeight: number | undefined;
13
+ testId: string;
14
+ onKeyDown: (event: FleetKeyEvent) => void;
15
+ }
16
+ export declare function FleetRoster({ units, copy, selectedId, onSelect, laggingAfterSeconds, staleAfterSeconds, loading, maxHeight, testId, onKeyDown, }: FleetRosterProps): React.JSX.Element;
17
+ //# sourceMappingURL=FleetRoster.native.d.ts.map