-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(daffio): support always showing sidebar header and footer (#3451)
Co-authored-by: Peter Lauck <[email protected]>
- Loading branch information
Showing
24 changed files
with
160 additions
and
72 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { DaffSidebarRegistration } from '@daffodil/design/sidebar'; | ||
|
||
import { DAFFIO_NAV_SIDEBAR_ID } from './header/sidebar-id'; | ||
import { DaffioNavSidebarBodyComponent } from './sidebar-body/component'; | ||
import { DaffioSidebarHeaderComponent } from '../sidebar/components/sidebar-header/sidebar-header.component'; | ||
|
||
export const DAFF_DOCS_NAV_SIDEBAR_REGISTRATION: DaffSidebarRegistration = { | ||
id: DAFFIO_NAV_SIDEBAR_ID, | ||
header: DaffioSidebarHeaderComponent, | ||
body: DaffioNavSidebarBodyComponent, | ||
}; |
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
15 changes: 15 additions & 0 deletions
15
apps/daffio/src/app/core/sidebar/components/docs/footer/footer-theme.scss
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,15 @@ | ||
@use 'sass:map'; | ||
@use 'theme' as daff-theme; | ||
|
||
@mixin daffio-docs-sidebar-footer-theme($theme) { | ||
$neutral: daff-theme.daff-map-get($theme, 'core', 'neutral'); | ||
$base: daff-theme.daff-map-get($theme, 'core', 'base'); | ||
|
||
.daffio-docs-sidebar-footer { | ||
border-top: 1px solid daff-theme.daff-illuminate($base, $neutral, 2); | ||
|
||
&::after { | ||
background: daff-theme.daff-illuminate($base, $neutral, 2); | ||
} | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
apps/daffio/src/app/core/sidebar/components/docs/footer/footer.component.html
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,6 @@ | ||
<daff-sidebar-footer > | ||
<a href="https://github.com/graycoreio/daffodil" rel="noopener noreferrer" target="_blank" class="daffio-docs-sidebar-footer"> | ||
<span>GitHub</span> | ||
<fa-icon [icon]="faArrowUpRightFromSquare"></fa-icon> | ||
</a> | ||
</daff-sidebar-footer> |
34 changes: 34 additions & 0 deletions
34
apps/daffio/src/app/core/sidebar/components/docs/footer/footer.component.scss
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,34 @@ | ||
@use 'utilities' as daff; | ||
|
||
.daffio-docs-sidebar-footer { | ||
@include daff.clickable(); | ||
display: flex; | ||
gap: 0.5rem; | ||
justify-content: center; | ||
font-weight: 500; | ||
padding: 0.75rem; | ||
text-decoration: none; | ||
position: relative; | ||
|
||
&::after { | ||
content: ''; | ||
position: absolute; | ||
height: 100%; | ||
width: 100%; | ||
top: 0; | ||
left: 0; | ||
opacity: 0; | ||
transition: opacity 300ms; | ||
z-index: 0; | ||
} | ||
|
||
> * { | ||
z-index: 1; | ||
} | ||
|
||
&:hover { | ||
&::after { | ||
opacity: 1; | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
apps/daffio/src/app/core/sidebar/components/docs/footer/footer.component.ts
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 @@ | ||
import { | ||
ChangeDetectionStrategy, | ||
Component, | ||
} from '@angular/core'; | ||
import { FaIconComponent } from '@fortawesome/angular-fontawesome'; | ||
import { faArrowUpRightFromSquare } from '@fortawesome/free-solid-svg-icons'; | ||
|
||
import { DaffSidebarFooterComponent } from '@daffodil/design/sidebar'; | ||
|
||
@Component({ | ||
selector: 'daffio-docs-sidebar-footer', | ||
templateUrl: './footer.component.html', | ||
styleUrls: ['./footer.component.scss'], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
standalone: true, | ||
imports: [ | ||
DaffSidebarFooterComponent, | ||
FaIconComponent, | ||
], | ||
}) | ||
export class DaffioDocsSidebarFooterComponent { | ||
faArrowUpRightFromSquare = faArrowUpRightFromSquare; | ||
} |
4 changes: 2 additions & 2 deletions
4
.../sidebar-footer/sidebar-footer-theme.scss → ...onents/marketing/footer/footer-theme.scss
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
2 changes: 1 addition & 1 deletion
2
...ebar-footer/sidebar-footer.component.html → ...ts/marketing/footer/footer.component.html
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,3 +1,3 @@ | ||
<daff-sidebar-footer> | ||
<a href="https://github.com/graycoreio/daffodil" rel="noopener noreferrer" target="_blank" class="daffio-sidebar-footer">Get Started</a> | ||
<a href="https://github.com/graycoreio/daffodil" rel="noopener noreferrer" target="_blank" class="daffio-marketing-sidebar-footer">Get Started</a> | ||
</daff-sidebar-footer> |
2 changes: 1 addition & 1 deletion
2
...ebar-footer/sidebar-footer.component.scss → ...ts/marketing/footer/footer.component.scss
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
18 changes: 18 additions & 0 deletions
18
apps/daffio/src/app/core/sidebar/components/marketing/footer/footer.component.ts
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,18 @@ | ||
import { | ||
ChangeDetectionStrategy, | ||
Component, | ||
} from '@angular/core'; | ||
|
||
import { DaffSidebarFooterComponent } from '@daffodil/design/sidebar'; | ||
|
||
@Component({ | ||
selector: 'daffio-marketing-sidebar-footer', | ||
templateUrl: './footer.component.html', | ||
styleUrls: ['./footer.component.scss'], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
standalone: true, | ||
imports: [ | ||
DaffSidebarFooterComponent, | ||
], | ||
}) | ||
export class DaffioMarketingSidebarFooterComponent { } |
13 changes: 0 additions & 13 deletions
13
apps/daffio/src/app/core/sidebar/components/sidebar-footer/sidebar-footer.component.ts
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
apps/daffio/src/app/core/sidebar/components/sidebar-footer/sidebar-footer.module.ts
This file was deleted.
Oops, something went wrong.
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,20 +1,19 @@ | ||
import { Route } from '@angular/router'; | ||
|
||
import { | ||
DaffSidebarModeEnum, | ||
DaffSidebarRegistration, | ||
} from '@daffodil/design/sidebar'; | ||
import { DaffSidebarModeEnum } from '@daffodil/design/sidebar'; | ||
|
||
import { DaffioSidebarRegistration } from '../registration/type'; | ||
|
||
export interface DaffioRouteWithSidebars extends Route { | ||
data?: Route['data'] & { | ||
/** | ||
* A collection of sidebars available on the current page. | ||
*/ | ||
daffioSidebars?: Record<DaffSidebarRegistration['id'], DaffSidebarRegistration>; | ||
daffioSidebars?: Record<DaffioSidebarRegistration['id'], DaffioSidebarRegistration>; | ||
/** | ||
* The sidebar that should be shown automatically (if any) when the viewport enters big tablet. | ||
*/ | ||
daffioDockedSidebar?: DaffSidebarRegistration['id']; | ||
daffioDockedSidebar?: DaffioSidebarRegistration['id']; | ||
sidebarMode?: DaffSidebarModeEnum; | ||
}; | ||
} |
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,12 @@ | ||
import { DaffSidebarRegistration } from '@daffodil/design/sidebar'; | ||
|
||
export interface DaffioSidebarRegistration extends DaffSidebarRegistration { | ||
/** | ||
* Whether to show the sidebar header regardless of sidebar mode. | ||
*/ | ||
alwaysShowHeader?: boolean; | ||
/** | ||
* Whether to show the sidebar footer regardless of sidebar mode. | ||
*/ | ||
alwaysShowFooter?: boolean; | ||
} |
4 changes: 4 additions & 0 deletions
4
apps/daffio/src/app/docs/api/components/nav-list/nav-list.component.scss
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,4 @@ | ||
:host { | ||
display: block; | ||
padding: 1rem 0; | ||
} |
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,11 +1,8 @@ | ||
import { DaffioApiNavListSidebarContainer } from './component'; | ||
import { DaffioSidebarFooterComponent } from '../../../core/sidebar/components/sidebar-footer/sidebar-footer.component'; | ||
import { DaffioSidebarHeaderComponent } from '../../../core/sidebar/components/sidebar-header/sidebar-header.component'; | ||
import { DAFFIO_DOCS_LIST_SIDEBAR_ID } from '../../containers/docs-list/sidebar.provider'; | ||
import { DaffioSidebarRegistration } from '../../../core/sidebar/registration/type'; | ||
import { DAFFIO_DOCS_LIST_SIDEBAR_REGISTRATION } from '../../containers/docs-list/sidebar.provider'; | ||
|
||
export const DAFFIO_API_NAV_LIST_SIDEBAR_REGISTRATION = { | ||
id: DAFFIO_DOCS_LIST_SIDEBAR_ID, | ||
header: DaffioSidebarHeaderComponent, | ||
export const DAFFIO_API_NAV_LIST_SIDEBAR_REGISTRATION: DaffioSidebarRegistration = { | ||
...DAFFIO_DOCS_LIST_SIDEBAR_REGISTRATION, | ||
body: DaffioApiNavListSidebarContainer, | ||
footer: DaffioSidebarFooterComponent, | ||
}; |
2 changes: 1 addition & 1 deletion
2
apps/daffio/src/app/docs/components/docs-list/docs-list.component.scss
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,4 @@ | ||
:host { | ||
display: block; | ||
padding: 1rem 0 0; | ||
padding: 1rem 0; | ||
} |
8 changes: 5 additions & 3 deletions
8
apps/daffio/src/app/docs/containers/docs-list/sidebar.provider.ts
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,12 +1,14 @@ | ||
import { DaffioDocsListContainer } from './docs-list.component'; | ||
import { DaffioSidebarFooterComponent } from '../../../core/sidebar/components/sidebar-footer/sidebar-footer.component'; | ||
import { DaffioDocsSidebarFooterComponent } from '../../../core/sidebar/components/docs/footer/footer.component'; | ||
import { DaffioSidebarHeaderComponent } from '../../../core/sidebar/components/sidebar-header/sidebar-header.component'; | ||
import { DaffioSidebarRegistration } from '../../../core/sidebar/registration/type'; | ||
|
||
export const DAFFIO_DOCS_LIST_SIDEBAR_ID = 'daffioDocsList'; | ||
|
||
export const DAFFIO_DOCS_LIST_SIDEBAR_REGISTRATION = { | ||
export const DAFFIO_DOCS_LIST_SIDEBAR_REGISTRATION: DaffioSidebarRegistration = { | ||
id: DAFFIO_DOCS_LIST_SIDEBAR_ID, | ||
header: DaffioSidebarHeaderComponent, | ||
body: DaffioDocsListContainer, | ||
footer: DaffioSidebarFooterComponent, | ||
footer: DaffioDocsSidebarFooterComponent, | ||
alwaysShowFooter: true, | ||
}; |
11 changes: 5 additions & 6 deletions
11
apps/daffio/src/app/docs/design/containers/docs-list/sidebar.provider.ts
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,12 +1,11 @@ | ||
import { DaffioSidebarRegistration } from 'apps/daffio/src/app/core/sidebar/registration/type'; | ||
|
||
import { DaffioDocsDesignListContainer } from './docs-list.component'; | ||
import { DaffioSidebarFooterComponent } from '../../../../core/sidebar/components/sidebar-footer/sidebar-footer.component'; | ||
import { DaffioSidebarHeaderComponent } from '../../../../core/sidebar/components/sidebar-header/sidebar-header.component'; | ||
import { DAFFIO_DOCS_LIST_SIDEBAR_REGISTRATION } from '../../../containers/docs-list/sidebar.provider'; | ||
|
||
export const DAFFIO_DOCS_DESIGN_LIST_SIDEBAR_ID = 'daffioDocsList'; | ||
|
||
export const DAFFIO_DOCS_DESIGN_LIST_SIDEBAR_REGISTRATION = { | ||
id: DAFFIO_DOCS_DESIGN_LIST_SIDEBAR_ID, | ||
header: DaffioSidebarHeaderComponent, | ||
export const DAFFIO_DOCS_DESIGN_LIST_SIDEBAR_REGISTRATION: DaffioSidebarRegistration = { | ||
...DAFFIO_DOCS_LIST_SIDEBAR_REGISTRATION, | ||
body: DaffioDocsDesignListContainer, | ||
footer: DaffioSidebarFooterComponent, | ||
}; |
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