Skip to content
Snippets Groups Projects
Select Git revision
  • 2d7c5948eab6340dfb06be11a375b079d7008515
  • main default protected
  • OZG-7985-anfrage-von-landesebene
  • release
  • OZG-8252-gitlab-pipeline
  • OZG-7774-E2E
  • OZG-5120-PoC-Native-Image
  • 1.10.0
  • 1.9.0
  • 1.8.0
  • 1.7.0
  • 1.6.0
  • 1.5.0
  • 1.4.0
  • 1.3.0
  • 1.2.1
  • 1.2.0
  • 1.1.1
  • 1.1.0
  • 1.0.0
  • 0.8.0
  • 0.7.0
  • 0.6.0
  • 0.5.0
  • 0.4.0
  • 0.3.0
  • 0.2.0
27 results

FeaturesMapper.java

  • heading.component.ts 1.03 KiB
    import { TechSharedModule } from '@alfa-client/tech-shared';
    import { NgClass } from '@angular/common';
    import { Component, Input } from '@angular/core';
    import { VariantProps, cva } from 'class-variance-authority';
    import { twMerge } from 'tailwind-merge';
    
    export const headingVariants = cva('font-medium', {
      variants: {
        level: {
          '1': 'text-3xl pb-6',
          '2': 'text-2xl py-4',
        },
      },
      defaultVariants: {
        level: '1',
      },
    });
    type HeadingVariants = VariantProps<typeof headingVariants>;
    
    @Component({
      selector: 'ods-heading',
      standalone: true,
      imports: [NgClass, TechSharedModule],
      template: `<div
        role="heading"
        [attr.aria-level]="level"
        [ngClass]="twMerge(class, headingVariants({ level }))"
        [attr.data-test-id]="'heading-' + text | convertForDataTest"
      >
        {{ text }}
      </div>`,
    })
    export class HeadingComponent {
      @Input({ required: true }) text!: string;
      @Input() level: HeadingVariants['level'] = '1';
      @Input() class: string = '';
    
      headingVariants = headingVariants;
      twMerge = twMerge;
    }