stargazer-ui 1.0.4 → 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/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} +1 -54
- 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/{FloatingLabel/index.js → components/FloatingLabel/FloatingLabel.js} +1 -1
- 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} +15 -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/{Modal/index.d.ts → components/Modal/Modal.d.ts} +2 -32
- package/dist/{Modal/index.js → components/Modal/Modal.js} +13 -12
- 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/{Nav/index.d.ts → components/Nav/Nav.d.ts} +0 -16
- package/dist/{Nav/index.js → components/Nav/Nav.js} +7 -7
- 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/{NavDropdown/index.d.ts → components/NavDropdown/NavDropdown.d.ts} +3 -7
- 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/{OffCanvas → components/OffCanvas}/OffCanvas.js +2 -2
- 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/{Popout/index.d.ts → components/Popout/Popout.d.ts} +1 -35
- package/dist/{Popout/index.js → components/Popout/Popout.js} +18 -18
- 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/{Spinner/index.d.ts → components/Spinner/Spinner.d.ts} +1 -7
- 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.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/{Tabs/index.js → components/Tabs/Tabs.js} +14 -14
- package/dist/{Tabs/index.d.ts → components/Tabs/Tabs.types.d.ts} +2 -9
- 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 +15 -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.d.ts +0 -11
- package/dist/Form/index.d.ts +0 -65
- package/dist/Grid/Col.js +0 -19
- package/dist/Grid/Container.js +0 -9
- package/dist/Grid/Row.js +0 -17
- package/dist/InputGroup/index.d.ts +0 -14
- package/dist/InputGroup/index.js +0 -8
- package/dist/NavBar/index.d.ts +0 -46
- package/dist/NavBar/index.js +0 -17
- package/dist/NavDropdown/index.js +0 -858
- package/dist/Table/index.d.ts +0 -9
- package/dist/ToggleButton/index.js +0 -11
- package/dist/main.js +0 -30
- package/dist/stylesheets/stargazerui.css +0 -4902
- package/dist/stylesheets/stargazerui.css.map +0 -1
- /package/dist/{Button/index.js → components/Button/Button.js} +0 -0
- /package/dist/{CloseButton/index.js → components/CloseButton/CloseButton.js} +0 -0
- /package/dist/{Dropdown/index.js → components/Dropdown/Dropdown.js} +0 -0
- /package/dist/{Overlay/index.js → components/Overlay/Overlay.js} +0 -0
- /package/dist/{Spinner/index.js → components/Spinner/Spinner.js} +0 -0
- /package/dist/{Table/index.js → components/Table/Table.js} +0 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FormCheckType, FormContextType, FormControlType, FormGroupType, FormLabelType, FormSelectType, FormTextType, FormType } from "./Form.types";
|
|
3
|
+
export declare const FormContext: React.Context<FormContextType | null>;
|
|
4
|
+
export declare const FormContextProvider: ({ children, value }: {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
value: FormContextType;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const useFormContext: () => FormContextType;
|
|
9
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<FormType, "ref"> & React.RefAttributes<HTMLFormElement>> & {
|
|
10
|
+
Control: React.ForwardRefExoticComponent<Omit<FormControlType, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
11
|
+
Select: React.ForwardRefExoticComponent<Omit<FormSelectType, "ref"> & React.RefAttributes<HTMLSelectElement>>;
|
|
12
|
+
Group: React.ForwardRefExoticComponent<Omit<FormGroupType, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
Label: React.ForwardRefExoticComponent<Omit<FormLabelType, "ref"> & React.RefAttributes<HTMLLabelElement>>;
|
|
14
|
+
Check: React.ForwardRefExoticComponent<Omit<FormCheckType, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
15
|
+
Text: React.ForwardRefExoticComponent<Omit<FormTextType, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
1
|
+
import { jsx as n, jsxs as C, Fragment as k } from "react/jsx-runtime";
|
|
2
2
|
import { createContext as b, forwardRef as l, useMemo as j, useContext as I } from "react";
|
|
3
3
|
const w = b(null), H = ({ children: e, value: t }) => /* @__PURE__ */ n(w.Provider, { value: t, children: e }), g = () => {
|
|
4
4
|
const e = I(w);
|
|
@@ -7,11 +7,11 @@ const w = b(null), H = ({ children: e, value: t }) => /* @__PURE__ */ n(w.Provid
|
|
|
7
7
|
"useFormContext has to be used within a FormContextProvider!"
|
|
8
8
|
);
|
|
9
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 },
|
|
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
11
|
let i = e;
|
|
12
|
-
const { controlId:
|
|
13
|
-
let x =
|
|
14
|
-
return /* @__PURE__ */ n(i, { autoFocus: s, ref:
|
|
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
15
|
}), E = l(({ children: e, className: t, id: o, ...c }, r) => {
|
|
16
16
|
const { controlId: s } = g();
|
|
17
17
|
let m = s || o;
|
|
@@ -30,22 +30,22 @@ const w = b(null), H = ({ children: e, value: t }) => /* @__PURE__ */ n(w.Provid
|
|
|
30
30
|
classNameLabel: r,
|
|
31
31
|
labelRef: s,
|
|
32
32
|
label: m,
|
|
33
|
-
labelId:
|
|
33
|
+
labelId: d,
|
|
34
34
|
className: i,
|
|
35
|
-
type:
|
|
35
|
+
type: u,
|
|
36
36
|
id: x,
|
|
37
37
|
controlId: f,
|
|
38
38
|
reverse: p = !1,
|
|
39
39
|
checkStyle: v,
|
|
40
40
|
...a
|
|
41
|
-
},
|
|
42
|
-
let h = f || x,
|
|
43
|
-
return /* @__PURE__ */ n("div", { ref: t, id: o, style: c, className: `sg-form-check${p ? "-reverse" : ""}${e ? " " + e : ""}${
|
|
44
|
-
/* @__PURE__ */ n("input", { ref:
|
|
45
|
-
/* @__PURE__ */ n("label", { ref: s, id:
|
|
46
|
-
] }) : /* @__PURE__ */
|
|
47
|
-
/* @__PURE__ */ n("label", { ref: s, id:
|
|
48
|
-
/* @__PURE__ */ n("input", { ref:
|
|
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
49
|
] }) });
|
|
50
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
51
|
Control: y,
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { BaseDivType, BaseFormType, BaseInputType, BaseLabelType, BaseSelectType, BaseSmallType } from "../../BaseTypes";
|
|
3
|
+
export type FormContextType = {
|
|
4
|
+
controlId: string;
|
|
5
|
+
};
|
|
6
|
+
export type FormType = {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
} & BaseFormType;
|
|
9
|
+
export type FormControlType = {
|
|
10
|
+
as?: React.ElementType;
|
|
11
|
+
className?: string;
|
|
12
|
+
plaintext?: boolean;
|
|
13
|
+
id?: string;
|
|
14
|
+
type?: string;
|
|
15
|
+
autoFocus?: boolean;
|
|
16
|
+
} & BaseInputType;
|
|
17
|
+
export type FormSelectType = {
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
className?: string;
|
|
20
|
+
id?: string;
|
|
21
|
+
} & BaseSelectType;
|
|
22
|
+
export type FormGroupType = {
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
className?: string;
|
|
25
|
+
controlId: string;
|
|
26
|
+
} & BaseDivType;
|
|
27
|
+
export type FormLabelType = {
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
className?: string;
|
|
30
|
+
htmlFor?: string;
|
|
31
|
+
} & BaseLabelType;
|
|
32
|
+
export type FormCheckType = {
|
|
33
|
+
classNameContainer?: string;
|
|
34
|
+
containerRef?: React.LegacyRef<HTMLDivElement>;
|
|
35
|
+
containerId?: string;
|
|
36
|
+
style?: React.CSSProperties;
|
|
37
|
+
classNameLabel?: string;
|
|
38
|
+
labelRef?: React.LegacyRef<HTMLLabelElement>;
|
|
39
|
+
label?: string;
|
|
40
|
+
labelId?: string;
|
|
41
|
+
className?: string;
|
|
42
|
+
type?: string;
|
|
43
|
+
controlId?: string;
|
|
44
|
+
reverse?: boolean;
|
|
45
|
+
checkStyle?: React.CSSProperties;
|
|
46
|
+
} & BaseInputType;
|
|
47
|
+
export type FormTextType = {
|
|
48
|
+
children: ReactNode;
|
|
49
|
+
className?: string;
|
|
50
|
+
} & BaseSmallType;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Form";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
declare const _default: import("react").ForwardRefExoticComponent<import("react").RefAttributes<any>> & {
|
|
2
|
+
Col: import("react").ForwardRefExoticComponent<import("react").RefAttributes<any>>;
|
|
3
|
+
Row: import("react").ForwardRefExoticComponent<import("react").RefAttributes<any>>;
|
|
4
|
+
};
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as C } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as h } from "react";
|
|
3
|
+
const j = h(({ children: i, className: u, fluid: s, ...l }, $) => {
|
|
4
|
+
let c = "sg-container", d = typeof s == "string" ? `-${s}` : "-fluid";
|
|
5
|
+
return /* @__PURE__ */ C("div", { ref: $, className: `${s ? c + d : c} ${u}`, ...l, children: i });
|
|
6
|
+
}), w = h(({ children: i, as: u = "div", className: s = "", ...l }, $) => {
|
|
7
|
+
const c = u, d = ["xxl", "xl", "lg", "md", "sm", "xs"], x = "xs";
|
|
8
|
+
let f = "", e = "", t = [];
|
|
9
|
+
d.forEach((a) => {
|
|
10
|
+
const g = l[a];
|
|
11
|
+
delete l[a];
|
|
12
|
+
let n, m, p;
|
|
13
|
+
typeof g == "object" && g != null ? { span: n, offset: m, order: p } = g : n = g;
|
|
14
|
+
const r = a !== x ? `-${a}` : "";
|
|
15
|
+
n && (e += n === !0 ? ` sg-col${r}` : ` sg-col${r}-${n}`, t.push(n === !0 ? ` sg-col${r}` : ` sg-col${r}-${n}`)), p != null && (f += ` order${r}-${p}`), m != null && (f += ` offset${r}-${m}`);
|
|
16
|
+
});
|
|
17
|
+
let o = s + f + e;
|
|
18
|
+
return o += t.length ? "" : " sg-col", /* @__PURE__ */ C(c, { ref: $, className: o, ...l, children: i });
|
|
19
|
+
}), y = h(({ children: i, className: u = "", as: s = "div", ...l }, $) => {
|
|
20
|
+
const c = s, d = ["xxl", "xl", "lg", "md", "sm", "xs"], x = "xs";
|
|
21
|
+
let f = "";
|
|
22
|
+
return d.forEach((e) => {
|
|
23
|
+
const t = l[e];
|
|
24
|
+
delete l[e];
|
|
25
|
+
let o;
|
|
26
|
+
t != null && typeof t == "object" ? { cols: o } = t : o = t;
|
|
27
|
+
const a = e !== x ? `-${e}` : "";
|
|
28
|
+
o != null && (f += ` sg-row-cols${a}-${o}`);
|
|
29
|
+
}), /* @__PURE__ */ C(c, { ref: $, className: `sg-row ${u}${f}`, ...l, children: i });
|
|
30
|
+
}), N = Object.assign(j, {
|
|
31
|
+
Col: w,
|
|
32
|
+
Row: y
|
|
33
|
+
});
|
|
34
|
+
export {
|
|
35
|
+
N as default
|
|
36
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Grid";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { InputGroupText, InputGroupType } from "./InputGroup.types";
|
|
3
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<InputGroupType, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
|
|
4
|
+
Text: import("react").ForwardRefExoticComponent<InputGroupText & import("react").RefAttributes<HTMLSpanElement>>;
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { BaseDivType } from "../../BaseTypes";
|
|
3
|
+
export type InputGroupType = {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
} & BaseDivType;
|
|
7
|
+
export type InputGroupText = {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./InputGroup";
|
|
@@ -1,36 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
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;
|
|
2
|
+
import { ModalBodyType, ModalType } from "./Modal.types";
|
|
34
3
|
declare const _default: (({ children, centered, size, show, backdrop, onHide, className, id, ...restProps }: ModalType) => React.ReactPortal) & {
|
|
35
4
|
Header: React.ForwardRefExoticComponent<(Omit<{
|
|
36
5
|
children: React.ReactNode;
|
|
@@ -68,3 +37,4 @@ declare const _default: (({ children, centered, size, show, backdrop, onHide, cl
|
|
|
68
37
|
Footer: React.ForwardRefExoticComponent<Omit<ModalBodyType, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
69
38
|
};
|
|
70
39
|
export default _default;
|
|
40
|
+
export declare const useKeepElementFocused: (elementRef: React.RefObject<HTMLDialogElement>) => void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
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
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
const g = D(null),
|
|
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
7
|
const e = P(g);
|
|
8
8
|
if (!e)
|
|
9
9
|
throw new Error(
|
|
@@ -21,11 +21,11 @@ const g = D(null), $ = ({ children: e, value: t }) => /* @__PURE__ */ s(g.Provid
|
|
|
21
21
|
id: i,
|
|
22
22
|
...m
|
|
23
23
|
}) => {
|
|
24
|
-
const [h, f] =
|
|
24
|
+
const [h, f] = $(o);
|
|
25
25
|
w(() => {
|
|
26
26
|
f(o);
|
|
27
27
|
}, [o]);
|
|
28
|
-
const r =
|
|
28
|
+
const r = B(null);
|
|
29
29
|
H(r);
|
|
30
30
|
let u = typeof o == "boolean" && typeof a == "function" ? void 0 : { show: typeof o == "boolean", onHide: typeof a == "function" };
|
|
31
31
|
u && console.error(
|
|
@@ -50,8 +50,8 @@ const g = D(null), $ = ({ children: e, value: t }) => /* @__PURE__ */ s(g.Provid
|
|
|
50
50
|
y();
|
|
51
51
|
}, { once: !0 });
|
|
52
52
|
};
|
|
53
|
-
return
|
|
54
|
-
/* @__PURE__ */ s("dialog", { ref: r, className: v, onKeyDown: (c) => k(c), ...m, children: /* @__PURE__ */ s(
|
|
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
55
|
document.body
|
|
56
56
|
);
|
|
57
57
|
}, x = b(({ children: e, as: t = "", className: n = "", closeButton: o = !1, onClick: l, ...a }, d) => {
|
|
@@ -61,7 +61,7 @@ const g = D(null), $ = ({ children: e, value: t }) => /* @__PURE__ */ s(g.Provid
|
|
|
61
61
|
};
|
|
62
62
|
return /* @__PURE__ */ p(m, { ref: d, className: `sg-modal-header ${n}`, ...a, children: [
|
|
63
63
|
e,
|
|
64
|
-
o ? /* @__PURE__ */ s(
|
|
64
|
+
o ? /* @__PURE__ */ s(K, { variant: !0, onClick: (r) => f(r) }) : null
|
|
65
65
|
] });
|
|
66
66
|
}), E = b(({ children: e, as: t = "h4", className: n, ...o }, l) => {
|
|
67
67
|
let d = ["div", "span", "h1", "h2", "h3", "h4", "h5", "h6"].find((i) => i === t) ? t : "h4";
|
|
@@ -92,8 +92,9 @@ const g = D(null), $ = ({ children: e, value: t }) => /* @__PURE__ */ s(g.Provid
|
|
|
92
92
|
e.show ? null : "The variable 'show' must be used and must be a boolean used to decide when to show the modal!",
|
|
93
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
94
|
] }) }),
|
|
95
|
-
/* @__PURE__ */ s(T, { children: /* @__PURE__ */ s(
|
|
95
|
+
/* @__PURE__ */ s(T, { children: /* @__PURE__ */ s(L, { variant: "danger", type: "button", onClick: () => t(), children: "Close" }) })
|
|
96
96
|
] });
|
|
97
97
|
export {
|
|
98
|
-
Q as default
|
|
98
|
+
Q as default,
|
|
99
|
+
H as useKeepElementFocused
|
|
99
100
|
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { BaseDialogType, BaseDivType, BaseHeadingType, BaseSpanType } from "../../BaseTypes";
|
|
3
|
+
export type ModalContextType = Function | null;
|
|
4
|
+
export type ModalType = {
|
|
5
|
+
children: 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: 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: ReactNode;
|
|
23
|
+
as?: React.ElementType;
|
|
24
|
+
className?: string;
|
|
25
|
+
} & (BaseDivType | BaseHeadingType | BaseSpanType);
|
|
26
|
+
export type ModalBodyType = {
|
|
27
|
+
children: ReactNode;
|
|
28
|
+
className?: string;
|
|
29
|
+
} & BaseDivType;
|
|
30
|
+
export type ModalFooterType = {
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
className?: string;
|
|
33
|
+
} & BaseDivType;
|
|
34
|
+
export type ErrorModalType = {
|
|
35
|
+
typeCheck: {
|
|
36
|
+
show: boolean;
|
|
37
|
+
onHide: boolean;
|
|
38
|
+
};
|
|
39
|
+
closeModal: Function;
|
|
40
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Modal";
|
|
@@ -1,20 +1,4 @@
|
|
|
1
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
2
|
declare const _default: React.ForwardRefExoticComponent<(Omit<{
|
|
19
3
|
children: React.ReactNode;
|
|
20
4
|
className?: string | undefined;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as m } from "react";
|
|
3
|
-
import { useNavbarContext as
|
|
4
|
-
const
|
|
5
|
-
const a = t,
|
|
6
|
-
return /* @__PURE__ */ s(a, { ref: r, className: `${n} ${
|
|
7
|
-
}),
|
|
8
|
-
Item:
|
|
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
9
|
Link: f
|
|
10
10
|
});
|
|
11
11
|
export {
|
|
12
|
-
|
|
12
|
+
x as default
|
|
13
13
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { BaseAnchorType, BaseElementType, BaseLItemType, BaseUListType } from "../../BaseTypes";
|
|
3
|
+
export type NavType = {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
as?: React.ElementType;
|
|
7
|
+
} & (BaseUListType | BaseElementType);
|
|
8
|
+
export type NavItemType = {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
as?: React.ElementType;
|
|
12
|
+
} & (BaseLItemType | BaseElementType);
|
|
13
|
+
export type NavLinkType = {
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
className?: string;
|
|
16
|
+
as?: React.ElementType;
|
|
17
|
+
} & (BaseAnchorType | BaseElementType);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Nav";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { NavbarTextType, NavbarType } from "./Navbar.types";
|
|
3
|
+
export type NavbarContextType = string | null;
|
|
4
|
+
export declare const NavbarContext: React.Context<NavbarContextType>;
|
|
5
|
+
export declare const useNavbarContext: () => NavbarContextType;
|
|
6
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<NavbarType, "ref"> & React.RefAttributes<HTMLElement>> & {
|
|
7
|
+
Brand: React.ForwardRefExoticComponent<(Omit<{
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
className?: string | undefined;
|
|
10
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
11
|
+
href?: string | undefined;
|
|
12
|
+
} & React.ClassAttributes<HTMLAnchorElement> & React.AnchorHTMLAttributes<HTMLAnchorElement>, "ref"> | Omit<{
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
className?: string | undefined;
|
|
15
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
16
|
+
href?: string | undefined;
|
|
17
|
+
} & React.ClassAttributes<HTMLElement> & React.HTMLAttributes<HTMLElement>, "ref">) & React.RefAttributes<HTMLAnchorElement | HTMLElement>>;
|
|
18
|
+
Text: React.ForwardRefExoticComponent<Omit<NavbarTextType, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { BaseAnchorType, BaseElementType, BaseNavType } from "../../BaseTypes";
|
|
3
|
+
export type NavbarType = {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
navbarPrefix?: string;
|
|
7
|
+
} & BaseNavType;
|
|
8
|
+
export type NavbarBrandType = {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
as?: React.ElementType;
|
|
12
|
+
href?: string;
|
|
13
|
+
} & (BaseAnchorType | BaseElementType);
|
|
14
|
+
export type NavbarTextType = {
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
className?: string;
|
|
17
|
+
as?: React.ElementType;
|
|
18
|
+
} & BaseElementType;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Navbar";
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
export type NavDropdownType = {
|
|
4
|
-
toggleProps?: any;
|
|
5
|
-
menuProps?: any;
|
|
6
|
-
} & DropdownType;
|
|
2
|
+
import { NavDropdownType } from "./NavDropdown.types";
|
|
7
3
|
declare const _default: import("react").ForwardRefExoticComponent<Omit<NavDropdownType, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
|
|
8
4
|
Toggle: import("react").ForwardRefExoticComponent<(Omit<{
|
|
9
5
|
children: import("react").ReactNode;
|
|
@@ -24,7 +20,7 @@ declare const _default: import("react").ForwardRefExoticComponent<Omit<NavDropdo
|
|
|
24
20
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
25
21
|
variant?: string | undefined;
|
|
26
22
|
} & 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>>;
|
|
23
|
+
Menu: import("react").ForwardRefExoticComponent<Omit<import("../Dropdown/Dropdown.types").DropdownMenuType, "ref"> & import("react").RefAttributes<HTMLUListElement>>;
|
|
28
24
|
Item: import("react").ForwardRefExoticComponent<(Omit<{
|
|
29
25
|
children: import("react").ReactNode;
|
|
30
26
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
@@ -34,6 +30,6 @@ declare const _default: import("react").ForwardRefExoticComponent<Omit<NavDropdo
|
|
|
34
30
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
35
31
|
className?: string | undefined;
|
|
36
32
|
} & 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>>;
|
|
33
|
+
Divider: import("react").ForwardRefExoticComponent<Omit<import("../Dropdown/Dropdown.types").DropdownDividerType, "ref"> & import("react").RefAttributes<HTMLHRElement>>;
|
|
38
34
|
};
|
|
39
35
|
export default _default;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx as f, jsxs as P } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as N, useState as h, useCallback as O, useMemo as $ } from "react";
|
|
3
|
+
import d, { DropdownContextProvider as k } from "../Dropdown/Dropdown.js";
|
|
4
|
+
const A = (o, n, e = !1) => {
|
|
5
|
+
const r = e ? "top-end" : "top-start", s = e ? "top-start" : "top-end", c = e ? "bottom-end" : "bottom-start", l = e ? "bottom-start" : "bottom-end", u = e ? "right-start" : "left-start", a = e ? "right-end" : "left-end", p = e ? "left-start" : "right-start", m = e ? "left-end" : "right-end";
|
|
6
|
+
let t = o ? l : c;
|
|
7
|
+
return n === "up" ? t = o ? s : r : n === "end" ? t = o ? m : p : n === "start" ? t = o ? a : u : n === "down-centered" ? t = "bottom" : n === "up-centered" && (t = "top"), t;
|
|
8
|
+
}, V = N(({
|
|
9
|
+
children: o,
|
|
10
|
+
className: n,
|
|
11
|
+
onSelect: e,
|
|
12
|
+
onToggle: r,
|
|
13
|
+
controlId: s,
|
|
14
|
+
toggleProps: c,
|
|
15
|
+
title: l,
|
|
16
|
+
menuProps: u,
|
|
17
|
+
drop: a = "down",
|
|
18
|
+
align: p = "start",
|
|
19
|
+
autoClose: m = !0,
|
|
20
|
+
show: t = "default",
|
|
21
|
+
...S
|
|
22
|
+
}, D) => {
|
|
23
|
+
const [w, x] = h(t === "default" ? !1 : t), [i, g] = h({ case: "" }), v = O((j) => {
|
|
24
|
+
j.stopPropagation(), x((E) => !E);
|
|
25
|
+
}, []), b = A(p === "end", a), C = {
|
|
26
|
+
down: "dropdown",
|
|
27
|
+
"down-centered": "dropdown-center",
|
|
28
|
+
up: "dropup",
|
|
29
|
+
"up-centered": "dropup-center dropup",
|
|
30
|
+
end: "dropend",
|
|
31
|
+
start: "dropstart"
|
|
32
|
+
}, I = s, M = $(() => ({
|
|
33
|
+
align: p,
|
|
34
|
+
drop: a,
|
|
35
|
+
showInternal: t != "default" && r ? t : w,
|
|
36
|
+
handleToggle: t != "default" && r ? r : v,
|
|
37
|
+
placement: b,
|
|
38
|
+
directionClasses: {
|
|
39
|
+
down: "dropdown",
|
|
40
|
+
"down-centered": "dropdown-center",
|
|
41
|
+
up: "dropup",
|
|
42
|
+
"up-centered": "dropup-center dropup",
|
|
43
|
+
end: "dropend",
|
|
44
|
+
start: "dropstart"
|
|
45
|
+
},
|
|
46
|
+
controlId: I,
|
|
47
|
+
activeDescendant: i,
|
|
48
|
+
setActiveDescendant: g
|
|
49
|
+
}), [p, a, t, w, r, v, b, C, s, i, g]);
|
|
50
|
+
return /* @__PURE__ */ f("div", { ref: D, id: s + "-wrapper", className: `sg-dropdown${n ? " " + n : ""} sg-nav-item`, ...S, children: /* @__PURE__ */ P(k, { value: M, children: [
|
|
51
|
+
/* @__PURE__ */ f(d.Toggle, { navDropdown: !0, ...c, children: l }),
|
|
52
|
+
/* @__PURE__ */ f(d.Menu, { ...u, children: o })
|
|
53
|
+
] }) });
|
|
54
|
+
}), F = Object.assign(V, {
|
|
55
|
+
Toggle: d.Toggle,
|
|
56
|
+
Menu: d.Menu,
|
|
57
|
+
Item: d.Item,
|
|
58
|
+
Divider: d.Divider
|
|
59
|
+
});
|
|
60
|
+
export {
|
|
61
|
+
F as default
|
|
62
|
+
};
|