@syscore/ui-library 2.0.0-beta-publish-workflow-beta.1 → 2.0.0-beta-publish-workflow-beta.3

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.
@@ -154,6 +154,10 @@ interface NavigationProps {
154
154
  beforeActions?: React.ReactNode; // Slot for custom items before user icon (e.g., language switcher)
155
155
  userDropdown?: React.ReactNode; // Dropdown content to show when user icon is clicked
156
156
  isStrategy?: boolean;
157
+ /** Show the small alpha (α) badge next to the logo. Default true. */
158
+ showAlpha?: boolean;
159
+ /** Show the back/close button in strategy mode. Default true. */
160
+ showClose?: boolean;
157
161
  Link?: LinkComponent; // Optional Link component from routing library
158
162
  onLinkClick?: (href: string) => void; // Fallback callback for navigation
159
163
  onClose?: () => void;
@@ -166,6 +170,8 @@ export const StandardNavigation: React.FC<NavigationProps> = ({
166
170
  beforeActions,
167
171
  userDropdown,
168
172
  isStrategy = false,
173
+ showAlpha = true,
174
+ showClose = true,
169
175
  Link: LinkComponent,
170
176
  onLinkClick,
171
177
  onClose,
@@ -393,7 +399,7 @@ export const StandardNavigation: React.FC<NavigationProps> = ({
393
399
 
394
400
  <div className="navigation-container">
395
401
  <div className="navigation-logo-container">
396
- {isStrategy ? (
402
+ {isStrategy && showClose ? (
397
403
  <Button
398
404
  className="navigation-close-button"
399
405
  size="icon"
@@ -425,7 +431,7 @@ export const StandardNavigation: React.FC<NavigationProps> = ({
425
431
 
426
432
  <NavLogo dark={isStrategy} />
427
433
  <StandardLogo className={cn(!isStrategy ? "text-white" : "text-black")} />
428
- <AlphaIcon dark={isStrategy} />
434
+ {showAlpha ? <AlphaIcon dark={isStrategy} /> : null}
429
435
  </>
430
436
 
431
437
  ) : null}
@@ -2,20 +2,62 @@ import * as React from "react";
2
2
 
3
3
  import { cn } from "@/lib/utils";
4
4
 
5
- const Table = React.forwardRef<
6
- HTMLTableElement,
7
- React.HTMLAttributes<HTMLTableElement>
8
- >(({ className, ...props }, ref) => (
9
- <div className="table-wrapper">
10
- <table
11
- ref={ref}
12
- className={cn("table", className)}
13
- {...props}
14
- />
15
- </div>
16
- ));
5
+ /**
6
+ * Table — built from the Figma component set `Table component` (node 12176:414).
7
+ *
8
+ * Figma models a single *cell* with four properties and ~135 variants. Two of
9
+ * them are structural rather than authored:
10
+ *
11
+ * - `Alignment` (Left / Center / Right) is really the cell's **column
12
+ * position**: it selects which borders and which corner radius the cell
13
+ * carries, not how the text sits. `Center` carries all four, so every column
14
+ * is divided; that grid is derived here from the cell order.
15
+ * - `Placement` (Header / Intermediate / Bottom) is the **row position**.
16
+ * Header is its own element; Intermediate vs Bottom is derived from
17
+ * `tr:last-child`.
18
+ *
19
+ * `Content type` (Text / Text + Tag / Text + Action / Tag / Action) collapses
20
+ * into composition — a cell renders whatever children it is given, with the
21
+ * 10px gap Figma specifies.
22
+ *
23
+ * That leaves `density` as the one real variant, and it is the cell's *vertical*
24
+ * padding only — 16 / 20 / 24, all on the `--space-*` scale. Horizontal padding
25
+ * stays 16 at every density. Cell heights then follow from the content, matching
26
+ * Figma's 40/48/56 for headers, 43/51/59 for text rows and 64/72/80 for tag and
27
+ * action rows.
28
+ */
29
+ type TableDensity = "compact" | "balanced" | "spacious";
30
+ type TableAlign = "left" | "center" | "right";
31
+
32
+ // ---------------------------------------------------------------------------
33
+ // Root
34
+ // ---------------------------------------------------------------------------
35
+
36
+ interface TableProps extends React.TableHTMLAttributes<HTMLTableElement> {
37
+ /** Figma `Density`. Sets the cell's vertical padding; heights follow. Default `compact`. */
38
+ density?: TableDensity;
39
+ /** Wrapper class, for width or overflow handling. */
40
+ containerClassName?: string;
41
+ }
42
+
43
+ const Table = React.forwardRef<HTMLTableElement, TableProps>(
44
+ ({ className, containerClassName, density = "compact", ...props }, ref) => (
45
+ <div className={cn("table-wrapper", containerClassName)}>
46
+ <table
47
+ ref={ref}
48
+ data-density={density}
49
+ className={cn("table", className)}
50
+ {...props}
51
+ />
52
+ </div>
53
+ ),
54
+ );
17
55
  Table.displayName = "Table";
18
56
 
57
+ // ---------------------------------------------------------------------------
58
+ // Sections and rows
59
+ // ---------------------------------------------------------------------------
60
+
19
61
  const TableHeader = React.forwardRef<
20
62
  HTMLTableSectionElement,
21
63
  React.HTMLAttributes<HTMLTableSectionElement>
@@ -28,23 +70,19 @@ const TableBody = React.forwardRef<
28
70
  HTMLTableSectionElement,
29
71
  React.HTMLAttributes<HTMLTableSectionElement>
30
72
  >(({ className, ...props }, ref) => (
31
- <tbody
32
- ref={ref}
33
- className={cn("table-body", className)}
34
- {...props}
35
- />
73
+ <tbody ref={ref} className={cn("table-body", className)} {...props} />
36
74
  ));
37
75
  TableBody.displayName = "TableBody";
38
76
 
77
+ /**
78
+ * Figma's `Placement=Bottom` is the last row of the table. As a section it also
79
+ * takes over the bottom corner radii from the body.
80
+ */
39
81
  const TableFooter = React.forwardRef<
40
82
  HTMLTableSectionElement,
41
83
  React.HTMLAttributes<HTMLTableSectionElement>
42
84
  >(({ className, ...props }, ref) => (
43
- <tfoot
44
- ref={ref}
45
- className={cn("table-footer", className)}
46
- {...props}
47
- />
85
+ <tfoot ref={ref} className={cn("table-footer", className)} {...props} />
48
86
  ));
49
87
  TableFooter.displayName = "TableFooter";
50
88
 
@@ -52,57 +90,136 @@ const TableRow = React.forwardRef<
52
90
  HTMLTableRowElement,
53
91
  React.HTMLAttributes<HTMLTableRowElement>
54
92
  >(({ className, ...props }, ref) => (
55
- <tr
56
- ref={ref}
57
- className={cn("table-row", className)}
58
- {...props}
59
- />
93
+ <tr ref={ref} className={cn("table-row", className)} {...props} />
60
94
  ));
61
95
  TableRow.displayName = "TableRow";
62
96
 
63
- const TableHead = React.forwardRef<
64
- HTMLTableCellElement,
65
- React.ThHTMLAttributes<HTMLTableCellElement>
66
- >(({ className, ...props }, ref) => (
67
- <th
68
- ref={ref}
69
- className={cn("table-head", className)}
70
- {...props}
71
- />
72
- ));
73
- TableHead.displayName = "TableHead";
97
+ // ---------------------------------------------------------------------------
98
+ // Cells
99
+ // ---------------------------------------------------------------------------
74
100
 
75
- const TableCell = React.forwardRef<
76
- HTMLTableCellElement,
77
- React.TdHTMLAttributes<HTMLTableCellElement>
78
- >(({ className, ...props }, ref) => (
79
- <td
80
- ref={ref}
81
- className={cn("table-cell", className)}
82
- {...props}
83
- />
84
- ));
101
+ /**
102
+ * Figma's code/strategy tag (instance `code_strategy_*`): emerald tint with a
103
+ * 1.5px tinted border and tabular figures.
104
+ */
105
+ interface TableTagProps extends React.HTMLAttributes<HTMLSpanElement> {}
106
+
107
+ const TableTag = React.forwardRef<HTMLSpanElement, TableTagProps>(
108
+ ({ className, ...props }, ref) => (
109
+ <span ref={ref} className={cn("table-tag", className)} {...props} />
110
+ ),
111
+ );
112
+ TableTag.displayName = "TableTag";
113
+
114
+ interface TableCellProps extends React.ThHTMLAttributes<HTMLTableCellElement> {
115
+ /**
116
+ * Text alignment within the cell. Figma's `Alignment` property is column
117
+ * position, not text alignment, so this is additive — tables need it for
118
+ * numeric columns.
119
+ */
120
+ align?: TableAlign;
121
+ /** The column label. Figma sets it uppercase in the overline ramp. */
122
+ label?: React.ReactNode;
123
+ }
124
+
125
+ /** Figma `Placement=Header`: cyan/50 fill, uppercase overline label in cyan/800. */
126
+ const TableHeaderCell = React.forwardRef<HTMLTableCellElement, TableCellProps>(
127
+ ({ className, align = "left", label, children, ...props }, ref) => (
128
+ <th
129
+ ref={ref}
130
+ scope="col"
131
+ data-align={align}
132
+ className={cn("table-header-cell", className)}
133
+ {...props}
134
+ >
135
+ <span className="table-cell-inner overline-medium">
136
+ {label}
137
+ {children}
138
+ </span>
139
+ </th>
140
+ ),
141
+ );
142
+ TableHeaderCell.displayName = "TableHeaderCell";
143
+
144
+ /**
145
+ * Figma `Placement=Intermediates | Bottom`: white fill, Mazzard Medium 16/21.
146
+ *
147
+ * Figma's `Content type` axis is expressed as content props rather than an
148
+ * enum: pass any of `text`, `tag` and `action` and the cell renders them in
149
+ * Figma's order with the 10px gap. `children` still works for anything the
150
+ * props cannot express (a link, two lines, a custom control).
151
+ */
152
+ interface TableBodyCellProps
153
+ extends React.TdHTMLAttributes<HTMLTableCellElement> {
154
+ /** Text alignment within the cell. Additive to Figma. */
155
+ align?: TableAlign;
156
+ /** Figma `Content type=Text …`: Mazzard Medium 16/21 in gray/800. */
157
+ text?: React.ReactNode;
158
+ /** Figma `Content type=… + Tag`: wrapped in the code/strategy tag. */
159
+ tag?: React.ReactNode;
160
+ /** Figma `Content type=… + Action`: pass one or more `TableAction`. */
161
+ action?: React.ReactNode;
162
+ }
163
+
164
+ const TableCell = React.forwardRef<HTMLTableCellElement, TableBodyCellProps>(
165
+ (
166
+ { className, align = "left", text, tag, action, children, ...props },
167
+ ref,
168
+ ) => (
169
+ <td
170
+ ref={ref}
171
+ data-align={align}
172
+ className={cn("table-cell", className)}
173
+ {...props}
174
+ >
175
+ <span className="table-cell-inner">
176
+ {text}
177
+ {tag != null ? <TableTag>{tag}</TableTag> : null}
178
+ {action}
179
+ {children}
180
+ </span>
181
+ </td>
182
+ ),
183
+ );
85
184
  TableCell.displayName = "TableCell";
86
185
 
87
- const TableCaption = React.forwardRef<
88
- HTMLTableCaptionElement,
89
- React.HTMLAttributes<HTMLTableCaptionElement>
90
- >(({ className, ...props }, ref) => (
91
- <caption
186
+ // ---------------------------------------------------------------------------
187
+ // Cell content — the pieces Figma's `Content type` composes
188
+ // ---------------------------------------------------------------------------
189
+
190
+ /**
191
+ * Figma's `button_icon_*`: a 32px white circle with a gray/100 border holding a
192
+ * 14px icon. Pass the icon as children.
193
+ */
194
+ const TableAction = React.forwardRef<
195
+ HTMLButtonElement,
196
+ React.ButtonHTMLAttributes<HTMLButtonElement>
197
+ >(({ className, type = "button", ...props }, ref) => (
198
+ <button
92
199
  ref={ref}
93
- className={cn("table-caption", className)}
200
+ type={type}
201
+ className={cn("table-action", className)}
94
202
  {...props}
95
203
  />
96
204
  ));
97
- TableCaption.displayName = "TableCaption";
205
+ TableAction.displayName = "TableAction";
98
206
 
99
207
  export {
100
208
  Table,
101
209
  TableHeader,
102
210
  TableBody,
103
211
  TableFooter,
104
- TableHead,
105
212
  TableRow,
213
+ TableHeaderCell,
106
214
  TableCell,
107
- TableCaption,
215
+ TableTag,
216
+ TableAction,
217
+ };
218
+
219
+ export type {
220
+ TableProps,
221
+ TableCellProps,
222
+ TableBodyCellProps,
223
+ TableDensity,
224
+ TableAlign,
108
225
  };
package/client/global.css CHANGED
@@ -5310,81 +5310,6 @@ body {
5310
5310
  slide-in-from-bottom 0.15s ease-in-out;
5311
5311
  }
5312
5312
 
5313
- /* Table Styles */
5314
- .table-wrapper {
5315
- position: relative;
5316
- width: 100%;
5317
- overflow: auto;
5318
- }
5319
-
5320
- .table {
5321
- width: 100%;
5322
- font-size: 0.875rem;
5323
- line-height: 1.25rem;
5324
- caption-side: bottom;
5325
- }
5326
-
5327
- .table-header tr {
5328
- border-bottom: 1px solid hsl(var(--border));
5329
- }
5330
-
5331
- .table-body tr:last-child {
5332
- border-bottom: 0;
5333
- }
5334
-
5335
- .table-footer {
5336
- border-top: 1px solid hsl(var(--border));
5337
- background-color: hsl(var(--muted) / 0.5);
5338
- font-weight: 500;
5339
- }
5340
-
5341
- .table-footer tr:last-child {
5342
- border-bottom: 0;
5343
- }
5344
-
5345
- .table-row {
5346
- border-bottom: 1px solid hsl(var(--border));
5347
- transition: background-color 0.15s ease-in-out;
5348
- }
5349
-
5350
- .table-row:hover {
5351
- background-color: hsl(var(--muted) / 0.5);
5352
- }
5353
-
5354
- .table-row[data-state="selected"] {
5355
- background-color: hsl(var(--muted));
5356
- }
5357
-
5358
- .table-head {
5359
- height: 3rem;
5360
- padding-left: 1rem;
5361
- padding-right: 1rem;
5362
- text-align: left;
5363
- vertical-align: middle;
5364
- font-weight: 500;
5365
- color: hsl(var(--muted-foreground));
5366
- }
5367
-
5368
- .table-head:has([role="checkbox"]) {
5369
- padding-right: 0;
5370
- }
5371
-
5372
- .table-cell {
5373
- padding: 1rem;
5374
- vertical-align: middle;
5375
- }
5376
-
5377
- .table-cell:has([role="checkbox"]) {
5378
- padding-right: 0;
5379
- }
5380
-
5381
- .table-caption {
5382
- margin-top: 1rem;
5383
- font-size: 0.875rem;
5384
- line-height: 1.25rem;
5385
- color: hsl(var(--muted-foreground));
5386
- }
5387
-
5388
5313
  /* Search/SearchField Styles */
5389
5314
  .search-field-dropdown {
5390
5315
  animation: fade-in 0.15s ease-in-out;
@@ -5582,17 +5507,17 @@ body {
5582
5507
  }
5583
5508
 
5584
5509
  /* ---------------------------------------------------------------------------
5585
- TableV01 — Figma `Table component` (node 12176:414).
5510
+ Table — Figma `Table component` (node 12176:414).
5586
5511
  Density is the cell's vertical padding (16 / 20 / 24) and heights follow from
5587
5512
  the content. Column position and row position — Figma's `Alignment` and
5588
5513
  `Placement` — are derived structurally rather than authored.
5589
5514
  --------------------------------------------------------------------------- */
5590
- .table-v01-wrapper {
5515
+ .table-wrapper {
5591
5516
  width: 100%;
5592
5517
  overflow-x: auto;
5593
5518
  }
5594
5519
 
5595
- .table-v01 {
5520
+ .table {
5596
5521
  /* Figma: density moves the vertical padding only — horizontal stays 16.
5597
5522
  Compact `p-[16px]`, Balanced `px-[16px] py-[20px]`, Spacious `py-[24px]`. */
5598
5523
  --table-cell-padding-block: var(--space-md);
@@ -5621,16 +5546,16 @@ body {
5621
5546
  }
5622
5547
 
5623
5548
  /* Figma `Density` — the only authored variant. */
5624
- .table-v01[data-density="balanced"] {
5549
+ .table[data-density="balanced"] {
5625
5550
  --table-cell-padding-block: var(--space-lg);
5626
5551
  }
5627
5552
 
5628
- .table-v01[data-density="spacious"] {
5553
+ .table[data-density="spacious"] {
5629
5554
  --table-cell-padding-block: var(--space-xl);
5630
5555
  }
5631
5556
 
5632
- .table-v01-header-cell,
5633
- .table-v01-cell {
5557
+ .table-header-cell,
5558
+ .table-cell {
5634
5559
  padding: var(--table-cell-padding-block) var(--table-cell-padding-inline);
5635
5560
  border-bottom: 1px solid var(--table-border-color);
5636
5561
  /* Figma's `Alignment=Center` carries all four borders, so every column is
@@ -5641,29 +5566,29 @@ body {
5641
5566
  vertical-align: middle;
5642
5567
  }
5643
5568
 
5644
- .table-v01-header-cell:last-child,
5645
- .table-v01-cell:last-child {
5569
+ .table-header-cell:last-child,
5570
+ .table-cell:last-child {
5646
5571
  border-right: 1px solid var(--table-border-color);
5647
5572
  }
5648
5573
 
5649
5574
  /* Figma `Placement=Header`: cyan/50 fill, top border, top corners rounded. */
5650
- .table-v01-header-cell {
5575
+ .table-header-cell {
5651
5576
  border-top: 1px solid var(--table-border-color);
5652
5577
  background-color: var(--table-header-bg);
5653
5578
  color: var(--table-header-color);
5654
5579
  white-space: nowrap;
5655
5580
  }
5656
5581
 
5657
- .table-v01-header tr:first-child .table-v01-header-cell:first-child {
5582
+ .table-header tr:first-child .table-header-cell:first-child {
5658
5583
  border-top-left-radius: var(--table-radius);
5659
5584
  }
5660
5585
 
5661
- .table-v01-header tr:first-child .table-v01-header-cell:last-child {
5586
+ .table-header tr:first-child .table-header-cell:last-child {
5662
5587
  border-top-right-radius: var(--table-radius);
5663
5588
  }
5664
5589
 
5665
5590
  /* Figma `Placement=Intermediates`; `Bottom` is the last row. */
5666
- .table-v01-cell {
5591
+ .table-cell {
5667
5592
  background-color: var(--table-body-bg);
5668
5593
  color: var(--table-body-color);
5669
5594
  font-size: var(--table-body-font-size);
@@ -5673,44 +5598,41 @@ body {
5673
5598
 
5674
5599
  /* Figma `Placement=Bottom` — the final row, which owns the bottom corners.
5675
5600
  A footer supersedes the body, so the body only rounds when there is none. */
5676
- .table-v01-body:last-of-type tr:last-child .table-v01-cell:first-child,
5677
- .table-v01-footer tr:last-child .table-v01-cell:first-child {
5601
+ .table-body:last-of-type tr:last-child .table-cell:first-child,
5602
+ .table-footer tr:last-child .table-cell:first-child {
5678
5603
  border-bottom-left-radius: var(--table-radius);
5679
5604
  }
5680
5605
 
5681
- .table-v01-body:last-of-type tr:last-child .table-v01-cell:last-child,
5682
- .table-v01-footer tr:last-child .table-v01-cell:last-child {
5606
+ .table-body:last-of-type tr:last-child .table-cell:last-child,
5607
+ .table-footer tr:last-child .table-cell:last-child {
5683
5608
  border-bottom-right-radius: var(--table-radius);
5684
5609
  }
5685
5610
 
5686
5611
  /* When a footer is present the body must not round its last row. */
5687
- .table-v01:has(.table-v01-footer)
5688
- .table-v01-body
5689
- tr:last-child
5690
- .table-v01-cell {
5612
+ .table:has(.table-footer) .table-body tr:last-child .table-cell {
5691
5613
  border-bottom-left-radius: 0;
5692
5614
  border-bottom-right-radius: 0;
5693
5615
  }
5694
5616
 
5695
5617
  /* Figma composes cell content in a row with a 10px gap. */
5696
- .table-v01-cell-inner {
5618
+ .table-cell-inner {
5697
5619
  display: flex;
5698
5620
  align-items: center;
5699
5621
  gap: var(--table-cell-gap);
5700
5622
  }
5701
5623
 
5702
- .table-v01-header-cell[data-align="center"] .table-v01-cell-inner,
5703
- .table-v01-cell[data-align="center"] .table-v01-cell-inner {
5624
+ .table-header-cell[data-align="center"] .table-cell-inner,
5625
+ .table-cell[data-align="center"] .table-cell-inner {
5704
5626
  justify-content: center;
5705
5627
  }
5706
5628
 
5707
- .table-v01-header-cell[data-align="right"] .table-v01-cell-inner,
5708
- .table-v01-cell[data-align="right"] .table-v01-cell-inner {
5629
+ .table-header-cell[data-align="right"] .table-cell-inner,
5630
+ .table-cell[data-align="right"] .table-cell-inner {
5709
5631
  justify-content: flex-end;
5710
5632
  }
5711
5633
 
5712
5634
  /* Figma instance `code_strategy_*` — emerald tint, 1.5px tinted border. */
5713
- .table-v01-tag {
5635
+ .table-tag {
5714
5636
  box-sizing: border-box;
5715
5637
  display: inline-flex;
5716
5638
  flex-shrink: 0;
@@ -5730,7 +5652,7 @@ body {
5730
5652
  }
5731
5653
 
5732
5654
  /* Figma instance `button_icon_*` — 32px white circle, gray/100 border. */
5733
- .table-v01-action {
5655
+ .table-action {
5734
5656
  box-sizing: border-box;
5735
5657
  display: inline-flex;
5736
5658
  flex-shrink: 0;
@@ -5746,16 +5668,16 @@ body {
5746
5668
  cursor: pointer;
5747
5669
  }
5748
5670
 
5749
- .table-v01-action:hover {
5671
+ .table-action:hover {
5750
5672
  background-color: var(--color-gray-50);
5751
5673
  }
5752
5674
 
5753
- .table-v01-action:focus-visible {
5675
+ .table-action:focus-visible {
5754
5676
  outline: 2px solid var(--color-cyan-300);
5755
5677
  outline-offset: 2px;
5756
5678
  }
5757
5679
 
5758
- .table-v01-action svg {
5680
+ .table-action svg {
5759
5681
  display: block;
5760
5682
  width: var(--table-action-icon-size);
5761
5683
  height: var(--table-action-icon-size);