@medway-ui/core 1.32.0 → 1.33.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/COMPONENTS.md +242 -3
- package/COMPONENTS_SUMMARY.md +3 -1
- package/README.md +2 -2
- package/dist/COMPONENTS.md +242 -3
- package/dist/COMPONENTS_SUMMARY.md +3 -1
- package/dist/components/Alert.js +1 -1
- package/dist/components/Autocomplete.d.mts.map +1 -1
- package/dist/components/Autocomplete.d.ts.map +1 -1
- package/dist/components/Autocomplete.js +1 -1
- package/dist/components/Autocomplete.mjs +1 -1
- package/dist/components/Breadcrumb.d.mts +5 -2
- package/dist/components/Breadcrumb.d.mts.map +1 -1
- package/dist/components/Breadcrumb.d.ts +5 -2
- package/dist/components/Breadcrumb.d.ts.map +1 -1
- package/dist/components/Breadcrumb.js +1 -1
- package/dist/components/Breadcrumb.mjs +1 -1
- package/dist/components/Button.js +1 -1
- package/dist/components/Button.mjs +1 -1
- package/dist/components/CardContinue.mjs +1 -1
- package/dist/components/CardModule.d.mts.map +1 -1
- package/dist/components/CardModule.d.ts.map +1 -1
- package/dist/components/CardModule.js +1 -1
- package/dist/components/CardModule.mjs +1 -1
- package/dist/components/CardNews.d.mts +1 -1
- package/dist/components/CardNews.d.mts.map +1 -1
- package/dist/components/CardNews.d.ts +1 -1
- package/dist/components/CardNews.d.ts.map +1 -1
- package/dist/components/CardNews.js +1 -1
- package/dist/components/CardNews.mjs +1 -1
- package/dist/components/CardTopic.d.mts.map +1 -1
- package/dist/components/CardTopic.d.ts.map +1 -1
- package/dist/components/CardTopic.js +1 -1
- package/dist/components/CardTopic.mjs +1 -1
- package/dist/components/CardWeek.js +1 -1
- package/dist/components/CardWeek.mjs +1 -1
- package/dist/components/Carousel.d.mts +76 -0
- package/dist/components/Carousel.d.mts.map +1 -0
- package/dist/components/Carousel.d.ts +76 -0
- package/dist/components/Carousel.d.ts.map +1 -0
- package/dist/components/Carousel.js +4 -0
- package/dist/components/Carousel.js.map +1 -0
- package/dist/components/Carousel.mjs +4 -0
- package/dist/components/Carousel.mjs.map +1 -0
- package/dist/components/Chip.js +1 -1
- package/dist/components/Chip.mjs +1 -1
- package/dist/components/DatePicker.d.mts.map +1 -1
- package/dist/components/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker.js +1 -1
- package/dist/components/DatePicker.mjs +1 -1
- package/dist/components/Input.d.mts.map +1 -1
- package/dist/components/Input.d.ts.map +1 -1
- package/dist/components/Input.js +1 -1
- package/dist/components/Input.mjs +1 -1
- package/dist/components/NoteEditor.d.mts.map +1 -1
- package/dist/components/NoteEditor.d.ts.map +1 -1
- package/dist/components/NoteEditor.js +1 -1
- package/dist/components/NoteEditor.mjs +1 -1
- package/dist/components/Offcanvas.d.mts.map +1 -1
- package/dist/components/Offcanvas.d.ts.map +1 -1
- package/dist/components/Offcanvas.js +1 -1
- package/dist/components/Offcanvas.mjs +1 -1
- package/dist/components/Pagination.d.mts.map +1 -1
- package/dist/components/Pagination.d.ts.map +1 -1
- package/dist/components/Pagination.js +1 -1
- package/dist/components/Pagination.mjs +1 -1
- package/dist/components/Popover.js +1 -1
- package/dist/components/Progress.d.mts.map +1 -1
- package/dist/components/Progress.d.ts.map +1 -1
- package/dist/components/Progress.js +1 -1
- package/dist/components/Progress.mjs +1 -1
- package/dist/components/RadioGroup.js +1 -1
- package/dist/components/Ranking.d.mts.map +1 -1
- package/dist/components/Ranking.d.ts.map +1 -1
- package/dist/components/Ranking.js +1 -1
- package/dist/components/Ranking.mjs +1 -1
- package/dist/components/Rating.d.mts.map +1 -1
- package/dist/components/Rating.d.ts.map +1 -1
- package/dist/components/Rating.js +1 -1
- package/dist/components/Rating.mjs +1 -1
- package/dist/components/SegmentControl.d.mts.map +1 -1
- package/dist/components/SegmentControl.d.ts.map +1 -1
- package/dist/components/SegmentControl.js +1 -1
- package/dist/components/SegmentControl.mjs +1 -1
- package/dist/components/Select.d.mts.map +1 -1
- package/dist/components/Select.d.ts.map +1 -1
- package/dist/components/Select.js +1 -1
- package/dist/components/Select.mjs +1 -1
- package/dist/components/Sidebar.d.mts.map +1 -1
- package/dist/components/Sidebar.d.ts.map +1 -1
- package/dist/components/Sidebar.js +1 -1
- package/dist/components/Sidebar.mjs +1 -1
- package/dist/components/Switcher.js +1 -1
- package/dist/components/Tabs.js +1 -1
- package/dist/components/Tag.js +1 -1
- package/dist/components/Toast.d.mts +6 -3
- package/dist/components/Toast.d.mts.map +1 -1
- package/dist/components/Toast.d.ts +6 -3
- package/dist/components/Toast.d.ts.map +1 -1
- package/dist/components/Toast.js +1 -1
- package/dist/components/Toast.mjs +1 -1
- package/dist/hooks/use-composed-refs.d.mts +1 -1
- package/dist/hooks/use-composed-refs.d.mts.map +1 -1
- package/dist/hooks/use-composed-refs.d.ts +1 -1
- package/dist/hooks/use-composed-refs.d.ts.map +1 -1
- package/dist/hooks/use-composed-refs.js +1 -1
- package/dist/hooks/use-composed-refs.mjs +1 -1
- package/dist/hooks/use-mobile.d.mts.map +1 -1
- package/dist/hooks/use-mobile.d.ts.map +1 -1
- package/dist/hooks/use-mobile.js +1 -1
- package/dist/hooks/use-mobile.mjs +1 -1
- package/dist/hooks/use-prefers-reduced-motion.d.mts +2 -0
- package/dist/hooks/use-prefers-reduced-motion.d.mts.map +1 -0
- package/dist/hooks/use-prefers-reduced-motion.d.ts +2 -0
- package/dist/hooks/use-prefers-reduced-motion.d.ts.map +1 -0
- package/dist/hooks/use-prefers-reduced-motion.js +3 -0
- package/dist/hooks/use-prefers-reduced-motion.js.map +1 -0
- package/dist/hooks/use-prefers-reduced-motion.mjs +3 -0
- package/dist/hooks/use-prefers-reduced-motion.mjs.map +1 -0
- package/dist/index.d.mts +4 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lib/cmdk.d.mts.map +1 -1
- package/dist/lib/cmdk.d.ts.map +1 -1
- package/dist/lib/cmdk.js +1 -1
- package/dist/lib/cmdk.mjs +1 -1
- package/dist/lib/image-toolbar-placement.d.mts +32 -0
- package/dist/lib/image-toolbar-placement.d.mts.map +1 -0
- package/dist/lib/image-toolbar-placement.d.ts +32 -0
- package/dist/lib/image-toolbar-placement.d.ts.map +1 -0
- package/dist/lib/image-toolbar-placement.js +3 -0
- package/dist/lib/image-toolbar-placement.js.map +1 -0
- package/dist/lib/image-toolbar-placement.mjs +3 -0
- package/dist/lib/image-toolbar-placement.mjs.map +1 -0
- package/package.json +28 -13
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
import{jsx as
|
|
3
|
+
import{jsx as t,jsxs as f,Fragment as h}from"react/jsx-runtime";import{cva as y}from"class-variance-authority";import{createContext as C,useContext as j,useState as k}from"react";import{Avatar as O,AvatarImage as P,AvatarFallback as z}from"./Avatar.mjs";import{Button as I}from"./Button.mjs";import{FallbackImage as A}from"./FallbackImage.mjs";import{cn as i}from"../lib/utils.mjs";import{Calendar as F}from"@medway-ui/icons";var R=Object.defineProperty,D=Object.defineProperties,E=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,N=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable,g=(a,e,r)=>e in a?R(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r,o=(a,e)=>{for(var r in e||(e={}))N.call(e,r)&&g(a,r,e[r]);if(v)for(var r of v(e))w.call(e,r)&&g(a,r,e[r]);return a},p=(a,e)=>D(a,E(e)),c=(a,e)=>{var r={};for(var s in a)N.call(a,s)&&e.indexOf(s)<0&&(r[s]=a[s]);if(a!=null&&v)for(var s of v(a))e.indexOf(s)<0&&w.call(a,s)&&(r[s]=a[s]);return r};const b=C({orientation:"vertical"}),S=y("flex border",{variants:{variant:{default:"rounded-lg border-secondary-stroke bg-secondary-background-soft-muted p-6",read:"rounded-lg border-gray-stroke-muted bg-surface-card p-6",compact:"rounded-xl border-gray-stroke-muted bg-surface-card p-4"},orientation:{vertical:"flex-col gap-6",horizontal:"flex-row gap-10"}},defaultVariants:{variant:"default",orientation:"vertical"}});function T(a){var e=a,{className:r,isRead:s,variant:n,orientation:l="vertical"}=e,d=c(e,["className","isRead","variant","orientation"]);const m=s?"read":n!=null?n:"default";return t(b.Provider,{value:{orientation:l!=null?l:"vertical"},children:t("div",o({"data-slot":"card-news",className:i(S({variant:m,orientation:l}),r)},d))})}function $(a){var e=a,{className:r}=e,s=c(e,["className"]);return t("div",o({"data-slot":"card-news-body",className:i("flex min-w-0 flex-1 flex-col gap-6 min-[1280px]:flex-auto",r)},s))}function B(a){var e=a,{className:r}=e,s=c(e,["className"]);return t("div",o({"data-slot":"card-news-header",className:i("flex w-full flex-col items-start justify-between gap-4 md:flex-row md:items-center",r)},s))}function H(a){var e=a,{className:r}=e,s=c(e,["className"]);return t("div",o({"data-slot":"card-news-tags",className:i("flex min-w-0 max-w-full flex-wrap items-center gap-x-4 gap-y-3",r)},s))}function K(a){var e=a,{className:r,icon:s=t(F,{}),children:n}=e,l=c(e,["className","icon","children"]);return f("div",p(o({"data-slot":"card-news-date",className:i("flex min-w-0 items-center gap-1.5 text-xs font-semibold leading-xs text-primary-foreground [&>svg]:size-4",r)},l),{children:[s,n&&t("span",{children:n})]}))}function U(a){var e=a,{className:r,src:s,alt:n="",children:l}=e,d=c(e,["className","src","alt","children"]);const{orientation:m}=j(b),[x,u]=k();return t("div",p(o({"data-slot":"card-news-image",className:i("relative overflow-hidden bg-gray-background-soft",m==="vertical"?"h-[300px] w-full rounded-lg":"hidden w-[482px] rounded-xl min-[1280px]:block",r)},d),{children:s&&x!==s?t("img",{src:s,alt:n,loading:"lazy",onError:()=>u(s),className:"absolute inset-0 size-full object-cover"}):l!=null?l:t(A,{className:"absolute inset-0"})}))}function _(a){var e=a,{className:r}=e,s=c(e,["className"]);return t("div",o({"data-slot":"card-news-content",className:i("flex w-full min-w-0 flex-col gap-6",r)},s))}function q(a){var e=a,{className:r}=e,s=c(e,["className"]);return t("div",o({"data-slot":"card-news-title",className:i("-mb-2 line-clamp-2 break-words text-title-xs font-semibold leading-title-xs text-primary-foreground",r)},s))}function G(a){var e=a,{className:r}=e,s=c(e,["className"]);return t("div",o({"data-slot":"card-news-description",className:i("line-clamp-3 break-words text-md leading-md text-primary-foreground",r)},s))}function J(a){var e=a,{className:r,label:s,children:n}=e,l=c(e,["className","label","children"]);return f("div",p(o({"data-slot":"card-news-resources",className:i("flex flex-col gap-2",r)},l),{children:[t("span",{className:"text-sm font-semibold leading-sm text-primary-foreground-muted",children:s}),t("div",{className:"flex flex-wrap gap-2",children:n})]}))}function L(a){var e=a,{className:r,children:s,disabled:n,loading:l,type:d,onClick:m,asChild:x}=e,u=c(e,["className","children","disabled","loading","type","onClick","asChild"]);return t(I,p(o({"data-slot":"card-news-resource-item",variant:"outlined",size:"sm",className:i("pointer-events-none max-w-full bg-surface-card",r)},u),{asChild:!0,children:t("span",{children:t("span",{className:"truncate",children:s})})}))}function M(a){return a.trim().split(/\s+/).slice(0,2).map(e=>{var r;return(r=e[0])!=null?r:""}).join("").toUpperCase()}function Q(a){var e=a,{className:r,src:s,alt:n,name:l,role:d,children:m}=e,x=c(e,["className","src","alt","name","role","children"]),u;return t("div",p(o({"data-slot":"card-news-author",className:i("flex min-w-0 items-center gap-2",r)},x),{children:m!=null?m:f(h,{children:[f(O,{size:"md",children:[s&&t(P,{src:s,alt:(u=n!=null?n:l)!=null?u:""}),t(z,{children:l?M(l):void 0})]}),f("div",{className:"flex min-w-0 flex-col gap-0.5",children:[d&&t("span",{className:"text-xs font-medium leading-xs text-secondary-foreground",children:d}),l&&t("span",{className:"break-words text-sm font-semibold leading-sm text-primary-foreground",children:l})]})]})}))}function V(a){var e=a,{className:r}=e,s=c(e,["className"]);return t("div",o({"data-slot":"card-news-footer",className:i("flex w-full flex-wrap items-center gap-6 gap-y-3 max-[500px]:flex-col max-[500px]:flex-nowrap max-[500px]:items-stretch max-[500px]:[&_[data-slot=button]]:w-full",r)},s))}export{T as CardNews,Q as CardNewsAuthor,$ as CardNewsBody,_ as CardNewsContent,K as CardNewsDate,G as CardNewsDescription,V as CardNewsFooter,B as CardNewsHeader,U as CardNewsImage,L as CardNewsResourceItem,J as CardNewsResources,H as CardNewsTags,q as CardNewsTitle};
|
|
4
4
|
//# sourceMappingURL=CardNews.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardTopic.d.ts","sourceRoot":"","sources":["../../src/components/CardTopic.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAsC,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAEhF,OAAO,EAEL,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,gBAAgB,EACtB,MAAM,0BAA0B,CAAC;AAMlC,KAAK,gBAAgB,GAAG,SAAS,GAAG,SAAS,CAAC;AAE9C,KAAK,cAAc,GACf,CAAC,gBAAgB,GAAG;IAClB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,aAAa,CAAC,EAAE,KAAK,CAAC;CACvB,CAAC,GACF,CAAC,gBAAgB,GAAG;IAClB,OAAO,EAAE,SAAS,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC,CAAC;AAOP,UAAU,sBAAuB,SAAQ,cAAc,CAAC,KAAK,CAAC;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,QAAA,MAAM,iBAAiB;;8EAatB,CAAC;AAQF,iBAAS,SAAS,CAAC,EACjB,SAAS,EACT,OAAO,EACP,aAAa,EACb,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,2CAqBhB;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,kBAAkB,CAAC,2CAoB3C;AAED,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,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,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,gBAAgB,GACjB,CAAC;AACF,YAAY,EAAE,sBAAsB,EAAE,cAAc,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
"use strict";var n=require("react/jsx-runtime"),w=require("class-variance-authority"),v=require("react"),x=require("./Collapsible.js"),T=require("./Progress.js"),O=require("./Tag.js"),i=require("../lib/utils.js"),b=require("@medway-ui/icons"),P=Object.defineProperty,D=Object.defineProperties,q=Object.getOwnPropertyDescriptors,p=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable,j=(e,r,a)=>r in e?P(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a,o=(e,r)=>{for(var a in r||(r={}))h.call(r,a)&&j(e,a,r[a]);if(p)for(var a of p(r))N.call(r,a)&&j(e,a,r[a]);return e},u=(e,r)=>D(e,q(r)),c=(e,r)=>{var a={};for(var t in e)h.call(e,t)&&r.indexOf(t)<0&&(a[t]=e[t]);if(e!=null&&p)for(var t of p(e))r.indexOf(t)<0&&N.call(e,t)&&(a[t]=e[t]);return a};const y=w.cva("flex flex-col overflow-hidden rounded-2xl border border-gray-stroke-muted",{variants:{variant:{default:"bg-surface-card",blocked:"bg-gray-background-soft"}},defaultVariants:{variant:"default"}}),C=v.createContext(null);function f(){var e;return(e=v.useContext(C))!=null?e:{}}function E(e){var r=e,{className:a,variant:t,availableDate:s,children:l}=r,d=c(r,["className","variant","availableDate","children"]);const m=v.useMemo(()=>({variant:t,availableDate:s}),[t,s]);return n.jsx(C.Provider,{value:m,children:n.jsx(x.Collapsible,u(o({"data-slot":"card-topic",animation:"accordion",className:i.cn(y({variant:t}),a)},d),{children:l}))})}function V(e){var r=e,{className:a,children:t}=r,s=c(r,["className","children"]);const{variant:l}=f(),d=l==="blocked";return n.jsx(x.CollapsibleTrigger,u(o({"data-slot":"card-topic-trigger",disabled:d,className:i.cn("group flex min-h-16 w-full select-none flex-wrap items-center gap-4 p-4 text-left","[&>*:first-child]:flex-1","disabled:pointer-events-none disabled:cursor-default",!d&&"cursor-pointer",a)},s),{children:t}))}function z(e){var r=e,{className:a}=r,t=c(r,["className"]);return n.jsx("div",o({"data-slot":"card-topic-column",className:i.cn("flex min-w-[min(100%,10rem)] max-w-full flex-wrap items-center gap-4",a)},t))}function F(e){var r=e,{className:a,children:t}=r,s=c(r,["className","children"]);const{variant:l}=f();return n.jsx("div",u(o({"data-slot":"card-topic-number",className:i.cn("flex size-[30px] shrink-0 items-center justify-center rounded-full text-md font-medium text-primary-foreground-onfill",l==="blocked"?"bg-primary-foreground-muted":"bg-primary-foreground",a)},s),{children:t}))}function I(e){var r=e,{className:a}=r,t=c(r,["className"]);const{variant:s}=f();return n.jsx("div",o({"data-slot":"card-topic-title",className:i.cn("min-w-[min(100%,6rem)] flex-1 break-words text-md font-semibold leading-md",s==="blocked"?"text-primary-foreground-muted":"text-primary-foreground",a)},t))}function M(e){var r=e,{className:a,progress:t}=r,s=c(r,["className","progress"]);const{variant:l,availableDate:d}=f();if(l==="blocked")return d?n.jsx("div",u(o({"data-slot":"card-topic-progress",className:i.cn("flex min-w-0",a)},s),{children:n.jsxs(O.Tag,{variant:"gray-soft",icon:n.jsx(b.Lock,{"aria-hidden":!0}),children:["Dispon\xEDvel em ",d]})})):null;if(t===void 0)return null;const m=i.clampPercentage(t),k=Math.round(m),g=m>=100;return n.jsxs("div",u(o({"data-slot":"card-topic-progress",className:i.cn("flex min-w-[min(180px,100%)] flex-col gap-2",a)},s),{children:[n.jsx("div",{className:"text-xs font-medium leading-xs text-gray-foreground-muted",children:g?"Conclu\xEDdo":n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"font-semibold text-gray-foreground",children:[k,"%"]})," de progresso"]})}),n.jsx(T.Progress,{value:m,indicatorClassName:g?"bg-secondary-stroke-emphasis":"bg-primary-stroke"})]}))}function A(e){var r=e,{className:a,children:t}=r,s=c(r,["className","children"]);const{variant:l}=f();return n.jsxs("div",u(o({"data-slot":"card-topic-count",className:i.cn("flex shrink-0 items-center gap-2",a)},s),{children:[n.jsx("span",{className:"text-sm font-medium leading-sm text-gray-foreground-muted",children:t}),n.jsx(b.ChevronDown,{"aria-hidden":!0,size:18,strokeWidth:2.4,className:i.cn("shrink-0 text-gray-foreground",l!=="blocked"&&"transition-transform duration-200 group-data-[state=open]:rotate-180")})]}))}function G(e){var r=e,{className:a,children:t}=r,s=c(r,["className","children"]);return n.jsx(x.CollapsibleContent,u(o({"data-slot":"card-topic-content"},s),{children:n.jsx("div",{className:i.cn("px-4 pb-4",a),children:t})}))}exports.CardTopic=E,exports.CardTopicColumn=z,exports.CardTopicContent=G,exports.CardTopicCount=A,exports.CardTopicNumber=F,exports.CardTopicProgress=M,exports.CardTopicTitle=I,exports.CardTopicTrigger=V,exports.cardTopicVariants=y;
|
|
3
|
+
"use strict";var n=require("react/jsx-runtime"),w=require("class-variance-authority"),v=require("react"),x=require("./Collapsible.js"),T=require("./Progress.js"),O=require("./Tag.js"),i=require("../lib/utils.js"),b=require("@medway-ui/icons"),P=Object.defineProperty,D=Object.defineProperties,q=Object.getOwnPropertyDescriptors,p=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable,j=(e,r,a)=>r in e?P(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a,o=(e,r)=>{for(var a in r||(r={}))h.call(r,a)&&j(e,a,r[a]);if(p)for(var a of p(r))N.call(r,a)&&j(e,a,r[a]);return e},u=(e,r)=>D(e,q(r)),c=(e,r)=>{var a={};for(var t in e)h.call(e,t)&&r.indexOf(t)<0&&(a[t]=e[t]);if(e!=null&&p)for(var t of p(e))r.indexOf(t)<0&&N.call(e,t)&&(a[t]=e[t]);return a};const y=w.cva("flex flex-col overflow-hidden rounded-2xl border border-gray-stroke-muted",{variants:{variant:{default:"bg-surface-card",blocked:"bg-gray-background-soft"}},defaultVariants:{variant:"default"}}),C=v.createContext(null);function f(){var e;return(e=v.useContext(C))!=null?e:{}}function E(e){var r=e,{className:a,variant:t,availableDate:s,children:l}=r,d=c(r,["className","variant","availableDate","children"]);const m=v.useMemo(()=>({variant:t,availableDate:s}),[t,s]);return n.jsx(C.Provider,{value:m,children:n.jsx(x.Collapsible,u(o({"data-slot":"card-topic",animation:"accordion",className:i.cn(y({variant:t}),a)},d),{children:l}))})}function V(e){var r=e,{className:a,children:t}=r,s=c(r,["className","children"]);const{variant:l}=f(),d=l==="blocked";return n.jsx(x.CollapsibleTrigger,u(o({"data-slot":"card-topic-trigger",disabled:d,className:i.cn("group flex min-h-16 w-full select-none flex-wrap items-center gap-4 p-4 text-left","[&>*:first-child]:flex-1","disabled:pointer-events-none disabled:cursor-default",!d&&"cursor-pointer",a)},s),{children:t}))}function z(e){var r=e,{className:a}=r,t=c(r,["className"]);return n.jsx("div",o({"data-slot":"card-topic-column",className:i.cn("flex min-w-[min(100%,10rem)] max-w-full flex-wrap items-center gap-4",a)},t))}function F(e){var r=e,{className:a,children:t}=r,s=c(r,["className","children"]);const{variant:l}=f();return n.jsx("div",u(o({"data-slot":"card-topic-number",className:i.cn("flex size-[30px] shrink-0 items-center justify-center rounded-full text-md font-medium text-primary-foreground-onfill",l==="blocked"?"bg-primary-foreground-muted":"bg-primary-foreground",a)},s),{children:t}))}function I(e){var r=e,{className:a}=r,t=c(r,["className"]);const{variant:s}=f();return n.jsx("div",o({"data-slot":"card-topic-title",className:i.cn("min-w-[min(100%,6rem)] flex-1 break-words text-md font-semibold leading-md",s==="blocked"?"text-primary-foreground-muted":"text-primary-foreground",a)},t))}function M(e){var r=e,{className:a,progress:t}=r,s=c(r,["className","progress"]);const{variant:l,availableDate:d}=f();if(l==="blocked")return d?n.jsx("div",u(o({"data-slot":"card-topic-progress",className:i.cn("flex min-w-0",a)},s),{children:n.jsxs(O.Tag,{variant:"gray-soft",icon:n.jsx(b.Lock,{"aria-hidden":!0}),children:["Dispon\xEDvel em ",d]})})):null;if(t===void 0)return null;const m=i.clampPercentage(t),k=Math.round(m),g=m>=100;return n.jsxs("div",u(o({"data-slot":"card-topic-progress",className:i.cn("flex min-w-[min(180px,100%)] flex-col gap-2",a)},s),{children:[n.jsx("div",{className:"text-xs font-medium leading-xs text-gray-foreground-muted",children:g?"Conclu\xEDdo":n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"font-semibold text-gray-foreground",children:[k,"%"]})," de progresso"]})}),n.jsx(T.Progress,{"aria-hidden":"true",value:m,indicatorClassName:g?"bg-secondary-stroke-emphasis":"bg-primary-stroke"})]}))}function A(e){var r=e,{className:a,children:t}=r,s=c(r,["className","children"]);const{variant:l}=f();return n.jsxs("div",u(o({"data-slot":"card-topic-count",className:i.cn("flex shrink-0 items-center gap-2",a)},s),{children:[n.jsx("span",{className:"text-sm font-medium leading-sm text-gray-foreground-muted",children:t}),n.jsx(b.ChevronDown,{"aria-hidden":!0,size:18,strokeWidth:2.4,className:i.cn("shrink-0 text-gray-foreground",l!=="blocked"&&"transition-transform duration-200 group-data-[state=open]:rotate-180")})]}))}function G(e){var r=e,{className:a,children:t}=r,s=c(r,["className","children"]);return n.jsx(x.CollapsibleContent,u(o({"data-slot":"card-topic-content"},s),{children:n.jsx("div",{className:i.cn("px-4 pb-4",a),children:t})}))}exports.CardTopic=E,exports.CardTopicColumn=z,exports.CardTopicContent=G,exports.CardTopicCount=A,exports.CardTopicNumber=F,exports.CardTopicProgress=M,exports.CardTopicTitle=I,exports.CardTopicTrigger=V,exports.cardTopicVariants=y;
|
|
4
4
|
//# sourceMappingURL=CardTopic.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
import{jsx as o,jsxs as f,Fragment as k}from"react/jsx-runtime";import{cva as w}from"class-variance-authority";import{createContext as T,useMemo as O,useContext as P}from"react";import{Collapsible as j,CollapsibleContent as D,CollapsibleTrigger as $}from"./Collapsible.mjs";import{Progress as E}from"./Progress.mjs";import{Tag as
|
|
3
|
+
import{jsx as o,jsxs as f,Fragment as k}from"react/jsx-runtime";import{cva as w}from"class-variance-authority";import{createContext as T,useMemo as O,useContext as P}from"react";import{Collapsible as j,CollapsibleContent as D,CollapsibleTrigger as $}from"./Collapsible.mjs";import{Progress as E}from"./Progress.mjs";import{Tag as I}from"./Tag.mjs";import{cn as i,clampPercentage as z}from"../lib/utils.mjs";import{ChevronDown as F,Lock as M}from"@medway-ui/icons";var V=Object.defineProperty,G=Object.defineProperties,H=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,b=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable,h=(a,r,e)=>r in a?V(a,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[r]=e,s=(a,r)=>{for(var e in r||(r={}))b.call(r,e)&&h(a,e,r[e]);if(v)for(var e of v(r))x.call(r,e)&&h(a,e,r[e]);return a},m=(a,r)=>G(a,H(r)),c=(a,r)=>{var e={};for(var t in a)b.call(a,t)&&r.indexOf(t)<0&&(e[t]=a[t]);if(a!=null&&v)for(var t of v(a))r.indexOf(t)<0&&x.call(a,t)&&(e[t]=a[t]);return e};const N=w("flex flex-col overflow-hidden rounded-2xl border border-gray-stroke-muted",{variants:{variant:{default:"bg-surface-card",blocked:"bg-gray-background-soft"}},defaultVariants:{variant:"default"}}),y=T(null);function p(){var a;return(a=P(y))!=null?a:{}}function J(a){var r=a,{className:e,variant:t,availableDate:n,children:l}=r,d=c(r,["className","variant","availableDate","children"]);const u=O(()=>({variant:t,availableDate:n}),[t,n]);return o(y.Provider,{value:u,children:o(j,m(s({"data-slot":"card-topic",animation:"accordion",className:i(N({variant:t}),e)},d),{children:l}))})}function K(a){var r=a,{className:e,children:t}=r,n=c(r,["className","children"]);const{variant:l}=p(),d=l==="blocked";return o($,m(s({"data-slot":"card-topic-trigger",disabled:d,className:i("group flex min-h-16 w-full select-none flex-wrap items-center gap-4 p-4 text-left","[&>*:first-child]:flex-1","disabled:pointer-events-none disabled:cursor-default",!d&&"cursor-pointer",e)},n),{children:t}))}function L(a){var r=a,{className:e}=r,t=c(r,["className"]);return o("div",s({"data-slot":"card-topic-column",className:i("flex min-w-[min(100%,10rem)] max-w-full flex-wrap items-center gap-4",e)},t))}function Q(a){var r=a,{className:e,children:t}=r,n=c(r,["className","children"]);const{variant:l}=p();return o("div",m(s({"data-slot":"card-topic-number",className:i("flex size-[30px] shrink-0 items-center justify-center rounded-full text-md font-medium text-primary-foreground-onfill",l==="blocked"?"bg-primary-foreground-muted":"bg-primary-foreground",e)},n),{children:t}))}function R(a){var r=a,{className:e}=r,t=c(r,["className"]);const{variant:n}=p();return o("div",s({"data-slot":"card-topic-title",className:i("min-w-[min(100%,6rem)] flex-1 break-words text-md font-semibold leading-md",n==="blocked"?"text-primary-foreground-muted":"text-primary-foreground",e)},t))}function S(a){var r=a,{className:e,progress:t}=r,n=c(r,["className","progress"]);const{variant:l,availableDate:d}=p();if(l==="blocked")return d?o("div",m(s({"data-slot":"card-topic-progress",className:i("flex min-w-0",e)},n),{children:f(I,{variant:"gray-soft",icon:o(M,{"aria-hidden":!0}),children:["Dispon\xEDvel em ",d]})})):null;if(t===void 0)return null;const u=z(t),C=Math.round(u),g=u>=100;return f("div",m(s({"data-slot":"card-topic-progress",className:i("flex min-w-[min(180px,100%)] flex-col gap-2",e)},n),{children:[o("div",{className:"text-xs font-medium leading-xs text-gray-foreground-muted",children:g?"Conclu\xEDdo":f(k,{children:[f("span",{className:"font-semibold text-gray-foreground",children:[C,"%"]})," de progresso"]})}),o(E,{"aria-hidden":"true",value:u,indicatorClassName:g?"bg-secondary-stroke-emphasis":"bg-primary-stroke"})]}))}function W(a){var r=a,{className:e,children:t}=r,n=c(r,["className","children"]);const{variant:l}=p();return f("div",m(s({"data-slot":"card-topic-count",className:i("flex shrink-0 items-center gap-2",e)},n),{children:[o("span",{className:"text-sm font-medium leading-sm text-gray-foreground-muted",children:t}),o(F,{"aria-hidden":!0,size:18,strokeWidth:2.4,className:i("shrink-0 text-gray-foreground",l!=="blocked"&&"transition-transform duration-200 group-data-[state=open]:rotate-180")})]}))}function q(a){var r=a,{className:e,children:t}=r,n=c(r,["className","children"]);return o(D,m(s({"data-slot":"card-topic-content"},n),{children:o("div",{className:i("px-4 pb-4",e),children:t})}))}export{J as CardTopic,L as CardTopicColumn,q as CardTopicContent,W as CardTopicCount,Q as CardTopicNumber,S as CardTopicProgress,R as CardTopicTitle,K as CardTopicTrigger,N as cardTopicVariants};
|
|
4
4
|
//# sourceMappingURL=CardTopic.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
"use strict";var t=require("react/jsx-runtime"),m=require("react"),N=require("./Breadcrumb.js"),q=require("./Progress.js"),z=require("./ProgressCircle.js"),R=require("./Tag.js"),p=require("./Tooltip.js"),B=require("../hooks/use-composed-refs.js"),o=require("../lib/utils.js"),k=require("@medway-ui/icons"),H=Object.defineProperty
|
|
3
|
+
"use strict";var t=require("react/jsx-runtime"),m=require("react"),N=require("./Breadcrumb.js"),q=require("./Progress.js"),z=require("./ProgressCircle.js"),R=require("./Tag.js"),p=require("./Tooltip.js"),B=require("../hooks/use-composed-refs.js"),o=require("../lib/utils.js"),k=require("@medway-ui/icons"),H=Object.defineProperty,$=Object.defineProperties,D=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable,j=(r,e,a)=>e in r?H(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,d=(r,e)=>{for(var a in e||(e={}))h.call(e,a)&&j(r,a,e[a]);if(v)for(var a of v(e))b.call(e,a)&&j(r,a,e[a]);return r},x=(r,e)=>$(r,D(e)),i=(r,e)=>{var a={};for(var s in r)h.call(r,s)&&e.indexOf(s)<0&&(a[s]=r[s]);if(r!=null&&v)for(var s of v(r))e.indexOf(s)<0&&b.call(r,s)&&(a[s]=r[s]);return a};const f=m.createContext(null);function I(r){var e=r,{className:a,done:s,postponed:n,skipped:c}=e,l=i(e,["className","done","postponed","skipped"]);const u=m.useMemo(()=>({done:s,postponed:n,skipped:c}),[s,n,c]);return t.jsx(f.Provider,{value:u,children:t.jsx("div",d({"data-slot":"card-week",className:o.cn("flex flex-col overflow-hidden rounded-xl border border-gray-stroke-muted text-gray-foreground-muted",a)},l))})}function S(r){var e=r,{className:a,children:s,tag:n,tagIcon:c}=e,l=i(e,["className","children","tag","tagIcon"]);return t.jsxs("div",x(d({"data-slot":"card-week-breadcrumb",className:o.cn("flex min-h-12 min-w-0 items-center gap-4 bg-primary-background-soft-muted px-6 py-3",a)},l),{children:[t.jsx(N.Breadcrumb,{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:t.jsx(N.BreadcrumbList,{className:"w-max flex-nowrap gap-1.5 whitespace-nowrap text-xs",children:s})}),n&&t.jsx(R.Tag,{variant:"regular-soft",icon:c,children:n})]}))}function A(r){var e=r,{className:a}=e,s=i(e,["className"]);return t.jsx("div",d({"data-slot":"card-week-container",className:o.cn("flex flex-1 flex-col gap-5 bg-surface-card px-6 py-5",a)},s))}function E(r){var e=r,{className:a}=e,s=i(e,["className"]);return t.jsx("div",d({"data-slot":"card-week-header",className:o.cn("flex items-start justify-between gap-4 [&.border-b]:pb-6 [&>*]:min-w-0",a)},s))}const F=m.forwardRef(function(r,e){var a=r,{className:s,children:n}=a,c=i(a,["className","children"]);const l=m.useContext(f),u=l==null?void 0:l.done,C=l==null?void 0:l.postponed,y=l==null?void 0:l.skipped,w=m.useRef(null),W=B.useComposedRefs(e,w),[T,P]=m.useState(!1);return t.jsx(p.TooltipProvider,{children:t.jsxs(p.Tooltip,{open:T,onOpenChange:O=>{const g=w.current;P(O&&!!g&&g.scrollHeight>g.clientHeight+1)},children:[t.jsx(p.TooltipTrigger,{asChild:!0,children:t.jsx("div",x(d({ref:W,"data-slot":"card-week-title",className:o.cn("line-clamp-2 break-words text-lg font-semibold leading-lg text-primary-foreground",(u||C||y)&&"text-primary-foreground-muted line-through",s)},c),{children:n}))}),t.jsx(p.TooltipContent,{side:"top",className:"max-w-xs break-words",children:n})]})})});function L(r){var e=r,{className:a}=e,s=i(e,["className"]);const n=m.useContext(f),c=n==null?void 0:n.done,l=n==null?void 0:n.postponed,u=n==null?void 0:n.skipped;return t.jsx("div",d({"data-slot":"card-week-description",className:o.cn("text-xs font-semibold leading-xs text-gray-foreground",(c||l||u)&&"text-gray-foreground-muted",a)},s))}function M(r){var e=r,{className:a}=e,s=i(e,["className"]);return t.jsx("div",d({"data-slot":"card-week-tags",className:o.cn("flex flex-wrap items-center gap-2 [[data-slot=card-week-header]:not(:has([data-slot=card-week-progress]))+&]:mt-6",a)},s))}function U(r){var e=r,{className:a,value:s}=e,n=i(e,["className","value"]);return t.jsx("div",{"data-slot":"card-week-progress-circle",className:o.cn("ml-auto flex shrink-0 justify-end",a),children:t.jsx(z.ProgressCircle,d({size:104,value:s},n))})}function X(r){var e=r,{className:a,value:s,indicatorClassName:n}=e,c=i(e,["className","value","indicatorClassName"]);const l=m.useContext(f),u=l==null?void 0:l.done;return t.jsx("div",{"data-slot":"card-week-progress",className:o.cn("flex flex-1",a),children:t.jsx(q.Progress,x(d({},c),{value:u?100:s,indicatorClassName:o.cn(u&&"bg-secondary-stroke-emphasis",n)}))})}function Y(r){var e=r,{className:a}=e,s=i(e,["className"]);return t.jsx("div",d({"data-slot":"card-week-footer",className:o.cn("mt-auto flex flex-col gap-2",a)},s))}function Z(r){var e=r,{className:a,children:s}=e,n=i(e,["className","children"]);return t.jsx("div",x(d({"data-slot":"card-week-content",className:o.cn("flex min-w-0 flex-col text-xs font-medium",a)},n),{children:s}))}function _(r){var e=r,{className:a,children:s,isTime:n}=e,c=i(e,["className","children","isTime"]);return t.jsxs("div",x(d({"data-slot":"card-week-text",className:o.cn("flex min-w-0 items-center gap-1.5",n?"text-secondary-foreground":"text-gray-foreground-muted",a)},c),{children:[n&&t.jsx(k.TimeRemaining,{size:16}),t.jsx("span",{className:"min-w-0 break-words",children:s})]}))}function G(r){var e=r,{className:a}=e,s=i(e,["className"]);const n=m.useContext(f),c=n==null?void 0:n.done,l=n==null?void 0:n.postponed,u=n==null?void 0:n.skipped;return!c&&!l&&!u?null:l||u?t.jsxs("div",x(d({"data-slot":"card-week-status",className:o.cn("ml-auto flex min-w-0 max-w-full items-center gap-1.5",a)},s),{children:[t.jsx("div",{className:"flex size-4 shrink-0 items-center justify-center rounded-full bg-yellow-24 text-feedback-warning-foreground",children:t.jsx(k.Check,{size:12,strokeWidth:1.67})}),t.jsx("div",{className:"min-w-0 break-words font-semibold text-feedback-warning-foreground",children:l?"Adiado":"Pulado"})]})):t.jsxs("div",x(d({"data-slot":"card-week-status",className:o.cn("ml-auto flex min-w-0 max-w-full items-center gap-1.5",a)},s),{children:[t.jsx("div",{className:"flex size-4 shrink-0 items-center justify-center rounded-full bg-secondary-background-soft text-secondary-foreground",children:t.jsx(k.Check,{size:12,strokeWidth:1.67})}),t.jsx("div",{className:"min-w-0 break-words font-semibold text-secondary-foreground",children:"Conclu\xEDdo"})]}))}function J(r){var e=r,{className:a}=e,s=i(e,["className"]);return t.jsx("div",d({"data-slot":"card-week-actions",className:o.cn("flex flex-wrap items-center justify-end gap-2 pt-4 max-[500px]:flex-col max-[500px]:flex-nowrap max-[500px]:items-stretch max-[500px]:[&_[data-slot=button]]:w-full",a)},s))}exports.CardWeek=I,exports.CardWeekActions=J,exports.CardWeekBreadcrumb=S,exports.CardWeekContainer=A,exports.CardWeekContent=Z,exports.CardWeekDescription=L,exports.CardWeekFooter=Y,exports.CardWeekHeader=E,exports.CardWeekProgress=X,exports.CardWeekProgressCircle=U,exports.CardWeekStatus=G,exports.CardWeekTags=M,exports.CardWeekText=_,exports.CardWeekTitle=F;
|
|
4
4
|
//# sourceMappingURL=CardWeek.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
import{jsx as o,jsxs as f}from"react/jsx-runtime";import{createContext as P,forwardRef as
|
|
3
|
+
import{jsx as o,jsxs as f}from"react/jsx-runtime";import{createContext as P,forwardRef as z,useContext as x,useRef as $,useState as R,useMemo as H}from"react";import{Breadcrumb as I,BreadcrumbList as B}from"./Breadcrumb.mjs";import{Progress as D}from"./Progress.mjs";import{ProgressCircle as S}from"./ProgressCircle.mjs";import{Tag as A}from"./Tag.mjs";import{TooltipProvider as E,Tooltip as F,TooltipTrigger as L,TooltipContent as M}from"./Tooltip.mjs";import{useComposedRefs as U}from"../hooks/use-composed-refs.mjs";import{cn as n}from"../lib/utils.mjs";import{Check as k,TimeRemaining as X}from"@medway-ui/icons";var Y=Object.defineProperty,Z=Object.defineProperties,_=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable,b=(a,e,r)=>e in a?Y(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r,d=(a,e)=>{for(var r in e||(e={}))h.call(e,r)&&b(a,r,e[r]);if(v)for(var r of v(e))N.call(e,r)&&b(a,r,e[r]);return a},u=(a,e)=>Z(a,_(e)),c=(a,e)=>{var r={};for(var s in a)h.call(a,s)&&e.indexOf(s)<0&&(r[s]=a[s]);if(a!=null&&v)for(var s of v(a))e.indexOf(s)<0&&N.call(a,s)&&(r[s]=a[s]);return r};const p=P(null);function q(a){var e=a,{className:r,done:s,postponed:t,skipped:i}=e,l=c(e,["className","done","postponed","skipped"]);const m=H(()=>({done:s,postponed:t,skipped:i}),[s,t,i]);return o(p.Provider,{value:m,children:o("div",d({"data-slot":"card-week",className:n("flex flex-col overflow-hidden rounded-xl border border-gray-stroke-muted text-gray-foreground-muted",r)},l))})}function G(a){var e=a,{className:r,children:s,tag:t,tagIcon:i}=e,l=c(e,["className","children","tag","tagIcon"]);return f("div",u(d({"data-slot":"card-week-breadcrumb",className:n("flex min-h-12 min-w-0 items-center gap-4 bg-primary-background-soft-muted px-6 py-3",r)},l),{children:[o(I,{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:o(B,{className:"w-max flex-nowrap gap-1.5 whitespace-nowrap text-xs",children:s})}),t&&o(A,{variant:"regular-soft",icon:i,children:t})]}))}function J(a){var e=a,{className:r}=e,s=c(e,["className"]);return o("div",d({"data-slot":"card-week-container",className:n("flex flex-1 flex-col gap-5 bg-surface-card px-6 py-5",r)},s))}function K(a){var e=a,{className:r}=e,s=c(e,["className"]);return o("div",d({"data-slot":"card-week-header",className:n("flex items-start justify-between gap-4 [&.border-b]:pb-6 [&>*]:min-w-0",r)},s))}const Q=z(function(a,e){var r=a,{className:s,children:t}=r,i=c(r,["className","children"]);const l=x(p),m=l==null?void 0:l.done,C=l==null?void 0:l.postponed,y=l==null?void 0:l.skipped,w=$(null),W=U(e,w),[O,j]=R(!1);return o(E,{children:f(F,{open:O,onOpenChange:T=>{const g=w.current;j(T&&!!g&&g.scrollHeight>g.clientHeight+1)},children:[o(L,{asChild:!0,children:o("div",u(d({ref:W,"data-slot":"card-week-title",className:n("line-clamp-2 break-words text-lg font-semibold leading-lg text-primary-foreground",(m||C||y)&&"text-primary-foreground-muted line-through",s)},i),{children:t}))}),o(M,{side:"top",className:"max-w-xs break-words",children:t})]})})});function V(a){var e=a,{className:r}=e,s=c(e,["className"]);const t=x(p),i=t==null?void 0:t.done,l=t==null?void 0:t.postponed,m=t==null?void 0:t.skipped;return o("div",d({"data-slot":"card-week-description",className:n("text-xs font-semibold leading-xs text-gray-foreground",(i||l||m)&&"text-gray-foreground-muted",r)},s))}function ee(a){var e=a,{className:r}=e,s=c(e,["className"]);return o("div",d({"data-slot":"card-week-tags",className:n("flex flex-wrap items-center gap-2 [[data-slot=card-week-header]:not(:has([data-slot=card-week-progress]))+&]:mt-6",r)},s))}function ae(a){var e=a,{className:r,value:s}=e,t=c(e,["className","value"]);return o("div",{"data-slot":"card-week-progress-circle",className:n("ml-auto flex shrink-0 justify-end",r),children:o(S,d({size:104,value:s},t))})}function re(a){var e=a,{className:r,value:s,indicatorClassName:t}=e,i=c(e,["className","value","indicatorClassName"]);const l=x(p),m=l==null?void 0:l.done;return o("div",{"data-slot":"card-week-progress",className:n("flex flex-1",r),children:o(D,u(d({},i),{value:m?100:s,indicatorClassName:n(m&&"bg-secondary-stroke-emphasis",t)}))})}function se(a){var e=a,{className:r}=e,s=c(e,["className"]);return o("div",d({"data-slot":"card-week-footer",className:n("mt-auto flex flex-col gap-2",r)},s))}function te(a){var e=a,{className:r,children:s}=e,t=c(e,["className","children"]);return o("div",u(d({"data-slot":"card-week-content",className:n("flex min-w-0 flex-col text-xs font-medium",r)},t),{children:s}))}function oe(a){var e=a,{className:r,children:s,isTime:t}=e,i=c(e,["className","children","isTime"]);return f("div",u(d({"data-slot":"card-week-text",className:n("flex min-w-0 items-center gap-1.5",t?"text-secondary-foreground":"text-gray-foreground-muted",r)},i),{children:[t&&o(X,{size:16}),o("span",{className:"min-w-0 break-words",children:s})]}))}function le(a){var e=a,{className:r}=e,s=c(e,["className"]);const t=x(p),i=t==null?void 0:t.done,l=t==null?void 0:t.postponed,m=t==null?void 0:t.skipped;return!i&&!l&&!m?null:l||m?f("div",u(d({"data-slot":"card-week-status",className:n("ml-auto flex min-w-0 max-w-full items-center gap-1.5",r)},s),{children:[o("div",{className:"flex size-4 shrink-0 items-center justify-center rounded-full bg-yellow-24 text-feedback-warning-foreground",children:o(k,{size:12,strokeWidth:1.67})}),o("div",{className:"min-w-0 break-words font-semibold text-feedback-warning-foreground",children:l?"Adiado":"Pulado"})]})):f("div",u(d({"data-slot":"card-week-status",className:n("ml-auto flex min-w-0 max-w-full items-center gap-1.5",r)},s),{children:[o("div",{className:"flex size-4 shrink-0 items-center justify-center rounded-full bg-secondary-background-soft text-secondary-foreground",children:o(k,{size:12,strokeWidth:1.67})}),o("div",{className:"min-w-0 break-words font-semibold text-secondary-foreground",children:"Conclu\xEDdo"})]}))}function ne(a){var e=a,{className:r}=e,s=c(e,["className"]);return o("div",d({"data-slot":"card-week-actions",className:n("flex flex-wrap items-center justify-end gap-2 pt-4 max-[500px]:flex-col max-[500px]:flex-nowrap max-[500px]:items-stretch max-[500px]:[&_[data-slot=button]]:w-full",r)},s))}export{q as CardWeek,ne as CardWeekActions,G as CardWeekBreadcrumb,J as CardWeekContainer,te as CardWeekContent,V as CardWeekDescription,se as CardWeekFooter,K as CardWeekHeader,re as CardWeekProgress,ae as CardWeekProgressCircle,le as CardWeekStatus,ee as CardWeekTags,oe as CardWeekText,Q as CardWeekTitle};
|
|
4
4
|
//# sourceMappingURL=CardWeek.mjs.map
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import useEmblaCarousel, { type UseEmblaCarouselType } from "embla-carousel-react";
|
|
2
|
+
import { type ComponentProps } from "react";
|
|
3
|
+
import { type ButtonProps } from "./Button.mjs";
|
|
4
|
+
type CarouselApi = NonNullable<UseEmblaCarouselType[1]>;
|
|
5
|
+
type CarouselOptions = Omit<NonNullable<Parameters<typeof useEmblaCarousel>[0]>, "axis" | "align" | "loop" | "dragFree" | "slidesToScroll" | "startIndex">;
|
|
6
|
+
type CarouselOrientation = "horizontal" | "vertical";
|
|
7
|
+
type CarouselAlign = "start" | "center" | "end";
|
|
8
|
+
type CarouselStep = number | "page";
|
|
9
|
+
type CarouselTransition = "slide" | "fade";
|
|
10
|
+
type CarouselControls = "side" | "floating" | "outside" | "inline";
|
|
11
|
+
type CarouselControlsFrom = "always" | "md" | "lg";
|
|
12
|
+
type CarouselEdgeBehavior = "disable" | "hide";
|
|
13
|
+
type CarouselGap = "none" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
14
|
+
type CarouselArrowProps = Omit<ButtonProps, "iconLeft" | "iconRight" | "children">;
|
|
15
|
+
type CarouselAutoplayToggleProps = Omit<ButtonProps, "iconLeft" | "iconRight" | "children">;
|
|
16
|
+
interface CarouselAutoplayOptions {
|
|
17
|
+
delay?: number;
|
|
18
|
+
}
|
|
19
|
+
interface CarouselProps extends Omit<ComponentProps<"div">, "aria-label"> {
|
|
20
|
+
"aria-label": string;
|
|
21
|
+
orientation?: CarouselOrientation;
|
|
22
|
+
align?: CarouselAlign;
|
|
23
|
+
step?: CarouselStep;
|
|
24
|
+
loop?: boolean;
|
|
25
|
+
dragFree?: boolean;
|
|
26
|
+
transition?: CarouselTransition;
|
|
27
|
+
autoplay?: boolean | CarouselAutoplayOptions;
|
|
28
|
+
controls?: CarouselControls;
|
|
29
|
+
controlsFrom?: CarouselControlsFrom;
|
|
30
|
+
edgeBehavior?: CarouselEdgeBehavior;
|
|
31
|
+
hideControlsWhenFits?: boolean;
|
|
32
|
+
index?: number;
|
|
33
|
+
defaultIndex?: number;
|
|
34
|
+
onIndexChange?: (index: number) => void;
|
|
35
|
+
setApi?: (api: CarouselApi) => void;
|
|
36
|
+
opts?: CarouselOptions;
|
|
37
|
+
}
|
|
38
|
+
interface CarouselContentProps extends ComponentProps<"div"> {
|
|
39
|
+
gap?: CarouselGap;
|
|
40
|
+
fadeEdges?: boolean;
|
|
41
|
+
fadeClassName?: string;
|
|
42
|
+
viewportClassName?: string;
|
|
43
|
+
}
|
|
44
|
+
interface CarouselDotsProps extends ComponentProps<"div"> {
|
|
45
|
+
getDotLabel?: (index: number, total: number) => string;
|
|
46
|
+
dotClassName?: string;
|
|
47
|
+
indicatorClassName?: string;
|
|
48
|
+
}
|
|
49
|
+
interface CarouselAutoplayState {
|
|
50
|
+
isEnabled: boolean;
|
|
51
|
+
isPaused: boolean;
|
|
52
|
+
isRotating: boolean;
|
|
53
|
+
toggle: () => void;
|
|
54
|
+
}
|
|
55
|
+
interface CarouselState {
|
|
56
|
+
selectedIndex: number;
|
|
57
|
+
snapCount: number;
|
|
58
|
+
canScrollPrev: boolean;
|
|
59
|
+
canScrollNext: boolean;
|
|
60
|
+
isScrollable: boolean;
|
|
61
|
+
scrollPrev: () => void;
|
|
62
|
+
scrollNext: () => void;
|
|
63
|
+
scrollTo: (index: number) => void;
|
|
64
|
+
autoplay: CarouselAutoplayState;
|
|
65
|
+
}
|
|
66
|
+
declare function useCarousel(): CarouselState;
|
|
67
|
+
declare const Carousel: import("react").ForwardRefExoticComponent<Omit<CarouselProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
68
|
+
declare const CarouselContent: import("react").ForwardRefExoticComponent<Omit<CarouselContentProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
69
|
+
declare const CarouselItem: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
70
|
+
declare const CarouselPrevious: import("react").ForwardRefExoticComponent<Omit<CarouselArrowProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
71
|
+
declare const CarouselNext: import("react").ForwardRefExoticComponent<Omit<CarouselArrowProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
72
|
+
declare const CarouselDots: import("react").ForwardRefExoticComponent<Omit<CarouselDotsProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
73
|
+
declare const CarouselAutoplayToggle: import("react").ForwardRefExoticComponent<Omit<CarouselAutoplayToggleProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
74
|
+
export { Carousel, CarouselAutoplayToggle, CarouselContent, CarouselDots, CarouselItem, CarouselNext, CarouselPrevious, useCarousel, };
|
|
75
|
+
export type { CarouselAlign, CarouselApi, CarouselArrowProps, CarouselAutoplayOptions, CarouselAutoplayToggleProps, CarouselContentProps, CarouselControls, CarouselControlsFrom, CarouselDotsProps, CarouselEdgeBehavior, CarouselGap, CarouselOptions, CarouselOrientation, CarouselProps, CarouselState, CarouselStep, CarouselTransition, };
|
|
76
|
+
//# sourceMappingURL=Carousel.d.ts.map
|
|
@@ -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AC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import useEmblaCarousel, { type UseEmblaCarouselType } from "embla-carousel-react";
|
|
2
|
+
import { type ComponentProps } from "react";
|
|
3
|
+
import { type ButtonProps } from "./Button.js";
|
|
4
|
+
type CarouselApi = NonNullable<UseEmblaCarouselType[1]>;
|
|
5
|
+
type CarouselOptions = Omit<NonNullable<Parameters<typeof useEmblaCarousel>[0]>, "axis" | "align" | "loop" | "dragFree" | "slidesToScroll" | "startIndex">;
|
|
6
|
+
type CarouselOrientation = "horizontal" | "vertical";
|
|
7
|
+
type CarouselAlign = "start" | "center" | "end";
|
|
8
|
+
type CarouselStep = number | "page";
|
|
9
|
+
type CarouselTransition = "slide" | "fade";
|
|
10
|
+
type CarouselControls = "side" | "floating" | "outside" | "inline";
|
|
11
|
+
type CarouselControlsFrom = "always" | "md" | "lg";
|
|
12
|
+
type CarouselEdgeBehavior = "disable" | "hide";
|
|
13
|
+
type CarouselGap = "none" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
14
|
+
type CarouselArrowProps = Omit<ButtonProps, "iconLeft" | "iconRight" | "children">;
|
|
15
|
+
type CarouselAutoplayToggleProps = Omit<ButtonProps, "iconLeft" | "iconRight" | "children">;
|
|
16
|
+
interface CarouselAutoplayOptions {
|
|
17
|
+
delay?: number;
|
|
18
|
+
}
|
|
19
|
+
interface CarouselProps extends Omit<ComponentProps<"div">, "aria-label"> {
|
|
20
|
+
"aria-label": string;
|
|
21
|
+
orientation?: CarouselOrientation;
|
|
22
|
+
align?: CarouselAlign;
|
|
23
|
+
step?: CarouselStep;
|
|
24
|
+
loop?: boolean;
|
|
25
|
+
dragFree?: boolean;
|
|
26
|
+
transition?: CarouselTransition;
|
|
27
|
+
autoplay?: boolean | CarouselAutoplayOptions;
|
|
28
|
+
controls?: CarouselControls;
|
|
29
|
+
controlsFrom?: CarouselControlsFrom;
|
|
30
|
+
edgeBehavior?: CarouselEdgeBehavior;
|
|
31
|
+
hideControlsWhenFits?: boolean;
|
|
32
|
+
index?: number;
|
|
33
|
+
defaultIndex?: number;
|
|
34
|
+
onIndexChange?: (index: number) => void;
|
|
35
|
+
setApi?: (api: CarouselApi) => void;
|
|
36
|
+
opts?: CarouselOptions;
|
|
37
|
+
}
|
|
38
|
+
interface CarouselContentProps extends ComponentProps<"div"> {
|
|
39
|
+
gap?: CarouselGap;
|
|
40
|
+
fadeEdges?: boolean;
|
|
41
|
+
fadeClassName?: string;
|
|
42
|
+
viewportClassName?: string;
|
|
43
|
+
}
|
|
44
|
+
interface CarouselDotsProps extends ComponentProps<"div"> {
|
|
45
|
+
getDotLabel?: (index: number, total: number) => string;
|
|
46
|
+
dotClassName?: string;
|
|
47
|
+
indicatorClassName?: string;
|
|
48
|
+
}
|
|
49
|
+
interface CarouselAutoplayState {
|
|
50
|
+
isEnabled: boolean;
|
|
51
|
+
isPaused: boolean;
|
|
52
|
+
isRotating: boolean;
|
|
53
|
+
toggle: () => void;
|
|
54
|
+
}
|
|
55
|
+
interface CarouselState {
|
|
56
|
+
selectedIndex: number;
|
|
57
|
+
snapCount: number;
|
|
58
|
+
canScrollPrev: boolean;
|
|
59
|
+
canScrollNext: boolean;
|
|
60
|
+
isScrollable: boolean;
|
|
61
|
+
scrollPrev: () => void;
|
|
62
|
+
scrollNext: () => void;
|
|
63
|
+
scrollTo: (index: number) => void;
|
|
64
|
+
autoplay: CarouselAutoplayState;
|
|
65
|
+
}
|
|
66
|
+
declare function useCarousel(): CarouselState;
|
|
67
|
+
declare const Carousel: import("react").ForwardRefExoticComponent<Omit<CarouselProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
68
|
+
declare const CarouselContent: import("react").ForwardRefExoticComponent<Omit<CarouselContentProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
69
|
+
declare const CarouselItem: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
70
|
+
declare const CarouselPrevious: import("react").ForwardRefExoticComponent<Omit<CarouselArrowProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
71
|
+
declare const CarouselNext: import("react").ForwardRefExoticComponent<Omit<CarouselArrowProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
72
|
+
declare const CarouselDots: import("react").ForwardRefExoticComponent<Omit<CarouselDotsProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
73
|
+
declare const CarouselAutoplayToggle: import("react").ForwardRefExoticComponent<Omit<CarouselAutoplayToggleProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
74
|
+
export { Carousel, CarouselAutoplayToggle, CarouselContent, CarouselDots, CarouselItem, CarouselNext, CarouselPrevious, useCarousel, };
|
|
75
|
+
export type { CarouselAlign, CarouselApi, CarouselArrowProps, CarouselAutoplayOptions, CarouselAutoplayToggleProps, CarouselContentProps, CarouselControls, CarouselControlsFrom, CarouselDotsProps, CarouselEdgeBehavior, CarouselGap, CarouselOptions, CarouselOrientation, CarouselProps, CarouselState, CarouselStep, CarouselTransition, };
|
|
76
|
+
//# sourceMappingURL=Carousel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Carousel.d.ts","sourceRoot":"","sources":["../../src/components/Carousel.tsx"],"names":[],"mappings":"AAIA,OAAO,gBAAgB,EAAE,EACvB,KAAK,oBAAoB,EAC1B,MAAM,sBAAsB,CAAC;AAU9B,OAAO,EAaL,KAAK,cAAc,EAQpB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAK/D,KAAK,WAAW,GAAG,WAAW,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;AACxD,KAAK,eAAe,GAAG,IAAI,CACzB,WAAW,CAAC,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,E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,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,EAAE,qBAAqB,CAAC;CACjC;AA6ZD,iBAAS,WAAW,IAAI,aAAa,CAqCpC;AA6KD,QAAA,MAAM,QAAQ,uHAgab,CAAC;AAEF,QAAA,MAAM,eAAe,8HAoGpB,CAAC;AAEF,QAAA,MAAM,YAAY,2MAmCjB,CAAC;AAkFF,QAAA,MAAM,gBAAgB,+HAIrB,CAAC;AAEF,QAAA,MAAM,YAAY,+HAIjB,CAAC;AAEF,QAAA,MAAM,YAAY,2HAkEjB,CAAC;AAEF,QAAA,MAAM,sBAAsB,wIAsC1B,CAAC;AAEH,OAAO,EACL,QAAQ,EACR,sBAAsB,EACtB,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,WAAW,GACZ,CAAC;AACF,YAAY,EACV,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,uBAAuB,EACvB,2BAA2B,EAC3B,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,YAAY,EACZ,kBAAkB,GACnB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
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"),nt=require("../hooks/use-composed-refs.js"),ot=require("../hooks/use-prefers-reduced-motion.js"),w=require("../lib/utils.js"),rt=Object.defineProperty,at=Object.defineProperties,lt=Object.getOwnPropertyDescriptors,oe=Object.getOwnPropertySymbols,je=Object.prototype.hasOwnProperty,Ae=Object.prototype.propertyIsEnumerable,Oe=(e,t,n)=>t in e?rt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,S=(e,t)=>{for(var n in t||(t={}))je.call(t,n)&&Oe(e,n,t[n]);if(oe)for(var n of oe(t))Ae.call(t,n)&&Oe(e,n,t[n]);return e},A=(e,t)=>at(e,lt(t)),W=(e,t)=>{var n={};for(var r in e)je.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&oe)for(var r of oe(e))t.indexOf(r)<0&&Ae.call(e,r)&&(n[r]=e[r]);return n};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",{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-[3px] 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:n,canScrollNext:r,isScrollable:c,scrollPrev:v,scrollNext:u,scrollTo:p,autoplay:s}=J();return a.useMemo(()=>({selectedIndex:e,snapCount:t,canScrollPrev:n,canScrollNext:r,isScrollable:c,scrollPrev:v,scrollNext:u,scrollTo:p,autoplay:s}),[e,t,n,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,n)=>{var r;return(r=t[0])!=null?r:n})}}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((n,r)=>n===t.snapFirstSlides[r])&&e.announcement===t.announcement}function Pt(e,t){const n=Object.keys(e);return n.length===Object.keys(t).length&&n.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(n=>{var r;if(!a.isValidElement(n))return[];const c=`${t}${(r=n.key)!=null?r:""}`;return n.type===a.Fragment?De(n.props.children,`${c}/`):[a.cloneElement(n,{key:c})]})}function Et(e,t,n){const r=document.activeElement;return r===n&&!e.canScrollNext&&e.canScrollPrev?"previous":r===t&&!e.canScrollPrev&&e.canScrollNext?"next":null}function zt(e,t){const n=getComputedStyle(e);return t==="horizontal"?/auto|scroll/.test(n.overflowX)&&e.scrollWidth>e.clientWidth:/auto|scroll/.test(n.overflowY)&&e.scrollHeight>e.clientHeight}function It(e,t){var n;return e instanceof HTMLElement&&e.isContentEditable||e instanceof HTMLInputElement&&!dt.includes(e.type)||ut.includes(e.tagName)||ft.includes((n=e.getAttribute("role"))!=null?n:"")||zt(e,t)}function Ft(e,t){const n=e.nativeEvent.composedPath();return n.slice(0,n.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,n;(n=(t=e.plugins())==null?void 0:t.autoplay)==null||n.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 n;const r=e.slideNodes().length;if(r===0)return"";const c=e.selectedScrollSnap();return t?`P\xE1gina ${c+1} de ${e.scrollSnapList().length}`:`Slide ${((n=$e(e)[0])!=null?n: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 n=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}=n,re=W(n,["orientation","align","step","loop","dragFree","transition","autoplay","controls","controlsFrom","edgeBehavior","hideControlsWhenFits","index","defaultIndex","onIndexChange","setApi","opts","className","children","onKeyDown","onFocus","onPointerEnter","onPointerLeave"]),C=ot.usePrefersReducedMotion(),j=h!==!1,U=jt(h),L=me(F),[ae]=a.useState(()=>{var o;return(o=L!=null?L:me(k))!=null?o:0}),He=a.useMemo(()=>{const o=[];return j&&o.push(Qe({delay:U,playOnInit:!1,stopOnInteraction:!0,stopOnFocusIn:!1,stopOnMouseEnter:!1})),s==="fade"&&o.push(et()),o},[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]),ne=a.useCallback(()=>{l&&(l.scrollNext(C),he(l))},[l,C]),fe=a.useCallback(o=>{if(!l)return;const i=o!==l.selectedScrollSnap();l.scrollTo(o,C),i&&he(l)},[l,C]),ve=a.useCallback(o=>{ue.current=!0;try{o==="previous"?te():ne()}finally{ue.current=!1}},[te,ne]),Pe=a.useCallback(()=>{var o;return(o=ee.current)==null?void 0:o.call(ee)},[]),Ee=a.useCallback(()=>xe(X?"playing":"paused"),[X]),Xe=o=>{O==null||O(o);const i=ct[r][o.key];!i||o.defaultPrevented||o.altKey||o.ctrlKey||o.metaKey||o.shiftKey||o.currentTarget.contains(o.target)&&(Ft(o,r)||(o.preventDefault(),ve(i)))},Ge=o=>{V==null||V(o),!(!j||le==="playing")&&kt(o.target)&&xe("paused")},Je=o=>{H==null||H(o),o.pointerType==="mouse"&&ye(!0)},Ye=o=>{Y==null||Y(o),o.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:ne,scrollTo:fe,scrollFromArrow:ve,syncFadeInert:Pe,autoplay:ze}),[_,r,s,b,d,R,z,Se,Q,be,te,ne,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 o=!1;const i=(N,m)=>{const g=wt(l),$=m==="select"&&o;$&&(o=!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){o=!m;try{l.scrollTo(g,!0)}finally{o=!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 o;const i=ce.current;i&&(ce.current=null,(o=(i==="previous"?ie:se).current)==null||o.focus({preventScroll:!0}))},[_]),a.useEffect(()=>{const o=Ne.current;if(!l||o&&Pt(o,e))return;if(Ne.current=e,L===void 0){Z.current=null;return}const i=l.selectedScrollSnap(),y=L===me(o==null?void 0:o.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 o=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&&o.has(g)&&(We(g),o.delete(g))});const m=N?y.find(g=>!g.inert):void 0;m&&(m.hasAttribute("tabindex")||(m.tabIndex=-1,o.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);o.forEach(We)}},[l,s]),a.useEffect(()=>{var o;const i=(o=l==null?void 0:l.plugins())==null?void 0:o.autoplay;i&&(D?i.play(C):i.stop())},[l,D,C]),a.useEffect(()=>{if(!l)return;const o=()=>{var i,y;we.current&&((y=(i=l.plugins())==null?void 0:i.autoplay)==null||y.play(Re.current))};return l.on("pointerUp",o).on("reInit",o),()=>{l.off("pointerUp",o).off("reInit",o)}},[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 n=e,{gap:r="md",fadeEdges:c=!1,fadeClassName:v,viewportClassName:u,className:p,children:s}=n,h=W(n,["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 n=e,{className:r,inert:c}=n,v=W(n,["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 n=e,{direction:r,variant:c="outlined",size:v="md",className:u,containerClassName:p,disabled:s,onClick:h}=n,b=W(n,["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=nt.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 n=e,{getDotLabel:r,dotClassName:c,indicatorClassName:v,className:u}=n,p=W(n,["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 n=e,{variant:r="outlined",size:c="sm",containerClassName:v,onClick:u}=n,p=W(n,["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;
|
|
4
|
+
//# sourceMappingURL=Carousel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Carousel.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
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,Be=Object.prototype.propertyIsEnumerable,Ke=(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)&&Ke(e,o,t[o]);if(ae)for(var o of ae(t))Be.call(t,o)&&Ke(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&&Be.call(e,r)&&(o[r]=e[r]);return o};const wt=5e3,We="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",{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-[3px] focus-visible:ring-state-focus",Bt="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 Kt(){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 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 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(We)}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:B,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,K=A&&te&&!J&&!et,Fe=S(K),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:K,toggle:Oe}),[A,J,K,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=K,Re.current=y}),O(()=>{l&&z&&z(l)},[l,z]),O(()=>{if(!l)return;let n=!1;const i=(C,m)=>{const p=Wt(l),W=m==="select"&&n;W&&(n=!1);const Le=m!=="select"?void 0:W?"":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,W)=>!F.has(W)&&p.contains(document.activeElement));x.forEach((p,W)=>{p.inert=!F.has(W)||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&&(K?i.play(y):i.stop())},[l,K,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:B}))})}),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(($,B)=>{var D;return v(Ve.Provider,{value:{index:B,total:z.length,gapClassName:I.item,focusRingClassName:I.focusRing},children:$},(D=$.key)!=null?D:B)})})),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={[We]: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:B,nextButtonRef:D}=Z(),U=r==="previous",_=U?z:I,Q=yt(t,U?B: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(Bt,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,Kt as useCarousel};
|
|
4
|
+
//# sourceMappingURL=Carousel.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Carousel.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
package/dist/components/Chip.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
"use strict";var s=require("react/jsx-runtime"),f=require("class-variance-authority"),c=require("@medway-ui/icons"),o=require("../lib/utils.js"),C=Object.defineProperty,O=Object.defineProperties,V=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,x=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,j=(a,e,r)=>e in a?C(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r,u=(a,e)=>{for(var r in e||(e={}))x.call(e,r)&&j(a,r,e[r]);if(l)for(var r of l(e))y.call(e,r)&&j(a,r,e[r]);return a},h=(a,e)=>O(a,V(e)),m=(a,e)=>{var r={};for(var t in a)x.call(a,t)&&e.indexOf(t)<0&&(r[t]=a[t]);if(a!=null&&l)for(var t of l(a))e.indexOf(t)<0&&y.call(a,t)&&(r[t]=a[t]);return r};const P={sm:"gap-2 px-3 py-2 text-xs leading-xs [&_svg:not([class*=
|
|
3
|
+
"use strict";var s=require("react/jsx-runtime"),f=require("class-variance-authority"),c=require("@medway-ui/icons"),o=require("../lib/utils.js"),C=Object.defineProperty,O=Object.defineProperties,V=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,x=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,j=(a,e,r)=>e in a?C(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r,u=(a,e)=>{for(var r in e||(e={}))x.call(e,r)&&j(a,r,e[r]);if(l)for(var r of l(e))y.call(e,r)&&j(a,r,e[r]);return a},h=(a,e)=>O(a,V(e)),m=(a,e)=>{var r={};for(var t in a)x.call(a,t)&&e.indexOf(t)<0&&(r[t]=a[t]);if(a!=null&&l)for(var t of l(a))e.indexOf(t)<0&&y.call(a,t)&&(r[t]=a[t]);return r};const P={sm:"gap-2 px-3 py-2 text-xs leading-xs [&_svg:not([class*=size-])]:size-4",md:"gap-2.5 px-3.5 py-2.5 text-sm leading-sm [&_svg:not([class*=size-])]:size-5",lg:"gap-3 px-4 py-3 text-md leading-md [&_svg:not([class*=size-])]:size-6"},p={variants:{size:P},defaultVariants:{size:"md"}},g="relative isolate inline-flex w-fit min-w-0 max-w-full shrink-0 items-center justify-center whitespace-nowrap transition-colors hover:cursor-pointer disabled:pointer-events-none [&_svg]:shrink-0",k=f.cva([g,"group/chip rounded-sm bg-surface-elevated font-semibold text-primary-foreground shadow-level-1-subtle disabled:bg-gray-background-soft-muted disabled:font-medium disabled:text-gray-foreground-muted disabled:shadow-none"],p),v=f.cva([g,"group/chip rounded-md bg-gray-background-soft font-medium text-gray-foreground [@media(hover:hover)]:data-[checked=false]:hover:bg-gray-background-soft-emphasis [@media(hover:hover)]:data-[checked=false]:hover:text-gray-foreground-emphasis enabled:data-[checked=true]:font-semibold enabled:data-[checked=true]:text-primary-foreground enabled:data-[checked=true]:before:absolute enabled:data-[checked=true]:before:inset-0.5 enabled:data-[checked=true]:before:-z-10 enabled:data-[checked=true]:before:rounded-[calc(var(--radius-md)-2px)] enabled:data-[checked=true]:before:bg-surface-card enabled:data-[checked=true]:before:shadow-level-1-subtle disabled:bg-gray-background-soft-muted disabled:text-gray-foreground-muted"],p),N=f.cva([g,"rounded-md bg-transparent font-semibold text-primary-foreground [@media(hover:hover)]:hover:bg-gray-background-soft-emphasis disabled:text-gray-foreground-muted"],p),M={sm:"w-[5px]",md:"w-[6px]",lg:"w-[7px]"};function q(a){var e=a,{className:r,size:t,dismissLabel:n="Remover",children:i}=e,d=m(e,["className","size","dismissLabel","children"]);return s.jsxs("button",h(u({"data-slot":"chip",className:o.cn(k({size:t}),r)},d),{type:"button",children:[s.jsx("span",{className:"truncate",children:i}),s.jsx("span",{className:"sr-only",children:n}),s.jsx(c.CloseMd,{"aria-hidden":"true","data-slot":"chip-dismiss",className:"text-gray-foreground-muted [@media(hover:hover)]:group-hover/chip:text-primary-foreground"})]}))}function F(a){var e=a,{className:r,size:t,icon:n,criteria:i,checked:d=!1,children:b}=e,z=m(e,["className","size","icon","criteria","checked","children"]);const w=i!=null&&typeof i!="boolean"&&i!=="";return s.jsxs("button",h(u({"data-slot":"chip-filter","data-checked":d,className:o.cn(v({size:t}),r)},z),{type:"button",children:[n,s.jsxs("span",{className:"inline-flex min-w-0",children:[s.jsx("span",{className:"truncate",children:b}),w&&s.jsxs(s.Fragment,{children:[s.jsx("span",{"aria-hidden":"true",className:o.cn("inline-flex shrink-0 justify-center",M[t!=null?t:p.defaultVariants.size]),children:":"}),s.jsx("span",{className:"truncate",children:i})]})]}),s.jsx(c.ChevronDown,{"aria-hidden":"true"})]}))}function L(a){var e=a,{className:r,size:t,icon:n,checked:i=!1,children:d}=e,b=m(e,["className","size","icon","checked","children"]);return s.jsxs("button",h(u({"data-slot":"chip-choice","data-checked":i,"aria-pressed":i,className:o.cn(v({size:t}),r)},b),{type:"button",children:[n,s.jsx("span",{className:"truncate",children:d}),i&&s.jsxs(s.Fragment,{children:[s.jsx(c.CheckMedium,{"aria-hidden":"true",className:"text-secondary-foreground group-disabled/chip:text-gray-foreground-muted [@media(hover:hover)]:group-hover/chip:hidden"}),s.jsx(c.CloseMd,{"aria-hidden":"true",className:"hidden text-primary-foreground [@media(hover:hover)]:group-hover/chip:block"})]})]}))}function _(a){var e=a,{className:r,size:t,children:n="Limpar"}=e,i=m(e,["className","size","children"]);return s.jsxs("button",h(u({"data-slot":"chip-clear",className:o.cn(N({size:t}),r)},i),{type:"button",children:[s.jsx("span",{className:"truncate",children:n}),s.jsx(c.CloseMd,{"aria-hidden":"true"})]}))}exports.Chip=q,exports.ChipChoice=L,exports.ChipClear=_,exports.ChipFilter=F,exports.chipClearVariants=N,exports.chipSelectableVariants=v,exports.chipVariants=k;
|
|
4
4
|
//# sourceMappingURL=Chip.js.map
|
package/dist/components/Chip.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
import{jsxs as n,jsx as i,Fragment as x}from"react/jsx-runtime";import{cva as f}from"class-variance-authority";import{CloseMd as g,CheckMedium as P,ChevronDown as V}from"@medway-ui/icons";import{cn as c}from"../lib/utils.mjs";var L=Object.defineProperty,_=Object.defineProperties,D=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,k=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable,z=(a,e,r)=>e in a?L(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r,h=(a,e)=>{for(var r in e||(e={}))k.call(e,r)&&z(a,r,e[r]);if(l)for(var r of l(e))N.call(e,r)&&z(a,r,e[r]);return a},u=(a,e)=>_(a,D(e)),m=(a,e)=>{var r={};for(var t in a)k.call(a,t)&&e.indexOf(t)<0&&(r[t]=a[t]);if(a!=null&&l)for(var t of l(a))e.indexOf(t)<0&&N.call(a,t)&&(r[t]=a[t]);return r};const F={sm:"gap-2 px-3 py-2 text-xs leading-xs [&_svg:not([class*=
|
|
3
|
+
import{jsxs as n,jsx as i,Fragment as x}from"react/jsx-runtime";import{cva as f}from"class-variance-authority";import{CloseMd as g,CheckMedium as P,ChevronDown as V}from"@medway-ui/icons";import{cn as c}from"../lib/utils.mjs";var L=Object.defineProperty,_=Object.defineProperties,D=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,k=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable,z=(a,e,r)=>e in a?L(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r,h=(a,e)=>{for(var r in e||(e={}))k.call(e,r)&&z(a,r,e[r]);if(l)for(var r of l(e))N.call(e,r)&&z(a,r,e[r]);return a},u=(a,e)=>_(a,D(e)),m=(a,e)=>{var r={};for(var t in a)k.call(a,t)&&e.indexOf(t)<0&&(r[t]=a[t]);if(a!=null&&l)for(var t of l(a))e.indexOf(t)<0&&N.call(a,t)&&(r[t]=a[t]);return r};const F={sm:"gap-2 px-3 py-2 text-xs leading-xs [&_svg:not([class*=size-])]:size-4",md:"gap-2.5 px-3.5 py-2.5 text-sm leading-sm [&_svg:not([class*=size-])]:size-5",lg:"gap-3 px-4 py-3 text-md leading-md [&_svg:not([class*=size-])]:size-6"},p={variants:{size:F},defaultVariants:{size:"md"}},v="relative isolate inline-flex w-fit min-w-0 max-w-full shrink-0 items-center justify-center whitespace-nowrap transition-colors hover:cursor-pointer disabled:pointer-events-none [&_svg]:shrink-0",w=f([v,"group/chip rounded-sm bg-surface-elevated font-semibold text-primary-foreground shadow-level-1-subtle disabled:bg-gray-background-soft-muted disabled:font-medium disabled:text-gray-foreground-muted disabled:shadow-none"],p),y=f([v,"group/chip rounded-md bg-gray-background-soft font-medium text-gray-foreground [@media(hover:hover)]:data-[checked=false]:hover:bg-gray-background-soft-emphasis [@media(hover:hover)]:data-[checked=false]:hover:text-gray-foreground-emphasis enabled:data-[checked=true]:font-semibold enabled:data-[checked=true]:text-primary-foreground enabled:data-[checked=true]:before:absolute enabled:data-[checked=true]:before:inset-0.5 enabled:data-[checked=true]:before:-z-10 enabled:data-[checked=true]:before:rounded-[calc(var(--radius-md)-2px)] enabled:data-[checked=true]:before:bg-surface-card enabled:data-[checked=true]:before:shadow-level-1-subtle disabled:bg-gray-background-soft-muted disabled:text-gray-foreground-muted"],p),j=f([v,"rounded-md bg-transparent font-semibold text-primary-foreground [@media(hover:hover)]:hover:bg-gray-background-soft-emphasis disabled:text-gray-foreground-muted"],p),M={sm:"w-[5px]",md:"w-[6px]",lg:"w-[7px]"};function R(a){var e=a,{className:r,size:t,dismissLabel:d="Remover",children:s}=e,o=m(e,["className","size","dismissLabel","children"]);return n("button",u(h({"data-slot":"chip",className:c(w({size:t}),r)},o),{type:"button",children:[i("span",{className:"truncate",children:s}),i("span",{className:"sr-only",children:d}),i(g,{"aria-hidden":"true","data-slot":"chip-dismiss",className:"text-gray-foreground-muted [@media(hover:hover)]:group-hover/chip:text-primary-foreground"})]}))}function S(a){var e=a,{className:r,size:t,icon:d,criteria:s,checked:o=!1,children:b}=e,C=m(e,["className","size","icon","criteria","checked","children"]);const O=s!=null&&typeof s!="boolean"&&s!=="";return n("button",u(h({"data-slot":"chip-filter","data-checked":o,className:c(y({size:t}),r)},C),{type:"button",children:[d,n("span",{className:"inline-flex min-w-0",children:[i("span",{className:"truncate",children:b}),O&&n(x,{children:[i("span",{"aria-hidden":"true",className:c("inline-flex shrink-0 justify-center",M[t!=null?t:p.defaultVariants.size]),children:":"}),i("span",{className:"truncate",children:s})]})]}),i(V,{"aria-hidden":"true"})]}))}function B(a){var e=a,{className:r,size:t,icon:d,checked:s=!1,children:o}=e,b=m(e,["className","size","icon","checked","children"]);return n("button",u(h({"data-slot":"chip-choice","data-checked":s,"aria-pressed":s,className:c(y({size:t}),r)},b),{type:"button",children:[d,i("span",{className:"truncate",children:o}),s&&n(x,{children:[i(P,{"aria-hidden":"true",className:"text-secondary-foreground group-disabled/chip:text-gray-foreground-muted [@media(hover:hover)]:group-hover/chip:hidden"}),i(g,{"aria-hidden":"true",className:"hidden text-primary-foreground [@media(hover:hover)]:group-hover/chip:block"})]})]}))}function E(a){var e=a,{className:r,size:t,children:d="Limpar"}=e,s=m(e,["className","size","children"]);return n("button",u(h({"data-slot":"chip-clear",className:c(j({size:t}),r)},s),{type:"button",children:[i("span",{className:"truncate",children:d}),i(g,{"aria-hidden":"true"})]}))}export{R as Chip,B as ChipChoice,E as ChipClear,S as ChipFilter,j as chipClearVariants,y as chipSelectableVariants,w as chipVariants};
|
|
4
4
|
//# sourceMappingURL=Chip.mjs.map
|