@xyd-js/components 0.1.0-xyd.7 → 0.1.0-xyd.8
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/CHANGELOG.md +6 -0
- package/LICENSE +21 -0
- package/dist/CTABanner-4FVIoaTR.js +2 -0
- package/dist/CTABanner-4FVIoaTR.js.map +1 -0
- package/dist/CTABanner-C6afsXoE.js +2 -0
- package/dist/CTABanner-C6afsXoE.js.map +1 -0
- package/dist/CTABanner-CEKs-Hb-.js +2 -0
- package/dist/CTABanner-CEKs-Hb-.js.map +1 -0
- package/dist/CTABanner-CUNcTr6s.js +2 -0
- package/dist/CTABanner-CUNcTr6s.js.map +1 -0
- package/dist/CTABanner-D02aIAsD.js +2 -0
- package/dist/CTABanner-D02aIAsD.js.map +1 -0
- package/dist/CTABanner-Dm3tUG3I.js +2 -0
- package/dist/CTABanner-Dm3tUG3I.js.map +1 -0
- package/dist/CTABanner-MCOcVowa.js +2 -0
- package/dist/CTABanner-MCOcVowa.js.map +1 -0
- package/dist/CTABanner-X6K49gSr.js +2 -0
- package/dist/CTABanner-X6K49gSr.js.map +1 -0
- package/dist/CodeSample-B9VUhTKF.js +2 -0
- package/dist/CodeSample-B9VUhTKF.js.map +1 -0
- package/dist/CodeSample-BSXeFy0x.js +2 -0
- package/dist/CodeSample-BSXeFy0x.js.map +1 -0
- package/dist/CodeSample-BwP208sQ.js +2 -0
- package/dist/CodeSample-BwP208sQ.js.map +1 -0
- package/dist/CodeSample-CUemtj_W.js +2 -0
- package/dist/CodeSample-CUemtj_W.js.map +1 -0
- package/dist/CodeSample-D0iKih-A.js +2 -0
- package/dist/CodeSample-D0iKih-A.js.map +1 -0
- package/dist/CodeSample-D33vTa6M.js +2 -0
- package/dist/CodeSample-D33vTa6M.js.map +1 -0
- package/dist/CodeSample-DUSx2KBt.js +2 -0
- package/dist/CodeSample-DUSx2KBt.js.map +1 -0
- package/dist/CodeSample-P4yxkHPW.js +2 -0
- package/dist/CodeSample-P4yxkHPW.js.map +1 -0
- package/dist/HomeView-ACBdUgyz.js +2 -0
- package/dist/HomeView-ACBdUgyz.js.map +1 -0
- package/dist/HomeView-B0ATNUF1.js +2 -0
- package/dist/HomeView-B0ATNUF1.js.map +1 -0
- package/dist/HomeView-COJrg8Ju.js +2 -0
- package/dist/HomeView-COJrg8Ju.js.map +1 -0
- package/dist/HomeView-Cun4apuy.js +2 -0
- package/dist/HomeView-Cun4apuy.js.map +1 -0
- package/dist/HomeView-D4DXEOOn.js +2 -0
- package/dist/HomeView-D4DXEOOn.js.map +1 -0
- package/dist/HomeView-DaH1PSBB.js +2 -0
- package/dist/HomeView-DaH1PSBB.js.map +1 -0
- package/dist/HomeView-O_lj2c2t.js +2 -0
- package/dist/HomeView-O_lj2c2t.js.map +1 -0
- package/dist/HomeView-_Nu2RcOM.js +2 -0
- package/dist/HomeView-_Nu2RcOM.js.map +1 -0
- package/dist/UnderlineNav-BCyB0G5d.js +2 -0
- package/dist/UnderlineNav-BCyB0G5d.js.map +1 -0
- package/dist/UnderlineNav-BEhDJk0H.js +2 -0
- package/dist/UnderlineNav-BEhDJk0H.js.map +1 -0
- package/dist/UnderlineNav-BqZ2xAp7.js +2 -0
- package/dist/UnderlineNav-BqZ2xAp7.js.map +1 -0
- package/dist/UnderlineNav-C2-4Vyj8.js +2 -0
- package/dist/UnderlineNav-C2-4Vyj8.js.map +1 -0
- package/dist/UnderlineNav-Co08Gykm.js +2 -0
- package/dist/UnderlineNav-Co08Gykm.js.map +1 -0
- package/dist/UnderlineNav-DC3UVmnZ.js +2 -0
- package/dist/UnderlineNav-DC3UVmnZ.js.map +1 -0
- package/dist/UnderlineNav-DsRYwuGB.js +2 -0
- package/dist/UnderlineNav-DsRYwuGB.js.map +1 -0
- package/dist/UnderlineNav-FbclXKUW.js +2 -0
- package/dist/UnderlineNav-FbclXKUW.js.map +1 -0
- package/dist/{_rollupPluginBabelHelpers-BMmCG_qQ.js → _rollupPluginBabelHelpers-BEouSrrZ.js} +2 -2
- package/dist/_rollupPluginBabelHelpers-BEouSrrZ.js.map +1 -0
- package/dist/{_rollupPluginBabelHelpers-DsEzE6Ab.js → _rollupPluginBabelHelpers-BHehKRBq.js} +2 -2
- package/dist/_rollupPluginBabelHelpers-BHehKRBq.js.map +1 -0
- package/dist/_rollupPluginBabelHelpers-Bunpz22T.js +2 -0
- package/dist/_rollupPluginBabelHelpers-Bunpz22T.js.map +1 -0
- package/dist/_rollupPluginBabelHelpers-CVblpRvU.js +2 -0
- package/dist/_rollupPluginBabelHelpers-CVblpRvU.js.map +1 -0
- package/dist/_rollupPluginBabelHelpers-CxmswfqM.js +2 -0
- package/dist/_rollupPluginBabelHelpers-CxmswfqM.js.map +1 -0
- package/dist/_rollupPluginBabelHelpers-DQJTK9EO.js +2 -0
- package/dist/_rollupPluginBabelHelpers-DQJTK9EO.js.map +1 -0
- package/dist/_rollupPluginBabelHelpers-DuRQdJ01.js +2 -0
- package/dist/_rollupPluginBabelHelpers-DuRQdJ01.js.map +1 -0
- package/dist/_rollupPluginBabelHelpers-tRAa4O0f.js +2 -0
- package/dist/_rollupPluginBabelHelpers-tRAa4O0f.js.map +1 -0
- package/dist/brand.d.ts +9 -9
- package/dist/brand.js +1 -1
- package/dist/brand.js.map +1 -1
- package/dist/coder.js +1 -1
- package/dist/content.d.ts +4 -3
- package/dist/content.js +1 -1
- package/dist/content.js.map +1 -1
- package/dist/index-B0FncPxO.js +2 -0
- package/dist/index-B0FncPxO.js.map +1 -0
- package/dist/index-BEm-xkm-.js +2 -0
- package/dist/index-BEm-xkm-.js.map +1 -0
- package/dist/index-BHwtxG27.js +2 -0
- package/dist/index-BHwtxG27.js.map +1 -0
- package/dist/index-BTcmIG47.js +2 -0
- package/dist/index-BTcmIG47.js.map +1 -0
- package/dist/index-CNkHt1r7.js +2 -0
- package/dist/index-CNkHt1r7.js.map +1 -0
- package/dist/index-D0XuyFm7.js +2 -0
- package/dist/index-D0XuyFm7.js.map +1 -0
- package/dist/index-DBspcqWq.js +2 -0
- package/dist/index-DBspcqWq.js.map +1 -0
- package/dist/index-DVBO4gYE.js +2 -0
- package/dist/index-DVBO4gYE.js.map +1 -0
- package/dist/index.css +217 -216
- package/dist/layouts.d.ts +1 -1
- package/dist/layouts.js +1 -1
- package/dist/layouts.js.map +1 -1
- package/dist/pages.js +1 -1
- package/dist/pages.js.map +1 -1
- package/dist/{tslib.es6-DDIOdJiV.js → tslib.es6-BBkx4Se1.js} +1 -1
- package/dist/{tslib.es6-DDIOdJiV.js.map → tslib.es6-BBkx4Se1.js.map} +1 -1
- package/dist/{tslib.es6-DUrRPhZd.js → tslib.es6-BF6ZLEXa.js} +1 -1
- package/dist/{tslib.es6-DUrRPhZd.js.map → tslib.es6-BF6ZLEXa.js.map} +1 -1
- package/dist/tslib.es6-BOZCDgb8.js +2 -0
- package/dist/tslib.es6-BOZCDgb8.js.map +1 -0
- package/dist/tslib.es6-Cjl5tesf.js +2 -0
- package/dist/tslib.es6-Cjl5tesf.js.map +1 -0
- package/dist/tslib.es6-DEH7Dkgy.js +2 -0
- package/dist/tslib.es6-DEH7Dkgy.js.map +1 -0
- package/dist/tslib.es6-DTeJ7dWi.js +2 -0
- package/dist/tslib.es6-DTeJ7dWi.js.map +1 -0
- package/dist/tslib.es6-U9-f6pA7.js +2 -0
- package/dist/tslib.es6-U9-f6pA7.js.map +1 -0
- package/dist/tslib.es6-cb69JjeS.js +2 -0
- package/dist/tslib.es6-cb69JjeS.js.map +1 -0
- package/dist/views.js +1 -1
- package/dist/writer.d.ts +4 -3
- package/dist/writer.js +1 -1
- package/dist/writer.js.map +1 -1
- package/package.json +12 -11
- package/rollup.config.js +20 -1
- package/src/brand/Button/Button.styles.tsx +31 -0
- package/src/brand/Button/Button.tsx +3 -35
- package/src/brand/CTABanner/CTABanner.styles.tsx +82 -0
- package/src/brand/CTABanner/CTABanner.tsx +34 -112
- package/src/brand/Footer/Footer.styles.tsx +21 -0
- package/src/brand/Footer/Footer.tsx +4 -24
- package/src/brand/TODO.md +1 -0
- package/src/coder/Code/Code.styles.tsx +45 -48
- package/src/coder/Code/Code.tsx +8 -8
- package/src/coder/Code/CodeLoader.tsx +2 -2
- package/src/coder/Code/annotations.tsx +1 -1
- package/src/coder/CodeCopy/CodeCopy.styles.tsx +19 -0
- package/src/coder/CodeCopy/CodeCopy.tsx +2 -4
- package/src/coder/CodeTabs/CodeTabs.styles.tsx +101 -97
- package/src/coder/CodeTabs/CodeTabs.tsx +11 -14
- package/src/content/Anchor/Anchor.styles.tsx +5 -0
- package/src/content/Anchor/Anchor.tsx +4 -14
- package/src/content/Content/Content.styles.tsx +9 -0
- package/src/content/Content/Content.tsx +4 -12
- package/src/content/Content.tsx +1 -2
- package/src/content/Subtitle/Subtitle.styles.ts +8 -0
- package/src/content/Subtitle/Subtitle.tsx +1 -10
- package/src/layouts/Layout.styles.tsx +135 -131
- package/src/layouts/Layout.tsx +21 -23
- package/src/layouts/LayoutPrimary/LayoutPrimary.styles.tsx +298 -277
- package/src/layouts/LayoutPrimary/LayoutPrimary.tsx +39 -42
- package/src/pages/HomePage/HomePage.styles.tsx +16 -0
- package/src/pages/HomePage/HomePage.tsx +7 -21
- package/src/pages/TODO.md +1 -0
- package/src/ui/Loader/Loader.styles.tsx +48 -46
- package/src/ui/Loader/Loader.tsx +8 -8
- package/src/ui/TODO.md +2 -0
- package/src/utils/useStyle.ts +19 -0
- package/src/views/HomeView/HomeView.styles.tsx +37 -0
- package/src/views/HomeView/HomeView.tsx +5 -45
- package/src/views/TODO.md +1 -0
- package/src/writer/Badge/Badge.styles.tsx +31 -30
- package/src/writer/Badge/Badge.tsx +40 -9
- package/src/writer/Blockquote/Blockquote.styles.tsx +6 -8
- package/src/writer/Blockquote/Blockquote.tsx +2 -2
- package/src/writer/Breadcrumbs/Breadcrumbs.styles.ts +27 -26
- package/src/writer/Breadcrumbs/Breadcrumbs.tsx +5 -5
- package/src/writer/Callout/Callout.styles.tsx +44 -48
- package/src/writer/Callout/Callout.tsx +5 -5
- package/src/writer/Code/Code.styles.tsx +11 -13
- package/src/writer/Code/Code.tsx +2 -2
- package/src/writer/Details/Details.styles.tsx +101 -90
- package/src/writer/Details/Details.tsx +32 -33
- package/src/writer/GuideCard/GuideCard.styles.tsx +116 -112
- package/src/writer/GuideCard/GuideCard.tsx +19 -19
- package/src/writer/Heading/Heading.styles.tsx +65 -61
- package/src/writer/Heading/Heading.tsx +11 -11
- package/src/writer/Hr/Hr.styles.tsx +3 -5
- package/src/writer/Hr/Hr.tsx +2 -2
- package/src/writer/NavLinks/NavLinks.styles.ts +30 -31
- package/src/writer/NavLinks/NavLinks.tsx +6 -6
- package/src/writer/Pre/Pre.styles.tsx +8 -10
- package/src/writer/Pre/Pre.tsx +2 -2
- package/src/writer/Steps/Steps.styles.tsx +30 -31
- package/src/writer/Steps/Steps.tsx +3 -4
- package/src/writer/Table/Table.styles.tsx +32 -31
- package/src/writer/Table/Table.tsx +5 -5
- package/src/writer/Tabs/Tabs.styles.tsx +60 -63
- package/src/writer/Tabs/Tabs.tsx +11 -16
- package/src/writer/UnderlineNav/UnderlineNav.styles.tsx +44 -42
- package/src/writer/UnderlineNav/UnderlineNav.tsx +5 -5
- package/tsconfig.json +2 -3
- package/dist/CTABanner-BrdYlhnD.js +0 -2
- package/dist/CTABanner-BrdYlhnD.js.map +0 -1
- package/dist/CTABanner-XQNnnpUx.js +0 -2
- package/dist/CTABanner-XQNnnpUx.js.map +0 -1
- package/dist/CodeSample-Cp42Adjc.js +0 -2
- package/dist/CodeSample-Cp42Adjc.js.map +0 -1
- package/dist/CodeSample-DxPp80ID.js +0 -2
- package/dist/CodeSample-DxPp80ID.js.map +0 -1
- package/dist/HomeView-BN9mZXh9.js +0 -2
- package/dist/HomeView-BN9mZXh9.js.map +0 -1
- package/dist/HomeView-BVaaV0uE.js +0 -2
- package/dist/HomeView-BVaaV0uE.js.map +0 -1
- package/dist/UnderlineNav-Bs7Ot9Ch.js +0 -2
- package/dist/UnderlineNav-Bs7Ot9Ch.js.map +0 -1
- package/dist/UnderlineNav-C2aEVraN.js +0 -2
- package/dist/UnderlineNav-C2aEVraN.js.map +0 -1
- package/dist/_rollupPluginBabelHelpers-BMmCG_qQ.js.map +0 -1
- package/dist/_rollupPluginBabelHelpers-DsEzE6Ab.js.map +0 -1
- package/dist/index-BVUz77Tm.js +0 -2
- package/dist/index-BVUz77Tm.js.map +0 -1
- package/dist/index-jxd3nv2J.js +0 -2
- package/dist/index-jxd3nv2J.js.map +0 -1
- package/src/coder/CodeCopy/CodeCopy.style.tsx +0 -21
|
@@ -1,127 +1,49 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
|
+
import * as cn from "./CTABanner.styles";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
`,
|
|
8
|
-
container: css`
|
|
9
|
-
display: flex;
|
|
10
|
-
align-items: center;
|
|
11
|
-
justify-content: center;
|
|
12
|
-
gap: 80px;
|
|
13
|
-
`,
|
|
14
|
-
hero: css`
|
|
15
|
-
display: flex;
|
|
16
|
-
align-items: center;
|
|
17
|
-
justify-content: center;
|
|
18
|
-
flex-direction: column;
|
|
19
|
-
gap: 40px;
|
|
20
|
-
`,
|
|
21
|
-
headingEffect: css`
|
|
22
|
-
display: flex;
|
|
23
|
-
align-items: center;
|
|
24
|
-
justify-content: center;
|
|
25
|
-
flex-direction: column;
|
|
26
|
-
|
|
27
|
-
background: -webkit-linear-gradient(
|
|
28
|
-
120deg,
|
|
29
|
-
var(--headingEffect-color-tertiary) 20%,
|
|
30
|
-
var(--headingEffect-color-tertiary) 30%,
|
|
31
|
-
var(--headingEffect-color-secondary) 60%,
|
|
32
|
-
var(--headingEffect-color-primary) 75%,
|
|
33
|
-
var(--headingEffect-color-primary) 85%
|
|
34
|
-
);
|
|
35
|
-
background-clip: text;
|
|
36
|
-
-webkit-text-fill-color: transparent;
|
|
37
|
-
animation: wave 5s infinite;
|
|
38
|
-
background-size: 200% 200%;
|
|
39
|
-
background-position: 50% 50%; // Start with all colors visible
|
|
4
|
+
export interface CTABannerProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
40
7
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
50% {
|
|
46
|
-
background-position: 0% 50%;
|
|
47
|
-
}
|
|
48
|
-
100% {
|
|
49
|
-
background-position: 50% 50%;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
`
|
|
8
|
+
export interface CTABannerHeadingProps {
|
|
9
|
+
title: string;
|
|
10
|
+
subtitle: string;
|
|
53
11
|
}
|
|
54
12
|
|
|
55
|
-
export interface
|
|
56
|
-
children: React.ReactNode
|
|
13
|
+
export interface CTABannerButtonGroupProps {
|
|
14
|
+
children: React.ReactNode;
|
|
57
15
|
}
|
|
58
16
|
|
|
59
17
|
export function CTABanner({children}: CTABannerProps) {
|
|
60
|
-
return
|
|
61
|
-
<div className={
|
|
62
|
-
<div className={
|
|
63
|
-
{
|
|
18
|
+
return (
|
|
19
|
+
<div className={cn.CTABannerHost}>
|
|
20
|
+
<div className={cn.CTABannerContainer}>
|
|
21
|
+
<div className={cn.CTABannerHero}>
|
|
22
|
+
{children}
|
|
23
|
+
</div>
|
|
64
24
|
</div>
|
|
65
25
|
</div>
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const $heading = {
|
|
70
|
-
host: css`
|
|
71
|
-
display: flex;
|
|
72
|
-
align-items: center;
|
|
73
|
-
justify-content: center;
|
|
74
|
-
flex-direction: column;
|
|
75
|
-
`,
|
|
76
|
-
title: css`
|
|
77
|
-
font-size: 76px;
|
|
78
|
-
font-weight: 900;
|
|
79
|
-
text-align: center;
|
|
80
|
-
letter-spacing: 3px;
|
|
81
|
-
margin: 0;
|
|
82
|
-
`,
|
|
83
|
-
subtitle: css`
|
|
84
|
-
color: #3c3c43;
|
|
85
|
-
font-size: 46px;
|
|
86
|
-
font-weight: 600;
|
|
87
|
-
text-align: center;
|
|
88
|
-
`
|
|
26
|
+
);
|
|
89
27
|
}
|
|
90
28
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
{
|
|
101
|
-
headingEffect
|
|
102
|
-
? <span className={$banner.headingEffect}>
|
|
103
|
-
{title}
|
|
104
|
-
</span>
|
|
105
|
-
: title
|
|
106
|
-
}
|
|
107
|
-
</h1>
|
|
108
|
-
<p className={$heading.subtitle}>
|
|
109
|
-
{subtitle}
|
|
110
|
-
</p>
|
|
111
|
-
</div>
|
|
29
|
+
function Heading({title, subtitle}: CTABannerHeadingProps) {
|
|
30
|
+
return (
|
|
31
|
+
<div className={cn.CTABannerHeadingHost}>
|
|
32
|
+
<div className={cn.CTABannerHeadingEffect}>
|
|
33
|
+
<h1 className={cn.CTABannerHeadingTitle}>{title}</h1>
|
|
34
|
+
</div>
|
|
35
|
+
<h2 className={cn.CTABannerHeadingSubtitle}>{subtitle}</h2>
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
112
38
|
}
|
|
113
39
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
`
|
|
40
|
+
function ButtonGroup({children}: CTABannerButtonGroupProps) {
|
|
41
|
+
return (
|
|
42
|
+
<div className={cn.CTABannerButtonGroupHost}>
|
|
43
|
+
{children}
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
121
46
|
}
|
|
122
47
|
|
|
123
|
-
CTABanner.
|
|
124
|
-
|
|
125
|
-
{children}
|
|
126
|
-
</div>
|
|
127
|
-
}
|
|
48
|
+
CTABanner.Heading = Heading;
|
|
49
|
+
CTABanner.ButtonGroup = ButtonGroup;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {css} from "@linaria/core";
|
|
2
|
+
|
|
3
|
+
export const FooterHost = css`
|
|
4
|
+
position: relative;
|
|
5
|
+
border-top: 1px solid #f0f0f0;
|
|
6
|
+
padding: 32px;
|
|
7
|
+
background-color: #fff;
|
|
8
|
+
`;
|
|
9
|
+
|
|
10
|
+
export const FooterContainer = css`
|
|
11
|
+
margin: 0 auto;
|
|
12
|
+
max-width: 1200px;
|
|
13
|
+
text-align: center;
|
|
14
|
+
`;
|
|
15
|
+
|
|
16
|
+
export const FooterTextContainer = css`
|
|
17
|
+
line-height: 24px;
|
|
18
|
+
font-size: 14px;
|
|
19
|
+
font-weight: 500;
|
|
20
|
+
color: rgba(60, 60, 67, .78);
|
|
21
|
+
`;
|
|
@@ -1,34 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
const $footer = {
|
|
5
|
-
host: css`
|
|
6
|
-
position: relative;
|
|
7
|
-
border-top: 1px solid #f0f0f0;
|
|
8
|
-
padding: 32px;
|
|
9
|
-
background-color: #fff;
|
|
10
|
-
`,
|
|
11
|
-
container: css`
|
|
12
|
-
margin: 0 auto;
|
|
13
|
-
max-width: 1200px;
|
|
14
|
-
text-align: center;
|
|
15
|
-
`,
|
|
16
|
-
textContainer: css`
|
|
17
|
-
line-height: 24px;
|
|
18
|
-
font-size: 14px;
|
|
19
|
-
font-weight: 500;
|
|
20
|
-
color: rgba(60, 60, 67, .78);
|
|
21
|
-
`
|
|
22
|
-
}
|
|
2
|
+
import * as cn from "./Footer.styles";
|
|
23
3
|
|
|
24
4
|
export interface FooterProps {
|
|
25
5
|
children?: React.ReactNode
|
|
26
6
|
}
|
|
27
7
|
|
|
28
8
|
export function Footer({children}: FooterProps) {
|
|
29
|
-
return <footer className={
|
|
30
|
-
<div className={
|
|
31
|
-
<div className={
|
|
9
|
+
return <footer className={cn.FooterHost}>
|
|
10
|
+
<div className={cn.FooterContainer}>
|
|
11
|
+
<div className={cn.FooterTextContainer}>
|
|
32
12
|
{children}
|
|
33
13
|
</div>
|
|
34
14
|
</div>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
DELETE `brand`
|
|
@@ -1,50 +1,47 @@
|
|
|
1
1
|
import {css} from "@linaria/core";
|
|
2
2
|
|
|
3
|
-
export const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
export const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
max-height: 100%;
|
|
49
|
-
`
|
|
50
|
-
}
|
|
3
|
+
export const MarkHost = css`
|
|
4
|
+
display: flex;
|
|
5
|
+
border-left-width: 4px;
|
|
6
|
+
border-color: transparent;
|
|
7
|
+
margin: 4px 0;
|
|
8
|
+
`;
|
|
9
|
+
|
|
10
|
+
export const MarkLine = css`
|
|
11
|
+
flex: 1 1 0%;
|
|
12
|
+
`;
|
|
13
|
+
|
|
14
|
+
export const MarkAnnotated = css`
|
|
15
|
+
border-color: #60A5FA;
|
|
16
|
+
background-color: #EEF2FF;
|
|
17
|
+
`;
|
|
18
|
+
|
|
19
|
+
export const LineNumberHost = css`
|
|
20
|
+
margin: 0 12px 0px 4px;
|
|
21
|
+
//text-align: right;
|
|
22
|
+
user-select: none;
|
|
23
|
+
opacity: 0.5;
|
|
24
|
+
`;
|
|
25
|
+
|
|
26
|
+
export const CodeHost = css`
|
|
27
|
+
max-height: 400px;
|
|
28
|
+
background: linear-gradient(45deg, rgb(247, 247, 248) 0%, rgb(247, 247, 248) 100%) !important;
|
|
29
|
+
|
|
30
|
+
margin: 0;
|
|
31
|
+
padding: 8px 16px;
|
|
32
|
+
|
|
33
|
+
border-top: 1px solid rgb(236, 236, 241);
|
|
34
|
+
border-bottom-left-radius: 10px;
|
|
35
|
+
border-bottom-right-radius: 10px;
|
|
36
|
+
|
|
37
|
+
font-size: 12px;
|
|
38
|
+
line-height: 20px;
|
|
39
|
+
white-space: pre-wrap;
|
|
40
|
+
word-break: break-all;
|
|
41
|
+
|
|
42
|
+
overflow-y: scroll;
|
|
43
|
+
`;
|
|
44
|
+
|
|
45
|
+
export const CodeHostFull = css`
|
|
46
|
+
max-height: 100%;
|
|
47
|
+
`;
|
package/src/coder/Code/Code.tsx
CHANGED
|
@@ -4,8 +4,8 @@ import {InnerLine, Pre} from "codehike/code";
|
|
|
4
4
|
import {Theme} from "@code-hike/lighter";
|
|
5
5
|
|
|
6
6
|
import {CodeTheme, type CodeThemeBlockProps} from "../CodeTheme";
|
|
7
|
-
import
|
|
8
|
-
import {CodeLoader} from "./CodeLoader
|
|
7
|
+
import * as cn from "./Code.styles";
|
|
8
|
+
import {CodeLoader} from "./CodeLoader";
|
|
9
9
|
|
|
10
10
|
export interface CodeProps {
|
|
11
11
|
codeblocks: CodeThemeBlockProps[];
|
|
@@ -30,7 +30,7 @@ Code.LineNumber = function LineNumber(props: any) {
|
|
|
30
30
|
<>
|
|
31
31
|
<span
|
|
32
32
|
style={{minWidth: `${props.width}ch`}}
|
|
33
|
-
className={
|
|
33
|
+
className={cn.LineNumberHost}
|
|
34
34
|
>
|
|
35
35
|
{props.lineNumber}
|
|
36
36
|
</span>
|
|
@@ -41,17 +41,17 @@ Code.LineNumber = function LineNumber(props: any) {
|
|
|
41
41
|
|
|
42
42
|
// TODO: fix any
|
|
43
43
|
Code.Mark = function Mark(props: any) {
|
|
44
|
-
return <div className={`${
|
|
44
|
+
return <div className={`${cn.MarkHost} ${props.annotation && cn.MarkAnnotated}`}>
|
|
45
45
|
<InnerLine
|
|
46
46
|
merge={props}
|
|
47
|
-
className={
|
|
47
|
+
className={cn.MarkLine}
|
|
48
48
|
/>
|
|
49
49
|
</div>
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
// TODO: fix any
|
|
53
53
|
Code.Bg = function CodeLine(props: any) {
|
|
54
|
-
return <span className={`${props.annotation &&
|
|
54
|
+
return <span className={`${props.annotation && cn.MarkAnnotated}`}>
|
|
55
55
|
{props.children}
|
|
56
56
|
</span>
|
|
57
57
|
}
|
|
@@ -65,8 +65,8 @@ Code.Pre = function CodePre(props: {
|
|
|
65
65
|
) {
|
|
66
66
|
return <Pre
|
|
67
67
|
className={`
|
|
68
|
-
${
|
|
69
|
-
${props?.size === "full" &&
|
|
68
|
+
${cn.CodeHost}
|
|
69
|
+
${props?.size === "full" && cn.CodeHostFull}
|
|
70
70
|
${props.className}
|
|
71
71
|
`}
|
|
72
72
|
style={props.codeblock?.style || props.codeblock?.style}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import * as cn from "./Code.styles";
|
|
4
4
|
import {Loader} from "../../ui";
|
|
5
5
|
|
|
6
6
|
export function CodeLoader() {
|
|
7
|
-
return <div className={
|
|
7
|
+
return <div className={cn.CodeHost}>
|
|
8
8
|
<Loader/>
|
|
9
9
|
</div>
|
|
10
10
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {css} from "@linaria/core";
|
|
2
|
+
|
|
3
|
+
export const CodeCopyHost = css`
|
|
4
|
+
all: unset;
|
|
5
|
+
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
|
|
12
|
+
border-radius: 6px;
|
|
13
|
+
padding: 6px;
|
|
14
|
+
|
|
15
|
+
&:hover {
|
|
16
|
+
transition: ease-in 0.1s;
|
|
17
|
+
background: #e3e3eb;
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React, {useState} from "react"
|
|
2
2
|
import {Copy, CheckCheck} from "lucide-react"
|
|
3
3
|
|
|
4
|
-
import
|
|
5
|
-
$copy
|
|
6
|
-
} from "./CodeCopy.style"
|
|
4
|
+
import * as cn from "./CodeCopy.styles"
|
|
7
5
|
|
|
8
6
|
export interface CodeCopyProps {
|
|
9
7
|
text: string
|
|
@@ -24,7 +22,7 @@ export function CodeCopy({text}: CodeCopyProps) {
|
|
|
24
22
|
<button
|
|
25
23
|
aria-label="Copy to clipboard"
|
|
26
24
|
onClick={onClick}
|
|
27
|
-
className={
|
|
25
|
+
className={cn.CodeCopyHost}
|
|
28
26
|
>
|
|
29
27
|
{copied ? <CheckCheck size={16}/> : <Copy size={16}/>}
|
|
30
28
|
</button>
|
|
@@ -1,100 +1,104 @@
|
|
|
1
1
|
import {css} from "@linaria/core";
|
|
2
2
|
|
|
3
|
-
export const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
3
|
+
export const CodeTabsHost = css`
|
|
4
|
+
overflow: hidden;
|
|
5
|
+
min-width: 0;
|
|
6
|
+
//flex: 1 1 0;
|
|
7
|
+
//max-width: 512px;
|
|
8
|
+
|
|
9
|
+
border: 1px solid rgb(236, 236, 241);
|
|
10
|
+
border-radius: 16px;
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
export const CodeTabsPreSingle = css`
|
|
14
|
+
border: none !important; // TODO: bad, find another way - CodeSample another kind?
|
|
15
|
+
`;
|
|
16
|
+
|
|
17
|
+
export const CodeTabsLanguagesHost = css`
|
|
18
|
+
display: flex;
|
|
19
|
+
flex: 1 1 0%;
|
|
20
|
+
//padding: 8px 0px;
|
|
21
|
+
|
|
22
|
+
background: linear-gradient(45deg, rgb(247, 247, 248) 0%, rgb(247, 247, 248) 100%) !important;
|
|
23
|
+
|
|
24
|
+
border-top-right-radius: 10px;
|
|
25
|
+
border-top-left-radius: 10px;
|
|
26
|
+
border-bottom: 0px;
|
|
27
|
+
|
|
28
|
+
min-width: 0;
|
|
29
|
+
`;
|
|
30
|
+
|
|
31
|
+
export const CodeTabsLanguagesHostSingle = css`
|
|
32
|
+
height: 0;
|
|
33
|
+
`;
|
|
34
|
+
|
|
35
|
+
export const CodeTabsLanguagesList = css`
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-grow: 1;
|
|
38
|
+
justify-content: end;
|
|
39
|
+
gap: 8px;
|
|
40
|
+
padding: 0 10px;
|
|
41
|
+
`;
|
|
42
|
+
|
|
43
|
+
export const CodeTabsLanguagesButton = css`
|
|
44
|
+
all: unset;
|
|
45
|
+
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
justify-content: center;
|
|
51
|
+
|
|
52
|
+
border-radius: 6px;
|
|
53
|
+
padding: 6px;
|
|
54
|
+
|
|
55
|
+
font-size: 14px;
|
|
56
|
+
color: rgb(53, 55, 64);
|
|
57
|
+
|
|
58
|
+
&[data-state="active"] {
|
|
59
|
+
color: rgb(112, 81, 212);
|
|
60
|
+
border-bottom: 1px solid rgb(112, 81, 212);
|
|
61
|
+
border-bottom-left-radius: 0px;
|
|
62
|
+
border-bottom-right-radius: 0px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&:hover {
|
|
66
|
+
transition: ease-in 0.1s;
|
|
67
|
+
background: #e3e3eb;
|
|
68
|
+
}
|
|
69
|
+
`;
|
|
70
|
+
|
|
71
|
+
export const CodeTabsLanguagesDescription = css`
|
|
72
|
+
display: flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
gap: 4px;
|
|
75
|
+
|
|
76
|
+
font-size: 14px;
|
|
77
|
+
color: rgb(53, 55, 64);
|
|
78
|
+
|
|
79
|
+
margin-left: 4px;
|
|
80
|
+
margin-right: 4px;
|
|
81
|
+
`;
|
|
82
|
+
|
|
83
|
+
export const CodeTabsLanguagesDescriptionItem = css`
|
|
84
|
+
display: flex;
|
|
85
|
+
padding-left: 16px;
|
|
86
|
+
padding-right: 16px;
|
|
87
|
+
flex: 1 1 0%;
|
|
88
|
+
gap: 16px;
|
|
89
|
+
border-radius: 4px;
|
|
90
|
+
`;
|
|
91
|
+
|
|
92
|
+
export const CodeTabsLanguagesCopy = css`
|
|
93
|
+
display: flex;
|
|
94
|
+
padding-left: 8px;
|
|
95
|
+
padding-right: 8px;
|
|
96
|
+
align-items: center;
|
|
97
|
+
`;
|
|
98
|
+
|
|
99
|
+
export const CodeTabsLanguagesCopySingle = css`
|
|
100
|
+
top: 17px;
|
|
101
|
+
position: relative;
|
|
102
|
+
right: 5px;
|
|
103
|
+
`;
|
|
100
104
|
|