Skip to content

Commit 13b9c23

Browse files
committed
feat(nx-dev): add quote component for enterprise articles
1 parent 9bc6317 commit 13b9c23

File tree

3 files changed

+88
-0
lines changed

3 files changed

+88
-0
lines changed

nx-dev/ui-markdoc/src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ import { FenceWrapper } from './lib/nodes/fence-wrapper.component';
5454
import { VideoPlayer, videoPlayer } from './lib/tags/video-player.component';
5555
import { TableOfContents } from './lib/tags/table-of-contents.component';
5656
import { tableOfContents } from './lib/tags/table-of-contents.schema';
57+
import { Quote } from './lib/tags/quote.component';
58+
import { quote } from './lib/tags/quote.schema';
5759
// TODO fix this export
5860
export { GithubRepository } from './lib/tags/github-repository.component';
5961

@@ -84,6 +86,7 @@ export const getMarkdocCustomConfig = (
8486
personas,
8587
'project-details': projectDetails,
8688
pill,
89+
quote,
8790
'short-embeds': shortEmbeds,
8891
'short-video': shortVideo,
8992
'side-by-side': sideBySide,
@@ -114,6 +117,7 @@ export const getMarkdocCustomConfig = (
114117
Personas,
115118
ProjectDetails,
116119
Pill,
120+
Quote,
117121
ShortEmbeds,
118122
ShortVideo,
119123
SideBySide,
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import { cx } from '@nx/nx-dev/ui-primitives';
2+
3+
export interface QuoteProps {
4+
quote: string;
5+
author: string;
6+
title?: string;
7+
companyIcon?: string;
8+
}
9+
10+
export function Quote({
11+
quote,
12+
author,
13+
title,
14+
companyIcon,
15+
}: QuoteProps): JSX.Element {
16+
return (
17+
<figure className="not-prose relative my-8 rounded-2xl bg-white p-8 shadow-lg ring-1 ring-slate-900/5 dark:bg-slate-800">
18+
<svg
19+
className="absolute left-6 top-6 h-12 w-12 text-slate-100 dark:text-slate-700"
20+
fill="currentColor"
21+
viewBox="0 0 24 24"
22+
aria-hidden="true"
23+
>
24+
<path d="M4.583 17.321C3.553 16.227 3 15 3 13.011c0-3.5 2.457-6.637 6.03-8.188l.893 1.378c-3.335 1.804-3.987 4.145-4.247 5.621.537-.278 1.24-.375 1.929-.311 1.804.167 3.226 1.648 3.226 3.489a3.5 3.5 0 01-3.5 3.5c-1.073 0-2.099-.49-2.748-1.179zm10 0C13.553 16.227 13 15 13 13.011c0-3.5 2.457-6.637 6.03-8.188l.893 1.378c-3.335 1.804-3.987 4.145-4.247 5.621.537-.278 1.24-.375 1.929-.311 1.804.167 3.226 1.648 3.226 3.489a3.5 3.5 0 01-3.5 3.5c-1.073 0-2.099-.49-2.748-1.179z" />
25+
</svg>
26+
27+
<blockquote className="relative">
28+
<p className="pl-12 text-lg font-semibold tracking-tight text-slate-900 dark:text-white">
29+
{quote}
30+
</p>
31+
</blockquote>
32+
33+
<div className="mt-6 flex items-center gap-x-4 pl-12">
34+
<div className="flex-auto">
35+
<div className="text-sm font-semibold text-slate-700 dark:text-slate-300">
36+
{author}
37+
</div>
38+
{title && (
39+
<div className="text-xs text-slate-500 dark:text-slate-400">
40+
{title}
41+
</div>
42+
)}
43+
</div>
44+
{companyIcon && (
45+
<div className="h-10 w-10 flex-none overflow-hidden">
46+
<img
47+
src={companyIcon}
48+
aria-hidden="true"
49+
className="h-full w-full object-contain"
50+
alt="Company logo"
51+
/>
52+
</div>
53+
)}
54+
</div>
55+
</figure>
56+
);
57+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { Schema } from '@markdoc/markdoc';
2+
3+
export const quote: Schema = {
4+
render: 'Quote',
5+
attributes: {
6+
quote: {
7+
type: 'String',
8+
required: true,
9+
},
10+
author: {
11+
type: 'String',
12+
required: true,
13+
},
14+
title: {
15+
type: 'String',
16+
required: false,
17+
},
18+
image: {
19+
type: 'String',
20+
required: false,
21+
},
22+
companyIcon: {
23+
type: 'String',
24+
required: false,
25+
},
26+
},
27+
};

0 commit comments

Comments
 (0)