@upstep/js 0.5.7 → 0.5.9

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/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const x=require("./api-BvhrcMKU.js"),w="#D97757",$={bg:"#ffffff",bgSoft:"#f6f5f2",bgHover:"#efede8",text:"#1a1915",textSoft:"#56544d",textFaint:"#9b9890",border:"#e8e6df",overlay:"rgba(26,25,21,.45)"},M={bg:"#1c1b19",bgSoft:"#262522",bgHover:"#302e2a",text:"#f5f4f0",textSoft:"#b4b1a8",textFaint:"#7d7a72",border:"#33312c",overlay:"rgba(0,0,0,.6)"};function E(o){return o==="light"||o==="dark"?o:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function L(o,e,t){return`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const v=require("./api-BvhrcMKU.js"),E="#D97757",x={bg:"#ffffff",bgSoft:"#f6f5f2",bgHover:"#efede8",text:"#1a1915",textSoft:"#56544d",textFaint:"#9b9890",border:"#e8e6df",overlay:"rgba(26,25,21,.45)"},m={bg:"#1c1b19",bgSoft:"#262522",bgHover:"#302e2a",text:"#f5f4f0",textSoft:"#b4b1a8",textFaint:"#7d7a72",border:"#33312c",overlay:"rgba(0,0,0,.6)"};function y(o){if(o==="light"||o==="dark")return o;if(typeof document<"u"){const e=document.documentElement;return e.classList.contains("dark")||e.getAttribute("data-theme")==="dark"?"dark":"light"}return typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function L(o,e,t){return`
2
2
  #upstep-root *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif}
3
3
  #upstep-btn{position:fixed;bottom:24px;${e==="left"?"left:24px":"right:24px"};z-index:9998;display:inline-flex;align-items:center;gap:7px;background:${o};color:#fff;border:none;border-radius:9999px;padding:12px 18px;font-size:14px;font-weight:600;cursor:grab;touch-action:none;box-shadow:0 6px 20px rgba(26,25,21,.18);transition:transform .15s,box-shadow .15s}
4
4
  #upstep-btn svg{width:16px;height:16px;flex-shrink:0}
@@ -47,7 +47,7 @@
47
47
  .upstep-feedback-date{font-size:11px;color:${t.textFaint}}
48
48
  .upstep-empty{text-align:center;color:${t.textFaint};font-size:14px;padding:40px 0}
49
49
  .upstep-empty strong{display:block;color:${t.textSoft};font-size:15px;margin-bottom:4px}
50
- `}const S='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>';class C{constructor(e,t={}){this.isOpen=!1,this.tab="submit",this.feedItems=[],this.selectedType="GENERAL",this.loading=!1,this.dragMoved=!1,this.client=e,this.accent=t.accentColor??w,this.position=t.position??"right",this.showLauncher=t.launcher!==!1,this.palette=E(t.theme??"auto")==="dark"?M:$}mount(){this.injectStyles(),this.showLauncher&&this.renderButton()}openWidget(){this.openModal()}closeWidget(){this.closeModal()}injectStyles(){var t;(t=document.getElementById("upstep-styles"))==null||t.remove();const e=document.createElement("style");e.id="upstep-styles",e.textContent=L(this.accent,this.position,this.palette),document.head.appendChild(e)}renderButton(){const e=document.createElement("button");e.id="upstep-btn",e.innerHTML=`${S}<span>Feedback</span>`,e.addEventListener("click",()=>{this.dragMoved||this.openModal()}),document.body.appendChild(e),this.makeDraggable(e)}makeDraggable(e){const s="upstep-btn-pos";try{const i=localStorage.getItem(s);if(i){const{side:a,bottom:u}=JSON.parse(i);e.style.left=a==="left"?"24px":"auto",e.style.right=a==="right"?"24px":"auto",e.style.top="auto",e.style.bottom=`${u}px`}}catch{}let r=0,c=0,d=0,f=0,b=!1;const y=()=>{const i=e.getBoundingClientRect(),a=i.left+i.width/2<window.innerWidth/2?"left":"right",u=Math.max(24,Math.min(window.innerHeight-i.height-24,i.top)),g=window.innerHeight-u-i.height;e.style.transition="left .25s cubic-bezier(.16,1,.3,1),right .25s cubic-bezier(.16,1,.3,1),top .25s cubic-bezier(.16,1,.3,1),bottom .25s cubic-bezier(.16,1,.3,1),transform .15s,box-shadow .15s",e.style.left=a==="left"?"24px":"auto",e.style.right=a==="right"?"24px":"auto",e.style.top="auto",e.style.bottom=`${g}px`;try{localStorage.setItem(s,JSON.stringify({side:a,bottom:g}))}catch{}},v=i=>{if(i.pointerType==="mouse"&&i.button!==0)return;this.dragMoved=!1,b=!0;const a=e.getBoundingClientRect();r=i.clientX,c=i.clientY,d=a.left,f=a.top,e.setPointerCapture(i.pointerId),e.style.transition="none"},k=i=>{if(!b)return;const a=i.clientX-r,u=i.clientY-c;!this.dragMoved&&Math.hypot(a,u)<6||(this.dragMoved||e.classList.add("upstep-dragging"),this.dragMoved=!0,e.style.left=`${d+a}px`,e.style.right="auto",e.style.top=`${f+u}px`,e.style.bottom="auto")},h=()=>{b&&(b=!1,e.classList.remove("upstep-dragging"),this.dragMoved&&y())};e.addEventListener("pointerdown",v),e.addEventListener("pointermove",k),e.addEventListener("pointerup",h),e.addEventListener("pointercancel",h)}openModal(){this.isOpen=!0,this.fetchFeed(),this.renderModal()}closeModal(){var e;this.isOpen=!1,(e=document.getElementById("upstep-backdrop"))==null||e.remove()}async fetchFeed(){try{const e=await this.client.listFeedback({sort:"votes",limit:20});this.feedItems=e.items,this.renderFeedList()}catch{}}renderModal(){var t,n;const e=document.createElement("div");e.id="upstep-backdrop",e.addEventListener("click",s=>{s.target===e&&this.closeModal()}),e.innerHTML=`
50
+ `}const S='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>';class C{constructor(e,t={}){this.isOpen=!1,this.tab="submit",this.feedItems=[],this.selectedType="GENERAL",this.loading=!1,this.dragMoved=!1,this.client=e,this.accent=t.accentColor??E,this.position=t.position??"right",this.showLauncher=t.launcher!==!1,this.themeMode=t.theme??"auto",this.palette=y(this.themeMode)==="dark"?m:x}mount(){this.injectStyles(),this.showLauncher&&this.renderButton()}openWidget(){this.openModal()}closeWidget(){this.closeModal()}injectStyles(){var t;(t=document.getElementById("upstep-styles"))==null||t.remove();const e=document.createElement("style");e.id="upstep-styles",e.textContent=L(this.accent,this.position,this.palette),document.head.appendChild(e)}renderButton(){const e=document.createElement("button");e.id="upstep-btn",e.innerHTML=`${S}<span>Feedback</span>`,e.addEventListener("click",()=>{this.dragMoved||this.openModal()}),document.body.appendChild(e),this.makeDraggable(e)}makeDraggable(e){const s="upstep-btn-pos";try{const i=localStorage.getItem(s);if(i){const{side:a,bottom:u}=JSON.parse(i);e.style.left=a==="left"?"24px":"auto",e.style.right=a==="right"?"24px":"auto",e.style.top="auto",e.style.bottom=`${u}px`}}catch{}let r=0,c=0,d=0,h=0,b=!1;const w=()=>{const i=e.getBoundingClientRect(),a=i.left+i.width/2<window.innerWidth/2?"left":"right",u=Math.max(24,Math.min(window.innerHeight-i.height-24,i.top)),g=window.innerHeight-u-i.height;e.style.transition="left .25s cubic-bezier(.16,1,.3,1),right .25s cubic-bezier(.16,1,.3,1),top .25s cubic-bezier(.16,1,.3,1),bottom .25s cubic-bezier(.16,1,.3,1),transform .15s,box-shadow .15s",e.style.left=a==="left"?"24px":"auto",e.style.right=a==="right"?"24px":"auto",e.style.top="auto",e.style.bottom=`${g}px`;try{localStorage.setItem(s,JSON.stringify({side:a,bottom:g}))}catch{}},$=i=>{if(i.pointerType==="mouse"&&i.button!==0)return;this.dragMoved=!1,b=!0;const a=e.getBoundingClientRect();r=i.clientX,c=i.clientY,d=a.left,h=a.top,e.setPointerCapture(i.pointerId),e.style.transition="none"},M=i=>{if(!b)return;const a=i.clientX-r,u=i.clientY-c;!this.dragMoved&&Math.hypot(a,u)<6||(this.dragMoved||e.classList.add("upstep-dragging"),this.dragMoved=!0,e.style.left=`${d+a}px`,e.style.right="auto",e.style.top=`${h+u}px`,e.style.bottom="auto")},f=()=>{b&&(b=!1,e.classList.remove("upstep-dragging"),this.dragMoved&&w())};e.addEventListener("pointerdown",$),e.addEventListener("pointermove",M),e.addEventListener("pointerup",f),e.addEventListener("pointercancel",f)}openModal(){this.isOpen=!0,this.palette=y(this.themeMode)==="dark"?m:x,this.injectStyles(),this.fetchFeed(),this.renderModal()}closeModal(){var e;this.isOpen=!1,(e=document.getElementById("upstep-backdrop"))==null||e.remove()}async fetchFeed(){try{const e=await this.client.listFeedback({sort:"votes",limit:20});this.feedItems=e.items,this.renderFeedList()}catch{}}renderModal(){var t,n;const e=document.createElement("div");e.id="upstep-backdrop",e.addEventListener("click",s=>{s.target===e&&this.closeModal()}),e.innerHTML=`
51
51
  <div id="upstep-modal">
52
52
  <div id="upstep-header">
53
53
  <div>
@@ -86,4 +86,4 @@
86
86
  <span class="upstep-feedback-date">${new Date(e.createdAt).toLocaleDateString()}</span>
87
87
  </div>
88
88
  </div>
89
- </div>`).join(""):'<div class="upstep-empty"><strong>No ideas yet</strong>Be the first to share one.</div>'}renderFeedList(){const e=document.getElementById("upstep-body");!e||this.tab!=="feed"||(e.innerHTML=this.renderFeed(),this.bindVoteButtons())}bindSubmitForm(){var e;document.querySelectorAll(".upstep-type-btn").forEach(t=>{t.addEventListener("click",()=>{this.selectedType=t.dataset.type,document.querySelectorAll(".upstep-type-btn").forEach(n=>n.classList.remove("selected")),t.classList.add("selected")})}),(e=document.getElementById("upstep-submit-btn"))==null||e.addEventListener("click",async()=>{const t=document.getElementById("upstep-textarea"),n=document.getElementById("upstep-form-msg"),s=document.getElementById("upstep-submit-btn");if(!t||this.loading)return;const r=t.value.trim();if(r){this.loading=!0,s&&(s.disabled=!0,s.textContent="Sending…");try{await this.client.submitFeedback({content:r,type:this.selectedType}),t.value="",n&&(n.textContent="Feedback received. Thank you."),await this.fetchFeed()}catch{n&&(n.textContent="Something went wrong. Please try again.")}finally{this.loading=!1,s&&(s.disabled=!1,s.textContent="Send feedback")}}})}bindVoteButtons(){document.querySelectorAll(".upstep-vote").forEach(e=>{e.addEventListener("click",async()=>{const t=e.dataset.feedback;try{await this.client.vote(t,"UP"),await this.fetchFeed()}catch{}})})}}function F(o){return o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}let p=null,l=null;const m={init(o){if(p=new x.UpstepApiClient(o),typeof window<"u"){const e={};o.accentColor!==void 0&&(e.accentColor=o.accentColor),o.position!==void 0&&(e.position=o.position),o.theme!==void 0&&(e.theme=o.theme),o.launcher!==void 0&&(e.launcher=o.launcher);const t=()=>{l=new C(p,e),l.mount()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t):t()}return p},open(){l==null||l.openWidget()},close(){l==null||l.closeWidget()},identify(o){p==null||p.setUserId(o)},get client(){if(!p)throw new Error("Upstep.init() must be called first");return p}};if(typeof document<"u"){const o=document.currentScript,e=o==null?void 0:o.dataset.apiKey,t=o==null?void 0:o.dataset.userId,n=o==null?void 0:o.dataset.baseUrl,s=o==null?void 0:o.dataset.accentColor,r=o==null?void 0:o.dataset.position,c=o==null?void 0:o.dataset.theme;if(e){const d={apiKey:e};t&&(d.userId=t),n&&(d.baseUrl=n),s&&(d.accentColor=s),(r==="left"||r==="right")&&(d.position=r),(c==="light"||c==="dark"||c==="auto")&&(d.theme=c),m.init(d)}}exports.UpstepApiClient=x.UpstepApiClient;exports.default=m;
89
+ </div>`).join(""):'<div class="upstep-empty"><strong>No ideas yet</strong>Be the first to share one.</div>'}renderFeedList(){const e=document.getElementById("upstep-body");!e||this.tab!=="feed"||(e.innerHTML=this.renderFeed(),this.bindVoteButtons())}bindSubmitForm(){var e;document.querySelectorAll(".upstep-type-btn").forEach(t=>{t.addEventListener("click",()=>{this.selectedType=t.dataset.type,document.querySelectorAll(".upstep-type-btn").forEach(n=>n.classList.remove("selected")),t.classList.add("selected")})}),(e=document.getElementById("upstep-submit-btn"))==null||e.addEventListener("click",async()=>{const t=document.getElementById("upstep-textarea"),n=document.getElementById("upstep-form-msg"),s=document.getElementById("upstep-submit-btn");if(!t||this.loading)return;const r=t.value.trim();if(r){this.loading=!0,s&&(s.disabled=!0,s.textContent="Sending…");try{await this.client.submitFeedback({content:r,type:this.selectedType}),t.value="",n&&(n.textContent="Feedback received. Thank you."),await this.fetchFeed()}catch{n&&(n.textContent="Something went wrong. Please try again.")}finally{this.loading=!1,s&&(s.disabled=!1,s.textContent="Send feedback")}}})}bindVoteButtons(){document.querySelectorAll(".upstep-vote").forEach(e=>{e.addEventListener("click",async()=>{const t=e.dataset.feedback;try{await this.client.vote(t,"UP"),await this.fetchFeed()}catch{}})})}}function F(o){return o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}let p=null,l=null;const k={init(o){if(p=new v.UpstepApiClient(o),typeof window<"u"){const e={};o.accentColor!==void 0&&(e.accentColor=o.accentColor),o.position!==void 0&&(e.position=o.position),o.theme!==void 0&&(e.theme=o.theme),o.launcher!==void 0&&(e.launcher=o.launcher);const t=()=>{l=new C(p,e),l.mount()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t):t()}return p},open(){l==null||l.openWidget()},close(){l==null||l.closeWidget()},identify(o){p==null||p.setUserId(o)},get client(){if(!p)throw new Error("Upstep.init() must be called first");return p}};if(typeof document<"u"){const o=document.currentScript,e=o==null?void 0:o.dataset.apiKey,t=o==null?void 0:o.dataset.userId,n=o==null?void 0:o.dataset.baseUrl,s=o==null?void 0:o.dataset.accentColor,r=o==null?void 0:o.dataset.position,c=o==null?void 0:o.dataset.theme;if(e){const d={apiKey:e};t&&(d.userId=t),n&&(d.baseUrl=n),s&&(d.accentColor=s),(r==="left"||r==="right")&&(d.position=r),(c==="light"||c==="dark"||c==="auto")&&(d.theme=c),k.init(d)}}exports.UpstepApiClient=v.UpstepApiClient;exports.default=k;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { U as v } from "./api-B-umoNRf.mjs";
2
- const k = "#D97757", w = {
1
+ import { U as $ } from "./api-B-umoNRf.mjs";
2
+ const M = "#D97757", x = {
3
3
  bg: "#ffffff",
4
4
  bgSoft: "#f6f5f2",
5
5
  bgHover: "#efede8",
@@ -8,7 +8,7 @@ const k = "#D97757", w = {
8
8
  textFaint: "#9b9890",
9
9
  border: "#e8e6df",
10
10
  overlay: "rgba(26,25,21,.45)"
11
- }, $ = {
11
+ }, m = {
12
12
  bg: "#1c1b19",
13
13
  bgSoft: "#262522",
14
14
  bgHover: "#302e2a",
@@ -18,8 +18,13 @@ const k = "#D97757", w = {
18
18
  border: "#33312c",
19
19
  overlay: "rgba(0,0,0,.6)"
20
20
  };
21
- function M(o) {
22
- return o === "light" || o === "dark" ? o : typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
21
+ function y(o) {
22
+ if (o === "light" || o === "dark") return o;
23
+ if (typeof document < "u") {
24
+ const e = document.documentElement;
25
+ return e.classList.contains("dark") || e.getAttribute("data-theme") === "dark" ? "dark" : "light";
26
+ }
27
+ return typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
23
28
  }
24
29
  function E(o, e, t) {
25
30
  return `
@@ -74,9 +79,9 @@ function E(o, e, t) {
74
79
  `;
75
80
  }
76
81
  const L = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>';
77
- class F {
82
+ class S {
78
83
  constructor(e, t = {}) {
79
- this.isOpen = !1, this.tab = "submit", this.feedItems = [], this.selectedType = "GENERAL", this.loading = !1, this.dragMoved = !1, this.client = e, this.accent = t.accentColor ?? k, this.position = t.position ?? "right", this.showLauncher = t.launcher !== !1, this.palette = M(t.theme ?? "auto") === "dark" ? $ : w;
84
+ this.isOpen = !1, this.tab = "submit", this.feedItems = [], this.selectedType = "GENERAL", this.loading = !1, this.dragMoved = !1, this.client = e, this.accent = t.accentColor ?? M, this.position = t.position ?? "right", this.showLauncher = t.launcher !== !1, this.themeMode = t.theme ?? "auto", this.palette = y(this.themeMode) === "dark" ? m : x;
80
85
  }
81
86
  mount() {
82
87
  this.injectStyles(), this.showLauncher && this.renderButton();
@@ -111,30 +116,30 @@ class F {
111
116
  }
112
117
  } catch {
113
118
  }
114
- let r = 0, c = 0, d = 0, f = 0, b = !1;
115
- const x = () => {
119
+ let r = 0, c = 0, d = 0, h = 0, b = !1;
120
+ const v = () => {
116
121
  const i = e.getBoundingClientRect(), a = i.left + i.width / 2 < window.innerWidth / 2 ? "left" : "right", u = Math.max(24, Math.min(window.innerHeight - i.height - 24, i.top)), g = window.innerHeight - u - i.height;
117
122
  e.style.transition = "left .25s cubic-bezier(.16,1,.3,1),right .25s cubic-bezier(.16,1,.3,1),top .25s cubic-bezier(.16,1,.3,1),bottom .25s cubic-bezier(.16,1,.3,1),transform .15s,box-shadow .15s", e.style.left = a === "left" ? "24px" : "auto", e.style.right = a === "right" ? "24px" : "auto", e.style.top = "auto", e.style.bottom = `${g}px`;
118
123
  try {
119
124
  localStorage.setItem(s, JSON.stringify({ side: a, bottom: g }));
120
125
  } catch {
121
126
  }
122
- }, m = (i) => {
127
+ }, k = (i) => {
123
128
  if (i.pointerType === "mouse" && i.button !== 0) return;
124
129
  this.dragMoved = !1, b = !0;
125
130
  const a = e.getBoundingClientRect();
126
- r = i.clientX, c = i.clientY, d = a.left, f = a.top, e.setPointerCapture(i.pointerId), e.style.transition = "none";
127
- }, y = (i) => {
131
+ r = i.clientX, c = i.clientY, d = a.left, h = a.top, e.setPointerCapture(i.pointerId), e.style.transition = "none";
132
+ }, w = (i) => {
128
133
  if (!b) return;
129
134
  const a = i.clientX - r, u = i.clientY - c;
130
- !this.dragMoved && Math.hypot(a, u) < 6 || (this.dragMoved || e.classList.add("upstep-dragging"), this.dragMoved = !0, e.style.left = `${d + a}px`, e.style.right = "auto", e.style.top = `${f + u}px`, e.style.bottom = "auto");
131
- }, h = () => {
132
- b && (b = !1, e.classList.remove("upstep-dragging"), this.dragMoved && x());
135
+ !this.dragMoved && Math.hypot(a, u) < 6 || (this.dragMoved || e.classList.add("upstep-dragging"), this.dragMoved = !0, e.style.left = `${d + a}px`, e.style.right = "auto", e.style.top = `${h + u}px`, e.style.bottom = "auto");
136
+ }, f = () => {
137
+ b && (b = !1, e.classList.remove("upstep-dragging"), this.dragMoved && v());
133
138
  };
134
- e.addEventListener("pointerdown", m), e.addEventListener("pointermove", y), e.addEventListener("pointerup", h), e.addEventListener("pointercancel", h);
139
+ e.addEventListener("pointerdown", k), e.addEventListener("pointermove", w), e.addEventListener("pointerup", f), e.addEventListener("pointercancel", f);
135
140
  }
136
141
  openModal() {
137
- this.isOpen = !0, this.fetchFeed(), this.renderModal();
142
+ this.isOpen = !0, this.palette = y(this.themeMode) === "dark" ? m : x, this.injectStyles(), this.fetchFeed(), this.renderModal();
138
143
  }
139
144
  closeModal() {
140
145
  var e;
@@ -201,7 +206,7 @@ class F {
201
206
  <span class="upstep-vote-count">${e.upvotes}</span>
202
207
  </button>
203
208
  <div class="upstep-feedback-main">
204
- <p class="upstep-feedback-content">${S(e.content)}</p>
209
+ <p class="upstep-feedback-content">${F(e.content)}</p>
205
210
  <div class="upstep-feedback-meta">
206
211
  <span class="upstep-badge upstep-badge-${e.type.toLowerCase()}">${e.type}</span>
207
212
  <span class="upstep-feedback-date">${new Date(e.createdAt).toLocaleDateString()}</span>
@@ -248,17 +253,17 @@ class F {
248
253
  });
249
254
  }
250
255
  }
251
- function S(o) {
256
+ function F(o) {
252
257
  return o.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
253
258
  }
254
259
  let p = null, l = null;
255
260
  const C = {
256
261
  init(o) {
257
- if (p = new v(o), typeof window < "u") {
262
+ if (p = new $(o), typeof window < "u") {
258
263
  const e = {};
259
264
  o.accentColor !== void 0 && (e.accentColor = o.accentColor), o.position !== void 0 && (e.position = o.position), o.theme !== void 0 && (e.theme = o.theme), o.launcher !== void 0 && (e.launcher = o.launcher);
260
265
  const t = () => {
261
- l = new F(p, e), l.mount();
266
+ l = new S(p, e), l.mount();
262
267
  };
263
268
  document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", t) : t();
264
269
  }
@@ -289,6 +294,6 @@ if (typeof document < "u") {
289
294
  }
290
295
  }
291
296
  export {
292
- v as UpstepApiClient,
297
+ $ as UpstepApiClient,
293
298
  C as default
294
299
  };
package/dist/react.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),L=require("./api-BvhrcMKU.js"),R="#D97757",M={bg:"#ffffff",bgSoft:"#f6f5f2",bgHover:"#efede8",text:"#1a1915",textSoft:"#56544d",textFaint:"#9b9890",border:"#e8e6df",overlay:"rgba(26,25,21,.45)"},D={bg:"#1c1b19",bgSoft:"#262522",bgHover:"#302e2a",text:"#f5f4f0",textSoft:"#b4b1a8",textFaint:"#7d7a72",border:"#33312c",overlay:"rgba(0,0,0,.6)"};function P(i){const[n,t]=r.useState(()=>i==="dark"?!0:i==="light"?!1:typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)").matches:!1);return r.useEffect(()=>{if(i!=="auto"||typeof window>"u"||!window.matchMedia){t(i==="dark");return}const f=window.matchMedia("(prefers-color-scheme: dark)"),u=s=>t(s.matches);return t(f.matches),f.addEventListener("change",u),()=>f.removeEventListener("change",u)},[i]),n?D:M}const F=r.createContext(null);function A({children:i,...n}){const[t]=r.useState(()=>new L.UpstepApiClient(n)),[f,u]=r.useState([]),[s,o]=r.useState(!1),[p,g]=r.useState(!0);r.useEffect(()=>{t.setUserId(n.userId)},[t,n.userId]);const l=r.useCallback(async()=>{try{const x=await t.listFeedback({sort:"votes",limit:20});u(x.items),g(x.showBranding??!0)}catch{}},[t]);r.useEffect(()=>{l()},[l]);const y=r.useCallback(async(x,j,h)=>{const d={content:j};x.trim()&&(d.title=x.trim()),h!==void 0&&(d.type=h),await t.submitFeedback(d),await l()},[t,l]),c=r.useCallback(async(x,j)=>{try{await t.vote(x,j),await l()}catch{}},[t,l]),a=r.useCallback(x=>t.getItem(x),[t]),b=r.useCallback(()=>o(!0),[]),k=r.useCallback(()=>o(!1),[]),S=r.useCallback(x=>t.setUserId(x),[t]);return e.jsx(F.Provider,{value:{client:t,feedItems:f,loadFeed:l,submit:y,vote:c,getItem:a,isOpen:s,open:b,close:k,identify:S,accentColor:n.accentColor??R,theme:n.theme??"auto",showBranding:p},children:i})}function v(){const i=r.useContext(F);if(!i)throw new Error("useUpstep must be used inside <UpstepProvider>");return i}function G({position:i="bottom-right",accentColor:n,theme:t,hideLauncher:f=!1}){const u=v(),s=n??u.accentColor,o=P(t??u.theme),{isOpen:p,open:g,close:l,showBranding:y}=u,[c,a]=r.useState("list"),[b,k]=r.useState(null),[S,x]=r.useState(()=>typeof window<"u"?window.matchMedia("(max-width: 639px)").matches:!1);r.useEffect(()=>{const m=window.matchMedia("(max-width: 639px)");x(m.matches);const w=U=>x(U.matches);return m.addEventListener("change",w),()=>m.removeEventListener("change",w)},[]);const j=i==="bottom-left"?{position:"fixed",bottom:24,left:24}:{position:"fixed",bottom:24,right:24},h='-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif';function d(){l(),setTimeout(()=>{a("list"),k(null)},300)}function T(m){k(m),a("detail")}return e.jsxs(e.Fragment,{children:[!f&&e.jsxs("button",{onClick:g,style:{...j,zIndex:9998,display:"inline-flex",alignItems:"center",gap:7,background:s,color:"#fff",border:"none",borderRadius:9999,padding:S?"12px":"12px 18px",fontSize:14,fontWeight:600,cursor:"pointer",fontFamily:h,boxShadow:"0 6px 20px rgba(26,25,21,.18)"},children:[e.jsx(Y,{size:16}),!S&&"Feedback"]}),p&&e.jsx("div",{onClick:m=>m.target===m.currentTarget&&d(),style:{position:"fixed",inset:0,background:o.overlay,backdropFilter:"blur(3px)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",padding:16,fontFamily:h},children:e.jsxs("div",{style:{background:o.bg,border:`1px solid ${o.border}`,borderRadius:20,width:"100%",maxWidth:440,maxHeight:"88vh",display:"flex",flexDirection:"column",overflow:"hidden",boxShadow:"0 24px 64px rgba(0,0,0,.28)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:`1px solid ${o.border}`,flexShrink:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[c!=="list"&&e.jsx("button",{onClick:()=>a("list"),style:{background:"none",border:"none",cursor:"pointer",color:s,fontSize:13,fontWeight:600,padding:0},children:"← Back"}),c==="list"&&e.jsx("span",{style:{fontWeight:700,fontSize:16,color:o.text,letterSpacing:"-.01em"},children:"Feedback"}),c==="create"&&e.jsx("span",{style:{fontWeight:700,fontSize:16,color:o.text,letterSpacing:"-.01em"},children:"New feedback"})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[c==="list"&&e.jsx("button",{onClick:()=>a("create"),style:{background:s,color:"#fff",border:"none",borderRadius:20,padding:"6px 14px",fontSize:13,fontWeight:700,cursor:"pointer"},children:"+ New"}),e.jsx("button",{onClick:d,style:{background:o.bgSoft,border:"none",width:28,height:28,borderRadius:8,fontSize:14,cursor:"pointer",color:o.textSoft,display:"flex",alignItems:"center",justifyContent:"center"},children:"✕"})]})]}),e.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"16px 20px 24px"},children:[c==="list"&&e.jsx(H,{onSelect:T,accent:s,p:o}),c==="detail"&&b&&e.jsx(N,{feedbackId:b,accent:s,p:o,font:h}),c==="create"&&e.jsx(O,{accent:s,p:o,font:h,onDone:()=>a("list")})]}),y&&e.jsxs("a",{href:"https://upstep.dev",target:"_blank",rel:"noopener noreferrer",style:{display:"block",textAlign:"center",padding:"8px 0",borderTop:`1px solid ${o.border}`,fontSize:11,color:o.textFaint,textDecoration:"none",flexShrink:0},children:["Powered by ",e.jsx("strong",{style:{fontWeight:700},children:"Upstep.dev"})]})]})})]})}function H({onSelect:i,accent:n,p:t}){const{feedItems:f,vote:u}=v(),s=f.filter(o=>o.status!=="CLOSED");return s.length?e.jsx(e.Fragment,{children:s.map(o=>{const p=o.userVote==="UP",g=o.title??o.content;return e.jsxs("div",{onClick:()=>i(o.id),style:{display:"flex",gap:12,padding:14,border:`1px solid ${t.border}`,borderRadius:14,marginBottom:10,background:t.bg,cursor:"pointer"},children:[e.jsxs("button",{onClick:l=>{l.stopPropagation(),u(o.id,"UP")},style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,minWidth:46,padding:"7px 0",borderRadius:11,cursor:"pointer",flexShrink:0,border:`1px solid ${p?n:t.border}`,background:p?`${n}1a`:t.bgSoft},children:[e.jsx(E,{color:n}),e.jsx("span",{style:{fontSize:14,fontWeight:700,color:t.text,lineHeight:1.1},children:o.upvotes})]}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("p",{style:{fontSize:13.5,fontWeight:600,lineHeight:1.4,color:t.text,margin:"0 0 6px",overflow:"hidden",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},children:g}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[e.jsx(z,{type:o.type,p:t}),o.status==="PENDING"?e.jsx(B,{}):e.jsx(W,{status:o.status,p:t}),e.jsx("span",{style:{fontSize:11,color:t.textFaint},children:I(o.createdAt)})]})]}),e.jsx("span",{style:{color:t.textFaint,fontSize:18,alignSelf:"center",flexShrink:0},children:"›"})]},o.id)})}):e.jsxs("div",{style:{textAlign:"center",padding:"40px 0"},children:[e.jsx("div",{style:{color:t.textSoft,fontSize:15,fontWeight:600,marginBottom:4},children:"No open feedback yet"}),e.jsx("div",{style:{color:t.textFaint,fontSize:14},children:"Be the first to share one."})]})}function N({feedbackId:i,accent:n,p:t,font:f}){const{vote:u,getItem:s}=v(),[o,p]=r.useState(null),[g,l]=r.useState(!1);r.useEffect(()=>{let a=!1;return s(i).then(b=>{a||p(b)}).catch(()=>{}),()=>{a=!0}},[i,s]);async function y(){if(!(!o||g)){l(!0);try{await u(o.id,"UP");const a=await s(i);p(a)}catch{}finally{l(!1)}}}if(!o)return e.jsx("div",{style:{textAlign:"center",padding:"40px 0",color:t.textFaint,fontSize:14},children:"Loading…"});const c=o.title;return e.jsxs("div",{children:[c&&e.jsx("div",{style:{fontSize:20,fontWeight:700,color:t.text,letterSpacing:"-.02em",marginBottom:10,lineHeight:1.3},children:c}),e.jsxs("div",{style:{display:"flex",gap:6,marginBottom:14,flexWrap:"wrap"},children:[e.jsx(z,{type:o.type,p:t}),o.status==="PENDING"?e.jsx(B,{}):e.jsx(W,{status:o.status,p:t})]}),e.jsx("p",{style:{fontSize:15,lineHeight:1.6,color:t.textSoft,marginBottom:20},children:o.content}),e.jsxs("button",{onClick:y,disabled:g,style:{display:"inline-flex",alignItems:"center",gap:8,border:`1px solid ${o.userVote==="UP"?n:t.border}`,background:o.userVote==="UP"?`${n}15`:t.bgSoft,borderRadius:12,padding:"10px 16px",cursor:"pointer",fontFamily:f},children:[e.jsx(E,{color:n,size:13}),e.jsx("span",{style:{fontSize:18,fontWeight:700,color:t.text},children:o.upvotes}),e.jsx("span",{style:{fontSize:13,color:t.textFaint},children:o.userVote==="UP"?"Upvoted":"Upvote"})]}),o.comments.length>0&&e.jsxs("div",{style:{marginTop:28,borderTop:`1px solid ${t.border}`,paddingTop:20},children:[e.jsx("div",{style:{fontSize:10,fontWeight:700,letterSpacing:".08em",color:t.textFaint,marginBottom:12,textTransform:"uppercase"},children:"Developer response"}),o.comments.map(a=>e.jsx($,{comment:a,p:t,accent:n},a.id))]})]})}function $({comment:i,p:n,accent:t}){return e.jsxs("div",{style:{background:n.bgSoft,border:`1px solid ${n.border}`,borderRadius:12,padding:14,marginBottom:10},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[e.jsx("span",{style:{background:`${t}20`,color:t,fontSize:11,fontWeight:700,borderRadius:20,padding:"2px 8px"},children:"Developer"}),e.jsx("span",{style:{fontSize:11,color:n.textFaint},children:I(i.createdAt)})]}),e.jsx("p",{style:{fontSize:14,lineHeight:1.5,color:n.textSoft,margin:0},children:i.content})]})}function O({accent:i,p:n,font:t,onDone:f}){const{submit:u}=v(),[s,o]=r.useState(""),[p,g]=r.useState(""),[l,y]=r.useState("GENERAL"),[c,a]=r.useState(!1),[b,k]=r.useState(!1),[S,x]=r.useState("");async function j(){if(!(!s.trim()||c)){a(!0),x("");try{await u(s.trim(),p.trim()||s.trim(),l),k(!0),setTimeout(f,1200)}catch{x("Something went wrong. Please try again.")}finally{a(!1)}}}if(b)return e.jsxs("div",{style:{textAlign:"center",paddingTop:40},children:[e.jsx("div",{style:{fontSize:18,fontWeight:700,color:n.text,marginBottom:6},children:"Submitted"}),e.jsx("div",{style:{fontSize:14,color:n.textFaint},children:"Feedback received. Thank you."})]});const h={width:"100%",border:`1px solid ${n.border}`,borderRadius:12,padding:"10px 12px",fontSize:14,lineHeight:1.5,outline:"none",background:n.bgSoft,color:n.text,fontFamily:t,boxSizing:"border-box"};return e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:10,fontWeight:700,letterSpacing:".08em",color:n.textFaint,marginBottom:8,textTransform:"uppercase"},children:"Type"}),e.jsx("div",{style:{display:"flex",gap:7,marginBottom:16},children:["BUG","FEATURE","GENERAL"].map(d=>e.jsxs("button",{onClick:()=>y(d),style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,padding:"8px 10px",borderRadius:9,fontSize:12.5,fontWeight:600,cursor:"pointer",background:l===d?i:n.bg,color:l===d?"#fff":n.textSoft,border:`1px solid ${l===d?i:n.border}`,fontFamily:t},children:[C[d].icon,C[d].label]},d))}),e.jsx("div",{style:{fontSize:10,fontWeight:700,letterSpacing:".08em",color:n.textFaint,marginBottom:8,textTransform:"uppercase"},children:"Title"}),e.jsx("input",{value:s,onChange:d=>o(d.target.value),placeholder:"Short summary of the issue or idea",maxLength:200,style:{...h,marginBottom:16,display:"block"}}),e.jsxs("div",{style:{fontSize:10,fontWeight:700,letterSpacing:".08em",color:n.textFaint,marginBottom:8,textTransform:"uppercase"},children:["Description ",e.jsx("span",{style:{fontWeight:400,textTransform:"none",letterSpacing:0},children:"(optional)"})]}),e.jsx("textarea",{value:p,onChange:d=>g(d.target.value),placeholder:"Steps to reproduce, expected behaviour, or more context",maxLength:2e3,rows:4,style:{...h,resize:"vertical",marginBottom:16}}),S&&e.jsx("p",{style:{fontSize:13,color:"#d6453d",marginBottom:12},children:S}),e.jsx("button",{onClick:j,disabled:c||!s.trim(),style:{width:"100%",padding:12,background:i,color:"#fff",border:"none",borderRadius:11,fontSize:14,fontWeight:600,cursor:"pointer",opacity:c||!s.trim()?.5:1,fontFamily:t},children:c?"Submitting…":"Submit feedback"})]})}const C={BUG:{label:"Bug",icon:e.jsxs("svg",{width:12,height:12,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("ellipse",{cx:"8",cy:"10",rx:"3.5",ry:"4.5"}),e.jsx("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"})]})},FEATURE:{label:"Feature",icon:e.jsxs("svg",{width:12,height:12,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("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"}),e.jsx("circle",{cx:"8",cy:"8",r:"2.5"})]})},GENERAL:{label:"General",icon:e.jsx("svg",{width:12,height:12,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M14 9a2 2 0 0 1-2 2H5L2 14V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v5z"})})}},V={BUG:"#fdecec",FEATURE:"#e9f0fd"},_={BUG:"#d6453d",FEATURE:"#3b76d6"};function z({type:i,p:n}){return e.jsx("span",{style:{padding:"2px 8px",borderRadius:9999,fontSize:10.5,fontWeight:700,letterSpacing:".02em",background:V[i]??n.bgSoft,color:_[i]??n.textSoft},children:i})}const q={OPEN:"#b45309",IN_PROGRESS:"#1d4ed8",DONE:"#15803d",CLOSED:"#6b7280"};function B(){return e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,background:"#fff7ed",border:"1px solid #fed7aa",borderRadius:6,padding:"1px 6px",fontSize:10,fontWeight:700,color:"#ea580c"},children:[e.jsx("span",{style:{width:5,height:5,borderRadius:"50%",background:"#ea580c",display:"inline-block"}}),"Pending review"]})}function W({status:i,p:n}){const t=q[i]??"#9ca3af";return e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:5,background:n.bgSoft,border:`1px solid ${n.border}`,borderRadius:6,padding:"2px 8px",fontSize:10,fontWeight:600,color:n.textSoft},children:[e.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:t,display:"inline-block",flexShrink:0}}),i.replace("_"," ")]})}function Y({size:i=16,color:n="currentColor"}){return e.jsx("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})}function E({color:i="currentColor",size:n=11}){return e.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"none",stroke:i,strokeWidth:2.2,strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M8 13V3M3 8l5-5 5 5"})})}function I(i){return new Date(i).toLocaleDateString(void 0,{month:"short",day:"numeric"})}exports.FeedbackWidget=G;exports.UpstepProvider=A;exports.useUpstep=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),L=require("./api-BvhrcMKU.js"),D="#D97757",M={bg:"#ffffff",bgSoft:"#f6f5f2",bgHover:"#efede8",text:"#1a1915",textSoft:"#56544d",textFaint:"#9b9890",border:"#e8e6df",overlay:"rgba(26,25,21,.45)"},P={bg:"#1c1b19",bgSoft:"#262522",bgHover:"#302e2a",text:"#f5f4f0",textSoft:"#b4b1a8",textFaint:"#7d7a72",border:"#33312c",overlay:"rgba(0,0,0,.6)"};function C(){if(typeof document>"u")return!1;const i=document.documentElement;return i.classList.contains("dark")||i.getAttribute("data-theme")==="dark"}function A(i){const[n,t]=r.useState(()=>i==="dark");return r.useEffect(()=>{if(i!=="auto"){t(i==="dark");return}if(t(C()),typeof MutationObserver>"u")return;const x=new MutationObserver(()=>t(C()));return x.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"]}),()=>x.disconnect()},[i]),n?P:M}const z=r.createContext(null);function H({children:i,...n}){const[t]=r.useState(()=>new L.UpstepApiClient(n)),[x,g]=r.useState([]),[s,o]=r.useState(!1),[f,p]=r.useState(!0);r.useEffect(()=>{t.setUserId(n.userId)},[t,n.userId]);const l=r.useCallback(async()=>{try{const u=await t.listFeedback({sort:"votes",limit:20});g(u.items),p(u.showBranding??!0)}catch{}},[t]);r.useEffect(()=>{l()},[l]);const y=r.useCallback(async(u,j,h)=>{const d={content:j};u.trim()&&(d.title=u.trim()),h!==void 0&&(d.type=h),await t.submitFeedback(d),await l()},[t,l]),c=r.useCallback(async(u,j)=>{try{await t.vote(u,j),await l()}catch{}},[t,l]),a=r.useCallback(u=>t.getItem(u),[t]),b=r.useCallback(()=>o(!0),[]),k=r.useCallback(()=>o(!1),[]),S=r.useCallback(u=>t.setUserId(u),[t]);return e.jsx(z.Provider,{value:{client:t,feedItems:x,loadFeed:l,submit:y,vote:c,getItem:a,isOpen:s,open:b,close:k,identify:S,accentColor:n.accentColor??D,theme:n.theme??"auto",showBranding:f},children:i})}function v(){const i=r.useContext(z);if(!i)throw new Error("useUpstep must be used inside <UpstepProvider>");return i}function G({position:i="bottom-right",accentColor:n,theme:t,hideLauncher:x=!1}){const g=v(),s=n??g.accentColor,o=A(t??g.theme),{isOpen:f,open:p,close:l,showBranding:y}=g,[c,a]=r.useState("list"),[b,k]=r.useState(null),[S,u]=r.useState(!1);r.useEffect(()=>{const m=window.matchMedia("(max-width: 639px)");u(m.matches);const w=R=>u(R.matches);return m.addEventListener("change",w),()=>m.removeEventListener("change",w)},[]);const j=i==="bottom-left"?{position:"fixed",bottom:24,left:24}:{position:"fixed",bottom:24,right:24},h='-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif';function d(){l(),setTimeout(()=>{a("list"),k(null)},300)}function U(m){k(m),a("detail")}return e.jsxs(e.Fragment,{children:[!x&&e.jsxs("button",{onClick:p,style:{...j,zIndex:9998,display:"inline-flex",alignItems:"center",gap:7,background:s,color:"#fff",border:"none",borderRadius:9999,padding:S?"12px":"12px 18px",fontSize:14,fontWeight:600,cursor:"pointer",fontFamily:h,boxShadow:"0 6px 20px rgba(26,25,21,.18)"},children:[e.jsx(K,{size:16}),!S&&"Feedback"]}),f&&e.jsx("div",{onClick:m=>m.target===m.currentTarget&&d(),style:{position:"fixed",inset:0,background:o.overlay,backdropFilter:"blur(3px)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",padding:16,fontFamily:h},children:e.jsxs("div",{style:{background:o.bg,border:`1px solid ${o.border}`,borderRadius:20,width:"100%",maxWidth:440,maxHeight:"88vh",display:"flex",flexDirection:"column",overflow:"hidden",boxShadow:"0 24px 64px rgba(0,0,0,.28)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:`1px solid ${o.border}`,flexShrink:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[c!=="list"&&e.jsx("button",{onClick:()=>a("list"),style:{background:"none",border:"none",cursor:"pointer",color:s,fontSize:13,fontWeight:600,padding:0},children:"← Back"}),c==="list"&&e.jsx("span",{style:{fontWeight:700,fontSize:16,color:o.text,letterSpacing:"-.01em"},children:"Feedback"}),c==="create"&&e.jsx("span",{style:{fontWeight:700,fontSize:16,color:o.text,letterSpacing:"-.01em"},children:"New feedback"})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[c==="list"&&e.jsx("button",{onClick:()=>a("create"),style:{background:s,color:"#fff",border:"none",borderRadius:20,padding:"6px 14px",fontSize:13,fontWeight:700,cursor:"pointer"},children:"+ New"}),e.jsx("button",{onClick:d,style:{background:o.bgSoft,border:"none",width:28,height:28,borderRadius:8,fontSize:14,cursor:"pointer",color:o.textSoft,display:"flex",alignItems:"center",justifyContent:"center"},children:"✕"})]})]}),e.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"16px 20px 24px"},children:[c==="list"&&e.jsx(N,{onSelect:U,accent:s,p:o}),c==="detail"&&b&&e.jsx(O,{feedbackId:b,accent:s,p:o,font:h}),c==="create"&&e.jsx(V,{accent:s,p:o,font:h,onDone:()=>a("list")})]}),y&&e.jsxs("a",{href:"https://upstep.dev",target:"_blank",rel:"noopener noreferrer",style:{display:"block",textAlign:"center",padding:"8px 0",borderTop:`1px solid ${o.border}`,fontSize:11,color:o.textFaint,textDecoration:"none",flexShrink:0},children:["Powered by ",e.jsx("strong",{style:{fontWeight:700},children:"Upstep.dev"})]})]})})]})}function N({onSelect:i,accent:n,p:t}){const{feedItems:x,vote:g}=v(),s=x.filter(o=>o.status!=="CLOSED");return s.length?e.jsx(e.Fragment,{children:s.map(o=>{const f=o.userVote==="UP",p=o.title??o.content;return e.jsxs("div",{onClick:()=>i(o.id),style:{display:"flex",gap:12,padding:14,border:`1px solid ${t.border}`,borderRadius:14,marginBottom:10,background:t.bg,cursor:"pointer"},children:[e.jsxs("button",{onClick:l=>{l.stopPropagation(),g(o.id,"UP")},style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,minWidth:46,padding:"7px 0",borderRadius:11,cursor:"pointer",flexShrink:0,border:`1px solid ${f?n:t.border}`,background:f?`${n}1a`:t.bgSoft},children:[e.jsx(I,{color:n}),e.jsx("span",{style:{fontSize:14,fontWeight:700,color:t.text,lineHeight:1.1},children:o.upvotes})]}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("p",{style:{fontSize:13.5,fontWeight:600,lineHeight:1.4,color:t.text,margin:"0 0 6px",overflow:"hidden",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},children:p}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[e.jsx(B,{type:o.type,p:t}),o.status==="PENDING"?e.jsx(W,{}):e.jsx(E,{status:o.status,p:t}),e.jsx("span",{style:{fontSize:11,color:t.textFaint},children:T(o.createdAt)})]})]}),e.jsx("span",{style:{color:t.textFaint,fontSize:18,alignSelf:"center",flexShrink:0},children:"›"})]},o.id)})}):e.jsxs("div",{style:{textAlign:"center",padding:"40px 0"},children:[e.jsx("div",{style:{color:t.textSoft,fontSize:15,fontWeight:600,marginBottom:4},children:"No open feedback yet"}),e.jsx("div",{style:{color:t.textFaint,fontSize:14},children:"Be the first to share one."})]})}function O({feedbackId:i,accent:n,p:t,font:x}){const{vote:g,getItem:s}=v(),[o,f]=r.useState(null),[p,l]=r.useState(!1);r.useEffect(()=>{let a=!1;return s(i).then(b=>{a||f(b)}).catch(()=>{}),()=>{a=!0}},[i,s]);async function y(){if(!(!o||p)){l(!0);try{await g(o.id,"UP");const a=await s(i);f(a)}catch{}finally{l(!1)}}}if(!o)return e.jsx("div",{style:{textAlign:"center",padding:"40px 0",color:t.textFaint,fontSize:14},children:"Loading…"});const c=o.title;return e.jsxs("div",{children:[c&&e.jsx("div",{style:{fontSize:20,fontWeight:700,color:t.text,letterSpacing:"-.02em",marginBottom:10,lineHeight:1.3},children:c}),e.jsxs("div",{style:{display:"flex",gap:6,marginBottom:14,flexWrap:"wrap"},children:[e.jsx(B,{type:o.type,p:t}),o.status==="PENDING"?e.jsx(W,{}):e.jsx(E,{status:o.status,p:t})]}),e.jsx("p",{style:{fontSize:15,lineHeight:1.6,color:t.textSoft,marginBottom:20},children:o.content}),e.jsxs("button",{onClick:y,disabled:p,style:{display:"inline-flex",alignItems:"center",gap:8,border:`1px solid ${o.userVote==="UP"?n:t.border}`,background:o.userVote==="UP"?`${n}15`:t.bgSoft,borderRadius:12,padding:"10px 16px",cursor:"pointer",fontFamily:x},children:[e.jsx(I,{color:n,size:13}),e.jsx("span",{style:{fontSize:18,fontWeight:700,color:t.text},children:o.upvotes}),e.jsx("span",{style:{fontSize:13,color:t.textFaint},children:o.userVote==="UP"?"Upvoted":"Upvote"})]}),o.comments.length>0&&e.jsxs("div",{style:{marginTop:28,borderTop:`1px solid ${t.border}`,paddingTop:20},children:[e.jsx("div",{style:{fontSize:10,fontWeight:700,letterSpacing:".08em",color:t.textFaint,marginBottom:12,textTransform:"uppercase"},children:"Developer response"}),o.comments.map(a=>e.jsx($,{comment:a,p:t,accent:n},a.id))]})]})}function $({comment:i,p:n,accent:t}){return e.jsxs("div",{style:{background:n.bgSoft,border:`1px solid ${n.border}`,borderRadius:12,padding:14,marginBottom:10},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[e.jsx("span",{style:{background:`${t}20`,color:t,fontSize:11,fontWeight:700,borderRadius:20,padding:"2px 8px"},children:"Developer"}),e.jsx("span",{style:{fontSize:11,color:n.textFaint},children:T(i.createdAt)})]}),e.jsx("p",{style:{fontSize:14,lineHeight:1.5,color:n.textSoft,margin:0},children:i.content})]})}function V({accent:i,p:n,font:t,onDone:x}){const{submit:g}=v(),[s,o]=r.useState(""),[f,p]=r.useState(""),[l,y]=r.useState("GENERAL"),[c,a]=r.useState(!1),[b,k]=r.useState(!1),[S,u]=r.useState("");async function j(){if(!(!s.trim()||c)){a(!0),u("");try{await g(s.trim(),f.trim()||s.trim(),l),k(!0),setTimeout(x,1200)}catch{u("Something went wrong. Please try again.")}finally{a(!1)}}}if(b)return e.jsxs("div",{style:{textAlign:"center",paddingTop:40},children:[e.jsx("div",{style:{fontSize:18,fontWeight:700,color:n.text,marginBottom:6},children:"Submitted"}),e.jsx("div",{style:{fontSize:14,color:n.textFaint},children:"Feedback received. Thank you."})]});const h={width:"100%",border:`1px solid ${n.border}`,borderRadius:12,padding:"10px 12px",fontSize:14,lineHeight:1.5,outline:"none",background:n.bgSoft,color:n.text,fontFamily:t,boxSizing:"border-box"};return e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:10,fontWeight:700,letterSpacing:".08em",color:n.textFaint,marginBottom:8,textTransform:"uppercase"},children:"Type"}),e.jsx("div",{style:{display:"flex",gap:7,marginBottom:16},children:["BUG","FEATURE","GENERAL"].map(d=>e.jsxs("button",{onClick:()=>y(d),style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,padding:"8px 10px",borderRadius:9,fontSize:12.5,fontWeight:600,cursor:"pointer",background:l===d?i:n.bg,color:l===d?"#fff":n.textSoft,border:`1px solid ${l===d?i:n.border}`,fontFamily:t},children:[F[d].icon,F[d].label]},d))}),e.jsx("div",{style:{fontSize:10,fontWeight:700,letterSpacing:".08em",color:n.textFaint,marginBottom:8,textTransform:"uppercase"},children:"Title"}),e.jsx("input",{value:s,onChange:d=>o(d.target.value),placeholder:"Short summary of the issue or idea",maxLength:200,style:{...h,marginBottom:16,display:"block"}}),e.jsxs("div",{style:{fontSize:10,fontWeight:700,letterSpacing:".08em",color:n.textFaint,marginBottom:8,textTransform:"uppercase"},children:["Description ",e.jsx("span",{style:{fontWeight:400,textTransform:"none",letterSpacing:0},children:"(optional)"})]}),e.jsx("textarea",{value:f,onChange:d=>p(d.target.value),placeholder:"Steps to reproduce, expected behaviour, or more context",maxLength:2e3,rows:4,style:{...h,resize:"vertical",marginBottom:16}}),S&&e.jsx("p",{style:{fontSize:13,color:"#d6453d",marginBottom:12},children:S}),e.jsx("button",{onClick:j,disabled:c||!s.trim(),style:{width:"100%",padding:12,background:i,color:"#fff",border:"none",borderRadius:11,fontSize:14,fontWeight:600,cursor:"pointer",opacity:c||!s.trim()?.5:1,fontFamily:t},children:c?"Submitting…":"Submit feedback"})]})}const F={BUG:{label:"Bug",icon:e.jsxs("svg",{width:12,height:12,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("ellipse",{cx:"8",cy:"10",rx:"3.5",ry:"4.5"}),e.jsx("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"})]})},FEATURE:{label:"Feature",icon:e.jsxs("svg",{width:12,height:12,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("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"}),e.jsx("circle",{cx:"8",cy:"8",r:"2.5"})]})},GENERAL:{label:"General",icon:e.jsx("svg",{width:12,height:12,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M14 9a2 2 0 0 1-2 2H5L2 14V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v5z"})})}},_={BUG:"#fdecec",FEATURE:"#e9f0fd"},q={BUG:"#d6453d",FEATURE:"#3b76d6"};function B({type:i,p:n}){return e.jsx("span",{style:{padding:"2px 8px",borderRadius:9999,fontSize:10.5,fontWeight:700,letterSpacing:".02em",background:_[i]??n.bgSoft,color:q[i]??n.textSoft},children:i})}const Y={OPEN:"#b45309",IN_PROGRESS:"#1d4ed8",DONE:"#15803d",CLOSED:"#6b7280"};function W(){return e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,background:"#fff7ed",border:"1px solid #fed7aa",borderRadius:6,padding:"1px 6px",fontSize:10,fontWeight:700,color:"#ea580c"},children:[e.jsx("span",{style:{width:5,height:5,borderRadius:"50%",background:"#ea580c",display:"inline-block"}}),"Pending review"]})}function E({status:i,p:n}){const t=Y[i]??"#9ca3af";return e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:5,background:n.bgSoft,border:`1px solid ${n.border}`,borderRadius:6,padding:"2px 8px",fontSize:10,fontWeight:600,color:n.textSoft},children:[e.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:t,display:"inline-block",flexShrink:0}}),i.replace("_"," ")]})}function K({size:i=16,color:n="currentColor"}){return e.jsx("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})}function I({color:i="currentColor",size:n=11}){return e.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"none",stroke:i,strokeWidth:2.2,strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M8 13V3M3 8l5-5 5 5"})})}function T(i){return new Date(i).toLocaleDateString(void 0,{month:"short",day:"numeric"})}exports.FeedbackWidget=G;exports.UpstepProvider=H;exports.useUpstep=v;
@@ -1 +1 @@
1
- {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAMZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAW,QAAQ,EAAE,YAAY,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACzG,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAMxC,KAAK,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAmD3C,UAAU,kBAAkB;IAC1B,MAAM,EAAE,eAAe,CAAC;IACxB,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/E,IAAI,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,GAAG,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE,OAAO,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC/D,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAC/C,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,SAAS,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;CACvB;AAID,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,GAAG,MAAM,EACV,EAAE,YAAY,GAAG;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,qBA6DxC;AAED,wBAAgB,SAAS,IAAI,kBAAkB,CAI9C;AAID,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,EAAE,cAAc,GAAG,aAAa,CAAC;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAID,wBAAgB,cAAc,CAAC,EAC7B,QAAyB,EACzB,WAAW,EACX,KAAK,EACL,YAAoB,GACrB,EAAE,mBAAmB,qBAmJrB"}
1
+ {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAMZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAW,QAAQ,EAAE,YAAY,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACzG,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAMxC,KAAK,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAsE3C,UAAU,kBAAkB;IAC1B,MAAM,EAAE,eAAe,CAAC;IACxB,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/E,IAAI,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,GAAG,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE,OAAO,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC/D,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAC/C,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,SAAS,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;CACvB;AAID,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,GAAG,MAAM,EACV,EAAE,YAAY,GAAG;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,qBA6DxC;AAED,wBAAgB,SAAS,IAAI,kBAAkB,CAI9C;AAID,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,EAAE,cAAc,GAAG,aAAa,CAAC;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAID,wBAAgB,cAAc,CAAC,EAC7B,QAAyB,EACzB,WAAW,EACX,KAAK,EACL,YAAoB,GACrB,EAAE,mBAAmB,qBAoJrB"}
package/dist/react.js CHANGED
@@ -1,7 +1,7 @@
1
- import { jsxs as r, Fragment as I, jsx as e } from "react/jsx-runtime";
2
- import { createContext as A, useState as p, useEffect as z, useCallback as w, useContext as G } from "react";
3
- import { U as H } from "./api-B-umoNRf.mjs";
4
- const N = "#D97757", $ = {
1
+ import { jsxs as r, Fragment as E, jsx as e } from "react/jsx-runtime";
2
+ import { createContext as H, useState as p, useEffect as z, useCallback as w, useContext as G } from "react";
3
+ import { U as N } from "./api-B-umoNRf.mjs";
4
+ const $ = "#D97757", O = {
5
5
  bg: "#ffffff",
6
6
  bgSoft: "#f6f5f2",
7
7
  bgHover: "#efede8",
@@ -20,104 +20,111 @@ const N = "#D97757", $ = {
20
20
  border: "#33312c",
21
21
  overlay: "rgba(0,0,0,.6)"
22
22
  };
23
- function O(i) {
24
- const [n, t] = p(() => i === "dark" ? !0 : i === "light" ? !1 : typeof window < "u" && window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)").matches : !1);
23
+ function W() {
24
+ if (typeof document > "u") return !1;
25
+ const i = document.documentElement;
26
+ return i.classList.contains("dark") || i.getAttribute("data-theme") === "dark";
27
+ }
28
+ function V(i) {
29
+ const [n, t] = p(() => i === "dark");
25
30
  return z(() => {
26
- if (i !== "auto" || typeof window > "u" || !window.matchMedia) {
31
+ if (i !== "auto") {
27
32
  t(i === "dark");
28
33
  return;
29
34
  }
30
- const h = window.matchMedia("(prefers-color-scheme: dark)"), g = (l) => t(l.matches);
31
- return t(h.matches), h.addEventListener("change", g), () => h.removeEventListener("change", g);
32
- }, [i]), n ? j : $;
35
+ if (t(W()), typeof MutationObserver > "u") return;
36
+ const u = new MutationObserver(() => t(W()));
37
+ return u.observe(document.documentElement, {
38
+ attributes: !0,
39
+ attributeFilter: ["class", "data-theme"]
40
+ }), () => u.disconnect();
41
+ }, [i]), n ? j : O;
33
42
  }
34
- const E = A(null);
35
- function ne({
43
+ const T = H(null);
44
+ function oe({
36
45
  children: i,
37
46
  ...n
38
47
  }) {
39
- const [t] = p(() => new H(n)), [h, g] = p([]), [l, o] = p(!1), [u, x] = p(!0);
48
+ const [t] = p(() => new N(n)), [u, h] = p([]), [l, o] = p(!1), [g, b] = p(!0);
40
49
  z(() => {
41
50
  t.setUserId(n.userId);
42
51
  }, [t, n.userId]);
43
52
  const d = w(async () => {
44
53
  try {
45
54
  const f = await t.listFeedback({ sort: "votes", limit: 20 });
46
- g(f.items), x(f.showBranding ?? !0);
55
+ h(f.items), b(f.showBranding ?? !0);
47
56
  } catch {
48
57
  }
49
58
  }, [t]);
50
59
  z(() => {
51
60
  d();
52
61
  }, [d]);
53
- const S = w(async (f, k, m) => {
54
- const s = { content: k };
55
- f.trim() && (s.title = f.trim()), m !== void 0 && (s.type = m), await t.submitFeedback(s), await d();
62
+ const S = w(async (f, k, x) => {
63
+ const a = { content: k };
64
+ f.trim() && (a.title = f.trim()), x !== void 0 && (a.type = x), await t.submitFeedback(a), await d();
56
65
  }, [t, d]), c = w(async (f, k) => {
57
66
  try {
58
67
  await t.vote(f, k), await d();
59
68
  } catch {
60
69
  }
61
- }, [t, d]), a = w(
70
+ }, [t, d]), s = w(
62
71
  (f) => t.getItem(f),
63
72
  [t]
64
- ), b = w(() => o(!0), []), F = w(() => o(!1), []), v = w((f) => t.setUserId(f), [t]);
73
+ ), m = w(() => o(!0), []), F = w(() => o(!1), []), v = w((f) => t.setUserId(f), [t]);
65
74
  return /* @__PURE__ */ e(
66
- E.Provider,
75
+ T.Provider,
67
76
  {
68
77
  value: {
69
78
  client: t,
70
- feedItems: h,
79
+ feedItems: u,
71
80
  loadFeed: d,
72
81
  submit: S,
73
82
  vote: c,
74
- getItem: a,
83
+ getItem: s,
75
84
  isOpen: l,
76
- open: b,
85
+ open: m,
77
86
  close: F,
78
87
  identify: v,
79
- accentColor: n.accentColor ?? N,
88
+ accentColor: n.accentColor ?? $,
80
89
  theme: n.theme ?? "auto",
81
- showBranding: u
90
+ showBranding: g
82
91
  },
83
92
  children: i
84
93
  }
85
94
  );
86
95
  }
87
96
  function B() {
88
- const i = G(E);
97
+ const i = G(T);
89
98
  if (!i) throw new Error("useUpstep must be used inside <UpstepProvider>");
90
99
  return i;
91
100
  }
92
- function oe({
101
+ function ie({
93
102
  position: i = "bottom-right",
94
103
  accentColor: n,
95
104
  theme: t,
96
- hideLauncher: h = !1
105
+ hideLauncher: u = !1
97
106
  }) {
98
- const g = B(), l = n ?? g.accentColor, o = O(t ?? g.theme), { isOpen: u, open: x, close: d, showBranding: S } = g, [c, a] = p("list"), [b, F] = p(null), [v, f] = p(
99
- () => typeof window < "u" ? window.matchMedia("(max-width: 639px)").matches : !1
100
- );
107
+ const h = B(), l = n ?? h.accentColor, o = V(t ?? h.theme), { isOpen: g, open: b, close: d, showBranding: S } = h, [c, s] = p("list"), [m, F] = p(null), [v, f] = p(!1);
101
108
  z(() => {
102
109
  const y = window.matchMedia("(max-width: 639px)");
103
110
  f(y.matches);
104
111
  const C = (P) => f(P.matches);
105
112
  return y.addEventListener("change", C), () => y.removeEventListener("change", C);
106
113
  }, []);
107
- const k = i === "bottom-left" ? { position: "fixed", bottom: 24, left: 24 } : { position: "fixed", bottom: 24, right: 24 }, m = '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif';
108
- function s() {
114
+ const k = i === "bottom-left" ? { position: "fixed", bottom: 24, left: 24 } : { position: "fixed", bottom: 24, right: 24 }, x = '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif';
115
+ function a() {
109
116
  d(), setTimeout(() => {
110
- a("list"), F(null);
117
+ s("list"), F(null);
111
118
  }, 300);
112
119
  }
113
- function D(y) {
114
- F(y), a("detail");
120
+ function A(y) {
121
+ F(y), s("detail");
115
122
  }
116
- return /* @__PURE__ */ r(I, { children: [
117
- !h && /* @__PURE__ */ r(
123
+ return /* @__PURE__ */ r(E, { children: [
124
+ !u && /* @__PURE__ */ r(
118
125
  "button",
119
126
  {
120
- onClick: x,
127
+ onClick: b,
121
128
  style: {
122
129
  ...k,
123
130
  zIndex: 9998,
@@ -132,19 +139,19 @@ function oe({
132
139
  fontSize: 14,
133
140
  fontWeight: 600,
134
141
  cursor: "pointer",
135
- fontFamily: m,
142
+ fontFamily: x,
136
143
  boxShadow: "0 6px 20px rgba(26,25,21,.18)"
137
144
  },
138
145
  children: [
139
- /* @__PURE__ */ e(X, { size: 16 }),
146
+ /* @__PURE__ */ e(Z, { size: 16 }),
140
147
  !v && "Feedback"
141
148
  ]
142
149
  }
143
150
  ),
144
- u && /* @__PURE__ */ e(
151
+ g && /* @__PURE__ */ e(
145
152
  "div",
146
153
  {
147
- onClick: (y) => y.target === y.currentTarget && s(),
154
+ onClick: (y) => y.target === y.currentTarget && a(),
148
155
  style: {
149
156
  position: "fixed",
150
157
  inset: 0,
@@ -155,7 +162,7 @@ function oe({
155
162
  alignItems: "center",
156
163
  justifyContent: "center",
157
164
  padding: 16,
158
- fontFamily: m
165
+ fontFamily: x
159
166
  },
160
167
  children: /* @__PURE__ */ r(
161
168
  "div",
@@ -178,7 +185,7 @@ function oe({
178
185
  c !== "list" && /* @__PURE__ */ e(
179
186
  "button",
180
187
  {
181
- onClick: () => a("list"),
188
+ onClick: () => s("list"),
182
189
  style: { background: "none", border: "none", cursor: "pointer", color: l, fontSize: 13, fontWeight: 600, padding: 0 },
183
190
  children: "← Back"
184
191
  }
@@ -190,7 +197,7 @@ function oe({
190
197
  c === "list" && /* @__PURE__ */ e(
191
198
  "button",
192
199
  {
193
- onClick: () => a("create"),
200
+ onClick: () => s("create"),
194
201
  style: { background: l, color: "#fff", border: "none", borderRadius: 20, padding: "6px 14px", fontSize: 13, fontWeight: 700, cursor: "pointer" },
195
202
  children: "+ New"
196
203
  }
@@ -198,7 +205,7 @@ function oe({
198
205
  /* @__PURE__ */ e(
199
206
  "button",
200
207
  {
201
- onClick: s,
208
+ onClick: a,
202
209
  style: { background: o.bgSoft, border: "none", width: 28, height: 28, borderRadius: 8, fontSize: 14, cursor: "pointer", color: o.textSoft, display: "flex", alignItems: "center", justifyContent: "center" },
203
210
  children: "✕"
204
211
  }
@@ -207,21 +214,21 @@ function oe({
207
214
  ] }),
208
215
  /* @__PURE__ */ r("div", { style: { flex: 1, overflowY: "auto", padding: "16px 20px 24px" }, children: [
209
216
  c === "list" && /* @__PURE__ */ e(
210
- V,
217
+ _,
211
218
  {
212
- onSelect: D,
219
+ onSelect: A,
213
220
  accent: l,
214
221
  p: o
215
222
  }
216
223
  ),
217
- c === "detail" && b && /* @__PURE__ */ e(_, { feedbackId: b, accent: l, p: o, font: m }),
224
+ c === "detail" && m && /* @__PURE__ */ e(Y, { feedbackId: m, accent: l, p: o, font: x }),
218
225
  c === "create" && /* @__PURE__ */ e(
219
- q,
226
+ K,
220
227
  {
221
228
  accent: l,
222
229
  p: o,
223
- font: m,
224
- onDone: () => a("list")
230
+ font: x,
231
+ onDone: () => s("list")
225
232
  }
226
233
  )
227
234
  ] }),
@@ -254,14 +261,14 @@ function oe({
254
261
  )
255
262
  ] });
256
263
  }
257
- function V({
264
+ function _({
258
265
  onSelect: i,
259
266
  accent: n,
260
267
  p: t
261
268
  }) {
262
- const { feedItems: h, vote: g } = B(), l = h.filter((o) => o.status !== "CLOSED");
263
- return l.length ? /* @__PURE__ */ e(I, { children: l.map((o) => {
264
- const u = o.userVote === "UP", x = o.title ?? o.content;
269
+ const { feedItems: u, vote: h } = B(), l = u.filter((o) => o.status !== "CLOSED");
270
+ return l.length ? /* @__PURE__ */ e(E, { children: l.map((o) => {
271
+ const g = o.userVote === "UP", b = o.title ?? o.content;
265
272
  return /* @__PURE__ */ r(
266
273
  "div",
267
274
  {
@@ -281,7 +288,7 @@ function V({
281
288
  "button",
282
289
  {
283
290
  onClick: (d) => {
284
- d.stopPropagation(), g(o.id, "UP");
291
+ d.stopPropagation(), h(o.id, "UP");
285
292
  },
286
293
  style: {
287
294
  display: "flex",
@@ -294,20 +301,20 @@ function V({
294
301
  borderRadius: 11,
295
302
  cursor: "pointer",
296
303
  flexShrink: 0,
297
- border: `1px solid ${u ? n : t.border}`,
298
- background: u ? `${n}1a` : t.bgSoft
304
+ border: `1px solid ${g ? n : t.border}`,
305
+ background: g ? `${n}1a` : t.bgSoft
299
306
  },
300
307
  children: [
301
- /* @__PURE__ */ e(R, { color: n }),
308
+ /* @__PURE__ */ e(D, { color: n }),
302
309
  /* @__PURE__ */ e("span", { style: { fontSize: 14, fontWeight: 700, color: t.text, lineHeight: 1.1 }, children: o.upvotes })
303
310
  ]
304
311
  }
305
312
  ),
306
313
  /* @__PURE__ */ r("div", { style: { flex: 1, minWidth: 0 }, children: [
307
- /* @__PURE__ */ e("p", { style: { fontSize: 13.5, fontWeight: 600, lineHeight: 1.4, color: t.text, margin: "0 0 6px", overflow: "hidden", display: "-webkit-box", WebkitLineClamp: 2, WebkitBoxOrient: "vertical" }, children: x }),
314
+ /* @__PURE__ */ e("p", { style: { fontSize: 13.5, fontWeight: 600, lineHeight: 1.4, color: t.text, margin: "0 0 6px", overflow: "hidden", display: "-webkit-box", WebkitLineClamp: 2, WebkitBoxOrient: "vertical" }, children: b }),
308
315
  /* @__PURE__ */ r("div", { style: { display: "flex", alignItems: "center", gap: 6, flexWrap: "wrap" }, children: [
309
- /* @__PURE__ */ e(T, { type: o.type, p: t }),
310
- o.status === "PENDING" ? /* @__PURE__ */ e(L, {}) : /* @__PURE__ */ e(U, { status: o.status, p: t }),
316
+ /* @__PURE__ */ e(U, { type: o.type, p: t }),
317
+ o.status === "PENDING" ? /* @__PURE__ */ e(L, {}) : /* @__PURE__ */ e(R, { status: o.status, p: t }),
311
318
  /* @__PURE__ */ e("span", { style: { fontSize: 11, color: t.textFaint }, children: M(o.createdAt) })
312
319
  ] })
313
320
  ] }),
@@ -321,24 +328,24 @@ function V({
321
328
  /* @__PURE__ */ e("div", { style: { color: t.textFaint, fontSize: 14 }, children: "Be the first to share one." })
322
329
  ] });
323
330
  }
324
- function _({ feedbackId: i, accent: n, p: t, font: h }) {
325
- const { vote: g, getItem: l } = B(), [o, u] = p(null), [x, d] = p(!1);
331
+ function Y({ feedbackId: i, accent: n, p: t, font: u }) {
332
+ const { vote: h, getItem: l } = B(), [o, g] = p(null), [b, d] = p(!1);
326
333
  z(() => {
327
- let a = !1;
328
- return l(i).then((b) => {
329
- a || u(b);
334
+ let s = !1;
335
+ return l(i).then((m) => {
336
+ s || g(m);
330
337
  }).catch(() => {
331
338
  }), () => {
332
- a = !0;
339
+ s = !0;
333
340
  };
334
341
  }, [i, l]);
335
342
  async function S() {
336
- if (!(!o || x)) {
343
+ if (!(!o || b)) {
337
344
  d(!0);
338
345
  try {
339
- await g(o.id, "UP");
340
- const a = await l(i);
341
- u(a);
346
+ await h(o.id, "UP");
347
+ const s = await l(i);
348
+ g(s);
342
349
  } catch {
343
350
  } finally {
344
351
  d(!1);
@@ -351,15 +358,15 @@ function _({ feedbackId: i, accent: n, p: t, font: h }) {
351
358
  return /* @__PURE__ */ r("div", { children: [
352
359
  c && /* @__PURE__ */ e("div", { style: { fontSize: 20, fontWeight: 700, color: t.text, letterSpacing: "-.02em", marginBottom: 10, lineHeight: 1.3 }, children: c }),
353
360
  /* @__PURE__ */ r("div", { style: { display: "flex", gap: 6, marginBottom: 14, flexWrap: "wrap" }, children: [
354
- /* @__PURE__ */ e(T, { type: o.type, p: t }),
355
- o.status === "PENDING" ? /* @__PURE__ */ e(L, {}) : /* @__PURE__ */ e(U, { status: o.status, p: t })
361
+ /* @__PURE__ */ e(U, { type: o.type, p: t }),
362
+ o.status === "PENDING" ? /* @__PURE__ */ e(L, {}) : /* @__PURE__ */ e(R, { status: o.status, p: t })
356
363
  ] }),
357
364
  /* @__PURE__ */ e("p", { style: { fontSize: 15, lineHeight: 1.6, color: t.textSoft, marginBottom: 20 }, children: o.content }),
358
365
  /* @__PURE__ */ r(
359
366
  "button",
360
367
  {
361
368
  onClick: S,
362
- disabled: x,
369
+ disabled: b,
363
370
  style: {
364
371
  display: "inline-flex",
365
372
  alignItems: "center",
@@ -369,10 +376,10 @@ function _({ feedbackId: i, accent: n, p: t, font: h }) {
369
376
  borderRadius: 12,
370
377
  padding: "10px 16px",
371
378
  cursor: "pointer",
372
- fontFamily: h
379
+ fontFamily: u
373
380
  },
374
381
  children: [
375
- /* @__PURE__ */ e(R, { color: n, size: 13 }),
382
+ /* @__PURE__ */ e(D, { color: n, size: 13 }),
376
383
  /* @__PURE__ */ e("span", { style: { fontSize: 18, fontWeight: 700, color: t.text }, children: o.upvotes }),
377
384
  /* @__PURE__ */ e("span", { style: { fontSize: 13, color: t.textFaint }, children: o.userVote === "UP" ? "Upvoted" : "Upvote" })
378
385
  ]
@@ -380,11 +387,11 @@ function _({ feedbackId: i, accent: n, p: t, font: h }) {
380
387
  ),
381
388
  o.comments.length > 0 && /* @__PURE__ */ r("div", { style: { marginTop: 28, borderTop: `1px solid ${t.border}`, paddingTop: 20 }, children: [
382
389
  /* @__PURE__ */ e("div", { style: { fontSize: 10, fontWeight: 700, letterSpacing: ".08em", color: t.textFaint, marginBottom: 12, textTransform: "uppercase" }, children: "Developer response" }),
383
- o.comments.map((a) => /* @__PURE__ */ e(Y, { comment: a, p: t, accent: n }, a.id))
390
+ o.comments.map((s) => /* @__PURE__ */ e(q, { comment: s, p: t, accent: n }, s.id))
384
391
  ] })
385
392
  ] });
386
393
  }
387
- function Y({ comment: i, p: n, accent: t }) {
394
+ function q({ comment: i, p: n, accent: t }) {
388
395
  return /* @__PURE__ */ r("div", { style: { background: n.bgSoft, border: `1px solid ${n.border}`, borderRadius: 12, padding: 14, marginBottom: 10 }, children: [
389
396
  /* @__PURE__ */ r("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 8 }, children: [
390
397
  /* @__PURE__ */ e("span", { style: { background: `${t}20`, color: t, fontSize: 11, fontWeight: 700, borderRadius: 20, padding: "2px 8px" }, children: "Developer" }),
@@ -393,26 +400,26 @@ function Y({ comment: i, p: n, accent: t }) {
393
400
  /* @__PURE__ */ e("p", { style: { fontSize: 14, lineHeight: 1.5, color: n.textSoft, margin: 0 }, children: i.content })
394
401
  ] });
395
402
  }
396
- function q({ accent: i, p: n, font: t, onDone: h }) {
397
- const { submit: g } = B(), [l, o] = p(""), [u, x] = p(""), [d, S] = p("GENERAL"), [c, a] = p(!1), [b, F] = p(!1), [v, f] = p("");
403
+ function K({ accent: i, p: n, font: t, onDone: u }) {
404
+ const { submit: h } = B(), [l, o] = p(""), [g, b] = p(""), [d, S] = p("GENERAL"), [c, s] = p(!1), [m, F] = p(!1), [v, f] = p("");
398
405
  async function k() {
399
406
  if (!(!l.trim() || c)) {
400
- a(!0), f("");
407
+ s(!0), f("");
401
408
  try {
402
- await g(l.trim(), u.trim() || l.trim(), d), F(!0), setTimeout(h, 1200);
409
+ await h(l.trim(), g.trim() || l.trim(), d), F(!0), setTimeout(u, 1200);
403
410
  } catch {
404
411
  f("Something went wrong. Please try again.");
405
412
  } finally {
406
- a(!1);
413
+ s(!1);
407
414
  }
408
415
  }
409
416
  }
410
- if (b)
417
+ if (m)
411
418
  return /* @__PURE__ */ r("div", { style: { textAlign: "center", paddingTop: 40 }, children: [
412
419
  /* @__PURE__ */ e("div", { style: { fontSize: 18, fontWeight: 700, color: n.text, marginBottom: 6 }, children: "Submitted" }),
413
420
  /* @__PURE__ */ e("div", { style: { fontSize: 14, color: n.textFaint }, children: "Feedback received. Thank you." })
414
421
  ] });
415
- const m = {
422
+ const x = {
416
423
  width: "100%",
417
424
  border: `1px solid ${n.border}`,
418
425
  borderRadius: 12,
@@ -427,10 +434,10 @@ function q({ accent: i, p: n, font: t, onDone: h }) {
427
434
  };
428
435
  return /* @__PURE__ */ r("div", { children: [
429
436
  /* @__PURE__ */ e("div", { style: { fontSize: 10, fontWeight: 700, letterSpacing: ".08em", color: n.textFaint, marginBottom: 8, textTransform: "uppercase" }, children: "Type" }),
430
- /* @__PURE__ */ e("div", { style: { display: "flex", gap: 7, marginBottom: 16 }, children: ["BUG", "FEATURE", "GENERAL"].map((s) => /* @__PURE__ */ r(
437
+ /* @__PURE__ */ e("div", { style: { display: "flex", gap: 7, marginBottom: 16 }, children: ["BUG", "FEATURE", "GENERAL"].map((a) => /* @__PURE__ */ r(
431
438
  "button",
432
439
  {
433
- onClick: () => S(s),
440
+ onClick: () => S(a),
434
441
  style: {
435
442
  flex: 1,
436
443
  display: "flex",
@@ -442,27 +449,27 @@ function q({ accent: i, p: n, font: t, onDone: h }) {
442
449
  fontSize: 12.5,
443
450
  fontWeight: 600,
444
451
  cursor: "pointer",
445
- background: d === s ? i : n.bg,
446
- color: d === s ? "#fff" : n.textSoft,
447
- border: `1px solid ${d === s ? i : n.border}`,
452
+ background: d === a ? i : n.bg,
453
+ color: d === a ? "#fff" : n.textSoft,
454
+ border: `1px solid ${d === a ? i : n.border}`,
448
455
  fontFamily: t
449
456
  },
450
457
  children: [
451
- W[s].icon,
452
- W[s].label
458
+ I[a].icon,
459
+ I[a].label
453
460
  ]
454
461
  },
455
- s
462
+ a
456
463
  )) }),
457
464
  /* @__PURE__ */ e("div", { style: { fontSize: 10, fontWeight: 700, letterSpacing: ".08em", color: n.textFaint, marginBottom: 8, textTransform: "uppercase" }, children: "Title" }),
458
465
  /* @__PURE__ */ e(
459
466
  "input",
460
467
  {
461
468
  value: l,
462
- onChange: (s) => o(s.target.value),
469
+ onChange: (a) => o(a.target.value),
463
470
  placeholder: "Short summary of the issue or idea",
464
471
  maxLength: 200,
465
- style: { ...m, marginBottom: 16, display: "block" }
472
+ style: { ...x, marginBottom: 16, display: "block" }
466
473
  }
467
474
  ),
468
475
  /* @__PURE__ */ r("div", { style: { fontSize: 10, fontWeight: 700, letterSpacing: ".08em", color: n.textFaint, marginBottom: 8, textTransform: "uppercase" }, children: [
@@ -472,12 +479,12 @@ function q({ accent: i, p: n, font: t, onDone: h }) {
472
479
  /* @__PURE__ */ e(
473
480
  "textarea",
474
481
  {
475
- value: u,
476
- onChange: (s) => x(s.target.value),
482
+ value: g,
483
+ onChange: (a) => b(a.target.value),
477
484
  placeholder: "Steps to reproduce, expected behaviour, or more context",
478
485
  maxLength: 2e3,
479
486
  rows: 4,
480
- style: { ...m, resize: "vertical", marginBottom: 16 }
487
+ style: { ...x, resize: "vertical", marginBottom: 16 }
481
488
  }
482
489
  ),
483
490
  v && /* @__PURE__ */ e("p", { style: { fontSize: 13, color: "#d6453d", marginBottom: 12 }, children: v }),
@@ -504,7 +511,7 @@ function q({ accent: i, p: n, font: t, onDone: h }) {
504
511
  )
505
512
  ] });
506
513
  }
507
- const W = {
514
+ const I = {
508
515
  BUG: {
509
516
  label: "Bug",
510
517
  icon: /* @__PURE__ */ r("svg", { width: 12, height: 12, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: 1.8, strokeLinecap: "round", strokeLinejoin: "round", children: [
@@ -523,19 +530,19 @@ const W = {
523
530
  label: "General",
524
531
  icon: /* @__PURE__ */ e("svg", { width: 12, height: 12, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: 1.8, strokeLinecap: "round", strokeLinejoin: "round", 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" }) })
525
532
  }
526
- }, K = { BUG: "#fdecec", FEATURE: "#e9f0fd" }, J = { BUG: "#d6453d", FEATURE: "#3b76d6" };
527
- function T({ type: i, p: n }) {
533
+ }, J = { BUG: "#fdecec", FEATURE: "#e9f0fd" }, Q = { BUG: "#d6453d", FEATURE: "#3b76d6" };
534
+ function U({ type: i, p: n }) {
528
535
  return /* @__PURE__ */ e("span", { style: {
529
536
  padding: "2px 8px",
530
537
  borderRadius: 9999,
531
538
  fontSize: 10.5,
532
539
  fontWeight: 700,
533
540
  letterSpacing: ".02em",
534
- background: K[i] ?? n.bgSoft,
535
- color: J[i] ?? n.textSoft
541
+ background: J[i] ?? n.bgSoft,
542
+ color: Q[i] ?? n.textSoft
536
543
  }, children: i });
537
544
  }
538
- const Q = {
545
+ const X = {
539
546
  OPEN: "#b45309",
540
547
  IN_PROGRESS: "#1d4ed8",
541
548
  DONE: "#15803d",
@@ -547,24 +554,24 @@ function L() {
547
554
  "Pending review"
548
555
  ] });
549
556
  }
550
- function U({ status: i, p: n }) {
551
- const t = Q[i] ?? "#9ca3af";
557
+ function R({ status: i, p: n }) {
558
+ const t = X[i] ?? "#9ca3af";
552
559
  return /* @__PURE__ */ r("span", { style: { display: "inline-flex", alignItems: "center", gap: 5, background: n.bgSoft, border: `1px solid ${n.border}`, borderRadius: 6, padding: "2px 8px", fontSize: 10, fontWeight: 600, color: n.textSoft }, children: [
553
560
  /* @__PURE__ */ e("span", { style: { width: 6, height: 6, borderRadius: "50%", background: t, display: "inline-block", flexShrink: 0 } }),
554
561
  i.replace("_", " ")
555
562
  ] });
556
563
  }
557
- function X({ size: i = 16, color: n = "currentColor" }) {
564
+ function Z({ size: i = 16, color: n = "currentColor" }) {
558
565
  return /* @__PURE__ */ e("svg", { width: i, height: i, viewBox: "0 0 24 24", fill: "none", stroke: n, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", 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" }) });
559
566
  }
560
- function R({ color: i = "currentColor", size: n = 11 }) {
567
+ function D({ color: i = "currentColor", size: n = 11 }) {
561
568
  return /* @__PURE__ */ e("svg", { width: n, height: n, viewBox: "0 0 16 16", fill: "none", stroke: i, strokeWidth: 2.2, strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("path", { d: "M8 13V3M3 8l5-5 5 5" }) });
562
569
  }
563
570
  function M(i) {
564
571
  return new Date(i).toLocaleDateString(void 0, { month: "short", day: "numeric" });
565
572
  }
566
573
  export {
567
- oe as FeedbackWidget,
568
- ne as UpstepProvider,
574
+ ie as FeedbackWidget,
575
+ oe as UpstepProvider,
569
576
  B as useUpstep
570
577
  };
package/dist/widget.d.ts CHANGED
@@ -18,6 +18,7 @@ export declare class UpstepWidget {
18
18
  private accent;
19
19
  private position;
20
20
  private showLauncher;
21
+ private themeMode;
21
22
  private palette;
22
23
  private dragMoved;
23
24
  constructor(client: UpstepApiClient, options?: WidgetOptions);
@@ -1 +1 @@
1
- {"version":3,"file":"widget.d.ts","sourceRoot":"","sources":["../src/widget.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAIxC,KAAK,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAuG3C,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,yEAAyE;IACzE,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,GAAG,CAAiB;IAC5B,OAAO,CAAC,SAAS,CAAkB;IACnC,OAAO,CAAC,YAAY,CAA2B;IAC/C,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,QAAQ,CAAmB;IACnC,OAAO,CAAC,YAAY,CAAU;IAC9B,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,SAAS,CAAS;gBAEd,MAAM,EAAE,eAAe,EAAE,OAAO,GAAE,aAAkB;IAQhE,KAAK;IAKL,4EAA4E;IAC5E,UAAU;IAIV,iDAAiD;IACjD,WAAW;IAIX,OAAO,CAAC,YAAY;IAQpB,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,aAAa;IA4ErB,OAAO,CAAC,SAAS;IAMjB,OAAO,CAAC,UAAU;YAKJ,SAAS;IAUvB,OAAO,CAAC,WAAW;IAyCnB,OAAO,CAAC,gBAAgB;IAoBxB,OAAO,CAAC,UAAU;IAwBlB,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,cAAc;IAyCtB,OAAO,CAAC,eAAe;CAaxB"}
1
+ {"version":3,"file":"widget.d.ts","sourceRoot":"","sources":["../src/widget.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAIxC,KAAK,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAoH3C,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,yEAAyE;IACzE,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,GAAG,CAAiB;IAC5B,OAAO,CAAC,SAAS,CAAkB;IACnC,OAAO,CAAC,YAAY,CAA2B;IAC/C,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,QAAQ,CAAmB;IACnC,OAAO,CAAC,YAAY,CAAU;IAC9B,OAAO,CAAC,SAAS,CAAY;IAC7B,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,SAAS,CAAS;gBAEd,MAAM,EAAE,eAAe,EAAE,OAAO,GAAE,aAAkB;IAShE,KAAK;IAKL,4EAA4E;IAC5E,UAAU;IAIV,iDAAiD;IACjD,WAAW;IAIX,OAAO,CAAC,YAAY;IAQpB,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,aAAa;IA4ErB,OAAO,CAAC,SAAS;IAUjB,OAAO,CAAC,UAAU;YAKJ,SAAS;IAUvB,OAAO,CAAC,WAAW;IAyCnB,OAAO,CAAC,gBAAgB;IAoBxB,OAAO,CAAC,UAAU;IAwBlB,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,cAAc;IAyCtB,OAAO,CAAC,eAAe;CAaxB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@upstep/js",
3
- "version": "0.5.7",
3
+ "version": "0.5.9",
4
4
  "description": "Upstep feedback widget for web apps",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",