@vonage/vivid 4.15.0 → 4.16.1

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.
@@ -23,6 +23,16 @@ const roundToStepValue = (value, step) => {
23
23
  const roundedValue = Math.round(value / step) * step;
24
24
  return Math.round(roundedValue * factor) / factor;
25
25
  };
26
+ const handleStepValue = (step) => step > 0 ? step : 1;
27
+ const defaultToOneConverter = {
28
+ fromView(value) {
29
+ const num = Number(value);
30
+ return handleStepValue(num);
31
+ },
32
+ toView(value) {
33
+ return value.toString();
34
+ }
35
+ };
26
36
 
27
37
  const lerp = (a, b, value) => a + (b - a) * value;
28
38
  const inverseLerp = (a, b, value) => numbers.limit(0, 1, (value - a) / (b - a));
@@ -97,6 +107,7 @@ const SliderTemplate = (context) => {
97
107
  };
98
108
 
99
109
  exports.SliderTemplate = SliderTemplate;
110
+ exports.defaultToOneConverter = defaultToOneConverter;
100
111
  exports.getMarkersTemplate = getMarkersTemplate;
101
112
  exports.inverseLerp = inverseLerp;
102
113
  exports.lerp = lerp;
@@ -21,6 +21,16 @@ const roundToStepValue = (value, step) => {
21
21
  const roundedValue = Math.round(value / step) * step;
22
22
  return Math.round(roundedValue * factor) / factor;
23
23
  };
24
+ const handleStepValue = (step) => step > 0 ? step : 1;
25
+ const defaultToOneConverter = {
26
+ fromView(value) {
27
+ const num = Number(value);
28
+ return handleStepValue(num);
29
+ },
30
+ toView(value) {
31
+ return value.toString();
32
+ }
33
+ };
24
34
 
25
35
  const lerp = (a, b, value) => a + (b - a) * value;
26
36
  const inverseLerp = (a, b, value) => limit(0, 1, (value - a) / (b - a));
@@ -94,4 +104,4 @@ const SliderTemplate = (context) => {
94
104
  >`;
95
105
  };
96
106
 
97
- export { SliderTemplate as S, getMarkersTemplate as g, inverseLerp as i, lerp as l, roundToStepValue as r };
107
+ export { SliderTemplate as S, defaultToOneConverter as d, getMarkersTemplate as g, inverseLerp as i, lerp as l, roundToStepValue as r };
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 13 Feb 2025 13:39:16 GMT
3
+ * Generated on Tue, 18 Feb 2025 11:18:19 GMT
4
4
  */
5
5
  .vvd-root {
6
6
  color-scheme: var(--vvd-color-scheme);
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 13 Feb 2025 13:39:16 GMT
3
+ * Generated on Tue, 18 Feb 2025 11:18:19 GMT
4
4
  */
5
5
  .vvd-root {
6
6
  color-scheme: var(--vvd-color-scheme);
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 13 Feb 2025 13:39:16 GMT
3
+ * Generated on Tue, 18 Feb 2025 11:18:19 GMT
4
4
  */
5
5
  .vvd-root:root {
6
6
  --vvd-size-font-scale-base: 1rem;
@@ -1,18 +1,18 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 13 Feb 2025 13:39:17 GMT
3
+ * Generated on Tue, 18 Feb 2025 11:18:19 GMT
4
4
  */
5
5
  /**
6
6
  * Do not edit directly
7
- * Generated on Thu, 13 Feb 2025 13:39:16 GMT
7
+ * Generated on Tue, 18 Feb 2025 11:18:19 GMT
8
8
  */
9
9
  /**
10
10
  * Do not edit directly
11
- * Generated on Thu, 13 Feb 2025 13:39:17 GMT
11
+ * Generated on Tue, 18 Feb 2025 11:18:19 GMT
12
12
  */
13
13
  /**
14
14
  * Do not edit directly
15
- * Generated on Thu, 13 Feb 2025 13:39:17 GMT
15
+ * Generated on Tue, 18 Feb 2025 11:18:19 GMT
16
16
  */
17
17
  @property --vvd-size-density {
18
18
  syntax: "<integer>";
@@ -1,18 +1,18 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 13 Feb 2025 13:39:16 GMT
3
+ * Generated on Tue, 18 Feb 2025 11:18:19 GMT
4
4
  */
5
5
  /**
6
6
  * Do not edit directly
7
- * Generated on Thu, 13 Feb 2025 13:39:17 GMT
7
+ * Generated on Tue, 18 Feb 2025 11:18:19 GMT
8
8
  */
9
9
  /**
10
10
  * Do not edit directly
11
- * Generated on Thu, 13 Feb 2025 13:39:17 GMT
11
+ * Generated on Tue, 18 Feb 2025 11:18:19 GMT
12
12
  */
13
13
  /**
14
14
  * Do not edit directly
15
- * Generated on Thu, 13 Feb 2025 13:39:17 GMT
15
+ * Generated on Tue, 18 Feb 2025 11:18:19 GMT
16
16
  */
17
17
  @property --vvd-size-density {
18
18
  syntax: "<integer>";
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 13 Feb 2025 13:39:16 GMT
3
+ * Generated on Tue, 18 Feb 2025 11:18:19 GMT
4
4
  */
5
5
  .vvd-root, ::part(vvd-root),
6
6
  .vvd-theme-alternate, ::part(vvd-theme-alternate) {