stargazer-ui 1.0.2 → 1.0.4
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 +19 -0
- package/dist/BaseTypes.js +1 -0
- package/dist/Button/index.d.ts +9 -0
- package/dist/Button/index.js +1 -1
- package/dist/Card/index.d.ts +92 -0
- package/dist/Card/index.js +15 -29
- package/dist/CloseButton/index.d.ts +8 -0
- package/dist/Dropdown/index.d.ts +124 -0
- package/dist/Dropdown/index.js +140 -117
- package/dist/FloatingLabel/index.d.ts +11 -0
- package/dist/FloatingLabel/index.js +9 -9
- package/dist/Form/index.d.ts +65 -0
- package/dist/Form/index.js +56 -51
- package/dist/Grid/Col.js +19 -0
- package/dist/Grid/Container.js +9 -0
- package/dist/Grid/Row.js +17 -0
- package/dist/InputGroup/index.d.ts +14 -0
- package/dist/InputGroup/index.js +6 -5
- package/dist/Modal/index.d.ts +70 -0
- package/dist/Modal/index.js +78 -64
- package/dist/Nav/index.d.ts +46 -0
- package/dist/Nav/index.js +11 -12
- package/dist/NavBar/index.d.ts +46 -0
- package/dist/NavBar/index.js +15 -14
- package/dist/NavDropdown/index.d.ts +39 -0
- package/dist/NavDropdown/index.js +226 -218
- package/dist/OffCanvas/OffCanvas.js +2266 -0
- package/dist/Overlay/index.js +36 -36
- package/dist/Popout/index.d.ts +56 -0
- package/dist/Popout/index.js +55 -68
- package/dist/Spinner/index.d.ts +10 -0
- package/dist/Spinner/index.js +9 -0
- package/dist/Table/index.d.ts +9 -0
- package/dist/Table/index.js +9 -0
- package/dist/Tabs/index.d.ts +42 -0
- package/dist/Tabs/index.js +60 -52
- package/dist/stylesheets/stargazerui.css +1160 -17
- package/dist/stylesheets/stargazerui.css.map +1 -1
- package/dist/vite-env.d.js +1 -0
- package/package.json +14 -2
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { BaseDialogType, BaseDivType, BaseHeadingType, BaseSpanType } from "../BaseTypes";
|
|
3
|
+
export type ModalContextType = Function | null;
|
|
4
|
+
export type ModalType = {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
id?: string;
|
|
8
|
+
centered?: boolean;
|
|
9
|
+
size?: string;
|
|
10
|
+
show: boolean;
|
|
11
|
+
backdrop?: string;
|
|
12
|
+
onHide: Function;
|
|
13
|
+
} & BaseDialogType;
|
|
14
|
+
export type ModalHeaderType = {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
as?: React.ElementType;
|
|
17
|
+
className?: string;
|
|
18
|
+
closeButton?: boolean;
|
|
19
|
+
onClick?: (event: React.MouseEvent) => void;
|
|
20
|
+
} & (BaseDivType | BaseHeadingType | BaseSpanType);
|
|
21
|
+
export type ModalTitleType = {
|
|
22
|
+
children: React.ReactNode;
|
|
23
|
+
as?: React.ElementType;
|
|
24
|
+
className?: string;
|
|
25
|
+
} & (BaseDivType | BaseHeadingType | BaseSpanType);
|
|
26
|
+
export type ModalBodyType = {
|
|
27
|
+
children: React.ReactNode;
|
|
28
|
+
className?: string;
|
|
29
|
+
} & BaseDivType;
|
|
30
|
+
export type ModalFooterType = {
|
|
31
|
+
children: React.ReactNode;
|
|
32
|
+
className?: string;
|
|
33
|
+
} & BaseDivType;
|
|
34
|
+
declare const _default: (({ children, centered, size, show, backdrop, onHide, className, id, ...restProps }: ModalType) => React.ReactPortal) & {
|
|
35
|
+
Header: React.ForwardRefExoticComponent<(Omit<{
|
|
36
|
+
children: React.ReactNode;
|
|
37
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
38
|
+
className?: string | undefined;
|
|
39
|
+
closeButton?: boolean | undefined;
|
|
40
|
+
onClick?: ((event: React.MouseEvent<Element, MouseEvent>) => void) | undefined;
|
|
41
|
+
} & React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement>, "ref"> | Omit<{
|
|
42
|
+
children: React.ReactNode;
|
|
43
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
44
|
+
className?: string | undefined;
|
|
45
|
+
closeButton?: boolean | undefined;
|
|
46
|
+
onClick?: ((event: React.MouseEvent<Element, MouseEvent>) => void) | undefined;
|
|
47
|
+
} & React.ClassAttributes<HTMLHeadingElement> & React.HTMLAttributes<HTMLHeadingElement>, "ref"> | Omit<{
|
|
48
|
+
children: React.ReactNode;
|
|
49
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
50
|
+
className?: string | undefined;
|
|
51
|
+
closeButton?: boolean | undefined;
|
|
52
|
+
onClick?: ((event: React.MouseEvent<Element, MouseEvent>) => void) | undefined;
|
|
53
|
+
} & React.ClassAttributes<HTMLSpanElement> & React.HTMLAttributes<HTMLSpanElement>, "ref">) & React.RefAttributes<HTMLDivElement | HTMLHeadingElement | HTMLSpanElement>>;
|
|
54
|
+
Title: React.ForwardRefExoticComponent<(Omit<{
|
|
55
|
+
children: React.ReactNode;
|
|
56
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
57
|
+
className?: string | undefined;
|
|
58
|
+
} & React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement>, "ref"> | Omit<{
|
|
59
|
+
children: React.ReactNode;
|
|
60
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
61
|
+
className?: string | undefined;
|
|
62
|
+
} & React.ClassAttributes<HTMLHeadingElement> & React.HTMLAttributes<HTMLHeadingElement>, "ref"> | Omit<{
|
|
63
|
+
children: React.ReactNode;
|
|
64
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
65
|
+
className?: string | undefined;
|
|
66
|
+
} & React.ClassAttributes<HTMLSpanElement> & React.HTMLAttributes<HTMLSpanElement>, "ref">) & React.RefAttributes<HTMLDivElement | HTMLHeadingElement | HTMLSpanElement>>;
|
|
67
|
+
Body: React.ForwardRefExoticComponent<Omit<ModalBodyType, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
68
|
+
Footer: React.ForwardRefExoticComponent<Omit<ModalBodyType, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
69
|
+
};
|
|
70
|
+
export default _default;
|
package/dist/Modal/index.js
CHANGED
|
@@ -1,85 +1,99 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
const g =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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 B, useEffect as w, useRef as F } from "react";
|
|
3
|
+
import { createPortal as K } from "react-dom";
|
|
4
|
+
import L from "../CloseButton/index.js";
|
|
5
|
+
import N from "../Button/index.js";
|
|
6
|
+
const g = D(null), $ = ({ 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",
|
|
10
17
|
show: o,
|
|
11
18
|
backdrop: l = "static",
|
|
12
|
-
onHide: a
|
|
13
|
-
className:
|
|
19
|
+
onHide: a,
|
|
20
|
+
className: d,
|
|
14
21
|
id: i,
|
|
15
|
-
...
|
|
16
|
-
}
|
|
17
|
-
const [
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
...m
|
|
23
|
+
}) => {
|
|
24
|
+
const [h, f] = B(o);
|
|
25
|
+
w(() => {
|
|
26
|
+
f(o);
|
|
20
27
|
}, [o]);
|
|
21
|
-
const
|
|
22
|
-
|
|
28
|
+
const r = F(null);
|
|
29
|
+
H(r);
|
|
23
30
|
let u = typeof o == "boolean" && typeof a == "function" ? void 0 : { show: typeof o == "boolean", onHide: typeof a == "function" };
|
|
24
31
|
u && console.error(
|
|
25
32
|
u.show ? null : "The variable 'show' must be used and must be a boolean used to decide when to show the modal!",
|
|
26
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!"
|
|
27
34
|
);
|
|
28
|
-
const
|
|
29
|
-
a && a(),
|
|
35
|
+
const y = () => {
|
|
36
|
+
a && a(), f(!1);
|
|
30
37
|
};
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
}, [
|
|
35
|
-
let v = `sg-modal-tag sg-modal-${
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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 K(
|
|
54
|
+
/* @__PURE__ */ s("dialog", { ref: r, className: v, onKeyDown: (c) => k(c), ...m, children: /* @__PURE__ */ s($, { value: a, children: u ? /* @__PURE__ */ s(q, { typeCheck: u, closeModal: y }) : e }) }),
|
|
45
55
|
document.body
|
|
46
|
-
)
|
|
47
|
-
}
|
|
48
|
-
let
|
|
49
|
-
const
|
|
50
|
-
l
|
|
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();
|
|
51
61
|
};
|
|
52
|
-
return /* @__PURE__ */
|
|
62
|
+
return /* @__PURE__ */ p(m, { ref: d, className: `sg-modal-header ${n}`, ...a, children: [
|
|
53
63
|
e,
|
|
54
|
-
o ? /* @__PURE__ */ s(
|
|
64
|
+
o ? /* @__PURE__ */ s(L, { variant: !0, onClick: (r) => f(r) }) : null
|
|
55
65
|
] });
|
|
56
|
-
})
|
|
57
|
-
d
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const
|
|
68
|
-
C(() => {
|
|
69
|
-
const n = (e) => {
|
|
70
|
-
const o = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])', l = t.current;
|
|
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;
|
|
71
78
|
if (l) {
|
|
72
|
-
const a = l.querySelectorAll(o)[0],
|
|
73
|
-
if (!(
|
|
79
|
+
const a = l.querySelectorAll(o)[0], d = l.querySelectorAll(o), i = d[d.length - 1];
|
|
80
|
+
if (!(n.key === "Tab"))
|
|
74
81
|
return;
|
|
75
|
-
|
|
82
|
+
n.shiftKey ? document.activeElement === a && (i.focus(), n.preventDefault()) : document.activeElement === i && (a.focus(), n.preventDefault());
|
|
76
83
|
}
|
|
77
84
|
};
|
|
78
|
-
return document.addEventListener("keydown",
|
|
79
|
-
document.removeEventListener("keydown",
|
|
85
|
+
return document.addEventListener("keydown", t, !0), function() {
|
|
86
|
+
document.removeEventListener("keydown", t, !0);
|
|
80
87
|
};
|
|
81
|
-
}, [
|
|
82
|
-
}
|
|
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(N, { variant: "danger", type: "button", onClick: () => t(), children: "Close" }) })
|
|
96
|
+
] });
|
|
83
97
|
export {
|
|
84
|
-
|
|
98
|
+
Q as default
|
|
85
99
|
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { BaseAnchorType, BaseElementType, BaseLItemType, BaseUListType } from "../BaseTypes";
|
|
3
|
+
export type NavType = {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
as?: React.ElementType;
|
|
7
|
+
} & (BaseUListType | BaseElementType);
|
|
8
|
+
export type NavItemType = {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
as?: React.ElementType;
|
|
12
|
+
} & (BaseLItemType | BaseElementType);
|
|
13
|
+
export type NavLinkType = {
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
className?: string;
|
|
16
|
+
as?: React.ElementType;
|
|
17
|
+
} & (BaseAnchorType | BaseElementType);
|
|
18
|
+
declare const _default: React.ForwardRefExoticComponent<(Omit<{
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
className?: string | undefined;
|
|
21
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
22
|
+
} & React.ClassAttributes<HTMLUListElement> & React.HTMLAttributes<HTMLUListElement>, "ref"> | Omit<{
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
className?: string | undefined;
|
|
25
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
26
|
+
} & React.ClassAttributes<HTMLElement> & React.HTMLAttributes<HTMLElement>, "ref">) & React.RefAttributes<HTMLElement>> & {
|
|
27
|
+
Item: React.ForwardRefExoticComponent<(Omit<{
|
|
28
|
+
children: React.ReactNode;
|
|
29
|
+
className?: string | undefined;
|
|
30
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
31
|
+
} & React.ClassAttributes<HTMLLIElement> & React.LiHTMLAttributes<HTMLLIElement>, "ref"> | Omit<{
|
|
32
|
+
children: React.ReactNode;
|
|
33
|
+
className?: string | undefined;
|
|
34
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
35
|
+
} & React.ClassAttributes<HTMLElement> & React.HTMLAttributes<HTMLElement>, "ref">) & React.RefAttributes<HTMLElement>>;
|
|
36
|
+
Link: React.ForwardRefExoticComponent<(Omit<{
|
|
37
|
+
children: React.ReactNode;
|
|
38
|
+
className?: string | undefined;
|
|
39
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
40
|
+
} & React.ClassAttributes<HTMLAnchorElement> & React.AnchorHTMLAttributes<HTMLAnchorElement>, "ref"> | Omit<{
|
|
41
|
+
children: React.ReactNode;
|
|
42
|
+
className?: string | undefined;
|
|
43
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
44
|
+
} & React.ClassAttributes<HTMLElement> & React.HTMLAttributes<HTMLElement>, "ref">) & React.RefAttributes<HTMLElement>>;
|
|
45
|
+
};
|
|
46
|
+
export default _default;
|
package/dist/Nav/index.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import {
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
l.Link = s(v);
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as m } from "react";
|
|
3
|
+
import { useNavbarContext as c } from "../NavBar/index.js";
|
|
4
|
+
const p = m(({ children: o, className: n, as: t = "ul", ...e }, r) => {
|
|
5
|
+
const a = t, i = c();
|
|
6
|
+
return /* @__PURE__ */ s(a, { ref: r, className: `${n} ${i || "sg-navbar-"}nav`, ...e, children: o });
|
|
7
|
+
}), v = 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 })), b = Object.assign(p, {
|
|
8
|
+
Item: v,
|
|
9
|
+
Link: f
|
|
10
|
+
});
|
|
12
11
|
export {
|
|
13
|
-
|
|
12
|
+
b as default
|
|
14
13
|
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { BaseAnchorType, BaseElementType, BaseNavType } from "../BaseTypes";
|
|
3
|
+
export type NavbarContextType = string | null;
|
|
4
|
+
export declare const NavbarContext: React.Context<NavbarContextType>;
|
|
5
|
+
export declare const useNavbarContext: () => NavbarContextType;
|
|
6
|
+
export type NavbarType = {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
navbarPrefix?: string;
|
|
10
|
+
} & BaseNavType;
|
|
11
|
+
export type NavbarBrandType = {
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
className?: string;
|
|
14
|
+
as?: React.ElementType;
|
|
15
|
+
href?: string;
|
|
16
|
+
} & (BaseAnchorType | BaseElementType);
|
|
17
|
+
export type NavbarTextType = {
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
className?: string;
|
|
20
|
+
as?: React.ElementType;
|
|
21
|
+
} & BaseElementType;
|
|
22
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<NavbarType, "ref"> & React.RefAttributes<HTMLElement>> & {
|
|
23
|
+
Brand: React.ForwardRefExoticComponent<(Omit<{
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
className?: string | undefined;
|
|
26
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
27
|
+
href?: string | undefined;
|
|
28
|
+
} & React.ClassAttributes<HTMLAnchorElement> & React.AnchorHTMLAttributes<HTMLAnchorElement>, "ref"> | Omit<{
|
|
29
|
+
children: React.ReactNode;
|
|
30
|
+
className?: string | undefined;
|
|
31
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
32
|
+
href?: string | undefined;
|
|
33
|
+
} & React.ClassAttributes<HTMLElement> & React.HTMLAttributes<HTMLElement>, "ref">) & React.RefAttributes<BaseAnchorType | BaseElementType>>;
|
|
34
|
+
Text: React.ForwardRefExoticComponent<(Omit<{
|
|
35
|
+
children: React.ReactNode;
|
|
36
|
+
className?: string | undefined;
|
|
37
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
38
|
+
href?: string | undefined;
|
|
39
|
+
} & React.ClassAttributes<HTMLAnchorElement> & React.AnchorHTMLAttributes<HTMLAnchorElement>, "ref"> | Omit<{
|
|
40
|
+
children: React.ReactNode;
|
|
41
|
+
className?: string | undefined;
|
|
42
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
43
|
+
href?: string | undefined;
|
|
44
|
+
} & React.ClassAttributes<HTMLElement> & React.HTMLAttributes<HTMLElement>, "ref">) & React.RefAttributes<HTMLElement>>;
|
|
45
|
+
};
|
|
46
|
+
export default _default;
|
package/dist/NavBar/index.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
const
|
|
4
|
-
const s =
|
|
5
|
-
return /* @__PURE__ */
|
|
6
|
-
}),
|
|
7
|
-
const
|
|
8
|
-
return /* @__PURE__ */
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as x, forwardRef as c, useMemo as b, useContext as C } from "react";
|
|
3
|
+
const u = x(null), d = ({ children: t, value: n }) => /* @__PURE__ */ a(u.Provider, { value: n, children: t }), N = () => C(u), m = c(({ children: t, className: n, navbarPrefix: o = "sg-navbar-", ...r }, e) => {
|
|
4
|
+
const s = b(() => o, [o]);
|
|
5
|
+
return /* @__PURE__ */ a("nav", { ref: e, className: `sg-navbar${n ? " " + n : ""}`, ...r, children: /* @__PURE__ */ a(d, { value: s, children: t }) });
|
|
6
|
+
}), p = c(({ children: t, className: n, href: o = "#", as: r = "a", ...e }, s) => {
|
|
7
|
+
const v = r || (o && r != "Link" ? "a" : "span");
|
|
8
|
+
return /* @__PURE__ */ a(v, { ref: s, href: o, className: `sg-navbar-brand${n ? " " + n : ""}`, ...e, children: t });
|
|
9
|
+
}), i = c(({ children: t, className: n, as: o = "span", ...r }, e) => /* @__PURE__ */ a(o, { ref: e, className: `sg-navbar-text${n ? " " + n : ""}`, ...r, children: t })), f = Object.assign(m, {
|
|
10
|
+
Brand: p,
|
|
11
|
+
Text: i
|
|
12
|
+
});
|
|
13
13
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
u as NavbarContext,
|
|
15
|
+
f as default,
|
|
16
|
+
N as useNavbarContext
|
|
16
17
|
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DropdownType } from "../Dropdown";
|
|
3
|
+
export type NavDropdownType = {
|
|
4
|
+
toggleProps?: any;
|
|
5
|
+
menuProps?: any;
|
|
6
|
+
} & DropdownType;
|
|
7
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<NavDropdownType, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
|
|
8
|
+
Toggle: import("react").ForwardRefExoticComponent<(Omit<{
|
|
9
|
+
children: import("react").ReactNode;
|
|
10
|
+
className?: string | undefined;
|
|
11
|
+
navDropdown?: boolean | undefined;
|
|
12
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
13
|
+
variant?: string | undefined;
|
|
14
|
+
} & import("react").ClassAttributes<HTMLAnchorElement> & import("react").AnchorHTMLAttributes<HTMLAnchorElement>, "ref"> | Omit<{
|
|
15
|
+
children: import("react").ReactNode;
|
|
16
|
+
className?: string | undefined;
|
|
17
|
+
navDropdown?: boolean | undefined;
|
|
18
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
19
|
+
variant?: string | undefined;
|
|
20
|
+
} & import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement>, "ref"> | Omit<{
|
|
21
|
+
children: import("react").ReactNode;
|
|
22
|
+
className?: string | undefined;
|
|
23
|
+
navDropdown?: boolean | undefined;
|
|
24
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
25
|
+
variant?: string | undefined;
|
|
26
|
+
} & import("react").ClassAttributes<HTMLElement> & import("react").HTMLAttributes<HTMLElement>, "ref">) & import("react").RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
27
|
+
Menu: import("react").ForwardRefExoticComponent<Omit<import("../Dropdown").DropdownMenuType, "ref"> & import("react").RefAttributes<HTMLUListElement>>;
|
|
28
|
+
Item: import("react").ForwardRefExoticComponent<(Omit<{
|
|
29
|
+
children: import("react").ReactNode;
|
|
30
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
31
|
+
className?: string | undefined;
|
|
32
|
+
} & import("react").ClassAttributes<HTMLAnchorElement> & import("react").AnchorHTMLAttributes<HTMLAnchorElement>, "ref"> | Omit<{
|
|
33
|
+
children: import("react").ReactNode;
|
|
34
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
35
|
+
className?: string | undefined;
|
|
36
|
+
} & import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement>, "ref">) & import("react").RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
37
|
+
Divider: import("react").ForwardRefExoticComponent<Omit<import("../Dropdown").DropdownDividerType, "ref"> & import("react").RefAttributes<HTMLHRElement>>;
|
|
38
|
+
};
|
|
39
|
+
export default _default;
|