fina-react-ds 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/dist/_virtual/index.js +5 -0
- package/dist/_virtual/index2.js +4 -0
- package/dist/_virtual/use-sync-external-store-shim.development.js +4 -0
- package/dist/_virtual/use-sync-external-store-shim.production.js +4 -0
- package/dist/components/alert-dialog.d.ts +16 -0
- package/dist/components/alert.d.ts +8 -0
- package/dist/components/alert.js +70 -0
- package/dist/components/avatar.d.ts +5 -0
- package/dist/components/avatar.js +58 -0
- package/dist/components/badge.d.ts +8 -0
- package/dist/components/badge.js +43 -0
- package/dist/components/button.d.ts +10 -0
- package/dist/components/button.js +152 -0
- package/dist/components/card.d.ts +8 -0
- package/dist/components/card.js +99 -0
- package/dist/components/checkbox.d.ts +4 -0
- package/dist/components/checkbox.js +34 -0
- package/dist/components/dialog.d.ts +15 -0
- package/dist/components/dialog.js +148 -0
- package/dist/components/dropdown-menu.d.ts +25 -0
- package/dist/components/dropdown-menu.js +248 -0
- package/dist/components/input.d.ts +3 -0
- package/dist/components/input.js +24 -0
- package/dist/components/label.d.ts +6 -0
- package/dist/components/label.js +32 -0
- package/dist/components/pagination.d.ts +13 -0
- package/dist/components/pagination.js +128 -0
- package/dist/components/popover.d.ts +7 -0
- package/dist/components/popover.js +50 -0
- package/dist/components/select.d.ts +11 -0
- package/dist/components/select.js +48 -0
- package/dist/components/separator.d.ts +4 -0
- package/dist/components/simple-pagination.d.ts +6 -0
- package/dist/components/simple-pagination.js +34 -0
- package/dist/components/tabs.d.ts +7 -0
- package/dist/components/tabs.js +73 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/index.js +80 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +11 -0
- package/dist/lib.d.ts +16 -0
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +534 -0
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +430 -0
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +215 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +159 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +149 -0
- package/dist/node_modules/@radix-ui/primitive/dist/index.js +12 -0
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +24 -0
- package/dist/node_modules/@radix-ui/react-avatar/dist/index.js +80 -0
- package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +258 -0
- package/dist/node_modules/@radix-ui/react-collection/dist/index.js +51 -0
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +34 -0
- package/dist/node_modules/@radix-ui/react-context/dist/index.js +76 -0
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +265 -0
- package/dist/node_modules/@radix-ui/react-direction/dist/index.js +12 -0
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +133 -0
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +230 -0
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +21 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +149 -0
- package/dist/node_modules/@radix-ui/react-id/dist/index.js +16 -0
- package/dist/node_modules/@radix-ui/react-label/dist/index.js +22 -0
- package/dist/node_modules/@radix-ui/react-menu/dist/index.js +663 -0
- package/dist/node_modules/@radix-ui/react-popover/dist/index.js +247 -0
- package/dist/node_modules/@radix-ui/react-popper/dist/index.js +224 -0
- package/dist/node_modules/@radix-ui/react-portal/dist/index.js +16 -0
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js +77 -0
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +39 -0
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +189 -0
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js +60 -0
- package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +168 -0
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +16 -0
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +59 -0
- package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +17 -0
- package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +19 -0
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +6 -0
- package/dist/node_modules/@radix-ui/react-use-previous/dist/index.js +11 -0
- package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +30 -0
- package/dist/node_modules/aria-hidden/dist/es2015/index.js +54 -0
- package/dist/node_modules/get-nonce/dist/es2015/index.js +9 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +11 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +116 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +33 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +18 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +70 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +5 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +7 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +73 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +7 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +27 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/component.js +13 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +17 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +35 -0
- package/dist/node_modules/tslib/tslib.es6.js +31 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +9 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +29 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +28 -0
- package/dist/node_modules/use-sidecar/dist/es2015/exports.js +21 -0
- package/dist/node_modules/use-sidecar/dist/es2015/medium.js +72 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +73 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +62 -0
- package/dist/node_modules/use-sync-external-store/shim/index.js +13 -0
- package/dist/themes/base.css +1982 -0
- package/dist/themes/pro.css +188 -0
- package/dist/themes/puulse-colors.css +388 -0
- package/package.json +114 -0
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
var j = Object.defineProperty;
|
|
2
|
+
var I = (e, o) => j(e, "name", { value: o, configurable: !0 });
|
|
3
|
+
import * as c from "react";
|
|
4
|
+
import { composeEventHandlers as p } from "../../primitive/dist/index.js";
|
|
5
|
+
import { createCollection as z } from "../../react-collection/dist/index.js";
|
|
6
|
+
import { useComposedRefs as q } from "../../react-compose-refs/dist/index.js";
|
|
7
|
+
import { createContextScope as J } from "../../react-context/dist/index.js";
|
|
8
|
+
import { useId as Q } from "../../react-id/dist/index.js";
|
|
9
|
+
import { Primitive as N } from "../../react-primitive/dist/index.js";
|
|
10
|
+
import { useCallbackRef as W } from "../../react-use-callback-ref/dist/index.js";
|
|
11
|
+
import { useControllableState as X } from "../../react-use-controllable-state/dist/index.js";
|
|
12
|
+
import { useDirection as Z } from "../../react-direction/dist/index.js";
|
|
13
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
14
|
+
var D = "rovingFocusGroup.onEntryFocus", $ = { bubbles: !1, cancelable: !0 }, b = "RovingFocusGroup", [P, O, ee] = z(b), [oe, Ee] = J(
|
|
15
|
+
b,
|
|
16
|
+
[ee]
|
|
17
|
+
), [te, re] = oe(b), K = c.forwardRef(
|
|
18
|
+
(e, o) => /* @__PURE__ */ d(P.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ d(P.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ d(ne, { ...e, ref: o }) }) })
|
|
19
|
+
);
|
|
20
|
+
K.displayName = b;
|
|
21
|
+
var ne = c.forwardRef((e, o) => {
|
|
22
|
+
const {
|
|
23
|
+
__scopeRovingFocusGroup: s,
|
|
24
|
+
orientation: t,
|
|
25
|
+
loop: w = !1,
|
|
26
|
+
dir: C,
|
|
27
|
+
currentTabStopId: v,
|
|
28
|
+
defaultCurrentTabStopId: S,
|
|
29
|
+
onCurrentTabStopIdChange: h,
|
|
30
|
+
onEntryFocus: m,
|
|
31
|
+
preventScrollOnEntryFocus: u = !1,
|
|
32
|
+
...F
|
|
33
|
+
} = e, g = c.useRef(null), R = q(o, g), E = Z(C), [T, r] = X({
|
|
34
|
+
prop: v,
|
|
35
|
+
defaultProp: S ?? null,
|
|
36
|
+
onChange: h,
|
|
37
|
+
caller: b
|
|
38
|
+
}), [i, A] = c.useState(!1), a = W(m), l = O(s), _ = c.useRef(!1), [U, x] = c.useState(0);
|
|
39
|
+
return c.useEffect(() => {
|
|
40
|
+
const n = g.current;
|
|
41
|
+
if (n)
|
|
42
|
+
return n.addEventListener(D, a), () => n.removeEventListener(D, a);
|
|
43
|
+
}, [a]), /* @__PURE__ */ d(
|
|
44
|
+
te,
|
|
45
|
+
{
|
|
46
|
+
scope: s,
|
|
47
|
+
orientation: t,
|
|
48
|
+
dir: E,
|
|
49
|
+
loop: w,
|
|
50
|
+
currentTabStopId: T,
|
|
51
|
+
onItemFocus: c.useCallback(
|
|
52
|
+
(n) => r(n),
|
|
53
|
+
[r]
|
|
54
|
+
),
|
|
55
|
+
onItemShiftTab: c.useCallback(() => A(!0), []),
|
|
56
|
+
onFocusableItemAdd: c.useCallback(
|
|
57
|
+
() => x((n) => n + 1),
|
|
58
|
+
[]
|
|
59
|
+
),
|
|
60
|
+
onFocusableItemRemove: c.useCallback(
|
|
61
|
+
() => x((n) => n - 1),
|
|
62
|
+
[]
|
|
63
|
+
),
|
|
64
|
+
children: /* @__PURE__ */ d(
|
|
65
|
+
N.div,
|
|
66
|
+
{
|
|
67
|
+
tabIndex: i || U === 0 ? -1 : 0,
|
|
68
|
+
"data-orientation": t,
|
|
69
|
+
...F,
|
|
70
|
+
ref: R,
|
|
71
|
+
style: { outline: "none", ...e.style },
|
|
72
|
+
onMouseDown: p(e.onMouseDown, () => {
|
|
73
|
+
_.current = !0;
|
|
74
|
+
}),
|
|
75
|
+
onFocus: p(e.onFocus, (n) => {
|
|
76
|
+
const B = !_.current;
|
|
77
|
+
if (n.target === n.currentTarget && B && !i) {
|
|
78
|
+
const G = new CustomEvent(D, $);
|
|
79
|
+
if (n.currentTarget.dispatchEvent(G), !G.defaultPrevented) {
|
|
80
|
+
const y = l().filter((f) => f.focusable), Y = y.find((f) => f.active), H = y.find((f) => f.id === T), V = [Y, H, ...y].filter(
|
|
81
|
+
Boolean
|
|
82
|
+
).map((f) => f.ref.current);
|
|
83
|
+
L(V, u);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
_.current = !1;
|
|
87
|
+
}),
|
|
88
|
+
onBlur: p(e.onBlur, () => A(!1))
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
}), M = "RovingFocusGroupItem", k = c.forwardRef(
|
|
94
|
+
(e, o) => {
|
|
95
|
+
const {
|
|
96
|
+
__scopeRovingFocusGroup: s,
|
|
97
|
+
focusable: t = !0,
|
|
98
|
+
active: w = !1,
|
|
99
|
+
tabStopId: C,
|
|
100
|
+
children: v,
|
|
101
|
+
...S
|
|
102
|
+
} = e, h = Q(), m = C || h, u = re(M, s), F = u.currentTabStopId === m, g = O(s), { onFocusableItemAdd: R, onFocusableItemRemove: E, currentTabStopId: T } = u;
|
|
103
|
+
return c.useEffect(() => {
|
|
104
|
+
if (t)
|
|
105
|
+
return R(), () => E();
|
|
106
|
+
}, [t, R, E]), /* @__PURE__ */ d(
|
|
107
|
+
P.ItemSlot,
|
|
108
|
+
{
|
|
109
|
+
scope: s,
|
|
110
|
+
id: m,
|
|
111
|
+
focusable: t,
|
|
112
|
+
active: w,
|
|
113
|
+
children: /* @__PURE__ */ d(
|
|
114
|
+
N.span,
|
|
115
|
+
{
|
|
116
|
+
tabIndex: F ? 0 : -1,
|
|
117
|
+
"data-orientation": u.orientation,
|
|
118
|
+
...S,
|
|
119
|
+
ref: o,
|
|
120
|
+
onMouseDown: p(e.onMouseDown, (r) => {
|
|
121
|
+
t ? u.onItemFocus(m) : r.preventDefault();
|
|
122
|
+
}),
|
|
123
|
+
onFocus: p(e.onFocus, () => u.onItemFocus(m)),
|
|
124
|
+
onKeyDown: p(e.onKeyDown, (r) => {
|
|
125
|
+
if (r.key === "Tab" && r.shiftKey) {
|
|
126
|
+
u.onItemShiftTab();
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
if (r.target !== r.currentTarget) return;
|
|
130
|
+
const i = ue(r, u.orientation, u.dir);
|
|
131
|
+
if (i !== void 0) {
|
|
132
|
+
if (r.metaKey || r.ctrlKey || r.altKey || r.shiftKey) return;
|
|
133
|
+
r.preventDefault();
|
|
134
|
+
let a = g().filter((l) => l.focusable).map((l) => l.ref.current);
|
|
135
|
+
if (i === "last") a.reverse();
|
|
136
|
+
else if (i === "prev" || i === "next") {
|
|
137
|
+
i === "prev" && a.reverse();
|
|
138
|
+
const l = a.indexOf(r.currentTarget);
|
|
139
|
+
a = u.loop ? ae(a, l + 1) : a.slice(l + 1);
|
|
140
|
+
}
|
|
141
|
+
setTimeout(() => L(a));
|
|
142
|
+
}
|
|
143
|
+
}),
|
|
144
|
+
children: typeof v == "function" ? v({ isCurrentTabStop: F, hasTabStop: T != null }) : v
|
|
145
|
+
}
|
|
146
|
+
)
|
|
147
|
+
}
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
);
|
|
151
|
+
k.displayName = M;
|
|
152
|
+
var ce = {
|
|
153
|
+
ArrowLeft: "prev",
|
|
154
|
+
ArrowUp: "prev",
|
|
155
|
+
ArrowRight: "next",
|
|
156
|
+
ArrowDown: "next",
|
|
157
|
+
PageUp: "first",
|
|
158
|
+
Home: "first",
|
|
159
|
+
PageDown: "last",
|
|
160
|
+
End: "last"
|
|
161
|
+
};
|
|
162
|
+
function se(e, o) {
|
|
163
|
+
return o !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
|
|
164
|
+
}
|
|
165
|
+
I(se, "getDirectionAwareKey");
|
|
166
|
+
function ue(e, o, s) {
|
|
167
|
+
const t = se(e.key, s);
|
|
168
|
+
if (!(o === "vertical" && ["ArrowLeft", "ArrowRight"].includes(t)) && !(o === "horizontal" && ["ArrowUp", "ArrowDown"].includes(t)))
|
|
169
|
+
return ce[t];
|
|
170
|
+
}
|
|
171
|
+
I(ue, "getFocusIntent");
|
|
172
|
+
function L(e, o = !1) {
|
|
173
|
+
const s = document.activeElement;
|
|
174
|
+
for (const t of e)
|
|
175
|
+
if (t === s || (t.focus({ preventScroll: o }), document.activeElement !== s)) return;
|
|
176
|
+
}
|
|
177
|
+
I(L, "focusFirst");
|
|
178
|
+
function ae(e, o) {
|
|
179
|
+
return e.map((s, t) => e[(o + t) % e.length]);
|
|
180
|
+
}
|
|
181
|
+
I(ae, "wrapArray");
|
|
182
|
+
var Te = K, we = k;
|
|
183
|
+
export {
|
|
184
|
+
we as Item,
|
|
185
|
+
Te as Root,
|
|
186
|
+
K as RovingFocusGroup,
|
|
187
|
+
k as RovingFocusGroupItem,
|
|
188
|
+
Ee as createRovingFocusGroupScope
|
|
189
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
var y = Object.defineProperty;
|
|
2
|
+
var a = (e, r) => y(e, "name", { value: r, configurable: !0 });
|
|
3
|
+
import * as l from "react";
|
|
4
|
+
import { composeRefs as S } from "../../react-compose-refs/dist/index.js";
|
|
5
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
6
|
+
// @__NO_SIDE_EFFECTS__
|
|
7
|
+
function g(e) {
|
|
8
|
+
const r = /* @__PURE__ */ E(e), o = l.forwardRef((n, t) => {
|
|
9
|
+
const { children: i, ...c } = n, s = l.Children.toArray(i), f = s.find(R);
|
|
10
|
+
if (f) {
|
|
11
|
+
const p = f.props.children, m = s.map((u) => u === f ? l.Children.count(p) > 1 ? l.Children.only(null) : l.isValidElement(p) ? p.props.children : null : u);
|
|
12
|
+
return /* @__PURE__ */ d(r, { ...c, ref: t, children: l.isValidElement(p) ? l.cloneElement(p, void 0, m) : null });
|
|
13
|
+
}
|
|
14
|
+
return /* @__PURE__ */ d(r, { ...c, ref: t, children: i });
|
|
15
|
+
});
|
|
16
|
+
return o.displayName = `${e}.Slot`, o;
|
|
17
|
+
}
|
|
18
|
+
a(g, "createSlot");
|
|
19
|
+
var O = /* @__PURE__ */ g("Slot");
|
|
20
|
+
// @__NO_SIDE_EFFECTS__
|
|
21
|
+
function E(e) {
|
|
22
|
+
const r = l.forwardRef((o, n) => {
|
|
23
|
+
const { children: t, ...i } = o;
|
|
24
|
+
if (l.isValidElement(t)) {
|
|
25
|
+
const c = b(t), s = h(i, t.props);
|
|
26
|
+
return t.type !== l.Fragment && (s.ref = n ? S(n, c) : c), l.cloneElement(t, s);
|
|
27
|
+
}
|
|
28
|
+
return l.Children.count(t) > 1 ? l.Children.only(null) : null;
|
|
29
|
+
});
|
|
30
|
+
return r.displayName = `${e}.SlotClone`, r;
|
|
31
|
+
}
|
|
32
|
+
a(E, "createSlotClone");
|
|
33
|
+
var C = Symbol("radix.slottable");
|
|
34
|
+
function R(e) {
|
|
35
|
+
return l.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === C;
|
|
36
|
+
}
|
|
37
|
+
a(R, "isSlottable");
|
|
38
|
+
function h(e, r) {
|
|
39
|
+
const o = { ...r };
|
|
40
|
+
for (const n in r) {
|
|
41
|
+
const t = e[n], i = r[n];
|
|
42
|
+
/^on[A-Z]/.test(n) ? t && i ? o[n] = (...s) => {
|
|
43
|
+
const f = i(...s);
|
|
44
|
+
return t(...s), f;
|
|
45
|
+
} : t && (o[n] = t) : n === "style" ? o[n] = { ...t, ...i } : n === "className" && (o[n] = [t, i].filter(Boolean).join(" "));
|
|
46
|
+
}
|
|
47
|
+
return { ...e, ...o };
|
|
48
|
+
}
|
|
49
|
+
a(h, "mergeProps");
|
|
50
|
+
function b(e) {
|
|
51
|
+
var n, t;
|
|
52
|
+
let r = (n = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : n.get, o = r && "isReactWarning" in r && r.isReactWarning;
|
|
53
|
+
return o ? e.ref : (r = (t = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : t.get, o = r && "isReactWarning" in r && r.isReactWarning, o ? e.props.ref : e.props.ref || e.ref);
|
|
54
|
+
}
|
|
55
|
+
a(b, "getElementRef");
|
|
56
|
+
export {
|
|
57
|
+
O as Root,
|
|
58
|
+
O as Slot,
|
|
59
|
+
g as createSlot
|
|
60
|
+
};
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
var E = Object.defineProperty;
|
|
2
|
+
var b = (e, a) => E(e, "name", { value: a, configurable: !0 });
|
|
3
|
+
import * as v from "react";
|
|
4
|
+
import { composeEventHandlers as T } from "../../primitive/dist/index.js";
|
|
5
|
+
import { createContextScope as F } from "../../react-context/dist/index.js";
|
|
6
|
+
import { createRovingFocusGroupScope as h, Root as w, Item as D } from "../../react-roving-focus/dist/index.js";
|
|
7
|
+
import { Presence as V } from "../../react-presence/dist/index.js";
|
|
8
|
+
import { Primitive as p } from "../../react-primitive/dist/index.js";
|
|
9
|
+
import { useDirection as G } from "../../react-direction/dist/index.js";
|
|
10
|
+
import { useControllableState as L } from "../../react-use-controllable-state/dist/index.js";
|
|
11
|
+
import { useId as $ } from "../../react-id/dist/index.js";
|
|
12
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
13
|
+
var g = "Tabs", [k, X] = F(g, [
|
|
14
|
+
h
|
|
15
|
+
]), I = h(), [K, C] = k(g), R = v.forwardRef(
|
|
16
|
+
(e, a) => {
|
|
17
|
+
const {
|
|
18
|
+
__scopeTabs: s,
|
|
19
|
+
value: t,
|
|
20
|
+
onValueChange: n,
|
|
21
|
+
defaultValue: c,
|
|
22
|
+
orientation: o = "horizontal",
|
|
23
|
+
dir: d,
|
|
24
|
+
activationMode: f = "automatic",
|
|
25
|
+
...m
|
|
26
|
+
} = e, i = G(d), [r, u] = L({
|
|
27
|
+
prop: t,
|
|
28
|
+
onChange: n,
|
|
29
|
+
defaultProp: c ?? "",
|
|
30
|
+
caller: g
|
|
31
|
+
});
|
|
32
|
+
return /* @__PURE__ */ l(
|
|
33
|
+
K,
|
|
34
|
+
{
|
|
35
|
+
scope: s,
|
|
36
|
+
baseId: $(),
|
|
37
|
+
value: r,
|
|
38
|
+
onValueChange: u,
|
|
39
|
+
orientation: o,
|
|
40
|
+
dir: i,
|
|
41
|
+
activationMode: f,
|
|
42
|
+
children: /* @__PURE__ */ l(
|
|
43
|
+
p.div,
|
|
44
|
+
{
|
|
45
|
+
dir: i,
|
|
46
|
+
"data-orientation": o,
|
|
47
|
+
...m,
|
|
48
|
+
ref: a
|
|
49
|
+
}
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
R.displayName = g;
|
|
56
|
+
var _ = "TabsList", y = v.forwardRef(
|
|
57
|
+
(e, a) => {
|
|
58
|
+
const { __scopeTabs: s, loop: t = !0, ...n } = e, c = C(_, s), o = I(s);
|
|
59
|
+
return /* @__PURE__ */ l(
|
|
60
|
+
w,
|
|
61
|
+
{
|
|
62
|
+
asChild: !0,
|
|
63
|
+
...o,
|
|
64
|
+
orientation: c.orientation,
|
|
65
|
+
dir: c.dir,
|
|
66
|
+
loop: t,
|
|
67
|
+
children: /* @__PURE__ */ l(
|
|
68
|
+
p.div,
|
|
69
|
+
{
|
|
70
|
+
role: "tablist",
|
|
71
|
+
"aria-orientation": c.orientation,
|
|
72
|
+
...n,
|
|
73
|
+
ref: a
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
y.displayName = _;
|
|
81
|
+
var A = "TabsTrigger", S = v.forwardRef(
|
|
82
|
+
(e, a) => {
|
|
83
|
+
const { __scopeTabs: s, value: t, disabled: n = !1, ...c } = e, o = C(A, s), d = I(s), f = P(o.baseId, t), m = x(o.baseId, t), i = t === o.value;
|
|
84
|
+
return /* @__PURE__ */ l(
|
|
85
|
+
D,
|
|
86
|
+
{
|
|
87
|
+
asChild: !0,
|
|
88
|
+
...d,
|
|
89
|
+
focusable: !n,
|
|
90
|
+
active: i,
|
|
91
|
+
children: /* @__PURE__ */ l(
|
|
92
|
+
p.button,
|
|
93
|
+
{
|
|
94
|
+
type: "button",
|
|
95
|
+
role: "tab",
|
|
96
|
+
"aria-selected": i,
|
|
97
|
+
"aria-controls": m,
|
|
98
|
+
"data-state": i ? "active" : "inactive",
|
|
99
|
+
"data-disabled": n ? "" : void 0,
|
|
100
|
+
disabled: n,
|
|
101
|
+
id: f,
|
|
102
|
+
...c,
|
|
103
|
+
ref: a,
|
|
104
|
+
onMouseDown: T(e.onMouseDown, (r) => {
|
|
105
|
+
!n && r.button === 0 && r.ctrlKey === !1 ? o.onValueChange(t) : r.preventDefault();
|
|
106
|
+
}),
|
|
107
|
+
onKeyDown: T(e.onKeyDown, (r) => {
|
|
108
|
+
[" ", "Enter"].includes(r.key) && o.onValueChange(t);
|
|
109
|
+
}),
|
|
110
|
+
onFocus: T(e.onFocus, () => {
|
|
111
|
+
const r = o.activationMode !== "manual";
|
|
112
|
+
!i && !n && r && o.onValueChange(t);
|
|
113
|
+
})
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
S.displayName = A;
|
|
121
|
+
var M = "TabsContent", N = v.forwardRef(
|
|
122
|
+
(e, a) => {
|
|
123
|
+
const { __scopeTabs: s, value: t, forceMount: n, children: c, ...o } = e, d = C(M, s), f = P(d.baseId, t), m = x(d.baseId, t), i = t === d.value, r = v.useRef(i);
|
|
124
|
+
return v.useEffect(() => {
|
|
125
|
+
const u = requestAnimationFrame(() => r.current = !1);
|
|
126
|
+
return () => cancelAnimationFrame(u);
|
|
127
|
+
}, []), /* @__PURE__ */ l(V, { present: n || i, children: /* @__PURE__ */ b(({ present: u }) => /* @__PURE__ */ l(
|
|
128
|
+
p.div,
|
|
129
|
+
{
|
|
130
|
+
"data-state": i ? "active" : "inactive",
|
|
131
|
+
"data-orientation": d.orientation,
|
|
132
|
+
role: "tabpanel",
|
|
133
|
+
"aria-labelledby": f,
|
|
134
|
+
hidden: !u,
|
|
135
|
+
id: m,
|
|
136
|
+
tabIndex: 0,
|
|
137
|
+
...o,
|
|
138
|
+
ref: a,
|
|
139
|
+
style: {
|
|
140
|
+
...e.style,
|
|
141
|
+
animationDuration: r.current ? "0s" : void 0
|
|
142
|
+
},
|
|
143
|
+
children: u && c
|
|
144
|
+
}
|
|
145
|
+
), "children") });
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
N.displayName = M;
|
|
149
|
+
function P(e, a) {
|
|
150
|
+
return `${e}-trigger-${a}`;
|
|
151
|
+
}
|
|
152
|
+
b(P, "makeTriggerId");
|
|
153
|
+
function x(e, a) {
|
|
154
|
+
return `${e}-content-${a}`;
|
|
155
|
+
}
|
|
156
|
+
b(x, "makeContentId");
|
|
157
|
+
var Y = R, Z = y, ee = S, te = N;
|
|
158
|
+
export {
|
|
159
|
+
te as Content,
|
|
160
|
+
Z as List,
|
|
161
|
+
Y as Root,
|
|
162
|
+
R as Tabs,
|
|
163
|
+
N as TabsContent,
|
|
164
|
+
y as TabsList,
|
|
165
|
+
S as TabsTrigger,
|
|
166
|
+
ee as Trigger,
|
|
167
|
+
X as createTabsScope
|
|
168
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var s = Object.defineProperty;
|
|
2
|
+
var n = (r, e) => s(r, "name", { value: e, configurable: !0 });
|
|
3
|
+
import * as t from "react";
|
|
4
|
+
function c(r) {
|
|
5
|
+
const e = t.useRef(r);
|
|
6
|
+
return t.useEffect(() => {
|
|
7
|
+
e.current = r;
|
|
8
|
+
}), t.useMemo(() => (...o) => {
|
|
9
|
+
var u;
|
|
10
|
+
return (u = e.current) == null ? void 0 : u.call(e, ...o);
|
|
11
|
+
}, []);
|
|
12
|
+
}
|
|
13
|
+
n(c, "useCallbackRef");
|
|
14
|
+
export {
|
|
15
|
+
c as useCallbackRef
|
|
16
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
var E = Object.defineProperty;
|
|
2
|
+
var i = (t, r) => E(t, "name", { value: r, configurable: !0 });
|
|
3
|
+
import * as n from "react";
|
|
4
|
+
import { useLayoutEffect as w } from "../../react-use-layout-effect/dist/index.js";
|
|
5
|
+
var R = n[" useInsertionEffect ".trim().toString()] || w;
|
|
6
|
+
function I({
|
|
7
|
+
prop: t,
|
|
8
|
+
defaultProp: r,
|
|
9
|
+
onChange: o = /* @__PURE__ */ i(() => {
|
|
10
|
+
}, "onChange"),
|
|
11
|
+
caller: d
|
|
12
|
+
}) {
|
|
13
|
+
const [l, e, c] = S({
|
|
14
|
+
defaultProp: r,
|
|
15
|
+
onChange: o
|
|
16
|
+
}), s = t !== void 0, m = s ? t : l;
|
|
17
|
+
{
|
|
18
|
+
const u = n.useRef(t !== void 0);
|
|
19
|
+
n.useEffect(() => {
|
|
20
|
+
const f = u.current;
|
|
21
|
+
f !== s && console.warn(
|
|
22
|
+
`${d} is changing from ${f ? "controlled" : "uncontrolled"} to ${s ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
|
|
23
|
+
), u.current = s;
|
|
24
|
+
}, [s, d]);
|
|
25
|
+
}
|
|
26
|
+
const v = n.useCallback(
|
|
27
|
+
(u) => {
|
|
28
|
+
var f;
|
|
29
|
+
if (s) {
|
|
30
|
+
const a = b(u) ? u(t) : u;
|
|
31
|
+
a !== t && ((f = c.current) == null || f.call(c, a));
|
|
32
|
+
} else
|
|
33
|
+
e(u);
|
|
34
|
+
},
|
|
35
|
+
[s, t, e, c]
|
|
36
|
+
);
|
|
37
|
+
return [m, v];
|
|
38
|
+
}
|
|
39
|
+
i(I, "useControllableState");
|
|
40
|
+
function S({
|
|
41
|
+
defaultProp: t,
|
|
42
|
+
onChange: r
|
|
43
|
+
}) {
|
|
44
|
+
const [o, d] = n.useState(t), l = n.useRef(o), e = n.useRef(r);
|
|
45
|
+
return R(() => {
|
|
46
|
+
e.current = r;
|
|
47
|
+
}, [r]), n.useEffect(() => {
|
|
48
|
+
var c;
|
|
49
|
+
l.current !== o && ((c = e.current) == null || c.call(e, o), l.current = o);
|
|
50
|
+
}, [o, l]), [o, d, e];
|
|
51
|
+
}
|
|
52
|
+
i(S, "useUncontrolledState");
|
|
53
|
+
function b(t) {
|
|
54
|
+
return typeof t == "function";
|
|
55
|
+
}
|
|
56
|
+
i(b, "isFunction");
|
|
57
|
+
export {
|
|
58
|
+
I as useControllableState
|
|
59
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var s = Object.defineProperty;
|
|
2
|
+
var o = (t, e) => s(t, "name", { value: e, configurable: !0 });
|
|
3
|
+
import * as c from "react";
|
|
4
|
+
import { useCallbackRef as p } from "../../react-use-callback-ref/dist/index.js";
|
|
5
|
+
function f(t, e = globalThis == null ? void 0 : globalThis.document) {
|
|
6
|
+
const a = p(t);
|
|
7
|
+
c.useEffect(() => {
|
|
8
|
+
const n = /* @__PURE__ */ o((r) => {
|
|
9
|
+
r.key === "Escape" && a(r);
|
|
10
|
+
}, "handleKeyDown");
|
|
11
|
+
return e.addEventListener("keydown", n, { capture: !0 }), () => e.removeEventListener("keydown", n, { capture: !0 });
|
|
12
|
+
}, [a, e]);
|
|
13
|
+
}
|
|
14
|
+
o(f, "useEscapeKeydown");
|
|
15
|
+
export {
|
|
16
|
+
f as useEscapeKeydown
|
|
17
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var s = Object.defineProperty;
|
|
2
|
+
var r = (e, t) => s(e, "name", { value: t, configurable: !0 });
|
|
3
|
+
import { s as n } from "../../../../_virtual/index.js";
|
|
4
|
+
function a() {
|
|
5
|
+
return n.useSyncExternalStore(
|
|
6
|
+
u,
|
|
7
|
+
() => !0,
|
|
8
|
+
() => !1
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
r(a, "useIsHydrated");
|
|
12
|
+
function u() {
|
|
13
|
+
return () => {
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
r(u, "subscribe");
|
|
17
|
+
export {
|
|
18
|
+
a as useIsHydrated
|
|
19
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var n = Object.defineProperty;
|
|
2
|
+
var u = (r, e) => n(r, "name", { value: e, configurable: !0 });
|
|
3
|
+
import * as t from "react";
|
|
4
|
+
function s(r) {
|
|
5
|
+
const e = t.useRef({ value: r, previous: r });
|
|
6
|
+
return t.useMemo(() => (e.current.value !== r && (e.current.previous = e.current.value, e.current.value = r), e.current.previous), [r]);
|
|
7
|
+
}
|
|
8
|
+
u(s, "usePrevious");
|
|
9
|
+
export {
|
|
10
|
+
s as usePrevious
|
|
11
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var z = Object.defineProperty;
|
|
2
|
+
var h = (r, e) => z(r, "name", { value: e, configurable: !0 });
|
|
3
|
+
import * as a from "react";
|
|
4
|
+
import { useLayoutEffect as c } from "../../react-use-layout-effect/dist/index.js";
|
|
5
|
+
function y(r) {
|
|
6
|
+
const [e, i] = a.useState(void 0);
|
|
7
|
+
return c(() => {
|
|
8
|
+
if (r) {
|
|
9
|
+
i({ width: r.offsetWidth, height: r.offsetHeight });
|
|
10
|
+
const b = new ResizeObserver((o) => {
|
|
11
|
+
if (!Array.isArray(o) || !o.length)
|
|
12
|
+
return;
|
|
13
|
+
const u = o[0];
|
|
14
|
+
let t, s;
|
|
15
|
+
if ("borderBoxSize" in u) {
|
|
16
|
+
const f = u.borderBoxSize, d = Array.isArray(f) ? f[0] : f;
|
|
17
|
+
t = d.inlineSize, s = d.blockSize;
|
|
18
|
+
} else
|
|
19
|
+
t = r.offsetWidth, s = r.offsetHeight;
|
|
20
|
+
i({ width: t, height: s });
|
|
21
|
+
});
|
|
22
|
+
return b.observe(r, { box: "border-box" }), () => b.unobserve(r);
|
|
23
|
+
} else
|
|
24
|
+
i(void 0);
|
|
25
|
+
}, [r]), e;
|
|
26
|
+
}
|
|
27
|
+
h(y, "useSize");
|
|
28
|
+
export {
|
|
29
|
+
y as useSize
|
|
30
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
var D = Object.defineProperty;
|
|
2
|
+
var i = (r, u) => D(r, "name", { value: u, configurable: !0 });
|
|
3
|
+
var E = /* @__PURE__ */ i(function(r) {
|
|
4
|
+
if (typeof document > "u")
|
|
5
|
+
return null;
|
|
6
|
+
var u = Array.isArray(r) ? r[0] : r;
|
|
7
|
+
return u.ownerDocument.body;
|
|
8
|
+
}, "getDefaultParent"), c = /* @__PURE__ */ new WeakMap(), p = /* @__PURE__ */ new WeakMap(), h = {}, l = 0, b = /* @__PURE__ */ i(function(r) {
|
|
9
|
+
return r && (r.host || b(r.parentNode));
|
|
10
|
+
}, "unwrapHost"), C = /* @__PURE__ */ i(function(r, u) {
|
|
11
|
+
return u.map(function(e) {
|
|
12
|
+
if (r.contains(e))
|
|
13
|
+
return e;
|
|
14
|
+
var n = b(e);
|
|
15
|
+
return n && r.contains(n) ? n : (console.error("aria-hidden", e, "in not contained inside", r, ". Doing nothing"), null);
|
|
16
|
+
}).filter(function(e) {
|
|
17
|
+
return !!e;
|
|
18
|
+
});
|
|
19
|
+
}, "correctTargets"), O = /* @__PURE__ */ i(function(r, u, e, n) {
|
|
20
|
+
var f = C(u, Array.isArray(r) ? r : [r]);
|
|
21
|
+
h[e] || (h[e] = /* @__PURE__ */ new WeakMap());
|
|
22
|
+
var o = h[e], y = [], v = /* @__PURE__ */ new Set(), k = new Set(f), A = /* @__PURE__ */ i(function(t) {
|
|
23
|
+
!t || v.has(t) || (v.add(t), A(t.parentNode));
|
|
24
|
+
}, "keep");
|
|
25
|
+
f.forEach(A);
|
|
26
|
+
var w = /* @__PURE__ */ i(function(t) {
|
|
27
|
+
!t || k.has(t) || Array.prototype.forEach.call(t.children, function(a) {
|
|
28
|
+
if (v.has(a))
|
|
29
|
+
w(a);
|
|
30
|
+
else
|
|
31
|
+
try {
|
|
32
|
+
var s = a.getAttribute(n), d = s !== null && s !== "false", M = (c.get(a) || 0) + 1, W = (o.get(a) || 0) + 1;
|
|
33
|
+
c.set(a, M), o.set(a, W), y.push(a), M === 1 && d && p.set(a, !0), W === 1 && a.setAttribute(e, "true"), d || a.setAttribute(n, "true");
|
|
34
|
+
} catch (S) {
|
|
35
|
+
console.error("aria-hidden: cannot operate on ", a, S);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}, "deep");
|
|
39
|
+
return w(u), v.clear(), l++, function() {
|
|
40
|
+
y.forEach(function(t) {
|
|
41
|
+
var a = c.get(t) - 1, s = o.get(t) - 1;
|
|
42
|
+
c.set(t, a), o.set(t, s), a || (p.has(t) || t.removeAttribute(n), p.delete(t)), s || t.removeAttribute(e);
|
|
43
|
+
}), l--, l || (c = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), p = /* @__PURE__ */ new WeakMap(), h = {});
|
|
44
|
+
};
|
|
45
|
+
}, "applyAttributeToOthers"), q = /* @__PURE__ */ i(function(r, u, e) {
|
|
46
|
+
e === void 0 && (e = "data-aria-hidden");
|
|
47
|
+
var n = Array.from(Array.isArray(r) ? r : [r]), f = E(r);
|
|
48
|
+
return f ? (n.push.apply(n, Array.from(f.querySelectorAll("[aria-live], script"))), O(n, f, e, "aria-hidden")) : function() {
|
|
49
|
+
return null;
|
|
50
|
+
};
|
|
51
|
+
}, "hideOthers");
|
|
52
|
+
export {
|
|
53
|
+
q as hideOthers
|
|
54
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { __assign as m } from "../../../tslib/tslib.es6.js";
|
|
2
|
+
import * as r from "react";
|
|
3
|
+
import { RemoveScroll as e } from "./UI.js";
|
|
4
|
+
import t from "./sidecar.js";
|
|
5
|
+
var s = r.forwardRef(function(a, o) {
|
|
6
|
+
return r.createElement(e, m({}, a, { ref: o, sideCar: t }));
|
|
7
|
+
});
|
|
8
|
+
s.classNames = e.classNames;
|
|
9
|
+
export {
|
|
10
|
+
s as default
|
|
11
|
+
};
|