From 229ca5cca76e64e3ad363127d1528e4f3d8a4d6a Mon Sep 17 00:00:00 2001 From: Emily Plummer Date: Mon, 30 Sep 2019 09:31:28 -0700 Subject: [PATCH 1/4] update Details docs and types --- docs/content/Details.md | 4 ++-- index.d.ts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/content/Details.md b/docs/content/Details.md index cabed45078f..cdcf296868d 100644 --- a/docs/content/Details.md +++ b/docs/content/Details.md @@ -19,7 +19,7 @@ You are responsible for rendering your own ``. 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
@@ -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 open/closed state of the Details component | | overlay | Boolean | false | Sets whether or not element will close when user clicks outside of it diff --git a/index.d.ts b/index.d.ts index 8976c939c6a..2d4c10db774 100644 --- a/index.d.ts +++ b/index.d.ts @@ -104,11 +104,12 @@ declare module '@primer/components' { export const Heading: React.FunctionComponent - type DetailsRenderFunction = (args: {open: boolean; toggle: () => void}) => React.ReactElement + type DetailsRenderFunction = (args: {open: boolean}) => React.ReactElement export interface DetailsProps extends CommonProps, Omit, 'color'> { render?: DetailsRenderFunction children?: DetailsRenderFunction | React.ReactNode + defaultOpen?: boolean overlay?: boolean } From 8068767be17aeca2a4e310b02e4c54b3eefa94f4 Mon Sep 17 00:00:00 2001 From: Emily Plummer Date: Mon, 30 Sep 2019 09:32:27 -0700 Subject: [PATCH 2/4] update dropdown prop types --- src/Dropdown.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Dropdown.js b/src/Dropdown.js index 3907a5217cb..7ad9a866d34 100644 --- a/src/Dropdown.js +++ b/src/Dropdown.js @@ -125,6 +125,7 @@ Dropdown.Item.propTypes = { Dropdown.defaultProps = {theme} Dropdown.propTypes = { children: PropTypes.node, + title: PropTypes.string, ...COMMON.propTypes } From aa395ce7d850a43f6d185c863d50ceacf610b6d4 Mon Sep 17 00:00:00 2001 From: Emily Plummer Date: Mon, 30 Sep 2019 09:34:08 -0700 Subject: [PATCH 3/4] update version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ce709793c9d..4b4f99db506 100644 --- a/package.json +++ b/package.json @@ -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", From 88d5ffed1d41ac73614370e698bcc935b925eaec Mon Sep 17 00:00:00 2001 From: Emily Plummer Date: Mon, 30 Sep 2019 09:35:22 -0700 Subject: [PATCH 4/4] Update Details.md --- docs/content/Details.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/Details.md b/docs/content/Details.md index cdcf296868d..e2bc55e480e 100644 --- a/docs/content/Details.md +++ b/docs/content/Details.md @@ -42,5 +42,5 @@ Details components get `COMMON` system props. Read our [System Props](/system-pr | Name | Type | Default | Description | | :- | :- | :-: | :- | -| defaultOpen | 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