@zimyo/ui 1.12.0 → 1.12.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.
Files changed (48) hide show
  1. package/dist/assets/noData-301bc56d84fa99a6.gif +0 -0
  2. package/dist/chunks/{Calender-0d04996d.js → Calender-7cb96562.js} +1 -1
  3. package/dist/chunks/{Calender-d4b487fe.esm.js → Calender-f8e1cbb6.esm.js} +1 -1
  4. package/dist/chunks/{assertThisInitialized-406be690.esm.js → assertThisInitialized-63d8ff5f.esm.js} +1 -1
  5. package/dist/chunks/{lucide-493ccaad.js → lucide-3fef2423.js} +2 -2
  6. package/dist/chunks/lucide-7e7c48b9.esm.js +26 -0
  7. package/dist/chunks/react-virtualized-auto-sizer.esm-8105695c.esm.js +1 -0
  8. package/dist/chunks/react-virtualized-auto-sizer.esm-8e1756a5.js +1 -0
  9. package/dist/components/Accordion/index.esm.js +1 -1
  10. package/dist/components/Accordion/index.js +1 -1
  11. package/dist/components/AppList/index.esm.js +1 -1
  12. package/dist/components/AppList/index.js +1 -1
  13. package/dist/components/BulkActionsBar/index.esm.js +1 -1
  14. package/dist/components/BulkActionsBar/index.js +1 -1
  15. package/dist/components/Checkbox/index.esm.js +1 -1
  16. package/dist/components/Checkbox/index.js +1 -1
  17. package/dist/components/CheckboxGroup/index.esm.js +1 -1
  18. package/dist/components/CheckboxGroup/index.js +1 -1
  19. package/dist/components/DataTable/index.d.ts +8 -1
  20. package/dist/components/DataTable/index.esm.js +3 -3
  21. package/dist/components/DataTable/index.js +3 -3
  22. package/dist/components/DatePicker/index.esm.js +1 -1
  23. package/dist/components/DatePicker/index.js +1 -1
  24. package/dist/components/DateRangePicker/index.esm.js +1 -1
  25. package/dist/components/DateRangePicker/index.js +1 -1
  26. package/dist/components/Form/index.esm.js +1 -1
  27. package/dist/components/Form/index.js +1 -1
  28. package/dist/components/GlobalMenuSearch/index.esm.js +1 -1
  29. package/dist/components/GlobalMenuSearch/index.js +1 -1
  30. package/dist/components/Input/index.esm.js +1 -1
  31. package/dist/components/Input/index.js +1 -1
  32. package/dist/components/Modal/index.esm.js +1 -1
  33. package/dist/components/Modal/index.js +1 -1
  34. package/dist/components/Notice/index.esm.js +1 -1
  35. package/dist/components/Notice/index.js +1 -1
  36. package/dist/components/PopupConfirm/index.esm.js +1 -1
  37. package/dist/components/PopupConfirm/index.js +1 -1
  38. package/dist/components/Select/index.esm.js +1 -1
  39. package/dist/components/Select/index.js +1 -1
  40. package/dist/components/Table/index.esm.js +1 -1
  41. package/dist/components/Table/index.js +1 -1
  42. package/dist/components/TimePicker/index.esm.js +1 -1
  43. package/dist/components/TimePicker/index.js +1 -1
  44. package/dist/index.d.ts +8 -1
  45. package/dist/index.esm.js +1 -1
  46. package/dist/index.js +1 -1
  47. package/package.json +3 -2
  48. package/dist/chunks/lucide-8c9441ea.esm.js +0 -26
@@ -1 +1 @@
1
- import{b as r,a as t,_ as e}from"../../chunks/tslib.es6-4974c96c.esm.js";import{jsx as n,jsxs as o,Fragment as i}from"react/jsx-runtime";import*as a from"react";import u,{Fragment as c,useState as l,useMemo as s,useRef as f,useEffect as h,createContext as d,useContext as p}from"react";import{Box as v,List as y,ListItemButton as m,ListItemIcon as g,ListItemText as b,CircularProgress as w,Slide as x,Dialog as E,DialogTitle as k,Divider as z,DialogContent as j,DialogActions as P}from"@mui/material";import{b as A,S as O}from"../../chunks/lucide-8c9441ea.esm.js";import{T as _}from"../../chunks/Text-5b99f7f4.esm.js";import{Input as C}from"../Input/index.esm.js";import"../../chunks/index-32c3a4e2.esm.js";var T="open",N="exit",S=function(r){var t=tr(),e=r.list,i=void 0===e?[]:e,a=r.history,u=null==t?void 0:t.handleClose;return n(v,{p:1,children:n(y,{disablePadding:!0,component:"nav","aria-label":"menu list box",children:i.map(function(r){return o(m,{onClick:function(){return t=r.url,null==a||a.push(t),void("function"==typeof u&&u());var t},sx:{fontFamily:"sans-serif",fontSize:14,background:"rgba(246, 247, 248, 0.4)",mt:1,minHeight:48,border:"1px solid rgba(232, 234, 238, 0.5)",borderRadius:1,":hover":{background:"#ebf5ff",borderColor:"#66b2ff",color:"#66b2ff"}},children:[n(g,{sx:{minWidth:"auto",color:"inherit"},children:n(A,{size:24})}),n(b,{primaryTypographyProps:{sx:{textTransform:"capitalize"},component:"div",variant:"body1",fontSize:14,fontWeight:500,lineHeight:.85},secondaryTypographyProps:{component:"div",variant:"body1",fontSize:12},sx:{ml:1},primary:r.name||"-",secondary:r.custom_path})]})})})})},F=function(r){return"function"==typeof r.children?u.createElement(c,null,r.children()):u.createElement(c,null,r.children||null)},I=function(r){return F(r)},G=function(r){return F(r)};function R(r,t,e,n,o,i,a){try{var u=r[i](a),c=u.value}catch(r){return void e(r)}u.done?t(c):Promise.resolve(c).then(n,o)}function D(r){return function(){var t=this,e=arguments;return new Promise(function(n,o){var i=r.apply(t,e);function a(r){R(i,n,o,a,u,"next",r)}function u(r){R(i,n,o,a,u,"throw",r)}a(void 0)})}}function L(){return L=Object.assign?Object.assign.bind():function(r){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)({}).hasOwnProperty.call(e,n)&&(r[n]=e[n])}return r},L.apply(null,arguments)}function W(){W=function(){return t};var r,t={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(r,t,e,n){return Object.defineProperty(r,t,{value:e,enumerable:!n,configurable:!n,writable:!n})}try{c({},"")}catch(r){c=function(r,t,e){return r[t]=e}}function l(t,e,n,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype);return c(a,"_invoke",function(t,e,n){var o=1;return function(i,a){if(3===o)throw Error("Generator is already running");if(4===o){if("throw"===i)throw a;return{value:r,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=x(u,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===o)throw o=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=3;var l=s(t,e,n);if("normal"===l.type){if(o=n.done?4:2,l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=4,n.method="throw",n.arg=l.arg)}}}(t,n,new z(o||[])),!0),a}function s(r,t,e){try{return{type:"normal",arg:r.call(t,e)}}catch(r){return{type:"throw",arg:r}}}t.wrap=l;var f={};function h(){}function d(){}function p(){}var v={};c(v,i,function(){return this});var y=Object.getPrototypeOf,m=y&&y(y(j([])));m&&m!==e&&n.call(m,i)&&(v=m);var g=p.prototype=h.prototype=Object.create(v);function b(r){["next","throw","return"].forEach(function(t){c(r,t,function(r){return this._invoke(t,r)})})}function w(r,t){function e(o,i,a,u){var c=s(r[o],r,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==typeof f&&n.call(f,"__await")?t.resolve(f.__await).then(function(r){e("next",r,a,u)},function(r){e("throw",r,a,u)}):t.resolve(f).then(function(r){l.value=r,a(l)},function(r){return e("throw",r,a,u)})}u(c.arg)}var o;c(this,"_invoke",function(r,n){function i(){return new t(function(t,o){e(r,n,t,o)})}return o=o?o.then(i,i):i()},!0)}function x(t,e){var n=e.method,o=t.i[n];if(o===r)return e.delegate=null,"throw"===n&&t.i.return&&(e.method="return",e.arg=r,x(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var i=s(o,t.i,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var a=i.arg;return a?a.done?(e[t.r]=a.value,e.next=t.n,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,f):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function E(r){this.tryEntries.push(r)}function k(t){var e=t[4]||{};e.type="normal",e.arg=r,t[4]=e}function z(r){this.tryEntries=[[-1]],r.forEach(E,this),this.reset(!0)}function j(t){if(null!=t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function e(){for(;++o<t.length;)if(n.call(t,o))return e.value=t[o],e.done=!1,e;return e.value=r,e.done=!0,e};return a.next=a}}throw new TypeError(typeof t+" is not iterable")}return d.prototype=p,c(g,"constructor",p),c(p,"constructor",d),d.displayName=c(p,u,"GeneratorFunction"),t.isGeneratorFunction=function(r){var t="function"==typeof r&&r.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,p):(r.__proto__=p,c(r,u,"GeneratorFunction")),r.prototype=Object.create(g),r},t.awrap=function(r){return{__await:r}},b(w.prototype),c(w.prototype,a,function(){return this}),t.AsyncIterator=w,t.async=function(r,e,n,o,i){void 0===i&&(i=Promise);var a=new w(l(r,e,n,o),i);return t.isGeneratorFunction(e)?a:a.next().then(function(r){return r.done?r.value:a.next()})},b(g),c(g,u,"Generator"),c(g,i,function(){return this}),c(g,"toString",function(){return"[object Generator]"}),t.keys=function(r){var t=Object(r),e=[];for(var n in t)e.unshift(n);return function r(){for(;e.length;)if((n=e.pop())in t)return r.value=n,r.done=!1,r;return r.done=!0,r}},t.values=j,z.prototype={constructor:z,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var r=this.tryEntries[0][4];if("throw"===r.type)throw r.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r){a.type="throw",a.arg=t,e.next=r}for(var o=e.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i[4],u=this.prev,c=i[1],l=i[2];if(-1===i[0])return n("end"),!1;if(!c&&!l)throw Error("try statement without catch or finally");if(null!=i[0]&&i[0]<=u){if(u<c)return this.method="next",this.arg=r,n(c),!0;if(u<l)return n(l),!1}}},abrupt:function(r,t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var o=n;break}}o&&("break"===r||"continue"===r)&&o[0]<=t&&t<=o[2]&&(o=null);var i=o?o[4]:{};return i.type=r,i.arg=t,o?(this.method="next",this.next=o[2],f):this.complete(i)},complete:function(r,t){if("throw"===r.type)throw r.arg;return"break"===r.type||"continue"===r.type?this.next=r.arg:"return"===r.type?(this.rval=this.arg=r.arg,this.method="return",this.next="end"):"normal"===r.type&&t&&(this.next=t),f},finish:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var e=this.tryEntries[t];if(e[2]===r)return this.complete(e[4],e[3]),k(e),f}},catch:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var e=this.tryEntries[t];if(e[0]===r){var n=e[4];if("throw"===n.type){var o=n.arg;k(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={i:j(t),r:e,n:n},"next"===this.method&&(this.arg=r),f}},t}var H=function(r){return F(r)};function K(r){return"function"==typeof r}function q(r){return"object"==typeof r&&null!==r&&(r instanceof Promise||r!==Promise.prototype&&function(r){return Reflect.has(r,"then")&&K(r.then)}(r)&&function(r){return Reflect.has(r,"catch")&&K(r.catch)}(r))}var B=function(r,t){void 0===t&&(t=[]);var e=f(!1),n=f([]);if("function"!=typeof r)throw new Error("Incorrect callback parameter for useSingleton hook; expected a function, but got: '"+typeof r+"'.");if(!Array.isArray(t))throw new Error("Incorrect dependencies parameter for useSingleton; expected an array, but got: '"+typeof t+"'.");if(Array.isArray(t)&&t.length>0){if(!function(r,t){if(!Array.isArray(r)||!Array.isArray(t))throw new Error("shallowArraysEqual only accepts arrays as parameters");if(r.length!==t.length)return!1;for(var e=0;e<r.length;++e)if(r[e]!==t[e])return!1;return!0}(n.current,t))n.current=t;else if(e.current)return}else if(e.current)return;r(),e.current=!0};function M(r){var t=r.promise,e=r.keepAlive,n=void 0!==e&&e,o=r.children,i=l(null),u=i[0],d=i[1],p=l(null),v=p[0],y=p[1],m=s(function(){return function(r){if(!q(r))throw new Error("Argument of createCancellablePromise should be a Promise");var t={value:!1},e=new Promise(function(){var e=D(W().mark(function e(n,o){var i;return W().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r;case 3:i=e.sent,t.value||n(i),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),t.value||o(e.t0);case 10:case"end":return e.stop()}},e,null,[[0,7]])}));return function(r,t){return e.apply(this,arguments)}}());return Object.keys(r).forEach(function(t){e[t]=r[t]}),{promise:e,cancel:function(){t.value=!0}}}(t)},[t]),g=f([]);if(h(function(){return function(){n||m.cancel()}},[m,m.promise,n]),B(D(W().mark(function r(){var t;return W().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return d(null),y(null),r.prev=2,r.next=5,m.promise;case 5:t=r.sent,y(t),d(!0),g.current.push(m),r.next=16;break;case 11:r.prev=11,r.t0=r.catch(2),y(r.t0),d(!1),g.current.push(m);case 16:case"end":return r.stop()}},r,null,[[2,11]])})),[m.promise]),!o||!q(t))return null;if(null===u){var b=a.Children.toArray(o).find(function(r){return r.type===G});return a.createElement(c,null,b||null)}if(!u){var w=a.Children.toArray(o).find(function(r){return r.type===I});if(!w)return a.createElement(c,null,null);var x=w,E=w.props;return"function"==typeof E.children&&(x=L({},w,{props:L({},E,{children:function(){return E.children(v,g.current,m.promise)}})})),a.createElement(c,null,x)}var k=a.Children.toArray(o).find(function(r){return r.type===H});if(!k)return a.createElement(c,null,null);var z=k,j=k.props;return"function"==typeof j.children&&(z=L({},k,{props:L({},j,{children:function(){return j.children(v,g.current,m.promise)}})})),a.createElement(c,null,z)}var V=function(r){var t=r.condition,e=r.keepAlive,n=void 0!==e&&e,o=r.children;if(!o)return null;if(function(r,t){if("production"!==process.env.NODE_ENV&&r){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(r){}}}(!Array.isArray(o)&&!(o.type===I||o.type===H)||!u.Children.toArray(o).every(function(r){return r.type===I||r.type===H||r.type===G}),"The <If> component should contain <Then /> <Else /> or <Fallback /> components as its children"),q(t))return u.createElement(M,{promise:t,keepAlive:n},o);var i=function(r){return Boolean("function"==typeof r?r():r)}(t);return u.createElement(c,null,u.Children.toArray(o).find(function(r){return r.type!==I!=!i})||null)};function Y(e,n){return void 0===n&&(n=[]),e.flatMap(function(e){var o=r(r([],n,!0),[e.name],!1);if(e.children&&e.children.length>0)return Y(e.children,o);var i=t(t({},e),{custom_path:o.join(" / ")});return delete i.children,[i]})}var J=function(r){return(null==r?void 0:r.trim().toLowerCase())||""},Q=function(r){var e=r.sx;return o(v,{sx:t({display:"flex",flexDirection:"column",height:"100%",justifyContent:"center",alignItems:"center",background:"#f4f4f4",color:"gray"},e),children:[n(O,{size:40}),n(_,{size:"sm",children:"No results found based on search"})]})};function U(r){var e=r.children,o=r.loading,a=r.list,u={display:"flex",flexDirection:"column",height:"100%",justifyContent:"center",alignItems:"center"};return o?n(v,{sx:u,children:n(w,{thickness:2})}):0===(null==a?void 0:a.length)?n(Q,{sx:t(t({},u),{background:"#f4f4f4",color:"gray"})}):n(i,{children:e})}var X=function(r){var t=r.list,e=void 0===t?[]:t,i=r.delay,a=void 0===i?1e3:i,c=r.popInputPlaceholder,f=void 0===c?"Search...":c,d=r.history,p=l(""),v=p[0],y=p[1],m=l([]),g=m[0],b=m[1],w=l(!1),x=w[0],E=w[1],A=function(r){var t=[],n=J(r);t=n?e.filter(function(r){return J(r.name).includes(n)}):e,b(t),E(!1)},O=s(function(){return function(r,t){var e;return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];clearTimeout(e),e=setTimeout(function(){r.apply(void 0,n)},t)}}(A,a)},[]);h(function(){E(!0),O(v)},[v,O]);return o(u.Fragment,{children:[n(k,{classes:{root:"zui:!p-1"},component:"div",color:"primary",className:"font-semibold flex items-center",children:n(Z,{kbdType:"exit",variant:"outlined",inputProps:{className:"zui:!mb-0 zui:!text-sm",placeholder:f,value:v,onChange:function(r){var t=r.target.value;y(t)}}})}),n(z,{}),n(j,{classes:{root:"zui:!p-0"},children:n(U,{loading:x,list:g,children:n(S,{list:g,history:d})})}),n(z,{}),n(P,{children:o("div",{className:"zui:flex zui:flex-row zui:gap-0.5 zui:items-center",children:[n(_,{size:"sm",children:"Search by :"}),n("img",{loading:"lazy",className:"org_logo",src:"https://files.zimyo.work/staticlogo/global/zimyo.svg",width:85})]})})]})},Z=function(r){var e=r.variant,i=void 0===e?"contained":e,a=r.inputProps,u=r.kbdType,c=void 0===u?T:u;return n(C,t({leftIcon:n(O,{size:16}),rightIcon:o(V,{condition:c===N,children:[n(H,{children:n("kbd",{className:"zui:px-2 zui:py-1 zui:border zui:border-gray-200 zui:rounded zui:bg-gray-200",children:"Esc"})}),n(I,{children:o("kbd",{className:"zui:px-2 zui:py-1 zui:border zui:border-gray-200 zui:rounded zui:bg-gray-200",children:[n("span",{children:"⌘"}),n("span",{children:"+"}),n("span",{children:"K"})]})})]})},a,{focusOutline:!1,autoFocus:c===N,variant:i}))},$=u.forwardRef(function(r,e){return n(x,t({direction:"up",ref:e},r))}),rr=d(null),tr=function(){return p(rr)},er=function(r){var i=r.list,a=void 0===i?[]:i,c=e(r,["list"]),f=s(function(){return Y(a)},[a]),d=l(!1),p=d[0],v=d[1];h(function(){var r=function(r){r.ctrlKey&&"k"===r.key.toLowerCase()&&(r.preventDefault(),v(!0))};return window.addEventListener("keydown",r),function(){return window.removeEventListener("keydown",r)}},[]);var y=function(){v(!1)};return n(u.Fragment,{children:o(rr.Provider,{value:{handleClose:y},children:[n("div",{className:"global-search-container",onClick:function(){return v(!0)},children:n(Z,{kbdType:"open",inputProps:{placeholder:c.placeholder||"Search...",readOnly:!0,className:"zui:rounded-full"},variant:"contained"})}),n(E,{open:p,TransitionComponent:$,onClose:y,maxWidth:"md",slotProps:{backdrop:{style:{backgroundColor:"rgba(0,0,0,0.6)",backdropFilter:"blur(4px)"}}},PaperProps:{sx:{width:620,height:550,borderRadius:2}},"aria-describedby":"alert-dialog-slide-description",children:n(X,t({list:f},c))})]})})};export{er as GlobalMenuSearch,er as default};
1
+ import{b as r,a as t,_ as e}from"../../chunks/tslib.es6-4974c96c.esm.js";import{jsx as n,jsxs as o,Fragment as i}from"react/jsx-runtime";import*as a from"react";import u,{Fragment as c,useState as l,useMemo as s,useRef as f,useEffect as h,createContext as d,useContext as p}from"react";import{Box as v,List as y,ListItemButton as m,ListItemIcon as g,ListItemText as b,CircularProgress as w,Slide as x,Dialog as E,DialogTitle as k,Divider as z,DialogContent as j,DialogActions as P}from"@mui/material";import{b as A,S as O}from"../../chunks/lucide-7e7c48b9.esm.js";import{T as _}from"../../chunks/Text-5b99f7f4.esm.js";import{Input as C}from"../Input/index.esm.js";import"../../chunks/index-32c3a4e2.esm.js";var T="open",N="exit",S=function(r){var t=tr(),e=r.list,i=void 0===e?[]:e,a=r.history,u=null==t?void 0:t.handleClose;return n(v,{p:1,children:n(y,{disablePadding:!0,component:"nav","aria-label":"menu list box",children:i.map(function(r){return o(m,{onClick:function(){return t=r.url,null==a||a.push(t),void("function"==typeof u&&u());var t},sx:{fontFamily:"sans-serif",fontSize:14,background:"rgba(246, 247, 248, 0.4)",mt:1,minHeight:48,border:"1px solid rgba(232, 234, 238, 0.5)",borderRadius:1,":hover":{background:"#ebf5ff",borderColor:"#66b2ff",color:"#66b2ff"}},children:[n(g,{sx:{minWidth:"auto",color:"inherit"},children:n(A,{size:24})}),n(b,{primaryTypographyProps:{sx:{textTransform:"capitalize"},component:"div",variant:"body1",fontSize:14,fontWeight:500,lineHeight:.85},secondaryTypographyProps:{component:"div",variant:"body1",fontSize:12},sx:{ml:1},primary:r.name||"-",secondary:r.custom_path})]})})})})},F=function(r){return"function"==typeof r.children?u.createElement(c,null,r.children()):u.createElement(c,null,r.children||null)},I=function(r){return F(r)},G=function(r){return F(r)};function R(r,t,e,n,o,i,a){try{var u=r[i](a),c=u.value}catch(r){return void e(r)}u.done?t(c):Promise.resolve(c).then(n,o)}function D(r){return function(){var t=this,e=arguments;return new Promise(function(n,o){var i=r.apply(t,e);function a(r){R(i,n,o,a,u,"next",r)}function u(r){R(i,n,o,a,u,"throw",r)}a(void 0)})}}function L(){return L=Object.assign?Object.assign.bind():function(r){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)({}).hasOwnProperty.call(e,n)&&(r[n]=e[n])}return r},L.apply(null,arguments)}function W(){W=function(){return t};var r,t={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(r,t,e,n){return Object.defineProperty(r,t,{value:e,enumerable:!n,configurable:!n,writable:!n})}try{c({},"")}catch(r){c=function(r,t,e){return r[t]=e}}function l(t,e,n,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype);return c(a,"_invoke",function(t,e,n){var o=1;return function(i,a){if(3===o)throw Error("Generator is already running");if(4===o){if("throw"===i)throw a;return{value:r,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=x(u,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===o)throw o=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=3;var l=s(t,e,n);if("normal"===l.type){if(o=n.done?4:2,l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=4,n.method="throw",n.arg=l.arg)}}}(t,n,new z(o||[])),!0),a}function s(r,t,e){try{return{type:"normal",arg:r.call(t,e)}}catch(r){return{type:"throw",arg:r}}}t.wrap=l;var f={};function h(){}function d(){}function p(){}var v={};c(v,i,function(){return this});var y=Object.getPrototypeOf,m=y&&y(y(j([])));m&&m!==e&&n.call(m,i)&&(v=m);var g=p.prototype=h.prototype=Object.create(v);function b(r){["next","throw","return"].forEach(function(t){c(r,t,function(r){return this._invoke(t,r)})})}function w(r,t){function e(o,i,a,u){var c=s(r[o],r,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==typeof f&&n.call(f,"__await")?t.resolve(f.__await).then(function(r){e("next",r,a,u)},function(r){e("throw",r,a,u)}):t.resolve(f).then(function(r){l.value=r,a(l)},function(r){return e("throw",r,a,u)})}u(c.arg)}var o;c(this,"_invoke",function(r,n){function i(){return new t(function(t,o){e(r,n,t,o)})}return o=o?o.then(i,i):i()},!0)}function x(t,e){var n=e.method,o=t.i[n];if(o===r)return e.delegate=null,"throw"===n&&t.i.return&&(e.method="return",e.arg=r,x(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var i=s(o,t.i,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var a=i.arg;return a?a.done?(e[t.r]=a.value,e.next=t.n,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,f):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function E(r){this.tryEntries.push(r)}function k(t){var e=t[4]||{};e.type="normal",e.arg=r,t[4]=e}function z(r){this.tryEntries=[[-1]],r.forEach(E,this),this.reset(!0)}function j(t){if(null!=t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function e(){for(;++o<t.length;)if(n.call(t,o))return e.value=t[o],e.done=!1,e;return e.value=r,e.done=!0,e};return a.next=a}}throw new TypeError(typeof t+" is not iterable")}return d.prototype=p,c(g,"constructor",p),c(p,"constructor",d),d.displayName=c(p,u,"GeneratorFunction"),t.isGeneratorFunction=function(r){var t="function"==typeof r&&r.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,p):(r.__proto__=p,c(r,u,"GeneratorFunction")),r.prototype=Object.create(g),r},t.awrap=function(r){return{__await:r}},b(w.prototype),c(w.prototype,a,function(){return this}),t.AsyncIterator=w,t.async=function(r,e,n,o,i){void 0===i&&(i=Promise);var a=new w(l(r,e,n,o),i);return t.isGeneratorFunction(e)?a:a.next().then(function(r){return r.done?r.value:a.next()})},b(g),c(g,u,"Generator"),c(g,i,function(){return this}),c(g,"toString",function(){return"[object Generator]"}),t.keys=function(r){var t=Object(r),e=[];for(var n in t)e.unshift(n);return function r(){for(;e.length;)if((n=e.pop())in t)return r.value=n,r.done=!1,r;return r.done=!0,r}},t.values=j,z.prototype={constructor:z,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var r=this.tryEntries[0][4];if("throw"===r.type)throw r.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r){a.type="throw",a.arg=t,e.next=r}for(var o=e.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i[4],u=this.prev,c=i[1],l=i[2];if(-1===i[0])return n("end"),!1;if(!c&&!l)throw Error("try statement without catch or finally");if(null!=i[0]&&i[0]<=u){if(u<c)return this.method="next",this.arg=r,n(c),!0;if(u<l)return n(l),!1}}},abrupt:function(r,t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var o=n;break}}o&&("break"===r||"continue"===r)&&o[0]<=t&&t<=o[2]&&(o=null);var i=o?o[4]:{};return i.type=r,i.arg=t,o?(this.method="next",this.next=o[2],f):this.complete(i)},complete:function(r,t){if("throw"===r.type)throw r.arg;return"break"===r.type||"continue"===r.type?this.next=r.arg:"return"===r.type?(this.rval=this.arg=r.arg,this.method="return",this.next="end"):"normal"===r.type&&t&&(this.next=t),f},finish:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var e=this.tryEntries[t];if(e[2]===r)return this.complete(e[4],e[3]),k(e),f}},catch:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var e=this.tryEntries[t];if(e[0]===r){var n=e[4];if("throw"===n.type){var o=n.arg;k(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={i:j(t),r:e,n:n},"next"===this.method&&(this.arg=r),f}},t}var H=function(r){return F(r)};function K(r){return"function"==typeof r}function q(r){return"object"==typeof r&&null!==r&&(r instanceof Promise||r!==Promise.prototype&&function(r){return Reflect.has(r,"then")&&K(r.then)}(r)&&function(r){return Reflect.has(r,"catch")&&K(r.catch)}(r))}var B=function(r,t){void 0===t&&(t=[]);var e=f(!1),n=f([]);if("function"!=typeof r)throw new Error("Incorrect callback parameter for useSingleton hook; expected a function, but got: '"+typeof r+"'.");if(!Array.isArray(t))throw new Error("Incorrect dependencies parameter for useSingleton; expected an array, but got: '"+typeof t+"'.");if(Array.isArray(t)&&t.length>0){if(!function(r,t){if(!Array.isArray(r)||!Array.isArray(t))throw new Error("shallowArraysEqual only accepts arrays as parameters");if(r.length!==t.length)return!1;for(var e=0;e<r.length;++e)if(r[e]!==t[e])return!1;return!0}(n.current,t))n.current=t;else if(e.current)return}else if(e.current)return;r(),e.current=!0};function M(r){var t=r.promise,e=r.keepAlive,n=void 0!==e&&e,o=r.children,i=l(null),u=i[0],d=i[1],p=l(null),v=p[0],y=p[1],m=s(function(){return function(r){if(!q(r))throw new Error("Argument of createCancellablePromise should be a Promise");var t={value:!1},e=new Promise(function(){var e=D(W().mark(function e(n,o){var i;return W().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r;case 3:i=e.sent,t.value||n(i),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),t.value||o(e.t0);case 10:case"end":return e.stop()}},e,null,[[0,7]])}));return function(r,t){return e.apply(this,arguments)}}());return Object.keys(r).forEach(function(t){e[t]=r[t]}),{promise:e,cancel:function(){t.value=!0}}}(t)},[t]),g=f([]);if(h(function(){return function(){n||m.cancel()}},[m,m.promise,n]),B(D(W().mark(function r(){var t;return W().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return d(null),y(null),r.prev=2,r.next=5,m.promise;case 5:t=r.sent,y(t),d(!0),g.current.push(m),r.next=16;break;case 11:r.prev=11,r.t0=r.catch(2),y(r.t0),d(!1),g.current.push(m);case 16:case"end":return r.stop()}},r,null,[[2,11]])})),[m.promise]),!o||!q(t))return null;if(null===u){var b=a.Children.toArray(o).find(function(r){return r.type===G});return a.createElement(c,null,b||null)}if(!u){var w=a.Children.toArray(o).find(function(r){return r.type===I});if(!w)return a.createElement(c,null,null);var x=w,E=w.props;return"function"==typeof E.children&&(x=L({},w,{props:L({},E,{children:function(){return E.children(v,g.current,m.promise)}})})),a.createElement(c,null,x)}var k=a.Children.toArray(o).find(function(r){return r.type===H});if(!k)return a.createElement(c,null,null);var z=k,j=k.props;return"function"==typeof j.children&&(z=L({},k,{props:L({},j,{children:function(){return j.children(v,g.current,m.promise)}})})),a.createElement(c,null,z)}var V=function(r){var t=r.condition,e=r.keepAlive,n=void 0!==e&&e,o=r.children;if(!o)return null;if(function(r,t){if("production"!==process.env.NODE_ENV&&r){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(r){}}}(!Array.isArray(o)&&!(o.type===I||o.type===H)||!u.Children.toArray(o).every(function(r){return r.type===I||r.type===H||r.type===G}),"The <If> component should contain <Then /> <Else /> or <Fallback /> components as its children"),q(t))return u.createElement(M,{promise:t,keepAlive:n},o);var i=function(r){return Boolean("function"==typeof r?r():r)}(t);return u.createElement(c,null,u.Children.toArray(o).find(function(r){return r.type!==I!=!i})||null)};function Y(e,n){return void 0===n&&(n=[]),e.flatMap(function(e){var o=r(r([],n,!0),[e.name],!1);if(e.children&&e.children.length>0)return Y(e.children,o);var i=t(t({},e),{custom_path:o.join(" / ")});return delete i.children,[i]})}var J=function(r){return(null==r?void 0:r.trim().toLowerCase())||""},Q=function(r){var e=r.sx;return o(v,{sx:t({display:"flex",flexDirection:"column",height:"100%",justifyContent:"center",alignItems:"center",background:"#f4f4f4",color:"gray"},e),children:[n(O,{size:40}),n(_,{size:"sm",children:"No results found based on search"})]})};function U(r){var e=r.children,o=r.loading,a=r.list,u={display:"flex",flexDirection:"column",height:"100%",justifyContent:"center",alignItems:"center"};return o?n(v,{sx:u,children:n(w,{thickness:2})}):0===(null==a?void 0:a.length)?n(Q,{sx:t(t({},u),{background:"#f4f4f4",color:"gray"})}):n(i,{children:e})}var X=function(r){var t=r.list,e=void 0===t?[]:t,i=r.delay,a=void 0===i?1e3:i,c=r.popInputPlaceholder,f=void 0===c?"Search...":c,d=r.history,p=l(""),v=p[0],y=p[1],m=l([]),g=m[0],b=m[1],w=l(!1),x=w[0],E=w[1],A=function(r){var t=[],n=J(r);t=n?e.filter(function(r){return J(r.name).includes(n)}):e,b(t),E(!1)},O=s(function(){return function(r,t){var e;return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];clearTimeout(e),e=setTimeout(function(){r.apply(void 0,n)},t)}}(A,a)},[]);h(function(){E(!0),O(v)},[v,O]);return o(u.Fragment,{children:[n(k,{classes:{root:"zui:!p-1"},component:"div",color:"primary",className:"font-semibold flex items-center",children:n(Z,{kbdType:"exit",variant:"outlined",inputProps:{className:"zui:!mb-0 zui:!text-sm",placeholder:f,value:v,onChange:function(r){var t=r.target.value;y(t)}}})}),n(z,{}),n(j,{classes:{root:"zui:!p-0"},children:n(U,{loading:x,list:g,children:n(S,{list:g,history:d})})}),n(z,{}),n(P,{children:o("div",{className:"zui:flex zui:flex-row zui:gap-0.5 zui:items-center",children:[n(_,{size:"sm",children:"Search by :"}),n("img",{loading:"lazy",className:"org_logo",src:"https://files.zimyo.work/staticlogo/global/zimyo.svg",width:85})]})})]})},Z=function(r){var e=r.variant,i=void 0===e?"contained":e,a=r.inputProps,u=r.kbdType,c=void 0===u?T:u;return n(C,t({leftIcon:n(O,{size:16}),rightIcon:o(V,{condition:c===N,children:[n(H,{children:n("kbd",{className:"zui:px-2 zui:py-1 zui:border zui:border-gray-200 zui:rounded zui:bg-gray-200",children:"Esc"})}),n(I,{children:o("kbd",{className:"zui:px-2 zui:py-1 zui:border zui:border-gray-200 zui:rounded zui:bg-gray-200",children:[n("span",{children:"⌘"}),n("span",{children:"+"}),n("span",{children:"K"})]})})]})},a,{focusOutline:!1,autoFocus:c===N,variant:i}))},$=u.forwardRef(function(r,e){return n(x,t({direction:"up",ref:e},r))}),rr=d(null),tr=function(){return p(rr)},er=function(r){var i=r.list,a=void 0===i?[]:i,c=e(r,["list"]),f=s(function(){return Y(a)},[a]),d=l(!1),p=d[0],v=d[1];h(function(){var r=function(r){r.ctrlKey&&"k"===r.key.toLowerCase()&&(r.preventDefault(),v(!0))};return window.addEventListener("keydown",r),function(){return window.removeEventListener("keydown",r)}},[]);var y=function(){v(!1)};return n(u.Fragment,{children:o(rr.Provider,{value:{handleClose:y},children:[n("div",{className:"global-search-container",onClick:function(){return v(!0)},children:n(Z,{kbdType:"open",inputProps:{placeholder:c.placeholder||"Search...",readOnly:!0,className:"zui:rounded-full"},variant:"contained"})}),n(E,{open:p,TransitionComponent:$,onClose:y,maxWidth:"md",slotProps:{backdrop:{style:{backgroundColor:"rgba(0,0,0,0.6)",backdropFilter:"blur(4px)"}}},PaperProps:{sx:{width:620,height:550,borderRadius:2}},"aria-describedby":"alert-dialog-slide-description",children:n(X,t({list:f},c))})]})})};export{er as GlobalMenuSearch,er as default};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../chunks/tslib.es6-a3dc1f53.js"),r=require("react/jsx-runtime"),t=require("react"),n=require("@mui/material"),i=require("../../chunks/lucide-493ccaad.js"),o=require("../../chunks/Text-e9636dd7.js"),a=require("../Input/index.js");function u(e){var r=Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}}),r.default=e,Object.freeze(r)}require("../../chunks/index-90b71f01.js");var c=u(t),s="open",l="exit",f=function(e){var t=F(),o=e.list,a=void 0===o?[]:o,u=e.history,c=null==t?void 0:t.handleClose;return r.jsx(n.Box,{p:1,children:r.jsx(n.List,{disablePadding:!0,component:"nav","aria-label":"menu list box",children:a.map(function(e){return r.jsxs(n.ListItemButton,{onClick:function(){return r=e.url,null==u||u.push(r),void("function"==typeof c&&c());var r},sx:{fontFamily:"sans-serif",fontSize:14,background:"rgba(246, 247, 248, 0.4)",mt:1,minHeight:48,border:"1px solid rgba(232, 234, 238, 0.5)",borderRadius:1,":hover":{background:"#ebf5ff",borderColor:"#66b2ff",color:"#66b2ff"}},children:[r.jsx(n.ListItemIcon,{sx:{minWidth:"auto",color:"inherit"},children:r.jsx(i.Globe,{size:24})}),r.jsx(n.ListItemText,{primaryTypographyProps:{sx:{textTransform:"capitalize"},component:"div",variant:"body1",fontSize:14,fontWeight:500,lineHeight:.85},secondaryTypographyProps:{component:"div",variant:"body1",fontSize:12},sx:{ml:1},primary:e.name||"-",secondary:e.custom_path})]})})})})},h=function(e){return"function"==typeof e.children?t.createElement(t.Fragment,null,e.children()):t.createElement(t.Fragment,null,e.children||null)},d=function(e){return h(e)},p=function(e){return h(e)};function v(e,r,t,n,i,o,a){try{var u=e[o](a),c=u.value}catch(e){return void t(e)}u.done?r(c):Promise.resolve(c).then(n,i)}function y(e){return function(){var r=this,t=arguments;return new Promise(function(n,i){var o=e.apply(r,t);function a(e){v(o,n,i,a,u,"next",e)}function u(e){v(o,n,i,a,u,"throw",e)}a(void 0)})}}function g(){return g=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},g.apply(null,arguments)}function m(){m=function(){return r};var e,r={},t=Object.prototype,n=t.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,r,t,n){return Object.defineProperty(e,r,{value:t,enumerable:!n,configurable:!n,writable:!n})}try{c({},"")}catch(e){c=function(e,r,t){return e[r]=t}}function s(r,t,n,i){var o=t&&t.prototype instanceof h?t:h,a=Object.create(o.prototype);return c(a,"_invoke",function(r,t,n){var i=1;return function(o,a){if(3===i)throw Error("Generator is already running");if(4===i){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var u=n.delegate;if(u){var c=j(u,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===i)throw i=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=3;var s=l(r,t,n);if("normal"===s.type){if(i=n.done?4:2,s.arg===f)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(i=4,n.method="throw",n.arg=s.arg)}}}(r,n,new _(i||[])),!0),a}function l(e,r,t){try{return{type:"normal",arg:e.call(r,t)}}catch(e){return{type:"throw",arg:e}}}r.wrap=s;var f={};function h(){}function d(){}function p(){}var v={};c(v,o,function(){return this});var y=Object.getPrototypeOf,g=y&&y(y(z([])));g&&g!==t&&n.call(g,o)&&(v=g);var x=p.prototype=h.prototype=Object.create(v);function b(e){["next","throw","return"].forEach(function(r){c(e,r,function(e){return this._invoke(r,e)})})}function w(e,r){function t(i,o,a,u){var c=l(e[i],e,o);if("throw"!==c.type){var s=c.arg,f=s.value;return f&&"object"==typeof f&&n.call(f,"__await")?r.resolve(f.__await).then(function(e){t("next",e,a,u)},function(e){t("throw",e,a,u)}):r.resolve(f).then(function(e){s.value=e,a(s)},function(e){return t("throw",e,a,u)})}u(c.arg)}var i;c(this,"_invoke",function(e,n){function o(){return new r(function(r,i){t(e,n,r,i)})}return i=i?i.then(o,o):o()},!0)}function j(r,t){var n=t.method,i=r.i[n];if(i===e)return t.delegate=null,"throw"===n&&r.i.return&&(t.method="return",t.arg=e,j(r,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var o=l(i,r.i,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,f;var a=o.arg;return a?a.done?(t[r.r]=a.value,t.next=r.n,"return"!==t.method&&(t.method="next",t.arg=e),t.delegate=null,f):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function E(e){this.tryEntries.push(e)}function k(r){var t=r[4]||{};t.type="normal",t.arg=e,r[4]=t}function _(e){this.tryEntries=[[-1]],e.forEach(E,this),this.reset(!0)}function z(r){if(null!=r){var t=r[o];if(t)return t.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var i=-1,a=function t(){for(;++i<r.length;)if(n.call(r,i))return t.value=r[i],t.done=!1,t;return t.value=e,t.done=!0,t};return a.next=a}}throw new TypeError(typeof r+" is not iterable")}return d.prototype=p,c(x,"constructor",p),c(p,"constructor",d),d.displayName=c(p,u,"GeneratorFunction"),r.isGeneratorFunction=function(e){var r="function"==typeof e&&e.constructor;return!!r&&(r===d||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,c(e,u,"GeneratorFunction")),e.prototype=Object.create(x),e},r.awrap=function(e){return{__await:e}},b(w.prototype),c(w.prototype,a,function(){return this}),r.AsyncIterator=w,r.async=function(e,t,n,i,o){void 0===o&&(o=Promise);var a=new w(s(e,t,n,i),o);return r.isGeneratorFunction(t)?a:a.next().then(function(e){return e.done?e.value:a.next()})},b(x),c(x,u,"Generator"),c(x,o,function(){return this}),c(x,"toString",function(){return"[object Generator]"}),r.keys=function(e){var r=Object(e),t=[];for(var n in r)t.unshift(n);return function e(){for(;t.length;)if((n=t.pop())in r)return e.value=n,e.done=!1,e;return e.done=!0,e}},r.values=z,_.prototype={constructor:_,reset:function(r){if(this.prev=this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(k),!r)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0][4];if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var t=this;function n(e){a.type="throw",a.arg=r,t.next=e}for(var i=t.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o[4],u=this.prev,c=o[1],s=o[2];if(-1===o[0])return n("end"),!1;if(!c&&!s)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=u){if(u<c)return this.method="next",this.arg=e,n(c),!0;if(u<s)return n(s),!1}}},abrupt:function(e,r){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var i=n;break}}i&&("break"===e||"continue"===e)&&i[0]<=r&&r<=i[2]&&(i=null);var o=i?i[4]:{};return o.type=e,o.arg=r,i?(this.method="next",this.next=i[2],f):this.complete(o)},complete:function(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),f},finish:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t[2]===e)return this.complete(t[4],t[3]),k(t),f}},catch:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t[0]===e){var n=t[4];if("throw"===n.type){var i=n.arg;k(t)}return i}}throw Error("illegal catch attempt")},delegateYield:function(r,t,n){return this.delegate={i:z(r),r:t,n:n},"next"===this.method&&(this.arg=e),f}},r}var x=function(e){return h(e)};function b(e){return"function"==typeof e}function w(e){return"object"==typeof e&&null!==e&&(e instanceof Promise||e!==Promise.prototype&&function(e){return Reflect.has(e,"then")&&b(e.then)}(e)&&function(e){return Reflect.has(e,"catch")&&b(e.catch)}(e))}var j=function(e,r){void 0===r&&(r=[]);var n=t.useRef(!1),i=t.useRef([]);if("function"!=typeof e)throw new Error("Incorrect callback parameter for useSingleton hook; expected a function, but got: '"+typeof e+"'.");if(!Array.isArray(r))throw new Error("Incorrect dependencies parameter for useSingleton; expected an array, but got: '"+typeof r+"'.");if(Array.isArray(r)&&r.length>0){if(!function(e,r){if(!Array.isArray(e)||!Array.isArray(r))throw new Error("shallowArraysEqual only accepts arrays as parameters");if(e.length!==r.length)return!1;for(var t=0;t<e.length;++t)if(e[t]!==r[t])return!1;return!0}(i.current,r))i.current=r;else if(n.current)return}else if(n.current)return;e(),n.current=!0};function E(e){var r=e.promise,n=e.keepAlive,i=void 0!==n&&n,o=e.children,a=t.useState(null),u=a[0],s=a[1],l=t.useState(null),f=l[0],h=l[1],v=t.useMemo(function(){return function(e){if(!w(e))throw new Error("Argument of createCancellablePromise should be a Promise");var r={value:!1},t=new Promise(function(){var t=y(m().mark(function t(n,i){var o;return m().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e;case 3:o=t.sent,r.value||n(o),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),r.value||i(t.t0);case 10:case"end":return t.stop()}},t,null,[[0,7]])}));return function(e,r){return t.apply(this,arguments)}}());return Object.keys(e).forEach(function(r){t[r]=e[r]}),{promise:t,cancel:function(){r.value=!0}}}(r)},[r]),b=t.useRef([]);if(t.useEffect(function(){return function(){i||v.cancel()}},[v,v.promise,i]),j(y(m().mark(function e(){var r;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s(null),h(null),e.prev=2,e.next=5,v.promise;case 5:r=e.sent,h(r),s(!0),b.current.push(v),e.next=16;break;case 11:e.prev=11,e.t0=e.catch(2),h(e.t0),s(!1),b.current.push(v);case 16:case"end":return e.stop()}},e,null,[[2,11]])})),[v.promise]),!o||!w(r))return null;if(null===u){var E=c.Children.toArray(o).find(function(e){return e.type===p});return c.createElement(t.Fragment,null,E||null)}if(!u){var k=c.Children.toArray(o).find(function(e){return e.type===d});if(!k)return c.createElement(t.Fragment,null,null);var _=k,z=k.props;return"function"==typeof z.children&&(_=g({},k,{props:g({},z,{children:function(){return z.children(f,b.current,v.promise)}})})),c.createElement(t.Fragment,null,_)}var P=c.Children.toArray(o).find(function(e){return e.type===x});if(!P)return c.createElement(t.Fragment,null,null);var O=P,A=P.props;return"function"==typeof A.children&&(O=g({},P,{props:g({},A,{children:function(){return A.children(f,b.current,v.promise)}})})),c.createElement(t.Fragment,null,O)}var k=function(e){var r=e.condition,n=e.keepAlive,i=void 0!==n&&n,o=e.children;if(!o)return null;if(function(e,r){if("production"!==process.env.NODE_ENV&&e){"undefined"!=typeof console&&console.warn(r);try{throw new Error(r)}catch(e){}}}(!Array.isArray(o)&&!(o.type===d||o.type===x)||!t.Children.toArray(o).every(function(e){return e.type===d||e.type===x||e.type===p}),"The <If> component should contain <Then /> <Else /> or <Fallback /> components as its children"),w(r))return t.createElement(E,{promise:r,keepAlive:i},o);var a=function(e){return Boolean("function"==typeof e?e():e)}(r);return t.createElement(t.Fragment,null,t.Children.toArray(o).find(function(e){return e.type!==d!=!a})||null)};function _(r,t){return void 0===t&&(t=[]),r.flatMap(function(r){var n=e.__spreadArray(e.__spreadArray([],t,!0),[r.name],!1);if(r.children&&r.children.length>0)return _(r.children,n);var i=e.__assign(e.__assign({},r),{custom_path:n.join(" / ")});return delete i.children,[i]})}var z=function(e){return(null==e?void 0:e.trim().toLowerCase())||""},P=function(t){var a=t.sx;return r.jsxs(n.Box,{sx:e.__assign({display:"flex",flexDirection:"column",height:"100%",justifyContent:"center",alignItems:"center",background:"#f4f4f4",color:"gray"},a),children:[r.jsx(i.Search,{size:40}),r.jsx(o.Text,{size:"sm",children:"No results found based on search"})]})};function O(t){var i=t.children,o=t.loading,a=t.list,u={display:"flex",flexDirection:"column",height:"100%",justifyContent:"center",alignItems:"center"};return o?r.jsx(n.Box,{sx:u,children:r.jsx(n.CircularProgress,{thickness:2})}):0===(null==a?void 0:a.length)?r.jsx(P,{sx:e.__assign(e.__assign({},u),{background:"#f4f4f4",color:"gray"})}):r.jsx(r.Fragment,{children:i})}var A=function(e){var i=e.list,a=void 0===i?[]:i,u=e.delay,c=void 0===u?1e3:u,s=e.popInputPlaceholder,l=void 0===s?"Search...":s,h=e.history,d=t.useState(""),p=d[0],v=d[1],y=t.useState([]),g=y[0],m=y[1],x=t.useState(!1),b=x[0],w=x[1],j=function(e){var r=[],t=z(e);r=t?a.filter(function(e){return z(e.name).includes(t)}):a,m(r),w(!1)},E=t.useMemo(function(){return function(e,r){var t;return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];clearTimeout(t),t=setTimeout(function(){e.apply(void 0,n)},r)}}(j,c)},[]);t.useEffect(function(){w(!0),E(p)},[p,E]);return r.jsxs(t.Fragment,{children:[r.jsx(n.DialogTitle,{classes:{root:"zui:!p-1"},component:"div",color:"primary",className:"font-semibold flex items-center",children:r.jsx(C,{kbdType:"exit",variant:"outlined",inputProps:{className:"zui:!mb-0 zui:!text-sm",placeholder:l,value:p,onChange:function(e){var r=e.target.value;v(r)}}})}),r.jsx(n.Divider,{}),r.jsx(n.DialogContent,{classes:{root:"zui:!p-0"},children:r.jsx(O,{loading:b,list:g,children:r.jsx(f,{list:g,history:h})})}),r.jsx(n.Divider,{}),r.jsx(n.DialogActions,{children:r.jsxs("div",{className:"zui:flex zui:flex-row zui:gap-0.5 zui:items-center",children:[r.jsx(o.Text,{size:"sm",children:"Search by :"}),r.jsx("img",{loading:"lazy",className:"org_logo",src:"https://files.zimyo.work/staticlogo/global/zimyo.svg",width:85})]})})]})},C=function(t){var n=t.variant,o=void 0===n?"contained":n,u=t.inputProps,c=t.kbdType,f=void 0===c?s:c;return r.jsx(a.Input,e.__assign({leftIcon:r.jsx(i.Search,{size:16}),rightIcon:r.jsxs(k,{condition:f===l,children:[r.jsx(x,{children:r.jsx("kbd",{className:"zui:px-2 zui:py-1 zui:border zui:border-gray-200 zui:rounded zui:bg-gray-200",children:"Esc"})}),r.jsx(d,{children:r.jsxs("kbd",{className:"zui:px-2 zui:py-1 zui:border zui:border-gray-200 zui:rounded zui:bg-gray-200",children:[r.jsx("span",{children:"⌘"}),r.jsx("span",{children:"+"}),r.jsx("span",{children:"K"})]})})]})},u,{focusOutline:!1,autoFocus:f===l,variant:o}))},S=t.forwardRef(function(t,i){return r.jsx(n.Slide,e.__assign({direction:"up",ref:i},t))}),T=t.createContext(null),F=function(){return t.useContext(T)},I=function(i){var o=i.list,a=void 0===o?[]:o,u=e.__rest(i,["list"]),c=t.useMemo(function(){return _(a)},[a]),s=t.useState(!1),l=s[0],f=s[1];t.useEffect(function(){var e=function(e){e.ctrlKey&&"k"===e.key.toLowerCase()&&(e.preventDefault(),f(!0))};return window.addEventListener("keydown",e),function(){return window.removeEventListener("keydown",e)}},[]);var h=function(){f(!1)};return r.jsx(t.Fragment,{children:r.jsxs(T.Provider,{value:{handleClose:h},children:[r.jsx("div",{className:"global-search-container",onClick:function(){return f(!0)},children:r.jsx(C,{kbdType:"open",inputProps:{placeholder:u.placeholder||"Search...",readOnly:!0,className:"zui:rounded-full"},variant:"contained"})}),r.jsx(n.Dialog,{open:l,TransitionComponent:S,onClose:h,maxWidth:"md",slotProps:{backdrop:{style:{backgroundColor:"rgba(0,0,0,0.6)",backdropFilter:"blur(4px)"}}},PaperProps:{sx:{width:620,height:550,borderRadius:2}},"aria-describedby":"alert-dialog-slide-description",children:r.jsx(A,e.__assign({list:c},u))})]})})};exports.GlobalMenuSearch=I,exports.default=I;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../chunks/tslib.es6-a3dc1f53.js"),r=require("react/jsx-runtime"),t=require("react"),n=require("@mui/material"),i=require("../../chunks/lucide-3fef2423.js"),o=require("../../chunks/Text-e9636dd7.js"),a=require("../Input/index.js");function u(e){var r=Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}}),r.default=e,Object.freeze(r)}require("../../chunks/index-90b71f01.js");var c=u(t),s="open",l="exit",f=function(e){var t=F(),o=e.list,a=void 0===o?[]:o,u=e.history,c=null==t?void 0:t.handleClose;return r.jsx(n.Box,{p:1,children:r.jsx(n.List,{disablePadding:!0,component:"nav","aria-label":"menu list box",children:a.map(function(e){return r.jsxs(n.ListItemButton,{onClick:function(){return r=e.url,null==u||u.push(r),void("function"==typeof c&&c());var r},sx:{fontFamily:"sans-serif",fontSize:14,background:"rgba(246, 247, 248, 0.4)",mt:1,minHeight:48,border:"1px solid rgba(232, 234, 238, 0.5)",borderRadius:1,":hover":{background:"#ebf5ff",borderColor:"#66b2ff",color:"#66b2ff"}},children:[r.jsx(n.ListItemIcon,{sx:{minWidth:"auto",color:"inherit"},children:r.jsx(i.Globe,{size:24})}),r.jsx(n.ListItemText,{primaryTypographyProps:{sx:{textTransform:"capitalize"},component:"div",variant:"body1",fontSize:14,fontWeight:500,lineHeight:.85},secondaryTypographyProps:{component:"div",variant:"body1",fontSize:12},sx:{ml:1},primary:e.name||"-",secondary:e.custom_path})]})})})})},h=function(e){return"function"==typeof e.children?t.createElement(t.Fragment,null,e.children()):t.createElement(t.Fragment,null,e.children||null)},d=function(e){return h(e)},p=function(e){return h(e)};function v(e,r,t,n,i,o,a){try{var u=e[o](a),c=u.value}catch(e){return void t(e)}u.done?r(c):Promise.resolve(c).then(n,i)}function y(e){return function(){var r=this,t=arguments;return new Promise(function(n,i){var o=e.apply(r,t);function a(e){v(o,n,i,a,u,"next",e)}function u(e){v(o,n,i,a,u,"throw",e)}a(void 0)})}}function g(){return g=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},g.apply(null,arguments)}function m(){m=function(){return r};var e,r={},t=Object.prototype,n=t.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,r,t,n){return Object.defineProperty(e,r,{value:t,enumerable:!n,configurable:!n,writable:!n})}try{c({},"")}catch(e){c=function(e,r,t){return e[r]=t}}function s(r,t,n,i){var o=t&&t.prototype instanceof h?t:h,a=Object.create(o.prototype);return c(a,"_invoke",function(r,t,n){var i=1;return function(o,a){if(3===i)throw Error("Generator is already running");if(4===i){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var u=n.delegate;if(u){var c=j(u,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===i)throw i=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=3;var s=l(r,t,n);if("normal"===s.type){if(i=n.done?4:2,s.arg===f)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(i=4,n.method="throw",n.arg=s.arg)}}}(r,n,new _(i||[])),!0),a}function l(e,r,t){try{return{type:"normal",arg:e.call(r,t)}}catch(e){return{type:"throw",arg:e}}}r.wrap=s;var f={};function h(){}function d(){}function p(){}var v={};c(v,o,function(){return this});var y=Object.getPrototypeOf,g=y&&y(y(z([])));g&&g!==t&&n.call(g,o)&&(v=g);var x=p.prototype=h.prototype=Object.create(v);function b(e){["next","throw","return"].forEach(function(r){c(e,r,function(e){return this._invoke(r,e)})})}function w(e,r){function t(i,o,a,u){var c=l(e[i],e,o);if("throw"!==c.type){var s=c.arg,f=s.value;return f&&"object"==typeof f&&n.call(f,"__await")?r.resolve(f.__await).then(function(e){t("next",e,a,u)},function(e){t("throw",e,a,u)}):r.resolve(f).then(function(e){s.value=e,a(s)},function(e){return t("throw",e,a,u)})}u(c.arg)}var i;c(this,"_invoke",function(e,n){function o(){return new r(function(r,i){t(e,n,r,i)})}return i=i?i.then(o,o):o()},!0)}function j(r,t){var n=t.method,i=r.i[n];if(i===e)return t.delegate=null,"throw"===n&&r.i.return&&(t.method="return",t.arg=e,j(r,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var o=l(i,r.i,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,f;var a=o.arg;return a?a.done?(t[r.r]=a.value,t.next=r.n,"return"!==t.method&&(t.method="next",t.arg=e),t.delegate=null,f):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function E(e){this.tryEntries.push(e)}function k(r){var t=r[4]||{};t.type="normal",t.arg=e,r[4]=t}function _(e){this.tryEntries=[[-1]],e.forEach(E,this),this.reset(!0)}function z(r){if(null!=r){var t=r[o];if(t)return t.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var i=-1,a=function t(){for(;++i<r.length;)if(n.call(r,i))return t.value=r[i],t.done=!1,t;return t.value=e,t.done=!0,t};return a.next=a}}throw new TypeError(typeof r+" is not iterable")}return d.prototype=p,c(x,"constructor",p),c(p,"constructor",d),d.displayName=c(p,u,"GeneratorFunction"),r.isGeneratorFunction=function(e){var r="function"==typeof e&&e.constructor;return!!r&&(r===d||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,c(e,u,"GeneratorFunction")),e.prototype=Object.create(x),e},r.awrap=function(e){return{__await:e}},b(w.prototype),c(w.prototype,a,function(){return this}),r.AsyncIterator=w,r.async=function(e,t,n,i,o){void 0===o&&(o=Promise);var a=new w(s(e,t,n,i),o);return r.isGeneratorFunction(t)?a:a.next().then(function(e){return e.done?e.value:a.next()})},b(x),c(x,u,"Generator"),c(x,o,function(){return this}),c(x,"toString",function(){return"[object Generator]"}),r.keys=function(e){var r=Object(e),t=[];for(var n in r)t.unshift(n);return function e(){for(;t.length;)if((n=t.pop())in r)return e.value=n,e.done=!1,e;return e.done=!0,e}},r.values=z,_.prototype={constructor:_,reset:function(r){if(this.prev=this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(k),!r)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0][4];if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var t=this;function n(e){a.type="throw",a.arg=r,t.next=e}for(var i=t.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o[4],u=this.prev,c=o[1],s=o[2];if(-1===o[0])return n("end"),!1;if(!c&&!s)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=u){if(u<c)return this.method="next",this.arg=e,n(c),!0;if(u<s)return n(s),!1}}},abrupt:function(e,r){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var i=n;break}}i&&("break"===e||"continue"===e)&&i[0]<=r&&r<=i[2]&&(i=null);var o=i?i[4]:{};return o.type=e,o.arg=r,i?(this.method="next",this.next=i[2],f):this.complete(o)},complete:function(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),f},finish:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t[2]===e)return this.complete(t[4],t[3]),k(t),f}},catch:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t[0]===e){var n=t[4];if("throw"===n.type){var i=n.arg;k(t)}return i}}throw Error("illegal catch attempt")},delegateYield:function(r,t,n){return this.delegate={i:z(r),r:t,n:n},"next"===this.method&&(this.arg=e),f}},r}var x=function(e){return h(e)};function b(e){return"function"==typeof e}function w(e){return"object"==typeof e&&null!==e&&(e instanceof Promise||e!==Promise.prototype&&function(e){return Reflect.has(e,"then")&&b(e.then)}(e)&&function(e){return Reflect.has(e,"catch")&&b(e.catch)}(e))}var j=function(e,r){void 0===r&&(r=[]);var n=t.useRef(!1),i=t.useRef([]);if("function"!=typeof e)throw new Error("Incorrect callback parameter for useSingleton hook; expected a function, but got: '"+typeof e+"'.");if(!Array.isArray(r))throw new Error("Incorrect dependencies parameter for useSingleton; expected an array, but got: '"+typeof r+"'.");if(Array.isArray(r)&&r.length>0){if(!function(e,r){if(!Array.isArray(e)||!Array.isArray(r))throw new Error("shallowArraysEqual only accepts arrays as parameters");if(e.length!==r.length)return!1;for(var t=0;t<e.length;++t)if(e[t]!==r[t])return!1;return!0}(i.current,r))i.current=r;else if(n.current)return}else if(n.current)return;e(),n.current=!0};function E(e){var r=e.promise,n=e.keepAlive,i=void 0!==n&&n,o=e.children,a=t.useState(null),u=a[0],s=a[1],l=t.useState(null),f=l[0],h=l[1],v=t.useMemo(function(){return function(e){if(!w(e))throw new Error("Argument of createCancellablePromise should be a Promise");var r={value:!1},t=new Promise(function(){var t=y(m().mark(function t(n,i){var o;return m().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e;case 3:o=t.sent,r.value||n(o),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),r.value||i(t.t0);case 10:case"end":return t.stop()}},t,null,[[0,7]])}));return function(e,r){return t.apply(this,arguments)}}());return Object.keys(e).forEach(function(r){t[r]=e[r]}),{promise:t,cancel:function(){r.value=!0}}}(r)},[r]),b=t.useRef([]);if(t.useEffect(function(){return function(){i||v.cancel()}},[v,v.promise,i]),j(y(m().mark(function e(){var r;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s(null),h(null),e.prev=2,e.next=5,v.promise;case 5:r=e.sent,h(r),s(!0),b.current.push(v),e.next=16;break;case 11:e.prev=11,e.t0=e.catch(2),h(e.t0),s(!1),b.current.push(v);case 16:case"end":return e.stop()}},e,null,[[2,11]])})),[v.promise]),!o||!w(r))return null;if(null===u){var E=c.Children.toArray(o).find(function(e){return e.type===p});return c.createElement(t.Fragment,null,E||null)}if(!u){var k=c.Children.toArray(o).find(function(e){return e.type===d});if(!k)return c.createElement(t.Fragment,null,null);var _=k,z=k.props;return"function"==typeof z.children&&(_=g({},k,{props:g({},z,{children:function(){return z.children(f,b.current,v.promise)}})})),c.createElement(t.Fragment,null,_)}var P=c.Children.toArray(o).find(function(e){return e.type===x});if(!P)return c.createElement(t.Fragment,null,null);var O=P,A=P.props;return"function"==typeof A.children&&(O=g({},P,{props:g({},A,{children:function(){return A.children(f,b.current,v.promise)}})})),c.createElement(t.Fragment,null,O)}var k=function(e){var r=e.condition,n=e.keepAlive,i=void 0!==n&&n,o=e.children;if(!o)return null;if(function(e,r){if("production"!==process.env.NODE_ENV&&e){"undefined"!=typeof console&&console.warn(r);try{throw new Error(r)}catch(e){}}}(!Array.isArray(o)&&!(o.type===d||o.type===x)||!t.Children.toArray(o).every(function(e){return e.type===d||e.type===x||e.type===p}),"The <If> component should contain <Then /> <Else /> or <Fallback /> components as its children"),w(r))return t.createElement(E,{promise:r,keepAlive:i},o);var a=function(e){return Boolean("function"==typeof e?e():e)}(r);return t.createElement(t.Fragment,null,t.Children.toArray(o).find(function(e){return e.type!==d!=!a})||null)};function _(r,t){return void 0===t&&(t=[]),r.flatMap(function(r){var n=e.__spreadArray(e.__spreadArray([],t,!0),[r.name],!1);if(r.children&&r.children.length>0)return _(r.children,n);var i=e.__assign(e.__assign({},r),{custom_path:n.join(" / ")});return delete i.children,[i]})}var z=function(e){return(null==e?void 0:e.trim().toLowerCase())||""},P=function(t){var a=t.sx;return r.jsxs(n.Box,{sx:e.__assign({display:"flex",flexDirection:"column",height:"100%",justifyContent:"center",alignItems:"center",background:"#f4f4f4",color:"gray"},a),children:[r.jsx(i.Search,{size:40}),r.jsx(o.Text,{size:"sm",children:"No results found based on search"})]})};function O(t){var i=t.children,o=t.loading,a=t.list,u={display:"flex",flexDirection:"column",height:"100%",justifyContent:"center",alignItems:"center"};return o?r.jsx(n.Box,{sx:u,children:r.jsx(n.CircularProgress,{thickness:2})}):0===(null==a?void 0:a.length)?r.jsx(P,{sx:e.__assign(e.__assign({},u),{background:"#f4f4f4",color:"gray"})}):r.jsx(r.Fragment,{children:i})}var A=function(e){var i=e.list,a=void 0===i?[]:i,u=e.delay,c=void 0===u?1e3:u,s=e.popInputPlaceholder,l=void 0===s?"Search...":s,h=e.history,d=t.useState(""),p=d[0],v=d[1],y=t.useState([]),g=y[0],m=y[1],x=t.useState(!1),b=x[0],w=x[1],j=function(e){var r=[],t=z(e);r=t?a.filter(function(e){return z(e.name).includes(t)}):a,m(r),w(!1)},E=t.useMemo(function(){return function(e,r){var t;return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];clearTimeout(t),t=setTimeout(function(){e.apply(void 0,n)},r)}}(j,c)},[]);t.useEffect(function(){w(!0),E(p)},[p,E]);return r.jsxs(t.Fragment,{children:[r.jsx(n.DialogTitle,{classes:{root:"zui:!p-1"},component:"div",color:"primary",className:"font-semibold flex items-center",children:r.jsx(C,{kbdType:"exit",variant:"outlined",inputProps:{className:"zui:!mb-0 zui:!text-sm",placeholder:l,value:p,onChange:function(e){var r=e.target.value;v(r)}}})}),r.jsx(n.Divider,{}),r.jsx(n.DialogContent,{classes:{root:"zui:!p-0"},children:r.jsx(O,{loading:b,list:g,children:r.jsx(f,{list:g,history:h})})}),r.jsx(n.Divider,{}),r.jsx(n.DialogActions,{children:r.jsxs("div",{className:"zui:flex zui:flex-row zui:gap-0.5 zui:items-center",children:[r.jsx(o.Text,{size:"sm",children:"Search by :"}),r.jsx("img",{loading:"lazy",className:"org_logo",src:"https://files.zimyo.work/staticlogo/global/zimyo.svg",width:85})]})})]})},C=function(t){var n=t.variant,o=void 0===n?"contained":n,u=t.inputProps,c=t.kbdType,f=void 0===c?s:c;return r.jsx(a.Input,e.__assign({leftIcon:r.jsx(i.Search,{size:16}),rightIcon:r.jsxs(k,{condition:f===l,children:[r.jsx(x,{children:r.jsx("kbd",{className:"zui:px-2 zui:py-1 zui:border zui:border-gray-200 zui:rounded zui:bg-gray-200",children:"Esc"})}),r.jsx(d,{children:r.jsxs("kbd",{className:"zui:px-2 zui:py-1 zui:border zui:border-gray-200 zui:rounded zui:bg-gray-200",children:[r.jsx("span",{children:"⌘"}),r.jsx("span",{children:"+"}),r.jsx("span",{children:"K"})]})})]})},u,{focusOutline:!1,autoFocus:f===l,variant:o}))},S=t.forwardRef(function(t,i){return r.jsx(n.Slide,e.__assign({direction:"up",ref:i},t))}),T=t.createContext(null),F=function(){return t.useContext(T)},I=function(i){var o=i.list,a=void 0===o?[]:o,u=e.__rest(i,["list"]),c=t.useMemo(function(){return _(a)},[a]),s=t.useState(!1),l=s[0],f=s[1];t.useEffect(function(){var e=function(e){e.ctrlKey&&"k"===e.key.toLowerCase()&&(e.preventDefault(),f(!0))};return window.addEventListener("keydown",e),function(){return window.removeEventListener("keydown",e)}},[]);var h=function(){f(!1)};return r.jsx(t.Fragment,{children:r.jsxs(T.Provider,{value:{handleClose:h},children:[r.jsx("div",{className:"global-search-container",onClick:function(){return f(!0)},children:r.jsx(C,{kbdType:"open",inputProps:{placeholder:u.placeholder||"Search...",readOnly:!0,className:"zui:rounded-full"},variant:"contained"})}),r.jsx(n.Dialog,{open:l,TransitionComponent:S,onClose:h,maxWidth:"md",slotProps:{backdrop:{style:{backgroundColor:"rgba(0,0,0,0.6)",backdropFilter:"blur(4px)"}}},PaperProps:{sx:{width:620,height:550,borderRadius:2}},"aria-describedby":"alert-dialog-slide-description",children:r.jsx(A,e.__assign({list:c},u))})]})})};exports.GlobalMenuSearch=I,exports.default=I;
@@ -1 +1 @@
1
- import{_ as e,a as i}from"../../chunks/tslib.es6-4974c96c.esm.js";import{jsxs as t,jsx as u}from"react/jsx-runtime";import*as n from"react";import{u as r,a as o}from"../../chunks/index-32c3a4e2.esm.js";import{E as l,e as a}from"../../chunks/lucide-8c9441ea.esm.js";var s={xs:"zui:h-8 zui:text-xs",sm:"zui:h-9 zui:text-sm",md:"zui:h-10 zui:text-sm",lg:"zui:h-11 zui:text-base"},z={xs:"zui:py-1.5",sm:"zui:py-2",md:"zui:py-2",lg:"zui:py-2.5"},c={xs:"zui:px-2",sm:"zui:px-2.5",md:"zui:px-3",lg:"zui:px-3.5"},d={xs:"zui:pl-8",sm:"zui:pl-9",md:"zui:pl-10",lg:"zui:pl-11"},m={xs:"zui:pr-8",sm:"zui:pr-9",md:"zui:pr-10",lg:"zui:pr-11"},f=n.forwardRef(function(f,p){var b,x,g=f.label,h=f.floatingLabel,v=void 0!==h&&h,y=f.description,w=f.error,N=f.leftIcon,k=f.rightIcon,I=f.size,C=void 0===I?"md":I,j=f.variant,B=void 0===j?"outlined":j,L=f.className,D=f.allowedPattern,R=f.onBeforeInput,S=f.onChange,E=f.onDebouncedChange,T=f.debounceDelay,q=f.type,F=void 0===q?"text":q,O=f.onLeftIconClick,P=f.onRightIconClick,$=f.wordLimit,A=f.focusOutline,H=void 0===A||A,Z=e(f,["label","floatingLabel","description","error","leftIcon","rightIcon","size","variant","className","allowedPattern","onBeforeInput","onChange","onDebouncedChange","debounceDelay","type","onLeftIconClick","onRightIconClick","wordLimit","focusOutline"]),_={container:(x=Z.disabled||!1)?"zui:opacity-80":"",label:x?"zui:text-gray-500":"zui:text-gray-700",input:x?" zui:cursor-not-allowed zui:opacity-90 zui:text-gray-900 zui:bg-gray-50 zui:border zui:border-gray-300":""},G=r("input"),J=n.useState(!1),K=J[0],M=J[1],Q=n.useState(null!==(b=Z.value)&&void 0!==b?b:""),U=Q[0],V=Q[1],W=n.useRef(null),X="textarea"===F,Y="password"===F,ee=Y&&K?"text":F,ie=X?String(U||"").trim().split(/\s+/).filter(Boolean).length:0;n.useEffect(function(){void 0!==Z.value&&V(Z.value)},[Z.value]),n.useEffect(function(){if(void 0!==T&&E)return W.current&&clearTimeout(W.current),W.current=setTimeout(function(){E(String(U))},T),function(){W.current&&clearTimeout(W.current)}},[U,T,E]);var te=function(e){var i="number"===D?/^[0-9]*$/:"alpha"===D?/^[a-zA-Z]*$/:D instanceof RegExp?D:null;if(i){var t=e.data,u=e.currentTarget.value+t;i.test(u)||e.preventDefault(),null==R||R(e)}},ue=function(e){var i=e.target.value;if($&&X&&i.trim().split(/\s+/).filter(Boolean).length>$)return;V(i),null==S||S(e)},ne=N?d[C]:"",re=k||Y?m[C]:"";return t("div",{className:o("zui:w-full",_.container,L),children:[!v&&g&&t("label",{htmlFor:G,className:o("zui:block zui:mb-2 zui:text-sm zui:font-medium zui:leading-none",_.label),children:[g,Z.required&&u("span",{className:"zui:text-destructive zui:font-medium",children:" *"})]}),t("div",{className:o("zui:relative zui:w-full zui:rounded-sm zui:border zui:bg-background zui:text-sm zui:transition-colors",H&&"zui:focus-within:ring-1 zui:focus-within:ring-ring zui:focus-within:ring-offset-1","outlined"===B&&"zui:border-input","contained"===B&&"zui:bg-muted zui:border-transparent",w&&"zui:border-destructive",w&&H&&"zui:focus-within:ring-destructive",_.input),children:[v&&g&&t("label",{htmlFor:G,className:o("zui:absolute zui:left-3 zui:top-0 zui:-translate-y-1/2 zui:bg-background zui:px-1 zui:text-xs zui:pointer-events-none zui:transition-colors zui:z-10",_.label),children:[g,Z.required&&u("span",{className:"zui:text-destructive zui:font-medium",children:" *"})]}),N&&u("span",{className:o("zui:absolute zui:inset-y-0 zui:left-0 zui:flex zui:items-center zui:text-muted-foreground",c[C]),children:O?u("button",{type:"button",onClick:O,className:"zui:cursor-pointer zui:focus:outline-none",tabIndex:-1,children:N}):N}),X?u("textarea",i({id:G,ref:p,onBeforeInput:te,onChange:ue,value:U,placeholder:Z.placeholder,disabled:Z.disabled,className:o("zui:peer zui:block zui:w-full zui:bg-transparent zui:outline-none zui:px-3 zui:disabled:cursor-not-allowed zui:disabled:opacity-50 zui:resize-none",z[C],ne,re)},Z)):u("input",i({id:G,ref:p,type:ee,onBeforeInput:te,onChange:ue,value:U,placeholder:Z.placeholder,disabled:Z.disabled,className:o("zui:peer zui:block zui:w-full zui:bg-transparent zui:outline-none zui:px-3 zui:disabled:cursor-not-allowed zui:disabled:opacity-50",s[C],z[C],ne,re)},Z)),(k||Y)&&u("span",{className:o("zui:absolute zui:inset-y-0 zui:right-0 zui:flex zui:items-center zui:text-muted-foreground",c[C]),children:Y?u("button",{type:"button",onClick:function(){return M(function(e){return!e})},className:"zui:focus:outline-none",tabIndex:-1,"aria-label":K?"Hide password":"Show password",children:u(K?l:a,{size:16})}):P?u("button",{type:"button",onClick:P,className:"zui:cursor-pointer zui:focus:outline-none",tabIndex:-1,children:k}):k})]}),t("div",{className:"zui:flex zui:flex-row zui:justify-between",children:[y&&!w&&u("p",{className:"zui:text-xs zui:text-muted-foreground",children:y}),w&&u("p",{className:"zui:text-xs zui:text-destructive",children:w}),X&&void 0!==$&&t("div",{className:"zui:mt-1 zui:text-xs zui:text-muted-foreground zui:text-right zui:flex zui:justify-end zui:flex-1",children:[ie,"/",$," words"]})]})]})});export{f as Input,f as default};
1
+ import{_ as e,a as i}from"../../chunks/tslib.es6-4974c96c.esm.js";import{jsxs as t,jsx as u}from"react/jsx-runtime";import*as n from"react";import{u as r,a as o}from"../../chunks/index-32c3a4e2.esm.js";import{E as l,e as a}from"../../chunks/lucide-7e7c48b9.esm.js";var s={xs:"zui:h-8 zui:text-xs",sm:"zui:h-9 zui:text-sm",md:"zui:h-10 zui:text-sm",lg:"zui:h-11 zui:text-base"},z={xs:"zui:py-1.5",sm:"zui:py-2",md:"zui:py-2",lg:"zui:py-2.5"},c={xs:"zui:px-2",sm:"zui:px-2.5",md:"zui:px-3",lg:"zui:px-3.5"},d={xs:"zui:pl-8",sm:"zui:pl-9",md:"zui:pl-10",lg:"zui:pl-11"},m={xs:"zui:pr-8",sm:"zui:pr-9",md:"zui:pr-10",lg:"zui:pr-11"},f=n.forwardRef(function(f,p){var b,x,g=f.label,h=f.floatingLabel,v=void 0!==h&&h,y=f.description,w=f.error,N=f.leftIcon,k=f.rightIcon,I=f.size,C=void 0===I?"md":I,j=f.variant,B=void 0===j?"outlined":j,L=f.className,D=f.allowedPattern,R=f.onBeforeInput,S=f.onChange,E=f.onDebouncedChange,T=f.debounceDelay,q=f.type,F=void 0===q?"text":q,O=f.onLeftIconClick,P=f.onRightIconClick,$=f.wordLimit,A=f.focusOutline,H=void 0===A||A,Z=e(f,["label","floatingLabel","description","error","leftIcon","rightIcon","size","variant","className","allowedPattern","onBeforeInput","onChange","onDebouncedChange","debounceDelay","type","onLeftIconClick","onRightIconClick","wordLimit","focusOutline"]),_={container:(x=Z.disabled||!1)?"zui:opacity-80":"",label:x?"zui:text-gray-500":"zui:text-gray-700",input:x?" zui:cursor-not-allowed zui:opacity-90 zui:text-gray-900 zui:bg-gray-50 zui:border zui:border-gray-300":""},G=r("input"),J=n.useState(!1),K=J[0],M=J[1],Q=n.useState(null!==(b=Z.value)&&void 0!==b?b:""),U=Q[0],V=Q[1],W=n.useRef(null),X="textarea"===F,Y="password"===F,ee=Y&&K?"text":F,ie=X?String(U||"").trim().split(/\s+/).filter(Boolean).length:0;n.useEffect(function(){void 0!==Z.value&&V(Z.value)},[Z.value]),n.useEffect(function(){if(void 0!==T&&E)return W.current&&clearTimeout(W.current),W.current=setTimeout(function(){E(String(U))},T),function(){W.current&&clearTimeout(W.current)}},[U,T,E]);var te=function(e){var i="number"===D?/^[0-9]*$/:"alpha"===D?/^[a-zA-Z]*$/:D instanceof RegExp?D:null;if(i){var t=e.data,u=e.currentTarget.value+t;i.test(u)||e.preventDefault(),null==R||R(e)}},ue=function(e){var i=e.target.value;if($&&X&&i.trim().split(/\s+/).filter(Boolean).length>$)return;V(i),null==S||S(e)},ne=N?d[C]:"",re=k||Y?m[C]:"";return t("div",{className:o("zui:w-full",_.container,L),children:[!v&&g&&t("label",{htmlFor:G,className:o("zui:block zui:mb-2 zui:text-sm zui:font-medium zui:leading-none",_.label),children:[g,Z.required&&u("span",{className:"zui:text-destructive zui:font-medium",children:" *"})]}),t("div",{className:o("zui:relative zui:w-full zui:rounded-sm zui:border zui:bg-background zui:text-sm zui:transition-colors",H&&"zui:focus-within:ring-1 zui:focus-within:ring-ring zui:focus-within:ring-offset-1","outlined"===B&&"zui:border-input","contained"===B&&"zui:bg-muted zui:border-transparent",w&&"zui:border-destructive",w&&H&&"zui:focus-within:ring-destructive",_.input),children:[v&&g&&t("label",{htmlFor:G,className:o("zui:absolute zui:left-3 zui:top-0 zui:-translate-y-1/2 zui:bg-background zui:px-1 zui:text-xs zui:pointer-events-none zui:transition-colors zui:z-10",_.label),children:[g,Z.required&&u("span",{className:"zui:text-destructive zui:font-medium",children:" *"})]}),N&&u("span",{className:o("zui:absolute zui:inset-y-0 zui:left-0 zui:flex zui:items-center zui:text-muted-foreground",c[C]),children:O?u("button",{type:"button",onClick:O,className:"zui:cursor-pointer zui:focus:outline-none",tabIndex:-1,children:N}):N}),X?u("textarea",i({id:G,ref:p,onBeforeInput:te,onChange:ue,value:U,placeholder:Z.placeholder,disabled:Z.disabled,className:o("zui:peer zui:block zui:w-full zui:bg-transparent zui:outline-none zui:px-3 zui:disabled:cursor-not-allowed zui:disabled:opacity-50 zui:resize-none",z[C],ne,re)},Z)):u("input",i({id:G,ref:p,type:ee,onBeforeInput:te,onChange:ue,value:U,placeholder:Z.placeholder,disabled:Z.disabled,className:o("zui:peer zui:block zui:w-full zui:bg-transparent zui:outline-none zui:px-3 zui:disabled:cursor-not-allowed zui:disabled:opacity-50",s[C],z[C],ne,re)},Z)),(k||Y)&&u("span",{className:o("zui:absolute zui:inset-y-0 zui:right-0 zui:flex zui:items-center zui:text-muted-foreground",c[C]),children:Y?u("button",{type:"button",onClick:function(){return M(function(e){return!e})},className:"zui:focus:outline-none",tabIndex:-1,"aria-label":K?"Hide password":"Show password",children:u(K?l:a,{size:16})}):P?u("button",{type:"button",onClick:P,className:"zui:cursor-pointer zui:focus:outline-none",tabIndex:-1,children:k}):k})]}),t("div",{className:"zui:flex zui:flex-row zui:justify-between",children:[y&&!w&&u("p",{className:"zui:text-xs zui:text-muted-foreground",children:y}),w&&u("p",{className:"zui:text-xs zui:text-destructive",children:w}),X&&void 0!==$&&t("div",{className:"zui:mt-1 zui:text-xs zui:text-muted-foreground zui:text-right zui:flex zui:justify-end zui:flex-1",children:[ie,"/",$," words"]})]})]})});export{f as Input,f as default};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../chunks/tslib.es6-a3dc1f53.js"),i=require("react/jsx-runtime"),t=require("react"),u=require("../../chunks/index-90b71f01.js"),n=require("../../chunks/lucide-493ccaad.js");function r(e){var i=Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var u=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(i,t,u.get?u:{enumerable:!0,get:function(){return e[t]}})}}),i.default=e,Object.freeze(i)}var s=r(t),l={xs:"zui:h-8 zui:text-xs",sm:"zui:h-9 zui:text-sm",md:"zui:h-10 zui:text-sm",lg:"zui:h-11 zui:text-base"},o={xs:"zui:py-1.5",sm:"zui:py-2",md:"zui:py-2",lg:"zui:py-2.5"},a={xs:"zui:px-2",sm:"zui:px-2.5",md:"zui:px-3",lg:"zui:px-3.5"},c={xs:"zui:pl-8",sm:"zui:pl-9",md:"zui:pl-10",lg:"zui:pl-11"},d={xs:"zui:pr-8",sm:"zui:pr-9",md:"zui:pr-10",lg:"zui:pr-11"},z=s.forwardRef(function(t,r){var z,f,x=t.label,p=t.floatingLabel,b=void 0!==p&&p,m=t.description,g=t.error,h=t.leftIcon,v=t.rightIcon,y=t.size,j=void 0===y?"md":y,w=t.variant,N=void 0===w?"outlined":w,I=t.className,k=t.allowedPattern,C=t.onBeforeInput,O=t.onChange,_=t.onDebouncedChange,q=t.debounceDelay,B=t.type,D=void 0===B?"text":B,E=t.onLeftIconClick,L=t.onRightIconClick,S=t.wordLimit,P=t.focusOutline,R=void 0===P||P,T=e.__rest(t,["label","floatingLabel","description","error","leftIcon","rightIcon","size","variant","className","allowedPattern","onBeforeInput","onChange","onDebouncedChange","debounceDelay","type","onLeftIconClick","onRightIconClick","wordLimit","focusOutline"]),F={container:(f=T.disabled||!1)?"zui:opacity-80":"",label:f?"zui:text-gray-500":"zui:text-gray-700",input:f?" zui:cursor-not-allowed zui:opacity-90 zui:text-gray-900 zui:bg-gray-50 zui:border zui:border-gray-300":""},$=u.useStableId("input"),A=s.useState(!1),H=A[0],M=A[1],Z=s.useState(null!==(z=T.value)&&void 0!==z?z:""),G=Z[0],J=Z[1],K=s.useRef(null),Q="textarea"===D,U="password"===D,V=U&&H?"text":D,W=Q?String(G||"").trim().split(/\s+/).filter(Boolean).length:0;s.useEffect(function(){void 0!==T.value&&J(T.value)},[T.value]),s.useEffect(function(){if(void 0!==q&&_)return K.current&&clearTimeout(K.current),K.current=setTimeout(function(){_(String(G))},q),function(){K.current&&clearTimeout(K.current)}},[G,q,_]);var X=function(e){var i="number"===k?/^[0-9]*$/:"alpha"===k?/^[a-zA-Z]*$/:k instanceof RegExp?k:null;if(i){var t=e.data,u=e.currentTarget.value+t;i.test(u)||e.preventDefault(),null==C||C(e)}},Y=function(e){var i=e.target.value;if(S&&Q&&i.trim().split(/\s+/).filter(Boolean).length>S)return;J(i),null==O||O(e)},ee=h?c[j]:"",ie=v||U?d[j]:"";return i.jsxs("div",{className:u.cn("zui:w-full",F.container,I),children:[!b&&x&&i.jsxs("label",{htmlFor:$,className:u.cn("zui:block zui:mb-2 zui:text-sm zui:font-medium zui:leading-none",F.label),children:[x,T.required&&i.jsx("span",{className:"zui:text-destructive zui:font-medium",children:" *"})]}),i.jsxs("div",{className:u.cn("zui:relative zui:w-full zui:rounded-sm zui:border zui:bg-background zui:text-sm zui:transition-colors",R&&"zui:focus-within:ring-1 zui:focus-within:ring-ring zui:focus-within:ring-offset-1","outlined"===N&&"zui:border-input","contained"===N&&"zui:bg-muted zui:border-transparent",g&&"zui:border-destructive",g&&R&&"zui:focus-within:ring-destructive",F.input),children:[b&&x&&i.jsxs("label",{htmlFor:$,className:u.cn("zui:absolute zui:left-3 zui:top-0 zui:-translate-y-1/2 zui:bg-background zui:px-1 zui:text-xs zui:pointer-events-none zui:transition-colors zui:z-10",F.label),children:[x,T.required&&i.jsx("span",{className:"zui:text-destructive zui:font-medium",children:" *"})]}),h&&i.jsx("span",{className:u.cn("zui:absolute zui:inset-y-0 zui:left-0 zui:flex zui:items-center zui:text-muted-foreground",a[j]),children:E?i.jsx("button",{type:"button",onClick:E,className:"zui:cursor-pointer zui:focus:outline-none",tabIndex:-1,children:h}):h}),Q?i.jsx("textarea",e.__assign({id:$,ref:r,onBeforeInput:X,onChange:Y,value:G,placeholder:T.placeholder,disabled:T.disabled,className:u.cn("zui:peer zui:block zui:w-full zui:bg-transparent zui:outline-none zui:px-3 zui:disabled:cursor-not-allowed zui:disabled:opacity-50 zui:resize-none",o[j],ee,ie)},T)):i.jsx("input",e.__assign({id:$,ref:r,type:V,onBeforeInput:X,onChange:Y,value:G,placeholder:T.placeholder,disabled:T.disabled,className:u.cn("zui:peer zui:block zui:w-full zui:bg-transparent zui:outline-none zui:px-3 zui:disabled:cursor-not-allowed zui:disabled:opacity-50",l[j],o[j],ee,ie)},T)),(v||U)&&i.jsx("span",{className:u.cn("zui:absolute zui:inset-y-0 zui:right-0 zui:flex zui:items-center zui:text-muted-foreground",a[j]),children:U?i.jsx("button",{type:"button",onClick:function(){return M(function(e){return!e})},className:"zui:focus:outline-none",tabIndex:-1,"aria-label":H?"Hide password":"Show password",children:H?i.jsx(n.Eye,{size:16}):i.jsx(n.EyeOff,{size:16})}):L?i.jsx("button",{type:"button",onClick:L,className:"zui:cursor-pointer zui:focus:outline-none",tabIndex:-1,children:v}):v})]}),i.jsxs("div",{className:"zui:flex zui:flex-row zui:justify-between",children:[m&&!g&&i.jsx("p",{className:"zui:text-xs zui:text-muted-foreground",children:m}),g&&i.jsx("p",{className:"zui:text-xs zui:text-destructive",children:g}),Q&&void 0!==S&&i.jsxs("div",{className:"zui:mt-1 zui:text-xs zui:text-muted-foreground zui:text-right zui:flex zui:justify-end zui:flex-1",children:[W,"/",S," words"]})]})]})});exports.Input=z,exports.default=z;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../chunks/tslib.es6-a3dc1f53.js"),i=require("react/jsx-runtime"),t=require("react"),u=require("../../chunks/index-90b71f01.js"),n=require("../../chunks/lucide-3fef2423.js");function r(e){var i=Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var u=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(i,t,u.get?u:{enumerable:!0,get:function(){return e[t]}})}}),i.default=e,Object.freeze(i)}var s=r(t),l={xs:"zui:h-8 zui:text-xs",sm:"zui:h-9 zui:text-sm",md:"zui:h-10 zui:text-sm",lg:"zui:h-11 zui:text-base"},o={xs:"zui:py-1.5",sm:"zui:py-2",md:"zui:py-2",lg:"zui:py-2.5"},a={xs:"zui:px-2",sm:"zui:px-2.5",md:"zui:px-3",lg:"zui:px-3.5"},c={xs:"zui:pl-8",sm:"zui:pl-9",md:"zui:pl-10",lg:"zui:pl-11"},d={xs:"zui:pr-8",sm:"zui:pr-9",md:"zui:pr-10",lg:"zui:pr-11"},z=s.forwardRef(function(t,r){var z,f,x=t.label,p=t.floatingLabel,b=void 0!==p&&p,m=t.description,g=t.error,h=t.leftIcon,v=t.rightIcon,y=t.size,j=void 0===y?"md":y,w=t.variant,N=void 0===w?"outlined":w,I=t.className,k=t.allowedPattern,C=t.onBeforeInput,O=t.onChange,_=t.onDebouncedChange,q=t.debounceDelay,B=t.type,D=void 0===B?"text":B,E=t.onLeftIconClick,L=t.onRightIconClick,S=t.wordLimit,P=t.focusOutline,R=void 0===P||P,T=e.__rest(t,["label","floatingLabel","description","error","leftIcon","rightIcon","size","variant","className","allowedPattern","onBeforeInput","onChange","onDebouncedChange","debounceDelay","type","onLeftIconClick","onRightIconClick","wordLimit","focusOutline"]),F={container:(f=T.disabled||!1)?"zui:opacity-80":"",label:f?"zui:text-gray-500":"zui:text-gray-700",input:f?" zui:cursor-not-allowed zui:opacity-90 zui:text-gray-900 zui:bg-gray-50 zui:border zui:border-gray-300":""},$=u.useStableId("input"),A=s.useState(!1),H=A[0],M=A[1],Z=s.useState(null!==(z=T.value)&&void 0!==z?z:""),G=Z[0],J=Z[1],K=s.useRef(null),Q="textarea"===D,U="password"===D,V=U&&H?"text":D,W=Q?String(G||"").trim().split(/\s+/).filter(Boolean).length:0;s.useEffect(function(){void 0!==T.value&&J(T.value)},[T.value]),s.useEffect(function(){if(void 0!==q&&_)return K.current&&clearTimeout(K.current),K.current=setTimeout(function(){_(String(G))},q),function(){K.current&&clearTimeout(K.current)}},[G,q,_]);var X=function(e){var i="number"===k?/^[0-9]*$/:"alpha"===k?/^[a-zA-Z]*$/:k instanceof RegExp?k:null;if(i){var t=e.data,u=e.currentTarget.value+t;i.test(u)||e.preventDefault(),null==C||C(e)}},Y=function(e){var i=e.target.value;if(S&&Q&&i.trim().split(/\s+/).filter(Boolean).length>S)return;J(i),null==O||O(e)},ee=h?c[j]:"",ie=v||U?d[j]:"";return i.jsxs("div",{className:u.cn("zui:w-full",F.container,I),children:[!b&&x&&i.jsxs("label",{htmlFor:$,className:u.cn("zui:block zui:mb-2 zui:text-sm zui:font-medium zui:leading-none",F.label),children:[x,T.required&&i.jsx("span",{className:"zui:text-destructive zui:font-medium",children:" *"})]}),i.jsxs("div",{className:u.cn("zui:relative zui:w-full zui:rounded-sm zui:border zui:bg-background zui:text-sm zui:transition-colors",R&&"zui:focus-within:ring-1 zui:focus-within:ring-ring zui:focus-within:ring-offset-1","outlined"===N&&"zui:border-input","contained"===N&&"zui:bg-muted zui:border-transparent",g&&"zui:border-destructive",g&&R&&"zui:focus-within:ring-destructive",F.input),children:[b&&x&&i.jsxs("label",{htmlFor:$,className:u.cn("zui:absolute zui:left-3 zui:top-0 zui:-translate-y-1/2 zui:bg-background zui:px-1 zui:text-xs zui:pointer-events-none zui:transition-colors zui:z-10",F.label),children:[x,T.required&&i.jsx("span",{className:"zui:text-destructive zui:font-medium",children:" *"})]}),h&&i.jsx("span",{className:u.cn("zui:absolute zui:inset-y-0 zui:left-0 zui:flex zui:items-center zui:text-muted-foreground",a[j]),children:E?i.jsx("button",{type:"button",onClick:E,className:"zui:cursor-pointer zui:focus:outline-none",tabIndex:-1,children:h}):h}),Q?i.jsx("textarea",e.__assign({id:$,ref:r,onBeforeInput:X,onChange:Y,value:G,placeholder:T.placeholder,disabled:T.disabled,className:u.cn("zui:peer zui:block zui:w-full zui:bg-transparent zui:outline-none zui:px-3 zui:disabled:cursor-not-allowed zui:disabled:opacity-50 zui:resize-none",o[j],ee,ie)},T)):i.jsx("input",e.__assign({id:$,ref:r,type:V,onBeforeInput:X,onChange:Y,value:G,placeholder:T.placeholder,disabled:T.disabled,className:u.cn("zui:peer zui:block zui:w-full zui:bg-transparent zui:outline-none zui:px-3 zui:disabled:cursor-not-allowed zui:disabled:opacity-50",l[j],o[j],ee,ie)},T)),(v||U)&&i.jsx("span",{className:u.cn("zui:absolute zui:inset-y-0 zui:right-0 zui:flex zui:items-center zui:text-muted-foreground",a[j]),children:U?i.jsx("button",{type:"button",onClick:function(){return M(function(e){return!e})},className:"zui:focus:outline-none",tabIndex:-1,"aria-label":H?"Hide password":"Show password",children:H?i.jsx(n.Eye,{size:16}):i.jsx(n.EyeOff,{size:16})}):L?i.jsx("button",{type:"button",onClick:L,className:"zui:cursor-pointer zui:focus:outline-none",tabIndex:-1,children:v}):v})]}),i.jsxs("div",{className:"zui:flex zui:flex-row zui:justify-between",children:[m&&!g&&i.jsx("p",{className:"zui:text-xs zui:text-muted-foreground",children:m}),g&&i.jsx("p",{className:"zui:text-xs zui:text-destructive",children:g}),Q&&void 0!==S&&i.jsxs("div",{className:"zui:mt-1 zui:text-xs zui:text-muted-foreground zui:text-right zui:flex zui:justify-end zui:flex-1",children:[W,"/",S," words"]})]})]})});exports.Input=z,exports.default=z;
@@ -1 +1 @@
1
- import{a as i}from"../../chunks/tslib.es6-4974c96c.esm.js";import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as o from"react";import{Slide as u,useMediaQuery as s,Dialog as t,IconButton as a,DialogContent as d,DialogActions as l}from"@mui/material";import{a as n}from"../../chunks/index-32c3a4e2.esm.js";import{M as m}from"../../chunks/Muted-d00b328e.esm.js";import{X as c}from"../../chunks/lucide-8c9441ea.esm.js";var z=o.forwardRef(function(r,o){return e(u,i({direction:"up",ref:o},r))}),f=function(i){var o=i.open,u=i.onClose,f=i.title,p=i.description,h=i.children,b=i.actions,x=i.showCloseIcon,v=void 0===x||x,N=i.maxWidth,w=void 0===N?"sm":N,j=i.fullWidth,k=void 0===j||j,y=i.fullScreen,g=void 0!==y&&y,C=i.allowActionBorder,W=void 0===C||C,M=i.className,P=s("(max-width:600px)");return r(t,{open:o,onClose:u,TransitionComponent:z,maxWidth:w,fullWidth:k,fullScreen:P||g,scroll:"body",PaperProps:{className:n("zui:bg-background zui:rounded-sm zui:shadow-lg zui:border zui:border-border",M)},children:[(f||v)&&r("div",{className:"zui:flex zui:items-center zui:justify-between zui:px-4 zui:py-3 zui:border-b zui:border-border",children:[f&&r("div",{className:"zui:p-0 zui:m-0 zui:!text-base zui:font-bold",children:[f,p&&e(m,{component:"div",className:"zui:mt-1.5",children:p})]}),v&&e(a,{onClick:u,size:"small",className:"zui:ml-auto zui:flex zui:text-muted-foreground hover:zui:text-foreground",children:e(c,{className:"zui:w-5 zui:h-5"})})]}),e(d,{className:n("zui:px-5 zui:py-4 zui:overflow-y-auto zui:max-h-[70vh]"),children:h}),b&&e(l,{className:n("zui:px-5 zui:py-3 zui:border-border",W&&"zui:border-t"),children:b})]})};export{f as Modal,f as default};
1
+ import{a as i}from"../../chunks/tslib.es6-4974c96c.esm.js";import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as o from"react";import{Slide as u,useMediaQuery as s,Dialog as t,IconButton as a,DialogContent as d,DialogActions as l}from"@mui/material";import{a as n}from"../../chunks/index-32c3a4e2.esm.js";import{M as m}from"../../chunks/Muted-d00b328e.esm.js";import{X as c}from"../../chunks/lucide-7e7c48b9.esm.js";var z=o.forwardRef(function(r,o){return e(u,i({direction:"up",ref:o},r))}),f=function(i){var o=i.open,u=i.onClose,f=i.title,p=i.description,h=i.children,b=i.actions,x=i.showCloseIcon,v=void 0===x||x,N=i.maxWidth,w=void 0===N?"sm":N,j=i.fullWidth,k=void 0===j||j,y=i.fullScreen,g=void 0!==y&&y,C=i.allowActionBorder,W=void 0===C||C,M=i.className,P=s("(max-width:600px)");return r(t,{open:o,onClose:u,TransitionComponent:z,maxWidth:w,fullWidth:k,fullScreen:P||g,scroll:"body",PaperProps:{className:n("zui:bg-background zui:rounded-sm zui:shadow-lg zui:border zui:border-border",M)},children:[(f||v)&&r("div",{className:"zui:flex zui:items-center zui:justify-between zui:px-4 zui:py-3 zui:border-b zui:border-border",children:[f&&r("div",{className:"zui:p-0 zui:m-0 zui:!text-base zui:font-bold",children:[f,p&&e(m,{component:"div",className:"zui:mt-1.5",children:p})]}),v&&e(a,{onClick:u,size:"small",className:"zui:ml-auto zui:flex zui:text-muted-foreground hover:zui:text-foreground",children:e(c,{className:"zui:w-5 zui:h-5"})})]}),e(d,{className:n("zui:px-5 zui:py-4 zui:overflow-y-auto zui:max-h-[70vh]"),children:h}),b&&e(l,{className:n("zui:px-5 zui:py-3 zui:border-border",W&&"zui:border-t"),children:b})]})};export{f as Modal,f as default};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../chunks/tslib.es6-a3dc1f53.js"),r=require("react/jsx-runtime"),i=require("react"),u=require("@mui/material"),o=require("../../chunks/index-90b71f01.js"),t=require("../../chunks/Muted-d2dbaba3.js"),s=require("../../chunks/lucide-493ccaad.js");function n(e){var r=Object.create(null);return e&&Object.keys(e).forEach(function(i){if("default"!==i){var u=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(r,i,u.get?u:{enumerable:!0,get:function(){return e[i]}})}}),r.default=e,Object.freeze(r)}var l=n(i).forwardRef(function(i,o){return r.jsx(u.Slide,e.__assign({direction:"up",ref:o},i))}),c=function(e){var i=e.open,n=e.onClose,c=e.title,d=e.description,a=e.children,z=e.actions,f=e.showCloseIcon,m=void 0===f||f,x=e.maxWidth,b=void 0===x?"sm":x,h=e.fullWidth,p=void 0===h||h,j=e.fullScreen,v=void 0!==j&&j,g=e.allowActionBorder,y=void 0===g||g,w=e.className,N=u.useMediaQuery("(max-width:600px)");return r.jsxs(u.Dialog,{open:i,onClose:n,TransitionComponent:l,maxWidth:b,fullWidth:p,fullScreen:N||v,scroll:"body",PaperProps:{className:o.cn("zui:bg-background zui:rounded-sm zui:shadow-lg zui:border zui:border-border",w)},children:[(c||m)&&r.jsxs("div",{className:"zui:flex zui:items-center zui:justify-between zui:px-4 zui:py-3 zui:border-b zui:border-border",children:[c&&r.jsxs("div",{className:"zui:p-0 zui:m-0 zui:!text-base zui:font-bold",children:[c,d&&r.jsx(t.Muted,{component:"div",className:"zui:mt-1.5",children:d})]}),m&&r.jsx(u.IconButton,{onClick:n,size:"small",className:"zui:ml-auto zui:flex zui:text-muted-foreground hover:zui:text-foreground",children:r.jsx(s.X,{className:"zui:w-5 zui:h-5"})})]}),r.jsx(u.DialogContent,{className:o.cn("zui:px-5 zui:py-4 zui:overflow-y-auto zui:max-h-[70vh]"),children:a}),z&&r.jsx(u.DialogActions,{className:o.cn("zui:px-5 zui:py-3 zui:border-border",y&&"zui:border-t"),children:z})]})};exports.Modal=c,exports.default=c;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../chunks/tslib.es6-a3dc1f53.js"),r=require("react/jsx-runtime"),i=require("react"),u=require("@mui/material"),o=require("../../chunks/index-90b71f01.js"),t=require("../../chunks/Muted-d2dbaba3.js"),s=require("../../chunks/lucide-3fef2423.js");function n(e){var r=Object.create(null);return e&&Object.keys(e).forEach(function(i){if("default"!==i){var u=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(r,i,u.get?u:{enumerable:!0,get:function(){return e[i]}})}}),r.default=e,Object.freeze(r)}var l=n(i).forwardRef(function(i,o){return r.jsx(u.Slide,e.__assign({direction:"up",ref:o},i))}),c=function(e){var i=e.open,n=e.onClose,c=e.title,d=e.description,a=e.children,z=e.actions,f=e.showCloseIcon,m=void 0===f||f,x=e.maxWidth,b=void 0===x?"sm":x,h=e.fullWidth,p=void 0===h||h,j=e.fullScreen,v=void 0!==j&&j,g=e.allowActionBorder,y=void 0===g||g,w=e.className,N=u.useMediaQuery("(max-width:600px)");return r.jsxs(u.Dialog,{open:i,onClose:n,TransitionComponent:l,maxWidth:b,fullWidth:p,fullScreen:N||v,scroll:"body",PaperProps:{className:o.cn("zui:bg-background zui:rounded-sm zui:shadow-lg zui:border zui:border-border",w)},children:[(c||m)&&r.jsxs("div",{className:"zui:flex zui:items-center zui:justify-between zui:px-4 zui:py-3 zui:border-b zui:border-border",children:[c&&r.jsxs("div",{className:"zui:p-0 zui:m-0 zui:!text-base zui:font-bold",children:[c,d&&r.jsx(t.Muted,{component:"div",className:"zui:mt-1.5",children:d})]}),m&&r.jsx(u.IconButton,{onClick:n,size:"small",className:"zui:ml-auto zui:flex zui:text-muted-foreground hover:zui:text-foreground",children:r.jsx(s.X,{className:"zui:w-5 zui:h-5"})})]}),r.jsx(u.DialogContent,{className:o.cn("zui:px-5 zui:py-4 zui:overflow-y-auto zui:max-h-[70vh]"),children:a}),z&&r.jsx(u.DialogActions,{className:o.cn("zui:px-5 zui:py-3 zui:border-border",y&&"zui:border-t"),children:z})]})};exports.Modal=c,exports.default=c;
@@ -1 +1 @@
1
- import{jsx as e,jsxs as i}from"react/jsx-runtime";import{a as u}from"../../chunks/index-32c3a4e2.esm.js";import{f as r,g as t,T as s,I as z,X as a}from"../../chunks/lucide-8c9441ea.esm.js";import"react";var o={contained:{success:"zui:bg-green-50 zui:text-green-900 zui:border-green-100",error:"zui:bg-red-50 zui:text-red-900 zui:border-red-100",warning:"zui:bg-yellow-50 zui:text-yellow-900 zui:border-yellow-100",info:"zui:bg-blue-50 zui:text-blue-900 zui:border-blue-100"},outlined:{success:"zui:bg-transparent zui:text-green-700 zui:border zui:border-green-700",error:"zui:bg-transparent zui:text-red-700 zui:border zui:border-red-700",warning:"zui:bg-transparent zui:text-yellow-700 zui:border zui:border-yellow-700",info:"zui:bg-transparent zui:text-blue-700 zui:border zui:border-blue-700"}},l={sm:"zui:text-sm zui:px-3 zui:py-2",md:"zui:text-sm zui:px-4 zui:py-3",lg:"zui:text-base zui:px-5 zui:py-4"},n={success:e(r,{className:"zui:h-5 zui:w-5 zui:text-green-600"}),error:e(t,{className:"zui:h-5 zui:w-5 zui:text-red-600"}),warning:e(s,{className:"zui:h-5 zui:w-5 zui:text-yellow-600"}),info:e(z,{className:"zui:h-5 zui:w-5 zui:text-blue-600"})},d=function(r){var t=r.title,s=r.message,z=r.variant,d=void 0===z?"info":z,m=r.size,c=void 0===m?"md":m,b=r.styleType,x=void 0===b?"contained":b,g=r.onClose,p=r.showCloseIcon,f=void 0===p||p,w=r.className;return i("div",{role:"alert",className:u("zui:relative zui:w-full zui:rounded-sm zui:flex zui:items-center zui:gap-3",t&&"zui:items-start",o[x][d],l[c],w),children:[e("div",{className:"zui:pt-0.5",children:n[d]}),i("div",{className:"zui:flex-1",children:[t&&e("p",{className:"zui:font-semibold",children:t}),e("p",{className:"zui:text-sm zui:leading-snug",children:s})]}),f&&e("button",{onClick:g,className:"zui:ml-auto zui:mt-0.5 zui:text-muted-foreground hover:zui:text-foreground",children:e(a,{className:"zui:w-4 zui:h-4"})})]})};export{d as Notice,d as default};
1
+ import{jsx as e,jsxs as i}from"react/jsx-runtime";import{a as u}from"../../chunks/index-32c3a4e2.esm.js";import{f as r,g as t,T as s,I as z,X as a}from"../../chunks/lucide-7e7c48b9.esm.js";import"react";var o={contained:{success:"zui:bg-green-50 zui:text-green-900 zui:border-green-100",error:"zui:bg-red-50 zui:text-red-900 zui:border-red-100",warning:"zui:bg-yellow-50 zui:text-yellow-900 zui:border-yellow-100",info:"zui:bg-blue-50 zui:text-blue-900 zui:border-blue-100"},outlined:{success:"zui:bg-transparent zui:text-green-700 zui:border zui:border-green-700",error:"zui:bg-transparent zui:text-red-700 zui:border zui:border-red-700",warning:"zui:bg-transparent zui:text-yellow-700 zui:border zui:border-yellow-700",info:"zui:bg-transparent zui:text-blue-700 zui:border zui:border-blue-700"}},l={sm:"zui:text-sm zui:px-3 zui:py-2",md:"zui:text-sm zui:px-4 zui:py-3",lg:"zui:text-base zui:px-5 zui:py-4"},n={success:e(r,{className:"zui:h-5 zui:w-5 zui:text-green-600"}),error:e(t,{className:"zui:h-5 zui:w-5 zui:text-red-600"}),warning:e(s,{className:"zui:h-5 zui:w-5 zui:text-yellow-600"}),info:e(z,{className:"zui:h-5 zui:w-5 zui:text-blue-600"})},d=function(r){var t=r.title,s=r.message,z=r.variant,d=void 0===z?"info":z,m=r.size,c=void 0===m?"md":m,b=r.styleType,x=void 0===b?"contained":b,g=r.onClose,p=r.showCloseIcon,f=void 0===p||p,w=r.className;return i("div",{role:"alert",className:u("zui:relative zui:w-full zui:rounded-sm zui:flex zui:items-center zui:gap-3",t&&"zui:items-start",o[x][d],l[c],w),children:[e("div",{className:"zui:pt-0.5",children:n[d]}),i("div",{className:"zui:flex-1",children:[t&&e("p",{className:"zui:font-semibold",children:t}),e("p",{className:"zui:text-sm zui:leading-snug",children:s})]}),f&&e("button",{onClick:g,className:"zui:ml-auto zui:mt-0.5 zui:text-muted-foreground hover:zui:text-foreground",children:e(a,{className:"zui:w-4 zui:h-4"})})]})};export{d as Notice,d as default};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("../../chunks/index-90b71f01.js"),r=require("../../chunks/lucide-493ccaad.js");require("react");var u={contained:{success:"zui:bg-green-50 zui:text-green-900 zui:border-green-100",error:"zui:bg-red-50 zui:text-red-900 zui:border-red-100",warning:"zui:bg-yellow-50 zui:text-yellow-900 zui:border-yellow-100",info:"zui:bg-blue-50 zui:text-blue-900 zui:border-blue-100"},outlined:{success:"zui:bg-transparent zui:text-green-700 zui:border zui:border-green-700",error:"zui:bg-transparent zui:text-red-700 zui:border zui:border-red-700",warning:"zui:bg-transparent zui:text-yellow-700 zui:border zui:border-yellow-700",info:"zui:bg-transparent zui:text-blue-700 zui:border zui:border-blue-700"}},t={sm:"zui:text-sm zui:px-3 zui:py-2",md:"zui:text-sm zui:px-4 zui:py-3",lg:"zui:text-base zui:px-5 zui:py-4"},s={success:e.jsx(r.CircleCheck,{className:"zui:h-5 zui:w-5 zui:text-green-600"}),error:e.jsx(r.CircleAlert,{className:"zui:h-5 zui:w-5 zui:text-red-600"}),warning:e.jsx(r.TriangleAlert,{className:"zui:h-5 zui:w-5 zui:text-yellow-600"}),info:e.jsx(r.Info,{className:"zui:h-5 zui:w-5 zui:text-blue-600"})},z=function(z){var l=z.title,n=z.message,o=z.variant,a=void 0===o?"info":o,d=z.size,c=void 0===d?"md":d,x=z.styleType,b=void 0===x?"contained":x,m=z.onClose,g=z.showCloseIcon,p=void 0===g||g,h=z.className;return e.jsxs("div",{role:"alert",className:i.cn("zui:relative zui:w-full zui:rounded-sm zui:flex zui:items-center zui:gap-3",l&&"zui:items-start",u[b][a],t[c],h),children:[e.jsx("div",{className:"zui:pt-0.5",children:s[a]}),e.jsxs("div",{className:"zui:flex-1",children:[l&&e.jsx("p",{className:"zui:font-semibold",children:l}),e.jsx("p",{className:"zui:text-sm zui:leading-snug",children:n})]}),p&&e.jsx("button",{onClick:m,className:"zui:ml-auto zui:mt-0.5 zui:text-muted-foreground hover:zui:text-foreground",children:e.jsx(r.X,{className:"zui:w-4 zui:h-4"})})]})};exports.Notice=z,exports.default=z;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("../../chunks/index-90b71f01.js"),r=require("../../chunks/lucide-3fef2423.js");require("react");var u={contained:{success:"zui:bg-green-50 zui:text-green-900 zui:border-green-100",error:"zui:bg-red-50 zui:text-red-900 zui:border-red-100",warning:"zui:bg-yellow-50 zui:text-yellow-900 zui:border-yellow-100",info:"zui:bg-blue-50 zui:text-blue-900 zui:border-blue-100"},outlined:{success:"zui:bg-transparent zui:text-green-700 zui:border zui:border-green-700",error:"zui:bg-transparent zui:text-red-700 zui:border zui:border-red-700",warning:"zui:bg-transparent zui:text-yellow-700 zui:border zui:border-yellow-700",info:"zui:bg-transparent zui:text-blue-700 zui:border zui:border-blue-700"}},t={sm:"zui:text-sm zui:px-3 zui:py-2",md:"zui:text-sm zui:px-4 zui:py-3",lg:"zui:text-base zui:px-5 zui:py-4"},s={success:e.jsx(r.CircleCheck,{className:"zui:h-5 zui:w-5 zui:text-green-600"}),error:e.jsx(r.CircleAlert,{className:"zui:h-5 zui:w-5 zui:text-red-600"}),warning:e.jsx(r.TriangleAlert,{className:"zui:h-5 zui:w-5 zui:text-yellow-600"}),info:e.jsx(r.Info,{className:"zui:h-5 zui:w-5 zui:text-blue-600"})},z=function(z){var l=z.title,n=z.message,o=z.variant,a=void 0===o?"info":o,d=z.size,c=void 0===d?"md":d,x=z.styleType,b=void 0===x?"contained":x,m=z.onClose,g=z.showCloseIcon,p=void 0===g||g,h=z.className;return e.jsxs("div",{role:"alert",className:i.cn("zui:relative zui:w-full zui:rounded-sm zui:flex zui:items-center zui:gap-3",l&&"zui:items-start",u[b][a],t[c],h),children:[e.jsx("div",{className:"zui:pt-0.5",children:s[a]}),e.jsxs("div",{className:"zui:flex-1",children:[l&&e.jsx("p",{className:"zui:font-semibold",children:l}),e.jsx("p",{className:"zui:text-sm zui:leading-snug",children:n})]}),p&&e.jsx("button",{onClick:m,className:"zui:ml-auto zui:mt-0.5 zui:text-muted-foreground hover:zui:text-foreground",children:e.jsx(r.X,{className:"zui:w-4 zui:h-4"})})]})};exports.Notice=z,exports.default=z;
@@ -1 +1 @@
1
- import{c as e,d as i}from"../../chunks/tslib.es6-4974c96c.esm.js";import{jsxs as r,jsx as o}from"react/jsx-runtime";import{useCallback as n}from"react";import{Modal as t}from"../Modal/index.esm.js";import{Button as u}from"../Button/index.esm.js";import{a as c}from"../../chunks/index-32c3a4e2.esm.js";import{H as l}from"../../chunks/Heading-cefb898e.esm.js";import{T as a}from"../../chunks/Text-5b99f7f4.esm.js";import"@mui/material";import"../../chunks/Muted-d00b328e.esm.js";import"../../chunks/lucide-8c9441ea.esm.js";var s={default:{iconBg:"zui:bg-blue-50",iconColor:"zui:text-blue-600",confirmBg:"zui:bg-blue-500 hover:zui:bg-blue-600",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-white",cancelText:"zui:text-gray-700"},delete:{iconBg:"zui:bg-red-50",iconColor:"zui:text-red-600",confirmBg:"zui:bg-red-100 hover:zui:bg-red-200",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-red-700",cancelText:"zui:text-gray-700"},save:{iconBg:"zui:bg-green-50",iconColor:"zui:text-green-600",confirmBg:"zui:bg-green-500 hover:zui:bg-green-600",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-white",cancelText:"zui:text-gray-700"},warning:{iconBg:"zui:bg-amber-50",iconColor:"zui:text-amber-600",confirmBg:"zui:bg-amber-500 hover:zui:bg-amber-600",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-white",cancelText:"zui:text-gray-700"},info:{iconBg:"zui:bg-blue-50",iconColor:"zui:text-blue-600",confirmBg:"zui:bg-blue-500 hover:zui:bg-blue-600",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-white",cancelText:"zui:text-gray-700"},success:{iconBg:"zui:bg-green-50",iconColor:"zui:text-green-600",confirmBg:"zui:bg-green-500 hover:zui:bg-green-600",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-white",cancelText:"zui:text-gray-700"},error:{iconBg:"zui:bg-red-50",iconColor:"zui:text-red-600",confirmBg:"zui:bg-red-500 hover:zui:bg-red-600",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-white",cancelText:"zui:text-gray-700"}},z=function(z){var d=z.open,g=z.onClose,m=z.title,h=void 0===m?"Are you sure?":m,v=z.message,x=z.description,f=z.confirmText,b=void 0===f?"Yes, Delete":f,p=z.cancelText,C=void 0===p?"No, Cancel":p,k=z.confirmVariant,y=z.loading,B=void 0!==y&&y,w=z.icon,N=z.maxWidth,j=void 0===N?"sm":N,T=z.fullWidth,L=void 0!==T&&T,M=z.showCloseIcon,W=void 0===M||M,A=z.onConfirm,H=z.onCancel,V=z.children,I=z.className,R=z.actionsClassName,D=z.messageClassName,Y=z.reverseActions,q=void 0!==Y&&Y,E=z.singleAction,F=void 0!==E&&E,G=z.variant,J=void 0===G?"delete":G,K=n(function(){return e(void 0,void 0,void 0,function(){var e;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,A()];case 1:return i.sent(),[3,3];case 2:return e=i.sent(),console.error("Confirm action failed:",e),[3,3];case 3:return[2]}})})},[A]),O=n(function(){null==H||H(),null==g||g()},[H,g]),P=n(function(){B||g()},[B,g]),Q=s[J],S=r("div",{className:c("zui:flex zui:gap-4 zui:justify-center zui:w-full zui:mt-8 zui:px-6",q&&"zui:flex-row-reverse",R),children:[!F&&o(u,{size:"small",onClick:O,disabled:B,className:c(Q.cancelBg,Q.cancelText),children:C}),o(u,{onClick:K,disabled:B,loading:B,className:c("outlined"===k?"zui:border-2 zui:border-current zui:bg-transparent":Q.confirmBg,"text"===k?"zui:bg-transparent":"",Q.confirmText),children:b})]});return r(t,{open:d,onClose:P,maxWidth:j,fullWidth:L,showCloseIcon:!1,className:c("zui:p-0 zui:m-0 zui:relative",I),children:[W&&o("button",{onClick:P,disabled:B,className:"zui:absolute zui:top-2 zui:right-2 zui:w-8 zui:h-8 zui:bg-gray-100 zui:rounded-full zui:flex zui:items-center zui:justify-center zui:text-gray-500 hover:zui:text-gray-700 hover:zui:bg-gray-200 zui:transition-all zui:duration-200 zui:border-0 zui:cursor-pointer zui:z-10",children:o("svg",{className:"zui:w-4 zui:h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),r("div",{className:"zui:text-center zui:p-1",children:[o("div",w?{className:"zui:flex zui:justify-center zui:mb-6",children:w}:{className:"zui:flex zui:justify-center zui:mb-6",children:r("div",{className:c("zui:w-12 zui:h-12 zui:rounded-full zui:flex zui:items-center zui:justify-center",Q.iconBg),children:["delete"===J&&o("svg",{className:c("zui:w-8 zui:h-8",Q.iconColor),fill:"currentColor",viewBox:"0 0 24 24",children:o("path",{fillRule:"evenodd",d:"M16.5 4.478v.227a48.816 48.816 0 013.878.512.75.75 0 11-.256 1.478l-.209-.035-1.005 13.07a3 3 0 01-2.991 2.77H8.084a3 3 0 01-2.991-2.77L4.087 6.66l-.209.035a.75.75 0 01-.256-1.478A48.567 48.567 0 017.5 4.705v-.227c0-1.564 1.213-2.9 2.816-2.951a52.662 52.662 0 013.369 0c1.603.051 2.815 1.387 2.815 2.951zm-6.136-1.452a51.196 51.196 0 013.273 0C14.39 3.05 15 3.684 15 4.478v.113a49.488 49.488 0 00-6 0v-.113c0-.794.609-1.428 1.364-1.452zm-.355 5.945a.75.75 0 10-1.5.058l.347 9a.75.75 0 101.499-.058l-.346-9zm5.48.058a.75.75 0 00-1.498-.058l-.347 9a.75.75 0 001.5.058l.345-9z",clipRule:"evenodd"})}),"save"===J&&o("svg",{className:c("zui:w-8 zui:h-8",Q.iconColor),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4"})}),"warning"===J&&o("svg",{className:c("zui:w-8 zui:h-8",Q.iconColor),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})}),("info"===J||"default"===J)&&o("svg",{className:c("zui:w-8 zui:h-8",Q.iconColor),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),"success"===J&&o("svg",{className:c("zui:w-8 zui:h-8",Q.iconColor),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),"error"===J&&o("svg",{className:c("zui:w-8 zui:h-8",Q.iconColor),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})})]})}),o(l,{level:5,children:h}),o(a,{size:"sm",className:D,children:v}),x&&o(a,{className:"zui:text-sm zui:text-gray-500 zui:mt-1",children:x}),V&&o("div",{className:"zui:mt-6",children:V}),S]})]})};export{z as PopupConfirm,z as default};
1
+ import{c as e,d as i}from"../../chunks/tslib.es6-4974c96c.esm.js";import{jsxs as r,jsx as o}from"react/jsx-runtime";import{useCallback as n}from"react";import{Modal as t}from"../Modal/index.esm.js";import{Button as u}from"../Button/index.esm.js";import{a as c}from"../../chunks/index-32c3a4e2.esm.js";import{H as l}from"../../chunks/Heading-cefb898e.esm.js";import{T as a}from"../../chunks/Text-5b99f7f4.esm.js";import"@mui/material";import"../../chunks/Muted-d00b328e.esm.js";import"../../chunks/lucide-7e7c48b9.esm.js";var s={default:{iconBg:"zui:bg-blue-50",iconColor:"zui:text-blue-600",confirmBg:"zui:bg-blue-500 hover:zui:bg-blue-600",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-white",cancelText:"zui:text-gray-700"},delete:{iconBg:"zui:bg-red-50",iconColor:"zui:text-red-600",confirmBg:"zui:bg-red-100 hover:zui:bg-red-200",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-red-700",cancelText:"zui:text-gray-700"},save:{iconBg:"zui:bg-green-50",iconColor:"zui:text-green-600",confirmBg:"zui:bg-green-500 hover:zui:bg-green-600",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-white",cancelText:"zui:text-gray-700"},warning:{iconBg:"zui:bg-amber-50",iconColor:"zui:text-amber-600",confirmBg:"zui:bg-amber-500 hover:zui:bg-amber-600",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-white",cancelText:"zui:text-gray-700"},info:{iconBg:"zui:bg-blue-50",iconColor:"zui:text-blue-600",confirmBg:"zui:bg-blue-500 hover:zui:bg-blue-600",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-white",cancelText:"zui:text-gray-700"},success:{iconBg:"zui:bg-green-50",iconColor:"zui:text-green-600",confirmBg:"zui:bg-green-500 hover:zui:bg-green-600",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-white",cancelText:"zui:text-gray-700"},error:{iconBg:"zui:bg-red-50",iconColor:"zui:text-red-600",confirmBg:"zui:bg-red-500 hover:zui:bg-red-600",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-white",cancelText:"zui:text-gray-700"}},z=function(z){var d=z.open,g=z.onClose,m=z.title,h=void 0===m?"Are you sure?":m,v=z.message,x=z.description,f=z.confirmText,b=void 0===f?"Yes, Delete":f,p=z.cancelText,C=void 0===p?"No, Cancel":p,k=z.confirmVariant,y=z.loading,B=void 0!==y&&y,w=z.icon,N=z.maxWidth,j=void 0===N?"sm":N,T=z.fullWidth,L=void 0!==T&&T,M=z.showCloseIcon,W=void 0===M||M,A=z.onConfirm,H=z.onCancel,V=z.children,I=z.className,R=z.actionsClassName,D=z.messageClassName,Y=z.reverseActions,q=void 0!==Y&&Y,E=z.singleAction,F=void 0!==E&&E,G=z.variant,J=void 0===G?"delete":G,K=n(function(){return e(void 0,void 0,void 0,function(){var e;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,A()];case 1:return i.sent(),[3,3];case 2:return e=i.sent(),console.error("Confirm action failed:",e),[3,3];case 3:return[2]}})})},[A]),O=n(function(){null==H||H(),null==g||g()},[H,g]),P=n(function(){B||g()},[B,g]),Q=s[J],S=r("div",{className:c("zui:flex zui:gap-4 zui:justify-center zui:w-full zui:mt-8 zui:px-6",q&&"zui:flex-row-reverse",R),children:[!F&&o(u,{size:"small",onClick:O,disabled:B,className:c(Q.cancelBg,Q.cancelText),children:C}),o(u,{onClick:K,disabled:B,loading:B,className:c("outlined"===k?"zui:border-2 zui:border-current zui:bg-transparent":Q.confirmBg,"text"===k?"zui:bg-transparent":"",Q.confirmText),children:b})]});return r(t,{open:d,onClose:P,maxWidth:j,fullWidth:L,showCloseIcon:!1,className:c("zui:p-0 zui:m-0 zui:relative",I),children:[W&&o("button",{onClick:P,disabled:B,className:"zui:absolute zui:top-2 zui:right-2 zui:w-8 zui:h-8 zui:bg-gray-100 zui:rounded-full zui:flex zui:items-center zui:justify-center zui:text-gray-500 hover:zui:text-gray-700 hover:zui:bg-gray-200 zui:transition-all zui:duration-200 zui:border-0 zui:cursor-pointer zui:z-10",children:o("svg",{className:"zui:w-4 zui:h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),r("div",{className:"zui:text-center zui:p-1",children:[o("div",w?{className:"zui:flex zui:justify-center zui:mb-6",children:w}:{className:"zui:flex zui:justify-center zui:mb-6",children:r("div",{className:c("zui:w-12 zui:h-12 zui:rounded-full zui:flex zui:items-center zui:justify-center",Q.iconBg),children:["delete"===J&&o("svg",{className:c("zui:w-8 zui:h-8",Q.iconColor),fill:"currentColor",viewBox:"0 0 24 24",children:o("path",{fillRule:"evenodd",d:"M16.5 4.478v.227a48.816 48.816 0 013.878.512.75.75 0 11-.256 1.478l-.209-.035-1.005 13.07a3 3 0 01-2.991 2.77H8.084a3 3 0 01-2.991-2.77L4.087 6.66l-.209.035a.75.75 0 01-.256-1.478A48.567 48.567 0 017.5 4.705v-.227c0-1.564 1.213-2.9 2.816-2.951a52.662 52.662 0 013.369 0c1.603.051 2.815 1.387 2.815 2.951zm-6.136-1.452a51.196 51.196 0 013.273 0C14.39 3.05 15 3.684 15 4.478v.113a49.488 49.488 0 00-6 0v-.113c0-.794.609-1.428 1.364-1.452zm-.355 5.945a.75.75 0 10-1.5.058l.347 9a.75.75 0 101.499-.058l-.346-9zm5.48.058a.75.75 0 00-1.498-.058l-.347 9a.75.75 0 001.5.058l.345-9z",clipRule:"evenodd"})}),"save"===J&&o("svg",{className:c("zui:w-8 zui:h-8",Q.iconColor),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4"})}),"warning"===J&&o("svg",{className:c("zui:w-8 zui:h-8",Q.iconColor),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})}),("info"===J||"default"===J)&&o("svg",{className:c("zui:w-8 zui:h-8",Q.iconColor),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),"success"===J&&o("svg",{className:c("zui:w-8 zui:h-8",Q.iconColor),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),"error"===J&&o("svg",{className:c("zui:w-8 zui:h-8",Q.iconColor),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})})]})}),o(l,{level:5,children:h}),o(a,{size:"sm",className:D,children:v}),x&&o(a,{className:"zui:text-sm zui:text-gray-500 zui:mt-1",children:x}),V&&o("div",{className:"zui:mt-6",children:V}),S]})]})};export{z as PopupConfirm,z as default};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../chunks/tslib.es6-a3dc1f53.js"),i=require("react/jsx-runtime"),r=require("react"),n=require("../Modal/index.js"),o=require("../Button/index.js"),u=require("../../chunks/index-90b71f01.js"),t=require("../../chunks/Heading-ff5c771d.js"),c=require("../../chunks/Text-e9636dd7.js");require("@mui/material"),require("../../chunks/Muted-d2dbaba3.js"),require("../../chunks/lucide-493ccaad.js");var l={default:{iconBg:"zui:bg-blue-50",iconColor:"zui:text-blue-600",confirmBg:"zui:bg-blue-500 hover:zui:bg-blue-600",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-white",cancelText:"zui:text-gray-700"},delete:{iconBg:"zui:bg-red-50",iconColor:"zui:text-red-600",confirmBg:"zui:bg-red-100 hover:zui:bg-red-200",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-red-700",cancelText:"zui:text-gray-700"},save:{iconBg:"zui:bg-green-50",iconColor:"zui:text-green-600",confirmBg:"zui:bg-green-500 hover:zui:bg-green-600",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-white",cancelText:"zui:text-gray-700"},warning:{iconBg:"zui:bg-amber-50",iconColor:"zui:text-amber-600",confirmBg:"zui:bg-amber-500 hover:zui:bg-amber-600",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-white",cancelText:"zui:text-gray-700"},info:{iconBg:"zui:bg-blue-50",iconColor:"zui:text-blue-600",confirmBg:"zui:bg-blue-500 hover:zui:bg-blue-600",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-white",cancelText:"zui:text-gray-700"},success:{iconBg:"zui:bg-green-50",iconColor:"zui:text-green-600",confirmBg:"zui:bg-green-500 hover:zui:bg-green-600",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-white",cancelText:"zui:text-gray-700"},error:{iconBg:"zui:bg-red-50",iconColor:"zui:text-red-600",confirmBg:"zui:bg-red-500 hover:zui:bg-red-600",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-white",cancelText:"zui:text-gray-700"}},s=function(s){var a=s.open,z=s.onClose,d=s.title,g=void 0===d?"Are you sure?":d,x=s.message,h=s.description,m=s.confirmText,v=void 0===m?"Yes, Delete":m,b=s.cancelText,f=void 0===b?"No, Cancel":b,j=s.confirmVariant,C=s.loading,k=void 0!==C&&C,y=s.icon,B=s.maxWidth,p=void 0===B?"sm":B,w=s.fullWidth,N=void 0!==w&&w,T=s.showCloseIcon,L=void 0===T||T,M=s.onConfirm,q=s.onCancel,W=s.children,_=s.className,A=s.actionsClassName,H=s.messageClassName,V=s.reverseActions,I=void 0!==V&&V,P=s.singleAction,R=void 0!==P&&P,D=s.variant,O=void 0===D?"delete":D,Y=r.useCallback(function(){return e.__awaiter(void 0,void 0,void 0,function(){var i;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,M()];case 1:return e.sent(),[3,3];case 2:return i=e.sent(),console.error("Confirm action failed:",i),[3,3];case 3:return[2]}})})},[M]),E=r.useCallback(function(){null==q||q(),null==z||z()},[q,z]),F=r.useCallback(function(){k||z()},[k,z]),G=l[O],J=i.jsxs("div",{className:u.cn("zui:flex zui:gap-4 zui:justify-center zui:w-full zui:mt-8 zui:px-6",I&&"zui:flex-row-reverse",A),children:[!R&&i.jsx(o.Button,{size:"small",onClick:E,disabled:k,className:u.cn(G.cancelBg,G.cancelText),children:f}),i.jsx(o.Button,{onClick:Y,disabled:k,loading:k,className:u.cn("outlined"===j?"zui:border-2 zui:border-current zui:bg-transparent":G.confirmBg,"text"===j?"zui:bg-transparent":"",G.confirmText),children:v})]});return i.jsxs(n.Modal,{open:a,onClose:F,maxWidth:p,fullWidth:N,showCloseIcon:!1,className:u.cn("zui:p-0 zui:m-0 zui:relative",_),children:[L&&i.jsx("button",{onClick:F,disabled:k,className:"zui:absolute zui:top-2 zui:right-2 zui:w-8 zui:h-8 zui:bg-gray-100 zui:rounded-full zui:flex zui:items-center zui:justify-center zui:text-gray-500 hover:zui:text-gray-700 hover:zui:bg-gray-200 zui:transition-all zui:duration-200 zui:border-0 zui:cursor-pointer zui:z-10",children:i.jsx("svg",{className:"zui:w-4 zui:h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),i.jsxs("div",{className:"zui:text-center zui:p-1",children:[y?i.jsx("div",{className:"zui:flex zui:justify-center zui:mb-6",children:y}):i.jsx("div",{className:"zui:flex zui:justify-center zui:mb-6",children:i.jsxs("div",{className:u.cn("zui:w-12 zui:h-12 zui:rounded-full zui:flex zui:items-center zui:justify-center",G.iconBg),children:["delete"===O&&i.jsx("svg",{className:u.cn("zui:w-8 zui:h-8",G.iconColor),fill:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{fillRule:"evenodd",d:"M16.5 4.478v.227a48.816 48.816 0 013.878.512.75.75 0 11-.256 1.478l-.209-.035-1.005 13.07a3 3 0 01-2.991 2.77H8.084a3 3 0 01-2.991-2.77L4.087 6.66l-.209.035a.75.75 0 01-.256-1.478A48.567 48.567 0 017.5 4.705v-.227c0-1.564 1.213-2.9 2.816-2.951a52.662 52.662 0 013.369 0c1.603.051 2.815 1.387 2.815 2.951zm-6.136-1.452a51.196 51.196 0 013.273 0C14.39 3.05 15 3.684 15 4.478v.113a49.488 49.488 0 00-6 0v-.113c0-.794.609-1.428 1.364-1.452zm-.355 5.945a.75.75 0 10-1.5.058l.347 9a.75.75 0 101.499-.058l-.346-9zm5.48.058a.75.75 0 00-1.498-.058l-.347 9a.75.75 0 001.5.058l.345-9z",clipRule:"evenodd"})}),"save"===O&&i.jsx("svg",{className:u.cn("zui:w-8 zui:h-8",G.iconColor),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4"})}),"warning"===O&&i.jsx("svg",{className:u.cn("zui:w-8 zui:h-8",G.iconColor),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})}),("info"===O||"default"===O)&&i.jsx("svg",{className:u.cn("zui:w-8 zui:h-8",G.iconColor),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),"success"===O&&i.jsx("svg",{className:u.cn("zui:w-8 zui:h-8",G.iconColor),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),"error"===O&&i.jsx("svg",{className:u.cn("zui:w-8 zui:h-8",G.iconColor),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})})]})}),i.jsx(t.Heading,{level:5,children:g}),i.jsx(c.Text,{size:"sm",className:H,children:x}),h&&i.jsx(c.Text,{className:"zui:text-sm zui:text-gray-500 zui:mt-1",children:h}),W&&i.jsx("div",{className:"zui:mt-6",children:W}),J]})]})};exports.PopupConfirm=s,exports.default=s;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../chunks/tslib.es6-a3dc1f53.js"),i=require("react/jsx-runtime"),r=require("react"),n=require("../Modal/index.js"),o=require("../Button/index.js"),u=require("../../chunks/index-90b71f01.js"),t=require("../../chunks/Heading-ff5c771d.js"),c=require("../../chunks/Text-e9636dd7.js");require("@mui/material"),require("../../chunks/Muted-d2dbaba3.js"),require("../../chunks/lucide-3fef2423.js");var l={default:{iconBg:"zui:bg-blue-50",iconColor:"zui:text-blue-600",confirmBg:"zui:bg-blue-500 hover:zui:bg-blue-600",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-white",cancelText:"zui:text-gray-700"},delete:{iconBg:"zui:bg-red-50",iconColor:"zui:text-red-600",confirmBg:"zui:bg-red-100 hover:zui:bg-red-200",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-red-700",cancelText:"zui:text-gray-700"},save:{iconBg:"zui:bg-green-50",iconColor:"zui:text-green-600",confirmBg:"zui:bg-green-500 hover:zui:bg-green-600",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-white",cancelText:"zui:text-gray-700"},warning:{iconBg:"zui:bg-amber-50",iconColor:"zui:text-amber-600",confirmBg:"zui:bg-amber-500 hover:zui:bg-amber-600",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-white",cancelText:"zui:text-gray-700"},info:{iconBg:"zui:bg-blue-50",iconColor:"zui:text-blue-600",confirmBg:"zui:bg-blue-500 hover:zui:bg-blue-600",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-white",cancelText:"zui:text-gray-700"},success:{iconBg:"zui:bg-green-50",iconColor:"zui:text-green-600",confirmBg:"zui:bg-green-500 hover:zui:bg-green-600",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-white",cancelText:"zui:text-gray-700"},error:{iconBg:"zui:bg-red-50",iconColor:"zui:text-red-600",confirmBg:"zui:bg-red-500 hover:zui:bg-red-600",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-white",cancelText:"zui:text-gray-700"}},s=function(s){var a=s.open,z=s.onClose,d=s.title,g=void 0===d?"Are you sure?":d,x=s.message,h=s.description,m=s.confirmText,v=void 0===m?"Yes, Delete":m,b=s.cancelText,f=void 0===b?"No, Cancel":b,j=s.confirmVariant,C=s.loading,k=void 0!==C&&C,y=s.icon,B=s.maxWidth,p=void 0===B?"sm":B,w=s.fullWidth,N=void 0!==w&&w,T=s.showCloseIcon,L=void 0===T||T,M=s.onConfirm,q=s.onCancel,W=s.children,_=s.className,A=s.actionsClassName,H=s.messageClassName,V=s.reverseActions,I=void 0!==V&&V,P=s.singleAction,R=void 0!==P&&P,D=s.variant,O=void 0===D?"delete":D,Y=r.useCallback(function(){return e.__awaiter(void 0,void 0,void 0,function(){var i;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,M()];case 1:return e.sent(),[3,3];case 2:return i=e.sent(),console.error("Confirm action failed:",i),[3,3];case 3:return[2]}})})},[M]),E=r.useCallback(function(){null==q||q(),null==z||z()},[q,z]),F=r.useCallback(function(){k||z()},[k,z]),G=l[O],J=i.jsxs("div",{className:u.cn("zui:flex zui:gap-4 zui:justify-center zui:w-full zui:mt-8 zui:px-6",I&&"zui:flex-row-reverse",A),children:[!R&&i.jsx(o.Button,{size:"small",onClick:E,disabled:k,className:u.cn(G.cancelBg,G.cancelText),children:f}),i.jsx(o.Button,{onClick:Y,disabled:k,loading:k,className:u.cn("outlined"===j?"zui:border-2 zui:border-current zui:bg-transparent":G.confirmBg,"text"===j?"zui:bg-transparent":"",G.confirmText),children:v})]});return i.jsxs(n.Modal,{open:a,onClose:F,maxWidth:p,fullWidth:N,showCloseIcon:!1,className:u.cn("zui:p-0 zui:m-0 zui:relative",_),children:[L&&i.jsx("button",{onClick:F,disabled:k,className:"zui:absolute zui:top-2 zui:right-2 zui:w-8 zui:h-8 zui:bg-gray-100 zui:rounded-full zui:flex zui:items-center zui:justify-center zui:text-gray-500 hover:zui:text-gray-700 hover:zui:bg-gray-200 zui:transition-all zui:duration-200 zui:border-0 zui:cursor-pointer zui:z-10",children:i.jsx("svg",{className:"zui:w-4 zui:h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),i.jsxs("div",{className:"zui:text-center zui:p-1",children:[y?i.jsx("div",{className:"zui:flex zui:justify-center zui:mb-6",children:y}):i.jsx("div",{className:"zui:flex zui:justify-center zui:mb-6",children:i.jsxs("div",{className:u.cn("zui:w-12 zui:h-12 zui:rounded-full zui:flex zui:items-center zui:justify-center",G.iconBg),children:["delete"===O&&i.jsx("svg",{className:u.cn("zui:w-8 zui:h-8",G.iconColor),fill:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{fillRule:"evenodd",d:"M16.5 4.478v.227a48.816 48.816 0 013.878.512.75.75 0 11-.256 1.478l-.209-.035-1.005 13.07a3 3 0 01-2.991 2.77H8.084a3 3 0 01-2.991-2.77L4.087 6.66l-.209.035a.75.75 0 01-.256-1.478A48.567 48.567 0 017.5 4.705v-.227c0-1.564 1.213-2.9 2.816-2.951a52.662 52.662 0 013.369 0c1.603.051 2.815 1.387 2.815 2.951zm-6.136-1.452a51.196 51.196 0 013.273 0C14.39 3.05 15 3.684 15 4.478v.113a49.488 49.488 0 00-6 0v-.113c0-.794.609-1.428 1.364-1.452zm-.355 5.945a.75.75 0 10-1.5.058l.347 9a.75.75 0 101.499-.058l-.346-9zm5.48.058a.75.75 0 00-1.498-.058l-.347 9a.75.75 0 001.5.058l.345-9z",clipRule:"evenodd"})}),"save"===O&&i.jsx("svg",{className:u.cn("zui:w-8 zui:h-8",G.iconColor),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4"})}),"warning"===O&&i.jsx("svg",{className:u.cn("zui:w-8 zui:h-8",G.iconColor),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})}),("info"===O||"default"===O)&&i.jsx("svg",{className:u.cn("zui:w-8 zui:h-8",G.iconColor),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),"success"===O&&i.jsx("svg",{className:u.cn("zui:w-8 zui:h-8",G.iconColor),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),"error"===O&&i.jsx("svg",{className:u.cn("zui:w-8 zui:h-8",G.iconColor),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})})]})}),i.jsx(t.Heading,{level:5,children:g}),i.jsx(c.Text,{size:"sm",className:H,children:x}),h&&i.jsx(c.Text,{className:"zui:text-sm zui:text-gray-500 zui:mt-1",children:h}),W&&i.jsx("div",{className:"zui:mt-6",children:W}),J]})]})};exports.PopupConfirm=s,exports.default=s;