@cdx-ui/primitives 0.0.1-beta.115 → 0.0.1-beta.117
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/README.md +5 -0
- package/lib/commonjs/index.js +35 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/overlay/useAnchorPosition.js +60 -11
- package/lib/commonjs/overlay/useAnchorPosition.js.map +1 -1
- package/lib/commonjs/slider/SliderRail.js +131 -0
- package/lib/commonjs/slider/SliderRail.js.map +1 -0
- package/lib/commonjs/slider/SliderRoot.js +186 -0
- package/lib/commonjs/slider/SliderRoot.js.map +1 -0
- package/lib/commonjs/slider/SliderThumb.js +228 -0
- package/lib/commonjs/slider/SliderThumb.js.map +1 -0
- package/lib/commonjs/slider/context.js +11 -0
- package/lib/commonjs/slider/context.js.map +1 -0
- package/lib/commonjs/slider/index.js +65 -0
- package/lib/commonjs/slider/index.js.map +1 -0
- package/lib/commonjs/slider/types.js +6 -0
- package/lib/commonjs/slider/types.js.map +1 -0
- package/lib/commonjs/slider/useSliderPointer.js +116 -0
- package/lib/commonjs/slider/useSliderPointer.js.map +1 -0
- package/lib/commonjs/slider/utils.js +155 -0
- package/lib/commonjs/slider/utils.js.map +1 -0
- package/lib/commonjs/utils/assignRef.js +16 -0
- package/lib/commonjs/utils/assignRef.js.map +1 -0
- package/lib/commonjs/utils/createPortal.js +3 -1
- package/lib/commonjs/utils/createPortal.js.map +1 -1
- package/lib/module/index.js +4 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/overlay/useAnchorPosition.js +60 -11
- package/lib/module/overlay/useAnchorPosition.js.map +1 -1
- package/lib/module/slider/SliderRail.js +127 -0
- package/lib/module/slider/SliderRail.js.map +1 -0
- package/lib/module/slider/SliderRoot.js +182 -0
- package/lib/module/slider/SliderRoot.js.map +1 -0
- package/lib/module/slider/SliderThumb.js +224 -0
- package/lib/module/slider/SliderThumb.js.map +1 -0
- package/lib/module/slider/context.js +5 -0
- package/lib/module/slider/context.js.map +1 -0
- package/lib/module/slider/index.js +8 -0
- package/lib/module/slider/index.js.map +1 -0
- package/lib/module/slider/types.js +4 -0
- package/lib/module/slider/types.js.map +1 -0
- package/lib/module/slider/useSliderPointer.js +110 -0
- package/lib/module/slider/useSliderPointer.js.map +1 -0
- package/lib/module/slider/utils.js +138 -0
- package/lib/module/slider/utils.js.map +1 -0
- package/lib/module/utils/assignRef.js +12 -0
- package/lib/module/utils/assignRef.js.map +1 -0
- package/lib/module/utils/createPortal.js +3 -1
- package/lib/module/utils/createPortal.js.map +1 -1
- package/lib/typescript/index.d.ts +4 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/overlay/useAnchorPosition.d.ts +7 -1
- package/lib/typescript/overlay/useAnchorPosition.d.ts.map +1 -1
- package/lib/typescript/slider/SliderRail.d.ts +6 -0
- package/lib/typescript/slider/SliderRail.d.ts.map +1 -0
- package/lib/typescript/slider/SliderRoot.d.ts +7 -0
- package/lib/typescript/slider/SliderRoot.d.ts.map +1 -0
- package/lib/typescript/slider/SliderThumb.d.ts +6 -0
- package/lib/typescript/slider/SliderThumb.d.ts.map +1 -0
- package/lib/typescript/slider/context.d.ts +37 -0
- package/lib/typescript/slider/context.d.ts.map +1 -0
- package/lib/typescript/slider/index.d.ts +8 -0
- package/lib/typescript/slider/index.d.ts.map +1 -0
- package/lib/typescript/slider/types.d.ts +37 -0
- package/lib/typescript/slider/types.d.ts.map +1 -0
- package/lib/typescript/slider/useSliderPointer.d.ts +23 -0
- package/lib/typescript/slider/useSliderPointer.d.ts.map +1 -0
- package/lib/typescript/slider/utils.d.ts +23 -0
- package/lib/typescript/slider/utils.d.ts.map +1 -0
- package/lib/typescript/utils/assignRef.d.ts +3 -0
- package/lib/typescript/utils/assignRef.d.ts.map +1 -0
- package/lib/typescript/utils/createPortal.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +4 -0
- package/src/overlay/useAnchorPosition.ts +79 -11
- package/src/slider/SliderRail.tsx +143 -0
- package/src/slider/SliderRoot.tsx +266 -0
- package/src/slider/SliderThumb.tsx +268 -0
- package/src/slider/context.tsx +38 -0
- package/src/slider/index.ts +19 -0
- package/src/slider/types.ts +44 -0
- package/src/slider/useSliderPointer.ts +157 -0
- package/src/slider/utils.ts +181 -0
- package/src/utils/assignRef.ts +11 -0
- package/src/utils/createPortal.ts +3 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { View } from 'react-native';
|
|
2
|
+
import type { InterfaceSliderProps } from './types';
|
|
3
|
+
export interface SliderRootProps extends InterfaceSliderProps {
|
|
4
|
+
readonly asChild?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const SliderRoot: import("react").ForwardRefExoticComponent<SliderRootProps & import("react").RefAttributes<View>>;
|
|
7
|
+
//# sourceMappingURL=SliderRoot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SliderRoot.d.ts","sourceRoot":"","sources":["../../../src/slider/SliderRoot.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,IAAI,EAIL,MAAM,cAAc,CAAC;AAMtB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAKpD,MAAM,WAAW,eAAgB,SAAQ,oBAAoB;IAC3D,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,UAAU,kGAiPtB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { View } from 'react-native';
|
|
2
|
+
import type { InterfaceSliderThumbProps } from './types';
|
|
3
|
+
export interface SliderThumbProps extends InterfaceSliderThumbProps {
|
|
4
|
+
}
|
|
5
|
+
export declare const SliderThumb: import("react").ForwardRefExoticComponent<SliderThumbProps & import("react").RefAttributes<View>>;
|
|
6
|
+
//# sourceMappingURL=SliderThumb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SliderThumb.d.ts","sourceRoot":"","sources":["../../../src/slider/SliderThumb.tsx"],"names":[],"mappings":"AACA,OAAO,EAIL,IAAI,EAKL,MAAM,cAAc,CAAC;AAQtB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAIzD,MAAM,WAAW,gBAAiB,SAAQ,yBAAyB;CAAG;AAEtE,eAAO,MAAM,WAAW,mGAiPvB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { RefObject } from 'react';
|
|
2
|
+
import type { View } from 'react-native';
|
|
3
|
+
import type { SliderOrientation } from './types';
|
|
4
|
+
export interface SliderTrackLayout {
|
|
5
|
+
readonly width: number;
|
|
6
|
+
readonly height: number;
|
|
7
|
+
readonly x: number;
|
|
8
|
+
readonly y: number;
|
|
9
|
+
}
|
|
10
|
+
export interface SliderContextValue {
|
|
11
|
+
readonly value: number;
|
|
12
|
+
readonly min: number;
|
|
13
|
+
readonly max: number;
|
|
14
|
+
readonly step: number;
|
|
15
|
+
readonly percent: number;
|
|
16
|
+
readonly orientation: SliderOrientation;
|
|
17
|
+
readonly isDisabled: boolean;
|
|
18
|
+
readonly isDragging: boolean;
|
|
19
|
+
readonly isHovered: boolean;
|
|
20
|
+
readonly isFocused: boolean;
|
|
21
|
+
readonly trackLayout: SliderTrackLayout | null;
|
|
22
|
+
readonly thumbSize: number;
|
|
23
|
+
readonly setValue: (value: number, complete?: boolean) => void;
|
|
24
|
+
readonly setValueFromRatio: (ratio: number, complete?: boolean) => void;
|
|
25
|
+
readonly setTrackLayout: (layout: SliderTrackLayout) => void;
|
|
26
|
+
readonly setThumbSize: (size: number) => void;
|
|
27
|
+
readonly setIsDragging: (dragging: boolean) => void;
|
|
28
|
+
readonly setIsHovered: (hovered: boolean) => void;
|
|
29
|
+
readonly setIsFocused: (focused: boolean) => void;
|
|
30
|
+
readonly getValueLabel: () => string;
|
|
31
|
+
readonly thumbRef: RefObject<View | null>;
|
|
32
|
+
}
|
|
33
|
+
export declare const SliderProvider: import("react").FunctionComponent<{
|
|
34
|
+
children: import("react").ReactNode;
|
|
35
|
+
value: SliderContextValue;
|
|
36
|
+
}>, useSliderContext: () => SliderContextValue;
|
|
37
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/slider/context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAC;IACxC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC/C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/D,QAAQ,CAAC,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACxE,QAAQ,CAAC,cAAc,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC7D,QAAQ,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,QAAQ,CAAC,aAAa,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IACpD,QAAQ,CAAC,YAAY,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAClD,QAAQ,CAAC,YAAY,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAClD,QAAQ,CAAC,aAAa,EAAE,MAAM,MAAM,CAAC;IACrC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;CAC3C;AAED,eAAO,MAAO,cAAc;;;IAAE,gBAAgB,0BACM,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type { ISliderProps, ISliderRailProps, ISliderThumbProps, SliderAccessibilityValue, SliderOrientation, } from './types';
|
|
2
|
+
export type { SliderContextValue, SliderTrackLayout } from './context';
|
|
3
|
+
export { useSliderContext } from './context';
|
|
4
|
+
export { SliderRoot, type SliderRootProps } from './SliderRoot';
|
|
5
|
+
export { SliderRail, type SliderRailProps } from './SliderRail';
|
|
6
|
+
export { SliderThumb, type SliderThumbProps } from './SliderThumb';
|
|
7
|
+
export { getMarkerPositionStyle, getMarkerStepValues, percentToFillExtent, SLIDER_MARKER_SIZE, valueToPercent, } from './utils';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/slider/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,GACf,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { PressableProps, ViewProps } from 'react-native';
|
|
3
|
+
export type SliderOrientation = 'horizontal' | 'vertical';
|
|
4
|
+
export type SliderAccessibilityValue = NonNullable<ViewProps['accessibilityValue']>;
|
|
5
|
+
export interface InterfaceSliderProps extends Omit<ViewProps, 'children' | 'accessibilityValue'> {
|
|
6
|
+
readonly value?: number;
|
|
7
|
+
readonly defaultValue?: number;
|
|
8
|
+
readonly onChange?: (value: number) => void;
|
|
9
|
+
readonly onChangeComplete?: (value: number) => void;
|
|
10
|
+
readonly min?: number;
|
|
11
|
+
readonly max?: number;
|
|
12
|
+
readonly step?: number;
|
|
13
|
+
readonly isDisabled?: boolean;
|
|
14
|
+
readonly orientation?: SliderOrientation;
|
|
15
|
+
/**
|
|
16
|
+
* Screen reader label when there is no visible label.
|
|
17
|
+
*/
|
|
18
|
+
readonly accessibilityLabel?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Screen reader value for the slider. Merged with derived `min`, `max`, `now`, and formatted
|
|
21
|
+
* `text` when fields are omitted. `text` overrides the numeric announcement when set.
|
|
22
|
+
*/
|
|
23
|
+
readonly accessibilityValue?: SliderAccessibilityValue;
|
|
24
|
+
readonly children?: ReactNode;
|
|
25
|
+
}
|
|
26
|
+
export type ISliderProps = InterfaceSliderProps;
|
|
27
|
+
export interface InterfaceSliderRailProps extends ViewProps {
|
|
28
|
+
readonly asChild?: boolean;
|
|
29
|
+
readonly children?: ReactNode;
|
|
30
|
+
}
|
|
31
|
+
export type ISliderRailProps = InterfaceSliderRailProps;
|
|
32
|
+
export interface InterfaceSliderThumbProps extends PressableProps {
|
|
33
|
+
readonly asChild?: boolean;
|
|
34
|
+
readonly children?: ReactNode;
|
|
35
|
+
}
|
|
36
|
+
export type ISliderThumbProps = InterfaceSliderThumbProps;
|
|
37
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/slider/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9D,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,UAAU,CAAC;AAE1D,MAAM,MAAM,wBAAwB,GAAG,WAAW,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC,CAAC;AAEpF,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,GAAG,oBAAoB,CAAC;IAC9F,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,WAAW,CAAC,EAAE,iBAAiB,CAAC;IACzC;;OAEG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC;;;OAGG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,wBAAwB,CAAC;IACvD,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B;AAED,MAAM,MAAM,YAAY,GAAG,oBAAoB,CAAC;AAEhD,MAAM,WAAW,wBAAyB,SAAQ,SAAS;IACzD,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B;AAED,MAAM,MAAM,gBAAgB,GAAG,wBAAwB,CAAC;AAExD,MAAM,WAAW,yBAA0B,SAAQ,cAAc;IAC/D,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B;AAED,MAAM,MAAM,iBAAiB,GAAG,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { SliderTrackLayout } from './context';
|
|
2
|
+
import type { SliderOrientation } from './types';
|
|
3
|
+
export declare function getPointerCoords(nativeEvent: {
|
|
4
|
+
pageX?: number;
|
|
5
|
+
pageY?: number;
|
|
6
|
+
clientX?: number;
|
|
7
|
+
clientY?: number;
|
|
8
|
+
}): {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
};
|
|
12
|
+
export declare function getRatioFromPagePoint(pageX: number, pageY: number, trackLayout: SliderTrackLayout | null, orientation: SliderOrientation, thumbSize: number): number;
|
|
13
|
+
export declare function useWebSliderDrag({ isDisabled, setIsDragging, setValueFromRatio, trackLayout, orientation, thumbSize, }: {
|
|
14
|
+
isDisabled: boolean;
|
|
15
|
+
setIsDragging: (dragging: boolean) => void;
|
|
16
|
+
setValueFromRatio: (ratio: number, complete?: boolean) => void;
|
|
17
|
+
trackLayout: SliderTrackLayout | null;
|
|
18
|
+
orientation: SliderOrientation;
|
|
19
|
+
thumbSize: number;
|
|
20
|
+
}): {
|
|
21
|
+
startDrag: (pageX: number, pageY: number, anchorRatio?: number, trackLayoutOverride?: SliderTrackLayout) => void;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=useSliderPointer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSliderPointer.d.ts","sourceRoot":"","sources":["../../../src/slider/useSliderPointer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAGjD,wBAAgB,gBAAgB,CAAC,WAAW,EAAE;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAS3B;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,iBAAiB,GAAG,IAAI,EACrC,WAAW,EAAE,iBAAiB,EAC9B,SAAS,EAAE,MAAM,GAChB,MAAM,CAUR;AAQD,wBAAgB,gBAAgB,CAAC,EAC/B,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,SAAS,GACV,EAAE;IACD,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/D,WAAW,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACtC,WAAW,EAAE,iBAAiB,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;CACnB;uBAyBY,MAAM,SACN,MAAM,gBACC,MAAM,wBACE,iBAAiB;EAoE5C"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ViewStyle } from 'react-native';
|
|
2
|
+
import type { SliderTrackLayout } from './context';
|
|
3
|
+
import type { SliderOrientation } from './types';
|
|
4
|
+
export declare const SLIDER_MARKER_SIZE = 3;
|
|
5
|
+
export declare function clamp(value: number, min: number, max: number): number;
|
|
6
|
+
export declare function getThumbTravel(trackSize: number, _thumbSize: number): number;
|
|
7
|
+
/** Thumb leading-edge offset along the track axis (center-based). */
|
|
8
|
+
export declare function percentToThumbOffset(percent: number, trackSize: number, thumbSize: number): number;
|
|
9
|
+
/** Filled track extent to the thumb center. */
|
|
10
|
+
export declare function percentToFillExtent(percent: number, trackSize: number, _thumbSize: number): number;
|
|
11
|
+
/** Map a pointer coordinate on the track axis to a 0–1 ratio. */
|
|
12
|
+
export declare function pointerCoordToRatio(pointerCoord: number, trackStart: number, trackSize: number, _thumbSize: number): number;
|
|
13
|
+
/** Vertical slider: bottom = min (0), top = max (1). */
|
|
14
|
+
export declare function pointerCoordToVerticalRatio(pointerCoord: number, trackStart: number, trackSize: number, _thumbSize: number): number;
|
|
15
|
+
export declare function snapToStep(value: number, min: number, max: number, step: number): number;
|
|
16
|
+
export declare function valueToPercent(value: number, min: number, max: number): number;
|
|
17
|
+
export declare function percentToValue(percent: number, min: number, max: number, step: number): number;
|
|
18
|
+
export declare function formatSliderValue(value: number): string;
|
|
19
|
+
export declare function getMarkerStepValues(min: number, max: number, step: number): number[];
|
|
20
|
+
/** Marker leading-edge offset (center-aligned to the thumb coordinate system). */
|
|
21
|
+
export declare function percentToMarkerCenterOffset(percent: number, trackSize: number, markerSize?: number): number;
|
|
22
|
+
export declare function getMarkerPositionStyle(percent: number, orientation: SliderOrientation, trackLayout: SliderTrackLayout | null, _thumbSize: number, markerSize?: number): ViewStyle;
|
|
23
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/slider/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAQjD,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAErE;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAE5E;AAED,qEAAqE;AACrE,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,MAAM,CAGR;AAED,+CAA+C;AAC/C,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACjB,MAAM,CAGR;AAED,iEAAiE;AACjE,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACjB,MAAM,CAKR;AAED,wDAAwD;AACxD,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACjB,MAAM,CAKR;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMxF;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAK9E;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAG9F;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAcpF;AAaD,kFAAkF;AAClF,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,UAAU,SAAqB,GAC9B,MAAM,CAGR;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,iBAAiB,EAC9B,WAAW,EAAE,iBAAiB,GAAG,IAAI,EACrC,UAAU,EAAE,MAAM,EAClB,UAAU,SAAqB,GAC9B,SAAS,CA+CX"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assignRef.d.ts","sourceRoot":"","sources":["../../../src/utils/assignRef.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,QAQjE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPortal.d.ts","sourceRoot":"","sources":["../../../src/utils/createPortal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,KAAK,cAAc,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,KAAK,KAAK,CAAC,WAAW,CAAC;AAE3F;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,cAAc,GAAG,
|
|
1
|
+
{"version":3,"file":"createPortal.d.ts","sourceRoot":"","sources":["../../../src/utils/createPortal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,KAAK,cAAc,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,KAAK,KAAK,CAAC,WAAW,CAAC;AAE3F;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,cAAc,GAAG,SAU1C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdx-ui/primitives",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.117",
|
|
4
4
|
"main": "lib/commonjs/index.js",
|
|
5
5
|
"module": "lib/module/index.js",
|
|
6
6
|
"react-native": "src/index.ts",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@react-stately/checkbox": "3.7.4",
|
|
61
61
|
"@react-stately/radio": "3.12.0",
|
|
62
62
|
"@react-stately/toggle": "3.9.4",
|
|
63
|
-
"@cdx-ui/utils": "0.0.1-beta.
|
|
63
|
+
"@cdx-ui/utils": "0.0.1-beta.117"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@types/react": "19.1.17",
|
package/src/index.ts
CHANGED
|
@@ -11,6 +11,7 @@ export * from './otp-input';
|
|
|
11
11
|
export * from './link';
|
|
12
12
|
export * from './list-item';
|
|
13
13
|
export { type EdgeInsets, OverlayInsetsProvider } from './overlay';
|
|
14
|
+
export { useAnchorPosition, type AnchorLayout } from './overlay';
|
|
14
15
|
export * from './select';
|
|
15
16
|
export * from './switch';
|
|
16
17
|
export * from './tile';
|
|
@@ -18,6 +19,7 @@ export * from './toast';
|
|
|
18
19
|
export * from './portal';
|
|
19
20
|
export * from './progress-bar';
|
|
20
21
|
export * from './radio';
|
|
22
|
+
export * from './slider';
|
|
21
23
|
export type { InteractionState } from './types';
|
|
22
24
|
export { FormControlContext, useFormControlContext } from '@cdx-ui/utils';
|
|
23
25
|
export { dataAttributes, mergeDataAttributes } from './utils/dataAttributes';
|
|
@@ -26,4 +28,6 @@ export {
|
|
|
26
28
|
mergeDomDataAttributes,
|
|
27
29
|
type DomDataAttributeValue,
|
|
28
30
|
} from './utils/domDataAttributes';
|
|
31
|
+
export { assignRef } from './utils/assignRef';
|
|
32
|
+
export { createPortalFn } from './utils/createPortal';
|
|
29
33
|
export { Slot } from './slot';
|
|
@@ -16,32 +16,79 @@ function measureWeb(element: any): AnchorLayout {
|
|
|
16
16
|
return { x: rect.left, y: rect.top, width: rect.width, height: rect.height };
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
function setLayoutIfChanged(
|
|
20
|
+
setLayout: React.Dispatch<React.SetStateAction<AnchorLayout | null>>,
|
|
21
|
+
next: AnchorLayout,
|
|
22
|
+
) {
|
|
23
|
+
setLayout((prev) => {
|
|
24
|
+
if (
|
|
25
|
+
prev?.x === next.x &&
|
|
26
|
+
prev.y === next.y &&
|
|
27
|
+
prev.width === next.width &&
|
|
28
|
+
prev.height === next.height
|
|
29
|
+
) {
|
|
30
|
+
return prev;
|
|
31
|
+
}
|
|
32
|
+
return next;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface UseAnchorPositionOptions {
|
|
37
|
+
/** Re-run layout measurement when this value changes (e.g. slider value percent). */
|
|
38
|
+
remeasureKey?: unknown;
|
|
39
|
+
/** Poll anchor position each animation frame while open (for anchors that move). */
|
|
40
|
+
trackWhileOpen?: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
19
43
|
/**
|
|
20
44
|
* Measures an anchor element's position and size, re-measuring on scroll/resize
|
|
21
45
|
* (web) so a positioned overlay can track its anchor across layout changes.
|
|
22
46
|
*
|
|
23
47
|
* Returns `null` until the first measurement completes.
|
|
24
48
|
*/
|
|
25
|
-
export function useAnchorPosition(
|
|
49
|
+
export function useAnchorPosition(
|
|
50
|
+
anchorRef: RefObject<any>,
|
|
51
|
+
open: boolean,
|
|
52
|
+
options?: UseAnchorPositionOptions,
|
|
53
|
+
): AnchorLayout | null {
|
|
54
|
+
const { remeasureKey, trackWhileOpen = false } = options ?? {};
|
|
26
55
|
const [layout, setLayout] = useState<AnchorLayout | null>(null);
|
|
27
56
|
|
|
57
|
+
const measureAnchor = () => {
|
|
58
|
+
const anchor = anchorRef.current;
|
|
59
|
+
if (!anchor) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (Platform.OS === 'web') {
|
|
64
|
+
setLayoutIfChanged(setLayout, measureWeb(anchor));
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
anchor.measureInWindow((x: number, y: number, width: number, height: number) => {
|
|
69
|
+
setLayoutIfChanged(setLayout, { x, y, width, height });
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
|
|
28
73
|
useIsomorphicLayoutEffect(() => {
|
|
29
74
|
if (!open) {
|
|
30
75
|
setLayout(null);
|
|
31
76
|
return;
|
|
32
77
|
}
|
|
33
78
|
|
|
34
|
-
const anchor = anchorRef.current;
|
|
35
|
-
if (!anchor) return;
|
|
36
|
-
|
|
37
79
|
let cancelled = false;
|
|
38
80
|
|
|
39
81
|
if (Platform.OS === 'web') {
|
|
40
|
-
|
|
82
|
+
measureAnchor();
|
|
41
83
|
} else {
|
|
84
|
+
const anchor = anchorRef.current;
|
|
85
|
+
if (!anchor) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
|
|
42
89
|
anchor.measureInWindow((x: number, y: number, width: number, height: number) => {
|
|
43
90
|
if (!cancelled) {
|
|
44
|
-
setLayout
|
|
91
|
+
setLayoutIfChanged(setLayout, { x, y, width, height });
|
|
45
92
|
}
|
|
46
93
|
});
|
|
47
94
|
}
|
|
@@ -49,15 +96,36 @@ export function useAnchorPosition(anchorRef: RefObject<any>, open: boolean): Anc
|
|
|
49
96
|
return () => {
|
|
50
97
|
cancelled = true;
|
|
51
98
|
};
|
|
52
|
-
}, [open, anchorRef]);
|
|
99
|
+
}, [open, anchorRef, remeasureKey]);
|
|
53
100
|
|
|
54
101
|
useEffect(() => {
|
|
55
|
-
if (!open ||
|
|
102
|
+
if (!open || !trackWhileOpen) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
let frameId = 0;
|
|
107
|
+
const tick = () => {
|
|
108
|
+
measureAnchor();
|
|
109
|
+
frameId = requestAnimationFrame(tick);
|
|
110
|
+
};
|
|
111
|
+
frameId = requestAnimationFrame(tick);
|
|
112
|
+
|
|
113
|
+
return () => {
|
|
114
|
+
cancelAnimationFrame(frameId);
|
|
115
|
+
};
|
|
116
|
+
}, [open, anchorRef, remeasureKey, trackWhileOpen]);
|
|
117
|
+
|
|
118
|
+
useEffect(() => {
|
|
119
|
+
if (!open || Platform.OS !== 'web' || trackWhileOpen) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
56
122
|
|
|
57
123
|
const anchor = anchorRef.current;
|
|
58
|
-
if (!anchor)
|
|
124
|
+
if (!anchor) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
59
127
|
|
|
60
|
-
const update = () => setLayout
|
|
128
|
+
const update = () => setLayoutIfChanged(setLayout, measureWeb(anchor));
|
|
61
129
|
|
|
62
130
|
window.addEventListener('scroll', update, true);
|
|
63
131
|
window.addEventListener('resize', update);
|
|
@@ -66,7 +134,7 @@ export function useAnchorPosition(anchorRef: RefObject<any>, open: boolean): Anc
|
|
|
66
134
|
window.removeEventListener('scroll', update, true);
|
|
67
135
|
window.removeEventListener('resize', update);
|
|
68
136
|
};
|
|
69
|
-
}, [open, anchorRef]);
|
|
137
|
+
}, [open, anchorRef, remeasureKey, trackWhileOpen]);
|
|
70
138
|
|
|
71
139
|
return layout;
|
|
72
140
|
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { forwardRef, useCallback, useRef } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Platform,
|
|
4
|
+
Pressable,
|
|
5
|
+
StyleSheet,
|
|
6
|
+
View,
|
|
7
|
+
type GestureResponderEvent,
|
|
8
|
+
type LayoutChangeEvent,
|
|
9
|
+
type PressableProps,
|
|
10
|
+
} from 'react-native';
|
|
11
|
+
import { Slot } from '../slot';
|
|
12
|
+
import { assignRef } from '../utils/assignRef';
|
|
13
|
+
import { dataAttributes } from '../utils/dataAttributes';
|
|
14
|
+
import { useSliderContext } from './context';
|
|
15
|
+
import type { InterfaceSliderRailProps } from './types';
|
|
16
|
+
import { getPointerCoords, getRatioFromPagePoint, useWebSliderDrag } from './useSliderPointer';
|
|
17
|
+
|
|
18
|
+
export interface SliderRailProps extends InterfaceSliderRailProps {}
|
|
19
|
+
|
|
20
|
+
export const SliderRail = forwardRef<View, SliderRailProps>(
|
|
21
|
+
({ asChild, style, onLayout, children, ...props }, ref) => {
|
|
22
|
+
const {
|
|
23
|
+
orientation,
|
|
24
|
+
isDisabled,
|
|
25
|
+
isDragging,
|
|
26
|
+
trackLayout,
|
|
27
|
+
thumbSize,
|
|
28
|
+
setValueFromRatio,
|
|
29
|
+
setTrackLayout,
|
|
30
|
+
setIsDragging,
|
|
31
|
+
} = useSliderContext();
|
|
32
|
+
|
|
33
|
+
const railRef = useRef<View>(null);
|
|
34
|
+
|
|
35
|
+
const measureRail = useCallback(() => {
|
|
36
|
+
const node = railRef.current;
|
|
37
|
+
if (!node?.measureInWindow) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
node.measureInWindow((x, y, width, height) => {
|
|
41
|
+
setTrackLayout({ x, y, width, height });
|
|
42
|
+
});
|
|
43
|
+
}, [setTrackLayout]);
|
|
44
|
+
|
|
45
|
+
const handleLayout = useCallback(
|
|
46
|
+
(event: LayoutChangeEvent) => {
|
|
47
|
+
measureRail();
|
|
48
|
+
onLayout?.(event);
|
|
49
|
+
},
|
|
50
|
+
[measureRail, onLayout],
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
const { startDrag } = useWebSliderDrag({
|
|
54
|
+
isDisabled,
|
|
55
|
+
setIsDragging,
|
|
56
|
+
setValueFromRatio,
|
|
57
|
+
trackLayout,
|
|
58
|
+
orientation,
|
|
59
|
+
thumbSize,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const updateFromEvent = useCallback(
|
|
63
|
+
(event: GestureResponderEvent) => {
|
|
64
|
+
if (isDisabled) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const { x, y } = getPointerCoords(event.nativeEvent);
|
|
68
|
+
setValueFromRatio(getRatioFromPagePoint(x, y, trackLayout, orientation, thumbSize), true);
|
|
69
|
+
},
|
|
70
|
+
[isDisabled, orientation, setValueFromRatio, thumbSize, trackLayout],
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
const handlePress = useCallback(
|
|
74
|
+
(event: GestureResponderEvent) => {
|
|
75
|
+
updateFromEvent(event);
|
|
76
|
+
},
|
|
77
|
+
[updateFromEvent],
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
const handlePointerDown = useCallback(
|
|
81
|
+
(event: GestureResponderEvent) => {
|
|
82
|
+
if (Platform.OS !== 'web' || isDisabled) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
event.preventDefault();
|
|
86
|
+
|
|
87
|
+
const node = railRef.current as unknown as HTMLElement | null;
|
|
88
|
+
if (!node) return;
|
|
89
|
+
const rect = node.getBoundingClientRect();
|
|
90
|
+
const freshLayout = { x: rect.left, y: rect.top, width: rect.width, height: rect.height };
|
|
91
|
+
setTrackLayout(freshLayout);
|
|
92
|
+
|
|
93
|
+
const { x, y } = getPointerCoords(event.nativeEvent);
|
|
94
|
+
startDrag(x, y, undefined, freshLayout);
|
|
95
|
+
},
|
|
96
|
+
[isDisabled, setTrackLayout, startDrag],
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
const Comp = asChild ? Slot : View;
|
|
100
|
+
|
|
101
|
+
return (
|
|
102
|
+
<Pressable
|
|
103
|
+
accessibilityRole="none"
|
|
104
|
+
accessible={false}
|
|
105
|
+
disabled={isDisabled}
|
|
106
|
+
onPress={Platform.OS === 'web' ? undefined : handlePress}
|
|
107
|
+
onPointerDown={
|
|
108
|
+
Platform.OS === 'web'
|
|
109
|
+
? (handlePointerDown as unknown as PressableProps['onPointerDown'])
|
|
110
|
+
: undefined
|
|
111
|
+
}
|
|
112
|
+
accessibilityElementsHidden
|
|
113
|
+
importantForAccessibility="no-hide-descendants"
|
|
114
|
+
aria-hidden
|
|
115
|
+
tabIndex={-1}
|
|
116
|
+
style={styles.railHitArea}
|
|
117
|
+
>
|
|
118
|
+
<Comp
|
|
119
|
+
ref={(node: View | null) => {
|
|
120
|
+
railRef.current = node;
|
|
121
|
+
assignRef(ref, node);
|
|
122
|
+
}}
|
|
123
|
+
{...props}
|
|
124
|
+
onLayout={handleLayout}
|
|
125
|
+
style={style}
|
|
126
|
+
{...dataAttributes({ slot: 'slider-rail', dragging: isDragging })}
|
|
127
|
+
>
|
|
128
|
+
{children}
|
|
129
|
+
</Comp>
|
|
130
|
+
</Pressable>
|
|
131
|
+
);
|
|
132
|
+
},
|
|
133
|
+
);
|
|
134
|
+
|
|
135
|
+
SliderRail.displayName = 'SliderRail';
|
|
136
|
+
|
|
137
|
+
const styles = StyleSheet.create({
|
|
138
|
+
railHitArea: {
|
|
139
|
+
...StyleSheet.absoluteFillObject,
|
|
140
|
+
justifyContent: 'center',
|
|
141
|
+
alignItems: 'center',
|
|
142
|
+
},
|
|
143
|
+
});
|