@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
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,241 @@
1
- # Temporary Holding Version
1
+ # @timefoldai/viz-react
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ React components for Timefold model visualizations: timelines, maps, heatmaps, charts, popovers, and
4
+ the shell that holds them.
5
+
6
+ ## Install
7
+
8
+ ```sh
9
+ pnpm add @timefoldai/viz-react react react-dom tailwindcss
10
+ ```
11
+
12
+ The peers are React 19, React DOM 19, and Tailwind CSS 4.
13
+ `@timefoldai/viz-react` installs `@timefoldai/viz-core`, and your package manager installs its peer `@js-joda/core`.
14
+ You need no registry token and no `.npmrc`.
15
+
16
+ Build your app with Vite. The map loads the MapLibre worker through a Vite `?worker&url` import,
17
+ and other bundlers do not read that import.
18
+
19
+ ## Set up
20
+
21
+ The components use Tailwind utility classes that `styles.css` does not contain.
22
+ Your Tailwind build generates them, so do the first two steps before you render a component.
23
+ Without them, the components render without layout.
24
+
25
+ 1. **Let Tailwind scan the package.** In the stylesheet that imports Tailwind, import the theme and
26
+ add the package's `dist` as a source. The path is relative to that stylesheet:
27
+
28
+ ```css
29
+ @import "@timefoldai/viz-react/theme.css";
30
+ @source "../node_modules/@timefoldai/viz-react/dist";
31
+ ```
32
+
33
+ 2. **Declare the layer order before any other CSS loads.** The first `@layer` rule on the page
34
+ fixes the order of all layers, and a minifier can drop the statement from `theme.css`. Put it
35
+ first in the `<head>` of your page:
36
+
37
+ ```html
38
+ <style>
39
+ @layer properties, theme, base, ds, components, utilities;
40
+ </style>
41
+ ```
42
+
43
+ 3. **Import the component styles once**, before your app mounts:
44
+
45
+ ```ts
46
+ import "@timefoldai/viz-react/styles.css";
47
+ ```
48
+
49
+ ## Example
50
+
51
+ A Vite app with the Tailwind Vite plugin:
52
+
53
+ ```sh
54
+ pnpm add -D vite @vitejs/plugin-react @tailwindcss/vite
55
+ ```
56
+
57
+ ```ts
58
+ // vite.config.ts
59
+ import tailwindcss from "@tailwindcss/vite";
60
+ import react from "@vitejs/plugin-react";
61
+ import { defineConfig } from "vite";
62
+
63
+ export default defineConfig({ plugins: [react(), tailwindcss()] });
64
+ ```
65
+
66
+ ```css
67
+ /* src/tailwind.css */
68
+ @import "@timefoldai/viz-react/theme.css";
69
+ @source "../node_modules/@timefoldai/viz-react/dist";
70
+ ```
71
+
72
+ ```tsx
73
+ // src/main.tsx
74
+ import "@timefoldai/viz-react/styles.css";
75
+ import "./tailwind.css";
76
+
77
+ import { Badge } from "@timefoldai/viz-react";
78
+ import { createRoot } from "react-dom/client";
79
+
80
+ const root = document.getElementById("root");
81
+ if (root) createRoot(root).render(<Badge>Active</Badge>);
82
+ ```
83
+
84
+ `index.html` declares the layer order of step 2 in its `<head>` and loads `/src/main.tsx`.
85
+ `@timefoldai/viz-cli/vite` gives a Vite config that declares the layer order for you.
86
+
87
+ ## Accessibility
88
+
89
+ The components are designed and tested against WCAG 2.2 Level AA: axe checks every story, and a test covers each key of each
90
+ interactive component. The library does not claim conformance for your app.
91
+
92
+ One gap is known: axe checks the state each story ends in, so a target-size problem (WCAG 2.5.8) that shows only in an
93
+ overlay no test opens is not found.
94
+
95
+ ## Theming
96
+
97
+ Every color comes from a CSS custom property. To retint a visualization, override the tokens on
98
+ `:root` or on a `[data-viz-theme]` subtree. The Tokens section below lists them.
99
+
100
+ ## Tokens
101
+
102
+ `@timefoldai/viz-react/tokens.css` declares the tokens.
103
+ `@timefoldai/viz-react/theme.css` imports it and maps the tokens to Tailwind theme variables.
104
+ Every component reads its colors from these tokens, so you can give each model its own colors.
105
+
106
+ ### Design-system tokens (`--tf-*`)
107
+
108
+ The `--tf-*` names come from the Timefold design system, which `tokens.css` contains, so you install no other package.
109
+ `viz-react` adds the `--viz-*` tokens and a few `--tf-*` names of its own.
110
+
111
+ ### Semantic colors (`--tf-color-*`)
112
+
113
+ Theme-aware colors for the page, the controls, and the text.
114
+ They change under `.dark`.
115
+
116
+ | Token | Use |
117
+ | ----- | --- |
118
+ | `--tf-color-primary` | primary action: links, highlights, and borders |
119
+ | `--tf-color-primary-foreground` | text and icons on the primary color |
120
+ | `--tf-color-primary-hover` | hover state of a primary element |
121
+ | `--tf-color-secondary` | secondary and accent color |
122
+ | `--tf-color-secondary-foreground` | text and icons on the secondary color |
123
+ | `--tf-color-destructive` | alert and delete actions |
124
+ | `--tf-color-destructive-foreground` | text and icons on the destructive color |
125
+ | `--tf-color-destructive-hover` | hover state of a destructive element |
126
+ | `--tf-color-background` | page and panel background |
127
+ | `--tf-color-foreground` | body text |
128
+ | `--tf-color-muted` | disabled or muted background |
129
+ | `--tf-color-muted-foreground` | text on a muted background |
130
+ | `--tf-color-border` | dividers, borders, and outlines |
131
+ | `--tf-color-input` | form input borders |
132
+ | `--tf-color-ring` | focus and selection rings |
133
+
134
+ ### Visualization colors (`--viz-*`)
135
+
136
+ Colors for charts, timelines, and maps.
137
+ Most of them stay the same in the dark theme, so a color means the same thing in both themes.
138
+ The exceptions are `--viz-timeline-border`, `--viz-timeline-grid`, `--viz-map-unreachable`, and `--viz-text-muted`: they follow `.dark`.
139
+
140
+ | Token | Use |
141
+ | ----- | --- |
142
+ | `--viz-cat-1` to `--viz-cat-10` | the categorical palette: 10 hues, at least 20° apart, each with a contrast of at least 3:1. `pickCategory` from `@timefoldai/viz-core` maps an id to one of them, so a theme sets all ten |
143
+ | `--viz-cat-1-fg` to `--viz-cat-10-fg` | text on each categorical color |
144
+ | `--viz-item-default` | a scheduled item |
145
+ | `--viz-item-positive` | an available, preferred, or valid item |
146
+ | `--viz-item-warning` | a partial or unpreferred item |
147
+ | `--viz-item-negative` | an unavailable or conflicting item |
148
+ | `--viz-item-neutral` | a neutral item |
149
+ | `--viz-item-done` | a finished item, such as a visit with a recorded departure |
150
+ | `--viz-score-hard`, `--viz-score-medium`, `--viz-score-soft` | hard, medium, and soft constraint impact |
151
+ | `--viz-score-soft-positive` | a satisfied soft constraint |
152
+ | `--viz-scale-low`, `--viz-scale-mid`, `--viz-scale-high` | efficiency and capacity scales |
153
+ | `--viz-heatmap-from`, `--viz-heatmap-to` | the ends of the heatmap ramp |
154
+ | `--viz-empty` | no data |
155
+ | `--viz-map-locator-pin` | the location pin of `MapLocator` |
156
+ | `--viz-map-unreachable` | the badge on a marker that the route cannot reach |
157
+ | `--viz-timeline-border` | the timeline axis and borders |
158
+ | `--viz-timeline-grid` | the timeline grid lines |
159
+ | `--viz-text-muted` | muted labels and captions (`text-viz-muted`) |
160
+
161
+ ### Color ramps (`--tf-{neutral,primary,success,emphasis,alert}-*`)
162
+
163
+ The steps that the semantic colors use, from `000` to `999`.
164
+ They stay the same in the dark theme.
165
+
166
+ | Token | Use |
167
+ | ----- | --- |
168
+ | `--tf-neutral-*` | gray, from white to black |
169
+ | `--tf-primary-*` | the brand color, from light to dark |
170
+ | `--tf-success-*` | positive and available |
171
+ | `--tf-emphasis-400` | the orange of a medium score |
172
+ | `--tf-alert-*` | negative and alert |
173
+
174
+ ### Scopes
175
+
176
+ A token applies at three scopes, and the most specific one wins:
177
+
178
+ - `:root` holds the light defaults.
179
+ - `.dark` on `<html>` or on any ancestor changes the semantic colors to the dark theme.
180
+ - `[data-viz-theme="<name>"]` on a container gives that subtree its own colors, so two visualizations on one page can look different.
181
+
182
+ A semantic or `--viz-*` token reads its ramp step once, where it is declared, which is `:root`.
183
+ So a ramp step that you set inside `[data-viz-theme]` changes nothing unless you also set the tokens that read it in the same rule.
184
+ To theme a subtree, set the semantic and `--viz-*` tokens directly:
185
+
186
+ ```css
187
+ [data-viz-theme="routing"] {
188
+ --tf-color-primary: #0066cc;
189
+ --tf-color-primary-hover: #003f99;
190
+ --viz-cat-1: oklch(0.6 0.12 200);
191
+ --viz-cat-2: oklch(0.62 0.19 25);
192
+ --viz-item-positive: #2ecc71;
193
+ --viz-item-negative: #e74c3c;
194
+ }
195
+ ```
196
+
197
+ ```tsx
198
+ <div data-viz-theme="routing">
199
+ <Badge category={1}>Vehicle 1</Badge>
200
+ </div>
201
+ ```
202
+
203
+ ### Versions
204
+
205
+ The tokens are public API.
206
+ A new token is a minor change.
207
+ A changed value is a patch for a ramp step and a minor change for a `--viz-*` color.
208
+ A renamed token, a changed meaning, or a change to the ramp step that a token reads is a breaking change.
209
+ While the version is 0.x, a breaking change bumps the minor version, so pin a minor range such as `~0.1.0`.
210
+
211
+ ## Browsers
212
+
213
+ The package supports the browsers of [Baseline](https://web.dev/baseline) Widely available on 2026-11-16, with Firefox at the Tailwind CSS 4 floor:
214
+
215
+ | Browser | Minimum version |
216
+ | ---------------------- | --------------- |
217
+ | Chrome and Edge | 124 |
218
+ | Firefox | 128 |
219
+ | Safari (macOS and iOS) | 17.5 |
220
+
221
+ The map also needs WebGL2. The package ships no polyfills.
222
+ A newer CSS feature is an enhancement with a fallback: for example, `contrast-color()` picks the ink of a glyph where the browser supports it.
223
+
224
+ ## TypeScript
225
+
226
+ The types support TypeScript 7 and later. CI type-checks the package with TypeScript 7.
227
+
228
+ The map types use the global `GeoJSON` namespace of `@types/geojson`, which `maplibre-gl` installs.
229
+ When `skipLibCheck` is `false` and your package manager does not put that package in your own
230
+ `node_modules/@types` (pnpm does not), add `@types/geojson` to your dev dependencies.
231
+
232
+ ## Support
233
+
234
+ - To report a security vulnerability, email security@timefold.ai. Don't post the details in public.
235
+ - To report a bug or to get help with this package, email support@timefold.ai.
236
+
237
+ ## License
238
+
239
+ Apache License 2.0: the `LICENSE` file of this package holds the text.
240
+ `dist/THIRD-PARTY-NOTICES.txt` lists the third-party parts that this package ships, with their licenses.
241
+ The license grants no right to use the Timefold name, logo, or brand colors, such as the purple of the tokens, except to describe where the package comes from.
@@ -0,0 +1,99 @@
1
+ Third-party notices for @timefoldai/viz-react
2
+
3
+ This package ships the third-party parts below. Each part keeps its own license.
4
+
5
+ ------------------------------------------------------------------------
6
+ Inter font (dist/assets/Inter-latin-ext.woff2)
7
+
8
+ Copyright (c) 2016 The Inter Project Authors (https://github.com/rsms/inter)
9
+
10
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
11
+ This license is copied below, and is also available with a FAQ at:
12
+ http://scripts.sil.org/OFL
13
+
14
+ -----------------------------------------------------------
15
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
16
+ -----------------------------------------------------------
17
+
18
+ PREAMBLE
19
+ The goals of the Open Font License (OFL) are to stimulate worldwide
20
+ development of collaborative font projects, to support the font creation
21
+ efforts of academic and linguistic communities, and to provide a free and
22
+ open framework in which fonts may be shared and improved in partnership
23
+ with others.
24
+
25
+ The OFL allows the licensed fonts to be used, studied, modified and
26
+ redistributed freely as long as they are not sold by themselves. The
27
+ fonts, including any derivative works, can be bundled, embedded,
28
+ redistributed and/or sold with any software provided that any reserved
29
+ names are not used by derivative works. The fonts and derivatives,
30
+ however, cannot be released under any other type of license. The
31
+ requirement for fonts to remain under this license does not apply
32
+ to any document created using the fonts or their derivatives.
33
+
34
+ DEFINITIONS
35
+ "Font Software" refers to the set of files released by the Copyright
36
+ Holder(s) under this license and clearly marked as such. This may
37
+ include source files, build scripts and documentation.
38
+
39
+ "Reserved Font Name" refers to any names specified as such after the
40
+ copyright statement(s).
41
+
42
+ "Original Version" refers to the collection of Font Software components as
43
+ distributed by the Copyright Holder(s).
44
+
45
+ "Modified Version" refers to any derivative made by adding to, deleting,
46
+ or substituting -- in part or in whole -- any of the components of the
47
+ Original Version, by changing formats or by porting the Font Software to a
48
+ new environment.
49
+
50
+ "Author" refers to any designer, engineer, programmer, technical
51
+ writer or other person who contributed to the Font Software.
52
+
53
+ PERMISSION AND CONDITIONS
54
+ Permission is hereby granted, free of charge, to any person obtaining
55
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
56
+ redistribute, and sell modified and unmodified copies of the Font
57
+ Software, subject to the following conditions:
58
+
59
+ 1) Neither the Font Software nor any of its individual components,
60
+ in Original or Modified Versions, may be sold by itself.
61
+
62
+ 2) Original or Modified Versions of the Font Software may be bundled,
63
+ redistributed and/or sold with any software, provided that each copy
64
+ contains the above copyright notice and this license. These can be
65
+ included either as stand-alone text files, human-readable headers or
66
+ in the appropriate machine-readable metadata fields within text or
67
+ binary files as long as those fields can be easily viewed by the user.
68
+
69
+ 3) No Modified Version of the Font Software may use the Reserved Font
70
+ Name(s) unless explicit written permission is granted by the corresponding
71
+ Copyright Holder. This restriction only applies to the primary font name as
72
+ presented to the users.
73
+
74
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
75
+ Software shall not be used to promote, endorse or advertise any
76
+ Modified Version, except to acknowledge the contribution(s) of the
77
+ Copyright Holder(s) and the Author(s) or with their explicit written
78
+ permission.
79
+
80
+ 5) The Font Software, modified or unmodified, in part or in whole,
81
+ must be distributed entirely under this license, and must not be
82
+ distributed under any other license. The requirement for fonts to
83
+ remain under this license does not apply to any document created
84
+ using the Font Software.
85
+
86
+ TERMINATION
87
+ This license becomes null and void if any of the above conditions are
88
+ not met.
89
+
90
+ DISCLAIMER
91
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
92
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
93
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
94
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
95
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
96
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
97
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
98
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
99
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,42 @@
1
+ /** A column of an accessible table: its key, header and whether its cells are row headers. */
2
+ export interface AccessibleTableColumn {
3
+ key: string;
4
+ header: string;
5
+ /** @defaultValue `false`; `true` renders this column's cells as row headers, where row buttons go */
6
+ rowHeader?: boolean;
7
+ }
8
+ /** A table row, whose `cells` hold each value under the `key` of its column. */
9
+ export interface AccessibleTableRow {
10
+ id: string;
11
+ cells: Record<string, React.ReactNode>;
12
+ }
13
+ /** The data of a screen-reader table: a caption, its columns and its rows. */
14
+ export interface AccessibleTableData {
15
+ caption: string;
16
+ columns: AccessibleTableColumn[];
17
+ rows: AccessibleTableRow[];
18
+ }
19
+ /** Makes the row-header cell of each listed row a button, so a keyboard reaches the thing the row stands for. */
20
+ export interface AccessibleTableRowButtons {
21
+ rowIds: ReadonlySet<string>;
22
+ onFocus: (rowId: string) => void;
23
+ onPress: (rowId: string) => void;
24
+ buttonRef?: (rowId: string, button: HTMLButtonElement | null) => void;
25
+ }
26
+ /** The props of `AccessibleTable`: its data, whether it shows, and the rows that are buttons. */
27
+ export interface AccessibleTableProps extends AccessibleTableData {
28
+ /** @defaultValue false */
29
+ visible?: boolean;
30
+ rowButtons?: AccessibleTableRowButtons;
31
+ }
32
+ /**
33
+ * A `<table>` equivalent of a chart or map, rendered off-screen for
34
+ * assistive technology by default, shown only as a fallback (`visible`).
35
+ *
36
+ * @remarks
37
+ * The chart or map it describes stays presentational, so the data is not announced twice.
38
+ *
39
+ * @see https://www.w3.org/WAI/ARIA/apg/patterns/table/
40
+ * @category Data display
41
+ */
42
+ export default function AccessibleTable({ caption, columns, rows, visible, rowButtons }: AccessibleTableProps): import("react").JSX.Element;
@@ -0,0 +1,82 @@
1
+ "use client";
2
+ import { c } from "react/compiler-runtime";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ // src/a11y/AccessibleTable.tsx
5
+ /** A column of an accessible table: its key, header and whether its cells are row headers. */
6
+ /**
7
+ * A `<table>` equivalent of a chart or map, rendered off-screen for
8
+ * assistive technology by default, shown only as a fallback (`visible`).
9
+ *
10
+ * @remarks
11
+ * The chart or map it describes stays presentational, so the data is not announced twice.
12
+ *
13
+ * @see https://www.w3.org/WAI/ARIA/apg/patterns/table/
14
+ * @category Data display
15
+ */
16
+ function AccessibleTable({ caption, columns, rows, visible = false, rowButtons }) {
17
+ const headerKey = columns.find((column) => column.rowHeader)?.key ?? columns[0]?.key;
18
+ return /* @__PURE__ */ jsx("div", {
19
+ "data-slot": "accessible-table-frame",
20
+ className: visible ? void 0 : "sr-only",
21
+ children: /* @__PURE__ */ jsxs("table", {
22
+ "data-slot": "accessible-table",
23
+ children: [
24
+ /* @__PURE__ */ jsx("caption", { children: caption }),
25
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: columns.map((column_0) => /* @__PURE__ */ jsx("th", {
26
+ scope: "col",
27
+ children: column_0.header
28
+ }, column_0.key)) }) }),
29
+ /* @__PURE__ */ jsx("tbody", { children: rows.map((row) => /* @__PURE__ */ jsx("tr", { children: columns.map((column_1) => {
30
+ const content = row.cells[column_1.key];
31
+ if (!(column_1.rowHeader === true || rowButtons !== void 0 && column_1.key === headerKey)) return /* @__PURE__ */ jsx("td", { children: content }, column_1.key);
32
+ return /* @__PURE__ */ jsx("th", {
33
+ scope: "row",
34
+ children: rowButtons?.rowIds.has(row.id) && column_1.key === headerKey ? /* @__PURE__ */ jsx(RowButton, {
35
+ rowId: row.id,
36
+ rowButtons,
37
+ children: content
38
+ }) : content
39
+ }, column_1.key);
40
+ }) }, row.id)) })
41
+ ]
42
+ })
43
+ });
44
+ }
45
+ function RowButton(t0) {
46
+ const $ = c(10);
47
+ const { rowId, rowButtons, children } = t0;
48
+ let t1;
49
+ let t2;
50
+ let t3;
51
+ if ($[0] !== rowButtons || $[1] !== rowId) {
52
+ t1 = (button) => rowButtons.buttonRef?.(rowId, button);
53
+ t2 = () => rowButtons.onFocus(rowId);
54
+ t3 = () => rowButtons.onPress(rowId);
55
+ $[0] = rowButtons;
56
+ $[1] = rowId;
57
+ $[2] = t1;
58
+ $[3] = t2;
59
+ $[4] = t3;
60
+ } else {
61
+ t1 = $[2];
62
+ t2 = $[3];
63
+ t3 = $[4];
64
+ }
65
+ let t4;
66
+ if ($[5] !== children || $[6] !== t1 || $[7] !== t2 || $[8] !== t3) {
67
+ t4 = /* @__PURE__ */ jsx("button", {
68
+ type: "button",
69
+ ref: t1,
70
+ onFocus: t2,
71
+ onClick: t3,
72
+ children
73
+ });
74
+ $[5] = children;
75
+ $[6] = t1;
76
+ $[7] = t2;
77
+ $[8] = t3;
78
+ $[9] = t4;
79
+ } else t4 = $[9];
80
+ return t4;
81
+ }
82
+ export { AccessibleTable as default };
@@ -0,0 +1,4 @@
1
+ /** The details an `on<Part>Activate` callback receives beside its target: the input that activated it. */
2
+ export interface ActivationDetails {
3
+ source: "pointer" | "keyboard";
4
+ }
File without changes