@usertour/helpers 0.0.61 → 0.0.63

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.
@@ -290,6 +290,7 @@ var convertToCssVars = (settings, type = "tooltip") => {
290
290
  "--usertour-main-active-background-color": hexToHSLString(
291
291
  settings.mainColor.autoActive
292
292
  ),
293
+ "--usertour-ring": hexToHSLString(settings.mainColor.autoActive),
293
294
  "--usertour-line-height": `${settings.font.lineHeight}px`,
294
295
  "--usertour-widget-popper-border-radius": `${settings.border.borderRadius}px`,
295
296
  "--usertour-font-weight-normal": settings.font.fontWeightNormal,
@@ -364,7 +365,7 @@ var convertToCssVars = (settings, type = "tooltip") => {
364
365
  "--usertour-checklist-trigger-hover-background-color": settings.checklistLauncher.color.hover,
365
366
  "--usertour-question-color": hexToHSLString(settings.survey.color),
366
367
  "--usertour-launcher-button-height": `${settings.launcherButtons.height}px`,
367
- "--usertour-launcher-button-width": settings.launcherButtons.width === 0 ? "auto" : `${settings.launcherButtons.width}px`,
368
+ "--usertour-launcher-button-width": !settings.launcherButtons.width ? "auto" : `${settings.launcherButtons.width}px`,
368
369
  "--usertour-launcher-button-horizontal-padding": `${settings.launcherButtons.px}px`,
369
370
  "--usertour-launcher-button-border-radius": `${settings.launcherButtons.borderRadius}px`,
370
371
  "--usertour-launcher-button-background-color": settings.launcherButtons.primary.backgroundColor.background,
@@ -548,7 +549,6 @@ describe("convert-settings", () => {
548
549
  },
549
550
  launcherButtons: {
550
551
  height: 32,
551
- width: 0,
552
552
  px: 16,
553
553
  borderRadius: 8,
554
554
  primary: {
@@ -919,7 +919,7 @@ describe("convert-settings", () => {
919
919
  const result = convertSettings(settings);
920
920
  expect(result.launcherButtons).toBeDefined();
921
921
  expect(result.launcherButtons.height).toBe(import_types2.defaultSettings.launcherButtons.height);
922
- expect(result.launcherButtons.width).toBe(import_types2.defaultSettings.launcherButtons.width);
922
+ expect(result.launcherButtons.width).toBeUndefined();
923
923
  expect(result.launcherButtons.px).toBe(import_types2.defaultSettings.launcherButtons.px);
924
924
  expect(result.launcherButtons.borderRadius).toBe(
925
925
  import_types2.defaultSettings.launcherButtons.borderRadius
@@ -1050,11 +1050,35 @@ describe("convert-settings", () => {
1050
1050
  expect(css).toContain("--usertour-launcher-button-hover-border-color:");
1051
1051
  expect(css).toContain("--usertour-launcher-button-active-border-color:");
1052
1052
  });
1053
- it("should set launcher button width to auto when width is 0", () => {
1053
+ it("should set launcher button width to auto when width is undefined", () => {
1054
1054
  const convertedSettings = convertSettings(completeSettings);
1055
1055
  const css = convertToCssVars(convertedSettings);
1056
1056
  expect(css).toContain("--usertour-launcher-button-width:auto");
1057
1057
  });
1058
+ it("should set launcher button width to auto when width is 0", () => {
1059
+ const settingsWithZeroWidth = {
1060
+ ...completeSettings,
1061
+ launcherButtons: {
1062
+ ...completeSettings.launcherButtons,
1063
+ width: 0
1064
+ }
1065
+ };
1066
+ const convertedSettings = convertSettings(settingsWithZeroWidth);
1067
+ const css = convertToCssVars(convertedSettings);
1068
+ expect(css).toContain("--usertour-launcher-button-width:auto");
1069
+ });
1070
+ it("should set launcher button width to specific value when width is provided", () => {
1071
+ const settingsWithWidth = {
1072
+ ...completeSettings,
1073
+ launcherButtons: {
1074
+ ...completeSettings.launcherButtons,
1075
+ width: 120
1076
+ }
1077
+ };
1078
+ const convertedSettings = convertSettings(settingsWithWidth);
1079
+ const css = convertToCssVars(convertedSettings);
1080
+ expect(css).toContain("--usertour-launcher-button-width:120px");
1081
+ });
1058
1082
  it("should set launcher button border width to 0px when border is disabled", () => {
1059
1083
  const convertedSettings = convertSettings(completeSettings);
1060
1084
  const css = convertToCssVars(convertedSettings);
@@ -2,7 +2,7 @@ import {
2
2
  convertSettings,
3
3
  convertToCssVars,
4
4
  mergeThemeDefaultSettings
5
- } from "../chunk-XKSTKX45.js";
5
+ } from "../chunk-XLRBUF5Z.js";
6
6
  import "../chunk-5C3J4DM2.js";
7
7
  import "../chunk-FZFHBCB6.js";
8
8
  import "../chunk-GFH3VWOC.js";
@@ -165,7 +165,6 @@ describe("convert-settings", () => {
165
165
  },
166
166
  launcherButtons: {
167
167
  height: 32,
168
- width: 0,
169
168
  px: 16,
170
169
  borderRadius: 8,
171
170
  primary: {
@@ -536,7 +535,7 @@ describe("convert-settings", () => {
536
535
  const result = convertSettings(settings);
537
536
  expect(result.launcherButtons).toBeDefined();
538
537
  expect(result.launcherButtons.height).toBe(defaultSettings.launcherButtons.height);
539
- expect(result.launcherButtons.width).toBe(defaultSettings.launcherButtons.width);
538
+ expect(result.launcherButtons.width).toBeUndefined();
540
539
  expect(result.launcherButtons.px).toBe(defaultSettings.launcherButtons.px);
541
540
  expect(result.launcherButtons.borderRadius).toBe(
542
541
  defaultSettings.launcherButtons.borderRadius
@@ -667,11 +666,35 @@ describe("convert-settings", () => {
667
666
  expect(css).toContain("--usertour-launcher-button-hover-border-color:");
668
667
  expect(css).toContain("--usertour-launcher-button-active-border-color:");
669
668
  });
670
- it("should set launcher button width to auto when width is 0", () => {
669
+ it("should set launcher button width to auto when width is undefined", () => {
671
670
  const convertedSettings = convertSettings(completeSettings);
672
671
  const css = convertToCssVars(convertedSettings);
673
672
  expect(css).toContain("--usertour-launcher-button-width:auto");
674
673
  });
674
+ it("should set launcher button width to auto when width is 0", () => {
675
+ const settingsWithZeroWidth = {
676
+ ...completeSettings,
677
+ launcherButtons: {
678
+ ...completeSettings.launcherButtons,
679
+ width: 0
680
+ }
681
+ };
682
+ const convertedSettings = convertSettings(settingsWithZeroWidth);
683
+ const css = convertToCssVars(convertedSettings);
684
+ expect(css).toContain("--usertour-launcher-button-width:auto");
685
+ });
686
+ it("should set launcher button width to specific value when width is provided", () => {
687
+ const settingsWithWidth = {
688
+ ...completeSettings,
689
+ launcherButtons: {
690
+ ...completeSettings.launcherButtons,
691
+ width: 120
692
+ }
693
+ };
694
+ const convertedSettings = convertSettings(settingsWithWidth);
695
+ const css = convertToCssVars(convertedSettings);
696
+ expect(css).toContain("--usertour-launcher-button-width:120px");
697
+ });
675
698
  it("should set launcher button border width to 0px when border is disabled", () => {
676
699
  const convertedSettings = convertSettings(completeSettings);
677
700
  const css = convertToCssVars(convertedSettings);
@@ -227,6 +227,7 @@ var convertToCssVars = (settings, type = "tooltip") => {
227
227
  "--usertour-main-active-background-color": hexToHSLString(
228
228
  settings.mainColor.autoActive
229
229
  ),
230
+ "--usertour-ring": hexToHSLString(settings.mainColor.autoActive),
230
231
  "--usertour-line-height": `${settings.font.lineHeight}px`,
231
232
  "--usertour-widget-popper-border-radius": `${settings.border.borderRadius}px`,
232
233
  "--usertour-font-weight-normal": settings.font.fontWeightNormal,
@@ -301,7 +302,7 @@ var convertToCssVars = (settings, type = "tooltip") => {
301
302
  "--usertour-checklist-trigger-hover-background-color": settings.checklistLauncher.color.hover,
302
303
  "--usertour-question-color": hexToHSLString(settings.survey.color),
303
304
  "--usertour-launcher-button-height": `${settings.launcherButtons.height}px`,
304
- "--usertour-launcher-button-width": settings.launcherButtons.width === 0 ? "auto" : `${settings.launcherButtons.width}px`,
305
+ "--usertour-launcher-button-width": !settings.launcherButtons.width ? "auto" : `${settings.launcherButtons.width}px`,
305
306
  "--usertour-launcher-button-horizontal-padding": `${settings.launcherButtons.px}px`,
306
307
  "--usertour-launcher-button-border-radius": `${settings.launcherButtons.borderRadius}px`,
307
308
  "--usertour-launcher-button-background-color": settings.launcherButtons.primary.backgroundColor.background,
@@ -299,6 +299,7 @@ var convertToCssVars = (settings, type = "tooltip") => {
299
299
  "--usertour-main-active-background-color": hexToHSLString(
300
300
  settings.mainColor.autoActive
301
301
  ),
302
+ "--usertour-ring": hexToHSLString(settings.mainColor.autoActive),
302
303
  "--usertour-line-height": `${settings.font.lineHeight}px`,
303
304
  "--usertour-widget-popper-border-radius": `${settings.border.borderRadius}px`,
304
305
  "--usertour-font-weight-normal": settings.font.fontWeightNormal,
@@ -373,7 +374,7 @@ var convertToCssVars = (settings, type = "tooltip") => {
373
374
  "--usertour-checklist-trigger-hover-background-color": settings.checklistLauncher.color.hover,
374
375
  "--usertour-question-color": hexToHSLString(settings.survey.color),
375
376
  "--usertour-launcher-button-height": `${settings.launcherButtons.height}px`,
376
- "--usertour-launcher-button-width": settings.launcherButtons.width === 0 ? "auto" : `${settings.launcherButtons.width}px`,
377
+ "--usertour-launcher-button-width": !settings.launcherButtons.width ? "auto" : `${settings.launcherButtons.width}px`,
377
378
  "--usertour-launcher-button-horizontal-padding": `${settings.launcherButtons.px}px`,
378
379
  "--usertour-launcher-button-border-radius": `${settings.launcherButtons.borderRadius}px`,
379
380
  "--usertour-launcher-button-background-color": settings.launcherButtons.primary.backgroundColor.background,
@@ -2,7 +2,7 @@ import {
2
2
  convertSettings,
3
3
  convertToCssVars,
4
4
  mergeThemeDefaultSettings
5
- } from "./chunk-XKSTKX45.js";
5
+ } from "./chunk-XLRBUF5Z.js";
6
6
  import "./chunk-5C3J4DM2.js";
7
7
  import "./chunk-FZFHBCB6.js";
8
8
  import "./chunk-GFH3VWOC.js";
package/dist/index.cjs CHANGED
@@ -601,6 +601,7 @@ var convertToCssVars = (settings, type = "tooltip") => {
601
601
  "--usertour-main-active-background-color": hexToHSLString(
602
602
  settings.mainColor.autoActive
603
603
  ),
604
+ "--usertour-ring": hexToHSLString(settings.mainColor.autoActive),
604
605
  "--usertour-line-height": `${settings.font.lineHeight}px`,
605
606
  "--usertour-widget-popper-border-radius": `${settings.border.borderRadius}px`,
606
607
  "--usertour-font-weight-normal": settings.font.fontWeightNormal,
@@ -675,7 +676,7 @@ var convertToCssVars = (settings, type = "tooltip") => {
675
676
  "--usertour-checklist-trigger-hover-background-color": settings.checklistLauncher.color.hover,
676
677
  "--usertour-question-color": hexToHSLString(settings.survey.color),
677
678
  "--usertour-launcher-button-height": `${settings.launcherButtons.height}px`,
678
- "--usertour-launcher-button-width": settings.launcherButtons.width === 0 ? "auto" : `${settings.launcherButtons.width}px`,
679
+ "--usertour-launcher-button-width": !settings.launcherButtons.width ? "auto" : `${settings.launcherButtons.width}px`,
679
680
  "--usertour-launcher-button-horizontal-padding": `${settings.launcherButtons.px}px`,
680
681
  "--usertour-launcher-button-border-radius": `${settings.launcherButtons.borderRadius}px`,
681
682
  "--usertour-launcher-button-background-color": settings.launcherButtons.primary.backgroundColor.background,
package/dist/index.js CHANGED
@@ -75,7 +75,7 @@ import {
75
75
  convertSettings,
76
76
  convertToCssVars,
77
77
  mergeThemeDefaultSettings
78
- } from "./chunk-XKSTKX45.js";
78
+ } from "./chunk-XLRBUF5Z.js";
79
79
  import {
80
80
  deepClone,
81
81
  parseUrlParams,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usertour/helpers",
3
- "version": "0.0.61",
3
+ "version": "0.0.63",
4
4
  "type": "module",
5
5
  "description": "Utility functions and helpers shared across the UserTour project",
6
6
  "homepage": "https://www.usertour.io",
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@paralleldrive/cuid2": "^2.2.2",
32
- "@usertour/types": "^0.0.45",
32
+ "@usertour/types": "^0.0.48",
33
33
  "chroma-js": "^3.1.2",
34
34
  "class-variance-authority": "^0.4.0",
35
35
  "date-fns": "^2.30.0",