feat: add Checkbox component with styling and stories; update process resolver to include tags

This commit is contained in:
Lorenz Hilpert
2025-03-10 15:23:37 +01:00
parent 298ea042f2
commit ce4a6b36b6
9 changed files with 138 additions and 1 deletions

View File

@@ -1 +1,2 @@
export * from './lib/checkbox/checkbox.component';
export * from './lib/text-field/text-field.component';

View File

@@ -0,0 +1 @@
<ng-content select="input[type=checkbox]"></ng-content> <ng-icon name="isaActionCheck"></ng-icon>

View File

@@ -0,0 +1,52 @@
.ui-checkbox {
display: inline-flex;
padding: 0.75rem;
justify-content: center;
align-items: center;
font-size: 1.5rem;
position: relative;
@apply rounded-full bg-isa-neutral-300 size-12;
ng-icon {
@apply invisible size-6 text-isa-neutral-100;
}
input[type="checkbox"] {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
opacity: 0;
@apply cursor-pointer;
}
&:hover {
@apply bg-isa-neutral-400;
}
&:has(input[type="checkbox"]:checked) {
@apply bg-isa-neutral-700;
ng-icon {
@apply visible;
}
&:hover {
@apply bg-isa-neutral-800;
}
}
&:has(input[type="checkbox"]:disabled) {
@apply bg-isa-neutral-400 cursor-default;
&:has(input[type="checkbox"]:checked) {
@apply bg-isa-neutral-700;
}
input[type="checkbox"] {
@apply cursor-default;
}
}
}

View File

@@ -0,0 +1,17 @@
import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';
import { NgIconComponent, provideIcons } from '@ng-icons/core';
import { isaActionCheck } from '@isa/icons';
@Component({
selector: 'ui-checkbox',
templateUrl: './checkbox.component.html',
styleUrls: ['./checkbox.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
imports: [NgIconComponent],
providers: [provideIcons({ isaActionCheck })],
host: {
class: 'ui-checkbox',
},
})
export class CheckboxComponent {}