-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: toolbar UI update with hoverable menu (#1478)
BREAKING CHANGE The `FileMenu` is now using the new `HoverMenuBar` components which makes this version of the `FileMenu` incompatible with the previous version. Apps will be need to update their toolbar and file menu before using this version of analytics.
- Loading branch information
1 parent
a2a7117
commit 129ad4a
Showing
33 changed files
with
1,841 additions
and
457 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { configure } from '@testing-library/dom' | ||
|
||
configure({ | ||
testIdAttribute: 'data-test', | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
module.exports = { | ||
testPathIgnorePatterns: ['/node_modules/', '/build/'], | ||
setupFilesAfterEnv: ['<rootDir>/config/setupEnzyme.js'], | ||
setupFilesAfterEnv: [ | ||
'<rootDir>/config/setupEnzyme.js', | ||
'<rootDir>/config/setupTestingLibrary.js', | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import { storiesOf } from '@storybook/react' | ||
import React, { useState } from 'react' | ||
import { | ||
HoverMenuBar, | ||
HoverMenuDropdown, | ||
HoverMenuList, | ||
HoverMenuListItem, | ||
InterpretationsAndDetailsToggler, | ||
Toolbar, | ||
ToolbarSidebar, | ||
UpdateButton, | ||
} from '../components/Toolbar/index.js' | ||
|
||
function ToolbarWithState() { | ||
const [isHidden, setIsHidden] = useState(false) | ||
const [isSidebarShowing, setIsSidebarShowing] = useState(false) | ||
return ( | ||
<Toolbar> | ||
<ToolbarSidebar isHidden={isHidden}> | ||
<span>Toolbar side bar</span> | ||
<a | ||
style={{ | ||
paddingLeft: 12, | ||
textDecoration: 'underline', | ||
cursor: 'pointer', | ||
}} | ||
onClick={() => setIsHidden(true)} | ||
> | ||
click to hide | ||
</a> | ||
</ToolbarSidebar> | ||
<UpdateButton /> | ||
<HoverMenuBar> | ||
<HoverMenuDropdown label="Menu A"> | ||
<HoverMenuList> | ||
<HoverMenuListItem label="Menu item A.1" /> | ||
<HoverMenuListItem label="Menu item A.2" /> | ||
<HoverMenuListItem label="Menu item A.3" /> | ||
</HoverMenuList> | ||
</HoverMenuDropdown> | ||
<HoverMenuDropdown label="Menu B"> | ||
<HoverMenuList> | ||
<HoverMenuListItem label="Menu item B.1"> | ||
<HoverMenuListItem label="Menu item B.1.1" /> | ||
<HoverMenuListItem label="Menu item B.1.2" /> | ||
<HoverMenuListItem label="Menu item B.1.3" /> | ||
</HoverMenuListItem> | ||
<HoverMenuListItem label="Menu item B.2"> | ||
<HoverMenuListItem label="Menu item B.2.1" /> | ||
<HoverMenuListItem label="Menu item B.2.2" /> | ||
<HoverMenuListItem label="Menu item B.2.3" /> | ||
</HoverMenuListItem> | ||
<HoverMenuListItem label="Menu item B.3" disabled> | ||
<HoverMenuListItem label="Menu item B.3.1" /> | ||
<HoverMenuListItem label="Menu item B.3.2" /> | ||
<HoverMenuListItem label="Menu item B.3.3" /> | ||
</HoverMenuListItem> | ||
</HoverMenuList> | ||
</HoverMenuDropdown> | ||
<HoverMenuDropdown label="Menu C" disabled> | ||
<HoverMenuList> | ||
<HoverMenuListItem label="Menu item C.1" /> | ||
<HoverMenuListItem label="Menu item C.2" /> | ||
<HoverMenuListItem label="Menu item C.3" /> | ||
</HoverMenuList> | ||
</HoverMenuDropdown> | ||
</HoverMenuBar> | ||
<InterpretationsAndDetailsToggler | ||
isShowing={isSidebarShowing} | ||
onClick={() => setIsSidebarShowing((current) => !current)} | ||
/> | ||
</Toolbar> | ||
) | ||
} | ||
|
||
storiesOf('Toolbar', module).add('default', () => { | ||
return <ToolbarWithState /> | ||
}) |
Oops, something went wrong.