stargazer-ui 1.0.9 → 1.0.10
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/BaseTypes.d.ts +1 -1
- package/dist/Button/Button.js +2 -0
- package/dist/Button/Button.js.map +1 -0
- package/dist/{components/Button → Button}/Button.types.d.ts +1 -1
- package/dist/Button/index.d.ts +2 -0
- package/dist/Button/index.js +2 -0
- package/dist/Button/index.js.map +1 -0
- package/dist/Card/Card.js +2 -0
- package/dist/Card/Card.js.map +1 -0
- package/dist/{components/Card → Card}/Card.types.d.ts +1 -1
- package/dist/Card/index.d.ts +2 -0
- package/dist/CloseButton/CloseButton.js +2 -0
- package/dist/CloseButton/CloseButton.js.map +1 -0
- package/dist/{components/CloseButton → CloseButton}/CloseButton.types.d.ts +1 -1
- package/dist/CloseButton/index.d.ts +2 -0
- package/dist/Dropdown/Dropdown.js +2 -0
- package/dist/Dropdown/Dropdown.js.map +1 -0
- package/dist/{components/Dropdown → Dropdown}/Dropdown.types.d.ts +1 -1
- package/dist/Dropdown/index.d.ts +3 -0
- package/dist/FloatingLabel/FloatingLabel.js +2 -0
- package/dist/FloatingLabel/FloatingLabel.js.map +1 -0
- package/dist/{components/FloatingLabel → FloatingLabel}/FloatingLabel.types.d.ts +1 -1
- package/dist/FloatingLabel/index.d.ts +2 -0
- package/dist/Form/Form.js +2 -0
- package/dist/Form/Form.js.map +1 -0
- package/dist/{components/Form → Form}/Form.types.d.ts +1 -1
- package/dist/Form/index.d.ts +3 -0
- package/dist/InputGroup/InputGroup.js +2 -0
- package/dist/InputGroup/InputGroup.js.map +1 -0
- package/dist/{components/InputGroup → InputGroup}/InputGroup.types.d.ts +1 -1
- package/dist/InputGroup/index.d.ts +3 -0
- package/dist/Modal/Modal.js +2 -0
- package/dist/Modal/Modal.js.map +1 -0
- package/dist/{components/Modal → Modal}/Modal.types.d.ts +1 -1
- package/dist/Modal/index.d.ts +2 -0
- package/dist/Nav/Nav.js +2 -0
- package/dist/Nav/Nav.js.map +1 -0
- package/dist/{components/Nav → Nav}/Nav.types.d.ts +1 -1
- package/dist/Nav/index.d.ts +3 -0
- package/dist/{components/NavBar → NavBar}/Navbar.d.ts +1 -2
- package/dist/NavBar/Navbar.js +2 -0
- package/dist/NavBar/Navbar.js.map +1 -0
- package/dist/{components/NavBar → NavBar}/Navbar.types.d.ts +2 -1
- package/dist/NavBar/index.d.ts +3 -0
- package/dist/{components/NavDropdown → NavDropdown}/NavDropdown.d.ts +2 -2
- package/dist/NavDropdown/NavDropdown.js +2 -0
- package/dist/NavDropdown/NavDropdown.js.map +1 -0
- package/dist/NavDropdown/index.d.ts +2 -0
- package/dist/Popout/Popout.js +2 -0
- package/dist/Popout/Popout.js.map +1 -0
- package/dist/{components/Popout → Popout}/Popout.types.d.ts +1 -1
- package/dist/Popout/index.d.ts +2 -0
- package/dist/Spinner/Spinner.js +2 -0
- package/dist/Spinner/Spinner.js.map +1 -0
- package/dist/Spinner/index.d.ts +2 -0
- package/dist/Table/Table.js +2 -0
- package/dist/Table/Table.js.map +1 -0
- package/dist/{components/Table → Table}/Table.types.d.ts +1 -1
- package/dist/Table/index.d.ts +3 -0
- package/dist/Tabs/Tabs.js +2 -0
- package/dist/Tabs/Tabs.js.map +1 -0
- package/dist/{components/Tabs → Tabs}/Tabs.types.d.ts +1 -1
- package/dist/Tabs/index.d.ts +2 -0
- package/dist/ToggleButton/ToggleButton.d.ts +4 -0
- package/dist/ToggleButton/ToggleButton.js +2 -0
- package/dist/ToggleButton/ToggleButton.js.map +1 -0
- package/dist/ToggleButton/ToggleButton.types.d.ts +7 -0
- package/dist/ToggleButton/index.d.ts +2 -0
- package/dist/index.d.ts +17 -1
- package/dist/index.js +2 -34
- package/dist/index.js.map +1 -0
- package/package.json +6 -5
- package/dist/BaseTypes.js +0 -1
- package/dist/components/Button/Button.js +0 -6
- package/dist/components/Button/Button.types.js +0 -1
- package/dist/components/Button/index.d.ts +0 -1
- package/dist/components/Button/index.js +0 -4
- package/dist/components/Card/Card.js +0 -18
- package/dist/components/Card/Card.types.js +0 -1
- package/dist/components/Card/index.d.ts +0 -1
- package/dist/components/Card/index.js +0 -4
- package/dist/components/CloseButton/CloseButton.js +0 -6
- package/dist/components/CloseButton/CloseButton.types.js +0 -1
- package/dist/components/CloseButton/index.d.ts +0 -1
- package/dist/components/CloseButton/index.js +0 -4
- package/dist/components/Dropdown/Dropdown.js +0 -205
- package/dist/components/Dropdown/Dropdown.types.js +0 -1
- package/dist/components/Dropdown/index.d.ts +0 -1
- package/dist/components/Dropdown/index.js +0 -4
- package/dist/components/FloatingLabel/FloatingLabel.js +0 -13
- package/dist/components/FloatingLabel/FloatingLabel.types.js +0 -1
- package/dist/components/FloatingLabel/index.d.ts +0 -1
- package/dist/components/FloatingLabel/index.js +0 -4
- package/dist/components/Form/Form.js +0 -63
- package/dist/components/Form/Form.types.js +0 -1
- package/dist/components/Form/index.d.ts +0 -1
- package/dist/components/Form/index.js +0 -4
- package/dist/components/InputGroup/InputGroup.js +0 -8
- package/dist/components/InputGroup/InputGroup.types.js +0 -1
- package/dist/components/InputGroup/index.d.ts +0 -1
- package/dist/components/InputGroup/index.js +0 -4
- package/dist/components/Modal/Modal.js +0 -100
- package/dist/components/Modal/Modal.types.js +0 -1
- package/dist/components/Modal/index.d.ts +0 -1
- package/dist/components/Modal/index.js +0 -4
- package/dist/components/Nav/Nav.js +0 -13
- package/dist/components/Nav/Nav.types.js +0 -1
- package/dist/components/Nav/index.d.ts +0 -1
- package/dist/components/Nav/index.js +0 -4
- package/dist/components/NavBar/Navbar.js +0 -17
- package/dist/components/NavBar/Navbar.types.js +0 -1
- package/dist/components/NavBar/index.d.ts +0 -1
- package/dist/components/NavBar/index.js +0 -4
- package/dist/components/NavDropdown/NavDropdown.js +0 -62
- package/dist/components/NavDropdown/NavDropdown.types.js +0 -1
- package/dist/components/NavDropdown/index.d.ts +0 -1
- package/dist/components/NavDropdown/index.js +0 -4
- package/dist/components/Popout/Popout.js +0 -72
- package/dist/components/Popout/Popout.types.js +0 -1
- package/dist/components/Popout/index.d.ts +0 -1
- package/dist/components/Popout/index.js +0 -4
- package/dist/components/Spinner/Spinner.js +0 -9
- package/dist/components/Spinner/Spinner.types.js +0 -1
- package/dist/components/Spinner/index.d.ts +0 -1
- package/dist/components/Spinner/index.js +0 -4
- package/dist/components/Table/Table.js +0 -9
- package/dist/components/Table/Table.types.js +0 -1
- package/dist/components/Table/index.d.ts +0 -1
- package/dist/components/Table/index.js +0 -4
- package/dist/components/Tabs/Tabs.js +0 -77
- package/dist/components/Tabs/Tabs.types.js +0 -1
- package/dist/components/Tabs/index.d.ts +0 -1
- package/dist/components/Tabs/index.js +0 -4
- package/dist/components/ToggleButton/ToggleButton.d.ts +0 -9
- package/dist/components/ToggleButton/ToggleButton.js +0 -11
- package/dist/components/ToggleButton/ToggleButton.types.d.ts +0 -0
- package/dist/components/ToggleButton/ToggleButton.types.js +0 -1
- package/dist/components/ToggleButton/index.d.ts +0 -1
- package/dist/components/ToggleButton/index.js +0 -4
- package/dist/components/index.d.ts +0 -16
- package/dist/components/index.js +0 -34
- package/dist/vite-env.d.js +0 -1
- /package/dist/{components/Button → Button}/Button.d.ts +0 -0
- /package/dist/{components/Card → Card}/Card.d.ts +0 -0
- /package/dist/{components/CloseButton → CloseButton}/CloseButton.d.ts +0 -0
- /package/dist/{components/Dropdown → Dropdown}/Dropdown.d.ts +0 -0
- /package/dist/{components/FloatingLabel → FloatingLabel}/FloatingLabel.d.ts +0 -0
- /package/dist/{components/Form → Form}/Form.d.ts +0 -0
- /package/dist/{components/InputGroup → InputGroup}/InputGroup.d.ts +0 -0
- /package/dist/{components/Modal → Modal}/Modal.d.ts +0 -0
- /package/dist/{components/Nav → Nav}/Nav.d.ts +0 -0
- /package/dist/{components/NavDropdown → NavDropdown}/NavDropdown.types.d.ts +0 -0
- /package/dist/{components/Popout → Popout}/Popout.d.ts +0 -0
- /package/dist/{components/Spinner → Spinner}/Spinner.d.ts +0 -0
- /package/dist/{components/Spinner → Spinner}/Spinner.types.d.ts +0 -0
- /package/dist/{components/Table → Table}/Table.d.ts +0 -0
- /package/dist/{components/Tabs → Tabs}/Tabs.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stargazer-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "React component library made by Stargazer Works",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
|
-
"
|
|
6
|
+
"typings": "dist/index.d.ts",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"files": [
|
|
9
9
|
"dist",
|
|
10
10
|
"package.json",
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
"README.md",
|
|
12
|
+
"ChangeLogs.md"
|
|
13
13
|
],
|
|
14
14
|
"scripts": {
|
|
15
15
|
"test": "\"echo \\\"Error: no test specified\\\" && exit 1\"",
|
|
16
16
|
"dev": "vite --config vite.config.js --port 5000",
|
|
17
|
-
"build": "tsc && vite build --config vite.config.js",
|
|
17
|
+
"build": "tsc --p ./tsconfig-build.json && vite build --config vite.config.js",
|
|
18
18
|
"rollup": "rimraf dist && rollup -c"
|
|
19
19
|
},
|
|
20
20
|
"type": "module",
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
"vite-plugin-dts": "^3.7.3"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
|
+
"rollup-plugin-generate-package-json": "^3.2.0",
|
|
73
74
|
"sass": "^1.71.1",
|
|
74
75
|
"tslib": "^2.6.2"
|
|
75
76
|
}
|
package/dist/BaseTypes.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as f } from "react";
|
|
3
|
-
const s = f(({ children: o, variant: r = "primary", className: t, ...n }, u) => /* @__PURE__ */ e("button", { ref: u, type: "button", className: `sg-button sg-button-${r}${t == null ? "" : " " + t}`, ...n, children: o }));
|
|
4
|
-
export {
|
|
5
|
-
s as default
|
|
6
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./Button";
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as d } from "react";
|
|
3
|
-
const h = d(({ children: e, className: r, ...t }, s) => /* @__PURE__ */ a("div", { ref: s, className: "sg-card " + r, ...t, children: e })), l = d(({ as: e = "div", className: r, children: t, ...s }, o) => {
|
|
4
|
-
let n = ["div", "span", "h1", "h2", "h3", "h4", "h5", "h6"].find((c) => c === e) ? e : "div";
|
|
5
|
-
return /* @__PURE__ */ a(n, { ref: o, className: `sg-card-header ${r}`, ...s, children: t });
|
|
6
|
-
}), m = d(({ as: e = "h5", className: r, children: t, ...s }, o) => {
|
|
7
|
-
let n = ["h1", "h2", "h3", "h4", "h5", "h6"].find((c) => c === e) ? e : "h5";
|
|
8
|
-
return /* @__PURE__ */ a(n, { ref: o, className: r, ...s, children: t });
|
|
9
|
-
}), v = d(({ children: e, className: r, ...t }, s) => /* @__PURE__ */ a("div", { ref: s, className: `sg-card-body ${r}`, ...t, children: e })), f = d(({ children: e, className: r, ...t }, s) => /* @__PURE__ */ a("p", { ref: s, className: `sg-card-text ${r}`, ...t, children: e })), p = d(({ children: e, className: r, ...t }, s) => /* @__PURE__ */ a("div", { ref: s, className: `sg-card-footer ${r}`, ...t, children: e })), N = Object.assign(h, {
|
|
10
|
-
Header: l,
|
|
11
|
-
Body: v,
|
|
12
|
-
Title: m,
|
|
13
|
-
Text: f,
|
|
14
|
-
Footer: p
|
|
15
|
-
});
|
|
16
|
-
export {
|
|
17
|
-
N as default
|
|
18
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./Card";
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as a } from "react";
|
|
3
|
-
const c = a(({ className: e, variant: o = !1, ...l }, t) => /* @__PURE__ */ s("button", { ref: t, className: `sg-button-close${o ? " sg-button-close-white" : ""} ${e}`, ...l, children: /* @__PURE__ */ s("span", { className: "sg-close-visually-hidden-label", children: "Close" }) }));
|
|
4
|
-
export {
|
|
5
|
-
c as default
|
|
6
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./CloseButton";
|
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
import { jsx as v } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as D, forwardRef as E, useState as y, useMemo as $, useEffect as C, useLayoutEffect as A, useContext as P } from "react";
|
|
3
|
-
const L = (d, o, r = !1) => {
|
|
4
|
-
const m = r ? "top-end" : "top-start", f = r ? "top-start" : "top-end", i = r ? "bottom-end" : "bottom-start", h = r ? "bottom-start" : "bottom-end", g = r ? "right-start" : "left-start", c = r ? "right-end" : "left-end", w = r ? "left-start" : "right-start", u = r ? "left-end" : "right-end";
|
|
5
|
-
let n = d ? h : i;
|
|
6
|
-
return o === "up" ? n = d ? f : m : o === "end" ? n = d ? u : w : o === "start" ? n = d ? c : g : o === "down-centered" ? n = "bottom" : o === "up-centered" && (n = "top"), n;
|
|
7
|
-
}, k = (d, o = "") => {
|
|
8
|
-
let r = d.target, m = !0, f = !1;
|
|
9
|
-
for (; m; )
|
|
10
|
-
r.id != o + "-menu" ? r = r.parentElement : (f = !0, m = !1), r.id === "root" && (m = !1, f = !1);
|
|
11
|
-
return f;
|
|
12
|
-
}, I = D(null), M = ({ children: d, value: o }) => /* @__PURE__ */ v(I.Provider, { value: o, children: d }), x = () => {
|
|
13
|
-
const d = P(I);
|
|
14
|
-
if (!d)
|
|
15
|
-
throw new Error(
|
|
16
|
-
"useDropdownContext has to be used within DropdownContextProvider!"
|
|
17
|
-
);
|
|
18
|
-
return d;
|
|
19
|
-
}, O = E(({
|
|
20
|
-
children: d,
|
|
21
|
-
className: o,
|
|
22
|
-
onSelect: r,
|
|
23
|
-
onToggle: m,
|
|
24
|
-
controlId: f,
|
|
25
|
-
drop: i = "down",
|
|
26
|
-
align: h = "start",
|
|
27
|
-
autoClose: g = !0,
|
|
28
|
-
show: c = "default",
|
|
29
|
-
...w
|
|
30
|
-
}, u) => {
|
|
31
|
-
const [n, e] = y(c === "default" ? !1 : c), [l, b] = y({ case: "" }), a = (B) => {
|
|
32
|
-
B.stopPropagation(), e((S) => !S);
|
|
33
|
-
}, s = L(h === "end", i), p = $(() => ({
|
|
34
|
-
align: h,
|
|
35
|
-
drop: i,
|
|
36
|
-
showInternal: c != "default" && m ? c : n,
|
|
37
|
-
handleToggle: c != "default" && m ? m : a,
|
|
38
|
-
placement: s,
|
|
39
|
-
directionClasses: {
|
|
40
|
-
down: "dropdown",
|
|
41
|
-
"down-centered": "dropdown-center",
|
|
42
|
-
up: "dropup",
|
|
43
|
-
"up-centered": "dropup-center dropup",
|
|
44
|
-
end: "dropend",
|
|
45
|
-
start: "dropstart"
|
|
46
|
-
},
|
|
47
|
-
controlId: f,
|
|
48
|
-
activeDescendant: l,
|
|
49
|
-
setActiveDescendant: b
|
|
50
|
-
}), [h, i, c, n, m, s, f, l, b]);
|
|
51
|
-
return /* @__PURE__ */ v("div", { id: f + "-wrapper", ref: u, className: `sg-dropdown${o ? " " + o : ""}`, ...w, children: /* @__PURE__ */ v(M, { value: p, children: d }) });
|
|
52
|
-
}), q = E(({ children: d, className: o, navDropdown: r = !1, as: m = "button", variant: f = "primary", ...i }, h) => {
|
|
53
|
-
const { controlId: g, handleToggle: c, setActiveDescendant: w, showInternal: u } = x(), n = m, e = (t) => {
|
|
54
|
-
let s = !1;
|
|
55
|
-
switch (console.log(t.key), t.key) {
|
|
56
|
-
case "ArrowDown":
|
|
57
|
-
s = !0, u ? w((p) => ({ ...p, case: "next" })) : (c(t), w((p) => ({ ...p, case: "first" })));
|
|
58
|
-
break;
|
|
59
|
-
case "ArrowUp":
|
|
60
|
-
s = !0, u ? w((p) => ({ ...p, case: "previous" })) : (c(t), w((p) => ({ ...p, case: "last" })));
|
|
61
|
-
break;
|
|
62
|
-
case "Home":
|
|
63
|
-
s = !0, u && w((p) => ({ ...p, case: "first" }));
|
|
64
|
-
break;
|
|
65
|
-
case "End":
|
|
66
|
-
s = !0, u && w((p) => ({ ...p, case: "last" }));
|
|
67
|
-
break;
|
|
68
|
-
case "Tab":
|
|
69
|
-
u && c(t);
|
|
70
|
-
break;
|
|
71
|
-
case "Escape":
|
|
72
|
-
s = !0, u && c(t);
|
|
73
|
-
break;
|
|
74
|
-
case "Enter":
|
|
75
|
-
case " ":
|
|
76
|
-
if (u) {
|
|
77
|
-
s = !0, document.querySelector(".sg-dropdown-item-visual-focus").click(), c(t);
|
|
78
|
-
break;
|
|
79
|
-
} else {
|
|
80
|
-
w((p) => ({ ...p, case: "first" }));
|
|
81
|
-
break;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
s && (t.stopPropagation(), t.preventDefault());
|
|
85
|
-
}, l = (t) => {
|
|
86
|
-
if (u && t.target.id !== g) {
|
|
87
|
-
if (!k(t, g))
|
|
88
|
-
c(t);
|
|
89
|
-
else if (k(t, g)) {
|
|
90
|
-
c(t);
|
|
91
|
-
const s = document.getElementById(g);
|
|
92
|
-
s == null || s.focus();
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
C(() => {
|
|
97
|
-
const t = document.getElementById(g);
|
|
98
|
-
return t.addEventListener("keydown", e, !0), document.addEventListener("mouseup", l, !0), function() {
|
|
99
|
-
t.removeEventListener("keydown", e, !0), document.removeEventListener("mouseup", l, !0);
|
|
100
|
-
};
|
|
101
|
-
}, [e, g]);
|
|
102
|
-
const b = (t) => {
|
|
103
|
-
c(t), u || w((s) => ({ ...s, case: "first" }));
|
|
104
|
-
};
|
|
105
|
-
let a = `sg-button sg-button${f ? "-" + f : "-primary"} sg-dropdown-toggle${o ? " " + o : ""}`;
|
|
106
|
-
return (n === "a" || r) && (a = `sg-nav-dropdown-toggle sg-dropdown-toggle${o ? " " + o : ""}`), /* @__PURE__ */ v(
|
|
107
|
-
n,
|
|
108
|
-
{
|
|
109
|
-
tabIndex: "0",
|
|
110
|
-
type: "button",
|
|
111
|
-
"aria-haspopup": "true",
|
|
112
|
-
"aria-controls": g + "-menu",
|
|
113
|
-
"aria-expanded": u,
|
|
114
|
-
id: g,
|
|
115
|
-
ref: h,
|
|
116
|
-
className: a,
|
|
117
|
-
onClick: (t) => b(t),
|
|
118
|
-
...i,
|
|
119
|
-
children: d
|
|
120
|
-
}
|
|
121
|
-
);
|
|
122
|
-
}), j = E(({ children: d, className: o, style: r = {}, ...m }, f) => {
|
|
123
|
-
const { controlId: i, showInternal: h, activeDescendant: g } = x(), [c, w] = y(r);
|
|
124
|
-
A(() => {
|
|
125
|
-
if (h) {
|
|
126
|
-
const n = document.getElementById(i + "-menu");
|
|
127
|
-
let e = {};
|
|
128
|
-
n.getBoundingClientRect().right > window.innerWidth ? e = { ...e, right: 0 } : n.getBoundingClientRect().left < 0 ? e = { ...e, left: 0 } : n.getBoundingClientRect().top < 0 ? e = { ...e, top: 0 } : n.getBoundingClientRect().bottom > window.innerHeight && (e = { ...e, bottom: 0 }), w((l) => ({ ...l, ...e }));
|
|
129
|
-
}
|
|
130
|
-
}, [h]), C(() => {
|
|
131
|
-
if (h) {
|
|
132
|
-
const n = document.getElementById(i + "-menu"), e = document.getElementById(i + "-menu").children, l = e.length - 1, b = document.querySelector(".sg-dropdown-item-visual-focus");
|
|
133
|
-
let a = 0, t = e[0].children[0];
|
|
134
|
-
if (b != null) {
|
|
135
|
-
b.classList.remove("sg-dropdown-item-visual-focus");
|
|
136
|
-
for (let s = 0; s < e.length; s++)
|
|
137
|
-
if (e[s] === b.parentElement) {
|
|
138
|
-
a = s;
|
|
139
|
-
break;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
switch (g.case) {
|
|
143
|
-
case "first":
|
|
144
|
-
t = e[0].children[0], a = 0;
|
|
145
|
-
break;
|
|
146
|
-
case "last":
|
|
147
|
-
t = e[l].children[0], a = l;
|
|
148
|
-
break;
|
|
149
|
-
case "next":
|
|
150
|
-
a = a === l ? 0 : a + 1, t = e[a].children[0];
|
|
151
|
-
break;
|
|
152
|
-
case "previous":
|
|
153
|
-
a = a === 0 ? l : a - 1, t = e[a].children[0];
|
|
154
|
-
break;
|
|
155
|
-
}
|
|
156
|
-
n.setAttribute("aria-activedescendant", t.id), e[a].children[0].classList.add("sg-dropdown-item-visual-focus");
|
|
157
|
-
} else
|
|
158
|
-
document.getElementById(i + "-menu").setAttribute("aria-activedescendant", "");
|
|
159
|
-
}, [i, h, g]);
|
|
160
|
-
const u = (n) => {
|
|
161
|
-
var a;
|
|
162
|
-
const e = n.target;
|
|
163
|
-
let l = e.classList.contains("sg-dropdown-item-visual-focus");
|
|
164
|
-
const b = document.getElementById(i + "-menu");
|
|
165
|
-
l || ((a = document.querySelector(".sg-dropdown-item-visual-focus")) == null || a.classList.remove("sg-dropdown-item-visual-focus"), b.setAttribute("aria-activedescendant", ""), e.classList.add("sg-dropdown-item-visual-focus"), b.setAttribute("aria-activedescendant", e.id));
|
|
166
|
-
};
|
|
167
|
-
return C(() => {
|
|
168
|
-
const n = document.getElementById(i + "-menu");
|
|
169
|
-
for (let e = 0; e < n.children.length; e++)
|
|
170
|
-
n.children[e].addEventListener("mouseover", u, !0);
|
|
171
|
-
return function() {
|
|
172
|
-
for (let l = 0; l < n.children.length; l++)
|
|
173
|
-
n.children[l].addEventListener("mouseover", u, !0);
|
|
174
|
-
};
|
|
175
|
-
}, []), /* @__PURE__ */ v(
|
|
176
|
-
"ul",
|
|
177
|
-
{
|
|
178
|
-
id: i + "-menu",
|
|
179
|
-
role: "menu",
|
|
180
|
-
tabIndex: -1,
|
|
181
|
-
"aria-labelledby": i,
|
|
182
|
-
ref: f,
|
|
183
|
-
className: `sg-dropdown-list${o ? " " + o : ""}${h ? " show" : ""}`,
|
|
184
|
-
style: c,
|
|
185
|
-
...m,
|
|
186
|
-
children: d
|
|
187
|
-
}
|
|
188
|
-
);
|
|
189
|
-
}), H = E(({ children: d, as: o = "button", className: r, ...m }, f) => /* @__PURE__ */ v("li", { role: "none", children: /* @__PURE__ */ v(o, { ref: f, role: "menuitem", tabIndex: "-1", className: `sg-dropdown-item${r ? " " + r : ""}`, ...m, children: d }) })), V = E(({ className: d = "", ...o }, r) => /* @__PURE__ */ v("hr", { ref: r, className: `.sg-dropdown-divider${d}`, ...o })), K = Object.assign(O, {
|
|
190
|
-
Toggle: q,
|
|
191
|
-
Menu: j,
|
|
192
|
-
Item: H,
|
|
193
|
-
//Text: Text,
|
|
194
|
-
Divider: V
|
|
195
|
-
});
|
|
196
|
-
export {
|
|
197
|
-
V as Divider,
|
|
198
|
-
I as DropdownContext,
|
|
199
|
-
M as DropdownContextProvider,
|
|
200
|
-
H as Item,
|
|
201
|
-
j as Menu,
|
|
202
|
-
q as Toggle,
|
|
203
|
-
K as default,
|
|
204
|
-
x as useDropdownContext
|
|
205
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./Dropdown";
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as i, useMemo as f } from "react";
|
|
3
|
-
import { FormContextProvider as n } from "../Form/Form.js";
|
|
4
|
-
const x = i(({ children: o, label: a, controlId: r, className: c, htmlFor: d, ...l }, t) => {
|
|
5
|
-
const m = f(() => ({ controlId: r }), [r]);
|
|
6
|
-
return /* @__PURE__ */ e(n, { value: m, children: /* @__PURE__ */ s("div", { className: "sg-form-floating", children: [
|
|
7
|
-
o,
|
|
8
|
-
/* @__PURE__ */ e("label", { ref: t, htmlFor: r, className: "sg-form-floating-label", ...l, children: a })
|
|
9
|
-
] }) });
|
|
10
|
-
});
|
|
11
|
-
export {
|
|
12
|
-
x as default
|
|
13
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./FloatingLabel";
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { jsx as n, jsxs as C, Fragment as k } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as b, forwardRef as l, useMemo as j, useContext as I } from "react";
|
|
3
|
-
const w = b(null), H = ({ children: e, value: t }) => /* @__PURE__ */ n(w.Provider, { value: t, children: e }), g = () => {
|
|
4
|
-
const e = I(w);
|
|
5
|
-
if (!e)
|
|
6
|
-
throw new Error(
|
|
7
|
-
"useFormContext has to be used within a FormContextProvider!"
|
|
8
|
-
);
|
|
9
|
-
return e;
|
|
10
|
-
}, P = l(({ children: e, ...t }, o) => /* @__PURE__ */ n("form", { ref: o, ...t, children: e })), y = l(({ as: e = "input", className: t = "", plaintext: o = !1, id: c = "", type: r = "text", autoFocus: s = !1, ...m }, d) => {
|
|
11
|
-
let i = e;
|
|
12
|
-
const { controlId: u } = g();
|
|
13
|
-
let x = u || c, f = (o ? "sg-form-control-plaintext" : "sg-form-control") + (t != "" ? " " + t : "") + (r == "color" ? " sg-form-control-color" : "");
|
|
14
|
-
return /* @__PURE__ */ n(i, { autoFocus: s, ref: d, id: x, type: r, className: f, ...m });
|
|
15
|
-
}), E = l(({ children: e, className: t, id: o, ...c }, r) => {
|
|
16
|
-
const { controlId: s } = g();
|
|
17
|
-
let m = s || o;
|
|
18
|
-
return /* @__PURE__ */ n("select", { ref: r, className: `sg-form-select${t ? " " + t : ""}`, id: m, ...c, children: e });
|
|
19
|
-
}), G = l(({ children: e, className: t, controlId: o, ...c }, r) => {
|
|
20
|
-
const s = j(() => ({ controlId: o }), [o]);
|
|
21
|
-
return /* @__PURE__ */ n("div", { ref: r, className: `sg-from-group${t ? " " + t : ""}`, ...c, children: /* @__PURE__ */ n(H, { value: s, children: e }) });
|
|
22
|
-
}), M = l(({ children: e, className: t, htmlFor: o }, c) => {
|
|
23
|
-
const { controlId: r } = g();
|
|
24
|
-
return /* @__PURE__ */ n("label", { ref: c, htmlFor: o || r, className: `sg-form-label${t ? " " + t : ""}`, children: e });
|
|
25
|
-
}), O = l(({
|
|
26
|
-
classNameContainer: e,
|
|
27
|
-
containerRef: t,
|
|
28
|
-
containerId: o,
|
|
29
|
-
style: c,
|
|
30
|
-
classNameLabel: r,
|
|
31
|
-
labelRef: s,
|
|
32
|
-
label: m,
|
|
33
|
-
labelId: d,
|
|
34
|
-
className: i,
|
|
35
|
-
type: u,
|
|
36
|
-
id: x,
|
|
37
|
-
controlId: f,
|
|
38
|
-
reverse: p = !1,
|
|
39
|
-
checkStyle: v,
|
|
40
|
-
...a
|
|
41
|
-
}, F) => {
|
|
42
|
-
let h = f || x, $ = u === "switch" ? "checkbox" : u;
|
|
43
|
-
return /* @__PURE__ */ n("div", { ref: t, id: o, style: c, className: `sg-form-check${p ? "-reverse" : ""}${e ? " " + e : ""}${u === "switch" ? " sg-form-switch" : ""}`, children: p ? /* @__PURE__ */ C(k, { children: [
|
|
44
|
-
/* @__PURE__ */ n("input", { ref: F, type: $, id: h, className: `sg-form-check-input${i ? " " + i : ""}`, ...a }),
|
|
45
|
-
/* @__PURE__ */ n("label", { ref: s, id: d, htmlFor: h, className: `sg-form-check-label${r ? " " + r : ""}`, children: m })
|
|
46
|
-
] }) : /* @__PURE__ */ C(k, { children: [
|
|
47
|
-
/* @__PURE__ */ n("label", { ref: s, id: d, htmlFor: h, className: `sg-form-check-label${r ? " " + r : ""}`, children: m }),
|
|
48
|
-
/* @__PURE__ */ n("input", { ref: F, type: $, id: h, className: `sg-form-check-input${i ? " " + i : ""}`, style: v, ...a })
|
|
49
|
-
] }) });
|
|
50
|
-
}), S = l(({ children: e, className: t, ...o }, c) => /* @__PURE__ */ n("small", { ref: c, className: `sg-form-text${t ? " " + t : ""}`, ...o, children: e })), z = Object.assign(P, {
|
|
51
|
-
Control: y,
|
|
52
|
-
Select: E,
|
|
53
|
-
Group: G,
|
|
54
|
-
Label: M,
|
|
55
|
-
Check: O,
|
|
56
|
-
Text: S
|
|
57
|
-
});
|
|
58
|
-
export {
|
|
59
|
-
w as FormContext,
|
|
60
|
-
H as FormContextProvider,
|
|
61
|
-
z as default,
|
|
62
|
-
g as useFormContext
|
|
63
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./Form";
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as u } from "react";
|
|
3
|
-
const s = u(({ children: r, className: t, ...o }, p) => /* @__PURE__ */ n("div", { ref: p, className: `sg-input-group${t ? " " + t : ""}`, ...o, children: r })), e = u(({ children: r, className: t, ...o }, p) => /* @__PURE__ */ n("span", { ref: p, className: `sg-input-group-text${t ? " " + t : ""}`, ...o, children: r })), f = Object.assign(s, {
|
|
4
|
-
Text: e
|
|
5
|
-
});
|
|
6
|
-
export {
|
|
7
|
-
f as default
|
|
8
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./InputGroup";
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { jsxs as p, jsx as s, Fragment as A } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as D, forwardRef as b, useContext as P, useState as $, useEffect as w, useRef as B } from "react";
|
|
3
|
-
import { createPortal as F } from "react-dom";
|
|
4
|
-
import K from "../CloseButton/CloseButton.js";
|
|
5
|
-
import L from "../Button/Button.js";
|
|
6
|
-
const g = D(null), N = ({ children: e, value: t }) => /* @__PURE__ */ s(g.Provider, { value: t, children: e }), S = () => {
|
|
7
|
-
const e = P(g);
|
|
8
|
-
if (!e)
|
|
9
|
-
throw new Error(
|
|
10
|
-
"useModalContext has to be used within ModalContextProvider!"
|
|
11
|
-
);
|
|
12
|
-
return e;
|
|
13
|
-
}, j = ({
|
|
14
|
-
children: e,
|
|
15
|
-
centered: t = !1,
|
|
16
|
-
size: n = "md",
|
|
17
|
-
show: o,
|
|
18
|
-
backdrop: l = "static",
|
|
19
|
-
onHide: a,
|
|
20
|
-
className: d,
|
|
21
|
-
id: i,
|
|
22
|
-
...m
|
|
23
|
-
}) => {
|
|
24
|
-
const [h, f] = $(o);
|
|
25
|
-
w(() => {
|
|
26
|
-
f(o);
|
|
27
|
-
}, [o]);
|
|
28
|
-
const r = B(null);
|
|
29
|
-
H(r);
|
|
30
|
-
let u = typeof o == "boolean" && typeof a == "function" ? void 0 : { show: typeof o == "boolean", onHide: typeof a == "function" };
|
|
31
|
-
u && console.error(
|
|
32
|
-
u.show ? null : "The variable 'show' must be used and must be a boolean used to decide when to show the modal!",
|
|
33
|
-
u.onHide ? null : "The variable 'onHide' must be used and must be a function which is used to set 'show' as the modal gets closed!"
|
|
34
|
-
);
|
|
35
|
-
const y = () => {
|
|
36
|
-
a && a(), f(!1);
|
|
37
|
-
};
|
|
38
|
-
w(() => {
|
|
39
|
-
const c = r.current;
|
|
40
|
-
c && (h ? (c.classList.remove("close"), c.showModal()) : c.close());
|
|
41
|
-
}, [h]);
|
|
42
|
-
let v = `sg-modal-tag sg-modal-${n}`;
|
|
43
|
-
d && (v += " " + d), (l === "static" || l === "true") && (v += " sg-modal-static");
|
|
44
|
-
const k = (c) => {
|
|
45
|
-
if (c.key != "Escape")
|
|
46
|
-
return;
|
|
47
|
-
c.preventDefault();
|
|
48
|
-
const C = r.current;
|
|
49
|
-
C.classList.add("close"), C.addEventListener("animationend", () => {
|
|
50
|
-
y();
|
|
51
|
-
}, { once: !0 });
|
|
52
|
-
};
|
|
53
|
-
return F(
|
|
54
|
-
/* @__PURE__ */ s("dialog", { ref: r, className: v, onKeyDown: (c) => k(c), ...m, children: /* @__PURE__ */ s(N, { value: a, children: u ? /* @__PURE__ */ s(q, { typeCheck: u, closeModal: y }) : e }) }),
|
|
55
|
-
document.body
|
|
56
|
-
);
|
|
57
|
-
}, x = b(({ children: e, as: t = "", className: n = "", closeButton: o = !1, onClick: l, ...a }, d) => {
|
|
58
|
-
let m = ["div", "span", "h1", "h2", "h3", "h4", "h5", "h6"].find((r) => r === t) ? t : "div";
|
|
59
|
-
const h = S(), f = (r) => {
|
|
60
|
-
l && l(r), h();
|
|
61
|
-
};
|
|
62
|
-
return /* @__PURE__ */ p(m, { ref: d, className: `sg-modal-header ${n}`, ...a, children: [
|
|
63
|
-
e,
|
|
64
|
-
o ? /* @__PURE__ */ s(K, { variant: !0, onClick: (r) => f(r) }) : null
|
|
65
|
-
] });
|
|
66
|
-
}), E = b(({ children: e, as: t = "h4", className: n, ...o }, l) => {
|
|
67
|
-
let d = ["div", "span", "h1", "h2", "h3", "h4", "h5", "h6"].find((i) => i === t) ? t : "h4";
|
|
68
|
-
return /* @__PURE__ */ s(d, { ref: l, className: `sg-modal-title ${n}`, ...o, children: e });
|
|
69
|
-
}), M = b(({ children: e, className: t, ...n }, o) => /* @__PURE__ */ s("div", { ref: o, className: `sg-modal-body ${t}`, ...n, children: e })), T = b(({ children: e, className: t, ...n }, o) => /* @__PURE__ */ s("div", { ref: o, className: `sg-modal-footer ${t}`, ...n, children: e })), Q = Object.assign(j, {
|
|
70
|
-
Header: x,
|
|
71
|
-
Title: E,
|
|
72
|
-
Body: M,
|
|
73
|
-
Footer: T
|
|
74
|
-
}), H = function(e) {
|
|
75
|
-
w(() => {
|
|
76
|
-
const t = (n) => {
|
|
77
|
-
const o = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])', l = e.current;
|
|
78
|
-
if (l) {
|
|
79
|
-
const a = l.querySelectorAll(o)[0], d = l.querySelectorAll(o), i = d[d.length - 1];
|
|
80
|
-
if (!(n.key === "Tab"))
|
|
81
|
-
return;
|
|
82
|
-
n.shiftKey ? document.activeElement === a && (i.focus(), n.preventDefault()) : document.activeElement === i && (a.focus(), n.preventDefault());
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
return document.addEventListener("keydown", t, !0), function() {
|
|
86
|
-
document.removeEventListener("keydown", t, !0);
|
|
87
|
-
};
|
|
88
|
-
}, [e]);
|
|
89
|
-
}, q = ({ typeCheck: e, closeModal: t }) => /* @__PURE__ */ p(A, { children: [
|
|
90
|
-
/* @__PURE__ */ s(x, { closeButton: !0, children: /* @__PURE__ */ s(E, { children: "An Error ocurred!" }) }),
|
|
91
|
-
/* @__PURE__ */ s(M, { children: /* @__PURE__ */ p("p", { children: [
|
|
92
|
-
e.show ? null : "The variable 'show' must be used and must be a boolean used to decide when to show the modal!",
|
|
93
|
-
e.onHide ? null : "The variable 'onHide' must be used and must be a function which is used to set 'show' as the modal gets closed!"
|
|
94
|
-
] }) }),
|
|
95
|
-
/* @__PURE__ */ s(T, { children: /* @__PURE__ */ s(L, { variant: "danger", type: "button", onClick: () => t(), children: "Close" }) })
|
|
96
|
-
] });
|
|
97
|
-
export {
|
|
98
|
-
Q as default,
|
|
99
|
-
H as useKeepElementFocused
|
|
100
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./Modal";
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as m } from "react";
|
|
3
|
-
import { useNavbarContext as i } from "../NavBar/Navbar.js";
|
|
4
|
-
const v = m(({ children: o, className: n, as: t = "ul", ...e }, r) => {
|
|
5
|
-
const a = t, c = i();
|
|
6
|
-
return /* @__PURE__ */ s(a, { ref: r, className: `${n} ${c || "sg-navbar-"}nav`, ...e, children: o });
|
|
7
|
-
}), p = m(({ children: o, className: n, as: t = "li", ...e }, r) => /* @__PURE__ */ s(t, { role: "none", ref: r, className: `sg-nav-item${n ? " " + n : ""}`, ...e, children: o })), f = m(({ children: o, className: n, as: t = "a", ...e }, r) => /* @__PURE__ */ s(t, { role: "menuitem", ref: r, className: `sg-nav-link${n ? " " + n : ""}`, ...e, children: o })), x = Object.assign(v, {
|
|
8
|
-
Item: p,
|
|
9
|
-
Link: f
|
|
10
|
-
});
|
|
11
|
-
export {
|
|
12
|
-
x as default
|
|
13
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./Nav";
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as b, forwardRef as c, useMemo as x, useContext as C } from "react";
|
|
3
|
-
const v = b(null), m = ({ children: n, value: t }) => /* @__PURE__ */ a(v.Provider, { value: t, children: n }), N = () => C(v), p = c(({ children: n, className: t, navbarPrefix: o = "sg-navbar-", ...r }, e) => {
|
|
4
|
-
const s = x(() => o, [o]);
|
|
5
|
-
return /* @__PURE__ */ a("nav", { ref: e, className: `sg-navbar${t ? " " + t : ""}`, ...r, children: /* @__PURE__ */ a(m, { value: s, children: n }) });
|
|
6
|
-
}), d = c(({ children: n, className: t, href: o = "#", as: r = "a", ...e }, s) => {
|
|
7
|
-
const u = r || (o && r != "Link" ? "a" : "span");
|
|
8
|
-
return /* @__PURE__ */ a(u, { ref: s, href: o, className: `sg-navbar-brand${t ? " " + t : ""}`, ...e, children: n });
|
|
9
|
-
}), i = c(({ children: n, className: t, as: o = "span", ...r }, e) => /* @__PURE__ */ a(o, { ref: e, className: `sg-navbar-text${t ? " " + t : ""}`, ...r, children: n })), $ = Object.assign(p, {
|
|
10
|
-
Brand: d,
|
|
11
|
-
Text: i
|
|
12
|
-
});
|
|
13
|
-
export {
|
|
14
|
-
v as NavbarContext,
|
|
15
|
-
$ as default,
|
|
16
|
-
N as useNavbarContext
|
|
17
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./Navbar";
|