Skip to content
Merged
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
13 changes: 10 additions & 3 deletions docs/components-api/skeleton.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@

# ExtraSkeleton

> ✅ **Реализован**: `ExtraSkeletonComponent` (`@cdek-it/angular-ui-kit`) соответствует спецификации.

Плейсхолдер контента на момент загрузки.

| Свойство | Описание | Типизация |
| -------- | -------- | --------------------- |
| `shape` | форма | `rectangle \| circle` |
| Свойство | Описание | Типизация |
| -------------- | --------------------------------------------------------------------------- | --------------------- |
| `shape` | форма | `rectangle \| circle` |
| `animation` | тип анимации: волновой шиммер или без анимации | `wave \| none` |
| `width` | ширина элемента (CSS-значение); игнорируется при заданном `size` | `string` |
| `height` | высота элемента (CSS-значение); игнорируется при заданном `size` | `string` |
| `size` | размер элемента, задаёт ширину и высоту одновременно (для `shape="circle"`) | `string \| undefined` |
| `borderRadius` | скругление углов (CSS-значение), переопределяет значение темы | `string \| undefined` |
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const CardPlaceholder: StoryObj = {
language: 'ts',
code: `
import { Component } from '@angular/core';
import { SkeletonComponent } from '@cdek-it/angular-ui-kit';
import { ExtraSkeletonComponent } from '@cdek-it/angular-ui-kit';

@Component({
selector: 'app-skeleton-card-placeholder',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const Circle: StoryObj = {
language: 'ts',
code: `
import { Component } from '@angular/core';
import { SkeletonComponent } from '@cdek-it/angular-ui-kit';
import { ExtraSkeletonComponent } from '@cdek-it/angular-ui-kit';

@Component({
selector: 'app-skeleton-circle',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const NoAnimation: StoryObj = {
language: 'ts',
code: `
import { Component } from '@angular/core';
import { SkeletonComponent } from '@cdek-it/angular-ui-kit';
import { ExtraSkeletonComponent } from '@cdek-it/angular-ui-kit';

@Component({
selector: 'app-skeleton-no-animation',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
import { StoryObj } from '@storybook/angular';
import { ExtraSkeletonComponent } from '../../../../lib/components/skeleton/skeleton.component';

// Пунктирная рамка — границы контейнера: без неё верхняя строка выглядит просто длинной
// полосой, и не видно, что width по умолчанию равен 100% и считается от родителя.
const template = `
<div>
<div class="border border-dashed border-surface-200 p-4" style="width: 600px">
<div class="flex flex-col gap-3">
<extra-skeleton height="1rem"></extra-skeleton>
<extra-skeleton height="1rem" width="75%"></extra-skeleton>
Expand All @@ -30,24 +32,27 @@ export const Rectangles: StoryObj = {
parameters: {
docs: {
description: {
story: 'Прямоугольные строки-заглушки разной ширины — паттерн для списка отправлений или текстового контента.'
story:
'Прямоугольные строки-заглушки разной ширины — паттерн для списка отправлений или текстового контента. Пунктирная рамка показывает границы контейнера: `width` по умолчанию равен `100%` и считается от родителя, поэтому верхняя строка занимает его целиком, а следующие — 75% и 50% от той же ширины.'
},
source: {
language: 'ts',
code: `
import { Component } from '@angular/core';
import { SkeletonComponent } from '@cdek-it/angular-ui-kit';
import { ExtraSkeletonComponent } from '@cdek-it/angular-ui-kit';

@Component({
selector: 'app-skeleton-rectangles',
standalone: true,
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [ExtraSkeletonComponent],
template: \`
<div class="flex flex-col gap-3">
<extra-skeleton height="1rem"></extra-skeleton>
<extra-skeleton height="1rem" width="75%"></extra-skeleton>
<extra-skeleton height="1rem" width="50%"></extra-skeleton>
<div class="border border-dashed border-surface-200 p-4" style="width: 600px">
<div class="flex flex-col gap-3">
<extra-skeleton height="1rem"></extra-skeleton>
<extra-skeleton height="1rem" width="75%"></extra-skeleton>
<extra-skeleton height="1rem" width="50%"></extra-skeleton>
</div>
</div>
\`,
})
Expand Down
14 changes: 7 additions & 7 deletions src/stories/components/skeleton/skeleton.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const meta: Meta<SkeletonComponent> = {
component: `Заглушка для контента, пока данные загружаются. Поддерживает прямоугольную и круглую форму, а также волновую анимацию.

\`\`\`typescript
import { SkeletonComponent } from '@cdek-it/angular-ui-kit';
import { ExtraSkeletonComponent } from '@cdek-it/angular-ui-kit';
\`\`\``
}
},
Expand All @@ -39,7 +39,7 @@ import { SkeletonComponent } from '@cdek-it/angular-ui-kit';
options: ['rectangle', 'circle'],
description: 'Форма скелетона',
table: {
category: 'Props',
category: 'Свойства',
defaultValue: { summary: 'rectangle' },
type: { summary: "'rectangle' | 'circle'" }
}
Expand All @@ -49,7 +49,7 @@ import { SkeletonComponent } from '@cdek-it/angular-ui-kit';
options: ['wave', 'none'],
description: 'Тип анимации',
table: {
category: 'Props',
category: 'Свойства',
defaultValue: { summary: 'wave' },
type: { summary: "'wave' | 'none'" }
}
Expand All @@ -58,7 +58,7 @@ import { SkeletonComponent } from '@cdek-it/angular-ui-kit';
control: 'text',
description: 'Ширина элемента',
table: {
category: 'Props',
category: 'Свойства',
defaultValue: { summary: '100%' },
type: { summary: 'string' }
}
Expand All @@ -67,7 +67,7 @@ import { SkeletonComponent } from '@cdek-it/angular-ui-kit';
control: 'text',
description: 'Высота элемента',
table: {
category: 'Props',
category: 'Свойства',
defaultValue: { summary: '1rem' },
type: { summary: 'string' }
}
Expand All @@ -76,7 +76,7 @@ import { SkeletonComponent } from '@cdek-it/angular-ui-kit';
control: 'text',
description: 'Размер элемента (устанавливает ширину и высоту одновременно; используется для circle)',
table: {
category: 'Props',
category: 'Свойства',
defaultValue: { summary: 'undefined' },
type: { summary: 'string' }
}
Expand All @@ -85,7 +85,7 @@ import { SkeletonComponent } from '@cdek-it/angular-ui-kit';
control: 'text',
description: 'Скругление углов (переопределяет значение темы)',
table: {
category: 'Props',
category: 'Свойства',
defaultValue: { summary: 'undefined' },
type: { summary: 'string' }
}
Expand Down
Loading