@xyd-js/components 0.1.0-build.168
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/.idea/git_toolbox_blame.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/.idea/xyd-components.iml +12 -0
- package/CHANGELOG.md +1369 -0
- package/LICENSE +21 -0
- package/README.md +3 -0
- package/TODO.md +1 -0
- package/coder.ts +1 -0
- package/content.ts +1 -0
- package/dist/Button-BLA2ghHZ.js +2 -0
- package/dist/Button-BLA2ghHZ.js.map +1 -0
- package/dist/Button-BTJ2hIal.js +2 -0
- package/dist/Button-BTJ2hIal.js.map +1 -0
- package/dist/Button-r4BCrEjy.js +2 -0
- package/dist/Button-r4BCrEjy.js.map +1 -0
- package/dist/CodeSample-BZ5tvyWY.js +2 -0
- package/dist/CodeSample-BZ5tvyWY.js.map +1 -0
- package/dist/CodeSample-BqXDbWdi.js +2 -0
- package/dist/CodeSample-BqXDbWdi.js.map +1 -0
- package/dist/CodeSample-Cqv86IdN.js +2 -0
- package/dist/CodeSample-Cqv86IdN.js.map +1 -0
- package/dist/Icon--77MqplU.js +2 -0
- package/dist/Icon--77MqplU.js.map +1 -0
- package/dist/Icon-DbNmvK_Q.js +2 -0
- package/dist/Icon-DbNmvK_Q.js.map +1 -0
- package/dist/Icon-uVIU1LW6.js +2 -0
- package/dist/Icon-uVIU1LW6.js.map +1 -0
- package/dist/PageFirstSlide-BDNmCTiJ.js +2 -0
- package/dist/PageFirstSlide-BDNmCTiJ.js.map +1 -0
- package/dist/PageFirstSlide-BpZ42bEU.js +2 -0
- package/dist/PageFirstSlide-BpZ42bEU.js.map +1 -0
- package/dist/PageFirstSlide-CqxiyK57.js +2 -0
- package/dist/PageFirstSlide-CqxiyK57.js.map +1 -0
- package/dist/TabsAnalytics-B_JYpawG.js +2 -0
- package/dist/TabsAnalytics-B_JYpawG.js.map +1 -0
- package/dist/TabsAnalytics-DAOfTZgv.js +2 -0
- package/dist/TabsAnalytics-DAOfTZgv.js.map +1 -0
- package/dist/TabsAnalytics-Dhyadlbu.js +2 -0
- package/dist/TabsAnalytics-Dhyadlbu.js.map +1 -0
- package/dist/Update-53fEhmjh.js +2 -0
- package/dist/Update-53fEhmjh.js.map +1 -0
- package/dist/Update-CFi6uapq.js +2 -0
- package/dist/Update-CFi6uapq.js.map +1 -0
- package/dist/Update-CiMIOgZi.js +2 -0
- package/dist/Update-CiMIOgZi.js.map +1 -0
- package/dist/VideoGuide-C0K9fFar.js +2 -0
- package/dist/VideoGuide-C0K9fFar.js.map +1 -0
- package/dist/VideoGuide-CJYkuLst.js +2 -0
- package/dist/VideoGuide-CJYkuLst.js.map +1 -0
- package/dist/VideoGuide-DBY-EyxG.js +2 -0
- package/dist/VideoGuide-DBY-EyxG.js.map +1 -0
- package/dist/_rollupPluginBabelHelpers-CvhQFv1t.js +4 -0
- package/dist/_rollupPluginBabelHelpers-CvhQFv1t.js.map +1 -0
- package/dist/_rollupPluginBabelHelpers-DSwDY1Dm.js +4 -0
- package/dist/_rollupPluginBabelHelpers-DSwDY1Dm.js.map +1 -0
- package/dist/_rollupPluginBabelHelpers-Dc-ocx4G.js +4 -0
- package/dist/_rollupPluginBabelHelpers-Dc-ocx4G.js.map +1 -0
- package/dist/coder/themes/classic.css +57 -0
- package/dist/coder/themes/classic.d.ts +96 -0
- package/dist/coder/themes/classic.js +2 -0
- package/dist/coder/themes/classic.js.map +1 -0
- package/dist/coder/themes/cosmo.css +64 -0
- package/dist/coder/themes/cosmo.d.ts +96 -0
- package/dist/coder/themes/cosmo.js +2 -0
- package/dist/coder/themes/cosmo.js.map +1 -0
- package/dist/coder.d.ts +94 -0
- package/dist/coder.js +2 -0
- package/dist/coder.js.map +1 -0
- package/dist/content.d.ts +411 -0
- package/dist/content.js +2 -0
- package/dist/content.js.map +1 -0
- package/dist/index.css +282 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/layouts.d.ts +33 -0
- package/dist/layouts.js +2 -0
- package/dist/layouts.js.map +1 -0
- package/dist/pages.d.ts +176 -0
- package/dist/pages.js +2 -0
- package/dist/pages.js.map +1 -0
- package/dist/system.d.ts +45 -0
- package/dist/system.js +2 -0
- package/dist/system.js.map +1 -0
- package/dist/useUXClick-DK3cTAMR.js +2 -0
- package/dist/useUXClick-DK3cTAMR.js.map +1 -0
- package/dist/useUXClick-DO6qBcRy.js +2 -0
- package/dist/useUXClick-DO6qBcRy.js.map +1 -0
- package/dist/useUXClick-NwpsiuK9.js +2 -0
- package/dist/useUXClick-NwpsiuK9.js.map +1 -0
- package/dist/useUXEvents-CJtgGV4R.js +2 -0
- package/dist/useUXEvents-CJtgGV4R.js.map +1 -0
- package/dist/useUXEvents-Cxgl7xb-.js +2 -0
- package/dist/useUXEvents-Cxgl7xb-.js.map +1 -0
- package/dist/useUXEvents-XqAGxoEj.js +2 -0
- package/dist/useUXEvents-XqAGxoEj.js.map +1 -0
- package/dist/useUXScrollDepth-3rk3Z95r.js +2 -0
- package/dist/useUXScrollDepth-3rk3Z95r.js.map +1 -0
- package/dist/useUXScrollDepth-BwK-XOBg.js +2 -0
- package/dist/useUXScrollDepth-BwK-XOBg.js.map +1 -0
- package/dist/useUXScrollDepth-DKre7PBz.js +2 -0
- package/dist/useUXScrollDepth-DKre7PBz.js.map +1 -0
- package/dist/uxsdk.d.ts +53 -0
- package/dist/uxsdk.js +2 -0
- package/dist/uxsdk.js.map +1 -0
- package/dist/views.d.ts +18 -0
- package/dist/views.js +2 -0
- package/dist/views.js.map +1 -0
- package/dist/writer.d.ts +580 -0
- package/dist/writer.js +2 -0
- package/dist/writer.js.map +1 -0
- package/docs/.nojekyll +1 -0
- package/docs/assets/hierarchy.js +1 -0
- package/docs/assets/highlight.css +22 -0
- package/docs/assets/icons.js +18 -0
- package/docs/assets/icons.svg +1 -0
- package/docs/assets/main.js +60 -0
- package/docs/assets/navigation.js +1 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1640 -0
- package/docs/functions/GuideCard.html +6 -0
- package/docs/hierarchy.html +1 -0
- package/docs/index.html +2 -0
- package/docs/interfaces/GuideCardProps.html +18 -0
- package/docs/modules.html +1 -0
- package/index.ts +0 -0
- package/layouts.ts +1 -0
- package/output.txt +13 -0
- package/package.json +81 -0
- package/pages.ts +1 -0
- package/postcss.config.cjs +5 -0
- package/rollup.config.js +195 -0
- package/src/coder/Code/Code.styles.tsx +151 -0
- package/src/coder/Code/Code.tsx +171 -0
- package/src/coder/Code/CodeLoader.tsx +10 -0
- package/src/coder/Code/annotations.tsx +51 -0
- package/src/coder/Code/highlight.ts +208 -0
- package/src/coder/Code/index.ts +16 -0
- package/src/coder/CodeCopy/CodeCopy.styles.tsx +21 -0
- package/src/coder/CodeCopy/CodeCopy.tsx +36 -0
- package/src/coder/CodeCopy/index.ts +7 -0
- package/src/coder/CodeSample/CodeSample.tsx +118 -0
- package/src/coder/CodeSample/CodeSampleAnalytics.tsx +112 -0
- package/src/coder/CodeSample/index.ts +11 -0
- package/src/coder/CodeSample/withLocalStored.tsx +50 -0
- package/src/coder/CodeTabs/CodeTabs.styles.tsx +126 -0
- package/src/coder/CodeTabs/CodeTabs.tsx +128 -0
- package/src/coder/CodeTabs/index.ts +6 -0
- package/src/coder/CodeTheme/CodeTheme.tsx +126 -0
- package/src/coder/CodeTheme/index.ts +7 -0
- package/src/coder/CoderProvider.tsx +26 -0
- package/src/coder/README.md +1 -0
- package/src/coder/hooks/highlight.ts +182 -0
- package/src/coder/index.ts +37 -0
- package/src/coder/themes/classic.css +57 -0
- package/src/coder/themes/classic.ts +270 -0
- package/src/coder/themes/cosmo.css +64 -0
- package/src/coder/themes/cosmo.ts +264 -0
- package/src/content/AppearanceDecorator.styles.tsx +11 -0
- package/src/content/ContentDecoator.styles.tsx +180 -0
- package/src/content/ContentDecorator.tsx +17 -0
- package/src/content/GridDecorator.styles.tsx +86 -0
- package/src/content/GridDecorator.tsx +23 -0
- package/src/content/ReactContent.tsx +671 -0
- package/src/content/TODO.md +1 -0
- package/src/content/index.ts +13 -0
- package/src/kit/Loader/Loader.styles.tsx +53 -0
- package/src/kit/Loader/Loader.tsx +22 -0
- package/src/kit/TODO.md +2 -0
- package/src/kit/index.ts +1 -0
- package/src/layouts/LayoutPrimary/LayoutPrimary.styles.tsx +325 -0
- package/src/layouts/LayoutPrimary/LayoutPrimary.tsx +252 -0
- package/src/layouts/LayoutPrimary/index.ts +3 -0
- package/src/layouts/index.ts +6 -0
- package/src/pages/PageBlogHome/PageBlogHome.styles.tsx +67 -0
- package/src/pages/PageBlogHome/PageBlogHome.tsx +64 -0
- package/src/pages/PageBlogHome/index.ts +3 -0
- package/src/pages/PageBlogHome/types.ts +35 -0
- package/src/pages/PageBlogPost/PageBlogPost.styles.tsx +4 -0
- package/src/pages/PageBlogPost/PageBlogPost.tsx +9 -0
- package/src/pages/PageBlogPost/index.ts +3 -0
- package/src/pages/PageFirstSlide/PageFirstSlide.styles.tsx +134 -0
- package/src/pages/PageFirstSlide/PageFirstSlide.tsx +56 -0
- package/src/pages/PageFirstSlide/index.ts +1 -0
- package/src/pages/PageFirstSlide/types.ts +67 -0
- package/src/pages/PageHome/PageHome.styles.tsx +51 -0
- package/src/pages/PageHome/PageHome.tsx +62 -0
- package/src/pages/PageHome/index.ts +3 -0
- package/src/pages/PageHome/types.ts +79 -0
- package/src/pages/index.ts +7 -0
- package/src/system/Baseline/Baseline.styles.tsx +128 -0
- package/src/system/Baseline/Baseline.tsx +40 -0
- package/src/system/Baseline/bun.svg +1 -0
- package/src/system/Baseline/check.svg +1 -0
- package/src/system/Baseline/index.ts +1 -0
- package/src/system/Baseline/logo.svg +1 -0
- package/src/system/Baseline/node.svg +7 -0
- package/src/system/Baseline/npm.svg +5 -0
- package/src/system/Baseline/pnpm.svg +1 -0
- package/src/system/Footer/Footer.styles.tsx +213 -0
- package/src/system/Footer/Footer.tsx +105 -0
- package/src/system/Footer/index.ts +1 -0
- package/src/system/SearchButton/SearchButton.styles.tsx +89 -0
- package/src/system/SearchButton/SearchButton.tsx +118 -0
- package/src/system/SearchButton/index.ts +1 -0
- package/src/system/index.ts +3 -0
- package/src/utils/useStyle.ts +19 -0
- package/src/uxsdk/const.ts +1 -0
- package/src/uxsdk/index.ts +21 -0
- package/src/uxsdk/useUXClick.ts +21 -0
- package/src/uxsdk/useUXEvents.ts +105 -0
- package/src/uxsdk/useUXScrollDepth.ts +49 -0
- package/src/uxsdk/useUXUnreachableElementTracker.ts +100 -0
- package/src/views/HomeView/HomeView.styles.tsx +37 -0
- package/src/views/HomeView/HomeView.tsx +34 -0
- package/src/views/HomeView/index.ts +3 -0
- package/src/writer/Anchor/Anchor.styles.tsx +26 -0
- package/src/writer/Anchor/Anchor.tsx +51 -0
- package/src/writer/Anchor/index.tsx +1 -0
- package/src/writer/Badge/Badge.styles.tsx +44 -0
- package/src/writer/Badge/Badge.tsx +47 -0
- package/src/writer/Badge/index.ts +7 -0
- package/src/writer/Banner/Banner.styles.tsx +111 -0
- package/src/writer/Banner/Banner.tsx +151 -0
- package/src/writer/Banner/index.ts +1 -0
- package/src/writer/Blockquote/Blockquote.styles.tsx +20 -0
- package/src/writer/Blockquote/Blockquote.tsx +38 -0
- package/src/writer/Blockquote/index.ts +7 -0
- package/src/writer/BlogCard/BlogCard.styles.tsx +4 -0
- package/src/writer/BlogCard/BlogCard.tsx +9 -0
- package/src/writer/BlogCard/index.ts +3 -0
- package/src/writer/Breadcrumbs/Breadcrumbs.styles.ts +24 -0
- package/src/writer/Breadcrumbs/Breadcrumbs.tsx +57 -0
- package/src/writer/Breadcrumbs/index.ts +7 -0
- package/src/writer/Button/Button.styles.tsx +149 -0
- package/src/writer/Button/Button.tsx +82 -0
- package/src/writer/Button/index.ts +2 -0
- package/src/writer/Callout/Callout.styles.tsx +102 -0
- package/src/writer/Callout/Callout.tsx +166 -0
- package/src/writer/Callout/index.tsx +3 -0
- package/src/writer/Card/Card.styles.tsx +110 -0
- package/src/writer/Card/Card.tsx +94 -0
- package/src/writer/Card/index.ts +1 -0
- package/src/writer/Code/Code.styles.tsx +16 -0
- package/src/writer/Code/Code.tsx +16 -0
- package/src/writer/Code/index.ts +3 -0
- package/src/writer/ColorSchemeButton/ColorSchemeButton.tsx +191 -0
- package/src/writer/ColorSchemeButton/index.ts +1 -0
- package/src/writer/Details/Details.styles.tsx +101 -0
- package/src/writer/Details/Details.tsx +168 -0
- package/src/writer/Details/DetailsProps.tsx +34 -0
- package/src/writer/Details/index.ts +6 -0
- package/src/writer/GuideCard/GuideCard.styles.tsx +129 -0
- package/src/writer/GuideCard/GuideCard.tsx +123 -0
- package/src/writer/GuideCard/index.ts +1 -0
- package/src/writer/Heading/Heading.styles.tsx +93 -0
- package/src/writer/Heading/Heading.tsx +123 -0
- package/src/writer/Heading/index.ts +7 -0
- package/src/writer/Hr/Hr.styles.tsx +7 -0
- package/src/writer/Hr/Hr.tsx +10 -0
- package/src/writer/Hr/index.ts +3 -0
- package/src/writer/Icon/Icon.styles.tsx +15 -0
- package/src/writer/Icon/Icon.tsx +99 -0
- package/src/writer/Icon/index.ts +1 -0
- package/src/writer/IconSocial/IconSocial.tsx +107 -0
- package/src/writer/IconSocial/index.ts +1 -0
- package/src/writer/Image/Image.styles.tsx +9 -0
- package/src/writer/Image/Image.tsx +35 -0
- package/src/writer/Image/index.ts +1 -0
- package/src/writer/List/List.styles.tsx +47 -0
- package/src/writer/List/List.tsx +29 -0
- package/src/writer/List/index.ts +4 -0
- package/src/writer/NavLinks/NavLinks.styles.ts +32 -0
- package/src/writer/NavLinks/NavLinks.tsx +95 -0
- package/src/writer/NavLinks/index.ts +7 -0
- package/src/writer/Pre/Pre.styles.tsx +13 -0
- package/src/writer/Pre/Pre.tsx +14 -0
- package/src/writer/Pre/index.ts +3 -0
- package/src/writer/README.md +1 -0
- package/src/writer/Steps/Steps.styles.tsx +91 -0
- package/src/writer/Steps/Steps.tsx +75 -0
- package/src/writer/Steps/index.ts +5 -0
- package/src/writer/Table/Table.styles.tsx +100 -0
- package/src/writer/Table/Table.tsx +158 -0
- package/src/writer/Table/index.ts +3 -0
- package/src/writer/Tabs/Tabs.tsx +67 -0
- package/src/writer/Tabs/TabsAnalytics.tsx +25 -0
- package/src/writer/Tabs/TabsPrimary.styles.tsx +187 -0
- package/src/writer/Tabs/TabsPrimary.tsx +215 -0
- package/src/writer/Tabs/TabsProps.tsx +13 -0
- package/src/writer/Tabs/TabsSecondary.styles.tsx +78 -0
- package/src/writer/Tabs/TabsSecondary.tsx +176 -0
- package/src/writer/Tabs/index.ts +2 -0
- package/src/writer/Tabs/useValueChange.ts +84 -0
- package/src/writer/Text/Text.styles.tsx +66 -0
- package/src/writer/Text/Text.tsx +79 -0
- package/src/writer/Text/index.ts +3 -0
- package/src/writer/TocCard/TocCard.module.css +44 -0
- package/src/writer/TocCard/TocCard.tsx +42 -0
- package/src/writer/TocCard/index.ts +3 -0
- package/src/writer/Update/Update.styles.tsx +33 -0
- package/src/writer/Update/Update.tsx +37 -0
- package/src/writer/Update/index.ts +1 -0
- package/src/writer/VideoGuide/VideoGuide.module.css +105 -0
- package/src/writer/VideoGuide/VideoGuide.tsx +75 -0
- package/src/writer/VideoGuide/index.ts +1 -0
- package/src/writer/index.ts +53 -0
- package/system.ts +1 -0
- package/tsconfig.json +46 -0
- package/types.d.ts +52 -0
- package/uxsdk.ts +1 -0
- package/views.ts +2 -0
- package/writer.ts +1 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { css } from "@linaria/core"
|
|
2
|
+
|
|
3
|
+
export const PageBlogHome = css`
|
|
4
|
+
--page-blog-home-padding: calc(var(--xyd-nav-item-padding) + var(--xyd-nav-padding));
|
|
5
|
+
max-width: var(--page-bloghome-max-width, 800px);
|
|
6
|
+
margin: 0 auto;
|
|
7
|
+
padding: 48px var(--page-blog-home-padding) 0 var(--page-blog-home-padding);
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
|
|
11
|
+
[part="posts"] {
|
|
12
|
+
--spacing: .25rem;
|
|
13
|
+
display: grid;
|
|
14
|
+
grid-template-columns: repeat(auto-fill, minmax(calc(var(--spacing) * 80), 1fr));
|
|
15
|
+
grid-gap: calc(var(--spacing) * 12) calc(var(--spacing) * 8);
|
|
16
|
+
min-height: 430px;
|
|
17
|
+
|
|
18
|
+
margin-top: 24px;
|
|
19
|
+
margin-bottom: 24px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
[part="pagination"] {
|
|
23
|
+
margin-top: 32px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
[part="card-content"] {
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
gap: 12px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
[part="card-image"] {
|
|
33
|
+
width: 100%;
|
|
34
|
+
height: 180px;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
border-radius: 8px;
|
|
37
|
+
margin-bottom: 16px;
|
|
38
|
+
img {
|
|
39
|
+
width: 100%;
|
|
40
|
+
height: 100%;
|
|
41
|
+
object-fit: cover;
|
|
42
|
+
display: block;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
[part="card-author-row"] {
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: end;
|
|
49
|
+
flex: 1;
|
|
50
|
+
gap: 8px;
|
|
51
|
+
margin-top: 8px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
[part="card-author-avatar"] {
|
|
55
|
+
width: 32px;
|
|
56
|
+
height: 32px;
|
|
57
|
+
border-radius: 50%;
|
|
58
|
+
object-fit: cover;
|
|
59
|
+
display: block;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
xyd-guidecard {
|
|
63
|
+
[part="right"], [part="body"], [part="card-content"] {
|
|
64
|
+
height: 100%;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
`;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
|
|
3
|
+
import { Heading, NavLinks, Tabs, GuideCard, Text } from "../../writer"
|
|
4
|
+
|
|
5
|
+
import * as cn from "./PageBlogHome.styles"
|
|
6
|
+
import { PageBlogHomeProps, BlogPost, BlogTab } from "./types"
|
|
7
|
+
|
|
8
|
+
export function PageBlogHome({
|
|
9
|
+
posts = [],
|
|
10
|
+
tabs = [],
|
|
11
|
+
initialTab,
|
|
12
|
+
heading,
|
|
13
|
+
subheading,
|
|
14
|
+
prevLink,
|
|
15
|
+
nextLink,
|
|
16
|
+
as = "",
|
|
17
|
+
}: PageBlogHomeProps) {
|
|
18
|
+
const [tab, setTab] = React.useState(initialTab || (tabs && tabs[0]?.value) || "")
|
|
19
|
+
|
|
20
|
+
const filteredPosts = React.useMemo(() => {
|
|
21
|
+
if (tab === "everything") return posts
|
|
22
|
+
return posts?.filter(post => post.tag.toLowerCase() === tab)
|
|
23
|
+
}, [tab, posts])
|
|
24
|
+
|
|
25
|
+
return <page-blog-home className={cn.PageBlogHome}>
|
|
26
|
+
<Heading size={1} subtitle={subheading}>{heading}</Heading>
|
|
27
|
+
<Tabs value={tab} onChange={setTab}>
|
|
28
|
+
{tabs.map(t => (
|
|
29
|
+
<Tabs.Item as={as} href={t.href} value={t.value}>{t.label}</Tabs.Item>
|
|
30
|
+
))}
|
|
31
|
+
</Tabs>
|
|
32
|
+
<div part="posts">
|
|
33
|
+
{filteredPosts.map(post => (
|
|
34
|
+
<GuideCard
|
|
35
|
+
key={post.id}
|
|
36
|
+
href={post.href}
|
|
37
|
+
kind="secondary"
|
|
38
|
+
size="md"
|
|
39
|
+
>
|
|
40
|
+
<div part="card-content">
|
|
41
|
+
<div part="card-image">
|
|
42
|
+
<img src={post.image} alt={post.title} />
|
|
43
|
+
</div>
|
|
44
|
+
<Text size="small" kind="primary" as="span">{post.tag}</Text>
|
|
45
|
+
<GuideCard.Title>
|
|
46
|
+
<Text size="large" weight="bold" as="span">{post.title}</Text>
|
|
47
|
+
</GuideCard.Title>
|
|
48
|
+
<div part="card-author-row">
|
|
49
|
+
<img src={post.author.avatar} alt={post.author.name} part="card-author-avatar" />
|
|
50
|
+
<Text size="small" as="span">{post.author.name}</Text>
|
|
51
|
+
<Text size="small" kind="secondary" as="span">{post.date}</Text>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</GuideCard>
|
|
55
|
+
))}
|
|
56
|
+
</div>
|
|
57
|
+
<div part="pagination">
|
|
58
|
+
<NavLinks
|
|
59
|
+
prev={prevLink}
|
|
60
|
+
next={nextLink}
|
|
61
|
+
/>
|
|
62
|
+
</div>
|
|
63
|
+
</page-blog-home>
|
|
64
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface BlogPostAuthor {
|
|
2
|
+
name: string;
|
|
3
|
+
avatar: string;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface BlogPost {
|
|
7
|
+
id: number;
|
|
8
|
+
title: string;
|
|
9
|
+
image: string;
|
|
10
|
+
tag: string;
|
|
11
|
+
author: BlogPostAuthor;
|
|
12
|
+
date: string;
|
|
13
|
+
href: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface BlogTab {
|
|
17
|
+
value: string;
|
|
18
|
+
label: string;
|
|
19
|
+
href?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface BlogPaginationLink {
|
|
23
|
+
title: string;
|
|
24
|
+
href: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface PageBlogHomeProps {
|
|
28
|
+
posts: BlogPost[];
|
|
29
|
+
tabs: BlogTab[];
|
|
30
|
+
initialTab?: string;
|
|
31
|
+
heading?: string;
|
|
32
|
+
subheading?: string;
|
|
33
|
+
prevLink?: BlogPaginationLink;
|
|
34
|
+
nextLink?: BlogPaginationLink;
|
|
35
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { css } from "@linaria/core";
|
|
2
|
+
|
|
3
|
+
export const globals = css`
|
|
4
|
+
:global() {
|
|
5
|
+
@layer themedecorator {
|
|
6
|
+
xyd-layout-primary[data-layout="page"] {
|
|
7
|
+
[part="page-article-content"] {
|
|
8
|
+
height: 100%;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
@media (min-width: 1024px) {
|
|
12
|
+
xyd-layout-primary[data-layout="page"] {
|
|
13
|
+
grid-template-rows: auto 1fr auto;
|
|
14
|
+
grid-template-columns: 1fr;
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: max-content;
|
|
17
|
+
min-height: 100%;
|
|
18
|
+
display: grid;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
body:has(xyd-layout-primary[data-layout="page"]) {
|
|
23
|
+
height: 100%;
|
|
24
|
+
}
|
|
25
|
+
html:has(body xyd-layout-primary[data-layout="page"]) {
|
|
26
|
+
height: 100%;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
[data-color-scheme="dark"] {
|
|
30
|
+
--page-first-slide-special-text-color: var(--xyd-heading-color, #fff);
|
|
31
|
+
}
|
|
32
|
+
@media (prefers-color-scheme: dark) {
|
|
33
|
+
--page-first-slide-special-text-color: var(--xyd-heading-color, #fff);
|
|
34
|
+
}
|
|
35
|
+
@media (prefers-color-scheme: dark) {
|
|
36
|
+
:root:not([data-color-scheme="light"]):not([data-color-scheme="dark"]) {
|
|
37
|
+
--page-first-slide-special-text-color: var(--xyd-heading-color, #fff);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
`
|
|
43
|
+
|
|
44
|
+
export const PageFirstSlide = css`
|
|
45
|
+
display: grid;
|
|
46
|
+
grid-template-columns: 2fr 3fr;
|
|
47
|
+
gap: 60px;
|
|
48
|
+
align-items: center;
|
|
49
|
+
max-width: var(--page-first-slide-container-width, var(--page-home-container-width, 1200px));
|
|
50
|
+
margin: 0 auto;
|
|
51
|
+
padding: 50px;
|
|
52
|
+
height: 100%;
|
|
53
|
+
|
|
54
|
+
[part="left"] {
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
gap: 24px;
|
|
58
|
+
|
|
59
|
+
h1 {
|
|
60
|
+
--special-text-color: var(--page-first-slide-special-text-color, #353535);
|
|
61
|
+
background-image: linear-gradient(180deg, var(--special-text-color) 0%,
|
|
62
|
+
color-mix(in oklab, var(--special-text-color) 80%, transparent) 100%);
|
|
63
|
+
background-clip: text;
|
|
64
|
+
-webkit-text-fill-color: transparent;
|
|
65
|
+
-webkit-background-clip: text;
|
|
66
|
+
font-size: var(--xyd-font-size-3xl);
|
|
67
|
+
line-height: var(--xyd-line-height-3xl);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
[part="buttons"] {
|
|
72
|
+
display: flex;
|
|
73
|
+
flex-direction: column;
|
|
74
|
+
gap: 16px;
|
|
75
|
+
margin-top: 16px;
|
|
76
|
+
|
|
77
|
+
[data-button="true"] {
|
|
78
|
+
width: 100%;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
[part="right"] {
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
justify-content: center;
|
|
86
|
+
min-height: 400px;
|
|
87
|
+
|
|
88
|
+
img {
|
|
89
|
+
max-width: 100%;
|
|
90
|
+
height: auto;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
pre {
|
|
94
|
+
width: 100%;
|
|
95
|
+
max-width: 100%;
|
|
96
|
+
overflow-x: auto;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@media (max-width: 768px) {
|
|
101
|
+
grid-template-columns: 1fr;
|
|
102
|
+
gap: 40px;
|
|
103
|
+
padding: 40px 20px;
|
|
104
|
+
min-height: auto;
|
|
105
|
+
|
|
106
|
+
[part="left"] {
|
|
107
|
+
order: 1;
|
|
108
|
+
text-align: center;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
[part="right"] {
|
|
112
|
+
order: 2;
|
|
113
|
+
min-height: 300px;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
[part="buttons"] {
|
|
117
|
+
align-items: center;
|
|
118
|
+
|
|
119
|
+
[data-button="true"] {
|
|
120
|
+
width: 100%;
|
|
121
|
+
max-width: 300px;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
xyd-codetabs {
|
|
127
|
+
width: 100%;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
@media (max-width: 480px) {
|
|
131
|
+
padding: 20px 16px;
|
|
132
|
+
gap: 32px;
|
|
133
|
+
}
|
|
134
|
+
`;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
Heading,
|
|
5
|
+
Button,
|
|
6
|
+
} from "../../writer";
|
|
7
|
+
|
|
8
|
+
import { PageFirstSlideProps } from "./types";
|
|
9
|
+
|
|
10
|
+
import * as cn from "./PageFirstSlide.styles"
|
|
11
|
+
|
|
12
|
+
export function PageFirstSlide(props: PageFirstSlideProps) {
|
|
13
|
+
return <page-first-slide className={cn.PageFirstSlide}>
|
|
14
|
+
<div part="left">
|
|
15
|
+
{props.content?.title && (
|
|
16
|
+
<Heading size={1}>
|
|
17
|
+
{props.content.title}
|
|
18
|
+
</Heading>
|
|
19
|
+
)}
|
|
20
|
+
|
|
21
|
+
{props.content?.description && (
|
|
22
|
+
<Heading size={4} kind="muted">
|
|
23
|
+
{props.content.description}
|
|
24
|
+
</Heading>
|
|
25
|
+
)}
|
|
26
|
+
|
|
27
|
+
<div part="buttons">
|
|
28
|
+
{props.content?.primaryButton && (
|
|
29
|
+
<Button
|
|
30
|
+
href={props.content.primaryButton.href}
|
|
31
|
+
kind={props.content.primaryButton.kind || "primary"}
|
|
32
|
+
size="lg"
|
|
33
|
+
disabled={props.content.primaryButton.disabled}
|
|
34
|
+
>
|
|
35
|
+
{props.content.primaryButton.title}
|
|
36
|
+
</Button>
|
|
37
|
+
)}
|
|
38
|
+
|
|
39
|
+
{props.content?.secondaryButton && (
|
|
40
|
+
<Button
|
|
41
|
+
href={props.content.secondaryButton.href}
|
|
42
|
+
kind={props.content.secondaryButton.kind || "secondary"}
|
|
43
|
+
size="lg"
|
|
44
|
+
disabled={props.content.secondaryButton.disabled}
|
|
45
|
+
>
|
|
46
|
+
{props.content.secondaryButton.title}
|
|
47
|
+
</Button>
|
|
48
|
+
)}
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<div part="right">
|
|
53
|
+
{props.rightContent}
|
|
54
|
+
</div>
|
|
55
|
+
</page-first-slide>
|
|
56
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./PageFirstSlide"
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Props for the PageFirstSlide component.
|
|
5
|
+
*/
|
|
6
|
+
export interface PageFirstSlideProps {
|
|
7
|
+
/**
|
|
8
|
+
* The main content for the slide.
|
|
9
|
+
*/
|
|
10
|
+
content?: PageFirstSlideContent;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Optional React node to display on the right side.
|
|
14
|
+
*/
|
|
15
|
+
rightContent?: React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/*
|
|
19
|
+
* Represents a button displayed on the first slide page.
|
|
20
|
+
*/
|
|
21
|
+
export interface PageFirstSlideButton {
|
|
22
|
+
/*
|
|
23
|
+
* The button label.
|
|
24
|
+
*/
|
|
25
|
+
title: string;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The URL the button links to.
|
|
29
|
+
*/
|
|
30
|
+
href: string;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The visual style of the button.
|
|
34
|
+
*/
|
|
35
|
+
kind?: "primary" | "secondary";
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Whether the button is disabled.
|
|
39
|
+
*/
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/*
|
|
44
|
+
* Content structure for the PageFirstSlide component.
|
|
45
|
+
*/
|
|
46
|
+
export interface PageFirstSlideContent {
|
|
47
|
+
/**
|
|
48
|
+
* The main title text.
|
|
49
|
+
*/
|
|
50
|
+
title?: string;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The description text.
|
|
54
|
+
*/
|
|
55
|
+
description?: string;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The primary action button.
|
|
59
|
+
*/
|
|
60
|
+
primaryButton?: PageFirstSlideButton;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The secondary action button.
|
|
64
|
+
*/
|
|
65
|
+
secondaryButton?: PageFirstSlideButton;
|
|
66
|
+
}
|
|
67
|
+
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { css } from "@linaria/core";
|
|
2
|
+
|
|
3
|
+
export const globals = css`
|
|
4
|
+
:global() {
|
|
5
|
+
:root {
|
|
6
|
+
--page-home-hero-font-size: 50px;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
`;
|
|
10
|
+
|
|
11
|
+
export const PageHome = css`
|
|
12
|
+
[part="hero"] {
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
padding: 80px 50px;
|
|
18
|
+
background: var(--page-home-hero-background);
|
|
19
|
+
|
|
20
|
+
h1 {
|
|
21
|
+
font-size: var(--page-home-hero-font-size, 50px);
|
|
22
|
+
text-align: center;
|
|
23
|
+
}
|
|
24
|
+
h1, h2, h3, h4, h5, h6 {
|
|
25
|
+
font-weight: 400;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
img {
|
|
29
|
+
width: auto;
|
|
30
|
+
max-height: 60px;
|
|
31
|
+
padding-bottom: 18px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
[data-button="true"] {
|
|
35
|
+
margin-top: var(--xyd-padding-xlarge);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
[part="sections"] {
|
|
40
|
+
max-width: var(--page-home-container-width, 1300px);
|
|
41
|
+
margin: 0 auto;
|
|
42
|
+
padding: 30px 100px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@media (max-width: 1024px) {
|
|
46
|
+
[part="sections"] {
|
|
47
|
+
padding: 25px;
|
|
48
|
+
padding-inline: var(--theme-sidebar-padding-total, 25px);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
`;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
Heading,
|
|
5
|
+
GuideCard,
|
|
6
|
+
List,
|
|
7
|
+
Button,
|
|
8
|
+
} from "../../writer";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
import { PageHomeProps } from "./types";
|
|
12
|
+
import { GridDecorator } from "../../content/GridDecorator";
|
|
13
|
+
|
|
14
|
+
import * as cn from "./PageHome.styles"
|
|
15
|
+
|
|
16
|
+
export function PageHome(props: PageHomeProps) {
|
|
17
|
+
return <page-home className={cn.PageHome}>
|
|
18
|
+
<div part="hero">
|
|
19
|
+
{props?.hero?.image ? <img src={props.hero.image} alt={props.hero.title} /> : null}
|
|
20
|
+
<Heading size={1}>
|
|
21
|
+
{props.hero?.title}
|
|
22
|
+
</Heading>
|
|
23
|
+
<Heading size={3} kind="muted">
|
|
24
|
+
{props.hero?.description}
|
|
25
|
+
</Heading>
|
|
26
|
+
|
|
27
|
+
{props?.hero?.button ? <Button href={props.hero.button.href}>{props.hero.button.title}</Button> : null}
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<div part="sections">
|
|
31
|
+
{
|
|
32
|
+
props.sections?.map((section, index) => <React.Fragment key={`${section.title}-${index}`}>
|
|
33
|
+
{
|
|
34
|
+
section?.title ? <div part="section-title">
|
|
35
|
+
<Heading size={3}>
|
|
36
|
+
{section.title}
|
|
37
|
+
</Heading>
|
|
38
|
+
</div> : null
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
{
|
|
42
|
+
section?.cards?.length ? <div part="section-cards">
|
|
43
|
+
<GridDecorator cols={3}>
|
|
44
|
+
<List>
|
|
45
|
+
<List.Item>
|
|
46
|
+
<List>
|
|
47
|
+
{section.cards?.map((card, index) => (
|
|
48
|
+
<List.Item key={`${card.title}-${index}`}>
|
|
49
|
+
<GuideCard {...card} />
|
|
50
|
+
</List.Item>
|
|
51
|
+
))}
|
|
52
|
+
</List>
|
|
53
|
+
</List.Item>
|
|
54
|
+
</List>
|
|
55
|
+
</GridDecorator>
|
|
56
|
+
</div> : null
|
|
57
|
+
}
|
|
58
|
+
</React.Fragment>)
|
|
59
|
+
}
|
|
60
|
+
</div>
|
|
61
|
+
</page-home>
|
|
62
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { GuideCardProps } from "../../writer/GuideCard/GuideCard";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Props for the PageHome component.
|
|
5
|
+
*/
|
|
6
|
+
export interface PageHomeProps {
|
|
7
|
+
/**
|
|
8
|
+
* Hero section content for the home page.
|
|
9
|
+
*/
|
|
10
|
+
hero?: PageHomeHero;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Sections to display on the home page.
|
|
14
|
+
*/
|
|
15
|
+
sections?: PageHomeSection[];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Button used in the hero section of the home page.
|
|
20
|
+
*/
|
|
21
|
+
export interface PageHomeHeroButton {
|
|
22
|
+
/**
|
|
23
|
+
* The button label.
|
|
24
|
+
*/
|
|
25
|
+
title: string;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The URL the button links to.
|
|
29
|
+
*/
|
|
30
|
+
href: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Hero section content for the home page.
|
|
35
|
+
*/
|
|
36
|
+
export interface PageHomeHero {
|
|
37
|
+
/**
|
|
38
|
+
* The main title text.
|
|
39
|
+
*/
|
|
40
|
+
title?: string;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The description text.
|
|
44
|
+
*/
|
|
45
|
+
description?: string;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The image URL for the hero section.
|
|
49
|
+
*/
|
|
50
|
+
image?: string;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The main button for the hero section.
|
|
54
|
+
*/
|
|
55
|
+
button?: PageHomeHeroButton;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Card displayed in a section on the home page. Extends GuideCardProps.
|
|
60
|
+
*/
|
|
61
|
+
export interface PageHomeCard extends GuideCardProps {
|
|
62
|
+
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Section displayed on the home page.
|
|
67
|
+
*/
|
|
68
|
+
export interface PageHomeSection {
|
|
69
|
+
/**
|
|
70
|
+
* The section title.
|
|
71
|
+
*/
|
|
72
|
+
title?: string;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Cards to display in the section.
|
|
76
|
+
*/
|
|
77
|
+
cards?: PageHomeCard[];
|
|
78
|
+
}
|
|
79
|
+
|