stargazer-ui 1.0.4 → 1.0.6

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 (139) hide show
  1. package/dist/cjs/components/Button/Button.d.ts +4 -0
  2. package/dist/cjs/components/Button/Button.types.d.ts +7 -0
  3. package/dist/cjs/components/Button/index.d.ts +1 -0
  4. package/dist/cjs/components/Card/Card.d.ts +34 -0
  5. package/dist/cjs/components/Card/Card.types.d.ts +24 -0
  6. package/dist/cjs/components/Card/index.d.ts +1 -0
  7. package/dist/{CloseButton/index.d.ts → cjs/components/CloseButton/CloseButton.d.ts} +1 -5
  8. package/dist/cjs/components/CloseButton/CloseButton.types.d.ts +5 -0
  9. package/dist/cjs/components/CloseButton/index.d.ts +1 -0
  10. package/dist/{Dropdown/index.d.ts → cjs/components/Dropdown/Dropdown.d.ts} +1 -54
  11. package/dist/cjs/components/Dropdown/Dropdown.types.d.ts +55 -0
  12. package/dist/cjs/components/Dropdown/index.d.ts +1 -0
  13. package/dist/cjs/components/FloatingLabel/FloatingLabel.d.ts +4 -0
  14. package/dist/cjs/components/FloatingLabel/FloatingLabel.types.d.ts +9 -0
  15. package/dist/cjs/components/FloatingLabel/index.d.ts +1 -0
  16. package/dist/cjs/components/Form/Form.d.ts +17 -0
  17. package/dist/cjs/components/Form/Form.types.d.ts +50 -0
  18. package/dist/cjs/components/Form/index.d.ts +1 -0
  19. package/dist/cjs/components/InputGroup/InputGroup.d.ts +6 -0
  20. package/dist/cjs/components/InputGroup/InputGroup.types.d.ts +10 -0
  21. package/dist/cjs/components/InputGroup/index.d.ts +1 -0
  22. package/dist/{Modal/index.d.ts → cjs/components/Modal/Modal.d.ts} +2 -32
  23. package/dist/cjs/components/Modal/Modal.types.d.ts +40 -0
  24. package/dist/cjs/components/Modal/index.d.ts +1 -0
  25. package/dist/{Nav/index.d.ts → cjs/components/Nav/Nav.d.ts} +0 -16
  26. package/dist/cjs/components/Nav/Nav.types.d.ts +17 -0
  27. package/dist/cjs/components/Nav/index.d.ts +1 -0
  28. package/dist/cjs/components/NavBar/Navbar.d.ts +20 -0
  29. package/dist/cjs/components/NavBar/Navbar.types.d.ts +18 -0
  30. package/dist/cjs/components/NavBar/index.d.ts +1 -0
  31. package/dist/{NavDropdown/index.d.ts → cjs/components/NavDropdown/NavDropdown.d.ts} +3 -7
  32. package/dist/cjs/components/NavDropdown/NavDropdown.types.d.ts +5 -0
  33. package/dist/cjs/components/NavDropdown/index.d.ts +1 -0
  34. package/dist/{Popout/index.d.ts → cjs/components/Popout/Popout.d.ts} +1 -35
  35. package/dist/cjs/components/Popout/Popout.types.d.ts +36 -0
  36. package/dist/cjs/components/Popout/index.d.ts +1 -0
  37. package/dist/{Spinner/index.d.ts → cjs/components/Spinner/Spinner.d.ts} +1 -7
  38. package/dist/cjs/components/Spinner/Spinner.types.d.ts +7 -0
  39. package/dist/cjs/components/Spinner/index.d.ts +1 -0
  40. package/dist/cjs/components/Table/Table.d.ts +4 -0
  41. package/dist/cjs/components/Table/Table.types.d.ts +7 -0
  42. package/dist/cjs/components/Table/index.d.ts +1 -0
  43. package/dist/cjs/components/Tabs/Tabs.d.ts +9 -0
  44. package/dist/{Tabs/index.d.ts → cjs/components/Tabs/Tabs.types.d.ts} +2 -9
  45. package/dist/cjs/components/Tabs/index.d.ts +1 -0
  46. package/dist/cjs/components/ToggleButton/ToggleButton.d.ts +9 -0
  47. package/dist/cjs/components/ToggleButton/index.d.ts +1 -0
  48. package/dist/cjs/components/index.d.ts +16 -0
  49. package/dist/cjs/index.d.ts +1 -0
  50. package/dist/cjs/index.js +2 -0
  51. package/dist/cjs/index.js.map +1 -0
  52. package/dist/esm/BaseTypes.d.ts +19 -0
  53. package/dist/esm/components/Button/Button.d.ts +4 -0
  54. package/dist/esm/components/Button/Button.types.d.ts +7 -0
  55. package/dist/esm/components/Button/index.d.ts +1 -0
  56. package/dist/esm/components/Card/Card.d.ts +34 -0
  57. package/dist/esm/components/Card/Card.types.d.ts +24 -0
  58. package/dist/esm/components/Card/index.d.ts +1 -0
  59. package/dist/esm/components/CloseButton/CloseButton.d.ts +4 -0
  60. package/dist/esm/components/CloseButton/CloseButton.types.d.ts +5 -0
  61. package/dist/esm/components/CloseButton/index.d.ts +1 -0
  62. package/dist/esm/components/Dropdown/Dropdown.d.ts +71 -0
  63. package/dist/esm/components/Dropdown/Dropdown.types.d.ts +55 -0
  64. package/dist/esm/components/Dropdown/index.d.ts +1 -0
  65. package/dist/esm/components/FloatingLabel/FloatingLabel.d.ts +4 -0
  66. package/dist/esm/components/FloatingLabel/FloatingLabel.types.d.ts +9 -0
  67. package/dist/esm/components/FloatingLabel/index.d.ts +1 -0
  68. package/dist/esm/components/Form/Form.d.ts +17 -0
  69. package/dist/esm/components/Form/Form.types.d.ts +50 -0
  70. package/dist/esm/components/Form/index.d.ts +1 -0
  71. package/dist/esm/components/InputGroup/InputGroup.d.ts +6 -0
  72. package/dist/esm/components/InputGroup/InputGroup.types.d.ts +10 -0
  73. package/dist/esm/components/InputGroup/index.d.ts +1 -0
  74. package/dist/esm/components/Modal/Modal.d.ts +40 -0
  75. package/dist/esm/components/Modal/Modal.types.d.ts +40 -0
  76. package/dist/esm/components/Modal/index.d.ts +1 -0
  77. package/dist/esm/components/Nav/Nav.d.ts +30 -0
  78. package/dist/esm/components/Nav/Nav.types.d.ts +17 -0
  79. package/dist/esm/components/Nav/index.d.ts +1 -0
  80. package/dist/esm/components/NavBar/Navbar.d.ts +20 -0
  81. package/dist/esm/components/NavBar/Navbar.types.d.ts +18 -0
  82. package/dist/esm/components/NavBar/index.d.ts +1 -0
  83. package/dist/esm/components/NavDropdown/NavDropdown.d.ts +35 -0
  84. package/dist/esm/components/NavDropdown/NavDropdown.types.d.ts +5 -0
  85. package/dist/esm/components/NavDropdown/index.d.ts +1 -0
  86. package/dist/esm/components/Popout/Popout.d.ts +22 -0
  87. package/dist/esm/components/Popout/Popout.types.d.ts +36 -0
  88. package/dist/esm/components/Popout/index.d.ts +1 -0
  89. package/dist/esm/components/Spinner/Spinner.d.ts +4 -0
  90. package/dist/esm/components/Spinner/Spinner.types.d.ts +7 -0
  91. package/dist/esm/components/Spinner/index.d.ts +1 -0
  92. package/dist/esm/components/Table/Table.d.ts +4 -0
  93. package/dist/esm/components/Table/Table.types.d.ts +7 -0
  94. package/dist/esm/components/Table/index.d.ts +1 -0
  95. package/dist/esm/components/Tabs/Tabs.d.ts +9 -0
  96. package/dist/esm/components/Tabs/Tabs.types.d.ts +35 -0
  97. package/dist/esm/components/Tabs/index.d.ts +1 -0
  98. package/dist/esm/components/ToggleButton/ToggleButton.d.ts +9 -0
  99. package/dist/esm/components/ToggleButton/index.d.ts +1 -0
  100. package/dist/esm/components/index.d.ts +16 -0
  101. package/dist/esm/index.d.ts +1 -0
  102. package/dist/esm/index.js +2 -0
  103. package/dist/esm/index.js.map +1 -0
  104. package/dist/types.d.ts +470 -0
  105. package/package.json +15 -4
  106. package/dist/BaseTypes.js +0 -1
  107. package/dist/Button/index.d.ts +0 -9
  108. package/dist/Button/index.js +0 -6
  109. package/dist/Card/index.d.ts +0 -92
  110. package/dist/Card/index.js +0 -18
  111. package/dist/CloseButton/index.js +0 -6
  112. package/dist/Dropdown/index.js +0 -205
  113. package/dist/FloatingLabel/index.d.ts +0 -11
  114. package/dist/FloatingLabel/index.js +0 -13
  115. package/dist/Form/index.d.ts +0 -65
  116. package/dist/Form/index.js +0 -63
  117. package/dist/Grid/Col.js +0 -19
  118. package/dist/Grid/Container.js +0 -9
  119. package/dist/Grid/Row.js +0 -17
  120. package/dist/InputGroup/index.d.ts +0 -14
  121. package/dist/InputGroup/index.js +0 -8
  122. package/dist/Modal/index.js +0 -99
  123. package/dist/Nav/index.js +0 -13
  124. package/dist/NavBar/index.d.ts +0 -46
  125. package/dist/NavBar/index.js +0 -17
  126. package/dist/NavDropdown/index.js +0 -858
  127. package/dist/OffCanvas/OffCanvas.js +0 -2266
  128. package/dist/Overlay/index.js +0 -125
  129. package/dist/Popout/index.js +0 -72
  130. package/dist/Spinner/index.js +0 -9
  131. package/dist/Table/index.d.ts +0 -9
  132. package/dist/Table/index.js +0 -9
  133. package/dist/Tabs/index.js +0 -77
  134. package/dist/ToggleButton/index.js +0 -11
  135. package/dist/main.js +0 -30
  136. package/dist/stylesheets/stargazerui.css +0 -4902
  137. package/dist/stylesheets/stargazerui.css.map +0 -1
  138. package/dist/vite-env.d.js +0 -1
  139. /package/dist/{BaseTypes.d.ts → cjs/BaseTypes.d.ts} +0 -0
@@ -1,125 +0,0 @@
1
- import { jsxs as M, Fragment as U, jsx as N } from "react/jsx-runtime";
2
- import { forwardRef as X, useRef as S, useState as w, useEffect as $, cloneElement as Y } from "react";
3
- import { createPortal as Z } from "react-dom";
4
- const q = (l, a, u, c, i = !1) => {
5
- let f = document.body, o = l.current, g = a.current, e = getComputedStyle(o).position, n = o.getBoundingClientRect().top - (e != "fixed" ? f.getBoundingClientRect().top : 0), d = o.offsetHeight, h = o.getBoundingClientRect().left - (e != "fixed" ? f.getBoundingClientRect().left : 0), x = o.offsetWidth, m = g.clientHeight, y = g.clientWidth;
6
- const p = (C, R, B) => g.getBoundingClientRect()[C] <= B ? R : r[C];
7
- let H = 0, v = 0;
8
- i || (v = c.clientHeight - 1, H = c.clientWidth - 1);
9
- let r;
10
- switch (u) {
11
- case "top":
12
- return r = { top: n - m - v, left: h + x / 2 - y / 2 }, r.right = p("right", 12, 0), r.left = p("left", 0, 0), r;
13
- case "right":
14
- return r = { top: n + d / 2 - m / 2, left: h + o.offsetWidth + H }, r;
15
- case "bottom":
16
- return r = { top: n + d + v, left: h + x / 2 - y / 2 }, r.right = p("right", 12, 0), r.left = p("left", 0, 0), r;
17
- case "left":
18
- return r = { top: n + d / 2 - m / 2, left: h - y - H }, r;
19
- default:
20
- return { top: n - m, left: h + x / 2 - y / 2 };
21
- }
22
- }, G = (l, a, u, c) => {
23
- let i = a.current.getBoundingClientRect().top, f = window.innerHeight - a.current.getBoundingClientRect().bottom, o = a.current.getBoundingClientRect().left, g = window.innerWidth - a.current.getBoundingClientRect().right, e = u.current.clientWidth + c.current.clientWidth + 48, n = u.current.clientHeight + c.current.clientHeight + 48;
24
- if (l.current === "top") {
25
- if (i <= n)
26
- return g <= e ? "left" : o <= e ? "right" : "top";
27
- } else if (l.current === "bottom") {
28
- if (f <= n)
29
- return g <= e ? "left" : o <= e ? "right" : "bottom";
30
- } else if (l.current === "left" || l.current === "right") {
31
- if (i >= n)
32
- return "top";
33
- if (i < n / 2)
34
- return "bottom";
35
- if (f < n / 2)
36
- return l.current === "left" ? "left" : "right";
37
- }
38
- return l.current;
39
- }, et = X(({ children: l, overlay: a, show: u, onToggle: c, position: i = "auto", trigger: f = "click", defaultShow: o = !1 }, g) => {
40
- const e = S(), n = S(), d = S(), [h, x] = w(""), [m, y] = w(""), [p, H] = w(o), v = S(p), r = (t) => {
41
- v.current = t, H(t);
42
- }, [C, R] = w(i === "auto" ? "top" : i), B = S(C), W = (t) => {
43
- B.current = t, R(t);
44
- }, [k, A] = w(!1), [L, O] = w(!1), [J, F] = w(!0), P = Array.isArray(f) ? f : [f], E = (t, s, b) => {
45
- s.current && (y(q(t, s, B.current, b.current)), x(q(t, b, B.current, b.current, !0)));
46
- }, I = () => {
47
- if (v.current && i === "auto") {
48
- let t = G(B, e, n, d);
49
- W(t);
50
- }
51
- }, z = () => {
52
- E(e, n, d), v.current;
53
- }, K = (t) => {
54
- if (L && J) {
55
- F(!1);
56
- return;
57
- }
58
- r(!p), c(!p);
59
- }, Q = (t) => {
60
- k || (A(!0), c(!0));
61
- }, T = (t) => {
62
- r(!0), O(!0), c(!0);
63
- }, D = (t) => {
64
- k ? A(!1) : L && (O(!1), F(!0)), r(!1), c(!1);
65
- };
66
- $(() => {
67
- if (n.current && u && (E(e, n, d), i === "auto")) {
68
- let t = G(B, e, n, d);
69
- W(t);
70
- }
71
- if (e.current) {
72
- let t = document.body, s = getComputedStyle(e.current).position;
73
- y({
74
- top: e.current.getBoundingClientRect().top - (s != "fixed" ? t.getBoundingClientRect().top : 0),
75
- left: e.current.getBoundingClientRect().left - (s != "fixed" ? t.getBoundingClientRect().left : 0)
76
- }), x({
77
- top: e.current.getBoundingClientRect().top - (s != "fixed" ? t.getBoundingClientRect().top : 0),
78
- left: e.current.getBoundingClientRect().left - (s != "fixed" ? t.getBoundingClientRect().left : 0)
79
- });
80
- }
81
- r(u);
82
- }, [u, n, e, C]), $(() => (window.addEventListener("scroll", I), window.addEventListener("resize", z), function() {
83
- window.removeEventListener("scroll", I), window.removeEventListener("resize", z);
84
- }), []);
85
- const j = (t) => {
86
- let s = getComputedStyle(t.current).position;
87
- return s === "fixed" ? "fixed" : s === "sticky" ? "sticky" : "absolute";
88
- };
89
- return /* @__PURE__ */ M("div", { ref: g, style: { display: "static" }, children: [
90
- Y(l, {
91
- ref: e,
92
- onClick: P.find((t) => t === "click") ? K : null,
93
- onMouseOver: P.find((t) => t === "hover") ? Q : null,
94
- onMouseLeave: P.find((t) => t === "hover") ? D : null,
95
- onFocus: P.find((t) => t === "focus") ? T : null,
96
- onBlur: P.find((t) => t === "focus") ? D : null
97
- }),
98
- u ? Z(
99
- /* @__PURE__ */ M(U, { children: [
100
- /* @__PURE__ */ N(
101
- "div",
102
- {
103
- ref: n,
104
- style: { maxWidth: "100%", maxHeight: "100%", position: j(e), top: m.top, left: m.left, zIndex: "1010" },
105
- children: a
106
- }
107
- ),
108
- /* @__PURE__ */ N(
109
- "div",
110
- {
111
- id: "sg-overlay-arrow",
112
- ref: d,
113
- "aria-hidden": !0,
114
- className: `sg-overlay-arrow${C ? " overlay-position-" + C : ""}`,
115
- style: { position: j(e), top: h.top, left: h.left }
116
- }
117
- )
118
- ] }),
119
- document.body
120
- ) : null
121
- ] });
122
- });
123
- export {
124
- et as default
125
- };
@@ -1,72 +0,0 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import { createPortal as A } from "react-dom";
3
- import { forwardRef as u, useState as M, useRef as y, useEffect as R } from "react";
4
- const W = u(({ children: e, initialPosition: n = { top: 0, left: 0 }, id: o, resize: s = !1, move: f = !1, className: a, style: l, ...p }, N) => {
5
- const [r, C] = M({ offSetTop: 0, offSetLeft: 0, ...n }), P = s ? "true" : "false", $ = f ? "true" : "false", x = y(N), i = y(null), [h, T] = M(!1), b = y(h);
6
- R(() => {
7
- b.current = h;
8
- }, [h]);
9
- const D = (t) => {
10
- const d = t.target;
11
- if (f && d.className.includes("sg-popout-title") || d.className.includes("sg-popout-header")) {
12
- const { top: m, left: g } = i.current.getBoundingClientRect();
13
- C((w) => ({
14
- ...w,
15
- offSetTop: t.clientY - m,
16
- offSetLeft: t.clientX - g
17
- })), i.current.style.setProperty("user-select", "none"), i.current.setPointerCapture(t.pointerId), T(!0);
18
- }
19
- }, L = () => {
20
- f && (i.current.style.removeProperty("user-select"), T(!1));
21
- }, H = (t) => {
22
- if (f && b.current && i.current) {
23
- const d = t.clientY - r.offSetTop < 0, m = window.innerHeight - (t.clientY - r.offSetTop + i.current.offsetHeight) < 0, g = t.clientX - r.offSetLeft < 0, w = window.innerWidth - (t.clientX - r.offSetLeft + i.current.offsetWidth) < 0;
24
- let v = d ? 0 : t.clientY - r.offSetTop;
25
- v = m ? window.innerHeight - i.current.offsetHeight : v;
26
- let S = g ? 0 : t.clientX - r.offSetLeft;
27
- S = w ? window.innerWidth - i.current.offsetWidth : S, C((O) => ({
28
- ...O,
29
- top: v,
30
- left: S
31
- }));
32
- }
33
- };
34
- return R(() => (document.body.addEventListener("pointerup", () => L(), !0), function() {
35
- document.body.removeEventListener("pointerup", () => L(), !0);
36
- }), []), A(
37
- /* @__PURE__ */ c(
38
- "dialog",
39
- {
40
- "data-resize": P,
41
- "data-move": $,
42
- "data-passedRef": x,
43
- ref: i,
44
- id: o,
45
- className: `sg-moveable-popout${a ? " " + a : ""}`,
46
- style: { ...l, top: r.top, left: r.left, bottom: r.bottom, right: r.right },
47
- onPointerDown: D,
48
- onPointerMove: (t) => H(t),
49
- ...p,
50
- children: e
51
- }
52
- ),
53
- document.body
54
- );
55
- }), X = u(
56
- ({ children: e, className: n, as: o = "div", ...s }, f) => {
57
- let l = ["div", "span", "h1", "h2", "h3", "h4", "h5", "h6"].find((p) => p === o) ? o : "div";
58
- return /* @__PURE__ */ c(l, { ref: f, className: `sg-popout-header ${n}`, ...s, children: e });
59
- }
60
- ), Y = u(({ as: e = "h4", className: n, children: o, ...s }, f) => {
61
- let l = ["h1", "h2", "h3", "h4", "h5", "h6"].find((p) => p === e) ? e : "h5";
62
- return /* @__PURE__ */ c(l, { ref: f, className: `sg-popout-title ${n}`, ...s, children: o });
63
- }), B = u(({ children: e, className: n, ...o }, s) => /* @__PURE__ */ c("div", { ref: s, className: `sg-popout-body ${n}`, ...o, children: e })), E = u(({ children: e, className: n, ...o }, s) => /* @__PURE__ */ c("p", { ref: s, className: `sg-popout-text ${n}`, ...o, children: e })), j = u(({ children: e, className: n, ...o }, s) => /* @__PURE__ */ c("div", { ref: s, className: `sg-popout-footer ${n}`, ...o, children: e })), U = Object.assign(W, {
64
- Header: X,
65
- Title: Y,
66
- Body: B,
67
- Text: E,
68
- Footer: j
69
- });
70
- export {
71
- U as default
72
- };
@@ -1,9 +0,0 @@
1
- import { jsxs as n, Fragment as o, jsx as l } from "react/jsx-runtime";
2
- import { forwardRef as h } from "react";
3
- const p = h(({ size: e = "1em", color: s = "white", label: a, className: r, controlId: i, ...t }, d) => /* @__PURE__ */ n(o, { children: [
4
- /* @__PURE__ */ l("div", { "aria-labelledby": i, role: "status", ref: d, className: `sg-spinner${r ? " " + r : ""}`, style: { width: e, height: e, borderColor: s }, ...t }),
5
- /* @__PURE__ */ l("label", { id: i, className: "sg-visually-hidden", children: a })
6
- ] }));
7
- export {
8
- p as default
9
- };
@@ -1,9 +0,0 @@
1
- import React from "react";
2
- import { BaseTableType } from "../BaseTypes";
3
- export type TableType = {
4
- children: React.ReactNode;
5
- size?: string;
6
- className?: string;
7
- } & BaseTableType;
8
- declare const Table: React.ForwardRefExoticComponent<Omit<TableType, "ref"> & React.RefAttributes<HTMLTableElement>>;
9
- export default Table;
@@ -1,9 +0,0 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { forwardRef as m } from "react";
3
- const p = m(({ children: t, size: s = "lg", className: e, ...r }, a) => {
4
- let l = `sg-table${e ? " " + e : ""}${s === "sm" ? " sg-table-sm" : ""}`;
5
- return /* @__PURE__ */ o("table", { ref: a, className: l, ...r, children: t });
6
- });
7
- export {
8
- p as default
9
- };
@@ -1,77 +0,0 @@
1
- import { jsx as d } from "react/jsx-runtime";
2
- import { createContext as m, forwardRef as C, useState as p, useMemo as T, useContext as w } from "react";
3
- const h = m(null), y = ({ children: e, value: t }) => /* @__PURE__ */ d(h.Provider, { value: t, children: e }), f = () => {
4
- const e = w(h);
5
- if (!e)
6
- throw new Error(
7
- "useTabContext has to be used within a TabContextProvider!"
8
- );
9
- return e;
10
- }, A = C(({ children: e, className: t, controlId: n, activeClassName: o, defaultActive: r, ...i }, l) => {
11
- const [s, c] = p(r), v = o || "sg-active", a = T(() => ({
12
- activeTab: s,
13
- setActiveTab: c,
14
- controlId: n,
15
- activeClass: v
16
- }), [s, c, n]);
17
- return /* @__PURE__ */ d(y, { value: a, children: /* @__PURE__ */ d("div", { ref: l, id: n + "-tab-wrapper", className: `sg-tabs${t ? " " + t : ""}`, ...i, children: e }) });
18
- }), k = C(({ children: e, className: t, ...n }, o) => {
19
- const { controlId: r, activeClass: i } = f(), l = (s) => {
20
- const c = s.key, v = document.getElementById(r + "-tab-controls");
21
- if (v) {
22
- const a = Array.from(v.children);
23
- if (c === "ArrowRight" || c === "ArrowLeft") {
24
- s.preventDefault();
25
- const u = document.querySelector(".sg-tabs-button." + i), g = a.indexOf(u), b = c === "ArrowRight" ? 1 : -1, x = g + b < 0 ? a.length - 1 : g + b >= a.length ? 0 : g + b;
26
- a[x].focus(), a[x].click();
27
- } else if (c === "Home" || c === "End") {
28
- s.preventDefault();
29
- const u = c === "Home" ? 0 : a.length - 1;
30
- a[u].focus(), a[u].click();
31
- }
32
- }
33
- };
34
- return /* @__PURE__ */ d("div", { onKeyDown: (s) => l(s), role: "tablist", id: r + "-tab-controls", ref: o, className: `sg-tabs-controls${t ? " " + t : ""}`, ...n, children: e });
35
- }), D = C(({ children: e, className: t, onClick: n, tabId: o, id: r, ...i }, l) => {
36
- const { activeTab: s, setActiveTab: c, activeClass: v } = f(), a = "sg-tabs-button" + (t ? " " + t : "") + (s === o ? " " + v : ""), u = s === o, g = (b) => {
37
- c(o), n && n(b);
38
- };
39
- return /* @__PURE__ */ d(
40
- "button",
41
- {
42
- role: "tab",
43
- type: "button",
44
- id: o + "-button",
45
- ref: l,
46
- onClick: (b) => g(b),
47
- className: a,
48
- ...i,
49
- tabIndex: u ? 0 : -1,
50
- "aria-selected": u ? "true" : "false",
51
- "aria-controls": o + "-page",
52
- children: e
53
- }
54
- );
55
- }), P = C(({ children: e, className: t, ...n }, o) => /* @__PURE__ */ d("div", { role: "none", ref: o, className: `sg-tabs-content${t ? " " + t : ""}`, ...n, children: e })), E = C(({ children: e, className: t, tabId: n, ...o }, r) => {
56
- const { activeTab: i, activeClass: l } = f(), s = "sg-tabs-page" + (t ? " " + t : "") + (i === n ? " " + l : "");
57
- return /* @__PURE__ */ d(
58
- "div",
59
- {
60
- role: "tabpanel",
61
- id: n + "-page",
62
- "aria-labelledby": n + "-button",
63
- ref: r,
64
- className: s,
65
- ...o,
66
- children: e
67
- }
68
- );
69
- }), j = Object.assign(A, {
70
- Controls: k,
71
- Button: D,
72
- Content: P,
73
- Page: E
74
- });
75
- export {
76
- j as default
77
- };
@@ -1,11 +0,0 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { forwardRef as u, useState as g } from "react";
3
- const p = u(({ children: t, toggled: r = "false", onClick: e, ...o }, d) => {
4
- const [l, n] = g(r);
5
- return /* @__PURE__ */ s("button", { onClick: (a) => {
6
- n((f) => f === "true" ? "false" : "true"), e && e(a);
7
- }, toggled: l, ...o, children: t });
8
- });
9
- export {
10
- p as default
11
- };
package/dist/main.js DELETED
@@ -1,30 +0,0 @@
1
- import { default as t } from "./Button/index.js";
2
- import { default as e } from "./Card/index.js";
3
- import { default as u } from "./CloseButton/index.js";
4
- import { default as p } from "./Dropdown/index.js";
5
- import { default as s } from "./FloatingLabel/index.js";
6
- import { default as x } from "./Form/index.js";
7
- import { default as b } from "./InputGroup/index.js";
8
- import { default as v } from "./Modal/index.js";
9
- import { default as N } from "./Nav/index.js";
10
- import { default as C } from "./NavBar/index.js";
11
- import { default as F } from "./NavDropdown/index.js";
12
- import { default as i } from "./Popout/index.js";
13
- import { default as I } from "./Tabs/index.js";
14
- import { default as M } from "./ToggleButton/index.js";
15
- export {
16
- t as Button,
17
- e as Card,
18
- u as CloseButton,
19
- p as Dropdown,
20
- s as FloatingLabel,
21
- x as Form,
22
- b as InputGroup,
23
- v as Modal,
24
- N as Nav,
25
- F as NavDropdown,
26
- C as Navbar,
27
- i as Popout,
28
- I as Tabs,
29
- M as ToggleButton
30
- };