@medway-ui/core 1.47.0 → 1.49.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/COMPONENTS.md +41 -13
- package/COMPONENTS_SUMMARY.md +5 -3
- package/dist/COMPONENTS.md +41 -13
- package/dist/COMPONENTS_SUMMARY.md +5 -3
- package/dist/components/Alert.d.ts +3 -3
- package/dist/components/Alert.js +1 -1
- package/dist/components/Alert.mjs +1 -1
- package/dist/components/AlertDialog.mjs +1 -1
- package/dist/components/Autocomplete.js +1 -1
- package/dist/components/Autocomplete.mjs +1 -1
- package/dist/components/CardLesson.mjs +1 -1
- package/dist/components/CardModule.mjs +1 -1
- package/dist/components/CardTopic.mjs +1 -1
- package/dist/components/CardWeek.mjs +1 -1
- package/dist/components/Collapsible.d.ts +1 -1
- package/dist/components/Collapsible.js +1 -1
- package/dist/components/Collapsible.mjs +1 -1
- package/dist/components/ConnectorNode.d.ts +104 -14
- package/dist/components/ConnectorNode.js +1 -1
- package/dist/components/ConnectorNode.mjs +1 -1
- package/dist/components/Popover.d.ts +2 -1
- package/dist/components/Popover.js +1 -1
- package/dist/components/Popover.mjs +1 -1
- package/dist/components/Ranking.mjs +1 -1
- package/dist/components/Sidebar.d.ts +27 -3
- package/dist/components/Sidebar.js +1 -1
- package/dist/components/Sidebar.mjs +1 -1
- package/dist/components/Tag.d.ts +2 -2
- package/dist/components/Tag.js +1 -1
- package/dist/components/Tag.mjs +1 -1
- package/dist/components/TagPicker.js +1 -1
- package/dist/components/TagPicker.mjs +1 -1
- package/dist/components/TrailStep.d.ts +4 -6
- package/dist/components/TrailStep.js +1 -1
- package/dist/components/TrailStep.mjs +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lib/sidebar-search.d.ts +2 -0
- package/dist/lib/sidebar-search.js +3 -0
- package/dist/lib/sidebar-search.mjs +3 -0
- package/dist/lib/utils.d.ts +5 -0
- package/dist/lib/utils.js +1 -1
- package/dist/lib/utils.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
import{jsx as l,jsxs as h}from"react/jsx-runtime";import{Check as
|
|
3
|
+
import{jsx as l,jsxs as h}from"react/jsx-runtime";import{Check as T,ChevronDown as Q}from"@medway-ui/icons";import{createContext as U,useState as x,useCallback as j,useMemo as X,useContext as v,Children as Z,isValidElement as E}from"react";import{cva as J}from"class-variance-authority";import{useId as _}from"../hooks/use-id.mjs";import{FLOATING_LABEL_WRAPPER as Y}from"../lib/floating-label.mjs";import{cn as m}from"../lib/utils.mjs";import{Command as ee,CommandInput as re,CommandList as ae,CommandEmpty as te,CommandGroup as oe,CommandItem as se}from"./Command.mjs";import{Popover as ne,PopoverContent as le,PopoverTrigger as ie}from"./Popover.mjs";import{Button as $}from"./Button.mjs";var de=Object.defineProperty,ce=Object.defineProperties,ue=Object.getOwnPropertyDescriptors,k=Object.getOwnPropertySymbols,G=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable,F=(e,r,a)=>r in e?de(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a,C=(e,r)=>{for(var a in r||(r={}))G.call(r,a)&&F(e,a,r[a]);if(k)for(var a of k(r))R.call(r,a)&&F(e,a,r[a]);return e},me=(e,r)=>ce(e,ue(r)),N=(e,r)=>{var a={};for(var t in e)G.call(e,t)&&r.indexOf(t)<0&&(a[t]=e[t]);if(e!=null&&k)for(var t of k(e))r.indexOf(t)<0&&R.call(e,t)&&(a[t]=e[t]);return a};const pe={md:20,lg:24},fe={lg:{item:"gap-2.5 px-3.5 py-2.5 text-sm leading-sm",box:"size-5",check:16},md:{item:"gap-2 px-3 py-2 text-xs leading-xs",box:"size-4",check:12}},ge=J("flex w-full items-center justify-between rounded-md border-2 border-gray-stroke-muted bg-surface-card text-left text-gray-foreground outline-none transition-[color,box-shadow] hover:border-gray-stroke hover:ring-4 hover:ring-state-hover focus-visible:border-gray-stroke-emphasis focus-visible:ring-4 focus-visible:ring-state-focus disabled:cursor-default disabled:bg-gray-background-soft-muted disabled:hover:border-gray-stroke-muted disabled:hover:ring-0 aria-[invalid=true]:border-feedback-error-stroke aria-[invalid=true]:hover:ring-state-error aria-[invalid=true]:focus-visible:border-feedback-error-stroke aria-[invalid=true]:focus-visible:ring-state-error [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{size:{lg:"h-12 max-h-12 gap-3 px-3.5 py-2.5 text-md",md:"h-10 max-h-10 gap-2.5 px-3 py-2 text-sm leading-sm"}},defaultVariants:{size:"lg"}}),b=U({invalid:!1,disabled:!1,size:"lg",open:!1,setOpen:()=>{},values:[],toggleValue:()=>{},onCancelSelection:()=>{},listId:""});function he({children:e,invalid:r=!1,disabled:a=!1,size:t="lg",values:s,onValuesChange:o,open:d,onOpenChange:i,defaultValues:n=[]}){const[p,y]=x(n),[O,w]=x(!1),c=s!==void 0,z=d!==void 0,u=c?s:p,f=z?d:O,[A,M]=x(u),[D,q]=x(f);f!==D&&(q(f),f&&M(u));const V=j(g=>{const B=u.includes(g)?u.filter(K=>K!==g):[...u,g];c||y(B),o==null||o(B)},[u,c,o]),P=j(g=>{a||(z||w(g),i==null||i(g))},[a,z,i]),L=j(()=>{c||y(A),o==null||o(A)},[c,A,o]),W=_(),H=X(()=>({invalid:r,disabled:a,size:t,open:f,setOpen:P,values:u,toggleValue:V,onCancelSelection:L,listId:W}),[r,a,t,f,P,u,V,L,W]);return l(b.Provider,{value:H,children:l(ne,{open:f,onOpenChange:P,children:e})})}function be(e){var r=e,{className:a}=r,t=N(r,["className"]);return l("div",C({className:m(Y,a),"data-slot":"autocomplete-wrapper"},t))}function ve(e){var r=e,{className:a,placeholder:t="Selecione uma op\xE7\xE3o",children:s}=r,o=N(r,["className","placeholder","children"]);const{invalid:d,disabled:i,size:n,open:p,values:y,listId:O}=v(b),w=_(),c=y.length>0;return l(ie,{asChild:!0,children:h("button",me(C({"aria-controls":O,"aria-expanded":p,"aria-invalid":d||void 0,className:m(ge({size:n}),c&&!d&&"border-gray-stroke-emphasis hover:border-gray-stroke-emphasis",a),"data-slot":"autocomplete-trigger","data-size":n,"data-placeholder":c?void 0:"",disabled:i,id:w,role:"combobox",type:"button"},o),{children:[l("span",{className:m("min-w-0 truncate",s!=null?"text-gray-foreground-emphasis":i?"text-gray-foreground-muted":"text-gray-foreground-placeholder"),children:s!=null?s:t}),l(Q,{"aria-hidden":"true",className:"shrink-0 text-gray-foreground",size:pe[n],strokeWidth:1.6})]}))})}function I({className:e,cancelLabel:r="Cancelar",confirmLabel:a="Concluir",onCancel:t,onConfirm:s}){const{setOpen:o,onCancelSelection:d,values:i}=v(b);return h("div",{className:m("flex items-center justify-between border-t border-gray-stroke-muted px-4 py-3",e),"data-slot":"autocomplete-content-footer",children:[l($,{size:"sm",variant:"regular-soft",onClick:()=>{d(),t==null||t(),o(!1)},children:r}),l($,{size:"sm",variant:"emphasis",iconLeft:l(T,{strokeWidth:2.6}),onClick:()=>{s==null||s(i),o(!1)},children:a})]})}function S(e){return typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(S).join(""):E(e)?S(e.props.children):""}function ye({children:e,className:r,searchPlaceholder:a="Buscar...",emptyMessage:t="Nenhum resultado encontrado"}){const{listId:s}=v(b),o=Z.toArray(e),d=o.filter(n=>E(n)&&n.type===I),i=o.filter(n=>!(E(n)&&n.type===I));return h(le,{id:s,align:"start",sideOffset:4,className:m("w-full min-w-[var(--radix-popper-anchor-width)] border border-gray-stroke-muted bg-surface-elevated p-0",r),children:[h(ee,{className:"bg-surface-elevated",children:[l(re,{placeholder:a}),h(ae,{children:[l(te,{children:t}),i]})]}),d]})}function xe({children:e,value:r,name:a,className:t,disabled:s=!1}){const{values:o,toggleValue:d,size:i}=v(b),n=fe[i],p=o.includes(r);return h(se,{className:m("relative flex w-full cursor-default select-none items-center rounded-md font-medium text-gray-foreground outline-none hover:cursor-pointer hover:bg-primary-background-soft-muted hover:text-gray-foreground-emphasis data-[selected=true]:bg-primary-background-soft-muted data-[selected=true]:text-gray-foreground-emphasis",n.item,t),disabled:s,"aria-checked":p,onSelect:()=>{d(r)},value:r,keywords:[a!=null?a:S(e)].filter(Boolean),children:[l("span",{"aria-hidden":"true",className:m("inline-flex shrink-0 items-center justify-center rounded-sm border-2 transition-colors",n.box,p?"border-primary-background-fill bg-primary-background-fill":"border-gray-stroke-muted bg-surface-card"),children:p&&l(T,{size:n.check,strokeWidth:2.6,className:"text-primary-foreground-onfill"})}),e]})}function ke(e){var r=e,{className:a}=r,t=N(r,["className"]);return l(oe,C({className:a},t))}function Ce(e){var r=e,{className:a}=r,t=N(r,["className"]);const{invalid:s}=v(b);return l("span",C({className:m("-mt-1 text-xs",s?"text-feedback-error-foreground":"text-gray-foreground",a),"data-slot":"autocomplete-text"},t))}export{he as Autocomplete,ye as AutocompleteContent,I as AutocompleteContentFooter,ke as AutocompleteGroup,xe as AutocompleteItem,Ce as AutocompleteText,ve as AutocompleteTrigger,be as AutocompleteWrapper};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
import{jsx as n,jsxs as x}from"react/jsx-runtime";import{cva as O}from"class-variance-authority";import{createContext as D,useMemo as I,useState as P,useContext as S}from"react";import{Badge as E}from"./Badge.mjs";import{Button as
|
|
3
|
+
import{jsx as n,jsxs as x}from"react/jsx-runtime";import{cva as O}from"class-variance-authority";import{createContext as D,useMemo as I,useState as P,useContext as S}from"react";import{Badge as E}from"./Badge.mjs";import{Button as $}from"./Button.mjs";import{FallbackImage as B}from"./FallbackImage.mjs";import{Tag as h}from"./Tag.mjs";import{cn as l}from"../lib/utils.mjs";import{Lock as V,Check as F}from"@medway-ui/icons";var T=Object.defineProperty,W=Object.defineProperties,Z=Object.getOwnPropertyDescriptors,p=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable,C=(e,a,r)=>a in e?T(e,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[a]=r,i=(e,a)=>{for(var r in a||(a={}))y.call(a,r)&&C(e,r,a[r]);if(p)for(var r of p(a))k.call(a,r)&&C(e,r,a[r]);return e},g=(e,a)=>W(e,Z(a)),c=(e,a)=>{var r={};for(var t in e)y.call(e,t)&&a.indexOf(t)<0&&(r[t]=e[t]);if(e!=null&&p)for(var t of p(e))a.indexOf(t)<0&&k.call(e,t)&&(r[t]=e[t]);return r};const w=O("flex flex-col overflow-hidden rounded-lg border border-gray-stroke-muted",{variants:{variant:{default:"bg-surface-card",blocked:"bg-gray-background-soft"},orientation:{vertical:"",horizontal:"lg:flex-row lg:flex-wrap lg:items-center lg:gap-x-6 lg:gap-y-3 lg:p-3 lg:pr-6"}},defaultVariants:{variant:"default",orientation:"vertical"}}),L=D(null);function u(){var e;return(e=S(L))!=null?e:{}}function _(e){var a=e,{className:r,variant:t,orientation:s="vertical",availableDate:o,children:d}=a,m=c(a,["className","variant","orientation","availableDate","children"]);const f=I(()=>({variant:t,orientation:s,availableDate:o}),[t,s,o]);return n(L.Provider,{value:f,children:n("div",g(i({"data-slot":"card-lesson",className:l(w({variant:t,orientation:s}),r)},m),{children:d}))})}function q(e){var a=e,{className:r,src:t,alt:s="",children:o}=a,d=c(a,["className","src","alt","children"]);const{variant:m,orientation:f}=u(),[j,z]=P(),N=f==="horizontal",b=l("h-[153px] w-full overflow-hidden rounded-md",N&&"lg:h-[120px] lg:w-[200px]",m==="blocked"&&"opacity-20");let v;return o?v=n("div",{className:l(b,"bg-gray-background-soft"),children:o}):t&&j!==t?v=n("img",{src:t,alt:s,loading:"lazy",onError:()=>z(t),className:l(b,"object-cover")}):v=n(B,{className:b,label:s,"aria-hidden":s===""||void 0}),n("div",g(i({"data-slot":"card-lesson-image",className:l("px-3 pt-3",N&&"lg:shrink-0 lg:p-0",r)},d),{children:v}))}function A(e){var a=e,{className:r}=a,t=c(a,["className"]);const{orientation:s}=u();return n("div",i({"data-slot":"card-lesson-content",className:l("flex flex-col gap-4 px-6 pt-4",s==="horizontal"&&"lg:min-w-[12rem] lg:flex-1 lg:justify-center lg:p-0",r)},t))}function G(e){var a=e,{className:r}=a,t=c(a,["className"]);return n("div",i({"data-slot":"card-lesson-header",className:l("flex flex-col",r)},t))}function H(e){var a=e,{className:r}=a,t=c(a,["className"]);const{variant:s}=u();return n("div",i({"data-slot":"card-lesson-label",className:l("text-xs font-medium leading-xs",s==="blocked"?"text-gray-foreground-muted":"text-content-paragraph",r)},t))}function J(e){var a=e,{className:r}=a,t=c(a,["className"]);const{variant:s}=u();return n("div",i({"data-slot":"card-lesson-title",className:l("line-clamp-2 text-lg font-semibold leading-lg",s==="blocked"?"text-primary-foreground-muted":"text-primary-foreground",r)},t))}function K(e){var a=e,{className:r,children:t}=a,s=c(a,["className","children"]);return n("div",g(i({"data-slot":"card-lesson-duration",className:l("flex items-center gap-1 text-sm font-medium leading-sm text-gray-foreground-muted",r)},s),{children:t}))}function M(e){var a=e,{className:r}=a,t=c(a,["className"]);const{orientation:s}=u();return n("div",i({"data-slot":"card-lesson-icons",className:l("-my-2 -me-6 flex items-center gap-2.5 overflow-x-auto py-2 pe-6 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",s==="horizontal"&&"lg:me-0 lg:pe-1",r)},t))}function Q(e){var a=e,{className:r,icon:t,badge:s}=a,o=c(a,["className","icon","badge"]);const{variant:d}=u(),m=Number(s),f=s!=null&&s!==""&&(Number.isNaN(m)||m>=2);return x("div",g(i({"data-slot":"card-lesson-icon",className:l("relative flex size-10 shrink-0 items-center justify-center rounded-pill text-gray-foreground-muted [&_svg]:size-5",d==="blocked"?"bg-gray-background-soft-muted":"bg-gray-background-soft",r)},o),{children:[t,f?n(E,{size:"sm",className:"absolute -right-1 -top-1 bg-gray-stroke text-primary-foreground",children:String(s)}):null]}))}function U(e){var a=e,{className:r,children:t}=a,s=c(a,["className","children"]);const{variant:o,availableDate:d,orientation:m}=u();return x("div",g(i({"data-slot":"card-lesson-footer",className:l("mt-auto flex flex-wrap items-center justify-between gap-4 px-6 pb-6 pt-4",m==="horizontal"&&"lg:ml-auto lg:mt-0 lg:shrink-0 lg:justify-start lg:p-0",r)},s),{children:[o==="blocked"&&d?x(h,{variant:"gray-soft",icon:n(V,{}),children:["Dispon\xEDvel em ",d]}):null,t]}))}function X(e){var a=e,{className:r,status:t}=a,s=c(a,["className","status"]);const o=t==="completed";return n(h,g(i({"data-slot":"card-lesson-status",variant:o?"success-soft":"warning-soft",icon:o?n(F,{}):void 0,className:r},s),{children:o?"Conclu\xEDdo":"Iniciado"}))}function Y(e){var a=e,{className:r,children:t,containerClassName:s}=a,o=c(a,["className","children","containerClassName"]);const{variant:d}=u();return n($,g(i({"data-slot":"card-lesson-button",variant:"regular",size:"sm",disabled:d==="blocked",containerClassName:l("ml-auto max-[500px]:w-full",s),className:l("rounded-full disabled:bg-gray-background-soft-muted disabled:text-gray-foreground-muted max-[500px]:w-full",r)},o),{children:t}))}export{_ as CardLesson,Y as CardLessonButton,A as CardLessonContent,K as CardLessonDuration,U as CardLessonFooter,G as CardLessonHeader,Q as CardLessonIcon,M as CardLessonIcons,q as CardLessonImage,H as CardLessonLabel,X as CardLessonStatus,J as CardLessonTitle,w as cardLessonVariants};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
import{jsx as o,jsxs as i}from"react/jsx-runtime";import{cva as N}from"class-variance-authority";import{createContext as O,useMemo as j,useContext as P}from"react";import{Button as D}from"./Button.mjs";import{Progress as
|
|
3
|
+
import{jsx as o,jsxs as i}from"react/jsx-runtime";import{cva as N}from"class-variance-authority";import{createContext as O,useMemo as j,useContext as P}from"react";import{Button as D}from"./Button.mjs";import{Progress as S}from"./Progress.mjs";import{Separator as E}from"./Separator.mjs";import{cn as d,clampPercentage as L}from"../lib/utils.mjs";import{ArrowRightMd as V,Lock as z}from"@medway-ui/icons";import{Tag as I}from"./Tag.mjs";var A=Object.defineProperty,B=Object.defineProperties,F=Object.getOwnPropertyDescriptors,f=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable,w=(e,a,r)=>a in e?A(e,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[a]=r,c=(e,a)=>{for(var r in a||(a={}))y.call(a,r)&&w(e,r,a[r]);if(f)for(var r of f(a))k.call(a,r)&&w(e,r,a[r]);return e},u=(e,a)=>B(e,F(a)),m=(e,a)=>{var r={};for(var t in e)y.call(e,t)&&a.indexOf(t)<0&&(r[t]=e[t]);if(e!=null&&f)for(var t of f(e))a.indexOf(t)<0&&k.call(e,t)&&(r[t]=e[t]);return r};const C=N("relative z-0 flex flex-col gap-4 overflow-hidden rounded-lg border border-gray-stroke-muted p-6",{variants:{variant:{default:"bg-surface-card",blocked:"bg-gray-background-soft"}},defaultVariants:{variant:"default"}}),v=N("text-xs font-medium leading-xs text-gray-foreground-muted"),M=O(null);function p(){var e;return(e=P(M))!=null?e:{}}function T(e){var a=e,{className:r,variant:t,availableDate:s,showStack:n=!0,children:l}=a,g=m(a,["className","variant","availableDate","showStack","children"]);const b=j(()=>({variant:t,availableDate:s}),[t,s]),x=d("pointer-events-none absolute bottom-0 z-0 max-h-[20%] rounded-lg border border-gray-stroke-muted",t==="blocked"?"bg-gray-background-soft":"bg-surface-card"),h=o("div",u(c({"data-slot":"card-module",className:d(C({variant:t}),r)},g),{children:l}));return o(M.Provider,{value:b,children:n?i("div",{"data-slot":"card-module-stack",className:"relative pt-[17px]",children:[o("div",{"aria-hidden":!0,className:d(x,"inset-x-[34px] top-0")}),o("div",{"aria-hidden":!0,className:d(x,"inset-x-4 top-2")}),h]}):h})}function $(e){var a=e,{className:r}=a,t=m(a,["className"]);return o("div",c({"data-slot":"card-module-header",className:d("flex flex-col",r)},t))}function q(e){var a=e,{className:r,children:t,count:s}=a,n=m(a,["className","children","count"]);const{variant:l}=p();return i("div",u(c({"data-slot":"card-module-label",className:d("flex items-center justify-between gap-2 text-xs font-medium leading-xs",l==="blocked"?"text-gray-foreground-muted":"text-content-paragraph",r)},n),{children:[o("span",{className:"min-w-0 truncate",children:t}),s!=null&&s!==""&&o("span",{className:"shrink-0 whitespace-nowrap text-sm leading-sm text-gray-foreground-muted",children:s})]}))}function G(e){var a=e,{className:r}=a,t=m(a,["className"]);const{variant:s}=p();return o("div",c({"data-slot":"card-module-title",className:d("line-clamp-2 min-h-14 min-w-[min(100%,12ch)] max-w-[70%] break-words text-lg font-semibold leading-lg",s==="blocked"?"text-primary-foreground-muted":"text-primary-foreground",r)},t))}function H(e){var a=e,{className:r,progress:t}=a,s=m(a,["className","progress"]);const{variant:n}=p(),l=typeof t=="number"&&Number.isFinite(t)?L(t):0,g=Math.round(l),b=n==="blocked"?o("div",{"data-slot":"card-module-status",className:v(),children:"N\xE3o iniciado"}):l>=100?o("div",{"data-slot":"card-module-status",className:v(),children:"Conclu\xEDdo"}):i("div",{"data-slot":"card-module-status",className:v(),children:[i("span",{className:"font-semibold text-gray-foreground",children:[g,"%"]})," ","de progresso"]});return i("div",u(c({"data-slot":"card-module-progress",className:d("flex flex-col gap-2",r)},s),{children:[b,n!=="blocked"&&o(S,{"aria-hidden":"true",value:l,indicatorClassName:l===100?"bg-secondary-stroke-emphasis":"bg-primary-stroke"})]}))}function J(e){var a=e,{className:r,children:t}=a,s=m(a,["className","children"]);const{variant:n,availableDate:l}=p();return n!=="blocked"||!l?null:i("div",u(c({"data-slot":"card-module-footer",className:d("flex flex-col gap-3",r)},s),{children:[o(E,{}),i("div",{className:"flex items-center justify-between",children:[i(I,{variant:"gray-soft",icon:o(z,{}),children:["Dispon\xEDvel em ",l]}),t]})]}))}function K(e){var a=e,{className:r}=a,t=m(a,["className"]);return o(D,c({"data-slot":"card-module-button",size:"sm",iconLeft:o(V,{}),className:d(r)},t))}function Q(e){var a=e,{className:r,children:t}=a,s=m(a,["className","children"]);return o("div",u(c({"data-slot":"card-module-action",className:d("flex items-center justify-end",r)},s),{children:t}))}export{T as CardModule,Q as CardModuleAction,K as CardModuleButton,J as CardModuleFooter,$ as CardModuleHeader,q as CardModuleLabel,H as CardModuleProgress,G as CardModuleTitle,v as cardModuleStatusVariants,C as cardModuleVariants};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
import{jsx as o,jsxs as f,Fragment as k}from"react/jsx-runtime";import{cva as w}from"class-variance-authority";import{createContext as T,useMemo as O,useContext as P}from"react";import{Collapsible as j,CollapsibleContent as D,CollapsibleTrigger as
|
|
3
|
+
import{jsx as o,jsxs as f,Fragment as k}from"react/jsx-runtime";import{cva as w}from"class-variance-authority";import{createContext as T,useMemo as O,useContext as P}from"react";import{Collapsible as j,CollapsibleContent as D,CollapsibleTrigger as E}from"./Collapsible.mjs";import{Progress as I}from"./Progress.mjs";import{Tag as M}from"./Tag.mjs";import{cn as i,clampPercentage as z}from"../lib/utils.mjs";import{ChevronDown as F,Lock as S}from"@medway-ui/icons";var V=Object.defineProperty,W=Object.defineProperties,$=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,b=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable,h=(a,r,e)=>r in a?V(a,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[r]=e,l=(a,r)=>{for(var e in r||(r={}))b.call(r,e)&&h(a,e,r[e]);if(v)for(var e of v(r))x.call(r,e)&&h(a,e,r[e]);return a},m=(a,r)=>W(a,$(r)),c=(a,r)=>{var e={};for(var t in a)b.call(a,t)&&r.indexOf(t)<0&&(e[t]=a[t]);if(a!=null&&v)for(var t of v(a))r.indexOf(t)<0&&x.call(a,t)&&(e[t]=a[t]);return e};const N=w("flex flex-col overflow-hidden rounded-lg border border-gray-stroke-muted",{variants:{variant:{default:"bg-surface-card",blocked:"bg-gray-background-soft"}},defaultVariants:{variant:"default"}}),y=T(null);function p(){var a;return(a=P(y))!=null?a:{}}function G(a){var r=a,{className:e,variant:t,availableDate:n,children:s}=r,d=c(r,["className","variant","availableDate","children"]);const u=O(()=>({variant:t,availableDate:n}),[t,n]);return o(y.Provider,{value:u,children:o(j,m(l({"data-slot":"card-topic",animation:"accordion",className:i(N({variant:t}),e)},d),{children:s}))})}function H(a){var r=a,{className:e,children:t}=r,n=c(r,["className","children"]);const{variant:s}=p(),d=s==="blocked";return o(E,m(l({"data-slot":"card-topic-trigger",disabled:d,className:i("group flex min-h-16 w-full select-none flex-wrap items-center gap-4 p-4 text-left","[&>*:first-child]:flex-1","disabled:pointer-events-none disabled:cursor-default",!d&&"cursor-pointer",e)},n),{children:t}))}function J(a){var r=a,{className:e}=r,t=c(r,["className"]);return o("div",l({"data-slot":"card-topic-column",className:i("flex min-w-[min(100%,10rem)] max-w-full flex-wrap items-center gap-4",e)},t))}function K(a){var r=a,{className:e,children:t}=r,n=c(r,["className","children"]);const{variant:s}=p();return o("div",m(l({"data-slot":"card-topic-number",className:i("flex size-[30px] shrink-0 items-center justify-center rounded-full text-md font-medium text-primary-foreground-onfill",s==="blocked"?"bg-primary-foreground-muted":"bg-primary-foreground",e)},n),{children:t}))}function L(a){var r=a,{className:e}=r,t=c(r,["className"]);const{variant:n}=p();return o("div",l({"data-slot":"card-topic-title",className:i("min-w-[min(100%,6rem)] flex-1 break-words text-md font-semibold leading-md",n==="blocked"?"text-primary-foreground-muted":"text-primary-foreground",e)},t))}function Q(a){var r=a,{className:e,progress:t}=r,n=c(r,["className","progress"]);const{variant:s,availableDate:d}=p();if(s==="blocked")return d?o("div",m(l({"data-slot":"card-topic-progress",className:i("flex min-w-0",e)},n),{children:f(M,{variant:"gray-soft",icon:o(S,{"aria-hidden":!0}),children:["Dispon\xEDvel em ",d]})})):null;if(t===void 0)return null;const u=z(t),C=Math.round(u),g=u>=100;return f("div",m(l({"data-slot":"card-topic-progress",className:i("flex min-w-[min(180px,100%)] flex-col gap-2",e)},n),{children:[o("div",{className:"text-xs font-medium leading-xs text-gray-foreground-muted",children:g?"Conclu\xEDdo":f(k,{children:[f("span",{className:"font-semibold text-gray-foreground",children:[C,"%"]})," de progresso"]})}),o(I,{"aria-hidden":"true",value:u,indicatorClassName:g?"bg-secondary-stroke-emphasis":"bg-primary-stroke"})]}))}function q(a){var r=a,{className:e,children:t}=r,n=c(r,["className","children"]);const{variant:s}=p();return f("div",m(l({"data-slot":"card-topic-count",className:i("flex shrink-0 items-center gap-2",e)},n),{children:[o("span",{className:"text-sm font-medium leading-sm text-gray-foreground-muted",children:t}),o(F,{"aria-hidden":!0,size:18,strokeWidth:2.4,className:i("shrink-0 text-gray-foreground",s!=="blocked"&&"transition-transform duration-200 group-data-[state=open]:rotate-180 motion-reduce:transition-none")})]}))}function A(a){var r=a,{className:e,children:t}=r,n=c(r,["className","children"]);return o(D,m(l({"data-slot":"card-topic-content"},n),{children:o("div",{className:i("px-4 pb-4",e),children:t})}))}export{G as CardTopic,J as CardTopicColumn,A as CardTopicContent,q as CardTopicCount,K as CardTopicNumber,Q as CardTopicProgress,L as CardTopicTitle,H as CardTopicTrigger,N as cardTopicVariants};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
import{jsx as o,jsxs as f}from"react/jsx-runtime";import{createContext as P,forwardRef as z,useContext as x,useRef as $,useState as R,useMemo as H}from"react";import{BreadcrumbList as I}from"./Breadcrumb.mjs";import{Progress as
|
|
3
|
+
import{jsx as o,jsxs as f}from"react/jsx-runtime";import{createContext as P,forwardRef as z,useContext as x,useRef as $,useState as R,useMemo as H}from"react";import{BreadcrumbList as I}from"./Breadcrumb.mjs";import{Progress as S}from"./Progress.mjs";import{ProgressCircle as B}from"./ProgressCircle.mjs";import{Tag as D}from"./Tag.mjs";import{TooltipProvider as A,Tooltip as E,TooltipTrigger as F,TooltipContent as L}from"./Tooltip.mjs";import{useComposedRefs as M}from"../hooks/use-composed-refs.mjs";import{cn as n}from"../lib/utils.mjs";import{Check as w,TimeRemaining as Q}from"@medway-ui/icons";var U=Object.defineProperty,X=Object.defineProperties,Y=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable,b=(a,e,r)=>e in a?U(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r,d=(a,e)=>{for(var r in e||(e={}))h.call(e,r)&&b(a,r,e[r]);if(v)for(var r of v(e))N.call(e,r)&&b(a,r,e[r]);return a},u=(a,e)=>X(a,Y(e)),c=(a,e)=>{var r={};for(var s in a)h.call(a,s)&&e.indexOf(s)<0&&(r[s]=a[s]);if(a!=null&&v)for(var s of v(a))e.indexOf(s)<0&&N.call(a,s)&&(r[s]=a[s]);return r};const p=P(null);function Z(a){var e=a,{className:r,done:s,postponed:t,skipped:i}=e,l=c(e,["className","done","postponed","skipped"]);const m=H(()=>({done:s,postponed:t,skipped:i}),[s,t,i]);return o(p.Provider,{value:m,children:o("div",d({"data-slot":"card-week",className:n("flex flex-col overflow-hidden rounded-lg border border-gray-stroke-muted text-gray-foreground-muted",r)},l))})}function _(a){var e=a,{className:r,children:s,tag:t,tagIcon:i}=e,l=c(e,["className","children","tag","tagIcon"]);return f("div",u(d({"data-slot":"card-week-breadcrumb",className:n("flex min-h-12 min-w-0 items-center gap-4 bg-primary-background-soft-muted px-6 py-3",r)},l),{children:[o("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:o(I,{className:"w-max flex-nowrap gap-1.5 whitespace-nowrap text-xs",children:s})}),t&&o(D,{variant:"regular-soft",icon:i,children:t})]}))}function q(a){var e=a,{className:r}=e,s=c(e,["className"]);return o("div",d({"data-slot":"card-week-container",className:n("flex flex-1 flex-col gap-5 bg-surface-card px-6 py-5",r)},s))}function G(a){var e=a,{className:r}=e,s=c(e,["className"]);return o("div",d({"data-slot":"card-week-header",className:n("flex items-start justify-between gap-4 [&.border-b]:pb-6 [&>*]:min-w-0",r)},s))}const J=z(function(a,e){var r=a,{className:s,children:t}=r,i=c(r,["className","children"]);const l=x(p),m=l==null?void 0:l.done,C=l==null?void 0:l.postponed,y=l==null?void 0:l.skipped,k=$(null),W=M(e,k),[O,j]=R(!1);return o(A,{children:f(E,{open:O,onOpenChange:T=>{const g=k.current;j(T&&!!g&&g.scrollHeight>g.clientHeight+1)},children:[o(F,{asChild:!0,children:o("div",u(d({ref:W,"data-slot":"card-week-title",className:n("line-clamp-2 break-words text-lg font-semibold leading-lg text-primary-foreground",(m||C||y)&&"text-primary-foreground-muted line-through",s)},i),{children:t}))}),o(L,{side:"top",className:"max-w-xs break-words",children:t})]})})});function K(a){var e=a,{className:r}=e,s=c(e,["className"]);const t=x(p),i=t==null?void 0:t.done,l=t==null?void 0:t.postponed,m=t==null?void 0:t.skipped;return o("div",d({"data-slot":"card-week-description",className:n("text-xs font-semibold leading-xs text-gray-foreground",(i||l||m)&&"text-gray-foreground-muted",r)},s))}function V(a){var e=a,{className:r}=e,s=c(e,["className"]);return o("div",d({"data-slot":"card-week-tags",className:n("flex flex-wrap items-center gap-2 [[data-slot=card-week-header]:not(:has([data-slot=card-week-progress]))+&]:mt-6",r)},s))}function ee(a){var e=a,{className:r,value:s}=e,t=c(e,["className","value"]);return o("div",{"data-slot":"card-week-progress-circle",className:n("ml-auto flex shrink-0 justify-end",r),children:o(B,d({size:104,value:s},t))})}function ae(a){var e=a,{className:r,value:s,indicatorClassName:t}=e,i=c(e,["className","value","indicatorClassName"]);const l=x(p),m=l==null?void 0:l.done;return o("div",{"data-slot":"card-week-progress",className:n("flex flex-1",r),children:o(S,u(d({},i),{value:m?100:s,indicatorClassName:n(m&&"bg-secondary-stroke-emphasis",t)}))})}function re(a){var e=a,{className:r}=e,s=c(e,["className"]);return o("div",d({"data-slot":"card-week-footer",className:n("mt-auto flex flex-col gap-2",r)},s))}function se(a){var e=a,{className:r,children:s}=e,t=c(e,["className","children"]);return o("div",u(d({"data-slot":"card-week-content",className:n("flex min-w-0 flex-col text-xs font-medium",r)},t),{children:s}))}function te(a){var e=a,{className:r,children:s,isTime:t}=e,i=c(e,["className","children","isTime"]);return f("div",u(d({"data-slot":"card-week-text",className:n("flex min-w-0 items-center gap-1.5",t?"text-secondary-foreground":"text-gray-foreground-muted",r)},i),{children:[t&&o(Q,{size:16}),o("span",{className:"min-w-0 break-words",children:s})]}))}function oe(a){var e=a,{className:r}=e,s=c(e,["className"]);const t=x(p),i=t==null?void 0:t.done,l=t==null?void 0:t.postponed,m=t==null?void 0:t.skipped;return!i&&!l&&!m?null:l||m?f("div",u(d({"data-slot":"card-week-status",className:n("ml-auto flex min-w-0 max-w-full items-center gap-1.5",r)},s),{children:[o("div",{className:"flex size-4 shrink-0 items-center justify-center rounded-full bg-feedback-warning-background-soft text-feedback-warning-foreground",children:o(w,{size:12,strokeWidth:1.67})}),o("div",{className:"min-w-0 break-words font-semibold text-feedback-warning-foreground",children:l?"Adiado":"Pulado"})]})):f("div",u(d({"data-slot":"card-week-status",className:n("ml-auto flex min-w-0 max-w-full items-center gap-1.5",r)},s),{children:[o("div",{className:"flex size-4 shrink-0 items-center justify-center rounded-full bg-secondary-background-soft text-secondary-foreground",children:o(w,{size:12,strokeWidth:1.67})}),o("div",{className:"min-w-0 break-words font-semibold text-secondary-foreground",children:"Conclu\xEDdo"})]}))}function le(a){var e=a,{className:r}=e,s=c(e,["className"]);return o("div",d({"data-slot":"card-week-actions",className:n("flex flex-wrap items-center justify-end gap-2 pt-4 max-[500px]:flex-col max-[500px]:flex-nowrap max-[500px]:items-stretch max-[500px]:[&_[data-slot=button]]:w-full",r)},s))}export{Z as CardWeek,le as CardWeekActions,_ as CardWeekBreadcrumb,q as CardWeekContainer,se as CardWeekContent,K as CardWeekDescription,re as CardWeekFooter,G as CardWeekHeader,ae as CardWeekProgress,ee as CardWeekProgressCircle,oe as CardWeekStatus,V as CardWeekTags,te as CardWeekText,J as CardWeekTitle};
|
|
@@ -7,7 +7,7 @@ interface CollapsibleContentProps extends ComponentProps<typeof CollapsiblePrimi
|
|
|
7
7
|
interface CollapsibleProps extends ComponentProps<typeof CollapsiblePrimitive.Root> {
|
|
8
8
|
animation?: AnimationType;
|
|
9
9
|
}
|
|
10
|
-
declare function Collapsible({ animation, ...props }: CollapsibleProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function Collapsible({ animation, open: openProp, defaultOpen, onOpenChange, ...props }: CollapsibleProps): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
declare const CollapsibleTrigger: import("react").ForwardRefExoticComponent<Omit<CollapsiblePrimitive.CollapsibleTriggerProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
12
12
|
declare function CollapsibleContent({ className, ...props }: CollapsibleContentProps): import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
"use strict";var
|
|
3
|
+
"use strict";var i=require("react/jsx-runtime"),t=require("react"),c=require("radix-ui"),y=require("../lib/sidebar-search.js"),w=require("../lib/utils.js"),q=Object.defineProperty,s=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,v=(a,e,n)=>e in a?q(a,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):a[e]=n,u=(a,e)=>{for(var n in e||(e={}))p.call(e,n)&&v(a,n,e[n]);if(s)for(var n of s(e))f.call(e,n)&&v(a,n,e[n]);return a},b=(a,e)=>{var n={};for(var r in a)p.call(a,r)&&e.indexOf(r)<0&&(n[r]=a[r]);if(a!=null&&s)for(var r of s(a))e.indexOf(r)<0&&f.call(a,r)&&(n[r]=a[r]);return n};const m=t.createContext({animation:void 0});function P(a){var e=a,{animation:n,open:r,defaultOpen:l=!1,onOpenChange:o}=e,C=b(e,["animation","open","defaultOpen","onOpenChange"]);const x=t.useContext(y.SidebarSearchActiveContext),[O,g]=t.useState(l),j=r!=null?r:O,h=t.useCallback(d=>{r===void 0&&g(d),o==null||o(d)},[r,o]);return i.jsx(m.Provider,{value:t.useMemo(()=>({animation:n}),[n]),children:i.jsx(c.Collapsible.Root,u({"data-slot":"collapsible",open:j||x,onOpenChange:h},C))})}const S=t.forwardRef(function(a,e){return i.jsx(c.Collapsible.Trigger,u({ref:e,"data-slot":"collapsible-trigger"},a))});function R(a){var e=a,{className:n}=e,r=b(e,["className"]);const{animation:l}=t.useContext(m),o={accordion:"overflow-hidden data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down motion-reduce:!animate-none",fade:"data-[state=closed]:animate-fade-out data-[state=open]:animate-fade-in"};return i.jsx(c.Collapsible.Content,u({"data-slot":"collapsible-content",className:w.cn(l&&o[l],n)},r))}exports.Collapsible=P,exports.CollapsibleContent=R,exports.CollapsibleTrigger=S;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
import{jsx as
|
|
3
|
+
import{jsx as l}from"react/jsx-runtime";import{createContext as w,forwardRef as j,useContext as f,useState as P,useCallback as S,useMemo as N}from"react";import{Collapsible as s}from"radix-ui";import{SidebarSearchActiveContext as R}from"../lib/sidebar-search.mjs";import{cn as T}from"../lib/utils.mjs";var k=Object.defineProperty,i=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,u=(e,a,o)=>a in e?k(e,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[a]=o,c=(e,a)=>{for(var o in a||(a={}))d.call(a,o)&&u(e,o,a[o]);if(i)for(var o of i(a))m.call(a,o)&&u(e,o,a[o]);return e},b=(e,a)=>{var o={};for(var n in e)d.call(e,n)&&a.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&i)for(var n of i(e))a.indexOf(n)<0&&m.call(e,n)&&(o[n]=e[n]);return o};const v=w({animation:void 0});function M(e){var a=e,{animation:o,open:n,defaultOpen:r=!1,onOpenChange:t}=a,O=b(a,["animation","open","defaultOpen","onOpenChange"]);const g=f(R),[C,x]=P(r),y=n!=null?n:C,h=S(p=>{n===void 0&&x(p),t==null||t(p)},[n,t]);return l(v.Provider,{value:N(()=>({animation:o}),[o]),children:l(s.Root,c({"data-slot":"collapsible",open:y||g,onOpenChange:h},O))})}const A=j(function(e,a){return l(s.Trigger,c({ref:a,"data-slot":"collapsible-trigger"},e))});function E(e){var a=e,{className:o}=a,n=b(a,["className"]);const{animation:r}=f(v),t={accordion:"overflow-hidden data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down motion-reduce:!animate-none",fade:"data-[state=closed]:animate-fade-out data-[state=open]:animate-fade-in"};return l(s.Content,c({"data-slot":"collapsible-content",className:T(r&&t[r],o)},n))}export{M as Collapsible,E as CollapsibleContent,A as CollapsibleTrigger};
|
|
@@ -1,30 +1,120 @@
|
|
|
1
1
|
import { type ComponentProps, type MouseEventHandler, type ReactNode } from "react";
|
|
2
|
-
import { type ConnectorPosition } from "./Connector.js";
|
|
2
|
+
import { type ConnectorAnchor, type ConnectorPosition } from "./Connector.js";
|
|
3
3
|
type ConnectorNodeStatus = "done" | "current" | "upcoming";
|
|
4
|
+
type ConnectorNodeCard = {
|
|
5
|
+
badge?: string;
|
|
6
|
+
title: string;
|
|
7
|
+
description: ReactNode;
|
|
8
|
+
};
|
|
4
9
|
type ConnectorNodeOwn = {
|
|
5
10
|
status?: ConnectorNodeStatus | null;
|
|
6
11
|
label: string;
|
|
7
12
|
icon?: ReactNode;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
connector?:
|
|
13
|
-
|
|
13
|
+
} & ({
|
|
14
|
+
connector: ConnectorPosition;
|
|
15
|
+
position?: never;
|
|
16
|
+
} | {
|
|
17
|
+
connector?: null;
|
|
18
|
+
position?: ConnectorAnchor;
|
|
19
|
+
});
|
|
14
20
|
type ConnectorNodeButtonProps = ConnectorNodeOwn & Omit<ComponentProps<"button">, "children" | "type"> & {
|
|
15
|
-
/**
|
|
16
|
-
* Torna a etapa um botão. Mantenha estável durante a vida da etapa:
|
|
17
|
-
* alternar entre função e `undefined` troca o elemento raiz e remonta a etapa.
|
|
18
|
-
*/
|
|
19
21
|
onClick: MouseEventHandler<HTMLButtonElement>;
|
|
22
|
+
card?: ConnectorNodeCard | null;
|
|
23
|
+
};
|
|
24
|
+
type ConnectorNodeCardProps = ConnectorNodeOwn & Omit<ComponentProps<"button">, "children" | "type"> & {
|
|
25
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
26
|
+
card: ConnectorNodeCard;
|
|
20
27
|
};
|
|
21
28
|
type ButtonOnlyKey = Exclude<keyof ComponentProps<"button">, keyof ComponentProps<"div">>;
|
|
22
29
|
type ConnectorNodeStaticProps = ConnectorNodeOwn & Omit<ComponentProps<"div">, "children" | "onClick"> & {
|
|
23
30
|
onClick?: undefined;
|
|
31
|
+
card?: null;
|
|
24
32
|
} & {
|
|
25
33
|
[K in ButtonOnlyKey]?: never;
|
|
26
34
|
};
|
|
27
|
-
type ConnectorNodeProps = ConnectorNodeButtonProps | ConnectorNodeStaticProps;
|
|
28
|
-
declare const ConnectorNode: import("react").ForwardRefExoticComponent<(Omit<
|
|
35
|
+
type ConnectorNodeProps = ConnectorNodeButtonProps | ConnectorNodeCardProps | ConnectorNodeStaticProps;
|
|
36
|
+
declare const ConnectorNode: import("react").ForwardRefExoticComponent<(Omit<{
|
|
37
|
+
status?: ConnectorNodeStatus | null;
|
|
38
|
+
label: string;
|
|
39
|
+
icon?: ReactNode;
|
|
40
|
+
} & {
|
|
41
|
+
connector: ConnectorPosition;
|
|
42
|
+
position?: never;
|
|
43
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "type" | "children"> & {
|
|
44
|
+
onClick: MouseEventHandler<HTMLButtonElement>;
|
|
45
|
+
card?: ConnectorNodeCard | null;
|
|
46
|
+
}, "ref"> | Omit<{
|
|
47
|
+
status?: ConnectorNodeStatus | null;
|
|
48
|
+
label: string;
|
|
49
|
+
icon?: ReactNode;
|
|
50
|
+
} & {
|
|
51
|
+
connector?: null;
|
|
52
|
+
position?: ConnectorAnchor;
|
|
53
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "type" | "children"> & {
|
|
54
|
+
onClick: MouseEventHandler<HTMLButtonElement>;
|
|
55
|
+
card?: ConnectorNodeCard | null;
|
|
56
|
+
}, "ref"> | Omit<{
|
|
57
|
+
status?: ConnectorNodeStatus | null;
|
|
58
|
+
label: string;
|
|
59
|
+
icon?: ReactNode;
|
|
60
|
+
} & {
|
|
61
|
+
connector: ConnectorPosition;
|
|
62
|
+
position?: never;
|
|
63
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "type" | "children"> & {
|
|
64
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
65
|
+
card: ConnectorNodeCard;
|
|
66
|
+
}, "ref"> | Omit<{
|
|
67
|
+
status?: ConnectorNodeStatus | null;
|
|
68
|
+
label: string;
|
|
69
|
+
icon?: ReactNode;
|
|
70
|
+
} & {
|
|
71
|
+
connector?: null;
|
|
72
|
+
position?: ConnectorAnchor;
|
|
73
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "type" | "children"> & {
|
|
74
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
75
|
+
card: ConnectorNodeCard;
|
|
76
|
+
}, "ref"> | Omit<{
|
|
77
|
+
status?: ConnectorNodeStatus | null;
|
|
78
|
+
label: string;
|
|
79
|
+
icon?: ReactNode;
|
|
80
|
+
} & {
|
|
81
|
+
connector: ConnectorPosition;
|
|
82
|
+
position?: never;
|
|
83
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children" | "onClick"> & {
|
|
84
|
+
onClick?: undefined;
|
|
85
|
+
card?: null;
|
|
86
|
+
} & {
|
|
87
|
+
form?: undefined;
|
|
88
|
+
name?: undefined;
|
|
89
|
+
type?: undefined;
|
|
90
|
+
disabled?: undefined;
|
|
91
|
+
formAction?: undefined;
|
|
92
|
+
formEncType?: undefined;
|
|
93
|
+
formMethod?: undefined;
|
|
94
|
+
formNoValidate?: undefined;
|
|
95
|
+
formTarget?: undefined;
|
|
96
|
+
value?: undefined;
|
|
97
|
+
}, "ref"> | Omit<{
|
|
98
|
+
status?: ConnectorNodeStatus | null;
|
|
99
|
+
label: string;
|
|
100
|
+
icon?: ReactNode;
|
|
101
|
+
} & {
|
|
102
|
+
connector?: null;
|
|
103
|
+
position?: ConnectorAnchor;
|
|
104
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children" | "onClick"> & {
|
|
105
|
+
onClick?: undefined;
|
|
106
|
+
card?: null;
|
|
107
|
+
} & {
|
|
108
|
+
form?: undefined;
|
|
109
|
+
name?: undefined;
|
|
110
|
+
type?: undefined;
|
|
111
|
+
disabled?: undefined;
|
|
112
|
+
formAction?: undefined;
|
|
113
|
+
formEncType?: undefined;
|
|
114
|
+
formMethod?: undefined;
|
|
115
|
+
formNoValidate?: undefined;
|
|
116
|
+
formTarget?: undefined;
|
|
117
|
+
value?: undefined;
|
|
118
|
+
}, "ref">) & import("react").RefAttributes<HTMLButtonElement | HTMLDivElement>>;
|
|
29
119
|
export { ConnectorNode };
|
|
30
|
-
export type { ConnectorNodeProps, ConnectorNodeStatus };
|
|
120
|
+
export type { ConnectorNodeCard, ConnectorNodeProps, ConnectorNodeStatus };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
"use strict";var
|
|
3
|
+
"use strict";var e=require("react/jsx-runtime"),i=require("class-variance-authority"),D=require("react"),F=require("./Badge.js"),v=require("./Collapsible.js"),h=require("./Connector.js"),H=require("../hooks/use-id.js"),d=require("../lib/utils.js"),L=Object.defineProperty,T=Object.defineProperties,$=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,w=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable,A=(r,t,n)=>t in r?L(r,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[t]=n,p=(r,t)=>{for(var n in t||(t={}))w.call(t,n)&&A(r,n,t[n]);if(u)for(var n of u(t))q.call(t,n)&&A(r,n,t[n]);return r},P=(r,t)=>T(r,$(t)),R=(r,t)=>{var n={};for(var o in r)w.call(r,o)&&t.indexOf(o)<0&&(n[o]=r[o]);if(r!=null&&u)for(var o of u(r))t.indexOf(o)<0&&q.call(r,o)&&(n[o]=r[o]);return n};const V={done:"Conclu\xEDdo",current:"Atual",upcoming:"Pr\xF3ximo"},K=i.cva("pointer-events-none absolute inset-0 block origin-center rounded-lg border-2 group-disabled/connector-node:border-gray-stroke-muted group-disabled/connector-node:animate-none",{variants:{status:{done:"border-solid border-secondary-stroke-emphasis",current:"border-solid border-secondary-stroke-emphasis animate-connector-node-pulse motion-reduce:animate-none",upcoming:"border-dashed border-gray-stroke-muted"}}}),M=i.cva("absolute inset-2 flex flex-col overflow-hidden rounded-[10px] px-0.5 pb-1.5 pt-0.5 transition-colors motion-reduce:transition-none group-disabled/connector-node:bg-gray-stroke-muted",{variants:{status:{done:"bg-secondary-stroke-emphasis",current:"bg-gray-stroke-muted [@media(hover:hover)]:group-hover/connector-node:bg-gray-stroke",upcoming:"bg-gray-stroke-muted [@media(hover:hover)]:group-hover/connector-node:bg-gray-stroke"}}}),Q=i.cva("flex w-full flex-1 items-center justify-center rounded-md [&_svg]:size-6 [&_svg]:shrink-0 group-disabled/connector-node:text-gray-foreground-muted group-disabled/connector-node:[background:var(--color-surface-card)]",{variants:{status:{done:"text-secondary-foreground-muted [background:linear-gradient(0deg,var(--color-secondary-background-soft-muted),var(--color-secondary-background-soft-muted)),var(--color-surface-card)]",current:"bg-surface-card text-gray-stroke-emphasis",upcoming:"bg-surface-card text-gray-stroke-emphasis"}}}),X=i.cva("w-full text-center text-sm font-semibold leading-sm group-disabled/connector-node:text-gray-foreground-muted",{variants:{status:{done:"text-gray-stroke-emphasis line-through",current:"text-primary-foreground",upcoming:"text-gray-stroke-emphasis"}}}),Y={left:"left-[calc(16.75%-6px)]",center:"left-[calc(50%-6px)]",right:"left-[calc(83.25%-6px)]"},Z=D.forwardRef(function(r,t){var n;const o=(n=r.status)!=null?n:"current",{label:y,className:_,icon:z,connector:c,position:l,card:a}=r,k=H.useId(),g=typeof r.onClick=="function"||a!=null,m=g&&o==="current"?void 0:V[o],j=e.jsxs(e.Fragment,{children:[e.jsxs("span",{"data-slot":"connector-node-shape",className:"relative block size-[72px] shrink-0",children:[e.jsx("span",{"data-slot":"connector-node-ring",className:K({status:o})}),e.jsx("span",{"data-slot":"connector-node-base",className:M({status:o}),children:e.jsx("span",{"data-slot":"connector-node-face",className:Q({status:o}),children:z})})]}),e.jsx("span",{"data-slot":"connector-node-label","aria-hidden":m?!0:void 0,className:X({status:o}),children:y}),m?e.jsx("span",{className:"sr-only",children:`${y}, ${m}`}):null]}),E=d.cn("inline-flex w-[72px] shrink-0 flex-col items-center gap-1.5 border-0 bg-transparent p-0",g&&"group/connector-node rounded-lg hover:cursor-pointer disabled:pointer-events-none focus:outline-0 focus-visible:ring-4 focus-visible:ring-state-focus",_),N={"data-slot":"connector-node","data-status":o,"aria-current":o==="current"?"step":void 0,className:E};if(g){const s=r,{status:b,label:f,className:x,icon:ne,connector:ae,position:se,card:ce,onClick:I}=s,B=R(s,["status","label","className","icon","connector","position","card","onClick"]);return O(e.jsx("button",P(p(p({ref:t},B),N),{type:"button",onClick:I,children:j})))}const C=r,{status:G,label:J,className:U,icon:W,connector:ee,position:re,card:oe,onClick:te}=C,S=R(C,["status","label","className","icon","connector","position","card","onClick"]);return O(e.jsx("div",P(p(p({ref:t},S),N),{children:j})));function O(s){if(!c&&!a)return l?e.jsx("div",{"data-slot":"connector-node-anchor",className:d.cn("w-fit",h.CONNECTOR_ANCHOR_CLASS[l]),children:s}):s;const b=c?c.split("-to-")[0]:l!=null?l:"center",f="flex w-[400px] min-w-0 max-w-full flex-col",x=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:d.cn("w-fit",h.CONNECTOR_ANCHOR_CLASS[b]),children:a?e.jsx(v.CollapsibleTrigger,{asChild:!0,children:s}):s}),a?e.jsx(v.CollapsibleContent,{role:"region","aria-labelledby":k,"data-slot":"connector-node-card",className:"w-full",children:e.jsxs("div",{className:"relative pb-2 pt-2",children:[e.jsxs("div",{className:"flex flex-col items-start gap-2 rounded-lg border border-gray-stroke-muted bg-surface-card p-5",children:[a.badge?e.jsx(F.Badge,{size:"lg",variant:o==="upcoming"?"primary-soft":"secondary-soft",className:"mb-1 uppercase",children:a.badge}):null,e.jsx("p",{id:k,className:"m-0 text-md font-bold leading-md text-primary-foreground",children:a.title}),e.jsx("div",{className:"text-sm leading-sm text-gray-foreground",children:a.description})]}),e.jsx("span",{"aria-hidden":"true","data-slot":"connector-node-card-arrow",className:d.cn("absolute top-0.5 size-3 rotate-45 border-l border-t border-gray-stroke-muted bg-surface-card",Y[b])})]})}):null,c?e.jsx(h.Connector,{position:c,done:o==="done"}):null]});return a?e.jsx(v.Collapsible,{animation:"accordion","data-slot":"connector-node-item",className:f,children:x}):e.jsx("div",{"data-slot":"connector-node-item",className:f,children:x})}});exports.ConnectorNode=Z;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
import{jsxs as
|
|
3
|
+
import{jsxs as l,Fragment as O,jsx as t}from"react/jsx-runtime";import{cva as i}from"class-variance-authority";import{forwardRef as F}from"react";import{Badge as H}from"./Badge.mjs";import{CollapsibleTrigger as L,CollapsibleContent as M,Collapsible as T}from"./Collapsible.mjs";import{CONNECTOR_ANCHOR_CLASS as j,Connector as V}from"./Connector.mjs";import{useId as K}from"../hooks/use-id.mjs";import{cn as u}from"../lib/utils.mjs";var Q=Object.defineProperty,W=Object.defineProperties,X=Object.getOwnPropertyDescriptors,m=Object.getOwnPropertySymbols,P=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable,z=(e,o,n)=>o in e?Q(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,p=(e,o)=>{for(var n in o||(o={}))P.call(o,n)&&z(e,n,o[n]);if(m)for(var n of m(o))$.call(o,n)&&z(e,n,o[n]);return e},_=(e,o)=>W(e,X(o)),A=(e,o)=>{var n={};for(var r in e)P.call(e,r)&&o.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&m)for(var r of m(e))o.indexOf(r)<0&&$.call(e,r)&&(n[r]=e[r]);return n};const Y={done:"Conclu\xEDdo",current:"Atual",upcoming:"Pr\xF3ximo"},Z=i("pointer-events-none absolute inset-0 block origin-center rounded-lg border-2 group-disabled/connector-node:border-gray-stroke-muted group-disabled/connector-node:animate-none",{variants:{status:{done:"border-solid border-secondary-stroke-emphasis",current:"border-solid border-secondary-stroke-emphasis animate-connector-node-pulse motion-reduce:animate-none",upcoming:"border-dashed border-gray-stroke-muted"}}}),q=i("absolute inset-2 flex flex-col overflow-hidden rounded-[10px] px-0.5 pb-1.5 pt-0.5 transition-colors motion-reduce:transition-none group-disabled/connector-node:bg-gray-stroke-muted",{variants:{status:{done:"bg-secondary-stroke-emphasis",current:"bg-gray-stroke-muted [@media(hover:hover)]:group-hover/connector-node:bg-gray-stroke",upcoming:"bg-gray-stroke-muted [@media(hover:hover)]:group-hover/connector-node:bg-gray-stroke"}}}),G=i("flex w-full flex-1 items-center justify-center rounded-md [&_svg]:size-6 [&_svg]:shrink-0 group-disabled/connector-node:text-gray-foreground-muted group-disabled/connector-node:[background:var(--color-surface-card)]",{variants:{status:{done:"text-secondary-foreground-muted [background:linear-gradient(0deg,var(--color-secondary-background-soft-muted),var(--color-secondary-background-soft-muted)),var(--color-surface-card)]",current:"bg-surface-card text-gray-stroke-emphasis",upcoming:"bg-surface-card text-gray-stroke-emphasis"}}}),J=i("w-full text-center text-sm font-semibold leading-sm group-disabled/connector-node:text-gray-foreground-muted",{variants:{status:{done:"text-gray-stroke-emphasis line-through",current:"text-primary-foreground",upcoming:"text-gray-stroke-emphasis"}}}),U={left:"left-[calc(16.75%-6px)]",center:"left-[calc(50%-6px)]",right:"left-[calc(83.25%-6px)]"},ee=F(function(e,o){var n;const r=(n=e.status)!=null?n:"current",{label:x,className:E,icon:I,connector:c,position:d,card:a}=e,y=K(),g=typeof e.onClick=="function"||a!=null,f=g&&r==="current"?void 0:Y[r],k=l(O,{children:[l("span",{"data-slot":"connector-node-shape",className:"relative block size-[72px] shrink-0",children:[t("span",{"data-slot":"connector-node-ring",className:Z({status:r})}),t("span",{"data-slot":"connector-node-base",className:q({status:r}),children:t("span",{"data-slot":"connector-node-face",className:G({status:r}),children:I})})]}),t("span",{"data-slot":"connector-node-label","aria-hidden":f?!0:void 0,className:J({status:r}),children:x}),f?t("span",{className:"sr-only",children:`${x}, ${f}`}):null]}),R=u("inline-flex w-[72px] shrink-0 flex-col items-center gap-1.5 border-0 bg-transparent p-0",g&&"group/connector-node rounded-lg hover:cursor-pointer disabled:pointer-events-none focus:outline-0 focus-visible:ring-4 focus-visible:ring-state-focus",E),N={"data-slot":"connector-node","data-status":r,"aria-current":r==="current"?"step":void 0,className:R};if(g){const s=e,{status:b,label:v,className:h,icon:de,connector:ie,position:ue,card:me,onClick:S}=s,B=A(s,["status","label","className","icon","connector","position","card","onClick"]);return w(t("button",_(p(p({ref:o},B),N),{type:"button",onClick:S,children:k})))}const C=e,{status:re,label:oe,className:te,icon:ne,connector:ae,position:se,card:ce,onClick:le}=C,D=A(C,["status","label","className","icon","connector","position","card","onClick"]);return w(t("div",_(p(p({ref:o},D),N),{children:k})));function w(s){if(!c&&!a)return d?t("div",{"data-slot":"connector-node-anchor",className:u("w-fit",j[d]),children:s}):s;const b=c?c.split("-to-")[0]:d!=null?d:"center",v="flex w-[400px] min-w-0 max-w-full flex-col",h=l(O,{children:[t("div",{className:u("w-fit",j[b]),children:a?t(L,{asChild:!0,children:s}):s}),a?t(M,{role:"region","aria-labelledby":y,"data-slot":"connector-node-card",className:"w-full",children:l("div",{className:"relative pb-2 pt-2",children:[l("div",{className:"flex flex-col items-start gap-2 rounded-lg border border-gray-stroke-muted bg-surface-card p-5",children:[a.badge?t(H,{size:"lg",variant:r==="upcoming"?"primary-soft":"secondary-soft",className:"mb-1 uppercase",children:a.badge}):null,t("p",{id:y,className:"m-0 text-md font-bold leading-md text-primary-foreground",children:a.title}),t("div",{className:"text-sm leading-sm text-gray-foreground",children:a.description})]}),t("span",{"aria-hidden":"true","data-slot":"connector-node-card-arrow",className:u("absolute top-0.5 size-3 rotate-45 border-l border-t border-gray-stroke-muted bg-surface-card",U[b])})]})}):null,c?t(V,{position:c,done:r==="done"}):null]});return a?t(T,{animation:"accordion","data-slot":"connector-node-item",className:v,children:h}):t("div",{"data-slot":"connector-node-item",className:v,children:h})}});export{ee as ConnectorNode};
|
|
@@ -2,8 +2,9 @@ import { Popover as PopoverPrimitive } from "radix-ui";
|
|
|
2
2
|
import { type ComponentProps } from "react";
|
|
3
3
|
declare function Popover({ ...props }: ComponentProps<typeof PopoverPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
declare const PopoverTrigger: import("react").ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverTriggerProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
5
|
-
declare function PopoverContent({ className, align, sideOffset, showArrow, ...props }: ComponentProps<typeof PopoverPrimitive.Content> & {
|
|
5
|
+
declare function PopoverContent({ className, align, sideOffset, showArrow, showDismiss, children, ...props }: ComponentProps<typeof PopoverPrimitive.Content> & {
|
|
6
6
|
showArrow?: boolean;
|
|
7
|
+
showDismiss?: boolean;
|
|
7
8
|
}): import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
declare const PopoverAnchor: import("react").ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverAnchorProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
9
10
|
export { Popover, PopoverAnchor, PopoverContent, PopoverTrigger };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
"use strict";var a=require("react/jsx-runtime"),
|
|
3
|
+
"use strict";var a=require("react/jsx-runtime"),s=require("radix-ui"),b=require("./Dismiss.js"),j=require("../lib/utils.js"),v=require("react"),P=Object.defineProperty,y=Object.defineProperties,O=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,m=(e,r,o)=>r in e?P(e,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[r]=o,d=(e,r)=>{for(var o in r||(r={}))u.call(r,o)&&m(e,o,r[o]);if(n)for(var o of n(r))h.call(r,o)&&m(e,o,r[o]);return e},$=(e,r)=>y(e,O(r)),x=(e,r)=>{var o={};for(var t in e)u.call(e,t)&&r.indexOf(t)<0&&(o[t]=e[t]);if(e!=null&&n)for(var t of n(e))r.indexOf(t)<0&&h.call(e,t)&&(o[t]=e[t]);return o};function _(e){var r=x(e,[]);return a.jsx(s.Popover.Root,d({"data-slot":"popover"},r))}const N=v.forwardRef(function(e,r){return a.jsx(s.Popover.Trigger,d({ref:r,"data-slot":"popover-trigger"},e))}),i=16,l=10,A=16,C=8;function k(e){var r=e,{className:o,align:t="center",sideOffset:c,showArrow:p=!1,showDismiss:f=!1,children:w}=r,g=x(r,["className","align","sideOffset","showArrow","showDismiss","children"]);return a.jsx(s.Popover.Portal,{children:a.jsxs(s.Popover.Content,$(d({align:t,className:j.cn("relative z-50 rounded-md border border-gray-stroke-muted bg-surface-elevated px-3.5 py-2.5 text-gray-foreground outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 motion-reduce:!animate-none",p?"[filter:drop-shadow(0_2px_8px_var(--color-drop-shadow-layer-a))_drop-shadow(0_8px_16px_var(--color-drop-shadow-layer-b))]":"shadow-level-3",f&&"pr-11",o),"data-slot":"popover-content",sideOffset:c!=null?c:p?A-l:C},g),{children:[w,p&&a.jsx(s.Popover.Arrow,{asChild:!0,width:i,height:l,children:a.jsxs("svg",{viewBox:`0 0 ${i} ${l}`,className:"overflow-visible","aria-hidden":!0,children:[a.jsx("path",{"data-slot":"popover-arrow-fill",d:`M0 0H${i}L${i/2} ${l}Z`,className:"fill-surface-elevated"}),a.jsx("path",{"data-slot":"popover-arrow-stroke",d:`M0 0L${i/2} ${l}L${i} 0`,className:"fill-none stroke-gray-stroke-muted",strokeWidth:1})]})}),f&&a.jsx(s.Popover.Close,{asChild:!0,children:a.jsx(b.Dismiss,{className:"absolute right-[7px] top-[7px]"})})]}))})}const q=v.forwardRef(function(e,r){return a.jsx(s.Popover.Anchor,d({ref:r,"data-slot":"popover-anchor"},e))});exports.Popover=_,exports.PopoverAnchor=q,exports.PopoverContent=k,exports.PopoverTrigger=N;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
import{jsx as
|
|
3
|
+
import{jsx as a,jsxs as m}from"react/jsx-runtime";import{Popover as s}from"radix-ui";import{Dismiss as y}from"./Dismiss.mjs";import{cn as O}from"../lib/utils.mjs";import{forwardRef as v}from"react";var P=Object.defineProperty,$=Object.defineProperties,j=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,g=(e,r,o)=>r in e?P(e,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[r]=o,d=(e,r)=>{for(var o in r||(r={}))u.call(r,o)&&g(e,o,r[o]);if(n)for(var o of n(r))h.call(r,o)&&g(e,o,r[o]);return e},_=(e,r)=>$(e,j(r)),w=(e,r)=>{var o={};for(var t in e)u.call(e,t)&&r.indexOf(t)<0&&(o[t]=e[t]);if(e!=null&&n)for(var t of n(e))r.indexOf(t)<0&&h.call(e,t)&&(o[t]=e[t]);return o};function N(e){var r=w(e,[]);return a(s.Root,d({"data-slot":"popover"},r))}const A=v(function(e,r){return a(s.Trigger,d({ref:r,"data-slot":"popover-trigger"},e))}),i=16,l=10,C=16,k=8;function D(e){var r=e,{className:o,align:t="center",sideOffset:f,showArrow:p=!1,showDismiss:c=!1,children:b}=r,x=w(r,["className","align","sideOffset","showArrow","showDismiss","children"]);return a(s.Portal,{children:m(s.Content,_(d({align:t,className:O("relative z-50 rounded-md border border-gray-stroke-muted bg-surface-elevated px-3.5 py-2.5 text-gray-foreground outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 motion-reduce:!animate-none",p?"[filter:drop-shadow(0_2px_8px_var(--color-drop-shadow-layer-a))_drop-shadow(0_8px_16px_var(--color-drop-shadow-layer-b))]":"shadow-level-3",c&&"pr-11",o),"data-slot":"popover-content",sideOffset:f!=null?f:p?C-l:k},x),{children:[b,p&&a(s.Arrow,{asChild:!0,width:i,height:l,children:m("svg",{viewBox:`0 0 ${i} ${l}`,className:"overflow-visible","aria-hidden":!0,children:[a("path",{"data-slot":"popover-arrow-fill",d:`M0 0H${i}L${i/2} ${l}Z`,className:"fill-surface-elevated"}),a("path",{"data-slot":"popover-arrow-stroke",d:`M0 0L${i/2} ${l}L${i} 0`,className:"fill-none stroke-gray-stroke-muted",strokeWidth:1})]})}),c&&a(s.Close,{asChild:!0,children:a(y,{className:"absolute right-[7px] top-[7px]"})})]}))})}const z=v(function(e,r){return a(s.Anchor,d({ref:r,"data-slot":"popover-anchor"},e))});export{N as Popover,z as PopoverAnchor,D as PopoverContent,A as PopoverTrigger};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
import{jsx as s,jsxs as d,Fragment as b}from"react/jsx-runtime";import{cn as i,clampPercentage as p}from"../lib/utils.mjs";import{ArrowRightMd as q,Info as L,CloseMd as Q,Check as B,Warning as W,RemoveMinus as v,CheckboxFill as G}from"@medway-ui/icons";import{Button as y}from"./Button.mjs";import{Avatar as H,AvatarImage as X,AvatarFallback as Y}from"./Avatar.mjs";import{Tag as k}from"./Tag.mjs";import{TooltipProvider as w,Tooltip as C,TooltipTrigger as R,TooltipContent as j}from"./Tooltip.mjs";var Z=Object.defineProperty,J=Object.defineProperties,K=Object.getOwnPropertyDescriptors,h=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable,O=(r,e,a)=>e in r?Z(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,l=(r,e)=>{for(var a in e||(e={}))z.call(e,a)&&O(r,a,e[a]);if(h)for(var a of h(e))$.call(e,a)&&O(r,a,e[a]);return r},o=(r,e)=>J(r,K(e)),c=(r,e)=>{var a={};for(var n in r)z.call(r,n)&&e.indexOf(n)<0&&(a[n]=r[n]);if(r!=null&&h)for(var n of h(r))e.indexOf(n)<0&&$.call(r,n)&&(a[n]=r[n]);return a};function U(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("div",{className:"w-full overflow-x-auto rounded-lg border border-gray-stroke-muted",children:s("table",o(l({className:i("w-full border-collapse text-left",n)},t),{children:a}))})}function V(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("thead",o(l({className:i("h-11 border-b border-gray-stroke-muted bg-surface-card",n)},t),{children:s("tr",{children:a})}))}function _(r){var e=r,{children:a,className:n,tooltip:t,highlight:m}=e,u=c(e,["children","className","tooltip","highlight"]);return s("th",o(l({className:i("text-ellipsis whitespace-nowrap px-5 text-sm font-semibold text-gray-foreground first:pr-0",n)},u),{children:d("div",{className:"flex items-center gap-1.5",children:[s("span",{className:i(m&&"flex size-7 shrink-0 items-center justify-center rounded-full bg-primary-foreground-onfill"),children:a}),t&&s(w,{children:d(C,{children:[s(R,{asChild:!0,children:s(y,{type:"button",variant:"regular-basic",size:"sm","aria-label":t,className:"!h-6 !min-h-6 !w-6 !min-w-6 !p-0 text-gray-foreground",iconLeft:s(L,{"aria-hidden":"true",className:"size-4"})})}),s(j,{children:t})]})})]})}))}function ee(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("tbody",o(l({className:i("bg-surface-card",n)},t),{children:a}))}function re(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("tr",o(l({className:i("w-full border-t border-solid border-gray-stroke-muted first:border-t-0",n)},t),{children:a}))}function ae(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("td",{className:"py-4 pl-5 align-middle",children:s("div",o(l({className:i("flex size-7 shrink-0 items-center justify-center overflow-hidden whitespace-nowrap rounded-full bg-primary-foreground text-sm font-semibold text-primary-foreground-onfill",n)},t),{children:a}))})}function ne(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("td",o(l({className:"px-5 py-4 align-middle"},t),{children:s("div",{className:i("flex items-center gap-5",n),children:s("div",{className:"flex shrink-0 items-center gap-5 pr-8",children:a})})}))}function se(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("div",o(l({className:i("flex shrink-0 flex-col items-start whitespace-nowrap text-gray-foreground",n)},t),{children:a}))}function te(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("span",o(l({className:i("shrink-0 overflow-hidden text-ellipsis font-sans text-xxs font-medium leading-xxs",n)},t),{children:a}))}function ie(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("span",o(l({className:i("shrink-0 overflow-hidden text-ellipsis font-sans text-sm font-semibold leading-sm",n)},t),{children:a}))}function le(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s(k,o(l({className:i("bg-gradient-to-r from-cm-24 to-secondary-24 text-primary-foreground",n)},t),{icon:s(G,{className:"text-primary-foreground"}),children:a}))}function oe(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("td",o(l({className:"px-5 py-4 align-middle"},t),{children:s("div",{className:i("flex flex-col items-start gap-2",n),children:a})}))}function ce(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("span",o(l({className:i("relative block shrink-0 overflow-hidden text-ellipsis whitespace-nowrap text-xxs font-medium leading-xxs text-gray-foreground",n)},t),{children:a}))}function de(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("div",o(l({className:i("avatar-group flex shrink-0 items-center gap-2",n)},t),{children:a}))}function me(r){var e=r,{src:a,alt:n,fallback:t="?",className:m,tooltip:u}=e,f=c(e,["src","alt","fallback","className","tooltip"]);const g=d(H,o(l({size:"sm",tabIndex:u?0:void 0,className:i("ring-2 ring-background",u&&"outline-none focus-visible:ring-4 focus-visible:ring-state-focus",m)},f),{children:[s(X,{src:a,alt:n!=null?n:typeof u=="string"?u:""}),s(Y,{children:t})]}));return u?s(w,{children:d(C,{children:[s(R,{asChild:!0,children:g}),s(j,{children:u})]})}):g}function ue(r){var e=r,{children:a,className:n,icon:t}=e,m=c(e,["children","className","icon"]);return s("td",o(l({className:"px-5 py-4 align-middle"},m),{children:s(k,{variant:"regular-soft",className:n,icon:t,children:a})}))}function fe({className:r,percentage:e,label:a}){return s("div",{role:"progressbar","aria-label":a,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(p(e)),className:i("relative h-0.5 w-full overflow-hidden rounded-pill bg-gray-stroke-muted",r),children:s("div",{className:i("absolute inset-y-0 left-0 rounded-pill bg-primary-stroke transition-[width] duration-300 motion-reduce:transition-none"),style:{width:`${p(e)}%`}})})}function ge(r){var e=r,{questions:a,answered:n,className:t}=e,m=c(e,["questions","answered","className"]);const u=n>0&&a>0?p(n/a*100):0;return n===0?s("td",o(l({className:"px-5 py-4 align-middle"},m),{children:s("div",{className:i("flex min-w-[140px] flex-col items-start justify-center gap-2",t),children:d("div",{className:"flex shrink-0 items-center justify-center gap-2 text-xs font-medium text-gray-foreground-muted",children:[s("div",{className:"flex size-4 items-center justify-center rounded-full bg-gray-background-soft",children:s(v,{className:"size-3 text-gray-foreground",strokeWidth:2.6})}),s("span",{className:"whitespace-nowrap font-medium text-gray-foreground-muted",children:"N\xE3o iniciado"})]})})})):s("td",o(l({className:"px-5 py-4 align-middle"},m),{children:d("div",{className:i("flex min-w-[140px] flex-col items-start justify-center gap-2",t),children:[s("div",{className:"flex shrink-0 items-center gap-0.5 text-xs leading-xs",children:d("span",{className:"relative shrink-0 whitespace-nowrap font-medium text-gray-foreground-muted",children:[s("span",{className:"font-semibold text-gray-foreground",children:n})," ",n>1?"respondidas":"respondida"]})}),s(fe,{percentage:u,label:`${n} ${n>1?"respondidas":"respondida"}`})]})}))}const he={notStarted:{icon:v,bgColor:"bg-gray-background-soft",iconColor:"text-gray-foreground",titleClassName:"font-medium text-gray-foreground-muted",title:()=>"N\xE3o iniciado",subtitle:()=>""},minNotReached:{icon:W,bgColor:"bg-feedback-warning-background-soft",iconColor:"text-feedback-warning-foreground",titleClassName:"font-medium text-gray-foreground-muted",title:()=>"M\xEDnimo n\xE3o atingido",subtitle:({remainingQuestions:r})=>r>1?`Faltam ${r} quest\xF5es`:`Falta ${r} quest\xE3o`},dominated:{icon:B,statusLabel:"Dominado",bgColor:"bg-feedback-success-background-soft",iconColor:"text-feedback-success-foreground",titleClassName:"font-medium text-gray-foreground-muted",title:({progress:r})=>d(b,{children:[d("span",{className:"font-semibold text-gray-foreground",children:[Math.round(r),"%"]})," ","de ",r>1?"acertos":"acerto"]}),subtitle:({correct:r,answered:e})=>`${r} de ${e} acertos`},notDominated:{icon:Q,statusLabel:"N\xE3o dominado",bgColor:"bg-feedback-error-background-soft",iconColor:"text-feedback-error-foreground",titleClassName:"font-medium text-gray-foreground-muted",title:({progress:r})=>d(b,{children:[d("span",{className:"font-semibold text-gray-foreground",children:[Math.round(r),"%"]})," ","de ",r>1?"acertos":"acerto"]}),subtitle:({correct:r,answered:e})=>`${r} de ${e} acertos`}};function pe(r,e,a){return[[r,"notStarted"],[e,"minNotReached"],[a>=80,"dominated"],[!0,"notDominated"]].find(([n])=>n)[1]}function xe(r){var e=r,{answered:a,correct:n,minQuestions:t,className:m}=e,u=c(e,["answered","correct","minQuestions","className"]);const f=a>0?n/a*100:0,g=a===0,T=a<t,P=t-a,A=pe(g,T,f),{icon:E,bgColor:F,iconColor:M,titleClassName:I,statusLabel:x,title:D,subtitle:S}=he[A],N={progress:f,correct:n,answered:a,remainingQuestions:P};return s("td",o(l({className:"px-5 py-4 align-middle"},u),{children:s("div",{className:i("flex min-w-[140px] flex-col items-start justify-center gap-2",m),children:d("div",{className:"flex shrink-0 items-center justify-center gap-2 text-xs font-medium text-gray-foreground-muted",children:[s("div",{className:i("flex size-4 items-center justify-center rounded-full",F),children:s(E,{"aria-hidden":"true",className:i("size-3",M),strokeWidth:2.6})}),d("div",{className:"flex flex-col items-start justify-center",children:[x&&d("span",{className:"sr-only",children:[x,": "]}),s("span",{className:i("whitespace-nowrap",I),children:D(N)}),s("span",{className:"whitespace-nowrap text-xxs font-semibold text-gray-foreground-muted",children:S(N)})]})]})})}))}function Ne(r){var e=r,{children:a,className:n,onClick:t}=e,m=c(e,["children","className","onClick"]);return s("td",{className:"px-5 py-4 align-middle",children:s(y,o(l({variant:"regular-soft",size:"sm",iconRight:s(q,{className:"size-4"}),onClick:t,className:n},m),{children:a}))})}export{U as Ranking,de as RankingAssigneeGroup,me as RankingAssigneeItem,ce as RankingAssigneeLabel,oe as RankingAssigneesColumn,ee as RankingBody,Ne as RankingButton,V as RankingHeader,_ as RankingHeaderCell,re as RankingItem,ae as RankingNumber,xe as RankingPerformance,ue as RankingPriority,ge as RankingQuestions,te as RankingSpecialty,le as RankingSuperFocus,ie as RankingTopic,ne as RankingTopicColumn,se as RankingTopicContent};
|
|
3
|
+
import{jsx as s,jsxs as d,Fragment as b}from"react/jsx-runtime";import{cn as i,clampPercentage as p}from"../lib/utils.mjs";import{ArrowRightMd as q,Info as L,CloseMd as Q,Check as B,Warning as W,RemoveMinus as v,CheckboxFill as G}from"@medway-ui/icons";import{Button as y}from"./Button.mjs";import{Avatar as H,AvatarImage as X,AvatarFallback as Y}from"./Avatar.mjs";import{Tag as k}from"./Tag.mjs";import{TooltipProvider as w,Tooltip as C,TooltipTrigger as R,TooltipContent as j}from"./Tooltip.mjs";var Z=Object.defineProperty,J=Object.defineProperties,K=Object.getOwnPropertyDescriptors,h=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,$=(r,e,a)=>e in r?Z(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,l=(r,e)=>{for(var a in e||(e={}))z.call(e,a)&&$(r,a,e[a]);if(h)for(var a of h(e))O.call(e,a)&&$(r,a,e[a]);return r},o=(r,e)=>J(r,K(e)),c=(r,e)=>{var a={};for(var n in r)z.call(r,n)&&e.indexOf(n)<0&&(a[n]=r[n]);if(r!=null&&h)for(var n of h(r))e.indexOf(n)<0&&O.call(r,n)&&(a[n]=r[n]);return a};function U(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("div",{className:"w-full overflow-x-auto rounded-lg border border-gray-stroke-muted",children:s("table",o(l({className:i("w-full border-collapse text-left",n)},t),{children:a}))})}function V(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("thead",o(l({className:i("h-11 border-b border-gray-stroke-muted bg-surface-card",n)},t),{children:s("tr",{children:a})}))}function _(r){var e=r,{children:a,className:n,tooltip:t,highlight:m}=e,u=c(e,["children","className","tooltip","highlight"]);return s("th",o(l({className:i("text-ellipsis whitespace-nowrap px-5 text-sm font-semibold text-gray-foreground first:pr-0",n)},u),{children:d("div",{className:"flex items-center gap-1.5",children:[s("span",{className:i(m&&"flex size-7 shrink-0 items-center justify-center rounded-full bg-primary-foreground-onfill"),children:a}),t&&s(w,{children:d(C,{children:[s(R,{asChild:!0,children:s(y,{type:"button",variant:"regular-basic",size:"sm","aria-label":t,className:"!h-6 !min-h-6 !w-6 !min-w-6 !p-0 text-gray-foreground",iconLeft:s(L,{"aria-hidden":"true",className:"size-4"})})}),s(j,{children:t})]})})]})}))}function ee(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("tbody",o(l({className:i("bg-surface-card",n)},t),{children:a}))}function re(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("tr",o(l({className:i("w-full border-t border-solid border-gray-stroke-muted first:border-t-0",n)},t),{children:a}))}function ae(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("td",{className:"py-4 pl-5 align-middle",children:s("div",o(l({className:i("flex size-7 shrink-0 items-center justify-center overflow-hidden whitespace-nowrap rounded-full bg-primary-foreground text-sm font-semibold text-primary-foreground-onfill",n)},t),{children:a}))})}function ne(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("td",o(l({className:"px-5 py-4 align-middle"},t),{children:s("div",{className:i("flex items-center gap-5",n),children:s("div",{className:"flex shrink-0 items-center gap-5 pr-8",children:a})})}))}function se(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("div",o(l({className:i("flex shrink-0 flex-col items-start whitespace-nowrap text-gray-foreground",n)},t),{children:a}))}function te(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("span",o(l({className:i("shrink-0 overflow-hidden text-ellipsis font-sans text-xxs font-medium leading-xxs",n)},t),{children:a}))}function ie(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("span",o(l({className:i("shrink-0 overflow-hidden text-ellipsis font-sans text-sm font-semibold leading-sm",n)},t),{children:a}))}function le(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s(k,o(l({className:i("bg-gradient-to-r from-cm-24 to-secondary-24 text-primary-foreground",n)},t),{icon:s(G,{className:"text-primary-foreground"}),children:a}))}function oe(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("td",o(l({className:"px-5 py-4 align-middle"},t),{children:s("div",{className:i("flex flex-col items-start gap-2",n),children:a})}))}function ce(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("span",o(l({className:i("relative block shrink-0 overflow-hidden text-ellipsis whitespace-nowrap text-xxs font-medium leading-xxs text-gray-foreground",n)},t),{children:a}))}function de(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("div",o(l({className:i("avatar-group flex shrink-0 items-center gap-2",n)},t),{children:a}))}function me(r){var e=r,{src:a,alt:n,fallback:t="?",className:m,tooltip:u}=e,f=c(e,["src","alt","fallback","className","tooltip"]);const g=d(H,o(l({size:"sm",tabIndex:u?0:void 0,className:i("ring-2 ring-background",u&&"outline-none focus-visible:ring-4 focus-visible:ring-state-focus",m)},f),{children:[s(X,{src:a,alt:n!=null?n:typeof u=="string"?u:""}),s(Y,{children:t})]}));return u?s(w,{children:d(C,{children:[s(R,{asChild:!0,children:g}),s(j,{children:u})]})}):g}function ue(r){var e=r,{children:a,className:n,icon:t}=e,m=c(e,["children","className","icon"]);return s("td",o(l({className:"px-5 py-4 align-middle"},m),{children:s(k,{variant:"regular-soft",className:n,icon:t,children:a})}))}function fe({className:r,percentage:e,label:a}){return s("div",{role:"progressbar","aria-label":a,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(p(e)),className:i("relative h-0.5 w-full overflow-hidden rounded-pill bg-gray-stroke-muted",r),children:s("div",{className:i("absolute inset-y-0 left-0 rounded-pill bg-primary-stroke transition-[width] duration-300 motion-reduce:transition-none"),style:{width:`${p(e)}%`}})})}function ge(r){var e=r,{questions:a,answered:n,className:t}=e,m=c(e,["questions","answered","className"]);const u=n>0&&a>0?p(n/a*100):0;return n===0?s("td",o(l({className:"px-5 py-4 align-middle"},m),{children:s("div",{className:i("flex min-w-[140px] flex-col items-start justify-center gap-2",t),children:d("div",{className:"flex shrink-0 items-center justify-center gap-2 text-xs font-medium text-gray-foreground-muted",children:[s("div",{className:"flex size-4 items-center justify-center rounded-full bg-gray-background-soft",children:s(v,{className:"size-3 text-gray-foreground",strokeWidth:2.6})}),s("span",{className:"whitespace-nowrap font-medium text-gray-foreground-muted",children:"N\xE3o iniciado"})]})})})):s("td",o(l({className:"px-5 py-4 align-middle"},m),{children:d("div",{className:i("flex min-w-[140px] flex-col items-start justify-center gap-2",t),children:[s("div",{className:"flex shrink-0 items-center gap-0.5 text-xs leading-xs",children:d("span",{className:"relative shrink-0 whitespace-nowrap font-medium text-gray-foreground-muted",children:[s("span",{className:"font-semibold text-gray-foreground",children:n})," ",n>1?"respondidas":"respondida"]})}),s(fe,{percentage:u,label:`${n} ${n>1?"respondidas":"respondida"}`})]})}))}const he={notStarted:{icon:v,bgColor:"bg-gray-background-soft",iconColor:"text-gray-foreground",titleClassName:"font-medium text-gray-foreground-muted",title:()=>"N\xE3o iniciado",subtitle:()=>""},minNotReached:{icon:W,bgColor:"bg-feedback-warning-background-soft",iconColor:"text-feedback-warning-foreground",titleClassName:"font-medium text-gray-foreground-muted",title:()=>"M\xEDnimo n\xE3o atingido",subtitle:({remainingQuestions:r})=>r>1?`Faltam ${r} quest\xF5es`:`Falta ${r} quest\xE3o`},dominated:{icon:B,statusLabel:"Dominado",bgColor:"bg-feedback-success-background-soft",iconColor:"text-feedback-success-foreground",titleClassName:"font-medium text-gray-foreground-muted",title:({progress:r})=>d(b,{children:[d("span",{className:"font-semibold text-gray-foreground",children:[Math.round(r),"%"]})," ","de ",r>1?"acertos":"acerto"]}),subtitle:({correct:r,answered:e})=>`${r} de ${e} acertos`},notDominated:{icon:Q,statusLabel:"N\xE3o dominado",bgColor:"bg-feedback-error-background-soft",iconColor:"text-feedback-error-foreground",titleClassName:"font-medium text-gray-foreground-muted",title:({progress:r})=>d(b,{children:[d("span",{className:"font-semibold text-gray-foreground",children:[Math.round(r),"%"]})," ","de ",r>1?"acertos":"acerto"]}),subtitle:({correct:r,answered:e})=>`${r} de ${e} acertos`}};function pe(r,e,a){return[[r,"notStarted"],[e,"minNotReached"],[a>=80,"dominated"],[!0,"notDominated"]].find(([n])=>n)[1]}function xe(r){var e=r,{answered:a,correct:n,minQuestions:t,className:m}=e,u=c(e,["answered","correct","minQuestions","className"]);const f=a>0?n/a*100:0,g=a===0,T=a<t,P=t-a,A=pe(g,T,f),{icon:E,bgColor:F,iconColor:M,titleClassName:I,statusLabel:x,title:S,subtitle:D}=he[A],N={progress:f,correct:n,answered:a,remainingQuestions:P};return s("td",o(l({className:"px-5 py-4 align-middle"},u),{children:s("div",{className:i("flex min-w-[140px] flex-col items-start justify-center gap-2",m),children:d("div",{className:"flex shrink-0 items-center justify-center gap-2 text-xs font-medium text-gray-foreground-muted",children:[s("div",{className:i("flex size-4 items-center justify-center rounded-full",F),children:s(E,{"aria-hidden":"true",className:i("size-3",M),strokeWidth:2.6})}),d("div",{className:"flex flex-col items-start justify-center",children:[x&&d("span",{className:"sr-only",children:[x,": "]}),s("span",{className:i("whitespace-nowrap",I),children:S(N)}),s("span",{className:"whitespace-nowrap text-xxs font-semibold text-gray-foreground-muted",children:D(N)})]})]})})}))}function Ne(r){var e=r,{children:a,className:n,onClick:t}=e,m=c(e,["children","className","onClick"]);return s("td",{className:"px-5 py-4 align-middle",children:s(y,o(l({variant:"regular-soft",size:"sm",iconRight:s(q,{className:"size-4"}),onClick:t,className:n},m),{children:a}))})}export{U as Ranking,de as RankingAssigneeGroup,me as RankingAssigneeItem,ce as RankingAssigneeLabel,oe as RankingAssigneesColumn,ee as RankingBody,Ne as RankingButton,V as RankingHeader,_ as RankingHeaderCell,re as RankingItem,ae as RankingNumber,xe as RankingPerformance,ue as RankingPriority,ge as RankingQuestions,te as RankingSpecialty,le as RankingSuperFocus,ie as RankingTopic,ne as RankingTopicColumn,se as RankingTopicContent};
|