-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(new-hope): Cell web, b2c and docs
- Loading branch information
Showing
28 changed files
with
865 additions
and
162 deletions.
There are no files selected for viewing
Binary file added
BIN
+19.6 KB
...ents/Cell/Cell.component-test.tsx/plasma-new-hope Cell Styled -- _size.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.32 KB
...ts/Cell/Cell.component-test.tsx/plasma-new-hope Cell Styled -- default.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+19.3 KB
...ents/Cell/Cell.component-test.tsx/plasma-new-hope Cell Styled -- _size.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.24 KB
...ts/Cell/Cell.component-test.tsx/plasma-new-hope Cell Styled -- default.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion
1
packages/plasma-b2c/src/components/Cell/Cell.component-test.tsx
This file was deleted.
Oops, something went wrong.
81 changes: 81 additions & 0 deletions
81
packages/plasma-b2c/src/components/Cell/Cell.component-test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import React from 'react'; | ||
import { mount, CypressTestDecorator, getComponent, SpaceMe } from '@salutejs/plasma-cy-utils'; | ||
import { createGlobalStyle } from 'styled-components'; | ||
import { standard as standardTypo } from '@salutejs/plasma-typo'; | ||
import type { FC, PropsWithChildren } from 'react'; | ||
import { IconChevronRight } from '@salutejs/plasma-icons'; | ||
|
||
const StandardTypoStyle = createGlobalStyle(standardTypo); | ||
|
||
describe('plasma-new-hope: Cell Styled', () => { | ||
const Cell = getComponent('Cell'); | ||
const Avatar = getComponent('Avatar'); | ||
|
||
const CypressTestDecoratorWithTypo: FC<PropsWithChildren> = ({ children }) => ( | ||
<CypressTestDecorator> | ||
<StandardTypoStyle /> | ||
{children} | ||
</CypressTestDecorator> | ||
); | ||
|
||
it('default', () => { | ||
mount( | ||
<CypressTestDecoratorWithTypo> | ||
<Cell | ||
size="m" | ||
contentLeft={<Avatar size="m" name="Иван Фадеев" />} | ||
contentRight={<IconChevronRight color="inheart" size="xs" />} | ||
title="Title" | ||
subtitle="Subtitle" | ||
label="Label" | ||
/> | ||
</CypressTestDecoratorWithTypo>, | ||
); | ||
|
||
cy.matchImageSnapshot(); | ||
}); | ||
|
||
it('_size', () => { | ||
mount( | ||
<CypressTestDecoratorWithTypo> | ||
<Cell | ||
size="l" | ||
contentLeft={<Avatar size="l" name="Иван Фадеев" />} | ||
contentRight={<IconChevronRight color="inheart" size="xs" />} | ||
title="Title" | ||
subtitle="Subtitle" | ||
label="Label" | ||
/> | ||
<SpaceMe /> | ||
<Cell | ||
size="m" | ||
contentLeft={<Avatar size="m" name="Иван Фадеев" />} | ||
contentRight={<IconChevronRight color="inheart" size="xs" />} | ||
title="Title" | ||
subtitle="Subtitle" | ||
label="Label" | ||
/> | ||
<SpaceMe /> | ||
<Cell | ||
size="s" | ||
contentLeft={<Avatar size="s" name="Иван Фадеев" />} | ||
contentRight={<IconChevronRight color="inheart" size="xs" />} | ||
title="Title" | ||
subtitle="Subtitle" | ||
label="Label" | ||
/> | ||
<SpaceMe /> | ||
<Cell | ||
size="xs" | ||
contentLeft={<Avatar size="s" name="Иван Фадеев" />} | ||
contentRight={<IconChevronRight color="inheart" size="xs" />} | ||
title="Title" | ||
subtitle="Subtitle" | ||
label="Label" | ||
/> | ||
</CypressTestDecoratorWithTypo>, | ||
); | ||
|
||
cy.matchImageSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
import { css, cellTokens } from '@salutejs/plasma-new-hope/styled-components'; | ||
|
||
export const config = { | ||
defaults: { | ||
view: 'primary', | ||
size: 'm', | ||
}, | ||
variations: { | ||
view: { | ||
default: css` | ||
${cellTokens.cellColor}: var(--text-primary); | ||
${cellTokens.cellLabelColor}: var(--text-secondary); | ||
${cellTokens.cellTitleColor}: var(--text-primary); | ||
${cellTokens.cellSubtitleColor}: var(--text-secondary); | ||
${cellTokens.cellBackgroundColor}: transparent; | ||
`, | ||
}, | ||
size: { | ||
l: css` | ||
${cellTokens.cellWidth}: 15rem; | ||
${cellTokens.cellPadding}: 0rem; | ||
${cellTokens.cellPaddingLeftContent}: 0rem; | ||
${cellTokens.cellPaddingContent}: 0rem; | ||
${cellTokens.cellPaddingRightContent}: 0rem; | ||
${cellTokens.cellTextboxGap}: 0.125rem; | ||
${cellTokens.cellLabelFontFamily}: var(--plasma-typo-body-m-font-family); | ||
${cellTokens.cellLabelFontSize}: var(--plasma-typo-body-m-font-size); | ||
${cellTokens.cellLabelFontStyle}: var(--plasma-typo-body-m-font-style); | ||
${cellTokens.cellLabelFontWeight}: var(--plasma-typo-body-m-bold-font-weight); | ||
${cellTokens.cellLabelLetterSpacing}: var(--plasma-typo-body-m-letter-spacing); | ||
${cellTokens.cellLabelLineHeight}: var(--plasma-typo-body-m-line-height); | ||
${cellTokens.cellTitleFontFamily}: var(--plasma-typo-body-l-font-family); | ||
${cellTokens.cellTitleFontSize}: var(--plasma-typo-body-l-font-size); | ||
${cellTokens.cellTitleFontStyle}: var(--plasma-typo-body-l-font-style); | ||
${cellTokens.cellTitleFontWeight}: var(--plasma-typo-body-l-bold-font-weight); | ||
${cellTokens.cellTitleLetterSpacing}: var(--plasma-typo-body-l-letter-spacing); | ||
${cellTokens.cellTitleLineHeight}: var(--plasma-typo-body-l-line-height); | ||
${cellTokens.cellSubtitleFontFamily}: var(--plasma-typo-body-m-font-family); | ||
${cellTokens.cellSubtitleFontSize}: var(--plasma-typo-body-m-font-size); | ||
${cellTokens.cellSubtitleFontStyle}: var(--plasma-typo-body-m-font-style); | ||
${cellTokens.cellSubtitleFontWeight}: var(--plasma-typo-body-m-bold-font-weight); | ||
${cellTokens.cellSubtitleLetterSpacing}: var(--plasma-typo-body-m-letter-spacing); | ||
${cellTokens.cellSubtitleLineHeight}: var(--plasma-typo-body-m-line-height); | ||
`, | ||
m: css` | ||
${cellTokens.cellWidth}: 15rem; | ||
${cellTokens.cellPadding}: 0rem; | ||
${cellTokens.cellPaddingLeftContent}: 0rem; | ||
${cellTokens.cellPaddingContent}: 0rem; | ||
${cellTokens.cellPaddingRightContent}: 0rem; | ||
${cellTokens.cellTextboxGap}: 0.125rem; | ||
${cellTokens.cellLabelFontFamily}: var(--plasma-typo-body-s-font-family); | ||
${cellTokens.cellLabelFontSize}: var(--plasma-typo-body-s-font-size); | ||
${cellTokens.cellLabelFontStyle}: var(--plasma-typo-body-s-font-style); | ||
${cellTokens.cellLabelFontWeight}: var(--plasma-typo-body-s-bold-font-weight); | ||
${cellTokens.cellLabelLetterSpacing}: var(--plasma-typo-body-s-letter-spacing); | ||
${cellTokens.cellLabelLineHeight}: var(--plasma-typo-body-s-line-height); | ||
${cellTokens.cellTitleFontFamily}: var(--plasma-typo-body-m-font-family); | ||
${cellTokens.cellTitleFontSize}: var(--plasma-typo-body-m-font-size); | ||
${cellTokens.cellTitleFontStyle}: var(--plasma-typo-body-m-font-style); | ||
${cellTokens.cellTitleFontWeight}: var(--plasma-typo-body-m-bold-font-weight); | ||
${cellTokens.cellTitleLetterSpacing}: var(--plasma-typo-body-m-letter-spacing); | ||
${cellTokens.cellTitleLineHeight}: var(--plasma-typo-body-m-line-height); | ||
${cellTokens.cellSubtitleFontFamily}: var(--plasma-typo-body-s-font-family); | ||
${cellTokens.cellSubtitleFontSize}: var(--plasma-typo-body-s-font-size); | ||
${cellTokens.cellSubtitleFontStyle}: var(--plasma-typo-body-s-font-style); | ||
${cellTokens.cellSubtitleFontWeight}: var(--plasma-typo-body-s-bold-font-weight); | ||
${cellTokens.cellSubtitleLetterSpacing}: var(--plasma-typo-body-s-letter-spacing); | ||
${cellTokens.cellSubtitleLineHeight}: var(--plasma-typo-body-s-line-height); | ||
`, | ||
s: css` | ||
${cellTokens.cellWidth}: 15rem; | ||
${cellTokens.cellPadding}: 0rem; | ||
${cellTokens.cellPaddingLeftContent}: 0rem; | ||
${cellTokens.cellPaddingContent}: 0rem; | ||
${cellTokens.cellPaddingRightContent}: 0rem; | ||
${cellTokens.cellTextboxGap}: 0.125rem; | ||
${cellTokens.cellLabelFontFamily}: var(--plasma-typo-body-xs-font-family); | ||
${cellTokens.cellLabelFontSize}: var(--plasma-typo-body-xs-font-size); | ||
${cellTokens.cellLabelFontStyle}: var(--plasma-typo-body-xs-font-style); | ||
${cellTokens.cellLabelFontWeight}: var(--plasma-typo-body-xs-bold-font-weight); | ||
${cellTokens.cellLabelLetterSpacing}: var(--plasma-typo-body-xs-letter-spacing); | ||
${cellTokens.cellLabelLineHeight}: var(--plasma-typo-body-xs-line-height); | ||
${cellTokens.cellTitleFontFamily}: var(--plasma-typo-body-s-font-family); | ||
${cellTokens.cellTitleFontSize}: var(--plasma-typo-body-s-font-size); | ||
${cellTokens.cellTitleFontStyle}: var(--plasma-typo-body-s-font-style); | ||
${cellTokens.cellTitleFontWeight}: var(--plasma-typo-body-s-bold-font-weight); | ||
${cellTokens.cellTitleLetterSpacing}: var(--plasma-typo-body-s-letter-spacing); | ||
${cellTokens.cellTitleLineHeight}: var(--plasma-typo-body-s-line-height); | ||
${cellTokens.cellSubtitleFontFamily}: var(--plasma-typo-body-xs-font-family); | ||
${cellTokens.cellSubtitleFontSize}: var(--plasma-typo-body-xs-font-size); | ||
${cellTokens.cellSubtitleFontStyle}: var(--plasma-typo-body-xs-font-style); | ||
${cellTokens.cellSubtitleFontWeight}: var(--plasma-typo-body-xs-bold-font-weight); | ||
${cellTokens.cellSubtitleLetterSpacing}: var(--plasma-typo-body-xs-letter-spacing); | ||
${cellTokens.cellSubtitleLineHeight}: var(--plasma-typo-body-xs-line-height); | ||
`, | ||
xs: css` | ||
${cellTokens.cellWidth}: 15rem; | ||
${cellTokens.cellPadding}: 0rem; | ||
${cellTokens.cellPaddingLeftContent}: 0rem; | ||
${cellTokens.cellPaddingContent}: 0rem; | ||
${cellTokens.cellPaddingRightContent}: 0rem; | ||
${cellTokens.cellTextboxGap}: 0.125rem; | ||
${cellTokens.cellLabelFontFamily}: var(--plasma-typo-body-xs-font-family); | ||
${cellTokens.cellLabelFontSize}: var(--plasma-typo-body-xs-font-size); | ||
${cellTokens.cellLabelFontStyle}: var(--plasma-typo-body-xs-font-style); | ||
${cellTokens.cellLabelFontWeight}: var(--plasma-typo-body-xs-bold-font-weight); | ||
${cellTokens.cellLabelLetterSpacing}: var(--plasma-typo-body-xs-letter-spacing); | ||
${cellTokens.cellLabelLineHeight}: var(--plasma-typo-body-xs-line-height); | ||
${cellTokens.cellTitleFontFamily}: var(--plasma-typo-body-xs-font-family); | ||
${cellTokens.cellTitleFontSize}: var(--plasma-typo-body-xs-font-size); | ||
${cellTokens.cellTitleFontStyle}: var(--plasma-typo-body-xs-font-style); | ||
${cellTokens.cellTitleFontWeight}: var(--plasma-typo-body-xs-bold-font-weight); | ||
${cellTokens.cellTitleLetterSpacing}: var(--plasma-typo-body-xs-letter-spacing); | ||
${cellTokens.cellTitleLineHeight}: var(--plasma-typo-body-xs-line-height); | ||
${cellTokens.cellSubtitleFontFamily}: var(--plasma-typo-body-xs-font-family); | ||
${cellTokens.cellSubtitleFontSize}: var(--plasma-typo-body-xs-font-size); | ||
${cellTokens.cellSubtitleFontStyle}: var(--plasma-typo-body-xs-font-style); | ||
${cellTokens.cellSubtitleFontWeight}: var(--plasma-typo-body-xs-bold-font-weight); | ||
${cellTokens.cellSubtitleLetterSpacing}: var(--plasma-typo-body-xs-letter-spacing); | ||
${cellTokens.cellSubtitleLineHeight}: var(--plasma-typo-body-xs-line-height); | ||
`, | ||
}, | ||
stretching: { | ||
auto: css``, | ||
filled: css``, | ||
}, | ||
}, | ||
}; |
Oops, something went wrong.