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

feat(Card): add mode plain #7824

Merged
merged 8 commits into from
Nov 5, 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
Expand Up @@ -12,7 +12,7 @@ export const CardPlayground = (props: ComponentPlaygroundProps): React.ReactNode
{...props}
propSets={[
{
mode: ['tint', 'shadow', 'outline', 'outline-tint'],
mode: ['tint', 'shadow', 'outline', 'outline-tint', 'plain'],
},
]}
>
Expand Down
5 changes: 3 additions & 2 deletions packages/vkui/src/components/Card/Card.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
0 2px 24px 0 rgba(0, 0, 0, 0.08),
0 0 2px 0 rgba(0, 0, 0, 0.08)
);
background: var(--vkui--color_background_contrast_themed);
}

.modeOutline {
.modeShadow,
.modeOutline,
.modePlain {
background: var(--vkui--color_background_contrast_themed);
}

Expand Down
3 changes: 2 additions & 1 deletion packages/vkui/src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { RootComponent } from '../RootComponent/RootComponent';
import styles from './Card.module.css';

export interface CardProps extends HTMLAttributesWithRootRef<HTMLDivElement>, HasComponent {
mode?: 'tint' | 'shadow' | 'outline' | 'outline-tint';
mode?: 'tint' | 'shadow' | 'outline' | 'outline-tint' | 'plain';
}

/**
Expand All @@ -24,6 +24,7 @@ export const Card = ({
styles.host,
mode === 'outline' && styles.modeOutline,
mode === 'shadow' && styles.modeShadow,
mode === 'plain' && styles.modePlain,
withBorder && styles.withBorder,
)}
/>
Expand Down
26 changes: 16 additions & 10 deletions packages/vkui/src/components/Card/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,39 @@
<Panel id="card">
<PanelHeader>Card</PanelHeader>
<Group>
<Group mode="plain" header={<Header size="s">Дефолтный стиль</Header>}>
<Group mode="plain" header={<Header size="s">Стандартный стиль</Header>}>
<CardGrid size="l">
<Card>
<div style={{ height: 96 }} />
</Card>
</CardGrid>
</Group>
<Group mode="plain" header={<Header size="s">С внутренней обводкой</Header>}>
<Group mode="plain" header={<Header size="s">Стандартный фон с обводкой</Header>}>
<CardGrid size="l">
<Card mode="outline">
<Card mode="outline-tint">
<div style={{ height: 96 }} />
</Card>
</CardGrid>
</Group>
<Group mode="plain" header={<Header size="s">С внешней тенью</Header>}>
</Group>
<Group style={{ background: 'var(--vkui--color_background_secondary)' }}>
<Group mode="plain" header={<Header size="s">Светлый фон без обводки и тени</Header>}>
<CardGrid size="l">
<Card mode="shadow">
<Card mode="plain">
<div style={{ height: 96 }} />
</Card>
</CardGrid>
</Group>
<Group
mode="plain"
header={<Header size="s">С внутренней обводкой и дефолтным фоном</Header>}
>
<Group mode="plain" header={<Header size="s">Светлый фон с обводкой</Header>}>
<CardGrid size="l">
<Card mode="outline-tint">
<Card mode="outline">
<div style={{ height: 96 }} />
</Card>
</CardGrid>
</Group>
<Group mode="plain" header={<Header size="s">Светлый фон с тенью</Header>}>
<CardGrid size="l">
<Card mode="shadow">
<div style={{ height: 96 }} />
</Card>
</CardGrid>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading