@radix-ui/react-accordion 1.2.1 → 1.2.2-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 +19 -30
- package/dist/index.d.ts +19 -30
- package/package.json +8 -7
package/dist/index.d.mts
CHANGED
|
@@ -1,28 +1,17 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as _radix_ui_react_context from '@radix-ui/react-context';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import { Primitive } from '@radix-ui/react-primitive';
|
|
4
4
|
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
5
5
|
|
|
6
|
-
type Scope<C = any> = {
|
|
7
|
-
[scopeName: string]: React.Context<C>[];
|
|
8
|
-
} | undefined;
|
|
9
|
-
type ScopeHook = (scope: Scope) => {
|
|
10
|
-
[__scopeProp: string]: Scope;
|
|
11
|
-
};
|
|
12
|
-
interface CreateScope {
|
|
13
|
-
scopeName: string;
|
|
14
|
-
(): ScopeHook;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
6
|
type Direction = 'ltr' | 'rtl';
|
|
18
|
-
declare const createAccordionScope: CreateScope;
|
|
7
|
+
declare const createAccordionScope: _radix_ui_react_context.CreateScope;
|
|
19
8
|
interface AccordionSingleProps extends AccordionImplSingleProps {
|
|
20
9
|
type: 'single';
|
|
21
10
|
}
|
|
22
11
|
interface AccordionMultipleProps extends AccordionImplMultipleProps {
|
|
23
12
|
type: 'multiple';
|
|
24
13
|
}
|
|
25
|
-
declare const Accordion:
|
|
14
|
+
declare const Accordion: React.ForwardRefExoticComponent<(AccordionSingleProps | AccordionMultipleProps) & React.RefAttributes<HTMLDivElement>>;
|
|
26
15
|
interface AccordionImplSingleProps extends AccordionImplProps {
|
|
27
16
|
/**
|
|
28
17
|
* The controlled stateful value of the accordion item whose content is expanded.
|
|
@@ -58,7 +47,7 @@ interface AccordionImplMultipleProps extends AccordionImplProps {
|
|
|
58
47
|
*/
|
|
59
48
|
onValueChange?(value: string[]): void;
|
|
60
49
|
}
|
|
61
|
-
type PrimitiveDivProps =
|
|
50
|
+
type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
62
51
|
interface AccordionImplProps extends PrimitiveDivProps {
|
|
63
52
|
/**
|
|
64
53
|
* Whether or not an accordion is disabled from user interaction.
|
|
@@ -70,13 +59,13 @@ interface AccordionImplProps extends PrimitiveDivProps {
|
|
|
70
59
|
* The layout in which the Accordion operates.
|
|
71
60
|
* @default vertical
|
|
72
61
|
*/
|
|
73
|
-
orientation?:
|
|
62
|
+
orientation?: React.AriaAttributes['aria-orientation'];
|
|
74
63
|
/**
|
|
75
64
|
* The language read direction.
|
|
76
65
|
*/
|
|
77
66
|
dir?: Direction;
|
|
78
67
|
}
|
|
79
|
-
type CollapsibleProps =
|
|
68
|
+
type CollapsibleProps = React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Root>;
|
|
80
69
|
interface AccordionItemProps extends Omit<CollapsibleProps, 'open' | 'defaultOpen' | 'onOpenChange'> {
|
|
81
70
|
/**
|
|
82
71
|
* Whether or not an accordion item is disabled from user interaction.
|
|
@@ -92,34 +81,34 @@ interface AccordionItemProps extends Omit<CollapsibleProps, 'open' | 'defaultOpe
|
|
|
92
81
|
/**
|
|
93
82
|
* `AccordionItem` contains all of the parts of a collapsible section inside of an `Accordion`.
|
|
94
83
|
*/
|
|
95
|
-
declare const AccordionItem:
|
|
96
|
-
type PrimitiveHeading3Props =
|
|
84
|
+
declare const AccordionItem: React.ForwardRefExoticComponent<AccordionItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
85
|
+
type PrimitiveHeading3Props = React.ComponentPropsWithoutRef<typeof Primitive.h3>;
|
|
97
86
|
interface AccordionHeaderProps extends PrimitiveHeading3Props {
|
|
98
87
|
}
|
|
99
88
|
/**
|
|
100
89
|
* `AccordionHeader` contains the content for the parts of an `AccordionItem` that will be visible
|
|
101
90
|
* whether or not its content is collapsed.
|
|
102
91
|
*/
|
|
103
|
-
declare const AccordionHeader:
|
|
104
|
-
type CollapsibleTriggerProps =
|
|
92
|
+
declare const AccordionHeader: React.ForwardRefExoticComponent<AccordionHeaderProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
93
|
+
type CollapsibleTriggerProps = React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Trigger>;
|
|
105
94
|
interface AccordionTriggerProps extends CollapsibleTriggerProps {
|
|
106
95
|
}
|
|
107
96
|
/**
|
|
108
97
|
* `AccordionTrigger` is the trigger that toggles the collapsed state of an `AccordionItem`. It
|
|
109
98
|
* should always be nested inside of an `AccordionHeader`.
|
|
110
99
|
*/
|
|
111
|
-
declare const AccordionTrigger:
|
|
112
|
-
type CollapsibleContentProps =
|
|
100
|
+
declare const AccordionTrigger: React.ForwardRefExoticComponent<AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
101
|
+
type CollapsibleContentProps = React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Content>;
|
|
113
102
|
interface AccordionContentProps extends CollapsibleContentProps {
|
|
114
103
|
}
|
|
115
104
|
/**
|
|
116
105
|
* `AccordionContent` contains the collapsible content for an `AccordionItem`.
|
|
117
106
|
*/
|
|
118
|
-
declare const AccordionContent:
|
|
119
|
-
declare const Root:
|
|
120
|
-
declare const Item:
|
|
121
|
-
declare const Header:
|
|
122
|
-
declare const Trigger:
|
|
123
|
-
declare const Content:
|
|
107
|
+
declare const AccordionContent: React.ForwardRefExoticComponent<AccordionContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
108
|
+
declare const Root: React.ForwardRefExoticComponent<(AccordionSingleProps | AccordionMultipleProps) & React.RefAttributes<HTMLDivElement>>;
|
|
109
|
+
declare const Item: React.ForwardRefExoticComponent<AccordionItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
110
|
+
declare const Header: React.ForwardRefExoticComponent<AccordionHeaderProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
111
|
+
declare const Trigger: React.ForwardRefExoticComponent<AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
112
|
+
declare const Content: React.ForwardRefExoticComponent<AccordionContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
124
113
|
|
|
125
114
|
export { Accordion, AccordionContent, type AccordionContentProps, AccordionHeader, type AccordionHeaderProps, AccordionItem, type AccordionItemProps, type AccordionMultipleProps, type AccordionSingleProps, AccordionTrigger, type AccordionTriggerProps, Content, Header, Item, Root, Trigger, createAccordionScope };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,28 +1,17 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as _radix_ui_react_context from '@radix-ui/react-context';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import { Primitive } from '@radix-ui/react-primitive';
|
|
4
4
|
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
5
5
|
|
|
6
|
-
type Scope<C = any> = {
|
|
7
|
-
[scopeName: string]: React.Context<C>[];
|
|
8
|
-
} | undefined;
|
|
9
|
-
type ScopeHook = (scope: Scope) => {
|
|
10
|
-
[__scopeProp: string]: Scope;
|
|
11
|
-
};
|
|
12
|
-
interface CreateScope {
|
|
13
|
-
scopeName: string;
|
|
14
|
-
(): ScopeHook;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
6
|
type Direction = 'ltr' | 'rtl';
|
|
18
|
-
declare const createAccordionScope: CreateScope;
|
|
7
|
+
declare const createAccordionScope: _radix_ui_react_context.CreateScope;
|
|
19
8
|
interface AccordionSingleProps extends AccordionImplSingleProps {
|
|
20
9
|
type: 'single';
|
|
21
10
|
}
|
|
22
11
|
interface AccordionMultipleProps extends AccordionImplMultipleProps {
|
|
23
12
|
type: 'multiple';
|
|
24
13
|
}
|
|
25
|
-
declare const Accordion:
|
|
14
|
+
declare const Accordion: React.ForwardRefExoticComponent<(AccordionSingleProps | AccordionMultipleProps) & React.RefAttributes<HTMLDivElement>>;
|
|
26
15
|
interface AccordionImplSingleProps extends AccordionImplProps {
|
|
27
16
|
/**
|
|
28
17
|
* The controlled stateful value of the accordion item whose content is expanded.
|
|
@@ -58,7 +47,7 @@ interface AccordionImplMultipleProps extends AccordionImplProps {
|
|
|
58
47
|
*/
|
|
59
48
|
onValueChange?(value: string[]): void;
|
|
60
49
|
}
|
|
61
|
-
type PrimitiveDivProps =
|
|
50
|
+
type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
62
51
|
interface AccordionImplProps extends PrimitiveDivProps {
|
|
63
52
|
/**
|
|
64
53
|
* Whether or not an accordion is disabled from user interaction.
|
|
@@ -70,13 +59,13 @@ interface AccordionImplProps extends PrimitiveDivProps {
|
|
|
70
59
|
* The layout in which the Accordion operates.
|
|
71
60
|
* @default vertical
|
|
72
61
|
*/
|
|
73
|
-
orientation?:
|
|
62
|
+
orientation?: React.AriaAttributes['aria-orientation'];
|
|
74
63
|
/**
|
|
75
64
|
* The language read direction.
|
|
76
65
|
*/
|
|
77
66
|
dir?: Direction;
|
|
78
67
|
}
|
|
79
|
-
type CollapsibleProps =
|
|
68
|
+
type CollapsibleProps = React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Root>;
|
|
80
69
|
interface AccordionItemProps extends Omit<CollapsibleProps, 'open' | 'defaultOpen' | 'onOpenChange'> {
|
|
81
70
|
/**
|
|
82
71
|
* Whether or not an accordion item is disabled from user interaction.
|
|
@@ -92,34 +81,34 @@ interface AccordionItemProps extends Omit<CollapsibleProps, 'open' | 'defaultOpe
|
|
|
92
81
|
/**
|
|
93
82
|
* `AccordionItem` contains all of the parts of a collapsible section inside of an `Accordion`.
|
|
94
83
|
*/
|
|
95
|
-
declare const AccordionItem:
|
|
96
|
-
type PrimitiveHeading3Props =
|
|
84
|
+
declare const AccordionItem: React.ForwardRefExoticComponent<AccordionItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
85
|
+
type PrimitiveHeading3Props = React.ComponentPropsWithoutRef<typeof Primitive.h3>;
|
|
97
86
|
interface AccordionHeaderProps extends PrimitiveHeading3Props {
|
|
98
87
|
}
|
|
99
88
|
/**
|
|
100
89
|
* `AccordionHeader` contains the content for the parts of an `AccordionItem` that will be visible
|
|
101
90
|
* whether or not its content is collapsed.
|
|
102
91
|
*/
|
|
103
|
-
declare const AccordionHeader:
|
|
104
|
-
type CollapsibleTriggerProps =
|
|
92
|
+
declare const AccordionHeader: React.ForwardRefExoticComponent<AccordionHeaderProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
93
|
+
type CollapsibleTriggerProps = React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Trigger>;
|
|
105
94
|
interface AccordionTriggerProps extends CollapsibleTriggerProps {
|
|
106
95
|
}
|
|
107
96
|
/**
|
|
108
97
|
* `AccordionTrigger` is the trigger that toggles the collapsed state of an `AccordionItem`. It
|
|
109
98
|
* should always be nested inside of an `AccordionHeader`.
|
|
110
99
|
*/
|
|
111
|
-
declare const AccordionTrigger:
|
|
112
|
-
type CollapsibleContentProps =
|
|
100
|
+
declare const AccordionTrigger: React.ForwardRefExoticComponent<AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
101
|
+
type CollapsibleContentProps = React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Content>;
|
|
113
102
|
interface AccordionContentProps extends CollapsibleContentProps {
|
|
114
103
|
}
|
|
115
104
|
/**
|
|
116
105
|
* `AccordionContent` contains the collapsible content for an `AccordionItem`.
|
|
117
106
|
*/
|
|
118
|
-
declare const AccordionContent:
|
|
119
|
-
declare const Root:
|
|
120
|
-
declare const Item:
|
|
121
|
-
declare const Header:
|
|
122
|
-
declare const Trigger:
|
|
123
|
-
declare const Content:
|
|
107
|
+
declare const AccordionContent: React.ForwardRefExoticComponent<AccordionContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
108
|
+
declare const Root: React.ForwardRefExoticComponent<(AccordionSingleProps | AccordionMultipleProps) & React.RefAttributes<HTMLDivElement>>;
|
|
109
|
+
declare const Item: React.ForwardRefExoticComponent<AccordionItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
110
|
+
declare const Header: React.ForwardRefExoticComponent<AccordionHeaderProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
111
|
+
declare const Trigger: React.ForwardRefExoticComponent<AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
112
|
+
declare const Content: React.ForwardRefExoticComponent<AccordionContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
124
113
|
|
|
125
114
|
export { Accordion, AccordionContent, type AccordionContentProps, AccordionHeader, type AccordionHeaderProps, AccordionItem, type AccordionItemProps, type AccordionMultipleProps, type AccordionSingleProps, AccordionTrigger, type AccordionTriggerProps, Content, Header, Item, Root, Trigger, createAccordionScope };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@radix-ui/react-accordion",
|
|
3
|
-
"version": "1.2.1",
|
|
3
|
+
"version": "1.2.2-rc.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
"version": "yarn version"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@radix-ui/primitive": "1.1.
|
|
32
|
-
"@radix-ui/react-collapsible": "1.1.1",
|
|
33
|
-
"@radix-ui/react-collection": "1.1.
|
|
34
|
-
"@radix-ui/react-compose-refs": "1.1.
|
|
31
|
+
"@radix-ui/primitive": "1.1.1-rc.1",
|
|
32
|
+
"@radix-ui/react-collapsible": "1.1.2-rc.1",
|
|
33
|
+
"@radix-ui/react-collection": "1.1.1-rc.1",
|
|
34
|
+
"@radix-ui/react-compose-refs": "1.1.1-rc.1",
|
|
35
35
|
"@radix-ui/react-context": "1.1.1",
|
|
36
36
|
"@radix-ui/react-direction": "1.1.0",
|
|
37
37
|
"@radix-ui/react-id": "1.1.0",
|
|
38
|
-
"@radix-ui/react-primitive": "2.0.
|
|
38
|
+
"@radix-ui/react-primitive": "2.0.1-rc.1",
|
|
39
39
|
"@radix-ui/react-use-controllable-state": "1.1.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
@@ -59,5 +59,6 @@
|
|
|
59
59
|
},
|
|
60
60
|
"bugs": {
|
|
61
61
|
"url": "https://github.com/radix-ui/primitives/issues"
|
|
62
|
-
}
|
|
62
|
+
},
|
|
63
|
+
"stableVersion": "1.2.1"
|
|
63
64
|
}
|