stargazer-ui 1.0.4 → 1.0.6
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/cjs/components/Button/Button.d.ts +4 -0
- package/dist/cjs/components/Button/Button.types.d.ts +7 -0
- package/dist/cjs/components/Button/index.d.ts +1 -0
- package/dist/cjs/components/Card/Card.d.ts +34 -0
- package/dist/cjs/components/Card/Card.types.d.ts +24 -0
- package/dist/cjs/components/Card/index.d.ts +1 -0
- package/dist/{CloseButton/index.d.ts → cjs/components/CloseButton/CloseButton.d.ts} +1 -5
- package/dist/cjs/components/CloseButton/CloseButton.types.d.ts +5 -0
- package/dist/cjs/components/CloseButton/index.d.ts +1 -0
- package/dist/{Dropdown/index.d.ts → cjs/components/Dropdown/Dropdown.d.ts} +1 -54
- package/dist/cjs/components/Dropdown/Dropdown.types.d.ts +55 -0
- package/dist/cjs/components/Dropdown/index.d.ts +1 -0
- package/dist/cjs/components/FloatingLabel/FloatingLabel.d.ts +4 -0
- package/dist/cjs/components/FloatingLabel/FloatingLabel.types.d.ts +9 -0
- package/dist/cjs/components/FloatingLabel/index.d.ts +1 -0
- package/dist/cjs/components/Form/Form.d.ts +17 -0
- package/dist/cjs/components/Form/Form.types.d.ts +50 -0
- package/dist/cjs/components/Form/index.d.ts +1 -0
- package/dist/cjs/components/InputGroup/InputGroup.d.ts +6 -0
- package/dist/cjs/components/InputGroup/InputGroup.types.d.ts +10 -0
- package/dist/cjs/components/InputGroup/index.d.ts +1 -0
- package/dist/{Modal/index.d.ts → cjs/components/Modal/Modal.d.ts} +2 -32
- package/dist/cjs/components/Modal/Modal.types.d.ts +40 -0
- package/dist/cjs/components/Modal/index.d.ts +1 -0
- package/dist/{Nav/index.d.ts → cjs/components/Nav/Nav.d.ts} +0 -16
- package/dist/cjs/components/Nav/Nav.types.d.ts +17 -0
- package/dist/cjs/components/Nav/index.d.ts +1 -0
- package/dist/cjs/components/NavBar/Navbar.d.ts +20 -0
- package/dist/cjs/components/NavBar/Navbar.types.d.ts +18 -0
- package/dist/cjs/components/NavBar/index.d.ts +1 -0
- package/dist/{NavDropdown/index.d.ts → cjs/components/NavDropdown/NavDropdown.d.ts} +3 -7
- package/dist/cjs/components/NavDropdown/NavDropdown.types.d.ts +5 -0
- package/dist/cjs/components/NavDropdown/index.d.ts +1 -0
- package/dist/{Popout/index.d.ts → cjs/components/Popout/Popout.d.ts} +1 -35
- package/dist/cjs/components/Popout/Popout.types.d.ts +36 -0
- package/dist/cjs/components/Popout/index.d.ts +1 -0
- package/dist/{Spinner/index.d.ts → cjs/components/Spinner/Spinner.d.ts} +1 -7
- package/dist/cjs/components/Spinner/Spinner.types.d.ts +7 -0
- package/dist/cjs/components/Spinner/index.d.ts +1 -0
- package/dist/cjs/components/Table/Table.d.ts +4 -0
- package/dist/cjs/components/Table/Table.types.d.ts +7 -0
- package/dist/cjs/components/Table/index.d.ts +1 -0
- package/dist/cjs/components/Tabs/Tabs.d.ts +9 -0
- package/dist/{Tabs/index.d.ts → cjs/components/Tabs/Tabs.types.d.ts} +2 -9
- package/dist/cjs/components/Tabs/index.d.ts +1 -0
- package/dist/cjs/components/ToggleButton/ToggleButton.d.ts +9 -0
- package/dist/cjs/components/ToggleButton/index.d.ts +1 -0
- package/dist/cjs/components/index.d.ts +16 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/esm/BaseTypes.d.ts +19 -0
- package/dist/esm/components/Button/Button.d.ts +4 -0
- package/dist/esm/components/Button/Button.types.d.ts +7 -0
- package/dist/esm/components/Button/index.d.ts +1 -0
- package/dist/esm/components/Card/Card.d.ts +34 -0
- package/dist/esm/components/Card/Card.types.d.ts +24 -0
- package/dist/esm/components/Card/index.d.ts +1 -0
- package/dist/esm/components/CloseButton/CloseButton.d.ts +4 -0
- package/dist/esm/components/CloseButton/CloseButton.types.d.ts +5 -0
- package/dist/esm/components/CloseButton/index.d.ts +1 -0
- package/dist/esm/components/Dropdown/Dropdown.d.ts +71 -0
- package/dist/esm/components/Dropdown/Dropdown.types.d.ts +55 -0
- package/dist/esm/components/Dropdown/index.d.ts +1 -0
- package/dist/esm/components/FloatingLabel/FloatingLabel.d.ts +4 -0
- package/dist/esm/components/FloatingLabel/FloatingLabel.types.d.ts +9 -0
- package/dist/esm/components/FloatingLabel/index.d.ts +1 -0
- package/dist/esm/components/Form/Form.d.ts +17 -0
- package/dist/esm/components/Form/Form.types.d.ts +50 -0
- package/dist/esm/components/Form/index.d.ts +1 -0
- package/dist/esm/components/InputGroup/InputGroup.d.ts +6 -0
- package/dist/esm/components/InputGroup/InputGroup.types.d.ts +10 -0
- package/dist/esm/components/InputGroup/index.d.ts +1 -0
- package/dist/esm/components/Modal/Modal.d.ts +40 -0
- package/dist/esm/components/Modal/Modal.types.d.ts +40 -0
- package/dist/esm/components/Modal/index.d.ts +1 -0
- package/dist/esm/components/Nav/Nav.d.ts +30 -0
- package/dist/esm/components/Nav/Nav.types.d.ts +17 -0
- package/dist/esm/components/Nav/index.d.ts +1 -0
- package/dist/esm/components/NavBar/Navbar.d.ts +20 -0
- package/dist/esm/components/NavBar/Navbar.types.d.ts +18 -0
- package/dist/esm/components/NavBar/index.d.ts +1 -0
- package/dist/esm/components/NavDropdown/NavDropdown.d.ts +35 -0
- package/dist/esm/components/NavDropdown/NavDropdown.types.d.ts +5 -0
- package/dist/esm/components/NavDropdown/index.d.ts +1 -0
- package/dist/esm/components/Popout/Popout.d.ts +22 -0
- package/dist/esm/components/Popout/Popout.types.d.ts +36 -0
- package/dist/esm/components/Popout/index.d.ts +1 -0
- package/dist/esm/components/Spinner/Spinner.d.ts +4 -0
- package/dist/esm/components/Spinner/Spinner.types.d.ts +7 -0
- package/dist/esm/components/Spinner/index.d.ts +1 -0
- package/dist/esm/components/Table/Table.d.ts +4 -0
- package/dist/esm/components/Table/Table.types.d.ts +7 -0
- package/dist/esm/components/Table/index.d.ts +1 -0
- package/dist/esm/components/Tabs/Tabs.d.ts +9 -0
- package/dist/esm/components/Tabs/Tabs.types.d.ts +35 -0
- package/dist/esm/components/Tabs/index.d.ts +1 -0
- package/dist/esm/components/ToggleButton/ToggleButton.d.ts +9 -0
- package/dist/esm/components/ToggleButton/index.d.ts +1 -0
- package/dist/esm/components/index.d.ts +16 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/types.d.ts +470 -0
- package/package.json +15 -4
- package/dist/BaseTypes.js +0 -1
- package/dist/Button/index.d.ts +0 -9
- package/dist/Button/index.js +0 -6
- package/dist/Card/index.d.ts +0 -92
- package/dist/Card/index.js +0 -18
- package/dist/CloseButton/index.js +0 -6
- package/dist/Dropdown/index.js +0 -205
- package/dist/FloatingLabel/index.d.ts +0 -11
- package/dist/FloatingLabel/index.js +0 -13
- package/dist/Form/index.d.ts +0 -65
- package/dist/Form/index.js +0 -63
- package/dist/Grid/Col.js +0 -19
- package/dist/Grid/Container.js +0 -9
- package/dist/Grid/Row.js +0 -17
- package/dist/InputGroup/index.d.ts +0 -14
- package/dist/InputGroup/index.js +0 -8
- package/dist/Modal/index.js +0 -99
- package/dist/Nav/index.js +0 -13
- package/dist/NavBar/index.d.ts +0 -46
- package/dist/NavBar/index.js +0 -17
- package/dist/NavDropdown/index.js +0 -858
- package/dist/OffCanvas/OffCanvas.js +0 -2266
- package/dist/Overlay/index.js +0 -125
- package/dist/Popout/index.js +0 -72
- package/dist/Spinner/index.js +0 -9
- package/dist/Table/index.d.ts +0 -9
- package/dist/Table/index.js +0 -9
- package/dist/Tabs/index.js +0 -77
- package/dist/ToggleButton/index.js +0 -11
- package/dist/main.js +0 -30
- package/dist/stylesheets/stargazerui.css +0 -4902
- package/dist/stylesheets/stargazerui.css.map +0 -1
- package/dist/vite-env.d.js +0 -1
- /package/dist/{BaseTypes.d.ts → cjs/BaseTypes.d.ts} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{forwardRef as r,createContext as s,useState as o,useMemo as a,useEffect as l,useLayoutEffect as c,useContext as d,useRef as i,useCallback as u}from"react";import{createPortal as h}from"react-dom";const m=r((({children:t,variant:n="primary",className:r,...s},o)=>e("button",{ref:o,type:"button",className:`sg-button sg-button-${n}${null==r?"":" "+r}`,...s,children:t}))),f=r((({children:t,className:n,...r},s)=>e("div",{ref:s,className:"sg-card "+n,...r,children:t}))),p=r((({as:t="div",className:n,children:r,...s},o)=>{let a=["div","span","h1","h2","h3","h4","h5","h6"].find((e=>e===t))?t:"div";return e(a,{ref:o,className:`sg-card-header ${n}`,...s,children:r})})),g=r((({as:t="h5",className:n,children:r,...s},o)=>{let a=["h1","h2","h3","h4","h5","h6"].find((e=>e===t))?t:"h5";return e(a,{ref:o,className:n,...s,children:r})})),v=r((({children:t,className:n,...r},s)=>e("div",{ref:s,className:`sg-card-body ${n}`,...r,children:t}))),b=r((({children:t,className:n,...r},s)=>e("p",{ref:s,className:`sg-card-text ${n}`,...r,children:t}))),N=r((({children:t,className:n,...r},s)=>e("div",{ref:s,className:`sg-card-footer ${n}`,...r,children:t})));var w=Object.assign(f,{Header:p,Body:v,Title:g,Text:b,Footer:N});const y=r((({className:t,variant:n=!1,...r},s)=>e("button",{ref:s,className:`sg-button-close${n?" sg-button-close-white":""} ${t}`,...r,children:e("span",{className:"sg-close-visually-hidden-label",children:"Close"})}))),k=(e,t="")=>{let n=e.target,r=!0,s=!1;for(;r;)n.id!=t+"-menu"?n=n.parentElement:(s=!0,r=!1),"root"===n.id&&(r=!1,s=!1);return s},I=s(null),C=({children:t,value:n})=>e(I.Provider,{value:n,children:t}),x=()=>{const e=d(I);if(!e)throw new Error("useDropdownContext has to be used within DropdownContextProvider!");return e},T=r((({children:t,className:n,onSelect:r,onToggle:s,controlId:l,drop:c="down",align:d="start",autoClose:i=!0,show:u="default",...h},m)=>{const[f,p]=o("default"!==u&&u),[g,v]=o({case:""}),b=e=>{e.stopPropagation(),p((e=>!e))},N=((e,t,n=!1)=>{let r=e?n?"bottom-start":"bottom-end":n?"bottom-end":"bottom-start";return"up"===t?r=e?n?"top-start":"top-end":n?"top-end":"top-start":"end"===t?r=e?n?"left-end":"right-end":n?"left-start":"right-start":"start"===t?r=e?n?"right-end":"left-end":n?"right-start":"left-start":"down-centered"===t?r="bottom":"up-centered"===t&&(r="top"),r})("end"===d,c),w=a((()=>({align:d,drop:c,showInternal:"default"!=u&&s?u:f,handleToggle:"default"!=u&&s?s:b,placement:N,directionClasses:{down:"dropdown","down-centered":"dropdown-center",up:"dropup","up-centered":"dropup-center dropup",end:"dropend",start:"dropstart"},controlId:l,activeDescendant:g,setActiveDescendant:v})),[d,c,u,f,s,N,l,g,v]);return e("div",{id:l+"-wrapper",ref:m,className:"sg-dropdown"+(n?" "+n:""),...h,children:e(C,{value:w,children:t})})})),E=r((({children:t,className:n,navDropdown:r=!1,as:s="button",variant:o="primary",...a},c)=>{const{controlId:d,handleToggle:i,setActiveDescendant:u,showInternal:h}=x(),m=s,f=e=>{let t=!1;switch(console.log(e.key),e.key){case"ArrowDown":t=!0,h?u((e=>({...e,case:"next"}))):(i(e),u((e=>({...e,case:"first"}))));break;case"ArrowUp":t=!0,h?u((e=>({...e,case:"previous"}))):(i(e),u((e=>({...e,case:"last"}))));break;case"Home":t=!0,h&&u((e=>({...e,case:"first"})));break;case"End":t=!0,h&&u((e=>({...e,case:"last"})));break;case"Tab":h&&i(e);break;case"Escape":t=!0,h&&i(e);break;case"Enter":case" ":if(h){t=!0;document.querySelector(".sg-dropdown-item-visual-focus").click(),i(e);break}u((e=>({...e,case:"first"})))}t&&(e.stopPropagation(),e.preventDefault())},p=e=>{if(h&&e.target.id!==d)if(k(e,d)){if(k(e,d)){i(e);const t=document.getElementById(d);t?.focus()}}else i(e)};l((()=>{const e=document.getElementById(d);return e.addEventListener("keydown",f,!0),document.addEventListener("mouseup",p,!0),function(){e.removeEventListener("keydown",f,!0),document.removeEventListener("mouseup",p,!0)}}),[f,d]);let g=`sg-button sg-button${o?"-"+o:"-primary"} sg-dropdown-toggle${n?" "+n:""}`;return("a"===m||r)&&(g="sg-nav-dropdown-toggle sg-dropdown-toggle"+(n?" "+n:"")),e(m,{tabIndex:"0",type:"button","aria-haspopup":"true","aria-controls":d+"-menu","aria-expanded":h,id:d,ref:c,className:g,onClick:e=>(e=>{i(e),h||u((e=>({...e,case:"first"})))})(e),...a,children:t})})),$=r((({children:t,className:n,style:r={},...s},a)=>{const{controlId:d,showInternal:i,activeDescendant:u}=x(),[h,m]=o(r);c((()=>{if(i){const e=document.getElementById(d+"-menu");let t={};e.getBoundingClientRect().right>window.innerWidth?t={...t,right:0}:e.getBoundingClientRect().left<0?t={...t,left:0}:e.getBoundingClientRect().top<0?t={...t,top:0}:e.getBoundingClientRect().bottom>window.innerHeight&&(t={...t,bottom:0}),m((e=>({...e,...t})))}}),[i]),l((()=>{if(i){const e=document.getElementById(d+"-menu"),t=document.getElementById(d+"-menu").children,n=t.length-1,r=document.querySelector(".sg-dropdown-item-visual-focus");let s=0,o=t[0].children[0];if(null!=r){r.classList.remove("sg-dropdown-item-visual-focus");for(let e=0;e<t.length;e++)if(t[e]===r.parentElement){s=e;break}}switch(u.case){case"first":o=t[0].children[0],s=0;break;case"last":o=t[n].children[0],s=n;break;case"next":s=s===n?0:s+1,o=t[s].children[0];break;case"previous":s=0===s?n:s-1,o=t[s].children[0]}e.setAttribute("aria-activedescendant",o.id),t[s].children[0].classList.add("sg-dropdown-item-visual-focus")}else{document.getElementById(d+"-menu").setAttribute("aria-activedescendant","")}}),[d,i,u]);const f=e=>{const t=e.target;let n=t.classList.contains("sg-dropdown-item-visual-focus");const r=document.getElementById(d+"-menu");n||(document.querySelector(".sg-dropdown-item-visual-focus")?.classList.remove("sg-dropdown-item-visual-focus"),r.setAttribute("aria-activedescendant",""),t.classList.add("sg-dropdown-item-visual-focus"),r.setAttribute("aria-activedescendant",t.id))};return l((()=>{const e=document.getElementById(d+"-menu");for(let t of e.children)t.addEventListener("mouseover",f,!0);return function(){for(let t of e.children)t.removeEventListener("mouseover",f,!0)}}),[]),e("ul",{id:d+"-menu",role:"menu",tabIndex:-1,"aria-labelledby":d,ref:a,className:`sg-dropdown-list${n?" "+n:""}${i?" show":""}`,style:h,...s,children:t})})),L=r((({children:t,as:n="button",className:r,...s},o)=>e("li",{role:"none",children:e(n,{ref:o,role:"menuitem",tabIndex:"-1",className:"sg-dropdown-item"+(r?" "+r:""),...s,children:t})}))),D=r((({className:t="",...n},r)=>e("hr",{ref:r,className:`.sg-dropdown-divider${t}`,...n})));var B=Object.assign(T,{Toggle:E,Menu:$,Item:L,Divider:D});const P=s(null),S=({children:t,value:n})=>e(P.Provider,{value:n,children:t}),A=()=>{const e=d(P);if(!e)throw new Error("useFormContext has to be used within a FormContextProvider!");return e},H=r((({children:t,...n},r)=>e("form",{ref:r,...n,children:t}))),F=r((({as:t="input",className:n="",plaintext:r=!1,id:s="",type:o="text",autoFocus:a=!1,...l},c)=>{let d=t;const{controlId:i}=A();return e(d,{autoFocus:a,ref:c,id:i||s,type:o,className:(r?"sg-form-control-plaintext":"sg-form-control")+(""!=n?" "+n:"")+("color"==o?" sg-form-control-color":""),...l})})),j=r((({children:t,className:n,id:r,...s},o)=>{const{controlId:a}=A();return e("select",{ref:o,className:"sg-form-select"+(n?" "+n:""),id:a||r,...s,children:t})})),M=r((({children:t,className:n,controlId:r,...s},o)=>{const l=a((()=>({controlId:r})),[r]);return e("div",{ref:o,className:"sg-from-group"+(n?" "+n:""),...s,children:e(S,{value:l,children:t})})})),O=r((({children:t,className:n,htmlFor:r},s)=>{const{controlId:o}=A();return e("label",{ref:s,htmlFor:r||o,className:"sg-form-label"+(n?" "+n:""),children:t})})),R=r((({classNameContainer:r,containerRef:s,containerId:o,style:a,classNameLabel:l,labelRef:c,label:d,labelId:i,className:u,type:h,id:m,controlId:f,reverse:p=!1,checkStyle:g,...v},b)=>{let N=f||m,w="switch"===h?"checkbox":h;return e("div",{ref:s,id:o,style:a,className:`sg-form-check${p?"-reverse":""}${r?" "+r:""}${"switch"===h?" sg-form-switch":""}`,children:t(n,p?{children:[e("input",{ref:b,type:w,id:N,className:"sg-form-check-input"+(u?" "+u:""),...v}),e("label",{ref:c,id:i,htmlFor:N,className:"sg-form-check-label"+(l?" "+l:""),children:d})]}:{children:[e("label",{ref:c,id:i,htmlFor:N,className:"sg-form-check-label"+(l?" "+l:""),children:d}),e("input",{ref:b,type:w,id:N,className:"sg-form-check-input"+(u?" "+u:""),style:g,...v})]})})})),q=r((({children:t,className:n,...r},s)=>e("small",{ref:s,className:"sg-form-text"+(n?" "+n:""),...r,children:t})));var z=Object.assign(H,{Control:F,Select:j,Group:M,Label:O,Check:R,Text:q});const W=r((({children:n,label:r,controlId:s,className:o,htmlFor:l,...c},d)=>{const i=a((()=>({controlId:s})),[s]);return e(S,{value:i,children:t("div",{className:"sg-form-floating",children:[n,e("label",{ref:d,htmlFor:s,className:"sg-form-floating-label",...c,children:r})]})})})),X=r((({children:t,className:n,...r},s)=>e("div",{ref:s,className:"sg-input-group"+(n?" "+n:""),...r,children:t}))),Y=r((({children:t,className:n,...r},s)=>e("span",{ref:s,className:"sg-input-group-text"+(n?" "+n:""),...r,children:t})));var K=Object.assign(X,{Text:Y});const G=s(null),U=({children:t,value:n})=>e(G.Provider,{value:n,children:t}),J=r((({children:n,as:r="",className:s="",closeButton:o=!1,onClick:a,...l},c)=>{let i=["div","span","h1","h2","h3","h4","h5","h6"].find((e=>e===r))?r:"div";const u=(()=>{const e=d(G);if(!e)throw new Error("useModalContext has to be used within ModalContextProvider!");return e})();return t(i,{ref:c,className:`sg-modal-header ${s}`,...l,children:[n,o?e(y,{variant:!0,onClick:e=>(e=>{a&&a(e),u()})(e)}):null]})})),Q=r((({children:t,as:n="h4",className:r,...s},o)=>{let a=["div","span","h1","h2","h3","h4","h5","h6"].find((e=>e===n))?n:"h4";return e(a,{ref:o,className:`sg-modal-title ${r}`,...s,children:t})})),V=r((({children:t,className:n,...r},s)=>e("div",{ref:s,className:`sg-modal-body ${n}`,...r,children:t}))),Z=r((({children:t,className:n,...r},s)=>e("div",{ref:s,className:`sg-modal-footer ${n}`,...r,children:t})));var _=Object.assign((({children:t,centered:n=!1,size:r="md",show:s,backdrop:a="static",onHide:c,className:d,id:u,...m})=>{const[f,p]=o(s);l((()=>{p(s)}),[s]);const g=i(null);ee(g);let v="boolean"==typeof s&&"function"==typeof c?void 0:{show:"boolean"==typeof s,onHide:"function"==typeof c};v&&console.error(v.show?null:"The variable 'show' must be used and must be a boolean used to decide when to show the modal!",v.onHide?null:"The variable 'onHide' must be used and must be a function which is used to set 'show' as the modal gets closed!");const b=()=>{c&&c(),p(!1)};l((()=>{const e=g.current;e&&(f?(e.classList.remove("close"),e.showModal()):e.close())}),[f]);let N=`sg-modal-tag sg-modal-${r}`;d&&(N+=" "+d),"static"!==a&&"true"!==a||(N+=" sg-modal-static");return h(e("dialog",{ref:g,className:N,onKeyDown:e=>(e=>{if("Escape"!=e.key)return;e.preventDefault();const t=g.current;t.classList.add("close"),t.addEventListener("animationend",(()=>{b()}),{once:!0})})(e),...m,children:e(U,{value:c,children:v?e(te,{typeCheck:v,closeModal:b}):t})}),document.body)}),{Header:J,Title:Q,Body:V,Footer:Z});const ee=function(e){l((()=>{const t=t=>{const n='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',r=e.current;if(r){const e=r.querySelectorAll(n)[0],s=r.querySelectorAll(n),o=s[s.length-1];if(!("Tab"===t.key))return;t.shiftKey?document.activeElement===e&&(o.focus(),t.preventDefault()):document.activeElement===o&&(e.focus(),t.preventDefault())}};return document.addEventListener("keydown",t,!0),function(){document.removeEventListener("keydown",t,!0)}}),[e])},te=({typeCheck:r,closeModal:s})=>t(n,{children:[e(J,{closeButton:!0,children:e(Q,{children:"An Error ocurred!"})}),e(V,{children:t("p",{children:[r.show?null:"The variable 'show' must be used and must be a boolean used to decide when to show the modal!",r.onHide?null:"The variable 'onHide' must be used and must be a function which is used to set 'show' as the modal gets closed!"]})}),e(Z,{children:e(m,{variant:"danger",type:"button",onClick:()=>s(),children:"Close"})})]}),ne=s(null),re=({children:t,value:n})=>e(ne.Provider,{value:n,children:t}),se=r((({children:t,className:n,navbarPrefix:r="sg-navbar-",...s},o)=>{const l=a((()=>r),[r]);return e("nav",{ref:o,className:"sg-navbar"+(n?" "+n:""),...s,children:e(re,{value:l,children:t})})})),oe=r((({children:t,className:n,href:r="#",as:s="a",...o},a)=>e(s||(r&&"Link"!=s?"a":"span"),{ref:a,href:r,className:"sg-navbar-brand"+(n?" "+n:""),...o,children:t}))),ae=r((({children:t,className:n,as:r="span",...s},o)=>e(r,{ref:o,className:"sg-navbar-text"+(n?" "+n:""),...s,children:t})));var le=Object.assign(se,{Brand:oe,Text:ae});const ce=r((({children:t,className:n,as:r="ul",...s},o)=>{const a=r,l=d(ne);return e(a,{ref:o,className:`${n} ${l||"sg-navbar-"}nav`,...s,children:t})})),de=r((({children:t,className:n,as:r="li",...s},o)=>e(r,{role:"none",ref:o,className:"sg-nav-item"+(n?" "+n:""),...s,children:t}))),ie=r((({children:t,className:n,as:r="a",...s},o)=>e(r,{role:"menuitem",ref:o,className:"sg-nav-link"+(n?" "+n:""),...s,children:t})));var ue=Object.assign(ce,{Item:de,Link:ie});const he=r((({children:n,className:r,onSelect:s,onToggle:l,controlId:c,toggleProps:d,title:i,menuProps:h,drop:m="down",align:f="start",autoClose:p=!0,show:g="default",...v},b)=>{const[N,w]=o("default"!==g&&g),[y,k]=o({case:""}),I=u((e=>{e.stopPropagation(),w((e=>!e))}),[]),x=((e,t,n=!1)=>{let r=e?n?"bottom-start":"bottom-end":n?"bottom-end":"bottom-start";return"up"===t?r=e?n?"top-start":"top-end":n?"top-end":"top-start":"end"===t?r=e?n?"left-end":"right-end":n?"left-start":"right-start":"start"===t?r=e?n?"right-end":"left-end":n?"right-start":"left-start":"down-centered"===t?r="bottom":"up-centered"===t&&(r="top"),r})("end"===f,m),T=c,E=a((()=>({align:f,drop:m,showInternal:"default"!=g&&l?g:N,handleToggle:"default"!=g&&l?l:I,placement:x,directionClasses:{down:"dropdown","down-centered":"dropdown-center",up:"dropup","up-centered":"dropup-center dropup",end:"dropend",start:"dropstart"},controlId:T,activeDescendant:y,setActiveDescendant:k})),[f,m,g,N,l,I,x,{down:"dropdown","down-centered":"dropdown-center",up:"dropup","up-centered":"dropup-center dropup",end:"dropend",start:"dropstart"},c,y,k]);return e("div",{ref:b,id:c+"-wrapper",className:`sg-dropdown${r?" "+r:""} sg-nav-item`,...v,children:t(C,{value:E,children:[e(B.Toggle,{navDropdown:!0,...d,children:i}),e(B.Menu,{...h,children:n})]})})}));var me=Object.assign(he,{Toggle:B.Toggle,Menu:B.Menu,Item:B.Item,Divider:B.Divider});const fe=r((({children:t,initialPosition:n={top:0,left:0},id:r,resize:s=!1,move:a=!1,className:c,style:d,...u},m)=>{const[f,p]=o({offSetTop:0,offSetLeft:0,...n}),g=s?"true":"false",v=a?"true":"false",b=i(m),N=i(null),[w,y]=o(!1),k=i(w);l((()=>{k.current=w}),[w]);const I=()=>{a&&(N.current.style.removeProperty("user-select"),y(!1))};return l((()=>(document.body.addEventListener("pointerup",(()=>I()),!0),function(){document.body.removeEventListener("pointerup",(()=>I()),!0)})),[]),h(e("dialog",{"data-resize":g,"data-move":v,"data-passedRef":b,ref:N,id:r,className:"sg-moveable-popout"+(c?" "+c:""),style:{...d,top:f.top,left:f.left,bottom:f.bottom,right:f.right},onPointerDown:e=>{const t=e.target;if(a&&t.className.includes("sg-popout-title")||t.className.includes("sg-popout-header")){const{top:t,left:n}=N.current.getBoundingClientRect();p((r=>({...r,offSetTop:e.clientY-t,offSetLeft:e.clientX-n}))),N.current.style.setProperty("user-select","none"),N.current.setPointerCapture(e.pointerId),y(!0)}},onPointerMove:e=>(e=>{if(a&&k.current&&N.current){const t=e.clientY-f.offSetTop<0,n=window.innerHeight-(e.clientY-f.offSetTop+N.current.offsetHeight)<0,r=e.clientX-f.offSetLeft<0,s=window.innerWidth-(e.clientX-f.offSetLeft+N.current.offsetWidth)<0;let o=t?0:e.clientY-f.offSetTop;o=n?window.innerHeight-N.current.offsetHeight:o;let a=r?0:e.clientX-f.offSetLeft;a=s?window.innerWidth-N.current.offsetWidth:a,p((e=>({...e,top:o,left:a})))}})(e),...u,children:t}),document.body)})),pe=r((({children:t,className:n,as:r="div",...s},o)=>{let a=["div","span","h1","h2","h3","h4","h5","h6"].find((e=>e===r))?r:"div";return e(a,{ref:o,className:`sg-popout-header ${n}`,...s,children:t})})),ge=r((({as:t="h4",className:n,children:r,...s},o)=>{let a=["h1","h2","h3","h4","h5","h6"].find((e=>e===t))?t:"h5";return e(a,{ref:o,className:`sg-popout-title ${n}`,...s,children:r})})),ve=r((({children:t,className:n,...r},s)=>e("div",{ref:s,className:`sg-popout-body ${n}`,...r,children:t}))),be=r((({children:t,className:n,...r},s)=>e("p",{ref:s,className:`sg-popout-text ${n}`,...r,children:t}))),Ne=r((({children:t,className:n,...r},s)=>e("div",{ref:s,className:`sg-popout-footer ${n}`,...r,children:t})));var we=Object.assign(fe,{Header:pe,Title:ge,Body:ve,Text:be,Footer:Ne});const ye=r((({size:r="1em",color:s="white",label:o,className:a,controlId:l,...c},d)=>t(n,{children:[e("div",{"aria-labelledby":l,role:"status",ref:d,className:"sg-spinner"+(a?" "+a:""),style:{width:r,height:r,borderColor:s},...c}),e("label",{id:l,className:"sg-visually-hidden",children:o})]}))),ke=r((({children:t,size:n="lg",className:r,...s},o)=>e("table",{ref:o,className:`sg-table${r?" "+r:""}${"sm"===n?" sg-table-sm":""}`,...s,children:t}))),Ie=s(null),Ce=({children:t,value:n})=>e(Ie.Provider,{value:n,children:t}),xe=()=>{const e=d(Ie);if(!e)throw new Error("useTabContext has to be used within a TabContextProvider!");return e},Te=r((({children:t,className:n,controlId:r,activeClassName:s,defaultActive:l,...c},d)=>{const[i,u]=o(l),h=s||"sg-active",m=a((()=>({activeTab:i,setActiveTab:u,controlId:r,activeClass:h})),[i,u,r]);return e(Ce,{value:m,children:e("div",{ref:d,id:r+"-tab-wrapper",className:"sg-tabs"+(n?" "+n:""),...c,children:t})})})),Ee=r((({children:t,className:n,...r},s)=>{const{controlId:o,activeClass:a}=xe();return e("div",{onKeyDown:e=>(e=>{const t=e.key,n=document.getElementById(o+"-tab-controls");if(n){const r=Array.from(n.children);if("ArrowRight"===t||"ArrowLeft"===t){e.preventDefault();const n=document.querySelector(".sg-tabs-button."+a),s=r.indexOf(n),o="ArrowRight"===t?1:-1,l=s+o<0?r.length-1:s+o>=r.length?0:s+o;r[l].focus(),r[l].click()}else if("Home"===t||"End"===t){e.preventDefault();const n="Home"===t?0:r.length-1;r[n].focus(),r[n].click()}}})(e),role:"tablist",id:o+"-tab-controls",ref:s,className:"sg-tabs-controls"+(n?" "+n:""),...r,children:t})})),$e=r((({children:t,className:n,onClick:r,tabId:s,id:o,...a},l)=>{const{activeTab:c,setActiveTab:d,activeClass:i}=xe(),u=c===s;return e("button",{role:"tab",type:"button",id:s+"-button",ref:l,onClick:e=>(e=>{d(s),r&&r(e)})(e),className:"sg-tabs-button"+(n?" "+n:"")+(c===s?" "+i:""),...a,tabIndex:u?0:-1,"aria-selected":u?"true":"false","aria-controls":s+"-page",children:t})})),Le=r((({children:t,className:n,...r},s)=>e("div",{role:"none",ref:s,className:"sg-tabs-content"+(n?" "+n:""),...r,children:t}))),De=r((({children:t,className:n,tabId:r,...s},o)=>{const{activeTab:a,activeClass:l}=xe();return e("div",{role:"tabpanel",id:r+"-page","aria-labelledby":r+"-button",ref:o,className:"sg-tabs-page"+(n?" "+n:"")+(a===r?" "+l:""),...s,children:t})}));var Be=Object.assign(Te,{Controls:Ee,Button:$e,Content:Le,Page:De});const Pe=r((({children:t,toggled:n="false",onClick:r,...s},a)=>{const[l,c]=o("true"===n);return e("button",{onClick:e=>(e=>{c((e=>!e)),r&&r(e)})(e),"data-toggled":l,...s,children:t})}));export{m as Button,w as Card,y as CloseButton,B as Dropdown,W as FloatingLabel,z as Form,K as InputGroup,_ as Modal,ue as Nav,le as NavBar,me as NavDropdown,we as Popout,ye as Spinner,ke as Table,Be as Tabs,Pe as ToggleButton};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/components/Button/Button.tsx","../../src/components/Card/Card.tsx","../../src/components/CloseButton/CloseButton.tsx","../../src/components/Dropdown/Dropdown.tsx","../../src/components/Form/Form.tsx","../../src/components/FloatingLabel/FloatingLabel.tsx","../../src/components/InputGroup/InputGroup.tsx","../../src/components/Modal/Modal.tsx","../../src/components/NavBar/Navbar.tsx","../../src/components/Nav/Nav.tsx","../../src/components/NavDropdown/NavDropdown.tsx","../../src/components/Popout/Popout.tsx","../../src/components/Spinner/Spinner.tsx","../../src/components/Table/Table.tsx","../../src/components/Tabs/Tabs.tsx","../../src/components/ToggleButton/ToggleButton.tsx"],"sourcesContent":["import { forwardRef } from \"react\"\r\n\r\nimport {ButtonType} from \"./Button.types\"\r\n\r\nconst Button = forwardRef<HTMLButtonElement, ButtonType>( ({children, variant=\"primary\", className, ...rest}, ref) => {\r\n //let variants = [\"primary\", \"secondary\", \"success\", \"info\", \"warning\", \"danger\", \"dark\", \"light\"] //[\"red\", \"blue\", \"yellow\", \"green\", \"purple\"]\r\n // let variantTest = variants.find(variantTest => variantTest === variant) ? variant : \"primary\"\r\n return(\r\n <button ref={ref} type=\"button\" className={`sg-button sg-button-${variant}${className == undefined ? \"\" : \" \"+className}`} {...rest}>\r\n {children}\r\n </button>\r\n )\r\n} )\r\n\r\nexport default Button\r\n","import React, { forwardRef } from \"react\"\r\n\r\nimport { CardBodyType, CardFooterType, CardHeaderType, CardTextType, CardType } from \"./Card.types\"\r\n\r\nconst Card = forwardRef<HTMLDivElement, CardType>( ({children, className, ...restProps}, ref) => {\r\n /*\r\n let subComponentList = Object.keys(Card);\r\n let subComponents = []\r\n let childs = children.length === undefined ? children : children.filter(child => child != null && child != \"\")\r\n \r\n subComponentList.forEach((key) => {\r\n React.Children.forEach(childs, (child) => (\r\n child.type.name === key ? subComponents.push(child) : null\r\n ))\r\n })\r\n if(subComponents.length === 0) {\r\n subComponents = [childs]\r\n }\r\n */\r\n //console.log(subComponents)\r\n\r\n return (\r\n <div ref={ref} className={\"sg-card\" + \" \" + className} {...restProps}>\r\n {children}\r\n </div>\r\n )\r\n})\r\n\r\nconst Header = forwardRef<HTMLDivElement | HTMLHeadingElement | HTMLSpanElement, CardHeaderType>( ({as=\"div\", className, children, ...restProps}, ref) => {\r\n let validAs = [\"div\", \"span\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\"]\r\n let Component = validAs.find(valid => valid === as) ? as : \"div\"\r\n\r\n return (\r\n <Component ref={ref} className={`sg-card-header ${className}`} {...restProps}>\r\n {children}\r\n </Component>\r\n )\r\n})\r\n\r\nconst Title = forwardRef<HTMLHeadingElement, CardHeaderType>(({as=\"h5\", className, children, ...restProps}, ref) => {\r\n let validAs = [\"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\"]\r\n let Component = validAs.find(valid => valid === as) ? as : \"h5\"\r\n return (\r\n <Component ref={ref} className={className} {...restProps}>\r\n {children}\r\n </Component>\r\n )\r\n})\r\n\r\nconst Body = forwardRef<HTMLDivElement, CardBodyType>( ({children, className, ...restProps}, ref) => {\r\n /*\r\n children = children.length ? children.filter(child => child != null && child != \"\") : children\r\n let subComponents = []\r\n React.Children.forEach(children, (child) => {\r\n subComponents.push(child)\r\n })\r\n */\r\n return (\r\n <div ref={ref} className={`sg-card-body ${className}`} {...restProps}>\r\n {children}\r\n </div>\r\n )\r\n})\r\n\r\nconst Text = forwardRef<HTMLParagraphElement, CardTextType>( ({children, className, ...restProps}, ref) => {\r\n return (\r\n <p ref={ref} className={`sg-card-text ${className}`} {...restProps}>\r\n {children}\r\n </p>\r\n )\r\n})\r\n\r\nconst Footer = forwardRef<HTMLDivElement, CardFooterType>( ({children, className, ...restProps}, ref) => {\r\n return (\r\n <div ref={ref} className={`sg-card-footer ${className}`} {...restProps}>\r\n {children}\r\n </div>\r\n )\r\n})\r\n\r\nexport default Object.assign(Card, {\r\n Header: Header,\r\n Body: Body,\r\n Title: Title,\r\n Text: Text,\r\n Footer: Footer\r\n})","import { forwardRef } from \"react\"\r\n\r\nimport { CloseButtonType } from \"./CloseButton.types\"\r\n\r\nconst CloseButton = forwardRef<HTMLButtonElement, CloseButtonType>( ({className, variant = false, ...restProps}, ref) => {\r\n return (\r\n <button ref={ref} className={`sg-button-close${variant ? \" sg-button-close-white\" : \"\"} ${className}`} {...restProps}>\r\n <span className=\"sg-close-visually-hidden-label\">Close</span>\r\n </button>\r\n )\r\n})\r\n\r\nexport default CloseButton","import React, { createContext, forwardRef, useContext, useEffect, useLayoutEffect, useMemo, useState } from \"react\";\r\nimport { DropdownContextType, DropdownItemType, DropdownDividerType, DropdownMenuType, DropdownToggleType, DropdownType } from \"./Dropdown.types\";\r\n//automatic menu placement function\r\nconst getDropdownMenuPlacement = (alignEnd:boolean, dropDirection:string, isRTL:boolean=false) => {\r\n const topStart = isRTL ? 'top-end' : 'top-start';\r\n const topEnd = isRTL ? 'top-start' : 'top-end';\r\n const bottomStart = isRTL ? 'bottom-end' : 'bottom-start';\r\n const bottomEnd = isRTL ? 'bottom-start' : 'bottom-end';\r\n const leftStart = isRTL ? 'right-start' : 'left-start';\r\n const leftEnd = isRTL ? 'right-end' : 'left-end';\r\n const rightStart = isRTL ? 'left-start' : 'right-start';\r\n const rightEnd = isRTL ? 'left-end' : 'right-end';\r\n let placement = alignEnd ? bottomEnd : bottomStart;\r\n if (dropDirection === 'up') \r\n {\r\n placement = alignEnd ? topEnd : topStart\r\n }\r\n else if (dropDirection === 'end') {\r\n placement = alignEnd ? rightEnd : rightStart\r\n } else if (dropDirection === 'start') {\r\n placement = alignEnd ? leftEnd : leftStart\r\n } else if (dropDirection === 'down-centered') {\r\n placement = 'bottom'\r\n } else if (dropDirection === 'up-centered') {\r\n placement = 'top'\r\n }\r\n return placement;\r\n}\r\n// is click event on the menu\r\nconst isEventOnMenu = (event:MouseEvent, controlId:string = \"\") => {\r\n let element = event.target as HTMLElement\r\n let condition = true\r\n let eventIsOnMenu = false\r\n while(condition) {\r\n if(element.id != controlId+\"-menu\") {\r\n element = element.parentElement as HTMLElement\r\n }\r\n else {\r\n eventIsOnMenu = true\r\n condition = false\r\n }\r\n\r\n\r\n if(element.id === \"root\") {\r\n condition = false\r\n eventIsOnMenu = false\r\n }\r\n }\r\n return eventIsOnMenu\r\n}\r\n\r\nexport const DropdownContext = createContext<DropdownContextType | null>(null)\r\nexport const DropdownContextProvider = ({children, value}:{children: React.ReactNode, value:DropdownContextType}) => {\r\n return (\r\n <DropdownContext.Provider value={value}>\r\n {children}\r\n </DropdownContext.Provider>\r\n )\r\n}\r\nexport const useDropdownContext = () => {\r\n const context = useContext(DropdownContext)\r\n if(!context) {\r\n throw new Error(\r\n \"useDropdownContext has to be used within DropdownContextProvider!\"\r\n )\r\n }\r\n return context\r\n}\r\n\r\n\r\nconst Dropdown = forwardRef<HTMLDivElement, DropdownType>((\r\n {\r\n children, className, onSelect, onToggle, controlId,\r\n drop=\"down\", align=\"start\", autoClose=true, show=\"default\", ...restProps\r\n }, ref) => {\r\n \r\n const [showInternal, setShowInternal] = useState<boolean>(show === \"default\" ? false : show as boolean)\r\n\r\n // this is an object like {index: string} because we need it to rerender even if the case is the same\r\n // aka we use a \"next/previous\" case to navigate through the dropdown menu so need to rerender consecutive \"next\" cases\r\n const [activeDescendant, setActiveDescendant] = useState<{case:string}>({case:\"\"})\r\n\r\n const internalOnToggle = (event: MouseEvent) => {\r\n event.stopPropagation()\r\n setShowInternal(prev => !prev)\r\n }\r\n\r\n const alignEnd = align === \"end\"\r\n const placement = getDropdownMenuPlacement(alignEnd, drop )\r\n \r\n const contextValue = useMemo(() => ({\r\n align, \r\n drop, \r\n showInternal: show != \"default\" && onToggle ? show as boolean : showInternal, \r\n handleToggle: show != \"default\" && onToggle ? onToggle : internalOnToggle, \r\n placement, \r\n directionClasses: {\r\n down: \"dropdown\",\r\n 'down-centered': `dropdown-center`,\r\n up: 'dropup',\r\n 'up-centered': 'dropup-center dropup',\r\n end: 'dropend',\r\n start: 'dropstart'\r\n },\r\n controlId: controlId, \r\n activeDescendant, \r\n setActiveDescendant\r\n }), [align, drop, show, showInternal, onToggle, placement, controlId, activeDescendant, setActiveDescendant])\r\n \r\n return (\r\n <div id={controlId+\"-wrapper\"} ref={ref} className={`sg-dropdown${className? \" \"+className:\"\"}`} {...restProps} >\r\n <DropdownContextProvider value={contextValue}>\r\n {children}\r\n </DropdownContextProvider>\r\n </div>\r\n )\r\n})\r\n\r\n\r\nexport const Toggle = forwardRef<HTMLAnchorElement | HTMLButtonElement, DropdownToggleType>( ({children, className, navDropdown=false, as=\"button\", variant=\"primary\", ...restProps}, ref) => {\r\n const { controlId, handleToggle, setActiveDescendant, showInternal } = useDropdownContext()\r\n const Component = as\r\n const handleKeyPress = (event: KeyboardEvent) => {\r\n let flag = false\r\n console.log(event.key)\r\n switch (event.key) {\r\n case \"ArrowDown\":\r\n flag = true\r\n if(showInternal) {\r\n setActiveDescendant(prev => ({...prev, case:\"next\"}))\r\n }\r\n else {\r\n handleToggle(event)\r\n setActiveDescendant(prev => ({...prev, case:\"first\"}))\r\n }\r\n break\r\n case \"ArrowUp\":\r\n flag = true\r\n if(showInternal) {\r\n setActiveDescendant(prev => ({...prev, case:\"previous\"}))\r\n } else {\r\n handleToggle(event)\r\n setActiveDescendant(prev => ({...prev, case:\"last\"}))\r\n }\r\n break\r\n case \"Home\":\r\n flag = true\r\n if(showInternal) {\r\n setActiveDescendant(prev => ({...prev, case:\"first\"}))\r\n }\r\n break\r\n case \"End\":\r\n flag = true\r\n if(showInternal) {\r\n setActiveDescendant(prev => ({...prev, case:\"last\"}))\r\n }\r\n break\r\n case \"Tab\":\r\n if(showInternal) {\r\n handleToggle(event)\r\n }\r\n break\r\n case \"Escape\":\r\n flag = true\r\n if(showInternal) {\r\n handleToggle(event)\r\n }\r\n break\r\n case \"Enter\":\r\n case \" \":\r\n if(showInternal) {\r\n flag = true\r\n const activeElement = document.querySelector(\".sg-dropdown-item-visual-focus\") as HTMLElement\r\n activeElement.click()\r\n handleToggle(event)\r\n break\r\n }\r\n else {\r\n setActiveDescendant(prev => ({...prev, case:\"first\"}))\r\n break\r\n }\r\n }\r\n if(flag) {\r\n event.stopPropagation()\r\n event.preventDefault()\r\n }\r\n }\r\n const handleClick = (event: MouseEvent) => {\r\n if(!showInternal) return\r\n if((event.target as HTMLElement).id === controlId) return\r\n\r\n if(!isEventOnMenu(event, controlId)) {\r\n handleToggle(event)\r\n }\r\n else if(isEventOnMenu(event, controlId)) {\r\n handleToggle(event)\r\n const toggleElement: HTMLElement | null = document.getElementById(controlId)\r\n toggleElement?.focus()\r\n }\r\n }\r\n useEffect(() => {\r\n const toggleElement: HTMLElement = document.getElementById(controlId) as HTMLElement\r\n toggleElement.addEventListener(\"keydown\", handleKeyPress, true)\r\n document.addEventListener(\"mouseup\", handleClick, true)\r\n return function cleanup() {\r\n toggleElement.removeEventListener(\"keydown\", handleKeyPress, true)\r\n document.removeEventListener(\"mouseup\", handleClick, true)\r\n }\r\n }, [handleKeyPress, controlId])\r\n\r\n const toggleButtonClick = (event: MouseEvent) => {\r\n handleToggle(event)\r\n if(!showInternal) {\r\n setActiveDescendant(prev => ({...prev, case:\"first\"}))\r\n }\r\n }\r\n let classNamesComputed = `sg-button sg-button${variant ? \"-\"+variant:\"-primary\"} sg-dropdown-toggle${className ? \" \"+className:\"\"}`\r\n if (Component === \"a\" || navDropdown) {\r\n classNamesComputed = `sg-nav-dropdown-toggle sg-dropdown-toggle${className ? \" \"+className:\"\"}`\r\n }\r\n return (\r\n <Component tabIndex=\"0\" type=\"button\" aria-haspopup=\"true\" aria-controls={controlId+\"-menu\"} aria-expanded={showInternal} id={controlId}\r\n ref={ref} className={classNamesComputed} \r\n onClick={(event: MouseEvent) => toggleButtonClick(event)} {...restProps}\r\n >\r\n {children}\r\n </Component>\r\n )\r\n})\r\n\r\n\r\nexport const Menu = forwardRef<HTMLUListElement, DropdownMenuType>( ({children, className, style = {}, ...restProps}, ref) => {\r\n const { controlId, showInternal, activeDescendant } = useDropdownContext()\r\n const [ computedStyle, setComputedStyle ] = useState(style)\r\n useLayoutEffect(() => {\r\n if(showInternal) {\r\n const menu = document.getElementById(controlId+\"-menu\") as HTMLElement\r\n let tempComputedStyle = {}\r\n if(menu.getBoundingClientRect().right > window.innerWidth) {\r\n tempComputedStyle = {...tempComputedStyle, right:0}\r\n } else if(menu.getBoundingClientRect().left < 0) {\r\n tempComputedStyle = {...tempComputedStyle, left:0}\r\n } else if(menu.getBoundingClientRect().top < 0) {\r\n tempComputedStyle = {...tempComputedStyle, top:0}\r\n } else if(menu.getBoundingClientRect().bottom > window.innerHeight) {\r\n tempComputedStyle = {...tempComputedStyle, bottom:0}\r\n }\r\n setComputedStyle(prev => ({...prev, ...tempComputedStyle}))\r\n }\r\n }, [showInternal])\r\n \r\n useEffect(() => {\r\n if(showInternal) {\r\n const menu = document.getElementById(controlId+\"-menu\") as HTMLElement\r\n const menuChildren = document.getElementById(controlId+\"-menu\")!.children\r\n const menuChildrenLast = menuChildren.length - 1\r\n const elementWithVisualFocus = document.querySelector(\".sg-dropdown-item-visual-focus\")\r\n let currentIndex = 0, currentChild = menuChildren[0].children[0]\r\n if(elementWithVisualFocus != null) {\r\n elementWithVisualFocus.classList.remove(\"sg-dropdown-item-visual-focus\")\r\n for(let i=0; i<menuChildren.length; i++) {\r\n if(menuChildren[i] === elementWithVisualFocus.parentElement) {\r\n currentIndex = i\r\n break\r\n }\r\n }\r\n }\r\n switch (activeDescendant.case) {\r\n case \"first\":\r\n currentChild = menuChildren[0].children[0]\r\n currentIndex = 0\r\n break\r\n case \"last\":\r\n currentChild = menuChildren[menuChildrenLast].children[0]\r\n currentIndex = menuChildrenLast\r\n break\r\n case \"next\":\r\n currentIndex = currentIndex === menuChildrenLast ? 0 : currentIndex + 1\r\n currentChild = menuChildren[currentIndex].children[0]\r\n break\r\n case \"previous\":\r\n currentIndex = currentIndex === 0 ? menuChildrenLast : currentIndex - 1\r\n currentChild = menuChildren[currentIndex].children[0]\r\n break\r\n }\r\n menu.setAttribute(\"aria-activedescendant\", currentChild.id)\r\n menuChildren[currentIndex].children[0].classList.add(\"sg-dropdown-item-visual-focus\")\r\n } else {\r\n const menu = document.getElementById(controlId+\"-menu\") as HTMLElement\r\n menu.setAttribute(\"aria-activedescendant\", \"\")\r\n }\r\n }, [controlId, showInternal, activeDescendant])\r\n\r\n const handleMouseOver = (event: MouseEvent) => {\r\n const target = event.target as HTMLElement\r\n let active=target.classList.contains(\"sg-dropdown-item-visual-focus\")\r\n const menu = document.getElementById(controlId+\"-menu\") as HTMLElement\r\n if(active) {\r\n return\r\n } else {\r\n document.querySelector(\".sg-dropdown-item-visual-focus\")?.classList.remove(\"sg-dropdown-item-visual-focus\")\r\n menu.setAttribute(\"aria-activedescendant\", \"\")\r\n target.classList.add(\"sg-dropdown-item-visual-focus\")\r\n menu.setAttribute(\"aria-activedescendant\", target.id)\r\n }\r\n }\r\n useEffect(() => {\r\n const menu = document.getElementById(controlId+\"-menu\") as HTMLElement\r\n for (let child of menu.children) {\r\n (child as HTMLElement).addEventListener(\"mouseover\", handleMouseOver, true)\r\n }\r\n return function cleanup() {\r\n for (let child of menu.children) {\r\n (child as HTMLElement).removeEventListener(\"mouseover\", handleMouseOver, true)\r\n }\r\n }\r\n }, [])\r\n return (\r\n <ul id={controlId+\"-menu\"} role=\"menu\" tabIndex={-1} aria-labelledby={controlId} \r\n ref={ref} className={`sg-dropdown-list${className ? \" \"+className:\"\"}${showInternal ? \" show\":\"\"}`}\r\n style={computedStyle} {...restProps}\r\n >\r\n {children}\r\n </ul>\r\n )\r\n})\r\n\r\n\r\nexport const Item = forwardRef<HTMLAnchorElement | HTMLButtonElement, DropdownItemType>( ({children, as=\"button\", className, ...restProps}, ref) => {\r\n const Component = as\r\n return (\r\n <li role=\"none\">\r\n <Component ref={ref} role=\"menuitem\" tabIndex=\"-1\" className={`sg-dropdown-item${className ? \" \"+className:\"\"}`} {...restProps}>\r\n {children}\r\n </Component >\r\n </li>\r\n )\r\n})\r\n\r\nexport const Divider = forwardRef<HTMLHRElement, DropdownDividerType>( ({className=\"\", ...restProps}, ref) => {\r\n return (\r\n <hr ref={ref} className={`.sg-dropdown-divider${className}`} {...restProps}></hr>\r\n )\r\n})\r\n\r\nexport default Object.assign(Dropdown, {\r\n Toggle: Toggle,\r\n Menu: Menu,\r\n Item: Item,\r\n //Text: Text,\r\n Divider: Divider\r\n})","import React, { forwardRef, useContext, createContext, useMemo } from \"react\";\r\n\r\nimport { FormCheckType, FormContextType, FormControlType, FormGroupType, FormLabelType, FormSelectType, FormTextType, FormType } from \"./Form.types\";\r\n\r\nexport const FormContext = createContext<FormContextType | null>(null)\r\nexport const FormContextProvider = ({children, value} : {children: React.ReactNode, value:FormContextType}) => {\r\n return (\r\n <FormContext.Provider value={value}>\r\n {children}\r\n </FormContext.Provider>\r\n )\r\n}\r\nexport const useFormContext = () => {\r\n const context = useContext(FormContext)\r\n if(!context) {\r\n throw new Error(\r\n \"useFormContext has to be used within a FormContextProvider!\"\r\n )\r\n }\r\n return context\r\n}\r\n\r\n\r\nconst Form = forwardRef<HTMLFormElement, FormType>(({children, ...restProps}, ref) => {\r\n return (\r\n <form ref={ref} {...restProps}>\r\n {children}\r\n </form>\r\n )\r\n})\r\n\r\n\r\nconst Control = forwardRef<HTMLInputElement, FormControlType>( (\r\n {as = \"input\", className = \"\", plaintext = false, id=\"\", type = \"text\", autoFocus=false, ...restProps}, ref\r\n) => {\r\n let Component = as\r\n\r\n const { controlId } = useFormContext()\r\n\r\n let elementId = controlId || id\r\n\r\n let computedClassName = (plaintext ? \"sg-form-control-plaintext\" : \"sg-form-control\") + (className != \"\" ? \" \"+className : \"\") + (type == \"color\" ? \" sg-form-control-color\" : \"\")\r\n\r\n return (\r\n <Component autoFocus={autoFocus} ref={ref} id={elementId} type={type} className={computedClassName} {...restProps} />\r\n )\r\n})\r\n\r\n\r\nconst Select = forwardRef<HTMLSelectElement, FormSelectType>( ({children, className, id, ...restProps}, ref) => {\r\n const { controlId } = useFormContext()\r\n\r\n let elementId = controlId ? controlId : id\r\n\r\n return (\r\n <select ref={ref} className={`sg-form-select${className ? \" \"+className : \"\"}`} id={elementId} {...restProps}>\r\n {children}\r\n </select>\r\n )\r\n})\r\n\r\n\r\nconst Group = forwardRef<HTMLDivElement, FormGroupType>( ({children, className, controlId, ...restProps}, ref) => {\r\n const context = useMemo(() => {\r\n return {controlId: controlId}\r\n }, [controlId])\r\n return (\r\n <div ref={ref} className={`sg-from-group${className ? \" \"+className : \"\"}`} {...restProps}>\r\n <FormContextProvider value={context}>\r\n {children}\r\n </FormContextProvider>\r\n </div>\r\n )\r\n})\r\n\r\n \r\nconst Label = forwardRef<HTMLLabelElement, FormLabelType>( ({children, className, htmlFor}, ref) => {\r\n const { controlId } = useFormContext()\r\n\r\n let elementHtmlFor = htmlFor ? htmlFor : controlId\r\n return (\r\n <label ref={ref} htmlFor={elementHtmlFor} className={`sg-form-label${className ? \" \"+className : \"\"}`}>\r\n {children}\r\n </label>\r\n )\r\n})\r\n\r\n// <Form.Check className=\"mb-3\" type=\"checkbox\" id=\"remember me checkbox\" label=\"Remember me\" onChange={event => handleChange(event, \"remember\")}/>\r\nconst Check = forwardRef<HTMLInputElement, FormCheckType>( ({ \r\n classNameContainer, containerRef, containerId, style,\r\n classNameLabel, labelRef, label, labelId,\r\n className, type, id, controlId, reverse=false, checkStyle, ...restProps \r\n } , ref) => {\r\n \r\n let elementId = controlId ? controlId : id\r\n let typeComputed = type === \"switch\" ? \"checkbox\" : type\r\n\r\n return (\r\n <div ref={containerRef} id={containerId} style={style} className={`sg-form-check${reverse ? \"-reverse\":\"\"}${classNameContainer ? \" \"+classNameContainer : \"\"}${type === \"switch\" ? \" sg-form-switch\":\"\"}`}>\r\n {reverse ?\r\n <>\r\n <input ref={ref} type={typeComputed} id={elementId} className={`sg-form-check-input${className ? \" \"+className : \"\"}`} {...restProps} />\r\n <label ref={labelRef} id={labelId} htmlFor={elementId}className={`sg-form-check-label${classNameLabel ? \" \"+classNameLabel : \"\"}`}>{label}</label>\r\n </> :\r\n <>\r\n <label ref={labelRef} id={labelId} htmlFor={elementId}className={`sg-form-check-label${classNameLabel ? \" \"+classNameLabel : \"\"}`}>{label}</label>\r\n <input ref={ref} type={typeComputed} id={elementId} className={`sg-form-check-input${className ? \" \"+className : \"\"}`} style={checkStyle} {...restProps} />\r\n </>\r\n }\r\n </div>\r\n )\r\n})\r\n\r\nconst Text = forwardRef<HTMLElement, FormTextType>( ({children, className, ...restProps}, ref) => {\r\n return (\r\n <small ref={ref} className={`sg-form-text${className ? \" \"+className:\"\"}`} {...restProps}>\r\n {children}\r\n </small>\r\n )\r\n})\r\n\r\nexport default Object.assign(Form, {\r\n Control: Control,\r\n Select: Select,\r\n Group: Group,\r\n Label: Label,\r\n Check: Check,\r\n Text: Text\r\n})","import { forwardRef, useMemo } from \"react\";\r\n\r\nimport { FormContextProvider } from \"../Form/Form\";\r\nimport { FormContextType } from \"../Form/Form.types\";\r\nimport { FloatingLabelType } from \"./FloatingLabel.types\";\r\n\r\nconst FloatingLabel = forwardRef<HTMLLabelElement, FloatingLabelType>( ({children, label, controlId, className, htmlFor,...restProps}, ref) => {\r\n const context = useMemo<FormContextType>(() => {\r\n return {controlId: controlId}\r\n }, [controlId])\r\n return (\r\n <FormContextProvider value={context} >\r\n <div className={`sg-form-floating`}>\r\n {children}\r\n <label ref={ref} htmlFor={controlId} className=\"sg-form-floating-label\" {...restProps}>{label}</label>\r\n </div>\r\n </FormContextProvider>\r\n )\r\n})\r\n\r\nexport default FloatingLabel","import { forwardRef } from \"react\"\r\n\r\nimport { InputGroupText, InputGroupType } from \"./InputGroup.types\"\r\n\r\nconst InputGroup = forwardRef<HTMLDivElement, InputGroupType>(({children, className, ...restProps}, ref) => {\r\n return (\r\n <div ref={ref} className={`sg-input-group${className ? \" \"+className : \"\"}`} {...restProps}>\r\n {children}\r\n </div>\r\n )\r\n})\r\n\r\nconst Text = forwardRef<HTMLSpanElement, InputGroupText>( ({children, className, ...restProps}, ref) => {\r\n return (\r\n <span ref={ref} className={`sg-input-group-text${className ? \" \"+className : \"\"}`} {...restProps}>\r\n {children}\r\n </span>\r\n )\r\n})\r\n\r\nexport default Object.assign(InputGroup, {\r\n Text: Text\r\n})","import React, { createContext, useContext, useEffect, useState, forwardRef, useRef } from \"react\"\r\nimport { createPortal } from \"react-dom\"\r\n\r\nimport { ModalBodyType, ModalContextType, ModalFooterType, ModalHeaderType, ModalTitleType, ModalType, ErrorModalType } from \"./Modal.types\"\r\n\r\nimport CloseButton from \"../CloseButton/CloseButton\"\r\nimport Button from \"../Button/Button\"\r\n\r\nconst ModalContext = createContext<ModalContextType>(null)\r\nconst ModalContextProvider = ({children, value}:{children:React.ReactNode, value:ModalContextType}) => {\r\n return (\r\n <ModalContext.Provider value={value}>\r\n {children}\r\n </ModalContext.Provider>\r\n )\r\n}\r\nconst useModalContext = () => {\r\n const context = useContext(ModalContext)\r\n if(!context) {\r\n throw new Error(\r\n \"useModalContext has to be used within ModalContextProvider!\"\r\n )\r\n }\r\n return context\r\n}\r\n\r\nconst Modal = ({ children, centered=false, size = \"md\", show, backdrop = \"static\", onHide, className, id, ...restProps \r\n }: ModalType) => {\r\n const [showModal, setShowModal] = useState<boolean>(show)\r\n useEffect(() => {\r\n setShowModal(show)\r\n }, [show])\r\n\r\n const modalRef = useRef<HTMLDialogElement>(null)\r\n useKeepElementFocused(modalRef)\r\n\r\n let typeCheck : {show: boolean, onHide: boolean} | undefined = typeof(show) === \"boolean\" && typeof(onHide) === \"function\" ? undefined : {show: typeof(show) === \"boolean\", onHide: typeof(onHide) === \"function\"}\r\n if(typeCheck) {\r\n console.error(\r\n !typeCheck.show ? \"The variable 'show' must be used and must be a boolean used to decide when to show the modal!\" : null,\r\n !typeCheck.onHide ? \"The variable 'onHide' must be used and must be a function which is used to set 'show' as the modal gets closed!\" : null\r\n )\r\n }\r\n\r\n const closeModal = () => {\r\n if(onHide) {\r\n onHide()\r\n }\r\n setShowModal(false);\r\n }\r\n\r\n useEffect(() => {\r\n const modal = modalRef.current\r\n \r\n if(!modal) return\r\n if(showModal) {\r\n modal.classList.remove('close')\r\n modal.showModal()\r\n }\r\n else {\r\n modal.close()\r\n }\r\n }, [showModal])\r\n\r\n let classNameComputed: string = `sg-modal-tag sg-modal-${size}`\r\n if(className) {\r\n classNameComputed += \" \"+className\r\n }\r\n if(backdrop === \"static\" || backdrop === \"true\") {\r\n classNameComputed += \" sg-modal-static\"\r\n }\r\n\r\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDialogElement>) => {\r\n const key: string = event.key\r\n if(key != \"Escape\") {return}\r\n \r\n event.preventDefault()\r\n const modal = modalRef.current!\r\n modal.classList.add(\"close\")\r\n modal.addEventListener('animationend', () => {\r\n closeModal(); // then run the default close method\r\n }, {once : true});\r\n }\r\n\r\n return (\r\n createPortal(\r\n <dialog ref={modalRef} className={classNameComputed} onKeyDown={(event) => handleKeyDown(event)} {...restProps }>\r\n <ModalContextProvider value={onHide}>\r\n {!typeCheck ?\r\n children :\r\n <ErrorModal typeCheck={typeCheck} closeModal={closeModal}/>\r\n }\r\n </ModalContextProvider>\r\n </dialog>\r\n , document.body)\r\n )\r\n}\r\n\r\nconst Header = forwardRef<HTMLDivElement | HTMLSpanElement | HTMLHeadingElement, ModalHeaderType>(({children, as=\"\", className = \"\", closeButton = false, onClick, ...restProps}, ref) => {\r\n let validAs = [\"div\", \"span\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\"]\r\n let Component = validAs.find(valid => valid === as) ? as : \"div\"\r\n const onHide = useModalContext()\r\n const onCloseButtonClick = (event: React.MouseEvent) => {\r\n if(onClick) {\r\n onClick(event)\r\n }\r\n onHide()\r\n }\r\n\r\n return (\r\n <Component ref={ref} className={`sg-modal-header ${className}`} {...restProps}>\r\n {children}\r\n {closeButton ? <CloseButton variant onClick={event => onCloseButtonClick(event)}/> : null}\r\n </Component>\r\n )\r\n})\r\n\r\nconst Title = forwardRef<HTMLDivElement | HTMLSpanElement | HTMLHeadingElement, ModalTitleType>( ({children, as=\"h4\", className, ...restProps}, ref) => {\r\n let validAs = [\"div\", \"span\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\"]\r\n let Component = validAs.find(valid => valid === as) ? as : \"h4\"\r\n return (\r\n <Component ref={ref} className={`sg-modal-title ${className}`} {...restProps}>\r\n {children}\r\n </Component>\r\n )\r\n})\r\n\r\nconst Body = forwardRef<HTMLDivElement, ModalBodyType>( ({children, className, ...restProps}, ref) => {\r\n return (\r\n <div ref={ref} className={`sg-modal-body ${className}`} {...restProps}>\r\n {children}\r\n </div>\r\n )\r\n})\r\n\r\nconst Footer = forwardRef<HTMLDivElement, ModalBodyType>( ({children, className, ...restProps}, ref) => {\r\n return (\r\n <div ref={ref} className={`sg-modal-footer ${className}`} {...restProps}>\r\n {children}\r\n </div>\r\n )\r\n})\r\n\r\nexport default Object.assign(Modal, {\r\n Header: Header,\r\n Title: Title,\r\n Body: Body,\r\n Footer: Footer\r\n})\r\n\r\nexport const useKeepElementFocused = function (elementRef: React.RefObject<HTMLDialogElement>) {\r\n useEffect(() => {\r\n const onKeyDown = (event: KeyboardEvent) => {\r\n const focusableElements = 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\r\n const modal = elementRef.current\r\n if(modal) {\r\n const firstFocusableElement = modal.querySelectorAll(focusableElements)[0] as HTMLElement\r\n const focusableContent = modal.querySelectorAll(focusableElements)\r\n const lastFocusableElement = focusableContent[focusableContent.length - 1] as HTMLElement\r\n let isTabPressed = event.key === 'Tab'\r\n \r\n if (!isTabPressed) {\r\n return;\r\n }\r\n \r\n if (event.shiftKey) {\r\n if (document.activeElement === firstFocusableElement) {\r\n lastFocusableElement.focus()\r\n event.preventDefault()\r\n }\r\n } else if (document.activeElement === lastFocusableElement) {\r\n firstFocusableElement.focus();\r\n event.preventDefault()\r\n }\r\n }\r\n }\r\n document.addEventListener('keydown', onKeyDown, true )\r\n\r\n return function cleanup() {\r\n document.removeEventListener('keydown', onKeyDown, true )\r\n }\r\n }, [elementRef])\r\n}\r\n\r\nconst ErrorModal = ({typeCheck, closeModal}:ErrorModalType) => {\r\n return (\r\n <>\r\n <Header closeButton >\r\n <Title>\r\n An Error ocurred!\r\n </Title>\r\n </Header>\r\n <Body>\r\n <p>\r\n {!typeCheck.show ? \"The variable 'show' must be used and must be a boolean used to decide when to show the modal!\" : null}\r\n {!typeCheck.onHide ? \"The variable 'onHide' must be used and must be a function which is used to set 'show' as the modal gets closed!\" : null}\r\n </p>\r\n </Body>\r\n <Footer>\r\n <Button variant=\"danger\" type=\"button\" onClick={() => closeModal()}>\r\n Close\r\n </Button>\r\n </Footer>\r\n </>\r\n )\r\n}","import React, { createContext, forwardRef, useContext, useMemo } from \"react\";\r\n\r\nimport { NavbarBrandType, NavbarTextType, NavbarType } from \"./Navbar.types\";\r\n\r\nexport type NavbarContextType = string | null\r\nexport const NavbarContext = createContext<NavbarContextType>(null)\r\n\r\nconst NavbarContextProvider = ({children, value}:{children:React.ReactNode, value:NavbarContextType}) => {\r\n return (\r\n <NavbarContext.Provider value={value}>\r\n {children}\r\n </NavbarContext.Provider>\r\n )\r\n}\r\nexport const useNavbarContext = () => {\r\n const context = useContext(NavbarContext)\r\n return context\r\n}\r\n\r\nconst Navbar = forwardRef<HTMLElement, NavbarType>(({children, className, navbarPrefix= \"sg-navbar-\", ...restProps}, ref) => {\r\n const navbarContext = useMemo(() => {\r\n return navbarPrefix\r\n }, [navbarPrefix])\r\n\r\n return (\r\n <nav ref={ref} className={`sg-navbar${className ? \" \"+className:\"\"}`} {...restProps}>\r\n <NavbarContextProvider value={navbarContext}>\r\n {children}\r\n </NavbarContextProvider>\r\n </nav>\r\n )\r\n})\r\n\r\nconst Brand = forwardRef<HTMLAnchorElement | HTMLElement, NavbarBrandType>( ({children, className, href=\"#\", as=\"a\", ...restProps}, ref) => {\r\n const Component = as || (href && as != \"Link\" ? 'a' : 'span')\r\n return (\r\n <Component ref={ref} href={href} className={`sg-navbar-brand${className ? \" \"+className:\"\"}`} {...restProps} >\r\n {children}\r\n </Component>\r\n )\r\n})\r\n\r\nconst Text = forwardRef<HTMLElement, NavbarTextType>( ({children, className, as=\"span\", ...restProps}, ref) => {\r\n const Component = as\r\n return (\r\n <Component ref={ref} className={`sg-navbar-text${className ? \" \"+className:\"\"}`} {...restProps}>\r\n {children}\r\n </Component>\r\n )\r\n})\r\n\r\nexport default Object.assign(Navbar, {\r\n Brand: Brand,\r\n Text: Text\r\n})","import React, { forwardRef } from \"react\";\r\n\r\nimport { NavType, NavItemType, NavLinkType } from \"./Nav.types\";\r\n\r\nimport { useNavbarContext } from \"../NavBar/Navbar\";\r\n\r\nconst Nav = forwardRef<HTMLElement, NavType>(({children, className, as=\"ul\", ...restProps}, ref) => {\r\n const Component = as\r\n const navbarContext = useNavbarContext()\r\n const navbarPrefix = navbarContext ? navbarContext : \"sg-navbar-\"\r\n\r\n return (\r\n <Component ref={ref} className={`${className} ${navbarPrefix}nav`} {...restProps}>\r\n {children}\r\n </Component>\r\n )\r\n})\r\n\r\n\r\nconst Item = forwardRef<HTMLElement, NavItemType>( ({children, className, as=\"li\", ...restProps}, ref) => {\r\n const Component = as\r\n return (\r\n <Component role=\"none\" ref={ref} className={`sg-nav-item${className ? \" \"+className:\"\"}`} {...restProps}>\r\n {children}\r\n </Component>\r\n )\r\n})\r\n\r\n\r\nconst Link = forwardRef<HTMLElement, NavLinkType>( ({children, className, as=\"a\", ...restProps}, ref) => {\r\n const Component = as\r\n return (\r\n <Component role=\"menuitem\" ref={ref} className={`sg-nav-link${className ? \" \"+className:\"\"}`} {...restProps}>\r\n {children}\r\n </Component>\r\n )\r\n})\r\n\r\nexport default Object.assign(Nav, {\r\n Item: Item,\r\n Link: Link\r\n})","import { forwardRef, useCallback, useMemo, useState } from \"react\";\r\n\r\nimport { NavDropdownType } from \"./NavDropdown.types\";\r\n\r\nimport Dropdown, { DropdownContextProvider } from \"../Dropdown/Dropdown\";\r\n\r\nconst getDropdownMenuPlacement = (alignEnd: boolean, dropDirection: string, isRTL:boolean = false) => {\r\n const topStart = isRTL ? 'top-end' : 'top-start';\r\n const topEnd = isRTL ? 'top-start' : 'top-end';\r\n const bottomStart = isRTL ? 'bottom-end' : 'bottom-start';\r\n const bottomEnd = isRTL ? 'bottom-start' : 'bottom-end';\r\n const leftStart = isRTL ? 'right-start' : 'left-start';\r\n const leftEnd = isRTL ? 'right-end' : 'left-end';\r\n const rightStart = isRTL ? 'left-start' : 'right-start';\r\n const rightEnd = isRTL ? 'left-end' : 'right-end';\r\n let placement = alignEnd ? bottomEnd : bottomStart;\r\n if (dropDirection === 'up') \r\n {\r\n placement = alignEnd ? topEnd : topStart\r\n }\r\n else if (dropDirection === 'end') {\r\n placement = alignEnd ? rightEnd : rightStart\r\n } else if (dropDirection === 'start') {\r\n placement = alignEnd ? leftEnd : leftStart\r\n } else if (dropDirection === 'down-centered') {\r\n placement = 'bottom'\r\n } else if (dropDirection === 'up-centered') {\r\n placement = 'top'\r\n }\r\n return placement;\r\n}\r\n\r\nconst NavDropdown = forwardRef<HTMLDivElement, NavDropdownType>((\r\n {\r\n children, className, onSelect, onToggle, controlId, toggleProps, title, menuProps,\r\n drop=\"down\", align=\"start\", autoClose=true, show=\"default\", ...restProps\r\n }, ref) => {\r\n const [showInternal, setShowInternal] = useState<boolean>(show === \"default\" ? false : show as boolean)\r\n const [activeDescendant, setActiveDescendant] = useState({case:\"\"})\r\n\r\n const internalOnToggle = useCallback((event: MouseEvent) => {\r\n event.stopPropagation()\r\n setShowInternal(prev => !prev)\r\n }, [])\r\n\r\n const alignEnd = align === \"end\"\r\n const placement = getDropdownMenuPlacement(alignEnd, drop )\r\n\r\n const directionClasses = {\r\n down: \"dropdown\",\r\n 'down-centered': `dropdown-center`,\r\n up: 'dropup',\r\n 'up-centered': 'dropup-center dropup',\r\n end: 'dropend',\r\n start: 'dropstart'\r\n };\r\n const controlIdcomputed = controlId\r\n const contextValue = useMemo(() => ({\r\n align, \r\n drop, \r\n showInternal: show != \"default\" && onToggle ? show as boolean : showInternal, \r\n handleToggle: show != \"default\" && onToggle ? onToggle : internalOnToggle, \r\n placement, \r\n directionClasses: {\r\n down: \"dropdown\",\r\n 'down-centered': `dropdown-center`,\r\n up: 'dropup',\r\n 'up-centered': 'dropup-center dropup',\r\n end: 'dropend',\r\n start: 'dropstart'\r\n },\r\n controlId: controlIdcomputed, \r\n activeDescendant, \r\n setActiveDescendant\r\n }), [align, drop, show, showInternal, onToggle, internalOnToggle, placement, directionClasses, controlId, activeDescendant, setActiveDescendant])\r\n \r\n return (\r\n <div ref={ref} id={controlId+\"-wrapper\"} className={`sg-dropdown${className? \" \"+className:\"\"} sg-nav-item`} {...restProps} >\r\n <DropdownContextProvider value={contextValue}>\r\n <Dropdown.Toggle navDropdown={true} {...toggleProps}>\r\n {title}\r\n </Dropdown.Toggle>\r\n <Dropdown.Menu {...menuProps}>\r\n {children}\r\n </Dropdown.Menu>\r\n </DropdownContextProvider>\r\n </div>\r\n )\r\n})\r\n\r\nexport default Object.assign(NavDropdown, {\r\n Toggle: Dropdown.Toggle,\r\n Menu: Dropdown.Menu,\r\n Item: Dropdown.Item,\r\n Divider: Dropdown.Divider\r\n})","import { createPortal } from \"react-dom\";\r\nimport React, { forwardRef, useEffect, useRef, useState } from \"react\";\r\n\r\nimport { PopoutType, PopoutBodyType, PopoutFooterType, PopoutHeaderType, PopoutTextType, PopoutTitleType } from \"./Popout.types\";\r\n/*\r\nexport const useEventListener = (eventType: keyof HTMLElementEventMap, callback: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions | undefined, customOptions: {element: HTMLElement}) => {\r\n const element = customOptions ? customOptions.element : document.body\r\n useEffect(() => {\r\n if(element) {\r\n element.addEventListener(eventType, callback, options)\r\n return function cleanup() {\r\n element.removeEventListener(eventType, callback, options)\r\n }\r\n }\r\n }, [callback, element])\r\n}\r\n*/\r\n\r\nconst Popout = forwardRef<HTMLDialogElement, PopoutType>(({children, initialPosition={top:0, left:0}, id, resize=false, move=false, className, style, ...restProps}, ref) => {\r\n const [coordinates, setCoordinates] = useState<{ top?: number, bottom?: number, right?: number, left?: number, offSetTop:number, offSetLeft:number }>({offSetTop:0, offSetLeft:0, ...initialPosition})\r\n const resizeComputed = resize ? \"true\":\"false\"\r\n const moveComputed = move ? \"true\":\"false\"\r\n \r\n const passedRef = useRef(ref)\r\n const popupRef = useRef<HTMLDialogElement>(null)\r\n const [ isMouseDown, setIsMouseDown ] = useState<boolean>(false)\r\n const isMouseDownRef = useRef(isMouseDown)\r\n useEffect(() => {\r\n isMouseDownRef.current = isMouseDown\r\n }, [isMouseDown])\r\n\r\n const onMouseDown = (event: React.PointerEvent<HTMLDialogElement>) => {\r\n const eventTarget = event.target as HTMLElement\r\n if(move && eventTarget.className.includes(\"sg-popout-title\") || eventTarget.className.includes(\"sg-popout-header\")) {\r\n const { top, left} = popupRef.current!.getBoundingClientRect();\r\n setCoordinates(prev => ({\r\n ...prev,\r\n offSetTop:event.clientY - top,\r\n offSetLeft:event.clientX - left\r\n }))\r\n popupRef.current!.style.setProperty(\"user-select\", \"none\")\r\n popupRef.current!.setPointerCapture(event.pointerId)//event.pointerId)//\"moveable-popup-\"+id);\r\n setIsMouseDown(true)\r\n }\r\n }\r\n const onMouseUp = () => {\r\n if(move) {\r\n popupRef.current!.style.removeProperty(\"user-select\")\r\n setIsMouseDown(false)\r\n }\r\n }\r\n const onMouseMove = (event: React.PointerEvent<HTMLDialogElement>) => {\r\n if( move && isMouseDownRef.current && popupRef.current ) {\r\n const isTopOver = event.clientY - coordinates.offSetTop < 0\r\n const isBottomOver = window.innerHeight - (event.clientY - coordinates.offSetTop + popupRef.current.offsetHeight) < 0\r\n const isLeftOver = event.clientX - coordinates.offSetLeft < 0\r\n const isRightOver = window.innerWidth - (event.clientX - coordinates.offSetLeft + popupRef.current.offsetWidth) < 0\r\n\r\n let topCoordinate = isTopOver ? 0 : event.clientY - coordinates.offSetTop\r\n topCoordinate = isBottomOver ? window.innerHeight - popupRef.current.offsetHeight : topCoordinate\r\n\r\n let leftCoordinate = isLeftOver ? 0 : event.clientX - coordinates.offSetLeft\r\n leftCoordinate = isRightOver ? window.innerWidth - popupRef.current.offsetWidth : leftCoordinate\r\n\r\n //console.log(event.clientX - coordinates.offSetLeft, event.clientY - coordinates.offSetTop)\r\n setCoordinates(prev => ({\r\n ...prev,\r\n top:topCoordinate,\r\n left:leftCoordinate\r\n }))\r\n }\r\n }\r\n\r\n useEffect(() => {\r\n document.body.addEventListener(\"pointerup\", () => onMouseUp(), true)\r\n return function cleanup() {\r\n document.body.removeEventListener(\"pointerup\", () => onMouseUp(), true)\r\n }\r\n }, [])\r\n return (\r\n createPortal(\r\n <dialog data-resize={resizeComputed} data-move={moveComputed} data-passedRef={passedRef}\r\n ref={popupRef} id={id} className={`sg-moveable-popout${className ? \" \"+className : \"\"}`}\r\n style={{...style, top:coordinates.top, left:coordinates.left, bottom:coordinates.bottom, right:coordinates.right}}\r\n onPointerDown={onMouseDown} onPointerMove={(event) => onMouseMove(event)} {...restProps}\r\n >\r\n {children}\r\n </dialog>\r\n , document.body\r\n )\r\n )\r\n})\r\n\r\nconst Header = forwardRef<HTMLDivElement | HTMLSpanElement | HTMLHeadingElement, PopoutHeaderType>(\r\n ({ children, className, as = \"div\", ...restProps}, ref) => \r\n {\r\n let validAs = [\"div\", \"span\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\"]\r\n let Component = validAs.find(valid => valid === as) ? as : \"div\"\r\n return (\r\n <Component ref={ref} className={`sg-popout-header ${className}`} {...restProps}>\r\n {children}\r\n </Component>\r\n )\r\n})\r\n\r\nconst Title = forwardRef<HTMLHeadingElement, PopoutTitleType>( ({as=\"h4\", className, children, ...restProps}, ref) => {\r\n let validAs = [\"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\"]\r\n let Component = validAs.find(valid => valid === as) ? as : \"h5\"\r\n return (\r\n <Component ref={ref} className={`sg-popout-title ${className}`} {...restProps}>\r\n {children}\r\n </Component>\r\n )\r\n})\r\n\r\nconst Body = forwardRef<HTMLDivElement, PopoutBodyType>( ({children, className, ...restProps}, ref) => {\r\n return (\r\n <div ref={ref} className={`sg-popout-body ${className}`} {...restProps}>\r\n {children}\r\n </div>\r\n )\r\n})\r\n\r\nconst Text = forwardRef<HTMLParagraphElement, PopoutTextType>( ({children, className, ...restProps}, ref) => {\r\n return (\r\n <p ref={ref} className={`sg-popout-text ${className}`} {...restProps}>\r\n {children}\r\n </p>\r\n )\r\n})\r\n\r\nconst Footer = forwardRef<HTMLDivElement, PopoutFooterType>( ({children, className, ...restProps}, ref) => {\r\n return (\r\n <div ref={ref} className={`sg-popout-footer ${className}`} {...restProps}>\r\n {children}\r\n </div>\r\n )\r\n})\r\n\r\nexport default Object.assign(Popout, {\r\n Header: Header,\r\n Title: Title,\r\n Body: Body,\r\n Text: Text,\r\n Footer: Footer\r\n})\r\n\r\n","import { forwardRef } from \"react\";\r\n\r\nimport { SpinnerType } from \"./Spinner.types\";\r\n\r\nconst Spinner = forwardRef<HTMLDivElement, SpinnerType>( ({size=\"1em\", color=\"white\", label, className, controlId, ...restProps}, ref) => {\r\n return (\r\n <>\r\n <div aria-labelledby={controlId} role=\"status\" ref={ref} className={`sg-spinner${className ? \" \"+className : \"\"}`} style={{width:size, height:size, borderColor:color}} {...restProps}></div>\r\n <label id={controlId} className=\"sg-visually-hidden\">{label}</label>\r\n </>\r\n )\r\n})\r\n\r\nexport default Spinner","import { forwardRef } from \"react\";\r\n\r\nimport { TableType } from \"./Table.types\";\r\n\r\n\r\nconst Table = forwardRef<HTMLTableElement, TableType>( ({children, size=\"lg\", className, ...restProps}, ref) => {\r\n let classesComputed = `sg-table${className ? \" \"+className:\"\"}${size === \"sm\" ? \" \"+\"sg-table-sm\":\"\"}`\r\n return (\r\n <table ref={ref} className={classesComputed} {...restProps}>\r\n {children}\r\n </table>\r\n )\r\n})\r\n\r\nexport default Table","import { createContext, forwardRef, useContext, useMemo, useState } from \"react\"\r\n\r\nimport { TabsButtonType, TabsContentType, TabsContextType, TabsControlsType, TabsPageType, TabsType } from \"./Tabs.types\"\r\n\r\nconst TabsContext = createContext<TabsContextType | null>(null)\r\nconst TabsContextProvider = ({children, value}:{children: React.ReactNode, value: TabsContextType}) => {\r\n return (\r\n <TabsContext.Provider value={value}>\r\n {children}\r\n </TabsContext.Provider>\r\n )\r\n}\r\nconst useTabsContext = () => {\r\n const context = useContext(TabsContext)\r\n if(!context) {\r\n throw new Error(\r\n \"useTabContext has to be used within a TabContextProvider!\"\r\n )\r\n }\r\n return context\r\n}\r\n\r\nconst Tabs = forwardRef<HTMLDivElement, TabsType>(({children, className, controlId, activeClassName, defaultActive, ...restProps}, ref) => {\r\n const [activeTab, setActiveTab] = useState<string>(defaultActive)\r\n const activeClass= activeClassName ? activeClassName: \"sg-active\"\r\n \r\n const contextValue = useMemo(() => ({\r\n activeTab,\r\n setActiveTab,\r\n controlId,\r\n activeClass\r\n }), [activeTab, setActiveTab, controlId])\r\n return (\r\n <TabsContextProvider value={contextValue}>\r\n <div ref={ref} id={controlId+\"-tab-wrapper\"} className={`sg-tabs${className ? \" \"+className: \"\"}`} {...restProps}>\r\n {children}\r\n </div>\r\n </TabsContextProvider>\r\n )\r\n})\r\n\r\nconst Controls = forwardRef<HTMLDivElement, TabsControlsType>( ({children, className, ...restProps}, ref) => {\r\n const { controlId, activeClass } = useTabsContext()\r\n \r\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\r\n const key = event.key\r\n const tabsControls = document.getElementById(controlId+\"-tab-controls\")\r\n if(tabsControls) {\r\n const tabControlsChildren = Array.from(tabsControls.children) as HTMLElement[]\r\n if(key === \"ArrowRight\" || key === \"ArrowLeft\") {\r\n event.preventDefault()\r\n const activeTab = document.querySelector(\".sg-tabs-button\"+\".\"+activeClass) as HTMLElement\r\n const activeTabIndex = tabControlsChildren.indexOf(activeTab)\r\n const indexChange = key === \"ArrowRight\" ? 1 : -1\r\n const newIndex = activeTabIndex + indexChange < 0 ? tabControlsChildren.length - 1 : (activeTabIndex + indexChange >= tabControlsChildren.length ? 0 : activeTabIndex + indexChange)\r\n tabControlsChildren[newIndex].focus()\r\n tabControlsChildren[newIndex].click()\r\n } else if (key === \"Home\" || key === \"End\") {\r\n event.preventDefault()\r\n const newIndex = key === \"Home\" ? 0 : tabControlsChildren.length -1\r\n tabControlsChildren[newIndex].focus()\r\n tabControlsChildren[newIndex].click()\r\n }\r\n }\r\n }\r\n\r\n return (\r\n <div onKeyDown={(event) => handleKeyDown(event)} role=\"tablist\" id={controlId+\"-tab-controls\"} ref={ref} className={`sg-tabs-controls${className ? \" \"+className:\"\"}`} {...restProps}>\r\n {children}\r\n </div>\r\n )\r\n})\r\n\r\nconst Button = forwardRef<HTMLButtonElement, TabsButtonType>( ({children, className, onClick, tabId, id,...restProps}, ref) => {\r\n const { activeTab, setActiveTab, activeClass } = useTabsContext()\r\n const classNameComputed = \"sg-tabs-button\" + (className ? \" \"+className:\"\") + (activeTab === tabId ? \" \"+activeClass : \"\")\r\n const isActiveTab = activeTab === tabId\r\n const handleClick = (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\r\n setActiveTab(tabId)\r\n if(onClick) {\r\n onClick(event)\r\n }\r\n }\r\n return (\r\n <button \r\n role=\"tab\" type=\"button\" id={tabId+\"-button\"} ref={ref} onClick={event => handleClick(event)} className={classNameComputed} {...restProps}\r\n tabIndex={isActiveTab ? 0:-1} aria-selected={isActiveTab ? \"true\":\"false\"} aria-controls={tabId+\"-page\"}\r\n >\r\n {children}\r\n </button>\r\n )\r\n})\r\n\r\nconst Content = forwardRef<HTMLDivElement, TabsContentType>( ({children, className, ...restProps}, ref) => {\r\n return (\r\n <div role=\"none\" ref={ref} className={`sg-tabs-content${className ? \" \"+className:\"\"}`} {...restProps}>\r\n {children}\r\n </div>\r\n )\r\n})\r\n\r\nconst Page = forwardRef<HTMLDivElement, TabsPageType>( ({children, className, tabId, ...restProps}, ref) => {\r\n const { activeTab, activeClass } = useTabsContext()\r\n const classNameComputed = \"sg-tabs-page\" + (className ? \" \"+className:\"\") + (activeTab === tabId ? \" \"+activeClass : \"\")\r\n return (\r\n <div \r\n role=\"tabpanel\" id={tabId+\"-page\"} aria-labelledby={tabId+\"-button\"}\r\n ref={ref} className={classNameComputed} {...restProps}\r\n >\r\n {children}\r\n </div>\r\n )\r\n})\r\n\r\nexport default Object.assign(Tabs, {\r\n Controls: Controls,\r\n Button: Button,\r\n Content: Content,\r\n Page: Page,\r\n})","import { ReactNode, useState, forwardRef } from \"react\"\r\n\r\nimport { BaseButtonType } from \"../../BaseTypes\"\r\n\r\ntype ToggleButtonType = {\r\n children: ReactNode,\r\n toggled?: boolean,\r\n onClick?: <T>(event: T) => T\r\n} & BaseButtonType\r\n\r\nconst ToggleButton = forwardRef<HTMLButtonElement, ToggleButtonType>( ({children, toggled=\"false\", onClick, ...restProps}, ref) => {\r\n const [ toggledInternal, setToggledInternal ] = useState<boolean>(toggled === \"true\" ? true : false)\r\n const handleClick = (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\r\n setToggledInternal(prev => !prev)\r\n if(onClick) {\r\n onClick(event)\r\n }\r\n }\r\n return (\r\n <button onClick={(event) => handleClick(event)} data-toggled={toggledInternal} {...restProps}>\r\n {children}\r\n </button>\r\n )\r\n})\r\n\r\nexport default ToggleButton"],"names":["Button","forwardRef","children","variant","className","rest","ref","_jsx","type","undefined","Card","restProps","Header","as","Component","find","valid","Title","Body","Text","Footer","Card$1","Object","assign","CloseButton","isEventOnMenu","event","controlId","element","target","condition","eventIsOnMenu","id","parentElement","DropdownContext","createContext","DropdownContextProvider","value","Provider","useDropdownContext","context","useContext","Error","Dropdown","onSelect","onToggle","drop","align","autoClose","show","showInternal","setShowInternal","useState","activeDescendant","setActiveDescendant","case","internalOnToggle","stopPropagation","prev","placement","alignEnd","dropDirection","isRTL","getDropdownMenuPlacement","contextValue","useMemo","handleToggle","directionClasses","down","up","end","start","Toggle","navDropdown","handleKeyPress","flag","console","log","key","document","querySelector","click","preventDefault","handleClick","toggleElement","getElementById","focus","useEffect","addEventListener","removeEventListener","classNamesComputed","tabIndex","onClick","toggleButtonClick","Menu","style","computedStyle","setComputedStyle","useLayoutEffect","menu","tempComputedStyle","getBoundingClientRect","right","window","innerWidth","left","top","bottom","innerHeight","menuChildren","menuChildrenLast","length","elementWithVisualFocus","currentIndex","currentChild","classList","remove","i","setAttribute","add","handleMouseOver","active","contains","child","role","Item","Divider","Dropdown$1","FormContext","FormContextProvider","useFormContext","Form","Control","plaintext","autoFocus","Select","Group","Label","htmlFor","Check","classNameContainer","containerRef","containerId","classNameLabel","labelRef","label","labelId","reverse","checkStyle","elementId","typeComputed","_jsxs","_Fragment","Form$1","FloatingLabel","InputGroup","InputGroup$1","ModalContext","ModalContextProvider","closeButton","onHide","useModalContext","onCloseButtonClick","Modal$1","centered","size","backdrop","showModal","setShowModal","modalRef","useRef","useKeepElementFocused","typeCheck","error","closeModal","modal","current","close","classNameComputed","createPortal","onKeyDown","once","handleKeyDown","ErrorModal","body","elementRef","focusableElements","firstFocusableElement","querySelectorAll","focusableContent","lastFocusableElement","shiftKey","activeElement","NavbarContext","NavbarContextProvider","Navbar","navbarPrefix","navbarContext","Brand","href","Navbar$1","Nav","Link","Nav$1","NavDropdown","toggleProps","title","menuProps","useCallback","controlIdcomputed","NavDropdown$1","Popout","initialPosition","resize","move","coordinates","setCoordinates","offSetTop","offSetLeft","resizeComputed","moveComputed","passedRef","popupRef","isMouseDown","setIsMouseDown","isMouseDownRef","onMouseUp","removeProperty","onPointerDown","eventTarget","includes","clientY","clientX","setProperty","setPointerCapture","pointerId","onPointerMove","isTopOver","isBottomOver","offsetHeight","isLeftOver","isRightOver","offsetWidth","topCoordinate","leftCoordinate","onMouseMove","Popout$1","Spinner","color","width","height","borderColor","Table","TabsContext","TabsContextProvider","useTabsContext","Tabs","activeClassName","defaultActive","activeTab","setActiveTab","activeClass","Controls","tabsControls","tabControlsChildren","Array","from","activeTabIndex","indexOf","indexChange","newIndex","tabId","isActiveTab","Content","Page","Tabs$1","ToggleButton","toggled","toggledInternal","setToggledInternal"],"mappings":"2QAIM,MAAAA,EAASC,GAA2C,EAAEC,WAAUC,UAAQ,UAAWC,eAAcC,GAAOC,IAItGC,EAAA,SAAA,CAAQD,IAAKA,EAAKE,KAAK,SAASJ,UAAW,uBAAuBD,IAAuBM,MAAbL,EAAyB,GAAK,IAAIA,OAAiBC,EAAIH,SAC9HA,MCLPQ,EAAOT,GAAsC,EAAEC,WAAUE,eAAcO,GAAYL,IAkBjFC,EAAK,MAAA,CAAAD,IAAKA,EAAKF,UAAW,WAAkBA,KAAeO,WACtDT,MAKPU,EAASX,GAAmF,EAAEY,KAAG,MAAOT,YAAWF,cAAaS,GAAYL,KAC9I,IACIQ,EADU,CAAC,MAAO,OAAQ,KAAM,KAAM,KAAM,KAAM,KAAM,MACpCC,MAAKC,GAASA,IAAUH,IAAMA,EAAK,MAE3D,OACIN,EAACO,GAAUR,IAAKA,EAAKF,UAAW,kBAAkBA,OAAiBO,WAC9DT,GAER,IAGCe,EAAQhB,GAA+C,EAAEY,KAAG,KAAMT,YAAWF,cAAaS,GAAYL,KACxG,IACIQ,EADU,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,MACrBC,MAAKC,GAASA,IAAUH,IAAMA,EAAK,KAC3D,OACIN,EAACO,EAAU,CAAAR,IAAKA,EAAKF,UAAWA,KAAeO,WAC1CT,GAER,IAGCgB,EAAOjB,GAA0C,EAAEC,WAAUE,eAAcO,GAAYL,IASrFC,EAAK,MAAA,CAAAD,IAAKA,EAAKF,UAAW,gBAAgBA,OAAiBO,WACtDT,MAKPiB,EAAOlB,GAA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