@xjur-ui/react 3.0.2 → 3.0.4
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/CHANGELOG.md +12 -0
- package/dist/components/accordion/accordion-tab-header.js +1 -1
- package/dist/components/accordion/accordion-trigger.js +1 -1
- package/dist/components/breadcrumb/breadcrumb-ellipsis.js +1 -1
- package/dist/components/breadcrumb/breadcrumb-separator.js +1 -1
- package/dist/components/breadcrumb/index.js +1 -1
- package/dist/components/carousel/carousel-action.d.ts +1 -1
- package/dist/components/carousel/carousel-action.js +1 -1
- package/dist/components/carousel/index.js +1 -1
- package/dist/components/controls/checkbox.js +1 -1
- package/dist/components/controls/date-picker/index.js +1 -1
- package/dist/components/controls/input/input-icon.js +1 -1
- package/dist/components/controls/input/input-numeric-stepper.js +1 -1
- package/dist/components/controls/rich-editor.js +1 -1
- package/dist/components/controls/search-selector.js +1 -1
- package/dist/components/controls/select/index.js +1 -1
- package/dist/components/controls/select/select-content.js +1 -1
- package/dist/components/controls/select/select-header-title.js +1 -1
- package/dist/components/controls/select/select-header.js +1 -1
- package/dist/components/controls/select/select-option.js +1 -1
- package/dist/components/controls/select/select-options.js +1 -1
- package/dist/components/custom/pessoa/pessoa-body.js +1 -1
- package/dist/components/custom/pessoa/pessoa-close-button.js +1 -1
- package/dist/components/custom/pessoa/pessoa-content.js +1 -1
- package/dist/components/custom/pessoa/pessoa-footer.js +1 -1
- package/dist/components/custom/pessoa/pessoa-header.js +1 -1
- package/dist/components/custom/pessoa/pessoa.js +1 -1
- package/dist/components/dialog/delete-dialog.js +1 -1
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-content.js +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-item.js +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-list.js +1 -1
- package/dist/components/dropdown-menu/index.js +1 -1
- package/dist/components/full-calendar/calendar-cell.js +1 -1
- package/dist/components/full-calendar/calendar-day-view.js +1 -1
- package/dist/components/full-calendar/calendar-month-view.js +1 -1
- package/dist/components/full-calendar/calendar-more-events-dropdown.js +1 -1
- package/dist/components/full-calendar/calendar-navigator.js +1 -1
- package/dist/components/full-calendar/calendar-toggle-view.js +1 -1
- package/dist/components/full-calendar/calendar-view-renderer.js +1 -1
- package/dist/components/full-calendar/calendar-week-view.js +1 -1
- package/dist/components/full-calendar/index.js +1 -1
- package/dist/components/icon/index.js +1 -1
- package/dist/components/list/index.js +1 -1
- package/dist/components/list/list-root.js +1 -1
- package/dist/components/sheet/sheet-close.js +1 -1
- package/dist/components/table/index.js +1 -1
- package/dist/components/table/table-sort.js +1 -1
- package/dist/components/tag/index.js +1 -1
- package/dist/components/tag/tag-close.js +1 -1
- package/dist/components/toast/index.js +1 -1
- package/dist/components/upload/index.js +1 -1
- package/dist/index.css +1 -1
- package/dist/resources/icons.d.ts +1 -1
- package/dist/resources/icons.js +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as $ from"@radix-ui/react-popover";import{createContext as te,useContext as oe}from"react";var b=te({state:"normal",variant:"normal",customMask:void 0,mask:void 0});function l(){let e=oe(b);if(!e)throw new Error("useFieldContext must be used within a InputRoot, SelectRoot, DatePickerRoot, etc.");return e}import{tv as re}from"@xjur-ui/util";var s=re({slots:{wrapper:"group flex flex-col gap-small-2x",trigger:["h-large-4x w-auto inline-flex cursor-pointer relative","items-center gap-small rounded-small-1x","py-small_1x-alt px-small","bg-layer-2-idle border border-border-layer-2","group-has-[div[data-slot=input-action-slot]]:rounded-r-none","transition-all duration-200"],content:["group z-1000 max-h-[var(--radix-popover-content-available-height)] max-w-[240px] min-w-[var(--radix-popover-trigger-width)] group-data-[state=open]:rotate-180 transition-transform duration-200"],icon:"size-large text-icon-neutral-3 flex items-center justify-center",slotText:"size-large flex items-center justify-center !text-size-label-md text-neutral-placeholder",caption:"!text-size-body-sm font-normal"},variants:{state:{normal:{trigger:"hover:border-border-layer-3 data-[state=open]:border-primary-idle data-[state=open]:hover:border-primary-idle"},error:{trigger:"border-danger-idle hover:border-danger-idle data-[state=open]:border-danger-idle data-[state=open]:hover:border-danger-idle",caption:"text-danger-label-idle"},disabled:{trigger:"pointer-events-none border-transparent bg-layer-2-idle"}}}});import{jsx as C}from"react/jsx-runtime";var{wrapper:ae}=s();function P({className:e,state:o="normal",defaultOpen:t,variant:r="normal",modal:n,open:a,onOpenChange:i,...d}){return C($.Root,{defaultOpen:t,modal:n,open:a,onOpenChange:i,children:C(b.Provider,{value:{state:o,variant:r},children:C("div",{className:ae({className:e,state:o}),...d})})})}import{tv as ne,twMerge as ie}from"@xjur-ui/util";import*as q from"@radix-ui/react-popover";import{jsx as se}from"react/jsx-runtime";var{trigger:le}=s();function w({className:e,...o}){let{state:t,variant:r}=l(),n=ne({base:["group bg-layer-2-idle"],variants:{state:{normal:["border-border-layer-2 hover:border-border-layer-3 has-[input:not(:placeholder-shown)]:border-primary-idle"],error:["border-danger-idle hover:border-danger-idle"],disabled:["border border-border-layer-2 opacity-60"]}}}),a=ie(le({state:t,className:e}),r==="filter"&&n({state:t,className:e}));return se(q.Trigger,{className:a,disabled:t==="disabled",...o})}import{cx as pe}from"@xjur-ui/util";import{jsx as de}from"react/jsx-runtime";function B({className:e,filled:o=!1,name:t,...r}){return de("span",{...r,className:pe("material-symbols-outlined","text-size-body-lg select-none",e),style:{fontVariationSettings:`'FILL' ${o?1:0}, 'wght' 600, 'GRAD' 0, 'opsz' 20`,...r.style},children:t})}import{jsx as G}from"react/jsx-runtime";var{icon:me}=s();function T({className:e,name:o,orientation:t="left",...r}){let{state:n}=l();return G("div",{className:me({className:e,state:n}),"data-slot":`control-${t}-slot`,...r,children:G(B,{name:o})})}import{twJoin as Ce}from"@xjur-ui/util";import{useMemo as Pe}from"react";import{Slot as ve}from"@radix-ui/react-slot";import{cva as ge}from"@xjur-ui/util";import{memo as J,useState as xe}from"react";import*as v from"@radix-ui/react-tooltip";import{jsx as _}from"react/jsx-runtime";function ce({delayDuration:e=0,...o}){return _(v.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...o})}function S({...e}){return _(ce,{children:_(v.Root,{"data-slot":"tooltip",...e})})}import*as K from"@radix-ui/react-tooltip";import{jsx as ue}from"react/jsx-runtime";function z({...e}){return ue(K.Trigger,{"data-slot":"tooltip-trigger",...e})}import*as g from"@radix-ui/react-tooltip";import{cx as fe}from"@xjur-ui/util";import{jsx as W}from"react/jsx-runtime";function V({className:e,sideOffset:o=1,variant:t="simple",children:r,...n}){return W(g.Portal,{children:W(g.Content,{className:fe("text-size-body-sm z-99999 text-balance","data-[variant=simple]:bg-alt-2 data-[variant=simple]:text-neutral-label data-[variant=simple]:rounded-small-1x data-[variant=simple]:px-small data-[variant=simple]:py-small-1x","data-[variant=rich]:bg-layer-2-idle data-[variant=rich]:text-neutral-dark data-[variant=rich]:rounded-small data-[variant=rich]:border-border-layer-2 data-[variant=rich]:p-large data-[variant=rich]:border","animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin)",e),"data-slot":"tooltip-content","data-variant":t,sideOffset:o,...n,children:r})})}import{jsx as x,jsxs as he}from"react/jsx-runtime";var ye=ge("",{variants:{variant:{body:"",label:"",title:"",headline:""},size:{"sm-2x":"","sm-1x":"",sm:"",md:"",lg:""},weight:{thin:"font-thin",extraLight:"font-extralight",light:"font-light",normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold",extraBold:"font-extrabold",black:"font-black"}},compoundVariants:[{variant:"body",size:"sm-1x",class:"text-size-body-sm-1x"},{variant:"body",size:"sm",class:"text-size-body-sm"},{variant:"body",size:"md",class:"text-size-body-md"},{variant:"body",size:"lg",class:"text-size-body-lg"},{variant:"label",size:"sm-2x",class:"text-size-label-sm-2x"},{variant:"label",size:"sm-1x",class:"text-size-label-sm-1x"},{variant:"label",size:"sm",class:"text-size-label-sm"},{variant:"label",size:"md",class:"text-size-label-md"},{variant:"label",size:"lg",class:"text-size-label-lg"},{variant:"title",size:"sm",class:"text-size-title-sm"},{variant:"title",size:"md",class:"text-size-title-md"},{variant:"title",size:"lg",class:"text-size-title-lg"},{variant:"headline",size:"sm",class:"text-size-headline-sm"},{variant:"headline",size:"md",class:"text-size-headline-md"},{variant:"headline",size:"lg",class:"text-size-headline-lg"}],defaultVariants:{variant:"body",size:"md",weight:"normal"}}),m=J(({variant:e,size:o,weight:t,asChild:r,className:n,...a})=>x(r?ve:"span",{className:ye({variant:e,size:o,weight:t,className:n}),...a}));m.displayName="Typography";var R=J(({children:e,...o})=>{let[t,r]=xe(!1);return he(S,{children:[x(z,{asChild:!0,children:x(m,{onMouseEnter:({currentTarget:a})=>{let i=a.scrollWidth>a.clientWidth;r(i),i?a.style.cursor="pointer":a.style.cursor="text"},...o,children:e})}),t&&x(V,{children:e})]})});R.displayName="TruncatedTypography";import{tv as be}from"@xjur-ui/util";import{jsx as Y}from"react/jsx-runtime";function k({className:e,htmlFor:o,children:t,...r}){let{state:n}=l(),a=be({base:["group inline-block max-w-full truncate text-left","ease animate-in left-small right-small pointer-events-none absolute top-1/2 -translate-y-1/2 transition-all duration-250","text-size-body-md","group-focus-within:-top-[3px]","group-data-[state=open]:-top-[3px]","group-focus-within:text-size-label-sm-1x group-focus-within:font-medium","group-data-[state=open]:text-size-label-sm-1x group-data-[state=open]:font-medium","group-has-[input:not(:placeholder-shown)]:-top-[3px]","group-has-[input:not(:placeholder-shown)]:text-size-label-sm-1x","group-has-[input:not(:placeholder-shown)]:font-medium","group-has-[div[data-slot=control-left-slot]]:left-large-4x","group-has-[div[data-slot=control-left-slot]]:group-focus-within:left-small","group-has-[div[data-slot=control-left-slot]]:group-has-[input:not(:placeholder-shown)]:left-small","group-has-[div[data-slot=control-left-slot]]:group-data-[state=open]:left-small","group-focus-within:animate-in","group-has-[input:not(:placeholder-shown)]:animate-out","data-[disabled=true]:hidden"],variants:{state:{normal:["group-focus-within:!text-primary-idle group-data-[state=open]:!text-primary-idle","group-has-[input:not(:placeholder-shown)]:!text-primary-idle"],error:["group-focus-within:!text-danger-label-active group-data-[state=open]:!text-danger-label-active","group-has-[input:not(:placeholder-shown)]:!text-danger-label-active"],disabled:[]}}});return Y("label",{className:a({className:e,state:n}),htmlFor:o,...r,children:Y("span",{className:"rounded-small-1x bg-layer-2-idle max-w-full",children:t})})}import{jsx as y,jsxs as we}from"react/jsx-runtime";function D({className:e,value:o,placeholder:t,renderValue:r,...n}){let{variant:a}=l(),i=Pe(()=>a==="filter"?r(o??""):r(o??"")||t,[o,t,a,r]);return we("div",{className:"grid w-full items-center",children:[t&&a==="filter"&&y(k,{children:t}),t&&a==="filter"&&y(m,{className:"invisible col-start-1 row-start-1 self-center",children:t}),y(m,{className:"text-neutral-dark z-10 col-start-1 row-start-1 self-center text-left",children:i}),y("input",{...n,"aria-readonly":!0,className:Ce("pointer-events-none",e),hidden:!0,placeholder:" ",readOnly:!0,value:o??""})]})}import{twMerge as Wt}from"@xjur-ui/util";import{Fragment as Yt,useMemo as Qt}from"react";import{jsx as eo,jsxs as to}from"react/jsx-runtime";import*as h from"@radix-ui/react-popover";import{Slot as _e}from"@radix-ui/react-slot";import{cx as Se}from"@xjur-ui/util";import{useVirtualizer as ze}from"@tanstack/react-virtual";import{useRef as Ve}from"react";import{createContext as Te}from"react";var f=Te({virtualizer:null,enabled:!1});import{jsx as Q}from"react/jsx-runtime";function N({className:e,asChild:o,children:t,virtualized:r=!1,itemCount:n=0,estimateSize:a=()=>48,overscan:i=5,...d}){let u=o?_e:"div",p=Ve(null),ee=ze({count:n,getScrollElement:()=>p.current,estimateSize:a,overscan:i,enabled:r});return Q(f.Provider,{value:{virtualizer:ee,enabled:r},children:Q(u,{...d,className:Se(e,"rounded-small scrollbar-thin bg-layer-2-idle border-border-layer-2 shadow-elevation-3 z-1000 max-h-[400px] list-none overflow-y-auto border"),ref:p,children:t})})}import{Slot as fo}from"@radix-ui/react-slot";import{cx as go}from"@xjur-ui/util";import{jsx as yo}from"react/jsx-runtime";import{cx as Co}from"@xjur-ui/util";import{jsx as To}from"react/jsx-runtime";import{Slot as Re}from"@radix-ui/react-slot";import{cx as U}from"@xjur-ui/util";import{useContext as ke}from"react";import{jsx as I}from"react/jsx-runtime";function E({className:e,asChild:o,children:t,renderItem:r,...n}){let a=o?Re:"ul",{virtualizer:i,enabled:d}=ke(f);if(d&&i&&r){let u=i.getVirtualItems();return I(a,{...n,className:U("p-small relative flex flex-col",e),style:{height:`${i.getTotalSize()}px`},children:u.map(p=>I("div",{className:"absolute top-0 left-0 w-full","data-index":p.index,ref:i.measureElement,style:{transform:`translateY(${p.start}px)`},children:r(p.index)},p.key))})}return I(a,{...n,className:U("gap-small-1x p-small flex flex-col",e),children:t})}import{Slot as De}from"@radix-ui/react-slot";import{cx as Ne,cva as Ie}from"@xjur-ui/util";import{jsx as Le}from"react/jsx-runtime";var Ee=Ie(["py-medium px-small flex items-center gap-small rounded-small-1x","bg-layer-2-idle text-neutral-dark","hover:bg-layer-2-hover transition-colors duration-100 ease-out","active:bg-layer-2-pressed"],{variants:{size:{md:"h-large-4x",lg:"h-large-7x"},isActive:{true:"bg-primary-alt-active text-primary-label-active hover:bg-primary-alt-hover active:bg-primary-alt-pressed"}},defaultVariants:{size:"md",isActive:!1}});function L({className:e,size:o,isActive:t,asChild:r,...n}){return Le(r?De:"li",{...n,className:Ne(Ee({size:o,isActive:t}),e)})}import{jsx as F}from"react/jsx-runtime";var{content:Oe}=s();function M({className:e,sideOffset:o=5,side:t="bottom",align:r="start",children:n,virtualized:a=!1,overscan:i=5,estimateSize:d=()=>32,...u}){let{state:p}=l();return F(h.Portal,{children:F(h.Content,{align:r,className:Oe({className:e,state:p}),side:t,sideOffset:o,...u,children:F(N,{estimateSize:d,overscan:i,virtualized:a,children:n})})})}import{jsx as Zo}from"react/jsx-runtime";var{caption:Uo}=s();import{jsx as ar}from"react/jsx-runtime";var{slotText:or}=s();import{jsx as He}from"react/jsx-runtime";function O(e){return He(E,{...e})}import{twMerge as Ae}from"@xjur-ui/util";import{jsx as $e}from"react/jsx-runtime";function H({className:e,...o}){return $e(L,{className:Ae(e,"cursor-pointer"),...o})}import{twMerge as qe}from"@xjur-ui/util";import{jsx as Be}from"react/jsx-runtime";function A({className:e,...o}){return Be(R,{className:qe(e,"truncate"),...o})}import{jsx as hr}from"react/jsx-runtime";import{jsx as wr}from"react/jsx-runtime";import{createContext as Ge,use as Ke,useCallback as Wr,useMemo as Jr,useState as Yr}from"react";import{DndContext as Ur,closestCenter as Xr,useSensor as Zr,useSensors as jr,PointerSensor as ea,KeyboardSensor as ta,MouseSensor as oa}from"@dnd-kit/core";import{sortableKeyboardCoordinates as aa}from"@dnd-kit/sortable";import{jsx as ia}from"react/jsx-runtime";var We=Ge({events:[],calendarView:"month",selectedDate:new Date,activeEventId:null,disableEventCreationInPast:!0,renderEvent:()=>null,setSelectedDate:()=>{},handleChangeView:()=>{},onEventMove:()=>{},onAddEvent:()=>{}});function X(){let e=Ke(We);if(!e)throw new Error("useFullCalendar must be used within a CalendarRoot");return e}import{jsx as c,jsxs as j}from"react/jsx-runtime";var Z=[{name:"M\xEAs",value:"month"},{name:"Semana",value:"week"},{name:"Dia",value:"day"}];function da(){let{calendarView:e,handleChangeView:o}=X();return c("div",{className:"w-[94px]",children:j(P,{children:[j(w,{children:[c(D,{name:"calendar-toggle-view",renderValue:t=>Z.find(r=>r.value===t)?.name??"",value:e}),c(T,{className:"text-icon-neutral-3",name:"keyboard_arrow_down"})]}),c(M,{children:c(O,{children:Z.map(t=>c(H,{isActive:e===t.value,value:t.value,onClick:()=>o(t.value),children:c(A,{children:t.name})},t.value))})})]})})}export{da as CalendarToggleView};
|
|
1
|
+
import*as $ from"@radix-ui/react-popover";import{createContext as te,useContext as oe}from"react";var b=te({state:"normal",variant:"normal",customMask:void 0,mask:void 0});function l(){let e=oe(b);if(!e)throw new Error("useFieldContext must be used within a InputRoot, SelectRoot, DatePickerRoot, etc.");return e}import{tv as re}from"@xjur-ui/util";var s=re({slots:{wrapper:"group flex flex-col gap-small-2x",trigger:["h-large-4x w-auto inline-flex cursor-pointer relative","items-center gap-small rounded-small-1x","py-small_1x-alt px-small","bg-layer-2-idle border border-border-layer-2","group-has-[div[data-slot=input-action-slot]]:rounded-r-none","transition-all duration-200"],content:["group z-1000 max-h-[var(--radix-popover-content-available-height)] max-w-[240px] min-w-[var(--radix-popover-trigger-width)] group-data-[state=open]:rotate-180 transition-transform duration-200"],icon:"size-large text-icon-neutral-3 flex items-center justify-center",slotText:"size-large flex items-center justify-center !text-size-label-md text-neutral-placeholder",caption:"!text-size-body-sm font-normal"},variants:{state:{normal:{trigger:"hover:border-border-layer-3 data-[state=open]:border-primary-idle data-[state=open]:hover:border-primary-idle"},error:{trigger:"border-danger-idle hover:border-danger-idle data-[state=open]:border-danger-idle data-[state=open]:hover:border-danger-idle",caption:"text-danger-label-idle"},disabled:{trigger:"pointer-events-none border-transparent bg-layer-2-idle"}}}});import{jsx as C}from"react/jsx-runtime";var{wrapper:ae}=s();function w({className:e,state:o="normal",defaultOpen:t,variant:r="normal",modal:n,open:a,onOpenChange:i,...d}){return C($.Root,{defaultOpen:t,modal:n,open:a,onOpenChange:i,children:C(b.Provider,{value:{state:o,variant:r},children:C("div",{className:ae({className:e,state:o}),...d})})})}import{tv as ne,twMerge as ie}from"@xjur-ui/util";import*as q from"@radix-ui/react-popover";import{jsx as se}from"react/jsx-runtime";var{trigger:le}=s();function P({className:e,...o}){let{state:t,variant:r}=l(),n=ne({base:["group bg-layer-2-idle"],variants:{state:{normal:["border-border-layer-2 hover:border-border-layer-3 has-[input:not(:placeholder-shown)]:border-primary-idle"],error:["border-danger-idle hover:border-danger-idle"],disabled:["border border-border-layer-2 opacity-60"]}}}),a=ie(le({state:t,className:e}),r==="filter"&&n({state:t,className:e}));return se(q.Trigger,{className:a,disabled:t==="disabled",...o})}import{cx as pe}from"@xjur-ui/util";import{jsx as de}from"react/jsx-runtime";function B({className:e,filled:o=!1,name:t,...r}){return de("span",{...r,className:pe("material-symbols-outlined","text-size-body-lg select-none",e),style:{fontVariationSettings:`'FILL' ${o?1:0}, 'wght' 600, 'GRAD' 0, 'opsz' 20`,...r.style},children:t})}import{jsx as G}from"react/jsx-runtime";var{icon:me}=s();function _({className:e,name:o,orientation:t="left",...r}){let{state:n}=l();return G("div",{className:me({className:e,state:n}),"data-slot":`control-${t}-slot`,...r,children:G(B,{name:o})})}import{twJoin as Ce}from"@xjur-ui/util";import{useMemo as we}from"react";import{Slot as ve}from"@radix-ui/react-slot";import{cva as ge}from"@xjur-ui/util";import{memo as J,useState as xe}from"react";import*as v from"@radix-ui/react-tooltip";import{jsx as T}from"react/jsx-runtime";function ce({delayDuration:e=0,...o}){return T(v.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...o})}function S({...e}){return T(ce,{children:T(v.Root,{"data-slot":"tooltip",...e})})}import*as K from"@radix-ui/react-tooltip";import{jsx as ue}from"react/jsx-runtime";function z({...e}){return ue(K.Trigger,{"data-slot":"tooltip-trigger",...e})}import*as g from"@radix-ui/react-tooltip";import{cx as fe}from"@xjur-ui/util";import{jsx as W}from"react/jsx-runtime";function V({className:e,sideOffset:o=1,variant:t="simple",children:r,...n}){return W(g.Portal,{children:W(g.Content,{className:fe("text-size-body-sm z-99999 text-balance","data-[variant=simple]:bg-alt-2 data-[variant=simple]:text-neutral-label data-[variant=simple]:rounded-small-1x data-[variant=simple]:px-small data-[variant=simple]:py-small-1x","data-[variant=rich]:bg-layer-2-idle data-[variant=rich]:text-neutral-dark data-[variant=rich]:rounded-small data-[variant=rich]:border-border-layer-2 data-[variant=rich]:p-large data-[variant=rich]:border","animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin)",e),"data-slot":"tooltip-content","data-variant":t,sideOffset:o,...n,children:r})})}import{jsx as x,jsxs as he}from"react/jsx-runtime";var ye=ge("",{variants:{variant:{body:"",label:"",title:"",headline:""},size:{"sm-2x":"","sm-1x":"",sm:"",md:"",lg:""},weight:{thin:"font-thin",extraLight:"font-extralight",light:"font-light",normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold",extraBold:"font-extrabold",black:"font-black"}},compoundVariants:[{variant:"body",size:"sm-1x",class:"text-size-body-sm-1x"},{variant:"body",size:"sm",class:"text-size-body-sm"},{variant:"body",size:"md",class:"text-size-body-md"},{variant:"body",size:"lg",class:"text-size-body-lg"},{variant:"label",size:"sm-2x",class:"text-size-label-sm-2x"},{variant:"label",size:"sm-1x",class:"text-size-label-sm-1x"},{variant:"label",size:"sm",class:"text-size-label-sm"},{variant:"label",size:"md",class:"text-size-label-md"},{variant:"label",size:"lg",class:"text-size-label-lg"},{variant:"title",size:"sm",class:"text-size-title-sm"},{variant:"title",size:"md",class:"text-size-title-md"},{variant:"title",size:"lg",class:"text-size-title-lg"},{variant:"headline",size:"sm",class:"text-size-headline-sm"},{variant:"headline",size:"md",class:"text-size-headline-md"},{variant:"headline",size:"lg",class:"text-size-headline-lg"}],defaultVariants:{variant:"body",size:"md",weight:"normal"}}),m=J(({variant:e,size:o,weight:t,asChild:r,className:n,...a})=>x(r?ve:"span",{className:ye({variant:e,size:o,weight:t,className:n}),...a}));m.displayName="Typography";var R=J(({children:e,...o})=>{let[t,r]=xe(!1);return he(S,{children:[x(z,{asChild:!0,children:x(m,{onMouseEnter:({currentTarget:a})=>{let i=a.scrollWidth>a.clientWidth;r(i),i?a.style.cursor="pointer":a.style.cursor="text"},...o,children:e})}),t&&x(V,{children:e})]})});R.displayName="TruncatedTypography";import{tv as be}from"@xjur-ui/util";import{jsx as Y}from"react/jsx-runtime";function k({className:e,htmlFor:o,children:t,...r}){let{state:n}=l(),a=be({base:["group inline-block max-w-full truncate text-left","ease animate-in left-small right-small pointer-events-none absolute top-1/2 -translate-y-1/2 transition-all duration-250","text-size-body-md","group-focus-within:-top-[3px]","group-data-[state=open]:-top-[3px]","group-focus-within:text-size-label-sm-1x group-focus-within:font-medium","group-data-[state=open]:text-size-label-sm-1x group-data-[state=open]:font-medium","group-has-[input:not(:placeholder-shown)]:-top-[3px]","group-has-[input:not(:placeholder-shown)]:text-size-label-sm-1x","group-has-[input:not(:placeholder-shown)]:font-medium","group-has-[div[data-slot=control-left-slot]]:left-large-4x","group-has-[div[data-slot=control-left-slot]]:group-focus-within:left-small","group-has-[div[data-slot=control-left-slot]]:group-has-[input:not(:placeholder-shown)]:left-small","group-has-[div[data-slot=control-left-slot]]:group-data-[state=open]:left-small","group-focus-within:animate-in","group-has-[input:not(:placeholder-shown)]:animate-out","data-[disabled=true]:hidden"],variants:{state:{normal:["group-focus-within:!text-primary-idle group-data-[state=open]:!text-primary-idle","group-has-[input:not(:placeholder-shown)]:!text-primary-idle"],error:["group-focus-within:!text-danger-label-active group-data-[state=open]:!text-danger-label-active","group-has-[input:not(:placeholder-shown)]:!text-danger-label-active"],disabled:[]}}});return Y("label",{className:a({className:e,state:n}),htmlFor:o,...r,children:Y("span",{className:"rounded-small-1x bg-layer-2-idle max-w-full",children:t})})}import{jsx as y,jsxs as Pe}from"react/jsx-runtime";function D({className:e,value:o,placeholder:t,renderValue:r,...n}){let{variant:a}=l(),i=we(()=>a==="filter"?r(o??""):r(o??"")||t,[o,t,a,r]);return Pe("div",{className:"grid w-full items-center",children:[t&&a==="filter"&&y(k,{children:t}),t&&a==="filter"&&y(m,{className:"invisible col-start-1 row-start-1 self-center",children:t}),y(m,{className:"text-neutral-dark z-10 col-start-1 row-start-1 self-center text-left",children:i}),y("input",{...n,"aria-readonly":!0,className:Ce("pointer-events-none",e),hidden:!0,placeholder:" ",readOnly:!0,value:o??""})]})}import{twMerge as Wt}from"@xjur-ui/util";import{Fragment as Yt,useMemo as Qt}from"react";import{jsx as eo,jsxs as to}from"react/jsx-runtime";import*as h from"@radix-ui/react-popover";import{Slot as Te}from"@radix-ui/react-slot";import{cx as Se}from"@xjur-ui/util";import{useVirtualizer as ze}from"@tanstack/react-virtual";import{useRef as Ve}from"react";import{createContext as _e}from"react";var f=_e({virtualizer:null,enabled:!1});import{jsx as Q}from"react/jsx-runtime";function N({className:e,asChild:o,children:t,virtualized:r=!1,itemCount:n=0,estimateSize:a=()=>48,overscan:i=5,...d}){let u=o?Te:"div",p=Ve(null),ee=ze({count:n,getScrollElement:()=>p.current,estimateSize:a,overscan:i,enabled:r});return Q(f.Provider,{value:{virtualizer:ee,enabled:r},children:Q(u,{...d,className:Se(e,"rounded-small scrollbar-thin bg-layer-2-idle border-border-layer-2 shadow-elevation-3 z-1000 max-h-[400px] list-none overflow-x-hidden overflow-y-auto border"),ref:p,children:t})})}import{Slot as fo}from"@radix-ui/react-slot";import{cx as go}from"@xjur-ui/util";import{jsx as yo}from"react/jsx-runtime";import{cx as Co}from"@xjur-ui/util";import{jsx as _o}from"react/jsx-runtime";import{Slot as Re}from"@radix-ui/react-slot";import{cx as U}from"@xjur-ui/util";import{useContext as ke}from"react";import{jsx as I}from"react/jsx-runtime";function E({className:e,asChild:o,children:t,renderItem:r,...n}){let a=o?Re:"ul",{virtualizer:i,enabled:d}=ke(f);if(d&&i&&r){let u=i.getVirtualItems();return I(a,{...n,className:U("p-small relative flex flex-col",e),style:{height:`${i.getTotalSize()}px`},children:u.map(p=>I("div",{className:"absolute top-0 left-0 w-full","data-index":p.index,ref:i.measureElement,style:{transform:`translateY(${p.start}px)`},children:r(p.index)},p.key))})}return I(a,{...n,className:U("gap-small-1x p-small flex flex-col",e),children:t})}import{Slot as De}from"@radix-ui/react-slot";import{cx as Ne,cva as Ie}from"@xjur-ui/util";import{jsx as Le}from"react/jsx-runtime";var Ee=Ie(["py-medium px-small flex items-center gap-small rounded-small-1x","bg-layer-2-idle text-neutral-dark","hover:bg-layer-2-hover transition-colors duration-100 ease-out","active:bg-layer-2-pressed"],{variants:{size:{md:"h-large-4x",lg:"h-large-7x"},isActive:{true:"bg-primary-alt-active text-primary-label-active hover:bg-primary-alt-hover active:bg-primary-alt-pressed"}},defaultVariants:{size:"md",isActive:!1}});function L({className:e,size:o,isActive:t,asChild:r,...n}){return Le(r?De:"li",{...n,className:Ne(Ee({size:o,isActive:t}),e)})}import{jsx as F}from"react/jsx-runtime";var{content:Oe}=s();function M({className:e,sideOffset:o=5,side:t="bottom",align:r="start",children:n,virtualized:a=!1,overscan:i=5,estimateSize:d=()=>32,...u}){let{state:p}=l();return F(h.Portal,{children:F(h.Content,{align:r,className:Oe({className:e,state:p}),side:t,sideOffset:o,...u,children:F(N,{estimateSize:d,overscan:i,virtualized:a,children:n})})})}import{jsx as Zo}from"react/jsx-runtime";var{caption:Uo}=s();import{jsx as ar}from"react/jsx-runtime";var{slotText:or}=s();import{jsx as He}from"react/jsx-runtime";function O(e){return He(E,{...e})}import{twMerge as Ae}from"@xjur-ui/util";import{jsx as $e}from"react/jsx-runtime";function H({className:e,...o}){return $e(L,{className:Ae(e,"cursor-pointer"),...o})}import{twMerge as qe}from"@xjur-ui/util";import{jsx as Be}from"react/jsx-runtime";function A({className:e,...o}){return Be(R,{className:qe(e,"truncate"),...o})}import{jsx as hr}from"react/jsx-runtime";import{jsx as Pr}from"react/jsx-runtime";import{createContext as Ge,use as Ke,useCallback as Wr,useMemo as Jr,useState as Yr}from"react";import{DndContext as Ur,closestCenter as Xr,useSensor as Zr,useSensors as jr,PointerSensor as ea,KeyboardSensor as ta,MouseSensor as oa}from"@dnd-kit/core";import{sortableKeyboardCoordinates as aa}from"@dnd-kit/sortable";import{jsx as ia}from"react/jsx-runtime";var We=Ge({events:[],calendarView:"month",selectedDate:new Date,activeEventId:null,disableEventCreationInPast:!0,renderEvent:()=>null,setSelectedDate:()=>{},handleChangeView:()=>{},onEventMove:()=>{},onAddEvent:()=>{}});function X(){let e=Ke(We);if(!e)throw new Error("useFullCalendar must be used within a CalendarRoot");return e}import{jsx as c,jsxs as j}from"react/jsx-runtime";var Z=[{name:"M\xEAs",value:"month"},{name:"Semana",value:"week"},{name:"Dia",value:"day"}];function da(){let{calendarView:e,handleChangeView:o}=X();return c("div",{className:"w-[94px]",children:j(w,{children:[j(P,{children:[c(D,{name:"calendar-toggle-view",renderValue:t=>Z.find(r=>r.value===t)?.name??"",value:e}),c(_,{className:"text-icon-neutral-3",name:"keyboard_arrow_down"})]}),c(M,{children:c(O,{children:Z.map(t=>c(H,{isActive:e===t.value,value:t.value,onClick:()=>o(t.value),children:c(A,{children:t.name})},t.value))})})]})})}export{da as CalendarToggleView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext as $e,use as Qe,useCallback as $t,useMemo as Qt,useState as qt}from"react";import{DndContext as Gt,closestCenter as Jt,useSensor as Xt,useSensors as Zt,PointerSensor as jt,KeyboardSensor as er,MouseSensor as tr}from"@dnd-kit/core";import{sortableKeyboardCoordinates as or}from"@dnd-kit/sortable";import{jsx as nr}from"react/jsx-runtime";var qe=$e({events:[],calendarView:"month",selectedDate:new Date,activeEventId:null,disableEventCreationInPast:!0,renderEvent:()=>null,setSelectedDate:()=>{},handleChangeView:()=>{},onEventMove:()=>{},onAddEvent:()=>{}});function c(){let e=Qe(qe);if(!e)throw new Error("useFullCalendar must be used within a CalendarRoot");return e}import{useCallback as Ht,useMemo as Ft}from"react";import{cx as Re}from"@xjur-ui/util";import{Slot as Xe}from"@radix-ui/react-slot";import{cva as Ze}from"@xjur-ui/util";import{memo as fe,useState as je}from"react";import*as M from"@radix-ui/react-tooltip";import{jsx as K}from"react/jsx-runtime";function Ue({delayDuration:e=0,...t}){return K(M.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function $({...e}){return K(Ue,{children:K(M.Root,{"data-slot":"tooltip",...e})})}import*as ce from"@radix-ui/react-tooltip";import{jsx as Ge}from"react/jsx-runtime";function Q({...e}){return Ge(ce.Trigger,{"data-slot":"tooltip-trigger",...e})}import*as z from"@radix-ui/react-tooltip";import{cx as Je}from"@xjur-ui/util";import{jsx as ue}from"react/jsx-runtime";function q({className:e,sideOffset:t=1,variant:r="simple",children:o,...a}){return ue(z.Portal,{children:ue(z.Content,{className:Je("text-size-body-sm z-99999 text-balance","data-[variant=simple]:bg-alt-2 data-[variant=simple]:text-neutral-label data-[variant=simple]:rounded-small-1x data-[variant=simple]:px-small data-[variant=simple]:py-small-1x","data-[variant=rich]:bg-layer-2-idle data-[variant=rich]:text-neutral-dark data-[variant=rich]:rounded-small data-[variant=rich]:border-border-layer-2 data-[variant=rich]:p-large data-[variant=rich]:border","animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin)",e),"data-slot":"tooltip-content","data-variant":r,sideOffset:t,...a,children:o})})}import{jsx as S,jsxs as rt}from"react/jsx-runtime";var et=Ze("",{variants:{variant:{body:"",label:"",title:"",headline:""},size:{"sm-2x":"","sm-1x":"",sm:"",md:"",lg:""},weight:{thin:"font-thin",extraLight:"font-extralight",light:"font-light",normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold",extraBold:"font-extrabold",black:"font-black"}},compoundVariants:[{variant:"body",size:"sm-1x",class:"text-size-body-sm-1x"},{variant:"body",size:"sm",class:"text-size-body-sm"},{variant:"body",size:"md",class:"text-size-body-md"},{variant:"body",size:"lg",class:"text-size-body-lg"},{variant:"label",size:"sm-2x",class:"text-size-label-sm-2x"},{variant:"label",size:"sm-1x",class:"text-size-label-sm-1x"},{variant:"label",size:"sm",class:"text-size-label-sm"},{variant:"label",size:"md",class:"text-size-label-md"},{variant:"label",size:"lg",class:"text-size-label-lg"},{variant:"title",size:"sm",class:"text-size-title-sm"},{variant:"title",size:"md",class:"text-size-title-md"},{variant:"title",size:"lg",class:"text-size-title-lg"},{variant:"headline",size:"sm",class:"text-size-headline-sm"},{variant:"headline",size:"md",class:"text-size-headline-md"},{variant:"headline",size:"lg",class:"text-size-headline-lg"}],defaultVariants:{variant:"body",size:"md",weight:"normal"}}),d=fe(({variant:e,size:t,weight:r,asChild:o,className:a,...n})=>S(o?Xe:"span",{className:et({variant:e,size:t,weight:r,className:a}),...n}));d.displayName="Typography";var tt=fe(({children:e,...t})=>{let[r,o]=je(!1);return rt($,{children:[S(Q,{asChild:!0,children:S(d,{onMouseEnter:({currentTarget:n})=>{let i=n.scrollWidth>n.clientWidth;o(i),i?n.style.cursor="pointer":n.style.cursor="text"},...t,children:e})}),r&&S(q,{children:e})]})});tt.displayName="TruncatedTypography";var ot=Math.pow(10,8)*24*60*60*1e3,_r=-ot;var at=3600;var ye=at*24,Pr=ye*7,nt=ye*365.2425,it=nt/12,Ir=it*3,U=Symbol.for("constructDateFrom");function m(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&U in e?e[U](t):e instanceof Date?new e.constructor(t):new Date(t)}function l(e,t){return m(t||e,e)}function ve(e,t,r){let o=l(e,r?.in);if(isNaN(t))return m(r?.in||e,NaN);if(!t)return o;let a=o.getDate(),n=m(r?.in||e,o.getTime());n.setMonth(o.getMonth()+t+1,0);let i=n.getDate();return a>=i?n:(o.setFullYear(n.getFullYear(),n.getMonth(),a),o)}var st={};function E(){return st}function xe(e,t){let r=E(),o=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=l(e,t?.in),n=a.getDay(),i=(n<o?7:0)+n-o;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function N(e,...t){let r=m.bind(null,e||t.find(o=>typeof o=="object"));return t.map(r)}function G(e,t){let r=l(e,t?.in);return r.setHours(0,0,0,0),r}function ge(e){return m(e,Date.now())}function P(e,t,r){let[o,a]=N(r?.in,e,t);return+G(o)==+G(a)}function J(e,t){let r=l(e,t?.in),o=r.getMonth();return r.setFullYear(r.getFullYear(),o+1,0),r.setHours(23,59,59,999),r}function he(e,t){let[r,o]=N(e,t.start,t.end);return{start:r,end:o}}function be(e,t){let{start:r,end:o}=he(t?.in,e),a=+r>+o,n=a?+r:+o,i=a?o:r;i.setHours(0,0,0,0);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,a=!a);let p=[];for(;+i<=n;)p.push(m(r,i)),i.setDate(i.getDate()+s),i.setHours(0,0,0,0);return a?p.reverse():p}function Ce(e,t){let r=l(e,t?.in);return r.setDate(1),r.setHours(0,0,0,0),r}function De(e,t){let r=E(),o=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=l(e,t?.in),n=a.getDay(),i=(n<o?-7:0)+6-(n-o);return a.setDate(a.getDate()+i),a.setHours(23,59,59,999),a}function we(e){return+l(e)<Date.now()}function _e(e,t){return P(m(t?.in||e,e),ge(t?.in||e))}function O(e,t,r){let o=l(e,r?.in);return o.setHours(t),o}function Pe(e,t,r){return ve(e,-t,r)}function X(e){return Array.from({length:e},(t,r)=>r)}var I=["Domingo","Segunda","Ter\xE7a","Quarta","Quinta","Sexta","S\xE1bado"],V=Array.from({length:16},(e,t)=>{let r=t+8;return{hour:r,label:`${r.toString().padStart(2,"0")}:00`}});function Ie(e){let t=e.getFullYear(),r=e.getMonth(),o=Ce(e).getDay(),a=J(Pe(e,1)).getDate(),n=J(e).getDate(),i=X(o).map(y=>{y+=1;let h=r-1,b=a-o+y,_=new Date(t,h,b);return{dayOfWeekNumber:_.getDay(),date:_,type:"month"}}),s=X(n).map(y=>{let h=y+1,v=new Date(t,r,h);return{dayOfWeekNumber:v.getDay(),date:v,type:"month"}}),p=7,u=o+n,w=p-u%p%p,Y=X(w).map(y=>{let h=y+1,v=new Date(t,r+1,h);return{dayOfWeekNumber:v.getDay(),date:v,type:"month"}});return[...i,...s,...Y]}function ke(e,t){return e.filter(r=>P(r.eventDate,t))}function k(e){return _e(e)}function Te(e){let t=xe(e,{weekStartsOn:0}),r=De(e,{weekStartsOn:0}),o=be({start:t,end:r}),a=t.getDay(),n=I[a];return o.map(i=>({date:i,dayOfWeekNumber:a,dayOfWeekName:n,fullDate:i,type:"week"}))}function R(e,t,r){return e.filter(o=>P(o.eventDate,t)&&o.eventDate.getHours()===r)}import{Fragment as Et,useMemo as ie}from"react";import{useDroppable as Nt}from"@dnd-kit/core";import{cx as Ot,tv as Vt}from"@xjur-ui/util";import{Slot as lt}from"@radix-ui/react-slot";import{cva as dt,cx as pt}from"@xjur-ui/util";import{jsx as ct}from"react/jsx-runtime";var mt=dt(["outline-none inline-flex items-center justify-center rounded-circle gap-small cursor-pointer disabled:opacity-38 disabled:pointer-events-none transition-colors"],{variants:{size:{md:"py-small_1x-alt px-medium text-size-body-md",sm:"py-small-1x px-small text-size-label-sm",icon_md:"p-small text-size-body-md h-large-4x w-large-4x",icon_sm:"p-small-1x text-size-label-sm h-large-2x w-large-2x"},variant:{primary:"",secondary:"",tertiary:"",destructive:"",outlined:"bg-layer-2-idle border border-border-layer-2 hover:bg-layer-2-hover active:bg-layer-2-pressed"},appearance:{solid:"",ghost:"bg-transparent"}},compoundVariants:[{variant:"primary",appearance:"solid",class:"bg-primary-idle text-neutral-label hover:bg-primary-hover active:bg-primary-pressed"},{variant:"primary",appearance:"ghost",class:"text-primary-idle hover:bg-primary-alt-idle active:bg-primary-alt-pressed"},{variant:"secondary",appearance:"solid",class:"bg-layer-1-hover text-neutral-dark hover:bg-layer-1-pressed active:bg-layer-1-active"},{variant:"secondary",appearance:"ghost",class:"hover:bg-layer-1-hover active:bg-layer-1-pressed"},{variant:"tertiary",appearance:"solid",class:"bg-layer-2-hover text-neutral-dark hover:bg-layer-2-pressed active:bg-layer-2-active"},{variant:"tertiary",appearance:"ghost",class:"hover:bg-layer-2-hover active:bg-layer-2-pressed"},{variant:"destructive",appearance:"solid",class:"bg-danger-idle text-neutral-label hover:bg-danger-hover active:bg-danger-pressed"},{variant:"destructive",appearance:"ghost",class:"text-danger-label-idle hover:bg-danger-alt-idle active:bg-danger-alt-pressed"}],defaultVariants:{size:"md",variant:"primary",appearance:"solid"}});function H({asChild:e,className:t,variant:r="primary",size:o="md",appearance:a="solid",...n}){return ct(e?lt:"button",{className:pt(mt({variant:r,appearance:a,size:o}),t),...n})}import{cx as ut}from"@xjur-ui/util";import{jsx as ft}from"react/jsx-runtime";function Me({className:e,filled:t=!1,name:r,...o}){return ft("span",{...o,className:ut("material-symbols-outlined","text-size-body-lg select-none",e),style:{fontVariationSettings:`'FILL' ${t?1:0}, 'wght' 600, 'GRAD' 0, 'opsz' 20`,...o.style},children:r})}import{Fragment as St}from"react/jsx-runtime";import"react";import*as ze from"@radix-ui/react-dropdown-menu";import{jsx as yt}from"react/jsx-runtime";function Z({...e}){return yt(ze.Root,{"data-slot":"dropdown-menu",...e})}import*as Se from"@radix-ui/react-dropdown-menu";import{jsx as vt}from"react/jsx-runtime";function j({...e}){return vt(Se.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}import*as F from"@radix-ui/react-dropdown-menu";import{cx as Tt}from"@xjur-ui/util";import{Slot as gt}from"@radix-ui/react-slot";import{cx as ht}from"@xjur-ui/util";import{useVirtualizer as bt}from"@tanstack/react-virtual";import{useRef as Ct}from"react";import{createContext as xt}from"react";var T=xt({virtualizer:null,enabled:!1});import{jsx as Ee}from"react/jsx-runtime";function ee({className:e,asChild:t,children:r,virtualized:o=!1,itemCount:a=0,estimateSize:n=()=>48,overscan:i=5,...s}){let p=t?gt:"div",u=Ct(null),w=bt({count:a,getScrollElement:()=>u.current,estimateSize:n,overscan:i,enabled:o});return Ee(T.Provider,{value:{virtualizer:w,enabled:o},children:Ee(p,{...s,className:ht(e,"rounded-small scrollbar-thin bg-layer-2-idle border-border-layer-2 shadow-elevation-3 z-1000 max-h-[400px] list-none overflow-y-auto border"),ref:u,children:r})})}import{Slot as Ko}from"@radix-ui/react-slot";import{cx as Qo}from"@xjur-ui/util";import{jsx as Uo}from"react/jsx-runtime";import{cx as Xo}from"@xjur-ui/util";import{jsx as ea}from"react/jsx-runtime";import{Slot as Dt}from"@radix-ui/react-slot";import{cx as Ne}from"@xjur-ui/util";import{useContext as wt}from"react";import{jsx as te}from"react/jsx-runtime";function re({className:e,asChild:t,children:r,renderItem:o,...a}){let n=t?Dt:"ul",{virtualizer:i,enabled:s}=wt(T);if(s&&i&&o){let p=i.getVirtualItems();return te(n,{...a,className:Ne("p-small relative flex flex-col",e),style:{height:`${i.getTotalSize()}px`},children:p.map(u=>te("div",{className:"absolute top-0 left-0 w-full","data-index":u.index,ref:i.measureElement,style:{transform:`translateY(${u.start}px)`},children:o(u.index)},u.key))})}return te(n,{...a,className:Ne("gap-small-1x p-small flex flex-col",e),children:r})}import{Slot as da}from"@radix-ui/react-slot";import{cx as ma,cva as _t}from"@xjur-ui/util";import{jsx as fa}from"react/jsx-runtime";var ca=_t(["py-medium px-small flex items-center gap-small rounded-small-1x","bg-layer-2-idle text-neutral-dark","hover:bg-layer-2-hover transition-colors duration-100 ease-out","active:bg-layer-2-pressed"],{variants:{size:{md:"h-large-4x",lg:"h-large-7x"},isActive:{true:"bg-primary-alt-active text-primary-label-active hover:bg-primary-alt-hover active:bg-primary-alt-pressed"}},defaultVariants:{size:"md",isActive:!1}});import{jsx as oe}from"react/jsx-runtime";function ae({className:e,sideOffset:t=4,align:r="start",side:o="bottom",children:a,...n}){return oe(F.Portal,{children:oe(F.Content,{align:r,className:Tt("group z-1000 max-h-[var(--radix-popover-content-available-height)] max-w-[240px] min-w-[var(--radix-popover-trigger-width)]",e),"data-slot":"dropdown-menu-content",side:o,sideOffset:t,...n,children:oe(ee,{children:a})})})}import{jsx as Mt}from"react/jsx-runtime";function ne({...e}){return Mt(re,{...e})}import{jsx as Ea}from"react/jsx-runtime";import{cx as Ya}from"@xjur-ui/util";import"react";import*as zt from"@radix-ui/react-separator";import{cx as Ra}from"@xjur-ui/util";import{jsx as Fa}from"react/jsx-runtime";import{jsx as qa}from"react/jsx-runtime";import{jsx as W,jsxs as Oe}from"react/jsx-runtime";function Ve({events:e}){let{renderEvent:t}=c();return Oe(Z,{children:[W(j,{asChild:!0,children:Oe(H,{size:"sm",variant:"outlined",children:["Mais ",e.length]})}),W(ae,{className:"w-[240px]",children:W(ne,{children:e.map(r=>W(St,{children:t?.(r)},r.eventDate.toISOString()))})})]})}import{jsx as f,jsxs as se}from"react/jsx-runtime";var Rt=Vt({base:"group/calendar-cell p-small flex flex-col gap-small-1x w-full bg-layer-2-idle ",variants:{type:{month:"h-[212px]",week:"min-h-[64px] max-h-[212px]",day:"min-h-[64px] max-h-[212px]"}}});function C({cell:e,events:t}){let{date:r,type:o}=e,{renderEvent:a,activeEventId:n,onAddEvent:i,disableEventCreationInPast:s}=c(),p=ie(()=>t.slice(0,2),[t]),u=t.length>=3,{isOver:w,setNodeRef:Y}=Nt({id:`calendar-cell-${o}-${r.toISOString()}`,data:{date:r,type:o}}),y=ie(()=>{let b=t.find(B=>B.id===n);if(!b)return!1;let _=B=>B.toLocaleDateString("pt-BR",{year:"numeric",month:"2-digit",day:"2-digit"}),Be=_(r),Ke=_(b.eventDate);return Be===Ke},[n,r,t]),h=Rt({type:o}),v=ie(()=>s&&we(r)&&!k(r),[s,r]);return se("div",{className:h,"data-slot":"calendar-cell",ref:Y,children:[o==="month"&&f("div",{className:"flex items-center justify-center",children:f("div",{className:Ot("size-large-2x rounded-circle bg-layer-2-idle flex items-center justify-center",k(r)&&"bg-primary-idle text-neutral-label"),children:f(d,{size:"sm",variant:"label",weight:"medium",children:e.date.getDate()})})}),se("div",{className:"gap-small-1x flex flex-col",children:[p.map(b=>f(Et,{children:a(b)},b.id)),w&&p.length<2&&!y&&f("div",{className:"border-border-layer-4 rounded-small-2x h-[68px] w-full border border-dashed"})]}),se("div",{className:"mt-auto flex items-center justify-between",children:[u&&f(Ve,{events:t.slice(2)}),i&&!v&&f("div",{className:"invisible ml-auto transition-opacity duration-100 ease-in-out group-hover/calendar-cell:visible",children:f(H,{size:"icon_sm",variant:"outlined",onClick:()=>i(r),children:f(Me,{className:"text-icon-neutral-3",name:"add"})})})]})]})}import{jsx as D,jsxs as Wt}from"react/jsx-runtime";function le(){let{selectedDate:e,events:t}=c(),r=Ft(()=>Ie(e),[e]),o=Ht(a=>ke(t,a.date),[t]);return Wt("div",{className:"rounded-small-1x scrollbar-hide border-border-layer-2 h-full w-full border",children:[D("div",{className:"bg-layer-2-hover h-large-4x rounded-t-small-1x sticky top-0 grid grid-cols-7","data-slot":"month-header",children:I.map(a=>D("div",{className:Re("p-small b border-border-layer-2 flex items-center justify-center border-r last:border-r-0"),"data-slot":"month-header-weekday",children:D(d,{size:"sm",variant:"label",weight:"medium",children:a})},a))}),D("div",{className:"grid h-full grid-cols-7 overflow-hidden","data-slot":"month-day-cells",children:r.map((a,n)=>{let i=(n+1)%7===0,s=(n+1)%7===1;return D("div",{className:Re("border-border-layer-2 border-t border-r",i&&"pr-small-2x border-r-0",s&&"pl-small-2x"),children:D(C,{cell:a,events:o(a)})},`${a.date.toISOString()}-${n}`)})})]})}import{useCallback as He,useMemo as At}from"react";import{cx as Fe}from"@xjur-ui/util";import{cx as de}from"@xjur-ui/util";import{jsx as pe,jsxs as Lt}from"react/jsx-runtime";function L({date:e,className:t,...r}){let o=k(e),a=e.getDate();return Lt("div",{className:de("p-small gap-small-1x flex w-full flex-1 flex-col items-center",t),"data-slot":"week-day",...r,children:[pe(d,{size:"sm",variant:"label",weight:"medium",children:I[e.getDay()]}),pe("div",{className:de("size-large-2x rounded-circle flex items-center justify-center",o&&"bg-primary-idle"),children:pe(d,{className:de(o&&"text-neutral-label"),size:"sm-1x",variant:"label",weight:"medium",children:a})})]},e.toISOString())}import{jsx as x,jsxs as We}from"react/jsx-runtime";function Le(){let{selectedDate:e,events:t}=c(),r=At(()=>Te(e),[e]),o=He((n,i)=>R(t,n,i),[t]),a=He((n,i)=>({...n,date:O(n.date,i)}),[]);return x("div",{className:"bg-layer-2-hover rounded-small-1x border-border-layer-2 scrollbar-hide h-full w-full border",children:We("div",{className:"flex flex-1 flex-col",children:[x("div",{className:Fe("bg-layer-2-hover sticky top-0 grid [grid-template-columns:64px_repeat(7,1fr)]","[&>*]:border-border-layer-2","[&>*]:border-l"),"data-slot":"week-header",children:r.map((n,i)=>x(L,{date:n.date,style:{gridColumnStart:i+2}},n.date.getDay()))}),x("div",{className:"overflow-hidden",children:V.map(({hour:n,label:i})=>We("div",{className:"flex items-start",children:[x("div",{className:"px-small flex h-full w-[64px] items-start justify-end",children:x(d,{size:"sm-1x",variant:"label",weight:"medium",children:i})}),x("div",{className:Fe("grid flex-1 grid-cols-7","[&>*]:border-border-layer-2","[&>*]:border-t","[&>*]:border-l"),children:r.map(s=>x(C,{cell:a(s,n),events:o(s.date,n)},s.date.toISOString()))})]},n))})]})})}import{useCallback as Ae}from"react";import{cx as Yt}from"@xjur-ui/util";import{jsx as g,jsxs as me}from"react/jsx-runtime";function Ye(){let{selectedDate:e,events:t}=c(),r=Ae((a,n)=>R(t,a,n),[t]),o=Ae((a,n)=>({...a,date:O(a.date,n)}),[]);return g("div",{className:"bg-layer-2-hover rounded-small-1x border-border-layer-2 scrollbar-hide h-full w-full border",children:me("div",{className:"flex flex-1 flex-col",children:[me("div",{className:"bg-layer-2-hover sticky top-0 z-10 flex w-full","data-slot":"week-header",children:[g("div",{className:"w-[64px]"}),g(L,{className:"border-border-layer-2 items-start border-l",date:e})]}),g("div",{className:"overflow-hidden",children:V.map(({hour:a,label:n})=>me("div",{className:"flex items-start",children:[g("div",{className:"px-small flex h-full w-[64px] items-start justify-end",children:g(d,{size:"sm-1x",variant:"label",weight:"medium",children:n})}),g("div",{className:Yt("flex flex-1","[&>*]:border-border-layer-2","[&>*]:border-t","[&>*]:border-l"),children:g(C,{cell:o({date:e,type:"day"},a),events:r(e,a)})})]},a))})]})})}import{jsx as A}from"react/jsx-runtime";function di(){let{calendarView:e}=c();switch(e){case"month":return A(le,{});case"week":return A(Le,{});case"day":return A(Ye,{});default:return A(le,{})}}export{di as CalendarViewRenderer};
|
|
1
|
+
import{createContext as $e,use as Qe,useCallback as $t,useMemo as Qt,useState as qt}from"react";import{DndContext as Gt,closestCenter as Jt,useSensor as Xt,useSensors as Zt,PointerSensor as jt,KeyboardSensor as er,MouseSensor as tr}from"@dnd-kit/core";import{sortableKeyboardCoordinates as or}from"@dnd-kit/sortable";import{jsx as nr}from"react/jsx-runtime";var qe=$e({events:[],calendarView:"month",selectedDate:new Date,activeEventId:null,disableEventCreationInPast:!0,renderEvent:()=>null,setSelectedDate:()=>{},handleChangeView:()=>{},onEventMove:()=>{},onAddEvent:()=>{}});function c(){let e=Qe(qe);if(!e)throw new Error("useFullCalendar must be used within a CalendarRoot");return e}import{useCallback as Ht,useMemo as Ft}from"react";import{cx as Re}from"@xjur-ui/util";import{Slot as Xe}from"@radix-ui/react-slot";import{cva as Ze}from"@xjur-ui/util";import{memo as fe,useState as je}from"react";import*as M from"@radix-ui/react-tooltip";import{jsx as K}from"react/jsx-runtime";function Ue({delayDuration:e=0,...t}){return K(M.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function $({...e}){return K(Ue,{children:K(M.Root,{"data-slot":"tooltip",...e})})}import*as ce from"@radix-ui/react-tooltip";import{jsx as Ge}from"react/jsx-runtime";function Q({...e}){return Ge(ce.Trigger,{"data-slot":"tooltip-trigger",...e})}import*as z from"@radix-ui/react-tooltip";import{cx as Je}from"@xjur-ui/util";import{jsx as ue}from"react/jsx-runtime";function q({className:e,sideOffset:t=1,variant:r="simple",children:o,...a}){return ue(z.Portal,{children:ue(z.Content,{className:Je("text-size-body-sm z-99999 text-balance","data-[variant=simple]:bg-alt-2 data-[variant=simple]:text-neutral-label data-[variant=simple]:rounded-small-1x data-[variant=simple]:px-small data-[variant=simple]:py-small-1x","data-[variant=rich]:bg-layer-2-idle data-[variant=rich]:text-neutral-dark data-[variant=rich]:rounded-small data-[variant=rich]:border-border-layer-2 data-[variant=rich]:p-large data-[variant=rich]:border","animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin)",e),"data-slot":"tooltip-content","data-variant":r,sideOffset:t,...a,children:o})})}import{jsx as S,jsxs as rt}from"react/jsx-runtime";var et=Ze("",{variants:{variant:{body:"",label:"",title:"",headline:""},size:{"sm-2x":"","sm-1x":"",sm:"",md:"",lg:""},weight:{thin:"font-thin",extraLight:"font-extralight",light:"font-light",normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold",extraBold:"font-extrabold",black:"font-black"}},compoundVariants:[{variant:"body",size:"sm-1x",class:"text-size-body-sm-1x"},{variant:"body",size:"sm",class:"text-size-body-sm"},{variant:"body",size:"md",class:"text-size-body-md"},{variant:"body",size:"lg",class:"text-size-body-lg"},{variant:"label",size:"sm-2x",class:"text-size-label-sm-2x"},{variant:"label",size:"sm-1x",class:"text-size-label-sm-1x"},{variant:"label",size:"sm",class:"text-size-label-sm"},{variant:"label",size:"md",class:"text-size-label-md"},{variant:"label",size:"lg",class:"text-size-label-lg"},{variant:"title",size:"sm",class:"text-size-title-sm"},{variant:"title",size:"md",class:"text-size-title-md"},{variant:"title",size:"lg",class:"text-size-title-lg"},{variant:"headline",size:"sm",class:"text-size-headline-sm"},{variant:"headline",size:"md",class:"text-size-headline-md"},{variant:"headline",size:"lg",class:"text-size-headline-lg"}],defaultVariants:{variant:"body",size:"md",weight:"normal"}}),d=fe(({variant:e,size:t,weight:r,asChild:o,className:a,...n})=>S(o?Xe:"span",{className:et({variant:e,size:t,weight:r,className:a}),...n}));d.displayName="Typography";var tt=fe(({children:e,...t})=>{let[r,o]=je(!1);return rt($,{children:[S(Q,{asChild:!0,children:S(d,{onMouseEnter:({currentTarget:n})=>{let i=n.scrollWidth>n.clientWidth;o(i),i?n.style.cursor="pointer":n.style.cursor="text"},...t,children:e})}),r&&S(q,{children:e})]})});tt.displayName="TruncatedTypography";var ot=Math.pow(10,8)*24*60*60*1e3,_r=-ot;var at=3600;var ye=at*24,Pr=ye*7,nt=ye*365.2425,it=nt/12,Ir=it*3,U=Symbol.for("constructDateFrom");function m(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&U in e?e[U](t):e instanceof Date?new e.constructor(t):new Date(t)}function l(e,t){return m(t||e,e)}function ve(e,t,r){let o=l(e,r?.in);if(isNaN(t))return m(r?.in||e,NaN);if(!t)return o;let a=o.getDate(),n=m(r?.in||e,o.getTime());n.setMonth(o.getMonth()+t+1,0);let i=n.getDate();return a>=i?n:(o.setFullYear(n.getFullYear(),n.getMonth(),a),o)}var st={};function E(){return st}function xe(e,t){let r=E(),o=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=l(e,t?.in),n=a.getDay(),i=(n<o?7:0)+n-o;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function N(e,...t){let r=m.bind(null,e||t.find(o=>typeof o=="object"));return t.map(r)}function G(e,t){let r=l(e,t?.in);return r.setHours(0,0,0,0),r}function ge(e){return m(e,Date.now())}function P(e,t,r){let[o,a]=N(r?.in,e,t);return+G(o)==+G(a)}function J(e,t){let r=l(e,t?.in),o=r.getMonth();return r.setFullYear(r.getFullYear(),o+1,0),r.setHours(23,59,59,999),r}function he(e,t){let[r,o]=N(e,t.start,t.end);return{start:r,end:o}}function be(e,t){let{start:r,end:o}=he(t?.in,e),a=+r>+o,n=a?+r:+o,i=a?o:r;i.setHours(0,0,0,0);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,a=!a);let p=[];for(;+i<=n;)p.push(m(r,i)),i.setDate(i.getDate()+s),i.setHours(0,0,0,0);return a?p.reverse():p}function Ce(e,t){let r=l(e,t?.in);return r.setDate(1),r.setHours(0,0,0,0),r}function De(e,t){let r=E(),o=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=l(e,t?.in),n=a.getDay(),i=(n<o?-7:0)+6-(n-o);return a.setDate(a.getDate()+i),a.setHours(23,59,59,999),a}function we(e){return+l(e)<Date.now()}function _e(e,t){return P(m(t?.in||e,e),ge(t?.in||e))}function O(e,t,r){let o=l(e,r?.in);return o.setHours(t),o}function Pe(e,t,r){return ve(e,-t,r)}function X(e){return Array.from({length:e},(t,r)=>r)}var I=["Domingo","Segunda","Ter\xE7a","Quarta","Quinta","Sexta","S\xE1bado"],V=Array.from({length:16},(e,t)=>{let r=t+8;return{hour:r,label:`${r.toString().padStart(2,"0")}:00`}});function Ie(e){let t=e.getFullYear(),r=e.getMonth(),o=Ce(e).getDay(),a=J(Pe(e,1)).getDate(),n=J(e).getDate(),i=X(o).map(y=>{y+=1;let h=r-1,b=a-o+y,_=new Date(t,h,b);return{dayOfWeekNumber:_.getDay(),date:_,type:"month"}}),s=X(n).map(y=>{let h=y+1,v=new Date(t,r,h);return{dayOfWeekNumber:v.getDay(),date:v,type:"month"}}),p=7,u=o+n,w=p-u%p%p,Y=X(w).map(y=>{let h=y+1,v=new Date(t,r+1,h);return{dayOfWeekNumber:v.getDay(),date:v,type:"month"}});return[...i,...s,...Y]}function ke(e,t){return e.filter(r=>P(r.eventDate,t))}function k(e){return _e(e)}function Te(e){let t=xe(e,{weekStartsOn:0}),r=De(e,{weekStartsOn:0}),o=be({start:t,end:r}),a=t.getDay(),n=I[a];return o.map(i=>({date:i,dayOfWeekNumber:a,dayOfWeekName:n,fullDate:i,type:"week"}))}function R(e,t,r){return e.filter(o=>P(o.eventDate,t)&&o.eventDate.getHours()===r)}import{Fragment as Et,useMemo as ie}from"react";import{useDroppable as Nt}from"@dnd-kit/core";import{cx as Ot,tv as Vt}from"@xjur-ui/util";import{Slot as lt}from"@radix-ui/react-slot";import{cva as dt,cx as pt}from"@xjur-ui/util";import{jsx as ct}from"react/jsx-runtime";var mt=dt(["outline-none inline-flex items-center justify-center rounded-circle gap-small cursor-pointer disabled:opacity-38 disabled:pointer-events-none transition-colors"],{variants:{size:{md:"py-small_1x-alt px-medium text-size-body-md",sm:"py-small-1x px-small text-size-label-sm",icon_md:"p-small text-size-body-md h-large-4x w-large-4x",icon_sm:"p-small-1x text-size-label-sm h-large-2x w-large-2x"},variant:{primary:"",secondary:"",tertiary:"",destructive:"",outlined:"bg-layer-2-idle border border-border-layer-2 hover:bg-layer-2-hover active:bg-layer-2-pressed"},appearance:{solid:"",ghost:"bg-transparent"}},compoundVariants:[{variant:"primary",appearance:"solid",class:"bg-primary-idle text-neutral-label hover:bg-primary-hover active:bg-primary-pressed"},{variant:"primary",appearance:"ghost",class:"text-primary-idle hover:bg-primary-alt-idle active:bg-primary-alt-pressed"},{variant:"secondary",appearance:"solid",class:"bg-layer-1-hover text-neutral-dark hover:bg-layer-1-pressed active:bg-layer-1-active"},{variant:"secondary",appearance:"ghost",class:"hover:bg-layer-1-hover active:bg-layer-1-pressed"},{variant:"tertiary",appearance:"solid",class:"bg-layer-2-hover text-neutral-dark hover:bg-layer-2-pressed active:bg-layer-2-active"},{variant:"tertiary",appearance:"ghost",class:"hover:bg-layer-2-hover active:bg-layer-2-pressed"},{variant:"destructive",appearance:"solid",class:"bg-danger-idle text-neutral-label hover:bg-danger-hover active:bg-danger-pressed"},{variant:"destructive",appearance:"ghost",class:"text-danger-label-idle hover:bg-danger-alt-idle active:bg-danger-alt-pressed"}],defaultVariants:{size:"md",variant:"primary",appearance:"solid"}});function H({asChild:e,className:t,variant:r="primary",size:o="md",appearance:a="solid",...n}){return ct(e?lt:"button",{className:pt(mt({variant:r,appearance:a,size:o}),t),...n})}import{cx as ut}from"@xjur-ui/util";import{jsx as ft}from"react/jsx-runtime";function Me({className:e,filled:t=!1,name:r,...o}){return ft("span",{...o,className:ut("material-symbols-outlined","text-size-body-lg select-none",e),style:{fontVariationSettings:`'FILL' ${t?1:0}, 'wght' 600, 'GRAD' 0, 'opsz' 20`,...o.style},children:r})}import{Fragment as St}from"react/jsx-runtime";import"react";import*as ze from"@radix-ui/react-dropdown-menu";import{jsx as yt}from"react/jsx-runtime";function Z({...e}){return yt(ze.Root,{"data-slot":"dropdown-menu",...e})}import*as Se from"@radix-ui/react-dropdown-menu";import{jsx as vt}from"react/jsx-runtime";function j({...e}){return vt(Se.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}import*as F from"@radix-ui/react-dropdown-menu";import{cx as Tt}from"@xjur-ui/util";import{Slot as gt}from"@radix-ui/react-slot";import{cx as ht}from"@xjur-ui/util";import{useVirtualizer as bt}from"@tanstack/react-virtual";import{useRef as Ct}from"react";import{createContext as xt}from"react";var T=xt({virtualizer:null,enabled:!1});import{jsx as Ee}from"react/jsx-runtime";function ee({className:e,asChild:t,children:r,virtualized:o=!1,itemCount:a=0,estimateSize:n=()=>48,overscan:i=5,...s}){let p=t?gt:"div",u=Ct(null),w=bt({count:a,getScrollElement:()=>u.current,estimateSize:n,overscan:i,enabled:o});return Ee(T.Provider,{value:{virtualizer:w,enabled:o},children:Ee(p,{...s,className:ht(e,"rounded-small scrollbar-thin bg-layer-2-idle border-border-layer-2 shadow-elevation-3 z-1000 max-h-[400px] list-none overflow-x-hidden overflow-y-auto border"),ref:u,children:r})})}import{Slot as Ko}from"@radix-ui/react-slot";import{cx as Qo}from"@xjur-ui/util";import{jsx as Uo}from"react/jsx-runtime";import{cx as Xo}from"@xjur-ui/util";import{jsx as ea}from"react/jsx-runtime";import{Slot as Dt}from"@radix-ui/react-slot";import{cx as Ne}from"@xjur-ui/util";import{useContext as wt}from"react";import{jsx as te}from"react/jsx-runtime";function re({className:e,asChild:t,children:r,renderItem:o,...a}){let n=t?Dt:"ul",{virtualizer:i,enabled:s}=wt(T);if(s&&i&&o){let p=i.getVirtualItems();return te(n,{...a,className:Ne("p-small relative flex flex-col",e),style:{height:`${i.getTotalSize()}px`},children:p.map(u=>te("div",{className:"absolute top-0 left-0 w-full","data-index":u.index,ref:i.measureElement,style:{transform:`translateY(${u.start}px)`},children:o(u.index)},u.key))})}return te(n,{...a,className:Ne("gap-small-1x p-small flex flex-col",e),children:r})}import{Slot as da}from"@radix-ui/react-slot";import{cx as ma,cva as _t}from"@xjur-ui/util";import{jsx as fa}from"react/jsx-runtime";var ca=_t(["py-medium px-small flex items-center gap-small rounded-small-1x","bg-layer-2-idle text-neutral-dark","hover:bg-layer-2-hover transition-colors duration-100 ease-out","active:bg-layer-2-pressed"],{variants:{size:{md:"h-large-4x",lg:"h-large-7x"},isActive:{true:"bg-primary-alt-active text-primary-label-active hover:bg-primary-alt-hover active:bg-primary-alt-pressed"}},defaultVariants:{size:"md",isActive:!1}});import{jsx as oe}from"react/jsx-runtime";function ae({className:e,sideOffset:t=4,align:r="start",side:o="bottom",children:a,...n}){return oe(F.Portal,{children:oe(F.Content,{align:r,className:Tt("group z-1000 max-h-[var(--radix-popover-content-available-height)] max-w-[240px] min-w-[var(--radix-popover-trigger-width)]",e),"data-slot":"dropdown-menu-content",side:o,sideOffset:t,...n,children:oe(ee,{children:a})})})}import{jsx as Mt}from"react/jsx-runtime";function ne({...e}){return Mt(re,{...e})}import{jsx as Ea}from"react/jsx-runtime";import{cx as Ya}from"@xjur-ui/util";import"react";import*as zt from"@radix-ui/react-separator";import{cx as Ra}from"@xjur-ui/util";import{jsx as Fa}from"react/jsx-runtime";import{jsx as qa}from"react/jsx-runtime";import{jsx as W,jsxs as Oe}from"react/jsx-runtime";function Ve({events:e}){let{renderEvent:t}=c();return Oe(Z,{children:[W(j,{asChild:!0,children:Oe(H,{size:"sm",variant:"outlined",children:["Mais ",e.length]})}),W(ae,{className:"w-[240px]",children:W(ne,{children:e.map(r=>W(St,{children:t?.(r)},r.eventDate.toISOString()))})})]})}import{jsx as f,jsxs as se}from"react/jsx-runtime";var Rt=Vt({base:"group/calendar-cell p-small flex flex-col gap-small-1x w-full bg-layer-2-idle ",variants:{type:{month:"h-[212px]",week:"min-h-[64px] max-h-[212px]",day:"min-h-[64px] max-h-[212px]"}}});function C({cell:e,events:t}){let{date:r,type:o}=e,{renderEvent:a,activeEventId:n,onAddEvent:i,disableEventCreationInPast:s}=c(),p=ie(()=>t.slice(0,2),[t]),u=t.length>=3,{isOver:w,setNodeRef:Y}=Nt({id:`calendar-cell-${o}-${r.toISOString()}`,data:{date:r,type:o}}),y=ie(()=>{let b=t.find(B=>B.id===n);if(!b)return!1;let _=B=>B.toLocaleDateString("pt-BR",{year:"numeric",month:"2-digit",day:"2-digit"}),Be=_(r),Ke=_(b.eventDate);return Be===Ke},[n,r,t]),h=Rt({type:o}),v=ie(()=>s&&we(r)&&!k(r),[s,r]);return se("div",{className:h,"data-slot":"calendar-cell",ref:Y,children:[o==="month"&&f("div",{className:"flex items-center justify-center",children:f("div",{className:Ot("size-large-2x rounded-circle bg-layer-2-idle flex items-center justify-center",k(r)&&"bg-primary-idle text-neutral-label"),children:f(d,{size:"sm",variant:"label",weight:"medium",children:e.date.getDate()})})}),se("div",{className:"gap-small-1x flex flex-col",children:[p.map(b=>f(Et,{children:a(b)},b.id)),w&&p.length<2&&!y&&f("div",{className:"border-border-layer-4 rounded-small-2x h-[68px] w-full border border-dashed"})]}),se("div",{className:"mt-auto flex items-center justify-between",children:[u&&f(Ve,{events:t.slice(2)}),i&&!v&&f("div",{className:"invisible ml-auto transition-opacity duration-100 ease-in-out group-hover/calendar-cell:visible",children:f(H,{size:"icon_sm",variant:"outlined",onClick:()=>i(r),children:f(Me,{className:"text-icon-neutral-3",name:"add"})})})]})]})}import{jsx as D,jsxs as Wt}from"react/jsx-runtime";function le(){let{selectedDate:e,events:t}=c(),r=Ft(()=>Ie(e),[e]),o=Ht(a=>ke(t,a.date),[t]);return Wt("div",{className:"rounded-small-1x scrollbar-hide border-border-layer-2 h-full w-full border",children:[D("div",{className:"bg-layer-2-hover h-large-4x rounded-t-small-1x sticky top-0 grid grid-cols-7","data-slot":"month-header",children:I.map(a=>D("div",{className:Re("p-small b border-border-layer-2 flex items-center justify-center border-r last:border-r-0"),"data-slot":"month-header-weekday",children:D(d,{size:"sm",variant:"label",weight:"medium",children:a})},a))}),D("div",{className:"grid h-full grid-cols-7 overflow-hidden","data-slot":"month-day-cells",children:r.map((a,n)=>{let i=(n+1)%7===0,s=(n+1)%7===1;return D("div",{className:Re("border-border-layer-2 border-t border-r",i&&"pr-small-2x border-r-0",s&&"pl-small-2x"),children:D(C,{cell:a,events:o(a)})},`${a.date.toISOString()}-${n}`)})})]})}import{useCallback as He,useMemo as At}from"react";import{cx as Fe}from"@xjur-ui/util";import{cx as de}from"@xjur-ui/util";import{jsx as pe,jsxs as Lt}from"react/jsx-runtime";function L({date:e,className:t,...r}){let o=k(e),a=e.getDate();return Lt("div",{className:de("p-small gap-small-1x flex w-full flex-1 flex-col items-center",t),"data-slot":"week-day",...r,children:[pe(d,{size:"sm",variant:"label",weight:"medium",children:I[e.getDay()]}),pe("div",{className:de("size-large-2x rounded-circle flex items-center justify-center",o&&"bg-primary-idle"),children:pe(d,{className:de(o&&"text-neutral-label"),size:"sm-1x",variant:"label",weight:"medium",children:a})})]},e.toISOString())}import{jsx as x,jsxs as We}from"react/jsx-runtime";function Le(){let{selectedDate:e,events:t}=c(),r=At(()=>Te(e),[e]),o=He((n,i)=>R(t,n,i),[t]),a=He((n,i)=>({...n,date:O(n.date,i)}),[]);return x("div",{className:"bg-layer-2-hover rounded-small-1x border-border-layer-2 scrollbar-hide h-full w-full border",children:We("div",{className:"flex flex-1 flex-col",children:[x("div",{className:Fe("bg-layer-2-hover sticky top-0 grid [grid-template-columns:64px_repeat(7,1fr)]","[&>*]:border-border-layer-2","[&>*]:border-l"),"data-slot":"week-header",children:r.map((n,i)=>x(L,{date:n.date,style:{gridColumnStart:i+2}},n.date.getDay()))}),x("div",{className:"overflow-hidden",children:V.map(({hour:n,label:i})=>We("div",{className:"flex items-start",children:[x("div",{className:"px-small flex h-full w-[64px] items-start justify-end",children:x(d,{size:"sm-1x",variant:"label",weight:"medium",children:i})}),x("div",{className:Fe("grid flex-1 grid-cols-7","[&>*]:border-border-layer-2","[&>*]:border-t","[&>*]:border-l"),children:r.map(s=>x(C,{cell:a(s,n),events:o(s.date,n)},s.date.toISOString()))})]},n))})]})})}import{useCallback as Ae}from"react";import{cx as Yt}from"@xjur-ui/util";import{jsx as g,jsxs as me}from"react/jsx-runtime";function Ye(){let{selectedDate:e,events:t}=c(),r=Ae((a,n)=>R(t,a,n),[t]),o=Ae((a,n)=>({...a,date:O(a.date,n)}),[]);return g("div",{className:"bg-layer-2-hover rounded-small-1x border-border-layer-2 scrollbar-hide h-full w-full border",children:me("div",{className:"flex flex-1 flex-col",children:[me("div",{className:"bg-layer-2-hover sticky top-0 z-10 flex w-full","data-slot":"week-header",children:[g("div",{className:"w-[64px]"}),g(L,{className:"border-border-layer-2 items-start border-l",date:e})]}),g("div",{className:"overflow-hidden",children:V.map(({hour:a,label:n})=>me("div",{className:"flex items-start",children:[g("div",{className:"px-small flex h-full w-[64px] items-start justify-end",children:g(d,{size:"sm-1x",variant:"label",weight:"medium",children:n})}),g("div",{className:Yt("flex flex-1","[&>*]:border-border-layer-2","[&>*]:border-t","[&>*]:border-l"),children:g(C,{cell:o({date:e,type:"day"},a),events:r(e,a)})})]},a))})]})})}import{jsx as A}from"react/jsx-runtime";function di(){let{calendarView:e}=c();switch(e){case"month":return A(le,{});case"week":return A(Le,{});case"day":return A(Ye,{});default:return A(le,{})}}export{di as CalendarViewRenderer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as be,useMemo as Dt}from"react";import{cx as Ce}from"@xjur-ui/util";var ze=Math.pow(10,8)*24*60*60*1e3,wt=-ze;var Me=3600;var J=Me*24,_t=J*7,Se=J*365.2425,Ee=Se/12,Pt=Ee*3,M=Symbol.for("constructDateFrom");function d(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&M in e?e[M](t):e instanceof Date?new e.constructor(t):new Date(t)}function m(e,t){return d(t||e,e)}var Re={};function h(){return Re}function X(e,t){let o=h(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0,a=m(e,t?.in),n=a.getDay(),i=(n<r?7:0)+n-r;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function b(e,...t){let o=d.bind(null,e||t.find(r=>typeof r=="object"));return t.map(o)}function S(e,t){let o=m(e,t?.in);return o.setHours(0,0,0,0),o}function Z(e){return d(e,Date.now())}function C(e,t,o){let[r,a]=b(o?.in,e,t);return+S(r)==+S(a)}function j(e,t){let[o,r]=b(e,t.start,t.end);return{start:o,end:r}}function ee(e,t){let{start:o,end:r}=j(t?.in,e),a=+o>+r,n=a?+o:+r,i=a?r:o;i.setHours(0,0,0,0);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,a=!a);let p=[];for(;+i<=n;)p.push(d(o,i)),i.setDate(i.getDate()+s),i.setHours(0,0,0,0);return a?p.reverse():p}function te(e,t){let o=h(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0,a=m(e,t?.in),n=a.getDay(),i=(n<r?-7:0)+6-(n-r);return a.setDate(a.getDate()+i),a.setHours(23,59,59,999),a}function oe(e){return+m(e)<Date.now()}function re(e,t){return C(d(t?.in||e,e),Z(t?.in||e))}function ae(e,t,o){let r=m(e,o?.in);return r.setHours(t),r}import{Slot as He}from"@radix-ui/react-slot";import{cva as Le}from"@xjur-ui/util";import{memo as se,useState as We}from"react";import*as D from"@radix-ui/react-tooltip";import{jsx as E}from"react/jsx-runtime";function Ne({delayDuration:e=0,...t}){return E(D.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function R({...e}){return E(Ne,{children:E(D.Root,{"data-slot":"tooltip",...e})})}import*as ne from"@radix-ui/react-tooltip";import{jsx as Oe}from"react/jsx-runtime";function N({...e}){return Oe(ne.Trigger,{"data-slot":"tooltip-trigger",...e})}import*as w from"@radix-ui/react-tooltip";import{cx as Ve}from"@xjur-ui/util";import{jsx as ie}from"react/jsx-runtime";function O({className:e,sideOffset:t=1,variant:o="simple",children:r,...a}){return ie(w.Portal,{children:ie(w.Content,{className:Ve("text-size-body-sm z-99999 text-balance","data-[variant=simple]:bg-alt-2 data-[variant=simple]:text-neutral-label data-[variant=simple]:rounded-small-1x data-[variant=simple]:px-small data-[variant=simple]:py-small-1x","data-[variant=rich]:bg-layer-2-idle data-[variant=rich]:text-neutral-dark data-[variant=rich]:rounded-small data-[variant=rich]:border-border-layer-2 data-[variant=rich]:p-large data-[variant=rich]:border","animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin)",e),"data-slot":"tooltip-content","data-variant":o,sideOffset:t,...a,children:r})})}import{jsx as _,jsxs as Be}from"react/jsx-runtime";var Fe=Le("",{variants:{variant:{body:"",label:"",title:"",headline:""},size:{"sm-2x":"","sm-1x":"",sm:"",md:"",lg:""},weight:{thin:"font-thin",extraLight:"font-extralight",light:"font-light",normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold",extraBold:"font-extrabold",black:"font-black"}},compoundVariants:[{variant:"body",size:"sm-1x",class:"text-size-body-sm-1x"},{variant:"body",size:"sm",class:"text-size-body-sm"},{variant:"body",size:"md",class:"text-size-body-md"},{variant:"body",size:"lg",class:"text-size-body-lg"},{variant:"label",size:"sm-2x",class:"text-size-label-sm-2x"},{variant:"label",size:"sm-1x",class:"text-size-label-sm-1x"},{variant:"label",size:"sm",class:"text-size-label-sm"},{variant:"label",size:"md",class:"text-size-label-md"},{variant:"label",size:"lg",class:"text-size-label-lg"},{variant:"title",size:"sm",class:"text-size-title-sm"},{variant:"title",size:"md",class:"text-size-title-md"},{variant:"title",size:"lg",class:"text-size-title-lg"},{variant:"headline",size:"sm",class:"text-size-headline-sm"},{variant:"headline",size:"md",class:"text-size-headline-md"},{variant:"headline",size:"lg",class:"text-size-headline-lg"}],defaultVariants:{variant:"body",size:"md",weight:"normal"}}),l=se(({variant:e,size:t,weight:o,asChild:r,className:a,...n})=>_(r?He:"span",{className:Fe({variant:e,size:t,weight:o,className:a}),...n}));l.displayName="Typography";var Ae=se(({children:e,...t})=>{let[o,r]=We(!1);return Be(R,{children:[_(N,{asChild:!0,children:_(l,{onMouseEnter:({currentTarget:n})=>{let i=n.scrollWidth>n.clientWidth;r(i),i?n.style.cursor="pointer":n.style.cursor="text"},...t,children:e})}),o&&_(O,{children:e})]})});Ae.displayName="TruncatedTypography";var V=["Domingo","Segunda","Ter\xE7a","Quarta","Quinta","Sexta","S\xE1bado"],le=Array.from({length:16},(e,t)=>{let o=t+8;return{hour:o,label:`${o.toString().padStart(2,"0")}:00`}});function x(e){return re(e)}function pe(e){let t=X(e,{weekStartsOn:0}),o=te(e,{weekStartsOn:0}),r=ee({start:t,end:o}),a=t.getDay(),n=V[a];return r.map(i=>({date:i,dayOfWeekNumber:a,dayOfWeekName:n,fullDate:i,type:"week"}))}function de(e,t,o){return e.filter(r=>C(r.eventDate,t)&&r.eventDate.getHours()===o)}import{createContext as Ye,use as Ke,useCallback as So,useMemo as Eo,useState as Ro}from"react";import{DndContext as Oo,closestCenter as Vo,useSensor as Ho,useSensors as Lo,PointerSensor as Wo,KeyboardSensor as Fo,MouseSensor as Ao}from"@dnd-kit/core";import{sortableKeyboardCoordinates as Yo}from"@dnd-kit/sortable";import{jsx as $o}from"react/jsx-runtime";var $e=Ye({events:[],calendarView:"month",selectedDate:new Date,activeEventId:null,disableEventCreationInPast:!0,renderEvent:()=>null,setSelectedDate:()=>{},handleChangeView:()=>{},onEventMove:()=>{},onAddEvent:()=>{}});function y(){let e=Ke($e);if(!e)throw new Error("useFullCalendar must be used within a CalendarRoot");return e}import{cx as H}from"@xjur-ui/util";import{jsx as L,jsxs as Qe}from"react/jsx-runtime";function me({date:e,className:t,...o}){let r=x(e),a=e.getDate();return Qe("div",{className:H("p-small gap-small-1x flex w-full flex-1 flex-col items-center",t),"data-slot":"week-day",...o,children:[L(l,{size:"sm",variant:"label",weight:"medium",children:V[e.getDay()]}),L("div",{className:H("size-large-2x rounded-circle flex items-center justify-center",r&&"bg-primary-idle"),children:L(l,{className:H(r&&"text-neutral-label"),size:"sm-1x",variant:"label",weight:"medium",children:a})})]},e.toISOString())}import{Fragment as xt,useMemo as q}from"react";import{useDroppable as gt}from"@dnd-kit/core";import{cx as ht,tv as bt}from"@xjur-ui/util";import{Slot as qe}from"@radix-ui/react-slot";import{cva as Ge,cx as Ue}from"@xjur-ui/util";import{jsx as Xe}from"react/jsx-runtime";var Je=Ge(["outline-none inline-flex items-center justify-center rounded-circle gap-small cursor-pointer disabled:opacity-38 disabled:pointer-events-none transition-colors"],{variants:{size:{md:"py-small_1x-alt px-medium text-size-body-md",sm:"py-small-1x px-small text-size-label-sm",icon_md:"p-small text-size-body-md h-large-4x w-large-4x",icon_sm:"p-small-1x text-size-label-sm h-large-2x w-large-2x"},variant:{primary:"",secondary:"",tertiary:"",destructive:"",outlined:"bg-layer-2-idle border border-border-layer-2 hover:bg-layer-2-hover active:bg-layer-2-pressed"},appearance:{solid:"",ghost:"bg-transparent"}},compoundVariants:[{variant:"primary",appearance:"solid",class:"bg-primary-idle text-neutral-label hover:bg-primary-hover active:bg-primary-pressed"},{variant:"primary",appearance:"ghost",class:"text-primary-idle hover:bg-primary-alt-idle active:bg-primary-alt-pressed"},{variant:"secondary",appearance:"solid",class:"bg-layer-1-hover text-neutral-dark hover:bg-layer-1-pressed active:bg-layer-1-active"},{variant:"secondary",appearance:"ghost",class:"hover:bg-layer-1-hover active:bg-layer-1-pressed"},{variant:"tertiary",appearance:"solid",class:"bg-layer-2-hover text-neutral-dark hover:bg-layer-2-pressed active:bg-layer-2-active"},{variant:"tertiary",appearance:"ghost",class:"hover:bg-layer-2-hover active:bg-layer-2-pressed"},{variant:"destructive",appearance:"solid",class:"bg-danger-idle text-neutral-label hover:bg-danger-hover active:bg-danger-pressed"},{variant:"destructive",appearance:"ghost",class:"text-danger-label-idle hover:bg-danger-alt-idle active:bg-danger-alt-pressed"}],defaultVariants:{size:"md",variant:"primary",appearance:"solid"}});function P({asChild:e,className:t,variant:o="primary",size:r="md",appearance:a="solid",...n}){return Xe(e?qe:"button",{className:Ue(Je({variant:o,appearance:a,size:r}),t),...n})}import{cx as Ze}from"@xjur-ui/util";import{jsx as je}from"react/jsx-runtime";function ce({className:e,filled:t=!1,name:o,...r}){return je("span",{...r,className:Ze("material-symbols-outlined","text-size-body-lg select-none",e),style:{fontVariationSettings:`'FILL' ${t?1:0}, 'wght' 600, 'GRAD' 0, 'opsz' 20`,...r.style},children:o})}import{Fragment as vt}from"react/jsx-runtime";import"react";import*as ue from"@radix-ui/react-dropdown-menu";import{jsx as et}from"react/jsx-runtime";function W({...e}){return et(ue.Root,{"data-slot":"dropdown-menu",...e})}import*as fe from"@radix-ui/react-dropdown-menu";import{jsx as tt}from"react/jsx-runtime";function F({...e}){return tt(fe.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}import*as I from"@radix-ui/react-dropdown-menu";import{cx as ut}from"@xjur-ui/util";import{Slot as rt}from"@radix-ui/react-slot";import{cx as at}from"@xjur-ui/util";import{useVirtualizer as nt}from"@tanstack/react-virtual";import{useRef as it}from"react";import{createContext as ot}from"react";var g=ot({virtualizer:null,enabled:!1});import{jsx as ye}from"react/jsx-runtime";function A({className:e,asChild:t,children:o,virtualized:r=!1,itemCount:a=0,estimateSize:n=()=>48,overscan:i=5,...s}){let p=t?rt:"div",c=it(null),k=nt({count:a,getScrollElement:()=>c.current,estimateSize:n,overscan:i,enabled:r});return ye(g.Provider,{value:{virtualizer:k,enabled:r},children:ye(p,{...s,className:at(e,"rounded-small scrollbar-thin bg-layer-2-idle border-border-layer-2 shadow-elevation-3 z-1000 max-h-[400px] list-none overflow-y-auto border"),ref:c,children:o})})}import{Slot as wr}from"@radix-ui/react-slot";import{cx as Pr}from"@xjur-ui/util";import{jsx as Tr}from"react/jsx-runtime";import{cx as Mr}from"@xjur-ui/util";import{jsx as Rr}from"react/jsx-runtime";import{Slot as st}from"@radix-ui/react-slot";import{cx as ve}from"@xjur-ui/util";import{useContext as lt}from"react";import{jsx as B}from"react/jsx-runtime";function Y({className:e,asChild:t,children:o,renderItem:r,...a}){let n=t?st:"ul",{virtualizer:i,enabled:s}=lt(g);if(s&&i&&r){let p=i.getVirtualItems();return B(n,{...a,className:ve("p-small relative flex flex-col",e),style:{height:`${i.getTotalSize()}px`},children:p.map(c=>B("div",{className:"absolute top-0 left-0 w-full","data-index":c.index,ref:i.measureElement,style:{transform:`translateY(${c.start}px)`},children:r(c.index)},c.key))})}return B(n,{...a,className:ve("gap-small-1x p-small flex flex-col",e),children:o})}import{Slot as Br}from"@radix-ui/react-slot";import{cx as Kr,cva as pt}from"@xjur-ui/util";import{jsx as qr}from"react/jsx-runtime";var $r=pt(["py-medium px-small flex items-center gap-small rounded-small-1x","bg-layer-2-idle text-neutral-dark","hover:bg-layer-2-hover transition-colors duration-100 ease-out","active:bg-layer-2-pressed"],{variants:{size:{md:"h-large-4x",lg:"h-large-7x"},isActive:{true:"bg-primary-alt-active text-primary-label-active hover:bg-primary-alt-hover active:bg-primary-alt-pressed"}},defaultVariants:{size:"md",isActive:!1}});import{jsx as K}from"react/jsx-runtime";function $({className:e,sideOffset:t=4,align:o="start",side:r="bottom",children:a,...n}){return K(I.Portal,{children:K(I.Content,{align:o,className:ut("group z-1000 max-h-[var(--radix-popover-content-available-height)] max-w-[240px] min-w-[var(--radix-popover-trigger-width)]",e),"data-slot":"dropdown-menu-content",side:r,sideOffset:t,...n,children:K(A,{children:a})})})}import{jsx as ft}from"react/jsx-runtime";function Q({...e}){return ft(Y,{...e})}import{jsx as ma}from"react/jsx-runtime";import{cx as Ca}from"@xjur-ui/util";import"react";import*as yt from"@radix-ui/react-separator";import{cx as ya}from"@xjur-ui/util";import{jsx as xa}from"react/jsx-runtime";import{jsx as Ia}from"react/jsx-runtime";import{jsx as T,jsxs as xe}from"react/jsx-runtime";function ge({events:e}){let{renderEvent:t}=y();return xe(W,{children:[T(F,{asChild:!0,children:xe(P,{size:"sm",variant:"outlined",children:["Mais ",e.length]})}),T($,{className:"w-[240px]",children:T(Q,{children:e.map(o=>T(vt,{children:t?.(o)},o.eventDate.toISOString()))})})]})}import{jsx as u,jsxs as G}from"react/jsx-runtime";var Ct=bt({base:"group/calendar-cell p-small flex flex-col gap-small-1x w-full bg-layer-2-idle ",variants:{type:{month:"h-[212px]",week:"min-h-[64px] max-h-[212px]",day:"min-h-[64px] max-h-[212px]"}}});function he({cell:e,events:t}){let{date:o,type:r}=e,{renderEvent:a,activeEventId:n,onAddEvent:i,disableEventCreationInPast:s}=y(),p=q(()=>t.slice(0,2),[t]),c=t.length>=3,{isOver:k,setNodeRef:we}=gt({id:`calendar-cell-${r}-${o.toISOString()}`,data:{date:o,type:r}}),_e=q(()=>{let v=t.find(z=>z.id===n);if(!v)return!1;let U=z=>z.toLocaleDateString("pt-BR",{year:"numeric",month:"2-digit",day:"2-digit"}),Te=U(o),ke=U(v.eventDate);return Te===ke},[n,o,t]),Pe=Ct({type:r}),Ie=q(()=>s&&oe(o)&&!x(o),[s,o]);return G("div",{className:Pe,"data-slot":"calendar-cell",ref:we,children:[r==="month"&&u("div",{className:"flex items-center justify-center",children:u("div",{className:ht("size-large-2x rounded-circle bg-layer-2-idle flex items-center justify-center",x(o)&&"bg-primary-idle text-neutral-label"),children:u(l,{size:"sm",variant:"label",weight:"medium",children:e.date.getDate()})})}),G("div",{className:"gap-small-1x flex flex-col",children:[p.map(v=>u(xt,{children:a(v)},v.id)),k&&p.length<2&&!_e&&u("div",{className:"border-border-layer-4 rounded-small-2x h-[68px] w-full border border-dashed"})]}),G("div",{className:"mt-auto flex items-center justify-between",children:[c&&u(ge,{events:t.slice(2)}),i&&!Ie&&u("div",{className:"invisible ml-auto transition-opacity duration-100 ease-in-out group-hover/calendar-cell:visible",children:u(P,{size:"icon_sm",variant:"outlined",onClick:()=>i(o),children:u(ce,{className:"text-icon-neutral-3",name:"add"})})})]})]})}import{jsx as f,jsxs as De}from"react/jsx-runtime";function un(){let{selectedDate:e,events:t}=y(),o=Dt(()=>pe(e),[e]),r=be((n,i)=>de(t,n,i),[t]),a=be((n,i)=>({...n,date:ae(n.date,i)}),[]);return f("div",{className:"bg-layer-2-hover rounded-small-1x border-border-layer-2 scrollbar-hide h-full w-full border",children:De("div",{className:"flex flex-1 flex-col",children:[f("div",{className:Ce("bg-layer-2-hover sticky top-0 grid [grid-template-columns:64px_repeat(7,1fr)]","[&>*]:border-border-layer-2","[&>*]:border-l"),"data-slot":"week-header",children:o.map((n,i)=>f(me,{date:n.date,style:{gridColumnStart:i+2}},n.date.getDay()))}),f("div",{className:"overflow-hidden",children:le.map(({hour:n,label:i})=>De("div",{className:"flex items-start",children:[f("div",{className:"px-small flex h-full w-[64px] items-start justify-end",children:f(l,{size:"sm-1x",variant:"label",weight:"medium",children:i})}),f("div",{className:Ce("grid flex-1 grid-cols-7","[&>*]:border-border-layer-2","[&>*]:border-t","[&>*]:border-l"),children:o.map(s=>f(he,{cell:a(s,n),events:r(s.date,n)},s.date.toISOString()))})]},n))})]})})}export{un as CalendarWeekView};
|
|
1
|
+
import{useCallback as be,useMemo as Dt}from"react";import{cx as Ce}from"@xjur-ui/util";var ze=Math.pow(10,8)*24*60*60*1e3,wt=-ze;var Me=3600;var J=Me*24,_t=J*7,Se=J*365.2425,Ee=Se/12,Pt=Ee*3,M=Symbol.for("constructDateFrom");function d(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&M in e?e[M](t):e instanceof Date?new e.constructor(t):new Date(t)}function m(e,t){return d(t||e,e)}var Re={};function h(){return Re}function X(e,t){let o=h(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0,a=m(e,t?.in),n=a.getDay(),i=(n<r?7:0)+n-r;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function b(e,...t){let o=d.bind(null,e||t.find(r=>typeof r=="object"));return t.map(o)}function S(e,t){let o=m(e,t?.in);return o.setHours(0,0,0,0),o}function Z(e){return d(e,Date.now())}function C(e,t,o){let[r,a]=b(o?.in,e,t);return+S(r)==+S(a)}function j(e,t){let[o,r]=b(e,t.start,t.end);return{start:o,end:r}}function ee(e,t){let{start:o,end:r}=j(t?.in,e),a=+o>+r,n=a?+o:+r,i=a?r:o;i.setHours(0,0,0,0);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,a=!a);let p=[];for(;+i<=n;)p.push(d(o,i)),i.setDate(i.getDate()+s),i.setHours(0,0,0,0);return a?p.reverse():p}function te(e,t){let o=h(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0,a=m(e,t?.in),n=a.getDay(),i=(n<r?-7:0)+6-(n-r);return a.setDate(a.getDate()+i),a.setHours(23,59,59,999),a}function oe(e){return+m(e)<Date.now()}function re(e,t){return C(d(t?.in||e,e),Z(t?.in||e))}function ae(e,t,o){let r=m(e,o?.in);return r.setHours(t),r}import{Slot as He}from"@radix-ui/react-slot";import{cva as Le}from"@xjur-ui/util";import{memo as se,useState as We}from"react";import*as D from"@radix-ui/react-tooltip";import{jsx as E}from"react/jsx-runtime";function Ne({delayDuration:e=0,...t}){return E(D.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function R({...e}){return E(Ne,{children:E(D.Root,{"data-slot":"tooltip",...e})})}import*as ne from"@radix-ui/react-tooltip";import{jsx as Oe}from"react/jsx-runtime";function N({...e}){return Oe(ne.Trigger,{"data-slot":"tooltip-trigger",...e})}import*as w from"@radix-ui/react-tooltip";import{cx as Ve}from"@xjur-ui/util";import{jsx as ie}from"react/jsx-runtime";function O({className:e,sideOffset:t=1,variant:o="simple",children:r,...a}){return ie(w.Portal,{children:ie(w.Content,{className:Ve("text-size-body-sm z-99999 text-balance","data-[variant=simple]:bg-alt-2 data-[variant=simple]:text-neutral-label data-[variant=simple]:rounded-small-1x data-[variant=simple]:px-small data-[variant=simple]:py-small-1x","data-[variant=rich]:bg-layer-2-idle data-[variant=rich]:text-neutral-dark data-[variant=rich]:rounded-small data-[variant=rich]:border-border-layer-2 data-[variant=rich]:p-large data-[variant=rich]:border","animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin)",e),"data-slot":"tooltip-content","data-variant":o,sideOffset:t,...a,children:r})})}import{jsx as _,jsxs as Be}from"react/jsx-runtime";var Fe=Le("",{variants:{variant:{body:"",label:"",title:"",headline:""},size:{"sm-2x":"","sm-1x":"",sm:"",md:"",lg:""},weight:{thin:"font-thin",extraLight:"font-extralight",light:"font-light",normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold",extraBold:"font-extrabold",black:"font-black"}},compoundVariants:[{variant:"body",size:"sm-1x",class:"text-size-body-sm-1x"},{variant:"body",size:"sm",class:"text-size-body-sm"},{variant:"body",size:"md",class:"text-size-body-md"},{variant:"body",size:"lg",class:"text-size-body-lg"},{variant:"label",size:"sm-2x",class:"text-size-label-sm-2x"},{variant:"label",size:"sm-1x",class:"text-size-label-sm-1x"},{variant:"label",size:"sm",class:"text-size-label-sm"},{variant:"label",size:"md",class:"text-size-label-md"},{variant:"label",size:"lg",class:"text-size-label-lg"},{variant:"title",size:"sm",class:"text-size-title-sm"},{variant:"title",size:"md",class:"text-size-title-md"},{variant:"title",size:"lg",class:"text-size-title-lg"},{variant:"headline",size:"sm",class:"text-size-headline-sm"},{variant:"headline",size:"md",class:"text-size-headline-md"},{variant:"headline",size:"lg",class:"text-size-headline-lg"}],defaultVariants:{variant:"body",size:"md",weight:"normal"}}),l=se(({variant:e,size:t,weight:o,asChild:r,className:a,...n})=>_(r?He:"span",{className:Fe({variant:e,size:t,weight:o,className:a}),...n}));l.displayName="Typography";var Ae=se(({children:e,...t})=>{let[o,r]=We(!1);return Be(R,{children:[_(N,{asChild:!0,children:_(l,{onMouseEnter:({currentTarget:n})=>{let i=n.scrollWidth>n.clientWidth;r(i),i?n.style.cursor="pointer":n.style.cursor="text"},...t,children:e})}),o&&_(O,{children:e})]})});Ae.displayName="TruncatedTypography";var V=["Domingo","Segunda","Ter\xE7a","Quarta","Quinta","Sexta","S\xE1bado"],le=Array.from({length:16},(e,t)=>{let o=t+8;return{hour:o,label:`${o.toString().padStart(2,"0")}:00`}});function x(e){return re(e)}function pe(e){let t=X(e,{weekStartsOn:0}),o=te(e,{weekStartsOn:0}),r=ee({start:t,end:o}),a=t.getDay(),n=V[a];return r.map(i=>({date:i,dayOfWeekNumber:a,dayOfWeekName:n,fullDate:i,type:"week"}))}function de(e,t,o){return e.filter(r=>C(r.eventDate,t)&&r.eventDate.getHours()===o)}import{createContext as Ye,use as Ke,useCallback as So,useMemo as Eo,useState as Ro}from"react";import{DndContext as Oo,closestCenter as Vo,useSensor as Ho,useSensors as Lo,PointerSensor as Wo,KeyboardSensor as Fo,MouseSensor as Ao}from"@dnd-kit/core";import{sortableKeyboardCoordinates as Yo}from"@dnd-kit/sortable";import{jsx as $o}from"react/jsx-runtime";var $e=Ye({events:[],calendarView:"month",selectedDate:new Date,activeEventId:null,disableEventCreationInPast:!0,renderEvent:()=>null,setSelectedDate:()=>{},handleChangeView:()=>{},onEventMove:()=>{},onAddEvent:()=>{}});function y(){let e=Ke($e);if(!e)throw new Error("useFullCalendar must be used within a CalendarRoot");return e}import{cx as H}from"@xjur-ui/util";import{jsx as L,jsxs as Qe}from"react/jsx-runtime";function me({date:e,className:t,...o}){let r=x(e),a=e.getDate();return Qe("div",{className:H("p-small gap-small-1x flex w-full flex-1 flex-col items-center",t),"data-slot":"week-day",...o,children:[L(l,{size:"sm",variant:"label",weight:"medium",children:V[e.getDay()]}),L("div",{className:H("size-large-2x rounded-circle flex items-center justify-center",r&&"bg-primary-idle"),children:L(l,{className:H(r&&"text-neutral-label"),size:"sm-1x",variant:"label",weight:"medium",children:a})})]},e.toISOString())}import{Fragment as xt,useMemo as q}from"react";import{useDroppable as gt}from"@dnd-kit/core";import{cx as ht,tv as bt}from"@xjur-ui/util";import{Slot as qe}from"@radix-ui/react-slot";import{cva as Ge,cx as Ue}from"@xjur-ui/util";import{jsx as Xe}from"react/jsx-runtime";var Je=Ge(["outline-none inline-flex items-center justify-center rounded-circle gap-small cursor-pointer disabled:opacity-38 disabled:pointer-events-none transition-colors"],{variants:{size:{md:"py-small_1x-alt px-medium text-size-body-md",sm:"py-small-1x px-small text-size-label-sm",icon_md:"p-small text-size-body-md h-large-4x w-large-4x",icon_sm:"p-small-1x text-size-label-sm h-large-2x w-large-2x"},variant:{primary:"",secondary:"",tertiary:"",destructive:"",outlined:"bg-layer-2-idle border border-border-layer-2 hover:bg-layer-2-hover active:bg-layer-2-pressed"},appearance:{solid:"",ghost:"bg-transparent"}},compoundVariants:[{variant:"primary",appearance:"solid",class:"bg-primary-idle text-neutral-label hover:bg-primary-hover active:bg-primary-pressed"},{variant:"primary",appearance:"ghost",class:"text-primary-idle hover:bg-primary-alt-idle active:bg-primary-alt-pressed"},{variant:"secondary",appearance:"solid",class:"bg-layer-1-hover text-neutral-dark hover:bg-layer-1-pressed active:bg-layer-1-active"},{variant:"secondary",appearance:"ghost",class:"hover:bg-layer-1-hover active:bg-layer-1-pressed"},{variant:"tertiary",appearance:"solid",class:"bg-layer-2-hover text-neutral-dark hover:bg-layer-2-pressed active:bg-layer-2-active"},{variant:"tertiary",appearance:"ghost",class:"hover:bg-layer-2-hover active:bg-layer-2-pressed"},{variant:"destructive",appearance:"solid",class:"bg-danger-idle text-neutral-label hover:bg-danger-hover active:bg-danger-pressed"},{variant:"destructive",appearance:"ghost",class:"text-danger-label-idle hover:bg-danger-alt-idle active:bg-danger-alt-pressed"}],defaultVariants:{size:"md",variant:"primary",appearance:"solid"}});function P({asChild:e,className:t,variant:o="primary",size:r="md",appearance:a="solid",...n}){return Xe(e?qe:"button",{className:Ue(Je({variant:o,appearance:a,size:r}),t),...n})}import{cx as Ze}from"@xjur-ui/util";import{jsx as je}from"react/jsx-runtime";function ce({className:e,filled:t=!1,name:o,...r}){return je("span",{...r,className:Ze("material-symbols-outlined","text-size-body-lg select-none",e),style:{fontVariationSettings:`'FILL' ${t?1:0}, 'wght' 600, 'GRAD' 0, 'opsz' 20`,...r.style},children:o})}import{Fragment as vt}from"react/jsx-runtime";import"react";import*as ue from"@radix-ui/react-dropdown-menu";import{jsx as et}from"react/jsx-runtime";function W({...e}){return et(ue.Root,{"data-slot":"dropdown-menu",...e})}import*as fe from"@radix-ui/react-dropdown-menu";import{jsx as tt}from"react/jsx-runtime";function F({...e}){return tt(fe.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}import*as I from"@radix-ui/react-dropdown-menu";import{cx as ut}from"@xjur-ui/util";import{Slot as rt}from"@radix-ui/react-slot";import{cx as at}from"@xjur-ui/util";import{useVirtualizer as nt}from"@tanstack/react-virtual";import{useRef as it}from"react";import{createContext as ot}from"react";var g=ot({virtualizer:null,enabled:!1});import{jsx as ye}from"react/jsx-runtime";function A({className:e,asChild:t,children:o,virtualized:r=!1,itemCount:a=0,estimateSize:n=()=>48,overscan:i=5,...s}){let p=t?rt:"div",c=it(null),k=nt({count:a,getScrollElement:()=>c.current,estimateSize:n,overscan:i,enabled:r});return ye(g.Provider,{value:{virtualizer:k,enabled:r},children:ye(p,{...s,className:at(e,"rounded-small scrollbar-thin bg-layer-2-idle border-border-layer-2 shadow-elevation-3 z-1000 max-h-[400px] list-none overflow-x-hidden overflow-y-auto border"),ref:c,children:o})})}import{Slot as wr}from"@radix-ui/react-slot";import{cx as Pr}from"@xjur-ui/util";import{jsx as Tr}from"react/jsx-runtime";import{cx as Mr}from"@xjur-ui/util";import{jsx as Rr}from"react/jsx-runtime";import{Slot as st}from"@radix-ui/react-slot";import{cx as ve}from"@xjur-ui/util";import{useContext as lt}from"react";import{jsx as B}from"react/jsx-runtime";function Y({className:e,asChild:t,children:o,renderItem:r,...a}){let n=t?st:"ul",{virtualizer:i,enabled:s}=lt(g);if(s&&i&&r){let p=i.getVirtualItems();return B(n,{...a,className:ve("p-small relative flex flex-col",e),style:{height:`${i.getTotalSize()}px`},children:p.map(c=>B("div",{className:"absolute top-0 left-0 w-full","data-index":c.index,ref:i.measureElement,style:{transform:`translateY(${c.start}px)`},children:r(c.index)},c.key))})}return B(n,{...a,className:ve("gap-small-1x p-small flex flex-col",e),children:o})}import{Slot as Br}from"@radix-ui/react-slot";import{cx as Kr,cva as pt}from"@xjur-ui/util";import{jsx as qr}from"react/jsx-runtime";var $r=pt(["py-medium px-small flex items-center gap-small rounded-small-1x","bg-layer-2-idle text-neutral-dark","hover:bg-layer-2-hover transition-colors duration-100 ease-out","active:bg-layer-2-pressed"],{variants:{size:{md:"h-large-4x",lg:"h-large-7x"},isActive:{true:"bg-primary-alt-active text-primary-label-active hover:bg-primary-alt-hover active:bg-primary-alt-pressed"}},defaultVariants:{size:"md",isActive:!1}});import{jsx as K}from"react/jsx-runtime";function $({className:e,sideOffset:t=4,align:o="start",side:r="bottom",children:a,...n}){return K(I.Portal,{children:K(I.Content,{align:o,className:ut("group z-1000 max-h-[var(--radix-popover-content-available-height)] max-w-[240px] min-w-[var(--radix-popover-trigger-width)]",e),"data-slot":"dropdown-menu-content",side:r,sideOffset:t,...n,children:K(A,{children:a})})})}import{jsx as ft}from"react/jsx-runtime";function Q({...e}){return ft(Y,{...e})}import{jsx as ma}from"react/jsx-runtime";import{cx as Ca}from"@xjur-ui/util";import"react";import*as yt from"@radix-ui/react-separator";import{cx as ya}from"@xjur-ui/util";import{jsx as xa}from"react/jsx-runtime";import{jsx as Ia}from"react/jsx-runtime";import{jsx as T,jsxs as xe}from"react/jsx-runtime";function ge({events:e}){let{renderEvent:t}=y();return xe(W,{children:[T(F,{asChild:!0,children:xe(P,{size:"sm",variant:"outlined",children:["Mais ",e.length]})}),T($,{className:"w-[240px]",children:T(Q,{children:e.map(o=>T(vt,{children:t?.(o)},o.eventDate.toISOString()))})})]})}import{jsx as u,jsxs as G}from"react/jsx-runtime";var Ct=bt({base:"group/calendar-cell p-small flex flex-col gap-small-1x w-full bg-layer-2-idle ",variants:{type:{month:"h-[212px]",week:"min-h-[64px] max-h-[212px]",day:"min-h-[64px] max-h-[212px]"}}});function he({cell:e,events:t}){let{date:o,type:r}=e,{renderEvent:a,activeEventId:n,onAddEvent:i,disableEventCreationInPast:s}=y(),p=q(()=>t.slice(0,2),[t]),c=t.length>=3,{isOver:k,setNodeRef:we}=gt({id:`calendar-cell-${r}-${o.toISOString()}`,data:{date:o,type:r}}),_e=q(()=>{let v=t.find(z=>z.id===n);if(!v)return!1;let U=z=>z.toLocaleDateString("pt-BR",{year:"numeric",month:"2-digit",day:"2-digit"}),Te=U(o),ke=U(v.eventDate);return Te===ke},[n,o,t]),Pe=Ct({type:r}),Ie=q(()=>s&&oe(o)&&!x(o),[s,o]);return G("div",{className:Pe,"data-slot":"calendar-cell",ref:we,children:[r==="month"&&u("div",{className:"flex items-center justify-center",children:u("div",{className:ht("size-large-2x rounded-circle bg-layer-2-idle flex items-center justify-center",x(o)&&"bg-primary-idle text-neutral-label"),children:u(l,{size:"sm",variant:"label",weight:"medium",children:e.date.getDate()})})}),G("div",{className:"gap-small-1x flex flex-col",children:[p.map(v=>u(xt,{children:a(v)},v.id)),k&&p.length<2&&!_e&&u("div",{className:"border-border-layer-4 rounded-small-2x h-[68px] w-full border border-dashed"})]}),G("div",{className:"mt-auto flex items-center justify-between",children:[c&&u(ge,{events:t.slice(2)}),i&&!Ie&&u("div",{className:"invisible ml-auto transition-opacity duration-100 ease-in-out group-hover/calendar-cell:visible",children:u(P,{size:"icon_sm",variant:"outlined",onClick:()=>i(o),children:u(ce,{className:"text-icon-neutral-3",name:"add"})})})]})]})}import{jsx as f,jsxs as De}from"react/jsx-runtime";function un(){let{selectedDate:e,events:t}=y(),o=Dt(()=>pe(e),[e]),r=be((n,i)=>de(t,n,i),[t]),a=be((n,i)=>({...n,date:ae(n.date,i)}),[]);return f("div",{className:"bg-layer-2-hover rounded-small-1x border-border-layer-2 scrollbar-hide h-full w-full border",children:De("div",{className:"flex flex-1 flex-col",children:[f("div",{className:Ce("bg-layer-2-hover sticky top-0 grid [grid-template-columns:64px_repeat(7,1fr)]","[&>*]:border-border-layer-2","[&>*]:border-l"),"data-slot":"week-header",children:o.map((n,i)=>f(me,{date:n.date,style:{gridColumnStart:i+2}},n.date.getDay()))}),f("div",{className:"overflow-hidden",children:le.map(({hour:n,label:i})=>De("div",{className:"flex items-start",children:[f("div",{className:"px-small flex h-full w-[64px] items-start justify-end",children:f(l,{size:"sm-1x",variant:"label",weight:"medium",children:i})}),f("div",{className:Ce("grid flex-1 grid-cols-7","[&>*]:border-border-layer-2","[&>*]:border-t","[&>*]:border-l"),children:o.map(s=>f(he,{cell:a(s,n),events:r(s.date,n)},s.date.toISOString()))})]},n))})]})})}export{un as CalendarWeekView};
|