@12-apps/ui 6.98.0 → 6.99.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 (210) hide show
  1. package/dist/_internal/components/data-display/Alert/Alert.content.js +4 -2
  2. package/dist/_internal/components/data-display/Alert/Alert.ink.js +27 -0
  3. package/dist/_internal/components/data-display/Alert/Alert.js +6 -5
  4. package/dist/_internal/components/data-display/Alert/Alert.metrics.js +5 -1
  5. package/dist/_internal/components/data-display/Alert/Alert.styles.js +2 -2
  6. package/dist/_internal/components/data-display/Banner/Banner.js +3 -3
  7. package/dist/_internal/components/data-display/Banner/Banner.styles.js +2 -2
  8. package/dist/_internal/components/data-display/CardKit/card-actions-context.js +8 -7
  9. package/dist/_internal/components/data-display/CardKit/use-remove-confirm.js +9 -8
  10. package/dist/_internal/components/data-display/Carousel/Carousel.js +2 -2
  11. package/dist/_internal/components/data-display/Chart/SpecChart.js +3 -3
  12. package/dist/_internal/components/data-display/DataGrid/DataGrid.js +1 -1
  13. package/dist/_internal/components/data-display/DataViews/DataViewsGrid.js +17 -17
  14. package/dist/_internal/components/data-display/DataViews/DataViewsTableBase.js +26 -25
  15. package/dist/_internal/components/data-display/DataViews/base-list-card-geometry.js +1 -1
  16. package/dist/_internal/components/data-display/DataViews/base-list-card-layout.js +1 -1
  17. package/dist/_internal/components/data-display/DataViews/base-list-card-slots.js +1 -1
  18. package/dist/_internal/components/data-display/DataViews/base-list-card.js +4 -4
  19. package/dist/_internal/components/data-display/DataViews/data-views-grid-bodies.js +2 -2
  20. package/dist/_internal/components/data-display/DataViews/data-views-grid-parts.js +14 -14
  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 +2 -2
  23. package/dist/_internal/components/data-display/DataViews/data-views-more-filters.js +3 -3
  24. package/dist/_internal/components/data-display/DataViews/data-views-table-parts.js +8 -7
  25. package/dist/_internal/components/data-display/DataViews/list-card-rails.js +1 -1
  26. package/dist/_internal/components/data-display/DataViews/use-data-views-state.js +2 -2
  27. package/dist/_internal/components/data-display/DayRuler/DayRuler.footer.js +2 -2
  28. package/dist/_internal/components/data-display/DayRuler/DayRuler.js +7 -7
  29. package/dist/_internal/components/data-display/DayRuler/DayRuler.keyboard.js +2 -2
  30. package/dist/_internal/components/data-display/DayRuler/DayRuler.parts.js +3 -3
  31. package/dist/_internal/components/data-display/DayRuler/useRulerDrag.js +2 -2
  32. package/dist/_internal/components/data-display/FleetMap/FleetBody.js +6 -6
  33. package/dist/_internal/components/data-display/FleetMap/FleetCanvas.js +5 -5
  34. package/dist/_internal/components/data-display/FleetMap/FleetMap.js +7 -7
  35. package/dist/_internal/components/data-display/HoverCard/HoverCard.js +2 -2
  36. package/dist/_internal/components/data-display/Lightbox/Lightbox.js +3 -3
  37. package/dist/_internal/components/data-display/MapPreview/MapLayers.js +2 -2
  38. package/dist/_internal/components/data-display/MapPreview/MapPreview.js +4 -4
  39. package/dist/_internal/components/data-display/Progress/Progress.js +2 -2
  40. package/dist/_internal/components/data-display/RegionMap/RegionMap.fixtures.js +1 -1
  41. package/dist/_internal/components/data-display/RegionMap/RegionMap.helpers.js +3 -1
  42. package/dist/_internal/components/data-display/RegionMap/RegionMap.hooks.js +3 -3
  43. package/dist/_internal/components/data-display/RegionMap/RegionMap.js +6 -5
  44. package/dist/_internal/components/data-display/RegionMap/RegionMap.view.js +2 -2
  45. package/dist/_internal/components/data-display/RegionMap/RegionMapDrawing.js +3 -2
  46. package/dist/_internal/components/data-display/RegionMap/RegionMapPin.js +26 -0
  47. package/dist/_internal/components/data-display/index.js +60 -50
  48. package/dist/_internal/components/feedback/NotificationStatusNotice/NotificationStatusNotice.js +7 -6
  49. package/dist/_internal/components/feedback/SequenceResolver/SequenceResolver.frame.js +4 -4
  50. package/dist/_internal/components/feedback/SequenceResolver/SequenceResolver.header.js +3 -3
  51. package/dist/_internal/components/feedback/SequenceResolver/SequenceResolver.js +14 -13
  52. package/dist/_internal/components/feedback/SequenceResolver/SequenceResolver.overview.js +9 -8
  53. package/dist/_internal/components/feedback/SequenceResolver/SequenceResolver.parts.js +8 -7
  54. package/dist/_internal/components/feedback/index.js +15 -14
  55. package/dist/_internal/components/index.js +66 -56
  56. package/dist/charts.js +11 -11
  57. package/dist/{chunk-WYNGH2WL.js → chunk-255WTBZ5.js} +8 -8
  58. package/dist/{chunk-QIP37Y2C.js → chunk-2RC6EAGD.js} +2 -2
  59. package/dist/{chunk-ZKVSFVIA.js → chunk-37MJZLQU.js} +2 -2
  60. package/dist/{chunk-BQBEN44R.js → chunk-3I7KE2N6.js} +2 -2
  61. package/dist/{chunk-L4FWEI2P.js → chunk-3V3Z4EML.js} +5 -5
  62. package/dist/{chunk-E4MJA52O.js → chunk-3V5V44UP.js} +16 -18
  63. package/dist/chunk-3V5V44UP.js.map +1 -0
  64. package/dist/{chunk-6RYSSNOO.js → chunk-54DOLCJ3.js} +2 -2
  65. package/dist/{chunk-74IH3ZGD.js → chunk-643YFWNK.js} +2 -2
  66. package/dist/{chunk-FRQGZIYU.js → chunk-6WAP7BJS.js} +2 -2
  67. package/dist/chunk-AG4F6NVT.js +1 -0
  68. package/dist/chunk-AG4F6NVT.js.map +1 -0
  69. package/dist/{chunk-3CXRHRGE.js → chunk-AYDVNXGR.js} +7 -3
  70. package/dist/chunk-AYDVNXGR.js.map +1 -0
  71. package/dist/{chunk-JO6D7YGN.js → chunk-CWRQGA2T.js} +2 -2
  72. package/dist/chunk-DRYBA76G.js +293 -0
  73. package/dist/chunk-DRYBA76G.js.map +1 -0
  74. package/dist/{chunk-ZW7Q3IRL.js → chunk-FYJL432J.js} +4 -4
  75. package/dist/{chunk-G6TKWNF2.js → chunk-GZITNT7O.js} +11 -11
  76. package/dist/{chunk-RFMQBIE6.js → chunk-HBHBRRSW.js} +4 -4
  77. package/dist/{chunk-U4Z6GZDW.js → chunk-HN36UVOE.js} +4 -4
  78. package/dist/{chunk-WK577LQL.js → chunk-J2IQ6FJ5.js} +4 -4
  79. package/dist/{chunk-HCTHY66U.js → chunk-KAGXV3ID.js} +4 -4
  80. package/dist/{chunk-FWAY2SAI.js → chunk-KAZWBDIH.js} +2 -2
  81. package/dist/{chunk-DKPELKGL.js → chunk-KV7LTOWC.js} +5 -5
  82. package/dist/{chunk-UC7DLGMP.js → chunk-KVP5A3YK.js} +2 -2
  83. package/dist/chunk-LNZJJFZQ.js +41 -0
  84. package/dist/chunk-LNZJJFZQ.js.map +1 -0
  85. package/dist/{chunk-EGBQR5GH.js → chunk-LOLYBFYY.js} +5 -5
  86. package/dist/{chunk-SOXO2VN3.js → chunk-MEMVZW64.js} +3 -3
  87. package/dist/{chunk-COOSJKZL.js → chunk-MNJZPJ5S.js} +2 -1
  88. package/dist/chunk-MNJZPJ5S.js.map +1 -0
  89. package/dist/{chunk-G2NVBCF7.js → chunk-NWUMGE6T.js} +3 -3
  90. package/dist/{chunk-NQCTANF3.js → chunk-Q5SCBQLY.js} +18 -11
  91. package/dist/chunk-Q5SCBQLY.js.map +1 -0
  92. package/dist/{chunk-64LNNC54.js → chunk-QLKUWDMQ.js} +4 -4
  93. package/dist/{chunk-MPVH2GM5.js → chunk-RAQD5QCM.js} +4 -4
  94. package/dist/{chunk-KXDLLS62.js → chunk-REHGWN5M.js} +4 -4
  95. package/dist/{chunk-Z4ZFJ565.js → chunk-SRAIV6U6.js} +3 -3
  96. package/dist/{chunk-5ZY3IIIG.js → chunk-TBQR5VCN.js} +11 -1
  97. package/dist/chunk-TBQR5VCN.js.map +1 -0
  98. package/dist/{chunk-3N2HWNKT.js → chunk-UIJLDAV7.js} +2 -2
  99. package/dist/{chunk-7HZ36QDH.js → chunk-UN5WU2OX.js} +9 -3
  100. package/dist/chunk-UN5WU2OX.js.map +1 -0
  101. package/dist/{chunk-A27J4CIZ.js → chunk-UTIYB6VE.js} +11 -11
  102. package/dist/{chunk-5V7IZBRY.js → chunk-VRSW7PIO.js} +5 -5
  103. package/dist/{chunk-U4PV2ZKK.js → chunk-WDEVKND3.js} +3 -3
  104. package/dist/chunk-WGKLBVDZ.js +1 -0
  105. package/dist/chunk-WGKLBVDZ.js.map +1 -0
  106. package/dist/{chunk-AP7GEUJS.js → chunk-XFOKLWJZ.js} +2 -2
  107. package/dist/{chunk-6D5AMANO.js → chunk-XQAFSC66.js} +2 -2
  108. package/dist/{chunk-YNZUYZ2O.js → chunk-XR474YYX.js} +2 -2
  109. package/dist/{chunk-L5RS6QAT.js → chunk-YBF2WUGQ.js} +2 -2
  110. package/dist/{chunk-RCTHCXS6.js → chunk-YQ5GQ32T.js} +2 -2
  111. package/dist/{chunk-YLZXIR6B.js → chunk-Z5V5E3JW.js} +4 -4
  112. package/dist/data-display/Alert.js +10 -6
  113. package/dist/data-display/Banner.js +3 -3
  114. package/dist/data-display/CardKit.js +9 -8
  115. package/dist/data-display/Carousel.js +2 -2
  116. package/dist/data-display/Chart.js +11 -11
  117. package/dist/data-display/DataGrid.js +1 -1
  118. package/dist/data-display/DataViews.js +33 -32
  119. package/dist/data-display/DayRuler.js +7 -7
  120. package/dist/data-display/FleetMap.js +7 -7
  121. package/dist/data-display/HoverCard.js +2 -2
  122. package/dist/data-display/Lightbox.js +3 -3
  123. package/dist/data-display/MapPreview.js +4 -4
  124. package/dist/data-display/Progress.js +2 -2
  125. package/dist/data-display/RegionMap.js +14 -8
  126. package/dist/feedback/NotificationStatusNotice.js +7 -6
  127. package/dist/feedback/SequenceResolver.js +14 -13
  128. package/dist/native/data-display/Alert.js +10 -0
  129. package/dist/native/data-display/Alert.js.map +1 -1
  130. package/dist/types/components/data-display/Alert/Alert.content.d.ts.map +1 -1
  131. package/dist/types/components/data-display/Alert/Alert.d.ts.map +1 -1
  132. package/dist/types/components/data-display/Alert/Alert.ink.d.ts +65 -0
  133. package/dist/types/components/data-display/Alert/Alert.ink.d.ts.map +1 -0
  134. package/dist/types/components/data-display/Alert/Alert.metrics.d.ts +73 -5
  135. package/dist/types/components/data-display/Alert/Alert.metrics.d.ts.map +1 -1
  136. package/dist/types/components/data-display/Alert/index.d.ts +1 -0
  137. package/dist/types/components/data-display/Alert/index.d.ts.map +1 -1
  138. package/dist/types/components/data-display/RegionMap/RegionMap.d.ts +1 -1
  139. package/dist/types/components/data-display/RegionMap/RegionMap.d.ts.map +1 -1
  140. package/dist/types/components/data-display/RegionMap/RegionMap.helpers.d.ts +9 -0
  141. package/dist/types/components/data-display/RegionMap/RegionMap.helpers.d.ts.map +1 -1
  142. package/dist/types/components/data-display/RegionMap/RegionMap.types.d.ts +45 -1
  143. package/dist/types/components/data-display/RegionMap/RegionMap.types.d.ts.map +1 -1
  144. package/dist/types/components/data-display/RegionMap/RegionMapDrawing.d.ts +4 -1
  145. package/dist/types/components/data-display/RegionMap/RegionMapDrawing.d.ts.map +1 -1
  146. package/dist/types/components/data-display/RegionMap/RegionMapPin.d.ts +102 -0
  147. package/dist/types/components/data-display/RegionMap/RegionMapPin.d.ts.map +1 -0
  148. package/dist/types/components/data-display/RegionMap/index.d.ts +2 -1
  149. package/dist/types/components/data-display/RegionMap/index.d.ts.map +1 -1
  150. package/dist/types-native/components/data-display/Alert/Alert.metrics.d.ts +73 -5
  151. package/dist/types-native/components/data-display/Alert/Alert.metrics.d.ts.map +1 -1
  152. package/package.json +1 -1
  153. package/src/components/data-display/Alert/Alert.content.tsx +16 -1
  154. package/src/components/data-display/Alert/Alert.ink.ts +106 -0
  155. package/src/components/data-display/Alert/Alert.md +40 -0
  156. package/src/components/data-display/Alert/Alert.metrics.ts +57 -5
  157. package/src/components/data-display/Alert/Alert.tsx +18 -7
  158. package/src/components/data-display/Alert/index.ts +1 -0
  159. package/src/components/data-display/RegionMap/RegionMap.helpers.ts +1 -1
  160. package/src/components/data-display/RegionMap/RegionMap.md +19 -2
  161. package/src/components/data-display/RegionMap/RegionMap.tsx +4 -0
  162. package/src/components/data-display/RegionMap/RegionMap.types.ts +49 -1
  163. package/src/components/data-display/RegionMap/RegionMapDrawing.tsx +11 -13
  164. package/src/components/data-display/RegionMap/RegionMapPin.tsx +388 -0
  165. package/src/components/data-display/RegionMap/index.ts +5 -0
  166. package/dist/chunk-3CXRHRGE.js.map +0 -1
  167. package/dist/chunk-5ZY3IIIG.js.map +0 -1
  168. package/dist/chunk-7HZ36QDH.js.map +0 -1
  169. package/dist/chunk-COOSJKZL.js.map +0 -1
  170. package/dist/chunk-DY2I6LMX.js +0 -1
  171. package/dist/chunk-E4MJA52O.js.map +0 -1
  172. package/dist/chunk-NQCTANF3.js.map +0 -1
  173. package/dist/chunk-NUGT7LMR.js +0 -1
  174. /package/dist/{chunk-DY2I6LMX.js.map → _internal/components/data-display/Alert/Alert.ink.js.map} +0 -0
  175. /package/dist/{chunk-NUGT7LMR.js.map → _internal/components/data-display/RegionMap/RegionMapPin.js.map} +0 -0
  176. /package/dist/{chunk-WYNGH2WL.js.map → chunk-255WTBZ5.js.map} +0 -0
  177. /package/dist/{chunk-QIP37Y2C.js.map → chunk-2RC6EAGD.js.map} +0 -0
  178. /package/dist/{chunk-ZKVSFVIA.js.map → chunk-37MJZLQU.js.map} +0 -0
  179. /package/dist/{chunk-BQBEN44R.js.map → chunk-3I7KE2N6.js.map} +0 -0
  180. /package/dist/{chunk-L4FWEI2P.js.map → chunk-3V3Z4EML.js.map} +0 -0
  181. /package/dist/{chunk-6RYSSNOO.js.map → chunk-54DOLCJ3.js.map} +0 -0
  182. /package/dist/{chunk-74IH3ZGD.js.map → chunk-643YFWNK.js.map} +0 -0
  183. /package/dist/{chunk-FRQGZIYU.js.map → chunk-6WAP7BJS.js.map} +0 -0
  184. /package/dist/{chunk-JO6D7YGN.js.map → chunk-CWRQGA2T.js.map} +0 -0
  185. /package/dist/{chunk-ZW7Q3IRL.js.map → chunk-FYJL432J.js.map} +0 -0
  186. /package/dist/{chunk-G6TKWNF2.js.map → chunk-GZITNT7O.js.map} +0 -0
  187. /package/dist/{chunk-RFMQBIE6.js.map → chunk-HBHBRRSW.js.map} +0 -0
  188. /package/dist/{chunk-U4Z6GZDW.js.map → chunk-HN36UVOE.js.map} +0 -0
  189. /package/dist/{chunk-WK577LQL.js.map → chunk-J2IQ6FJ5.js.map} +0 -0
  190. /package/dist/{chunk-HCTHY66U.js.map → chunk-KAGXV3ID.js.map} +0 -0
  191. /package/dist/{chunk-FWAY2SAI.js.map → chunk-KAZWBDIH.js.map} +0 -0
  192. /package/dist/{chunk-DKPELKGL.js.map → chunk-KV7LTOWC.js.map} +0 -0
  193. /package/dist/{chunk-UC7DLGMP.js.map → chunk-KVP5A3YK.js.map} +0 -0
  194. /package/dist/{chunk-EGBQR5GH.js.map → chunk-LOLYBFYY.js.map} +0 -0
  195. /package/dist/{chunk-SOXO2VN3.js.map → chunk-MEMVZW64.js.map} +0 -0
  196. /package/dist/{chunk-G2NVBCF7.js.map → chunk-NWUMGE6T.js.map} +0 -0
  197. /package/dist/{chunk-64LNNC54.js.map → chunk-QLKUWDMQ.js.map} +0 -0
  198. /package/dist/{chunk-MPVH2GM5.js.map → chunk-RAQD5QCM.js.map} +0 -0
  199. /package/dist/{chunk-KXDLLS62.js.map → chunk-REHGWN5M.js.map} +0 -0
  200. /package/dist/{chunk-Z4ZFJ565.js.map → chunk-SRAIV6U6.js.map} +0 -0
  201. /package/dist/{chunk-3N2HWNKT.js.map → chunk-UIJLDAV7.js.map} +0 -0
  202. /package/dist/{chunk-A27J4CIZ.js.map → chunk-UTIYB6VE.js.map} +0 -0
  203. /package/dist/{chunk-5V7IZBRY.js.map → chunk-VRSW7PIO.js.map} +0 -0
  204. /package/dist/{chunk-U4PV2ZKK.js.map → chunk-WDEVKND3.js.map} +0 -0
  205. /package/dist/{chunk-AP7GEUJS.js.map → chunk-XFOKLWJZ.js.map} +0 -0
  206. /package/dist/{chunk-6D5AMANO.js.map → chunk-XQAFSC66.js.map} +0 -0
  207. /package/dist/{chunk-YNZUYZ2O.js.map → chunk-XR474YYX.js.map} +0 -0
  208. /package/dist/{chunk-L5RS6QAT.js.map → chunk-YBF2WUGQ.js.map} +0 -0
  209. /package/dist/{chunk-RCTHCXS6.js.map → chunk-YQ5GQ32T.js.map} +0 -0
  210. /package/dist/{chunk-YLZXIR6B.js.map → chunk-Z5V5E3JW.js.map} +0 -0
@@ -14,7 +14,7 @@ import {
14
14
  } from "./chunk-2SRWPNQ7.js";
15
15
  import {
16
16
  Progress
17
- } from "./chunk-L4FWEI2P.js";
17
+ } from "./chunk-3V3Z4EML.js";
18
18
  import {
19
19
  Button
20
20
  } from "./chunk-YOXYSAUI.js";
@@ -108,4 +108,4 @@ function SequenceHeader(props) {
108
108
  export {
109
109
  SequenceHeader
110
110
  };
111
- //# sourceMappingURL=chunk-JO6D7YGN.js.map
111
+ //# sourceMappingURL=chunk-CWRQGA2T.js.map
@@ -0,0 +1,293 @@
1
+ import {
2
+ METRES_PER_DEGREE
3
+ } from "./chunk-MNJZPJ5S.js";
4
+ import {
5
+ rem
6
+ } from "./chunk-YKCAJ2TN.js";
7
+
8
+ // src/components/data-display/RegionMap/RegionMapPin.tsx
9
+ import Box from "@mui/material/Box/index.js";
10
+ import { alpha } from "@mui/material/styles/index.js";
11
+ import React from "react";
12
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
13
+ function PinShapes({ model, moving, testId, theme, fallback }) {
14
+ const { projection, view } = model;
15
+ if (!moving || !projection) return /* @__PURE__ */ jsx(Fragment, { children: fallback });
16
+ const pinAt = moving.pin ? projection.project([moving.pin.at.latitude, moving.pin.at.longitude]) : null;
17
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
18
+ pinAt ? /* @__PURE__ */ jsx(PinCircles, { at: pinAt, radii: model.radii, theme }) : fallback,
19
+ pinAt && moving.ghost ? /* @__PURE__ */ jsx(GhostShapes, { ghost: moving.ghost, pinAt, projection, view, testId, theme }) : null,
20
+ moving.dots ? /* @__PURE__ */ jsx(Dots, { dots: moving.dots, projection, view, testId, theme }) : null
21
+ ] });
22
+ }
23
+ function PinOverlay({
24
+ model,
25
+ moving,
26
+ svgRef,
27
+ testId,
28
+ theme
29
+ }) {
30
+ if (!moving || !model.projection) return null;
31
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
32
+ moving.pin ? /* @__PURE__ */ jsx(PinMarker, { pin: moving.pin, center: moving.center, projection: model.projection, view: model.view, svgRef, testId, theme }) : null,
33
+ /* @__PURE__ */ jsx(ScaleBar, { view: model.view, copy: moving.copy, svgRef, testId, theme })
34
+ ] });
35
+ }
36
+ function latLngAt(center, point) {
37
+ const kx = METRES_PER_DEGREE * Math.cos(center.latitude * Math.PI / 180);
38
+ return { latitude: center.latitude - point.y / METRES_PER_DEGREE, longitude: center.longitude + point.x / kx };
39
+ }
40
+ function fractionOf(view, point) {
41
+ return { x: (point.x - view.minX) / view.spanX, y: (point.y - view.minY) / view.spanY };
42
+ }
43
+ var clampFraction = (value) => Math.min(0.995, Math.max(5e-3, value));
44
+ function clampToView(view, point) {
45
+ const at = fractionOf(view, point);
46
+ return { x: view.minX + clampFraction(at.x) * view.spanX, y: view.minY + clampFraction(at.y) * view.spanY };
47
+ }
48
+ var ARROWS = { ArrowLeft: [-1, 0], ArrowRight: [1, 0], ArrowUp: [0, 1], ArrowDown: [0, -1] };
49
+ var DEFAULT_STEP_METRES = 50;
50
+ function PinMarker({ pin, center, projection, view, svgRef, testId, theme }) {
51
+ const ref = React.useRef(null);
52
+ const live = React.useRef({ pin, center, view });
53
+ live.current = { pin, center, view };
54
+ usePinDrag(ref, svgRef, live);
55
+ const at = fractionOf(view, projection.project([pin.at.latitude, pin.at.longitude]));
56
+ const onKeyDown = (event) => {
57
+ const arrow = ARROWS[event.key];
58
+ if (!arrow || pin.disabled) return;
59
+ event.preventDefault();
60
+ const step = pin.stepMetres ?? DEFAULT_STEP_METRES;
61
+ const plane = projection.project([pin.at.latitude, pin.at.longitude]);
62
+ const next = latLngAt(center, clampToView(view, { x: plane.x + arrow[0] * step, y: plane.y - arrow[1] * step }));
63
+ pin.onMove?.(next);
64
+ pin.onDrop(next);
65
+ };
66
+ return /* @__PURE__ */ jsxs(
67
+ Box,
68
+ {
69
+ ref,
70
+ role: "button",
71
+ tabIndex: pin.disabled ? -1 : 0,
72
+ "aria-label": pin.ariaLabel,
73
+ "aria-disabled": pin.disabled || void 0,
74
+ onKeyDown,
75
+ "data-testid": `${testId}-pin`,
76
+ "data-region-pin": "",
77
+ style: { left: `${(at.x * 100).toFixed(3)}%`, top: `${(at.y * 100).toFixed(3)}%` },
78
+ sx: {
79
+ position: "absolute",
80
+ transform: "translate(-50%, -100%)",
81
+ width: rem(theme, 44),
82
+ height: rem(theme, 48),
83
+ display: "flex",
84
+ alignItems: "flex-end",
85
+ justifyContent: "center",
86
+ cursor: pin.disabled ? "default" : "grab",
87
+ touchAction: "none",
88
+ zIndex: 2,
89
+ borderRadius: 1,
90
+ "&:focus-visible": { outline: `${rem(theme, 2)} solid`, outlineColor: "primary.main", outlineOffset: rem(theme, 2) }
91
+ },
92
+ children: [
93
+ /* @__PURE__ */ jsxs(Box, { component: "svg", viewBox: "0 0 32 42", "aria-hidden": "true", sx: { width: rem(theme, 32), height: rem(theme, 42) }, children: [
94
+ /* @__PURE__ */ jsx(
95
+ "path",
96
+ {
97
+ d: "M16 41C16 41 3 25 3 15.5A13 13 0 1 1 29 15.5C29 25 16 41 16 41Z",
98
+ fill: theme.palette.primary.main,
99
+ stroke: theme.palette.background.paper,
100
+ strokeWidth: 2
101
+ }
102
+ ),
103
+ /* @__PURE__ */ jsx("circle", { cx: "16", cy: "15.5", r: "5", fill: theme.palette.background.paper })
104
+ ] }),
105
+ /* @__PURE__ */ jsx(
106
+ Box,
107
+ {
108
+ component: "span",
109
+ "aria-hidden": true,
110
+ sx: {
111
+ position: "absolute",
112
+ left: "88%",
113
+ top: 0,
114
+ px: 0.75,
115
+ borderRadius: 0.5,
116
+ border: 1,
117
+ borderColor: "divider",
118
+ bgcolor: "background.paper",
119
+ color: "text.primary",
120
+ fontSize: rem(theme, 12),
121
+ fontWeight: 600,
122
+ whiteSpace: "nowrap",
123
+ pointerEvents: "none"
124
+ },
125
+ children: pin.label
126
+ }
127
+ )
128
+ ]
129
+ }
130
+ );
131
+ }
132
+ function usePinDrag(ref, svgRef, live) {
133
+ React.useEffect(() => {
134
+ const element = ref.current;
135
+ if (!element) return void 0;
136
+ let dragging = null;
137
+ let last = null;
138
+ const pointAt = (event) => {
139
+ const box = svgRef.current?.getBoundingClientRect();
140
+ if (!box || box.width === 0 || box.height === 0) return null;
141
+ const { view, center } = live.current;
142
+ if (!Number.isFinite(event.clientX) || !Number.isFinite(event.clientY)) return null;
143
+ const fx = clampFraction((event.clientX - box.left) / box.width);
144
+ const fy = clampFraction((event.clientY - box.top) / box.height);
145
+ return latLngAt(center, { x: view.minX + fx * view.spanX, y: view.minY + fy * view.spanY });
146
+ };
147
+ const down = (event) => {
148
+ event.stopPropagation();
149
+ if (live.current.pin.disabled) return;
150
+ event.preventDefault();
151
+ dragging = event.pointerId;
152
+ last = null;
153
+ element.setPointerCapture?.(event.pointerId);
154
+ };
155
+ const move = (event) => {
156
+ if (dragging !== event.pointerId) return;
157
+ event.stopPropagation();
158
+ const at = pointAt(event);
159
+ if (!at) return;
160
+ last = at;
161
+ live.current.pin.onMove?.(at);
162
+ };
163
+ const up = (event) => {
164
+ if (dragging !== event.pointerId) return;
165
+ event.stopPropagation();
166
+ dragging = null;
167
+ const at = event.type === "pointercancel" ? last : pointAt(event) ?? last;
168
+ if (at) live.current.pin.onDrop(at);
169
+ };
170
+ const click = (event) => event.stopPropagation();
171
+ element.addEventListener("pointerdown", down);
172
+ element.addEventListener("pointermove", move);
173
+ element.addEventListener("pointerup", up);
174
+ element.addEventListener("pointercancel", up);
175
+ element.addEventListener("click", click);
176
+ return () => {
177
+ element.removeEventListener("pointerdown", down);
178
+ element.removeEventListener("pointermove", move);
179
+ element.removeEventListener("pointerup", up);
180
+ element.removeEventListener("pointercancel", up);
181
+ element.removeEventListener("click", click);
182
+ };
183
+ }, [ref, svgRef, live]);
184
+ }
185
+ function PinCircles({ at, radii, theme }) {
186
+ return /* @__PURE__ */ jsx(Fragment, { children: radii.map((radius) => /* @__PURE__ */ jsx(
187
+ "circle",
188
+ {
189
+ cx: at.x,
190
+ cy: at.y,
191
+ r: radius,
192
+ fill: alpha(theme.palette.primary.main, 0.06),
193
+ stroke: theme.palette.primary.main,
194
+ strokeWidth: 2.25,
195
+ vectorEffect: "non-scaling-stroke",
196
+ pointerEvents: "none"
197
+ },
198
+ radius
199
+ )) });
200
+ }
201
+ function GhostShapes({
202
+ ghost,
203
+ pinAt,
204
+ projection,
205
+ view,
206
+ testId,
207
+ theme
208
+ }) {
209
+ const at = projection.project([ghost.at.latitude, ghost.at.longitude]);
210
+ const stroke = theme.palette.text.secondary;
211
+ const common = { fill: "none", stroke, vectorEffect: "non-scaling-stroke", pointerEvents: "none" };
212
+ return /* @__PURE__ */ jsxs("g", { "data-testid": `${testId}-ghost`, children: [
213
+ /* @__PURE__ */ jsx("circle", { cx: at.x, cy: at.y, r: ghost.radiusMetres, strokeWidth: 1.5, strokeDasharray: "6 5", ...common }),
214
+ /* @__PURE__ */ jsx("line", { x1: at.x, y1: at.y, x2: pinAt.x, y2: pinAt.y, strokeWidth: 1.5, strokeDasharray: "4 4", ...common }),
215
+ /* @__PURE__ */ jsx("circle", { cx: at.x, cy: at.y, r: view.spanX / 110, strokeWidth: 2, strokeDasharray: "3 2", ...common, fill: alpha(theme.palette.background.paper, 0.7) })
216
+ ] });
217
+ }
218
+ function Dots({ dots, projection, view, testId, theme }) {
219
+ return /* @__PURE__ */ jsx("g", { "data-testid": `${testId}-dots`, children: dots.map((dot) => {
220
+ const at = projection.project([dot.at.latitude, dot.at.longitude]);
221
+ return /* @__PURE__ */ jsx(
222
+ "circle",
223
+ {
224
+ cx: at.x,
225
+ cy: at.y,
226
+ r: view.spanX / 150,
227
+ fill: dot.filled ? theme.palette.text.primary : theme.palette.background.paper,
228
+ stroke: theme.palette.text.primary,
229
+ strokeWidth: 2,
230
+ vectorEffect: "non-scaling-stroke",
231
+ pointerEvents: "none",
232
+ "data-filled": dot.filled ? "true" : "false"
233
+ },
234
+ dot.id
235
+ );
236
+ }) });
237
+ }
238
+ var SCALE_STEPS = [50, 100, 200, 500, 1e3, 2e3, 5e3, 1e4, 2e4, 5e4];
239
+ function scaleMetres(view) {
240
+ const quarter = view.spanX / 4;
241
+ return SCALE_STEPS.filter((step) => step <= quarter).at(-1) ?? SCALE_STEPS[0];
242
+ }
243
+ function ScaleBar({
244
+ view,
245
+ copy,
246
+ svgRef,
247
+ testId,
248
+ theme
249
+ }) {
250
+ const [screen, setScreen] = React.useState({ laidOut: 0, drawn: 0 });
251
+ const wanted = copy.scale !== void 0;
252
+ React.useLayoutEffect(() => {
253
+ if (!wanted) return;
254
+ const svg = svgRef.current;
255
+ const next = { laidOut: svg?.clientWidth ?? 0, drawn: svg?.getBoundingClientRect().width ?? 0 };
256
+ if (next.laidOut !== screen.laidOut || Math.abs(next.drawn - screen.drawn) > 0.5) setScreen(next);
257
+ });
258
+ if (!copy.scale) return null;
259
+ const zoom = screen.laidOut > 0 && screen.drawn > 0 ? screen.drawn / screen.laidOut : 1;
260
+ const metres = scaleMetres({ ...view, spanX: view.spanX / zoom });
261
+ const share = metres * zoom / view.spanX;
262
+ return /* @__PURE__ */ jsxs(
263
+ Box,
264
+ {
265
+ "data-testid": `${testId}-scale`,
266
+ "aria-hidden": true,
267
+ sx: { position: "absolute", left: 0, right: 0, bottom: rem(theme, 10), pointerEvents: "none", zIndex: 1 },
268
+ children: [
269
+ /* @__PURE__ */ jsx(Box, { component: "span", sx: { display: "block", ml: rem(theme, 10), fontSize: rem(theme, 11), color: "text.secondary" }, children: copy.scale(metres) }),
270
+ /* @__PURE__ */ jsx(
271
+ Box,
272
+ {
273
+ component: "span",
274
+ sx: { display: "block", height: rem(theme, 4), ml: rem(theme, 10), width: `${(share * 100).toFixed(2)}%`, borderStyle: "solid", borderWidth: `0 ${rem(theme, 1.5)} ${rem(theme, 1.5)}`, borderColor: "text.secondary" }
275
+ }
276
+ )
277
+ ]
278
+ }
279
+ );
280
+ }
281
+
282
+ export {
283
+ PinShapes,
284
+ PinOverlay,
285
+ latLngAt,
286
+ PinMarker,
287
+ PinCircles,
288
+ GhostShapes,
289
+ Dots,
290
+ scaleMetres,
291
+ ScaleBar
292
+ };
293
+ //# sourceMappingURL=chunk-DRYBA76G.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/data-display/RegionMap/RegionMapPin.tsx"],"sourcesContent":["import Box from '@mui/material/Box/index.js';\nimport { alpha, type Theme } from '@mui/material/styles/index.js';\nimport React from 'react';\n\nimport { rem } from '../../../tokens/relative';\n\nimport { METRES_PER_DEGREE, type PlaneBox, type PlanePoint, type Projection } from './RegionMap.helpers';\nimport type { RegionMapModel } from './RegionMap.hooks';\nimport type { RegionMapCenter, RegionMapCopy, RegionMapDot, RegionMapGhost, RegionMapPin } from './RegionMap.types';\n\n/**\n * The movable centre of a `RegionMap` (`pin`, `ghost`, `dots`): a pin the\n * viewer drags with a mouse or one finger, or focuses and nudges with the\n * arrow keys, while the VIEW stays where `center` put it — so the areas never\n * slide under a dragging finger. The circles follow the pin; a dashed ring\n * and dot stay at `ghost`; `dots` are small points (filled or hollow).\n *\n * The pin is HTML over the drawing, at its point by percent like the labels,\n * carrying `data-region-pin` so a host that zooms the drawing's layers can\n * move it with them. Its moves are reported, never applied: the host passes\n * the new point back.\n */\n\n/** The movable centre and what is drawn with it, as the drawing receives it. */\nexport interface Moving {\n center: RegionMapCenter;\n pin?: RegionMapPin;\n ghost?: RegionMapGhost;\n dots?: readonly RegionMapDot[];\n copy: RegionMapCopy;\n}\n\ntype DrawnModel = Pick<RegionMapModel, 'projection' | 'radii'> & { view: PlaneBox };\n\n/**\n * What the movable centre draws inside the SVG: the circles around the pin\n * (else `fallback`, the centre's own circles), the ghost, and the dots.\n */\nexport function PinShapes({ model, moving, testId, theme, fallback }: { model: DrawnModel; moving: Moving | undefined; testId: string; theme: Theme; fallback: React.ReactNode }): React.JSX.Element {\n const { projection, view } = model;\n if (!moving || !projection) return <>{fallback}</>;\n const pinAt = moving.pin ? projection.project([moving.pin.at.latitude, moving.pin.at.longitude]) : null;\n return (\n <>\n {pinAt ? <PinCircles at={pinAt} radii={model.radii} theme={theme} /> : fallback}\n {pinAt && moving.ghost ? <GhostShapes ghost={moving.ghost} pinAt={pinAt} projection={projection} view={view} testId={testId} theme={theme} /> : null}\n {moving.dots ? <Dots dots={moving.dots} projection={projection} view={view} testId={testId} theme={theme} /> : null}\n </>\n );\n}\n\n/** What the movable centre draws over the SVG, in HTML: the pin and the scale bar. */\nexport function PinOverlay({\n model,\n moving,\n svgRef,\n testId,\n theme,\n}: {\n model: DrawnModel;\n moving: Moving | undefined;\n svgRef: React.RefObject<SVGSVGElement | null>;\n testId: string;\n theme: Theme;\n}): React.JSX.Element | null {\n if (!moving || !model.projection) return null;\n return (\n <>\n {moving.pin ? <PinMarker pin={moving.pin} center={moving.center} projection={model.projection} view={model.view} svgRef={svgRef} testId={testId} theme={theme} /> : null}\n <ScaleBar view={model.view} copy={moving.copy} svgRef={svgRef} testId={testId} theme={theme} />\n </>\n );\n}\n\n/** The flat projection's inverse around `center` — it is linear. */\nexport function latLngAt(center: RegionMapCenter, point: PlanePoint): RegionMapCenter {\n const kx = METRES_PER_DEGREE * Math.cos((center.latitude * Math.PI) / 180);\n return { latitude: center.latitude - point.y / METRES_PER_DEGREE, longitude: center.longitude + point.x / kx };\n}\n\n/** A point of the plane as fractions of the view (0..1 across, 0..1 down). */\nfunction fractionOf(view: PlaneBox, point: PlanePoint): { x: number; y: number } {\n return { x: (point.x - view.minX) / view.spanX, y: (point.y - view.minY) / view.spanY };\n}\n\n/** Keep a fraction inside the view, a hair in from its edge (the mock's clamp). */\nconst clampFraction = (value: number): number => Math.min(0.995, Math.max(0.005, value));\n\n/** A plane point kept inside the view by the same clamp a drag gets. */\nfunction clampToView(view: PlaneBox, point: PlanePoint): PlanePoint {\n const at = fractionOf(view, point);\n return { x: view.minX + clampFraction(at.x) * view.spanX, y: view.minY + clampFraction(at.y) * view.spanY };\n}\n\n/** Arrow keys, as metres east and north per press. */\nconst ARROWS: Record<string, [number, number]> = { ArrowLeft: [-1, 0], ArrowRight: [1, 0], ArrowUp: [0, 1], ArrowDown: [0, -1] };\n\n/** One arrow key: 50 m unless the host says otherwise. */\nconst DEFAULT_STEP_METRES = 50;\n\ninterface PinLayerProps {\n pin: RegionMapPin;\n center: RegionMapCenter;\n projection: Projection;\n view: PlaneBox;\n /** The drawing's SVG, whose on-screen box maps a pointer to the plane (zoomed or not). */\n svgRef: React.RefObject<SVGSVGElement | null>;\n testId: string;\n theme: Theme;\n}\n\n/** The draggable pin, as HTML over the drawing. */\nexport function PinMarker({ pin, center, projection, view, svgRef, testId, theme }: PinLayerProps): React.JSX.Element {\n const ref = React.useRef<HTMLDivElement>(null);\n const live = React.useRef({ pin, center, view });\n live.current = { pin, center, view };\n usePinDrag(ref, svgRef, live);\n const at = fractionOf(view, projection.project([pin.at.latitude, pin.at.longitude]));\n const onKeyDown = (event: React.KeyboardEvent): void => {\n const arrow = ARROWS[event.key];\n if (!arrow || pin.disabled) return;\n event.preventDefault();\n const step = pin.stepMetres ?? DEFAULT_STEP_METRES;\n const plane = projection.project([pin.at.latitude, pin.at.longitude]);\n const next = latLngAt(center, clampToView(view, { x: plane.x + arrow[0] * step, y: plane.y - arrow[1] * step }));\n pin.onMove?.(next);\n pin.onDrop(next);\n };\n return (\n <Box\n ref={ref}\n role=\"button\"\n tabIndex={pin.disabled ? -1 : 0}\n aria-label={pin.ariaLabel}\n aria-disabled={pin.disabled || undefined}\n onKeyDown={onKeyDown}\n data-testid={`${testId}-pin`}\n data-region-pin=\"\"\n style={{ left: `${(at.x * 100).toFixed(3)}%`, top: `${(at.y * 100).toFixed(3)}%` }}\n sx={{\n position: 'absolute',\n transform: 'translate(-50%, -100%)',\n width: rem(theme, 44),\n height: rem(theme, 48),\n display: 'flex',\n alignItems: 'flex-end',\n justifyContent: 'center',\n cursor: pin.disabled ? 'default' : 'grab',\n touchAction: 'none',\n zIndex: 2,\n borderRadius: 1,\n '&:focus-visible': { outline: `${rem(theme, 2)} solid`, outlineColor: 'primary.main', outlineOffset: rem(theme, 2) },\n }}\n >\n <Box component=\"svg\" viewBox=\"0 0 32 42\" aria-hidden=\"true\" sx={{ width: rem(theme, 32), height: rem(theme, 42) }}>\n <path\n d=\"M16 41C16 41 3 25 3 15.5A13 13 0 1 1 29 15.5C29 25 16 41 16 41Z\"\n fill={theme.palette.primary.main}\n stroke={theme.palette.background.paper}\n strokeWidth={2}\n />\n <circle cx=\"16\" cy=\"15.5\" r=\"5\" fill={theme.palette.background.paper} />\n </Box>\n <Box\n component=\"span\"\n aria-hidden\n sx={{\n position: 'absolute',\n left: '88%',\n top: 0,\n px: 0.75,\n borderRadius: 0.5,\n border: 1,\n borderColor: 'divider',\n bgcolor: 'background.paper',\n color: 'text.primary',\n fontSize: rem(theme, 12),\n fontWeight: 600,\n whiteSpace: 'nowrap',\n pointerEvents: 'none',\n }}\n >\n {pin.label}\n </Box>\n </Box>\n );\n}\n\n/**\n * The pointer drag: native listeners on the pin, so a host's own listeners on\n * the drawing (a pan, a tap) never see the press; captured, so a finger that\n * leaves the pin keeps dragging it; clamped inside the view.\n */\nfunction usePinDrag(\n ref: React.RefObject<HTMLDivElement | null>,\n svgRef: React.RefObject<SVGSVGElement | null>,\n live: React.RefObject<{ pin: RegionMapPin; center: RegionMapCenter; view: PlaneBox }>,\n): void {\n React.useEffect(() => {\n const element = ref.current;\n if (!element) return undefined;\n let dragging: number | null = null;\n // Where the last move put the pin: a cancelled gesture (a browser may\n // report 0,0 for it) rests there rather than jumping to the corner.\n let last: RegionMapCenter | null = null;\n const pointAt = (event: PointerEvent): RegionMapCenter | null => {\n const box = svgRef.current?.getBoundingClientRect();\n if (!box || box.width === 0 || box.height === 0) return null;\n const { view, center } = live.current;\n if (!Number.isFinite(event.clientX) || !Number.isFinite(event.clientY)) return null;\n const fx = clampFraction((event.clientX - box.left) / box.width);\n const fy = clampFraction((event.clientY - box.top) / box.height);\n return latLngAt(center, { x: view.minX + fx * view.spanX, y: view.minY + fy * view.spanY });\n };\n const down = (event: PointerEvent): void => {\n event.stopPropagation();\n if (live.current.pin.disabled) return;\n event.preventDefault();\n dragging = event.pointerId;\n last = null;\n element.setPointerCapture?.(event.pointerId);\n };\n const move = (event: PointerEvent): void => {\n if (dragging !== event.pointerId) return;\n event.stopPropagation();\n const at = pointAt(event);\n if (!at) return;\n last = at;\n live.current.pin.onMove?.(at);\n };\n const up = (event: PointerEvent): void => {\n if (dragging !== event.pointerId) return;\n event.stopPropagation();\n dragging = null;\n const at = event.type === 'pointercancel' ? last : (pointAt(event) ?? last);\n if (at) live.current.pin.onDrop(at);\n };\n // A click that ends a drag is the drag's, not a tap on the area under it.\n const click = (event: MouseEvent): void => event.stopPropagation();\n element.addEventListener('pointerdown', down);\n element.addEventListener('pointermove', move);\n element.addEventListener('pointerup', up);\n element.addEventListener('pointercancel', up);\n element.addEventListener('click', click);\n return () => {\n element.removeEventListener('pointerdown', down);\n element.removeEventListener('pointermove', move);\n element.removeEventListener('pointerup', up);\n element.removeEventListener('pointercancel', up);\n element.removeEventListener('click', click);\n };\n }, [ref, svgRef, live]);\n}\n\n/** The circles around the pin: solid in the primary colour, faintly filled. */\nexport function PinCircles({ at, radii, theme }: { at: PlanePoint; radii: readonly number[]; theme: Theme }): React.JSX.Element {\n return (\n <>\n {radii.map((radius) => (\n <circle\n key={radius}\n cx={at.x}\n cy={at.y}\n r={radius}\n fill={alpha(theme.palette.primary.main, 0.06)}\n stroke={theme.palette.primary.main}\n strokeWidth={2.25}\n vectorEffect=\"non-scaling-stroke\"\n pointerEvents=\"none\"\n />\n ))}\n </>\n );\n}\n\n/** Where the circles stood: a dashed ring and dot at `ghost`, and a dashed line from it to the pin. */\nexport function GhostShapes({\n ghost,\n pinAt,\n projection,\n view,\n testId,\n theme,\n}: {\n ghost: RegionMapGhost;\n pinAt: PlanePoint;\n projection: Projection;\n view: PlaneBox;\n testId: string;\n theme: Theme;\n}): React.JSX.Element {\n const at = projection.project([ghost.at.latitude, ghost.at.longitude]);\n const stroke = theme.palette.text.secondary;\n const common = { fill: 'none', stroke, vectorEffect: 'non-scaling-stroke', pointerEvents: 'none' } as const;\n return (\n <g data-testid={`${testId}-ghost`}>\n <circle cx={at.x} cy={at.y} r={ghost.radiusMetres} strokeWidth={1.5} strokeDasharray=\"6 5\" {...common} />\n <line x1={at.x} y1={at.y} x2={pinAt.x} y2={pinAt.y} strokeWidth={1.5} strokeDasharray=\"4 4\" {...common} />\n <circle cx={at.x} cy={at.y} r={view.spanX / 110} strokeWidth={2} strokeDasharray=\"3 2\" {...common} fill={alpha(theme.palette.background.paper, 0.7)} />\n </g>\n );\n}\n\n/** The dots: filled with the ink, or hollow (paper with an ink ring). */\nexport function Dots({ dots, projection, view, testId, theme }: { dots: readonly RegionMapDot[]; projection: Projection; view: PlaneBox; testId: string; theme: Theme }): React.JSX.Element {\n return (\n <g data-testid={`${testId}-dots`}>\n {dots.map((dot) => {\n const at = projection.project([dot.at.latitude, dot.at.longitude]);\n return (\n <circle\n key={dot.id}\n cx={at.x}\n cy={at.y}\n r={view.spanX / 150}\n fill={dot.filled ? theme.palette.text.primary : theme.palette.background.paper}\n stroke={theme.palette.text.primary}\n strokeWidth={2}\n vectorEffect=\"non-scaling-stroke\"\n pointerEvents=\"none\"\n data-filled={dot.filled ? 'true' : 'false'}\n />\n );\n })}\n </g>\n );\n}\n\n/** Nice lengths a scale bar may take, in metres. */\nconst SCALE_STEPS = [50, 100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000];\n\n/** The longest nice length that fits in a quarter of the drawing's width. */\nexport function scaleMetres(view: PlaneBox): number {\n const quarter = view.spanX / 4;\n return SCALE_STEPS.filter((step) => step <= quarter).at(-1) ?? SCALE_STEPS[0]!;\n}\n\n/**\n * A scale bar, bottom-left, when the host gives `copy.scale`. It reads what is\n * on screen: a host that zooms the drawing's layers (a CSS scale on the SVG)\n * shows fewer metres per pixel, so after every render the bar compares the\n * SVG's drawn width with its laid-out width — both off the SVG itself — and\n * spans the drawing's own width, so its share of it is a share of the view.\n */\nexport function ScaleBar({\n view,\n copy,\n svgRef,\n testId,\n theme,\n}: {\n view: PlaneBox;\n copy: RegionMapCopy;\n svgRef: React.RefObject<SVGSVGElement | null>;\n testId: string;\n theme: Theme;\n}): React.JSX.Element | null {\n // What the drawing shows on screen: its laid-out width, and its width as\n // drawn (a host's CSS scale on the SVG), both read off the SVG itself.\n const [screen, setScreen] = React.useState({ laidOut: 0, drawn: 0 });\n const wanted = copy.scale !== undefined;\n React.useLayoutEffect(() => {\n if (!wanted) return;\n const svg = svgRef.current;\n const next = { laidOut: svg?.clientWidth ?? 0, drawn: svg?.getBoundingClientRect().width ?? 0 };\n if (next.laidOut !== screen.laidOut || Math.abs(next.drawn - screen.drawn) > 0.5) setScreen(next);\n });\n if (!copy.scale) return null;\n const zoom = screen.laidOut > 0 && screen.drawn > 0 ? screen.drawn / screen.laidOut : 1;\n const metres = scaleMetres({ ...view, spanX: view.spanX / zoom });\n // The bar's share of the drawing's width: metres on screen over the metres the width shows.\n const share = (metres * zoom) / view.spanX;\n return (\n <Box\n data-testid={`${testId}-scale`}\n aria-hidden\n sx={{ position: 'absolute', left: 0, right: 0, bottom: rem(theme, 10), pointerEvents: 'none', zIndex: 1 }}\n >\n <Box component=\"span\" sx={{ display: 'block', ml: rem(theme, 10), fontSize: rem(theme, 11), color: 'text.secondary' }}>\n {copy.scale(metres)}\n </Box>\n <Box\n component=\"span\"\n sx={{ display: 'block', height: rem(theme, 4), ml: rem(theme, 10), width: `${(share * 100).toFixed(2)}%`, borderStyle: 'solid', borderWidth: `0 ${rem(theme, 1.5)} ${rem(theme, 1.5)}`, borderColor: 'text.secondary' }}\n />\n </Box>\n );\n}\n"],"mappings":";;;;;;;;AAAA,OAAO,SAAS;AAChB,SAAS,aAAyB;AAClC,OAAO,WAAW;AAsCmB,wBAGjC,YAHiC;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YAAY,MAAM,GAAG,OAAO,GAAG,QAAQ,IAAI,OAAO,EAAE,GAAG,eAAe,QAAQ,QAAQ,EAAE;AAAA,MAExG;AAAA,4BAAC,OAAI,WAAU,QAAO,IAAI,EAAE,SAAS,SAAS,IAAI,IAAI,OAAO,EAAE,GAAG,UAAU,IAAI,OAAO,EAAE,GAAG,OAAO,iBAAiB,GACjH,eAAK,MAAM,MAAM,GACpB;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,WAAU;AAAA,YACV,IAAI,EAAE,SAAS,SAAS,QAAQ,IAAI,OAAO,CAAC,GAAG,IAAI,IAAI,OAAO,EAAE,GAAG,OAAO,IAAI,QAAQ,KAAK,QAAQ,CAAC,CAAC,KAAK,aAAa,SAAS,aAAa,KAAK,IAAI,OAAO,GAAG,CAAC,IAAI,IAAI,OAAO,GAAG,CAAC,IAAI,aAAa,iBAAiB;AAAA;AAAA,QACxN;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
@@ -1,10 +1,10 @@
1
- import {
2
- MapLayers
3
- } from "./chunk-HCTHY66U.js";
4
1
  import {
5
2
  MapCoordinates,
6
3
  MapMarkers
7
4
  } from "./chunk-4Y3QLISA.js";
5
+ import {
6
+ MapLayers
7
+ } from "./chunk-KAGXV3ID.js";
8
8
  import {
9
9
  glassStyles,
10
10
  resolveMapCopy,
@@ -113,4 +113,4 @@ export {
113
113
  MapPreview,
114
114
  MapPreview_default
115
115
  };
116
- //# sourceMappingURL=chunk-ZW7Q3IRL.js.map
116
+ //# sourceMappingURL=chunk-FYJL432J.js.map
@@ -1,3 +1,13 @@
1
+ import {
2
+ useTextFit
3
+ } from "./chunk-WG7CAT5D.js";
4
+ import {
5
+ formatHour,
6
+ formatRange,
7
+ hitBoundsOf,
8
+ percentOf,
9
+ ticksOf
10
+ } from "./chunk-L5CAHQIN.js";
1
11
  import {
2
12
  actionsSx,
3
13
  actualLabelSx,
@@ -18,16 +28,6 @@ import {
18
28
  import {
19
29
  DAY_RULER_METRICS
20
30
  } from "./chunk-273OLFJD.js";
21
- import {
22
- useTextFit
23
- } from "./chunk-WG7CAT5D.js";
24
- import {
25
- formatHour,
26
- formatRange,
27
- hitBoundsOf,
28
- percentOf,
29
- ticksOf
30
- } from "./chunk-L5CAHQIN.js";
31
31
  import {
32
32
  ScheduleNameCell
33
33
  } from "./chunk-CGS2LQE5.js";
@@ -228,4 +228,4 @@ export {
228
228
  Coverage,
229
229
  Axis
230
230
  };
231
- //# sourceMappingURL=chunk-G6TKWNF2.js.map
231
+ //# sourceMappingURL=chunk-GZITNT7O.js.map
@@ -1,3 +1,6 @@
1
+ import {
2
+ useHoverCard
3
+ } from "./chunk-Z3USLQQT.js";
1
4
  import {
2
5
  HoverCardContent
3
6
  } from "./chunk-NRIV2CQ2.js";
@@ -8,9 +11,6 @@ import {
8
11
  getTransformOrigin,
9
12
  sideOf
10
13
  } from "./chunk-ABF64CAQ.js";
11
- import {
12
- useHoverCard
13
- } from "./chunk-Z3USLQQT.js";
14
14
  import {
15
15
  withDefaults
16
16
  } from "./chunk-HPK33ACY.js";
@@ -191,4 +191,4 @@ HoverCard.displayName = "HoverCard";
191
191
  export {
192
192
  HoverCard
193
193
  };
194
- //# sourceMappingURL=chunk-RFMQBIE6.js.map
194
+ //# sourceMappingURL=chunk-HBHBRRSW.js.map
@@ -1,6 +1,3 @@
1
- import {
2
- DAY_RULER_METRICS
3
- } from "./chunk-273OLFJD.js";
4
1
  import {
5
2
  clamp,
6
3
  formatRange,
@@ -8,6 +5,9 @@ import {
8
5
  resized,
9
6
  snapTo
10
7
  } from "./chunk-L5CAHQIN.js";
8
+ import {
9
+ DAY_RULER_METRICS
10
+ } from "./chunk-273OLFJD.js";
11
11
 
12
12
  // src/components/data-display/DayRuler/DayRuler.keyboard.ts
13
13
  function gestureOf(event, block, can) {
@@ -59,4 +59,4 @@ export {
59
59
  handleBlockKey,
60
60
  keyCreateSpan
61
61
  };
62
- //# sourceMappingURL=chunk-U4Z6GZDW.js.map
62
+ //# sourceMappingURL=chunk-HN36UVOE.js.map
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  PillControl
3
3
  } from "./chunk-XA5ES25V.js";
4
- import {
5
- QuickRow
6
- } from "./chunk-AT6UKTH4.js";
7
4
  import {
8
5
  isQuickActive
9
6
  } from "./chunk-KYUEO2IO.js";
10
7
  import {
11
8
  RangeBounds
12
9
  } from "./chunk-FW5GTAUY.js";
10
+ import {
11
+ QuickRow
12
+ } from "./chunk-AT6UKTH4.js";
13
13
  import {
14
14
  isRangeSet
15
15
  } from "./chunk-GCZJH4XL.js";
@@ -278,4 +278,4 @@ export {
278
278
  clearTargetSx,
279
279
  MoreGroup
280
280
  };
281
- //# sourceMappingURL=chunk-WK577LQL.js.map
281
+ //# sourceMappingURL=chunk-J2IQ6FJ5.js.map
@@ -4,13 +4,13 @@ import {
4
4
  import {
5
5
  MapSearchBar
6
6
  } from "./chunk-MIUPTZS6.js";
7
+ import {
8
+ resolveMapCopy
9
+ } from "./chunk-ZX4ORMBC.js";
7
10
  import {
8
11
  HeatmapOverlay,
9
12
  RouteOverlay
10
13
  } from "./chunk-ZZ4MMUBY.js";
11
- import {
12
- resolveMapCopy
13
- } from "./chunk-ZX4ORMBC.js";
14
14
  import {
15
15
  HEATMAP_VIEWBOX
16
16
  } from "./chunk-H2J2MTRE.js";
@@ -59,4 +59,4 @@ var MapLayers = ({ settings, zoom, mapType, search, controls }) => {
59
59
  export {
60
60
  MapLayers
61
61
  };
62
- //# sourceMappingURL=chunk-HCTHY66U.js.map
62
+ //# sourceMappingURL=chunk-KAGXV3ID.js.map
@@ -4,7 +4,7 @@ import {
4
4
  projectRings,
5
5
  projectionAt,
6
6
  viewBoxFor
7
- } from "./chunk-COOSJKZL.js";
7
+ } from "./chunk-MNJZPJ5S.js";
8
8
 
9
9
  // src/components/data-display/RegionMap/RegionMap.view.ts
10
10
  function unionBox(boxes) {
@@ -69,4 +69,4 @@ export {
69
69
  centreOf,
70
70
  regionMapView
71
71
  };
72
- //# sourceMappingURL=chunk-FWAY2SAI.js.map
72
+ //# sourceMappingURL=chunk-KAZWBDIH.js.map
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  handleBlockKey,
3
3
  keyCreateSpan
4
- } from "./chunk-U4Z6GZDW.js";
4
+ } from "./chunk-HN36UVOE.js";
5
5
  import {
6
6
  GroupFooter
7
- } from "./chunk-MPVH2GM5.js";
7
+ } from "./chunk-RAQD5QCM.js";
8
8
  import {
9
9
  EN_US_DAY_RULER_LABELS
10
10
  } from "./chunk-F2ZUUEXC.js";
11
11
  import {
12
12
  useRulerDrag
13
- } from "./chunk-KXDLLS62.js";
13
+ } from "./chunk-REHGWN5M.js";
14
14
  import {
15
15
  Axis,
16
16
  Coverage,
17
17
  RulerRow
18
- } from "./chunk-G6TKWNF2.js";
18
+ } from "./chunk-GZITNT7O.js";
19
19
  import {
20
20
  groupTitleSx,
21
21
  rootSx,
@@ -127,4 +127,4 @@ function DayRuler(props) {
127
127
  export {
128
128
  DayRuler
129
129
  };
130
- //# sourceMappingURL=chunk-DKPELKGL.js.map
130
+ //# sourceMappingURL=chunk-KV7LTOWC.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  MapPreview
3
- } from "./chunk-ZW7Q3IRL.js";
3
+ } from "./chunk-FYJL432J.js";
4
4
 
5
5
  // src/components/data-display/FleetMap/FleetCanvas.tsx
6
6
  import Box from "@mui/material/Box/index.js";
@@ -38,4 +38,4 @@ function FleetCanvas({
38
38
  export {
39
39
  FleetCanvas
40
40
  };
41
- //# sourceMappingURL=chunk-UC7DLGMP.js.map
41
+ //# sourceMappingURL=chunk-KVP5A3YK.js.map
@@ -0,0 +1,41 @@
1
+ import {
2
+ ACTIVE,
3
+ ALERT_EASING,
4
+ POINTER_INK_STEP,
5
+ seconds
6
+ } from "./chunk-TBQR5VCN.js";
7
+ import {
8
+ absoluteInk
9
+ } from "./chunk-XJAD6E3V.js";
10
+
11
+ // src/components/data-display/Alert/Alert.ink.ts
12
+ var ALERT_DESCRIPTION_CLASS = "alert-description";
13
+ var ALERT_CHILDREN_CLASS = "alert-children";
14
+ var MESSAGE_INK = `& .MuiAlertTitle-root, & .${ALERT_DESCRIPTION_CLASS}, & .${ALERT_CHILDREN_CLASS}`;
15
+ function inkAbsolute(theme, variant) {
16
+ if (variant === "gradient") return null;
17
+ return theme.palette.mode === "dark" ? "white" : "black";
18
+ }
19
+ function steppedInkCss(absolute, step) {
20
+ return `color-mix(in srgb, currentColor ${Math.round((1 - step) * 100)}%, ${absolute})`;
21
+ }
22
+ function pointerInkStyles(theme, variant) {
23
+ const side = inkAbsolute(theme, variant);
24
+ if (side === null) return { rest: {}, hover: {}, press: {} };
25
+ const absolute = absoluteInk(theme)[side];
26
+ const at = (state) => steppedInkCss(absolute, POINTER_INK_STEP[state][side]);
27
+ return {
28
+ rest: { [MESSAGE_INK]: { transition: `color ${seconds(ACTIVE.ms)} ${ALERT_EASING}` } },
29
+ hover: { [MESSAGE_INK]: { color: at("hover") } },
30
+ press: { [MESSAGE_INK]: { color: at("press"), transition: "none" } }
31
+ };
32
+ }
33
+
34
+ export {
35
+ ALERT_DESCRIPTION_CLASS,
36
+ ALERT_CHILDREN_CLASS,
37
+ inkAbsolute,
38
+ steppedInkCss,
39
+ pointerInkStyles
40
+ };
41
+ //# sourceMappingURL=chunk-LNZJJFZQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/data-display/Alert/Alert.ink.ts"],"sourcesContent":["import type { CSSObject, Theme } from '@mui/material/styles/index.js';\n\nimport { absoluteInk } from '../../../tokens/ink';\n\nimport { ACTIVE, ALERT_EASING, POINTER_INK_STEP, seconds } from './Alert.metrics';\n\n/**\n * THE INK HALF OF THE POINTER STATES (FUT-4506, option C).\n *\n * The hover and press tint (`pointerShadow` in `Alert.tsx`) moves the SURFACE\n * toward an absolute. On every surface that tracks the mode that is the side\n * the ink is on, so the gap the message is read across closed under the\n * pointer — a host summary at 4.71:1 idle fell to 3.17:1 pressed. These rules\n * move the INK further the same way, by {@link POINTER_INK_STEP}, so it\n * re-opens.\n */\n\n/** The summary's class, so the pointer states can reach it without a test id. */\nexport const ALERT_DESCRIPTION_CLASS = 'alert-description';\n/**\n * The wrapper `AlertContent` puts around `children`, at `display: contents`:\n * no box of its own, so the column's flex layout is what it was, and a bare\n * text node still inherits its colour.\n */\nexport const ALERT_CHILDREN_CLASS = 'alert-children';\n\n/**\n * What steps: the WORDS of the message — the title, the description and\n * whatever the caller passed as `children` — each one step, none nested in\n * another. Stepping only the title and the description left a children-only\n * alert (about one in six in the first host measured) at its rest ink under\n * the press tint.\n *\n * Not the whole message column, because the column is not only words: with\n * `iconPlacement: 'title'` the icon sits in it, on the title's row, beside\n * `.MuiAlertTitle-root` rather than inside it. The icon is the variant's\n * meaning, not an affordance, so it stays still in both placements; the close\n * button (`.MuiAlert-action`) is outside the column altogether. A control\n * inside `children` keeps its own colour, because it declares one; only a\n * `color=\"inherit\"` one follows the step, on the same tinted surface as the\n * words around it.\n */\nconst MESSAGE_INK = `& .MuiAlertTitle-root, & .${ALERT_DESCRIPTION_CLASS}, & .${ALERT_CHILDREN_CLASS}`;\n\nexport type PointerInkState = keyof typeof POINTER_INK_STEP;\nexport type InkAbsolute = 'black' | 'white';\n\n/**\n * The absolute the ink steps toward — the mode's, the side the ink is on — or\n * `null` for `gradient`, which does not step at all.\n *\n * Every other variant's surface tracks the mode: a dark ink on a light tint,\n * a light ink on a dark one, so the step is toward black in light mode and\n * toward white in dark, the same absolute the tint layer moves the surface to.\n *\n * `gradient` is the one surface where the package cannot know which side its\n * ink is on. Its own ink is `getContrastText` of the hue, but a host that\n * repaints alerts repaints the gradient too: a light pane and a dark ink under\n * the variant's BLACK layer. Stepping by the package's own ink then moved that\n * dark ink toward white — 1.02:1 pressed. A step that reads `currentColor` for\n * its amount but not for its direction is only safe where the direction is the\n * mode's, so `gradient` keeps today's ink. Its rest contrast and its dark ink\n * on dark mode's light hues are FUT-4516's.\n */\nexport function inkAbsolute(theme: Theme, variant: string | undefined): InkAbsolute | null {\n if (variant === 'gradient') return null;\n return theme.palette.mode === 'dark' ? 'white' : 'black';\n}\n\n/**\n * The CSS for the ink at one pointer state: the ink actually painted\n * (`currentColor`, inherited from the root — a host's repaint included) mixed\n * toward the absolute by the state's step.\n *\n * `currentColor` in a `color` declaration is the PARENT's colour, which is why\n * this sits on the message's parts and never on the root: on the root it would\n * read the page's text colour instead of the alert's ink. None of the three\n * parts is nested in another, so nothing steps twice.\n */\nexport function steppedInkCss(absolute: string, step: number): string {\n return `color-mix(in srgb, currentColor ${Math.round((1 - step) * 100)}%, ${absolute})`;\n}\n\n/**\n * The three pieces of the ink's pointer behaviour, spread into the root's\n * blocks by `Alert.tsx`:\n *\n * - `rest` eases the ink on the box-shadow's own clock, so ink and tint arrive\n * together rather than the ink snapping while the surface eases;\n * - `hover` and `press` step it. The press declares `transition: none` for the\n * same reason the root's `:active` does: a click's `:active` is too short to\n * ease into. A `:hover` block declares no transition, ever (see `ACTIVE`).\n *\n * All three are empty for a variant that does not step.\n */\nexport function pointerInkStyles(theme: Theme, variant: string | undefined): Record<'rest' | PointerInkState, CSSObject> {\n const side = inkAbsolute(theme, variant);\n if (side === null) return { rest: {}, hover: {}, press: {} };\n const absolute = absoluteInk(theme)[side];\n const at = (state: PointerInkState): string => steppedInkCss(absolute, POINTER_INK_STEP[state][side]);\n return {\n rest: { [MESSAGE_INK]: { transition: `color ${seconds(ACTIVE.ms)} ${ALERT_EASING}` } },\n hover: { [MESSAGE_INK]: { color: at('hover') } },\n press: { [MESSAGE_INK]: { color: at('press'), transition: 'none' } },\n };\n}\n"],"mappings":";;;;;;;;;;;AAkBO,IAAM,0BAA0B;AAMhC,IAAM,uBAAuB;AAkBpC,IAAM,cAAc,6BAA6B,uBAAuB,QAAQ,oBAAoB;AAsB7F,SAAS,YAAY,OAAc,SAAiD;AACzF,MAAI,YAAY,WAAY,QAAO;AACnC,SAAO,MAAM,QAAQ,SAAS,SAAS,UAAU;AACnD;AAYO,SAAS,cAAc,UAAkB,MAAsB;AACpE,SAAO,mCAAmC,KAAK,OAAO,IAAI,QAAQ,GAAG,CAAC,MAAM,QAAQ;AACtF;AAcO,SAAS,iBAAiB,OAAc,SAA0E;AACvH,QAAM,OAAO,YAAY,OAAO,OAAO;AACvC,MAAI,SAAS,KAAM,QAAO,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,GAAG,OAAO,CAAC,EAAE;AAC3D,QAAM,WAAW,YAAY,KAAK,EAAE,IAAI;AACxC,QAAM,KAAK,CAAC,UAAmC,cAAc,UAAU,iBAAiB,KAAK,EAAE,IAAI,CAAC;AACpG,SAAO;AAAA,IACL,MAAM,EAAE,CAAC,WAAW,GAAG,EAAE,YAAY,SAAS,QAAQ,OAAO,EAAE,CAAC,IAAI,YAAY,GAAG,EAAE;AAAA,IACrF,OAAO,EAAE,CAAC,WAAW,GAAG,EAAE,OAAO,GAAG,OAAO,EAAE,EAAE;AAAA,IAC/C,OAAO,EAAE,CAAC,WAAW,GAAG,EAAE,OAAO,GAAG,OAAO,GAAG,YAAY,OAAO,EAAE;AAAA,EACrE;AACF;","names":[]}
@@ -5,6 +5,10 @@ import {
5
5
  import {
6
6
  filterRows
7
7
  } from "./chunk-YGQX7BNI.js";
8
+ import {
9
+ resolveScope,
10
+ useScopeConfigChecks
11
+ } from "./chunk-PL2AB5HJ.js";
8
12
  import {
9
13
  serverDerived,
10
14
  useServerQuery
@@ -12,10 +16,6 @@ import {
12
16
  import {
13
17
  useSelection
14
18
  } from "./chunk-LLZWB32X.js";
15
- import {
16
- resolveScope,
17
- useScopeConfigChecks
18
- } from "./chunk-PL2AB5HJ.js";
19
19
  import {
20
20
  useClearFilters,
21
21
  useStateWriters
@@ -178,4 +178,4 @@ function useDataViewsState({
178
178
  export {
179
179
  useDataViewsState
180
180
  };
181
- //# sourceMappingURL=chunk-EGBQR5GH.js.map
181
+ //# sourceMappingURL=chunk-LOLYBFYY.js.map