@timefoldai/viz-react 0.0.0-stage → 0.1.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 (289) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +240 -2
  3. package/dist/THIRD-PARTY-NOTICES.txt +99 -0
  4. package/dist/a11y/AccessibleTable.d.mts +42 -0
  5. package/dist/a11y/AccessibleTable.mjs +82 -0
  6. package/dist/a11y/activation.d.mts +4 -0
  7. package/dist/a11y/activation.mjs +0 -0
  8. package/dist/analytics/AnalyticsProvider.d.mts +16 -0
  9. package/dist/analytics/AnalyticsProvider.mjs +32 -0
  10. package/dist/assets/Inter-latin-ext.woff2 +0 -0
  11. package/dist/badge/Badge.css +122 -0
  12. package/dist/badge/Badge.d.mts +50 -0
  13. package/dist/badge/Badge.mjs +145 -0
  14. package/dist/badge/Badge.module.css.mjs +15 -0
  15. package/dist/badge/BadgeFacetGroup.d.mts +23 -0
  16. package/dist/badge/BadgeFacetGroup.mjs +220 -0
  17. package/dist/badge/BadgeGroup.d.mts +13 -0
  18. package/dist/badge/BadgeGroup.mjs +53 -0
  19. package/dist/badge/BadgeList.d.mts +14 -0
  20. package/dist/badge/BadgeList.mjs +15 -0
  21. package/dist/badge/badge-facet-fit.d.mts +18 -0
  22. package/dist/badge/badge-facet-fit.mjs +50 -0
  23. package/dist/badge/badge-item.d.mts +19 -0
  24. package/dist/badge/badge-item.mjs +23 -0
  25. package/dist/button/CopyButton.d.mts +12 -0
  26. package/dist/button/CopyButton.mjs +52 -0
  27. package/dist/button/ShowAllButton.d.mts +14 -0
  28. package/dist/button/ShowAllButton.mjs +61 -0
  29. package/dist/button/ShowMoreButton.d.mts +13 -0
  30. package/dist/button/ShowMoreButton.mjs +51 -0
  31. package/dist/button/SolveButton.d.mts +16 -0
  32. package/dist/button/SolveButton.mjs +56 -0
  33. package/dist/charts/BarChart.css +59 -0
  34. package/dist/charts/BarChart.d.mts +26 -0
  35. package/dist/charts/BarChart.mjs +167 -0
  36. package/dist/charts/BarChart.module.css.mjs +10 -0
  37. package/dist/charts/ChartGrid.d.mts +8 -0
  38. package/dist/charts/ChartGrid.mjs +47 -0
  39. package/dist/charts/DistributionChart.d.mts +60 -0
  40. package/dist/charts/DistributionChart.mjs +151 -0
  41. package/dist/code/CodeBlock.d.mts +13 -0
  42. package/dist/code/CodeBlock.mjs +71 -0
  43. package/dist/composition-bar/CompositionBar.d.mts +24 -0
  44. package/dist/composition-bar/CompositionBar.mjs +124 -0
  45. package/dist/composition-bar/composition-shares.d.mts +8 -0
  46. package/dist/composition-bar/composition-shares.mjs +30 -0
  47. package/dist/data-gate/DataGate.d.mts +34 -0
  48. package/dist/data-gate/DataGate.mjs +80 -0
  49. package/dist/date-scope/DateScope.d.mts +30 -0
  50. package/dist/date-scope/DateScope.mjs +285 -0
  51. package/dist/design-system/part-props.d.mts +39 -0
  52. package/dist/design-system/part-props.mjs +0 -0
  53. package/dist/detail-panel/DetailPanel.d.mts +22 -0
  54. package/dist/detail-panel/DetailPanel.mjs +80 -0
  55. package/dist/detail-panel/DetailPanelSection.d.mts +20 -0
  56. package/dist/detail-panel/DetailPanelSection.mjs +27 -0
  57. package/dist/detail-panel/micro-label.d.mts +7 -0
  58. package/dist/detail-panel/micro-label.mjs +9 -0
  59. package/dist/env.d.mts +2 -0
  60. package/dist/env.mjs +4 -0
  61. package/dist/export/ExportCsvButton.d.mts +19 -0
  62. package/dist/export/ExportCsvButton.mjs +73 -0
  63. package/dist/export/download-csv.d.mts +5 -0
  64. package/dist/export/download-csv.mjs +11 -0
  65. package/dist/export/download-file.d.mts +11 -0
  66. package/dist/export/download-file.mjs +32 -0
  67. package/dist/export/download-json.d.mts +2 -0
  68. package/dist/export/download-json.mjs +8 -0
  69. package/dist/filter/FilterGroup.d.mts +24 -0
  70. package/dist/filter/FilterGroup.mjs +71 -0
  71. package/dist/filter/FilterGroupTitle.d.mts +3 -0
  72. package/dist/filter/FilterGroupTitle.mjs +18 -0
  73. package/dist/filter/FilterItem.d.mts +17 -0
  74. package/dist/filter/FilterItem.mjs +94 -0
  75. package/dist/filter/FilterPanel.d.mts +22 -0
  76. package/dist/filter/FilterPanel.mjs +158 -0
  77. package/dist/filter/FilterToggleButton.d.mts +15 -0
  78. package/dist/filter/FilterToggleButton.mjs +30 -0
  79. package/dist/filter/date-range.d.mts +8 -0
  80. package/dist/filter/date-range.mjs +13 -0
  81. package/dist/filter/filter-facet.d.mts +7 -0
  82. package/dist/filter/filter-facet.mjs +0 -0
  83. package/dist/heatmap/Heatmap.css +138 -0
  84. package/dist/heatmap/Heatmap.d.mts +10 -0
  85. package/dist/heatmap/Heatmap.mjs +370 -0
  86. package/dist/heatmap/Heatmap.module.css.mjs +17 -0
  87. package/dist/heatmap/HeatmapCell.d.mts +25 -0
  88. package/dist/heatmap/HeatmapCell.mjs +124 -0
  89. package/dist/heatmap/heatmap-scale.d.mts +19 -0
  90. package/dist/heatmap/heatmap-scale.mjs +43 -0
  91. package/dist/heatmap/heatmap-types.d.mts +49 -0
  92. package/dist/heatmap/heatmap-types.mjs +0 -0
  93. package/dist/hooks/use-controllable-state.d.mts +9 -0
  94. package/dist/hooks/use-controllable-state.mjs +44 -0
  95. package/dist/hooks/use-debounced-value.d.mts +1 -0
  96. package/dist/hooks/use-debounced-value.mjs +27 -0
  97. package/dist/hooks/use-detail-panel-layout.d.mts +18 -0
  98. package/dist/hooks/use-detail-panel-layout.mjs +94 -0
  99. package/dist/hooks/use-hover-card.d.mts +47 -0
  100. package/dist/hooks/use-hover-card.mjs +190 -0
  101. package/dist/hooks/use-hover-focus-card.d.mts +38 -0
  102. package/dist/hooks/use-hover-focus-card.mjs +321 -0
  103. package/dist/hooks/use-hover-intent.d.mts +6 -0
  104. package/dist/hooks/use-hover-intent.mjs +55 -0
  105. package/dist/hooks/use-merged-ref.d.mts +2 -0
  106. package/dist/hooks/use-merged-ref.mjs +36 -0
  107. package/dist/hooks/use-tracked-anchor.d.mts +14 -0
  108. package/dist/hooks/use-tracked-anchor.mjs +42 -0
  109. package/dist/index.d.mts +97 -0
  110. package/dist/index.mjs +88 -0
  111. package/dist/input/MenuButton.d.mts +47 -0
  112. package/dist/input/MenuButton.mjs +152 -0
  113. package/dist/interval-strip/IntervalStrip.css +7 -0
  114. package/dist/interval-strip/IntervalStrip.d.mts +39 -0
  115. package/dist/interval-strip/IntervalStrip.mjs +233 -0
  116. package/dist/interval-strip/IntervalStrip.module.css.mjs +4 -0
  117. package/dist/interval-strip/IntervalStripAxis.d.mts +18 -0
  118. package/dist/interval-strip/IntervalStripAxis.mjs +73 -0
  119. package/dist/interval-strip/interval-fill.d.mts +2 -0
  120. package/dist/interval-strip/interval-fill.mjs +13 -0
  121. package/dist/interval-strip/interval-layout.d.mts +33 -0
  122. package/dist/interval-strip/interval-layout.mjs +79 -0
  123. package/dist/layout/AppShell.css +103 -0
  124. package/dist/layout/AppShell.d.mts +73 -0
  125. package/dist/layout/AppShell.mjs +397 -0
  126. package/dist/layout/AppShell.module.css.mjs +16 -0
  127. package/dist/layout/ColorSchemeMenu.d.mts +14 -0
  128. package/dist/layout/ColorSchemeMenu.mjs +92 -0
  129. package/dist/layout/DemoDataPicker.d.mts +17 -0
  130. package/dist/layout/DemoDataPicker.mjs +150 -0
  131. package/dist/layout/OverflowMenu.d.mts +11 -0
  132. package/dist/layout/OverflowMenu.mjs +94 -0
  133. package/dist/layout/SidebarLayout.css +70 -0
  134. package/dist/layout/SidebarLayout.d.mts +33 -0
  135. package/dist/layout/SidebarLayout.mjs +129 -0
  136. package/dist/layout/SidebarLayout.module.css.mjs +8 -0
  137. package/dist/layout/use-date-scope-day.d.mts +23 -0
  138. package/dist/layout/use-date-scope-day.mjs +63 -0
  139. package/dist/layout/use-fill-height.d.mts +7 -0
  140. package/dist/layout/use-fill-height.mjs +50 -0
  141. package/dist/layout/use-followed-state.d.mts +5 -0
  142. package/dist/layout/use-followed-state.mjs +75 -0
  143. package/dist/layout/use-page-route.d.mts +10 -0
  144. package/dist/layout/use-page-route.mjs +65 -0
  145. package/dist/legend/Legend.d.mts +54 -0
  146. package/dist/legend/Legend.mjs +132 -0
  147. package/dist/map/MapLayersControl.d.mts +11 -0
  148. package/dist/map/MapLayersControl.mjs +157 -0
  149. package/dist/map/MapLocator.css +9 -0
  150. package/dist/map/MapLocator.d.mts +18 -0
  151. package/dist/map/MapLocator.mjs +97 -0
  152. package/dist/map/MapLocator.module.css.mjs +4 -0
  153. package/dist/map/MapMarker.d.mts +29 -0
  154. package/dist/map/MapMarker.mjs +265 -0
  155. package/dist/map/MapStops.d.mts +19 -0
  156. package/dist/map/MapStops.mjs +355 -0
  157. package/dist/map/MapView.css +24 -0
  158. package/dist/map/MapView.d.mts +11 -0
  159. package/dist/map/MapView.mjs +141 -0
  160. package/dist/map/MapWebgl.d.mts +9 -0
  161. package/dist/map/MapWebgl.mjs +727 -0
  162. package/dist/map/area-layers.d.mts +33 -0
  163. package/dist/map/area-layers.mjs +96 -0
  164. package/dist/map/control-group.d.mts +6 -0
  165. package/dist/map/control-group.mjs +12 -0
  166. package/dist/map/for-each-chunk.d.mts +4 -0
  167. package/dist/map/for-each-chunk.mjs +14 -0
  168. package/dist/map/highlight.d.mts +30 -0
  169. package/dist/map/highlight.mjs +99 -0
  170. package/dist/map/locator-tile.d.mts +24 -0
  171. package/dist/map/locator-tile.mjs +41 -0
  172. package/dist/map/map-sites.d.mts +12 -0
  173. package/dist/map/map-sites.mjs +39 -0
  174. package/dist/map/map-style.d.mts +24 -0
  175. package/dist/map/map-style.mjs +79 -0
  176. package/dist/map/marker-geometry.d.mts +5 -0
  177. package/dist/map/marker-geometry.mjs +13 -0
  178. package/dist/map/marker-icon.d.mts +26 -0
  179. package/dist/map/marker-icon.mjs +223 -0
  180. package/dist/map/observe-color-scheme.d.mts +5 -0
  181. package/dist/map/observe-color-scheme.mjs +19 -0
  182. package/dist/map/popup-placement.d.mts +20 -0
  183. package/dist/map/popup-placement.mjs +20 -0
  184. package/dist/map/route-layers.d.mts +28 -0
  185. package/dist/map/route-layers.mjs +73 -0
  186. package/dist/map/types.d.mts +97 -0
  187. package/dist/map/types.mjs +0 -0
  188. package/dist/map/use-painted-color-scheme.d.mts +6 -0
  189. package/dist/map/use-painted-color-scheme.mjs +43 -0
  190. package/dist/map/use-resolved-colors.d.mts +5 -0
  191. package/dist/map/use-resolved-colors.mjs +63 -0
  192. package/dist/pagination/paginationLabels.d.mts +6 -0
  193. package/dist/pagination/paginationLabels.mjs +8 -0
  194. package/dist/popover/Popover.css +176 -0
  195. package/dist/popover/Popover.d.mts +239 -0
  196. package/dist/popover/Popover.mjs +672 -0
  197. package/dist/popover/Popover.module.css.mjs +18 -0
  198. package/dist/popover/PopoverFacts.d.mts +24 -0
  199. package/dist/popover/PopoverFacts.mjs +63 -0
  200. package/dist/readout/Readout.d.mts +15 -0
  201. package/dist/readout/Readout.mjs +53 -0
  202. package/dist/readout/TimeZoneReadout.d.mts +11 -0
  203. package/dist/readout/TimeZoneReadout.mjs +46 -0
  204. package/dist/score-box/ScoreBox.css +62 -0
  205. package/dist/score-box/ScoreBox.d.mts +12 -0
  206. package/dist/score-box/ScoreBox.mjs +143 -0
  207. package/dist/score-box/ScoreBox.module.css.mjs +15 -0
  208. package/dist/segment-bar/Segment.d.mts +23 -0
  209. package/dist/segment-bar/Segment.mjs +27 -0
  210. package/dist/segment-bar/SegmentBar.css +44 -0
  211. package/dist/segment-bar/SegmentBar.d.mts +35 -0
  212. package/dist/segment-bar/SegmentBar.mjs +57 -0
  213. package/dist/segment-bar/SegmentBar.module.css.mjs +9 -0
  214. package/dist/segment-bar/segment-box.d.mts +10 -0
  215. package/dist/segment-bar/segment-box.mjs +30 -0
  216. package/dist/stat/Stat.d.mts +25 -0
  217. package/dist/stat/Stat.mjs +36 -0
  218. package/dist/stat/StatTile.d.mts +18 -0
  219. package/dist/stat/StatTile.mjs +37 -0
  220. package/dist/styles.css +1 -0
  221. package/dist/swatch/Swatch.d.mts +8 -0
  222. package/dist/swatch/Swatch.mjs +30 -0
  223. package/dist/swatch/legend-swatch.d.mts +3 -0
  224. package/dist/swatch/legend-swatch.mjs +0 -0
  225. package/dist/tab-bar/FilteredTabBar.d.mts +32 -0
  226. package/dist/tab-bar/FilteredTabBar.mjs +181 -0
  227. package/dist/tab-bar/TabBar.d.mts +22 -0
  228. package/dist/tab-bar/TabBar.mjs +151 -0
  229. package/dist/tab-bar/TabPanel.d.mts +9 -0
  230. package/dist/tab-bar/TabPanel.mjs +55 -0
  231. package/dist/tab-bar/assert-named-value.d.mts +4 -0
  232. package/dist/tab-bar/assert-named-value.mjs +6 -0
  233. package/dist/table/DataTable.d.mts +31 -0
  234. package/dist/table/DataTable.mjs +43 -0
  235. package/dist/theme/use-color-scheme.d.mts +14 -0
  236. package/dist/theme/use-color-scheme.mjs +92 -0
  237. package/dist/theme.css +58 -0
  238. package/dist/timeline/Timeline.d.mts +54 -0
  239. package/dist/timeline/Timeline.mjs +220 -0
  240. package/dist/timeline/TimelineBand.d.mts +18 -0
  241. package/dist/timeline/TimelineBand.mjs +30 -0
  242. package/dist/timeline/TimelineGroup.d.mts +7 -0
  243. package/dist/timeline/TimelineGroup.mjs +50 -0
  244. package/dist/timeline/TimelineItem.d.mts +19 -0
  245. package/dist/timeline/TimelineItem.mjs +64 -0
  246. package/dist/timeline/TimelineItemChip.css +153 -0
  247. package/dist/timeline/TimelineItemChip.d.mts +23 -0
  248. package/dist/timeline/TimelineItemChip.mjs +74 -0
  249. package/dist/timeline/TimelineItemChip.module.css.mjs +15 -0
  250. package/dist/timeline/TimelineItemMark.css +38 -0
  251. package/dist/timeline/TimelineItemMark.d.mts +15 -0
  252. package/dist/timeline/TimelineItemMark.mjs +129 -0
  253. package/dist/timeline/TimelineItemMark.module.css.mjs +4 -0
  254. package/dist/timeline/TimelineRoot.d.mts +19 -0
  255. package/dist/timeline/TimelineRoot.mjs +742 -0
  256. package/dist/timeline/TimelineRowHeader.d.mts +23 -0
  257. package/dist/timeline/TimelineRowHeader.mjs +244 -0
  258. package/dist/timeline/TimelineZoomHint.d.mts +9 -0
  259. package/dist/timeline/TimelineZoomHint.mjs +32 -0
  260. package/dist/timeline/axis-label.d.mts +5 -0
  261. package/dist/timeline/axis-label.mjs +53 -0
  262. package/dist/timeline/batched-dataset-writer.d.mts +29 -0
  263. package/dist/timeline/batched-dataset-writer.mjs +58 -0
  264. package/dist/timeline/row-card-side.d.mts +7 -0
  265. package/dist/timeline/row-card-side.mjs +6 -0
  266. package/dist/timeline/timeline-a11y.d.mts +33 -0
  267. package/dist/timeline/timeline-a11y.mjs +96 -0
  268. package/dist/timeline/timeline-context.d.mts +33 -0
  269. package/dist/timeline/timeline-context.mjs +40 -0
  270. package/dist/timeline/timeline-types.d.mts +126 -0
  271. package/dist/timeline/timeline-types.mjs +0 -0
  272. package/dist/timeline/timeline-utils.d.mts +52 -0
  273. package/dist/timeline/timeline-utils.mjs +130 -0
  274. package/dist/timeline/zoom-modifier.d.mts +21 -0
  275. package/dist/timeline/zoom-modifier.mjs +25 -0
  276. package/dist/toast/ToastProvider.d.mts +33 -0
  277. package/dist/toast/ToastProvider.mjs +257 -0
  278. package/dist/toast/toast-context.d.mts +2 -0
  279. package/dist/toast/toast-context.mjs +5 -0
  280. package/dist/tokens.css +1 -0
  281. package/dist/tooltip/Tooltip.d.mts +17 -0
  282. package/dist/tooltip/Tooltip.mjs +41 -0
  283. package/dist/tooltip/hover-open-delay.d.mts +2 -0
  284. package/dist/tooltip/hover-open-delay.mjs +4 -0
  285. package/dist/tooltip/is-text-cut.d.mts +1 -0
  286. package/dist/tooltip/is-text-cut.mjs +5 -0
  287. package/dist/vendor/components.d.mts +664 -0
  288. package/dist/vendor/components.mjs +2060 -0
  289. package/package.json +61 -3
@@ -0,0 +1,132 @@
1
+ "use client";
2
+ import { intervalFillClass } from "../interval-strip/interval-fill.mjs";
3
+ import IntervalStrip_module_default from "../interval-strip/IntervalStrip.module.css.mjs";
4
+ import { c } from "react/compiler-runtime";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import clsx$1 from "clsx";
7
+ // src/legend/Legend.tsx
8
+ const ITEM_COLOR = {
9
+ default: "var(--viz-item-default)",
10
+ done: "var(--viz-item-done)",
11
+ overtime: "var(--viz-overtime)",
12
+ waiting: "var(--viz-item-waiting)",
13
+ positive: "var(--viz-item-positive)",
14
+ warning: "var(--viz-item-warning)",
15
+ negative: "var(--viz-item-negative)",
16
+ neutral: "var(--viz-item-neutral)"
17
+ };
18
+ /** An always-visible key for a chart's wordless marks: a timeline's band fills, or an interval strip's segment
19
+ * fills and gaps. A strip band's colour must read before the pointer finds it.
20
+ *
21
+ * @example
22
+ * ```tsx
23
+ * <Legend
24
+ * variant="timeline"
25
+ * entries={[
26
+ * { id: "preferred", label: "Preferred", state: "positive" },
27
+ * { id: "overlap", label: "Overlap", swatch: "hatch", state: "negative" },
28
+ * ]}
29
+ * />
30
+ * ```
31
+ *
32
+ * @category Charts
33
+ */
34
+ function Legend(props) {
35
+ const { "aria-label": ariaLabel = "Legend", className, style, ref } = props;
36
+ return /* @__PURE__ */ jsx("ul", {
37
+ ref,
38
+ style,
39
+ "data-slot": "legend",
40
+ "data-variant": props.variant,
41
+ "aria-label": ariaLabel,
42
+ className: clsx$1("flex list-none flex-wrap items-center gap-x-4 gap-y-1 p-0 text-xs", className),
43
+ children: props.variant === "timeline" ? props.entries.map((entry) => /* @__PURE__ */ jsx(TimelineLegendItem, { entry }, entry.id)) : props.entries.map((entry_0) => /* @__PURE__ */ jsx(IntervalStripLegendItem, { entry: entry_0 }, entry_0.id))
44
+ });
45
+ }
46
+ function TimelineLegendItem(t0) {
47
+ const $ = c(10);
48
+ const { entry } = t0;
49
+ const swatch = entry.swatch ?? "strip";
50
+ const t1 = swatch === "strip" || swatch === "solid" ? "h-[0.3125rem] w-5 shrink-0 rounded-[var(--tf-radius-xs)]" : "h-3.5 w-5 shrink-0 rounded-[var(--tf-radius-xs)]";
51
+ const t2 = ITEM_COLOR[entry.state ?? entry.variant ?? "default"];
52
+ let t3;
53
+ if ($[0] !== t2) {
54
+ t3 = { "--viz-timeline-item-color": t2 };
55
+ $[0] = t2;
56
+ $[1] = t3;
57
+ } else t3 = $[1];
58
+ const t4 = t3;
59
+ let t5;
60
+ if ($[2] !== swatch || $[3] !== t1 || $[4] !== t4) {
61
+ t5 = /* @__PURE__ */ jsx("span", {
62
+ "aria-hidden": "true",
63
+ "data-slot": "legend-swatch",
64
+ "data-swatch": swatch,
65
+ className: t1,
66
+ style: t4
67
+ });
68
+ $[2] = swatch;
69
+ $[3] = t1;
70
+ $[4] = t4;
71
+ $[5] = t5;
72
+ } else t5 = $[5];
73
+ let t6;
74
+ if ($[6] !== entry.id || $[7] !== entry.label || $[8] !== t5) {
75
+ t6 = /* @__PURE__ */ jsxs("li", {
76
+ "data-slot": "legend-entry",
77
+ "data-entry": entry.id,
78
+ className: "flex items-center gap-1.5",
79
+ children: [t5, entry.label]
80
+ });
81
+ $[6] = entry.id;
82
+ $[7] = entry.label;
83
+ $[8] = t5;
84
+ $[9] = t6;
85
+ } else t6 = $[9];
86
+ return t6;
87
+ }
88
+ function IntervalStripLegendItem(t0) {
89
+ const $ = c(11);
90
+ const { entry } = t0;
91
+ const t1 = entry.id;
92
+ const t2 = entry.swatch ?? "fill";
93
+ const t3 = entry.swatch === "hatch" ? void 0 : entry.variant ?? "subtle";
94
+ const t4 = entry.state;
95
+ let t5;
96
+ if ($[0] !== entry) {
97
+ t5 = clsx$1("h-3.5 w-5 shrink-0 rounded-sm", entry.swatch === "hatch" ? clsx$1(IntervalStrip_module_default.gap, "bg-viz-tint") : intervalFillClass(entry));
98
+ $[0] = entry;
99
+ $[1] = t5;
100
+ } else t5 = $[1];
101
+ let t6;
102
+ if ($[2] !== entry.state || $[3] !== t2 || $[4] !== t3 || $[5] !== t5) {
103
+ t6 = /* @__PURE__ */ jsx("span", {
104
+ "aria-hidden": "true",
105
+ "data-slot": "legend-swatch",
106
+ "data-swatch": t2,
107
+ "data-variant": t3,
108
+ "data-state": t4,
109
+ className: t5
110
+ });
111
+ $[2] = entry.state;
112
+ $[3] = t2;
113
+ $[4] = t3;
114
+ $[5] = t5;
115
+ $[6] = t6;
116
+ } else t6 = $[6];
117
+ let t7;
118
+ if ($[7] !== entry.id || $[8] !== entry.label || $[9] !== t6) {
119
+ t7 = /* @__PURE__ */ jsxs("li", {
120
+ "data-slot": "legend-entry",
121
+ "data-entry": t1,
122
+ className: "flex items-center gap-1.5",
123
+ children: [t6, entry.label]
124
+ });
125
+ $[7] = entry.id;
126
+ $[8] = entry.label;
127
+ $[9] = t6;
128
+ $[10] = t7;
129
+ } else t7 = $[10];
130
+ return t7;
131
+ }
132
+ export { Legend as default };
@@ -0,0 +1,11 @@
1
+ import { MapAreaLayer } from "./types.mjs";
2
+ /**
3
+ * The map's layers button, in the bottom-right controls, and its panel: one row per layer, pressed while it shows.
4
+ *
5
+ * @see https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/
6
+ */
7
+ export default function MapLayersControl({ layers, hidden, onToggle }: {
8
+ layers: readonly MapAreaLayer[];
9
+ hidden: ReadonlySet<string>;
10
+ onToggle: (layerId: string) => void;
11
+ }): import("react").ReactPortal;
@@ -0,0 +1,157 @@
1
+ "use client";
2
+ import { createControlGroup } from "./control-group.mjs";
3
+ import { c } from "react/compiler-runtime";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { useId } from "react";
6
+ import { Popover, PopoverContent, PopoverTrigger } from "../vendor/components.mjs";
7
+ import { OVERLAY_ATTRIBUTE } from "@timefoldai/viz-core";
8
+ import { createPortal } from "react-dom";
9
+ import { TbEye, TbEyeOff, TbStack2 } from "react-icons/tb";
10
+ import { useControl } from "react-map-gl/maplibre";
11
+ // src/map/MapLayersControl.tsx
12
+ function AreaGlyph(t0) {
13
+ const $ = c(2);
14
+ const { variant } = t0;
15
+ let t1;
16
+ if ($[0] !== variant) {
17
+ t1 = /* @__PURE__ */ jsx("svg", {
18
+ viewBox: "0 0 16 16",
19
+ className: "size-4 shrink-0",
20
+ "aria-hidden": "true",
21
+ "data-slot": "map-view-layer-glyph",
22
+ children: variant === "filled" ? /* @__PURE__ */ jsx("rect", {
23
+ x: "2",
24
+ y: "2",
25
+ width: "12",
26
+ height: "12",
27
+ rx: "1.5",
28
+ fill: "currentColor",
29
+ fillOpacity: "0.16",
30
+ stroke: "currentColor",
31
+ strokeWidth: "1.5"
32
+ }) : /* @__PURE__ */ jsx("rect", {
33
+ x: "2",
34
+ y: "2",
35
+ width: "12",
36
+ height: "12",
37
+ rx: "1.5",
38
+ fill: "none",
39
+ stroke: "currentColor",
40
+ strokeWidth: "1.75",
41
+ strokeDasharray: "0 3",
42
+ strokeLinecap: "round"
43
+ })
44
+ });
45
+ $[0] = variant;
46
+ $[1] = t1;
47
+ } else t1 = $[1];
48
+ return t1;
49
+ }
50
+ /**
51
+ * The map's layers button, in the bottom-right controls, and its panel: one row per layer, pressed while it shows.
52
+ *
53
+ * @see https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/
54
+ */
55
+ function MapLayersControl(t0) {
56
+ const $ = c(19);
57
+ const { layers, hidden, onToggle } = t0;
58
+ const titleId = useId();
59
+ let t1;
60
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
61
+ t1 = { position: "bottom-right" };
62
+ $[0] = t1;
63
+ } else t1 = $[0];
64
+ const { element } = useControl(createControlGroup, t1);
65
+ let t2;
66
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
67
+ t2 = /* @__PURE__ */ jsx(PopoverTrigger, {
68
+ "aria-label": "Map layers",
69
+ children: /* @__PURE__ */ jsx("span", {
70
+ className: "flex size-full items-center justify-center text-[var(--viz-map-control-ink)]",
71
+ children: /* @__PURE__ */ jsx(TbStack2, {
72
+ className: "size-4.5",
73
+ "aria-hidden": "true"
74
+ })
75
+ })
76
+ });
77
+ $[1] = t2;
78
+ } else t2 = $[1];
79
+ let t3;
80
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
81
+ t3 = { [OVERLAY_ATTRIBUTE]: "" };
82
+ $[2] = t3;
83
+ } else t3 = $[2];
84
+ let t4;
85
+ if ($[3] !== titleId) {
86
+ t4 = /* @__PURE__ */ jsx("h2", {
87
+ id: titleId,
88
+ className: "text-viz-muted m-0 px-3 pt-1 pb-1.5 text-xs font-medium",
89
+ children: "Layers"
90
+ });
91
+ $[3] = titleId;
92
+ $[4] = t4;
93
+ } else t4 = $[4];
94
+ let t5;
95
+ if ($[5] !== hidden || $[6] !== layers || $[7] !== onToggle) {
96
+ let t6;
97
+ if ($[9] !== hidden || $[10] !== onToggle) {
98
+ t6 = (layer) => {
99
+ const isShown = !hidden.has(layer.id);
100
+ const Eye = isShown ? TbEye : TbEyeOff;
101
+ return /* @__PURE__ */ jsxs("button", {
102
+ type: "button",
103
+ "aria-pressed": isShown,
104
+ "data-slot": "map-view-layer",
105
+ onClick: () => onToggle(layer.id),
106
+ className: "hover:bg-muted focus-visible:bg-muted aria-[pressed=false]:text-viz-muted flex h-8 items-center gap-2.5 px-3 text-left outline-none",
107
+ children: [
108
+ /* @__PURE__ */ jsx(AreaGlyph, { variant: layer.variant }),
109
+ /* @__PURE__ */ jsx("span", {
110
+ className: "flex-1",
111
+ children: layer.label
112
+ }),
113
+ /* @__PURE__ */ jsx(Eye, {
114
+ className: "size-4",
115
+ "aria-hidden": "true"
116
+ })
117
+ ]
118
+ }, layer.id);
119
+ };
120
+ $[9] = hidden;
121
+ $[10] = onToggle;
122
+ $[11] = t6;
123
+ } else t6 = $[11];
124
+ t5 = layers.map(t6);
125
+ $[5] = hidden;
126
+ $[6] = layers;
127
+ $[7] = onToggle;
128
+ $[8] = t5;
129
+ } else t5 = $[8];
130
+ let t6;
131
+ if ($[12] !== t4 || $[13] !== t5 || $[14] !== titleId) {
132
+ t6 = /* @__PURE__ */ jsxs(Popover, { children: [t2, /* @__PURE__ */ jsxs(PopoverContent, {
133
+ side: "left",
134
+ align: "end",
135
+ sideOffset: 10,
136
+ padding: "none",
137
+ "aria-labelledby": titleId,
138
+ "data-slot": "map-view-layers",
139
+ ...t3,
140
+ className: "flex w-56 flex-col py-1.5",
141
+ children: [t4, t5]
142
+ })] });
143
+ $[12] = t4;
144
+ $[13] = t5;
145
+ $[14] = titleId;
146
+ $[15] = t6;
147
+ } else t6 = $[15];
148
+ let t7;
149
+ if ($[16] !== element || $[17] !== t6) {
150
+ t7 = createPortal(t6, element);
151
+ $[16] = element;
152
+ $[17] = t6;
153
+ $[18] = t7;
154
+ } else t7 = $[18];
155
+ return t7;
156
+ }
157
+ export { MapLayersControl as default };
@@ -0,0 +1,9 @@
1
+ @layer components {
2
+ .OeNIna_locator-image {
3
+ filter: saturate(.2) contrast(.65) brightness(1.2);
4
+ }
5
+
6
+ .dark .OeNIna_locator-image {
7
+ filter: grayscale() invert() brightness(.85) contrast(.9);
8
+ }
9
+ }
@@ -0,0 +1,18 @@
1
+ /** The props of `MapLocator`: the coordinates it marks and its text alternative. */
2
+ export interface MapLocatorProps {
3
+ latitude: number;
4
+ longitude: number;
5
+ alt: string;
6
+ }
7
+ /**
8
+ * A still basemap crop marking one location, for a record surface that would
9
+ * otherwise cost the reader a tab switch.
10
+ *
11
+ * @remarks
12
+ * One tile request per location, drawn as a plain `<img>`: no map instance and
13
+ * no GL context. Renders nothing for coordinates the projection cannot place,
14
+ * so a caller pairs it with a coordinates line. The pin reads `--viz-map-locator-pin`.
15
+ *
16
+ * @category Map
17
+ */
18
+ export default function MapLocator({ latitude, longitude, alt }: MapLocatorProps): import("react").JSX.Element | null;
@@ -0,0 +1,97 @@
1
+ import { locatorTile } from "./locator-tile.mjs";
2
+ import { MAP_REFERRER_POLICY } from "./map-style.mjs";
3
+ import MapLocator_module_default from "./MapLocator.module.css.mjs";
4
+ import { c } from "react/compiler-runtime";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ // src/map/MapLocator.tsx
7
+ const WIDTH = 132;
8
+ const HEIGHT = 84;
9
+ /**
10
+ * A still basemap crop marking one location, for a record surface that would
11
+ * otherwise cost the reader a tab switch.
12
+ *
13
+ * @remarks
14
+ * One tile request per location, drawn as a plain `<img>`: no map instance and
15
+ * no GL context. Renders nothing for coordinates the projection cannot place,
16
+ * so a caller pairs it with a coordinates line. The pin reads `--viz-map-locator-pin`.
17
+ *
18
+ * @category Map
19
+ */
20
+ function MapLocator(t0) {
21
+ const $ = c(17);
22
+ const { latitude, longitude, alt } = t0;
23
+ let t1;
24
+ if ($[0] !== latitude || $[1] !== longitude) {
25
+ t1 = locatorTile(latitude, longitude, WIDTH, HEIGHT);
26
+ $[0] = latitude;
27
+ $[1] = longitude;
28
+ $[2] = t1;
29
+ } else t1 = $[2];
30
+ const tile = t1;
31
+ if (!tile) return null;
32
+ let t2;
33
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
34
+ t2 = {
35
+ width: WIDTH,
36
+ height: HEIGHT
37
+ };
38
+ $[3] = t2;
39
+ } else t2 = $[3];
40
+ let t3;
41
+ if ($[4] !== tile.offsetX || $[5] !== tile.offsetY) {
42
+ t3 = {
43
+ left: tile.offsetX,
44
+ top: tile.offsetY
45
+ };
46
+ $[4] = tile.offsetX;
47
+ $[5] = tile.offsetY;
48
+ $[6] = t3;
49
+ } else t3 = $[6];
50
+ let t4;
51
+ if ($[7] !== alt || $[8] !== t3 || $[9] !== tile.url) {
52
+ t4 = /* @__PURE__ */ jsx("img", {
53
+ className: `${MapLocator_module_default["locator-image"]} absolute max-w-none`,
54
+ src: tile.url,
55
+ alt,
56
+ width: 256,
57
+ height: 256,
58
+ referrerPolicy: MAP_REFERRER_POLICY,
59
+ loading: "lazy",
60
+ decoding: "async",
61
+ style: t3
62
+ });
63
+ $[7] = alt;
64
+ $[8] = t3;
65
+ $[9] = tile.url;
66
+ $[10] = t4;
67
+ } else t4 = $[10];
68
+ let t5;
69
+ if ($[11] !== tile.pinX || $[12] !== tile.pinY) {
70
+ t5 = /* @__PURE__ */ jsx("span", {
71
+ "aria-hidden": "true",
72
+ "data-slot": "map-locator-pin",
73
+ className: "border-background absolute size-3 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 bg-[var(--viz-map-locator-pin)]",
74
+ style: {
75
+ left: tile.pinX,
76
+ top: tile.pinY
77
+ }
78
+ });
79
+ $[11] = tile.pinX;
80
+ $[12] = tile.pinY;
81
+ $[13] = t5;
82
+ } else t5 = $[13];
83
+ let t6;
84
+ if ($[14] !== t4 || $[15] !== t5) {
85
+ t6 = /* @__PURE__ */ jsxs("span", {
86
+ className: "relative block shrink-0 overflow-hidden rounded-sm border border-current/18",
87
+ "data-slot": "map-locator",
88
+ style: t2,
89
+ children: [t4, t5]
90
+ });
91
+ $[14] = t4;
92
+ $[15] = t5;
93
+ $[16] = t6;
94
+ } else t6 = $[16];
95
+ return t6;
96
+ }
97
+ export { MapLocator as default };
@@ -0,0 +1,4 @@
1
+ import './MapLocator.css';
2
+ // src/map/MapLocator.module.css
3
+ var MapLocator_module_default = { "locator-image": "OeNIna_locator-image" };
4
+ export { MapLocator_module_default as default };
@@ -0,0 +1,29 @@
1
+ import { MapMarkerData, MapMarkerKind, MapMarkerUnmetRequirement } from "./types.mjs";
2
+ export declare const UNMET_PLATE_SIZE = 12;
3
+ /** The plate listing what a marker's assignment fails, each requirement's glyph struck through.
4
+ * @remarks `ink` is the word of its token `--viz-map-unmet-ink`, not a marker's `textColor`. */
5
+ export declare function UnmetPlate({ unmet, x, y, fill, ink, border }: {
6
+ unmet: readonly MapMarkerUnmetRequirement[];
7
+ x?: number;
8
+ y?: number;
9
+ fill?: string;
10
+ ink?: string;
11
+ border?: string;
12
+ }): import("react").JSX.Element;
13
+ /** The SVG glyph of one marker kind; the map's GL layer draws it with resolved colours, a DOM marker with CSS ones. */
14
+ export declare function MarkerGlyph({ kind, sequence, fill, textColor, halo }: {
15
+ kind: MapMarkerKind;
16
+ sequence?: number;
17
+ fill?: string;
18
+ textColor?: string;
19
+ halo?: string;
20
+ }): import("react").JSX.Element;
21
+ /**
22
+ * The visual content of a single map marker, coloured via `currentColor`. Presentational
23
+ * only (`aria-hidden`); the `<button>` MapView wraps it in is the interactive element.
24
+ */
25
+ export default function MapMarker({ marker, selected, dimmed }: {
26
+ marker: MapMarkerData;
27
+ selected?: boolean;
28
+ dimmed?: boolean;
29
+ }): import("react").JSX.Element;