@dqa-ai-solutions/ui-runtime 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -2
- package/dist/_types/ui-kit/index.d.ts +4 -0
- package/dist/_types/ui-kit/lens/action.d.ts +76 -0
- package/dist/_types/ui-kit/lens/cell.d.ts +79 -0
- package/dist/_types/ui-kit/lens/diagnostic.d.ts +49 -0
- package/dist/_types/ui-kit/lens/format.d.ts +32 -0
- package/dist/_types/ui-kit/lens/index.d.ts +12 -0
- package/dist/_types/ui-kit/lens/list.d.ts +223 -0
- package/dist/_types/ui-kit/lens/milestone.d.ts +112 -0
- package/dist/_types/ui-kit/lens/pattern.d.ts +38 -0
- package/dist/_types/ui-kit/lens/queue.d.ts +30 -0
- package/dist/_types/ui-kit/lens/record.d.ts +110 -0
- package/dist/_types/ui-kit/lens/registry.d.ts +9 -0
- package/dist/_types/ui-kit/lens/shape.d.ts +27 -0
- package/dist/_types/ui-kit/lens/timeline.d.ts +36 -0
- package/dist/_types/ui-kit/primitives/action.d.ts +263 -0
- package/dist/_types/ui-kit/primitives/index.d.ts +2 -0
- package/dist/_types/ui-kit/primitives/state.d.ts +148 -0
- package/dist/_types/ui-kit/shell/index.d.ts +2 -0
- package/dist/_types/ui-kit/shell/nav.d.ts +142 -0
- package/dist/_types/ui-kit/shell/trail.d.ts +85 -0
- package/dist/_types/ui-kit/tokens/index.d.ts +1 -0
- package/dist/_types/ui-kit/tokens/types.d.ts +252 -0
- package/dist/_types/ui-react/elements/action-bar.d.ts +32 -0
- package/dist/_types/ui-react/elements/action-scope.d.ts +9 -0
- package/dist/_types/ui-react/elements/button.d.ts +42 -0
- package/dist/_types/ui-react/elements/choice.d.ts +40 -0
- package/dist/_types/ui-react/elements/columns.d.ts +82 -0
- package/dist/_types/ui-react/elements/dialog-scope.d.ts +15 -0
- package/dist/_types/ui-react/elements/dialog.d.ts +67 -0
- package/dist/_types/ui-react/elements/disclosure.d.ts +305 -0
- package/dist/_types/ui-react/elements/field-attributes.d.ts +39 -0
- package/dist/_types/ui-react/elements/field.d.ts +628 -0
- package/dist/_types/ui-react/elements/file.d.ts +82 -0
- package/dist/_types/ui-react/elements/filter.d.ts +61 -0
- package/dist/_types/ui-react/elements/link.d.ts +38 -0
- package/dist/_types/ui-react/elements/menu.d.ts +56 -0
- package/dist/_types/ui-react/elements/milestone.d.ts +119 -0
- package/dist/_types/ui-react/elements/nav.d.ts +73 -0
- package/dist/_types/ui-react/elements/pop.d.ts +14 -0
- package/dist/_types/ui-react/elements/record.d.ts +174 -0
- package/dist/_types/ui-react/elements/segmented.d.ts +59 -0
- package/dist/_types/ui-react/elements/suggest.d.ts +11 -0
- package/dist/_types/ui-react/elements/surface.d.ts +354 -0
- package/dist/_types/ui-react/elements/table.d.ts +72 -0
- package/dist/_types/ui-react/elements/toast.d.ts +69 -0
- package/dist/_types/ui-react/index.d.ts +22 -0
- package/dist/_types/ui-react/prefix/index.d.ts +8 -0
- package/dist/chunks/chunk-4LX2HZJU.js +0 -0
- package/dist/chunks/chunk-7WHYHIUX.js +1 -0
- package/dist/chunks/chunk-VS5FCRGY.js +3 -0
- package/dist/chunks/chunk-X6SR5UHK.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/lens.d.ts +1 -0
- package/dist/lens.js +1 -0
- package/dist/primitives.d.ts +1 -0
- package/dist/primitives.js +1 -0
- package/dist/react.d.ts +1 -0
- package/dist/react.js +1 -0
- package/dist/shell.d.ts +1 -0
- package/dist/shell.js +1 -0
- package/dist/tokens.css +160 -0
- package/dist/tokens.d.ts +1 -0
- package/dist/tokens.dark.css +98 -0
- package/dist/tokens.generated.css +98 -0
- package/dist/tokens.high.css +98 -0
- package/dist/tokens.js +1 -0
- package/package.json +60 -4
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{b as N,f as K}from"./chunk-X6SR5UHK.js";function Y(e){let{locale:t,currency:n,timeZone:s}=e,i=new Intl.NumberFormat(t),o=new Intl.NumberFormat(t,{style:"currency",currency:n}),a=new Intl.NumberFormat(t,{style:"percent",maximumFractionDigits:1}),r=new Intl.DateTimeFormat(t,{day:"2-digit",month:"2-digit",year:"numeric",...s?{timeZone:s}:{}}),d=new Intl.DateTimeFormat(t,{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",...s?{timeZone:s}:{}}),p=f=>f instanceof Date?f:new Date(f);return{decl:e,number:f=>i.format(f),currency:f=>o.format(f),percent:f=>a.format(f/100),date:f=>Number.isNaN(+p(f))?String(f):r.format(p(f)),datetime:f=>Number.isNaN(+p(f))?String(f):d.format(p(f))}}var D=120;function A(e,t,n){if(n==null)return"";if(t.meaning==="currency"&&typeof n=="number")return e.currency(n);if(t.meaning==="percent"&&typeof n=="number")return e.percent(n);switch(t.kind){case"date":return e.date(n);case"datetime":return e.datetime(n);case"number":return typeof n=="number"?e.number(n):String(n);case"text[]":return Array.isArray(n)?n.join(", "):String(n);default:return t.numeric&&typeof n=="number"?e.number(n):String(n)}}var O=Symbol("the read layer never produced this key");function x(e,t){let n=e.data;return n&&t in n?n[t]:t in e?e[t]:O}function ee(e){let t=e.data,{data:n,...s}=e;return t?{...s,...t}:s}var U=e=>{let t=new Set(e);return{has:n=>t.has(n),names:()=>[...t]}},te=U([]);function ne(e,t){if(t.kind!=="derived"){let s=x(e,t.key);return s===O?void 0:s}if(t.derived&&!(t.key in e))return O;let n=e[t.key];return n==null?null:t.derived?.kind==="linked"?n[t.derived.show]:n}function k(e,t,n){if(t.widget)return n.blocks.has(t.widget)?{kind:"block",field:t,widget:t.widget}:{kind:"missing-block",field:t,widget:t.widget,message:`"${t.label}" names the block "${t.widget}", which this renderer does not publish. Register it, or the column is blank with nothing to notice.`};let s=ne(e,t);if(s===O){let r=t.derived&&"via"in t.derived?t.derived.via:void 0;return{kind:"unwired",field:t,message:`the row carries no "${t.key}" key`+(r?`, so the join through "${r}" never ran`:"")+". The ontology name and the read layer's key must be the same word."}}if(s==null||s==="")return{kind:"blank",field:t};if(t.enum?.length){let r=t.enum.find(d=>d.value===s);return r&&!n.plain?{kind:"tone",field:t,value:String(s),label:r.label,tone:r.tone??"plain"}:{kind:"text",field:t,text:r?r.label:String(s),numeric:!1,long:!1}}let i=t.derived?.kind==="linked"?e[t.key]:null,o=i&&typeof i=="object"?i.id:void 0;if(t.refEntity&&typeof o=="string")return{kind:"link",field:t,text:A(n.format,t,s),to:{entity:t.refEntity,id:o}};let a=A(n.format,t,s);return{kind:"text",field:t,text:a,numeric:!!t.numeric||t.kind==="number",long:a.length>D}}var _=e=>e.filter(t=>t.kind==="unwired"||t.kind==="missing-block");var oe=e=>e.filter(t=>t.severity==="error");function se(e){return e.length?e.map(t=>`${t.severity==="error"?"\u26D4":"\u26A0\uFE0F "} [${t.code}] ${t.where}
|
|
2
|
+
${t.message}`).join(`
|
|
3
|
+
`):""}function j(e,t={}){let n=e.list,s=n?.columns??[],i={primary:0,normal:1,extra:2},o=[...s].sort((u,g)=>i[u.priority??"normal"]-i[g.priority??"normal"]),a=Math.max(1,t.maxColumns??7),r=n?.main?.key??null,d=new Set(t.hiddenByDefault??[]),p=new Set(o.filter(u=>u.key===r||!d.has(u.key)).slice(0,a).map(u=>u.key));r&&p.add(r);let f=t.visibility??{},y=o.map(u=>{let g=u.key===r,$=f[u.key];return{key:u.key,label:u.label,shown:g||(typeof $=="boolean"?$:p.has(u.key)),locked:g,hiddenByDefault:!p.has(u.key)}}),b=y.some(u=>!u.locked&&u.shown===u.hiddenByDefault),h=new Set(y.filter(u=>u.shown).map(u=>u.key)),c=n?.sort??[],m={};for(let u of o){let g=c.find($=>$.by===u.key);m[u.key]=u.sortable===!1?"none":g?g.dir==="desc"?"descending":"ascending":"none"}return{columns:o.filter(u=>h.has(u.key)),extraColumns:o.filter(u=>!h.has(u.key)),choices:y,customised:b,rowHeaderKey:r,sortState:m}}function re(e,t,n={}){let s=n.as==="queue"?[e.row?.main?.key,e.list?.main?.key]:[e.list?.main?.key,e.row?.main?.key];for(let i of s){if(!i)continue;let o=x(t,i);if(!(o===O||o==null||o===""))return{key:i,text:String(o)}}return null}var ae=(e,t)=>typeof e.id=="string"?e.id:String(e.id??t);function ie(e,t){let n=[...e.list?.columns??[],...e.list?.main?[e.list.main]:[],...e.list?.sub?[e.list.sub]:[],...e.detail?.facts??[],...e.row?[e.row.main,e.row.sub,e.row.badge]:[]].filter(o=>o!=null&&o.kind==="derived"&&o.derived!=null),s=new Set,i=[];for(let o of n){if(s.has(o.key)||(s.add(o.key),o.key in t))continue;let a=o.derived&&"via"in o.derived?o.derived.via:void 0;i.push({key:o.key,label:o.label,...a?{via:a}:{}})}return i}function le(e,t){let{contract:n,rows:s,empty:i}=e,o=n.list,a=o?.columns??[],r=[],d=j(n,{maxColumns:e.maxColumns,visibility:e.visibility,hiddenByDefault:e.hiddenByDefault}),p=d.columns,f=s==null?null:{...d,search:o?.search??[],sort:o?.sort??[],rows:s.map((b,h)=>{for(let m of ie(n,b))r.some(g=>g.message.includes(`"${m.key}"`))||r.push({kind:"missing-key",message:`"${n.entity}" promises the derived property "${m.key}"`+(m.via?` through "${m.via}"`:"")+", but the rows do not carry it. The column is blank for a reason no user can see."});let c=p.map(m=>k(b,m,t));return{id:ae(b,h),main:o?.main?k(b,o.main,t):null,sub:o?.sub?k(b,o.sub,{...t,plain:!0}):null,cells:c}})};for(let b of f?.rows??[])for(let h of _(ce(b)))h.kind==="missing-block"&&(r.some(c=>c.message.includes(`"${h.widget}"`))||r.push({kind:"missing-key",message:h.message}));let y=e.total??s?.length;return{state:N({forbidden:e.forbidden,error:e.error,loading:e.loading,data:f,count:y,narrowed:e.narrowed,faults:r,empty:i,surface:"table"}),faults:r}}var ce=e=>[...e.cells,...e.main?[e.main]:[],...e.sub?[e.sub]:[]];var de=e=>!!e.typeClasses?.multiline||!!e.typeClasses?.paragraph;function ue(e){if(e.enum?.length)return"select";switch(e.kind){case"text":return de(e)?"textarea":"text";case"number":return"number";case"date":return"date";case"datetime":return"datetime";case"text[]":return"tags";case"file":return"file";case"uuid":return e.many?"refs":"ref";default:return"unrenderable"}}function me(e,t){let n=[];e.widget&&!t.has(e.widget)&&n.push({severity:"error",code:"UNKNOWN_BLOCK",where:`action.${e.action}`,message:`step "${e.label}" names the form "${e.widget}", which this renderer does not publish. The step would open an empty dialog.`});let s=[],i=[],o=[],a=e.task?.filledBy;for(let r of e.fields){if(r.fixed!=null){s.push({field:r,value:r.fixed});continue}let d=a?.[r.key];if(d==="system"){o.push(r);continue}let p=ue(r);p==="unrenderable"&&!e.widget&&n.push({severity:"error",code:"UNRENDERABLE_FIELD",where:`action.${e.action}.${r.key}`,message:`no control can be generated for "${r.label}" (type ${r.kind}). Declare \`widgets: { action.${e.action}: <name> }\` and write the form, or the step refuses in front of whoever is taking it.`}),i.push({field:r,control:p,required:!!r.required,...r.refEntity?{refEntity:r.refEntity}:{},...d==="interaction"||d==="suggested"?{entry:d}:{}})}return{action:e.action,label:e.label,...e.widget?{widget:e.widget}:{},fields:i,settled:s,...o.length?{bySoftware:o}:{},diagnostics:n}}var M=(e,t)=>e.actions.filter(n=>t==null?n.from.length===0:n.from.includes(t));function L(e,t={}){let n=[],s=e.map(o=>{let a=t[o.action]??{},r=a.outcome??o.outcome;return{key:o.action,label:o.label,advances:o.to!=null,...r?{outcome:r}:{},...a.exits?{exits:!0}:{},...a.destroys?{destroys:!0}:{},...o.provisional?{provisional:o.provisional}:{}}}),i=s.filter(o=>o.advances&&!o.outcome);return i.length>1&&n.push({severity:"warn",code:"CONTRACT_GAP",where:"actions",message:`${i.length} steps advance the record and none declares \`decision.outcome\`, so no button can be the primary one. If one of them IS the approval, say so in the process; otherwise the screen must still name one (\`primary: true\`) \u2014 a flat screen is not an answer (ruled 26/9/2026: "tr\xEAn 1 m\xE0n h\xECnh lu\xF4n ph\u1EA3i define button n\xE0o l\xE0 ch\xEDnh").`}),{facts:s,diagnostics:n}}var I=e=>K(e);var fe={name:"main",label:""},he=(e,t)=>{if(!e.stateProperty)return null;let n=x(t,e.stateProperty);return typeof n=="string"?n:null};function pe(e,t){let{contract:n,record:s,layout:i,empty:o}=e,a=[],r=[],d=n.detail?.facts??[],p=new Map(d.map(y=>[y.key,y])),f=null;if(s!=null){let y=he(n,s),b=n.row?.main??n.list?.main??null,h=b?k(s,b,t):null,c=h?.kind==="text"?h.text:null;b||a.push({severity:"error",code:"NO_TITLE",where:n.entity,message:"no property is marked `keys: title`, so this record has no name to show at the top of its own page. Every other screen that lists it has the same problem."});let m=n.row?.badge??(n.stateProperty?p.get(n.stateProperty):void 0)??null,u=m?k(s,m,t):null,g=n.states?.find(l=>l.name===y)?.hint,$=i?.sections??[],C=$.filter(l=>!l.when||y!=null&&l.when.includes(y)),R=new Set(C.flatMap(l=>l.facts??[]));for(let l of $){for(let w of l.facts??[])p.has(w)||a.push({severity:"error",code:"UNKNOWN_FACT",where:`sections.${l.name}`,message:`"${w}" is not among the facts this contract carries. Either the ontology never declared it, or \`detail.facts\` does not list it \u2014 the section would simply be short one row, with nothing to notice.`});l.facts?.length&&l.block&&a.push({severity:"error",code:"UNKNOWN_BLOCK",where:`sections.${l.name}`,message:"a section draws facts or a block, never both \u2014 pick one."})}let T=d.filter(l=>!R.has(l.key));$.length&&T.length&&a.push({severity:"warn",code:"ORPHAN_FACTS",where:n.entity,message:`${T.length} declared fact(s) belong to no section and were appended at the end: ${T.map(l=>l.key).join(", ")}. Place them, or drop them from \`detail.facts\`.`});let q=$.length?[...C,...T.length?[{name:"_rest",facts:T.map(l=>l.key)}]:[]]:[{name:"main",facts:d.map(l=>l.key)}],W=l=>l.block?t.blocks.has(l.block)?{kind:"block",name:l.name,...l.label?{label:l.label}:{},widget:l.block}:{kind:"missing-block",name:l.name,widget:l.block,message:`section "${l.name}" names the block "${l.block}", which this renderer does not publish. The section would be an empty heading.`}:{kind:"facts",name:l.name,...l.label?{label:l.label}:{},facts:(l.facts??[]).map(w=>p.get(w)).filter(w=>w!=null).map(w=>({field:w,cell:k(s,w,t)}))},H=(n.detail?.related??[]).filter(l=>!l.when||y!=null&&l.when.includes(y)).map(l=>{let w=e.related?.[l.name];w==null&&a.push({severity:"error",code:"MISSING_ROWS",where:`detail.related.${l.name}`,message:`"${l.name}" is declared but the app supplied no rows for it. A section drawn empty is indistinguishable from one that genuinely has nothing \u2014 so it is reported here instead, and the process should refuse to start.`});let E=l.columns.find(S=>S.priority==="primary")??l.columns[0]??null;return{kind:"related",name:l.name,label:l.label,entity:l.entity,columns:l.columns,rowHeaderKey:E?.key??null,rows:(w??[]).map((S,z)=>({id:typeof S.id=="string"?S.id:String(S.id??z),cells:l.columns.map(Q=>k(S,Q,t))}))}}),B=i?.tabs?.length?i.tabs:[fe],F=B.map(l=>({name:l.name,label:l.label,parts:[...q.filter(w=>(w.tab??B[0].name)===l.name).map(W),...l.name===B[0].name?H:[]]})).filter((l,w)=>w===0||l.parts.length>0);for(let l of F)for(let w of l.parts)if(w.kind==="missing-block"&&a.push({severity:"error",code:"UNKNOWN_BLOCK",where:`sections.${w.name}`,message:w.message}),w.kind==="facts")for(let{cell:E}of w.facts)E.kind==="unwired"&&r.push({kind:"missing-key",message:E.message});let X=M(n,y),{facts:J,diagnostics:Z}=L(X,e.hints);a.push(...Z),f={title:c,badge:u,...g?{hint:g}:{},state:y,tabs:F,actions:I(J)}}return{state:N({forbidden:e.forbidden,error:e.error,loading:e.loading,data:f,count:s==null?0:1,faults:r,empty:o,surface:"record"}),diagnostics:a,faults:r}}function ge(e,t){let n=[],s=[],i=new Set,o=e.items?.flatMap(({entity:a,record:r},d)=>{let p=e.contracts[a];if(!p)return i.has(a)||(i.add(a),n.push({severity:"error",code:"NO_TITLE",where:a,message:`the queue holds "${a}" records and no view contract was supplied for it. They cannot be named, so they are dropped rather than listed as blanks.`})),[];let f=p.row?.main??p.list?.main;if(!f)return i.has(a)||(i.add(a),n.push({severity:"error",code:"NO_TITLE",where:a,message:`nothing says what a "${a}" is called, so a queue row for it would be an id. Mark a property \`keys: title\`, or declare \`row.main\`.`})),[];let y=p.row?.sub??null,b=p.row?.badge??null,h={id:typeof r.id=="string"?r.id:String(r.id??d),entity:a,main:k(r,f,{...t,plain:!0}),sub:y?k(r,y,{...t,plain:!0}):null,badge:b?k(r,b,t):null};for(let c of[h.main,h.sub,h.badge])c?.kind==="unwired"&&s.push({kind:"missing-key",message:c.message});return[h]})??null;return{state:N({forbidden:e.forbidden,error:e.error,loading:e.loading,data:o,count:o?.length,narrowed:e.narrowed,faults:s,empty:e.empty,surface:"list"}),diagnostics:n,faults:s}}function ye(e,t){let{contract:n,process:s}=e,i=n.lines?.length?n.lines:n.states?.length?[{process:"",stateProperty:n.stateProperty??"status",states:n.states}]:[];if(!i.length)return t.push({severity:"error",code:"CONTRACT_GAP",where:n.entity,message:`"${n.entity}" declares no states, so it has no route to draw. Either it has no lifecycle \u2014 in which case no screen should ask for one \u2014 or its process was not loaded.`}),null;if(!s&&i.length>1)return t.push({severity:"error",code:"AMBIGUOUS_LINE",where:n.entity,message:`"${n.entity}" runs ${i.length} lines (${i.map(d=>d.process).join(", ")}) and no \`process\` was given. Drawing them end to end would assert an order none of them declares, so nothing is drawn: pass the line the record is on.`}),null;let o=s?i.find(d=>d.process===s):i[0];if(!o)return t.push({severity:"error",code:"AMBIGUOUS_LINE",where:`${n.entity}.${s}`,message:`"${s}" is not a line of "${n.entity}". It declares ${i.map(d=>d.process).join(", ")||"none"}.`}),null;let r=n.actions.some(d=>d.process)?n.actions.filter(d=>d.process===o.process):n.actions;return{line:o,steps:r}}function be(e,t,n){let s=[];for(let o of e)for(let a of o.waitsOn??[])a.kind==="decision"&&!s.includes(a.via)&&s.push(a.via);let i=new Map;for(let o of s){let a=e.filter(d=>d.settles===o&&d.outcome==="approve");if(!a.length){n.push({severity:"warn",code:"UNPLACED_GATE",where:o,message:`steps wait on "${o}" and no step declares \`decision: { via: "${o}", outcome: approve }\`. The wait cannot be named without inventing a word for it, so it is left off the route \u2014 it is still on those steps' \`waitsOn\`. Mark the granting step's outcome in the process.`});continue}let r=a.flatMap(d=>d.from).map(d=>t.get(d)).filter(d=>d!=null);if(!r.length){n.push({severity:"warn",code:"UNPLACED_GATE",where:o,message:`"${o}" is opened by ${a.map(d=>`"${d.action}"`).join(", ")}, which departs from no state on this line. It has no place on the route and is left off.`});continue}i.set(o,{via:o,label:a[0].label,roles:[...new Set(a.map(d=>d.role))],after:Math.min(...r)})}return i}function we(e){let t=[],n=ye(e,t);if(!n)return{milestones:[],returns:[],diagnostics:t};let{line:s,steps:i}=n,o=new Map(s.states.map((c,m)=>[c.name,m])),a=new Set;for(let c of i)for(let m of[...c.from,...c.to?[c.to]:[]])o.has(m)||a.add(m);for(let c of a)t.push({severity:"error",code:"UNKNOWN_STATE",where:`${e.contract.entity}.${s.process||"line"}`,message:`a step names the state "${c}", which this line does not declare. Either the state is missing from the process, or the record belongs to a different line.`});let r=e.state==null?-1:o.get(e.state)??null;if(r===null)return t.push({severity:"error",code:"UNKNOWN_STATE",where:`${e.contract.entity}.${s.process||"line"}`,message:`the record is in "${e.state}", which is not a state of this line (${s.states.map(c=>c.name).join(", ")}). Nothing is drawn rather than drawing it as not yet started.`}),{milestones:[],returns:[],diagnostics:t};let d=new Map;for(let c of i){if(!c.to)continue;let m=o.get(c.to);if(m==null)continue;let u=c.from.map(g=>o.get(g)).filter(g=>g!=null&&g<m);c.from.length&&!u.length||d.set(c.to,[...d.get(c.to)??[],c])}let p=c=>[...new Set((d.get(c)??[]).map(m=>m.role))],f=c=>{let m=[...new Set((d.get(c)??[]).map(u=>u.label))];return m.length===1?m[0]:null},y=be(i,o,t),b=[];s.states.forEach((c,m)=>{b.push({kind:"state",key:c.name,label:f(c.name)??c.label,stateLabel:c.label,...c.hint?{hint:c.hint}:{},...c.tone?{tone:c.tone}:{},standing:m<r?"past":m===r?"current":"ahead",roles:p(c.name)});for(let u of y.values()){if(u.after!==m)continue;let g=e.settled?.[u.via];b.push({kind:"gate",key:u.via,label:u.label,standing:r>m||g?"past":"ahead",roles:u.roles,...g?{verdict:g}:{},...r===m&&!g?{awaiting:!0}:{}})}});let h=i.flatMap(c=>{if(!c.to)return[];let m=o.get(c.to),u=c.from.map(g=>o.get(g)).filter(g=>g!=null);return m==null||!u.length||m>=Math.min(...u)?[]:[{action:c.action,label:c.label,role:c.role,from:c.from,to:c.to}]});return{milestones:b,returns:h,diagnostics:t}}function ke(e,t){let n=[],s=new Set,i=e.events?.map(a=>{let r=e.vocabulary[a.event];return!r&&!s.has(a.event)&&(s.add(a.event),n.push({severity:"error",code:"UNLABELLED_EVENT",where:a.event,message:`"${a.event}" has no wording, so the timeline would print the machine name. Every event a record can record needs a sentence a person can read.`})),{event:a.event,label:r??a.event,at:a.at,when:t.datetime(a.at),...a.actor?{actor:a.actor}:{},...a.detail?{detail:a.detail}:{},unlabelled:!r}})??null,o=i?i.map((a,r)=>({e:a,i:r})).sort((a,r)=>+new Date(r.e.at)-+new Date(a.e.at)||a.i-r.i).map(({e:a})=>a):null;return{state:N({loading:e.loading,error:e.error,data:o,count:o?.length,empty:e.empty,surface:"list"}),diagnostics:n}}var v=e=>({determined:!1,why:e}),P=e=>typeof e=="object"&&e!==null&&typeof e.rows=="string";function G(e){let t=e.task,n=`"${e.label||e.action}"`;if(!t)return v(`nobody has said how ${n} is done`);if(!t.category)return v(`nobody has said who does ${n}`);if(t.category==="system")return{determined:!0,value:{surface:"none"}};let s=t.iteration;if(s===void 0)return v(`nobody has said whether ${n} is done on one record or many`);if(s!=="single"&&s!=="records"&&!P(s))return v(`${n} repeats over ${JSON.stringify(s)}, which is not a pattern`);if(t.reads===void 0)return v(`nobody has said what the person must see to do ${n}`);let i=e.fields.filter(h=>h.fixed==null).map(h=>h.key),o=t.filledBy,a=o?Object.keys(o):i;if(!o&&(i.length||t.category==="user"))return v(`nobody has said who puts in what ${n} records`);let r=o??{},d=i.find(h=>!(h in r));if(d)return v(`nobody has said who puts in "${d}" at ${n}`);let p=Object.entries(r).find(([h,c])=>c!=="system"&&!i.includes(h));if(p)return v(`"${p[0]}" is to be put in by a person at ${n}, but the step does not take it`);if(P(s)&&!a.includes(s.rows))return v(`${n} repeats over lines of "${s.rows}", which it does not record`);let f=i.filter(h=>r[h]==="interaction"),y=i.filter(h=>r[h]==="suggested"),b=f.length||y.length?"fields":"none";if(t.category==="user"){if(!a.length)return v(`${n} happens away from the software and nothing of it is recorded`);if(!t.leaves)return v(`nobody has said what ${n} leaves behind \u2014 a signed paper, or only a result`);t.leaves==="document"&&(b="document")}return{determined:!0,value:{surface:"action",review:t.reads,input:b,typed:f,suggested:y,over:s}}}function V(e,t,n){let s=e.lines?.find(o=>o.process===t);if(!s)return v(`"${e.entity}" has no line "${t}"`);let i=s.readers?.[n];return i?{determined:!0,value:i}:v(`nobody has said who else may see a record at "${n}"`)}function ve(e){let t=[];for(let n of e.actions){let s=G(n);s.determined||t.push({at:`${n.process}.step:${n.action}`,why:s.why})}for(let n of e.lines??[])for(let s of n.states){let i=V(e,n.process,s.name);i.determined||t.push({at:`${n.process}.state:${s.name}`,why:i.why})}return t}export{Y as a,D as b,A as c,O as d,x as e,ee as f,U as g,te as h,k as i,_ as j,oe as k,se as l,j as m,re as n,le as o,me as p,M as q,L as r,I as s,pe as t,ge as u,we as v,ke as w,G as x,V as y,ve as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var h=e=>e==="table"||e==="list"?"rows":e==="card"||e==="record"?"block":null;function N(e){let{forbidden:t,error:r,loading:a,data:c,count:i,narrowed:f,empty:o,surface:s="list",retry:u=!0,loadingLabel:p="\u0110ang t\u1EA3i\u2026"}=e,l=[...e.faults??[]],n=c!=null;return t?{kind:"forbidden",message:t}:!n&&a?{kind:"loading",skeleton:h(s),label:p}:!n&&r?{kind:"error",message:r,retry:u}:!n||(r&&l.push({kind:"stale",message:r}),i===0)?k(o,f):l.length?{kind:"partial",data:c,faults:l}:{kind:"ready",data:c}}function k(e,t){let r=t?e.noMatch:e.noRecords;return{kind:"empty",because:t?"no-match":"no-records",title:r.title,...r.body?{body:r.body}:{},...r.action?{action:r.action}:{}}}function O(e,t){switch(e.kind){case"loading":return t.loading(e);case"forbidden":return t.forbidden(e);case"error":return t.error(e);case"empty":return t.empty(e);case"partial":return t.partial(e);case"ready":return t.ready(e);default:return b(e,"SurfaceState")}}function b(e,t){throw new Error(`${t}: unhandled variant ${JSON.stringify(e)}`)}var v=e=>e.destroys?"danger":e.exits?"quiet":"normal";function S(e){let t=e.filter(i=>!i.exits),r=t.filter(i=>i.primary);if(r.length)return r.length===1?r[0]:null;let a=t.filter(i=>i.outcome==="approve");if(a.length===1)return a[0];let c=t.filter(i=>i.advances&&i.outcome!=="reject");return c.length===1?c[0]:t.length===1?t[0]:null}function E(e){let t=S(e);return e.map(r=>({key:r.key,label:r.label,tier:r===t&&!r.destroys?"key":v(r),primary:r===t,...r.icon?{icon:r.icon}:{},showLabel:r===t,busy:r.busy??!1,disabled:r.disabled??!1,...r.provisional?{provisional:r.provisional}:{}}))}var y=1,g=e=>e<=y+1?e:y;function x(e,t,r=!1){let a=o=>!!t.find(s=>s.key===o.key)?.destroys;if(r&&e.length>1&&e.some(a)){let o=e.filter(l=>!a(l)),s=Math.min(g(e.length),o.length),u=o.slice(0,s);e.length-u.length===1&&(u=u.slice(0,-1));let p=new Set(u.map(l=>l.key));return{sight:u,menu:e.filter(l=>!p.has(l.key))}}let c=g(e.length),i=[...e.filter(o=>!a(o)),...e.filter(a)],f=new Set(i.slice(0,c).map(o=>o.key));return{sight:e.filter(o=>f.has(o.key)),menu:e.filter(o=>!f.has(o.key))}}function B(e,t){let r=E(e),a=r.filter(n=>!n.icon).map(n=>n.key);if(t.surface==="table"||t.surface==="item"){let n=t.surface==="item",d=r.map(m=>({...m,primary:!1,tier:m.tier==="key"?"normal":m.tier})),{sight:I,menu:L}=x(d,e,t.surface==="table");return{inline:I.map(m=>({...m,showLabel:n})),menu:L.map(m=>({...m,showLabel:!0})),missingIcon:a,missingPrimary:!1}}let c=t.surface==="dialog"||t.surface==="form",i=n=>c&&!!e.find(d=>d.key===n.key)?.exits,f=r.filter(n=>n.primary),o=r.filter(i),s=r.filter(n=>!n.primary&&!i(n)),{sight:u,menu:p}=o.length===0?x(s,e):o.length+s.length<=y+1||s.length===1?{sight:s,menu:[]}:{sight:[],menu:[...s.filter(n=>!e.find(d=>d.key===n.key)?.destroys),...s.filter(n=>e.find(d=>d.key===n.key)?.destroys)]},l=e.filter(n=>!n.exits);return{inline:[...o,...u,...f].map(n=>({...n,showLabel:!0})),menu:p.map(n=>({...n,showLabel:!0})),missingIcon:a,missingPrimary:t.surface!=="card"&&l.length>0&&!r.some(n=>n.primary)}}var R={key:{background:"var(--fos-primary)",ink:"var(--fos-primary-contrast)",border:null},normal:{background:"var(--fos-surface)",ink:"var(--fos-ink)",border:"var(--fos-line)"},quiet:{background:"transparent",ink:"var(--fos-ink-2)",border:null},danger:{background:"transparent",ink:"var(--fos-tone-stop)",border:"var(--fos-tone-stop)"}};export{h as a,N as b,O as c,b as d,S as e,E as f,y as g,g as h,B as i,R as j};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './_types/ui-kit/index.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunks/chunk-4LX2HZJU.js";import{a as c,b as d,c as g,d as h,e as i,f as j,g as k,h as l,i as n,j as q,k as s,l as u,m as v,n as w,o as y,p as z,q as A,r as B,s as C,t as D,u as E,v as F,w as G,x as H,y as I,z as J}from"./chunks/chunk-VS5FCRGY.js";import{a as K,b as L,c as M,d as N,e as O,f as P,g as Q,h as R,i as S}from"./chunks/chunk-7WHYHIUX.js";import{a as o,b as r,c as e,d as f,e as m,f as p,g as t,h as x,i as a,j as b}from"./chunks/chunk-X6SR5UHK.js";export{h as ABSENT,d as LONG_TEXT,l as NO_BLOCKS,b as TIER_PAINT,t as VISIBLE_SECONDARY,a as actionBar,C as actionButtons,B as actionFacts,z as actionForm,p as actionViews,f as assertNever,A as availableActions,Q as backOf,n as cellOf,q as defectsOf,K as domainOf,N as emptyTrail,s as errorsIn,j as fieldsOf,u as formatLensDiagnostics,c as formatter,x as inSightCount,y as listModel,e as matchState,F as milestoneModel,O as moveTrail,L as navModel,S as parseTrail,v as planColumns,H as presentationOf,m as primaryOf,E as queueModel,i as readValue,I as readersOf,D as recordModel,k as registryOf,R as returnOf,M as routesOf,o as skeletonFor,w as subjectOf,r as surfaceState,G as timelineModel,P as titleTrail,J as undeterminedIn,g as writeValue};
|
package/dist/lens.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './_types/ui-kit/lens/index.js';
|
package/dist/lens.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o,b as r,c as e,d as f,e as m,f as p,g as t,h as x,i as a,j as b,k as c,l as d,m as g,n as h,o as i,p as j,q as k,r as l,s as n,t as q,u as s,v as u,w as v,x as w,y,z}from"./chunks/chunk-VS5FCRGY.js";import"./chunks/chunk-X6SR5UHK.js";export{f as ABSENT,r as LONG_TEXT,x as NO_BLOCKS,n as actionButtons,l as actionFacts,j as actionForm,k as availableActions,a as cellOf,b as defectsOf,c as errorsIn,p as fieldsOf,d as formatLensDiagnostics,o as formatter,i as listModel,u as milestoneModel,g as planColumns,w as presentationOf,s as queueModel,m as readValue,y as readersOf,q as recordModel,t as registryOf,h as subjectOf,v as timelineModel,z as undeterminedIn,e as writeValue};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './_types/ui-kit/primitives/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o,b as r,c as e,d as f,e as m,f as p,g as t,h as x,i as a,j as b}from"./chunks/chunk-X6SR5UHK.js";export{b as TIER_PAINT,t as VISIBLE_SECONDARY,a as actionBar,p as actionViews,f as assertNever,x as inSightCount,e as matchState,m as primaryOf,o as skeletonFor,r as surfaceState};
|
package/dist/react.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './_types/ui-react/index.js';
|
package/dist/react.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as Ne}from"./chunks/chunk-X6SR5UHK.js";var ne="fos";function rt(e){if(!/^[a-z][a-z0-9-]*$/.test(e))throw new Error(`@dqa-ai-solutions/ui-react: prefix "${e}" is not a class stem (a-z, digits, dashes).`);ne=e}var ot=()=>ne,r=e=>`${ne}-${e}`,i=(...e)=>e.filter(Boolean).join(" ")||void 0;import{createElement as ke}from"react";function st({as:e,disabled:t,className:n,href:o,onClick:a,...c}){let l=i(r("link"),n);return t?ke("a",{...c,className:l,"aria-disabled":!0}):ke(e??"a",{...c,className:l,href:o,onClick:a})}import{createElement as re}from"react";var oe=e=>e?{"aria-invalid":!0}:{};function at({className:e,invalid:t,type:n="text",...o}){return re("input",{...o,type:n,className:i(r("field"),e),...oe(t)})}function it({className:e,invalid:t,children:n,...o}){return re("select",{...o,className:i(r("select"),e),...oe(t)},n)}function lt({className:e,invalid:t,...n}){return re("textarea",{...n,className:i(r("textarea"),e),...oe(t)})}var ct=/^(\.[A-Za-z0-9]+|[a-z]+\/(\*|[A-Za-z0-9.+-]+))$/,se=e=>(Array.isArray(e)?e.map(String):typeof e=="string"?e.split(","):[]).map(t=>t.trim()).filter(Boolean);function ut(e,t){let n={};if(!t)return n;if(e==="file")return t.accept?.length&&(n.accept=t.accept.join(",")),t.maxBytes!==void 0&&(n.maxBytes=t.maxBytes),n;if(e==="number"){let o=t.multipleOf;o!==void 0&&(n.step=o);let a=[t.minimum,t.exclusiveMinimum!==void 0?o!==void 0?t.exclusiveMinimum+o:t.exclusiveMinimum:void 0].filter(l=>l!==void 0);a.length&&(n.min=Math.max(...a));let c=[t.maximum,t.exclusiveMaximum!==void 0?o!==void 0?t.exclusiveMaximum-o:t.exclusiveMaximum:void 0].filter(l=>l!==void 0);return c.length&&(n.max=Math.min(...c)),n}if(e==="date"||e==="datetime"){let o=a=>e==="date"?a.slice(0,10):a.length===10?`${a}T00:00`:a.replace(" ","T").slice(0,16);return t.formatMinimum!==void 0&&(n.min=o(t.formatMinimum)),t.formatMaximum!==void 0&&(n.max=o(t.formatMaximum)),n}return e.endsWith("[]")?(t.maxItems!==void 0&&t.maxLength!==void 0&&(n.maxLength=t.maxItems*(t.maxLength+1)-1),n):(t.maxLength!==void 0&&(n.maxLength=t.maxLength),t.minLength!==void 0&&(n.minLength=t.minLength),t.pattern!==void 0&&(n.pattern=t.pattern),n)}import{jsx as P,jsxs as mt}from"react/jsx-runtime";import{useId as dt,useRef as ft,useState as ae}from"react";function we(e,t,n){if(n!==void 0&&e.size>n)return{keyword:"maxBytes",limit:n,file:e};let o=se(t);if(o.length){let a=e.name.toLowerCase(),c=(e.type??"").toLowerCase();if(!o.some(p=>{let m=p.toLowerCase();return m.startsWith(".")?a.endsWith(m):m.endsWith("/*")?c!==""&&c.startsWith(m.slice(0,-1)):c===m}))return{keyword:"accept",limit:o,file:e}}return null}function pt({main:e,chosenMain:t,hint:n,chosenHint:o,clearLabel:a,mark:c,chosenMark:l,onPick:p,maxBytes:m,refused:d,onRefuse:w,invalid:j,className:E,id:u,disabled:b,...N}){let h=dt(),S=u??`file-${h}`,f=ft(null),[s,g]=ae(null),[x,y]=ae(null),[k,v]=ae(!1),T=D=>{y(null),g(D),p?.(D)},O=D=>{let A=we(D,N.accept,m);return A?(f.current&&(f.current.value=""),s&&p?.(null),g(null),y(A),w?.(A),!1):!0},tt=D=>{if(D.preventDefault(),v(!1),b)return;let A=D.dataTransfer?.files?.[0];if(!A||!f.current||!O(A))return;let ve=new DataTransfer;ve.items.add(A),f.current.files=ve.files,T(A)},nt=D=>{D.preventDefault(),D.stopPropagation(),f.current&&(f.current.value=""),T(null)},ye=x&&d?d(x):s?o??n:n;return mt("label",{className:i(r("file"),s&&r("file--has"),k&&r("file--over"),E),htmlFor:S,...j||x?{"aria-invalid":!0}:{},onDragOver:D=>{D.preventDefault(),b||v(!0)},onDragLeave:()=>v(!1),onDrop:tt,children:[P("input",{...N,ref:f,id:S,type:"file",disabled:b,onChange:D=>{let A=D.target.files?.[0]??null;A&&!O(A)||T(A)}}),P("span",{className:r("file-mark"),"aria-hidden":"true",children:s?l??c:c}),P("span",{className:r("file-main"),children:s?t?.(s)??s.name:e}),ye!=null&&P("span",{className:r("file-hint"),...x?{role:"alert"}:{},children:ye}),s&&a!=null&&P("button",{type:"button",className:i(r("btn"),r("btn--normal"),r("file-clear")),onClick:nt,children:a})]})}var xt=e=>e>=1024*1024?`${(e/1024/1024).toFixed(1)} MB`:`${Math.ceil(e/1024)} KB`;import{createElement as je}from"react";var Ee=(e,t)=>function({children:o,className:a,...c}){return je("label",{className:i(r(e),a)},je("input",{...c,type:t}),o)},ht=Ee("check","checkbox"),bt=Ee("radio","radio");import{createElement as Ce}from"react";function gt({summary:e,children:t,summaryClassName:n,className:o,...a}){return Ce("details",{...a,className:o},Ce("summary",{className:i(r("disclosure"),n)},e),t)}import{jsx as Z,jsxs as yt}from"react/jsx-runtime";import{createElement as Te}from"react";function vt({tone:e,className:t,children:n,...o}){return n==null||n===!1||n===""?null:Z("div",{...o,className:i(r("notice"),e&&r(`notice--${e}`),t),children:n})}function Nt({compact:e,as:t="div",className:n,children:o,...a}){return Te(t,{...a,className:i(r("empty"),e&&r("empty--compact"),n)},o)}function kt({lines:e=3,label:t,className:n,...o}){return yt("div",{...o,role:"status","aria-live":"polite","aria-busy":"true",className:n,children:[Z("span",{className:r("sr-only"),children:t}),Array.from({length:e},(a,c)=>Z("div",{className:r("skeleton"),"aria-hidden":"true"},c))]})}function wt({label:e,decorative:t,className:n,children:o,...a}){return Z("svg",{...a,className:i(r("icon"),n),...t?{"aria-hidden":!0,focusable:"false"}:{role:"img","aria-label":e},children:o})}var jt=({children:e})=>Te("span",{className:r("sr-only")},e);import{jsx as z,jsxs as Oe}from"react/jsx-runtime";import{useEffect as R,useId as Bt,useRef as ue}from"react";import{jsx as $,jsxs as Se}from"react/jsx-runtime";import{useEffect as Tt,useId as Dt,useSyncExternalStore as Ae}from"react";import{Fragment as Et,jsxs as Ct}from"react/jsx-runtime";import{createElement as De}from"react";function L(e){let{tier:t="normal",type:n="button",icon:o,busy:a,as:c,className:l,children:p,label:m,...d}=e,w=p==null,j=i(r("btn"),r(`btn--${t}`),w&&r("btn--icon"),l),E={...d,className:j,...m?{"aria-label":m,title:d.title??m}:{},...a?{"aria-busy":!0,disabled:!0}:{},children:Ct(Et,{children:[o,p]})};return c?De(c,E):De("button",{...E,type:n})}var St=0,M=[],Q=!1,q=[],le=null,B=new Map,ie=new Set,Me={items:M,top:void 0,labels:le},H=()=>{Me={items:M,top:q[q.length-1],labels:le};for(let e of ie)e()},Le=e=>(ie.add(e),()=>{ie.delete(e)}),X=()=>Me,Ie=e=>{e.ms<=0||Q||(e.since=Date.now(),B.set(e.id,setTimeout(()=>K(e.id),e.left)))};function At(e,t={}){let n=t.tone??"done",o=t.ms??(n==="stop"||n==="warn"?0:5e3),a={id:++St,tone:n,title:e,detail:t.detail,ms:o,left:o,since:0},c=M.find(l=>l.tone===n&&typeof l.title=="string"&&l.title===e);return c&&K(c.id),M=[...M,a],Ie(a),H(),a.id}function K(e){let t=B.get(e);t&&clearTimeout(t),B.delete(e),M.some(n=>n.id===e)&&(M=M.filter(n=>n.id!==e),H())}function Mt(){for(let e of B.values())clearTimeout(e);B.clear(),Q=!1,M.length&&(M=[],H())}var V=e=>{if(Q!==e){Q=e;for(let t of M)if(!(t.ms<=0))if(e){let n=B.get(t.id);n&&(clearTimeout(n),B.delete(t.id),t.left=Math.max(800,t.left-(Date.now()-t.since)))}else Ie(t)}};function _e(){let e=Dt();return Tt(()=>(q.push(e),H(),()=>{let n=q.lastIndexOf(e);n>=0&&q.splice(n,1),H()}),[e]),Ae(Le,X,X).top===e}function Be(){let e=Ae(Le,X,X);if(!e.items.length||!e.labels)return null;let{label:t,closeLabel:n,closeIcon:o}=e.labels;return $("section",{"aria-label":t,className:r("toasts"),onMouseEnter:()=>V(!0),onMouseLeave:()=>V(!1),onFocus:()=>V(!0),onBlur:()=>V(!1),children:e.items.map(a=>Se("div",{role:a.tone==="stop"?"alert":"status",className:i(r("toast"),r(`toast--${a.tone}`)),children:[Se("div",{className:r("toast-body"),children:[$("span",{children:a.title}),a.detail!=null&&$("span",{className:r("hint"),children:a.detail})]}),$(L,{tier:"quiet",icon:o,label:n,onClick:()=>K(a.id)})]},a.id))})}function Lt({label:e,closeLabel:t,closeIcon:n}){return le={label:e,closeLabel:t,closeIcon:n},_e()?$(Be,{}):null}function Fe(){return _e()?$(Be,{}):null}import{createContext as It,useContext as _t}from"react";var ce=It(null),$e=()=>_t(ce);var Ft='input:not([type="hidden"]):not(:disabled), select:not(:disabled), textarea:not(:disabled)';function $t({open:e,onClose:t,onGuard:n,isDirty:o,dirtyWithin:a,autoFocusWithin:c,className:l,children:p,...m}){let d=ue(null),w=ue(!1),j=()=>o?o():w.current,E=()=>{j()&&n?n():t()};return R(()=>{let u=d.current;if(u){if(e&&!u.open){u.showModal();let N=(c?u.querySelector(c):u)?.querySelector(Ft);N?N.focus():u.focus()}!e&&u.open&&u.close(),e&&(w.current=!1)}},[e,c]),R(()=>{let u=d.current;if(!u||!e)return;let b=N=>{let h=N.target;(!a||h?.closest(a))&&(w.current=!0)};return u.addEventListener("input",b),u.addEventListener("change",b),()=>{u.removeEventListener("input",b),u.removeEventListener("change",b)}}),R(()=>{let u=d.current;if(!u)return;let b=N=>{j()&&n&&(N.preventDefault(),n())};return u.addEventListener("cancel",b),()=>u.removeEventListener("cancel",b)}),R(()=>{let u=d.current;if(!u)return;let b=()=>t();return u.addEventListener("close",b),()=>u.removeEventListener("close",b)}),e?z(ce.Provider,{value:{requestClose:E},children:Oe("dialog",{...m,ref:d,tabIndex:-1,className:i(r("dialog"),l),onClick:u=>{u.target===d.current&&E()},children:[typeof p=="function"?p({requestClose:E}):p,z(Fe,{})]})}):null}function Ot({className:e,children:t,...n}){return z("div",{...n,className:i(r("dialog-body"),e),children:t})}function Pt({title:e,closeLabel:t,closeIcon:n,closeDisabled:o,children:a,className:c}){let l=$e(),p=Bt(),m=ue(null);return R(()=>{let d=m.current?.closest("dialog");d&&!d.hasAttribute("aria-labelledby")&&!d.hasAttribute("aria-label")&&d.setAttribute("aria-labelledby",p)}),Oe("header",{ref:m,className:i(r("dialog-head"),c),children:[z("h2",{id:p,className:r("dialog-title"),children:e}),a,z(L,{tier:"quiet",icon:n,label:t,className:r("dialog-close"),disabled:o?!0:void 0,title:o||t,onClick:()=>l?.requestClose()})]})}import{jsx as me,jsxs as qt}from"react/jsx-runtime";import{useId as Ht,useState as Pe}from"react";var qe=e=>e.toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/đ/g,"d");function Rt({value:e,onValue:t,options:n,max:o=8,className:a,invalid:c,...l}){let p=Ht(),[m,d]=Pe(!1),[w,j]=Pe(-1),E=qe(e??""),u=(n??[]).filter(f=>f!==e&&qe(f).includes(E)).slice(0,o),b=m&&u.length>0,N=()=>{d(!1),j(-1)},h=f=>{t(f),N()};function S(f){if(l.onKeyDown?.(f),!b){f.key==="ArrowDown"&&u.length&&(f.preventDefault(),d(!0),j(0));return}f.key==="ArrowDown"?(f.preventDefault(),j(s=>(s+1)%u.length)):f.key==="ArrowUp"?(f.preventDefault(),j(s=>(s-1+u.length)%u.length)):f.key==="Enter"&&w>=0?(f.preventDefault(),h(u[w])):f.key==="Escape"&&(f.preventDefault(),f.stopPropagation(),N())}return qt("span",{className:i(r("suggest"),a),children:[me("input",{...l,type:"text",className:r("field"),...c?{"aria-invalid":!0}:{},value:e,onChange:f=>{t(f.target.value),d(!0),j(-1)},onFocus:f=>{l.onFocus?.(f),d(!0)},onBlur:f=>{l.onBlur?.(f),N()},onKeyDown:S,role:"combobox","aria-expanded":b,"aria-controls":b?p:void 0,"aria-activedescendant":w>=0?`${p}-${w}`:void 0,"aria-autocomplete":"list",autoComplete:"off"}),b&&me("ul",{id:p,role:"listbox",className:i(r("menu"),r("menu--pop")),children:u.map((f,s)=>me("li",{id:`${p}-${s}`,role:"option","aria-selected":s===w,className:r("menu-item"),onMouseDown:g=>g.preventDefault(),onClick:()=>h(f),children:f},f))})]})}import{jsx as de,Fragment as zt,jsxs as Ut}from"react/jsx-runtime";import{createElement as He}from"react";var fe=({label:e,className:t,children:n,...o})=>de("ul",{...o,role:"menu","aria-label":e,className:i(r("menu"),t),children:n});function pe({icon:e,current:t,as:n,className:o,children:a,...c}){let l=Ut(zt,{children:[e,a]}),p={...c,role:"menuitem",className:i(r("menu-item"),o),...t?{"aria-current":"page"}:{}};return de("li",{role:"none",children:n?He(n,p,l):He("button",{...p,type:"button"},l)})}var Wt=()=>de("li",{role:"separator"});import{jsx as I,jsxs as U,Fragment as Yt}from"react/jsx-runtime";import{useEffect as Zt,useId as Vt,useRef as ze}from"react";import{createContext as Jt,useContext as Rr}from"react";var Re=Jt(!1);var Je=["key","label","advances","outcome","exits","destroys","primary","busy","disabled","provisional"],Qt=new Set([...Je,"icon","onSelect","as","type","form"]),Ue=e=>Object.fromEntries(Object.entries(e).filter(([t])=>!Qt.has(t))),We=e=>e.disabled?[e.disabled.because,e.disabled.hint].filter(Boolean).join(" \u2014 "):null;function Xt({surface:e,label:t,moreIcon:n,moreLabel:o,actions:a,className:c}){let l=Vt(),p=ze(null),m=ze(!1),d=()=>typeof document>"u"?null:document.getElementById(l),w=a.filter(s=>!!s),j=new Map(w.map(s=>[s.key,s])),E=w.map(s=>{let g={};for(let x of Je)s[x]!==void 0&&(g[x]=s[x]);return s.icon!=null&&(g.icon=s.key),g}),u=Ne(E,{surface:e}),b=e!=="table";Zt(()=>{let s=d();if(!s)return;let g=y=>{if(y.newState!=="open")return;let k=document.querySelector(`[popovertarget="${CSS.escape(l)}"]`)?.getBoundingClientRect();if(!k)return;let v=k.bottom+4+s.offsetHeight<=window.innerHeight;s.style.top=`${v?k.bottom+4:Math.max(8,k.top-4-s.offsetHeight)}px`,s.style.left=`${Math.max(8,k.right-s.offsetWidth)}px`,m.current&&s.querySelector('[role="menuitem"]:not([disabled])')?.focus()},x=y=>{let k=Array.from(s.querySelectorAll('[role="menuitem"]:not([disabled])')),v=k.indexOf(document.activeElement);y.key==="ArrowDown"?(y.preventDefault(),k[(v+1)%k.length]?.focus()):y.key==="ArrowUp"&&(y.preventDefault(),k[(v-1+k.length)%k.length]?.focus())};return s.addEventListener("toggle",g),s.addEventListener("keydown",x),()=>{s.removeEventListener("toggle",g),s.removeEventListener("keydown",x)}},[l,u.menu.length]);let N=u.inline.some(s=>s.primary),h=[],S=u.inline.map(s=>{let g=j.get(s.key),x=We(s),y={...Ue(g),tier:s.tier,busy:s.busy,as:g.as,type:g.type,form:g.form,disabled:x?!0:void 0,title:x??void 0,"aria-describedby":x||s.provisional?`${l}-${s.key}`:void 0,onClick:g.onSelect},k=s.showLabel?I(L,{...y,icon:g.icon,children:s.label},s.key):I(L,{...y,icon:g.icon,label:s.label},s.key),v=x??s.provisional;return v?e==="table"?U("span",{className:r("actions"),children:[k,I("span",{id:`${l}-${s.key}`,className:r("sr-only"),children:v})]},s.key):(h.push({key:s.key,label:s.label,note:v,primary:s.primary}),k):k}),f=h.length>0&&I("ul",{className:r("actions-why"),children:h.map(s=>I("li",{id:`${l}-${s.key}`,className:r("hint"),children:h.length>1?`${s.label} \u2014 ${s.note}`:s.note},s.key))});return I(Re.Provider,{value:!0,children:U("div",{ref:p,role:"group","aria-label":t,className:i(r("actions"),h.length>0&&r("actions--noted"),c),"data-fos-primary":N?"":void 0,"data-fos-card":e==="card"?"":void 0,children:[S,u.menu.length>0&&U(Yt,{children:[I(L,{tier:"quiet",icon:n,...b&&o?{children:o,"aria-label":`${o}: ${t}`}:{label:t,className:r("btn--menu")},"aria-haspopup":"menu",popoverTarget:l,onPointerDown:()=>{m.current=!1},onKeyDown:s=>{["Enter"," ","ArrowDown","ArrowUp"].includes(s.key)&&(m.current=!0)}}),I(fe,{label:t,id:l,popover:"auto",style:{position:"fixed",inset:"auto",margin:0,maxHeight:"60vh",overflowY:"auto"},children:u.menu.map(s=>{let g=j.get(s.key),x=We(s);return U(pe,{...Ue(g),icon:g.icon,as:g.as,disabled:x||s.busy?!0:void 0,title:x??void 0,"data-tier":s.tier,onClick:()=>{d()?.hidePopover?.(),g.onSelect?.()},children:[s.label,x&&U("span",{className:r("hint"),children:[" \xB7 ",x]})]},s.key)})})]}),f]})})}import{jsx as Ze,Fragment as Kt,jsxs as Gt}from"react/jsx-runtime";import{createElement as Ye}from"react";var en=({label:e,className:t,children:n,...o})=>Ze("div",{...o,role:"group","aria-label":e,className:i(r("segmented"),t),children:n});function tn({icon:e,current:t,count:n,as:o,className:a,children:c,...l}){let p=Gt(Kt,{children:[e,c,n!=null&&Ze("span",{className:r("count"),children:n})]}),m=t?{"aria-current":"page"}:{},d=i(r("segmented-item"),a);return o?Ye(o,{...l,className:d,...m},p):Ye("button",{...l,type:"button",className:d,...m},p)}import{jsxs as ee,jsx as W}from"react/jsx-runtime";import{useEffect as nn,useId as rn,useRef as Ve,useState as xe}from"react";function G(e){let t=e?.getBoundingClientRect();return t?{up:window.innerHeight-t.bottom<240&&t.top>240,end:t.left>window.innerWidth/2}:{up:!1,end:!1}}function on({label:e,value:t,options:n,onPick:o,addLabel:a,clearLabel:c,clearIcon:l,className:p}){let[m,d]=xe(!1),[w,j]=xe(!1),[E,u]=xe(!1),b=Ve(null),N=Ve(null),h=rn(),S=n.find(s=>s.value===t&&s.value!=="");nn(()=>{if(!m){j(!1),u(!1);return}let s=G(N.current);j(s.up),u(s.end);let g=v=>{b.current?.contains(v.target)||d(!1)},x=v=>{let T=Array.from(b.current?.querySelectorAll('[role="option"]')??[]);if(!T.length)return;let O=T.indexOf(document.activeElement);if(v.key==="Escape"){d(!1),N.current?.focus();return}v.key==="ArrowDown"?(v.preventDefault(),T[(O+1)%T.length]?.focus()):v.key==="ArrowUp"?(v.preventDefault(),T[(O-1+T.length)%T.length]?.focus()):v.key==="Home"?(v.preventDefault(),T[0]?.focus()):v.key==="End"&&(v.preventDefault(),T[T.length-1]?.focus())},y=b.current?.querySelectorAll('[role="option"]');return(b.current?.querySelector('[aria-selected="true"]')??y?.[0])?.focus(),document.addEventListener("mousedown",g),document.addEventListener("keydown",x),()=>{document.removeEventListener("mousedown",g),document.removeEventListener("keydown",x)}},[m]);let f=s=>{d(!1),N.current?.focus(),o(s)};return ee("div",{className:i(r("menu-anchor"),p),ref:b,children:[S?ee("span",{className:r("actions"),children:[ee("button",{ref:N,type:"button",className:i(r("btn"),r("btn--normal")),"aria-haspopup":"listbox","aria-expanded":m,"aria-controls":m?h:void 0,onClick:()=>d(s=>!s),children:[e,": ",S.label]}),W("button",{type:"button",className:i(r("btn"),r("btn--quiet"),r("btn--icon")),"aria-label":c,onClick:()=>o(""),children:l??"\xD7"})]}):W("button",{ref:N,type:"button",className:i(r("btn"),r("btn--quiet")),"aria-haspopup":"listbox","aria-expanded":m,"aria-controls":m?h:void 0,onClick:()=>d(s=>!s),children:a}),m&&W("ul",{id:h,role:"listbox","aria-label":e,className:i(r("menu"),r("menu--pop"),w&&r("menu--pop-up"),E&&r("menu--pop-end")),children:n.map(s=>W("li",{role:"none",children:ee("button",{type:"button",role:"option","aria-selected":s.value===t,className:r("menu-item"),onClick:()=>f(s.value),children:[s.label,s.count!=null&&W("span",{className:r("count"),children:s.count})]})},s.value||"\xB7"))})]})}import{jsx as J,jsxs as te,Fragment as sn}from"react/jsx-runtime";import{useCallback as Qe,useEffect as an,useId as ln,useRef as Xe,useState as he}from"react";function cn({label:e,trigger:t,choices:n,visibility:o,onChange:a,resetLabel:c,customised:l,className:p}){let[m,d]=he(!1),[w,j]=he({up:!1,end:!1}),E=Xe(null),u=Xe(null),b=ln();an(()=>{if(!m){j({up:!1,end:!1});return}j(G(u.current));let h=()=>Array.from(E.current?.querySelectorAll('input[type="checkbox"]:not(:disabled)')??[]);h()[0]?.focus();let S=x=>{E.current?.contains(x.target)||d(!1)},f=x=>{if(x.key==="Escape"){d(!1),u.current?.focus();return}let y=h(),k=y.indexOf(document.activeElement);k<0||(x.key==="ArrowDown"?(x.preventDefault(),y[(k+1)%y.length]?.focus()):x.key==="ArrowUp"?(x.preventDefault(),y[(k-1+y.length)%y.length]?.focus()):x.key==="Home"?(x.preventDefault(),y[0]?.focus()):x.key==="End"&&(x.preventDefault(),y[y.length-1]?.focus()))},s=x=>{let y=x.relatedTarget;y&&!E.current?.contains(y)&&d(!1)},g=E.current;return document.addEventListener("mousedown",S),document.addEventListener("keydown",f),g?.addEventListener("focusout",s),()=>{document.removeEventListener("mousedown",S),document.removeEventListener("keydown",f),g?.removeEventListener("focusout",s)}},[m]);let N=h=>{h.locked||a({...o,[h.key]:!h.shown})};return te("div",{className:i(r("menu-anchor"),p),ref:E,children:[J("button",{ref:u,type:"button",className:i(r("btn"),r("btn--quiet")),"aria-expanded":m,"aria-controls":m?b:void 0,onClick:()=>d(h=>!h),children:t}),m&&te("div",{id:b,role:"group","aria-label":e,className:i(r("menu"),r("menu--pop"),w.up&&r("menu--pop-up"),w.end&&r("menu--pop-end")),children:[n.map(h=>te("label",{className:r("menu-item"),children:[J("input",{type:"checkbox",checked:h.shown||!!h.locked,disabled:h.locked,onChange:()=>N(h)}),h.label,h.hint!=null&&J("span",{className:r("count"),children:h.hint})]},h.key)),l&&c!=null&&te(sn,{children:[J("div",{role:"separator"}),J("button",{type:"button",className:r("menu-item"),onClick:()=>a({}),children:c})]})]})]})}function un(e){let t=Qe(()=>{if(!e)return{};try{let l=JSON.parse(globalThis.localStorage?.getItem(e)??"{}");return!l||typeof l!="object"||Array.isArray(l)?{}:Object.fromEntries(Object.entries(l).filter(([,p])=>typeof p=="boolean"))}catch{return{}}},[e]),[n,o]=he(()=>({key:e,value:t()})),a=n.key===e?n.value:t();n.key!==e&&o({key:e,value:a});let c=Qe(l=>{if(o({key:e,value:l}),!!e)try{Object.keys(l).length?globalThis.localStorage?.setItem(e,JSON.stringify(l)):globalThis.localStorage?.removeItem(e)}catch{}},[e]);return[a,c]}import{jsx as Ke,Fragment as mn,jsxs as dn}from"react/jsx-runtime";import{createElement as be}from"react";var fn=({label:e,className:t,children:n})=>Ke("div",{role:"tablist","aria-label":e,className:t,children:n});function pn({icon:e,current:t,count:n,as:o,className:a,children:c,...l}){let p=dn(mn,{children:[e,c,n!=null&&Ke("span",{className:r("count"),children:n})]}),m={role:"tab","aria-selected":!!t},d=i(r("tab"),a);return o?be(o,{...l,...m,className:d},p):be("button",{...l,...m,type:"button",className:d},p)}function xn({current:e,as:t,dense:n,className:o,children:a,...c}){let l=i(r("rail-item"),n&&r("rail-item--dense")),p=typeof o=="function"?m=>i(l,o(m)):i(l,o);return be(t??"a",{...c,className:p,...e?{"aria-current":"page"}:{}},a)}import{jsx as C,jsxs as hn}from"react/jsx-runtime";import{createContext as bn,useContext as gn}from"react";var Ge=bn(!1);function yn({sticky:e,wrap:t=!0,wrapClassName:n,className:o,children:a,...c}){let l=C("table",{...c,className:i(r("table"),e&&r("table--sticky"),o),children:a});return t?C("div",{className:i(r("table-wrap"),n),children:l}):l}var vn=({children:e,...t})=>C(Ge.Provider,{value:!0,children:C("thead",{...t,children:e})}),Nn=({children:e,...t})=>C("tbody",{...t,children:e}),kn=({selected:e,children:t,...n})=>C("tr",{...n,...e?{"aria-selected":!0}:{},children:t});function wn({numeric:e,className:t,children:n,...o}){let a=gn(Ge);return C("th",{...o,...a?{scope:"col"}:{},className:i(e&&r("num"),t),children:n})}function jn({lead:e,className:t,children:n,...o}){return C("th",{...o,scope:"row",className:t,children:hn("span",{className:r("row-head"),children:[C("span",{className:r("row-head-lead"),children:e}),C("span",{className:r("row-head-text"),children:n})]})})}var En=({numeric:e,className:t,children:n,...o})=>C("td",{...o,className:i(e&&r("num"),t),children:n});function Cn({label:e,cell:t=!0,className:n,...o}){let a=C("label",{className:i(r("pick"),!t&&n),children:C("input",{...o,type:"checkbox","aria-label":e})});return t?C("td",{className:i(r("pick-cell"),n),children:a}):a}var Tn=({open:e,label:t,className:n,children:o,...a})=>C("button",{...a,type:"button","aria-expanded":e,"aria-label":t,className:i(r("tree-toggle"),n),children:o});import{jsx as _,Fragment as Dn,jsxs as Sn}from"react/jsx-runtime";import{createElement as Y}from"react";var ge=e=>function({as:n,className:o,children:a,...c}){return Y(n??"div",{...c,className:i(r(e),o)},a)},An=ge("card"),Mn=ge("card-head"),Ln=ge("card-body");function In({stacked:e,className:t,children:n,...o}){return _("dl",{...o,className:i(r("facts"),e&&r("facts--stacked"),t),children:n})}function _n({name:e,children:t}){return Sn(Dn,{children:[_("dt",{children:e}),_("dd",{children:t})]})}function Bn({tone:e,className:t,children:n,label:o,...a}){let c=n==null||n===""||n===!1;return _("span",{...a,className:i(r("badge"),e&&r(`badge--${e}`),c&&r("badge--bare"),t),...o?{"aria-label":o,title:o}:{},children:n})}function Fn({as:e,className:t,children:n,...o}){return Y(e??"div",{...o,className:i(r("legend"),t)},n)}function $n({as:e,className:t,children:n,...o}){return Y(e??"span",{...o,className:i(r("count"),t)},n)}function On({as:e,className:t,children:n,...o}){return Y(e??"span",{...o,className:i(r("tag"),t)},n)}function Pn({value:e,max:t,tone:n,label:o,className:a,...c}){let l=t>0?Math.max(0,Math.min(1,e/t)):0;return _("div",{...c,className:i(r("meter"),n&&r(`meter--${n}`),a),role:"meter","aria-label":o,"aria-valuenow":e,"aria-valuemin":0,"aria-valuemax":t,children:_("span",{style:{width:`${l*100}%`}})})}function qn({src:e,initials:t,label:n,imgProps:o,className:a,...c}){return _("span",{...c,className:i(r("avatar"),a),role:"img","aria-label":n,children:e?_("img",{...o,src:e,alt:""}):t})}function Hn({as:e,className:t,children:n,...o}){return Y(e??"div",{...o,className:i(r("provenance"),t)},n)}import{jsx as F,jsxs as et}from"react/jsx-runtime";function Rn({label:e,className:t,children:n,...o}){return F("div",{...o,className:i(r("milestones"),t),role:"group","aria-label":e,children:n})}function zn({label:e,standing:t,gate:n,awaiting:o,settled:a,who:c,mark:l,className:p,...m}){return et("div",{...m,className:i(r("milestone"),r(`milestone--${t}`),n&&r("milestone--gate"),o&&r("milestone--awaiting"),a&&r(`milestone--${a}`),p),"aria-current":t==="current"?"step":void 0,children:[F("span",{className:r("milestone-dot"),"aria-hidden":"true",children:l}),F("span",{className:r("milestone-label"),children:e}),c&&F("span",{className:r("milestone-who"),children:c})]})}function Un({className:e,children:t,...n}){return F("div",{...n,className:i(r("milestones-foot"),e),children:t})}function Wn({mark:e,className:t,children:n,...o}){return et("p",{...o,className:i(r("milestone-note"),t),children:[F("span",{"aria-hidden":"true",children:e}),F("span",{children:n})]})}export{ct as ACCEPT_ITEM,Xt as ActionBar,qn as Avatar,Bn as Badge,L as Button,An as Card,Ln as CardBody,Mn as CardHead,ht as Check,cn as ColumnPicker,$n as Count,$t as Dialog,Ot as DialogBody,Pt as DialogHead,gt as Disclosure,Nt as Empty,_n as Fact,In as Facts,at as Field,pt as FileField,on as FilterSelect,wt as Icon,Fn as Legend,st as Link,fe as Menu,pe as MenuItem,Wt as MenuSeparator,Pn as Meter,zn as Milestone,Wn as MilestoneNote,Rn as Milestones,Un as MilestonesFoot,vt as Notice,Cn as Pick,Hn as Provenance,bt as Radio,xn as RailItem,jn as RowHeader,en as Segmented,tn as SegmentedItem,it as Select,kt as Skeleton,jt as SrOnly,Rt as Suggest,Nn as TBody,vn as THead,pn as Tab,yn as Table,fn as Tabs,On as Tag,En as Td,lt as Textarea,wn as Th,Lt as Toaster,kn as Tr,Tn as TreeToggle,se as acceptItems,r as cls,i as cx,Mt as dismissAllToasts,K as dismissToast,ut as fieldAttributes,we as fileRefusal,xt as fileSize,ot as prefix,rt as setPrefix,At as toast,un as useColumnVisibility};
|
package/dist/shell.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './_types/ui-kit/shell/index.js';
|
package/dist/shell.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o,b as r,c as e,d as f,e as m,f as p,g as t,h as x,i as a}from"./chunks/chunk-7WHYHIUX.js";export{t as backOf,o as domainOf,f as emptyTrail,m as moveTrail,r as navModel,a as parseTrail,x as returnOf,e as routesOf,p as titleTrail};
|
package/dist/tokens.css
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/* @dqa-ai-solutions/ui-kit — MỘT nguồn sự thật cho màu và nhịp của mọi giao diện FOS.
|
|
2
|
+
*
|
|
3
|
+
* Vì sao gói riêng, không copy-paste: hai app nằm ở hai repo khác nhau. Hai bảng màu chép tay
|
|
4
|
+
* thì chắc chắn lệch nhau, và đã lệch: app thứ nhất `--color-bg #f7f8fa` / `--color-primary #2554eb`;
|
|
5
|
+
* app thứ hai `--bg #f5f6f8` / `--brand #2f3aa3`. Không chỉ khác GIÁ TRỊ mà khác cả CÁCH ĐẶT TÊN,
|
|
6
|
+
* nên không sửa được bằng cách chỉnh vài mã màu.
|
|
7
|
+
*
|
|
8
|
+
* Chiến lược: một bộ tên chuẩn `--fos-*`, cộng ALIAS về tên cũ của từng app. Nhờ vậy giá trị hội tụ
|
|
9
|
+
* NGAY hôm nay mà không phải sửa hàng trăm dòng CSS; tên sẽ hội tụ dần. Alias chỉ được PHÉP NGẮN đi.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
:root {
|
|
13
|
+
/* ── Nền & bề mặt ─────────────────────────────────────────────────────── */
|
|
14
|
+
--fos-bg: #f5f6f8;
|
|
15
|
+
--fos-surface: #ffffff;
|
|
16
|
+
--fos-surface-2: #fafbfc;
|
|
17
|
+
|
|
18
|
+
/* ── Chữ ──────────────────────────────────────────────────────────────── */
|
|
19
|
+
--fos-ink: #1a1f29; /* chính */
|
|
20
|
+
--fos-ink-2: #565d6b; /* phụ */
|
|
21
|
+
--fos-ink-3: #6b7385; /* mờ — ≥4.5:1 trên nền trắng (WCAG AA cho chữ thường); trước #8a909c ~3.2:1 chưa đạt */
|
|
22
|
+
|
|
23
|
+
/* ── Đường viền ───────────────────────────────────────────────────────── */
|
|
24
|
+
--fos-line: #e3e6eb;
|
|
25
|
+
--fos-line-2: #eef0f4;
|
|
26
|
+
|
|
27
|
+
/* ── Thương hiệu & trạng thái ─────────────────────────────────────────── */
|
|
28
|
+
/* Một primary duy nhất. Trước đây app thứ nhất dùng #2554eb còn app thứ hai #2f3aa3 — hai màu "xanh
|
|
29
|
+
* đáng tin cậy" khác nhau trên hai màn hình mà người dùng nhảy qua lại trong một phiên.
|
|
30
|
+
* Nay hội tụ về THƯƠNG HIỆU DQA: Cobalt #0047AB (tin cậy, chiều sâu công nghệ) là primary;
|
|
31
|
+
* Deep Sky #00BFFF (dòng chảy dữ liệu) và Turquoise #00CED1 (đổi mới) là accent/gradient nhận diện;
|
|
32
|
+
* Steel Blue #1A5392 cho chữ phụ / nhấn thương hiệu. */
|
|
33
|
+
--fos-primary: #0047ab;
|
|
34
|
+
--fos-primary-contrast: #ffffff;
|
|
35
|
+
--fos-primary-bg: #e6eef8;
|
|
36
|
+
|
|
37
|
+
/* Accent thương hiệu (gradient nhận diện Cobalt → Deep Sky → Turquoise) */
|
|
38
|
+
--fos-accent: #00bfff;
|
|
39
|
+
--fos-accent-2: #00ced1;
|
|
40
|
+
--fos-steel: #1a5392;
|
|
41
|
+
--fos-gradient-brand: linear-gradient(135deg, #0047ab 0%, #00bfff 55%, #00ced1 100%);
|
|
42
|
+
|
|
43
|
+
--fos-ok: #107a4d; --fos-ok-bg: #e6f4ec;
|
|
44
|
+
--fos-warn: #a86510; --fos-warn-bg: #fbf0db;
|
|
45
|
+
--fos-bad: #c5372c; --fos-bad-bg: #fbe9e7;
|
|
46
|
+
--fos-info: #0047ab; --fos-info-bg: #e6eef8;
|
|
47
|
+
--fos-muted: #8a909c; --fos-muted-bg: #f0f1f4;
|
|
48
|
+
|
|
49
|
+
/* ── Nhịp (thang 4px) ─────────────────────────────────────────────────── */
|
|
50
|
+
--fos-s1: 4px; --fos-s2: 8px; --fos-s3: 12px; --fos-s4: 16px;
|
|
51
|
+
--fos-s5: 24px; --fos-s6: 32px; --fos-s7: 48px;
|
|
52
|
+
|
|
53
|
+
/* ── Cỡ chữ ───────────────────────────────────────────────────────────── */
|
|
54
|
+
--fos-t-caption: 12px; --fos-t-body: 14px; --fos-t-body-lg: 16px;
|
|
55
|
+
--fos-t-h3: 20px; --fos-t-h2: 24px; --fos-t-h1: 28px;
|
|
56
|
+
|
|
57
|
+
/* ── Bo góc & bóng ────────────────────────────────────────────────────── */
|
|
58
|
+
--fos-r: 8px; --fos-r-sm: 6px;
|
|
59
|
+
--fos-sh-1: 0 1px 2px rgba(19, 23, 34, .04);
|
|
60
|
+
--fos-sh-2: 0 1px 3px rgba(19, 23, 34, .07), 0 1px 2px rgba(19, 23, 34, .04);
|
|
61
|
+
--fos-sh-3: 0 12px 28px -10px rgba(19, 23, 34, .16);
|
|
62
|
+
|
|
63
|
+
/* ── Chuyển động ──────────────────────────────────────────────────────── */
|
|
64
|
+
--fos-dur-fast: 120ms; --fos-dur-base: 180ms;
|
|
65
|
+
--fos-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
|
|
66
|
+
--fos-ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
|
|
67
|
+
|
|
68
|
+
/* ── Vỏ quản trị (sidebar tối) ────────────────────────────────────────── */
|
|
69
|
+
/* Đây là KHUNG CỦA KHU QUẢN TRỊ, dùng chung cho app thứ nhất và cho console quản trị của app thứ hai.
|
|
70
|
+
* Một người của DQA đi qua lại giữa hai màn trong cùng một phiên; hai vỏ khác nhau là hai sản phẩm. */
|
|
71
|
+
/* Vỏ quản trị nhuộm chất thương hiệu: cobalt navy sâu (khớp panel login) thay vì xám gần-đen
|
|
72
|
+
* trung tính. Vẫn là "dark shell" tập trung, nhưng rõ là của DQA. */
|
|
73
|
+
--fos-sidebar-bg: #08213f;
|
|
74
|
+
--fos-sidebar-border: #143a63;
|
|
75
|
+
--fos-sidebar-hover-bg: rgb(255 255 255 / 6%);
|
|
76
|
+
--fos-sidebar-accent: #00bfff;
|
|
77
|
+
--fos-sidebar-accent-contrast: #0b1220;
|
|
78
|
+
--fos-sidebar-active-bg: color-mix(in srgb, var(--fos-sidebar-accent) 16%, transparent);
|
|
79
|
+
--fos-sidebar-text: #b7bac2;
|
|
80
|
+
--fos-sidebar-text-muted: #82868f;
|
|
81
|
+
--fos-sidebar-text-strong: #f5f6f8;
|
|
82
|
+
|
|
83
|
+
/* ── Chữ ──────────────────────────────────────────────────────────────── */
|
|
84
|
+
--fos-font: 'Inter Variable', Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
|
|
85
|
+
--fos-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
86
|
+
|
|
87
|
+
/* ═══════════════════════════════════════════════════════════════════════
|
|
88
|
+
* ALIAS — tên cũ của từng app, trỏ về token chuẩn. Đây là cầu tạm, không phải đích.
|
|
89
|
+
* Xoá dần khi từng app đã dùng thẳng `--fos-*`. Danh sách này chỉ được NGẮN đi.
|
|
90
|
+
* ═══════════════════════════════════════════════════════════════════════ */
|
|
91
|
+
|
|
92
|
+
/* app thứ nhất */
|
|
93
|
+
--bg: var(--fos-bg);
|
|
94
|
+
--surface: var(--fos-surface);
|
|
95
|
+
--surface-2: var(--fos-surface-2);
|
|
96
|
+
--ink: var(--fos-ink);
|
|
97
|
+
--ink2: var(--fos-ink-2);
|
|
98
|
+
--ink3: var(--fos-ink-3);
|
|
99
|
+
--line: var(--fos-line);
|
|
100
|
+
--line-2: var(--fos-line-2);
|
|
101
|
+
--ok: var(--fos-ok); --ok-bg: var(--fos-ok-bg);
|
|
102
|
+
--warn: var(--fos-warn); --warn-bg: var(--fos-warn-bg);
|
|
103
|
+
--bad: var(--fos-bad); --bad-bg: var(--fos-bad-bg);
|
|
104
|
+
--info: var(--fos-info); --info-bg: var(--fos-info-bg);
|
|
105
|
+
--muted: var(--fos-muted); --muted-bg: var(--fos-muted-bg);
|
|
106
|
+
--brand: var(--fos-primary);
|
|
107
|
+
--accent: var(--fos-accent); --accent-2: var(--fos-accent-2); --steel: var(--fos-steel);
|
|
108
|
+
--r: var(--fos-r); --r-sm: var(--fos-r-sm);
|
|
109
|
+
--sh-1: var(--fos-sh-1); --sh-2: var(--fos-sh-3);
|
|
110
|
+
/* `.pipe-act` dùng `var(--warn-fg, #9a6700)` — biến chưa từng tồn tại, chỉ sống nhờ fallback.
|
|
111
|
+
* Khai báo nó ở đây để màu khớp bảng chung thay vì một mã màu lạc lõng trong một dòng CSS. */
|
|
112
|
+
--warn-fg: var(--fos-warn);
|
|
113
|
+
--s1: var(--fos-s1); --s2: var(--fos-s2); --s3: var(--fos-s3); --s4: var(--fos-s4);
|
|
114
|
+
--s5: var(--fos-s5); --s6: var(--fos-s6); --s7: var(--fos-s7);
|
|
115
|
+
--t-caption: var(--fos-t-caption); --t-body: var(--fos-t-body); --t-body-lg: var(--fos-t-body-lg);
|
|
116
|
+
--t-h3: var(--fos-t-h3); --t-h2: var(--fos-t-h2); --t-h1: var(--fos-t-h1);
|
|
117
|
+
|
|
118
|
+
/* app thứ hai */
|
|
119
|
+
--color-bg: var(--fos-bg);
|
|
120
|
+
--color-surface: var(--fos-surface);
|
|
121
|
+
--color-border: var(--fos-line);
|
|
122
|
+
--color-text: var(--fos-ink);
|
|
123
|
+
--color-muted: var(--fos-ink-2);
|
|
124
|
+
--color-primary: var(--fos-primary);
|
|
125
|
+
--color-primary-contrast: var(--fos-primary-contrast);
|
|
126
|
+
--color-accent: var(--fos-accent);
|
|
127
|
+
--color-accent-2: var(--fos-accent-2);
|
|
128
|
+
--color-steel: var(--fos-steel);
|
|
129
|
+
--color-danger: var(--fos-bad);
|
|
130
|
+
--color-success-bg: var(--fos-ok-bg);
|
|
131
|
+
--color-success-fg: var(--fos-ok);
|
|
132
|
+
--color-danger-bg: var(--fos-bad-bg);
|
|
133
|
+
--color-danger-fg: var(--fos-bad);
|
|
134
|
+
--color-warning-bg: var(--fos-warn-bg);
|
|
135
|
+
--color-warning-fg: var(--fos-warn);
|
|
136
|
+
--color-info-bg: var(--fos-info-bg);
|
|
137
|
+
--color-info-fg: var(--fos-info);
|
|
138
|
+
--color-neutral-bg: var(--fos-muted-bg);
|
|
139
|
+
--color-neutral-fg: var(--fos-ink-2);
|
|
140
|
+
--shadow-xs: var(--fos-sh-1);
|
|
141
|
+
--shadow-sm: var(--fos-sh-2);
|
|
142
|
+
--shadow-md: var(--fos-sh-3);
|
|
143
|
+
--dur-fast: var(--fos-dur-fast);
|
|
144
|
+
--dur-base: var(--fos-dur-base);
|
|
145
|
+
--ease-out: var(--fos-ease-out);
|
|
146
|
+
--ease-standard: var(--fos-ease-standard);
|
|
147
|
+
--sidebar-bg: var(--fos-sidebar-bg);
|
|
148
|
+
--sidebar-border: var(--fos-sidebar-border);
|
|
149
|
+
--sidebar-hover-bg: var(--fos-sidebar-hover-bg);
|
|
150
|
+
--sidebar-active-bg: var(--fos-sidebar-active-bg);
|
|
151
|
+
--sidebar-accent: var(--fos-sidebar-accent);
|
|
152
|
+
--sidebar-accent-contrast: var(--fos-sidebar-accent-contrast);
|
|
153
|
+
--sidebar-text: var(--fos-sidebar-text);
|
|
154
|
+
--sidebar-text-muted: var(--fos-sidebar-text-muted);
|
|
155
|
+
--sidebar-text-strong: var(--fos-sidebar-text-strong);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* CHƯA đưa dark-mode vào đây. Một app có `@media (prefers-color-scheme: dark)` ghi đè `--color-*`;
|
|
159
|
+
* app kia thì không. Nhập chung ngay bây giờ là bật dark-mode cho một app chưa từng thiết kế
|
|
160
|
+
* cho nó — đổi hình hài mà không ai duyệt. Nợ ghi rõ, không dọn lén. */
|
package/dist/tokens.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './_types/ui-kit/tokens/index.js';
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/* GENERATED by @dqa-ai-solutions/ui-kit — do not edit.
|
|
2
|
+
* Change the theme declaration and regenerate. Every colour below was computed from
|
|
3
|
+
* a hue and checked for contrast against every ground it can land on. */
|
|
4
|
+
:root[data-theme="dark"] {
|
|
5
|
+
color-scheme: dark;
|
|
6
|
+
|
|
7
|
+
/* ── colour ─────────────────────────────────────────────── */
|
|
8
|
+
--fos-bg: #151617;
|
|
9
|
+
--fos-surface: #202122;
|
|
10
|
+
--fos-surface-2: #1b1c1d;
|
|
11
|
+
--fos-ink: #f0f2f4;
|
|
12
|
+
--fos-ink-2: #bbbec2;
|
|
13
|
+
--fos-ink-3: #9c9fa3;
|
|
14
|
+
--fos-line: #343538;
|
|
15
|
+
--fos-line-2: #292a2c;
|
|
16
|
+
--fos-primary: #5596ff;
|
|
17
|
+
--fos-primary-bg: #292e36;
|
|
18
|
+
--fos-steel: #709de6;
|
|
19
|
+
--fos-focus: #5596ff;
|
|
20
|
+
--fos-primary-contrast: #11161f;
|
|
21
|
+
--fos-accent: #00bfff;
|
|
22
|
+
--fos-accent-2: #01ced1;
|
|
23
|
+
--fos-gradient-brand: linear-gradient(135deg, #5596ff 0%, #00bfff 55%, #01ced1 100%);
|
|
24
|
+
--fos-tone-plain: #bec4d1;
|
|
25
|
+
--fos-tone-plain-bg: #2f3032;
|
|
26
|
+
--fos-muted: #bec4d1;
|
|
27
|
+
--fos-muted-bg: #2f3032;
|
|
28
|
+
--fos-tone-wait: #d6c47b;
|
|
29
|
+
--fos-tone-wait-bg: #323028;
|
|
30
|
+
--fos-tone-doing: #a1c6ff;
|
|
31
|
+
--fos-tone-doing-bg: #28313e;
|
|
32
|
+
--fos-info: #a1c6ff;
|
|
33
|
+
--fos-info-bg: #28313e;
|
|
34
|
+
--fos-tone-done: #7fdba8;
|
|
35
|
+
--fos-tone-done-bg: #29332d;
|
|
36
|
+
--fos-ok: #7fdba8;
|
|
37
|
+
--fos-ok-bg: #29332d;
|
|
38
|
+
--fos-tone-warn: #fbb36a;
|
|
39
|
+
--fos-tone-warn-bg: #382e26;
|
|
40
|
+
--fos-warn: #fbb36a;
|
|
41
|
+
--fos-warn-bg: #382e26;
|
|
42
|
+
--fos-tone-stop: #ffab9e;
|
|
43
|
+
--fos-tone-stop-bg: #3e2b28;
|
|
44
|
+
--fos-bad: #ffab9e;
|
|
45
|
+
--fos-bad-bg: #3e2b28;
|
|
46
|
+
|
|
47
|
+
/* ── rhythm ─────────────────────────────────────────────── */
|
|
48
|
+
--fos-s1: 4px; /* icon to its label; inside a badge */
|
|
49
|
+
--fos-s2: 8px; /* control to its hint; between list rows */
|
|
50
|
+
--fos-s3: 12px; /* inside a chip; tight stack */
|
|
51
|
+
--fos-s4: 16px; /* between fields; dense card padding */
|
|
52
|
+
--fos-s5: 24px; /* card padding; heading to its body */
|
|
53
|
+
--fos-s6: 32px; /* between blocks in one section */
|
|
54
|
+
--fos-s7: 48px; /* between top-level sections */
|
|
55
|
+
|
|
56
|
+
/* ── type — four numbers per step, always together ──────── */
|
|
57
|
+
--fos-t-caption: 12px;
|
|
58
|
+
--fos-t-caption-line: 1.4;
|
|
59
|
+
--fos-t-caption-weight: 400;
|
|
60
|
+
--fos-t-caption-tracking: 0px;
|
|
61
|
+
--fos-t-body: 14px;
|
|
62
|
+
--fos-t-body-line: 1.5;
|
|
63
|
+
--fos-t-body-weight: 400;
|
|
64
|
+
--fos-t-body-tracking: 0px;
|
|
65
|
+
--fos-t-body-lg: 16px;
|
|
66
|
+
--fos-t-body-lg-line: 1.5;
|
|
67
|
+
--fos-t-body-lg-weight: 400;
|
|
68
|
+
--fos-t-body-lg-tracking: -0.05px;
|
|
69
|
+
--fos-t-h3: 20px;
|
|
70
|
+
--fos-t-h3-line: 1.3;
|
|
71
|
+
--fos-t-h3-weight: 600;
|
|
72
|
+
--fos-t-h3-tracking: -0.2px;
|
|
73
|
+
--fos-t-h2: 24px;
|
|
74
|
+
--fos-t-h2-line: 1.25;
|
|
75
|
+
--fos-t-h2-weight: 600;
|
|
76
|
+
--fos-t-h2-tracking: -0.4px;
|
|
77
|
+
--fos-t-h1: 28px;
|
|
78
|
+
--fos-t-h1-line: 1.2;
|
|
79
|
+
--fos-t-h1-weight: 600;
|
|
80
|
+
--fos-t-h1-tracking: -0.6px;
|
|
81
|
+
|
|
82
|
+
/* ── radius ─────────────────────────────────────────────── */
|
|
83
|
+
--fos-r-sm: 6px; /* badge, inline tag */
|
|
84
|
+
--fos-r: 8px; /* button, input, card */
|
|
85
|
+
--fos-r-lg: 12px; /* dialog, sheet, panel */
|
|
86
|
+
--fos-r-pill: 9999px; /* chip, avatar, segmented control */
|
|
87
|
+
|
|
88
|
+
/* ── shadow, motion, type family — passed through ───────── */
|
|
89
|
+
--fos-sh-1: 0 1px 2px rgba(19, 23, 34, .04);
|
|
90
|
+
--fos-sh-2: 0 1px 3px rgba(19, 23, 34, .07), 0 1px 2px rgba(19, 23, 34, .04);
|
|
91
|
+
--fos-sh-3: 0 12px 28px -10px rgba(19, 23, 34, .16);
|
|
92
|
+
--fos-dur-fast: 120ms;
|
|
93
|
+
--fos-dur-base: 180ms;
|
|
94
|
+
--fos-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
|
|
95
|
+
--fos-ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
|
|
96
|
+
--fos-font: 'Inter Variable', Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
|
|
97
|
+
--fos-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
98
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/* GENERATED by @dqa-ai-solutions/ui-kit — do not edit.
|
|
2
|
+
* Change the theme declaration and regenerate. Every colour below was computed from
|
|
3
|
+
* a hue and checked for contrast against every ground it can land on. */
|
|
4
|
+
:root {
|
|
5
|
+
color-scheme: light;
|
|
6
|
+
|
|
7
|
+
/* ── colour ─────────────────────────────────────────────── */
|
|
8
|
+
--fos-bg: #f5f6f8;
|
|
9
|
+
--fos-surface: #ffffff;
|
|
10
|
+
--fos-surface-2: #fafbfc;
|
|
11
|
+
--fos-ink: #191f29;
|
|
12
|
+
--fos-ink-2: #555d6b;
|
|
13
|
+
--fos-ink-3: #667182;
|
|
14
|
+
--fos-line: #e3e6eb;
|
|
15
|
+
--fos-line-2: #eef0f4;
|
|
16
|
+
--fos-primary: #0047ab;
|
|
17
|
+
--fos-primary-bg: #e7eef8;
|
|
18
|
+
--fos-steel: #285193;
|
|
19
|
+
--fos-focus: #0047ab;
|
|
20
|
+
--fos-primary-contrast: #fafcff;
|
|
21
|
+
--fos-accent: #00bfff;
|
|
22
|
+
--fos-accent-2: #01ced1;
|
|
23
|
+
--fos-gradient-brand: linear-gradient(135deg, #0047ab 0%, #00bfff 55%, #01ced1 100%);
|
|
24
|
+
--fos-tone-plain: #626873;
|
|
25
|
+
--fos-tone-plain-bg: #eeeff1;
|
|
26
|
+
--fos-muted: #626873;
|
|
27
|
+
--fos-muted-bg: #eeeff1;
|
|
28
|
+
--fos-tone-wait: #78671a;
|
|
29
|
+
--fos-tone-wait-bg: #f2efe4;
|
|
30
|
+
--fos-tone-doing: #2262c8;
|
|
31
|
+
--fos-tone-doing-bg: #e6f0ff;
|
|
32
|
+
--fos-info: #2262c8;
|
|
33
|
+
--fos-info-bg: #e6f0ff;
|
|
34
|
+
--fos-tone-done: #117b4e;
|
|
35
|
+
--fos-tone-done-bg: #e6f3ea;
|
|
36
|
+
--fos-ok: #117b4e;
|
|
37
|
+
--fos-ok-bg: #e6f3ea;
|
|
38
|
+
--fos-tone-warn: #945700;
|
|
39
|
+
--fos-tone-warn-bg: #f9ede2;
|
|
40
|
+
--fos-warn: #945700;
|
|
41
|
+
--fos-warn-bg: #f9ede2;
|
|
42
|
+
--fos-tone-stop: #b92a21;
|
|
43
|
+
--fos-tone-stop-bg: #ffe9e6;
|
|
44
|
+
--fos-bad: #b92a21;
|
|
45
|
+
--fos-bad-bg: #ffe9e6;
|
|
46
|
+
|
|
47
|
+
/* ── rhythm ─────────────────────────────────────────────── */
|
|
48
|
+
--fos-s1: 4px; /* icon to its label; inside a badge */
|
|
49
|
+
--fos-s2: 8px; /* control to its hint; between list rows */
|
|
50
|
+
--fos-s3: 12px; /* inside a chip; tight stack */
|
|
51
|
+
--fos-s4: 16px; /* between fields; dense card padding */
|
|
52
|
+
--fos-s5: 24px; /* card padding; heading to its body */
|
|
53
|
+
--fos-s6: 32px; /* between blocks in one section */
|
|
54
|
+
--fos-s7: 48px; /* between top-level sections */
|
|
55
|
+
|
|
56
|
+
/* ── type — four numbers per step, always together ──────── */
|
|
57
|
+
--fos-t-caption: 12px;
|
|
58
|
+
--fos-t-caption-line: 1.4;
|
|
59
|
+
--fos-t-caption-weight: 400;
|
|
60
|
+
--fos-t-caption-tracking: 0px;
|
|
61
|
+
--fos-t-body: 14px;
|
|
62
|
+
--fos-t-body-line: 1.5;
|
|
63
|
+
--fos-t-body-weight: 400;
|
|
64
|
+
--fos-t-body-tracking: 0px;
|
|
65
|
+
--fos-t-body-lg: 16px;
|
|
66
|
+
--fos-t-body-lg-line: 1.5;
|
|
67
|
+
--fos-t-body-lg-weight: 400;
|
|
68
|
+
--fos-t-body-lg-tracking: -0.05px;
|
|
69
|
+
--fos-t-h3: 20px;
|
|
70
|
+
--fos-t-h3-line: 1.3;
|
|
71
|
+
--fos-t-h3-weight: 600;
|
|
72
|
+
--fos-t-h3-tracking: -0.2px;
|
|
73
|
+
--fos-t-h2: 24px;
|
|
74
|
+
--fos-t-h2-line: 1.25;
|
|
75
|
+
--fos-t-h2-weight: 600;
|
|
76
|
+
--fos-t-h2-tracking: -0.4px;
|
|
77
|
+
--fos-t-h1: 28px;
|
|
78
|
+
--fos-t-h1-line: 1.2;
|
|
79
|
+
--fos-t-h1-weight: 600;
|
|
80
|
+
--fos-t-h1-tracking: -0.6px;
|
|
81
|
+
|
|
82
|
+
/* ── radius ─────────────────────────────────────────────── */
|
|
83
|
+
--fos-r-sm: 6px; /* badge, inline tag */
|
|
84
|
+
--fos-r: 8px; /* button, input, card */
|
|
85
|
+
--fos-r-lg: 12px; /* dialog, sheet, panel */
|
|
86
|
+
--fos-r-pill: 9999px; /* chip, avatar, segmented control */
|
|
87
|
+
|
|
88
|
+
/* ── shadow, motion, type family — passed through ───────── */
|
|
89
|
+
--fos-sh-1: 0 1px 2px rgba(19, 23, 34, .04);
|
|
90
|
+
--fos-sh-2: 0 1px 3px rgba(19, 23, 34, .07), 0 1px 2px rgba(19, 23, 34, .04);
|
|
91
|
+
--fos-sh-3: 0 12px 28px -10px rgba(19, 23, 34, .16);
|
|
92
|
+
--fos-dur-fast: 120ms;
|
|
93
|
+
--fos-dur-base: 180ms;
|
|
94
|
+
--fos-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
|
|
95
|
+
--fos-ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
|
|
96
|
+
--fos-font: 'Inter Variable', Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
|
|
97
|
+
--fos-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
98
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/* GENERATED by @dqa-ai-solutions/ui-kit — do not edit.
|
|
2
|
+
* Change the theme declaration and regenerate. Every colour below was computed from
|
|
3
|
+
* a hue and checked for contrast against every ground it can land on. */
|
|
4
|
+
:root {
|
|
5
|
+
color-scheme: light;
|
|
6
|
+
|
|
7
|
+
/* ── colour ─────────────────────────────────────────────── */
|
|
8
|
+
--fos-bg: #f5f6f8;
|
|
9
|
+
--fos-surface: #ffffff;
|
|
10
|
+
--fos-surface-2: #fafbfc;
|
|
11
|
+
--fos-ink: #000003;
|
|
12
|
+
--fos-ink-2: #343c48;
|
|
13
|
+
--fos-ink-3: #485363;
|
|
14
|
+
--fos-line: #dfe2e7;
|
|
15
|
+
--fos-line-2: #eceff3;
|
|
16
|
+
--fos-primary: #0047ab;
|
|
17
|
+
--fos-primary-bg: #e7eef8;
|
|
18
|
+
--fos-steel: #285193;
|
|
19
|
+
--fos-focus: #0047ab;
|
|
20
|
+
--fos-primary-contrast: #fafcff;
|
|
21
|
+
--fos-accent: #00bfff;
|
|
22
|
+
--fos-accent-2: #01ced1;
|
|
23
|
+
--fos-gradient-brand: linear-gradient(135deg, #0047ab 0%, #00bfff 55%, #01ced1 100%);
|
|
24
|
+
--fos-tone-plain: #434852;
|
|
25
|
+
--fos-tone-plain-bg: #eeeff1;
|
|
26
|
+
--fos-muted: #434852;
|
|
27
|
+
--fos-muted-bg: #eeeff1;
|
|
28
|
+
--fos-tone-wait: #554700;
|
|
29
|
+
--fos-tone-wait-bg: #f2efe4;
|
|
30
|
+
--fos-tone-doing: #00409c;
|
|
31
|
+
--fos-tone-doing-bg: #e6f0ff;
|
|
32
|
+
--fos-info: #00409c;
|
|
33
|
+
--fos-info-bg: #e6f0ff;
|
|
34
|
+
--fos-tone-done: #005634;
|
|
35
|
+
--fos-tone-done-bg: #e6f3ea;
|
|
36
|
+
--fos-ok: #005634;
|
|
37
|
+
--fos-ok-bg: #e6f3ea;
|
|
38
|
+
--fos-tone-warn: #693b00;
|
|
39
|
+
--fos-tone-warn-bg: #f9ede2;
|
|
40
|
+
--fos-warn: #693b00;
|
|
41
|
+
--fos-warn-bg: #f9ede2;
|
|
42
|
+
--fos-tone-stop: #8b0002;
|
|
43
|
+
--fos-tone-stop-bg: #ffe9e6;
|
|
44
|
+
--fos-bad: #8b0002;
|
|
45
|
+
--fos-bad-bg: #ffe9e6;
|
|
46
|
+
|
|
47
|
+
/* ── rhythm ─────────────────────────────────────────────── */
|
|
48
|
+
--fos-s1: 4px; /* icon to its label; inside a badge */
|
|
49
|
+
--fos-s2: 8px; /* control to its hint; between list rows */
|
|
50
|
+
--fos-s3: 12px; /* inside a chip; tight stack */
|
|
51
|
+
--fos-s4: 16px; /* between fields; dense card padding */
|
|
52
|
+
--fos-s5: 24px; /* card padding; heading to its body */
|
|
53
|
+
--fos-s6: 32px; /* between blocks in one section */
|
|
54
|
+
--fos-s7: 48px; /* between top-level sections */
|
|
55
|
+
|
|
56
|
+
/* ── type — four numbers per step, always together ──────── */
|
|
57
|
+
--fos-t-caption: 12px;
|
|
58
|
+
--fos-t-caption-line: 1.4;
|
|
59
|
+
--fos-t-caption-weight: 400;
|
|
60
|
+
--fos-t-caption-tracking: 0px;
|
|
61
|
+
--fos-t-body: 14px;
|
|
62
|
+
--fos-t-body-line: 1.5;
|
|
63
|
+
--fos-t-body-weight: 400;
|
|
64
|
+
--fos-t-body-tracking: 0px;
|
|
65
|
+
--fos-t-body-lg: 16px;
|
|
66
|
+
--fos-t-body-lg-line: 1.5;
|
|
67
|
+
--fos-t-body-lg-weight: 400;
|
|
68
|
+
--fos-t-body-lg-tracking: -0.05px;
|
|
69
|
+
--fos-t-h3: 20px;
|
|
70
|
+
--fos-t-h3-line: 1.3;
|
|
71
|
+
--fos-t-h3-weight: 600;
|
|
72
|
+
--fos-t-h3-tracking: -0.2px;
|
|
73
|
+
--fos-t-h2: 24px;
|
|
74
|
+
--fos-t-h2-line: 1.25;
|
|
75
|
+
--fos-t-h2-weight: 600;
|
|
76
|
+
--fos-t-h2-tracking: -0.4px;
|
|
77
|
+
--fos-t-h1: 28px;
|
|
78
|
+
--fos-t-h1-line: 1.2;
|
|
79
|
+
--fos-t-h1-weight: 600;
|
|
80
|
+
--fos-t-h1-tracking: -0.6px;
|
|
81
|
+
|
|
82
|
+
/* ── radius ─────────────────────────────────────────────── */
|
|
83
|
+
--fos-r-sm: 6px; /* badge, inline tag */
|
|
84
|
+
--fos-r: 8px; /* button, input, card */
|
|
85
|
+
--fos-r-lg: 12px; /* dialog, sheet, panel */
|
|
86
|
+
--fos-r-pill: 9999px; /* chip, avatar, segmented control */
|
|
87
|
+
|
|
88
|
+
/* ── shadow, motion, type family — passed through ───────── */
|
|
89
|
+
--fos-sh-1: 0 1px 2px rgba(19, 23, 34, .04);
|
|
90
|
+
--fos-sh-2: 0 1px 3px rgba(19, 23, 34, .07), 0 1px 2px rgba(19, 23, 34, .04);
|
|
91
|
+
--fos-sh-3: 0 12px 28px -10px rgba(19, 23, 34, .16);
|
|
92
|
+
--fos-dur-fast: 120ms;
|
|
93
|
+
--fos-dur-base: 180ms;
|
|
94
|
+
--fos-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
|
|
95
|
+
--fos-ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
|
|
96
|
+
--fos-font: 'Inter Variable', Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
|
|
97
|
+
--fos-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
98
|
+
}
|
package/dist/tokens.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunks/chunk-4LX2HZJU.js";
|