@soul-refiner/design-system 0.1.18 → 0.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soul-refiner/design-system",
3
- "version": "0.1.18",
3
+ "version": "0.1.19",
4
4
  "main": "src/index.ts",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -61,11 +61,11 @@ export namespace Styles {
61
61
  export const padding = css<Padding>`
62
62
  padding: ${({ $padding }) =>
63
63
  $padding && typeof $padding === 'number'
64
- ? `${$padding}px`
64
+ ? `${$padding}px;`
65
65
  : $padding && typeof $padding === 'string' && $padding.includes('px')
66
66
  ? $padding
67
67
  : $padding && typeof $padding === 'string'
68
- ? `var(--${$padding})`
68
+ ? `var(--${$padding});`
69
69
  : '0px'};
70
70
  `;
71
71
 
@@ -84,5 +84,5 @@ const SVG = styled.svg<{
84
84
  $isRateable?: number;
85
85
  }>`
86
86
  fill: url(#MyGradient);
87
- cursor: pointer;
87
+ cursor: ${({ $isRateable }) => ($isRateable ? 'pointer' : 'initial')};
88
88
  `;
@@ -15,6 +15,7 @@ import {
15
15
  type NativeProps = Pick<
16
16
  React.HTMLAttributes<HTMLDivElement>,
17
17
  | 'children'
18
+ | 'className'
18
19
  | 'dangerouslySetInnerHTML'
19
20
  | 'onBlur'
20
21
  | 'onBlurCapture'
@@ -8,7 +8,7 @@ export interface CommonProps extends TypographyProps {
8
8
 
9
9
  export interface HeadingProps extends CommonProps {
10
10
  as?: React.ElementType;
11
- $fontSize?: 18 | 20 | 24 | 28 | 32 | 36 | 40 | 48;
11
+ $fontSize?: 16 | 18 | 20 | 24 | 28 | 32 | 36 | 40 | 48;
12
12
  $lineHeight?: 64 | 60 | 54 | 48 | 36 | 28 | 26;
13
13
  }
14
14
 
@@ -19,7 +19,6 @@ export const P = ({
19
19
  $fontSize = 16,
20
20
  $lineHeight = 24,
21
21
  $textAlign = 'left',
22
-
23
22
  ...rest
24
23
  }: ParagraphProps) => (
25
24
  <StyledP
@@ -0,0 +1,106 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+ import { Box, H, P } from 'components';
4
+
5
+ export interface ActionCardProps {
6
+ actions: React.ReactElement | React.ReactElement[];
7
+ content: string;
8
+ image: string;
9
+ logo: React.ReactElement;
10
+ subtitle: string;
11
+ sx?: string;
12
+ title: string;
13
+ }
14
+
15
+ export const ActionCard = ({
16
+ actions,
17
+ content,
18
+ image,
19
+ logo,
20
+ subtitle,
21
+ sx,
22
+ title,
23
+ }: ActionCardProps) => {
24
+ return (
25
+ <Action $backgroundImage={image} $sx={sx}>
26
+ <img src={image} alt="" />
27
+ <Figcaption>
28
+ <LogoWrapper>{logo}</LogoWrapper>
29
+ <H
30
+ as="span"
31
+ $mediumBold
32
+ $color="grey-2"
33
+ $fontSize={18}
34
+ $lineHeight={26}
35
+ >
36
+ {title}
37
+ </H>
38
+ <P as="span" $color="grey-4" $fontSize={12} $lineHeight={16}>
39
+ {subtitle}
40
+ </P>
41
+ <P
42
+ as="span"
43
+ $color="grey-3"
44
+ $fontSize={14}
45
+ $lineHeight={20}
46
+ $textAlign="center"
47
+ sx="margin-top: 12px;"
48
+ >
49
+ {content}
50
+ </P>
51
+ <Box
52
+ $display="flex"
53
+ $dir="row"
54
+ $gap={8}
55
+ sx="margin-top: 8px; width: 100%;"
56
+ >
57
+ {React.Children.toArray(actions)}
58
+ </Box>
59
+ </Figcaption>
60
+ </Action>
61
+ );
62
+ };
63
+
64
+ const Action = styled.figure<{
65
+ $backgroundImage: string;
66
+ $sx?: string;
67
+ }>`
68
+ position: relative;
69
+ aspect-ratio: 310 / 374;
70
+ border-radius: 16px;
71
+ max-width: 374px;
72
+ width: 100%;
73
+ margin: 0px;
74
+ display: flex;
75
+ flex-flow: column nowrap;
76
+ justify-content: flex-end;
77
+ box-shadow: var(--elevation-1);
78
+
79
+ img {
80
+ aspect-ratio: 310 / 160;
81
+ border-radius: 16px 16px 0px 0px;
82
+ }
83
+
84
+ ${({ $sx }) => ($sx ? $sx : '')};
85
+ `;
86
+
87
+ const Figcaption = styled.figcaption`
88
+ position: relative;
89
+ display: flex;
90
+ align-items: center;
91
+ flex-flow: column nowrap;
92
+ aspect-ratio: 310 / 198;
93
+ padding: 56px 16px 16px;
94
+ box-sizing: border-box;
95
+ background-color: var(--color-white);
96
+ border-radius: 0px 0px 15px 15px;
97
+ text-align: center;
98
+ `;
99
+
100
+ const LogoWrapper = styled.div`
101
+ position: absolute;
102
+ top: -28px;
103
+ right: calc(50% - 28px);
104
+ border: 4px solid var(--color-white);
105
+ border-radius: 50%;
106
+ `;
@@ -0,0 +1,2 @@
1
+ export { ActionCard } from './action';
2
+ export type { ActionCardProps } from './action';
@@ -0,0 +1,175 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+ import { Box, H, P, Rate } from 'components';
4
+
5
+ export interface AudioEpisodeCardProps {
6
+ actions: React.ReactElement[];
7
+ actionDropdown?: React.ReactElement;
8
+ content: string;
9
+ cta: React.ReactElement;
10
+ href: string;
11
+ image: string;
12
+ logo?: React.ReactElement;
13
+ numRating: number;
14
+ rating: number;
15
+ subtitle: string;
16
+ supportLabel?: string;
17
+ sx?: string;
18
+ title: string;
19
+ }
20
+
21
+ export const AudioEpisodeCard = ({
22
+ actions,
23
+ actionDropdown,
24
+ content,
25
+ cta,
26
+ href,
27
+ image,
28
+ logo,
29
+ numRating,
30
+ rating,
31
+ subtitle,
32
+ supportLabel,
33
+ sx,
34
+ title,
35
+ }: AudioEpisodeCardProps) => {
36
+ const hasLogo = !!logo;
37
+
38
+ return (
39
+ <Wrapper $sx={sx} href={href}>
40
+ <Figure>
41
+ {actionDropdown && <DropdownWrapper>{actionDropdown}</DropdownWrapper>}
42
+ <img className="thumbnail" src={image} alt="" />
43
+ <Figcaption>
44
+ <Box $display="block" className="hidden">
45
+ {cta}
46
+ </Box>
47
+ <Box $align="center" $dir="row" $gap={16}>
48
+ {logo}
49
+ <Box $dir="column">
50
+ <H $color="grey-2" $semiBold $fontSize={hasLogo ? 18 : 16}>
51
+ {title}
52
+ </H>
53
+ <P $color="grey-4" $fontSize={12} $lineHeight={16}>
54
+ {subtitle}
55
+ </P>
56
+ </Box>
57
+ {supportLabel && (
58
+ <P
59
+ className="not-hover"
60
+ $color="grey-4"
61
+ $fontSize={12}
62
+ $lineHeight={16}
63
+ sx="margin-left: auto; align-self: flex-end; margin-bottom: 2.5px;"
64
+ >
65
+ {supportLabel}
66
+ </P>
67
+ )}
68
+ </Box>
69
+ <P
70
+ $color="grey-5"
71
+ $fontSize={14}
72
+ $lineHeight={20}
73
+ $mediumBold
74
+ $textClampLines={6}
75
+ className="hidden inline"
76
+ >
77
+ {content}
78
+ </P>
79
+ <Box className="hidden" $align="center" $dir="row">
80
+ <Rate isRateable={false} percent={rating} size="small" />
81
+ <P
82
+ $color="grey-4"
83
+ $fontSize={12}
84
+ $lineHeight={16}
85
+ sx="margin: 0px auto 0px 4px;"
86
+ >
87
+ ({numRating})
88
+ </P>
89
+ <Box $align="center" $dir="row" $gap={8}>
90
+ {React.Children.toArray(actions)}
91
+ </Box>
92
+ </Box>
93
+ </Figcaption>
94
+ </Figure>
95
+ </Wrapper>
96
+ );
97
+ };
98
+
99
+ const Wrapper = styled.a<{ $sx?: string }>`
100
+ cursor: pointer;
101
+ display: block;
102
+ position: relative;
103
+ user-select: none;
104
+
105
+ figure {
106
+ max-width: 228px;
107
+ }
108
+
109
+ .hidden {
110
+ display: none;
111
+ }
112
+
113
+ &:hover {
114
+ .hidden {
115
+ display: flex;
116
+
117
+ &.inline {
118
+ display: -webkit-box;
119
+ }
120
+ }
121
+
122
+ .not-hover {
123
+ display: none;
124
+ }
125
+
126
+ .thumbnail {
127
+ border-radius: 16px 16px 0px 0px;
128
+ }
129
+
130
+ figure {
131
+ max-width: 280px;
132
+ aspect-ratio: 280 / 434;
133
+ box-shadow: var(--elevation-3);
134
+ background: linear-gradient(
135
+ 0deg,
136
+ #ffffff 50%,
137
+ rgba(255, 255, 255, 0.85) 55%,
138
+ rgba(255, 255, 255, 0.1) 80%
139
+ );
140
+ }
141
+
142
+ figcaption {
143
+ margin-top: -80px;
144
+ padding: 24px;
145
+ }
146
+ }
147
+
148
+ ${({ $sx }) => ($sx ? $sx : '')};
149
+ `;
150
+
151
+ const Figure = styled.figure`
152
+ margin: 0px;
153
+ border-radius: 16px;
154
+
155
+ .thumbnail {
156
+ border-radius: 16px;
157
+ position: relative;
158
+ z-index: -1;
159
+ width: 100%;
160
+ aspect-ratio: 228 / 228;
161
+ }
162
+ `;
163
+
164
+ const Figcaption = styled.figcaption`
165
+ display: flex;
166
+ flex-flow: column nowrap;
167
+ gap: 8px;
168
+ padding: 8px;
169
+ `;
170
+
171
+ const DropdownWrapper = styled.div`
172
+ position: absolute;
173
+ top: 8px;
174
+ right: 8px;
175
+ `;
@@ -0,0 +1,2 @@
1
+ export { AudioEpisodeCard } from './audio';
2
+ export type { AudioEpisodeCardProps } from './audio';
@@ -0,0 +1,49 @@
1
+ import React from 'react';
2
+ import { ActionCard, ActionCardProps } from './action';
3
+ import { AudioEpisodeCard, AudioEpisodeCardProps } from './audio';
4
+ import { FeatureCard, FeatureCardProps } from './feature';
5
+ import { PersonCard, PersonCardProps } from './person';
6
+ import { PriceCard, PriceCardProps } from './price';
7
+ import { RegularCard, RegularCardProps } from './regular';
8
+ import { VideoEpisodeCard, VideoEpisodeCardProps } from './video';
9
+ import { WrittenEpisodeCard, WrittenEpisodeCardProps } from './written';
10
+
11
+ type CardType =
12
+ | 'action'
13
+ | 'audio-episode'
14
+ | 'feature'
15
+ | 'person'
16
+ | 'price'
17
+ | 'regular'
18
+ | 'video-episode'
19
+ | 'written-episode';
20
+
21
+ export type CardProps = (
22
+ | ActionCardProps
23
+ | AudioEpisodeCardProps
24
+ | FeatureCardProps
25
+ | PersonCardProps
26
+ | PriceCardProps
27
+ | RegularCardProps
28
+ | VideoEpisodeCardProps
29
+ | WrittenEpisodeCardProps
30
+ ) & {
31
+ type: CardType;
32
+ };
33
+
34
+ export const Card = ({ type = 'regular', ...rest }: CardProps) => {
35
+ const lookup: Record<CardType, React.ReactElement> = {
36
+ action: <ActionCard {...(rest as ActionCardProps)} />,
37
+ 'audio-episode': <AudioEpisodeCard {...(rest as AudioEpisodeCardProps)} />,
38
+ feature: <FeatureCard {...(rest as FeatureCardProps)} />,
39
+ person: <PersonCard {...(rest as PersonCardProps)} />,
40
+ price: <PriceCard {...(rest as PriceCardProps)} />,
41
+ regular: <RegularCard {...(rest as RegularCardProps)} />,
42
+ 'video-episode': <VideoEpisodeCard {...(rest as VideoEpisodeCardProps)} />,
43
+ 'written-episode': (
44
+ <WrittenEpisodeCard {...(rest as WrittenEpisodeCardProps)} />
45
+ ),
46
+ };
47
+
48
+ return lookup[type];
49
+ };
@@ -0,0 +1,248 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+ import { Box, Button, Modal } from 'components';
4
+ import { Camera, Checkmark, Close, Pencil } from 'icons';
5
+
6
+ export interface FeatureCardProps {
7
+ content: string;
8
+ editable?: boolean;
9
+ href?: string;
10
+ image: string;
11
+ onSave?: (title: string, content: string) => void;
12
+ sx?: string;
13
+ title: string;
14
+ uploadModal?: React.ReactElement;
15
+ }
16
+
17
+ export const FeatureCard = ({
18
+ content = '',
19
+ editable,
20
+ href,
21
+ image,
22
+ onSave,
23
+ sx,
24
+ title = '',
25
+ uploadModal,
26
+ }: FeatureCardProps) => {
27
+ const [editing, setEditing] = React.useState(false);
28
+ const [editingTitle, setTitle] = React.useState(() => title);
29
+ const [editingContent, setContent] = React.useState(() => content);
30
+
31
+ const handleSetEditing = () => setEditing(true);
32
+
33
+ const handleCancelEdit = () => {
34
+ setTitle(title);
35
+ setContent(content);
36
+ setEditing(false);
37
+ };
38
+
39
+ const handleSave = () => {
40
+ setEditing(false);
41
+ onSave && onSave(editingTitle, editingContent);
42
+ };
43
+
44
+ const handleTitleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
45
+ setTitle(event.target.value);
46
+ };
47
+
48
+ const handleContentChange = (event: React.ChangeEvent<HTMLInputElement>) => {
49
+ setContent(event.target.value);
50
+ };
51
+
52
+ const showEditIcon = !editing && editable;
53
+ const isLink = !!href;
54
+
55
+ return (
56
+ <Wrapper as={isLink ? 'div' : 'a'} href={href}>
57
+ <Figure $editing={editing} $isLink={isLink} $sx={sx}>
58
+ <img alt={title} src={image} />
59
+ {!editing && (
60
+ <Title>
61
+ {editingTitle}
62
+ <figure>
63
+ <Content>{editingContent}</Content>
64
+ </figure>
65
+ {showEditIcon && (
66
+ <Pencil className="edit" onClick={handleSetEditing} />
67
+ )}
68
+ {editable && uploadModal && (
69
+ <Modal>
70
+ <Modal.Trigger>
71
+ <Button
72
+ icon={<Camera />}
73
+ type="outlined"
74
+ size="small"
75
+ sx="position: absolute; right: 8px; top: -72px;"
76
+ >
77
+ Edit
78
+ </Button>
79
+ </Modal.Trigger>
80
+ <Modal.Content>{uploadModal}</Modal.Content>
81
+ </Modal>
82
+ )}
83
+ </Title>
84
+ )}
85
+ {editing && (
86
+ <Box
87
+ $align="flex-end"
88
+ $display="flex"
89
+ $dir="column"
90
+ $gap={8}
91
+ sx="position: relative;"
92
+ >
93
+ <EditTitle onChange={handleTitleChange} value={editingTitle} />
94
+ <EditContent
95
+ onChange={handleContentChange}
96
+ value={editingContent}
97
+ />
98
+ <Box $gap={8}>
99
+ <Checkmark
100
+ onClick={handleSave}
101
+ sx={`
102
+ padding: 8px;
103
+ border-radius: 4px;
104
+ cursor: pointer;
105
+ background-color: var(--color-white);
106
+ box-shadow: var(--elevation-1);
107
+ &:hover {
108
+ background-color: var(--color-grey-10);
109
+ }
110
+ `}
111
+ />
112
+ <Close
113
+ onClick={handleCancelEdit}
114
+ sx={`
115
+ padding: 8px;
116
+ border-radius: 4px;
117
+ cursor: pointer;
118
+ background-color: var(--color-white);
119
+ box-shadow: var(--elevation-1);
120
+ &:hover {
121
+ background-color: var(--color-grey-10);
122
+ }
123
+ `}
124
+ />
125
+ </Box>
126
+ </Box>
127
+ )}
128
+ </Figure>
129
+ </Wrapper>
130
+ );
131
+ };
132
+
133
+ const Wrapper = styled.div`
134
+ text-decoration: none;
135
+ `;
136
+
137
+ const Figure = styled.figure<{
138
+ $editing: boolean;
139
+ $isLink: boolean;
140
+ $sx?: string;
141
+ }>`
142
+ max-width: 352px;
143
+ display: flex;
144
+ flex-flow: column nowrap;
145
+ gap: 16px;
146
+ padding: 16px;
147
+ margin: 0px;
148
+ border-radius: 16px;
149
+ box-shadow: var(--elevation-1);
150
+ border: 1px solid var(--color-white);
151
+
152
+ &:hover {
153
+ ${({ $isLink }) =>
154
+ $isLink
155
+ ? 'border: 1px solid var(--color-primary-blue-3); cursor: pointer;'
156
+ : 'cursor: arrow;'}
157
+
158
+ button {
159
+ display: flex;
160
+ }
161
+
162
+ .edit {
163
+ display: block;
164
+ }
165
+ }
166
+
167
+ img {
168
+ max-width: 352px;
169
+ aspect-ratio: 1/1;
170
+ }
171
+
172
+ figure {
173
+ display: flex;
174
+ flex-flow: column nowrap;
175
+ gap: 4px;
176
+ margin: 0px;
177
+ padding: 0px;
178
+ }
179
+
180
+ button {
181
+ display: none;
182
+ }
183
+
184
+ .edit {
185
+ position: absolute;
186
+ right: 0px;
187
+ top: 0px;
188
+ display: none;
189
+ padding: 8px;
190
+ border-radius: 50%;
191
+ cursor: pointer;
192
+ &:hover {
193
+ background-color: var(--color-grey-10);
194
+ }
195
+ }
196
+
197
+ ${({ $editing }) =>
198
+ $editing
199
+ ? `
200
+ background-color: var(--color-grey-9);`
201
+ : `
202
+ background-color: var(--color-white);`}
203
+
204
+ ${({ $sx }) => ($sx ? $sx : '')};
205
+ `;
206
+
207
+ const Title = styled.figcaption`
208
+ position: relative;
209
+ padding-right: 32px;
210
+ color: var(--color-grey-2);
211
+ font-size: 18px;
212
+ font-family: Inter;
213
+ font-weight: 500;
214
+ line-height: 26px;
215
+ letter-spacing: -0.252px;
216
+ user-select: none;
217
+ `;
218
+
219
+ const Content = styled.figcaption`
220
+ font-size: 14px;
221
+ font-family: Inter;
222
+ font-weight: 400;
223
+ line-height: 20px;
224
+ letter-spacing: -0.084px;
225
+ `;
226
+
227
+ const EditTitle = styled.input`
228
+ width: calc(100% - 24px);
229
+ padding: 12px;
230
+ background-color: var(--color-white);
231
+ font-size: 18px;
232
+ font-family: Inter;
233
+ font-weight: 500;
234
+ line-height: 26px;
235
+ letter-spacing: -0.252px;
236
+ border: none;
237
+ border-radius: 8px;
238
+ outline: none;
239
+ `;
240
+
241
+ const EditContent = styled(EditTitle)`
242
+ padding: 6px 12px;
243
+ font-size: 14px;
244
+ font-family: Inter;
245
+ font-weight: 400;
246
+ line-height: 20px;
247
+ letter-spacing: -0.084px;
248
+ `;
@@ -0,0 +1,2 @@
1
+ export { FeatureCard } from './feature';
2
+ export type { FeatureCardProps } from './feature';
@@ -0,0 +1,2 @@
1
+ export { Card } from './card';
2
+ export type { CardProps } from './card';
@@ -0,0 +1,2 @@
1
+ export { PersonCard } from './person';
2
+ export type { PersonCardProps } from './person';
@@ -0,0 +1,96 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+ import { Box, H, P } from 'components';
4
+
5
+ export interface PersonCardProps {
6
+ actions?: React.ReactElement | React.ReactElement[];
7
+ href: string;
8
+ image: string;
9
+ subtitle: string;
10
+ sx?: string;
11
+ title: string;
12
+ }
13
+
14
+ export const PersonCard = ({
15
+ actions,
16
+ href,
17
+ image,
18
+ subtitle,
19
+ sx,
20
+ title,
21
+ }: PersonCardProps) => {
22
+ return (
23
+ <Wrapper $image={image} as={href ? 'a' : 'div'}>
24
+ <Person $sx={sx}>
25
+ <Shadow>
26
+ <img src={image} alt="" />
27
+ </Shadow>
28
+ <Figcaption>
29
+ <H as="span" $bold $color="white" $fontSize={24} $lineHeight={36}>
30
+ {title}
31
+ </H>
32
+ <P as="span" $color="white" $fontSize={14} $lineHeight={20}>
33
+ {subtitle}
34
+ </P>
35
+ {actions && (
36
+ <Box $display="flex" $dir="row" $gap={8} sx="margin-top: 16px;">
37
+ {React.Children.toArray(actions)}
38
+ </Box>
39
+ )}
40
+ </Figcaption>
41
+ </Person>
42
+ </Wrapper>
43
+ );
44
+ };
45
+
46
+ const Wrapper = styled.div<{
47
+ $image: string;
48
+ }>`
49
+ width: 312px;
50
+ height: 400px;
51
+ display: block;
52
+ text-decoration: none;
53
+ cursor: pointer;
54
+
55
+ img {
56
+ width: 100%;
57
+ height: 100%;
58
+ border-radius: 16px;
59
+ }
60
+ `;
61
+
62
+ const Shadow = styled.div`
63
+ border-radius: 16px;
64
+ position: absolute;
65
+ top: 0px;
66
+ left: 0px;
67
+ right: 0px;
68
+ width: 100%;
69
+ height: 100%;
70
+ background: linear-gradient(180deg, rgba(0, 0, 0, 0) 66.67%, #000 98.25%),
71
+ transparent 50% / cover no-repeat;
72
+ `;
73
+
74
+ const Person = styled.figure<{
75
+ $sx?: string;
76
+ }>`
77
+ position: relative;
78
+ width: 100%;
79
+ height: 100%;
80
+ margin: 0px;
81
+ border-radius: 16px;
82
+ display: flex;
83
+ justify-content: flex-end;
84
+ flex-direction: column;
85
+
86
+ ${({ $sx }) => ($sx ? $sx : '')};
87
+ `;
88
+
89
+ const Figcaption = styled.figcaption`
90
+ position: relative;
91
+ width: 100%;
92
+ box-sizing: border-box;
93
+ display: flex;
94
+ flex-direction: column;
95
+ padding: 16px 24px;
96
+ `;
@@ -0,0 +1,2 @@
1
+ export { PriceCard } from './price';
2
+ export type { PriceCardProps } from './price';
@@ -0,0 +1,110 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+ import { Box, H, P } from 'components';
4
+ import { Checkmark } from 'icons';
5
+
6
+ export interface PriceCardProps {
7
+ actions: React.ReactElement;
8
+ content: string;
9
+ features: string[];
10
+ featureTitle: string;
11
+ price: string;
12
+ title: string;
13
+ }
14
+
15
+ export const PriceCard = ({
16
+ actions,
17
+ content,
18
+ featureTitle,
19
+ features,
20
+ price,
21
+ title,
22
+ }: PriceCardProps) => {
23
+ const id = React.useId();
24
+ return (
25
+ <Price>
26
+ <Box
27
+ $align="stretch"
28
+ $display="flex"
29
+ $dir="column"
30
+ $gap={24}
31
+ sx={`
32
+ padding: 24px 48px;
33
+ background-color: var(--color-grey-10);
34
+ border-radius: 16px 16px 0px 0px;
35
+ `}
36
+ >
37
+ <H
38
+ as="h6"
39
+ $fontSize={24}
40
+ $lineHeight={36}
41
+ $semiBold
42
+ $textAlign="center"
43
+ >
44
+ {title}
45
+ </H>
46
+ <Box $dir="column">
47
+ <H
48
+ as="p"
49
+ $bold
50
+ $fontSize={32}
51
+ $lineHeight={48}
52
+ $textClampLines={5}
53
+ $textAlign="center"
54
+ >
55
+ {price}
56
+ </H>
57
+ <P as="span" $color="grey-4" $textAlign="center">
58
+ /month
59
+ </P>
60
+ </Box>
61
+ {actions}
62
+ </Box>
63
+ <Box
64
+ sx="padding: 16px 24px; position: relative;"
65
+ $display="flex"
66
+ $dir="column"
67
+ >
68
+ <P sx="padding: 16px 0px;">{content}</P>
69
+ <Divider />
70
+ <Box sx="padding: 16px 0px;" $dir="column" $gap={8}>
71
+ <P $color="grey-2" $mediumBold>
72
+ {featureTitle}
73
+ </P>
74
+ {features.map((item, index) => (
75
+ <Box key={id + index.toString(36)} $align="center" $gap={12}>
76
+ <Checkmark
77
+ color="green-5"
78
+ sx="padding: 2px; border-radius: 50%; background-color: var(--color-green-9);"
79
+ />
80
+ <P $fontSize={14} $lineHeight={20}>
81
+ {item}
82
+ </P>
83
+ </Box>
84
+ ))}
85
+ </Box>
86
+ </Box>
87
+ </Price>
88
+ );
89
+ };
90
+
91
+ const Price = styled.figure`
92
+ margin: 0px;
93
+ padding: 0px;
94
+ width: 280px;
95
+ height: fit-content;
96
+ border-radius: 16px;
97
+ box-shadow: var(--elevation-2);
98
+ user-select: none;
99
+
100
+ &:hover {
101
+ border: 1px solid var(--color-primary-blue-3);
102
+ }
103
+ `;
104
+
105
+ const Divider = styled.div`
106
+ height: 1px;
107
+ width: 100%;
108
+ box-sizing: border-box;
109
+ background-color: var(--color-grey-9);
110
+ `;
@@ -0,0 +1,2 @@
1
+ export { RegularCard } from './regular';
2
+ export type { RegularCardProps } from './regular';
@@ -0,0 +1,52 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+ import { Box } from 'components';
4
+
5
+ export interface RegularCardProps extends React.PropsWithChildren {
6
+ href?: string;
7
+ image: string;
8
+ sx?: string;
9
+ }
10
+
11
+ export const RegularCard = ({
12
+ children,
13
+ href,
14
+ image,
15
+ sx,
16
+ }: RegularCardProps) => {
17
+ return (
18
+ <Wrapper $isLink={!!href} $sx={sx} as={href ? 'a' : 'div'} href={href}>
19
+ <img src={image} alt="" />
20
+ <Box $dir="column" $padding={24}>
21
+ {children}
22
+ </Box>
23
+ </Wrapper>
24
+ );
25
+ };
26
+
27
+ const Wrapper = styled.div<{
28
+ $isLink: boolean;
29
+ $sx?: string;
30
+ }>`
31
+ position: relative;
32
+ display: block;
33
+ text-decoration: none;
34
+ cursor: pointer;
35
+ box-shadow: var(--elevation-1);
36
+ border-radius: 16px;
37
+ background-color: var(--color-white);
38
+
39
+ ${({ $isLink }) =>
40
+ $isLink
41
+ ? `
42
+ &:hover {
43
+ border: 1px solid var(--color-primary-blue-3);
44
+ }`
45
+ : ''}
46
+
47
+ img {
48
+ border-radius: 16px 16px 0px 0px;
49
+ }
50
+
51
+ ${({ $sx }) => ($sx ? $sx : '')};
52
+ `;
@@ -0,0 +1,2 @@
1
+ export { VideoEpisodeCard } from './video';
2
+ export type { VideoEpisodeCardProps } from './video';
@@ -0,0 +1,167 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+ import { Box, H, P, Rate } from 'components';
4
+
5
+ export interface VideoEpisodeCardProps {
6
+ actions: React.ReactElement[];
7
+ actionDropdown?: React.ReactElement;
8
+ content: string;
9
+ cta: React.ReactElement;
10
+ href: string;
11
+ image: string;
12
+ logo?: React.ReactElement;
13
+ numRating: number;
14
+ rating: number;
15
+ subtitle: string;
16
+ supportLabel?: string;
17
+ sx?: string;
18
+ title: string;
19
+ }
20
+
21
+ export const VideoEpisodeCard = ({
22
+ actions,
23
+ actionDropdown,
24
+ content,
25
+ cta,
26
+ href,
27
+ image,
28
+ logo,
29
+ numRating,
30
+ rating,
31
+ subtitle,
32
+ supportLabel,
33
+ sx,
34
+ title,
35
+ }: VideoEpisodeCardProps) => {
36
+ const hasLogo = !!logo;
37
+
38
+ return (
39
+ <Wrapper $sx={sx} href={href}>
40
+ <Figure>
41
+ {actionDropdown && <DropdownWrapper>{actionDropdown}</DropdownWrapper>}
42
+ <img className="thumbnail" src={image} alt="" />
43
+ <Figcaption>
44
+ <Box $display="block" className="hidden">
45
+ {cta}
46
+ </Box>
47
+ <Box $align="center" $dir="row" $gap={16}>
48
+ {logo}
49
+ <Box $dir="column">
50
+ <H $color="grey-2" $semiBold $fontSize={hasLogo ? 18 : 16}>
51
+ {title}
52
+ </H>
53
+ <P $color="grey-4" $fontSize={12} $lineHeight={16}>
54
+ {subtitle}
55
+ </P>
56
+ </Box>
57
+ {supportLabel && (
58
+ <P
59
+ className="not-hover"
60
+ $color="grey-4"
61
+ $fontSize={12}
62
+ $lineHeight={16}
63
+ sx="margin-left: auto; align-self: flex-end; margin-bottom: 2.5px;"
64
+ >
65
+ {supportLabel}
66
+ </P>
67
+ )}
68
+ </Box>
69
+ <P
70
+ $color="grey-5"
71
+ $fontSize={14}
72
+ $lineHeight={20}
73
+ $mediumBold
74
+ $textClampLines={4}
75
+ className="hidden"
76
+ >
77
+ {content}
78
+ </P>
79
+ <Box className="hidden" $align="center" $dir="row">
80
+ <Rate isRateable={false} percent={rating} size="small" />
81
+ <P
82
+ $color="grey-4"
83
+ $fontSize={12}
84
+ $lineHeight={16}
85
+ sx="margin: 0px auto 0px 4px;"
86
+ >
87
+ ({numRating})
88
+ </P>
89
+ <Box $align="center" $dir="row" $gap={8}>
90
+ {React.Children.toArray(actions)}
91
+ </Box>
92
+ </Box>
93
+ </Figcaption>
94
+ </Figure>
95
+ </Wrapper>
96
+ );
97
+ };
98
+
99
+ const Wrapper = styled.a<{ $sx?: string }>`
100
+ cursor: pointer;
101
+ display: block;
102
+ position: relative;
103
+ user-select: none;
104
+
105
+ .hidden {
106
+ display: none;
107
+ }
108
+
109
+ &:hover {
110
+ .hidden {
111
+ display: flex;
112
+ }
113
+
114
+ .not-hover {
115
+ display: none;
116
+ }
117
+
118
+ .thumbnail {
119
+ border-radius: 16px 16px 0px 0px;
120
+ }
121
+
122
+ figure {
123
+ aspect-ratio: 410 / 414;
124
+ box-shadow: var(--elevation-3);
125
+ background: linear-gradient(
126
+ 0deg,
127
+ #ffffff 50%,
128
+ rgba(255, 255, 255, 0.85) 55%,
129
+ rgba(255, 255, 255, 0.1) 80%
130
+ );
131
+ }
132
+
133
+ figcaption {
134
+ margin-top: -40px;
135
+ padding: 24px;
136
+ }
137
+ }
138
+
139
+ ${({ $sx }) => ($sx ? $sx : '')};
140
+ `;
141
+
142
+ const Figure = styled.figure`
143
+ max-width: 410px;
144
+ margin: 0px;
145
+ border-radius: 16px;
146
+
147
+ .thumbnail {
148
+ position: relative;
149
+ z-index: -1;
150
+ width: 100%;
151
+ aspect-ratio: 410 / 239;
152
+ border-radius: 16px;
153
+ }
154
+ `;
155
+
156
+ const Figcaption = styled.figcaption`
157
+ display: flex;
158
+ flex-flow: column nowrap;
159
+ gap: 8px;
160
+ padding: 8px;
161
+ `;
162
+
163
+ const DropdownWrapper = styled.div`
164
+ position: absolute;
165
+ top: 8px;
166
+ right: 8px;
167
+ `;
@@ -0,0 +1,2 @@
1
+ export { WrittenEpisodeCard } from './written';
2
+ export type { WrittenEpisodeCardProps } from './written';
@@ -0,0 +1,176 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+ import { Box, H, P, Rate } from 'components';
4
+
5
+ export interface WrittenEpisodeCardProps {
6
+ actions: React.ReactElement[];
7
+ actionDropdown?: React.ReactElement;
8
+ content: string;
9
+ cta: React.ReactElement;
10
+ href: string;
11
+ image: string;
12
+ logo?: React.ReactElement;
13
+ numRating: number;
14
+ rating: number;
15
+ subtitle: string;
16
+ supportLabel?: string;
17
+ sx?: string;
18
+ title: string;
19
+ }
20
+
21
+ export const WrittenEpisodeCard = ({
22
+ actions,
23
+ actionDropdown,
24
+ content,
25
+ cta,
26
+ href,
27
+ image,
28
+ logo,
29
+ numRating,
30
+ rating,
31
+ subtitle,
32
+ supportLabel,
33
+ sx,
34
+ title,
35
+ }: WrittenEpisodeCardProps) => {
36
+ const hasLogo = !!logo;
37
+
38
+ return (
39
+ <Wrapper $sx={sx} href={href}>
40
+ <Figure>
41
+ {actionDropdown && <DropdownWrapper>{actionDropdown}</DropdownWrapper>}
42
+ <img className="thumbnail" src={image} alt="" />
43
+ <Figcaption>
44
+ <Box $display="block" className="hidden">
45
+ {cta}
46
+ </Box>
47
+ <Box $align="center" $dir="row" $gap={16}>
48
+ {logo}
49
+ <Box $dir="column">
50
+ <H $color="grey-2" $semiBold $fontSize={hasLogo ? 18 : 16}>
51
+ {title}
52
+ </H>
53
+ <P $color="grey-4" $fontSize={12} $lineHeight={16}>
54
+ {subtitle}
55
+ </P>
56
+ </Box>
57
+ {supportLabel && (
58
+ <P
59
+ className="not-hover"
60
+ $color="grey-4"
61
+ $fontSize={12}
62
+ $lineHeight={16}
63
+ sx="margin-left: auto; align-self: flex-end; margin-bottom: 2.5px;"
64
+ >
65
+ {supportLabel}
66
+ </P>
67
+ )}
68
+ </Box>
69
+ <P
70
+ $color="grey-5"
71
+ $fontSize={14}
72
+ $lineHeight={20}
73
+ $mediumBold
74
+ $textClampLines={6}
75
+ className="hidden inline"
76
+ >
77
+ {content}
78
+ </P>
79
+ <Box className="hidden" $align="center" $dir="row">
80
+ <Rate isRateable={false} percent={rating} size="small" />
81
+ <P
82
+ $color="grey-4"
83
+ $fontSize={12}
84
+ $lineHeight={16}
85
+ sx="margin: 0px auto 0px 4px;"
86
+ >
87
+ ({numRating})
88
+ </P>
89
+ <Box $align="center" $dir="row" $gap={8}>
90
+ {React.Children.toArray(actions)}
91
+ </Box>
92
+ </Box>
93
+ </Figcaption>
94
+ </Figure>
95
+ </Wrapper>
96
+ );
97
+ };
98
+
99
+ const Wrapper = styled.a<{ $sx?: string }>`
100
+ cursor: pointer;
101
+ display: block;
102
+ position: relative;
103
+ user-select: none;
104
+
105
+ figure {
106
+ max-width: 228px;
107
+ }
108
+
109
+ .hidden {
110
+ display: none;
111
+ }
112
+
113
+ &:hover {
114
+ .hidden {
115
+ display: flex;
116
+
117
+ &.inline {
118
+ display: -webkit-box;
119
+ }
120
+ }
121
+
122
+ .not-hover {
123
+ display: none;
124
+ }
125
+
126
+ .thumbnail {
127
+ border-radius: 16px 16px 0px 0px;
128
+ aspect-ratio: 228 / 228;
129
+ }
130
+
131
+ figure {
132
+ max-width: 280px;
133
+ aspect-ratio: 280 / 434;
134
+ box-shadow: var(--elevation-3);
135
+ background: linear-gradient(
136
+ 0deg,
137
+ #ffffff 50%,
138
+ rgba(255, 255, 255, 0.85) 55%,
139
+ rgba(255, 255, 255, 0.1) 80%
140
+ );
141
+ }
142
+
143
+ figcaption {
144
+ margin-top: -80px;
145
+ padding: 24px;
146
+ }
147
+ }
148
+
149
+ ${({ $sx }) => ($sx ? $sx : '')};
150
+ `;
151
+
152
+ const Figure = styled.figure`
153
+ margin: 0px;
154
+ border-radius: 16px;
155
+
156
+ .thumbnail {
157
+ border-radius: 16px;
158
+ position: relative;
159
+ z-index: -1;
160
+ width: 100%;
161
+ aspect-ratio: 228 / 326;
162
+ }
163
+ `;
164
+
165
+ const Figcaption = styled.figcaption`
166
+ display: flex;
167
+ flex-flow: column nowrap;
168
+ gap: 8px;
169
+ padding: 8px;
170
+ `;
171
+
172
+ const DropdownWrapper = styled.div`
173
+ position: absolute;
174
+ top: 8px;
175
+ right: 8px;
176
+ `;
@@ -186,9 +186,11 @@ const Container = styled.div<{
186
186
  $size: number;
187
187
  href?: string;
188
188
  }>`
189
+ flex-shrink: 0;
189
190
  display: flex;
190
191
  flex-flow: row nowrap;
191
- cursor: pointer;
192
+ cursor: ${({ as }) =>
193
+ as && (as === 'a' || as === 'button') ? 'pointer' : 'initial'};
192
194
  padding: 0px;
193
195
  border: 0px;
194
196
  position: relative;
@@ -196,6 +198,7 @@ const Container = styled.div<{
196
198
 
197
199
  > img,
198
200
  > svg {
201
+ flex-shrink: 0;
199
202
  border-radius: 50%;
200
203
  overflow: hidden;
201
204
  object-fit: cover;
@@ -1,5 +1,6 @@
1
1
  export * from './actions';
2
2
  export * from './atoms';
3
+ export * from './card';
3
4
  export * from './feedback';
4
5
  export * from './iconography';
5
6
  export * from './input';