You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add SplitChart details and document Table sizing (#126)
## Summary
- add the `SplitChart` detailed variant with value and percentage
display plus test coverage
- document the Table column sizing pattern and add a `ColumnSizing`
story fixture
- tighten the SplitChart legend assertion so the new detailed legend
coverage matches the component structure
## Test plan
- [x] `npm run lint`
- [x] `npm test -- src/components/Chart/Chart.test.tsx`
Made with [Cursor](https://cursor.com)
Copy file name to clipboardExpand all lines: docs/using-origin-in-your-app.md
+56Lines changed: 56 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -130,6 +130,62 @@ If you need app-specific tokens or mixins, create them in a local `src/tokens/`
130
130
@use"pkg:@lightsparkdev/origin/tokens/text-styles"as*; // from Origin
131
131
```
132
132
133
+
## Table Column Sizing
134
+
135
+
`Table.Root` uses `table-layout: fixed` so column widths are predictable and text truncates cleanly. The sizing model is simple:
136
+
137
+
-**Hug columns** — Set an explicit width via `style`. The column stays at that size. Use for checkboxes, status badges, action menus, and other fixed-width content.
138
+
-**Fill columns** — Don't set a width. The browser divides remaining space equally among columns without explicit widths.
TanStack defaults every column to `size: 150`, so `header.getSize()` always returns a number. If you pass that to every header cell, `table-layout: fixed` distributes surplus space proportionally and inflates hug columns.
161
+
162
+
Only set width on columns that need it:
163
+
164
+
```tsx
165
+
// In your column definitions, tag hug columns via meta:
Copy file name to clipboardExpand all lines: src/components/Table/Table.stories.tsx
+13Lines changed: 13 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,7 @@ import {
7
7
AlignedTable,
8
8
LoadingTable,
9
9
ResizableTable,
10
+
ColumnSizingTable,
10
11
SlotsTable,
11
12
DescriptionTable,
12
13
FooterTable,
@@ -91,6 +92,18 @@ export const Resizable: Story = {
91
92
},
92
93
};
93
94
95
+
exportconstColumnSizing: Story={
96
+
render: ()=><ColumnSizingTable/>,
97
+
parameters: {
98
+
docs: {
99
+
description: {
100
+
story:
101
+
'Hug columns (checkbox, status, amount, actions) get explicit widths; fill columns (customer, product, note) omit width and split remaining space equally. Tag hug columns with `meta: { sizing: "hug" }` and only pass `style.width` when that flag is set.',
0 commit comments