stargazer-ui 1.0.5 → 1.0.7
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/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/Button/Button.d.ts +4 -0
- package/dist/cjs/types/components/CloseButton/CloseButton.d.ts +4 -0
- package/dist/{components → cjs/types/components}/Dropdown/Dropdown.d.ts +1 -1
- package/dist/cjs/types/components/FloatingLabel/FloatingLabel.d.ts +4 -0
- package/dist/{components → cjs/types/components}/Form/Form.d.ts +1 -1
- package/dist/cjs/types/components/InputGroup/InputGroup.d.ts +6 -0
- package/dist/cjs/types/components/NavDropdown/NavDropdown.d.ts +35 -0
- package/dist/cjs/types/components/Spinner/Spinner.d.ts +4 -0
- package/dist/cjs/types/components/Table/Table.d.ts +4 -0
- package/dist/cjs/types/components/Tabs/Tabs.d.ts +9 -0
- package/dist/{components → cjs/types/components}/ToggleButton/ToggleButton.d.ts +2 -2
- package/dist/cjs/types/components/index.d.ts +16 -0
- package/dist/cjs/types/index.d.ts +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/BaseTypes.d.ts +19 -0
- package/dist/esm/types/components/Button/Button.d.ts +4 -0
- package/dist/esm/types/components/Button/Button.types.d.ts +7 -0
- package/dist/esm/types/components/Button/index.d.ts +1 -0
- package/dist/esm/types/components/Card/Card.d.ts +34 -0
- package/dist/esm/types/components/Card/Card.types.d.ts +24 -0
- package/dist/esm/types/components/Card/index.d.ts +1 -0
- package/dist/esm/types/components/CloseButton/CloseButton.d.ts +4 -0
- package/dist/esm/types/components/CloseButton/CloseButton.types.d.ts +5 -0
- package/dist/esm/types/components/CloseButton/index.d.ts +1 -0
- package/dist/esm/types/components/Dropdown/Dropdown.d.ts +71 -0
- package/dist/esm/types/components/Dropdown/Dropdown.types.d.ts +55 -0
- package/dist/esm/types/components/Dropdown/index.d.ts +1 -0
- package/dist/esm/types/components/FloatingLabel/FloatingLabel.d.ts +4 -0
- package/dist/esm/types/components/FloatingLabel/FloatingLabel.types.d.ts +9 -0
- package/dist/esm/types/components/FloatingLabel/index.d.ts +1 -0
- package/dist/esm/types/components/Form/Form.d.ts +17 -0
- package/dist/esm/types/components/Form/Form.types.d.ts +50 -0
- package/dist/esm/types/components/Form/index.d.ts +1 -0
- package/dist/esm/types/components/InputGroup/InputGroup.d.ts +6 -0
- package/dist/esm/types/components/InputGroup/InputGroup.types.d.ts +10 -0
- package/dist/esm/types/components/InputGroup/index.d.ts +1 -0
- package/dist/esm/types/components/Modal/Modal.d.ts +40 -0
- package/dist/esm/types/components/Modal/Modal.types.d.ts +40 -0
- package/dist/esm/types/components/Modal/index.d.ts +1 -0
- package/dist/esm/types/components/Nav/Nav.d.ts +30 -0
- package/dist/esm/types/components/Nav/Nav.types.d.ts +17 -0
- package/dist/esm/types/components/Nav/index.d.ts +1 -0
- package/dist/esm/types/components/NavBar/Navbar.d.ts +20 -0
- package/dist/esm/types/components/NavBar/Navbar.types.d.ts +18 -0
- package/dist/esm/types/components/NavBar/index.d.ts +1 -0
- package/dist/esm/types/components/NavDropdown/NavDropdown.d.ts +35 -0
- package/dist/esm/types/components/NavDropdown/NavDropdown.types.d.ts +5 -0
- package/dist/esm/types/components/NavDropdown/index.d.ts +1 -0
- package/dist/esm/types/components/Popout/Popout.d.ts +22 -0
- package/dist/esm/types/components/Popout/Popout.types.d.ts +36 -0
- package/dist/esm/types/components/Popout/index.d.ts +1 -0
- package/dist/esm/types/components/Spinner/Spinner.d.ts +4 -0
- package/dist/esm/types/components/Spinner/Spinner.types.d.ts +7 -0
- package/dist/esm/types/components/Spinner/index.d.ts +1 -0
- package/dist/esm/types/components/Table/Table.d.ts +4 -0
- package/dist/esm/types/components/Table/Table.types.d.ts +7 -0
- package/dist/esm/types/components/Table/index.d.ts +1 -0
- package/dist/esm/types/components/Tabs/Tabs.d.ts +9 -0
- package/dist/esm/types/components/Tabs/Tabs.types.d.ts +35 -0
- package/dist/esm/types/components/Tabs/index.d.ts +1 -0
- package/dist/esm/types/components/ToggleButton/ToggleButton.d.ts +9 -0
- package/dist/esm/types/components/ToggleButton/index.d.ts +1 -0
- package/dist/esm/types/components/index.d.ts +16 -0
- package/dist/esm/types/index.d.ts +1 -0
- package/dist/index.d.ts +470 -1
- package/package.json +2 -2
- package/dist/BaseTypes.js +0 -1
- package/dist/components/Button/Button.d.ts +0 -4
- package/dist/components/Button/Button.js +0 -6
- package/dist/components/Button/Button.types.js +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.js +0 -4
- package/dist/components/CloseButton/CloseButton.d.ts +0 -4
- package/dist/components/CloseButton/CloseButton.js +0 -6
- package/dist/components/CloseButton/CloseButton.types.js +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.js +0 -4
- package/dist/components/FloatingLabel/FloatingLabel.d.ts +0 -4
- package/dist/components/FloatingLabel/FloatingLabel.js +0 -13
- package/dist/components/FloatingLabel/FloatingLabel.types.js +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.js +0 -4
- package/dist/components/Grid/Grid.d.ts +0 -5
- package/dist/components/Grid/Grid.js +0 -36
- package/dist/components/Grid/index.d.ts +0 -1
- package/dist/components/Grid/index.js +0 -4
- package/dist/components/InputGroup/InputGroup.d.ts +0 -6
- package/dist/components/InputGroup/InputGroup.js +0 -8
- package/dist/components/InputGroup/InputGroup.types.js +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.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.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.js +0 -4
- package/dist/components/NavDropdown/NavDropdown.d.ts +0 -35
- package/dist/components/NavDropdown/NavDropdown.js +0 -62
- package/dist/components/NavDropdown/NavDropdown.types.js +0 -1
- package/dist/components/NavDropdown/index.js +0 -4
- package/dist/components/OffCanvas/OffCanvas.d.ts +0 -3
- package/dist/components/OffCanvas/OffCanvas.js +0 -2266
- package/dist/components/OffCanvas/index.d.ts +0 -1
- package/dist/components/OffCanvas/index.js +0 -4
- package/dist/components/Overlay/Overlay.d.ts +0 -3
- package/dist/components/Overlay/Overlay.js +0 -125
- package/dist/components/Overlay/index.d.ts +0 -1
- package/dist/components/Overlay/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.js +0 -4
- package/dist/components/Spinner/Spinner.d.ts +0 -4
- package/dist/components/Spinner/Spinner.js +0 -9
- package/dist/components/Spinner/Spinner.types.js +0 -1
- package/dist/components/Spinner/index.js +0 -4
- package/dist/components/Table/Table.d.ts +0 -4
- package/dist/components/Table/Table.js +0 -9
- package/dist/components/Table/Table.types.js +0 -1
- package/dist/components/Table/index.js +0 -4
- package/dist/components/Tabs/Tabs.d.ts +0 -9
- package/dist/components/Tabs/Tabs.js +0 -77
- package/dist/components/Tabs/Tabs.types.js +0 -1
- package/dist/components/Tabs/index.js +0 -4
- 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.js +0 -4
- package/dist/components/index.d.ts +0 -19
- package/dist/components/index.js +0 -19
- package/dist/index.js +0 -19
- package/dist/types.d.ts +0 -2
- package/dist/vite-env.d.js +0 -1
- /package/dist/{BaseTypes.d.ts → cjs/types/BaseTypes.d.ts} +0 -0
- /package/dist/{components → cjs/types/components}/Button/Button.types.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/Button/index.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/Card/Card.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/Card/Card.types.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/Card/index.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/CloseButton/CloseButton.types.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/CloseButton/index.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/Dropdown/Dropdown.types.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/Dropdown/index.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/FloatingLabel/FloatingLabel.types.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/FloatingLabel/index.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/Form/Form.types.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/Form/index.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/InputGroup/InputGroup.types.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/InputGroup/index.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/Modal/Modal.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/Modal/Modal.types.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/Modal/index.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/Nav/Nav.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/Nav/Nav.types.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/Nav/index.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/NavBar/Navbar.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/NavBar/Navbar.types.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/NavBar/index.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/NavDropdown/NavDropdown.types.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/NavDropdown/index.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/Popout/Popout.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/Popout/Popout.types.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/Popout/index.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/Spinner/Spinner.types.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/Spinner/index.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/Table/Table.types.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/Table/index.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/Tabs/Tabs.types.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/Tabs/index.d.ts +0 -0
- /package/dist/{components → cjs/types/components}/ToggleButton/index.d.ts +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./OffCanvas";
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import { jsxs as M, Fragment as U, jsx as N } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as X, useRef as S, useState as w, useEffect as $, cloneElement as Y } from "react";
|
|
3
|
-
import { createPortal as Z } from "react-dom";
|
|
4
|
-
const q = (l, a, u, c, i = !1) => {
|
|
5
|
-
let f = document.body, o = l.current, g = a.current, e = getComputedStyle(o).position, n = o.getBoundingClientRect().top - (e != "fixed" ? f.getBoundingClientRect().top : 0), d = o.offsetHeight, h = o.getBoundingClientRect().left - (e != "fixed" ? f.getBoundingClientRect().left : 0), x = o.offsetWidth, m = g.clientHeight, y = g.clientWidth;
|
|
6
|
-
const p = (C, R, B) => g.getBoundingClientRect()[C] <= B ? R : r[C];
|
|
7
|
-
let H = 0, v = 0;
|
|
8
|
-
i || (v = c.clientHeight - 1, H = c.clientWidth - 1);
|
|
9
|
-
let r;
|
|
10
|
-
switch (u) {
|
|
11
|
-
case "top":
|
|
12
|
-
return r = { top: n - m - v, left: h + x / 2 - y / 2 }, r.right = p("right", 12, 0), r.left = p("left", 0, 0), r;
|
|
13
|
-
case "right":
|
|
14
|
-
return r = { top: n + d / 2 - m / 2, left: h + o.offsetWidth + H }, r;
|
|
15
|
-
case "bottom":
|
|
16
|
-
return r = { top: n + d + v, left: h + x / 2 - y / 2 }, r.right = p("right", 12, 0), r.left = p("left", 0, 0), r;
|
|
17
|
-
case "left":
|
|
18
|
-
return r = { top: n + d / 2 - m / 2, left: h - y - H }, r;
|
|
19
|
-
default:
|
|
20
|
-
return { top: n - m, left: h + x / 2 - y / 2 };
|
|
21
|
-
}
|
|
22
|
-
}, G = (l, a, u, c) => {
|
|
23
|
-
let i = a.current.getBoundingClientRect().top, f = window.innerHeight - a.current.getBoundingClientRect().bottom, o = a.current.getBoundingClientRect().left, g = window.innerWidth - a.current.getBoundingClientRect().right, e = u.current.clientWidth + c.current.clientWidth + 48, n = u.current.clientHeight + c.current.clientHeight + 48;
|
|
24
|
-
if (l.current === "top") {
|
|
25
|
-
if (i <= n)
|
|
26
|
-
return g <= e ? "left" : o <= e ? "right" : "top";
|
|
27
|
-
} else if (l.current === "bottom") {
|
|
28
|
-
if (f <= n)
|
|
29
|
-
return g <= e ? "left" : o <= e ? "right" : "bottom";
|
|
30
|
-
} else if (l.current === "left" || l.current === "right") {
|
|
31
|
-
if (i >= n)
|
|
32
|
-
return "top";
|
|
33
|
-
if (i < n / 2)
|
|
34
|
-
return "bottom";
|
|
35
|
-
if (f < n / 2)
|
|
36
|
-
return l.current === "left" ? "left" : "right";
|
|
37
|
-
}
|
|
38
|
-
return l.current;
|
|
39
|
-
}, et = X(({ children: l, overlay: a, show: u, onToggle: c, position: i = "auto", trigger: f = "click", defaultShow: o = !1 }, g) => {
|
|
40
|
-
const e = S(), n = S(), d = S(), [h, x] = w(""), [m, y] = w(""), [p, H] = w(o), v = S(p), r = (t) => {
|
|
41
|
-
v.current = t, H(t);
|
|
42
|
-
}, [C, R] = w(i === "auto" ? "top" : i), B = S(C), W = (t) => {
|
|
43
|
-
B.current = t, R(t);
|
|
44
|
-
}, [k, A] = w(!1), [L, O] = w(!1), [J, F] = w(!0), P = Array.isArray(f) ? f : [f], E = (t, s, b) => {
|
|
45
|
-
s.current && (y(q(t, s, B.current, b.current)), x(q(t, b, B.current, b.current, !0)));
|
|
46
|
-
}, I = () => {
|
|
47
|
-
if (v.current && i === "auto") {
|
|
48
|
-
let t = G(B, e, n, d);
|
|
49
|
-
W(t);
|
|
50
|
-
}
|
|
51
|
-
}, z = () => {
|
|
52
|
-
E(e, n, d), v.current;
|
|
53
|
-
}, K = (t) => {
|
|
54
|
-
if (L && J) {
|
|
55
|
-
F(!1);
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
r(!p), c(!p);
|
|
59
|
-
}, Q = (t) => {
|
|
60
|
-
k || (A(!0), c(!0));
|
|
61
|
-
}, T = (t) => {
|
|
62
|
-
r(!0), O(!0), c(!0);
|
|
63
|
-
}, D = (t) => {
|
|
64
|
-
k ? A(!1) : L && (O(!1), F(!0)), r(!1), c(!1);
|
|
65
|
-
};
|
|
66
|
-
$(() => {
|
|
67
|
-
if (n.current && u && (E(e, n, d), i === "auto")) {
|
|
68
|
-
let t = G(B, e, n, d);
|
|
69
|
-
W(t);
|
|
70
|
-
}
|
|
71
|
-
if (e.current) {
|
|
72
|
-
let t = document.body, s = getComputedStyle(e.current).position;
|
|
73
|
-
y({
|
|
74
|
-
top: e.current.getBoundingClientRect().top - (s != "fixed" ? t.getBoundingClientRect().top : 0),
|
|
75
|
-
left: e.current.getBoundingClientRect().left - (s != "fixed" ? t.getBoundingClientRect().left : 0)
|
|
76
|
-
}), x({
|
|
77
|
-
top: e.current.getBoundingClientRect().top - (s != "fixed" ? t.getBoundingClientRect().top : 0),
|
|
78
|
-
left: e.current.getBoundingClientRect().left - (s != "fixed" ? t.getBoundingClientRect().left : 0)
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
r(u);
|
|
82
|
-
}, [u, n, e, C]), $(() => (window.addEventListener("scroll", I), window.addEventListener("resize", z), function() {
|
|
83
|
-
window.removeEventListener("scroll", I), window.removeEventListener("resize", z);
|
|
84
|
-
}), []);
|
|
85
|
-
const j = (t) => {
|
|
86
|
-
let s = getComputedStyle(t.current).position;
|
|
87
|
-
return s === "fixed" ? "fixed" : s === "sticky" ? "sticky" : "absolute";
|
|
88
|
-
};
|
|
89
|
-
return /* @__PURE__ */ M("div", { ref: g, style: { display: "static" }, children: [
|
|
90
|
-
Y(l, {
|
|
91
|
-
ref: e,
|
|
92
|
-
onClick: P.find((t) => t === "click") ? K : null,
|
|
93
|
-
onMouseOver: P.find((t) => t === "hover") ? Q : null,
|
|
94
|
-
onMouseLeave: P.find((t) => t === "hover") ? D : null,
|
|
95
|
-
onFocus: P.find((t) => t === "focus") ? T : null,
|
|
96
|
-
onBlur: P.find((t) => t === "focus") ? D : null
|
|
97
|
-
}),
|
|
98
|
-
u ? Z(
|
|
99
|
-
/* @__PURE__ */ M(U, { children: [
|
|
100
|
-
/* @__PURE__ */ N(
|
|
101
|
-
"div",
|
|
102
|
-
{
|
|
103
|
-
ref: n,
|
|
104
|
-
style: { maxWidth: "100%", maxHeight: "100%", position: j(e), top: m.top, left: m.left, zIndex: "1010" },
|
|
105
|
-
children: a
|
|
106
|
-
}
|
|
107
|
-
),
|
|
108
|
-
/* @__PURE__ */ N(
|
|
109
|
-
"div",
|
|
110
|
-
{
|
|
111
|
-
id: "sg-overlay-arrow",
|
|
112
|
-
ref: d,
|
|
113
|
-
"aria-hidden": !0,
|
|
114
|
-
className: `sg-overlay-arrow${C ? " overlay-position-" + C : ""}`,
|
|
115
|
-
style: { position: j(e), top: h.top, left: h.left }
|
|
116
|
-
}
|
|
117
|
-
)
|
|
118
|
-
] }),
|
|
119
|
-
document.body
|
|
120
|
-
) : null
|
|
121
|
-
] });
|
|
122
|
-
});
|
|
123
|
-
export {
|
|
124
|
-
et as default
|
|
125
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./Overlay";
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import { createPortal as A } from "react-dom";
|
|
3
|
-
import { forwardRef as u, useState as M, useRef as y, useEffect as P } from "react";
|
|
4
|
-
const W = u(({ children: e, initialPosition: s = { top: 0, left: 0 }, id: o, resize: n = !1, move: f = !1, className: a, style: l, ...p }, R) => {
|
|
5
|
-
const [r, C] = M({ offSetTop: 0, offSetLeft: 0, ...s }), N = n ? "true" : "false", $ = f ? "true" : "false", D = y(R), i = y(null), [h, T] = M(!1), b = y(h);
|
|
6
|
-
P(() => {
|
|
7
|
-
b.current = h;
|
|
8
|
-
}, [h]);
|
|
9
|
-
const H = (t) => {
|
|
10
|
-
const d = t.target;
|
|
11
|
-
if (f && d.className.includes("sg-popout-title") || d.className.includes("sg-popout-header")) {
|
|
12
|
-
const { top: m, left: g } = i.current.getBoundingClientRect();
|
|
13
|
-
C((w) => ({
|
|
14
|
-
...w,
|
|
15
|
-
offSetTop: t.clientY - m,
|
|
16
|
-
offSetLeft: t.clientX - g
|
|
17
|
-
})), i.current.style.setProperty("user-select", "none"), i.current.setPointerCapture(t.pointerId), T(!0);
|
|
18
|
-
}
|
|
19
|
-
}, L = () => {
|
|
20
|
-
f && (i.current.style.removeProperty("user-select"), T(!1));
|
|
21
|
-
}, O = (t) => {
|
|
22
|
-
if (f && b.current && i.current) {
|
|
23
|
-
const d = t.clientY - r.offSetTop < 0, m = window.innerHeight - (t.clientY - r.offSetTop + i.current.offsetHeight) < 0, g = t.clientX - r.offSetLeft < 0, w = window.innerWidth - (t.clientX - r.offSetLeft + i.current.offsetWidth) < 0;
|
|
24
|
-
let v = d ? 0 : t.clientY - r.offSetTop;
|
|
25
|
-
v = m ? window.innerHeight - i.current.offsetHeight : v;
|
|
26
|
-
let S = g ? 0 : t.clientX - r.offSetLeft;
|
|
27
|
-
S = w ? window.innerWidth - i.current.offsetWidth : S, C((x) => ({
|
|
28
|
-
...x,
|
|
29
|
-
top: v,
|
|
30
|
-
left: S
|
|
31
|
-
}));
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
return P(() => (document.body.addEventListener("pointerup", () => L(), !0), function() {
|
|
35
|
-
document.body.removeEventListener("pointerup", () => L(), !0);
|
|
36
|
-
}), []), A(
|
|
37
|
-
/* @__PURE__ */ c(
|
|
38
|
-
"dialog",
|
|
39
|
-
{
|
|
40
|
-
"data-resize": N,
|
|
41
|
-
"data-move": $,
|
|
42
|
-
"data-passedRef": D,
|
|
43
|
-
ref: i,
|
|
44
|
-
id: o,
|
|
45
|
-
className: `sg-moveable-popout${a ? " " + a : ""}`,
|
|
46
|
-
style: { ...l, top: r.top, left: r.left, bottom: r.bottom, right: r.right },
|
|
47
|
-
onPointerDown: H,
|
|
48
|
-
onPointerMove: (t) => O(t),
|
|
49
|
-
...p,
|
|
50
|
-
children: e
|
|
51
|
-
}
|
|
52
|
-
),
|
|
53
|
-
document.body
|
|
54
|
-
);
|
|
55
|
-
}), X = u(
|
|
56
|
-
({ children: e, className: s, as: o = "div", ...n }, f) => {
|
|
57
|
-
let l = ["div", "span", "h1", "h2", "h3", "h4", "h5", "h6"].find((p) => p === o) ? o : "div";
|
|
58
|
-
return /* @__PURE__ */ c(l, { ref: f, className: `sg-popout-header ${s}`, ...n, children: e });
|
|
59
|
-
}
|
|
60
|
-
), Y = u(({ as: e = "h4", className: s, children: o, ...n }, f) => {
|
|
61
|
-
let l = ["h1", "h2", "h3", "h4", "h5", "h6"].find((p) => p === e) ? e : "h5";
|
|
62
|
-
return /* @__PURE__ */ c(l, { ref: f, className: `sg-popout-title ${s}`, ...n, children: o });
|
|
63
|
-
}), B = u(({ children: e, className: s, ...o }, n) => /* @__PURE__ */ c("div", { ref: n, className: `sg-popout-body ${s}`, ...o, children: e })), E = u(({ children: e, className: s, ...o }, n) => /* @__PURE__ */ c("p", { ref: n, className: `sg-popout-text ${s}`, ...o, children: e })), j = u(({ children: e, className: s, ...o }, n) => /* @__PURE__ */ c("div", { ref: n, className: `sg-popout-footer ${s}`, ...o, children: e })), U = Object.assign(W, {
|
|
64
|
-
Header: X,
|
|
65
|
-
Title: Y,
|
|
66
|
-
Body: B,
|
|
67
|
-
Text: E,
|
|
68
|
-
Footer: j
|
|
69
|
-
});
|
|
70
|
-
export {
|
|
71
|
-
U as default
|
|
72
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsxs as n, Fragment as o, jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as h } from "react";
|
|
3
|
-
const p = h(({ size: e = "1em", color: s = "white", label: a, className: r, controlId: i, ...t }, d) => /* @__PURE__ */ n(o, { children: [
|
|
4
|
-
/* @__PURE__ */ l("div", { "aria-labelledby": i, role: "status", ref: d, className: `sg-spinner${r ? " " + r : ""}`, style: { width: e, height: e, borderColor: s }, ...t }),
|
|
5
|
-
/* @__PURE__ */ l("label", { id: i, className: "sg-visually-hidden", children: a })
|
|
6
|
-
] }));
|
|
7
|
-
export {
|
|
8
|
-
p as default
|
|
9
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as m } from "react";
|
|
3
|
-
const p = m(({ children: t, size: s = "lg", className: e, ...r }, a) => {
|
|
4
|
-
let l = `sg-table${e ? " " + e : ""}${s === "sm" ? " sg-table-sm" : ""}`;
|
|
5
|
-
return /* @__PURE__ */ o("table", { ref: a, className: l, ...r, children: t });
|
|
6
|
-
});
|
|
7
|
-
export {
|
|
8
|
-
p as default
|
|
9
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,9 +0,0 @@
|
|
|
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,77 +0,0 @@
|
|
|
1
|
-
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as h, forwardRef as C, useState as m, useMemo as p, useContext as w } from "react";
|
|
3
|
-
const T = h(null), y = ({ children: e, value: t }) => /* @__PURE__ */ d(T.Provider, { value: t, children: e }), f = () => {
|
|
4
|
-
const e = w(T);
|
|
5
|
-
if (!e)
|
|
6
|
-
throw new Error(
|
|
7
|
-
"useTabContext has to be used within a TabContextProvider!"
|
|
8
|
-
);
|
|
9
|
-
return e;
|
|
10
|
-
}, A = C(({ children: e, className: t, controlId: n, activeClassName: o, defaultActive: r, ...i }, l) => {
|
|
11
|
-
const [s, c] = m(r), v = o || "sg-active", a = p(() => ({
|
|
12
|
-
activeTab: s,
|
|
13
|
-
setActiveTab: c,
|
|
14
|
-
controlId: n,
|
|
15
|
-
activeClass: v
|
|
16
|
-
}), [s, c, n]);
|
|
17
|
-
return /* @__PURE__ */ d(y, { value: a, children: /* @__PURE__ */ d("div", { ref: l, id: n + "-tab-wrapper", className: `sg-tabs${t ? " " + t : ""}`, ...i, children: e }) });
|
|
18
|
-
}), k = C(({ children: e, className: t, ...n }, o) => {
|
|
19
|
-
const { controlId: r, activeClass: i } = f(), l = (s) => {
|
|
20
|
-
const c = s.key, v = document.getElementById(r + "-tab-controls");
|
|
21
|
-
if (v) {
|
|
22
|
-
const a = Array.from(v.children);
|
|
23
|
-
if (c === "ArrowRight" || c === "ArrowLeft") {
|
|
24
|
-
s.preventDefault();
|
|
25
|
-
const b = document.querySelector(".sg-tabs-button." + i), g = a.indexOf(b), u = c === "ArrowRight" ? 1 : -1, x = g + u < 0 ? a.length - 1 : g + u >= a.length ? 0 : g + u;
|
|
26
|
-
a[x].focus(), a[x].click();
|
|
27
|
-
} else if (c === "Home" || c === "End") {
|
|
28
|
-
s.preventDefault();
|
|
29
|
-
const b = c === "Home" ? 0 : a.length - 1;
|
|
30
|
-
a[b].focus(), a[b].click();
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
return /* @__PURE__ */ d("div", { onKeyDown: (s) => l(s), role: "tablist", id: r + "-tab-controls", ref: o, className: `sg-tabs-controls${t ? " " + t : ""}`, ...n, children: e });
|
|
35
|
-
}), D = C(({ children: e, className: t, onClick: n, tabId: o, id: r, ...i }, l) => {
|
|
36
|
-
const { activeTab: s, setActiveTab: c, activeClass: v } = f(), a = "sg-tabs-button" + (t ? " " + t : "") + (s === o ? " " + v : ""), b = s === o, g = (u) => {
|
|
37
|
-
c(o), n && n(u);
|
|
38
|
-
};
|
|
39
|
-
return /* @__PURE__ */ d(
|
|
40
|
-
"button",
|
|
41
|
-
{
|
|
42
|
-
role: "tab",
|
|
43
|
-
type: "button",
|
|
44
|
-
id: o + "-button",
|
|
45
|
-
ref: l,
|
|
46
|
-
onClick: (u) => g(u),
|
|
47
|
-
className: a,
|
|
48
|
-
...i,
|
|
49
|
-
tabIndex: b ? 0 : -1,
|
|
50
|
-
"aria-selected": b ? "true" : "false",
|
|
51
|
-
"aria-controls": o + "-page",
|
|
52
|
-
children: e
|
|
53
|
-
}
|
|
54
|
-
);
|
|
55
|
-
}), P = C(({ children: e, className: t, ...n }, o) => /* @__PURE__ */ d("div", { role: "none", ref: o, className: `sg-tabs-content${t ? " " + t : ""}`, ...n, children: e })), $ = C(({ children: e, className: t, tabId: n, ...o }, r) => {
|
|
56
|
-
const { activeTab: i, activeClass: l } = f(), s = "sg-tabs-page" + (t ? " " + t : "") + (i === n ? " " + l : "");
|
|
57
|
-
return /* @__PURE__ */ d(
|
|
58
|
-
"div",
|
|
59
|
-
{
|
|
60
|
-
role: "tabpanel",
|
|
61
|
-
id: n + "-page",
|
|
62
|
-
"aria-labelledby": n + "-button",
|
|
63
|
-
ref: r,
|
|
64
|
-
className: s,
|
|
65
|
-
...o,
|
|
66
|
-
children: e
|
|
67
|
-
}
|
|
68
|
-
);
|
|
69
|
-
}), j = Object.assign(A, {
|
|
70
|
-
Controls: k,
|
|
71
|
-
Button: D,
|
|
72
|
-
Content: P,
|
|
73
|
-
Page: $
|
|
74
|
-
});
|
|
75
|
-
export {
|
|
76
|
-
j as default
|
|
77
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as g } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as d, useState as u } from "react";
|
|
3
|
-
const p = d(({ children: o, toggled: r = "false", onClick: e, ...a }, c) => {
|
|
4
|
-
const [l, n] = u(r === "true"), f = (t) => {
|
|
5
|
-
n((s) => !s), e && e(t);
|
|
6
|
-
};
|
|
7
|
-
return /* @__PURE__ */ g("button", { onClick: (t) => f(t), "data-toggled": l, ...a, children: o });
|
|
8
|
-
});
|
|
9
|
-
export {
|
|
10
|
-
p as default
|
|
11
|
-
};
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export * from "./Button";
|
|
2
|
-
export * from "./Card";
|
|
3
|
-
export * from "./CloseButton";
|
|
4
|
-
export * from "./Dropdown";
|
|
5
|
-
export * from "./FloatingLabel";
|
|
6
|
-
export * from "./Form";
|
|
7
|
-
export * from "./Grid";
|
|
8
|
-
export * from "./InputGroup";
|
|
9
|
-
export * from "./Modal";
|
|
10
|
-
export * from "./Nav";
|
|
11
|
-
export * from "./NavBar";
|
|
12
|
-
export * from "./NavDropdown";
|
|
13
|
-
export * from "./OffCanvas";
|
|
14
|
-
export * from "./Overlay";
|
|
15
|
-
export * from "./Popout";
|
|
16
|
-
export * from "./Spinner";
|
|
17
|
-
export * from "./Table";
|
|
18
|
-
export * from "./Tabs";
|
|
19
|
-
export * from "./ToggleButton";
|
package/dist/components/index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import "./Button/Button.js";
|
|
2
|
-
import "./Card/Card.js";
|
|
3
|
-
import "./CloseButton/CloseButton.js";
|
|
4
|
-
import "./Dropdown/Dropdown.js";
|
|
5
|
-
import "./FloatingLabel/FloatingLabel.js";
|
|
6
|
-
import "./Form/Form.js";
|
|
7
|
-
import "./Grid/Grid.js";
|
|
8
|
-
import "./InputGroup/InputGroup.js";
|
|
9
|
-
import "./Modal/Modal.js";
|
|
10
|
-
import "./Nav/Nav.js";
|
|
11
|
-
import "./NavBar/Navbar.js";
|
|
12
|
-
import "./NavDropdown/NavDropdown.js";
|
|
13
|
-
import "./OffCanvas/OffCanvas.js";
|
|
14
|
-
import "./Overlay/Overlay.js";
|
|
15
|
-
import "./Popout/Popout.js";
|
|
16
|
-
import "./Spinner/Spinner.js";
|
|
17
|
-
import "./Table/Table.js";
|
|
18
|
-
import "./Tabs/Tabs.js";
|
|
19
|
-
import "./ToggleButton/ToggleButton.js";
|
package/dist/index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import "./components/Button/Button.js";
|
|
2
|
-
import "./components/Card/Card.js";
|
|
3
|
-
import "./components/CloseButton/CloseButton.js";
|
|
4
|
-
import "./components/Dropdown/Dropdown.js";
|
|
5
|
-
import "./components/FloatingLabel/FloatingLabel.js";
|
|
6
|
-
import "./components/Form/Form.js";
|
|
7
|
-
import "./components/Grid/Grid.js";
|
|
8
|
-
import "./components/InputGroup/InputGroup.js";
|
|
9
|
-
import "./components/Modal/Modal.js";
|
|
10
|
-
import "./components/Nav/Nav.js";
|
|
11
|
-
import "./components/NavBar/Navbar.js";
|
|
12
|
-
import "./components/NavDropdown/NavDropdown.js";
|
|
13
|
-
import "./components/OffCanvas/OffCanvas.js";
|
|
14
|
-
import "./components/Overlay/Overlay.js";
|
|
15
|
-
import "./components/Popout/Popout.js";
|
|
16
|
-
import "./components/Spinner/Spinner.js";
|
|
17
|
-
import "./components/Table/Table.js";
|
|
18
|
-
import "./components/Tabs/Tabs.js";
|
|
19
|
-
import "./components/ToggleButton/ToggleButton.js";
|
package/dist/types.d.ts
DELETED
package/dist/vite-env.d.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|