@tamagui/slider 1.0.1-beta.78 → 1.0.1-beta.79
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/jsx/Slider.js +1 -0
- package/dist/jsx/Slider.js.map +7 -0
- package/dist/jsx/SliderImpl.js +1 -0
- package/dist/jsx/SliderImpl.js.map +7 -0
- package/dist/jsx/constants.js +1 -0
- package/dist/jsx/constants.js.map +7 -0
- package/dist/jsx/helpers.js +1 -0
- package/dist/jsx/helpers.js.map +7 -0
- package/dist/jsx/index.js +1 -0
- package/dist/jsx/index.js.map +7 -0
- package/dist/jsx/types.js +1 -0
- package/dist/jsx/types.js.map +7 -0
- package/package.json +8 -8
- package/types/Slider.d.ts +29 -29
- package/types/SliderImpl.d.ts +14 -14
- package/types/constants.d.ts +0 -1
- package/types/constants.d.ts.map +1 -1
package/dist/jsx/Slider.js
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/Slider.tsx"],
|
|
4
|
+
"sourcesContent": ["// forked from radix-ui\n\nimport { useComposedRefs } from '@tamagui/compose-refs'\nimport { getSize, isWeb, styled, withStaticProperties } from '@tamagui/core'\nimport { clamp, composeEventHandlers } from '@tamagui/helpers'\nimport { SizableStackProps, ThemeableStack, YStackProps } from '@tamagui/stacks'\nimport { useControllableState } from '@tamagui/use-controllable-state'\nimport { useDirection } from '@tamagui/use-direction'\nimport * as React from 'react'\nimport { LayoutRectangle, View } from 'react-native'\n\nimport {\n ARROW_KEYS,\n BACK_KEYS,\n PAGE_KEYS,\n SLIDER_NAME,\n SliderOrientationProvider,\n SliderProvider,\n useSliderContext,\n useSliderOrientationContext,\n} from './constants'\nimport {\n convertValueToPercentage,\n getClosestValueIndex,\n getDecimalCount,\n getLabel,\n getNextSortedValues,\n getThumbInBoundsOffset,\n hasMinStepsBetweenValues,\n linearScale,\n roundValue,\n} from './helpers'\nimport { SliderFrame, SliderImpl } from './SliderImpl'\nimport {\n ScopedProps,\n SliderContextValue,\n SliderHorizontalProps,\n SliderImplElement,\n SliderProps,\n SliderTrackProps,\n SliderVerticalProps,\n} from './types'\n\n/* -------------------------------------------------------------------------------------------------\n * SliderHorizontal\n * -----------------------------------------------------------------------------------------------*/\n\ntype SliderHorizontalElement = SliderImplElement\n\nconst SliderHorizontal = React.forwardRef<SliderHorizontalElement, SliderHorizontalProps>(\n (props: ScopedProps<SliderHorizontalProps>, forwardedRef) => {\n const { min, max, dir, onSlideStart, onSlideMove, onStepKeyDown, ...sliderProps } = props\n const direction = useDirection(dir)\n const isDirectionLTR = direction === 'ltr'\n const layoutRef = React.useRef<LayoutRectangle | null>(null)\n const [size, setSize] = React.useState(0)\n\n function getValueFromPointer(pointerPosition: number) {\n const layout = layoutRef.current\n if (!layout) return\n const input: [number, number] = [0, layout.width]\n const output: [number, number] = isDirectionLTR ? [min, max] : [max, min]\n const value = linearScale(input, output)\n return value(pointerPosition)\n }\n\n return (\n <SliderOrientationProvider\n scope={props.__scopeSlider}\n startEdge={isDirectionLTR ? 'left' : 'right'}\n endEdge={isDirectionLTR ? 'right' : 'left'}\n direction={isDirectionLTR ? 1 : -1}\n sizeProp=\"width\"\n size={size}\n >\n <SliderImpl\n ref={forwardedRef}\n dir={direction}\n {...sliderProps}\n orientation=\"horizontal\"\n onLayout={(e) => {\n const layout = e.nativeEvent.layout\n layoutRef.current = layout\n setSize(layout.height)\n }}\n onSlideStart={(event, target) => {\n const value = getValueFromPointer(event.nativeEvent.locationX)\n if (value) {\n onSlideStart?.(value, target)\n }\n }}\n onSlideMove={(event) => {\n const value = getValueFromPointer(event.nativeEvent.locationX)\n if (value) {\n onSlideMove?.(value)\n }\n }}\n onSlideEnd={() => {}}\n onStepKeyDown={(event) => {\n const isBackKey = BACK_KEYS[direction].includes(event.key)\n onStepKeyDown?.({ event, direction: isBackKey ? -1 : 1 })\n }}\n />\n </SliderOrientationProvider>\n )\n }\n)\n\n/* -------------------------------------------------------------------------------------------------\n * SliderVertical\n * -----------------------------------------------------------------------------------------------*/\n\ntype SliderVerticalElement = SliderImplElement\n\nconst SliderVertical = React.forwardRef<SliderVerticalElement, SliderVerticalProps>(\n (props: ScopedProps<SliderVerticalProps>, forwardedRef) => {\n const { min, max, onSlideStart, onSlideMove, onStepKeyDown, ...sliderProps } = props\n const layoutRef = React.useRef<LayoutRectangle | null>(null)\n const [size, setSize] = React.useState(0)\n\n function getValueFromPointer(pointerPosition: number) {\n const layout = layoutRef.current\n if (!layout) return\n const input: [number, number] = [0, layout.height]\n const output: [number, number] = [max, min]\n const value = linearScale(input, output)\n return value(pointerPosition)\n }\n\n return (\n <SliderOrientationProvider\n scope={props.__scopeSlider}\n startEdge=\"bottom\"\n endEdge=\"top\"\n sizeProp=\"height\"\n size={size}\n direction={1}\n >\n <SliderImpl\n ref={forwardedRef}\n {...sliderProps}\n orientation=\"vertical\"\n onLayout={(e) => {\n const layout = e.nativeEvent.layout\n layoutRef.current = layout\n setSize(layout.height)\n }}\n onSlideStart={(event, target) => {\n const value = getValueFromPointer(event.nativeEvent.locationY)\n if (value) {\n onSlideStart?.(value, target)\n }\n }}\n onSlideMove={(event) => {\n const value = getValueFromPointer(event.nativeEvent.locationY)\n if (value) {\n onSlideMove?.(value)\n }\n }}\n onSlideEnd={() => {}}\n onStepKeyDown={(event) => {\n const isBackKey = BACK_KEYS.ltr.includes(event.key)\n onStepKeyDown?.({ event, direction: isBackKey ? -1 : 1 })\n }}\n />\n </SliderOrientationProvider>\n )\n }\n)\n\n/* -------------------------------------------------------------------------------------------------\n * SliderTrack\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRACK_NAME = 'SliderTrack'\n\ntype SliderTrackElement = HTMLElement | View\n\nexport const SliderTrackFrame = styled(SliderFrame, {\n name: 'SliderTrack',\n height: '100%',\n width: '100%',\n backgroundColor: '$background',\n position: 'relative',\n borderRadius: 100_000,\n overflow: 'hidden',\n})\n\nconst SliderTrack = React.forwardRef<SliderTrackElement, SliderTrackProps>(\n (props: ScopedProps<SliderTrackProps>, forwardedRef) => {\n const { __scopeSlider, ...trackProps } = props\n const context = useSliderContext(TRACK_NAME, __scopeSlider)\n return (\n <SliderTrackFrame\n data-disabled={context.disabled ? '' : undefined}\n data-orientation={context.orientation}\n orientation={context.orientation}\n size={context.size}\n {...trackProps}\n ref={forwardedRef}\n />\n )\n }\n)\n\nSliderTrack.displayName = TRACK_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * SliderTrackActive\n * -----------------------------------------------------------------------------------------------*/\n\nconst RANGE_NAME = 'SliderTrackActive'\n\ntype SliderTrackActiveElement = HTMLElement | View\ninterface SliderTrackActiveProps extends YStackProps {}\n\nexport const SliderTrackActiveFrame = styled(SliderFrame, {\n name: 'SliderTrackActive',\n backgroundColor: '$background',\n position: 'absolute',\n})\n\nconst SliderTrackActive = React.forwardRef<SliderTrackActiveElement, SliderTrackActiveProps>(\n (props: ScopedProps<SliderTrackActiveProps>, forwardedRef) => {\n const { __scopeSlider, ...rangeProps } = props\n const context = useSliderContext(RANGE_NAME, __scopeSlider)\n const orientation = useSliderOrientationContext(RANGE_NAME, __scopeSlider)\n const ref = React.useRef<HTMLSpanElement>(null)\n const composedRefs = useComposedRefs(forwardedRef, ref)\n const valuesCount = context.values.length\n const percentages = context.values.map((value) =>\n convertValueToPercentage(value, context.min, context.max)\n )\n const offsetStart = valuesCount > 1 ? Math.min(...percentages) : 0\n const offsetEnd = 100 - Math.max(...percentages)\n\n return (\n <SliderTrackActiveFrame\n orientation={context.orientation}\n data-orientation={context.orientation}\n data-disabled={context.disabled ? '' : undefined}\n size={context.size}\n {...rangeProps}\n ref={composedRefs}\n {...{\n [orientation.startEdge]: offsetStart + '%',\n [orientation.endEdge]: offsetEnd + '%',\n }}\n {...(orientation.sizeProp === 'width'\n ? {\n height: '100%',\n }\n : {\n left: 0,\n right: 0,\n })}\n />\n )\n }\n)\n\nSliderTrackActive.displayName = RANGE_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * SliderThumb\n * -----------------------------------------------------------------------------------------------*/\n\nconst THUMB_NAME = 'SliderThumb'\n\nexport const SliderThumbFrame = styled(ThemeableStack, {\n name: 'SliderThumb',\n position: 'absolute',\n // TODO not taking up 2\n bordered: 2,\n // OR THIS\n borderWidth: 2,\n backgrounded: true,\n pressTheme: isWeb,\n focusTheme: isWeb,\n hoverTheme: isWeb,\n\n variants: {\n size: {\n '...size': (val) => {\n const size = typeof val === 'number' ? val : getSize(val, -1)\n return {\n width: size,\n height: size,\n minWidth: size,\n minHeight: size,\n }\n },\n },\n },\n})\n\ntype SliderThumbElement = HTMLElement | View\ninterface SliderThumbProps extends SizableStackProps {\n index: number\n}\n\nconst SliderThumb = React.forwardRef<SliderThumbElement, SliderThumbProps>(\n (props: ScopedProps<SliderThumbProps>, forwardedRef) => {\n const { __scopeSlider, index, size: sizeProp, ...thumbProps } = props\n const context = useSliderContext(THUMB_NAME, __scopeSlider)\n const orientation = useSliderOrientationContext(THUMB_NAME, __scopeSlider)\n const [thumb, setThumb] = React.useState<View | HTMLElement | null>(null)\n const composedRefs = useComposedRefs(forwardedRef, (node) => setThumb(node))\n\n // We cast because index could be `-1` which would return undefined\n const value = context.values[index] as number | undefined\n const percent =\n value === undefined ? 0 : convertValueToPercentage(value, context.min, context.max)\n const label = getLabel(index, context.values.length)\n const [size, setSize] = React.useState(0)\n\n const thumbInBoundsOffset = size\n ? getThumbInBoundsOffset(size, percent, orientation.direction)\n : 0\n\n React.useEffect(() => {\n if (thumb) {\n context.thumbs.add(thumb)\n return () => {\n context.thumbs.delete(thumb)\n }\n }\n }, [thumb, context.thumbs])\n\n return (\n <SliderThumbFrame\n ref={composedRefs}\n // TODO\n // @ts-ignore\n role=\"slider\"\n aria-label={props['aria-label'] || label}\n aria-valuemin={context.min}\n aria-valuenow={value}\n aria-valuemax={context.max}\n aria-orientation={context.orientation}\n data-orientation={context.orientation}\n data-disabled={context.disabled ? '' : undefined}\n // TODO\n // @ts-ignore\n tabIndex={context.disabled ? undefined : 0}\n {...thumbProps}\n {...(context.orientation === 'horizontal'\n ? {\n x: thumbInBoundsOffset - size / 2,\n y: -size / 2,\n top: '50%',\n ...(size === 0 && {\n top: 'auto',\n bottom: 'auto',\n }),\n }\n : {\n x: -size / 2,\n y: size / 2,\n left: '50%',\n ...(size === 0 && {\n left: 'auto',\n right: 'auto',\n }),\n })}\n size={sizeProp ?? context.size ?? '$4'}\n onLayout={(e) => {\n setSize(e.nativeEvent.layout[orientation.sizeProp])\n }}\n {...{\n [orientation.startEdge]: `${percent}%`,\n }}\n /**\n * There will be no value on initial render while we work out the index so we hide thumbs\n * without a value, otherwise SSR will render them in the wrong position before they\n * snap into the correct position during hydration which would be visually jarring for\n * slower connections.\n */\n // style={value === undefined ? { display: 'none' } : props.style}\n onFocus={composeEventHandlers(props.onFocus, () => {\n context.valueIndexToChangeRef.current = index\n })}\n // temp fix to make slider work nicely on native\n // we just let the events propagate to the track\n {...(!isWeb && {\n pointerEvents: 'none',\n })}\n />\n )\n }\n)\n\nSliderThumb.displayName = THUMB_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * Slider\n * -----------------------------------------------------------------------------------------------*/\n\ntype SliderElement = SliderHorizontalElement | SliderVerticalElement\n\nconst Slider = withStaticProperties(\n React.forwardRef<SliderElement, SliderProps>((props: ScopedProps<SliderProps>, forwardedRef) => {\n const {\n name,\n min = 0,\n max = 100,\n step = 1,\n orientation = 'horizontal',\n disabled = false,\n minStepsBetweenThumbs = 0,\n defaultValue = [min],\n value,\n onValueChange = () => {},\n size: sizeProp,\n ...sliderProps\n } = props\n const sliderRef = React.useRef<SliderImplElement>(null)\n const composedRefs = useComposedRefs(sliderRef, forwardedRef)\n const thumbRefs = React.useRef<SliderContextValue['thumbs']>(new Set())\n const valueIndexToChangeRef = React.useRef<number>(0)\n const isHorizontal = orientation === 'horizontal'\n // We set this to true by default so that events bubble to forms without JS (SSR)\n // TODO\n // const isFormControl = slider ? Boolean(slider.closest('form')) : true\n\n const [values = [], setValues] = useControllableState({\n prop: value,\n defaultProp: defaultValue,\n onChange: (value) => {\n if (isWeb) {\n const thumbs = [...thumbRefs.current]\n thumbs[valueIndexToChangeRef.current]?.focus()\n }\n onValueChange(value)\n },\n })\n\n if (isWeb) {\n React.useEffect(() => {\n const node = sliderRef.current as HTMLElement\n if (!node) return\n const preventDefault = (e) => {\n e.preventDefault()\n }\n node.addEventListener('touchstart', preventDefault)\n return () => {\n node.removeEventListener('touchstart', preventDefault)\n }\n }, [])\n }\n\n function handleSlideMove(value: number) {\n updateValues(value, valueIndexToChangeRef.current)\n }\n\n function updateValues(value: number, atIndex: number) {\n const decimalCount = getDecimalCount(step)\n const snapToStep = roundValue(Math.round((value - min) / step) * step + min, decimalCount)\n const nextValue = clamp(snapToStep, [min, max])\n setValues((prevValues = []) => {\n const nextValues = getNextSortedValues(prevValues, nextValue, atIndex)\n if (hasMinStepsBetweenValues(nextValues, minStepsBetweenThumbs * step)) {\n valueIndexToChangeRef.current = nextValues.indexOf(nextValue)\n return String(nextValues) === String(prevValues) ? prevValues : nextValues\n } else {\n return prevValues\n }\n })\n }\n\n const SliderOriented = isHorizontal ? SliderHorizontal : SliderVertical\n\n return (\n <SliderProvider\n scope={props.__scopeSlider}\n disabled={disabled}\n min={min}\n max={max}\n valueIndexToChangeRef={valueIndexToChangeRef}\n thumbs={thumbRefs.current}\n values={values}\n orientation={orientation}\n size={sizeProp}\n >\n <SliderOriented\n aria-disabled={disabled}\n data-disabled={disabled ? '' : undefined}\n {...sliderProps}\n ref={composedRefs}\n min={min}\n max={max}\n onSlideStart={\n disabled\n ? undefined\n : (value: number, target) => {\n // when starting on the track, move it right away\n // when starting on thumb, dont jump until movemenet as it feels weird\n if (target !== 'thumb') {\n const closestIndex = getClosestValueIndex(values, value)\n updateValues(value, closestIndex)\n }\n }\n }\n onSlideMove={disabled ? undefined : handleSlideMove}\n onHomeKeyDown={() => !disabled && updateValues(min, 0)}\n onEndKeyDown={() => !disabled && updateValues(max, values.length - 1)}\n onStepKeyDown={({ event, direction: stepDirection }) => {\n if (!disabled) {\n const isPageKey = PAGE_KEYS.includes(event.key)\n const isSkipKey = isPageKey || (event.shiftKey && ARROW_KEYS.includes(event.key))\n const multiplier = isSkipKey ? 10 : 1\n const atIndex = valueIndexToChangeRef.current\n const value = values[atIndex]\n const stepInDirection = step * multiplier * stepDirection\n updateValues(value + stepInDirection, atIndex)\n }\n }}\n />\n {/* {isFormControl &&\n values.map((value, index) => (\n <BubbleInput\n key={index}\n name={name ? name + (values.length > 1 ? '[]' : '') : undefined}\n value={value}\n />\n ))} */}\n </SliderProvider>\n )\n }),\n {\n Track: SliderTrack,\n TrackActive: SliderTrackActive,\n Thumb: SliderThumb,\n }\n)\n\nSlider.displayName = SLIDER_NAME\n\n/* -----------------------------------------------------------------------------------------------*/\n\n// TODO\n// const BubbleInput = (props: any) => {\n// const { value, ...inputProps } = props\n// const ref = React.useRef<HTMLInputElement>(null)\n// const prevValue = usePrevious(value)\n\n// // Bubble value change to parents (e.g form change event)\n// React.useEffect(() => {\n// const input = ref.current!\n// const inputProto = window.HTMLInputElement.prototype\n// const descriptor = Object.getOwnPropertyDescriptor(inputProto, 'value') as PropertyDescriptor\n// const setValue = descriptor.set\n// if (prevValue !== value && setValue) {\n// const event = new Event('input', { bubbles: true })\n// setValue.call(input, value)\n// input.dispatchEvent(event)\n// }\n// }, [prevValue, value])\n\n// /**\n// * We purposefully do not use `type=\"hidden\"` here otherwise forms that\n// * wrap it will not be able to access its value via the FormData API.\n// *\n// * We purposefully do not add the `value` attribute here to allow the value\n// * to be set programatically and bubble to any parent form `onChange` event.\n// * Adding the `value` will cause React to consider the programatic\n// * dispatch a duplicate and it will get swallowed.\n// */\n// return <input style={{ display: 'none' }} {...inputProps} ref={ref} defaultValue={value} />\n// }\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Track = SliderTrack\nconst Range = SliderTrackActive\nconst Thumb = SliderThumb\n\nexport {\n Slider,\n SliderTrack,\n SliderTrackActive,\n SliderThumb,\n //\n Track,\n Range,\n Thumb,\n}\n\nexport type { SliderProps, SliderTrackProps, SliderTrackActiveProps, SliderThumbProps }\n"],
|
|
5
|
+
"mappings": "AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA;AAiBA,MAAM,mBAAmB,MAAM,WAC7B,CAAC,OAA2C,iBAAiB;AAC3D,QAAM,EAAE,KAAK,KAAK,KAAK,cAAc,aAAa,kBAAkB,gBAAgB;AACpF,QAAM,YAAY,aAAa,GAAG;AAClC,QAAM,iBAAiB,cAAc;AACrC,QAAM,YAAY,MAAM,OAA+B,IAAI;AAC3D,QAAM,CAAC,MAAM,WAAW,MAAM,SAAS,CAAC;AAExC,+BAA6B,iBAAyB;AACpD,UAAM,SAAS,UAAU;AACzB,QAAI,CAAC;AAAQ;AACb,UAAM,QAA0B,CAAC,GAAG,OAAO,KAAK;AAChD,UAAM,SAA2B,iBAAiB,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG;AACxE,UAAM,QAAQ,YAAY,OAAO,MAAM;AACvC,WAAO,MAAM,eAAe;AAAA,EAC9B;AAEA,SACE,CAAC,0BACC,OAAO,MAAM,eACb,WAAW,iBAAiB,SAAS,SACrC,SAAS,iBAAiB,UAAU,QACpC,WAAW,iBAAiB,IAAI,IAChC,SAAS,QACT,MAAM,MAEN,CAAC,WACC,KAAK,cACL,KAAK,eACD,aACJ,YAAY,aACZ,UAAU,CAAC,MAAM;AACf,UAAM,SAAS,EAAE,YAAY;AAC7B,cAAU,UAAU;AACpB,YAAQ,OAAO,MAAM;AAAA,EACvB,GACA,cAAc,CAAC,OAAO,WAAW;AAC/B,UAAM,QAAQ,oBAAoB,MAAM,YAAY,SAAS;AAC7D,QAAI,OAAO;AACT,mDAAe,O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a,YAAY,KAAK;AACpC,YAAM,UAAU,sBAAsB;AACtC,YAAM,SAAQ,OAAO;AACrB,YAAM,kBAAkB,OAAO,aAAa;AAC5C,mBAAa,SAAQ,iBAAiB,OAAO;AAAA,IAC/C;AAAA,EACF,GACF,EASF,EArDC;AAuDL,CAAC,GACD;AAAA,EACE,OAAO;AAAA,EACP,aAAa;AAAA,EACb,OAAO;AACT,CACF;AAEA,OAAO,cAAc;AAqCrB,MAAM,QAAQ;AACd,MAAM,QAAQ;AACd,MAAM,QAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/jsx/SliderImpl.js
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/SliderImpl.tsx"],
|
|
4
|
+
"sourcesContent": ["/* -------------------------------------------------------------------------------------------------\n * SliderImpl\n * -----------------------------------------------------------------------------------------------*/\n\nimport { composeEventHandlers, getSize, getVariableValue, isWeb, styled } from '@tamagui/core'\nimport { YStack } from '@tamagui/stacks'\nimport * as React from 'react'\n\nimport { ARROW_KEYS, PAGE_KEYS, SLIDER_NAME, useSliderContext } from './constants'\nimport { ScopedProps, SliderImplElement, SliderImplProps } from './types'\n\nexport const DirectionalYStack = styled(YStack, {\n variants: {\n orientation: {\n horizontal: {},\n vertical: {},\n },\n },\n})\n\nexport const SliderFrame = styled(DirectionalYStack, {\n position: 'relative',\n\n variants: {\n size: (val, extras) => {\n const orientation = extras.props.orientation\n const size = Math.round(getVariableValue(getSize(val)) / 6)\n if (orientation === 'horizontal') {\n return {\n height: size,\n borderRadius: size,\n justifyContent: 'center',\n }\n }\n return {\n width: size,\n borderRadius: size,\n alignItems: 'center',\n }\n },\n },\n})\n\nexport const SliderImpl = React.forwardRef<SliderImplElement, SliderImplProps>(\n (props: ScopedProps<SliderImplProps>, forwardedRef) => {\n const {\n __scopeSlider,\n onSlideStart,\n onSlideMove,\n onSlideEnd,\n onHomeKeyDown,\n onEndKeyDown,\n onStepKeyDown,\n ...sliderProps\n } = props\n const context = useSliderContext(SLIDER_NAME, __scopeSlider)\n return (\n <SliderFrame\n size=\"$4\"\n {...sliderProps}\n data-orientation={sliderProps.orientation}\n ref={forwardedRef}\n {...(isWeb && {\n onKeyDown: (event) => {\n if (event.key === 'Home') {\n onHomeKeyDown(event)\n // Prevent scrolling to page start\n event.preventDefault()\n } else if (event.key === 'End') {\n onEndKeyDown(event)\n // Prevent scrolling to page end\n event.preventDefault()\n } else if (PAGE_KEYS.concat(ARROW_KEYS).includes(event.key)) {\n onStepKeyDown(event)\n // Prevent scrolling for directional key presses\n event.preventDefault()\n }\n },\n })}\n onMoveShouldSetResponderCapture={() => true}\n onScrollShouldSetResponder={() => true}\n onScrollShouldSetResponderCapture={() => true}\n onMoveShouldSetResponder={() => true}\n onStartShouldSetResponder={() => true}\n onStartShouldSetResponderCapture={() => true}\n onResponderTerminationRequest={() => {\n console.log('got??/')\n return false\n }}\n onResponderGrant={composeEventHandlers(props.onResponderGrant, (event) => {\n const target = event.target as HTMLElement | number\n const isStartingOnThumb = context.thumbs.has(event.target)\n // // Prevent browser focus behaviour because we focus a thumb manually when values change.\n // Touch devices have a delay before focusing so won't focus if touch immediately moves\n // away from target (sliding). We want thumb to focus regardless.\n if (isWeb && target instanceof HTMLElement) {\n if (context.thumbs.has(target)) {\n target.focus()\n }\n }\n onSlideStart(event, isStartingOnThumb ? 'thumb' : 'track')\n })}\n onResponderMove={composeEventHandlers(props.onResponderMove, (event) => {\n console.log('gogo')\n event.preventDefault()\n event.stopPropagation()\n\n // const target = event.target as HTMLElement\n onSlideMove(event)\n })}\n onResponderRelease={composeEventHandlers(props.onResponderRelease, (event) => {\n // const target = event.target as HTMLElement\n onSlideEnd(event)\n })}\n />\n )\n }\n)\n"],
|
|
5
|
+
"mappings": "AAIA;AACA;AACA;AAEA;AAGO,MAAM,oBAAoB,OAAO,QAAQ;AAAA,EAC9C,UAAU;AAAA,IACR,aAAa;AAAA,M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AM;AACnC,YAAQ,IAAI,QAAQ;AACpB,WAAO;AAAA,EACT,GACA,kBAAkB,qBAAqB,MAAM,kBAAkB,CAAC,UAAU;AACxE,UAAM,SAAS,MAAM;AACrB,UAAM,oBAAoB,QAAQ,OAAO,IAAI,MAAM,MAAM;AAIzD,QAAI,SAAS,kBAAkB,aAAa;AAC1C,UAAI,QAAQ,OAAO,IAAI,MAAM,GAAG;AAC9B,eAAO,MAAM;AAAA,MACf;AAAA,IACF;AACA,iBAAa,OAAO,oBAAoB,UAAU,OAAO;AAAA,EAC3D,CAAC,GACD,iBAAiB,qBAAqB,MAAM,iBAAiB,CAAC,UAAU;AACtE,YAAQ,IAAI,MAAM;AAClB,UAAM,eAAe;AACrB,UAAM,gBAAgB;AAGtB,gBAAY,KAAK;AAAA,EACnB,CAAC,GACD,oBAAoB,qBAAqB,MAAM,oBAAoB,CAAC,UAAU;AAE5E,eAAW,KAAK;AAAA,EAClB,CAAC,GACH;AAEJ,CACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/jsx/constants.js
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/constants.tsx"],
|
|
4
|
+
"sourcesContent": ["import { SizeTokens } from '@tamagui/core'\nimport { createContextScope } from '@tamagui/create-context'\n\nimport { Direction, SliderContextValue } from './types'\n\nexport const SLIDER_NAME = 'Slider'\n\nexport const [createSliderContext, createSliderScope] = createContextScope(SLIDER_NAME)\n\nexport const [SliderProvider, useSliderContext] =\n createSliderContext<SliderContextValue>(SLIDER_NAME)\n\nexport const [SliderOrientationProvider, useSliderOrientationContext] = createSliderContext<{\n startEdge: 'bottom' | 'left' | 'right'\n endEdge: 'top' | 'right' | 'left'\n sizeProp: 'width' | 'height'\n size: number | SizeTokens\n direction: number\n}>(SLIDER_NAME, {\n startEdge: 'left',\n endEdge: 'right',\n sizeProp: 'width',\n size: 0,\n direction: 1,\n})\n\nexport const PAGE_KEYS = ['PageUp', 'PageDown']\nexport const ARROW_KEYS = ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight']\nexport const BACK_KEYS: Record<Direction, string[]> = {\n ltr: ['ArrowDown', 'Home', 'ArrowLeft', 'PageDown'],\n rtl: ['ArrowDown', 'Home', 'ArrowRight', 'PageDown'],\n}\n"],
|
|
5
|
+
"mappings": "AACA;AAIO,MAAM,cAAc;AAEpB,MAAM,CAAC,qBAAqB,qBAAqB,mBAAmB,WAAW;AAE/E,MAAM,CAAC,gBAAgB,oBAC5B,oBAAwC,WAAW;AAE9C,MAAM,CAAC,2BAA2B,+BAA+B,oBAMrE,aAAa;AAAA,EACd,WAAW;AAAA,EACX,SAAS;AAAA,EACT,UAAU;AAAA,EACV,MAAM;AAAA,EACN,WAAW;AACb,CAAC;AAEM,MAAM,YAAY,CAAC,UAAU,UAAU;AACvC,MAAM,aAAa,CAAC,WAAW,aAAa,aAAa,YAAY;AACrE,MAAM,YAAyC;AAAA,EACpD,KAAK,CAAC,aAAa,QAAQ,aAAa,UAAU;AAAA,EAClD,KAAK,CAAC,aAAa,QAAQ,cAAc,UAAU;AACrD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/jsx/helpers.js
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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,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
|
+
"names": []
|
|
7
|
+
}
|
package/dist/jsx/index.js
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["export * from './Slider'\n// for static extract to find, must export\nexport { SliderFrame, DirectionalYStack } from './SliderImpl'\nexport type {\n SliderProps,\n SliderHorizontalProps,\n SliderVerticalProps,\n SliderTrackProps,\n} from './types'\n"],
|
|
5
|
+
"mappings": "AAAA;AAEA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/jsx/types.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/slider",
|
|
3
|
-
"version": "1.0.1-beta.
|
|
3
|
+
"version": "1.0.1-beta.79",
|
|
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.
|
|
25
|
-
"@tamagui/core": "^1.0.1-beta.
|
|
26
|
-
"@tamagui/create-context": "^1.0.1-beta.
|
|
27
|
-
"@tamagui/stacks": "^1.0.1-beta.
|
|
28
|
-
"@tamagui/use-controllable-state": "^1.0.1-beta.
|
|
29
|
-
"@tamagui/use-direction": "^1.0.1-beta.
|
|
24
|
+
"@tamagui/compose-refs": "^1.0.1-beta.79",
|
|
25
|
+
"@tamagui/core": "^1.0.1-beta.79",
|
|
26
|
+
"@tamagui/create-context": "^1.0.1-beta.79",
|
|
27
|
+
"@tamagui/stacks": "^1.0.1-beta.79",
|
|
28
|
+
"@tamagui/use-controllable-state": "^1.0.1-beta.79",
|
|
29
|
+
"@tamagui/use-direction": "^1.0.1-beta.79"
|
|
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.
|
|
37
|
+
"@tamagui/build": "^1.0.1-beta.79",
|
|
38
38
|
"@types/react-native": "^0.67.3",
|
|
39
39
|
"react": "*",
|
|
40
40
|
"react-dom": "*",
|
package/types/Slider.d.ts
CHANGED
|
@@ -5,50 +5,50 @@ import { SliderImplElement, SliderProps, SliderTrackProps } from './types';
|
|
|
5
5
|
declare type SliderHorizontalElement = SliderImplElement;
|
|
6
6
|
declare type SliderVerticalElement = SliderImplElement;
|
|
7
7
|
declare type SliderTrackElement = HTMLElement | View;
|
|
8
|
-
export declare const SliderTrackFrame: import("@tamagui/core").TamaguiComponent<(Omit<import("react-native").ViewProps, "
|
|
8
|
+
export declare const SliderTrackFrame: import("@tamagui/core").TamaguiComponent<(Omit<import("react-native").ViewProps, "display" | "children"> & 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<{
|
|
9
9
|
readonly fullscreen?: boolean | undefined;
|
|
10
10
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
11
11
|
} & {
|
|
12
|
-
orientation?: "
|
|
12
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
13
13
|
}, "size"> & {
|
|
14
14
|
size?: any;
|
|
15
|
-
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "
|
|
15
|
+
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & 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<{
|
|
16
16
|
readonly fullscreen?: boolean | undefined;
|
|
17
17
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
18
18
|
} & {
|
|
19
|
-
orientation?: "
|
|
19
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
20
20
|
}, "size"> & {
|
|
21
21
|
size?: any;
|
|
22
|
-
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "
|
|
22
|
+
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & 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<{
|
|
23
23
|
readonly fullscreen?: boolean | undefined;
|
|
24
24
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
25
25
|
} & {
|
|
26
|
-
orientation?: "
|
|
26
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
27
27
|
}, "size"> & {
|
|
28
28
|
size?: any;
|
|
29
|
-
}>>) | (Omit<import("react-native").ViewProps, "
|
|
29
|
+
}>>) | (Omit<import("react-native").ViewProps, "display" | "children"> & 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<{
|
|
30
30
|
readonly fullscreen?: boolean | undefined;
|
|
31
31
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
32
32
|
} & {
|
|
33
|
-
orientation?: "
|
|
33
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
34
34
|
} & {
|
|
35
35
|
size?: any;
|
|
36
36
|
}, string | number> & {
|
|
37
37
|
[x: string]: undefined;
|
|
38
|
-
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "
|
|
38
|
+
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & 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<{
|
|
39
39
|
readonly fullscreen?: boolean | undefined;
|
|
40
40
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
41
41
|
} & {
|
|
42
|
-
orientation?: "
|
|
42
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
43
43
|
} & {
|
|
44
44
|
size?: any;
|
|
45
45
|
}, string | number> & {
|
|
46
46
|
[x: string]: undefined;
|
|
47
|
-
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "
|
|
47
|
+
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & 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<{
|
|
48
48
|
readonly fullscreen?: boolean | undefined;
|
|
49
49
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
50
50
|
} & {
|
|
51
|
-
orientation?: "
|
|
51
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
52
52
|
} & {
|
|
53
53
|
size?: any;
|
|
54
54
|
}, string | number> & {
|
|
@@ -57,7 +57,7 @@ export declare const SliderTrackFrame: import("@tamagui/core").TamaguiComponent<
|
|
|
57
57
|
readonly fullscreen?: boolean | undefined;
|
|
58
58
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
59
59
|
} & {
|
|
60
|
-
orientation?: "
|
|
60
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
61
61
|
} & {
|
|
62
62
|
size?: any;
|
|
63
63
|
} & ({} | {
|
|
@@ -67,50 +67,50 @@ declare const SliderTrack: React.ForwardRefExoticComponent<SliderTrackProps & Re
|
|
|
67
67
|
declare type SliderTrackActiveElement = HTMLElement | View;
|
|
68
68
|
interface SliderTrackActiveProps extends YStackProps {
|
|
69
69
|
}
|
|
70
|
-
export declare const SliderTrackActiveFrame: import("@tamagui/core").TamaguiComponent<(Omit<import("react-native").ViewProps, "
|
|
70
|
+
export declare const SliderTrackActiveFrame: import("@tamagui/core").TamaguiComponent<(Omit<import("react-native").ViewProps, "display" | "children"> & 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<{
|
|
71
71
|
readonly fullscreen?: boolean | undefined;
|
|
72
72
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
73
73
|
} & {
|
|
74
|
-
orientation?: "
|
|
74
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
75
75
|
}, "size"> & {
|
|
76
76
|
size?: any;
|
|
77
|
-
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "
|
|
77
|
+
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & 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<{
|
|
78
78
|
readonly fullscreen?: boolean | undefined;
|
|
79
79
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
80
80
|
} & {
|
|
81
|
-
orientation?: "
|
|
81
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
82
82
|
}, "size"> & {
|
|
83
83
|
size?: any;
|
|
84
|
-
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "
|
|
84
|
+
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & 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<{
|
|
85
85
|
readonly fullscreen?: boolean | undefined;
|
|
86
86
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
87
87
|
} & {
|
|
88
|
-
orientation?: "
|
|
88
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
89
89
|
}, "size"> & {
|
|
90
90
|
size?: any;
|
|
91
|
-
}>>) | (Omit<import("react-native").ViewProps, "
|
|
91
|
+
}>>) | (Omit<import("react-native").ViewProps, "display" | "children"> & 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<{
|
|
92
92
|
readonly fullscreen?: boolean | undefined;
|
|
93
93
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
94
94
|
} & {
|
|
95
|
-
orientation?: "
|
|
95
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
96
96
|
} & {
|
|
97
97
|
size?: any;
|
|
98
98
|
}, string | number> & {
|
|
99
99
|
[x: string]: undefined;
|
|
100
|
-
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "
|
|
100
|
+
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & 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<{
|
|
101
101
|
readonly fullscreen?: boolean | undefined;
|
|
102
102
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
103
103
|
} & {
|
|
104
|
-
orientation?: "
|
|
104
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
105
105
|
} & {
|
|
106
106
|
size?: any;
|
|
107
107
|
}, string | number> & {
|
|
108
108
|
[x: string]: undefined;
|
|
109
|
-
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "
|
|
109
|
+
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & 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<{
|
|
110
110
|
readonly fullscreen?: boolean | undefined;
|
|
111
111
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
112
112
|
} & {
|
|
113
|
-
orientation?: "
|
|
113
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
114
114
|
} & {
|
|
115
115
|
size?: any;
|
|
116
116
|
}, string | number> & {
|
|
@@ -119,14 +119,14 @@ export declare const SliderTrackActiveFrame: import("@tamagui/core").TamaguiComp
|
|
|
119
119
|
readonly fullscreen?: boolean | undefined;
|
|
120
120
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
121
121
|
} & {
|
|
122
|
-
orientation?: "
|
|
122
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
123
123
|
} & {
|
|
124
124
|
size?: any;
|
|
125
125
|
} & ({} | {
|
|
126
126
|
[x: string]: undefined;
|
|
127
127
|
})>;
|
|
128
128
|
declare const SliderTrackActive: React.ForwardRefExoticComponent<SliderTrackActiveProps & React.RefAttributes<SliderTrackActiveElement>>;
|
|
129
|
-
export declare const SliderThumbFrame: import("@tamagui/core").TamaguiComponent<Omit<import("react-native").ViewProps, "
|
|
129
|
+
export declare const SliderThumbFrame: import("@tamagui/core").TamaguiComponent<Omit<import("react-native").ViewProps, "display" | "children"> & 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<{
|
|
130
130
|
readonly fullscreen?: boolean | undefined;
|
|
131
131
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
132
132
|
} & {
|
|
@@ -144,7 +144,7 @@ export declare const SliderThumbFrame: import("@tamagui/core").TamaguiComponent<
|
|
|
144
144
|
chromeless?: boolean | undefined;
|
|
145
145
|
}, "size"> & {
|
|
146
146
|
size?: import("@tamagui/core").SizeTokens | undefined;
|
|
147
|
-
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "
|
|
147
|
+
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & 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<{
|
|
148
148
|
readonly fullscreen?: boolean | undefined;
|
|
149
149
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
150
150
|
} & {
|
|
@@ -162,7 +162,7 @@ export declare const SliderThumbFrame: import("@tamagui/core").TamaguiComponent<
|
|
|
162
162
|
chromeless?: boolean | undefined;
|
|
163
163
|
}, "size"> & {
|
|
164
164
|
size?: import("@tamagui/core").SizeTokens | undefined;
|
|
165
|
-
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "
|
|
165
|
+
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & 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<{
|
|
166
166
|
readonly fullscreen?: boolean | undefined;
|
|
167
167
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
168
168
|
} & {
|
package/types/SliderImpl.d.ts
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SliderImplElement, SliderImplProps } from './types';
|
|
3
|
-
export declare const DirectionalYStack: import("@tamagui/core").TamaguiComponent<Omit<import("react-native").ViewProps, "
|
|
3
|
+
export declare const DirectionalYStack: import("@tamagui/core").TamaguiComponent<Omit<import("react-native").ViewProps, "display" | "children"> & 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<{
|
|
4
4
|
readonly fullscreen?: boolean | undefined;
|
|
5
5
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
6
6
|
}, "orientation"> & {
|
|
7
|
-
orientation?: "
|
|
8
|
-
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "
|
|
7
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
8
|
+
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & 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<{
|
|
9
9
|
readonly fullscreen?: boolean | undefined;
|
|
10
10
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
11
11
|
}, "orientation"> & {
|
|
12
|
-
orientation?: "
|
|
13
|
-
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "
|
|
12
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
13
|
+
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & 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<{
|
|
14
14
|
readonly fullscreen?: boolean | undefined;
|
|
15
15
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
16
16
|
}, "orientation"> & {
|
|
17
|
-
orientation?: "
|
|
17
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
18
18
|
}>>, any, import("@tamagui/core").StackPropsBase, {
|
|
19
19
|
readonly fullscreen?: boolean | undefined;
|
|
20
20
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
21
21
|
} & {
|
|
22
|
-
orientation?: "
|
|
22
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
23
23
|
}>;
|
|
24
|
-
export declare const SliderFrame: import("@tamagui/core").TamaguiComponent<Omit<import("react-native").ViewProps, "
|
|
24
|
+
export declare const SliderFrame: import("@tamagui/core").TamaguiComponent<Omit<import("react-native").ViewProps, "display" | "children"> & 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<{
|
|
25
25
|
readonly fullscreen?: boolean | undefined;
|
|
26
26
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
27
27
|
} & {
|
|
28
|
-
orientation?: "
|
|
28
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
29
29
|
}, "size"> & {
|
|
30
30
|
size?: any;
|
|
31
|
-
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "
|
|
31
|
+
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & 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<{
|
|
32
32
|
readonly fullscreen?: boolean | undefined;
|
|
33
33
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
34
34
|
} & {
|
|
35
|
-
orientation?: "
|
|
35
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
36
36
|
}, "size"> & {
|
|
37
37
|
size?: any;
|
|
38
|
-
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "
|
|
38
|
+
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & 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<{
|
|
39
39
|
readonly fullscreen?: boolean | undefined;
|
|
40
40
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
41
41
|
} & {
|
|
42
|
-
orientation?: "
|
|
42
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
43
43
|
}, "size"> & {
|
|
44
44
|
size?: any;
|
|
45
45
|
}>>, any, import("@tamagui/core").StackPropsBase, {
|
|
46
46
|
readonly fullscreen?: boolean | undefined;
|
|
47
47
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
48
48
|
} & {
|
|
49
|
-
orientation?: "
|
|
49
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
50
50
|
} & {
|
|
51
51
|
size?: any;
|
|
52
52
|
}>;
|
package/types/constants.d.ts
CHANGED
package/types/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAG1C,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAEvD,eAAO,MAAM,WAAW,WAAW,CAAA;AAEnC,eAAO,MAAO,mBAAmB;;;;;;8HAAE,iBAAiB,+CAAmC,CAAA;AAEvF,eAAO,MAAO,cAAc;;;;;;GAAE,gBAAgB,8HACQ,CAAA;AAEtD,eAAO,MAAO,yBAAyB;;mBAC1B,QAAQ,GAAG,MAAM,GAAG,OAAO;iBAC7B,KAAK,GAAG,OAAO,GAAG,MAAM;kBACvB,OAAO,GAAG,QAAQ;cACtB,MAAM,GAAG,UAAU;mBACd,MAAM;;;uBAJN,QAAQ,GAAG,MAAM,GAAG,OAAO;qBAC7B,KAAK,GAAG,OAAO,GAAG,MAAM;sBACvB,OAAO,GAAG,QAAQ;kBACtB,MAAM,GAAG,UAAU;uBACd,MAAM;;;;;GALsB,2BAA2B;eACvD,QAAQ,GAAG,MAAM,GAAG,OAAO;aAC7B,KAAK,GAAG,OAAO,GAAG,MAAM;cACvB,OAAO,GAAG,QAAQ;UACtB,MAAM,GAAG,UAAU;eACd,MAAM;;eAJN,QAAQ,GAAG,MAAM,GAAG,OAAO;aAC7B,KAAK,GAAG,OAAO,GAAG,MAAM;cACvB,OAAO,GAAG,QAAQ;UACtB,MAAM,GAAG,UAAU;eACd,MAAM;CAOjB,CAAA;AAEF,eAAO,MAAM,SAAS,UAAyB,CAAA;AAC/C,eAAO,MAAM,UAAU,UAAsD,CAAA;AAC7E,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,CAGjD,CAAA"}
|