@clickhouse/click-ui 0.0.89 → 0.0.90
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/click-ui.es.js +3 -1
- package/dist/click-ui.umd.js +1 -1
- package/package.json +1 -1
package/dist/click-ui.es.js
CHANGED
|
@@ -10666,7 +10666,7 @@ const Ig = k.div.withConfig({
|
|
|
10666
10666
|
...h
|
|
10667
10667
|
}) => /* @__PURE__ */ o.jsx(Pg, { $alignItems: e, $fillWidth: n, $gapSize: r, $grow: i, $shrink: a, $isResponsive: s, $justifyContent: l, $maxWidth: c, $minWidth: d, $orientation: f, $paddingSize: u, $wrap: p, "data-testid": "container", ...h, children: t }), Pg = k.div.withConfig({
|
|
10668
10668
|
componentId: "sc-bcplth-0"
|
|
10669
|
-
})(["display:flex;flex-grow:", ";flex-shrink:", ";flex-wrap:", ";gap:", ";max-width:", ";min-width:", ";padding:", ";width:", ";flex-direction:", ";align-items:", ";justify-content:", ";@media (max-width:", "){width:", ";flex-direction:", ";}"], ({
|
|
10669
|
+
})(["display:flex;flex-grow:", ";flex-shrink:", ";flex-wrap:", ";gap:", ";max-width:", ";min-width:", ";padding:", ";width:", ";flex-direction:", ";align-items:", ";justify-content:", ";@media (max-width:", "){width:", ";max-width:", ";flex-direction:", ";}"], ({
|
|
10670
10670
|
$grow: e = "1"
|
|
10671
10671
|
}) => e === "1" ? "1" : `${e}`, ({
|
|
10672
10672
|
$shrink: e = "0"
|
|
@@ -10697,6 +10697,8 @@ const Ig = k.div.withConfig({
|
|
|
10697
10697
|
$fillWidth: t = !0
|
|
10698
10698
|
}) => e === !0 || t === !0 ? "100%" : "auto", ({
|
|
10699
10699
|
$isResponsive: e = !0
|
|
10700
|
+
}) => e === !0 ? "none" : "auto", ({
|
|
10701
|
+
$isResponsive: e = !0
|
|
10700
10702
|
}) => e === !0 ? "column" : "auto"), Q5 = "Dialog", [e0, i_] = Ne(Q5), [Dg, jt] = e0(Q5), t0 = (e) => {
|
|
10701
10703
|
const { __scopeDialog: t, children: n, open: r, defaultOpen: i, onOpenChange: a, modal: s = !0 } = e, l = D(null), c = D(null), [d = !1, f] = Ye({
|
|
10702
10704
|
prop: r,
|
package/dist/click-ui.umd.js
CHANGED
|
@@ -451,7 +451,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),fe=F,W=R);const ie={co
|
|
|
451
451
|
gap: 0.625rem;
|
|
452
452
|
top: ${e.click.codeblock.space.y};
|
|
453
453
|
right: ${e.click.codeblock.space.x};
|
|
454
|
-
`),Qp=({children:e,language:t,theme:n,showLineNumbers:r,showWrapButton:i=!1,wrapLines:a=!1,onCopy:s,onCopyError:l,...d})=>{const[f,u]=c.useState(!1),[p,h]=c.useState(!1),[g,b]=c.useState(a),C=Wp(n),v=async()=>{try{await navigator.clipboard.writeText(e),typeof s=="function"&&s(e),u(!0),setTimeout(()=>u(!1),2e3)}catch(y){let j="Unable to copy code";y instanceof Error&&(j=y.message),h(!0),typeof l=="function"&&l(j),setTimeout(()=>h(!1),2e3)}},m=()=>{b(y=>!y)},w=y=>o.jsx(Xp,{...y});return o.jsxs(qp,{$theme:n,...d,children:[o.jsxs(Jp,{children:[i&&o.jsx(o5,{as:mt,$copied:!1,$error:!1,icon:"document",onClick:m}),o.jsx(o5,{as:mt,$copied:f,$error:p,icon:f?"check":p?"warning":"copy",onClick:v})]}),o.jsx(Yp,{language:t,style:C,CodeTag:w,renderer:({rows:y,stylesheet:j,useInlineStyles:S})=>y.map((L,$)=>{const M=L.children,_=M==null?void 0:M.shift();return _&&(L.children=[_,{children:M,properties:{className:[]},tagName:"span",type:"element"}]),x2({node:L,stylesheet:j,useInlineStyles:S,key:$})}),showLineNumbers:r,wrapLines:g||a,wrapLongLines:g||a,children:e})]})},eh=({alignItems:e="center",children:t,fillWidth:n=!1,gap:r="none",grow:i="1",shrink:a="0",isResponsive:s,justifyContent:l="start",maxWidth:d,minWidth:f,orientation:u="horizontal",padding:p="none",wrap:h="nowrap",...g})=>o.jsx(th,{$alignItems:e,$fillWidth:n,$gapSize:r,$grow:i,$shrink:a,$isResponsive:s,$justifyContent:l,$maxWidth:d,$minWidth:f,$orientation:u,$paddingSize:p,$wrap:h,"data-testid":"container",...g,children:t}),th=x.div.withConfig({componentId:"sc-bcplth-0"})(["display:flex;flex-grow:",";flex-shrink:",";flex-wrap:",";gap:",";max-width:",";min-width:",";padding:",";width:",";flex-direction:",";align-items:",";justify-content:",";@media (max-width:","){width:",";flex-direction:",";}"],({$grow:e="1"})=>e==="1"?"1":`${e}`,({$shrink:e="0"})=>e==="0"?"0":`${e}`,({$wrap:e="nowrap"})=>e==="nowrap"?"nowrap":`${e}`,({theme:e,$gapSize:t})=>e.click.container.gap[t],({$maxWidth:e="100%"})=>e===""?"none":`${e}`,({$minWidth:e="auto"})=>e===""?"none":`${e}`,({theme:e,$paddingSize:t})=>e.click.container.space[t],({$fillWidth:e=!0})=>e===!0?"100%":"auto",({$orientation:e="horizontal"})=>e==="horizontal"?"row":"column",({$alignItems:e="center"})=>e==="center"?"center":`${e}`,({$justifyContent:e="left"})=>e==="start"?"start":`${e}`,({theme:e})=>e.breakpoint.sizes.md,({$isResponsive:e=!0,$fillWidth:t=!0})=>e===!0||t===!0?"100%":"auto",({$isResponsive:e=!0})=>e===!0?"column":"auto"),r5="Dialog",[i5,KS]=Te(r5),[nh,gt]=i5(r5),a5=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:s=!0}=e,l=c.useRef(null),d=c.useRef(null),[f=!1,u]=Be({prop:r,defaultProp:i,onChange:a});return c.createElement(nh,{scope:t,triggerRef:l,contentRef:d,contentId:Je(),titleId:Je(),descriptionId:Je(),open:f,onOpenChange:u,onOpenToggle:c.useCallback(()=>u(p=>!p),[u]),modal:s},n)},oh="DialogTrigger",s5=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=gt(oh,n),a=me(t,i.triggerRef);return c.createElement(re.button,E({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":O2(i.open)},r,{ref:a,onClick:Z(e.onClick,i.onOpenToggle)}))}),l5="DialogPortal",[rh,c5]=i5(l5,{forceMount:void 0}),d5=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=gt(l5,t);return c.createElement(rh,{scope:t,forceMount:n},c.Children.map(r,s=>c.createElement(Ae,{present:n||a.open},c.createElement($1,{asChild:!0,container:i},s))))},I2="DialogOverlay",f5=c.forwardRef((e,t)=>{const n=c5(I2,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=gt(I2,e.__scopeDialog);return a.modal?c.createElement(Ae,{present:r||a.open},c.createElement(ih,E({},i,{ref:t}))):null}),ih=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=gt(I2,n);return c.createElement(Kr,{as:r1,allowPinchZoom:!0,shards:[i.contentRef]},c.createElement(re.div,E({"data-state":O2(i.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),vn="DialogContent",u5=c.forwardRef((e,t)=>{const n=c5(vn,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=gt(vn,e.__scopeDialog);return c.createElement(Ae,{present:r||a.open},a.modal?c.createElement(ah,E({},i,{ref:t})):c.createElement(sh,E({},i,{ref:t})))}),ah=c.forwardRef((e,t)=>{const n=gt(vn,e.__scopeDialog),r=c.useRef(null),i=me(t,n.contentRef,r);return c.useEffect(()=>{const a=r.current;if(a)return Rr(a)},[]),c.createElement(p5,E({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Z(e.onCloseAutoFocus,a=>{var s;a.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:Z(e.onPointerDownOutside,a=>{const s=a.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0;(s.button===2||l)&&a.preventDefault()}),onFocusOutside:Z(e.onFocusOutside,a=>a.preventDefault())}))}),sh=c.forwardRef((e,t)=>{const n=gt(vn,e.__scopeDialog),r=c.useRef(!1),i=c.useRef(!1);return c.createElement(p5,E({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,a),!a.defaultPrevented){var l;r.current||(l=n.triggerRef.current)===null||l===void 0||l.focus(),a.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:a=>{var s,l;(s=e.onInteractOutside)===null||s===void 0||s.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const d=a.target;((l=n.triggerRef.current)===null||l===void 0?void 0:l.contains(d))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}}))}),p5=c.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...s}=e,l=gt(vn,n),d=c.useRef(null),f=me(t,d);return jr(),c.createElement(c.Fragment,null,c.createElement(_r,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a},c.createElement(m1,E({role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":O2(l.open)},s,{ref:f,onDismiss:()=>l.onOpenChange(!1)}))),!1)}),lh="DialogTitle",ch=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=gt(lh,n);return c.createElement(re.h2,E({id:i.titleId},r,{ref:t}))}),dh="DialogDescription",fh=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=gt(dh,n);return c.createElement(re.p,E({id:i.descriptionId},r,{ref:t}))}),uh="DialogClose",Eo=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=gt(uh,n);return c.createElement(re.button,E({type:"button"},r,{ref:t,onClick:Z(e.onClick,()=>i.onOpenChange(!1))}))});function O2(e){return e?"open":"closed"}const ph=a5,hh=s5,gh=d5,bh=f5,Ch=u5,h5=Eo,Jt=({children:e,...t})=>o.jsx(ph,{...t,children:e}),vh=x(hh).withConfig({componentId:"sc-1wr6otn-0"})(["width:fit-content;background:transparent;border:none;cursor:pointer;"]),g5=({children:e,...t})=>o.jsx(vh,{...t,children:e});g5.displayName="DialogTrigger",Jt.Trigger=g5;const b5=({label:e="Close",type:t="secondary",...n})=>o.jsx(h5,{asChild:!0,children:o.jsx(hn,{type:t,label:e,...n})});b5.displayName="DialogClose",Jt.Close=b5;const mh=x.keyframes({"0%":{opacity:0},"100%":{opacity:1}}),xh=x.keyframes({"0%":{opacity:0,transform:"translate(-50%, -48%) scale(.96)"},"100%":{opacity:1,transform:"translate(-50%, -50%) scale(1)"}}),wh=x(bh).withConfig({componentId:"sc-1wr6otn-1"})(["background-color:",";position:fixed;inset:0;animation:"," 150ms cubic-bezier(0.16,1,0.3,1);"],({theme:e})=>e.click.dialog.color.opaqueBackground.default,mh),kh=x(Ch).withConfig({componentId:"sc-1wr6otn-2"})(["background:",";border-radius:",";padding:"," ",";box-shadow:",";border:1px solid ",";width:75%;max-width:670px;position:fixed;top:50%;left:50%;max-height:75%;overflow:auto;transform:translate(-50%,-50%);animation:"," 150ms cubic-bezier(0.16,1,0.3,1);outline:none;"],({theme:e})=>e.click.dialog.color.background.default,({theme:e})=>e.click.dialog.radii.all,({theme:e})=>e.click.dialog.space.y,({theme:e})=>e.click.dialog.space.x,({theme:e})=>e.click.dialog.shadow.default,({theme:e})=>e.click.global.color.stroke.default,xh),yh=x.div.withConfig({componentId:"sc-1wr6otn-3"})(["display:flex;justify-content:space-between;align-items:center;min-height:",";"],({theme:e})=>e.sizes[9]),$h=x.h2.withConfig({componentId:"sc-1wr6otn-4"})(["font:",";padding:0;margin:0;"],({theme:e})=>e.click.dialog.typography.title.default),Lh=({onClose:e})=>o.jsx(h5,{asChild:!0,children:o.jsx(vr,{onClick:e,children:o.jsx(oe,{name:"cross",size:"lg"})})}),C5=({title:e,children:t,showClose:n,onClose:r,forceMount:i,container:a,showOverlay:s=!0,...l})=>o.jsxs(gh,{forceMount:i,container:a,children:[s&&o.jsx(wh,{}),o.jsxs(kh,{...l,children:[o.jsxs(yh,{children:[o.jsx($h,{children:e}),n&&o.jsx(Lh,{onClose:r})]}),o.jsx(fi,{size:"sm"}),t]})]});C5.displayName="DialogContent",Jt.Content=C5;const jh=x.div.withConfig({componentId:"sc-6eozxy-0"})(["display:flex;justify-content:flex-end;gap:",";"],e=>e.theme.click.dialog.space.gap),Mh=({open:e,onCancel:t,title:n,message:r,loading:i,primaryActionType:a="primary",primaryActionLabel:s="Confirm",secondaryActionLabel:l="Cancel",onConfirm:d,children:f,showClose:u})=>{if(f&&r)throw new Error("You can't pass children and message props at the same time");return o.jsx(Jt,{open:e,onOpenChange:p=>{!p&&t&&t()},children:o.jsxs(Jt.Content,{title:n,showClose:u,children:[f||o.jsx(Kt,{children:r}),o.jsx(g1,{size:"xl"}),o.jsxs(jh,{children:[o.jsx(Jt.Close,{label:l}),o.jsx(Jt.Close,{loading:!!i,disabled:!!i,type:a,label:s,onClick:()=>{d&&d()}})]})]})})},Qt=({modal:e=!1,...t})=>o.jsx(a5,{modal:e,...t}),v5=({children:e,...t})=>o.jsx(s5,{asChild:!0,...t,children:o.jsx("div",{children:e})});v5.displayName="Flyout.Trigger",Qt.Trigger=v5;const Sh=x.keyframes({"0%":{maxWidth:0,minWidth:0},"100%":{maxWidth:"fit-content",minWidth:"var(--flyout-width, 100%)"}}),_h=x(u5).withConfig({componentId:"sc-1vtv6sf-0"})(["display:flex;flex-direction:column;align-items:center;overflow:hidden;flex:1;top:0;right:0;bottom:0;width:100%;--flyout-width:",";animation:"," 500ms cubic-bezier(0.16,1,0.3,1) forwards;",""],({theme:e,$size:t="default"})=>e.click.flyout.size[t].width,Sh,({theme:e,$strategy:t})=>`
|
|
454
|
+
`),Qp=({children:e,language:t,theme:n,showLineNumbers:r,showWrapButton:i=!1,wrapLines:a=!1,onCopy:s,onCopyError:l,...d})=>{const[f,u]=c.useState(!1),[p,h]=c.useState(!1),[g,b]=c.useState(a),C=Wp(n),v=async()=>{try{await navigator.clipboard.writeText(e),typeof s=="function"&&s(e),u(!0),setTimeout(()=>u(!1),2e3)}catch(y){let j="Unable to copy code";y instanceof Error&&(j=y.message),h(!0),typeof l=="function"&&l(j),setTimeout(()=>h(!1),2e3)}},m=()=>{b(y=>!y)},w=y=>o.jsx(Xp,{...y});return o.jsxs(qp,{$theme:n,...d,children:[o.jsxs(Jp,{children:[i&&o.jsx(o5,{as:mt,$copied:!1,$error:!1,icon:"document",onClick:m}),o.jsx(o5,{as:mt,$copied:f,$error:p,icon:f?"check":p?"warning":"copy",onClick:v})]}),o.jsx(Yp,{language:t,style:C,CodeTag:w,renderer:({rows:y,stylesheet:j,useInlineStyles:S})=>y.map((L,$)=>{const M=L.children,_=M==null?void 0:M.shift();return _&&(L.children=[_,{children:M,properties:{className:[]},tagName:"span",type:"element"}]),x2({node:L,stylesheet:j,useInlineStyles:S,key:$})}),showLineNumbers:r,wrapLines:g||a,wrapLongLines:g||a,children:e})]})},eh=({alignItems:e="center",children:t,fillWidth:n=!1,gap:r="none",grow:i="1",shrink:a="0",isResponsive:s,justifyContent:l="start",maxWidth:d,minWidth:f,orientation:u="horizontal",padding:p="none",wrap:h="nowrap",...g})=>o.jsx(th,{$alignItems:e,$fillWidth:n,$gapSize:r,$grow:i,$shrink:a,$isResponsive:s,$justifyContent:l,$maxWidth:d,$minWidth:f,$orientation:u,$paddingSize:p,$wrap:h,"data-testid":"container",...g,children:t}),th=x.div.withConfig({componentId:"sc-bcplth-0"})(["display:flex;flex-grow:",";flex-shrink:",";flex-wrap:",";gap:",";max-width:",";min-width:",";padding:",";width:",";flex-direction:",";align-items:",";justify-content:",";@media (max-width:","){width:",";max-width:",";flex-direction:",";}"],({$grow:e="1"})=>e==="1"?"1":`${e}`,({$shrink:e="0"})=>e==="0"?"0":`${e}`,({$wrap:e="nowrap"})=>e==="nowrap"?"nowrap":`${e}`,({theme:e,$gapSize:t})=>e.click.container.gap[t],({$maxWidth:e="100%"})=>e===""?"none":`${e}`,({$minWidth:e="auto"})=>e===""?"none":`${e}`,({theme:e,$paddingSize:t})=>e.click.container.space[t],({$fillWidth:e=!0})=>e===!0?"100%":"auto",({$orientation:e="horizontal"})=>e==="horizontal"?"row":"column",({$alignItems:e="center"})=>e==="center"?"center":`${e}`,({$justifyContent:e="left"})=>e==="start"?"start":`${e}`,({theme:e})=>e.breakpoint.sizes.md,({$isResponsive:e=!0,$fillWidth:t=!0})=>e===!0||t===!0?"100%":"auto",({$isResponsive:e=!0})=>e===!0?"none":"auto",({$isResponsive:e=!0})=>e===!0?"column":"auto"),r5="Dialog",[i5,KS]=Te(r5),[nh,gt]=i5(r5),a5=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:s=!0}=e,l=c.useRef(null),d=c.useRef(null),[f=!1,u]=Be({prop:r,defaultProp:i,onChange:a});return c.createElement(nh,{scope:t,triggerRef:l,contentRef:d,contentId:Je(),titleId:Je(),descriptionId:Je(),open:f,onOpenChange:u,onOpenToggle:c.useCallback(()=>u(p=>!p),[u]),modal:s},n)},oh="DialogTrigger",s5=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=gt(oh,n),a=me(t,i.triggerRef);return c.createElement(re.button,E({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":O2(i.open)},r,{ref:a,onClick:Z(e.onClick,i.onOpenToggle)}))}),l5="DialogPortal",[rh,c5]=i5(l5,{forceMount:void 0}),d5=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=gt(l5,t);return c.createElement(rh,{scope:t,forceMount:n},c.Children.map(r,s=>c.createElement(Ae,{present:n||a.open},c.createElement($1,{asChild:!0,container:i},s))))},I2="DialogOverlay",f5=c.forwardRef((e,t)=>{const n=c5(I2,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=gt(I2,e.__scopeDialog);return a.modal?c.createElement(Ae,{present:r||a.open},c.createElement(ih,E({},i,{ref:t}))):null}),ih=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=gt(I2,n);return c.createElement(Kr,{as:r1,allowPinchZoom:!0,shards:[i.contentRef]},c.createElement(re.div,E({"data-state":O2(i.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),vn="DialogContent",u5=c.forwardRef((e,t)=>{const n=c5(vn,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=gt(vn,e.__scopeDialog);return c.createElement(Ae,{present:r||a.open},a.modal?c.createElement(ah,E({},i,{ref:t})):c.createElement(sh,E({},i,{ref:t})))}),ah=c.forwardRef((e,t)=>{const n=gt(vn,e.__scopeDialog),r=c.useRef(null),i=me(t,n.contentRef,r);return c.useEffect(()=>{const a=r.current;if(a)return Rr(a)},[]),c.createElement(p5,E({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Z(e.onCloseAutoFocus,a=>{var s;a.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:Z(e.onPointerDownOutside,a=>{const s=a.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0;(s.button===2||l)&&a.preventDefault()}),onFocusOutside:Z(e.onFocusOutside,a=>a.preventDefault())}))}),sh=c.forwardRef((e,t)=>{const n=gt(vn,e.__scopeDialog),r=c.useRef(!1),i=c.useRef(!1);return c.createElement(p5,E({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,a),!a.defaultPrevented){var l;r.current||(l=n.triggerRef.current)===null||l===void 0||l.focus(),a.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:a=>{var s,l;(s=e.onInteractOutside)===null||s===void 0||s.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const d=a.target;((l=n.triggerRef.current)===null||l===void 0?void 0:l.contains(d))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}}))}),p5=c.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...s}=e,l=gt(vn,n),d=c.useRef(null),f=me(t,d);return jr(),c.createElement(c.Fragment,null,c.createElement(_r,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a},c.createElement(m1,E({role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":O2(l.open)},s,{ref:f,onDismiss:()=>l.onOpenChange(!1)}))),!1)}),lh="DialogTitle",ch=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=gt(lh,n);return c.createElement(re.h2,E({id:i.titleId},r,{ref:t}))}),dh="DialogDescription",fh=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=gt(dh,n);return c.createElement(re.p,E({id:i.descriptionId},r,{ref:t}))}),uh="DialogClose",Eo=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=gt(uh,n);return c.createElement(re.button,E({type:"button"},r,{ref:t,onClick:Z(e.onClick,()=>i.onOpenChange(!1))}))});function O2(e){return e?"open":"closed"}const ph=a5,hh=s5,gh=d5,bh=f5,Ch=u5,h5=Eo,Jt=({children:e,...t})=>o.jsx(ph,{...t,children:e}),vh=x(hh).withConfig({componentId:"sc-1wr6otn-0"})(["width:fit-content;background:transparent;border:none;cursor:pointer;"]),g5=({children:e,...t})=>o.jsx(vh,{...t,children:e});g5.displayName="DialogTrigger",Jt.Trigger=g5;const b5=({label:e="Close",type:t="secondary",...n})=>o.jsx(h5,{asChild:!0,children:o.jsx(hn,{type:t,label:e,...n})});b5.displayName="DialogClose",Jt.Close=b5;const mh=x.keyframes({"0%":{opacity:0},"100%":{opacity:1}}),xh=x.keyframes({"0%":{opacity:0,transform:"translate(-50%, -48%) scale(.96)"},"100%":{opacity:1,transform:"translate(-50%, -50%) scale(1)"}}),wh=x(bh).withConfig({componentId:"sc-1wr6otn-1"})(["background-color:",";position:fixed;inset:0;animation:"," 150ms cubic-bezier(0.16,1,0.3,1);"],({theme:e})=>e.click.dialog.color.opaqueBackground.default,mh),kh=x(Ch).withConfig({componentId:"sc-1wr6otn-2"})(["background:",";border-radius:",";padding:"," ",";box-shadow:",";border:1px solid ",";width:75%;max-width:670px;position:fixed;top:50%;left:50%;max-height:75%;overflow:auto;transform:translate(-50%,-50%);animation:"," 150ms cubic-bezier(0.16,1,0.3,1);outline:none;"],({theme:e})=>e.click.dialog.color.background.default,({theme:e})=>e.click.dialog.radii.all,({theme:e})=>e.click.dialog.space.y,({theme:e})=>e.click.dialog.space.x,({theme:e})=>e.click.dialog.shadow.default,({theme:e})=>e.click.global.color.stroke.default,xh),yh=x.div.withConfig({componentId:"sc-1wr6otn-3"})(["display:flex;justify-content:space-between;align-items:center;min-height:",";"],({theme:e})=>e.sizes[9]),$h=x.h2.withConfig({componentId:"sc-1wr6otn-4"})(["font:",";padding:0;margin:0;"],({theme:e})=>e.click.dialog.typography.title.default),Lh=({onClose:e})=>o.jsx(h5,{asChild:!0,children:o.jsx(vr,{onClick:e,children:o.jsx(oe,{name:"cross",size:"lg"})})}),C5=({title:e,children:t,showClose:n,onClose:r,forceMount:i,container:a,showOverlay:s=!0,...l})=>o.jsxs(gh,{forceMount:i,container:a,children:[s&&o.jsx(wh,{}),o.jsxs(kh,{...l,children:[o.jsxs(yh,{children:[o.jsx($h,{children:e}),n&&o.jsx(Lh,{onClose:r})]}),o.jsx(fi,{size:"sm"}),t]})]});C5.displayName="DialogContent",Jt.Content=C5;const jh=x.div.withConfig({componentId:"sc-6eozxy-0"})(["display:flex;justify-content:flex-end;gap:",";"],e=>e.theme.click.dialog.space.gap),Mh=({open:e,onCancel:t,title:n,message:r,loading:i,primaryActionType:a="primary",primaryActionLabel:s="Confirm",secondaryActionLabel:l="Cancel",onConfirm:d,children:f,showClose:u})=>{if(f&&r)throw new Error("You can't pass children and message props at the same time");return o.jsx(Jt,{open:e,onOpenChange:p=>{!p&&t&&t()},children:o.jsxs(Jt.Content,{title:n,showClose:u,children:[f||o.jsx(Kt,{children:r}),o.jsx(g1,{size:"xl"}),o.jsxs(jh,{children:[o.jsx(Jt.Close,{label:l}),o.jsx(Jt.Close,{loading:!!i,disabled:!!i,type:a,label:s,onClick:()=>{d&&d()}})]})]})})},Qt=({modal:e=!1,...t})=>o.jsx(a5,{modal:e,...t}),v5=({children:e,...t})=>o.jsx(s5,{asChild:!0,...t,children:o.jsx("div",{children:e})});v5.displayName="Flyout.Trigger",Qt.Trigger=v5;const Sh=x.keyframes({"0%":{maxWidth:0,minWidth:0},"100%":{maxWidth:"fit-content",minWidth:"var(--flyout-width, 100%)"}}),_h=x(u5).withConfig({componentId:"sc-1vtv6sf-0"})(["display:flex;flex-direction:column;align-items:center;overflow:hidden;flex:1;top:0;right:0;bottom:0;width:100%;--flyout-width:",";animation:"," 500ms cubic-bezier(0.16,1,0.3,1) forwards;",""],({theme:e,$size:t="default"})=>e.click.flyout.size[t].width,Sh,({theme:e,$strategy:t})=>`
|
|
455
455
|
position: ${t};
|
|
456
456
|
height: ${t==="relative"?"100%":"auto"};
|
|
457
457
|
padding: ${e.click.flyout.space.y} ${e.click.flyout.space.x};
|