import{R as e,r as m}from"./index-bIIEL2MP.js";import{S as u,p as y}from"./nord-DxLM28z-.js";import{s as h}from"./scss-DJ1h0WN5.js";import{U as f}from"./index-Z-6k0Xrj.js";const b="_title_p4fs8_1",g="_table_p4fs8_20",C="_importsnippet_p4fs8_125",i={title:b,table:g,importsnippet:C};u.registerLanguage("scss",h);const d=t=>t.replace(/\/_/,"/").replace(/\.scss$/,""),N=t=>{const[a,l]=m.useState(!1);let c;m.useEffect(()=>{c&&clearTimeout(c),c=setTimeout(()=>{l(!1)},1500)},[a]);const s=async({partial:n})=>{const r=`@use "@reuters-graphics/graphics-components/scss/colours/${d(n)}";`;await navigator.clipboard.writeText(r),l(!0)};return e.createElement("button",{className:"copy-btn",onClick:()=>s(t)},e.createElement("span",{className:"material-symbols-outlined"},"content_copy"),a&&e.createElement("span",{className:"copy-tag"},"Copied"))},_=({included:t=!1,partial:a="thematic/_tr.scss"})=>t?e.createElement("div",{className:i.importsnippet},e.createElement("p",null,"Included")):e.createElement("div",{className:i.importsnippet},e.createElement(u,{language:"scss",style:y},`// global.scss @use "@reuters-graphics/graphics-components/scss/colours/${d(a)}";`),e.createElement(N,{partial:a})),p=t=>{const a=async l=>{const c=l.wrap?`var(${l.children})`:l.children;await navigator.clipboard.writeText(c),l.setCopied(!0)};return e.createElement("button",{className:"copy-btn",onClick:()=>a(t)},e.createElement("span",{className:"material-symbols-outlined"},"content_copy"),t.children,t.copied&&e.createElement("div",{className:"copy-tag"},"Copied"))},T=t=>{const[a,l]=m.useState(!1);let c;m.useEffect(()=>{c&&clearTimeout(c),c=setTimeout(()=>{l(!1)},1e3)},[a]);const s={...t,copied:a,setCopied:l};return t.column===0?e.createElement("div",{className:"swatch-container"},e.createElement("div",{className:"swatch",style:{backgroundColor:t.children}}),e.createElement("span",null,e.createElement(p,{...s},t.children))):t.children.map(n=>e.createElement("div",{key:n},e.createElement(p,{...s,wrap:!0},n)))},v=t=>e.createElement("td",null,e.createElement(T,{...t},t.children)),k=t=>e.createElement("tr",null,t.children.map((a,l)=>e.createElement(v,{...t,column:l,key:l},a))),w=t=>e.createElement("th",null,t.children),H=({title:t=null,body:a,copyable:l,mdnLink:c=null,included:s=!1,partial:n})=>{const r=["Colour","CSS variable"];return e.createElement(f,null,e.createElement("div",{className:i.title},t),e.createElement(_,{included:s,partial:n}),e.createElement("table",{className:i.table},e.createElement("thead",null,e.createElement("tr",null,r.map(o=>e.createElement(w,{key:o},o)))),e.createElement("tbody",null,a.map((o,E)=>e.createElement(k,{title:t,header:r,body:a,copyable:l,mdnLink:c,key:E},o)))))};export{H as C};