feedback-vos 1.0.36 → 1.0.37
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.js +31 -25
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +31 -25
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +37 -18
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -12,30 +12,30 @@ var thoughtImageUrl = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzYiIGhlaWdodD0
|
|
|
12
12
|
// src/lib/theme.ts
|
|
13
13
|
function getThemeClasses(theme) {
|
|
14
14
|
return {
|
|
15
|
-
// Background colors - light mode
|
|
16
|
-
bgPrimary: theme === "dark" ? "bg-zinc-900" : "bg-
|
|
17
|
-
bgSecondary: theme === "dark" ? "bg-zinc-800" : "bg-gray-
|
|
18
|
-
bgTertiary: theme === "dark" ? "bg-zinc-700" : "bg-gray-
|
|
19
|
-
bgHover: theme === "dark" ? "hover:bg-zinc-600" : "hover:bg-gray-
|
|
20
|
-
bgHoverSecondary: theme === "dark" ? "hover:bg-zinc-700" : "hover:bg-gray-
|
|
15
|
+
// Background colors - light mode uses white for better clarity
|
|
16
|
+
bgPrimary: theme === "dark" ? "bg-zinc-900" : "bg-white",
|
|
17
|
+
bgSecondary: theme === "dark" ? "bg-zinc-800" : "bg-gray-50",
|
|
18
|
+
bgTertiary: theme === "dark" ? "bg-zinc-700" : "bg-gray-100",
|
|
19
|
+
bgHover: theme === "dark" ? "hover:bg-zinc-600" : "hover:bg-gray-100",
|
|
20
|
+
bgHoverSecondary: theme === "dark" ? "hover:bg-zinc-700" : "hover:bg-gray-50",
|
|
21
21
|
// Text colors
|
|
22
22
|
textPrimary: theme === "dark" ? "text-zinc-100" : "text-gray-900",
|
|
23
23
|
textSecondary: theme === "dark" ? "text-zinc-300" : "text-gray-700",
|
|
24
24
|
textTertiary: theme === "dark" ? "text-zinc-400" : "text-gray-600",
|
|
25
25
|
textMuted: theme === "dark" ? "text-neutral-400" : "text-gray-500",
|
|
26
|
-
// Border colors
|
|
27
|
-
borderPrimary: theme === "dark" ? "border-zinc-700" : "border-gray-
|
|
26
|
+
// Border colors - stronger borders in light mode for better definition
|
|
27
|
+
borderPrimary: theme === "dark" ? "border-zinc-700" : "border-gray-200",
|
|
28
28
|
borderSecondary: theme === "dark" ? "border-zinc-600" : "border-gray-300",
|
|
29
29
|
borderHover: theme === "dark" ? "hover:border-zinc-500" : "hover:border-gray-400",
|
|
30
30
|
// Canvas/Editor background
|
|
31
|
-
canvasBg: theme === "dark" ? "bg-zinc-900" : "bg-gray-
|
|
31
|
+
canvasBg: theme === "dark" ? "bg-zinc-900" : "bg-gray-100",
|
|
32
32
|
// Overlay
|
|
33
33
|
overlay: theme === "dark" ? "bg-black/80" : "bg-black/60",
|
|
34
34
|
// Focus ring offset
|
|
35
|
-
focusRingOffset: theme === "dark" ? "focus:ring-offset-zinc-900" : "focus:ring-offset-
|
|
36
|
-
// Button variants
|
|
37
|
-
buttonSecondary: theme === "dark" ? "bg-zinc-800 hover:bg-zinc-700 text-zinc-100" : "bg-
|
|
38
|
-
buttonTertiary: theme === "dark" ? "bg-zinc-700 hover:bg-zinc-600 text-zinc-100" : "bg-gray-
|
|
35
|
+
focusRingOffset: theme === "dark" ? "focus:ring-offset-zinc-900" : "focus:ring-offset-white",
|
|
36
|
+
// Button variants - clearer distinction in light mode
|
|
37
|
+
buttonSecondary: theme === "dark" ? "bg-zinc-800 hover:bg-zinc-700 text-zinc-100" : "bg-white hover:bg-gray-50 text-gray-900 border border-gray-200",
|
|
38
|
+
buttonTertiary: theme === "dark" ? "bg-zinc-700 hover:bg-zinc-600 text-zinc-100" : "bg-gray-50 hover:bg-gray-100 text-gray-900 border border-gray-200",
|
|
39
39
|
// Icon colors - make icons more visible (darker for better contrast)
|
|
40
40
|
iconColor: theme === "dark" ? "text-zinc-100" : "text-gray-900"
|
|
41
41
|
};
|
|
@@ -108,20 +108,20 @@ function FeedbackTypeStep({ onFeedbackTypeChanged, language, theme }) {
|
|
|
108
108
|
const feedbackTypes = getFeedbackTypes(language);
|
|
109
109
|
const themeClasses = getThemeClasses(theme);
|
|
110
110
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
111
|
-
/* @__PURE__ */ jsxs("header", { className:
|
|
112
|
-
/* @__PURE__ */ jsx("span", { className: `text-lg md:text-xl leading-6 ${themeClasses.textPrimary}`, children: t.form.header }),
|
|
111
|
+
/* @__PURE__ */ jsxs("header", { className: `flex items-center justify-between w-full gap-2 ${theme === "light" ? "pb-3 mb-2 border-b border-gray-200" : "pb-2"}`, children: [
|
|
112
|
+
/* @__PURE__ */ jsx("span", { className: `text-lg md:text-xl leading-6 font-semibold ${themeClasses.textPrimary}`, children: t.form.header }),
|
|
113
113
|
/* @__PURE__ */ jsx(CloseButton, { title: t.form.closeButton, theme })
|
|
114
114
|
] }),
|
|
115
115
|
/* @__PURE__ */ jsx("div", { className: "flex py-6 md:py-8 gap-2 md:gap-2 w-full justify-center md:justify-start flex-wrap", children: Object.entries(feedbackTypes).map(([key, value]) => {
|
|
116
116
|
return /* @__PURE__ */ jsxs(
|
|
117
117
|
"button",
|
|
118
118
|
{
|
|
119
|
-
className: `${themeClasses.bgSecondary} rounded py-4 md:py-5 flex-1 min-w-[80px] md:w-24 flex flex-col items-center gap-2 border-2 border-transparent hover:border-brand-500 focus:border-brand-500 focus:outline-none transition-
|
|
119
|
+
className: `${themeClasses.bgSecondary} rounded-lg py-4 md:py-5 flex-1 min-w-[80px] md:w-24 flex flex-col items-center gap-2 border-2 ${theme === "light" ? "border-gray-200" : "border-transparent"} hover:border-brand-500 focus:border-brand-500 focus:outline-none transition-all shadow-sm hover:shadow-md ${theme === "light" ? "hover:bg-white" : ""}`,
|
|
120
120
|
type: "button",
|
|
121
121
|
onClick: () => onFeedbackTypeChanged(key),
|
|
122
122
|
children: [
|
|
123
123
|
/* @__PURE__ */ jsx("img", { src: value.image.source, alt: value.image.alt, className: "w-5 h-5 md:w-6 md:h-6" }),
|
|
124
|
-
/* @__PURE__ */ jsx("span", { className: `text-xs md:text-sm text-center ${themeClasses.textPrimary}`, children: value.title })
|
|
124
|
+
/* @__PURE__ */ jsx("span", { className: `text-xs md:text-sm text-center font-medium ${themeClasses.textPrimary}`, children: value.title })
|
|
125
125
|
]
|
|
126
126
|
},
|
|
127
127
|
key
|
|
@@ -381,7 +381,13 @@ function ScreenshotButton({
|
|
|
381
381
|
const themeClasses = getThemeClasses(theme);
|
|
382
382
|
async function handleTakeScreenshot() {
|
|
383
383
|
setIsTakenScreenShot(true);
|
|
384
|
-
const canvas = await html2canvas(document.
|
|
384
|
+
const canvas = await html2canvas(document.body, {
|
|
385
|
+
width: window.innerWidth,
|
|
386
|
+
height: window.innerHeight,
|
|
387
|
+
scrollX: -window.scrollX,
|
|
388
|
+
scrollY: -window.scrollY,
|
|
389
|
+
windowWidth: window.innerWidth,
|
|
390
|
+
windowHeight: window.innerHeight,
|
|
385
391
|
ignoreElements: (element) => {
|
|
386
392
|
return element.hasAttribute("data-feedback-widget") || element.closest("[data-feedback-widget]") !== null;
|
|
387
393
|
}
|
|
@@ -1244,7 +1250,7 @@ function FeedbackContentStep({
|
|
|
1244
1250
|
}
|
|
1245
1251
|
}
|
|
1246
1252
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1247
|
-
/* @__PURE__ */ jsxs("header", { className:
|
|
1253
|
+
/* @__PURE__ */ jsxs("header", { className: `relative w-full ${theme === "light" ? "pb-3 mb-3 border-b border-gray-200" : "pb-2 mb-2"}`, children: [
|
|
1248
1254
|
/* @__PURE__ */ jsx(
|
|
1249
1255
|
"button",
|
|
1250
1256
|
{
|
|
@@ -1254,7 +1260,7 @@ function FeedbackContentStep({
|
|
|
1254
1260
|
children: /* @__PURE__ */ jsx(ArrowLeft, { weight: "bold", className: "w-5 h-5 md:w-5 md:h-5" })
|
|
1255
1261
|
}
|
|
1256
1262
|
),
|
|
1257
|
-
/* @__PURE__ */ jsxs("span", { className: `text-lg md:text-xl leading-6 flex items-center gap-2 pl-10 md:pl-12 pr-10 md:pr-12 ${themeClasses.textPrimary}`, children: [
|
|
1263
|
+
/* @__PURE__ */ jsxs("span", { className: `text-lg md:text-xl leading-6 flex items-center gap-2 pl-10 md:pl-12 pr-10 md:pr-12 font-semibold ${themeClasses.textPrimary}`, children: [
|
|
1258
1264
|
/* @__PURE__ */ jsx(
|
|
1259
1265
|
"img",
|
|
1260
1266
|
{
|
|
@@ -1272,10 +1278,10 @@ function FeedbackContentStep({
|
|
|
1272
1278
|
"textarea",
|
|
1273
1279
|
{
|
|
1274
1280
|
className: `w-full min-h-[100px] md:min-h-[112px] text-sm
|
|
1275
|
-
${themeClasses.textPrimary} border-2 border-brand-500 bg-transparent rounded-md p-2 md:p-3
|
|
1281
|
+
${themeClasses.textPrimary} border-2 ${theme === "light" ? "border-gray-300" : "border-brand-500"} ${theme === "light" ? "bg-gray-50" : "bg-transparent"} rounded-md p-2 md:p-3
|
|
1276
1282
|
${theme === "dark" ? "placeholder:text-zinc-400" : "placeholder:text-gray-500"}
|
|
1277
1283
|
focus:border-brand-500 focus:ring-brand-500 focus:ring-1 resize-none focus:outline-none
|
|
1278
|
-
${theme === "dark" ? "scrollbar-thumb-zinc-700" : "scrollbar-thumb-gray-400"} scrollbar-track-transparent scrollbar-thin`,
|
|
1284
|
+
${theme === "dark" ? "scrollbar-thumb-zinc-700" : "scrollbar-thumb-gray-400"} scrollbar-track-transparent scrollbar-thin transition-colors`,
|
|
1279
1285
|
placeholder: t.content.placeholder,
|
|
1280
1286
|
onChange: (e) => setComment(e.target.value)
|
|
1281
1287
|
}
|
|
@@ -1320,13 +1326,13 @@ function FeedbackSuccessStep({ onFeedbackRestartRequest, language, theme }) {
|
|
|
1320
1326
|
const t = getTranslations(language);
|
|
1321
1327
|
const themeClasses = getThemeClasses(theme);
|
|
1322
1328
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1323
|
-
/* @__PURE__ */ jsx("header", { children: /* @__PURE__ */ jsx(CloseButton, { title: t.form.closeButton, theme }) }),
|
|
1329
|
+
/* @__PURE__ */ jsx("header", { className: `flex items-center justify-end w-full ${theme === "light" ? "pb-3 mb-2 border-b border-gray-200" : "pb-2"}`, children: /* @__PURE__ */ jsx(CloseButton, { title: t.form.closeButton, theme }) }),
|
|
1324
1330
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center py-8 md:py-10 w-full max-w-[304px] px-2", children: [
|
|
1325
1331
|
/* @__PURE__ */ jsxs("svg", { width: "41", height: "40", viewBox: "0 0 41 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "w-10 h-10 md:w-[41px] md:h-[40px]", children: [
|
|
1326
1332
|
/* @__PURE__ */ jsx("path", { d: "M38.5 34C38.5 36.209 36.709 38 34.5 38H6.5C4.291 38 2.5 36.209 2.5 34V6C2.5 3.791 4.291 2 6.5 2H34.5C36.709 2 38.5 3.791 38.5 6V34Z", fill: "#77B255" }),
|
|
1327
1333
|
/* @__PURE__ */ jsx("path", { d: "M31.78 8.36202C30.624 7.61102 29.076 7.94002 28.322 9.09802L17.436 25.877L12.407 21.227C11.393 20.289 9.81103 20.352 8.87403 21.365C7.93703 22.379 7.99903 23.961 9.01303 24.898L16.222 31.564C16.702 32.009 17.312 32.229 17.918 32.229C18.591 32.229 19.452 31.947 20.017 31.09C20.349 30.584 32.517 11.82 32.517 11.82C33.268 10.661 32.938 9.11302 31.78 8.36202Z", fill: "white" })
|
|
1328
1334
|
] }),
|
|
1329
|
-
/* @__PURE__ */ jsx("span", { className: `text-lg md:text-xl mt-2 text-center ${themeClasses.textPrimary}`, children: t.success.message }),
|
|
1335
|
+
/* @__PURE__ */ jsx("span", { className: `text-lg md:text-xl mt-2 text-center font-medium ${themeClasses.textPrimary}`, children: t.success.message }),
|
|
1330
1336
|
/* @__PURE__ */ jsx(
|
|
1331
1337
|
"button",
|
|
1332
1338
|
{
|
|
@@ -1373,7 +1379,7 @@ function WidgetForm({ integration, githubConfig, language, theme }) {
|
|
|
1373
1379
|
setFeedbackSent(false);
|
|
1374
1380
|
setFeedbackType(null);
|
|
1375
1381
|
}
|
|
1376
|
-
return /* @__PURE__ */ jsxs("div", { className: `${themeClasses.bgPrimary} p-3 md:p-4 relative rounded-2xl mb-4 flex flex-col items-center shadow-lg w-[calc(100vw-2rem)] md:w-auto md:min-w-[384px] max-w-md`, children: [
|
|
1382
|
+
return /* @__PURE__ */ jsxs("div", { className: `${themeClasses.bgPrimary} p-3 md:p-4 relative rounded-2xl mb-4 flex flex-col items-center ${theme === "light" ? "shadow-xl border border-gray-200" : "shadow-lg"} w-[calc(100vw-2rem)] md:w-auto md:min-w-[384px] max-w-md`, children: [
|
|
1377
1383
|
feedbackSent ? /* @__PURE__ */ jsx(FeedbackSuccessStep, { onFeedbackRestartRequest: handleRestartFeedback, language, theme }) : /* @__PURE__ */ jsx(Fragment, { children: !feedbackType ? /* @__PURE__ */ jsx(FeedbackTypeStep, { onFeedbackTypeChanged: setFeedbackType, language, theme }) : /* @__PURE__ */ jsx(
|
|
1378
1384
|
FeedbackContentStep,
|
|
1379
1385
|
{
|