@orellabs/ui 0.1.2
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.
- package/README.md +43 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +507 -0
- package/dist/index.js +1882 -0
- package/dist/index.js.map +1 -0
- package/package.json +57 -0
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# @orellabs/ui
|
|
2
|
+
|
|
3
|
+
The shared component library for all OrelLabs products.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# If in the same workspace
|
|
9
|
+
pnpm add @orellabs/ui
|
|
10
|
+
|
|
11
|
+
# Or via npm link for development
|
|
12
|
+
cd ~/Desktop/Shopify\ Apps/OrelLabs-UI && npm link
|
|
13
|
+
cd ~/Desktop/Shopify\ Apps/AEO && npm link @orellabs/ui
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
import { Button, Card, Badge, StatGrid } from "@orellabs/ui";
|
|
20
|
+
|
|
21
|
+
function Dashboard() {
|
|
22
|
+
return (
|
|
23
|
+
<Card>
|
|
24
|
+
<Button variant="primary" size="md" onClick={handleClick}>
|
|
25
|
+
Run Analysis
|
|
26
|
+
</Button>
|
|
27
|
+
</Card>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## See All Components
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm run storybook
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Guiding Principles
|
|
39
|
+
|
|
40
|
+
1. **Tokens over values.** No component contains a raw color, spacing value, or font size. Everything references a token.
|
|
41
|
+
2. **Composable over monolithic.** Small, focused components composed together beat large, opinionated mega-components.
|
|
42
|
+
3. **Typed by default.** Every component prop is typed. No `any`. TypeScript is the documentation.
|
|
43
|
+
4. **No opinions about data.** The library renders what it's given. Business logic lives in apps, never here.
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react"),t=require("react/jsx-runtime"),e={black:"#1A1A1A",blackHover:"#2A2A2A",red:"#D42B2B",white:"#FFFFFF",pageBg:"#F1F1F1",cardBg:"#FFFFFF",bgSubtle:"#FAFAFA",textPrimary:"#1A1A1A",textSecondary:"#6B7280",textTertiary:"#9CA3AF",textDark:"#374151",textDisabled:"#D1D5DB",textInverse:"#FFFFFF",border:"#E5E5E5",borderLight:"#D1D5DB",borderSubtle:"#F3F4F6",borderFocus:"#1A1A1A",success:"#22C55E",successBg:"#F0FDF4",successBorder:"#BBF7D0",warning:"#F59E0B",warningBg:"#FFFBEB",warningBorder:"#FDE68A",error:"#EF4444",errorHover:"#DC2626",errorBg:"#FEF2F2",errorBorder:"#FECACA",info:"#2563EB",infoBg:"#EFF6FF",infoBorder:"#BFDBFE",neutralBg:"#F3F4F6",neutralText:"#6B7280",skeletonBase:"#E5E5E5",skeletonPulse:"#F1F2F4"},a={0:"0px",1:"4px",2:"8px",3:"12px",4:"16px",5:"20px",6:"24px",8:"32px",10:"40px",12:"48px",16:"64px",20:"80px"},n={fontFamily:{base:"-apple-system, 'Helvetica Neue', sans-serif",mono:"'Menlo', 'Monaco', 'Courier New', monospace"},size:{xs:"10px",sm:"11px",base:"13px",md:"14px",lg:"16px",xl:"20px","2xl":"24px","3xl":"32px"},weight:{normal:400,medium:500,semibold:600,bold:700,extrabold:800},lineHeight:{tight:1.2,snug:1.4,normal:1.5,relaxed:1.55,loose:1.75},letterSpacing:{tight:"-0.02em",snug:"-0.01em",normal:"0em",wide:"0.02em"}},h={none:"0px",xs:"4px",sm:"6px",md:"8px",lg:"10px",xl:"12px","2xl":"16px",full:"9999px"},F={none:"none",sm:"0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04)",md:"0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04)",lg:"0 20px 60px rgba(0,0,0,0.18)",focus:"0 0 0 3px rgba(26, 26, 26, 0.12)"},O={sm:{padding:`${a[1]} ${a[3]}`,fontSize:n.size.base,height:"32px",gap:a[1]},md:{padding:`${a[2]} ${a[4]}`,fontSize:n.size.md,height:"40px",gap:a[2]},lg:{padding:`${a[3]} ${a[6]}`,fontSize:n.size.md,height:"48px",gap:a[2]}},G={primary:{background:e.black,color:e.textInverse,border:"none",hoverBg:e.blackHover},ghost:{background:"transparent",color:e.textPrimary,border:`1px solid ${e.border}`,hoverBg:e.bgSubtle},danger:{background:e.error,color:e.textInverse,border:"none",hoverBg:e.errorHover},text:{background:"transparent",color:e.textSecondary,border:"none",hoverBg:e.bgSubtle}};function $({variant:o,size:i,loading:r=!1,disabled:s=!1,fullWidth:l=!1,leftIcon:c,children:g,onClick:x}){const u=O[i],d=G[o],f=s||r,p={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:u.gap,padding:u.padding,fontSize:u.fontSize,height:u.height,fontFamily:n.fontFamily.base,fontWeight:n.weight.semibold,lineHeight:n.lineHeight.tight,letterSpacing:n.letterSpacing.snug,borderRadius:h.md,background:d.background,color:d.color,border:d.border,cursor:f?"not-allowed":"pointer",opacity:f?.5:1,transition:"background 150ms ease, opacity 150ms ease, box-shadow 150ms ease",width:l?"100%":void 0,boxSizing:"border-box",outline:"none"};return t.jsxs("button",{style:p,onClick:x,disabled:f,onMouseEnter:y=>{f||(y.currentTarget.style.background=d.hoverBg)},onMouseLeave:y=>{f||(y.currentTarget.style.background=d.background)},onFocus:y=>{y.currentTarget.style.boxShadow=F.focus},onBlur:y=>{y.currentTarget.style.boxShadow="none"},children:[r?t.jsx(X,{}):c,g]})}let M=!1;function N(){if(M||typeof document>"u")return;const o=document.createElement("style");o.textContent="@keyframes ol-spin { to { transform: rotate(360deg) } }",document.head.appendChild(o),M=!0}function X(){return N(),t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",style:{animation:"ol-spin 0.6s linear infinite"},children:t.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"28",strokeDashoffset:"20",opacity:"0.8"})})}const q={none:"0px",sm:a[3],md:a[6],lg:a[8]};function K({padding:o="md",noBorder:i=!1,shadow:r=!1,children:s}){const l={background:e.cardBg,borderRadius:h.xl,padding:q[o],border:i?"none":`1px solid ${e.border}`,boxShadow:r?F.sm:F.none,boxSizing:"border-box"};return t.jsx("div",{style:l,children:s})}const Y={success:{bg:e.successBg,color:e.success,dot:e.success},warning:{bg:e.warningBg,color:e.warning,dot:e.warning},error:{bg:e.errorBg,color:e.error,dot:e.error},info:{bg:e.infoBg,color:e.info,dot:e.info},neutral:{bg:e.neutralBg,color:e.neutralText,dot:e.textTertiary}},D=m.memo(function({tone:i,dot:r=!1,children:s}){const l=Y[i],c={display:"inline-flex",alignItems:"center",gap:a[1],padding:`2px ${a[2]}`,fontSize:n.size.xs,fontWeight:n.weight.semibold,fontFamily:n.fontFamily.base,lineHeight:n.lineHeight.tight,borderRadius:h.xs,background:l.bg,color:l.color,whiteSpace:"nowrap"},g={width:"5px",height:"5px",borderRadius:h.full,background:l.dot,flexShrink:0};return t.jsxs("span",{style:c,children:[r&&t.jsx("span",{style:g}),s]})});function J({stats:o,cols:i=4}){const r={display:"flex",border:`1px solid ${e.border}`,borderRadius:h.lg,overflow:"hidden"};return t.jsx("div",{style:r,children:o.map((s,l)=>t.jsx(_,{stat:s,isLast:l===o.length-1},l))})}function _({stat:o,isLast:i}){const r=o.highlight,s={flex:1,padding:`${a[3]} ${a[4]}`,textAlign:"center",borderRight:i?void 0:`1px solid ${e.border}`,background:r?e.black:"transparent"},l={fontSize:n.size.xl,fontWeight:n.weight.bold,fontFamily:n.fontFamily.base,lineHeight:n.lineHeight.tight,color:o.color||(r?e.textInverse:e.textPrimary),display:"flex",alignItems:"baseline",justifyContent:"center",gap:a[1],margin:0},c={fontSize:n.size.sm,fontWeight:n.weight.medium,color:e.textTertiary},g={fontSize:n.size.sm,fontFamily:n.fontFamily.base,color:e.textTertiary,marginTop:"2px"},x={fontSize:n.size.xs,color:e.textTertiary,fontFamily:n.fontFamily.base,marginTop:"4px"};return t.jsxs("div",{style:s,children:[t.jsxs("p",{style:l,children:[o.value,o.unit&&t.jsx("span",{style:c,children:o.unit})]}),t.jsx("div",{style:g,children:o.label}),o.sub&&t.jsx("div",{style:x,children:o.sub})]})}const Q=m.memo(function({children:i,action:r}){const s={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:a[2]},l={fontSize:n.size.sm,fontWeight:n.weight.medium,fontFamily:n.fontFamily.base,color:e.textSecondary,margin:0};return t.jsxs("div",{style:s,children:[t.jsx("p",{style:l,children:i}),r&&t.jsx("div",{children:r})]})});function Z({tabs:o,active:i,onChange:r,size:s="md"}){const l={display:"inline-flex",alignItems:"center",gap:a[1],fontFamily:n.fontFamily.base},c=s==="sm"?n.size.base:n.size.md,g=s==="sm"?a[1]:a[2],x=s==="sm"?a[3]:a[4];return t.jsx("div",{style:l,role:"tablist",children:o.map(u=>{const d=u.id===i,f={padding:`${g} ${x}`,fontSize:c,fontWeight:d?n.weight.semibold:n.weight.normal,fontFamily:n.fontFamily.base,color:d?e.textInverse:e.textSecondary,background:d?e.black:"transparent",border:"none",borderRadius:h.full,cursor:"pointer",display:"flex",alignItems:"center",gap:a[2],transition:"background 150ms ease, color 150ms ease",whiteSpace:"nowrap"},p={fontSize:n.size.xs,fontWeight:n.weight.semibold,background:d?"rgba(255,255,255,0.2)":e.neutralBg,color:d?e.textInverse:e.textSecondary,borderRadius:h.full,padding:`0 ${a[2]}`,minWidth:"20px",textAlign:"center",lineHeight:"20px"};return t.jsxs("button",{style:f,role:"tab","aria-selected":d,onClick:()=>!d&&r(u.id),onMouseEnter:y=>{d||(y.currentTarget.style.background=e.neutralBg,y.currentTarget.style.color=e.textPrimary)},onMouseLeave:y=>{d||(y.currentTarget.style.background="transparent",y.currentTarget.style.color=e.textSecondary)},children:[u.label,u.badge!==void 0&&t.jsx("span",{style:p,children:u.badge})]},u.id)})})}function ee({columns:o,rows:i,loading:r=!1,emptyState:s,onRowClick:l}){const c={width:"100%",borderCollapse:"collapse",fontFamily:n.fontFamily.base,fontSize:n.size.base},g=d=>({textAlign:d.align||"left",padding:`${a[3]} ${a[4]}`,fontSize:n.size.sm,fontWeight:n.weight.medium,color:e.textTertiary,borderBottom:`1px solid ${e.border}`,width:d.width,whiteSpace:"nowrap"}),x=d=>({textAlign:d.align||"left",padding:`${a[3]} ${a[4]}`,fontSize:n.size.base,color:e.textPrimary,borderBottom:`1px solid ${e.borderSubtle}`,verticalAlign:"middle",lineHeight:n.lineHeight.snug}),u={cursor:l?"pointer":"default",transition:"background 100ms ease"};return r?t.jsx("div",{style:{padding:a[8],textAlign:"center"},children:t.jsx("p",{style:{color:e.textTertiary,fontSize:n.size.base},children:"Loading..."})}):i.length===0?s?t.jsx(t.Fragment,{children:s}):t.jsx("div",{style:{padding:a[8],textAlign:"center"},children:t.jsx("p",{style:{color:e.textTertiary,fontSize:n.size.base},children:"No data"})}):t.jsx("div",{style:{overflowX:"auto",borderRadius:h.md},children:t.jsxs("table",{style:c,children:[t.jsx("thead",{children:t.jsx("tr",{children:o.map(d=>t.jsx("th",{style:g(d),children:d.header},String(d.key)))})}),t.jsx("tbody",{children:i.map((d,f)=>t.jsx("tr",{style:u,onClick:()=>l==null?void 0:l(d),onMouseEnter:p=>{p.currentTarget.style.background=e.bgSubtle},onMouseLeave:p=>{p.currentTarget.style.background="transparent"},children:o.map(p=>t.jsx("td",{style:x(p),children:p.render?p.render(d):String(d[p.key]??"")},String(p.key)))},f))})]})})}function te({label:o,hint:i,error:r,prefix:s,suffix:l,type:c="text",placeholder:g,disabled:x=!1,value:u,onChange:d}){const f=!!r,p={display:"flex",flexDirection:"column",gap:a[1],fontFamily:n.fontFamily.base},y={fontSize:n.size.base,fontWeight:n.weight.medium,color:e.textPrimary,margin:0},w={display:"flex",alignItems:"center",gap:a[2],padding:`${a[2]} ${a[3]}`,background:x?e.bgSubtle:e.cardBg,border:`1px solid ${f?e.error:e.border}`,borderRadius:h.md,transition:"border-color 150ms ease, box-shadow 150ms ease",cursor:x?"not-allowed":"text"},b={flex:1,border:"none",outline:"none",background:"transparent",fontSize:n.size.md,fontFamily:n.fontFamily.base,color:x?e.textDisabled:e.textPrimary,cursor:x?"not-allowed":"text",padding:0,width:"100%"},S={fontSize:n.size.sm,color:f?e.error:e.textTertiary,margin:0},v={fontSize:n.size.base,color:e.textTertiary,flexShrink:0};return t.jsxs("div",{style:p,children:[o&&t.jsx("p",{style:y,children:o}),t.jsxs("div",{style:w,onFocusCapture:k=>{const z=k.currentTarget;z.style.borderColor=f?e.error:e.borderFocus,z.style.boxShadow=F.focus},onBlurCapture:k=>{const z=k.currentTarget;z.style.borderColor=f?e.error:e.border,z.style.boxShadow="none"},children:[s&&t.jsx("span",{style:v,children:s}),t.jsx("input",{type:c,value:u,onChange:k=>d(k.target.value),placeholder:g,disabled:x,"aria-invalid":f,style:b}),l&&t.jsx("span",{style:v,children:l})]}),(r||i)&&t.jsx("p",{style:S,children:r||i})]})}function ne(o){return o>=75?e.success:o>=50?e.warning:e.error}function oe(o){return o>=75?e.successBg:o>=50?e.warningBg:e.errorBg}const re=m.memo(function({score:i,max:r=100,width:s="100%",showLabel:l=!0,size:c="md"}){const g=Math.min(Math.max(i/r*100,0),100),x=ne(g),u=oe(g),d=c==="sm"?"6px":"8px",f={display:"flex",alignItems:"center",gap:a[3],width:s,fontFamily:n.fontFamily.base},p={flex:1,height:d,background:u,borderRadius:h.full,overflow:"hidden"},y={height:"100%",width:`${g}%`,background:x,borderRadius:h.full,transition:"width 400ms ease"},w={fontSize:c==="sm"?n.size.xs:n.size.sm,fontWeight:n.weight.semibold,color:x,minWidth:"36px",textAlign:"right"};return t.jsxs("div",{style:f,children:[t.jsx("div",{style:p,children:t.jsx("div",{style:y})}),l&&t.jsxs("span",{style:w,children:[Math.round(g),"%"]})]})}),T='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function ie({open:o,onClose:i,children:r,maxWidth:s=400,title:l}){const[c,g]=m.useState(!1),x=m.useRef(null),u=m.useId();if(m.useEffect(()=>{if(!o){g(!1);return}const f=requestAnimationFrame(()=>g(!0));return()=>cancelAnimationFrame(f)},[o]),m.useEffect(()=>{if(!o)return;const f=p=>{p.key==="Escape"&&i()};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[o,i]),m.useEffect(()=>{if(!o||!x.current)return;const f=x.current,p=document.activeElement,y=f.querySelector(T);y?y.focus():f.focus();const w=b=>{if(b.key!=="Tab")return;const S=f.querySelectorAll(T);if(S.length===0)return;const v=S[0],k=S[S.length-1];b.shiftKey?document.activeElement===v&&(b.preventDefault(),k.focus()):document.activeElement===k&&(b.preventDefault(),v.focus())};return document.addEventListener("keydown",w),()=>{document.removeEventListener("keydown",w),p==null||p.focus()}},[o]),!o)return null;const d=t.jsx("button",{onClick:i,onMouseEnter:f=>{f.currentTarget.style.background=e.pageBg},onMouseLeave:f=>{f.currentTarget.style.background="transparent"},style:{width:"28px",height:"28px",borderRadius:h.sm,border:"none",background:"transparent",color:e.textTertiary,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},"aria-label":"Close",children:t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:t.jsx("path",{d:"M1 1l10 10M11 1L1 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})});return t.jsx("div",{role:"presentation",onClick:i,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.32)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:100,padding:a[4]},children:t.jsx("div",{ref:x,role:"dialog","aria-modal":"true","aria-labelledby":l?u:void 0,tabIndex:-1,onClick:f=>f.stopPropagation(),onKeyDown:f=>f.stopPropagation(),style:{background:e.cardBg,borderRadius:h["2xl"],width:"100%",maxWidth:s,boxShadow:F.lg,opacity:c?1:0,transform:c?"none":"translateY(10px) scale(0.97)",transition:"opacity 0.18s ease, transform 0.18s ease",outline:"none",...l?{display:"flex",flexDirection:"column",maxHeight:"calc(100vh - 32px)",overflow:"hidden"}:{padding:"28px 24px 24px",position:"relative"}},children:l?t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:`${a[4]} ${a[5]}`,borderBottom:`1px solid ${e.border}`,flexShrink:0},children:[t.jsx("span",{id:u,style:{fontWeight:n.weight.bold,fontSize:n.size.base,fontFamily:n.fontFamily.base,color:e.textPrimary},children:l}),d]}),t.jsx("div",{style:{overflowY:"auto",flex:1},children:r})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{position:"absolute",top:"14px",right:"14px"},children:d}),r]})})})}function se({options:o,value:i,onChange:r,fullWidth:s=!1}){const l={display:"inline-flex",border:`1px solid ${e.border}`,borderRadius:h.md,overflow:"hidden",fontFamily:n.fontFamily.base,width:s?"100%":void 0};return t.jsx("div",{style:l,role:"radiogroup",children:o.map((c,g)=>{const x=c.value===i,u={flex:s?1:void 0,padding:`${a[2]} ${a[4]}`,fontSize:n.size.md,fontWeight:x?n.weight.semibold:n.weight.normal,fontFamily:n.fontFamily.base,color:x?e.textInverse:e.textPrimary,background:x?e.black:e.cardBg,border:"none",borderRight:g<o.length-1?`1px solid ${e.border}`:"none",cursor:"pointer",transition:"background 150ms ease, color 150ms ease",textAlign:"center",whiteSpace:"nowrap"};return t.jsx("button",{style:u,role:"radio","aria-checked":x,onClick:()=>r(c.value),onMouseEnter:d=>{x||(d.currentTarget.style.background=e.bgSubtle)},onMouseLeave:d=>{x||(d.currentTarget.style.background=e.cardBg)},children:c.label},c.value)})})}function j(o,i="0 0 24 24"){return function({size:s=20,filled:l,className:c,style:g,...x}){return t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:i,fill:l?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:c,style:{flexShrink:0,...g},...x,children:typeof o=="string"?t.jsx("path",{d:o}):o})}}const A=j(t.jsxs(t.Fragment,{children:[t.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),t.jsx("path",{d:"M7 11V7a5 5 0 0110 0v4"})]})),le=j(t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"11",cy:"11",r:"8"}),t.jsx("path",{d:"M21 21l-4.35-4.35"})]})),R=j("M20 6L9 17l-5-5"),E=j("M18 6L6 18M6 6l12 12"),ae=j("M3 12h18M3 6h18M3 18h18"),C=j(t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"12",cy:"12",r:"10"}),t.jsx("path",{d:"M12 16v-4M12 8h.01"})]})),W=j(t.jsxs(t.Fragment,{children:[t.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"}),t.jsx("path",{d:"M12 9v4M12 17h.01"})]})),ce=j("M5 3l14 9-14 9V3z"),de=j("M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"),ge=j(t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"12",cy:"12",r:"3"}),t.jsx("path",{d:"M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-2 2 2 2 0 01-2-2v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83 0 2 2 0 010-2.83l.06-.06a1.65 1.65 0 00.33-1.82 1.65 1.65 0 00-1.51-1H3a2 2 0 01-2-2 2 2 0 012-2h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 010-2.83 2 2 0 012.83 0l.06.06a1.65 1.65 0 001.82.33H9a1.65 1.65 0 001-1.51V3a2 2 0 012-2 2 2 0 012 2v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 0 2 2 0 010 2.83l-.06.06a1.65 1.65 0 00-.33 1.82V9a1.65 1.65 0 001.51 1H21a2 2 0 012 2 2 2 0 01-2 2h-.09a1.65 1.65 0 00-1.51 1z"})]})),xe=j("M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M17 8l-5-5-5 5M12 3v12"),ue=j("M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M7 10l5 5 5-5M12 15V3"),fe=j("M5 12h14M12 5l7 7-7 7"),pe=j("M19 12H5M12 19l-7-7 7-7"),he=j("M12 19V5M5 12l7-7 7 7"),ye=j("M12 5v14M19 12l-7 7-7-7"),me=j("M9 18l6-6-6-6"),be=j("M15 18l-6-6 6-6"),Se=j("M18 15l-6-6-6 6"),we=j("M6 9l6 6 6-6");function je({checked:o,onChange:i,label:r,sublabel:s,disabled:l=!1,locked:c=!1,badge:g,right:x}){const u=!l&&!c,d={display:"flex",alignItems:"center",gap:a[3],padding:`${a[3]} ${a[4]}`,background:o?e.black:e.cardBg,border:`1px solid ${o?e.black:e.border}`,borderRadius:h.lg,cursor:u?"pointer":"default",opacity:l?.5:1,transition:"background 150ms ease, border-color 150ms ease",fontFamily:n.fontFamily.base},f={width:"8px",height:"8px",borderRadius:h.full,background:o?e.error:e.textTertiary,flexShrink:0},p={flex:1,display:"flex",flexDirection:"column",gap:"2px"},y={fontSize:n.size.md,fontWeight:n.weight.semibold,color:o?e.textInverse:e.textPrimary,lineHeight:n.lineHeight.tight},w={fontSize:n.size.sm,color:o?e.textTertiary:e.textSecondary,lineHeight:n.lineHeight.tight},b={width:"20px",height:"20px",borderRadius:h.xs,border:o?"none":`1.5px solid ${e.borderLight}`,background:o?e.error:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"background 150ms ease, border-color 150ms ease"};return t.jsxs("div",{style:d,role:"checkbox","aria-checked":o,tabIndex:u?0:-1,onClick:()=>u&&i(!o),onKeyDown:S=>{(S.key===" "||S.key==="Enter")&&(S.preventDefault(),u&&i(!o))},onMouseEnter:S=>{u&&!o&&(S.currentTarget.style.borderColor=e.borderLight)},onMouseLeave:S=>{u&&!o&&(S.currentTarget.style.borderColor=e.border)},children:[t.jsx("span",{style:f}),t.jsxs("div",{style:p,children:[t.jsx("span",{style:y,children:r}),s&&t.jsx("span",{style:w,children:s})]}),g&&t.jsx("div",{children:g}),x&&t.jsx("div",{children:x}),c?t.jsx(A,{size:16,style:{color:e.textTertiary}}):t.jsx("div",{style:b,children:o&&t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:t.jsx("path",{d:"M2.5 6l2.5 2.5 4.5-4.5",stroke:e.textInverse,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}const ve={success:e.success,warning:e.warning,error:e.error,info:e.info,neutral:e.textTertiary};let L=!1;function ke(){if(L||typeof document>"u")return;const o=document.createElement("style");o.textContent="@keyframes ol-pulse { 0%, 100% { opacity: 1 } 50% { opacity: 0.4 } }",document.head.appendChild(o),L=!0}const Fe=m.memo(function({tone:i,size:r="md",pulse:s=!1}){s&&ke();const l=r==="sm"?"6px":"8px",c={width:l,height:l,borderRadius:h.full,backgroundColor:ve[i],display:"inline-block",flexShrink:0,animation:s?"ol-pulse 1.5s ease-in-out infinite":void 0};return t.jsx("span",{style:c})});function ze({title:o,sub:i,action:r}){const s={display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:a[4],marginBottom:a[5],fontFamily:n.fontFamily.base},l={display:"flex",flexDirection:"column",gap:"2px"},c={fontSize:n.size.xl,fontWeight:n.weight.bold,color:e.textPrimary,letterSpacing:n.letterSpacing.tight,lineHeight:n.lineHeight.tight,margin:0},g={fontSize:n.size.base,color:e.textSecondary,margin:0};return t.jsxs("div",{style:s,children:[t.jsxs("div",{style:l,children:[t.jsx("h2",{style:c,children:o}),i&&t.jsx("p",{style:g,children:i})]}),r&&t.jsx("div",{style:{flexShrink:0},children:r})]})}const Ie={error:e.error,warning:e.warning,info:e.info,neutral:e.textTertiary};function Ce({items:o}){const i={display:"flex",flexDirection:"column",gap:a[3],fontFamily:n.fontFamily.base};return t.jsx("div",{style:i,children:o.map((r,s)=>{const l=Ie[r.tone||"neutral"];return t.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:a[3]},children:[t.jsx("span",{style:{width:"8px",height:"8px",borderRadius:"50%",background:l,flexShrink:0,marginTop:"5px"}}),t.jsx("span",{style:{fontSize:n.size.base,color:e.textPrimary,lineHeight:n.lineHeight.relaxed},children:r.text})]},s)})})}const Be={success:{IconComponent:R,bg:e.cardBg,accent:e.success},error:{IconComponent:E,bg:e.cardBg,accent:e.error},warning:{IconComponent:W,bg:e.cardBg,accent:e.warning},info:{IconComponent:C,bg:e.cardBg,accent:e.info},neutral:{IconComponent:C,bg:e.cardBg,accent:e.textTertiary}};function Me({open:o,onClose:i,message:r,tone:s="neutral",duration:l=4e3,action:c}){const[g,x]=m.useState(!1);if(m.useEffect(()=>{if(!o){x(!1);return}const v=requestAnimationFrame(()=>x(!0));return()=>cancelAnimationFrame(v)},[o]),m.useEffect(()=>{if(!o||l<=0)return;const v=setTimeout(i,l);return()=>clearTimeout(v)},[o,l,i]),!o)return null;const u=Be[s],d={position:"fixed",bottom:"20px",left:"50%",transform:g?"translateX(-50%) translateY(0)":"translateX(-50%) translateY(16px)",opacity:g?1:0,transition:"opacity 0.18s ease, transform 0.18s ease",zIndex:200,pointerEvents:"auto"},f={display:"flex",alignItems:"center",gap:a[3],padding:`${a[3]} ${a[4]}`,background:u.bg,borderRadius:h.lg,boxShadow:F.lg,border:`1px solid ${e.border}`,fontFamily:n.fontFamily.base,maxWidth:"480px",minWidth:"280px"},p={width:"22px",height:"22px",borderRadius:h.full,background:u.accent,color:e.textInverse,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",fontWeight:n.weight.bold,flexShrink:0,lineHeight:1},y={flex:1,fontSize:n.size.base,color:e.textPrimary,lineHeight:n.lineHeight.snug},w={fontSize:n.size.base,fontWeight:n.weight.semibold,color:u.accent,background:"none",border:"none",cursor:"pointer",padding:0,whiteSpace:"nowrap",textDecoration:"underline",textUnderlineOffset:"2px",fontFamily:n.fontFamily.base},b={width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",background:"transparent",border:"none",borderRadius:h.xs,cursor:"pointer",color:e.textTertiary,flexShrink:0},S=u.IconComponent;return t.jsx("div",{style:d,children:t.jsxs("div",{style:f,children:[t.jsx("span",{style:p,children:t.jsx(S,{size:14})}),t.jsx("span",{style:y,children:r}),c&&t.jsx("button",{style:w,onClick:c.onClick,children:c.label}),t.jsx("button",{style:b,onClick:i,"aria-label":"Dismiss",onMouseEnter:v=>{v.currentTarget.style.background=e.pageBg},onMouseLeave:v=>{v.currentTarget.style.background="transparent"},children:t.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",children:t.jsx("path",{d:"M1 1l10 10M11 1L1 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]})})}const B=m.memo(function({children:i}){const r={fontFamily:n.fontFamily.mono,fontSize:n.size.sm,backgroundColor:e.bgSubtle,color:e.textDark,padding:`2px ${a[2]}`,borderRadius:h.md,border:`1px solid ${e.border}`,display:"inline-flex",alignItems:"center"};return t.jsx("span",{style:r,children:i})}),I={added:e.success,modified:e.warning,destructive:e.error,safe:e.textTertiary},Te={added:e.successBg,modified:e.warningBg,destructive:e.errorBg,safe:e.bgSubtle};function Le({title:o,handle:i,field:r,csvVal:s,storeVal:l,type:c,note:g}){const x={display:"grid",gridTemplateColumns:"2fr 1fr 1.5fr 1.5fr 1fr",gap:a[4],padding:a[4],backgroundColor:Te[c],borderLeft:`4px solid ${I[c]}`,borderBottom:`1px solid ${e.border}`,fontFamily:n.fontFamily.base,alignItems:"start"},u={fontSize:n.size.md,color:e.textPrimary,margin:0},d={fontSize:n.size.sm,color:e.textSecondary,fontFamily:n.fontFamily.mono,marginTop:a[1],marginBottom:0};return t.jsxs("div",{style:x,children:[t.jsxs("div",{children:[t.jsx("p",{style:{...u,fontWeight:n.weight.bold},children:o}),t.jsx("p",{style:d,children:i})]}),t.jsx("div",{children:t.jsx(B,{children:r})}),t.jsx("div",{children:t.jsx("p",{style:{...u,color:s?e.textPrimary:e.error},children:s||"(blank)"})}),t.jsx("div",{children:t.jsx("p",{style:{...u,color:e.textTertiary},children:l||"—"})}),t.jsxs("div",{children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:a[2]},children:[t.jsx("span",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:I[c]}}),t.jsx("span",{style:{fontSize:n.size.sm,fontWeight:n.weight.semibold,color:I[c]},children:c==="added"?"New":c==="safe"?"Unchanged":c.charAt(0).toUpperCase()+c.slice(1)})]}),g&&t.jsxs("p",{style:{fontSize:n.size.xs,color:I[c],marginTop:a[1],marginBottom:0},children:["⚠ ",g]})]})]})}function H({severity:o,field:i,rowCount:r,message:s,fixable:l,onFix:c}){const[g,x]=m.useState(!1),d={error:{tone:"error",outline:e.error},warning:{tone:"warning",outline:e.warning},info:{tone:"info",outline:e.info}}[o],f={padding:a[4],borderBottom:`1px solid ${e.borderSubtle}`,fontFamily:n.fontFamily.base,display:"flex",flexDirection:"column",gap:a[3],backgroundColor:e.white},p={display:"flex",alignItems:"center",justifyContent:"space-between"},y={display:"flex",alignItems:"center",gap:a[3],flexWrap:"wrap"},w={border:`1px solid ${d.outline}`,color:d.outline,padding:`2px ${a[2]}`,borderRadius:h.full,fontSize:n.size.xs,fontWeight:n.weight.medium,backgroundColor:"transparent"};return t.jsxs("div",{style:f,children:[t.jsxs("div",{style:p,children:[t.jsxs("div",{style:y,children:[t.jsx(D,{tone:d.tone,dot:!0,children:o.charAt(0).toUpperCase()+o.slice(1)}),t.jsx(B,{children:i}),t.jsxs("span",{style:w,children:[r.toLocaleString()," rows affected"]})]}),t.jsx("div",{children:l?t.jsx($,{variant:"primary",size:"sm",onClick:c,children:"Auto-Fix"}):t.jsx("span",{style:{fontSize:n.size.sm,color:e.textTertiary},children:"Manual fix"})})]}),t.jsx("p",{style:{margin:0,fontSize:n.size.md,color:e.textDark},children:s}),t.jsx("div",{children:t.jsx("button",{onClick:()=>x(!g),style:{background:"none",border:"none",padding:0,color:e.textSecondary,fontSize:n.size.sm,cursor:"pointer",textDecoration:"underline",fontFamily:n.fontFamily.base},children:g?"Hide sample rows ▲":"View sample rows ▼"})}),g&&t.jsxs("div",{style:{display:"flex",gap:a[2],marginTop:a[1],flexWrap:"wrap"},children:[[1,2,3].map(b=>t.jsxs("span",{style:{fontSize:n.size.xs,border:`1px solid ${e.border}`,padding:`2px ${a[2]}`,borderRadius:h.full,color:e.textSecondary},children:["row ",b]},b)),r>3&&t.jsxs("span",{style:{fontSize:n.size.xs,color:e.textTertiary,alignSelf:"center"},children:["+ ",r-3," more"]})]})]})}function $e({category:o,issues:i,defaultOpen:r=!0}){const[s,l]=m.useState(r),c=i.some(b=>b.severity==="error"),g=i.some(b=>b.severity==="warning"),x=c?e.error:g?e.warning:e.info,u=i.reduce((b,S)=>b+S.rowCount,0),d={backgroundColor:e.cardBg,borderRadius:h.lg,border:`1px solid ${e.border}`,marginBottom:a[4],overflow:"hidden",fontFamily:n.fontFamily.base},f={padding:a[4],display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",backgroundColor:e.cardBg,borderBottom:s?`1px solid ${e.border}`:"none",userSelect:"none"},p={display:"flex",alignItems:"center",gap:a[3]},y={width:8,height:8,borderRadius:"50%",backgroundColor:x,flexShrink:0},w={backgroundColor:e.bgSubtle,border:`1px solid ${e.border}`,borderRadius:h.full,padding:`2px ${a[3]}`,fontSize:n.size.sm,color:e.textSecondary,fontWeight:n.weight.medium};return t.jsxs("div",{style:d,children:[t.jsxs("div",{style:f,onClick:()=>l(!s),children:[t.jsxs("div",{style:p,children:[t.jsx("span",{style:y}),t.jsx("span",{style:{fontSize:n.size.lg,fontWeight:n.weight.bold,color:e.textPrimary},children:o})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:a[3]},children:[t.jsxs("span",{style:w,children:[u.toLocaleString()," rows"]}),t.jsx("span",{style:{color:e.textTertiary,transform:s?"rotate(180deg)":"none",transition:"transform 200ms ease",fontSize:"12px"},children:"▼"})]})]}),s&&t.jsx("div",{style:{display:"flex",flexDirection:"column"},children:i.map((b,S)=>t.jsx("div",{style:{borderBottom:S===i.length-1?"none":`1px solid ${e.borderSubtle}`},children:t.jsx(H,{...b})},S))})]})}const De=m.memo(function({value:i,label:r,tone:s="neutral"}){const c={success:{border:e.successBorder,color:e.success},error:{border:e.errorBorder,color:e.error},info:{border:e.infoBorder,color:e.info},neutral:{border:e.border,color:e.textPrimary}}[s],g={display:"flex",flexDirection:"column",gap:a[1],padding:a[4],borderRadius:h.lg,border:`1px solid ${c.border}`,backgroundColor:e.white,fontFamily:n.fontFamily.base,minWidth:"120px",flex:1},x={fontSize:n.size["2xl"],fontWeight:n.weight.bold,color:c.color,margin:0,lineHeight:1},u={fontSize:n.size.sm,color:s==="neutral"?e.textSecondary:c.color,margin:0,marginTop:a[1]};return t.jsxs("div",{style:g,children:[t.jsx("div",{style:x,children:i}),t.jsx("div",{style:u,children:r})]})}),Ae=m.memo(function({name:i}){const r={display:"inline-flex",alignItems:"center",padding:`2px ${a[3]}`,backgroundColor:e.neutralBg,color:e.textDark,fontSize:n.size.xs,fontFamily:n.fontFamily.base,fontWeight:n.weight.medium,borderRadius:h.full,whiteSpace:"nowrap"};return t.jsx("span",{style:r,children:i})}),Re=m.memo(function({percent:i,height:r=8}){const s={width:"100%",backgroundColor:e.borderSubtle,borderRadius:h.full,height:`${r}px`,overflow:"hidden"},l={width:`${Math.max(0,Math.min(100,i))}%`,backgroundColor:e.black,height:"100%",transition:"width 300ms ease"};return t.jsx("div",{style:s,role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:t.jsx("div",{style:l})})});function Ee({steps:o}){const i={display:"flex",flexDirection:"column",gap:a[4],fontFamily:n.fontFamily.base};return t.jsx("div",{style:i,children:o.map(r=>{const s=r.status==="pending",l=r.status==="running",c=r.status==="done",g={display:"flex",alignItems:"center",justifyContent:"space-between",opacity:s?.4:1},x={display:"flex",alignItems:"center",gap:a[3]},u={width:"20px",height:"20px",borderRadius:h.full,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:c?e.success:l?e.black:e.borderLight,color:e.white,flexShrink:0};return t.jsxs("div",{style:g,children:[t.jsxs("div",{style:x,children:[t.jsxs("div",{style:u,children:[c&&t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 14 14",fill:"none",children:t.jsx("path",{d:"M2.5 7.5L5.5 10.5L11.5 3.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),l&&t.jsx("div",{style:{width:6,height:6,backgroundColor:e.white,borderRadius:"50%"}})]}),t.jsx("span",{style:{fontSize:n.size.md,color:e.textPrimary,fontWeight:l?n.weight.semibold:n.weight.normal},children:r.label})]}),r.value&&t.jsx("span",{style:{fontSize:n.size.sm,color:c?e.success:e.textTertiary},children:r.value})]},r.id)})})}function We({checked:o,onChange:i,value:r,name:s,disabled:l=!1,label:c,description:g,id:x}){const[u,d]=m.useState(!1),[f,p]=m.useState(!1),y=m.useId(),w=x||y,b={display:"flex",alignItems:"flex-start",gap:a[3],opacity:l?.5:1,cursor:l?"not-allowed":"pointer",fontFamily:n.fontFamily.base},S={position:"relative",width:"18px",height:"18px",borderRadius:h.full,border:`1px solid ${o?e.black:f&&!l?e.textTertiary:e.borderLight}`,backgroundColor:e.white,transition:"border-color 150ms ease, box-shadow 150ms ease",flexShrink:0,boxShadow:u?F.focus:"none",outline:"none",marginTop:"1px"},v={position:"absolute",top:"50%",left:"50%",transform:`translate(-50%, -50%) scale(${o?1:0})`,width:"10px",height:"10px",borderRadius:h.full,backgroundColor:e.black,transition:"transform 150ms ease"},k={display:"flex",flexDirection:"column",gap:a[1]},z={fontSize:n.size.md,fontWeight:n.weight.medium,color:e.textPrimary,margin:0,cursor:l?"not-allowed":"pointer"},P={fontSize:n.size.sm,color:e.textSecondary,margin:0},V={position:"absolute",opacity:0,width:0,height:0,margin:0};return t.jsxs("label",{style:b,htmlFor:w,onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[t.jsxs("div",{style:{position:"relative"},children:[t.jsx("input",{id:w,type:"radio",name:s,value:r,checked:o,disabled:l,onChange:U=>{l||i(U.target.checked)},onFocus:()=>d(!0),onBlur:()=>d(!1),style:V}),t.jsx("div",{style:S,"aria-hidden":"true",children:t.jsx("div",{style:v})})]}),(c||g)&&t.jsxs("div",{style:k,children:[c&&t.jsx("span",{style:z,children:c}),g&&t.jsx("span",{style:P,children:g})]})]})}function He({steps:o,current:i}){const r={display:"flex",justifyContent:"space-between",width:"100%",fontFamily:n.fontFamily.base,position:"relative"},s=32,l={position:"absolute",top:s/2-1,left:s/2,right:s/2,height:2,backgroundColor:e.border,zIndex:1},c={height:"100%",width:`${(Math.min(i,o.length)-1)/(o.length-1)*100}%`,backgroundColor:e.black,transition:"width 300ms ease"};return t.jsxs("div",{style:r,children:[t.jsx("div",{style:l,children:t.jsx("div",{style:c})}),o.map((g,x)=>{const u=x+1,d=u<i,f=u===i,p={width:s,height:s,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:n.size.md,fontWeight:n.weight.semibold,backgroundColor:d||f?e.black:e.white,color:d||f?e.white:e.textTertiary,border:d||f?`2px solid ${e.black}`:`2px solid ${e.border}`,zIndex:2,position:"relative",transition:"all 300ms ease"},y={position:"absolute",top:s+8,left:"50%",transform:"translateX(-50%)",fontSize:n.size.sm,color:f||d?e.textPrimary:e.textTertiary,fontWeight:f?n.weight.semibold:n.weight.normal,whiteSpace:"nowrap"},w={position:"relative",display:"flex",flexDirection:"column",alignItems:"center"};return t.jsxs("div",{style:w,children:[t.jsx("div",{style:p,children:d?t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:t.jsx("path",{d:"M2.5 7.5L5.5 10.5L11.5 3.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}):u}),t.jsx("span",{style:y,children:g})]},g)})]})}const Pe=m.memo(function({label:i,value:r,highlight:s=!1,color:l}){const c={backgroundColor:s?e.black:e.white,border:s?"none":`1px solid ${e.border}`,borderRadius:h.lg,padding:a[5],display:"flex",flexDirection:"column",gap:a[2],fontFamily:n.fontFamily.base,flex:1,minWidth:0},g={fontSize:n.size.sm,color:s?e.textDisabled:e.textSecondary,fontWeight:n.weight.semibold,textTransform:"uppercase",letterSpacing:"0.05em",margin:0},x={fontSize:n.size["3xl"],fontWeight:n.weight.bold,color:s?e.white:l||e.textPrimary,margin:0,lineHeight:1};return t.jsxs("div",{style:c,children:[t.jsx("p",{style:g,children:i}),t.jsx("p",{style:x,children:r})]})});function Ve({checked:o,onChange:i,disabled:r=!1,label:s,description:l,id:c}){const[g,x]=m.useState(!1),u=m.useId(),d=c||u,f={display:"flex",alignItems:"flex-start",gap:a[3],opacity:r?.5:1,cursor:r?"not-allowed":"pointer",fontFamily:n.fontFamily.base},p={position:"relative",width:"36px",height:"20px",backgroundColor:o?e.black:e.borderLight,borderRadius:h.full,transition:"background-color 200ms ease",flexShrink:0,boxShadow:g?F.focus:"none",outline:"none"},y={position:"absolute",top:"2px",left:o?"calc(100% - 18px)":"2px",width:"16px",height:"16px",backgroundColor:e.white,borderRadius:h.full,transition:"left 200ms ease, transform 200ms ease",boxShadow:F.sm},w={display:"flex",flexDirection:"column",gap:a[1],marginTop:"1px"},b={fontSize:n.size.md,fontWeight:n.weight.medium,color:e.textPrimary,margin:0,cursor:r?"not-allowed":"pointer"},S={fontSize:n.size.sm,color:e.textSecondary,margin:0},v=k=>{(k.key===" "||k.key==="Enter")&&(k.preventDefault(),r||i(!o))};return t.jsxs("label",{style:f,htmlFor:d,onMouseEnter:()=>{},children:[t.jsx("div",{id:d,role:"switch","aria-checked":o,"aria-disabled":r,tabIndex:r?-1:0,onKeyDown:v,onFocus:()=>x(!0),onBlur:()=>x(!1),onClick:k=>{k.preventDefault(),r||i(!o)},style:p,children:t.jsx("div",{style:y})}),(s||l)&&t.jsxs("div",{style:w,children:[s&&t.jsx("span",{style:b,children:s}),l&&t.jsx("span",{style:S,children:l})]})]})}const Ue=m.memo(function({value:i,label:r,suffix:s,inverse:l=!1}){const c=i>0,g=i===0;let x=e.textTertiary;g||(c?x=l?e.error:e.success:x=l?e.success:e.error);const u=c?"↑":g?"—":"↓",d=g?"":`${c?"+":""}${i}${s??""}`,f={display:"inline-flex",alignItems:"center",gap:a[1],color:x,fontSize:n.size.sm,fontWeight:n.weight.medium,fontFamily:n.fontFamily.base};return t.jsxs("span",{style:f,children:[t.jsxs("span",{children:[u," ",d]}),r&&t.jsx("span",{style:{color:e.textSecondary,fontWeight:n.weight.normal,marginLeft:a[1]},children:r})]})});function Oe(o=!1){const[i,r]=m.useState(o),s=m.useCallback(()=>r(!0),[]),l=m.useCallback(()=>r(!1),[]),c=m.useCallback(()=>r(g=>!g),[]);return{isOpen:i,open:s,close:l,toggle:c}}function Ge(o,i){const[r,s]=m.useState(()=>{if(typeof window>"u")return i;try{const c=window.localStorage.getItem(o);return c?JSON.parse(c):i}catch{return i}}),l=m.useCallback(c=>{s(g=>{const x=c instanceof Function?c(g):c;try{window.localStorage.setItem(o,JSON.stringify(x))}catch{}return x})},[o]);return[r,l]}function Ne(...o){return o.filter(Boolean).join(" ")}exports.ActionList=Ce;exports.AlertIcon=W;exports.ArrowDownIcon=ye;exports.ArrowLeftIcon=pe;exports.ArrowRightIcon=fe;exports.ArrowUpIcon=he;exports.Badge=D;exports.Button=$;exports.Card=K;exports.CheckIcon=R;exports.CheckRow=je;exports.ChevronDownIcon=we;exports.ChevronLeftIcon=be;exports.ChevronRightIcon=me;exports.ChevronUpIcon=Se;exports.CodeChip=B;exports.DataTable=ee;exports.DiffRow=Le;exports.DownloadIcon=ue;exports.InfoIcon=C;exports.Input=te;exports.IssueCard=H;exports.IssueGroup=$e;exports.LockIcon=A;exports.MenuIcon=ae;exports.MiniStat=De;exports.Modal=ie;exports.ModelTag=Ae;exports.PageHeader=ze;exports.PlayIcon=ce;exports.ProgressBar=Re;exports.ProgressList=Ee;exports.Radio=We;exports.ScoreBar=re;exports.SearchIcon=le;exports.SectionLabel=Q;exports.SettingsIcon=ge;exports.StarIcon=de;exports.StatGrid=J;exports.StatusDot=Fe;exports.StepBar=He;exports.SummaryCard=Pe;exports.Switch=Ve;exports.TabBar=Z;exports.Toast=Me;exports.ToggleGroup=se;exports.Trend=Ue;exports.UploadIcon=xe;exports.XIcon=E;exports.colors=e;exports.cx=Ne;exports.radii=h;exports.shadows=F;exports.spacing=a;exports.typography=n;exports.useLocalStorage=Ge;exports.useModal=Oe;
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/tokens/colors.ts","../src/tokens/spacing.ts","../src/tokens/typography.ts","../src/tokens/radii.ts","../src/tokens/shadows.ts","../src/components/Button/Button.tsx","../src/components/Card/Card.tsx","../src/components/Badge/Badge.tsx","../src/components/StatGrid/StatGrid.tsx","../src/components/SectionLabel/SectionLabel.tsx","../src/components/TabBar/TabBar.tsx","../src/components/DataTable/DataTable.tsx","../src/components/Input/Input.tsx","../src/components/ScoreBar/ScoreBar.tsx","../src/components/Modal/Modal.tsx","../src/components/ToggleGroup/ToggleGroup.tsx","../src/components/Icon/Icon.tsx","../src/components/CheckRow/CheckRow.tsx","../src/components/StatusDot/StatusDot.tsx","../src/components/PageHeader/PageHeader.tsx","../src/components/ActionList/ActionList.tsx","../src/components/Toast/Toast.tsx","../src/components/CodeChip/CodeChip.tsx","../src/components/DiffRow/DiffRow.tsx","../src/components/IssueCard/IssueCard.tsx","../src/components/IssueGroup/IssueGroup.tsx","../src/components/MiniStat/MiniStat.tsx","../src/components/ModelTag/ModelTag.tsx","../src/components/ProgressBar/ProgressBar.tsx","../src/components/ProgressList/ProgressList.tsx","../src/components/Radio/Radio.tsx","../src/components/StepBar/StepBar.tsx","../src/components/SummaryCard/SummaryCard.tsx","../src/components/Switch/Switch.tsx","../src/components/Trend/Trend.tsx","../src/hooks/useModal.ts","../src/hooks/useLocalStorage.ts","../src/utils/cx.ts"],"sourcesContent":["export const colors = {\n // Brand\n black: \"#1A1A1A\",\n blackHover: \"#2A2A2A\",\n red: \"#D42B2B\",\n white: \"#FFFFFF\",\n\n // Page & surface\n pageBg: \"#F1F1F1\",\n cardBg: \"#FFFFFF\",\n bgSubtle: \"#FAFAFA\",\n\n // Text\n textPrimary: \"#1A1A1A\",\n textSecondary: \"#6B7280\",\n textTertiary: \"#9CA3AF\",\n textDark: \"#374151\",\n textDisabled: \"#D1D5DB\",\n textInverse: \"#FFFFFF\",\n\n // Borders\n border: \"#E5E5E5\",\n borderLight: \"#D1D5DB\",\n borderSubtle: \"#F3F4F6\",\n borderFocus: \"#1A1A1A\",\n\n // Semantic — status\n success: \"#22C55E\",\n successBg: \"#F0FDF4\",\n successBorder: \"#BBF7D0\",\n\n warning: \"#F59E0B\",\n warningBg: \"#FFFBEB\",\n warningBorder: \"#FDE68A\",\n\n error: \"#EF4444\",\n errorHover: \"#DC2626\",\n errorBg: \"#FEF2F2\",\n errorBorder: \"#FECACA\",\n\n info: \"#2563EB\",\n infoBg: \"#EFF6FF\",\n infoBorder: \"#BFDBFE\",\n\n // Pro badge / neutral chip\n neutralBg: \"#F3F4F6\",\n neutralText: \"#6B7280\",\n\n // Skeleton\n skeletonBase: \"#E5E5E5\",\n skeletonPulse: \"#F1F2F4\",\n} as const;\n\nexport type ColorToken = keyof typeof colors;\n","// Base unit: 4px\nexport const spacing = {\n 0: \"0px\",\n 1: \"4px\",\n 2: \"8px\",\n 3: \"12px\",\n 4: \"16px\",\n 5: \"20px\",\n 6: \"24px\",\n 8: \"32px\",\n 10: \"40px\",\n 12: \"48px\",\n 16: \"64px\",\n 20: \"80px\",\n} as const;\n\nexport type SpacingToken = keyof typeof spacing;\n","export const typography = {\n fontFamily: {\n base: \"-apple-system, 'Helvetica Neue', sans-serif\",\n mono: \"'Menlo', 'Monaco', 'Courier New', monospace\",\n },\n size: {\n xs: \"10px\",\n sm: \"11px\",\n base: \"13px\",\n md: \"14px\",\n lg: \"16px\",\n xl: \"20px\",\n \"2xl\": \"24px\",\n \"3xl\": \"32px\",\n },\n weight: {\n normal: 400,\n medium: 500,\n semibold: 600,\n bold: 700,\n extrabold: 800,\n },\n lineHeight: {\n tight: 1.2,\n snug: 1.4,\n normal: 1.5,\n relaxed: 1.55,\n loose: 1.75,\n },\n letterSpacing: {\n tight: \"-0.02em\",\n snug: \"-0.01em\",\n normal: \"0em\",\n wide: \"0.02em\",\n },\n} as const;\n","export const radii = {\n none: \"0px\",\n xs: \"4px\",\n sm: \"6px\",\n md: \"8px\",\n lg: \"10px\",\n xl: \"12px\",\n \"2xl\": \"16px\",\n full: \"9999px\",\n} as const;\n\nexport type RadiiToken = keyof typeof radii;\n","export const shadows = {\n none: \"none\",\n sm: \"0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04)\",\n md: \"0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04)\",\n lg: \"0 20px 60px rgba(0,0,0,0.18)\",\n focus: \"0 0 0 3px rgba(26, 26, 26, 0.12)\",\n} as const;\n\nexport type ShadowToken = keyof typeof shadows;\n","import React from \"react\";\nimport { colors } from \"../../tokens/colors\";\nimport { spacing } from \"../../tokens/spacing\";\nimport { typography } from \"../../tokens/typography\";\nimport { radii } from \"../../tokens/radii\";\nimport { shadows } from \"../../tokens/shadows\";\n\ntype ButtonProps = {\n variant: \"primary\" | \"ghost\" | \"danger\" | \"text\";\n size: \"sm\" | \"md\" | \"lg\";\n loading?: boolean;\n disabled?: boolean;\n fullWidth?: boolean;\n leftIcon?: React.ReactNode;\n children: React.ReactNode;\n onClick?: () => void;\n};\n\nconst sizeStyles = {\n sm: {\n padding: `${spacing[1]} ${spacing[3]}`,\n fontSize: typography.size.base,\n height: \"32px\",\n gap: spacing[1],\n },\n md: {\n padding: `${spacing[2]} ${spacing[4]}`,\n fontSize: typography.size.md,\n height: \"40px\",\n gap: spacing[2],\n },\n lg: {\n padding: `${spacing[3]} ${spacing[6]}`,\n fontSize: typography.size.md,\n height: \"48px\",\n gap: spacing[2],\n },\n} as const;\n\nconst variantStyles = {\n primary: {\n background: colors.black,\n color: colors.textInverse,\n border: \"none\",\n hoverBg: colors.blackHover,\n },\n ghost: {\n background: \"transparent\",\n color: colors.textPrimary,\n border: `1px solid ${colors.border}`,\n hoverBg: colors.bgSubtle,\n },\n danger: {\n background: colors.error,\n color: colors.textInverse,\n border: \"none\",\n hoverBg: colors.errorHover,\n },\n text: {\n background: \"transparent\",\n color: colors.textSecondary,\n border: \"none\",\n hoverBg: colors.bgSubtle,\n },\n} as const;\n\nexport function Button({\n variant,\n size,\n loading = false,\n disabled = false,\n fullWidth = false,\n leftIcon,\n children,\n onClick,\n}: ButtonProps) {\n const sizeS = sizeStyles[size];\n const variantS = variantStyles[variant];\n const isDisabled = disabled || loading;\n\n const style: React.CSSProperties = {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: sizeS.gap,\n padding: sizeS.padding,\n fontSize: sizeS.fontSize,\n height: sizeS.height,\n fontFamily: typography.fontFamily.base,\n fontWeight: typography.weight.semibold,\n lineHeight: typography.lineHeight.tight,\n letterSpacing: typography.letterSpacing.snug,\n borderRadius: radii.md,\n background: variantS.background,\n color: variantS.color,\n border: variantS.border,\n cursor: isDisabled ? \"not-allowed\" : \"pointer\",\n opacity: isDisabled ? 0.5 : 1,\n transition: \"background 150ms ease, opacity 150ms ease, box-shadow 150ms ease\",\n width: fullWidth ? \"100%\" : undefined,\n boxSizing: \"border-box\",\n outline: \"none\",\n };\n\n return (\n <button\n style={style}\n onClick={onClick}\n disabled={isDisabled}\n onMouseEnter={(e) => {\n if (!isDisabled) {\n e.currentTarget.style.background = variantS.hoverBg;\n }\n }}\n onMouseLeave={(e) => {\n if (!isDisabled) {\n e.currentTarget.style.background = variantS.background;\n }\n }}\n onFocus={(e) => {\n e.currentTarget.style.boxShadow = shadows.focus;\n }}\n onBlur={(e) => {\n e.currentTarget.style.boxShadow = \"none\";\n }}\n >\n {loading ? <Spinner /> : leftIcon}\n {children}\n </button>\n );\n}\n\nlet spinnerStyleInjected = false;\n\nfunction ensureSpinnerStyle() {\n if (spinnerStyleInjected || typeof document === \"undefined\") return;\n const style = document.createElement(\"style\");\n style.textContent = `@keyframes ol-spin { to { transform: rotate(360deg) } }`;\n document.head.appendChild(style);\n spinnerStyleInjected = true;\n}\n\nfunction Spinner() {\n ensureSpinnerStyle();\n\n return (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n style={{\n animation: \"ol-spin 0.6s linear infinite\",\n }}\n >\n <circle\n cx=\"8\"\n cy=\"8\"\n r=\"6\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeDasharray=\"28\"\n strokeDashoffset=\"20\"\n opacity=\"0.8\"\n />\n </svg>\n );\n}\n","import React from \"react\";\nimport { colors } from \"../../tokens/colors\";\nimport { spacing } from \"../../tokens/spacing\";\nimport { radii } from \"../../tokens/radii\";\nimport { shadows } from \"../../tokens/shadows\";\n\ntype CardProps = {\n padding?: \"none\" | \"sm\" | \"md\" | \"lg\";\n noBorder?: boolean;\n shadow?: boolean;\n children: React.ReactNode;\n};\n\nconst paddingMap = {\n none: \"0px\",\n sm: spacing[3],\n md: spacing[6],\n lg: spacing[8],\n} as const;\n\nexport function Card({\n padding = \"md\",\n noBorder = false,\n shadow = false,\n children,\n}: CardProps) {\n const style: React.CSSProperties = {\n background: colors.cardBg,\n borderRadius: radii.xl,\n padding: paddingMap[padding],\n border: noBorder ? \"none\" : `1px solid ${colors.border}`,\n boxShadow: shadow ? shadows.sm : shadows.none,\n boxSizing: \"border-box\",\n };\n\n return <div style={style}>{children}</div>;\n}\n","import React from \"react\";\nimport { colors } from \"../../tokens/colors\";\nimport { spacing } from \"../../tokens/spacing\";\nimport { typography } from \"../../tokens/typography\";\nimport { radii } from \"../../tokens/radii\";\n\ntype BadgeProps = {\n tone: \"success\" | \"warning\" | \"error\" | \"info\" | \"neutral\";\n dot?: boolean;\n children: React.ReactNode;\n};\n\nconst toneStyles = {\n success: { bg: colors.successBg, color: colors.success, dot: colors.success },\n warning: { bg: colors.warningBg, color: colors.warning, dot: colors.warning },\n error: { bg: colors.errorBg, color: colors.error, dot: colors.error },\n info: { bg: colors.infoBg, color: colors.info, dot: colors.info },\n neutral: { bg: colors.neutralBg, color: colors.neutralText, dot: colors.textTertiary },\n} as const;\n\nexport const Badge = React.memo(function Badge({ tone, dot = false, children }: BadgeProps) {\n const t = toneStyles[tone];\n\n const style: React.CSSProperties = {\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: spacing[1],\n padding: `2px ${spacing[2]}`,\n fontSize: typography.size.xs,\n fontWeight: typography.weight.semibold,\n fontFamily: typography.fontFamily.base,\n lineHeight: typography.lineHeight.tight,\n borderRadius: radii.xs,\n background: t.bg,\n color: t.color,\n whiteSpace: \"nowrap\",\n };\n\n const dotStyle: React.CSSProperties = {\n width: \"5px\",\n height: \"5px\",\n borderRadius: radii.full,\n background: t.dot,\n flexShrink: 0,\n };\n\n return (\n <span style={style}>\n {dot && <span style={dotStyle} />}\n {children}\n </span>\n );\n});\n","import React from \"react\";\nimport { colors } from \"../../tokens/colors\";\nimport { spacing } from \"../../tokens/spacing\";\nimport { typography } from \"../../tokens/typography\";\nimport { radii } from \"../../tokens/radii\";\n\ntype Stat = {\n label: string;\n value: string;\n unit?: string;\n sub?: string;\n color?: string;\n highlight?: boolean;\n};\n\ntype StatGridProps = {\n stats: Stat[];\n cols?: 2 | 3 | 4;\n};\n\nexport function StatGrid({ stats, cols: _cols = 4 }: StatGridProps) {\n // Use the bordered-strip pattern from csv-doctor's diagnosis screen\n const stripStyle: React.CSSProperties = {\n display: \"flex\",\n border: `1px solid ${colors.border}`,\n borderRadius: radii.lg,\n overflow: \"hidden\",\n };\n\n return (\n <div style={stripStyle}>\n {stats.map((stat, i) => (\n <StatCell key={i} stat={stat} isLast={i === stats.length - 1} />\n ))}\n </div>\n );\n}\n\nfunction StatCell({ stat, isLast }: { stat: Stat; isLast: boolean }) {\n const isHighlight = stat.highlight;\n\n const style: React.CSSProperties = {\n flex: 1,\n padding: `${spacing[3]} ${spacing[4]}`,\n textAlign: \"center\",\n borderRight: isLast ? undefined : `1px solid ${colors.border}`,\n background: isHighlight ? colors.black : \"transparent\",\n };\n\n const valueStyle: React.CSSProperties = {\n fontSize: typography.size.xl,\n fontWeight: typography.weight.bold,\n fontFamily: typography.fontFamily.base,\n lineHeight: typography.lineHeight.tight,\n color: stat.color || (isHighlight ? colors.textInverse : colors.textPrimary),\n display: \"flex\",\n alignItems: \"baseline\",\n justifyContent: \"center\",\n gap: spacing[1],\n margin: 0,\n };\n\n const unitStyle: React.CSSProperties = {\n fontSize: typography.size.sm,\n fontWeight: typography.weight.medium,\n color: isHighlight ? colors.textTertiary : colors.textTertiary,\n };\n\n const labelStyle: React.CSSProperties = {\n fontSize: typography.size.sm,\n fontFamily: typography.fontFamily.base,\n color: isHighlight ? colors.textTertiary : colors.textTertiary,\n marginTop: \"2px\",\n };\n\n const subStyle: React.CSSProperties = {\n fontSize: typography.size.xs,\n color: colors.textTertiary,\n fontFamily: typography.fontFamily.base,\n marginTop: \"4px\",\n };\n\n return (\n <div style={style}>\n <p style={valueStyle}>\n {stat.value}\n {stat.unit && <span style={unitStyle}>{stat.unit}</span>}\n </p>\n <div style={labelStyle}>{stat.label}</div>\n {stat.sub && <div style={subStyle}>{stat.sub}</div>}\n </div>\n );\n}\n","import React from \"react\";\nimport { colors } from \"../../tokens/colors\";\nimport { spacing } from \"../../tokens/spacing\";\nimport { typography } from \"../../tokens/typography\";\n\ntype SectionLabelProps = {\n children: React.ReactNode;\n action?: React.ReactNode;\n};\n\nexport const SectionLabel = React.memo(function SectionLabel({ children, action }: SectionLabelProps) {\n const style: React.CSSProperties = {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n marginBottom: spacing[2],\n };\n\n const labelStyle: React.CSSProperties = {\n fontSize: typography.size.sm,\n fontWeight: typography.weight.medium,\n fontFamily: typography.fontFamily.base,\n color: colors.textSecondary,\n margin: 0,\n };\n\n return (\n <div style={style}>\n <p style={labelStyle}>{children}</p>\n {action && <div>{action}</div>}\n </div>\n );\n});\n","import React from \"react\";\nimport { colors } from \"../../tokens/colors\";\nimport { spacing } from \"../../tokens/spacing\";\nimport { typography } from \"../../tokens/typography\";\nimport { radii } from \"../../tokens/radii\";\n\ntype Tab = {\n id: string;\n label: string;\n badge?: number;\n};\n\ntype TabBarProps = {\n tabs: Tab[];\n active: string;\n onChange: (id: string) => void;\n size?: \"sm\" | \"md\";\n};\n\nexport function TabBar({ tabs, active, onChange, size = \"md\" }: TabBarProps) {\n const containerStyle: React.CSSProperties = {\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: spacing[1],\n fontFamily: typography.fontFamily.base,\n };\n\n const fontSize = size === \"sm\" ? typography.size.base : typography.size.md;\n const paddingY = size === \"sm\" ? spacing[1] : spacing[2];\n const paddingX = size === \"sm\" ? spacing[3] : spacing[4];\n\n return (\n <div style={containerStyle} role=\"tablist\">\n {tabs.map((tab) => {\n const isActive = tab.id === active;\n\n const tabStyle: React.CSSProperties = {\n padding: `${paddingY} ${paddingX}`,\n fontSize,\n fontWeight: isActive ? typography.weight.semibold : typography.weight.normal,\n fontFamily: typography.fontFamily.base,\n color: isActive ? colors.textInverse : colors.textSecondary,\n background: isActive ? colors.black : \"transparent\",\n border: \"none\",\n borderRadius: radii.full,\n cursor: \"pointer\",\n display: \"flex\",\n alignItems: \"center\",\n gap: spacing[2],\n transition: \"background 150ms ease, color 150ms ease\",\n whiteSpace: \"nowrap\",\n };\n\n const badgeStyle: React.CSSProperties = {\n fontSize: typography.size.xs,\n fontWeight: typography.weight.semibold,\n background: isActive ? \"rgba(255,255,255,0.2)\" : colors.neutralBg,\n color: isActive ? colors.textInverse : colors.textSecondary,\n borderRadius: radii.full,\n padding: `0 ${spacing[2]}`,\n minWidth: \"20px\",\n textAlign: \"center\",\n lineHeight: \"20px\",\n };\n\n return (\n <button\n key={tab.id}\n style={tabStyle}\n role=\"tab\"\n aria-selected={isActive}\n onClick={() => !isActive && onChange(tab.id)}\n onMouseEnter={(e) => {\n if (!isActive) {\n e.currentTarget.style.background = colors.neutralBg;\n e.currentTarget.style.color = colors.textPrimary;\n }\n }}\n onMouseLeave={(e) => {\n if (!isActive) {\n e.currentTarget.style.background = \"transparent\";\n e.currentTarget.style.color = colors.textSecondary;\n }\n }}\n >\n {tab.label}\n {tab.badge !== undefined && <span style={badgeStyle}>{tab.badge}</span>}\n </button>\n );\n })}\n </div>\n );\n}\n","import React from \"react\";\nimport { colors } from \"../../tokens/colors\";\nimport { spacing } from \"../../tokens/spacing\";\nimport { typography } from \"../../tokens/typography\";\nimport { radii } from \"../../tokens/radii\";\n\ntype Column<T> = {\n key: keyof T | string;\n header: string;\n width?: number | string;\n render?: (row: T) => React.ReactNode;\n align?: \"left\" | \"center\" | \"right\";\n};\n\ntype DataTableProps<T> = {\n columns: Column<T>[];\n rows: T[];\n loading?: boolean;\n emptyState?: React.ReactNode;\n onRowClick?: (row: T) => void;\n};\n\nexport function DataTable<T extends Record<string, unknown>>({\n columns,\n rows,\n loading = false,\n emptyState,\n onRowClick,\n}: DataTableProps<T>) {\n const tableStyle: React.CSSProperties = {\n width: \"100%\",\n borderCollapse: \"collapse\",\n fontFamily: typography.fontFamily.base,\n fontSize: typography.size.base,\n };\n\n const thStyle = (col: Column<T>): React.CSSProperties => ({\n textAlign: (col.align || \"left\") as React.CSSProperties[\"textAlign\"],\n padding: `${spacing[3]} ${spacing[4]}`,\n fontSize: typography.size.sm,\n fontWeight: typography.weight.medium,\n color: colors.textTertiary,\n borderBottom: `1px solid ${colors.border}`,\n width: col.width,\n whiteSpace: \"nowrap\",\n });\n\n const tdStyle = (col: Column<T>): React.CSSProperties => ({\n textAlign: (col.align || \"left\") as React.CSSProperties[\"textAlign\"],\n padding: `${spacing[3]} ${spacing[4]}`,\n fontSize: typography.size.base,\n color: colors.textPrimary,\n borderBottom: `1px solid ${colors.borderSubtle}`,\n verticalAlign: \"middle\",\n lineHeight: typography.lineHeight.snug,\n });\n\n const trHoverStyle: React.CSSProperties = {\n cursor: onRowClick ? \"pointer\" : \"default\",\n transition: \"background 100ms ease\",\n };\n\n if (loading) {\n return (\n <div style={{ padding: spacing[8], textAlign: \"center\" }}>\n <p style={{ color: colors.textTertiary, fontSize: typography.size.base }}>Loading...</p>\n </div>\n );\n }\n\n if (rows.length === 0) {\n if (emptyState) return <>{emptyState}</>;\n return (\n <div style={{ padding: spacing[8], textAlign: \"center\" }}>\n <p style={{ color: colors.textTertiary, fontSize: typography.size.base }}>No data</p>\n </div>\n );\n }\n\n return (\n <div style={{ overflowX: \"auto\", borderRadius: radii.md }}>\n <table style={tableStyle}>\n <thead>\n <tr>\n {columns.map((col) => (\n <th key={String(col.key)} style={thStyle(col)}>\n {col.header}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {rows.map((row, rowIdx) => (\n <tr\n key={rowIdx}\n style={trHoverStyle}\n onClick={() => onRowClick?.(row)}\n onMouseEnter={(e) => {\n e.currentTarget.style.background = colors.bgSubtle;\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.background = \"transparent\";\n }}\n >\n {columns.map((col) => (\n <td key={String(col.key)} style={tdStyle(col)}>\n {col.render\n ? col.render(row)\n : String(row[col.key as keyof T] ?? \"\")}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n}\n","import React from \"react\";\nimport { colors } from \"../../tokens/colors\";\nimport { spacing } from \"../../tokens/spacing\";\nimport { typography } from \"../../tokens/typography\";\nimport { radii } from \"../../tokens/radii\";\nimport { shadows } from \"../../tokens/shadows\";\n\ntype InputProps = {\n label?: string;\n hint?: string;\n error?: string;\n prefix?: React.ReactNode;\n suffix?: React.ReactNode;\n type?: \"text\" | \"email\" | \"password\" | \"time\" | \"url\";\n placeholder?: string;\n disabled?: boolean;\n value: string;\n onChange: (value: string) => void;\n};\n\nexport function Input({\n label,\n hint,\n error,\n prefix,\n suffix,\n type = \"text\",\n placeholder,\n disabled = false,\n value,\n onChange,\n}: InputProps) {\n const hasError = !!error;\n\n const wrapperStyle: React.CSSProperties = {\n display: \"flex\",\n flexDirection: \"column\",\n gap: spacing[1],\n fontFamily: typography.fontFamily.base,\n };\n\n const labelStyle: React.CSSProperties = {\n fontSize: typography.size.base,\n fontWeight: typography.weight.medium,\n color: colors.textPrimary,\n margin: 0,\n };\n\n const inputWrapperStyle: React.CSSProperties = {\n display: \"flex\",\n alignItems: \"center\",\n gap: spacing[2],\n padding: `${spacing[2]} ${spacing[3]}`,\n background: disabled ? colors.bgSubtle : colors.cardBg,\n border: `1px solid ${hasError ? colors.error : colors.border}`,\n borderRadius: radii.md,\n transition: \"border-color 150ms ease, box-shadow 150ms ease\",\n cursor: disabled ? \"not-allowed\" : \"text\",\n };\n\n const inputStyle: React.CSSProperties = {\n flex: 1,\n border: \"none\",\n outline: \"none\",\n background: \"transparent\",\n fontSize: typography.size.md,\n fontFamily: typography.fontFamily.base,\n color: disabled ? colors.textDisabled : colors.textPrimary,\n cursor: disabled ? \"not-allowed\" : \"text\",\n padding: 0,\n width: \"100%\",\n };\n\n const hintStyle: React.CSSProperties = {\n fontSize: typography.size.sm,\n color: hasError ? colors.error : colors.textTertiary,\n margin: 0,\n };\n\n const affixStyle: React.CSSProperties = {\n fontSize: typography.size.base,\n color: colors.textTertiary,\n flexShrink: 0,\n };\n\n return (\n <div style={wrapperStyle}>\n {label && <p style={labelStyle}>{label}</p>}\n <div\n style={inputWrapperStyle}\n onFocusCapture={(e) => {\n const wrapper = e.currentTarget;\n wrapper.style.borderColor = hasError ? colors.error : colors.borderFocus;\n wrapper.style.boxShadow = shadows.focus;\n }}\n onBlurCapture={(e) => {\n const wrapper = e.currentTarget;\n wrapper.style.borderColor = hasError ? colors.error : colors.border;\n wrapper.style.boxShadow = \"none\";\n }}\n >\n {prefix && <span style={affixStyle}>{prefix}</span>}\n <input\n type={type}\n value={value}\n onChange={(e) => onChange(e.target.value)}\n placeholder={placeholder}\n disabled={disabled}\n aria-invalid={hasError}\n style={inputStyle}\n />\n {suffix && <span style={affixStyle}>{suffix}</span>}\n </div>\n {(error || hint) && <p style={hintStyle}>{error || hint}</p>}\n </div>\n );\n}\n","import React from \"react\";\nimport { colors } from \"../../tokens/colors\";\nimport { spacing } from \"../../tokens/spacing\";\nimport { typography } from \"../../tokens/typography\";\nimport { radii } from \"../../tokens/radii\";\n\ntype ScoreBarProps = {\n score: number;\n max?: number;\n width?: number | string;\n showLabel?: boolean;\n size?: \"sm\" | \"md\";\n};\n\nfunction getScoreColor(pct: number): string {\n if (pct >= 75) return colors.success;\n if (pct >= 50) return colors.warning;\n return colors.error;\n}\n\nfunction getScoreBg(pct: number): string {\n if (pct >= 75) return colors.successBg;\n if (pct >= 50) return colors.warningBg;\n return colors.errorBg;\n}\n\nexport const ScoreBar = React.memo(function ScoreBar({\n score,\n max = 100,\n width = \"100%\",\n showLabel = true,\n size = \"md\",\n}: ScoreBarProps) {\n const pct = Math.min(Math.max((score / max) * 100, 0), 100);\n const barColor = getScoreColor(pct);\n const bgColor = getScoreBg(pct);\n const barHeight = size === \"sm\" ? \"6px\" : \"8px\";\n\n const containerStyle: React.CSSProperties = {\n display: \"flex\",\n alignItems: \"center\",\n gap: spacing[3],\n width,\n fontFamily: typography.fontFamily.base,\n };\n\n const trackStyle: React.CSSProperties = {\n flex: 1,\n height: barHeight,\n background: bgColor,\n borderRadius: radii.full,\n overflow: \"hidden\",\n };\n\n const fillStyle: React.CSSProperties = {\n height: \"100%\",\n width: `${pct}%`,\n background: barColor,\n borderRadius: radii.full,\n transition: \"width 400ms ease\",\n };\n\n const labelStyle: React.CSSProperties = {\n fontSize: size === \"sm\" ? typography.size.xs : typography.size.sm,\n fontWeight: typography.weight.semibold,\n color: barColor,\n minWidth: \"36px\",\n textAlign: \"right\",\n };\n\n return (\n <div style={containerStyle}>\n <div style={trackStyle}>\n <div style={fillStyle} />\n </div>\n {showLabel && <span style={labelStyle}>{Math.round(pct)}%</span>}\n </div>\n );\n});\n","import React, { useEffect, useRef, useState } from \"react\";\nimport { colors } from \"../../tokens/colors\";\nimport { spacing } from \"../../tokens/spacing\";\nimport { typography } from \"../../tokens/typography\";\nimport { radii } from \"../../tokens/radii\";\nimport { shadows } from \"../../tokens/shadows\";\n\ntype ModalProps = {\n open: boolean;\n onClose: () => void;\n children: React.ReactNode;\n maxWidth?: number;\n title?: string;\n};\n\nconst FOCUSABLE_SELECTOR =\n 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex=\"-1\"])';\n\nexport function Modal({\n open,\n onClose,\n children,\n maxWidth = 400,\n title,\n}: ModalProps) {\n const [visible, setVisible] = useState(false);\n const dialogRef = useRef<HTMLDivElement>(null);\n const titleId = React.useId();\n\n // Entry animation: mount → rAF → transition in\n useEffect(() => {\n if (!open) {\n setVisible(false);\n return;\n }\n const id = requestAnimationFrame(() => setVisible(true));\n return () => cancelAnimationFrame(id);\n }, [open]);\n\n // ESC key closes modal\n useEffect(() => {\n if (!open) return;\n const handler = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") onClose();\n };\n document.addEventListener(\"keydown\", handler);\n return () => document.removeEventListener(\"keydown\", handler);\n }, [open, onClose]);\n\n // Focus trap\n useEffect(() => {\n if (!open || !dialogRef.current) return;\n\n const dialog = dialogRef.current;\n const previouslyFocused = document.activeElement as HTMLElement | null;\n\n // Focus the first focusable element inside the dialog\n const firstFocusable = dialog.querySelector<HTMLElement>(FOCUSABLE_SELECTOR);\n if (firstFocusable) {\n firstFocusable.focus();\n } else {\n dialog.focus();\n }\n\n const handleTab = (e: KeyboardEvent) => {\n if (e.key !== \"Tab\") return;\n\n const focusableElements = dialog.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR);\n if (focusableElements.length === 0) return;\n\n const first = focusableElements[0];\n const last = focusableElements[focusableElements.length - 1];\n\n if (e.shiftKey) {\n if (document.activeElement === first) {\n e.preventDefault();\n last.focus();\n }\n } else {\n if (document.activeElement === last) {\n e.preventDefault();\n first.focus();\n }\n }\n };\n\n document.addEventListener(\"keydown\", handleTab);\n return () => {\n document.removeEventListener(\"keydown\", handleTab);\n // Restore focus when modal closes\n previouslyFocused?.focus();\n };\n }, [open]);\n\n if (!open) return null;\n\n const closeButton = (\n <button\n onClick={onClose}\n onMouseEnter={(e) => {\n e.currentTarget.style.background = colors.pageBg;\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.background = \"transparent\";\n }}\n style={{\n width: \"28px\",\n height: \"28px\",\n borderRadius: radii.sm,\n border: \"none\",\n background: \"transparent\",\n color: colors.textTertiary,\n cursor: \"pointer\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n flexShrink: 0,\n }}\n aria-label=\"Close\"\n >\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\n <path\n d=\"M1 1l10 10M11 1L1 11\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n />\n </svg>\n </button>\n );\n\n return (\n <div\n role=\"presentation\"\n onClick={onClose}\n style={{\n position: \"fixed\",\n inset: 0,\n background: \"rgba(0,0,0,0.32)\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n zIndex: 100,\n padding: spacing[4],\n }}\n >\n <div\n ref={dialogRef}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={title ? titleId : undefined}\n tabIndex={-1}\n onClick={(e) => e.stopPropagation()}\n onKeyDown={(e) => e.stopPropagation()}\n style={{\n background: colors.cardBg,\n borderRadius: radii[\"2xl\"],\n width: \"100%\",\n maxWidth,\n boxShadow: shadows.lg,\n opacity: visible ? 1 : 0,\n transform: visible ? \"none\" : \"translateY(10px) scale(0.97)\",\n transition: \"opacity 0.18s ease, transform 0.18s ease\",\n outline: \"none\",\n ...(title\n ? {\n display: \"flex\",\n flexDirection: \"column\" as const,\n maxHeight: \"calc(100vh - 32px)\",\n overflow: \"hidden\",\n }\n : {\n padding: \"28px 24px 24px\",\n position: \"relative\" as const,\n }),\n }}\n >\n {title ? (\n <>\n {/* Sticky header */}\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n padding: `${spacing[4]} ${spacing[5]}`,\n borderBottom: `1px solid ${colors.border}`,\n flexShrink: 0,\n }}\n >\n <span\n id={titleId}\n style={{\n fontWeight: typography.weight.bold,\n fontSize: typography.size.base,\n fontFamily: typography.fontFamily.base,\n color: colors.textPrimary,\n }}\n >\n {title}\n </span>\n {closeButton}\n </div>\n\n {/* Scrollable body */}\n <div style={{ overflowY: \"auto\", flex: 1 }}>{children}</div>\n </>\n ) : (\n <>\n {/* Original layout: absolute X button */}\n <div style={{ position: \"absolute\", top: \"14px\", right: \"14px\" }}>\n {closeButton}\n </div>\n {children}\n </>\n )}\n </div>\n </div>\n );\n}\n","import React from \"react\";\nimport { colors } from \"../../tokens/colors\";\nimport { spacing } from \"../../tokens/spacing\";\nimport { typography } from \"../../tokens/typography\";\nimport { radii } from \"../../tokens/radii\";\n\ntype ToggleGroupProps = {\n options: { value: string; label: string }[];\n value: string;\n onChange: (value: string) => void;\n fullWidth?: boolean;\n};\n\nexport function ToggleGroup({\n options,\n value,\n onChange,\n fullWidth = false,\n}: ToggleGroupProps) {\n const containerStyle: React.CSSProperties = {\n display: \"inline-flex\",\n border: `1px solid ${colors.border}`,\n borderRadius: radii.md,\n overflow: \"hidden\",\n fontFamily: typography.fontFamily.base,\n width: fullWidth ? \"100%\" : undefined,\n };\n\n return (\n <div style={containerStyle} role=\"radiogroup\">\n {options.map((opt, i) => {\n const isActive = opt.value === value;\n\n const optStyle: React.CSSProperties = {\n flex: fullWidth ? 1 : undefined,\n padding: `${spacing[2]} ${spacing[4]}`,\n fontSize: typography.size.md,\n fontWeight: isActive ? typography.weight.semibold : typography.weight.normal,\n fontFamily: typography.fontFamily.base,\n color: isActive ? colors.textInverse : colors.textPrimary,\n background: isActive ? colors.black : colors.cardBg,\n border: \"none\",\n borderRight: i < options.length - 1 ? `1px solid ${colors.border}` : \"none\",\n cursor: \"pointer\",\n transition: \"background 150ms ease, color 150ms ease\",\n textAlign: \"center\",\n whiteSpace: \"nowrap\",\n };\n\n return (\n <button\n key={opt.value}\n style={optStyle}\n role=\"radio\"\n aria-checked={isActive}\n onClick={() => onChange(opt.value)}\n onMouseEnter={(e) => {\n if (!isActive) e.currentTarget.style.background = colors.bgSubtle;\n }}\n onMouseLeave={(e) => {\n if (!isActive) e.currentTarget.style.background = colors.cardBg;\n }}\n >\n {opt.label}\n </button>\n );\n })}\n </div>\n );\n}\n","import React from \"react\";\n\nexport type IconProps = React.SVGProps<SVGSVGElement> & {\n size?: number | string;\n filled?: boolean;\n};\n\nfunction createIcon(d: string | React.ReactNode, viewBox = \"0 0 24 24\") {\n return function Icon({ size = 20, filled, className, style, ...props }: IconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={size}\n height={size}\n viewBox={viewBox}\n fill={filled ? \"currentColor\" : \"none\"}\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={className}\n style={{ flexShrink: 0, ...style }}\n {...props}\n >\n {typeof d === \"string\" ? <path d={d} /> : d}\n </svg>\n );\n };\n}\n\n// -----------------------------------------------------------------------------\n// core / ui\n// -----------------------------------------------------------------------------\nexport const LockIcon = createIcon(\n <>\n <rect x=\"3\" y=\"11\" width=\"18\" height=\"11\" rx=\"2\" ry=\"2\" />\n <path d=\"M7 11V7a5 5 0 0110 0v4\" />\n </>\n);\n\nexport const SearchIcon = createIcon(\n <>\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <path d=\"M21 21l-4.35-4.35\" />\n </>\n);\n\nexport const CheckIcon = createIcon(\"M20 6L9 17l-5-5\");\n\nexport const XIcon = createIcon(\"M18 6L6 18M6 6l12 12\");\n\nexport const MenuIcon = createIcon(\"M3 12h18M3 6h18M3 18h18\");\n\nexport const InfoIcon = createIcon(\n <>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 16v-4M12 8h.01\" />\n </>\n);\n\nexport const AlertIcon = createIcon(\n <>\n <path d=\"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z\" />\n <path d=\"M12 9v4M12 17h.01\" />\n </>\n);\n\nexport const PlayIcon = createIcon(\"M5 3l14 9-14 9V3z\");\n\nexport const StarIcon = createIcon(\n \"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z\"\n);\n\nexport const SettingsIcon = createIcon(\n <>\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n <path d=\"M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-2 2 2 2 0 01-2-2v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83 0 2 2 0 010-2.83l.06-.06a1.65 1.65 0 00.33-1.82 1.65 1.65 0 00-1.51-1H3a2 2 0 01-2-2 2 2 0 012-2h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 010-2.83 2 2 0 012.83 0l.06.06a1.65 1.65 0 001.82.33H9a1.65 1.65 0 001-1.51V3a2 2 0 012-2 2 2 0 012 2v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 0 2 2 0 010 2.83l-.06.06a1.65 1.65 0 00-.33 1.82V9a1.65 1.65 0 001.51 1H21a2 2 0 012 2 2 2 0 01-2 2h-.09a1.65 1.65 0 00-1.51 1z\" />\n </>\n);\n\nexport const UploadIcon = createIcon(\"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M17 8l-5-5-5 5M12 3v12\");\n\nexport const DownloadIcon = createIcon(\"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M7 10l5 5 5-5M12 15V3\");\n\n// -----------------------------------------------------------------------------\n// arrows / chevrons\n// -----------------------------------------------------------------------------\nexport const ArrowRightIcon = createIcon(\"M5 12h14M12 5l7 7-7 7\");\nexport const ArrowLeftIcon = createIcon(\"M19 12H5M12 19l-7-7 7-7\");\nexport const ArrowUpIcon = createIcon(\"M12 19V5M5 12l7-7 7 7\");\nexport const ArrowDownIcon = createIcon(\"M12 5v14M19 12l-7 7-7-7\");\n\nexport const ChevronRightIcon = createIcon(\"M9 18l6-6-6-6\");\nexport const ChevronLeftIcon = createIcon(\"M15 18l-6-6 6-6\");\nexport const ChevronUpIcon = createIcon(\"M18 15l-6-6-6 6\");\nexport const ChevronDownIcon = createIcon(\"M6 9l6 6 6-6\");\n","import React from \"react\";\nimport { colors } from \"../../tokens/colors\";\nimport { spacing } from \"../../tokens/spacing\";\nimport { typography } from \"../../tokens/typography\";\nimport { radii } from \"../../tokens/radii\";\nimport { LockIcon } from \"../Icon\";\n\ntype CheckRowProps = {\n checked: boolean;\n onChange: (checked: boolean) => void;\n label: string;\n sublabel?: string;\n disabled?: boolean;\n locked?: boolean;\n badge?: React.ReactNode;\n right?: React.ReactNode;\n};\n\nexport function CheckRow({\n checked,\n onChange,\n label,\n sublabel,\n disabled = false,\n locked = false,\n badge,\n right,\n}: CheckRowProps) {\n const isInteractive = !disabled && !locked;\n\n const style: React.CSSProperties = {\n display: \"flex\",\n alignItems: \"center\",\n gap: spacing[3],\n padding: `${spacing[3]} ${spacing[4]}`,\n background: checked ? colors.black : colors.cardBg,\n border: `1px solid ${checked ? colors.black : colors.border}`,\n borderRadius: radii.lg,\n cursor: isInteractive ? \"pointer\" : \"default\",\n opacity: disabled ? 0.5 : 1,\n transition: \"background 150ms ease, border-color 150ms ease\",\n fontFamily: typography.fontFamily.base,\n };\n\n const dotStyle: React.CSSProperties = {\n width: \"8px\",\n height: \"8px\",\n borderRadius: radii.full,\n background: checked ? colors.error : colors.textTertiary,\n flexShrink: 0,\n };\n\n const labelStyle: React.CSSProperties = {\n flex: 1,\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"2px\",\n };\n\n const titleStyle: React.CSSProperties = {\n fontSize: typography.size.md,\n fontWeight: typography.weight.semibold,\n color: checked ? colors.textInverse : colors.textPrimary,\n lineHeight: typography.lineHeight.tight,\n };\n\n const subStyle: React.CSSProperties = {\n fontSize: typography.size.sm,\n color: checked ? colors.textTertiary : colors.textSecondary,\n lineHeight: typography.lineHeight.tight,\n };\n\n // Checkbox visual\n const checkboxStyle: React.CSSProperties = {\n width: \"20px\",\n height: \"20px\",\n borderRadius: radii.xs,\n border: checked\n ? \"none\"\n : `1.5px solid ${colors.borderLight}`,\n background: checked ? colors.error : \"transparent\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n flexShrink: 0,\n transition: \"background 150ms ease, border-color 150ms ease\",\n };\n\n return (\n <div\n style={style}\n role=\"checkbox\"\n aria-checked={checked}\n tabIndex={isInteractive ? 0 : -1}\n onClick={() => isInteractive && onChange(!checked)}\n onKeyDown={(e) => {\n if (e.key === \" \" || e.key === \"Enter\") {\n e.preventDefault();\n if (isInteractive) onChange(!checked);\n }\n }}\n onMouseEnter={(e) => {\n if (isInteractive && !checked) {\n e.currentTarget.style.borderColor = colors.borderLight;\n }\n }}\n onMouseLeave={(e) => {\n if (isInteractive && !checked) {\n e.currentTarget.style.borderColor = colors.border;\n }\n }}\n >\n <span style={dotStyle} />\n <div style={labelStyle}>\n <span style={titleStyle}>{label}</span>\n {sublabel && <span style={subStyle}>{sublabel}</span>}\n </div>\n\n {badge && <div>{badge}</div>}\n {right && <div>{right}</div>}\n\n {locked ? (\n <LockIcon size={16} style={{ color: colors.textTertiary }} />\n ) : (\n <div style={checkboxStyle}>\n {checked && (\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\n <path\n d=\"M2.5 6l2.5 2.5 4.5-4.5\"\n stroke={colors.textInverse}\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n )}\n </div>\n )}\n </div>\n );\n}\n","import React from \"react\";\nimport { colors } from \"../../tokens/colors\";\nimport { radii } from \"../../tokens/radii\";\n\ntype StatusDotProps = {\n tone: \"success\" | \"warning\" | \"error\" | \"info\" | \"neutral\";\n size?: \"sm\" | \"md\";\n pulse?: boolean;\n};\n\nconst toneColors = {\n success: colors.success,\n warning: colors.warning,\n error: colors.error,\n info: colors.info,\n neutral: colors.textTertiary,\n} as const;\n\nlet pulseStyleInjected = false;\n\nfunction ensurePulseStyle() {\n if (pulseStyleInjected || typeof document === \"undefined\") return;\n const style = document.createElement(\"style\");\n style.textContent = `@keyframes ol-pulse { 0%, 100% { opacity: 1 } 50% { opacity: 0.4 } }`;\n document.head.appendChild(style);\n pulseStyleInjected = true;\n}\n\nexport const StatusDot = React.memo(function StatusDot({ tone, size = \"md\", pulse = false }: StatusDotProps) {\n if (pulse) ensurePulseStyle();\n\n const px = size === \"sm\" ? \"6px\" : \"8px\";\n\n const style: React.CSSProperties = {\n width: px,\n height: px,\n borderRadius: radii.full,\n backgroundColor: toneColors[tone],\n display: \"inline-block\",\n flexShrink: 0,\n animation: pulse ? \"ol-pulse 1.5s ease-in-out infinite\" : undefined,\n };\n\n return <span style={style} />;\n});\n","import React from \"react\";\nimport { colors } from \"../../tokens/colors\";\nimport { spacing } from \"../../tokens/spacing\";\nimport { typography } from \"../../tokens/typography\";\n\ntype PageHeaderProps = {\n title: string;\n sub?: string;\n action?: React.ReactNode;\n};\n\nexport function PageHeader({ title, sub, action }: PageHeaderProps) {\n const style: React.CSSProperties = {\n display: \"flex\",\n alignItems: \"flex-start\",\n justifyContent: \"space-between\",\n gap: spacing[4],\n marginBottom: spacing[5],\n fontFamily: typography.fontFamily.base,\n };\n\n const textStyle: React.CSSProperties = {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"2px\",\n };\n\n const titleStyle: React.CSSProperties = {\n fontSize: typography.size.xl,\n fontWeight: typography.weight.bold,\n color: colors.textPrimary,\n letterSpacing: typography.letterSpacing.tight,\n lineHeight: typography.lineHeight.tight,\n margin: 0,\n };\n\n const subStyle: React.CSSProperties = {\n fontSize: typography.size.base,\n color: colors.textSecondary,\n margin: 0,\n };\n\n return (\n <div style={style}>\n <div style={textStyle}>\n <h2 style={titleStyle}>{title}</h2>\n {sub && <p style={subStyle}>{sub}</p>}\n </div>\n {action && <div style={{ flexShrink: 0 }}>{action}</div>}\n </div>\n );\n}\n","import React from \"react\";\nimport { colors } from \"../../tokens/colors\";\nimport { spacing } from \"../../tokens/spacing\";\nimport { typography } from \"../../tokens/typography\";\n\ntype ActionItem = {\n text: string;\n tone?: \"error\" | \"warning\" | \"info\" | \"neutral\";\n};\n\ntype ActionListProps = {\n items: ActionItem[];\n};\n\nconst toneColors = {\n error: colors.error,\n warning: colors.warning,\n info: colors.info,\n neutral: colors.textTertiary,\n} as const;\n\nexport function ActionList({ items }: ActionListProps) {\n const listStyle: React.CSSProperties = {\n display: \"flex\",\n flexDirection: \"column\",\n gap: spacing[3],\n fontFamily: typography.fontFamily.base,\n };\n\n return (\n <div style={listStyle}>\n {items.map((item, i) => {\n const dotColor = toneColors[item.tone || \"neutral\"];\n\n return (\n <div\n key={i}\n style={{\n display: \"flex\",\n alignItems: \"flex-start\",\n gap: spacing[3],\n }}\n >\n <span\n style={{\n width: \"8px\",\n height: \"8px\",\n borderRadius: \"50%\",\n background: dotColor,\n flexShrink: 0,\n marginTop: \"5px\",\n }}\n />\n <span\n style={{\n fontSize: typography.size.base,\n color: colors.textPrimary,\n lineHeight: typography.lineHeight.relaxed,\n }}\n >\n {item.text}\n </span>\n </div>\n );\n })}\n </div>\n );\n}\n","import React, { useEffect, useState } from \"react\";\nimport { colors } from \"../../tokens/colors\";\nimport { spacing } from \"../../tokens/spacing\";\nimport { typography } from \"../../tokens/typography\";\nimport { radii } from \"../../tokens/radii\";\nimport { shadows } from \"../../tokens/shadows\";\nimport { CheckIcon, XIcon, AlertIcon, InfoIcon } from \"../Icon\";\n\ntype ToastTone = \"success\" | \"error\" | \"warning\" | \"info\" | \"neutral\";\n\ntype ToastProps = {\n open: boolean;\n onClose: () => void;\n message: string;\n tone?: ToastTone;\n duration?: number;\n action?: { label: string; onClick: () => void };\n};\n\nconst toneConfig = {\n success: { IconComponent: CheckIcon, bg: colors.cardBg, accent: colors.success },\n error: { IconComponent: XIcon, bg: colors.cardBg, accent: colors.error },\n warning: { IconComponent: AlertIcon, bg: colors.cardBg, accent: colors.warning },\n info: { IconComponent: InfoIcon, bg: colors.cardBg, accent: colors.info },\n neutral: { IconComponent: InfoIcon, bg: colors.cardBg, accent: colors.textTertiary },\n} as const;\n\nexport function Toast({\n open,\n onClose,\n message,\n tone = \"neutral\",\n duration = 4000,\n action,\n}: ToastProps) {\n const [visible, setVisible] = useState(false);\n\n // Slide-in animation\n useEffect(() => {\n if (!open) {\n setVisible(false);\n return;\n }\n const id = requestAnimationFrame(() => setVisible(true));\n return () => cancelAnimationFrame(id);\n }, [open]);\n\n // Auto-dismiss\n useEffect(() => {\n if (!open || duration <= 0) return;\n const timer = setTimeout(onClose, duration);\n return () => clearTimeout(timer);\n }, [open, duration, onClose]);\n\n if (!open) return null;\n\n const config = toneConfig[tone];\n\n const containerStyle: React.CSSProperties = {\n position: \"fixed\",\n bottom: \"20px\",\n left: \"50%\",\n transform: visible\n ? \"translateX(-50%) translateY(0)\"\n : \"translateX(-50%) translateY(16px)\",\n opacity: visible ? 1 : 0,\n transition: \"opacity 0.18s ease, transform 0.18s ease\",\n zIndex: 200,\n pointerEvents: \"auto\",\n };\n\n const cardStyle: React.CSSProperties = {\n display: \"flex\",\n alignItems: \"center\",\n gap: spacing[3],\n padding: `${spacing[3]} ${spacing[4]}`,\n background: config.bg,\n borderRadius: radii.lg,\n boxShadow: shadows.lg,\n border: `1px solid ${colors.border}`,\n fontFamily: typography.fontFamily.base,\n maxWidth: \"480px\",\n minWidth: \"280px\",\n };\n\n const iconStyle: React.CSSProperties = {\n width: \"22px\",\n height: \"22px\",\n borderRadius: radii.full,\n background: config.accent,\n color: colors.textInverse,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontSize: \"12px\",\n fontWeight: typography.weight.bold,\n flexShrink: 0,\n lineHeight: 1,\n };\n\n const messageStyle: React.CSSProperties = {\n flex: 1,\n fontSize: typography.size.base,\n color: colors.textPrimary,\n lineHeight: typography.lineHeight.snug,\n };\n\n const actionStyle: React.CSSProperties = {\n fontSize: typography.size.base,\n fontWeight: typography.weight.semibold,\n color: config.accent,\n background: \"none\",\n border: \"none\",\n cursor: \"pointer\",\n padding: 0,\n whiteSpace: \"nowrap\",\n textDecoration: \"underline\",\n textUnderlineOffset: \"2px\",\n fontFamily: typography.fontFamily.base,\n };\n\n const closeStyle: React.CSSProperties = {\n width: \"24px\",\n height: \"24px\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n border: \"none\",\n borderRadius: radii.xs,\n cursor: \"pointer\",\n color: colors.textTertiary,\n flexShrink: 0,\n };\n\n const IconComp = config.IconComponent;\n\n return (\n <div style={containerStyle}>\n <div style={cardStyle}>\n <span style={iconStyle}>\n <IconComp size={14} />\n </span>\n <span style={messageStyle}>{message}</span>\n {action && (\n <button style={actionStyle} onClick={action.onClick}>\n {action.label}\n </button>\n )}\n <button\n style={closeStyle}\n onClick={onClose}\n aria-label=\"Dismiss\"\n onMouseEnter={(e) => { e.currentTarget.style.background = colors.pageBg; }}\n onMouseLeave={(e) => { e.currentTarget.style.background = \"transparent\"; }}\n >\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 12 12\" fill=\"none\">\n <path d=\"M1 1l10 10M11 1L1 11\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" />\n </svg>\n </button>\n </div>\n </div>\n );\n}\n","import React from \"react\";\nimport { colors } from \"../../tokens/colors\";\nimport { typography } from \"../../tokens/typography\";\nimport { radii } from \"../../tokens/radii\";\nimport { spacing } from \"../../tokens/spacing\";\n\nexport const CodeChip = React.memo(function CodeChip({ children }: { children: React.ReactNode }) {\n const style: React.CSSProperties = {\n fontFamily: typography.fontFamily.mono,\n fontSize: typography.size.sm,\n backgroundColor: colors.bgSubtle,\n color: colors.textDark,\n padding: `2px ${spacing[2]}`,\n borderRadius: radii.md,\n border: `1px solid ${colors.border}`,\n display: \"inline-flex\",\n alignItems: \"center\",\n };\n return <span style={style}>{children}</span>;\n});\n","import React from \"react\";\nimport { colors } from \"../../tokens/colors\";\nimport { typography } from \"../../tokens/typography\";\nimport { spacing } from \"../../tokens/spacing\";\nimport { CodeChip } from \"../CodeChip\";\n\nexport type DiffType = \"added\" | \"modified\" | \"destructive\" | \"safe\";\n\nexport type DiffRowProps = {\n title: string;\n handle: string;\n field: string;\n csvVal: string;\n storeVal: string;\n type: DiffType;\n note?: string;\n};\n\nconst typeColors = {\n added: colors.success,\n modified: colors.warning,\n destructive: colors.error,\n safe: colors.textTertiary,\n};\n\nconst typeBg = {\n added: colors.successBg,\n modified: colors.warningBg,\n destructive: colors.errorBg,\n safe: colors.bgSubtle, // slightly grey for unchanged/safe\n};\n\nexport function DiffRow({ title, handle, field, csvVal, storeVal, type, note }: DiffRowProps) {\n const rowStyle: React.CSSProperties = {\n display: \"grid\",\n gridTemplateColumns: \"2fr 1fr 1.5fr 1.5fr 1fr\",\n gap: spacing[4],\n padding: spacing[4],\n backgroundColor: typeBg[type],\n borderLeft: `4px solid ${typeColors[type]}`,\n borderBottom: `1px solid ${colors.border}`,\n fontFamily: typography.fontFamily.base,\n alignItems: \"start\",\n };\n\n const textStyle: React.CSSProperties = {\n fontSize: typography.size.md,\n color: colors.textPrimary,\n margin: 0,\n };\n \n const subTextStyle: React.CSSProperties = {\n fontSize: typography.size.sm,\n color: colors.textSecondary,\n fontFamily: typography.fontFamily.mono,\n marginTop: spacing[1],\n marginBottom: 0,\n };\n\n return (\n <div style={rowStyle}>\n <div>\n <p style={{ ...textStyle, fontWeight: typography.weight.bold }}>{title}</p>\n <p style={subTextStyle}>{handle}</p>\n </div>\n <div>\n <CodeChip>{field}</CodeChip>\n </div>\n <div>\n <p style={{ ...textStyle, color: csvVal ? colors.textPrimary : colors.error }}>\n {csvVal || \"(blank)\"}\n </p>\n </div>\n <div>\n <p style={{ ...textStyle, color: colors.textTertiary }}>{storeVal || \"—\"}</p>\n </div>\n <div>\n <div style={{ display: \"flex\", alignItems: \"center\", gap: spacing[2] }}>\n <span style={{ width: 8, height: 8, borderRadius: \"50%\", backgroundColor: typeColors[type] }} />\n <span style={{ fontSize: typography.size.sm, fontWeight: typography.weight.semibold, color: typeColors[type] }}>\n {type === \"added\" ? \"New\" : type === \"safe\" ? \"Unchanged\" : type.charAt(0).toUpperCase() + type.slice(1)}\n </span>\n </div>\n {note && (\n <p style={{ fontSize: typography.size.xs, color: typeColors[type], marginTop: spacing[1], marginBottom: 0 }}>\n ⚠ {note}\n </p>\n )}\n </div>\n </div>\n );\n}\n","import React, { useState } from \"react\";\nimport { colors } from \"../../tokens/colors\";\nimport { spacing } from \"../../tokens/spacing\";\nimport { typography } from \"../../tokens/typography\";\nimport { radii } from \"../../tokens/radii\";\nimport { Badge } from \"../Badge\";\nimport { CodeChip } from \"../CodeChip\";\nimport { Button } from \"../Button\";\n\nexport type IssueCardProps = {\n severity: \"error\" | \"warning\" | \"info\";\n field: string;\n rowCount: number;\n message: string;\n fixable: boolean;\n onFix?: () => void;\n};\n\nexport function IssueCard({ severity, field, rowCount, message, fixable, onFix }: IssueCardProps) {\n const [expanded, setExpanded] = useState(false);\n\n const severityMap = {\n error: { tone: \"error\" as const, outline: colors.error },\n warning: { tone: \"warning\" as const, outline: colors.warning },\n info: { tone: \"info\" as const, outline: colors.info },\n };\n \n const s = severityMap[severity];\n\n const cardStyle: React.CSSProperties = {\n padding: spacing[4],\n borderBottom: `1px solid ${colors.borderSubtle}`,\n fontFamily: typography.fontFamily.base,\n display: \"flex\",\n flexDirection: \"column\",\n gap: spacing[3],\n backgroundColor: colors.white,\n };\n\n const headerRowStyle: React.CSSProperties = {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n };\n\n const leftGroupStyle: React.CSSProperties = {\n display: \"flex\",\n alignItems: \"center\",\n gap: spacing[3],\n flexWrap: \"wrap\",\n };\n \n const outlineBadgeStyle: React.CSSProperties = {\n border: `1px solid ${s.outline}`,\n color: s.outline,\n padding: `2px ${spacing[2]}`,\n borderRadius: radii.full,\n fontSize: typography.size.xs,\n fontWeight: typography.weight.medium,\n backgroundColor: \"transparent\",\n };\n\n return (\n <div style={cardStyle}>\n <div style={headerRowStyle}>\n <div style={leftGroupStyle}>\n <Badge tone={s.tone} dot>\n {severity.charAt(0).toUpperCase() + severity.slice(1)}\n </Badge>\n <CodeChip>{field}</CodeChip>\n <span style={outlineBadgeStyle}>{rowCount.toLocaleString()} rows affected</span>\n </div>\n <div>\n {fixable ? (\n <Button variant=\"primary\" size=\"sm\" onClick={onFix}>\n Auto-Fix\n </Button>\n ) : (\n <span style={{ fontSize: typography.size.sm, color: colors.textTertiary }}>\n Manual fix\n </span>\n )}\n </div>\n </div>\n \n <p style={{ margin: 0, fontSize: typography.size.md, color: colors.textDark }}>\n {message}\n </p>\n \n <div>\n <button \n onClick={() => setExpanded(!expanded)}\n style={{\n background: \"none\",\n border: \"none\",\n padding: 0,\n color: colors.textSecondary,\n fontSize: typography.size.sm,\n cursor: \"pointer\",\n textDecoration: \"underline\",\n fontFamily: typography.fontFamily.base,\n }}\n >\n {expanded ? \"Hide sample rows ▲\" : \"View sample rows ▼\"}\n </button>\n </div>\n \n {expanded && (\n <div style={{ display: \"flex\", gap: spacing[2], marginTop: spacing[1], flexWrap: \"wrap\" }}>\n {[1, 2, 3].map(row => (\n <span key={row} style={{ \n fontSize: typography.size.xs, \n border: `1px solid ${colors.border}`,\n padding: `2px ${spacing[2]}`,\n borderRadius: radii.full,\n color: colors.textSecondary\n }}>\n row {row}\n </span>\n ))}\n {rowCount > 3 && (\n <span style={{ fontSize: typography.size.xs, color: colors.textTertiary, alignSelf: \"center\" }}>\n + {rowCount - 3} more\n </span>\n )}\n </div>\n )}\n </div>\n );\n}\n","import React, { useState } from \"react\";\nimport { colors } from \"../../tokens/colors\";\nimport { typography } from \"../../tokens/typography\";\nimport { spacing } from \"../../tokens/spacing\";\nimport { radii } from \"../../tokens/radii\";\nimport { IssueCard, type IssueCardProps } from \"../IssueCard\";\n\nexport type IssueGroupProps = {\n category: string;\n issues: IssueCardProps[];\n defaultOpen?: boolean;\n};\n\nexport function IssueGroup({ category, issues, defaultOpen = true }: IssueGroupProps) {\n const [isOpen, setIsOpen] = useState(defaultOpen);\n \n const hasError = issues.some(i => i.severity === \"error\");\n const hasWarning = issues.some(i => i.severity === \"warning\");\n const dotColor = hasError ? colors.error : hasWarning ? colors.warning : colors.info;\n\n const totalRows = issues.reduce((acc, issue) => acc + issue.rowCount, 0);\n\n const containerStyle: React.CSSProperties = {\n backgroundColor: colors.cardBg,\n borderRadius: radii.lg,\n border: `1px solid ${colors.border}`,\n marginBottom: spacing[4],\n overflow: \"hidden\",\n fontFamily: typography.fontFamily.base,\n };\n\n const headerStyle: React.CSSProperties = {\n padding: spacing[4],\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n cursor: \"pointer\",\n backgroundColor: colors.cardBg,\n borderBottom: isOpen ? `1px solid ${colors.border}` : \"none\",\n userSelect: \"none\",\n };\n\n const titleGroupStyle: React.CSSProperties = {\n display: \"flex\",\n alignItems: \"center\",\n gap: spacing[3],\n };\n\n const dotStyle: React.CSSProperties = {\n width: 8,\n height: 8,\n borderRadius: \"50%\",\n backgroundColor: dotColor,\n flexShrink: 0,\n };\n \n const countBadgeStyle: React.CSSProperties = {\n backgroundColor: colors.bgSubtle,\n border: `1px solid ${colors.border}`,\n borderRadius: radii.full,\n padding: `2px ${spacing[3]}`,\n fontSize: typography.size.sm,\n color: colors.textSecondary,\n fontWeight: typography.weight.medium,\n };\n\n return (\n <div style={containerStyle}>\n <div style={headerStyle} onClick={() => setIsOpen(!isOpen)}>\n <div style={titleGroupStyle}>\n <span style={dotStyle} />\n <span style={{ fontSize: typography.size.lg, fontWeight: typography.weight.bold, color: colors.textPrimary }}>\n {category}\n </span>\n </div>\n <div style={{ display: \"flex\", alignItems: \"center\", gap: spacing[3] }}>\n <span style={countBadgeStyle}>{totalRows.toLocaleString()} rows</span>\n <span style={{ \n color: colors.textTertiary, \n transform: isOpen ? \"rotate(180deg)\" : \"none\", \n transition: \"transform 200ms ease\",\n fontSize: \"12px\"\n }}>\n ▼\n </span>\n </div>\n </div>\n \n {isOpen && (\n <div style={{ display: \"flex\", flexDirection: \"column\" }}>\n {issues.map((issue, idx) => (\n <div key={idx} style={{ \n borderBottom: idx === issues.length - 1 ? \"none\" : `1px solid ${colors.borderSubtle}` \n }}>\n <IssueCard {...issue} />\n </div>\n ))}\n </div>\n )}\n </div>\n );\n}\n","import React from \"react\";\nimport { colors } from \"../../tokens/colors\";\nimport { typography } from \"../../tokens/typography\";\nimport { radii } from \"../../tokens/radii\";\nimport { spacing } from \"../../tokens/spacing\";\n\nexport type MiniStatProps = {\n value: string | React.ReactNode;\n label: string;\n tone?: \"success\" | \"error\" | \"neutral\" | \"info\";\n};\n\nexport const MiniStat = React.memo(function MiniStat({ value, label, tone = \"neutral\" }: MiniStatProps) {\n const toneMap = {\n success: { border: colors.successBorder, color: colors.success },\n error: { border: colors.errorBorder, color: colors.error },\n info: { border: colors.infoBorder, color: colors.info },\n neutral: { border: colors.border, color: colors.textPrimary },\n };\n\n const t = toneMap[tone];\n\n const containerStyle: React.CSSProperties = {\n display: \"flex\",\n flexDirection: \"column\",\n gap: spacing[1],\n padding: spacing[4],\n borderRadius: radii.lg,\n border: `1px solid ${t.border}`,\n backgroundColor: colors.white,\n fontFamily: typography.fontFamily.base,\n minWidth: \"120px\",\n flex: 1,\n };\n\n const valueStyle: React.CSSProperties = {\n fontSize: typography.size[\"2xl\"],\n fontWeight: typography.weight.bold,\n color: t.color,\n margin: 0,\n lineHeight: 1,\n };\n\n const labelStyle: React.CSSProperties = {\n fontSize: typography.size.sm,\n color: tone === \"neutral\" ? colors.textSecondary : t.color,\n margin: 0,\n marginTop: spacing[1],\n };\n\n return (\n <div style={containerStyle}>\n <div style={valueStyle}>{value}</div>\n <div style={labelStyle}>{label}</div>\n </div>\n );\n});\n","import React from \"react\";\nimport { colors } from \"../../tokens/colors\";\nimport { typography } from \"../../tokens/typography\";\nimport { spacing } from \"../../tokens/spacing\";\nimport { radii } from \"../../tokens/radii\";\n\nexport type ModelTagProps = {\n name: string;\n};\n\nexport const ModelTag = React.memo(function ModelTag({ name }: ModelTagProps) {\n const style: React.CSSProperties = {\n display: \"inline-flex\",\n alignItems: \"center\",\n padding: `2px ${spacing[3]}`,\n backgroundColor: colors.neutralBg,\n color: colors.textDark,\n fontSize: typography.size.xs,\n fontFamily: typography.fontFamily.base,\n fontWeight: typography.weight.medium,\n borderRadius: radii.full,\n whiteSpace: \"nowrap\",\n };\n\n return <span style={style}>{name}</span>;\n});\n","import React from \"react\";\nimport { colors } from \"../../tokens/colors\";\nimport { radii } from \"../../tokens/radii\";\n\nexport type ProgressBarProps = {\n percent: number;\n height?: number;\n};\n\nexport const ProgressBar = React.memo(function ProgressBar({ percent, height = 8 }: ProgressBarProps) {\n const trackStyle: React.CSSProperties = {\n width: \"100%\",\n backgroundColor: colors.borderSubtle,\n borderRadius: radii.full,\n height: `${height}px`,\n overflow: \"hidden\",\n };\n\n const fillStyle: React.CSSProperties = {\n width: `${Math.max(0, Math.min(100, percent))}%`,\n backgroundColor: colors.black,\n height: \"100%\",\n transition: \"width 300ms ease\",\n };\n\n return (\n <div style={trackStyle} role=\"progressbar\" aria-valuenow={percent} aria-valuemin={0} aria-valuemax={100}>\n <div style={fillStyle} />\n </div>\n );\n});\n","import React from \"react\";\nimport { colors } from \"../../tokens/colors\";\nimport { typography } from \"../../tokens/typography\";\nimport { spacing } from \"../../tokens/spacing\";\nimport { radii } from \"../../tokens/radii\";\n\nexport type ProgressStep = {\n id: string;\n label: string;\n status: \"pending\" | \"running\" | \"done\";\n value?: React.ReactNode;\n};\n\nexport type ProgressListProps = {\n steps: ProgressStep[];\n};\n\nexport function ProgressList({ steps }: ProgressListProps) {\n const containerStyle: React.CSSProperties = {\n display: \"flex\",\n flexDirection: \"column\",\n gap: spacing[4],\n fontFamily: typography.fontFamily.base,\n };\n\n return (\n <div style={containerStyle}>\n {steps.map((step) => {\n const isPending = step.status === \"pending\";\n const isRunning = step.status === \"running\";\n const isDone = step.status === \"done\";\n\n const rowStyle: React.CSSProperties = {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n opacity: isPending ? 0.4 : 1,\n };\n\n const leftStyle: React.CSSProperties = {\n display: \"flex\",\n alignItems: \"center\",\n gap: spacing[3],\n };\n\n const iconContainerStyle: React.CSSProperties = {\n width: \"20px\",\n height: \"20px\",\n borderRadius: radii.full,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n backgroundColor: isDone ? colors.success : isRunning ? colors.black : colors.borderLight,\n color: colors.white,\n flexShrink: 0,\n };\n\n return (\n <div key={step.id} style={rowStyle}>\n <div style={leftStyle}>\n <div style={iconContainerStyle}>\n {isDone && (\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 14 14\" fill=\"none\">\n <path d=\"M2.5 7.5L5.5 10.5L11.5 3.5\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n </svg>\n )}\n {isRunning && (\n <div style={{ width: 6, height: 6, backgroundColor: colors.white, borderRadius: \"50%\" }} />\n )}\n </div>\n <span style={{ \n fontSize: typography.size.md, \n color: colors.textPrimary, \n fontWeight: isRunning ? typography.weight.semibold : typography.weight.normal \n }}>\n {step.label}\n </span>\n </div>\n {step.value && (\n <span style={{ \n fontSize: typography.size.sm, \n color: isDone ? colors.success : colors.textTertiary \n }}>\n {step.value}\n </span>\n )}\n </div>\n );\n })}\n </div>\n );\n}\n","import React, { useState } from \"react\";\nimport { colors } from \"../../tokens/colors\";\nimport { spacing } from \"../../tokens/spacing\";\nimport { typography } from \"../../tokens/typography\";\nimport { radii } from \"../../tokens/radii\";\nimport { shadows } from \"../../tokens/shadows\";\n\nexport type RadioProps = {\n checked: boolean;\n onChange: (checked: boolean) => void;\n value?: string;\n name?: string;\n disabled?: boolean;\n label?: string;\n description?: string;\n id?: string;\n};\n\nexport function Radio({\n checked,\n onChange,\n value,\n name,\n disabled = false,\n label,\n description,\n id,\n}: RadioProps) {\n const [isFocused, setIsFocused] = useState(false);\n const [isHovered, setIsHovered] = useState(false);\n\n const generatedId = React.useId();\n const radioId = id || generatedId;\n\n const wrapperStyle: React.CSSProperties = {\n display: \"flex\",\n alignItems: \"flex-start\",\n gap: spacing[3],\n opacity: disabled ? 0.5 : 1,\n cursor: disabled ? \"not-allowed\" : \"pointer\",\n fontFamily: typography.fontFamily.base,\n };\n\n const outerCircleStyle: React.CSSProperties = {\n position: \"relative\",\n width: \"18px\",\n height: \"18px\",\n borderRadius: radii.full,\n border: `1px solid ${checked ? colors.black : isHovered && !disabled ? colors.textTertiary : colors.borderLight}`,\n backgroundColor: colors.white,\n transition: \"border-color 150ms ease, box-shadow 150ms ease\",\n flexShrink: 0,\n boxShadow: isFocused ? shadows.focus : \"none\",\n outline: \"none\",\n marginTop: \"1px\", // Optical alignment\n };\n\n const innerDotStyle: React.CSSProperties = {\n position: \"absolute\",\n top: \"50%\",\n left: \"50%\",\n transform: `translate(-50%, -50%) scale(${checked ? 1 : 0})`,\n width: \"10px\",\n height: \"10px\",\n borderRadius: radii.full,\n backgroundColor: colors.black,\n transition: \"transform 150ms ease\",\n };\n\n const textWrapperStyle: React.CSSProperties = {\n display: \"flex\",\n flexDirection: \"column\",\n gap: spacing[1],\n };\n\n const labelStyle: React.CSSProperties = {\n fontSize: typography.size.md,\n fontWeight: typography.weight.medium,\n color: colors.textPrimary,\n margin: 0,\n cursor: disabled ? \"not-allowed\" : \"pointer\",\n };\n\n const descStyle: React.CSSProperties = {\n fontSize: typography.size.sm,\n color: colors.textSecondary,\n margin: 0,\n };\n\n // Hidden native radio button for accessibility and forms\n const inputStyle: React.CSSProperties = {\n position: \"absolute\",\n opacity: 0,\n width: 0,\n height: 0,\n margin: 0,\n };\n\n return (\n <label\n style={wrapperStyle}\n htmlFor={radioId}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n <div style={{ position: \"relative\" }}>\n <input\n id={radioId}\n type=\"radio\"\n name={name}\n value={value}\n checked={checked}\n disabled={disabled}\n onChange={(e) => {\n if (!disabled) {\n onChange(e.target.checked);\n }\n }}\n onFocus={() => setIsFocused(true)}\n onBlur={() => setIsFocused(false)}\n style={inputStyle}\n />\n <div style={outerCircleStyle} aria-hidden=\"true\">\n <div style={innerDotStyle} />\n </div>\n </div>\n\n {(label || description) && (\n <div style={textWrapperStyle}>\n {label && <span style={labelStyle}>{label}</span>}\n {description && <span style={descStyle}>{description}</span>}\n </div>\n )}\n </label>\n );\n}\n","import React from \"react\";\nimport { colors } from \"../../tokens/colors\";\nimport { typography } from \"../../tokens/typography\";\n\nexport type StepBarProps = {\n steps: string[];\n current: number; // 1-indexed\n};\n\nexport function StepBar({ steps, current }: StepBarProps) {\n const containerStyle: React.CSSProperties = {\n display: \"flex\",\n justifyContent: \"space-between\",\n width: \"100%\",\n fontFamily: typography.fontFamily.base,\n position: \"relative\",\n };\n\n const circleSize = 32;\n\n const backgroundLineStyle: React.CSSProperties = {\n position: \"absolute\",\n top: circleSize / 2 - 1, // center vertically with circles\n left: circleSize / 2,\n right: circleSize / 2,\n height: 2,\n backgroundColor: colors.border,\n zIndex: 1,\n };\n\n const progressLineStyle: React.CSSProperties = {\n height: \"100%\",\n width: `${((Math.min(current, steps.length) - 1) / (steps.length - 1)) * 100}%`,\n backgroundColor: colors.black,\n transition: \"width 300ms ease\",\n };\n\n return (\n <div style={containerStyle}>\n <div style={backgroundLineStyle}>\n <div style={progressLineStyle} />\n </div>\n \n {steps.map((step, index) => {\n const stepNum = index + 1;\n const isCompleted = stepNum < current;\n const isActive = stepNum === current;\n \n const circleStyle: React.CSSProperties = {\n width: circleSize,\n height: circleSize,\n borderRadius: \"50%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontSize: typography.size.md,\n fontWeight: typography.weight.semibold,\n backgroundColor: isCompleted || isActive ? colors.black : colors.white,\n color: isCompleted || isActive ? colors.white : colors.textTertiary,\n border: isCompleted || isActive ? `2px solid ${colors.black}` : `2px solid ${colors.border}`,\n zIndex: 2,\n position: \"relative\",\n transition: \"all 300ms ease\",\n };\n \n const labelStyle: React.CSSProperties = {\n position: \"absolute\",\n top: circleSize + 8,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n fontSize: typography.size.sm,\n color: isActive || isCompleted ? colors.textPrimary : colors.textTertiary,\n fontWeight: isActive ? typography.weight.semibold : typography.weight.normal,\n whiteSpace: \"nowrap\",\n };\n\n const stepContainerStyle: React.CSSProperties = {\n position: \"relative\",\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n };\n\n return (\n <div key={step} style={stepContainerStyle}>\n <div style={circleStyle}>\n {isCompleted ? (\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" fill=\"none\">\n <path d=\"M2.5 7.5L5.5 10.5L11.5 3.5\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n </svg>\n ) : (\n stepNum\n )}\n </div>\n <span style={labelStyle}>{step}</span>\n </div>\n );\n })}\n </div>\n );\n}\n","import React from \"react\";\nimport { colors } from \"../../tokens/colors\";\nimport { typography } from \"../../tokens/typography\";\nimport { radii } from \"../../tokens/radii\";\nimport { spacing } from \"../../tokens/spacing\";\n\nexport type SummaryCardProps = {\n label: string;\n value: string | number;\n highlight?: boolean;\n color?: string; // e.g., colors.error\n};\n\nexport const SummaryCard = React.memo(function SummaryCard({ label, value, highlight = false, color }: SummaryCardProps) {\n const cardStyle: React.CSSProperties = {\n backgroundColor: highlight ? colors.black : colors.white,\n border: highlight ? \"none\" : `1px solid ${colors.border}`,\n borderRadius: radii.lg,\n padding: spacing[5],\n display: \"flex\",\n flexDirection: \"column\",\n gap: spacing[2],\n fontFamily: typography.fontFamily.base,\n flex: 1,\n minWidth: 0, // prevents overflow in flex contexts\n };\n \n const labelStyle: React.CSSProperties = {\n fontSize: typography.size.sm,\n color: highlight ? colors.textDisabled : colors.textSecondary,\n fontWeight: typography.weight.semibold,\n textTransform: \"uppercase\",\n letterSpacing: \"0.05em\",\n margin: 0,\n };\n \n const valueStyle: React.CSSProperties = {\n fontSize: typography.size[\"3xl\"],\n fontWeight: typography.weight.bold,\n color: highlight ? colors.white : (color || colors.textPrimary),\n margin: 0,\n lineHeight: 1,\n };\n\n return (\n <div style={cardStyle}>\n <p style={labelStyle}>{label}</p>\n <p style={valueStyle}>{value}</p>\n </div>\n );\n});\n","import React, { useState } from \"react\";\nimport { colors } from \"../../tokens/colors\";\nimport { spacing } from \"../../tokens/spacing\";\nimport { typography } from \"../../tokens/typography\";\nimport { radii } from \"../../tokens/radii\";\nimport { shadows } from \"../../tokens/shadows\";\n\nexport type SwitchProps = {\n checked: boolean;\n onChange: (checked: boolean) => void;\n disabled?: boolean;\n label?: string;\n description?: string;\n id?: string;\n};\n\nexport function Switch({ checked, onChange, disabled = false, label, description, id }: SwitchProps) {\n const [isFocused, setIsFocused] = useState(false);\n\n const generatedId = React.useId();\n const switchId = id || generatedId;\n\n const wrapperStyle: React.CSSProperties = {\n display: \"flex\",\n alignItems: \"flex-start\",\n gap: spacing[3],\n opacity: disabled ? 0.5 : 1,\n cursor: disabled ? \"not-allowed\" : \"pointer\",\n fontFamily: typography.fontFamily.base,\n };\n\n const trackStyle: React.CSSProperties = {\n position: \"relative\",\n width: \"36px\",\n height: \"20px\",\n backgroundColor: checked ? colors.black : colors.borderLight,\n borderRadius: radii.full,\n transition: \"background-color 200ms ease\",\n flexShrink: 0,\n boxShadow: isFocused ? shadows.focus : \"none\",\n outline: \"none\",\n };\n\n const thumbStyle: React.CSSProperties = {\n position: \"absolute\",\n top: \"2px\",\n left: checked ? \"calc(100% - 18px)\" : \"2px\",\n width: \"16px\",\n height: \"16px\",\n backgroundColor: colors.white,\n borderRadius: radii.full,\n transition: \"left 200ms ease, transform 200ms ease\",\n boxShadow: shadows.sm,\n };\n\n const textWrapperStyle: React.CSSProperties = {\n display: \"flex\",\n flexDirection: \"column\",\n gap: spacing[1],\n marginTop: \"1px\", // Optical alignment with switch thumb\n };\n\n const labelStyle: React.CSSProperties = {\n fontSize: typography.size.md,\n fontWeight: typography.weight.medium,\n color: colors.textPrimary,\n margin: 0,\n cursor: disabled ? \"not-allowed\" : \"pointer\",\n };\n\n const descStyle: React.CSSProperties = {\n fontSize: typography.size.sm,\n color: colors.textSecondary,\n margin: 0,\n };\n\n const handleKeyDown = (e: React.KeyboardEvent) => {\n if (e.key === \" \" || e.key === \"Enter\") {\n e.preventDefault();\n if (!disabled) {\n onChange(!checked);\n }\n }\n };\n\n return (\n <label\n style={wrapperStyle}\n htmlFor={switchId}\n onMouseEnter={() => {\n if (!disabled && !checked) {\n // subtle hover could be added via ref, but sticking to inline\n }\n }}\n >\n <div\n id={switchId}\n role=\"switch\"\n aria-checked={checked}\n aria-disabled={disabled}\n tabIndex={disabled ? -1 : 0}\n onKeyDown={handleKeyDown}\n onFocus={() => setIsFocused(true)}\n onBlur={() => setIsFocused(false)}\n onClick={(e) => {\n // Prevent double firing when label is clicked\n e.preventDefault();\n if (!disabled) onChange(!checked);\n }}\n style={trackStyle}\n >\n <div style={thumbStyle} />\n </div>\n\n {(label || description) && (\n <div style={textWrapperStyle}>\n {label && <span style={labelStyle}>{label}</span>}\n {description && <span style={descStyle}>{description}</span>}\n </div>\n )}\n </label>\n );\n}\n","import React from \"react\";\nimport { colors } from \"../../tokens/colors\";\nimport { typography } from \"../../tokens/typography\";\nimport { spacing } from \"../../tokens/spacing\";\n\nexport type TrendProps = {\n value: number;\n label?: string;\n suffix?: string;\n inverse?: boolean;\n};\n\nexport const Trend = React.memo(function Trend({ value, label, suffix, inverse = false }: TrendProps) {\n const isPositive = value > 0;\n const isNeutral = value === 0;\n\n let color: string = colors.textTertiary;\n if (!isNeutral) {\n if (isPositive) color = inverse ? colors.error : colors.success;\n else color = inverse ? colors.success : colors.error;\n }\n\n const arrow = isPositive ? \"\\u2191\" : isNeutral ? \"\\u2014\" : \"\\u2193\";\n const displayValue = isNeutral ? \"\" : `${isPositive ? \"+\" : \"\"}${value}${suffix ?? \"\"}`;\n\n const style: React.CSSProperties = {\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: spacing[1],\n color,\n fontSize: typography.size.sm,\n fontWeight: typography.weight.medium,\n fontFamily: typography.fontFamily.base,\n };\n\n return (\n <span style={style}>\n <span>{arrow} {displayValue}</span>\n {label && <span style={{ color: colors.textSecondary, fontWeight: typography.weight.normal, marginLeft: spacing[1] }}>{label}</span>}\n </span>\n );\n});\n","import { useState, useCallback } from \"react\";\n\n/**\n * Hook to manage modal open/close state.\n *\n * @example\n * const { isOpen, open, close, toggle } = useModal();\n * <Button onClick={open}>Open</Button>\n * <Modal open={isOpen} onClose={close}>...</Modal>\n */\nexport function useModal(initialState = false) {\n const [isOpen, setIsOpen] = useState(initialState);\n\n const open = useCallback(() => setIsOpen(true), []);\n const close = useCallback(() => setIsOpen(false), []);\n const toggle = useCallback(() => setIsOpen((prev) => !prev), []);\n\n return { isOpen, open, close, toggle } as const;\n}\n","import { useState, useCallback } from \"react\";\n\n/**\n * Typed localStorage wrapper with SSR safety.\n *\n * @example\n * const [tab, setTab] = useLocalStorage<string>(\"active-tab\", \"Overview\");\n */\nexport function useLocalStorage<T>(\n key: string,\n initialValue: T\n): [T, (value: T | ((prev: T) => T)) => void] {\n const [storedValue, setStoredValue] = useState<T>(() => {\n if (typeof window === \"undefined\") return initialValue;\n try {\n const item = window.localStorage.getItem(key);\n return item ? (JSON.parse(item) as T) : initialValue;\n } catch {\n return initialValue;\n }\n });\n\n const setValue = useCallback(\n (value: T | ((prev: T) => T)) => {\n setStoredValue((prev) => {\n const nextValue =\n value instanceof Function ? value(prev) : value;\n try {\n window.localStorage.setItem(key, JSON.stringify(nextValue));\n } catch {\n // Storage full or unavailable — fail silently\n }\n return nextValue;\n });\n },\n [key]\n );\n\n return [storedValue, setValue];\n}\n","/**\n * Utility for conditionally joining class names.\n * Filters out falsy values and joins the rest with a space.\n *\n * @example\n * cx(\"base\", isActive && \"active\", isDisabled && \"disabled\")\n * // => \"base active\" (if isActive=true, isDisabled=false)\n */\nexport function cx(\n ...classes: (string | false | null | undefined)[]\n): string {\n return classes.filter(Boolean).join(\" \");\n}\n"],"names":["colors","spacing","typography","radii","shadows","sizeStyles","variantStyles","Button","variant","size","loading","disabled","fullWidth","leftIcon","children","onClick","sizeS","variantS","isDisabled","style","jsxs","e","jsx","Spinner","spinnerStyleInjected","ensureSpinnerStyle","paddingMap","Card","padding","noBorder","shadow","toneStyles","Badge","React","tone","dot","t","dotStyle","StatGrid","stats","_cols","stripStyle","stat","i","StatCell","isLast","isHighlight","valueStyle","unitStyle","labelStyle","subStyle","SectionLabel","action","TabBar","tabs","active","onChange","containerStyle","fontSize","paddingY","paddingX","tab","isActive","tabStyle","badgeStyle","DataTable","columns","rows","emptyState","onRowClick","tableStyle","thStyle","col","tdStyle","trHoverStyle","Fragment","row","rowIdx","Input","label","hint","error","prefix","suffix","type","placeholder","value","hasError","wrapperStyle","inputWrapperStyle","inputStyle","hintStyle","affixStyle","wrapper","getScoreColor","pct","getScoreBg","ScoreBar","score","max","width","showLabel","barColor","bgColor","barHeight","trackStyle","fillStyle","FOCUSABLE_SELECTOR","Modal","open","onClose","maxWidth","title","visible","setVisible","useState","dialogRef","useRef","titleId","useEffect","id","handler","dialog","previouslyFocused","firstFocusable","handleTab","focusableElements","first","last","closeButton","ToggleGroup","options","opt","optStyle","createIcon","d","viewBox","filled","className","props","LockIcon","SearchIcon","CheckIcon","XIcon","MenuIcon","InfoIcon","AlertIcon","PlayIcon","StarIcon","SettingsIcon","UploadIcon","DownloadIcon","ArrowRightIcon","ArrowLeftIcon","ArrowUpIcon","ArrowDownIcon","ChevronRightIcon","ChevronLeftIcon","ChevronUpIcon","ChevronDownIcon","CheckRow","checked","sublabel","locked","badge","right","isInteractive","titleStyle","checkboxStyle","toneColors","pulseStyleInjected","ensurePulseStyle","StatusDot","pulse","px","PageHeader","sub","textStyle","ActionList","items","listStyle","item","dotColor","toneConfig","Toast","message","duration","timer","config","cardStyle","iconStyle","messageStyle","actionStyle","closeStyle","IconComp","CodeChip","typeColors","typeBg","DiffRow","handle","field","csvVal","storeVal","note","rowStyle","subTextStyle","IssueCard","severity","rowCount","fixable","onFix","expanded","setExpanded","s","headerRowStyle","leftGroupStyle","outlineBadgeStyle","IssueGroup","category","issues","defaultOpen","isOpen","setIsOpen","hasWarning","totalRows","acc","issue","headerStyle","titleGroupStyle","countBadgeStyle","idx","MiniStat","ModelTag","name","ProgressBar","percent","height","ProgressList","steps","step","isPending","isRunning","isDone","leftStyle","iconContainerStyle","Radio","description","isFocused","setIsFocused","isHovered","setIsHovered","generatedId","radioId","outerCircleStyle","innerDotStyle","textWrapperStyle","descStyle","StepBar","current","circleSize","backgroundLineStyle","progressLineStyle","index","stepNum","isCompleted","circleStyle","stepContainerStyle","SummaryCard","highlight","color","Switch","switchId","thumbStyle","handleKeyDown","Trend","inverse","isPositive","isNeutral","arrow","displayValue","useModal","initialState","useCallback","close","toggle","prev","useLocalStorage","key","initialValue","storedValue","setStoredValue","setValue","nextValue","cx","classes"],"mappings":"wIAAaA,EAAS,CAElB,MAAO,UACP,WAAY,UACZ,IAAK,UACL,MAAO,UAGP,OAAQ,UACR,OAAQ,UACR,SAAU,UAGV,YAAa,UACb,cAAe,UACf,aAAc,UACd,SAAU,UACV,aAAc,UACd,YAAa,UAGb,OAAQ,UACR,YAAa,UACb,aAAc,UACd,YAAa,UAGb,QAAS,UACT,UAAW,UACX,cAAe,UAEf,QAAS,UACT,UAAW,UACX,cAAe,UAEf,MAAO,UACP,WAAY,UACZ,QAAS,UACT,YAAa,UAEb,KAAM,UACN,OAAQ,UACR,WAAY,UAGZ,UAAW,UACX,YAAa,UAGb,aAAc,UACd,cAAe,SACnB,EClDaC,EAAU,CACnB,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,OACH,EAAG,OACH,EAAG,OACH,EAAG,OACH,EAAG,OACH,GAAI,OACJ,GAAI,OACJ,GAAI,OACJ,GAAI,MACR,ECdaC,EAAa,CACtB,WAAY,CACR,KAAM,8CACN,KAAM,6CAAA,EAEV,KAAM,CACF,GAAI,OACJ,GAAI,OACJ,KAAM,OACN,GAAI,OACJ,GAAI,OACJ,GAAI,OACJ,MAAO,OACP,MAAO,MAAA,EAEX,OAAQ,CACJ,OAAQ,IACR,OAAQ,IACR,SAAU,IACV,KAAM,IACN,UAAW,GAAA,EAEf,WAAY,CACR,MAAO,IACP,KAAM,IACN,OAAQ,IACR,QAAS,KACT,MAAO,IAAA,EAEX,cAAe,CACX,MAAO,UACP,KAAM,U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