@worldresources/wri-design-systems 2.184.1 → 2.184.2
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.cjs.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.esm.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -3705,7 +3705,7 @@ function Ju(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
3705
3705
|
padding: 0px;
|
|
3706
3706
|
padding-top: 8px;
|
|
3707
3707
|
color: ${o?h("neutral",500):"inherit"};
|
|
3708
|
-
`),children:n.children}):null]},`${n.label}-${n.value}`);var o,i}))})}),exports.Pagination=Yi,exports.Panel=({header:e,content:r,footer:o,variant:i="fixed",width:a})=>{const[s,l]=n.useState(void 0),[c,d]=n.useState(void 0),u=n.useRef(null),p=n.useRef(null);n.useEffect((()=>{l(u?.current?.getBoundingClientRect()?.height),d(p?.current?.getBoundingClientRect()?.height)}),[e,o]);return t.jsxs("div",{css:[fs(a),"fixed"===i?xs:gs],children:[e?t.jsx("div",{css:vs,ref:u,children:e}):null,t.jsx("div",{css:ms(s,c),children:r}),o?t.jsx("div",{css:bs,ref:p,children:o}):null]})},exports.Password=({label:e,caption:o,required:i,disabledRules:a,onChange:s,minLength:l=8,hideValidations:c})=>{const[d,u]=n.useState(!1),[p,f]=n.useState(""),[x,g]=n.useState({strength:"Very weak",length:!1,uppercase:!1,lowercase:!1,numbers:!1,specialCharacters:!1});return t.jsxs("div",{css:Kt,children:[t.jsxs("p",{css:Jt,"aria-label":e,children:[i?t.jsx("span",{children:"*"}):null,e]}),t.jsx("p",{css:Qt,"aria-label":o,children:o}),t.jsxs("div",{css:en,children:[t.jsx(kt,{type:d?"text":"password",value:p,"aria-describedby":"password-guidelines",onChange:e=>(e=>{const t={...x};let n=0,r=!1;t.length=e.length>=l,n+=e.length>=l?1:0,r=/[A-Z]/.test(e),n+=r?1:0,t.uppercase=r,r=/[a-z]/.test(e),n+=r?1:0,t.lowercase=r,r=/[0-9]/.test(e),n+=r?1:0,t.numbers=r,r=/[-'/`~!¡#*$@_%+=.,^&(){}[\]|;:“‘"<>?\\]/.test(e),n+=r?1:0,t.specialCharacters=r,t.strength="Very Weak",e.length>=4&&n>=2&&(t.strength="Weak"),e.length>=6&&n>=3&&(t.strength="Medium"),e.length>=l&&n>=4&&(t.strength="Strong"),e.length>=l+2&&n>=5&&(t.strength="Very Strong"),f(e),g(t),s&&s(t)})(e.target.value)}),t.jsx(b,{label:d?"Hide":"Show",variant:"secondary",leftIcon:d?t.jsx(O,{}):t.jsx(L,{}),"aria-label":d?"Hide password":"Show password",onClick:()=>u(!d),type:"button"})]}),p&&!c?t.jsxs("div",{id:"password-guidelines",css:tn,"aria-live":"polite",children:[t.jsxs("p",{css:(v=x.strength,r.css`
|
|
3708
|
+
`),children:n.children}):null]},`${n.label}-${n.value}`);var o,i}))})}),exports.Pagination=Yi,exports.Panel=({header:e,content:r,footer:o,variant:i="fixed",width:a})=>{const[s,l]=n.useState(void 0),[c,d]=n.useState(void 0),u=n.useRef(null),p=n.useRef(null);n.useEffect((()=>{l(u?.current?.getBoundingClientRect()?.height),d(p?.current?.getBoundingClientRect()?.height)}),[e,o]);return t.jsxs("div",{css:[fs(a),"fixed"===i?xs:gs],children:[e?t.jsx("div",{css:vs,ref:u,children:e}):null,t.jsx("div",{css:ms(s,c),children:r}),o?t.jsx("div",{css:bs,ref:p,children:o}):null]})},exports.Password=({label:e,caption:o,required:i,disabledRules:a,onChange:s,minLength:l=8,hideValidations:c})=>{const[d,u]=n.useState(!1),[p,f]=n.useState(""),[x,g]=n.useState({strength:"Very weak",length:!1,uppercase:!1,lowercase:!1,numbers:!1,specialCharacters:!1});return t.jsxs("div",{css:Kt,children:[t.jsxs("p",{css:Jt,"aria-label":e,children:[i?t.jsx("span",{children:"*"}):null,e]}),t.jsx("p",{css:Qt,"aria-label":o,children:o}),t.jsxs("div",{css:en,children:[t.jsx(kt,{type:d?"text":"password",value:p,"aria-describedby":"password-guidelines",onChange:e=>(e=>{const t={...x};let n=0,r=!1;t.length=e.length>=l,n+=e.length>=l?1:0,r=/[A-Z]/.test(e),n+=r?1:0,t.uppercase=r,r=/[a-z]/.test(e),n+=r?1:0,t.lowercase=r,r=/[0-9]/.test(e),n+=r?1:0,t.numbers=r,r=/[-'/`~!¡#*$@_%+=.,^&(){}[\]|;:“‘"<>?\\]/.test(e),n+=r?1:0,t.specialCharacters=r,t.strength="Very Weak",e.length>=4&&n>=2&&(t.strength="Weak"),e.length>=6&&n>=3&&(t.strength="Medium"),e.length>=l&&n>=4&&(t.strength="Strong"),e.length>=l+2&&n>=5&&(t.strength="Very Strong"),f(e),g(t),s&&s({...t,password:e})})(e.target.value)}),t.jsx(b,{label:d?"Hide":"Show",variant:"secondary",leftIcon:d?t.jsx(O,{}):t.jsx(L,{}),"aria-label":d?"Hide password":"Show password",onClick:()=>u(!d),type:"button"})]}),p&&!c?t.jsxs("div",{id:"password-guidelines",css:tn,"aria-live":"polite",children:[t.jsxs("p",{css:(v=x.strength,r.css`
|
|
3709
3709
|
font-size: 16px;
|
|
3710
3710
|
line-height: 24px;
|
|
3711
3711
|
font-weight: 400;
|
package/dist/index.d.ts
CHANGED
|
@@ -282,13 +282,14 @@ type PasswordProps = {
|
|
|
282
282
|
label: string;
|
|
283
283
|
caption?: string;
|
|
284
284
|
required?: boolean;
|
|
285
|
-
onChange?: ({ strength, length, uppercase, lowercase, numbers, specialCharacters, }: {
|
|
285
|
+
onChange?: ({ strength, length, uppercase, lowercase, numbers, specialCharacters, password, }: {
|
|
286
286
|
strength: string;
|
|
287
287
|
length: boolean;
|
|
288
288
|
uppercase: boolean;
|
|
289
289
|
lowercase: boolean;
|
|
290
290
|
numbers: boolean;
|
|
291
291
|
specialCharacters: boolean;
|
|
292
|
+
password: string;
|
|
292
293
|
}) => void;
|
|
293
294
|
disabledRules?: {
|
|
294
295
|
uppercase?: boolean;
|
package/dist/index.esm.js
CHANGED
|
@@ -1511,7 +1511,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
|
|
|
1511
1511
|
justify-content: center;
|
|
1512
1512
|
align-items: center;
|
|
1513
1513
|
}
|
|
1514
|
-
`,br=({label:e,caption:t,required:n,disabledRules:r,onChange:o,minLength:i=8,hideValidations:a})=>{const[l,s]=J(!1),[c,d]=J(""),[u,p]=J({strength:"Very weak",length:!1,uppercase:!1,lowercase:!1,numbers:!1,specialCharacters:!1});return q("div",{css:pr,children:[q("p",{css:hr,"aria-label":e,children:[n?G("span",{children:"*"}):null,e]}),G("p",{css:fr,"aria-label":t,children:t}),q("div",{css:gr,children:[G(jn,{type:l?"text":"password",value:c,"aria-describedby":"password-guidelines",onChange:e=>(e=>{const t={...u};let n=0,r=!1;t.length=e.length>=i,n+=e.length>=i?1:0,r=/[A-Z]/.test(e),n+=r?1:0,t.uppercase=r,r=/[a-z]/.test(e),n+=r?1:0,t.lowercase=r,r=/[0-9]/.test(e),n+=r?1:0,t.numbers=r,r=/[-'/`~!¡#*$@_%+=.,^&(){}[\]|;:“‘"<>?\\]/.test(e),n+=r?1:0,t.specialCharacters=r,t.strength="Very Weak",e.length>=4&&n>=2&&(t.strength="Weak"),e.length>=6&&n>=3&&(t.strength="Medium"),e.length>=i&&n>=4&&(t.strength="Strong"),e.length>=i+2&&n>=5&&(t.strength="Very Strong"),d(e),p(t),o&&o(t)})(e.target.value)}),G(Le,{label:l?"Hide":"Show",variant:"secondary",leftIcon:G(l?je:Ie,{}),"aria-label":l?"Hide password":"Show password",onClick:()=>s(!l),type:"button"})]}),c&&!a?q("div",{id:"password-guidelines",css:vr,"aria-live":"polite",children:[q("p",{css:(h=u.strength,de`
|
|
1514
|
+
`,br=({label:e,caption:t,required:n,disabledRules:r,onChange:o,minLength:i=8,hideValidations:a})=>{const[l,s]=J(!1),[c,d]=J(""),[u,p]=J({strength:"Very weak",length:!1,uppercase:!1,lowercase:!1,numbers:!1,specialCharacters:!1});return q("div",{css:pr,children:[q("p",{css:hr,"aria-label":e,children:[n?G("span",{children:"*"}):null,e]}),G("p",{css:fr,"aria-label":t,children:t}),q("div",{css:gr,children:[G(jn,{type:l?"text":"password",value:c,"aria-describedby":"password-guidelines",onChange:e=>(e=>{const t={...u};let n=0,r=!1;t.length=e.length>=i,n+=e.length>=i?1:0,r=/[A-Z]/.test(e),n+=r?1:0,t.uppercase=r,r=/[a-z]/.test(e),n+=r?1:0,t.lowercase=r,r=/[0-9]/.test(e),n+=r?1:0,t.numbers=r,r=/[-'/`~!¡#*$@_%+=.,^&(){}[\]|;:“‘"<>?\\]/.test(e),n+=r?1:0,t.specialCharacters=r,t.strength="Very Weak",e.length>=4&&n>=2&&(t.strength="Weak"),e.length>=6&&n>=3&&(t.strength="Medium"),e.length>=i&&n>=4&&(t.strength="Strong"),e.length>=i+2&&n>=5&&(t.strength="Very Strong"),d(e),p(t),o&&o({...t,password:e})})(e.target.value)}),G(Le,{label:l?"Hide":"Show",variant:"secondary",leftIcon:G(l?je:Ie,{}),"aria-label":l?"Hide password":"Show password",onClick:()=>s(!l),type:"button"})]}),c&&!a?q("div",{id:"password-guidelines",css:vr,"aria-live":"polite",children:[q("p",{css:(h=u.strength,de`
|
|
1515
1515
|
font-size: 16px;
|
|
1516
1516
|
line-height: 24px;
|
|
1517
1517
|
font-weight: 400;
|