@openfeed-ink/widget 0.1.3
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/LICENSE +661 -0
- package/README.md +141 -0
- package/dist/npm/AnnouncementBanner-BPo8Jmax.js +75 -0
- package/dist/npm/App.d.ts +5 -0
- package/dist/npm/ChangelogTab-DBQ5Ip6K.js +18 -0
- package/dist/npm/DrawerType-D9YHimv7.js +1184 -0
- package/dist/npm/FeatureDialog-BU1c2n3F.js +31 -0
- package/dist/npm/FeedbackTab-V7VCrze1.js +71 -0
- package/dist/npm/Main.d.ts +5 -0
- package/dist/npm/PopoverType-DlyRog2q.js +1863 -0
- package/dist/npm/RoadmapTab-DOYJBpgd.js +18 -0
- package/dist/npm/WidgetContent-Bs4eY5OF.js +507 -0
- package/dist/npm/button-Q2Dh1yK6.js +3086 -0
- package/dist/npm/components/AnnouncementBanner.d.ts +4 -0
- package/dist/npm/components/ChangelogTab.d.ts +6 -0
- package/dist/npm/components/FeatureDialog.d.ts +5 -0
- package/dist/npm/components/FeedbackTab.d.ts +8 -0
- package/dist/npm/components/NewFeedback.d.ts +9 -0
- package/dist/npm/components/RoadmapTab.d.ts +6 -0
- package/dist/npm/components/WidgetContent.d.ts +8 -0
- package/dist/npm/components/theme-provider.d.ts +8 -0
- package/dist/npm/components/triggerType/DrawerType.d.ts +11 -0
- package/dist/npm/components/triggerType/PopoverType.d.ts +11 -0
- package/dist/npm/components/ui/button.d.ts +10 -0
- package/dist/npm/components/ui/dialog.d.ts +11 -0
- package/dist/npm/components/ui/drawer.d.ts +10 -0
- package/dist/npm/components/ui/popover.d.ts +7 -0
- package/dist/npm/components/ui/tabs.d.ts +11 -0
- package/dist/npm/context/outsideEvent.d.ts +17 -0
- package/dist/npm/context/shadow-root.d.ts +5 -0
- package/dist/npm/dialog-5J_RZfbt.js +107 -0
- package/dist/npm/hooks/use-local-storage.d.ts +1 -0
- package/dist/npm/index-BaBFRQOq.js +1043 -0
- package/dist/npm/index-BkmaVINv.js +334 -0
- package/dist/npm/index-MTTUickr.js +237 -0
- package/dist/npm/index.d.ts +2 -0
- package/dist/npm/index.js +6 -0
- package/dist/npm/lib/utils.d.ts +2 -0
- package/dist/npm/mount.d.ts +7 -0
- package/dist/npm/react/OpenFeed.d.ts +7 -0
- package/dist/npm/types/index.d.ts +31 -0
- package/dist/npm/x-BkA0RvhX.js +9 -0
- package/package.json +95 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import { u as s } from "./index-BkmaVINv.js";
|
|
4
|
+
function d(e) {
|
|
5
|
+
const { iframeKey: r, ready: l, setReady: t } = s();
|
|
6
|
+
return /* @__PURE__ */ a("div", { className: "flex h-full w-full", children: /* @__PURE__ */ a(
|
|
7
|
+
"iframe",
|
|
8
|
+
{
|
|
9
|
+
src: `${e.apiUrl}/pub/${e.projectId}/roadmap?theme=${e.theme}`,
|
|
10
|
+
className: "h-full w-full border-0",
|
|
11
|
+
onLoad: () => !l && t(!0)
|
|
12
|
+
},
|
|
13
|
+
r
|
|
14
|
+
) });
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
d as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,507 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as n, jsxs as z } from "react/jsx-runtime";
|
|
3
|
+
import { u as O, a as $, c as M, b as pe } from "./button-Q2Dh1yK6.js";
|
|
4
|
+
import * as l from "react";
|
|
5
|
+
import S, { useMemo as ve, Suspense as be, lazy as G } from "react";
|
|
6
|
+
import { c as U, d as j, P as w, e as R, b as B, a as me, f as ge } from "./index-BaBFRQOq.js";
|
|
7
|
+
function he(e) {
|
|
8
|
+
const t = e + "CollectionProvider", [r, o] = U(t), [f, a] = r(
|
|
9
|
+
t,
|
|
10
|
+
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
11
|
+
), c = (I) => {
|
|
12
|
+
const { scope: i, children: m } = I, T = S.useRef(null), d = S.useRef(/* @__PURE__ */ new Map()).current;
|
|
13
|
+
return /* @__PURE__ */ n(f, { scope: i, itemMap: d, collectionRef: T, children: m });
|
|
14
|
+
};
|
|
15
|
+
c.displayName = t;
|
|
16
|
+
const p = e + "CollectionSlot", C = $(p), b = S.forwardRef(
|
|
17
|
+
(I, i) => {
|
|
18
|
+
const { scope: m, children: T } = I, d = a(p, m), v = O(i, d.collectionRef);
|
|
19
|
+
return /* @__PURE__ */ n(C, { ref: v, children: T });
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
b.displayName = p;
|
|
23
|
+
const s = e + "CollectionItemSlot", u = "data-radix-collection-item", g = $(s), x = S.forwardRef(
|
|
24
|
+
(I, i) => {
|
|
25
|
+
const { scope: m, children: T, ...d } = I, v = S.useRef(null), E = O(i, v), _ = a(s, m);
|
|
26
|
+
return S.useEffect(() => (_.itemMap.set(v, { ref: v, ...d }), () => {
|
|
27
|
+
_.itemMap.delete(v);
|
|
28
|
+
})), /* @__PURE__ */ n(g, { [u]: "", ref: E, children: T });
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
x.displayName = s;
|
|
32
|
+
function y(I) {
|
|
33
|
+
const i = a(e + "CollectionConsumer", I);
|
|
34
|
+
return S.useCallback(() => {
|
|
35
|
+
const T = i.collectionRef.current;
|
|
36
|
+
if (!T) return [];
|
|
37
|
+
const d = Array.from(T.querySelectorAll(`[${u}]`));
|
|
38
|
+
return Array.from(i.itemMap.values()).sort(
|
|
39
|
+
(_, N) => d.indexOf(_.ref.current) - d.indexOf(N.ref.current)
|
|
40
|
+
);
|
|
41
|
+
}, [i.collectionRef, i.itemMap]);
|
|
42
|
+
}
|
|
43
|
+
return [
|
|
44
|
+
{ Provider: c, Slot: b, ItemSlot: x },
|
|
45
|
+
y,
|
|
46
|
+
o
|
|
47
|
+
];
|
|
48
|
+
}
|
|
49
|
+
var Ie = l.createContext(void 0);
|
|
50
|
+
function Y(e) {
|
|
51
|
+
const t = l.useContext(Ie);
|
|
52
|
+
return e || t || "ltr";
|
|
53
|
+
}
|
|
54
|
+
var D = "rovingFocusGroup.onEntryFocus", Te = { bubbles: !1, cancelable: !0 }, A = "RovingFocusGroup", [L, q, Ce] = he(A), [Re, H] = U(
|
|
55
|
+
A,
|
|
56
|
+
[Ce]
|
|
57
|
+
), [xe, Fe] = Re(A), W = l.forwardRef(
|
|
58
|
+
(e, t) => /* @__PURE__ */ n(L.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ n(L.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ n(Se, { ...e, ref: t }) }) })
|
|
59
|
+
);
|
|
60
|
+
W.displayName = A;
|
|
61
|
+
var Se = l.forwardRef((e, t) => {
|
|
62
|
+
const {
|
|
63
|
+
__scopeRovingFocusGroup: r,
|
|
64
|
+
orientation: o,
|
|
65
|
+
loop: f = !1,
|
|
66
|
+
dir: a,
|
|
67
|
+
currentTabStopId: c,
|
|
68
|
+
defaultCurrentTabStopId: p,
|
|
69
|
+
onCurrentTabStopIdChange: C,
|
|
70
|
+
onEntryFocus: b,
|
|
71
|
+
preventScrollOnEntryFocus: s = !1,
|
|
72
|
+
...u
|
|
73
|
+
} = e, g = l.useRef(null), x = O(t, g), y = Y(a), [I, i] = B({
|
|
74
|
+
prop: c,
|
|
75
|
+
defaultProp: p ?? null,
|
|
76
|
+
onChange: C,
|
|
77
|
+
caller: A
|
|
78
|
+
}), [m, T] = l.useState(!1), d = me(b), v = q(r), E = l.useRef(!1), [_, N] = l.useState(0);
|
|
79
|
+
return l.useEffect(() => {
|
|
80
|
+
const h = g.current;
|
|
81
|
+
if (h)
|
|
82
|
+
return h.addEventListener(D, d), () => h.removeEventListener(D, d);
|
|
83
|
+
}, [d]), /* @__PURE__ */ n(
|
|
84
|
+
xe,
|
|
85
|
+
{
|
|
86
|
+
scope: r,
|
|
87
|
+
orientation: o,
|
|
88
|
+
dir: y,
|
|
89
|
+
loop: f,
|
|
90
|
+
currentTabStopId: I,
|
|
91
|
+
onItemFocus: l.useCallback(
|
|
92
|
+
(h) => i(h),
|
|
93
|
+
[i]
|
|
94
|
+
),
|
|
95
|
+
onItemShiftTab: l.useCallback(() => T(!0), []),
|
|
96
|
+
onFocusableItemAdd: l.useCallback(
|
|
97
|
+
() => N((h) => h + 1),
|
|
98
|
+
[]
|
|
99
|
+
),
|
|
100
|
+
onFocusableItemRemove: l.useCallback(
|
|
101
|
+
() => N((h) => h - 1),
|
|
102
|
+
[]
|
|
103
|
+
),
|
|
104
|
+
children: /* @__PURE__ */ n(
|
|
105
|
+
w.div,
|
|
106
|
+
{
|
|
107
|
+
tabIndex: m || _ === 0 ? -1 : 0,
|
|
108
|
+
"data-orientation": o,
|
|
109
|
+
...u,
|
|
110
|
+
ref: x,
|
|
111
|
+
style: { outline: "none", ...e.style },
|
|
112
|
+
onMouseDown: R(e.onMouseDown, () => {
|
|
113
|
+
E.current = !0;
|
|
114
|
+
}),
|
|
115
|
+
onFocus: R(e.onFocus, (h) => {
|
|
116
|
+
const le = !E.current;
|
|
117
|
+
if (h.target === h.currentTarget && le && !m) {
|
|
118
|
+
const V = new CustomEvent(D, Te);
|
|
119
|
+
if (h.currentTarget.dispatchEvent(V), !V.defaultPrevented) {
|
|
120
|
+
const k = v().filter((F) => F.focusable), ue = k.find((F) => F.active), de = k.find((F) => F.id === I), fe = [ue, de, ...k].filter(
|
|
121
|
+
Boolean
|
|
122
|
+
).map((F) => F.ref.current);
|
|
123
|
+
X(fe, s);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
E.current = !1;
|
|
127
|
+
}),
|
|
128
|
+
onBlur: R(e.onBlur, () => T(!1))
|
|
129
|
+
}
|
|
130
|
+
)
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
}), J = "RovingFocusGroupItem", Q = l.forwardRef(
|
|
134
|
+
(e, t) => {
|
|
135
|
+
const {
|
|
136
|
+
__scopeRovingFocusGroup: r,
|
|
137
|
+
focusable: o = !0,
|
|
138
|
+
active: f = !1,
|
|
139
|
+
tabStopId: a,
|
|
140
|
+
children: c,
|
|
141
|
+
...p
|
|
142
|
+
} = e, C = j(), b = a || C, s = Fe(J, r), u = s.currentTabStopId === b, g = q(r), { onFocusableItemAdd: x, onFocusableItemRemove: y, currentTabStopId: I } = s;
|
|
143
|
+
return l.useEffect(() => {
|
|
144
|
+
if (o)
|
|
145
|
+
return x(), () => y();
|
|
146
|
+
}, [o, x, y]), /* @__PURE__ */ n(
|
|
147
|
+
L.ItemSlot,
|
|
148
|
+
{
|
|
149
|
+
scope: r,
|
|
150
|
+
id: b,
|
|
151
|
+
focusable: o,
|
|
152
|
+
active: f,
|
|
153
|
+
children: /* @__PURE__ */ n(
|
|
154
|
+
w.span,
|
|
155
|
+
{
|
|
156
|
+
tabIndex: u ? 0 : -1,
|
|
157
|
+
"data-orientation": s.orientation,
|
|
158
|
+
...p,
|
|
159
|
+
ref: t,
|
|
160
|
+
onMouseDown: R(e.onMouseDown, (i) => {
|
|
161
|
+
o ? s.onItemFocus(b) : i.preventDefault();
|
|
162
|
+
}),
|
|
163
|
+
onFocus: R(e.onFocus, () => s.onItemFocus(b)),
|
|
164
|
+
onKeyDown: R(e.onKeyDown, (i) => {
|
|
165
|
+
if (i.key === "Tab" && i.shiftKey) {
|
|
166
|
+
s.onItemShiftTab();
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
if (i.target !== i.currentTarget) return;
|
|
170
|
+
const m = _e(i, s.orientation, s.dir);
|
|
171
|
+
if (m !== void 0) {
|
|
172
|
+
if (i.metaKey || i.ctrlKey || i.altKey || i.shiftKey) return;
|
|
173
|
+
i.preventDefault();
|
|
174
|
+
let d = g().filter((v) => v.focusable).map((v) => v.ref.current);
|
|
175
|
+
if (m === "last") d.reverse();
|
|
176
|
+
else if (m === "prev" || m === "next") {
|
|
177
|
+
m === "prev" && d.reverse();
|
|
178
|
+
const v = d.indexOf(i.currentTarget);
|
|
179
|
+
d = s.loop ? we(d, v + 1) : d.slice(v + 1);
|
|
180
|
+
}
|
|
181
|
+
setTimeout(() => X(d));
|
|
182
|
+
}
|
|
183
|
+
}),
|
|
184
|
+
children: typeof c == "function" ? c({ isCurrentTabStop: u, hasTabStop: I != null }) : c
|
|
185
|
+
}
|
|
186
|
+
)
|
|
187
|
+
}
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
);
|
|
191
|
+
Q.displayName = J;
|
|
192
|
+
var ye = {
|
|
193
|
+
ArrowLeft: "prev",
|
|
194
|
+
ArrowUp: "prev",
|
|
195
|
+
ArrowRight: "next",
|
|
196
|
+
ArrowDown: "next",
|
|
197
|
+
PageUp: "first",
|
|
198
|
+
Home: "first",
|
|
199
|
+
PageDown: "last",
|
|
200
|
+
End: "last"
|
|
201
|
+
};
|
|
202
|
+
function Ee(e, t) {
|
|
203
|
+
return t !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
|
|
204
|
+
}
|
|
205
|
+
function _e(e, t, r) {
|
|
206
|
+
const o = Ee(e.key, r);
|
|
207
|
+
if (!(t === "vertical" && ["ArrowLeft", "ArrowRight"].includes(o)) && !(t === "horizontal" && ["ArrowUp", "ArrowDown"].includes(o)))
|
|
208
|
+
return ye[o];
|
|
209
|
+
}
|
|
210
|
+
function X(e, t = !1) {
|
|
211
|
+
const r = document.activeElement;
|
|
212
|
+
for (const o of e)
|
|
213
|
+
if (o === r || (o.focus({ preventScroll: t }), document.activeElement !== r)) return;
|
|
214
|
+
}
|
|
215
|
+
function we(e, t) {
|
|
216
|
+
return e.map((r, o) => e[(t + o) % e.length]);
|
|
217
|
+
}
|
|
218
|
+
var Ae = W, Ne = Q, P = "Tabs", [Me] = U(P, [
|
|
219
|
+
H
|
|
220
|
+
]), Z = H(), [Pe, K] = Me(P), ee = l.forwardRef(
|
|
221
|
+
(e, t) => {
|
|
222
|
+
const {
|
|
223
|
+
__scopeTabs: r,
|
|
224
|
+
value: o,
|
|
225
|
+
onValueChange: f,
|
|
226
|
+
defaultValue: a,
|
|
227
|
+
orientation: c = "horizontal",
|
|
228
|
+
dir: p,
|
|
229
|
+
activationMode: C = "automatic",
|
|
230
|
+
...b
|
|
231
|
+
} = e, s = Y(p), [u, g] = B({
|
|
232
|
+
prop: o,
|
|
233
|
+
onChange: f,
|
|
234
|
+
defaultProp: a ?? "",
|
|
235
|
+
caller: P
|
|
236
|
+
});
|
|
237
|
+
return /* @__PURE__ */ n(
|
|
238
|
+
Pe,
|
|
239
|
+
{
|
|
240
|
+
scope: r,
|
|
241
|
+
baseId: j(),
|
|
242
|
+
value: u,
|
|
243
|
+
onValueChange: g,
|
|
244
|
+
orientation: c,
|
|
245
|
+
dir: s,
|
|
246
|
+
activationMode: C,
|
|
247
|
+
children: /* @__PURE__ */ n(
|
|
248
|
+
w.div,
|
|
249
|
+
{
|
|
250
|
+
dir: s,
|
|
251
|
+
"data-orientation": c,
|
|
252
|
+
...b,
|
|
253
|
+
ref: t
|
|
254
|
+
}
|
|
255
|
+
)
|
|
256
|
+
}
|
|
257
|
+
);
|
|
258
|
+
}
|
|
259
|
+
);
|
|
260
|
+
ee.displayName = P;
|
|
261
|
+
var te = "TabsList", oe = l.forwardRef(
|
|
262
|
+
(e, t) => {
|
|
263
|
+
const { __scopeTabs: r, loop: o = !0, ...f } = e, a = K(te, r), c = Z(r);
|
|
264
|
+
return /* @__PURE__ */ n(
|
|
265
|
+
Ae,
|
|
266
|
+
{
|
|
267
|
+
asChild: !0,
|
|
268
|
+
...c,
|
|
269
|
+
orientation: a.orientation,
|
|
270
|
+
dir: a.dir,
|
|
271
|
+
loop: o,
|
|
272
|
+
children: /* @__PURE__ */ n(
|
|
273
|
+
w.div,
|
|
274
|
+
{
|
|
275
|
+
role: "tablist",
|
|
276
|
+
"aria-orientation": a.orientation,
|
|
277
|
+
...f,
|
|
278
|
+
ref: t
|
|
279
|
+
}
|
|
280
|
+
)
|
|
281
|
+
}
|
|
282
|
+
);
|
|
283
|
+
}
|
|
284
|
+
);
|
|
285
|
+
oe.displayName = te;
|
|
286
|
+
var re = "TabsTrigger", ae = l.forwardRef(
|
|
287
|
+
(e, t) => {
|
|
288
|
+
const { __scopeTabs: r, value: o, disabled: f = !1, ...a } = e, c = K(re, r), p = Z(r), C = ie(c.baseId, o), b = ce(c.baseId, o), s = o === c.value;
|
|
289
|
+
return /* @__PURE__ */ n(
|
|
290
|
+
Ne,
|
|
291
|
+
{
|
|
292
|
+
asChild: !0,
|
|
293
|
+
...p,
|
|
294
|
+
focusable: !f,
|
|
295
|
+
active: s,
|
|
296
|
+
children: /* @__PURE__ */ n(
|
|
297
|
+
w.button,
|
|
298
|
+
{
|
|
299
|
+
type: "button",
|
|
300
|
+
role: "tab",
|
|
301
|
+
"aria-selected": s,
|
|
302
|
+
"aria-controls": b,
|
|
303
|
+
"data-state": s ? "active" : "inactive",
|
|
304
|
+
"data-disabled": f ? "" : void 0,
|
|
305
|
+
disabled: f,
|
|
306
|
+
id: C,
|
|
307
|
+
...a,
|
|
308
|
+
ref: t,
|
|
309
|
+
onMouseDown: R(e.onMouseDown, (u) => {
|
|
310
|
+
!f && u.button === 0 && u.ctrlKey === !1 ? c.onValueChange(o) : u.preventDefault();
|
|
311
|
+
}),
|
|
312
|
+
onKeyDown: R(e.onKeyDown, (u) => {
|
|
313
|
+
[" ", "Enter"].includes(u.key) && c.onValueChange(o);
|
|
314
|
+
}),
|
|
315
|
+
onFocus: R(e.onFocus, () => {
|
|
316
|
+
const u = c.activationMode !== "manual";
|
|
317
|
+
!s && !f && u && c.onValueChange(o);
|
|
318
|
+
})
|
|
319
|
+
}
|
|
320
|
+
)
|
|
321
|
+
}
|
|
322
|
+
);
|
|
323
|
+
}
|
|
324
|
+
);
|
|
325
|
+
ae.displayName = re;
|
|
326
|
+
var ne = "TabsContent", se = l.forwardRef(
|
|
327
|
+
(e, t) => {
|
|
328
|
+
const { __scopeTabs: r, value: o, forceMount: f, children: a, ...c } = e, p = K(ne, r), C = ie(p.baseId, o), b = ce(p.baseId, o), s = o === p.value, u = l.useRef(s);
|
|
329
|
+
return l.useEffect(() => {
|
|
330
|
+
const g = requestAnimationFrame(() => u.current = !1);
|
|
331
|
+
return () => cancelAnimationFrame(g);
|
|
332
|
+
}, []), /* @__PURE__ */ n(ge, { present: f || s, children: ({ present: g }) => /* @__PURE__ */ n(
|
|
333
|
+
w.div,
|
|
334
|
+
{
|
|
335
|
+
"data-state": s ? "active" : "inactive",
|
|
336
|
+
"data-orientation": p.orientation,
|
|
337
|
+
role: "tabpanel",
|
|
338
|
+
"aria-labelledby": C,
|
|
339
|
+
hidden: !g,
|
|
340
|
+
id: b,
|
|
341
|
+
tabIndex: 0,
|
|
342
|
+
...c,
|
|
343
|
+
ref: t,
|
|
344
|
+
style: {
|
|
345
|
+
...e.style,
|
|
346
|
+
animationDuration: u.current ? "0s" : void 0
|
|
347
|
+
},
|
|
348
|
+
children: g && a
|
|
349
|
+
}
|
|
350
|
+
) });
|
|
351
|
+
}
|
|
352
|
+
);
|
|
353
|
+
se.displayName = ne;
|
|
354
|
+
function ie(e, t) {
|
|
355
|
+
return `${e}-trigger-${t}`;
|
|
356
|
+
}
|
|
357
|
+
function ce(e, t) {
|
|
358
|
+
return `${e}-content-${t}`;
|
|
359
|
+
}
|
|
360
|
+
var ke = ee, De = oe, Oe = ae, Le = se;
|
|
361
|
+
function Ge({
|
|
362
|
+
className: e,
|
|
363
|
+
orientation: t = "horizontal",
|
|
364
|
+
...r
|
|
365
|
+
}) {
|
|
366
|
+
return /* @__PURE__ */ n(
|
|
367
|
+
ke,
|
|
368
|
+
{
|
|
369
|
+
"data-slot": "tabs",
|
|
370
|
+
"data-orientation": t,
|
|
371
|
+
className: M(
|
|
372
|
+
"group/tabs flex gap-2 data-horizontal:flex-col",
|
|
373
|
+
e
|
|
374
|
+
),
|
|
375
|
+
...r
|
|
376
|
+
}
|
|
377
|
+
);
|
|
378
|
+
}
|
|
379
|
+
const Ue = pe(
|
|
380
|
+
"group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",
|
|
381
|
+
{
|
|
382
|
+
variants: {
|
|
383
|
+
variant: {
|
|
384
|
+
default: "bg-muted",
|
|
385
|
+
line: "gap-1 bg-transparent"
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
defaultVariants: {
|
|
389
|
+
variant: "default"
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
);
|
|
393
|
+
function Ke({
|
|
394
|
+
className: e,
|
|
395
|
+
variant: t = "default",
|
|
396
|
+
...r
|
|
397
|
+
}) {
|
|
398
|
+
return /* @__PURE__ */ n(
|
|
399
|
+
De,
|
|
400
|
+
{
|
|
401
|
+
"data-slot": "tabs-list",
|
|
402
|
+
"data-variant": t,
|
|
403
|
+
className: M(Ue({ variant: t }), e),
|
|
404
|
+
...r
|
|
405
|
+
}
|
|
406
|
+
);
|
|
407
|
+
}
|
|
408
|
+
function Ve({
|
|
409
|
+
className: e,
|
|
410
|
+
...t
|
|
411
|
+
}) {
|
|
412
|
+
return /* @__PURE__ */ n(
|
|
413
|
+
Oe,
|
|
414
|
+
{
|
|
415
|
+
"data-slot": "tabs-trigger",
|
|
416
|
+
className: M(
|
|
417
|
+
"relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
418
|
+
"group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent",
|
|
419
|
+
"data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground",
|
|
420
|
+
"after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:-bottom-1.25 group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",
|
|
421
|
+
e
|
|
422
|
+
),
|
|
423
|
+
...t
|
|
424
|
+
}
|
|
425
|
+
);
|
|
426
|
+
}
|
|
427
|
+
function ze({
|
|
428
|
+
className: e,
|
|
429
|
+
...t
|
|
430
|
+
}) {
|
|
431
|
+
return /* @__PURE__ */ n(
|
|
432
|
+
Le,
|
|
433
|
+
{
|
|
434
|
+
"data-slot": "tabs-content",
|
|
435
|
+
className: M("flex-1 text-sm outline-none", e),
|
|
436
|
+
...t
|
|
437
|
+
}
|
|
438
|
+
);
|
|
439
|
+
}
|
|
440
|
+
const $e = G(() => import("./FeedbackTab-V7VCrze1.js")), je = G(() => import("./ChangelogTab-DBQ5Ip6K.js")), Be = G(() => import("./RoadmapTab-DOYJBpgd.js"));
|
|
441
|
+
function Qe({
|
|
442
|
+
config: e,
|
|
443
|
+
widgetConfig: t,
|
|
444
|
+
isDrawer: r
|
|
445
|
+
}) {
|
|
446
|
+
const o = ve(() => {
|
|
447
|
+
const a = [];
|
|
448
|
+
return e.showFeedback && a.push("feedback"), e.showRoadmap && a.push("roadmap"), e.showChangeLog && a.push("changelog"), a;
|
|
449
|
+
}, [e]), f = {
|
|
450
|
+
1: "grid-cols-1",
|
|
451
|
+
2: "grid-cols-2",
|
|
452
|
+
3: "grid-cols-3"
|
|
453
|
+
};
|
|
454
|
+
return /* @__PURE__ */ z(Ge, { defaultValue: o[0], className: "flex h-full flex-col", children: [
|
|
455
|
+
/* @__PURE__ */ n(Ke, { className: `grid w-full ${f[o.length]}`, children: o.map((a) => /* @__PURE__ */ n(
|
|
456
|
+
Ve,
|
|
457
|
+
{
|
|
458
|
+
value: a,
|
|
459
|
+
className: "capitalize",
|
|
460
|
+
children: a
|
|
461
|
+
},
|
|
462
|
+
`trigger-${a}`
|
|
463
|
+
)) }),
|
|
464
|
+
o.map((a) => /* @__PURE__ */ n(
|
|
465
|
+
ze,
|
|
466
|
+
{
|
|
467
|
+
value: a,
|
|
468
|
+
className: "min-h-0 flex-1",
|
|
469
|
+
children: /* @__PURE__ */ z(be, { fallback: null, children: [
|
|
470
|
+
a === "feedback" && /* @__PURE__ */ n(
|
|
471
|
+
$e,
|
|
472
|
+
{
|
|
473
|
+
textColor: e.triggerBtn.textColor,
|
|
474
|
+
bgColor: e.triggerBtn.color,
|
|
475
|
+
projectId: t.projectId,
|
|
476
|
+
apiUrl: t.apiUrl,
|
|
477
|
+
isDrawer: r,
|
|
478
|
+
theme: e.theme
|
|
479
|
+
}
|
|
480
|
+
),
|
|
481
|
+
a === "changelog" && /* @__PURE__ */ n(
|
|
482
|
+
je,
|
|
483
|
+
{
|
|
484
|
+
apiUrl: t.apiUrl,
|
|
485
|
+
projectId: t.projectId,
|
|
486
|
+
theme: e.theme,
|
|
487
|
+
isDrawer: r
|
|
488
|
+
}
|
|
489
|
+
),
|
|
490
|
+
a === "roadmap" && /* @__PURE__ */ n(
|
|
491
|
+
Be,
|
|
492
|
+
{
|
|
493
|
+
apiUrl: t.apiUrl,
|
|
494
|
+
projectId: t.projectId,
|
|
495
|
+
theme: e.theme,
|
|
496
|
+
isDrawer: r
|
|
497
|
+
}
|
|
498
|
+
)
|
|
499
|
+
] })
|
|
500
|
+
},
|
|
501
|
+
`content-${a}`
|
|
502
|
+
))
|
|
503
|
+
] });
|
|
504
|
+
}
|
|
505
|
+
export {
|
|
506
|
+
Qe as W
|
|
507
|
+
};
|