@kosdev-code/base-ui-components 1.3.0 → 2.0.0

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,9 +1,10 @@
1
1
  import { ReactNode } from 'react';
2
2
 
3
3
  interface ShellMenuProps {
4
+ className?: string;
5
+ left?: ReactNode;
4
6
  right?: ReactNode;
5
- left: ReactNode;
6
7
  }
7
- export declare const ShellMenu: ({ right, left }: ShellMenuProps) => import("@emotion/react/jsx-runtime").JSX.Element;
8
+ export declare const ShellMenu: ({ className, left, right }: ShellMenuProps) => import("@emotion/react/jsx-runtime").JSX.Element;
8
9
  export {};
9
10
  //# sourceMappingURL=shell-menu.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shell-menu.d.ts","sourceRoot":"","sources":["../../../../../../../packages/libraries/base-ui-components/src/components/molecules/shell-menu/shell-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,UAAU,cAAc;IACtB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,eAAO,MAAM,SAAS,oBAAqB,cAAc,qDAKxD,CAAC"}
1
+ {"version":3,"file":"shell-menu.d.ts","sourceRoot":"","sources":["../../../../../../../packages/libraries/base-ui-components/src/components/molecules/shell-menu/shell-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,UAAU,cAAc;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,eAAO,MAAM,SAAS,+BAAgC,cAAc,qDAKnE,CAAC"}
@@ -5,7 +5,8 @@ export type PasswordValidation<T extends FieldValues = FieldValues> = Record<Pas
5
5
  export declare enum PasswordRequirementKeys {
6
6
  noDigit = "noDigit",
7
7
  noUpperCase = "noUpperCase",
8
- noSpecialCharacter = "noSpecialCharacter"
8
+ noSpecialCharacter = "noSpecialCharacter",
9
+ tooSimilar = "tooSimilar"
9
10
  }
10
- export declare const getPasswordValidation: <T extends FieldValues = FieldValues>() => PasswordValidation<T>;
11
+ export declare const getPasswordValidation: <T extends FieldValues = FieldValues>(includeTooSimilar?: boolean, tooSimilarKey?: string) => PasswordValidation<T>;
11
12
  //# sourceMappingURL=password-validation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"password-validation.d.ts","sourceRoot":"","sources":["../../../../../../packages/libraries/base-ui-components/src/helpers/validation/password-validation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE7D,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtC,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,IAAI,MAAM,CAC1E,uBAAuB,EACvB,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CACpB,CAAC;AAEF,oBAAY,uBAAuB;IACjC,OAAO,YAAY;IACnB,WAAW,gBAAgB;IAC3B,kBAAkB,uBAAuB;CAC1C;AAED,eAAO,MAAM,qBAAqB,6CAE7B,mBAAmB,CAAC,CAQxB,CAAC"}
1
+ {"version":3,"file":"password-validation.d.ts","sourceRoot":"","sources":["../../../../../../packages/libraries/base-ui-components/src/helpers/validation/password-validation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE7D,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtC,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,IAAI,MAAM,CAC1E,uBAAuB,EACvB,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CACpB,CAAC;AAEF,oBAAY,uBAAuB;IACjC,OAAO,YAAY;IACnB,WAAW,gBAAgB;IAC3B,kBAAkB,uBAAuB;IACzC,UAAU,eAAe;CAC1B;AAED,eAAO,MAAM,qBAAqB,4DACZ,OAAO,kBACX,MAAM,KACrB,mBAAmB,CAAC,CAoBtB,CAAC"}
package/index.cjs CHANGED
@@ -1276,7 +1276,7 @@
1276
1276
  gap: ${zc("gap")};
1277
1277
  `,Ir=({variant:e="body",...t})=>a.jsx(M,{css:Or,variant:e,...t}),en=({children:e,prefix:t,suffix:o,...n})=>a.jsxs(Ir,{...n,children:[t,e,o]}),[Oc]=O(["label-with-action"]),Ic=E.css([Or,{gap:Oc("gap")}]),Rc=({action:e,variant:t="h2",...o})=>a.jsx(en,{css:Ic,suffix:e,variant:t,...o}),[Nc]=O(["label-with-content-link"]),Fc=E.css`
1278
1278
  color: ${Nc("color")};
1279
- `,Ac=e=>a.jsx(en,{css:Fc,...e}),_c=new RegExp(/^[a-zA-Z0-9 _.-]*$/),Rr=new RegExp(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),Wc=new RegExp(/^\d+$/),Lc=new RegExp(/^\S*$/),Bc=new RegExp(/^[a-zA-Z].*/),Nr=new RegExp(/^[-a-zA-Z0-9-_'().-]+(\s+[-a-zA-Z0-9-_'().-]+)*$/);var Fr=(e=>(e.email="email",e))(Fr||{});const Pc=()=>({email:e=>Rr.test(e)}),Hc=12;var Dt=(e=>(e.noDigit="noDigit",e.noUpperCase="noUpperCase",e.noSpecialCharacter="noSpecialCharacter",e))(Dt||{});const Vc=()=>({noDigit:e=>new RegExp(/\d/).test(e),noSpecialCharacter:e=>new RegExp(/[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~]+/).test(e),noUpperCase:e=>new RegExp(/[A-Z]+/).test(e)}),Ar=e=>typeof e=="object"&&e!==null&&"message"in e&&typeof e.message=="string",Gc=e=>{if(Ar(e))return e.message},Uc=()=>{let e=!1,t=[];const o=new Map,n=new window.ResizeObserver((r,s)=>{t=t.concat(r),e||window.requestAnimationFrame(()=>{const l=new Set;t.forEach(i=>{if(!l.has(i.target)){l.add(i.target);const u=o.get(i.target);u&&u.forEach(f=>f(i,s))}}),t=[],e=!1}),e=!0});return{observer:n,subscribe(r,s){n.observe(r);const l=o.get(r)??[];l.push(s),o.set(r,l)},unsubscribe(r,s){const l=o.get(r)??[];if(l.length===1){n.unobserve(r),o.delete(r);return}const i=l.indexOf(s);i!==-1&&l.splice(i,1),o.set(r,l)}}};let yo;const Yc=()=>yo||(yo=Uc()),_r=(e,t)=>{const o=Yc(),n=d.useRef(t);return d.useLayoutEffect(()=>{n.current=t},[t]),d.useLayoutEffect(()=>{let r=!1;const s=e&&"current"in e?e.current:e;if(!s)return Re;const l=(i,u)=>{r||n.current(i,u)};return o.subscribe(s,l),()=>{r=!0,o.unsubscribe(s,l)}},[e,o]),o.observer},eo=e=>{const t=d.useRef(null),o=d.useRef(null),n=d.useCallback(()=>{if(!t.current)return;const l=o.current,i=t.current;if(i!==null&&l!==null){const u=i.getAttribute("data-original");i.textContent!==u&&(i.textContent=u);const p=i.textContent,g=i.offsetWidth,h=l.offsetWidth;if(g>h&&p){const x=p.length,b=g/x,v=Math.ceil((g-h)/b)/2+1.5,w=Math.floor(x/2-v),k=Math.ceil(x/2+v),S=p.substr(0,w),$=p.substr(k);i.textContent=`${S.trim()}...${$.trim()}`}}},[]),r=d.useCallback(l=>{n()},[n]);_r(o,r),d.useEffect(()=>n(),[e.children,n]);const s=d.useCallback(l=>{t.current=l,o.current=(l==null?void 0:l.parentElement)??null},[]);return a.jsx(Kc,{"data-original":e.children,ref:s,...e})},Kc=m(M)`
1279
+ `,Ac=e=>a.jsx(en,{css:Fc,...e}),_c=new RegExp(/^[a-zA-Z0-9 _.-]*$/),Rr=new RegExp(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),Wc=new RegExp(/^\d+$/),Lc=new RegExp(/^\S*$/),Bc=new RegExp(/^[a-zA-Z].*/),Nr=new RegExp(/^[-a-zA-Z0-9-_'().-]+(\s+[-a-zA-Z0-9-_'().-]+)*$/);var Fr=(e=>(e.email="email",e))(Fr||{});const Pc=()=>({email:e=>Rr.test(e)}),Hc=12;var Dt=(e=>(e.noDigit="noDigit",e.noUpperCase="noUpperCase",e.noSpecialCharacter="noSpecialCharacter",e.tooSimilar="tooSimilar",e))(Dt||{});const Vc=(e,t)=>({...e?{tooSimilar:(o,n)=>{const r=n[t??"password_current"];return r?o!==r:!0}}:{tooSimilar:()=>!0},noDigit:o=>new RegExp(/\d/).test(o),noSpecialCharacter:o=>new RegExp(/[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~]+/).test(o),noUpperCase:o=>new RegExp(/[A-Z]+/).test(o)}),Ar=e=>typeof e=="object"&&e!==null&&"message"in e&&typeof e.message=="string",Gc=e=>{if(Ar(e))return e.message},Uc=()=>{let e=!1,t=[];const o=new Map,n=new window.ResizeObserver((r,s)=>{t=t.concat(r),e||window.requestAnimationFrame(()=>{const l=new Set;t.forEach(i=>{if(!l.has(i.target)){l.add(i.target);const u=o.get(i.target);u&&u.forEach(f=>f(i,s))}}),t=[],e=!1}),e=!0});return{observer:n,subscribe(r,s){n.observe(r);const l=o.get(r)??[];l.push(s),o.set(r,l)},unsubscribe(r,s){const l=o.get(r)??[];if(l.length===1){n.unobserve(r),o.delete(r);return}const i=l.indexOf(s);i!==-1&&l.splice(i,1),o.set(r,l)}}};let yo;const Yc=()=>yo||(yo=Uc()),_r=(e,t)=>{const o=Yc(),n=d.useRef(t);return d.useLayoutEffect(()=>{n.current=t},[t]),d.useLayoutEffect(()=>{let r=!1;const s=e&&"current"in e?e.current:e;if(!s)return Re;const l=(i,u)=>{r||n.current(i,u)};return o.subscribe(s,l),()=>{r=!0,o.unsubscribe(s,l)}},[e,o]),o.observer},eo=e=>{const t=d.useRef(null),o=d.useRef(null),n=d.useCallback(()=>{if(!t.current)return;const l=o.current,i=t.current;if(i!==null&&l!==null){const u=i.getAttribute("data-original");i.textContent!==u&&(i.textContent=u);const p=i.textContent,g=i.offsetWidth,h=l.offsetWidth;if(g>h&&p){const x=p.length,b=g/x,v=Math.ceil((g-h)/b)/2+1.5,w=Math.floor(x/2-v),k=Math.ceil(x/2+v),S=p.substr(0,w),$=p.substr(k);i.textContent=`${S.trim()}...${$.trim()}`}}},[]),r=d.useCallback(l=>{n()},[n]);_r(o,r),d.useEffect(()=>n(),[e.children,n]);const s=d.useCallback(l=>{t.current=l,o.current=(l==null?void 0:l.parentElement)??null},[]);return a.jsx(Kc,{"data-original":e.children,ref:s,...e})},Kc=m(M)`
1280
1280
  white-space: nowrap;
1281
1281
  word-break: keep-all;
1282
1282
  overflow: visible;
@@ -2500,19 +2500,20 @@
2500
2500
  cursor: default;
2501
2501
  border-bottom: 0.5px solid ${c("color-grey60")};
2502
2502
  pointer-events: none;
2503
- `,[Ho]=O(["shell-menu"]),yg=({right:e,left:t})=>a.jsxs(kg,{children:[a.jsx(Un,{children:t}),!!e&&a.jsx(Un,{children:e})]}),kg=m.div`
2504
- width: 100%;
2505
- display: flex;
2503
+ `,[Ho]=O(["shell-menu"]),yg=({className:e,left:t,right:o})=>a.jsxs(kg,{className:e,children:[a.jsx(Un,{children:t}),!!o&&a.jsx(Un,{children:o})]}),kg=m.div`
2506
2504
  align-items: center;
2505
+ column-gap: ${Ho("section-gap")};
2506
+ display: flex;
2507
2507
  height: 100%;
2508
2508
  justify-content: space-between;
2509
2509
  padding: 0px ${Ho("padding-x")};
2510
- column-gap: ${Ho("section-gap")};
2510
+ width: 100%;
2511
2511
  `,Un=m.div`
2512
- display: flex;
2513
2512
  align-items: center;
2514
- justify-content: flex-start;
2515
2513
  column-gap: ${Ho("link-gap")};
2514
+ display: flex;
2515
+ height: 100%;
2516
+ justify-content: flex-start;
2516
2517
  `,[Yn]=O(["shell-menu"]),vg=d.memo(({text:e,onClick:t,isActive:o})=>a.jsx(wg,{onClick:t,variant:"body",color:"light",bold:o,children:e})),wg=m(M)`
2517
2518
  padding: ${Yn("link-padding-y")} ${Yn("link-padding-x")};
2518
2519
  line-height: unset;