stargazer-ui 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/dist/BaseTypes.d.ts +4 -0
  2. package/dist/cjs/index.js +2 -0
  3. package/dist/cjs/index.js.map +1 -0
  4. package/dist/components/Button/Button.d.ts +4 -0
  5. package/dist/components/Button/Button.types.d.ts +7 -0
  6. package/dist/components/Button/Button.types.js +1 -0
  7. package/dist/components/Button/index.d.ts +1 -0
  8. package/dist/components/Button/index.js +4 -0
  9. package/dist/components/Card/Card.d.ts +34 -0
  10. package/dist/components/Card/Card.js +18 -0
  11. package/dist/components/Card/Card.types.d.ts +24 -0
  12. package/dist/components/Card/Card.types.js +1 -0
  13. package/dist/components/Card/index.d.ts +1 -0
  14. package/dist/components/Card/index.js +4 -0
  15. package/dist/{CloseButton/index.d.ts → components/CloseButton/CloseButton.d.ts} +1 -5
  16. package/dist/components/CloseButton/CloseButton.types.d.ts +5 -0
  17. package/dist/components/CloseButton/CloseButton.types.js +1 -0
  18. package/dist/components/CloseButton/index.d.ts +1 -0
  19. package/dist/components/CloseButton/index.js +4 -0
  20. package/dist/{Dropdown/index.d.ts → components/Dropdown/Dropdown.d.ts} +18 -55
  21. package/dist/{Dropdown/index.js → components/Dropdown/Dropdown.js} +31 -30
  22. package/dist/components/Dropdown/Dropdown.types.d.ts +55 -0
  23. package/dist/components/Dropdown/Dropdown.types.js +1 -0
  24. package/dist/components/Dropdown/index.d.ts +1 -0
  25. package/dist/components/Dropdown/index.js +4 -0
  26. package/dist/components/FloatingLabel/FloatingLabel.d.ts +4 -0
  27. package/dist/components/FloatingLabel/FloatingLabel.js +13 -0
  28. package/dist/components/FloatingLabel/FloatingLabel.types.d.ts +9 -0
  29. package/dist/components/FloatingLabel/FloatingLabel.types.js +1 -0
  30. package/dist/components/FloatingLabel/index.d.ts +1 -0
  31. package/dist/components/FloatingLabel/index.js +4 -0
  32. package/dist/components/Form/Form.d.ts +17 -0
  33. package/dist/{Form/index.js → components/Form/Form.js} +16 -15
  34. package/dist/components/Form/Form.types.d.ts +50 -0
  35. package/dist/components/Form/Form.types.js +1 -0
  36. package/dist/components/Form/index.d.ts +1 -0
  37. package/dist/components/Form/index.js +4 -0
  38. package/dist/components/Grid/Grid.d.ts +5 -0
  39. package/dist/components/Grid/Grid.js +36 -0
  40. package/dist/components/Grid/index.d.ts +1 -0
  41. package/dist/components/Grid/index.js +4 -0
  42. package/dist/components/InputGroup/InputGroup.d.ts +6 -0
  43. package/dist/components/InputGroup/InputGroup.js +8 -0
  44. package/dist/components/InputGroup/InputGroup.types.d.ts +10 -0
  45. package/dist/components/InputGroup/InputGroup.types.js +1 -0
  46. package/dist/components/InputGroup/index.d.ts +1 -0
  47. package/dist/components/InputGroup/index.js +4 -0
  48. package/dist/components/Modal/Modal.d.ts +40 -0
  49. package/dist/components/Modal/Modal.js +100 -0
  50. package/dist/components/Modal/Modal.types.d.ts +40 -0
  51. package/dist/components/Modal/Modal.types.js +1 -0
  52. package/dist/components/Modal/index.d.ts +1 -0
  53. package/dist/components/Modal/index.js +4 -0
  54. package/dist/components/Nav/Nav.d.ts +30 -0
  55. package/dist/components/Nav/Nav.js +13 -0
  56. package/dist/components/Nav/Nav.types.d.ts +17 -0
  57. package/dist/components/Nav/Nav.types.js +1 -0
  58. package/dist/components/Nav/index.d.ts +1 -0
  59. package/dist/components/Nav/index.js +4 -0
  60. package/dist/components/NavBar/Navbar.d.ts +20 -0
  61. package/dist/components/NavBar/Navbar.js +17 -0
  62. package/dist/components/NavBar/Navbar.types.d.ts +18 -0
  63. package/dist/components/NavBar/Navbar.types.js +1 -0
  64. package/dist/components/NavBar/index.d.ts +1 -0
  65. package/dist/components/NavBar/index.js +4 -0
  66. package/dist/components/NavDropdown/NavDropdown.d.ts +35 -0
  67. package/dist/components/NavDropdown/NavDropdown.js +62 -0
  68. package/dist/components/NavDropdown/NavDropdown.types.d.ts +5 -0
  69. package/dist/components/NavDropdown/NavDropdown.types.js +1 -0
  70. package/dist/components/NavDropdown/index.d.ts +1 -0
  71. package/dist/components/NavDropdown/index.js +4 -0
  72. package/dist/components/OffCanvas/OffCanvas.d.ts +3 -0
  73. package/dist/components/OffCanvas/OffCanvas.js +2266 -0
  74. package/dist/components/OffCanvas/index.d.ts +1 -0
  75. package/dist/components/OffCanvas/index.js +4 -0
  76. package/dist/components/Overlay/Overlay.d.ts +3 -0
  77. package/dist/components/Overlay/index.d.ts +1 -0
  78. package/dist/components/Overlay/index.js +4 -0
  79. package/dist/components/Popout/Popout.d.ts +22 -0
  80. package/dist/components/Popout/Popout.js +72 -0
  81. package/dist/components/Popout/Popout.types.d.ts +36 -0
  82. package/dist/components/Popout/Popout.types.js +1 -0
  83. package/dist/components/Popout/index.d.ts +1 -0
  84. package/dist/components/Popout/index.js +4 -0
  85. package/dist/components/Spinner/Spinner.d.ts +4 -0
  86. package/dist/components/Spinner/Spinner.js +9 -0
  87. package/dist/components/Spinner/Spinner.types.d.ts +7 -0
  88. package/dist/components/Spinner/Spinner.types.js +1 -0
  89. package/dist/components/Spinner/index.d.ts +1 -0
  90. package/dist/components/Spinner/index.js +4 -0
  91. package/dist/components/Table/Table.d.ts +4 -0
  92. package/dist/components/Table/Table.js +9 -0
  93. package/dist/components/Table/Table.types.d.ts +7 -0
  94. package/dist/components/Table/Table.types.js +1 -0
  95. package/dist/components/Table/index.d.ts +1 -0
  96. package/dist/components/Table/index.js +4 -0
  97. package/dist/components/Tabs/Tabs.d.ts +9 -0
  98. package/dist/components/Tabs/Tabs.js +77 -0
  99. package/dist/components/Tabs/Tabs.types.d.ts +35 -0
  100. package/dist/components/Tabs/Tabs.types.js +1 -0
  101. package/dist/components/Tabs/index.d.ts +1 -0
  102. package/dist/components/Tabs/index.js +4 -0
  103. package/dist/components/ToggleButton/ToggleButton.d.ts +9 -0
  104. package/dist/components/ToggleButton/ToggleButton.js +11 -0
  105. package/dist/components/ToggleButton/ToggleButton.types.d.ts +0 -0
  106. package/dist/components/ToggleButton/ToggleButton.types.js +1 -0
  107. package/dist/components/ToggleButton/index.d.ts +1 -0
  108. package/dist/components/ToggleButton/index.js +4 -0
  109. package/dist/components/index.d.ts +19 -0
  110. package/dist/components/index.js +19 -0
  111. package/dist/esm/index.js +2 -0
  112. package/dist/esm/index.js.map +1 -0
  113. package/dist/index.d.ts +1 -0
  114. package/dist/index.js +19 -0
  115. package/dist/types.d.ts +2 -0
  116. package/package.json +18 -4
  117. package/dist/Button/index.d.ts +0 -9
  118. package/dist/Card/index.d.ts +0 -92
  119. package/dist/Card/index.js +0 -18
  120. package/dist/FloatingLabel/index.js +0 -13
  121. package/dist/Form/index.d.ts +0 -61
  122. package/dist/InputGroup/index.js +0 -7
  123. package/dist/Modal/index.js +0 -85
  124. package/dist/Nav/index.js +0 -14
  125. package/dist/NavBar/index.js +0 -16
  126. package/dist/NavDropdown/index.js +0 -850
  127. package/dist/Popout/index.js +0 -85
  128. package/dist/Tabs/index.js +0 -69
  129. package/dist/ToggleButton/index.js +0 -11
  130. package/dist/main.js +0 -30
  131. package/dist/stylesheets/stargazerui.css +0 -3759
  132. package/dist/stylesheets/stargazerui.css.map +0 -1
  133. /package/dist/{Button/index.js → components/Button/Button.js} +0 -0
  134. /package/dist/{CloseButton/index.js → components/CloseButton/CloseButton.js} +0 -0
  135. /package/dist/{Overlay/index.js → components/Overlay/Overlay.js} +0 -0
@@ -1,9 +1,9 @@
1
1
  import { jsx as v } from "react/jsx-runtime";
2
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
3
  const L = (d, o, r = !1) => {
4
- const u = r ? "top-end" : "top-start", m = r ? "top-start" : "top-end", i = r ? "bottom-end" : "bottom-start", h = r ? "bottom-start" : "bottom-end", g = r ? "right-start" : "left-start", a = r ? "right-end" : "left-end", w = r ? "left-start" : "right-start", l = r ? "left-end" : "right-end";
4
+ const u = r ? "top-end" : "top-start", m = 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", l = r ? "left-end" : "right-end";
5
5
  let n = d ? h : i;
6
- return o === "up" ? n = d ? m : u : o === "end" ? n = d ? l : w : o === "start" ? n = d ? a : g : o === "down-centered" ? n = "bottom" : o === "up-centered" && (n = "top"), n;
6
+ return o === "up" ? n = d ? m : u : o === "end" ? n = d ? l : w : o === "start" ? n = d ? c : g : o === "down-centered" ? n = "bottom" : o === "up-centered" && (n = "top"), n;
7
7
  }, k = (d, o = "") => {
8
8
  let r = d.target, u = !0, m = !1;
9
9
  for (; u; )
@@ -25,16 +25,16 @@ const L = (d, o, r = !1) => {
25
25
  drop: i = "down",
26
26
  align: h = "start",
27
27
  autoClose: g = !0,
28
- show: a = "default",
28
+ show: c = "default",
29
29
  ...w
30
30
  }, l) => {
31
- const [n, e] = y(a && !1), [f, b] = y({ case: "" }), c = (B) => {
31
+ const [n, e] = y(c === "default" ? !1 : c), [f, b] = y({ case: "" }), a = (B) => {
32
32
  B.stopPropagation(), e((S) => !S);
33
33
  }, s = L(h === "end", i), p = $(() => ({
34
34
  align: h,
35
35
  drop: i,
36
- showInternal: a != "default" && u ? a : n,
37
- handleToggle: a != "default" && u ? u : c,
36
+ showInternal: c != "default" && u ? c : n,
37
+ handleToggle: c != "default" && u ? u : a,
38
38
  placement: s,
39
39
  directionClasses: {
40
40
  down: "dropdown",
@@ -47,17 +47,17 @@ const L = (d, o, r = !1) => {
47
47
  controlId: m,
48
48
  activeDescendant: f,
49
49
  setActiveDescendant: b
50
- }), [h, i, a, n, u, s, m, f, b]);
50
+ }), [h, i, c, n, u, s, m, f, b]);
51
51
  return /* @__PURE__ */ v("div", { id: m + "-wrapper", ref: l, className: `sg-dropdown${o ? " " + o : ""}`, ...w, children: /* @__PURE__ */ v(M, { value: p, children: d }) });
52
52
  }), q = E(({ children: d, className: o, navDropdown: r = !1, as: u = "button", variant: m = "primary", ...i }, h) => {
53
- const { controlId: g, handleToggle: a, setActiveDescendant: w, showInternal: l } = x(), n = u, e = (t) => {
53
+ const { controlId: g, handleToggle: c, setActiveDescendant: w, showInternal: l } = x(), n = u, e = (t) => {
54
54
  let s = !1;
55
55
  switch (console.log(t.key), t.key) {
56
56
  case "ArrowDown":
57
- s = !0, l ? w((p) => ({ ...p, case: "next" })) : (a(t), w((p) => ({ ...p, case: "first" })));
57
+ s = !0, l ? w((p) => ({ ...p, case: "next" })) : (c(t), w((p) => ({ ...p, case: "first" })));
58
58
  break;
59
59
  case "ArrowUp":
60
- s = !0, l ? w((p) => ({ ...p, case: "previous" })) : (a(t), w((p) => ({ ...p, case: "last" })));
60
+ s = !0, l ? w((p) => ({ ...p, case: "previous" })) : (c(t), w((p) => ({ ...p, case: "last" })));
61
61
  break;
62
62
  case "Home":
63
63
  s = !0, l && w((p) => ({ ...p, case: "first" }));
@@ -66,15 +66,15 @@ const L = (d, o, r = !1) => {
66
66
  s = !0, l && w((p) => ({ ...p, case: "last" }));
67
67
  break;
68
68
  case "Tab":
69
- l && a(t);
69
+ l && c(t);
70
70
  break;
71
71
  case "Escape":
72
- s = !0, l && a(t);
72
+ s = !0, l && c(t);
73
73
  break;
74
74
  case "Enter":
75
75
  case " ":
76
76
  if (l) {
77
- s = !0, document.querySelector(".sg-dropdown-item-visual-focus").click(), a(t);
77
+ s = !0, document.querySelector(".sg-dropdown-item-visual-focus").click(), c(t);
78
78
  break;
79
79
  } else {
80
80
  w((p) => ({ ...p, case: "first" }));
@@ -85,9 +85,9 @@ const L = (d, o, r = !1) => {
85
85
  }, f = (t) => {
86
86
  if (l && t.target.id !== g) {
87
87
  if (!k(t, g))
88
- a(t);
88
+ c(t);
89
89
  else if (k(t, g)) {
90
- a(t);
90
+ c(t);
91
91
  const s = document.getElementById(g);
92
92
  s == null || s.focus();
93
93
  }
@@ -100,10 +100,10 @@ const L = (d, o, r = !1) => {
100
100
  };
101
101
  }, [e, g]);
102
102
  const b = (t) => {
103
- a(t), l || w((s) => ({ ...s, case: "first" }));
103
+ c(t), l || w((s) => ({ ...s, case: "first" }));
104
104
  };
105
- let c = `sg-button sg-button${m ? "-" + m : "-primary"} sg-dropdown-toggle${o ? " " + o : ""}`;
106
- return (n === "a" || r) && (c = `sg-nav-dropdown-toggle sg-dropdown-toggle${o ? " " + o : ""}`), /* @__PURE__ */ v(
105
+ let a = `sg-button sg-button${m ? "-" + m : "-primary"} sg-dropdown-toggle${o ? " " + o : ""}`;
106
+ return (n === "a" || r) && (a = `sg-nav-dropdown-toggle sg-dropdown-toggle${o ? " " + o : ""}`), /* @__PURE__ */ v(
107
107
  n,
108
108
  {
109
109
  tabIndex: "0",
@@ -113,14 +113,14 @@ const L = (d, o, r = !1) => {
113
113
  "aria-expanded": l,
114
114
  id: g,
115
115
  ref: h,
116
- className: c,
116
+ className: a,
117
117
  onClick: (t) => b(t),
118
118
  ...i,
119
119
  children: d
120
120
  }
121
121
  );
122
122
  }), j = E(({ children: d, className: o, style: r = {}, ...u }, m) => {
123
- const { controlId: i, showInternal: h, activeDescendant: g } = x(), [a, w] = y(r);
123
+ const { controlId: i, showInternal: h, activeDescendant: g } = x(), [c, w] = y(r);
124
124
  A(() => {
125
125
  if (h) {
126
126
  const n = document.getElementById(i + "-menu");
@@ -130,39 +130,39 @@ const L = (d, o, r = !1) => {
130
130
  }, [h]), C(() => {
131
131
  if (h) {
132
132
  const n = document.getElementById(i + "-menu"), e = document.getElementById(i + "-menu").children, f = e.length - 1, b = document.querySelector(".sg-dropdown-item-visual-focus");
133
- let c = 0, t = e[0].children[0];
133
+ let a = 0, t = e[0].children[0];
134
134
  if (b != null) {
135
135
  b.classList.remove("sg-dropdown-item-visual-focus");
136
136
  for (let s = 0; s < e.length; s++)
137
137
  if (e[s] === b.parentElement) {
138
- c = s;
138
+ a = s;
139
139
  break;
140
140
  }
141
141
  }
142
142
  switch (g.case) {
143
143
  case "first":
144
- t = e[0].children[0], c = 0;
144
+ t = e[0].children[0], a = 0;
145
145
  break;
146
146
  case "last":
147
- t = e[f].children[0], c = f;
147
+ t = e[f].children[0], a = f;
148
148
  break;
149
149
  case "next":
150
- c = c === f ? 0 : c + 1, t = e[c].children[0];
150
+ a = a === f ? 0 : a + 1, t = e[a].children[0];
151
151
  break;
152
152
  case "previous":
153
- c = c === 0 ? f : c - 1, t = e[c].children[0];
153
+ a = a === 0 ? f : a - 1, t = e[a].children[0];
154
154
  break;
155
155
  }
156
- n.setAttribute("aria-activedescendant", t.id), e[c].children[0].classList.add("sg-dropdown-item-visual-focus");
156
+ n.setAttribute("aria-activedescendant", t.id), e[a].children[0].classList.add("sg-dropdown-item-visual-focus");
157
157
  } else
158
158
  document.getElementById(i + "-menu").setAttribute("aria-activedescendant", "");
159
159
  }, [i, h, g]);
160
160
  const l = (n) => {
161
- var c;
161
+ var a;
162
162
  const e = n.target;
163
163
  let f = e.classList.contains("sg-dropdown-item-visual-focus");
164
164
  const b = document.getElementById(i + "-menu");
165
- f || ((c = document.querySelector(".sg-dropdown-item-visual-focus")) == null || c.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));
165
+ f || ((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
166
  };
167
167
  return C(() => {
168
168
  const n = document.getElementById(i + "-menu");
@@ -181,7 +181,7 @@ const L = (d, o, r = !1) => {
181
181
  "aria-labelledby": i,
182
182
  ref: m,
183
183
  className: `sg-dropdown-list${o ? " " + o : ""}${h ? " show" : ""}`,
184
- style: a,
184
+ style: c,
185
185
  ...u,
186
186
  children: d
187
187
  }
@@ -196,6 +196,7 @@ const L = (d, o, r = !1) => {
196
196
  export {
197
197
  V as Divider,
198
198
  I as DropdownContext,
199
+ M as DropdownContextProvider,
199
200
  H as Item,
200
201
  j as Menu,
201
202
  q as Toggle,
@@ -0,0 +1,55 @@
1
+ import { ReactNode } from "react";
2
+ import { BaseDivType, BaseAnchorType, BaseButtonType, BaseUListType, BaseHrType, BaseElementType } from "../../BaseTypes";
3
+ export type DropdownContextType = {
4
+ align: string;
5
+ drop: string;
6
+ showInternal: boolean;
7
+ handleToggle: Function;
8
+ placement: string;
9
+ directionClasses?: {
10
+ down?: string;
11
+ 'down-centered'?: string;
12
+ up?: string;
13
+ 'up-centered'?: string;
14
+ end?: string;
15
+ start?: string;
16
+ };
17
+ controlId: string;
18
+ activeDescendant: {
19
+ case: string;
20
+ };
21
+ setActiveDescendant: React.Dispatch<React.SetStateAction<{
22
+ case: string;
23
+ }>>;
24
+ };
25
+ export type DropdownType = {
26
+ children: ReactNode;
27
+ className?: string;
28
+ onSelect?: Function;
29
+ onToggle?: Function;
30
+ controlId: string;
31
+ drop?: string;
32
+ align?: string;
33
+ autoClose?: boolean;
34
+ show?: boolean;
35
+ } & BaseDivType;
36
+ export type DropdownToggleType = {
37
+ children: ReactNode;
38
+ className?: string;
39
+ navDropdown?: boolean;
40
+ as?: React.ElementType;
41
+ variant?: string;
42
+ } & (BaseAnchorType | BaseButtonType | BaseElementType);
43
+ export type DropdownMenuType = {
44
+ children: ReactNode;
45
+ className?: string;
46
+ style?: React.CSSProperties | undefined;
47
+ } & BaseUListType;
48
+ export type DropdownItemType = {
49
+ children: ReactNode;
50
+ as?: React.ElementType;
51
+ className?: string;
52
+ } & (BaseAnchorType | BaseButtonType);
53
+ export type DropdownDividerType = {
54
+ className?: string;
55
+ } & BaseHrType;
@@ -0,0 +1 @@
1
+ export { default } from "./Dropdown";
@@ -0,0 +1,4 @@
1
+ import { default as o } from "./Dropdown.js";
2
+ export {
3
+ o as default
4
+ };
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { FloatingLabelType } from "./FloatingLabel.types";
3
+ declare const FloatingLabel: import("react").ForwardRefExoticComponent<Omit<FloatingLabelType, "ref"> & import("react").RefAttributes<HTMLLabelElement>>;
4
+ export default FloatingLabel;
@@ -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,9 @@
1
+ import { ReactNode } from "react";
2
+ import { BaseLabelType } from "../../BaseTypes";
3
+ export type FloatingLabelType = {
4
+ children: ReactNode;
5
+ className?: string;
6
+ htmlFor?: string;
7
+ label: string;
8
+ controlId: string;
9
+ } & BaseLabelType;
@@ -0,0 +1 @@
1
+ export { default } from "./FloatingLabel";
@@ -0,0 +1,4 @@
1
+ import { default as o } from "./FloatingLabel.js";
2
+ export {
3
+ o as default
4
+ };
@@ -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 $, Fragment as k } from "react/jsx-runtime";
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 }, u) => {
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: d } = g();
13
- let x = d || 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: u, id: x, type: r, className: f, ...m });
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: u,
33
+ labelId: d,
34
34
  className: i,
35
- type: d,
35
+ type: u,
36
36
  id: x,
37
37
  controlId: f,
38
38
  reverse: p = !1,
39
39
  checkStyle: v,
40
40
  ...a
41
- }, C) => {
42
- let h = f || x, F = d === "switch" ? "checkbox" : d;
43
- return /* @__PURE__ */ n("div", { ref: t, id: o, style: c, className: `sg-form-check${p ? "-reverse" : ""}${e ? " " + e : ""}${d === "switch" ? " sg-form-switch" : ""}`, children: p ? /* @__PURE__ */ $(k, { children: [
44
- /* @__PURE__ */ n("input", { ref: C, type: F, id: h, className: `sg-form-check-input${i ? " " + i : ""}`, ...a }),
45
- /* @__PURE__ */ n("label", { ref: s, id: u, htmlFor: h, className: `sg-form-check-label${r ? " " + r : ""}`, children: m })
46
- ] }) : /* @__PURE__ */ $(k, { children: [
47
- /* @__PURE__ */ n("label", { ref: s, id: u, htmlFor: h, className: `sg-form-check-label${r ? " " + r : ""}`, children: m }),
48
- /* @__PURE__ */ n("input", { ref: C, type: F, id: h, className: `sg-form-check-input${i ? " " + i : ""}`, style: v, ...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
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,
@@ -57,6 +57,7 @@ const w = b(null), H = ({ children: e, value: t }) => /* @__PURE__ */ n(w.Provid
57
57
  });
58
58
  export {
59
59
  w as FormContext,
60
+ H as FormContextProvider,
60
61
  z as default,
61
62
  g as useFormContext
62
63
  };
@@ -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,4 @@
1
+ import { default as o } from "./Form.js";
2
+ export {
3
+ o as default
4
+ };
@@ -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,4 @@
1
+ import { default as o } from "./Grid.js";
2
+ export {
3
+ o as default
4
+ };
@@ -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
+ export { default } from "./InputGroup";
@@ -0,0 +1,4 @@
1
+ import { default as o } from "./InputGroup.js";
2
+ export {
3
+ o as default
4
+ };
@@ -0,0 +1,40 @@
1
+ import React from "react";
2
+ import { ModalBodyType, ModalType } from "./Modal.types";
3
+ declare const _default: (({ children, centered, size, show, backdrop, onHide, className, id, ...restProps }: ModalType) => React.ReactPortal) & {
4
+ Header: React.ForwardRefExoticComponent<(Omit<{
5
+ children: React.ReactNode;
6
+ as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
7
+ className?: string | undefined;
8
+ closeButton?: boolean | undefined;
9
+ onClick?: ((event: React.MouseEvent<Element, MouseEvent>) => void) | undefined;
10
+ } & React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement>, "ref"> | Omit<{
11
+ children: React.ReactNode;
12
+ as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
13
+ className?: string | undefined;
14
+ closeButton?: boolean | undefined;
15
+ onClick?: ((event: React.MouseEvent<Element, MouseEvent>) => void) | undefined;
16
+ } & React.ClassAttributes<HTMLHeadingElement> & React.HTMLAttributes<HTMLHeadingElement>, "ref"> | Omit<{
17
+ children: React.ReactNode;
18
+ as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
19
+ className?: string | undefined;
20
+ closeButton?: boolean | undefined;
21
+ onClick?: ((event: React.MouseEvent<Element, MouseEvent>) => void) | undefined;
22
+ } & React.ClassAttributes<HTMLSpanElement> & React.HTMLAttributes<HTMLSpanElement>, "ref">) & React.RefAttributes<HTMLDivElement | HTMLHeadingElement | HTMLSpanElement>>;
23
+ Title: React.ForwardRefExoticComponent<(Omit<{
24
+ children: React.ReactNode;
25
+ as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
26
+ className?: string | undefined;
27
+ } & React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement>, "ref"> | Omit<{
28
+ children: React.ReactNode;
29
+ as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
30
+ className?: string | undefined;
31
+ } & React.ClassAttributes<HTMLHeadingElement> & React.HTMLAttributes<HTMLHeadingElement>, "ref"> | Omit<{
32
+ children: React.ReactNode;
33
+ as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
34
+ className?: string | undefined;
35
+ } & React.ClassAttributes<HTMLSpanElement> & React.HTMLAttributes<HTMLSpanElement>, "ref">) & React.RefAttributes<HTMLDivElement | HTMLHeadingElement | HTMLSpanElement>>;
36
+ Body: React.ForwardRefExoticComponent<Omit<ModalBodyType, "ref"> & React.RefAttributes<HTMLDivElement>>;
37
+ Footer: React.ForwardRefExoticComponent<Omit<ModalBodyType, "ref"> & React.RefAttributes<HTMLDivElement>>;
38
+ };
39
+ export default _default;
40
+ export declare const useKeepElementFocused: (elementRef: React.RefObject<HTMLDialogElement>) => void;