Skip to content
Open
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
62 changes: 25 additions & 37 deletions src/lib/providers/prime-preset/tokens/components/chip.ts
Original file line number Diff line number Diff line change
@@ -1,45 +1,33 @@
/**
* Кастомная CSS-стилизация для компонента p-chip.
* Публикует extend-токены как CSS-переменные и применяет глобальные стили.
* Подключается в map-tokens.ts: `import { chipCss } from './components/chip'`
*/
export const chipCss = ({ dt }: { dt: (token: string) => string }): string => `
/* ─── Chip extend: публикуем кастомные переменные в :root ─── */
:root {
--p-chip-extend-border-color: ${dt('chip.extend.borderColor')};
--p-chip-extend-border-width: ${dt('chip.extend.borderWidth')};
}
.p-chip {
border: ${dt('chip.extend.borderWidth')} solid ${dt('chip.extend.borderColor')};
}

/* ─── Граница чипа ─── */
.p-chip {
border: var(--p-chip-extend-border-width) solid var(--p-chip-extend-border-color);
}
.p-chip-icon {
font-size: ${dt('chip.icon.size')};
}

/* ─── Типографика лейбла ─── */
.p-chip-label {
font-family: ${dt('fonts.fontFamily.base')};
font-size: ${dt('fonts.fontSize.300')};
font-weight: ${dt('fonts.fontWeight.regular')};
line-height: ${dt('fonts.lineHeight.400')};
}
.p-chip-label {
font-family: ${dt('fonts.fontFamily.base')};
font-size: ${dt('fonts.fontSize.200')};
font-weight: ${dt('fonts.fontWeight.regular')};
line-height: ${dt('fonts.lineHeight.none')};
}

/* ─── Сброс уменьшенного padding PrimeNG при наличии кнопки удаления ─── */
.p-chip:has(.p-chip-remove-icon) {
padding-inline-end: ${dt('chip.root.paddingX')};
}
.p-chip:has(.p-chip-remove-icon) {
padding-inline-end: ${dt('chip.root.paddingX')};
}

/* ─── Focus ring иконки удаления ─── */
.p-chip-remove-icon:focus-visible {
outline: ${dt('chip.removeIcon.focusRing.width')} solid ${dt('color.border.focus')};
}
.p-chip-remove-icon:focus-visible {
outline: ${dt('chip.removeIcon.focusRing.width')} solid ${dt('chip.removeIcon.focusRing.color')};
}

/* ─── Disabled состояние ─── */
.p-chip.p-disabled {
opacity: ${dt('effects.opacity.50')};
pointer-events: none;
}
.p-chip.p-disabled {
opacity: ${dt('effects.opacity.50')};
pointer-events: none;
}

.p-chip.p-disabled .p-chip-remove-icon {
pointer-events: none;
}
.p-chip.p-disabled .p-chip-remove-icon {
pointer-events: none;
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
import { ExtraChipComponent } from '../../../../lib/components/chip/chip.component';

const template = `
<div class="bg-surface-ground">
<div>
<extra-chip label="Доставлен" icon="ti ti-check" [removable]="true" [disabled]="true"></extra-chip>
</div>
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
import { ExtraChipComponent } from '../../../../lib/components/chip/chip.component';

const template = `
<div class="bg-surface-ground">
<div>
<extra-chip label="Задержан" icon="ti ti-alert-triangle" [removable]="true"></extra-chip>
</div>
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
import { ExtraChipComponent } from '../../../../lib/components/chip/chip.component';

const template = `
<div class="bg-surface-ground">
<div>
<extra-chip label="Хрупкий груз" [removable]="true"></extra-chip>
</div>
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
import { ExtraChipComponent } from '../../../../lib/components/chip/chip.component';

const template = `
<div class="bg-surface-ground">
<div>
<extra-chip label="В пути" icon="ti ti-map-pin"></extra-chip>
</div>
`;
Expand Down
Loading