@tamagui/slider 1.0.1-beta.166 → 1.0.1-beta.168

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.
Files changed (2) hide show
  1. package/package.json +8 -8
  2. package/types/helpers.d.ts +27 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/slider",
3
- "version": "1.0.1-beta.166",
3
+ "version": "1.0.1-beta.168",
4
4
  "sideEffects": [
5
5
  "*.css"
6
6
  ],
@@ -23,12 +23,12 @@
23
23
  "clean:build": "tamagui-build clean:build"
24
24
  },
25
25
  "dependencies": {
26
- "@tamagui/compose-refs": "^1.0.1-beta.166",
27
- "@tamagui/core": "^1.0.1-beta.166",
28
- "@tamagui/create-context": "^1.0.1-beta.166",
29
- "@tamagui/stacks": "^1.0.1-beta.166",
30
- "@tamagui/use-controllable-state": "^1.0.1-beta.166",
31
- "@tamagui/use-direction": "^1.0.1-beta.166"
26
+ "@tamagui/compose-refs": "^1.0.1-beta.168",
27
+ "@tamagui/core": "^1.0.1-beta.168",
28
+ "@tamagui/create-context": "^1.0.1-beta.168",
29
+ "@tamagui/stacks": "^1.0.1-beta.168",
30
+ "@tamagui/use-controllable-state": "^1.0.1-beta.168",
31
+ "@tamagui/use-direction": "^1.0.1-beta.168"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "react": "*",
@@ -36,7 +36,7 @@
36
36
  "react-native": "*"
37
37
  },
38
38
  "devDependencies": {
39
- "@tamagui/build": "^1.0.1-beta.166",
39
+ "@tamagui/build": "^1.0.1-beta.168",
40
40
  "@types/react-native": "^0.69.2",
41
41
  "react": "*",
42
42
  "react-dom": "*",
@@ -1,8 +1,35 @@
1
1
  export declare function getNextSortedValues(prevValues: number[] | undefined, nextValue: number, atIndex: number): number[];
2
2
  export declare function convertValueToPercentage(value: number, min: number, max: number): number;
3
+ /**
4
+ * Returns a label for each thumb when there are two or more thumbs
5
+ */
3
6
  export declare function getLabel(index: number, totalValues: number): string | undefined;
7
+ /**
8
+ * Given a `values` array and a `nextValue`, determine which value in
9
+ * the array is closest to `nextValue` and return its index.
10
+ *
11
+ * @example
12
+ * // returns 1
13
+ * getClosestValueIndex([10, 30], 25);
14
+ */
4
15
  export declare function getClosestValueIndex(values: number[], nextValue: number): number;
16
+ /**
17
+ * Offsets the thumb centre point while sliding to ensure it remains
18
+ * within the bounds of the slider when reaching the edges
19
+ */
5
20
  export declare function getThumbInBoundsOffset(width: number, left: number, direction: number): number;
21
+ /**
22
+ * Verifies the minimum steps between all values is greater than or equal
23
+ * to the expected minimum steps.
24
+ *
25
+ * @example
26
+ * // returns false
27
+ * hasMinStepsBetweenValues([1,2,3], 2);
28
+ *
29
+ * @example
30
+ * // returns true
31
+ * hasMinStepsBetweenValues([1,2,3], 1);
32
+ */
6
33
  export declare function hasMinStepsBetweenValues(values: number[], minStepsBetweenValues: number): boolean;
7
34
  export declare function linearScale(input: readonly [number, number], output: readonly [number, number]): (value: number) => number;
8
35
  export declare function getDecimalCount(value: number): number;