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