Skip to content
Snippets Groups Projects
Commit 1ee110ac authored by OZGCloud's avatar OZGCloud
Browse files

OZG-5600-OZG-5715 Fix darkmode colors

- Add class prop to ods-button and ods-button-with-spinner
- Replace html buttons in wizard to ods-buttons
parent bda2e31e
No related branches found
No related tags found
No related merge requests found
Showing
with 21 additions and 10 deletions
...@@ -15,6 +15,7 @@ type ButtonVariants = VariantProps<typeof buttonVariants>; ...@@ -15,6 +15,7 @@ type ButtonVariants = VariantProps<typeof buttonVariants>;
template: `<ods-button template: `<ods-button
[text]="text" [text]="text"
[type]="type" [type]="type"
[class]="class"
[size]="size" [size]="size"
[dataTestId]="dataTestId" [dataTestId]="dataTestId"
[isLoading]="isLoading" [isLoading]="isLoading"
...@@ -25,6 +26,7 @@ type ButtonVariants = VariantProps<typeof buttonVariants>; ...@@ -25,6 +26,7 @@ type ButtonVariants = VariantProps<typeof buttonVariants>;
export class ButtonWithSpinnerComponent implements OnInit { export class ButtonWithSpinnerComponent implements OnInit {
@Input() text: string = ''; @Input() text: string = '';
@Input() dataTestId: string = ''; @Input() dataTestId: string = '';
@Input() class: string = '';
@Input() stateResource: StateResource<Resource>; @Input() stateResource: StateResource<Resource>;
@Input() type: ButtonVariants['type'] = 'primary'; @Input() type: ButtonVariants['type'] = 'primary';
@Input() size: ButtonVariants['size'] = 'medium'; @Input() size: ButtonVariants['size'] = 'medium';
......
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { Component, EventEmitter, Input, Output } from '@angular/core'; import { Component, EventEmitter, Input, Output } from '@angular/core';
import { VariantProps, cva } from 'class-variance-authority'; import { VariantProps, cva } from 'class-variance-authority';
import { twMerge } from 'tailwind-merge';
import { SpinnerIconComponent } from '../icons/spinner-icon/spinner-icon.component'; import { SpinnerIconComponent } from '../icons/spinner-icon/spinner-icon.component';
...@@ -30,8 +31,9 @@ type ButtonVariants = VariantProps<typeof buttonVariants>; ...@@ -30,8 +31,9 @@ type ButtonVariants = VariantProps<typeof buttonVariants>;
standalone: true, standalone: true,
imports: [CommonModule, SpinnerIconComponent], imports: [CommonModule, SpinnerIconComponent],
template: `<button template: `<button
[class]="class"
type="button" type="button"
[ngClass]="buttonVariants({ size, type })" [ngClass]="twMerge(buttonVariants({ size, type }), class)"
[disabled]="isLoading" [disabled]="isLoading"
[attr.aria-disabled]="isLoading" [attr.aria-disabled]="isLoading"
[attr.aria-label]="text" [attr.aria-label]="text"
...@@ -46,6 +48,7 @@ type ButtonVariants = VariantProps<typeof buttonVariants>; ...@@ -46,6 +48,7 @@ type ButtonVariants = VariantProps<typeof buttonVariants>;
export class ButtonComponent { export class ButtonComponent {
@Input() text: string = ''; @Input() text: string = '';
@Input() dataTestId: string = ''; @Input() dataTestId: string = '';
@Input() class: string = '';
@Input() isLoading: boolean = false; @Input() isLoading: boolean = false;
@Input() type: ButtonVariants['type'] = 'primary'; @Input() type: ButtonVariants['type'] = 'primary';
@Input() size: ButtonVariants['size'] = 'medium'; @Input() size: ButtonVariants['size'] = 'medium';
...@@ -53,4 +56,5 @@ export class ButtonComponent { ...@@ -53,4 +56,5 @@ export class ButtonComponent {
@Output() public clickEmitter: EventEmitter<MouseEvent> = new EventEmitter<MouseEvent>(); @Output() public clickEmitter: EventEmitter<MouseEvent> = new EventEmitter<MouseEvent>();
buttonVariants = buttonVariants; buttonVariants = buttonVariants;
twMerge = twMerge;
} }
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
--color-pdf: 4 62% 63%; --color-pdf: 4 62% 63%;
--color-doc: 219 63% 54%; --color-doc: 219 63% 54%;
--color-modal-bg: 0 0% 100%;
} }
.dark { .dark {
...@@ -57,6 +59,8 @@ ...@@ -57,6 +59,8 @@
--color-pdf: 4 62% 63%; --color-pdf: 4 62% 63%;
--color-doc: 219 63% 54%; --color-doc: 219 63% 54%;
--color-modal-bg: 0 0% 26%;
} }
.bescheid-dialog-backdrop { .bescheid-dialog-backdrop {
......
...@@ -85,6 +85,7 @@ module.exports = { ...@@ -85,6 +85,7 @@ module.exports = {
DEFAULT: 'hsl(var(--color-doc) / <alpha-value>)', DEFAULT: 'hsl(var(--color-doc) / <alpha-value>)',
}, },
mainbg: 'hsl(var(--color-mainbg) / <alpha-value>)', mainbg: 'hsl(var(--color-mainbg) / <alpha-value>)',
modalBg: 'hsl(var(--color-modal-bg) / <alpha-value>)',
primary: { primary: {
600: 'hsl(var(--color-primary-600) / <alpha-value>)', 600: 'hsl(var(--color-primary-600) / <alpha-value>)',
DEFAULT: 'hsl(var(--color-primary-600) / <alpha-value>)', DEFAULT: 'hsl(var(--color-primary-600) / <alpha-value>)',
......
<div class="relative m-6 max-w-2xl rounded-lg bg-white p-6 shadow-xl"> <div class="relative m-6 max-w-2xl rounded-lg bg-modalBg p-6 shadow-xl">
<div class="flex flex-col gap-6"> <div class="flex flex-col gap-6">
<div> <div>
<h4 class="text-lg font-medium text-primary">Bescheiderstellung abbrechen</h4> <h4 class="text-lg font-medium text-primary">Bescheiderstellung abbrechen</h4>
......
<div <div
class="relative m-6 max-w-2xl rounded-lg bg-white p-6 shadow-xl" class="relative m-6 max-w-2xl rounded-lg bg-modalBg p-6 shadow-xl"
data-test-id="bescheid-ueberspringen-dialog" data-test-id="bescheid-ueberspringen-dialog"
> >
<button <button
......
<button <ods-button
*ngIf="showButton$ | async" *ngIf="showButton$ | async"
(click)="clickEmitter.emit($event)" (click)="clickEmitter.emit($event)"
type="button" text="Weiter"
class="mt-8 rounded-md bg-primary-600 px-8 py-2 text-sm text-white shadow-sm hover:bg-ozgblue-600 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ozgblue-800" class="mt-8 min-w-0 px-8"
data-test-id="bescheid-weiter-button" dataTestId="bescheid-weiter-button"
> />
Weiter
</button>
...@@ -55,6 +55,7 @@ import { ...@@ -55,6 +55,7 @@ import {
BescheidStatusTextComponent, BescheidStatusTextComponent,
BescheidUploadIconComponent, BescheidUploadIconComponent,
ButtonCardComponent, ButtonCardComponent,
ButtonComponent,
CloseIconComponent, CloseIconComponent,
RadioButtonCardComponent, RadioButtonCardComponent,
SaveIconComponent, SaveIconComponent,
...@@ -143,6 +144,7 @@ const routes: Routes = [ ...@@ -143,6 +144,7 @@ const routes: Routes = [
LoeschAnforderungSharedModule, LoeschAnforderungSharedModule,
BescheidModule, BescheidModule,
RadioButtonCardComponent, RadioButtonCardComponent,
ButtonComponent,
ButtonCardComponent, ButtonCardComponent,
CloseIconComponent, CloseIconComponent,
SaveIconComponent, SaveIconComponent,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment