@medway-ui/core 1.45.0 → 1.47.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.
@@ -0,0 +1,47 @@
1
+ import { type ComponentPropsWithoutRef, type ReactNode } from "react";
2
+ type CardOptionSize = "md" | "lg";
3
+ type CardOptionIndicator = "radio" | "checkbox";
4
+ declare const cardOptionVariants: (props?: ({
5
+ size?: "md" | "lg" | null | undefined;
6
+ emphasis?: boolean | null | undefined;
7
+ interactive?: boolean | null | undefined;
8
+ disabled?: boolean | null | undefined;
9
+ } & ({ class: import("clsx").ClassValue; className?: never } | { class?: never; className: import("clsx").ClassValue } | { class?: never; className?: never })) | undefined) => string;
10
+ interface CardOptionGroupBaseProps {
11
+ disabled?: boolean;
12
+ size?: CardOptionSize;
13
+ className?: string;
14
+ children: ReactNode;
15
+ "aria-label"?: string;
16
+ }
17
+ interface CardOptionGroupSingleProps extends CardOptionGroupBaseProps {
18
+ type: "single";
19
+ value?: string;
20
+ defaultValue?: string;
21
+ onValueChange?: (value: string) => void;
22
+ }
23
+ interface CardOptionGroupMultipleProps extends CardOptionGroupBaseProps {
24
+ type: "multiple";
25
+ value?: string[];
26
+ defaultValue?: string[];
27
+ onValueChange?: (value: string[]) => void;
28
+ max?: number;
29
+ }
30
+ type CardOptionGroupProps = CardOptionGroupSingleProps | CardOptionGroupMultipleProps;
31
+ declare const CardOptionGroup: import("react").ForwardRefExoticComponent<CardOptionGroupProps & import("react").RefAttributes<HTMLDivElement>>;
32
+ interface CardOptionProps extends Omit<ComponentPropsWithoutRef<"button">, "value" | "children" | "disabled" | "onClick" | "type"> {
33
+ value: string;
34
+ label?: string;
35
+ children?: ReactNode;
36
+ description?: string;
37
+ disabled?: boolean;
38
+ readOnly?: boolean;
39
+ emphasis?: boolean;
40
+ className?: string;
41
+ indicator?: CardOptionIndicator;
42
+ checked?: boolean;
43
+ onCheckedChange?: (checked: boolean) => void;
44
+ }
45
+ declare const CardOption: import("react").ForwardRefExoticComponent<CardOptionProps & import("react").RefAttributes<HTMLButtonElement>>;
46
+ export { CardOption, CardOptionGroup, cardOptionVariants };
47
+ export type { CardOptionProps, CardOptionGroupProps, CardOptionSize, CardOptionIndicator, };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ "use client";
3
+ "use strict";var d=require("react/jsx-runtime"),p=require("react"),M=require("radix-ui"),K=require("@medway-ui/icons"),Q=require("class-variance-authority"),T=require("./Checkbox.js"),W=require("./RadioGroup.js"),S=require("../hooks/use-id.js"),x=require("../lib/utils.js"),X=Object.defineProperty,Z=Object.defineProperties,_=Object.getOwnPropertyDescriptors,V=Object.getOwnPropertySymbols,D=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,U=(a,e,r)=>e in a?X(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r,n=(a,e)=>{for(var r in e||(e={}))D.call(e,r)&&U(a,r,e[r]);if(V)for(var r of V(e))E.call(e,r)&&U(a,r,e[r]);return a},y=(a,e)=>Z(a,_(e)),G=(a,e)=>{var r={};for(var l in a)D.call(a,l)&&e.indexOf(l)<0&&(r[l]=a[l]);if(a!=null&&V)for(var l of V(a))e.indexOf(l)<0&&E.call(a,l)&&(r[l]=a[l]);return r};const A=Q.cva("flex w-full min-h-12 items-center gap-3 rounded-md border-2 border-gray-stroke-muted bg-surface-card px-4 py-3 text-left outline-none transition-colors focus-visible:ring-4 focus-visible:ring-state-focus",{variants:{size:{md:"",lg:""},emphasis:{true:"data-[state=checked]:border-primary-foreground",false:""},interactive:{true:"cursor-pointer hover:bg-state-hover",false:"cursor-default"},disabled:{true:"cursor-not-allowed",false:""}},defaultVariants:{size:"md",emphasis:!0,interactive:!0,disabled:!1}}),Y={md:"text-sm leading-sm",lg:"text-md leading-md"},ee={md:"size-1.5",lg:"size-2"},B="pointer-events-none data-[disabled]:bg-gray-background-soft-muted data-[disabled]:border-gray-stroke-muted data-[disabled]:data-[state=checked]:bg-gray-background-soft-muted data-[disabled]:data-[state=checked]:border-gray-stroke-muted",I=p.createContext(null);function F(a,e,r){const[l,o]=p.useState(e),v=a!==void 0,t=v?a:l,f=p.useCallback(c=>{v||o(c),r==null||r(c)},[v,r]);return[t,f]}const ae=p.forwardRef(function(a,e){return a.type==="single"?d.jsx(re,n({ref:e},a)):d.jsx(le,n({ref:e},a))}),re=p.forwardRef(function(a,e){var r=a,{value:l,defaultValue:o,onValueChange:v,disabled:t=!1,size:f="md",className:c,children:j,type:O}=r,z=G(r,["value","defaultValue","onValueChange","disabled","size","className","children","type"]);const[h,i]=F(l,o,v),m=p.useMemo(()=>({type:"single",size:f,disabled:t,isChecked:b=>b===h,isLocked:()=>!1,toggle:b=>i(b)}),[f,t,h,i]);return d.jsx(I.Provider,{value:m,children:d.jsx(M.RadioGroup.Root,y(n({ref:e,"data-slot":"card-option-group",value:h!=null?h:"",onValueChange:i,disabled:t,className:x.cn("flex w-full flex-col gap-2",c)},z),{children:j}))})}),le=p.forwardRef(function(a,e){var r=a,{value:l,defaultValue:o=[],onValueChange:v,max:t,disabled:f=!1,size:c="md",className:j,children:O,type:z}=r,h=G(r,["value","defaultValue","onValueChange","max","disabled","size","className","children","type"]);const[i,m]=F(l,o,v),b=t!==void 0&&i.length>=t,w=p.useMemo(()=>({type:"multiple",size:c,disabled:f,isChecked:u=>i.includes(u),isLocked:u=>b&&!i.includes(u),toggle:u=>{i.includes(u)?m(i.filter(N=>N!==u)):b||m([...i,u])}}),[c,f,i,b,m]);return d.jsx(I.Provider,{value:w,children:d.jsx("div",y(n({ref:e,role:"group","data-slot":"card-option-group","data-disabled":f?"":void 0,className:x.cn("flex w-full flex-col gap-2",j)},h),{children:O}))})});function de({indicator:a,size:e,checked:r,disabled:l}){const o={"data-slot":"card-option-indicator","data-state":r?"checked":"unchecked","data-disabled":l?"":void 0,"aria-hidden":!0};return a==="checkbox"?d.jsx("span",y(n({},o),{className:x.cn(T.checkboxVariants({size:e}),B),children:r&&d.jsx(K.Check,{className:l?"text-gray-background-fill-muted":"text-primary-foreground-onfill",strokeWidth:2.6})})):d.jsx("span",y(n({},o),{className:x.cn(W.radioGroupVariants({size:e}),"aspect-square rounded-full",B),children:r&&d.jsx("span",{className:x.cn("block rounded-full",ee[e],l?"bg-gray-background-fill-muted":"bg-primary-foreground-onfill")})}))}const ie=p.forwardRef(function(a,e){var r=a,{value:l,label:o,children:v,description:t,disabled:f=!1,readOnly:c=!1,emphasis:j=!0,className:O,indicator:z="radio",checked:h=!1,onCheckedChange:i,"aria-label":m,"aria-labelledby":b,"aria-describedby":w}=r,u=G(r,["value","label","children","description","disabled","readOnly","emphasis","className","indicator","checked","onCheckedChange","aria-label","aria-labelledby","aria-describedby"]),N;const s=p.useContext(I),L=S.useId(),$=S.useId(),q=(N=s==null?void 0:s.size)!=null?N:"md",C=s?s.type==="single"?"radio":"checkbox":z,k=s?s.isChecked(l):h,g=!!(f||s!=null&&s.disabled||s!=null&&s.isLocked(l)),H=!c&&!g,P=d.jsxs(d.Fragment,{children:[d.jsx(de,{indicator:C,size:q,checked:k,disabled:g}),d.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[d.jsx("span",{id:L,"data-slot":"card-option-label",className:x.cn("font-medium",Y[q],g?"text-gray-foreground-muted":"text-gray-foreground"),children:o!=null?o:v}),t&&d.jsx("span",{id:$,"data-slot":"card-option-description",className:"text-xs leading-xs text-gray-foreground-muted",children:t})]})]}),R={"data-slot":"card-option","data-state":k?"checked":"unchecked","data-disabled":g?"":void 0,"data-readonly":c?"":void 0,"aria-label":m,"aria-labelledby":b!=null?b:m?void 0:L,"aria-describedby":[w,t?$:void 0].filter(Boolean).join(" ")||void 0,className:x.cn(A({size:q,emphasis:j&&!g,interactive:H,disabled:g}),O)};if(c)return d.jsx("div",y(n(n({},u),R),{ref:e,role:C,"aria-checked":k,"aria-disabled":g||void 0,"aria-readonly":C==="checkbox"?!0:void 0,children:P}));if((s==null?void 0:s.type)==="single")return d.jsx(M.RadioGroup.Item,y(n(n({},u),R),{ref:e,value:l,disabled:g,children:P}));const J=()=>{s?s.toggle(l):C==="checkbox"?i==null||i(!k):k||i==null||i(!0)};return d.jsx("button",y(n(n({},u),R),{ref:e,type:"button",role:C,"aria-checked":k,value:l,disabled:g,onClick:J,children:P}))});exports.CardOption=ie,exports.CardOptionGroup=ae,exports.cardOptionVariants=A;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ "use client";
3
+ import{jsx as i,jsxs as D,Fragment as X}from"react/jsx-runtime";import{createContext as Z,forwardRef as V,useMemo as E,useContext as _,useState as A,useCallback as Y}from"react";import{RadioGroup as M}from"radix-ui";import{Check as $}from"@medway-ui/icons";import{cva as ee}from"class-variance-authority";import{checkboxVariants as ae}from"./Checkbox.mjs";import{radioGroupVariants as re}from"./RadioGroup.mjs";import{useId as B}from"../hooks/use-id.mjs";import{cn as v}from"../lib/utils.mjs";var le=Object.defineProperty,de=Object.defineProperties,ie=Object.getOwnPropertyDescriptors,w=Object.getOwnPropertySymbols,F=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable,J=(a,e,r)=>e in a?le(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r,n=(a,e)=>{for(var r in e||(e={}))F.call(e,r)&&J(a,r,e[r]);if(w)for(var r of w(e))H.call(e,r)&&J(a,r,e[r]);return a},y=(a,e)=>de(a,ie(e)),R=(a,e)=>{var r={};for(var l in a)F.call(a,l)&&e.indexOf(l)<0&&(r[l]=a[l]);if(a!=null&&w)for(var l of w(a))e.indexOf(l)<0&&H.call(a,l)&&(r[l]=a[l]);return r};const K=ee("flex w-full min-h-12 items-center gap-3 rounded-md border-2 border-gray-stroke-muted bg-surface-card px-4 py-3 text-left outline-none transition-colors focus-visible:ring-4 focus-visible:ring-state-focus",{variants:{size:{md:"",lg:""},emphasis:{true:"data-[state=checked]:border-primary-foreground",false:""},interactive:{true:"cursor-pointer hover:bg-state-hover",false:"cursor-default"},disabled:{true:"cursor-not-allowed",false:""}},defaultVariants:{size:"md",emphasis:!0,interactive:!0,disabled:!1}}),te={md:"text-sm leading-sm",lg:"text-md leading-md"},se={md:"size-1.5",lg:"size-2"},Q="pointer-events-none data-[disabled]:bg-gray-background-soft-muted data-[disabled]:border-gray-stroke-muted data-[disabled]:data-[state=checked]:bg-gray-background-soft-muted data-[disabled]:data-[state=checked]:border-gray-stroke-muted",I=Z(null);function T(a,e,r){const[l,o]=A(e),p=a!==void 0,s=p?a:l,f=Y(c=>{p||o(c),r==null||r(c)},[p,r]);return[s,f]}const ne=V(function(a,e){return a.type==="single"?i(oe,n({ref:e},a)):i(ce,n({ref:e},a))}),oe=V(function(a,e){var r=a,{value:l,defaultValue:o,onValueChange:p,disabled:s=!1,size:f="md",className:c,children:x,type:O}=r,z=R(r,["value","defaultValue","onValueChange","disabled","size","className","children","type"]);const[g,d]=T(l,o,p),h=E(()=>({type:"single",size:f,disabled:s,isChecked:b=>b===g,isLocked:()=>!1,toggle:b=>d(b)}),[f,s,g,d]);return i(I.Provider,{value:h,children:i(M.Root,y(n({ref:e,"data-slot":"card-option-group",value:g!=null?g:"",onValueChange:d,disabled:s,className:v("flex w-full flex-col gap-2",c)},z),{children:x}))})}),ce=V(function(a,e){var r=a,{value:l,defaultValue:o=[],onValueChange:p,max:s,disabled:f=!1,size:c="md",className:x,children:O,type:z}=r,g=R(r,["value","defaultValue","onValueChange","max","disabled","size","className","children","type"]);const[d,h]=T(l,o,p),b=s!==void 0&&d.length>=s,j=E(()=>({type:"multiple",size:c,disabled:f,isChecked:u=>d.includes(u),isLocked:u=>b&&!d.includes(u),toggle:u=>{d.includes(u)?h(d.filter(N=>N!==u)):b||h([...d,u])}}),[c,f,d,b,h]);return i(I.Provider,{value:j,children:i("div",y(n({ref:e,role:"group","data-slot":"card-option-group","data-disabled":f?"":void 0,className:v("flex w-full flex-col gap-2",x)},g),{children:O}))})});function ue({indicator:a,size:e,checked:r,disabled:l}){const o={"data-slot":"card-option-indicator","data-state":r?"checked":"unchecked","data-disabled":l?"":void 0,"aria-hidden":!0};return a==="checkbox"?i("span",y(n({},o),{className:v(ae({size:e}),Q),children:r&&i($,{className:l?"text-gray-background-fill-muted":"text-primary-foreground-onfill",strokeWidth:2.6})})):i("span",y(n({},o),{className:v(re({size:e}),"aspect-square rounded-full",Q),children:r&&i("span",{className:v("block rounded-full",se[e],l?"bg-gray-background-fill-muted":"bg-primary-foreground-onfill")})}))}const fe=V(function(a,e){var r=a,{value:l,label:o,children:p,description:s,disabled:f=!1,readOnly:c=!1,emphasis:x=!0,className:O,indicator:z="radio",checked:g=!1,onCheckedChange:d,"aria-label":h,"aria-labelledby":b,"aria-describedby":j}=r,u=R(r,["value","label","children","description","disabled","readOnly","emphasis","className","indicator","checked","onCheckedChange","aria-label","aria-labelledby","aria-describedby"]),N;const t=_(I),S=B(),q=B(),P=(N=t==null?void 0:t.size)!=null?N:"md",C=t?t.type==="single"?"radio":"checkbox":z,k=t?t.isChecked(l):g,m=!!(f||t!=null&&t.disabled||t!=null&&t.isLocked(l)),U=!c&&!m,G=D(X,{children:[i(ue,{indicator:C,size:P,checked:k,disabled:m}),D("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[i("span",{id:S,"data-slot":"card-option-label",className:v("font-medium",te[P],m?"text-gray-foreground-muted":"text-gray-foreground"),children:o!=null?o:p}),s&&i("span",{id:q,"data-slot":"card-option-description",className:"text-xs leading-xs text-gray-foreground-muted",children:s})]})]}),L={"data-slot":"card-option","data-state":k?"checked":"unchecked","data-disabled":m?"":void 0,"data-readonly":c?"":void 0,"aria-label":h,"aria-labelledby":b!=null?b:h?void 0:S,"aria-describedby":[j,s?q:void 0].filter(Boolean).join(" ")||void 0,className:v(K({size:P,emphasis:x&&!m,interactive:U,disabled:m}),O)};if(c)return i("div",y(n(n({},u),L),{ref:e,role:C,"aria-checked":k,"aria-disabled":m||void 0,"aria-readonly":C==="checkbox"?!0:void 0,children:G}));if((t==null?void 0:t.type)==="single")return i(M.Item,y(n(n({},u),L),{ref:e,value:l,disabled:m,children:G}));const W=()=>{t?t.toggle(l):C==="checkbox"?d==null||d(!k):k||d==null||d(!0)};return i("button",y(n(n({},u),L),{ref:e,type:"button",role:C,"aria-checked":k,value:l,disabled:m,onClick:W,children:G}))});export{fe as CardOption,ne as CardOptionGroup,K as cardOptionVariants};
@@ -0,0 +1,16 @@
1
+ import { type ComponentProps, type ReactNode } from "react";
2
+ interface CardTestimonialProps extends Omit<ComponentProps<"figure">, "children"> {
3
+ name: string;
4
+ quote: string;
5
+ /** Cargo da pessoa. O `role` de acessibilidade continua indo para o `figure`. */
6
+ jobTitle?: string;
7
+ organization?: string;
8
+ separator?: string;
9
+ avatarSrc?: string;
10
+ avatarFallback?: string;
11
+ footer?: ReactNode;
12
+ }
13
+ declare function cardTestimonialInitials(name: string): string;
14
+ declare const CardTestimonial: import("react").ForwardRefExoticComponent<Omit<CardTestimonialProps, "ref"> & import("react").RefAttributes<HTMLElement>>;
15
+ export { CardTestimonial, cardTestimonialInitials };
16
+ export type { CardTestimonialProps };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ "use client";
3
+ "use strict";var l=require("react/jsx-runtime"),y=require("react"),N=require("./Avatar.js"),O=require("../lib/utils.js"),q=Object.defineProperty,w=Object.defineProperties,k=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,p=(a,e,r)=>e in a?q(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r,P=(a,e)=>{for(var r in e||(e={}))f.call(e,r)&&p(a,r,e[r]);if(s)for(var r of s(e))u.call(e,r)&&p(a,r,e[r]);return a},T=(a,e)=>w(a,k(e)),C=(a,e)=>{var r={};for(var t in a)f.call(a,t)&&e.indexOf(t)<0&&(r[t]=a[t]);if(a!=null&&s)for(var t of s(a))e.indexOf(t)<0&&u.call(a,t)&&(r[t]=a[t]);return r};function x(a){return a.trim().split(/\s+/).slice(0,2).map(e=>e.charAt(0)).join("").toUpperCase()}const z=y.forwardRef(function(a,e){var r=a,{name:t,quote:b,jobTitle:c,organization:d,separator:g=" - ",avatarSrc:v,avatarFallback:m,footer:o,className:j}=r,h=C(r,["name","quote","jobTitle","organization","separator","avatarSrc","avatarFallback","footer","className"]);const i=!!c,n=!!d;return l.jsxs("figure",T(P({ref:e,"data-slot":"card-testimonial",className:O.cn("flex w-full flex-col gap-6 rounded-lg border border-gray-stroke-muted bg-surface-card p-6",j)},h),{children:[l.jsxs("figcaption",{"data-slot":"card-testimonial-header",className:"flex items-center gap-4",children:[l.jsx(N.Avatar,{size:"xl",src:v,alt:"",fallback:m!=null?m:x(t)}),l.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[l.jsx("span",{"data-slot":"card-testimonial-name",className:"text-lg font-semibold leading-lg text-primary-foreground",children:t}),(i||n)&&l.jsxs("span",{"data-slot":"card-testimonial-job-title",className:"text-sm font-regular leading-sm text-gray-foreground",children:[i&&c,i&&n&&g,n&&l.jsx("span",{className:"font-semibold",children:d})]})]})]}),l.jsxs("blockquote",{"data-slot":"card-testimonial-quote",className:"flex gap-2",children:[l.jsx("span",{"aria-hidden":"true","data-slot":"card-testimonial-quote-mark",className:"text-display-sm font-extrabold leading-display-sm text-secondary-stroke-emphasis",children:"\u201C"}),l.jsx("p",{className:"min-w-0 flex-1 pt-4 text-md font-semibold leading-md text-primary-foreground",children:b})]}),o!=null&&o!==!1&&l.jsx("div",{"data-slot":"card-testimonial-footer",children:o})]}))});exports.CardTestimonial=z,exports.cardTestimonialInitials=x;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ "use client";
3
+ import{jsxs as o,jsx as l}from"react/jsx-runtime";import{forwardRef as N}from"react";import{Avatar as O}from"./Avatar.mjs";import{cn as w}from"../lib/utils.mjs";var k=Object.defineProperty,q=Object.defineProperties,P=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,b=(a,e,r)=>e in a?k(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r,T=(a,e)=>{for(var r in e||(e={}))p.call(e,r)&&b(a,r,e[r]);if(i)for(var r of i(e))u.call(e,r)&&b(a,r,e[r]);return a},C=(a,e)=>q(a,P(e)),z=(a,e)=>{var r={};for(var t in a)p.call(a,t)&&e.indexOf(t)<0&&(r[t]=a[t]);if(a!=null&&i)for(var t of i(a))e.indexOf(t)<0&&u.call(a,t)&&(r[t]=a[t]);return r};function g(a){return a.trim().split(/\s+/).slice(0,2).map(e=>e.charAt(0)).join("").toUpperCase()}const S=N(function(a,e){var r=a,{name:t,quote:x,jobTitle:d,organization:m,separator:v=" - ",avatarSrc:h,avatarFallback:f,footer:s,className:y}=r,j=z(r,["name","quote","jobTitle","organization","separator","avatarSrc","avatarFallback","footer","className"]);const n=!!d,c=!!m;return o("figure",C(T({ref:e,"data-slot":"card-testimonial",className:w("flex w-full flex-col gap-6 rounded-lg border border-gray-stroke-muted bg-surface-card p-6",y)},j),{children:[o("figcaption",{"data-slot":"card-testimonial-header",className:"flex items-center gap-4",children:[l(O,{size:"xl",src:h,alt:"",fallback:f!=null?f:g(t)}),o("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[l("span",{"data-slot":"card-testimonial-name",className:"text-lg font-semibold leading-lg text-primary-foreground",children:t}),(n||c)&&o("span",{"data-slot":"card-testimonial-job-title",className:"text-sm font-regular leading-sm text-gray-foreground",children:[n&&d,n&&c&&v,c&&l("span",{className:"font-semibold",children:m})]})]})]}),o("blockquote",{"data-slot":"card-testimonial-quote",className:"flex gap-2",children:[l("span",{"aria-hidden":"true","data-slot":"card-testimonial-quote-mark",className:"text-display-sm font-extrabold leading-display-sm text-secondary-stroke-emphasis",children:"\u201C"}),l("p",{className:"min-w-0 flex-1 pt-4 text-md font-semibold leading-md text-primary-foreground",children:x})]}),s!=null&&s!==!1&&l("div",{"data-slot":"card-testimonial-footer",children:s})]}))});export{S as CardTestimonial,g as cardTestimonialInitials};
@@ -29,6 +29,7 @@ interface CarouselProps extends Omit<ComponentProps<"div">, "aria-label"> {
29
29
  controlsFrom?: CarouselControlsFrom;
30
30
  edgeBehavior?: CarouselEdgeBehavior;
31
31
  hideControlsWhenFits?: boolean;
32
+ wheelGestures?: boolean;
32
33
  index?: number;
33
34
  defaultIndex?: number;
34
35
  onIndexChange?: (index: number) => void;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  "use client";
3
- "use strict";var f=require("react/jsx-runtime"),Qe=require("embla-carousel-autoplay"),et=require("embla-carousel-fade"),tt=require("embla-carousel-react"),G=require("class-variance-authority"),B=require("@medway-ui/icons"),a=require("react"),ke=require("./Button.js"),ot=require("../hooks/use-composed-refs.js"),nt=require("../hooks/use-prefers-reduced-motion.js"),w=require("../lib/utils.js"),rt=Object.defineProperty,at=Object.defineProperties,lt=Object.getOwnPropertyDescriptors,ne=Object.getOwnPropertySymbols,je=Object.prototype.hasOwnProperty,Ae=Object.prototype.propertyIsEnumerable,Oe=(e,t,o)=>t in e?rt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,S=(e,t)=>{for(var o in t||(t={}))je.call(t,o)&&Oe(e,o,t[o]);if(ne)for(var o of ne(t))Ae.call(t,o)&&Oe(e,o,t[o]);return e},A=(e,t)=>at(e,lt(t)),W=(e,t)=>{var o={};for(var r in e)je.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&ne)for(var r of ne(e))t.indexOf(r)<0&&Ae.call(e,r)&&(o[r]=e[r]);return o};const it=5e3,Le="data-consumer-inert",st={selectedIndex:0,snapCount:0,canScrollPrev:!1,canScrollNext:!1,slideCount:0,snapFirstSlides:[],announcement:""},ct={horizontal:{ArrowLeft:"previous",ArrowRight:"next"},vertical:{ArrowUp:"previous",ArrowDown:"next"}},ut=["TEXTAREA","SELECT","VIDEO","AUDIO"],dt=["button","checkbox","color","file","image","reset","submit"],ft=["combobox","grid","listbox","menu","menubar","radiogroup","searchbox","slider","spinbutton","tablist","textbox","toolbar","tree","treegrid"],vt={horizontal:{previous:B.ArrowLeftMd,next:B.ArrowRightMd},vertical:{previous:B.ArrowUpMd,next:B.ArrowDownMd}},pt={previous:"Anterior",next:"Pr\xF3ximo"},gt={none:{horizontal:{content:"",item:"",focusRing:""},vertical:{content:"",item:"",focusRing:""}},xs:{horizontal:{content:"-ml-2",item:"pl-2",focusRing:"focus-visible:after:left-2"},vertical:{content:"-mt-2",item:"pt-2",focusRing:"focus-visible:after:top-2"}},sm:{horizontal:{content:"-ml-3",item:"pl-3",focusRing:"focus-visible:after:left-3"},vertical:{content:"-mt-3",item:"pt-3",focusRing:"focus-visible:after:top-3"}},md:{horizontal:{content:"-ml-4",item:"pl-4",focusRing:"focus-visible:after:left-4"},vertical:{content:"-mt-4",item:"pt-4",focusRing:"focus-visible:after:top-4"}},lg:{horizontal:{content:"-ml-6",item:"pl-6",focusRing:"focus-visible:after:left-6"},vertical:{content:"-mt-6",item:"pt-6",focusRing:"focus-visible:after:top-6"}},xl:{horizontal:{content:"-ml-8",item:"pl-8",focusRing:"focus-visible:after:left-8"},vertical:{content:"-mt-8",item:"pt-8",focusRing:"focus-visible:after:top-8"}}},K=["side","floating","outside"],mt=G.cva("relative",{variants:{orientation:{horizontal:"",vertical:""},controls:{side:"",floating:"",outside:"",inline:""}},compoundVariants:[{orientation:"horizontal",controls:K,class:"grid grid-flow-row-dense grid-cols-[auto_minmax(0,1fr)_auto] items-center [&>*]:col-span-full"},{orientation:"vertical",controls:K,class:"flex flex-col"}]}),ht=G.cva("relative overflow-hidden",{variants:{orientation:{horizontal:"",vertical:""},controls:{side:"",floating:"",outside:"",inline:""}},compoundVariants:[{orientation:"horizontal",controls:K,class:"!col-start-2 !col-span-1 min-w-0"}]}),bt=G.cva("relative z-10 shrink-0",{variants:{orientation:{horizontal:"",vertical:""},controls:{side:"",floating:"",outside:"",inline:""},direction:{previous:"",next:""},controlsFrom:{always:"",md:"hidden md:block",lg:"hidden lg:block"}},compoundVariants:[{orientation:"horizontal",controls:K,direction:"previous",class:"!col-start-1 !col-span-1"},{orientation:"horizontal",controls:K,direction:"next",class:"!col-start-3 !col-span-1"},{orientation:"horizontal",controls:"side",direction:"previous",class:"mr-2"},{orientation:"horizontal",controls:"side",direction:"next",class:"ml-2"},{orientation:"horizontal",controls:["floating","outside"],class:"w-0"},{orientation:"vertical",controls:K,class:"self-center"},{orientation:"vertical",controls:"side",direction:"previous",class:"mb-2"},{orientation:"vertical",controls:"side",direction:"next",class:"mt-2"},{orientation:"vertical",controls:["floating","outside"],class:"h-0"}]}),xt=G.cva("touch-manipulation disabled:opacity-50 dark:disabled:opacity-30",{variants:{orientation:{horizontal:"",vertical:""},controls:{side:"",floating:"",outside:"",inline:""},direction:{previous:"",next:""},opaque:{true:"",false:""}},compoundVariants:[{controls:["floating","outside"],class:"disabled:pointer-events-auto disabled:cursor-default"},{controls:"floating",class:"shadow-level-1"},{controls:"floating",opaque:!0,class:"bg-surface-elevated dark:bg-surface-elevated disabled:hover:bg-surface-elevated"},{controls:"outside",opaque:!0,class:"disabled:hover:bg-transparent"},{controls:["floating","outside"],opaque:!0,class:"disabled:hover:dark:border-gray-stroke-muted"},{orientation:"horizontal",controls:["floating","outside"],class:"absolute top-1/2 -translate-y-1/2"},{orientation:"horizontal",controls:"floating",direction:"previous",class:"left-2"},{orientation:"horizontal",controls:"floating",direction:"next",class:"right-2"},{orientation:"horizontal",controls:"outside",direction:"previous",class:"right-2"},{orientation:"horizontal",controls:"outside",direction:"next",class:"left-2"},{orientation:"vertical",controls:["floating","outside"],class:"absolute left-1/2 -translate-x-1/2"},{orientation:"vertical",controls:"floating",direction:"previous",class:"top-2"},{orientation:"vertical",controls:"floating",direction:"next",class:"bottom-2"},{orientation:"vertical",controls:"outside",direction:"previous",class:"bottom-2"},{orientation:"vertical",controls:"outside",direction:"next",class:"top-2"}]}),Te=G.cva("pointer-events-none absolute z-[1] transition-opacity duration-200 motion-reduce:transition-none",{variants:{orientation:{horizontal:"inset-y-0 w-8",vertical:"inset-x-0 h-8"},edge:{start:"",end:""},visible:{true:"opacity-100",false:"opacity-0"}},compoundVariants:[{orientation:"horizontal",edge:"start",class:"left-0 bg-gradient-to-r from-background to-transparent"},{orientation:"horizontal",edge:"end",class:"right-0 bg-gradient-to-l from-background to-transparent"},{orientation:"vertical",edge:"start",class:"top-0 bg-gradient-to-b from-background to-transparent"},{orientation:"vertical",edge:"end",class:"bottom-0 bg-gradient-to-t from-background to-transparent"}]}),yt="focus:outline-0 focus-visible:after:pointer-events-none focus-visible:after:absolute focus-visible:after:inset-0 focus-visible:after:ring-[3px] focus-visible:after:ring-inset focus-visible:after:ring-state-focus",Ct="group flex size-6 items-center justify-center rounded-pill hover:cursor-pointer focus:outline-0 focus-visible:ring-4 focus-visible:ring-state-focus",Nt="h-2 w-2 rounded-pill bg-gray-stroke transition-[width,background-color] duration-200 motion-reduce:transition-none group-hover:data-[active=false]:bg-gray-stroke-emphasis data-[active=true]:w-4 data-[active=true]:bg-primary-background-fill",ge=a.createContext(null),Me=a.createContext(null);function J(){const e=a.useContext(ge);if(!e)throw new Error("useCarousel must be used within a Carousel component.");return e}function St(){const{selectedIndex:e,snapCount:t,canScrollPrev:o,canScrollNext:r,isScrollable:c,scrollPrev:v,scrollNext:u,scrollTo:p,autoplay:s}=J();return a.useMemo(()=>({selectedIndex:e,snapCount:t,canScrollPrev:o,canScrollNext:r,isScrollable:c,scrollPrev:v,scrollNext:u,scrollTo:p,autoplay:s}),[e,t,o,r,c,v,u,p,s])}function wt(e){return{selectedIndex:e.selectedScrollSnap(),snapCount:e.scrollSnapList().length,canScrollPrev:e.canScrollPrev(),canScrollNext:e.canScrollNext(),slideCount:e.slideNodes().length,snapFirstSlides:e.internalEngine().slideRegistry.map((t,o)=>{var r;return(r=t[0])!=null?r:o})}}function Rt(e,t){return e.selectedIndex===t.selectedIndex&&e.snapCount===t.snapCount&&e.canScrollPrev===t.canScrollPrev&&e.canScrollNext===t.canScrollNext&&e.slideCount===t.slideCount&&e.snapFirstSlides.length===t.snapFirstSlides.length&&e.snapFirstSlides.every((o,r)=>o===t.snapFirstSlides[r])&&e.announcement===t.announcement}function Pt(e,t){const o=Object.keys(e);return o.length===Object.keys(t).length&&o.every(r=>Object.is(e[r],t[r]))}function qe(e,t){return Number.isFinite(e)&&e>=1?Math.trunc(e):t}function me(e){if(!(e===void 0||!Number.isFinite(e)))return Math.max(0,Math.trunc(e))}function De(e,t=""){return a.Children.toArray(e).flatMap(o=>{var r;if(!a.isValidElement(o))return[];const c=`${t}${(r=o.key)!=null?r:""}`;return o.type===a.Fragment?De(o.props.children,`${c}/`):[a.cloneElement(o,{key:c})]})}function Et(e,t,o){const r=document.activeElement;return r===o&&!e.canScrollNext&&e.canScrollPrev?"previous":r===t&&!e.canScrollPrev&&e.canScrollNext?"next":null}function zt(e,t){const o=getComputedStyle(e);return t==="horizontal"?/auto|scroll/.test(o.overflowX)&&e.scrollWidth>e.clientWidth:/auto|scroll/.test(o.overflowY)&&e.scrollHeight>e.clientHeight}function It(e,t){var o;return e instanceof HTMLElement&&e.isContentEditable||e instanceof HTMLInputElement&&!dt.includes(e.type)||ut.includes(e.tagName)||ft.includes((o=e.getAttribute("role"))!=null?o:"")||zt(e,t)}function Ft(e,t){const o=e.nativeEvent.composedPath();return o.slice(0,o.indexOf(e.currentTarget)).some(r=>r instanceof Element&&It(r,t))}function kt(e){try{return e.matches(":focus-visible")}catch(t){return!1}}function $e(e){var t;return(t=e.internalEngine().slideRegistry[e.selectedScrollSnap()])!=null?t:[]}function Be(e){return e.hasAttribute(Le)}function We(e){e.getAttribute("tabindex")==="-1"&&e.removeAttribute("tabindex")}function he(e){var t,o;(o=(t=e.plugins())==null?void 0:t.autoplay)==null||o.reset()}function jt(e){const t=typeof e=="object"?e.delay:void 0;return t!==void 0&&Number.isFinite(t)&&t>0?t:it}function Ke(e,t){return e==="page"?t.snapCount!==t.slideCount:qe(e,1)>1}function At(e,t){var o;const r=e.slideNodes().length;if(r===0)return"";const c=e.selectedScrollSnap();return t?`P\xE1gina ${c+1} de ${e.scrollSnapList().length}`:`Slide ${((o=$e(e)[0])!=null?o:c)+1} de ${r}`}function Ot(e,t){return t?`Ir para a p\xE1gina ${e+1}`:`Ir para o slide ${e+1}`}const Lt=a.forwardRef(function(e,t){const o=e,{orientation:r="horizontal",align:c="start",step:v=1,loop:u=!1,dragFree:p=!1,transition:s="slide",autoplay:h=!1,controls:b="side",controlsFrom:d="always",edgeBehavior:R="disable",hideControlsWhenFits:z=!0,index:F,defaultIndex:k,onIndexChange:x,setApi:P,opts:E,className:M,children:q,onKeyDown:O,onFocus:V,onPointerEnter:H,onPointerLeave:Y}=o,re=W(o,["orientation","align","step","loop","dragFree","transition","autoplay","controls","controlsFrom","edgeBehavior","hideControlsWhenFits","index","defaultIndex","onIndexChange","setApi","opts","className","children","onKeyDown","onFocus","onPointerEnter","onPointerLeave"]),C=nt.usePrefersReducedMotion(),j=h!==!1,U=jt(h),L=me(F),[ae]=a.useState(()=>{var n;return(n=L!=null?L:me(k))!=null?n:0}),He=a.useMemo(()=>{const n=[];return j&&n.push(Qe({delay:U,playOnInit:!1,stopOnInteraction:!0,stopOnFocusIn:!1,stopOnMouseEnter:!1})),s==="fade"&&n.push(et()),n},[j,U,s]),[be,l]=tt(A(S({containScroll:"trimSnaps"},E),{axis:r==="horizontal"?"x":"y",align:c,loop:u,dragFree:p,slidesToScroll:v==="page"?"auto":qe(v,1),startIndex:ae}),He),[_,Ue]=a.useState(()=>A(S({},st),{selectedIndex:ae})),[le,xe]=a.useState(null),[_e,ye]=a.useState(!1),ie=a.useRef(null),se=a.useRef(null),ce=a.useRef(null),ue=a.useRef(!1),T=a.useRef(ae),de=a.useRef(x),Ce=a.useRef(v),Ne=a.useRef(null),Z=a.useRef(null),Q=_.snapCount>1,Se=Ke(v,_),X=le?le==="paused":C,D=j&&Q&&!X&&!_e,we=a.useRef(D),ee=a.useRef(null),Re=a.useRef(C),te=a.useCallback(()=>{l&&(l.scrollPrev(C),he(l))},[l,C]),oe=a.useCallback(()=>{l&&(l.scrollNext(C),he(l))},[l,C]),fe=a.useCallback(n=>{if(!l)return;const i=n!==l.selectedScrollSnap();l.scrollTo(n,C),i&&he(l)},[l,C]),ve=a.useCallback(n=>{ue.current=!0;try{n==="previous"?te():oe()}finally{ue.current=!1}},[te,oe]),Pe=a.useCallback(()=>{var n;return(n=ee.current)==null?void 0:n.call(ee)},[]),Ee=a.useCallback(()=>xe(X?"playing":"paused"),[X]),Xe=n=>{O==null||O(n);const i=ct[r][n.key];!i||n.defaultPrevented||n.altKey||n.ctrlKey||n.metaKey||n.shiftKey||n.currentTarget.contains(n.target)&&(Ft(n,r)||(n.preventDefault(),ve(i)))},Ge=n=>{V==null||V(n),!(!j||le==="playing")&&kt(n.target)&&xe("paused")},Je=n=>{H==null||H(n),n.pointerType==="mouse"&&ye(!0)},Ye=n=>{Y==null||Y(n),n.pointerType==="mouse"&&ye(!1)},ze=a.useMemo(()=>({isEnabled:j,isPaused:X,isRotating:D,toggle:Ee}),[j,X,D,Ee]),Ze=a.useMemo(()=>A(S({},_),{orientation:r,transition:s,controls:b,controlsFrom:d,edgeBehavior:R,hideControlsWhenFits:z,isPaged:Se,isScrollable:Q,viewportRef:be,previousButtonRef:ie,nextButtonRef:se,scrollPrev:te,scrollNext:oe,scrollTo:fe,scrollFromArrow:ve,syncFadeInert:Pe,autoplay:ze}),[_,r,s,b,d,R,z,Se,Q,be,te,oe,fe,ve,Pe,ze]);return a.useEffect(()=>{de.current=x,Ce.current=v,we.current=D,Re.current=C}),a.useEffect(()=>{l&&P&&P(l)},[l,P]),a.useEffect(()=>{if(!l)return;let n=!1;const i=(N,m)=>{const g=wt(l),$=m==="select"&&n;$&&(n=!1);const Ie=m!=="select"?void 0:$?"":At(l,Ke(Ce.current,g));ce.current=ue.current?Et(g,ie.current,se.current):null,Ue(pe=>{const Fe=A(S({},g),{announcement:Ie!=null?Ie:pe.announcement});return Rt(pe,Fe)?pe:Fe})},y=()=>{const N=Z.current,m=N!==null&&N<l.scrollSnapList().length;m&&(Z.current=null,T.current=N);const g=T.current;if(l.selectedScrollSnap()!==g){n=!m;try{l.scrollTo(g,!0)}finally{n=!1}}},I=()=>{var N;const m=l.selectedScrollSnap();m!==T.current&&(T.current=m,(N=de.current)==null||N.call(de,m))};return T.current=l.selectedScrollSnap(),i(),l.on("reInit",y).on("select",i).on("reInit",i).on("select",I).on("reInit",I),()=>{l.off("reInit",y).off("select",i).off("reInit",i).off("select",I).off("reInit",I)}},[l]),a.useEffect(()=>{var n;const i=ce.current;i&&(ce.current=null,(n=(i==="previous"?ie:se).current)==null||n.focus({preventScroll:!0}))},[_]),a.useEffect(()=>{const n=Ne.current;if(!l||n&&Pt(n,e))return;if(Ne.current=e,L===void 0){Z.current=null;return}const i=l.selectedScrollSnap(),y=L===me(n==null?void 0:n.index);if(i!==T.current&&y)return;const I=Math.max(0,l.scrollSnapList().length-1);Z.current=L>I?L:null;const N=Math.min(L,I);N!==i&&(T.current=N,fe(N))}),a.useEffect(()=>{if(!l||s!=="fade")return;const n=new Set,i=()=>{const y=l.slideNodes(),I=new Set($e(l)),N=y.some((g,$)=>!I.has($)&&g.contains(document.activeElement));y.forEach((g,$)=>{g.inert=!I.has($)||Be(g),g.inert&&n.has(g)&&(We(g),n.delete(g))});const m=N?y.find(g=>!g.inert):void 0;m&&(m.hasAttribute("tabindex")||(m.tabIndex=-1,n.add(m)),m.focus({preventScroll:!0}))};return ee.current=i,i(),l.on("select",i).on("reInit",i),()=>{ee.current=null,l.off("select",i).off("reInit",i);for(const y of l.slideNodes())y.inert=Be(y);n.forEach(We)}},[l,s]),a.useEffect(()=>{var n;const i=(n=l==null?void 0:l.plugins())==null?void 0:n.autoplay;i&&(D?i.play(C):i.stop())},[l,D,C]),a.useEffect(()=>{if(!l)return;const n=()=>{var i,y;we.current&&((y=(i=l.plugins())==null?void 0:i.autoplay)==null||y.play(Re.current))};return l.on("pointerUp",n).on("reInit",n),()=>{l.off("pointerUp",n).off("reInit",n)}},[l]),f.jsx(ge.Provider,{value:Ze,children:f.jsx("div",A(S({ref:t,role:"region","aria-roledescription":"carousel","data-slot":"carousel","data-orientation":r,"data-scrollable":Q,className:w.cn(mt({orientation:r,controls:b}),M),onKeyDown:Xe,onFocus:Ge,onPointerEnter:Je,onPointerLeave:Ye},re),{children:q}))})}),Tt=a.forwardRef(function(e,t){var o=e,{gap:r="md",fadeEdges:c=!1,fadeClassName:v,viewportClassName:u,className:p,children:s}=o,h=W(o,["gap","fadeEdges","fadeClassName","viewportClassName","className","children"]);const{viewportRef:b,orientation:d,controls:R,canScrollPrev:z,canScrollNext:F,announcement:k,autoplay:x}=J(),P=De(s),E=gt[r][d];return f.jsxs("div",{ref:b,"data-slot":"carousel-viewport",className:w.cn(ht({orientation:d,controls:R}),u),children:[f.jsx("div",A(S({ref:t,"data-slot":"carousel-content",className:w.cn("flex touch-pinch-zoom",d==="horizontal"?"touch-pan-y":"touch-pan-x flex-col",E.content,p)},h),{children:P.map((M,q)=>{var O;return f.jsx(Me.Provider,{value:{index:q,total:P.length,gapClassName:E.item,focusRingClassName:E.focusRing},children:M},(O=M.key)!=null?O:q)})})),f.jsx("div",{"data-slot":"carousel-live","aria-live":x.isRotating?"off":"polite","aria-atomic":"true",className:"sr-only",children:k}),c&&f.jsxs(f.Fragment,{children:[f.jsx("div",{"aria-hidden":"true","data-slot":"carousel-fade-start",className:w.cn(Te({orientation:d,edge:"start",visible:z}),v)}),f.jsx("div",{"aria-hidden":"true","data-slot":"carousel-fade-end",className:w.cn(Te({orientation:d,edge:"end",visible:F}),v)})]})]})}),Mt=a.forwardRef(function(e,t){var o=e,{className:r,inert:c}=o,v=W(o,["className","inert"]);const u=a.useContext(Me),p=a.useContext(ge),s=p==null?void 0:p.syncFadeInert,h=(p==null?void 0:p.transition)==="fade",b=!!c||c==="",d={[Le]:b||void 0};return a.useEffect(()=>{s==null||s()},[b,s]),f.jsx("div",S(A(S({ref:t,role:"group","aria-roledescription":"slide","aria-label":u?`${u.index+1} de ${u.total}`:void 0,"data-slot":"carousel-item"},d),{inert:c,className:w.cn("min-w-0 shrink-0 grow-0 basis-full",u==null?void 0:u.gapClassName,h&&yt,h&&(u==null?void 0:u.focusRingClassName),r)}),v))}),Ve=a.forwardRef(function(e,t){var o=e,{direction:r,variant:c="outlined",size:v="md",className:u,containerClassName:p,disabled:s,onClick:h}=o,b=W(o,["direction","variant","size","className","containerClassName","disabled","onClick"]);const{orientation:d,controls:R,controlsFrom:z,edgeBehavior:F,hideControlsWhenFits:k,isScrollable:x,canScrollPrev:P,canScrollNext:E,scrollFromArrow:M,previousButtonRef:q,nextButtonRef:O}=J(),V=r==="previous",H=V?P:E,Y=ot.useComposedRefs(t,V?q:O),re=F==="hide"&&!H||k&&!x,C=vt[d][r],j=U=>{h==null||h(U),!U.defaultPrevented&&M(r)};return f.jsx(ke.Button,S({ref:Y,"data-slot":`carousel-${r}`,variant:c,size:v,"aria-label":pt[r],iconLeft:f.jsx(C,{"aria-hidden":"true"}),disabled:s||!H,containerClassName:w.cn(bt({orientation:d,controls:R,direction:r,controlsFrom:z}),re&&"invisible",p),className:w.cn(xt({orientation:d,controls:R,direction:r,opaque:c==="outlined"}),u),onClick:j},b))}),qt=a.forwardRef(function(e,t){return f.jsx(Ve,S({ref:t,direction:"previous"},e))}),Dt=a.forwardRef(function(e,t){return f.jsx(Ve,S({ref:t,direction:"next"},e))}),$t=a.forwardRef(function(e,t){var o=e,{getDotLabel:r,dotClassName:c,indicatorClassName:v,className:u}=o,p=W(o,["getDotLabel","dotClassName","indicatorClassName","className"]);const{snapCount:s,snapFirstSlides:h,selectedIndex:b,isPaged:d,isScrollable:R,hideControlsWhenFits:z,scrollTo:F}=J();return f.jsx("div",A(S({ref:t,role:"group","aria-label":d?"Escolher p\xE1gina":"Escolher slide","data-slot":"carousel-dots",className:w.cn("mt-2 flex min-h-6 items-center justify-center",z&&!R&&"invisible",u)},p),{children:Array.from({length:s},(k,x)=>{var P;const E=x===b;return f.jsx("button",{type:"button","data-slot":"carousel-dot","data-active":E,"aria-label":r?r(x,s):Ot(d?x:(P=h[x])!=null?P:x,d),"aria-current":E||void 0,onClick:()=>F(x),className:w.cn(Ct,c),children:f.jsx("span",{"data-slot":"carousel-dot-indicator","data-active":E,className:w.cn(Nt,v)})},x)})}))}),Bt=a.forwardRef(function(e,t){var o=e,{variant:r="outlined",size:c="sm",containerClassName:v,onClick:u}=o,p=W(o,["variant","size","containerClassName","onClick"]);const{autoplay:s,isScrollable:h,hideControlsWhenFits:b}=J(),d=s.isPaused?B.Play:B.Pause,R=s.isPaused?"Iniciar rota\xE7\xE3o autom\xE1tica":"Pausar rota\xE7\xE3o autom\xE1tica",z=b&&!h,F=k=>{u==null||u(k),k.defaultPrevented||s.toggle()};return s.isEnabled?f.jsx(ke.Button,S({ref:t,"data-slot":"carousel-autoplay-toggle",variant:r,size:c,"aria-label":R,iconLeft:f.jsx(d,{"aria-hidden":"true"}),containerClassName:w.cn("relative z-10",z&&"invisible",v),onClick:F},p)):null});exports.Carousel=Lt,exports.CarouselAutoplayToggle=Bt,exports.CarouselContent=Tt,exports.CarouselDots=$t,exports.CarouselItem=Mt,exports.CarouselNext=Dt,exports.CarouselPrevious=qt,exports.useCarousel=St;
3
+ "use strict";var v=require("react/jsx-runtime"),dt=require("embla-carousel-autoplay"),ft=require("embla-carousel-fade"),vt=require("embla-carousel-wheel-gestures"),pt=require("embla-carousel-react"),J=require("class-variance-authority"),H=require("@medway-ui/icons"),r=require("react"),qe=require("./Button.js"),De=require("../hooks/use-composed-refs.js"),mt=require("../hooks/use-id.js"),gt=require("../hooks/use-prefers-reduced-motion.js"),w=require("../lib/utils.js"),bt=Object.defineProperty,ht=Object.defineProperties,xt=Object.getOwnPropertyDescriptors,se=Object.getOwnPropertySymbols,We=Object.prototype.hasOwnProperty,$e=Object.prototype.propertyIsEnumerable,Be=(e,t,o)=>t in e?bt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,R=(e,t)=>{for(var o in t||(t={}))We.call(t,o)&&Be(e,o,t[o]);if(se)for(var o of se(t))$e.call(t,o)&&Be(e,o,t[o]);return e},j=(e,t)=>ht(e,xt(t)),U=(e,t)=>{var o={};for(var i in e)We.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&se)for(var i of se(e))t.indexOf(i)<0&&$e.call(e,i)&&(o[i]=e[i]);return o};const yt=5e3,Ve="data-consumer-inert",St={selectedIndex:0,snapCount:0,canScrollPrev:!1,canScrollNext:!1,slideCount:0,snapFirstSlides:[],announcement:""},Ct={horizontal:{ArrowLeft:"previous",ArrowRight:"next"},vertical:{ArrowUp:"previous",ArrowDown:"next"}},Nt={Home:"first",End:"last"},Rt=["a[href]","area[href]","button:not([disabled])","input:not([disabled]):not([type='hidden'])","select:not([disabled])","textarea:not([disabled])","iframe","audio[controls]","video[controls]","summary","[contenteditable]:not([contenteditable='false'])","[tabindex]:not([tabindex='-1'])"].join(","),wt="focus:outline-0 focus-visible:ring-4 focus-visible:ring-state-focus",Et=["TEXTAREA","SELECT","VIDEO","AUDIO"],It=["button","checkbox","color","file","image","reset","submit"],Pt=["combobox","grid","listbox","menu","menubar","radiogroup","searchbox","slider","spinbutton","tablist","textbox","toolbar","tree","treegrid"],zt={horizontal:{previous:H.ArrowLeftMd,next:H.ArrowRightMd},vertical:{previous:H.ArrowUpMd,next:H.ArrowDownMd}},Ft={previous:"Anterior",next:"Pr\xF3ximo"},kt={none:{horizontal:{content:"",item:"",focusRing:""},vertical:{content:"",item:"",focusRing:""}},xs:{horizontal:{content:"-ml-2",item:"pl-2",focusRing:"focus-visible:after:left-2"},vertical:{content:"-mt-2",item:"pt-2",focusRing:"focus-visible:after:top-2"}},sm:{horizontal:{content:"-ml-3",item:"pl-3",focusRing:"focus-visible:after:left-3"},vertical:{content:"-mt-3",item:"pt-3",focusRing:"focus-visible:after:top-3"}},md:{horizontal:{content:"-ml-4",item:"pl-4",focusRing:"focus-visible:after:left-4"},vertical:{content:"-mt-4",item:"pt-4",focusRing:"focus-visible:after:top-4"}},lg:{horizontal:{content:"-ml-6",item:"pl-6",focusRing:"focus-visible:after:left-6"},vertical:{content:"-mt-6",item:"pt-6",focusRing:"focus-visible:after:top-6"}},xl:{horizontal:{content:"-ml-8",item:"pl-8",focusRing:"focus-visible:after:left-8"},vertical:{content:"-mt-8",item:"pt-8",focusRing:"focus-visible:after:top-8"}}},_=["side","floating","outside"],jt=J.cva("relative",{variants:{orientation:{horizontal:"",vertical:""},controls:{side:"",floating:"",outside:"",inline:""}},compoundVariants:[{orientation:"horizontal",controls:_,class:"grid grid-flow-row-dense grid-cols-[auto_minmax(0,1fr)_auto] items-center [&>*]:col-span-full"},{orientation:"vertical",controls:_,class:"flex flex-col"}]}),Lt=J.cva("relative overflow-hidden",{variants:{orientation:{horizontal:"",vertical:""},controls:{side:"",floating:"",outside:"",inline:""}},compoundVariants:[{orientation:"horizontal",controls:_,class:"!col-start-2 !col-span-1 min-w-0"}]}),At=J.cva("relative z-10 shrink-0",{variants:{orientation:{horizontal:"",vertical:""},controls:{side:"",floating:"",outside:"",inline:""},direction:{previous:"",next:""},controlsFrom:{always:"",md:"hidden md:block",lg:"hidden lg:block"}},compoundVariants:[{orientation:"horizontal",controls:_,direction:"previous",class:"!col-start-1 !col-span-1"},{orientation:"horizontal",controls:_,direction:"next",class:"!col-start-3 !col-span-1"},{orientation:"horizontal",controls:"side",direction:"previous",class:"mr-2"},{orientation:"horizontal",controls:"side",direction:"next",class:"ml-2"},{orientation:"horizontal",controls:["floating","outside"],class:"w-0"},{orientation:"vertical",controls:_,class:"self-center"},{orientation:"vertical",controls:"side",direction:"previous",class:"mb-2"},{orientation:"vertical",controls:"side",direction:"next",class:"mt-2"},{orientation:"vertical",controls:["floating","outside"],class:"h-0"}]}),Mt=J.cva("touch-manipulation disabled:opacity-50 dark:disabled:opacity-30",{variants:{orientation:{horizontal:"",vertical:""},controls:{side:"",floating:"",outside:"",inline:""},direction:{previous:"",next:""},opaque:{true:"",false:""}},compoundVariants:[{controls:["floating","outside"],class:"disabled:pointer-events-auto disabled:cursor-default"},{controls:"floating",class:"shadow-level-1"},{controls:"floating",opaque:!0,class:"bg-surface-elevated dark:bg-surface-elevated disabled:hover:bg-surface-elevated"},{controls:"outside",opaque:!0,class:"disabled:hover:bg-transparent"},{controls:["floating","outside"],opaque:!0,class:"disabled:hover:dark:border-gray-stroke-muted"},{orientation:"horizontal",controls:["floating","outside"],class:"absolute top-1/2 -translate-y-1/2"},{orientation:"horizontal",controls:"floating",direction:"previous",class:"left-2"},{orientation:"horizontal",controls:"floating",direction:"next",class:"right-2"},{orientation:"horizontal",controls:"outside",direction:"previous",class:"right-2"},{orientation:"horizontal",controls:"outside",direction:"next",class:"left-2"},{orientation:"vertical",controls:["floating","outside"],class:"absolute left-1/2 -translate-x-1/2"},{orientation:"vertical",controls:"floating",direction:"previous",class:"top-2"},{orientation:"vertical",controls:"floating",direction:"next",class:"bottom-2"},{orientation:"vertical",controls:"outside",direction:"previous",class:"bottom-2"},{orientation:"vertical",controls:"outside",direction:"next",class:"top-2"}]}),Ke=J.cva("pointer-events-none absolute z-[1] transition-opacity duration-200 motion-reduce:transition-none",{variants:{orientation:{horizontal:"inset-y-0 w-8",vertical:"inset-x-0 h-8"},edge:{start:"",end:""},visible:{true:"opacity-100",false:"opacity-0"}},compoundVariants:[{orientation:"horizontal",edge:"start",class:"left-0 bg-gradient-to-r from-background to-transparent"},{orientation:"horizontal",edge:"end",class:"right-0 bg-gradient-to-l from-background to-transparent"},{orientation:"vertical",edge:"start",class:"top-0 bg-gradient-to-b from-background to-transparent"},{orientation:"vertical",edge:"end",class:"bottom-0 bg-gradient-to-t from-background to-transparent"}]}),Ot="focus:outline-0 focus-visible:after:pointer-events-none focus-visible:after:absolute focus-visible:after:inset-0 focus-visible:after:ring-[3px] focus-visible:after:ring-inset focus-visible:after:ring-state-focus",Tt="group flex size-6 items-center justify-center rounded-pill hover:cursor-pointer focus:outline-0 focus-visible:ring-4 focus-visible:ring-state-focus",qt="h-2 w-2 rounded-pill bg-gray-stroke transition-[width,background-color] duration-200 motion-reduce:transition-none group-hover:data-[active=false]:bg-gray-stroke-emphasis data-[active=true]:w-4 data-[active=true]:bg-primary-background-fill",xe=r.createContext(null),He=r.createContext(null);function X(){const e=r.useContext(xe);if(!e)throw new Error("useCarousel must be used within a Carousel component.");return e}function Dt(){const{selectedIndex:e,snapCount:t,canScrollPrev:o,canScrollNext:i,isScrollable:u,scrollPrev:p,scrollNext:f,scrollTo:m,autoplay:c}=X();return r.useMemo(()=>({selectedIndex:e,snapCount:t,canScrollPrev:o,canScrollNext:i,isScrollable:u,scrollPrev:p,scrollNext:f,scrollTo:m,autoplay:c}),[e,t,o,i,u,p,f,m,c])}function Wt(e){return{selectedIndex:e.selectedScrollSnap(),snapCount:e.scrollSnapList().length,canScrollPrev:e.canScrollPrev(),canScrollNext:e.canScrollNext(),slideCount:e.slideNodes().length,snapFirstSlides:e.internalEngine().slideRegistry.map((t,o)=>{var i;return(i=t[0])!=null?i:o})}}function $t(e,t){return e.selectedIndex===t.selectedIndex&&e.snapCount===t.snapCount&&e.canScrollPrev===t.canScrollPrev&&e.canScrollNext===t.canScrollNext&&e.slideCount===t.slideCount&&e.snapFirstSlides.length===t.snapFirstSlides.length&&e.snapFirstSlides.every((o,i)=>o===t.snapFirstSlides[i])&&e.announcement===t.announcement}function Bt(e,t){const o=Object.keys(e);return o.length===Object.keys(t).length&&o.every(i=>Object.is(e[i],t[i]))}function Ue(e,t){return Number.isFinite(e)&&e>=1?Math.trunc(e):t}function ye(e){if(!(e===void 0||!Number.isFinite(e)))return Math.max(0,Math.trunc(e))}function _e(e,t=""){return r.Children.toArray(e).flatMap(o=>{var i;if(!r.isValidElement(o))return[];const u=`${t}${(i=o.key)!=null?i:""}`;return o.type===r.Fragment?_e(o.props.children,`${u}/`):[r.cloneElement(o,{key:u})]})}function Vt(e,t,o){const i=document.activeElement;return i===o&&!e.canScrollNext&&e.canScrollPrev?"previous":i===t&&!e.canScrollPrev&&e.canScrollNext?"next":null}function Kt(e,t){const o=getComputedStyle(e);return t==="horizontal"?/auto|scroll/.test(o.overflowX)&&e.scrollWidth>e.clientWidth:/auto|scroll/.test(o.overflowY)&&e.scrollHeight>e.clientHeight}function Ht(e,t){var o;return e instanceof HTMLElement&&e.isContentEditable||e instanceof HTMLInputElement&&!It.includes(e.type)||Et.includes(e.tagName)||Pt.includes((o=e.getAttribute("role"))!=null?o:"")||Kt(e,t)}function Ut(e,t){const o=e.nativeEvent.composedPath();return o.slice(0,o.indexOf(e.currentTarget)).some(i=>i instanceof Element&&Ht(i,t))}function _t(e){try{return e.matches(":focus-visible")}catch(t){return!1}}function Ge(e){var t;return(t=e.internalEngine().slideRegistry[e.selectedScrollSnap()])!=null?t:[]}function Qe(e){return e.hasAttribute(Ve)}function Ze(e){e.getAttribute("tabindex")==="-1"&&e.removeAttribute("tabindex")}function Se(e){var t,o;(o=(t=e.plugins())==null?void 0:t.autoplay)==null||o.reset()}function Gt(e){const t=typeof e=="object"?e.delay:void 0;return t!==void 0&&Number.isFinite(t)&&t>0?t:yt}function Je(e,t){return e==="page"?t.snapCount!==t.slideCount:Ue(e,1)>1}function Qt(e,t){var o;const i=e.slideNodes().length;if(i===0)return"";const u=e.selectedScrollSnap();return t?`P\xE1gina ${u+1} de ${e.scrollSnapList().length}`:`Slide ${((o=Ge(e)[0])!=null?o:u)+1} de ${i}`}function Zt(e,t){return t?`Ir para a p\xE1gina ${e+1}`:`Ir para o slide ${e+1}`}const Jt=r.forwardRef(function(e,t){const o=e,{orientation:i="horizontal",align:u="start",step:p=1,loop:f=!1,dragFree:m=!1,transition:c="slide",autoplay:g=!1,controls:C="side",controlsFrom:y="always",edgeBehavior:S="disable",hideControlsWhenFits:P=!0,wheelGestures:z=!1,index:F,defaultIndex:W,onIndexChange:N,setApi:k,opts:E,className:$,children:O,onKeyDown:T,onFocus:L,onPointerEnter:A,onPointerLeave:Y,tabIndex:ee}=o,ce=U(o,["orientation","align","step","loop","dragFree","transition","autoplay","controls","controlsFrom","edgeBehavior","hideControlsWhenFits","wheelGestures","index","defaultIndex","onIndexChange","setApi","opts","className","children","onKeyDown","onFocus","onPointerEnter","onPointerLeave","tabIndex"]),ue=mt.useId(),[G,Ye]=r.useState(),Ce=G!=null?G:ue,I=gt.usePrefersReducedMotion(),B=g!==!1,Ne=Gt(g),q=ye(F),[de]=r.useState(()=>{var n;return(n=q!=null?q:ye(W))!=null?n:0}),et=r.useMemo(()=>{const n=[];if(B&&n.push(dt({delay:Ne,playOnInit:!1,stopOnInteraction:!0,stopOnFocusIn:!1,stopOnMouseEnter:!1})),c==="fade"&&n.push(ft()),z){const a=vt.WheelGesturesPlugin();n.push(j(R({},a),{init(s,b){s.scrollSnapList().length>1&&s.internalEngine().options.watchDrag!==!1&&a.init(s,b)}}))}return n},[B,Ne,c,z]),[Re,l]=pt(j(R({containScroll:"trimSnaps"},E),{axis:i==="horizontal"?"x":"y",align:u,loop:f,dragFree:m,slidesToScroll:p==="page"?"auto":Ue(p,1),startIndex:de}),et),[Q,tt]=r.useState(()=>j(R({},St),{selectedIndex:de})),[fe,we]=r.useState(null),[nt,Ee]=r.useState(!1),[ot,rt]=r.useState(!0),Ie=r.useRef(null),it=De.useComposedRefs(t,Ie),te=r.useRef(null),ne=r.useRef(null),ve=r.useRef(null),pe=r.useRef(!1),D=r.useRef(de),me=r.useRef(N),Pe=r.useRef(p),ze=r.useRef(null),oe=r.useRef(null),M=Q.snapCount>1,Fe=Je(p,Q),Z=fe?fe==="paused":I,V=B&&M&&!Z&&!nt,ke=r.useRef(V),re=r.useRef(null),je=r.useRef(I),ie=r.useCallback(()=>{l&&(l.scrollPrev(I),Se(l))},[l,I]),le=r.useCallback(()=>{l&&(l.scrollNext(I),Se(l))},[l,I]),ae=r.useCallback(n=>{if(!l)return;const a=n!==l.selectedScrollSnap();l.scrollTo(n,I),a&&Se(l)},[l,I]),ge=r.useCallback(n=>{pe.current=!0;try{n()}finally{pe.current=!1}},[]),be=r.useCallback(n=>ge(n==="previous"?ie:le),[ge,ie,le]),Le=r.useCallback(()=>{var n;return(n=re.current)==null?void 0:n.call(re)},[]),Ae=r.useCallback(()=>we(Z?"playing":"paused"),[Z]),lt=n=>{T==null||T(n);const a=Ct[i][n.key],s=Nt[n.key];if(!(!a&&!s||n.defaultPrevented)&&!(n.altKey||n.ctrlKey||n.metaKey||n.shiftKey)&&n.currentTarget.contains(n.target)&&!Ut(n,i)){if(s){const b=n.target===n.currentTarget||n.target===te.current||n.target===ne.current;if(!l||!M||!b)return;const h=s==="first"?0:l.scrollSnapList().length-1;n.preventDefault(),ge(()=>ae(h));return}a&&(n.preventDefault(),be(a))}},at=n=>{L==null||L(n),!(!B||fe==="playing")&&_t(n.target)&&we("paused")},st=n=>{A==null||A(n),n.pointerType==="mouse"&&Ee(!0)},ct=n=>{Y==null||Y(n),n.pointerType==="mouse"&&Ee(!1)},Me=r.useMemo(()=>({isEnabled:B,isPaused:Z,isRotating:V,toggle:Ae}),[B,Z,V,Ae]),ut=r.useMemo(()=>j(R({},Q),{orientation:i,transition:c,controls:C,controlsFrom:y,edgeBehavior:S,hideControlsWhenFits:P,isPaged:Fe,isScrollable:M,contentId:Ce,setContentId:Ye,viewportRef:Re,previousButtonRef:te,nextButtonRef:ne,scrollPrev:ie,scrollNext:le,scrollTo:ae,scrollFromArrow:be,syncFadeInert:Le,autoplay:Me}),[Q,i,c,C,y,S,P,Fe,M,Ce,Re,ie,le,ae,be,Le,Me]);return r.useEffect(()=>{me.current=N,Pe.current=p,ke.current=V,je.current=I}),r.useEffect(()=>{l&&k&&k(l)},[l,k]),r.useEffect(()=>{if(!l)return;let n=!1;const a=(h,d)=>{const x=Wt(l),K=d==="select"&&n;K&&(n=!1);const Oe=d!=="select"?void 0:K?"":Qt(l,Je(Pe.current,x));ve.current=pe.current?Vt(x,te.current,ne.current):null,tt(he=>{const Te=j(R({},x),{announcement:Oe!=null?Oe:he.announcement});return $t(he,Te)?he:Te})},s=()=>{const h=oe.current,d=h!==null&&h<l.scrollSnapList().length;d&&(oe.current=null,D.current=h);const x=D.current;if(l.selectedScrollSnap()!==x){n=!d;try{l.scrollTo(x,!0)}finally{n=!1}}},b=()=>{var h;const d=l.selectedScrollSnap();d!==D.current&&(D.current=d,(h=me.current)==null||h.call(me,d))};return D.current=l.selectedScrollSnap(),a(),l.on("reInit",s).on("select",a).on("reInit",a).on("select",b).on("reInit",b),()=>{l.off("reInit",s).off("select",a).off("reInit",a).off("select",b).off("reInit",b)}},[l]),r.useEffect(()=>{const n=Ie.current;if(!n||!M)return;const a=n.ownerDocument.defaultView,s=()=>{const h=n.querySelectorAll(Rt);rt(Array.from(h).some(d=>!(d.hasAttribute("tabindex")&&d.tabIndex<0)&&!d.matches(":disabled")&&!d.closest("[hidden], [inert]")&&d.getClientRects().length>0&&getComputedStyle(d).visibility==="visible"))};s();const b=new MutationObserver(s);return b.observe(n,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["class","style","hidden","inert","disabled","href","type","tabindex","contenteditable","controls","open"]}),a==null||a.addEventListener("resize",s),()=>{b.disconnect(),a==null||a.removeEventListener("resize",s)}},[M]),r.useEffect(()=>{var n;const a=ve.current;a&&(ve.current=null,(n=(a==="previous"?te:ne).current)==null||n.focus({preventScroll:!0}))},[Q]),r.useEffect(()=>{const n=ze.current;if(!l||n&&Bt(n,e))return;if(ze.current=e,q===void 0){oe.current=null;return}const a=l.selectedScrollSnap(),s=q===ye(n==null?void 0:n.index);if(a!==D.current&&s)return;const b=Math.max(0,l.scrollSnapList().length-1);oe.current=q>b?q:null;const h=Math.min(q,b);h!==a&&(D.current=h,ae(h))}),r.useEffect(()=>{if(!l||c!=="fade")return;const n=new Set,a=()=>{const s=l.slideNodes(),b=new Set(Ge(l)),h=s.some((x,K)=>!b.has(K)&&x.contains(document.activeElement));s.forEach((x,K)=>{x.inert=!b.has(K)||Qe(x),x.inert&&n.has(x)&&(Ze(x),n.delete(x))});const d=h?s.find(x=>!x.inert):void 0;d&&(d.hasAttribute("tabindex")||(d.tabIndex=-1,n.add(d)),d.focus({preventScroll:!0}))};return re.current=a,a(),l.on("select",a).on("reInit",a),()=>{re.current=null,l.off("select",a).off("reInit",a);for(const s of l.slideNodes())s.inert=Qe(s);n.forEach(Ze)}},[l,c]),r.useEffect(()=>{var n;const a=(n=l==null?void 0:l.plugins())==null?void 0:n.autoplay;a&&(V?a.play(I):a.stop())},[l,V,I]),r.useEffect(()=>{if(!l)return;const n=()=>{var a,s;ke.current&&((s=(a=l.plugins())==null?void 0:a.autoplay)==null||s.play(je.current))};return l.on("pointerUp",n).on("reInit",n),()=>{l.off("pointerUp",n).off("reInit",n)}},[l]),v.jsx(xe.Provider,{value:ut,children:v.jsx("div",j(R({ref:it,role:"region","aria-roledescription":"carousel","data-slot":"carousel","data-orientation":i,"data-scrollable":M,tabIndex:ee!=null?ee:M&&!ot?0:void 0,className:w.cn(jt({orientation:i,controls:C}),wt,$),onKeyDown:lt,onFocus:at,onPointerEnter:st,onPointerLeave:ct},ce),{children:O}))})}),Xt=r.forwardRef(function(e,t){var o=e,{gap:i="md",fadeEdges:u=!1,fadeClassName:p,viewportClassName:f,className:m,children:c,id:g}=o,C=U(o,["gap","fadeEdges","fadeClassName","viewportClassName","className","children","id"]);const{viewportRef:y,orientation:S,controls:P,canScrollPrev:z,canScrollNext:F,announcement:W,autoplay:N,contentId:k,setContentId:E}=X();r.useLayoutEffect(()=>(E(g),()=>E(void 0)),[g,E]);const $=_e(c),O=kt[i][S];return v.jsxs("div",{ref:y,"data-slot":"carousel-viewport",className:w.cn(Lt({orientation:S,controls:P}),f),children:[v.jsx("div",j(R({ref:t,id:g!=null?g:k,"data-slot":"carousel-content",className:w.cn("flex touch-pinch-zoom",S==="horizontal"?"touch-pan-y":"touch-pan-x flex-col",O.content,m)},C),{children:$.map((T,L)=>{var A;return v.jsx(He.Provider,{value:{index:L,total:$.length,gapClassName:O.item,focusRingClassName:O.focusRing},children:T},(A=T.key)!=null?A:L)})})),v.jsx("div",{"data-slot":"carousel-live","aria-live":N.isRotating?"off":"polite","aria-atomic":"true",className:"sr-only",children:W}),u&&v.jsxs(v.Fragment,{children:[v.jsx("div",{"aria-hidden":"true","data-slot":"carousel-fade-start",className:w.cn(Ke({orientation:S,edge:"start",visible:z}),p)}),v.jsx("div",{"aria-hidden":"true","data-slot":"carousel-fade-end",className:w.cn(Ke({orientation:S,edge:"end",visible:F}),p)})]})]})}),Yt=r.forwardRef(function(e,t){var o=e,{className:i,inert:u}=o,p=U(o,["className","inert"]);const f=r.useContext(He),m=r.useContext(xe),c=m==null?void 0:m.syncFadeInert,g=(m==null?void 0:m.transition)==="fade",C=!!u||u==="",y={[Ve]:C||void 0};return r.useEffect(()=>{c==null||c()},[C,c]),v.jsx("div",R(j(R({ref:t,role:"group","aria-roledescription":"slide","aria-label":f?`${f.index+1} de ${f.total}`:void 0,"data-slot":"carousel-item"},y),{inert:u,className:w.cn("min-w-0 shrink-0 grow-0 basis-full",f==null?void 0:f.gapClassName,g&&Ot,g&&(f==null?void 0:f.focusRingClassName),i)}),p))}),Xe=r.forwardRef(function(e,t){var o=e,{direction:i,variant:u="outlined",size:p="md",className:f,containerClassName:m,disabled:c,onClick:g}=o,C=U(o,["direction","variant","size","className","containerClassName","disabled","onClick"]);const{orientation:y,controls:S,controlsFrom:P,edgeBehavior:z,hideControlsWhenFits:F,isScrollable:W,canScrollPrev:N,canScrollNext:k,scrollFromArrow:E,previousButtonRef:$,nextButtonRef:O,contentId:T}=X(),L=i==="previous",A=L?N:k,Y=De.useComposedRefs(t,L?$:O),ee=z==="hide"&&!A||F&&!W,ce=zt[y][i],ue=G=>{g==null||g(G),!G.defaultPrevented&&E(i)};return v.jsx(qe.Button,R({ref:Y,"data-slot":`carousel-${i}`,variant:u,size:p,"aria-label":Ft[i],"aria-controls":T,iconLeft:v.jsx(ce,{"aria-hidden":"true"}),disabled:c||!A,containerClassName:w.cn(At({orientation:y,controls:S,direction:i,controlsFrom:P}),ee&&"invisible",m),className:w.cn(Mt({orientation:y,controls:S,direction:i,opaque:u==="outlined"}),f),onClick:ue},C))}),en=r.forwardRef(function(e,t){return v.jsx(Xe,R({ref:t,direction:"previous"},e))}),tn=r.forwardRef(function(e,t){return v.jsx(Xe,R({ref:t,direction:"next"},e))}),nn=r.forwardRef(function(e,t){var o=e,{getDotLabel:i,dotClassName:u,indicatorClassName:p,className:f}=o,m=U(o,["getDotLabel","dotClassName","indicatorClassName","className"]);const{snapCount:c,snapFirstSlides:g,selectedIndex:C,isPaged:y,isScrollable:S,hideControlsWhenFits:P,scrollTo:z,contentId:F}=X();return v.jsx("div",j(R({ref:t,role:"group","aria-label":y?"Escolher p\xE1gina":"Escolher slide","data-slot":"carousel-dots",className:w.cn("mt-2 flex min-h-6 items-center justify-center",P&&!S&&"invisible",f)},m),{children:Array.from({length:c},(W,N)=>{var k;const E=N===C;return v.jsx("button",{type:"button","data-slot":"carousel-dot","data-active":E,"aria-label":i?i(N,c):Zt(y?N:(k=g[N])!=null?k:N,y),"aria-current":E||void 0,"aria-controls":F,onClick:()=>z(N),className:w.cn(Tt,u),children:v.jsx("span",{"data-slot":"carousel-dot-indicator","data-active":E,className:w.cn(qt,p)})},N)})}))}),on=r.forwardRef(function(e,t){var o=e,{variant:i="outlined",size:u="sm",containerClassName:p,onClick:f}=o,m=U(o,["variant","size","containerClassName","onClick"]);const{autoplay:c,isScrollable:g,hideControlsWhenFits:C}=X(),y=c.isPaused?H.Play:H.Pause,S=c.isPaused?"Iniciar rota\xE7\xE3o autom\xE1tica":"Pausar rota\xE7\xE3o autom\xE1tica",P=C&&!g,z=F=>{f==null||f(F),F.defaultPrevented||c.toggle()};return c.isEnabled?v.jsx(qe.Button,R({ref:t,"data-slot":"carousel-autoplay-toggle",variant:i,size:u,"aria-label":S,iconLeft:v.jsx(y,{"aria-hidden":"true"}),containerClassName:w.cn("relative z-10",P&&"invisible",p),onClick:z},m)):null});exports.Carousel=Jt,exports.CarouselAutoplayToggle=on,exports.CarouselContent=Xt,exports.CarouselDots=nn,exports.CarouselItem=Yt,exports.CarouselNext=tn,exports.CarouselPrevious=en,exports.useCarousel=Dt;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  "use client";
3
- import{jsx as v,jsxs as De,Fragment as it}from"react/jsx-runtime";import at from"embla-carousel-autoplay";import st from"embla-carousel-fade";import ct from"embla-carousel-react";import{cva as Y}from"class-variance-authority";import{ArrowDownMd as ut,ArrowUpMd as dt,ArrowRightMd as ft,ArrowLeftMd as pt,Play as vt,Pause as mt}from"@medway-ui/icons";import{createContext as Me,forwardRef as L,useState as le,useMemo as ie,useRef as S,useCallback as H,useEffect as O,useContext as xe,Children as gt,isValidElement as ht,Fragment as bt,cloneElement as xt}from"react";import{Button as je}from"./Button.mjs";import{useComposedRefs as yt}from"../hooks/use-composed-refs.mjs";import{usePrefersReducedMotion as Ct}from"../hooks/use-prefers-reduced-motion.mjs";import{cn as P}from"../lib/utils.mjs";var Nt=Object.defineProperty,St=Object.defineProperties,Pt=Object.getOwnPropertyDescriptors,ae=Object.getOwnPropertySymbols,$e=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable,Be=(e,t,o)=>t in e?Nt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,N=(e,t)=>{for(var o in t||(t={}))$e.call(t,o)&&Be(e,o,t[o]);if(ae)for(var o of ae(t))We.call(t,o)&&Be(e,o,t[o]);return e},T=(e,t)=>St(e,Pt(t)),V=(e,t)=>{var o={};for(var r in e)$e.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&ae)for(var r of ae(e))t.indexOf(r)<0&&We.call(e,r)&&(o[r]=e[r]);return o};const wt=5e3,Ke="data-consumer-inert",zt={selectedIndex:0,snapCount:0,canScrollPrev:!1,canScrollNext:!1,slideCount:0,snapFirstSlides:[],announcement:""},It={horizontal:{ArrowLeft:"previous",ArrowRight:"next"},vertical:{ArrowUp:"previous",ArrowDown:"next"}},Et=["TEXTAREA","SELECT","VIDEO","AUDIO"],Ft=["button","checkbox","color","file","image","reset","submit"],Rt=["combobox","grid","listbox","menu","menubar","radiogroup","searchbox","slider","spinbutton","tablist","textbox","toolbar","tree","treegrid"],kt={horizontal:{previous:pt,next:ft},vertical:{previous:dt,next:ut}},Ot={previous:"Anterior",next:"Pr\xF3ximo"},At={none:{horizontal:{content:"",item:"",focusRing:""},vertical:{content:"",item:"",focusRing:""}},xs:{horizontal:{content:"-ml-2",item:"pl-2",focusRing:"focus-visible:after:left-2"},vertical:{content:"-mt-2",item:"pt-2",focusRing:"focus-visible:after:top-2"}},sm:{horizontal:{content:"-ml-3",item:"pl-3",focusRing:"focus-visible:after:left-3"},vertical:{content:"-mt-3",item:"pt-3",focusRing:"focus-visible:after:top-3"}},md:{horizontal:{content:"-ml-4",item:"pl-4",focusRing:"focus-visible:after:left-4"},vertical:{content:"-mt-4",item:"pt-4",focusRing:"focus-visible:after:top-4"}},lg:{horizontal:{content:"-ml-6",item:"pl-6",focusRing:"focus-visible:after:left-6"},vertical:{content:"-mt-6",item:"pt-6",focusRing:"focus-visible:after:top-6"}},xl:{horizontal:{content:"-ml-8",item:"pl-8",focusRing:"focus-visible:after:left-8"},vertical:{content:"-mt-8",item:"pt-8",focusRing:"focus-visible:after:top-8"}}},q=["side","floating","outside"],Lt=Y("relative",{variants:{orientation:{horizontal:"",vertical:""},controls:{side:"",floating:"",outside:"",inline:""}},compoundVariants:[{orientation:"horizontal",controls:q,class:"grid grid-flow-row-dense grid-cols-[auto_minmax(0,1fr)_auto] items-center [&>*]:col-span-full"},{orientation:"vertical",controls:q,class:"flex flex-col"}]}),Tt=Y("relative overflow-hidden",{variants:{orientation:{horizontal:"",vertical:""},controls:{side:"",floating:"",outside:"",inline:""}},compoundVariants:[{orientation:"horizontal",controls:q,class:"!col-start-2 !col-span-1 min-w-0"}]}),Dt=Y("relative z-10 shrink-0",{variants:{orientation:{horizontal:"",vertical:""},controls:{side:"",floating:"",outside:"",inline:""},direction:{previous:"",next:""},controlsFrom:{always:"",md:"hidden md:block",lg:"hidden lg:block"}},compoundVariants:[{orientation:"horizontal",controls:q,direction:"previous",class:"!col-start-1 !col-span-1"},{orientation:"horizontal",controls:q,direction:"next",class:"!col-start-3 !col-span-1"},{orientation:"horizontal",controls:"side",direction:"previous",class:"mr-2"},{orientation:"horizontal",controls:"side",direction:"next",class:"ml-2"},{orientation:"horizontal",controls:["floating","outside"],class:"w-0"},{orientation:"vertical",controls:q,class:"self-center"},{orientation:"vertical",controls:"side",direction:"previous",class:"mb-2"},{orientation:"vertical",controls:"side",direction:"next",class:"mt-2"},{orientation:"vertical",controls:["floating","outside"],class:"h-0"}]}),Mt=Y("touch-manipulation disabled:opacity-50 dark:disabled:opacity-30",{variants:{orientation:{horizontal:"",vertical:""},controls:{side:"",floating:"",outside:"",inline:""},direction:{previous:"",next:""},opaque:{true:"",false:""}},compoundVariants:[{controls:["floating","outside"],class:"disabled:pointer-events-auto disabled:cursor-default"},{controls:"floating",class:"shadow-level-1"},{controls:"floating",opaque:!0,class:"bg-surface-elevated dark:bg-surface-elevated disabled:hover:bg-surface-elevated"},{controls:"outside",opaque:!0,class:"disabled:hover:bg-transparent"},{controls:["floating","outside"],opaque:!0,class:"disabled:hover:dark:border-gray-stroke-muted"},{orientation:"horizontal",controls:["floating","outside"],class:"absolute top-1/2 -translate-y-1/2"},{orientation:"horizontal",controls:"floating",direction:"previous",class:"left-2"},{orientation:"horizontal",controls:"floating",direction:"next",class:"right-2"},{orientation:"horizontal",controls:"outside",direction:"previous",class:"right-2"},{orientation:"horizontal",controls:"outside",direction:"next",class:"left-2"},{orientation:"vertical",controls:["floating","outside"],class:"absolute left-1/2 -translate-x-1/2"},{orientation:"vertical",controls:"floating",direction:"previous",class:"top-2"},{orientation:"vertical",controls:"floating",direction:"next",class:"bottom-2"},{orientation:"vertical",controls:"outside",direction:"previous",class:"bottom-2"},{orientation:"vertical",controls:"outside",direction:"next",class:"top-2"}]}),He=Y("pointer-events-none absolute z-[1] transition-opacity duration-200 motion-reduce:transition-none",{variants:{orientation:{horizontal:"inset-y-0 w-8",vertical:"inset-x-0 h-8"},edge:{start:"",end:""},visible:{true:"opacity-100",false:"opacity-0"}},compoundVariants:[{orientation:"horizontal",edge:"start",class:"left-0 bg-gradient-to-r from-background to-transparent"},{orientation:"horizontal",edge:"end",class:"right-0 bg-gradient-to-l from-background to-transparent"},{orientation:"vertical",edge:"start",class:"top-0 bg-gradient-to-b from-background to-transparent"},{orientation:"vertical",edge:"end",class:"bottom-0 bg-gradient-to-t from-background to-transparent"}]}),jt="focus:outline-0 focus-visible:after:pointer-events-none focus-visible:after:absolute focus-visible:after:inset-0 focus-visible:after:ring-[3px] focus-visible:after:ring-inset focus-visible:after:ring-state-focus",$t="group flex size-6 items-center justify-center rounded-pill hover:cursor-pointer focus:outline-0 focus-visible:ring-4 focus-visible:ring-state-focus",Wt="h-2 w-2 rounded-pill bg-gray-stroke transition-[width,background-color] duration-200 motion-reduce:transition-none group-hover:data-[active=false]:bg-gray-stroke-emphasis data-[active=true]:w-4 data-[active=true]:bg-primary-background-fill",ye=Me(null),Ve=Me(null);function Z(){const e=xe(ye);if(!e)throw new Error("useCarousel must be used within a Carousel component.");return e}function Bt(){const{selectedIndex:e,snapCount:t,canScrollPrev:o,canScrollNext:r,isScrollable:s,scrollPrev:d,scrollNext:c,scrollTo:f,autoplay:a}=Z();return ie(()=>({selectedIndex:e,snapCount:t,canScrollPrev:o,canScrollNext:r,isScrollable:s,scrollPrev:d,scrollNext:c,scrollTo:f,autoplay:a}),[e,t,o,r,s,d,c,f,a])}function Kt(e){return{selectedIndex:e.selectedScrollSnap(),snapCount:e.scrollSnapList().length,canScrollPrev:e.canScrollPrev(),canScrollNext:e.canScrollNext(),slideCount:e.slideNodes().length,snapFirstSlides:e.internalEngine().slideRegistry.map((t,o)=>{var r;return(r=t[0])!=null?r:o})}}function Ht(e,t){return e.selectedIndex===t.selectedIndex&&e.snapCount===t.snapCount&&e.canScrollPrev===t.canScrollPrev&&e.canScrollNext===t.canScrollNext&&e.slideCount===t.slideCount&&e.snapFirstSlides.length===t.snapFirstSlides.length&&e.snapFirstSlides.every((o,r)=>o===t.snapFirstSlides[r])&&e.announcement===t.announcement}function Vt(e,t){const o=Object.keys(e);return o.length===Object.keys(t).length&&o.every(r=>Object.is(e[r],t[r]))}function qe(e,t){return Number.isFinite(e)&&e>=1?Math.trunc(e):t}function Ce(e){if(!(e===void 0||!Number.isFinite(e)))return Math.max(0,Math.trunc(e))}function Ue(e,t=""){return gt.toArray(e).flatMap(o=>{var r;if(!ht(o))return[];const s=`${t}${(r=o.key)!=null?r:""}`;return o.type===bt?Ue(o.props.children,`${s}/`):[xt(o,{key:s})]})}function qt(e,t,o){const r=document.activeElement;return r===o&&!e.canScrollNext&&e.canScrollPrev?"previous":r===t&&!e.canScrollPrev&&e.canScrollNext?"next":null}function Ut(e,t){const o=getComputedStyle(e);return t==="horizontal"?/auto|scroll/.test(o.overflowX)&&e.scrollWidth>e.clientWidth:/auto|scroll/.test(o.overflowY)&&e.scrollHeight>e.clientHeight}function _t(e,t){var o;return e instanceof HTMLElement&&e.isContentEditable||e instanceof HTMLInputElement&&!Ft.includes(e.type)||Et.includes(e.tagName)||Rt.includes((o=e.getAttribute("role"))!=null?o:"")||Ut(e,t)}function Xt(e,t){const o=e.nativeEvent.composedPath();return o.slice(0,o.indexOf(e.currentTarget)).some(r=>r instanceof Element&&_t(r,t))}function Gt(e){try{return e.matches(":focus-visible")}catch(t){return!1}}function _e(e){var t;return(t=e.internalEngine().slideRegistry[e.selectedScrollSnap()])!=null?t:[]}function Xe(e){return e.hasAttribute(Ke)}function Ge(e){e.getAttribute("tabindex")==="-1"&&e.removeAttribute("tabindex")}function Ne(e){var t,o;(o=(t=e.plugins())==null?void 0:t.autoplay)==null||o.reset()}function Jt(e){const t=typeof e=="object"?e.delay:void 0;return t!==void 0&&Number.isFinite(t)&&t>0?t:wt}function Je(e,t){return e==="page"?t.snapCount!==t.slideCount:qe(e,1)>1}function Yt(e,t){var o;const r=e.slideNodes().length;if(r===0)return"";const s=e.selectedScrollSnap();return t?`P\xE1gina ${s+1} de ${e.scrollSnapList().length}`:`Slide ${((o=_e(e)[0])!=null?o:s)+1} de ${r}`}function Zt(e,t){return t?`Ir para a p\xE1gina ${e+1}`:`Ir para o slide ${e+1}`}const Qt=L(function(e,t){const o=e,{orientation:r="horizontal",align:s="start",step:d=1,loop:c=!1,dragFree:f=!1,transition:a="slide",autoplay:g=!1,controls:h="side",controlsFrom:u="always",edgeBehavior:w="disable",hideControlsWhenFits:E=!0,index:R,defaultIndex:k,onIndexChange:b,setApi:z,opts:I,className:$,children:W,onKeyDown:D,onFocus:U,onPointerEnter:_,onPointerLeave:Q}=o,se=V(o,["orientation","align","step","loop","dragFree","transition","autoplay","controls","controlsFrom","edgeBehavior","hideControlsWhenFits","index","defaultIndex","onIndexChange","setApi","opts","className","children","onKeyDown","onFocus","onPointerEnter","onPointerLeave"]),y=Ct(),A=g!==!1,X=Jt(g),M=Ce(R),[ce]=le(()=>{var n;return(n=M!=null?M:Ce(k))!=null?n:0}),Ze=ie(()=>{const n=[];return A&&n.push(at({delay:X,playOnInit:!1,stopOnInteraction:!0,stopOnFocusIn:!1,stopOnMouseEnter:!1})),a==="fade"&&n.push(st()),n},[A,X,a]),[Se,l]=ct(T(N({containScroll:"trimSnaps"},I),{axis:r==="horizontal"?"x":"y",align:s,loop:c,dragFree:f,slidesToScroll:d==="page"?"auto":qe(d,1),startIndex:ce}),Ze),[G,Qe]=le(()=>T(N({},zt),{selectedIndex:ce})),[ue,Pe]=le(null),[et,we]=le(!1),de=S(null),fe=S(null),pe=S(null),ve=S(!1),j=S(ce),me=S(b),ze=S(d),Ie=S(null),ee=S(null),te=G.snapCount>1,Ee=Je(d,G),J=ue?ue==="paused":y,B=A&&te&&!J&&!et,Fe=S(B),oe=S(null),Re=S(y),ne=H(()=>{l&&(l.scrollPrev(y),Ne(l))},[l,y]),re=H(()=>{l&&(l.scrollNext(y),Ne(l))},[l,y]),ge=H(n=>{if(!l)return;const i=n!==l.selectedScrollSnap();l.scrollTo(n,y),i&&Ne(l)},[l,y]),he=H(n=>{ve.current=!0;try{n==="previous"?ne():re()}finally{ve.current=!1}},[ne,re]),ke=H(()=>{var n;return(n=oe.current)==null?void 0:n.call(oe)},[]),Oe=H(()=>Pe(J?"playing":"paused"),[J]),tt=n=>{D==null||D(n);const i=It[r][n.key];!i||n.defaultPrevented||n.altKey||n.ctrlKey||n.metaKey||n.shiftKey||n.currentTarget.contains(n.target)&&(Xt(n,r)||(n.preventDefault(),he(i)))},ot=n=>{U==null||U(n),!(!A||ue==="playing")&&Gt(n.target)&&Pe("paused")},nt=n=>{_==null||_(n),n.pointerType==="mouse"&&we(!0)},rt=n=>{Q==null||Q(n),n.pointerType==="mouse"&&we(!1)},Ae=ie(()=>({isEnabled:A,isPaused:J,isRotating:B,toggle:Oe}),[A,J,B,Oe]),lt=ie(()=>T(N({},G),{orientation:r,transition:a,controls:h,controlsFrom:u,edgeBehavior:w,hideControlsWhenFits:E,isPaged:Ee,isScrollable:te,viewportRef:Se,previousButtonRef:de,nextButtonRef:fe,scrollPrev:ne,scrollNext:re,scrollTo:ge,scrollFromArrow:he,syncFadeInert:ke,autoplay:Ae}),[G,r,a,h,u,w,E,Ee,te,Se,ne,re,ge,he,ke,Ae]);return O(()=>{me.current=b,ze.current=d,Fe.current=B,Re.current=y}),O(()=>{l&&z&&z(l)},[l,z]),O(()=>{if(!l)return;let n=!1;const i=(C,m)=>{const p=Kt(l),K=m==="select"&&n;K&&(n=!1);const Le=m!=="select"?void 0:K?"":Yt(l,Je(ze.current,p));pe.current=ve.current?qt(p,de.current,fe.current):null,Qe(be=>{const Te=T(N({},p),{announcement:Le!=null?Le:be.announcement});return Ht(be,Te)?be:Te})},x=()=>{const C=ee.current,m=C!==null&&C<l.scrollSnapList().length;m&&(ee.current=null,j.current=C);const p=j.current;if(l.selectedScrollSnap()!==p){n=!m;try{l.scrollTo(p,!0)}finally{n=!1}}},F=()=>{var C;const m=l.selectedScrollSnap();m!==j.current&&(j.current=m,(C=me.current)==null||C.call(me,m))};return j.current=l.selectedScrollSnap(),i(),l.on("reInit",x).on("select",i).on("reInit",i).on("select",F).on("reInit",F),()=>{l.off("reInit",x).off("select",i).off("reInit",i).off("select",F).off("reInit",F)}},[l]),O(()=>{var n;const i=pe.current;i&&(pe.current=null,(n=(i==="previous"?de:fe).current)==null||n.focus({preventScroll:!0}))},[G]),O(()=>{const n=Ie.current;if(!l||n&&Vt(n,e))return;if(Ie.current=e,M===void 0){ee.current=null;return}const i=l.selectedScrollSnap(),x=M===Ce(n==null?void 0:n.index);if(i!==j.current&&x)return;const F=Math.max(0,l.scrollSnapList().length-1);ee.current=M>F?M:null;const C=Math.min(M,F);C!==i&&(j.current=C,ge(C))}),O(()=>{if(!l||a!=="fade")return;const n=new Set,i=()=>{const x=l.slideNodes(),F=new Set(_e(l)),C=x.some((p,K)=>!F.has(K)&&p.contains(document.activeElement));x.forEach((p,K)=>{p.inert=!F.has(K)||Xe(p),p.inert&&n.has(p)&&(Ge(p),n.delete(p))});const m=C?x.find(p=>!p.inert):void 0;m&&(m.hasAttribute("tabindex")||(m.tabIndex=-1,n.add(m)),m.focus({preventScroll:!0}))};return oe.current=i,i(),l.on("select",i).on("reInit",i),()=>{oe.current=null,l.off("select",i).off("reInit",i);for(const x of l.slideNodes())x.inert=Xe(x);n.forEach(Ge)}},[l,a]),O(()=>{var n;const i=(n=l==null?void 0:l.plugins())==null?void 0:n.autoplay;i&&(B?i.play(y):i.stop())},[l,B,y]),O(()=>{if(!l)return;const n=()=>{var i,x;Fe.current&&((x=(i=l.plugins())==null?void 0:i.autoplay)==null||x.play(Re.current))};return l.on("pointerUp",n).on("reInit",n),()=>{l.off("pointerUp",n).off("reInit",n)}},[l]),v(ye.Provider,{value:lt,children:v("div",T(N({ref:t,role:"region","aria-roledescription":"carousel","data-slot":"carousel","data-orientation":r,"data-scrollable":te,className:P(Lt({orientation:r,controls:h}),$),onKeyDown:tt,onFocus:ot,onPointerEnter:nt,onPointerLeave:rt},se),{children:W}))})}),eo=L(function(e,t){var o=e,{gap:r="md",fadeEdges:s=!1,fadeClassName:d,viewportClassName:c,className:f,children:a}=o,g=V(o,["gap","fadeEdges","fadeClassName","viewportClassName","className","children"]);const{viewportRef:h,orientation:u,controls:w,canScrollPrev:E,canScrollNext:R,announcement:k,autoplay:b}=Z(),z=Ue(a),I=At[r][u];return De("div",{ref:h,"data-slot":"carousel-viewport",className:P(Tt({orientation:u,controls:w}),c),children:[v("div",T(N({ref:t,"data-slot":"carousel-content",className:P("flex touch-pinch-zoom",u==="horizontal"?"touch-pan-y":"touch-pan-x flex-col",I.content,f)},g),{children:z.map(($,W)=>{var D;return v(Ve.Provider,{value:{index:W,total:z.length,gapClassName:I.item,focusRingClassName:I.focusRing},children:$},(D=$.key)!=null?D:W)})})),v("div",{"data-slot":"carousel-live","aria-live":b.isRotating?"off":"polite","aria-atomic":"true",className:"sr-only",children:k}),s&&De(it,{children:[v("div",{"aria-hidden":"true","data-slot":"carousel-fade-start",className:P(He({orientation:u,edge:"start",visible:E}),d)}),v("div",{"aria-hidden":"true","data-slot":"carousel-fade-end",className:P(He({orientation:u,edge:"end",visible:R}),d)})]})]})}),to=L(function(e,t){var o=e,{className:r,inert:s}=o,d=V(o,["className","inert"]);const c=xe(Ve),f=xe(ye),a=f==null?void 0:f.syncFadeInert,g=(f==null?void 0:f.transition)==="fade",h=!!s||s==="",u={[Ke]:h||void 0};return O(()=>{a==null||a()},[h,a]),v("div",N(T(N({ref:t,role:"group","aria-roledescription":"slide","aria-label":c?`${c.index+1} de ${c.total}`:void 0,"data-slot":"carousel-item"},u),{inert:s,className:P("min-w-0 shrink-0 grow-0 basis-full",c==null?void 0:c.gapClassName,g&&jt,g&&(c==null?void 0:c.focusRingClassName),r)}),d))}),Ye=L(function(e,t){var o=e,{direction:r,variant:s="outlined",size:d="md",className:c,containerClassName:f,disabled:a,onClick:g}=o,h=V(o,["direction","variant","size","className","containerClassName","disabled","onClick"]);const{orientation:u,controls:w,controlsFrom:E,edgeBehavior:R,hideControlsWhenFits:k,isScrollable:b,canScrollPrev:z,canScrollNext:I,scrollFromArrow:$,previousButtonRef:W,nextButtonRef:D}=Z(),U=r==="previous",_=U?z:I,Q=yt(t,U?W:D),se=R==="hide"&&!_||k&&!b,y=kt[u][r],A=X=>{g==null||g(X),!X.defaultPrevented&&$(r)};return v(je,N({ref:Q,"data-slot":`carousel-${r}`,variant:s,size:d,"aria-label":Ot[r],iconLeft:v(y,{"aria-hidden":"true"}),disabled:a||!_,containerClassName:P(Dt({orientation:u,controls:w,direction:r,controlsFrom:E}),se&&"invisible",f),className:P(Mt({orientation:u,controls:w,direction:r,opaque:s==="outlined"}),c),onClick:A},h))}),oo=L(function(e,t){return v(Ye,N({ref:t,direction:"previous"},e))}),no=L(function(e,t){return v(Ye,N({ref:t,direction:"next"},e))}),ro=L(function(e,t){var o=e,{getDotLabel:r,dotClassName:s,indicatorClassName:d,className:c}=o,f=V(o,["getDotLabel","dotClassName","indicatorClassName","className"]);const{snapCount:a,snapFirstSlides:g,selectedIndex:h,isPaged:u,isScrollable:w,hideControlsWhenFits:E,scrollTo:R}=Z();return v("div",T(N({ref:t,role:"group","aria-label":u?"Escolher p\xE1gina":"Escolher slide","data-slot":"carousel-dots",className:P("mt-2 flex min-h-6 items-center justify-center",E&&!w&&"invisible",c)},f),{children:Array.from({length:a},(k,b)=>{var z;const I=b===h;return v("button",{type:"button","data-slot":"carousel-dot","data-active":I,"aria-label":r?r(b,a):Zt(u?b:(z=g[b])!=null?z:b,u),"aria-current":I||void 0,onClick:()=>R(b),className:P($t,s),children:v("span",{"data-slot":"carousel-dot-indicator","data-active":I,className:P(Wt,d)})},b)})}))}),lo=L(function(e,t){var o=e,{variant:r="outlined",size:s="sm",containerClassName:d,onClick:c}=o,f=V(o,["variant","size","containerClassName","onClick"]);const{autoplay:a,isScrollable:g,hideControlsWhenFits:h}=Z(),u=a.isPaused?vt:mt,w=a.isPaused?"Iniciar rota\xE7\xE3o autom\xE1tica":"Pausar rota\xE7\xE3o autom\xE1tica",E=h&&!g,R=k=>{c==null||c(k),k.defaultPrevented||a.toggle()};return a.isEnabled?v(je,N({ref:t,"data-slot":"carousel-autoplay-toggle",variant:r,size:s,"aria-label":w,iconLeft:v(u,{"aria-hidden":"true"}),containerClassName:P("relative z-10",E&&"invisible",d),onClick:R},f)):null});export{Qt as Carousel,lo as CarouselAutoplayToggle,eo as CarouselContent,ro as CarouselDots,to as CarouselItem,no as CarouselNext,oo as CarouselPrevious,Bt as useCarousel};
3
+ import{jsx as h,jsxs as Ve,Fragment as ht}from"react/jsx-runtime";import xt from"embla-carousel-autoplay";import yt from"embla-carousel-fade";import{WheelGesturesPlugin as St}from"embla-carousel-wheel-gestures";import Ct from"embla-carousel-react";import{cva as ee}from"class-variance-authority";import{ArrowDownMd as Nt,ArrowUpMd as wt,ArrowRightMd as It,ArrowLeftMd as zt,Play as Pt,Pause as Et}from"@medway-ui/icons";import{createContext as qe,forwardRef as D,useState as G,useMemo as de,useRef as w,useCallback as K,useEffect as L,useLayoutEffect as Ft,useContext as Ne,Children as Rt,isValidElement as kt,Fragment as Lt,cloneElement as At}from"react";import{Button as He}from"./Button.mjs";import{useComposedRefs as Ue}from"../hooks/use-composed-refs.mjs";import{useId as Ot}from"../hooks/use-id.mjs";import{usePrefersReducedMotion as Tt}from"../hooks/use-prefers-reduced-motion.mjs";import{cn as I}from"../lib/utils.mjs";var Mt=Object.defineProperty,Dt=Object.defineProperties,jt=Object.getOwnPropertyDescriptors,fe=Object.getOwnPropertySymbols,_e=Object.prototype.hasOwnProperty,Ge=Object.prototype.propertyIsEnumerable,Qe=(e,t,o)=>t in e?Mt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,N=(e,t)=>{for(var o in t||(t={}))_e.call(t,o)&&Qe(e,o,t[o]);if(fe)for(var o of fe(t))Ge.call(t,o)&&Qe(e,o,t[o]);return e},A=(e,t)=>Dt(e,jt(t)),Q=(e,t)=>{var o={};for(var r in e)_e.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&fe)for(var r of fe(e))t.indexOf(r)<0&&Ge.call(e,r)&&(o[r]=e[r]);return o};const $t=5e3,Ze="data-consumer-inert",Wt={selectedIndex:0,snapCount:0,canScrollPrev:!1,canScrollNext:!1,slideCount:0,snapFirstSlides:[],announcement:""},Bt={horizontal:{ArrowLeft:"previous",ArrowRight:"next"},vertical:{ArrowUp:"previous",ArrowDown:"next"}},Kt={Home:"first",End:"last"},Vt=["a[href]","area[href]","button:not([disabled])","input:not([disabled]):not([type='hidden'])","select:not([disabled])","textarea:not([disabled])","iframe","audio[controls]","video[controls]","summary","[contenteditable]:not([contenteditable='false'])","[tabindex]:not([tabindex='-1'])"].join(","),qt="focus:outline-0 focus-visible:ring-4 focus-visible:ring-state-focus",Ht=["TEXTAREA","SELECT","VIDEO","AUDIO"],Ut=["button","checkbox","color","file","image","reset","submit"],_t=["combobox","grid","listbox","menu","menubar","radiogroup","searchbox","slider","spinbutton","tablist","textbox","toolbar","tree","treegrid"],Gt={horizontal:{previous:zt,next:It},vertical:{previous:wt,next:Nt}},Qt={previous:"Anterior",next:"Pr\xF3ximo"},Zt={none:{horizontal:{content:"",item:"",focusRing:""},vertical:{content:"",item:"",focusRing:""}},xs:{horizontal:{content:"-ml-2",item:"pl-2",focusRing:"focus-visible:after:left-2"},vertical:{content:"-mt-2",item:"pt-2",focusRing:"focus-visible:after:top-2"}},sm:{horizontal:{content:"-ml-3",item:"pl-3",focusRing:"focus-visible:after:left-3"},vertical:{content:"-mt-3",item:"pt-3",focusRing:"focus-visible:after:top-3"}},md:{horizontal:{content:"-ml-4",item:"pl-4",focusRing:"focus-visible:after:left-4"},vertical:{content:"-mt-4",item:"pt-4",focusRing:"focus-visible:after:top-4"}},lg:{horizontal:{content:"-ml-6",item:"pl-6",focusRing:"focus-visible:after:left-6"},vertical:{content:"-mt-6",item:"pt-6",focusRing:"focus-visible:after:top-6"}},xl:{horizontal:{content:"-ml-8",item:"pl-8",focusRing:"focus-visible:after:left-8"},vertical:{content:"-mt-8",item:"pt-8",focusRing:"focus-visible:after:top-8"}}},Z=["side","floating","outside"],Jt=ee("relative",{variants:{orientation:{horizontal:"",vertical:""},controls:{side:"",floating:"",outside:"",inline:""}},compoundVariants:[{orientation:"horizontal",controls:Z,class:"grid grid-flow-row-dense grid-cols-[auto_minmax(0,1fr)_auto] items-center [&>*]:col-span-full"},{orientation:"vertical",controls:Z,class:"flex flex-col"}]}),Xt=ee("relative overflow-hidden",{variants:{orientation:{horizontal:"",vertical:""},controls:{side:"",floating:"",outside:"",inline:""}},compoundVariants:[{orientation:"horizontal",controls:Z,class:"!col-start-2 !col-span-1 min-w-0"}]}),Yt=ee("relative z-10 shrink-0",{variants:{orientation:{horizontal:"",vertical:""},controls:{side:"",floating:"",outside:"",inline:""},direction:{previous:"",next:""},controlsFrom:{always:"",md:"hidden md:block",lg:"hidden lg:block"}},compoundVariants:[{orientation:"horizontal",controls:Z,direction:"previous",class:"!col-start-1 !col-span-1"},{orientation:"horizontal",controls:Z,direction:"next",class:"!col-start-3 !col-span-1"},{orientation:"horizontal",controls:"side",direction:"previous",class:"mr-2"},{orientation:"horizontal",controls:"side",direction:"next",class:"ml-2"},{orientation:"horizontal",controls:["floating","outside"],class:"w-0"},{orientation:"vertical",controls:Z,class:"self-center"},{orientation:"vertical",controls:"side",direction:"previous",class:"mb-2"},{orientation:"vertical",controls:"side",direction:"next",class:"mt-2"},{orientation:"vertical",controls:["floating","outside"],class:"h-0"}]}),en=ee("touch-manipulation disabled:opacity-50 dark:disabled:opacity-30",{variants:{orientation:{horizontal:"",vertical:""},controls:{side:"",floating:"",outside:"",inline:""},direction:{previous:"",next:""},opaque:{true:"",false:""}},compoundVariants:[{controls:["floating","outside"],class:"disabled:pointer-events-auto disabled:cursor-default"},{controls:"floating",class:"shadow-level-1"},{controls:"floating",opaque:!0,class:"bg-surface-elevated dark:bg-surface-elevated disabled:hover:bg-surface-elevated"},{controls:"outside",opaque:!0,class:"disabled:hover:bg-transparent"},{controls:["floating","outside"],opaque:!0,class:"disabled:hover:dark:border-gray-stroke-muted"},{orientation:"horizontal",controls:["floating","outside"],class:"absolute top-1/2 -translate-y-1/2"},{orientation:"horizontal",controls:"floating",direction:"previous",class:"left-2"},{orientation:"horizontal",controls:"floating",direction:"next",class:"right-2"},{orientation:"horizontal",controls:"outside",direction:"previous",class:"right-2"},{orientation:"horizontal",controls:"outside",direction:"next",class:"left-2"},{orientation:"vertical",controls:["floating","outside"],class:"absolute left-1/2 -translate-x-1/2"},{orientation:"vertical",controls:"floating",direction:"previous",class:"top-2"},{orientation:"vertical",controls:"floating",direction:"next",class:"bottom-2"},{orientation:"vertical",controls:"outside",direction:"previous",class:"bottom-2"},{orientation:"vertical",controls:"outside",direction:"next",class:"top-2"}]}),Je=ee("pointer-events-none absolute z-[1] transition-opacity duration-200 motion-reduce:transition-none",{variants:{orientation:{horizontal:"inset-y-0 w-8",vertical:"inset-x-0 h-8"},edge:{start:"",end:""},visible:{true:"opacity-100",false:"opacity-0"}},compoundVariants:[{orientation:"horizontal",edge:"start",class:"left-0 bg-gradient-to-r from-background to-transparent"},{orientation:"horizontal",edge:"end",class:"right-0 bg-gradient-to-l from-background to-transparent"},{orientation:"vertical",edge:"start",class:"top-0 bg-gradient-to-b from-background to-transparent"},{orientation:"vertical",edge:"end",class:"bottom-0 bg-gradient-to-t from-background to-transparent"}]}),tn="focus:outline-0 focus-visible:after:pointer-events-none focus-visible:after:absolute focus-visible:after:inset-0 focus-visible:after:ring-[3px] focus-visible:after:ring-inset focus-visible:after:ring-state-focus",nn="group flex size-6 items-center justify-center rounded-pill hover:cursor-pointer focus:outline-0 focus-visible:ring-4 focus-visible:ring-state-focus",on="h-2 w-2 rounded-pill bg-gray-stroke transition-[width,background-color] duration-200 motion-reduce:transition-none group-hover:data-[active=false]:bg-gray-stroke-emphasis data-[active=true]:w-4 data-[active=true]:bg-primary-background-fill",we=qe(null),Xe=qe(null);function te(){const e=Ne(we);if(!e)throw new Error("useCarousel must be used within a Carousel component.");return e}function rn(){const{selectedIndex:e,snapCount:t,canScrollPrev:o,canScrollNext:r,isScrollable:c,scrollPrev:f,scrollNext:d,scrollTo:p,autoplay:s}=te();return de(()=>({selectedIndex:e,snapCount:t,canScrollPrev:o,canScrollNext:r,isScrollable:c,scrollPrev:f,scrollNext:d,scrollTo:p,autoplay:s}),[e,t,o,r,c,f,d,p,s])}function ln(e){return{selectedIndex:e.selectedScrollSnap(),snapCount:e.scrollSnapList().length,canScrollPrev:e.canScrollPrev(),canScrollNext:e.canScrollNext(),slideCount:e.slideNodes().length,snapFirstSlides:e.internalEngine().slideRegistry.map((t,o)=>{var r;return(r=t[0])!=null?r:o})}}function an(e,t){return e.selectedIndex===t.selectedIndex&&e.snapCount===t.snapCount&&e.canScrollPrev===t.canScrollPrev&&e.canScrollNext===t.canScrollNext&&e.slideCount===t.slideCount&&e.snapFirstSlides.length===t.snapFirstSlides.length&&e.snapFirstSlides.every((o,r)=>o===t.snapFirstSlides[r])&&e.announcement===t.announcement}function sn(e,t){const o=Object.keys(e);return o.length===Object.keys(t).length&&o.every(r=>Object.is(e[r],t[r]))}function Ye(e,t){return Number.isFinite(e)&&e>=1?Math.trunc(e):t}function Ie(e){if(!(e===void 0||!Number.isFinite(e)))return Math.max(0,Math.trunc(e))}function et(e,t=""){return Rt.toArray(e).flatMap(o=>{var r;if(!kt(o))return[];const c=`${t}${(r=o.key)!=null?r:""}`;return o.type===Lt?et(o.props.children,`${c}/`):[At(o,{key:c})]})}function cn(e,t,o){const r=document.activeElement;return r===o&&!e.canScrollNext&&e.canScrollPrev?"previous":r===t&&!e.canScrollPrev&&e.canScrollNext?"next":null}function un(e,t){const o=getComputedStyle(e);return t==="horizontal"?/auto|scroll/.test(o.overflowX)&&e.scrollWidth>e.clientWidth:/auto|scroll/.test(o.overflowY)&&e.scrollHeight>e.clientHeight}function dn(e,t){var o;return e instanceof HTMLElement&&e.isContentEditable||e instanceof HTMLInputElement&&!Ut.includes(e.type)||Ht.includes(e.tagName)||_t.includes((o=e.getAttribute("role"))!=null?o:"")||un(e,t)}function fn(e,t){const o=e.nativeEvent.composedPath();return o.slice(0,o.indexOf(e.currentTarget)).some(r=>r instanceof Element&&dn(r,t))}function pn(e){try{return e.matches(":focus-visible")}catch(t){return!1}}function tt(e){var t;return(t=e.internalEngine().slideRegistry[e.selectedScrollSnap()])!=null?t:[]}function nt(e){return e.hasAttribute(Ze)}function ot(e){e.getAttribute("tabindex")==="-1"&&e.removeAttribute("tabindex")}function ze(e){var t,o;(o=(t=e.plugins())==null?void 0:t.autoplay)==null||o.reset()}function vn(e){const t=typeof e=="object"?e.delay:void 0;return t!==void 0&&Number.isFinite(t)&&t>0?t:$t}function rt(e,t){return e==="page"?t.snapCount!==t.slideCount:Ye(e,1)>1}function mn(e,t){var o;const r=e.slideNodes().length;if(r===0)return"";const c=e.selectedScrollSnap();return t?`P\xE1gina ${c+1} de ${e.scrollSnapList().length}`:`Slide ${((o=tt(e)[0])!=null?o:c)+1} de ${r}`}function gn(e,t){return t?`Ir para a p\xE1gina ${e+1}`:`Ir para o slide ${e+1}`}const bn=D(function(e,t){const o=e,{orientation:r="horizontal",align:c="start",step:f=1,loop:d=!1,dragFree:p=!1,transition:s="slide",autoplay:v=!1,controls:S="side",controlsFrom:x="always",edgeBehavior:y="disable",hideControlsWhenFits:E=!0,wheelGestures:F=!1,index:R,defaultIndex:V,onIndexChange:C,setApi:k,opts:z,className:q,children:j,onKeyDown:$,onFocus:O,onPointerEnter:T,onPointerLeave:ne,tabIndex:oe}=o,pe=Q(o,["orientation","align","step","loop","dragFree","transition","autoplay","controls","controlsFrom","edgeBehavior","hideControlsWhenFits","wheelGestures","index","defaultIndex","onIndexChange","setApi","opts","className","children","onKeyDown","onFocus","onPointerEnter","onPointerLeave","tabIndex"]),ve=Ot(),[J,lt]=G(),Pe=J!=null?J:ve,P=Tt(),H=v!==!1,Ee=vn(v),W=Ie(R),[me]=G(()=>{var n;return(n=W!=null?W:Ie(V))!=null?n:0}),at=de(()=>{const n=[];if(H&&n.push(xt({delay:Ee,playOnInit:!1,stopOnInteraction:!0,stopOnFocusIn:!1,stopOnMouseEnter:!1})),s==="fade"&&n.push(yt()),F){const l=St();n.push(A(N({},l),{init(a,m){a.scrollSnapList().length>1&&a.internalEngine().options.watchDrag!==!1&&l.init(a,m)}}))}return n},[H,Ee,s,F]),[Fe,i]=Ct(A(N({containScroll:"trimSnaps"},z),{axis:r==="horizontal"?"x":"y",align:c,loop:d,dragFree:p,slidesToScroll:f==="page"?"auto":Ye(f,1),startIndex:me}),at),[X,st]=G(()=>A(N({},Wt),{selectedIndex:me})),[ge,Re]=G(null),[ct,ke]=G(!1),[ut,dt]=G(!0),Le=w(null),ft=Ue(t,Le),re=w(null),ie=w(null),be=w(null),he=w(!1),B=w(me),xe=w(C),Ae=w(f),Oe=w(null),le=w(null),M=X.snapCount>1,Te=rt(f,X),Y=ge?ge==="paused":P,U=H&&M&&!Y&&!ct,Me=w(U),ae=w(null),De=w(P),se=K(()=>{i&&(i.scrollPrev(P),ze(i))},[i,P]),ce=K(()=>{i&&(i.scrollNext(P),ze(i))},[i,P]),ue=K(n=>{if(!i)return;const l=n!==i.selectedScrollSnap();i.scrollTo(n,P),l&&ze(i)},[i,P]),ye=K(n=>{he.current=!0;try{n()}finally{he.current=!1}},[]),Se=K(n=>ye(n==="previous"?se:ce),[ye,se,ce]),je=K(()=>{var n;return(n=ae.current)==null?void 0:n.call(ae)},[]),$e=K(()=>Re(Y?"playing":"paused"),[Y]),pt=n=>{$==null||$(n);const l=Bt[r][n.key],a=Kt[n.key];if(!(!l&&!a||n.defaultPrevented)&&!(n.altKey||n.ctrlKey||n.metaKey||n.shiftKey)&&n.currentTarget.contains(n.target)&&!fn(n,r)){if(a){const m=n.target===n.currentTarget||n.target===re.current||n.target===ie.current;if(!i||!M||!m)return;const g=a==="first"?0:i.scrollSnapList().length-1;n.preventDefault(),ye(()=>ue(g));return}l&&(n.preventDefault(),Se(l))}},vt=n=>{O==null||O(n),!(!H||ge==="playing")&&pn(n.target)&&Re("paused")},mt=n=>{T==null||T(n),n.pointerType==="mouse"&&ke(!0)},gt=n=>{ne==null||ne(n),n.pointerType==="mouse"&&ke(!1)},We=de(()=>({isEnabled:H,isPaused:Y,isRotating:U,toggle:$e}),[H,Y,U,$e]),bt=de(()=>A(N({},X),{orientation:r,transition:s,controls:S,controlsFrom:x,edgeBehavior:y,hideControlsWhenFits:E,isPaged:Te,isScrollable:M,contentId:Pe,setContentId:lt,viewportRef:Fe,previousButtonRef:re,nextButtonRef:ie,scrollPrev:se,scrollNext:ce,scrollTo:ue,scrollFromArrow:Se,syncFadeInert:je,autoplay:We}),[X,r,s,S,x,y,E,Te,M,Pe,Fe,se,ce,ue,Se,je,We]);return L(()=>{xe.current=C,Ae.current=f,Me.current=U,De.current=P}),L(()=>{i&&k&&k(i)},[i,k]),L(()=>{if(!i)return;let n=!1;const l=(g,u)=>{const b=ln(i),_=u==="select"&&n;_&&(n=!1);const Be=u!=="select"?void 0:_?"":mn(i,rt(Ae.current,b));be.current=he.current?cn(b,re.current,ie.current):null,st(Ce=>{const Ke=A(N({},b),{announcement:Be!=null?Be:Ce.announcement});return an(Ce,Ke)?Ce:Ke})},a=()=>{const g=le.current,u=g!==null&&g<i.scrollSnapList().length;u&&(le.current=null,B.current=g);const b=B.current;if(i.selectedScrollSnap()!==b){n=!u;try{i.scrollTo(b,!0)}finally{n=!1}}},m=()=>{var g;const u=i.selectedScrollSnap();u!==B.current&&(B.current=u,(g=xe.current)==null||g.call(xe,u))};return B.current=i.selectedScrollSnap(),l(),i.on("reInit",a).on("select",l).on("reInit",l).on("select",m).on("reInit",m),()=>{i.off("reInit",a).off("select",l).off("reInit",l).off("select",m).off("reInit",m)}},[i]),L(()=>{const n=Le.current;if(!n||!M)return;const l=n.ownerDocument.defaultView,a=()=>{const g=n.querySelectorAll(Vt);dt(Array.from(g).some(u=>!(u.hasAttribute("tabindex")&&u.tabIndex<0)&&!u.matches(":disabled")&&!u.closest("[hidden], [inert]")&&u.getClientRects().length>0&&getComputedStyle(u).visibility==="visible"))};a();const m=new MutationObserver(a);return m.observe(n,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["class","style","hidden","inert","disabled","href","type","tabindex","contenteditable","controls","open"]}),l==null||l.addEventListener("resize",a),()=>{m.disconnect(),l==null||l.removeEventListener("resize",a)}},[M]),L(()=>{var n;const l=be.current;l&&(be.current=null,(n=(l==="previous"?re:ie).current)==null||n.focus({preventScroll:!0}))},[X]),L(()=>{const n=Oe.current;if(!i||n&&sn(n,e))return;if(Oe.current=e,W===void 0){le.current=null;return}const l=i.selectedScrollSnap(),a=W===Ie(n==null?void 0:n.index);if(l!==B.current&&a)return;const m=Math.max(0,i.scrollSnapList().length-1);le.current=W>m?W:null;const g=Math.min(W,m);g!==l&&(B.current=g,ue(g))}),L(()=>{if(!i||s!=="fade")return;const n=new Set,l=()=>{const a=i.slideNodes(),m=new Set(tt(i)),g=a.some((b,_)=>!m.has(_)&&b.contains(document.activeElement));a.forEach((b,_)=>{b.inert=!m.has(_)||nt(b),b.inert&&n.has(b)&&(ot(b),n.delete(b))});const u=g?a.find(b=>!b.inert):void 0;u&&(u.hasAttribute("tabindex")||(u.tabIndex=-1,n.add(u)),u.focus({preventScroll:!0}))};return ae.current=l,l(),i.on("select",l).on("reInit",l),()=>{ae.current=null,i.off("select",l).off("reInit",l);for(const a of i.slideNodes())a.inert=nt(a);n.forEach(ot)}},[i,s]),L(()=>{var n;const l=(n=i==null?void 0:i.plugins())==null?void 0:n.autoplay;l&&(U?l.play(P):l.stop())},[i,U,P]),L(()=>{if(!i)return;const n=()=>{var l,a;Me.current&&((a=(l=i.plugins())==null?void 0:l.autoplay)==null||a.play(De.current))};return i.on("pointerUp",n).on("reInit",n),()=>{i.off("pointerUp",n).off("reInit",n)}},[i]),h(we.Provider,{value:bt,children:h("div",A(N({ref:ft,role:"region","aria-roledescription":"carousel","data-slot":"carousel","data-orientation":r,"data-scrollable":M,tabIndex:oe!=null?oe:M&&!ut?0:void 0,className:I(Jt({orientation:r,controls:S}),qt,q),onKeyDown:pt,onFocus:vt,onPointerEnter:mt,onPointerLeave:gt},pe),{children:j}))})}),hn=D(function(e,t){var o=e,{gap:r="md",fadeEdges:c=!1,fadeClassName:f,viewportClassName:d,className:p,children:s,id:v}=o,S=Q(o,["gap","fadeEdges","fadeClassName","viewportClassName","className","children","id"]);const{viewportRef:x,orientation:y,controls:E,canScrollPrev:F,canScrollNext:R,announcement:V,autoplay:C,contentId:k,setContentId:z}=te();Ft(()=>(z(v),()=>z(void 0)),[v,z]);const q=et(s),j=Zt[r][y];return Ve("div",{ref:x,"data-slot":"carousel-viewport",className:I(Xt({orientation:y,controls:E}),d),children:[h("div",A(N({ref:t,id:v!=null?v:k,"data-slot":"carousel-content",className:I("flex touch-pinch-zoom",y==="horizontal"?"touch-pan-y":"touch-pan-x flex-col",j.content,p)},S),{children:q.map(($,O)=>{var T;return h(Xe.Provider,{value:{index:O,total:q.length,gapClassName:j.item,focusRingClassName:j.focusRing},children:$},(T=$.key)!=null?T:O)})})),h("div",{"data-slot":"carousel-live","aria-live":C.isRotating?"off":"polite","aria-atomic":"true",className:"sr-only",children:V}),c&&Ve(ht,{children:[h("div",{"aria-hidden":"true","data-slot":"carousel-fade-start",className:I(Je({orientation:y,edge:"start",visible:F}),f)}),h("div",{"aria-hidden":"true","data-slot":"carousel-fade-end",className:I(Je({orientation:y,edge:"end",visible:R}),f)})]})]})}),xn=D(function(e,t){var o=e,{className:r,inert:c}=o,f=Q(o,["className","inert"]);const d=Ne(Xe),p=Ne(we),s=p==null?void 0:p.syncFadeInert,v=(p==null?void 0:p.transition)==="fade",S=!!c||c==="",x={[Ze]:S||void 0};return L(()=>{s==null||s()},[S,s]),h("div",N(A(N({ref:t,role:"group","aria-roledescription":"slide","aria-label":d?`${d.index+1} de ${d.total}`:void 0,"data-slot":"carousel-item"},x),{inert:c,className:I("min-w-0 shrink-0 grow-0 basis-full",d==null?void 0:d.gapClassName,v&&tn,v&&(d==null?void 0:d.focusRingClassName),r)}),f))}),it=D(function(e,t){var o=e,{direction:r,variant:c="outlined",size:f="md",className:d,containerClassName:p,disabled:s,onClick:v}=o,S=Q(o,["direction","variant","size","className","containerClassName","disabled","onClick"]);const{orientation:x,controls:y,controlsFrom:E,edgeBehavior:F,hideControlsWhenFits:R,isScrollable:V,canScrollPrev:C,canScrollNext:k,scrollFromArrow:z,previousButtonRef:q,nextButtonRef:j,contentId:$}=te(),O=r==="previous",T=O?C:k,ne=Ue(t,O?q:j),oe=F==="hide"&&!T||R&&!V,pe=Gt[x][r],ve=J=>{v==null||v(J),!J.defaultPrevented&&z(r)};return h(He,N({ref:ne,"data-slot":`carousel-${r}`,variant:c,size:f,"aria-label":Qt[r],"aria-controls":$,iconLeft:h(pe,{"aria-hidden":"true"}),disabled:s||!T,containerClassName:I(Yt({orientation:x,controls:y,direction:r,controlsFrom:E}),oe&&"invisible",p),className:I(en({orientation:x,controls:y,direction:r,opaque:c==="outlined"}),d),onClick:ve},S))}),yn=D(function(e,t){return h(it,N({ref:t,direction:"previous"},e))}),Sn=D(function(e,t){return h(it,N({ref:t,direction:"next"},e))}),Cn=D(function(e,t){var o=e,{getDotLabel:r,dotClassName:c,indicatorClassName:f,className:d}=o,p=Q(o,["getDotLabel","dotClassName","indicatorClassName","className"]);const{snapCount:s,snapFirstSlides:v,selectedIndex:S,isPaged:x,isScrollable:y,hideControlsWhenFits:E,scrollTo:F,contentId:R}=te();return h("div",A(N({ref:t,role:"group","aria-label":x?"Escolher p\xE1gina":"Escolher slide","data-slot":"carousel-dots",className:I("mt-2 flex min-h-6 items-center justify-center",E&&!y&&"invisible",d)},p),{children:Array.from({length:s},(V,C)=>{var k;const z=C===S;return h("button",{type:"button","data-slot":"carousel-dot","data-active":z,"aria-label":r?r(C,s):gn(x?C:(k=v[C])!=null?k:C,x),"aria-current":z||void 0,"aria-controls":R,onClick:()=>F(C),className:I(nn,c),children:h("span",{"data-slot":"carousel-dot-indicator","data-active":z,className:I(on,f)})},C)})}))}),Nn=D(function(e,t){var o=e,{variant:r="outlined",size:c="sm",containerClassName:f,onClick:d}=o,p=Q(o,["variant","size","containerClassName","onClick"]);const{autoplay:s,isScrollable:v,hideControlsWhenFits:S}=te(),x=s.isPaused?Pt:Et,y=s.isPaused?"Iniciar rota\xE7\xE3o autom\xE1tica":"Pausar rota\xE7\xE3o autom\xE1tica",E=S&&!v,F=R=>{d==null||d(R),R.defaultPrevented||s.toggle()};return s.isEnabled?h(He,N({ref:t,"data-slot":"carousel-autoplay-toggle",variant:r,size:c,"aria-label":y,iconLeft:h(x,{"aria-hidden":"true"}),containerClassName:I("relative z-10",E&&"invisible",f),onClick:F},p)):null});export{bn as Carousel,Nn as CarouselAutoplayToggle,hn as CarouselContent,Cn as CarouselDots,xn as CarouselItem,Sn as CarouselNext,yn as CarouselPrevious,rn as useCarousel};
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  "use client";
3
- "use strict";var r=require("react/jsx-runtime"),f=require("radix-ui"),d=require("react"),C=require("./Dismiss.js"),D=require("./Separator.js"),c=require("../lib/utils.js"),z=Object.defineProperty,q=Object.defineProperties,M=Object.getOwnPropertyDescriptors,P=Object.getOwnPropertySymbols,N=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable,y=(t,e,a)=>e in t?z(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,m=(t,e)=>{for(var a in e||(e={}))N.call(e,a)&&y(t,a,e[a]);if(P)for(var a of P(e))j.call(e,a)&&y(t,a,e[a]);return t},w=(t,e)=>q(t,M(e)),p=(t,e)=>{var a={};for(var o in t)N.call(t,o)&&e.indexOf(o)<0&&(a[o]=t[o]);if(t!=null&&P)for(var o of P(t))e.indexOf(o)<0&&j.call(t,o)&&(a[o]=t[o]);return a};const R=40,k=.25,U=.5,Y=16,E="button, a, input, select, textarea, label, [role='button'], [contenteditable='true']",O=d.createContext(!1),I=d.createContext(()=>{});function F(t){var e=t,{open:a,defaultOpen:o=!1,onOpenChange:s}=e,n=p(e,["open","defaultOpen","onOpenChange"]);const l=a!==void 0,[i,u]=d.useState(o),h=l?a:i,g=d.useCallback(v=>{l||u(v),s==null||s(v)},[l,s]),x=d.useCallback(()=>g(!1),[g]);return r.jsx(I.Provider,{value:x,children:r.jsx(f.Dialog.Root,m({"data-slot":"dialog",open:h,onOpenChange:g},n))})}function b(t,e){return a=>{t==null||t(a),a.defaultPrevented||e(a)}}function L(t){const e=t.currentTarget,a=t.target,o=e.querySelector('[data-slot="dialog-handle"]');return t.button!==0||!(o!=null&&o.getClientRects().length)||a.closest('[data-slot="dialog-container"]')!==e||a.closest(E)?!1:t.clientY-e.getBoundingClientRect().top<=R||!!a.closest('[data-slot="dialog-header"]')}function $(t){const e=d.useRef(null),a=n=>{if(!L(n))return;const l=n.currentTarget;l.setPointerCapture(n.pointerId),l.dataset.dragging="",e.current={pointerId:n.pointerId,startY:n.clientY,startTime:n.timeStamp,offset:0}},o=n=>{const l=e.current;(l==null?void 0:l.pointerId)===n.pointerId&&(l.offset=Math.max(0,n.clientY-l.startY),n.currentTarget.style.transform=`translateY(${l.offset}px)`)},s=n=>{const l=e.current;if((l==null?void 0:l.pointerId)!==n.pointerId)return;const i=n.currentTarget;e.current=null,delete i.dataset.dragging,i.hasPointerCapture(n.pointerId)&&i.releasePointerCapture(n.pointerId);const u=l.offset/Math.max(n.timeStamp-l.startTime,1);if(!(n.type==="pointerup"&&(l.offset>i.offsetHeight*k||l.offset>Y&&u>U))){i.style.transform="";return}t(),requestAnimationFrame(()=>{i.dataset.state==="open"&&(i.style.transform="")})};return{onPointerDown:a,onPointerMove:o,onPointerUp:s,onPointerCancel:s}}const _=d.forwardRef(function(t,e){return r.jsx(f.Dialog.Trigger,m({ref:e,"data-slot":"dialog-trigger"},t))});function S(t){var e=p(t,[]);return r.jsx(f.Dialog.Portal,m({"data-slot":"dialog-portal"},e))}const A=d.forwardRef(function(t,e){return r.jsx(f.Dialog.Close,m({ref:e,"data-slot":"dialog-close"},t))});function T(t){var e=t,{className:a}=e,o=p(e,["className"]);return r.jsx(f.Dialog.Overlay,m({"data-slot":"dialog-overlay",className:c.cn("fixed inset-0 z-50 bg-backdrop data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 motion-reduce:!animate-none",a)},o))}function B(t){var e=t,{className:a,overlayClassName:o,children:s,showCloseButton:n=!0,closeLabel:l="Fechar",onPointerDown:i,onPointerMove:u,onPointerUp:h,onPointerCancel:g}=e,x=p(e,["className","overlayClassName","children","showCloseButton","closeLabel","onPointerDown","onPointerMove","onPointerUp","onPointerCancel"]);const v=$(d.useContext(I));return r.jsxs(S,{"data-slot":"dialog-portal",children:[r.jsx(T,{className:c.cn("modal-overlay",o)}),r.jsxs(f.Dialog.Content,w(m({"data-slot":"dialog-container",className:c.cn("modal-overlay fixed left-1/2 top-1/2 z-50 flex max-h-[85dvh] w-full max-w-[568px] -translate-x-1/2 -translate-y-1/2 flex-col gap-0 overflow-y-auto rounded-lg bg-surface-elevated p-0 shadow-level-5 duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-1/2 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-1/2 motion-reduce:!animate-none md:max-h-[85vh]","max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:max-w-none max-md:translate-x-0 max-md:translate-y-0 max-md:rounded-b-none max-md:data-[state=closed]:zoom-out-100 max-md:data-[state=open]:zoom-in-100 max-md:data-[state=closed]:slide-out-to-bottom max-md:data-[state=closed]:slide-out-to-left-0 max-md:data-[state=open]:slide-in-from-bottom max-md:data-[state=open]:slide-in-from-left-0","data-[dragging]:transition-none max-md:ease-out max-md:motion-safe:transition-transform max-md:[&>[data-slot=dialog-handle]+[data-slot=dialog-header]]:pt-10 max-md:[&_[data-slot=dialog-header]]:touch-none",a)},x),{onPointerDown:b(i,v.onPointerDown),onPointerMove:b(u,v.onPointerMove),onPointerUp:b(h,v.onPointerUp),onPointerCancel:b(g,v.onPointerCancel),children:[r.jsx("div",{"aria-hidden":!0,"data-slot":"dialog-handle",className:"pointer-events-none absolute left-1/2 top-4 z-10 h-1 w-11 -translate-x-1/2 rounded-pill bg-gray-stroke md:hidden"}),r.jsx(O.Provider,{value:n,children:s}),n&&r.jsx(f.Dialog.Close,{"data-slot":"dialog-close",asChild:!0,children:r.jsx(C.Dismiss,{label:l,className:c.cn(C.DISMISS_PANEL_POSITION,"max-md:top-[34px]")})})]}))]})}function H(t){var e=t,{containerClassName:a,className:o}=e,s=p(e,["containerClassName","className"]);return r.jsx("div",{className:c.cn("mb-auto overflow-y-auto",a),children:r.jsx("div",m({"data-slot":"dialog-content",className:c.cn("px-8 py-6 text-md leading-md text-primary-foreground",o)},s))})}function V(t){var e=t,{className:a,separator:o=!1}=e,s=p(e,["className","separator"]);const n=d.useContext(O);return r.jsxs(r.Fragment,{children:[r.jsx("div",m({"data-slot":"dialog-header",className:c.cn("flex flex-col gap-2 px-8 py-6 text-left",n&&"pr-14",a)},s)),o&&r.jsx(D.Separator,{})]})}function W(t){var e=t,{className:a,separator:o=!1}=e,s=p(e,["className","separator"]);return r.jsxs(r.Fragment,{children:[o&&r.jsx(D.Separator,{}),r.jsx("div",m({"data-slot":"dialog-footer",className:c.cn("flex justify-end gap-2 px-8 py-6",a)},s))]})}function G(t){var e=t,{className:a,iconLeft:o,iconRight:s,children:n}=e,l=p(e,["className","iconLeft","iconRight","children"]);const i=u=>{var h,g;if(d.isValidElement(u)){const x=u;return d.cloneElement(x,{size:(h=x.props.size)!=null?h:32,strokeWidth:(g=x.props.strokeWidth)!=null?g:2.2,className:c.cn("flex-shrink-0",x.props.className)})}return u};return r.jsxs(f.Dialog.Title,w(m({"data-slot":"dialog-title",className:c.cn("flex items-center gap-3 text-title-md font-semibold leading-title-md !text-content-title",a)},l),{children:[o&&i(o),n,s&&i(s)]}))}function J(t){var e=t,{className:a}=e,o=p(e,["className"]);return r.jsx(f.Dialog.Description,m({"data-slot":"dialog-description",className:c.cn("text-md leading-md text-content-paragraph",a)},o))}exports.Dialog=F,exports.DialogClose=A,exports.DialogContainer=B,exports.DialogContent=H,exports.DialogDescription=J,exports.DialogFooter=W,exports.DialogHeader=V,exports.DialogOverlay=T,exports.DialogPortal=S,exports.DialogTitle=G,exports.DialogTrigger=_;
3
+ "use strict";var r=require("react/jsx-runtime"),p=require("radix-ui"),d=require("react"),I=require("./Dismiss.js"),P=require("./Separator.js"),m=require("../lib/utils.js"),q=Object.defineProperty,R=Object.defineProperties,S=Object.getOwnPropertyDescriptors,b=Object.getOwnPropertySymbols,j=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,D=(t,e,a)=>e in t?q(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,c=(t,e)=>{for(var a in e||(e={}))j.call(e,a)&&D(t,a,e[a]);if(b)for(var a of b(e))y.call(e,a)&&D(t,a,e[a]);return t},N=(t,e)=>R(t,S(e)),f=(t,e)=>{var a={};for(var o in t)j.call(t,o)&&e.indexOf(o)<0&&(a[o]=t[o]);if(t!=null&&b)for(var o of b(t))e.indexOf(o)<0&&y.call(t,o)&&(a[o]=t[o]);return a};const k=40,M=.25,U=.5,Y=16,F="button, a, input, select, textarea, label, [role='button'], [contenteditable='true']",L="sticky top-[18px] z-10 order-first -mb-[46px] mr-[18px] mt-[18px] self-end max-md:top-[34px] max-md:-mb-[62px] max-md:mt-[34px]",w=d.createContext(!1),O=d.createContext(()=>{});function $(t){var e=t,{open:a,defaultOpen:o=!1,onOpenChange:l}=e,n=f(e,["open","defaultOpen","onOpenChange"]);const s=a!==void 0,[i,u]=d.useState(o),h=s?a:i,x=d.useCallback(v=>{s||u(v),l==null||l(v)},[s,l]),g=d.useCallback(()=>x(!1),[x]);return r.jsx(O.Provider,{value:g,children:r.jsx(p.Dialog.Root,c({"data-slot":"dialog",open:h,onOpenChange:x},n))})}function C(t,e){return a=>{t==null||t(a),a.defaultPrevented||e(a)}}function B(t){const e=t.currentTarget,a=t.target,o=e.querySelector('[data-slot="dialog-handle"]');return t.button!==0||!(o!=null&&o.getClientRects().length)||a.closest('[data-slot="dialog-container"]')!==e||a.closest(F)?!1:t.clientY-e.getBoundingClientRect().top<=k||!!a.closest('[data-slot="dialog-header"]')}function E(t){const e=d.useRef(null),a=n=>{if(!B(n))return;const s=n.currentTarget;s.setPointerCapture(n.pointerId),s.dataset.dragging="",e.current={pointerId:n.pointerId,startY:n.clientY,startTime:n.timeStamp,offset:0}},o=n=>{const s=e.current;(s==null?void 0:s.pointerId)===n.pointerId&&(s.offset=Math.max(0,n.clientY-s.startY),n.currentTarget.style.transform=`translateY(${s.offset}px)`)},l=n=>{const s=e.current;if((s==null?void 0:s.pointerId)!==n.pointerId)return;const i=n.currentTarget;e.current=null,delete i.dataset.dragging,i.hasPointerCapture(n.pointerId)&&i.releasePointerCapture(n.pointerId);const u=s.offset/Math.max(n.timeStamp-s.startTime,1);if(!(n.type==="pointerup"&&(s.offset>i.offsetHeight*M||s.offset>Y&&u>U))){i.style.transform="";return}t(),requestAnimationFrame(()=>{i.dataset.state==="open"&&(i.style.transform="")})};return{onPointerDown:a,onPointerMove:o,onPointerUp:l,onPointerCancel:l}}const H=d.forwardRef(function(t,e){return r.jsx(p.Dialog.Trigger,c({ref:e,"data-slot":"dialog-trigger"},t))});function z(t){var e=f(t,[]);return r.jsx(p.Dialog.Portal,c({"data-slot":"dialog-portal"},e))}const V=d.forwardRef(function(t,e){return r.jsx(p.Dialog.Close,c({ref:e,"data-slot":"dialog-close"},t))});function T(t){var e=t,{className:a}=e,o=f(e,["className"]);return r.jsx(p.Dialog.Overlay,c({"data-slot":"dialog-overlay",className:m.cn("fixed inset-0 z-50 bg-backdrop data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 motion-reduce:!animate-none",a)},o))}function W(t){var e=t,{className:a,overlayClassName:o,children:l,showCloseButton:n=!0,closeLabel:s="Fechar",onPointerDown:i,onPointerMove:u,onPointerUp:h,onPointerCancel:x}=e,g=f(e,["className","overlayClassName","children","showCloseButton","closeLabel","onPointerDown","onPointerMove","onPointerUp","onPointerCancel"]);const v=E(d.useContext(O));return r.jsxs(z,{"data-slot":"dialog-portal",children:[r.jsx(T,{className:m.cn("modal-overlay",o)}),r.jsxs(p.Dialog.Content,N(c({"data-slot":"dialog-container",className:m.cn("modal-overlay fixed left-1/2 top-1/2 z-50 flex max-h-[85dvh] w-full max-w-[568px] -translate-x-1/2 -translate-y-1/2 flex-col gap-0 overflow-y-auto rounded-lg bg-surface-elevated p-0 shadow-level-5 duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-1/2 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-1/2 motion-reduce:!animate-none md:max-h-[85vh]","max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:max-w-none max-md:translate-x-0 max-md:translate-y-0 max-md:rounded-b-none max-md:data-[state=closed]:zoom-out-100 max-md:data-[state=open]:zoom-in-100 max-md:data-[state=closed]:slide-out-to-bottom max-md:data-[state=closed]:slide-out-to-left-0 max-md:data-[state=open]:slide-in-from-bottom max-md:data-[state=open]:slide-in-from-left-0","data-[dragging]:transition-none max-md:ease-out max-md:motion-safe:transition-transform max-md:[&>[data-slot=dialog-handle]+[data-slot=dialog-header]]:pt-10 max-md:[&_[data-slot=dialog-header]]:touch-none",a)},g),{onPointerDown:C(i,v.onPointerDown),onPointerMove:C(u,v.onPointerMove),onPointerUp:C(h,v.onPointerUp),onPointerCancel:C(x,v.onPointerCancel),children:[r.jsx("div",{"aria-hidden":!0,"data-slot":"dialog-handle",className:"pointer-events-none absolute left-1/2 top-4 z-10 h-1 w-11 -translate-x-1/2 rounded-pill bg-gray-stroke md:hidden"}),r.jsx(w.Provider,{value:n,children:l}),n&&r.jsx(p.Dialog.Close,{"data-slot":"dialog-close",asChild:!0,children:r.jsx(I.Dismiss,{label:s,className:L})})]}))]})}function _(t){var e=t,{containerClassName:a,className:o}=e,l=f(e,["containerClassName","className"]);return r.jsx("div",{className:m.cn("mb-auto overflow-y-auto",a),children:r.jsx("div",c({"data-slot":"dialog-content",className:m.cn("px-8 py-6 text-md leading-md text-primary-foreground",o)},l))})}function A(t){var e=t,{className:a,separator:o=!1}=e,l=f(e,["className","separator"]);const n=d.useContext(w);return r.jsxs(r.Fragment,{children:[r.jsx("div",c({"data-slot":"dialog-header",className:m.cn("flex flex-col gap-2 px-8 py-6 text-left",n&&"pr-14",a)},l)),o&&r.jsx(P.Separator,{})]})}function G(t){var e=t,{className:a,separator:o=!1}=e,l=f(e,["className","separator"]);return r.jsxs(r.Fragment,{children:[o&&r.jsx(P.Separator,{}),r.jsx("div",c({"data-slot":"dialog-footer",className:m.cn("flex justify-end gap-2 px-8 py-6",a)},l))]})}function J(t){var e=t,{className:a,iconLeft:o,iconRight:l,children:n}=e,s=f(e,["className","iconLeft","iconRight","children"]);const i=u=>{var h,x;if(d.isValidElement(u)){const g=u;return d.cloneElement(g,{size:(h=g.props.size)!=null?h:32,strokeWidth:(x=g.props.strokeWidth)!=null?x:2.2,className:m.cn("flex-shrink-0",g.props.className)})}return u};return r.jsxs(p.Dialog.Title,N(c({"data-slot":"dialog-title",className:m.cn("flex items-center gap-3 text-title-md font-semibold leading-title-md !text-content-title",a)},s),{children:[o&&i(o),n,l&&i(l)]}))}function K(t){var e=t,{className:a}=e,o=f(e,["className"]);return r.jsx(p.Dialog.Description,c({"data-slot":"dialog-description",className:m.cn("text-md leading-md text-content-paragraph",a)},o))}exports.Dialog=$,exports.DialogClose=V,exports.DialogContainer=W,exports.DialogContent=_,exports.DialogDescription=K,exports.DialogFooter=G,exports.DialogHeader=A,exports.DialogOverlay=T,exports.DialogPortal=z,exports.DialogTitle=J,exports.DialogTrigger=H;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  "use client";
3
- import{jsx as l,jsxs as h,Fragment as b}from"react/jsx-runtime";import{Dialog as u}from"radix-ui";import{createContext as y,forwardRef as C,useState as U,useCallback as D,useContext as w,useRef as Y,isValidElement as E,cloneElement as L}from"react";import{Dismiss as F,DISMISS_PANEL_POSITION as _}from"./Dismiss.mjs";import{Separator as O}from"./Separator.mjs";import{cn as d}from"../lib/utils.mjs";var q=Object.defineProperty,A=Object.defineProperties,B=Object.getOwnPropertyDescriptors,P=Object.getOwnPropertySymbols,I=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable,j=(t,e,a)=>e in t?q(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,c=(t,e)=>{for(var a in e||(e={}))I.call(e,a)&&j(t,a,e[a]);if(P)for(var a of P(e))T.call(e,a)&&j(t,a,e[a]);return t},z=(t,e)=>A(t,B(e)),f=(t,e)=>{var a={};for(var o in t)I.call(t,o)&&e.indexOf(o)<0&&(a[o]=t[o]);if(t!=null&&P)for(var o of P(t))e.indexOf(o)<0&&T.call(t,o)&&(a[o]=t[o]);return a};const H=40,$=.25,V=.5,W=16,G="button, a, input, select, textarea, label, [role='button'], [contenteditable='true']",S=y(!1),M=y(()=>{});function J(t){var e=t,{open:a,defaultOpen:o=!1,onOpenChange:s}=e,n=f(e,["open","defaultOpen","onOpenChange"]);const r=a!==void 0,[i,m]=U(o),v=r?a:i,p=D(x=>{r||m(x),s==null||s(x)},[r,s]),g=D(()=>p(!1),[p]);return l(M.Provider,{value:g,children:l(u.Root,c({"data-slot":"dialog",open:v,onOpenChange:p},n))})}function N(t,e){return a=>{t==null||t(a),a.defaultPrevented||e(a)}}function K(t){const e=t.currentTarget,a=t.target,o=e.querySelector('[data-slot="dialog-handle"]');return t.button!==0||!(o!=null&&o.getClientRects().length)||a.closest('[data-slot="dialog-container"]')!==e||a.closest(G)?!1:t.clientY-e.getBoundingClientRect().top<=H||!!a.closest('[data-slot="dialog-header"]')}function Q(t){const e=Y(null),a=n=>{if(!K(n))return;const r=n.currentTarget;r.setPointerCapture(n.pointerId),r.dataset.dragging="",e.current={pointerId:n.pointerId,startY:n.clientY,startTime:n.timeStamp,offset:0}},o=n=>{const r=e.current;(r==null?void 0:r.pointerId)===n.pointerId&&(r.offset=Math.max(0,n.clientY-r.startY),n.currentTarget.style.transform=`translateY(${r.offset}px)`)},s=n=>{const r=e.current;if((r==null?void 0:r.pointerId)!==n.pointerId)return;const i=n.currentTarget;e.current=null,delete i.dataset.dragging,i.hasPointerCapture(n.pointerId)&&i.releasePointerCapture(n.pointerId);const m=r.offset/Math.max(n.timeStamp-r.startTime,1);if(!(n.type==="pointerup"&&(r.offset>i.offsetHeight*$||r.offset>W&&m>V))){i.style.transform="";return}t(),requestAnimationFrame(()=>{i.dataset.state==="open"&&(i.style.transform="")})};return{onPointerDown:a,onPointerMove:o,onPointerUp:s,onPointerCancel:s}}const X=C(function(t,e){return l(u.Trigger,c({ref:e,"data-slot":"dialog-trigger"},t))});function R(t){var e=f(t,[]);return l(u.Portal,c({"data-slot":"dialog-portal"},e))}const Z=C(function(t,e){return l(u.Close,c({ref:e,"data-slot":"dialog-close"},t))});function k(t){var e=t,{className:a}=e,o=f(e,["className"]);return l(u.Overlay,c({"data-slot":"dialog-overlay",className:d("fixed inset-0 z-50 bg-backdrop data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 motion-reduce:!animate-none",a)},o))}function ee(t){var e=t,{className:a,overlayClassName:o,children:s,showCloseButton:n=!0,closeLabel:r="Fechar",onPointerDown:i,onPointerMove:m,onPointerUp:v,onPointerCancel:p}=e,g=f(e,["className","overlayClassName","children","showCloseButton","closeLabel","onPointerDown","onPointerMove","onPointerUp","onPointerCancel"]);const x=Q(w(M));return h(R,{"data-slot":"dialog-portal",children:[l(k,{className:d("modal-overlay",o)}),h(u.Content,z(c({"data-slot":"dialog-container",className:d("modal-overlay fixed left-1/2 top-1/2 z-50 flex max-h-[85dvh] w-full max-w-[568px] -translate-x-1/2 -translate-y-1/2 flex-col gap-0 overflow-y-auto rounded-lg bg-surface-elevated p-0 shadow-level-5 duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-1/2 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-1/2 motion-reduce:!animate-none md:max-h-[85vh]","max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:max-w-none max-md:translate-x-0 max-md:translate-y-0 max-md:rounded-b-none max-md:data-[state=closed]:zoom-out-100 max-md:data-[state=open]:zoom-in-100 max-md:data-[state=closed]:slide-out-to-bottom max-md:data-[state=closed]:slide-out-to-left-0 max-md:data-[state=open]:slide-in-from-bottom max-md:data-[state=open]:slide-in-from-left-0","data-[dragging]:transition-none max-md:ease-out max-md:motion-safe:transition-transform max-md:[&>[data-slot=dialog-handle]+[data-slot=dialog-header]]:pt-10 max-md:[&_[data-slot=dialog-header]]:touch-none",a)},g),{onPointerDown:N(i,x.onPointerDown),onPointerMove:N(m,x.onPointerMove),onPointerUp:N(v,x.onPointerUp),onPointerCancel:N(p,x.onPointerCancel),children:[l("div",{"aria-hidden":!0,"data-slot":"dialog-handle",className:"pointer-events-none absolute left-1/2 top-4 z-10 h-1 w-11 -translate-x-1/2 rounded-pill bg-gray-stroke md:hidden"}),l(S.Provider,{value:n,children:s}),n&&l(u.Close,{"data-slot":"dialog-close",asChild:!0,children:l(F,{label:r,className:d(_,"max-md:top-[34px]")})})]}))]})}function te(t){var e=t,{containerClassName:a,className:o}=e,s=f(e,["containerClassName","className"]);return l("div",{className:d("mb-auto overflow-y-auto",a),children:l("div",c({"data-slot":"dialog-content",className:d("px-8 py-6 text-md leading-md text-primary-foreground",o)},s))})}function ae(t){var e=t,{className:a,separator:o=!1}=e,s=f(e,["className","separator"]);const n=w(S);return h(b,{children:[l("div",c({"data-slot":"dialog-header",className:d("flex flex-col gap-2 px-8 py-6 text-left",n&&"pr-14",a)},s)),o&&l(O,{})]})}function oe(t){var e=t,{className:a,separator:o=!1}=e,s=f(e,["className","separator"]);return h(b,{children:[o&&l(O,{}),l("div",c({"data-slot":"dialog-footer",className:d("flex justify-end gap-2 px-8 py-6",a)},s))]})}function ne(t){var e=t,{className:a,iconLeft:o,iconRight:s,children:n}=e,r=f(e,["className","iconLeft","iconRight","children"]);const i=m=>{var v,p;if(E(m)){const g=m;return L(g,{size:(v=g.props.size)!=null?v:32,strokeWidth:(p=g.props.strokeWidth)!=null?p:2.2,className:d("flex-shrink-0",g.props.className)})}return m};return h(u.Title,z(c({"data-slot":"dialog-title",className:d("flex items-center gap-3 text-title-md font-semibold leading-title-md !text-content-title",a)},r),{children:[o&&i(o),n,s&&i(s)]}))}function re(t){var e=t,{className:a}=e,o=f(e,["className"]);return l(u.Description,c({"data-slot":"dialog-description",className:d("text-md leading-md text-content-paragraph",a)},o))}export{J as Dialog,Z as DialogClose,ee as DialogContainer,te as DialogContent,re as DialogDescription,oe as DialogFooter,ae as DialogHeader,k as DialogOverlay,R as DialogPortal,ne as DialogTitle,X as DialogTrigger};
3
+ import{jsx as l,jsxs as h,Fragment as y}from"react/jsx-runtime";import{Dialog as u}from"radix-ui";import{createContext as N,forwardRef as C,useState as U,useCallback as D,useContext as w,useRef as Y,isValidElement as L,cloneElement as B}from"react";import{Dismiss as E}from"./Dismiss.mjs";import{Separator as O}from"./Separator.mjs";import{cn as c}from"../lib/utils.mjs";var F=Object.defineProperty,q=Object.defineProperties,H=Object.getOwnPropertyDescriptors,b=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable,T=(e,t,a)=>t in e?F(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,d=(e,t)=>{for(var a in t||(t={}))z.call(t,a)&&T(e,a,t[a]);if(b)for(var a of b(t))I.call(t,a)&&T(e,a,t[a]);return e},j=(e,t)=>q(e,H(t)),p=(e,t)=>{var a={};for(var o in e)z.call(e,o)&&t.indexOf(o)<0&&(a[o]=e[o]);if(e!=null&&b)for(var o of b(e))t.indexOf(o)<0&&I.call(e,o)&&(a[o]=e[o]);return a};const V=40,W=.25,_=.5,$=16,A="button, a, input, select, textarea, label, [role='button'], [contenteditable='true']",G="sticky top-[18px] z-10 order-first -mb-[46px] mr-[18px] mt-[18px] self-end max-md:top-[34px] max-md:-mb-[62px] max-md:mt-[34px]",M=N(!1),k=N(()=>{});function J(e){var t=e,{open:a,defaultOpen:o=!1,onOpenChange:s}=t,n=p(t,["open","defaultOpen","onOpenChange"]);const r=a!==void 0,[i,m]=U(o),v=r?a:i,f=D(x=>{r||m(x),s==null||s(x)},[r,s]),g=D(()=>f(!1),[f]);return l(k.Provider,{value:g,children:l(u.Root,d({"data-slot":"dialog",open:v,onOpenChange:f},n))})}function P(e,t){return a=>{e==null||e(a),a.defaultPrevented||t(a)}}function K(e){const t=e.currentTarget,a=e.target,o=t.querySelector('[data-slot="dialog-handle"]');return e.button!==0||!(o!=null&&o.getClientRects().length)||a.closest('[data-slot="dialog-container"]')!==t||a.closest(A)?!1:e.clientY-t.getBoundingClientRect().top<=V||!!a.closest('[data-slot="dialog-header"]')}function Q(e){const t=Y(null),a=n=>{if(!K(n))return;const r=n.currentTarget;r.setPointerCapture(n.pointerId),r.dataset.dragging="",t.current={pointerId:n.pointerId,startY:n.clientY,startTime:n.timeStamp,offset:0}},o=n=>{const r=t.current;(r==null?void 0:r.pointerId)===n.pointerId&&(r.offset=Math.max(0,n.clientY-r.startY),n.currentTarget.style.transform=`translateY(${r.offset}px)`)},s=n=>{const r=t.current;if((r==null?void 0:r.pointerId)!==n.pointerId)return;const i=n.currentTarget;t.current=null,delete i.dataset.dragging,i.hasPointerCapture(n.pointerId)&&i.releasePointerCapture(n.pointerId);const m=r.offset/Math.max(n.timeStamp-r.startTime,1);if(!(n.type==="pointerup"&&(r.offset>i.offsetHeight*W||r.offset>$&&m>_))){i.style.transform="";return}e(),requestAnimationFrame(()=>{i.dataset.state==="open"&&(i.style.transform="")})};return{onPointerDown:a,onPointerMove:o,onPointerUp:s,onPointerCancel:s}}const X=C(function(e,t){return l(u.Trigger,d({ref:t,"data-slot":"dialog-trigger"},e))});function R(e){var t=p(e,[]);return l(u.Portal,d({"data-slot":"dialog-portal"},t))}const Z=C(function(e,t){return l(u.Close,d({ref:t,"data-slot":"dialog-close"},e))});function S(e){var t=e,{className:a}=t,o=p(t,["className"]);return l(u.Overlay,d({"data-slot":"dialog-overlay",className:c("fixed inset-0 z-50 bg-backdrop data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 motion-reduce:!animate-none",a)},o))}function tt(e){var t=e,{className:a,overlayClassName:o,children:s,showCloseButton:n=!0,closeLabel:r="Fechar",onPointerDown:i,onPointerMove:m,onPointerUp:v,onPointerCancel:f}=t,g=p(t,["className","overlayClassName","children","showCloseButton","closeLabel","onPointerDown","onPointerMove","onPointerUp","onPointerCancel"]);const x=Q(w(k));return h(R,{"data-slot":"dialog-portal",children:[l(S,{className:c("modal-overlay",o)}),h(u.Content,j(d({"data-slot":"dialog-container",className:c("modal-overlay fixed left-1/2 top-1/2 z-50 flex max-h-[85dvh] w-full max-w-[568px] -translate-x-1/2 -translate-y-1/2 flex-col gap-0 overflow-y-auto rounded-lg bg-surface-elevated p-0 shadow-level-5 duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-1/2 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-1/2 motion-reduce:!animate-none md:max-h-[85vh]","max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:max-w-none max-md:translate-x-0 max-md:translate-y-0 max-md:rounded-b-none max-md:data-[state=closed]:zoom-out-100 max-md:data-[state=open]:zoom-in-100 max-md:data-[state=closed]:slide-out-to-bottom max-md:data-[state=closed]:slide-out-to-left-0 max-md:data-[state=open]:slide-in-from-bottom max-md:data-[state=open]:slide-in-from-left-0","data-[dragging]:transition-none max-md:ease-out max-md:motion-safe:transition-transform max-md:[&>[data-slot=dialog-handle]+[data-slot=dialog-header]]:pt-10 max-md:[&_[data-slot=dialog-header]]:touch-none",a)},g),{onPointerDown:P(i,x.onPointerDown),onPointerMove:P(m,x.onPointerMove),onPointerUp:P(v,x.onPointerUp),onPointerCancel:P(f,x.onPointerCancel),children:[l("div",{"aria-hidden":!0,"data-slot":"dialog-handle",className:"pointer-events-none absolute left-1/2 top-4 z-10 h-1 w-11 -translate-x-1/2 rounded-pill bg-gray-stroke md:hidden"}),l(M.Provider,{value:n,children:s}),n&&l(u.Close,{"data-slot":"dialog-close",asChild:!0,children:l(E,{label:r,className:G})})]}))]})}function et(e){var t=e,{containerClassName:a,className:o}=t,s=p(t,["containerClassName","className"]);return l("div",{className:c("mb-auto overflow-y-auto",a),children:l("div",d({"data-slot":"dialog-content",className:c("px-8 py-6 text-md leading-md text-primary-foreground",o)},s))})}function at(e){var t=e,{className:a,separator:o=!1}=t,s=p(t,["className","separator"]);const n=w(M);return h(y,{children:[l("div",d({"data-slot":"dialog-header",className:c("flex flex-col gap-2 px-8 py-6 text-left",n&&"pr-14",a)},s)),o&&l(O,{})]})}function ot(e){var t=e,{className:a,separator:o=!1}=t,s=p(t,["className","separator"]);return h(y,{children:[o&&l(O,{}),l("div",d({"data-slot":"dialog-footer",className:c("flex justify-end gap-2 px-8 py-6",a)},s))]})}function nt(e){var t=e,{className:a,iconLeft:o,iconRight:s,children:n}=t,r=p(t,["className","iconLeft","iconRight","children"]);const i=m=>{var v,f;if(L(m)){const g=m;return B(g,{size:(v=g.props.size)!=null?v:32,strokeWidth:(f=g.props.strokeWidth)!=null?f:2.2,className:c("flex-shrink-0",g.props.className)})}return m};return h(u.Title,j(d({"data-slot":"dialog-title",className:c("flex items-center gap-3 text-title-md font-semibold leading-title-md !text-content-title",a)},r),{children:[o&&i(o),n,s&&i(s)]}))}function rt(e){var t=e,{className:a}=t,o=p(t,["className"]);return l(u.Description,d({"data-slot":"dialog-description",className:c("text-md leading-md text-content-paragraph",a)},o))}export{J as Dialog,Z as DialogClose,tt as DialogContainer,et as DialogContent,rt as DialogDescription,ot as DialogFooter,at as DialogHeader,S as DialogOverlay,R as DialogPortal,nt as DialogTitle,X as DialogTrigger};
@@ -0,0 +1,22 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ import { type ComponentProps, type ReactNode } from "react";
3
+ type DistributionTone = "primary" | "secondary" | "cm" | "go" | "cir" | "ped" | "prev" | "gray";
4
+ declare const distributionToneClass: Record<DistributionTone, string>;
5
+ declare const distributionBarVariants: (props?: ({
6
+ size?: "sm" | "md" | null | undefined;
7
+ } & ({ class: import("clsx").ClassValue; className?: never } | { class?: never; className: import("clsx").ClassValue } | { class?: never; className?: never })) | undefined) => string;
8
+ interface DistributionSegment {
9
+ label: string;
10
+ /** Percentual de 0 a 100. */
11
+ value: number;
12
+ tone?: DistributionTone;
13
+ }
14
+ interface DistributionBarProps extends Omit<ComponentProps<"div">, "children">, VariantProps<typeof distributionBarVariants> {
15
+ segments: readonly DistributionSegment[];
16
+ label?: ReactNode;
17
+ showLegend?: boolean;
18
+ showPercent?: boolean;
19
+ }
20
+ declare const DistributionBar: import("react").ForwardRefExoticComponent<Omit<DistributionBarProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
21
+ export { DistributionBar, distributionBarVariants, distributionToneClass };
22
+ export type { DistributionBarProps, DistributionSegment, DistributionTone };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ "use client";
3
+ "use strict";var s=require("react/jsx-runtime"),P=require("class-variance-authority"),z=require("react"),v=require("../hooks/use-id.js"),d=require("../lib/utils.js"),q=Object.defineProperty,I=Object.defineProperties,C=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable,y=(e,a,r)=>a in e?q(e,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[a]=r,V=(e,a)=>{for(var r in a||(a={}))p.call(a,r)&&y(e,r,a[r]);if(i)for(var r of i(a))x.call(a,r)&&y(e,r,a[r]);return e},B=(e,a)=>I(e,C(a)),L=(e,a)=>{var r={};for(var t in e)p.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&&x.call(e,t)&&(r[t]=e[t]);return r};const u={primary:"bg-primary-background-fill",secondary:"bg-secondary-background-fill",cm:"bg-cm-background-fill",go:"bg-go-background-fill",cir:"bg-cir-background-fill",ped:"bg-ped-background-fill",prev:"bg-prev-background-fill",gray:"bg-gray-background-fill-muted"},h=P.cva("flex w-full flex-row overflow-hidden rounded-pill bg-gray-background-soft",{variants:{size:{sm:"h-2",md:"h-3"}},defaultVariants:{size:"sm"}});function M(e){return e&&Object.hasOwn(u,e)?e:"secondary"}function D(e){return Number.isFinite(e)?Math.min(100,Math.max(0,e)):0}const R=z.forwardRef(function(e,a){var r=e,{segments:t,label:n,showLegend:w=!0,showPercent:j=!0,size:k,className:O}=r,N=L(r,["segments","label","showLegend","showPercent","size","className"]);const c=v.useId(),b=v.useId();if(t.length===0)return null;const o=t.map(l=>{const g=M(l.tone),m=D(l.value);return{key:`${g}-${m}-${l.label}`,label:l.label,value:m,toneClass:u[g]}}),$=o.map(l=>`${l.label} ${l.value}%`).join(", "),f=n!=null&&n!==!1;return s.jsxs("div",B(V({ref:a,"data-slot":"distribution-bar",className:d.cn("flex w-full flex-col gap-3",O)},N),{children:[f&&s.jsx("div",{id:c,"data-slot":"distribution-bar-label",className:"text-xs font-semibold leading-xs text-primary-foreground",children:n}),s.jsx("div",{"data-slot":"distribution-bar-track",id:b,role:"img","aria-label":$,"aria-labelledby":f?`${c} ${b}`:void 0,className:h({size:k}),children:o.map(l=>s.jsx("div",{"data-slot":"distribution-bar-segment",className:d.cn("h-full shrink-0",l.toneClass),style:{width:`${l.value}%`}},l.key))}),w&&s.jsx("ul",{"data-slot":"distribution-bar-legend",className:"flex flex-row flex-wrap gap-x-4 gap-y-2",children:o.map(l=>s.jsxs("li",{"data-slot":"distribution-bar-legend-item",className:"flex flex-row items-center gap-1.5",children:[s.jsx("span",{"aria-hidden":"true","data-slot":"distribution-bar-dot",className:d.cn("size-2 shrink-0 rounded-full",l.toneClass)}),s.jsx("span",{className:"text-xs font-medium leading-xs text-gray-foreground-muted",children:j?`${l.label} ${l.value}%`:l.label})]},l.key))})]}))});exports.DistributionBar=R,exports.distributionBarVariants=h,exports.distributionToneClass=u;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ "use client";
3
+ import{jsxs as p,jsx as i}from"react/jsx-runtime";import{cva as z}from"class-variance-authority";import{forwardRef as C}from"react";import{useId as v}from"../hooks/use-id.mjs";import{cn as d}from"../lib/utils.mjs";var B=Object.defineProperty,I=Object.defineProperties,L=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,x=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,h=(e,a,r)=>a in e?B(e,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[a]=r,M=(e,a)=>{for(var r in a||(a={}))x.call(a,r)&&h(e,r,a[r]);if(n)for(var r of n(a))y.call(a,r)&&h(e,r,a[r]);return e},V=(e,a)=>I(e,L(a)),D=(e,a)=>{var r={};for(var t in e)x.call(e,t)&&a.indexOf(t)<0&&(r[t]=e[t]);if(e!=null&&n)for(var t of n(e))a.indexOf(t)<0&&y.call(e,t)&&(r[t]=e[t]);return r};const u={primary:"bg-primary-background-fill",secondary:"bg-secondary-background-fill",cm:"bg-cm-background-fill",go:"bg-go-background-fill",cir:"bg-cir-background-fill",ped:"bg-ped-background-fill",prev:"bg-prev-background-fill",gray:"bg-gray-background-fill-muted"},w=z("flex w-full flex-row overflow-hidden rounded-pill bg-gray-background-soft",{variants:{size:{sm:"h-2",md:"h-3"}},defaultVariants:{size:"sm"}});function T(e){return e&&Object.hasOwn(u,e)?e:"secondary"}function E(e){return Number.isFinite(e)?Math.min(100,Math.max(0,e)):0}const F=C(function(e,a){var r=e,{segments:t,label:s,showLegend:k=!0,showPercent:O=!0,size:j,className:N}=r,$=D(r,["segments","label","showLegend","showPercent","size","className"]);const b=v(),c=v();if(t.length===0)return null;const o=t.map(l=>{const m=T(l.tone),g=E(l.value);return{key:`${m}-${g}-${l.label}`,label:l.label,value:g,toneClass:u[m]}}),P=o.map(l=>`${l.label} ${l.value}%`).join(", "),f=s!=null&&s!==!1;return p("div",V(M({ref:a,"data-slot":"distribution-bar",className:d("flex w-full flex-col gap-3",N)},$),{children:[f&&i("div",{id:b,"data-slot":"distribution-bar-label",className:"text-xs font-semibold leading-xs text-primary-foreground",children:s}),i("div",{"data-slot":"distribution-bar-track",id:c,role:"img","aria-label":P,"aria-labelledby":f?`${b} ${c}`:void 0,className:w({size:j}),children:o.map(l=>i("div",{"data-slot":"distribution-bar-segment",className:d("h-full shrink-0",l.toneClass),style:{width:`${l.value}%`}},l.key))}),k&&i("ul",{"data-slot":"distribution-bar-legend",className:"flex flex-row flex-wrap gap-x-4 gap-y-2",children:o.map(l=>p("li",{"data-slot":"distribution-bar-legend-item",className:"flex flex-row items-center gap-1.5",children:[i("span",{"aria-hidden":"true","data-slot":"distribution-bar-dot",className:d("size-2 shrink-0 rounded-full",l.toneClass)}),i("span",{className:"text-xs font-medium leading-xs text-gray-foreground-muted",children:O?`${l.label} ${l.value}%`:l.label})]},l.key))})]}))});export{F as DistributionBar,w as distributionBarVariants,u as distributionToneClass};
@@ -0,0 +1,45 @@
1
+ import { type ComponentProps, type ReactNode } from "react";
2
+ declare const RING_SIZE = 139;
3
+ declare const RING_ARC = "M69.5 1C81.2203 1 92.7446 4.00722 102.971 9.73402C113.196 15.4608 121.782 23.7156 127.906 33.7088C134.03 43.7021 137.487 55.0994 137.947 66.8107C138.407 78.522 135.855 90.1555 130.534 100.598C125.213 111.041 117.302 119.944 107.557 126.456C97.8115 132.967 86.5587 136.869 74.8745 137.789C63.1903 138.708 51.4656 136.615 40.8218 131.708C30.1781 126.801 20.9714 119.245 14.0823 109.763";
4
+ interface AlignToStepOptions {
5
+ min: number;
6
+ max: number;
7
+ step: number;
8
+ }
9
+ /**
10
+ * Alinha `value` à grade `min + k * step` (quando `step > 0`) e limita em `[min, max]`. Valor não finito vira `min`.
11
+ * Os limites são devolvidos exatos, mesmo fora da grade. O resultado é arredondado às casas decimais de `step`
12
+ * e `min`, para `0.2 + 0.1` virar `0.3`.
13
+ */
14
+ declare function alignToStep(value: number, { min, max, step }: AlignToStepOptions): number;
15
+ /**
16
+ * Próximo ponto da grade a partir de `value`, na direção pedida: o menor acima (`1`) ou o maior abaixo (`-1`).
17
+ * Parte do valor atual para não pular pontos quando `value` está fora da grade (um limite exato ou um valor
18
+ * controlado). O quociente é arredondado a 9 casas para `0.3 - 0.1` não cair no ponto de baixo.
19
+ */
20
+ declare function stepFrom(value: number, { min, max, step }: AlignToStepOptions, direction: 1 | -1): number;
21
+ interface RingCounterProps extends Omit<ComponentProps<"div">, "children" | "defaultValue" | "onChange"> {
22
+ /** Valor controlado. `null` = carregando: sem número e com os botões desabilitados. */
23
+ value?: number | null;
24
+ /** Valor inicial não controlado. Padrão: `min`. */
25
+ defaultValue?: number;
26
+ /** Recebe o valor já alinhado ao `step` e preso em `[min, max]`. */
27
+ onValueChange?: (value: number) => void;
28
+ min?: number;
29
+ max?: number;
30
+ step?: number;
31
+ formatValue?: (value: number) => string;
32
+ /** Texto sob o valor, dentro do anel. Quando é string e não há `aria-label`, também nomeia o spinbutton. */
33
+ caption?: ReactNode;
34
+ /** Texto entre os botões, anunciado em região `aria-live="polite"`. */
35
+ helperText?: ReactNode;
36
+ /** Texto acessível do valor (`aria-valuetext`). Padrão: `formatValue`. */
37
+ valueText?: (value: number) => string;
38
+ decrementLabel?: string;
39
+ incrementLabel?: string;
40
+ arc?: "static" | "progress";
41
+ disabled?: boolean;
42
+ }
43
+ declare const RingCounter: import("react").ForwardRefExoticComponent<Omit<RingCounterProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
44
+ export { RingCounter, alignToStep, stepFrom, RING_ARC, RING_SIZE };
45
+ export type { RingCounterProps, AlignToStepOptions };