@tamagui/slider 1.0.1-beta.95 → 1.0.1-beta.96

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 (53) hide show
  1. package/dist/cjs/Slider.js +29 -29
  2. package/dist/cjs/Slider.js.map +2 -2
  3. package/dist/cjs/SliderImpl.js +2 -4
  4. package/dist/cjs/SliderImpl.js.map +2 -2
  5. package/dist/cjs/constants.js +0 -0
  6. package/dist/cjs/constants.js.map +0 -0
  7. package/dist/cjs/helpers.js +0 -0
  8. package/dist/cjs/helpers.js.map +2 -2
  9. package/dist/cjs/index.js +0 -0
  10. package/dist/cjs/index.js.map +0 -0
  11. package/dist/cjs/types.js +0 -0
  12. package/dist/cjs/types.js.map +1 -1
  13. package/dist/esm/Slider.js +30 -30
  14. package/dist/esm/Slider.js.map +2 -2
  15. package/dist/esm/SliderImpl.js +2 -4
  16. package/dist/esm/SliderImpl.js.map +2 -2
  17. package/dist/esm/constants.js +0 -0
  18. package/dist/esm/constants.js.map +0 -0
  19. package/dist/esm/helpers.js +0 -0
  20. package/dist/esm/helpers.js.map +2 -2
  21. package/dist/esm/index.js +0 -0
  22. package/dist/esm/index.js.map +0 -0
  23. package/dist/esm/types.js +0 -0
  24. package/dist/esm/types.js.map +0 -0
  25. package/dist/jsx/Slider.js +26 -26
  26. package/dist/jsx/Slider.js.map +2 -2
  27. package/dist/jsx/SliderImpl.js +3 -4
  28. package/dist/jsx/SliderImpl.js.map +2 -2
  29. package/dist/jsx/constants.js +0 -0
  30. package/dist/jsx/constants.js.map +0 -0
  31. package/dist/jsx/helpers.js +0 -0
  32. package/dist/jsx/helpers.js.map +2 -2
  33. package/dist/jsx/index.js +0 -0
  34. package/dist/jsx/index.js.map +0 -0
  35. package/dist/jsx/types.js +0 -0
  36. package/dist/jsx/types.js.map +0 -0
  37. package/package.json +8 -8
  38. package/src/Slider.tsx +43 -55
  39. package/src/SliderImpl.tsx +6 -6
  40. package/src/helpers.tsx +0 -2
  41. package/src/types.ts +0 -3
  42. package/types/Slider.d.ts +155 -17
  43. package/types/Slider.d.ts.map +1 -1
  44. package/types/SliderImpl.d.ts +3 -2
  45. package/types/SliderImpl.d.ts.map +1 -1
  46. package/types/constants.d.ts +0 -1
  47. package/types/constants.d.ts.map +1 -1
  48. package/types/helpers.d.ts +0 -0
  49. package/types/helpers.d.ts.map +1 -1
  50. package/types/index.d.ts +0 -0
  51. package/types/index.d.ts.map +0 -0
  52. package/types/types.d.ts +0 -2
  53. package/types/types.d.ts.map +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/helpers.tsx"],
4
- "sourcesContent": ["import { SizeTokens, getTokens, getVariableValue } from '@tamagui/core'\n\nexport function getNextSortedValues(prevValues: number[] = [], nextValue: number, atIndex: number) {\n const nextValues = [...prevValues]\n nextValues[atIndex] = nextValue\n return nextValues.sort((a, b) => a - b)\n}\n\nexport function convertValueToPercentage(value: number, min: number, max: number) {\n const maxSteps = max - min\n const percentPerStep = 100 / maxSteps\n return percentPerStep * (value - min)\n}\n\n/**\n * Returns a label for each thumb when there are two or more thumbs\n */\nexport function getLabel(index: number, totalValues: number) {\n if (totalValues > 2) {\n return `Value ${index + 1} of ${totalValues}`\n } else if (totalValues === 2) {\n return ['Minimum', 'Maximum'][index]\n } else {\n return undefined\n }\n}\n\n/**\n * Given a `values` array and a `nextValue`, determine which value in\n * the array is closest to `nextValue` and return its index.\n *\n * @example\n * // returns 1\n * getClosestValueIndex([10, 30], 25);\n */\nexport function getClosestValueIndex(values: number[], nextValue: number) {\n if (values.length === 1) return 0\n const distances = values.map((value) => Math.abs(value - nextValue))\n const closestDistance = Math.min(...distances)\n return distances.indexOf(closestDistance)\n}\n\n/**\n * Offsets the thumb centre point while sliding to ensure it remains\n * within the bounds of the slider when reaching the edges\n */\nexport function getThumbInBoundsOffset(width: number, left: number, direction: number) {\n const halfWidth = width / 2\n const halfPercent = 50\n const offset = linearScale([0, halfPercent], [0, halfWidth])\n return (halfWidth - offset(left) * direction) * direction\n}\n\n/**\n * Gets an array of steps between each value.\n *\n * @example\n * // returns [1, 9]\n * getStepsBetweenValues([10, 11, 20]);\n */\nfunction getStepsBetweenValues(values: number[]) {\n return values.slice(0, -1).map((value, index) => values[index + 1] - value)\n}\n\n/**\n * Verifies the minimum steps between all values is greater than or equal\n * to the expected minimum steps.\n *\n * @example\n * // returns false\n * hasMinStepsBetweenValues([1,2,3], 2);\n *\n * @example\n * // returns true\n * hasMinStepsBetweenValues([1,2,3], 1);\n */\nexport function hasMinStepsBetweenValues(values: number[], minStepsBetweenValues: number) {\n if (minStepsBetweenValues > 0) {\n const stepsBetweenValues = getStepsBetweenValues(values)\n const actualMinStepsBetweenValues = Math.min(...stepsBetweenValues)\n return actualMinStepsBetweenValues >= minStepsBetweenValues\n }\n return true\n}\n\n// https://github.com/tmcw-up-for-adoption/simple-linear-scale/blob/master/index.js\nexport function linearScale(input: readonly [number, number], output: readonly [number, number]) {\n return (value: number) => {\n if (input[0] === input[1] || output[0] === output[1]) return output[0]\n const ratio = (output[1] - output[0]) / (input[1] - input[0])\n return output[0] + ratio * (value - input[0])\n }\n}\n\nexport function getDecimalCount(value: number) {\n return (String(value).split('.')[1] || '').length\n}\n\nexport function roundValue(value: number, decimalCount: number) {\n const rounder = Math.pow(10, decimalCount)\n return Math.round(value * rounder) / rounder\n}\n"],
5
- "mappings": "AAEO,6BAA6B,aAAuB,CAAC,GAAG,WAAmB,SAAiB;AACjG,QAAM,aAAa,CAAC,GAAG,UAAU;AACjC,aAAW,WAAW;AACtB,SAAO,WAAW,KAAK,CAAC,GAAG,MAAM,IAAI,CAAC;AACxC;AAEO,kCAAkC,OAAe,KAAa,KAAa;AAChF,QAAM,WAAW,MAAM;AACvB,QAAM,iBAAiB,MAAM;AAC7B,SAAO,iBAAkB,SAAQ;AACnC;AAKO,kBAAkB,OAAe,aAAqB;AAC3D,MAAI,cAAc,GAAG;AACnB,WAAO,SAAS,Q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D,QAAM,UAAU,KAAK,IAAI,IAAI,YAAY;AACzC,SAAO,KAAK,MAAM,QAAQ,OAAO,IAAI;AACvC;",
4
+ "sourcesContent": ["export function getNextSortedValues(prevValues: number[] = [], nextValue: number, atIndex: number) {\n const nextValues = [...prevValues]\n nextValues[atIndex] = nextValue\n return nextValues.sort((a, b) => a - b)\n}\n\nexport function convertValueToPercentage(value: number, min: number, max: number) {\n const maxSteps = max - min\n const percentPerStep = 100 / maxSteps\n return percentPerStep * (value - min)\n}\n\n/**\n * Returns a label for each thumb when there are two or more thumbs\n */\nexport function getLabel(index: number, totalValues: number) {\n if (totalValues > 2) {\n return `Value ${index + 1} of ${totalValues}`\n } else if (totalValues === 2) {\n return ['Minimum', 'Maximum'][index]\n } else {\n return undefined\n }\n}\n\n/**\n * Given a `values` array and a `nextValue`, determine which value in\n * the array is closest to `nextValue` and return its index.\n *\n * @example\n * // returns 1\n * getClosestValueIndex([10, 30], 25);\n */\nexport function getClosestValueIndex(values: number[], nextValue: number) {\n if (values.length === 1) return 0\n const distances = values.map((value) => Math.abs(value - nextValue))\n const closestDistance = Math.min(...distances)\n return distances.indexOf(closestDistance)\n}\n\n/**\n * Offsets the thumb centre point while sliding to ensure it remains\n * within the bounds of the slider when reaching the edges\n */\nexport function getThumbInBoundsOffset(width: number, left: number, direction: number) {\n const halfWidth = width / 2\n const halfPercent = 50\n const offset = linearScale([0, halfPercent], [0, halfWidth])\n return (halfWidth - offset(left) * direction) * direction\n}\n\n/**\n * Gets an array of steps between each value.\n *\n * @example\n * // returns [1, 9]\n * getStepsBetweenValues([10, 11, 20]);\n */\nfunction getStepsBetweenValues(values: number[]) {\n return values.slice(0, -1).map((value, index) => values[index + 1] - value)\n}\n\n/**\n * Verifies the minimum steps between all values is greater than or equal\n * to the expected minimum steps.\n *\n * @example\n * // returns false\n * hasMinStepsBetweenValues([1,2,3], 2);\n *\n * @example\n * // returns true\n * hasMinStepsBetweenValues([1,2,3], 1);\n */\nexport function hasMinStepsBetweenValues(values: number[], minStepsBetweenValues: number) {\n if (minStepsBetweenValues > 0) {\n const stepsBetweenValues = getStepsBetweenValues(values)\n const actualMinStepsBetweenValues = Math.min(...stepsBetweenValues)\n return actualMinStepsBetweenValues >= minStepsBetweenValues\n }\n return true\n}\n\n// https://github.com/tmcw-up-for-adoption/simple-linear-scale/blob/master/index.js\nexport function linearScale(input: readonly [number, number], output: readonly [number, number]) {\n return (value: number) => {\n if (input[0] === input[1] || output[0] === output[1]) return output[0]\n const ratio = (output[1] - output[0]) / (input[1] - input[0])\n return output[0] + ratio * (value - input[0])\n }\n}\n\nexport function getDecimalCount(value: number) {\n return (String(value).split('.')[1] || '').length\n}\n\nexport function roundValue(value: number, decimalCount: number) {\n const rounder = Math.pow(10, decimalCount)\n return Math.round(value * rounder) / rounder\n}\n"],
5
+ "mappings": "AAAO,6BAA6B,aAAuB,CAAC,GAAG,WAAmB,SAAiB;AACjG,QAAM,aAAa,CAAC,GAAG,UAAU;AACjC,aAAW,WAAW;AACtB,SAAO,WAAW,KAAK,CAAC,GAAG,MAAM,IAAI,CAAC;AACxC;AAEO,kCAAkC,OAAe,KAAa,KAAa;AAChF,QAAM,WAAW,MAAM;AACvB,QAAM,iBAAiB,MAAM;AAC7B,SAAO,iBAAkB,SAAQ;AACnC;AAKO,kBAAkB,OAAe,aAAqB;AAC3D,MAAI,cAAc,GAAG;AACnB,WAAO,SAAS,QAAQ,QAAQ;AAAA,EAClC,WAAW,gBAAgB,GAAG;AAC5B,WAAO,CAAC,WAAW,SAAS,EAAE;AAAA,EAChC,OAAO;AACL,WAAO;AAAA,EACT;AACF;AAUO,8BAA8B,QAAkB,WAAmB;AACxE,MAAI,OAAO,WAAW;AAAG,WAAO;AAChC,QAAM,YAAY,OAAO,IAAI,CAAC,UAAU,KAAK,IAAI,QAAQ,SAAS,CAAC;AACnE,QAAM,kBAAkB,KAAK,IAAI,GAAG,SAAS;AAC7C,SAAO,UAAU,QAAQ,eAAe;AAC1C;AAMO,gCAAgC,OAAe,MAAc,WAAmB;AACrF,QAAM,YAAY,QAAQ;AAC1B,QAAM,cAAc;AACpB,QAAM,SAAS,YAAY,CAAC,GAAG,WAAW,GAAG,CAAC,GAAG,SAAS,CAAC;AAC3D,SAAQ,aAAY,OAAO,IAAI,IAAI,aAAa;AAClD;AASA,+BAA+B,QAAkB;AAC/C,SAAO,OAAO,MAAM,GAAG,EAAE,EAAE,IAAI,CAAC,OAAO,UAAU,OAAO,QAAQ,KAAK,KAAK;AAC5E;AAcO,kCAAkC,QAAkB,uBAA+B;AACxF,MAAI,wBAAwB,GAAG;AAC7B,UAAM,qBAAqB,sBAAsB,MAAM;AACvD,UAAM,8BAA8B,KAAK,IAAI,GAAG,kBAAkB;AAClE,WAAO,+BAA+B;AAAA,EACxC;AACA,SAAO;AACT;AAGO,qBAAqB,OAAkC,QAAmC;AAC/F,SAAO,CAAC,UAAkB;AACxB,QAAI,MAAM,OAAO,MAAM,MAAM,OAAO,OAAO,OAAO;AAAI,aAAO,OAAO;AACpE,UAAM,QAAS,QAAO,KAAK,OAAO,MAAO,OAAM,KAAK,MAAM;AAC1D,WAAO,OAAO,KAAK,QAAS,SAAQ,MAAM;AAAA,EAC5C;AACF;AAEO,yBAAyB,OAAe;AAC7C,SAAQ,QAAO,KAAK,EAAE,MAAM,GAAG,EAAE,MAAM,IAAI;AAC7C;AAEO,oBAAoB,OAAe,cAAsB;AAC9D,QAAM,UAAU,KAAK,IAAI,IAAI,YAAY;AACzC,SAAO,KAAK,MAAM,QAAQ,OAAO,IAAI;AACvC;",
6
6
  "names": []
7
7
  }
package/dist/jsx/index.js CHANGED
File without changes
File without changes
package/dist/jsx/types.js CHANGED
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/slider",
3
- "version": "1.0.1-beta.95",
3
+ "version": "1.0.1-beta.96",
4
4
  "sideEffects": [
5
5
  "*.css"
6
6
  ],
@@ -21,12 +21,12 @@
21
21
  "clean:build": "tamagui-build clean:build"
22
22
  },
23
23
  "dependencies": {
24
- "@tamagui/compose-refs": "^1.0.1-beta.95",
25
- "@tamagui/core": "^1.0.1-beta.95",
26
- "@tamagui/create-context": "^1.0.1-beta.95",
27
- "@tamagui/stacks": "^1.0.1-beta.95",
28
- "@tamagui/use-controllable-state": "^1.0.1-beta.95",
29
- "@tamagui/use-direction": "^1.0.1-beta.95"
24
+ "@tamagui/compose-refs": "^1.0.1-beta.96",
25
+ "@tamagui/core": "^1.0.1-beta.96",
26
+ "@tamagui/create-context": "^1.0.1-beta.96",
27
+ "@tamagui/stacks": "^1.0.1-beta.96",
28
+ "@tamagui/use-controllable-state": "^1.0.1-beta.96",
29
+ "@tamagui/use-direction": "^1.0.1-beta.96"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "react": "*",
@@ -34,7 +34,7 @@
34
34
  "react-native": "*"
35
35
  },
36
36
  "devDependencies": {
37
- "@tamagui/build": "^1.0.1-beta.95",
37
+ "@tamagui/build": "^1.0.1-beta.96",
38
38
  "@types/react-native": "^0.67.3",
39
39
  "react": "*",
40
40
  "react-dom": "*",
package/src/Slider.tsx CHANGED
@@ -1,7 +1,8 @@
1
1
  // forked from radix-ui
2
2
 
3
- import { useComposedRefs } from '@tamagui/compose-refs'
3
+ import { composeRefs, useComposedRefs } from '@tamagui/compose-refs'
4
4
  import {
5
+ GetProps,
5
6
  SizeTokens,
6
7
  getSize,
7
8
  getVariableValue,
@@ -10,11 +11,11 @@ import {
10
11
  withStaticProperties,
11
12
  } from '@tamagui/core'
12
13
  import { clamp, composeEventHandlers } from '@tamagui/helpers'
13
- import { SizableStackProps, ThemeableStack, YStackProps } from '@tamagui/stacks'
14
+ import { SizableStackProps, ThemeableStack } from '@tamagui/stacks'
14
15
  import { useControllableState } from '@tamagui/use-controllable-state'
15
16
  import { useDirection } from '@tamagui/use-direction'
16
17
  import * as React from 'react'
17
- import { LayoutRectangle, View } from 'react-native'
18
+ import { View } from 'react-native'
18
19
 
19
20
  import {
20
21
  ARROW_KEYS,
@@ -42,7 +43,6 @@ import {
42
43
  ScopedProps,
43
44
  SliderContextValue,
44
45
  SliderHorizontalProps,
45
- SliderImplElement,
46
46
  SliderProps,
47
47
  SliderTrackProps,
48
48
  SliderVerticalProps,
@@ -52,20 +52,16 @@ import {
52
52
  * SliderHorizontal
53
53
  * -----------------------------------------------------------------------------------------------*/
54
54
 
55
- type SliderHorizontalElement = SliderImplElement
56
-
57
- const SliderHorizontal = React.forwardRef<SliderHorizontalElement, SliderHorizontalProps>(
55
+ const SliderHorizontal = React.forwardRef<View, SliderHorizontalProps>(
58
56
  (props: ScopedProps<SliderHorizontalProps>, forwardedRef) => {
59
57
  const { min, max, dir, onSlideStart, onSlideMove, onStepKeyDown, ...sliderProps } = props
60
58
  const direction = useDirection(dir)
61
59
  const isDirectionLTR = direction === 'ltr'
62
- const layoutRef = React.useRef<LayoutRectangle | null>(null)
63
- const [size, setSize] = React.useState(0)
60
+ const sliderRef = React.useRef<View>(null)
61
+ const [state, setState] = React.useState(() => ({ size: 0, offset: 0 }))
64
62
 
65
63
  function getValueFromPointer(pointerPosition: number) {
66
- const layout = layoutRef.current
67
- if (!layout) return
68
- const input: [number, number] = [0, layout.width]
64
+ const input: [number, number] = [0, state.size]
69
65
  const output: [number, number] = isDirectionLTR ? [min, max] : [max, min]
70
66
  const value = linearScale(input, output)
71
67
  return value(pointerPosition)
@@ -78,17 +74,20 @@ const SliderHorizontal = React.forwardRef<SliderHorizontalElement, SliderHorizon
78
74
  endEdge={isDirectionLTR ? 'right' : 'left'}
79
75
  direction={isDirectionLTR ? 1 : -1}
80
76
  sizeProp="width"
81
- size={size}
77
+ size={state.size}
82
78
  >
83
79
  <SliderImpl
84
- ref={forwardedRef}
80
+ ref={composeRefs(forwardedRef, sliderRef)}
85
81
  dir={direction}
86
82
  {...sliderProps}
87
83
  orientation="horizontal"
88
- onLayout={(e) => {
89
- const layout = e.nativeEvent.layout
90
- layoutRef.current = layout
91
- setSize(layout.height)
84
+ onLayout={() => {
85
+ sliderRef.current?.measure((_x, _y, width, _height, pageX, _pageY) => {
86
+ setState({
87
+ size: width,
88
+ offset: pageX,
89
+ })
90
+ })
92
91
  }}
93
92
  onSlideStart={(event, target) => {
94
93
  const value = getValueFromPointer(event.nativeEvent.locationX)
@@ -97,7 +96,7 @@ const SliderHorizontal = React.forwardRef<SliderHorizontalElement, SliderHorizon
97
96
  }
98
97
  }}
99
98
  onSlideMove={(event) => {
100
- const value = getValueFromPointer(event.nativeEvent.locationX)
99
+ const value = getValueFromPointer(event.nativeEvent.pageX - state.offset)
101
100
  if (value) {
102
101
  onSlideMove?.(value)
103
102
  }
@@ -117,18 +116,14 @@ const SliderHorizontal = React.forwardRef<SliderHorizontalElement, SliderHorizon
117
116
  * SliderVertical
118
117
  * -----------------------------------------------------------------------------------------------*/
119
118
 
120
- type SliderVerticalElement = SliderImplElement
121
-
122
- const SliderVertical = React.forwardRef<SliderVerticalElement, SliderVerticalProps>(
119
+ const SliderVertical = React.forwardRef<View, SliderVerticalProps>(
123
120
  (props: ScopedProps<SliderVerticalProps>, forwardedRef) => {
124
121
  const { min, max, onSlideStart, onSlideMove, onStepKeyDown, ...sliderProps } = props
125
- const layoutRef = React.useRef<LayoutRectangle | null>(null)
126
- const [size, setSize] = React.useState(0)
122
+ const [state, setState] = React.useState(() => ({ size: 0, offset: 0 }))
123
+ const sliderRef = React.useRef<View>(null)
127
124
 
128
125
  function getValueFromPointer(pointerPosition: number) {
129
- const layout = layoutRef.current
130
- if (!layout) return
131
- const input: [number, number] = [0, layout.height]
126
+ const input: [number, number] = [0, state.size]
132
127
  const output: [number, number] = [max, min]
133
128
  const value = linearScale(input, output)
134
129
  return value(pointerPosition)
@@ -140,17 +135,20 @@ const SliderVertical = React.forwardRef<SliderVerticalElement, SliderVerticalPro
140
135
  startEdge="bottom"
141
136
  endEdge="top"
142
137
  sizeProp="height"
143
- size={size}
138
+ size={state.size}
144
139
  direction={1}
145
140
  >
146
141
  <SliderImpl
147
- ref={forwardedRef}
142
+ ref={composeRefs(forwardedRef, sliderRef)}
148
143
  {...sliderProps}
149
144
  orientation="vertical"
150
- onLayout={(e) => {
151
- const layout = e.nativeEvent.layout
152
- layoutRef.current = layout
153
- setSize(layout.height)
145
+ onLayout={() => {
146
+ sliderRef.current?.measure((_x, _y, _width, height, _pageX, pageY) => {
147
+ setState({
148
+ size: height,
149
+ offset: pageY,
150
+ })
151
+ })
154
152
  }}
155
153
  onSlideStart={(event, target) => {
156
154
  const value = getValueFromPointer(event.nativeEvent.locationY)
@@ -159,7 +157,7 @@ const SliderVertical = React.forwardRef<SliderVerticalElement, SliderVerticalPro
159
157
  }
160
158
  }}
161
159
  onSlideMove={(event) => {
162
- const value = getValueFromPointer(event.nativeEvent.locationY)
160
+ const value = getValueFromPointer(event.nativeEvent.pageY - state.offset)
163
161
  if (value) {
164
162
  onSlideMove?.(value)
165
163
  }
@@ -218,21 +216,20 @@ SliderTrack.displayName = TRACK_NAME
218
216
 
219
217
  const RANGE_NAME = 'SliderTrackActive'
220
218
 
221
- type SliderTrackActiveElement = HTMLElement | View
222
- interface SliderTrackActiveProps extends YStackProps {}
223
-
224
219
  export const SliderTrackActiveFrame = styled(SliderFrame, {
225
220
  name: 'SliderTrackActive',
226
221
  backgroundColor: '$background',
227
222
  position: 'absolute',
228
223
  })
229
224
 
230
- const SliderTrackActive = React.forwardRef<SliderTrackActiveElement, SliderTrackActiveProps>(
225
+ type SliderTrackActiveProps = GetProps<typeof SliderTrackActiveFrame>
226
+
227
+ const SliderTrackActive = React.forwardRef<View, SliderTrackActiveProps>(
231
228
  (props: ScopedProps<SliderTrackActiveProps>, forwardedRef) => {
232
229
  const { __scopeSlider, ...rangeProps } = props
233
230
  const context = useSliderContext(RANGE_NAME, __scopeSlider)
234
231
  const orientation = useSliderOrientationContext(RANGE_NAME, __scopeSlider)
235
- const ref = React.useRef<HTMLSpanElement>(null)
232
+ const ref = React.useRef<View>(null)
236
233
  const composedRefs = useComposedRefs(forwardedRef, ref)
237
234
  const valuesCount = context.values.length
238
235
  const percentages = context.values.map((value) =>
@@ -305,12 +302,11 @@ export const SliderThumbFrame = styled(ThemeableStack, {
305
302
  },
306
303
  })
307
304
 
308
- type SliderThumbElement = HTMLElement | View
309
305
  interface SliderThumbProps extends SizableStackProps {
310
306
  index: number
311
307
  }
312
308
 
313
- const SliderThumb = React.forwardRef<SliderThumbElement, SliderThumbProps>(
309
+ const SliderThumb = React.forwardRef<View, SliderThumbProps>(
314
310
  (props: ScopedProps<SliderThumbProps>, forwardedRef) => {
315
311
  const { __scopeSlider, index, size: sizeProp, ...thumbProps } = props
316
312
  const context = useSliderContext(THUMB_NAME, __scopeSlider)
@@ -355,8 +351,6 @@ const SliderThumb = React.forwardRef<SliderThumbElement, SliderThumbProps>(
355
351
  aria-orientation={context.orientation}
356
352
  data-orientation={context.orientation}
357
353
  data-disabled={context.disabled ? '' : undefined}
358
- // TODO
359
- // @ts-ignore
360
354
  tabIndex={context.disabled ? undefined : 0}
361
355
  {...thumbProps}
362
356
  {...(context.orientation === 'horizontal'
@@ -395,11 +389,6 @@ const SliderThumb = React.forwardRef<SliderThumbElement, SliderThumbProps>(
395
389
  onFocus={composeEventHandlers(props.onFocus, () => {
396
390
  context.valueIndexToChangeRef.current = index
397
391
  })}
398
- // temp fix to make slider work nicely on native
399
- // we just let the events propagate to the track
400
- {...(!isWeb && {
401
- pointerEvents: 'none',
402
- })}
403
392
  />
404
393
  )
405
394
  }
@@ -411,10 +400,8 @@ SliderThumb.displayName = THUMB_NAME
411
400
  * Slider
412
401
  * -----------------------------------------------------------------------------------------------*/
413
402
 
414
- type SliderElement = SliderHorizontalElement | SliderVerticalElement
415
-
416
403
  const Slider = withStaticProperties(
417
- React.forwardRef<SliderElement, SliderProps>((props: ScopedProps<SliderProps>, forwardedRef) => {
404
+ React.forwardRef<View, SliderProps>((props: ScopedProps<SliderProps>, forwardedRef) => {
418
405
  const {
419
406
  name,
420
407
  min = 0,
@@ -429,14 +416,14 @@ const Slider = withStaticProperties(
429
416
  size: sizeProp,
430
417
  ...sliderProps
431
418
  } = props
432
- const sliderRef = React.useRef<SliderImplElement>(null)
419
+ const sliderRef = React.useRef<View>(null)
433
420
  const composedRefs = useComposedRefs(sliderRef, forwardedRef)
434
421
  const thumbRefs = React.useRef<SliderContextValue['thumbs']>(new Set())
435
422
  const valueIndexToChangeRef = React.useRef<number>(0)
436
423
  const isHorizontal = orientation === 'horizontal'
437
424
  // We set this to true by default so that events bubble to forms without JS (SSR)
438
- // TODO
439
- // const isFormControl = slider ? Boolean(slider.closest('form')) : true
425
+ // const isFormControl =
426
+ // sliderRef.current instanceof HTMLElement ? Boolean(sliderRef.current.closest('form')) : true
440
427
 
441
428
  const [values = [], setValues] = useControllableState({
442
429
  prop: value,
@@ -452,6 +439,7 @@ const Slider = withStaticProperties(
452
439
 
453
440
  if (isWeb) {
454
441
  React.useEffect(() => {
442
+ // @ts-ignore
455
443
  const node = sliderRef.current as HTMLElement
456
444
  if (!node) return
457
445
  const preventDefault = (e) => {
@@ -553,7 +541,7 @@ Slider.displayName = SLIDER_NAME
553
541
 
554
542
  /* -----------------------------------------------------------------------------------------------*/
555
543
 
556
- // TODO
544
+ // // TODO
557
545
  // const BubbleInput = (props: any) => {
558
546
  // const { value, ...inputProps } = props
559
547
  // const ref = React.useRef<HTMLInputElement>(null)
@@ -5,9 +5,10 @@
5
5
  import { composeEventHandlers, getSize, getVariableValue, isWeb, styled } from '@tamagui/core'
6
6
  import { YStack } from '@tamagui/stacks'
7
7
  import * as React from 'react'
8
+ import { View } from 'react-native'
8
9
 
9
10
  import { ARROW_KEYS, PAGE_KEYS, SLIDER_NAME, useSliderContext } from './constants'
10
- import { ScopedProps, SliderImplElement, SliderImplProps } from './types'
11
+ import { ScopedProps, SliderImplProps } from './types'
11
12
 
12
13
  export const DirectionalYStack = styled(YStack, {
13
14
  variants: {
@@ -41,7 +42,7 @@ export const SliderFrame = styled(DirectionalYStack, {
41
42
  },
42
43
  })
43
44
 
44
- export const SliderImpl = React.forwardRef<SliderImplElement, SliderImplProps>(
45
+ export const SliderImpl = React.forwardRef<View, SliderImplProps>(
45
46
  (props: ScopedProps<SliderImplProps>, forwardedRef) => {
46
47
  const {
47
48
  __scopeSlider,
@@ -82,14 +83,14 @@ export const SliderImpl = React.forwardRef<SliderImplElement, SliderImplProps>(
82
83
  onScrollShouldSetResponderCapture={() => true}
83
84
  onMoveShouldSetResponder={() => true}
84
85
  onStartShouldSetResponder={() => true}
85
- onStartShouldSetResponderCapture={() => true}
86
+ // onStartShouldSetResponderCapture={() => true}
86
87
  onResponderTerminationRequest={() => {
87
- console.log('got??/')
88
88
  return false
89
89
  }}
90
90
  onResponderGrant={composeEventHandlers(props.onResponderGrant, (event) => {
91
91
  const target = event.target as HTMLElement | number
92
- const isStartingOnThumb = context.thumbs.has(event.target)
92
+ console.log('target', target, context.thumbs.has(target), context.thumbs)
93
+ const isStartingOnThumb = context.thumbs.has(target)
93
94
  // // Prevent browser focus behaviour because we focus a thumb manually when values change.
94
95
  // Touch devices have a delay before focusing so won't focus if touch immediately moves
95
96
  // away from target (sliding). We want thumb to focus regardless.
@@ -101,7 +102,6 @@ export const SliderImpl = React.forwardRef<SliderImplElement, SliderImplProps>(
101
102
  onSlideStart(event, isStartingOnThumb ? 'thumb' : 'track')
102
103
  })}
103
104
  onResponderMove={composeEventHandlers(props.onResponderMove, (event) => {
104
- console.log('gogo')
105
105
  event.preventDefault()
106
106
  event.stopPropagation()
107
107
 
package/src/helpers.tsx CHANGED
@@ -1,5 +1,3 @@
1
- import { SizeTokens, getTokens, getVariableValue } from '@tamagui/core'
2
-
3
1
  export function getNextSortedValues(prevValues: number[] = [], nextValue: number, atIndex: number) {
4
2
  const nextValues = [...prevValues]
5
3
  nextValues[atIndex] = nextValue
package/src/types.ts CHANGED
@@ -1,14 +1,11 @@
1
1
  import type { GestureReponderEvent, SizeTokens } from '@tamagui/core'
2
2
  import type { Scope } from '@tamagui/create-context'
3
3
  import type { SizableStackProps } from '@tamagui/stacks'
4
- import type { View } from 'react-native'
5
4
 
6
5
  export type ScopedProps<P> = P & { __scopeSlider?: Scope }
7
6
 
8
7
  export type Direction = 'ltr' | 'rtl'
9
8
 
10
- export type SliderImplElement = HTMLElement | View
11
-
12
9
  type SliderImplPrivateProps = {
13
10
  onSlideStart(event: GestureReponderEvent, target: 'thumb' | 'track'): void
14
11
  onSlideMove(event: GestureReponderEvent): void
package/types/Slider.d.ts CHANGED
@@ -1,10 +1,8 @@
1
- import { SizeTokens } from '@tamagui/core';
2
- import { SizableStackProps, YStackProps } from '@tamagui/stacks';
1
+ import { GetProps, SizeTokens } from '@tamagui/core';
2
+ import { SizableStackProps } from '@tamagui/stacks';
3
3
  import * as React from 'react';
4
4
  import { View } from 'react-native';
5
- import { SliderImplElement, SliderProps, SliderTrackProps } from './types';
6
- declare type SliderHorizontalElement = SliderImplElement;
7
- declare type SliderVerticalElement = SliderImplElement;
5
+ import { SliderProps, SliderTrackProps } from './types';
8
6
  declare type SliderTrackElement = HTMLElement | View;
9
7
  export declare const SliderTrackFrame: import("@tamagui/core").TamaguiComponent<(Omit<import("react-native").ViewProps, "children" | "display"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
10
8
  readonly fullscreen?: boolean | undefined;
@@ -65,9 +63,6 @@ export declare const SliderTrackFrame: import("@tamagui/core").TamaguiComponent<
65
63
  [x: string]: undefined;
66
64
  })>;
67
65
  declare const SliderTrack: React.ForwardRefExoticComponent<SliderTrackProps & React.RefAttributes<SliderTrackElement>>;
68
- declare type SliderTrackActiveElement = HTMLElement | View;
69
- interface SliderTrackActiveProps extends YStackProps {
70
- }
71
66
  export declare const SliderTrackActiveFrame: import("@tamagui/core").TamaguiComponent<(Omit<import("react-native").ViewProps, "children" | "display"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
72
67
  readonly fullscreen?: boolean | undefined;
73
68
  readonly elevation?: SizeTokens | undefined;
@@ -126,7 +121,56 @@ export declare const SliderTrackActiveFrame: import("@tamagui/core").TamaguiComp
126
121
  } & ({} | {
127
122
  [x: string]: undefined;
128
123
  })>;
129
- declare const SliderTrackActive: React.ForwardRefExoticComponent<SliderTrackActiveProps & React.RefAttributes<SliderTrackActiveElement>>;
124
+ declare type SliderTrackActiveProps = GetProps<typeof SliderTrackActiveFrame>;
125
+ declare const SliderTrackActive: React.ForwardRefExoticComponent<((Omit<import("react-native").ViewProps, "children" | "display"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
126
+ readonly fullscreen?: boolean | undefined;
127
+ readonly elevation?: SizeTokens | undefined;
128
+ } & {
129
+ orientation?: "vertical" | "horizontal" | undefined;
130
+ }, "size"> & {
131
+ size?: any;
132
+ } & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "children" | "display"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
133
+ readonly fullscreen?: boolean | undefined;
134
+ readonly elevation?: SizeTokens | undefined;
135
+ } & {
136
+ orientation?: "vertical" | "horizontal" | undefined;
137
+ }, "size"> & {
138
+ size?: any;
139
+ }>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "children" | "display"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
140
+ readonly fullscreen?: boolean | undefined;
141
+ readonly elevation?: SizeTokens | undefined;
142
+ } & {
143
+ orientation?: "vertical" | "horizontal" | undefined;
144
+ }, "size"> & {
145
+ size?: any;
146
+ }>>) | Pick<Omit<import("react-native").ViewProps, "children" | "display"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
147
+ readonly fullscreen?: boolean | undefined;
148
+ readonly elevation?: SizeTokens | undefined;
149
+ } & {
150
+ orientation?: "vertical" | "horizontal" | undefined;
151
+ } & {
152
+ size?: any;
153
+ }, string | number> & {
154
+ [x: string]: undefined;
155
+ } & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "children" | "display"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
156
+ readonly fullscreen?: boolean | undefined;
157
+ readonly elevation?: SizeTokens | undefined;
158
+ } & {
159
+ orientation?: "vertical" | "horizontal" | undefined;
160
+ } & {
161
+ size?: any;
162
+ }, string | number> & {
163
+ [x: string]: undefined;
164
+ }>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "children" | "display"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
165
+ readonly fullscreen?: boolean | undefined;
166
+ readonly elevation?: SizeTokens | undefined;
167
+ } & {
168
+ orientation?: "vertical" | "horizontal" | undefined;
169
+ } & {
170
+ size?: any;
171
+ }, string | number> & {
172
+ [x: string]: undefined;
173
+ }>>, string | number>) & React.RefAttributes<View>>;
130
174
  export declare const SliderThumbFrame: import("@tamagui/core").TamaguiComponent<Omit<import("react-native").ViewProps, "children" | "display"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
131
175
  readonly fullscreen?: boolean | undefined;
132
176
  readonly elevation?: SizeTokens | undefined;
@@ -200,20 +244,114 @@ export declare const SliderThumbFrame: import("@tamagui/core").TamaguiComponent<
200
244
  } & {
201
245
  size?: SizeTokens | undefined;
202
246
  }>;
203
- declare type SliderThumbElement = HTMLElement | View;
204
247
  interface SliderThumbProps extends SizableStackProps {
205
248
  index: number;
206
249
  }
207
- declare const SliderThumb: React.ForwardRefExoticComponent<SliderThumbProps & React.RefAttributes<SliderThumbElement>>;
208
- declare type SliderElement = SliderHorizontalElement | SliderVerticalElement;
209
- declare const Slider: React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<SliderElement>> & {
250
+ declare const SliderThumb: React.ForwardRefExoticComponent<SliderThumbProps & React.RefAttributes<View>>;
251
+ declare const Slider: React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<View>> & {
210
252
  Track: React.ForwardRefExoticComponent<SliderTrackProps & React.RefAttributes<SliderTrackElement>>;
211
- TrackActive: React.ForwardRefExoticComponent<SliderTrackActiveProps & React.RefAttributes<SliderTrackActiveElement>>;
212
- Thumb: React.ForwardRefExoticComponent<SliderThumbProps & React.RefAttributes<SliderThumbElement>>;
253
+ TrackActive: React.ForwardRefExoticComponent<((Omit<import("react-native").ViewProps, "children" | "display"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
254
+ readonly fullscreen?: boolean | undefined;
255
+ readonly elevation?: SizeTokens | undefined;
256
+ } & {
257
+ orientation?: "vertical" | "horizontal" | undefined;
258
+ }, "size"> & {
259
+ size?: any;
260
+ } & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "children" | "display"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
261
+ readonly fullscreen?: boolean | undefined;
262
+ readonly elevation?: SizeTokens | undefined;
263
+ } & {
264
+ orientation?: "vertical" | "horizontal" | undefined;
265
+ }, "size"> & {
266
+ size?: any;
267
+ }>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "children" | "display"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
268
+ readonly fullscreen?: boolean | undefined;
269
+ readonly elevation?: SizeTokens | undefined;
270
+ } & {
271
+ orientation?: "vertical" | "horizontal" | undefined;
272
+ }, "size"> & {
273
+ size?: any;
274
+ }>>) | Pick<Omit<import("react-native").ViewProps, "children" | "display"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
275
+ readonly fullscreen?: boolean | undefined;
276
+ readonly elevation?: SizeTokens | undefined;
277
+ } & {
278
+ orientation?: "vertical" | "horizontal" | undefined;
279
+ } & {
280
+ size?: any;
281
+ }, string | number> & {
282
+ [x: string]: undefined;
283
+ } & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "children" | "display"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
284
+ readonly fullscreen?: boolean | undefined;
285
+ readonly elevation?: SizeTokens | undefined;
286
+ } & {
287
+ orientation?: "vertical" | "horizontal" | undefined;
288
+ } & {
289
+ size?: any;
290
+ }, string | number> & {
291
+ [x: string]: undefined;
292
+ }>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "children" | "display"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
293
+ readonly fullscreen?: boolean | undefined;
294
+ readonly elevation?: SizeTokens | undefined;
295
+ } & {
296
+ orientation?: "vertical" | "horizontal" | undefined;
297
+ } & {
298
+ size?: any;
299
+ }, string | number> & {
300
+ [x: string]: undefined;
301
+ }>>, string | number>) & React.RefAttributes<View>>;
302
+ Thumb: React.ForwardRefExoticComponent<SliderThumbProps & React.RefAttributes<View>>;
213
303
  };
214
304
  declare const Track: React.ForwardRefExoticComponent<SliderTrackProps & React.RefAttributes<SliderTrackElement>>;
215
- declare const Range: React.ForwardRefExoticComponent<SliderTrackActiveProps & React.RefAttributes<SliderTrackActiveElement>>;
216
- declare const Thumb: React.ForwardRefExoticComponent<SliderThumbProps & React.RefAttributes<SliderThumbElement>>;
305
+ declare const Range: React.ForwardRefExoticComponent<((Omit<import("react-native").ViewProps, "children" | "display"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
306
+ readonly fullscreen?: boolean | undefined;
307
+ readonly elevation?: SizeTokens | undefined;
308
+ } & {
309
+ orientation?: "vertical" | "horizontal" | undefined;
310
+ }, "size"> & {
311
+ size?: any;
312
+ } & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "children" | "display"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
313
+ readonly fullscreen?: boolean | undefined;
314
+ readonly elevation?: SizeTokens | undefined;
315
+ } & {
316
+ orientation?: "vertical" | "horizontal" | undefined;
317
+ }, "size"> & {
318
+ size?: any;
319
+ }>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "children" | "display"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
320
+ readonly fullscreen?: boolean | undefined;
321
+ readonly elevation?: SizeTokens | undefined;
322
+ } & {
323
+ orientation?: "vertical" | "horizontal" | undefined;
324
+ }, "size"> & {
325
+ size?: any;
326
+ }>>) | Pick<Omit<import("react-native").ViewProps, "children" | "display"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
327
+ readonly fullscreen?: boolean | undefined;
328
+ readonly elevation?: SizeTokens | undefined;
329
+ } & {
330
+ orientation?: "vertical" | "horizontal" | undefined;
331
+ } & {
332
+ size?: any;
333
+ }, string | number> & {
334
+ [x: string]: undefined;
335
+ } & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "children" | "display"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
336
+ readonly fullscreen?: boolean | undefined;
337
+ readonly elevation?: SizeTokens | undefined;
338
+ } & {
339
+ orientation?: "vertical" | "horizontal" | undefined;
340
+ } & {
341
+ size?: any;
342
+ }, string | number> & {
343
+ [x: string]: undefined;
344
+ }>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "children" | "display"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
345
+ readonly fullscreen?: boolean | undefined;
346
+ readonly elevation?: SizeTokens | undefined;
347
+ } & {
348
+ orientation?: "vertical" | "horizontal" | undefined;
349
+ } & {
350
+ size?: any;
351
+ }, string | number> & {
352
+ [x: string]: undefined;
353
+ }>>, string | number>) & React.RefAttributes<View>>;
354
+ declare const Thumb: React.ForwardRefExoticComponent<SliderThumbProps & React.RefAttributes<View>>;
217
355
  export { Slider, SliderTrack, SliderTrackActive, SliderThumb, Track, Range, Thumb, };
218
356
  export type { SliderProps, SliderTrackProps, SliderTrackActiveProps, SliderThumbProps };
219
357
  //# sourceMappingURL=Slider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../src/Slider.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,UAAU,EAMX,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,iBAAiB,EAAkB,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAGhF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAmB,IAAI,EAAE,MAAM,cAAc,CAAA;AAwBpD,OAAO,EAIL,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAEjB,MAAM,SAAS,CAAA;AAMhB,aAAK,uBAAuB,GAAG,iBAAiB,CAAA;AAiEhD,aAAK,qBAAqB,GAAG,iBAAiB,CAAA;AAgE9C,aAAK,kBAAkB,GAAG,WAAW,GAAG,IAAI,CAAA;AAE5C,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAQ3B,CAAA;AAEF,QAAA,MAAM,WAAW,6FAehB,CAAA;AAUD,aAAK,wBAAwB,GAAG,WAAW,GAAG,IAAI,CAAA;AAClD,UAAU,sBAAuB,SAAQ,WAAW;CAAG;AAEvD,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAIjC,CAAA;AAEF,QAAA,MAAM,iBAAiB,yGAqCtB,CAAA;AAsBD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiB3B,CAAA;AAEF,aAAK,kBAAkB,GAAG,WAAW,GAAG,IAAI,CAAA;AAC5C,UAAU,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