@sybilion/uilib 1.4.37 → 1.4.41
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.
- package/dist/agent-glossary/workspace.generated.ts +1 -0
- package/dist/agent-glossary/workspace.index.md +1 -0
- package/dist/agent-glossary/workspace.md +1 -0
- package/dist/esm/src/components/ui/Banner/Banner.styl.js +1 -1
- package/dist/esm/src/components/ui/Chart/Chart.js +1 -2
- package/dist/esm/src/components/ui/Dialog/Dialog.styl.js +1 -1
- package/dist/esm/src/components/ui/Drawer/Drawer.styl.js +1 -1
- package/dist/esm/src/components/ui/DropdownMenu/DropdownMenu.styl.js +1 -1
- package/dist/esm/src/components/ui/Foldable/Foldable.js +2 -2
- package/dist/esm/src/components/ui/Foldable/Foldable.styl.js +1 -1
- package/dist/esm/src/components/ui/MobileAdaptiveSelector/MobileAdaptiveSelector.styl.js +1 -1
- package/dist/esm/src/components/ui/Page/PageHeader/PageHeader.styl.js +1 -1
- package/dist/esm/src/components/ui/Select/Select.js +313 -5
- package/dist/esm/src/components/ui/Select/Select.styl.js +2 -2
- package/dist/esm/src/components/ui/Sheet/Sheet.styl.js +1 -1
- package/dist/esm/src/components/ui/SupplyChainMap/SupplyChainMap.js +384 -0
- package/dist/esm/src/components/ui/SupplyChainMap/SupplyChainMap.styl.js +7 -0
- package/dist/esm/src/components/ui/SupplyChainMap/map-colors.js +44 -0
- package/dist/esm/src/components/ui/SupplyChainMap/map-disclosure.js +142 -0
- package/dist/esm/src/components/ui/SupplyChainMap/map-labels.js +55 -0
- package/dist/esm/src/components/ui/SupplyChainMap/map-projection.js +186 -0
- package/dist/esm/src/components/ui/SupplyChainMap/supply-chain-map-clusters.js +96 -0
- package/dist/esm/src/components/ui/SupplyChainMap/supply-chain-map-draw.js +66 -0
- package/dist/esm/src/components/ui/SupplyChainMap/supply-chain-map-scene.js +59 -0
- package/dist/esm/src/components/ui/SupplyChainMap/supply-chain-map-types.js +10 -0
- package/dist/esm/src/components/ui/SupplyChainMap/use-map-base-renderer.js +122 -0
- package/dist/esm/src/components/ui/Table/Table.styl.js +1 -1
- package/dist/esm/src/components/ui/Tabs/Tabs.styl.js +1 -1
- package/dist/esm/src/components/ui/Tooltip/Tooltip.styl.js +1 -1
- package/dist/esm/src/components/widgets/DriverCard/DriverPerformanceChart.js +1 -2
- package/dist/esm/src/index.js +2 -0
- package/dist/esm/types/src/components/ui/Select/Select.d.ts +3 -3
- package/dist/esm/types/src/components/ui/Select/Select.types.d.ts +3 -1
- package/dist/esm/types/src/components/ui/SupplyChainMap/SupplyChainMap.contract.test.d.ts +1 -0
- package/dist/esm/types/src/components/ui/SupplyChainMap/SupplyChainMap.d.ts +2 -0
- package/dist/esm/types/src/components/ui/SupplyChainMap/SupplyChainMap.example.d.ts +1 -0
- package/dist/esm/types/src/components/ui/SupplyChainMap/SupplyChainMap.render.worker.d.ts +15 -0
- package/dist/esm/types/src/components/ui/SupplyChainMap/SupplyChainMap.types.d.ts +10 -0
- package/dist/esm/types/src/components/ui/SupplyChainMap/index.d.ts +3 -0
- package/dist/esm/types/src/components/ui/SupplyChainMap/map-colors.d.ts +43 -0
- package/dist/esm/types/src/components/ui/SupplyChainMap/map-disclosure.d.ts +35 -0
- package/dist/esm/types/src/components/ui/SupplyChainMap/map-disclosure.test.d.ts +1 -0
- package/dist/esm/types/src/components/ui/SupplyChainMap/map-labels.d.ts +14 -0
- package/dist/esm/types/src/components/ui/SupplyChainMap/map-labels.test.d.ts +1 -0
- package/dist/esm/types/src/components/ui/SupplyChainMap/map-projection.d.ts +83 -0
- package/dist/esm/types/src/components/ui/SupplyChainMap/map-projection.test.d.ts +1 -0
- package/dist/esm/types/src/components/ui/SupplyChainMap/supply-chain-map-clusters.d.ts +25 -0
- package/dist/esm/types/src/components/ui/SupplyChainMap/supply-chain-map-clusters.test.d.ts +1 -0
- package/dist/esm/types/src/components/ui/SupplyChainMap/supply-chain-map-draw.d.ts +30 -0
- package/dist/esm/types/src/components/ui/SupplyChainMap/supply-chain-map-scene.d.ts +28 -0
- package/dist/esm/types/src/components/ui/SupplyChainMap/supply-chain-map-scene.test.d.ts +1 -0
- package/dist/esm/types/src/components/ui/SupplyChainMap/supply-chain-map-types.d.ts +31 -0
- package/dist/esm/types/src/components/ui/SupplyChainMap/use-map-base-renderer.d.ts +14 -0
- package/dist/esm/types/src/docs/pages/BannerPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/SupplyChainMapPage.d.ts +1 -0
- package/dist/esm/types/src/index.d.ts +1 -0
- package/dist/esm/types/src/lib/logger.d.ts +1 -0
- package/package.json +7 -1
- package/src/components/ui/Banner/Banner.styl +1 -1
- package/src/components/ui/Dialog/Dialog.styl +2 -2
- package/src/components/ui/Drawer/Drawer.styl +2 -2
- package/src/components/ui/DropdownMenu/DropdownMenu.styl +2 -2
- package/src/components/ui/Foldable/Foldable.styl +1 -1
- package/src/components/ui/Foldable/Foldable.tsx +2 -2
- package/src/components/ui/MobileAdaptiveSelector/MobileAdaptiveSelector.styl +1 -1
- package/src/components/ui/Page/PageHeader/PageHeader.styl +1 -1
- package/src/components/ui/Select/AGENT.md +3 -1
- package/src/components/ui/Select/Select.styl +31 -0
- package/src/components/ui/Select/Select.styl.d.ts +3 -0
- package/src/components/ui/Select/Select.tsx +506 -4
- package/src/components/ui/Select/Select.types.ts +3 -1
- package/src/components/ui/Sheet/Sheet.styl +2 -2
- package/src/components/ui/SupplyChainMap/AGENT.md +45 -0
- package/src/components/ui/SupplyChainMap/SupplyChainMap.contract.test.ts +45 -0
- package/src/components/ui/SupplyChainMap/SupplyChainMap.example.tsx +176 -0
- package/src/components/ui/SupplyChainMap/SupplyChainMap.render.worker.ts +63 -0
- package/src/components/ui/SupplyChainMap/SupplyChainMap.styl +221 -0
- package/src/components/ui/SupplyChainMap/SupplyChainMap.styl.d.ts +25 -0
- package/src/components/ui/SupplyChainMap/SupplyChainMap.tsx +720 -0
- package/src/components/ui/SupplyChainMap/SupplyChainMap.types.ts +15 -0
- package/src/components/ui/SupplyChainMap/index.ts +11 -0
- package/src/components/ui/SupplyChainMap/map-colors.ts +66 -0
- package/src/components/ui/SupplyChainMap/map-disclosure.test.ts +237 -0
- package/src/components/ui/SupplyChainMap/map-disclosure.ts +226 -0
- package/src/components/ui/SupplyChainMap/map-labels.test.ts +102 -0
- package/src/components/ui/SupplyChainMap/map-labels.ts +85 -0
- package/src/components/ui/SupplyChainMap/map-projection.test.ts +172 -0
- package/src/components/ui/SupplyChainMap/map-projection.ts +281 -0
- package/src/components/ui/SupplyChainMap/supply-chain-map-clusters.test.ts +182 -0
- package/src/components/ui/SupplyChainMap/supply-chain-map-clusters.ts +127 -0
- package/src/components/ui/SupplyChainMap/supply-chain-map-draw.ts +114 -0
- package/src/components/ui/SupplyChainMap/supply-chain-map-scene.test.ts +196 -0
- package/src/components/ui/SupplyChainMap/supply-chain-map-scene.ts +118 -0
- package/src/components/ui/SupplyChainMap/supply-chain-map-types.ts +45 -0
- package/src/components/ui/SupplyChainMap/use-map-base-renderer.ts +145 -0
- package/src/components/ui/Table/Table.styl +3 -3
- package/src/components/ui/Tabs/Tabs.styl +1 -1
- package/src/components/ui/Tooltip/Tooltip.styl +7 -2
- package/src/declarations.d.ts +4 -0
- package/src/docs/pages/BannerPage.tsx +83 -0
- package/src/docs/pages/FeedbackOverviewPage.tsx +7 -1
- package/src/docs/pages/SelectPage.tsx +30 -1
- package/src/docs/pages/SupplyChainMapPage.tsx +21 -0
- package/src/docs/registry.ts +12 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
const CHAR_PX = 6.2;
|
|
2
|
+
const PAD_PX = 14;
|
|
3
|
+
const LABEL_H = 18;
|
|
4
|
+
const LABEL_OFFSET_X = 12;
|
|
5
|
+
const LABEL_OFFSET_Y = 0;
|
|
6
|
+
const OFFSCREEN_MARGIN = 60;
|
|
7
|
+
function overlaps(a, b, padding) {
|
|
8
|
+
return (a.x < b.x + b.w + padding &&
|
|
9
|
+
a.x + a.w + padding > b.x &&
|
|
10
|
+
a.y < b.y + b.h + padding &&
|
|
11
|
+
a.y + a.h + padding > b.y);
|
|
12
|
+
}
|
|
13
|
+
function declutter(boxes, padding = 2) {
|
|
14
|
+
const ordered = [...boxes].sort((a, b) => b.priority - a.priority || (a.id < b.id ? -1 : 1));
|
|
15
|
+
const placed = [];
|
|
16
|
+
const kept = new Set();
|
|
17
|
+
for (const box of ordered) {
|
|
18
|
+
if (box.w <= 0 || box.h <= 0)
|
|
19
|
+
continue;
|
|
20
|
+
if (placed.some(p => overlaps(p, box, padding)))
|
|
21
|
+
continue;
|
|
22
|
+
placed.push(box);
|
|
23
|
+
kept.add(box.id);
|
|
24
|
+
}
|
|
25
|
+
return kept;
|
|
26
|
+
}
|
|
27
|
+
function placeMapLabels(labels, project, width, height) {
|
|
28
|
+
const placed = [];
|
|
29
|
+
const boxes = [];
|
|
30
|
+
for (const [i, label] of labels.entries()) {
|
|
31
|
+
const p = project(label.lat, label.lng);
|
|
32
|
+
if (!p)
|
|
33
|
+
continue;
|
|
34
|
+
const [x, y] = p;
|
|
35
|
+
if (x < -OFFSCREEN_MARGIN ||
|
|
36
|
+
x > width + OFFSCREEN_MARGIN ||
|
|
37
|
+
y < -OFFSCREEN_MARGIN ||
|
|
38
|
+
y > height + OFFSCREEN_MARGIN) {
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
placed.push({ ...label, x, y });
|
|
42
|
+
boxes.push({
|
|
43
|
+
id: label.id,
|
|
44
|
+
x: x + LABEL_OFFSET_X,
|
|
45
|
+
y: y + LABEL_OFFSET_Y - LABEL_H / 2,
|
|
46
|
+
w: PAD_PX + label.text.length * CHAR_PX,
|
|
47
|
+
h: LABEL_H,
|
|
48
|
+
priority: labels.length - i,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
const kept = declutter(boxes);
|
|
52
|
+
return placed.filter(l => kept.has(l.id));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export { LABEL_OFFSET_X, LABEL_OFFSET_Y, placeMapLabels };
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { geoNaturalEarth1, geoPath } from 'd3-geo';
|
|
2
|
+
|
|
3
|
+
// The flat map's projection and camera (components/supply-chain-map.tsx): where
|
|
4
|
+
// a lat/lng lands on the canvas, how the reader pans and zooms, and how a zoom
|
|
5
|
+
// level translates into the altitude vocabulary the globe's scene code already
|
|
6
|
+
// speaks (label tiers, lane-width rungs, admin-1 reveal). No canvas, no React —
|
|
7
|
+
// table-tested in lib/map-projection.test.ts.
|
|
8
|
+
//
|
|
9
|
+
// Natural Earth (geoNaturalEarth1) rather than Mercator or equirectangular: it
|
|
10
|
+
// is the projection tuned for exactly this reading — the whole world at once
|
|
11
|
+
// with landmasses at honest relative sizes — and it matches the globe's crafted
|
|
12
|
+
// look better than a web-tile grid would. d3-geo also resamples along great
|
|
13
|
+
// circles, so a two-point LineString drawn through it curves the way the same
|
|
14
|
+
// lane bows on the sphere.
|
|
15
|
+
const HOME_CAMERA = { k: 1, x: 0, y: 0 };
|
|
16
|
+
/** Zoomed all the way out the map IS the fitted world — there is nothing
|
|
17
|
+
* beyond it to show, so 1 is the floor rather than a preference. */
|
|
18
|
+
const MIN_ZOOM = 1;
|
|
19
|
+
/** Deep enough to separate two plants in one city (at a typical viewport this
|
|
20
|
+
* is a few tens of kilometres across), shallow enough that the 110m coastline
|
|
21
|
+
* under it has not visibly fallen apart. */
|
|
22
|
+
const MAX_ZOOM = 24;
|
|
23
|
+
/** One press of the +/- buttons. */
|
|
24
|
+
const ZOOM_STEP = 1.6;
|
|
25
|
+
/** Breathing room between the fitted world and the viewport edge, so the
|
|
26
|
+
* Antarctic coast is not kissing the canvas border. */
|
|
27
|
+
const FIT_PADDING_PX = 12;
|
|
28
|
+
/** How much of the viewport the world must always cover while panning — the
|
|
29
|
+
* clamp that stops a drag from throwing the planet off the canvas entirely. */
|
|
30
|
+
const MIN_WORLD_VISIBLE_PX = 120;
|
|
31
|
+
function clamp(v, lo, hi) {
|
|
32
|
+
return Math.min(hi, Math.max(lo, v));
|
|
33
|
+
}
|
|
34
|
+
/** The world fitted to this viewport, before any camera. Recomputed rather than
|
|
35
|
+
* cached: geoNaturalEarth1() is cheap arithmetic and a cache keyed on size
|
|
36
|
+
* would be one more thing that can disagree with the canvas. */
|
|
37
|
+
function fittedProjection(width, height) {
|
|
38
|
+
return geoNaturalEarth1().fitExtent([
|
|
39
|
+
[FIT_PADDING_PX, FIT_PADDING_PX],
|
|
40
|
+
[
|
|
41
|
+
Math.max(FIT_PADDING_PX + 1, width - FIT_PADDING_PX),
|
|
42
|
+
Math.max(FIT_PADDING_PX + 1, height - FIT_PADDING_PX),
|
|
43
|
+
],
|
|
44
|
+
], { type: 'Sphere' });
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The projection the camera sees. The camera transform (scale k, then translate
|
|
48
|
+
* x/y) composes with the base fit linearly, so it folds into the projection's
|
|
49
|
+
* own scale and translate — which is what lets d3's geoPath render polygons,
|
|
50
|
+
* graticule and resampled lines under the camera with no second transform pass
|
|
51
|
+
* (and no stroke widths scaling with the zoom).
|
|
52
|
+
*/
|
|
53
|
+
function mapProjection(width, height, camera) {
|
|
54
|
+
const base = fittedProjection(width, height);
|
|
55
|
+
const [tx, ty] = base.translate();
|
|
56
|
+
return geoNaturalEarth1()
|
|
57
|
+
.scale(base.scale() * camera.k)
|
|
58
|
+
.translate([tx * camera.k + camera.x, ty * camera.k + camera.y]);
|
|
59
|
+
}
|
|
60
|
+
/** Screen position of a place, or null for a point the projection rejects. */
|
|
61
|
+
function projectPoint(proj, lat, lng) {
|
|
62
|
+
const p = proj([lng, lat]);
|
|
63
|
+
return p ? [p[0], p[1]] : null;
|
|
64
|
+
}
|
|
65
|
+
/** The projected world's bounding box under this camera, in screen pixels.
|
|
66
|
+
* Measured off the base fit (fitExtent letterboxes — Natural Earth is wider
|
|
67
|
+
* than it is tall, so the sphere never fills a squarer viewport vertically)
|
|
68
|
+
* and then carried through the camera, which is linear. */
|
|
69
|
+
function worldBounds(width, height, camera) {
|
|
70
|
+
const base = fittedProjection(width, height);
|
|
71
|
+
const [[bx0, by0], [bx1, by1]] = geoPath(base).bounds({ type: 'Sphere' });
|
|
72
|
+
return {
|
|
73
|
+
x0: bx0 * camera.k + camera.x,
|
|
74
|
+
y0: by0 * camera.k + camera.y,
|
|
75
|
+
x1: bx1 * camera.k + camera.x,
|
|
76
|
+
y1: by1 * camera.k + camera.y,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Keep the world on the canvas. Zoom is clamped to the reachable range, and the
|
|
81
|
+
* translation so that at least MIN_WORLD_VISIBLE_PX of the world's box remains
|
|
82
|
+
* in view on each axis — a drag can park the map half off-screen, never lose it.
|
|
83
|
+
*/
|
|
84
|
+
function clampCamera(camera, width, height) {
|
|
85
|
+
const k = clamp(camera.k, MIN_ZOOM, MAX_ZOOM);
|
|
86
|
+
const probe = { k, x: camera.x, y: camera.y };
|
|
87
|
+
const box = worldBounds(width, height, probe);
|
|
88
|
+
const w = box.x1 - box.x0;
|
|
89
|
+
const h = box.y1 - box.y0;
|
|
90
|
+
const visible = Math.min(MIN_WORLD_VISIBLE_PX, w / 2, h / 2);
|
|
91
|
+
// The box must keep `visible` px inside [0,width] x [0,height].
|
|
92
|
+
const minX = visible - (box.x1 - probe.x); // world right edge >= visible
|
|
93
|
+
const maxX = width - visible - (box.x0 - probe.x); // world left edge <= width - visible
|
|
94
|
+
const minY = visible - (box.y1 - probe.y);
|
|
95
|
+
const maxY = height - visible - (box.y0 - probe.y);
|
|
96
|
+
return {
|
|
97
|
+
k,
|
|
98
|
+
x: clamp(probe.x, minX, maxX),
|
|
99
|
+
y: clamp(probe.y, minY, maxY),
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
/** Slide the camera by a screen-pixel delta (the drag gesture). */
|
|
103
|
+
function panCamera(camera, dx, dy, width, height) {
|
|
104
|
+
return clampCamera({ k: camera.k, x: camera.x + dx, y: camera.y + dy }, width, height);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Zoom by `factor` keeping the screen point `at` over the same place — the
|
|
108
|
+
* wheel gesture's contract. Derivation: a base-projected point v lands at
|
|
109
|
+
* screen s = k·v + t, so holding s fixed across k -> k' means
|
|
110
|
+
* t' = s - (k'/k)(s - t).
|
|
111
|
+
*/
|
|
112
|
+
function zoomCamera(camera, factor, at, width, height) {
|
|
113
|
+
const k = clamp(camera.k * factor, MIN_ZOOM, MAX_ZOOM);
|
|
114
|
+
const ratio = k / camera.k;
|
|
115
|
+
return clampCamera({
|
|
116
|
+
k,
|
|
117
|
+
x: at.x - ratio * (at.x - camera.x),
|
|
118
|
+
y: at.y - ratio * (at.y - camera.y),
|
|
119
|
+
}, width, height);
|
|
120
|
+
}
|
|
121
|
+
/** A camera holding this place at the viewport centre, at zoom k. */
|
|
122
|
+
function cameraCenteredOn(lat, lng, k, width, height) {
|
|
123
|
+
const base = fittedProjection(width, height);
|
|
124
|
+
const p = base([lng, lat]);
|
|
125
|
+
if (!p)
|
|
126
|
+
return clampCamera({ k, x: 0, y: 0 }, width, height);
|
|
127
|
+
return clampCamera({ k, x: width / 2 - k * p[0], y: height / 2 - k * p[1] }, width, height);
|
|
128
|
+
}
|
|
129
|
+
/** Breathing room around a fitted set of points — same intent as the globe's
|
|
130
|
+
* FIT_MARGIN: endpoints land inside the frame, not on its rim. */
|
|
131
|
+
const FIT_POINTS_MARGIN = 1.25;
|
|
132
|
+
/**
|
|
133
|
+
* A camera that frames every one of these points at once — the flat analogue of
|
|
134
|
+
* the globe's povFitPoints. Framing is done in base-projected space, where there
|
|
135
|
+
* is no antimeridian to straddle: two points either side of the dateline project
|
|
136
|
+
* to the two edges of the map, and the honest answer there is a wide view, not a
|
|
137
|
+
* wrapped one.
|
|
138
|
+
*/
|
|
139
|
+
function cameraFitPoints(points, width, height) {
|
|
140
|
+
if (points.length === 0)
|
|
141
|
+
return clampCamera(HOME_CAMERA, width, height);
|
|
142
|
+
const base = fittedProjection(width, height);
|
|
143
|
+
let x0 = Infinity;
|
|
144
|
+
let y0 = Infinity;
|
|
145
|
+
let x1 = -Infinity;
|
|
146
|
+
let y1 = -Infinity;
|
|
147
|
+
for (const pt of points) {
|
|
148
|
+
const p = base([pt.lng, pt.lat]);
|
|
149
|
+
if (!p)
|
|
150
|
+
continue;
|
|
151
|
+
x0 = Math.min(x0, p[0]);
|
|
152
|
+
y0 = Math.min(y0, p[1]);
|
|
153
|
+
x1 = Math.max(x1, p[0]);
|
|
154
|
+
y1 = Math.max(y1, p[1]);
|
|
155
|
+
}
|
|
156
|
+
if (!Number.isFinite(x0))
|
|
157
|
+
return clampCamera(HOME_CAMERA, width, height);
|
|
158
|
+
if (points.length === 1) {
|
|
159
|
+
return cameraCenteredOn(points[0].lat, points[0].lng, FOCUS_ZOOM, width, height);
|
|
160
|
+
}
|
|
161
|
+
const spanW = Math.max(1, (x1 - x0) * FIT_POINTS_MARGIN);
|
|
162
|
+
const spanH = Math.max(1, (y1 - y0) * FIT_POINTS_MARGIN);
|
|
163
|
+
const k = clamp(Math.min(width / spanW, height / spanH), MIN_ZOOM, MAX_ZOOM);
|
|
164
|
+
const cx = (x0 + x1) / 2;
|
|
165
|
+
const cy = (y0 + y1) / 2;
|
|
166
|
+
return clampCamera({ k, x: width / 2 - k * cx, y: height / 2 - k * cy }, width, height);
|
|
167
|
+
}
|
|
168
|
+
/** The zoom a single-target fly-to lands at: close enough that the node's city
|
|
169
|
+
* and neighbours read, far enough that there is context around it. */
|
|
170
|
+
const FOCUS_ZOOM = 6;
|
|
171
|
+
/**
|
|
172
|
+
* The globe-altitude this zoom level corresponds to.
|
|
173
|
+
*
|
|
174
|
+
* The scene code speaks altitude everywhere — labelTier, laneZoomT, the admin-1
|
|
175
|
+
* reveal — and re-deriving three parallel zoom ladders for the flat map would
|
|
176
|
+
* guarantee the two views disagree about when detail arrives. So the map speaks
|
|
177
|
+
* altitude too, through this one mapping: at k = 1 the whole world is in frame,
|
|
178
|
+
* which on the globe is the far end of the wheel (2.2 is the intro's own pull-
|
|
179
|
+
* back altitude); every doubling of zoom halves the "height". Clamped to the
|
|
180
|
+
* globe's reachable range so every consumer sees numbers it was tuned for.
|
|
181
|
+
*/
|
|
182
|
+
function syntheticAltitude(k) {
|
|
183
|
+
return clamp(2.2 / Math.max(MIN_ZOOM, k), 0.12, 2.6);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export { FOCUS_ZOOM, HOME_CAMERA, MAX_ZOOM, MIN_ZOOM, ZOOM_STEP, cameraCenteredOn, cameraFitPoints, clampCamera, mapProjection, panCamera, projectPoint, syntheticAltitude, zoomCamera };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// Screen-space clustering for the flat supply-chain map.
|
|
2
|
+
//
|
|
3
|
+
// Supercluster / Mapbox is the usual default for millions of lon/lat points, but
|
|
4
|
+
// it speaks Web Mercator integer zoom. This map uses Natural Earth plus a
|
|
5
|
+
// continuous camera.k, with tens-to-hundreds of confirmed sites — not a tile
|
|
6
|
+
// grid. Clustering in projected pixels tracks zoom for free: the same two plants
|
|
7
|
+
// merge when they overlap on screen and split as the reader flies in.
|
|
8
|
+
//
|
|
9
|
+
// Connected components (not a first-come greedy grab) so A~B and B~C become one
|
|
10
|
+
// cluster even when A is just outside C's radius.
|
|
11
|
+
const CLUSTER_RADIUS_PX = 40;
|
|
12
|
+
/** Force-open expires once the camera zooms out past the k recorded at expand. */
|
|
13
|
+
function forceOpenExpired(openedAtK, currentK) {
|
|
14
|
+
return currentK < openedAtK - 1e-6;
|
|
15
|
+
}
|
|
16
|
+
function find(parent, i) {
|
|
17
|
+
while (parent[i] !== i) {
|
|
18
|
+
parent[i] = parent[parent[i]];
|
|
19
|
+
i = parent[i];
|
|
20
|
+
}
|
|
21
|
+
return i;
|
|
22
|
+
}
|
|
23
|
+
function clusterMapNodes(nodes, project, radiusPx = CLUSTER_RADIUS_PX, expandIds) {
|
|
24
|
+
const projected = [];
|
|
25
|
+
for (const node of nodes) {
|
|
26
|
+
const p = project(node.lat, node.lng);
|
|
27
|
+
if (!p)
|
|
28
|
+
continue;
|
|
29
|
+
projected.push({ node, x: p[0], y: p[1] });
|
|
30
|
+
}
|
|
31
|
+
const n = projected.length;
|
|
32
|
+
const parent = Array.from({ length: n }, (_, i) => i);
|
|
33
|
+
const r2 = radiusPx * radiusPx;
|
|
34
|
+
for (let i = 0; i < n; i++) {
|
|
35
|
+
if (expandIds?.has(projected[i].node.id))
|
|
36
|
+
continue;
|
|
37
|
+
for (let j = i + 1; j < n; j++) {
|
|
38
|
+
if (expandIds?.has(projected[j].node.id))
|
|
39
|
+
continue;
|
|
40
|
+
const dx = projected[i].x - projected[j].x;
|
|
41
|
+
const dy = projected[i].y - projected[j].y;
|
|
42
|
+
if (dx * dx + dy * dy <= r2) {
|
|
43
|
+
const a = find(parent, i);
|
|
44
|
+
const b = find(parent, j);
|
|
45
|
+
if (a !== b)
|
|
46
|
+
parent[b] = a;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const groups = new Map();
|
|
51
|
+
for (let i = 0; i < n; i++) {
|
|
52
|
+
const root = find(parent, i);
|
|
53
|
+
const group = groups.get(root);
|
|
54
|
+
if (group)
|
|
55
|
+
group.push(projected[i]);
|
|
56
|
+
else
|
|
57
|
+
groups.set(root, [projected[i]]);
|
|
58
|
+
}
|
|
59
|
+
return [...groups.values()].map(members => {
|
|
60
|
+
members.sort((a, b) => (a.node.id < b.node.id ? -1 : 1));
|
|
61
|
+
const memberIds = members.map(m => m.node.id);
|
|
62
|
+
const lat = members.reduce((sum, m) => sum + m.node.lat, 0) / members.length;
|
|
63
|
+
const lng = members.reduce((sum, m) => sum + m.node.lng, 0) / members.length;
|
|
64
|
+
const singleton = members.length === 1;
|
|
65
|
+
return {
|
|
66
|
+
id: singleton ? members[0].node.id : `cluster:${memberIds[0]}`,
|
|
67
|
+
lat,
|
|
68
|
+
lng,
|
|
69
|
+
count: members.length,
|
|
70
|
+
memberIds,
|
|
71
|
+
nodeId: singleton ? members[0].node.id : null,
|
|
72
|
+
};
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function remapArcsToClusters(arcs, clusters) {
|
|
76
|
+
const clusterOf = new Map();
|
|
77
|
+
for (const cluster of clusters) {
|
|
78
|
+
for (const id of cluster.memberIds)
|
|
79
|
+
clusterOf.set(id, cluster);
|
|
80
|
+
}
|
|
81
|
+
const remapped = [];
|
|
82
|
+
for (const arc of arcs) {
|
|
83
|
+
const from = clusterOf.get(arc.fromEntity);
|
|
84
|
+
const to = clusterOf.get(arc.toEntity);
|
|
85
|
+
if (!from || !to || from.id === to.id)
|
|
86
|
+
continue;
|
|
87
|
+
remapped.push({
|
|
88
|
+
...arc,
|
|
89
|
+
from: [from.lng, from.lat],
|
|
90
|
+
to: [to.lng, to.lat],
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
return remapped;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export { CLUSTER_RADIUS_PX, clusterMapNodes, forceOpenExpired, remapArcsToClusters };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { geoPath, geoGraticule10 } from 'd3-geo';
|
|
2
|
+
import { feature } from 'topojson-client';
|
|
3
|
+
import worldData from 'world-atlas/countries-110m.json';
|
|
4
|
+
import { mapProjection, projectPoint } from './map-projection.js';
|
|
5
|
+
|
|
6
|
+
const topology = worldData;
|
|
7
|
+
const COUNTRY_FEATURES = feature(topology, topology.objects.countries)
|
|
8
|
+
.features;
|
|
9
|
+
function resizeMapCanvas(canvas, width, height, dpr) {
|
|
10
|
+
canvas.width = Math.round(width * dpr);
|
|
11
|
+
canvas.height = Math.round(height * dpr);
|
|
12
|
+
}
|
|
13
|
+
/** Land, ocean, graticule and arcs. Safe in a Worker — no DOM, no React. */
|
|
14
|
+
function paintSupplyChainMap(ctx, command) {
|
|
15
|
+
const { width, height, dpr, camera, arcs, palette } = command;
|
|
16
|
+
ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
|
|
17
|
+
ctx.clearRect(0, 0, width, height);
|
|
18
|
+
const proj = mapProjection(width, height, camera);
|
|
19
|
+
const path = geoPath(proj, ctx);
|
|
20
|
+
const draw = (obj) => {
|
|
21
|
+
ctx.beginPath();
|
|
22
|
+
path(obj);
|
|
23
|
+
};
|
|
24
|
+
draw({ type: 'Sphere' });
|
|
25
|
+
ctx.fillStyle = palette.ocean;
|
|
26
|
+
ctx.fill();
|
|
27
|
+
draw(geoGraticule10());
|
|
28
|
+
ctx.strokeStyle = palette.graticule;
|
|
29
|
+
ctx.lineWidth = 1;
|
|
30
|
+
ctx.stroke();
|
|
31
|
+
for (const f of COUNTRY_FEATURES) {
|
|
32
|
+
draw(f.geometry);
|
|
33
|
+
ctx.fillStyle = palette.land;
|
|
34
|
+
ctx.fill();
|
|
35
|
+
}
|
|
36
|
+
ctx.beginPath();
|
|
37
|
+
for (const f of COUNTRY_FEATURES)
|
|
38
|
+
path(f.geometry);
|
|
39
|
+
ctx.strokeStyle = palette.landStroke;
|
|
40
|
+
ctx.lineWidth = 0.7;
|
|
41
|
+
ctx.stroke();
|
|
42
|
+
const hitLanes = [];
|
|
43
|
+
for (const a of arcs) {
|
|
44
|
+
draw({
|
|
45
|
+
type: 'LineString',
|
|
46
|
+
coordinates: [a.from, a.to],
|
|
47
|
+
});
|
|
48
|
+
ctx.strokeStyle = a.color;
|
|
49
|
+
ctx.globalAlpha = a.alpha;
|
|
50
|
+
ctx.lineWidth = 2;
|
|
51
|
+
ctx.lineCap = 'round';
|
|
52
|
+
ctx.stroke();
|
|
53
|
+
ctx.globalAlpha = 1;
|
|
54
|
+
const flat = [];
|
|
55
|
+
for (const [lng, lat] of [a.from, a.to]) {
|
|
56
|
+
const q = projectPoint(proj, lat, lng);
|
|
57
|
+
if (q)
|
|
58
|
+
flat.push(q);
|
|
59
|
+
}
|
|
60
|
+
if (flat.length > 1)
|
|
61
|
+
hitLanes.push({ id: a.id, points: flat });
|
|
62
|
+
}
|
|
63
|
+
return hitLanes;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { paintSupplyChainMap, resizeMapCanvas };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import 'd3-geo';
|
|
2
|
+
|
|
3
|
+
function isValidCoordinate(lat, lng) {
|
|
4
|
+
return (Number.isFinite(lat) &&
|
|
5
|
+
Number.isFinite(lng) &&
|
|
6
|
+
lat >= -90 &&
|
|
7
|
+
lat <= 90 &&
|
|
8
|
+
lng >= -180 &&
|
|
9
|
+
lng <= 180);
|
|
10
|
+
}
|
|
11
|
+
function buildConfirmedMapScene(entities, edges) {
|
|
12
|
+
const nodes = entities.flatMap(entity => {
|
|
13
|
+
const geo = entity.geo;
|
|
14
|
+
if (entity.status !== 'confirmed' ||
|
|
15
|
+
!geo ||
|
|
16
|
+
!isValidCoordinate(geo.lat, geo.lng)) {
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
return [
|
|
20
|
+
{
|
|
21
|
+
id: entity.id,
|
|
22
|
+
name: entity.name,
|
|
23
|
+
type: entity.type,
|
|
24
|
+
lat: geo.lat,
|
|
25
|
+
lng: geo.lng,
|
|
26
|
+
precision: geo.precision,
|
|
27
|
+
place: geo.place,
|
|
28
|
+
country: geo.country,
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
});
|
|
32
|
+
const nodesById = new Map(nodes.map(node => [node.id, node]));
|
|
33
|
+
const arcs = edges.flatMap(edge => {
|
|
34
|
+
if (edge.status !== 'confirmed')
|
|
35
|
+
return [];
|
|
36
|
+
const from = nodesById.get(edge.from_entity);
|
|
37
|
+
const to = nodesById.get(edge.to_entity);
|
|
38
|
+
if (!from || !to)
|
|
39
|
+
return [];
|
|
40
|
+
return [
|
|
41
|
+
{
|
|
42
|
+
id: edge.id,
|
|
43
|
+
fromEntity: from.id,
|
|
44
|
+
toEntity: to.id,
|
|
45
|
+
relation: edge.relation,
|
|
46
|
+
from: [from.lng, from.lat],
|
|
47
|
+
to: [to.lng, to.lat],
|
|
48
|
+
},
|
|
49
|
+
];
|
|
50
|
+
});
|
|
51
|
+
return { nodes, arcs };
|
|
52
|
+
}
|
|
53
|
+
function resolveMapSelection(selected, nodes) {
|
|
54
|
+
if (!selected)
|
|
55
|
+
return null;
|
|
56
|
+
return nodes.find(node => node.id === selected.id) ?? null;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export { buildConfirmedMapScene, resolveMapSelection };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Minimal graph types the map needs. Compatible with onboarding Entity/Edge. */
|
|
2
|
+
function activeMapCascade(overlay) {
|
|
3
|
+
if (!overlay)
|
|
4
|
+
return undefined;
|
|
5
|
+
return overlay.onPathIds.size > 0 || overlay.laneIds.size > 0
|
|
6
|
+
? overlay
|
|
7
|
+
: undefined;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { activeMapCascade };
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { useState, useRef, useEffect } from 'react';
|
|
2
|
+
import { resizeMapCanvas, paintSupplyChainMap } from './supply-chain-map-draw.js';
|
|
3
|
+
|
|
4
|
+
function canUseOffscreenWorker(canvas) {
|
|
5
|
+
return (typeof Worker !== 'undefined' &&
|
|
6
|
+
typeof OffscreenCanvas !== 'undefined' &&
|
|
7
|
+
typeof canvas.transferControlToOffscreen === 'function');
|
|
8
|
+
}
|
|
9
|
+
function paintOnMain(canvas, command) {
|
|
10
|
+
resizeMapCanvas(canvas, command.width, command.height, command.dpr);
|
|
11
|
+
const ctx = canvas.getContext('2d');
|
|
12
|
+
if (!ctx)
|
|
13
|
+
return [];
|
|
14
|
+
return paintSupplyChainMap(ctx, command);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Paints the basemap (land / ocean / graticule / arcs) on an OffscreenCanvas in
|
|
18
|
+
* a Worker when the browser allows it, so projection and rasterization do not
|
|
19
|
+
* hitch the main thread during pan/zoom. Falls back to the same paint path on
|
|
20
|
+
* the main thread. `canvasKey` must be set on the <canvas> so a transferred
|
|
21
|
+
* canvas can be replaced if we drop back to main-thread painting.
|
|
22
|
+
*/
|
|
23
|
+
function useMapBaseRenderer(canvasRef, command, onHitLanes, enabled = true) {
|
|
24
|
+
const [mode, setMode] = useState('pending');
|
|
25
|
+
const [canvasKey, setCanvasKey] = useState(0);
|
|
26
|
+
const forceMainRef = useRef(false);
|
|
27
|
+
const ownsCanvasRef = useRef(true);
|
|
28
|
+
const workerRef = useRef(null);
|
|
29
|
+
const onHitLanesRef = useRef(onHitLanes);
|
|
30
|
+
onHitLanesRef.current = onHitLanes;
|
|
31
|
+
const commandRef = useRef(command);
|
|
32
|
+
commandRef.current = command;
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
ownsCanvasRef.current = true;
|
|
35
|
+
if (!enabled) {
|
|
36
|
+
setMode('pending');
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const canvas = canvasRef.current;
|
|
40
|
+
if (!canvas || forceMainRef.current || !canUseOffscreenWorker(canvas)) {
|
|
41
|
+
setMode('main');
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
let worker;
|
|
45
|
+
try {
|
|
46
|
+
// Bundlers (webpack docs, Vite, Next) resolve this worker entry.
|
|
47
|
+
// Published Rollup output may keep a .ts URL — paint then falls back
|
|
48
|
+
// to the main-thread path below.
|
|
49
|
+
worker = new Worker(new URL('./SupplyChainMap.render.worker.ts', import.meta.url));
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
forceMainRef.current = true;
|
|
53
|
+
setMode('main');
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const remountOnMain = () => {
|
|
57
|
+
worker.terminate();
|
|
58
|
+
workerRef.current = null;
|
|
59
|
+
if (forceMainRef.current && !ownsCanvasRef.current)
|
|
60
|
+
return;
|
|
61
|
+
forceMainRef.current = true;
|
|
62
|
+
ownsCanvasRef.current = false;
|
|
63
|
+
setMode('main');
|
|
64
|
+
setCanvasKey(n => n + 1);
|
|
65
|
+
};
|
|
66
|
+
try {
|
|
67
|
+
const offscreen = canvas.transferControlToOffscreen();
|
|
68
|
+
ownsCanvasRef.current = false;
|
|
69
|
+
const init = { type: 'init', canvas: offscreen };
|
|
70
|
+
worker.postMessage(init, [offscreen]);
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
worker.terminate();
|
|
74
|
+
workerRef.current = null;
|
|
75
|
+
forceMainRef.current = true;
|
|
76
|
+
ownsCanvasRef.current = false;
|
|
77
|
+
setMode('main');
|
|
78
|
+
setCanvasKey(n => n + 1);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
worker.onmessage = (event) => {
|
|
82
|
+
if (event.data.type === 'hitLanes') {
|
|
83
|
+
onHitLanesRef.current(event.data.lanes);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
remountOnMain();
|
|
87
|
+
};
|
|
88
|
+
workerRef.current = worker;
|
|
89
|
+
setMode('worker');
|
|
90
|
+
const latest = commandRef.current;
|
|
91
|
+
if (latest) {
|
|
92
|
+
const draw = { type: 'draw', command: latest };
|
|
93
|
+
worker.postMessage(draw);
|
|
94
|
+
}
|
|
95
|
+
return () => {
|
|
96
|
+
worker.terminate();
|
|
97
|
+
workerRef.current = null;
|
|
98
|
+
};
|
|
99
|
+
}, [canvasRef, canvasKey, enabled]);
|
|
100
|
+
useEffect(() => {
|
|
101
|
+
if (!command || mode === 'pending')
|
|
102
|
+
return;
|
|
103
|
+
const worker = workerRef.current;
|
|
104
|
+
if (mode === 'worker' && worker) {
|
|
105
|
+
const draw = { type: 'draw', command };
|
|
106
|
+
worker.postMessage(draw);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
const canvas = canvasRef.current;
|
|
110
|
+
if (!canvas || mode !== 'main' || !ownsCanvasRef.current)
|
|
111
|
+
return;
|
|
112
|
+
try {
|
|
113
|
+
onHitLanesRef.current(paintOnMain(canvas, command));
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
ownsCanvasRef.current = false;
|
|
117
|
+
}
|
|
118
|
+
}, [canvasRef, canvasKey, command, mode]);
|
|
119
|
+
return { mode, canvasKey };
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export { useMapBaseRenderer };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styleInject from 'style-inject';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".Table_tableContainer__5D8Ht{overflow-x:auto;position:relative;width:100%}.Table_scrollContainer__8-Zr9{width:100%}.Table_scrollInner__QcOf7{display:block}.Table_scrollbar__Zs9-w{bottom:-6px}.Table_withBackground__ASHzK{background-color:var(--background);border-radius:var(--p-4);padding:0 var(--p-6)}.Table_table__OuLba{caption-side:bottom;font-size:var(--text-sm);overflow:hidden;width:100%}.Table_table__OuLba[data-size=sm]{font-size:var(--text-xs)}.Table_table__OuLba[data-size=sm] .Table_tableCell__rJJqf,.Table_table__OuLba[data-size=sm] .Table_tableHead__SSL9f{height:auto;padding:var(--p-2) var(--p-3)}.Table_table__OuLba[data-size=md]{font-size:var(--text-sm)}.Table_table__OuLba[data-size=md] .Table_tableCell__rJJqf,.Table_table__OuLba[data-size=md] .Table_tableHead__SSL9f{height:auto;padding:var(--p-3) var(--p-4)}.Table_table__OuLba[data-size=lg]{font-size:var(--text-base)}.Table_table__OuLba[data-size=lg] .Table_tableCell__rJJqf,.Table_table__OuLba[data-size=lg] .Table_tableHead__SSL9f{height:auto;padding:var(--p-5) var(--p-5)}.Table_table__OuLba.Table_withPaddings__zUGoU .Table_tableCell__rJJqf:first-child,.Table_table__OuLba.Table_withPaddings__zUGoU .Table_tableHead__SSL9f:first-child{padding-left:var(--p-6)}.Table_table__OuLba.Table_withPaddings__zUGoU .Table_tableCell__rJJqf:last-child,.Table_table__OuLba.Table_withPaddings__zUGoU .Table_tableHead__SSL9f:last-child{padding-right:var(--p-6)}.Table_tableBody__YyhVh{position:relative}.Table_tableBody__YyhVh tr:last-child{border-bottom:0}.Table_tableFooter__CJXND{background-color:var(--muted-50);font-weight:500}.Table_tableFooter__CJXND tr:
|
|
3
|
+
var css_248z = ".Table_tableContainer__5D8Ht{overflow-x:auto;position:relative;width:100%}.Table_scrollContainer__8-Zr9{width:100%}.Table_scrollInner__QcOf7{display:block}.Table_scrollbar__Zs9-w{bottom:-6px}.Table_withBackground__ASHzK{background-color:var(--background);border-radius:var(--p-4);padding:0 var(--p-6)}.Table_table__OuLba{caption-side:bottom;font-size:var(--text-sm);overflow:hidden;width:100%}.Table_table__OuLba[data-size=sm]{font-size:var(--text-xs)}.Table_table__OuLba[data-size=sm] .Table_tableCell__rJJqf,.Table_table__OuLba[data-size=sm] .Table_tableHead__SSL9f{height:auto;padding:var(--p-2) var(--p-3)}.Table_table__OuLba[data-size=md]{font-size:var(--text-sm)}.Table_table__OuLba[data-size=md] .Table_tableCell__rJJqf,.Table_table__OuLba[data-size=md] .Table_tableHead__SSL9f{height:auto;padding:var(--p-3) var(--p-4)}.Table_table__OuLba[data-size=lg]{font-size:var(--text-base)}.Table_table__OuLba[data-size=lg] .Table_tableCell__rJJqf,.Table_table__OuLba[data-size=lg] .Table_tableHead__SSL9f{height:auto;padding:var(--p-5) var(--p-5)}.Table_table__OuLba.Table_withPaddings__zUGoU .Table_tableCell__rJJqf:first-child,.Table_table__OuLba.Table_withPaddings__zUGoU .Table_tableHead__SSL9f:first-child{padding-left:var(--p-6)}.Table_table__OuLba.Table_withPaddings__zUGoU .Table_tableCell__rJJqf:last-child,.Table_table__OuLba.Table_withPaddings__zUGoU .Table_tableHead__SSL9f:last-child{padding-right:var(--p-6)}.Table_tableBody__YyhVh{position:relative}.Table_tableBody__YyhVh tr:last-child{border-bottom:0}.Table_tableFooter__CJXND{background-color:var(--muted-50);font-weight:500}.Table_tableFooter__CJXND tr:first-child,.Table_tableRow__CdFFX{border-top:1px solid var(--border)}.Table_tableRow__CdFFX{position:relative;transition-duration:.15s;transition-property:background-color,color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.Table_tableBody__YyhVh:last-child .Table_tableRow__CdFFX:last-child .Table_tableCell__rJJqf:first-child{border-bottom-left-radius:var(--p-3)}.Table_tableBody__YyhVh:last-child .Table_tableRow__CdFFX:last-child .Table_tableCell__rJJqf:last-child{border-bottom-right-radius:var(--p-3)}.Table_tableBody__YyhVh .Table_tableRow__CdFFX:focus-within,.Table_tableBody__YyhVh .Table_tableRow__CdFFX:hover,.Table_tableRow__CdFFX[data-state=selected]{background-color:var(--muted-50)}.Table_tableHead__SSL9f{color:var(--muted-foreground);font-weight:500;min-width:0;text-align:left;vertical-align:middle;white-space:nowrap}.Table_tableHead__SSL9f:has([role=checkbox]){padding-right:0}.Table_tableHead__SSL9f [role=checkbox]{transform:translateY(2px)}.Table_tableCell__rJJqf,.Table_tableHead__SSL9f{min-width:0;position:relative;vertical-align:middle;white-space:nowrap;z-index:1}.Table_tableCell__rJJqf:has([role=checkbox]),.Table_tableHead__SSL9f:has([role=checkbox]){padding-right:0}.Table_tableCell__rJJqf [role=checkbox],.Table_tableHead__SSL9f [role=checkbox]{transform:translateY(2px)}.Table_cellValue__WCD3J{align-items:center;color:var(--muted-foreground);display:flex;gap:var(--p-1)}";
|
|
4
4
|
var S = {"tableContainer":"Table_tableContainer__5D8Ht","scrollContainer":"Table_scrollContainer__8-Zr9","scrollInner":"Table_scrollInner__QcOf7","scrollbar":"Table_scrollbar__Zs9-w","withBackground":"Table_withBackground__ASHzK","table":"Table_table__OuLba","tableHead":"Table_tableHead__SSL9f","tableCell":"Table_tableCell__rJJqf","withPaddings":"Table_withPaddings__zUGoU","tableBody":"Table_tableBody__YyhVh","tableFooter":"Table_tableFooter__CJXND","tableRow":"Table_tableRow__CdFFX","cellValue":"Table_cellValue__WCD3J"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styleInject from 'style-inject';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".Tabs_root__cB9Au{display:flex;flex-direction:column;gap:.5rem}.Tabs_list__9Hs22{align-items:center;color:var(--muted-foreground);display:inline-flex;height:48px;justify-content:center;width:-moz-fit-content;width:fit-content}.Tabs_list__9Hs22.Tabs_fullWidth__Lj2Dd{width:100%}.Tabs_variant-link__xOMDg>.Tabs_list__9Hs22{background-color:transparent!important}.Tabs_variant-button__wtc8k .Tabs_list__9Hs22,.Tabs_variant-outline__2CJJg .Tabs_list__9Hs22{border-radius:1.5rem;box-shadow:none;gap:.25rem;height:auto}.Tabs_variant-outline__2CJJg .Tabs_list__9Hs22{background-color:transparent!important;gap:var(--p-2)}.Tabs_trigger__uzdqH{align-items:center;border:1px solid transparent;border-radius:.375rem;color:var(--muted-foreground);cursor:pointer;display:inline-flex;flex:1;font-size:var(--text-sm);font-weight:500;gap:.375rem;height:calc(100% - 1px);justify-content:center;padding:.25rem .5rem;transition:color .2s,box-shadow .2s;white-space:nowrap}.Tabs_trigger__uzdqH:focus-visible{border-color:var(--ring);box-shadow:0 0 0 3px var(--ring-50);outline:1px solid var(--ring);outline-offset:0}.Tabs_trigger__uzdqH:disabled{opacity:.5;pointer-events:none}.Tabs_trigger__uzdqH[data-state=active]{background-color:var(--background);box-shadow:0 1px 2px 0 rgba(0,0,0,.05)}.Tabs_trigger__uzdqH:hover,.Tabs_trigger__uzdqH[data-state=active]{color:var(--foreground)!important}.Tabs_darker__l-R0I .Tabs_trigger__uzdqH{background-color:var(--muted)}.Tabs_variant-button__wtc8k .Tabs_list__9Hs22 .Tabs_trigger__uzdqH{border:none;border-radius:var(--p-4);box-shadow:none;color:var(--muted-foreground);flex-shrink:0;font-weight:600;padding:var(--p-1) var(--p-3);transition:all .15s ease-in-out}.Tabs_variant-button__wtc8k .Tabs_list__9Hs22 .Tabs_trigger__uzdqH[data-state=active]{border-radius:var(--p-6);box-shadow:0 1px 2px 0 rgba(0,0,0,.05);color:var(--foreground)}.Tabs_variant-outline__2CJJg .Tabs_list__9Hs22 .Tabs_trigger__uzdqH{background-color:var(--background);border-radius:var(--p-6);color:var(--muted-foreground);flex-shrink:0;font-weight:500;padding:var(--p-1) var(--p-4);transition:box-shadow .15s ease-in-out,color .15s ease-in-out}.Tabs_variant-outline__2CJJg .Tabs_list__9Hs22 .Tabs_trigger__uzdqH:hover{color:var(--foreground)}.Tabs_variant-outline__2CJJg .Tabs_list__9Hs22 .Tabs_trigger__uzdqH[data-state=active]{background-color:var(--background);box-shadow:inset 0 0 0 1px var(--selected-tab-outline-color,var(--brand-color-400));color:var(--foreground)}.Tabs_variant-link__xOMDg>.Tabs_list__9Hs22 .Tabs_trigger__uzdqH{background-color:transparent!important;border:0!important;border-radius:0!important;box-shadow:0!important;font-size:16px;padding:12px 16px}.Tabs_variant-link__xOMDg>.Tabs_list__9Hs22 .Tabs_trigger__uzdqH[data-state=active]{box-shadow:inset 0 -3px 0 -1px var(--selected-tab-outline-color,var(--brand-color-400))!important}.Tabs_trigger__uzdqH svg{flex-shrink:0;pointer-events:none}.Tabs_trigger__uzdqH svg:not([class*=size-]){height:1rem;width:1rem}.dark .Tabs_trigger__uzdqH{color:var(--muted-foreground)}.dark .Tabs_trigger__uzdqH[data-state=active]{background-color:var(--input-30);border-color:var(--input);color:var(--foreground)}.dark .Tabs_variant-outline__2CJJg .Tabs_list__9Hs22 .Tabs_trigger__uzdqH[data-state=active]{background-color:var(--background);box-shadow:inset 0 0 0 1px var(--selected-tab-outline-color,var(--brand-color-400));color:var(--foreground)}.Tabs_content__K27Vl{flex:1;outline:none}.Tabs_content__K27Vl[hidden]{display:none!important}.Tabs_root__cB9Au.Tabs_variant-button__wtc8k.Tabs_sizeSm__gfpc6 .Tabs_list__9Hs22 .Tabs_trigger__uzdqH{font-size:var(--text-xs);padding:var(--p-1) var(--p-2)}.Tabs_root__cB9Au.Tabs_variant-button__wtc8k.Tabs_sizeSm__gfpc6 .Tabs_list__9Hs22 .Tabs_trigger__uzdqH[data-state=active]{border-radius:var(--p-4)}.Tabs_root__cB9Au.Tabs_variant-button__wtc8k.Tabs_sizeLg__CcRFZ .Tabs_list__9Hs22 .Tabs_trigger__uzdqH{font-size:var(--text-base);padding:var(--p-2) var(--p-4)}.Tabs_root__cB9Au.Tabs_variant-button__wtc8k.Tabs_sizeLg__CcRFZ .Tabs_list__9Hs22 .Tabs_trigger__uzdqH[data-state=active]{border-radius:var(--p-8)}.Tabs_root__cB9Au.Tabs_variant-outline__2CJJg.Tabs_sizeSm__gfpc6 .Tabs_list__9Hs22 .Tabs_trigger__uzdqH{border-radius:var(--p-4);font-size:var(--text-xs);padding:var(--p-1) var(--p-3)}.Tabs_root__cB9Au.Tabs_variant-outline__2CJJg.Tabs_sizeSm__gfpc6 .Tabs_list__9Hs22 .Tabs_trigger__uzdqH[data-state=active]{border-radius:var(--p-4)}.Tabs_root__cB9Au.Tabs_variant-outline__2CJJg.Tabs_sizeLg__CcRFZ .Tabs_list__9Hs22 .Tabs_trigger__uzdqH{border-radius:var(--p-8);font-size:var(--text-base);padding:var(--p-2) var(--p-5)}.Tabs_root__cB9Au.Tabs_variant-outline__2CJJg.Tabs_sizeLg__CcRFZ .Tabs_list__9Hs22 .Tabs_trigger__uzdqH[data-state=active]{border-radius:var(--p-8)}.Tabs_root__cB9Au.Tabs_variant-link__xOMDg.Tabs_sizeSm__gfpc6>.Tabs_list__9Hs22{height:auto;min-height:36px}.Tabs_root__cB9Au.Tabs_variant-link__xOMDg.Tabs_sizeSm__gfpc6>.Tabs_list__9Hs22 .Tabs_trigger__uzdqH{font-size:14px;padding:8px 12px}.Tabs_root__cB9Au.Tabs_variant-link__xOMDg.Tabs_sizeLg__CcRFZ>.Tabs_list__9Hs22{height:auto;min-height:56px}.Tabs_root__cB9Au.Tabs_variant-link__xOMDg.Tabs_sizeLg__CcRFZ>.Tabs_list__9Hs22 .Tabs_trigger__uzdqH{font-size:18px;padding:16px 24px}";
|
|
3
|
+
var css_248z = ".Tabs_root__cB9Au{display:flex;flex-direction:column;gap:.5rem}.Tabs_list__9Hs22{align-items:center;color:var(--muted-foreground);display:inline-flex;height:48px;justify-content:center;width:-moz-fit-content;width:fit-content}.Tabs_list__9Hs22.Tabs_fullWidth__Lj2Dd{width:100%}.Tabs_variant-link__xOMDg>.Tabs_list__9Hs22{background-color:transparent!important}.Tabs_variant-button__wtc8k .Tabs_list__9Hs22,.Tabs_variant-outline__2CJJg .Tabs_list__9Hs22{border-radius:1.5rem;box-shadow:none;gap:.25rem;height:auto}.Tabs_variant-outline__2CJJg .Tabs_list__9Hs22{background-color:transparent!important;gap:var(--p-2)}.Tabs_trigger__uzdqH{align-items:center;border:1px solid transparent;border-radius:.375rem;color:var(--muted-foreground);cursor:pointer;display:inline-flex;flex:1;font-size:var(--text-sm);font-weight:500;gap:.375rem;height:calc(100% - 1px);justify-content:center;padding:.25rem .5rem;transition:color .2s,box-shadow .2s;white-space:nowrap}.Tabs_trigger__uzdqH:focus-visible{border-color:var(--ring);box-shadow:0 0 0 3px var(--ring-50);outline:1px solid var(--ring);outline-offset:0}.Tabs_trigger__uzdqH:disabled{opacity:.5;pointer-events:none}.Tabs_trigger__uzdqH[data-state=active]{background-color:var(--background);box-shadow:0 1px 2px 0 rgba(0,0,0,.05)}.Tabs_trigger__uzdqH:hover,.Tabs_trigger__uzdqH[data-state=active]{color:var(--foreground)!important}.Tabs_darker__l-R0I .Tabs_trigger__uzdqH{background-color:var(--muted)}.Tabs_variant-button__wtc8k .Tabs_list__9Hs22 .Tabs_trigger__uzdqH{border:none;border-radius:var(--p-4);box-shadow:none;color:var(--muted-foreground);flex-shrink:0;font-weight:600;padding:var(--p-1) var(--p-3);transition:all .15s ease-in-out}.Tabs_variant-button__wtc8k .Tabs_list__9Hs22 .Tabs_trigger__uzdqH[data-state=active]{border-radius:var(--p-6);box-shadow:0 1px 2px 0 rgba(0,0,0,.05);color:var(--foreground)}.Tabs_variant-outline__2CJJg .Tabs_list__9Hs22 .Tabs_trigger__uzdqH{background-color:var(--background);border-radius:var(--p-6);color:var(--muted-foreground);flex-shrink:0;font-weight:500;padding:var(--p-1) var(--p-4);transition:box-shadow .15s ease-in-out,color .15s ease-in-out}.Tabs_variant-outline__2CJJg .Tabs_list__9Hs22 .Tabs_trigger__uzdqH:hover{color:var(--foreground)}.Tabs_variant-outline__2CJJg .Tabs_list__9Hs22 .Tabs_trigger__uzdqH[data-state=active]{background-color:var(--background);box-shadow:inset 0 0 0 1px var(--selected-tab-outline-color,var(--brand-color-400));color:var(--foreground)}.Tabs_variant-link__xOMDg>.Tabs_list__9Hs22 .Tabs_trigger__uzdqH{background-color:transparent!important;border:0!important;border-radius:0!important;box-shadow:inset 0 -2px 0 0 var(--border)!important;font-size:16px;padding:12px 16px}.Tabs_variant-link__xOMDg>.Tabs_list__9Hs22 .Tabs_trigger__uzdqH[data-state=active]{box-shadow:inset 0 -3px 0 -1px var(--selected-tab-outline-color,var(--brand-color-400))!important}.Tabs_trigger__uzdqH svg{flex-shrink:0;pointer-events:none}.Tabs_trigger__uzdqH svg:not([class*=size-]){height:1rem;width:1rem}.dark .Tabs_trigger__uzdqH{color:var(--muted-foreground)}.dark .Tabs_trigger__uzdqH[data-state=active]{background-color:var(--input-30);border-color:var(--input);color:var(--foreground)}.dark .Tabs_variant-outline__2CJJg .Tabs_list__9Hs22 .Tabs_trigger__uzdqH[data-state=active]{background-color:var(--background);box-shadow:inset 0 0 0 1px var(--selected-tab-outline-color,var(--brand-color-400));color:var(--foreground)}.Tabs_content__K27Vl{flex:1;outline:none}.Tabs_content__K27Vl[hidden]{display:none!important}.Tabs_root__cB9Au.Tabs_variant-button__wtc8k.Tabs_sizeSm__gfpc6 .Tabs_list__9Hs22 .Tabs_trigger__uzdqH{font-size:var(--text-xs);padding:var(--p-1) var(--p-2)}.Tabs_root__cB9Au.Tabs_variant-button__wtc8k.Tabs_sizeSm__gfpc6 .Tabs_list__9Hs22 .Tabs_trigger__uzdqH[data-state=active]{border-radius:var(--p-4)}.Tabs_root__cB9Au.Tabs_variant-button__wtc8k.Tabs_sizeLg__CcRFZ .Tabs_list__9Hs22 .Tabs_trigger__uzdqH{font-size:var(--text-base);padding:var(--p-2) var(--p-4)}.Tabs_root__cB9Au.Tabs_variant-button__wtc8k.Tabs_sizeLg__CcRFZ .Tabs_list__9Hs22 .Tabs_trigger__uzdqH[data-state=active]{border-radius:var(--p-8)}.Tabs_root__cB9Au.Tabs_variant-outline__2CJJg.Tabs_sizeSm__gfpc6 .Tabs_list__9Hs22 .Tabs_trigger__uzdqH{border-radius:var(--p-4);font-size:var(--text-xs);padding:var(--p-1) var(--p-3)}.Tabs_root__cB9Au.Tabs_variant-outline__2CJJg.Tabs_sizeSm__gfpc6 .Tabs_list__9Hs22 .Tabs_trigger__uzdqH[data-state=active]{border-radius:var(--p-4)}.Tabs_root__cB9Au.Tabs_variant-outline__2CJJg.Tabs_sizeLg__CcRFZ .Tabs_list__9Hs22 .Tabs_trigger__uzdqH{border-radius:var(--p-8);font-size:var(--text-base);padding:var(--p-2) var(--p-5)}.Tabs_root__cB9Au.Tabs_variant-outline__2CJJg.Tabs_sizeLg__CcRFZ .Tabs_list__9Hs22 .Tabs_trigger__uzdqH[data-state=active]{border-radius:var(--p-8)}.Tabs_root__cB9Au.Tabs_variant-link__xOMDg.Tabs_sizeSm__gfpc6>.Tabs_list__9Hs22{height:auto;min-height:36px}.Tabs_root__cB9Au.Tabs_variant-link__xOMDg.Tabs_sizeSm__gfpc6>.Tabs_list__9Hs22 .Tabs_trigger__uzdqH{font-size:14px;padding:8px 12px}.Tabs_root__cB9Au.Tabs_variant-link__xOMDg.Tabs_sizeLg__CcRFZ>.Tabs_list__9Hs22{height:auto;min-height:56px}.Tabs_root__cB9Au.Tabs_variant-link__xOMDg.Tabs_sizeLg__CcRFZ>.Tabs_list__9Hs22 .Tabs_trigger__uzdqH{font-size:18px;padding:16px 24px}";
|
|
4
4
|
var S = {"root":"Tabs_root__cB9Au","list":"Tabs_list__9Hs22","fullWidth":"Tabs_fullWidth__Lj2Dd","variant-link":"Tabs_variant-link__xOMDg","variant-button":"Tabs_variant-button__wtc8k","variant-outline":"Tabs_variant-outline__2CJJg","trigger":"Tabs_trigger__uzdqH","darker":"Tabs_darker__l-R0I","content":"Tabs_content__K27Vl","sizeSm":"Tabs_sizeSm__gfpc6","sizeLg":"Tabs_sizeLg__CcRFZ"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|