stargazer-ui 1.0.8 → 1.0.9

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