stargazer-ui 1.0.3 → 1.0.5
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 +4 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/components/Button/Button.d.ts +4 -0
- package/dist/components/Button/Button.types.d.ts +7 -0
- package/dist/components/Button/Button.types.js +1 -0
- package/dist/components/Button/index.d.ts +1 -0
- package/dist/components/Button/index.js +4 -0
- package/dist/components/Card/Card.d.ts +34 -0
- package/dist/components/Card/Card.js +18 -0
- package/dist/components/Card/Card.types.d.ts +24 -0
- package/dist/components/Card/Card.types.js +1 -0
- package/dist/components/Card/index.d.ts +1 -0
- package/dist/components/Card/index.js +4 -0
- package/dist/{CloseButton/index.d.ts → components/CloseButton/CloseButton.d.ts} +1 -5
- package/dist/components/CloseButton/CloseButton.types.d.ts +5 -0
- package/dist/components/CloseButton/CloseButton.types.js +1 -0
- package/dist/components/CloseButton/index.d.ts +1 -0
- package/dist/components/CloseButton/index.js +4 -0
- package/dist/{Dropdown/index.d.ts → components/Dropdown/Dropdown.d.ts} +18 -55
- package/dist/{Dropdown/index.js → components/Dropdown/Dropdown.js} +31 -30
- package/dist/components/Dropdown/Dropdown.types.d.ts +55 -0
- package/dist/components/Dropdown/Dropdown.types.js +1 -0
- package/dist/components/Dropdown/index.d.ts +1 -0
- package/dist/components/Dropdown/index.js +4 -0
- package/dist/components/FloatingLabel/FloatingLabel.d.ts +4 -0
- package/dist/components/FloatingLabel/FloatingLabel.js +13 -0
- package/dist/components/FloatingLabel/FloatingLabel.types.d.ts +9 -0
- package/dist/components/FloatingLabel/FloatingLabel.types.js +1 -0
- package/dist/components/FloatingLabel/index.d.ts +1 -0
- package/dist/components/FloatingLabel/index.js +4 -0
- package/dist/components/Form/Form.d.ts +17 -0
- package/dist/{Form/index.js → components/Form/Form.js} +16 -15
- package/dist/components/Form/Form.types.d.ts +50 -0
- package/dist/components/Form/Form.types.js +1 -0
- package/dist/components/Form/index.d.ts +1 -0
- package/dist/components/Form/index.js +4 -0
- package/dist/components/Grid/Grid.d.ts +5 -0
- package/dist/components/Grid/Grid.js +36 -0
- package/dist/components/Grid/index.d.ts +1 -0
- package/dist/components/Grid/index.js +4 -0
- package/dist/components/InputGroup/InputGroup.d.ts +6 -0
- package/dist/components/InputGroup/InputGroup.js +8 -0
- package/dist/components/InputGroup/InputGroup.types.d.ts +10 -0
- package/dist/components/InputGroup/InputGroup.types.js +1 -0
- package/dist/components/InputGroup/index.d.ts +1 -0
- package/dist/components/InputGroup/index.js +4 -0
- package/dist/components/Modal/Modal.d.ts +40 -0
- package/dist/components/Modal/Modal.js +100 -0
- package/dist/components/Modal/Modal.types.d.ts +40 -0
- package/dist/components/Modal/Modal.types.js +1 -0
- package/dist/components/Modal/index.d.ts +1 -0
- package/dist/components/Modal/index.js +4 -0
- package/dist/components/Nav/Nav.d.ts +30 -0
- package/dist/components/Nav/Nav.js +13 -0
- package/dist/components/Nav/Nav.types.d.ts +17 -0
- package/dist/components/Nav/Nav.types.js +1 -0
- package/dist/components/Nav/index.d.ts +1 -0
- package/dist/components/Nav/index.js +4 -0
- package/dist/components/NavBar/Navbar.d.ts +20 -0
- package/dist/components/NavBar/Navbar.js +17 -0
- package/dist/components/NavBar/Navbar.types.d.ts +18 -0
- package/dist/components/NavBar/Navbar.types.js +1 -0
- package/dist/components/NavBar/index.d.ts +1 -0
- package/dist/components/NavBar/index.js +4 -0
- package/dist/components/NavDropdown/NavDropdown.d.ts +35 -0
- package/dist/components/NavDropdown/NavDropdown.js +62 -0
- package/dist/components/NavDropdown/NavDropdown.types.d.ts +5 -0
- package/dist/components/NavDropdown/NavDropdown.types.js +1 -0
- package/dist/components/NavDropdown/index.d.ts +1 -0
- package/dist/components/NavDropdown/index.js +4 -0
- package/dist/components/OffCanvas/OffCanvas.d.ts +3 -0
- package/dist/components/OffCanvas/OffCanvas.js +2266 -0
- package/dist/components/OffCanvas/index.d.ts +1 -0
- package/dist/components/OffCanvas/index.js +4 -0
- package/dist/components/Overlay/Overlay.d.ts +3 -0
- package/dist/components/Overlay/index.d.ts +1 -0
- package/dist/components/Overlay/index.js +4 -0
- package/dist/components/Popout/Popout.d.ts +22 -0
- package/dist/components/Popout/Popout.js +72 -0
- package/dist/components/Popout/Popout.types.d.ts +36 -0
- package/dist/components/Popout/Popout.types.js +1 -0
- package/dist/components/Popout/index.d.ts +1 -0
- package/dist/components/Popout/index.js +4 -0
- package/dist/components/Spinner/Spinner.d.ts +4 -0
- package/dist/components/Spinner/Spinner.js +9 -0
- package/dist/components/Spinner/Spinner.types.d.ts +7 -0
- package/dist/components/Spinner/Spinner.types.js +1 -0
- package/dist/components/Spinner/index.d.ts +1 -0
- package/dist/components/Spinner/index.js +4 -0
- package/dist/components/Table/Table.d.ts +4 -0
- package/dist/components/Table/Table.js +9 -0
- package/dist/components/Table/Table.types.d.ts +7 -0
- package/dist/components/Table/Table.types.js +1 -0
- package/dist/components/Table/index.d.ts +1 -0
- package/dist/components/Table/index.js +4 -0
- package/dist/components/Tabs/Tabs.d.ts +9 -0
- package/dist/components/Tabs/Tabs.js +77 -0
- package/dist/components/Tabs/Tabs.types.d.ts +35 -0
- package/dist/components/Tabs/Tabs.types.js +1 -0
- package/dist/components/Tabs/index.d.ts +1 -0
- package/dist/components/Tabs/index.js +4 -0
- package/dist/components/ToggleButton/ToggleButton.d.ts +9 -0
- package/dist/components/ToggleButton/ToggleButton.js +11 -0
- package/dist/components/ToggleButton/ToggleButton.types.d.ts +0 -0
- package/dist/components/ToggleButton/ToggleButton.types.js +1 -0
- package/dist/components/ToggleButton/index.d.ts +1 -0
- package/dist/components/ToggleButton/index.js +4 -0
- package/dist/components/index.d.ts +19 -0
- package/dist/components/index.js +19 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +19 -0
- package/dist/types.d.ts +2 -0
- package/package.json +18 -4
- package/dist/Button/index.d.ts +0 -9
- package/dist/Card/index.d.ts +0 -92
- package/dist/Card/index.js +0 -18
- package/dist/FloatingLabel/index.js +0 -13
- package/dist/Form/index.d.ts +0 -61
- package/dist/InputGroup/index.js +0 -7
- package/dist/Modal/index.js +0 -85
- package/dist/Nav/index.js +0 -14
- package/dist/NavBar/index.js +0 -16
- package/dist/NavDropdown/index.js +0 -850
- package/dist/Popout/index.js +0 -85
- package/dist/Tabs/index.js +0 -69
- package/dist/ToggleButton/index.js +0 -11
- package/dist/main.js +0 -30
- package/dist/stylesheets/stargazerui.css +0 -3759
- package/dist/stylesheets/stargazerui.css.map +0 -1
- /package/dist/{Button/index.js → components/Button/Button.js} +0 -0
- /package/dist/{CloseButton/index.js → components/CloseButton/CloseButton.js} +0 -0
- /package/dist/{Overlay/index.js → components/Overlay/Overlay.js} +0 -0
package/dist/Popout/index.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import { createPortal as $ } from "react-dom";
|
|
3
|
-
import A, { forwardRef as p, useState as L, useRef as T, useEffect as N } from "react";
|
|
4
|
-
const B = (e, o, s, r) => {
|
|
5
|
-
const t = r ? r.element : document.body;
|
|
6
|
-
N(() => {
|
|
7
|
-
if (t)
|
|
8
|
-
return t.addEventListener(e, o, s), function() {
|
|
9
|
-
t.removeEventListener(e, o, s);
|
|
10
|
-
};
|
|
11
|
-
}, [o, t]);
|
|
12
|
-
}, a = p(({ children: e, initialPosition: o, id: s, resize: r = !1, move: t = !1, ...i }, u) => {
|
|
13
|
-
const [n, C] = L({ offSetTop: 0, offSetLeft: 0, ...o });
|
|
14
|
-
console.log(n);
|
|
15
|
-
const b = r ? "true" : "false", M = t ? "true" : "false", l = T(u || null), [h, S] = L(!1), y = T(h);
|
|
16
|
-
N(() => {
|
|
17
|
-
y.current = h;
|
|
18
|
-
}, [h]);
|
|
19
|
-
const R = (f) => {
|
|
20
|
-
if (t && f.target.className.includes("sg-popout-title") || f.target.className.includes("sg-popout-header")) {
|
|
21
|
-
const { top: d, left: g } = l.current.getBoundingClientRect();
|
|
22
|
-
C((m) => ({
|
|
23
|
-
...m,
|
|
24
|
-
offSetTop: f.clientY - d,
|
|
25
|
-
offSetLeft: f.clientX - g
|
|
26
|
-
})), l.current.style.setProperty("user-select", "none"), l.current.setPointerCapture("moveable-popup-" + s), S((m) => !0);
|
|
27
|
-
}
|
|
28
|
-
}, H = (f) => {
|
|
29
|
-
t && (l.current.style.removeProperty("user-select"), S((d) => !1));
|
|
30
|
-
}, P = (f) => {
|
|
31
|
-
if (t && y.current) {
|
|
32
|
-
const d = f.clientY - n.offSetTop < 0, g = window.innerHeight - (f.clientY - n.offSetTop + l.current.offsetHeight) < 0, m = f.clientX - n.offSetLeft < 0, x = window.innerWidth - (f.clientX - n.offSetLeft + l.current.offsetWidth) < 0;
|
|
33
|
-
let v = d ? 0 : f.clientY - n.offSetTop;
|
|
34
|
-
v = g ? window.innerHeight - l.current.offsetHeight : v;
|
|
35
|
-
let w = m ? 0 : f.clientX - n.offSetLeft;
|
|
36
|
-
w = x ? window.innerWidth - l.current.offsetWidth : w, C((E) => ({
|
|
37
|
-
...E,
|
|
38
|
-
top: v,
|
|
39
|
-
left: w
|
|
40
|
-
}));
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
return B("pointerup", H, !0, { element: document.body }), $(
|
|
44
|
-
/* @__PURE__ */ c(
|
|
45
|
-
"dialog",
|
|
46
|
-
{
|
|
47
|
-
"data-resize": b,
|
|
48
|
-
"data-move": M,
|
|
49
|
-
ref: l,
|
|
50
|
-
id: s,
|
|
51
|
-
className: "moveable-popout",
|
|
52
|
-
style: { top: n.top, left: n.left, bottom: n.bottom, right: n.right },
|
|
53
|
-
onMouseDown: R,
|
|
54
|
-
onMouseMove: P,
|
|
55
|
-
children: e
|
|
56
|
-
}
|
|
57
|
-
),
|
|
58
|
-
document.body
|
|
59
|
-
);
|
|
60
|
-
}), D = ({ as: e, className: o, children: s, ...r }, t) => {
|
|
61
|
-
let u = ["div", "span", "h1", "h2", "h3", "h4", "h5", "h6"].find((n) => n === e) ? e : "div";
|
|
62
|
-
return /* @__PURE__ */ c(u, { ref: t, className: `sg-popout-header ${o}`, ...r, children: s });
|
|
63
|
-
};
|
|
64
|
-
a.Header = p(D);
|
|
65
|
-
const W = ({ children: e, className: o, ...s }, r) => {
|
|
66
|
-
e = e.length ? e.filter((i) => i != null && i != "") : e;
|
|
67
|
-
let t = [];
|
|
68
|
-
return A.Children.forEach(e, (i) => {
|
|
69
|
-
t.push(i);
|
|
70
|
-
}), /* @__PURE__ */ c("div", { ref: r, className: `sg-popout-body ${o}`, ...s, children: t.map((i) => i) });
|
|
71
|
-
};
|
|
72
|
-
a.Body = p(W);
|
|
73
|
-
const X = ({ as: e, className: o, children: s, ...r }, t) => {
|
|
74
|
-
let u = ["h1", "h2", "h3", "h4", "h5", "h6"].find((n) => n === e) ? e : "h5";
|
|
75
|
-
return /* @__PURE__ */ c(u, { ref: t, className: `sg-popout-title ${o}`, ...r, children: s });
|
|
76
|
-
};
|
|
77
|
-
a.Title = p(X);
|
|
78
|
-
const Y = ({ children: e, className: o, ...s }, r) => /* @__PURE__ */ c("p", { ref: r, className: `sg-popout-text ${o}`, ...s, children: e });
|
|
79
|
-
a.Text = p(Y);
|
|
80
|
-
const O = ({ children: e, className: o, ...s }, r) => /* @__PURE__ */ c("div", { ref: r, className: `sg-popout-footer ${o}`, ...s, children: e });
|
|
81
|
-
a.Footer = p(O);
|
|
82
|
-
export {
|
|
83
|
-
a as default,
|
|
84
|
-
B as useEventListener
|
|
85
|
-
};
|
package/dist/Tabs/index.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as x, forwardRef as v, useState as h, useMemo as T, useContext as m } from "react";
|
|
3
|
-
const C = x(null), w = ({ children: s, value: t }) => /* @__PURE__ */ u(C.Provider, { value: t, children: s }), p = v(({ children: s, className: t, controlId: e, activeClassName: n, defaultActive: l = 0, ...i }, b) => {
|
|
4
|
-
const [a, c] = h(l), o = n || "sg-active", r = T(() => ({
|
|
5
|
-
activeTab: a,
|
|
6
|
-
setActiveTab: c,
|
|
7
|
-
controlId: e,
|
|
8
|
-
activeClass: o
|
|
9
|
-
}), [a, c, e]);
|
|
10
|
-
return /* @__PURE__ */ u(w, { value: r, children: /* @__PURE__ */ u("div", { ref: b, id: e + "-tab-wrapper", className: `sg-tabs${t ? " " + t : ""}`, ...i, children: s }) });
|
|
11
|
-
}), y = ({ children: s, className: t, ...e }, n) => {
|
|
12
|
-
const { controlId: l, activeClass: i } = m(C);
|
|
13
|
-
return /* @__PURE__ */ u("div", { onKeyDown: (a) => {
|
|
14
|
-
const c = a.key, o = Array.from(document.getElementById(l + "-tab-controls").children);
|
|
15
|
-
if (c === "ArrowRight" || c === "ArrowLeft") {
|
|
16
|
-
a.preventDefault();
|
|
17
|
-
const r = document.querySelector(".sg-tabs-button." + i), d = o.indexOf(r), g = c === "ArrowRight" ? 1 : -1, f = d + g < 0 ? o.length - 1 : d + g >= o.length ? 0 : d + g;
|
|
18
|
-
o[f].focus(), o[f].click();
|
|
19
|
-
} else if (c === "Home" || c === "End") {
|
|
20
|
-
a.preventDefault();
|
|
21
|
-
const r = c === "Home" ? 0 : o.length - 1;
|
|
22
|
-
o[r].focus(), o[r].click();
|
|
23
|
-
}
|
|
24
|
-
}, role: "tablist", id: l + "-tab-controls", ref: n, className: `sg-tabs-controls${t ? " " + t : ""}`, ...e, children: s });
|
|
25
|
-
};
|
|
26
|
-
p.Controls = v(y);
|
|
27
|
-
const A = ({ children: s, className: t, onClick: e, tabId: n, id: l, ...i }, b) => {
|
|
28
|
-
const { activeTab: a, setActiveTab: c, activeClass: o } = m(C), r = "sg-tabs-button" + (t ? " " + t : "") + (a === n ? " " + o : ""), d = a === n, g = (f) => {
|
|
29
|
-
c(n), e && e(f);
|
|
30
|
-
};
|
|
31
|
-
return /* @__PURE__ */ u(
|
|
32
|
-
"button",
|
|
33
|
-
{
|
|
34
|
-
role: "tab",
|
|
35
|
-
type: "button",
|
|
36
|
-
id: n + "-button",
|
|
37
|
-
ref: b,
|
|
38
|
-
onClick: g,
|
|
39
|
-
className: r,
|
|
40
|
-
...i,
|
|
41
|
-
tabIndex: d ? "0" : "-1",
|
|
42
|
-
"aria-selected": d ? "true" : "false",
|
|
43
|
-
"aria-controls": n + "-page",
|
|
44
|
-
children: s
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
};
|
|
48
|
-
p.Button = v(A);
|
|
49
|
-
const k = ({ children: s, className: t, ...e }, n) => (m(C), /* @__PURE__ */ u("div", { role: "none", ref: n, className: `sg-tabs-content${t ? " " + t : ""}`, ...e, children: s }));
|
|
50
|
-
p.Content = v(k);
|
|
51
|
-
const D = ({ children: s, className: t, tabId: e, ...n }, l) => {
|
|
52
|
-
const { activeTab: i, activeClass: b } = m(C), a = "sg-tabs-page" + (t ? " " + t : "") + (i === e ? " " + b : "");
|
|
53
|
-
return /* @__PURE__ */ u(
|
|
54
|
-
"div",
|
|
55
|
-
{
|
|
56
|
-
role: "tabpanel",
|
|
57
|
-
id: e + "-page",
|
|
58
|
-
"aria-labelledby": e + "-button",
|
|
59
|
-
ref: l,
|
|
60
|
-
className: a,
|
|
61
|
-
...n,
|
|
62
|
-
children: s
|
|
63
|
-
}
|
|
64
|
-
);
|
|
65
|
-
};
|
|
66
|
-
p.Page = v(D);
|
|
67
|
-
export {
|
|
68
|
-
p as default
|
|
69
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as u, useState as g } from "react";
|
|
3
|
-
const p = u(({ children: t, toggled: r = "false", onClick: e, ...o }, d) => {
|
|
4
|
-
const [l, n] = g(r);
|
|
5
|
-
return /* @__PURE__ */ s("button", { onClick: (a) => {
|
|
6
|
-
n((f) => f === "true" ? "false" : "true"), e && e(a);
|
|
7
|
-
}, toggled: l, ...o, children: t });
|
|
8
|
-
});
|
|
9
|
-
export {
|
|
10
|
-
p as default
|
|
11
|
-
};
|
package/dist/main.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { default as t } from "./Button/index.js";
|
|
2
|
-
import { default as e } from "./Card/index.js";
|
|
3
|
-
import { default as u } from "./CloseButton/index.js";
|
|
4
|
-
import { default as p } from "./Dropdown/index.js";
|
|
5
|
-
import { default as s } from "./FloatingLabel/index.js";
|
|
6
|
-
import { default as x } from "./Form/index.js";
|
|
7
|
-
import { default as b } from "./InputGroup/index.js";
|
|
8
|
-
import { default as v } from "./Modal/index.js";
|
|
9
|
-
import { default as N } from "./Nav/index.js";
|
|
10
|
-
import { default as C } from "./NavBar/index.js";
|
|
11
|
-
import { default as F } from "./NavDropdown/index.js";
|
|
12
|
-
import { default as i } from "./Popout/index.js";
|
|
13
|
-
import { default as I } from "./Tabs/index.js";
|
|
14
|
-
import { default as M } from "./ToggleButton/index.js";
|
|
15
|
-
export {
|
|
16
|
-
t as Button,
|
|
17
|
-
e as Card,
|
|
18
|
-
u as CloseButton,
|
|
19
|
-
p as Dropdown,
|
|
20
|
-
s as FloatingLabel,
|
|
21
|
-
x as Form,
|
|
22
|
-
b as InputGroup,
|
|
23
|
-
v as Modal,
|
|
24
|
-
N as Nav,
|
|
25
|
-
F as NavDropdown,
|
|
26
|
-
C as Navbar,
|
|
27
|
-
i as Popout,
|
|
28
|
-
I as Tabs,
|
|
29
|
-
M as ToggleButton
|
|
30
|
-
};
|