@artibet/react-mui-components 3.7.3 → 3.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import e from"react";import{Alert as r}from"@mui/material";import{usePage as t}from"@inertiajs/react";var n=function(t){var n=t.errors,m=t.marginBottom,o=void 0===m?3:m;return 0===Object.keys(n).length?null:e.createElement(e.Fragment,null,Object.keys(n).map((function(t,m){return e.createElement(r,{sx:{marginBottom:o},key:m,severity:"error"},n[t])})))},m=function(){var m=t().props,o=m.flash,a=m.errors;return e.createElement(e.Fragment,null,e.createElement(n,{errors:a}),Object.keys(o).map((function(t,n){return o[t]?e.createElement(r,{sx:{marginBottom:3},key:n,severity:t},o[t]):null})))};export{m as FlashMessages};
1
+ import r,{useState as t,useEffect as e}from"react";import{Alert as n,Snackbar as o,Slide as a,Box as i,Typography as l}from"@mui/material";import{usePage as c}from"@inertiajs/react";var u=function(t){var e=t.errors,o=t.marginBottom,a=void 0===o?3:o;return 0===Object.keys(e).length?null:r.createElement(r.Fragment,null,Object.keys(e).map((function(t,o){return r.createElement(n,{sx:{marginBottom:a},key:o,severity:"error"},e[t])})))},s=function(){var t=c().props,e=t.flash,o=t.errors;return r.createElement(r.Fragment,null,r.createElement(u,{errors:o}),Object.keys(e).map((function(t,o){return e[t]?r.createElement(n,{sx:{marginBottom:3},key:o,severity:t},e[t]):null})))};function f(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=Array(t);e<t;e++)n[e]=r[e];return n}function m(){return m=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},m.apply(null,arguments)}function p(r,t){return function(r){if(Array.isArray(r))return r}(r)||function(r,t){var e=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=e){var n,o,a,i,l=[],c=!0,u=!1;try{if(a=(e=e.call(r)).next,0===t);else for(;!(c=(n=a.call(e)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(r){u=!0,o=r}finally{try{if(!c&&null!=e.return&&(i=e.return(),Object(i)!==i))return}finally{if(u)throw o}}return l}}(r,t)||function(r,t){if(r){if("string"==typeof r)return f(r,t);var e={}.toString.call(r).slice(8,-1);return"Object"===e&&r.constructor&&(e=r.constructor.name),"Map"===e||"Set"===e?Array.from(r):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?f(r,t):void 0}}(r,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var d=function(u){var s=u.defaultDirection,f=void 0===s?"left":s,d=c().props.flash,y=p(t(!1),2),v=y[0],b=y[1],g=p(t(""),2),h=g[0],x=g[1],E=p(t("success"),2),w=E[0],j=E[1],O=p(t(f),2),k=O[0],A=O[1];e((function(){var r=d.success?"success":d.error?"error":d.warning?"warning":d.info?"info":null;r&&d[r]&&(A("error"===r?"down":"left"),x(d[r]),j(r),b(!0))}),[d]);var S=function(r,t){"clickaway"!==t&&b(!1)};return r.createElement(o,{open:v,autoHideDuration:5e3,onClose:S,anchorOrigin:{vertical:"top",horizontal:"right"},slots:{transition:function(t){return r.createElement(a,m({},t,{direction:k}))}},slotProps:{root:{sx:{mt:"down"===k?0:6}}}},r.createElement(n,{onClose:S,severity:w,variant:"filled",sx:{width:"100%",minWidth:"320px",borderRadius:"16px",backdropFilter:"blur(12px)",backgroundColor:function(r){return"".concat(r.palette[w].main,"E6")},boxShadow:function(r){return"0 12px 32px ".concat(r.palette[w].main,"33")},border:"1px solid rgba(255,255,255,0.1)"}},r.createElement(i,null,r.createElement(l,{variant:"body2",sx:{fontWeight:500}},h))))};export{s as FlashMessages,d as ToastMessages};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artibet/react-mui-components",
3
- "version": "3.7.3",
3
+ "version": "3.7.4",
4
4
  "description": "Various react components build with mui library",
5
5
  "main": "./core/index.js",
6
6
  "scripts": {