Skip to content

Commit ce82f9c

Browse files
authored
fix: feedback ui (#76)
1 parent eae00d6 commit ce82f9c

File tree

18 files changed

+81
-86
lines changed

18 files changed

+81
-86
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@eleven-labs/design-system",
33
"description": "Design System for Eleven Labs",
4-
"version": "0.31.0",
4+
"version": "0.32.0",
55
"repository": {
66
"type": "git",
77
"url": "https://github.com/eleven-labs/design-system.git"

src/components/Molecules/Cards/PostCard/PostCard.scss

Lines changed: 6 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
--background-color-post-card: white;
3131
--cover-size-square-mobile-post-card: 74px;
32-
--cover-size-square-desktop-post-card: 185px;
32+
--cover-size-square-desktop-post-card: 200px;
3333
--cover-height-horizontal-mobile-post-card: 130px;
3434
--cover-height-horizontal-medium-desktop-post-card: 175px;
3535
--cover-height-horizontal-large-desktop-post-card: 245px;
@@ -57,19 +57,6 @@
5757
@include cover-image-horizontal(var(--cover-height-horizontal-medium-desktop-post-card));
5858
}
5959
}
60-
61-
#{$this}__heading {
62-
-webkit-line-clamp: 3;
63-
}
64-
#{$this}__excerpt {
65-
-webkit-line-clamp: 4;
66-
}
67-
68-
@include create-media-queries('md') {
69-
#{$this}__heading {
70-
min-height: 6rem;
71-
}
72-
}
7360
}
7461

7562
&--highlight-dark {
@@ -90,19 +77,13 @@
9077
@include cover-image-horizontal(var(--cover-height-horizontal-large-desktop-post-card));
9178
}
9279
}
93-
94-
#{$this}__heading {
95-
-webkit-line-clamp: 3;
96-
min-height: 5.5rem;
97-
}
9880
}
9981

10082
&--side-image {
10183
flex-direction: row-reverse;
10284

10385
@include create-media-queries('md') {
10486
flex-direction: row;
105-
max-height: var(--cover-size-square-desktop-post-card);
10687
}
10788
#{$this}__cover {
10889
@include cover-image-square;
@@ -112,31 +93,13 @@
11293
}
11394
}
11495

115-
#{$this}__heading {
116-
-webkit-line-clamp: 2;
117-
118-
@include create-media-queries('md') {
119-
width: calc(100% - 55px);
96+
&#{$this}--with-tutorial {
97+
#{$this}__heading {
98+
@include create-media-queries('md') {
99+
width: calc(100% - 55px);
100+
}
120101
}
121102
}
122-
#{$this}__excerpt {
123-
-webkit-line-clamp: 2;
124-
}
125-
}
126-
127-
&__heading {
128-
align-items: center;
129-
justify-content: space-between;
130-
gap: #{map-get-strict($token-variables, 'spacing', 'xxs')};
131-
overflow: hidden;
132-
display: -webkit-box;
133-
-webkit-box-orient: vertical;
134-
}
135-
136-
&__excerpt {
137-
overflow: hidden;
138-
display: -webkit-box;
139-
-webkit-box-orient: vertical;
140103
}
141104

142105

src/components/Molecules/Cards/PostCard/PostCard.tsx

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import classNames from 'classnames';
22
import React from 'react';
33

44
import type { BoxProps, PictureProps } from '@/components';
5-
import { Box, Heading, Picture, Skeleton, Text } from '@/components';
5+
import { Box, Flex, Heading, Picture, Skeleton, Text } from '@/components';
66
import { PostMetadata } from '@/components';
77
import type { ComponentPropsWithoutRef } from '@/types';
88

@@ -27,6 +27,7 @@ export interface PostCardProps extends BoxProps {
2727
}
2828

2929
export const PostCard: React.FC<PostCardProps> = ({
30+
slug,
3031
contentType,
3132
variant = 'side-image',
3233
cover = {},
@@ -40,13 +41,26 @@ export const PostCard: React.FC<PostCardProps> = ({
4041
tutorialLabel,
4142
...props
4243
}) => (
43-
<Box as="article" {...props} className={classNames('post-card', `post-card--${variant}`)}>
44+
<Box
45+
as="article"
46+
{...props}
47+
className={classNames('post-card', `post-card--${variant}`, {
48+
['post-card--with-tutorial']: contentType === 'tutorial',
49+
})}
50+
>
4451
<Skeleton isLoading={isLoading}>
4552
<Picture {...cover} img={{ className: 'post-card__cover', ...cover?.img }} />
4653
</Skeleton>
47-
<Box my={{ xs: 's', md: 'm' }} pl={{ xs: 's', md: 'm' }} pr={{ xs: 'xs', md: 'm' }} flex="1">
54+
<Flex
55+
flexDirection="column"
56+
justifyContent="between"
57+
my={{ xs: 's', md: 'm' }}
58+
pl={{ xs: 's', md: 'm' }}
59+
pr={{ xs: 'xs', md: 'm' }}
60+
flex="1"
61+
>
4862
<Skeleton isLoading={isLoading}>
49-
<Heading as="h2" size="xs" className="post-card__heading">
63+
<Heading as="h2" size="xs" lineClamp={2} className="post-card__heading">
5064
<Text as="a" {...link} size="m" data-internal-link="post" className="post-card__link">
5165
{title}
5266
</Text>
@@ -75,11 +89,11 @@ export const PostCard: React.FC<PostCardProps> = ({
7589
/>
7690
{variant !== 'highlight-dark' && (
7791
<Skeleton isLoading={isLoading}>
78-
<Text mt="xs" size="s" hiddenBelow="md" className="post-card__excerpt">
92+
<Text mt="xs" size="s" hiddenBelow="md" lineClamp={2} className="post-card__excerpt">
7993
{excerpt}
8094
</Text>
8195
</Skeleton>
8296
)}
83-
</Box>
97+
</Flex>
8498
</Box>
8599
);

src/components/Molecules/PostMetadata/PostMetadata.scss

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,4 @@
1717
&__date {
1818
min-width: max-content;
1919
}
20-
21-
&__authors {
22-
overflow: hidden;
23-
display: -webkit-box;
24-
-webkit-box-orient: vertical;
25-
-webkit-line-clamp: 1;
26-
}
2720
}

src/components/Molecules/PostMetadata/PostMetadata.stories.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,10 @@ WithVariantSecondary.args = {
2626
{
2727
username: 'jdoe',
2828
name: 'J. Doe',
29-
link: {
30-
href: '/fr/authors/jdoe',
31-
},
3229
},
3330
{
3431
username: 'jdupont',
3532
name: 'J. Dupont',
36-
link: {
37-
href: '/fr/authors/jdupont',
38-
},
3933
},
4034
],
4135
variant: 'secondary',

src/components/Molecules/PostMetadata/PostMetadata.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import classNames from 'classnames';
22
import React, { Fragment } from 'react';
33

4-
import { Flex, Icon, Link, Skeleton, Text } from '@/components';
5-
import type { ComponentPropsWithoutRef, SpacingSystemProps } from '@/types';
4+
import { Flex, Icon, Skeleton, Text } from '@/components';
5+
import type { SpacingSystemProps } from '@/types';
66

77
import './PostMetadata.scss';
88

@@ -16,7 +16,6 @@ export interface PostMetadataProps extends SpacingSystemProps {
1616
authors?: {
1717
username: string;
1818
name: string;
19-
link?: ComponentPropsWithoutRef<'a'>;
2019
}[];
2120
isLoading?: boolean;
2221
displayedFields?: ('date' | 'readingTime' | 'authors')[];
@@ -74,15 +73,15 @@ export const PostMetadata: React.FC<PostMetadataProps> = ({
7473
style={{ minWidth: 50, minHeight: 16 }}
7574
>
7675
{authors && (
77-
<Flex alignContent="center" alignItems="center" gap="xxs" className="post-metadata__authors">
76+
<>
7877
{variant === 'secondary' && <Icon name="person" size="24px" color="light-grey" />}
79-
{authors.map(({ username, name, link }, authorIndex) => (
78+
{authors.map(({ username, name }, authorIndex) => (
8079
<Fragment key={username}>
81-
{link ? <Link {...link}>{name}</Link> : <Text as="span">{name}</Text>}
80+
<Text as="span">{name}</Text>
8281
{authorIndex !== authors.length - 1 && <Text as="span">{' & '}</Text>}
8382
</Fragment>
8483
))}
85-
</Flex>
84+
</>
8685
)}
8786
</Skeleton>
8887
);
@@ -106,7 +105,7 @@ export const PostMetadata: React.FC<PostMetadataProps> = ({
106105
{...props}
107106
alignItems="center"
108107
textSize="s"
109-
flexWrap="no-wrap"
108+
flexWrap="wrap"
110109
gap={variant === 'secondary' ? 's' : 'xxs'}
111110
className={classNames('post-metadata', { [`post-metadata--${variant}`]: variant })}
112111
>

src/components/Organisms/Autocomplete/AutocompleteResult/AutocompleteResult.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@
3535

3636
&__link {
3737
color: black;
38-
overflow: hidden;
39-
display: -webkit-box;
40-
-webkit-box-orient: vertical;
41-
-webkit-line-clamp: 2;
4238

4339
&::before {
4440
content: " ";

src/components/Organisms/Autocomplete/AutocompleteResult/AutocompleteResult.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export const AutocompleteResult = polyRef<'div', AutocompleteResultProps>(
6767
size="s"
6868
text={title}
6969
textQuery={searchValue}
70+
lineClamp={2}
7071
className="autocomplete-result__link"
7172
/>
7273
<PostMetadata mt="xxs-3" date={date} authors={authors} displayedFields={['date', 'authors']} />

src/components/Organisms/Blocks/LastArticlesBlock/LastArticlesBlock.scss

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,20 @@
44
&__post-list {
55
display: grid; // @todo: add component for grid
66

7-
@include create-media-queries('md') {
7+
@include create-media-queries('md' ) {
88
grid-template-columns: repeat(2, 1fr);
9+
10+
.post-card:last-child {
11+
display: none;
12+
}
913
}
1014

1115
@include create-media-queries('lg') {
12-
grid-template-columns: repeat(4, 1fr);
16+
grid-template-columns: repeat(3, 1fr);
17+
18+
.post-card:last-child {
19+
display: flex;
20+
}
1321
}
1422
}
1523
}

0 commit comments

Comments
 (0)