1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-21 10:43:35 +00:00

[CL-427] Add skeleton loading components to the CL (#16728)

This commit is contained in:
Vicki League
2025-10-16 09:36:16 -04:00
committed by GitHub
parent 96d40ae5c0
commit ba5c93fae2
14 changed files with 427 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
import { CommonModule } from "@angular/common";
import { Component, computed, input } from "@angular/core";
import { SkeletonComponent } from "./skeleton.component";
/**
* Specific skeleton component used to represent lines of text. It uses the `bit-skeleton`
* under the hood.
*
* Customize the number of lines represented with the `lines` input. Customize the width
* by applying a class to the `bit-skeleton-text` element (i.e. `tw-w-1/2`).
*/
@Component({
selector: "bit-skeleton-text",
templateUrl: "./skeleton-text.component.html",
imports: [CommonModule, SkeletonComponent],
host: {
class: "tw-block",
},
})
export class SkeletonTextComponent {
/**
* The number of text lines to display
*/
readonly lines = input<number>(1);
/**
* Array-transformed version of the `lines` to loop over
*/
protected linesArray = computed(() => [...Array(this.lines()).keys()]);
}