Skip to content

Commit 2f5ba1a

Browse files
committed
feat(daffio): add search feature
1 parent 69283f8 commit 2f5ba1a

49 files changed

Lines changed: 5157 additions & 16 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/daffio/src/app/core/header/components/header/header.component.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@
88
</div>
99
</div>
1010
<div class="daffio-header__right">
11-
<div class="daffio-header__theme-toggle">
11+
<ng-content></ng-content>
12+
<!-- <div class="daffio-header__theme-toggle">
1213
<ng-content select="[theme-toggle]"></ng-content>
1314
</div>
1415
<div class="daffio-header__button">
1516
<ng-content select="[quickstart-button]"></ng-content>
16-
</div>
17+
</div> -->
1718
<div class="daffio-header__bars">
1819
<ng-content select="[sidebar-button]"></ng-content>
1920
</div>

apps/daffio/src/app/core/header/components/header/header.component.scss

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
color: currentColor;
1515
font-size: daff.$normal-font-size;
1616
font-weight: 500;
17-
line-height: 64px;
17+
line-height: 4rem;
1818
padding: 0 1rem;
1919
position: relative;
2020
text-decoration: none;
@@ -26,7 +26,7 @@
2626
.daffio-header {
2727
&__navbar {
2828
justify-content: space-between;
29-
padding: 0 24px;
29+
padding: 0 1.5rem;
3030
}
3131

3232
&__left,
@@ -36,15 +36,11 @@
3636
}
3737

3838
&__left {
39-
gap: 32px;
39+
gap: 2rem;
4040
}
4141

42-
&__theme-toggle {
43-
margin-right: 0.25rem;
44-
45-
@include daff.breakpoint(big-tablet) {
46-
margin-right: 0;
47-
}
42+
&__right {
43+
gap: 1rem;
4844
}
4945

5046
&__menu {
@@ -54,7 +50,7 @@
5450
@include daff.breakpoint(big-tablet) {
5551
display: flex;
5652
align-items: center;
57-
gap: 16px;
53+
gap: 1rem;
5854
}
5955
}
6056

@@ -68,10 +64,10 @@
6864
}
6965

7066
&__logo {
71-
width: 128px;
67+
width: 8rem;
7268

7369
@include daff.breakpoint(mobile) {
74-
width: 160px;
70+
width: 10rem;
7571
}
7672
}
7773

apps/daffio/src/app/core/nav/docs/docs.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<a routerLink="/" daffio-logo>
33
<daff-branding-logo type="full"></daff-branding-logo>
44
</a>
5-
<daff-theme-switch-button theme-toggle></daff-theme-switch-button>
65
@for (link of links$ | async; track $index) {
76
<ng-container daffioHeaderItem>
87
@if (link.external) {
@@ -12,6 +11,8 @@
1211
}
1312
</ng-container>
1413
}
14+
<daffio-docs-search-button></daffio-docs-search-button>
15+
<daff-theme-switch-button theme-toggle></daff-theme-switch-button>
1516
<button daff-icon-button color="theme-contrast" aria-label="Open Navigation Sidebar"
1617
sidebar-button
1718
(click)="openSidebar()">

apps/daffio/src/app/core/nav/docs/docs.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { DaffIconButtonComponent } from '@daffodil/design/button';
2020
import { DaffRouterDataService } from '@daffodil/router';
2121
import { DaffThemeSwitchButtonModule } from '@daffodil/theme-switch';
2222

23+
import { DaffioDocsSearchButtonComponent } from '../../../docs//search/components/search-button/search-button.component';
2324
import { DaffioHeaderComponentModule } from '../../header/components/header.module';
2425
import { DaffioRoute } from '../../router/route.type';
2526
import { DaffioSidebarService } from '../../sidebar/services/sidebar.service';
@@ -39,6 +40,7 @@ import { DaffioNavLink } from '../link/type';
3940
DaffIconButtonComponent,
4041
FaIconComponent,
4142
AsyncPipe,
43+
DaffioDocsSearchButtonComponent,
4244
],
4345
})
4446
export class DaffioDocsNavContainer implements OnInit {

apps/daffio/src/app/core/nav/marketing/marketing.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
}
1313
</ng-container>
1414
}
15-
<a daff-button color="theme-contrast" size="sm" href="https://github.com/graycoreio/daffodil" rel="noopener noreferrer" target="_blank" quickstart-button>Get Started</a>
15+
<a daff-button color="theme-contrast" size="sm" href="https://github.com/graycoreio/daffodil" rel="noopener noreferrer" target="_blank" class="daffio-header__get-started-button">Get Started</a>
16+
1617
<button daff-icon-button color="theme-contrast" aria-label="Open Navigation Sidebar"
1718
sidebar-button
1819
(click)="openSidebar()">
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@use 'utilities' as daff;
2+
3+
.daffio-header {
4+
&__get-started-button {
5+
display: none;
6+
7+
@include daff.breakpoint(big-tablet) {
8+
display: flex;
9+
}
10+
}
11+
}

apps/daffio/src/app/core/nav/marketing/marketing.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import { DaffioNavLink } from '../link/type';
3232
@Component({
3333
selector: 'daffio-nav-marketing-container',
3434
templateUrl: './marketing.component.html',
35+
styleUrl: './marketing.component.scss',
3536
changeDetection: ChangeDetectionStrategy.OnPush,
3637
imports: [
3738
DaffioHeaderComponentModule,
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
@use 'theme' as *;
2+
3+
@mixin daffio-docs-search-button-theme($theme) {
4+
$neutral: daff-get-palette($theme, neutral);
5+
$base: daff-get-base-color($theme, base);
6+
$base-contrast: daff-get-base-color($theme, base-contrast);
7+
$mode: daff-get-theme-mode($theme);
8+
9+
.daffio-docs-search-button {
10+
@include light($mode) {
11+
background: rgba(daff-color($neutral, 20), 0.4);
12+
color: daff-color($neutral, 70);
13+
14+
&__kbd {
15+
border: 1px solid daff-color($neutral, 70);
16+
}
17+
}
18+
19+
@include dark($mode) {
20+
background: daff-color($neutral, 90);
21+
color: daff-color($neutral, 40);
22+
23+
&__kbd {
24+
border: 1px solid daff-color($neutral, 40);
25+
}
26+
}
27+
}
28+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<button type="button" class="daffio-docs-search-button" (click)="showModal()">
2+
<fa-icon [icon]="faSearch" [fixedWidth]="true"></fa-icon>
3+
<span>Type <kbd class="daffio-docs-search-button__kbd">/</kbd> to search</span>
4+
</button>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
@use 'utilities' as daff;
2+
3+
.daffio-docs-search-button {
4+
@include daff.clickable();
5+
display: flex;
6+
align-items: center;
7+
gap: 0.75rem;
8+
appearance: none;
9+
border: none;
10+
border-radius: 0.25rem;
11+
font-size: daff.$font-size-sm;
12+
padding: 0.75rem;
13+
width: 16rem;
14+
15+
&__kbd {
16+
display: inline-flex;
17+
align-items: center;
18+
justify-content: center;
19+
border-radius: 0.25rem;
20+
font-size: 0.75rem;
21+
line-height: 1rem;
22+
height: 1rem;
23+
width: 1rem;
24+
box-sizing: border-box;
25+
}
26+
}

0 commit comments

Comments
 (0)