@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,126 @@
1
+ import { ReactNode } from "react";
2
+ /** vis-timeline/vis-data id type (`string | number`), named locally so the
3
+ * public API doesn't leak a deep import. */
4
+ export type TimelineId = string | number;
5
+ /** An item's look: `done` recedes a settled item, `waiting` and `overtime` are kinds of time. */
6
+ export type TimelineItemVariant = "default" | "done" | "overtime" | "waiting";
7
+ /** An item's verdict; it colours the item in place of the `variant`. */
8
+ export type TimelineItemState = "positive" | "negative" | "warning" | "neutral";
9
+ /** The colour of an item, a band or a legend entry: a look (`variant`) or a verdict (`state`), never both. */
10
+ export type TimelineItemTint = {
11
+ /** @defaultValue "default" */
12
+ variant?: TimelineItemVariant;
13
+ state?: never;
14
+ } | {
15
+ state: TimelineItemState;
16
+ variant?: never;
17
+ };
18
+ /** Where an item keeps its content: `sticky` moves it into view when the item starts before the window. */
19
+ export type TimelineItemContentAlign = "sticky" | "left";
20
+ /** Whether a timeline item is a bar on a row or a background band. */
21
+ export type TimelineItemType = "range" | "background";
22
+ /** A visible span of a timeline, from `start` to `end`. */
23
+ export type TimelineWindow = {
24
+ start: Date | number;
25
+ end: Date | number;
26
+ };
27
+ /** The display options of a timeline: zoom limits, time zone offset, row gutter and axis scaling. */
28
+ export interface TimelineChartOptions {
29
+ zoom?: {
30
+ min: number;
31
+ max: number;
32
+ };
33
+ timeZoneOffsetSeconds?: number;
34
+ /**
35
+ * @defaultValue 12
36
+ */
37
+ rowGutter?: number;
38
+ /**
39
+ * @defaultValue false
40
+ */
41
+ autoScaleAxis?: boolean;
42
+ }
43
+ /** An explicit pan-limit pair, in raw model time like `TimelineWindow`. */
44
+ export type TimelineBounds = {
45
+ min: Date | number;
46
+ max: Date | number;
47
+ };
48
+ /** A labeled vertical line at one instant, drawn across every row and the time axis. */
49
+ export interface TimelineMarkerProps {
50
+ time: Date | number | string;
51
+ label: string;
52
+ }
53
+ /** The props of `TimelineRoot`: its window, bounds, markers, engine options and row callbacks. */
54
+ export interface TimelineRootProps extends Pick<React.ComponentProps<"div">, "className" | "style" | "ref"> {
55
+ markers?: TimelineMarkerProps[];
56
+ /** @remarks Moves the window on a new start or end; a value kept after a reader's move keeps their window. */
57
+ visibleRange?: TimelineWindow;
58
+ defaultVisibleRange?: TimelineWindow;
59
+ /** @remarks Called when the reader pans, zooms or moves the keyboard cursor, not when the chart moves its own window. */
60
+ onVisibleRangeChange?: (window: TimelineWindow) => void;
61
+ /** @remarks The window moves to the data when this changes and the window is empty; defaults to the row ids. */
62
+ fitKey?: string;
63
+ bounds?: TimelineBounds | "data" | null;
64
+ options?: TimelineChartOptions;
65
+ "aria-label": string;
66
+ onHighlightedGroupChange?: (group: TimelineId | null) => void;
67
+ onGroupClick?: (group: TimelineId) => void;
68
+ children?: ReactNode;
69
+ }
70
+ /** An item on a timeline row. `statusLabel` is the only state the announcer speaks, so pass one where the colour or a
71
+ * `muted` grey carries meaning. */
72
+ export type TimelineItemProps = TimelineItemTint & {
73
+ id: TimelineId;
74
+ group?: TimelineId;
75
+ start: Date | number | string;
76
+ end: Date | number | string;
77
+ /** @defaultValue "sticky" */
78
+ contentAlign?: TimelineItemContentAlign;
79
+ label?: string;
80
+ popover?: ReactNode;
81
+ statusLabel?: string;
82
+ muted?: boolean;
83
+ children?: ReactNode;
84
+ };
85
+ /** A span behind a row's items, drawn by `TimelineBand`: a full-height wash, or a thin `strip` whose meaning is
86
+ * the app's `popover`. */
87
+ export type TimelineBandProps = TimelineItemTint & {
88
+ id: TimelineId;
89
+ group?: TimelineId;
90
+ start: Date | number | string;
91
+ end: Date | number | string;
92
+ } & ({
93
+ /** @defaultValue "tint" */
94
+ fill?: "tint" | "shade";
95
+ popover?: never;
96
+ } | {
97
+ fill: "strip";
98
+ popover?: ReactNode;
99
+ });
100
+ /** The fill of a band: `tint` marks time a row holds, `shade` time it cannot hold work, and `strip` is a thin
101
+ * wordless strip pinned to the top of the row. */
102
+ export type TimelineBandFill = "tint" | "shade" | "strip";
103
+ /** A row group of a timeline: its id, label and place in the row order. */
104
+ export interface TimelineGroupProps {
105
+ id: TimelineId;
106
+ label?: string;
107
+ /** @defaultValue 0 */
108
+ order?: number;
109
+ highlighted?: boolean;
110
+ popover?: ReactNode;
111
+ children?: ReactNode;
112
+ }
113
+ /** Scalar a11y descriptor derived from an item's props. The `popover` ReactNode lives
114
+ * in a ref map instead, so the reactive a11y surfaces stay serializable. */
115
+ export interface TimelineItemDescriptor {
116
+ id: TimelineId;
117
+ group?: TimelineId;
118
+ start: number;
119
+ end: number;
120
+ type: TimelineItemType;
121
+ variant: TimelineItemVariant;
122
+ state?: TimelineItemState;
123
+ label?: string;
124
+ /** @see {@link TimelineItemProps.statusLabel} */
125
+ statusLabel?: string;
126
+ }
File without changes
@@ -0,0 +1,52 @@
1
+ import { TimelineChartOptions, TimelineItemDescriptor, TimelineWindow } from "./timeline-types.mjs";
2
+ import { TimelineOptions } from "vis-timeline/standalone";
3
+ /** Shifts a date by the model's timezone offset (seconds). Compare with `=== undefined`,
4
+ * not truthiness: `0` (a UTC dataset) is a valid offset, still shifted for the viewer's zone. */
5
+ export declare function getTimezonedDate(date: Date | number | string, timeZoneOffsetSeconds?: number): Date;
6
+ /** The inverse of {@link getTimezonedDate}: the model instant an engine date stands for. */
7
+ export declare function getUntimezonedDate(engineDate: Date, timeZoneOffsetSeconds?: number): Date;
8
+ /** The dataset's timezone as a `UTC±H` readout — one formatter so `Root` (used
9
+ * standalone) and `Timeline` (its own toolbar) can't disagree on the number. */
10
+ export declare function formatTimeZoneOffset(offsetSeconds: number): string;
11
+ /** The "no pan limit" bounds, as vis-timeline's own `min`/`max` options: always present
12
+ * (vis-timeline merges by key presence), set to the `Date` range's extremes (no null/undefined). */
13
+ export declare const UNBOUNDED_MIN = -8640000000000000;
14
+ /** @see {@link UNBOUNDED_MIN} */
15
+ export declare const UNBOUNDED_MAX = 8640000000000000;
16
+ /** How many pixels one day takes on a time axis `centerWidthPx` wide that shows `window`. */
17
+ export declare function pixelsPerDay(centerWidthPx: number, window: {
18
+ start: Date;
19
+ end: Date;
20
+ }): number;
21
+ /** The static vis-timeline option bag. Content is now live React, so no string injection.
22
+ * `bounds` absent/`null` emits {@link UNBOUNDED_MIN}/{@link UNBOUNDED_MAX}, not an omitted key.
23
+ * @param dayWidthPx Pixels one day takes now; sizes each day label, on a fixed day axis only. */
24
+ export declare function buildVisOptions(options: TimelineChartOptions | undefined, bounds?: {
25
+ min: number | Date;
26
+ max: number | Date;
27
+ } | null, dayWidthPx?: () => number): TimelineOptions;
28
+ /** Pan limits from the item extent. Unlike `deriveWindowFromItems` (the initial
29
+ * ~1-week window) this includes background items and is not capped. */
30
+ export declare function deriveBoundsFromItems(items: TimelineItemDescriptor[], marginMs?: number): {
31
+ min: number;
32
+ max: number;
33
+ } | null;
34
+ /** Whether any positioned item is at least partly inside the window.
35
+ * Background spans don't count: a wash behind the rows is not what the reader came to read. */
36
+ export declare function hasItemInWindow(items: TimelineItemDescriptor[], visibleWindow: TimelineWindow): boolean;
37
+ /** Initial window from item descriptors, capped to ~1 week. Background items are
38
+ * ignored. Returns `null` when there is nothing positioned to frame. */
39
+ export declare function deriveWindowFromItems(items: TimelineItemDescriptor[]): TimelineWindow | null;
40
+ /** Whether a controllable window matches the engine's current window. */
41
+ export declare function windowsEqual(a: TimelineWindow | undefined, b: {
42
+ start: Date;
43
+ end: Date;
44
+ } | undefined): boolean;
45
+ /** A marker tag's left offset from its line, in px: right of the line, else left of it, else at the area's left edge. */
46
+ export declare function markerLabelOffset(line: {
47
+ left: number;
48
+ width: number;
49
+ }, tagWidth: number, area: {
50
+ left: number;
51
+ right: number;
52
+ }): number;
@@ -0,0 +1,130 @@
1
+ import { formatDayLabel, formatHourLabel } from "./axis-label.mjs";
2
+ import { detectZoomModifier } from "./zoom-modifier.mjs";
3
+ // src/timeline/timeline-utils.ts
4
+ const HOURS_PER_DAY = 24;
5
+ const AXIS_STEP_HOURS = 6;
6
+ const ONE_DAY_MS = 864e5;
7
+ const ONE_WEEK_MS = 7 * ONE_DAY_MS;
8
+ const DEFAULT_ZOOM = {
9
+ min: ONE_DAY_MS,
10
+ max: 4 * ONE_WEEK_MS
11
+ };
12
+ const TWELVE_HOURS_MS = 432e5;
13
+ /** Shifts a date by the model's timezone offset (seconds). Compare with `=== undefined`,
14
+ * not truthiness: `0` (a UTC dataset) is a valid offset, still shifted for the viewer's zone. */
15
+ function getTimezonedDate(date, timeZoneOffsetSeconds) {
16
+ if (timeZoneOffsetSeconds === void 0) return new Date(date);
17
+ const modelWallClockMs = new Date(date).getTime() + timeZoneOffsetSeconds * 1e3;
18
+ const atLocalOffset = (offsetSource) => new Date(modelWallClockMs + offsetSource.getTimezoneOffset() * 60 * 1e3);
19
+ const firstGuess = atLocalOffset(new Date(date));
20
+ const engineDate = atLocalOffset(firstGuess);
21
+ return getUntimezonedDate(engineDate, timeZoneOffsetSeconds).getTime() === new Date(date).getTime() ? engineDate : firstGuess;
22
+ }
23
+ /** The inverse of {@link getTimezonedDate}: the model instant an engine date stands for. */
24
+ function getUntimezonedDate(engineDate, timeZoneOffsetSeconds) {
25
+ if (timeZoneOffsetSeconds === void 0) return engineDate;
26
+ return /* @__PURE__ */ new Date(engineDate.getTime() - timeZoneOffsetSeconds * 1e3 - engineDate.getTimezoneOffset() * 60 * 1e3);
27
+ }
28
+ /** The dataset's timezone as a `UTC±H` readout — one formatter so `Root` (used
29
+ * standalone) and `Timeline` (its own toolbar) can't disagree on the number. */
30
+ function formatTimeZoneOffset(offsetSeconds) {
31
+ const hours = offsetSeconds / 3600;
32
+ return `UTC${hours >= 0 ? "+" : ""}${hours}`;
33
+ }
34
+ /** The "no pan limit" bounds, as vis-timeline's own `min`/`max` options: always present
35
+ * (vis-timeline merges by key presence), set to the `Date` range's extremes (no null/undefined). */
36
+ const UNBOUNDED_MIN = -864e13;
37
+ /** @see {@link UNBOUNDED_MIN} */
38
+ const UNBOUNDED_MAX = 864e13;
39
+ /** How many pixels one day takes on a time axis `centerWidthPx` wide that shows `window`. */
40
+ function pixelsPerDay(centerWidthPx, window) {
41
+ return centerWidthPx * ONE_DAY_MS / (window.end.getTime() - window.start.getTime());
42
+ }
43
+ /** The static vis-timeline option bag. Content is now live React, so no string injection.
44
+ * `bounds` absent/`null` emits {@link UNBOUNDED_MIN}/{@link UNBOUNDED_MAX}, not an omitted key.
45
+ * @param dayWidthPx Pixels one day takes now; sizes each day label, on a fixed day axis only. */
46
+ function buildVisOptions(options, bounds, dayWidthPx) {
47
+ return {
48
+ selectable: false,
49
+ editable: false,
50
+ locale: "en",
51
+ orientation: { axis: "top" },
52
+ stack: true,
53
+ stackSubgroups: false,
54
+ groupOrder: "order",
55
+ zoomMin: options?.zoom?.min ?? DEFAULT_ZOOM.min,
56
+ zoomMax: options?.zoom?.max ?? DEFAULT_ZOOM.max,
57
+ zoomKey: detectZoomModifier().key,
58
+ preferZoom: false,
59
+ groupHeightMode: "auto",
60
+ showCurrentTime: false,
61
+ horizontalScroll: true,
62
+ verticalScroll: true,
63
+ margin: { item: {
64
+ horizontal: -1,
65
+ vertical: options?.rowGutter ?? 12
66
+ } },
67
+ ...options?.autoScaleAxis ? {} : {
68
+ timeAxis: {
69
+ scale: "hour",
70
+ step: AXIS_STEP_HOURS
71
+ },
72
+ ...dayWidthPx && { format: {
73
+ majorLabels: (date) => formatDayLabel(new Date(date), dayWidthPx()),
74
+ minorLabels: (date) => formatHourLabel(new Date(date), dayWidthPx() * AXIS_STEP_HOURS / HOURS_PER_DAY)
75
+ } }
76
+ },
77
+ min: bounds ? bounds.min : UNBOUNDED_MIN,
78
+ max: bounds ? bounds.max : UNBOUNDED_MAX
79
+ };
80
+ }
81
+ /** Pan limits from the item extent. Unlike `deriveWindowFromItems` (the initial
82
+ * ~1-week window) this includes background items and is not capped. */
83
+ function deriveBoundsFromItems(items, marginMs = TWELVE_HOURS_MS) {
84
+ let min = 1e400;
85
+ let max = -1e400;
86
+ for (const item of items) {
87
+ if (item.start < min) min = item.start;
88
+ if (item.end > max) max = item.end;
89
+ }
90
+ if (min === 1e400 || max === -1e400) return null;
91
+ return {
92
+ min: min - marginMs,
93
+ max: max + marginMs
94
+ };
95
+ }
96
+ /** Whether any positioned item is at least partly inside the window.
97
+ * Background spans don't count: a wash behind the rows is not what the reader came to read. */
98
+ function hasItemInWindow(items, visibleWindow) {
99
+ const start = +new Date(visibleWindow.start);
100
+ const end = +new Date(visibleWindow.end);
101
+ return items.some((item) => item.type !== "background" && item.start <= end && item.end >= start);
102
+ }
103
+ /** Initial window from item descriptors, capped to ~1 week. Background items are
104
+ * ignored. Returns `null` when there is nothing positioned to frame. */
105
+ function deriveWindowFromItems(items) {
106
+ let start = 1e400;
107
+ let end = -1e400;
108
+ for (const item of items) {
109
+ if (item.type === "background") continue;
110
+ if (item.start < start) start = item.start;
111
+ if (item.end > end) end = item.end;
112
+ }
113
+ if (start === 1e400 || end === -1e400) return null;
114
+ if (end - start > ONE_WEEK_MS) end = start + ONE_WEEK_MS;
115
+ return {
116
+ start,
117
+ end
118
+ };
119
+ }
120
+ /** Whether a controllable window matches the engine's current window. */
121
+ function windowsEqual(a, b) {
122
+ if (!a || !b) return false;
123
+ return +new Date(a.start) === +b.start && +new Date(a.end) === +b.end;
124
+ }
125
+ /** A marker tag's left offset from its line, in px: right of the line, else left of it, else at the area's left edge. */
126
+ function markerLabelOffset(line, tagWidth, area) {
127
+ if (line.left + tagWidth <= area.right) return 0;
128
+ return Math.max(line.width - tagWidth, area.left - line.left);
129
+ }
130
+ export { UNBOUNDED_MAX, UNBOUNDED_MIN, buildVisOptions, deriveBoundsFromItems, deriveWindowFromItems, formatTimeZoneOffset, getTimezonedDate, getUntimezonedDate, hasItemInWindow, markerLabelOffset, pixelsPerDay, windowsEqual };
@@ -0,0 +1,21 @@
1
+ /** Which keyboard modifier gates wheel-zoom, per platform: Apple keyboards use ⌘ (metaKey),
2
+ * everything else Ctrl — one value feeds both vis-timeline's `zoomKey` and the footer hint. */
3
+ export interface ZoomModifier {
4
+ key: "ctrlKey" | "metaKey";
5
+ label: "Ctrl" | "⌘";
6
+ }
7
+ /** The subset of `Navigator` the detection reads — injectable for tests. */
8
+ export interface PlatformSource {
9
+ userAgentData?: {
10
+ platform?: string;
11
+ };
12
+ platform?: string;
13
+ }
14
+ /** Detects whether the browser runs on an Apple platform (macOS, or iOS). Prefers
15
+ * `navigator.userAgentData.platform`, falls back to the legacy `navigator.platform`. */
16
+ export declare function isApplePlatform(source?: PlatformSource): boolean;
17
+ /** The platform's zoom modifier — ⌘/metaKey on Apple, Ctrl/ctrlKey elsewhere. */
18
+ export declare function detectZoomModifier(source?: PlatformSource): ZoomModifier;
19
+ /** Whether the primary pointer is coarse (touch) — the signal for showing a pinch hint
20
+ * instead of a keyboard-modifier one. Media query first, `maxTouchPoints` as fallback. */
21
+ export declare function isCoarsePointer(): boolean;
@@ -0,0 +1,25 @@
1
+ // src/timeline/zoom-modifier.ts
2
+ /** Detects whether the browser runs on an Apple platform (macOS, or iOS). Prefers
3
+ * `navigator.userAgentData.platform`, falls back to the legacy `navigator.platform`. */
4
+ function isApplePlatform(source) {
5
+ const nav = source ?? (typeof navigator === "undefined" ? void 0 : navigator);
6
+ const platform = nav?.userAgentData?.platform ?? nav?.platform ?? "";
7
+ return /mac|iphone|ipad|ipod/iu.test(platform);
8
+ }
9
+ /** The platform's zoom modifier — ⌘/metaKey on Apple, Ctrl/ctrlKey elsewhere. */
10
+ function detectZoomModifier(source) {
11
+ return isApplePlatform(source) ? {
12
+ key: "metaKey",
13
+ label: "⌘"
14
+ } : {
15
+ key: "ctrlKey",
16
+ label: "Ctrl"
17
+ };
18
+ }
19
+ /** Whether the primary pointer is coarse (touch) — the signal for showing a pinch hint
20
+ * instead of a keyboard-modifier one. Media query first, `maxTouchPoints` as fallback. */
21
+ function isCoarsePointer() {
22
+ if (typeof window !== "undefined" && typeof window.matchMedia === "function") return window.matchMedia("(pointer: coarse)").matches;
23
+ return typeof navigator !== "undefined" && navigator.maxTouchPoints > 0;
24
+ }
25
+ export { detectZoomModifier, isApplePlatform, isCoarsePointer };
@@ -0,0 +1,33 @@
1
+ /** A toast's verdict: `negative` for a failure, which stays until closed, `positive` for a success. */
2
+ export type ToastState = "positive" | "negative" | "neutral";
3
+ /** A button on the toast that runs `onAction` and closes the toast, such as a retry. */
4
+ export interface ToastAction {
5
+ label: string;
6
+ onAction: () => void;
7
+ }
8
+ /** The options of a toast: its state and an optional action button. */
9
+ export interface ToastOptions {
10
+ /** @defaultValue "neutral" */
11
+ state?: ToastState;
12
+ action?: ToastAction;
13
+ }
14
+ /** The handle {@link useToast} returns. */
15
+ export interface ToastHandle {
16
+ show: (message: React.ReactNode, options?: ToastOptions) => void;
17
+ }
18
+ /**
19
+ * Raise toasts from anywhere under a {@link ToastProvider}.
20
+ */
21
+ export declare function useToast(): ToastHandle;
22
+ /** The props of `ToastProvider`: the content in which `useToast` works. */
23
+ export interface ToastProviderProps {
24
+ children: React.ReactNode;
25
+ }
26
+ /**
27
+ * Mounts the notification viewport so any descendant raises a toast via {@link useToast}.
28
+ * An error toast stays until closed; any other closes after 5 s, paused on pointer or focus.
29
+ *
30
+ * @see https://www.w3.org/WAI/ARIA/apg/patterns/button/
31
+ * @category Feedback
32
+ */
33
+ export default function ToastProvider({ children }: ToastProviderProps): import("react").JSX.Element;
@@ -0,0 +1,257 @@
1
+ "use client";
2
+ import { ToastContext } from "./toast-context.mjs";
3
+ import { c } from "react/compiler-runtime";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { use, useCallback, useEffect, useMemo, useRef, useState } from "react";
6
+ import { Button, Toast, ToastClose, ToastDescription, ToastViewport } from "../vendor/components.mjs";
7
+ import { createPortal } from "react-dom";
8
+ import { TbX } from "react-icons/tb";
9
+ // src/toast/ToastProvider.tsx
10
+ const TOAST_VARIANT = {
11
+ positive: "success",
12
+ negative: "error",
13
+ neutral: "info"
14
+ };
15
+ const AUTO_DISMISS_MS = 5e3;
16
+ const EXIT_ANIMATION_MS = 300;
17
+ function clearTimers(timers, shouldClear = () => true) {
18
+ for (const [id, timer] of timers) {
19
+ if (!shouldClear(id)) continue;
20
+ window.clearTimeout(timer);
21
+ timers.delete(id);
22
+ }
23
+ }
24
+ /**
25
+ * Raise toasts from anywhere under a {@link ToastProvider}.
26
+ */
27
+ function useToast() {
28
+ const handle = use(ToastContext);
29
+ if (!handle) throw new Error("useToast needs a ToastProvider above it.");
30
+ return handle;
31
+ }
32
+ /**
33
+ * Mounts the notification viewport so any descendant raises a toast via {@link useToast}.
34
+ * An error toast stays until closed; any other closes after 5 s, paused on pointer or focus.
35
+ *
36
+ * @see https://www.w3.org/WAI/ARIA/apg/patterns/button/
37
+ * @category Feedback
38
+ */
39
+ function ToastProvider({ children }) {
40
+ const [toasts, setToasts] = useState([]);
41
+ const nextId = useRef(0);
42
+ const dismissTimers = useRef(/* @__PURE__ */ new Map());
43
+ const removalTimers = useRef(/* @__PURE__ */ new Map());
44
+ const stopAutoDismiss = useCallback((id) => {
45
+ clearTimers(dismissTimers.current, (timerId) => timerId === id);
46
+ }, []);
47
+ const dismiss = useCallback((id_0) => {
48
+ stopAutoDismiss(id_0);
49
+ if (removalTimers.current.has(id_0)) return;
50
+ setToasts((current) => current.map((toast) => toast.id === id_0 ? {
51
+ ...toast,
52
+ open: false
53
+ } : toast));
54
+ removalTimers.current.set(id_0, window.setTimeout(() => {
55
+ removalTimers.current.delete(id_0);
56
+ setToasts((current_0) => current_0.filter((toast_0) => toast_0.id !== id_0));
57
+ }, EXIT_ANIMATION_MS));
58
+ }, [stopAutoDismiss]);
59
+ const startAutoDismiss = useCallback((id_1) => {
60
+ stopAutoDismiss(id_1);
61
+ if (removalTimers.current.has(id_1)) return;
62
+ dismissTimers.current.set(id_1, window.setTimeout(() => {
63
+ dismiss(id_1);
64
+ }, AUTO_DISMISS_MS));
65
+ }, [dismiss, stopAutoDismiss]);
66
+ const show = useCallback((message, { state = "neutral", action } = {}) => {
67
+ nextId.current += 1;
68
+ const id_2 = nextId.current;
69
+ setToasts((current_1) => [...current_1, {
70
+ id: id_2,
71
+ message,
72
+ state,
73
+ action,
74
+ open: true
75
+ }].slice(-5));
76
+ if (state !== "negative") startAutoDismiss(id_2);
77
+ }, [startAutoDismiss]);
78
+ useEffect(() => {
79
+ const live = new Set(toasts.map((toast_1) => toast_1.id));
80
+ clearTimers(dismissTimers.current, (id_3) => !live.has(id_3));
81
+ clearTimers(removalTimers.current, (id_4) => !live.has(id_4));
82
+ }, [toasts]);
83
+ useEffect(() => {
84
+ const pendingDismissals = dismissTimers.current;
85
+ const pendingRemovals = removalTimers.current;
86
+ return () => {
87
+ clearTimers(pendingDismissals);
88
+ clearTimers(pendingRemovals);
89
+ };
90
+ }, []);
91
+ const handle = useMemo(() => ({ show }), [show]);
92
+ return /* @__PURE__ */ jsxs(ToastContext, {
93
+ value: handle,
94
+ children: [children, createPortal(/* @__PURE__ */ jsx(ToastViewport, {
95
+ label: "Notifications",
96
+ children: toasts.map((toast_2) => /* @__PURE__ */ jsx(ToastItem, {
97
+ toast: toast_2,
98
+ onDismiss: dismiss,
99
+ onPauseAutoDismiss: stopAutoDismiss,
100
+ onResumeAutoDismiss: startAutoDismiss
101
+ }, toast_2.id))
102
+ }), document.body)]
103
+ });
104
+ }
105
+ function ToastItem(t0) {
106
+ const $ = c(35);
107
+ const { toast, onDismiss, onPauseAutoDismiss, onResumeAutoDismiss } = t0;
108
+ let t1;
109
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
110
+ t1 = {
111
+ pointer: false,
112
+ focus: false
113
+ };
114
+ $[0] = t1;
115
+ } else t1 = $[0];
116
+ const holds = useRef(t1);
117
+ const focusBeforeToast = useRef(null);
118
+ const { action } = toast;
119
+ const autoDismisses = toast.state !== "negative" && toast.open;
120
+ let t2;
121
+ if ($[1] !== autoDismisses || $[2] !== onPauseAutoDismiss || $[3] !== onResumeAutoDismiss || $[4] !== toast.id) {
122
+ t2 = function setHold(kind, held) {
123
+ holds.current[kind] = held;
124
+ if (!autoDismisses) return;
125
+ if (holds.current.pointer || holds.current.focus) onPauseAutoDismiss(toast.id);
126
+ else onResumeAutoDismiss(toast.id);
127
+ };
128
+ $[1] = autoDismisses;
129
+ $[2] = onPauseAutoDismiss;
130
+ $[3] = onResumeAutoDismiss;
131
+ $[4] = toast.id;
132
+ $[5] = t2;
133
+ } else t2 = $[5];
134
+ const setHold = t2;
135
+ let t3;
136
+ if ($[6] !== onDismiss || $[7] !== toast.id) {
137
+ t3 = function close() {
138
+ const returnTo = holds.current.focus ? focusBeforeToast.current : null;
139
+ onDismiss(toast.id);
140
+ if (returnTo?.isConnected && returnTo instanceof HTMLElement) returnTo.focus();
141
+ };
142
+ $[6] = onDismiss;
143
+ $[7] = toast.id;
144
+ $[8] = t3;
145
+ } else t3 = $[8];
146
+ const close = t3;
147
+ const t4 = TOAST_VARIANT[toast.state];
148
+ let t5;
149
+ let t6;
150
+ let t7;
151
+ let t8;
152
+ if ($[9] !== setHold) {
153
+ t5 = () => {
154
+ setHold("pointer", true);
155
+ };
156
+ t6 = () => {
157
+ setHold("pointer", false);
158
+ };
159
+ t7 = (event) => {
160
+ if (!event.currentTarget.contains(event.relatedTarget)) focusBeforeToast.current = event.relatedTarget;
161
+ setHold("focus", true);
162
+ };
163
+ t8 = (event_0) => {
164
+ if (!event_0.currentTarget.contains(event_0.relatedTarget)) setHold("focus", false);
165
+ };
166
+ $[9] = setHold;
167
+ $[10] = t5;
168
+ $[11] = t6;
169
+ $[12] = t7;
170
+ $[13] = t8;
171
+ } else {
172
+ t5 = $[10];
173
+ t6 = $[11];
174
+ t7 = $[12];
175
+ t8 = $[13];
176
+ }
177
+ let t9;
178
+ if ($[14] !== toast.message) {
179
+ t9 = /* @__PURE__ */ jsx(ToastDescription, {
180
+ "data-slot": "toast-title",
181
+ className: "break-words",
182
+ children: toast.message
183
+ });
184
+ $[14] = toast.message;
185
+ $[15] = t9;
186
+ } else t9 = $[15];
187
+ let t10;
188
+ if ($[16] !== action || $[17] !== close) {
189
+ t10 = action && /* @__PURE__ */ jsx(Button, {
190
+ variant: "outline",
191
+ size: "sm",
192
+ className: "self-start",
193
+ onClick: () => {
194
+ close();
195
+ action.onAction();
196
+ },
197
+ children: action.label
198
+ });
199
+ $[16] = action;
200
+ $[17] = close;
201
+ $[18] = t10;
202
+ } else t10 = $[18];
203
+ let t11;
204
+ if ($[19] !== t10 || $[20] !== t9) {
205
+ t11 = /* @__PURE__ */ jsxs("div", {
206
+ className: "flex min-w-0 flex-col gap-2",
207
+ children: [t9, t10]
208
+ });
209
+ $[19] = t10;
210
+ $[20] = t9;
211
+ $[21] = t11;
212
+ } else t11 = $[21];
213
+ let t12;
214
+ if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
215
+ t12 = /* @__PURE__ */ jsx(TbX, {
216
+ "aria-hidden": true,
217
+ className: "size-4"
218
+ });
219
+ $[22] = t12;
220
+ } else t12 = $[22];
221
+ let t13;
222
+ if ($[23] !== close) {
223
+ t13 = /* @__PURE__ */ jsx(ToastClose, {
224
+ "aria-label": "Dismiss notification",
225
+ onClick: close,
226
+ children: t12
227
+ });
228
+ $[23] = close;
229
+ $[24] = t13;
230
+ } else t13 = $[24];
231
+ let t14;
232
+ if ($[25] !== t11 || $[26] !== t13 || $[27] !== t4 || $[28] !== t5 || $[29] !== t6 || $[30] !== t7 || $[31] !== t8 || $[32] !== toast.open || $[33] !== toast.state) {
233
+ t14 = /* @__PURE__ */ jsxs(Toast, {
234
+ variant: t4,
235
+ open: toast.open,
236
+ "data-slot": "toast",
237
+ "data-toast-state": toast.state,
238
+ onPointerEnter: t5,
239
+ onPointerLeave: t6,
240
+ onFocus: t7,
241
+ onBlur: t8,
242
+ children: [t11, t13]
243
+ });
244
+ $[25] = t11;
245
+ $[26] = t13;
246
+ $[27] = t4;
247
+ $[28] = t5;
248
+ $[29] = t6;
249
+ $[30] = t7;
250
+ $[31] = t8;
251
+ $[32] = toast.open;
252
+ $[33] = toast.state;
253
+ $[34] = t14;
254
+ } else t14 = $[34];
255
+ return t14;
256
+ }
257
+ export { ToastProvider as default, useToast };
@@ -0,0 +1,2 @@
1
+ import { ToastHandle } from "./ToastProvider.mjs";
2
+ export declare const ToastContext: import("react").Context<ToastHandle | null>;
@@ -0,0 +1,5 @@
1
+ "use client";
2
+ import { createContext } from "react";
3
+ // src/toast/toast-context.ts
4
+ const ToastContext = createContext(null);
5
+ export { ToastContext };