@xyd-js/atlas 0.1.0-xyd.12 → 0.1.0-xyd.13
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/.storybook/index.css +2 -27
- package/CHANGELOG.md +7 -0
- package/LICENSE +21 -0
- package/dist/{CodeSample-Cp42Adjc-C5AHaCBx.js → CodeSample-B9VUhTKF-DJ2leksk.js} +2 -2
- package/dist/{CodeSample-Cp42Adjc-C5AHaCBx.js.map → CodeSample-B9VUhTKF-DJ2leksk.js.map} +1 -1
- package/dist/{CodeSample-DxPp80ID-C5AHaCBx.js → CodeSample-BSXeFy0x-DJ2leksk.js} +2 -2
- package/dist/{CodeSample-DxPp80ID-C5AHaCBx.js.map → CodeSample-BSXeFy0x-DJ2leksk.js.map} +1 -1
- package/dist/CodeSample-BwP208sQ-DJ2leksk.js +2 -0
- package/dist/CodeSample-BwP208sQ-DJ2leksk.js.map +1 -0
- package/dist/CodeSample-CUemtj_W-DJ2leksk.js +2 -0
- package/dist/CodeSample-CUemtj_W-DJ2leksk.js.map +1 -0
- package/dist/CodeSample-D0iKih-A-DJ2leksk.js +2 -0
- package/dist/CodeSample-D0iKih-A-DJ2leksk.js.map +1 -0
- package/dist/CodeSample-D33vTa6M-DJ2leksk.js +2 -0
- package/dist/CodeSample-D33vTa6M-DJ2leksk.js.map +1 -0
- package/dist/CodeSample-DUSx2KBt-DJ2leksk.js +2 -0
- package/dist/CodeSample-DUSx2KBt-DJ2leksk.js.map +1 -0
- package/dist/CodeSample-P4yxkHPW-DJ2leksk.js +2 -0
- package/dist/CodeSample-P4yxkHPW-DJ2leksk.js.map +1 -0
- package/dist/atlas-index.js +1 -1
- package/dist/atlas-index.js.map +1 -1
- package/dist/index.css +58 -58
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/rollup.config.js +2 -2
- package/src/components/ApiRef/ApiRefItem/ApiRefItem.styles.tsx +56 -67
- package/src/components/ApiRef/ApiRefItem/ApiRefItem.tsx +20 -27
- package/src/components/ApiRef/ApiRefProperties/ApiRefProperties.styles.tsx +124 -139
- package/src/components/ApiRef/ApiRefProperties/ApiRefProperties.tsx +27 -37
- package/src/components/ApiRef/ApiRefSamples/ApiRefSamples.styles.tsx +18 -23
- package/src/components/ApiRef/ApiRefSamples/ApiRefSamples.tsx +3 -6
- package/src/components/Atlas/Atlas.styles.tsx +3 -5
- package/src/components/Atlas/Atlas.tsx +2 -5
- package/src/components/Atlas/AtlasLazy/AtlasLazy.styles.tsx +7 -8
- package/src/components/Atlas/AtlasLazy/AtlasLazy.tsx +2 -4
- package/src/components/Code/CodeCopy/CodeCopy.styles.tsx +17 -0
- package/src/components/Code/CodeCopy/CodeCopy.tsx +2 -4
- package/src/components/Code/CodeSample/CodeSample.styles.tsx +129 -132
- package/src/components/Code/CodeSample/CodeSample.tsx +12 -18
- package/src/components/Code/CodeSampleButtons/CodeSampleButtons.styles.tsx +56 -134
- package/src/components/Code/CodeSampleButtons/CodeSampleButtons.tsx +13 -20
- package/src/components/Code/CodeCopy/CodeCopy.style.tsx +0 -19
- package/src/utils/linaria.ts +0 -20
|
@@ -2,40 +2,31 @@ import React, {useState} from "react";
|
|
|
2
2
|
import {DefinitionProperty} from "@xyd-js/uniform";
|
|
3
3
|
|
|
4
4
|
import {MDXReference, mdxValue} from "@/utils/mdx"
|
|
5
|
-
import
|
|
6
|
-
$ul,
|
|
7
|
-
$li,
|
|
8
|
-
$description,
|
|
9
|
-
$dl,
|
|
10
|
-
$propNameCode,
|
|
11
|
-
$propTypeCode,
|
|
12
|
-
$subProps,
|
|
13
|
-
$propToggle,
|
|
14
|
-
} from "./ApiRefProperties.styles";
|
|
5
|
+
import * as cn from "./ApiRefProperties.styles";
|
|
15
6
|
|
|
16
7
|
export interface ApiRefPropertiesProps {
|
|
17
8
|
properties: MDXReference<DefinitionProperty[]>
|
|
18
9
|
}
|
|
19
10
|
|
|
20
11
|
export function ApiRefProperties({properties}: ApiRefPropertiesProps) {
|
|
21
|
-
return <ul className={
|
|
12
|
+
return <ul className={cn.ApiRefPropertiesUlHost}>
|
|
22
13
|
{
|
|
23
14
|
properties?.map((property, i) => (
|
|
24
|
-
<li className={
|
|
25
|
-
<dl className={
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
<li className={cn.ApiRefPropertiesLiHost} key={i}>
|
|
16
|
+
<dl className={cn.ApiRefPropertiesDlHost}>
|
|
17
|
+
<PropName name="name" value={mdxValue(property.name)}/>
|
|
18
|
+
<PropType
|
|
28
19
|
name="type"
|
|
29
20
|
value={mdxValue(property.type)}
|
|
30
21
|
href={propertyTypeHref(property)}
|
|
31
22
|
/>
|
|
32
23
|
</dl>
|
|
33
|
-
<div className={
|
|
24
|
+
<div className={cn.ApiRefPropertiesDescriptionHost}>
|
|
34
25
|
{property.children}
|
|
35
26
|
</div>
|
|
36
27
|
{
|
|
37
28
|
property.properties ?
|
|
38
|
-
|
|
29
|
+
<SubProperties
|
|
39
30
|
properties={property.properties as MDXReference<DefinitionProperty>[]}
|
|
40
31
|
/> : null
|
|
41
32
|
}
|
|
@@ -45,21 +36,21 @@ export function ApiRefProperties({properties}: ApiRefPropertiesProps) {
|
|
|
45
36
|
</ul>
|
|
46
37
|
}
|
|
47
38
|
|
|
48
|
-
function
|
|
39
|
+
function PropName({name, value}: { name: string, value: string }) {
|
|
49
40
|
return <>
|
|
50
41
|
<dd>
|
|
51
|
-
<code className={
|
|
42
|
+
<code className={cn.ApiRefPropertiesPropNameCodeHost}>{value}</code>
|
|
52
43
|
</dd>
|
|
53
44
|
</>
|
|
54
45
|
}
|
|
55
46
|
|
|
56
|
-
function
|
|
47
|
+
function PropType({name, value, href}: { name: string, value: string, href?: string }) {
|
|
57
48
|
return <>
|
|
58
49
|
<dd>
|
|
59
|
-
<code className={
|
|
50
|
+
<code className={cn.ApiRefPropertiesPropTypeCodeHost}>
|
|
60
51
|
{
|
|
61
52
|
href
|
|
62
|
-
? <a className={
|
|
53
|
+
? <a className={cn.ApiRefPropertiesPropTypeCodeLink} href={href}>{value}</a>
|
|
63
54
|
: value
|
|
64
55
|
}
|
|
65
56
|
</code>
|
|
@@ -67,37 +58,37 @@ function $PropType({name, value, href}: { name: string, value: string, href?: st
|
|
|
67
58
|
</>
|
|
68
59
|
}
|
|
69
60
|
|
|
70
|
-
function
|
|
61
|
+
function SubProperties({properties}: { properties: MDXReference<DefinitionProperty>[] }) {
|
|
71
62
|
const [expanded, setExpanded] = useState(false)
|
|
72
63
|
|
|
73
64
|
return <>
|
|
74
|
-
|
|
65
|
+
<PropToggle
|
|
75
66
|
onClick={() => setExpanded(!expanded)}
|
|
76
67
|
isExpanded={expanded}
|
|
77
68
|
/>
|
|
78
69
|
|
|
79
70
|
<div
|
|
80
|
-
className={`${
|
|
71
|
+
className={`${cn.ApiRefPropertiesSubPropsHost} ${expanded && cn.ApiRefPropertiesSubPropsHostExpanded}`}
|
|
81
72
|
>
|
|
82
|
-
<div className={
|
|
83
|
-
<ul role="list" className={
|
|
73
|
+
<div className={cn.ApiRefPropertiesSubPropsBox}>
|
|
74
|
+
<ul role="list" className={cn.ApiRefPropertiesSubPropsUl}>
|
|
84
75
|
{
|
|
85
76
|
properties?.map((prop, i) => {
|
|
86
|
-
return <li className={
|
|
87
|
-
<dl className={
|
|
88
|
-
|
|
89
|
-
|
|
77
|
+
return <li className={cn.ApiRefPropertiesSubPropsLi} key={i}>
|
|
78
|
+
<dl className={cn.ApiRefPropertiesDlHost}>
|
|
79
|
+
<PropName name="name" value={mdxValue(prop.name)}/>
|
|
80
|
+
<PropType
|
|
90
81
|
name="type"
|
|
91
82
|
value={mdxValue(prop.type)}
|
|
92
83
|
href={propertyTypeHref(prop)}
|
|
93
84
|
/>
|
|
94
85
|
</dl>
|
|
95
|
-
<div className={
|
|
86
|
+
<div className={cn.ApiRefPropertiesDescriptionHost}>
|
|
96
87
|
{prop.children}
|
|
97
88
|
</div>
|
|
98
89
|
{
|
|
99
90
|
prop.properties ?
|
|
100
|
-
|
|
91
|
+
<SubProperties
|
|
101
92
|
properties={prop.properties as MDXReference<DefinitionProperty>[]}/> : null
|
|
102
93
|
}
|
|
103
94
|
</li>
|
|
@@ -109,19 +100,18 @@ function $SubProperties({properties}: { properties: MDXReference<DefinitionPrope
|
|
|
109
100
|
</>
|
|
110
101
|
}
|
|
111
102
|
|
|
112
|
-
|
|
113
103
|
interface PropsToggleProps {
|
|
114
104
|
isExpanded: boolean
|
|
115
105
|
onClick: () => void
|
|
116
106
|
}
|
|
117
107
|
|
|
118
|
-
function
|
|
108
|
+
function PropToggle(props: PropsToggleProps) {
|
|
119
109
|
return (
|
|
120
110
|
<button
|
|
121
111
|
aria-expanded={props.isExpanded}
|
|
122
112
|
aria-controls="chat/object-usage_table"
|
|
123
113
|
onClick={props.onClick}
|
|
124
|
-
className={
|
|
114
|
+
className={cn.ApiRefPropertiesPropToggleHost}
|
|
125
115
|
>
|
|
126
116
|
<svg
|
|
127
117
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -140,7 +130,7 @@ function $PropToggle(props: PropsToggleProps) {
|
|
|
140
130
|
clipRule="evenodd"
|
|
141
131
|
/>
|
|
142
132
|
</svg>
|
|
143
|
-
<span className={
|
|
133
|
+
<span className={cn.ApiRefPropertiesPropToggleLink}>{props.isExpanded ? 'Hide properties' : 'Show properties'}</span>
|
|
144
134
|
</button>
|
|
145
135
|
)
|
|
146
136
|
}
|
|
@@ -1,28 +1,23 @@
|
|
|
1
1
|
import {css} from "@linaria/core";
|
|
2
2
|
|
|
3
|
-
export const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
export const ApiRefSamplesContainerHost = css`
|
|
4
|
+
position: sticky;
|
|
5
|
+
top: 6rem;
|
|
6
|
+
display: flex;
|
|
7
|
+
gap: 32px;
|
|
8
|
+
flex-direction: column;
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
&:first-child {
|
|
11
|
+
margin-top: 0;
|
|
12
|
+
}
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
&:last-child {
|
|
15
|
+
margin-bottom: 0;
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export const $group = {
|
|
23
|
-
host: css`
|
|
24
|
-
gap: 10px;
|
|
25
|
-
display: flex;
|
|
26
|
-
flex-direction: column;
|
|
27
|
-
`
|
|
28
|
-
}
|
|
19
|
+
export const ApiRefSamplesGroupHost = css`
|
|
20
|
+
gap: 10px;
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
`;
|
|
@@ -5,17 +5,14 @@ import {MDXReference} from "@/utils/mdx"
|
|
|
5
5
|
import {CodeExampleButtons, CodeSample} from "@/components/Code";
|
|
6
6
|
import type {MDXCodeSampleBlock} from "@/components/Code/CodeSample/CodeSample";
|
|
7
7
|
|
|
8
|
-
import
|
|
9
|
-
$container,
|
|
10
|
-
$group
|
|
11
|
-
} from "./ApiRefSamples.styles";
|
|
8
|
+
import * as cn from "./ApiRefSamples.styles";
|
|
12
9
|
|
|
13
10
|
export interface ApiRefSamplesProps {
|
|
14
11
|
examples: MDXReference<ExampleRoot>
|
|
15
12
|
}
|
|
16
13
|
|
|
17
14
|
export function ApiRefSamples({examples}: ApiRefSamplesProps) {
|
|
18
|
-
return <div className={
|
|
15
|
+
return <div className={cn.ApiRefSamplesContainerHost}>
|
|
19
16
|
{
|
|
20
17
|
examples.groups?.map(({description, examples}, i) => {
|
|
21
18
|
const [activeExample, setActiveExample] = useState<MDXReference<Example> | null>(examples?.[0])
|
|
@@ -24,7 +21,7 @@ export function ApiRefSamples({examples}: ApiRefSamplesProps) {
|
|
|
24
21
|
return tab.code as unknown as MDXCodeSampleBlock // TODO: because atlas use mdx uniform reference - we need to unify it !!!
|
|
25
22
|
})
|
|
26
23
|
|
|
27
|
-
return <div key={i} className={
|
|
24
|
+
return <div key={i} className={cn.ApiRefSamplesGroupHost}>
|
|
28
25
|
{
|
|
29
26
|
examples?.length > 1
|
|
30
27
|
? <CodeExampleButtons
|
|
@@ -5,21 +5,18 @@ import {Reference} from "@xyd-js/uniform";
|
|
|
5
5
|
import {MDXReference} from "@/utils/mdx";
|
|
6
6
|
import {ApiRefItem} from "@/components/ApiRef";
|
|
7
7
|
|
|
8
|
-
import
|
|
9
|
-
$atlas
|
|
10
|
-
} from "@/components/Atlas/Atlas.styles";
|
|
8
|
+
import * as cn from "@/components/Atlas/Atlas.styles";
|
|
11
9
|
|
|
12
10
|
export interface AtlasProps {
|
|
13
11
|
references: MDXReference<Reference[]> | []
|
|
14
12
|
}
|
|
15
13
|
|
|
16
14
|
export function Atlas(props: AtlasProps) {
|
|
17
|
-
return <div className={
|
|
15
|
+
return <div className={cn.AtlasHost}>
|
|
18
16
|
{
|
|
19
17
|
props.references?.map((reference, i) => <div key={i}>
|
|
20
18
|
<ApiRefItem
|
|
21
19
|
reference={{
|
|
22
|
-
|
|
23
20
|
...reference
|
|
24
21
|
}}
|
|
25
22
|
/>
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import {css} from "@linaria/core";
|
|
2
2
|
|
|
3
|
-
export const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
3
|
+
export const AtlasLazyItemHost = css`
|
|
4
|
+
padding: 16px 0;
|
|
5
|
+
`;
|
|
6
|
+
|
|
7
|
+
export const AtlasLazyItemFirst = css`
|
|
8
|
+
padding: 4px 0;
|
|
9
|
+
`;
|
|
@@ -4,9 +4,7 @@ import {Reference} from "@xyd-js/uniform";
|
|
|
4
4
|
|
|
5
5
|
import {MDXReference} from "@/utils/mdx";
|
|
6
6
|
import {ApiRefItem} from "@/components/ApiRef";
|
|
7
|
-
import
|
|
8
|
-
$item
|
|
9
|
-
} from "./AtlasLazy.styles";
|
|
7
|
+
import * as cn from "./AtlasLazy.styles";
|
|
10
8
|
|
|
11
9
|
export interface AtlasLazyProps {
|
|
12
10
|
references: MDXReference<Reference>[]
|
|
@@ -21,7 +19,7 @@ export function AtlasLazy(props: AtlasLazyProps) {
|
|
|
21
19
|
key={i}
|
|
22
20
|
// TODO: slug should be passed from reference or somrthing
|
|
23
21
|
// ref={`api-reference/${reference.title}` === slug ? targetRef : null} // Attach ref to the 30th item
|
|
24
|
-
className={`${
|
|
22
|
+
className={`${cn.AtlasLazyItemHost} ${i === 0 && cn.AtlasLazyItemFirst}`}
|
|
25
23
|
// TODO: slug prefix props
|
|
26
24
|
data-slug={`${props.urlPrefix}/${reference.canonical?.title}`}
|
|
27
25
|
>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {css} from "@linaria/core";
|
|
2
|
+
|
|
3
|
+
export const CodeCopyHost = css`
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
|
|
8
|
+
padding: 8px;
|
|
9
|
+
|
|
10
|
+
border-radius: 6px;
|
|
11
|
+
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
|
|
14
|
+
&:hover {
|
|
15
|
+
background: var(--XydAtlas-Component-Code-Copy__color-background--active);
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React, {useState} from "react"
|
|
2
2
|
import {Copy, CopyCheck, 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,134 +1,131 @@
|
|
|
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
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
opacity: 0.5;
|
|
133
|
-
`
|
|
134
|
-
}
|
|
3
|
+
export const CodeSampleHost = css`
|
|
4
|
+
flex: 1 1 0;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
min-width: 0;
|
|
7
|
+
max-width: 512px;
|
|
8
|
+
|
|
9
|
+
border: 1px solid var(--XydAtlas-Component-Code-Sample__color-border);
|
|
10
|
+
border-radius: 16px;
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
export const CodeSampleLanguagesHost = css`
|
|
14
|
+
display: flex;
|
|
15
|
+
flex: 1 1 0%;
|
|
16
|
+
padding: 8px 0px;
|
|
17
|
+
|
|
18
|
+
background: linear-gradient(45deg, rgb(247, 247, 248) 0%, rgb(247, 247, 248) 100%) !important;
|
|
19
|
+
|
|
20
|
+
border-top-right-radius: 10px;
|
|
21
|
+
border-top-left-radius: 10px;
|
|
22
|
+
border-bottom: 0px;
|
|
23
|
+
|
|
24
|
+
min-width: 0;
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
export const CodeSampleLanguagesList = css`
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-grow: 1;
|
|
30
|
+
justify-content: end;
|
|
31
|
+
gap: 8px;
|
|
32
|
+
padding: 0 10px;
|
|
33
|
+
`;
|
|
34
|
+
|
|
35
|
+
export const CodeSampleLanguagesButton = css`
|
|
36
|
+
all: unset;
|
|
37
|
+
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
justify-content: center;
|
|
43
|
+
|
|
44
|
+
border-radius: 6px;
|
|
45
|
+
padding: 6px;
|
|
46
|
+
|
|
47
|
+
font-size: 14px;
|
|
48
|
+
color: var(--XydAtlas-Component-Code-Sample__color);
|
|
49
|
+
|
|
50
|
+
&[data-state="active"] {
|
|
51
|
+
color: var(--XydAtlas-Component-Code-Sample__color--active);
|
|
52
|
+
border-bottom: 1px solid var(--XydAtlas-Component-Code-Sample__color--active);
|
|
53
|
+
border-bottom-left-radius: 0px;
|
|
54
|
+
border-bottom-right-radius: 0px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&:hover {
|
|
58
|
+
transition: ease-in 0.1s;
|
|
59
|
+
background: var(--XydAtlas-Component-Code-Sample__color-background);
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
62
|
+
|
|
63
|
+
export const CodeSampleLanguagesDescription = css`
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
gap: 4px;
|
|
67
|
+
|
|
68
|
+
font-size: 14px;
|
|
69
|
+
color: var(--XydAtlas-Component-Code-Sample__color);
|
|
70
|
+
|
|
71
|
+
margin-left: 4px;
|
|
72
|
+
margin-right: 4px;
|
|
73
|
+
`;
|
|
74
|
+
|
|
75
|
+
export const CodeSampleLanguagesDescriptionItem = css`
|
|
76
|
+
display: flex;
|
|
77
|
+
padding-left: 16px;
|
|
78
|
+
padding-right: 16px;
|
|
79
|
+
flex: 1 1 0%;
|
|
80
|
+
gap: 16px;
|
|
81
|
+
border-radius: 4px;
|
|
82
|
+
`;
|
|
83
|
+
|
|
84
|
+
export const CodeSampleLanguagesCopy = css`
|
|
85
|
+
display: flex;
|
|
86
|
+
padding-left: 8px;
|
|
87
|
+
padding-right: 8px;
|
|
88
|
+
align-items: center;
|
|
89
|
+
`;
|
|
90
|
+
|
|
91
|
+
export const CodeSampleCodeHost = css`
|
|
92
|
+
max-height: 400px;
|
|
93
|
+
background: linear-gradient(45deg, rgb(247, 247, 248) 0%, rgb(247, 247, 248) 100%) !important;
|
|
94
|
+
|
|
95
|
+
margin: 0;
|
|
96
|
+
padding: 8px 16px;
|
|
97
|
+
|
|
98
|
+
border-top: 1px solid var(--XydAtlas-Component-Code-Sample__color-border);
|
|
99
|
+
border-bottom-left-radius: 10px;
|
|
100
|
+
border-bottom-right-radius: 10px;
|
|
101
|
+
|
|
102
|
+
font-size: 14px;
|
|
103
|
+
line-height: 20px;
|
|
104
|
+
white-space: pre-wrap;
|
|
105
|
+
word-break: break-all;
|
|
106
|
+
|
|
107
|
+
overflow-y: scroll;
|
|
108
|
+
`;
|
|
109
|
+
|
|
110
|
+
export const CodeSampleMarkHost = css`
|
|
111
|
+
display: flex;
|
|
112
|
+
border-left-width: 4px;
|
|
113
|
+
border-color: transparent;
|
|
114
|
+
margin: 4px 0;
|
|
115
|
+
`;
|
|
116
|
+
|
|
117
|
+
export const CodeSampleMarkLine = css`
|
|
118
|
+
flex: 1 1 0%;
|
|
119
|
+
`;
|
|
120
|
+
|
|
121
|
+
export const CodeSampleMarkAnnotated = css`
|
|
122
|
+
border-color: var(--XydAtlas-Component-Code-Sample__color-markBorder--active);
|
|
123
|
+
background-color: var(--XydAtlas-Component-Code-Sample__color-markBackground--active);
|
|
124
|
+
`;
|
|
125
|
+
|
|
126
|
+
export const CodeSampleLineNumberHost = css`
|
|
127
|
+
margin: 0 4px;
|
|
128
|
+
//text-align: right;
|
|
129
|
+
user-select: none;
|
|
130
|
+
opacity: 0.5;
|
|
131
|
+
`;
|