cursor-canvas-export 0.0.0-stage → 0.1.1

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/src/sdk/ui.tsx ADDED
@@ -0,0 +1,779 @@
1
+ import {
2
+ createContext,
3
+ useContext,
4
+ type CSSProperties,
5
+ type ReactNode,
6
+ } from "react";
7
+ import { useHostTheme } from "./hooks";
8
+ import { fontStack, monoStack, toneColor, type ChartTone } from "./tokens";
9
+
10
+ export function mergeStyle(base: CSSProperties, override?: CSSProperties): CSSProperties {
11
+ return override ? { ...base, ...override } : base;
12
+ }
13
+
14
+ const alignItems = {
15
+ start: "flex-start",
16
+ center: "center",
17
+ end: "flex-end",
18
+ stretch: "stretch",
19
+ } as const;
20
+
21
+ const justifyContent = {
22
+ start: "flex-start",
23
+ center: "center",
24
+ end: "flex-end",
25
+ "space-between": "space-between",
26
+ } as const;
27
+
28
+ export function Stack({
29
+ children,
30
+ gap = 0,
31
+ style,
32
+ }: {
33
+ children?: ReactNode;
34
+ gap?: number;
35
+ style?: CSSProperties;
36
+ }) {
37
+ return (
38
+ <div style={mergeStyle({ display: "flex", flexDirection: "column", gap }, style)}>
39
+ {children}
40
+ </div>
41
+ );
42
+ }
43
+
44
+ export function Row({
45
+ children,
46
+ gap = 0,
47
+ align = "stretch",
48
+ justify = "start",
49
+ wrap = false,
50
+ style,
51
+ }: {
52
+ children?: ReactNode;
53
+ gap?: number;
54
+ align?: keyof typeof alignItems;
55
+ justify?: keyof typeof justifyContent;
56
+ wrap?: boolean;
57
+ style?: CSSProperties;
58
+ }) {
59
+ return (
60
+ <div
61
+ style={mergeStyle(
62
+ {
63
+ display: "flex",
64
+ flexDirection: "row",
65
+ gap,
66
+ alignItems: alignItems[align],
67
+ justifyContent: justifyContent[justify],
68
+ flexWrap: wrap ? "wrap" : "nowrap",
69
+ },
70
+ style,
71
+ )}
72
+ >
73
+ {children}
74
+ </div>
75
+ );
76
+ }
77
+
78
+ export function Grid({
79
+ children,
80
+ columns,
81
+ gap = 0,
82
+ align = "stretch",
83
+ style,
84
+ }: {
85
+ children?: ReactNode;
86
+ columns: number | string;
87
+ gap?: number;
88
+ align?: keyof typeof alignItems;
89
+ style?: CSSProperties;
90
+ }) {
91
+ const template =
92
+ typeof columns === "number" ? `repeat(${columns}, minmax(0, 1fr))` : columns;
93
+ return (
94
+ <div
95
+ style={mergeStyle(
96
+ {
97
+ display: "grid",
98
+ gridTemplateColumns: template,
99
+ gap,
100
+ alignItems: alignItems[align],
101
+ },
102
+ style,
103
+ )}
104
+ >
105
+ {children}
106
+ </div>
107
+ );
108
+ }
109
+
110
+ export function Divider({ style }: { style?: CSSProperties }) {
111
+ const theme = useHostTheme();
112
+ return (
113
+ <hr
114
+ style={mergeStyle(
115
+ {
116
+ border: 0,
117
+ width: "100%",
118
+ height: 1,
119
+ margin: 0,
120
+ background: theme.stroke.tertiary,
121
+ },
122
+ style,
123
+ )}
124
+ />
125
+ );
126
+ }
127
+
128
+ export function Spacer() {
129
+ return <div style={{ flex: "1 1 auto" }} />;
130
+ }
131
+
132
+ function Heading({
133
+ tag,
134
+ fontSize,
135
+ lineHeight,
136
+ children,
137
+ style,
138
+ }: {
139
+ tag: "h1" | "h2" | "h3";
140
+ fontSize: number;
141
+ lineHeight: string;
142
+ children?: ReactNode;
143
+ style?: CSSProperties;
144
+ }) {
145
+ const theme = useHostTheme();
146
+ const Tag = tag;
147
+ return (
148
+ <Tag
149
+ style={mergeStyle(
150
+ {
151
+ margin: 0,
152
+ fontFamily: fontStack,
153
+ fontSize,
154
+ lineHeight,
155
+ fontWeight: 590,
156
+ color: theme.text.primary,
157
+ },
158
+ style,
159
+ )}
160
+ >
161
+ {children}
162
+ </Tag>
163
+ );
164
+ }
165
+
166
+ export function H1({ children, style }: { children?: ReactNode; style?: CSSProperties }) {
167
+ return (
168
+ <Heading tag="h1" fontSize={24} lineHeight="30px" style={style}>
169
+ {children}
170
+ </Heading>
171
+ );
172
+ }
173
+
174
+ export function H2({ children, style }: { children?: ReactNode; style?: CSSProperties }) {
175
+ return (
176
+ <Heading tag="h2" fontSize={18} lineHeight="24px" style={style}>
177
+ {children}
178
+ </Heading>
179
+ );
180
+ }
181
+
182
+ export function H3({ children, style }: { children?: ReactNode; style?: CSSProperties }) {
183
+ return (
184
+ <Heading tag="h3" fontSize={16} lineHeight="22px" style={style}>
185
+ {children}
186
+ </Heading>
187
+ );
188
+ }
189
+
190
+ const textNest = createContext(0);
191
+
192
+ const textWeight = { normal: 400, medium: 500, semibold: 590, bold: 700 } as const;
193
+
194
+ export function Text({
195
+ children,
196
+ tone = "primary",
197
+ size = "body",
198
+ as,
199
+ weight = "normal",
200
+ italic = false,
201
+ truncate,
202
+ style,
203
+ }: {
204
+ children?: ReactNode;
205
+ tone?: "primary" | "secondary" | "tertiary" | "quaternary";
206
+ size?: "body" | "small";
207
+ as?: "p" | "span";
208
+ weight?: keyof typeof textWeight;
209
+ italic?: boolean;
210
+ truncate?: boolean | "start" | "end";
211
+ style?: CSSProperties;
212
+ }) {
213
+ const theme = useHostTheme();
214
+ const depth = useContext(textNest);
215
+ const tag = as ?? (depth > 0 ? "span" : "p");
216
+ const metrics =
217
+ size === "small"
218
+ ? { fontSize: 12, lineHeight: "16px" }
219
+ : { fontSize: 14, lineHeight: "20px" };
220
+ const truncation: CSSProperties =
221
+ truncate === true || truncate === "end"
222
+ ? { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }
223
+ : truncate === "start"
224
+ ? {
225
+ overflow: "hidden",
226
+ textOverflow: "ellipsis",
227
+ whiteSpace: "nowrap",
228
+ direction: "rtl",
229
+ textAlign: "left",
230
+ }
231
+ : {};
232
+ const Tag = tag;
233
+ return (
234
+ <textNest.Provider value={depth + 1}>
235
+ <Tag
236
+ style={mergeStyle(
237
+ {
238
+ margin: 0,
239
+ fontFamily: fontStack,
240
+ color: theme.text[tone],
241
+ fontWeight: textWeight[weight],
242
+ fontStyle: italic ? "italic" : "normal",
243
+ ...metrics,
244
+ ...truncation,
245
+ },
246
+ style,
247
+ )}
248
+ >
249
+ {typeof children === "string" ? parseInline(children) : children}
250
+ </Tag>
251
+ </textNest.Provider>
252
+ );
253
+ }
254
+
255
+ function parseInline(text: string): ReactNode {
256
+ const pattern = /`([^`]+)`|\[([^\]]+)\]\(([^)\s]+)\)/g;
257
+ const nodes: ReactNode[] = [];
258
+ let last = 0;
259
+ let match: RegExpExecArray | null;
260
+ let index = 0;
261
+ while ((match = pattern.exec(text))) {
262
+ if (match.index > last) nodes.push(text.slice(last, match.index));
263
+ if (match[1] != null) nodes.push(<Code key={index}>{match[1]}</Code>);
264
+ else nodes.push(
265
+ <Link key={index} href={match[3]}>
266
+ {match[2]}
267
+ </Link>,
268
+ );
269
+ last = match.index + match[0].length;
270
+ index += 1;
271
+ }
272
+ if (nodes.length === 0) return text;
273
+ if (last < text.length) nodes.push(text.slice(last));
274
+ return nodes;
275
+ }
276
+
277
+ export function Code({ children, style }: { children?: ReactNode; style?: CSSProperties }) {
278
+ const theme = useHostTheme();
279
+ return (
280
+ <code
281
+ style={mergeStyle(
282
+ {
283
+ fontFamily: monoStack,
284
+ fontSize: "0.92em",
285
+ padding: "1px 4px",
286
+ borderRadius: 4,
287
+ background: theme.fill.tertiary,
288
+ color: theme.text.primary,
289
+ },
290
+ style,
291
+ )}
292
+ >
293
+ {children}
294
+ </code>
295
+ );
296
+ }
297
+
298
+ export function Link({
299
+ children,
300
+ href,
301
+ style,
302
+ }: {
303
+ children?: ReactNode;
304
+ href: string;
305
+ style?: CSSProperties;
306
+ }) {
307
+ const theme = useHostTheme();
308
+ return (
309
+ <a
310
+ href={href}
311
+ style={mergeStyle(
312
+ { color: theme.text.link, textDecoration: "underline", textUnderlineOffset: 2 },
313
+ style,
314
+ )}
315
+ >
316
+ {children}
317
+ </a>
318
+ );
319
+ }
320
+
321
+ type CardContextValue = { open: boolean; size: "base" | "lg" };
322
+ const cardContext = createContext<CardContextValue>({ open: true, size: "base" });
323
+
324
+ export function Card({
325
+ children,
326
+ variant = "default",
327
+ size = "base",
328
+ collapsible = false,
329
+ defaultOpen = true,
330
+ open,
331
+ style,
332
+ }: {
333
+ children?: ReactNode;
334
+ variant?: "default" | "borderless";
335
+ size?: "base" | "lg";
336
+ stickyHeader?: boolean;
337
+ collapsible?: boolean;
338
+ defaultOpen?: boolean;
339
+ open?: boolean;
340
+ onOpenChange?: (open: boolean) => void;
341
+ style?: CSSProperties;
342
+ }) {
343
+ const theme = useHostTheme();
344
+ const isOpen = open ?? (collapsible ? defaultOpen : true);
345
+ const framed = variant !== "borderless";
346
+ return (
347
+ <cardContext.Provider value={{ open: collapsible ? isOpen : true, size }}>
348
+ <section
349
+ data-card=""
350
+ style={mergeStyle(
351
+ {
352
+ border: framed ? `1px solid ${theme.stroke.primary}` : "none",
353
+ borderRadius: framed ? 8 : 0,
354
+ background: theme.bg.elevated,
355
+ overflow: "hidden",
356
+ },
357
+ style,
358
+ )}
359
+ >
360
+ {children}
361
+ </section>
362
+ </cardContext.Provider>
363
+ );
364
+ }
365
+
366
+ export function CardHeader({
367
+ children,
368
+ trailing,
369
+ style,
370
+ }: {
371
+ children?: ReactNode;
372
+ trailing?: ReactNode;
373
+ style?: CSSProperties;
374
+ }) {
375
+ const theme = useHostTheme();
376
+ const { size } = useContext(cardContext);
377
+ return (
378
+ <div
379
+ data-card-header=""
380
+ style={mergeStyle(
381
+ {
382
+ display: "flex",
383
+ alignItems: "center",
384
+ gap: 12,
385
+ minHeight: size === "lg" ? 32 : 28,
386
+ padding: "4px 12px",
387
+ fontFamily: fontStack,
388
+ fontSize: 12,
389
+ lineHeight: "16px",
390
+ fontWeight: 590,
391
+ color: theme.text.primary,
392
+ borderBottom: `1px solid ${theme.stroke.tertiary}`,
393
+ },
394
+ style,
395
+ )}
396
+ >
397
+ <span style={{ flex: "1 1 auto", minWidth: 0 }}>{children}</span>
398
+ {trailing != null && trailing !== false ? (
399
+ <span style={{ flex: "none", color: theme.text.tertiary, fontWeight: 400 }}>{trailing}</span>
400
+ ) : null}
401
+ </div>
402
+ );
403
+ }
404
+
405
+ export function CardBody({ children, style }: { children?: ReactNode; style?: CSSProperties }) {
406
+ const { open } = useContext(cardContext);
407
+ if (!open) return null;
408
+ return <div style={mergeStyle({ padding: 12 }, style)}>{children}</div>;
409
+ }
410
+
411
+ export function CanvasChevron({ expanded }: { expanded: boolean }) {
412
+ const theme = useHostTheme();
413
+ return (
414
+ <svg width="12" height="12" viewBox="0 0 12 12" aria-hidden="true">
415
+ <path
416
+ d={expanded ? "M2 4.5 L6 8.5 L10 4.5" : "M4.5 2 L8.5 6 L4.5 10"}
417
+ fill="none"
418
+ stroke={theme.text.tertiary}
419
+ strokeWidth="1.4"
420
+ />
421
+ </svg>
422
+ );
423
+ }
424
+
425
+ export function Button({
426
+ children,
427
+ variant = "secondary",
428
+ disabled,
429
+ type = "button",
430
+ style,
431
+ onClick,
432
+ }: {
433
+ children?: ReactNode;
434
+ variant?: "primary" | "secondary" | "ghost";
435
+ disabled?: boolean;
436
+ type?: "button" | "submit" | "reset";
437
+ style?: CSSProperties;
438
+ onClick?: () => void;
439
+ }) {
440
+ const theme = useHostTheme();
441
+ const colors: CSSProperties =
442
+ variant === "primary"
443
+ ? { background: theme.accent.control, color: theme.text.onAccent, border: "1px solid transparent" }
444
+ : variant === "ghost"
445
+ ? { background: "transparent", color: theme.text.primary, border: "1px solid transparent" }
446
+ : {
447
+ background: theme.fill.tertiary,
448
+ color: theme.text.primary,
449
+ border: `1px solid ${theme.stroke.secondary}`,
450
+ };
451
+ return (
452
+ <button
453
+ type={type}
454
+ disabled={disabled}
455
+ onClick={onClick}
456
+ style={mergeStyle(
457
+ {
458
+ height: 24,
459
+ padding: "0 10px",
460
+ borderRadius: 6,
461
+ fontFamily: fontStack,
462
+ fontSize: 12,
463
+ lineHeight: "16px",
464
+ fontWeight: 500,
465
+ width: "fit-content",
466
+ cursor: disabled ? "default" : "pointer",
467
+ opacity: disabled ? 0.5 : 1,
468
+ ...colors,
469
+ },
470
+ style,
471
+ )}
472
+ >
473
+ {children}
474
+ </button>
475
+ );
476
+ }
477
+
478
+ export function Pill({
479
+ children,
480
+ active = false,
481
+ size = "md",
482
+ leadingContent,
483
+ keyboardHint,
484
+ disabled,
485
+ title,
486
+ style,
487
+ onClick,
488
+ }: {
489
+ children?: ReactNode;
490
+ active?: boolean;
491
+ tone?: string;
492
+ size?: "sm" | "md";
493
+ leadingContent?: ReactNode;
494
+ keyboardHint?: string;
495
+ disabled?: boolean;
496
+ title?: string;
497
+ style?: CSSProperties;
498
+ onClick?: () => void;
499
+ }) {
500
+ const theme = useHostTheme();
501
+ const compact = size === "sm";
502
+ return (
503
+ <button
504
+ type="button"
505
+ disabled={disabled}
506
+ title={title}
507
+ onClick={onClick}
508
+ style={mergeStyle(
509
+ {
510
+ display: "inline-flex",
511
+ alignItems: "center",
512
+ gap: 6,
513
+ height: compact ? 18 : 24,
514
+ padding: compact ? "0 6px" : "0 10px",
515
+ borderRadius: 999,
516
+ border: compact ? "none" : `1px solid ${theme.stroke.secondary}`,
517
+ background: active ? theme.fill.primary : "transparent",
518
+ color: theme.text.primary,
519
+ fontFamily: fontStack,
520
+ fontSize: compact ? 11 : 12,
521
+ lineHeight: "16px",
522
+ cursor: onClick ? "pointer" : "default",
523
+ },
524
+ style,
525
+ )}
526
+ >
527
+ {leadingContent}
528
+ {children}
529
+ {keyboardHint ? (
530
+ <span style={{ color: theme.text.tertiary }}>{keyboardHint}</span>
531
+ ) : null}
532
+ </button>
533
+ );
534
+ }
535
+
536
+ export function Stat({
537
+ value,
538
+ label,
539
+ tone,
540
+ style,
541
+ }: {
542
+ value: ReactNode;
543
+ label: string;
544
+ tone?: "success" | "danger" | "warning" | "info";
545
+ style?: CSSProperties;
546
+ }) {
547
+ const theme = useHostTheme();
548
+ return (
549
+ <div data-stat="" style={mergeStyle({ display: "flex", flexDirection: "column", gap: 4, minWidth: 0 }, style)}>
550
+ <div
551
+ data-stat-value=""
552
+ style={{
553
+ fontFamily: fontStack,
554
+ fontSize: 22,
555
+ lineHeight: "28px",
556
+ fontWeight: 590,
557
+ color: tone ? toneColor[tone] : theme.text.primary,
558
+ }}
559
+ >
560
+ {value}
561
+ </div>
562
+ <div
563
+ style={{
564
+ fontFamily: fontStack,
565
+ fontSize: 12,
566
+ lineHeight: "16px",
567
+ color: theme.text.secondary,
568
+ }}
569
+ >
570
+ {label}
571
+ </div>
572
+ </div>
573
+ );
574
+ }
575
+
576
+ function CalloutIcon({ tone }: { tone: ChartTone }) {
577
+ const color = toneColor[tone];
578
+ if (tone === "success") {
579
+ return (
580
+ <svg width="16" height="16" viewBox="0 0 16 16" aria-hidden="true">
581
+ <circle cx="8" cy="8" r="6.25" fill="none" stroke={color} strokeWidth="1.4" />
582
+ <path d="M5 8.2 L7.1 10.2 L11 6.2" fill="none" stroke={color} strokeWidth="1.4" />
583
+ </svg>
584
+ );
585
+ }
586
+ if (tone === "warning" || tone === "danger") {
587
+ return (
588
+ <svg width="16" height="16" viewBox="0 0 16 16" aria-hidden="true">
589
+ <circle cx="8" cy="8" r="6.25" fill="none" stroke={color} strokeWidth="1.4" />
590
+ <path d="M8 4.5 V9" stroke={color} strokeWidth="1.4" />
591
+ <circle cx="8" cy="11.2" r="0.7" fill={color} />
592
+ </svg>
593
+ );
594
+ }
595
+ return (
596
+ <svg width="16" height="16" viewBox="0 0 16 16" aria-hidden="true">
597
+ <circle cx="8" cy="8" r="6.25" fill="none" stroke={color} strokeWidth="1.4" />
598
+ <circle cx="8" cy="5.2" r="0.7" fill={color} />
599
+ <path d="M8 7.2 V11.5" stroke={color} strokeWidth="1.4" />
600
+ </svg>
601
+ );
602
+ }
603
+
604
+ export function Callout({
605
+ children,
606
+ tone = "info",
607
+ title,
608
+ icon,
609
+ style,
610
+ }: {
611
+ children?: ReactNode;
612
+ tone?: ChartTone;
613
+ title?: ReactNode;
614
+ icon?: ReactNode;
615
+ style?: CSSProperties;
616
+ }) {
617
+ const theme = useHostTheme();
618
+ return (
619
+ <div
620
+ data-callout=""
621
+ style={mergeStyle(
622
+ {
623
+ display: "flex",
624
+ gap: 10,
625
+ padding: "10px 12px",
626
+ borderRadius: 8,
627
+ background: theme.fill.tertiary,
628
+ color: theme.text.primary,
629
+ fontFamily: fontStack,
630
+ },
631
+ style,
632
+ )}
633
+ >
634
+ <span style={{ flex: "none", marginTop: 2 }}>{icon ?? <CalloutIcon tone={tone} />}</span>
635
+ <div style={{ minWidth: 0, display: "flex", flexDirection: "column", gap: 4 }}>
636
+ {title != null ? (
637
+ <div style={{ fontSize: 14, lineHeight: "20px", fontWeight: 590 }}>{title}</div>
638
+ ) : null}
639
+ <div style={{ fontSize: 14, lineHeight: "20px", color: theme.text.secondary }}>{children}</div>
640
+ </div>
641
+ </div>
642
+ );
643
+ }
644
+
645
+ const rowToneColor = {
646
+ success: toneColor.success,
647
+ danger: toneColor.danger,
648
+ warning: toneColor.warning,
649
+ info: toneColor.info,
650
+ neutral: toneColor.neutral,
651
+ } as const;
652
+
653
+ export function Table({
654
+ headers,
655
+ rows,
656
+ columnAlign,
657
+ rowTone,
658
+ framed = true,
659
+ striped = false,
660
+ stickyHeader = false,
661
+ style,
662
+ emptyMessage,
663
+ }: {
664
+ headers: ReactNode[];
665
+ rows: ReactNode[][];
666
+ columnAlign?: Array<"left" | "center" | "right" | undefined>;
667
+ rowTone?: Array<"success" | "danger" | "warning" | "info" | "neutral" | undefined>;
668
+ framed?: boolean;
669
+ striped?: boolean;
670
+ stickyHeader?: boolean;
671
+ style?: CSSProperties;
672
+ emptyMessage?: ReactNode;
673
+ }) {
674
+ const theme = useHostTheme();
675
+ const alignOf = (index: number) => columnAlign?.[index] ?? "left";
676
+ return (
677
+ <div
678
+ data-table=""
679
+ style={mergeStyle(
680
+ {
681
+ border: framed ? `1px solid ${theme.stroke.primary}` : "none",
682
+ borderRadius: framed ? 8 : 0,
683
+ overflow: "hidden",
684
+ background: theme.bg.editor,
685
+ },
686
+ style,
687
+ )}
688
+ >
689
+ <table style={{ width: "100%", borderCollapse: "collapse", fontFamily: fontStack }}>
690
+ <thead>
691
+ <tr>
692
+ {headers.map((header, index) => (
693
+ <th
694
+ key={index}
695
+ style={{
696
+ textAlign: alignOf(index),
697
+ fontSize: 12,
698
+ lineHeight: "16px",
699
+ fontWeight: 590,
700
+ color: theme.text.tertiary,
701
+ padding: "8px 10px",
702
+ borderBottom: `1px solid ${theme.stroke.tertiary}`,
703
+ background: theme.bg.editor,
704
+ position: stickyHeader ? "sticky" : "static",
705
+ top: 0,
706
+ verticalAlign: "bottom",
707
+ }}
708
+ >
709
+ {header}
710
+ </th>
711
+ ))}
712
+ </tr>
713
+ </thead>
714
+ <tbody>
715
+ {rows.length === 0 ? (
716
+ <tr>
717
+ <td
718
+ colSpan={headers.length}
719
+ style={{ padding: "12px 10px", color: theme.text.tertiary, fontSize: 13 }}
720
+ >
721
+ {emptyMessage}
722
+ </td>
723
+ </tr>
724
+ ) : (
725
+ rows.map((row, rowIndex) => (
726
+ <tr
727
+ key={rowIndex}
728
+ style={{
729
+ background:
730
+ striped && rowIndex % 2 === 1 ? theme.fill.quaternary : "transparent",
731
+ }}
732
+ >
733
+ {headers.map((_, columnIndex) => {
734
+ const cell = row[columnIndex] ?? "";
735
+ const tone = columnIndex === 0 ? rowTone?.[rowIndex] : undefined;
736
+ return (
737
+ <td
738
+ key={columnIndex}
739
+ style={{
740
+ textAlign: alignOf(columnIndex),
741
+ fontSize: 13,
742
+ lineHeight: "18px",
743
+ color: theme.text.primary,
744
+ padding: "8px 10px",
745
+ borderBottom: `1px solid ${theme.stroke.tertiary}`,
746
+ verticalAlign: "top",
747
+ overflowWrap: "break-word",
748
+ fontVariantNumeric: alignOf(columnIndex) === "right" ? "tabular-nums" : "normal",
749
+ }}
750
+ >
751
+ {tone ? (
752
+ <span style={{ display: "inline-flex", alignItems: "flex-start", gap: 8 }}>
753
+ <span
754
+ data-row-tone={tone}
755
+ style={{
756
+ width: 8,
757
+ height: 8,
758
+ marginTop: 5,
759
+ borderRadius: 99,
760
+ background: rowToneColor[tone],
761
+ flex: "none",
762
+ }}
763
+ />
764
+ <span>{cell}</span>
765
+ </span>
766
+ ) : (
767
+ cell
768
+ )}
769
+ </td>
770
+ );
771
+ })}
772
+ </tr>
773
+ ))
774
+ )}
775
+ </tbody>
776
+ </table>
777
+ </div>
778
+ );
779
+ }