@medway-ui/core 1.48.0 → 1.50.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.
Files changed (40) hide show
  1. package/COMPONENTS.md +68 -3
  2. package/COMPONENTS_SUMMARY.md +5 -2
  3. package/dist/COMPONENTS.md +68 -3
  4. package/dist/COMPONENTS_SUMMARY.md +5 -2
  5. package/dist/components/AlertDialog.mjs +1 -1
  6. package/dist/components/Autocomplete.js +1 -1
  7. package/dist/components/Autocomplete.mjs +1 -1
  8. package/dist/components/CardLearn.d.ts +49 -0
  9. package/dist/components/CardLearn.js +3 -0
  10. package/dist/components/CardLearn.mjs +3 -0
  11. package/dist/components/CardLesson.mjs +1 -1
  12. package/dist/components/CardModule.mjs +1 -1
  13. package/dist/components/CardTopic.mjs +1 -1
  14. package/dist/components/CardWeek.mjs +1 -1
  15. package/dist/components/Collapsible.d.ts +1 -1
  16. package/dist/components/Collapsible.js +1 -1
  17. package/dist/components/Collapsible.mjs +1 -1
  18. package/dist/components/ConnectorNode.mjs +1 -1
  19. package/dist/components/Popover.d.ts +2 -1
  20. package/dist/components/Popover.js +1 -1
  21. package/dist/components/Popover.mjs +1 -1
  22. package/dist/components/Ranking.mjs +1 -1
  23. package/dist/components/Sidebar.d.ts +27 -3
  24. package/dist/components/Sidebar.js +1 -1
  25. package/dist/components/Sidebar.mjs +1 -1
  26. package/dist/components/Tag.d.ts +2 -2
  27. package/dist/components/Tag.js +1 -1
  28. package/dist/components/Tag.mjs +1 -1
  29. package/dist/components/TagPicker.js +1 -1
  30. package/dist/components/TagPicker.mjs +1 -1
  31. package/dist/index.d.ts +4 -1
  32. package/dist/index.js +1 -1
  33. package/dist/index.mjs +1 -1
  34. package/dist/lib/sidebar-search.d.ts +2 -0
  35. package/dist/lib/sidebar-search.js +3 -0
  36. package/dist/lib/sidebar-search.mjs +3 -0
  37. package/dist/lib/utils.d.ts +5 -0
  38. package/dist/lib/utils.js +1 -1
  39. package/dist/lib/utils.mjs +1 -1
  40. package/package.json +3 -3
@@ -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 E}from"./Progress.mjs";import{Separator as S}from"./Separator.mjs";import{cn as d,clampPercentage as z}from"../lib/utils.mjs";import{ArrowRightMd as L,Lock as V}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)?z(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(E,{"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(S,{}),i("div",{className:"flex items-center justify-between",children:[i(I,{variant:"gray-soft",icon:o(V,{}),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(L,{}),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};
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 z}from"./Collapsible.mjs";import{Progress as E}from"./Progress.mjs";import{Tag as I}from"./Tag.mjs";import{cn as i,clampPercentage as $}from"../lib/utils.mjs";import{ChevronDown as F,Lock as M}from"@medway-ui/icons";var V=Object.defineProperty,G=Object.defineProperties,H=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)=>G(a,H(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 J(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 K(a){var r=a,{className:e,children:t}=r,n=c(r,["className","children"]);const{variant:s}=p(),d=s==="blocked";return o(z,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 L(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 Q(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 R(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 S(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(I,{variant:"gray-soft",icon:o(M,{"aria-hidden":!0}),children:["Dispon\xEDvel em ",d]})})):null;if(t===void 0)return null;const u=$(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(E,{"aria-hidden":"true",value:u,indicatorClassName:g?"bg-secondary-stroke-emphasis":"bg-primary-stroke"})]}))}function W(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 q(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{J as CardTopic,L as CardTopicColumn,q as CardTopicContent,W as CardTopicCount,Q as CardTopicNumber,S as CardTopicProgress,R as CardTopicTitle,K as CardTopicTrigger,N as cardTopicVariants};
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 B}from"./Progress.mjs";import{ProgressCircle as D}from"./ProgressCircle.mjs";import{Tag as S}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(S,{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(D,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(B,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};
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 l=require("react/jsx-runtime"),n=require("react"),o=require("radix-ui"),m=require("../lib/utils.js"),x=Object.defineProperty,i=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,p=(e,a,r)=>a in e?x(e,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[a]=r,s=(e,a)=>{for(var r in a||(a={}))u.call(a,r)&&p(e,r,a[r]);if(i)for(var r of i(a))d.call(a,r)&&p(e,r,a[r]);return e},f=(e,a)=>{var r={};for(var t in e)u.call(e,t)&&a.indexOf(t)<0&&(r[t]=e[t]);if(e!=null&&i)for(var t of i(e))a.indexOf(t)<0&&d.call(e,t)&&(r[t]=e[t]);return r};const v=n.createContext({animation:void 0});function C(e){var a=e,{animation:r}=a,t=f(a,["animation"]);return l.jsx(v.Provider,{value:n.useMemo(()=>({animation:r}),[r]),children:l.jsx(o.Collapsible.Root,s({"data-slot":"collapsible"},t))})}const j=n.forwardRef(function(e,a){return l.jsx(o.Collapsible.Trigger,s({ref:a,"data-slot":"collapsible-trigger"},e))});function g(e){var a=e,{className:r}=a,t=f(a,["className"]);const{animation:c}=n.useContext(v),b={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.jsx(o.Collapsible.Content,s({"data-slot":"collapsible-content",className:m.cn(c&&b[c],r)},t))}exports.Collapsible=C,exports.CollapsibleContent=g,exports.CollapsibleTrigger=j;
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 o}from"react/jsx-runtime";import{createContext as b,forwardRef as v,useContext as C,useMemo as g}from"react";import{Collapsible as l}from"radix-ui";import{cn as O}from"../lib/utils.mjs";var x=Object.defineProperty,n=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,m=(e,a,t)=>a in e?x(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,i=(e,a)=>{for(var t in a||(a={}))c.call(a,t)&&m(e,t,a[t]);if(n)for(var t of n(a))f.call(a,t)&&m(e,t,a[t]);return e},p=(e,a)=>{var t={};for(var r in e)c.call(e,r)&&a.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&n)for(var r of n(e))a.indexOf(r)<0&&f.call(e,r)&&(t[r]=e[r]);return t};const d=b({animation:void 0});function y(e){var a=e,{animation:t}=a,r=p(a,["animation"]);return o(d.Provider,{value:g(()=>({animation:t}),[t]),children:o(l.Root,i({"data-slot":"collapsible"},r))})}const w=v(function(e,a){return o(l.Trigger,i({ref:a,"data-slot":"collapsible-trigger"},e))});function j(e){var a=e,{className:t}=a,r=p(a,["className"]);const{animation:s}=C(d),u={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 o(l.Content,i({"data-slot":"collapsible-content",className:O(s&&u[s],t)},r))}export{y as Collapsible,j as CollapsibleContent,w as CollapsibleTrigger};
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,3 +1,3 @@
1
1
  "use strict";
2
2
  "use client";
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 T,Collapsible as V}from"./Collapsible.mjs";import{CONNECTOR_ANCHOR_CLASS as j,Connector as K}from"./Connector.mjs";import{useId as M}from"../hooks/use-id.mjs";import{cn as u}from"../lib/utils.mjs";var Q=Object.defineProperty,X=Object.defineProperties,Y=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},R=(e,o)=>X(e,Y(o)),_=(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 Z={done:"Conclu\xEDdo",current:"Atual",upcoming:"Pr\xF3ximo"},q=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"}}}),G=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"}}}),J=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"}}}),U=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"}}}),W={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:A,icon:E,connector:c,position:d,card:a}=e,y=M(),g=typeof e.onClick=="function"||a!=null,f=g&&r==="current"?void 0:Z[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:q({status:r})}),t("span",{"data-slot":"connector-node-base",className:G({status:r}),children:t("span",{"data-slot":"connector-node-face",className:J({status:r}),children:E})})]}),t("span",{"data-slot":"connector-node-label","aria-hidden":f?!0:void 0,className:U({status:r}),children:x}),f?t("span",{className:"sr-only",children:`${x}, ${f}`}):null]}),I=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",A),N={"data-slot":"connector-node","data-status":r,"aria-current":r==="current"?"step":void 0,className:I};if(g){const s=e,{status:b,label:v,className:h,icon:de,connector:ie,position:ue,card:me,onClick:S}=s,B=_(s,["status","label","className","icon","connector","position","card","onClick"]);return w(t("button",R(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=_(C,["status","label","className","icon","connector","position","card","onClick"]);return w(t("div",R(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(T,{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",W[b])})]})}):null,c?t(K,{position:c,done:r==="done"}):null]});return a?t(V,{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};
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"),n=require("radix-ui"),g=require("../lib/utils.js"),l=require("react"),b=Object.defineProperty,P=Object.defineProperties,w=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,p=(r,e,t)=>e in r?b(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,i=(r,e)=>{for(var t in e||(e={}))f.call(e,t)&&p(r,t,e[t]);if(s)for(var t of s(e))c.call(e,t)&&p(r,t,e[t]);return r},O=(r,e)=>P(r,w(e)),u=(r,e)=>{var t={};for(var o in r)f.call(r,o)&&e.indexOf(o)<0&&(t[o]=r[o]);if(r!=null&&s)for(var o of s(r))e.indexOf(o)<0&&c.call(r,o)&&(t[o]=r[o]);return t};function h(r){var e=u(r,[]);return a.jsx(n.Popover.Root,i({"data-slot":"popover"},e))}const j=l.forwardRef(function(r,e){return a.jsx(n.Popover.Trigger,i({ref:e,"data-slot":"popover-trigger"},r))});function x(r){var e=r,{className:t,align:o="center",sideOffset:v=4,showArrow:m=!1}=e,d=u(e,["className","align","sideOffset","showArrow"]);return a.jsx(n.Popover.Portal,{children:a.jsxs(n.Popover.Content,O(i({align:o,className:g.cn("z-50 w-72 rounded-md border border-gray-stroke-muted bg-surface-card p-4 text-gray-foreground shadow-level-3 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",t),"data-slot":"popover-content",sideOffset:v},d),{children:[d.children,m&&a.jsx(n.Popover.Arrow,{className:"-my-px fill-surface-card drop-shadow-[0_1px_0_var(--color-gray-stroke-muted)]"})]}))})}l.forwardRef(function(r,e){return a.jsx(n.Popover.Anchor,i({ref:e,"data-slot":"popover-anchor"},r))}),exports.Popover=h,exports.PopoverContent=x,exports.PopoverTrigger=j;
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 n,jsxs as g}from"react/jsx-runtime";import{Popover as a}from"radix-ui";import{cn as b}from"../lib/utils.mjs";import{forwardRef as l}from"react";var w=Object.defineProperty,O=Object.defineProperties,h=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,c=(r,e,t)=>e in r?w(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,i=(r,e)=>{for(var t in e||(e={}))f.call(e,t)&&c(r,t,e[t]);if(s)for(var t of s(e))p.call(e,t)&&c(r,t,e[t]);return r},y=(r,e)=>O(r,h(e)),m=(r,e)=>{var t={};for(var o in r)f.call(r,o)&&e.indexOf(o)<0&&(t[o]=r[o]);if(r!=null&&s)for(var o of s(r))e.indexOf(o)<0&&p.call(r,o)&&(t[o]=r[o]);return t};function P(r){var e=m(r,[]);return n(a.Root,i({"data-slot":"popover"},e))}const j=l(function(r,e){return n(a.Trigger,i({ref:e,"data-slot":"popover-trigger"},r))});function x(r){var e=r,{className:t,align:o="center",sideOffset:u=4,showArrow:v=!1}=e,d=m(e,["className","align","sideOffset","showArrow"]);return n(a.Portal,{children:g(a.Content,y(i({align:o,className:b("z-50 w-72 rounded-md border border-gray-stroke-muted bg-surface-card p-4 text-gray-foreground shadow-level-3 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",t),"data-slot":"popover-content",sideOffset:u},d),{children:[d.children,v&&n(a.Arrow,{className:"-my-px fill-surface-card drop-shadow-[0_1px_0_var(--color-gray-stroke-muted)]"})]}))})}l(function(r,e){return n(a.Anchor,i({ref:e,"data-slot":"popover-anchor"},r))});export{P as Popover,x as PopoverContent,j as PopoverTrigger};
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};
@@ -12,19 +12,39 @@ type SidebarContextProps = {
12
12
  isMobile: boolean;
13
13
  toggleSidebar: () => void;
14
14
  };
15
+ /**
16
+ * Lê a busca da sidebar. Os `Collapsible` do DS já abrem sozinhos durante a
17
+ * busca; use o hook para reagir a ela em outras partes do menu.
18
+ */
19
+ declare function useSidebarSearch(): {
20
+ query: string;
21
+ isSearching: boolean;
22
+ };
15
23
  declare function useSidebar(): SidebarContextProps;
16
24
  declare function SidebarProvider({ defaultOpen, open: openProp, onOpenChange: setOpenProp, className, children, ...props }: ComponentProps<"div"> & {
17
25
  defaultOpen?: boolean;
18
26
  open?: boolean;
19
27
  onOpenChange?: (open: boolean) => void;
20
28
  }): import("react/jsx-runtime").JSX.Element;
21
- declare function Sidebar({ side, variant, collapsible, className, containerClassName, mobileTitle, mobileDescription, children, ...props }: ComponentProps<"div"> & {
29
+ declare function Sidebar({ side, variant, collapsible, className, containerClassName, mobileTitle, mobileDescription, searchable, searchLabel, searchPlaceholder, searchEmptyMessage, searchClearLabel, searchResultsMessage, searchQuery: searchQueryProp, onSearchQueryChange, children: childrenProp, ...props }: ComponentProps<"div"> & {
22
30
  side?: "left" | "right";
23
31
  variant?: "sidebar" | "floating" | "inset";
24
32
  collapsible?: "offcanvas" | "icon" | "none";
25
33
  containerClassName?: string;
26
34
  mobileTitle?: string;
27
35
  mobileDescription?: string;
36
+ /** Mostra um campo de busca no topo do `SidebarContent` que filtra os itens do menu. */
37
+ searchable?: boolean;
38
+ searchLabel?: string;
39
+ searchPlaceholder?: string;
40
+ searchEmptyMessage?: string;
41
+ /** Nome acessível do botão que limpa a busca. */
42
+ searchClearLabel?: string;
43
+ /** Texto anunciado pelo leitor de tela com a quantidade de itens encontrados. */
44
+ searchResultsMessage?: (count: number) => string;
45
+ /** Texto da busca, para controlar de fora (por exemplo, limpar ao navegar). */
46
+ searchQuery?: string;
47
+ onSearchQueryChange?: (query: string) => void;
28
48
  }): import("react/jsx-runtime").JSX.Element;
29
49
  declare const SidebarTrigger: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
30
50
  label?: string;
@@ -45,7 +65,7 @@ declare function SidebarInput({ className, ...props }: ComponentProps<typeof Inp
45
65
  declare function SidebarHeader({ className, ...props }: ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
46
66
  declare function SidebarFooter({ className, ...props }: ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
47
67
  declare function SidebarSeparator({ className, ...props }: ComponentProps<typeof Separator>): import("react/jsx-runtime").JSX.Element;
48
- declare function SidebarContent({ className, ...props }: ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
68
+ declare const SidebarContent: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
49
69
  declare function SidebarGroup({ className, ...props }: ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
50
70
  declare const SidebarGroupLabel: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
51
71
  asChild?: boolean;
@@ -62,6 +82,8 @@ declare const SidebarMenuButton: import("react").ForwardRefExoticComponent<Omit<
62
82
  asChild?: boolean;
63
83
  isActive?: boolean;
64
84
  tooltip?: string | ComponentProps<typeof TooltipContent>;
85
+ /** Texto usado pela busca da sidebar no lugar do texto visível do botão. */
86
+ searchText?: string;
65
87
  } & VariantProps<(props?: ({
66
88
  variant?: "section" | "default" | "outline" | null | undefined;
67
89
  size?: "sm" | "md" | "lg" | null | undefined;
@@ -85,5 +107,7 @@ declare const SidebarMenuSubButton: import("react").ForwardRefExoticComponent<Om
85
107
  asChild?: boolean;
86
108
  size?: "sm" | "md";
87
109
  isActive?: boolean;
110
+ /** Texto usado pela busca da sidebar no lugar do texto visível do botão. */
111
+ searchText?: string;
88
112
  }, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
89
- export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuItemCollapse, SidebarMenuItemTitle, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar, };
113
+ export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuItemCollapse, SidebarMenuItemTitle, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar, useSidebarSearch, };
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  "use client";
3
- "use strict";var r=require("react/jsx-runtime"),O=require("@medway-ui/icons"),L=require("class-variance-authority"),z=require("radix-ui"),c=require("react"),$=require("./Input.js"),D=require("./Separator.js"),E=require("./Sheet.js"),q=require("./Skeleton.js"),k=require("./Tooltip.js"),F=require("../hooks/use-composed-refs.js"),G=require("../hooks/use-id.js"),B=require("../hooks/use-mobile.js"),n=require("../lib/utils.js"),K=Object.defineProperty,V=Object.defineProperties,U=Object.getOwnPropertyDescriptors,I=Object.getOwnPropertySymbols,_=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable,R=(a,e,t)=>e in a?K(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,i=(a,e)=>{for(var t in e||(e={}))_.call(e,t)&&R(a,t,e[t]);if(I)for(var t of I(e))A.call(e,t)&&R(a,t,e[t]);return a},C=(a,e)=>V(a,U(e)),d=(a,e)=>{var t={};for(var s in a)_.call(a,s)&&e.indexOf(s)<0&&(t[s]=a[s]);if(a!=null&&I)for(var s of I(a))e.indexOf(s)<0&&A.call(a,s)&&(t[s]=a[s]);return t};const W="sidebar_state",J=3600*24*7,Q="b",X=50,Y=40,Z=9973;function ee(a){return a instanceof HTMLElement?a.isContentEditable||a instanceof HTMLInputElement||a instanceof HTMLTextAreaElement||a instanceof HTMLSelectElement:!1}const P=c.createContext(null);function M(){const a=c.useContext(P);if(!a)throw new Error("useSidebar must be used within a SidebarProvider.");return a}function ae(a){var e=a,{defaultOpen:t=!0,open:s,onOpenChange:o,className:l,children:b}=e,p=d(e,["defaultOpen","open","onOpenChange","className","children"]);const g=B.useIsMobile(),[h,x]=c.useState(!1),[j,N]=c.useState(t),v=s!=null?s:j,w=c.useCallback(f=>{const u=typeof f=="function"?f(v):f;s===void 0&&N(u),o==null||o(u),document.cookie=`${W}=${u}; path=/; max-age=${J}`},[s,o,v]),m=c.useCallback(()=>g?x(f=>!f):w(f=>!f),[g,w,x]);c.useEffect(()=>{const f=u=>{u.defaultPrevented||ee(u.target)||u.key===Q&&(u.metaKey||u.ctrlKey)&&(u.preventDefault(),m())};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[m]);const S=v?"expanded":"collapsed",y=c.useMemo(()=>({state:S,open:v,setOpen:w,isMobile:g,openMobile:h,setOpenMobile:x,toggleSidebar:m}),[S,v,w,g,h,x,m]);return r.jsx(P.Provider,{value:y,children:r.jsx(k.TooltipProvider,{delayDuration:0,children:r.jsx("div",C(i({"data-slot":"sidebar-wrapper",className:n.cn("group/sidebar-wrapper flex min-h-svh w-full [&:has([data-variant=inset])]:bg-surface-navigation",l)},p),{children:b}))})})}function te(a){var e=a,{side:t="left",variant:s="sidebar",collapsible:o="offcanvas",className:l,containerClassName:b,mobileTitle:p="Menu lateral",mobileDescription:g="Navega\xE7\xE3o principal da aplica\xE7\xE3o.",children:h}=e,x=d(e,["side","variant","collapsible","className","containerClassName","mobileTitle","mobileDescription","children"]);const{isMobile:j,state:N,openMobile:v,setOpenMobile:w}=M(),m=c.useRef(null),S=()=>{m.current=document.activeElement},y=f=>{var u;f.preventDefault(),(u=m.current)==null||u.focus()};return o==="none"?r.jsx("div",C(i({"data-slot":"sidebar",className:n.cn("flex h-full w-[var(--sidebar-width)] flex-col bg-surface-navigation text-gray-foreground",l)},x),{children:h})):j?r.jsx(E.Sheet,{open:v,onOpenChange:w,children:r.jsxs(E.SheetContent,C(i({"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:n.cn("w-[var(--sidebar-width-mobile)] bg-surface-navigation p-0 text-gray-foreground [&>button]:hidden",l),side:t,onOpenAutoFocus:S,onCloseAutoFocus:y},x),{children:[r.jsx(E.SheetTitle,{className:"sr-only",children:p}),r.jsx(E.SheetDescription,{className:"sr-only",children:g}),r.jsx("div",{className:"flex h-full w-full flex-col",children:h})]}))}):r.jsxs("div",{className:n.cn("group peer hidden text-gray-foreground md:block",l),"data-state":N,"data-collapsible":N==="collapsed"?o:"","data-variant":s,"data-side":t,"data-slot":"sidebar",children:[r.jsx("div",{"data-slot":"sidebar-gap",className:n.cn("relative w-[var(--sidebar-width)] bg-transparent transition-[width] duration-200 ease-linear motion-reduce:transition-none","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",s==="floating"||s==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+1rem)]":"group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)]")}),r.jsx("div",C(i({"data-slot":"sidebar-container",className:n.cn("fixed inset-y-0 z-10 hidden h-svh w-[var(--sidebar-width)] border-gray-stroke-muted transition-[left,right,width] duration-200 ease-linear motion-reduce:transition-none md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",s==="floating"||s==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+1rem+2px)]":"group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)] group-data-[side=left]:border-r group-data-[side=right]:border-l",b)},x),{children:r.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex h-full w-full flex-col bg-surface-navigation group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-gray-stroke-muted group-data-[variant=floating]:shadow-level-1",children:h})}))]})}const se=c.forwardRef(function(a,e){var t=a,{className:s,onClick:o,sizeIcon:l="size-4",icon:b=r.jsx(O.HamburgerMd,{className:l}),showTooltip:p=!1,tooltipContent:g,enableHover:h=!1,label:x="Alternar barra lateral"}=t,j=d(t,["className","onClick","sizeIcon","icon","showTooltip","tooltipContent","enableHover","label"]);const{toggleSidebar:N,open:v,openMobile:w,isMobile:m}=M(),[S,y]=c.useState(!1),f=g||{open:"Esconder",closed:"Mostrar"},u=()=>h&&S?v?r.jsx(O.ChevronLeft,{className:l}):r.jsx(O.ChevronRight,{className:l}):b,T=r.jsxs("button",C(i({ref:e,type:"button","data-sidebar":"trigger","data-slot":"sidebar-trigger","aria-expanded":m?w:v,className:n.cn("flex min-h-8 min-w-8 items-center justify-center rounded-full bg-surface-elevated text-gray-foreground transition-shadow duration-200 hover:shadow-level-1 [&>svg]:text-gray-foreground hover:[&>svg]:text-gray-foreground-emphasis",s),onClick:H=>{o==null||o(H),N()},onMouseEnter:!m&&h?()=>y(!0):void 0,onMouseLeave:!m&&h?()=>y(!1):void 0},j),{children:[u(),r.jsx("span",{className:"sr-only",children:x})]}));return!p||m?T:r.jsxs(k.Tooltip,{children:[r.jsx(k.TooltipTrigger,{asChild:!0,children:T}),r.jsx(k.TooltipContent,{side:"right",align:"center",children:v?f.open:f.closed})]})});function re(a){var e=a,{className:t,label:s="Alternar barra lateral"}=e,o=d(e,["className","label"]);const{toggleSidebar:l}=M();return r.jsx("button",i({type:"button","data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":s,tabIndex:-1,onClick:l,title:s,className:n.cn("absolute inset-y-0 z-20 flex w-4 -translate-x-1/2 transition-[left,right,transform,background-color] ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-gray-stroke-muted group-data-[side=left]:-right-4 group-data-[side=right]:left-0 motion-reduce:transition-none","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-surface-navigation","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",t)},o))}function oe(a){var e=a,{className:t}=e,s=d(e,["className"]);return r.jsx("main",i({"data-slot":"sidebar-inset",className:n.cn("relative flex w-full flex-1 flex-col bg-surface-navigation","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-level-1",t)},s))}function ne(a){var e=a,{className:t}=e,s=d(e,["className"]);return r.jsx($.Input,i({"data-slot":"sidebar-input","data-sidebar":"input",className:n.cn("h-8 w-full bg-surface-navigation shadow-none",t)},s))}function ie(a){var e=a,{className:t}=e,s=d(e,["className"]);return r.jsx("div",i({"data-slot":"sidebar-header","data-sidebar":"header",className:n.cn("flex flex-col gap-0.5 px-4 pt-3",t)},s))}function le(a){var e=a,{className:t}=e,s=d(e,["className"]);return r.jsx("div",i({"data-slot":"sidebar-footer","data-sidebar":"footer",className:n.cn("flex flex-col gap-0.5 px-4 pb-3",t)},s))}function de(a){var e=a,{className:t}=e,s=d(e,["className"]);return r.jsx(D.Separator,i({"data-slot":"sidebar-separator","data-sidebar":"separator",className:n.cn("mx-2 w-auto bg-gray-stroke-muted",t)},s))}function ce(a){var e=a,{className:t}=e,s=d(e,["className"]);return r.jsx("div",i({"data-slot":"sidebar-content","data-sidebar":"content",className:n.cn("flex min-h-0 flex-1 flex-col gap-0.5 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t)},s))}function ue(a){var e=a,{className:t}=e,s=d(e,["className"]);return r.jsx("div",i({"data-slot":"sidebar-group","data-sidebar":"group",className:n.cn("relative flex w-full min-w-0 flex-col px-4 py-3",t)},s))}const fe=c.forwardRef(function(a,e){var t=a,{className:s,asChild:o=!1}=t,l=d(t,["className","asChild"]);const b=o?z.Slot.Slot:"div";return r.jsx(b,i({ref:e,"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:n.cn("flex shrink-0 items-center whitespace-nowrap rounded-md px-3.5 pb-3 text-xs font-semibold uppercase leading-xs text-gray-foreground-muted outline-none transition-[margin,opacity,visibility] duration-200 ease-linear focus-visible:ring-4 focus-visible:ring-state-focus motion-reduce:transition-none [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:pointer-events-none group-data-[collapsible=icon]:invisible group-data-[collapsible=icon]:-mt-7 group-data-[collapsible=icon]:opacity-0",s)},l))}),be=c.forwardRef(function(a,e){var t=a,{className:s,asChild:o=!1}=t,l=d(t,["className","asChild"]);const b=o?z.Slot.Slot:"button";return r.jsx(b,i({ref:e,type:o?void 0:"button","data-slot":"sidebar-group-action","data-sidebar":"group-action",className:n.cn("absolute right-3 top-2.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-gray-foreground outline-none transition-transform hover:bg-secondary-background-soft-emphasis focus-visible:ring-4 focus-visible:ring-state-focus [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","group-data-[collapsible=icon]:hidden",s)},l))});function pe(a){var e=a,{className:t}=e,s=d(e,["className"]);return r.jsx("div",i({"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:n.cn("w-full text-sm",t)},s))}function me(a){var e=a,{className:t}=e,s=d(e,["className"]);return r.jsx("ul",i({"data-slot":"sidebar-menu","data-sidebar":"menu",className:n.cn("flex w-full min-w-0 flex-col",t)},s))}function ve(a){var e=a,{className:t,isActive:s,children:o}=e,l=d(e,["className","isActive","children"]);return r.jsxs("li",C(i({"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:n.cn("group/menu-item relative hover:cursor-pointer",t)},l),{children:[s&&r.jsx("span",{className:"absolute -left-4 top-0 h-full w-0.5 bg-secondary-stroke-emphasis","aria-hidden":"true"}),o]}))}const ge=L.cva("peer/menu-button font-medium flex w-full select-none items-center gap-2.5 overflow-hidden rounded-md px-3.5 py-2.5 text-left text-sm outline-none transition-[width,height,padding] duration-200 ease-linear hover:bg-secondary-background-soft-emphasis focus-visible:ring-4 focus-visible:ring-state-focus motion-reduce:transition-none active:text-secondary-foreground-muted active:font-semibold disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 group-has-[[data-sidebar=menu-badge]]/menu-item:pr-10 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:text-secondary-foreground-muted data-[active=true]:font-semibold data-[active=true]:hover:bg-secondary-background-soft-emphasis data-[active=true]:hover:text-secondary-foreground-muted group-data-[collapsible=icon]:!size-10 group-data-[collapsible=icon]:!p-2.5 [&>span:last-child]:truncate [&>svg]:size-5 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-secondary-background-soft-emphasis",section:"[[data-state=collapsed]_&]:justify-center [[data-state=collapsed]_&]:p-[5px]",outline:"bg-surface-navigation shadow-[0_0_0_1px_var(--color-gray-stroke-muted)] hover:bg-secondary-background-soft-emphasis hover:shadow-[0_0_0_1px_var(--color-secondary-stroke)]"},size:{sm:"h-8 text-xs",md:"h-10 text-sm",lg:"h-12 text-md group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"md"}});function he(a){if(!a)return!1;try{return a.matches(":focus-visible, :hover")}catch(e){return a.matches(":focus, :hover")}}const xe=c.forwardRef(function(a,e){var t=a,{asChild:s=!1,isActive:o=!1,variant:l="default",size:b="md",tooltip:p,className:g}=t,h=d(t,["asChild","isActive","variant","size","tooltip","className"]);const x=s?z.Slot.Slot:"button",{isMobile:j,state:N}=M(),[v,w]=c.useState(!1),m=c.useRef(null),S=F.useComposedRefs(e,m),y=N!=="collapsed"||j,f=T=>{y||w(T)},u=r.jsx(x,i({ref:S,type:s?void 0:"button","data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":b,"data-active":o,className:n.cn(ge({variant:l,size:b}),g)},h));return c.useEffect(()=>{w(!y&&he(m.current))},[y]),p?(typeof p=="string"&&(p={children:p}),r.jsxs(k.Tooltip,{open:!y&&v,onOpenChange:f,children:[r.jsx(k.TooltipTrigger,{asChild:!0,children:u}),r.jsx(k.TooltipContent,i({side:"right",align:"center"},p))]})):u}),we=c.forwardRef(function(a,e){var t=a,{className:s,asChild:o=!1,showOnHover:l=!1}=t,b=d(t,["className","asChild","showOnHover"]);const p=o?z.Slot.Slot:"button";return r.jsx(p,i({ref:e,type:o?void 0:"button","data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:n.cn("absolute right-1 top-2.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-gray-foreground outline-none transition-transform hover:bg-secondary-background-soft-emphasis focus-visible:ring-4 focus-visible:ring-state-focus peer-hover/menu-button:text-secondary-stroke-emphasis [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","peer-data-[size=sm]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-3.5","group-data-[collapsible=icon]:hidden",l&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-secondary-foreground-muted md:opacity-0",s)},b))});function ye(a){var e=a,{className:t}=e,s=d(e,["className"]);return r.jsx("div",i({"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:n.cn("pointer-events-none absolute right-1 top-2.5 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-gray-foreground","peer-hover/menu-button:text-secondary-foreground peer-data-[active=true]/menu-button:text-secondary-foreground-muted","peer-data-[size=sm]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-3.5","group-data-[collapsible=icon]:hidden",t)},s))}function Ne(a){let e=0;for(const t of a)e=(e*31+t.charCodeAt(0))%Z;return`${e%Y+X}%`}function Se(a){var e=a,{className:t,showIcon:s=!1}=e,o=d(e,["className","showIcon"]);const l=Ne(G.useId());return r.jsxs("div",C(i({"data-slot":"sidebar-menu-skeleton","data-sidebar":"menu-skeleton",className:n.cn("flex h-8 items-center gap-0.5 rounded-md px-2",t)},o),{children:[s&&r.jsx(q.Skeleton,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),r.jsx(q.Skeleton,{className:"h-4 max-w-[var(--skeleton-width)] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":l}})]}))}function je(a){var e=a,{className:t}=e,s=d(e,["className"]);return r.jsx("ul",i({"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:n.cn("my-1 ml-[1.4375rem] flex min-w-0 flex-col border-l border-gray-stroke-muted pl-1.5","group-data-[collapsible=icon]:hidden",t)},s))}function ke(a){var e=a,{className:t}=e,s=d(e,["className"]);return r.jsx("li",i({"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:n.cn("group/menu-sub-item relative",t)},s))}function Ce({icon:a,title:e}){const{state:t,isMobile:s}=M();return r.jsxs(r.Fragment,{children:[a,r.jsx("span",{className:n.cn("whitespace-nowrap transition-opacity duration-200 ease-linear",t==="collapsed"&&"opacity-0",s&&"opacity-100"),children:e})]})}function Me(){return r.jsx("div",{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90 motion-reduce:transition-none",children:r.jsx(O.ChevronRightMd,{size:20})})}const ze=c.forwardRef(function(a,e){var t=a,{asChild:s=!1,size:o="md",isActive:l=!1,className:b}=t,p=d(t,["asChild","size","isActive","className"]);const g=s?z.Slot.Slot:"a";return r.jsx(g,i({ref:e,"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":o,"data-active":l,className:n.cn("flex h-10 min-w-0 select-none items-center gap-0.5 overflow-hidden rounded-md px-3.5 font-medium text-gray-foreground outline-none hover:bg-secondary-background-soft-emphasis focus-visible:ring-4 focus-visible:ring-state-focus active:font-semibold active:text-secondary-foreground-muted disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-gray-foreground","data-[active=true]:font-semibold data-[active=true]:text-secondary-foreground-muted",o==="sm"&&"text-xs",o==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",b)},p))});exports.Sidebar=te,exports.SidebarContent=ce,exports.SidebarFooter=le,exports.SidebarGroup=ue,exports.SidebarGroupAction=be,exports.SidebarGroupContent=pe,exports.SidebarGroupLabel=fe,exports.SidebarHeader=ie,exports.SidebarInput=ne,exports.SidebarInset=oe,exports.SidebarMenu=me,exports.SidebarMenuAction=we,exports.SidebarMenuBadge=ye,exports.SidebarMenuButton=xe,exports.SidebarMenuItem=ve,exports.SidebarMenuItemCollapse=Me,exports.SidebarMenuItemTitle=Ce,exports.SidebarMenuSkeleton=Se,exports.SidebarMenuSub=je,exports.SidebarMenuSubButton=ze,exports.SidebarMenuSubItem=ke,exports.SidebarProvider=ae,exports.SidebarRail=re,exports.SidebarSeparator=de,exports.SidebarTrigger=se,exports.useSidebar=M;
3
+ "use strict";var n=require("react/jsx-runtime"),T=require("@medway-ui/icons"),ye=require("class-variance-authority"),_=require("radix-ui"),l=require("react"),we=require("./Input.js"),Ne=require("./Separator.js"),P=require("./Sheet.js"),ae=require("./Skeleton.js"),E=require("./Tooltip.js"),Se=require("../hooks/use-composed-refs.js"),te=require("../hooks/use-id.js"),je=require("../hooks/use-mobile.js"),Ce=require("../lib/sidebar-search.js"),u=require("../lib/utils.js"),Me=Object.defineProperty,ke=Object.defineProperties,Ae=Object.getOwnPropertyDescriptors,H=Object.getOwnPropertySymbols,re=Object.prototype.hasOwnProperty,ne=Object.prototype.propertyIsEnumerable,se=(e,a,t)=>a in e?Me(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,p=(e,a)=>{for(var t in a||(a={}))re.call(a,t)&&se(e,t,a[t]);if(H)for(var t of H(a))ne.call(a,t)&&se(e,t,a[t]);return e},A=(e,a)=>ke(e,Ae(a)),v=(e,a)=>{var t={};for(var r in e)re.call(e,r)&&a.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&H)for(var r of H(e))a.indexOf(r)<0&&ne.call(e,r)&&(t[r]=e[r]);return t};const Ee="sidebar_state",ze=3600*24*7,Te="b",qe=50,Oe=40,Le=9973;function Ie(e){return e instanceof HTMLElement?e.isContentEditable||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement:!1}const oe=l.createContext(null),D=l.createContext(null),q="data-search-hidden",O='[data-sidebar="menu-item"], [data-sidebar="menu-sub-item"]',ie='[data-sidebar="menu-button"], [data-sidebar="menu-sub-button"]',Re='[data-sidebar="menu-badge"], [data-sidebar="menu-action"], [data-sidebar="menu-sub"], [aria-hidden="true"], .sr-only';function _e(e){return e===1?"1 item encontrado.":`${e} itens encontrados.`}function $(e){return u.normalizeSearchText(e.replace(/\s+/g," "))}function L(e,a){a?e.setAttribute(q,""):e.removeAttribute(q)}function le(e){e.querySelectorAll(`[${q}]`).forEach(a=>a.removeAttribute(q))}function V(e){var a,t;return(t=(a=e.parentElement)==null?void 0:a.closest(O))!=null?t:null}function Pe(e){return Array.from(e.querySelectorAll(O)).filter(a=>V(a)===e)}function de(e){var a;return(a=Array.from(e.querySelectorAll(ie)).find(t=>t.closest(O)===e))!=null?a:null}function He(e){var a,t;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let s="";for(let o=r.nextNode();o;o=r.nextNode()){const d=(a=o.parentElement)==null?void 0:a.closest(`${Re}, ${O}`);(!d||d===e||!e.contains(d))&&(s+=(t=o.textContent)!=null?t:"")}return s}function De(e){var a;const t=de(e),r=t==null?void 0:t.getAttribute("data-search-text");if(r!=null)return r;const s=He(t!=null?t:e);return s.trim()===""?(a=t==null?void 0:t.getAttribute("aria-label"))!=null?a:"":s}function $e(e){const a=de(e);if(!a)return!1;const t=a.getAttribute("aria-current");return a.getAttribute("data-active")==="true"||t!==null&&t!=="false"}function ce(e,a,t,r){let s=t.get(e);s===void 0&&(s=$(De(e)),t.set(e,s));const o=r||a(s);let d=!1,c=!1;for(const i of Pe(e)){const b=ce(i,a,t,o);d||(d=b.matched),c||(c=b.visible)}const h=o||d,f=h||c||$e(e);return L(e,!f),{matched:h,visible:f}}function Fe(e,a){let t=!1,r=null;for(const s of Array.from(e.children))if(s!==a){if(s.getAttribute("data-sidebar")==="separator"){r&&L(r,!0),r=t?s:null,t||L(s,!0);continue}s.hasAttribute(q)||(r&&(L(r,!1),r=null),t=!0)}r&&L(r,!0)}function Qe(e,a,t,r){const s=$(t);if(s==="")return le(e),0;const o=c=>c.includes(s);let d=0;return e.querySelectorAll(O).forEach(c=>{V(c)||ce(c,o,r,!1).matched&&(d+=1)}),e.querySelectorAll('[data-sidebar="group"]').forEach(c=>{const h=Array.from(c.querySelectorAll('[data-sidebar="menu-item"]')).some(f=>!f.hasAttribute(q));L(c,!h)}),Fe(e,a),d}function U(e){const a=e.closest('[data-sidebar="sidebar"], [data-slot="sidebar"]');return a?Array.from(a.querySelectorAll('[data-sidebar="content"]')):[]}function ue(){var e;const a=l.useContext(D),t=(e=a==null?void 0:a.query)!=null?e:"";return{query:t,isSearching:$(t)!==""}}function I(){const e=l.useContext(oe);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function Be(e){var a=e,{defaultOpen:t=!0,open:r,onOpenChange:s,className:o,children:d}=a,c=v(a,["defaultOpen","open","onOpenChange","className","children"]);const h=je.useIsMobile(),[f,i]=l.useState(!1),[b,S]=l.useState(t),x=r!=null?r:b,N=l.useCallback(m=>{const w=typeof m=="function"?m(x):m;r===void 0&&S(w),s==null||s(w),document.cookie=`${Ee}=${w}; path=/; max-age=${ze}`},[r,s,x]),g=l.useCallback(()=>h?i(m=>!m):N(m=>!m),[h,N,i]);l.useEffect(()=>{const m=w=>{w.defaultPrevented||Ie(w.target)||w.key===Te&&(w.metaKey||w.ctrlKey)&&(w.preventDefault(),g())};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[g]);const y=x?"expanded":"collapsed",C=l.useMemo(()=>({state:y,open:x,setOpen:N,isMobile:h,openMobile:f,setOpenMobile:i,toggleSidebar:g}),[y,x,N,h,f,i,g]);return n.jsx(oe.Provider,{value:C,children:n.jsx(E.TooltipProvider,{delayDuration:0,children:n.jsx("div",A(p({"data-slot":"sidebar-wrapper",className:u.cn("group/sidebar-wrapper flex min-h-svh w-full [&:has([data-variant=inset])]:bg-surface-navigation",o)},c),{children:d}))})})}function Ke(e){var a=e,{side:t="left",variant:r="sidebar",collapsible:s="offcanvas",className:o,containerClassName:d,mobileTitle:c="Menu lateral",mobileDescription:h="Navega\xE7\xE3o principal da aplica\xE7\xE3o.",searchable:f=!1,searchLabel:i="Buscar no menu",searchPlaceholder:b="Buscar no menu",searchEmptyMessage:S="Nenhum item encontrado.",searchClearLabel:x="Limpar busca",searchResultsMessage:N=_e,searchQuery:g,onSearchQueryChange:y,children:C}=a,m=v(a,["side","variant","collapsible","className","containerClassName","mobileTitle","mobileDescription","searchable","searchLabel","searchPlaceholder","searchEmptyMessage","searchClearLabel","searchResultsMessage","searchQuery","onSearchQueryChange","children"]);const{isMobile:w,state:k,openMobile:R,setOpenMobile:be}=I(),X=l.useRef(null),[me,pe]=l.useState(""),F=g!=null?g:me,z=l.useCallback(j=>{g===void 0&&pe(j),y==null||y(j)},[g,y]),[Y,Z]=l.useState(null),J=l.useCallback(j=>{Z(M=>M!=null?M:j)},[]),ee=l.useCallback(j=>{Z(M=>M===j?null:M)},[]),Q=!w&&s==="icon"&&k==="collapsed",B=!f||Q,K=B?"":F;l.useEffect(()=>{B&&F!==""&&z("")},[B,F,z]);const he=l.useMemo(()=>({query:K,setQuery:z,isCollapsedToIcon:Q,label:i,placeholder:b,emptyMessage:S,clearLabel:x,resultsMessage:N,ownerId:Y,claimOwner:J,releaseOwner:ee}),[K,z,Q,i,b,S,x,N,Y,J,ee]),G=n.jsx(D.Provider,{value:f?he:null,children:C}),ve=j=>{X.current=document.activeElement,f&&j.target instanceof HTMLElement&&(j.preventDefault(),j.target.focus({preventScroll:!0}))},ge=j=>{var M;j.preventDefault(),f&&z(""),(M=X.current)==null||M.focus()},xe=j=>{var M;const W=j.target;f&&K!==""&&(M=W==null?void 0:W.closest)!=null&&M.call(W,'[data-sidebar="search"]')&&(j.preventDefault(),z(""))};return s==="none"?n.jsx("div",A(p({"data-slot":"sidebar",className:u.cn("flex h-full w-[var(--sidebar-width)] flex-col bg-surface-navigation text-gray-foreground",o)},m),{children:G})):w?n.jsx(P.Sheet,{open:R,onOpenChange:be,children:n.jsxs(P.SheetContent,A(p({"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:u.cn("w-[var(--sidebar-width-mobile)] bg-surface-navigation p-0 text-gray-foreground outline-none [&>button]:hidden",o),side:t,onOpenAutoFocus:ve,onCloseAutoFocus:ge,onEscapeKeyDown:xe},m),{children:[n.jsx(P.SheetTitle,{className:"sr-only",children:c}),n.jsx(P.SheetDescription,{className:"sr-only",children:h}),n.jsx("div",{className:"flex h-full w-full flex-col",children:G})]}))}):n.jsxs("div",{className:u.cn("group peer hidden text-gray-foreground md:block",o),"data-state":k,"data-collapsible":k==="collapsed"?s:"","data-variant":r,"data-side":t,"data-slot":"sidebar",children:[n.jsx("div",{"data-slot":"sidebar-gap",className:u.cn("relative w-[var(--sidebar-width)] bg-transparent transition-[width] duration-200 ease-linear motion-reduce:transition-none","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",r==="floating"||r==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+1rem)]":"group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)]")}),n.jsx("div",A(p({"data-slot":"sidebar-container",className:u.cn("fixed inset-y-0 z-10 hidden h-svh w-[var(--sidebar-width)] border-gray-stroke-muted transition-[left,right,width] duration-200 ease-linear motion-reduce:transition-none md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",r==="floating"||r==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+1rem+2px)]":"group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)] group-data-[side=left]:border-r group-data-[side=right]:border-l",d)},m),{children:n.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex h-full w-full flex-col bg-surface-navigation group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-gray-stroke-muted group-data-[variant=floating]:shadow-level-1",children:G})}))]})}const Ge=l.forwardRef(function(e,a){var t=e,{className:r,onClick:s,sizeIcon:o="size-4",icon:d=n.jsx(T.HamburgerMd,{className:o}),showTooltip:c=!1,tooltipContent:h,enableHover:f=!1,label:i="Alternar barra lateral"}=t,b=v(t,["className","onClick","sizeIcon","icon","showTooltip","tooltipContent","enableHover","label"]);const{toggleSidebar:S,open:x,openMobile:N,isMobile:g}=I(),[y,C]=l.useState(!1),m=h||{open:"Esconder",closed:"Mostrar"},w=()=>f&&y?x?n.jsx(T.ChevronLeft,{className:o}):n.jsx(T.ChevronRight,{className:o}):d,k=n.jsxs("button",A(p({ref:a,type:"button","data-sidebar":"trigger","data-slot":"sidebar-trigger","aria-expanded":g?N:x,className:u.cn("flex min-h-8 min-w-8 items-center justify-center rounded-full bg-surface-elevated text-gray-foreground transition-shadow duration-200 hover:shadow-level-1 [&>svg]:text-gray-foreground hover:[&>svg]:text-gray-foreground-emphasis",r),onClick:R=>{s==null||s(R),S()},onMouseEnter:!g&&f?()=>C(!0):void 0,onMouseLeave:!g&&f?()=>C(!1):void 0},b),{children:[w(),n.jsx("span",{className:"sr-only",children:i})]}));return!c||g?k:n.jsxs(E.Tooltip,{children:[n.jsx(E.TooltipTrigger,{asChild:!0,children:k}),n.jsx(E.TooltipContent,{side:"right",align:"center",children:x?m.open:m.closed})]})});function We(e){var a=e,{className:t,label:r="Alternar barra lateral"}=a,s=v(a,["className","label"]);const{toggleSidebar:o}=I();return n.jsx("button",p({type:"button","data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":r,tabIndex:-1,onClick:o,title:r,className:u.cn("absolute inset-y-0 z-20 flex w-4 -translate-x-1/2 transition-[left,right,transform,background-color] ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-gray-stroke-muted group-data-[side=left]:-right-4 group-data-[side=right]:left-0 motion-reduce:transition-none","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-surface-navigation","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",t)},s))}function Ve(e){var a=e,{className:t}=a,r=v(a,["className"]);return n.jsx("main",p({"data-slot":"sidebar-inset",className:u.cn("relative flex w-full flex-1 flex-col bg-surface-navigation","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-level-1",t)},r))}function fe(e){var a=e,{className:t}=a,r=v(a,["className"]);return n.jsx(we.Input,p({"data-slot":"sidebar-input","data-sidebar":"input",className:u.cn("h-8 w-full bg-surface-navigation shadow-none",t)},r))}function Ue(e){var a=e,{className:t}=a,r=v(a,["className"]);return n.jsx("div",p({"data-slot":"sidebar-header","data-sidebar":"header",className:u.cn("flex flex-col gap-0.5 px-4 pt-3",t)},r))}function Xe(e){var a=e,{className:t}=a,r=v(a,["className"]);return n.jsx("div",p({"data-slot":"sidebar-footer","data-sidebar":"footer",className:u.cn("flex flex-col gap-0.5 px-4 pb-3",t)},r))}function Ye(e){var a=e,{className:t}=a,r=v(a,["className"]);return n.jsx(Ne.Separator,p({"data-slot":"sidebar-separator","data-sidebar":"separator",className:u.cn("mx-2 w-auto bg-gray-stroke-muted data-[search-hidden]:hidden",t)},r))}function Ze({label:e,size:a,onClear:t}){return n.jsx("button",{type:"button","aria-label":e,onClick:t,className:"flex rounded-full text-gray-foreground outline-none transition-colors hover:text-gray-foreground-emphasis focus-visible:ring-4 focus-visible:ring-state-focus",children:n.jsx(T.CloseMd,{size:a,"aria-hidden":"true"})})}function Je(e,a){const t=e instanceof Element?e:e.parentElement;return!t||a.contains(t)||t.closest('[data-sidebar="menu-badge"], [data-sidebar="menu-action"]')!==null}function ea(e,a){var t;let r=e instanceof Element?e:e.parentElement;for(r=(t=r==null?void 0:r.closest(O))!=null?t:null;r;)a.delete(r),r=V(r)}function aa(){const e=l.useContext(D),{query:a,setQuery:t,isCollapsedToIcon:r}=e,s=l.useRef(null),[o,d]=l.useState(0),c=$(a)!=="";l.useLayoutEffect(()=>{const i=s.current;if(!i)return;const b=U(i),S=new WeakMap,x=()=>{d(b.reduce((y,C)=>y+Qe(C,i,a,S),0))};if(x(),!c)return;let N=0;const g=new MutationObserver(y=>{const C=y.filter(m=>!Je(m.target,i));C.length!==0&&(C.forEach(m=>ea(m.target,S)),!N&&(N=requestAnimationFrame(()=>{N=0,x()})))});return b.forEach(y=>g.observe(y,{childList:!0,subtree:!0,characterData:!0})),()=>{g.disconnect(),cancelAnimationFrame(N)}},[a,c]),l.useLayoutEffect(()=>{const i=s.current;if(!i)return;const b=U(i);return()=>b.forEach(le)},[]),l.useLayoutEffect(()=>{const i=s.current;if(!r||!i||!i.contains(document.activeElement))return;const b=U(i).flatMap(S=>Array.from(S.querySelectorAll(ie))).find(S=>S.offsetParent!==null);b==null||b.focus()},[r]);const h=()=>{var i,b;t(""),(b=(i=s.current)==null?void 0:i.querySelector("input"))==null||b.focus()};let f="";return c&&(f=o>0?e.resultsMessage(o):e.emptyMessage),n.jsxs("div",{ref:s,role:"search","data-slot":"sidebar-search","data-sidebar":"search",className:"sticky top-0 z-10 flex flex-col gap-2 bg-surface-navigation px-4 pt-3 group-data-[collapsible=icon]:hidden",children:[n.jsx(fe,{size:"md",role:"searchbox",autoComplete:"off","aria-label":e.label,placeholder:e.placeholder,iconLeft:n.jsx(T.SearchMagnifyingGlass,{}),iconRight:a!==""?n.jsx(Ze,{label:e.clearLabel,onClear:h}):void 0,value:a,onChange:i=>t(i.target.value),onKeyDown:i=>{i.key==="Escape"&&a!==""&&(i.preventDefault(),i.stopPropagation(),t(""))},className:"h-10"}),n.jsx("p",{role:"status",className:u.cn("text-sm text-gray-foreground-muted",c&&o===0?"px-3.5":"sr-only"),children:f})]})}const ta=l.forwardRef(function(e,a){var t=e,{className:r,children:s}=t,o=v(t,["className","children"]);const d=l.useContext(D),{isSearching:c}=ue(),h=te.useId(),f=d==null?void 0:d.ownerId,i=d==null?void 0:d.claimOwner,b=d==null?void 0:d.releaseOwner;return l.useLayoutEffect(()=>{f===null&&(i==null||i(h))},[f,i,h]),l.useLayoutEffect(()=>()=>b==null?void 0:b(h),[b,h]),n.jsxs("div",A(p({ref:a,"data-slot":"sidebar-content","data-sidebar":"content",className:u.cn("flex min-h-0 flex-1 flex-col gap-0.5 overflow-auto group-data-[collapsible=icon]:overflow-hidden",r)},o),{children:[d&&f===h&&n.jsx(aa,{}),n.jsx(Ce.SidebarSearchActiveContext.Provider,{value:c,children:s})]}))});function ra(e){var a=e,{className:t}=a,r=v(a,["className"]);return n.jsx("div",p({"data-slot":"sidebar-group","data-sidebar":"group",className:u.cn("relative flex w-full min-w-0 flex-col px-4 py-3 data-[search-hidden]:hidden",t)},r))}const na=l.forwardRef(function(e,a){var t=e,{className:r,asChild:s=!1}=t,o=v(t,["className","asChild"]);const d=s?_.Slot.Slot:"div";return n.jsx(d,p({ref:a,"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:u.cn("flex shrink-0 items-center whitespace-nowrap rounded-md px-3.5 pb-3 text-xs font-semibold uppercase leading-xs text-gray-foreground-muted outline-none transition-[margin,opacity,visibility] duration-200 ease-linear focus-visible:ring-4 focus-visible:ring-state-focus motion-reduce:transition-none [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:pointer-events-none group-data-[collapsible=icon]:invisible group-data-[collapsible=icon]:-mt-7 group-data-[collapsible=icon]:opacity-0",r)},o))}),sa=l.forwardRef(function(e,a){var t=e,{className:r,asChild:s=!1}=t,o=v(t,["className","asChild"]);const d=s?_.Slot.Slot:"button";return n.jsx(d,p({ref:a,type:s?void 0:"button","data-slot":"sidebar-group-action","data-sidebar":"group-action",className:u.cn("absolute right-3 top-2.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-gray-foreground outline-none transition-transform hover:bg-secondary-background-soft-emphasis focus-visible:ring-4 focus-visible:ring-state-focus [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","group-data-[collapsible=icon]:hidden",r)},o))});function oa(e){var a=e,{className:t}=a,r=v(a,["className"]);return n.jsx("div",p({"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:u.cn("w-full text-sm",t)},r))}function ia(e){var a=e,{className:t}=a,r=v(a,["className"]);return n.jsx("ul",p({"data-slot":"sidebar-menu","data-sidebar":"menu",className:u.cn("flex w-full min-w-0 flex-col",t)},r))}function la(e){var a=e,{className:t,isActive:r,children:s}=a,o=v(a,["className","isActive","children"]);return n.jsxs("li",A(p({"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:u.cn("group/menu-item relative hover:cursor-pointer data-[search-hidden]:hidden",t)},o),{children:[r&&n.jsx("span",{className:"absolute -left-4 top-0 h-full w-0.5 bg-secondary-stroke-emphasis","aria-hidden":"true"}),s]}))}const da=ye.cva("peer/menu-button font-medium flex w-full select-none items-center gap-2.5 overflow-hidden rounded-md px-3.5 py-2.5 text-left text-sm outline-none transition-[width,height,padding] duration-200 ease-linear hover:bg-secondary-background-soft-emphasis focus-visible:ring-4 focus-visible:ring-state-focus motion-reduce:transition-none active:text-secondary-foreground-muted active:font-semibold disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 group-has-[[data-sidebar=menu-badge]]/menu-item:pr-10 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:text-secondary-foreground-muted data-[active=true]:font-semibold data-[active=true]:hover:bg-secondary-background-soft-emphasis data-[active=true]:hover:text-secondary-foreground-muted group-data-[collapsible=icon]:!size-10 group-data-[collapsible=icon]:!p-2.5 [&>span:last-child]:truncate [&>svg]:size-5 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-secondary-background-soft-emphasis",section:"[[data-state=collapsed]_&]:justify-center [[data-state=collapsed]_&]:p-[5px]",outline:"bg-surface-navigation shadow-[0_0_0_1px_var(--color-gray-stroke-muted)] hover:bg-secondary-background-soft-emphasis hover:shadow-[0_0_0_1px_var(--color-secondary-stroke)]"},size:{sm:"h-8 text-xs",md:"h-10 text-sm",lg:"h-12 text-md group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"md"}});function ca(e){if(!e)return!1;try{return e.matches(":focus-visible, :hover")}catch(a){return e.matches(":focus, :hover")}}const ua=l.forwardRef(function(e,a){var t=e,{asChild:r=!1,isActive:s=!1,variant:o="default",size:d="md",tooltip:c,searchText:h,className:f}=t,i=v(t,["asChild","isActive","variant","size","tooltip","searchText","className"]);const b=r?_.Slot.Slot:"button",{isMobile:S,state:x}=I(),[N,g]=l.useState(!1),y=l.useRef(null),C=Se.useComposedRefs(a,y),m=x!=="collapsed"||S,w=R=>{m||g(R)},k=n.jsx(b,p({ref:C,type:r?void 0:"button","data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":d,"data-active":s,"data-search-text":h,className:u.cn(da({variant:o,size:d}),f)},i));return l.useEffect(()=>{g(!m&&ca(y.current))},[m]),c?(typeof c=="string"&&(c={children:c}),n.jsxs(E.Tooltip,{open:!m&&N,onOpenChange:w,children:[n.jsx(E.TooltipTrigger,{asChild:!0,children:k}),n.jsx(E.TooltipContent,p({side:"right",align:"center"},c))]})):k}),fa=l.forwardRef(function(e,a){var t=e,{className:r,asChild:s=!1,showOnHover:o=!1}=t,d=v(t,["className","asChild","showOnHover"]);const c=s?_.Slot.Slot:"button";return n.jsx(c,p({ref:a,type:s?void 0:"button","data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:u.cn("absolute right-1 top-2.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-gray-foreground outline-none transition-transform hover:bg-secondary-background-soft-emphasis focus-visible:ring-4 focus-visible:ring-state-focus peer-hover/menu-button:text-secondary-stroke-emphasis [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","peer-data-[size=sm]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-3.5","group-data-[collapsible=icon]:hidden",o&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-secondary-foreground-muted md:opacity-0",r)},d))});function ba(e){var a=e,{className:t}=a,r=v(a,["className"]);return n.jsx("div",p({"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:u.cn("pointer-events-none absolute right-1 top-2.5 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-gray-foreground","peer-hover/menu-button:text-secondary-foreground peer-data-[active=true]/menu-button:text-secondary-foreground-muted","peer-data-[size=sm]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-3.5","group-data-[collapsible=icon]:hidden",t)},r))}function ma(e){let a=0;for(const t of e)a=(a*31+t.charCodeAt(0))%Le;return`${a%Oe+qe}%`}function pa(e){var a=e,{className:t,showIcon:r=!1}=a,s=v(a,["className","showIcon"]);const o=ma(te.useId());return n.jsxs("div",A(p({"data-slot":"sidebar-menu-skeleton","data-sidebar":"menu-skeleton",className:u.cn("flex h-8 items-center gap-0.5 rounded-md px-2",t)},s),{children:[r&&n.jsx(ae.Skeleton,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),n.jsx(ae.Skeleton,{className:"h-4 max-w-[var(--skeleton-width)] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":o}})]}))}function ha(e){var a=e,{className:t}=a,r=v(a,["className"]);return n.jsx("ul",p({"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:u.cn("my-1 ml-[1.4375rem] flex min-w-0 flex-col border-l border-gray-stroke-muted pl-1.5","group-data-[collapsible=icon]:hidden",t)},r))}function va(e){var a=e,{className:t}=a,r=v(a,["className"]);return n.jsx("li",p({"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:u.cn("group/menu-sub-item relative data-[search-hidden]:hidden",t)},r))}function ga({icon:e,title:a}){const{state:t,isMobile:r}=I();return n.jsxs(n.Fragment,{children:[e,n.jsx("span",{className:u.cn("whitespace-nowrap transition-opacity duration-200 ease-linear",t==="collapsed"&&"opacity-0",r&&"opacity-100"),children:a})]})}function xa(){return n.jsx("div",{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90 motion-reduce:transition-none",children:n.jsx(T.ChevronRightMd,{size:20})})}const ya=l.forwardRef(function(e,a){var t=e,{asChild:r=!1,size:s="md",isActive:o=!1,searchText:d,className:c}=t,h=v(t,["asChild","size","isActive","searchText","className"]);const f=r?_.Slot.Slot:"a";return n.jsx(f,p({ref:a,"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":s,"data-active":o,"data-search-text":d,className:u.cn("flex h-10 min-w-0 select-none items-center gap-0.5 overflow-hidden rounded-md px-3.5 font-medium text-gray-foreground outline-none hover:bg-secondary-background-soft-emphasis focus-visible:ring-4 focus-visible:ring-state-focus active:font-semibold active:text-secondary-foreground-muted disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-gray-foreground","data-[active=true]:font-semibold data-[active=true]:text-secondary-foreground-muted",s==="sm"&&"text-xs",s==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",c)},h))});exports.Sidebar=Ke,exports.SidebarContent=ta,exports.SidebarFooter=Xe,exports.SidebarGroup=ra,exports.SidebarGroupAction=sa,exports.SidebarGroupContent=oa,exports.SidebarGroupLabel=na,exports.SidebarHeader=Ue,exports.SidebarInput=fe,exports.SidebarInset=Ve,exports.SidebarMenu=ia,exports.SidebarMenuAction=fa,exports.SidebarMenuBadge=ba,exports.SidebarMenuButton=ua,exports.SidebarMenuItem=la,exports.SidebarMenuItemCollapse=xa,exports.SidebarMenuItemTitle=ga,exports.SidebarMenuSkeleton=pa,exports.SidebarMenuSub=ha,exports.SidebarMenuSubButton=ya,exports.SidebarMenuSubItem=va,exports.SidebarProvider=Be,exports.SidebarRail=We,exports.SidebarSeparator=Ye,exports.SidebarTrigger=Ge,exports.useSidebar=I,exports.useSidebarSearch=ue;