@eliseubatista99/react-scaffold-core 0.1.80 → 0.1.82

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.
@@ -10,6 +10,7 @@ export interface InputFieldProps {
10
10
  autoComplete?: HTMLInputAutoCompleteAttribute;
11
11
  value?: string;
12
12
  initialValue?: string;
13
+ maxLength?: number;
13
14
  type?: HTMLInputTypeAttribute;
14
15
  onChange?: (value: string) => void;
15
16
  onFocus?: () => void;
@@ -18,4 +19,4 @@ export interface InputFieldProps {
18
19
  containerStyles?: CSSProperties;
19
20
  styles?: CSSProperties;
20
21
  }
21
- export declare const InputField: ({ name, label, leftIcon, rightIcon, bottomMessage, placeHolder, autoComplete, value, initialValue, type, onChange, onFocus, onBlur, inputStyles, containerStyles, styles, step, }: InputFieldProps) => import("react/jsx-runtime").JSX.Element;
22
+ export declare const InputField: ({ name, label, leftIcon, rightIcon, bottomMessage, placeHolder, autoComplete, value, initialValue, type, onChange, onFocus, onBlur, maxLength, inputStyles, containerStyles, styles, step, }: InputFieldProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { StoryObj } from '@storybook/react-vite';
2
2
  declare const meta: {
3
3
  title: string;
4
- component: ({ name, label, leftIcon, rightIcon, bottomMessage, placeHolder, autoComplete, value, initialValue, type, onChange, onFocus, onBlur, inputStyles, containerStyles, styles, step, }: import('../inputField').InputFieldProps) => import("react/jsx-runtime").JSX.Element;
4
+ component: ({ name, label, leftIcon, rightIcon, bottomMessage, placeHolder, autoComplete, value, initialValue, type, onChange, onFocus, onBlur, maxLength, inputStyles, containerStyles, styles, step, }: import('../inputField').InputFieldProps) => import("react/jsx-runtime").JSX.Element;
5
5
  parameters: {
6
6
  layout: string;
7
7
  };
package/dist/index.cjs.js CHANGED
@@ -156,7 +156,7 @@ Please change the parent <Route path="${x}"> to <Route path="${x==="/"?"*":`${x}
156
156
  input:-webkit-autofill {
157
157
  background-color: #00000000;
158
158
  }
159
- `,Zo=({name:e,label:t,leftIcon:r,rightIcon:i,bottomMessage:a,placeHolder:s,autoComplete:c="off",value:l,initialValue:u,type:h="text",onChange:g,onFocus:k,onBlur:j,inputStyles:M,containerStyles:P,styles:p,step:I})=>{const x=B=>{g?.(B.currentTarget.value)},F=B=>{B.preventDefault(),B.stopPropagation(),k?.()},U=B=>{j?.()};return G.jsxs(Jo,{style:{width:"100%",maxWidth:"357px",gap:"8px",...p},children:[t,G.jsxs("div",{style:{display:"flex",flexDirection:"row",width:"100%",height:"47px",margin:"8px auto 0 auto",border:"2px solid #000000",borderRadius:"5px",padding:"5px 15px",color:"#000000",fontFamily:"inherit",fontStyle:"normal",fontWeight:400,fontSize:"16px",lineHeight:"24px",outline:"none",alignItems:"center",gap:"10px",...P},children:[r,G.jsx("input",{name:e,type:h,autoComplete:c,step:I,style:{flex:1,border:"none",color:"inherit",fontFamily:"inherit",fontStyle:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",outline:"inherit",background:"none",...M},placeholder:s,value:l,defaultValue:u,onChange:x,onFocus:F,onBlur:U}),i]}),a]})},Qo=({id:e,styles:t,children:r})=>{const{isItemVisible:i}=et();return G.jsx(G.Fragment,{children:i(e)&&G.jsx("div",{style:{width:"100%",minHeight:"100%",left:0,top:0,position:"fixed",zIndex:1e3,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",...t},children:r})})},es=({id:e,children:t,backgroundStyles:r,contentStyles:i,onClickOutsideModal:a})=>{const{isItemVisible:s}=et();return G.jsx(G.Fragment,{children:s(e)&&G.jsx("div",{style:{width:"100%",height:"100%",minHeight:"100vh",background:"#00000068",position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1e3,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",...r},onClick:()=>{a?.()},children:G.jsx("div",{style:{width:"90%",maxWidth:"375px",height:"fit-content",minHeight:"80px",maxHeight:"50%",background:"#ffffff",borderRadius:"16px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",zIndex:1001,position:"relative",padding:"24px",...i},onClick:c=>{c.stopPropagation()},children:t})})})},ts=e=>{const t=Y.useRef(null),r=Y.useRef(null),[i,a]=Y.useState(24),[s,c]=Y.useState(24),l=Y.useCallback(()=>{t.current&&a(t.current.clientHeight)},[t,t.current]),u=Y.useCallback(()=>{r.current&&c(r.current.clientHeight)},[r,r.current]),h=Y.useCallback(()=>{let g=0;return e.header?.visibility==="always"&&(g=g+(i||0)),e.footer?.visibility==="always"&&(g=g+(s||0)),g},[r,r.current]);return Y.useEffect(()=>{l()},[l,t,t.current]),Y.useEffect(()=>{u()},[u,r,r.current]),{header:{...e.header,visible:e.header!==void 0,height:e.header?.visibility==="fixed"?0:i,ref:t},footer:{...e.footer,visible:e.footer!==void 0,height:e.footer?.visibility==="fixed"?0:s,ref:r},page:{extraHeight:h()}}},rs=Pe.div`
159
+ `,Zo=({name:e,label:t,leftIcon:r,rightIcon:i,bottomMessage:a,placeHolder:s,autoComplete:c="off",value:l,initialValue:u,type:h="text",onChange:g,onFocus:k,onBlur:j,maxLength:M,inputStyles:P,containerStyles:p,styles:I,step:x})=>{const F=v=>{g?.(v.currentTarget.value)},U=v=>{v.preventDefault(),v.stopPropagation(),k?.()},B=v=>{j?.()};return G.jsxs(Jo,{style:{width:"100%",maxWidth:"357px",gap:"8px",...I},children:[t,G.jsxs("div",{style:{display:"flex",flexDirection:"row",width:"100%",height:"47px",margin:"8px auto 0 auto",border:"2px solid #000000",borderRadius:"5px",padding:"5px 15px",color:"#000000",fontFamily:"inherit",fontStyle:"normal",fontWeight:400,fontSize:"16px",lineHeight:"24px",outline:"none",alignItems:"center",gap:"10px",...p},children:[r,G.jsx("input",{name:e,type:h,autoComplete:c,step:x,maxLength:M,max:M?"9".repeat(M):void 0,style:{flex:1,border:"none",color:"inherit",fontFamily:"inherit",fontStyle:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",outline:"inherit",background:"none",...P},placeholder:s,value:l,defaultValue:u,onChange:F,onFocus:U,onBlur:B}),i]}),a]})},Qo=({id:e,styles:t,children:r})=>{const{isItemVisible:i}=et();return G.jsx(G.Fragment,{children:i(e)&&G.jsx("div",{style:{width:"100%",minHeight:"100%",left:0,top:0,position:"fixed",zIndex:1e3,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",...t},children:r})})},es=({id:e,children:t,backgroundStyles:r,contentStyles:i,onClickOutsideModal:a})=>{const{isItemVisible:s}=et();return G.jsx(G.Fragment,{children:s(e)&&G.jsx("div",{style:{width:"100%",height:"100%",minHeight:"100vh",background:"#00000068",position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1e3,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",...r},onClick:()=>{a?.()},children:G.jsx("div",{style:{width:"90%",maxWidth:"375px",height:"fit-content",minHeight:"80px",maxHeight:"50%",background:"#ffffff",borderRadius:"16px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",zIndex:1001,position:"relative",padding:"24px",...i},onClick:c=>{c.stopPropagation()},children:t})})})},ts=e=>{const t=Y.useRef(null),r=Y.useRef(null),[i,a]=Y.useState(24),[s,c]=Y.useState(24),l=Y.useCallback(()=>{t.current&&a(t.current.clientHeight)},[t,t.current]),u=Y.useCallback(()=>{r.current&&c(r.current.clientHeight)},[r,r.current]),h=Y.useCallback(()=>{let g=0;return e.header?.visibility==="always"&&(g=g+(i||0)),e.footer?.visibility==="always"&&(g=g+(s||0)),g},[r,r.current]);return Y.useEffect(()=>{l()},[l,t,t.current]),Y.useEffect(()=>{u()},[u,r,r.current]),{header:{...e.header,visible:e.header!==void 0,height:e.header?.visibility==="fixed"?0:i,ref:t},footer:{...e.footer,visible:e.footer!==void 0,height:e.footer?.visibility==="fixed"?0:s,ref:r},page:{extraHeight:h()}}},rs=Pe.div`
160
160
  min-height: 100%;
161
161
  max-height: 100%;
162
162
  width: 100%;