@zvoove/unity-ui 2.28.0 → 2.29.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/cli.mjs +53 -28
- package/dist/bin/generate-skills.mjs +33 -21
- package/dist/llms.txt +62 -0
- package/dist/unity-ui.cjs.js +1 -1
- package/dist/unity-ui.css +1 -1
- package/dist/unity-ui.d.ts +12 -1
- package/dist/unity-ui.es.js +10 -10
- package/package.json +16 -8
package/dist/unity-ui.d.ts
CHANGED
|
@@ -2019,7 +2019,7 @@ declare type LabelStates = {
|
|
|
2019
2019
|
};
|
|
2020
2020
|
|
|
2021
2021
|
export declare const List: {
|
|
2022
|
-
<T extends default_2.ElementType = "div">({ items, showDividers, linkComponent: LinkComponent, }: ListProps<T>): JSX.Element;
|
|
2022
|
+
<T extends default_2.ElementType = "div">({ items, activeItemId, showDividers, linkComponent: LinkComponent, }: ListProps<T>): JSX.Element;
|
|
2023
2023
|
displayName: string;
|
|
2024
2024
|
};
|
|
2025
2025
|
|
|
@@ -2121,6 +2121,11 @@ export declare interface ListProps<T extends default_2.ElementType = 'div'> {
|
|
|
2121
2121
|
* The items of the List.
|
|
2122
2122
|
*/
|
|
2123
2123
|
items: ListItem<T>[];
|
|
2124
|
+
/**
|
|
2125
|
+
* The active item id of the List.
|
|
2126
|
+
* If provided, the item will be highlighted.
|
|
2127
|
+
*/
|
|
2128
|
+
activeItemId?: string;
|
|
2124
2129
|
/**
|
|
2125
2130
|
* Whether to show dividers between items.
|
|
2126
2131
|
* @default true
|
|
@@ -3074,6 +3079,12 @@ export declare type SideNavigationProps<T extends React.ElementType = 'a'> = {
|
|
|
3074
3079
|
* Full logo name shown next to the icon when expanded.
|
|
3075
3080
|
*/
|
|
3076
3081
|
name?: ReactNode;
|
|
3082
|
+
/**
|
|
3083
|
+
* When `true`, the icon is hidden while the sidebar is expanded so that only the name is visible.
|
|
3084
|
+
* When the sidebar collapses the icon reappears as the sole identifier.
|
|
3085
|
+
* @default false
|
|
3086
|
+
*/
|
|
3087
|
+
hideIconWhenOpen?: boolean;
|
|
3077
3088
|
};
|
|
3078
3089
|
/**
|
|
3079
3090
|
* The list of menu items
|
package/dist/unity-ui.es.js
CHANGED
|
@@ -12,7 +12,7 @@ return b("div",{className:_m(),children:[o.map(({...e},n)=>/* @__PURE__ */b(a.Fr
|
|
|
12
12
|
/* @__PURE__ */x(wd,{name:"chevron-right",size:"sm",weight:"bold",className:"fill-outline"})]}),1===e.length?/* @__PURE__ */x(wd,{name:l,size:"sm"}):n&&/* @__PURE__ */x(_p,{truncate:1,color:"on-surface-variant",children:n.label})]})},Dm=Ja({base:["size-fit","inline-flex","items-center","justify-center"],variants:{isLoading:{true:["opacity-0"]}}}),Tm=Ja({base:["inline-flex","items-center","justify-center","rounded-full","transition-colors","duration-300","disabled:cursor-not-allowed","transition-colors","duration-300","whitespace-nowrap","shrink-0","text-nowrap"],variants:{isLoading:{true:["cursor-progress"],false:["cursor-pointer"]},size:{sm:["text-label-medium","min-h-[24px]"],md:["text-label-large","min-h-[32px]"],lg:["text-label-large","min-h-[40px]"]},hasIconOnly:{false:[]},hasIcon:{true:[]},variant:{filled:["bg-primary","border-primary","text-on-primary","hover:bg-primary-hover","focus:bg-primary-hover","focus:border-primary","focus:text-on-primary","active:bg-primary-active","disabled:bg-on-surface/10","disabled:text-on-surface/40"],outlined:["active:bg-primary/20","bg-transparent","border","disabled:hover:bg-transparent","border-outline","text-on-surface","hover:bg-primary/10","hover:border-primary","hover:text-primary","focus:bg-primary/10","focus:border-primary","focus:text-primary","disabled:border-on-surface/10","disabled:text-on-surface/40","disabled:hover:border-on-surface/10","disabled:hover:text-on-surface/40"],text:["bg-transparent","text-primary","hover:bg-primary/10","active:bg-primary/20","disabled:text-on-surface/40"],textSecondary:["bg-transparent","disabled:text-secondary-70","text-on-surface-variant","hover:bg-secondary/10","hover:bg-on-surface/10","active:bg-on-surface/20"],elevated:["disabled:shadow-none","disabled:bg-on-surface/10","disabled:text-on-surface/40","bg-surface-bright","text-on-surface","hover:bg-primary/10","hover:bg-primary/20","shadow-elevation1","dark:shadow-elevation1-dark"],tonal:["disabled:bg-secondary-95","disabled:text-secondary-70","bg-tertiary-container","text-on-tertiary-container","hover:bg-tertiary-container-hover","active:bg-tertiary-container-active"],linkPrimary:["disabled:text-secondary-70","text-primary","hover:bg-primary/10","active:bg-primary/20","disabled:text-on-surface/40","size-fit"],linkSecondary:["disabled:text-secondary-70","text-on-surface-variant","hover:bg-on-surface/10","active:bg-on-surface/20","size-fit"],positive:["bg-green-container","border-green-container","text-on-green-container","hover:bg-green-container-hover","focus:bg-green-container-hover","focus:border-green-container","focus:text-on-green-container"],negative:["bg-error","border-error","text-on-error","hover:bg-error-hover","focus:bg-error-hover","focus:border-error","focus:text-on-error"]}},compoundVariants:[{size:"sm",hasIconOnly:!0,class:["size-[24px]"]},{size:"md",hasIconOnly:!0,class:["size-[32px]"]},{size:"lg",hasIconOnly:!0,class:["size-[40px]"]},{size:"sm",hasIconOnly:!1,hasIcon:!1,class:["px-md"]},{size:"md",hasIconOnly:!1,hasIcon:!1,class:["px-lg"]},{size:"lg",hasIconOnly:!1,hasIcon:!1,class:["px-xl"]},{size:"sm",hasIconOnly:!1,hasIcon:!0,class:["pr-md","pl-sm"]},{size:"md",hasIconOnly:!1,hasIcon:!0,class:["pr-lg","pl-md"]},{size:"lg",hasIconOnly:!1,hasIcon:!0,class:["pr-xl","pl-lg"]},{variant:["linkPrimary","linkSecondary"],class:["min-h-none!","!py-none","!px-none","rounded-xs","bg-transparent","disabled:bg-transparent"]}]}),Om=({children:e,variant:a="filled",hideLabel:t=!1,as:l,icon:n,linkComponent:r,size:i="lg",isLoading:o=!1,...s})=>{const c=gm(i)??"lg",m=gm(a)??"filled",d=gm(t)??!1;Kc(!!r&&!!l,'The prop "as" is ignored when the button is an custom link component'),Kc(!e&&!("aria-label"in s),'When the children are empty, you must provide an "aria-label" prop to the button to make it accessible');const h=!!n&&!e||d,p="string"==typeof n?{name:n}:n;/* @__PURE__ */
|
|
13
13
|
return b(r??l??"button",{className:Tm({variant:m,hasIconOnly:h,size:c,hasIcon:!!n,isLoading:o}),...s,...o&&{onClick:void 0,"aria-disabled":!0,"aria-busy":!0},children:[o&&/* @__PURE__ */x("span",{className:"size-fit absolute inset-0",children:/* @__PURE__ */x(wd,{name:"circle-notch",size:"sm"===c?"xs":c,className:"animate-spin"})}),o?/* @__PURE__ */x("span",{className:Dm({isLoading:!0}),children:/* @__PURE__ */b(CH,{direction:"row",align:"center",justify:"center",gap:"xs",children:[n&&/* @__PURE__ */x(wd,{...p,size:"sm"===c?"xs":c}),!h&&e]})}):/* @__PURE__ */b(CH,{direction:"row",align:"center",justify:"center",gap:"xs",children:[n&&/* @__PURE__ */x(wd,{...p,size:"sm"===c?"xs":c}),!h&&e]})]})};Om.displayName="Button";var zm=Ja({base:["border-b","transition-colors","duration-300"],variants:{bgColor:F,sticky:{true:["sticky","top-none","z-1","backdrop-blur-sm"]},hideBorder:{true:["border-transparent"],false:["border-outline-variant"]},borderRadius:{none:[],sm:["rounded-tl-sm","rounded-tr-sm"],md:["rounded-tl-md","rounded-tr-md"],lg:["rounded-tl-lg","rounded-tr-lg"],xl:["rounded-tl-xl","rounded-tr-xl"]}},defaultVariants:{hideBorder:!1}}),Rm=Ja({base:["size-full","min-h-none"],variants:{...j}}),Bm=Ja({base:["relative","w-full","h-full","overscroll-none"],variants:{...pe}}),Um=Ja({base:[],variants:{bgColor:F}}),jm=Ja({base:["relative","overflow-hidden","transition-all","duration-300","grid","grid-cols-1"],variants:{hasCustomSize:{false:["w-full"]},hasHeader:{true:[],false:[]},hasFooter:{true:[],false:[]},variant:{outlined:["border","bg-transparent","border-outline-variant"],filled:["bg-surface"]},interactive:{true:["cursor-pointer"]},bgColor:F,textColor:{outline:["text-on-surface!"],"outline-variant":["text-on-surface!"],"outline-low":["text-on-surface!"],primary:["text-on-primary!"],"primary-container":["text-on-primary-container!"],"primary-fixed":["text-on-primary-fixed!"],"primary-fixed-dim":["text-on-primary-fixed!"],"inverse-primary":["text-inverse-on-surface!"],secondary:["text-on-secondary!"],"secondary-fixed":["text-on-secondary-fixed!"],"secondary-fixed-dim":["text-on-secondary-fixed!"],tertiary:["text-on-tertiary!"],"tertiary-fixed":["text-on-tertiary-fixed!"],"tertiary-fixed-dim":["text-on-tertiary-fixed!"],"tertiary-container":["text-on-tertiary-container!"],surface:["text-on-surface!"],"surface-bright":["text-on-surface!"],"surface-dim":["text-on-surface!"],"surface-variant":["text-on-surface-variant!"],"inverse-surface":["text-inverse-on-surface!"],"surface-container-high":["text-on-surface!"],"surface-container-highest":["text-on-surface!"],"surface-container-low":["text-on-surface!"],"surface-container-lowest":["text-on-surface!"],"surface-container":["text-on-surface!"],"inverse-on-surface":["text-on-surface!"],error:["text-on-error!"],"error-container":["text-on-error-container!"],green:["text-on-green!"],"dark-green":["text-on-dark-green!"],"green-container":["text-on-green-container!"],pink:["text-on-pink!"],"dark-pink":["text-on-dark-pink!"],"pink-container":["text-on-pink-container!"],"steel-blue":["text-on-steel-blue!"],"dark-steel-blue":["text-on-dark-steel-blue!"],"steel-blue-container":["text-on-steel-blue-container!"],yellow:["text-on-yellow!"],"dark-yellow":["text-on-dark-yellow!"],"yellow-container":["text-on-yellow-container!"],scrim:["text-on-scrim!"],background:["text-on-surface!"],"primary-hover":["text-on-primary!"],"primary-active":["text-on-primary!"],"secondary-container":["text-on-secondary-container!"],"tertiary-container-hover":["text-on-tertiary-container!"],"tertiary-container-active":["text-on-tertiary-container!"],"container-neutral":["text-on-container-neutral!"],"container-neutral-hover":["text-on-container-neutral!"],"code-surface":["text-code-on-surface!"],"code-surface-variant":["text-code-on-surface!"]},interactiveBgColor:{outline:["hover:bg-outline/80!"],"outline-variant":["hover:bg-outline-variant/80!"],"outline-low":["hover:bg-outline-low/80!"],primary:["hover:bg-primary/80!"],"primary-container":["hover:bg-primary-container/80!"],"primary-fixed":["hover:bg-primary-fixed/80!"],"primary-fixed-dim":["hover:bg-primary-fixed-dim/80!"],"inverse-primary":["hover:bg-inverse-primary/80!"],secondary:["hover:bg-secondary/80!"],"secondary-fixed":["hover:bg-secondary-fixed/80!"],"secondary-fixed-dim":["hover:bg-secondary-fixed-dim/80!"],tertiary:["hover:bg-tertiary/80!"],"tertiary-fixed":["hover:bg-tertiary-fixed/80!"],"tertiary-fixed-dim":["hover:bg-tertiary-fixed-dim/80!"],"tertiary-container":["hover:bg-tertiary-container/80!"],surface:["hover:bg-surface-container-lowest!"],"surface-bright":["hover:bg-surface-bright/80!"],"surface-dim":["hover:bg-surface-dim/80!"],"surface-variant":["hover:bg-surface-variant/80!"],"inverse-surface":["hover:bg-inverse-surface/80!"],"surface-container-high":["hover:bg-surface-container-high/80!"],"surface-container-highest":["hover:bg-surface-container-highest/80!"],"surface-container-low":["hover:bg-surface-container-low/80!"],"surface-container-lowest":["hover:bg-surface-container-lowest/80!"],"surface-container":["hover:bg-surface-container/80!"],"inverse-on-surface":["hover:bg-inverse-on-surface/80!"],error:["hover:bg-error/80!"],"error-container":["hover:bg-error-container/80!"],green:["hover:bg-green/80!"],"dark-green":["hover:bg-dark-green/80!"],"green-container":["hover:bg-green-container/80!"],pink:["hover:bg-pink/80!"],"dark-pink":["hover:bg-dark-pink/80!"],"pink-container":["hover:bg-pink-container/80!"],"steel-blue":["hover:bg-steel-blue/80!"],"dark-steel-blue":["hover:bg-dark-steel-blue/80!"],"steel-blue-container":["hover:bg-steel-blue-container/80!"],yellow:["hover:bg-yellow/80!"],"dark-yellow":["hover:bg-dark-yellow/80!"],"yellow-container":["hover:bg-yellow-container/80!"],scrim:["hover:bg-scrim/80!"],background:["hover:bg-background/80!"],"primary-hover":["hover:bg-primary-hover/80!"],"primary-active":["hover:bg-primary-active/80!"],"secondary-container":["hover:bg-secondary-container/80!"],"tertiary-container-hover":["hover:bg-tertiary-container-hover/80!"],"tertiary-container-active":["hover:bg-tertiary-container-active/80!"],"container-neutral":["hover:bg-container-neutral/80!"],"container-neutral-hover":["hover:bg-container-neutral-hover/80!"],"code-surface":["hover:bg-code-surface/80!"],"code-surface-variant":["hover:bg-code-surface-variant/80!"]},...j,...K,borderRadius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl"},elevation:{0:["shadow-none"],1:["shadow-elevation1","dark:shadow-elevation1-dark"],2:["shadow-elevation2","dark:shadow-elevation2-dark"],3:["shadow-elevation3","dark:shadow-elevation3-dark"],4:["shadow-elevation4","dark:shadow-elevation4-dark"],5:["shadow-elevation5","dark:shadow-elevation5-dark"]}},compoundVariants:[{elevation:0,bgColor:"surface",class:["dark:bg-surface!"]},{elevation:1,bgColor:"surface",class:["dark:bg-surface-container-low!"]},{elevation:2,bgColor:"surface",class:["dark:bg-surface-container!"]},{elevation:3,bgColor:"surface",class:["dark:bg-surface-container-high!"]},{elevation:4,bgColor:"surface",class:["dark:bg-surface-container-high!"]},{elevation:5,bgColor:"surface",class:["dark:bg-surface-container-highest!"]},{hasHeader:!1,hasFooter:!1,class:["grid-rows-[1fr]"]},{hasHeader:!0,hasFooter:!1,class:["grid-rows-[auto_1fr]"]},{hasHeader:!1,hasFooter:!0,class:["grid-rows-[1fr_auto]"]},{hasHeader:!0,hasFooter:!0,class:["grid-rows-[auto_1fr_auto]"]}]}),Wm=({children:e,header:a,headerBgColor:t,footer:l,footerBgColor:n,hideHeaderBorder:r=!1,borderRadius:i="md",elevation:o=0,variant:s="filled",padding:c="md",margin:m="none",className:d,overflow:h="visible",bgColor:p="surface",height:u,width:H,minHeight:C,maxHeight:g,minWidth:V,maxWidth:f,interactive:Z,as:v,linkComponent:A,...w})=>{d&&(Xc(!Jc(d),"@Card: className only accepts tailwindcss classes that defines height or width. \n\nExample: h-[200px], w-[200px], h-full, w-full, size-full, size-[500px]"),Kc(!!Jc(d),"@Card: className is deprecated. Use the `height`, `width`, `minHeight`, `maxHeight`, `minWidth`, `maxWidth` props instead. In v3.0.0, the className prop will be removed.")),Kc(!!A&&!!v,'@Card: The prop "as" is ignored when a custom linkComponent is provided');const E=gm(u),L=gm(H),y=gm(C),k=gm(g),F=gm(V),N=gm(f),_=A??v??"div",S=Z??Boolean(w.onClick??A??"a"===v),I=!(!a&&!l),D="visible"!==h&&"hidden"!==h;/* @__PURE__ */
|
|
14
14
|
return x(_,{className:jm({...Hm(I||D?"none":c,m),...D?{}:vm(I?"hidden":h),interactive:S,hasCustomSize:Boolean(d),hasHeader:Boolean(a),hasFooter:Boolean(l),borderRadius:i,elevation:o,variant:s,bgColor:p,textColor:p,...S?{interactiveBgColor:p}:{},className:d}),...w,style:{height:E,width:L,minHeight:y,maxHeight:k,minWidth:F,maxWidth:N},children:D?/* @__PURE__ */b("div",{className:Bm({...vm(h)}),children:[a&&/* @__PURE__ */x("div",{className:zm({bgColor:t,sticky:!0,hideBorder:r,borderRadius:i}),children:a}),e&&/* @__PURE__ */x("div",{className:Rm(Hm(c)),children:e}),l&&/* @__PURE__ */x("div",{className:Um({bgColor:n}),children:l})]}):/* @__PURE__ */b(M,{children:[a&&/* @__PURE__ */x("div",{className:zm({bgColor:t,hideBorder:r,borderRadius:i}),children:a}),I?e&&/* @__PURE__ */x("div",{className:Rm(Hm(c)),children:e}):e,l&&/* @__PURE__ */x("div",{className:Um({bgColor:n}),children:l})]})})};Wm.displayName="Card";var Pm=Ja({base:["grid","gap-xs","items-start","w-full"],variants:{variant:{sender:["grid-cols-[1fr_auto]"],receiver:["grid-cols-[auto_1fr]"]},state:{thinking:["items-center","gap-sm"],default:[],error:[]}},defaultVariants:{variant:"receiver",state:"default"}}),$m=Ja({base:["size-xl2","shrink-0","[&>*]:size-full!"],variants:{variant:{sender:["order-last"],receiver:["[&>*]:bg-surface-container-low!"]}}}),Gm=Ja({base:["min-w-none","flex","flex-col","gap-xs"],variants:{variant:{sender:["items-end"],receiver:["items-start"]}},defaultVariants:{variant:"receiver"}}),qm=Ja({base:["text-body-medium","text-on-surface-variant","italic","select-none","animate-fade-in"]}),Ym=Ja({base:["animate-dot-pulse",'after:content-["."]'],variants:{delay:{0:["[animation-delay:0ms]"],1:["[animation-delay:160ms]"],2:["[animation-delay:320ms]"]}},defaultVariants:{delay:0}}),Xm=Ja({base:["w-fit","max-w-[min(var(--chat-content-measure),100%)]","rounded-bl-md","rounded-br-md","text-body-medium","min-w-none","[overflow-wrap:anywhere]","py-sm","px-md","animate-fade-in","[&>a]:text-primary","[&>a]:underline"],variants:{variant:{sender:["bg-primary","text-on-primary","rounded-tl-md","rounded-tr-xs","text-right"],receiver:["bg-surface-container-low","text-on-surface","rounded-tl-xs","rounded-tr-md","text-left"]},state:{default:["overflow-hidden"],error:["overflow-hidden"]}},defaultVariants:{variant:"receiver",state:"default",hasAttachment:!1}}),Km=Ja({base:["w-full","max-w-[min(var(--chat-content-measure),100%)]","min-w-none","animate-fade-in"]}),Jm=Ja({base:["flex","flex-col","gap-xs","w-full"]}),Qm=Ja({base:["overflow-hidden","rounded-sm","[&>img]:w-full","[&>img]:h-auto","[&>img]:block","[&>video]:w-full","[&>video]:h-auto","[&>video]:block","[&>iframe]:w-full","[&>iframe]:aspect-video","[&>iframe]:block","[&>iframe]:border-none"]}),ed=Ja({base:["text-body-medium","opacity-70","px-xs2"]}),ad=(Ja({base:["flex","flex-col","gap-xs","w-fit","max-w-[min(var(--chat-content-measure),100%)]"]}),Ja({base:["animate-fade-in"]})),td=[0,1,2],ld=["Einen Moment bitte","Ich denke nach","Wird verarbeitet"],nd=()=>/* @__PURE__ */x(M,{children:td.map(e=>/* @__PURE__ */x("span",{className:Ym({delay:e})},e))});var rd=s(({variant:e="receiver",state:a="default",children:t,avatar:l,thinkingPhrases:n=ld,attachment:r,footer:i,className:o,...s},c)=>{const m="thinking"===a,d=!!r,p=null!=t,H=function(e,a,t){const l=Z(0),n=Z(/* @__PURE__ */new Set),r=h(e=>(n.current.add(e),()=>{n.current.delete(e)}),[]),i=h(()=>l.current,[]);return u(()=>{if(!e)return void(l.current=0);l.current=0;const r=setInterval(()=>{l.current=(l.current+1)%a,n.current.forEach(e=>e())},t);return()=>clearInterval(r)},[e,a,t]),A(r,i)}(m,n.length,3e3),C=l?.type??("receiver"===e?"zvoove":l?.image?"image":l?.name?"initials":"avatar");/* @__PURE__ */
|
|
15
|
-
return b("div",{ref:c,className:Pm({variant:e,state:a,className:o}),"data-testid":"chat-bubble","data-variant":e,...s,...m?{role:"status","aria-busy":!0}:{},children:[/* @__PURE__ */x("div",{className:$m({variant:e}),children:/* @__PURE__ */x(km,{size:"medium",variant:"round",...l,type:C})}),/* @__PURE__ */x("div",{className:Gm({variant:e}),children:m?/* @__PURE__ */b("span",{className:qm(),children:[n[H],/* @__PURE__ */x(nd,{})]}):/* @__PURE__ */b(M,{children:[p&&/* @__PURE__ */x("div",{className:Xm({variant:e,state:a}),children:"string"==typeof t?Mm(t):t}),d&&/* @__PURE__ */x("div",{className:Km(),children:r}),i&&/* @__PURE__ */x("div",{className:ad(),children:i})]})})]})});rd.displayName="ChatBubble";var id=s(({children:e,caption:a,className:t,...l},n)=>/* @__PURE__ */b("figure",{ref:n,className:Jm({className:t}),...l,children:[/* @__PURE__ */x("div",{className:Qm(),children:e}),a&&/* @__PURE__ */x("figcaption",{className:ed(),children:a})]}));id.displayName="ChatBubbleMedia";var od=Ja({base:["flex","items-center","gap-sm","cursor-pointer"],variants:{disabled:{true:["opacity-50","!cursor-not-allowed"]}}}),sd=Ja({base:["size-[18px]","shrink-0","rounded-xs","relative","transition-all","duration-300","border-2","flex","items-center","justify-center","before:shrink-0","after:absolute","after:size-[20px]","after:rounded-full","after:transition-all","after:transform","after:top-[-3px]","after:left-[-3px]","after:scale-100","after:opacity-0","after:z-0","hover:after:opacity-10","hover:after:scale-180","peer-focus:after:opacity-10","peer-focus:after:scale-180","before:shrink-0","before:absolute","before:size-[20px]","before:rounded-full","before:transition-all","before:transform","before:top-[-3px]","before:left-[-3px]","before:opacity-0"],variants:{checked:{true:["border-transparent","text-on-primary"],false:["border-outline"]},error:{true:["before:bg-error","after:bg-error"],false:["before:bg-primary","after:bg-primary"]},animate:{true:["before:animate-ripple"]},disabled:{true:["before:bg-outline!","after:bg-outline!"]}},compoundVariants:[{checked:!0,error:!0,disabled:!1,class:["bg-error"]},{checked:!0,error:!1,disabled:!1,class:["bg-primary","border-primary"]},{error:!0,checked:!1,disabled:!1,class:["border-error!","before:bg-error!"]},{checked:!0,disabled:!0,class:["border-transparent","bg-outline"]}]}),cd=({checked:e=!1,name:a,id:t,disabled:l=!1,error:n=!1,indeterminate:r=!1,value:i,label:o,onChange:s=()=>{}})=>{const[c,m]=v(!1),d=H();/* @__PURE__ */
|
|
15
|
+
return b("div",{ref:c,className:Pm({variant:e,state:a,className:o}),"data-testid":"chat-bubble","data-variant":e,...s,...m?{role:"status","aria-busy":!0}:{},children:[/* @__PURE__ */x("div",{className:$m({variant:e}),children:/* @__PURE__ */x(km,{size:"medium",variant:"round",...l,type:C})}),/* @__PURE__ */x("div",{className:Gm({variant:e}),children:m?/* @__PURE__ */b("span",{className:qm(),children:[n[H],/* @__PURE__ */x(nd,{})]}):/* @__PURE__ */b(M,{children:[p&&/* @__PURE__ */x("div",{className:Xm({variant:e,state:a}),children:"string"==typeof t?Mm(t):t}),d&&/* @__PURE__ */x("div",{className:Km(),children:r}),i&&/* @__PURE__ */x("div",{className:ad(),children:i})]})})]})});rd.displayName="ChatBubble";var id=s(({children:e,caption:a,className:t,...l},n)=>/* @__PURE__ */b("figure",{ref:n,className:Jm({className:t}),...l,children:[/* @__PURE__ */x("div",{className:Qm(),children:e}),a&&/* @__PURE__ */x("figcaption",{className:ed(),children:a})]}));id.displayName="ChatBubbleMedia";var od=Ja({base:["relative","flex","items-center","gap-sm","cursor-pointer"],variants:{disabled:{true:["opacity-50","!cursor-not-allowed"]}}}),sd=Ja({base:["size-[18px]","shrink-0","rounded-xs","relative","transition-all","duration-300","border-2","flex","items-center","justify-center","before:shrink-0","after:absolute","after:size-[20px]","after:rounded-full","after:transition-all","after:transform","after:top-[-3px]","after:left-[-3px]","after:scale-100","after:opacity-0","after:z-0","hover:after:opacity-10","hover:after:scale-180","peer-focus:after:opacity-10","peer-focus:after:scale-180","before:shrink-0","before:absolute","before:size-[20px]","before:rounded-full","before:transition-all","before:transform","before:top-[-3px]","before:left-[-3px]","before:opacity-0"],variants:{checked:{true:["border-transparent","text-on-primary"],false:["border-outline"]},error:{true:["before:bg-error","after:bg-error"],false:["before:bg-primary","after:bg-primary"]},animate:{true:["before:animate-ripple"]},disabled:{true:["before:bg-outline!","after:bg-outline!"]}},compoundVariants:[{checked:!0,error:!0,disabled:!1,class:["bg-error"]},{checked:!0,error:!1,disabled:!1,class:["bg-primary","border-primary"]},{error:!0,checked:!1,disabled:!1,class:["border-error!","before:bg-error!"]},{checked:!0,disabled:!0,class:["border-transparent","bg-outline"]}]}),cd=({checked:e=!1,name:a,id:t,disabled:l=!1,error:n=!1,indeterminate:r=!1,value:i,label:o,onChange:s=()=>{}})=>{const[c,m]=v(!1),d=H();/* @__PURE__ */
|
|
16
16
|
return b("label",{className:od({disabled:l}),htmlFor:t??d,children:[
|
|
17
17
|
/* @__PURE__ */x("input",{type:"checkbox",name:a,value:i,checked:e,"aria-checked":e,onChange:e=>{l||(m(!0),s(e),setTimeout(()=>{m(!1)},500))},className:"sr-only peer",disabled:l,id:t??d}),
|
|
18
18
|
/* @__PURE__ */x("div",{className:sd({checked:e||r,error:n,animate:c,disabled:l}),children:r?/* @__PURE__ */x(wd,{name:"minus",size:"2xs",weight:"bold"}):e?/* @__PURE__ */x(wd,{name:"check",size:"2xs",weight:"bold"}):""}),
|
|
@@ -654,7 +654,7 @@ return b(M,{children:[
|
|
|
654
654
|
/* @__PURE__ */x("div",{className:ah({visible:V}),children:/* @__PURE__ */x(eh,{currentDate:E,onSelectYear:e=>{G(new Date(e,E.getMonth(),1)),f(!1)},onClose:()=>f(!1),isOpen:V,locale:t,maxDate:n,minDate:r})}),
|
|
655
655
|
/* @__PURE__ */x(ih,{weekDays:j,isSelectorOpen:C||V}),
|
|
656
656
|
/* @__PURE__ */x(Ch,{monthsData:_,isSelectorOpen:C||V,skipTransition:I,carouselRef:T,getCurrentMonthDays:R,isSelectedDate:B,isToday:U,onDateClick:e=>i(e,!0),selectedDate:a,renderEmptyCells:Wd,minDate:r,maxDate:n,locale:t}),
|
|
657
|
-
/* @__PURE__ */x(ph,{isSelectorOpen:C||V,onCancel:H,onClear:d,onOK:p,cancelText:Gd(t,"cancel",q),clearText:Gd(t,"clear",q),okText:l?.ok??"OK"})]})},Vh=({isOpen:e=!1,isVisible:a=!1,onClose:t,onDateSelect:l,selectedDate:n,inputSelector:r,onCancel:i,closeOnSelect:o=!1})=>{const{locale:s,maxDate:c,minDate:m,buttonsTranslations:p}=Bd(),H=void 0!==globalThis.window,C=Z(null),g=Z(null),V=Z(null),f=h(()=>{t()},[t]),A=h((e,a=!1)=>{l(e),o&&a&&f()},[l,o,f]),M=h(()=>{i()},[i]);u(()=>{e&&(V.current=document.querySelector(`input[data-selector="${r}"]`))},[e,r]),L([g,V],f,e),((e,a,t,l)=>{u(()=>{if(!a||!e?.current)return;const t=e.current,n=t.querySelectorAll('[data-focusable="true"]');if(!n?.length)return;const r=Array.from(n),i=t.querySelector('[data-container="days"]'),o=t.querySelector('[data-container="actions"]'),s=t.querySelector('[data-month-nav-direction="prev"]'),c=t.querySelector('[data-month-nav-direction="next"]'),m=[],d=[],h=[];r.forEach(e=>{o?.contains(e)?h.push(e):i?.contains(e)?d.push(e):m.push(e)});const p=m[0]||r[0],u=h[h.length-1]||r[r.length-1],H=t.querySelectorAll('a, button, input, select, textarea, [tabindex]:not([tabindex="-1"])');H&&Array.from(H).forEach(e=>{e.hasAttribute("data-focusable")||e.setAttribute("tabindex","-1")});const C=document.activeElement;C&&"INPUT"===C.tagName||setTimeout(()=>{const e=t.querySelector('[data-selected="true"][data-month="current"]'),a=t.querySelector('[data-today="true"][data-month="current"]'),l=Array.from(t.querySelectorAll('[data-month="current"][data-focusable="true"]'));e?.hasAttribute("data-focusable")?e.focus():a?.hasAttribute("data-focusable")?a.focus():l.length>0?l[0].focus():p&&p.focus()},50);const g=e=>{if("INPUT"!==document.activeElement?.tagName){if("Escape"===e.key)return e.preventDefault(),void l();if("Tab"===e.key||e.key.startsWith("Arrow")){if("Tab"===e.key){const a=document.activeElement,l=a?.hasAttribute("data-selected"),n=a?.hasAttribute("data-today"),r=l||n||a?.hasAttribute("data-month");if(!e.shiftKey&&(l||n))return e.preventDefault(),void(h.length>0?h[0].focus():p?.focus());if(e.shiftKey&&r)return e.preventDefault(),void(m.length>0?m[m.length-1].focus():u?.focus());const i=m.includes(a),o=d.includes(a),s=h.includes(a);let c=-1;if(i?c=m.indexOf(a):o?c=d.indexOf(a):s&&(c=h.indexOf(a)),-1===c&&!i&&!o&&!s){if(e.preventDefault(),e.shiftKey)u?.focus();else{const e=Array.from(t.querySelectorAll('[data-month="current"][data-focusable="true"]'));e.length>0?e[0].focus():p?.focus()}return}if(e.shiftKey){if(i&&0===c)e.preventDefault(),u?.focus();else if(o&&0===c)e.preventDefault(),m.length>0?m[m.length-1].focus():u?.focus();else if(s&&0===c){e.preventDefault();const a=t.querySelector('[data-selected="true"][data-month="current"]'),l=t.querySelector('[data-today="true"][data-month="current"]'),n=Array.from(t.querySelectorAll('[data-month="current"][data-focusable="true"]'));a?.hasAttribute("data-focusable")?a.focus():l?.hasAttribute("data-focusable")?l.focus():n.length>0?n[n.length-1].focus():m.length>0&&m[m.length-1].focus()}}else if(i&&c===m.length-1){e.preventDefault();const a=t.querySelector('[data-selected="true"][data-month="current"]'),l=t.querySelector('[data-today="true"][data-month="current"]'),n=Array.from(t.querySelectorAll('[data-month="current"][data-focusable="true"]'));a?.hasAttribute("data-focusable")?a.focus():l?.hasAttribute("data-focusable")?l.focus():n.length>0?n[0].focus():h.length>0&&h[0].focus()}else o&&c===d.length-1?(e.preventDefault(),h.length>0?h[0].focus():p?.focus()):s&&c===h.length-1&&(e.preventDefault(),p?.focus());return}const a=document.activeElement;if(a?.hasAttribute("data-month")&&("ArrowUp"===e.key||"ArrowDown"===e.key||"ArrowLeft"===e.key||"ArrowRight"===e.key)){e.preventDefault();const l=Array.from(t.querySelectorAll('[data-month="current"][data-focusable="true"]')||[]);if(!l.length)return;const n=l.findIndex(e=>e===a);if(-1===n)return;const r=7;let i=n;switch(e.key){case"ArrowUp":i=n-r;break;case"ArrowDown":i=n+r;break;case"ArrowLeft":i=n-1;break;case"ArrowRight":i=n+1}i<0||i>=l.length?i<0&&s?(s.dispatchEvent(new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0})),setTimeout(()=>{const e=t.querySelectorAll('[data-month="current"][data-focusable="true"]');e?.length&&e[e.length-1].focus()},550)):i>=l.length&&c&&(c.dispatchEvent(new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0})),setTimeout(()=>{const e=t.querySelectorAll('[data-month="current"][data-focusable="true"]');e?.length&&e[0].focus()},550)):l[i].focus()}}}};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[e,a,t,l])})(C,e,n,f),(({isOpen:e,portalRef:a,inputSelector:t})=>{const l=h(()=>{if(!a.current)return;const e=document.querySelector(`input[data-selector="${t}"]`);if(!e)return;const l=e.getBoundingClientRect(),n=a.current,r=document.documentElement.clientHeight,i=r-l.bottom,o=a.current?.querySelector('[data-selector="card"]');o.style.position="absolute",o.style.bottom="",n.style.top="",n.style.bottom="",i<412?(o.style.bottom="0px",n.style.bottom=r-l.top+12+"px"):n.style.top=`${l.bottom+12}px`,n.style.left=`${l.left}px`},[t,a]);u(()=>{if(e)return l(),window.addEventListener("scroll",l,!0),window.addEventListener("resize",l),()=>{window.removeEventListener("scroll",l,!0),window.removeEventListener("resize",l)}},[e,l])})({isOpen:e,portalRef:C,inputSelector:r});const{currentDate:b,internalSelectedDate:w,handleDateClick:y,handleClear:k,handlePrevMonth:F,handleNextMonth:N,handlePrevYear:_,handleNextYear:S}=(({selectedDate:e,onDateSelect:a})=>{const[t,l]=v(()=>!e||Number.isNaN(e.getTime())?/* @__PURE__ */new Date:e),[n,r]=v(e);return u(()=>{d(()=>{r(a=>a===e||a&&e&&a.getTime()===e.getTime()?a:a||e?e:a),e&&!Number.isNaN(e.getTime())?l(a=>a.getTime()===e.getTime()?a:e):e||l(e=>{const a=/* @__PURE__ */new Date;return e.getFullYear()===a.getFullYear()&&e.getMonth()===a.getMonth()?e:a})})},[e]),{currentDate:t,internalSelectedDate:n,handleDateClick:(e,t=!1)=>{a(e,t),r(e),l(e)},handleClear:()=>{r(null),l(/* @__PURE__ */new Date),a(null)},handlePrevMonth:()=>{l(new Date(t.getFullYear(),t.getMonth()-1,1))},handleNextMonth:()=>{l(new Date(t.getFullYear(),t.getMonth()+1,1))},handlePrevYear:()=>{l(new Date(t.getFullYear()-1,t.getMonth(),1))},handleNextYear:()=>{l(new Date(t.getFullYear()+1,t.getMonth(),1))}}})({selectedDate:n,onDateSelect:A});return H&&e?E(/* @__PURE__ */x("div",{ref:C,className:"fixed z-50",children:/* @__PURE__ */x("dialog",{ref:g,className:Od({isVisible:a}),open:!0,children:/* @__PURE__ */x(Wm,{"data-selector":"card",overflow:"hidden",elevation:1,width:"360px",height:"auto",onClick:e=>{e.preventDefault(),e.stopPropagation()},borderRadius:"md",padding:"none",children:/* @__PURE__ */x(gh,{currentDate:b,selectedDate:w,locale:s,onDateClick:y,onPrevMonth:F,onNextMonth:N,onPrevYear:_,onNextYear:S,onClear:k,onOK:f,onCancel:M,maxDate:c,minDate:m,buttonTranslations:p})})})}),document.body):null},fh=new Set(["maxDate","minDate","setMaxDate","setMinDate","buttonsTranslations"]),Zh=()=>{const{label:e,onChange:a,name:t,innerValue:l,setInnerValue:n,isOpen:r,setIsOpen:i,uniqueId:o,openOnFocus:s,onFocus:c,onKeyDown:m,locale:d="de-DE",closeOnSelect:p=!1,placeholder:H,...C}=Bd(),g=Z(d),[V,f]=v(""),[A,w]=v(!1),{addMaskBasedOnLocale:E,formatFromStringToDate:L,getFormattedDate:y,getMaxLength:k,getPlaceholder:F}=Ud(d),N=()=>{f(l),i(!0),requestAnimationFrame(()=>{w(!0)})},_=()=>{w(!1),setTimeout(()=>{i(!1)},200)},S=h(e=>{if(e){const l=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())).toISOString().split("T")[0],r=y(l);n(r),a?.({target:{value:r,name:t}},e)}else n(""),a?.({target:{value:"",name:t}})},[a,t,n,y]),I=(()=>{if(!l)return null;const e=L(l);return Number.isNaN(e.getTime())?null:e})();return u(()=>{if(d!==g.current&&l){const e=L(y(L(l,g.current).toISOString()),d);S(Number.isNaN(e.getTime())?null:e),g.current=d}else d!==g.current&&(g.current=d)},[d,l,S,L,y]),/* @__PURE__ */b(M,{children:[/* @__PURE__ */x(FC,{...Object.keys(C).filter(e=>!fh.has(e)).reduce((e,a)=>({...e,[a]:C[a]}),{}),maxLength:k(),label:e,type:"text",value:l,icon:"calendar",onIconClick:N,iconPosition:"right",placeholder:H??F(),onChange:e=>{const{value:l}=e.target,r=E(l)??"";let i,o=!1;n(r),a?.({target:{value:r,name:t}}),r.length===k()&&(i=L(r),i&&!Number.isNaN(i.getTime())&&(S(i),o=!0)),a?.({target:{value:r,name:t}},o?i:void 0)},name:t,id:t,"data-selector":`${t}-${o}`,isFocused:r,onFocus:e=>{e.preventDefault(),c?.(e),s&&N()},onKeyDown:e=>{m?.(e),/[\d./-]/.test(e.key)||["Backspace","Delete","ArrowLeft","ArrowRight","Tab"].includes(e.key)||e.preventDefault()}}),/* @__PURE__ */x(Vh,{isOpen:r,isVisible:A,onClose:_,onDateSelect:S,selectedDate:I,inputSelector:`${t}-${o}`,onCancel:()=>{const e=L(V);S(Number.isNaN(e.getTime())?null:e),_()},closeOnSelect:p})]})},vh=e=>/* @__PURE__ */x(Rd,{...e,children:/* @__PURE__ */x(Zh,{})}),Ah=Ja({base:["fixed","inset-none","transition-opacity","duration-500","bg-scrim/50"],variants:{show:{true:["opacity-100"],false:["opacity-0","pointer-events-none"]}}}),Mh=({show:e,onClick:a,className:t,children:l,zIndex:n=20})=>/* @__PURE__ */x("div",{className:Ah({show:e,className:t}),onClick:a,role:"presentation","aria-hidden":"true",style:{zIndex:n},children:l});Mh.displayName="Backdrop";var xh=Ja({base:["transition-all","duration-500","w-full","mx-[40px]","max-h-[90vh]","overflow-hidden"],variants:{size:{sm:["max-w-[320px]"],md:["max-w-[560px]"],lg:["max-w-[1200px]"],fullscreen:["w-dvw!","h-dvh!","max-w-dvw!","max-h-dvh!","mx-none!"],none:["w-fit"]},show:{true:["scale-100","opacity-100"],false:["scale-90","opacity-0"]}},defaultVariants:{size:"none"}}),bh=(Ja({base:["max-h-[90vh]","overflow-y-auto"]}),new class{dialogStack=[];closeCallbacks=/* @__PURE__ */new Map;registerOpenDialog(e,a){this.dialogStack.includes(e)||this.dialogStack.push(e),this.closeCallbacks.set(e,a)}unregisterOpenDialog(e){const a=this.dialogStack.indexOf(e);-1!==a&&this.dialogStack.splice(a,1),this.closeCallbacks.delete(e)}closeOtherDialogs(e){[...this.dialogStack].forEach(a=>{if(a!==e){const e=this.closeCallbacks.get(a);e&&(e(),this.unregisterOpenDialog(a))}})}isTopDialog(e){return this.dialogStack.length>0&&this.dialogStack.at(-1)===e}hasOpenDialogs(){return this.dialogStack.length>0}getOpenDialogs(){return[...this.dialogStack]}clear(){this.dialogStack.length=0,this.closeCallbacks.clear()}}),wh=new class{openMenus=/* @__PURE__ */new Set;closeCallbacks=/* @__PURE__ */new Map;registerOpenMenu(e,a){this.openMenus.add(e),this.closeCallbacks.set(e,a)}unregisterOpenMenu(e){this.openMenus.delete(e),this.closeCallbacks.delete(e)}closeOtherMenus(e){this.openMenus.forEach(a=>{if(a!==e){const e=this.closeCallbacks.get(a);e&&(e(),this.unregisterOpenMenu(a))}})}hasOpenMenus(){return this.openMenus.size>0}getOpenMenus(){return Array.from(this.openMenus)}clear(){this.openMenus.clear(),this.closeCallbacks.clear()}},Eh=new class{openSelects=/* @__PURE__ */new Set;closeCallbacks=/* @__PURE__ */new Map;registerOpenSelect(e,a){this.openSelects.add(e),this.closeCallbacks.set(e,a)}unregisterOpenSelect(e){this.openSelects.delete(e),this.closeCallbacks.delete(e)}closeOtherSelects(e){this.openSelects.forEach(a=>{if(a!==e){const e=this.closeCallbacks.get(a);e&&(e(),this.unregisterOpenSelect(a))}})}hasOpenSelects(){return this.openSelects.size>0}getOpenSelects(){return Array.from(this.openSelects)}clear(){this.openSelects.clear(),this.closeCallbacks.clear()}},Lh=new class{openSheets=/* @__PURE__ */new Set;closeCallbacks=/* @__PURE__ */new Map;registerOpenSheet(e,a){this.openSheets.add(e),this.closeCallbacks.set(e,a)}unregisterOpenSheet(e){this.openSheets.delete(e),this.closeCallbacks.delete(e)}closeOtherSheets(e){this.openSheets.forEach(a=>{if(a!==e){const e=this.closeCallbacks.get(a);e&&(e(),this.unregisterOpenSheet(a))}})}hasOpenSheets(){return this.openSheets.size>0}getOpenSheets(){return Array.from(this.openSheets)}clear(){this.openSheets.clear(),this.closeCallbacks.clear()}},yh=({open:e,onClose:a,children:t,closeOnBackdropClick:l=!0,closeOnEsc:n=!1,padding:r="lg",size:i,zIndex:o=20})=>{const s=H(),c=Z(null),{mounted:m,show:h,setShow:p}=(e=>{const[a,t]=v(!1),[l,n]=v(!1);return g(()=>{e&&d(()=>{t(!0)})},[e]),u(()=>(e?(document.body.style.overflow="hidden",setTimeout(()=>{d(()=>{n(!0)})},100)):(d(()=>{n(!1)}),document.body.style.overflow=""),()=>{document.body.style.overflow=""}),[e]),u(()=>{if(!l&&a){const e=setTimeout(()=>t(!1),500);return()=>clearTimeout(e)}},[l,a]),{mounted:a,show:l,setShow:n}})(e),C=gm(i)??"none";Kc(!i,`@Dialog: Please use the prop ${Yc("red","size")}. In version ${Yc("red","^3.0.0")} the default size will be ${Yc("red","sm")} and ${Yc("red","none")} will be deprecated`),((e,a,t)=>{u(()=>{const l=l=>{a&&"Escape"===l.key&&bh.isTopDialog(t)&&(wh.hasOpenMenus()||Eh.hasOpenSelects()||Lh.hasOpenSheets()||e())};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[e,a,t])})(a,n,s),((e,a,t)=>{u(()=>{if(!a||!e.current)return;const l=a=>{if("Tab"!==a.key)return;if(!bh.isTopDialog(t))return;const l=document.activeElement;if(l.closest('[role="menu"]'))return;if(l.closest("dialog")||document.querySelector("dialog[open]"))return;const n=e.current?.querySelectorAll(ae);if(!n?.length)return;const r=n[0],i=n[n.length-1];if(!e.current?.contains(l))return a.preventDefault(),void r.focus();a.shiftKey&&l===r?(a.preventDefault(),i.focus()):a.shiftKey||l!==i||(a.preventDefault(),r.focus())};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[a,e,t])})(c,m,s),u(()=>{if(m&&e)return bh.registerOpenDialog(s,a),()=>{bh.unregisterOpenDialog(s)}},[m,e,s,a]);return m?w.createPortal(/* @__PURE__ */x(Mh,{show:h,onClick:()=>{l&&(p(!1),setTimeout(()=>a(),500))},className:"flex items-center justify-center",zIndex:o,children:/* @__PURE__ */x("div",{onClick:e=>e.stopPropagation(),ref:c,className:xh({show:h,size:C}),role:"dialog","aria-modal":"true","aria-label":"Dialog",children:/* @__PURE__ */x(Wm,{padding:r,overflow:"y-auto",maxHeight:"fullscreen"===C?"100vh":"90vh",maxWidth:"fullscreen"===C?"100vw":"auto",height:"fullscreen"===C?"100vh":"auto",width:"fullscreen"===C?"100vw":"auto",borderRadius:"fullscreen"===C?"none":"md",children:t})})}),document.body):null},kh=Ja({base:["border-outline-variant"],variants:{variant:{fullWidth:["w-full","m-none"],inset:["ml-md"],middle:["mx-md"]}}}),Fh=({variant:e="fullWidth",color:a="outline-variant"})=>/* @__PURE__ */x("hr",{className:kh({variant:e}),style:{borderColor:`var(--color-${a})`}}),Nh=Ja({base:["w-full","max-w-[640px]","mx-md","bg-surface-container-lowest","rounded-lg","shadow-elevation3","overflow-hidden","transition-all","duration-500"],variants:{show:{true:["scale-100","opacity-100"],false:["scale-90","opacity-0"]}}}),_h=Ja({base:["flex","items-center","gap-sm","p-md","border-b","border-transparent"],variants:{hasResults:{true:["border-outline-variant"]}}}),Sh=Ja({base:["flex-1","bg-transparent","outline-none","text-body-medium","text-on-surface","placeholder:text-on-surface-variant-lowest","caret-primary"]}),Ih=Ja({base:["overflow-y-auto","max-h-[420px]"]}),Dh=Ja({base:["w-full","flex","items-center","gap-sm","px-md","py-sm","cursor-pointer","transition-colors","duration-150","text-left","bg-transparent","border-none","outline-none"],variants:{active:{true:["bg-surface-container"],false:["hover:bg-surface-container-low"]}},defaultVariants:{active:!1}}),Th=Ja({base:["text-label-small","text-on-surface-variant-lowest","shrink-0"]}),Oh=Ja({base:["flex","items-center","gap-md","px-md","py-sm","border-t","border-outline-variant","bg-surface-container-low"]}),zh=(Ja({base:["flex","items-center","gap-xs","text-label-small","text-on-surface-variant"]}),Ja({base:["flex","items-center","gap-sm","px-md","py-sm"]})),Rh=["60%","75%","50%","80%","45%","65%"],Bh={placeholder:"Chats und Projekte durchsuchen",clearAriaLabel:"Suche zurücksetzen",closeAriaLabel:"Suche schließen",noResults:"Keine Ergebnisse gefunden",navigate:"navigieren",open:"öffnen",close:"schließen"},Uh=({open:e,onClose:a,items:t=[],onSearch:l,onSelect:n,value:r,placeholder:i,translations:o,zIndex:s=20,loading:c=!1,linkComponent:m="button"})=>{const h={...Bh,...o},p=i??h.placeholder,H=void 0!==r,[C,V]=v(""),f=H?r:C,[A,M]=v(-1),E=Z(null),L=Z(null),{mounted:y,show:k,setShow:F}=(e=>{const[a,t]=v(!1),[l,n]=v(!1);return g(()=>{e&&d(()=>t(!0))},[e]),u(()=>(e?(document.body.style.overflow="hidden",setTimeout(()=>d(()=>n(!0)),100)):(d(()=>n(!1)),document.body.style.overflow=""),()=>{document.body.style.overflow=""}),[e]),u(()=>{if(!l&&a){const e=setTimeout(()=>t(!1),500);return()=>clearTimeout(e)}},[l,a]),{mounted:a,show:l,setShow:n}})(e);u(()=>{e&&(d(()=>{M(-1),H||V("")}),setTimeout(()=>E.current?.focus(),50))},[e,H]),u(()=>{A<0||(L.current?.querySelector(`#float-search-item-${A}`))?.scrollIntoView?.({block:"nearest"})},[A]);const N=()=>{F(!1),setTimeout(()=>a(),500)},_=e=>{n?.(e),N()};return y?w.createPortal(/* @__PURE__ */x(Mh,{show:k,onClick:N,className:"flex items-center justify-center",zIndex:s,children:/* @__PURE__ */b("div",{className:Nh({show:k}),onClick:e=>e.stopPropagation(),children:[
|
|
657
|
+
/* @__PURE__ */x(ph,{isSelectorOpen:C||V,onCancel:H,onClear:d,onOK:p,cancelText:Gd(t,"cancel",q),clearText:Gd(t,"clear",q),okText:l?.ok??"OK"})]})},Vh=({isOpen:e=!1,isVisible:a=!1,onClose:t,onDateSelect:l,selectedDate:n,inputSelector:r,onCancel:i,closeOnSelect:o=!1})=>{const{locale:s,maxDate:c,minDate:m,buttonsTranslations:p}=Bd(),H=void 0!==globalThis.window,C=Z(null),g=Z(null),V=Z(null),f=h(()=>{t()},[t]),A=h((e,a=!1)=>{l(e),o&&a&&f()},[l,o,f]),M=h(()=>{i()},[i]);u(()=>{e&&(V.current=document.querySelector(`input[data-selector="${r}"]`))},[e,r]),L([g,V],f,e),((e,a,t,l)=>{u(()=>{if(!a||!e?.current)return;const t=e.current,n=t.querySelectorAll('[data-focusable="true"]');if(!n?.length)return;const r=Array.from(n),i=t.querySelector('[data-container="days"]'),o=t.querySelector('[data-container="actions"]'),s=t.querySelector('[data-month-nav-direction="prev"]'),c=t.querySelector('[data-month-nav-direction="next"]'),m=[],d=[],h=[];r.forEach(e=>{o?.contains(e)?h.push(e):i?.contains(e)?d.push(e):m.push(e)});const p=m[0]||r[0],u=h[h.length-1]||r[r.length-1],H=t.querySelectorAll('a, button, input, select, textarea, [tabindex]:not([tabindex="-1"])');H&&Array.from(H).forEach(e=>{e.hasAttribute("data-focusable")||e.setAttribute("tabindex","-1")});const C=document.activeElement;C&&"INPUT"===C.tagName||setTimeout(()=>{const e=t.querySelector('[data-selected="true"][data-month="current"]'),a=t.querySelector('[data-today="true"][data-month="current"]'),l=Array.from(t.querySelectorAll('[data-month="current"][data-focusable="true"]'));e?.hasAttribute("data-focusable")?e.focus():a?.hasAttribute("data-focusable")?a.focus():l.length>0?l[0].focus():p&&p.focus()},50);const g=e=>{if("INPUT"!==document.activeElement?.tagName){if("Escape"===e.key)return e.preventDefault(),void l();if("Tab"===e.key||e.key.startsWith("Arrow")){if("Tab"===e.key){const a=document.activeElement,l=a?.hasAttribute("data-selected"),n=a?.hasAttribute("data-today"),r=l||n||a?.hasAttribute("data-month");if(!e.shiftKey&&(l||n))return e.preventDefault(),void(h.length>0?h[0].focus():p?.focus());if(e.shiftKey&&r)return e.preventDefault(),void(m.length>0?m[m.length-1].focus():u?.focus());const i=m.includes(a),o=d.includes(a),s=h.includes(a);let c=-1;if(i?c=m.indexOf(a):o?c=d.indexOf(a):s&&(c=h.indexOf(a)),-1===c&&!i&&!o&&!s){if(e.preventDefault(),e.shiftKey)u?.focus();else{const e=Array.from(t.querySelectorAll('[data-month="current"][data-focusable="true"]'));e.length>0?e[0].focus():p?.focus()}return}if(e.shiftKey){if(i&&0===c)e.preventDefault(),u?.focus();else if(o&&0===c)e.preventDefault(),m.length>0?m[m.length-1].focus():u?.focus();else if(s&&0===c){e.preventDefault();const a=t.querySelector('[data-selected="true"][data-month="current"]'),l=t.querySelector('[data-today="true"][data-month="current"]'),n=Array.from(t.querySelectorAll('[data-month="current"][data-focusable="true"]'));a?.hasAttribute("data-focusable")?a.focus():l?.hasAttribute("data-focusable")?l.focus():n.length>0?n[n.length-1].focus():m.length>0&&m[m.length-1].focus()}}else if(i&&c===m.length-1){e.preventDefault();const a=t.querySelector('[data-selected="true"][data-month="current"]'),l=t.querySelector('[data-today="true"][data-month="current"]'),n=Array.from(t.querySelectorAll('[data-month="current"][data-focusable="true"]'));a?.hasAttribute("data-focusable")?a.focus():l?.hasAttribute("data-focusable")?l.focus():n.length>0?n[0].focus():h.length>0&&h[0].focus()}else o&&c===d.length-1?(e.preventDefault(),h.length>0?h[0].focus():p?.focus()):s&&c===h.length-1&&(e.preventDefault(),p?.focus());return}const a=document.activeElement;if(a?.hasAttribute("data-month")&&("ArrowUp"===e.key||"ArrowDown"===e.key||"ArrowLeft"===e.key||"ArrowRight"===e.key)){e.preventDefault();const l=Array.from(t.querySelectorAll('[data-month="current"][data-focusable="true"]')||[]);if(!l.length)return;const n=l.findIndex(e=>e===a);if(-1===n)return;const r=7;let i=n;switch(e.key){case"ArrowUp":i=n-r;break;case"ArrowDown":i=n+r;break;case"ArrowLeft":i=n-1;break;case"ArrowRight":i=n+1}i<0||i>=l.length?i<0&&s?(s.dispatchEvent(new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0})),setTimeout(()=>{const e=t.querySelectorAll('[data-month="current"][data-focusable="true"]');e?.length&&e[e.length-1].focus()},550)):i>=l.length&&c&&(c.dispatchEvent(new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0})),setTimeout(()=>{const e=t.querySelectorAll('[data-month="current"][data-focusable="true"]');e?.length&&e[0].focus()},550)):l[i].focus()}}}};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[e,a,t,l])})(C,e,n,f),(({isOpen:e,portalRef:a,inputSelector:t})=>{const l=h(()=>{if(!a.current)return;const e=document.querySelector(`input[data-selector="${t}"]`);if(!e)return;const l=e.getBoundingClientRect(),n=a.current,r=document.documentElement.clientHeight,i=r-l.bottom,o=a.current?.querySelector('[data-selector="card"]');o.style.position="absolute",o.style.bottom="",n.style.top="",n.style.bottom="",i<412?(o.style.bottom="0px",n.style.bottom=r-l.top+12+"px"):n.style.top=`${l.bottom+12}px`,n.style.left=`${l.left}px`},[t,a]);u(()=>{if(e)return l(),window.addEventListener("scroll",l,!0),window.addEventListener("resize",l),()=>{window.removeEventListener("scroll",l,!0),window.removeEventListener("resize",l)}},[e,l])})({isOpen:e,portalRef:C,inputSelector:r});const{currentDate:b,internalSelectedDate:w,handleDateClick:y,handleClear:k,handlePrevMonth:F,handleNextMonth:N,handlePrevYear:_,handleNextYear:S}=(({selectedDate:e,onDateSelect:a})=>{const[t,l]=v(()=>!e||Number.isNaN(e.getTime())?/* @__PURE__ */new Date:e),[n,r]=v(e);return u(()=>{d(()=>{r(a=>a===e||a&&e&&a.getTime()===e.getTime()?a:a||e?e:a),e&&!Number.isNaN(e.getTime())?l(a=>a.getTime()===e.getTime()?a:e):e||l(e=>{const a=/* @__PURE__ */new Date;return e.getFullYear()===a.getFullYear()&&e.getMonth()===a.getMonth()?e:a})})},[e]),{currentDate:t,internalSelectedDate:n,handleDateClick:(e,t=!1)=>{a(e,t),r(e),l(e)},handleClear:()=>{r(null),l(/* @__PURE__ */new Date),a(null)},handlePrevMonth:()=>{l(new Date(t.getFullYear(),t.getMonth()-1,1))},handleNextMonth:()=>{l(new Date(t.getFullYear(),t.getMonth()+1,1))},handlePrevYear:()=>{l(new Date(t.getFullYear()-1,t.getMonth(),1))},handleNextYear:()=>{l(new Date(t.getFullYear()+1,t.getMonth(),1))}}})({selectedDate:n,onDateSelect:A});return H&&e?E(/* @__PURE__ */x("div",{ref:C,className:"fixed z-50",children:/* @__PURE__ */x("dialog",{ref:g,className:Od({isVisible:a}),open:!0,children:/* @__PURE__ */x(Wm,{"data-selector":"card",overflow:"hidden",elevation:1,width:"360px",height:"auto",onClick:e=>{e.preventDefault(),e.stopPropagation()},borderRadius:"md",padding:"none",interactive:!1,children:/* @__PURE__ */x(gh,{currentDate:b,selectedDate:w,locale:s,onDateClick:y,onPrevMonth:F,onNextMonth:N,onPrevYear:_,onNextYear:S,onClear:k,onOK:f,onCancel:M,maxDate:c,minDate:m,buttonTranslations:p})})})}),document.body):null},fh=new Set(["maxDate","minDate","setMaxDate","setMinDate","buttonsTranslations"]),Zh=()=>{const{label:e,onChange:a,name:t,innerValue:l,setInnerValue:n,isOpen:r,setIsOpen:i,uniqueId:o,openOnFocus:s,onFocus:c,onKeyDown:m,locale:d="de-DE",closeOnSelect:p=!1,placeholder:H,...C}=Bd(),g=Z(d),[V,f]=v(""),[A,w]=v(!1),{addMaskBasedOnLocale:E,formatFromStringToDate:L,getFormattedDate:y,getMaxLength:k,getPlaceholder:F}=Ud(d),N=()=>{f(l),i(!0),requestAnimationFrame(()=>{w(!0)})},_=()=>{w(!1),setTimeout(()=>{i(!1)},200)},S=h(e=>{if(e){const l=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())).toISOString().split("T")[0],r=y(l);n(r),a?.({target:{value:r,name:t}},e)}else n(""),a?.({target:{value:"",name:t}})},[a,t,n,y]),I=(()=>{if(!l)return null;const e=L(l);return Number.isNaN(e.getTime())?null:e})();return u(()=>{if(d!==g.current&&l){const e=L(y(L(l,g.current).toISOString()),d);S(Number.isNaN(e.getTime())?null:e),g.current=d}else d!==g.current&&(g.current=d)},[d,l,S,L,y]),/* @__PURE__ */b(M,{children:[/* @__PURE__ */x(FC,{...Object.keys(C).filter(e=>!fh.has(e)).reduce((e,a)=>({...e,[a]:C[a]}),{}),maxLength:k(),label:e,type:"text",value:l,icon:"calendar",onIconClick:N,iconPosition:"right",placeholder:H??F(),onChange:e=>{const{value:l}=e.target,r=E(l)??"";let i,o=!1;n(r),a?.({target:{value:r,name:t}}),r.length===k()&&(i=L(r),i&&!Number.isNaN(i.getTime())&&(S(i),o=!0)),a?.({target:{value:r,name:t}},o?i:void 0)},name:t,id:t,"data-selector":`${t}-${o}`,isFocused:r,onFocus:e=>{e.preventDefault(),c?.(e),s&&N()},onKeyDown:e=>{m?.(e),/[\d./-]/.test(e.key)||["Backspace","Delete","ArrowLeft","ArrowRight","Tab"].includes(e.key)||e.preventDefault()}}),/* @__PURE__ */x(Vh,{isOpen:r,isVisible:A,onClose:_,onDateSelect:S,selectedDate:I,inputSelector:`${t}-${o}`,onCancel:()=>{const e=L(V);S(Number.isNaN(e.getTime())?null:e),_()},closeOnSelect:p})]})},vh=e=>/* @__PURE__ */x(Rd,{...e,children:/* @__PURE__ */x(Zh,{})}),Ah=Ja({base:["fixed","inset-none","transition-opacity","duration-500","bg-scrim/50"],variants:{show:{true:["opacity-100"],false:["opacity-0","pointer-events-none"]}}}),Mh=({show:e,onClick:a,className:t,children:l,zIndex:n=20})=>/* @__PURE__ */x("div",{className:Ah({show:e,className:t}),onClick:a,role:"presentation","aria-hidden":"true",style:{zIndex:n},children:l});Mh.displayName="Backdrop";var xh=Ja({base:["transition-all","duration-500","w-full","mx-[40px]","max-h-[90vh]","overflow-hidden"],variants:{size:{sm:["max-w-[320px]"],md:["max-w-[560px]"],lg:["max-w-[1200px]"],fullscreen:["w-dvw!","h-dvh!","max-w-dvw!","max-h-dvh!","mx-none!"],none:["w-fit"]},show:{true:["scale-100","opacity-100"],false:["scale-90","opacity-0"]}},defaultVariants:{size:"none"}}),bh=(Ja({base:["max-h-[90vh]","overflow-y-auto"]}),new class{dialogStack=[];closeCallbacks=/* @__PURE__ */new Map;registerOpenDialog(e,a){this.dialogStack.includes(e)||this.dialogStack.push(e),this.closeCallbacks.set(e,a)}unregisterOpenDialog(e){const a=this.dialogStack.indexOf(e);-1!==a&&this.dialogStack.splice(a,1),this.closeCallbacks.delete(e)}closeOtherDialogs(e){[...this.dialogStack].forEach(a=>{if(a!==e){const e=this.closeCallbacks.get(a);e&&(e(),this.unregisterOpenDialog(a))}})}isTopDialog(e){return this.dialogStack.length>0&&this.dialogStack.at(-1)===e}hasOpenDialogs(){return this.dialogStack.length>0}getOpenDialogs(){return[...this.dialogStack]}clear(){this.dialogStack.length=0,this.closeCallbacks.clear()}}),wh=new class{openMenus=/* @__PURE__ */new Set;closeCallbacks=/* @__PURE__ */new Map;registerOpenMenu(e,a){this.openMenus.add(e),this.closeCallbacks.set(e,a)}unregisterOpenMenu(e){this.openMenus.delete(e),this.closeCallbacks.delete(e)}closeOtherMenus(e){this.openMenus.forEach(a=>{if(a!==e){const e=this.closeCallbacks.get(a);e&&(e(),this.unregisterOpenMenu(a))}})}hasOpenMenus(){return this.openMenus.size>0}getOpenMenus(){return Array.from(this.openMenus)}clear(){this.openMenus.clear(),this.closeCallbacks.clear()}},Eh=new class{openSelects=/* @__PURE__ */new Set;closeCallbacks=/* @__PURE__ */new Map;registerOpenSelect(e,a){this.openSelects.add(e),this.closeCallbacks.set(e,a)}unregisterOpenSelect(e){this.openSelects.delete(e),this.closeCallbacks.delete(e)}closeOtherSelects(e){this.openSelects.forEach(a=>{if(a!==e){const e=this.closeCallbacks.get(a);e&&(e(),this.unregisterOpenSelect(a))}})}hasOpenSelects(){return this.openSelects.size>0}getOpenSelects(){return Array.from(this.openSelects)}clear(){this.openSelects.clear(),this.closeCallbacks.clear()}},Lh=new class{openSheets=/* @__PURE__ */new Set;closeCallbacks=/* @__PURE__ */new Map;registerOpenSheet(e,a){this.openSheets.add(e),this.closeCallbacks.set(e,a)}unregisterOpenSheet(e){this.openSheets.delete(e),this.closeCallbacks.delete(e)}closeOtherSheets(e){this.openSheets.forEach(a=>{if(a!==e){const e=this.closeCallbacks.get(a);e&&(e(),this.unregisterOpenSheet(a))}})}hasOpenSheets(){return this.openSheets.size>0}getOpenSheets(){return Array.from(this.openSheets)}clear(){this.openSheets.clear(),this.closeCallbacks.clear()}},yh=({open:e,onClose:a,children:t,closeOnBackdropClick:l=!0,closeOnEsc:n=!1,padding:r="lg",size:i,zIndex:o=20})=>{const s=H(),c=Z(null),{mounted:m,show:h,setShow:p}=(e=>{const[a,t]=v(!1),[l,n]=v(!1);return g(()=>{e&&d(()=>{t(!0)})},[e]),u(()=>(e?(document.body.style.overflow="hidden",setTimeout(()=>{d(()=>{n(!0)})},100)):(d(()=>{n(!1)}),document.body.style.overflow=""),()=>{document.body.style.overflow=""}),[e]),u(()=>{if(!l&&a){const e=setTimeout(()=>t(!1),500);return()=>clearTimeout(e)}},[l,a]),{mounted:a,show:l,setShow:n}})(e),C=gm(i)??"none";Kc(!i,`@Dialog: Please use the prop ${Yc("red","size")}. In version ${Yc("red","^3.0.0")} the default size will be ${Yc("red","sm")} and ${Yc("red","none")} will be deprecated`),((e,a,t)=>{u(()=>{const l=l=>{a&&"Escape"===l.key&&bh.isTopDialog(t)&&(wh.hasOpenMenus()||Eh.hasOpenSelects()||Lh.hasOpenSheets()||e())};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[e,a,t])})(a,n,s),((e,a,t)=>{u(()=>{if(!a||!e.current)return;const l=a=>{if("Tab"!==a.key)return;if(!bh.isTopDialog(t))return;const l=document.activeElement;if(l.closest('[role="menu"]'))return;if(l.closest("dialog")||document.querySelector("dialog[open]"))return;const n=e.current?.querySelectorAll(ae);if(!n?.length)return;const r=n[0],i=n[n.length-1];if(!e.current?.contains(l))return a.preventDefault(),void r.focus();a.shiftKey&&l===r?(a.preventDefault(),i.focus()):a.shiftKey||l!==i||(a.preventDefault(),r.focus())};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[a,e,t])})(c,m,s),u(()=>{if(m&&e)return bh.registerOpenDialog(s,a),()=>{bh.unregisterOpenDialog(s)}},[m,e,s,a]);return m?w.createPortal(/* @__PURE__ */x(Mh,{show:h,onClick:()=>{l&&(p(!1),setTimeout(()=>a(),500))},className:"flex items-center justify-center",zIndex:o,children:/* @__PURE__ */x("div",{onClick:e=>e.stopPropagation(),ref:c,className:xh({show:h,size:C}),role:"dialog","aria-modal":"true","aria-label":"Dialog",children:/* @__PURE__ */x(Wm,{padding:r,overflow:"y-auto",maxHeight:"fullscreen"===C?"100vh":"90vh",maxWidth:"fullscreen"===C?"100vw":"auto",height:"fullscreen"===C?"100vh":"auto",width:"fullscreen"===C?"100vw":"auto",borderRadius:"fullscreen"===C?"none":"md",children:t})})}),document.body):null},kh=Ja({base:["border-outline-variant"],variants:{variant:{fullWidth:["w-full","m-none"],inset:["ml-md"],middle:["mx-md"]}}}),Fh=({variant:e="fullWidth",color:a="outline-variant"})=>/* @__PURE__ */x("hr",{className:kh({variant:e}),style:{borderColor:`var(--color-${a})`}}),Nh=Ja({base:["w-full","max-w-[640px]","mx-md","bg-surface-container-lowest","rounded-lg","shadow-elevation3","overflow-hidden","transition-all","duration-500"],variants:{show:{true:["scale-100","opacity-100"],false:["scale-90","opacity-0"]}}}),_h=Ja({base:["flex","items-center","gap-sm","p-md","border-b","border-transparent"],variants:{hasResults:{true:["border-outline-variant"]}}}),Sh=Ja({base:["flex-1","bg-transparent","outline-none","text-body-medium","text-on-surface","placeholder:text-on-surface-variant-lowest","caret-primary"]}),Ih=Ja({base:["overflow-y-auto","max-h-[420px]"]}),Dh=Ja({base:["w-full","flex","items-center","gap-sm","px-md","py-sm","cursor-pointer","transition-colors","duration-150","text-left","bg-transparent","border-none","outline-none"],variants:{active:{true:["bg-surface-container"],false:["hover:bg-surface-container-low"]}},defaultVariants:{active:!1}}),Th=Ja({base:["text-label-small","text-on-surface-variant-lowest","shrink-0"]}),Oh=Ja({base:["flex","items-center","gap-md","px-md","py-sm","border-t","border-outline-variant","bg-surface-container-low"]}),zh=(Ja({base:["flex","items-center","gap-xs","text-label-small","text-on-surface-variant"]}),Ja({base:["flex","items-center","gap-sm","px-md","py-sm"]})),Rh=["60%","75%","50%","80%","45%","65%"],Bh={placeholder:"Chats und Projekte durchsuchen",clearAriaLabel:"Suche zurücksetzen",closeAriaLabel:"Suche schließen",noResults:"Keine Ergebnisse gefunden",navigate:"navigieren",open:"öffnen",close:"schließen"},Uh=({open:e,onClose:a,items:t=[],onSearch:l,onSelect:n,value:r,placeholder:i,translations:o,zIndex:s=20,loading:c=!1,linkComponent:m="button"})=>{const h={...Bh,...o},p=i??h.placeholder,H=void 0!==r,[C,V]=v(""),f=H?r:C,[A,M]=v(-1),E=Z(null),L=Z(null),{mounted:y,show:k,setShow:F}=(e=>{const[a,t]=v(!1),[l,n]=v(!1);return g(()=>{e&&d(()=>t(!0))},[e]),u(()=>(e?(document.body.style.overflow="hidden",setTimeout(()=>d(()=>n(!0)),100)):(d(()=>n(!1)),document.body.style.overflow=""),()=>{document.body.style.overflow=""}),[e]),u(()=>{if(!l&&a){const e=setTimeout(()=>t(!1),500);return()=>clearTimeout(e)}},[l,a]),{mounted:a,show:l,setShow:n}})(e);u(()=>{e&&(d(()=>{M(-1),H||V("")}),setTimeout(()=>E.current?.focus(),50))},[e,H]),u(()=>{A<0||(L.current?.querySelector(`#float-search-item-${A}`))?.scrollIntoView?.({block:"nearest"})},[A]);const N=()=>{F(!1),setTimeout(()=>a(),500)},_=e=>{n?.(e),N()};return y?w.createPortal(/* @__PURE__ */x(Mh,{show:k,onClick:N,className:"flex items-center justify-center",zIndex:s,children:/* @__PURE__ */b("div",{className:Nh({show:k}),onClick:e=>e.stopPropagation(),children:[
|
|
658
658
|
/* @__PURE__ */b("div",{className:_h({hasResults:c||t.length>0||!!f}),children:[
|
|
659
659
|
/* @__PURE__ */x(wd,{name:"search",size:"sm",color:"on-surface-variant"}),
|
|
660
660
|
/* @__PURE__ */x("input",{ref:E,className:Sh(),value:f,onChange:e=>{const a=e.target.value;H||V(a),l?.(a),M(-1)},onKeyDown:e=>{"Escape"!==e.key?"ArrowDown"===e.key?(e.preventDefault(),M(e=>Math.min(e+1,t.length-1))):"ArrowUp"===e.key?(e.preventDefault(),M(e=>Math.max(e-1,-1))):"Enter"===e.key&&A>=0&&t[A]&&(e.preventDefault(),_(t[A])):N()},placeholder:p,role:"combobox","aria-expanded":t.length>0,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":"float-search-list","aria-activedescendant":A>=0?`float-search-item-${A}`:void 0,autoComplete:"off"}),f&&/* @__PURE__ */x("button",{onClick:()=>{H||V(""),l?.(""),M(-1),E.current?.focus()},"aria-label":h.clearAriaLabel,className:"text-on-surface-variant hover:text-on-surface transition-colors duration-150",children:/* @__PURE__ */x(wd,{name:"close",size:"sm",color:"on-surface-variant"})}),!f&&/* @__PURE__ */x("button",{onClick:N,"aria-label":h.closeAriaLabel,className:"text-on-surface-variant hover:text-on-surface transition-colors duration-150",children:/* @__PURE__ */x(wd,{name:"close",size:"sm",color:"on-surface-variant"})})]}),c&&/* @__PURE__ */x("div",{className:Ih(),children:Array.from({length:6}).map((e,a)=>/* @__PURE__ */b("div",{className:zh(),children:[/* @__PURE__ */x(IH,{width:20,height:20,borderRadius:"xs"}),/* @__PURE__ */x(IH,{width:Rh[a],height:16,borderRadius:"xs"})]},`skeleton-search-row-${a}`))}),!c&&0===t.length&&f&&/* @__PURE__ */b(CH,{direction:"column",gap:"sm",align:"center",justify:"center",padding:"xl4",children:[/* @__PURE__ */x(wd,{name:"error",size:"lg",color:"on-surface-variant-lowest"}),/* @__PURE__ */x(_p,{variant:"body",size:"large",color:"on-surface-variant-lowest",children:h.noResults})]}),!c&&t.length>0&&/* @__PURE__ */x("div",{ref:L,id:"float-search-list",role:"listbox",className:Ih(),children:t.map((e,a)=>{const{id:t,label:l,type:n,meta:r,...i}=e;/* @__PURE__ */
|
|
@@ -662,9 +662,9 @@ return b(m,{id:`float-search-item-${a}`,...i,className:Dh({active:a===A}),onClic
|
|
|
662
662
|
/* @__PURE__ */b(CH,{direction:"row",gap:"xs",align:"center",width:"fit-content",children:[/* @__PURE__ */x(ZC,{label:"↑↓",variant:"outlined",color:"neutral",size:"small"}),/* @__PURE__ */x(_p,{variant:"label",size:"small",color:"on-surface-variant",children:h.navigate})]}),
|
|
663
663
|
/* @__PURE__ */b(CH,{direction:"row",gap:"xs",align:"center",width:"fit-content",children:[/* @__PURE__ */x(ZC,{label:"Enter",variant:"outlined",color:"neutral",size:"small"}),/* @__PURE__ */x(_p,{variant:"label",size:"small",color:"on-surface-variant",children:h.open})]}),
|
|
664
664
|
/* @__PURE__ */b(CH,{direction:"row",gap:"xs",align:"center",width:"fit-content",children:[/* @__PURE__ */x(ZC,{label:"Esc",variant:"outlined",color:"neutral",size:"small"}),/* @__PURE__ */x(_p,{variant:"label",size:"small",color:"on-surface-variant",children:h.close})]})]})})]})}),document.body):null};Uh.displayName="FloatSearch";var jh=({value:e,required:a=!1,htmlFor:t,...l})=>/* @__PURE__ */b("label",{...l,className:"flex space-xs",htmlFor:t,children:[/* @__PURE__ */x(_p,{as:"span",variant:"title",size:"medium",children:e}),a&&/* @__PURE__ */x(_p,{as:"span",variant:"title",size:"medium",color:"error",children:"*"})]}),Wh=Ja({base:["grid","w-full"],variants:{...ee,...j,...K}}),Ph=s(({children:e,padding:a="none",gap:t="none",margin:l="none",columns:n=1,rows:r=1,className:i,height:o,minHeight:s,maxHeight:c,width:m,minWidth:d,maxWidth:h,...p},u)=>{const H=gm(n),C=gm(r),g=gm(o),V=gm(s),f=gm(c),Z=gm(m),v=gm(d),A=gm(h);return Kc(!!i,"@Grid: className is not supported"),/* @__PURE__ */x("div",{ref:u,className:Wh({...Hm(a,l,t)}),...p,style:{gridTemplateColumns:"number"==typeof H?`repeat(${H}, 1fr)`:H,gridTemplateRows:"number"==typeof C?`repeat(${C}, 1fr)`:C,height:g,width:Z,minHeight:V,maxHeight:f,minWidth:v,maxWidth:A},children:e})});Ph.Item=s(({children:e,colSpan:a,rowSpan:t,className:l,...n},r)=>{const i=gm(a),o=gm(t);return Kc(!!l,"@Grid.Item: className is not supported"),/* @__PURE__ */x("div",{className:"flex",ref:r,...n,style:{gridColumn:i?`span ${i}`:void 0,gridRow:o?`span ${o}`:void 0},children:e})}),Ph.displayName="Grid";var $h=Ja({slots:{container:["relative","overflow-hidden","cursor-pointer","group"],image:["w-full","h-full","block","min-h-0"],overlay:["absolute","inset-none","bg-scrim/80","opacity-0","group-hover:opacity-100","transition-opacity","duration-300","ease-out","flex","items-center","justify-center"],iconWrapper:["scale-75","group-hover:scale-100","transition-transform","duration-300","ease-out"],closeButtonContainer:["absolute","top-none","right-none","p-lg"]},variants:{fitContent:{true:{container:["w-fit"],image:["w-auto","h-auto"]}},borderRadius:{none:{container:["rounded-none"]},sm:{container:["rounded-sm"]},md:{container:["rounded-md"]},lg:{container:["rounded-lg"]},xl:{container:["rounded-xl"]}},objectFit:{contain:{image:["object-contain"]},cover:{image:["object-cover"]},fill:{image:["object-fill"]},none:{image:["object-none"]},"scale-down":{image:["object-scale-down"]}}},defaultVariants:{borderRadius:"sm",objectFit:"cover"}}),Gh=({src:e,alt:a="",width:t,height:l,maxWidth:n,maxHeight:r,minWidth:i,minHeight:o,borderRadius:s="sm",objectFit:c="cover"})=>{const[m,d]=v(!1),h=gm(t),p=gm(l),u=gm(n),H=gm(r),C=gm(i),g=gm(o),{container:V,image:f,overlay:Z,iconWrapper:A,closeButtonContainer:w}=$h({borderRadius:s,objectFit:c,fitContent:void 0===t&&void 0===l});/* @__PURE__ */
|
|
665
|
-
return b(M,{children:[/* @__PURE__ */b("div",{className:V(),style:{width:h,height:p,maxWidth:u,maxHeight:H,minWidth:C,minHeight:g},role:"button",tabIndex:0,"aria-label":"Bild anzeigen",onClick:()=>d(!0),onKeyDown:e=>"Enter"===e.key&&d(!0),children:[/* @__PURE__ */x("img",{src:e,alt:a,className:f()}),/* @__PURE__ */x("div",{className:Z(),children:/* @__PURE__ */x("div",{className:A(),children:/* @__PURE__ */x(wd,{name:"search-plus",size:"xl",color:"on-scrim"})})})]}),/* @__PURE__ */b(yh,{open:m,onClose:()=>d(!1),size:"none",padding:"none",children:[/* @__PURE__ */x("div",{className:w(),children:/* @__PURE__ */x(Om,{icon:"close",size:"md",variant:"tonal",onClick:()=>d(!1),"aria-label":"Bildschirm schließen"})}),/* @__PURE__ */x("img",{src:e,alt:a,style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain",display:"block"}})]})]})};Gh.displayName="ImageVisualizer";var qh={default:{name:"info"},positive:{name:"check-circle",weight:"fill"},warning:{name:"warning"},error:{name:"error",weight:"fill"},subtle:{name:"info"},neutral:{name:"info"},outlined:{name:"info"}},Yh={default:"inverse-surface",positive:"green-container",warning:"yellow-container",error:"error-container",subtle:"steel-blue-container",neutral:"surface",outlined:"surface"},Xh={default:"inverse-on-surface",positive:"on-green-container",warning:"on-yellow-container",error:"on-error-container",subtle:"on-steel-blue-container",neutral:"on-surface",outlined:"on-surface"},Kh=({message:e,variant:a="default",icon:t,elevated:l=!0})=>/* @__PURE__ */x("div",{className:"w-full",children:/* @__PURE__ */x(Wm,{bgColor:Yh[a],elevation:l&&"outlined"!==a?1:0,borderRadius:"sm",padding:"sm",variant:"outlined"===a?"outlined":"filled",children:/* @__PURE__ */b(Ph,{columns:"auto 1fr",gap:"sm",children:[/* @__PURE__ */x(wd,{...t?"string"==typeof t?{name:t}:t:qh[a],color:Xh[a]}),/* @__PURE__ */x("div",{className:"flex items-center",children:/* @__PURE__ */x(_p,{color:Xh[a],children:e})})]})})});Kh.displayName="InfoBox";var Jh=Ja({slots:{list:["w-full","list-none","p-none","m-none"],itemWrapper:["w-full","
|
|
666
|
-
return x("ul",{className:
|
|
667
|
-
return b("li",{className:
|
|
665
|
+
return b(M,{children:[/* @__PURE__ */b("div",{className:V(),style:{width:h,height:p,maxWidth:u,maxHeight:H,minWidth:C,minHeight:g},role:"button",tabIndex:0,"aria-label":"Bild anzeigen",onClick:()=>d(!0),onKeyDown:e=>"Enter"===e.key&&d(!0),children:[/* @__PURE__ */x("img",{src:e,alt:a,className:f()}),/* @__PURE__ */x("div",{className:Z(),children:/* @__PURE__ */x("div",{className:A(),children:/* @__PURE__ */x(wd,{name:"search-plus",size:"xl",color:"on-scrim"})})})]}),/* @__PURE__ */b(yh,{open:m,onClose:()=>d(!1),size:"none",padding:"none",children:[/* @__PURE__ */x("div",{className:w(),children:/* @__PURE__ */x(Om,{icon:"close",size:"md",variant:"tonal",onClick:()=>d(!1),"aria-label":"Bildschirm schließen"})}),/* @__PURE__ */x("img",{src:e,alt:a,style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain",display:"block"}})]})]})};Gh.displayName="ImageVisualizer";var qh={default:{name:"info"},positive:{name:"check-circle",weight:"fill"},warning:{name:"warning"},error:{name:"error",weight:"fill"},subtle:{name:"info"},neutral:{name:"info"},outlined:{name:"info"}},Yh={default:"inverse-surface",positive:"green-container",warning:"yellow-container",error:"error-container",subtle:"steel-blue-container",neutral:"surface",outlined:"surface"},Xh={default:"inverse-on-surface",positive:"on-green-container",warning:"on-yellow-container",error:"on-error-container",subtle:"on-steel-blue-container",neutral:"on-surface",outlined:"on-surface"},Kh=({message:e,variant:a="default",icon:t,elevated:l=!0})=>/* @__PURE__ */x("div",{className:"w-full",children:/* @__PURE__ */x(Wm,{bgColor:Yh[a],elevation:l&&"outlined"!==a?1:0,borderRadius:"sm",padding:"sm",variant:"outlined"===a?"outlined":"filled",children:/* @__PURE__ */b(Ph,{columns:"auto 1fr",gap:"sm",children:[/* @__PURE__ */x(wd,{...t?"string"==typeof t?{name:t}:t:qh[a],color:Xh[a]}),/* @__PURE__ */x("div",{className:"flex items-center",children:/* @__PURE__ */x(_p,{color:Xh[a],children:e})})]})})});Kh.displayName="InfoBox";var Jh=Ja({slots:{list:["w-full","list-none","p-none","m-none","text-body-medium"],itemWrapper:["w-full","transition-colors","duration-300"],item:["p-sm","w-full","inline-block"]},variants:{active:{true:{itemWrapper:["bg-surface-container","text-on-surface-variant"]},false:{itemWrapper:["text-on-surface-variant","hover:bg-surface-container-low"]}}}}),Qh=({items:e,activeItemId:a,showDividers:t=!0,linkComponent:l="div"})=>{Xc("production"!==process.env.NODE_ENV&&void 0!==a&&!e.some(e=>e.id===a),`@List: activeItemId "${a}" does not match any item id.`);const n=Jh();/* @__PURE__ */
|
|
666
|
+
return x("ul",{className:n.list(),children:e.map((r,i)=>{const{content:o,id:s,...c}=r,m=s===a;/* @__PURE__ */
|
|
667
|
+
return b("li",{className:n.itemWrapper({active:m}),children:[/* @__PURE__ */x(l,{...c,className:n.item(),children:o}),t&&i<e.length-1&&/* @__PURE__ */x(Fh,{variant:"fullWidth"})]},s)})})};Qh.displayName="List";var ep=["transition-all","duration-500","ease-in-out"],ap="w-[56px]",tp="w-[220px]",lp="w-[34px]",np="w-[220px]",rp=Ja({base:[...ep,"w-full","p-xs","tablet:p-none"]}),ip=Ja({base:["w-full"],variants:{isFirst:{true:[],false:["mt-md"]}},defaultVariants:{isFirst:!0}}),op=Ja({base:[...ep,"overflow-hidden"],variants:{open:{true:["pb-xs","pt-sm","pl-xs","tablet:pl-none","opacity-100"],false:["h-none","py-none","mb-none","pl-none","opacity-0","pointer-events-none"]}},defaultVariants:{open:!0}}),sp=Ja({base:[...ep,"flex","items-center","cursor-pointer","justify-start","p-md","hover:font-semibold","text-on-surface-variant","hover:bg-on-surface/3","hover:text-on-secondary-container"],variants:{active:{true:["font-semibold","bg-tertiary-container!","text-on-secondary-container!"]},open:{true:[],false:["tablet:rounded-[40px]"]},variant:{default:[],compact:["py-[7px]","px-xs","text-body-medium"]}},compoundVariants:[{open:!0,variant:"compact",class:["rounded-sm"]},{open:!0,variant:"default",class:["rounded-md"]}],defaultVariants:{active:!1,variant:"default"}}),cp=Ja({base:[...ep,"text-nowrap","flex","items-center","overflow-hidden"],variants:{open:{true:["pl-lg","w-full","opacity-100"],false:["pl-none","w-[0%]","opacity-0"]},variant:{default:[],compact:[]},hasIcon:{true:[],false:["pl-none"]}},compoundVariants:[{open:!0,variant:"compact",hasIcon:!0,class:["pl-sm","w-full"]},{open:!0,variant:"compact",hasIcon:!1,class:["pl-none","w-full"]},{open:!0,variant:"default",hasIcon:!0,class:["pl-lg","w-full"]},{open:!0,variant:"default",hasIcon:!1,class:["pl-none","w-full"]}],defaultVariants:{hasIcon:!0}}),mp=Ja({base:["shrink-0"],variants:{variant:{default:["size-xl"],compact:["size-md"]}},defaultVariants:{variant:"default"}}),dp=Ja({base:[...ep,"ml-auto","pl-xs2","shrink-0"],variants:{visibility:{always:["opacity-100"],hover:["tablet:opacity-0","tablet:group-hover/item:opacity-100"]}},defaultVariants:{visibility:"always"}});function hp(e){if(!Array.isArray(e)||0===e.length)return!1;const a=e[0];return null!==a&&"object"==typeof a&&(!(!("items"in a)||!Array.isArray(a.items))&&(!("label"in a)||"string"!=typeof a.label))}var pp=({items:e,activeItem:a,open:t=!0,variant:l="default",linkComponent:n="a",onItemClick:r})=>{const i="compact"===l,o=e=>e.map(e=>e.isSpacer?/* @__PURE__ */x("li",{className:"h-md pointer-events-none"},e.id):(e=>{const{label:o,id:s,icon:c,endContent:m,endContentVisibility:d="always",isSpacer:h,...p}=e,u=s===a;/* @__PURE__ */
|
|
668
668
|
return x("li",{className:"group/item",children:/* @__PURE__ */x(DC,{content:o,disabled:t,placement:"right",children:/* @__PURE__ */x(n,{"data-testid":`listMenu_${o}`,"aria-label":o,...p,role:"link",onClick:a=>{p.onClick&&p.onClick(a),r&&(p.target||"a"!==n||a.preventDefault(),r(e))},children:/* @__PURE__ */b("span",{className:sp({active:u,open:t,variant:l}),children:[c&&"string"==typeof c?/* @__PURE__ */x(wd,{name:c,size:i?"sm":"lg",weight:u?"fill":"regular",color:u?"on-secondary-container":"on-surface-variant"}):c?/* @__PURE__ */x("div",{className:mp({variant:l}),children:c}):null,/* @__PURE__ */b("span",{className:cp({open:t,variant:l,hasIcon:!!c}),children:[/* @__PURE__ */x(_p,{truncate:1,as:"span",children:o}),m&&/* @__PURE__ */x("span",{className:dp({visibility:d}),role:"presentation",onClick:e=>{e.stopPropagation(),e.preventDefault()},onKeyDown:e=>e.stopPropagation(),children:m})]})]})})})},s)})(e));return hp(e)?/* @__PURE__ */x(M,{children:e.map((e,a)=>{const l=e.title?.trim();/* @__PURE__ */
|
|
669
669
|
return b("div",{className:ip({isFirst:0===a}),children:[l?/* @__PURE__ */x("div",{className:op({open:t}),children:/* @__PURE__ */x(_p,{variant:"label",size:"small",color:"on-surface-variant",textTransform:"uppercase",as:"span",children:l})}):null,/* @__PURE__ */x("ul",{className:rp(),children:o(e.items)})]},l||`section-${a}`)})}):/* @__PURE__ */x("ul",{className:rp(),children:o(e)})};pp.displayName="ListMenu";var up=Ja({base:["flex","items-center","gap-xs","w-full"],variants:{variant:{sender:["flex-row-reverse"],receiver:["flex-row"]}},defaultVariants:{variant:"receiver"}}),Hp=Ja({base:["flex","items-center","gap-xs2"],variants:{variant:{sender:["flex-row-reverse"],receiver:["flex-row"]}},defaultVariants:{variant:"receiver"}}),Cp=Ja({base:["inline-flex","items-center","justify-center","size-xl","rounded-xs","text-on-surface-variant","transition-colors","duration-150","cursor-pointer","border-none","bg-transparent","hover:bg-surface-container-low","hover:text-on-surface","active:bg-surface-container"],variants:{active:{true:["text-primary","hover:text-primary"]},animated:{true:["animate-[thumb-pop_0.35s_ease-out]"]}}}),gp=Ja({base:["text-body-small","text-on-surface-variant","select-none","whitespace-nowrap"]}),Vp=Ja({base:["text-body-small","text-on-surface-variant","select-none","whitespace-nowrap","animate-[fade-in_0.3s_ease-out_both]"]}),fp=[{icon:"copy",label:"Kopieren",confirmation:{icon:"check",text:"Kopiert"}},{icon:"thumb-up",label:"Hilfreich",feedbackType:"positive",confirmation:{text:"Danke für Ihr Feedback",duration:0}},{icon:"thumb-down",label:"Nicht hilfreich",feedbackType:"negative",confirmation:{text:"Danke für Ihr Feedback",duration:0}},{icon:"more-horizontal",label:"Mehr"}],Zp=s(({variant:e="receiver",timestamp:a,actions:t,menuItems:l,onFeedback:n,className:r},i)=>{const o=t??fp,[s,c]=v(()=>o.find(e=>void 0!==e.feedbackType&&e.active)?.feedbackType??null),[m,d]=v(null),[p,u]=v(null),[H,C]=v(null),g=Z(null),V=Z(null),f=Z(null),A=h(()=>{g.current&&clearTimeout(g.current),V.current&&clearTimeout(V.current),f.current&&clearTimeout(f.current)},[]),M=h(e=>{const{confirmation:a,feedbackType:t}=e;if(!a)return;const l=void 0!==t,r=a.duration??3e3;if(A(),l){const l=s===t,i=l?null:t??null;if(c(i),n?.(i),l)return u(null),void C(null);d(e.label),u(e.label),a.text&&C(a.text),f.current=setTimeout(()=>d(null),350),r>0&&a.text&&(g.current=setTimeout(()=>C(null),r))}else d(e.label),u(e.label),a.text&&C(a.text),f.current=setTimeout(()=>d(null),350),V.current=setTimeout(()=>{u(null),C(null)},r>0?r:3e3)},[s,n,A]),w=(e,a)=>{const t=(e=>void 0!==e.feedbackType?s===e.feedbackType:!(p!==e.label||!e.confirmation)||e.active)(e),l=m===e.label,n=(e=>void 0!==e.feedbackType?e.icon:p===e.label&&e.confirmation?.icon?e.confirmation.icon:e.icon)(e),r=(e=>{if(void 0!==e.feedbackType)return s===e.feedbackType?"fill":void 0})(e);/* @__PURE__ */
|
|
670
670
|
return x(DC,{content:e.label,placement:"top",children:/* @__PURE__ */x("button",{type:"button",className:Cp({active:t,animated:l}),onClick:a=>{e.confirmation&&M(e),e.onClick?.(a)},"aria-label":e.label,children:/* @__PURE__ */x(wd,{name:n,size:"xs",color:t?"primary":void 0,weight:r})})},`${e.label}-${a}`)};/* @__PURE__ */
|
|
@@ -690,7 +690,7 @@ return b("div",{ref:g,className:Lp({placement:B,hasCustomHeight:!!(U||j||W)}),st
|
|
|
690
690
|
/* @__PURE__ */x("span",{className:"inline-block align-middle",children:/* @__PURE__ */x(_p,{as:"span",variant:"body",wrap:!1,children:Sp(m,p)})})]}),/* @__PURE__ */b("span",{className:"w-lg",children:[k&&/* @__PURE__ */x(wd,{name:"chevron-right",size:"sm",color:"on-surface-variant-lowest"}),!k&&V&&"none"!==l&&/* @__PURE__ */x(wd,{name:"check",size:"sm"})]})]});return k?/* @__PURE__ */x(Ip,{item:e,density:t,buttonProps:"button"===n?A:g,commonProps:y,ItemComponent:v,isButton:f,children:F},i):/* @__PURE__ */x("li",{role:"none","data-testid":i,children:/* @__PURE__ */x(v,{..."button"===n?A:g,...y,children:F})},i)}),h&&/* @__PURE__ */x("div",{className:"absolute bottom-0 left-0 right-0 w-full z-10",children:/* @__PURE__ */x(pu,{indeterminate:!0})})]}),D&&/* @__PURE__ */b(M,{children:[/* @__PURE__ */x(Fh,{}),/* @__PURE__ */x(CH,{gap:"xs",padding:"xs",align:"center",children:/* @__PURE__ */x(Om,{variant:"text","aria-label":"Clear all",size:"md",onClick:k,children:c})})]})]})},Tp=function(){if("undefined"!=typeof Map)return Map;function e(e,a){var t=-1;return e.some(function(e,l){return e[0]===a&&(t=l,!0)}),t}return function(){function a(){this.__entries__=[]}return Object.defineProperty(a.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),a.prototype.get=function(a){var t=e(this.__entries__,a),l=this.__entries__[t];return l&&l[1]},a.prototype.set=function(a,t){var l=e(this.__entries__,a);~l?this.__entries__[l][1]=t:this.__entries__.push([a,t])},a.prototype.delete=function(a){var t=this.__entries__,l=e(t,a);~l&&t.splice(l,1)},a.prototype.has=function(a){return!!~e(this.__entries__,a)},a.prototype.clear=function(){this.__entries__.splice(0)},a.prototype.forEach=function(e,a){void 0===a&&(a=null);for(var t=0,l=this.__entries__;t<l.length;t++){var n=l[t];e.call(a,n[1],n[0])}},a}()}(),Op="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,zp="undefined"!=typeof global&&global.Math===Math?global:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),Rp="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(zp):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)};var Bp=["top","right","bottom","left","width","height","size","weight"],Up="undefined"!=typeof MutationObserver,jp=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,a){var t=!1,l=!1,n=0;function r(){t&&(t=!1,e()),l&&o()}function i(){Rp(r)}function o(){var e=Date.now();if(t){if(e-n<2)return;l=!0}else t=!0,l=!1,setTimeout(i,a);n=e}return o}(this.refresh.bind(this),20)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var a=this.observers_,t=a.indexOf(e);~t&&a.splice(t,1),!a.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter(function(e){return e.gatherActive(),e.hasActive()});return e.forEach(function(e){return e.broadcastActive()}),e.length>0},e.prototype.connect_=function(){Op&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Up?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){Op&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var a=e.propertyName,t=void 0===a?"":a;Bp.some(function(e){return!!~t.indexOf(e)})&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),Wp=function(e,a){for(var t=0,l=Object.keys(a);t<l.length;t++){var n=l[t];Object.defineProperty(e,n,{value:a[n],enumerable:!1,writable:!1,configurable:!0})}return e},Pp=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||zp},$p=Jp(0,0,0,0);function Gp(e){return parseFloat(e)||0}function qp(e){for(var a=[],t=1;t<arguments.length;t++)a[t-1]=arguments[t];return a.reduce(function(a,t){return a+Gp(e["border-"+t+"-width"])},0)}function Yp(e){var a=e.clientWidth,t=e.clientHeight;if(!a&&!t)return $p;var l=Pp(e).getComputedStyle(e),n=function(e){for(var a={},t=0,l=["top","right","bottom","left"];t<l.length;t++){var n=l[t],r=e["padding-"+n];a[n]=Gp(r)}return a}(l),r=n.left+n.right,i=n.top+n.bottom,o=Gp(l.width),s=Gp(l.height);if("border-box"===l.boxSizing&&(Math.round(o+r)!==a&&(o-=qp(l,"left","right")+r),Math.round(s+i)!==t&&(s-=qp(l,"top","bottom")+i)),!function(e){return e===Pp(e).document.documentElement}(e)){var c=Math.round(o+r)-a,m=Math.round(s+i)-t;1!==Math.abs(c)&&(o-=c),1!==Math.abs(m)&&(s-=m)}return Jp(n.left,n.top,o,s)}var Xp="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof Pp(e).SVGGraphicsElement}:function(e){return e instanceof Pp(e).SVGElement&&"function"==typeof e.getBBox};function Kp(e){return Op?Xp(e)?function(e){var a=e.getBBox();return Jp(0,0,a.width,a.height)}(e):Yp(e):$p}function Jp(e,a,t,l){return{x:e,y:a,width:t,height:l}}var Qp=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Jp(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=Kp(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),eu=function(e,a){var t,l,n,r,i,o,s=(l=(t=a).x,n=t.y,r=t.width,i=t.height,o=Object.create(("undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object).prototype),Wp(o,{x:l,y:n,width:r,height:i,top:n,right:l+r,bottom:i+n,left:l}),o);Wp(this,{target:e,contentRect:s})},au=function(){function e(e,a,t){if(this.activeObservations_=[],this.observations_=new Tp,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=a,this.callbackCtx_=t}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof Pp(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var a=this.observations_;a.has(e)||(a.set(e,new Qp(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof Pp(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var a=this.observations_;a.has(e)&&(a.delete(e),a.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(a){a.isActive()&&e.activeObservations_.push(a)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,a=this.activeObservations_.map(function(e){return new eu(e.target,e.broadcastRect())});this.callback_.call(e,a,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),tu="undefined"!=typeof WeakMap?/* @__PURE__ */new WeakMap:new Tp,lu=function e(a){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=new au(a,jp.getInstance(),this);tu.set(this,t)};["observe","unobserve","disconnect"].forEach(function(e){lu.prototype[e]=function(){var a;return(a=tu.get(this))[e].apply(a,arguments)}});var nu=void 0!==zp.ResizeObserver?zp.ResizeObserver:lu,ru=({children:e,triggerRef:a,placement:t,isOpen:l,cursorPosition:n})=>{const[r,i]=v(!1),[o,s]=v(!1),c=Z(null),[m,d]=v({top:0,left:0}),p=gm(t),H=h(()=>{const e=c.current;if(!e)return;const t=e.getBoundingClientRect();let l=0,r=0;if(n)l=n.y,r=n.x,r+t.width>document.documentElement.scrollWidth&&(r=document.documentElement.scrollWidth-t.width-8),l+t.height>document.documentElement.scrollHeight&&(l=document.documentElement.scrollHeight-t.height-8);else{const e=a.current;if(!e)return;const n=e.getBoundingClientRect();switch(p){case"top":l=n.top-t.height-8,r=n.left+(n.width-t.width)/2;break;case"top-left":l=n.top-t.height-8,r=n.left;break;case"top-right":l=n.top-t.height-8,r=n.right-t.width;break;case"bottom":l=n.bottom+8,r=n.left+(n.width-t.width)/2;break;case"bottom-left":l=n.bottom+8,r=n.left;break;case"bottom-right":l=n.bottom+8,r=n.right-t.width;break;case"left":l=n.top+(n.height-t.height)/2,r=n.left-t.width-8;break;case"right":l=n.top+(n.height-t.height)/2,r=n.right+8;break;case"left-top":l=n.top,r=n.left-t.width-8;break;case"left-bottom":l=n.bottom-t.height,r=n.left-t.width-8;break;case"right-top":l=n.top,r=n.right+8;break;case"right-bottom":l=n.bottom-t.height,r=n.right+8}}d({top:l+window.scrollY,left:r+window.scrollX})},[n,p,a]);return u(()=>{if(l)return void i(!0);const e=setTimeout(()=>{i(!1)},200);return()=>clearTimeout(e)},[l]),u(()=>()=>{i(!1),s(!1)},[]),g(()=>{l?r&&c.current&&(H(),s(!0)):s(!1)},[r,l,H]),u(()=>{if(!r||!c.current)return;const e=()=>{l&&requestAnimationFrame(H)},t=new nu(()=>{l&&requestAnimationFrame(()=>{a.current&&a.current.getBoundingClientRect(),H()})});if(a.current){t.observe(a.current);const e=a.current.parentElement;e&&t.observe(e)}let n;return requestAnimationFrame(H),window.addEventListener("resize",H),window.addEventListener("scroll",e,!0),l&&a.current&&(n=new MutationObserver(()=>{requestAnimationFrame(H)}),n.observe(a.current,{childList:!0,subtree:!0,attributes:!0,characterData:!0})),()=>{window.removeEventListener("resize",H),window.removeEventListener("scroll",e,!0),t.disconnect(),n?.disconnect()}},[r,l,a,H]),r?E(/* @__PURE__ */x("div",{ref:c,className:yp({isVisible:o}),style:{top:`${m.top}px`,left:`${m.left}px`},children:e}),document.body):null},iu=({disabled:e,trigger:a,selectable:t,closeOnItemClick:l,closeOnClickOutside:n,closeOnEscape:r,toggleOnClick:i,showSearch:o,allowClearAll:s,items:c,onItemClick:m,onClearAllOrSelectAllClick:d,onClose:p,onFocus:H,state:C,setSearchQuery:g})=>{const{innerSelectedItem:V,setInnerSelectedItem:f,isOpenState:Z,setIsOpenState:v,setCursorPosition:A,focusedIndex:M,setFocusedIndex:x,timeoutId:b,setTimeoutId:w,filteredItems:E,triggerRef:L,menuRef:y,containerRef:k,menuItemsRef:F,searchInputRef:N,hasInitiallyFocusedRef:_,hasReachedEndRef:S,previousScrollTopRef:I,previousItemsLengthRef:D,menuId:T,isControlled:O}=C,z=(e,a=!1)=>{const n=((e,a,t)=>{if("single"===t)return a===e.id?void 0:e.id;if("multiple"===t){let t=[];return Array.isArray(a)?t=a:a&&(t=[a]),t.includes(e.id)?t.filter(a=>a!==e.id):[...t,e.id]}})(e,V,t);f(n),m?.(e,n),a||((e,a)=>{if("none"===t)return;const l=E.findIndex(a=>a.id===e.id);-1!==l&&((Array.isArray(a)?a.includes(e.id):a===e.id)?(F.current[l]?.focus(),x(l)):(F.current[l]?.blur(),x(-1)))})(e,n),!l||e.keepOpen||"none"!==t&&"single"!==t||B()},R=()=>{e||O||(b&&(clearTimeout(b),w(null)),wh.closeOtherMenus(T),"hover"===a?w(setTimeout(()=>{v(!0)},50)):v(!0))},B=h(()=>{b&&(clearTimeout(b),w(null)),v(!1),g(""),S.current=!1,D.current=0,I.current=0,"right-click"!==a&&setTimeout(()=>{const e=L.current?.querySelector(ae);e?e.focus():L.current?.focus()},0),p?.()},[b,p,a,L,v,g,w,S,D,I]),U=(e,a)=>{e.preventDefault(),F.current[a]?.focus(),x(a)};u(()=>{if(!Z)return x(-1),void(_.current=!1);const e=e=>{if("Tab"===e.key){const a=[];N.current&&a.push(N.current);const t=y.current?.querySelectorAll("button");t&&a.push(...Array.from(t));const l=F.current.filter(Boolean);a.push(...l);const n=a.at(0),r=a.at(-1),i=y.current?.contains(document.activeElement);if(L.current?.contains(document.activeElement)&&!e.shiftKey&&n){e.preventDefault(),n.focus();const a=l.indexOf(n);return void x(-1===a?-1:a)}if(i&&n&&r)if(e.shiftKey&&document.activeElement===n){e.preventDefault(),r.focus();const a=l.indexOf(r);-1!==a&&x(a)}else if(!e.shiftKey&&document.activeElement===r){e.preventDefault(),n.focus();const a=l.indexOf(n);x(-1===a?-1:a)}}},a=()=>{const e=o&&document.activeElement===N.current;_.current||!F.current[0]||e||(F.current[0].focus(),x(0),_.current=!0)};a();const t=requestAnimationFrame(a);return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e),cancelAnimationFrame(t)}},[Z,o,E.length,x,_,F,y,N,L]),u(()=>{const e=e=>{if(!n||!Z)return;const a=e.target,t=L.current?.contains(a)??!1,l=y.current?.contains(a)??!1,r=k.current?.contains(a)??!1;t||l||r||B()},t=e=>{"Escape"===e.key&&Z&&r&&B()};if("click"===a||"right-click"===a)return document.addEventListener("click",e,!0),document.addEventListener("keydown",t),()=>{document.removeEventListener("click",e,!0),document.removeEventListener("keydown",t)}},[a,Z,B,n,r,L,y,k]),u(()=>{if(!Z){const e=setTimeout(()=>{wh.unregisterOpenMenu(T)},0);return()=>clearTimeout(e)}wh.registerOpenMenu(T,B)},[Z,T,B]),u(()=>()=>{b&&clearTimeout(b),wh.unregisterOpenMenu(T)},[b,T]);const j=((e,a,t)=>"multiple"===t&&!!Array.isArray(a)&&0!==e.length&&e.filter(e=>!e.isDivider&&!e.customContent).every(e=>a.includes(e.id)))(o?E:c,V,t),W="multiple"===t&&s&&Array.isArray(V)&&V.length>0;return{handleItemClick:z,handleOpen:R,handleClose:B,handleDelayedClose:()=>{"hover"===a?w(setTimeout(()=>{k.current?.matches(":hover")||L.current?.matches(":hover")||y.current?.matches(":hover")||(v(!1),wh.unregisterOpenMenu(T)),w(null)},200)):B()},handleClick:e=>{e.stopPropagation(),e.preventDefault(),0!==e.detail&&(O||("click"===a?Z&&i?B():R():"right-click"===a&&Z&&B()))},handleKeyDown:e=>{if("hover"!==a)if("Enter"===e.key||"Space"===e.code)(e=>{if(e.preventDefault(),Z)if(M>=0&&M<E.length){const e=E[M];e.disabled||(z(e,!0),"none"===t&&e.onClick?.())}else B();else R()})(e);else if("Escape"===e.key&&Z)e.preventDefault(),B();else if(Z)switch(e.key){case"ArrowDown":U(e,(M+1)%E.length);break;case"ArrowUp":U(e,(M-1+E.length)%E.length)}},handlePopUpMenu:t=>{if("right-click"===a){if(t.preventDefault(),t.stopPropagation(),e)return;A({x:t.clientX,y:t.clientY}),R()}},handleContainerFocus:e=>{if(H?.(e),!Z&&!k.current?.contains(e.relatedTarget)){const a=L.current?.querySelector(ae);a&&(e.preventDefault(),a.focus())}},handleSelectAll:()=>{const e=o?E.map(e=>e.id):c.map(e=>e.id),a=c.filter(a=>e.includes(a.id));f(e),d?.(a,e)},handleClearAll:e=>{e.stopPropagation(),f(void 0),d?.([],[])},handleSearchChange:e=>{const a=e.target.value;g(a),x(-1)},handleSearchFocus:()=>{x(-1)},handleScroll:e=>{const{scrollTop:a,scrollHeight:t,clientHeight:l}=e.currentTarget;I.current=a;const n=a+l>=t-1;n&&!S.current?(S.current=!0,C.onScrollEndRef.current?.()):n||(S.current=!1)},handleMenuItemFocus:e=>{x(e)},computedAllItemsAreSelected:j,shouldShowClearAll:W}},ou=({children:e,placement:a="bottom-left",disabled:t=!1,trigger:l="click",density:n="default",closeOnItemClick:r=!0,items:i,onItemClick:o,selectedItem:s,selectable:c="none",open:m,onClose:d,closeOnClickOutside:h=!0,closeOnEscape:p=!0,toggleOnClick:C=!0,queryHighlight:f,showSearch:A=!1,searchPlaceholder:M="Suchen",allowClearAll:w=!1,allowSelectAll:E=!1,selectAllLabel:L="Alle auswählen",clearAllLabel:y="Alle löschen",noResultsFoundMessage:k="Keine Ergebnisse gefunden",onClearAllOrSelectAllClick:F,searchMode:N="built-in",onSearchChange:_,isLoading:S=!1,wrapperWidth:I="fit",onScrollEnd:D,isLoadingMore:T=!1,height:O,minHeight:z,maxHeight:R,...B})=>{const[U,j]=v(""),W=(({items:e,selectedItem:a,open:t,showSearch:l,searchMode:n,searchQuery:r,onSearchChange:i,onScrollEnd:o})=>{const[s,c]=v(),[m,d]=v(!1),h=Z(null),[p,C]=v(null),f=Z(null),A=Z(null),[M,x]=v({x:0,y:0}),[b,w]=v(-1),E=Z([]),L=void 0!==t,y=Z(null),k=Z(!1),F=Z(i),N=Z(null),_=Z(o),S=Z(!1),I=Z(0),D=Z(0),T=H(),O=H();u(()=>{F.current=i},[i]),u(()=>{_.current=o},[o]),u(()=>{L&&d(t??!1)},[L,t]),u(()=>{c(a)},[a]);const z=V(()=>l&&"built-in"===n?((e,a)=>e.filter(e=>e.isDivider||e.customContent||e.label.toLowerCase().includes(a.toLowerCase())))(e,r):e,[e,l,r,n]);return u(()=>{S.current=!1},[z.length]),u(()=>{m&&N.current&&(I.current=N.current.scrollTop,D.current=z.length)},[m]),g(()=>{const e=N.current;if(!e||!m)return void(D.current=z.length);const a=z.length,t=D.current;if(0===t&&a>0)return D.current=a,void(I.current=e.scrollTop);const l=e.scrollTop;if(a>t){const a=I.current;requestAnimationFrame(()=>{requestAnimationFrame(()=>{e&&(e.scrollTop=a)})})}else a!==t&&(I.current=l);D.current=a},[z.length,m]),u(()=>{l&&"async"===n&&F.current&&F.current(r)},[r,n,l]),{innerSelectedItem:s,setInnerSelectedItem:c,isOpenState:m,setIsOpenState:d,cursorPosition:M,setCursorPosition:x,focusedIndex:b,setFocusedIndex:w,timeoutId:p,setTimeoutId:C,filteredItems:z,triggerRef:h,menuRef:f,containerRef:A,menuItemsRef:E,searchInputRef:y,listRef:N,hasInitiallyFocusedRef:k,hasReachedEndRef:S,previousScrollTopRef:I,previousItemsLengthRef:D,onScrollEndRef:_,innerId:T,menuId:O,isControlled:L}})({items:i,selectedItem:s,open:m,showSearch:A,searchMode:N,searchQuery:U,onSearchChange:_,onScrollEnd:D}),{isOpenState:P,containerRef:$,triggerRef:G,cursorPosition:q,innerId:Y,filteredItems:X,innerSelectedItem:K,menuRef:J,listRef:Q,searchInputRef:ee,menuItemsRef:ae}=W,te=V(()=>i.some(e=>!e.isDivider&&!e.customContent&&void 0!==e.icon),[i]),le=iu({disabled:t,trigger:l,selectable:c,closeOnItemClick:r,closeOnClickOutside:h,closeOnEscape:p,toggleOnClick:C,showSearch:A,allowSelectAll:E,allowClearAll:w,items:i,onItemClick:o,onClearAllOrSelectAllClick:F,onClose:d,onFocus:B.onFocus,state:W,searchQuery:U,setSearchQuery:j});/* @__PURE__ */
|
|
691
691
|
return b("div",{...B,ref:$,className:Ep({cursorPointer:"right-click"!==l,wrapperWidth:I}),onMouseEnter:"hover"===l?le.handleOpen:void 0,onMouseLeave:"hover"===l?le.handleDelayedClose:void 0,onContextMenu:le.handlePopUpMenu,onFocus:le.handleContainerFocus,tabIndex:-1,children:[/* @__PURE__ */x("span",{ref:G,onClick:le.handleClick,onKeyDown:le.handleKeyDown,tabIndex:"right-click"===l?-1:0,children:e}),!t&&/* @__PURE__ */x(ru,{triggerRef:G,placement:a,isOpen:P,cursorPosition:"right-click"===l?q:void 0,children:/* @__PURE__ */x(Dp,{innerId:Y,placement:a,trigger:l,density:n,selectable:c,showSearch:A,searchPlaceholder:M,allowSelectAll:E,allowClearAll:w,selectAllLabel:L,clearAllLabel:y,noResultsFoundMessage:k,isLoading:S,isLoadingMore:T,queryHighlight:f,filteredItems:X,innerSelectedItem:K,atLeastOneHasIcon:te,menuRef:J,listRef:Q,searchInputRef:ee,menuItemsRef:ae,searchQuery:U,onSearchChange:le.handleSearchChange,onItemClick:le.handleItemClick,onKeyDown:le.handleKeyDown,onSelectAll:le.handleSelectAll,onClearAll:le.handleClearAll,onScroll:le.handleScroll,onMouseEnter:"hover"===l?le.handleOpen:void 0,onMouseLeave:"hover"===l?le.handleDelayedClose:void 0,onSearchFocus:le.handleSearchFocus,onMenuItemFocus:le.handleMenuItemFocus,allItemsAreSelected:le.computedAllItemsAreSelected,shouldShowClearAll:le.shouldShowClearAll,isOpen:P,height:O,minHeight:z,maxHeight:R})})]})},su=Ja({base:["relative","overflow-hidden"],variants:{variant:{linear:["bg-secondary-container","rounded-sm","h-xs2","w-full"],circular:["inline-block"]},bgColor:F},defaultVariants:{variant:"linear"}}),cu=Ja({base:["transition-all","duration-500","ease-in-out"],variants:{variant:{linear:["bg-primary","rounded-sm","h-full"],circular:["stroke-primary","fill-none"]},circularSize:{sm:["stroke-2"],md:["stroke-4"]},indeterminate:{true:[],false:[]},positioning:{absolute:["absolute","left-none","top-none"],relative:[]},bgColor:F,strokeColor:N},compoundVariants:[{indeterminate:!0,variant:"circular",circularSize:"md",class:"animate-circular-indeterminate"},{indeterminate:!0,variant:"circular",circularSize:"sm",class:"animate-circular-indeterminate-slow"},{indeterminate:!0,variant:"linear",class:"animate-linear-indeterminate"}],defaultVariants:{variant:"linear",indeterminate:!1,positioning:"relative"}}),mu=Ja({base:["absolute","right-none","top-none","bg-primary","size-xs2","rounded-full"],variants:{bgColor:F}}),du=Ja({base:["stroke-secondary-container","fill-none"],variants:{strokeColor:N,circularSize:{sm:["stroke-2"],md:["stroke-4"]}},defaultVariants:{circularSize:"md"}}),hu={sm:18,md:44},pu=({value:e=0,indeterminate:a=!1,variant:t="linear",size:l="md",foregroundColor:n,backgroundColor:r})=>{const i=a&&"linear"===t?"absolute":"relative";/* @__PURE__ */
|
|
692
692
|
return x(M,{children:"circular"===t?(()=>{const i=hu[l],o=(i-("sm"===l?2:4))/2,s=2*Math.PI*o,c=a?void 0:s,m=a?void 0:s-e/100*s;/* @__PURE__ */
|
|
693
|
-
return x("div",{className:su({variant:t}),role:"progressbar",children:/* @__PURE__ */b("svg",{width:i,height:i,viewBox:`0 0 ${i} ${i}`,"aria-valuenow":a?void 0:e,"aria-valuemin":a?void 0:0,"aria-valuemax":a?void 0:100,children:[/* @__PURE__ */x("circle",{cx:i/2,cy:i/2,r:o,className:du({strokeColor:r,circularSize:l}),strokeLinecap:"round"}),/* @__PURE__ */x("circle",{cx:i/2,cy:i/2,r:o,className:cu({variant:t,indeterminate:a,strokeColor:n,circularSize:l}),style:{strokeDasharray:c,strokeDashoffset:m,transform:"rotate(-90deg)",transformOrigin:"50% 50%"},strokeLinecap:"round"})]})})})():/* @__PURE__ */b("div",{className:su({variant:t,bgColor:r}),role:"progressbar",children:[/* @__PURE__ */x("div",{"aria-valuenow":a?void 0:e,"aria-valuemin":a?void 0:0,"aria-valuemax":a?void 0:100,style:a?{}:{width:`${e}%`},className:cu({variant:t,indeterminate:a,positioning:i,bgColor:n})}),!a&&/* @__PURE__ */x("div",{className:mu({bgColor:n})})]})})},uu=Ja({base:["flex","items-center","gap-sm","cursor-pointer"],variants:{disabled:{true:["opacity-50","!cursor-not-allowed"]}}}),Hu=Ja({base:["size-[20px]","shrink-0","rounded-full","border-2","flex","items-center","justify-center","transition-all","relative","hover:[&>*]:opacity-10","hover:[&>*]:scale-180","peer-focus:[&>*]:opacity-10","peer-focus:[&>*]:scale-180","after:shrink-0","after:w-[10px]","after:h-[10px]","after:rounded-full","after:bg-primary","after:transition-all","after:opacity-0","after:scale-0","after:duration-300","after:ease-in-out","after:z-2","before:shrink-0","before:absolute","before:w-[20px]","before:h-[20px]","before:rounded-full","before:transition-all","before:transform","before:top-[-2px]","before:left-[-2px]","before:opacity-0","before:bg-primary","border-outline"],variants:{checked:{true:["after:opacity-100","after:scale-100","border-primary","after:bg-primary"]},animate:{true:["before:animate-ripple"]},disabled:{true:["border-neutral-50!","after:bg-neutral-50!"]}}}),Cu=Ja({base:["shrink-0","absolute","size-[20px]","rounded-full","transition-all","transform","top-[-2px]","left-[-2px]","scale-100","opacity-0","z-0","bg-primary"]}),gu=({checked:e=!1,name:a,id:t,disabled:l=!1,value:n,label:r,onChange:i=()=>{}})=>{const[o,s]=v(!1),c=H();/* @__PURE__ */
|
|
693
|
+
return x("div",{className:su({variant:t}),role:"progressbar",children:/* @__PURE__ */b("svg",{width:i,height:i,viewBox:`0 0 ${i} ${i}`,"aria-valuenow":a?void 0:e,"aria-valuemin":a?void 0:0,"aria-valuemax":a?void 0:100,children:[/* @__PURE__ */x("circle",{cx:i/2,cy:i/2,r:o,className:du({strokeColor:r,circularSize:l}),strokeLinecap:"round"}),/* @__PURE__ */x("circle",{cx:i/2,cy:i/2,r:o,className:cu({variant:t,indeterminate:a,strokeColor:n,circularSize:l}),style:{strokeDasharray:c,strokeDashoffset:m,transform:"rotate(-90deg)",transformOrigin:"50% 50%"},strokeLinecap:"round"})]})})})():/* @__PURE__ */b("div",{className:su({variant:t,bgColor:r}),role:"progressbar",children:[/* @__PURE__ */x("div",{"aria-valuenow":a?void 0:e,"aria-valuemin":a?void 0:0,"aria-valuemax":a?void 0:100,style:a?{}:{width:`${e}%`},className:cu({variant:t,indeterminate:a,positioning:i,bgColor:n})}),!a&&/* @__PURE__ */x("div",{className:mu({bgColor:n})})]})})},uu=Ja({base:["relative","flex","items-center","gap-sm","cursor-pointer"],variants:{disabled:{true:["opacity-50","!cursor-not-allowed"]}}}),Hu=Ja({base:["size-[20px]","shrink-0","rounded-full","border-2","flex","items-center","justify-center","transition-all","relative","hover:[&>*]:opacity-10","hover:[&>*]:scale-180","peer-focus:[&>*]:opacity-10","peer-focus:[&>*]:scale-180","after:shrink-0","after:w-[10px]","after:h-[10px]","after:rounded-full","after:bg-primary","after:transition-all","after:opacity-0","after:scale-0","after:duration-300","after:ease-in-out","after:z-2","before:shrink-0","before:absolute","before:w-[20px]","before:h-[20px]","before:rounded-full","before:transition-all","before:transform","before:top-[-2px]","before:left-[-2px]","before:opacity-0","before:bg-primary","border-outline"],variants:{checked:{true:["after:opacity-100","after:scale-100","border-primary","after:bg-primary"]},animate:{true:["before:animate-ripple"]},disabled:{true:["border-neutral-50!","after:bg-neutral-50!"]}}}),Cu=Ja({base:["shrink-0","absolute","size-[20px]","rounded-full","transition-all","transform","top-[-2px]","left-[-2px]","scale-100","opacity-0","z-0","bg-primary"]}),gu=({checked:e=!1,name:a,id:t,disabled:l=!1,value:n,label:r,onChange:i=()=>{}})=>{const[o,s]=v(!1),c=H();/* @__PURE__ */
|
|
694
694
|
return b("label",{className:uu({disabled:l}),htmlFor:t??c,children:[
|
|
695
695
|
/* @__PURE__ */x("input",{type:"radio",name:a,value:n,checked:e,"aria-checked":e,onChange:e=>{l||(s(!0),i(e),setTimeout(()=>{s(!1)},500))},className:"sr-only peer",disabled:l,id:t??c}),
|
|
696
696
|
/* @__PURE__ */x("div",{className:Hu({checked:e,animate:o,disabled:l}),children:/* @__PURE__ */x("div",{className:Cu()})}),
|
|
@@ -713,8 +713,8 @@ return x("span",{ref:C,className:HH({...Hm(o,s,a),...Zm(t,l,n,r),hasClassName:Bo
|
|
|
713
713
|
/* @__PURE__ */x("path",{d:"M47.7158 12.8C44.1405 12.8 41.5229 10.3068 41.5229 6.95813C41.5229 3.0641 44.7097 0 48.7792 0C52.3546 0 54.9722 2.4932 54.9722 5.8419C54.9722 9.73593 51.7854 12.8 47.7175 12.8H47.7158ZM48.0004 9.03552C49.5819 9.03552 50.8515 7.71137 50.8515 6.1282C50.8515 4.7785 49.8665 3.76451 48.4929 3.76451C46.9114 3.76451 45.6418 5.08866 45.6418 6.67183C45.6418 8.02153 46.6269 9.03552 48.0004 9.03552Z",fill:"var(--color-on-surface)"}),
|
|
714
714
|
/* @__PURE__ */x("path",{d:"M75.6625 9.55522C76.5401 9.55522 77.8063 9.26722 79.3537 8.37934C79.6451 8.21233 80.0234 8.3606 80.107 8.68609L80.6523 10.8214C80.7051 11.0276 80.6199 11.2458 80.4376 11.3548C78.8203 12.3211 77.1332 12.8034 75.3762 12.8034C71.748 12.8034 69.2343 10.3102 69.2343 6.96147C69.2343 3.06744 72.2916 0.0289051 76.3339 0.0289051C79.4185 0.0289051 81.7736 1.97336 81.9935 5.55724C82.0071 5.77367 81.8674 5.96794 81.6612 6.03611L73.5357 8.67587C74.0282 9.2212 74.7542 9.55863 75.6608 9.55863L75.6625 9.55522ZM76.051 3.2975C74.5224 3.2975 73.2528 4.4393 72.9409 5.97135L78.0722 4.28422C77.6581 3.63493 76.9065 3.2975 76.051 3.2975Z",fill:"var(--color-on-surface)"}),
|
|
715
715
|
/* @__PURE__ */x("path",{d:"M65.4544 0.599916C65.5464 0.468695 65.6981 0.388599 65.8583 0.388599H69.5223C69.921 0.388599 70.1545 0.8385 69.9245 1.1657L62.133 12.2036C62.041 12.3348 61.891 12.4115 61.7308 12.4115H57.9527C57.709 12.4115 57.501 12.2326 57.4653 11.9923L55.8122 0.954384C55.7679 0.656154 55.998 0.388599 56.2996 0.388599H59.725C59.9721 0.388599 60.1817 0.57265 60.2141 0.81805L61.0014 6.98374L65.4544 0.598212V0.599916Z",fill:"var(--color-on-surface)"}),
|
|
716
|
-
/* @__PURE__ */x("path",{d:"M23.2967 0.599916C23.3888 0.468695 23.5404 0.388599 23.7006 0.388599H27.3646C27.7634 0.388599 27.9968 0.8385 27.7668 1.1657L19.9753 12.2036C19.8833 12.3348 19.7333 12.4115 19.5731 12.4115H15.795C15.5513 12.4115 15.3434 12.2326 15.3076 11.9923L13.6545 0.954384C13.6102 0.656154 13.8403 0.388599 14.1419 0.388599H17.5673C17.8144 0.388599 18.024 0.57265 18.0564 0.81805L18.8437 6.98374L23.2967 0.598212V0.599916Z",fill:"var(--color-on-surface)"})]}),fH=({hideIcon:e=!1,hideName:a=!1,iconSize:t=22,nameHeight:l=12})=>/* @__PURE__ */b(CH,{direction:"row",gap:"xs",align:"center",justify:"center",children:[!e&&/* @__PURE__ */x(gH,{size:t}),!a&&/* @__PURE__ */x(VH,{height:l})]});fH.displayName="ZvooveBrand";var ZH=Ja({base:["flex","overflow-x-hidden","shrink-0","absolute","left-none","top-none","z-30","p-sm","pb-md","h-dvh","tablet:h-full","tablet:relative","tablet:left-none","tablet:top-none","tablet:z-10","tablet:p-none","tablet:overflow-visible"]}),vH=Ja({base:["w-full","shrink-0","flex","items-center","tablet:mt-[1px]"],variants:{variant:{default:["h-[60px]"],compact:["h-[34px]","tablet:h-[44px]","overflow-visible"]},hasLogo:{true:["gap-xs2"],false:[]},hasToggleButton:{true:[],false:[]}},compoundVariants:[{hasLogo:!0,hasToggleButton:!0,class:"justify-between"},{hasLogo:!0,hasToggleButton:!1,class:"justify-start"}],defaultVariants:{variant:"default",hasLogo:!1,hasToggleButton:!0}}),AH=Ja({base:[...ep,ap,"h-[48px]","rounded-full","cursor-pointer","flex","shrink-0","items-start","justify-start","pt-xs2","tablet:hover:bg-on-surface/3","tablet:pt-none","tablet:justify-center","tablet:items-center","border-transparent"],variants:{addBorderToToggleButton:{false:[]},variant:{default:[],compact:[lp,"h-xl2","tablet:h-[36px]"]},open:{true:[],false:[]}},compoundVariants:[{addBorderToToggleButton:!0,open:!1,class:["tablet:border-t","tablet:border-r","tablet:border-b","tablet:border-l-transparent","tablet:border-outline-variant","tablet:hover:bg-background"]},{variant:"compact",open:!1,class:["tablet:bg-background","tablet:rounded-l-none","tablet:rounded-r-sm","tablet:h-[28px]"]}],defaultVariants:{variant:"default"}}),MH=Ja({base:["flex-1","min-h-none","flex","flex-col","bg-surface","tablet:bg-transparent","rounded-md","tablet:rounded-none","overflow-hidden","shadow-elevation2","tablet:shadow-none","relative","w-full",...ep],variants:{open:{false:["-translate-x-full","-left-md","tablet:-left-none","tablet:-translate-x-none"]},isCompact:{true:["mt-[5px]"],false:[]}}}),xH=Ja({base:["transition-all","ease-in-out","duration-300","tablet:pb-sm"],variants:{open:{true:[],false:[]},variant:{default:[],compact:["mt-none","tablet:mt-xs"]},section:{main:[],subMenuBack:[]}},compoundVariants:[{section:"main",open:!0,class:"mb-none"},{section:"main",open:!1,class:"mb-none tablet:mb-md"},{section:"subMenuBack",class:"mb-none"}],defaultVariants:{open:!1,variant:"default",section:"main"}}),bH=Ja({base:["flex-1","min-h-none","flex","flex-col","justify-between","overflow-y-auto","scrollbar-hidden"]}),wH=Ja({base:["shrink-0","mb-sm"]}),EH=Ja({base:[ap,...ep,"text-on-surface-variant","flex","flex-col","h-full","max-h-full","tablet:max-h-[calc(100dvh-24px)]"],variants:{open:{true:[tp]},variant:{default:[],compact:[lp]}},compoundVariants:[{open:!0,variant:"compact",class:[np]},{open:!0,variant:"default",class:[tp]}],defaultVariants:{open:!1,variant:"default"}}),LH=Ja({base:[...ep,ap,"w-full","border-outline-variant","overflow-hidden","shrink-0","sticky","bottom-none","tablet:static","px-xs2","pb-xs2","tablet:px-none","tablet:pb-none","transition-all","ease-in-out","duration-300"],variants:{open:{true:[tp,"h-[56px]"],false:["ml-[2px]","h-[32px]"]},compact:{true:[],false:[]},variant:{default:[],compact:[lp]}},compoundVariants:[{compact:!1,open:!1,class:["pl-sm!"]},{open:!0,variant:"compact",class:[np]},{open:!0,variant:"default",class:[tp]}],defaultVariants:{variant:"default"}}),yH=Ja({base:["relative","flex-1","min-h-none","overflow-hidden"]}),kH=Ja({base:["absolute","inset-none","flex","flex-col","h-full","w-full","overflow-y-auto","scrollbar-hidden","transition-transform","duration-300","ease-in-out"],variants:{state:{visible:["translate-x-0"],"hidden-right":["translate-x-full"],"hidden-left":["-translate-x-full"]}},defaultVariants:{state:"visible"}});function FH(e,a){if(!e||!a?.length)return null;const t=e.indexOf(".");return t>=0?e.slice(0,t):a.some(a=>a.parentId===e)?e:null}function NH(e,a,t){if(e.isSpacer||!a.has(e.id))return e;const l=/* @__PURE__ */x(wd,{name:"chevron-right",size:"compact"===t?"xs":"sm",color:"on-surface-variant"}),n=e.endContent?/* @__PURE__ */b(M,{children:[e.endContent,l]}):l;return{...e,endContent:n}}var _H=({menuItems:e,utilityItems:a,midSections:t,subMenus:l,userArea:n,hideUserAreaInMobile:r=!0,hideToggleButton:i=!1,addBorderToToggleButton:o=!1,logo:s,open:c=!1,variant:m="default",activeItem:d,onToggleOpen:h,onActiveItemChange:p,onItemClick:H,linkComponent:C="a"})=>{const{isSmallerThan:g}=ue(),f=g("tablet"),[A,w]=v(c),E="compact"===m,L=E,y=s?.icon??/* @__PURE__ */x(fH,{hideName:!0}),k=s?.name??/* @__PURE__ */x(fH,{hideIcon:!0}),F=Z(null),[
|
|
717
|
-
return b(M,{children:[f&&/* @__PURE__ */x(Mh,{show:A,onClick:
|
|
716
|
+
/* @__PURE__ */x("path",{d:"M23.2967 0.599916C23.3888 0.468695 23.5404 0.388599 23.7006 0.388599H27.3646C27.7634 0.388599 27.9968 0.8385 27.7668 1.1657L19.9753 12.2036C19.8833 12.3348 19.7333 12.4115 19.5731 12.4115H15.795C15.5513 12.4115 15.3434 12.2326 15.3076 11.9923L13.6545 0.954384C13.6102 0.656154 13.8403 0.388599 14.1419 0.388599H17.5673C17.8144 0.388599 18.024 0.57265 18.0564 0.81805L18.8437 6.98374L23.2967 0.598212V0.599916Z",fill:"var(--color-on-surface)"})]}),fH=({hideIcon:e=!1,hideName:a=!1,iconSize:t=22,nameHeight:l=12})=>/* @__PURE__ */b(CH,{direction:"row",gap:"xs",align:"center",justify:"center",children:[!e&&/* @__PURE__ */x(gH,{size:t}),!a&&/* @__PURE__ */x(VH,{height:l})]});fH.displayName="ZvooveBrand";var ZH=Ja({base:["flex","overflow-x-hidden","shrink-0","absolute","left-none","top-none","z-30","p-sm","pb-md","h-dvh","tablet:h-full","tablet:relative","tablet:left-none","tablet:top-none","tablet:z-10","tablet:p-none","tablet:overflow-visible"]}),vH=Ja({base:["w-full","shrink-0","flex","items-center","tablet:mt-[1px]"],variants:{variant:{default:["h-[60px]"],compact:["h-[34px]","tablet:h-[44px]","overflow-visible"]},hasLogo:{true:["gap-xs2"],false:[]},hasToggleButton:{true:[],false:[]}},compoundVariants:[{hasLogo:!0,hasToggleButton:!0,class:"justify-between"},{hasLogo:!0,hasToggleButton:!1,class:"justify-start"}],defaultVariants:{variant:"default",hasLogo:!1,hasToggleButton:!0}}),AH=Ja({base:[...ep,ap,"h-[48px]","rounded-full","cursor-pointer","flex","shrink-0","items-start","justify-start","pt-xs2","tablet:hover:bg-on-surface/3","tablet:pt-none","tablet:justify-center","tablet:items-center","border-transparent"],variants:{addBorderToToggleButton:{false:[]},variant:{default:[],compact:[lp,"h-xl2","tablet:h-[36px]"]},open:{true:[],false:[]}},compoundVariants:[{addBorderToToggleButton:!0,open:!1,class:["tablet:border-t","tablet:border-r","tablet:border-b","tablet:border-l-transparent","tablet:border-outline-variant","tablet:hover:bg-background"]},{variant:"compact",open:!1,class:["tablet:bg-background","tablet:rounded-l-none","tablet:rounded-r-sm","tablet:h-[28px]"]}],defaultVariants:{variant:"default"}}),MH=Ja({base:["flex-1","min-h-none","flex","flex-col","bg-surface","tablet:bg-transparent","rounded-md","tablet:rounded-none","overflow-hidden","shadow-elevation2","tablet:shadow-none","relative","w-full",...ep],variants:{open:{false:["-translate-x-full","-left-md","tablet:-left-none","tablet:-translate-x-none"]},isCompact:{true:["mt-[5px]"],false:[]}}}),xH=Ja({base:["transition-all","ease-in-out","duration-300","tablet:pb-sm"],variants:{open:{true:[],false:[]},variant:{default:[],compact:["mt-none","tablet:mt-xs"]},section:{main:[],subMenuBack:[]}},compoundVariants:[{section:"main",open:!0,class:"mb-none"},{section:"main",open:!1,class:"mb-none tablet:mb-md"},{section:"subMenuBack",class:"mb-none"}],defaultVariants:{open:!1,variant:"default",section:"main"}}),bH=Ja({base:["flex-1","min-h-none","flex","flex-col","justify-between","overflow-y-auto","scrollbar-hidden"]}),wH=Ja({base:["shrink-0","mb-sm"]}),EH=Ja({base:[ap,...ep,"text-on-surface-variant","flex","flex-col","h-full","max-h-full","tablet:max-h-[calc(100dvh-24px)]"],variants:{open:{true:[tp]},variant:{default:[],compact:[lp]}},compoundVariants:[{open:!0,variant:"compact",class:[np]},{open:!0,variant:"default",class:[tp]}],defaultVariants:{open:!1,variant:"default"}}),LH=Ja({base:[...ep,ap,"w-full","border-outline-variant","overflow-hidden","shrink-0","sticky","bottom-none","tablet:static","px-xs2","pb-xs2","tablet:px-none","tablet:pb-none","transition-all","ease-in-out","duration-300"],variants:{open:{true:[tp,"h-[56px]"],false:["ml-[2px]","h-[32px]"]},compact:{true:[],false:[]},variant:{default:[],compact:[lp]}},compoundVariants:[{compact:!1,open:!1,class:["pl-sm!"]},{open:!0,variant:"compact",class:[np]},{open:!0,variant:"default",class:[tp]}],defaultVariants:{variant:"default"}}),yH=Ja({base:["relative","flex-1","min-h-none","overflow-hidden"]}),kH=Ja({base:["absolute","inset-none","flex","flex-col","h-full","w-full","overflow-y-auto","scrollbar-hidden","transition-transform","duration-300","ease-in-out"],variants:{state:{visible:["translate-x-0"],"hidden-right":["translate-x-full"],"hidden-left":["-translate-x-full"]}},defaultVariants:{state:"visible"}});function FH(e,a){if(!e||!a?.length)return null;const t=e.indexOf(".");return t>=0?e.slice(0,t):a.some(a=>a.parentId===e)?e:null}function NH(e,a,t){if(e.isSpacer||!a.has(e.id))return e;const l=/* @__PURE__ */x(wd,{name:"chevron-right",size:"compact"===t?"xs":"sm",color:"on-surface-variant"}),n=e.endContent?/* @__PURE__ */b(M,{children:[e.endContent,l]}):l;return{...e,endContent:n}}var _H=({menuItems:e,utilityItems:a,midSections:t,subMenus:l,userArea:n,hideUserAreaInMobile:r=!0,hideToggleButton:i=!1,addBorderToToggleButton:o=!1,logo:s,open:c=!1,variant:m="default",activeItem:d,onToggleOpen:h,onActiveItemChange:p,onItemClick:H,linkComponent:C="a"})=>{const{isSmallerThan:g}=ue(),f=g("tablet"),[A,w]=v(c),E="compact"===m,L=E,y=s?.icon??/* @__PURE__ */x(fH,{hideName:!0}),k=s?.name??/* @__PURE__ */x(fH,{hideIcon:!0}),F=s?.hideIconWhenOpen??!1,N=Z(null),[_,S]=v(()=>FH(d,l)),[I,D]=v(()=>FH(d,l)),[T,O]=v(()=>FH(d,l)),z=FH(d,l),R=function(e){if(void 0===e)return{layerId:null,itemId:void 0};const a=e.indexOf(".");return-1===a?{layerId:null,itemId:e}:{layerId:e.slice(0,a),itemId:e.slice(a+1)}}(d).itemId??d,B=z??T??R,U=[...(l??[]).map(e=>e.parentId)].sort((e,a)=>e.localeCompare(a)).join("|"),j=V(()=>U?new Set(U.split("|")):/* @__PURE__ */new Set,[U]),W=V(()=>e.map(e=>NH(e,j,m)),[e,j,m]),P=V(()=>{if(a)return a.map(e=>NH(e,j,m))},[a,j,m]),$=V(()=>(t??[]).map(e=>({...e,items:e.items.map(e=>NH(e,j,m))})),[t,j,m]);u(()=>{const e=FH(d,l);S(e),e?(D(e),O(e)):O(null)},[d,U]);const G=l?.find(e=>e.parentId===I),q=V(()=>{if(!G)return[];const l=function(e,a,t,l){const n=a=>a.find(a=>a.id===e&&!a.isSpacer),r=n(a)?.label;if(r)return r;if(t?.length){const e=n(t)?.label;if(e)return e}if(l?.length)for(const i of l){const e=n(i.items)?.label;if(e)return e}return e}(G.parentId,e,a,t);return[{id:"__back__",label:G.backLabel??"Hauptmenü",icon:"arrow-back",endContent:/* @__PURE__ */x(ZC,{label:l,variant:"outlined",size:"small",color:"neutral"})}]},[G,e,a,t]),Y=()=>{const e=!A;!e&&f&&N.current?.scrollTo({top:0,behavior:"smooth"}),w(e),h&&h(e)},X=e=>{if(e.isSpacer)return;const a=a=>{"_blank"!==e.target&&p?.(a)};if(l?.some(a=>a.parentId===e.id))return a(e.id),S(e.id),D(e.id),O(e.id),void H?.(e);if("__back__"===e.id)return S(null),void H?.(e);const t="function"==typeof e.onClick;t||a(e.id),!t&&f&&Y(),O(null),H?.(e)};u(()=>{w(c)},[c]);const K=i?null:/* @__PURE__ */b("button",{type:"button",onClick:Y,className:AH({variant:m,open:A,addBorderToToggleButton:o}),children:[/* @__PURE__ */x("span",{className:"hidden tablet:block",children:/* @__PURE__ */x(wd,{name:"sidebar",size:E?"xs":"lg",color:"on-surface-variant"})}),/* @__PURE__ */x("span",{className:"block tablet:hidden",children:/* @__PURE__ */x(wd,{name:A?"close":"menu",size:E?"xs":"lg",color:A?"on-scrim":"on-surface-variant"})})]}),J=Boolean(K)||L&&!f&&E,Q=/* @__PURE__ */b(M,{children:[/* @__PURE__ */b("div",{children:[/* @__PURE__ */x("div",{className:xH({open:A,variant:m}),children:/* @__PURE__ */x(pp,{items:W,activeItem:B,open:A,variant:m,linkComponent:C,onItemClick:X})}),/* @__PURE__ */x(bp,{sections:$,open:A,variant:m,activeItem:R,linkComponent:C,onItemClick:X})]}),P&&/* @__PURE__ */x("div",{className:wH(),children:/* @__PURE__ */x(pp,{items:P,activeItem:R,open:A,variant:m,linkComponent:C,onItemClick:X})})]});/* @__PURE__ */
|
|
717
|
+
return b(M,{children:[f&&/* @__PURE__ */x(Mh,{show:A,onClick:Y}),/* @__PURE__ */x("div",{className:ZH(),children:/* @__PURE__ */b("div",{className:EH({open:A,variant:m}),children:[J&&/* @__PURE__ */b("div",{className:vH({variant:m,hasLogo:L,hasToggleButton:!i}),children:[L&&!f&&/* @__PURE__ */b("div",{className:"flex shrink-0 items-center gap-xs overflow-hidden",children:[/* @__PURE__ */x("span",{className:"flex shrink-0 items-center justify-center transition-all duration-500 ease-in-out "+(F&&A?"w-none opacity-0":"w-[34px] opacity-100"),children:y}),/* @__PURE__ */x("span",{className:"transition-all duration-500 ease-in-out "+(A?"max-w-[200px] opacity-100":"max-w-none opacity-0"),children:k})]}),K]}),/* @__PURE__ */b("div",{className:MH({open:A,isCompact:E}),children:[/* @__PURE__ */x("div",{ref:N,className:bH(),children:l?.length?/* @__PURE__ */b("div",{className:yH(),children:[/* @__PURE__ */x("div",{className:kH({state:_?"hidden-left":"visible"}),children:Q}),/* @__PURE__ */x("div",{className:kH({state:_?"visible":"hidden-right"}),onTransitionEnd:e=>{e.target===e.currentTarget&&(_||D(null))},children:G&&/* @__PURE__ */b(M,{children:[/* @__PURE__ */x("div",{className:xH({open:A,variant:m,section:"subMenuBack"}),children:/* @__PURE__ */x(pp,{items:q,activeItem:void 0,open:A,variant:m,linkComponent:C,onItemClick:X})}),G.content]})})]}):Q}),n&&!(r&&f)&&/* @__PURE__ */x("div",{className:LH({open:A,variant:m,compact:E}),children:/* @__PURE__ */x(Rg,{...n,showInfo:A,compact:!A})})]})]})})]})},SH=Ja({base:["bg-surface-container","block","cursor-progress"],variants:{borderRadius:{xs:["rounded-xs"],sm:["rounded-sm"],md:["rounded-md"],lg:["rounded-lg"],xl:["rounded-xl"],full:["rounded-full"]},animation:{pulse:["animate-pulse"],wave:["bg-gradient-to-r","from-transparent","via-surface-container-lowest","to-transparent","bg-[length:200%_100%]","animate-[wave_1.5s_ease-in-out_infinite]"],false:["animate-none"]}}}),IH=s(({borderRadius:e="xs",animation:a="pulse",width:t="100%",height:l=16,...n},r)=>{const{className:i,...o}=n;return Kc(void 0!==i,"className is not supported on Skeleton component. Please use the width and height props instead."),/* @__PURE__ */x("div",{"aria-hidden":"true",className:SH({borderRadius:e,animation:a}),style:{width:"number"==typeof t?`${t}px`:t,height:"number"==typeof l?`${l}px`:l},ref:r,...o})});IH.displayName="Skeleton";var DH={default:{name:"info"},positive:{name:"check-circle",weight:"fill"},warning:{name:"warning"},error:{name:"error",weight:"fill"},subtle:{name:"info"}},TH={default:"inverse-surface",positive:"green-container",warning:"yellow-container",error:"error-container",subtle:"steel-blue-container"},OH={default:"inverse-on-surface",positive:"on-green-container",warning:"on-yellow-container",error:"on-error-container",subtle:"on-steel-blue-container"},zH=i(null),RH=Ja({base:["fixed","z-[9999]","pointer-events-none","flex","gap-sm"],variants:{placement:{"top-left":["top-[24px]","left-[24px]","bottom-auto","right-auto","flex-col","items-start"],"top-center":["top-[24px]","left-1/2","-translate-x-1/2","bottom-auto","right-auto","flex-col","items-center"],"top-right":["top-[24px]","right-[24px]","bottom-auto","left-auto","flex-col","items-end"],"bottom-left":["bottom-[72px]","left-[24px]","top-auto","right-auto","flex-col","items-start"],"bottom-center":["bottom-[72px]","left-1/2","-translate-x-1/2","top-auto","right-auto","flex-col","items-center"],"bottom-right":["bottom-[72px]","right-[24px]","top-auto","left-auto","flex-col","items-end"]}}}),BH=Ja({base:["relative","group","transition-all","duration-200","ease-in-out","w-[420px]","h-fit"],variants:{isHovered:{true:["gap-sm"],false:["gap-none"]},placement:{"top-left":["self-start"],"top-center":["self-center"],"top-right":["self-end"],"bottom-left":["self-start"],"bottom-center":["self-center"],"bottom-right":["self-end"]}}}),UH=Ja({base:["pointer-events-auto","transition-all","duration-300","ease-out","transform","absolute","animate-in","fade-in","w-full","rounded-sm","flex","flex-col","justify-end","items-end"],variants:{position:{0:["z-30"],1:["z-20"],2:["z-10"]},isHovered:{true:[],false:[]},placement:{"top-left":["slide-in-from-top-4"],"top-center":["slide-in-from-top-4"],"top-right":["slide-in-from-top-4"],"bottom-left":["slide-in-from-bottom-4"],"bottom-center":["slide-in-from-bottom-4"],"bottom-right":["slide-in-from-bottom-4"]},isMounted:{true:["opacity-100"],false:["opacity-0"]},isRemoving:{true:["animate-out!","fade-out!","scale-95!","opacity-0!"],false:[]}},compoundVariants:[{placement:"top-left",isMounted:!1,class:["-translate-y-full","opacity-0"]},{placement:"top-center",isMounted:!1,class:["-translate-y-full","opacity-0"]},{placement:"top-right",isMounted:!1,class:["-translate-y-full","opacity-0"]},{placement:"bottom-left",isMounted:!1,class:["translate-y-full","opacity-0"]},{placement:"bottom-center",isMounted:!1,class:["translate-y-full","opacity-0"]},{placement:"bottom-right",isMounted:!1,class:["translate-y-full","opacity-0"]}]}),jH=Ja({base:["text-label-large","cursor-pointer","hover:opacity-80","transition-opacity"],variants:{variant:{default:["text-inverse-on-surface"],positive:["text-on-green-container"],warning:["text-on-yellow-container"],error:["text-on-error-container"],subtle:["text-on-steel-blue-container"]}}}),WH=Ja({base:["flex","items-center","justify-center","shrink-0","cursor-pointer","hover:opacity-70","transition-opacity"]}),PH=()=>{const e=a.useContext(zH);if(!e)throw new Error("Snackbar must be used within a SnackbarProvider");const{snackbars:t,removeSnackbar:l,pauseTimeouts:n,resumeTimeouts:r}=e,[i,o]=v(/* @__PURE__ */new Map),[s,c]=v(/* @__PURE__ */new Set),[m,d]=v(/* @__PURE__ */new Map),[h,p]=v(/* @__PURE__ */new Map),H=Z(/* @__PURE__ */new Map),C=Z(/* @__PURE__ */new Map),g=Z(/* @__PURE__ */new Map);if(u(()=>{for(const l of t)if(!s.has(l.id)&&!H.current.has(l.id)){const e=setTimeout(()=>{c(e=>new Set(e).add(l.id)),H.current.delete(l.id)},10);H.current.set(l.id,e)}const e=new Set(t.map(e=>e.id)),a=[];for(const t of s)e.has(t)||a.push(t);if(a.length>0){const e=setTimeout(()=>{c(e=>{const t=new Set(e);for(const l of a)t.delete(l);return t})},0);return()=>clearTimeout(e)}},[t,s]),u(()=>{const e=H.current,a=C.current;return()=>{for(const a of e.values())clearTimeout(a);for(const e of a.values())clearTimeout(e)}},[]),u(()=>{const e=new Set(t.map(e=>e.placement));for(const[a,t]of i.entries())if(!e.has(a)&&t){const e=setTimeout(()=>{o(e=>{const t=new Map(e);return t.delete(a),t})},0);return()=>clearTimeout(e)}},[t,i]),u(()=>{const e=new ResizeObserver(e=>{const a=new Map(m);let l=!1;for(const n of e){const e=n.target.dataset.snackbarId;if(e){const r=n.contentRect.height,o=t.find(a=>a.id===e);if(o){const a=o.placement,l=i.get(a)||!1,n=[...t.filter(e=>e.placement===a)].reverse().findIndex(a=>a.id===e);(l||0===(0===n?0:Math.min(n,2)))&&h.get(e)!==r&&p(a=>{const t=new Map(a);return t.set(e,r),t})}a.get(e)!==r&&(a.set(e,r),l=!0)}}l&&d(a)});for(const a of g.current.values())a&&e.observe(a);return()=>{e.disconnect()}},[t,m,i,h]),0===t.length)return null;const V=t.reduce((e,a)=>{const t=a.placement;return e[t]||(e[t]=[]),e[t].push(a),e},{});return E(/* @__PURE__ */x(M,{children:Object.entries(V).map(([e,a])=>{const t=[...a].reverse(),c=e,d=i.get(c)||!1;/* @__PURE__ */
|
|
718
718
|
return x("div",{className:RH({placement:c}),children:/* @__PURE__ */x("div",{className:BH({isHovered:d,placement:c}),onMouseEnter:()=>{const e=C.current.get(c);e&&(clearTimeout(e),C.current.delete(c)),o(e=>new Map(e).set(c,!0)),n()},onMouseLeave:()=>{r();const e=C.current.get(c);e&&clearTimeout(e);const a=setTimeout(()=>{o(e=>{const a=new Map(e);return a.delete(c),a}),C.current.delete(c)},100);C.current.set(c,a)},children:t.map((e,a)=>{const n=Math.min(a,2),r=e.isRemoving||!1,i=e.icon?"string"==typeof e.icon?{name:e.icon}:e.icon:void 0,o=!!e.actionLabel&&!!e.onAction,p=e.showCloseButton,u=e.actionLabel?52:56,H=e.children.length+(e.actionLabel?.length||0),C=(()=>{if(0===n)return 0;if(d){let e=0;for(let l=0;l<a;l++){const a=t[l];e+=(h.get(a.id)||m.get(a.id)||60)+8}return e}{const e=h.get(t[0].id)||m.get(t[0].id)||60,a=Math.min(.3*e,20);return n*Math.min(10,a/2)}})(),V=c.startsWith("top")?C:-C,f=s.has(e.id),Z={},v={};if(f&&!r){const e=d||0===n?1:1===n?.95:.9,a=h.get(t[0].id)||m.get(t[0].id)||60;d?(Z.transform=`translateY(${V}px) scale(${e})`,v.opacity="1"):(Z.transform=`translateY(${V}px) scale(${e})`,v.height=`${a}px`,v.maxHeight=`${a}px`,v.opacity=0===n?"1":"0")}/* @__PURE__ */
|
|
719
719
|
return x("div",{ref:a=>{a?g.current.set(e.id,a):g.current.delete(e.id)},"data-snackbar-id":e.id,className:UH({position:n,isHovered:d,placement:c,isMounted:f,isRemoving:r}),style:Z,children:/* @__PURE__ */x(Wm,{bgColor:TH[e.variant],elevation:1,width:"100%",minWidth:"280px",maxWidth:"560px",borderRadius:"sm",padding:"none",children:/* @__PURE__ */x("div",{style:v,className:"overflow-hidden transition-all duration-200 ease-in-out",children:/* @__PURE__ */b(CH,{direction:H>u?"column":"row",gap:H>u?"xs":"xl",padding:"sm",justify:"space-between",align:"center",wrap:"nowrap",height:"100%",minHeight:"48px",children:[/* @__PURE__ */b(Ph,{columns:"auto 1fr",gap:"sm",children:[/* @__PURE__ */x(wd,{...i||DH[e.variant],color:OH[e.variant]}),/* @__PURE__ */x("div",{className:"flex items-center",children:/* @__PURE__ */x(_p,{color:OH[e.variant],children:e.children})})]}),(o||e.showCloseButton)&&/* @__PURE__ */b(CH,{direction:"row",gap:"sm",justify:"flex-end",align:H>u?"flex-start":"center",width:H>u?"100%":"fit-content",height:"100%",children:[o&&/* @__PURE__ */x("button",{className:jH({variant:e.variant}),onClick:()=>{e.onAction?.(e.id),e.duration>0&&l(e.id)},children:e.actionLabel}),p&&/* @__PURE__ */x("button",{className:WH(),onClick:()=>{e.onClose?.(e.id),l(e.id)},"aria-label":"Close snackbar",children:/* @__PURE__ */x(wd,{name:"close",size:"sm",color:OH[e.variant]})})]})]})})})},e.id)})})},e)})}),document.body)};PH.displayName="Snackbar";var $H=({children:e,maxSnackbars:a=3,defaultDuration:t=5e3})=>{const[l,n]=v([]),r=Z(/* @__PURE__ */new Map),i=Z(!1),o=h(e=>{const a=r.current.get(e);a?.timeoutId&&clearTimeout(a.timeoutId),r.current.delete(e),n(a=>a.map(a=>a.id===e?{...a,isRemoving:!0}:a)),setTimeout(()=>{n(a=>a.filter(a=>a.id!==e))},300)},[]),s=h((e,l={})=>{const s=l.id||Math.random().toString(36).substring(2,11),c={id:s,children:e,variant:l.variant||"default",placement:l.placement||"top-right",showCloseButton:l.showCloseButton??!0,icon:l.icon,actionLabel:l.actionLabel,onAction:l.onAction,onClose:l.onClose,duration:l.duration??t,createdAt:Date.now()};n(e=>{const t=e.filter(e=>e.placement===c.placement),l=e.filter(e=>e.placement!==c.placement),n=[...t,c];return[...l,...n.length>a?n.slice(-a):n]});const m=c.duration;if(m&&m>0){const e=Date.now();let a=null;i.current||(a=setTimeout(()=>{o(s)},m)),r.current.set(s,{timeoutId:a,startTime:e,remainingDuration:m})}return s},[t,a,o]),c=h(()=>{for(const e of r.current.values())e.timeoutId&&clearTimeout(e.timeoutId);r.current.clear(),n([])},[]),m=h(()=>{if(i.current)return;i.current=!0;const e=Date.now();for(const[a,t]of r.current.entries())if(t.timeoutId){const l=e-t.startTime,n=Math.max(0,t.remainingDuration-l);clearTimeout(t.timeoutId),r.current.set(a,{...t,timeoutId:null,remainingDuration:n})}},[]),d=h(()=>{if(!i.current)return;i.current=!1;const e=Date.now();for(const[a,t]of r.current.entries())if(t.remainingDuration>0&&!t.timeoutId){const l=setTimeout(()=>{o(a)},t.remainingDuration);r.current.set(a,{timeoutId:l,startTime:e,remainingDuration:t.remainingDuration})}},[o]),p=V(()=>({snackbars:l,addSnackbar:s,removeSnackbar:o,clearAll:c,pauseTimeouts:m,resumeTimeouts:d}),[l,s,o,c,m,d]);/* @__PURE__ */
|
|
720
720
|
return x(zH.Provider,{value:p,children:e})},GH=()=>{const{addSnackbar:e,removeSnackbar:a,clearAll:t}=(()=>{const e=p(zH);if(!e)throw new Error("useSnackbarContext must be used within a SnackbarProvider");return e})();return{snackbar:h((a,t)=>e(a,t),[e]),dismiss:h(e=>{a(e)},[a]),dismissAll:h(()=>{t()},[t])}},qH=Ja({base:["relative","inline-flex","items-center","cursor-pointer","border-2","rounded-full","transition-colors","w-[52px]","h-[32px]","shrink-0","group","has-[:focus-visible]:ring-2","has-[:focus-visible]:ring-primary","has-[:focus-visible]:ring-offset-2","has-[:focus-visible]:outline-variant-low-none"],variants:{checked:{true:["bg-primary","border-primary","peer-hover/thumb:bg-primary-container"],false:["bg-transparent","border-outline-variant-low"]},disabled:{true:["opacity-10","!cursor-not-allowed"]}},compoundVariants:[{checked:!0,disabled:!0,class:["border-outline-variant-low!","bg-outline-variant-low!"]}],defaultVariants:{checked:!1,disabled:!1}}),YH=Ja({base:["rounded-full","transform","transition-all","flex","items-center","justify-center",'before:content-[""]',"before:absolute","before:size-[24px]","before:rounded-full","before:transition-all","before:transform","before:opacity-0",'after:content-[""]',"after:absolute","after:size-full","after:rounded-full","after:transition-colors","after:top-[0]","after:left-[0]"],variants:{checked:{true:["size-[24px]","translate-x-[22px]","bg-primary-container","text-on-primary-container","after:bg-on-primary","group-hover:after:bg-primary-container","before:bg-primary"],false:["translate-x-[3px]","text-on-primary","after:bg-outline-variant-low","group-hover:after:bg-on-surface-variant","before:bg-outline-variant-low"]},animate:{true:["before:animate-ripple"]},disabled:{true:[]},withIcons:{true:[]}},compoundVariants:[{checked:!0,disabled:!0,class:["after:bg-container"]},{checked:!1,disabled:!0,class:["after:bg-outline-variant-low"]},{checked:!1,withIcons:!0,class:["size-[24px]","before:top-[0]","before:left-[0]"]},{checked:!1,withIcons:!1,class:["size-[16px]","translate-x-[6px]","before:top-[-4px]","before:left-[-4px]"]}],defaultVariants:{checked:!1}}),XH=s(({checked:e=!1,disabled:a=!1,onChange:t=()=>{},name:l,value:n,id:r,withIcons:i=!1,label:o,labelPlacement:s="left",justify:c="flex-start",...m},d)=>{const[h,p]=v(!1),u=H(),C=r??u,g=void 0!==o;Kc(!g&&!m["aria-label"],"@zvoove/unity-ui: Switch must have a label or aria-label");const V=e=>{a||(p(!0),t(e),setTimeout(()=>{p(!1)},500))};let f=null;!0===i?f={on:"check",off:"close"}:!1!==i&&(f=i);const Z=["space-between","space-around","space-evenly","flex-end","center"].includes(c);/* @__PURE__ */
|
|
@@ -722,8 +722,8 @@ return x("label",{htmlFor:C,className:`cursor-pointer ${Z?"w-full":"w-fit"} inli
|
|
|
722
722
|
/* @__PURE__ */b("span",{className:qH({checked:e,disabled:a}),children:[/* @__PURE__ */x("input",{id:C,name:l,value:n,type:"checkbox",checked:e,"aria-checked":e,"aria-disabled":a,disabled:a,onChange:V,onKeyDown:a=>{"Space"===a.key&&(a.preventDefault(),a.stopPropagation(),V({target:{checked:e}}))},className:"sr-only",ref:d,tabIndex:a?-1:0,...m}),/* @__PURE__ */b("div",{className:YH({checked:e,animate:h,disabled:a,withIcons:null!==f}),children:[f&&e&&/* @__PURE__ */x("div",{className:"z-1","data-testid":"icon-on",children:/* @__PURE__ */x(wd,{name:f.on,size:"2xs"})}),f&&!e&&/* @__PURE__ */x("div",{className:"z-1","data-testid":"icon-off",children:/* @__PURE__ */x(wd,{name:f.off,size:"2xs"})})]})]}),g&&"right"===s&&/* @__PURE__ */b(_p,{variant:"body",size:"large",children:["string"==typeof o&&o,"object"==typeof o&&/* @__PURE__ */x(M,{children:e?o.on:o.off})]})]})})});XH.displayName="Switch";var KH=Ja({base:["overflow-x-auto"]}),JH=Ja({base:["table-auto","w-full"]}),QH=Ja({base:["py-md","px-sm","border-b","border-outline-variant","max-mobile:hidden"],variants:{hasBackgroundColor:{true:["bg-surface-container-low"]}}}),eC=Ja({base:["text-body-medium","not-last:border-b","transition-colors","transition-all","border-outline-variant","[&+tr]:transition-all","[&+tr]:duration-200","[&+tr]:ease-in-out","mobile:hover:bg-surface-container-lowest","max-mobile:block","max-mobile:odd:bg-surface-container-lowest"],variants:{isSubRow:{true:["border-b-0!","hover:bg-transparent"]},isLastWithSubRow:{true:["border-b-0!"]},isOpen:{true:["[&+tr]:border-t","[&+tr]:border-outline-variant"]},isSubRowOpen:{true:["bg-surface-container-lowest"]}}}),aC=Ja({base:["p-sm","relative","max-mobile:p-xs","max-mobile:inline-flex","max-mobile:w-full","max-mobile:justify-between","max-mobile:before:content-[attr(data-label)]","max-mobile:before:text-label-large","max-mobile:gap-sm"],variants:{variant:{header:["not-last:after:absolute","not-last:after:right-[0px]","not-last:after:top-1/2","not-last:after:-translate-y-1/2","not-last:after:w-px","not-last:after:h-[12px]","not-last:after:bg-outline-variant"]},orderable:{true:["cursor-pointer"]}}}),tC="asc",lC="desc",nC="left",rC="center",iC="right",oC=e=>{let a="flex-start";return e===iC&&(a="flex-end"),e===rC&&(a="center"),e===nC&&(a="flex-start"),a},sC=({data:e,columns:t,title:l,subtitle:n,actions:r,filters:i,footer:o,orderBy:s,onOrderByChange:c,emptyState:m,hiddenColumns:d,loading:h=!1,expandedRows:p,headerBackgroundColor:u=!1})=>{const{isSmallerThan:H}=ue(),C=t.filter(e=>!d?.includes(e.id));/* @__PURE__ */
|
|
723
723
|
return b(Wm,{variant:"outlined",padding:"none",overflow:"hidden",children:[(r||l)&&/* @__PURE__ */b(M,{children:[/* @__PURE__ */b(CH,{padding:{y:"xs",x:"md"},direction:{minimum:"column",mobile:"row"},justify:"space-between",align:"center",children:[l?/* @__PURE__ */x(M,{children:l&&/* @__PURE__ */b(CH,{gap:"none",padding:{y:"xs"},children:[/* @__PURE__ */x(_p,{variant:"title",size:"large",as:"h1",children:l}),n&&/* @__PURE__ */x(_p,{color:"on-surface-variant",children:n})]})}):/* @__PURE__ */x("div",{}),/* @__PURE__ */x("div",{children:/* @__PURE__ */x(CH,{direction:"row",gap:"none",children:r})})]}),/* @__PURE__ */x(Fh,{})]}),i&&/* @__PURE__ */b(M,{children:[/* @__PURE__ */x(CH,{padding:"md",direction:"row",gap:"sm",align:"center",children:i}),/* @__PURE__ */x(Fh,{})]}),
|
|
724
724
|
/* @__PURE__ */x("div",{className:KH(),children:/* @__PURE__ */b("table",{className:JH(),children:[/* @__PURE__ */x("thead",{children:/* @__PURE__ */x("tr",{className:QH({hasBackgroundColor:u}),children:C.map(e=>/* @__PURE__ */x("th",{className:aC({variant:"header",orderable:e.orderable}),style:{width:e.width,minWidth:e.minWidth,textAlign:e.align??nC},role:e.orderable?"button":void 0,tabIndex:e.orderable?0:void 0,onClick:()=>{e.orderable&&c?.({columnId:e.id,direction:s?.direction===tC?lC:tC})},children:/* @__PURE__ */b(CH,{direction:"row",gap:"xs",align:"center",justify:oC(e.align??nC),children:[/* @__PURE__ */x(_p,{variant:"label",size:"large",wrap:!1,as:"span",children:e.label}),e.orderable&&/* @__PURE__ */x(wd,{name:s?.column===e.id?s.direction===tC?"arrow-up":"arrow-down":"minus",size:"sm",color:"on-surface"})]})},`${e.id}-header`))})}),/* @__PURE__ */x("tbody",{children:h?/* @__PURE__ */x(M,{children:Array.from({length:10}).map((e,a)=>/* @__PURE__ */x("tr",{className:eC(),children:C.map(e=>/* @__PURE__ */x("td",{className:aC(),align:e.align??nC,children:/* @__PURE__ */x(IH,{width:`${Math.floor(61*Math.random())+40}%`})},`${e.id}-row-loading`))},`row-loading-${a}`))}):e.length>0?e.map((t,l)=>{const n=l===e.length-1,r=!!t.expandableRow,i=n&&r,o=p?.includes(t.expandableRow?.id??"");/* @__PURE__ */
|
|
725
|
-
return b(a.Fragment,{children:[/* @__PURE__ */x("tr",{className:eC({isLastWithSubRow:i&&!o,isSubRowOpen:o}),children:C.map(e=>{const a=t[e.id];let n;return n="string"==typeof a?/* @__PURE__ */x(_p,{variant:"body",as:"span",textAlign:H("tablet")?iC:e.align??nC,children:a}):a,/* @__PURE__ */x("td",{className:aC(),align:e.align??nC,"data-label":e.label,children:n},`${e.id}-row-${l}`)})},`row-${l}`),t.expandableRow&&/* @__PURE__ */x("tr",{className:eC({isSubRow:!0,isOpen:p?.includes(t.expandableRow?.id??"")}),"data-type":"expandable-row",children:/* @__PURE__ */x("td",{colSpan:C.length,align:nC,children:/* @__PURE__ */x(Cd,{isOpen:p?.includes(t.expandableRow?.id??""),children:/* @__PURE__ */x("div",{className:aC(),children:t.expandableRow.render})})})},t.expandableRow.id?`expandable-row-${t.expandableRow.id}`:`expandable-row-${l}`)]},`row-fragment-${l}`)}):/* @__PURE__ */x("tr",{children:/* @__PURE__ */x("td",{colSpan:t.length,className:aC(),align:rC,children:m||/* @__PURE__ */x(_p,{variant:"body",as:"span",children:"Keine Daten gefunden"})})})})]})}),o&&/* @__PURE__ */b(M,{children:[/* @__PURE__ */x(Fh,{}),/* @__PURE__ */x(CH,{padding:"md",children:o})]})]})};sC.displayName="Table";var cC=Ja({base:["w-full","relative"]}),mC=Ja({base:["w-full","p-md"],variants:{active:{true:["block"],false:["hidden"]}}}),dC=Ja({base:["w-full","relative"],variants:{hasArrows:{true:["px-
|
|
726
|
-
return b("div",{className:cC(),children:[/* @__PURE__ */b("div",{className:dC({hasArrows:s.left||s.right,hideBorder:l,isSticky:r}),ref:g,children:[
|
|
725
|
+
return b(a.Fragment,{children:[/* @__PURE__ */x("tr",{className:eC({isLastWithSubRow:i&&!o,isSubRowOpen:o}),children:C.map(e=>{const a=t[e.id];let n;return n="string"==typeof a?/* @__PURE__ */x(_p,{variant:"body",as:"span",textAlign:H("tablet")?iC:e.align??nC,children:a}):a,/* @__PURE__ */x("td",{className:aC(),align:e.align??nC,"data-label":e.label,children:n},`${e.id}-row-${l}`)})},`row-${l}`),t.expandableRow&&/* @__PURE__ */x("tr",{className:eC({isSubRow:!0,isOpen:p?.includes(t.expandableRow?.id??"")}),"data-type":"expandable-row",children:/* @__PURE__ */x("td",{colSpan:C.length,align:nC,children:/* @__PURE__ */x(Cd,{isOpen:p?.includes(t.expandableRow?.id??""),children:/* @__PURE__ */x("div",{className:aC(),children:t.expandableRow.render})})})},t.expandableRow.id?`expandable-row-${t.expandableRow.id}`:`expandable-row-${l}`)]},`row-fragment-${l}`)}):/* @__PURE__ */x("tr",{children:/* @__PURE__ */x("td",{colSpan:t.length,className:aC(),align:rC,children:m||/* @__PURE__ */x(_p,{variant:"body",as:"span",children:"Keine Daten gefunden"})})})})]})}),o&&/* @__PURE__ */b(M,{children:[/* @__PURE__ */x(Fh,{}),/* @__PURE__ */x(CH,{padding:"md",children:o})]})]})};sC.displayName="Table";var cC=Ja({base:["w-full","relative"],variants:{isSticky:{true:["sticky","top-none","z-10"],false:["relative"]}}}),mC=Ja({base:["w-full","p-md"],variants:{active:{true:["block"],false:["hidden"]}}}),dC=Ja({base:["w-full","relative"],variants:{hasArrows:{true:["px-xl"]},hideBorder:{true:["border-none"],false:["border-b","border-b-surface-container-highest"]},isSticky:{true:["sticky","top-none","bg-surface/50","backdrop-blur","z-10"]}}}),hC=Ja({base:["w-full","overflow-x-auto","overflow-y-hidden","scrollbar-hidden ","relative"]}),pC=Ja({base:["flex","gap-md","relative"],variants:{hasArrows:{false:["px-xl","w-full"],true:["w-fit"]},itemsAlignment:{left:["justify-start"],center:["justify-center"],right:["justify-end"],between:["justify-between"],around:["justify-around"],evenly:["justify-evenly"]}}}),uC=Ja({base:["cursor-pointer","transition-colors","duration-300","px-md","py-sm","whitespace-nowrap"],variants:{active:{false:["hover:bg-on-surface/8"],true:["hover:bg-primary/8"]},activity:{true:["relative","after:absolute","after:bottom-1/2","after:translate-y-1/2","after:right-xs2","after:size-xs","after:shrink-0","after:rounded-full","after:bg-primary"]}}}),HC=Ja({base:["absolute","bottom-none","h-[3px]","rounded-t-lg","z-10","bg-primary"],variants:{initial:{true:["transition-none"],false:["transition-[left,width]","duration-300","ease-in-out"]}},defaultVariants:{initial:!1}}),CC=Ja({base:["absolute","top-none","cursor-pointer","h-full","w-xl","flex","items-center","justify-center","z-50","transition-all","duration-300","hover:bg-on-surface/8"],variants:{direction:{left:["left-none"],right:["right-none"]},visible:{true:["opacity-100","pointer-events-auto"],false:["opacity-0","pointer-events-none"]}}}),gC=({item:e,activeItem:a,onChange:t,hasActivity:l,scrollContainerRef:n,tabRefs:r,setTabRef:i,index:s,linkComponent:c="button",isActive:m})=>/* @__PURE__ */o(c,{...e,key:e.id,ref:e=>{i(s,e)},role:"tab","aria-selected":m,"aria-controls":`tab-panel-${e.id}`,onClick:()=>{if(t?.({...e,hasActivity:l}),n.current&&r?.current){const e=r.current[s],a=n.current,t=a.clientWidth,l=e.offsetLeft-t/2+e.offsetWidth/2;a.scrollTo({left:l,behavior:"smooth"})}},className:uC({active:m,activity:l})},/* @__PURE__ */x(CH,{direction:"row",align:"center",gap:"sm",children:/* @__PURE__ */b(CH,{direction:"top"===e.iconPosition?"column":"row",align:"center",gap:"top"===e.iconPosition?"xs2":"xs",children:[e.icon&&/* @__PURE__ */x(wd,{name:e.icon,size:"sm",color:m?"primary":"on-surface-variant"}),!e.hideLabel&&/* @__PURE__ */x(_p,{as:"span",variant:"title",size:"small",color:e.id===a?"primary":"on-surface-variant",children:e.label})]})})),VC=({items:e,activeItem:a,onChange:t,hideBorder:l=!1,itemsAlignment:n="left",isSticky:r=!0,panels:i,linkComponent:o="button"})=>{const[s,c]=v({left:!1,right:!1}),[m,h]=v({left:0,width:0}),[p,H]=v(!0),C=Z([]),g=Z(null),V=Z(null),f=Z(null),A=()=>{if(f.current){const{scrollLeft:e,scrollWidth:a,clientWidth:t}=f.current;c({left:e>0,right:e<a-t-1})}};u(()=>{const e=f.current;if(e){e.addEventListener("scroll",A);const a=new ResizeObserver(()=>{A()});return a.observe(e),()=>{e.removeEventListener("scroll",A),a.disconnect()}}},[]),u(()=>{const t=e.findIndex(e=>e.id===a),l=C.current[t];if(l){const{offsetLeft:e,offsetWidth:a}=l;p?requestAnimationFrame(()=>{h({left:e+16,width:a-32});const t=setTimeout(()=>{H(!1)},300);return()=>clearTimeout(t)}):h({left:e+16,width:a-32})}},[a,e,s,n,p]),u(()=>{if(V.current&&g.current){const{width:e}=g.current.getBoundingClientRect(),{width:a}=V.current.getBoundingClientRect();a>e&&d(()=>{c({left:!1,right:!0})})}},[V,g,e]);const M=e=>{if(f.current){const{clientWidth:a}=f.current,t=.5*a,l="left"===e?f.current.scrollLeft-t:f.current.scrollLeft+t;f.current.scrollTo({left:l,behavior:"smooth"})}},w=(e,a)=>{C.current&&(C.current[e]=a)};/* @__PURE__ */
|
|
726
|
+
return b("div",{className:cC({isSticky:r}),children:[/* @__PURE__ */b("div",{className:dC({hasArrows:s.left||s.right,hideBorder:l,isSticky:r}),ref:g,children:[
|
|
727
727
|
/* @__PURE__ */x("button",{className:CC({direction:"left",visible:s.left}),onClick:()=>M("left"),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||M("left")},"aria-label":"Scroll left",children:/* @__PURE__ */x(wd,{name:"chevron-left",size:"sm",color:"on-surface-variant"})}),
|
|
728
728
|
/* @__PURE__ */x("button",{className:CC({direction:"right",visible:s.right}),onClick:()=>M("right"),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||M("right")},"aria-label":"Scroll right",children:/* @__PURE__ */x(wd,{name:"chevron-right",size:"sm",color:"on-surface-variant"})}),
|
|
729
729
|
/* @__PURE__ */x("div",{className:hC(),ref:f,children:/* @__PURE__ */b("div",{className:pC({hasArrows:s.left||s.right,itemsAlignment:n}),ref:V,role:"tablist",children:[e.map(({hasActivity:e,...l},n)=>/* @__PURE__ */x(gC,{item:l,activeItem:a,onChange:t,hasActivity:e,index:n,linkComponent:o,isActive:l.id===a,scrollContainerRef:f,tabRefs:C,setTabRef:w},l.id)),/* @__PURE__ */x("div",{className:HC({initial:p}),style:{left:`${m.left}px`,width:`${m.width}px`}})]})})]}),i?.map(e=>/* @__PURE__ */x("div",{className:mC({active:e.id===a}),children:e.children},e.id))]})};VC.displayName="Tabs";var fC=Ja({base:["w-fit","flex","justify-center","items-center","border","gap-xs","text-nowrap"],variants:{variant:{solid:["border-transparent!"],outlined:["bg-transparent!"],ghost:["bg-transparent!","border-transparent!"]},size:{large:["text-label-large","h-[32px]","px-md","rounded-sm"],medium:["text-label-medium","h-[24px]","px-sm","rounded-sm"],small:["text-label-small","h-[18px]","px-xs","rounded-xs"]},color:{green:["border-dark-green"],yellow:["border-dark-yellow"],pink:["border-dark-pink"],"steel-blue":["border-dark-steel-blue"],error:["border-error"],primary:["border-primary"],neutral:["border-outline"]},tone:{light:[],dark:[]}},compoundVariants:[{color:"green",tone:"light",variant:"solid",class:["bg-green-container","text-on-green-container"]},{color:"green",tone:"dark",variant:"solid",class:["bg-dark-green","text-on-dark-green"]},{color:"green",variant:"outlined",class:["text-on-green-container"]},{color:"green",variant:"ghost",class:["text-dark-green"]},{color:"yellow",tone:"light",variant:"solid",class:["bg-yellow-container","text-on-yellow-container"]},{color:"yellow",tone:"dark",variant:"solid",class:["bg-dark-yellow","text-on-dark-yellow"]},{color:"yellow",variant:"outlined",class:["text-on-yellow-container"]},{color:"yellow",variant:"ghost",class:["text-dark-yellow"]},{color:"pink",tone:"light",variant:"solid",class:["bg-pink-container","text-on-pink-container"]},{color:"pink",tone:"dark",variant:"solid",class:["bg-dark-pink","text-on-dark-pink"]},{color:"pink",variant:"outlined",class:["text-on-pink-container"]},{color:"pink",variant:"ghost",class:["text-dark-pink"]},{color:"steel-blue",tone:"light",variant:"solid",class:["bg-steel-blue-container","text-on-steel-blue-container"]},{color:"steel-blue",tone:"dark",variant:"solid",class:["bg-dark-steel-blue","text-on-dark-steel-blue"]},{color:"steel-blue",variant:"outlined",class:["text-on-steel-blue-container"]},{color:"steel-blue",variant:"ghost",class:["text-dark-steel-blue"]},{color:"error",tone:"light",variant:"solid",class:["bg-error-container","text-on-error-container"]},{color:"error",tone:"dark",variant:"solid",class:["bg-error","text-on-error"]},{color:"error",variant:"outlined",class:["text-on-error-container"]},{color:"error",variant:"ghost",class:["text-error"]},{color:"primary",tone:"light",variant:"solid",class:["bg-primary-container","text-on-primary-container"]},{color:"primary",tone:"dark",variant:"solid",class:["bg-primary","text-on-primary"]},{color:"primary",variant:"outlined",class:["text-on-primary-container"]},{color:"primary",variant:"ghost",class:["text-primary"]},{color:"neutral",tone:"light",variant:"solid",class:["bg-surface-container","text-inverse-surface"]},{color:"neutral",tone:"dark",variant:"solid",class:["bg-on-surface-variant","text-inverse-on-surface"]},{color:"neutral",variant:"outlined",class:["text-inverse-surface"]},{color:"neutral",variant:"ghost",class:["text-inverse-surface"]}]}),ZC=s(({label:e,variant:a="solid",size:t="medium",color:l="primary",tone:n="light",icon:r,...i},o)=>/* @__PURE__ */b("span",{ref:o,className:fC({variant:a,size:t,color:l,tone:n}),...i,children:[r&&/* @__PURE__ */x(wd,{name:r,size:"xs"})," ",e]})),vC=Ja({base:["flex","flex-col","gap-xs2","p-md","relative","w-full","border","border-outline","transition-colors","ease-in-out","text-on-surface","bg-surface"],variants:{borderRadius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl"},disabled:{true:["opacity-50","cursor-not-allowed","bg-surface-container-low"],false:[]},error:{true:["border-error"],false:[]}},compoundVariants:[{disabled:!1,error:!1,class:["hover:border-on-surface-variant","hover:bg-surface-container-low!","focus-within:border-primary!","focus-within:bg-surface-container-low"]},{disabled:!1,error:!0,class:["hover:bg-surface-container-low!","focus-within:bg-surface-container-low"]}]}),AC=Ja({base:["w-full","pb-xs"]}),MC=Ja({base:["grid","text-body-medium","[&>textarea]:text-inherit","after:text-inherit","[&>textarea]:resize-none","[&>textarea]:overflow-hidden","[&>textarea]:[grid-area:1/1/2/2]","after:[grid-area:1/1/2/2]","after:whitespace-pre-wrap","after:invisible","after:content-[attr(data-cloned-val)_'_']"]}),xC=Ja({base:["appearance-none","text-body-medium","text-on-surface","placeholder:text-on-surface-variant-lowest","disabled:opacity-50","disabled:cursor-not-allowed","focus:outline-none","focus:ring-0","p-none"],variants:{error:{true:["caret-error"],false:["caret-primary"]}}}),bC=s(({value:e,error:a=!1,errorMessage:t,disabled:l=!1,maxLength:n,borderRadius:r="sm",header:i,rows:o=1,actions:s,...c},m)=>{const d=Z(null);/* @__PURE__ */
|