-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enhance ngx-dev-toolbar with new card components and layout imp…
…rovements - Introduced new card components: DevToolbarCardComponent and DevToolbarClickableCardComponent for better UI representation. - Added link button component (DevToolbarLinkButtonComponent) for external links with icons. - Updated home tool layout to include clickable cards for exporting and importing settings. - Enhanced styling for various components to improve visual consistency and user experience. - Updated project configuration to include new assets and styles for better organization.
- Loading branch information
1 parent
282d931
commit 409ea9c
Showing
12 changed files
with
16,984 additions
and
42 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
18 changes: 18 additions & 0 deletions
18
libs/ngx-dev-toolbar/src/components/card/card.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,18 @@ | ||
.card { | ||
background: var(--ndt-bg-primary); | ||
border-radius: var(--ndt-border-radius-large); | ||
padding: var(--ndt-spacing-md); | ||
cursor: pointer; | ||
transition: var(--ndt-transition-default); | ||
border: 1px solid var(--ndt-border-subtle); | ||
position: relative; | ||
flex: 1; | ||
height: 120px; | ||
display: flex; | ||
|
||
&:hover { | ||
background: var(--ndt-hover-bg); | ||
border-color: var(--ndt-primary); | ||
box-shadow: 0 0 0 1px rgba(var(--ndt-primary-rgb), 0.3); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
libs/ngx-dev-toolbar/src/components/card/card.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,30 @@ | ||
import { Component, signal } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'ndt-card', | ||
standalone: true, | ||
template: ` | ||
<div | ||
class="card" | ||
role="button" | ||
tabindex="0" | ||
(click)="onClick()" | ||
(keydown.enter)="onClick()" | ||
(keydown.space)="onClick()" | ||
[class.card--hover]="isHovered()" | ||
(mouseenter)="isHovered.set(true)" | ||
(mouseleave)="isHovered.set(false)" | ||
> | ||
<ng-content></ng-content> | ||
</div> | ||
`, | ||
styleUrls: ['./card.component.scss'], | ||
}) | ||
export class DevToolbarCardComponent { | ||
readonly click = signal<void>(undefined); | ||
protected readonly isHovered = signal(false); | ||
|
||
onClick(): void { | ||
this.click.set(); | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
libs/ngx-dev-toolbar/src/components/clickable-card/clickable-card.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,39 @@ | ||
.clickable-card { | ||
display: flex; | ||
flex-direction: column; | ||
gap: var(--ndt-spacing-sm); | ||
height: 100%; | ||
|
||
&__icon { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
width: 32px; | ||
height: 32px; | ||
border-radius: var(--ndt-border-radius-medium); | ||
background: var(--ndt-hover-bg); | ||
color: var(--ndt-text-primary); | ||
} | ||
|
||
&__content { | ||
display: flex; | ||
flex-direction: column; | ||
gap: var(--ndt-spacing-xs); | ||
} | ||
|
||
&__title { | ||
color: var(--ndt-text-primary); | ||
font-size: var(--ndt-font-size-sm); | ||
font-weight: 500; | ||
} | ||
|
||
&__subtitle { | ||
color: var(--ndt-text-muted); | ||
font-size: var(--ndt-font-size-xs); | ||
line-height: 1.4; | ||
display: -webkit-box; | ||
-webkit-line-clamp: 2; | ||
-webkit-box-orient: vertical; | ||
overflow: hidden; | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
libs/ngx-dev-toolbar/src/components/clickable-card/clickable-card.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,34 @@ | ||
import { Component, input, signal } from '@angular/core'; | ||
import { DevToolbarCardComponent } from '../card/card.component'; | ||
import { DevToolbarIconComponent } from '../icons/icon.component'; | ||
import { IconName } from '../icons/icon.models'; | ||
|
||
@Component({ | ||
selector: 'ndt-clickable-card', | ||
standalone: true, | ||
imports: [DevToolbarCardComponent, DevToolbarIconComponent], | ||
template: ` | ||
<ndt-card (clicked)="onClick()"> | ||
<div class="clickable-card"> | ||
<div class="clickable-card__icon"> | ||
<ndt-icon [name]="icon()" /> | ||
</div> | ||
<div class="clickable-card__content"> | ||
<div class="clickable-card__title">{{ title() }}</div> | ||
<div class="clickable-card__subtitle">{{ subtitle() }}</div> | ||
</div> | ||
</div> | ||
</ndt-card> | ||
`, | ||
styleUrls: ['./clickable-card.component.scss'], | ||
}) | ||
export class DevToolbarClickableCardComponent { | ||
readonly icon = input.required<IconName>(); | ||
readonly title = input.required<string>(); | ||
readonly subtitle = input.required<string>(); | ||
readonly clicked = signal<void>(undefined); | ||
|
||
onClick(): void { | ||
this.clicked.set(); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
libs/ngx-dev-toolbar/src/components/link-button/link-button.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,37 @@ | ||
.link-button { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
gap: var(--ndt-spacing-xs); | ||
text-decoration: none; | ||
color: var(--ndt-text-muted); | ||
transition: var(--ndt-transition-default); | ||
min-width: 80px; | ||
|
||
&:hover { | ||
color: var(--ndt-text-primary); | ||
|
||
.link-button__icon { | ||
outline: 2px solid var(--ndt-primary); | ||
outline-offset: 2px; | ||
box-shadow: 0 0 8px var(--ndt-primary); | ||
} | ||
} | ||
|
||
&__icon { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
width: 40px; | ||
height: 40px; | ||
border-radius: var(--ndt-border-radius-medium); | ||
background: var(--ndt-hover-bg); | ||
transition: all 0.2s ease-in-out; | ||
} | ||
|
||
&__text { | ||
font-size: var(--ndt-font-size-xs); | ||
text-align: center; | ||
white-space: nowrap; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
libs/ngx-dev-toolbar/src/components/link-button/link-button.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,29 @@ | ||
import { Component, input } from '@angular/core'; | ||
import { DevToolbarIconComponent } from '../icons/icon.component'; | ||
import { IconName } from '../icons/icon.models'; | ||
|
||
@Component({ | ||
selector: 'ndt-link-button', | ||
standalone: true, | ||
imports: [DevToolbarIconComponent], | ||
template: ` | ||
<a | ||
[href]="url()" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
class="link-button" | ||
> | ||
<div class="link-button__icon"> | ||
<ndt-icon [name]="icon()" /> | ||
</div> | ||
<span class="link-button__text"> | ||
<ng-content></ng-content> | ||
</span> | ||
</a> | ||
`, | ||
styleUrls: ['./link-button.component.scss'], | ||
}) | ||
export class DevToolbarLinkButtonComponent { | ||
readonly url = input.required<string>(); | ||
readonly icon = input.required<IconName>(); | ||
} |
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
Oops, something went wrong.