@radix-ui/react-scroll-area 1.1.0-rc.2 → 1.1.0-rc.4
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/index.d.mts +17 -18
- package/dist/index.d.ts +17 -18
- package/dist/index.js +711 -697
- package/dist/index.js.map +3 -3
- package/dist/index.mjs.map +2 -2
- package/package.json +12 -12
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import * as Radix from '@radix-ui/react-primitive';
|
|
3
2
|
import { Primitive } from '@radix-ui/react-primitive';
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
type Scope<C = any> = {
|
|
6
5
|
[scopeName: string]: React.Context<C>[];
|
|
7
6
|
} | undefined;
|
|
8
|
-
|
|
7
|
+
type ScopeHook = (scope: Scope) => {
|
|
9
8
|
[__scopeProp: string]: Scope;
|
|
10
9
|
};
|
|
11
10
|
interface CreateScope {
|
|
@@ -13,8 +12,8 @@ interface CreateScope {
|
|
|
13
12
|
(): ScopeHook;
|
|
14
13
|
}
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
type Direction = 'ltr' | 'rtl';
|
|
16
|
+
type Sizes = {
|
|
18
17
|
content: number;
|
|
19
18
|
viewport: number;
|
|
20
19
|
scrollbar: {
|
|
@@ -24,7 +23,7 @@ declare type Sizes = {
|
|
|
24
23
|
};
|
|
25
24
|
};
|
|
26
25
|
declare const createScrollAreaScope: CreateScope;
|
|
27
|
-
|
|
26
|
+
type ScrollAreaContextValue = {
|
|
28
27
|
type: 'auto' | 'always' | 'scroll' | 'hover';
|
|
29
28
|
dir: Direction;
|
|
30
29
|
scrollHideDelay: number;
|
|
@@ -44,29 +43,29 @@ declare type ScrollAreaContextValue = {
|
|
|
44
43
|
onCornerWidthChange(width: number): void;
|
|
45
44
|
onCornerHeightChange(height: number): void;
|
|
46
45
|
};
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
type ScrollAreaElement = React.ElementRef<typeof Primitive.div>;
|
|
47
|
+
type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
49
48
|
interface ScrollAreaProps extends PrimitiveDivProps {
|
|
50
49
|
type?: ScrollAreaContextValue['type'];
|
|
51
50
|
dir?: ScrollAreaContextValue['dir'];
|
|
52
51
|
scrollHideDelay?: number;
|
|
53
52
|
}
|
|
54
53
|
declare const ScrollArea: React.ForwardRefExoticComponent<ScrollAreaProps & React.RefAttributes<HTMLDivElement>>;
|
|
55
|
-
|
|
54
|
+
type ScrollAreaViewportElement = React.ElementRef<typeof Primitive.div>;
|
|
56
55
|
interface ScrollAreaViewportProps extends PrimitiveDivProps {
|
|
57
56
|
nonce?: string;
|
|
58
57
|
}
|
|
59
58
|
declare const ScrollAreaViewport: React.ForwardRefExoticComponent<ScrollAreaViewportProps & React.RefAttributes<HTMLDivElement>>;
|
|
60
|
-
|
|
59
|
+
type ScrollAreaScrollbarElement = ScrollAreaScrollbarVisibleElement;
|
|
61
60
|
interface ScrollAreaScrollbarProps extends ScrollAreaScrollbarVisibleProps {
|
|
62
61
|
forceMount?: true;
|
|
63
62
|
}
|
|
64
63
|
declare const ScrollAreaScrollbar: React.ForwardRefExoticComponent<ScrollAreaScrollbarProps & React.RefAttributes<HTMLDivElement>>;
|
|
65
|
-
|
|
64
|
+
type ScrollAreaScrollbarVisibleElement = ScrollAreaScrollbarAxisElement;
|
|
66
65
|
interface ScrollAreaScrollbarVisibleProps extends Omit<ScrollAreaScrollbarAxisProps, keyof ScrollAreaScrollbarAxisPrivateProps> {
|
|
67
66
|
orientation?: 'horizontal' | 'vertical';
|
|
68
67
|
}
|
|
69
|
-
|
|
68
|
+
type ScrollAreaScrollbarAxisPrivateProps = {
|
|
70
69
|
hasThumb: boolean;
|
|
71
70
|
sizes: Sizes;
|
|
72
71
|
onSizesChange(sizes: Sizes): void;
|
|
@@ -77,10 +76,10 @@ declare type ScrollAreaScrollbarAxisPrivateProps = {
|
|
|
77
76
|
onWheelScroll(scrollPos: number): void;
|
|
78
77
|
onDragScroll(pointerPos: number): void;
|
|
79
78
|
};
|
|
80
|
-
|
|
79
|
+
type ScrollAreaScrollbarAxisElement = ScrollAreaScrollbarImplElement;
|
|
81
80
|
interface ScrollAreaScrollbarAxisProps extends Omit<ScrollAreaScrollbarImplProps, keyof ScrollAreaScrollbarImplPrivateProps>, ScrollAreaScrollbarAxisPrivateProps {
|
|
82
81
|
}
|
|
83
|
-
|
|
82
|
+
type ScrollbarContext = {
|
|
84
83
|
hasThumb: boolean;
|
|
85
84
|
scrollbar: ScrollAreaScrollbarElement | null;
|
|
86
85
|
onThumbChange(thumb: ScrollAreaThumbElement | null): void;
|
|
@@ -91,8 +90,8 @@ declare type ScrollbarContext = {
|
|
|
91
90
|
}): void;
|
|
92
91
|
onThumbPositionChange(): void;
|
|
93
92
|
};
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
type ScrollAreaScrollbarImplElement = React.ElementRef<typeof Primitive.div>;
|
|
94
|
+
type ScrollAreaScrollbarImplPrivateProps = {
|
|
96
95
|
sizes: Sizes;
|
|
97
96
|
hasThumb: boolean;
|
|
98
97
|
onThumbChange: ScrollbarContext['onThumbChange'];
|
|
@@ -108,7 +107,7 @@ declare type ScrollAreaScrollbarImplPrivateProps = {
|
|
|
108
107
|
};
|
|
109
108
|
interface ScrollAreaScrollbarImplProps extends Omit<PrimitiveDivProps, keyof ScrollAreaScrollbarImplPrivateProps>, ScrollAreaScrollbarImplPrivateProps {
|
|
110
109
|
}
|
|
111
|
-
|
|
110
|
+
type ScrollAreaThumbElement = ScrollAreaThumbImplElement;
|
|
112
111
|
interface ScrollAreaThumbProps extends ScrollAreaThumbImplProps {
|
|
113
112
|
/**
|
|
114
113
|
* Used to force mounting when more control is needed. Useful when
|
|
@@ -117,7 +116,7 @@ interface ScrollAreaThumbProps extends ScrollAreaThumbImplProps {
|
|
|
117
116
|
forceMount?: true;
|
|
118
117
|
}
|
|
119
118
|
declare const ScrollAreaThumb: React.ForwardRefExoticComponent<ScrollAreaThumbProps & React.RefAttributes<HTMLDivElement>>;
|
|
120
|
-
|
|
119
|
+
type ScrollAreaThumbImplElement = React.ElementRef<typeof Primitive.div>;
|
|
121
120
|
interface ScrollAreaThumbImplProps extends PrimitiveDivProps {
|
|
122
121
|
}
|
|
123
122
|
interface ScrollAreaCornerProps extends ScrollAreaCornerImplProps {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import * as Radix from '@radix-ui/react-primitive';
|
|
3
2
|
import { Primitive } from '@radix-ui/react-primitive';
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
type Scope<C = any> = {
|
|
6
5
|
[scopeName: string]: React.Context<C>[];
|
|
7
6
|
} | undefined;
|
|
8
|
-
|
|
7
|
+
type ScopeHook = (scope: Scope) => {
|
|
9
8
|
[__scopeProp: string]: Scope;
|
|
10
9
|
};
|
|
11
10
|
interface CreateScope {
|
|
@@ -13,8 +12,8 @@ interface CreateScope {
|
|
|
13
12
|
(): ScopeHook;
|
|
14
13
|
}
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
type Direction = 'ltr' | 'rtl';
|
|
16
|
+
type Sizes = {
|
|
18
17
|
content: number;
|
|
19
18
|
viewport: number;
|
|
20
19
|
scrollbar: {
|
|
@@ -24,7 +23,7 @@ declare type Sizes = {
|
|
|
24
23
|
};
|
|
25
24
|
};
|
|
26
25
|
declare const createScrollAreaScope: CreateScope;
|
|
27
|
-
|
|
26
|
+
type ScrollAreaContextValue = {
|
|
28
27
|
type: 'auto' | 'always' | 'scroll' | 'hover';
|
|
29
28
|
dir: Direction;
|
|
30
29
|
scrollHideDelay: number;
|
|
@@ -44,29 +43,29 @@ declare type ScrollAreaContextValue = {
|
|
|
44
43
|
onCornerWidthChange(width: number): void;
|
|
45
44
|
onCornerHeightChange(height: number): void;
|
|
46
45
|
};
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
type ScrollAreaElement = React.ElementRef<typeof Primitive.div>;
|
|
47
|
+
type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
49
48
|
interface ScrollAreaProps extends PrimitiveDivProps {
|
|
50
49
|
type?: ScrollAreaContextValue['type'];
|
|
51
50
|
dir?: ScrollAreaContextValue['dir'];
|
|
52
51
|
scrollHideDelay?: number;
|
|
53
52
|
}
|
|
54
53
|
declare const ScrollArea: React.ForwardRefExoticComponent<ScrollAreaProps & React.RefAttributes<HTMLDivElement>>;
|
|
55
|
-
|
|
54
|
+
type ScrollAreaViewportElement = React.ElementRef<typeof Primitive.div>;
|
|
56
55
|
interface ScrollAreaViewportProps extends PrimitiveDivProps {
|
|
57
56
|
nonce?: string;
|
|
58
57
|
}
|
|
59
58
|
declare const ScrollAreaViewport: React.ForwardRefExoticComponent<ScrollAreaViewportProps & React.RefAttributes<HTMLDivElement>>;
|
|
60
|
-
|
|
59
|
+
type ScrollAreaScrollbarElement = ScrollAreaScrollbarVisibleElement;
|
|
61
60
|
interface ScrollAreaScrollbarProps extends ScrollAreaScrollbarVisibleProps {
|
|
62
61
|
forceMount?: true;
|
|
63
62
|
}
|
|
64
63
|
declare const ScrollAreaScrollbar: React.ForwardRefExoticComponent<ScrollAreaScrollbarProps & React.RefAttributes<HTMLDivElement>>;
|
|
65
|
-
|
|
64
|
+
type ScrollAreaScrollbarVisibleElement = ScrollAreaScrollbarAxisElement;
|
|
66
65
|
interface ScrollAreaScrollbarVisibleProps extends Omit<ScrollAreaScrollbarAxisProps, keyof ScrollAreaScrollbarAxisPrivateProps> {
|
|
67
66
|
orientation?: 'horizontal' | 'vertical';
|
|
68
67
|
}
|
|
69
|
-
|
|
68
|
+
type ScrollAreaScrollbarAxisPrivateProps = {
|
|
70
69
|
hasThumb: boolean;
|
|
71
70
|
sizes: Sizes;
|
|
72
71
|
onSizesChange(sizes: Sizes): void;
|
|
@@ -77,10 +76,10 @@ declare type ScrollAreaScrollbarAxisPrivateProps = {
|
|
|
77
76
|
onWheelScroll(scrollPos: number): void;
|
|
78
77
|
onDragScroll(pointerPos: number): void;
|
|
79
78
|
};
|
|
80
|
-
|
|
79
|
+
type ScrollAreaScrollbarAxisElement = ScrollAreaScrollbarImplElement;
|
|
81
80
|
interface ScrollAreaScrollbarAxisProps extends Omit<ScrollAreaScrollbarImplProps, keyof ScrollAreaScrollbarImplPrivateProps>, ScrollAreaScrollbarAxisPrivateProps {
|
|
82
81
|
}
|
|
83
|
-
|
|
82
|
+
type ScrollbarContext = {
|
|
84
83
|
hasThumb: boolean;
|
|
85
84
|
scrollbar: ScrollAreaScrollbarElement | null;
|
|
86
85
|
onThumbChange(thumb: ScrollAreaThumbElement | null): void;
|
|
@@ -91,8 +90,8 @@ declare type ScrollbarContext = {
|
|
|
91
90
|
}): void;
|
|
92
91
|
onThumbPositionChange(): void;
|
|
93
92
|
};
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
type ScrollAreaScrollbarImplElement = React.ElementRef<typeof Primitive.div>;
|
|
94
|
+
type ScrollAreaScrollbarImplPrivateProps = {
|
|
96
95
|
sizes: Sizes;
|
|
97
96
|
hasThumb: boolean;
|
|
98
97
|
onThumbChange: ScrollbarContext['onThumbChange'];
|
|
@@ -108,7 +107,7 @@ declare type ScrollAreaScrollbarImplPrivateProps = {
|
|
|
108
107
|
};
|
|
109
108
|
interface ScrollAreaScrollbarImplProps extends Omit<PrimitiveDivProps, keyof ScrollAreaScrollbarImplPrivateProps>, ScrollAreaScrollbarImplPrivateProps {
|
|
110
109
|
}
|
|
111
|
-
|
|
110
|
+
type ScrollAreaThumbElement = ScrollAreaThumbImplElement;
|
|
112
111
|
interface ScrollAreaThumbProps extends ScrollAreaThumbImplProps {
|
|
113
112
|
/**
|
|
114
113
|
* Used to force mounting when more control is needed. Useful when
|
|
@@ -117,7 +116,7 @@ interface ScrollAreaThumbProps extends ScrollAreaThumbImplProps {
|
|
|
117
116
|
forceMount?: true;
|
|
118
117
|
}
|
|
119
118
|
declare const ScrollAreaThumb: React.ForwardRefExoticComponent<ScrollAreaThumbProps & React.RefAttributes<HTMLDivElement>>;
|
|
120
|
-
|
|
119
|
+
type ScrollAreaThumbImplElement = React.ElementRef<typeof Primitive.div>;
|
|
121
120
|
interface ScrollAreaThumbImplProps extends PrimitiveDivProps {
|
|
122
121
|
}
|
|
123
122
|
interface ScrollAreaCornerProps extends ScrollAreaCornerImplProps {
|