@contractspec/example.learning-journey-ui-onboarding 3.7.19 → 4.0.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.
@@ -1 +1 @@
1
- import{XpBar as a}from"@contractspec/example.learning-journey-ui-shared";import{Button as C}from"@contractspec/lib.design-system";import{Card as P,CardContent as V,CardHeader as u,CardTitle as X}from"@contractspec/lib.ui-kit-web/ui/card";import{Progress as r}from"@contractspec/lib.ui-kit-web/ui/progress";import{jsx as v,jsxs as J}from"react/jsx-runtime";function x({track:f,progress:h,onStart:w}){let b=f.steps.length,G=h.completedStepIds.length,L=b>0?G/b*100:0,z=G===b,W=b-G,R=W*5,Q=f.totalXp??f.steps.reduce((K,Z)=>K+(Z.xpReward??0),0)+(f.completionRewards?.xpBonus??0);return J("div",{className:"space-y-6",children:[v(P,{className:"overflow-hidden bg-gradient-to-r from-blue-500/10 via-violet-500/10 to-purple-500/10",children:v(V,{className:"p-8",children:J("div",{className:"flex flex-col items-center gap-6 text-center md:flex-row md:text-left",children:[v("div",{className:"flex h-20 w-20 items-center justify-center rounded-2xl bg-gradient-to-br from-blue-500 to-violet-600 text-4xl shadow-lg",children:z?"\uD83C\uDF89":"\uD83D\uDE80"}),J("div",{className:"flex-1",children:[v("h1",{className:"font-bold text-2xl",children:f.name}),v("p",{className:"mt-1 max-w-2xl text-muted-foreground",children:f.description}),!z&&J("p",{className:"mt-3 text-muted-foreground text-sm",children:["⏱️ Estimated time:"," ",R>0?`~${R} minutes`:"Less than a minute"]})]}),!z&&v(C,{size:"lg",onClick:w,children:G>0?"Continue":"Get Started"})]})})}),J("div",{className:"grid gap-4 md:grid-cols-3",children:[J(P,{children:[v(u,{className:"pb-2",children:v(X,{className:"font-medium text-muted-foreground text-sm",children:"Progress"})}),J(V,{children:[J("div",{className:"font-bold text-3xl",children:[Math.round(L),"%"]}),v(r,{value:L,className:"mt-2 h-2"}),J("p",{className:"mt-2 text-muted-foreground text-sm",children:[G," of ",b," steps completed"]})]})]}),J(P,{children:[v(u,{className:"pb-2",children:v(X,{className:"font-medium text-muted-foreground text-sm",children:"XP Earned"})}),J(V,{children:[v("div",{className:"font-bold text-3xl text-blue-500",children:h.xpEarned}),v(a,{current:h.xpEarned,max:Q,showLabel:!1,size:"sm"})]})]}),J(P,{children:[v(u,{className:"pb-2",children:v(X,{className:"font-medium text-muted-foreground text-sm",children:"Time Remaining"})}),J(V,{children:[v("div",{className:"font-bold text-3xl",children:z?"✓":`~${R}m`}),v("p",{className:"mt-2 text-muted-foreground text-sm",children:z?"All done!":`${W} steps to go`})]})]})]}),J(P,{children:[v(u,{children:J(X,{className:"flex items-center gap-2",children:[v("span",{children:"\uD83D\uDCCB"}),v("span",{children:"Your Journey"})]})}),v(V,{children:v("div",{className:"space-y-3",children:f.steps.map((K,Z)=>{let D=h.completedStepIds.includes(K.id),O=!D&&f.steps.slice(0,Z).every((d)=>h.completedStepIds.includes(d.id));return J("div",{className:"flex items-center gap-4 rounded-lg border p-3",children:[v("div",{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full font-semibold text-sm ${D?"bg-green-500 text-white":O?"bg-blue-500 text-white":"bg-muted text-muted-foreground"}`,children:D?"✓":Z+1}),v("div",{className:"min-w-0 flex-1",children:v("p",{className:`font-medium ${D?"text-green-500":O?"text-foreground":"text-muted-foreground"}`,children:K.title})}),K.xpReward&&J("span",{className:"text-muted-foreground text-sm",children:["+",K.xpReward," XP"]})]},K.id)})})})]}),z&&v(P,{className:"border-green-500/50 bg-green-500/5",children:J(V,{className:"flex items-center gap-4 p-6",children:[v("div",{className:"text-4xl",children:"\uD83C\uDF89"}),J("div",{children:[v("h3",{className:"font-semibold text-green-500 text-lg",children:"Onboarding Complete!"}),J("p",{className:"text-muted-foreground",children:["You've completed all ",b," steps. Welcome aboard!"]})]})]})})]})}import{BadgeDisplay as j,XpBar as p}from"@contractspec/example.learning-journey-ui-shared";import{Card as E,CardContent as M,CardHeader as T,CardTitle as H}from"@contractspec/lib.ui-kit-web/ui/card";import{Progress as t}from"@contractspec/lib.ui-kit-web/ui/progress";import{jsx as N,jsxs as y}from"react/jsx-runtime";function e({track:f,progress:h}){let w=f.steps.length,b=h.completedStepIds.length,G=w>0?b/w*100:0,L=f.totalXp??f.steps.reduce((R,Q)=>R+(Q.xpReward??0),0)+(f.completionRewards?.xpBonus??0),z=w-b,W=z*5;return y("div",{className:"space-y-6",children:[y(E,{children:[N(T,{children:y(H,{className:"flex items-center gap-2",children:[N("span",{children:"\uD83D\uDCC8"}),N("span",{children:"Your Progress"})]})}),y(M,{className:"space-y-6",children:[N("div",{className:"flex items-center justify-center",children:y("div",{className:"relative flex h-40 w-40 items-center justify-center",children:[y("svg",{className:"absolute h-full w-full -rotate-90",viewBox:"0 0 100 100",children:[N("circle",{cx:"50",cy:"50",r:"45",fill:"none",strokeWidth:"8",className:"stroke-muted"}),N("circle",{cx:"50",cy:"50",r:"45",fill:"none",strokeWidth:"8",strokeLinecap:"round",strokeDasharray:`${G*2.83} 283`,className:"stroke-blue-500 transition-all duration-500"})]}),y("div",{className:"text-center",children:[y("div",{className:"font-bold text-3xl",children:[Math.round(G),"%"]}),N("div",{className:"text-muted-foreground text-sm",children:"Complete"})]})]})}),y("div",{className:"grid grid-cols-3 gap-4 text-center",children:[y("div",{children:[N("div",{className:"font-bold text-2xl text-green-500",children:b}),N("div",{className:"text-muted-foreground text-sm",children:"Completed"})]}),y("div",{children:[N("div",{className:"font-bold text-2xl text-orange-500",children:z}),N("div",{className:"text-muted-foreground text-sm",children:"Remaining"})]}),y("div",{children:[y("div",{className:"font-bold text-2xl",children:[W,"m"]}),N("div",{className:"text-muted-foreground text-sm",children:"Est. Time"})]})]})]})]}),y(E,{children:[N(T,{children:y(H,{className:"flex items-center gap-2",children:[N("span",{children:"⚡"}),N("span",{children:"Experience Points"})]})}),y(M,{className:"space-y-4",children:[y("div",{className:"flex items-baseline gap-2",children:[N("span",{className:"font-bold text-3xl text-blue-500",children:h.xpEarned}),y("span",{className:"text-muted-foreground",children:["/ ",L," XP"]})]}),N(p,{current:h.xpEarned,max:L,showLabel:!1,size:"lg"})]})]}),y(E,{children:[N(T,{children:y(H,{className:"flex items-center gap-2",children:[N("span",{children:"\uD83C\uDFC5"}),N("span",{children:"Achievements"})]})}),y(M,{children:[N(j,{badges:h.badges,size:"lg"}),h.badges.length===0&&f.completionRewards?.badgeKey&&y("p",{className:"text-muted-foreground text-sm",children:['Complete all steps to earn the "',f.completionRewards.badgeKey,'" badge!']})]})]}),y(E,{children:[N(T,{children:y(H,{className:"flex items-center gap-2",children:[N("span",{children:"\uD83D\uDCCB"}),N("span",{children:"Step Details"})]})}),N(M,{children:N("div",{className:"space-y-3",children:f.steps.map((R,Q)=>{let K=h.completedStepIds.includes(R.id),Z=K?100:0;return y("div",{className:"space-y-1",children:[y("div",{className:"flex items-center justify-between text-sm",children:[y("span",{className:K?"text-green-500":"text-foreground",children:[Q+1,". ",R.title]}),N("span",{className:K?"text-green-500":"text-muted-foreground",children:K?"✓":"Pending"})]}),N(t,{value:Z,className:"h-1"})]},R.id)})})})]})]})}import{Button as g}from"@contractspec/lib.design-system";import{cn as A}from"@contractspec/lib.ui-kit-core";import{jsx as Y,jsxs as $}from"react/jsx-runtime";function n({step:f,stepNumber:h,isCompleted:w,isCurrent:b,isExpanded:G,onToggle:L,onComplete:z}){return $("div",{className:A("rounded-xl border transition-all",w&&"border-green-500/50 bg-green-500/5",b&&!w&&"border-violet-500 bg-violet-500/5",!w&&!b&&"border-border"),children:[$("button",{type:"button",className:"flex w-full items-center gap-4 p-4 text-left",onClick:L,children:[Y("div",{className:A("flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 font-semibold text-sm transition-colors",w&&"border-green-500 bg-green-500 text-white",b&&!w&&"border-violet-500 text-violet-500",!w&&!b&&"border-muted-foreground text-muted-foreground"),children:w?"✓":h}),$("div",{className:"min-w-0 flex-1",children:[Y("h4",{className:A("font-semibold",w&&"text-green-500",b&&!w&&"text-foreground",!w&&!b&&"text-muted-foreground"),children:f.title}),!G&&f.description&&Y("p",{className:"truncate text-muted-foreground text-sm",children:f.description})]}),f.xpReward&&$("span",{className:A("shrink-0 rounded-full px-2 py-1 font-semibold text-xs",w?"bg-green-500/10 text-green-500":"bg-muted text-muted-foreground"),children:["+",f.xpReward," XP"]}),Y("span",{className:A("shrink-0 transition-transform",G&&"rotate-180"),children:"▼"})]}),G&&$("div",{className:"border-t px-4 py-4",children:[f.description&&Y("p",{className:"mb-4 text-muted-foreground",children:f.description}),f.instructions&&$("div",{className:"mb-4 rounded-lg bg-muted p-4",children:[Y("p",{className:"mb-2 font-medium text-sm",children:"Instructions:"}),Y("p",{className:"text-muted-foreground text-sm",children:f.instructions})]}),$("div",{className:"flex flex-wrap gap-2",children:[f.actionUrl&&Y(g,{variant:"outline",size:"sm",onClick:()=>window.open(f.actionUrl,"_blank"),children:f.actionLabel??"Try it"}),!w&&Y(g,{size:"sm",onClick:z,children:"Mark as Complete"})]})]})]})}import{Progress as s}from"@contractspec/lib.ui-kit-web/ui/progress";import{useState as ff}from"react";import{jsx as F,jsxs as B}from"react/jsx-runtime";function bf({track:f,progress:h,onStepComplete:w}){let[b,G]=ff(()=>{return f.steps.find((K)=>!h.completedStepIds.includes(K.id))?.id??null}),L=h.completedStepIds.length,z=f.steps.length,W=z>0?L/z*100:0,R=f.steps.findIndex((Q)=>!h.completedStepIds.includes(Q.id));return B("div",{className:"space-y-6",children:[B("div",{className:"space-y-2",children:[B("div",{className:"flex items-center justify-between",children:[F("h2",{className:"font-bold text-xl",children:"Complete Each Step"}),B("span",{className:"text-muted-foreground text-sm",children:[L," / ",z," completed"]})]}),F(s,{value:W,className:"h-2"})]}),F("div",{className:"space-y-3",children:f.steps.map((Q,K)=>{let Z=h.completedStepIds.includes(Q.id),D=K===R;return F(n,{step:Q,stepNumber:K+1,isCompleted:Z,isCurrent:D,isExpanded:b===Q.id,onToggle:()=>G(b===Q.id?null:Q.id),onComplete:()=>{w?.(Q.id);let O=f.steps[K+1];if(O&&!h.completedStepIds.includes(O.id))G(O.id)}},Q.id)})}),f.completionRewards&&W<100&&F("div",{className:"rounded-lg border border-blue-500/30 bg-blue-500/5 p-4",children:B("p",{className:"text-sm",children:["\uD83C\uDF81 Complete all steps to unlock:",f.completionRewards.xpBonus&&B("span",{className:"ml-2 font-semibold text-blue-500",children:["+",f.completionRewards.xpBonus," XP bonus"]}),f.completionRewards.badgeKey&&B("span",{className:"ml-2 font-semibold text-amber-500",children:['+ "',f.completionRewards.badgeKey,'" badge']})]})})]})}import{cn as I}from"@contractspec/lib.ui-kit-web/ui/utils";import{jsx as _,jsxs as l}from"react/jsx-runtime";var m={templates:"\uD83D\uDCCB","spec-editor":"✏️",regenerator:"\uD83D\uDD04",playground:"\uD83C\uDFAE",evolution:"\uD83E\uDD16",dashboard:"\uD83D\uDCCA",settings:"⚙️",default:"\uD83D\uDCCD"};function o({steps:f,completedStepIds:h,currentStepId:w}){return _("div",{className:"relative overflow-x-auto pb-4",children:_("div",{className:"flex min-w-max items-center gap-2",children:f.map((b,G)=>{let L=h.includes(b.id),z=b.id===w,W=b.metadata?.surface??"default",R=m[W]??m.default;return l("div",{className:"flex items-center",children:[l("div",{className:"flex flex-col items-center gap-2",children:[_("div",{className:I("flex h-14 w-14 items-center justify-center rounded-2xl border-2 text-2xl transition-all",L&&"border-green-500 bg-green-500/10",z&&!L&&"border-violet-500 bg-violet-500/10 ring-4 ring-violet-500/20",!L&&!z&&"border-muted bg-muted/50"),children:L?"✓":R}),_("div",{className:"text-center",children:_("p",{className:I("max-w-[100px] truncate font-medium text-xs",L&&"text-green-500",z&&!L&&"text-violet-500",!L&&!z&&"text-muted-foreground"),children:b.title})})]}),G<f.length-1&&_("div",{className:I("mx-2 h-1 w-8 rounded-full transition-colors",h.includes(f[G+1]?.id??"")?"bg-green-500":L?"bg-green-500/50":"bg-muted")})]},b.id)})})})}import{Card as S,CardContent as k,CardHeader as i,CardTitle as c}from"@contractspec/lib.ui-kit-web/ui/card";import{jsx as q,jsxs as U}from"react/jsx-runtime";function vf({track:f,progress:h}){let w=f.steps.find((b)=>!h.completedStepIds.includes(b.id))?.id??null;return U("div",{className:"space-y-6",children:[U("div",{className:"text-center",children:[q("h2",{className:"font-bold text-xl",children:"Your Learning Journey"}),q("p",{className:"text-muted-foreground",children:"Follow the path through each surface and feature"})]}),U(S,{children:[q(i,{children:U(c,{className:"flex items-center gap-2",children:[q("span",{children:"\uD83D\uDDFA️"}),q("span",{children:"Journey Map"})]})}),q(k,{children:q(o,{steps:f.steps,completedStepIds:h.completedStepIds,currentStepId:w})})]}),U(S,{children:[q(i,{children:U(c,{className:"flex items-center gap-2",children:[q("span",{children:"\uD83D\uDCCD"}),q("span",{children:"Step by Step"})]})}),q(k,{children:U("div",{className:"relative",children:[q("div",{className:"absolute top-0 left-4 h-full w-0.5 bg-border"}),q("div",{className:"space-y-6",children:f.steps.map((b,G)=>{let L=h.completedStepIds.includes(b.id),z=b.id===w,W=b.metadata?.surface??"general";return U("div",{className:"relative flex gap-4 pl-2",children:[q("div",{className:`relative z-10 flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 transition-all ${L?"border-green-500 bg-green-500 text-white":z?"border-blue-500 bg-blue-500 text-white ring-4 ring-blue-500/20":"border-border bg-background text-muted-foreground"}`,children:L?"✓":G+1}),q("div",{className:"flex-1 pb-2",children:U("div",{className:"rounded-lg border p-4",children:[U("div",{className:"flex items-start justify-between gap-2",children:[U("div",{children:[U("div",{className:"flex items-center gap-2",children:[q("h4",{className:`font-semibold ${L?"text-green-500":z?"text-blue-500":"text-foreground"}`,children:b.title}),q("span",{className:"rounded bg-muted px-2 py-0.5 text-muted-foreground text-xs",children:W})]}),q("p",{className:"mt-1 text-muted-foreground text-sm",children:b.description})]}),b.xpReward&&U("span",{className:`shrink-0 rounded-full px-2 py-1 font-semibold text-xs ${L?"bg-green-500/10 text-green-500":"bg-muted text-muted-foreground"}`,children:["+",b.xpReward," XP"]})]}),q("div",{className:"mt-3 text-xs",children:L?q("span",{className:"text-green-500",children:"✓ Completed"}):z?q("span",{className:"text-blue-500",children:"→ In Progress"}):q("span",{className:"text-muted-foreground",children:"○ Not Started"})})]})})]},b.id)})})]})})]})]})}export{vf as Timeline,bf as Steps,e as Progress,x as Overview};
1
+ import{XpBar as a}from"@contractspec/example.learning-journey-ui-shared";import{Button as C}from"@contractspec/lib.design-system";import{Card as P,CardContent as V,CardHeader as u,CardTitle as X}from"@contractspec/lib.ui-kit-web/ui/card";import{Progress as r}from"@contractspec/lib.ui-kit-web/ui/progress";import{jsx as v,jsxs as J}from"react/jsx-runtime";function x({track:f,progress:h,onStart:w}){let b=f.steps.length,G=h.completedStepIds.length,z=b>0?G/b*100:0,L=G===b,W=b-G,R=W*5,Q=f.totalXp??f.steps.reduce((K,Z)=>K+(Z.xpReward??0),0)+(f.completionRewards?.xp??0);return J("div",{className:"space-y-6",children:[v(P,{className:"overflow-hidden bg-gradient-to-r from-blue-500/10 via-violet-500/10 to-purple-500/10",children:v(V,{className:"p-8",children:J("div",{className:"flex flex-col items-center gap-6 text-center md:flex-row md:text-left",children:[v("div",{className:"flex h-20 w-20 items-center justify-center rounded-2xl bg-gradient-to-br from-blue-500 to-violet-600 text-4xl shadow-lg",children:L?"\uD83C\uDF89":"\uD83D\uDE80"}),J("div",{className:"flex-1",children:[v("h1",{className:"font-bold text-2xl",children:f.name}),v("p",{className:"mt-1 max-w-2xl text-muted-foreground",children:f.description}),!L&&J("p",{className:"mt-3 text-muted-foreground text-sm",children:["⏱️ Estimated time:"," ",R>0?`~${R} minutes`:"Less than a minute"]})]}),!L&&v(C,{size:"lg",onClick:w,children:G>0?"Continue":"Get Started"})]})})}),J("div",{className:"grid gap-4 md:grid-cols-3",children:[J(P,{children:[v(u,{className:"pb-2",children:v(X,{className:"font-medium text-muted-foreground text-sm",children:"Progress"})}),J(V,{children:[J("div",{className:"font-bold text-3xl",children:[Math.round(z),"%"]}),v(r,{value:z,className:"mt-2 h-2"}),J("p",{className:"mt-2 text-muted-foreground text-sm",children:[G," of ",b," steps completed"]})]})]}),J(P,{children:[v(u,{className:"pb-2",children:v(X,{className:"font-medium text-muted-foreground text-sm",children:"XP Earned"})}),J(V,{children:[v("div",{className:"font-bold text-3xl text-blue-500",children:h.xpEarned}),v(a,{current:h.xpEarned,max:Q,showLabel:!1,size:"sm"})]})]}),J(P,{children:[v(u,{className:"pb-2",children:v(X,{className:"font-medium text-muted-foreground text-sm",children:"Time Remaining"})}),J(V,{children:[v("div",{className:"font-bold text-3xl",children:L?"✓":`~${R}m`}),v("p",{className:"mt-2 text-muted-foreground text-sm",children:L?"All done!":`${W} steps to go`})]})]})]}),J(P,{children:[v(u,{children:J(X,{className:"flex items-center gap-2",children:[v("span",{children:"\uD83D\uDCCB"}),v("span",{children:"Your Journey"})]})}),v(V,{children:v("div",{className:"space-y-3",children:f.steps.map((K,Z)=>{let D=h.completedStepIds.includes(K.id),O=!D&&f.steps.slice(0,Z).every((d)=>h.completedStepIds.includes(d.id));return J("div",{className:"flex items-center gap-4 rounded-lg border p-3",children:[v("div",{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full font-semibold text-sm ${D?"bg-green-500 text-white":O?"bg-blue-500 text-white":"bg-muted text-muted-foreground"}`,children:D?"✓":Z+1}),v("div",{className:"min-w-0 flex-1",children:v("p",{className:`font-medium ${D?"text-green-500":O?"text-foreground":"text-muted-foreground"}`,children:K.title})}),K.xpReward&&J("span",{className:"text-muted-foreground text-sm",children:["+",K.xpReward," XP"]})]},K.id)})})})]}),L&&v(P,{className:"border-green-500/50 bg-green-500/5",children:J(V,{className:"flex items-center gap-4 p-6",children:[v("div",{className:"text-4xl",children:"\uD83C\uDF89"}),J("div",{children:[v("h3",{className:"font-semibold text-green-500 text-lg",children:"Onboarding Complete!"}),J("p",{className:"text-muted-foreground",children:["You've completed all ",b," steps. Welcome aboard!"]})]})]})})]})}import{BadgeDisplay as j,XpBar as p}from"@contractspec/example.learning-journey-ui-shared";import{Card as E,CardContent as M,CardHeader as T,CardTitle as H}from"@contractspec/lib.ui-kit-web/ui/card";import{Progress as t}from"@contractspec/lib.ui-kit-web/ui/progress";import{jsx as N,jsxs as y}from"react/jsx-runtime";function e({track:f,progress:h}){let w=f.steps.length,b=h.completedStepIds.length,G=w>0?b/w*100:0,z=f.totalXp??f.steps.reduce((R,Q)=>R+(Q.xpReward??0),0)+(f.completionRewards?.xp??0),L=w-b,W=L*5;return y("div",{className:"space-y-6",children:[y(E,{children:[N(T,{children:y(H,{className:"flex items-center gap-2",children:[N("span",{children:"\uD83D\uDCC8"}),N("span",{children:"Your Progress"})]})}),y(M,{className:"space-y-6",children:[N("div",{className:"flex items-center justify-center",children:y("div",{className:"relative flex h-40 w-40 items-center justify-center",children:[y("svg",{className:"absolute h-full w-full -rotate-90",viewBox:"0 0 100 100",children:[N("circle",{cx:"50",cy:"50",r:"45",fill:"none",strokeWidth:"8",className:"stroke-muted"}),N("circle",{cx:"50",cy:"50",r:"45",fill:"none",strokeWidth:"8",strokeLinecap:"round",strokeDasharray:`${G*2.83} 283`,className:"stroke-blue-500 transition-all duration-500"})]}),y("div",{className:"text-center",children:[y("div",{className:"font-bold text-3xl",children:[Math.round(G),"%"]}),N("div",{className:"text-muted-foreground text-sm",children:"Complete"})]})]})}),y("div",{className:"grid grid-cols-3 gap-4 text-center",children:[y("div",{children:[N("div",{className:"font-bold text-2xl text-green-500",children:b}),N("div",{className:"text-muted-foreground text-sm",children:"Completed"})]}),y("div",{children:[N("div",{className:"font-bold text-2xl text-orange-500",children:L}),N("div",{className:"text-muted-foreground text-sm",children:"Remaining"})]}),y("div",{children:[y("div",{className:"font-bold text-2xl",children:[W,"m"]}),N("div",{className:"text-muted-foreground text-sm",children:"Est. Time"})]})]})]})]}),y(E,{children:[N(T,{children:y(H,{className:"flex items-center gap-2",children:[N("span",{children:"⚡"}),N("span",{children:"Experience Points"})]})}),y(M,{className:"space-y-4",children:[y("div",{className:"flex items-baseline gap-2",children:[N("span",{className:"font-bold text-3xl text-blue-500",children:h.xpEarned}),y("span",{className:"text-muted-foreground",children:["/ ",z," XP"]})]}),N(p,{current:h.xpEarned,max:z,showLabel:!1,size:"lg"})]})]}),y(E,{children:[N(T,{children:y(H,{className:"flex items-center gap-2",children:[N("span",{children:"\uD83C\uDFC5"}),N("span",{children:"Achievements"})]})}),y(M,{children:[N(j,{badges:h.badges,size:"lg"}),h.badges.length===0&&f.completionRewards?.badgeKey&&y("p",{className:"text-muted-foreground text-sm",children:['Complete all steps to earn the "',f.completionRewards.badgeKey,'" badge!']})]})]}),y(E,{children:[N(T,{children:y(H,{className:"flex items-center gap-2",children:[N("span",{children:"\uD83D\uDCCB"}),N("span",{children:"Step Details"})]})}),N(M,{children:N("div",{className:"space-y-3",children:f.steps.map((R,Q)=>{let K=h.completedStepIds.includes(R.id),Z=K?100:0;return y("div",{className:"space-y-1",children:[y("div",{className:"flex items-center justify-between text-sm",children:[y("span",{className:K?"text-green-500":"text-foreground",children:[Q+1,". ",R.title]}),N("span",{className:K?"text-green-500":"text-muted-foreground",children:K?"✓":"Pending"})]}),N(t,{value:Z,className:"h-1"})]},R.id)})})})]})]})}import{Button as g}from"@contractspec/lib.design-system";import{cn as A}from"@contractspec/lib.ui-kit-core";import{jsx as Y,jsxs as $}from"react/jsx-runtime";function m({step:f,stepNumber:h,isCompleted:w,isCurrent:b,isExpanded:G,onToggle:z,onComplete:L}){return $("div",{className:A("rounded-xl border transition-all",w&&"border-green-500/50 bg-green-500/5",b&&!w&&"border-violet-500 bg-violet-500/5",!w&&!b&&"border-border"),children:[$("button",{type:"button",className:"flex w-full items-center gap-4 p-4 text-left",onClick:z,children:[Y("div",{className:A("flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 font-semibold text-sm transition-colors",w&&"border-green-500 bg-green-500 text-white",b&&!w&&"border-violet-500 text-violet-500",!w&&!b&&"border-muted-foreground text-muted-foreground"),children:w?"✓":h}),$("div",{className:"min-w-0 flex-1",children:[Y("h4",{className:A("font-semibold",w&&"text-green-500",b&&!w&&"text-foreground",!w&&!b&&"text-muted-foreground"),children:f.title}),!G&&f.description&&Y("p",{className:"truncate text-muted-foreground text-sm",children:f.description})]}),f.xpReward&&$("span",{className:A("shrink-0 rounded-full px-2 py-1 font-semibold text-xs",w?"bg-green-500/10 text-green-500":"bg-muted text-muted-foreground"),children:["+",f.xpReward," XP"]}),Y("span",{className:A("shrink-0 transition-transform",G&&"rotate-180"),children:"▼"})]}),G&&$("div",{className:"border-t px-4 py-4",children:[f.description&&Y("p",{className:"mb-4 text-muted-foreground",children:f.description}),f.instructions&&$("div",{className:"mb-4 rounded-lg bg-muted p-4",children:[Y("p",{className:"mb-2 font-medium text-sm",children:"Instructions:"}),Y("p",{className:"text-muted-foreground text-sm",children:f.instructions})]}),$("div",{className:"flex flex-wrap gap-2",children:[f.actionUrl&&Y(g,{variant:"outline",size:"sm",onClick:()=>window.open(f.actionUrl,"_blank"),children:f.actionLabel??"Try it"}),!w&&Y(g,{size:"sm",onClick:L,children:"Mark as Complete"})]})]})]})}import{Progress as s}from"@contractspec/lib.ui-kit-web/ui/progress";import{useState as ff}from"react";import{jsx as F,jsxs as B}from"react/jsx-runtime";function bf({track:f,progress:h,onStepComplete:w}){let[b,G]=ff(()=>{return f.steps.find((K)=>!h.completedStepIds.includes(K.id))?.id??null}),z=h.completedStepIds.length,L=f.steps.length,W=L>0?z/L*100:0,R=f.steps.findIndex((Q)=>!h.completedStepIds.includes(Q.id));return B("div",{className:"space-y-6",children:[B("div",{className:"space-y-2",children:[B("div",{className:"flex items-center justify-between",children:[F("h2",{className:"font-bold text-xl",children:"Complete Each Step"}),B("span",{className:"text-muted-foreground text-sm",children:[z," / ",L," completed"]})]}),F(s,{value:W,className:"h-2"})]}),F("div",{className:"space-y-3",children:f.steps.map((Q,K)=>{let Z=h.completedStepIds.includes(Q.id),D=K===R;return F(m,{step:Q,stepNumber:K+1,isCompleted:Z,isCurrent:D,isExpanded:b===Q.id,onToggle:()=>G(b===Q.id?null:Q.id),onComplete:()=>{w?.(Q.id);let O=f.steps[K+1];if(O&&!h.completedStepIds.includes(O.id))G(O.id)}},Q.id)})}),f.completionRewards&&W<100&&F("div",{className:"rounded-lg border border-blue-500/30 bg-blue-500/5 p-4",children:B("p",{className:"text-sm",children:["\uD83C\uDF81 Complete all steps to unlock:",f.completionRewards.xp&&B("span",{className:"ml-2 font-semibold text-blue-500",children:["+",f.completionRewards.xp," XP bonus"]}),f.completionRewards.badgeKey&&B("span",{className:"ml-2 font-semibold text-amber-500",children:['+ "',f.completionRewards.badgeKey,'" badge']})]})})]})}import{cn as I}from"@contractspec/lib.ui-kit-web/ui/utils";import{jsx as _,jsxs as l}from"react/jsx-runtime";var n={templates:"\uD83D\uDCCB","spec-editor":"✏️",regenerator:"\uD83D\uDD04",playground:"\uD83C\uDFAE",evolution:"\uD83E\uDD16",dashboard:"\uD83D\uDCCA",settings:"⚙️",default:"\uD83D\uDCCD"};function o({steps:f,completedStepIds:h,currentStepId:w}){return _("div",{className:"relative overflow-x-auto pb-4",children:_("div",{className:"flex min-w-max items-center gap-2",children:f.map((b,G)=>{let z=h.includes(b.id),L=b.id===w,W=b.metadata?.surface??"default",R=n[W]??n.default;return l("div",{className:"flex items-center",children:[l("div",{className:"flex flex-col items-center gap-2",children:[_("div",{className:I("flex h-14 w-14 items-center justify-center rounded-2xl border-2 text-2xl transition-all",z&&"border-green-500 bg-green-500/10",L&&!z&&"border-violet-500 bg-violet-500/10 ring-4 ring-violet-500/20",!z&&!L&&"border-muted bg-muted/50"),children:z?"✓":R}),_("div",{className:"text-center",children:_("p",{className:I("max-w-[100px] truncate font-medium text-xs",z&&"text-green-500",L&&!z&&"text-violet-500",!z&&!L&&"text-muted-foreground"),children:b.title})})]}),G<f.length-1&&_("div",{className:I("mx-2 h-1 w-8 rounded-full transition-colors",h.includes(f[G+1]?.id??"")?"bg-green-500":z?"bg-green-500/50":"bg-muted")})]},b.id)})})})}import{Card as S,CardContent as k,CardHeader as i,CardTitle as c}from"@contractspec/lib.ui-kit-web/ui/card";import{jsx as q,jsxs as U}from"react/jsx-runtime";function vf({track:f,progress:h}){let w=f.steps.find((b)=>!h.completedStepIds.includes(b.id))?.id??null;return U("div",{className:"space-y-6",children:[U("div",{className:"text-center",children:[q("h2",{className:"font-bold text-xl",children:"Your Learning Journey"}),q("p",{className:"text-muted-foreground",children:"Follow the path through each surface and feature"})]}),U(S,{children:[q(i,{children:U(c,{className:"flex items-center gap-2",children:[q("span",{children:"\uD83D\uDDFA️"}),q("span",{children:"Journey Map"})]})}),q(k,{children:q(o,{steps:f.steps,completedStepIds:h.completedStepIds,currentStepId:w})})]}),U(S,{children:[q(i,{children:U(c,{className:"flex items-center gap-2",children:[q("span",{children:"\uD83D\uDCCD"}),q("span",{children:"Step by Step"})]})}),q(k,{children:U("div",{className:"relative",children:[q("div",{className:"absolute top-0 left-4 h-full w-0.5 bg-border"}),q("div",{className:"space-y-6",children:f.steps.map((b,G)=>{let z=h.completedStepIds.includes(b.id),L=b.id===w,W=b.metadata?.surface??"general";return U("div",{className:"relative flex gap-4 pl-2",children:[q("div",{className:`relative z-10 flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 transition-all ${z?"border-green-500 bg-green-500 text-white":L?"border-blue-500 bg-blue-500 text-white ring-4 ring-blue-500/20":"border-border bg-background text-muted-foreground"}`,children:z?"✓":G+1}),q("div",{className:"flex-1 pb-2",children:U("div",{className:"rounded-lg border p-4",children:[U("div",{className:"flex items-start justify-between gap-2",children:[U("div",{children:[U("div",{className:"flex items-center gap-2",children:[q("h4",{className:`font-semibold ${z?"text-green-500":L?"text-blue-500":"text-foreground"}`,children:b.title}),q("span",{className:"rounded bg-muted px-2 py-0.5 text-muted-foreground text-xs",children:W})]}),q("p",{className:"mt-1 text-muted-foreground text-sm",children:b.description})]}),b.xpReward&&U("span",{className:`shrink-0 rounded-full px-2 py-1 font-semibold text-xs ${z?"bg-green-500/10 text-green-500":"bg-muted text-muted-foreground"}`,children:["+",b.xpReward," XP"]})]}),q("div",{className:"mt-3 text-xs",children:z?q("span",{className:"text-green-500",children:"✓ Completed"}):L?q("span",{className:"text-blue-500",children:"→ In Progress"}):q("span",{className:"text-muted-foreground",children:"○ Not Started"})})]})})]},b.id)})})]})})]})]})}export{vf as Timeline,bf as Steps,e as Progress,x as Overview};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{XpBar as W}from"@contractspec/example.learning-journey-ui-shared";import{Button as Y}from"@contractspec/lib.design-system";import{Card as A,CardContent as D,CardHeader as J,CardTitle as K}from"@contractspec/lib.ui-kit-web/ui/card";import{Progress as Z}from"@contractspec/lib.ui-kit-web/ui/progress";import{jsx as f,jsxs as h}from"react/jsx-runtime";function b({track:q,progress:E,onStart:R}){let y=q.steps.length,F=E.completedStepIds.length,N=y>0?F/y*100:0,z=F===y,O=y-F,L=O*5,U=q.totalXp??q.steps.reduce((v,G)=>v+(G.xpReward??0),0)+(q.completionRewards?.xpBonus??0);return h("div",{className:"space-y-6",children:[f(A,{className:"overflow-hidden bg-gradient-to-r from-blue-500/10 via-violet-500/10 to-purple-500/10",children:f(D,{className:"p-8",children:h("div",{className:"flex flex-col items-center gap-6 text-center md:flex-row md:text-left",children:[f("div",{className:"flex h-20 w-20 items-center justify-center rounded-2xl bg-gradient-to-br from-blue-500 to-violet-600 text-4xl shadow-lg",children:z?"\uD83C\uDF89":"\uD83D\uDE80"}),h("div",{className:"flex-1",children:[f("h1",{className:"font-bold text-2xl",children:q.name}),f("p",{className:"mt-1 max-w-2xl text-muted-foreground",children:q.description}),!z&&h("p",{className:"mt-3 text-muted-foreground text-sm",children:["\u23F1\uFE0F Estimated time:"," ",L>0?`~${L} minutes`:"Less than a minute"]})]}),!z&&f(Y,{size:"lg",onClick:R,children:F>0?"Continue":"Get Started"})]})})}),h("div",{className:"grid gap-4 md:grid-cols-3",children:[h(A,{children:[f(J,{className:"pb-2",children:f(K,{className:"font-medium text-muted-foreground text-sm",children:"Progress"})}),h(D,{children:[h("div",{className:"font-bold text-3xl",children:[Math.round(N),"%"]}),f(Z,{value:N,className:"mt-2 h-2"}),h("p",{className:"mt-2 text-muted-foreground text-sm",children:[F," of ",y," steps completed"]})]})]}),h(A,{children:[f(J,{className:"pb-2",children:f(K,{className:"font-medium text-muted-foreground text-sm",children:"XP Earned"})}),h(D,{children:[f("div",{className:"font-bold text-3xl text-blue-500",children:E.xpEarned}),f(W,{current:E.xpEarned,max:U,showLabel:!1,size:"sm"})]})]}),h(A,{children:[f(J,{className:"pb-2",children:f(K,{className:"font-medium text-muted-foreground text-sm",children:"Time Remaining"})}),h(D,{children:[f("div",{className:"font-bold text-3xl",children:z?"\u2713":`~${L}m`}),f("p",{className:"mt-2 text-muted-foreground text-sm",children:z?"All done!":`${O} steps to go`})]})]})]}),h(A,{children:[f(J,{children:h(K,{className:"flex items-center gap-2",children:[f("span",{children:"\uD83D\uDCCB"}),f("span",{children:"Your Journey"})]})}),f(D,{children:f("div",{className:"space-y-3",children:q.steps.map((v,G)=>{let I=E.completedStepIds.includes(v.id),Q=!I&&q.steps.slice(0,G).every((V)=>E.completedStepIds.includes(V.id));return h("div",{className:"flex items-center gap-4 rounded-lg border p-3",children:[f("div",{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full font-semibold text-sm ${I?"bg-green-500 text-white":Q?"bg-blue-500 text-white":"bg-muted text-muted-foreground"}`,children:I?"\u2713":G+1}),f("div",{className:"min-w-0 flex-1",children:f("p",{className:`font-medium ${I?"text-green-500":Q?"text-foreground":"text-muted-foreground"}`,children:v.title})}),v.xpReward&&h("span",{className:"text-muted-foreground text-sm",children:["+",v.xpReward," XP"]})]},v.id)})})})]}),z&&f(A,{className:"border-green-500/50 bg-green-500/5",children:h(D,{className:"flex items-center gap-4 p-6",children:[f("div",{className:"text-4xl",children:"\uD83C\uDF89"}),h("div",{children:[f("h3",{className:"font-semibold text-green-500 text-lg",children:"Onboarding Complete!"}),h("p",{className:"text-muted-foreground",children:["You've completed all ",y," steps. Welcome aboard!"]})]})]})})]})}export{b as Overview};
2
+ import{XpBar as W}from"@contractspec/example.learning-journey-ui-shared";import{Button as Y}from"@contractspec/lib.design-system";import{Card as A,CardContent as D,CardHeader as J,CardTitle as K}from"@contractspec/lib.ui-kit-web/ui/card";import{Progress as Z}from"@contractspec/lib.ui-kit-web/ui/progress";import{jsx as f,jsxs as h}from"react/jsx-runtime";function b({track:q,progress:E,onStart:R}){let y=q.steps.length,F=E.completedStepIds.length,N=y>0?F/y*100:0,z=F===y,O=y-F,L=O*5,U=q.totalXp??q.steps.reduce((v,G)=>v+(G.xpReward??0),0)+(q.completionRewards?.xp??0);return h("div",{className:"space-y-6",children:[f(A,{className:"overflow-hidden bg-gradient-to-r from-blue-500/10 via-violet-500/10 to-purple-500/10",children:f(D,{className:"p-8",children:h("div",{className:"flex flex-col items-center gap-6 text-center md:flex-row md:text-left",children:[f("div",{className:"flex h-20 w-20 items-center justify-center rounded-2xl bg-gradient-to-br from-blue-500 to-violet-600 text-4xl shadow-lg",children:z?"\uD83C\uDF89":"\uD83D\uDE80"}),h("div",{className:"flex-1",children:[f("h1",{className:"font-bold text-2xl",children:q.name}),f("p",{className:"mt-1 max-w-2xl text-muted-foreground",children:q.description}),!z&&h("p",{className:"mt-3 text-muted-foreground text-sm",children:["\u23F1\uFE0F Estimated time:"," ",L>0?`~${L} minutes`:"Less than a minute"]})]}),!z&&f(Y,{size:"lg",onClick:R,children:F>0?"Continue":"Get Started"})]})})}),h("div",{className:"grid gap-4 md:grid-cols-3",children:[h(A,{children:[f(J,{className:"pb-2",children:f(K,{className:"font-medium text-muted-foreground text-sm",children:"Progress"})}),h(D,{children:[h("div",{className:"font-bold text-3xl",children:[Math.round(N),"%"]}),f(Z,{value:N,className:"mt-2 h-2"}),h("p",{className:"mt-2 text-muted-foreground text-sm",children:[F," of ",y," steps completed"]})]})]}),h(A,{children:[f(J,{className:"pb-2",children:f(K,{className:"font-medium text-muted-foreground text-sm",children:"XP Earned"})}),h(D,{children:[f("div",{className:"font-bold text-3xl text-blue-500",children:E.xpEarned}),f(W,{current:E.xpEarned,max:U,showLabel:!1,size:"sm"})]})]}),h(A,{children:[f(J,{className:"pb-2",children:f(K,{className:"font-medium text-muted-foreground text-sm",children:"Time Remaining"})}),h(D,{children:[f("div",{className:"font-bold text-3xl",children:z?"\u2713":`~${L}m`}),f("p",{className:"mt-2 text-muted-foreground text-sm",children:z?"All done!":`${O} steps to go`})]})]})]}),h(A,{children:[f(J,{children:h(K,{className:"flex items-center gap-2",children:[f("span",{children:"\uD83D\uDCCB"}),f("span",{children:"Your Journey"})]})}),f(D,{children:f("div",{className:"space-y-3",children:q.steps.map((v,G)=>{let I=E.completedStepIds.includes(v.id),Q=!I&&q.steps.slice(0,G).every((V)=>E.completedStepIds.includes(V.id));return h("div",{className:"flex items-center gap-4 rounded-lg border p-3",children:[f("div",{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full font-semibold text-sm ${I?"bg-green-500 text-white":Q?"bg-blue-500 text-white":"bg-muted text-muted-foreground"}`,children:I?"\u2713":G+1}),f("div",{className:"min-w-0 flex-1",children:f("p",{className:`font-medium ${I?"text-green-500":Q?"text-foreground":"text-muted-foreground"}`,children:v.title})}),v.xpReward&&h("span",{className:"text-muted-foreground text-sm",children:["+",v.xpReward," XP"]})]},v.id)})})})]}),z&&f(A,{className:"border-green-500/50 bg-green-500/5",children:h(D,{className:"flex items-center gap-4 p-6",children:[f("div",{className:"text-4xl",children:"\uD83C\uDF89"}),h("div",{children:[f("h3",{className:"font-semibold text-green-500 text-lg",children:"Onboarding Complete!"}),h("p",{className:"text-muted-foreground",children:["You've completed all ",y," steps. Welcome aboard!"]})]})]})})]})}export{b as Overview};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{BadgeDisplay as W,XpBar as Y}from"@contractspec/example.learning-journey-ui-shared";import{Card as E,CardContent as F,CardHeader as G,CardTitle as I}from"@contractspec/lib.ui-kit-web/ui/card";import{Progress as Z}from"@contractspec/lib.ui-kit-web/ui/progress";import{jsx as f,jsxs as h}from"react/jsx-runtime";function D({track:q,progress:v}){let J=q.steps.length,K=v.completedStepIds.length,N=J>0?K/J*100:0,O=q.totalXp??q.steps.reduce((z,L)=>z+(L.xpReward??0),0)+(q.completionRewards?.xpBonus??0),Q=J-K,R=Q*5;return h("div",{className:"space-y-6",children:[h(E,{children:[f(G,{children:h(I,{className:"flex items-center gap-2",children:[f("span",{children:"\uD83D\uDCC8"}),f("span",{children:"Your Progress"})]})}),h(F,{className:"space-y-6",children:[f("div",{className:"flex items-center justify-center",children:h("div",{className:"relative flex h-40 w-40 items-center justify-center",children:[h("svg",{className:"absolute h-full w-full -rotate-90",viewBox:"0 0 100 100",children:[f("circle",{cx:"50",cy:"50",r:"45",fill:"none",strokeWidth:"8",className:"stroke-muted"}),f("circle",{cx:"50",cy:"50",r:"45",fill:"none",strokeWidth:"8",strokeLinecap:"round",strokeDasharray:`${N*2.83} 283`,className:"stroke-blue-500 transition-all duration-500"})]}),h("div",{className:"text-center",children:[h("div",{className:"font-bold text-3xl",children:[Math.round(N),"%"]}),f("div",{className:"text-muted-foreground text-sm",children:"Complete"})]})]})}),h("div",{className:"grid grid-cols-3 gap-4 text-center",children:[h("div",{children:[f("div",{className:"font-bold text-2xl text-green-500",children:K}),f("div",{className:"text-muted-foreground text-sm",children:"Completed"})]}),h("div",{children:[f("div",{className:"font-bold text-2xl text-orange-500",children:Q}),f("div",{className:"text-muted-foreground text-sm",children:"Remaining"})]}),h("div",{children:[h("div",{className:"font-bold text-2xl",children:[R,"m"]}),f("div",{className:"text-muted-foreground text-sm",children:"Est. Time"})]})]})]})]}),h(E,{children:[f(G,{children:h(I,{className:"flex items-center gap-2",children:[f("span",{children:"\u26A1"}),f("span",{children:"Experience Points"})]})}),h(F,{className:"space-y-4",children:[h("div",{className:"flex items-baseline gap-2",children:[f("span",{className:"font-bold text-3xl text-blue-500",children:v.xpEarned}),h("span",{className:"text-muted-foreground",children:["/ ",O," XP"]})]}),f(Y,{current:v.xpEarned,max:O,showLabel:!1,size:"lg"})]})]}),h(E,{children:[f(G,{children:h(I,{className:"flex items-center gap-2",children:[f("span",{children:"\uD83C\uDFC5"}),f("span",{children:"Achievements"})]})}),h(F,{children:[f(W,{badges:v.badges,size:"lg"}),v.badges.length===0&&q.completionRewards?.badgeKey&&h("p",{className:"text-muted-foreground text-sm",children:['Complete all steps to earn the "',q.completionRewards.badgeKey,'" badge!']})]})]}),h(E,{children:[f(G,{children:h(I,{className:"flex items-center gap-2",children:[f("span",{children:"\uD83D\uDCCB"}),f("span",{children:"Step Details"})]})}),f(F,{children:f("div",{className:"space-y-3",children:q.steps.map((z,L)=>{let A=v.completedStepIds.includes(z.id),U=A?100:0;return h("div",{className:"space-y-1",children:[h("div",{className:"flex items-center justify-between text-sm",children:[h("span",{className:A?"text-green-500":"text-foreground",children:[L+1,". ",z.title]}),f("span",{className:A?"text-green-500":"text-muted-foreground",children:A?"\u2713":"Pending"})]}),f(Z,{value:U,className:"h-1"})]},z.id)})})})]})]})}export{D as ProgressView,D as Progress};
2
+ import{BadgeDisplay as W,XpBar as Y}from"@contractspec/example.learning-journey-ui-shared";import{Card as E,CardContent as F,CardHeader as G,CardTitle as I}from"@contractspec/lib.ui-kit-web/ui/card";import{Progress as Z}from"@contractspec/lib.ui-kit-web/ui/progress";import{jsx as f,jsxs as h}from"react/jsx-runtime";function D({track:q,progress:v}){let J=q.steps.length,K=v.completedStepIds.length,N=J>0?K/J*100:0,O=q.totalXp??q.steps.reduce((z,L)=>z+(L.xpReward??0),0)+(q.completionRewards?.xp??0),Q=J-K,R=Q*5;return h("div",{className:"space-y-6",children:[h(E,{children:[f(G,{children:h(I,{className:"flex items-center gap-2",children:[f("span",{children:"\uD83D\uDCC8"}),f("span",{children:"Your Progress"})]})}),h(F,{className:"space-y-6",children:[f("div",{className:"flex items-center justify-center",children:h("div",{className:"relative flex h-40 w-40 items-center justify-center",children:[h("svg",{className:"absolute h-full w-full -rotate-90",viewBox:"0 0 100 100",children:[f("circle",{cx:"50",cy:"50",r:"45",fill:"none",strokeWidth:"8",className:"stroke-muted"}),f("circle",{cx:"50",cy:"50",r:"45",fill:"none",strokeWidth:"8",strokeLinecap:"round",strokeDasharray:`${N*2.83} 283`,className:"stroke-blue-500 transition-all duration-500"})]}),h("div",{className:"text-center",children:[h("div",{className:"font-bold text-3xl",children:[Math.round(N),"%"]}),f("div",{className:"text-muted-foreground text-sm",children:"Complete"})]})]})}),h("div",{className:"grid grid-cols-3 gap-4 text-center",children:[h("div",{children:[f("div",{className:"font-bold text-2xl text-green-500",children:K}),f("div",{className:"text-muted-foreground text-sm",children:"Completed"})]}),h("div",{children:[f("div",{className:"font-bold text-2xl text-orange-500",children:Q}),f("div",{className:"text-muted-foreground text-sm",children:"Remaining"})]}),h("div",{children:[h("div",{className:"font-bold text-2xl",children:[R,"m"]}),f("div",{className:"text-muted-foreground text-sm",children:"Est. Time"})]})]})]})]}),h(E,{children:[f(G,{children:h(I,{className:"flex items-center gap-2",children:[f("span",{children:"\u26A1"}),f("span",{children:"Experience Points"})]})}),h(F,{className:"space-y-4",children:[h("div",{className:"flex items-baseline gap-2",children:[f("span",{className:"font-bold text-3xl text-blue-500",children:v.xpEarned}),h("span",{className:"text-muted-foreground",children:["/ ",O," XP"]})]}),f(Y,{current:v.xpEarned,max:O,showLabel:!1,size:"lg"})]})]}),h(E,{children:[f(G,{children:h(I,{className:"flex items-center gap-2",children:[f("span",{children:"\uD83C\uDFC5"}),f("span",{children:"Achievements"})]})}),h(F,{children:[f(W,{badges:v.badges,size:"lg"}),v.badges.length===0&&q.completionRewards?.badgeKey&&h("p",{className:"text-muted-foreground text-sm",children:['Complete all steps to earn the "',q.completionRewards.badgeKey,'" badge!']})]})]}),h(E,{children:[f(G,{children:h(I,{className:"flex items-center gap-2",children:[f("span",{children:"\uD83D\uDCCB"}),f("span",{children:"Step Details"})]})}),f(F,{children:f("div",{className:"space-y-3",children:q.steps.map((z,L)=>{let A=v.completedStepIds.includes(z.id),U=A?100:0;return h("div",{className:"space-y-1",children:[h("div",{className:"flex items-center justify-between text-sm",children:[h("span",{className:A?"text-green-500":"text-foreground",children:[L+1,". ",z.title]}),f("span",{className:A?"text-green-500":"text-muted-foreground",children:A?"\u2713":"Pending"})]}),f(Z,{value:U,className:"h-1"})]},z.id)})})})]})]})}export{D as ProgressView,D as Progress};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Button as c}from"@contractspec/lib.design-system";import{cn as e}from"@contractspec/lib.ui-kit-core";import{jsx as u,jsxs as m}from"react/jsx-runtime";function y({step:n,stepNumber:r,isCompleted:o,isCurrent:l,isExpanded:a,onToggle:g,onComplete:f}){return m("div",{className:e("rounded-xl border transition-all",o&&"border-green-500/50 bg-green-500/5",l&&!o&&"border-violet-500 bg-violet-500/5",!o&&!l&&"border-border"),children:[m("button",{type:"button",className:"flex w-full items-center gap-4 p-4 text-left",onClick:g,children:[u("div",{className:e("flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 font-semibold text-sm transition-colors",o&&"border-green-500 bg-green-500 text-white",l&&!o&&"border-violet-500 text-violet-500",!o&&!l&&"border-muted-foreground text-muted-foreground"),children:o?"\u2713":r}),m("div",{className:"min-w-0 flex-1",children:[u("h4",{className:e("font-semibold",o&&"text-green-500",l&&!o&&"text-foreground",!o&&!l&&"text-muted-foreground"),children:n.title}),!a&&n.description&&u("p",{className:"truncate text-muted-foreground text-sm",children:n.description})]}),n.xpReward&&m("span",{className:e("shrink-0 rounded-full px-2 py-1 font-semibold text-xs",o?"bg-green-500/10 text-green-500":"bg-muted text-muted-foreground"),children:["+",n.xpReward," XP"]}),u("span",{className:e("shrink-0 transition-transform",a&&"rotate-180"),children:"\u25BC"})]}),a&&m("div",{className:"border-t px-4 py-4",children:[n.description&&u("p",{className:"mb-4 text-muted-foreground",children:n.description}),n.instructions&&m("div",{className:"mb-4 rounded-lg bg-muted p-4",children:[u("p",{className:"mb-2 font-medium text-sm",children:"Instructions:"}),u("p",{className:"text-muted-foreground text-sm",children:n.instructions})]}),m("div",{className:"flex flex-wrap gap-2",children:[n.actionUrl&&u(c,{variant:"outline",size:"sm",onClick:()=>window.open(n.actionUrl,"_blank"),children:n.actionLabel??"Try it"}),!o&&u(c,{size:"sm",onClick:f,children:"Mark as Complete"})]})]})]})}import{Progress as L}from"@contractspec/lib.ui-kit-web/ui/progress";import{useState as z}from"react";import{jsx as v,jsxs as b}from"react/jsx-runtime";function _({track:n,progress:r,onStepComplete:o}){let[l,a]=z(()=>{return n.steps.find((d)=>!r.completedStepIds.includes(d.id))?.id??null}),g=r.completedStepIds.length,f=n.steps.length,N=f>0?g/f*100:0,h=n.steps.findIndex((i)=>!r.completedStepIds.includes(i.id));return b("div",{className:"space-y-6",children:[b("div",{className:"space-y-2",children:[b("div",{className:"flex items-center justify-between",children:[v("h2",{className:"font-bold text-xl",children:"Complete Each Step"}),b("span",{className:"text-muted-foreground text-sm",children:[g," / ",f," completed"]})]}),v(L,{value:N,className:"h-2"})]}),v("div",{className:"space-y-3",children:n.steps.map((i,d)=>{let w=r.completedStepIds.includes(i.id),B=d===h;return v(y,{step:i,stepNumber:d+1,isCompleted:w,isCurrent:B,isExpanded:l===i.id,onToggle:()=>a(l===i.id?null:i.id),onComplete:()=>{o?.(i.id);let t=n.steps[d+1];if(t&&!r.completedStepIds.includes(t.id))a(t.id)}},i.id)})}),n.completionRewards&&N<100&&v("div",{className:"rounded-lg border border-blue-500/30 bg-blue-500/5 p-4",children:b("p",{className:"text-sm",children:["\uD83C\uDF81 Complete all steps to unlock:",n.completionRewards.xpBonus&&b("span",{className:"ml-2 font-semibold text-blue-500",children:["+",n.completionRewards.xpBonus," XP bonus"]}),n.completionRewards.badgeKey&&b("span",{className:"ml-2 font-semibold text-amber-500",children:['+ "',n.completionRewards.badgeKey,'" badge']})]})})]})}export{_ as Steps};
2
+ import{Button as c}from"@contractspec/lib.design-system";import{cn as e}from"@contractspec/lib.ui-kit-core";import{jsx as u,jsxs as r}from"react/jsx-runtime";function y({step:o,stepNumber:m,isCompleted:n,isCurrent:l,isExpanded:f,onToggle:g,onComplete:a}){return r("div",{className:e("rounded-xl border transition-all",n&&"border-green-500/50 bg-green-500/5",l&&!n&&"border-violet-500 bg-violet-500/5",!n&&!l&&"border-border"),children:[r("button",{type:"button",className:"flex w-full items-center gap-4 p-4 text-left",onClick:g,children:[u("div",{className:e("flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 font-semibold text-sm transition-colors",n&&"border-green-500 bg-green-500 text-white",l&&!n&&"border-violet-500 text-violet-500",!n&&!l&&"border-muted-foreground text-muted-foreground"),children:n?"\u2713":m}),r("div",{className:"min-w-0 flex-1",children:[u("h4",{className:e("font-semibold",n&&"text-green-500",l&&!n&&"text-foreground",!n&&!l&&"text-muted-foreground"),children:o.title}),!f&&o.description&&u("p",{className:"truncate text-muted-foreground text-sm",children:o.description})]}),o.xpReward&&r("span",{className:e("shrink-0 rounded-full px-2 py-1 font-semibold text-xs",n?"bg-green-500/10 text-green-500":"bg-muted text-muted-foreground"),children:["+",o.xpReward," XP"]}),u("span",{className:e("shrink-0 transition-transform",f&&"rotate-180"),children:"\u25BC"})]}),f&&r("div",{className:"border-t px-4 py-4",children:[o.description&&u("p",{className:"mb-4 text-muted-foreground",children:o.description}),o.instructions&&r("div",{className:"mb-4 rounded-lg bg-muted p-4",children:[u("p",{className:"mb-2 font-medium text-sm",children:"Instructions:"}),u("p",{className:"text-muted-foreground text-sm",children:o.instructions})]}),r("div",{className:"flex flex-wrap gap-2",children:[o.actionUrl&&u(c,{variant:"outline",size:"sm",onClick:()=>window.open(o.actionUrl,"_blank"),children:o.actionLabel??"Try it"}),!n&&u(c,{size:"sm",onClick:a,children:"Mark as Complete"})]})]})]})}import{Progress as z}from"@contractspec/lib.ui-kit-web/ui/progress";import{useState as J}from"react";import{jsx as v,jsxs as b}from"react/jsx-runtime";function _({track:o,progress:m,onStepComplete:n}){let[l,f]=J(()=>{return o.steps.find((d)=>!m.completedStepIds.includes(d.id))?.id??null}),g=m.completedStepIds.length,a=o.steps.length,N=a>0?g/a*100:0,h=o.steps.findIndex((i)=>!m.completedStepIds.includes(i.id));return b("div",{className:"space-y-6",children:[b("div",{className:"space-y-2",children:[b("div",{className:"flex items-center justify-between",children:[v("h2",{className:"font-bold text-xl",children:"Complete Each Step"}),b("span",{className:"text-muted-foreground text-sm",children:[g," / ",a," completed"]})]}),v(z,{value:N,className:"h-2"})]}),v("div",{className:"space-y-3",children:o.steps.map((i,d)=>{let w=m.completedStepIds.includes(i.id),B=d===h;return v(y,{step:i,stepNumber:d+1,isCompleted:w,isCurrent:B,isExpanded:l===i.id,onToggle:()=>f(l===i.id?null:i.id),onComplete:()=>{n?.(i.id);let t=o.steps[d+1];if(t&&!m.completedStepIds.includes(t.id))f(t.id)}},i.id)})}),o.completionRewards&&N<100&&v("div",{className:"rounded-lg border border-blue-500/30 bg-blue-500/5 p-4",children:b("p",{className:"text-sm",children:["\uD83C\uDF81 Complete all steps to unlock:",o.completionRewards.xp&&b("span",{className:"ml-2 font-semibold text-blue-500",children:["+",o.completionRewards.xp," XP bonus"]}),o.completionRewards.badgeKey&&b("span",{className:"ml-2 font-semibold text-amber-500",children:['+ "',o.completionRewards.badgeKey,'" badge']})]})})]})}export{_ as Steps};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{XpBar as a}from"@contractspec/example.learning-journey-ui-shared";import{Button as C}from"@contractspec/lib.design-system";import{Card as P,CardContent as V,CardHeader as u,CardTitle as X}from"@contractspec/lib.ui-kit-web/ui/card";import{Progress as r}from"@contractspec/lib.ui-kit-web/ui/progress";import{jsx as v,jsxs as J}from"react/jsx-runtime";function x({track:f,progress:h,onStart:w}){let b=f.steps.length,G=h.completedStepIds.length,L=b>0?G/b*100:0,z=G===b,W=b-G,R=W*5,Q=f.totalXp??f.steps.reduce((K,Z)=>K+(Z.xpReward??0),0)+(f.completionRewards?.xpBonus??0);return J("div",{className:"space-y-6",children:[v(P,{className:"overflow-hidden bg-gradient-to-r from-blue-500/10 via-violet-500/10 to-purple-500/10",children:v(V,{className:"p-8",children:J("div",{className:"flex flex-col items-center gap-6 text-center md:flex-row md:text-left",children:[v("div",{className:"flex h-20 w-20 items-center justify-center rounded-2xl bg-gradient-to-br from-blue-500 to-violet-600 text-4xl shadow-lg",children:z?"\uD83C\uDF89":"\uD83D\uDE80"}),J("div",{className:"flex-1",children:[v("h1",{className:"font-bold text-2xl",children:f.name}),v("p",{className:"mt-1 max-w-2xl text-muted-foreground",children:f.description}),!z&&J("p",{className:"mt-3 text-muted-foreground text-sm",children:["\u23F1\uFE0F Estimated time:"," ",R>0?`~${R} minutes`:"Less than a minute"]})]}),!z&&v(C,{size:"lg",onClick:w,children:G>0?"Continue":"Get Started"})]})})}),J("div",{className:"grid gap-4 md:grid-cols-3",children:[J(P,{children:[v(u,{className:"pb-2",children:v(X,{className:"font-medium text-muted-foreground text-sm",children:"Progress"})}),J(V,{children:[J("div",{className:"font-bold text-3xl",children:[Math.round(L),"%"]}),v(r,{value:L,className:"mt-2 h-2"}),J("p",{className:"mt-2 text-muted-foreground text-sm",children:[G," of ",b," steps completed"]})]})]}),J(P,{children:[v(u,{className:"pb-2",children:v(X,{className:"font-medium text-muted-foreground text-sm",children:"XP Earned"})}),J(V,{children:[v("div",{className:"font-bold text-3xl text-blue-500",children:h.xpEarned}),v(a,{current:h.xpEarned,max:Q,showLabel:!1,size:"sm"})]})]}),J(P,{children:[v(u,{className:"pb-2",children:v(X,{className:"font-medium text-muted-foreground text-sm",children:"Time Remaining"})}),J(V,{children:[v("div",{className:"font-bold text-3xl",children:z?"\u2713":`~${R}m`}),v("p",{className:"mt-2 text-muted-foreground text-sm",children:z?"All done!":`${W} steps to go`})]})]})]}),J(P,{children:[v(u,{children:J(X,{className:"flex items-center gap-2",children:[v("span",{children:"\uD83D\uDCCB"}),v("span",{children:"Your Journey"})]})}),v(V,{children:v("div",{className:"space-y-3",children:f.steps.map((K,Z)=>{let D=h.completedStepIds.includes(K.id),O=!D&&f.steps.slice(0,Z).every((d)=>h.completedStepIds.includes(d.id));return J("div",{className:"flex items-center gap-4 rounded-lg border p-3",children:[v("div",{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full font-semibold text-sm ${D?"bg-green-500 text-white":O?"bg-blue-500 text-white":"bg-muted text-muted-foreground"}`,children:D?"\u2713":Z+1}),v("div",{className:"min-w-0 flex-1",children:v("p",{className:`font-medium ${D?"text-green-500":O?"text-foreground":"text-muted-foreground"}`,children:K.title})}),K.xpReward&&J("span",{className:"text-muted-foreground text-sm",children:["+",K.xpReward," XP"]})]},K.id)})})})]}),z&&v(P,{className:"border-green-500/50 bg-green-500/5",children:J(V,{className:"flex items-center gap-4 p-6",children:[v("div",{className:"text-4xl",children:"\uD83C\uDF89"}),J("div",{children:[v("h3",{className:"font-semibold text-green-500 text-lg",children:"Onboarding Complete!"}),J("p",{className:"text-muted-foreground",children:["You've completed all ",b," steps. Welcome aboard!"]})]})]})})]})}import{BadgeDisplay as j,XpBar as p}from"@contractspec/example.learning-journey-ui-shared";import{Card as E,CardContent as M,CardHeader as T,CardTitle as H}from"@contractspec/lib.ui-kit-web/ui/card";import{Progress as t}from"@contractspec/lib.ui-kit-web/ui/progress";import{jsx as N,jsxs as y}from"react/jsx-runtime";function e({track:f,progress:h}){let w=f.steps.length,b=h.completedStepIds.length,G=w>0?b/w*100:0,L=f.totalXp??f.steps.reduce((R,Q)=>R+(Q.xpReward??0),0)+(f.completionRewards?.xpBonus??0),z=w-b,W=z*5;return y("div",{className:"space-y-6",children:[y(E,{children:[N(T,{children:y(H,{className:"flex items-center gap-2",children:[N("span",{children:"\uD83D\uDCC8"}),N("span",{children:"Your Progress"})]})}),y(M,{className:"space-y-6",children:[N("div",{className:"flex items-center justify-center",children:y("div",{className:"relative flex h-40 w-40 items-center justify-center",children:[y("svg",{className:"absolute h-full w-full -rotate-90",viewBox:"0 0 100 100",children:[N("circle",{cx:"50",cy:"50",r:"45",fill:"none",strokeWidth:"8",className:"stroke-muted"}),N("circle",{cx:"50",cy:"50",r:"45",fill:"none",strokeWidth:"8",strokeLinecap:"round",strokeDasharray:`${G*2.83} 283`,className:"stroke-blue-500 transition-all duration-500"})]}),y("div",{className:"text-center",children:[y("div",{className:"font-bold text-3xl",children:[Math.round(G),"%"]}),N("div",{className:"text-muted-foreground text-sm",children:"Complete"})]})]})}),y("div",{className:"grid grid-cols-3 gap-4 text-center",children:[y("div",{children:[N("div",{className:"font-bold text-2xl text-green-500",children:b}),N("div",{className:"text-muted-foreground text-sm",children:"Completed"})]}),y("div",{children:[N("div",{className:"font-bold text-2xl text-orange-500",children:z}),N("div",{className:"text-muted-foreground text-sm",children:"Remaining"})]}),y("div",{children:[y("div",{className:"font-bold text-2xl",children:[W,"m"]}),N("div",{className:"text-muted-foreground text-sm",children:"Est. Time"})]})]})]})]}),y(E,{children:[N(T,{children:y(H,{className:"flex items-center gap-2",children:[N("span",{children:"\u26A1"}),N("span",{children:"Experience Points"})]})}),y(M,{className:"space-y-4",children:[y("div",{className:"flex items-baseline gap-2",children:[N("span",{className:"font-bold text-3xl text-blue-500",children:h.xpEarned}),y("span",{className:"text-muted-foreground",children:["/ ",L," XP"]})]}),N(p,{current:h.xpEarned,max:L,showLabel:!1,size:"lg"})]})]}),y(E,{children:[N(T,{children:y(H,{className:"flex items-center gap-2",children:[N("span",{children:"\uD83C\uDFC5"}),N("span",{children:"Achievements"})]})}),y(M,{children:[N(j,{badges:h.badges,size:"lg"}),h.badges.length===0&&f.completionRewards?.badgeKey&&y("p",{className:"text-muted-foreground text-sm",children:['Complete all steps to earn the "',f.completionRewards.badgeKey,'" badge!']})]})]}),y(E,{children:[N(T,{children:y(H,{className:"flex items-center gap-2",children:[N("span",{children:"\uD83D\uDCCB"}),N("span",{children:"Step Details"})]})}),N(M,{children:N("div",{className:"space-y-3",children:f.steps.map((R,Q)=>{let K=h.completedStepIds.includes(R.id),Z=K?100:0;return y("div",{className:"space-y-1",children:[y("div",{className:"flex items-center justify-between text-sm",children:[y("span",{className:K?"text-green-500":"text-foreground",children:[Q+1,". ",R.title]}),N("span",{className:K?"text-green-500":"text-muted-foreground",children:K?"\u2713":"Pending"})]}),N(t,{value:Z,className:"h-1"})]},R.id)})})})]})]})}import{Button as g}from"@contractspec/lib.design-system";import{cn as A}from"@contractspec/lib.ui-kit-core";import{jsx as Y,jsxs as $}from"react/jsx-runtime";function n({step:f,stepNumber:h,isCompleted:w,isCurrent:b,isExpanded:G,onToggle:L,onComplete:z}){return $("div",{className:A("rounded-xl border transition-all",w&&"border-green-500/50 bg-green-500/5",b&&!w&&"border-violet-500 bg-violet-500/5",!w&&!b&&"border-border"),children:[$("button",{type:"button",className:"flex w-full items-center gap-4 p-4 text-left",onClick:L,children:[Y("div",{className:A("flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 font-semibold text-sm transition-colors",w&&"border-green-500 bg-green-500 text-white",b&&!w&&"border-violet-500 text-violet-500",!w&&!b&&"border-muted-foreground text-muted-foreground"),children:w?"\u2713":h}),$("div",{className:"min-w-0 flex-1",children:[Y("h4",{className:A("font-semibold",w&&"text-green-500",b&&!w&&"text-foreground",!w&&!b&&"text-muted-foreground"),children:f.title}),!G&&f.description&&Y("p",{className:"truncate text-muted-foreground text-sm",children:f.description})]}),f.xpReward&&$("span",{className:A("shrink-0 rounded-full px-2 py-1 font-semibold text-xs",w?"bg-green-500/10 text-green-500":"bg-muted text-muted-foreground"),children:["+",f.xpReward," XP"]}),Y("span",{className:A("shrink-0 transition-transform",G&&"rotate-180"),children:"\u25BC"})]}),G&&$("div",{className:"border-t px-4 py-4",children:[f.description&&Y("p",{className:"mb-4 text-muted-foreground",children:f.description}),f.instructions&&$("div",{className:"mb-4 rounded-lg bg-muted p-4",children:[Y("p",{className:"mb-2 font-medium text-sm",children:"Instructions:"}),Y("p",{className:"text-muted-foreground text-sm",children:f.instructions})]}),$("div",{className:"flex flex-wrap gap-2",children:[f.actionUrl&&Y(g,{variant:"outline",size:"sm",onClick:()=>window.open(f.actionUrl,"_blank"),children:f.actionLabel??"Try it"}),!w&&Y(g,{size:"sm",onClick:z,children:"Mark as Complete"})]})]})]})}import{Progress as s}from"@contractspec/lib.ui-kit-web/ui/progress";import{useState as ff}from"react";import{jsx as F,jsxs as B}from"react/jsx-runtime";function bf({track:f,progress:h,onStepComplete:w}){let[b,G]=ff(()=>{return f.steps.find((K)=>!h.completedStepIds.includes(K.id))?.id??null}),L=h.completedStepIds.length,z=f.steps.length,W=z>0?L/z*100:0,R=f.steps.findIndex((Q)=>!h.completedStepIds.includes(Q.id));return B("div",{className:"space-y-6",children:[B("div",{className:"space-y-2",children:[B("div",{className:"flex items-center justify-between",children:[F("h2",{className:"font-bold text-xl",children:"Complete Each Step"}),B("span",{className:"text-muted-foreground text-sm",children:[L," / ",z," completed"]})]}),F(s,{value:W,className:"h-2"})]}),F("div",{className:"space-y-3",children:f.steps.map((Q,K)=>{let Z=h.completedStepIds.includes(Q.id),D=K===R;return F(n,{step:Q,stepNumber:K+1,isCompleted:Z,isCurrent:D,isExpanded:b===Q.id,onToggle:()=>G(b===Q.id?null:Q.id),onComplete:()=>{w?.(Q.id);let O=f.steps[K+1];if(O&&!h.completedStepIds.includes(O.id))G(O.id)}},Q.id)})}),f.completionRewards&&W<100&&F("div",{className:"rounded-lg border border-blue-500/30 bg-blue-500/5 p-4",children:B("p",{className:"text-sm",children:["\uD83C\uDF81 Complete all steps to unlock:",f.completionRewards.xpBonus&&B("span",{className:"ml-2 font-semibold text-blue-500",children:["+",f.completionRewards.xpBonus," XP bonus"]}),f.completionRewards.badgeKey&&B("span",{className:"ml-2 font-semibold text-amber-500",children:['+ "',f.completionRewards.badgeKey,'" badge']})]})})]})}import{cn as I}from"@contractspec/lib.ui-kit-web/ui/utils";import{jsx as _,jsxs as l}from"react/jsx-runtime";var m={templates:"\uD83D\uDCCB","spec-editor":"\u270F\uFE0F",regenerator:"\uD83D\uDD04",playground:"\uD83C\uDFAE",evolution:"\uD83E\uDD16",dashboard:"\uD83D\uDCCA",settings:"\u2699\uFE0F",default:"\uD83D\uDCCD"};function o({steps:f,completedStepIds:h,currentStepId:w}){return _("div",{className:"relative overflow-x-auto pb-4",children:_("div",{className:"flex min-w-max items-center gap-2",children:f.map((b,G)=>{let L=h.includes(b.id),z=b.id===w,W=b.metadata?.surface??"default",R=m[W]??m.default;return l("div",{className:"flex items-center",children:[l("div",{className:"flex flex-col items-center gap-2",children:[_("div",{className:I("flex h-14 w-14 items-center justify-center rounded-2xl border-2 text-2xl transition-all",L&&"border-green-500 bg-green-500/10",z&&!L&&"border-violet-500 bg-violet-500/10 ring-4 ring-violet-500/20",!L&&!z&&"border-muted bg-muted/50"),children:L?"\u2713":R}),_("div",{className:"text-center",children:_("p",{className:I("max-w-[100px] truncate font-medium text-xs",L&&"text-green-500",z&&!L&&"text-violet-500",!L&&!z&&"text-muted-foreground"),children:b.title})})]}),G<f.length-1&&_("div",{className:I("mx-2 h-1 w-8 rounded-full transition-colors",h.includes(f[G+1]?.id??"")?"bg-green-500":L?"bg-green-500/50":"bg-muted")})]},b.id)})})})}import{Card as S,CardContent as k,CardHeader as i,CardTitle as c}from"@contractspec/lib.ui-kit-web/ui/card";import{jsx as q,jsxs as U}from"react/jsx-runtime";function vf({track:f,progress:h}){let w=f.steps.find((b)=>!h.completedStepIds.includes(b.id))?.id??null;return U("div",{className:"space-y-6",children:[U("div",{className:"text-center",children:[q("h2",{className:"font-bold text-xl",children:"Your Learning Journey"}),q("p",{className:"text-muted-foreground",children:"Follow the path through each surface and feature"})]}),U(S,{children:[q(i,{children:U(c,{className:"flex items-center gap-2",children:[q("span",{children:"\uD83D\uDDFA\uFE0F"}),q("span",{children:"Journey Map"})]})}),q(k,{children:q(o,{steps:f.steps,completedStepIds:h.completedStepIds,currentStepId:w})})]}),U(S,{children:[q(i,{children:U(c,{className:"flex items-center gap-2",children:[q("span",{children:"\uD83D\uDCCD"}),q("span",{children:"Step by Step"})]})}),q(k,{children:U("div",{className:"relative",children:[q("div",{className:"absolute top-0 left-4 h-full w-0.5 bg-border"}),q("div",{className:"space-y-6",children:f.steps.map((b,G)=>{let L=h.completedStepIds.includes(b.id),z=b.id===w,W=b.metadata?.surface??"general";return U("div",{className:"relative flex gap-4 pl-2",children:[q("div",{className:`relative z-10 flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 transition-all ${L?"border-green-500 bg-green-500 text-white":z?"border-blue-500 bg-blue-500 text-white ring-4 ring-blue-500/20":"border-border bg-background text-muted-foreground"}`,children:L?"\u2713":G+1}),q("div",{className:"flex-1 pb-2",children:U("div",{className:"rounded-lg border p-4",children:[U("div",{className:"flex items-start justify-between gap-2",children:[U("div",{children:[U("div",{className:"flex items-center gap-2",children:[q("h4",{className:`font-semibold ${L?"text-green-500":z?"text-blue-500":"text-foreground"}`,children:b.title}),q("span",{className:"rounded bg-muted px-2 py-0.5 text-muted-foreground text-xs",children:W})]}),q("p",{className:"mt-1 text-muted-foreground text-sm",children:b.description})]}),b.xpReward&&U("span",{className:`shrink-0 rounded-full px-2 py-1 font-semibold text-xs ${L?"bg-green-500/10 text-green-500":"bg-muted text-muted-foreground"}`,children:["+",b.xpReward," XP"]})]}),q("div",{className:"mt-3 text-xs",children:L?q("span",{className:"text-green-500",children:"\u2713 Completed"}):z?q("span",{className:"text-blue-500",children:"\u2192 In Progress"}):q("span",{className:"text-muted-foreground",children:"\u25CB Not Started"})})]})})]},b.id)})})]})})]})]})}export{vf as Timeline,bf as Steps,e as Progress,x as Overview};
2
+ import{XpBar as a}from"@contractspec/example.learning-journey-ui-shared";import{Button as C}from"@contractspec/lib.design-system";import{Card as P,CardContent as V,CardHeader as u,CardTitle as X}from"@contractspec/lib.ui-kit-web/ui/card";import{Progress as r}from"@contractspec/lib.ui-kit-web/ui/progress";import{jsx as v,jsxs as J}from"react/jsx-runtime";function x({track:f,progress:h,onStart:w}){let b=f.steps.length,G=h.completedStepIds.length,z=b>0?G/b*100:0,L=G===b,W=b-G,R=W*5,Q=f.totalXp??f.steps.reduce((K,Z)=>K+(Z.xpReward??0),0)+(f.completionRewards?.xp??0);return J("div",{className:"space-y-6",children:[v(P,{className:"overflow-hidden bg-gradient-to-r from-blue-500/10 via-violet-500/10 to-purple-500/10",children:v(V,{className:"p-8",children:J("div",{className:"flex flex-col items-center gap-6 text-center md:flex-row md:text-left",children:[v("div",{className:"flex h-20 w-20 items-center justify-center rounded-2xl bg-gradient-to-br from-blue-500 to-violet-600 text-4xl shadow-lg",children:L?"\uD83C\uDF89":"\uD83D\uDE80"}),J("div",{className:"flex-1",children:[v("h1",{className:"font-bold text-2xl",children:f.name}),v("p",{className:"mt-1 max-w-2xl text-muted-foreground",children:f.description}),!L&&J("p",{className:"mt-3 text-muted-foreground text-sm",children:["\u23F1\uFE0F Estimated time:"," ",R>0?`~${R} minutes`:"Less than a minute"]})]}),!L&&v(C,{size:"lg",onClick:w,children:G>0?"Continue":"Get Started"})]})})}),J("div",{className:"grid gap-4 md:grid-cols-3",children:[J(P,{children:[v(u,{className:"pb-2",children:v(X,{className:"font-medium text-muted-foreground text-sm",children:"Progress"})}),J(V,{children:[J("div",{className:"font-bold text-3xl",children:[Math.round(z),"%"]}),v(r,{value:z,className:"mt-2 h-2"}),J("p",{className:"mt-2 text-muted-foreground text-sm",children:[G," of ",b," steps completed"]})]})]}),J(P,{children:[v(u,{className:"pb-2",children:v(X,{className:"font-medium text-muted-foreground text-sm",children:"XP Earned"})}),J(V,{children:[v("div",{className:"font-bold text-3xl text-blue-500",children:h.xpEarned}),v(a,{current:h.xpEarned,max:Q,showLabel:!1,size:"sm"})]})]}),J(P,{children:[v(u,{className:"pb-2",children:v(X,{className:"font-medium text-muted-foreground text-sm",children:"Time Remaining"})}),J(V,{children:[v("div",{className:"font-bold text-3xl",children:L?"\u2713":`~${R}m`}),v("p",{className:"mt-2 text-muted-foreground text-sm",children:L?"All done!":`${W} steps to go`})]})]})]}),J(P,{children:[v(u,{children:J(X,{className:"flex items-center gap-2",children:[v("span",{children:"\uD83D\uDCCB"}),v("span",{children:"Your Journey"})]})}),v(V,{children:v("div",{className:"space-y-3",children:f.steps.map((K,Z)=>{let D=h.completedStepIds.includes(K.id),O=!D&&f.steps.slice(0,Z).every((d)=>h.completedStepIds.includes(d.id));return J("div",{className:"flex items-center gap-4 rounded-lg border p-3",children:[v("div",{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full font-semibold text-sm ${D?"bg-green-500 text-white":O?"bg-blue-500 text-white":"bg-muted text-muted-foreground"}`,children:D?"\u2713":Z+1}),v("div",{className:"min-w-0 flex-1",children:v("p",{className:`font-medium ${D?"text-green-500":O?"text-foreground":"text-muted-foreground"}`,children:K.title})}),K.xpReward&&J("span",{className:"text-muted-foreground text-sm",children:["+",K.xpReward," XP"]})]},K.id)})})})]}),L&&v(P,{className:"border-green-500/50 bg-green-500/5",children:J(V,{className:"flex items-center gap-4 p-6",children:[v("div",{className:"text-4xl",children:"\uD83C\uDF89"}),J("div",{children:[v("h3",{className:"font-semibold text-green-500 text-lg",children:"Onboarding Complete!"}),J("p",{className:"text-muted-foreground",children:["You've completed all ",b," steps. Welcome aboard!"]})]})]})})]})}import{BadgeDisplay as j,XpBar as p}from"@contractspec/example.learning-journey-ui-shared";import{Card as E,CardContent as M,CardHeader as T,CardTitle as H}from"@contractspec/lib.ui-kit-web/ui/card";import{Progress as t}from"@contractspec/lib.ui-kit-web/ui/progress";import{jsx as N,jsxs as y}from"react/jsx-runtime";function e({track:f,progress:h}){let w=f.steps.length,b=h.completedStepIds.length,G=w>0?b/w*100:0,z=f.totalXp??f.steps.reduce((R,Q)=>R+(Q.xpReward??0),0)+(f.completionRewards?.xp??0),L=w-b,W=L*5;return y("div",{className:"space-y-6",children:[y(E,{children:[N(T,{children:y(H,{className:"flex items-center gap-2",children:[N("span",{children:"\uD83D\uDCC8"}),N("span",{children:"Your Progress"})]})}),y(M,{className:"space-y-6",children:[N("div",{className:"flex items-center justify-center",children:y("div",{className:"relative flex h-40 w-40 items-center justify-center",children:[y("svg",{className:"absolute h-full w-full -rotate-90",viewBox:"0 0 100 100",children:[N("circle",{cx:"50",cy:"50",r:"45",fill:"none",strokeWidth:"8",className:"stroke-muted"}),N("circle",{cx:"50",cy:"50",r:"45",fill:"none",strokeWidth:"8",strokeLinecap:"round",strokeDasharray:`${G*2.83} 283`,className:"stroke-blue-500 transition-all duration-500"})]}),y("div",{className:"text-center",children:[y("div",{className:"font-bold text-3xl",children:[Math.round(G),"%"]}),N("div",{className:"text-muted-foreground text-sm",children:"Complete"})]})]})}),y("div",{className:"grid grid-cols-3 gap-4 text-center",children:[y("div",{children:[N("div",{className:"font-bold text-2xl text-green-500",children:b}),N("div",{className:"text-muted-foreground text-sm",children:"Completed"})]}),y("div",{children:[N("div",{className:"font-bold text-2xl text-orange-500",children:L}),N("div",{className:"text-muted-foreground text-sm",children:"Remaining"})]}),y("div",{children:[y("div",{className:"font-bold text-2xl",children:[W,"m"]}),N("div",{className:"text-muted-foreground text-sm",children:"Est. Time"})]})]})]})]}),y(E,{children:[N(T,{children:y(H,{className:"flex items-center gap-2",children:[N("span",{children:"\u26A1"}),N("span",{children:"Experience Points"})]})}),y(M,{className:"space-y-4",children:[y("div",{className:"flex items-baseline gap-2",children:[N("span",{className:"font-bold text-3xl text-blue-500",children:h.xpEarned}),y("span",{className:"text-muted-foreground",children:["/ ",z," XP"]})]}),N(p,{current:h.xpEarned,max:z,showLabel:!1,size:"lg"})]})]}),y(E,{children:[N(T,{children:y(H,{className:"flex items-center gap-2",children:[N("span",{children:"\uD83C\uDFC5"}),N("span",{children:"Achievements"})]})}),y(M,{children:[N(j,{badges:h.badges,size:"lg"}),h.badges.length===0&&f.completionRewards?.badgeKey&&y("p",{className:"text-muted-foreground text-sm",children:['Complete all steps to earn the "',f.completionRewards.badgeKey,'" badge!']})]})]}),y(E,{children:[N(T,{children:y(H,{className:"flex items-center gap-2",children:[N("span",{children:"\uD83D\uDCCB"}),N("span",{children:"Step Details"})]})}),N(M,{children:N("div",{className:"space-y-3",children:f.steps.map((R,Q)=>{let K=h.completedStepIds.includes(R.id),Z=K?100:0;return y("div",{className:"space-y-1",children:[y("div",{className:"flex items-center justify-between text-sm",children:[y("span",{className:K?"text-green-500":"text-foreground",children:[Q+1,". ",R.title]}),N("span",{className:K?"text-green-500":"text-muted-foreground",children:K?"\u2713":"Pending"})]}),N(t,{value:Z,className:"h-1"})]},R.id)})})})]})]})}import{Button as g}from"@contractspec/lib.design-system";import{cn as A}from"@contractspec/lib.ui-kit-core";import{jsx as Y,jsxs as $}from"react/jsx-runtime";function m({step:f,stepNumber:h,isCompleted:w,isCurrent:b,isExpanded:G,onToggle:z,onComplete:L}){return $("div",{className:A("rounded-xl border transition-all",w&&"border-green-500/50 bg-green-500/5",b&&!w&&"border-violet-500 bg-violet-500/5",!w&&!b&&"border-border"),children:[$("button",{type:"button",className:"flex w-full items-center gap-4 p-4 text-left",onClick:z,children:[Y("div",{className:A("flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 font-semibold text-sm transition-colors",w&&"border-green-500 bg-green-500 text-white",b&&!w&&"border-violet-500 text-violet-500",!w&&!b&&"border-muted-foreground text-muted-foreground"),children:w?"\u2713":h}),$("div",{className:"min-w-0 flex-1",children:[Y("h4",{className:A("font-semibold",w&&"text-green-500",b&&!w&&"text-foreground",!w&&!b&&"text-muted-foreground"),children:f.title}),!G&&f.description&&Y("p",{className:"truncate text-muted-foreground text-sm",children:f.description})]}),f.xpReward&&$("span",{className:A("shrink-0 rounded-full px-2 py-1 font-semibold text-xs",w?"bg-green-500/10 text-green-500":"bg-muted text-muted-foreground"),children:["+",f.xpReward," XP"]}),Y("span",{className:A("shrink-0 transition-transform",G&&"rotate-180"),children:"\u25BC"})]}),G&&$("div",{className:"border-t px-4 py-4",children:[f.description&&Y("p",{className:"mb-4 text-muted-foreground",children:f.description}),f.instructions&&$("div",{className:"mb-4 rounded-lg bg-muted p-4",children:[Y("p",{className:"mb-2 font-medium text-sm",children:"Instructions:"}),Y("p",{className:"text-muted-foreground text-sm",children:f.instructions})]}),$("div",{className:"flex flex-wrap gap-2",children:[f.actionUrl&&Y(g,{variant:"outline",size:"sm",onClick:()=>window.open(f.actionUrl,"_blank"),children:f.actionLabel??"Try it"}),!w&&Y(g,{size:"sm",onClick:L,children:"Mark as Complete"})]})]})]})}import{Progress as s}from"@contractspec/lib.ui-kit-web/ui/progress";import{useState as ff}from"react";import{jsx as F,jsxs as B}from"react/jsx-runtime";function bf({track:f,progress:h,onStepComplete:w}){let[b,G]=ff(()=>{return f.steps.find((K)=>!h.completedStepIds.includes(K.id))?.id??null}),z=h.completedStepIds.length,L=f.steps.length,W=L>0?z/L*100:0,R=f.steps.findIndex((Q)=>!h.completedStepIds.includes(Q.id));return B("div",{className:"space-y-6",children:[B("div",{className:"space-y-2",children:[B("div",{className:"flex items-center justify-between",children:[F("h2",{className:"font-bold text-xl",children:"Complete Each Step"}),B("span",{className:"text-muted-foreground text-sm",children:[z," / ",L," completed"]})]}),F(s,{value:W,className:"h-2"})]}),F("div",{className:"space-y-3",children:f.steps.map((Q,K)=>{let Z=h.completedStepIds.includes(Q.id),D=K===R;return F(m,{step:Q,stepNumber:K+1,isCompleted:Z,isCurrent:D,isExpanded:b===Q.id,onToggle:()=>G(b===Q.id?null:Q.id),onComplete:()=>{w?.(Q.id);let O=f.steps[K+1];if(O&&!h.completedStepIds.includes(O.id))G(O.id)}},Q.id)})}),f.completionRewards&&W<100&&F("div",{className:"rounded-lg border border-blue-500/30 bg-blue-500/5 p-4",children:B("p",{className:"text-sm",children:["\uD83C\uDF81 Complete all steps to unlock:",f.completionRewards.xp&&B("span",{className:"ml-2 font-semibold text-blue-500",children:["+",f.completionRewards.xp," XP bonus"]}),f.completionRewards.badgeKey&&B("span",{className:"ml-2 font-semibold text-amber-500",children:['+ "',f.completionRewards.badgeKey,'" badge']})]})})]})}import{cn as I}from"@contractspec/lib.ui-kit-web/ui/utils";import{jsx as _,jsxs as l}from"react/jsx-runtime";var n={templates:"\uD83D\uDCCB","spec-editor":"\u270F\uFE0F",regenerator:"\uD83D\uDD04",playground:"\uD83C\uDFAE",evolution:"\uD83E\uDD16",dashboard:"\uD83D\uDCCA",settings:"\u2699\uFE0F",default:"\uD83D\uDCCD"};function o({steps:f,completedStepIds:h,currentStepId:w}){return _("div",{className:"relative overflow-x-auto pb-4",children:_("div",{className:"flex min-w-max items-center gap-2",children:f.map((b,G)=>{let z=h.includes(b.id),L=b.id===w,W=b.metadata?.surface??"default",R=n[W]??n.default;return l("div",{className:"flex items-center",children:[l("div",{className:"flex flex-col items-center gap-2",children:[_("div",{className:I("flex h-14 w-14 items-center justify-center rounded-2xl border-2 text-2xl transition-all",z&&"border-green-500 bg-green-500/10",L&&!z&&"border-violet-500 bg-violet-500/10 ring-4 ring-violet-500/20",!z&&!L&&"border-muted bg-muted/50"),children:z?"\u2713":R}),_("div",{className:"text-center",children:_("p",{className:I("max-w-[100px] truncate font-medium text-xs",z&&"text-green-500",L&&!z&&"text-violet-500",!z&&!L&&"text-muted-foreground"),children:b.title})})]}),G<f.length-1&&_("div",{className:I("mx-2 h-1 w-8 rounded-full transition-colors",h.includes(f[G+1]?.id??"")?"bg-green-500":z?"bg-green-500/50":"bg-muted")})]},b.id)})})})}import{Card as S,CardContent as k,CardHeader as i,CardTitle as c}from"@contractspec/lib.ui-kit-web/ui/card";import{jsx as q,jsxs as U}from"react/jsx-runtime";function vf({track:f,progress:h}){let w=f.steps.find((b)=>!h.completedStepIds.includes(b.id))?.id??null;return U("div",{className:"space-y-6",children:[U("div",{className:"text-center",children:[q("h2",{className:"font-bold text-xl",children:"Your Learning Journey"}),q("p",{className:"text-muted-foreground",children:"Follow the path through each surface and feature"})]}),U(S,{children:[q(i,{children:U(c,{className:"flex items-center gap-2",children:[q("span",{children:"\uD83D\uDDFA\uFE0F"}),q("span",{children:"Journey Map"})]})}),q(k,{children:q(o,{steps:f.steps,completedStepIds:h.completedStepIds,currentStepId:w})})]}),U(S,{children:[q(i,{children:U(c,{className:"flex items-center gap-2",children:[q("span",{children:"\uD83D\uDCCD"}),q("span",{children:"Step by Step"})]})}),q(k,{children:U("div",{className:"relative",children:[q("div",{className:"absolute top-0 left-4 h-full w-0.5 bg-border"}),q("div",{className:"space-y-6",children:f.steps.map((b,G)=>{let z=h.completedStepIds.includes(b.id),L=b.id===w,W=b.metadata?.surface??"general";return U("div",{className:"relative flex gap-4 pl-2",children:[q("div",{className:`relative z-10 flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 transition-all ${z?"border-green-500 bg-green-500 text-white":L?"border-blue-500 bg-blue-500 text-white ring-4 ring-blue-500/20":"border-border bg-background text-muted-foreground"}`,children:z?"\u2713":G+1}),q("div",{className:"flex-1 pb-2",children:U("div",{className:"rounded-lg border p-4",children:[U("div",{className:"flex items-start justify-between gap-2",children:[U("div",{children:[U("div",{className:"flex items-center gap-2",children:[q("h4",{className:`font-semibold ${z?"text-green-500":L?"text-blue-500":"text-foreground"}`,children:b.title}),q("span",{className:"rounded bg-muted px-2 py-0.5 text-muted-foreground text-xs",children:W})]}),q("p",{className:"mt-1 text-muted-foreground text-sm",children:b.description})]}),b.xpReward&&U("span",{className:`shrink-0 rounded-full px-2 py-1 font-semibold text-xs ${z?"bg-green-500/10 text-green-500":"bg-muted text-muted-foreground"}`,children:["+",b.xpReward," XP"]})]}),q("div",{className:"mt-3 text-xs",children:z?q("span",{className:"text-green-500",children:"\u2713 Completed"}):L?q("span",{className:"text-blue-500",children:"\u2192 In Progress"}):q("span",{className:"text-muted-foreground",children:"\u25CB Not Started"})})]})})]},b.id)})})]})})]})]})}export{vf as Timeline,bf as Steps,e as Progress,x as Overview};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contractspec/example.learning-journey-ui-onboarding",
3
- "version": "3.7.19",
3
+ "version": "4.0.0",
4
4
  "description": "Developer onboarding UI with checklists and journey maps.",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
@@ -128,13 +128,13 @@
128
128
  },
129
129
  "dependencies": {
130
130
  "@contractspec/lib.ui-kit-core": "3.8.0",
131
- "@contractspec/lib.contracts-spec": "5.3.0",
132
- "@contractspec/example.learning-journey-ui-shared": "3.7.19",
133
- "@contractspec/example.learning-journey-studio-onboarding": "3.7.19",
134
- "@contractspec/example.learning-journey-platform-tour": "3.7.19",
135
- "@contractspec/module.learning-journey": "3.7.18",
136
- "@contractspec/lib.design-system": "3.9.0",
137
- "@contractspec/lib.ui-kit-web": "3.10.0",
131
+ "@contractspec/lib.contracts-spec": "5.4.0",
132
+ "@contractspec/example.learning-journey-ui-shared": "4.0.0",
133
+ "@contractspec/example.learning-journey-studio-onboarding": "4.0.0",
134
+ "@contractspec/example.learning-journey-platform-tour": "4.0.0",
135
+ "@contractspec/module.learning-journey": "4.0.0",
136
+ "@contractspec/lib.design-system": "3.10.0",
137
+ "@contractspec/lib.ui-kit-web": "3.10.1",
138
138
  "react": "19.2.0"
139
139
  },
140
140
  "devDependencies": {
@@ -1,10 +1,10 @@
1
1
  'use client';
2
2
 
3
3
  import { cn } from '@contractspec/lib.ui-kit-web/ui/utils';
4
- import type { LearningJourneyStepSpec } from '@contractspec/module.learning-journey/track-spec';
4
+ import type { JourneyStepSpec } from '@contractspec/module.learning-journey/track-spec';
5
5
 
6
6
  interface JourneyMapProps {
7
- steps: LearningJourneyStepSpec[];
7
+ steps: JourneyStepSpec[];
8
8
  completedStepIds: string[];
9
9
  currentStepId?: string | null;
10
10
  }
@@ -2,10 +2,10 @@
2
2
 
3
3
  import { Button } from '@contractspec/lib.design-system';
4
4
  import { cn } from '@contractspec/lib.ui-kit-core';
5
- import type { LearningJourneyStepSpec } from '@contractspec/module.learning-journey/track-spec';
5
+ import type { JourneyStepSpec } from '@contractspec/module.learning-journey/track-spec';
6
6
 
7
7
  interface StepChecklistProps {
8
- step: LearningJourneyStepSpec;
8
+ step: JourneyStepSpec;
9
9
  stepNumber: number;
10
10
  isCompleted: boolean;
11
11
  isCurrent: boolean;
@@ -33,7 +33,7 @@ export function Overview({
33
33
  const totalXp =
34
34
  track.totalXp ??
35
35
  track.steps.reduce((sum, s) => sum + (s.xpReward ?? 0), 0) +
36
- (track.completionRewards?.xpBonus ?? 0);
36
+ (track.completionRewards?.xp ?? 0);
37
37
 
38
38
  return (
39
39
  <div className="space-y-6">
@@ -22,7 +22,7 @@ export function ProgressView({ track, progress }: LearningViewProps) {
22
22
  const totalXp =
23
23
  track.totalXp ??
24
24
  track.steps.reduce((sum, s) => sum + (s.xpReward ?? 0), 0) +
25
- (track.completionRewards?.xpBonus ?? 0);
25
+ (track.completionRewards?.xp ?? 0);
26
26
 
27
27
  const remainingSteps = totalSteps - completedSteps;
28
28
  const estimatedMinutes = remainingSteps * 5;
@@ -74,9 +74,9 @@ export function Steps({ track, progress, onStepComplete }: LearningViewProps) {
74
74
  <div className="rounded-lg border border-blue-500/30 bg-blue-500/5 p-4">
75
75
  <p className="text-sm">
76
76
  🎁 Complete all steps to unlock:
77
- {track.completionRewards.xpBonus && (
77
+ {track.completionRewards.xp && (
78
78
  <span className="ml-2 font-semibold text-blue-500">
79
- +{track.completionRewards.xpBonus} XP bonus
79
+ +{track.completionRewards.xp} XP bonus
80
80
  </span>
81
81
  )}
82
82
  {track.completionRewards.badgeKey && (