{"name":"diff-table","title":"Diff Table","description":"","kind":"block","category":"data","status":"beta","props":{"title":{"type":"string","default":"Proposed changes"},"columns":{"type":"array","items":{"0":"string"},"default":["Name","Category","Value"]},"rows":{"type":"array","items":{"key":"string","name":"string","category":"string","tone":"accent|neutral|orange|green","value":"string","change":"removed|added|unchanged"}},"included":{"type":"object","model":true,"description":"Record<key, boolean>; defaults to every changed row included"},"accepted":{"type":"boolean","default":false,"model":true},"labels":{"type":"object","description":"{ hint, remove, add, apply, removal, removals, addition, additions, edit, edits, applied, change, changes, empty }"}},"playground":{"name":"Playground","props":{"title":"Proposed price changes","columns":["Plan","Billing","Price"],"rows":[{"key":"team-49","name":"Team","category":"Monthly","tone":"accent","value":"$49 per seat","change":"removed"},{"key":"team-59","name":"Team","category":"Monthly","tone":"accent","value":"$59 per seat","change":"added"},{"key":"business","name":"Business","category":"Monthly","tone":"accent","value":"$99 per seat","change":"unchanged"}]}},"exampleFiles":[{"file":"default","title":"Review the agent's price change"},{"file":"business-held-back","title":"Keep the Business price for now"},{"file":"applied","title":"Price change applied"},{"file":"no-changes","title":"Nothing to change"}],"worstCase":[{"name":"Long names, unbreakable slug, non-Latin and right-to-left","props":{"title":"Proposed cleanup of every retired add-on across all regional billing catalogs","rows":[{"key":"long","name":"Customer-managed encryption keys with per-region rotation, audit trails and break-glass access","category":"Add-on","tone":"orange","value":"northwind-industries-holdings-enterprise-billing-platform-division","change":"removed"},{"key":"one","name":"A","category":"B","tone":"neutral","value":"c","change":"removed"},{"key":"cjk","name":"監査ログのエクスポート","category":"追加機能","tone":"accent","value":"株式会社クモ","change":"unchanged"},{"key":"rtl","name":"تصدير سجل التدقيق","category":"إضافة","tone":"green","value":"فوترة-الشروق","change":"added"}]}},{"name":"Sixty rows","props":{"rows":[{"key":"f1","name":"Add-on 1","category":"Core","tone":"accent","value":"billing-core","change":"removed"},{"key":"f2","name":"Add-on 2","category":"Legacy","tone":"neutral","value":"identity-svc","change":"unchanged"},{"key":"f3","name":"Add-on 3","category":"Add-on","tone":"orange","value":"platform-ops","change":"unchanged"},{"key":"f4","name":"Add-on 4","category":"Core","tone":"accent","value":"billing-core","change":"removed"},{"key":"f5","name":"Add-on 5","category":"Legacy","tone":"neutral","value":"identity-svc","change":"unchanged"},{"key":"f6","name":"Add-on 6","category":"Add-on","tone":"orange","value":"platform-ops","change":"removed"},{"key":"f7","name":"Add-on 7","category":"Core","tone":"accent","value":"billing-core","change":"unchanged"},{"key":"f8","name":"Add-on 8","category":"Legacy","tone":"neutral","value":"identity-svc","change":"unchanged"},{"key":"f9","name":"Add-on 9","category":"Add-on","tone":"orange","value":"platform-ops","change":"removed"},{"key":"f10","name":"Add-on 10","category":"Core","tone":"accent","value":"billing-core","change":"unchanged"},{"key":"f11","name":"Add-on 11","category":"Legacy","tone":"neutral","value":"identity-svc","change":"removed"},{"key":"f12","name":"Add-on 12","category":"Add-on","tone":"orange","value":"platform-ops","change":"unchanged"},{"key":"f13","name":"Add-on 13","category":"Core","tone":"accent","value":"billing-core","change":"unchanged"},{"key":"f14","name":"Add-on 14","category":"Legacy","tone":"neutral","value":"identity-svc","change":"removed"},{"key":"f15","name":"Add-on 15","category":"Add-on","tone":"orange","value":"platform-ops","change":"unchanged"},{"key":"f16","name":"Add-on 16","category":"Core","tone":"accent","value":"billing-core","change":"removed"},{"key":"f17","name":"Add-on 17","category":"Legacy","tone":"neutral","value":"identity-svc","change":"unchanged"},{"key":"f18","name":"Add-on 18","category":"Add-on","tone":"orange","value":"platform-ops","change":"unchanged"},{"key":"f19","name":"Add-on 19","category":"Core","tone":"accent","value":"billing-core","change":"removed"},{"key":"f20","name":"Add-on 20","category":"Legacy","tone":"neutral","value":"identity-svc","change":"unchanged"},{"key":"f21","name":"Add-on 21","category":"Add-on","tone":"orange","value":"platform-ops","change":"removed"},{"key":"f22","name":"Add-on 22","category":"Core","tone":"accent","value":"billing-core","change":"unchanged"},{"key":"f23","name":"Add-on 23","category":"Legacy","tone":"neutral","value":"identity-svc","change":"unchanged"},{"key":"f24","name":"Add-on 24","category":"Add-on","tone":"orange","value":"platform-ops","change":"removed"},{"key":"f25","name":"Add-on 25","category":"Core","tone":"accent","value":"billing-core","change":"unchanged"},{"key":"f26","name":"Add-on 26","category":"Legacy","tone":"neutral","value":"identity-svc","change":"removed"},{"key":"f27","name":"Add-on 27","category":"Add-on","tone":"orange","value":"platform-ops","change":"unchanged"},{"key":"f28","name":"Add-on 28","category":"Core","tone":"accent","value":"billing-core","change":"unchanged"},{"key":"f29","name":"Add-on 29","category":"Legacy","tone":"neutral","value":"identity-svc","change":"removed"},{"key":"f30","name":"Add-on 30","category":"Add-on","tone":"orange","value":"platform-ops","change":"unchanged"},{"key":"f31","name":"Add-on 31","category":"Core","tone":"accent","value":"billing-core","change":"removed"},{"key":"f32","name":"Add-on 32","category":"Legacy","tone":"neutral","value":"identity-svc","change":"unchanged"},{"key":"f33","name":"Add-on 33","category":"Add-on","tone":"orange","value":"platform-ops","change":"unchanged"},{"key":"f34","name":"Add-on 34","category":"Core","tone":"accent","value":"billing-core","change":"removed"},{"key":"f35","name":"Add-on 35","category":"Legacy","tone":"neutral","value":"identity-svc","change":"unchanged"},{"key":"f36","name":"Add-on 36","category":"Add-on","tone":"orange","value":"platform-ops","change":"removed"},{"key":"f37","name":"Add-on 37","category":"Core","tone":"accent","value":"billing-core","change":"unchanged"},{"key":"f38","name":"Add-on 38","category":"Legacy","tone":"neutral","value":"identity-svc","change":"unchanged"},{"key":"f39","name":"Add-on 39","category":"Add-on","tone":"orange","value":"platform-ops","change":"removed"},{"key":"f40","name":"Add-on 40","category":"Core","tone":"accent","value":"billing-core","change":"unchanged"},{"key":"f41","name":"Add-on 41","category":"Legacy","tone":"neutral","value":"identity-svc","change":"removed"},{"key":"f42","name":"Add-on 42","category":"Add-on","tone":"orange","value":"platform-ops","change":"unchanged"},{"key":"f43","name":"Add-on 43","category":"Core","tone":"accent","value":"billing-core","change":"unchanged"},{"key":"f44","name":"Add-on 44","category":"Legacy","tone":"neutral","value":"identity-svc","change":"removed"},{"key":"f45","name":"Add-on 45","category":"Add-on","tone":"orange","value":"platform-ops","change":"unchanged"},{"key":"f46","name":"Add-on 46","category":"Core","tone":"accent","value":"billing-core","change":"removed"},{"key":"f47","name":"Add-on 47","category":"Legacy","tone":"neutral","value":"identity-svc","change":"unchanged"},{"key":"f48","name":"Add-on 48","category":"Add-on","tone":"orange","value":"platform-ops","change":"unchanged"},{"key":"f49","name":"Add-on 49","category":"Core","tone":"accent","value":"billing-core","change":"removed"},{"key":"f50","name":"Add-on 50","category":"Legacy","tone":"neutral","value":"identity-svc","change":"unchanged"},{"key":"f51","name":"Add-on 51","category":"Add-on","tone":"orange","value":"platform-ops","change":"removed"},{"key":"f52","name":"Add-on 52","category":"Core","tone":"accent","value":"billing-core","change":"unchanged"},{"key":"f53","name":"Add-on 53","category":"Legacy","tone":"neutral","value":"identity-svc","change":"unchanged"},{"key":"f54","name":"Add-on 54","category":"Add-on","tone":"orange","value":"platform-ops","change":"removed"},{"key":"f55","name":"Add-on 55","category":"Core","tone":"accent","value":"billing-core","change":"unchanged"},{"key":"f56","name":"Add-on 56","category":"Legacy","tone":"neutral","value":"identity-svc","change":"removed"},{"key":"f57","name":"Add-on 57","category":"Add-on","tone":"orange","value":"platform-ops","change":"unchanged"},{"key":"f58","name":"Add-on 58","category":"Core","tone":"accent","value":"billing-core","change":"unchanged"},{"key":"f59","name":"Add-on 59","category":"Legacy","tone":"neutral","value":"identity-svc","change":"removed"},{"key":"f60","name":"Add-on 60","category":"Add-on","tone":"orange","value":"platform-ops","change":"added"}]}},{"name":"One row","props":{"rows":[{"key":"audit","name":"Audit log export","category":"Core","tone":"accent","value":"billing-core","change":"removed"}]}},{"name":"Zero rows","props":{"rows":[]}}],"anatomy":[{"part":"root","element":"div","description":"max-width 380; data-enter once painted (an added row reveals only after that)"},{"part":"card","element":"div"},{"part":"bar","element":"div","description":"title + hint"},{"part":"title","element":"span"},{"part":"hint","element":"span","optional":true,"description":"Gone once applied, and when no row changes"},{"part":"table","element":"table","description":"Native table, fixed layout"},{"part":"col","element":"col","repeat":true,"description":"One per column (name, category, value); its width is the recipe col variant"},{"part":"th","element":"th","repeat":true,"description":"scope=col"},{"part":"row","element":"tr","repeat":true,"description":"data-key; its change (removed|added|unchanged), included and toggleable state are recipe variants"},{"part":"cell","element":"td","repeat":true,"description":"Its column (name|category|value) is a recipe variant. The category is a status-pill (tone neutral, size sm) whose dot takes the row tone through dotTone (data-dot-tone=accent|orange|green; none for neutral)"},{"part":"reveal","element":"div","optional":true,"description":"Added rows only: the reveal wrapper of each cell (grid 0fr → 1fr on mount)"},{"part":"pad","element":"div","optional":true,"description":"Added rows only: the cell padding, inside the clipping child of reveal"},{"part":"value","element":"span","description":"Value text + include box (a checkbox: size md, tone red for a removal / green for an addition, aria-label on its input, roving tabindex on the inputs; disabled once applied)"},{"part":"value-text","element":"span","description":"Truncates at the end; full value in title"},{"part":"empty","element":"td","optional":true,"description":"No rows: one cell across the columns (in a plain tr) holding the real EmptyState (size block, icon table, labels.empty). With no changed row, Apply is not offered"},{"part":"footer","element":"div"},{"part":"summary","element":"span"},{"part":"applied","element":"span","optional":true,"description":"The real StatusPill (tone green, with a mark), marked data-diff-table=\"applied\", after apply; pops in and takes focus (tabindex=-1)"}],"events":{"toggle":"(key, included)","apply":"(included: Record<string, boolean>)"},"states":["removed","added","included","excluded","accepted","row-hover","row-press","focus-visible","disabled"],"tokens":["color.surface","color.ink","color.ink-2","color.ink-3","color.line","color.accent","color.green","color.green-tint","color.red","color.red-tint","color.orange","shadow.card","radius.card","text.2xs","text.xs","text.sm","easing.out-strong","duration.base","duration.reveal"],"a11y":{"role":"table; checkbox per changed row","keyboard":["Tab reaches the include boxes once (roving tabindex), then the Apply button","Enter / Space toggle the focused row's edit","ArrowDown / ArrowUp move to the next / previous changed row; Home / End to the first / last","Enter / Space on Apply applies; focus moves to the applied pill"],"notes":["The table keeps native semantics (table, th scope=col, tr, td). Each changed row holds a checkbox (the native input inside the checkbox component), named \"Remove <name>\" or \"Add <name>\", so a screen reader reads the row as a table row and the box as a checkbox.","The focus ring is the checkbox's own, on the include box, while it has keyboard focus.","After Apply the boxes stay readable but are disabled and leave the tab order."]},"motion":["row tint, text colour and the category pill: colour / opacity over duration.base from the pointer; instant from the keyboard (kbd-instant), like the include box","row hover (toggleable rows, fine pointers): a 4% ink layer, instant both ways; the press darkens the fill beneath to 7% over duration.base","include box: the checkbox's own recipe (fill leads, the check is drawn, shorter exit)","added row: reveal recipe (grid-template-rows over duration.reveal, opacity over duration.base, through @starting-style) only for a row added after the table's first paint (data-enter on the root, lib/paint.ts); the rows it mounts with are simply there; no timers","applied pill: the status-pill's pop-in (mark) over duration.popup, once","Apply button: the button's own press"]}