Skip to content

feat(icons): new icons pack (#DS-2567) #86

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 29 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
219f436
feat(icon): new icons version added, added migration script,
NikGurev Sep 9, 2024
c975dbb
feat(icon): script fix
NikGurev Sep 9, 2024
bea2a0e
feat(icon): fixed tests
NikGurev Sep 9, 2024
7b39ec2
feat(chore): updated icons pack script without icons migration, updat…
NikGurev Sep 16, 2024
3bb4786
feat(chore): updated icons replacement config
NikGurev Sep 16, 2024
017d415
feat(chore): updated icons replacement config
NikGurev Sep 16, 2024
6788c1f
feat(chore): updated koobiq/icons version
NikGurev Sep 16, 2024
4f61f4d
feat(core): icons migration
NikGurev Sep 16, 2024
b2c7fbf
feat(chore): skip test for UX review
NikGurev Sep 16, 2024
cdac60f
feat(chore): updated icons pack prefixes
NikGurev Sep 17, 2024
febbf3c
fix(empty-state): changed button label
rmnturov Sep 17, 2024
58ce1f1
feat(docs): updated docs
NikGurev Sep 17, 2024
d6a0fdd
fix(empty-state): change icon (plus-s → plus)
rmnturov Sep 17, 2024
7d64e85
fix(navbar): changed icons in docs article
rmnturov Sep 17, 2024
8ff5239
feat(button): changed icon in docs (info-circle → plus)
rmnturov Sep 17, 2024
f6fa914
feat(docs): updated tokens values
NikGurev Sep 17, 2024
e55c909
feat(docs): changed missing icon text
NikGurev Sep 17, 2024
e997ac9
feat(alert): revert unnecessary changes
NikGurev Sep 17, 2024
c57d4ab
feat(chore): updated tokens version
NikGurev Sep 17, 2024
3b22fcf
fix(docs): delete mc alerts from tooltip article
rmnturov Sep 17, 2024
0441904
fix(docs): removed alert blocks from articles
rmnturov Sep 17, 2024
1a0a9b0
feat(docs): format tooltip.md
rmnturov Sep 17, 2024
9ba1a74
feat(docs): ux fixes applied
NikGurev Sep 17, 2024
c443a35
feat(docs): updated icon colors
NikGurev Sep 17, 2024
1f84858
fix(checkbox,form-field): fixed checkmark icon
NikGurev Sep 17, 2024
d27fb1c
fix(cli): replacement script re improved
NikGurev Sep 17, 2024
b895993
fix(docs,icon): updated text
NikGurev Sep 18, 2024
e1bb849
fix(docs,icon): updated link
NikGurev Sep 18, 2024
cbf6fc7
fix(chore): prettier fix
NikGurev Sep 23, 2024
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
2 changes: 1 addition & 1 deletion .stylelintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const config = {
{
ignoreFontFamilies: [
'Inter',
'PT Mosaic Icons',
'Koobiq Icons',
'JetBrains Mono'
]
}
Expand Down
4 changes: 2 additions & 2 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
"assets": [
{
"glob": "**/*",
"input": "node_modules/@koobiq/icons/dist/svg",
"input": "node_modules/@koobiq/icons/svg",
"output": "/assets/SVGIcons"
},
{
"glob": "**/*",
"input": "node_modules/@koobiq/icons/dist/info",
"input": "node_modules/@koobiq/icons/info",
"output": "/assets/SVGIcons"
},
{
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/src/app/components/copy-button/copy-button.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
kbq-link
pseudo
>
<i class="mc mc-check_16"></i>
<i class="kbq kbq-check_16"></i>
<span class="kbq-link__text">{{ successLabelText }}</span>
</span>
}
Expand All @@ -15,7 +15,7 @@
pseudo
>
<i
class="mc kbq-copy_16"
class="kbq kbq-square-multiple-o_16"
(click)="copyContent()"
></i>
</span>
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/src/app/components/footer/footer.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
>
<span>{{ selectedLanguages }}</span>
<i
kbq-icon="mc-angle-down-S_16"
kbq-icon="kbq-chevron-down-s_16"
[color]="'contrast'"
></i>
</div>
Expand Down Expand Up @@ -73,7 +73,7 @@
<span>.next</span>
}
<i
kbq-icon="mc-angle-down-S_16"
kbq-icon="kbq-chevron-down-s_16"
[color]="'contrast'"
></i>

Expand Down
10 changes: 5 additions & 5 deletions apps/docs/src/app/components/icons-items/icon-items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ export interface IconItem {
id: string;
name: string;
cssClass: string;
code: string;
code: number;
description: string;
size: number;
tags: string[];
tags: string | string[];
}

@Injectable()
Expand All @@ -17,18 +17,18 @@ export class IconItems {

constructor(ICONS) {
this.allIcons = Object.keys(ICONS).map((id) => {
const { code, tags, description } = ICONS[id];
const { codepoint, tags, description } = ICONS[id];

const size = parseInt(id.split('_')[1]);
this.sizes.add(size);

const cssClass = 'mc-'.concat(id);
const cssClass = 'kbq-'.concat(id);

let name = id.replace(/_\d+/, '').replace(/-/g, ' ');

name = name.charAt(0).toUpperCase() + name.slice(1);

return { id, name, cssClass, code, size, tags, description } as IconItem;
return { id, name, cssClass, code: parseInt(codepoint), size, tags, description } as IconItem;
});
}

Expand Down
6 changes: 3 additions & 3 deletions apps/docs/src/app/components/navbar/navbar.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
[kbqStyle]="'transparent'"
>
<i
kbq-icon="mc-theme_16"
kbq-icon="kbq-sun-moon_16"
[color]="'contrast'"
></i>
</button>
Expand All @@ -62,8 +62,8 @@
>
<i
kbq-icon=""
[class.mc-close-L_32]="opened"
[class.mc-hamburger_32]="!opened"
[class.kbq-bars-horizontal_32]="!opened"
[class.kbq-xmark_32]="opened"
[color]="'contrast'"
></i>
</button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<i kbq-icon="mc-cloud-404_256"></i>
<i kbq-icon="kbq-cloud-404_256"></i>

<div class="kbq-display-3">Страница не найдена</div>

Expand Down
4 changes: 2 additions & 2 deletions apps/docs/src/app/components/sidenav/sidenav.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
>
<span>{{ node.name }}</span>
<i
kbq-icon-button="mc-angle-down-S_16"
kbq-icon-button="kbq-chevron-down-s_16"
kbq-tree-node-toggle
class="docs-sidenav__category-icon"
[class.mc_collapsed]="!treeControl.isExpanded(node)"
[class.kbq_collapsed]="!treeControl.isExpanded(node)"
[style.visibility]="node.id === 'icons' ? 'hidden' : 'initial'"
></i>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<span class="kbq-link__text">StackBlitz</span>
<i kbq-icon="mc-external-link_16"></i>
<i kbq-icon="kbq-arrow-up-right-from-square_16"></i>
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export class IconPreviewModalComponent implements AfterViewInit {
KbqComponentColors.Contrast,
KbqComponentColors.ContrastFade,
KbqComponentColors.Error,
KbqComponentColors.Success
KbqComponentColors.Success,
KbqComponentColors.Warning
];

selectedColorTheme: KbqComponentColors | string = KbqComponentColors.Theme;
Expand All @@ -50,7 +51,7 @@ export class IconPreviewModalComponent implements AfterViewInit {
) {}

ngAfterViewInit(): void {
this.SVGLink = `assets/SVGIcons/${this.iconItem.cssClass}.svg`;
this.SVGLink = `assets/SVGIcons/${this.iconItem.id}.svg`;
}

onTagSelect(tag: string): void {
Expand Down Expand Up @@ -87,7 +88,12 @@ export class IconPreviewModalComponent implements AfterViewInit {
}

getCodeExampleText(): string {
return `<i kbq-icon="${this.iconItem.cssClass}"></i>`;
const color =
this.selectedColorTheme === KbqComponentColors.ContrastFade
? ''
: ` [color]="'${this.selectedColorTheme}'"`;

return `<i kbq-icon="${this.iconItem.cssClass}"${color}></i>`;
}

getUnicode(): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

.icon-preview-modal__description {
.icon-unicode {
font-family: 'PT Mosaic Icons';
font-family: 'Koobiq Icons';
}

.kbq-tag {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
(click)="modal.close()"
>
<i
kbq-icon="mc-close-L_16"
kbq-icon="kbq-xmark_16"
[color]="componentColors.Contrast"
></i>
</button>
Expand All @@ -30,7 +30,7 @@
>
<kbq-select-trigger>
<i
kbq-icon="mc-circle-8_16"
kbq-icon="kbq-circle-xs_16"
class="icon-preview-modal__palette-icon"
[color]="selectedColorTheme"
></i>
Expand All @@ -43,7 +43,7 @@
[value]="paletteName"
>
<i
kbq-icon="mc-circle-8_16"
kbq-icon="kbq-circle-xs_16"
class="icon-preview-modal__palette-icon"
[color]="paletteName"
></i>
Expand All @@ -59,15 +59,15 @@
href="{{ SVGLink }}"
kbq-button
>
<i kbq-icon="mc-download_16"></i>
<i kbq-icon="kbq-arrow-down-to-line_16"></i>
Скачать SVG
</a>

<button
kbq-button
(click)="copySVG()"
>
<i kbq-icon="mc-copy-o_16"></i>
<i kbq-icon="kbq-file-multiple-o_16"></i>
Скопировать SVG
</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,4 @@
.icon-preview-modal__description .kbq-badge {
@include typography.kbq-typography-level-to-styles($config, text-big);
}

.docs-icons-viewer__table-empty-results {
@include typography.kbq-typography-level-to-styles($config, display-3);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class IconsViewerComponent implements OnDestroy {
private changeDetectorRef: ChangeDetectorRef,
private elementRef: ElementRef
) {
this.http.get('assets/SVGIcons/mc-icons-info.json', { responseType: 'json' }).subscribe((data) => {
this.http.get('assets/SVGIcons/kbq-icons-info.json', { responseType: 'json' }).subscribe((data) => {
this.iconItems = new IconItems(data);

this.availableSizes = Array.from(this.iconItems.sizes).sort((a, b) => a - b);
Expand Down Expand Up @@ -91,7 +91,8 @@ export class IconsViewerComponent implements OnDestroy {
.filter(
(item) =>
item.name.toLowerCase().includes(lowered) ||
item.tags.some((tag) => tag.toLowerCase().includes(lowered))
(Array.isArray(item.tags) &&
item.tags.some((tag) => tag.toLowerCase().includes(lowered)))
);

return items.length ? items : undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { KbqBadgeModule } from '@koobiq/components/badge';
import { KbqButtonModule } from '@koobiq/components/button';
import { KbqHighlightModule } from '@koobiq/components/core';
import { KbqDlModule } from '@koobiq/components/dl';
import { KbqEmptyStateModule } from '@koobiq/components/empty-state';
import { KbqFormFieldModule } from '@koobiq/components/form-field';
import { KbqIconModule } from '@koobiq/components/icon';
import { KbqInputModule } from '@koobiq/components/input';
Expand Down Expand Up @@ -44,6 +45,7 @@ import { IconsViewerComponent } from './icons-viewer.component';
NavbarModule,
KbqButtonModule,
AnchorsModule,
KbqEmptyStateModule,
NgClass,
AsyncPipe,
TitleCasePipe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<kbq-form-field>
<i
kbq-icon="mc-search_16"
kbq-icon="kbq-magnifying-glass_16"
kbqPrefix
[color]="themePalette.Secondary"
></i>
Expand Down Expand Up @@ -53,6 +53,10 @@
}

@if (searchControl.value && !filteredIcons.value) {
<div class="docs-icons-viewer__table-empty-results">Ничего не найдено</div>
<div class="docs-icons-viewer__table-empty-results">
<kbq-empty-state [big]="true">
<div kbq-empty-state-title>Ничего не найдено</div>
</kbq-empty-state>
</div>
}
</div>
4 changes: 2 additions & 2 deletions apps/docs/src/assets/stackblitz/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
"@angular/router": "^17.2.0",
"@koobiq/cdk": "${version}",
"@koobiq/components": "${version}",
"@koobiq/icons": "^7.1.0",
"@koobiq/icons": "^9.0.0",
"@koobiq/angular-luxon-adapter": "${version}",
"@koobiq/angular-moment-adapter": "${version}",
"@koobiq/date-adapter": "^3.1.2",
"@koobiq/moment-date-adapter": "^3.1.2",
"@koobiq/luxon-date-adapter": "^3.1.2",
"@koobiq/date-formatter": "^3.1.2",
"@koobiq/design-tokens": "3.5.1",
"@koobiq/design-tokens": "^3.6.0",
"marked": "^9.0.0",
"@messageformat/core": "^3.0.0",
"moment": "~2.29.2",
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/assets/stackblitz/src/styles.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import '@koobiq/components/prebuilt-themes/light-theme.css';
@import '@koobiq/icons/dist/fonts/mc-icons';
@import '@koobiq/icons/fonts/kbq-icons';

body {
font-family: Roboto, Arial, sans-serif;
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/main.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@use '@koobiq/icons/dist/fonts/mc-icons';
@use '@koobiq/icons/fonts/kbq-icons';

@use 'highlightjs/material-dark' as *;
@use 'highlightjs/material-light' as *;
Expand Down
14 changes: 7 additions & 7 deletions apps/docs/src/styles/_docsearch.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

@use '@docsearch/css/dist/style.scss';
@use 'koobiq/default-theme/variables' as *;
@use '@koobiq/icons/dist/fonts/mc-icons';
@use '@koobiq/icons/fonts/kbq-icons';

.DocSearch-Button {
padding: 0 $button-size-horizontal-padding;
Expand Down Expand Up @@ -32,8 +32,8 @@
}

.DocSearch-Button-Container::before {
@extend .mc;
@extend .mc-search_16;
@extend .kbq;
@extend .kbq-magnifying-glass_16;

@media (width <= 768px) {
font-size: 20px;
Expand Down Expand Up @@ -67,8 +67,8 @@
}

.DocSearch-MagnifierLabel::before {
@extend .mc;
@extend .mc-search_16;
@extend .kbq;
@extend .kbq-magnifying-glass_16;

color: $light-icon-contrast-fade;
}
Expand All @@ -87,8 +87,8 @@
}

.DocSearch-Reset::before {
@extend .mc;
@extend .mc-close-circle_16;
@extend .kbq;
@extend .kbq-xmark-circle_16;
}

.DocSearch-Reset:hover {
Expand Down
Loading