@upstep/js 0.8.0 → 0.10.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/dist/react.js CHANGED
@@ -1,206 +1,220 @@
1
- import { jsxs as d, Fragment as T, jsx as e } from "react/jsx-runtime";
2
- import { createContext as G, useState as h, useEffect as k, useCallback as F, useContext as O, useRef as j } from "react";
3
- import { U as V } from "./api-ZTIiZxlg.mjs";
4
- const _ = "#D97757", Y = {
5
- bg: "#ffffff",
6
- bgSoft: "#f5f5f5",
7
- bgHover: "#ededed",
8
- text: "#1a1915",
9
- textSoft: "#56544d",
10
- textFaint: "#9b9890",
11
- border: "#e8e6df",
12
- overlay: "rgba(26,25,21,.45)"
13
- }, q = {
14
- bg: "#000000",
15
- bgSoft: "#171717",
16
- bgHover: "#262626",
17
- text: "#f5f4f0",
18
- textSoft: "#b4b1a8",
19
- textFaint: "#7d7a72",
20
- border: "#33312c",
21
- overlay: "rgba(0,0,0,.6)"
22
- };
23
- function E() {
1
+ import { jsxs as a, Fragment as B, jsx as t } from "react/jsx-runtime";
2
+ import J, { createContext as K, useState as m, useEffect as k, useCallback as F, useContext as Q, useRef as X } from "react";
3
+ import { U as Z } from "./api-CROQwfAo.mjs";
4
+ import { scaleRadius as x, DEFAULT_ACCENT as ee, buildWidgetPalette as te, withAlpha as oe } from "./theme.js";
5
+ const ne = '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif';
6
+ function N(n, e) {
7
+ return oe(n, e) ?? `color-mix(in srgb, ${n} ${Math.round(e * 100)}%, transparent)`;
8
+ }
9
+ function P() {
24
10
  if (typeof document > "u") return !1;
25
- const o = document.documentElement;
26
- return o.classList.contains("dark") || o.getAttribute("data-theme") === "dark";
11
+ const n = document.documentElement;
12
+ return n.classList.contains("dark") || n.getAttribute("data-theme") === "dark";
27
13
  }
28
- function K(o) {
29
- const [n, t] = h(() => o === "dark");
30
- return k(() => {
31
- if (o !== "auto") {
32
- t(o === "dark");
14
+ function re(n, e) {
15
+ const [o, p] = m(() => n === "dark");
16
+ k(() => {
17
+ if (n !== "auto") {
18
+ p(n === "dark");
33
19
  return;
34
20
  }
35
- if (t(E()), typeof MutationObserver > "u") return;
36
- const a = new MutationObserver(() => t(E()));
37
- return a.observe(document.documentElement, {
21
+ if (p(P()), typeof MutationObserver > "u") return;
22
+ const d = new MutationObserver(() => p(P()));
23
+ return d.observe(document.documentElement, {
38
24
  attributes: !0,
39
25
  attributeFilter: ["class", "data-theme"]
40
- }), () => a.disconnect();
41
- }, [o]), n ? q : Y;
26
+ }), () => d.disconnect();
27
+ }, [n]);
28
+ const { accentColor: c, colors: b, radius: r } = e;
29
+ return J.useMemo(
30
+ () => te({
31
+ mode: o ? "dark" : "light",
32
+ accentColor: c,
33
+ colors: b,
34
+ radius: r
35
+ }),
36
+ // `colors` is usually an inline object literal, so compare it by value.
37
+ // eslint-disable-next-line react-hooks/exhaustive-deps
38
+ [o, c, JSON.stringify(b ?? null), r]
39
+ );
42
40
  }
43
- const R = G(null);
44
- function de({
45
- children: o,
46
- ...n
41
+ const H = K(null);
42
+ function be({
43
+ children: n,
44
+ ...e
47
45
  }) {
48
- const [t] = h(() => new V(n)), [a, c] = h([]), [i, r] = h(!1), [l, x] = h(!0);
46
+ const [o] = m(() => new Z(e)), [p, c] = m([]), [b, r] = m(!1), [d, l] = m(!0);
49
47
  k(() => {
50
- t.setUserId(n.userId);
51
- }, [t, n.userId]), k(() => {
52
- t.supportIdentityToken = n.supportIdentityToken, document.querySelectorAll("iframe[data-upstep-support]").forEach(
53
- (u) => {
54
- var y;
55
- return (y = u.contentWindow) == null ? void 0 : y.postMessage(
48
+ o.setUserId(e.userId);
49
+ }, [o, e.userId]), k(() => {
50
+ o.supportIdentityToken = e.supportIdentityToken, document.querySelectorAll("iframe[data-upstep-support]").forEach(
51
+ (s) => {
52
+ var u;
53
+ return (u = s.contentWindow) == null ? void 0 : u.postMessage(
56
54
  {
57
55
  type: "upstep:support:identity",
58
- token: n.supportIdentityToken
56
+ token: e.supportIdentityToken
59
57
  },
60
- new URL(t.baseUrl).origin
58
+ new URL(o.baseUrl).origin
61
59
  );
62
60
  }
63
61
  );
64
- }, [t, n.supportIdentityToken]);
65
- const p = F(async () => {
62
+ }, [o, e.supportIdentityToken]);
63
+ const i = F(async () => {
66
64
  try {
67
- const u = await t.listFeedback({ sort: "votes", limit: 20 });
68
- c(u.items), x(u.showBranding ?? !0);
65
+ const s = await o.listFeedback({ sort: "votes", limit: 20 });
66
+ c(s.items), l(s.showBranding ?? !0);
69
67
  } catch {
70
68
  }
71
- }, [t]);
69
+ }, [o]);
72
70
  k(() => {
73
- p();
74
- }, [p]);
75
- const w = F(
76
- async (u, y, v) => {
77
- const f = { content: y };
78
- u.trim() && (f.title = u.trim()), v !== void 0 && (f.type = v), await t.submitFeedback(f), await p();
71
+ i();
72
+ }, [i]);
73
+ const g = F(
74
+ async (s, u, S) => {
75
+ const w = { content: u };
76
+ s.trim() && (w.title = s.trim()), S !== void 0 && (w.type = S), await o.submitFeedback(w), await i();
79
77
  },
80
- [t, p]
81
- ), m = F(
82
- async (u, y) => {
78
+ [o, i]
79
+ ), v = F(
80
+ async (s, u) => {
83
81
  try {
84
- await t.vote(u, y), await p();
82
+ await o.vote(s, u), await i();
85
83
  } catch {
86
84
  }
87
85
  },
88
- [t, p]
89
- ), s = F(
90
- (u) => t.getItem(u),
91
- [t]
92
- ), b = F(() => r(!0), []), S = F(() => r(!1), []), C = F(
93
- (u) => t.setUserId(u),
94
- [t]
86
+ [o, i]
87
+ ), h = F(
88
+ (s) => o.getItem(s),
89
+ [o]
90
+ ), C = F(() => r(!0), []), z = F(() => r(!1), []), I = F(
91
+ (s) => o.setUserId(s),
92
+ [o]
95
93
  );
96
- return /* @__PURE__ */ e(
97
- R.Provider,
94
+ return /* @__PURE__ */ t(
95
+ H.Provider,
98
96
  {
99
97
  value: {
100
- client: t,
101
- feedItems: a,
102
- loadFeed: p,
103
- submit: w,
104
- vote: m,
105
- getItem: s,
106
- isOpen: i,
107
- open: b,
108
- close: S,
109
- identify: C,
110
- accentColor: n.accentColor ?? _,
111
- theme: n.theme ?? "auto",
112
- showBranding: l,
113
- chat: n.chat !== !1
98
+ client: o,
99
+ feedItems: p,
100
+ loadFeed: i,
101
+ submit: g,
102
+ vote: v,
103
+ getItem: h,
104
+ isOpen: b,
105
+ open: C,
106
+ close: z,
107
+ identify: I,
108
+ accentColor: e.accentColor ?? ee,
109
+ customAccentColor: e.accentColor,
110
+ theme: e.theme ?? "auto",
111
+ colors: e.colors,
112
+ radius: e.radius,
113
+ fontFamily: e.fontFamily,
114
+ showBranding: d,
115
+ chat: e.chat !== !1
114
116
  },
115
- children: o
117
+ children: n
116
118
  }
117
119
  );
118
120
  }
119
- function I() {
120
- const o = O(R);
121
- if (!o) throw new Error("useUpstep must be used inside <UpstepProvider>");
122
- return o;
121
+ function E() {
122
+ const n = Q(H);
123
+ if (!n) throw new Error("useUpstep must be used inside <UpstepProvider>");
124
+ return n;
123
125
  }
124
- function ae({
125
- position: o = "bottom-right",
126
- accentColor: n,
127
- theme: t,
128
- hideLauncher: a = !1,
129
- chat: c = !0
126
+ function ye({
127
+ position: n = "bottom-right",
128
+ accentColor: e,
129
+ theme: o,
130
+ colors: p,
131
+ radius: c,
132
+ fontFamily: b,
133
+ hideLauncher: r = !1,
134
+ chat: d = !0
130
135
  }) {
131
- const i = I(), r = n ?? i.accentColor, l = K(t ?? i.theme), {
132
- isOpen: x,
133
- open: p,
134
- close: w,
135
- showBranding: m
136
- } = i, [s, b] = h("list"), [S, C] = h(!1);
136
+ var A;
137
+ const l = E(), i = re(o ?? l.theme, {
138
+ accentColor: e ?? l.customAccentColor,
139
+ colors: p ?? l.colors,
140
+ radius: c ?? l.radius
141
+ }), g = i.accent, v = {
142
+ colors: p ?? l.colors,
143
+ radius: c ?? l.radius,
144
+ fontFamily: b ?? l.fontFamily
145
+ }, {
146
+ isOpen: h,
147
+ open: C,
148
+ close: z,
149
+ showBranding: I
150
+ } = l, [s, u] = m("list"), [S, w] = m(!1);
137
151
  k(() => {
138
- let g = !0;
139
- if (i.client.chat = i.chat, !i.chat || !c) {
140
- C(!1);
152
+ let f = !0;
153
+ if (l.client.chat = l.chat, !l.chat || !d) {
154
+ w(!1);
141
155
  return;
142
156
  }
143
- return i.client.supportEnabled().then((z) => {
144
- g && C(z);
157
+ return l.client.supportEnabled().then((T) => {
158
+ f && w(T);
145
159
  }), () => {
146
- g = !1;
160
+ f = !1;
147
161
  };
148
- }, [i.client, i.chat, c]), k(() => {
149
- (!i.chat || !c) && s === "support" && b("list");
150
- }, [i.chat, c, s]), k(() => {
151
- x && b(S && c && i.chat ? "support" : "list");
152
- }, [x, S, c, i.chat]);
153
- const [u, y] = h(null), [v, f] = h(!1);
162
+ }, [l.client, l.chat, d]), k(() => {
163
+ (!l.chat || !d) && s === "support" && u("list");
164
+ }, [l.chat, d, s]), k(() => {
165
+ h && u(S && d && l.chat ? "support" : "list");
166
+ }, [h, S, d, l.chat]);
167
+ const [y, L] = m(null), [R, M] = m(!1);
154
168
  k(() => {
155
- const g = window.matchMedia("(max-width: 639px)");
156
- f(g.matches);
157
- const z = ($) => f($.matches);
158
- return g.addEventListener("change", z), () => g.removeEventListener("change", z);
169
+ const f = window.matchMedia("(max-width: 639px)");
170
+ M(f.matches);
171
+ const T = (q) => M(q.matches);
172
+ return f.addEventListener("change", T), () => f.removeEventListener("change", T);
159
173
  }, []);
160
- const H = {
174
+ const _ = {
161
175
  position: "fixed",
162
176
  bottom: 24,
163
177
  right: 24
164
- }, B = '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif';
165
- function W() {
166
- w(), y(null);
178
+ }, W = ((A = v.fontFamily) == null ? void 0 : A.trim()) || ne;
179
+ function U() {
180
+ z(), L(null);
167
181
  }
168
- function N(g) {
169
- y(g), b("detail");
182
+ function Y(f) {
183
+ L(f), u("detail");
170
184
  }
171
- return /* @__PURE__ */ d(T, { children: [
172
- !a && /* @__PURE__ */ d(
185
+ return /* @__PURE__ */ a(B, { children: [
186
+ !r && /* @__PURE__ */ a(
173
187
  "button",
174
188
  {
175
189
  "aria-label": "Open help and feedback",
176
- onClick: p,
190
+ onClick: C,
177
191
  style: {
178
- ...H,
192
+ ..._,
179
193
  zIndex: 9998,
180
194
  display: "inline-flex",
181
195
  alignItems: "center",
182
196
  gap: 7,
183
- background: r,
184
- color: "#fff",
197
+ background: g,
198
+ color: i.accentText,
185
199
  border: "none",
186
- borderRadius: 9999,
187
- padding: v ? "12px" : "12px 18px",
200
+ borderRadius: x(9999, i.radius),
201
+ padding: R ? "12px" : "12px 18px",
188
202
  fontSize: 14,
189
203
  fontWeight: 600,
190
204
  cursor: "pointer",
191
- fontFamily: B,
205
+ fontFamily: W,
192
206
  boxShadow: "0 6px 20px rgba(26,25,21,.18)"
193
207
  },
194
208
  children: [
195
- /* @__PURE__ */ e(re, { size: 16 }),
196
- !v && (S && c && i.chat ? "Help & feedback" : "Feedback")
209
+ /* @__PURE__ */ t(he, { size: 16 }),
210
+ !R && (S && d && l.chat ? "Help & feedback" : "Feedback")
197
211
  ]
198
212
  }
199
213
  ),
200
- x && /* @__PURE__ */ e(
214
+ h && /* @__PURE__ */ t(
201
215
  "div",
202
216
  {
203
- onClick: (g) => g.target === g.currentTarget && W(),
217
+ onClick: (f) => f.target === f.currentTarget && U(),
204
218
  style: {
205
219
  position: "fixed",
206
220
  inset: 0,
@@ -209,18 +223,18 @@ function ae({
209
223
  display: "flex",
210
224
  alignItems: "flex-end",
211
225
  justifyContent: "flex-end",
212
- padding: v ? "0 12px 80px" : "0 24px 88px",
213
- fontFamily: B
226
+ padding: R ? "0 12px 80px" : "0 24px 88px",
227
+ fontFamily: W
214
228
  },
215
- children: /* @__PURE__ */ d(
229
+ children: /* @__PURE__ */ a(
216
230
  "div",
217
231
  {
218
232
  style: {
219
- background: l.bg,
220
- border: `1px solid ${l.border}`,
221
- borderRadius: 20,
233
+ background: i.bg,
234
+ border: `1px solid ${i.border}`,
235
+ borderRadius: x(20, i.radius),
222
236
  width: "100%",
223
- maxWidth: S && c && i.chat ? 460 : 440,
237
+ maxWidth: S && d && l.chat ? 460 : 440,
224
238
  maxHeight: "calc(100dvh - 112px)",
225
239
  display: "flex",
226
240
  flexDirection: "column",
@@ -228,7 +242,7 @@ function ae({
228
242
  boxShadow: "0 24px 64px rgba(0,0,0,.28)"
229
243
  },
230
244
  children: [
231
- S && c && i.chat ? /* @__PURE__ */ d(
245
+ S && d && l.chat ? /* @__PURE__ */ a(
232
246
  "div",
233
247
  {
234
248
  style: {
@@ -236,41 +250,41 @@ function ae({
236
250
  alignItems: "center",
237
251
  gap: 14,
238
252
  padding: "10px 14px",
239
- borderBottom: `1px solid ${l.border}`,
253
+ borderBottom: `1px solid ${i.border}`,
240
254
  flexShrink: 0
241
255
  },
242
256
  children: [
243
- /* @__PURE__ */ e("div", { style: { display: "flex", flex: 1, gap: 4 }, children: [
257
+ /* @__PURE__ */ t("div", { style: { display: "flex", flex: 1, gap: 4 }, children: [
244
258
  ["support", "Support"],
245
- ["list", "Feedback"]
246
- ].map(([g, z]) => /* @__PURE__ */ e(
259
+ ["list", "Ideas"]
260
+ ].map(([f, T]) => /* @__PURE__ */ t(
247
261
  "button",
248
262
  {
249
- onClick: () => b(g),
263
+ onClick: () => u(f),
250
264
  style: {
251
265
  flex: 1,
252
266
  border: 0,
253
- borderRadius: 8,
267
+ borderRadius: x(8, i.radius),
254
268
  padding: "9px 12px",
255
- background: (s === "support" ? g === "support" : g === "list") ? l.bgSoft : "transparent",
256
- color: (s === "support" ? g === "support" : g === "list") ? l.text : l.textSoft,
269
+ background: (s === "support" ? f === "support" : f === "list") ? i.bgSoft : "transparent",
270
+ color: (s === "support" ? f === "support" : f === "list") ? i.text : i.textSoft,
257
271
  fontSize: 14,
258
272
  fontWeight: 600,
259
273
  cursor: "pointer"
260
274
  },
261
- children: z
275
+ children: T
262
276
  },
263
- g
277
+ f
264
278
  )) }),
265
- /* @__PURE__ */ e(
279
+ /* @__PURE__ */ t(
266
280
  "button",
267
281
  {
268
282
  "aria-label": "Close",
269
- onClick: W,
283
+ onClick: U,
270
284
  style: {
271
285
  border: 0,
272
286
  background: "transparent",
273
- color: l.textSoft,
287
+ color: i.textSoft,
274
288
  padding: 6,
275
289
  cursor: "pointer",
276
290
  fontSize: 14
@@ -280,7 +294,7 @@ function ae({
280
294
  )
281
295
  ]
282
296
  }
283
- ) : /* @__PURE__ */ d(
297
+ ) : /* @__PURE__ */ a(
284
298
  "div",
285
299
  {
286
300
  style: {
@@ -288,20 +302,20 @@ function ae({
288
302
  alignItems: "center",
289
303
  justifyContent: "space-between",
290
304
  padding: "16px 20px",
291
- borderBottom: `1px solid ${l.border}`,
305
+ borderBottom: `1px solid ${i.border}`,
292
306
  flexShrink: 0
293
307
  },
294
308
  children: [
295
- /* @__PURE__ */ d("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
296
- s !== "list" && /* @__PURE__ */ e(
309
+ /* @__PURE__ */ a("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
310
+ s !== "list" && /* @__PURE__ */ t(
297
311
  "button",
298
312
  {
299
- onClick: () => b("list"),
313
+ onClick: () => u("list"),
300
314
  style: {
301
315
  background: "none",
302
316
  border: "none",
303
317
  cursor: "pointer",
304
- color: r,
318
+ color: g,
305
319
  fontSize: 14,
306
320
  fontWeight: 600,
307
321
  padding: 0
@@ -309,41 +323,41 @@ function ae({
309
323
  children: "← Back"
310
324
  }
311
325
  ),
312
- s === "list" && /* @__PURE__ */ e(
326
+ s === "list" && /* @__PURE__ */ t(
313
327
  "span",
314
328
  {
315
329
  style: {
316
330
  fontWeight: 700,
317
331
  fontSize: 16,
318
- color: l.text,
332
+ color: i.text,
319
333
  letterSpacing: "-.01em"
320
334
  },
321
335
  children: "Feedback"
322
336
  }
323
337
  ),
324
- s === "create" && /* @__PURE__ */ e(
338
+ s === "create" && /* @__PURE__ */ t(
325
339
  "span",
326
340
  {
327
341
  style: {
328
342
  fontWeight: 700,
329
343
  fontSize: 16,
330
- color: l.text,
344
+ color: i.text,
331
345
  letterSpacing: "-.01em"
332
346
  },
333
347
  children: "New feedback"
334
348
  }
335
349
  )
336
350
  ] }),
337
- /* @__PURE__ */ d("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
338
- s === "list" && /* @__PURE__ */ e(
351
+ /* @__PURE__ */ a("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
352
+ s === "list" && /* @__PURE__ */ t(
339
353
  "button",
340
354
  {
341
- onClick: () => b("create"),
355
+ onClick: () => u("create"),
342
356
  style: {
343
- background: r,
344
- color: "#fff",
357
+ background: g,
358
+ color: i.accentText,
345
359
  border: "none",
346
- borderRadius: 20,
360
+ borderRadius: x(20, i.radius),
347
361
  padding: "6px 14px",
348
362
  fontSize: 14,
349
363
  fontWeight: 700,
@@ -352,19 +366,19 @@ function ae({
352
366
  children: "+ New"
353
367
  }
354
368
  ),
355
- /* @__PURE__ */ e(
369
+ /* @__PURE__ */ t(
356
370
  "button",
357
371
  {
358
- onClick: W,
372
+ onClick: U,
359
373
  style: {
360
- background: l.bgSoft,
374
+ background: i.bgSoft,
361
375
  border: "none",
362
376
  width: 28,
363
377
  height: 28,
364
- borderRadius: 8,
378
+ borderRadius: x(8, i.radius),
365
379
  fontSize: 14,
366
380
  cursor: "pointer",
367
- color: l.textSoft,
381
+ color: i.textSoft,
368
382
  display: "flex",
369
383
  alignItems: "center",
370
384
  justifyContent: "center"
@@ -376,7 +390,7 @@ function ae({
376
390
  ]
377
391
  }
378
392
  ),
379
- /* @__PURE__ */ d(
393
+ /* @__PURE__ */ a(
380
394
  "div",
381
395
  {
382
396
  style: {
@@ -385,15 +399,16 @@ function ae({
385
399
  padding: s === "support" ? 0 : "16px 20px 24px"
386
400
  },
387
401
  children: [
388
- s === "support" && c && i.chat && /* @__PURE__ */ e(
389
- J,
402
+ s === "support" && d && l.chat && /* @__PURE__ */ t(
403
+ ie,
390
404
  {
391
- client: i.client,
392
- accentColor: r,
393
- theme: l.bg === "#000000" ? "dark" : "light"
405
+ client: l.client,
406
+ accentColor: g,
407
+ theme: i.dark ? "dark" : "light",
408
+ appearance: v
394
409
  }
395
410
  ),
396
- S && c && i.chat && s !== "support" && /* @__PURE__ */ e(
411
+ S && d && l.chat && s !== "support" && /* @__PURE__ */ t(
397
412
  "div",
398
413
  {
399
414
  style: {
@@ -402,70 +417,71 @@ function ae({
402
417
  justifyContent: "space-between",
403
418
  marginBottom: 16
404
419
  },
405
- children: s === "list" ? /* @__PURE__ */ d(T, { children: [
406
- /* @__PURE__ */ e(
420
+ children: s === "list" ? /* @__PURE__ */ a(B, { children: [
421
+ /* @__PURE__ */ t(
407
422
  "span",
408
423
  {
409
- style: { fontSize: 14, fontWeight: 600, color: l.text },
410
- children: "Feedback & ideas"
424
+ style: { fontSize: 14, fontWeight: 600, color: i.text },
425
+ children: "Ideas"
411
426
  }
412
427
  ),
413
- /* @__PURE__ */ e(
428
+ /* @__PURE__ */ t(
414
429
  "button",
415
430
  {
416
- onClick: () => b("create"),
431
+ onClick: () => u("create"),
417
432
  style: {
418
433
  border: 0,
419
- borderRadius: 8,
420
- background: r,
421
- color: "white",
434
+ borderRadius: x(8, i.radius),
435
+ background: g,
436
+ color: i.accentText,
422
437
  fontSize: 14,
423
438
  padding: "7px 10px",
424
439
  cursor: "pointer"
425
440
  },
426
- children: "+ New"
441
+ children: "+ Suggest an idea"
427
442
  }
428
443
  )
429
- ] }) : /* @__PURE__ */ e(
444
+ ] }) : /* @__PURE__ */ t(
430
445
  "button",
431
446
  {
432
- onClick: () => b("list"),
447
+ onClick: () => u("list"),
433
448
  style: {
434
449
  border: 0,
435
450
  background: "none",
436
451
  padding: 0,
437
- color: l.textSoft,
452
+ color: i.textSoft,
438
453
  fontSize: 14,
439
454
  cursor: "pointer"
440
455
  },
441
- children: "← Back to feedback"
456
+ children: "← Back to ideas"
442
457
  }
443
458
  )
444
459
  }
445
460
  ),
446
- s === "list" && /* @__PURE__ */ e(Q, { onSelect: N, accent: r, p: l }),
447
- s === "detail" && u && /* @__PURE__ */ e(
448
- X,
461
+ s === "list" && /* @__PURE__ */ t(le, { onSelect: Y, accent: g, p: i }),
462
+ s === "detail" && y && /* @__PURE__ */ t(
463
+ se,
449
464
  {
450
- feedbackId: u,
451
- accent: r,
452
- p: l,
453
- font: B
465
+ feedbackId: y,
466
+ accent: g,
467
+ p: i,
468
+ font: W
454
469
  }
455
470
  ),
456
- s === "create" && /* @__PURE__ */ e(
457
- ee,
471
+ s === "create" && /* @__PURE__ */ t(
472
+ de,
458
473
  {
459
- accent: r,
460
- p: l,
461
- font: B,
462
- onDone: () => b("list")
474
+ accent: g,
475
+ p: i,
476
+ font: W,
477
+ ideasOnly: !!(S && d && l.chat),
478
+ onDone: () => u("list")
463
479
  }
464
480
  )
465
481
  ]
466
482
  }
467
483
  ),
468
- m && s !== "support" && /* @__PURE__ */ d(
484
+ I && s !== "support" && /* @__PURE__ */ a(
469
485
  "a",
470
486
  {
471
487
  href: "https://upstep.dev",
@@ -475,16 +491,16 @@ function ae({
475
491
  display: "block",
476
492
  textAlign: "center",
477
493
  padding: "8px 0",
478
- borderTop: `1px solid ${l.border}`,
494
+ borderTop: `1px solid ${i.border}`,
479
495
  fontSize: 11,
480
- color: l.textFaint,
496
+ color: i.textFaint,
481
497
  textDecoration: "none",
482
498
  flexShrink: 0
483
499
  },
484
500
  children: [
485
501
  "Powered by",
486
502
  " ",
487
- /* @__PURE__ */ e("strong", { style: { fontWeight: 700 }, children: "Upstep.dev" })
503
+ /* @__PURE__ */ t("strong", { style: { fontWeight: 700 }, children: "Upstep.dev" })
488
504
  ]
489
505
  }
490
506
  )
@@ -495,23 +511,24 @@ function ae({
495
511
  )
496
512
  ] });
497
513
  }
498
- function J({
499
- client: o,
500
- theme: n,
501
- accentColor: t
514
+ function ie({
515
+ client: n,
516
+ theme: e,
517
+ accentColor: o,
518
+ appearance: p
502
519
  }) {
503
- const a = j(null);
520
+ const c = X(null);
504
521
  return k(() => {
505
- if (a.current) return o.connectSupportFrame(a.current);
506
- }, [o]), /* @__PURE__ */ e(
522
+ if (c.current) return n.connectSupportFrame(c.current);
523
+ }, [n]), /* @__PURE__ */ t(
507
524
  "iframe",
508
525
  {
509
- ref: a,
526
+ ref: c,
510
527
  "data-upstep-support": !0,
511
528
  title: "Customer support",
512
- src: o.supportFrameUrl(n, t),
529
+ src: n.supportFrameUrl(e, o, p),
513
530
  style: {
514
- color: t,
531
+ color: o,
515
532
  width: "100%",
516
533
  height: "min(560px, calc(100dvh - 168px))",
517
534
  minHeight: 300,
@@ -521,34 +538,34 @@ function J({
521
538
  }
522
539
  );
523
540
  }
524
- function Q({
525
- onSelect: o,
526
- accent: n,
527
- p: t
541
+ function le({
542
+ onSelect: n,
543
+ accent: e,
544
+ p: o
528
545
  }) {
529
- const { feedItems: a, vote: c } = I(), i = a.filter((r) => r.status !== "CLOSED");
530
- return i.length ? /* @__PURE__ */ e(T, { children: i.map((r) => {
531
- const l = r.userVote === "UP", x = r.title ?? r.content;
532
- return /* @__PURE__ */ d(
546
+ const { feedItems: p, vote: c } = E(), b = p.filter((r) => r.status !== "CLOSED");
547
+ return b.length ? /* @__PURE__ */ t(B, { children: b.map((r) => {
548
+ const d = r.userVote === "UP", l = r.title ?? r.content;
549
+ return /* @__PURE__ */ a(
533
550
  "div",
534
551
  {
535
- onClick: () => o(r.id),
552
+ onClick: () => n(r.id),
536
553
  style: {
537
554
  display: "flex",
538
555
  gap: 12,
539
556
  padding: 14,
540
- border: `1px solid ${t.border}`,
541
- borderRadius: 14,
557
+ border: `1px solid ${o.border}`,
558
+ borderRadius: x(14, o.radius),
542
559
  marginBottom: 10,
543
- background: t.bg,
560
+ background: o.bg,
544
561
  cursor: "pointer"
545
562
  },
546
563
  children: [
547
- /* @__PURE__ */ d(
564
+ /* @__PURE__ */ a(
548
565
  "button",
549
566
  {
550
- onClick: (p) => {
551
- p.stopPropagation(), c(r.id, "UP");
567
+ onClick: (i) => {
568
+ i.stopPropagation(), c(r.id, "UP");
552
569
  },
553
570
  style: {
554
571
  display: "flex",
@@ -558,21 +575,21 @@ function Q({
558
575
  gap: 2,
559
576
  minWidth: 46,
560
577
  padding: "7px 0",
561
- borderRadius: 11,
578
+ borderRadius: x(11, o.radius),
562
579
  cursor: "pointer",
563
580
  flexShrink: 0,
564
- border: `1px solid ${l ? n : t.border}`,
565
- background: l ? `${n}1a` : t.bgSoft
581
+ border: `1px solid ${d ? e : o.border}`,
582
+ background: d ? o.accentTint : o.bgSoft
566
583
  },
567
584
  children: [
568
- /* @__PURE__ */ e(D, { color: n }),
569
- /* @__PURE__ */ e(
585
+ /* @__PURE__ */ t(O, { color: e }),
586
+ /* @__PURE__ */ t(
570
587
  "span",
571
588
  {
572
589
  style: {
573
590
  fontSize: 14,
574
591
  fontWeight: 700,
575
- color: t.text,
592
+ color: o.text,
576
593
  lineHeight: 1.1
577
594
  },
578
595
  children: r.upvotes
@@ -581,25 +598,25 @@ function Q({
581
598
  ]
582
599
  }
583
600
  ),
584
- /* @__PURE__ */ d("div", { style: { flex: 1, minWidth: 0 }, children: [
585
- /* @__PURE__ */ e(
601
+ /* @__PURE__ */ a("div", { style: { flex: 1, minWidth: 0 }, children: [
602
+ /* @__PURE__ */ t(
586
603
  "p",
587
604
  {
588
605
  style: {
589
606
  fontSize: 14,
590
607
  fontWeight: 600,
591
608
  lineHeight: 1.4,
592
- color: t.text,
609
+ color: o.text,
593
610
  margin: "0 0 6px",
594
611
  overflow: "hidden",
595
612
  display: "-webkit-box",
596
613
  WebkitLineClamp: 2,
597
614
  WebkitBoxOrient: "vertical"
598
615
  },
599
- children: x
616
+ children: l
600
617
  }
601
618
  ),
602
- /* @__PURE__ */ d(
619
+ /* @__PURE__ */ a(
603
620
  "div",
604
621
  {
605
622
  style: {
@@ -609,25 +626,25 @@ function Q({
609
626
  flexWrap: "wrap"
610
627
  },
611
628
  children: [
612
- /* @__PURE__ */ e(L, { type: r.type, p: t }),
613
- r.status === "PENDING" ? /* @__PURE__ */ e(M, {}) : /* @__PURE__ */ e(
614
- A,
629
+ /* @__PURE__ */ t($, { type: r.type, p: o }),
630
+ r.status === "PENDING" ? /* @__PURE__ */ t(j, {}) : /* @__PURE__ */ t(
631
+ G,
615
632
  {
616
633
  status: r.status,
617
634
  boardStatus: r.boardStatus,
618
- p: t
635
+ p: o
619
636
  }
620
637
  ),
621
- /* @__PURE__ */ e("span", { style: { fontSize: 11, color: t.textFaint }, children: P(r.createdAt) })
638
+ /* @__PURE__ */ t("span", { style: { fontSize: 11, color: o.textFaint }, children: V(r.createdAt) })
622
639
  ]
623
640
  }
624
641
  )
625
642
  ] }),
626
- /* @__PURE__ */ e(
643
+ /* @__PURE__ */ t(
627
644
  "span",
628
645
  {
629
646
  style: {
630
- color: t.textFaint,
647
+ color: o.textFaint,
631
648
  fontSize: 18,
632
649
  alignSelf: "center",
633
650
  flexShrink: 0
@@ -639,12 +656,12 @@ function Q({
639
656
  },
640
657
  r.id
641
658
  );
642
- }) }) : /* @__PURE__ */ d("div", { style: { textAlign: "center", padding: "40px 0" }, children: [
643
- /* @__PURE__ */ e(
659
+ }) }) : /* @__PURE__ */ a("div", { style: { textAlign: "center", padding: "40px 0" }, children: [
660
+ /* @__PURE__ */ t(
644
661
  "div",
645
662
  {
646
663
  style: {
647
- color: t.textSoft,
664
+ color: o.textSoft,
648
665
  fontSize: 15,
649
666
  fontWeight: 600,
650
667
  marginBottom: 4
@@ -652,166 +669,166 @@ function Q({
652
669
  children: "No open feedback yet"
653
670
  }
654
671
  ),
655
- /* @__PURE__ */ e("div", { style: { color: t.textFaint, fontSize: 14 }, children: "Be the first to share one." })
672
+ /* @__PURE__ */ t("div", { style: { color: o.textFaint, fontSize: 14 }, children: "Be the first to share one." })
656
673
  ] });
657
674
  }
658
- function X({
659
- feedbackId: o,
660
- accent: n,
661
- p: t,
662
- font: a
675
+ function se({
676
+ feedbackId: n,
677
+ accent: e,
678
+ p: o,
679
+ font: p
663
680
  }) {
664
- const { vote: c, getItem: i } = I(), [r, l] = h(null), [x, p] = h(!1);
681
+ const { vote: c, getItem: b } = E(), [r, d] = m(null), [l, i] = m(!1);
665
682
  k(() => {
666
- let s = !1;
667
- return i(o).then((b) => {
668
- s || l(b);
683
+ let h = !1;
684
+ return b(n).then((C) => {
685
+ h || d(C);
669
686
  }).catch(() => {
670
687
  }), () => {
671
- s = !0;
688
+ h = !0;
672
689
  };
673
- }, [o, i]);
674
- async function w() {
675
- if (!(!r || x)) {
676
- p(!0);
690
+ }, [n, b]);
691
+ async function g() {
692
+ if (!(!r || l)) {
693
+ i(!0);
677
694
  try {
678
695
  await c(r.id, "UP");
679
- const s = await i(o);
680
- l(s);
696
+ const h = await b(n);
697
+ d(h);
681
698
  } catch {
682
699
  } finally {
683
- p(!1);
700
+ i(!1);
684
701
  }
685
702
  }
686
703
  }
687
704
  if (!r)
688
- return /* @__PURE__ */ e(
705
+ return /* @__PURE__ */ t(
689
706
  "div",
690
707
  {
691
708
  style: {
692
709
  textAlign: "center",
693
710
  padding: "40px 0",
694
- color: t.textFaint,
711
+ color: o.textFaint,
695
712
  fontSize: 14
696
713
  },
697
714
  children: "Loading…"
698
715
  }
699
716
  );
700
- const m = r.title;
701
- return /* @__PURE__ */ d("div", { children: [
702
- m && /* @__PURE__ */ e(
717
+ const v = r.title;
718
+ return /* @__PURE__ */ a("div", { children: [
719
+ v && /* @__PURE__ */ t(
703
720
  "div",
704
721
  {
705
722
  style: {
706
723
  fontSize: 20,
707
724
  fontWeight: 700,
708
- color: t.text,
725
+ color: o.text,
709
726
  letterSpacing: "-.02em",
710
727
  marginBottom: 10,
711
728
  lineHeight: 1.3
712
729
  },
713
- children: m
730
+ children: v
714
731
  }
715
732
  ),
716
- /* @__PURE__ */ d(
733
+ /* @__PURE__ */ a(
717
734
  "div",
718
735
  {
719
736
  style: { display: "flex", gap: 6, marginBottom: 14, flexWrap: "wrap" },
720
737
  children: [
721
- /* @__PURE__ */ e(L, { type: r.type, p: t }),
722
- r.status === "PENDING" ? /* @__PURE__ */ e(M, {}) : /* @__PURE__ */ e(
723
- A,
738
+ /* @__PURE__ */ t($, { type: r.type, p: o }),
739
+ r.status === "PENDING" ? /* @__PURE__ */ t(j, {}) : /* @__PURE__ */ t(
740
+ G,
724
741
  {
725
742
  status: r.status,
726
743
  boardStatus: r.boardStatus,
727
- p: t
744
+ p: o
728
745
  }
729
746
  )
730
747
  ]
731
748
  }
732
749
  ),
733
- /* @__PURE__ */ e(
750
+ /* @__PURE__ */ t(
734
751
  "p",
735
752
  {
736
753
  style: {
737
754
  fontSize: 15,
738
755
  lineHeight: 1.6,
739
- color: t.textSoft,
756
+ color: o.textSoft,
740
757
  marginBottom: 20
741
758
  },
742
759
  children: r.content
743
760
  }
744
761
  ),
745
- /* @__PURE__ */ d(
762
+ /* @__PURE__ */ a(
746
763
  "button",
747
764
  {
748
- onClick: w,
749
- disabled: x,
765
+ onClick: g,
766
+ disabled: l,
750
767
  style: {
751
768
  display: "inline-flex",
752
769
  alignItems: "center",
753
770
  gap: 8,
754
- border: `1px solid ${r.userVote === "UP" ? n : t.border}`,
755
- background: r.userVote === "UP" ? `${n}15` : t.bgSoft,
756
- borderRadius: 12,
771
+ border: `1px solid ${r.userVote === "UP" ? e : o.border}`,
772
+ background: r.userVote === "UP" ? N(e, 0.08) : o.bgSoft,
773
+ borderRadius: x(12, o.radius),
757
774
  padding: "10px 16px",
758
775
  cursor: "pointer",
759
- fontFamily: a
776
+ fontFamily: p
760
777
  },
761
778
  children: [
762
- /* @__PURE__ */ e(D, { color: n, size: 13 }),
763
- /* @__PURE__ */ e("span", { style: { fontSize: 18, fontWeight: 700, color: t.text }, children: r.upvotes }),
764
- /* @__PURE__ */ e("span", { style: { fontSize: 14, color: t.textFaint }, children: r.userVote === "UP" ? "Upvoted" : "Upvote" })
779
+ /* @__PURE__ */ t(O, { color: e, size: 13 }),
780
+ /* @__PURE__ */ t("span", { style: { fontSize: 18, fontWeight: 700, color: o.text }, children: r.upvotes }),
781
+ /* @__PURE__ */ t("span", { style: { fontSize: 14, color: o.textFaint }, children: r.userVote === "UP" ? "Upvoted" : "Upvote" })
765
782
  ]
766
783
  }
767
784
  ),
768
- r.comments.length > 0 && /* @__PURE__ */ d(
785
+ r.comments.length > 0 && /* @__PURE__ */ a(
769
786
  "div",
770
787
  {
771
788
  style: {
772
789
  marginTop: 28,
773
- borderTop: `1px solid ${t.border}`,
790
+ borderTop: `1px solid ${o.border}`,
774
791
  paddingTop: 20
775
792
  },
776
793
  children: [
777
- /* @__PURE__ */ e(
794
+ /* @__PURE__ */ t(
778
795
  "div",
779
796
  {
780
797
  style: {
781
798
  fontSize: 10,
782
799
  fontWeight: 700,
783
800
  letterSpacing: ".08em",
784
- color: t.textFaint,
801
+ color: o.textFaint,
785
802
  marginBottom: 12,
786
803
  textTransform: "uppercase"
787
804
  },
788
805
  children: "Comments"
789
806
  }
790
807
  ),
791
- r.comments.map((s) => /* @__PURE__ */ e(Z, { comment: s, p: t, accent: n }, s.id))
808
+ r.comments.map((h) => /* @__PURE__ */ t(ae, { comment: h, p: o, accent: e }, h.id))
792
809
  ]
793
810
  }
794
811
  )
795
812
  ] });
796
813
  }
797
- function Z({
798
- comment: o,
799
- p: n,
800
- accent: t
814
+ function ae({
815
+ comment: n,
816
+ p: e,
817
+ accent: o
801
818
  }) {
802
- var a;
803
- return /* @__PURE__ */ d(
819
+ var p;
820
+ return /* @__PURE__ */ a(
804
821
  "div",
805
822
  {
806
823
  style: {
807
- background: n.bgSoft,
808
- border: `1px solid ${n.border}`,
809
- borderRadius: 12,
824
+ background: e.bgSoft,
825
+ border: `1px solid ${e.border}`,
826
+ borderRadius: x(12, e.radius),
810
827
  padding: 14,
811
828
  marginBottom: 10
812
829
  },
813
830
  children: [
814
- /* @__PURE__ */ d(
831
+ /* @__PURE__ */ a(
815
832
  "div",
816
833
  {
817
834
  style: {
@@ -821,164 +838,169 @@ function Z({
821
838
  marginBottom: 8
822
839
  },
823
840
  children: [
824
- /* @__PURE__ */ e(
841
+ /* @__PURE__ */ t(
825
842
  "span",
826
843
  {
827
844
  style: {
828
- background: `${t}20`,
829
- color: t,
845
+ background: N(o, 0.125),
846
+ color: o,
830
847
  fontSize: 11,
831
848
  fontWeight: 700,
832
- borderRadius: 20,
849
+ borderRadius: x(20, e.radius),
833
850
  padding: "2px 8px"
834
851
  },
835
- children: ((a = o.authorName) == null ? void 0 : a.trim()) || "UpStep Team"
852
+ children: ((p = n.authorName) == null ? void 0 : p.trim()) || "UpStep Team"
836
853
  }
837
854
  ),
838
- /* @__PURE__ */ e("span", { style: { fontSize: 11, color: n.textFaint }, children: P(o.createdAt) })
855
+ /* @__PURE__ */ t("span", { style: { fontSize: 11, color: e.textFaint }, children: V(n.createdAt) })
839
856
  ]
840
857
  }
841
858
  ),
842
- /* @__PURE__ */ e(
859
+ /* @__PURE__ */ t(
843
860
  "p",
844
861
  {
845
- style: { fontSize: 16, lineHeight: 1.6, color: n.textSoft, margin: 0 },
846
- children: o.content
862
+ style: { fontSize: 16, lineHeight: 1.6, color: e.textSoft, margin: 0 },
863
+ children: n.content
847
864
  }
848
865
  )
849
866
  ]
850
867
  }
851
868
  );
852
869
  }
853
- function ee({
854
- accent: o,
855
- p: n,
856
- font: t,
857
- onDone: a
870
+ function de({
871
+ accent: n,
872
+ p: e,
873
+ font: o,
874
+ onDone: p,
875
+ ideasOnly: c = !1
858
876
  }) {
859
- const { submit: c } = I(), [i, r] = h(""), [l, x] = h(""), [p, w] = h("GENERAL"), [m, s] = h(!1), [b, S] = h(!1), [C, u] = h("");
860
- async function y() {
861
- if (!(!i.trim() || m)) {
862
- s(!0), u("");
877
+ const { submit: b } = E(), [r, d] = m(""), [l, i] = m(""), [g, v] = m(
878
+ c ? "FEATURE" : "GENERAL"
879
+ ), [h, C] = m(!1), [z, I] = m(!1), [s, u] = m("");
880
+ async function S() {
881
+ if (!(!r.trim() || h)) {
882
+ C(!0), u("");
863
883
  try {
864
- await c(i.trim(), l.trim() || i.trim(), p), S(!0), setTimeout(a, 1200);
884
+ await b(r.trim(), l.trim() || r.trim(), g), I(!0), setTimeout(p, 1200);
865
885
  } catch {
866
886
  u("Something went wrong. Please try again.");
867
887
  } finally {
868
- s(!1);
888
+ C(!1);
869
889
  }
870
890
  }
871
891
  }
872
- if (b)
873
- return /* @__PURE__ */ d("div", { style: { textAlign: "center", paddingTop: 40 }, children: [
874
- /* @__PURE__ */ e(
892
+ if (z)
893
+ return /* @__PURE__ */ a("div", { style: { textAlign: "center", paddingTop: 40 }, children: [
894
+ /* @__PURE__ */ t(
875
895
  "div",
876
896
  {
877
897
  style: {
878
898
  fontSize: 18,
879
899
  fontWeight: 700,
880
- color: n.text,
900
+ color: e.text,
881
901
  marginBottom: 6
882
902
  },
883
903
  children: "Submitted"
884
904
  }
885
905
  ),
886
- /* @__PURE__ */ e("div", { style: { fontSize: 14, color: n.textFaint }, children: "Feedback received. Thank you." })
906
+ /* @__PURE__ */ t("div", { style: { fontSize: 14, color: e.textFaint }, children: c ? "Idea received. Thank you." : "Feedback received. Thank you." })
887
907
  ] });
888
- const v = {
908
+ const w = {
889
909
  width: "100%",
890
- border: `1px solid ${n.border}`,
891
- borderRadius: 12,
910
+ border: `1px solid ${e.border}`,
911
+ borderRadius: x(12, e.radius),
892
912
  padding: "10px 12px",
893
913
  fontSize: 16,
894
914
  lineHeight: 1.6,
895
915
  outline: "none",
896
- background: n.bgSoft,
897
- color: n.text,
898
- fontFamily: t,
916
+ background: e.bgSoft,
917
+ color: e.text,
918
+ fontFamily: o,
899
919
  boxSizing: "border-box"
900
920
  };
901
- return /* @__PURE__ */ d("div", { children: [
902
- /* @__PURE__ */ e(
903
- "div",
904
- {
905
- style: {
906
- fontSize: 10,
907
- fontWeight: 700,
908
- letterSpacing: ".08em",
909
- color: n.textFaint,
910
- marginBottom: 8,
911
- textTransform: "uppercase"
912
- },
913
- children: "Type"
914
- }
915
- ),
916
- /* @__PURE__ */ e("div", { style: { display: "flex", gap: 7, marginBottom: 16 }, children: ["BUG", "FEATURE", "GENERAL"].map((f) => /* @__PURE__ */ d(
917
- "button",
918
- {
919
- onClick: () => w(f),
920
- style: {
921
- flex: 1,
922
- display: "flex",
923
- alignItems: "center",
924
- justifyContent: "center",
925
- gap: 5,
926
- padding: "8px 10px",
927
- borderRadius: 9,
928
- fontSize: 14,
929
- fontWeight: 600,
930
- cursor: "pointer",
931
- background: p === f ? o : n.bg,
932
- color: p === f ? "#fff" : n.textSoft,
933
- border: `1px solid ${p === f ? o : n.border}`,
934
- fontFamily: t
921
+ return /* @__PURE__ */ a("div", { children: [
922
+ !c && /* @__PURE__ */ a(B, { children: [
923
+ /* @__PURE__ */ t(
924
+ "div",
925
+ {
926
+ style: {
927
+ fontSize: 10,
928
+ fontWeight: 700,
929
+ letterSpacing: ".08em",
930
+ color: e.textFaint,
931
+ marginBottom: 8,
932
+ textTransform: "uppercase"
933
+ },
934
+ children: "Type"
935
+ }
936
+ ),
937
+ /* @__PURE__ */ t("div", { style: { display: "flex", gap: 7, marginBottom: 16 }, children: ["BUG", "FEATURE", "GENERAL"].map((y) => /* @__PURE__ */ a(
938
+ "button",
939
+ {
940
+ onClick: () => v(y),
941
+ style: {
942
+ flex: 1,
943
+ display: "flex",
944
+ alignItems: "center",
945
+ justifyContent: "center",
946
+ gap: 5,
947
+ padding: "8px 10px",
948
+ borderRadius: x(9, e.radius),
949
+ fontSize: 14,
950
+ fontWeight: 600,
951
+ cursor: "pointer",
952
+ background: g === y ? n : e.bg,
953
+ color: g === y ? e.accentText : e.textSoft,
954
+ border: `1px solid ${g === y ? n : e.border}`,
955
+ fontFamily: o
956
+ },
957
+ children: [
958
+ D[y].icon,
959
+ D[y].label
960
+ ]
935
961
  },
936
- children: [
937
- U[f].icon,
938
- U[f].label
939
- ]
940
- },
941
- f
942
- )) }),
943
- /* @__PURE__ */ e(
962
+ y
963
+ )) })
964
+ ] }),
965
+ /* @__PURE__ */ t(
944
966
  "div",
945
967
  {
946
968
  style: {
947
969
  fontSize: 10,
948
970
  fontWeight: 700,
949
971
  letterSpacing: ".08em",
950
- color: n.textFaint,
972
+ color: e.textFaint,
951
973
  marginBottom: 8,
952
974
  textTransform: "uppercase"
953
975
  },
954
976
  children: "Title"
955
977
  }
956
978
  ),
957
- /* @__PURE__ */ e(
979
+ /* @__PURE__ */ t(
958
980
  "input",
959
981
  {
960
- value: i,
961
- onChange: (f) => r(f.target.value),
962
- placeholder: "Short summary of the issue or idea",
982
+ value: r,
983
+ onChange: (y) => d(y.target.value),
984
+ placeholder: c ? "What would you like us to build?" : "Short summary of the issue or idea",
963
985
  maxLength: 200,
964
- style: { ...v, marginBottom: 16, display: "block" }
986
+ style: { ...w, marginBottom: 16, display: "block" }
965
987
  }
966
988
  ),
967
- /* @__PURE__ */ d(
989
+ /* @__PURE__ */ a(
968
990
  "div",
969
991
  {
970
992
  style: {
971
993
  fontSize: 10,
972
994
  fontWeight: 700,
973
995
  letterSpacing: ".08em",
974
- color: n.textFaint,
996
+ color: e.textFaint,
975
997
  marginBottom: 8,
976
998
  textTransform: "uppercase"
977
999
  },
978
1000
  children: [
979
1001
  "Description",
980
1002
  " ",
981
- /* @__PURE__ */ e(
1003
+ /* @__PURE__ */ t(
982
1004
  "span",
983
1005
  {
984
1006
  style: { fontWeight: 400, textTransform: "none", letterSpacing: 0 },
@@ -988,45 +1010,45 @@ function ee({
988
1010
  ]
989
1011
  }
990
1012
  ),
991
- /* @__PURE__ */ e(
1013
+ /* @__PURE__ */ t(
992
1014
  "textarea",
993
1015
  {
994
1016
  value: l,
995
- onChange: (f) => x(f.target.value),
996
- placeholder: "Steps to reproduce, expected behaviour, or more context",
1017
+ onChange: (y) => i(y.target.value),
1018
+ placeholder: c ? "Why would it help? (optional)" : "Steps to reproduce, expected behaviour, or more context",
997
1019
  maxLength: 2e3,
998
1020
  rows: 4,
999
- style: { ...v, resize: "vertical", marginBottom: 16 }
1021
+ style: { ...w, resize: "vertical", marginBottom: 16 }
1000
1022
  }
1001
1023
  ),
1002
- C && /* @__PURE__ */ e("p", { style: { fontSize: 14, color: "#d6453d", marginBottom: 12 }, children: C }),
1003
- /* @__PURE__ */ e(
1024
+ s && /* @__PURE__ */ t("p", { style: { fontSize: 14, color: "#d6453d", marginBottom: 12 }, children: s }),
1025
+ /* @__PURE__ */ t(
1004
1026
  "button",
1005
1027
  {
1006
- onClick: y,
1007
- disabled: m || !i.trim(),
1028
+ onClick: S,
1029
+ disabled: h || !r.trim(),
1008
1030
  style: {
1009
1031
  width: "100%",
1010
1032
  padding: 12,
1011
- background: o,
1012
- color: "#fff",
1033
+ background: n,
1034
+ color: e.accentText,
1013
1035
  border: "none",
1014
- borderRadius: 11,
1036
+ borderRadius: x(11, e.radius),
1015
1037
  fontSize: 14,
1016
1038
  fontWeight: 600,
1017
1039
  cursor: "pointer",
1018
- opacity: m || !i.trim() ? 0.5 : 1,
1019
- fontFamily: t
1040
+ opacity: h || !r.trim() ? 0.5 : 1,
1041
+ fontFamily: o
1020
1042
  },
1021
- children: m ? "Submitting…" : "Submit feedback"
1043
+ children: h ? "Submitting…" : c ? "Suggest idea" : "Submit feedback"
1022
1044
  }
1023
1045
  )
1024
1046
  ] });
1025
1047
  }
1026
- const U = {
1048
+ const D = {
1027
1049
  BUG: {
1028
1050
  label: "Bug",
1029
- icon: /* @__PURE__ */ d(
1051
+ icon: /* @__PURE__ */ a(
1030
1052
  "svg",
1031
1053
  {
1032
1054
  width: 12,
@@ -1038,15 +1060,15 @@ const U = {
1038
1060
  strokeLinecap: "round",
1039
1061
  strokeLinejoin: "round",
1040
1062
  children: [
1041
- /* @__PURE__ */ e("ellipse", { cx: "8", cy: "10", rx: "3.5", ry: "4.5" }),
1042
- /* @__PURE__ */ e("path", { d: "M8 5.5V4M5.5 6.5 3.5 5M10.5 6.5 12.5 5M4.5 10.5 2.5 10M11.5 10.5 13.5 10" })
1063
+ /* @__PURE__ */ t("ellipse", { cx: "8", cy: "10", rx: "3.5", ry: "4.5" }),
1064
+ /* @__PURE__ */ t("path", { d: "M8 5.5V4M5.5 6.5 3.5 5M10.5 6.5 12.5 5M4.5 10.5 2.5 10M11.5 10.5 13.5 10" })
1043
1065
  ]
1044
1066
  }
1045
1067
  )
1046
1068
  },
1047
1069
  FEATURE: {
1048
1070
  label: "Feature",
1049
- icon: /* @__PURE__ */ d(
1071
+ icon: /* @__PURE__ */ a(
1050
1072
  "svg",
1051
1073
  {
1052
1074
  width: 12,
@@ -1058,15 +1080,15 @@ const U = {
1058
1080
  strokeLinecap: "round",
1059
1081
  strokeLinejoin: "round",
1060
1082
  children: [
1061
- /* @__PURE__ */ e("path", { d: "M8 2v1.5M8 12.5V14M2 8h1.5M12.5 8H14M4.1 4.1l1 1M10.9 10.9l1 1M11.9 4.1l-1 1M5.1 10.9l-1 1" }),
1062
- /* @__PURE__ */ e("circle", { cx: "8", cy: "8", r: "2.5" })
1083
+ /* @__PURE__ */ t("path", { d: "M8 2v1.5M8 12.5V14M2 8h1.5M12.5 8H14M4.1 4.1l1 1M10.9 10.9l1 1M11.9 4.1l-1 1M5.1 10.9l-1 1" }),
1084
+ /* @__PURE__ */ t("circle", { cx: "8", cy: "8", r: "2.5" })
1063
1085
  ]
1064
1086
  }
1065
1087
  )
1066
1088
  },
1067
1089
  GENERAL: {
1068
1090
  label: "General",
1069
- icon: /* @__PURE__ */ e(
1091
+ icon: /* @__PURE__ */ t(
1070
1092
  "svg",
1071
1093
  {
1072
1094
  width: 12,
@@ -1077,36 +1099,36 @@ const U = {
1077
1099
  strokeWidth: 1.8,
1078
1100
  strokeLinecap: "round",
1079
1101
  strokeLinejoin: "round",
1080
- children: /* @__PURE__ */ e("path", { d: "M14 9a2 2 0 0 1-2 2H5L2 14V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v5z" })
1102
+ children: /* @__PURE__ */ t("path", { d: "M14 9a2 2 0 0 1-2 2H5L2 14V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v5z" })
1081
1103
  }
1082
1104
  )
1083
1105
  }
1084
- }, te = { BUG: "#fdecec", FEATURE: "#e9f0fd" }, ne = { BUG: "#d6453d", FEATURE: "#3b76d6" };
1085
- function L({ type: o, p: n }) {
1086
- return /* @__PURE__ */ e(
1106
+ }, ce = { BUG: "#fdecec", FEATURE: "#e9f0fd" }, pe = { BUG: "#d6453d", FEATURE: "#3b76d6" };
1107
+ function $({ type: n, p: e }) {
1108
+ return /* @__PURE__ */ t(
1087
1109
  "span",
1088
1110
  {
1089
1111
  style: {
1090
1112
  padding: "2px 8px",
1091
- borderRadius: 9999,
1113
+ borderRadius: x(9999, e.radius),
1092
1114
  fontSize: 10.5,
1093
1115
  fontWeight: 700,
1094
1116
  letterSpacing: ".02em",
1095
- background: te[o] ?? n.bgSoft,
1096
- color: ne[o] ?? n.textSoft
1117
+ background: ce[n] ?? e.bgSoft,
1118
+ color: pe[n] ?? e.textSoft
1097
1119
  },
1098
- children: o
1120
+ children: n
1099
1121
  }
1100
1122
  );
1101
1123
  }
1102
- const oe = {
1124
+ const ue = {
1103
1125
  OPEN: "#b45309",
1104
1126
  IN_PROGRESS: "#1d4ed8",
1105
1127
  DONE: "#15803d",
1106
1128
  CLOSED: "#6b7280"
1107
1129
  };
1108
- function M() {
1109
- return /* @__PURE__ */ d(
1130
+ function j() {
1131
+ return /* @__PURE__ */ a(
1110
1132
  "span",
1111
1133
  {
1112
1134
  style: {
@@ -1122,7 +1144,7 @@ function M() {
1122
1144
  color: "#ea580c"
1123
1145
  },
1124
1146
  children: [
1125
- /* @__PURE__ */ e(
1147
+ /* @__PURE__ */ t(
1126
1148
  "span",
1127
1149
  {
1128
1150
  style: {
@@ -1139,92 +1161,92 @@ function M() {
1139
1161
  }
1140
1162
  );
1141
1163
  }
1142
- function A({
1143
- status: o,
1144
- boardStatus: n,
1145
- p: t
1164
+ function G({
1165
+ status: n,
1166
+ boardStatus: e,
1167
+ p: o
1146
1168
  }) {
1147
- const a = (n == null ? void 0 : n.color) ?? oe[o] ?? "#9ca3af";
1148
- return /* @__PURE__ */ d(
1169
+ const p = (e == null ? void 0 : e.color) ?? ue[n] ?? "#9ca3af";
1170
+ return /* @__PURE__ */ a(
1149
1171
  "span",
1150
1172
  {
1151
1173
  style: {
1152
1174
  display: "inline-flex",
1153
1175
  alignItems: "center",
1154
1176
  gap: 5,
1155
- background: t.bgSoft,
1156
- border: `1px solid ${t.border}`,
1157
- borderRadius: 6,
1177
+ background: o.bgSoft,
1178
+ border: `1px solid ${o.border}`,
1179
+ borderRadius: x(6, o.radius),
1158
1180
  padding: "2px 8px",
1159
1181
  fontSize: 10,
1160
1182
  fontWeight: 600,
1161
- color: t.textSoft
1183
+ color: o.textSoft
1162
1184
  },
1163
1185
  children: [
1164
- /* @__PURE__ */ e(
1186
+ /* @__PURE__ */ t(
1165
1187
  "span",
1166
1188
  {
1167
1189
  style: {
1168
1190
  width: 6,
1169
1191
  height: 6,
1170
1192
  borderRadius: "50%",
1171
- background: a,
1193
+ background: p,
1172
1194
  display: "inline-block",
1173
1195
  flexShrink: 0
1174
1196
  }
1175
1197
  }
1176
1198
  ),
1177
- (n == null ? void 0 : n.name) ?? o.replace("_", " ")
1199
+ (e == null ? void 0 : e.name) ?? n.replace("_", " ")
1178
1200
  ]
1179
1201
  }
1180
1202
  );
1181
1203
  }
1182
- function re({
1183
- size: o = 16,
1184
- color: n = "currentColor"
1204
+ function he({
1205
+ size: n = 16,
1206
+ color: e = "currentColor"
1185
1207
  }) {
1186
- return /* @__PURE__ */ e(
1208
+ return /* @__PURE__ */ t(
1187
1209
  "svg",
1188
1210
  {
1189
- width: o,
1190
- height: o,
1211
+ width: n,
1212
+ height: n,
1191
1213
  viewBox: "0 0 24 24",
1192
1214
  fill: "none",
1193
- stroke: n,
1215
+ stroke: e,
1194
1216
  strokeWidth: 2,
1195
1217
  strokeLinecap: "round",
1196
1218
  strokeLinejoin: "round",
1197
- children: /* @__PURE__ */ e("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })
1219
+ children: /* @__PURE__ */ t("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })
1198
1220
  }
1199
1221
  );
1200
1222
  }
1201
- function D({
1202
- color: o = "currentColor",
1203
- size: n = 11
1223
+ function O({
1224
+ color: n = "currentColor",
1225
+ size: e = 11
1204
1226
  }) {
1205
- return /* @__PURE__ */ e(
1227
+ return /* @__PURE__ */ t(
1206
1228
  "svg",
1207
1229
  {
1208
- width: n,
1209
- height: n,
1230
+ width: e,
1231
+ height: e,
1210
1232
  viewBox: "0 0 16 16",
1211
1233
  fill: "none",
1212
- stroke: o,
1234
+ stroke: n,
1213
1235
  strokeWidth: 2.2,
1214
1236
  strokeLinecap: "round",
1215
1237
  strokeLinejoin: "round",
1216
- children: /* @__PURE__ */ e("path", { d: "M8 13V3M3 8l5-5 5 5" })
1238
+ children: /* @__PURE__ */ t("path", { d: "M8 13V3M3 8l5-5 5 5" })
1217
1239
  }
1218
1240
  );
1219
1241
  }
1220
- function P(o) {
1221
- return new Date(o).toLocaleDateString(void 0, {
1242
+ function V(n) {
1243
+ return new Date(n).toLocaleDateString(void 0, {
1222
1244
  month: "short",
1223
1245
  day: "numeric"
1224
1246
  });
1225
1247
  }
1226
1248
  export {
1227
- ae as FeedbackWidget,
1228
- de as UpstepProvider,
1229
- I as useUpstep
1249
+ ye as FeedbackWidget,
1250
+ be as UpstepProvider,
1251
+ E as useUpstep
1230
1252
  };