-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat: upgrade page components #254
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
47458d5
refactor: fix alignment bug and make page header and page content sha…
alexpaxton 0412587
docs: add documentation for page components
alexpaxton 57d46aa
refactor: improve handling of presenation mode
alexpaxton fa5eb67
chore: update changelog
alexpaxton a792ea6
Merge branch 'master' into feat/upgrade-page
alexpaxton 6a9ebef
refactor: use suggested typing
alexpaxton bc34bee
Merge branch 'master' into feat/upgrade-page
alexpaxton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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,26 @@ | ||
# Full Page Example | ||
|
||
This an example of all the `Page` components working together. | ||
|
||
### Usage | ||
```tsx | ||
import {Page} from '@influxdata/clockface' | ||
``` | ||
```tsx | ||
<Page> | ||
<Page.Header fullWidth={true} /> | ||
<Page.Contents fullWidth={true}> | ||
// Contents go here | ||
</Page.Contents> | ||
</Page> | ||
``` | ||
|
||
### Example | ||
<!-- STORY --> | ||
|
||
|
||
<!-- STORY HIDE START --> | ||
|
||
<!-- STORY HIDE END --> | ||
|
||
<!-- PROPS --> |
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,31 @@ | ||
# Page | ||
|
||
The `Page` component family is for laying out pages, hence the name. It is best used in combination with `AppWrapper` and `NavMenu`. *NOTE:* `Page` components used outside of `AppWrapper` may not appear as expected. | ||
|
||
### Usage | ||
```tsx | ||
import {Page} from '@influxdata/clockface' | ||
``` | ||
In combination with `AppWrapper` and `NavMenu`: | ||
|
||
```tsx | ||
<AppWrapper> | ||
<NavMenu /> | ||
<Page> | ||
<Page.Header /> | ||
<Page.Contents> | ||
// Contents go here | ||
</Page.Contents> | ||
</Page> | ||
</AppWrapper> | ||
``` | ||
|
||
### Example | ||
<!-- STORY --> | ||
|
||
|
||
<!-- STORY HIDE START --> | ||
|
||
<!-- STORY HIDE END --> | ||
|
||
<!-- PROPS --> |
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 |
---|---|---|
|
@@ -7,34 +7,62 @@ | |
|
||
.cf-page { | ||
width: 100%; | ||
flex: 1 0 calc(100% - #{$nav-menu--size}); | ||
flex: 1 0 100%; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: stretch; | ||
|
||
.cf-nav + & { | ||
flex: 1 0 calc(100% - #{$nav-menu--size}); | ||
} | ||
} | ||
|
||
@media screen and (min-width: $nav-menu--breakpoint) { | ||
.cf-page { | ||
width: auto; | ||
height: 100%; | ||
flex: 1 0 100%; | ||
} | ||
} | ||
|
||
/* | ||
Gutters & Max Width | ||
----------------------------------------------------------------------------- | ||
*/ | ||
|
||
.cf-page-header--fluid, | ||
.cf-page-header--fixed, | ||
.cf-page-contents__fluid, | ||
.cf-page-contents__fixed { | ||
width: 100%; | ||
padding: 0 $page--gutter-small; | ||
} | ||
|
||
.cf-page-header--fixed, | ||
.cf-page-contents__fixed { | ||
margin: 0 auto; | ||
max-width: $page--max-width; | ||
} | ||
|
||
/* | ||
Page Header | ||
----------------------------------------------------------------------------- | ||
*/ | ||
|
||
.cf-page-header { | ||
height: $page--header-size; | ||
width: 100%; | ||
flex: 0 0 $page--header-size; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
|
||
.cf-page-header--container { | ||
.cf-page-header--fluid, | ||
.cf-page-header--fixed { | ||
display: flex; | ||
padding: 0 $page--gutter-small; | ||
align-items: center; | ||
justify-content: space-between; | ||
flex-wrap: nowrap; | ||
width: 100%; | ||
max-width: $page--max-width; | ||
} | ||
|
||
.cf-page-header--left, | ||
|
@@ -77,10 +105,15 @@ | |
cursor: default; | ||
} | ||
|
||
/* | ||
Page Contents | ||
------------------------------------------------------------------------------ | ||
*/ | ||
|
||
.cf-page-contents { | ||
width: 100%; | ||
position: relative; | ||
height: calc(100% - #{$page--header-size}) !important; | ||
flex: 1 0 calc(100% - #{$page--header-size}); | ||
overflow: hidden; | ||
|
||
& > .cf-dapper-scrollbars--track-y { | ||
|
@@ -92,58 +125,36 @@ | |
} | ||
} | ||
|
||
.cf-page-contents--padding { | ||
.cf-page-contents__fluid { | ||
min-height: 100%; | ||
padding: $page--gutter-small; | ||
padding-top: 0; | ||
} | ||
|
||
.cf-page-contents--container { | ||
.cf-page-contents__fixed { | ||
margin: 0 auto; | ||
max-width: $page--max-width; | ||
} | ||
|
||
/* | ||
Full Width Page | ||
------------------------------------------------------------------------------ | ||
*/ | ||
|
||
.cf-page-contents.full-width .cf-page-contents--padding { | ||
padding: 0 $page--gutter-small; | ||
} | ||
|
||
.cf-page-contents--container.full-width { | ||
max-width: 100%; | ||
} | ||
|
||
.cf-page-header.full-width .cf-page-header--container { | ||
max-width: 100%; | ||
} | ||
|
||
/* | ||
Scrollable Page | ||
------------------------------------------------------------------------------ | ||
*/ | ||
|
||
.cf-page-contents.cf-dapper-scrollbars > .cf-page-contents--padding { | ||
.cf-page-contents.cf-dapper-scrollbars .cf-page-contents__fluid, | ||
.cf-page-contents.cf-dapper-scrollbars .cf-page-contents__fixed { | ||
padding-bottom: $page--gutter-small; | ||
} | ||
|
||
/* | ||
Full Height Mode | ||
Non-Scrollable Page | ||
------------------------------------------------------------------------------ | ||
*/ | ||
|
||
.cf-page-contents.full-height { | ||
height: 100% !important; | ||
} | ||
|
||
.cf-page-contents.full-height .cf-page-contents--padding { | ||
padding: $cf-marg-b; | ||
} | ||
.cf-page-contents__no-scroll { | ||
display: flex; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This small change makes it way easier to have "full height" pages like the DE |
||
|
||
.cf-page-contents.full-height.cf-dapper-scrollbars .cf-page-contents--padding { | ||
padding-right: $cf-marg-c; | ||
.cf-page-contents__fluid, | ||
.cf-page-contents__fixed { | ||
height: 100%; | ||
} | ||
} | ||
|
||
/* | ||
|
@@ -152,17 +163,21 @@ | |
*/ | ||
|
||
@media screen and (min-width: $nav-menu--breakpoint) { | ||
.cf-page-header--container { | ||
.cf-page-header--fluid, | ||
.cf-page-header--fixed, | ||
.cf-page-contents__fluid, | ||
.cf-page-contents__fixed { | ||
padding: 0 $page--gutter; | ||
} | ||
.cf-page-contents--padding { | ||
padding: $page--gutter; | ||
padding-top: 0; | ||
} | ||
.cf-page-contents.full-width .cf-page-contents--padding { | ||
padding: 0 $page--gutter; | ||
} | ||
.cf-page-contents.cf-dapper-scrollbars > .cf-page-contents--padding { | ||
|
||
.cf-page-contents.cf-dapper-scrollbars .cf-page-contents__fluid, | ||
.cf-page-contents.cf-dapper-scrollbars .cf-page-contents__fixed { | ||
padding-bottom: $page--gutter; | ||
} | ||
} | ||
|
||
/* | ||
PresentationMode | ||
------------------------------------------------------------------------------ | ||
*/ | ||
|
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,23 @@ | ||
# Page Contents | ||
|
||
Used alongside `<Page.Header />` to layout page, this component is for containing the body of the page. | ||
|
||
### Usage | ||
```tsx | ||
import {Page} from '@influxdata/clockface' | ||
``` | ||
```tsx | ||
<Page.Contents> | ||
// Contents go here | ||
</Page.Contents> | ||
``` | ||
|
||
### Example | ||
<!-- STORY --> | ||
|
||
|
||
<!-- STORY HIDE START --> | ||
|
||
<!-- STORY HIDE END --> | ||
|
||
<!-- PROPS --> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Goal was to use consistent naming between page header and page contents