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