@x-plat/design-system 0.5.30 → 0.5.32
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/components/Chart/index.cjs +234 -100
- package/dist/components/Chart/index.css +18 -0
- package/dist/components/Chart/index.js +234 -100
- package/dist/components/Table/index.cjs +8 -1
- package/dist/components/Table/index.css +38 -0
- package/dist/components/Table/index.d.cts +2 -0
- package/dist/components/Table/index.d.ts +2 -0
- package/dist/components/Table/index.js +8 -1
- package/dist/components/index.cjs +242 -101
- package/dist/components/index.css +56 -0
- package/dist/components/index.js +242 -101
- package/dist/index.cjs +242 -101
- package/dist/index.css +56 -0
- package/dist/index.js +242 -101
- package/package.json +1 -1
|
@@ -186,6 +186,40 @@ var AxisLabels = React.memo(({ labels, count, chartW, height }) => {
|
|
|
186
186
|
}) });
|
|
187
187
|
});
|
|
188
188
|
AxisLabels.displayName = "AxisLabels";
|
|
189
|
+
var useCrosshair = (seriesPoints, entries, labels, chartH) => {
|
|
190
|
+
const [activeIndex, setActiveIndex] = React.useState(null);
|
|
191
|
+
const [mouseX, setMouseX] = React.useState(null);
|
|
192
|
+
const handleMouseMove = React.useCallback((e) => {
|
|
193
|
+
const svg = e.currentTarget;
|
|
194
|
+
const rect = svg.getBoundingClientRect();
|
|
195
|
+
const mx = (e.clientX - rect.left) / rect.width * svg.viewBox.baseVal.width;
|
|
196
|
+
setMouseX(mx);
|
|
197
|
+
if (seriesPoints.length === 0 || seriesPoints[0].length === 0) return;
|
|
198
|
+
const points = seriesPoints[0];
|
|
199
|
+
let closest = 0;
|
|
200
|
+
let minDist = Math.abs(points[0].x - mx);
|
|
201
|
+
for (let i = 1; i < points.length; i++) {
|
|
202
|
+
const dist = Math.abs(points[i].x - mx);
|
|
203
|
+
if (dist < minDist) {
|
|
204
|
+
minDist = dist;
|
|
205
|
+
closest = i;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
setActiveIndex(closest);
|
|
209
|
+
}, [seriesPoints]);
|
|
210
|
+
const handleMouseLeave = React.useCallback(() => {
|
|
211
|
+
setActiveIndex(null);
|
|
212
|
+
setMouseX(null);
|
|
213
|
+
}, []);
|
|
214
|
+
const tooltipContent = React.useMemo(() => {
|
|
215
|
+
if (activeIndex === null) return "";
|
|
216
|
+
return entries.map(([key], di) => {
|
|
217
|
+
const p = seriesPoints[di]?.[activeIndex];
|
|
218
|
+
return p ? `${key}: ${p.v}` : "";
|
|
219
|
+
}).filter(Boolean).join(" / ");
|
|
220
|
+
}, [activeIndex, entries, seriesPoints]);
|
|
221
|
+
return { activeIndex, mouseX, handleMouseMove, handleMouseLeave, tooltipContent };
|
|
222
|
+
};
|
|
189
223
|
var LineChart = React.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
|
|
190
224
|
const entries = React.useMemo(() => Object.entries(data), [data]);
|
|
191
225
|
const maxVal = React.useMemo(() => {
|
|
@@ -205,8 +239,9 @@ var LineChart = React.memo(({ data, labels, width, height, animate, onHover, onM
|
|
|
205
239
|
),
|
|
206
240
|
[entries, count, chartW, chartH, maxVal]
|
|
207
241
|
);
|
|
208
|
-
const showPoints = count <= 100;
|
|
209
242
|
const lineRefs = React.useRef([]);
|
|
243
|
+
const clipRef = React.useRef(null);
|
|
244
|
+
const { activeIndex, mouseX, handleMouseMove, handleMouseLeave, tooltipContent } = useCrosshair(seriesPoints, entries, labels, chartH);
|
|
210
245
|
React.useEffect(() => {
|
|
211
246
|
if (!animate) return;
|
|
212
247
|
lineRefs.current.forEach((el) => {
|
|
@@ -219,61 +254,110 @@ var LineChart = React.memo(({ data, labels, width, height, animate, onHover, onM
|
|
|
219
254
|
el.style.strokeDashoffset = "0";
|
|
220
255
|
});
|
|
221
256
|
});
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
257
|
+
if (clipRef.current) {
|
|
258
|
+
clipRef.current.setAttribute("width", "0");
|
|
259
|
+
requestAnimationFrame(() => {
|
|
260
|
+
if (clipRef.current) {
|
|
261
|
+
clipRef.current.style.transition = "width 1200ms ease-out 200ms";
|
|
262
|
+
clipRef.current.setAttribute("width", `${width}`);
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
}, [animate, seriesPoints, width]);
|
|
267
|
+
const guideX = mouseX != null && mouseX >= PADDING.left && mouseX <= width - PADDING.right ? mouseX : null;
|
|
268
|
+
const activeX = activeIndex !== null ? seriesPoints[0]?.[activeIndex]?.x : null;
|
|
269
|
+
const lineClipId = "line-area-clip";
|
|
270
|
+
return /* @__PURE__ */ jsxs(
|
|
271
|
+
"svg",
|
|
272
|
+
{
|
|
273
|
+
viewBox: `0 0 ${width} ${height}`,
|
|
274
|
+
className: "chart-svg",
|
|
275
|
+
onMouseMove: (e) => {
|
|
276
|
+
handleMouseMove(e);
|
|
277
|
+
onMove(e);
|
|
278
|
+
},
|
|
279
|
+
onMouseLeave: () => {
|
|
280
|
+
handleMouseLeave();
|
|
281
|
+
onLeave();
|
|
282
|
+
},
|
|
283
|
+
children: [
|
|
284
|
+
animate && /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: lineClipId, children: /* @__PURE__ */ jsx("rect", { ref: clipRef, x: "0", y: "0", width: animate ? 0 : width, height }) }) }),
|
|
285
|
+
/* @__PURE__ */ jsx(GridLines, { width, height, chartH, maxVal }),
|
|
286
|
+
/* @__PURE__ */ jsx(AxisLabels, { labels, count, chartW, height }),
|
|
287
|
+
entries.map(([key], di) => {
|
|
288
|
+
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
289
|
+
const color = palette[2];
|
|
290
|
+
const areaColor = palette[0];
|
|
291
|
+
const points = seriesPoints[di];
|
|
292
|
+
const gradientId = `line-gradient-${di}`;
|
|
293
|
+
const polyPoints = points.map((p) => `${p.x},${p.y}`).join(" ");
|
|
294
|
+
const areaD = `M ${points[0].x},${points[0].y} ${points.map((p) => `L ${p.x},${p.y}`).join(" ")} L ${points[points.length - 1].x},${PADDING.top + chartH} L ${points[0].x},${PADDING.top + chartH} Z`;
|
|
295
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
296
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
297
|
+
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.2" }),
|
|
298
|
+
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0" })
|
|
299
|
+
] }) }),
|
|
300
|
+
/* @__PURE__ */ jsx(
|
|
301
|
+
"path",
|
|
302
|
+
{
|
|
303
|
+
d: areaD,
|
|
304
|
+
fill: `url(#${gradientId})`,
|
|
305
|
+
clipPath: animate ? `url(#${lineClipId})` : void 0
|
|
306
|
+
}
|
|
307
|
+
),
|
|
308
|
+
/* @__PURE__ */ jsx(
|
|
309
|
+
"polyline",
|
|
310
|
+
{
|
|
311
|
+
ref: (el) => {
|
|
312
|
+
lineRefs.current[di] = el;
|
|
313
|
+
},
|
|
314
|
+
points: polyPoints,
|
|
315
|
+
fill: "none",
|
|
316
|
+
stroke: color,
|
|
317
|
+
strokeWidth: "2"
|
|
318
|
+
}
|
|
319
|
+
),
|
|
320
|
+
activeIndex !== null && points[activeIndex] && /* @__PURE__ */ jsx(
|
|
321
|
+
"circle",
|
|
322
|
+
{
|
|
323
|
+
cx: points[activeIndex].x,
|
|
324
|
+
cy: points[activeIndex].y,
|
|
325
|
+
r: "5",
|
|
326
|
+
fill: color,
|
|
327
|
+
className: "chart-point-active"
|
|
328
|
+
}
|
|
329
|
+
)
|
|
330
|
+
] }, di);
|
|
331
|
+
}),
|
|
332
|
+
guideX !== null && /* @__PURE__ */ jsx(
|
|
333
|
+
"line",
|
|
241
334
|
{
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
335
|
+
x1: guideX,
|
|
336
|
+
y1: PADDING.top,
|
|
337
|
+
x2: guideX,
|
|
338
|
+
y2: PADDING.top + chartH,
|
|
339
|
+
className: "chart-crosshair"
|
|
246
340
|
}
|
|
247
341
|
),
|
|
342
|
+
activeIndex !== null && activeX !== null && /* @__PURE__ */ jsx("foreignObject", { x: activeX - 100, y: 0, width: "200", height: PADDING.top, children: /* @__PURE__ */ jsxs("div", { className: "chart-crosshair-label", children: [
|
|
343
|
+
labels[activeIndex],
|
|
344
|
+
" \u2014 ",
|
|
345
|
+
tooltipContent
|
|
346
|
+
] }) }),
|
|
248
347
|
/* @__PURE__ */ jsx(
|
|
249
|
-
"
|
|
348
|
+
"rect",
|
|
250
349
|
{
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
fill: "
|
|
256
|
-
|
|
257
|
-
strokeWidth: "2"
|
|
350
|
+
x: PADDING.left,
|
|
351
|
+
y: PADDING.top,
|
|
352
|
+
width: chartW,
|
|
353
|
+
height: chartH,
|
|
354
|
+
fill: "transparent",
|
|
355
|
+
style: { cursor: "crosshair" }
|
|
258
356
|
}
|
|
259
|
-
)
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
cx: p.x,
|
|
264
|
-
cy: p.y,
|
|
265
|
-
r: "4",
|
|
266
|
-
fill: color,
|
|
267
|
-
className: "chart-point",
|
|
268
|
-
onMouseEnter: (e) => onHover(e, `${key}: ${labels[i]} \u2014 ${p.v}`),
|
|
269
|
-
onMouseMove: onMove,
|
|
270
|
-
onMouseLeave: onLeave
|
|
271
|
-
},
|
|
272
|
-
i
|
|
273
|
-
))
|
|
274
|
-
] }, di);
|
|
275
|
-
})
|
|
276
|
-
] });
|
|
357
|
+
)
|
|
358
|
+
]
|
|
359
|
+
}
|
|
360
|
+
);
|
|
277
361
|
});
|
|
278
362
|
LineChart.displayName = "LineChart";
|
|
279
363
|
var CurveChart = React.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
|
|
@@ -295,8 +379,9 @@ var CurveChart = React.memo(({ data, labels, width, height, animate, onHover, on
|
|
|
295
379
|
),
|
|
296
380
|
[entries, count, chartW, chartH, maxVal]
|
|
297
381
|
);
|
|
298
|
-
const showPoints = count <= 100;
|
|
299
382
|
const lineRefs = React.useRef([]);
|
|
383
|
+
const curveClipRef = React.useRef(null);
|
|
384
|
+
const { activeIndex, mouseX, handleMouseMove, handleMouseLeave, tooltipContent } = useCrosshair(seriesPoints, entries, labels, chartH);
|
|
300
385
|
React.useEffect(() => {
|
|
301
386
|
if (!animate) return;
|
|
302
387
|
lineRefs.current.forEach((el) => {
|
|
@@ -309,61 +394,110 @@ var CurveChart = React.memo(({ data, labels, width, height, animate, onHover, on
|
|
|
309
394
|
el.style.strokeDashoffset = "0";
|
|
310
395
|
});
|
|
311
396
|
});
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
397
|
+
if (curveClipRef.current) {
|
|
398
|
+
curveClipRef.current.setAttribute("width", "0");
|
|
399
|
+
requestAnimationFrame(() => {
|
|
400
|
+
if (curveClipRef.current) {
|
|
401
|
+
curveClipRef.current.style.transition = "width 1200ms ease-out 200ms";
|
|
402
|
+
curveClipRef.current.setAttribute("width", `${width}`);
|
|
403
|
+
}
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
}, [animate, seriesPoints, width]);
|
|
407
|
+
const guideX = mouseX != null && mouseX >= PADDING.left && mouseX <= width - PADDING.right ? mouseX : null;
|
|
408
|
+
const activeX = activeIndex !== null ? seriesPoints[0]?.[activeIndex]?.x : null;
|
|
409
|
+
const curveClipId = "curve-area-clip";
|
|
410
|
+
return /* @__PURE__ */ jsxs(
|
|
411
|
+
"svg",
|
|
412
|
+
{
|
|
413
|
+
viewBox: `0 0 ${width} ${height}`,
|
|
414
|
+
className: "chart-svg",
|
|
415
|
+
onMouseMove: (e) => {
|
|
416
|
+
handleMouseMove(e);
|
|
417
|
+
onMove(e);
|
|
418
|
+
},
|
|
419
|
+
onMouseLeave: () => {
|
|
420
|
+
handleMouseLeave();
|
|
421
|
+
onLeave();
|
|
422
|
+
},
|
|
423
|
+
children: [
|
|
424
|
+
animate && /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: curveClipId, children: /* @__PURE__ */ jsx("rect", { ref: curveClipRef, x: "0", y: "0", width: animate ? 0 : width, height }) }) }),
|
|
425
|
+
/* @__PURE__ */ jsx(GridLines, { width, height, chartH, maxVal }),
|
|
426
|
+
/* @__PURE__ */ jsx(AxisLabels, { labels, count, chartW, height }),
|
|
427
|
+
entries.map(([key], di) => {
|
|
428
|
+
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
429
|
+
const color = palette[2];
|
|
430
|
+
const areaColor = palette[0];
|
|
431
|
+
const points = seriesPoints[di];
|
|
432
|
+
const gradientId = `curve-gradient-${di}`;
|
|
433
|
+
const linePath = toSmoothPath(points);
|
|
434
|
+
const areaPath = linePath + ` L ${points[points.length - 1].x} ${PADDING.top + chartH} L ${points[0].x} ${PADDING.top + chartH} Z`;
|
|
435
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
436
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
437
|
+
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.4" }),
|
|
438
|
+
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0.02" })
|
|
439
|
+
] }) }),
|
|
440
|
+
/* @__PURE__ */ jsx(
|
|
441
|
+
"path",
|
|
442
|
+
{
|
|
443
|
+
d: areaPath,
|
|
444
|
+
fill: `url(#${gradientId})`,
|
|
445
|
+
clipPath: animate ? `url(#${curveClipId})` : void 0
|
|
446
|
+
}
|
|
447
|
+
),
|
|
448
|
+
/* @__PURE__ */ jsx(
|
|
449
|
+
"path",
|
|
450
|
+
{
|
|
451
|
+
ref: (el) => {
|
|
452
|
+
lineRefs.current[di] = el;
|
|
453
|
+
},
|
|
454
|
+
d: linePath,
|
|
455
|
+
fill: "none",
|
|
456
|
+
stroke: color,
|
|
457
|
+
strokeWidth: "2"
|
|
458
|
+
}
|
|
459
|
+
),
|
|
460
|
+
activeIndex !== null && points[activeIndex] && /* @__PURE__ */ jsx(
|
|
461
|
+
"circle",
|
|
462
|
+
{
|
|
463
|
+
cx: points[activeIndex].x,
|
|
464
|
+
cy: points[activeIndex].y,
|
|
465
|
+
r: "5",
|
|
466
|
+
fill: color,
|
|
467
|
+
className: "chart-point-active"
|
|
468
|
+
}
|
|
469
|
+
)
|
|
470
|
+
] }, di);
|
|
471
|
+
}),
|
|
472
|
+
guideX !== null && /* @__PURE__ */ jsx(
|
|
473
|
+
"line",
|
|
331
474
|
{
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
475
|
+
x1: guideX,
|
|
476
|
+
y1: PADDING.top,
|
|
477
|
+
x2: guideX,
|
|
478
|
+
y2: PADDING.top + chartH,
|
|
479
|
+
className: "chart-crosshair"
|
|
336
480
|
}
|
|
337
481
|
),
|
|
482
|
+
activeIndex !== null && activeX !== null && /* @__PURE__ */ jsx("foreignObject", { x: activeX - 100, y: 0, width: "200", height: PADDING.top, children: /* @__PURE__ */ jsxs("div", { className: "chart-crosshair-label", children: [
|
|
483
|
+
labels[activeIndex],
|
|
484
|
+
" \u2014 ",
|
|
485
|
+
tooltipContent
|
|
486
|
+
] }) }),
|
|
338
487
|
/* @__PURE__ */ jsx(
|
|
339
|
-
"
|
|
488
|
+
"rect",
|
|
340
489
|
{
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
fill: "
|
|
346
|
-
|
|
347
|
-
strokeWidth: "2"
|
|
490
|
+
x: PADDING.left,
|
|
491
|
+
y: PADDING.top,
|
|
492
|
+
width: chartW,
|
|
493
|
+
height: chartH,
|
|
494
|
+
fill: "transparent",
|
|
495
|
+
style: { cursor: "crosshair" }
|
|
348
496
|
}
|
|
349
|
-
)
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
cx: p.x,
|
|
354
|
-
cy: p.y,
|
|
355
|
-
r: "4",
|
|
356
|
-
fill: color,
|
|
357
|
-
className: "chart-point",
|
|
358
|
-
onMouseEnter: (e) => onHover(e, `${key}: ${labels[i]} \u2014 ${p.v}`),
|
|
359
|
-
onMouseMove: onMove,
|
|
360
|
-
onMouseLeave: onLeave
|
|
361
|
-
},
|
|
362
|
-
i
|
|
363
|
-
))
|
|
364
|
-
] }, di);
|
|
365
|
-
})
|
|
366
|
-
] });
|
|
497
|
+
)
|
|
498
|
+
]
|
|
499
|
+
}
|
|
500
|
+
);
|
|
367
501
|
});
|
|
368
502
|
CurveChart.displayName = "CurveChart";
|
|
369
503
|
var BarChart = React.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
|
|
@@ -210,6 +210,7 @@ var TableRow = import_react5.default.memo((props) => {
|
|
|
210
210
|
const {
|
|
211
211
|
children,
|
|
212
212
|
type = "secondary",
|
|
213
|
+
color,
|
|
213
214
|
isHover,
|
|
214
215
|
onClick
|
|
215
216
|
} = props;
|
|
@@ -226,11 +227,17 @@ var TableRow = import_react5.default.memo((props) => {
|
|
|
226
227
|
{
|
|
227
228
|
className: clsx_default(
|
|
228
229
|
rowBorderUse ? "table-bottom-border" : null,
|
|
229
|
-
type,
|
|
230
|
+
color != null ? "categorical" : type,
|
|
231
|
+
color === "neutral" && "cat-neutral",
|
|
230
232
|
isHover && "hover",
|
|
231
233
|
onClick && "clickable"
|
|
232
234
|
),
|
|
233
235
|
onClick,
|
|
236
|
+
style: color != null && color !== "neutral" ? {
|
|
237
|
+
"--cat-fill": `var(--semantic-categorical-${color}-fill)`,
|
|
238
|
+
"--cat-text": `var(--semantic-categorical-${color}-text)`,
|
|
239
|
+
"--cat-bg": `var(--semantic-categorical-${color}-bg)`
|
|
240
|
+
} : void 0,
|
|
234
241
|
children
|
|
235
242
|
}
|
|
236
243
|
) });
|
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
height: 100%;
|
|
6
6
|
position: relative;
|
|
7
7
|
overflow: auto;
|
|
8
|
+
scrollbar-width: none;
|
|
9
|
+
}
|
|
10
|
+
.lib-xplat-table-wrapper::-webkit-scrollbar {
|
|
11
|
+
display: none;
|
|
8
12
|
}
|
|
9
13
|
.lib-xplat-table-wrapper.sm > .lib-xplat-table > thead > tr > th,
|
|
10
14
|
.lib-xplat-table-wrapper.sm > .lib-xplat-table > thead > tr > td,
|
|
@@ -183,6 +187,40 @@
|
|
|
183
187
|
color: var(--semantic-text-inverse);
|
|
184
188
|
background-color: var(--semantic-surface-info-strong);
|
|
185
189
|
}
|
|
190
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.categorical,
|
|
191
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.categorical {
|
|
192
|
+
background-color: var(--cat-fill);
|
|
193
|
+
}
|
|
194
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.categorical > td,
|
|
195
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.categorical > th,
|
|
196
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.categorical > td,
|
|
197
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.categorical > th {
|
|
198
|
+
color: var(--semantic-text-inverse);
|
|
199
|
+
background-color: var(--cat-fill);
|
|
200
|
+
}
|
|
201
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.categorical.hover:hover > td,
|
|
202
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.categorical.hover:hover > th,
|
|
203
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.categorical.hover:hover > td,
|
|
204
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.categorical.hover:hover > th {
|
|
205
|
+
background-color: var(--cat-text);
|
|
206
|
+
}
|
|
207
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.categorical.cat-neutral,
|
|
208
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.categorical.cat-neutral {
|
|
209
|
+
background-color: var(--semantic-surface-neutral-strong);
|
|
210
|
+
}
|
|
211
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.categorical.cat-neutral > td,
|
|
212
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.categorical.cat-neutral > th,
|
|
213
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.categorical.cat-neutral > td,
|
|
214
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.categorical.cat-neutral > th {
|
|
215
|
+
color: var(--semantic-text-inverse);
|
|
216
|
+
background-color: var(--semantic-surface-neutral-strong);
|
|
217
|
+
}
|
|
218
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.categorical.cat-neutral.hover:hover > td,
|
|
219
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.categorical.cat-neutral.hover:hover > th,
|
|
220
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.categorical.cat-neutral.hover:hover > td,
|
|
221
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.categorical.cat-neutral.hover:hover > th {
|
|
222
|
+
background-color: var(--semantic-surface-neutral-disabled);
|
|
223
|
+
}
|
|
186
224
|
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.clickable,
|
|
187
225
|
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.clickable {
|
|
188
226
|
cursor: pointer;
|
|
@@ -42,9 +42,11 @@ declare const TableHead: {
|
|
|
42
42
|
displayName: string;
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
+
type RowColor = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | "neutral";
|
|
45
46
|
interface TableRowProps {
|
|
46
47
|
children: React.ReactNode;
|
|
47
48
|
type?: "primary" | "secondary" | "success" | "error" | "warning" | "info";
|
|
49
|
+
color?: RowColor;
|
|
48
50
|
isHover?: boolean;
|
|
49
51
|
onClick?: (e: React.MouseEvent<HTMLTableRowElement>) => void;
|
|
50
52
|
}
|
|
@@ -42,9 +42,11 @@ declare const TableHead: {
|
|
|
42
42
|
displayName: string;
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
+
type RowColor = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | "neutral";
|
|
45
46
|
interface TableRowProps {
|
|
46
47
|
children: React.ReactNode;
|
|
47
48
|
type?: "primary" | "secondary" | "success" | "error" | "warning" | "info";
|
|
49
|
+
color?: RowColor;
|
|
48
50
|
isHover?: boolean;
|
|
49
51
|
onClick?: (e: React.MouseEvent<HTMLTableRowElement>) => void;
|
|
50
52
|
}
|
|
@@ -170,6 +170,7 @@ var TableRow = React5.memo((props) => {
|
|
|
170
170
|
const {
|
|
171
171
|
children,
|
|
172
172
|
type = "secondary",
|
|
173
|
+
color,
|
|
173
174
|
isHover,
|
|
174
175
|
onClick
|
|
175
176
|
} = props;
|
|
@@ -186,11 +187,17 @@ var TableRow = React5.memo((props) => {
|
|
|
186
187
|
{
|
|
187
188
|
className: clsx_default(
|
|
188
189
|
rowBorderUse ? "table-bottom-border" : null,
|
|
189
|
-
type,
|
|
190
|
+
color != null ? "categorical" : type,
|
|
191
|
+
color === "neutral" && "cat-neutral",
|
|
190
192
|
isHover && "hover",
|
|
191
193
|
onClick && "clickable"
|
|
192
194
|
),
|
|
193
195
|
onClick,
|
|
196
|
+
style: color != null && color !== "neutral" ? {
|
|
197
|
+
"--cat-fill": `var(--semantic-categorical-${color}-fill)`,
|
|
198
|
+
"--cat-text": `var(--semantic-categorical-${color}-text)`,
|
|
199
|
+
"--cat-bg": `var(--semantic-categorical-${color}-bg)`
|
|
200
|
+
} : void 0,
|
|
194
201
|
children
|
|
195
202
|
}
|
|
196
203
|
) });
|