Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(layout): CardLarge with headless Cell list #9114

Merged
merged 1 commit into from
Sep 23, 2024
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<div
tuiCardLarge
tuiSurface="elevated"
>
<header tuiHeader>
<h1 tuiTitle>
Title
<span tuiSubtitle>Subtitle</span>
</h1>
</header>

<section>
<iframe
height="450"
loading="lazy"
src="https://yandex.ru/map-widget/v1/?um=constructor%3A0ff7188173ceeea1b3c1d5b2ebeaca63ceb70dc60ebc79513c51bb855356a6ac&amp;source=constructor"
title="map"
width="100%"
class="map"
></iframe>
</section>

<footer>
<button
appearance="secondary"
size="m"
tuiButton
type="button"
>
Label
</button>
</footer>
</div>
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {Component} from '@angular/core';
import {changeDetection} from '@demo/emulate/change-detection';
import {encapsulation} from '@demo/emulate/encapsulation';
import {TuiButton, TuiSurface} from '@taiga-ui/core';
import {TuiCardLarge, TuiHeader} from '@taiga-ui/layout';

@Component({
standalone: true,
imports: [TuiButton, TuiCardLarge, TuiHeader, TuiSurface],
templateUrl: './index.html',
encapsulation,
changeDetection,
})
export default class Example {}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
tuiCardLarge
tuiSurface="elevated"
>
<header tuiHeader>
<h2 tuiTitle>Title</h2>
</header>

<div tuiCell>
<div
*tuiRepeatTimes="let index of 3"
tuiCell="l"
>
<tui-avatar
appearance="primary"
src="@tui.star"
Expand All @@ -16,36 +15,28 @@ <h2 tuiTitle>Title</h2>
<div tuiSubtitle>Description</div>
</div>
</div>

<footer>
<button
appearance="secondary"
size="m"
tuiButton
type="button"
>
Label
</button>
</footer>
</div>

<div
tuiCardLarge
tuiSurface="elevated"
>
<header tuiHeader>
<h2 tuiTitle>Title</h2>
</header>

Some text

<footer>
<button
appearance="secondary"
size="m"
tuiButton
type="button"
>
Label
</button>
</footer>
<div tuiCell="l">
<tui-avatar
appearance="primary"
src="@tui.star"
/>
<div tuiTitle>
Title
<div tuiSubtitle>Description</div>
</div>
</div>
<button
appearance="secondary"
size="m"
tuiButton
type="button"
>
Label
</button>
</div>
Original file line number Diff line number Diff line change
@@ -1,6 +0,0 @@
:host {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1rem;
inline-size: 30rem;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {Component} from '@angular/core';
import {changeDetection} from '@demo/emulate/change-detection';
import {encapsulation} from '@demo/emulate/encapsulation';
import {TuiButton, TuiSurface, TuiTitle} from '@taiga-ui/core';
import {TuiRepeatTimes} from '@taiga-ui/cdk';
import {TuiButton, TuiSurface} from '@taiga-ui/core';
import {TuiAvatar} from '@taiga-ui/kit';
import {TuiCardLarge, TuiCell, TuiHeader} from '@taiga-ui/layout';

Expand All @@ -13,11 +14,11 @@ import {TuiCardLarge, TuiCell, TuiHeader} from '@taiga-ui/layout';
TuiCardLarge,
TuiCell,
TuiHeader,
TuiRepeatTimes,
TuiSurface,
TuiTitle,
],
templateUrl: './index.html',
styleUrls: ['./index.less'],
styles: [':host { display: flex; flex-direction: column; gap: 2rem}'],
encapsulation,
changeDetection,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,40 @@
tuiSurface="elevated"
>
<header tuiHeader>
<h1 tuiTitle>
<h2 tuiTitle>Title</h2>
</header>

<div tuiCell>
<tui-avatar
appearance="primary"
src="@tui.star"
/>
<div tuiTitle>
Title
<span tuiSubtitle>Subtitle</span>
</h1>
<div tuiSubtitle>Description</div>
</div>
</div>

<footer>
<button
appearance="secondary"
size="m"
tuiButton
type="button"
>
Label
</button>
</footer>
</div>
<div
tuiCardLarge
tuiSurface="elevated"
>
<header tuiHeader>
<h2 tuiTitle>Title</h2>
</header>

<section>
<iframe
height="450"
loading="lazy"
src="https://yandex.ru/map-widget/v1/?um=constructor%3A0ff7188173ceeea1b3c1d5b2ebeaca63ceb70dc60ebc79513c51bb855356a6ac&amp;source=constructor"
title="map"
width="100%"
class="map"
></iframe>
</section>
Some text

<footer>
<button
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
:host {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1rem;
inline-size: 30rem;
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
import {Component} from '@angular/core';
import {changeDetection} from '@demo/emulate/change-detection';
import {encapsulation} from '@demo/emulate/encapsulation';
import {TuiButton, TuiSurface} from '@taiga-ui/core';
import {TuiCardLarge, TuiHeader} from '@taiga-ui/layout';
import {TuiButton, TuiSurface, TuiTitle} from '@taiga-ui/core';
import {TuiAvatar} from '@taiga-ui/kit';
import {TuiCardLarge, TuiCell, TuiHeader} from '@taiga-ui/layout';

@Component({
standalone: true,
imports: [TuiButton, TuiCardLarge, TuiHeader, TuiSurface],
imports: [
TuiAvatar,
TuiButton,
TuiCardLarge,
TuiCell,
TuiHeader,
TuiSurface,
TuiTitle,
],
templateUrl: './index.html',
styleUrls: ['./index.less'],
encapsulation,
changeDetection,
})
Expand Down
3 changes: 2 additions & 1 deletion projects/demo/src/modules/components/card-large/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ export default class Example {
'Cell List',
'Cell List (2 columns)',
'Cell List (actions)',
'Cell List (headless)',
'Footer alignment',
'Map',
'Image',
'Image-dark',
'Paddings and radii',
'Map',
];
}
4 changes: 4 additions & 0 deletions projects/layout/components/card/card.styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@
padding: 0.5rem;
margin: -0.5rem -0.5rem -0.75rem;
border-radius: var(--tui-radius-l);

&:last-of-type {
margin-bottom: -0.5rem;
}
}

> [tuiLink]:last-child {
Expand Down
Loading