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 @@
|
|
|
1
|
+
export { default } from "./Popout";
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
label: string;
|
|
4
|
-
size?: string;
|
|
5
|
-
color?: string;
|
|
6
|
-
className?: string;
|
|
7
|
-
controlId?: string;
|
|
8
|
-
};
|
|
2
|
+
import { SpinnerType } from "./Spinner.types";
|
|
9
3
|
declare const Spinner: import("react").ForwardRefExoticComponent<SpinnerType & import("react").RefAttributes<HTMLDivElement>>;
|
|
10
4
|
export default Spinner;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Spinner";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Table";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TabsButtonType, TabsContentType, TabsControlsType, TabsPageType, TabsType } from "./Tabs.types";
|
|
3
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<TabsType, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
|
|
4
|
+
Controls: import("react").ForwardRefExoticComponent<Omit<TabsControlsType, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
|
+
Button: import("react").ForwardRefExoticComponent<Omit<TabsButtonType, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
Content: import("react").ForwardRefExoticComponent<Omit<TabsContentType, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
7
|
+
Page: import("react").ForwardRefExoticComponent<Omit<TabsPageType, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { BaseButtonType, BaseDivType } from "
|
|
2
|
+
import { BaseButtonType, BaseDivType } from "../../BaseTypes";
|
|
3
3
|
export type TabsContextType = {
|
|
4
4
|
activeTab: string;
|
|
5
5
|
setActiveTab: React.Dispatch<React.SetStateAction<string>>;
|
|
6
6
|
controlId: string;
|
|
7
7
|
activeClass: string;
|
|
8
8
|
};
|
|
9
|
-
export type
|
|
9
|
+
export type TabsType = {
|
|
10
10
|
children: React.ReactNode;
|
|
11
11
|
className?: string;
|
|
12
12
|
controlId: string;
|
|
@@ -33,10 +33,3 @@ export type TabsPageType = {
|
|
|
33
33
|
className?: string;
|
|
34
34
|
tabId: string;
|
|
35
35
|
} & BaseDivType;
|
|
36
|
-
declare const _default: import("react").ForwardRefExoticComponent<Omit<TabsContext, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
|
|
37
|
-
Controls: import("react").ForwardRefExoticComponent<Omit<TabsControlsType, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
38
|
-
Button: import("react").ForwardRefExoticComponent<Omit<TabsButtonType, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
39
|
-
Content: import("react").ForwardRefExoticComponent<Omit<TabsContentType, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
40
|
-
Page: import("react").ForwardRefExoticComponent<Omit<TabsPageType, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
41
|
-
};
|
|
42
|
-
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Tabs";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { BaseButtonType } from "../../BaseTypes";
|
|
3
|
+
type ToggleButtonType = {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
toggled?: boolean;
|
|
6
|
+
onClick?: <T>(event: T) => T;
|
|
7
|
+
} & BaseButtonType;
|
|
8
|
+
declare const ToggleButton: import("react").ForwardRefExoticComponent<Omit<ToggleButtonType, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
export default ToggleButton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./ToggleButton";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { default as Button } from "./Button";
|
|
2
|
+
export { default as Card } from "./Card";
|
|
3
|
+
export { default as CloseButton } from "./CloseButton";
|
|
4
|
+
export { default as Dropdown } from "./Dropdown";
|
|
5
|
+
export { default as FloatingLabel } from "./FloatingLabel";
|
|
6
|
+
export { default as Form } from "./Form";
|
|
7
|
+
export { default as InputGroup } from "./InputGroup";
|
|
8
|
+
export { default as Modal } from "./Modal";
|
|
9
|
+
export { default as Nav } from "./Nav";
|
|
10
|
+
export { default as NavBar } from "./NavBar";
|
|
11
|
+
export { default as NavDropdown } from "./NavDropdown";
|
|
12
|
+
export { default as Popout } from "./Popout";
|
|
13
|
+
export { default as Spinner } from "./Spinner";
|
|
14
|
+
export { default as Table } from "./Table";
|
|
15
|
+
export { default as Tabs } from "./Tabs";
|
|
16
|
+
export { default as ToggleButton } from "./ToggleButton";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./components";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("react"),r=require("react-dom");const s=t.forwardRef((({children:t,variant:r="primary",className:s,...n},o)=>e.jsx("button",{ref:o,type:"button",className:`sg-button sg-button-${r}${null==s?"":" "+s}`,...n,children:t}))),n=t.forwardRef((({children:t,className:r,...s},n)=>e.jsx("div",{ref:n,className:"sg-card "+r,...s,children:t}))),o=t.forwardRef((({as:t="div",className:r,children:s,...n},o)=>{let a=["div","span","h1","h2","h3","h4","h5","h6"].find((e=>e===t))?t:"div";return e.jsx(a,{ref:o,className:`sg-card-header ${r}`,...n,children:s})})),a=t.forwardRef((({as:t="h5",className:r,children:s,...n},o)=>{let a=["h1","h2","h3","h4","h5","h6"].find((e=>e===t))?t:"h5";return e.jsx(a,{ref:o,className:r,...n,children:s})})),l=t.forwardRef((({children:t,className:r,...s},n)=>e.jsx("div",{ref:n,className:`sg-card-body ${r}`,...s,children:t}))),c=t.forwardRef((({children:t,className:r,...s},n)=>e.jsx("p",{ref:n,className:`sg-card-text ${r}`,...s,children:t}))),d=t.forwardRef((({children:t,className:r,...s},n)=>e.jsx("div",{ref:n,className:`sg-card-footer ${r}`,...s,children:t})));var i=Object.assign(n,{Header:o,Body:l,Title:a,Text:c,Footer:d});const u=t.forwardRef((({className:t,variant:r=!1,...s},n)=>e.jsx("button",{ref:n,className:`sg-button-close${r?" sg-button-close-white":""} ${t}`,...s,children:e.jsx("span",{className:"sg-close-visually-hidden-label",children:"Close"})}))),f=(e,t="")=>{let r=e.target,s=!0,n=!1;for(;s;)r.id!=t+"-menu"?r=r.parentElement:(n=!0,s=!1),"root"===r.id&&(s=!1,n=!1);return n},h=t.createContext(null),m=({children:t,value:r})=>e.jsx(h.Provider,{value:r,children:t}),p=()=>{const e=t.useContext(h);if(!e)throw new Error("useDropdownContext has to be used within DropdownContextProvider!");return e},g=t.forwardRef((({children:r,className:s,onSelect:n,onToggle:o,controlId:a,drop:l="down",align:c="start",autoClose:d=!0,show:i="default",...u},f)=>{const[h,p]=t.useState("default"!==i&&i),[g,v]=t.useState({case:""}),b=e=>{e.stopPropagation(),p((e=>!e))},w=((e,t,r=!1)=>{let s=e?r?"bottom-start":"bottom-end":r?"bottom-end":"bottom-start";return"up"===t?s=e?r?"top-start":"top-end":r?"top-end":"top-start":"end"===t?s=e?r?"left-end":"right-end":r?"left-start":"right-start":"start"===t?s=e?r?"right-end":"left-end":r?"right-start":"left-start":"down-centered"===t?s="bottom":"up-centered"===t&&(s="top"),s})("end"===c,l),x=t.useMemo((()=>({align:c,drop:l,showInternal:"default"!=i&&o?i:h,handleToggle:"default"!=i&&o?o:b,placement:w,directionClasses:{down:"dropdown","down-centered":"dropdown-center",up:"dropup","up-centered":"dropup-center dropup",end:"dropend",start:"dropstart"},controlId:a,activeDescendant:g,setActiveDescendant:v})),[c,l,i,h,o,w,a,g,v]);return e.jsx("div",{id:a+"-wrapper",ref:f,className:"sg-dropdown"+(s?" "+s:""),...u,children:e.jsx(m,{value:x,children:r})})})),v=t.forwardRef((({children:r,className:s,navDropdown:n=!1,as:o="button",variant:a="primary",...l},c)=>{const{controlId:d,handleToggle:i,setActiveDescendant:u,showInternal:h}=p(),m=o,g=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())},v=e=>{if(h&&e.target.id!==d)if(f(e,d)){if(f(e,d)){i(e);const t=document.getElementById(d);t?.focus()}}else i(e)};t.useEffect((()=>{const e=document.getElementById(d);return e.addEventListener("keydown",g,!0),document.addEventListener("mouseup",v,!0),function(){e.removeEventListener("keydown",g,!0),document.removeEventListener("mouseup",v,!0)}}),[g,d]);let b=`sg-button sg-button${a?"-"+a:"-primary"} sg-dropdown-toggle${s?" "+s:""}`;return("a"===m||n)&&(b="sg-nav-dropdown-toggle sg-dropdown-toggle"+(s?" "+s:"")),e.jsx(m,{tabIndex:"0",type:"button","aria-haspopup":"true","aria-controls":d+"-menu","aria-expanded":h,id:d,ref:c,className:b,onClick:e=>(e=>{i(e),h||u((e=>({...e,case:"first"})))})(e),...l,children:r})})),b=t.forwardRef((({children:r,className:s,style:n={},...o},a)=>{const{controlId:l,showInternal:c,activeDescendant:d}=p(),[i,u]=t.useState(n);t.useLayoutEffect((()=>{if(c){const e=document.getElementById(l+"-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}),u((e=>({...e,...t})))}}),[c]),t.useEffect((()=>{if(c){const e=document.getElementById(l+"-menu"),t=document.getElementById(l+"-menu").children,r=t.length-1,s=document.querySelector(".sg-dropdown-item-visual-focus");let n=0,o=t[0].children[0];if(null!=s){s.classList.remove("sg-dropdown-item-visual-focus");for(let e=0;e<t.length;e++)if(t[e]===s.parentElement){n=e;break}}switch(d.case){case"first":o=t[0].children[0],n=0;break;case"last":o=t[r].children[0],n=r;break;case"next":n=n===r?0:n+1,o=t[n].children[0];break;case"previous":n=0===n?r:n-1,o=t[n].children[0]}e.setAttribute("aria-activedescendant",o.id),t[n].children[0].classList.add("sg-dropdown-item-visual-focus")}else{document.getElementById(l+"-menu").setAttribute("aria-activedescendant","")}}),[l,c,d]);const f=e=>{const t=e.target;let r=t.classList.contains("sg-dropdown-item-visual-focus");const s=document.getElementById(l+"-menu");r||(document.querySelector(".sg-dropdown-item-visual-focus")?.classList.remove("sg-dropdown-item-visual-focus"),s.setAttribute("aria-activedescendant",""),t.classList.add("sg-dropdown-item-visual-focus"),s.setAttribute("aria-activedescendant",t.id))};return t.useEffect((()=>{const e=document.getElementById(l+"-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.jsx("ul",{id:l+"-menu",role:"menu",tabIndex:-1,"aria-labelledby":l,ref:a,className:`sg-dropdown-list${s?" "+s:""}${c?" show":""}`,style:i,...o,children:r})})),w=t.forwardRef((({children:t,as:r="button",className:s,...n},o)=>{const a=r;return e.jsx("li",{role:"none",children:e.jsx(a,{ref:o,role:"menuitem",tabIndex:"-1",className:"sg-dropdown-item"+(s?" "+s:""),...n,children:t})})})),x=t.forwardRef((({className:t="",...r},s)=>e.jsx("hr",{ref:s,className:`.sg-dropdown-divider${t}`,...r})));var N=Object.assign(g,{Toggle:v,Menu:b,Item:w,Divider:x});const j=t.createContext(null),y=({children:t,value:r})=>e.jsx(j.Provider,{value:r,children:t}),R=()=>{const e=t.useContext(j);if(!e)throw new Error("useFormContext has to be used within a FormContextProvider!");return e},C=t.forwardRef((({children:t,...r},s)=>e.jsx("form",{ref:s,...r,children:t}))),k=t.forwardRef((({as:t="input",className:r="",plaintext:s=!1,id:n="",type:o="text",autoFocus:a=!1,...l},c)=>{let d=t;const{controlId:i}=R();let u=i||n,f=(s?"sg-form-control-plaintext":"sg-form-control")+(""!=r?" "+r:"")+("color"==o?" sg-form-control-color":"");return e.jsx(d,{autoFocus:a,ref:c,id:u,type:o,className:f,...l})})),I=t.forwardRef((({children:t,className:r,id:s,...n},o)=>{const{controlId:a}=R();let l=a||s;return e.jsx("select",{ref:o,className:"sg-form-select"+(r?" "+r:""),id:l,...n,children:t})})),E=t.forwardRef((({children:r,className:s,controlId:n,...o},a)=>{const l=t.useMemo((()=>({controlId:n})),[n]);return e.jsx("div",{ref:a,className:"sg-from-group"+(s?" "+s:""),...o,children:e.jsx(y,{value:l,children:r})})})),T=t.forwardRef((({children:t,className:r,htmlFor:s},n)=>{const{controlId:o}=R();let a=s||o;return e.jsx("label",{ref:n,htmlFor:a,className:"sg-form-label"+(r?" "+r:""),children:t})})),S=t.forwardRef((({classNameContainer:t,containerRef:r,containerId:s,style:n,classNameLabel:o,labelRef:a,label:l,labelId:c,className:d,type:i,id:u,controlId:f,reverse:h=!1,checkStyle:m,...p},g)=>{let v=f||u,b="switch"===i?"checkbox":i;return e.jsx("div",{ref:r,id:s,style:n,className:`sg-form-check${h?"-reverse":""}${t?" "+t:""}${"switch"===i?" sg-form-switch":""}`,children:h?e.jsxs(e.Fragment,{children:[e.jsx("input",{ref:g,type:b,id:v,className:"sg-form-check-input"+(d?" "+d:""),...p}),e.jsx("label",{ref:a,id:c,htmlFor:v,className:"sg-form-check-label"+(o?" "+o:""),children:l})]}):e.jsxs(e.Fragment,{children:[e.jsx("label",{ref:a,id:c,htmlFor:v,className:"sg-form-check-label"+(o?" "+o:""),children:l}),e.jsx("input",{ref:g,type:b,id:v,className:"sg-form-check-input"+(d?" "+d:""),style:m,...p})]})})})),$=t.forwardRef((({children:t,className:r,...s},n)=>e.jsx("small",{ref:n,className:"sg-form-text"+(r?" "+r:""),...s,children:t})));var L=Object.assign(C,{Control:k,Select:I,Group:E,Label:T,Check:S,Text:$});const B=t.forwardRef((({children:r,label:s,controlId:n,className:o,htmlFor:a,...l},c)=>{const d=t.useMemo((()=>({controlId:n})),[n]);return e.jsx(y,{value:d,children:e.jsxs("div",{className:"sg-form-floating",children:[r,e.jsx("label",{ref:c,htmlFor:n,className:"sg-form-floating-label",...l,children:s})]})})})),D=t.forwardRef((({children:t,className:r,...s},n)=>e.jsx("div",{ref:n,className:"sg-input-group"+(r?" "+r:""),...s,children:t}))),P=t.forwardRef((({children:t,className:r,...s},n)=>e.jsx("span",{ref:n,className:"sg-input-group-text"+(r?" "+r:""),...s,children:t})));var A=Object.assign(D,{Text:P});const F=t.createContext(null),H=({children:t,value:r})=>e.jsx(F.Provider,{value:r,children:t}),M=t.forwardRef((({children:r,as:s="",className:n="",closeButton:o=!1,onClick:a,...l},c)=>{let d=["div","span","h1","h2","h3","h4","h5","h6"].find((e=>e===s))?s:"div";const i=(()=>{const e=t.useContext(F);if(!e)throw new Error("useModalContext has to be used within ModalContextProvider!");return e})();return e.jsxs(d,{ref:c,className:`sg-modal-header ${n}`,...l,children:[r,o?e.jsx(u,{variant:!0,onClick:e=>(e=>{a&&a(e),i()})(e)}):null]})})),O=t.forwardRef((({children:t,as:r="h4",className:s,...n},o)=>{let a=["div","span","h1","h2","h3","h4","h5","h6"].find((e=>e===r))?r:"h4";return e.jsx(a,{ref:o,className:`sg-modal-title ${s}`,...n,children:t})})),q=t.forwardRef((({children:t,className:r,...s},n)=>e.jsx("div",{ref:n,className:`sg-modal-body ${r}`,...s,children:t}))),z=t.forwardRef((({children:t,className:r,...s},n)=>e.jsx("div",{ref:n,className:`sg-modal-footer ${r}`,...s,children:t})));var W=Object.assign((({children:s,centered:n=!1,size:o="md",show:a,backdrop:l="static",onHide:c,className:d,id:i,...u})=>{const[f,h]=t.useState(a);t.useEffect((()=>{h(a)}),[a]);const m=t.useRef(null);X(m);let p="boolean"==typeof a&&"function"==typeof c?void 0:{show:"boolean"==typeof a,onHide:"function"==typeof c};p&&console.error(p.show?null:"The variable 'show' must be used and must be a boolean used to decide when to show the modal!",p.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 g=()=>{c&&c(),h(!1)};t.useEffect((()=>{const e=m.current;e&&(f?(e.classList.remove("close"),e.showModal()):e.close())}),[f]);let v=`sg-modal-tag sg-modal-${o}`;d&&(v+=" "+d),"static"!==l&&"true"!==l||(v+=" sg-modal-static");return r.createPortal(e.jsx("dialog",{ref:m,className:v,onKeyDown:e=>(e=>{if("Escape"!=e.key)return;e.preventDefault();const t=m.current;t.classList.add("close"),t.addEventListener("animationend",(()=>{g()}),{once:!0})})(e),...u,children:e.jsx(H,{value:c,children:p?e.jsx(Y,{typeCheck:p,closeModal:g}):s})}),document.body)}),{Header:M,Title:O,Body:q,Footer:z});const X=function(e){t.useEffect((()=>{const t=t=>{const r='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',s=e.current;if(s){const e=s.querySelectorAll(r)[0],n=s.querySelectorAll(r),o=n[n.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])},Y=({typeCheck:t,closeModal:r})=>e.jsxs(e.Fragment,{children:[e.jsx(M,{closeButton:!0,children:e.jsx(O,{children:"An Error ocurred!"})}),e.jsx(q,{children:e.jsxs("p",{children:[t.show?null:"The variable 'show' must be used and must be a boolean used to decide when to show the modal!",t.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.jsx(z,{children:e.jsx(s,{variant:"danger",type:"button",onClick:()=>r(),children:"Close"})})]}),K=t.createContext(null),G=({children:t,value:r})=>e.jsx(K.Provider,{value:r,children:t}),U=t.forwardRef((({children:r,className:s,navbarPrefix:n="sg-navbar-",...o},a)=>{const l=t.useMemo((()=>n),[n]);return e.jsx("nav",{ref:a,className:"sg-navbar"+(s?" "+s:""),...o,children:e.jsx(G,{value:l,children:r})})})),J=t.forwardRef((({children:t,className:r,href:s="#",as:n="a",...o},a)=>{const l=n||(s&&"Link"!=n?"a":"span");return e.jsx(l,{ref:a,href:s,className:"sg-navbar-brand"+(r?" "+r:""),...o,children:t})})),Q=t.forwardRef((({children:t,className:r,as:s="span",...n},o)=>{const a=s;return e.jsx(a,{ref:o,className:"sg-navbar-text"+(r?" "+r:""),...n,children:t})}));var V=Object.assign(U,{Brand:J,Text:Q});const Z=t.forwardRef((({children:r,className:s,as:n="ul",...o},a)=>{const l=n,c=t.useContext(K),d=c||"sg-navbar-";return e.jsx(l,{ref:a,className:`${s} ${d}nav`,...o,children:r})})),_=t.forwardRef((({children:t,className:r,as:s="li",...n},o)=>{const a=s;return e.jsx(a,{role:"none",ref:o,className:"sg-nav-item"+(r?" "+r:""),...n,children:t})})),ee=t.forwardRef((({children:t,className:r,as:s="a",...n},o)=>{const a=s;return e.jsx(a,{role:"menuitem",ref:o,className:"sg-nav-link"+(r?" "+r:""),...n,children:t})}));var te=Object.assign(Z,{Item:_,Link:ee});const re=t.forwardRef((({children:r,className:s,onSelect:n,onToggle:o,controlId:a,toggleProps:l,title:c,menuProps:d,drop:i="down",align:u="start",autoClose:f=!0,show:h="default",...p},g)=>{const[v,b]=t.useState("default"!==h&&h),[w,x]=t.useState({case:""}),j=t.useCallback((e=>{e.stopPropagation(),b((e=>!e))}),[]),y=((e,t,r=!1)=>{let s=e?r?"bottom-start":"bottom-end":r?"bottom-end":"bottom-start";return"up"===t?s=e?r?"top-start":"top-end":r?"top-end":"top-start":"end"===t?s=e?r?"left-end":"right-end":r?"left-start":"right-start":"start"===t?s=e?r?"right-end":"left-end":r?"right-start":"left-start":"down-centered"===t?s="bottom":"up-centered"===t&&(s="top"),s})("end"===u,i),R={down:"dropdown","down-centered":"dropdown-center",up:"dropup","up-centered":"dropup-center dropup",end:"dropend",start:"dropstart"},C=a,k=t.useMemo((()=>({align:u,drop:i,showInternal:"default"!=h&&o?h:v,handleToggle:"default"!=h&&o?o:j,placement:y,directionClasses:{down:"dropdown","down-centered":"dropdown-center",up:"dropup","up-centered":"dropup-center dropup",end:"dropend",start:"dropstart"},controlId:C,activeDescendant:w,setActiveDescendant:x})),[u,i,h,v,o,j,y,R,a,w,x]);return e.jsx("div",{ref:g,id:a+"-wrapper",className:`sg-dropdown${s?" "+s:""} sg-nav-item`,...p,children:e.jsxs(m,{value:k,children:[e.jsx(N.Toggle,{navDropdown:!0,...l,children:c}),e.jsx(N.Menu,{...d,children:r})]})})}));var se=Object.assign(re,{Toggle:N.Toggle,Menu:N.Menu,Item:N.Item,Divider:N.Divider});const ne=t.forwardRef((({children:s,initialPosition:n={top:0,left:0},id:o,resize:a=!1,move:l=!1,className:c,style:d,...i},u)=>{const[f,h]=t.useState({offSetTop:0,offSetLeft:0,...n}),m=a?"true":"false",p=l?"true":"false",g=t.useRef(u),v=t.useRef(null),[b,w]=t.useState(!1),x=t.useRef(b);t.useEffect((()=>{x.current=b}),[b]);const N=()=>{l&&(v.current.style.removeProperty("user-select"),w(!1))};return t.useEffect((()=>(document.body.addEventListener("pointerup",(()=>N()),!0),function(){document.body.removeEventListener("pointerup",(()=>N()),!0)})),[]),r.createPortal(e.jsx("dialog",{"data-resize":m,"data-move":p,"data-passedRef":g,ref:v,id:o,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(l&&t.className.includes("sg-popout-title")||t.className.includes("sg-popout-header")){const{top:t,left:r}=v.current.getBoundingClientRect();h((s=>({...s,offSetTop:e.clientY-t,offSetLeft:e.clientX-r}))),v.current.style.setProperty("user-select","none"),v.current.setPointerCapture(e.pointerId),w(!0)}},onPointerMove:e=>(e=>{if(l&&x.current&&v.current){const t=e.clientY-f.offSetTop<0,r=window.innerHeight-(e.clientY-f.offSetTop+v.current.offsetHeight)<0,s=e.clientX-f.offSetLeft<0,n=window.innerWidth-(e.clientX-f.offSetLeft+v.current.offsetWidth)<0;let o=t?0:e.clientY-f.offSetTop;o=r?window.innerHeight-v.current.offsetHeight:o;let a=s?0:e.clientX-f.offSetLeft;a=n?window.innerWidth-v.current.offsetWidth:a,h((e=>({...e,top:o,left:a})))}})(e),...i,children:s}),document.body)})),oe=t.forwardRef((({children:t,className:r,as:s="div",...n},o)=>{let a=["div","span","h1","h2","h3","h4","h5","h6"].find((e=>e===s))?s:"div";return e.jsx(a,{ref:o,className:`sg-popout-header ${r}`,...n,children:t})})),ae=t.forwardRef((({as:t="h4",className:r,children:s,...n},o)=>{let a=["h1","h2","h3","h4","h5","h6"].find((e=>e===t))?t:"h5";return e.jsx(a,{ref:o,className:`sg-popout-title ${r}`,...n,children:s})})),le=t.forwardRef((({children:t,className:r,...s},n)=>e.jsx("div",{ref:n,className:`sg-popout-body ${r}`,...s,children:t}))),ce=t.forwardRef((({children:t,className:r,...s},n)=>e.jsx("p",{ref:n,className:`sg-popout-text ${r}`,...s,children:t}))),de=t.forwardRef((({children:t,className:r,...s},n)=>e.jsx("div",{ref:n,className:`sg-popout-footer ${r}`,...s,children:t})));var ie=Object.assign(ne,{Header:oe,Title:ae,Body:le,Text:ce,Footer:de});const ue=t.forwardRef((({size:t="1em",color:r="white",label:s,className:n,controlId:o,...a},l)=>e.jsxs(e.Fragment,{children:[e.jsx("div",{"aria-labelledby":o,role:"status",ref:l,className:"sg-spinner"+(n?" "+n:""),style:{width:t,height:t,borderColor:r},...a}),e.jsx("label",{id:o,className:"sg-visually-hidden",children:s})]}))),fe=t.forwardRef((({children:t,size:r="lg",className:s,...n},o)=>{let a=`sg-table${s?" "+s:""}${"sm"===r?" sg-table-sm":""}`;return e.jsx("table",{ref:o,className:a,...n,children:t})})),he=t.createContext(null),me=({children:t,value:r})=>e.jsx(he.Provider,{value:r,children:t}),pe=()=>{const e=t.useContext(he);if(!e)throw new Error("useTabContext has to be used within a TabContextProvider!");return e},ge=t.forwardRef((({children:r,className:s,controlId:n,activeClassName:o,defaultActive:a,...l},c)=>{const[d,i]=t.useState(a),u=o||"sg-active",f=t.useMemo((()=>({activeTab:d,setActiveTab:i,controlId:n,activeClass:u})),[d,i,n]);return e.jsx(me,{value:f,children:e.jsx("div",{ref:c,id:n+"-tab-wrapper",className:"sg-tabs"+(s?" "+s:""),...l,children:r})})})),ve=t.forwardRef((({children:t,className:r,...s},n)=>{const{controlId:o,activeClass:a}=pe();return e.jsx("div",{onKeyDown:e=>(e=>{const t=e.key,r=document.getElementById(o+"-tab-controls");if(r){const s=Array.from(r.children);if("ArrowRight"===t||"ArrowLeft"===t){e.preventDefault();const r=document.querySelector(".sg-tabs-button."+a),n=s.indexOf(r),o="ArrowRight"===t?1:-1,l=n+o<0?s.length-1:n+o>=s.length?0:n+o;s[l].focus(),s[l].click()}else if("Home"===t||"End"===t){e.preventDefault();const r="Home"===t?0:s.length-1;s[r].focus(),s[r].click()}}})(e),role:"tablist",id:o+"-tab-controls",ref:n,className:"sg-tabs-controls"+(r?" "+r:""),...s,children:t})})),be=t.forwardRef((({children:t,className:r,onClick:s,tabId:n,id:o,...a},l)=>{const{activeTab:c,setActiveTab:d,activeClass:i}=pe(),u="sg-tabs-button"+(r?" "+r:"")+(c===n?" "+i:""),f=c===n;return e.jsx("button",{role:"tab",type:"button",id:n+"-button",ref:l,onClick:e=>(e=>{d(n),s&&s(e)})(e),className:u,...a,tabIndex:f?0:-1,"aria-selected":f?"true":"false","aria-controls":n+"-page",children:t})})),we=t.forwardRef((({children:t,className:r,...s},n)=>e.jsx("div",{role:"none",ref:n,className:"sg-tabs-content"+(r?" "+r:""),...s,children:t}))),xe=t.forwardRef((({children:t,className:r,tabId:s,...n},o)=>{const{activeTab:a,activeClass:l}=pe(),c="sg-tabs-page"+(r?" "+r:"")+(a===s?" "+l:"");return e.jsx("div",{role:"tabpanel",id:s+"-page","aria-labelledby":s+"-button",ref:o,className:c,...n,children:t})}));var Ne=Object.assign(ge,{Controls:ve,Button:be,Content:we,Page:xe});const je=t.forwardRef((({children:r,toggled:s="false",onClick:n,...o},a)=>{const[l,c]=t.useState("true"===s);return e.jsx("button",{onClick:e=>(e=>{c((e=>!e)),n&&n(e)})(e),"data-toggled":l,...o,children:r})}));exports.Button=s,exports.Card=i,exports.CloseButton=u,exports.Dropdown=N,exports.FloatingLabel=B,exports.Form=L,exports.InputGroup=A,exports.Modal=W,exports.Nav=te,exports.NavBar=V,exports.NavDropdown=se,exports.Popout=ie,exports.Spinner=ue,exports.Table=fe,exports.Tabs=Ne,exports.ToggleButton=je;
|
|
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","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","elementId","computedClassName","Select","Group","Label","htmlFor","elementHtmlFor","Check","classNameContainer","containerRef","containerId","classNameLabel","labelRef","label","labelId","reverse","checkStyle","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","jsxs","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","Fragment","width","height","borderColor","Table","classesComputed","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":"0FAIM,MAAAA,EAASC,EAAAA,YAA2C,EAAEC,WAAUC,UAAQ,UAAWC,eAAcC,GAAOC,IAItGC,EAAAC,IAAA,SAAA,CAAQF,IAAKA,EAAKG,KAAK,SAASL,UAAW,uBAAuBD,IAAuBO,MAAbN,EAAyB,GAAK,IAAIA,OAAiBC,EAAIH,SAC9HA,MCLPS,EAAOV,EAAUA,YAA4B,EAAEC,WAAUE,eAAcQ,GAAYN,IAkBjFC,EAAKC,IAAA,MAAA,CAAAF,IAAKA,EAAKF,UAAW,WAAkBA,KAAeQ,WACtDV,MAKPW,EAASZ,EAAAA,YAAmF,EAAEa,KAAG,MAAOV,YAAWF,cAAaU,GAAYN,KAC9I,IACIS,EADU,CAAC,MAAO,OAAQ,KAAM,KAAM,KAAM,KAAM,KAAM,MACpCC,MAAKC,GAASA,IAAUH,IAAMA,EAAK,MAE3D,O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AChG,MAAMmQ,UAAEA,EAASE,YAAEA,GAAgBN,KAC7BhF,EAAoB,gBAAkBjL,EAAY,IAAIA,EAAU,KAAOqQ,IAAcY,EAAQ,IAAIV,EAAc,IACrH,OACIpQ,EAAAC,IAAA,MAAA,CACIqH,KAAK,WAAW5F,GAAIoP,EAAM,QAAO,kBAAmBA,EAAM,UAC1D/Q,IAAKA,EAAKF,UAAWiL,KAAuBzK,EAASV,SAEpDA,GAER,IAGL,IAAAuR,GAAgBlQ,OAAOC,OAAO8O,GAAM,CAChCM,SAAUA,GACV5Q,OAAQA,GACRuR,QAASA,GACTC,KAAMA,KC5GJ,MAAAE,GAAezR,EAAAA,YAAiD,EAAEC,WAAUyR,UAAQ,QAAS9L,aAAYjF,GAAYN,KACvH,MAAQsR,EAAiBC,GAAuBxO,EAAAA,SAA8B,SAAZsO,GAOlE,OACIpR,EAAAA,cAAQsF,QAAUlE,GAPF,CAACA,IACjBkQ,GAAmBlO,IAASA,IACzBkC,GACCA,EAAQlE,EACX,EAG2ByD,CAAYzD,kBAAsBiQ,KAAqBhR,EAC9EV,SAAAA,GAER"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type BaseAnchorType = React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
|
|
3
|
+
export type BaseButtonType = React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
|
|
4
|
+
export type BaseDialogType = React.DetailedHTMLProps<React.DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement>;
|
|
5
|
+
export type BaseDivType = React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
6
|
+
export type BaseFormType = React.DetailedHTMLProps<React.FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>;
|
|
7
|
+
export type BaseHeadingType = React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
|
|
8
|
+
export type BaseInputType = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
9
|
+
export type BaseHrType = React.DetailedHTMLProps<React.HTMLAttributes<HTMLHRElement>, HTMLHRElement>;
|
|
10
|
+
export type BaseLabelType = React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>;
|
|
11
|
+
export type BaseLItemType = React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>;
|
|
12
|
+
export type BaseNavType = React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
13
|
+
export type BaseParagraphType = React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>;
|
|
14
|
+
export type BaseSelectType = React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>;
|
|
15
|
+
export type BaseSmallType = React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
16
|
+
export type BaseSpanType = React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>;
|
|
17
|
+
export type BaseTableType = React.DetailedHTMLProps<React.TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>;
|
|
18
|
+
export type BaseUListType = React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>;
|
|
19
|
+
export type BaseElementType = React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Button";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CardBodyType, CardFooterType, CardTextType, CardType } from "./Card.types";
|
|
3
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<CardType, "ref"> & React.RefAttributes<HTMLDivElement>> & {
|
|
4
|
+
Header: React.ForwardRefExoticComponent<(Omit<{
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
className?: string | undefined;
|
|
7
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
8
|
+
} & React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement>, "ref"> | Omit<{
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
className?: string | undefined;
|
|
11
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
12
|
+
} & React.ClassAttributes<HTMLHeadingElement> & React.HTMLAttributes<HTMLHeadingElement>, "ref"> | Omit<{
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
className?: string | undefined;
|
|
15
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
16
|
+
} & React.ClassAttributes<HTMLSpanElement> & React.HTMLAttributes<HTMLSpanElement>, "ref">) & React.RefAttributes<HTMLDivElement | HTMLHeadingElement | HTMLSpanElement>>;
|
|
17
|
+
Body: React.ForwardRefExoticComponent<Omit<CardBodyType, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
Title: React.ForwardRefExoticComponent<(Omit<{
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
className?: string | undefined;
|
|
21
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
22
|
+
} & React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement>, "ref"> | Omit<{
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
className?: string | undefined;
|
|
25
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
26
|
+
} & React.ClassAttributes<HTMLHeadingElement> & React.HTMLAttributes<HTMLHeadingElement>, "ref"> | Omit<{
|
|
27
|
+
children: React.ReactNode;
|
|
28
|
+
className?: string | undefined;
|
|
29
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
30
|
+
} & React.ClassAttributes<HTMLSpanElement> & React.HTMLAttributes<HTMLSpanElement>, "ref">) & React.RefAttributes<HTMLHeadingElement>>;
|
|
31
|
+
Text: React.ForwardRefExoticComponent<Omit<CardTextType, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
32
|
+
Footer: React.ForwardRefExoticComponent<Omit<CardFooterType, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
33
|
+
};
|
|
34
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { BaseDivType, BaseHeadingType, BaseSpanType, BaseParagraphType } from "../../BaseTypes";
|
|
3
|
+
export type CardType = {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
} & BaseDivType;
|
|
7
|
+
export type CardHeaderPossible = BaseDivType | BaseSpanType | BaseHeadingType;
|
|
8
|
+
export type CardHeaderType = {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
as?: React.ElementType;
|
|
12
|
+
} & CardHeaderPossible;
|
|
13
|
+
export type CardBodyType = {
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
className?: string;
|
|
16
|
+
} & BaseDivType;
|
|
17
|
+
export type CardTextType = {
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
className?: string;
|
|
20
|
+
} & BaseParagraphType;
|
|
21
|
+
export type CardFooterType = {
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
className?: string;
|
|
24
|
+
} & BaseDivType;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Card";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./CloseButton";
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { DropdownContextType, DropdownDividerType, DropdownMenuType, DropdownType } from "./Dropdown.types";
|
|
3
|
+
export declare const DropdownContext: React.Context<DropdownContextType | null>;
|
|
4
|
+
export declare const DropdownContextProvider: ({ children, value }: {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
value: DropdownContextType;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const useDropdownContext: () => DropdownContextType;
|
|
9
|
+
export declare const Toggle: React.ForwardRefExoticComponent<(Omit<{
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
className?: string | undefined;
|
|
12
|
+
navDropdown?: boolean | undefined;
|
|
13
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
14
|
+
variant?: string | undefined;
|
|
15
|
+
} & React.ClassAttributes<HTMLAnchorElement> & React.AnchorHTMLAttributes<HTMLAnchorElement>, "ref"> | Omit<{
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
className?: string | undefined;
|
|
18
|
+
navDropdown?: boolean | undefined;
|
|
19
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
20
|
+
variant?: string | undefined;
|
|
21
|
+
} & React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement>, "ref"> | Omit<{
|
|
22
|
+
children: React.ReactNode;
|
|
23
|
+
className?: string | undefined;
|
|
24
|
+
navDropdown?: boolean | undefined;
|
|
25
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
26
|
+
variant?: string | undefined;
|
|
27
|
+
} & React.ClassAttributes<HTMLElement> & React.HTMLAttributes<HTMLElement>, "ref">) & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
28
|
+
export declare const Menu: React.ForwardRefExoticComponent<Omit<DropdownMenuType, "ref"> & React.RefAttributes<HTMLUListElement>>;
|
|
29
|
+
export declare const Item: React.ForwardRefExoticComponent<(Omit<{
|
|
30
|
+
children: React.ReactNode;
|
|
31
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
32
|
+
className?: string | undefined;
|
|
33
|
+
} & React.ClassAttributes<HTMLAnchorElement> & React.AnchorHTMLAttributes<HTMLAnchorElement>, "ref"> | Omit<{
|
|
34
|
+
children: React.ReactNode;
|
|
35
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
36
|
+
className?: string | undefined;
|
|
37
|
+
} & React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement>, "ref">) & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
38
|
+
export declare const Divider: React.ForwardRefExoticComponent<Omit<DropdownDividerType, "ref"> & React.RefAttributes<HTMLHRElement>>;
|
|
39
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<DropdownType, "ref"> & React.RefAttributes<HTMLDivElement>> & {
|
|
40
|
+
Toggle: React.ForwardRefExoticComponent<(Omit<{
|
|
41
|
+
children: React.ReactNode;
|
|
42
|
+
className?: string | undefined;
|
|
43
|
+
navDropdown?: boolean | undefined;
|
|
44
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
45
|
+
variant?: string | undefined;
|
|
46
|
+
} & React.ClassAttributes<HTMLAnchorElement> & React.AnchorHTMLAttributes<HTMLAnchorElement>, "ref"> | Omit<{
|
|
47
|
+
children: React.ReactNode;
|
|
48
|
+
className?: string | undefined;
|
|
49
|
+
navDropdown?: boolean | undefined;
|
|
50
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
51
|
+
variant?: string | undefined;
|
|
52
|
+
} & React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement>, "ref"> | Omit<{
|
|
53
|
+
children: React.ReactNode;
|
|
54
|
+
className?: string | undefined;
|
|
55
|
+
navDropdown?: boolean | undefined;
|
|
56
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
57
|
+
variant?: string | undefined;
|
|
58
|
+
} & React.ClassAttributes<HTMLElement> & React.HTMLAttributes<HTMLElement>, "ref">) & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
59
|
+
Menu: React.ForwardRefExoticComponent<Omit<DropdownMenuType, "ref"> & React.RefAttributes<HTMLUListElement>>;
|
|
60
|
+
Item: React.ForwardRefExoticComponent<(Omit<{
|
|
61
|
+
children: React.ReactNode;
|
|
62
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
63
|
+
className?: string | undefined;
|
|
64
|
+
} & React.ClassAttributes<HTMLAnchorElement> & React.AnchorHTMLAttributes<HTMLAnchorElement>, "ref"> | Omit<{
|
|
65
|
+
children: React.ReactNode;
|
|
66
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
67
|
+
className?: string | undefined;
|
|
68
|
+
} & React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement>, "ref">) & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
69
|
+
Divider: React.ForwardRefExoticComponent<Omit<DropdownDividerType, "ref"> & React.RefAttributes<HTMLHRElement>>;
|
|
70
|
+
};
|
|
71
|
+
export default _default;
|