Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/content/Details.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ You are responsible for rendering your own `<summary>`. To style your summary el
```

## With children as a function
The render function gets an object with the `open` prop to allow you to conditionally update UI based on the open state of the dropdown:
The render function gets an object with the `open` render prop to allow you to conditionally update UI based on the open state of the dropdown:

```jsx live
<Details>
Expand All @@ -42,5 +42,5 @@ Details components get `COMMON` system props. Read our [System Props](/system-pr

| Name | Type | Default | Description |
| :- | :- | :-: | :- |
| open | Boolean | | Sets the open/closed state of the Details component |
| defaultOpen | Boolean | | Sets the initial open/closed state |
| overlay | Boolean | false | Sets whether or not element will close when user clicks outside of it
3 changes: 2 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,12 @@ declare module '@primer/components' {

export const Heading: React.FunctionComponent<HeadingProps>

type DetailsRenderFunction = (args: {open: boolean; toggle: () => void}) => React.ReactElement
type DetailsRenderFunction = (args: {open: boolean}) => React.ReactElement

export interface DetailsProps extends CommonProps, Omit<React.DetailsHTMLAttributes<HTMLDetailsElement>, 'color'> {
render?: DetailsRenderFunction
children?: DetailsRenderFunction | React.ReactNode
defaultOpen?: boolean
overlay?: boolean
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@primer/components",
"version": "14.2.0",
"version": "14.2.1",
"description": "Primer react components",
"main": "dist/index.umd.js",
"module": "dist/index.esm.js",
Expand Down
1 change: 1 addition & 0 deletions src/Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ Dropdown.Item.propTypes = {
Dropdown.defaultProps = {theme}
Dropdown.propTypes = {
children: PropTypes.node,
title: PropTypes.string,
...COMMON.propTypes
}

Expand Down