Skip to content

chore(top-bar): styles order & examples refactoring (#DS-3886) #880

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions packages/components/top-bar/top-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
padding: var(--kbq-top-bar-padding-vertical) var(--kbq-top-bar-padding-horizontal);
border-radius: var(--kbq-top-bar-border-radius);

&.kbq-top-bar_with-shadow {
box-shadow: var(--kbq-top-bar-shadow-bottom);
transition: box-shadow var(--kbq-top-bar-shadow-transition);
}

.kbq-top-bar-spacer {
height: 100%;
flex: 0 0 var(--kbq-top-bar-spacer-min-width);
Expand All @@ -45,32 +50,27 @@
.kbq-overflow-items {
@include _overflow-items-margins;
}
}

.kbq-top-bar-container__start {
display: flex;
gap: var(--kbq-top-bar-container-start-gap);
flex: 1 0 var(--kbq-top-bar-container-start-basis);
justify-content: flex-start;
min-width: 0;
}

.kbq-top-bar-container__end {
display: flex;
gap: var(--kbq-top-bar-container-end-gap);
justify-content: end;
}
&.kbq-top-bar-container__start {
display: flex;
gap: var(--kbq-top-bar-container-start-gap);
flex: 1 0 var(--kbq-top-bar-container-start-basis);
justify-content: flex-start;
min-width: 0;
}

.kbq-top-bar-container__with-overflow-items {
gap: unset;
justify-content: unset;
&.kbq-top-bar-container__end {
display: flex;
gap: var(--kbq-top-bar-container-end-gap);
justify-content: end;
}

@include _overflow-items-margins;
}
&.kbq-top-bar-container__with-overflow-items {
gap: unset;
justify-content: unset;

&.kbq-top-bar_with-shadow {
box-shadow: var(--kbq-top-bar-shadow-bottom);
transition: box-shadow var(--kbq-top-bar-shadow-transition);
@include _overflow-items-margins;
}
}

@include tokens.kbq-typography-level-to-styles-css-variables(typography, text-normal);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BreakpointObserver } from '@angular/cdk/layout';
import { ChangeDetectionStrategy, Component, inject, InjectionToken, OnInit, signal } from '@angular/core';
import { ChangeDetectionStrategy, Component, computed, inject, InjectionToken } from '@angular/core';
import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
import { RouterLink } from '@angular/router';
import { kbqBreadcrumbsConfigurationProvider, KbqBreadcrumbsModule } from '@koobiq/components/breadcrumbs';
Expand All @@ -10,6 +10,7 @@ import { KbqIconModule } from '@koobiq/components/icon';
import { KbqOverflowItemsModule } from '@koobiq/components/overflow-items';
import { KbqToolTipModule } from '@koobiq/components/tooltip';
import { KbqTopBarModule } from '@koobiq/components/top-bar';
import { of } from 'rxjs';
import { map } from 'rxjs/operators';

interface ExampleLocalizedText {
Expand Down Expand Up @@ -223,15 +224,13 @@ export class ExampleTopBarBreadcrumbs {
`,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class TopBarBreadcrumbsAdaptiveExample implements OnInit {
protected readonly localeService = inject(KBQ_LOCALE_SERVICE, { optional: true });
export class TopBarBreadcrumbsAdaptiveExample {
protected readonly data = inject(ExampleLocalizedData);
protected readonly localeId = toSignal(inject(KBQ_LOCALE_SERVICE, { optional: true })?.changes || of(''));

protected readonly text = signal(this.data.default);
protected readonly text = computed(() => {
const localeId = this.localeId();

ngOnInit() {
if (this.localeService) {
this.localeService.changes.subscribe((id: string) => this.text.set(this.data[id] || this.data.default));
}
}
return (localeId && this.data[localeId]) || this.data.default;
});
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BreakpointObserver } from '@angular/cdk/layout';
import { ChangeDetectionStrategy, Component, inject, InjectionToken, OnInit, signal } from '@angular/core';
import { ChangeDetectionStrategy, Component, computed, inject, InjectionToken } from '@angular/core';
import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
import { KbqButtonModule, KbqButtonStyles } from '@koobiq/components/button';
import { KBQ_LOCALE_SERVICE, KbqComponentColors, KbqFormattersModule, PopUpPlacements } from '@koobiq/components/core';
Expand All @@ -8,6 +8,7 @@ import { KbqIconModule } from '@koobiq/components/icon';
import { KbqOverflowItemsModule } from '@koobiq/components/overflow-items';
import { KbqToolTipModule } from '@koobiq/components/tooltip';
import { KbqTopBarModule } from '@koobiq/components/top-bar';
import { of } from 'rxjs';
import { map } from 'rxjs/operators';

interface ExampleLocalizedText {
Expand Down Expand Up @@ -209,15 +210,13 @@ export class ExampleTopBar {
`,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class TopBarTitleCounterAdaptiveExample implements OnInit {
protected readonly localeService = inject(KBQ_LOCALE_SERVICE, { optional: true });
export class TopBarTitleCounterAdaptiveExample {
protected readonly data = inject(ExampleLocalizedData);
protected readonly localeId = toSignal(inject(KBQ_LOCALE_SERVICE, { optional: true })?.changes || of(''));

protected readonly text = signal(this.data.default);
protected readonly text = computed(() => {
const localeId = this.localeId();

ngOnInit() {
if (this.localeService) {
this.localeService.changes.subscribe((id: string) => this.text.set(this.data[id] || this.data.default));
}
}
return (localeId && this.data[localeId]) || this.data.default;
});
}
14 changes: 14 additions & 0 deletions packages/docs-examples/example-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3631,6 +3631,18 @@ export const EXAMPLE_COMPONENTS: {[id: string]: LiveExample} = {
"primaryFile": "timezone-trigger-overview-example.ts",
"importPath": "components/timezone"
},
"title-overview": {
"packagePath": "components/title/title-overview",
"title": "Title",
"componentName": "TitleOverviewExample",
"files": [
"title-overview-example.ts"
],
"selector": "title-overview-example",
"additionalComponents": [],
"primaryFile": "title-overview-example.ts",
"importPath": "components/title"
},
"toast-actions-overview": {
"packagePath": "components/toast/toast-actions-overview",
"title": "Toast actions",
Expand Down Expand Up @@ -4964,6 +4976,8 @@ return import('@koobiq/docs-examples/components/timezone');
return import('@koobiq/docs-examples/components/timezone');
case 'timezone-trigger-overview':
return import('@koobiq/docs-examples/components/timezone');
case 'title-overview':
return import('@koobiq/docs-examples/components/title');
case 'toast-actions-overview':
return import('@koobiq/docs-examples/components/toast');
case 'toast-hide-overview':
Expand Down