@verifiedinc-public/shared-ui-elements 3.1.1 → 3.1.3
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/components/index.mjs +1 -1
- package/dist/components/typographies/PageHeader.d.ts +8 -0
- package/dist/components/typographies/PageSectionHeader.d.ts +8 -0
- package/dist/components/typographies/index.d.ts +2 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/shared/index-f0sOpo6B.mjs +105 -0
- package/dist/shared/shadows-Dhd7FrwF.mjs +1 -0
- package/dist/shared/useOnClickOutside-Bvjq5s1M.mjs +1 -0
- package/dist/shared/useQRCode-DKyiMOAs.mjs +1 -0
- package/dist/styles/index.mjs +1 -1
- package/dist/styles/typography.d.ts +27 -30
- package/package.json +1 -1
- package/dist/shared/index-YQfmNqZx.mjs +0 -105
- package/dist/shared/shadows-CNjkm81P.mjs +0 -1
- package/dist/shared/useIntersectionObserver-BX_TdOtC.mjs +0 -1
- package/dist/shared/useQRCode-DXiPIj-D.mjs +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";import{colors as t,createTheme as C}from"@mui/material";const i="rgba(0,0,0,0.26)",r="#ffffff",n="#000000",o="#0dbc3d",a="#5ef06d",l="#008a01",s="#164fd6",g="#657bff",d="#0028a3",h="#eb0d28",f="#ff5952",m="#b00000",u="#F5D328",p="#5ef06d",y="#bea008",b="#625410",c="#09225E",x="#F9F9FB",W="#bdbdbd",z="#797979",S=t.grey[400],k=t.grey[500],w=t.grey[600],e={textDisabled:i,white:r,black:n,green:o,lightGreen:a,darkGreen:l,blue:s,lightBlue:g,darkBlue:d,red:h,lightRed:f,darkRed:m,yellow:u,lightYellow:p,darkYellow:y,warningContrast:b,infoContrast:c,lightGrey:x,grey:W,darkGrey:z,lightGreyContrast:S,greyContrast:k,darkGreyContrast:w},M={htmlFontSize:16,fontSize:14,fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:500,fontWeightBold:700,h1:{fontWeight:300,fontSize:"6rem",lineHeight:1.167},h2:{fontWeight:300,fontSize:"3.75rem",lineHeight:1.2},h3:{fontWeight:400,fontSize:"3rem",lineHeight:1.167},h4:{fontWeight:400,fontSize:"2.125rem",lineHeight:1.235},h5:{fontWeight:400,fontSize:"1.5rem",lineHeight:1.334},h6:{fontWeight:500,fontSize:"1.25rem",lineHeight:1.6},subtitle1:{fontWeight:400,fontSize:"1rem",lineHeight:1.75},subtitle2:{fontWeight:500,fontSize:"0.875rem",lineHeight:1.57},body1:{fontWeight:400,fontSize:"1rem",lineHeight:1.5},body2:{fontWeight:400,fontSize:"0.875rem",lineHeight:1.43},button:{fontWeight:500,fontSize:"0.875rem",lineHeight:1.75,textTransform:"uppercase"},caption:{fontWeight:400,fontSize:"0.75rem",lineHeight:1.66},overline:{fontWeight:400,fontSize:"0.75rem",lineHeight:2.66,textTransform:"uppercase"},inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},T=({primaryFontFace:v})=>C({breakpoints:{values:{xs:0,sm:600,md:900,lg:1200,xl:1536}},typography:{fontFamily:v.style.fontFamily,...M},palette:{text:{disabled:e.textDisabled},primary:{main:e.green,light:e.lightGreen,dark:e.darkGreen,contrastText:e.white},secondary:{main:e.blue,light:e.lightBlue,dark:e.darkBlue,contrastText:e.white},error:{main:e.red,light:e.lightRed,dark:e.darkRed,contrastText:e.white},warning:{main:e.yellow,light:e.yellow,dark:e.darkYellow,contrastText:e.white},success:{main:e.green,light:e.green,dark:e.darkGreen,contrastText:e.white},info:{main:e.blue,light:e.lightBlue,dark:e.darkBlue,contrastText:e.infoContrast},neutral:{main:e.grey,light:e.lightGrey,dark:e.darkGrey},neutralContrast:{main:e.greyContrast,light:e.lightGreyContrast,dark:e.darkGreyContrast},warningContrast:{main:e.warningContrast},infoContrast:{main:e.infoContrast}},components:{MuiAlert:{styleOverrides:{action:{overflowWrap:"normal",display:"flex",alignItems:"center",padding:"8px 0",marginRight:0,"& button, & a":{lineHeight:"0"}}}},MuiAlertTitle:{styleOverrides:{root:{...M.body2,fontSize:"1.1rem",fontWeight:700}}},MuiListItemIcon:{styleOverrides:{root:{minWidth:34}}},MuiListItemText:{styleOverrides:{primary:{fontSize:"1rem",fontWeight:800}}},MuiFab:{styleOverrides:{circular:{width:42,height:42},sizeSmall:{width:40,height:40}}},MuiIconButton:{styleOverrides:{root:{"&.Mui-disabled":{svg:{opacity:.4}}}}},MuiButton:{styleOverrides:{root:{fontWeight:800}}},MuiDialog:{defaultProps:{maxWidth:"xs"}},MuiDialogTitle:{styleOverrides:{root:{fontSize:20,fontWeight:800,textAlign:"center"}}},MuiDialogContent:{styleOverrides:{root:{paddingTop:"8px!important",paddingBottom:8}}},MuiDialogActions:{styleOverrides:{root:{paddingLeft:24,paddingRight:24,paddingBottom:24,justifyContent:"space-between","& .MuiButton-root":{marginTop:0}}}},MuiRadio:{styleOverrides:{root:{"&.Mui-disabled":{color:`${e.grey} !important`}}}},MuiTableRow:{styleOverrides:{root:{"& th.MuiTableCell-root":{fontSize:12,fontWeight:700,letterSpacing:1},"& td.MuiTableCell-root":{fontSize:20,fontWeight:300}}}},MuiTextField:{defaultProps:{variant:"outlined",size:"medium"}},MuiSelect:{defaultProps:{variant:"outlined",size:"medium"}},MuiAutocomplete:{defaultProps:{size:"medium"}}}}),H="0px -2px 4px -1px rgba(0,0,0,0.2), 0px -4px 5px 0px rgba(0,0,0,0.14), 0px -1px 10px 0px rgba(0,0,0,0.12)",B={bottomSheet:H};export{s as a,n as b,g as c,l as d,d as e,f,o as g,m as h,p as i,y as j,b as k,a as l,c as m,x as n,W as o,z as p,S as q,h as r,k as s,i as t,w as u,e as v,r as w,T as x,u as y,B as z};
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";import{useRef as y,useInsertionEffect as O,useCallback as w,useState as d,useId as T,useEffect as v,useLayoutEffect as x}from"react";function A(e){return{set:n=>{const o=typeof n=="string"?n:JSON.stringify(n);localStorage.setItem(e,o)},get:()=>{const n=localStorage.getItem(e);if(n)try{return JSON.parse(n)}catch{return n}return null},remove:()=>{localStorage.removeItem(e)}}}function k({type:e="text/plain"}){return{copy:async n=>{var o;if((o=navigator.clipboard)!=null&&o.write){const t={};switch(e){case"text/html":t["text/plain"]=new Blob([n],{type:"text/plain"}),t[e]=new Blob([n],{type:e});break;default:t[e]=new Blob([n],{type:e})}const i=[new ClipboardItem(t)];await navigator.clipboard.write(i)}else{const t=document.createElement("textarea");n instanceof Blob?t.value=await n.text():t.value=n.toString(),t.select(),document.execCommand("copy")}}}}function b(e,n=[]){const o=y(()=>{throw new Error("Cannot call an event handler while rendering.")});return O(()=>{o.current=e}),w((...t)=>{var i;return(i=o.current)==null?void 0:i.call(o,...t)},n)}function B(e={}){const{onClose:n,onOpen:o,open:t,id:i}=e,r=b(o),s=b(n),[c,l]=d(e.defaultOpen??!1),a=t??c,u=t!==void 0,p=T(),f=i??`disclosure-${p}`,g=w(()=>{u||l(!1),s?.()},[u,s]),h=w(()=>{u||l(!0),r?.()},[u,r]),E=w(()=>{a?g():h()},[a,h,g]);function L(m={}){return{...m,"aria-expanded":a,"aria-controls":f,onClick(C){var I;(I=m.onClick)==null||I.call(m,C),E()}}}function S(m={}){return{...m,hidden:!a,id:f}}return{open:a,onOpen:h,onClose:g,onToggle:E,isControlled:u,getButtonProps:L,getDisclosureProps:S}}function z(e){return new URLSearchParams(e??window.location.search)}function D(e,n=250){const[o,t]=d(e);return v(()=>{const i=setTimeout(()=>{t(e)},n);return()=>{clearTimeout(i)}},[e,n]),o}function U(e,n={removeOnUnmount:!1}){const[o,t]=d("loading"),i=y(n);return v(()=>{let r=document.querySelector(`script[src="${e}"]`);const s=r?.getAttribute("data-status");if(s){t(s);return}if(r===null){r=document.createElement("script"),r.src=e,r.async=!0,r.setAttribute("data-status","loading"),document.body.appendChild(r);const c=()=>{r?.setAttribute("data-status","ready"),t("ready"),a()},l=()=>{r?.setAttribute("data-status","error"),t("error"),a()},a=()=>{r?.removeEventListener("load",c),r?.removeEventListener("error",l)};r.addEventListener("load",c),r.addEventListener("error",l);const u=i.current.removeOnUnmount;return()=>{u&&(r?.remove(),a())}}else t("unknown")},[e]),o}function W(e,n=500){const[o,t]=d(e),i=y(Date.now());return v(()=>{const r=Date.now(),s=r-i.current;if(s>=n)i.current=r,t(e);else{const c=n-s,l=window.setTimeout(()=>{i.current=Date.now(),t(e)},c);return()=>{window.clearTimeout(l)}}},[e,n]),o}function j(e){const[n,o]=d(()=>typeof e=="boolean"?e:!!e),t=w(i=>{if(typeof i=="boolean"){o(i);return}o(r=>!r)},[]);return[n,t]}function P(){const[e,n]=d({x:0,y:0}),o=w((...t)=>{if(t.length===1&&typeof t[0]=="object")window.scrollTo(t[0]);else if(t.length===2)window.scrollTo(t[0],t[1]);else throw new Error("Invalid arguments passed to scrollTo. Expected either ScrollToOptions object or x,y coordinates. See https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo")},[]);return x(()=>{const t=()=>{n({x:window.scrollX,y:window.scrollY})};return t(),window.addEventListener("scroll",t),()=>{window.removeEventListener("scroll",t)}},[]),{...e,scrollTo:o}}function H(){const[e,n]=d({width:window.innerWidth,height:window.innerHeight});return x(()=>{const o=()=>{n({width:window.innerWidth,height:window.innerHeight})};return window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o)}},[]),e}function J(e,{threshold:n=0,root:o=null,rootMargin:t="0%",freezeOnceVisible:i=!1}={}){const[r,s]=d({isIntersecting:!1,entry:null});return v(()=>{const c=e?.current;let l;if(c){if(i&&r.isIntersecting)return;const a=p=>{const[f]=p;s({isIntersecting:f.isIntersecting,entry:f})},u=new IntersectionObserver(a,{threshold:n,root:o,rootMargin:t});u.observe(c),l=()=>{u.disconnect()}}return()=>{l&&l()}},[e,n,o,t,i,r.isIntersecting]),r}function N(e,n,o="mousedown",t={}){v(()=>{const i=r=>{const s=r.target;!s||!s.isConnected||(Array.isArray(e)?e.filter(c=>!!c.current).every(c=>c.current&&!c.current.contains(s)):e.current&&!e.current.contains(s))&&n(r)};return window.addEventListener(o,i,t),()=>{window.removeEventListener(o,i,t)}},[t,o,n,e])}export{k as a,B as b,b as c,z as d,D as e,U as f,W as g,j as h,P as i,H as j,J as k,N as l,A as u};
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";import u,{useMemo as c}from"react";import*as m from"qrcode";function w(t){const[s,r]=u.useState(t),[o,a]=u.useState();return t!==s&&(a(s),r(t)),o}function z(t){const s=c(()=>m.create(t.data),[t.data]).modules.data;return c(()=>{const r=t.size/Math.sqrt(s.length);let o=`<svg viewBox="0 0 ${t.size} ${t.size}" xmlns="http://www.w3.org/2000/svg">`;const a=t.imageSize,l=(t.size-a)/2,h=(t.size-a)/2;for(let e=0;e<s.length;e++){const n=e%Math.sqrt(s.length)*r,i=Math.floor(e/Math.sqrt(s.length))*r,g=r/2,$=s[e]===1,f=n+r>=l&&n<l+a&&i+r>=h&&i<h+a;!$||f||(o+=`<rect x="${n}" y="${i}" width="${r}" height="${r}" rx="${g}" ry="${g}" fill='${t.fill||"#000000"}' />`)}return o+="</svg>",o},[s,t])}export{w as a,z as u};
|
package/dist/styles/index.mjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";import{b as a,a as s,v as e,e as r,d as t,p as l,u as o,h as d,j as i,g as n,o as g,s as h,m as k,c as y,l as w,n as G,q as C,f as b,i as m,r as u,z as c,t as f,x as p,k as x,w as B,y as R}from"../shared/shadows-
|
1
|
+
"use strict";import{b as a,a as s,v as e,e as r,d as t,p as l,u as o,h as d,j as i,g as n,o as g,s as h,m as k,c as y,l as w,n as G,q as C,f as b,i as m,r as u,z as c,t as f,x as p,k as x,w as B,y as R}from"../shared/shadows-Dhd7FrwF.mjs";export{a as black,s as blue,e as colors,r as darkBlue,t as darkGreen,l as darkGrey,o as darkGreyContrast,d as darkRed,i as darkYellow,n as green,g as grey,h as greyContrast,k as infoContrast,y as lightBlue,w as lightGreen,G as lightGrey,C as lightGreyContrast,b as lightRed,m as lightYellow,u as red,c as shadows,f as textDisabled,p as theme,x as warningContrast,B as white,R as yellow};
|
@@ -1,85 +1,82 @@
|
|
1
1
|
export declare const typography: {
|
2
|
+
htmlFontSize: number;
|
3
|
+
fontSize: number;
|
4
|
+
fontWeightLight: number;
|
5
|
+
fontWeightRegular: number;
|
6
|
+
fontWeightMedium: number;
|
7
|
+
fontWeightBold: number;
|
2
8
|
h1: {
|
3
|
-
fontSize: string;
|
4
9
|
fontWeight: number;
|
5
|
-
|
10
|
+
fontSize: string;
|
6
11
|
lineHeight: number;
|
7
12
|
};
|
8
13
|
h2: {
|
9
|
-
fontSize: string;
|
10
14
|
fontWeight: number;
|
11
|
-
|
15
|
+
fontSize: string;
|
12
16
|
lineHeight: number;
|
13
17
|
};
|
14
18
|
h3: {
|
15
|
-
fontSize: string;
|
16
19
|
fontWeight: number;
|
17
|
-
|
20
|
+
fontSize: string;
|
18
21
|
lineHeight: number;
|
19
22
|
};
|
20
23
|
h4: {
|
21
|
-
fontSize: string;
|
22
24
|
fontWeight: number;
|
23
|
-
|
25
|
+
fontSize: string;
|
24
26
|
lineHeight: number;
|
25
27
|
};
|
26
28
|
h5: {
|
27
|
-
fontSize: string;
|
28
29
|
fontWeight: number;
|
29
|
-
|
30
|
+
fontSize: string;
|
30
31
|
lineHeight: number;
|
31
32
|
};
|
32
33
|
h6: {
|
33
|
-
fontSize: string;
|
34
34
|
fontWeight: number;
|
35
|
-
|
35
|
+
fontSize: string;
|
36
|
+
lineHeight: number;
|
36
37
|
};
|
37
38
|
subtitle1: {
|
38
|
-
fontSize: string;
|
39
39
|
fontWeight: number;
|
40
|
-
|
40
|
+
fontSize: string;
|
41
41
|
lineHeight: number;
|
42
42
|
};
|
43
43
|
subtitle2: {
|
44
|
-
fontSize: string;
|
45
44
|
fontWeight: number;
|
46
|
-
|
45
|
+
fontSize: string;
|
47
46
|
lineHeight: number;
|
48
47
|
};
|
49
48
|
body1: {
|
50
|
-
fontSize: string;
|
51
49
|
fontWeight: number;
|
52
|
-
|
50
|
+
fontSize: string;
|
53
51
|
lineHeight: number;
|
54
52
|
};
|
55
53
|
body2: {
|
56
|
-
fontSize: string;
|
57
54
|
fontWeight: number;
|
58
|
-
|
55
|
+
fontSize: string;
|
59
56
|
lineHeight: number;
|
60
57
|
};
|
61
58
|
button: {
|
62
59
|
fontWeight: number;
|
63
|
-
|
60
|
+
fontSize: string;
|
64
61
|
lineHeight: number;
|
65
|
-
textTransform:
|
62
|
+
textTransform: any;
|
66
63
|
};
|
67
64
|
caption: {
|
68
|
-
fontSize: string;
|
69
65
|
fontWeight: number;
|
70
|
-
|
66
|
+
fontSize: string;
|
71
67
|
lineHeight: number;
|
72
68
|
};
|
73
69
|
overline: {
|
74
|
-
fontSize: string;
|
75
70
|
fontWeight: number;
|
76
|
-
|
71
|
+
fontSize: string;
|
77
72
|
lineHeight: number;
|
73
|
+
textTransform: any;
|
78
74
|
};
|
79
|
-
|
75
|
+
inherit: {
|
76
|
+
fontFamily: string;
|
77
|
+
fontWeight: string;
|
80
78
|
fontSize: string;
|
81
|
-
|
82
|
-
letterSpacing:
|
83
|
-
textTransform: "uppercase";
|
79
|
+
lineHeight: string;
|
80
|
+
letterSpacing: string;
|
84
81
|
};
|
85
82
|
};
|