letalkui 0.0.13 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -28,4 +28,4 @@ type JsonViewProps = Overwrite<IAceEditorProps, {
28
28
  }>;
29
29
  declare const JsonView: React.FC<JsonViewProps>;
30
30
 
31
- export { Button, JsonEditor, JsonView };
31
+ export { Button, type ButtonProps, JsonEditor, JsonView };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var W=Object.create;var m=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var Q=Object.getPrototypeOf,X=Object.prototype.hasOwnProperty;var Y=(o,t)=>{for(var r in t)m(o,r,{get:t[r],enumerable:!0})},C=(o,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of K(t))!X.call(o,e)&&e!==r&&m(o,e,{get:()=>t[e],enumerable:!(n=q(t,e))||n.enumerable});return o};var Z=(o,t,r)=>(r=o!=null?W(Q(o)):{},C(t||!o||!o.__esModule?m(r,"default",{value:o,enumerable:!0}):r,o)),j=o=>C(m({},"__esModule",{value:!0}),o);var ro={};Y(ro,{Button:()=>R,JsonEditor:()=>k,JsonView:()=>G});module.exports=j(ro);var A=require("react/jsx-runtime"),R=o=>{let{backgroundColor:t,label:r,size:n,primary:e}=o,i=e?"storybook-button--primary":"storybook-button--secondary";return(0,A.jsx)("button",{type:"button",className:["storybook-button",`storybook-button--${n}`,i].join(""),style:{backgroundColor:t},...o,children:r})};var b=require("react");var x=require("@mui/material"),E=require("react/jsx-runtime"),w=o=>(0,E.jsx)(x.Grid2,{container:!0,direction:"column",spacing:2,children:o.children});var f=require("@mui/material"),g=require("react/jsx-runtime"),S=o=>{let{onSave:t,loading:r}=o;return(0,g.jsx)(f.Button,{onClick:()=>{t()},color:"primary",variant:"contained",disableElevation:!0,disabled:r,endIcon:r&&(0,g.jsx)(f.CircularProgress,{size:20,color:"inherit"}),children:"Salvar"})};var y=require("@mui/material"),J=require("react/jsx-runtime"),T=o=>(0,J.jsx)(y.Grid2,{container:!0,justify:"flex-end",children:(0,J.jsx)(y.Grid2,{item:!0,children:o.children})});var B=Z(require("react-ace")),u=require("@mui/material"),c=require("react/jsx-runtime"),oo="json-editor",F=o=>{let{value:t,onChange:r,currentError:n,currentHelperText:e,...i}=o,s=JSON.stringify(t,null,2);return(0,c.jsxs)(u.Grid2,{children:[(0,c.jsx)(u.FormControl,{error:n,fullWidth:!0,children:(0,c.jsx)(B.default,{...i,name:oo,value:s,wrapEnabled:!0,mode:"json",theme:"textmate",onChange:r,fontSize:16,showPrintMargin:!0,showGutter:!0,highlightActiveLine:!0,editorProps:{$blockScrolling:!0},setOptions:{showLineNumbers:!0,tabSize:2}})}),e&&(0,c.jsx)(u.FormHelperText,{error:n,children:e})]})};var a={Root:w,ActionButton:S,ActionsButtons:T,Content:F};var N=require("react"),to=()=>{let[o,t]=(0,N.useState)({});return{addValidation:i=>{t(s=>({...s,...i}))},clearValidation:i=>{i in o&&t(s=>{let d={...s};return delete d[i],d})},clearAllValidations:()=>{t({})},validation:o}},O=to;var p=require("react/jsx-runtime"),v="json-editor",k=o=>{let{value:t,onChange:r,onSave:n,helperText:e,error:i,...s}=o,{addValidation:d,clearValidation:I,validation:V}=O(),H=JSON.stringify(t,null,2),[z,D]=(0,b.useState)(H),[L,h]=(0,b.useState)(!1),M=()=>v in V&&i||!1,U=()=>v in V&&e||"Ocorreu um erro inesperado. Por favor, tente novamente mais tarde.",_=l=>{I(v),D(l),r?.(l)},$=async()=>{if(h(!0),n)try{let l=JSON.parse(z);await n(l)}catch(l){d({[v]:l})}h(!1)};return(0,p.jsxs)(a.Root,{children:[(0,p.jsx)(a.Content,{...s,value:t,onChange:_,currentError:M(),currentHelperText:U()}),(0,p.jsx)(a.ActionsButtons,{children:(0,p.jsx)(a.ActionButton,{onSave:$,loading:L})})]})};var P=require("react/jsx-runtime"),G=o=>{let{value:t,...r}=o;return(0,P.jsx)(a.Root,{children:(0,P.jsx)(a.Content,{...r,value:t})})};0&&(module.exports={Button,JsonEditor,JsonView});
1
+ "use strict";var U=Object.create;var m=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var W=Object.getPrototypeOf,q=Object.prototype.hasOwnProperty;var K=(o,t)=>{for(var r in t)m(o,r,{get:t[r],enumerable:!0})},C=(o,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of $(t))!q.call(o,e)&&e!==r&&m(o,e,{get:()=>t[e],enumerable:!(n=_(t,e))||n.enumerable});return o};var Q=(o,t,r)=>(r=o!=null?U(W(o)):{},C(t||!o||!o.__esModule?m(r,"default",{value:o,enumerable:!0}):r,o)),X=o=>C(m({},"__esModule",{value:!0}),o);var ro={};K(ro,{Button:()=>Y,JsonEditor:()=>oo,JsonView:()=>to});module.exports=X(ro);var R=require("react/jsx-runtime"),Y=o=>{let{backgroundColor:t,label:r,size:n,primary:e}=o,i=e?"storybook-button--primary":"storybook-button--secondary";return(0,R.jsx)("button",{type:"button",className:["storybook-button",`storybook-button--${n}`,i].join(""),style:{backgroundColor:t},...o,children:r})};var J=require("react");var A=require("@mui/material"),S=require("react/jsx-runtime"),x=o=>(0,S.jsx)(A.Grid2,{container:!0,direction:"column",spacing:2,children:o.children});var f=require("@mui/material"),g=require("react/jsx-runtime"),T=o=>{let{onSave:t,loading:r}=o;return(0,g.jsx)(f.Button,{onClick:()=>{t()},color:"primary",variant:"contained",disableElevation:!0,disabled:r,endIcon:r&&(0,g.jsx)(f.CircularProgress,{size:20,color:"inherit"}),children:"Salvar"})};var y=require("@mui/material"),b=require("react/jsx-runtime"),w=o=>(0,b.jsx)(y.Grid2,{container:!0,justify:"flex-end",children:(0,b.jsx)(y.Grid2,{item:!0,children:o.children})});var E=Q(require("react-ace")),p=require("@mui/material"),c=require("react/jsx-runtime"),Z="json-editor",B=o=>{let{value:t,onChange:r,currentError:n,currentHelperText:e,...i}=o,s=JSON.stringify(t,null,2);return(0,c.jsxs)(p.Grid2,{children:[(0,c.jsx)(p.FormControl,{error:n,fullWidth:!0,children:(0,c.jsx)(E.default,{...i,name:Z,value:s,wrapEnabled:!0,mode:"json",theme:"textmate",onChange:r,fontSize:16,showPrintMargin:!0,showGutter:!0,highlightActiveLine:!0,editorProps:{$blockScrolling:!0},setOptions:{showLineNumbers:!0,tabSize:2}})}),e&&(0,c.jsx)(p.FormHelperText,{error:n,children:e})]})};var a={Root:x,ActionButton:T,ActionsButtons:w,Content:B};var F=require("react"),j=()=>{let[o,t]=(0,F.useState)({});return{addValidation:i=>{t(s=>({...s,...i}))},clearValidation:i=>{i in o&&t(s=>{let d={...s};return delete d[i],d})},clearAllValidations:()=>{t({})},validation:o}},N=j;var u=require("react/jsx-runtime"),v="json-editor",oo=o=>{let{value:t,onChange:r,onSave:n,helperText:e,error:i,...s}=o,{addValidation:d,clearValidation:O,validation:h}=N(),k=JSON.stringify(t,null,2),[G,I]=(0,J.useState)(k),[H,V]=(0,J.useState)(!1),z=()=>v in h&&i||!1,D=()=>v in h&&e||"Ocorreu um erro inesperado. Por favor, tente novamente mais tarde.",L=l=>{O(v),I(l),r?.(l)},M=async()=>{if(V(!0),n)try{let l=JSON.parse(G);await n(l)}catch(l){d({[v]:l})}V(!1)};return(0,u.jsxs)(a.Root,{children:[(0,u.jsx)(a.Content,{...s,value:t,onChange:L,currentError:z(),currentHelperText:D()}),(0,u.jsx)(a.ActionsButtons,{children:(0,u.jsx)(a.ActionButton,{onSave:M,loading:H})})]})};var P=require("react/jsx-runtime"),to=o=>{let{value:t,...r}=o;return(0,P.jsx)(a.Root,{children:(0,P.jsx)(a.Content,{...r,value:t})})};0&&(module.exports={Button,JsonEditor,JsonView});
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "letalkui",
3
3
  "private": false,
4
- "version": "0.0.13",
4
+ "version": "0.0.14",
5
5
  "files": [
6
6
  "dist"
7
7
  ],
8
8
  "main": "dist/index.js",
9
- "module": "dist/index.cjs",
9
+ "module": "dist/index.mjs",
10
10
  "types": "dist/index.d.ts",
11
11
  "exports": {
12
12
  ".": {
13
- "import": "./dist/index.cjs",
14
- "default": "./dist/index.cjs",
13
+ "import": "./dist/index.mjs",
14
+ "default": "./dist/index.mjs",
15
15
  "require": "./dist/index.js",
16
16
  "types": "./dist/index.d.ts"
17
17
  }