diff --git a/packages/core/src/components/HelpDrawer/HelpDrawer.example.jsx b/packages/core/src/components/HelpDrawer/HelpDrawer.example.jsx new file mode 100644 index 0000000000..3f30cb094e --- /dev/null +++ b/packages/core/src/components/HelpDrawer/HelpDrawer.example.jsx @@ -0,0 +1,76 @@ +import HelpDrawer from './HelpDrawer'; +import HelpDrawerToggle from './HelpDrawerToggle'; +import React from 'react'; +import ReactDOM from 'react-dom'; + +class HelpDrawerExample extends React.PureComponent { + constructor(props) { + super(props); + + this.state = { + showHelp: false + }; + } + + handleDrawerClose() { + this.setState({ showHelp: false }); + } + + handleDrawerOpen() { + this.setState({ showHelp: true }); + } + + render() { + return ( +
+ Click the link below to open the help drawer. +
++ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad + minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. +
++ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut + enim ad minim veniam, quis nostrud exercitation ullamco laboris + nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in + reprehenderit in voluptate velit esse cillum dolore eu fugiat + nulla pariatur. Excepteur sint occaecat cupidatat non proident, + sunt in culpa qui officia deserunt mollit anim id est laborum. +
++ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad + minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. Duis aute irure dolor in + reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla + pariatur. Excepteur sint occaecat cupidatat non proident, sunt in + culpa qui officia deserunt mollit anim id est laborum. +
+Note: This is just an example of the HTML markup. See the React example for a functioning example.
+Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+ + Toggle the help drawer. + +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+Some footer content
+content
+content
+content
+link content
++ content +
++ Some footer content +
++ link content +
+ + +`; diff --git a/packages/core/src/components/__tests__/index.test.js b/packages/core/src/components/__tests__/index.test.js index 55d0fec88b..66580cebc1 100644 --- a/packages/core/src/components/__tests__/index.test.js +++ b/packages/core/src/components/__tests__/index.test.js @@ -34,7 +34,14 @@ function getDirectories(paths) { return paths.filter(filePath => fs.lstatSync(filePath).isDirectory()); } -const ignoredComponents = ['Mask', 'ReviewLink', 'Step', 'SubStep', 'StepLink']; +const ignoredComponents = [ + 'Mask', + 'ReviewLink', + 'Step', + 'SubStep', + 'StepLink', + 'HelpDrawerToggle' +]; describe('Components index', () => { it("exports all components except ones we don't want to expose", () => { diff --git a/packages/core/src/components/_index.scss b/packages/core/src/components/_index.scss index e27b11e6cf..5b48d70648 100644 --- a/packages/core/src/components/_index.scss +++ b/packages/core/src/components/_index.scss @@ -6,6 +6,7 @@ @import 'ChoiceList/Select'; @import 'Dialog/Dialog'; @import 'FormLabel/FormLabel'; +@import 'HelpDrawer/HelpDrawer'; @import 'List/List'; @import 'MonthPicker/MonthPicker'; @import 'Review/Review'; diff --git a/packages/core/src/components/index.js b/packages/core/src/components/index.js index ee858bd2fd..d84d0240f9 100644 --- a/packages/core/src/components/index.js +++ b/packages/core/src/components/index.js @@ -10,6 +10,7 @@ export * from './ChoiceList/Select'; export * from './DateField/DateField'; export * from './Dialog/Dialog'; export * from './FormLabel/FormLabel'; +export * from './HelpDrawer/HelpDrawer'; export * from './MonthPicker/MonthPicker'; export * from './Review/Review'; export * from './SkipNav/SkipNav';