lucent-ui 0.8.0 → 0.9.1

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/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("react"),Ce={primary:{background:"var(--lucent-accent-default)",color:"var(--lucent-text-on-accent)",border:"1px solid var(--lucent-accent-border)"},secondary:{background:"var(--lucent-surface)",color:"var(--lucent-text-primary)",border:"1px solid var(--lucent-border-default)"},ghost:{background:"transparent",color:"var(--lucent-text-primary)",border:"1px solid transparent"},danger:{background:"var(--lucent-danger-default)",color:"#ffffff",border:"1px solid var(--lucent-danger-default)"}},Ie={sm:{height:"32px",padding:"0 var(--lucent-space-3)",fontSize:"var(--lucent-font-size-sm)"},md:{height:"38px",padding:"0 var(--lucent-space-4)",fontSize:"var(--lucent-font-size-md)"},lg:{height:"46px",padding:"0 var(--lucent-space-5)",fontSize:"var(--lucent-font-size-lg)"}},he=m.forwardRef(({variant:t="primary",size:n="md",loading:a=!1,fullWidth:o=!1,spread:r=!1,leftIcon:i,rightIcon:s,chevron:l=!1,disableHoverStyles:c=!1,bordered:h=!0,children:g,disabled:u,style:p,...d},x)=>{const y=u??a;return e.jsxs("button",{ref:x,disabled:y,"aria-busy":a,style:{display:"inline-flex",alignItems:"center",justifyContent:r?"space-between":"center",gap:"var(--lucent-space-2)",fontFamily:"var(--lucent-font-family-base)",fontWeight:"var(--lucent-font-weight-medium)",lineHeight:1,letterSpacing:"0.01em",borderRadius:"var(--lucent-radius-lg)",cursor:y?"not-allowed":"pointer",width:o?"100%":void 0,transition:"background var(--lucent-duration-fast) var(--lucent-easing-default), border-color var(--lucent-duration-fast) var(--lucent-easing-default), box-shadow var(--lucent-duration-fast) var(--lucent-easing-default), transform 80ms var(--lucent-easing-default)",whiteSpace:"nowrap",boxSizing:"border-box",outline:"none",margin:0,...Ie[n],...Ce[t],...p,...y&&{background:"var(--lucent-surface-secondary)",color:"var(--lucent-text-disabled)",borderColor:"transparent"},...h===!1&&{border:"none"}},onMouseEnter:b=>{var f;!y&&!c&&Me(b.currentTarget,t,h),(f=d.onMouseEnter)==null||f.call(d,b)},onMouseLeave:b=>{var f;!y&&!c&&De(b.currentTarget,t,h),(f=d.onMouseLeave)==null||f.call(d,b)},onMouseDown:b=>{var f;y||(b.currentTarget.style.transform="scale(0.95)"),(f=d.onMouseDown)==null||f.call(d,b)},onMouseUp:b=>{var f;b.currentTarget.style.transform="",(f=d.onMouseUp)==null||f.call(d,b)},onFocus:b=>{var f;b.currentTarget.style.boxShadow="0 0 0 3px var(--lucent-accent-subtle)",(f=d.onFocus)==null||f.call(d,b)},onBlur:b=>{var f;b.currentTarget.style.boxShadow="",(f=d.onBlur)==null||f.call(d,b)},...d,children:[i,a?e.jsx(Ee,{}):g,!a&&s,!a&&l&&e.jsx(Ae,{size:n})]})});he.displayName="Button";function Me(t,n,a){n==="primary"?(t.style.background="var(--lucent-accent-hover)",a!==!1&&(t.style.borderColor="var(--lucent-accent-border)")):n==="secondary"||n==="ghost"?t.style.background="var(--lucent-surface-secondary)":n==="danger"&&(t.style.background="var(--lucent-danger-hover)",a!==!1&&(t.style.borderColor="var(--lucent-danger-hover)"))}function De(t,n,a){n==="primary"?(t.style.background="var(--lucent-accent-default)",a!==!1&&(t.style.borderColor="var(--lucent-accent-border)")):n==="secondary"?t.style.background="var(--lucent-surface)":n==="ghost"?t.style.background="transparent":n==="danger"&&(t.style.background="var(--lucent-danger-default)",a!==!1&&(t.style.borderColor="var(--lucent-danger-default)"))}const ze={sm:12,md:14,lg:16};function Ae({size:t}){const n=ze[t];return e.jsx("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,style:{flexShrink:0,marginLeft:-2},children:e.jsx("polyline",{points:"6 9 12 15 18 9"})})}function Ee(){return e.jsxs("svg",{width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,strokeLinecap:"round","aria-hidden":!0,style:{animation:"lucent-spin 0.7s linear infinite",flexShrink:0},children:[e.jsx("style",{children:"@keyframes lucent-spin { to { transform: rotate(360deg); } }"}),e.jsx("path",{d:"M12 2a10 10 0 0 1 10 10"})]})}const qe={id:"button",name:"Button",tier:"atom",domain:"neutral",specVersion:"1.0",description:"A clickable control that triggers an action. The primary interactive primitive in Lucent UI.",designIntent:'Buttons communicate available actions. Variant conveys hierarchy: use "primary" for the single most important action in a view, "secondary" for supporting actions, "ghost" for low-emphasis actions in dense UIs, and "danger" exclusively for destructive or irreversible operations. Size should match surrounding content density — prefer "md" as the default and reserve "sm" for toolbars or tables.',props:[{name:"variant",type:"enum",required:!1,default:"primary",description:"Visual style conveying action hierarchy.",enumValues:["primary","secondary","ghost","danger"]},{name:"size",type:"enum",required:!1,default:"md",description:"Controls height and padding.",enumValues:["sm","md","lg"]},{name:"children",type:"ReactNode",required:!0,description:"Button label or content."},{name:"disabled",type:"boolean",required:!1,default:"false",description:"Prevents interaction and applies disabled styling."},{name:"loading",type:"boolean",required:!1,default:"false",description:"Shows a spinner and prevents interaction while an async action is in progress."},{name:"fullWidth",type:"boolean",required:!1,default:"false",description:"Stretches the button to fill its container width."},{name:"bordered",type:"boolean",required:!1,default:"true",description:"When false removes the button border entirely, producing a flat look."},{name:"leftIcon",type:"ReactNode",required:!1,description:"Icon element rendered before the label."},{name:"rightIcon",type:"ReactNode",required:!1,description:"Icon element rendered after the label."},{name:"onClick",type:"function",required:!1,description:"Called when the button is clicked and not disabled or loading."},{name:"type",type:"enum",required:!1,default:"button",description:"Native button type attribute.",enumValues:["button","submit","reset"]}],usageExamples:[{title:"Primary action",code:'<Button variant="primary" onClick={handleSave}>Save changes</Button>'},{title:"Destructive action",code:'<Button variant="danger" onClick={handleDelete}>Delete account</Button>'},{title:"Loading state",code:'<Button variant="primary" loading={isSaving}>Save changes</Button>'},{title:"With icon",code:'<Button variant="secondary" leftIcon={<PlusIcon />}>Add member</Button>'},{title:"Ghost in toolbar",code:'<Button variant="ghost" size="sm">Edit</Button>'},{title:"Full-width submit",code:'<Button variant="primary" type="submit" fullWidth>Sign in</Button>'},{title:"Borderless primary",code:'<Button variant="primary" bordered={false}>Flat primary</Button>'}],compositionGraph:[],accessibility:{role:"button",ariaAttributes:["aria-disabled","aria-busy"],keyboardInteractions:["Enter — activates the button","Space — activates the button"]}},re=m.forwardRef(({label:t,helperText:n,errorText:a,leftElement:o,rightElement:r,id:i,style:s,...l},c)=>{const h=i??`lucent-input-${Math.random().toString(36).slice(2,7)}`,g=!!a,u=!!l.disabled;return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--lucent-space-1)",width:"100%"},children:[t&&e.jsx("label",{htmlFor:h,style:{fontSize:"var(--lucent-font-size-sm)",fontWeight:"var(--lucent-font-weight-medium)",color:"var(--lucent-text-primary)",fontFamily:"var(--lucent-font-family-base)"},children:t}),e.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center"},children:[o&&e.jsx("span",{style:{position:"absolute",left:"var(--lucent-space-3)",color:u?"var(--lucent-text-disabled)":"var(--lucent-text-secondary)",display:"flex",alignItems:"center",pointerEvents:"none"},children:o}),e.jsx("input",{ref:c,id:h,"aria-invalid":g,"aria-describedby":g?`${h}-error`:n?`${h}-helper`:void 0,style:{width:"100%",height:"40px",padding:`0 ${r?"var(--lucent-space-10)":"var(--lucent-space-3)"} 0 ${o?"var(--lucent-space-10)":"var(--lucent-space-3)"}`,fontSize:"var(--lucent-font-size-md)",fontFamily:"var(--lucent-font-family-base)",color:u?"var(--lucent-text-disabled)":"var(--lucent-text-primary)",background:u?"var(--lucent-surface-secondary)":"var(--lucent-surface)",border:`1px solid ${u?"transparent":g?"var(--lucent-danger-default)":"var(--lucent-border-default)"}`,cursor:u?"not-allowed":void 0,borderRadius:"var(--lucent-radius-lg)",outline:"none",boxSizing:"border-box",transition:"border-color var(--lucent-duration-fast) var(--lucent-easing-default)",...s},onMouseEnter:p=>{var d;!l.disabled&&p.currentTarget!==document.activeElement&&(p.currentTarget.style.borderColor=g?"var(--lucent-danger-default)":"var(--lucent-border-strong)"),(d=l.onMouseEnter)==null||d.call(l,p)},onMouseLeave:p=>{var d;!l.disabled&&p.currentTarget!==document.activeElement&&(p.currentTarget.style.borderColor=g?"var(--lucent-danger-default)":"var(--lucent-border-default)"),(d=l.onMouseLeave)==null||d.call(l,p)},onFocus:p=>{var d;p.currentTarget.style.borderColor=g?"var(--lucent-danger-default)":"var(--lucent-focus-ring)",p.currentTarget.style.boxShadow=`0 0 0 3px ${g?"var(--lucent-danger-subtle)":"var(--lucent-accent-subtle)"}`,(d=l.onFocus)==null||d.call(l,p)},onBlur:p=>{var d;p.currentTarget.style.borderColor=g?"var(--lucent-danger-default)":"var(--lucent-border-default)",p.currentTarget.style.boxShadow="none",(d=l.onBlur)==null||d.call(l,p)},...l}),r&&e.jsx("span",{style:{position:"absolute",right:"var(--lucent-space-3)",color:u?"var(--lucent-text-disabled)":"var(--lucent-text-secondary)",display:"flex",alignItems:"center"},children:r})]}),g&&e.jsx("span",{id:`${h}-error`,role:"alert",style:{fontSize:"var(--lucent-font-size-sm)",color:"var(--lucent-danger-text)",fontFamily:"var(--lucent-font-family-base)"},children:a}),!g&&n&&e.jsx("span",{id:`${h}-helper`,style:{fontSize:"var(--lucent-font-size-sm)",color:"var(--lucent-text-secondary)",fontFamily:"var(--lucent-font-family-base)"},children:n})]})});re.displayName="Input";const Re={id:"input",name:"Input",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A single-line text field with optional label, helper text, and error state.",designIntent:"Always pair with a visible label — never rely on placeholder text alone as it disappears on input and is inaccessible. Use errorText (not helperText) to surface validation failures; the component applies danger styling automatically. leftElement and rightElement accept icons or small controls (e.g. currency symbol, clear button).",props:[{name:"type",type:"enum",required:!1,default:"text",description:"HTML input type.",enumValues:["text","number","password","email","tel","url","search"]},{name:"label",type:"string",required:!1,description:"Visible label rendered above the input."},{name:"helperText",type:"string",required:!1,description:"Supplementary hint shown below the input."},{name:"errorText",type:"string",required:!1,description:"Validation error message. When set, input renders in error state."},{name:"leftElement",type:"ReactNode",required:!1,description:"Icon or adornment rendered inside the left edge."},{name:"rightElement",type:"ReactNode",required:!1,description:"Icon or adornment rendered inside the right edge."},{name:"placeholder",type:"string",required:!1,description:"Placeholder text. Use as a hint, not a label."},{name:"disabled",type:"boolean",required:!1,default:"false",description:"Disables the input."},{name:"value",type:"string",required:!1,description:"Controlled value."},{name:"onChange",type:"function",required:!1,description:"Change handler."}],usageExamples:[{title:"Basic",code:'<Input label="Email" type="email" placeholder="you@example.com" />'},{title:"With helper text",code:'<Input label="Username" helperText="3–20 characters, letters and numbers only" />'},{title:"Error state",code:'<Input label="Password" type="password" value={value} errorText="Must be at least 8 characters" />'},{title:"With icon",code:'<Input label="Search" leftElement={<SearchIcon />} placeholder="Search…" />'}],compositionGraph:[],accessibility:{role:"textbox",ariaAttributes:["aria-invalid","aria-describedby","aria-label"],keyboardInteractions:["Tab — focuses the input"]}},me=m.forwardRef(({label:t,helperText:n,errorText:a,autoResize:o=!1,maxLength:r,showCount:i=!1,id:s,value:l,onChange:c,style:h,...g},u)=>{const p=m.useRef(null),d=u??p,x=s??`lucent-textarea-${Math.random().toString(36).slice(2,7)}`,y=!!a,b=typeof l=="string"?l.length:0;return m.useEffect(()=>{if(!o)return;const f=d.current;f&&(f.style.height="auto",f.style.height=`${f.scrollHeight}px`)},[l,o,d]),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--lucent-space-1)",width:"100%"},children:[t&&e.jsx("label",{htmlFor:x,style:{fontSize:"var(--lucent-font-size-sm)",fontWeight:"var(--lucent-font-weight-medium)",color:"var(--lucent-text-primary)",fontFamily:"var(--lucent-font-family-base)"},children:t}),e.jsx("textarea",{ref:d,id:x,maxLength:r,value:l,onChange:c,"aria-invalid":y,"aria-describedby":y?`${x}-error`:n?`${x}-helper`:void 0,style:{width:"100%",minHeight:"100px",padding:"var(--lucent-space-3)",fontSize:"var(--lucent-font-size-md)",fontFamily:"var(--lucent-font-family-base)",color:"var(--lucent-text-primary)",background:"var(--lucent-surface)",border:`1px solid ${y?"var(--lucent-danger-default)":"var(--lucent-border-default)"}`,borderRadius:"var(--lucent-radius-md)",outline:"none",resize:o?"none":"vertical",boxSizing:"border-box",lineHeight:"var(--lucent-line-height-base)",transition:"border-color var(--lucent-duration-fast) var(--lucent-easing-default)",...h},onFocus:f=>{var v;f.currentTarget.style.borderColor=y?"var(--lucent-danger-default)":"var(--lucent-focus-ring)",f.currentTarget.style.boxShadow=`0 0 0 3px ${y?"var(--lucent-danger-subtle)":"var(--lucent-accent-subtle)"}`,(v=g.onFocus)==null||v.call(g,f)},onBlur:f=>{var v;f.currentTarget.style.borderColor=y?"var(--lucent-danger-default)":"var(--lucent-border-default)",f.currentTarget.style.boxShadow="none",(v=g.onBlur)==null||v.call(g,f)},...g}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[e.jsxs("div",{children:[y&&e.jsx("span",{id:`${x}-error`,role:"alert",style:{fontSize:"var(--lucent-font-size-sm)",color:"var(--lucent-danger-text)",fontFamily:"var(--lucent-font-family-base)"},children:a}),!y&&n&&e.jsx("span",{id:`${x}-helper`,style:{fontSize:"var(--lucent-font-size-sm)",color:"var(--lucent-text-secondary)",fontFamily:"var(--lucent-font-family-base)"},children:n})]}),(i||r)&&e.jsxs("span",{style:{fontSize:"var(--lucent-font-size-xs)",color:r&&b>=r?"var(--lucent-danger-text)":"var(--lucent-text-secondary)",fontFamily:"var(--lucent-font-family-mono)",flexShrink:0,marginLeft:"var(--lucent-space-2)"},children:[b,r?`/${r}`:""]})]})]})});me.displayName="Textarea";const Le={id:"textarea",name:"Textarea",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A multi-line text input with optional auto-resize and character count.",designIntent:"Use autoResize for open-ended fields (bio, description) where content length is unpredictable. Use maxLength + showCount for fields with hard limits (tweet-style). Behaves identically to Input for label/helper/error patterns.",props:[{name:"label",type:"string",required:!1,description:"Visible label above the textarea."},{name:"helperText",type:"string",required:!1,description:"Hint text shown below."},{name:"errorText",type:"string",required:!1,description:"Validation error. Triggers error styling."},{name:"autoResize",type:"boolean",required:!1,default:"false",description:"Grows with content, disables manual resize handle."},{name:"maxLength",type:"number",required:!1,description:"Character limit. Displays counter when set."},{name:"showCount",type:"boolean",required:!1,default:"false",description:"Always show character counter even without maxLength."},{name:"value",type:"string",required:!1,description:"Controlled value."},{name:"onChange",type:"function",required:!1,description:"Change handler."},{name:"placeholder",type:"string",required:!1,description:"Placeholder text."},{name:"disabled",type:"boolean",required:!1,default:"false",description:"Disables the textarea."}],usageExamples:[{title:"Basic",code:'<Textarea label="Bio" placeholder="Tell us about yourself…" />'},{title:"Auto-resize",code:'<Textarea label="Description" autoResize value={value} onChange={e => setValue(e.target.value)} />'},{title:"With character count",code:'<Textarea label="Tweet" maxLength={280} showCount value={value} onChange={e => setValue(e.target.value)} />'},{title:"Error state",code:'<Textarea label="Notes" errorText="Required" value="" />'}],compositionGraph:[],accessibility:{role:"textbox",ariaAttributes:["aria-multiline","aria-invalid","aria-describedby"],keyboardInteractions:["Tab — focuses the textarea"]}},Be={neutral:{bg:"var(--lucent-surface-secondary)",color:"var(--lucent-text-secondary)",border:"var(--lucent-border-default)"},accent:{bg:"var(--lucent-accent-default)",color:"var(--lucent-text-on-accent)",border:"var(--lucent-accent-default)"},success:{bg:"var(--lucent-success-subtle)",color:"var(--lucent-success-text)",border:"var(--lucent-success-subtle)"},warning:{bg:"var(--lucent-warning-subtle)",color:"var(--lucent-warning-text)",border:"var(--lucent-warning-subtle)"},danger:{bg:"var(--lucent-danger-subtle)",color:"var(--lucent-danger-text)",border:"var(--lucent-danger-subtle)"},info:{bg:"var(--lucent-info-subtle)",color:"var(--lucent-info-text)",border:"var(--lucent-info-subtle)"}},Fe={sm:{fontSize:"var(--lucent-font-size-xs)",padding:"0 var(--lucent-space-2)",height:"18px"},md:{fontSize:"var(--lucent-font-size-sm)",padding:"0 var(--lucent-space-2)",height:"22px"}};function Ne({variant:t="neutral",size:n="md",dot:a=!1,children:o,style:r}){const i=Be[t],s=Fe[n];return e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"var(--lucent-space-1)",height:s.height,padding:s.padding,fontSize:s.fontSize,fontFamily:"var(--lucent-font-family-base)",fontWeight:"var(--lucent-font-weight-medium)",lineHeight:1,borderRadius:"var(--lucent-radius-full)",background:i.bg,color:i.color,border:`1px solid ${i.border}`,whiteSpace:"nowrap",boxSizing:"border-box",...r},children:[a&&e.jsx("span",{style:{width:6,height:6,borderRadius:"var(--lucent-radius-full)",background:"currentColor",flexShrink:0}}),o]})}const Pe={id:"badge",name:"Badge",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A small inline label for status, count, or category.",designIntent:'Badges communicate status or category at a glance. Match variant to semantic meaning — never use "danger" for non-critical states or "success" for neutral counts. Use dot=true when a single colour indicator is enough context (e.g. online status). Keep badge text short: 1–3 words maximum.',props:[{name:"variant",type:"enum",required:!1,default:"neutral",description:"Colour scheme conveying semantic meaning.",enumValues:["neutral","success","warning","danger","info","accent"]},{name:"size",type:"enum",required:!1,default:"md",description:"Controls height and font size.",enumValues:["sm","md"]},{name:"dot",type:"boolean",required:!1,default:"false",description:"Prepends a coloured dot indicator."},{name:"children",type:"ReactNode",required:!0,description:"Badge label."}],usageExamples:[{title:"Status",code:'<Badge variant="success" dot>Active</Badge>'},{title:"Count",code:'<Badge variant="danger">12</Badge>'},{title:"Category",code:'<Badge variant="info">Beta</Badge>'},{title:"Neutral tag",code:"<Badge>Draft</Badge>"}],compositionGraph:[],accessibility:{role:"status",notes:"Use aria-label on the parent element when badge meaning depends on context."}},$e={xs:24,sm:32,md:40,lg:56,xl:80},We={xs:"var(--lucent-font-size-xs)",sm:"var(--lucent-font-size-xs)",md:"var(--lucent-font-size-sm)",lg:"var(--lucent-font-size-lg)",xl:"var(--lucent-font-size-xl)"};function Ve(t,n){var o,r,i;if(n)return n.slice(0,2).toUpperCase();const a=t.trim().split(/\s+/);return a.length===1?(((o=a[0])==null?void 0:o[0])??"").toUpperCase():((((r=a[0])==null?void 0:r[0])??"")+(((i=a[a.length-1])==null?void 0:i[0])??"")).toUpperCase()}function Oe({src:t,alt:n,size:a="md",initials:o,style:r,...i}){const s=$e[a],l=Ve(n,o),c={width:s,height:s,borderRadius:"var(--lucent-radius-full)",flexShrink:0,display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",boxSizing:"border-box",userSelect:"none",...r};return t?e.jsx("img",{src:t,alt:n,width:s,height:s,style:{...c,objectFit:"cover"},...i}):e.jsx("span",{role:"img","aria-label":n,style:{...c,background:"var(--lucent-accent-default)",color:"var(--lucent-text-on-accent)",fontSize:We[a],fontWeight:"var(--lucent-font-weight-semibold)",fontFamily:"var(--lucent-font-family-base)"},children:l})}const He={id:"avatar",name:"Avatar",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A circular user image with initials fallback.",designIntent:"Always provide alt for accessibility — it is used to derive initials automatically when src is absent or fails. Use initials prop to override auto-derived initials (e.g. for non-Latin names). Size xs/sm suit table rows and compact lists; md is the default for comment threads; lg/xl for profile headers.",props:[{name:"src",type:"string",required:!1,description:"Image URL. Falls back to initials if omitted or fails to load."},{name:"alt",type:"string",required:!0,description:"Alt text and source for auto-derived initials."},{name:"size",type:"enum",required:!1,default:"md",description:"Diameter of the avatar.",enumValues:["xs","sm","md","lg","xl"]},{name:"initials",type:"string",required:!1,description:"Override auto-derived initials (max 2 characters)."}],usageExamples:[{title:"With image",code:'<Avatar src="/avatars/jane.jpg" alt="Jane Doe" />'},{title:"Initials fallback",code:'<Avatar alt="Jane Doe" />'},{title:"Large profile",code:'<Avatar src={user.avatar} alt={user.name} size="lg" />'},{title:"Custom initials",code:'<Avatar alt="张伟" initials="张" size="md" />'}],compositionGraph:[],accessibility:{role:"img",ariaAttributes:["aria-label"],notes:'When src is present, renders as <img> with alt. When showing initials, renders as <span role="img" aria-label>.'}},Ge={xs:12,sm:16,md:24,lg:36},Ue={xs:2.5,sm:2.5,md:2,lg:2};function ge({size:t="md",label:n="Loading…",color:a}){const o=Ge[t],r=Ue[t];return e.jsxs("span",{role:"status","aria-label":n,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"},children:[e.jsxs("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,style:{animation:"lucent-spin 0.7s linear infinite",color:a??"currentColor"},children:[e.jsx("style",{children:"@keyframes lucent-spin { to { transform: rotate(360deg); } }"}),e.jsx("circle",{cx:12,cy:12,r:10,stroke:"currentColor",strokeWidth:r,strokeOpacity:.2}),e.jsx("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:"currentColor",strokeWidth:r,strokeLinecap:"round"})]}),e.jsx("span",{style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap"},children:n})]})}const _e={id:"spinner",name:"Spinner",tier:"atom",domain:"neutral",specVersion:"0.1",description:"An animated loading indicator for async operations.",designIntent:"Use Spinner for indeterminate loading states of short duration (< 3s). For full-page or skeleton-level loading, prefer Skeleton instead. The label prop is visually hidden but read by screen readers — always set it to a meaningful description of what is loading.",props:[{name:"size",type:"enum",required:!1,default:"md",description:"Spinner diameter.",enumValues:["xs","sm","md","lg"]},{name:"label",type:"string",required:!1,default:"Loading…",description:"Visually hidden accessible label."},{name:"color",type:"string",required:!1,description:"Override colour (CSS value). Defaults to currentColor."}],usageExamples:[{title:"Default",code:"<Spinner />"},{title:"Inside button",code:'<Button loading><Spinner size="sm" label="Saving…" /></Button>'},{title:"Full-page overlay",code:`<div style={{ display: 'grid', placeItems: 'center', minHeight: '100vh' }}><Spinner size="lg" label="Loading dashboard…" /></div>`}],compositionGraph:[],accessibility:{role:"status",ariaAttributes:["aria-label"],notes:'The visible SVG is aria-hidden. The label is conveyed via a visually-hidden span inside role="status".'}};function Ke({orientation:t="horizontal",label:n,spacing:a="var(--lucent-space-4)",style:o}){return t==="vertical"?e.jsx("span",{role:"separator","aria-orientation":"vertical",style:{display:"inline-block",width:"1px",alignSelf:"stretch",background:"var(--lucent-border-default)",margin:`0 ${a}`,flexShrink:0,...o}}):n?e.jsxs("div",{role:"separator","aria-label":n,style:{display:"flex",alignItems:"center",gap:"var(--lucent-space-3)",margin:`${a} 0`,...o},children:[e.jsx("span",{style:{flex:1,height:"1px",background:"var(--lucent-border-default)"}}),e.jsx("span",{style:{fontSize:"var(--lucent-font-size-xs)",fontFamily:"var(--lucent-font-family-base)",color:"var(--lucent-text-secondary)",whiteSpace:"nowrap",letterSpacing:"var(--lucent-letter-spacing-wide)",textTransform:"uppercase"},children:n}),e.jsx("span",{style:{flex:1,height:"1px",background:"var(--lucent-border-default)"}})]}):e.jsx("hr",{role:"separator",style:{border:"none",borderTop:"1px solid var(--lucent-border-default)",margin:`${a} 0`,width:"100%",...o}})}const Ye={id:"divider",name:"Divider",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A visual separator between content sections, horizontal or vertical.",designIntent:'Use horizontal Divider to separate sections in a layout. Use vertical Divider inline between sibling elements (e.g. nav links, toolbar buttons). Use the label prop for "OR" separators in auth flows or form sections — never use a plain text node next to a divider for this.',props:[{name:"orientation",type:"enum",required:!1,default:"horizontal",description:"Direction of the divider line.",enumValues:["horizontal","vertical"]},{name:"label",type:"string",required:!1,description:'Optional centered label (horizontal only). Common use: "OR", "AND", section titles.'},{name:"spacing",type:"string",required:!1,default:"var(--lucent-space-4)",description:"Margin on the axis perpendicular to the line."}],usageExamples:[{title:"Section separator",code:"<Divider />"},{title:"With label",code:'<Divider label="OR" />'},{title:"Vertical in nav",code:`<nav style={{ display: 'flex', alignItems: 'center' }}><a>Home</a><Divider orientation="vertical" /><a>About</a></nav>`}],compositionGraph:[],accessibility:{role:"separator",ariaAttributes:["aria-orientation","aria-label"]}},Xe={sm:14,md:16},Je=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),f=require("react"),Ze={primary:{background:"var(--lucent-accent-default)",color:"var(--lucent-text-on-accent)",border:"1px solid var(--lucent-accent-border)"},secondary:{background:"var(--lucent-surface)",color:"var(--lucent-text-primary)",border:"1px solid var(--lucent-border-default)"},ghost:{background:"transparent",color:"var(--lucent-text-primary)",border:"1px solid transparent"},danger:{background:"var(--lucent-danger-default)",color:"#ffffff",border:"1px solid var(--lucent-danger-default)"}},Qe={sm:{height:"32px",padding:"0 var(--lucent-space-3)",fontSize:"var(--lucent-font-size-sm)"},md:{height:"38px",padding:"0 var(--lucent-space-4)",fontSize:"var(--lucent-font-size-md)"},lg:{height:"46px",padding:"0 var(--lucent-space-5)",fontSize:"var(--lucent-font-size-lg)"}},ye=f.forwardRef(({variant:t="primary",size:n="md",loading:a=!1,fullWidth:o=!1,spread:r=!1,leftIcon:i,rightIcon:s,chevron:c=!1,disableHoverStyles:l=!1,bordered:u=!0,children:m,disabled:d,style:g,...p},x)=>{const b=d??a;return e.jsxs("button",{ref:x,disabled:b,"aria-busy":a,style:{display:"inline-flex",alignItems:"center",justifyContent:r?"space-between":"center",gap:"var(--lucent-space-2)",fontFamily:"var(--lucent-font-family-base)",fontWeight:"var(--lucent-font-weight-medium)",lineHeight:1,letterSpacing:"0.01em",borderRadius:"var(--lucent-radius-lg)",cursor:b?"not-allowed":"pointer",width:o?"100%":void 0,transition:"background var(--lucent-duration-fast) var(--lucent-easing-default), border-color var(--lucent-duration-fast) var(--lucent-easing-default), box-shadow var(--lucent-duration-fast) var(--lucent-easing-default), transform 80ms var(--lucent-easing-default)",whiteSpace:"nowrap",boxSizing:"border-box",outline:"none",margin:0,...Qe[n],...Ze[t],...g,...b&&{background:"var(--lucent-surface-secondary)",color:"var(--lucent-text-disabled)",borderColor:"transparent"},...u===!1&&{border:"none"}},onMouseEnter:y=>{var h;!b&&!l&&et(y.currentTarget,t,u),(h=p.onMouseEnter)==null||h.call(p,y)},onMouseLeave:y=>{var h;!b&&!l&&tt(y.currentTarget,t,u),(h=p.onMouseLeave)==null||h.call(p,y)},onMouseDown:y=>{var h;b||(y.currentTarget.style.transform="scale(0.95)"),(h=p.onMouseDown)==null||h.call(p,y)},onMouseUp:y=>{var h;y.currentTarget.style.transform="",(h=p.onMouseUp)==null||h.call(p,y)},onFocus:y=>{var h;y.currentTarget.style.boxShadow="0 0 0 3px var(--lucent-accent-subtle)",(h=p.onFocus)==null||h.call(p,y)},onBlur:y=>{var h;y.currentTarget.style.boxShadow="",(h=p.onBlur)==null||h.call(p,y)},...p,children:[i,a?e.jsx(rt,{}):m,!a&&s,!a&&c&&e.jsx(at,{size:n})]})});ye.displayName="Button";function et(t,n,a){n==="primary"?(t.style.background="var(--lucent-accent-hover)",a!==!1&&(t.style.borderColor="var(--lucent-accent-border)")):n==="secondary"||n==="ghost"?t.style.background="var(--lucent-surface-secondary)":n==="danger"&&(t.style.background="var(--lucent-danger-hover)",a!==!1&&(t.style.borderColor="var(--lucent-danger-hover)"))}function tt(t,n,a){n==="primary"?(t.style.background="var(--lucent-accent-default)",a!==!1&&(t.style.borderColor="var(--lucent-accent-border)")):n==="secondary"?t.style.background="var(--lucent-surface)":n==="ghost"?t.style.background="transparent":n==="danger"&&(t.style.background="var(--lucent-danger-default)",a!==!1&&(t.style.borderColor="var(--lucent-danger-default)"))}const nt={sm:12,md:14,lg:16};function at({size:t}){const n=nt[t];return e.jsx("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,style:{flexShrink:0,marginLeft:-2},children:e.jsx("polyline",{points:"6 9 12 15 18 9"})})}function rt(){return e.jsxs("svg",{width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,strokeLinecap:"round","aria-hidden":!0,style:{animation:"lucent-spin 0.7s linear infinite",flexShrink:0},children:[e.jsx("style",{children:"@keyframes lucent-spin { to { transform: rotate(360deg); } }"}),e.jsx("path",{d:"M12 2a10 10 0 0 1 10 10"})]})}const ot={id:"button",name:"Button",tier:"atom",domain:"neutral",specVersion:"1.0",description:"A clickable control that triggers an action. The primary interactive primitive in Lucent UI.",designIntent:'Buttons communicate available actions. Variant conveys hierarchy: use "primary" for the single most important action in a view, "secondary" for supporting actions, "ghost" for low-emphasis actions in dense UIs, and "danger" exclusively for destructive or irreversible operations. Size should match surrounding content density — prefer "md" as the default and reserve "sm" for toolbars or tables.',props:[{name:"variant",type:"enum",required:!1,default:"primary",description:"Visual style conveying action hierarchy.",enumValues:["primary","secondary","ghost","danger"]},{name:"size",type:"enum",required:!1,default:"md",description:"Controls height and padding.",enumValues:["sm","md","lg"]},{name:"children",type:"ReactNode",required:!0,description:"Button label or content."},{name:"disabled",type:"boolean",required:!1,default:"false",description:"Prevents interaction and applies disabled styling."},{name:"loading",type:"boolean",required:!1,default:"false",description:"Shows a spinner and prevents interaction while an async action is in progress."},{name:"fullWidth",type:"boolean",required:!1,default:"false",description:"Stretches the button to fill its container width."},{name:"bordered",type:"boolean",required:!1,default:"true",description:"When false removes the button border entirely, producing a flat look."},{name:"leftIcon",type:"ReactNode",required:!1,description:"Icon element rendered before the label."},{name:"rightIcon",type:"ReactNode",required:!1,description:"Icon element rendered after the label."},{name:"onClick",type:"function",required:!1,description:"Called when the button is clicked and not disabled or loading."},{name:"type",type:"enum",required:!1,default:"button",description:"Native button type attribute.",enumValues:["button","submit","reset"]}],usageExamples:[{title:"Primary action",code:'<Button variant="primary" onClick={handleSave}>Save changes</Button>'},{title:"Destructive action",code:'<Button variant="danger" onClick={handleDelete}>Delete account</Button>'},{title:"Loading state",code:'<Button variant="primary" loading={isSaving}>Save changes</Button>'},{title:"With icon",code:'<Button variant="secondary" leftIcon={<PlusIcon />}>Add member</Button>'},{title:"Ghost in toolbar",code:'<Button variant="ghost" size="sm">Edit</Button>'},{title:"Full-width submit",code:'<Button variant="primary" type="submit" fullWidth>Sign in</Button>'},{title:"Borderless primary",code:'<Button variant="primary" bordered={false}>Flat primary</Button>'}],compositionGraph:[],accessibility:{role:"button",ariaAttributes:["aria-disabled","aria-busy"],keyboardInteractions:["Enter — activates the button","Space — activates the button"]}},it={sm:"32px",md:"40px",lg:"46px"},Me={sm:"var(--lucent-font-size-sm)",md:"var(--lucent-font-size-md)",lg:"var(--lucent-font-size-md)"},X={sm:"var(--lucent-space-2)",md:"var(--lucent-space-3)",lg:"var(--lucent-space-3)"},De={sm:"28px",md:"var(--lucent-space-10)",lg:"var(--lucent-space-10)"},_=f.forwardRef(({size:t="md",label:n,helperText:a,errorText:o,leftElement:r,rightElement:i,prefix:s,suffix:c,id:l,style:u,...m},d)=>{const g=l??`lucent-input-${Math.random().toString(36).slice(2,7)}`,p=!!o,x=!!m.disabled,[b,y]=f.useState(!1),[h,v]=f.useState(!1),j=x?"transparent":p?"var(--lucent-danger-default)":b?"var(--lucent-focus-ring)":h?"var(--lucent-border-strong)":"var(--lucent-border-default)",S=b?`0 0 0 3px ${p?"var(--lucent-danger-subtle)":"var(--lucent-accent-subtle)"}`:"none",T={display:"flex",alignItems:"center",color:x?"var(--lucent-text-disabled)":"var(--lucent-text-secondary)",fontSize:Me[t],fontFamily:"var(--lucent-font-family-base)",whiteSpace:"nowrap",userSelect:"none",flexShrink:0},z={...T,paddingLeft:X[t],paddingRight:"2px"},q={...T,paddingLeft:"2px",paddingRight:X[t]};return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--lucent-space-1)",width:"100%",...u},children:[n&&e.jsx("label",{htmlFor:g,style:{fontSize:"var(--lucent-font-size-sm)",fontWeight:"var(--lucent-font-weight-medium)",color:x?"var(--lucent-text-disabled)":"var(--lucent-text-primary)",fontFamily:"var(--lucent-font-family-base)"},children:n}),e.jsxs("div",{style:{display:"flex",alignItems:"stretch",height:it[t],border:`1px solid ${j}`,borderRadius:"var(--lucent-radius-lg)",boxShadow:S,background:x?"var(--lucent-surface-secondary)":"var(--lucent-surface)",overflow:"hidden",cursor:x?"not-allowed":void 0,transition:["border-color var(--lucent-duration-fast) var(--lucent-easing-default)","box-shadow var(--lucent-duration-fast) var(--lucent-easing-default)"].join(", ")},onMouseEnter:()=>{x||v(!0)},onMouseLeave:()=>v(!1),children:[s&&e.jsx("span",{style:z,children:s}),e.jsxs("div",{style:{position:"relative",flex:1,display:"flex",alignItems:"center",minWidth:0},children:[r&&e.jsx("span",{style:{position:"absolute",left:X[t],color:x?"var(--lucent-text-disabled)":"var(--lucent-text-secondary)",display:"flex",alignItems:"center",pointerEvents:"none"},children:r}),e.jsx("input",{ref:d,id:g,"aria-invalid":p,"aria-describedby":p?`${g}-error`:a?`${g}-helper`:void 0,style:{width:"100%",height:"100%",paddingLeft:r?De[t]:X[t],paddingRight:i?De[t]:X[t],fontSize:Me[t],fontFamily:"var(--lucent-font-family-base)",color:x?"var(--lucent-text-disabled)":"var(--lucent-text-primary)",background:"transparent",border:"none",outline:"none",cursor:x?"not-allowed":void 0,boxSizing:"border-box"},onFocus:w=>{var C;y(!0),(C=m.onFocus)==null||C.call(m,w)},onBlur:w=>{var C;y(!1),(C=m.onBlur)==null||C.call(m,w)},...m}),i&&e.jsx("span",{style:{position:"absolute",right:X[t],color:x?"var(--lucent-text-disabled)":"var(--lucent-text-secondary)",display:"flex",alignItems:"center"},children:i})]}),c&&e.jsx("span",{style:q,children:c})]}),p&&e.jsx("span",{id:`${g}-error`,role:"alert",style:{fontSize:"var(--lucent-font-size-sm)",color:"var(--lucent-danger-text)",fontFamily:"var(--lucent-font-family-base)"},children:o}),!p&&a&&e.jsx("span",{id:`${g}-helper`,style:{fontSize:"var(--lucent-font-size-sm)",color:"var(--lucent-text-secondary)",fontFamily:"var(--lucent-font-family-base)"},children:a})]})});_.displayName="Input";const st={id:"input",name:"Input",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A single-line text field with optional label, helper text, and error state.",designIntent:"Always pair with a visible label — never rely on placeholder text alone as it disappears on input and is inaccessible. Use errorText (not helperText) to surface validation failures; the component applies danger styling automatically. leftElement and rightElement accept icons or small controls (e.g. currency symbol, clear button).",props:[{name:"type",type:"enum",required:!1,default:"text",description:"HTML input type.",enumValues:["text","number","password","email","tel","url","search"]},{name:"label",type:"string",required:!1,description:"Visible label rendered above the input."},{name:"helperText",type:"string",required:!1,description:"Supplementary hint shown below the input."},{name:"errorText",type:"string",required:!1,description:"Validation error message. When set, input renders in error state."},{name:"leftElement",type:"ReactNode",required:!1,description:"Icon or adornment rendered inside the left edge."},{name:"rightElement",type:"ReactNode",required:!1,description:"Icon or adornment rendered inside the right edge."},{name:"placeholder",type:"string",required:!1,description:"Placeholder text. Use as a hint, not a label."},{name:"disabled",type:"boolean",required:!1,default:"false",description:"Disables the input."},{name:"value",type:"string",required:!1,description:"Controlled value."},{name:"onChange",type:"function",required:!1,description:"Change handler."}],usageExamples:[{title:"Basic",code:'<Input label="Email" type="email" placeholder="you@example.com" />'},{title:"With helper text",code:'<Input label="Username" helperText="3–20 characters, letters and numbers only" />'},{title:"Error state",code:'<Input label="Password" type="password" value={value} errorText="Must be at least 8 characters" />'},{title:"With icon",code:'<Input label="Search" leftElement={<SearchIcon />} placeholder="Search…" />'}],compositionGraph:[],accessibility:{role:"textbox",ariaAttributes:["aria-invalid","aria-describedby","aria-label"],keyboardInteractions:["Tab — focuses the input"]}},Pe=f.forwardRef(({label:t,helperText:n,errorText:a,autoResize:o=!1,maxLength:r,showCount:i=!1,id:s,value:c,onChange:l,style:u,...m},d)=>{const g=f.useRef(null),p=d??g,x=s??`lucent-textarea-${Math.random().toString(36).slice(2,7)}`,b=!!a,y=typeof c=="string"?c.length:0;return f.useEffect(()=>{if(!o)return;const h=p.current;h&&(h.style.height="auto",h.style.height=`${h.scrollHeight}px`)},[c,o,p]),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--lucent-space-1)",width:"100%"},children:[t&&e.jsx("label",{htmlFor:x,style:{fontSize:"var(--lucent-font-size-sm)",fontWeight:"var(--lucent-font-weight-medium)",color:"var(--lucent-text-primary)",fontFamily:"var(--lucent-font-family-base)"},children:t}),e.jsx("textarea",{ref:p,id:x,maxLength:r,value:c,onChange:l,"aria-invalid":b,"aria-describedby":b?`${x}-error`:n?`${x}-helper`:void 0,style:{width:"100%",minHeight:"100px",padding:"var(--lucent-space-3)",fontSize:"var(--lucent-font-size-md)",fontFamily:"var(--lucent-font-family-base)",color:"var(--lucent-text-primary)",background:"var(--lucent-surface)",border:`1px solid ${b?"var(--lucent-danger-default)":"var(--lucent-border-default)"}`,borderRadius:"var(--lucent-radius-md)",outline:"none",resize:o?"none":"vertical",boxSizing:"border-box",lineHeight:"var(--lucent-line-height-base)",transition:"border-color var(--lucent-duration-fast) var(--lucent-easing-default)",...u},onFocus:h=>{var v;h.currentTarget.style.borderColor=b?"var(--lucent-danger-default)":"var(--lucent-focus-ring)",h.currentTarget.style.boxShadow=`0 0 0 3px ${b?"var(--lucent-danger-subtle)":"var(--lucent-accent-subtle)"}`,(v=m.onFocus)==null||v.call(m,h)},onBlur:h=>{var v;h.currentTarget.style.borderColor=b?"var(--lucent-danger-default)":"var(--lucent-border-default)",h.currentTarget.style.boxShadow="none",(v=m.onBlur)==null||v.call(m,h)},...m}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[e.jsxs("div",{children:[b&&e.jsx("span",{id:`${x}-error`,role:"alert",style:{fontSize:"var(--lucent-font-size-sm)",color:"var(--lucent-danger-text)",fontFamily:"var(--lucent-font-family-base)"},children:a}),!b&&n&&e.jsx("span",{id:`${x}-helper`,style:{fontSize:"var(--lucent-font-size-sm)",color:"var(--lucent-text-secondary)",fontFamily:"var(--lucent-font-family-base)"},children:n})]}),(i||r)&&e.jsxs("span",{style:{fontSize:"var(--lucent-font-size-xs)",color:r&&y>=r?"var(--lucent-danger-text)":"var(--lucent-text-secondary)",fontFamily:"var(--lucent-font-family-mono)",flexShrink:0,marginLeft:"var(--lucent-space-2)"},children:[y,r?`/${r}`:""]})]})]})});Pe.displayName="Textarea";const lt={id:"textarea",name:"Textarea",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A multi-line text input with optional auto-resize and character count.",designIntent:"Use autoResize for open-ended fields (bio, description) where content length is unpredictable. Use maxLength + showCount for fields with hard limits (tweet-style). Behaves identically to Input for label/helper/error patterns.",props:[{name:"label",type:"string",required:!1,description:"Visible label above the textarea."},{name:"helperText",type:"string",required:!1,description:"Hint text shown below."},{name:"errorText",type:"string",required:!1,description:"Validation error. Triggers error styling."},{name:"autoResize",type:"boolean",required:!1,default:"false",description:"Grows with content, disables manual resize handle."},{name:"maxLength",type:"number",required:!1,description:"Character limit. Displays counter when set."},{name:"showCount",type:"boolean",required:!1,default:"false",description:"Always show character counter even without maxLength."},{name:"value",type:"string",required:!1,description:"Controlled value."},{name:"onChange",type:"function",required:!1,description:"Change handler."},{name:"placeholder",type:"string",required:!1,description:"Placeholder text."},{name:"disabled",type:"boolean",required:!1,default:"false",description:"Disables the textarea."}],usageExamples:[{title:"Basic",code:'<Textarea label="Bio" placeholder="Tell us about yourself…" />'},{title:"Auto-resize",code:'<Textarea label="Description" autoResize value={value} onChange={e => setValue(e.target.value)} />'},{title:"With character count",code:'<Textarea label="Tweet" maxLength={280} showCount value={value} onChange={e => setValue(e.target.value)} />'},{title:"Error state",code:'<Textarea label="Notes" errorText="Required" value="" />'}],compositionGraph:[],accessibility:{role:"textbox",ariaAttributes:["aria-multiline","aria-invalid","aria-describedby"],keyboardInteractions:["Tab — focuses the textarea"]}},ct={neutral:{bg:"var(--lucent-surface-secondary)",color:"var(--lucent-text-secondary)",border:"var(--lucent-border-default)"},accent:{bg:"var(--lucent-accent-default)",color:"var(--lucent-text-on-accent)",border:"var(--lucent-accent-default)"},success:{bg:"var(--lucent-success-subtle)",color:"var(--lucent-success-text)",border:"var(--lucent-success-subtle)"},warning:{bg:"var(--lucent-warning-subtle)",color:"var(--lucent-warning-text)",border:"var(--lucent-warning-subtle)"},danger:{bg:"var(--lucent-danger-subtle)",color:"var(--lucent-danger-text)",border:"var(--lucent-danger-subtle)"},info:{bg:"var(--lucent-info-subtle)",color:"var(--lucent-info-text)",border:"var(--lucent-info-subtle)"}},dt={sm:{fontSize:"var(--lucent-font-size-xs)",padding:"0 var(--lucent-space-2)",height:"18px"},md:{fontSize:"var(--lucent-font-size-sm)",padding:"0 var(--lucent-space-2)",height:"22px"}};function ut({variant:t="neutral",size:n="md",dot:a=!1,children:o,style:r}){const i=ct[t],s=dt[n];return e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"var(--lucent-space-1)",height:s.height,padding:s.padding,fontSize:s.fontSize,fontFamily:"var(--lucent-font-family-base)",fontWeight:"var(--lucent-font-weight-medium)",lineHeight:1,borderRadius:"var(--lucent-radius-full)",background:i.bg,color:i.color,border:`1px solid ${i.border}`,whiteSpace:"nowrap",boxSizing:"border-box",...r},children:[a&&e.jsx("span",{style:{width:6,height:6,borderRadius:"var(--lucent-radius-full)",background:"currentColor",flexShrink:0}}),o]})}const pt={id:"badge",name:"Badge",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A small inline label for status, count, or category.",designIntent:'Badges communicate status or category at a glance. Match variant to semantic meaning — never use "danger" for non-critical states or "success" for neutral counts. Use dot=true when a single colour indicator is enough context (e.g. online status). Keep badge text short: 1–3 words maximum.',props:[{name:"variant",type:"enum",required:!1,default:"neutral",description:"Colour scheme conveying semantic meaning.",enumValues:["neutral","success","warning","danger","info","accent"]},{name:"size",type:"enum",required:!1,default:"md",description:"Controls height and font size.",enumValues:["sm","md"]},{name:"dot",type:"boolean",required:!1,default:"false",description:"Prepends a coloured dot indicator."},{name:"children",type:"ReactNode",required:!0,description:"Badge label."}],usageExamples:[{title:"Status",code:'<Badge variant="success" dot>Active</Badge>'},{title:"Count",code:'<Badge variant="danger">12</Badge>'},{title:"Category",code:'<Badge variant="info">Beta</Badge>'},{title:"Neutral tag",code:"<Badge>Draft</Badge>"}],compositionGraph:[],accessibility:{role:"status",notes:"Use aria-label on the parent element when badge meaning depends on context."}},ft={xs:24,sm:32,md:40,lg:56,xl:80},ht={xs:"var(--lucent-font-size-xs)",sm:"var(--lucent-font-size-xs)",md:"var(--lucent-font-size-sm)",lg:"var(--lucent-font-size-lg)",xl:"var(--lucent-font-size-xl)"};function mt(t,n){var o,r,i;if(n)return n.slice(0,2).toUpperCase();const a=t.trim().split(/\s+/);return a.length===1?(((o=a[0])==null?void 0:o[0])??"").toUpperCase():((((r=a[0])==null?void 0:r[0])??"")+(((i=a[a.length-1])==null?void 0:i[0])??"")).toUpperCase()}function gt({src:t,alt:n,size:a="md",initials:o,style:r,...i}){const s=ft[a],c=mt(n,o),l={width:s,height:s,borderRadius:"var(--lucent-radius-full)",flexShrink:0,display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",boxSizing:"border-box",userSelect:"none",...r};return t?e.jsx("img",{src:t,alt:n,width:s,height:s,style:{...l,objectFit:"cover"},...i}):e.jsx("span",{role:"img","aria-label":n,style:{...l,background:"var(--lucent-accent-default)",color:"var(--lucent-text-on-accent)",fontSize:ht[a],fontWeight:"var(--lucent-font-weight-semibold)",fontFamily:"var(--lucent-font-family-base)"},children:c})}const bt={id:"avatar",name:"Avatar",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A circular user image with initials fallback.",designIntent:"Always provide alt for accessibility — it is used to derive initials automatically when src is absent or fails. Use initials prop to override auto-derived initials (e.g. for non-Latin names). Size xs/sm suit table rows and compact lists; md is the default for comment threads; lg/xl for profile headers.",props:[{name:"src",type:"string",required:!1,description:"Image URL. Falls back to initials if omitted or fails to load."},{name:"alt",type:"string",required:!0,description:"Alt text and source for auto-derived initials."},{name:"size",type:"enum",required:!1,default:"md",description:"Diameter of the avatar.",enumValues:["xs","sm","md","lg","xl"]},{name:"initials",type:"string",required:!1,description:"Override auto-derived initials (max 2 characters)."}],usageExamples:[{title:"With image",code:'<Avatar src="/avatars/jane.jpg" alt="Jane Doe" />'},{title:"Initials fallback",code:'<Avatar alt="Jane Doe" />'},{title:"Large profile",code:'<Avatar src={user.avatar} alt={user.name} size="lg" />'},{title:"Custom initials",code:'<Avatar alt="张伟" initials="张" size="md" />'}],compositionGraph:[],accessibility:{role:"img",ariaAttributes:["aria-label"],notes:'When src is present, renders as <img> with alt. When showing initials, renders as <span role="img" aria-label>.'}},vt={xs:12,sm:16,md:24,lg:36},yt={xs:2.5,sm:2.5,md:2,lg:2};function $e({size:t="md",label:n="Loading…",color:a}){const o=vt[t],r=yt[t];return e.jsxs("span",{role:"status","aria-label":n,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"},children:[e.jsxs("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,style:{animation:"lucent-spin 0.7s linear infinite",color:a??"currentColor"},children:[e.jsx("style",{children:"@keyframes lucent-spin { to { transform: rotate(360deg); } }"}),e.jsx("circle",{cx:12,cy:12,r:10,stroke:"currentColor",strokeWidth:r,strokeOpacity:.2}),e.jsx("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:"currentColor",strokeWidth:r,strokeLinecap:"round"})]}),e.jsx("span",{style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap"},children:n})]})}const xt={id:"spinner",name:"Spinner",tier:"atom",domain:"neutral",specVersion:"0.1",description:"An animated loading indicator for async operations.",designIntent:"Use Spinner for indeterminate loading states of short duration (< 3s). For full-page or skeleton-level loading, prefer Skeleton instead. The label prop is visually hidden but read by screen readers — always set it to a meaningful description of what is loading.",props:[{name:"size",type:"enum",required:!1,default:"md",description:"Spinner diameter.",enumValues:["xs","sm","md","lg"]},{name:"label",type:"string",required:!1,default:"Loading…",description:"Visually hidden accessible label."},{name:"color",type:"string",required:!1,description:"Override colour (CSS value). Defaults to currentColor."}],usageExamples:[{title:"Default",code:"<Spinner />"},{title:"Inside button",code:'<Button loading><Spinner size="sm" label="Saving…" /></Button>'},{title:"Full-page overlay",code:`<div style={{ display: 'grid', placeItems: 'center', minHeight: '100vh' }}><Spinner size="lg" label="Loading dashboard…" /></div>`}],compositionGraph:[],accessibility:{role:"status",ariaAttributes:["aria-label"],notes:'The visible SVG is aria-hidden. The label is conveyed via a visually-hidden span inside role="status".'}};function wt({orientation:t="horizontal",label:n,spacing:a="var(--lucent-space-4)",style:o}){return t==="vertical"?e.jsx("span",{role:"separator","aria-orientation":"vertical",style:{display:"inline-block",width:"1px",alignSelf:"stretch",background:"var(--lucent-border-default)",margin:`0 ${a}`,flexShrink:0,...o}}):n?e.jsxs("div",{role:"separator","aria-label":n,style:{display:"flex",alignItems:"center",gap:"var(--lucent-space-3)",margin:`${a} 0`,...o},children:[e.jsx("span",{style:{flex:1,height:"1px",background:"var(--lucent-border-default)"}}),e.jsx("span",{style:{fontSize:"var(--lucent-font-size-xs)",fontFamily:"var(--lucent-font-family-base)",color:"var(--lucent-text-secondary)",whiteSpace:"nowrap",letterSpacing:"var(--lucent-letter-spacing-wide)",textTransform:"uppercase"},children:n}),e.jsx("span",{style:{flex:1,height:"1px",background:"var(--lucent-border-default)"}})]}):e.jsx("hr",{role:"separator",style:{border:"none",borderTop:"1px solid var(--lucent-border-default)",margin:`${a} 0`,width:"100%",...o}})}const kt={id:"divider",name:"Divider",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A visual separator between content sections, horizontal or vertical.",designIntent:'Use horizontal Divider to separate sections in a layout. Use vertical Divider inline between sibling elements (e.g. nav links, toolbar buttons). Use the label prop for "OR" separators in auth flows or form sections — never use a plain text node next to a divider for this.',props:[{name:"orientation",type:"enum",required:!1,default:"horizontal",description:"Direction of the divider line.",enumValues:["horizontal","vertical"]},{name:"label",type:"string",required:!1,description:'Optional centered label (horizontal only). Common use: "OR", "AND", section titles.'},{name:"spacing",type:"string",required:!1,default:"var(--lucent-space-4)",description:"Margin on the axis perpendicular to the line."}],usageExamples:[{title:"Section separator",code:"<Divider />"},{title:"With label",code:'<Divider label="OR" />'},{title:"Vertical in nav",code:`<nav style={{ display: 'flex', alignItems: 'center' }}><a>Home</a><Divider orientation="vertical" /><a>About</a></nav>`}],compositionGraph:[],accessibility:{role:"separator",ariaAttributes:["aria-orientation","aria-label"]}},St={sm:14,md:16},Tt=`
2
2
  @keyframes lucent-cb-pop {
3
3
  0% { transform: scale(1); }
4
4
  35% { transform: scale(0.82); }
@@ -10,7 +10,7 @@
10
10
  60% { transform: scale(1.15) rotate(2deg); }
11
11
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
12
12
  }
13
- `,oe=m.forwardRef(({label:t,size:n="md",indeterminate:a=!1,checked:o,defaultChecked:r,disabled:i,id:s,onChange:l,style:c,...h},g)=>{const u=m.useRef(null),p=s??`lucent-checkbox-${Math.random().toString(36).slice(2,7)}`,d=Xe[n],x=o!==void 0,[y,b]=m.useState(r??!1),f=x?!!o:y,v=m.useRef(f),[I,w]=m.useState(0);m.useEffect(()=>{!i&&v.current!==f&&(v.current=f,w(j=>j+1))},[f,i]);const S=m.useCallback(j=>{u.current=j,typeof g=="function"?g(j):g&&(g.current=j)},[g]);m.useEffect(()=>{u.current&&(u.current.indeterminate=a)},[a]);const D=j=>{x||b(j.target.checked),l==null||l(j)},q=i?"var(--lucent-text-disabled)":"var(--lucent-text-on-accent)",T={width:d,height:d,borderRadius:"4px",border:`1.5px solid ${i?"transparent":f||a?"var(--lucent-accent-default)":"var(--lucent-border-strong)"}`,background:i?"var(--lucent-surface-secondary)":f||a?"var(--lucent-accent-default)":"var(--lucent-surface)",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"background var(--lucent-duration-fast) var(--lucent-easing-default), border-color var(--lucent-duration-fast) var(--lucent-easing-default)",animation:I>0?"lucent-cb-pop 220ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards":void 0};return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:Je}),e.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:"var(--lucent-space-2)",cursor:i?"not-allowed":"pointer",fontFamily:"var(--lucent-font-family-base)",fontSize:n==="sm"?"var(--lucent-font-size-sm)":"var(--lucent-font-size-md)",color:i?"var(--lucent-text-disabled)":"var(--lucent-text-primary)",userSelect:"none",...c},children:[e.jsx("input",{ref:S,type:"checkbox",id:p,checked:x?o:y,disabled:i,onChange:D,style:{position:"absolute",opacity:0,width:0,height:0,margin:0,pointerEvents:"none"},...h}),e.jsxs("span",{"aria-hidden":!0,style:T,children:[f&&!a&&e.jsx("svg",{width:d-4,height:d-4,viewBox:"0 0 10 10",fill:"none",style:{animation:"lucent-cb-mark 200ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards"},children:e.jsx("path",{d:"M1.5 5L4 7.5L8.5 2.5",stroke:q,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})}),a&&e.jsx("svg",{width:d-4,height:d-4,viewBox:"0 0 10 10",fill:"none",style:{animation:"lucent-cb-mark 200ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards"},children:e.jsx("path",{d:"M2 5H8",stroke:q,strokeWidth:1.5,strokeLinecap:"round"})})]},I),t]})]})});oe.displayName="Checkbox";const Qe={id:"checkbox",name:"Checkbox",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A binary selection control for boolean values or multi-select lists.",designIntent:'Checkboxes represent independent boolean choices — they do not affect each other. Use a Checkbox for settings that take effect immediately (e.g. "Remember me") or for selecting multiple items from a list. When only one option may be active at a time, use Radio instead. The indeterminate state communicates a "select all" parent whose children are partially checked — never use it for a third logical state.',props:[{name:"checked",type:"boolean",required:!1,description:"Controlled checked state. Pair with onChange for controlled usage."},{name:"defaultChecked",type:"boolean",required:!1,default:"false",description:"Initial checked state for uncontrolled usage."},{name:"onChange",type:"function",required:!1,description:"Called when the checked state changes."},{name:"label",type:"string",required:!1,description:"Visible label rendered beside the checkbox."},{name:"indeterminate",type:"boolean",required:!1,default:"false",description:"Displays a dash to indicate a partially-checked parent state."},{name:"disabled",type:"boolean",required:!1,default:"false",description:"Prevents interaction and dims the control."},{name:"size",type:"enum",required:!1,default:"md",description:"Size of the checkbox box.",enumValues:["sm","md"]}],usageExamples:[{title:"Controlled",code:'<Checkbox checked={agreed} onChange={e => setAgreed(e.target.checked)} label="I agree to the terms" />'},{title:"Uncontrolled",code:'<Checkbox defaultChecked label="Send me updates" />'},{title:"Indeterminate",code:'<Checkbox indeterminate label="Select all" />'},{title:"Disabled",code:'<Checkbox disabled label="Unavailable option" />'}],compositionGraph:[],accessibility:{role:"checkbox",ariaAttributes:["aria-checked","aria-disabled"],keyboardInteractions:["Space — toggles checked state"]}},Ze=`
13
+ `,xe=f.forwardRef(({label:t,size:n="md",indeterminate:a=!1,checked:o,defaultChecked:r,disabled:i,id:s,onChange:c,style:l,...u},m)=>{const d=f.useRef(null),g=s??`lucent-checkbox-${Math.random().toString(36).slice(2,7)}`,p=St[n],x=o!==void 0,[b,y]=f.useState(r??!1),h=x?!!o:b,v=f.useRef(h),[j,S]=f.useState(0);f.useEffect(()=>{!i&&v.current!==h&&(v.current=h,S(C=>C+1))},[h,i]);const T=f.useCallback(C=>{d.current=C,typeof m=="function"?m(C):m&&(m.current=C)},[m]);f.useEffect(()=>{d.current&&(d.current.indeterminate=a)},[a]);const z=C=>{x||y(C.target.checked),c==null||c(C)},q=i?"var(--lucent-text-disabled)":"var(--lucent-text-on-accent)",w={width:p,height:p,borderRadius:"4px",border:`1.5px solid ${i?"transparent":h||a?"var(--lucent-accent-default)":"var(--lucent-border-strong)"}`,background:i?"var(--lucent-surface-secondary)":h||a?"var(--lucent-accent-default)":"var(--lucent-surface)",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"background var(--lucent-duration-fast) var(--lucent-easing-default), border-color var(--lucent-duration-fast) var(--lucent-easing-default)",animation:j>0?"lucent-cb-pop 220ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards":void 0};return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:Tt}),e.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:"var(--lucent-space-2)",cursor:i?"not-allowed":"pointer",fontFamily:"var(--lucent-font-family-base)",fontSize:n==="sm"?"var(--lucent-font-size-sm)":"var(--lucent-font-size-md)",color:i?"var(--lucent-text-disabled)":"var(--lucent-text-primary)",userSelect:"none",...l},children:[e.jsx("input",{ref:T,type:"checkbox",id:g,checked:x?o:b,disabled:i,onChange:z,style:{position:"absolute",opacity:0,width:0,height:0,margin:0,pointerEvents:"none"},...u}),e.jsxs("span",{"aria-hidden":!0,style:w,children:[h&&!a&&e.jsx("svg",{width:p-4,height:p-4,viewBox:"0 0 10 10",fill:"none",style:{animation:"lucent-cb-mark 200ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards"},children:e.jsx("path",{d:"M1.5 5L4 7.5L8.5 2.5",stroke:q,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})}),a&&e.jsx("svg",{width:p-4,height:p-4,viewBox:"0 0 10 10",fill:"none",style:{animation:"lucent-cb-mark 200ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards"},children:e.jsx("path",{d:"M2 5H8",stroke:q,strokeWidth:1.5,strokeLinecap:"round"})})]},j),t]})]})});xe.displayName="Checkbox";const jt={id:"checkbox",name:"Checkbox",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A binary selection control for boolean values or multi-select lists.",designIntent:'Checkboxes represent independent boolean choices — they do not affect each other. Use a Checkbox for settings that take effect immediately (e.g. "Remember me") or for selecting multiple items from a list. When only one option may be active at a time, use Radio instead. The indeterminate state communicates a "select all" parent whose children are partially checked — never use it for a third logical state.',props:[{name:"checked",type:"boolean",required:!1,description:"Controlled checked state. Pair with onChange for controlled usage."},{name:"defaultChecked",type:"boolean",required:!1,default:"false",description:"Initial checked state for uncontrolled usage."},{name:"onChange",type:"function",required:!1,description:"Called when the checked state changes."},{name:"label",type:"string",required:!1,description:"Visible label rendered beside the checkbox."},{name:"indeterminate",type:"boolean",required:!1,default:"false",description:"Displays a dash to indicate a partially-checked parent state."},{name:"disabled",type:"boolean",required:!1,default:"false",description:"Prevents interaction and dims the control."},{name:"size",type:"enum",required:!1,default:"md",description:"Size of the checkbox box.",enumValues:["sm","md"]}],usageExamples:[{title:"Controlled",code:'<Checkbox checked={agreed} onChange={e => setAgreed(e.target.checked)} label="I agree to the terms" />'},{title:"Uncontrolled",code:'<Checkbox defaultChecked label="Send me updates" />'},{title:"Indeterminate",code:'<Checkbox indeterminate label="Select all" />'},{title:"Disabled",code:'<Checkbox disabled label="Unavailable option" />'}],compositionGraph:[],accessibility:{role:"checkbox",ariaAttributes:["aria-checked","aria-disabled"],keyboardInteractions:["Space — toggles checked state"]}},Ct=`
14
14
  @keyframes lucent-radio-pop {
15
15
  0% { transform: scale(1); }
16
16
  35% { transform: scale(0.82); }
@@ -22,7 +22,7 @@
22
22
  60% { transform: scale(1.2); }
23
23
  100% { opacity: 1; transform: scale(1); }
24
24
  }
25
- `,be=m.createContext(null);function ve({name:t,value:n,onChange:a,disabled:o,orientation:r="vertical",label:i,children:s}){return e.jsx(be.Provider,{value:{name:t,value:n,onChange:a,disabled:o??!1},children:e.jsx("div",{role:"radiogroup","aria-label":i,style:{display:"flex",flexDirection:r==="vertical"?"column":"row",gap:r==="vertical"?"var(--lucent-space-3)":"var(--lucent-space-4)",flexWrap:"wrap"},children:s})})}const et={sm:14,md:16};function tt({value:t,label:n,size:a="md",disabled:o,id:r,onChange:i,checked:s,...l}){const c=m.useContext(be),h=r??`lucent-radio-${Math.random().toString(36).slice(2,7)}`,g=et[a],u=o??(c==null?void 0:c.disabled)??!1,p=c?c.value===t:!!s,d=m.useRef(p),[x,y]=m.useState(0);m.useEffect(()=>{!u&&d.current!==p&&(d.current=p,y(I=>I+1))},[p,u]);const b=I=>{c==null||c.onChange(t),i==null||i(I)},f={width:g/2,height:g/2,borderRadius:"50%",background:u?"var(--lucent-text-disabled)":"var(--lucent-text-on-accent)",animation:p?"lucent-radio-dot 200ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards":void 0,opacity:p?1:0},v={width:g,height:g,borderRadius:"50%",border:`1.5px solid ${u?"transparent":p?"var(--lucent-accent-default)":"var(--lucent-border-strong)"}`,background:u?"var(--lucent-surface-secondary)":p?"var(--lucent-accent-default)":"var(--lucent-surface)",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"background var(--lucent-duration-fast) var(--lucent-easing-default), border-color var(--lucent-duration-fast) var(--lucent-easing-default)",animation:x>0?"lucent-radio-pop 220ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards":void 0};return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:Ze}),e.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:"var(--lucent-space-2)",cursor:u?"not-allowed":"pointer",fontFamily:"var(--lucent-font-family-base)",fontSize:a==="sm"?"var(--lucent-font-size-sm)":"var(--lucent-font-size-md)",color:u?"var(--lucent-text-disabled)":"var(--lucent-text-primary)",userSelect:"none"},children:[e.jsx("input",{type:"radio",id:h,value:t,name:(c==null?void 0:c.name)??l.name,checked:p,disabled:u,onChange:b,style:{position:"absolute",opacity:0,width:0,height:0,margin:0,pointerEvents:"none"},...l}),e.jsx("span",{"aria-hidden":!0,style:v,children:e.jsx("span",{style:f})},x),n]})]})}function nt({defaultValue:t="",onChange:n,...a}){const[o,r]=m.useState(t);return e.jsx(ve,{...a,value:o,onChange:i=>{r(i),n==null||n(i)}})}const at={id:"radio",name:"Radio",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A mutually exclusive selection control. Use RadioGroup to manage a set of options.",designIntent:"Radio buttons enforce a single selection from a small set of options (typically 2–6). Always wrap Radio in a RadioGroup so name and selection state are shared automatically. For larger option sets (7+) prefer a Select. For independent true/false choices, use a Checkbox. RadioGroup orientation should match how the options relate — vertical for distinct choices, horizontal for brief inline options (e.g. Yes / No).",props:[{name:"value",type:"string",required:!0,description:"The value submitted when this radio is selected."},{name:"label",type:"string",required:!1,description:"Visible label rendered beside the radio button."},{name:"disabled",type:"boolean",required:!1,default:"false",description:"Prevents interaction. Inherits group-level disabled when inside RadioGroup."},{name:"size",type:"enum",required:!1,default:"md",description:"Size of the radio button circle.",enumValues:["sm","md"]}],usageExamples:[{title:"Controlled RadioGroup",code:`
25
+ `,We=f.createContext(null);function Ve({name:t,value:n,onChange:a,disabled:o,orientation:r="vertical",label:i,children:s}){return e.jsx(We.Provider,{value:{name:t,value:n,onChange:a,disabled:o??!1},children:e.jsx("div",{role:"radiogroup","aria-label":i,style:{display:"flex",flexDirection:r==="vertical"?"column":"row",gap:r==="vertical"?"var(--lucent-space-3)":"var(--lucent-space-4)",flexWrap:"wrap"},children:s})})}const It={sm:14,md:16};function Mt({value:t,label:n,size:a="md",disabled:o,id:r,onChange:i,checked:s,...c}){const l=f.useContext(We),u=r??`lucent-radio-${Math.random().toString(36).slice(2,7)}`,m=It[a],d=o??(l==null?void 0:l.disabled)??!1,g=l?l.value===t:!!s,p=f.useRef(g),[x,b]=f.useState(0);f.useEffect(()=>{!d&&p.current!==g&&(p.current=g,b(j=>j+1))},[g,d]);const y=j=>{l==null||l.onChange(t),i==null||i(j)},h={width:m/2,height:m/2,borderRadius:"50%",background:d?"var(--lucent-text-disabled)":"var(--lucent-text-on-accent)",animation:g?"lucent-radio-dot 200ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards":void 0,opacity:g?1:0},v={width:m,height:m,borderRadius:"50%",border:`1.5px solid ${d?"transparent":g?"var(--lucent-accent-default)":"var(--lucent-border-strong)"}`,background:d?"var(--lucent-surface-secondary)":g?"var(--lucent-accent-default)":"var(--lucent-surface)",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"background var(--lucent-duration-fast) var(--lucent-easing-default), border-color var(--lucent-duration-fast) var(--lucent-easing-default)",animation:x>0?"lucent-radio-pop 220ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards":void 0};return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:Ct}),e.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:"var(--lucent-space-2)",cursor:d?"not-allowed":"pointer",fontFamily:"var(--lucent-font-family-base)",fontSize:a==="sm"?"var(--lucent-font-size-sm)":"var(--lucent-font-size-md)",color:d?"var(--lucent-text-disabled)":"var(--lucent-text-primary)",userSelect:"none"},children:[e.jsx("input",{type:"radio",id:u,value:t,name:(l==null?void 0:l.name)??c.name,checked:g,disabled:d,onChange:y,style:{position:"absolute",opacity:0,width:0,height:0,margin:0,pointerEvents:"none"},...c}),e.jsx("span",{"aria-hidden":!0,style:v,children:e.jsx("span",{style:h})},x),n]})]})}function Dt({defaultValue:t="",onChange:n,...a}){const[o,r]=f.useState(t);return e.jsx(Ve,{...a,value:o,onChange:i=>{r(i),n==null||n(i)}})}const zt={id:"radio",name:"Radio",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A mutually exclusive selection control. Use RadioGroup to manage a set of options.",designIntent:"Radio buttons enforce a single selection from a small set of options (typically 2–6). Always wrap Radio in a RadioGroup so name and selection state are shared automatically. For larger option sets (7+) prefer a Select. For independent true/false choices, use a Checkbox. RadioGroup orientation should match how the options relate — vertical for distinct choices, horizontal for brief inline options (e.g. Yes / No).",props:[{name:"value",type:"string",required:!0,description:"The value submitted when this radio is selected."},{name:"label",type:"string",required:!1,description:"Visible label rendered beside the radio button."},{name:"disabled",type:"boolean",required:!1,default:"false",description:"Prevents interaction. Inherits group-level disabled when inside RadioGroup."},{name:"size",type:"enum",required:!1,default:"md",description:"Size of the radio button circle.",enumValues:["sm","md"]}],usageExamples:[{title:"Controlled RadioGroup",code:`
26
26
  <RadioGroup name="plan" value={plan} onChange={setPlan}>
27
27
  <Radio value="free" label="Free" />
28
28
  <Radio value="pro" label="Pro" />
@@ -36,23 +36,23 @@
36
36
  <RadioGroup name="tier" value="basic" onChange={() => {}} disabled>
37
37
  <Radio value="basic" label="Basic" />
38
38
  <Radio value="advanced" label="Advanced" />
39
- </RadioGroup>`.trim()}],compositionGraph:[{componentId:"radio-group",componentName:"RadioGroup",role:"container",required:!0},{componentId:"radio",componentName:"Radio",role:"item",required:!0}],accessibility:{role:"radio",ariaAttributes:["aria-checked","aria-disabled"],keyboardInteractions:["Arrow keys — move selection within the group","Space — selects the focused radio"]}},rt={sm:{track:[28,16],thumb:12},md:{track:[36,20],thumb:16},lg:{track:[44,24],thumb:20}},ce="cubic-bezier(0.34, 1.56, 0.64, 1)",ot=`
39
+ </RadioGroup>`.trim()}],compositionGraph:[{componentId:"radio-group",componentName:"RadioGroup",role:"container",required:!0},{componentId:"radio",componentName:"Radio",role:"item",required:!0}],accessibility:{role:"radio",ariaAttributes:["aria-checked","aria-disabled"],keyboardInteractions:["Arrow keys — move selection within the group","Space — selects the focused radio"]}},At={sm:{track:[28,16],thumb:12},md:{track:[36,20],thumb:16},lg:{track:[44,24],thumb:20}},ze="cubic-bezier(0.34, 1.56, 0.64, 1)",Et=`
40
40
  @keyframes lucent-toggle-pop {
41
41
  0% { transform: scale(1); }
42
42
  35% { transform: scale(0.94); }
43
43
  70% { transform: scale(1.06); }
44
44
  100% { transform: scale(1); }
45
45
  }
46
- `;function it({label:t,size:n="md",checked:a,defaultChecked:o,disabled:r,id:i,onChange:s,style:l,...c}){const h=i??`lucent-toggle-${Math.random().toString(36).slice(2,7)}`,g=a!==void 0,[u,p]=m.useState(o??!1),d=g?!!a:u,x=m.useRef(d),[y,b]=m.useState(0);m.useEffect(()=>{!r&&x.current!==d&&(x.current=d,b(D=>D+1))},[d,r]);const{track:[f,v],thumb:I}=rt[n],w=d?f-I-2:2,S=D=>{g||p(D.target.checked),s==null||s(D)};return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:ot}),e.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:"var(--lucent-space-2)",cursor:r?"not-allowed":"pointer",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-md)",color:r?"var(--lucent-text-disabled)":"var(--lucent-text-primary)",userSelect:"none",...l},children:[e.jsx("input",{type:"checkbox",role:"switch",id:h,checked:g?a:u,disabled:r,onChange:S,"aria-checked":d,style:{position:"absolute",opacity:0,width:0,height:0,margin:0,pointerEvents:"none"},...c}),e.jsx("span",{"aria-hidden":!0,style:{position:"relative",width:f,height:v,borderRadius:v/2,background:r?"var(--lucent-surface-secondary)":d?"var(--lucent-accent-default)":"var(--lucent-border-strong)",flexShrink:0,transition:"background var(--lucent-duration-fast) var(--lucent-easing-default)",animation:y>0?`lucent-toggle-pop 240ms ${ce} forwards`:void 0},children:e.jsx("span",{style:{position:"absolute",top:2,left:w,width:I,height:I,borderRadius:"50%",background:"#ffffff",boxShadow:"0 1px 3px rgb(0 0 0 / 0.2)",transition:`left 260ms ${ce}`}})},y),t]})]})}const st={id:"toggle",name:"Toggle",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A sliding switch for immediately-applied binary settings.",designIntent:'Toggles are for settings that take effect the moment they are flipped — no Save button needed. If the action requires a confirmation step or only applies on form submit, use a Checkbox instead. The "on" state is visually represented by the accent colour so the meaning is clear without relying on text alone. Keep the label short (2–4 words) and phrase it as the enabled state (e.g. "Dark mode", not "Enable dark mode").',props:[{name:"checked",type:"boolean",required:!1,description:"Controlled on/off state. Pair with onChange for controlled usage."},{name:"defaultChecked",type:"boolean",required:!1,default:"false",description:"Initial state for uncontrolled usage."},{name:"onChange",type:"function",required:!1,description:"Called when the toggle is flipped."},{name:"label",type:"string",required:!1,description:"Visible label rendered beside the toggle."},{name:"size",type:"enum",required:!1,default:"md",description:"Controls the track and thumb size.",enumValues:["sm","md","lg"]},{name:"disabled",type:"boolean",required:!1,default:"false",description:"Prevents interaction and dims the control."}],usageExamples:[{title:"Controlled",code:'<Toggle checked={darkMode} onChange={e => setDarkMode(e.target.checked)} label="Dark mode" />'},{title:"Uncontrolled",code:'<Toggle defaultChecked label="Email notifications" />'},{title:"Sizes",code:`<Toggle size="sm" label="Compact" />
46
+ `;function Rt({label:t,size:n="md",checked:a,defaultChecked:o,disabled:r,id:i,onChange:s,style:c,...l}){const u=i??`lucent-toggle-${Math.random().toString(36).slice(2,7)}`,m=a!==void 0,[d,g]=f.useState(o??!1),p=m?!!a:d,x=f.useRef(p),[b,y]=f.useState(0);f.useEffect(()=>{!r&&x.current!==p&&(x.current=p,y(z=>z+1))},[p,r]);const{track:[h,v],thumb:j}=At[n],S=p?h-j-2:2,T=z=>{m||g(z.target.checked),s==null||s(z)};return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:Et}),e.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:"var(--lucent-space-2)",cursor:r?"not-allowed":"pointer",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-md)",color:r?"var(--lucent-text-disabled)":"var(--lucent-text-primary)",userSelect:"none",...c},children:[e.jsx("input",{type:"checkbox",role:"switch",id:u,checked:m?a:d,disabled:r,onChange:T,"aria-checked":p,style:{position:"absolute",opacity:0,width:0,height:0,margin:0,pointerEvents:"none"},...l}),e.jsx("span",{"aria-hidden":!0,style:{position:"relative",width:h,height:v,borderRadius:v/2,background:r?"var(--lucent-surface-secondary)":p?"var(--lucent-accent-default)":"var(--lucent-border-strong)",flexShrink:0,transition:"background var(--lucent-duration-fast) var(--lucent-easing-default)",animation:b>0?`lucent-toggle-pop 240ms ${ze} forwards`:void 0},children:e.jsx("span",{style:{position:"absolute",top:2,left:S,width:j,height:j,borderRadius:"50%",background:"#ffffff",boxShadow:"0 1px 3px rgb(0 0 0 / 0.2)",transition:`left 260ms ${ze}`}})},b),t]})]})}const qt={id:"toggle",name:"Toggle",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A sliding switch for immediately-applied binary settings.",designIntent:'Toggles are for settings that take effect the moment they are flipped — no Save button needed. If the action requires a confirmation step or only applies on form submit, use a Checkbox instead. The "on" state is visually represented by the accent colour so the meaning is clear without relying on text alone. Keep the label short (2–4 words) and phrase it as the enabled state (e.g. "Dark mode", not "Enable dark mode").',props:[{name:"checked",type:"boolean",required:!1,description:"Controlled on/off state. Pair with onChange for controlled usage."},{name:"defaultChecked",type:"boolean",required:!1,default:"false",description:"Initial state for uncontrolled usage."},{name:"onChange",type:"function",required:!1,description:"Called when the toggle is flipped."},{name:"label",type:"string",required:!1,description:"Visible label rendered beside the toggle."},{name:"size",type:"enum",required:!1,default:"md",description:"Controls the track and thumb size.",enumValues:["sm","md","lg"]},{name:"disabled",type:"boolean",required:!1,default:"false",description:"Prevents interaction and dims the control."}],usageExamples:[{title:"Controlled",code:'<Toggle checked={darkMode} onChange={e => setDarkMode(e.target.checked)} label="Dark mode" />'},{title:"Uncontrolled",code:'<Toggle defaultChecked label="Email notifications" />'},{title:"Sizes",code:`<Toggle size="sm" label="Compact" />
47
47
  <Toggle size="md" label="Default" />
48
- <Toggle size="lg" label="Large" />`},{title:"Disabled",code:'<Toggle disabled label="Unavailable setting" />'}],compositionGraph:[],accessibility:{role:"switch",ariaAttributes:["aria-checked","aria-disabled"],keyboardInteractions:["Space — toggles the switch state"]}},lt={sm:"32px",md:"40px",lg:"46px"},ct={sm:"var(--lucent-font-size-sm)",md:"var(--lucent-font-size-md)",lg:"var(--lucent-font-size-lg)"},ye=m.forwardRef(({options:t,size:n="md",label:a,helperText:o,errorText:r,placeholder:i,disabled:s,id:l,style:c,...h},g)=>{const u=l??`lucent-select-${Math.random().toString(36).slice(2,7)}`,p=!!r;return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--lucent-space-1)",width:"100%"},children:[a&&e.jsx("label",{htmlFor:u,style:{fontSize:"var(--lucent-font-size-sm)",fontWeight:"var(--lucent-font-weight-medium)",color:"var(--lucent-text-primary)",fontFamily:"var(--lucent-font-family-base)"},children:a}),e.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center"},children:[e.jsxs("select",{ref:g,id:u,disabled:s,"aria-invalid":p,"aria-describedby":p?`${u}-error`:o?`${u}-helper`:void 0,style:{width:"100%",height:lt[n],padding:"0 var(--lucent-space-8) 0 var(--lucent-space-3)",fontSize:ct[n],fontFamily:"var(--lucent-font-family-base)",color:"var(--lucent-text-primary)",background:"var(--lucent-surface)",border:`1px solid ${p?"var(--lucent-danger-default)":"var(--lucent-border-default)"}`,borderRadius:"var(--lucent-radius-lg)",outline:"none",boxSizing:"border-box",appearance:"none",cursor:s?"not-allowed":"pointer",transition:"border-color var(--lucent-duration-fast) var(--lucent-easing-default)",...c},onMouseEnter:d=>{var x;!s&&d.currentTarget!==document.activeElement&&(d.currentTarget.style.borderColor=p?"var(--lucent-danger-default)":"var(--lucent-border-strong)"),(x=h.onMouseEnter)==null||x.call(h,d)},onMouseLeave:d=>{var x;!s&&d.currentTarget!==document.activeElement&&(d.currentTarget.style.borderColor=p?"var(--lucent-danger-default)":"var(--lucent-border-default)"),(x=h.onMouseLeave)==null||x.call(h,d)},onFocus:d=>{var x;d.currentTarget.style.borderColor=p?"var(--lucent-danger-default)":"var(--lucent-focus-ring)",d.currentTarget.style.boxShadow=`0 0 0 3px ${p?"var(--lucent-danger-subtle)":"var(--lucent-accent-subtle)"}`,(x=h.onFocus)==null||x.call(h,d)},onBlur:d=>{var x;d.currentTarget.style.borderColor=p?"var(--lucent-danger-default)":"var(--lucent-border-default)",d.currentTarget.style.boxShadow="none",(x=h.onBlur)==null||x.call(h,d)},...h,children:[i&&e.jsx("option",{value:"",disabled:!0,children:i}),t.map(d=>e.jsx("option",{value:d.value,disabled:d.disabled,children:d.label},d.value))]}),e.jsx("span",{"aria-hidden":!0,style:{position:"absolute",right:"var(--lucent-space-3)",pointerEvents:"none",color:"var(--lucent-text-secondary)",display:"flex",alignItems:"center"},children:e.jsx("svg",{width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}),p&&e.jsx("span",{id:`${u}-error`,role:"alert",style:{fontSize:"var(--lucent-font-size-sm)",color:"var(--lucent-danger-text)",fontFamily:"var(--lucent-font-family-base)"},children:r}),!p&&o&&e.jsx("span",{id:`${u}-helper`,style:{fontSize:"var(--lucent-font-size-sm)",color:"var(--lucent-text-secondary)",fontFamily:"var(--lucent-font-family-base)"},children:o})]})});ye.displayName="Select";const dt={id:"select",name:"Select",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A dropdown for choosing one option from a list.",designIntent:"Select is best for 5–15 options where showing all at once would be too noisy. For fewer than 5 options, prefer RadioGroup (always-visible, faster to scan). For search-filtered or async options, a Combobox (Wave 3) is more appropriate. Always provide a placeholder when no default is sensible — this communicates the field is required and prevents silent zero-state submissions.",props:[{name:"options",type:"array",required:!0,description:"Array of { value, label, disabled? } option objects."},{name:"value",type:"string",required:!1,description:"Controlled selected value. Pair with onChange."},{name:"onChange",type:"function",required:!1,description:"Called when the selected value changes."},{name:"placeholder",type:"string",required:!1,description:"Disabled first option shown when no value is selected."},{name:"label",type:"string",required:!1,description:"Visible label rendered above the select."},{name:"helperText",type:"string",required:!1,description:"Supplementary hint shown below the select."},{name:"errorText",type:"string",required:!1,description:"Validation error message. Replaces helperText and applies error styling."},{name:"size",type:"enum",required:!1,default:"md",description:"Controls the height of the select control.",enumValues:["sm","md","lg"]},{name:"disabled",type:"boolean",required:!1,default:"false",description:"Prevents interaction."}],usageExamples:[{title:"Controlled",code:`
48
+ <Toggle size="lg" label="Large" />`},{title:"Disabled",code:'<Toggle disabled label="Unavailable setting" />'}],compositionGraph:[],accessibility:{role:"switch",ariaAttributes:["aria-checked","aria-disabled"],keyboardInteractions:["Space — toggles the switch state"]}},Lt={sm:"32px",md:"40px",lg:"46px"},Bt={sm:"var(--lucent-font-size-sm)",md:"var(--lucent-font-size-md)",lg:"var(--lucent-font-size-lg)"},we=f.forwardRef(({options:t,size:n="md",label:a,helperText:o,errorText:r,placeholder:i,disabled:s,id:c,style:l,...u},m)=>{const d=c??`lucent-select-${Math.random().toString(36).slice(2,7)}`,g=!!r;return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--lucent-space-1)",width:"100%",...l},children:[a&&e.jsx("label",{htmlFor:d,style:{fontSize:"var(--lucent-font-size-sm)",fontWeight:"var(--lucent-font-weight-medium)",color:"var(--lucent-text-primary)",fontFamily:"var(--lucent-font-family-base)"},children:a}),e.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center"},children:[e.jsxs("select",{ref:m,id:d,disabled:s,"aria-invalid":g,"aria-describedby":g?`${d}-error`:o?`${d}-helper`:void 0,style:{width:"100%",height:Lt[n],padding:"0 var(--lucent-space-8) 0 var(--lucent-space-3)",fontSize:Bt[n],fontFamily:"var(--lucent-font-family-base)",color:"var(--lucent-text-primary)",background:"var(--lucent-surface)",border:`1px solid ${g?"var(--lucent-danger-default)":"var(--lucent-border-default)"}`,borderRadius:"var(--lucent-radius-lg)",outline:"none",boxSizing:"border-box",appearance:"none",cursor:s?"not-allowed":"pointer",transition:"border-color var(--lucent-duration-fast) var(--lucent-easing-default)"},onMouseEnter:p=>{var x;!s&&p.currentTarget!==document.activeElement&&(p.currentTarget.style.borderColor=g?"var(--lucent-danger-default)":"var(--lucent-border-strong)"),(x=u.onMouseEnter)==null||x.call(u,p)},onMouseLeave:p=>{var x;!s&&p.currentTarget!==document.activeElement&&(p.currentTarget.style.borderColor=g?"var(--lucent-danger-default)":"var(--lucent-border-default)"),(x=u.onMouseLeave)==null||x.call(u,p)},onFocus:p=>{var x;p.currentTarget.style.borderColor=g?"var(--lucent-danger-default)":"var(--lucent-focus-ring)",p.currentTarget.style.boxShadow=`0 0 0 3px ${g?"var(--lucent-danger-subtle)":"var(--lucent-accent-subtle)"}`,(x=u.onFocus)==null||x.call(u,p)},onBlur:p=>{var x;p.currentTarget.style.borderColor=g?"var(--lucent-danger-default)":"var(--lucent-border-default)",p.currentTarget.style.boxShadow="none",(x=u.onBlur)==null||x.call(u,p)},...u,children:[i&&e.jsx("option",{value:"",disabled:!0,children:i}),t.map(p=>e.jsx("option",{value:p.value,disabled:p.disabled,children:p.label},p.value))]}),e.jsx("span",{"aria-hidden":!0,style:{position:"absolute",right:"var(--lucent-space-3)",pointerEvents:"none",color:"var(--lucent-text-secondary)",display:"flex",alignItems:"center"},children:e.jsx("svg",{width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}),g&&e.jsx("span",{id:`${d}-error`,role:"alert",style:{fontSize:"var(--lucent-font-size-sm)",color:"var(--lucent-danger-text)",fontFamily:"var(--lucent-font-family-base)"},children:r}),!g&&o&&e.jsx("span",{id:`${d}-helper`,style:{fontSize:"var(--lucent-font-size-sm)",color:"var(--lucent-text-secondary)",fontFamily:"var(--lucent-font-family-base)"},children:o})]})});we.displayName="Select";const Ft={id:"select",name:"Select",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A dropdown for choosing one option from a list.",designIntent:"Select is best for 5–15 options where showing all at once would be too noisy. For fewer than 5 options, prefer RadioGroup (always-visible, faster to scan). For search-filtered or async options, a Combobox (Wave 3) is more appropriate. Always provide a placeholder when no default is sensible — this communicates the field is required and prevents silent zero-state submissions.",props:[{name:"options",type:"array",required:!0,description:"Array of { value, label, disabled? } option objects."},{name:"value",type:"string",required:!1,description:"Controlled selected value. Pair with onChange."},{name:"onChange",type:"function",required:!1,description:"Called when the selected value changes."},{name:"placeholder",type:"string",required:!1,description:"Disabled first option shown when no value is selected."},{name:"label",type:"string",required:!1,description:"Visible label rendered above the select."},{name:"helperText",type:"string",required:!1,description:"Supplementary hint shown below the select."},{name:"errorText",type:"string",required:!1,description:"Validation error message. Replaces helperText and applies error styling."},{name:"size",type:"enum",required:!1,default:"md",description:"Controls the height of the select control.",enumValues:["sm","md","lg"]},{name:"disabled",type:"boolean",required:!1,default:"false",description:"Prevents interaction."}],usageExamples:[{title:"Controlled",code:`
49
49
  <Select
50
50
  label="Country"
51
51
  placeholder="Choose a country"
52
52
  options={countries}
53
53
  value={country}
54
54
  onChange={e => setCountry(e.target.value)}
55
- />`.trim()},{title:"With validation error",code:'<Select label="Role" options={roles} errorText="Please select a role" />'},{title:"With helper text",code:'<Select label="Timezone" options={timezones} helperText="Used for scheduling notifications" />'}],compositionGraph:[],accessibility:{role:"combobox",ariaAttributes:["aria-invalid","aria-describedby"],keyboardInteractions:["Enter / Space — opens the option list","Arrow keys — navigate options","Escape — closes the list"]}},ut={neutral:{bg:"var(--lucent-surface-secondary)",color:"var(--lucent-text-secondary)",border:"var(--lucent-border-default)",dismissHover:"var(--lucent-border-strong)"},accent:{bg:"var(--lucent-accent-subtle)",color:"var(--lucent-accent-active)",border:"var(--lucent-accent-subtle)",dismissHover:"var(--lucent-accent-default)"},success:{bg:"var(--lucent-success-subtle)",color:"var(--lucent-success-text)",border:"var(--lucent-success-subtle)",dismissHover:"var(--lucent-success-default)"},warning:{bg:"var(--lucent-warning-subtle)",color:"var(--lucent-warning-text)",border:"var(--lucent-warning-subtle)",dismissHover:"var(--lucent-warning-default)"},danger:{bg:"var(--lucent-danger-subtle)",color:"var(--lucent-danger-text)",border:"var(--lucent-danger-subtle)",dismissHover:"var(--lucent-danger-default)"},info:{bg:"var(--lucent-info-subtle)",color:"var(--lucent-info-text)",border:"var(--lucent-info-subtle)",dismissHover:"var(--lucent-info-default)"}},pt={sm:{fontSize:"var(--lucent-font-size-xs)",height:"20px",padding:"0 var(--lucent-space-2)",iconSize:10,gap:"var(--lucent-space-1)"},md:{fontSize:"var(--lucent-font-size-sm)",height:"24px",padding:"0 var(--lucent-space-2)",iconSize:12,gap:"var(--lucent-space-1)"}};function ft({children:t,variant:n="neutral",size:a="md",onDismiss:o,disabled:r}){const i=ut[n],s=pt[a];return e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:s.gap,height:s.height,padding:o?"0 var(--lucent-space-1) 0 var(--lucent-space-2)":s.padding,fontSize:s.fontSize,fontFamily:"var(--lucent-font-family-base)",fontWeight:"var(--lucent-font-weight-medium)",lineHeight:1,borderRadius:"var(--lucent-radius-full)",background:i.bg,color:i.color,border:`1px solid ${i.border}`,whiteSpace:"nowrap",boxSizing:"border-box",opacity:r?.5:1},children:[t,o&&e.jsx("button",{type:"button",onClick:r?void 0:o,disabled:r,"aria-label":"Dismiss",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:s.iconSize+4,height:s.iconSize+4,padding:0,border:"none",borderRadius:"var(--lucent-radius-full)",background:"transparent",color:"inherit",cursor:r?"not-allowed":"pointer",flexShrink:0,lineHeight:1},onMouseEnter:l=>{r||(l.currentTarget.style.background=i.dismissHover+"33")},onMouseLeave:l=>{l.currentTarget.style.background="transparent"},children:e.jsx("svg",{width:s.iconSize,height:s.iconSize,viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",children:e.jsx("path",{d:"M2 2L8 8M8 2L2 8"})})})]})}const ht={id:"tag",name:"Tag",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A dismissible label for applied filters, selected values, or categorisation.",designIntent:"Tags represent user-applied selections that can be removed — filters, multi-select values, categories. They differ from Badge in that they are interactive: provide onDismiss when the user should be able to remove the tag. Without onDismiss they render as a static pill (identical to Badge in purpose). Use semantic variants to match meaning; default to neutral for user-generated content where no semantic applies.",props:[{name:"children",type:"ReactNode",required:!0,description:"Tag label content."},{name:"variant",type:"enum",required:!1,default:"neutral",description:"Colour scheme conveying semantic meaning.",enumValues:["neutral","accent","success","warning","danger","info"]},{name:"size",type:"enum",required:!1,default:"md",description:"Controls height and font size.",enumValues:["sm","md"]},{name:"onDismiss",type:"function",required:!1,description:"When provided, renders an × button that calls this handler on click."},{name:"disabled",type:"boolean",required:!1,default:"false",description:"Dims the tag and prevents the dismiss action."}],usageExamples:[{title:"Dismissible filter",code:"<Tag onDismiss={() => removeFilter('react')}>React</Tag>"},{title:"Multi-select value",code:'<Tag variant="accent" onDismiss={() => deselect(id)}>Jane Doe</Tag>'},{title:"Static category",code:'<Tag variant="info">Beta</Tag>'},{title:"Danger (removable)",code:'<Tag variant="danger" onDismiss={handleRemove}>Blocked</Tag>'}],compositionGraph:[],accessibility:{role:"group",notes:'The dismiss button has aria-label="Dismiss" and is keyboard-focusable.',keyboardInteractions:["Enter / Space — activates the dismiss button when focused"]}},L=5,mt={top:{bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:L+3},bottom:{top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:L+3},left:{right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:L+3},right:{left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:L+3}},gt={top:{bottom:-L,left:"50%",transform:"translateX(-50%)",borderWidth:`${L}px ${L}px 0 ${L}px`,borderColor:"var(--lucent-text-primary) transparent transparent transparent"},bottom:{top:-L,left:"50%",transform:"translateX(-50%)",borderWidth:`0 ${L}px ${L}px ${L}px`,borderColor:"transparent transparent var(--lucent-text-primary) transparent"},left:{right:-L,top:"50%",transform:"translateY(-50%)",borderWidth:`${L}px 0 ${L}px ${L}px`,borderColor:"transparent transparent transparent var(--lucent-text-primary)"},right:{left:-L,top:"50%",transform:"translateY(-50%)",borderWidth:`${L}px ${L}px ${L}px 0`,borderColor:"transparent var(--lucent-text-primary) transparent transparent"}};function bt({content:t,children:n,placement:a="top",delay:o=300}){const[r,i]=m.useState(!1),s=m.useRef(null),l=()=>{s.current=setTimeout(()=>i(!0),o)},c=()=>{s.current&&clearTimeout(s.current),i(!1)};return t?e.jsxs("span",{style:{position:"relative",display:"inline-flex"},onMouseEnter:l,onMouseLeave:c,onFocus:l,onBlur:c,children:[n,r&&e.jsxs("span",{role:"tooltip",style:{position:"absolute",...mt[a],background:"var(--lucent-text-primary)",color:"var(--lucent-bg-base)",padding:"5px 10px",borderRadius:"var(--lucent-radius-md)",fontSize:"var(--lucent-font-size-xs)",fontFamily:"var(--lucent-font-family-base)",fontWeight:"var(--lucent-font-weight-medium)",lineHeight:"var(--lucent-line-height-base)",whiteSpace:"nowrap",zIndex:9999,pointerEvents:"none",boxShadow:"var(--lucent-shadow-md)"},children:[t,e.jsx("span",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,borderStyle:"solid",...gt[a]}})]})]}):e.jsx(e.Fragment,{children:n})}const vt={id:"tooltip",name:"Tooltip",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A transient label that appears on hover or focus to explain an element.",designIntent:'Tooltips surface supplementary context that would clutter the UI if shown permanently — keyboard shortcut hints, icon button labels, truncated text expansions. They must never contain critical information (errors, required actions) because they are invisible until hovered. Keep content to one short phrase; avoid wrapping. Use placement to avoid viewport edges — "top" is the default and works in most cases.',props:[{name:"content",type:"ReactNode",required:!0,description:"Text or element shown inside the tooltip. Keep it short (under 80 chars)."},{name:"children",type:"ReactNode",required:!0,description:"The element that triggers the tooltip on hover/focus."},{name:"placement",type:"enum",required:!1,default:"top",description:"Position of the tooltip relative to the trigger.",enumValues:["top","bottom","left","right"]},{name:"delay",type:"number",required:!1,default:"300",description:"Milliseconds before the tooltip appears. Prevents flicker on fast cursor movement."}],usageExamples:[{title:"Icon button label",code:'<Tooltip content="Copy to clipboard"><IconButton icon={<CopyIcon />} /></Tooltip>'},{title:"Keyboard shortcut hint",code:'<Tooltip content="⌘K"><Button variant="ghost">Search</Button></Tooltip>'},{title:"Bottom placement",code:'<Tooltip content="Opens in a new tab" placement="bottom"><a href="…">Link</a></Tooltip>'},{title:"No delay (instant)",code:'<Tooltip content="Delete" delay={0}><Button variant="ghost">🗑</Button></Tooltip>'}],compositionGraph:[],accessibility:{role:"tooltip",ariaAttributes:['role="tooltip"'],notes:'The tooltip is shown on both hover and focus, making it accessible to keyboard users. Content is exposed via role="tooltip".'}},yt={xs:12,sm:14,md:16,lg:20,xl:24};function xt({children:t,size:n="md",label:a,color:o,style:r}){const i=yt[n];return e.jsx("span",{role:a?"img":void 0,"aria-label":a,"aria-hidden":a?void 0:!0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:i,height:i,flexShrink:0,color:o??"currentColor",...r},children:t})}const wt={id:"icon",name:"Icon",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A sized, accessible wrapper for any SVG or icon-set component.",designIntent:"Icon is intentionally icon-set agnostic — pass any SVG or third-party icon as children and it handles sizing and accessibility automatically. Use label for standalone icons that convey meaning without adjacent text (e.g. a close button). Omit label for decorative icons next to text, where the text already provides context. colour inherits from the parent by default via currentColor — override only when the icon must differ from its surrounding text.",props:[{name:"children",type:"ReactNode",required:!0,description:"The icon to render — any SVG element or icon-set component."},{name:"size",type:"enum",required:!1,default:"md",description:"Constrains the icon to a fixed square (xs=12, sm=14, md=16, lg=20, xl=24).",enumValues:["xs","sm","md","lg","xl"]},{name:"label",type:"string",required:!1,description:"Accessible label (aria-label). Provide for meaningful standalone icons; omit for decorative ones."},{name:"color",type:"string",required:!1,description:"CSS colour value. Defaults to currentColor (inherits from parent)."}],usageExamples:[{title:"Decorative (next to text)",code:'<Icon size="md"><SearchIcon /></Icon>'},{title:"Meaningful (standalone)",code:'<Icon size="lg" label="Close dialog"><XIcon /></Icon>'},{title:"Coloured",code:'<Icon color="var(--lucent-danger-default)"><AlertIcon /></Icon>'},{title:"Inside a button",code:'<Button leftIcon={<Icon size="sm"><PlusIcon /></Icon>}>Add item</Button>'}],compositionGraph:[],accessibility:{role:"img",ariaAttributes:["aria-label","aria-hidden"],notes:'aria-hidden="true" is applied automatically when no label is given, hiding the icon from screen readers.'}},kt={primary:"var(--lucent-text-primary)",secondary:"var(--lucent-text-secondary)",disabled:"var(--lucent-text-disabled)",inverse:"var(--lucent-text-inverse)",onAccent:"var(--lucent-text-on-accent)",success:"var(--lucent-success-text)",warning:"var(--lucent-warning-text)",danger:"var(--lucent-danger-text)",info:"var(--lucent-info-text)"},St={xs:"var(--lucent-font-size-xs)",sm:"var(--lucent-font-size-sm)",md:"var(--lucent-font-size-md)",lg:"var(--lucent-font-size-lg)",xl:"var(--lucent-font-size-xl)","2xl":"var(--lucent-font-size-2xl)","3xl":"var(--lucent-font-size-3xl)"},Tt={regular:"var(--lucent-font-weight-regular)",medium:"var(--lucent-font-weight-medium)",semibold:"var(--lucent-font-weight-semibold)",bold:"var(--lucent-font-weight-bold)"},jt={tight:"var(--lucent-line-height-tight)",base:"var(--lucent-line-height-base)",relaxed:"var(--lucent-line-height-relaxed)"},Ct={base:"var(--lucent-font-family-base)",mono:"var(--lucent-font-family-mono)",display:"var(--lucent-font-family-display)"};function z({as:t="p",size:n="md",weight:a="regular",color:o="primary",align:r="left",lineHeight:i="base",family:s="base",truncate:l=!1,children:c,style:h,...g}){const u={fontSize:St[n],fontWeight:Tt[a],color:kt[o],textAlign:r,lineHeight:jt[i],fontFamily:Ct[s],margin:0,...l&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},...h},p=t;return e.jsx(p,{style:u,...g,children:c})}const It={id:"text",name:"Text",tier:"atom",domain:"neutral",specVersion:"0.1",description:"Polymorphic typography primitive that maps semantic HTML elements to design-system type scales.",designIntent:"Text is the single source of truth for typography in Lucent UI. Rather than hard-coding font sizes and colors directly in components, every piece of rendered text should pass through this atom. The `as` prop controls the HTML element (and therefore semantic meaning), while `size`, `weight`, `color`, and `lineHeight` control appearance independently — decoupling semantics from style. Use `truncate` only in constrained-width containers where overflow must be prevented; it applies overflow: hidden + text-overflow: ellipsis. The `family` prop enables inline code or monospaced content without switching components.",props:[{name:"as",type:"enum",required:!1,default:"p",description:"HTML element to render. Controls semantic meaning independently of visual style.",enumValues:["p","h1","h2","h3","h4","h5","h6","span","div","label","strong","em","code"]},{name:"size",type:"enum",required:!1,default:"md",description:"Font size from the type scale. Maps to the corresponding --lucent-font-size-* token.",enumValues:["xs","sm","md","lg","xl","2xl","3xl"]},{name:"weight",type:"enum",required:!1,default:"regular",description:"Font weight. Maps to --lucent-font-weight-* tokens.",enumValues:["regular","medium","semibold","bold"]},{name:"color",type:"enum",required:!1,default:"primary",description:"Semantic text color. All values adapt automatically in light and dark themes.",enumValues:["primary","secondary","disabled","inverse","onAccent","success","warning","danger","info"]},{name:"align",type:"enum",required:!1,default:"left",description:"Text alignment.",enumValues:["left","center","right"]},{name:"lineHeight",type:"enum",required:!1,default:"base",description:"Line height. tight=1.25, base=1.5, relaxed=1.75.",enumValues:["tight","base","relaxed"]},{name:"family",type:"enum",required:!1,default:"base",description:"Font family. Use mono for code or tabular data. Use display (Unbounded) for headings and marketing copy.",enumValues:["base","mono","display"]},{name:"truncate",type:"boolean",required:!1,default:"false",description:"Clips overflow text with an ellipsis. Requires the container to have a constrained width."},{name:"children",type:"ReactNode",required:!0,description:"The text content to render."},{name:"style",type:"object",required:!1,description:"Inline style overrides. Applied after computed token styles."}],usageExamples:[{title:"Heading",code:'<Text as="h1" size="3xl" weight="bold">Page title</Text>'},{title:"Body paragraph",code:'<Text size="md" color="secondary">Supporting copy goes here.</Text>'},{title:"Label",code:'<Text as="label" size="sm" weight="medium" htmlFor="email">Email</Text>'},{title:"Inline code",code:'<Text as="code" family="mono" size="sm">const x = 1;</Text>'},{title:"Truncated",code:"<Text truncate style={{ maxWidth: 200 }}>Very long text that will be clipped</Text>"},{title:"Status color",code:'<Text color="danger" size="xs">This field is required</Text>'}],compositionGraph:[],accessibility:{notes:'The rendered element determines the implicit ARIA role. Use heading elements (h1–h6) for document headings so screen readers can navigate the page structure. Use `as="label"` with `htmlFor` to associate labels with form controls. Decorative text needs no additional ARIA.'}};function Mt({children:t,href:n,isActive:a=!1,icon:o,disabled:r=!1,onClick:i,as:s,style:l}){const c=s??"a";return e.jsxs(c,{href:r?void 0:n,onClick:r?void 0:i,"aria-current":a?"page":void 0,"aria-disabled":r||void 0,style:{display:"flex",alignItems:"center",gap:"var(--lucent-space-2)",padding:"var(--lucent-space-2) var(--lucent-space-3) var(--lucent-space-2) var(--lucent-space-4)",borderRadius:"var(--lucent-radius-md)",background:r?"transparent":a?"var(--lucent-accent-default)":"transparent",color:r?"var(--lucent-text-disabled)":a?"var(--lucent-text-on-accent)":"var(--lucent-text-secondary)",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-md)",fontWeight:a?"var(--lucent-font-weight-medium)":"var(--lucent-font-weight-regular)",textDecoration:"none",cursor:r?"not-allowed":"pointer",transition:"background var(--lucent-duration-fast) var(--lucent-easing-default), color var(--lucent-duration-fast) var(--lucent-easing-default)",userSelect:"none",boxSizing:"border-box",...l},onMouseEnter:h=>{!r&&!a&&(h.currentTarget.style.background="var(--lucent-surface-secondary)")},onMouseLeave:h=>{!r&&!a&&(h.currentTarget.style.background="transparent")},children:[o!=null&&e.jsx("span",{style:{display:"flex",flexShrink:0,color:"inherit"},children:o}),t]})}const Dt={sm:"3px",md:"4px",lg:"5px"},zt={sm:"14px",md:"18px",lg:"22px"},At=`
55
+ />`.trim()},{title:"With validation error",code:'<Select label="Role" options={roles} errorText="Please select a role" />'},{title:"With helper text",code:'<Select label="Timezone" options={timezones} helperText="Used for scheduling notifications" />'}],compositionGraph:[],accessibility:{role:"combobox",ariaAttributes:["aria-invalid","aria-describedby"],keyboardInteractions:["Enter / Space — opens the option list","Arrow keys — navigate options","Escape — closes the list"]}},Nt={neutral:{bg:"var(--lucent-surface-secondary)",color:"var(--lucent-text-secondary)",border:"var(--lucent-border-default)",dismissHover:"var(--lucent-border-strong)"},accent:{bg:"var(--lucent-accent-subtle)",color:"var(--lucent-accent-active)",border:"var(--lucent-accent-subtle)",dismissHover:"var(--lucent-accent-default)"},success:{bg:"var(--lucent-success-subtle)",color:"var(--lucent-success-text)",border:"var(--lucent-success-subtle)",dismissHover:"var(--lucent-success-default)"},warning:{bg:"var(--lucent-warning-subtle)",color:"var(--lucent-warning-text)",border:"var(--lucent-warning-subtle)",dismissHover:"var(--lucent-warning-default)"},danger:{bg:"var(--lucent-danger-subtle)",color:"var(--lucent-danger-text)",border:"var(--lucent-danger-subtle)",dismissHover:"var(--lucent-danger-default)"},info:{bg:"var(--lucent-info-subtle)",color:"var(--lucent-info-text)",border:"var(--lucent-info-subtle)",dismissHover:"var(--lucent-info-default)"}},Pt={sm:{fontSize:"var(--lucent-font-size-xs)",height:"20px",padding:"0 var(--lucent-space-2)",iconSize:10,gap:"var(--lucent-space-1)"},md:{fontSize:"var(--lucent-font-size-sm)",height:"24px",padding:"0 var(--lucent-space-2)",iconSize:12,gap:"var(--lucent-space-1)"}};function $t({children:t,variant:n="neutral",size:a="md",onDismiss:o,disabled:r}){const i=Nt[n],s=Pt[a];return e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:s.gap,height:s.height,padding:o?"0 var(--lucent-space-1) 0 var(--lucent-space-2)":s.padding,fontSize:s.fontSize,fontFamily:"var(--lucent-font-family-base)",fontWeight:"var(--lucent-font-weight-medium)",lineHeight:1,borderRadius:"var(--lucent-radius-full)",background:i.bg,color:i.color,border:`1px solid ${i.border}`,whiteSpace:"nowrap",boxSizing:"border-box",opacity:r?.5:1},children:[t,o&&e.jsx("button",{type:"button",onClick:r?void 0:o,disabled:r,"aria-label":"Dismiss",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:s.iconSize+4,height:s.iconSize+4,padding:0,border:"none",borderRadius:"var(--lucent-radius-full)",background:"transparent",color:"inherit",cursor:r?"not-allowed":"pointer",flexShrink:0,lineHeight:1},onMouseEnter:c=>{r||(c.currentTarget.style.background=i.dismissHover+"33")},onMouseLeave:c=>{c.currentTarget.style.background="transparent"},children:e.jsx("svg",{width:s.iconSize,height:s.iconSize,viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",children:e.jsx("path",{d:"M2 2L8 8M8 2L2 8"})})})]})}const Wt={id:"tag",name:"Tag",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A dismissible label for applied filters, selected values, or categorisation.",designIntent:"Tags represent user-applied selections that can be removed — filters, multi-select values, categories. They differ from Badge in that they are interactive: provide onDismiss when the user should be able to remove the tag. Without onDismiss they render as a static pill (identical to Badge in purpose). Use semantic variants to match meaning; default to neutral for user-generated content where no semantic applies.",props:[{name:"children",type:"ReactNode",required:!0,description:"Tag label content."},{name:"variant",type:"enum",required:!1,default:"neutral",description:"Colour scheme conveying semantic meaning.",enumValues:["neutral","accent","success","warning","danger","info"]},{name:"size",type:"enum",required:!1,default:"md",description:"Controls height and font size.",enumValues:["sm","md"]},{name:"onDismiss",type:"function",required:!1,description:"When provided, renders an × button that calls this handler on click."},{name:"disabled",type:"boolean",required:!1,default:"false",description:"Dims the tag and prevents the dismiss action."}],usageExamples:[{title:"Dismissible filter",code:"<Tag onDismiss={() => removeFilter('react')}>React</Tag>"},{title:"Multi-select value",code:'<Tag variant="accent" onDismiss={() => deselect(id)}>Jane Doe</Tag>'},{title:"Static category",code:'<Tag variant="info">Beta</Tag>'},{title:"Danger (removable)",code:'<Tag variant="danger" onDismiss={handleRemove}>Blocked</Tag>'}],compositionGraph:[],accessibility:{role:"group",notes:'The dismiss button has aria-label="Dismiss" and is keyboard-focusable.',keyboardInteractions:["Enter / Space — activates the dismiss button when focused"]}},N=5,Vt={top:{bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:N+3},bottom:{top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:N+3},left:{right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:N+3},right:{left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:N+3}},Ht={top:{bottom:-N,left:"50%",transform:"translateX(-50%)",borderWidth:`${N}px ${N}px 0 ${N}px`,borderColor:"var(--lucent-text-primary) transparent transparent transparent"},bottom:{top:-N,left:"50%",transform:"translateX(-50%)",borderWidth:`0 ${N}px ${N}px ${N}px`,borderColor:"transparent transparent var(--lucent-text-primary) transparent"},left:{right:-N,top:"50%",transform:"translateY(-50%)",borderWidth:`${N}px 0 ${N}px ${N}px`,borderColor:"transparent transparent transparent var(--lucent-text-primary)"},right:{left:-N,top:"50%",transform:"translateY(-50%)",borderWidth:`${N}px ${N}px ${N}px 0`,borderColor:"transparent var(--lucent-text-primary) transparent transparent"}};function Ot({content:t,children:n,placement:a="top",delay:o=300}){const[r,i]=f.useState(!1),s=f.useRef(null),c=()=>{s.current=setTimeout(()=>i(!0),o)},l=()=>{s.current&&clearTimeout(s.current),i(!1)};return t?e.jsxs("span",{style:{position:"relative",display:"inline-flex"},onMouseEnter:c,onMouseLeave:l,onFocus:c,onBlur:l,children:[n,r&&e.jsxs("span",{role:"tooltip",style:{position:"absolute",...Vt[a],background:"var(--lucent-text-primary)",color:"var(--lucent-bg-base)",padding:"5px 10px",borderRadius:"var(--lucent-radius-md)",fontSize:"var(--lucent-font-size-xs)",fontFamily:"var(--lucent-font-family-base)",fontWeight:"var(--lucent-font-weight-medium)",lineHeight:"var(--lucent-line-height-base)",whiteSpace:"nowrap",zIndex:9999,pointerEvents:"none",boxShadow:"var(--lucent-shadow-md)"},children:[t,e.jsx("span",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,borderStyle:"solid",...Ht[a]}})]})]}):e.jsx(e.Fragment,{children:n})}const Gt={id:"tooltip",name:"Tooltip",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A transient label that appears on hover or focus to explain an element.",designIntent:'Tooltips surface supplementary context that would clutter the UI if shown permanently — keyboard shortcut hints, icon button labels, truncated text expansions. They must never contain critical information (errors, required actions) because they are invisible until hovered. Keep content to one short phrase; avoid wrapping. Use placement to avoid viewport edges — "top" is the default and works in most cases.',props:[{name:"content",type:"ReactNode",required:!0,description:"Text or element shown inside the tooltip. Keep it short (under 80 chars)."},{name:"children",type:"ReactNode",required:!0,description:"The element that triggers the tooltip on hover/focus."},{name:"placement",type:"enum",required:!1,default:"top",description:"Position of the tooltip relative to the trigger.",enumValues:["top","bottom","left","right"]},{name:"delay",type:"number",required:!1,default:"300",description:"Milliseconds before the tooltip appears. Prevents flicker on fast cursor movement."}],usageExamples:[{title:"Icon button label",code:'<Tooltip content="Copy to clipboard"><IconButton icon={<CopyIcon />} /></Tooltip>'},{title:"Keyboard shortcut hint",code:'<Tooltip content="⌘K"><Button variant="ghost">Search</Button></Tooltip>'},{title:"Bottom placement",code:'<Tooltip content="Opens in a new tab" placement="bottom"><a href="…">Link</a></Tooltip>'},{title:"No delay (instant)",code:'<Tooltip content="Delete" delay={0}><Button variant="ghost">🗑</Button></Tooltip>'}],compositionGraph:[],accessibility:{role:"tooltip",ariaAttributes:['role="tooltip"'],notes:'The tooltip is shown on both hover and focus, making it accessible to keyboard users. Content is exposed via role="tooltip".'}},Ut={xs:12,sm:14,md:16,lg:20,xl:24};function _t({children:t,size:n="md",label:a,color:o,style:r}){const i=Ut[n];return e.jsx("span",{role:a?"img":void 0,"aria-label":a,"aria-hidden":a?void 0:!0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:i,height:i,flexShrink:0,color:o??"currentColor",...r},children:t})}const Kt={id:"icon",name:"Icon",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A sized, accessible wrapper for any SVG or icon-set component.",designIntent:"Icon is intentionally icon-set agnostic — pass any SVG or third-party icon as children and it handles sizing and accessibility automatically. Use label for standalone icons that convey meaning without adjacent text (e.g. a close button). Omit label for decorative icons next to text, where the text already provides context. colour inherits from the parent by default via currentColor — override only when the icon must differ from its surrounding text.",props:[{name:"children",type:"ReactNode",required:!0,description:"The icon to render — any SVG element or icon-set component."},{name:"size",type:"enum",required:!1,default:"md",description:"Constrains the icon to a fixed square (xs=12, sm=14, md=16, lg=20, xl=24).",enumValues:["xs","sm","md","lg","xl"]},{name:"label",type:"string",required:!1,description:"Accessible label (aria-label). Provide for meaningful standalone icons; omit for decorative ones."},{name:"color",type:"string",required:!1,description:"CSS colour value. Defaults to currentColor (inherits from parent)."}],usageExamples:[{title:"Decorative (next to text)",code:'<Icon size="md"><SearchIcon /></Icon>'},{title:"Meaningful (standalone)",code:'<Icon size="lg" label="Close dialog"><XIcon /></Icon>'},{title:"Coloured",code:'<Icon color="var(--lucent-danger-default)"><AlertIcon /></Icon>'},{title:"Inside a button",code:'<Button leftIcon={<Icon size="sm"><PlusIcon /></Icon>}>Add item</Button>'}],compositionGraph:[],accessibility:{role:"img",ariaAttributes:["aria-label","aria-hidden"],notes:'aria-hidden="true" is applied automatically when no label is given, hiding the icon from screen readers.'}},Yt={primary:"var(--lucent-text-primary)",secondary:"var(--lucent-text-secondary)",disabled:"var(--lucent-text-disabled)",inverse:"var(--lucent-text-inverse)",onAccent:"var(--lucent-text-on-accent)",success:"var(--lucent-success-text)",warning:"var(--lucent-warning-text)",danger:"var(--lucent-danger-text)",info:"var(--lucent-info-text)"},Xt={xs:"var(--lucent-font-size-xs)",sm:"var(--lucent-font-size-sm)",md:"var(--lucent-font-size-md)",lg:"var(--lucent-font-size-lg)",xl:"var(--lucent-font-size-xl)","2xl":"var(--lucent-font-size-2xl)","3xl":"var(--lucent-font-size-3xl)"},Jt={regular:"var(--lucent-font-weight-regular)",medium:"var(--lucent-font-weight-medium)",semibold:"var(--lucent-font-weight-semibold)",bold:"var(--lucent-font-weight-bold)"},Zt={tight:"var(--lucent-line-height-tight)",base:"var(--lucent-line-height-base)",relaxed:"var(--lucent-line-height-relaxed)"},Qt={base:"var(--lucent-font-family-base)",mono:"var(--lucent-font-family-mono)",display:"var(--lucent-font-family-display)"};function R({as:t="p",size:n="md",weight:a="regular",color:o="primary",align:r="left",lineHeight:i="base",family:s="base",truncate:c=!1,children:l,style:u,...m}){const d={fontSize:Xt[n],fontWeight:Jt[a],color:Yt[o],textAlign:r,lineHeight:Zt[i],fontFamily:Qt[s],margin:0,...c&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},...u},g=t;return e.jsx(g,{style:d,...m,children:l})}const en={id:"text",name:"Text",tier:"atom",domain:"neutral",specVersion:"0.1",description:"Polymorphic typography primitive that maps semantic HTML elements to design-system type scales.",designIntent:"Text is the single source of truth for typography in Lucent UI. Rather than hard-coding font sizes and colors directly in components, every piece of rendered text should pass through this atom. The `as` prop controls the HTML element (and therefore semantic meaning), while `size`, `weight`, `color`, and `lineHeight` control appearance independently — decoupling semantics from style. Use `truncate` only in constrained-width containers where overflow must be prevented; it applies overflow: hidden + text-overflow: ellipsis. The `family` prop enables inline code or monospaced content without switching components.",props:[{name:"as",type:"enum",required:!1,default:"p",description:"HTML element to render. Controls semantic meaning independently of visual style.",enumValues:["p","h1","h2","h3","h4","h5","h6","span","div","label","strong","em","code"]},{name:"size",type:"enum",required:!1,default:"md",description:"Font size from the type scale. Maps to the corresponding --lucent-font-size-* token.",enumValues:["xs","sm","md","lg","xl","2xl","3xl"]},{name:"weight",type:"enum",required:!1,default:"regular",description:"Font weight. Maps to --lucent-font-weight-* tokens.",enumValues:["regular","medium","semibold","bold"]},{name:"color",type:"enum",required:!1,default:"primary",description:"Semantic text color. All values adapt automatically in light and dark themes.",enumValues:["primary","secondary","disabled","inverse","onAccent","success","warning","danger","info"]},{name:"align",type:"enum",required:!1,default:"left",description:"Text alignment.",enumValues:["left","center","right"]},{name:"lineHeight",type:"enum",required:!1,default:"base",description:"Line height. tight=1.25, base=1.5, relaxed=1.75.",enumValues:["tight","base","relaxed"]},{name:"family",type:"enum",required:!1,default:"base",description:"Font family. Use mono for code or tabular data. Use display (Unbounded) for headings and marketing copy.",enumValues:["base","mono","display"]},{name:"truncate",type:"boolean",required:!1,default:"false",description:"Clips overflow text with an ellipsis. Requires the container to have a constrained width."},{name:"children",type:"ReactNode",required:!0,description:"The text content to render."},{name:"style",type:"object",required:!1,description:"Inline style overrides. Applied after computed token styles."}],usageExamples:[{title:"Heading",code:'<Text as="h1" size="3xl" weight="bold">Page title</Text>'},{title:"Body paragraph",code:'<Text size="md" color="secondary">Supporting copy goes here.</Text>'},{title:"Label",code:'<Text as="label" size="sm" weight="medium" htmlFor="email">Email</Text>'},{title:"Inline code",code:'<Text as="code" family="mono" size="sm">const x = 1;</Text>'},{title:"Truncated",code:"<Text truncate style={{ maxWidth: 200 }}>Very long text that will be clipped</Text>"},{title:"Status color",code:'<Text color="danger" size="xs">This field is required</Text>'}],compositionGraph:[],accessibility:{notes:'The rendered element determines the implicit ARIA role. Use heading elements (h1–h6) for document headings so screen readers can navigate the page structure. Use `as="label"` with `htmlFor` to associate labels with form controls. Decorative text needs no additional ARIA.'}};function tn({children:t,href:n,isActive:a=!1,icon:o,disabled:r=!1,onClick:i,as:s,style:c}){const l=s??"a";return e.jsxs(l,{href:r?void 0:n,onClick:r?void 0:i,"aria-current":a?"page":void 0,"aria-disabled":r||void 0,style:{display:"flex",alignItems:"center",gap:"var(--lucent-space-2)",padding:"var(--lucent-space-2) var(--lucent-space-3) var(--lucent-space-2) var(--lucent-space-4)",borderRadius:"var(--lucent-radius-md)",background:r?"transparent":a?"var(--lucent-accent-default)":"transparent",color:r?"var(--lucent-text-disabled)":a?"var(--lucent-text-on-accent)":"var(--lucent-text-secondary)",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-md)",fontWeight:a?"var(--lucent-font-weight-medium)":"var(--lucent-font-weight-regular)",textDecoration:"none",cursor:r?"not-allowed":"pointer",transition:"background var(--lucent-duration-fast) var(--lucent-easing-default), color var(--lucent-duration-fast) var(--lucent-easing-default)",userSelect:"none",boxSizing:"border-box",...c},onMouseEnter:u=>{!r&&!a&&(u.currentTarget.style.background="var(--lucent-surface-secondary)")},onMouseLeave:u=>{!r&&!a&&(u.currentTarget.style.background="transparent")},children:[o!=null&&e.jsx("span",{style:{display:"flex",flexShrink:0,color:"inherit"},children:o}),t]})}const nn={sm:"3px",md:"4px",lg:"5px"},an={sm:"14px",md:"18px",lg:"22px"},rn=`
56
56
  .lucent-slider {
57
57
  -webkit-appearance: none;
58
58
  appearance: none;
@@ -145,9 +145,9 @@
145
145
  border-color: var(--lucent-border-default);
146
146
  cursor: not-allowed;
147
147
  }
148
- `;function Et({label:t,showValue:n=!1,size:a="md",min:o=0,max:r=100,step:i=1,value:s,defaultValue:l,disabled:c,id:h,onChange:g,style:u,...p}){const d=h??`lucent-slider-${Math.random().toString(36).slice(2,7)}`,x=s!==void 0,[y,b]=m.useState(l??Math.round((o+r)/2)),f=x?s:y,v=`${(f-o)/(r-o)*100}%`,I=w=>{x||b(Number(w.target.value)),g==null||g(w)};return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:At}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--lucent-space-1)",width:"100%",fontFamily:"var(--lucent-font-family-base)",...u},children:[(t||n)&&e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline"},children:[t&&e.jsx("label",{htmlFor:d,style:{fontSize:"var(--lucent-font-size-sm)",fontWeight:"var(--lucent-font-weight-medium)",color:c?"var(--lucent-text-disabled)":"var(--lucent-text-primary)",cursor:c?"not-allowed":"default"},children:t}),n&&e.jsx("span",{style:{fontSize:"var(--lucent-font-size-sm)",color:c?"var(--lucent-text-disabled)":"var(--lucent-text-secondary)",fontVariantNumeric:"tabular-nums"},children:f})]}),e.jsx("input",{type:"range",id:d,className:"lucent-slider",min:o,max:r,step:i,disabled:c,value:x?s:y,onChange:I,style:{"--ls-track-h":Dt[a],"--ls-thumb":zt[a],"--ls-fill":v},...p})]})]})}const qt={id:"slider",name:"Slider",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A range input styled with Lucent tokens for selecting a numeric value within a bounded range.",designIntent:'Use Slider for continuous or stepped numeric inputs where the relative position matters — volume, brightness, border radius, spacing scale. Pair with showValue when the exact number is meaningful to the user. For precise numeric entry, use Input with type="number" instead. Disabled state uses muted colours without opacity hacks.',props:[{name:"min",type:"number",required:!1,default:"0",description:"Minimum value."},{name:"max",type:"number",required:!1,default:"100",description:"Maximum value."},{name:"step",type:"number",required:!1,default:"1",description:"Increment step between values."},{name:"value",type:"number",required:!1,description:"Controlled current value. Pair with onChange."},{name:"defaultValue",type:"number",required:!1,description:"Initial value for uncontrolled usage. Defaults to the midpoint of min/max."},{name:"onChange",type:"function",required:!1,description:"Called on every value change."},{name:"label",type:"string",required:!1,description:"Visible label rendered above the track."},{name:"showValue",type:"boolean",required:!1,default:"false",description:"Displays the current numeric value to the right of the label."},{name:"size",type:"enum",required:!1,default:"md",description:"Controls track thickness and thumb diameter.",enumValues:["sm","md","lg"]},{name:"disabled",type:"boolean",required:!1,default:"false",description:"Prevents interaction and dims the control."}],usageExamples:[{title:"Basic",code:'<Slider label="Volume" showValue />'},{title:"Controlled",code:'<Slider label="Opacity" min={0} max={1} step={0.01} value={opacity} onChange={e => setOpacity(Number(e.target.value))} showValue />'},{title:"Sizes",code:`<Slider size="sm" label="Small" />
148
+ `;function on({label:t,showValue:n=!1,size:a="md",min:o=0,max:r=100,step:i=1,value:s,defaultValue:c,disabled:l,id:u,onChange:m,style:d,...g}){const p=u??`lucent-slider-${Math.random().toString(36).slice(2,7)}`,x=s!==void 0,[b,y]=f.useState(c??Math.round((o+r)/2)),h=x?s:b,v=`${(h-o)/(r-o)*100}%`,j=S=>{x||y(Number(S.target.value)),m==null||m(S)};return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:rn}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--lucent-space-1)",width:"100%",fontFamily:"var(--lucent-font-family-base)",...d},children:[(t||n)&&e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline"},children:[t&&e.jsx("label",{htmlFor:p,style:{fontSize:"var(--lucent-font-size-sm)",fontWeight:"var(--lucent-font-weight-medium)",color:l?"var(--lucent-text-disabled)":"var(--lucent-text-primary)",cursor:l?"not-allowed":"default"},children:t}),n&&e.jsx("span",{style:{fontSize:"var(--lucent-font-size-sm)",color:l?"var(--lucent-text-disabled)":"var(--lucent-text-secondary)",fontVariantNumeric:"tabular-nums"},children:h})]}),e.jsx("input",{type:"range",id:p,className:"lucent-slider",min:o,max:r,step:i,disabled:l,value:x?s:b,onChange:j,style:{"--ls-track-h":nn[a],"--ls-thumb":an[a],"--ls-fill":v},...g})]})]})}const sn={id:"slider",name:"Slider",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A range input styled with Lucent tokens for selecting a numeric value within a bounded range.",designIntent:'Use Slider for continuous or stepped numeric inputs where the relative position matters — volume, brightness, border radius, spacing scale. Pair with showValue when the exact number is meaningful to the user. For precise numeric entry, use Input with type="number" instead. Disabled state uses muted colours without opacity hacks.',props:[{name:"min",type:"number",required:!1,default:"0",description:"Minimum value."},{name:"max",type:"number",required:!1,default:"100",description:"Maximum value."},{name:"step",type:"number",required:!1,default:"1",description:"Increment step between values."},{name:"value",type:"number",required:!1,description:"Controlled current value. Pair with onChange."},{name:"defaultValue",type:"number",required:!1,description:"Initial value for uncontrolled usage. Defaults to the midpoint of min/max."},{name:"onChange",type:"function",required:!1,description:"Called on every value change."},{name:"label",type:"string",required:!1,description:"Visible label rendered above the track."},{name:"showValue",type:"boolean",required:!1,default:"false",description:"Displays the current numeric value to the right of the label."},{name:"size",type:"enum",required:!1,default:"md",description:"Controls track thickness and thumb diameter.",enumValues:["sm","md","lg"]},{name:"disabled",type:"boolean",required:!1,default:"false",description:"Prevents interaction and dims the control."}],usageExamples:[{title:"Basic",code:'<Slider label="Volume" showValue />'},{title:"Controlled",code:'<Slider label="Opacity" min={0} max={1} step={0.01} value={opacity} onChange={e => setOpacity(Number(e.target.value))} showValue />'},{title:"Sizes",code:`<Slider size="sm" label="Small" />
149
149
  <Slider size="md" label="Medium" />
150
- <Slider size="lg" label="Large" />`},{title:"Disabled",code:'<Slider label="Locked" disabled defaultValue={40} />'}],compositionGraph:[],accessibility:{role:"slider",ariaAttributes:["aria-valuemin","aria-valuemax","aria-valuenow","aria-disabled"],keyboardInteractions:["ArrowRight / ArrowUp — increase value by step","ArrowLeft / ArrowDown — decrease value by step","Home — jump to min","End — jump to max"]}},Rt=2e3;function Lt(){return e.jsxs("svg",{width:13,height:13,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[e.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),e.jsx("path",{d:"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"})]})}function Bt(){return e.jsx("svg",{width:13,height:13,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:e.jsx("path",{d:"M20 6L9 17l-5-5"})})}function Ft({code:t,language:n,tabs:a,variant:o="code",helperText:r,showCopyButton:i=!0,style:s}){var f,v;const l=!!(a!=null&&a.length),[c,h]=m.useState(0),[g,u]=m.useState(!1),p=l?((f=a[c])==null?void 0:f.code)??"":t??"",d=l?(v=a[c])==null?void 0:v.language:n,x=async()=>{try{await navigator.clipboard.writeText(p),u(!0),setTimeout(()=>u(!1),Rt)}catch{}},y={display:"inline-flex",alignItems:"center",gap:"var(--lucent-space-1)",padding:"3px var(--lucent-space-2)",border:"1px solid transparent",borderRadius:"var(--lucent-radius-md)",background:"transparent",color:g?"var(--lucent-success-default)":"var(--lucent-text-secondary)",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-xs)",cursor:"pointer",flexShrink:0,transition:"color var(--lucent-duration-fast) var(--lucent-easing-default), background var(--lucent-duration-fast) var(--lucent-easing-default)"},b=()=>e.jsxs("button",{onClick:x,"aria-label":g?"Copied!":"Copy code",style:y,onMouseEnter:I=>{g||(I.currentTarget.style.background="var(--lucent-surface-secondary)",I.currentTarget.style.color="var(--lucent-text-primary)")},onMouseLeave:I=>{g||(I.currentTarget.style.background="transparent",I.currentTarget.style.color="var(--lucent-text-secondary)")},children:[g?e.jsx(Bt,{}):e.jsx(Lt,{}),g?"Copied!":"Copy"]});return e.jsxs("div",{style:{borderRadius:"var(--lucent-radius-lg)",border:"1px solid var(--lucent-border-default)",overflow:"hidden",...s},children:[l&&e.jsx("div",{style:{display:"flex",alignItems:"flex-end",background:"var(--lucent-surface)",borderBottom:"1px solid var(--lucent-border-default)",padding:"0 var(--lucent-space-2)"},children:a.map((I,w)=>{const S=w===c;return e.jsxs("button",{onClick:()=>{h(w),u(!1)},style:{display:"inline-flex",alignItems:"center",gap:"var(--lucent-space-1)",padding:"var(--lucent-space-2) var(--lucent-space-3)",border:"none",borderBottom:S?"2px solid var(--lucent-accent-default)":"2px solid transparent",marginBottom:-1,background:"transparent",color:S?"var(--lucent-text-primary)":"var(--lucent-text-secondary)",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-sm)",fontWeight:S?"var(--lucent-font-weight-semibold)":"var(--lucent-font-weight-regular)",cursor:"pointer",transition:"color var(--lucent-duration-fast) var(--lucent-easing-default)",whiteSpace:"nowrap"},onMouseEnter:D=>{S||(D.currentTarget.style.color="var(--lucent-text-primary)")},onMouseLeave:D=>{S||(D.currentTarget.style.color="var(--lucent-text-secondary)")},children:[I.icon!==void 0&&e.jsx("span",{style:{display:"inline-flex",alignItems:"center"},children:I.icon}),I.label]},I.label)})}),!l&&(!!d||i)&&e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:d?"space-between":"flex-end",padding:"0 var(--lucent-space-3)",height:36,background:"var(--lucent-surface-secondary)",borderBottom:"1px solid var(--lucent-border-default)"},children:[d&&e.jsx("span",{style:{fontSize:"var(--lucent-font-size-xs)",fontFamily:"var(--lucent-font-family-mono)",color:"var(--lucent-text-secondary)",letterSpacing:"var(--lucent-letter-spacing-wide)"},children:d}),i&&e.jsx(b,{})]}),r&&e.jsx("div",{style:{padding:"var(--lucent-space-2) var(--lucent-space-4)",fontSize:"var(--lucent-font-size-xs)",color:"var(--lucent-text-secondary)",fontFamily:"var(--lucent-font-family-base)",background:"var(--lucent-surface-secondary)",borderBottom:"1px solid var(--lucent-border-default)"},children:r}),o==="code"?e.jsxs("div",{style:{position:"relative"},children:[e.jsx("pre",{style:{margin:0,padding:"var(--lucent-space-4)",paddingRight:l&&i?"var(--lucent-space-16)":"var(--lucent-space-4)",background:"var(--lucent-surface-secondary)",overflowX:"auto",lineHeight:1.65},children:e.jsx("code",{style:{fontFamily:"var(--lucent-font-family-mono)",fontSize:"var(--lucent-font-size-sm)",color:"var(--lucent-text-primary)"},children:p})}),l&&i&&e.jsx("div",{style:{position:"absolute",top:"var(--lucent-space-2)",right:"var(--lucent-space-3)"},children:e.jsx(b,{})})]}):e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--lucent-space-3)",padding:"var(--lucent-space-3) var(--lucent-space-4)",background:"var(--lucent-surface-secondary)"},children:[e.jsx("span",{style:{flex:1,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontFamily:"var(--lucent-font-family-mono)",fontSize:"var(--lucent-font-size-sm)",color:"var(--lucent-text-primary)"},children:p}),i&&e.jsx(b,{})]})]})}const Nt={id:"code-block",name:"CodeBlock",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A styled code display with optional tabs, a language label, copy-to-clipboard, and an AI prompt variant.",designIntent:"Use CodeBlock for static code snippets, install commands, API examples, and AI prompt sharing. The tabs prop switches between related snippets (e.g. pnpm / npm / yarn). The prompt variant renders a single-line truncated display suited to AI tool prompts — the full text is always copied even when visually clipped. Zero-dependency — no syntax highlighting library is bundled.",props:[{name:"code",type:"string",required:!1,description:"Code string — used in single (non-tabbed) mode."},{name:"language",type:"string",required:!1,description:"Language label shown in the header (non-tabbed mode only). Purely cosmetic."},{name:"tabs",type:"array",required:!1,description:"Tabbed mode. Each entry has { label, code, language?, icon? }. Switching tabs resets the copied state."},{name:"variant",type:"enum",required:!1,default:"code",enumValues:["code","prompt"],description:'"code" renders a <pre><code> block with horizontal scroll. "prompt" renders a single-line truncated span suited to AI prompts.'},{name:"helperText",type:"string",required:!1,description:"Descriptive text rendered between the tab bar and the code area."},{name:"showCopyButton",type:"boolean",required:!1,default:"true",description:'Renders a copy-to-clipboard button. Shows a "Copied!" confirmation for 2 s on success.'}],usageExamples:[{title:"Single snippet",code:'<CodeBlock language="tsx" code={`<Button variant="primary">Save</Button>`} />'},{title:"Tabbed install commands",code:`<CodeBlock tabs={[
150
+ <Slider size="lg" label="Large" />`},{title:"Disabled",code:'<Slider label="Locked" disabled defaultValue={40} />'}],compositionGraph:[],accessibility:{role:"slider",ariaAttributes:["aria-valuemin","aria-valuemax","aria-valuenow","aria-disabled"],keyboardInteractions:["ArrowRight / ArrowUp — increase value by step","ArrowLeft / ArrowDown — decrease value by step","Home — jump to min","End — jump to max"]}},ln=2e3;function cn(){return e.jsxs("svg",{width:13,height:13,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[e.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),e.jsx("path",{d:"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"})]})}function dn(){return e.jsx("svg",{width:13,height:13,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:e.jsx("path",{d:"M20 6L9 17l-5-5"})})}function un({code:t,language:n,tabs:a,variant:o="code",helperText:r,showCopyButton:i=!0,style:s}){var h,v;const c=!!(a!=null&&a.length),[l,u]=f.useState(0),[m,d]=f.useState(!1),g=c?((h=a[l])==null?void 0:h.code)??"":t??"",p=c?(v=a[l])==null?void 0:v.language:n,x=async()=>{try{await navigator.clipboard.writeText(g),d(!0),setTimeout(()=>d(!1),ln)}catch{}},b={display:"inline-flex",alignItems:"center",gap:"var(--lucent-space-1)",padding:"3px var(--lucent-space-2)",border:"1px solid transparent",borderRadius:"var(--lucent-radius-md)",background:"transparent",color:m?"var(--lucent-success-default)":"var(--lucent-text-secondary)",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-xs)",cursor:"pointer",flexShrink:0,transition:"color var(--lucent-duration-fast) var(--lucent-easing-default), background var(--lucent-duration-fast) var(--lucent-easing-default)"},y=()=>e.jsxs("button",{onClick:x,"aria-label":m?"Copied!":"Copy code",style:b,onMouseEnter:j=>{m||(j.currentTarget.style.background="var(--lucent-surface-secondary)",j.currentTarget.style.color="var(--lucent-text-primary)")},onMouseLeave:j=>{m||(j.currentTarget.style.background="transparent",j.currentTarget.style.color="var(--lucent-text-secondary)")},children:[m?e.jsx(dn,{}):e.jsx(cn,{}),m?"Copied!":"Copy"]});return e.jsxs("div",{style:{borderRadius:"var(--lucent-radius-lg)",border:"1px solid var(--lucent-border-default)",overflow:"hidden",...s},children:[c&&e.jsx("div",{style:{display:"flex",alignItems:"flex-end",background:"var(--lucent-surface)",borderBottom:"1px solid var(--lucent-border-default)",padding:"0 var(--lucent-space-2)"},children:a.map((j,S)=>{const T=S===l;return e.jsxs("button",{onClick:()=>{u(S),d(!1)},style:{display:"inline-flex",alignItems:"center",gap:"var(--lucent-space-1)",padding:"var(--lucent-space-2) var(--lucent-space-3)",border:"none",borderBottom:T?"2px solid var(--lucent-accent-default)":"2px solid transparent",marginBottom:-1,background:"transparent",color:T?"var(--lucent-text-primary)":"var(--lucent-text-secondary)",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-sm)",fontWeight:T?"var(--lucent-font-weight-semibold)":"var(--lucent-font-weight-regular)",cursor:"pointer",transition:"color var(--lucent-duration-fast) var(--lucent-easing-default)",whiteSpace:"nowrap"},onMouseEnter:z=>{T||(z.currentTarget.style.color="var(--lucent-text-primary)")},onMouseLeave:z=>{T||(z.currentTarget.style.color="var(--lucent-text-secondary)")},children:[j.icon!==void 0&&e.jsx("span",{style:{display:"inline-flex",alignItems:"center"},children:j.icon}),j.label]},j.label)})}),!c&&(!!p||i)&&e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:p?"space-between":"flex-end",padding:"0 var(--lucent-space-3)",height:36,background:"var(--lucent-surface-secondary)",borderBottom:"1px solid var(--lucent-border-default)"},children:[p&&e.jsx("span",{style:{fontSize:"var(--lucent-font-size-xs)",fontFamily:"var(--lucent-font-family-mono)",color:"var(--lucent-text-secondary)",letterSpacing:"var(--lucent-letter-spacing-wide)"},children:p}),i&&e.jsx(y,{})]}),r&&e.jsx("div",{style:{padding:"var(--lucent-space-2) var(--lucent-space-4)",fontSize:"var(--lucent-font-size-xs)",color:"var(--lucent-text-secondary)",fontFamily:"var(--lucent-font-family-base)",background:"var(--lucent-surface-secondary)",borderBottom:"1px solid var(--lucent-border-default)"},children:r}),o==="code"?e.jsxs("div",{style:{position:"relative"},children:[e.jsx("pre",{style:{margin:0,padding:"var(--lucent-space-4)",paddingRight:c&&i?"var(--lucent-space-16)":"var(--lucent-space-4)",background:"var(--lucent-surface-secondary)",overflowX:"auto",lineHeight:1.65},children:e.jsx("code",{style:{fontFamily:"var(--lucent-font-family-mono)",fontSize:"var(--lucent-font-size-sm)",color:"var(--lucent-text-primary)"},children:g})}),c&&i&&e.jsx("div",{style:{position:"absolute",top:"var(--lucent-space-2)",right:"var(--lucent-space-3)"},children:e.jsx(y,{})})]}):e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--lucent-space-3)",padding:"var(--lucent-space-3) var(--lucent-space-4)",background:"var(--lucent-surface-secondary)"},children:[e.jsx("span",{style:{flex:1,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontFamily:"var(--lucent-font-family-mono)",fontSize:"var(--lucent-font-size-sm)",color:"var(--lucent-text-primary)"},children:g}),i&&e.jsx(y,{})]})]})}const pn={id:"code-block",name:"CodeBlock",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A styled code display with optional tabs, a language label, copy-to-clipboard, and an AI prompt variant.",designIntent:"Use CodeBlock for static code snippets, install commands, API examples, and AI prompt sharing. The tabs prop switches between related snippets (e.g. pnpm / npm / yarn). The prompt variant renders a single-line truncated display suited to AI tool prompts — the full text is always copied even when visually clipped. Zero-dependency — no syntax highlighting library is bundled.",props:[{name:"code",type:"string",required:!1,description:"Code string — used in single (non-tabbed) mode."},{name:"language",type:"string",required:!1,description:"Language label shown in the header (non-tabbed mode only). Purely cosmetic."},{name:"tabs",type:"array",required:!1,description:"Tabbed mode. Each entry has { label, code, language?, icon? }. Switching tabs resets the copied state."},{name:"variant",type:"enum",required:!1,default:"code",enumValues:["code","prompt"],description:'"code" renders a <pre><code> block with horizontal scroll. "prompt" renders a single-line truncated span suited to AI prompts.'},{name:"helperText",type:"string",required:!1,description:"Descriptive text rendered between the tab bar and the code area."},{name:"showCopyButton",type:"boolean",required:!1,default:"true",description:'Renders a copy-to-clipboard button. Shows a "Copied!" confirmation for 2 s on success.'}],usageExamples:[{title:"Single snippet",code:'<CodeBlock language="tsx" code={`<Button variant="primary">Save</Button>`} />'},{title:"Tabbed install commands",code:`<CodeBlock tabs={[
151
151
  { label: 'pnpm', code: 'pnpm add lucent-ui', language: 'bash' },
152
152
  { label: 'npm', code: 'npm install lucent-ui', language: 'bash' },
153
153
  ]} />`},{title:"AI prompt",code:`<CodeBlock
@@ -157,7 +157,7 @@
157
157
  { label: 'Claude', icon: '♦', code: '"Add a Button with variant=\\"primary\\"."' },
158
158
  { label: 'Cursor', icon: '↖', code: '@lucent-ui Add a primary Button.' },
159
159
  ]}
160
- />`}],compositionGraph:[],accessibility:{role:"region",ariaAttributes:["aria-label (copy button)"],keyboardInteractions:["Tab — focuses the copy button","Enter / Space — copies the code"]}},Pt=`
160
+ />`}],compositionGraph:[],accessibility:{role:"region",ariaAttributes:["aria-label (copy button)"],keyboardInteractions:["Tab — focuses the copy button","Enter / Space — copies the code"]}},fn=`
161
161
  .lucent-table-row:hover > td,
162
162
  .lucent-table-row:hover > th {
163
163
  background: var(--lucent-surface-secondary) !important;
@@ -166,7 +166,7 @@
166
166
  .lucent-table-striped tbody .lucent-table-row:nth-child(even) > th {
167
167
  background: var(--lucent-surface-secondary);
168
168
  }
169
- `;function $t({children:t,style:n,...a}){return e.jsx("thead",{style:{background:"var(--lucent-surface-secondary)",...n},...a,children:t})}function Wt({children:t,...n}){return e.jsx("tbody",{...n,children:t})}function Vt({children:t,style:n,...a}){return e.jsx("tfoot",{style:{background:"var(--lucent-surface-secondary)",...n},...a,children:t})}function Ot({children:t,className:n,...a}){return e.jsx("tr",{className:["lucent-table-row",n].filter(Boolean).join(" "),...a,children:t})}function Ht({as:t,children:n,style:a,...o}){const r=t==="th",i={padding:"var(--lucent-space-3) var(--lucent-space-4)",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-sm)",borderBottom:"1px solid var(--lucent-border-default)",textAlign:"left",verticalAlign:"middle",color:r?"var(--lucent-text-secondary)":"var(--lucent-text-primary)",fontWeight:r?"var(--lucent-font-weight-semibold)":"var(--lucent-font-weight-regular)",whiteSpace:r?"nowrap":void 0,...a};return r?e.jsx("th",{scope:"col",style:i,...o,children:n}):e.jsx("td",{style:i,...o,children:n})}function V({striped:t=!1,children:n,className:a,style:o,...r}){const i=["lucent-table",t&&"lucent-table-striped",a].filter(Boolean).join(" ");return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:Pt}),e.jsx("div",{style:{overflowX:"auto",width:"100%"},children:e.jsx("table",{className:i,style:{width:"100%",borderCollapse:"collapse",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-sm)",...o},...r,children:n})})]})}V.Head=$t;V.Body=Wt;V.Foot=Vt;V.Row=Ot;V.Cell=Ht;const Gt={id:"table",name:"Table",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A lightweight, token-styled HTML table primitive with compound sub-components. Distinct from DataTable — no sorting, filtering, or pagination.",designIntent:"Use Table for static or lightly dynamic tabular data where full DataTable features are not needed — props tables, changelog entries, comparison grids, reference docs. The compound API (Table.Head, Table.Body, Table.Row, Table.Cell) maps directly to semantic HTML so screen readers get the full table structure. Horizontal overflow is handled automatically by a scroll wrapper.",props:[{name:"striped",type:"boolean",required:!1,default:"false",description:"Applies alternating surfaceSecondary backgrounds to even tbody rows."},{name:"Table.Head",type:"component",required:!1,description:"Renders <thead> with surfaceSecondary background. Accepts Table.Row children."},{name:"Table.Body",type:"component",required:!1,description:"Renders <tbody>. Accepts Table.Row children."},{name:"Table.Foot",type:"component",required:!1,description:"Renders <tfoot> with surfaceSecondary background."},{name:"Table.Row",type:"component",required:!1,description:"Renders <tr> with a hover highlight. Accepts Table.Cell children."},{name:"Table.Cell",type:"component",required:!1,description:'Renders <td> by default or <th scope="col"> when as="th". Header cells are semibold + secondary colour; data cells are regular + primary.'}],usageExamples:[{title:"Basic",code:`<Table>
169
+ `;function hn({children:t,style:n,...a}){return e.jsx("thead",{style:{background:"var(--lucent-surface-secondary)",...n},...a,children:t})}function mn({children:t,...n}){return e.jsx("tbody",{...n,children:t})}function gn({children:t,style:n,...a}){return e.jsx("tfoot",{style:{background:"var(--lucent-surface-secondary)",...n},...a,children:t})}function bn({children:t,className:n,...a}){return e.jsx("tr",{className:["lucent-table-row",n].filter(Boolean).join(" "),...a,children:t})}function vn({as:t,children:n,style:a,...o}){const r=t==="th",i={padding:"var(--lucent-space-3) var(--lucent-space-4)",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-sm)",borderBottom:"1px solid var(--lucent-border-default)",textAlign:"left",verticalAlign:"middle",color:r?"var(--lucent-text-secondary)":"var(--lucent-text-primary)",fontWeight:r?"var(--lucent-font-weight-semibold)":"var(--lucent-font-weight-regular)",whiteSpace:r?"nowrap":void 0,...a};return r?e.jsx("th",{scope:"col",style:i,...o,children:n}):e.jsx("td",{style:i,...o,children:n})}function J({striped:t=!1,children:n,className:a,style:o,...r}){const i=["lucent-table",t&&"lucent-table-striped",a].filter(Boolean).join(" ");return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:fn}),e.jsx("div",{style:{overflowX:"auto",width:"100%"},children:e.jsx("table",{className:i,style:{width:"100%",borderCollapse:"collapse",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-sm)",...o},...r,children:n})})]})}J.Head=hn;J.Body=mn;J.Foot=gn;J.Row=bn;J.Cell=vn;const yn={id:"table",name:"Table",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A lightweight, token-styled HTML table primitive with compound sub-components. Distinct from DataTable — no sorting, filtering, or pagination.",designIntent:"Use Table for static or lightly dynamic tabular data where full DataTable features are not needed — props tables, changelog entries, comparison grids, reference docs. The compound API (Table.Head, Table.Body, Table.Row, Table.Cell) maps directly to semantic HTML so screen readers get the full table structure. Horizontal overflow is handled automatically by a scroll wrapper.",props:[{name:"striped",type:"boolean",required:!1,default:"false",description:"Applies alternating surfaceSecondary backgrounds to even tbody rows."},{name:"Table.Head",type:"component",required:!1,description:"Renders <thead> with surfaceSecondary background. Accepts Table.Row children."},{name:"Table.Body",type:"component",required:!1,description:"Renders <tbody>. Accepts Table.Row children."},{name:"Table.Foot",type:"component",required:!1,description:"Renders <tfoot> with surfaceSecondary background."},{name:"Table.Row",type:"component",required:!1,description:"Renders <tr> with a hover highlight. Accepts Table.Cell children."},{name:"Table.Cell",type:"component",required:!1,description:'Renders <td> by default or <th scope="col"> when as="th". Header cells are semibold + secondary colour; data cells are regular + primary.'}],usageExamples:[{title:"Basic",code:`<Table>
170
170
  <Table.Head>
171
171
  <Table.Row>
172
172
  <Table.Cell as="th">Name</Table.Cell>
@@ -184,7 +184,37 @@
184
184
  <Table.Body>…</Table.Body>
185
185
  </Table>`},{title:"Custom cell content",code:`<Table.Cell>
186
186
  <Badge variant="success">Active</Badge>
187
- </Table.Cell>`}],compositionGraph:[{componentId:"table-head",componentName:"Table.Head",role:"head",required:!1},{componentId:"table-body",componentName:"Table.Body",role:"body",required:!1},{componentId:"table-foot",componentName:"Table.Foot",role:"foot",required:!1},{componentId:"table-row",componentName:"Table.Row",role:"row",required:!1},{componentId:"table-cell",componentName:"Table.Cell",role:"cell",required:!1}],accessibility:{role:"table",ariaAttributes:['scope="col" on th cells'],keyboardInteractions:["Standard browser table navigation"]}};function Ut({label:t,htmlFor:n,required:a=!1,helperText:o,errorMessage:r,children:i,style:s}){const l=r??o,c=r?"danger":"secondary";return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--lucent-space-2)",...s},children:[t&&e.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"var(--lucent-space-1)"},children:[e.jsx(z,{as:"label",size:"sm",weight:"medium",lineHeight:"tight",...n!==void 0&&{htmlFor:n},children:t}),a&&e.jsx(z,{as:"span",size:"sm",color:"danger",lineHeight:"tight","aria-hidden":"true",children:"*"})]}),i,l&&e.jsx(z,{size:"xs",color:c,lineHeight:"tight",children:l})]})}const _t={id:"form-field",name:"FormField",tier:"molecule",domain:"neutral",specVersion:"0.1",description:"Wraps any form control (Input, Select, Textarea) with a label, helper text, and validation message.",designIntent:"FormField standardises the vertical rhythm around form controls. A label is linked to the control via htmlFor so screen readers announce it correctly. The required asterisk is decorative (aria-hidden) because the actual required state should be communicated on the input via aria-required. Helper text provides proactive guidance; errorMessage replaces it when validation fails, using danger color to draw attention. The gap between elements uses space-2 to create a tight but breathable stack.",props:[{name:"label",type:"string",required:!1,description:"Label text rendered above the control as a <label> element."},{name:"htmlFor",type:"string",required:!1,description:"ID of the form control this label describes. Forwarded to the label htmlFor attribute."},{name:"required",type:"boolean",required:!1,default:"false",description:"Appends a danger-colored asterisk after the label text."},{name:"helperText",type:"string",required:!1,description:"Secondary text below the control providing guidance. Hidden when errorMessage is set."},{name:"errorMessage",type:"string",required:!1,description:"Validation error shown in danger color below the control. Replaces helperText when set."},{name:"children",type:"ReactNode",required:!0,description:"The form control to wrap — typically Input, Select, or Textarea."},{name:"style",type:"object",required:!1,description:"Inline style overrides for the outer wrapper."}],usageExamples:[{title:"Basic field",code:`<FormField label="Email" htmlFor="email">
187
+ </Table.Cell>`}],compositionGraph:[{componentId:"table-head",componentName:"Table.Head",role:"head",required:!1},{componentId:"table-body",componentName:"Table.Body",role:"body",required:!1},{componentId:"table-foot",componentName:"Table.Foot",role:"foot",required:!1},{componentId:"table-row",componentName:"Table.Row",role:"row",required:!1},{componentId:"table-cell",componentName:"Table.Cell",role:"cell",required:!1}],accessibility:{role:"table",ariaAttributes:['scope="col" on th cells'],keyboardInteractions:["Standard browser table navigation"]}},Ae={sm:"30px",md:"36px",lg:"42px"},xn={sm:"var(--lucent-font-size-sm)",md:"var(--lucent-font-size-sm)",lg:"var(--lucent-font-size-md)"},wn={sm:"var(--lucent-space-2)",md:"var(--lucent-space-3)",lg:"var(--lucent-space-4)"};function ke({options:t,value:n,defaultValue:a,onChange:o,size:r="md",disabled:i=!1,fullWidth:s=!0,id:c,style:l}){var h;const[u,m]=f.useState(a??((h=t[0])==null?void 0:h.value)??""),d=n!==void 0?n:u,g=f.useRef(null),[p,x]=f.useState(null),b=f.useRef(!1);f.useLayoutEffect(()=>{const v=g.current;if(!v)return;const j=v.querySelector(`[data-sc-value="${d}"]`);j&&(x({left:j.offsetLeft,width:j.offsetWidth,animate:b.current}),b.current=!0)},[d,t]);const y=v=>{i||v.disabled||(n===void 0&&m(v.value),o==null||o(v.value))};return e.jsxs("div",{id:c,ref:g,role:"group",style:{position:"relative",display:"flex",alignItems:"center",width:s?"100%":"fit-content",height:Ae[r],background:"var(--lucent-surface-secondary)",borderRadius:"var(--lucent-radius-lg)",padding:2,gap:0,opacity:i?.5:1,...l},children:[p&&e.jsx("span",{"aria-hidden":!0,style:{position:"absolute",top:2,left:p.left,width:p.width,height:"calc(100% - 4px)",background:"var(--lucent-surface)",borderRadius:"var(--lucent-radius-md)",boxShadow:"0 1px 2px rgba(0,0,0,0.1)",transition:p.animate?"left var(--lucent-duration-base) var(--lucent-easing-default), width var(--lucent-duration-base) var(--lucent-easing-default)":"none",zIndex:0,pointerEvents:"none"}}),t.map(v=>{const j=v.value===d,S=i||!!v.disabled;return e.jsx("button",{"data-sc-value":v.value,type:"button",role:"radio","aria-checked":j,disabled:S,onClick:()=>y(v),style:{position:"relative",zIndex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:"var(--lucent-space-1)",flex:1,height:`calc(${Ae[r]} - 4px)`,padding:`0 ${wn[r]}`,fontSize:xn[r],fontFamily:"var(--lucent-font-family-base)",fontWeight:j?"var(--lucent-font-weight-medium)":"var(--lucent-font-weight-regular)",color:S?"var(--lucent-text-disabled)":j?"var(--lucent-text-primary)":"var(--lucent-text-secondary)",background:"transparent",border:"none",borderRadius:"var(--lucent-radius-md)",cursor:S?"not-allowed":"pointer",outline:"none",whiteSpace:"nowrap",transition:["color var(--lucent-duration-fast) var(--lucent-easing-default)","font-weight var(--lucent-duration-fast) var(--lucent-easing-default)"].join(", ")},onFocus:T=>{T.currentTarget.style.boxShadow="0 0 0 2px var(--lucent-accent-subtle)"},onBlur:T=>{T.currentTarget.style.boxShadow="none"},children:v.label},v.value)})]})}ke.displayName="SegmentedControl";const kn={xs:12,sm:16,md:22,lg:28,xl:36,"2xl":48},Sn={xs:"var(--lucent-radius-sm)",sm:"var(--lucent-radius-sm)",md:"var(--lucent-radius-md)",lg:"var(--lucent-radius-md)",xl:"var(--lucent-radius-lg)","2xl":"var(--lucent-radius-lg)"},Ee="inset 0 0 0 1px rgba(0,0,0,0.2)",Re="inset 0 0 0 2px rgba(0,0,0,0.5)",Tn="inset 0 0 0 1px rgba(0,0,0,0.2), 0 0 0 3px var(--lucent-accent-subtle)";function jn(t){return{backgroundImage:[`linear-gradient(${t}, ${t})`,"linear-gradient(45deg, #e5e5e5 25%, transparent 25%)","linear-gradient(-45deg, #e5e5e5 25%, transparent 25%)","linear-gradient(45deg, transparent 75%, #e5e5e5 75%)","linear-gradient(-45deg, transparent 75%, #e5e5e5 75%)"].join(", "),backgroundSize:"auto, 8px 8px, 8px 8px, 8px 8px, 8px 8px",backgroundPosition:"0 0, 0 0, 0 4px, 4px -4px, -4px 0",backgroundColor:"#fff"}}const ee=f.forwardRef(({color:t,size:n="md",shape:a="circle",showCheckerboard:o=!1,selected:r=!1,disabled:i=!1,style:s,onFocus:c,onBlur:l,onClick:u,...m},d)=>{const g=kn[n],p=a==="circle"?"50%":Sn[n];return e.jsx("button",{ref:d,type:"button",disabled:i,onClick:u,style:{width:g,height:g,flexShrink:0,...o?jn(t):{background:t},border:"none",borderRadius:p,cursor:i?"not-allowed":u?"pointer":"default",padding:0,outline:"none",opacity:i?.4:1,boxShadow:r?Re:Ee,transition:"box-shadow var(--lucent-duration-fast) var(--lucent-easing-default)",...s},onFocus:x=>{i||(x.currentTarget.style.boxShadow=Tn),c==null||c(x)},onBlur:x=>{x.currentTarget.style.boxShadow=r?Re:Ee,l==null||l(x)},...m})});ee.displayName="ColorSwatch";function ce(t,n,a){return Math.max(n,Math.min(a,t))}function Cn(t,n,a){const o=n/100,r=a/100,i=r*o,s=i*(1-Math.abs(t/60%2-1)),c=r-i;let l=0,u=0,m=0;return t<60?(l=i,u=s):t<120?(l=s,u=i):t<180?(u=i,m=s):t<240?(u=s,m=i):t<300?(l=s,m=i):(l=i,m=s),{r:Math.round((l+c)*255),g:Math.round((u+c)*255),b:Math.round((m+c)*255)}}function In(t,n,a){const o=t/255,r=n/255,i=a/255,s=Math.max(o,r,i),c=Math.min(o,r,i),l=s-c,u=s,m=s===0?0:l/s;let d=0;return l!==0&&(s===o?d=((r-i)/l+(r<i?6:0))/6:s===r?d=((i-o)/l+2)/6:d=((o-r)/l+4)/6),{h:Math.round(d*360),s:Math.round(m*100),v:Math.round(u*100)}}function Mn(t,n,a){const o=t/255,r=n/255,i=a/255,s=Math.max(o,r,i),c=Math.min(o,r,i),l=(s+c)/2;if(s===c)return{h:0,s:0,l:Math.round(l*100)};const u=s-c,m=l>.5?u/(2-s-c):u/(s+c);let d=0;return s===o?d=((r-i)/u+(r<i?6:0))/6:s===r?d=((i-o)/u+2)/6:d=((o-r)/u+4)/6,{h:Math.round(d*360),s:Math.round(m*100),l:Math.round(l*100)}}function le(t,n,a){const o=n/100,r=a/100,i=(1-Math.abs(2*r-1))*o,s=i*(1-Math.abs(t/60%2-1)),c=r-i/2;let l=0,u=0,m=0;return t<60?(l=i,u=s):t<120?(l=s,u=i):t<180?(u=i,m=s):t<240?(u=s,m=i):t<300?(l=s,m=i):(l=i,m=s),{r:Math.round((l+c)*255),g:Math.round((u+c)*255),b:Math.round((m+c)*255)}}function Se(t){const n=t.replace("#","");return n.length===3?`#${n[0]}${n[0]}${n[1]}${n[1]}${n[2]}${n[2]}`:n.length===6||n.length===8?`#${n}`:"#000000"}function He(t){const n=Se(t);return{r:parseInt(n.slice(1,3),16),g:parseInt(n.slice(3,5),16),b:parseInt(n.slice(5,7),16),a:n.length===9?+(parseInt(n.slice(7,9),16)/255).toFixed(2):1}}function me({r:t,g:n,b:a,a:o}){const r=s=>ce(Math.round(s),0,255).toString(16).padStart(2,"0"),i=`#${r(t)}${r(n)}${r(a)}`;return o<1?`${i}${r(Math.round(o*255))}`:i}function Oe({h:t,s:n,v:a,a:o}){return{...Cn(t,n,a),a:o}}function G({r:t,g:n,b:a,a:o}){return{...In(t,n,a),a:o}}function ae(t){return me(Oe(t))}function re(t){const n=t.trim();if(n.startsWith("#")){const r=Se(n);return/^#[0-9a-f]{6}([0-9a-f]{2})?$/i.test(r)?He(r):null}const a=n.match(/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})(?:\s*,\s*([\d.]+))?\s*\)$/);if(a){const r=+(a[1]??"0"),i=+(a[2]??"0"),s=+(a[3]??"0"),c=a[4]!==void 0?+a[4]:1;return[r,i,s].every(l=>l<=255)&&c>=0&&c<=1?{r,g:i,b:s,a:c}:null}const o=n.match(/^hsl\(\s*(\d{1,3})\s*,\s*(\d{1,3})%?\s*,\s*(\d{1,3})%?\s*\)$/);if(o){const r=+(o[1]??"0"),i=+(o[2]??"0"),s=+(o[3]??"0");return r<=360&&i<=100&&s<=100?{...le(r,i,s),a:1}:null}return null}const Dn=[{label:"Presets",colors:["#000000","#2563eb","#16a34a","#ca8a04","#dc2626","#0ea5e9","#9333ea","#4f46e5","#e11d48"]}],zn=["linear-gradient(45deg, #c0c0c0 25%, transparent 25%)","linear-gradient(-45deg, #c0c0c0 25%, transparent 25%)","linear-gradient(45deg, transparent 75%, #c0c0c0 75%)","linear-gradient(-45deg, transparent 75%, #c0c0c0 75%)"].join(", ");function qe({value:t,min:n,max:a,onChange:o,trackStyle:r,formatTooltip:i}){const s=f.useRef(null),[c,l]=f.useState(!1),u=f.useCallback(d=>{const g=s.current.getBoundingClientRect(),p=ce((d.clientX-g.left)/g.width,0,1);o(n+p*(a-n))},[n,a,o]),m=(t-n)/(a-n)*100;return e.jsx("div",{ref:s,style:{position:"relative",height:12,borderRadius:6,cursor:"crosshair",userSelect:"none",...r},onPointerDown:d=>{d.currentTarget.setPointerCapture(d.pointerId),l(!0),u(d)},onPointerMove:d=>{d.buttons>0&&u(d)},onPointerUp:()=>l(!1),onPointerCancel:()=>l(!1),children:e.jsx("div",{style:{position:"absolute",left:`${m}%`,top:"50%",transform:"translate(-50%, -50%)",width:14,height:14,borderRadius:"50%",background:"white",border:"2px solid rgba(0,0,0,0.22)",boxShadow:"0 1px 4px rgba(0,0,0,0.3)",zIndex:1,pointerEvents:"none"},children:c&&i&&e.jsx("div",{style:{position:"absolute",bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:6,background:"rgba(0,0,0,0.75)",color:"#fff",fontSize:11,fontFamily:"var(--lucent-font-family-base)",fontWeight:500,borderRadius:4,padding:"2px 6px",whiteSpace:"nowrap",pointerEvents:"none"},children:i(t)})})})}function An(){return e.jsxs("svg",{width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[e.jsx("path",{d:"M2 22l1-1h3l9-9"}),e.jsx("path",{d:"M3 21v-3l9-9"}),e.jsx("path",{d:"M15 6l3.4-3.4a2.1 2.1 0 1 1 3 3L18 9l.4.4a2.1 2.1 0 1 1-3 3l-3.8-3.8a2.1 2.1 0 1 1 3-3l.4.4Z"})]})}function Ge({value:t,onChange:n,label:a,disabled:o=!1,presetGroups:r=Dn,id:i,style:s}){var U,Ie;const c=f.useId(),l=i??c,[u,m]=f.useState(!1),[d,g]=f.useState("hex"),[p,x]=f.useState(0),[b,y]=f.useState(()=>{const k=t?re(t)??{r:0,g:0,b:0,a:1}:{r:0,g:0,b:0,a:1};return G(k)}),[h,v]=f.useState(()=>ae(b).slice(1).toUpperCase()),j=f.useRef(null),S=f.useRef(null),T=f.useRef(null),[z,q]=f.useState(!1);f.useLayoutEffect(()=>{if(!u||!T.current)return;const k=T.current.getBoundingClientRect();q(k.right>window.innerWidth)},[u]),f.useEffect(()=>{if(!t)return;const k=re(t);k&&(y(G(k)),v(me(k).slice(1).toUpperCase()))},[t]),f.useEffect(()=>{if(!u)return;const k=E=>{j.current&&!j.current.contains(E.target)&&m(!1)};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[u]);const w=f.useCallback(k=>{y(k);const E=ae(k);v(E.slice(1).toUpperCase()),n==null||n(E)},[n]),C=f.useCallback(k=>{const E=S.current.getBoundingClientRect(),F=Math.round(ce((k.clientX-E.left)/E.width,0,1)*100),$=Math.round((1-ce((k.clientY-E.top)/E.height,0,1))*100);w({...b,s:F,v:$})},[b,w]),V=f.useCallback(async()=>{if("EyeDropper"in window)try{const k=await new window.EyeDropper().open(),E=re(k.sRGBHex);E&&w(G(E))}catch{}},[w]),A=Oe(b),M=Mn(A.r,A.g,A.b),I=ae(b),D=ae({...b,a:1}),B=Math.round(b.a*100),H=[{id:"hex",label:"Hex"},{id:"rgb",label:"RGB"},{id:"hsl",label:"HSL"},{id:"hsb",label:"HSB"}],O=typeof window<"u"&&"EyeDropper"in window;return e.jsxs("div",{ref:j,style:{display:"inline-flex",flexDirection:"column",gap:"var(--lucent-space-1)",position:"relative",...s},children:[e.jsx("style",{children:`
188
+ .lucent-cp-field::-webkit-outer-spin-button,
189
+ .lucent-cp-field::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
190
+ .lucent-cp-field { -moz-appearance: textfield; }
191
+ `}),a&&e.jsx("label",{htmlFor:`${l}-swatch`,style:{fontSize:"var(--lucent-font-size-sm)",fontWeight:"var(--lucent-font-weight-medium)",color:o?"var(--lucent-text-disabled)":"var(--lucent-text-primary)",fontFamily:"var(--lucent-font-family-base)"},children:a}),e.jsx(ee,{id:`${l}-swatch`,color:`rgba(${A.r},${A.g},${A.b},${b.a})`,shape:"square",showCheckerboard:!0,disabled:o,onClick:()=>m(k=>!k),"aria-expanded":u,"aria-haspopup":"dialog",style:{width:40,height:40,borderRadius:"var(--lucent-radius-lg)",boxShadow:u?"inset 0 0 0 2px var(--lucent-focus-ring), 0 0 0 3px var(--lucent-accent-subtle)":"inset 0 0 0 1px rgba(0,0,0,0.2)"}}),u&&e.jsxs("div",{ref:T,role:"dialog","aria-label":"Color picker",style:{position:"absolute",top:"calc(100% + 8px)",...z?{right:0}:{left:0},zIndex:1e3,background:"var(--lucent-surface)",border:"1px solid var(--lucent-border-default)",borderRadius:"var(--lucent-radius-xl)",boxShadow:"var(--lucent-shadow-md)",width:280,overflow:"hidden",display:"flex",flexDirection:"column"},children:[e.jsxs("div",{ref:S,style:{position:"relative",height:160,background:`hsl(${b.h}, 100%, 50%)`,cursor:"crosshair",userSelect:"none",flexShrink:0},onPointerDown:k=>{k.currentTarget.setPointerCapture(k.pointerId),C(k)},onPointerMove:k=>{k.buttons>0&&C(k)},children:[e.jsx("div",{style:{position:"absolute",inset:0,background:"linear-gradient(to right, #fff, transparent)"}}),e.jsx("div",{style:{position:"absolute",inset:0,background:"linear-gradient(to bottom, transparent, #000)"}}),e.jsx("div",{style:{position:"absolute",left:`${b.s}%`,top:`${100-b.v}%`,transform:"translate(-50%, -50%)",width:14,height:14,borderRadius:"50%",border:"2px solid #fff",boxShadow:"0 0 0 1px rgba(0,0,0,0.25), 0 2px 4px rgba(0,0,0,0.35)",pointerEvents:"none"}})]}),e.jsxs("div",{style:{padding:12,display:"flex",flexDirection:"column",gap:10},children:[e.jsxs("div",{style:{display:"flex",gap:10,alignItems:"center"},children:[e.jsx(ee,{color:`rgba(${A.r},${A.g},${A.b},${b.a})`,shape:"square",showCheckerboard:!0,style:{width:44,height:44,borderRadius:8}}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:8},children:[e.jsx(qe,{value:b.h,min:0,max:360,onChange:k=>w({...b,h:Math.round(k)}),trackStyle:{background:"linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%)"},formatTooltip:k=>`${Math.round(k)}°`}),e.jsxs("div",{style:{position:"relative",borderRadius:6,overflow:"hidden"},children:[e.jsx("div",{style:{position:"absolute",inset:0,backgroundImage:zn,backgroundSize:"8px 8px",backgroundPosition:"0 0, 0 4px, 4px -4px, -4px 0",backgroundColor:"#fff"}}),e.jsx("div",{style:{position:"absolute",inset:0,background:`linear-gradient(to right, transparent, ${D})`}}),e.jsx(qe,{value:b.a,min:0,max:1,onChange:k=>w({...b,a:Math.round(k*100)/100}),trackStyle:{background:"transparent",position:"relative",zIndex:1},formatTooltip:k=>`${Math.round(k*100)}%`})]})]})]}),e.jsx(ke,{size:"sm",value:d,onChange:k=>g(k),options:H.map(({id:k,label:E})=>({value:k,label:E}))}),d==="hex"&&e.jsxs("div",{style:{display:"flex",gap:6,alignItems:"center"},children:[e.jsx(ye,{variant:"secondary",size:"sm",onClick:V,disabled:!O,title:O?"Pick color from screen":"Not supported in this browser",leftIcon:e.jsx(An,{}),style:{flexShrink:0,paddingLeft:8,paddingRight:8}}),e.jsx(_,{size:"sm",prefix:"#",value:h,onChange:k=>{const E=k.target.value.replace("#","");v(E.toUpperCase());const F=re(`#${E}`);if(F){const $=G(F);y($),n==null||n(me(F))}},spellCheck:!1,placeholder:"000000",maxLength:8,style:{flex:1}}),e.jsx(_,{size:"sm",type:"number",suffix:"%",value:B,min:0,max:100,onChange:k=>{const E=+k.target.value;!isNaN(E)&&E>=0&&E<=100&&w({...b,a:E/100})},className:"lucent-cp-field",style:{width:68,flexShrink:0}})]}),d==="rgb"&&e.jsx("div",{style:{display:"flex",gap:6},children:[{label:"R",val:A.r,max:255,fn:k=>w(G({...A,r:k}))},{label:"G",val:A.g,max:255,fn:k=>w(G({...A,g:k}))},{label:"B",val:A.b,max:255,fn:k=>w(G({...A,b:k}))},{label:"A",val:B,max:100,fn:k=>w({...b,a:k/100})}].map(({label:k,val:E,max:F,fn:$})=>e.jsx(_,{size:"sm",type:"number",prefix:k,value:E,min:0,max:F,onChange:Z=>{const W=+Z.target.value;!isNaN(W)&&W>=0&&W<=F&&$(W)},className:"lucent-cp-field",style:{flex:1}},k))}),d==="hsl"&&e.jsx("div",{style:{display:"flex",gap:6},children:[{label:"H",val:M.h,max:360,fn:k=>{const{r:E,g:F,b:$}=le(k,M.s,M.l);w(G({r:E,g:F,b:$,a:b.a}))}},{label:"S",val:M.s,max:100,fn:k=>{const{r:E,g:F,b:$}=le(M.h,k,M.l);w(G({r:E,g:F,b:$,a:b.a}))}},{label:"L",val:M.l,max:100,fn:k=>{const{r:E,g:F,b:$}=le(M.h,M.s,k);w(G({r:E,g:F,b:$,a:b.a}))}},{label:"A",val:B,max:100,fn:k=>w({...b,a:k/100})}].map(({label:k,val:E,max:F,fn:$})=>e.jsx(_,{size:"sm",type:"number",prefix:k,value:E,min:0,max:F,onChange:Z=>{const W=+Z.target.value;!isNaN(W)&&W>=0&&W<=F&&$(W)},className:"lucent-cp-field",style:{flex:1}},k))}),d==="hsb"&&e.jsx("div",{style:{display:"flex",gap:6},children:[{label:"H",val:b.h,max:360,fn:k=>w({...b,h:k})},{label:"S",val:b.s,max:100,fn:k=>w({...b,s:k})},{label:"B",val:b.v,max:100,fn:k=>w({...b,v:k})},{label:"A",val:B,max:100,fn:k=>w({...b,a:k/100})}].map(({label:k,val:E,max:F,fn:$})=>e.jsx(_,{size:"sm",type:"number",prefix:k,value:E,min:0,max:F,onChange:Z=>{const W=+Z.target.value;!isNaN(W)&&W>=0&&W<=F&&$(W)},className:"lucent-cp-field",style:{flex:1}},k))}),r.length>0&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[r.length>1&&e.jsx(we,{size:"sm",value:String(p),onChange:k=>x(Number(k.target.value)),options:r.map((k,E)=>({value:String(E),label:k.label}))}),r.length===1&&e.jsx("span",{style:{fontSize:"var(--lucent-font-size-xs)",fontWeight:"var(--lucent-font-weight-medium)",color:"var(--lucent-text-secondary)",fontFamily:"var(--lucent-font-family-base)"},children:(U=r[0])==null?void 0:U.label}),e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:(((Ie=r[p])==null?void 0:Ie.colors)??[]).map(k=>{const E=Se(k).toLowerCase()===I.slice(0,7).toLowerCase();return e.jsx(ee,{color:k,selected:E,onClick:()=>w(G(He(k)))},k)})})]})]})]})]})}Ge.displayName="ColorPicker";const En={id:"color-picker",name:"ColorPicker",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A color swatch button that opens a popover with preset swatches and HEX / RGB / RGBA / HSL inputs.",designIntent:"ColorPicker surfaces color selection without navigating away. The swatch button shows the current color at a glance; the popover provides precise input through four format modes. Presets accelerate common choices — provide a curated palette relevant to the product. Always pair with a visible label so the purpose of the picker is clear.",props:[{name:"value",type:"string",required:!1,description:"Controlled color value. Accepts hex (#rrggbb / #rrggbbaa), rgb(), rgba(), or hsl() strings."},{name:"onChange",type:"function",required:!1,description:"Called with the new hex string (#rrggbb, or #rrggbbaa when alpha < 1) whenever the color changes."},{name:"label",type:"string",required:!1,description:"Visible label rendered above the swatch button."},{name:"presets",type:"string[]",required:!1,description:"Array of hex color strings shown as clickable swatches. Defaults to a 16-color palette."},{name:"disabled",type:"boolean",required:!1,default:"false",description:"Prevents interaction and dims the label."},{name:"id",type:"string",required:!1,description:"HTML id for the swatch button. Auto-generated if omitted."},{name:"style",type:"CSSProperties",required:!1,description:"Inline styles applied to the outer wrapper."}],usageExamples:[{title:"Basic controlled",code:`const [color, setColor] = useState('#3b82f6');
192
+ <ColorPicker value={color} onChange={setColor} label="Brand color" />`},{title:"Custom presets",code:`<ColorPicker
193
+ value={accent}
194
+ onChange={setAccent}
195
+ label="Accent"
196
+ presets={['#111827', '#3b82f6', '#8b5cf6', '#ec4899', '#ef4444', '#f97316', '#22c55e']}
197
+ />`},{title:"No presets",code:'<ColorPicker value={color} onChange={setColor} presets={[]} label="Custom color" />'},{title:"Disabled",code:'<ColorPicker value="#6b7280" disabled label="Theme color" />'}],compositionGraph:[],accessibility:{role:"button (trigger) + dialog (popover)",ariaAttributes:["aria-expanded","aria-haspopup","aria-label"],keyboardInteractions:["Enter / Space — opens the color picker popover","Escape / click outside — closes the popover","Tab — moves through format tabs and input fields within the popover"]}},Rn={id:"color-swatch",name:"ColorSwatch",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A circular color swatch that can be static or interactive.",designIntent:"ColorSwatch is the smallest unit of color representation in the system. Use it wherever a color needs to be shown at a glance — palette pickers, token lists, or inline color indicators. The selected state shows an accent-colored ring to indicate the active choice.",props:[{name:"color",type:"string",required:!0,description:"CSS color value to display."},{name:"size",type:"'sm' | 'md' | 'lg'",required:!1,default:"'md'",description:"Swatch diameter: sm=16px, md=22px, lg=28px."},{name:"selected",type:"boolean",required:!1,default:"false",description:"Shows an accent ring when true."},{name:"onClick",type:"function",required:!1,description:"Click handler. Omit for a non-interactive display swatch."},{name:"disabled",type:"boolean",required:!1,default:"false",description:"Dims the swatch and prevents interaction."},{name:"title",type:"string",required:!1,description:"Tooltip text. Defaults to the color value."},{name:"style",type:"CSSProperties",required:!1,description:"Inline styles applied to the swatch button."}],usageExamples:[{title:"Static palette",code:`['#ef4444', '#f97316', '#22c55e'].map(c => (
198
+ <ColorSwatch key={c} color={c} />
199
+ ))`},{title:"Selectable swatch",code:`<ColorSwatch color="#3b82f6" selected={active === '#3b82f6'} onClick={() => setActive('#3b82f6')} />`}],compositionGraph:[],accessibility:{role:"button",ariaAttributes:["title (tooltip)"],keyboardInteractions:["Enter / Space — triggers onClick"]}},qn={id:"segmented-control",name:"SegmentedControl",tier:"atom",domain:"neutral",specVersion:"0.1",description:"A pill-group selector where exactly one option is always active, with a sliding indicator.",designIntent:"Use SegmentedControl for mutually exclusive view switches or mode selectors that have 2–5 options and where all options should be visible simultaneously (unlike Select). Common uses: view mode (Grid / List / Table), time range (Day / Week / Month), format picker (Hex / RGB / HSL). Keep labels short (1–2 words) so the control stays compact. For more than 5 options or dynamic option lists, prefer Select.",props:[{name:"options",type:"SegmentedOption[]",required:!0,description:"Array of { value, label, disabled? }. 2–5 options recommended."},{name:"value",type:"string",required:!1,description:"Controlled selected value. Pair with onChange."},{name:"defaultValue",type:"string",required:!1,description:"Initial value for uncontrolled usage. Defaults to the first option."},{name:"onChange",type:"function",required:!1,description:"Called with the newly selected value."},{name:"size",type:"enum",required:!1,default:"md",description:"Height and font size of the control.",enumValues:["sm","md","lg"]},{name:"disabled",type:"boolean",required:!1,default:"false",description:"Disables all options."},{name:"fullWidth",type:"boolean",required:!1,default:"false",description:"Stretches the control to fill its container, distributing options equally."}],usageExamples:[{title:"Controlled",code:`const [view, setView] = useState('grid');
200
+ <SegmentedControl
201
+ value={view}
202
+ onChange={setView}
203
+ options={[
204
+ { value: 'grid', label: 'Grid' },
205
+ { value: 'list', label: 'List' },
206
+ { value: 'table', label: 'Table' },
207
+ ]}
208
+ />`},{title:"With icons",code:`<SegmentedControl
209
+ defaultValue="week"
210
+ options={[
211
+ { value: 'day', label: <><CalIcon /> Day</> },
212
+ { value: 'week', label: <><CalIcon /> Week</> },
213
+ { value: 'month', label: <><CalIcon /> Month</> },
214
+ ]}
215
+ />`},{title:"Full-width, sizes",code:`<SegmentedControl fullWidth size="sm" defaultValue="a" options={[{ value: 'a', label: 'Alpha' }, { value: 'b', label: 'Beta' }]} />
216
+ <SegmentedControl fullWidth size="md" defaultValue="a" options={[{ value: 'a', label: 'Alpha' }, { value: 'b', label: 'Beta' }]} />
217
+ <SegmentedControl fullWidth size="lg" defaultValue="a" options={[{ value: 'a', label: 'Alpha' }, { value: 'b', label: 'Beta' }]} />`}],compositionGraph:[],accessibility:{role:"group (radiogroup)",ariaAttributes:["aria-checked",'role="radio"',"disabled"],keyboardInteractions:["Tab — focuses the group","Click — selects an option"]}};function Ln({label:t,htmlFor:n,required:a=!1,helperText:o,errorMessage:r,children:i,style:s}){const c=r??o,l=r?"danger":"secondary";return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--lucent-space-2)",...s},children:[t&&e.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"var(--lucent-space-1)"},children:[e.jsx(R,{as:"label",size:"sm",weight:"medium",lineHeight:"tight",...n!==void 0&&{htmlFor:n},children:t}),a&&e.jsx(R,{as:"span",size:"sm",color:"danger",lineHeight:"tight","aria-hidden":"true",children:"*"})]}),i,c&&e.jsx(R,{size:"xs",color:l,lineHeight:"tight",children:c})]})}const Bn={id:"form-field",name:"FormField",tier:"molecule",domain:"neutral",specVersion:"0.1",description:"Wraps any form control (Input, Select, Textarea) with a label, helper text, and validation message.",designIntent:"FormField standardises the vertical rhythm around form controls. A label is linked to the control via htmlFor so screen readers announce it correctly. The required asterisk is decorative (aria-hidden) because the actual required state should be communicated on the input via aria-required. Helper text provides proactive guidance; errorMessage replaces it when validation fails, using danger color to draw attention. The gap between elements uses space-2 to create a tight but breathable stack.",props:[{name:"label",type:"string",required:!1,description:"Label text rendered above the control as a <label> element."},{name:"htmlFor",type:"string",required:!1,description:"ID of the form control this label describes. Forwarded to the label htmlFor attribute."},{name:"required",type:"boolean",required:!1,default:"false",description:"Appends a danger-colored asterisk after the label text."},{name:"helperText",type:"string",required:!1,description:"Secondary text below the control providing guidance. Hidden when errorMessage is set."},{name:"errorMessage",type:"string",required:!1,description:"Validation error shown in danger color below the control. Replaces helperText when set."},{name:"children",type:"ReactNode",required:!0,description:"The form control to wrap — typically Input, Select, or Textarea."},{name:"style",type:"object",required:!1,description:"Inline style overrides for the outer wrapper."}],usageExamples:[{title:"Basic field",code:`<FormField label="Email" htmlFor="email">
188
218
  <Input id="email" placeholder="you@example.com" />
189
219
  </FormField>`},{title:"Required with helper",code:`<FormField label="Username" htmlFor="username" required helperText="Letters and numbers only">
190
220
  <Input id="username" />
@@ -192,7 +222,7 @@
192
222
  <Input id="pw" type="password" />
193
223
  </FormField>`},{title:"Wrapping a Select",code:`<FormField label="Country" htmlFor="country">
194
224
  <Select id="country" options={countryOptions} />
195
- </FormField>`}],compositionGraph:[{componentId:"text",componentName:"Text",role:"Label, helper text, and error message",required:!1}],accessibility:{ariaAttributes:["aria-required","aria-describedby"],notes:'Link the wrapped control to an error message using aria-describedby on the control and a matching id on the error element for full screen reader support. The required asterisk is aria-hidden; set aria-required="true" on the control itself.'}},Kt=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"6.5",cy:"6.5",r:"4",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M9.5 9.5L13 13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),Yt=()=>e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M3 3L11 11M11 3L3 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})});function Xt({value:t,onChange:n,placeholder:a="Search…",results:o=[],onResultSelect:r,isLoading:i=!1,disabled:s=!1,id:l,style:c}){const[h,g]=m.useState(!1),[u,p]=m.useState(null),d=m.useRef(null),x=h&&o.length>0,y=()=>{n("")},b=w=>{r==null||r(w),g(!1)},f=()=>{d.current=setTimeout(()=>g(!1),150)},v=()=>{d.current&&clearTimeout(d.current),g(!0)},I=i?e.jsx(ge,{size:"sm"}):t?e.jsx("button",{type:"button","aria-label":"Clear search",onClick:y,style:{display:"flex",alignItems:"center",background:"none",border:"none",cursor:"pointer",padding:2,borderRadius:"var(--lucent-radius-sm)",color:"var(--lucent-text-secondary)"},onMouseEnter:w=>{w.currentTarget.style.color="var(--lucent-text-primary)"},onMouseLeave:w=>{w.currentTarget.style.color="var(--lucent-text-secondary)"},children:e.jsx(Yt,{})}):null;return e.jsxs("div",{style:{position:"relative",...c},children:[e.jsx(re,{id:l,type:"search",value:t,onChange:w=>n(w.target.value),placeholder:a,disabled:s,leftElement:e.jsx(Kt,{}),rightElement:I??void 0,onFocus:v,onBlur:f}),x&&e.jsx("div",{role:"listbox",style:{position:"absolute",top:"calc(100% + var(--lucent-space-1))",left:0,right:0,zIndex:50,background:"var(--lucent-surface-overlay)",border:"1px solid var(--lucent-border-default)",borderRadius:"var(--lucent-radius-md)",boxShadow:"var(--lucent-shadow-md)",overflow:"hidden"},children:o.map((w,S)=>e.jsx("div",{role:"option","aria-selected":!1,onMouseDown:()=>b(w),onMouseEnter:()=>p(S),onMouseLeave:()=>p(null),style:{padding:"var(--lucent-space-2) var(--lucent-space-3)",cursor:"pointer",background:u===S?"var(--lucent-surface-secondary)":"transparent",transition:"background var(--lucent-duration-fast) var(--lucent-easing-default)"},children:e.jsx(z,{as:"span",size:"md",children:w.label})},w.id))})]})}const Jt={id:"search-input",name:"SearchInput",tier:"molecule",domain:"neutral",specVersion:"0.1",description:"A search field with a built-in magnifier icon, clear button, and an optional results dropdown.",designIntent:"SearchInput is intentionally dumb about filtering — the consumer passes already-filtered results so the component stays stateless and flexible. The clear button appears only when the input has a value, keeping the right side clean at rest. The results dropdown is rendered absolutely below the input and closes after a 150ms delay on blur to allow result clicks to register before focus is lost. Spinner replaces the clear button during loading to communicate async state without layout shift.",props:[{name:"value",type:"string",required:!0,description:"Controlled input value."},{name:"onChange",type:"function",required:!0,description:"Called with the new string value whenever the input changes."},{name:"placeholder",type:"string",required:!1,default:'"Search…"',description:"Placeholder text for the input."},{name:"results",type:"array",required:!1,default:"[]",description:"Pre-filtered list of SearchResult objects ({ id, label }) to display in the dropdown."},{name:"onResultSelect",type:"function",required:!1,description:"Called with the selected SearchResult when a dropdown item is clicked."},{name:"isLoading",type:"boolean",required:!1,default:"false",description:"Shows a spinner in the right slot to indicate async search in progress."},{name:"disabled",type:"boolean",required:!1,default:"false",description:"Disables the input."},{name:"id",type:"string",required:!1,description:"HTML id forwarded to the underlying input element."},{name:"style",type:"object",required:!1,description:"Inline style overrides for the outer wrapper."}],usageExamples:[{title:"Basic controlled search",code:`const [query, setQuery] = useState('');
225
+ </FormField>`}],compositionGraph:[{componentId:"text",componentName:"Text",role:"Label, helper text, and error message",required:!1}],accessibility:{ariaAttributes:["aria-required","aria-describedby"],notes:'Link the wrapped control to an error message using aria-describedby on the control and a matching id on the error element for full screen reader support. The required asterisk is aria-hidden; set aria-required="true" on the control itself.'}},Fn=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"6.5",cy:"6.5",r:"4",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M9.5 9.5L13 13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),Nn=()=>e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M3 3L11 11M11 3L3 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})});function Pn({value:t,onChange:n,placeholder:a="Search…",results:o=[],onResultSelect:r,isLoading:i=!1,disabled:s=!1,id:c,style:l}){const[u,m]=f.useState(!1),[d,g]=f.useState(null),p=f.useRef(null),x=u&&o.length>0,b=()=>{n("")},y=S=>{r==null||r(S),m(!1)},h=()=>{p.current=setTimeout(()=>m(!1),150)},v=()=>{p.current&&clearTimeout(p.current),m(!0)},j=i?e.jsx($e,{size:"sm"}):t?e.jsx("button",{type:"button","aria-label":"Clear search",onClick:b,style:{display:"flex",alignItems:"center",background:"none",border:"none",cursor:"pointer",padding:2,borderRadius:"var(--lucent-radius-sm)",color:"var(--lucent-text-secondary)"},onMouseEnter:S=>{S.currentTarget.style.color="var(--lucent-text-primary)"},onMouseLeave:S=>{S.currentTarget.style.color="var(--lucent-text-secondary)"},children:e.jsx(Nn,{})}):null;return e.jsxs("div",{style:{position:"relative",...l},children:[e.jsx(_,{id:c,type:"search",value:t,onChange:S=>n(S.target.value),placeholder:a,disabled:s,leftElement:e.jsx(Fn,{}),rightElement:j??void 0,onFocus:v,onBlur:h}),x&&e.jsx("div",{role:"listbox",style:{position:"absolute",top:"calc(100% + var(--lucent-space-1))",left:0,right:0,zIndex:50,background:"var(--lucent-surface-overlay)",border:"1px solid var(--lucent-border-default)",borderRadius:"var(--lucent-radius-md)",boxShadow:"var(--lucent-shadow-md)",overflow:"hidden"},children:o.map((S,T)=>e.jsx("div",{role:"option","aria-selected":!1,onMouseDown:()=>y(S),onMouseEnter:()=>g(T),onMouseLeave:()=>g(null),style:{padding:"var(--lucent-space-2) var(--lucent-space-3)",cursor:"pointer",background:d===T?"var(--lucent-surface-secondary)":"transparent",transition:"background var(--lucent-duration-fast) var(--lucent-easing-default)"},children:e.jsx(R,{as:"span",size:"md",children:S.label})},S.id))})]})}const $n={id:"search-input",name:"SearchInput",tier:"molecule",domain:"neutral",specVersion:"0.1",description:"A search field with a built-in magnifier icon, clear button, and an optional results dropdown.",designIntent:"SearchInput is intentionally dumb about filtering — the consumer passes already-filtered results so the component stays stateless and flexible. The clear button appears only when the input has a value, keeping the right side clean at rest. The results dropdown is rendered absolutely below the input and closes after a 150ms delay on blur to allow result clicks to register before focus is lost. Spinner replaces the clear button during loading to communicate async state without layout shift.",props:[{name:"value",type:"string",required:!0,description:"Controlled input value."},{name:"onChange",type:"function",required:!0,description:"Called with the new string value whenever the input changes."},{name:"placeholder",type:"string",required:!1,default:'"Search…"',description:"Placeholder text for the input."},{name:"results",type:"array",required:!1,default:"[]",description:"Pre-filtered list of SearchResult objects ({ id, label }) to display in the dropdown."},{name:"onResultSelect",type:"function",required:!1,description:"Called with the selected SearchResult when a dropdown item is clicked."},{name:"isLoading",type:"boolean",required:!1,default:"false",description:"Shows a spinner in the right slot to indicate async search in progress."},{name:"disabled",type:"boolean",required:!1,default:"false",description:"Disables the input."},{name:"id",type:"string",required:!1,description:"HTML id forwarded to the underlying input element."},{name:"style",type:"object",required:!1,description:"Inline style overrides for the outer wrapper."}],usageExamples:[{title:"Basic controlled search",code:`const [query, setQuery] = useState('');
196
226
  const [results, setResults] = useState([]);
197
227
 
198
228
  <SearchInput
@@ -200,7 +230,7 @@ const [results, setResults] = useState([]);
200
230
  onChange={(v) => { setQuery(v); setResults(filter(v)); }}
201
231
  results={results}
202
232
  onResultSelect={(r) => console.log(r)}
203
- />`},{title:"Loading state",code:"<SearchInput value={query} onChange={setQuery} isLoading={isFetching} results={[]} />"}],compositionGraph:[{componentId:"input",componentName:"Input",role:"Search text field with icon slots",required:!0},{componentId:"spinner",componentName:"Spinner",role:"Loading indicator in the right slot",required:!1}],accessibility:{role:"combobox",ariaAttributes:["aria-expanded","aria-haspopup","aria-label"],keyboardInteractions:["Enter to select focused result","Escape to close dropdown"],notes:'The results list uses role="listbox" with role="option" items. For full keyboard navigation (arrow keys to move between results), wire up onKeyDown on the Input and manage an activeIndex state.'}},Qt={none:"0",sm:"var(--lucent-space-3)",md:"var(--lucent-space-4)",lg:"var(--lucent-space-6)"},Zt={none:"var(--lucent-shadow-none)",sm:"var(--lucent-shadow-sm)",md:"var(--lucent-shadow-md)",lg:"var(--lucent-shadow-lg)"},en={none:"var(--lucent-radius-none)",sm:"var(--lucent-radius-sm)",md:"var(--lucent-radius-md)",lg:"var(--lucent-radius-lg)"};function tn({header:t,footer:n,children:a,padding:o="md",shadow:r="sm",radius:i="md",style:s}){const l=Qt[o],c=en[i];return e.jsxs("div",{style:{display:"flex",flexDirection:"column",background:"var(--lucent-surface)",border:"1px solid var(--lucent-border-default)",borderRadius:c,boxShadow:Zt[r],overflow:"hidden",boxSizing:"border-box",...s},children:[t!=null&&e.jsx("div",{style:{padding:l,borderBottom:"1px solid var(--lucent-border-default)"},children:t}),e.jsx("div",{style:{padding:l,flex:1},children:a}),n!=null&&e.jsx("div",{style:{padding:l,borderTop:"1px solid var(--lucent-border-default)"},children:n})]})}const nn={id:"card",name:"Card",tier:"molecule",domain:"neutral",specVersion:"0.1",description:"A surface container with optional header, body, and footer slots, configurable padding, shadow, and radius.",designIntent:`Card provides a consistent elevated surface for grouping related content. The header and footer slots are separated from the body by a border-default divider, giving visual structure without requiring the consumer to manage spacing. Padding, shadow, and radius are all configurable to accommodate flat/ghost cards, modal-like surfaces, and compact data-dense layouts. The overflow: hidden ensures children respect the border-radius without needing additional clipping.
233
+ />`},{title:"Loading state",code:"<SearchInput value={query} onChange={setQuery} isLoading={isFetching} results={[]} />"}],compositionGraph:[{componentId:"input",componentName:"Input",role:"Search text field with icon slots",required:!0},{componentId:"spinner",componentName:"Spinner",role:"Loading indicator in the right slot",required:!1}],accessibility:{role:"combobox",ariaAttributes:["aria-expanded","aria-haspopup","aria-label"],keyboardInteractions:["Enter to select focused result","Escape to close dropdown"],notes:'The results list uses role="listbox" with role="option" items. For full keyboard navigation (arrow keys to move between results), wire up onKeyDown on the Input and manage an activeIndex state.'}},Wn={none:"0",sm:"var(--lucent-space-4)",md:"var(--lucent-space-6)",lg:"var(--lucent-space-8)"},Vn={none:"var(--lucent-shadow-none)",sm:"var(--lucent-shadow-sm)",md:"var(--lucent-shadow-md)",lg:"var(--lucent-shadow-lg)"},Hn={none:"var(--lucent-radius-none)",sm:"var(--lucent-radius-sm)",md:"var(--lucent-radius-md)",lg:"var(--lucent-radius-lg)"};function On({header:t,footer:n,children:a,padding:o="md",shadow:r="sm",radius:i="md",style:s}){const c=Wn[o],l=Hn[i];return e.jsxs("div",{style:{display:"flex",flexDirection:"column",background:"var(--lucent-surface)",border:"1px solid var(--lucent-border-default)",borderRadius:l,boxShadow:Vn[r],overflow:"hidden",boxSizing:"border-box",...s},children:[t!=null&&e.jsx("div",{style:{padding:c,borderBottom:"1px solid var(--lucent-border-default)"},children:t}),e.jsx("div",{style:{padding:c,flex:1},children:a}),n!=null&&e.jsx("div",{style:{padding:c,borderTop:"1px solid var(--lucent-border-default)"},children:n})]})}const Gn={id:"card",name:"Card",tier:"molecule",domain:"neutral",specVersion:"0.1",description:"A surface container with optional header, body, and footer slots, configurable padding, shadow, and radius.",designIntent:`Card provides a consistent elevated surface for grouping related content. The header and footer slots are separated from the body by a border-default divider, giving visual structure without requiring the consumer to manage spacing. Padding, shadow, and radius are all configurable to accommodate flat/ghost cards, modal-like surfaces, and compact data-dense layouts. The overflow: hidden ensures children respect the border-radius without needing additional clipping.
204
234
 
205
235
  Token rule: Card uses surface for its background. Never use bgBase or bgSubtle on a Card — those tokens are reserved for the page canvas (body, sidebar, layout regions). Content nested inside a Card that needs a tinted fill (e.g. a footer, inset panel, or disabled input) should use surfaceSecondary.`,props:[{name:"children",type:"ReactNode",required:!0,description:"The card body content."},{name:"header",type:"ReactNode",required:!1,description:"Content rendered in the header slot, separated from the body by a divider."},{name:"footer",type:"ReactNode",required:!1,description:"Content rendered in the footer slot, separated from the body by a divider."},{name:"padding",type:"enum",required:!1,default:"md",description:"Inner padding applied equally to header, body, and footer.",enumValues:["none","sm","md","lg"]},{name:"shadow",type:"enum",required:!1,default:"sm",description:"Box shadow elevation.",enumValues:["none","sm","md","lg"]},{name:"radius",type:"enum",required:!1,default:"md",description:"Border radius of the card.",enumValues:["none","sm","md","lg"]},{name:"style",type:"object",required:!1,description:"Inline style overrides for the card wrapper."}],usageExamples:[{title:"Simple card",code:`<Card>
206
236
  <Text>Some content here.</Text>
@@ -211,11 +241,11 @@ Token rule: Card uses surface for its background. Never use bgBase or bgSubtle o
211
241
  <Text color="secondary">Card body content goes here.</Text>
212
242
  </Card>`},{title:"Flat variant",code:`<Card shadow="none" radius="sm" padding="sm">
213
243
  <Text size="sm">Compact flat card</Text>
214
- </Card>`}],compositionGraph:[],accessibility:{notes:"Card has no implicit ARIA role. If the card represents a landmark, wrap it in a <section> or <article> and provide an aria-label. For interactive cards (clickable), make the wrapper a <button> or <a> and ensure focus styles are visible."}},an={info:{bg:"var(--lucent-info-subtle)",border:"var(--lucent-info-default)",iconColor:"var(--lucent-info-text)",textColor:"info"},success:{bg:"var(--lucent-success-subtle)",border:"var(--lucent-success-default)",iconColor:"var(--lucent-success-text)",textColor:"success"},warning:{bg:"var(--lucent-warning-subtle)",border:"var(--lucent-warning-default)",iconColor:"var(--lucent-warning-text)",textColor:"warning"},danger:{bg:"var(--lucent-danger-subtle)",border:"var(--lucent-danger-default)",iconColor:"var(--lucent-danger-text)",textColor:"danger"}},rn=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"8",cy:"8",r:"6.5",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M8 5.5V8.5M8 10.5V11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),on=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"8",cy:"8",r:"6.5",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M5 8L7 10L11 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),sn=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[e.jsx("path",{d:"M8 2L14.5 13H1.5L8 2Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),e.jsx("path",{d:"M8 6V9M8 11V11.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),ln=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"8",cy:"8",r:"6.5",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M5.5 5.5L10.5 10.5M10.5 5.5L5.5 10.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),cn={info:e.jsx(rn,{}),success:e.jsx(on,{}),warning:e.jsx(sn,{}),danger:e.jsx(ln,{})},dn=()=>e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M3 3L11 11M11 3L3 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})});function un({variant:t="info",title:n,children:a,onDismiss:o,icon:r,style:i}){const s=an[t],l=r??cn[t];return e.jsxs("div",{role:"alert",style:{display:"flex",alignItems:"flex-start",gap:"var(--lucent-space-3)",padding:"var(--lucent-space-3) var(--lucent-space-4)",background:s.bg,border:`1px solid ${s.border}`,borderRadius:"var(--lucent-radius-md)",boxSizing:"border-box",...i},children:[e.jsx("span",{style:{flexShrink:0,color:s.iconColor,display:"flex",alignItems:"center",paddingTop:2},children:l}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"var(--lucent-space-1)"},children:[n&&e.jsx(z,{as:"span",size:"sm",weight:"semibold",color:s.textColor,lineHeight:"tight",children:n}),a&&e.jsx(z,{as:"span",size:"sm",color:s.textColor,lineHeight:"base",children:a})]}),o&&e.jsx("button",{type:"button","aria-label":"Dismiss",onClick:o,style:{flexShrink:0,display:"flex",alignItems:"center",background:"none",border:"none",cursor:"pointer",padding:2,borderRadius:"var(--lucent-radius-sm)",color:s.iconColor,opacity:.7},onMouseEnter:c=>{c.currentTarget.style.opacity="1"},onMouseLeave:c=>{c.currentTarget.style.opacity="0.7"},children:e.jsx(dn,{})})]})}const pn={id:"alert",name:"Alert",tier:"molecule",domain:"neutral",specVersion:"0.1",description:"An inline feedback banner with info, success, warning, and danger variants, optional title, and dismiss button.",designIntent:'Alert uses role="alert" so screen readers announce the message immediately when it appears. Each variant has a built-in icon that communicates intent visually; the icon can be overridden for custom scenarios. Title and body are both optional — you can show either, both, or just an icon with a body. The dismiss button is only rendered when onDismiss is provided, keeping the layout clean for non-dismissible alerts. All colors use status semantic tokens so they adapt correctly between light and dark themes.',props:[{name:"variant",type:"enum",required:!1,default:"info",description:"Visual and semantic variant of the alert.",enumValues:["info","success","warning","danger"]},{name:"title",type:"string",required:!1,description:"Bold title line rendered above the body."},{name:"children",type:"ReactNode",required:!1,description:"Alert body content — typically a short sentence or ReactNode."},{name:"onDismiss",type:"function",required:!1,description:"When provided, renders a dismiss (×) button and calls this handler on click."},{name:"icon",type:"ReactNode",required:!1,description:"Custom icon to replace the built-in variant icon."},{name:"style",type:"object",required:!1,description:"Inline style overrides for the alert wrapper."}],usageExamples:[{title:"Info with body",code:'<Alert variant="info">Your changes have been saved as a draft.</Alert>'},{title:"With title and dismiss",code:`<Alert variant="danger" title="Payment failed" onDismiss={() => setVisible(false)}>
244
+ </Card>`}],compositionGraph:[],accessibility:{notes:"Card has no implicit ARIA role. If the card represents a landmark, wrap it in a <section> or <article> and provide an aria-label. For interactive cards (clickable), make the wrapper a <button> or <a> and ensure focus styles are visible."}},Un={info:{bg:"var(--lucent-info-subtle)",border:"var(--lucent-info-default)",iconColor:"var(--lucent-info-text)",textColor:"info"},success:{bg:"var(--lucent-success-subtle)",border:"var(--lucent-success-default)",iconColor:"var(--lucent-success-text)",textColor:"success"},warning:{bg:"var(--lucent-warning-subtle)",border:"var(--lucent-warning-default)",iconColor:"var(--lucent-warning-text)",textColor:"warning"},danger:{bg:"var(--lucent-danger-subtle)",border:"var(--lucent-danger-default)",iconColor:"var(--lucent-danger-text)",textColor:"danger"}},_n=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"8",cy:"8",r:"6.5",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M8 5.5V8.5M8 10.5V11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),Kn=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"8",cy:"8",r:"6.5",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M5 8L7 10L11 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),Yn=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[e.jsx("path",{d:"M8 2L14.5 13H1.5L8 2Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),e.jsx("path",{d:"M8 6V9M8 11V11.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),Xn=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"8",cy:"8",r:"6.5",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M5.5 5.5L10.5 10.5M10.5 5.5L5.5 10.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),Jn={info:e.jsx(_n,{}),success:e.jsx(Kn,{}),warning:e.jsx(Yn,{}),danger:e.jsx(Xn,{})},Zn=()=>e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M3 3L11 11M11 3L3 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})});function Qn({variant:t="info",title:n,children:a,onDismiss:o,icon:r,style:i}){const s=Un[t],c=r??Jn[t];return e.jsxs("div",{role:"alert",style:{display:"flex",alignItems:"flex-start",gap:"var(--lucent-space-3)",padding:"var(--lucent-space-3) var(--lucent-space-4)",background:s.bg,border:`1px solid ${s.border}`,borderRadius:"var(--lucent-radius-md)",boxSizing:"border-box",...i},children:[e.jsx("span",{style:{flexShrink:0,color:s.iconColor,display:"flex",alignItems:"center",paddingTop:2},children:c}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"var(--lucent-space-1)"},children:[n&&e.jsx(R,{as:"span",size:"sm",weight:"semibold",color:s.textColor,lineHeight:"tight",children:n}),a&&e.jsx(R,{as:"span",size:"sm",color:s.textColor,lineHeight:"base",children:a})]}),o&&e.jsx("button",{type:"button","aria-label":"Dismiss",onClick:o,style:{flexShrink:0,display:"flex",alignItems:"center",background:"none",border:"none",cursor:"pointer",padding:2,borderRadius:"var(--lucent-radius-sm)",color:s.iconColor,opacity:.7},onMouseEnter:l=>{l.currentTarget.style.opacity="1"},onMouseLeave:l=>{l.currentTarget.style.opacity="0.7"},children:e.jsx(Zn,{})})]})}const ea={id:"alert",name:"Alert",tier:"molecule",domain:"neutral",specVersion:"0.1",description:"An inline feedback banner with info, success, warning, and danger variants, optional title, and dismiss button.",designIntent:'Alert uses role="alert" so screen readers announce the message immediately when it appears. Each variant has a built-in icon that communicates intent visually; the icon can be overridden for custom scenarios. Title and body are both optional — you can show either, both, or just an icon with a body. The dismiss button is only rendered when onDismiss is provided, keeping the layout clean for non-dismissible alerts. All colors use status semantic tokens so they adapt correctly between light and dark themes.',props:[{name:"variant",type:"enum",required:!1,default:"info",description:"Visual and semantic variant of the alert.",enumValues:["info","success","warning","danger"]},{name:"title",type:"string",required:!1,description:"Bold title line rendered above the body."},{name:"children",type:"ReactNode",required:!1,description:"Alert body content — typically a short sentence or ReactNode."},{name:"onDismiss",type:"function",required:!1,description:"When provided, renders a dismiss (×) button and calls this handler on click."},{name:"icon",type:"ReactNode",required:!1,description:"Custom icon to replace the built-in variant icon."},{name:"style",type:"object",required:!1,description:"Inline style overrides for the alert wrapper."}],usageExamples:[{title:"Info with body",code:'<Alert variant="info">Your changes have been saved as a draft.</Alert>'},{title:"With title and dismiss",code:`<Alert variant="danger" title="Payment failed" onDismiss={() => setVisible(false)}>
215
245
  Check your card details and try again.
216
246
  </Alert>`},{title:"Success confirmation",code:`<Alert variant="success" title="Order placed!">
217
247
  You'll receive a confirmation email shortly.
218
- </Alert>`}],compositionGraph:[{componentId:"text",componentName:"Text",role:"Title and body content",required:!1}],accessibility:{role:"alert",ariaAttributes:["aria-label"],notes:'role="alert" causes screen readers to announce the content immediately when rendered. For non-urgent status messages, consider using role="status" instead by overriding via style/wrapper.'}};function fn({illustration:t,title:n,description:a,action:o,style:r}){return e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"var(--lucent-space-4)",padding:"var(--lucent-space-8)",textAlign:"center",...r},children:[t!=null&&e.jsx("div",{style:{width:64,height:64,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--lucent-text-secondary)"},children:t}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--lucent-space-2)"},children:[e.jsx(z,{as:"h3",size:"lg",weight:"semibold",align:"center",lineHeight:"tight",children:n}),a&&e.jsx(z,{size:"sm",color:"secondary",align:"center",lineHeight:"relaxed",children:a})]}),o!=null&&e.jsx("div",{children:o})]})}const hn={id:"empty-state",name:"EmptyState",tier:"molecule",domain:"neutral",specVersion:"0.1",description:"A centered placeholder shown when a list or page has no content, with an optional illustration, title, description, and CTA.",designIntent:"EmptyState communicates the absence of data in a constructive way. The illustration slot accepts any ReactNode — an Icon atom, a custom SVG, or an image — and constrains it to a 64px square to maintain visual consistency. Title is required to ensure the state is always named; description is optional for additional context. The action slot accepts any ReactNode (typically a Button) so the consumer controls variant and label without prescribing them. The entire layout is center-aligned and padded to sit naturally inside a Card or page section.",props:[{name:"title",type:"string",required:!0,description:'Short headline naming the empty state (e.g. "No results found").'},{name:"illustration",type:"ReactNode",required:!1,description:"Icon, SVG, or image rendered above the title. Constrained to a 64px container."},{name:"description",type:"string",required:!1,description:"Secondary text below the title providing context or next steps."},{name:"action",type:"ReactNode",required:!1,description:"Call-to-action rendered below the description — typically a Button."},{name:"style",type:"object",required:!1,description:"Inline style overrides for the outer wrapper."}],usageExamples:[{title:"No search results",code:`<EmptyState
248
+ </Alert>`}],compositionGraph:[{componentId:"text",componentName:"Text",role:"Title and body content",required:!1}],accessibility:{role:"alert",ariaAttributes:["aria-label"],notes:'role="alert" causes screen readers to announce the content immediately when rendered. For non-urgent status messages, consider using role="status" instead by overriding via style/wrapper.'}};function ta({illustration:t,title:n,description:a,action:o,style:r}){return e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"var(--lucent-space-4)",padding:"var(--lucent-space-8)",textAlign:"center",...r},children:[t!=null&&e.jsx("div",{style:{width:64,height:64,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--lucent-text-secondary)"},children:t}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--lucent-space-2)"},children:[e.jsx(R,{as:"h3",size:"lg",weight:"semibold",align:"center",lineHeight:"tight",children:n}),a&&e.jsx(R,{size:"sm",color:"secondary",align:"center",lineHeight:"relaxed",children:a})]}),o!=null&&e.jsx("div",{children:o})]})}const na={id:"empty-state",name:"EmptyState",tier:"molecule",domain:"neutral",specVersion:"0.1",description:"A centered placeholder shown when a list or page has no content, with an optional illustration, title, description, and CTA.",designIntent:"EmptyState communicates the absence of data in a constructive way. The illustration slot accepts any ReactNode — an Icon atom, a custom SVG, or an image — and constrains it to a 64px square to maintain visual consistency. Title is required to ensure the state is always named; description is optional for additional context. The action slot accepts any ReactNode (typically a Button) so the consumer controls variant and label without prescribing them. The entire layout is center-aligned and padded to sit naturally inside a Card or page section.",props:[{name:"title",type:"string",required:!0,description:'Short headline naming the empty state (e.g. "No results found").'},{name:"illustration",type:"ReactNode",required:!1,description:"Icon, SVG, or image rendered above the title. Constrained to a 64px container."},{name:"description",type:"string",required:!1,description:"Secondary text below the title providing context or next steps."},{name:"action",type:"ReactNode",required:!1,description:"Call-to-action rendered below the description — typically a Button."},{name:"style",type:"object",required:!1,description:"Inline style overrides for the outer wrapper."}],usageExamples:[{title:"No search results",code:`<EmptyState
219
249
  illustration={<Icon size="xl"><SearchIcon /></Icon>}
220
250
  title="No results found"
221
251
  description="Try adjusting your search or filter to find what you're looking for."
@@ -226,23 +256,23 @@ Token rule: Card uses surface for its background. Never use bgBase or bgSubtle o
226
256
  action={<Button variant="primary">New project</Button>}
227
257
  />`},{title:"Inside a Card",code:`<Card>
228
258
  <EmptyState title="Nothing here" description="Add items to see them listed." />
229
- </Card>`}],compositionGraph:[{componentId:"text",componentName:"Text",role:"Title and description",required:!0}],accessibility:{notes:"The title renders as an h3 by default. If EmptyState appears inside a section with its own heading hierarchy, override by passing a Text component as part of a custom layout. Ensure the action element has a descriptive label for screen readers."}},mn={text:"1em",circle:40,rectangle:40},gn={text:"var(--lucent-radius-sm)",circle:"var(--lucent-radius-full)",rectangle:"var(--lucent-radius-md)"};function de({width:t,height:n,radius:a,animate:o,style:r}){return e.jsx("span",{style:{display:"block",width:typeof t=="number"?`${t}px`:t,height:typeof n=="number"?`${n}px`:n,borderRadius:a,background:o?"linear-gradient(90deg, var(--lucent-surface-secondary) 25%, var(--lucent-surface) 50%, var(--lucent-surface-secondary) 75%)":"var(--lucent-surface-secondary)",backgroundSize:o?"200% 100%":void 0,animation:o?"lucent-skeleton-shimmer 1.6s ease-in-out infinite":void 0,flexShrink:0,...r}})}function bn({variant:t="rectangle",width:n="100%",height:a,lines:o=1,animate:r=!0,radius:i,style:s}){const l=a??mn[t],c=i??gn[t],h=r?e.jsx("style",{children:`
259
+ </Card>`}],compositionGraph:[{componentId:"text",componentName:"Text",role:"Title and description",required:!0}],accessibility:{notes:"The title renders as an h3 by default. If EmptyState appears inside a section with its own heading hierarchy, override by passing a Text component as part of a custom layout. Ensure the action element has a descriptive label for screen readers."}},aa={text:"1em",circle:40,rectangle:40},ra={text:"var(--lucent-radius-sm)",circle:"var(--lucent-radius-full)",rectangle:"var(--lucent-radius-md)"};function Le({width:t,height:n,radius:a,animate:o,style:r}){return e.jsx("span",{style:{display:"block",width:typeof t=="number"?`${t}px`:t,height:typeof n=="number"?`${n}px`:n,borderRadius:a,background:o?"linear-gradient(90deg, var(--lucent-surface-secondary) 25%, var(--lucent-surface) 50%, var(--lucent-surface-secondary) 75%)":"var(--lucent-surface-secondary)",backgroundSize:o?"200% 100%":void 0,animation:o?"lucent-skeleton-shimmer 1.6s ease-in-out infinite":void 0,flexShrink:0,...r}})}function oa({variant:t="rectangle",width:n="100%",height:a,lines:o=1,animate:r=!0,radius:i,style:s}){const c=a??aa[t],l=i??ra[t],u=r?e.jsx("style",{children:`
230
260
  @keyframes lucent-skeleton-shimmer {
231
261
  0% { background-position: 200% 0; }
232
262
  100% { background-position: -200% 0; }
233
263
  }
234
- `}):null;return t==="text"&&o>1?e.jsxs(e.Fragment,{children:[h,e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--lucent-space-2)",...s},children:Array.from({length:o}).map((g,u)=>e.jsx(de,{width:u===o-1?"70%":n,height:l,radius:c,animate:r},u))})]}):e.jsxs(e.Fragment,{children:[h,e.jsx(de,{width:t==="circle"?a??40:n,height:l,radius:c,animate:r,...s!==void 0&&{style:s}})]})}const vn={id:"skeleton",name:"Skeleton",tier:"molecule",domain:"neutral",specVersion:"0.1",description:"Animated placeholder that matches the shape of content while it loads.",designIntent:"Skeleton uses a shimmer animation to communicate that content is loading without showing a spinner. The three variants (text, circle, rectangle) cover the most common content shapes: inline text, avatars/thumbnails, and generic content blocks. The text variant with lines > 1 mimics a paragraph by stacking multiple text skeletons and shortening the last line to 70%, which is a widely recognised convention for body copy placeholders. The shimmer gradient uses bg-muted and bg-subtle so it adapts correctly in both light and dark themes without hard-coded colors.",props:[{name:"variant",type:"enum",required:!1,default:"rectangle",description:"Shape of the skeleton — text (1em tall), circle (equal width/height), or rectangle.",enumValues:["text","circle","rectangle"]},{name:"width",type:"string",required:!1,default:'"100%"',description:"Width of the skeleton. Accepts any CSS value or a number (interpreted as px)."},{name:"height",type:"string",required:!1,description:"Height of the skeleton. Defaults: text=1em, circle=40px, rectangle=40px."},{name:"lines",type:"number",required:!1,default:"1",description:"Number of stacked text lines to render. Only applies to the text variant."},{name:"animate",type:"boolean",required:!1,default:"true",description:"Enables the shimmer animation. Set to false to render a static placeholder."},{name:"radius",type:"string",required:!1,description:"Override the default border-radius for the variant."},{name:"style",type:"object",required:!1,description:"Inline style overrides."}],usageExamples:[{title:"Paragraph placeholder",code:'<Skeleton variant="text" lines={3} />'},{title:"Avatar placeholder",code:'<Skeleton variant="circle" width={40} height={40} />'},{title:"Card placeholder",code:`<Card>
264
+ `}):null;return t==="text"&&o>1?e.jsxs(e.Fragment,{children:[u,e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--lucent-space-2)",...s},children:Array.from({length:o}).map((m,d)=>e.jsx(Le,{width:d===o-1?"70%":n,height:c,radius:l,animate:r},d))})]}):e.jsxs(e.Fragment,{children:[u,e.jsx(Le,{width:t==="circle"?a??40:n,height:c,radius:l,animate:r,...s!==void 0&&{style:s}})]})}const ia={id:"skeleton",name:"Skeleton",tier:"molecule",domain:"neutral",specVersion:"0.1",description:"Animated placeholder that matches the shape of content while it loads.",designIntent:"Skeleton uses a shimmer animation to communicate that content is loading without showing a spinner. The three variants (text, circle, rectangle) cover the most common content shapes: inline text, avatars/thumbnails, and generic content blocks. The text variant with lines > 1 mimics a paragraph by stacking multiple text skeletons and shortening the last line to 70%, which is a widely recognised convention for body copy placeholders. The shimmer gradient uses bg-muted and bg-subtle so it adapts correctly in both light and dark themes without hard-coded colors.",props:[{name:"variant",type:"enum",required:!1,default:"rectangle",description:"Shape of the skeleton — text (1em tall), circle (equal width/height), or rectangle.",enumValues:["text","circle","rectangle"]},{name:"width",type:"string",required:!1,default:'"100%"',description:"Width of the skeleton. Accepts any CSS value or a number (interpreted as px)."},{name:"height",type:"string",required:!1,description:"Height of the skeleton. Defaults: text=1em, circle=40px, rectangle=40px."},{name:"lines",type:"number",required:!1,default:"1",description:"Number of stacked text lines to render. Only applies to the text variant."},{name:"animate",type:"boolean",required:!1,default:"true",description:"Enables the shimmer animation. Set to false to render a static placeholder."},{name:"radius",type:"string",required:!1,description:"Override the default border-radius for the variant."},{name:"style",type:"object",required:!1,description:"Inline style overrides."}],usageExamples:[{title:"Paragraph placeholder",code:'<Skeleton variant="text" lines={3} />'},{title:"Avatar placeholder",code:'<Skeleton variant="circle" width={40} height={40} />'},{title:"Card placeholder",code:`<Card>
235
265
  <div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
236
266
  <Skeleton variant="rectangle" height={160} />
237
267
  <Skeleton variant="text" lines={2} />
238
268
  <Skeleton variant="text" width="40%" />
239
269
  </div>
240
- </Card>`},{title:"Static (no animation)",code:'<Skeleton variant="rectangle" width={200} height={32} animate={false} />'}],compositionGraph:[],accessibility:{ariaAttributes:["aria-busy","aria-label"],notes:'Wrap loading regions with aria-busy="true" on the container so screen readers know content is loading. Individual Skeleton elements are presentational and do not need ARIA attributes themselves.'}};function yn({items:t,separator:n="/",style:a}){return e.jsx("nav",{"aria-label":"Breadcrumb",style:a,children:e.jsx("ol",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"var(--lucent-space-1)",listStyle:"none",margin:0,padding:0,fontFamily:"var(--lucent-font-family-base)"},children:t.map((o,r)=>{const i=r===t.length-1;return e.jsxs("li",{style:{display:"flex",alignItems:"center",gap:"var(--lucent-space-1)"},children:[i?e.jsx(z,{size:"sm",color:"primary",as:"span","aria-current":"page",children:o.label}):o.href!=null?e.jsx("a",{href:o.href,onClick:o.onClick,style:{fontSize:"var(--lucent-font-size-sm)",color:"var(--lucent-text-secondary)",textDecoration:"none",fontFamily:"var(--lucent-font-family-base)",transition:"color var(--lucent-duration-fast) var(--lucent-easing-default)"},onMouseEnter:s=>{s.currentTarget.style.color="var(--lucent-text-primary)"},onMouseLeave:s=>{s.currentTarget.style.color="var(--lucent-text-secondary)"},children:o.label}):e.jsx("button",{onClick:o.onClick,style:{fontSize:"var(--lucent-font-size-sm)",color:"var(--lucent-text-secondary)",fontFamily:"var(--lucent-font-family-base)",background:"none",border:"none",padding:0,cursor:"pointer",transition:"color var(--lucent-duration-fast) var(--lucent-easing-default)"},onMouseEnter:s=>{s.currentTarget.style.color="var(--lucent-text-primary)"},onMouseLeave:s=>{s.currentTarget.style.color="var(--lucent-text-secondary)"},children:o.label}),!i&&e.jsx("span",{"aria-hidden":!0,style:{color:"var(--lucent-text-disabled)",fontSize:"var(--lucent-font-size-sm)",userSelect:"none"},children:n})]},r)})})})}function xn({tabs:t,defaultValue:n,value:a,onChange:o,style:r}){var f;const i=a!==void 0,[s,l]=m.useState(n??((f=t[0])==null?void 0:f.value)??""),c=i?a:s,[h,g]=m.useState(null),u=m.useRef([]),[p,d]=m.useState(null),x=m.useRef(!1);m.useLayoutEffect(()=>{const v=t.findIndex(w=>w.value===c),I=u.current[v];I&&(d({left:I.offsetLeft,width:I.offsetWidth,animate:x.current}),x.current=!0)},[c,t]);const y=v=>{i||l(v),o==null||o(v)},b=(v,I)=>{var q;const w=t.map((T,j)=>T.disabled?-1:j).filter(T=>T!==-1),S=w.indexOf(I);let D=-1;v.key==="ArrowRight"&&(D=w[(S+1)%w.length]??-1),v.key==="ArrowLeft"&&(D=w[(S-1+w.length)%w.length]??-1),v.key==="Home"&&(D=w[0]??-1),v.key==="End"&&(D=w[w.length-1]??-1),D!==-1&&(v.preventDefault(),(q=u.current[D])==null||q.focus(),y(t[D].value))};return e.jsxs("div",{style:{display:"flex",flexDirection:"column",...r},children:[e.jsxs("div",{role:"tablist",style:{position:"relative",display:"flex",borderBottom:"1px solid var(--lucent-border-default)"},children:[t.map((v,I)=>{const w=v.value===c,S=v.disabled??!1;return e.jsx("button",{ref:D=>{u.current[I]=D},role:"tab","aria-selected":w,"aria-controls":`lucent-tabpanel-${v.value}`,id:`lucent-tab-${v.value}`,disabled:S,tabIndex:w?0:-1,onClick:()=>{S||y(v.value)},onKeyDown:D=>b(D,I),onMouseEnter:()=>{S||g(I)},onMouseLeave:()=>g(null),style:{padding:"var(--lucent-space-1) var(--lucent-space-2) var(--lucent-space-3)",background:"none",border:"none",cursor:S?"not-allowed":"pointer",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-md)",fontWeight:w?"var(--lucent-font-weight-medium)":"var(--lucent-font-weight-regular)",color:S?"var(--lucent-text-disabled)":w?"var(--lucent-text-primary)":"var(--lucent-text-secondary)",transition:"color var(--lucent-duration-fast) var(--lucent-easing-default)",whiteSpace:"nowrap",outline:"none"},children:e.jsx("span",{style:{display:"block",padding:"var(--lucent-space-1) var(--lucent-space-3)",borderRadius:"var(--lucent-radius-md)",background:h===I&&!w?"var(--lucent-surface-secondary)":"transparent",transition:"background var(--lucent-duration-fast) var(--lucent-easing-default)"},children:v.label})},v.value)}),p!=null&&e.jsx("span",{"aria-hidden":!0,style:{position:"absolute",bottom:0,left:p.left,width:p.width,height:2,background:"var(--lucent-accent-default)",borderRadius:"var(--lucent-radius-sm)",transition:p.animate?"left 220ms var(--lucent-easing-default), width 220ms var(--lucent-easing-default)":"none"}})]}),t.map(v=>e.jsx("div",{role:"tabpanel",id:`lucent-tabpanel-${v.value}`,"aria-labelledby":`lucent-tab-${v.value}`,hidden:v.value!==c,style:{padding:"var(--lucent-space-4) 0",outline:"none"},tabIndex:0,children:v.content},v.value))]})}const wn=`
270
+ </Card>`},{title:"Static (no animation)",code:'<Skeleton variant="rectangle" width={200} height={32} animate={false} />'}],compositionGraph:[],accessibility:{ariaAttributes:["aria-busy","aria-label"],notes:'Wrap loading regions with aria-busy="true" on the container so screen readers know content is loading. Individual Skeleton elements are presentational and do not need ARIA attributes themselves.'}};function sa({items:t,separator:n="/",style:a}){return e.jsx("nav",{"aria-label":"Breadcrumb",style:a,children:e.jsx("ol",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"var(--lucent-space-1)",listStyle:"none",margin:0,padding:0,fontFamily:"var(--lucent-font-family-base)"},children:t.map((o,r)=>{const i=r===t.length-1;return e.jsxs("li",{style:{display:"flex",alignItems:"center",gap:"var(--lucent-space-1)"},children:[i?e.jsx(R,{size:"sm",color:"primary",as:"span","aria-current":"page",children:o.label}):o.href!=null?e.jsx("a",{href:o.href,onClick:o.onClick,style:{fontSize:"var(--lucent-font-size-sm)",color:"var(--lucent-text-secondary)",textDecoration:"none",fontFamily:"var(--lucent-font-family-base)",transition:"color var(--lucent-duration-fast) var(--lucent-easing-default)"},onMouseEnter:s=>{s.currentTarget.style.color="var(--lucent-text-primary)"},onMouseLeave:s=>{s.currentTarget.style.color="var(--lucent-text-secondary)"},children:o.label}):e.jsx("button",{onClick:o.onClick,style:{fontSize:"var(--lucent-font-size-sm)",color:"var(--lucent-text-secondary)",fontFamily:"var(--lucent-font-family-base)",background:"none",border:"none",padding:0,cursor:"pointer",transition:"color var(--lucent-duration-fast) var(--lucent-easing-default)"},onMouseEnter:s=>{s.currentTarget.style.color="var(--lucent-text-primary)"},onMouseLeave:s=>{s.currentTarget.style.color="var(--lucent-text-secondary)"},children:o.label}),!i&&e.jsx("span",{"aria-hidden":!0,style:{color:"var(--lucent-text-disabled)",fontSize:"var(--lucent-font-size-sm)",userSelect:"none"},children:n})]},r)})})})}function la({tabs:t,defaultValue:n,value:a,onChange:o,style:r}){var h;const i=a!==void 0,[s,c]=f.useState(n??((h=t[0])==null?void 0:h.value)??""),l=i?a:s,[u,m]=f.useState(null),d=f.useRef([]),[g,p]=f.useState(null),x=f.useRef(!1);f.useLayoutEffect(()=>{const v=t.findIndex(S=>S.value===l),j=d.current[v];j&&(p({left:j.offsetLeft,width:j.offsetWidth,animate:x.current}),x.current=!0)},[l,t]);const b=v=>{i||c(v),o==null||o(v)},y=(v,j)=>{var q;const S=t.map((w,C)=>w.disabled?-1:C).filter(w=>w!==-1),T=S.indexOf(j);let z=-1;v.key==="ArrowRight"&&(z=S[(T+1)%S.length]??-1),v.key==="ArrowLeft"&&(z=S[(T-1+S.length)%S.length]??-1),v.key==="Home"&&(z=S[0]??-1),v.key==="End"&&(z=S[S.length-1]??-1),z!==-1&&(v.preventDefault(),(q=d.current[z])==null||q.focus(),b(t[z].value))};return e.jsxs("div",{style:{display:"flex",flexDirection:"column",...r},children:[e.jsxs("div",{role:"tablist",style:{position:"relative",display:"flex",borderBottom:"1px solid var(--lucent-border-default)"},children:[t.map((v,j)=>{const S=v.value===l,T=v.disabled??!1;return e.jsx("button",{ref:z=>{d.current[j]=z},role:"tab","aria-selected":S,"aria-controls":`lucent-tabpanel-${v.value}`,id:`lucent-tab-${v.value}`,disabled:T,tabIndex:S?0:-1,onClick:()=>{T||b(v.value)},onKeyDown:z=>y(z,j),onMouseEnter:()=>{T||m(j)},onMouseLeave:()=>m(null),style:{padding:"var(--lucent-space-1) var(--lucent-space-2) var(--lucent-space-3)",background:"none",border:"none",cursor:T?"not-allowed":"pointer",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-md)",fontWeight:S?"var(--lucent-font-weight-medium)":"var(--lucent-font-weight-regular)",color:T?"var(--lucent-text-disabled)":S?"var(--lucent-text-primary)":"var(--lucent-text-secondary)",transition:"color var(--lucent-duration-fast) var(--lucent-easing-default)",whiteSpace:"nowrap",outline:"none"},children:e.jsx("span",{style:{display:"block",padding:"var(--lucent-space-1) var(--lucent-space-3)",borderRadius:"var(--lucent-radius-md)",background:u===j&&!S?"var(--lucent-surface-secondary)":"transparent",transition:"background var(--lucent-duration-fast) var(--lucent-easing-default)"},children:v.label})},v.value)}),g!=null&&e.jsx("span",{"aria-hidden":!0,style:{position:"absolute",bottom:0,left:g.left,width:g.width,height:2,background:"var(--lucent-accent-default)",borderRadius:"var(--lucent-radius-sm)",transition:g.animate?"left 220ms var(--lucent-easing-default), width 220ms var(--lucent-easing-default)":"none"}})]}),t.map(v=>e.jsx("div",{role:"tabpanel",id:`lucent-tabpanel-${v.value}`,"aria-labelledby":`lucent-tab-${v.value}`,hidden:v.value!==l,style:{padding:"var(--lucent-space-4) 0",outline:"none"},tabIndex:0,children:v.content},v.value))]})}const ca=`
241
271
  @keyframes lucent-collapsible-open {
242
272
  from { opacity: 0; transform: translateY(-4px); }
243
273
  to { opacity: 1; transform: translateY(0); }
244
274
  }
245
- `;function kn({trigger:t,children:n,defaultOpen:a=!1,open:o,onOpenChange:r,style:i}){const s=o!==void 0,[l,c]=m.useState(a),h=s?o:l,g=m.useRef(null),[u,p]=m.useState(h?void 0:0),d=m.useRef(!1);m.useEffect(()=>{const y=g.current;if(y)if(h){const b=y.scrollHeight;p(b),d.current=!0;const f=setTimeout(()=>{p(void 0),d.current=!1},220);return()=>clearTimeout(f)}else p(y.scrollHeight),y.getBoundingClientRect(),p(0)},[h]);const x=()=>{const y=!h;s||c(y),r==null||r(y)};return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:wn}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-md)",...i},children:[e.jsxs("button",{onClick:x,"aria-expanded":h,style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",background:"none",border:"none",padding:"var(--lucent-space-3) var(--lucent-space-4)",cursor:"pointer",textAlign:"left",outline:"none",fontFamily:"inherit",fontSize:"inherit"},children:[e.jsx("span",{style:{flex:1},children:t}),e.jsx(Sn,{open:h})]}),e.jsx("div",{ref:g,"aria-hidden":!h,style:{overflow:"hidden",height:u!==void 0?u:"auto",transition:"height 200ms var(--lucent-easing-default)"},children:e.jsx("div",{style:{padding:"var(--lucent-space-2) var(--lucent-space-4) var(--lucent-space-3)",animation:h?"lucent-collapsible-open 200ms var(--lucent-easing-default) forwards":void 0},children:n})})]})]})}function Sn({open:t}){return e.jsx("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,style:{flexShrink:0,color:"var(--lucent-text-secondary)",transform:t?"rotate(180deg)":"rotate(0deg)",transition:"transform 200ms var(--lucent-easing-default)"},children:e.jsx("polyline",{points:"6 9 12 15 18 9"})})}function _(t){return typeof t=="number"?`${t}px`:t}function Tn({children:t,header:n,sidebar:a,sidebarWidth:o=240,headerHeight:r=48,sidebarCollapsed:i=!1,rightSidebar:s,rightSidebarWidth:l=240,rightSidebarCollapsed:c=!1,footer:h,footerHeight:g=28,mainStyle:u,style:p}){const d=_(r),x=_(o),y=_(l),b=_(g);return e.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100vh",overflow:"hidden",fontFamily:"var(--lucent-font-family-base)",...p},children:[n!=null&&e.jsx("div",{style:{flexShrink:0,height:d,zIndex:10,background:"var(--lucent-surface)"},children:n}),e.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[a!=null&&e.jsx("div",{style:{width:i?0:x,flexShrink:0,overflow:"hidden",overflowY:i?"hidden":"auto",background:"var(--lucent-surface)",transition:"width 200ms var(--lucent-easing-default)"},children:a}),e.jsx("main",{style:{flex:1,overflowY:"auto",minWidth:0,margin:s!=null?"0 0 var(--lucent-space-3) 0":"0 var(--lucent-space-3) var(--lucent-space-3) 0",border:"1px solid var(--lucent-border-default)",borderRadius:"var(--lucent-radius-lg)",boxShadow:"var(--lucent-shadow-sm)",background:"var(--lucent-surface)",...u},children:t}),s!=null&&e.jsx("aside",{style:{width:c?0:y,flexShrink:0,overflow:"hidden",overflowY:c?"hidden":"auto",background:"var(--lucent-surface)",transition:"width 200ms var(--lucent-easing-default)"},children:s})]}),h!=null&&e.jsx("div",{style:{flexShrink:0,height:b,zIndex:10,background:"var(--lucent-surface)"},children:h})]})}function jn({state:t}){return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":!0,style:{flexShrink:0,opacity:t==="none"?.35:1},children:[e.jsx("path",{d:"M6 2L9 5H3L6 2Z",fill:"currentColor",opacity:t==="desc"?.35:1}),e.jsx("path",{d:"M6 10L3 7H9L6 10Z",fill:"currentColor",opacity:t==="asc"?.35:1})]})}function ue({dir:t}){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:e.jsx("path",{d:t==="left"?"M10 12L6 8l4-4":"M6 4l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Cn({columns:t,rows:n,pageSize:a=10,page:o,onPageChange:r,onFilterChange:i,emptyState:s,style:l}){const[c,h]=m.useState(null),[g,u]=m.useState(0),[p,d]=m.useState(null),[x,y]=m.useState({}),b=o!==void 0,f=b?o:g,v=t.some(M=>M.filterable),I=v?n.filter(M=>t.every(k=>{if(!k.filterable)return!0;const C=x[k.key];if(!C||C.length===0)return!0;const R=String(M[k.key]??"");return C.includes(R)})):n,w=c?[...I].sort((M,k)=>{const C=M[c.key],R=k[c.key],N=String(C??"").localeCompare(String(R??""),void 0,{numeric:!0});return c.dir==="asc"?N:-N}):I,S=a>0?w.slice(f*a,(f+1)*a):w,D=a>0?Math.max(1,Math.ceil(w.length/a)):1,q=M=>{b||u(M),r==null||r(M)},T=M=>{h(k=>!k||k.key!==M?{key:M,dir:"asc"}:k.dir==="asc"?{key:M,dir:"desc"}:null),b||u(0),r==null||r(0)},j=(M,k)=>{const C={...x,[M]:k};k.length===0&&delete C[M],y(C),b||u(0),r==null||r(0),i==null||i(C)},F=()=>{y({}),b||u(0),r==null||r(0),i==null||i({})},E=[];if(D<=7)for(let M=0;M<D;M++)E.push(M);else{E.push(0),f>2&&E.push("…");for(let M=Math.max(1,f-1);M<=Math.min(D-2,f+1);M++)E.push(M);f<D-3&&E.push("…"),E.push(D-1)}return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--lucent-space-3)",...l},children:[v&&e.jsx("div",{style:{position:"relative",zIndex:1},children:e.jsx(In,{columns:t,rows:n,filters:x,onFilter:j,onClearAll:F})}),e.jsx("div",{style:{overflowX:"auto",borderRadius:"var(--lucent-radius-lg)",border:"1px solid var(--lucent-border-default)"},children:e.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-sm)"},children:[e.jsx("thead",{children:e.jsx("tr",{style:{borderBottom:"1px solid var(--lucent-border-default)"},children:t.map(M=>{const k=(c==null?void 0:c.key)===M.key?c.dir:"none";return e.jsx("th",{onClick:M.sortable?()=>T(M.key):void 0,style:{padding:"var(--lucent-space-3) var(--lucent-space-4)",textAlign:M.align??"left",fontWeight:"var(--lucent-font-weight-medium)",color:"var(--lucent-text-secondary)",background:"var(--lucent-surface-secondary)",borderBottom:"1px solid var(--lucent-border-default)",cursor:M.sortable?"pointer":"default",userSelect:"none",whiteSpace:"nowrap",...M.width?{width:M.width}:{}},children:e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"var(--lucent-space-1)"},children:[M.header,M.sortable&&e.jsx(jn,{state:k})]})},M.key)})})}),e.jsx("tbody",{children:S.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:t.length,style:{padding:"var(--lucent-space-12)",textAlign:"center"},children:s??e.jsx(z,{color:"secondary",children:"No data"})})}):S.map((M,k)=>e.jsx("tr",{onMouseEnter:()=>d(k),onMouseLeave:()=>d(null),style:{borderBottom:k<S.length-1?"1px solid var(--lucent-border-subtle)":"none",background:p===k?"var(--lucent-surface-secondary)":"var(--lucent-surface)",transition:"background var(--lucent-duration-fast) var(--lucent-easing-default)"},children:t.map(C=>e.jsx("td",{style:{padding:"var(--lucent-space-3) var(--lucent-space-4)",color:"var(--lucent-text-primary)",textAlign:C.align??"left",verticalAlign:"middle"},children:C.render?C.render(M,k):String(M[C.key]??"")},C.key))},k))})]})}),a>0&&w.length>0&&e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"var(--lucent-space-3)",flexWrap:"wrap"},children:[e.jsx(z,{color:"secondary",size:"sm",children:w.length===0?`0 rows${n.length>0?` (filtered from ${n.length})`:""}`:w.length===1?`1 row${w.length<n.length?` (filtered from ${n.length})`:""}`:`${f*a+1}–${Math.min((f+1)*a,w.length)} of ${w.length} rows${w.length<n.length?` (filtered from ${n.length})`:""}`}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--lucent-space-1)"},children:[e.jsx(Q,{onClick:()=>q(f-1),disabled:f===0,"aria-label":"Previous page",children:e.jsx(ue,{dir:"left"})}),E.map((M,k)=>M==="…"?e.jsx("span",{style:{padding:"0 var(--lucent-space-1)",color:"var(--lucent-text-disabled)",fontSize:"var(--lucent-font-size-sm)"},children:"…"},`ellipsis-${k}`):e.jsx(Q,{onClick:()=>q(M),active:M===f,"aria-label":`Page ${M+1}`,"aria-current":M===f?"page":void 0,children:M+1},M)),e.jsx(Q,{onClick:()=>q(f+1),disabled:f>=D-1,"aria-label":"Next page",children:e.jsx(ue,{dir:"right"})})]})]})]})}function In({columns:t,rows:n,filters:a,onFilter:o,onClearAll:r}){const i=t.filter(l=>l.filterable),s=Object.keys(a).length;return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--lucent-space-2)",flexWrap:"wrap"},children:[i.map(l=>{const c=Array.from(new Set(n.map(h=>String(h[l.key]??"")))).sort();return e.jsx(Mn,{label:l.header,values:c,value:a[l.key]??[],onChange:h=>o(l.key,h)},l.key)}),s>0&&e.jsx("button",{onClick:r,style:{display:"inline-flex",alignItems:"center",height:30,padding:"0 var(--lucent-space-2)",border:"none",borderRadius:"var(--lucent-radius-md)",background:"transparent",color:"var(--lucent-text-secondary)",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-xs)",cursor:"pointer"},children:"Clear all"})]})}function Mn({label:t,values:n,value:a,onChange:o}){const[r,i]=m.useState(!1),[s,l]=m.useState(!1),[c,h]=m.useState(""),g=m.useRef(null),u=m.useRef(null),p=a.length>0;m.useEffect(()=>{if(!r){h("");return}setTimeout(()=>{var v;return(v=u.current)==null?void 0:v.focus()},0);const b=v=>{g.current&&!g.current.contains(v.target)&&i(!1)},f=v=>{v.key==="Escape"&&i(!1)};return document.addEventListener("mousedown",b),document.addEventListener("keydown",f),()=>{document.removeEventListener("mousedown",b),document.removeEventListener("keydown",f)}},[r]);const d=c?n.filter(b=>b.toLowerCase().includes(c.toLowerCase())):n,x=b=>o(a.includes(b)?a.filter(f=>f!==b):[...a,b]),y=a.length===0?null:a.length===1?e.jsxs("span",{style:{color:"var(--lucent-text-secondary)",fontWeight:"var(--lucent-font-weight-regular)"},children:[": ",a[0]]}):e.jsxs("span",{style:{color:"var(--lucent-accent-default)"},children:["(",a.length,")"]});return e.jsxs("div",{ref:g,style:{position:"relative"},children:[e.jsxs("button",{onClick:()=>i(b=>!b),onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),style:{display:"inline-flex",alignItems:"center",gap:"var(--lucent-space-1)",height:30,padding:"0 var(--lucent-space-3)",borderRadius:"var(--lucent-radius-md)",border:`1px solid ${p?"var(--lucent-accent-default)":s?"var(--lucent-border-strong)":"var(--lucent-border-default)"}`,background:p?"var(--lucent-accent-subtle)":"var(--lucent-surface)",color:p?"var(--lucent-accent-default)":"var(--lucent-text-primary)",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-xs)",fontWeight:p?"var(--lucent-font-weight-medium)":"var(--lucent-font-weight-regular)",cursor:"pointer",outline:"none",whiteSpace:"nowrap",transition:"border-color var(--lucent-duration-fast) var(--lucent-easing-default), background var(--lucent-duration-fast) var(--lucent-easing-default)"},children:[t,y,e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":!0,style:{transform:r?"rotate(180deg)":"none",transition:"transform var(--lucent-duration-fast) var(--lucent-easing-default)"},children:e.jsx("path",{d:"M2 3.5L5 6.5L8 3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),r&&e.jsxs("div",{style:{position:"absolute",top:"calc(100% + 4px)",left:0,minWidth:180,maxHeight:280,display:"flex",flexDirection:"column",background:"var(--lucent-surface)",border:"1px solid var(--lucent-border-default)",borderRadius:"var(--lucent-radius-lg)",boxShadow:"0 4px 16px color-mix(in srgb, var(--lucent-text-primary) 8%, transparent)",zIndex:50},children:[e.jsx("div",{style:{padding:"var(--lucent-space-2)",paddingBottom:0},children:e.jsx("input",{ref:u,type:"text",value:c,onChange:b=>h(b.target.value),placeholder:"Search…",style:{width:"100%",boxSizing:"border-box",height:26,padding:"0 var(--lucent-space-2)",borderRadius:"var(--lucent-radius-md)",border:"1px solid var(--lucent-border-default)",background:"var(--lucent-surface-secondary)",color:"var(--lucent-text-primary)",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-xs)",outline:"none"}})}),a.length>0&&e.jsx("div",{style:{padding:"var(--lucent-space-1) var(--lucent-space-2) 0"},children:e.jsx("button",{onClick:()=>o([]),style:{display:"inline-flex",padding:"2px var(--lucent-space-2)",border:"none",borderRadius:"var(--lucent-radius-sm)",background:"transparent",color:"var(--lucent-text-secondary)",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-xs)",cursor:"pointer",textDecoration:"underline"},children:"Clear selection"})}),e.jsx("div",{style:{overflowY:"auto",padding:"var(--lucent-space-1)",borderTop:"1px solid var(--lucent-border-subtle)",marginTop:"var(--lucent-space-2)"},children:d.length===0?e.jsx("div",{style:{padding:"var(--lucent-space-3)",color:"var(--lucent-text-disabled)",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-xs)",textAlign:"center"},children:"No results"}):d.map(b=>e.jsx(Dn,{label:b,isSelected:a.includes(b),onClick:()=>x(b)},b))})]})]})}function Dn({label:t,isSelected:n,onClick:a}){const[o,r]=m.useState(!1);return e.jsxs("button",{onClick:a,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),style:{display:"flex",alignItems:"center",gap:"var(--lucent-space-2)",width:"100%",textAlign:"left",padding:"var(--lucent-space-2) var(--lucent-space-3)",borderRadius:"var(--lucent-radius-md)",border:"none",background:o?"var(--lucent-surface-secondary)":"transparent",color:"var(--lucent-text-primary)",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-xs)",fontWeight:n?"var(--lucent-font-weight-medium)":"var(--lucent-font-weight-regular)",cursor:"pointer",outline:"none",whiteSpace:"nowrap"},children:[e.jsx("span",{style:{flexShrink:0,width:14,height:14,borderRadius:"var(--lucent-radius-sm)",border:`1.5px solid ${n?"var(--lucent-accent-default)":"var(--lucent-border-strong)"}`,background:n?"var(--lucent-accent-default)":"transparent",display:"flex",alignItems:"center",justifyContent:"center",transition:"border-color var(--lucent-duration-fast), background var(--lucent-duration-fast)"},children:n&&e.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",fill:"none","aria-hidden":!0,children:e.jsx("path",{d:"M1 4L3 6L7 2",stroke:"var(--lucent-text-on-accent)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),t]})}function Q({children:t,onClick:n,disabled:a,active:o,...r}){const[i,s]=m.useState(!1);return e.jsx("button",{...r,onClick:n,disabled:a,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:32,height:32,padding:"0 var(--lucent-space-2)",borderRadius:"var(--lucent-radius-md)",border:o?"1px solid var(--lucent-accent-default)":"1px solid transparent",background:o?"var(--lucent-accent-default)":i&&!a?"var(--lucent-surface-secondary)":"transparent",color:o?"var(--lucent-text-on-accent)":a?"var(--lucent-text-disabled)":"var(--lucent-text-primary)",fontSize:"var(--lucent-font-size-sm)",fontFamily:"var(--lucent-font-family-base)",fontWeight:"var(--lucent-font-weight-regular)",cursor:a?"not-allowed":"pointer",transition:"background var(--lucent-duration-fast) var(--lucent-easing-default)"},children:t})}const zn={id:"data-table",name:"DataTable",tier:"molecule",domain:"neutral",specVersion:"1.0",description:"A sortable, filterable, paginated data table with configurable columns, custom cell renderers, and keyboard-accessible pagination controls.",designIntent:'DataTable is generic over row type T so TypeScript consumers get full type safety on column keys and renderers. Sorting is client-side and composable — each column opts in via sortable:true; clicking a sorted column cycles asc → desc → unsorted. Filtering is per-column — each column opts in via filterable:true, which adds a dropdown button above the table. Each dropdown is searchable and multi-select: a search input filters the option list, and each option is a checkbox that toggles membership in the active set. Filtering uses set-membership: a row passes if its column value is included in the selected values array. A "Clear selection" link inside each dropdown clears that column; a "Clear all" button in the bar appears when any filter is active. Filter → sort → paginate is the fixed pipeline order; any filter change resets the page to 0. Pagination is either controlled (page prop + onPageChange) or uncontrolled (internal state). A pageSize of 0 disables pagination entirely, useful when the parent manages windowing. Row hover uses bg-subtle, not a border change, so the visual weight stays low for dense data views.',props:[{name:"columns",type:"array",required:!0,description:"Column definitions. Each column has a key, header, optional render function, optional sortable flag, optional filterable flag (renders a text filter input below the header), optional width, and optional text align."},{name:"rows",type:"array",required:!0,description:"Array of data objects to display. The generic type T is inferred from this prop."},{name:"pageSize",type:"number",required:!1,default:"10",description:"Number of rows per page. Set to 0 to disable pagination."},{name:"page",type:"number",required:!1,description:"Controlled current page (0-indexed). When provided, the component is fully controlled."},{name:"onPageChange",type:"function",required:!1,description:"Called with the new page index whenever the page changes (from pagination controls or after a sort/filter reset)."},{name:"onFilterChange",type:"function",required:!1,description:"Called with the current filter map (Record<string, string[]>) whenever any column filter changes. Keys are column keys; columns with no selection are omitted from the map."},{name:"emptyState",type:"ReactNode",required:!1,description:'Content to render when rows is empty. Defaults to a "No data" text.'},{name:"style",type:"object",required:!1,description:"Inline style overrides for the outer wrapper."}],usageExamples:[{title:"Basic sortable table",code:`<DataTable
275
+ `;function da({trigger:t,children:n,defaultOpen:a=!1,open:o,onOpenChange:r,style:i}){const s=o!==void 0,[c,l]=f.useState(a),u=s?o:c,m=f.useRef(null),[d,g]=f.useState(u?void 0:0),p=f.useRef(!1);f.useEffect(()=>{const b=m.current;if(b)if(u){const y=b.scrollHeight;g(y),p.current=!0;const h=setTimeout(()=>{g(void 0),p.current=!1},220);return()=>clearTimeout(h)}else g(b.scrollHeight),b.getBoundingClientRect(),g(0)},[u]);const x=()=>{const b=!u;s||l(b),r==null||r(b)};return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:ca}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-md)",...i},children:[e.jsxs("button",{onClick:x,"aria-expanded":u,style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",background:"none",border:"none",padding:"var(--lucent-space-3) var(--lucent-space-4)",cursor:"pointer",textAlign:"left",outline:"none",fontFamily:"inherit",fontSize:"inherit"},children:[e.jsx("span",{style:{flex:1},children:t}),e.jsx(ua,{open:u})]}),e.jsx("div",{ref:m,"aria-hidden":!u,style:{overflow:"hidden",height:d!==void 0?d:"auto",transition:"height 200ms var(--lucent-easing-default)"},children:e.jsx("div",{style:{padding:"var(--lucent-space-2) var(--lucent-space-4) var(--lucent-space-3)",animation:u?"lucent-collapsible-open 200ms var(--lucent-easing-default) forwards":void 0},children:n})})]})]})}function ua({open:t}){return e.jsx("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,style:{flexShrink:0,color:"var(--lucent-text-secondary)",transform:t?"rotate(180deg)":"rotate(0deg)",transition:"transform 200ms var(--lucent-easing-default)"},children:e.jsx("polyline",{points:"6 9 12 15 18 9"})})}function oe(t){return typeof t=="number"?`${t}px`:t}function pa({children:t,header:n,sidebar:a,sidebarWidth:o=240,headerHeight:r=48,sidebarCollapsed:i=!1,rightSidebar:s,rightSidebarWidth:c=240,rightSidebarCollapsed:l=!1,footer:u,footerHeight:m=28,mainStyle:d,style:g}){const p=oe(r),x=oe(o),b=oe(c),y=oe(m);return e.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100vh",overflow:"hidden",fontFamily:"var(--lucent-font-family-base)",...g},children:[n!=null&&e.jsx("div",{style:{flexShrink:0,height:p,zIndex:10,background:"var(--lucent-surface)"},children:n}),e.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[a!=null&&e.jsx("div",{style:{width:i?0:x,flexShrink:0,overflow:"hidden",overflowY:i?"hidden":"auto",background:"var(--lucent-surface)",transition:"width 200ms var(--lucent-easing-default)"},children:a}),e.jsx("main",{style:{flex:1,overflowY:"auto",minWidth:0,margin:s!=null?"0 0 var(--lucent-space-3) 0":"0 var(--lucent-space-3) var(--lucent-space-3) 0",border:"1px solid var(--lucent-border-default)",borderRadius:"var(--lucent-radius-lg)",boxShadow:"var(--lucent-shadow-sm)",background:"var(--lucent-surface)",...d},children:t}),s!=null&&e.jsx("aside",{style:{width:l?0:b,flexShrink:0,overflow:"hidden",overflowY:l?"hidden":"auto",background:"var(--lucent-surface)",transition:"width 200ms var(--lucent-easing-default)"},children:s})]}),u!=null&&e.jsx("div",{style:{flexShrink:0,height:y,zIndex:10,background:"var(--lucent-surface)"},children:u})]})}function fa({state:t}){return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":!0,style:{flexShrink:0,opacity:t==="none"?.35:1},children:[e.jsx("path",{d:"M6 2L9 5H3L6 2Z",fill:"currentColor",opacity:t==="desc"?.35:1}),e.jsx("path",{d:"M6 10L3 7H9L6 10Z",fill:"currentColor",opacity:t==="asc"?.35:1})]})}function Be({dir:t}){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:e.jsx("path",{d:t==="left"?"M10 12L6 8l4-4":"M6 4l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ha({columns:t,rows:n,pageSize:a=10,page:o,onPageChange:r,onFilterChange:i,emptyState:s,style:c}){const[l,u]=f.useState(null),[m,d]=f.useState(0),[g,p]=f.useState(null),[x,b]=f.useState({}),y=o!==void 0,h=y?o:m,v=t.some(M=>M.filterable),j=v?n.filter(M=>t.every(I=>{if(!I.filterable)return!0;const D=x[I.key];if(!D||D.length===0)return!0;const B=String(M[I.key]??"");return D.includes(B)})):n,S=l?[...j].sort((M,I)=>{const D=M[l.key],B=I[l.key],H=String(D??"").localeCompare(String(B??""),void 0,{numeric:!0});return l.dir==="asc"?H:-H}):j,T=a>0?S.slice(h*a,(h+1)*a):S,z=a>0?Math.max(1,Math.ceil(S.length/a)):1,q=M=>{y||d(M),r==null||r(M)},w=M=>{u(I=>!I||I.key!==M?{key:M,dir:"asc"}:I.dir==="asc"?{key:M,dir:"desc"}:null),y||d(0),r==null||r(0)},C=(M,I)=>{const D={...x,[M]:I};I.length===0&&delete D[M],b(D),y||d(0),r==null||r(0),i==null||i(D)},V=()=>{b({}),y||d(0),r==null||r(0),i==null||i({})},A=[];if(z<=7)for(let M=0;M<z;M++)A.push(M);else{A.push(0),h>2&&A.push("…");for(let M=Math.max(1,h-1);M<=Math.min(z-2,h+1);M++)A.push(M);h<z-3&&A.push("…"),A.push(z-1)}return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--lucent-space-3)",...c},children:[v&&e.jsx("div",{style:{position:"relative",zIndex:1},children:e.jsx(ma,{columns:t,rows:n,filters:x,onFilter:C,onClearAll:V})}),e.jsx("div",{style:{overflowX:"auto",borderRadius:"var(--lucent-radius-lg)",border:"1px solid var(--lucent-border-default)"},children:e.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-sm)"},children:[e.jsx("thead",{children:e.jsx("tr",{style:{borderBottom:"1px solid var(--lucent-border-default)"},children:t.map(M=>{const I=(l==null?void 0:l.key)===M.key?l.dir:"none";return e.jsx("th",{onClick:M.sortable?()=>w(M.key):void 0,style:{padding:"var(--lucent-space-3) var(--lucent-space-4)",textAlign:M.align??"left",fontWeight:"var(--lucent-font-weight-medium)",color:"var(--lucent-text-secondary)",background:"var(--lucent-surface-secondary)",borderBottom:"1px solid var(--lucent-border-default)",cursor:M.sortable?"pointer":"default",userSelect:"none",whiteSpace:"nowrap",...M.width?{width:M.width}:{}},children:e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"var(--lucent-space-1)"},children:[M.header,M.sortable&&e.jsx(fa,{state:I})]})},M.key)})})}),e.jsx("tbody",{children:T.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:t.length,style:{padding:"var(--lucent-space-12)",textAlign:"center"},children:s??e.jsx(R,{color:"secondary",children:"No data"})})}):T.map((M,I)=>e.jsx("tr",{onMouseEnter:()=>p(I),onMouseLeave:()=>p(null),style:{borderBottom:I<T.length-1?"1px solid var(--lucent-border-subtle)":"none",background:g===I?"var(--lucent-surface-secondary)":"var(--lucent-surface)",transition:"background var(--lucent-duration-fast) var(--lucent-easing-default)"},children:t.map(D=>e.jsx("td",{style:{padding:"var(--lucent-space-3) var(--lucent-space-4)",color:"var(--lucent-text-primary)",textAlign:D.align??"left",verticalAlign:"middle"},children:D.render?D.render(M,I):String(M[D.key]??"")},D.key))},I))})]})}),a>0&&S.length>0&&e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"var(--lucent-space-3)",flexWrap:"wrap"},children:[e.jsx(R,{color:"secondary",size:"sm",children:S.length===0?`0 rows${n.length>0?` (filtered from ${n.length})`:""}`:S.length===1?`1 row${S.length<n.length?` (filtered from ${n.length})`:""}`:`${h*a+1}–${Math.min((h+1)*a,S.length)} of ${S.length} rows${S.length<n.length?` (filtered from ${n.length})`:""}`}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--lucent-space-1)"},children:[e.jsx(pe,{onClick:()=>q(h-1),disabled:h===0,"aria-label":"Previous page",children:e.jsx(Be,{dir:"left"})}),A.map((M,I)=>M==="…"?e.jsx("span",{style:{padding:"0 var(--lucent-space-1)",color:"var(--lucent-text-disabled)",fontSize:"var(--lucent-font-size-sm)"},children:"…"},`ellipsis-${I}`):e.jsx(pe,{onClick:()=>q(M),active:M===h,"aria-label":`Page ${M+1}`,"aria-current":M===h?"page":void 0,children:M+1},M)),e.jsx(pe,{onClick:()=>q(h+1),disabled:h>=z-1,"aria-label":"Next page",children:e.jsx(Be,{dir:"right"})})]})]})]})}function ma({columns:t,rows:n,filters:a,onFilter:o,onClearAll:r}){const i=t.filter(c=>c.filterable),s=Object.keys(a).length;return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--lucent-space-2)",flexWrap:"wrap"},children:[i.map(c=>{const l=Array.from(new Set(n.map(u=>String(u[c.key]??"")))).sort();return e.jsx(ga,{label:c.header,values:l,value:a[c.key]??[],onChange:u=>o(c.key,u)},c.key)}),s>0&&e.jsx("button",{onClick:r,style:{display:"inline-flex",alignItems:"center",height:30,padding:"0 var(--lucent-space-2)",border:"none",borderRadius:"var(--lucent-radius-md)",background:"transparent",color:"var(--lucent-text-secondary)",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-xs)",cursor:"pointer"},children:"Clear all"})]})}function ga({label:t,values:n,value:a,onChange:o}){const[r,i]=f.useState(!1),[s,c]=f.useState(!1),[l,u]=f.useState(""),m=f.useRef(null),d=f.useRef(null),g=a.length>0;f.useEffect(()=>{if(!r){u("");return}setTimeout(()=>{var v;return(v=d.current)==null?void 0:v.focus()},0);const y=v=>{m.current&&!m.current.contains(v.target)&&i(!1)},h=v=>{v.key==="Escape"&&i(!1)};return document.addEventListener("mousedown",y),document.addEventListener("keydown",h),()=>{document.removeEventListener("mousedown",y),document.removeEventListener("keydown",h)}},[r]);const p=l?n.filter(y=>y.toLowerCase().includes(l.toLowerCase())):n,x=y=>o(a.includes(y)?a.filter(h=>h!==y):[...a,y]),b=a.length===0?null:a.length===1?e.jsxs("span",{style:{color:"var(--lucent-text-secondary)",fontWeight:"var(--lucent-font-weight-regular)"},children:[": ",a[0]]}):e.jsxs("span",{style:{color:"var(--lucent-accent-default)"},children:["(",a.length,")"]});return e.jsxs("div",{ref:m,style:{position:"relative"},children:[e.jsxs("button",{onClick:()=>i(y=>!y),onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),style:{display:"inline-flex",alignItems:"center",gap:"var(--lucent-space-1)",height:30,padding:"0 var(--lucent-space-3)",borderRadius:"var(--lucent-radius-md)",border:`1px solid ${g?"var(--lucent-accent-default)":s?"var(--lucent-border-strong)":"var(--lucent-border-default)"}`,background:g?"var(--lucent-accent-subtle)":"var(--lucent-surface)",color:g?"var(--lucent-accent-default)":"var(--lucent-text-primary)",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-xs)",fontWeight:g?"var(--lucent-font-weight-medium)":"var(--lucent-font-weight-regular)",cursor:"pointer",outline:"none",whiteSpace:"nowrap",transition:"border-color var(--lucent-duration-fast) var(--lucent-easing-default), background var(--lucent-duration-fast) var(--lucent-easing-default)"},children:[t,b,e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":!0,style:{transform:r?"rotate(180deg)":"none",transition:"transform var(--lucent-duration-fast) var(--lucent-easing-default)"},children:e.jsx("path",{d:"M2 3.5L5 6.5L8 3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),r&&e.jsxs("div",{style:{position:"absolute",top:"calc(100% + 4px)",left:0,minWidth:180,maxHeight:280,display:"flex",flexDirection:"column",background:"var(--lucent-surface)",border:"1px solid var(--lucent-border-default)",borderRadius:"var(--lucent-radius-lg)",boxShadow:"0 4px 16px color-mix(in srgb, var(--lucent-text-primary) 8%, transparent)",zIndex:50},children:[e.jsx("div",{style:{padding:"var(--lucent-space-2)",paddingBottom:0},children:e.jsx("input",{ref:d,type:"text",value:l,onChange:y=>u(y.target.value),placeholder:"Search…",style:{width:"100%",boxSizing:"border-box",height:26,padding:"0 var(--lucent-space-2)",borderRadius:"var(--lucent-radius-md)",border:"1px solid var(--lucent-border-default)",background:"var(--lucent-surface-secondary)",color:"var(--lucent-text-primary)",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-xs)",outline:"none"}})}),a.length>0&&e.jsx("div",{style:{padding:"var(--lucent-space-1) var(--lucent-space-2) 0"},children:e.jsx("button",{onClick:()=>o([]),style:{display:"inline-flex",padding:"2px var(--lucent-space-2)",border:"none",borderRadius:"var(--lucent-radius-sm)",background:"transparent",color:"var(--lucent-text-secondary)",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-xs)",cursor:"pointer",textDecoration:"underline"},children:"Clear selection"})}),e.jsx("div",{style:{overflowY:"auto",padding:"var(--lucent-space-1)",borderTop:"1px solid var(--lucent-border-subtle)",marginTop:"var(--lucent-space-2)"},children:p.length===0?e.jsx("div",{style:{padding:"var(--lucent-space-3)",color:"var(--lucent-text-disabled)",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-xs)",textAlign:"center"},children:"No results"}):p.map(y=>e.jsx(ba,{label:y,isSelected:a.includes(y),onClick:()=>x(y)},y))})]})]})}function ba({label:t,isSelected:n,onClick:a}){const[o,r]=f.useState(!1);return e.jsxs("button",{onClick:a,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),style:{display:"flex",alignItems:"center",gap:"var(--lucent-space-2)",width:"100%",textAlign:"left",padding:"var(--lucent-space-2) var(--lucent-space-3)",borderRadius:"var(--lucent-radius-md)",border:"none",background:o?"var(--lucent-surface-secondary)":"transparent",color:"var(--lucent-text-primary)",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-xs)",fontWeight:n?"var(--lucent-font-weight-medium)":"var(--lucent-font-weight-regular)",cursor:"pointer",outline:"none",whiteSpace:"nowrap"},children:[e.jsx("span",{style:{flexShrink:0,width:14,height:14,borderRadius:"var(--lucent-radius-sm)",border:`1.5px solid ${n?"var(--lucent-accent-default)":"var(--lucent-border-strong)"}`,background:n?"var(--lucent-accent-default)":"transparent",display:"flex",alignItems:"center",justifyContent:"center",transition:"border-color var(--lucent-duration-fast), background var(--lucent-duration-fast)"},children:n&&e.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",fill:"none","aria-hidden":!0,children:e.jsx("path",{d:"M1 4L3 6L7 2",stroke:"var(--lucent-text-on-accent)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),t]})}function pe({children:t,onClick:n,disabled:a,active:o,...r}){const[i,s]=f.useState(!1);return e.jsx("button",{...r,onClick:n,disabled:a,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:32,height:32,padding:"0 var(--lucent-space-2)",borderRadius:"var(--lucent-radius-md)",border:o?"1px solid var(--lucent-accent-default)":"1px solid transparent",background:o?"var(--lucent-accent-default)":i&&!a?"var(--lucent-surface-secondary)":"transparent",color:o?"var(--lucent-text-on-accent)":a?"var(--lucent-text-disabled)":"var(--lucent-text-primary)",fontSize:"var(--lucent-font-size-sm)",fontFamily:"var(--lucent-font-family-base)",fontWeight:"var(--lucent-font-weight-regular)",cursor:a?"not-allowed":"pointer",transition:"background var(--lucent-duration-fast) var(--lucent-easing-default)"},children:t})}const va={id:"data-table",name:"DataTable",tier:"molecule",domain:"neutral",specVersion:"1.0",description:"A sortable, filterable, paginated data table with configurable columns, custom cell renderers, and keyboard-accessible pagination controls.",designIntent:'DataTable is generic over row type T so TypeScript consumers get full type safety on column keys and renderers. Sorting is client-side and composable — each column opts in via sortable:true; clicking a sorted column cycles asc → desc → unsorted. Filtering is per-column — each column opts in via filterable:true, which adds a dropdown button above the table. Each dropdown is searchable and multi-select: a search input filters the option list, and each option is a checkbox that toggles membership in the active set. Filtering uses set-membership: a row passes if its column value is included in the selected values array. A "Clear selection" link inside each dropdown clears that column; a "Clear all" button in the bar appears when any filter is active. Filter → sort → paginate is the fixed pipeline order; any filter change resets the page to 0. Pagination is either controlled (page prop + onPageChange) or uncontrolled (internal state). A pageSize of 0 disables pagination entirely, useful when the parent manages windowing. Row hover uses bg-subtle, not a border change, so the visual weight stays low for dense data views.',props:[{name:"columns",type:"array",required:!0,description:"Column definitions. Each column has a key, header, optional render function, optional sortable flag, optional filterable flag (renders a text filter input below the header), optional width, and optional text align."},{name:"rows",type:"array",required:!0,description:"Array of data objects to display. The generic type T is inferred from this prop."},{name:"pageSize",type:"number",required:!1,default:"10",description:"Number of rows per page. Set to 0 to disable pagination."},{name:"page",type:"number",required:!1,description:"Controlled current page (0-indexed). When provided, the component is fully controlled."},{name:"onPageChange",type:"function",required:!1,description:"Called with the new page index whenever the page changes (from pagination controls or after a sort/filter reset)."},{name:"onFilterChange",type:"function",required:!1,description:"Called with the current filter map (Record<string, string[]>) whenever any column filter changes. Keys are column keys; columns with no selection are omitted from the map."},{name:"emptyState",type:"ReactNode",required:!1,description:'Content to render when rows is empty. Defaults to a "No data" text.'},{name:"style",type:"object",required:!1,description:"Inline style overrides for the outer wrapper."}],usageExamples:[{title:"Basic sortable table",code:`<DataTable
246
276
  columns={[
247
277
  { key: 'name', header: 'Name', sortable: true },
248
278
  { key: 'role', header: 'Role', sortable: true },
@@ -264,12 +294,12 @@ Token rule: Card uses surface for its background. Never use bgBase or bgSubtle o
264
294
  pageSize={20}
265
295
  page={page}
266
296
  onPageChange={setPage}
267
- />`},{title:"No pagination",code:"<DataTable columns={columns} rows={rows} pageSize={0} />"}],compositionGraph:[{componentId:"text",componentName:"Text",role:"Row count and empty state labels",required:!1},{componentId:"badge",componentName:"Badge",role:"Typical cell content for status columns",required:!1}],accessibility:{role:"table",ariaAttributes:["aria-label","aria-sort","aria-current"],keyboardInteractions:["Tab to pagination controls","Enter/Space to activate buttons"],notes:'Column headers with sortable:true are interactive buttons with aria-sort reflecting the current sort direction. Pagination buttons include aria-label and aria-current="page" for the active page.'}},An=`
297
+ />`},{title:"No pagination",code:"<DataTable columns={columns} rows={rows} pageSize={0} />"}],compositionGraph:[{componentId:"text",componentName:"Text",role:"Row count and empty state labels",required:!1},{componentId:"badge",componentName:"Badge",role:"Typical cell content for status columns",required:!1}],accessibility:{role:"table",ariaAttributes:["aria-label","aria-sort","aria-current"],keyboardInteractions:["Tab to pagination controls","Enter/Space to activate buttons"],notes:'Column headers with sortable:true are interactive buttons with aria-sort reflecting the current sort direction. Pagination buttons include aria-label and aria-current="page" for the active page.'}},ya=`
268
298
  @keyframes lucent-palette-in {
269
299
  from { opacity: 0; transform: scale(0.96) translateY(-8px); }
270
300
  to { opacity: 1; transform: scale(1) translateY(0); }
271
301
  }
272
- `;function En(t,n){var o;const a=n.toLowerCase();return t.label.toLowerCase().includes(a)||(((o=t.description)==null?void 0:o.toLowerCase().includes(a))??!1)}function qn({commands:t,placeholder:n="Search commands…",shortcutKey:a="k",open:o,onOpenChange:r,style:i}){const s=o!==void 0,[l,c]=m.useState(!1),h=s?o:l,[g,u]=m.useState(""),[p,d]=m.useState(0),x=m.useRef(null),y=m.useRef(null),b=m.useRef(!1);if(!b.current){const T=document.createElement("style");T.textContent=An,document.head.appendChild(T),b.current=!0}const f=m.useCallback(T=>{s||c(T),r==null||r(T)},[s,r]);m.useEffect(()=>{const T=j=>{(j.metaKey||j.ctrlKey)&&j.key===a&&(j.preventDefault(),f(!h))};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[h,a,f]),m.useEffect(()=>{h&&(u(""),d(0),setTimeout(()=>{var T;return(T=x.current)==null?void 0:T.focus()},10))},[h]);const v=g?t.filter(T=>En(T,g)):t,I=v.filter(T=>!T.disabled);m.useEffect(()=>{const T=y.current;if(!T)return;const j=T.querySelector('[data-active="true"]');j==null||j.scrollIntoView({block:"nearest"})},[p]);const w=T=>{T.disabled||(T.onSelect(),f(!1))},S=T=>{if(T.key==="Escape"){f(!1);return}if(T.key==="ArrowDown"&&(T.preventDefault(),d(j=>Math.min(j+1,I.length-1))),T.key==="ArrowUp"&&(T.preventDefault(),d(j=>Math.max(j-1,0))),T.key==="Enter"){const j=I[p];j&&w(j)}},D=[];for(const T of v){const j=D[D.length-1];j&&j.group===T.group?j.items.push(T):D.push({group:T.group,items:[T]})}if(!h)return null;let q=0;return e.jsx("div",{role:"dialog","aria-label":"Command palette","aria-modal":"true",onClick:()=>f(!1),style:{position:"fixed",inset:0,zIndex:9e3,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"15vh",background:"var(--lucent-bg-overlay)",...i},children:e.jsxs("div",{role:"combobox","aria-haspopup":"listbox","aria-expanded":"true",onClick:T=>T.stopPropagation(),style:{width:"100%",maxWidth:560,margin:"0 var(--lucent-space-4)",background:"var(--lucent-surface-overlay)",borderRadius:"var(--lucent-radius-xl)",border:"1px solid var(--lucent-border-default)",boxShadow:"var(--lucent-shadow-xl)",overflow:"hidden",animation:"lucent-palette-in 150ms var(--lucent-easing-decelerate)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--lucent-space-3)",padding:"var(--lucent-space-3) var(--lucent-space-4)",borderBottom:v.length>0?"1px solid var(--lucent-border-subtle)":"none"},children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,style:{flexShrink:0,color:"var(--lucent-text-secondary)"},children:[e.jsx("circle",{cx:"7",cy:"7",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M10.5 10.5L13.5 13.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),e.jsx("input",{ref:x,role:"searchbox","aria-autocomplete":"list","aria-controls":"lucent-command-list",value:g,onChange:T=>{u(T.target.value),d(0)},onKeyDown:S,placeholder:n,style:{flex:1,border:"none",outline:"none",background:"transparent",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-md)",color:"var(--lucent-text-primary)",lineHeight:"var(--lucent-line-height-base)"}}),e.jsx("kbd",{style:{display:"inline-flex",alignItems:"center",padding:"2px 6px",borderRadius:"var(--lucent-radius-sm)",border:"1px solid var(--lucent-border-default)",background:"var(--lucent-surface-secondary)",fontFamily:"var(--lucent-font-family-mono)",fontSize:"var(--lucent-font-size-xs)",color:"var(--lucent-text-secondary)"},children:"Esc"})]}),e.jsx("div",{id:"lucent-command-list",role:"listbox",ref:y,style:{maxHeight:360,overflowY:"auto",padding:"var(--lucent-space-1) 0"},children:v.length===0?e.jsx("div",{style:{padding:"var(--lucent-space-8)",textAlign:"center"},children:e.jsxs(z,{color:"secondary",children:['No results for "',g,'"']})}):D.map(({group:T,items:j},F)=>e.jsxs("div",{children:[T&&e.jsx("div",{style:{padding:"var(--lucent-space-2) var(--lucent-space-4) var(--lucent-space-1)",...F>0?{borderTop:"1px solid var(--lucent-border-subtle)",marginTop:"var(--lucent-space-1)"}:{}},children:e.jsx(z,{size:"xs",color:"secondary",weight:"medium",children:T})}),j.map(E=>{const M=E.disabled??!1;let k=!1;return M||(k=q===p,q++),e.jsxs("div",{role:"option","aria-selected":k,"aria-disabled":M,"data-active":k,onClick:()=>w(E),onMouseEnter:()=>{if(!M){const C=I.indexOf(E);C!==-1&&d(C)}},style:{display:"flex",alignItems:"center",gap:"var(--lucent-space-3)",padding:"var(--lucent-space-2) var(--lucent-space-4)",cursor:M?"not-allowed":"pointer",background:k?"var(--lucent-surface-secondary)":"transparent",transition:"background var(--lucent-duration-fast) var(--lucent-easing-default)",opacity:M?.5:1},children:[E.icon&&e.jsx("span",{style:{flexShrink:0,color:"var(--lucent-text-secondary)",display:"flex"},children:E.icon}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx(z,{size:"sm",weight:"medium",truncate:!0,children:E.label}),E.description&&e.jsx(z,{size:"xs",color:"secondary",truncate:!0,children:E.description})]})]},E.id)})]},F))}),e.jsx("div",{style:{display:"flex",gap:"var(--lucent-space-4)",padding:"var(--lucent-space-2) var(--lucent-space-4)",borderTop:"1px solid var(--lucent-border-subtle)",background:"var(--lucent-surface-secondary)"},children:[["↑↓","Navigate"],["↵","Select"],["Esc","Close"]].map(([T,j])=>e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"var(--lucent-space-1)"},children:[e.jsx("kbd",{style:{padding:"1px 5px",borderRadius:"var(--lucent-radius-sm)",border:"1px solid var(--lucent-border-default)",background:"var(--lucent-surface)",fontFamily:"var(--lucent-font-family-mono)",fontSize:"var(--lucent-font-size-xs)",color:"var(--lucent-text-secondary)"},children:T}),e.jsx(z,{size:"xs",color:"secondary",children:j})]},T))})]})})}const Rn={id:"command-palette",name:"CommandPalette",tier:"overlay",domain:"neutral",specVersion:"1.0",description:"A keyboard-driven modal command palette with fuzzy search, grouped results, and a built-in ⌘K / Ctrl+K global shortcut.",designIntent:"CommandPalette renders as a portal-style overlay (fixed, full-viewport) with a centred panel that animates in with a subtle scale+fade. The ⌘K shortcut is registered as a global window listener so it works regardless of focus — consumers can override the key via shortcutKey prop. Clicking the backdrop dismisses the palette; Escape also closes it. Results are filtered client-side against label and description using simple substring match — no fuzzy library needed. Navigation is purely keyboard-driven: ↑↓ move the active index, Enter selects, mouse hover syncs the active index so mouse and keyboard stay in sync. Groups are derived from the group field on each CommandItem; the order of groups follows the order they first appear in the commands array. The component is controlled-or-uncontrolled: pass open + onOpenChange for controlled use, or omit both to use internal state.",props:[{name:"commands",type:"array",required:!0,description:"Array of CommandItem objects. Each has id, label, onSelect, and optional description, icon, group, disabled."},{name:"placeholder",type:"string",required:!1,default:'"Search commands…"',description:"Placeholder text for the search input."},{name:"shortcutKey",type:"string",required:!1,default:'"k"',description:'Key that opens the palette when pressed with Meta (Mac) or Ctrl (Windows). Defaults to "k" for ⌘K.'},{name:"open",type:"boolean",required:!1,description:"Controlled open state. When provided, the component is fully controlled."},{name:"onOpenChange",type:"function",required:!1,description:"Called when the palette requests an open/close state change."},{name:"style",type:"object",required:!1,description:"Inline style overrides for the backdrop element."}],usageExamples:[{title:"Uncontrolled with ⌘K",code:`<CommandPalette
302
+ `;function xa(t,n){var o;const a=n.toLowerCase();return t.label.toLowerCase().includes(a)||(((o=t.description)==null?void 0:o.toLowerCase().includes(a))??!1)}function wa({commands:t,placeholder:n="Search commands…",shortcutKey:a="k",open:o,onOpenChange:r,style:i}){const s=o!==void 0,[c,l]=f.useState(!1),u=s?o:c,[m,d]=f.useState(""),[g,p]=f.useState(0),x=f.useRef(null),b=f.useRef(null),y=f.useRef(!1);if(!y.current){const w=document.createElement("style");w.textContent=ya,document.head.appendChild(w),y.current=!0}const h=f.useCallback(w=>{s||l(w),r==null||r(w)},[s,r]);f.useEffect(()=>{const w=C=>{(C.metaKey||C.ctrlKey)&&C.key===a&&(C.preventDefault(),h(!u))};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[u,a,h]),f.useEffect(()=>{u&&(d(""),p(0),setTimeout(()=>{var w;return(w=x.current)==null?void 0:w.focus()},10))},[u]);const v=m?t.filter(w=>xa(w,m)):t,j=v.filter(w=>!w.disabled);f.useEffect(()=>{const w=b.current;if(!w)return;const C=w.querySelector('[data-active="true"]');C==null||C.scrollIntoView({block:"nearest"})},[g]);const S=w=>{w.disabled||(w.onSelect(),h(!1))},T=w=>{if(w.key==="Escape"){h(!1);return}if(w.key==="ArrowDown"&&(w.preventDefault(),p(C=>Math.min(C+1,j.length-1))),w.key==="ArrowUp"&&(w.preventDefault(),p(C=>Math.max(C-1,0))),w.key==="Enter"){const C=j[g];C&&S(C)}},z=[];for(const w of v){const C=z[z.length-1];C&&C.group===w.group?C.items.push(w):z.push({group:w.group,items:[w]})}if(!u)return null;let q=0;return e.jsx("div",{role:"dialog","aria-label":"Command palette","aria-modal":"true",onClick:()=>h(!1),style:{position:"fixed",inset:0,zIndex:9e3,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"15vh",background:"var(--lucent-bg-overlay)",...i},children:e.jsxs("div",{role:"combobox","aria-haspopup":"listbox","aria-expanded":"true",onClick:w=>w.stopPropagation(),style:{width:"100%",maxWidth:560,margin:"0 var(--lucent-space-4)",background:"var(--lucent-surface-overlay)",borderRadius:"var(--lucent-radius-xl)",border:"1px solid var(--lucent-border-default)",boxShadow:"var(--lucent-shadow-xl)",overflow:"hidden",animation:"lucent-palette-in 150ms var(--lucent-easing-decelerate)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--lucent-space-3)",padding:"var(--lucent-space-3) var(--lucent-space-4)",borderBottom:v.length>0?"1px solid var(--lucent-border-subtle)":"none"},children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,style:{flexShrink:0,color:"var(--lucent-text-secondary)"},children:[e.jsx("circle",{cx:"7",cy:"7",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M10.5 10.5L13.5 13.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),e.jsx("input",{ref:x,role:"searchbox","aria-autocomplete":"list","aria-controls":"lucent-command-list",value:m,onChange:w=>{d(w.target.value),p(0)},onKeyDown:T,placeholder:n,style:{flex:1,border:"none",outline:"none",background:"transparent",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-md)",color:"var(--lucent-text-primary)",lineHeight:"var(--lucent-line-height-base)"}}),e.jsx("kbd",{style:{display:"inline-flex",alignItems:"center",padding:"2px 6px",borderRadius:"var(--lucent-radius-sm)",border:"1px solid var(--lucent-border-default)",background:"var(--lucent-surface-secondary)",fontFamily:"var(--lucent-font-family-mono)",fontSize:"var(--lucent-font-size-xs)",color:"var(--lucent-text-secondary)"},children:"Esc"})]}),e.jsx("div",{id:"lucent-command-list",role:"listbox",ref:b,style:{maxHeight:360,overflowY:"auto",padding:"var(--lucent-space-1) 0"},children:v.length===0?e.jsx("div",{style:{padding:"var(--lucent-space-8)",textAlign:"center"},children:e.jsxs(R,{color:"secondary",children:['No results for "',m,'"']})}):z.map(({group:w,items:C},V)=>e.jsxs("div",{children:[w&&e.jsx("div",{style:{padding:"var(--lucent-space-2) var(--lucent-space-4) var(--lucent-space-1)",...V>0?{borderTop:"1px solid var(--lucent-border-subtle)",marginTop:"var(--lucent-space-1)"}:{}},children:e.jsx(R,{size:"xs",color:"secondary",weight:"medium",children:w})}),C.map(A=>{const M=A.disabled??!1;let I=!1;return M||(I=q===g,q++),e.jsxs("div",{role:"option","aria-selected":I,"aria-disabled":M,"data-active":I,onClick:()=>S(A),onMouseEnter:()=>{if(!M){const D=j.indexOf(A);D!==-1&&p(D)}},style:{display:"flex",alignItems:"center",gap:"var(--lucent-space-3)",padding:"var(--lucent-space-2) var(--lucent-space-4)",cursor:M?"not-allowed":"pointer",background:I?"var(--lucent-surface-secondary)":"transparent",transition:"background var(--lucent-duration-fast) var(--lucent-easing-default)",opacity:M?.5:1},children:[A.icon&&e.jsx("span",{style:{flexShrink:0,color:"var(--lucent-text-secondary)",display:"flex"},children:A.icon}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx(R,{size:"sm",weight:"medium",truncate:!0,children:A.label}),A.description&&e.jsx(R,{size:"xs",color:"secondary",truncate:!0,children:A.description})]})]},A.id)})]},V))}),e.jsx("div",{style:{display:"flex",gap:"var(--lucent-space-4)",padding:"var(--lucent-space-2) var(--lucent-space-4)",borderTop:"1px solid var(--lucent-border-subtle)",background:"var(--lucent-surface-secondary)"},children:[["↑↓","Navigate"],["↵","Select"],["Esc","Close"]].map(([w,C])=>e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"var(--lucent-space-1)"},children:[e.jsx("kbd",{style:{padding:"1px 5px",borderRadius:"var(--lucent-radius-sm)",border:"1px solid var(--lucent-border-default)",background:"var(--lucent-surface)",fontFamily:"var(--lucent-font-family-mono)",fontSize:"var(--lucent-font-size-xs)",color:"var(--lucent-text-secondary)"},children:w}),e.jsx(R,{size:"xs",color:"secondary",children:C})]},w))})]})})}const ka={id:"command-palette",name:"CommandPalette",tier:"overlay",domain:"neutral",specVersion:"1.0",description:"A keyboard-driven modal command palette with fuzzy search, grouped results, and a built-in ⌘K / Ctrl+K global shortcut.",designIntent:"CommandPalette renders as a portal-style overlay (fixed, full-viewport) with a centred panel that animates in with a subtle scale+fade. The ⌘K shortcut is registered as a global window listener so it works regardless of focus — consumers can override the key via shortcutKey prop. Clicking the backdrop dismisses the palette; Escape also closes it. Results are filtered client-side against label and description using simple substring match — no fuzzy library needed. Navigation is purely keyboard-driven: ↑↓ move the active index, Enter selects, mouse hover syncs the active index so mouse and keyboard stay in sync. Groups are derived from the group field on each CommandItem; the order of groups follows the order they first appear in the commands array. The component is controlled-or-uncontrolled: pass open + onOpenChange for controlled use, or omit both to use internal state.",props:[{name:"commands",type:"array",required:!0,description:"Array of CommandItem objects. Each has id, label, onSelect, and optional description, icon, group, disabled."},{name:"placeholder",type:"string",required:!1,default:'"Search commands…"',description:"Placeholder text for the search input."},{name:"shortcutKey",type:"string",required:!1,default:'"k"',description:'Key that opens the palette when pressed with Meta (Mac) or Ctrl (Windows). Defaults to "k" for ⌘K.'},{name:"open",type:"boolean",required:!1,description:"Controlled open state. When provided, the component is fully controlled."},{name:"onOpenChange",type:"function",required:!1,description:"Called when the palette requests an open/close state change."},{name:"style",type:"object",required:!1,description:"Inline style overrides for the backdrop element."}],usageExamples:[{title:"Uncontrolled with ⌘K",code:`<CommandPalette
273
303
  commands={[
274
304
  { id: 'new', label: 'New document', icon: <PlusIcon />, onSelect: () => router.push('/new') },
275
305
  { id: 'settings', label: 'Settings', description: 'Open app settings', onSelect: () => router.push('/settings') },
@@ -284,7 +314,7 @@ Token rule: Card uses surface for its background. Never use bgBase or bgSubtle o
284
314
  onOpenChange={setOpen}
285
315
  shortcutKey="p"
286
316
  />
287
- </>`}],compositionGraph:[{componentId:"text",componentName:"Text",role:"Group labels, item labels, descriptions, and empty state",required:!0}],accessibility:{role:"dialog",ariaAttributes:["aria-label","aria-modal","aria-expanded","aria-selected","aria-disabled","aria-controls","aria-autocomplete"],keyboardInteractions:["⌘K / Ctrl+K to open","↑↓ to navigate","Enter to select","Escape to close"],notes:'The backdrop and panel use role="dialog" with aria-modal="true". The input is role="searchbox". The result list is role="listbox" with role="option" items. Focus is moved to the search input on open.'}};function Ln({label:t,onRemove:n,disabled:a}){return e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 6px 2px 8px",borderRadius:"var(--lucent-radius-full)",background:"var(--lucent-surface-secondary)",border:"1px solid var(--lucent-border-default)",fontSize:"var(--lucent-font-size-sm)",fontFamily:"var(--lucent-font-family-base)",color:"var(--lucent-text-primary)",lineHeight:1.4,flexShrink:0},children:[t,!a&&e.jsx("button",{type:"button",onClick:o=>{o.stopPropagation(),n()},"aria-label":`Remove ${t}`,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:14,height:14,padding:0,border:"none",background:"none",cursor:"pointer",color:"var(--lucent-text-secondary)",borderRadius:"var(--lucent-radius-full)"},children:e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":!0,children:e.jsx("path",{d:"M2 2l6 6M8 2l-6 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]})}function Bn({options:t,value:n,defaultValue:a=[],onChange:o,placeholder:r="Select…",disabled:i=!1,max:s,style:l}){const c=n!==void 0,[h,g]=m.useState(a),u=c?n:h,[p,d]=m.useState(!1),[x,y]=m.useState(""),[b,f]=m.useState(0),[v,I]=m.useState(!1),w=m.useRef(null),S=m.useRef(null),D=m.useId();m.useEffect(()=>{if(!p)return;const k=C=>{var R;(R=w.current)!=null&&R.contains(C.target)||(d(!1),y(""))};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[p]);const q=k=>{const C=u.includes(k)?u.filter(R=>R!==k):s!==void 0&&u.length>=s?u:[...u,k];c||g(C),o==null||o(C)},T=k=>{const C=u.filter(R=>R!==k);c||g(C),o==null||o(C)},j=t.filter(k=>k.label.toLowerCase().includes(x.toLowerCase())),F=k=>{if(k.key==="Escape"){d(!1),y("");return}if(k.key==="ArrowDown"&&(k.preventDefault(),d(!0),f(C=>Math.min(C+1,j.length-1))),k.key==="ArrowUp"&&(k.preventDefault(),f(C=>Math.max(C-1,0))),k.key==="Enter"){k.preventDefault();const C=j[b];C&&!C.disabled&&q(C.value)}k.key==="Backspace"&&x===""&&u.length>0&&T(u[u.length-1])},E=s!==void 0&&u.length>=s,M=i?"var(--lucent-border-default)":v?"var(--lucent-accent-default)":"var(--lucent-border-default)";return e.jsxs("div",{ref:w,style:{position:"relative",...l},children:[e.jsxs("div",{onClick:()=>{var k;i||(d(!0),(k=S.current)==null||k.focus())},style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"var(--lucent-space-1)",minHeight:38,padding:"var(--lucent-space-1) var(--lucent-space-3)",borderRadius:"var(--lucent-radius-md)",border:`1px solid ${M}`,background:i?"var(--lucent-surface-secondary)":"var(--lucent-surface)",cursor:i?"not-allowed":"text",transition:"border-color var(--lucent-duration-fast) var(--lucent-easing-default)",outline:v?"2px solid var(--lucent-focus-ring)":"none",outlineOffset:2},children:[u.map(k=>{const C=t.find(R=>R.value===k);return C?e.jsx(Ln,{label:C.label,onRemove:()=>T(k),disabled:i},k):null}),e.jsx("input",{ref:S,value:x,onChange:k=>{y(k.target.value),d(!0),f(0)},onKeyDown:F,onFocus:()=>I(!0),onBlur:()=>I(!1),disabled:i,placeholder:u.length===0?r:"","aria-autocomplete":"list","aria-controls":D,"aria-expanded":p,role:"combobox",style:{flex:"1 1 80px",minWidth:80,border:"none",outline:"none",background:"transparent",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-sm)",color:i?"var(--lucent-text-disabled)":"var(--lucent-text-primary)",cursor:i?"not-allowed":"text",padding:"2px 0"}})]}),p&&!i&&e.jsxs("div",{id:D,role:"listbox","aria-multiselectable":"true",style:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,zIndex:1e3,background:"var(--lucent-surface-overlay)",border:"1px solid var(--lucent-border-default)",borderRadius:"var(--lucent-radius-md)",boxShadow:"var(--lucent-shadow-md)",maxHeight:240,overflowY:"auto",padding:"var(--lucent-space-1) 0"},children:[j.length===0?e.jsx("div",{style:{padding:"var(--lucent-space-3) var(--lucent-space-4)"},children:e.jsx(z,{color:"secondary",size:"sm",children:"No options"})}):j.map((k,C)=>{const R=u.includes(k.value),N=C===b,P=k.disabled??!1,O=E&&!R;return e.jsxs("div",{role:"option","aria-selected":R,"aria-disabled":P||O,onClick:()=>{!P&&!O&&q(k.value)},onMouseEnter:()=>f(C),style:{display:"flex",alignItems:"center",gap:"var(--lucent-space-2)",padding:"var(--lucent-space-2) var(--lucent-space-3)",cursor:P||O?"not-allowed":"pointer",background:N?"var(--lucent-surface-secondary)":"transparent",opacity:P||O?.5:1},children:[e.jsx(oe,{checked:R,disabled:P||O,size:"md",style:{margin:0,pointerEvents:"none"},"aria-hidden":!0,readOnly:!0}),e.jsx(z,{size:"sm",children:k.label})]},k.value)}),E&&e.jsx("div",{style:{padding:"var(--lucent-space-2) var(--lucent-space-3)",borderTop:"1px solid var(--lucent-border-subtle)"},children:e.jsxs(z,{size:"xs",color:"secondary",children:["Max ",s," selected"]})})]})]})}const Fn={id:"multi-select",name:"MultiSelect",tier:"molecule",domain:"neutral",specVersion:"1.0",description:"A tag-based multi-option selector with inline search, keyboard navigation, and an optional selection cap.",designIntent:"MultiSelect renders selected values as removable tags inside the trigger area, giving immediate visual feedback on what is selected. The search input sits inline with the tags so there is no separate search field to discover. Backspace with an empty query removes the last selected tag — a standard UX pattern in multi-select inputs. The max prop caps selection without disabling the entire component: unselected options beyond the cap are grayed out and show a hint. The dropdown closes on outside click, Escape, or when focus leaves. Checkbox indicators in the dropdown make the selected state scannable at a glance without relying solely on background color.",props:[{name:"options",type:"array",required:!0,description:"Array of { value, label, disabled? } option objects."},{name:"value",type:"array",required:!1,description:"Controlled array of selected values."},{name:"defaultValue",type:"array",required:!1,default:"[]",description:"Initial selected values for uncontrolled usage."},{name:"onChange",type:"function",required:!1,description:"Called with the updated array of selected values on each change."},{name:"placeholder",type:"string",required:!1,default:'"Select…"',description:"Placeholder shown when nothing is selected."},{name:"disabled",type:"boolean",required:!1,default:"false",description:"Disables interaction and dims the component."},{name:"max",type:"number",required:!1,description:"Maximum number of selectable options. Unselected options beyond the cap are grayed out."},{name:"style",type:"object",required:!1,description:"Inline style overrides for the outer wrapper."}],usageExamples:[{title:"Uncontrolled",code:`<MultiSelect
317
+ </>`}],compositionGraph:[{componentId:"text",componentName:"Text",role:"Group labels, item labels, descriptions, and empty state",required:!0}],accessibility:{role:"dialog",ariaAttributes:["aria-label","aria-modal","aria-expanded","aria-selected","aria-disabled","aria-controls","aria-autocomplete"],keyboardInteractions:["⌘K / Ctrl+K to open","↑↓ to navigate","Enter to select","Escape to close"],notes:'The backdrop and panel use role="dialog" with aria-modal="true". The input is role="searchbox". The result list is role="listbox" with role="option" items. Focus is moved to the search input on open.'}};function Sa({label:t,onRemove:n,disabled:a}){return e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 6px 2px 8px",borderRadius:"var(--lucent-radius-full)",background:"var(--lucent-surface-secondary)",border:"1px solid var(--lucent-border-default)",fontSize:"var(--lucent-font-size-sm)",fontFamily:"var(--lucent-font-family-base)",color:"var(--lucent-text-primary)",lineHeight:1.4,flexShrink:0},children:[t,!a&&e.jsx("button",{type:"button",onClick:o=>{o.stopPropagation(),n()},"aria-label":`Remove ${t}`,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:14,height:14,padding:0,border:"none",background:"none",cursor:"pointer",color:"var(--lucent-text-secondary)",borderRadius:"var(--lucent-radius-full)"},children:e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":!0,children:e.jsx("path",{d:"M2 2l6 6M8 2l-6 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]})}function Ta({options:t,value:n,defaultValue:a=[],onChange:o,placeholder:r="Select…",disabled:i=!1,max:s,style:c}){const l=n!==void 0,[u,m]=f.useState(a),d=l?n:u,[g,p]=f.useState(!1),[x,b]=f.useState(""),[y,h]=f.useState(0),[v,j]=f.useState(!1),S=f.useRef(null),T=f.useRef(null),z=f.useId();f.useEffect(()=>{if(!g)return;const I=D=>{var B;(B=S.current)!=null&&B.contains(D.target)||(p(!1),b(""))};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[g]);const q=I=>{const D=d.includes(I)?d.filter(B=>B!==I):s!==void 0&&d.length>=s?d:[...d,I];l||m(D),o==null||o(D)},w=I=>{const D=d.filter(B=>B!==I);l||m(D),o==null||o(D)},C=t.filter(I=>I.label.toLowerCase().includes(x.toLowerCase())),V=I=>{if(I.key==="Escape"){p(!1),b("");return}if(I.key==="ArrowDown"&&(I.preventDefault(),p(!0),h(D=>Math.min(D+1,C.length-1))),I.key==="ArrowUp"&&(I.preventDefault(),h(D=>Math.max(D-1,0))),I.key==="Enter"){I.preventDefault();const D=C[y];D&&!D.disabled&&q(D.value)}I.key==="Backspace"&&x===""&&d.length>0&&w(d[d.length-1])},A=s!==void 0&&d.length>=s,M=i?"var(--lucent-border-default)":v?"var(--lucent-accent-default)":"var(--lucent-border-default)";return e.jsxs("div",{ref:S,style:{position:"relative",...c},children:[e.jsxs("div",{onClick:()=>{var I;i||(p(!0),(I=T.current)==null||I.focus())},style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"var(--lucent-space-1)",minHeight:38,padding:"var(--lucent-space-1) var(--lucent-space-3)",borderRadius:"var(--lucent-radius-md)",border:`1px solid ${M}`,background:i?"var(--lucent-surface-secondary)":"var(--lucent-surface)",cursor:i?"not-allowed":"text",transition:"border-color var(--lucent-duration-fast) var(--lucent-easing-default)",outline:v?"2px solid var(--lucent-focus-ring)":"none",outlineOffset:2},children:[d.map(I=>{const D=t.find(B=>B.value===I);return D?e.jsx(Sa,{label:D.label,onRemove:()=>w(I),disabled:i},I):null}),e.jsx("input",{ref:T,value:x,onChange:I=>{b(I.target.value),p(!0),h(0)},onKeyDown:V,onFocus:()=>j(!0),onBlur:()=>j(!1),disabled:i,placeholder:d.length===0?r:"","aria-autocomplete":"list","aria-controls":z,"aria-expanded":g,role:"combobox",style:{flex:"1 1 80px",minWidth:80,border:"none",outline:"none",background:"transparent",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-sm)",color:i?"var(--lucent-text-disabled)":"var(--lucent-text-primary)",cursor:i?"not-allowed":"text",padding:"2px 0"}})]}),g&&!i&&e.jsxs("div",{id:z,role:"listbox","aria-multiselectable":"true",style:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,zIndex:1e3,background:"var(--lucent-surface-overlay)",border:"1px solid var(--lucent-border-default)",borderRadius:"var(--lucent-radius-md)",boxShadow:"var(--lucent-shadow-md)",maxHeight:240,overflowY:"auto",padding:"var(--lucent-space-1) 0"},children:[C.length===0?e.jsx("div",{style:{padding:"var(--lucent-space-3) var(--lucent-space-4)"},children:e.jsx(R,{color:"secondary",size:"sm",children:"No options"})}):C.map((I,D)=>{const B=d.includes(I.value),H=D===y,O=I.disabled??!1,U=A&&!B;return e.jsxs("div",{role:"option","aria-selected":B,"aria-disabled":O||U,onClick:()=>{!O&&!U&&q(I.value)},onMouseEnter:()=>h(D),style:{display:"flex",alignItems:"center",gap:"var(--lucent-space-2)",padding:"var(--lucent-space-2) var(--lucent-space-3)",cursor:O||U?"not-allowed":"pointer",background:H?"var(--lucent-surface-secondary)":"transparent",opacity:O||U?.5:1},children:[e.jsx(xe,{checked:B,disabled:O||U,size:"md",style:{margin:0,pointerEvents:"none"},"aria-hidden":!0,readOnly:!0}),e.jsx(R,{size:"sm",children:I.label})]},I.value)}),A&&e.jsx("div",{style:{padding:"var(--lucent-space-2) var(--lucent-space-3)",borderTop:"1px solid var(--lucent-border-subtle)"},children:e.jsxs(R,{size:"xs",color:"secondary",children:["Max ",s," selected"]})})]})]})}const ja={id:"multi-select",name:"MultiSelect",tier:"molecule",domain:"neutral",specVersion:"1.0",description:"A tag-based multi-option selector with inline search, keyboard navigation, and an optional selection cap.",designIntent:"MultiSelect renders selected values as removable tags inside the trigger area, giving immediate visual feedback on what is selected. The search input sits inline with the tags so there is no separate search field to discover. Backspace with an empty query removes the last selected tag — a standard UX pattern in multi-select inputs. The max prop caps selection without disabling the entire component: unselected options beyond the cap are grayed out and show a hint. The dropdown closes on outside click, Escape, or when focus leaves. Checkbox indicators in the dropdown make the selected state scannable at a glance without relying solely on background color.",props:[{name:"options",type:"array",required:!0,description:"Array of { value, label, disabled? } option objects."},{name:"value",type:"array",required:!1,description:"Controlled array of selected values."},{name:"defaultValue",type:"array",required:!1,default:"[]",description:"Initial selected values for uncontrolled usage."},{name:"onChange",type:"function",required:!1,description:"Called with the updated array of selected values on each change."},{name:"placeholder",type:"string",required:!1,default:'"Select…"',description:"Placeholder shown when nothing is selected."},{name:"disabled",type:"boolean",required:!1,default:"false",description:"Disables interaction and dims the component."},{name:"max",type:"number",required:!1,description:"Maximum number of selectable options. Unselected options beyond the cap are grayed out."},{name:"style",type:"object",required:!1,description:"Inline style overrides for the outer wrapper."}],usageExamples:[{title:"Uncontrolled",code:`<MultiSelect
288
318
  options={[
289
319
  { value: 'react', label: 'React' },
290
320
  { value: 'vue', label: 'Vue' },
@@ -298,14 +328,14 @@ Token rule: Card uses surface for its background. Never use bgBase or bgSubtle o
298
328
  onChange={setTags}
299
329
  max={3}
300
330
  placeholder="Up to 3 tags"
301
- />`}],compositionGraph:[{componentId:"text",componentName:"Text",role:"Option labels, empty state, and max hint",required:!0}],accessibility:{role:"combobox",ariaAttributes:["aria-autocomplete","aria-controls","aria-expanded","aria-multiselectable","aria-selected","aria-disabled"],keyboardInteractions:["↑↓ to navigate options","Enter to toggle selection","Escape to close","Backspace to remove last tag"],notes:'The input carries role="combobox" with aria-expanded and aria-controls pointing to the listbox. Each option has role="option" with aria-selected. Remove buttons on tags have descriptive aria-label.'}};function Nn(t,n){return new Date(t,n+1,0).getDate()}function Pn(t,n){return new Date(t,n,1).getDay()}function X(t,n){return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()}function te(t,n){return new Date(t.getFullYear(),t.getMonth(),t.getDate())<new Date(n.getFullYear(),n.getMonth(),n.getDate())}function pe(t,n){return new Date(t.getFullYear(),t.getMonth(),t.getDate())>new Date(n.getFullYear(),n.getMonth(),n.getDate())}const $n=["January","February","March","April","May","June","July","August","September","October","November","December"],Wn=["Su","Mo","Tu","We","Th","Fr","Sa"];function G(t){return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}function fe({dir:t,onClick:n,disabled:a}){const[o,r]=m.useState(!1);return e.jsx("button",{type:"button",onClick:n,disabled:a,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),"aria-label":t==="prev"?"Previous month":"Next month",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,border:"none",borderRadius:"var(--lucent-radius-md)",background:o&&!a?"var(--lucent-surface-secondary)":"transparent",color:a?"var(--lucent-text-disabled)":"var(--lucent-text-secondary)",cursor:a?"not-allowed":"pointer",transition:"background var(--lucent-duration-fast)"},children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:e.jsx("path",{d:t==="prev"?"M10 12L6 8l4-4":"M6 4l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})}function ne({year:t,month:n,selected:a,today:o,min:r,max:i,onSelect:s,onPrevMonth:l,onNextMonth:c,highlightRange:h}){const g=Nn(t,n),u=Pn(t,n),[p,d]=m.useState(null),x=[...Array(u).fill(null),...Array.from({length:g},(y,b)=>b+1)];for(;x.length%7!==0;)x.push(null);return e.jsxs("div",{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"var(--lucent-space-3)"},children:[e.jsx(fe,{dir:"prev",onClick:l}),e.jsxs(z,{weight:"medium",size:"sm",children:[$n[n]," ",t]}),e.jsx(fe,{dir:"next",onClick:c})]}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:2,marginBottom:"var(--lucent-space-1)"},children:Wn.map(y=>e.jsx("div",{style:{textAlign:"center"},children:e.jsx(z,{size:"xs",color:"secondary",children:y})},y))}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:2},children:x.map((y,b)=>{if(!y)return e.jsx("div",{},b);const f=new Date(t,n,y),v=a?X(f,a):!1,I=X(f,o),w=(r?te(f,r):!1)||(i?pe(f,i):!1);let S=!1;return h!=null&&h.start&&(h!=null&&h.end)&&(S=!te(f,h.start)&&!pe(f,h.end)),e.jsx("button",{type:"button",disabled:w,onClick:()=>!w&&s(f),onMouseEnter:()=>d(y),onMouseLeave:()=>d(null),"aria-label":G(f),"aria-pressed":v,style:{display:"flex",alignItems:"center",justifyContent:"center",height:32,width:"100%",border:I&&!v?"1px solid var(--lucent-border-strong)":"1px solid transparent",borderRadius:"var(--lucent-radius-md)",background:v?"var(--lucent-accent-default)":S?"var(--lucent-accent-subtle)":p===y&&!w?"var(--lucent-surface-secondary)":"transparent",color:v?"var(--lucent-text-on-accent)":w?"var(--lucent-text-disabled)":"var(--lucent-text-primary)",fontSize:"var(--lucent-font-size-sm)",fontFamily:"var(--lucent-font-family-base)",fontWeight:I?"var(--lucent-font-weight-medium)":"var(--lucent-font-weight-regular)",cursor:w?"not-allowed":"pointer",transition:"background var(--lucent-duration-fast)"},children:y},b)})})]})}function Vn({value:t,defaultValue:n,onChange:a,placeholder:o="Pick a date",disabled:r=!1,min:i,max:s,style:l}){const c=t!==void 0,[h,g]=m.useState(n),u=c?t:h,p=new Date,[d,x]=m.useState((u??p).getFullYear()),[y,b]=m.useState((u??p).getMonth()),[f,v]=m.useState(!1),[I,w]=m.useState(!1),S=m.useRef(null);m.useEffect(()=>{if(!f)return;const j=F=>{var E;(E=S.current)!=null&&E.contains(F.target)||v(!1)};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[f]);const D=j=>{c||g(j),a==null||a(j),v(!1)},q=()=>{y===0?(b(11),x(j=>j-1)):b(j=>j-1)},T=()=>{y===11?(b(0),x(j=>j+1)):b(j=>j+1)};return e.jsxs("div",{ref:S,style:{position:"relative",display:"inline-block",...l},children:[e.jsxs("button",{type:"button",disabled:r,onClick:()=>!r&&v(j=>!j),onFocus:()=>w(!0),onBlur:()=>w(!1),"aria-haspopup":"dialog","aria-expanded":f,style:{display:"inline-flex",alignItems:"center",gap:"var(--lucent-space-2)",padding:"var(--lucent-space-2) var(--lucent-space-3)",borderRadius:"var(--lucent-radius-md)",border:`1px solid ${I?"var(--lucent-accent-default)":"var(--lucent-border-default)"}`,background:r?"var(--lucent-surface-secondary)":"var(--lucent-surface)",color:u?"var(--lucent-text-primary)":"var(--lucent-text-secondary)",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-sm)",cursor:r?"not-allowed":"pointer",outline:I?"2px solid var(--lucent-focus-ring)":"none",outlineOffset:2,minWidth:160,transition:"border-color var(--lucent-duration-fast)"},children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,style:{flexShrink:0},children:[e.jsx("rect",{x:"1",y:"2",width:"12",height:"11",rx:"2",stroke:"currentColor",strokeWidth:"1.3"}),e.jsx("path",{d:"M1 6h12",stroke:"currentColor",strokeWidth:"1.3"}),e.jsx("path",{d:"M4 1v2M10 1v2",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]}),e.jsx("span",{style:{flex:1,textAlign:"left"},children:u?G(u):o})]}),f&&e.jsx("div",{role:"dialog","aria-label":"Date picker",style:{position:"absolute",top:"calc(100% + 4px)",left:0,zIndex:1e3,background:"var(--lucent-surface-overlay)",border:"1px solid var(--lucent-border-default)",borderRadius:"var(--lucent-radius-lg)",boxShadow:"var(--lucent-shadow-md)",padding:"var(--lucent-space-4)",minWidth:260},children:e.jsx(ne,{year:d,month:y,...u!==void 0&&{selected:u},today:p,...i!==void 0&&{min:i},...s!==void 0&&{max:s},onSelect:D,onPrevMonth:q,onNextMonth:T})})]})}const On={id:"date-picker",name:"DatePicker",tier:"molecule",domain:"neutral",specVersion:"1.0",description:"A single-date picker with a calendar popover, month navigation, today highlight, min/max constraints, and controlled or uncontrolled modes.",designIntent:`DatePicker deliberately avoids native <input type="date"> to guarantee consistent cross-browser appearance that matches the Lucent token system. The trigger button shows the selected date in YYYY-MM-DD format (ISO-sortable, unambiguous locale-wise) or a placeholder. The calendar popover renders as a role="dialog" and closes on outside click. Today is outlined rather than filled so it doesn't compete visually with the selected date. Disabled dates (outside min/max) are grayed out and non-interactive. The Calendar primitive is exported separately so DateRangePicker can compose two calendars side by side.`,props:[{name:"value",type:"object",required:!1,description:"Controlled selected Date. When provided the component is fully controlled."},{name:"defaultValue",type:"object",required:!1,description:"Initial selected Date for uncontrolled usage."},{name:"onChange",type:"function",required:!1,description:"Called with the newly selected Date when the user picks a day."},{name:"placeholder",type:"string",required:!1,default:'"Pick a date"',description:"Trigger button text when no date is selected."},{name:"disabled",type:"boolean",required:!1,default:"false",description:"Disables the trigger button and all interaction."},{name:"min",type:"object",required:!1,description:"Earliest selectable Date. Days before this are grayed out."},{name:"max",type:"object",required:!1,description:"Latest selectable Date. Days after this are grayed out."},{name:"style",type:"object",required:!1,description:"Inline style overrides for the outer wrapper."}],usageExamples:[{title:"Uncontrolled",code:"<DatePicker onChange={(d) => console.log(d)} />"},{title:"Controlled with constraints",code:`const [date, setDate] = useState<Date>();
331
+ />`}],compositionGraph:[{componentId:"text",componentName:"Text",role:"Option labels, empty state, and max hint",required:!0}],accessibility:{role:"combobox",ariaAttributes:["aria-autocomplete","aria-controls","aria-expanded","aria-multiselectable","aria-selected","aria-disabled"],keyboardInteractions:["↑↓ to navigate options","Enter to toggle selection","Escape to close","Backspace to remove last tag"],notes:'The input carries role="combobox" with aria-expanded and aria-controls pointing to the listbox. Each option has role="option" with aria-selected. Remove buttons on tags have descriptive aria-label.'}};function Ca(t,n){return new Date(t,n+1,0).getDate()}function Ia(t,n){return new Date(t,n,1).getDay()}function de(t,n){return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()}function ge(t,n){return new Date(t.getFullYear(),t.getMonth(),t.getDate())<new Date(n.getFullYear(),n.getMonth(),n.getDate())}function Fe(t,n){return new Date(t.getFullYear(),t.getMonth(),t.getDate())>new Date(n.getFullYear(),n.getMonth(),n.getDate())}const Ma=["January","February","March","April","May","June","July","August","September","October","November","December"],Da=["Su","Mo","Tu","We","Th","Fr","Sa"];function te(t){return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}function Ne({dir:t,onClick:n,disabled:a}){const[o,r]=f.useState(!1);return e.jsx("button",{type:"button",onClick:n,disabled:a,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),"aria-label":t==="prev"?"Previous month":"Next month",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,border:"none",borderRadius:"var(--lucent-radius-md)",background:o&&!a?"var(--lucent-surface-secondary)":"transparent",color:a?"var(--lucent-text-disabled)":"var(--lucent-text-secondary)",cursor:a?"not-allowed":"pointer",transition:"background var(--lucent-duration-fast)"},children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:e.jsx("path",{d:t==="prev"?"M10 12L6 8l4-4":"M6 4l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})}function be({year:t,month:n,selected:a,today:o,min:r,max:i,onSelect:s,onPrevMonth:c,onNextMonth:l,highlightRange:u}){const m=Ca(t,n),d=Ia(t,n),[g,p]=f.useState(null),x=[...Array(d).fill(null),...Array.from({length:m},(b,y)=>y+1)];for(;x.length%7!==0;)x.push(null);return e.jsxs("div",{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"var(--lucent-space-3)"},children:[e.jsx(Ne,{dir:"prev",onClick:c}),e.jsxs(R,{weight:"medium",size:"sm",children:[Ma[n]," ",t]}),e.jsx(Ne,{dir:"next",onClick:l})]}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:2,marginBottom:"var(--lucent-space-1)"},children:Da.map(b=>e.jsx("div",{style:{textAlign:"center"},children:e.jsx(R,{size:"xs",color:"secondary",children:b})},b))}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:2},children:x.map((b,y)=>{if(!b)return e.jsx("div",{},y);const h=new Date(t,n,b),v=a?de(h,a):!1,j=de(h,o),S=(r?ge(h,r):!1)||(i?Fe(h,i):!1);let T=!1;return u!=null&&u.start&&(u!=null&&u.end)&&(T=!ge(h,u.start)&&!Fe(h,u.end)),e.jsx("button",{type:"button",disabled:S,onClick:()=>!S&&s(h),onMouseEnter:()=>p(b),onMouseLeave:()=>p(null),"aria-label":te(h),"aria-pressed":v,style:{display:"flex",alignItems:"center",justifyContent:"center",height:32,width:"100%",border:j&&!v?"1px solid var(--lucent-border-strong)":"1px solid transparent",borderRadius:"var(--lucent-radius-md)",background:v?"var(--lucent-accent-default)":T?"var(--lucent-accent-subtle)":g===b&&!S?"var(--lucent-surface-secondary)":"transparent",color:v?"var(--lucent-text-on-accent)":S?"var(--lucent-text-disabled)":"var(--lucent-text-primary)",fontSize:"var(--lucent-font-size-sm)",fontFamily:"var(--lucent-font-family-base)",fontWeight:j?"var(--lucent-font-weight-medium)":"var(--lucent-font-weight-regular)",cursor:S?"not-allowed":"pointer",transition:"background var(--lucent-duration-fast)"},children:b},y)})})]})}function za({value:t,defaultValue:n,onChange:a,placeholder:o="Pick a date",disabled:r=!1,min:i,max:s,style:c}){const l=t!==void 0,[u,m]=f.useState(n),d=l?t:u,g=new Date,[p,x]=f.useState((d??g).getFullYear()),[b,y]=f.useState((d??g).getMonth()),[h,v]=f.useState(!1),[j,S]=f.useState(!1),T=f.useRef(null);f.useEffect(()=>{if(!h)return;const C=V=>{var A;(A=T.current)!=null&&A.contains(V.target)||v(!1)};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[h]);const z=C=>{l||m(C),a==null||a(C),v(!1)},q=()=>{b===0?(y(11),x(C=>C-1)):y(C=>C-1)},w=()=>{b===11?(y(0),x(C=>C+1)):y(C=>C+1)};return e.jsxs("div",{ref:T,style:{position:"relative",display:"inline-block",...c},children:[e.jsxs("button",{type:"button",disabled:r,onClick:()=>!r&&v(C=>!C),onFocus:()=>S(!0),onBlur:()=>S(!1),"aria-haspopup":"dialog","aria-expanded":h,style:{display:"inline-flex",alignItems:"center",gap:"var(--lucent-space-2)",padding:"var(--lucent-space-2) var(--lucent-space-3)",borderRadius:"var(--lucent-radius-md)",border:`1px solid ${j?"var(--lucent-accent-default)":"var(--lucent-border-default)"}`,background:r?"var(--lucent-surface-secondary)":"var(--lucent-surface)",color:d?"var(--lucent-text-primary)":"var(--lucent-text-secondary)",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-sm)",cursor:r?"not-allowed":"pointer",outline:j?"2px solid var(--lucent-focus-ring)":"none",outlineOffset:2,minWidth:160,transition:"border-color var(--lucent-duration-fast)"},children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,style:{flexShrink:0},children:[e.jsx("rect",{x:"1",y:"2",width:"12",height:"11",rx:"2",stroke:"currentColor",strokeWidth:"1.3"}),e.jsx("path",{d:"M1 6h12",stroke:"currentColor",strokeWidth:"1.3"}),e.jsx("path",{d:"M4 1v2M10 1v2",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]}),e.jsx("span",{style:{flex:1,textAlign:"left"},children:d?te(d):o})]}),h&&e.jsx("div",{role:"dialog","aria-label":"Date picker",style:{position:"absolute",top:"calc(100% + 4px)",left:0,zIndex:1e3,background:"var(--lucent-surface-overlay)",border:"1px solid var(--lucent-border-default)",borderRadius:"var(--lucent-radius-lg)",boxShadow:"var(--lucent-shadow-md)",padding:"var(--lucent-space-4)",minWidth:260},children:e.jsx(be,{year:p,month:b,...d!==void 0&&{selected:d},today:g,...i!==void 0&&{min:i},...s!==void 0&&{max:s},onSelect:z,onPrevMonth:q,onNextMonth:w})})]})}const Aa={id:"date-picker",name:"DatePicker",tier:"molecule",domain:"neutral",specVersion:"1.0",description:"A single-date picker with a calendar popover, month navigation, today highlight, min/max constraints, and controlled or uncontrolled modes.",designIntent:`DatePicker deliberately avoids native <input type="date"> to guarantee consistent cross-browser appearance that matches the Lucent token system. The trigger button shows the selected date in YYYY-MM-DD format (ISO-sortable, unambiguous locale-wise) or a placeholder. The calendar popover renders as a role="dialog" and closes on outside click. Today is outlined rather than filled so it doesn't compete visually with the selected date. Disabled dates (outside min/max) are grayed out and non-interactive. The Calendar primitive is exported separately so DateRangePicker can compose two calendars side by side.`,props:[{name:"value",type:"object",required:!1,description:"Controlled selected Date. When provided the component is fully controlled."},{name:"defaultValue",type:"object",required:!1,description:"Initial selected Date for uncontrolled usage."},{name:"onChange",type:"function",required:!1,description:"Called with the newly selected Date when the user picks a day."},{name:"placeholder",type:"string",required:!1,default:'"Pick a date"',description:"Trigger button text when no date is selected."},{name:"disabled",type:"boolean",required:!1,default:"false",description:"Disables the trigger button and all interaction."},{name:"min",type:"object",required:!1,description:"Earliest selectable Date. Days before this are grayed out."},{name:"max",type:"object",required:!1,description:"Latest selectable Date. Days after this are grayed out."},{name:"style",type:"object",required:!1,description:"Inline style overrides for the outer wrapper."}],usageExamples:[{title:"Uncontrolled",code:"<DatePicker onChange={(d) => console.log(d)} />"},{title:"Controlled with constraints",code:`const [date, setDate] = useState<Date>();
302
332
  <DatePicker
303
333
  value={date}
304
334
  onChange={setDate}
305
335
  min={new Date()}
306
336
  placeholder="Select a future date"
307
- />`}],compositionGraph:[{componentId:"text",componentName:"Text",role:"Month/year header and weekday labels",required:!0}],accessibility:{role:"dialog",ariaAttributes:["aria-haspopup","aria-expanded","aria-label","aria-pressed"],keyboardInteractions:["Enter/Space to open calendar","Click day to select","Escape closes popover (click outside)"],notes:'The calendar popover is role="dialog". Each day button has aria-label with the full date and aria-pressed for selected state. Full arrow-key navigation within the calendar grid is a planned enhancement.'}};function Hn(t,n){return t?X(t.start,t.end)?G(t.start):`${G(t.start)} → ${G(t.end)}`:n}function Gn({value:t,defaultValue:n,onChange:a,placeholder:o="Pick a date range",disabled:r=!1,min:i,max:s,style:l}){const c=t!==void 0,[h,g]=m.useState(n),u=c?t:h,[p,d]=m.useState(null),x=new Date,[y,b]=m.useState(((u==null?void 0:u.start)??x).getFullYear()),[f,v]=m.useState(((u==null?void 0:u.start)??x).getMonth()),I=f===11?0:f+1,w=f===11?y+1:y,[S,D]=m.useState(!1),[q,T]=m.useState(!1),j=m.useRef(null);m.useEffect(()=>{if(!S)return;const C=R=>{var N;(N=j.current)!=null&&N.contains(R.target)||(D(!1),d(null))};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[S]);const F=C=>{if(!p)d(C);else{const[R,N]=te(C,p)||X(C,p)?[C,p]:[p,C],P={start:R,end:N};c||g(P),a==null||a(P),d(null),D(!1)}},E=()=>{f===0?(v(11),b(C=>C-1)):v(C=>C-1)},M=()=>{f===11?(v(0),b(C=>C+1)):v(C=>C+1)},k=p?{start:p,end:p}:u?{start:u.start,end:u.end}:void 0;return e.jsxs("div",{ref:j,style:{position:"relative",display:"inline-block",...l},children:[e.jsxs("button",{type:"button",disabled:r,onClick:()=>!r&&D(C=>!C),onFocus:()=>T(!0),onBlur:()=>T(!1),"aria-haspopup":"dialog","aria-expanded":S,style:{display:"inline-flex",alignItems:"center",gap:"var(--lucent-space-2)",padding:"var(--lucent-space-2) var(--lucent-space-3)",borderRadius:"var(--lucent-radius-md)",border:`1px solid ${q?"var(--lucent-accent-default)":"var(--lucent-border-default)"}`,background:r?"var(--lucent-surface-secondary)":"var(--lucent-surface)",color:u?"var(--lucent-text-primary)":"var(--lucent-text-secondary)",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-sm)",cursor:r?"not-allowed":"pointer",outline:q?"2px solid var(--lucent-focus-ring)":"none",outlineOffset:2,minWidth:220,transition:"border-color var(--lucent-duration-fast)"},children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,style:{flexShrink:0},children:[e.jsx("rect",{x:"1",y:"2",width:"12",height:"11",rx:"2",stroke:"currentColor",strokeWidth:"1.3"}),e.jsx("path",{d:"M1 6h12",stroke:"currentColor",strokeWidth:"1.3"}),e.jsx("path",{d:"M4 1v2M10 1v2",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]}),e.jsx("span",{style:{flex:1,textAlign:"left"},children:Hn(u,o)})]}),S&&e.jsxs("div",{role:"dialog","aria-label":"Date range picker",style:{position:"absolute",top:"calc(100% + 4px)",left:0,zIndex:1e3,background:"var(--lucent-surface-overlay)",border:"1px solid var(--lucent-border-default)",borderRadius:"var(--lucent-radius-lg)",boxShadow:"var(--lucent-shadow-md)",padding:"var(--lucent-space-4)",display:"flex",gap:"var(--lucent-space-6)"},children:[e.jsx("div",{style:{minWidth:220},children:e.jsx(ne,{year:y,month:f,...(u==null?void 0:u.start)!==void 0&&{selected:u.start},today:x,...i!==void 0&&{min:i},...s!==void 0&&{max:s},onSelect:F,onPrevMonth:E,onNextMonth:M,...k!==void 0&&{highlightRange:k}})}),e.jsx("div",{style:{width:1,background:"var(--lucent-border-subtle)",flexShrink:0}}),e.jsx("div",{style:{minWidth:220},children:e.jsx(ne,{year:w,month:I,...(u==null?void 0:u.end)!==void 0&&{selected:u.end},today:x,...i!==void 0&&{min:i},...s!==void 0&&{max:s},onSelect:F,onPrevMonth:E,onNextMonth:M,...k!==void 0&&{highlightRange:k}})})]}),p&&S&&e.jsx("div",{style:{position:"absolute",top:"calc(100% + 4px)",left:0,zIndex:1001,pointerEvents:"none"}}),p&&S&&e.jsx("div",{style:{position:"absolute",bottom:-24,left:0},children:e.jsx(z,{size:"xs",color:"secondary",children:"Now pick the end date"})})]})}const Un={id:"date-range-picker",name:"DateRangePicker",tier:"molecule",domain:"neutral",specVersion:"1.0",description:"A two-calendar date range picker. First click sets the start date, second click sets the end; the selected interval is highlighted across both calendars.",designIntent:'DateRangePicker composes two Calendar primitives from DatePicker side by side, advancing in lockstep (left = current month, right = next month). Selection is a two-click flow: first click anchors the start, a hint appears ("Now pick the end date"), second click resolves the range with automatic start/end ordering so users can click in either direction. The highlight range (accent-subtle background) spans both calendars to give clear visual feedback for the selected interval. Navigation (prev/next month) advances both calendars together to maintain the one-month-apart constraint.',props:[{name:"value",type:"object",required:!1,description:"Controlled DateRange { start: Date; end: Date }. When provided the component is fully controlled."},{name:"defaultValue",type:"object",required:!1,description:"Initial DateRange for uncontrolled usage."},{name:"onChange",type:"function",required:!1,description:"Called with the completed DateRange after the user picks both start and end."},{name:"placeholder",type:"string",required:!1,default:'"Pick a date range"',description:"Trigger button text when no range is selected."},{name:"disabled",type:"boolean",required:!1,default:"false",description:"Disables the trigger button and all interaction."},{name:"min",type:"object",required:!1,description:"Earliest selectable Date."},{name:"max",type:"object",required:!1,description:"Latest selectable Date."},{name:"style",type:"object",required:!1,description:"Inline style overrides for the outer wrapper."}],usageExamples:[{title:"Uncontrolled",code:"<DateRangePicker onChange={({ start, end }) => console.log(start, end)} />"},{title:"Controlled",code:`const [range, setRange] = useState<DateRange>();
308
- <DateRangePicker value={range} onChange={setRange} min={new Date()} />`}],compositionGraph:[{componentId:"date-picker",componentName:"DatePicker",role:"Calendar primitive (two instances, left and right)",required:!0},{componentId:"text",componentName:"Text",role:"Mid-selection hint and calendar headers",required:!0}],accessibility:{role:"dialog",ariaAttributes:["aria-haspopup","aria-expanded","aria-label","aria-pressed"],keyboardInteractions:["Enter/Space to open","Click first day to set start","Click second day to set end","Escape/click outside to cancel"],notes:'Inherits Calendar accessibility from DatePicker. The two-step selection flow is reinforced with a visible "Now pick the end date" hint.'}};function ae(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function _n(){return Math.random().toString(36).slice(2)}function Kn({item:t,onRemove:n}){const[a,o]=m.useState(!1),r=t.progress,i=!!t.error;return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--lucent-space-3)",padding:"var(--lucent-space-2) var(--lucent-space-3)",borderRadius:"var(--lucent-radius-md)",border:`1px solid ${i?"var(--lucent-danger-default)":"var(--lucent-border-default)"}`,background:"var(--lucent-surface)"},children:[e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,style:{flexShrink:0,color:"var(--lucent-text-secondary)"},children:[e.jsx("path",{d:"M5 2h7l4 4v12a1 1 0 01-1 1H5a1 1 0 01-1-1V3a1 1 0 011-1z",stroke:"currentColor",strokeWidth:"1.3"}),e.jsx("path",{d:"M12 2v4h4",stroke:"currentColor",strokeWidth:"1.3"})]}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx(z,{size:"sm",truncate:!0,children:t.file.name}),i?e.jsx(z,{size:"xs",color:"danger",children:t.error}):e.jsx(z,{size:"xs",color:"secondary",children:ae(t.file.size)}),r!==void 0&&!i&&e.jsx("div",{style:{marginTop:4,height:3,borderRadius:"var(--lucent-radius-full)",background:"var(--lucent-surface-secondary)",overflow:"hidden"},children:e.jsx("div",{style:{height:"100%",width:`${r}%`,borderRadius:"var(--lucent-radius-full)",background:r===100?"var(--lucent-success-default)":"var(--lucent-accent-default)",transition:"width 200ms var(--lucent-easing-default)"}})})]}),e.jsx("button",{type:"button",onClick:()=>n(t.id),onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),"aria-label":`Remove ${t.file.name}`,style:{flexShrink:0,display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,border:"none",borderRadius:"var(--lucent-radius-md)",background:a?"var(--lucent-surface-secondary)":"transparent",color:"var(--lucent-text-secondary)",cursor:"pointer",transition:"background var(--lucent-duration-fast)"},children:e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":!0,children:e.jsx("path",{d:"M2 2l8 8M10 2l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]})}function Yn({accept:t,multiple:n=!1,maxSize:a,value:o,onChange:r,onError:i,disabled:s=!1,style:l}){const c=o!==void 0,[h,g]=m.useState([]),u=c?o:h,[p,d]=m.useState(!1),[x,y]=m.useState(!1),b=m.useRef(null),f=m.useCallback(S=>{if(!S||s)return;const D=[];for(const T of Array.from(S)){if(a&&T.size>a){i==null||i(`"${T.name}" exceeds the ${ae(a)} limit.`);continue}if(!n&&u.length+D.length>=1)break;D.push({id:_n(),file:T})}if(D.length===0)return;const q=n?[...u,...D]:D;c||g(q),r==null||r(q)},[s,u,c,a,n,r,i]),v=S=>{const D=u.filter(q=>q.id!==S);c||g(D),r==null||r(D)},I=S=>{S.preventDefault(),d(!1),f(S.dataTransfer.files)},w=S=>{f(S.target.files),S.target.value=""};return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--lucent-space-3)",...l},children:[e.jsxs("div",{role:"button",tabIndex:s?-1:0,"aria-label":"Upload files","aria-disabled":s,onClick:()=>{var S;return!s&&((S=b.current)==null?void 0:S.click())},onKeyDown:S=>{var D;(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),(D=b.current)==null||D.click())},onFocus:()=>y(!0),onBlur:()=>y(!1),onDragOver:S=>{S.preventDefault(),s||d(!0)},onDragLeave:()=>d(!1),onDrop:I,style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"var(--lucent-space-2)",padding:"var(--lucent-space-8) var(--lucent-space-6)",borderRadius:"var(--lucent-radius-lg)",border:`2px dashed ${s?"var(--lucent-border-default)":p||x?"var(--lucent-accent-default)":"var(--lucent-border-default)"}`,background:p?"var(--lucent-accent-subtle)":"var(--lucent-surface-secondary)",cursor:s?"not-allowed":"pointer",transition:"border-color var(--lucent-duration-fast), background var(--lucent-duration-fast)",outline:"none"},children:[e.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none","aria-hidden":!0,style:{color:s?"var(--lucent-text-disabled)":p?"var(--lucent-accent-default)":"var(--lucent-text-secondary)"},children:[e.jsx("path",{d:"M16 20V10M16 10l-4 4M16 10l4 4",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M8 24h16",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]}),e.jsxs("div",{style:{textAlign:"center"},children:[e.jsx(z,{color:s?"disabled":"primary",weight:"medium",children:p?"Drop to upload":"Drop files here or click to browse"}),(t||a)&&e.jsx(z,{size:"xs",color:"secondary",children:[t&&`Accepted: ${t}`,a&&`Max size: ${ae(a)}`].filter(Boolean).join(" · ")})]}),e.jsx("input",{ref:b,type:"file",accept:t,multiple:n,disabled:s,onChange:w,style:{display:"none"},tabIndex:-1})]}),u.length>0&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--lucent-space-2)"},children:u.map(S=>e.jsx(Kn,{item:S,onRemove:v},S.id))})]})}const Xn={id:"file-upload",name:"FileUpload",tier:"molecule",domain:"neutral",specVersion:"1.0",description:"A drag-and-drop file upload zone with a file list, per-file progress bars, error display, and size/type validation.",designIntent:'FileUpload separates concerns between the drop zone (entry point) and the file list (status display). The drop zone uses a dashed border and an upload arrow icon to communicate droppability without words. Progress is modelled as a field on UploadFile rather than as a callback so the parent controls upload logic — this component is purely presentational for the upload state. The progress bar turns success-green at 100% to give clear completion feedback. Errors are shown inline on each file row (not as a toast) so the user knows exactly which file failed and why. The hidden <input type="file"> is triggered programmatically on click/keyboard so the drop zone can have a fully custom appearance.',props:[{name:"accept",type:"string",required:!1,description:'Accepted MIME types or extensions passed to the file input, e.g. "image/*,.pdf".'},{name:"multiple",type:"boolean",required:!1,default:"false",description:"Allow selecting multiple files at once."},{name:"maxSize",type:"number",required:!1,description:"Maximum file size in bytes. Files exceeding this trigger onError and are not added."},{name:"value",type:"array",required:!1,description:"Controlled array of UploadFile objects. Each has id, file (File), optional progress (0–100), and optional error string."},{name:"onChange",type:"function",required:!1,description:"Called with the updated UploadFile array after files are added or removed."},{name:"onError",type:"function",required:!1,description:"Called with an error message string when a file fails validation (e.g. exceeds maxSize)."},{name:"disabled",type:"boolean",required:!1,default:"false",description:"Disables the drop zone and all file interaction."},{name:"style",type:"object",required:!1,description:"Inline style overrides for the outer wrapper."}],usageExamples:[{title:"Uncontrolled multi-file upload",code:`<FileUpload
337
+ />`}],compositionGraph:[{componentId:"text",componentName:"Text",role:"Month/year header and weekday labels",required:!0}],accessibility:{role:"dialog",ariaAttributes:["aria-haspopup","aria-expanded","aria-label","aria-pressed"],keyboardInteractions:["Enter/Space to open calendar","Click day to select","Escape closes popover (click outside)"],notes:'The calendar popover is role="dialog". Each day button has aria-label with the full date and aria-pressed for selected state. Full arrow-key navigation within the calendar grid is a planned enhancement.'}};function Ea(t,n){return t?de(t.start,t.end)?te(t.start):`${te(t.start)} → ${te(t.end)}`:n}function Ra({value:t,defaultValue:n,onChange:a,placeholder:o="Pick a date range",disabled:r=!1,min:i,max:s,style:c}){const l=t!==void 0,[u,m]=f.useState(n),d=l?t:u,[g,p]=f.useState(null),x=new Date,[b,y]=f.useState(((d==null?void 0:d.start)??x).getFullYear()),[h,v]=f.useState(((d==null?void 0:d.start)??x).getMonth()),j=h===11?0:h+1,S=h===11?b+1:b,[T,z]=f.useState(!1),[q,w]=f.useState(!1),C=f.useRef(null);f.useEffect(()=>{if(!T)return;const D=B=>{var H;(H=C.current)!=null&&H.contains(B.target)||(z(!1),p(null))};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[T]);const V=D=>{if(!g)p(D);else{const[B,H]=ge(D,g)||de(D,g)?[D,g]:[g,D],O={start:B,end:H};l||m(O),a==null||a(O),p(null),z(!1)}},A=()=>{h===0?(v(11),y(D=>D-1)):v(D=>D-1)},M=()=>{h===11?(v(0),y(D=>D+1)):v(D=>D+1)},I=g?{start:g,end:g}:d?{start:d.start,end:d.end}:void 0;return e.jsxs("div",{ref:C,style:{position:"relative",display:"inline-block",...c},children:[e.jsxs("button",{type:"button",disabled:r,onClick:()=>!r&&z(D=>!D),onFocus:()=>w(!0),onBlur:()=>w(!1),"aria-haspopup":"dialog","aria-expanded":T,style:{display:"inline-flex",alignItems:"center",gap:"var(--lucent-space-2)",padding:"var(--lucent-space-2) var(--lucent-space-3)",borderRadius:"var(--lucent-radius-md)",border:`1px solid ${q?"var(--lucent-accent-default)":"var(--lucent-border-default)"}`,background:r?"var(--lucent-surface-secondary)":"var(--lucent-surface)",color:d?"var(--lucent-text-primary)":"var(--lucent-text-secondary)",fontFamily:"var(--lucent-font-family-base)",fontSize:"var(--lucent-font-size-sm)",cursor:r?"not-allowed":"pointer",outline:q?"2px solid var(--lucent-focus-ring)":"none",outlineOffset:2,minWidth:220,transition:"border-color var(--lucent-duration-fast)"},children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,style:{flexShrink:0},children:[e.jsx("rect",{x:"1",y:"2",width:"12",height:"11",rx:"2",stroke:"currentColor",strokeWidth:"1.3"}),e.jsx("path",{d:"M1 6h12",stroke:"currentColor",strokeWidth:"1.3"}),e.jsx("path",{d:"M4 1v2M10 1v2",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]}),e.jsx("span",{style:{flex:1,textAlign:"left"},children:Ea(d,o)})]}),T&&e.jsxs("div",{role:"dialog","aria-label":"Date range picker",style:{position:"absolute",top:"calc(100% + 4px)",left:0,zIndex:1e3,background:"var(--lucent-surface-overlay)",border:"1px solid var(--lucent-border-default)",borderRadius:"var(--lucent-radius-lg)",boxShadow:"var(--lucent-shadow-md)",padding:"var(--lucent-space-4)",display:"flex",gap:"var(--lucent-space-6)"},children:[e.jsx("div",{style:{minWidth:220},children:e.jsx(be,{year:b,month:h,...(d==null?void 0:d.start)!==void 0&&{selected:d.start},today:x,...i!==void 0&&{min:i},...s!==void 0&&{max:s},onSelect:V,onPrevMonth:A,onNextMonth:M,...I!==void 0&&{highlightRange:I}})}),e.jsx("div",{style:{width:1,background:"var(--lucent-border-subtle)",flexShrink:0}}),e.jsx("div",{style:{minWidth:220},children:e.jsx(be,{year:S,month:j,...(d==null?void 0:d.end)!==void 0&&{selected:d.end},today:x,...i!==void 0&&{min:i},...s!==void 0&&{max:s},onSelect:V,onPrevMonth:A,onNextMonth:M,...I!==void 0&&{highlightRange:I}})})]}),g&&T&&e.jsx("div",{style:{position:"absolute",top:"calc(100% + 4px)",left:0,zIndex:1001,pointerEvents:"none"}}),g&&T&&e.jsx("div",{style:{position:"absolute",bottom:-24,left:0},children:e.jsx(R,{size:"xs",color:"secondary",children:"Now pick the end date"})})]})}const qa={id:"date-range-picker",name:"DateRangePicker",tier:"molecule",domain:"neutral",specVersion:"1.0",description:"A two-calendar date range picker. First click sets the start date, second click sets the end; the selected interval is highlighted across both calendars.",designIntent:'DateRangePicker composes two Calendar primitives from DatePicker side by side, advancing in lockstep (left = current month, right = next month). Selection is a two-click flow: first click anchors the start, a hint appears ("Now pick the end date"), second click resolves the range with automatic start/end ordering so users can click in either direction. The highlight range (accent-subtle background) spans both calendars to give clear visual feedback for the selected interval. Navigation (prev/next month) advances both calendars together to maintain the one-month-apart constraint.',props:[{name:"value",type:"object",required:!1,description:"Controlled DateRange { start: Date; end: Date }. When provided the component is fully controlled."},{name:"defaultValue",type:"object",required:!1,description:"Initial DateRange for uncontrolled usage."},{name:"onChange",type:"function",required:!1,description:"Called with the completed DateRange after the user picks both start and end."},{name:"placeholder",type:"string",required:!1,default:'"Pick a date range"',description:"Trigger button text when no range is selected."},{name:"disabled",type:"boolean",required:!1,default:"false",description:"Disables the trigger button and all interaction."},{name:"min",type:"object",required:!1,description:"Earliest selectable Date."},{name:"max",type:"object",required:!1,description:"Latest selectable Date."},{name:"style",type:"object",required:!1,description:"Inline style overrides for the outer wrapper."}],usageExamples:[{title:"Uncontrolled",code:"<DateRangePicker onChange={({ start, end }) => console.log(start, end)} />"},{title:"Controlled",code:`const [range, setRange] = useState<DateRange>();
338
+ <DateRangePicker value={range} onChange={setRange} min={new Date()} />`}],compositionGraph:[{componentId:"date-picker",componentName:"DatePicker",role:"Calendar primitive (two instances, left and right)",required:!0},{componentId:"text",componentName:"Text",role:"Mid-selection hint and calendar headers",required:!0}],accessibility:{role:"dialog",ariaAttributes:["aria-haspopup","aria-expanded","aria-label","aria-pressed"],keyboardInteractions:["Enter/Space to open","Click first day to set start","Click second day to set end","Escape/click outside to cancel"],notes:'Inherits Calendar accessibility from DatePicker. The two-step selection flow is reinforced with a visible "Now pick the end date" hint.'}};function ve(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function La(){return Math.random().toString(36).slice(2)}function Ba({item:t,onRemove:n}){const[a,o]=f.useState(!1),r=t.progress,i=!!t.error;return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--lucent-space-3)",padding:"var(--lucent-space-2) var(--lucent-space-3)",borderRadius:"var(--lucent-radius-md)",border:`1px solid ${i?"var(--lucent-danger-default)":"var(--lucent-border-default)"}`,background:"var(--lucent-surface)"},children:[e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,style:{flexShrink:0,color:"var(--lucent-text-secondary)"},children:[e.jsx("path",{d:"M5 2h7l4 4v12a1 1 0 01-1 1H5a1 1 0 01-1-1V3a1 1 0 011-1z",stroke:"currentColor",strokeWidth:"1.3"}),e.jsx("path",{d:"M12 2v4h4",stroke:"currentColor",strokeWidth:"1.3"})]}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx(R,{size:"sm",truncate:!0,children:t.file.name}),i?e.jsx(R,{size:"xs",color:"danger",children:t.error}):e.jsx(R,{size:"xs",color:"secondary",children:ve(t.file.size)}),r!==void 0&&!i&&e.jsx("div",{style:{marginTop:4,height:3,borderRadius:"var(--lucent-radius-full)",background:"var(--lucent-surface-secondary)",overflow:"hidden"},children:e.jsx("div",{style:{height:"100%",width:`${r}%`,borderRadius:"var(--lucent-radius-full)",background:r===100?"var(--lucent-success-default)":"var(--lucent-accent-default)",transition:"width 200ms var(--lucent-easing-default)"}})})]}),e.jsx("button",{type:"button",onClick:()=>n(t.id),onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),"aria-label":`Remove ${t.file.name}`,style:{flexShrink:0,display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,border:"none",borderRadius:"var(--lucent-radius-md)",background:a?"var(--lucent-surface-secondary)":"transparent",color:"var(--lucent-text-secondary)",cursor:"pointer",transition:"background var(--lucent-duration-fast)"},children:e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":!0,children:e.jsx("path",{d:"M2 2l8 8M10 2l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]})}function Fa({accept:t,multiple:n=!1,maxSize:a,value:o,onChange:r,onError:i,disabled:s=!1,style:c}){const l=o!==void 0,[u,m]=f.useState([]),d=l?o:u,[g,p]=f.useState(!1),[x,b]=f.useState(!1),y=f.useRef(null),h=f.useCallback(T=>{if(!T||s)return;const z=[];for(const w of Array.from(T)){if(a&&w.size>a){i==null||i(`"${w.name}" exceeds the ${ve(a)} limit.`);continue}if(!n&&d.length+z.length>=1)break;z.push({id:La(),file:w})}if(z.length===0)return;const q=n?[...d,...z]:z;l||m(q),r==null||r(q)},[s,d,l,a,n,r,i]),v=T=>{const z=d.filter(q=>q.id!==T);l||m(z),r==null||r(z)},j=T=>{T.preventDefault(),p(!1),h(T.dataTransfer.files)},S=T=>{h(T.target.files),T.target.value=""};return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--lucent-space-3)",...c},children:[e.jsxs("div",{role:"button",tabIndex:s?-1:0,"aria-label":"Upload files","aria-disabled":s,onClick:()=>{var T;return!s&&((T=y.current)==null?void 0:T.click())},onKeyDown:T=>{var z;(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),(z=y.current)==null||z.click())},onFocus:()=>b(!0),onBlur:()=>b(!1),onDragOver:T=>{T.preventDefault(),s||p(!0)},onDragLeave:()=>p(!1),onDrop:j,style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"var(--lucent-space-2)",padding:"var(--lucent-space-8) var(--lucent-space-6)",borderRadius:"var(--lucent-radius-lg)",border:`2px dashed ${s?"var(--lucent-border-default)":g||x?"var(--lucent-accent-default)":"var(--lucent-border-default)"}`,background:g?"var(--lucent-accent-subtle)":"var(--lucent-surface-secondary)",cursor:s?"not-allowed":"pointer",transition:"border-color var(--lucent-duration-fast), background var(--lucent-duration-fast)",outline:"none"},children:[e.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none","aria-hidden":!0,style:{color:s?"var(--lucent-text-disabled)":g?"var(--lucent-accent-default)":"var(--lucent-text-secondary)"},children:[e.jsx("path",{d:"M16 20V10M16 10l-4 4M16 10l4 4",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M8 24h16",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]}),e.jsxs("div",{style:{textAlign:"center"},children:[e.jsx(R,{color:s?"disabled":"primary",weight:"medium",children:g?"Drop to upload":"Drop files here or click to browse"}),(t||a)&&e.jsx(R,{size:"xs",color:"secondary",children:[t&&`Accepted: ${t}`,a&&`Max size: ${ve(a)}`].filter(Boolean).join(" · ")})]}),e.jsx("input",{ref:y,type:"file",accept:t,multiple:n,disabled:s,onChange:S,style:{display:"none"},tabIndex:-1})]}),d.length>0&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--lucent-space-2)"},children:d.map(T=>e.jsx(Ba,{item:T,onRemove:v},T.id))})]})}const Na={id:"file-upload",name:"FileUpload",tier:"molecule",domain:"neutral",specVersion:"1.0",description:"A drag-and-drop file upload zone with a file list, per-file progress bars, error display, and size/type validation.",designIntent:'FileUpload separates concerns between the drop zone (entry point) and the file list (status display). The drop zone uses a dashed border and an upload arrow icon to communicate droppability without words. Progress is modelled as a field on UploadFile rather than as a callback so the parent controls upload logic — this component is purely presentational for the upload state. The progress bar turns success-green at 100% to give clear completion feedback. Errors are shown inline on each file row (not as a toast) so the user knows exactly which file failed and why. The hidden <input type="file"> is triggered programmatically on click/keyboard so the drop zone can have a fully custom appearance.',props:[{name:"accept",type:"string",required:!1,description:'Accepted MIME types or extensions passed to the file input, e.g. "image/*,.pdf".'},{name:"multiple",type:"boolean",required:!1,default:"false",description:"Allow selecting multiple files at once."},{name:"maxSize",type:"number",required:!1,description:"Maximum file size in bytes. Files exceeding this trigger onError and are not added."},{name:"value",type:"array",required:!1,description:"Controlled array of UploadFile objects. Each has id, file (File), optional progress (0–100), and optional error string."},{name:"onChange",type:"function",required:!1,description:"Called with the updated UploadFile array after files are added or removed."},{name:"onError",type:"function",required:!1,description:"Called with an error message string when a file fails validation (e.g. exceeds maxSize)."},{name:"disabled",type:"boolean",required:!1,default:"false",description:"Disables the drop zone and all file interaction."},{name:"style",type:"object",required:!1,description:"Inline style overrides for the outer wrapper."}],usageExamples:[{title:"Uncontrolled multi-file upload",code:`<FileUpload
309
339
  multiple
310
340
  accept="image/*,.pdf"
311
341
  maxSize={5 * 1024 * 1024}
@@ -324,7 +354,7 @@ const handleChange = async (updated: UploadFile[]) => {
324
354
  }
325
355
  };
326
356
 
327
- <FileUpload value={files} onChange={handleChange} multiple />`}],compositionGraph:[{componentId:"text",componentName:"Text",role:"Drop zone label, file name, file size, and error messages",required:!0}],accessibility:{role:"button",ariaAttributes:["aria-label","aria-disabled"],keyboardInteractions:["Enter/Space to open file picker","Tab to focus drop zone"],notes:'The drop zone has role="button" with tabIndex=0 and responds to Enter/Space. Remove buttons on file rows have aria-label including the filename.'}},Jn={default:"var(--lucent-border-strong)",success:"var(--lucent-success-default)",warning:"var(--lucent-warning-default)",danger:"var(--lucent-danger-default)",info:"var(--lucent-info-default)"},Qn={default:"var(--lucent-surface-secondary)",success:"var(--lucent-success-subtle)",warning:"var(--lucent-warning-subtle)",danger:"var(--lucent-danger-subtle)",info:"var(--lucent-info-subtle)"};function Zn({status:t}){return t==="success"?e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":!0,children:e.jsx("path",{d:"M2 5l2 2 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}):t==="danger"?e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":!0,children:e.jsx("path",{d:"M2 2l6 6M8 2L2 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}):t==="warning"?e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":!0,children:e.jsx("path",{d:"M5 2v4M5 7.5v.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}):null}function ea({items:t,style:n}){return e.jsx("ol",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",...n},children:t.map((a,o)=>{const r=a.status??"default",i=Jn[r],s=Qn[r],l=o===t.length-1;return e.jsxs("li",{style:{display:"flex",gap:"var(--lucent-space-4)",position:"relative"},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",flexShrink:0,width:28},children:[e.jsx("div",{style:{width:28,height:28,borderRadius:"var(--lucent-radius-full)",border:`2px solid ${i}`,background:s,display:"flex",alignItems:"center",justifyContent:"center",color:i,flexShrink:0,zIndex:1},children:a.icon??e.jsx(Zn,{status:r})}),!l&&e.jsx("div",{style:{flex:1,width:2,background:"var(--lucent-border-subtle)",minHeight:"var(--lucent-space-4)",margin:"2px 0"}})]}),e.jsxs("div",{style:{flex:1,paddingBottom:l?0:"var(--lucent-space-6)",paddingTop:4},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:"var(--lucent-space-3)",flexWrap:"wrap"},children:[e.jsx(z,{weight:"medium",size:"sm",children:a.title}),a.date&&e.jsx(z,{size:"xs",color:"secondary",children:a.date})]}),a.description&&e.jsx("div",{style:{marginTop:"var(--lucent-space-1)"},children:e.jsx(z,{size:"sm",color:"secondary",children:a.description})})]})]},a.id)})})}const ta={id:"timeline",name:"Timeline",tier:"molecule",domain:"neutral",specVersion:"1.0",description:"A vertical ordered event list with status-colored dots, connector lines, optional dates, and custom icons.",designIntent:"Timeline renders as a semantic <ol> with each event as a <li>, preserving document order for assistive technologies. The dot and connector are rendered in a fixed-width left column so content in the right column can wrap freely without misaligning the spine. The connector line is omitted on the last item — there is nothing to connect to. Status colors follow the same semantic token set as Alert and Badge so danger/success/warning/info carry consistent meaning across the design system. Default status (no explicit icon) renders a plain dot; success/danger/warning get built-in iconography inside the dot. Custom icons slot in via the icon prop to handle domain-specific event types (e.g. a deploy icon, a payment icon).",props:[{name:"items",type:"array",required:!0,description:"Array of TimelineItem objects. Each has id, title, optional description, optional date string, optional status, and optional icon."},{name:"style",type:"object",required:!1,description:"Inline style overrides for the outer <ol> wrapper."}],usageExamples:[{title:"Basic event log",code:`<Timeline
357
+ <FileUpload value={files} onChange={handleChange} multiple />`}],compositionGraph:[{componentId:"text",componentName:"Text",role:"Drop zone label, file name, file size, and error messages",required:!0}],accessibility:{role:"button",ariaAttributes:["aria-label","aria-disabled"],keyboardInteractions:["Enter/Space to open file picker","Tab to focus drop zone"],notes:'The drop zone has role="button" with tabIndex=0 and responds to Enter/Space. Remove buttons on file rows have aria-label including the filename.'}},Pa={default:"var(--lucent-border-strong)",success:"var(--lucent-success-default)",warning:"var(--lucent-warning-default)",danger:"var(--lucent-danger-default)",info:"var(--lucent-info-default)"},$a={default:"var(--lucent-surface-secondary)",success:"var(--lucent-success-subtle)",warning:"var(--lucent-warning-subtle)",danger:"var(--lucent-danger-subtle)",info:"var(--lucent-info-subtle)"};function Wa({status:t}){return t==="success"?e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":!0,children:e.jsx("path",{d:"M2 5l2 2 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}):t==="danger"?e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":!0,children:e.jsx("path",{d:"M2 2l6 6M8 2L2 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}):t==="warning"?e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":!0,children:e.jsx("path",{d:"M5 2v4M5 7.5v.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}):null}function Va({items:t,style:n}){return e.jsx("ol",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",...n},children:t.map((a,o)=>{const r=a.status??"default",i=Pa[r],s=$a[r],c=o===t.length-1;return e.jsxs("li",{style:{display:"flex",gap:"var(--lucent-space-4)",position:"relative"},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",flexShrink:0,width:28},children:[e.jsx("div",{style:{width:28,height:28,borderRadius:"var(--lucent-radius-full)",border:`2px solid ${i}`,background:s,display:"flex",alignItems:"center",justifyContent:"center",color:i,flexShrink:0,zIndex:1},children:a.icon??e.jsx(Wa,{status:r})}),!c&&e.jsx("div",{style:{flex:1,width:2,background:"var(--lucent-border-subtle)",minHeight:"var(--lucent-space-4)",margin:"2px 0"}})]}),e.jsxs("div",{style:{flex:1,paddingBottom:c?0:"var(--lucent-space-6)",paddingTop:4},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:"var(--lucent-space-3)",flexWrap:"wrap"},children:[e.jsx(R,{weight:"medium",size:"sm",children:a.title}),a.date&&e.jsx(R,{size:"xs",color:"secondary",children:a.date})]}),a.description&&e.jsx("div",{style:{marginTop:"var(--lucent-space-1)"},children:e.jsx(R,{size:"sm",color:"secondary",children:a.description})})]})]},a.id)})})}const Ha={id:"timeline",name:"Timeline",tier:"molecule",domain:"neutral",specVersion:"1.0",description:"A vertical ordered event list with status-colored dots, connector lines, optional dates, and custom icons.",designIntent:"Timeline renders as a semantic <ol> with each event as a <li>, preserving document order for assistive technologies. The dot and connector are rendered in a fixed-width left column so content in the right column can wrap freely without misaligning the spine. The connector line is omitted on the last item — there is nothing to connect to. Status colors follow the same semantic token set as Alert and Badge so danger/success/warning/info carry consistent meaning across the design system. Default status (no explicit icon) renders a plain dot; success/danger/warning get built-in iconography inside the dot. Custom icons slot in via the icon prop to handle domain-specific event types (e.g. a deploy icon, a payment icon).",props:[{name:"items",type:"array",required:!0,description:"Array of TimelineItem objects. Each has id, title, optional description, optional date string, optional status, and optional icon."},{name:"style",type:"object",required:!1,description:"Inline style overrides for the outer <ol> wrapper."}],usageExamples:[{title:"Basic event log",code:`<Timeline
328
358
  items={[
329
359
  { id: '1', title: 'Order placed', date: 'Mar 1, 2026', status: 'success' },
330
360
  { id: '2', title: 'Payment processed', date: 'Mar 1, 2026', status: 'success' },
@@ -337,11 +367,11 @@ const handleChange = async (updated: UploadFile[]) => {
337
367
  { id: 'review', title: 'PR #47 merged', icon: <GitMergeIcon />, date: '3h ago' },
338
368
  { id: 'alert', title: 'Error rate spike', status: 'warning', icon: <AlertIcon />, date: '4h ago' },
339
369
  ]}
340
- />`}],compositionGraph:[{componentId:"text",componentName:"Text",role:"Event title, description, and date label",required:!0}],accessibility:{role:"list",ariaAttributes:[],keyboardInteractions:["Standard document flow — no interactive elements unless custom icons include them"],notes:"Timeline is a semantic <ol> with <li> items. It is non-interactive by default. If items contain interactive elements (links, buttons), those elements carry their own keyboard behaviour."}},na={fontFamilyBase:'"DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontFamilyMono:'"DM Mono", "Fira Code", "Cascadia Code", monospace',fontFamilyDisplay:'"Georama", "DM Sans", sans-serif',fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.25rem",fontSize2xl:"1.5rem",fontSize3xl:"1.875rem",fontWeightRegular:"400",fontWeightMedium:"500",fontWeightSemibold:"600",fontWeightBold:"700",lineHeightTight:"1.25",lineHeightBase:"1.5",lineHeightRelaxed:"1.75",letterSpacingTight:"-0.02em",letterSpacingBase:"0em",letterSpacingWide:"0.04em"},aa={space0:"0px",space1:"0.25rem",space2:"0.5rem",space3:"0.75rem",space4:"1rem",space5:"1.25rem",space6:"1.5rem",space8:"2rem",space10:"2.5rem",space12:"3rem",space16:"4rem",space20:"5rem",space24:"6rem"},ra={radiusNone:"0px",radiusSm:"0.25rem",radiusMd:"0.375rem",radiusLg:"0.5rem",radiusXl:"0.75rem",radiusFull:"9999px"},oa={durationFast:"100ms",durationBase:"200ms",durationSlow:"350ms",easingDefault:"cubic-bezier(0.4, 0, 0.2, 1)",easingEmphasized:"cubic-bezier(0.2, 0, 0, 1)",easingDecelerate:"cubic-bezier(0, 0, 0.2, 1)"},ia={shadowNone:"none",shadowSm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",shadowMd:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",shadowLg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",shadowXl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)"},sa={shadowNone:"none",shadowSm:"0 1px 2px 0 rgb(0 0 0 / 0.3)",shadowMd:"0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4)",shadowLg:"0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4)",shadowXl:"0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.5)"},U={...na,...aa,...ra,...oa,...ia,bgBase:"#ffffff",bgSubtle:"#f9fafb",bgOverlay:"rgb(0 0 0 / 0.4)",surface:"#ffffff",surfaceSecondary:"#f3f4f6",surfaceRaised:"#ffffff",surfaceOverlay:"#ffffff",borderDefault:"#e5e7eb",borderSubtle:"#f3f4f6",borderStrong:"#9ca3af",textPrimary:"#111827",textSecondary:"#6b7280",textDisabled:"#9ca3af",textInverse:"#ffffff",textOnAccent:"#ffffff",accentDefault:"#111827",accentHover:"#1f2937",accentActive:"#374151",accentSubtle:"#f3f4f6",accentBorder:"#111827",successDefault:"#16a34a",successSubtle:"#f0fdf4",successText:"#15803d",warningDefault:"#d97706",warningSubtle:"#fffbeb",warningText:"#b45309",dangerDefault:"#dc2626",dangerHover:"#b91c1c",dangerSubtle:"#fef2f2",dangerText:"#b91c1c",infoDefault:"#2563eb",infoSubtle:"#eff6ff",infoText:"#1d4ed8",focusRing:"#111827"};function la(t){const n=parseInt(t.slice(1,3),16),a=parseInt(t.slice(3,5),16),o=parseInt(t.slice(5,7),16);return{r:n,g:a,b:o}}function ca({r:t,g:n,b:a}){const o=r=>r.toString(16).padStart(2,"0");return`#${o(t)}${o(n)}${o(a)}`}function $(t){const{r:n,g:a,b:o}=la(t),r=n/255,i=a/255,s=o/255,l=Math.max(r,i,s),c=Math.min(r,i,s);let h=0,g=0;const u=(l+c)/2;if(l!==c){const p=l-c;switch(g=u>.5?p/(2-l-c):p/(l+c),l){case r:h=(i-s)/p+(i<s?6:0);break;case i:h=(s-r)/p+2;break;case s:h=(r-i)/p+4;break}h/=6}return[h*360,g,u]}function W(t,n,a){t=(t%360+360)%360,n=Math.min(1,Math.max(0,n)),a=Math.min(1,Math.max(0,a));const o=(1-Math.abs(2*a-1))*n,r=o*(1-Math.abs(t/60%2-1)),i=a-o/2;let s=0,l=0,c=0;return t<60?(s=o,l=r):t<120?(s=r,l=o):t<180?(l=o,c=r):t<240?(l=r,c=o):t<300?(s=r,c=o):(s=o,c=r),ca({r:Math.round((s+i)*255),g:Math.round((l+i)*255),b:Math.round((c+i)*255)})}function A(t,n){const[a,o,r]=$(t);return W(a,o,Math.min(1,Math.max(0,r+n)))}const da=222,ua=.12;function xe(t,n){return n<.04?[da,ua]:[t,n]}function pa(t){const[n,a,o]=$(t),[r,i]=xe(n,a);return W(r,i,Math.max(.04,Math.min(.2,.07+(1-o))))}function Z(t){const[n,a,o]=$(t),[r,i]=xe(n,a);return W(r,i,Math.max(.06,Math.min(.5,(1-o)*.6+.06)))}function ee(t){const[n,a,o]=$(t);return W(n,a,Math.max(.04,Math.min(.97,1-o+.04)))}function H(t){const[n,a,o]=$(t);return W(n,a,Math.max(.02,Math.min(.98,1-o)))}function we(t){const n=pa(t.bgBase),[a,o,r]=$(n),i=s=>W(a,o,Math.min(.25,r+s));return{...t,...sa,bgBase:n,bgSubtle:i(.02),bgOverlay:"rgb(0 0 0 / 0.6)",surface:i(.02),surfaceSecondary:i(.05),surfaceRaised:i(.08),surfaceOverlay:i(.08),borderDefault:Z(t.borderDefault),borderSubtle:Z(t.borderSubtle),borderStrong:Z(t.borderStrong),textPrimary:ee(t.textPrimary),textSecondary:ee(t.textSecondary),textDisabled:ee(t.textDisabled),textInverse:n,textOnAccent:t.textOnAccent,accentDefault:H(t.accentDefault),accentHover:H(t.accentHover),accentActive:H(t.accentActive),accentSubtle:H(t.accentSubtle),accentBorder:t.accentBorder,successDefault:A(t.successDefault,.1),successSubtle:A(t.successDefault,-.25),successText:A(t.successText,.15),warningDefault:A(t.warningDefault,.1),warningSubtle:A(t.warningDefault,-.25),warningText:A(t.warningText,.15),dangerDefault:A(t.dangerDefault,.1),dangerHover:A(t.dangerHover,.1),dangerSubtle:A(t.dangerDefault,-.25),dangerText:A(t.dangerText,.15),infoDefault:A(t.infoDefault,.1),infoSubtle:A(t.infoDefault,-.25),infoText:A(t.infoText,.15),focusRing:H(t.focusRing)}}const ie=we(U);function fa(t){return"--lucent-"+t.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`).replace(/([a-z])(\d)/g,(n,a,o)=>`${a}-${o}`)}function ke(t,n=":root"){const a=Object.entries(t).map(([o,r])=>` ${fa(o)}: ${r};`).join(`
370
+ />`}],compositionGraph:[{componentId:"text",componentName:"Text",role:"Event title, description, and date label",required:!0}],accessibility:{role:"list",ariaAttributes:[],keyboardInteractions:["Standard document flow — no interactive elements unless custom icons include them"],notes:"Timeline is a semantic <ol> with <li> items. It is non-interactive by default. If items contain interactive elements (links, buttons), those elements carry their own keyboard behaviour."}},Oa={fontFamilyBase:'"DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontFamilyMono:'"DM Mono", "Fira Code", "Cascadia Code", monospace',fontFamilyDisplay:'"Georama", "DM Sans", sans-serif',fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.25rem",fontSize2xl:"1.5rem",fontSize3xl:"1.875rem",fontWeightRegular:"400",fontWeightMedium:"500",fontWeightSemibold:"600",fontWeightBold:"700",lineHeightTight:"1.25",lineHeightBase:"1.5",lineHeightRelaxed:"1.75",letterSpacingTight:"-0.02em",letterSpacingBase:"0em",letterSpacingWide:"0.04em"},Ga={space0:"0px",space1:"0.25rem",space2:"0.5rem",space3:"0.75rem",space4:"1rem",space5:"1.25rem",space6:"1.5rem",space8:"2rem",space10:"2.5rem",space12:"3rem",space16:"4rem",space20:"5rem",space24:"6rem"},Ua={radiusNone:"0px",radiusSm:"0.25rem",radiusMd:"0.375rem",radiusLg:"0.5rem",radiusXl:"0.75rem",radiusFull:"9999px"},_a={durationFast:"100ms",durationBase:"200ms",durationSlow:"350ms",easingDefault:"cubic-bezier(0.4, 0, 0.2, 1)",easingEmphasized:"cubic-bezier(0.2, 0, 0, 1)",easingDecelerate:"cubic-bezier(0, 0, 0.2, 1)"},Ka={shadowNone:"none",shadowSm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",shadowMd:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",shadowLg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",shadowXl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)"},Ya={shadowNone:"none",shadowSm:"0 1px 2px 0 rgb(0 0 0 / 0.3)",shadowMd:"0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4)",shadowLg:"0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4)",shadowXl:"0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.5)"},ne={...Oa,...Ga,...Ua,..._a,...Ka,bgBase:"#ffffff",bgSubtle:"#f9fafb",bgOverlay:"rgb(0 0 0 / 0.4)",surface:"#ffffff",surfaceSecondary:"#f3f4f6",surfaceRaised:"#ffffff",surfaceOverlay:"#ffffff",borderDefault:"#e5e7eb",borderSubtle:"#f3f4f6",borderStrong:"#9ca3af",textPrimary:"#111827",textSecondary:"#6b7280",textDisabled:"#9ca3af",textInverse:"#ffffff",textOnAccent:"#ffffff",accentDefault:"#111827",accentHover:"#1f2937",accentActive:"#374151",accentSubtle:"#f3f4f6",accentBorder:"#111827",successDefault:"#16a34a",successSubtle:"#f0fdf4",successText:"#15803d",warningDefault:"#d97706",warningSubtle:"#fffbeb",warningText:"#b45309",dangerDefault:"#dc2626",dangerHover:"#b91c1c",dangerSubtle:"#fef2f2",dangerText:"#b91c1c",infoDefault:"#2563eb",infoSubtle:"#eff6ff",infoText:"#1d4ed8",focusRing:"#111827"};function Xa(t){const n=parseInt(t.slice(1,3),16),a=parseInt(t.slice(3,5),16),o=parseInt(t.slice(5,7),16);return{r:n,g:a,b:o}}function Ja({r:t,g:n,b:a}){const o=r=>r.toString(16).padStart(2,"0");return`#${o(t)}${o(n)}${o(a)}`}function K(t){const{r:n,g:a,b:o}=Xa(t),r=n/255,i=a/255,s=o/255,c=Math.max(r,i,s),l=Math.min(r,i,s);let u=0,m=0;const d=(c+l)/2;if(c!==l){const g=c-l;switch(m=d>.5?g/(2-c-l):g/(c+l),c){case r:u=(i-s)/g+(i<s?6:0);break;case i:u=(s-r)/g+2;break;case s:u=(r-i)/g+4;break}u/=6}return[u*360,m,d]}function Y(t,n,a){t=(t%360+360)%360,n=Math.min(1,Math.max(0,n)),a=Math.min(1,Math.max(0,a));const o=(1-Math.abs(2*a-1))*n,r=o*(1-Math.abs(t/60%2-1)),i=a-o/2;let s=0,c=0,l=0;return t<60?(s=o,c=r):t<120?(s=r,c=o):t<180?(c=o,l=r):t<240?(c=r,l=o):t<300?(s=r,l=o):(s=o,l=r),Ja({r:Math.round((s+i)*255),g:Math.round((c+i)*255),b:Math.round((l+i)*255)})}function L(t,n){const[a,o,r]=K(t);return Y(a,o,Math.min(1,Math.max(0,r+n)))}const Za=222,Qa=.12;function Ue(t,n){return n<.04?[Za,Qa]:[t,n]}function er(t){const[n,a,o]=K(t),[r,i]=Ue(n,a);return Y(r,i,Math.max(.04,Math.min(.2,.07+(1-o))))}function fe(t){const[n,a,o]=K(t),[r,i]=Ue(n,a);return Y(r,i,Math.max(.06,Math.min(.5,(1-o)*.6+.06)))}function he(t){const[n,a,o]=K(t);return Y(n,a,Math.max(.04,Math.min(.97,1-o+.04)))}function Q(t){const[n,a,o]=K(t);return Y(n,a,Math.max(.02,Math.min(.98,1-o)))}function _e(t){const n=er(t.bgBase),[a,o,r]=K(n),i=s=>Y(a,o,Math.min(.25,r+s));return{...t,...Ya,bgBase:n,bgSubtle:i(.02),bgOverlay:"rgb(0 0 0 / 0.6)",surface:i(.02),surfaceSecondary:i(.05),surfaceRaised:i(.08),surfaceOverlay:i(.08),borderDefault:fe(t.borderDefault),borderSubtle:fe(t.borderSubtle),borderStrong:fe(t.borderStrong),textPrimary:he(t.textPrimary),textSecondary:he(t.textSecondary),textDisabled:he(t.textDisabled),textInverse:n,textOnAccent:t.textOnAccent,accentDefault:Q(t.accentDefault),accentHover:Q(t.accentHover),accentActive:Q(t.accentActive),accentSubtle:Q(t.accentSubtle),accentBorder:t.accentBorder,successDefault:L(t.successDefault,.1),successSubtle:L(t.successDefault,-.25),successText:L(t.successText,.15),warningDefault:L(t.warningDefault,.1),warningSubtle:L(t.warningDefault,-.25),warningText:L(t.warningText,.15),dangerDefault:L(t.dangerDefault,.1),dangerHover:L(t.dangerHover,.1),dangerSubtle:L(t.dangerDefault,-.25),dangerText:L(t.dangerText,.15),infoDefault:L(t.infoDefault,.1),infoSubtle:L(t.infoDefault,-.25),infoText:L(t.infoText,.15),focusRing:Q(t.focusRing)}}const Te=_e(ne);function tr(t){return"--lucent-"+t.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`).replace(/([a-z])(\d)/g,(n,a,o)=>`${a}-${o}`)}function Ke(t,n=":root"){const a=Object.entries(t).map(([o,r])=>` ${tr(o)}: ${r};`).join(`
341
371
  `);return`${n} {
342
372
  ${a}
343
- }`}function ha(t){const n=parseInt(t.slice(1,3),16)/255,a=parseInt(t.slice(3,5),16)/255,o=parseInt(t.slice(5,7),16)/255,r=i=>i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4);return .2126*r(n)+.7152*r(a)+.0722*r(o)}function se(t){return ha(t)<.179?"#ffffff":"#000000"}const J={subtle:{light:.95,dark:.12},text:{light:.28,dark:.78}};function K(t,n){const[a,o]=$(t);return W(a,o*.5,n?J.subtle.light:J.subtle.dark)}function Y(t,n){const[a,o]=$(t);return W(a,o,n?J.text.light:J.text.dark)}function le(t,n,a){const o={},r=a==="light";return"borderDefault"in t&&("borderSubtle"in t||(o.borderSubtle=A(n.borderDefault,r?.05:-.02)),"borderStrong"in t||(o.borderStrong=A(n.borderDefault,r?-.27:.19))),"bgBase"in t&&("bgSubtle"in t||(o.bgSubtle=A(n.bgBase,r?-.02:.02))),"surface"in t&&("surfaceSecondary"in t||(o.surfaceSecondary=A(n.surface,r?-.04:.03)),"surfaceRaised"in t||(o.surfaceRaised=A(n.surface,r?0:.06)),"surfaceOverlay"in t||(o.surfaceOverlay=A(n.surface,r?0:.06))),"textPrimary"in t&&("textSecondary"in t||(o.textSecondary=A(n.textPrimary,r?.2:-.15)),"textDisabled"in t||(o.textDisabled=A(n.textPrimary,r?.35:-.4))),"accentDefault"in t&&("accentHover"in t||(o.accentHover=A(n.accentDefault,r?.05:-.07)),"accentActive"in t||(o.accentActive=A(n.accentDefault,r?.13:-.14)),"accentSubtle"in t||(o.accentSubtle=A(n.accentDefault,r?.85:-.6))),"successDefault"in t&&("successSubtle"in t||(o.successSubtle=K(n.successDefault,r)),"successText"in t||(o.successText=Y(n.successDefault,r))),"warningDefault"in t&&("warningSubtle"in t||(o.warningSubtle=K(n.warningDefault,r)),"warningText"in t||(o.warningText=Y(n.warningDefault,r))),"dangerDefault"in t&&("dangerHover"in t||(o.dangerHover=A(n.dangerDefault,r?.05:-.07)),"dangerSubtle"in t||(o.dangerSubtle=K(n.dangerDefault,r)),"dangerText"in t||(o.dangerText=Y(n.dangerDefault,r))),"infoDefault"in t&&("infoSubtle"in t||(o.infoSubtle=K(n.infoDefault,r)),"infoText"in t||(o.infoText=Y(n.infoDefault,r))),o}function Se(t,n="light"){const o={...n==="dark"?ie:U,...t},r=le(t,o,n),i=n==="light"?A(o.accentDefault,-.15):A(o.accentDefault,.15);return{...o,...r,textOnAccent:se(o.accentDefault),accentBorder:i}}const Te=m.createContext({theme:"light",tokens:U});function ma({theme:t="light",tokens:n,anchors:a,children:o}){const r=m.useId().replace(/:/g,""),i=(()=>{if(a)return Se(a,t);const l=t==="dark"?ie:U,c=n?{...l,...n}:l,h=n?le(n,c,t):{},g=(n==null?void 0:n.accentBorder)??(t==="light"?A(c.accentDefault,-.15):A(c.accentDefault,.15));return{...c,...h,textOnAccent:(n==null?void 0:n.textOnAccent)??se(c.accentDefault),accentBorder:g}})(),s=`html { font-size: 14px; }
344
- `+ke(i,":root");return m.useLayoutEffect(()=>{let l=document.getElementById(`lucent-tokens-${r}`);return l||(l=document.createElement("style"),l.id=`lucent-tokens-${r}`,document.head.appendChild(l)),l.textContent=s,()=>{var c;(c=document.getElementById(`lucent-tokens-${r}`))==null||c.remove()}},[r,s]),e.jsx(Te.Provider,{value:{theme:t,tokens:i},children:o})}function ga(){return m.useContext(Te)}const ba={bgBase:{description:"Main page/canvas background. The lowest elevation layer — everything sits on top of this.",lightGuidance:"Near-white. Typically #ffffff or a very faint tint (L > 0.96).",darkGuidance:"Near-black with a subtle cool or warm tint. Typically L 0.07–0.10 (e.g. #0f0f11, #111318).",derives:["bgSubtle"]},surface:{description:'Component surface color. Used for cards, input backgrounds, table rows, list items — any component that "floats" above the page canvas.',lightGuidance:"Very slightly off-white — just enough to read as distinct from bgBase. Typically L 0.96–0.98 (e.g. #f9fafb, #f8f8f8).",darkGuidance:"Slightly lighter than bgBase. Typically L 0.11–0.15 (e.g. #1a1a1e, #18181b).",derives:["surfaceSecondary","surfaceRaised","surfaceOverlay"]},borderDefault:{description:"Default border and divider color. Used on input outlines, card borders, table cell borders, section dividers.",lightGuidance:"A mid-light gray. Enough contrast to be legible on bgBase, not so dark it draws attention. Typically L 0.85–0.92 (e.g. #e5e7eb, #d1d5db).",darkGuidance:"A dim gray that reads against dark surfaces. Typically L 0.18–0.26 (e.g. #2d2d35, #374151).",derives:["borderSubtle","borderStrong"]},textPrimary:{description:"Primary body text. High contrast against bgBase — the default color for headings, labels, and body copy.",lightGuidance:"Very dark — near-black. Typically L 0.04–0.15 (e.g. #111827, #0f172a). Must pass WCAG AA against bgBase.",darkGuidance:"Very light — near-white. Typically L 0.88–0.96 (e.g. #f9fafb, #e2e8f0). Must pass WCAG AA against bgBase.",derives:["textSecondary","textDisabled"]},accentDefault:{description:"Primary brand/action color. Drives the visual identity — used on primary buttons, active nav links, focus rings, badges, and progress indicators.",lightGuidance:"Pick a color with enough contrast against both bgBase (white) and textOnAccent (computed automatically). Saturated mid-tones work well. E.g. indigo #6366f1, violet #8b5cf6, emerald #10b981. Monochrome default is #111827 (near-black).",darkGuidance:"In dark mode the accent typically lightens so it stays visible. This is handled automatically via deriveDarkFromLight() — you can supply the same light-mode accent and the dark variant is computed.",derives:["accentHover","accentActive","accentSubtle","accentBorder","textOnAccent"]},successDefault:{description:'Positive/success state color. Used on success alerts, completed step indicators, "online" status badges, and confirmation toasts.',lightGuidance:"A readable green in the mid-to-dark range. E.g. #22c55e (Tailwind green-500), #16a34a (green-600). Avoid very pale greens — they fail WCAG against white.",darkGuidance:"Slightly lighter than the light-mode value so it reads against dark surfaces. createTheme() handles this automatically.",derives:["successSubtle","successText"]},warningDefault:{description:'Cautionary/warning state color. Used on warning banners, pending/in-review badges, and "needs attention" indicators.',lightGuidance:"An amber or orange-yellow. E.g. #f59e0b (Tailwind amber-500), #d97706 (amber-600). Avoid pure yellow — insufficient contrast on white.",darkGuidance:"Slightly lighter than light-mode. createTheme() handles this automatically.",derives:["warningSubtle","warningText"]},dangerDefault:{description:'Error/destructive state color. Used on error messages, delete-confirmation buttons, form field errors, and "offline" or "failed" status.',lightGuidance:"A mid-to-dark red. E.g. #ef4444 (Tailwind red-500), #dc2626 (red-600).",darkGuidance:"Slightly lighter than light-mode. createTheme() handles this automatically.",derives:["dangerHover","dangerSubtle","dangerText"]},infoDefault:{description:'Neutral informational state color. Used on info banners, help tooltips, "new feature" callouts, and link colors in some contexts.',lightGuidance:"A mid blue. E.g. #3b82f6 (Tailwind blue-500), #2563eb (blue-600).",darkGuidance:"Slightly lighter than light-mode. createTheme() handles this automatically.",derives:["infoSubtle","infoText"]}},va={id:"lucent-provider",name:"LucentProvider",tier:"provider",domain:"neutral",specVersion:"1.0",description:"Root configuration wrapper that injects Lucent design tokens as CSS custom properties. Accepts either 9 anchor colors (via `anchors`) for zero-config theming, or granular token overrides (via `tokens`) for full control.",designIntent:'LucentProvider is the single source of truth for the visual identity of any Lucent-powered UI. Its primary design goal is to make custom theming accessible to both humans and LLMs with minimal effort.\n\nANCHOR MODE (recommended for LLMs): Pass `anchors` with 9 semantic colors and the provider automatically derives all 30+ variant tokens — hover/active/subtle states, WCAG-compliant contrast text, status subtle tints, surface elevation steps, and more. An LLM generating a themed UI only needs to reason about 9 colors, not the full token surface.\n\nTOKEN MODE (for granular control): Pass `tokens` as a partial override object. Any token not supplied falls back to the base light or dark theme. Derivation still runs — e.g. if you supply only `accentDefault`, the provider auto-derives `accentHover`, `accentActive`, `accentSubtle`, `accentBorder`, and `textOnAccent`.\n\nWCAG auto-computation: `textOnAccent` is always computed from the resolved accent color via relative luminance — it will be #000000 or #ffffff, whichever passes AA contrast. Consumers can override it if they have brand-specific requirements.\n\nDARK MODE: Pass `theme="dark"` alongside either prop. Anchor colors are applied to the dark base palette; derivation runs with dark-calibrated lightness deltas. The same 9 anchors produce a coherent dark theme — no extra work needed.\n\nDO NOT nest multiple LucentProviders unless intentionally theming a sub-tree differently (e.g. an inverted sidebar). The outermost provider wins for `:root` CSS vars.',props:[{name:"anchors",type:"ThemeAnchors",required:!1,description:"Minimal theming API: supply 9 semantic anchor colors and all variant tokens are derived automatically. See ThemeAnchorsSpec for guidance on each key. When provided, the `tokens` prop is ignored. Keys: bgBase, surface, borderDefault, textPrimary, accentDefault, successDefault, warningDefault, dangerDefault, infoDefault."},{name:"theme",type:"enum",required:!1,default:'"light"',enumValues:["light","dark"],description:'Selects the base token palette. "light" uses lightTokens as the starting point; "dark" uses darkTokens. Applies to both anchor-mode and token-mode.'},{name:"tokens",type:"Partial<LucentTokens>",required:!1,description:"Granular token overrides. Any token not supplied falls back to the base theme. Variant derivation still runs for anchor tokens found in this object (e.g. supplying `accentDefault` auto-derives hover/active/subtle variants). Ignored when `anchors` is provided."},{name:"children",type:"ReactNode",required:!0,description:"The subtree to theme. Typically your entire app, or a section that needs independent theming."}],usageExamples:[{title:"Anchor mode — indigo brand (light)",description:"The recommended pattern for LLMs. 9 colors produce a complete WCAG-compliant theme.",code:`import { LucentProvider } from 'lucent-ui';
373
+ }`}function nr(t){const n=parseInt(t.slice(1,3),16)/255,a=parseInt(t.slice(3,5),16)/255,o=parseInt(t.slice(5,7),16)/255,r=i=>i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4);return .2126*r(n)+.7152*r(a)+.0722*r(o)}function je(t){return nr(t)<.179?"#ffffff":"#000000"}const ue={subtle:{light:.95,dark:.12},text:{light:.28,dark:.78}};function ie(t,n){const[a,o]=K(t);return Y(a,o*.5,n?ue.subtle.light:ue.subtle.dark)}function se(t,n){const[a,o]=K(t);return Y(a,o,n?ue.text.light:ue.text.dark)}function Ce(t,n,a){const o={},r=a==="light";return"borderDefault"in t&&("borderSubtle"in t||(o.borderSubtle=L(n.borderDefault,r?.05:-.02)),"borderStrong"in t||(o.borderStrong=L(n.borderDefault,r?-.27:.19))),"bgBase"in t&&("bgSubtle"in t||(o.bgSubtle=L(n.bgBase,r?-.02:.02))),"surface"in t&&("surfaceSecondary"in t||(o.surfaceSecondary=L(n.surface,r?-.04:.03)),"surfaceRaised"in t||(o.surfaceRaised=L(n.surface,r?0:.06)),"surfaceOverlay"in t||(o.surfaceOverlay=L(n.surface,r?0:.06))),"textPrimary"in t&&("textSecondary"in t||(o.textSecondary=L(n.textPrimary,r?.2:-.15)),"textDisabled"in t||(o.textDisabled=L(n.textPrimary,r?.35:-.4))),"accentDefault"in t&&("accentHover"in t||(o.accentHover=L(n.accentDefault,r?.05:-.07)),"accentActive"in t||(o.accentActive=L(n.accentDefault,r?.13:-.14)),"accentSubtle"in t||(o.accentSubtle=L(n.accentDefault,r?.85:-.6))),"successDefault"in t&&("successSubtle"in t||(o.successSubtle=ie(n.successDefault,r)),"successText"in t||(o.successText=se(n.successDefault,r))),"warningDefault"in t&&("warningSubtle"in t||(o.warningSubtle=ie(n.warningDefault,r)),"warningText"in t||(o.warningText=se(n.warningDefault,r))),"dangerDefault"in t&&("dangerHover"in t||(o.dangerHover=L(n.dangerDefault,r?.05:-.07)),"dangerSubtle"in t||(o.dangerSubtle=ie(n.dangerDefault,r)),"dangerText"in t||(o.dangerText=se(n.dangerDefault,r))),"infoDefault"in t&&("infoSubtle"in t||(o.infoSubtle=ie(n.infoDefault,r)),"infoText"in t||(o.infoText=se(n.infoDefault,r))),o}function Ye(t,n="light"){const o={...n==="dark"?Te:ne,...t},r=Ce(t,o,n),i=n==="light"?L(o.accentDefault,-.15):L(o.accentDefault,.15);return{...o,...r,textOnAccent:je(o.accentDefault),accentBorder:i}}const Xe=f.createContext({theme:"light",tokens:ne});function ar({theme:t="light",tokens:n,anchors:a,children:o}){const r=f.useId().replace(/:/g,""),i=(()=>{if(a)return Ye(a,t);const c=t==="dark"?Te:ne,l=n?{...c,...n}:c,u=n?Ce(n,l,t):{},m=(n==null?void 0:n.accentBorder)??(t==="light"?L(l.accentDefault,-.15):L(l.accentDefault,.15));return{...l,...u,textOnAccent:(n==null?void 0:n.textOnAccent)??je(l.accentDefault),accentBorder:m}})(),s=`html { font-size: 14px; }
374
+ `+Ke(i,":root");return f.useLayoutEffect(()=>{let c=document.getElementById(`lucent-tokens-${r}`);return c||(c=document.createElement("style"),c.id=`lucent-tokens-${r}`,document.head.appendChild(c)),c.textContent=s,()=>{var l;(l=document.getElementById(`lucent-tokens-${r}`))==null||l.remove()}},[r,s]),e.jsx(Xe.Provider,{value:{theme:t,tokens:i},children:o})}function rr(){return f.useContext(Xe)}const or={bgBase:{description:"Main page/canvas background. The lowest elevation layer — everything sits on top of this.",lightGuidance:"Near-white. Typically #ffffff or a very faint tint (L > 0.96).",darkGuidance:"Near-black with a subtle cool or warm tint. Typically L 0.07–0.10 (e.g. #0f0f11, #111318).",derives:["bgSubtle"]},surface:{description:'Component surface color. Used for cards, input backgrounds, table rows, list items — any component that "floats" above the page canvas.',lightGuidance:"Very slightly off-white — just enough to read as distinct from bgBase. Typically L 0.96–0.98 (e.g. #f9fafb, #f8f8f8).",darkGuidance:"Slightly lighter than bgBase. Typically L 0.11–0.15 (e.g. #1a1a1e, #18181b).",derives:["surfaceSecondary","surfaceRaised","surfaceOverlay"]},borderDefault:{description:"Default border and divider color. Used on input outlines, card borders, table cell borders, section dividers.",lightGuidance:"A mid-light gray. Enough contrast to be legible on bgBase, not so dark it draws attention. Typically L 0.85–0.92 (e.g. #e5e7eb, #d1d5db).",darkGuidance:"A dim gray that reads against dark surfaces. Typically L 0.18–0.26 (e.g. #2d2d35, #374151).",derives:["borderSubtle","borderStrong"]},textPrimary:{description:"Primary body text. High contrast against bgBase — the default color for headings, labels, and body copy.",lightGuidance:"Very dark — near-black. Typically L 0.04–0.15 (e.g. #111827, #0f172a). Must pass WCAG AA against bgBase.",darkGuidance:"Very light — near-white. Typically L 0.88–0.96 (e.g. #f9fafb, #e2e8f0). Must pass WCAG AA against bgBase.",derives:["textSecondary","textDisabled"]},accentDefault:{description:"Primary brand/action color. Drives the visual identity — used on primary buttons, active nav links, focus rings, badges, and progress indicators.",lightGuidance:"Pick a color with enough contrast against both bgBase (white) and textOnAccent (computed automatically). Saturated mid-tones work well. E.g. indigo #6366f1, violet #8b5cf6, emerald #10b981. Monochrome default is #111827 (near-black).",darkGuidance:"In dark mode the accent typically lightens so it stays visible. This is handled automatically via deriveDarkFromLight() — you can supply the same light-mode accent and the dark variant is computed.",derives:["accentHover","accentActive","accentSubtle","accentBorder","textOnAccent"]},successDefault:{description:'Positive/success state color. Used on success alerts, completed step indicators, "online" status badges, and confirmation toasts.',lightGuidance:"A readable green in the mid-to-dark range. E.g. #22c55e (Tailwind green-500), #16a34a (green-600). Avoid very pale greens — they fail WCAG against white.",darkGuidance:"Slightly lighter than the light-mode value so it reads against dark surfaces. createTheme() handles this automatically.",derives:["successSubtle","successText"]},warningDefault:{description:'Cautionary/warning state color. Used on warning banners, pending/in-review badges, and "needs attention" indicators.',lightGuidance:"An amber or orange-yellow. E.g. #f59e0b (Tailwind amber-500), #d97706 (amber-600). Avoid pure yellow — insufficient contrast on white.",darkGuidance:"Slightly lighter than light-mode. createTheme() handles this automatically.",derives:["warningSubtle","warningText"]},dangerDefault:{description:'Error/destructive state color. Used on error messages, delete-confirmation buttons, form field errors, and "offline" or "failed" status.',lightGuidance:"A mid-to-dark red. E.g. #ef4444 (Tailwind red-500), #dc2626 (red-600).",darkGuidance:"Slightly lighter than light-mode. createTheme() handles this automatically.",derives:["dangerHover","dangerSubtle","dangerText"]},infoDefault:{description:'Neutral informational state color. Used on info banners, help tooltips, "new feature" callouts, and link colors in some contexts.',lightGuidance:"A mid blue. E.g. #3b82f6 (Tailwind blue-500), #2563eb (blue-600).",darkGuidance:"Slightly lighter than light-mode. createTheme() handles this automatically.",derives:["infoSubtle","infoText"]}},ir={id:"lucent-provider",name:"LucentProvider",tier:"provider",domain:"neutral",specVersion:"1.0",description:"Root configuration wrapper that injects Lucent design tokens as CSS custom properties. Accepts either 9 anchor colors (via `anchors`) for zero-config theming, or granular token overrides (via `tokens`) for full control.",designIntent:'LucentProvider is the single source of truth for the visual identity of any Lucent-powered UI. Its primary design goal is to make custom theming accessible to both humans and LLMs with minimal effort.\n\nANCHOR MODE (recommended for LLMs): Pass `anchors` with 9 semantic colors and the provider automatically derives all 30+ variant tokens — hover/active/subtle states, WCAG-compliant contrast text, status subtle tints, surface elevation steps, and more. An LLM generating a themed UI only needs to reason about 9 colors, not the full token surface.\n\nTOKEN MODE (for granular control): Pass `tokens` as a partial override object. Any token not supplied falls back to the base light or dark theme. Derivation still runs — e.g. if you supply only `accentDefault`, the provider auto-derives `accentHover`, `accentActive`, `accentSubtle`, `accentBorder`, and `textOnAccent`.\n\nWCAG auto-computation: `textOnAccent` is always computed from the resolved accent color via relative luminance — it will be #000000 or #ffffff, whichever passes AA contrast. Consumers can override it if they have brand-specific requirements.\n\nDARK MODE: Pass `theme="dark"` alongside either prop. Anchor colors are applied to the dark base palette; derivation runs with dark-calibrated lightness deltas. The same 9 anchors produce a coherent dark theme — no extra work needed.\n\nDO NOT nest multiple LucentProviders unless intentionally theming a sub-tree differently (e.g. an inverted sidebar). The outermost provider wins for `:root` CSS vars.',props:[{name:"anchors",type:"ThemeAnchors",required:!1,description:"Minimal theming API: supply 9 semantic anchor colors and all variant tokens are derived automatically. See ThemeAnchorsSpec for guidance on each key. When provided, the `tokens` prop is ignored. Keys: bgBase, surface, borderDefault, textPrimary, accentDefault, successDefault, warningDefault, dangerDefault, infoDefault."},{name:"theme",type:"enum",required:!1,default:'"light"',enumValues:["light","dark"],description:'Selects the base token palette. "light" uses lightTokens as the starting point; "dark" uses darkTokens. Applies to both anchor-mode and token-mode.'},{name:"tokens",type:"Partial<LucentTokens>",required:!1,description:"Granular token overrides. Any token not supplied falls back to the base theme. Variant derivation still runs for anchor tokens found in this object (e.g. supplying `accentDefault` auto-derives hover/active/subtle variants). Ignored when `anchors` is provided."},{name:"children",type:"ReactNode",required:!0,description:"The subtree to theme. Typically your entire app, or a section that needs independent theming."}],usageExamples:[{title:"Anchor mode — indigo brand (light)",description:"The recommended pattern for LLMs. 9 colors produce a complete WCAG-compliant theme.",code:`import { LucentProvider } from 'lucent-ui';
345
375
 
346
376
  <LucentProvider
347
377
  anchors={{
@@ -406,6 +436,6 @@ const myTheme = createTheme({
406
436
  <App />
407
437
  </main>
408
438
  </div>
409
- </LucentProvider>`}],compositionGraph:[]},ya={accentDefault:"#e9c96b",accentHover:"#ddb84e",accentActive:"#c9a33b",accentSubtle:"#fef9ec",focusRing:"#e9c96b"};function B(t,n){return{field:t,message:n}}function je(t){const n=[];if(typeof t!="object"||t===null)return{valid:!1,errors:[B("manifest","Must be a non-null object")]};const a=t,o=["id","name","description","designIntent","specVersion"];for(const i of o)(typeof a[i]!="string"||a[i].trim()==="")&&n.push(B(i,"Must be a non-empty string"));typeof a.id=="string"&&!/^[a-z][a-z0-9-]*$/.test(a.id)&&n.push(B("id",'Must be kebab-case (e.g. "button", "form-field")'));const r=["atom","molecule","block","flow","overlay","provider"];return r.includes(a.tier)||n.push(B("tier",`Must be one of: ${r.join(", ")}`)),(typeof a.domain!="string"||a.domain.trim()==="")&&n.push(B("domain","Must be a non-empty string")),Array.isArray(a.props)?a.props.forEach((i,s)=>{const l=i,c=`props[${s}]`;(typeof l.name!="string"||l.name==="")&&n.push(B(`${c}.name`,"Must be a non-empty string")),(typeof l.type!="string"||l.type==="")&&n.push(B(`${c}.type`,"Must be a non-empty string")),typeof l.required!="boolean"&&n.push(B(`${c}.required`,"Must be a boolean")),(typeof l.description!="string"||l.description==="")&&n.push(B(`${c}.description`,"Must be a non-empty string"))}):n.push(B("props","Must be an array")),Array.isArray(a.usageExamples)?a.usageExamples.length===0?n.push(B("usageExamples","Must have at least one example")):a.usageExamples.forEach((i,s)=>{const l=i,c=`usageExamples[${s}]`;(typeof l.title!="string"||l.title==="")&&n.push(B(`${c}.title`,"Must be a non-empty string")),(typeof l.code!="string"||l.code==="")&&n.push(B(`${c}.code`,"Must be a non-empty string"))}):n.push(B("usageExamples","Must be an array")),Array.isArray(a.compositionGraph)||n.push(B("compositionGraph","Must be an array (empty array is fine for atoms)")),typeof a.specVersion=="string"&&!/^\d+\.\d+$/.test(a.specVersion)&&n.push(B("specVersion",'Must be "MAJOR.MINOR" format, e.g. "0.1"')),{valid:n.length===0,errors:n}}function xa(t){const n=je(t);if(!n.valid){const a=n.errors.map(o=>` ${o.field}: ${o.message}`).join(`
439
+ </LucentProvider>`}],compositionGraph:[]},sr={accentDefault:"#e9c96b",accentHover:"#ddb84e",accentActive:"#c9a33b",accentSubtle:"#fef9ec",focusRing:"#e9c96b"};function P(t,n){return{field:t,message:n}}function Je(t){const n=[];if(typeof t!="object"||t===null)return{valid:!1,errors:[P("manifest","Must be a non-null object")]};const a=t,o=["id","name","description","designIntent","specVersion"];for(const i of o)(typeof a[i]!="string"||a[i].trim()==="")&&n.push(P(i,"Must be a non-empty string"));typeof a.id=="string"&&!/^[a-z][a-z0-9-]*$/.test(a.id)&&n.push(P("id",'Must be kebab-case (e.g. "button", "form-field")'));const r=["atom","molecule","block","flow","overlay","provider"];return r.includes(a.tier)||n.push(P("tier",`Must be one of: ${r.join(", ")}`)),(typeof a.domain!="string"||a.domain.trim()==="")&&n.push(P("domain","Must be a non-empty string")),Array.isArray(a.props)?a.props.forEach((i,s)=>{const c=i,l=`props[${s}]`;(typeof c.name!="string"||c.name==="")&&n.push(P(`${l}.name`,"Must be a non-empty string")),(typeof c.type!="string"||c.type==="")&&n.push(P(`${l}.type`,"Must be a non-empty string")),typeof c.required!="boolean"&&n.push(P(`${l}.required`,"Must be a boolean")),(typeof c.description!="string"||c.description==="")&&n.push(P(`${l}.description`,"Must be a non-empty string"))}):n.push(P("props","Must be an array")),Array.isArray(a.usageExamples)?a.usageExamples.length===0?n.push(P("usageExamples","Must have at least one example")):a.usageExamples.forEach((i,s)=>{const c=i,l=`usageExamples[${s}]`;(typeof c.title!="string"||c.title==="")&&n.push(P(`${l}.title`,"Must be a non-empty string")),(typeof c.code!="string"||c.code==="")&&n.push(P(`${l}.code`,"Must be a non-empty string"))}):n.push(P("usageExamples","Must be an array")),Array.isArray(a.compositionGraph)||n.push(P("compositionGraph","Must be an array (empty array is fine for atoms)")),typeof a.specVersion=="string"&&!/^\d+\.\d+$/.test(a.specVersion)&&n.push(P("specVersion",'Must be "MAJOR.MINOR" format, e.g. "0.1"')),{valid:n.length===0,errors:n}}function lr(t){const n=Je(t);if(!n.valid){const a=n.errors.map(o=>` ${o.field}: ${o.message}`).join(`
410
440
  `);throw new Error(`Invalid ComponentManifest:
411
- ${a}`)}}function wa(t){if(typeof t!="object"||t===null)return!1;const n=t;return typeof n.name=="string"&&typeof n.type=="string"&&typeof n.required=="boolean"&&typeof n.description=="string"}const ka="1.0",Sa="0.1.0";exports.Alert=un;exports.AlertManifest=pn;exports.Avatar=Oe;exports.AvatarManifest=He;exports.Badge=Ne;exports.BadgeManifest=Pe;exports.Breadcrumb=yn;exports.Button=he;exports.ButtonManifest=qe;exports.COMMAND_PALETTE_MANIFEST=Rn;exports.Card=tn;exports.CardManifest=nn;exports.Checkbox=oe;exports.CheckboxManifest=Qe;exports.CodeBlock=Ft;exports.CodeBlockManifest=Nt;exports.Collapsible=kn;exports.CommandPalette=qn;exports.DATA_TABLE_MANIFEST=zn;exports.DATE_PICKER_MANIFEST=On;exports.DATE_RANGE_PICKER_MANIFEST=Un;exports.DataTable=Cn;exports.DatePicker=Vn;exports.DateRangePicker=Gn;exports.Divider=Ke;exports.DividerManifest=Ye;exports.EmptyState=fn;exports.EmptyStateManifest=hn;exports.FILE_UPLOAD_MANIFEST=Xn;exports.FileUpload=Yn;exports.FormField=Ut;exports.FormFieldManifest=_t;exports.Icon=xt;exports.IconManifest=wt;exports.Input=re;exports.InputManifest=Re;exports.LUCENT_UI_VERSION=Sa;exports.LucentProvider=ma;exports.LucentProviderManifest=va;exports.MANIFEST_SPEC_VERSION=ka;exports.MULTI_SELECT_MANIFEST=Fn;exports.MultiSelect=Bn;exports.NavLink=Mt;exports.PageLayout=Tn;exports.Radio=tt;exports.RadioGroup=ve;exports.RadioGroupUncontrolled=nt;exports.RadioManifest=at;exports.SearchInput=Xt;exports.SearchInputManifest=Jt;exports.Select=ye;exports.SelectManifest=dt;exports.Skeleton=bn;exports.SkeletonManifest=vn;exports.Slider=Et;exports.SliderManifest=qt;exports.Spinner=ge;exports.SpinnerManifest=_e;exports.TIMELINE_MANIFEST=ta;exports.Table=V;exports.TableManifest=Gt;exports.Tabs=xn;exports.Tag=ft;exports.TagManifest=ht;exports.Text=z;exports.TextManifest=It;exports.Textarea=me;exports.TextareaManifest=Le;exports.ThemeAnchorsSpec=ba;exports.Timeline=ea;exports.Toggle=it;exports.ToggleManifest=st;exports.Tooltip=bt;exports.TooltipManifest=vt;exports.assertManifest=xa;exports.brandTokens=ya;exports.createTheme=Se;exports.darkTokens=ie;exports.deriveDarkFromLight=we;exports.deriveTokens=le;exports.getContrastText=se;exports.isValidPropDescriptor=wa;exports.lightTokens=U;exports.makeLibraryCSS=ke;exports.useLucent=ga;exports.validateManifest=je;
441
+ ${a}`)}}function cr(t){if(typeof t!="object"||t===null)return!1;const n=t;return typeof n.name=="string"&&typeof n.type=="string"&&typeof n.required=="boolean"&&typeof n.description=="string"}const dr="1.0",ur="0.1.0";exports.Alert=Qn;exports.AlertManifest=ea;exports.Avatar=gt;exports.AvatarManifest=bt;exports.Badge=ut;exports.BadgeManifest=pt;exports.Breadcrumb=sa;exports.Button=ye;exports.ButtonManifest=ot;exports.COLOR_PICKER_MANIFEST=En;exports.COLOR_SWATCH_MANIFEST=Rn;exports.COMMAND_PALETTE_MANIFEST=ka;exports.Card=On;exports.CardManifest=Gn;exports.Checkbox=xe;exports.CheckboxManifest=jt;exports.CodeBlock=un;exports.CodeBlockManifest=pn;exports.Collapsible=da;exports.ColorPicker=Ge;exports.ColorSwatch=ee;exports.CommandPalette=wa;exports.DATA_TABLE_MANIFEST=va;exports.DATE_PICKER_MANIFEST=Aa;exports.DATE_RANGE_PICKER_MANIFEST=qa;exports.DataTable=ha;exports.DatePicker=za;exports.DateRangePicker=Ra;exports.Divider=wt;exports.DividerManifest=kt;exports.EmptyState=ta;exports.EmptyStateManifest=na;exports.FILE_UPLOAD_MANIFEST=Na;exports.FileUpload=Fa;exports.FormField=Ln;exports.FormFieldManifest=Bn;exports.Icon=_t;exports.IconManifest=Kt;exports.Input=_;exports.InputManifest=st;exports.LUCENT_UI_VERSION=ur;exports.LucentProvider=ar;exports.LucentProviderManifest=ir;exports.MANIFEST_SPEC_VERSION=dr;exports.MULTI_SELECT_MANIFEST=ja;exports.MultiSelect=Ta;exports.NavLink=tn;exports.PageLayout=pa;exports.Radio=Mt;exports.RadioGroup=Ve;exports.RadioGroupUncontrolled=Dt;exports.RadioManifest=zt;exports.SEGMENTED_CONTROL_MANIFEST=qn;exports.SearchInput=Pn;exports.SearchInputManifest=$n;exports.SegmentedControl=ke;exports.Select=we;exports.SelectManifest=Ft;exports.Skeleton=oa;exports.SkeletonManifest=ia;exports.Slider=on;exports.SliderManifest=sn;exports.Spinner=$e;exports.SpinnerManifest=xt;exports.TIMELINE_MANIFEST=Ha;exports.Table=J;exports.TableManifest=yn;exports.Tabs=la;exports.Tag=$t;exports.TagManifest=Wt;exports.Text=R;exports.TextManifest=en;exports.Textarea=Pe;exports.TextareaManifest=lt;exports.ThemeAnchorsSpec=or;exports.Timeline=Va;exports.Toggle=Rt;exports.ToggleManifest=qt;exports.Tooltip=Ot;exports.TooltipManifest=Gt;exports.assertManifest=lr;exports.brandTokens=sr;exports.createTheme=Ye;exports.darkTokens=Te;exports.deriveDarkFromLight=_e;exports.deriveTokens=Ce;exports.getContrastText=je;exports.isValidPropDescriptor=cr;exports.lightTokens=ne;exports.makeLibraryCSS=Ke;exports.useLucent=rr;exports.validateManifest=Je;