{"name":"insight-cards","title":"Insight Cards","description":"","kind":"block","category":"data","status":"beta","props":{"insights":{"type":"array","items":{"id":"string","title":"string","summary":"string | Array<string | { entity: string, color?: string } | { value: string, tone?: 'neutral'|'green'|'orange'|'red'|'accent' }>","chart":"{ kind: 'line'|'bar'|'share', series: { name, values: number[], tone?: 'accent'|'orange'|'red'|'green'|'neutral' }[], format?: 'number'|'percent'|'money', threshold?: number, label?: string }?","action":"string?"},"description":"The insights, in order. Owned by the parent: pass a new array to change them."},"page":{"type":"number","model":true,"default":0,"description":"Index of the insight shown. Clamped to the list."},"title":{"type":"string","default":"Insights"},"emptyText":{"type":"string","default":"No insights yet."},"tone":{"type":"enum","values":["accent","orange","red","green","neutral"],"default":"accent","part":"swatch","description":"Per series (chart.series[].tone): colour of its swatch and of its line, bars or segment."}},"playground":{"name":"Playground","props":{"insights":[{"id":"mix","title":"Revenue by plan","summary":[{"entity":"Enterprise"}," brings in ",{"value":"54.2%","tone":"orange"}," of revenue from only 11 accounts."],"chart":{"kind":"share","series":[{"name":"Enterprise","tone":"orange","values":[54.2]},{"name":"Team","tone":"accent","values":[32.1]},{"name":"Starter","tone":"neutral","values":[13.7]}]},"action":"What if Orbit Studio does not renew?"},{"id":"growth","title":"Plan growth","summary":[{"entity":"Team plan"}," MRR grew ",{"value":"+11.1%","tone":"green"}," in eight weeks to ",{"value":"$112,400"},", while Starter stayed flat."],"chart":{"kind":"line","format":"percent","series":[{"name":"Team","tone":"accent","values":[0,1.7,2.9,4.5,5.6,7,8.8,11.1]},{"name":"Starter","tone":"neutral","values":[0,0.7,0.2,1.2,0.5,1,0.2,0.7]}]},"action":"Which accounts drove the growth?"},{"id":"refunds","title":"Refund spike","summary":["Refunds on ",{"value":"Nov 12"}," reached ",{"value":"$4,180","tone":"red"},", about six times the daily average."],"chart":{"kind":"bar","format":"money","threshold":1500,"series":[{"name":"Refunds","tone":"red","values":[620,910,740,880,1020,4180,960]}]},"action":"Show the refunds from Nov 12"}]},"width":344},"exampleFiles":[{"file":"default","title":"Weekly revenue insights"},{"file":"churn-risk","title":"Account at risk before renewal"},{"file":"empty","title":"First week, nothing to report yet"}],"worstCase":[{"name":"Long names","width":320,"props":{"insights":[{"id":"long","title":"Return comparison across every Aleksandra Wiśniewska-Kowalczyk Logistics Holdings location","summary":["The worst performer in ",{"entity":"Aleksandra Wiśniewska-Kowalczyk Logistics Holdings International"}," is Customer-managed encryption keys for regulated workloads, down ",{"value":"−1,284,000 units (−41.25%)","tone":"red"},"."],"chart":{"kind":"line","format":"percent","series":[{"name":"Customer-managed encryption keys with per-region rotation and audit trails","tone":"orange","values":[-2.9,-3.4,-4.41]},{"name":"Asia Pacific (Sydney, Singapore, Tokyo)","tone":"accent","values":[0.22,0.58,1.15]}]},"action":"Should I rebalance every plan in every region before the new fiscal year starts next month?"}]}},{"name":"One insight, one value","width":344,"props":{"insights":[{"id":"one","title":"S","summary":"J","chart":{"kind":"line","series":[{"name":"A","values":[1]}]}}]}},{"name":"Zero insights","width":344,"props":{"insights":[]}},{"name":"Huge values","width":344,"props":{"insights":[{"id":"huge","title":"Annual revenue","summary":["Revenue reached ",{"value":"$12,480,000,000","tone":"green"}," across ",{"value":"12,480","tone":"neutral"}," stores."],"chart":{"kind":"bar","format":"money","threshold":9000000000,"series":[{"name":"Revenue","tone":"green","values":[1200000000,3400000000,8100000000,12480000000]}]},"action":"Break it down by region"},{"id":"share","title":"Twelve segments","summary":"Share across twelve segments.","chart":{"kind":"share","series":[{"name":"Segment 1","tone":"orange","values":[9000]},{"name":"Segment 2","tone":"accent","values":[1]},{"name":"Segment 3","tone":"green","values":[1]},{"name":"Segment 4","tone":"red","values":[1]},{"name":"Segment 5","tone":"neutral","values":[0]},{"name":"Segment 6","tone":"orange","values":[12480]}]}}]}},{"name":"Right-to-left","width":344,"props":{"title":"رؤى","insights":[{"id":"rtl","title":"مقارنة العائد","summary":["أسوأ نكهة في ",{"entity":"مثلجات الواحة","color":"#3b82f6"}," هي الفستق، بانخفاض ",{"value":"٦٪","tone":"red"},"."],"chart":{"kind":"line","format":"percent","series":[{"name":"الفستق","tone":"orange","values":[-2.9,-3.4,-3.05,-4.41]},{"name":"الفانيليا","tone":"accent","values":[0.22,0.58,0.42,1.15]}]},"action":"هل يجب أن أعيد التوازن؟"},{"id":"rtl-2","title":"حصة الفانيليا","summary":"الفانيليا ٧٢٫٥٪ من المخزون.","chart":{"kind":"share","series":[{"name":"الفانيليا","tone":"orange","values":[72.5]},{"name":"الشوكولاتة","tone":"neutral","values":[27.5]}]}}]}}],"anatomy":[{"part":"root","element":"section","description":"aria-roledescription=carousel, labelled by the title"},{"part":"header","element":"div","description":"Title (with a plain Count) and the pager: a Pager with loop, layout start, label 'Choose insight', buttons 'Previous insight' / 'Next insight'; its position is the role=status '2 of 3'. With no insights an empty-state row (centred) replaces the pages."},{"part":"title","element":"span","description":"The title and a plain Count of the insights"},{"part":"pages","element":"div","description":"One grid cell all pages share"},{"part":"page","element":"article","repeat":true,"description":"role=group, aria-roledescription=slide; data-state=active|inactive (inactive pages are visibility: hidden, so they keep their size but leave the tab order and the accessibility tree)"},{"part":"summary","element":"p","description":"The insight as a sentence: text, EntityChip and ValuePill"},{"part":"card","element":"div"},{"part":"card-title","element":"span"},{"part":"legend","element":"ul"},{"part":"legend-item","element":"li","repeat":true},{"part":"swatch","element":"span","description":"Series colour; data-tone"},{"part":"legend-name","element":"span","description":"Swatch + label; title carries the full name"},{"part":"legend-label","element":"span","description":"Series name; truncates at the end"},{"part":"legend-value","element":"span","description":"Latest value (line, bar) or share; tabular, never truncated"},{"part":"chart","element":"svg","description":"role=img with a generated aria-label; data-kind=line|bar|share. Shapes come from chartShapes()"},{"part":"line","element":"path","optional":true,"repeat":true},{"part":"bar","element":"rect","optional":true,"repeat":true},{"part":"segment","element":"rect","optional":true,"repeat":true},{"part":"rule","element":"line","optional":true,"repeat":true,"description":"data-kind=zero|threshold"},{"part":"action","element":"button","optional":true,"description":"Follow-up prompt; an outline sm Button"}],"events":{"pageChange":"(page: number)","action":"(id: string) the follow-up button of an insight was pressed"},"states":["hover","press","focus-visible","disabled"],"tokens":["color.surface","color.ink","color.ink-2","color.ink-3","color.line","color.line-strong","color.accent","color.orange","color.red","color.green","shadow.hairline","radius.card","text.xs","text.sm","radius.pill"],"a11y":{"role":"region (carousel) with a pager group and a status","keyboard":["Tab reaches the previous and next buttons, then the follow-up button of the shown insight","Enter / Space on previous or next change the page; focus stays on the button","ArrowLeft / ArrowRight while focus is in the pager change the page (mirrored right-to-left); Home / End jump to the first and last","Paging wraps around; with one insight or none the buttons are aria-disabled (they keep focus)"],"notes":["The position ('2 of 3') sits in a role=status region, so a page change is announced.","Every chart is role=img with a text alternative generated from its data (or chart.label).","Inactive pages are visibility: hidden: out of the tab order and the accessibility tree."]},"motion":["page change: instant. No crossfade (not even a short blur): the pager is used many times in a row and from the keyboard, and the content is data","chart: never animates, on mount or on page change","pager buttons and follow-up button: the shared Button press and gated hover"]}