@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 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
- declare type Scope<C = any> = {
4
+ type Scope<C = any> = {
6
5
  [scopeName: string]: React.Context<C>[];
7
6
  } | undefined;
8
- declare type ScopeHook = (scope: Scope) => {
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
- declare type Direction = 'ltr' | 'rtl';
17
- declare type Sizes = {
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
- declare type ScrollAreaContextValue = {
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
- declare type ScrollAreaElement = React.ElementRef<typeof Primitive.div>;
48
- declare type PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;
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
- declare type ScrollAreaViewportElement = React.ElementRef<typeof Primitive.div>;
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
- declare type ScrollAreaScrollbarElement = ScrollAreaScrollbarVisibleElement;
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
- declare type ScrollAreaScrollbarVisibleElement = ScrollAreaScrollbarAxisElement;
64
+ type ScrollAreaScrollbarVisibleElement = ScrollAreaScrollbarAxisElement;
66
65
  interface ScrollAreaScrollbarVisibleProps extends Omit<ScrollAreaScrollbarAxisProps, keyof ScrollAreaScrollbarAxisPrivateProps> {
67
66
  orientation?: 'horizontal' | 'vertical';
68
67
  }
69
- declare type ScrollAreaScrollbarAxisPrivateProps = {
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
- declare type ScrollAreaScrollbarAxisElement = ScrollAreaScrollbarImplElement;
79
+ type ScrollAreaScrollbarAxisElement = ScrollAreaScrollbarImplElement;
81
80
  interface ScrollAreaScrollbarAxisProps extends Omit<ScrollAreaScrollbarImplProps, keyof ScrollAreaScrollbarImplPrivateProps>, ScrollAreaScrollbarAxisPrivateProps {
82
81
  }
83
- declare type ScrollbarContext = {
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
- declare type ScrollAreaScrollbarImplElement = React.ElementRef<typeof Primitive.div>;
95
- declare type ScrollAreaScrollbarImplPrivateProps = {
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
- declare type ScrollAreaThumbElement = ScrollAreaThumbImplElement;
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
- declare type ScrollAreaThumbImplElement = React.ElementRef<typeof Primitive.div>;
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
- declare type Scope<C = any> = {
4
+ type Scope<C = any> = {
6
5
  [scopeName: string]: React.Context<C>[];
7
6
  } | undefined;
8
- declare type ScopeHook = (scope: Scope) => {
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
- declare type Direction = 'ltr' | 'rtl';
17
- declare type Sizes = {
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
- declare type ScrollAreaContextValue = {
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
- declare type ScrollAreaElement = React.ElementRef<typeof Primitive.div>;
48
- declare type PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;
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
- declare type ScrollAreaViewportElement = React.ElementRef<typeof Primitive.div>;
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
- declare type ScrollAreaScrollbarElement = ScrollAreaScrollbarVisibleElement;
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
- declare type ScrollAreaScrollbarVisibleElement = ScrollAreaScrollbarAxisElement;
64
+ type ScrollAreaScrollbarVisibleElement = ScrollAreaScrollbarAxisElement;
66
65
  interface ScrollAreaScrollbarVisibleProps extends Omit<ScrollAreaScrollbarAxisProps, keyof ScrollAreaScrollbarAxisPrivateProps> {
67
66
  orientation?: 'horizontal' | 'vertical';
68
67
  }
69
- declare type ScrollAreaScrollbarAxisPrivateProps = {
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
- declare type ScrollAreaScrollbarAxisElement = ScrollAreaScrollbarImplElement;
79
+ type ScrollAreaScrollbarAxisElement = ScrollAreaScrollbarImplElement;
81
80
  interface ScrollAreaScrollbarAxisProps extends Omit<ScrollAreaScrollbarImplProps, keyof ScrollAreaScrollbarImplPrivateProps>, ScrollAreaScrollbarAxisPrivateProps {
82
81
  }
83
- declare type ScrollbarContext = {
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
- declare type ScrollAreaScrollbarImplElement = React.ElementRef<typeof Primitive.div>;
95
- declare type ScrollAreaScrollbarImplPrivateProps = {
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
- declare type ScrollAreaThumbElement = ScrollAreaThumbImplElement;
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
- declare type ScrollAreaThumbImplElement = React.ElementRef<typeof Primitive.div>;
119
+ type ScrollAreaThumbImplElement = React.ElementRef<typeof Primitive.div>;
121
120
  interface ScrollAreaThumbImplProps extends PrimitiveDivProps {
122
121
  }
123
122
  interface ScrollAreaCornerProps extends ScrollAreaCornerImplProps {