@xyd-js/atlas 0.1.0-xyd.11 → 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 +15 -0
- package/LICENSE +21 -0
- package/dist/CodeSample-B9VUhTKF-DJ2leksk.js +2 -0
- package/dist/CodeSample-B9VUhTKF-DJ2leksk.js.map +1 -0
- package/dist/CodeSample-BSXeFy0x-DJ2leksk.js +2 -0
- package/dist/CodeSample-BSXeFy0x-DJ2leksk.js.map +1 -0
- 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.d.ts +15 -0
- package/dist/atlas-index.js +2 -0
- package/dist/atlas-index.js.map +1 -0
- package/dist/index.css +58 -58
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/tokens.css +57 -0
- package/index.ts +1 -2
- package/package.json +8 -3
- package/packages/atlas-index/AtlasIndex.tsx +79 -0
- package/packages/atlas-index/index.ts +3 -0
- package/rollup.config.js +53 -11
- 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 +128 -142
- 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 +15 -21
- package/src/components/Code/CodeSampleButtons/CodeSampleButtons.styles.tsx +57 -141
- package/src/components/Code/CodeSampleButtons/CodeSampleButtons.tsx +13 -20
- package/src/styles/tokens.css +57 -0
- package/tsconfig.json +3 -0
- package/src/components/Code/CodeCopy/CodeCopy.style.tsx +0 -21
package/dist/tokens.css
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
/* Ref tokens - Base values */
|
|
3
|
+
--XydAtlas-Ref-Palette-Primary-60: #7051d4;
|
|
4
|
+
--XydAtlas-Ref-Palette-Primary-70: #6045b9;
|
|
5
|
+
--XydAtlas-Ref-Palette-Primary-80: #4f399e;
|
|
6
|
+
|
|
7
|
+
--XydAtlas-Ref-Palette-Neutral-10: #F8F9FA;
|
|
8
|
+
--XydAtlas-Ref-Palette-Neutral-20: #F1F3F5;
|
|
9
|
+
--XydAtlas-Ref-Palette-Neutral-30: #E9ECEF;
|
|
10
|
+
--XydAtlas-Ref-Palette-Neutral-40: #DEE2E6;
|
|
11
|
+
--XydAtlas-Ref-Palette-Neutral-70: #6C757D;
|
|
12
|
+
--XydAtlas-Ref-Palette-Neutral-80: #495057;
|
|
13
|
+
--XydAtlas-Ref-Palette-Neutral-100: #212529;
|
|
14
|
+
|
|
15
|
+
/* System tokens - Semantic values */
|
|
16
|
+
--XydAtlas-Sys-Color-Primary: var(--XydAtlas-Ref-Palette-Primary-60);
|
|
17
|
+
--XydAtlas-Sys-Color-Primary--hover: var(--XydAtlas-Ref-Palette-Primary-70);
|
|
18
|
+
--XydAtlas-Sys-Color-Primary--active: var(--XydAtlas-Ref-Palette-Primary-80);
|
|
19
|
+
|
|
20
|
+
--XydAtlas-Sys-Color-Surface: var(--XydAtlas-Ref-Palette-Neutral-10);
|
|
21
|
+
--XydAtlas-Sys-Color-Surface--hover: var(--XydAtlas-Ref-Palette-Neutral-20);
|
|
22
|
+
--XydAtlas-Sys-Color-Surface--active: var(--XydAtlas-Ref-Palette-Neutral-30);
|
|
23
|
+
|
|
24
|
+
--XydAtlas-Sys-Color-Text-Primary: var(--XydAtlas-Ref-Palette-Neutral-100);
|
|
25
|
+
--XydAtlas-Sys-Color-Text-Secondary: var(--XydAtlas-Ref-Palette-Neutral-80);
|
|
26
|
+
--XydAtlas-Sys-Color-Text-Tertiary: var(--XydAtlas-Ref-Palette-Neutral-70);
|
|
27
|
+
|
|
28
|
+
--XydAtlas-Sys-Color-Border: var(--XydAtlas-Ref-Palette-Neutral-30);
|
|
29
|
+
--XydAtlas-Sys-Color-Border--hover: var(--XydAtlas-Ref-Palette-Neutral-40);
|
|
30
|
+
--XydAtlas-Sys-Color-Border--active: var(--XydAtlas-Ref-Palette-Primary-60);
|
|
31
|
+
|
|
32
|
+
/* Component tokens - Specific component values */
|
|
33
|
+
/* ApiRef Properties */
|
|
34
|
+
--XydAtlas-Component-ApiRef-Properties__color-description: var(--XydAtlas-Sys-Color-Text-Secondary);
|
|
35
|
+
--XydAtlas-Component-ApiRef-Properties__color-propName: var(--XydAtlas-Sys-Color-Text-Primary);
|
|
36
|
+
--XydAtlas-Component-ApiRef-Properties__color-propType: var(--XydAtlas-Sys-Color-Text-Tertiary);
|
|
37
|
+
--XydAtlas-Component-ApiRef-Properties__color--active: var(--XydAtlas-Sys-Color-Primary);
|
|
38
|
+
--XydAtlas-Component-ApiRef-Properties__color-border: var(--XydAtlas-Sys-Color-Border);
|
|
39
|
+
|
|
40
|
+
/* ApiRef Item */
|
|
41
|
+
--XydAtlas-Component-ApiRef-Item__color-border: var(--XydAtlas-Sys-Color-Border);
|
|
42
|
+
--XydAtlas-Component-ApiRef-Item__color-navbar: var(--XydAtlas-Sys-Color-Text-Secondary);
|
|
43
|
+
|
|
44
|
+
/* Code Sample */
|
|
45
|
+
--XydAtlas-Component-Code-Sample__color-border: var(--XydAtlas-Sys-Color-Border);
|
|
46
|
+
--XydAtlas-Component-Code-Sample__color: var(--XydAtlas-Sys-Color-Text-Secondary);
|
|
47
|
+
--XydAtlas-Component-Code-Sample__color--active: var(--XydAtlas-Sys-Color-Primary);
|
|
48
|
+
--XydAtlas-Component-Code-Sample__color-background: var(--XydAtlas-Sys-Color-Surface--hover);
|
|
49
|
+
--XydAtlas-Component-Code-Sample__color-markBorder--active: var(--XydAtlas-Sys-Color-Primary);
|
|
50
|
+
--XydAtlas-Component-Code-Sample__color-markBackground--active: var(--XydAtlas-Sys-Color-Surface--hover);
|
|
51
|
+
|
|
52
|
+
/* Code Sample Buttons */
|
|
53
|
+
--XydAtlas-Component-Code-SampleButtons__color-containerBackground: var(--XydAtlas-Sys-Color-Surface);
|
|
54
|
+
--XydAtlas-Component-Code-SampleButtons__color-background--active: var(--XydAtlas-Sys-Color-Surface--active);
|
|
55
|
+
--XydAtlas-Component-Code-SampleButtons__color: var(--XydAtlas-Sys-Color-Text-Secondary);
|
|
56
|
+
--XydAtlas-Component-Code-SampleButtons__color--active: var(--XydAtlas-Sys-Color-Text-Primary);
|
|
57
|
+
}
|
package/index.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export * from "./src/components/Atlas"
|
|
1
|
+
export * from "./src/components/Atlas"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyd-js/atlas",
|
|
3
|
-
"version": "0.1.0-xyd.
|
|
3
|
+
"version": "0.1.0-xyd.13",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -8,8 +8,12 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
"./package.json": "./package.json",
|
|
10
10
|
"./index.css": "./dist/index.css",
|
|
11
|
+
"./tokens.css": "./dist/tokens.css",
|
|
11
12
|
".": {
|
|
12
13
|
"import": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./atlas-index": {
|
|
16
|
+
"import": "./dist/atlas-index.js"
|
|
13
17
|
}
|
|
14
18
|
},
|
|
15
19
|
"dependencies": {
|
|
@@ -17,7 +21,7 @@
|
|
|
17
21
|
"@radix-ui/react-tabs": "^1.1.1",
|
|
18
22
|
"codehike": "^1.0.2",
|
|
19
23
|
"lucide-react": "^0.447.0",
|
|
20
|
-
"@xyd-js/uniform": "0.1.0-xyd.
|
|
24
|
+
"@xyd-js/uniform": "0.1.0-xyd.12"
|
|
21
25
|
},
|
|
22
26
|
"peerDependencies": {
|
|
23
27
|
"react": "^19.0.0"
|
|
@@ -56,12 +60,13 @@
|
|
|
56
60
|
"rimraf": "^3.0.2",
|
|
57
61
|
"prop-types": "^15.8.1",
|
|
58
62
|
"storybook": "^8.4.5",
|
|
59
|
-
"@xyd-js/gql": "0.1.0-xyd.
|
|
63
|
+
"@xyd-js/gql": "0.1.0-xyd.10"
|
|
60
64
|
},
|
|
61
65
|
"scripts": {
|
|
62
66
|
"clean": "rimraf build",
|
|
63
67
|
"prebuild": "pnpm clean",
|
|
64
68
|
"build": "rollup -c rollup.config.js",
|
|
69
|
+
"dev": "rollup -c rollup.config.js --watch",
|
|
65
70
|
"storybook": "storybook dev -p 6006",
|
|
66
71
|
"build-storybook": "storybook build"
|
|
67
72
|
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
|
|
3
|
+
import type {Reference} from "@xyd-js/uniform";
|
|
4
|
+
import {
|
|
5
|
+
Heading,
|
|
6
|
+
TableV2,
|
|
7
|
+
Details,
|
|
8
|
+
Code,
|
|
9
|
+
|
|
10
|
+
IconQuote
|
|
11
|
+
} from "@xyd-js/components/writer";
|
|
12
|
+
import {
|
|
13
|
+
helperContent
|
|
14
|
+
} from "@xyd-js/components/content";
|
|
15
|
+
|
|
16
|
+
import {MDXReference, mdxValue} from "@/utils/mdx";
|
|
17
|
+
|
|
18
|
+
const {Content} = helperContent()
|
|
19
|
+
|
|
20
|
+
// TODO: interface should be imported from somewhere
|
|
21
|
+
interface CodeSourceContext {
|
|
22
|
+
fileName: string;
|
|
23
|
+
fileFullPath: string;
|
|
24
|
+
sourcecode: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface AtlasIndexProps {
|
|
28
|
+
data: MDXReference<Reference<CodeSourceContext>>
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function AtlasIndex({data}: AtlasIndexProps) {
|
|
32
|
+
return <Content>
|
|
33
|
+
<Heading size={1}>
|
|
34
|
+
{mdxValue(data.title)}
|
|
35
|
+
</Heading>
|
|
36
|
+
|
|
37
|
+
<p>
|
|
38
|
+
{data.description.children}
|
|
39
|
+
</p>
|
|
40
|
+
|
|
41
|
+
{
|
|
42
|
+
mdxValue(data.context?.fileName) && <Details
|
|
43
|
+
label=""
|
|
44
|
+
kind="tertiary"
|
|
45
|
+
title={<>
|
|
46
|
+
Source code in <Code>{mdxValue(data.context.fileFullPath)}</Code>
|
|
47
|
+
</>}
|
|
48
|
+
icon={<IconQuote/>}>
|
|
49
|
+
{data.context.sourcecode.children}
|
|
50
|
+
</Details>
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
{
|
|
54
|
+
data.definitions.map((definition, index) => {
|
|
55
|
+
return <>
|
|
56
|
+
<Heading size={2}>
|
|
57
|
+
{mdxValue(definition.title)}
|
|
58
|
+
</Heading>
|
|
59
|
+
<TableV2 key={index}>
|
|
60
|
+
<TableV2.Head>
|
|
61
|
+
<TableV2.Tr>
|
|
62
|
+
<TableV2.Th>Type</TableV2.Th>
|
|
63
|
+
<TableV2.Th>Description</TableV2.Th>
|
|
64
|
+
</TableV2.Tr>
|
|
65
|
+
</TableV2.Head>
|
|
66
|
+
{definition.properties?.map((property, propIndex) => (
|
|
67
|
+
<TableV2.Tr key={propIndex}>
|
|
68
|
+
<TableV2.Td>
|
|
69
|
+
<Code>{mdxValue(property.name) || mdxValue(property.type)}</Code>
|
|
70
|
+
</TableV2.Td>
|
|
71
|
+
<TableV2.Td muted>{property?.children}</TableV2.Td>
|
|
72
|
+
</TableV2.Tr>
|
|
73
|
+
))}
|
|
74
|
+
</TableV2>
|
|
75
|
+
</>
|
|
76
|
+
})
|
|
77
|
+
}
|
|
78
|
+
</Content>
|
|
79
|
+
}
|
package/rollup.config.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import {createRequire} from 'module';
|
|
3
|
+
|
|
1
4
|
import resolve from '@rollup/plugin-node-resolve';
|
|
2
5
|
import commonjs from '@rollup/plugin-commonjs';
|
|
3
6
|
import typescript from '@rollup/plugin-typescript';
|
|
@@ -6,7 +9,6 @@ import {terser} from 'rollup-plugin-terser';
|
|
|
6
9
|
import babel from '@rollup/plugin-babel';
|
|
7
10
|
import css from 'rollup-plugin-css-only';
|
|
8
11
|
import wyw from '@wyw-in-js/rollup';
|
|
9
|
-
import {createRequire} from 'module';
|
|
10
12
|
|
|
11
13
|
const require = createRequire(import.meta.url);
|
|
12
14
|
const {
|
|
@@ -21,20 +23,33 @@ const external = [
|
|
|
21
23
|
...Object.keys(devDependencies),
|
|
22
24
|
];
|
|
23
25
|
|
|
26
|
+
// Function to copy tokens.css to dist
|
|
27
|
+
function copyTokensCss() {
|
|
28
|
+
return {
|
|
29
|
+
name: 'copy-tokens-css',
|
|
30
|
+
writeBundle() {
|
|
31
|
+
const tokensCss = fs.readFileSync('src/styles/tokens.css', 'utf8');
|
|
32
|
+
fs.mkdirSync('dist', { recursive: true });
|
|
33
|
+
fs.writeFileSync('dist/tokens.css', tokensCss);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
24
38
|
export default [
|
|
25
39
|
{
|
|
26
|
-
input:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
format: 'esm',
|
|
30
|
-
sourcemap: true,
|
|
40
|
+
input: {
|
|
41
|
+
index: 'index.ts',
|
|
42
|
+
["atlas-index"]: 'packages/atlas-index/index.ts'
|
|
31
43
|
},
|
|
44
|
+
output: [
|
|
45
|
+
{
|
|
46
|
+
dir: 'dist',
|
|
47
|
+
format: 'esm',
|
|
48
|
+
sourcemap: true,
|
|
49
|
+
entryFileNames: '[name].js'
|
|
50
|
+
}
|
|
51
|
+
],
|
|
32
52
|
plugins: [
|
|
33
|
-
// alias({ TODO: finish?
|
|
34
|
-
// entries: [
|
|
35
|
-
// {find: '@', replacement: resolve(__dirname, 'src')}
|
|
36
|
-
// ]
|
|
37
|
-
// }),
|
|
38
53
|
wyw({
|
|
39
54
|
include: ['**/*.{ts,tsx}'],
|
|
40
55
|
babelOptions: {
|
|
@@ -43,10 +58,28 @@ export default [
|
|
|
43
58
|
'@babel/preset-react'
|
|
44
59
|
],
|
|
45
60
|
},
|
|
61
|
+
classNameSlug: (hash, title, {file}) => {
|
|
62
|
+
// Get the full path after 'src/components/'
|
|
63
|
+
const pathParts = file.split('/');
|
|
64
|
+
const componentsIndex = pathParts.indexOf('components');
|
|
65
|
+
if (componentsIndex === -1) return `XydAtlas-Component-${title}`;
|
|
66
|
+
|
|
67
|
+
// Get everything after 'components' directory
|
|
68
|
+
const componentPath = pathParts
|
|
69
|
+
.slice(componentsIndex + 1)
|
|
70
|
+
.filter(part => !part.endsWith('.styles.tsx')) // Remove styles.tsx
|
|
71
|
+
.join('-');
|
|
72
|
+
|
|
73
|
+
// Use the title as the style name (it's already the variable name)
|
|
74
|
+
const styleName = title.replace(/^\$/, ''); // Remove $ prefix if present
|
|
75
|
+
|
|
76
|
+
return `XydAtlas-Component-${componentPath}__${styleName}`;
|
|
77
|
+
}
|
|
46
78
|
}),
|
|
47
79
|
css({
|
|
48
80
|
output: 'index.css',
|
|
49
81
|
}),
|
|
82
|
+
copyTokensCss(),
|
|
50
83
|
resolve(),
|
|
51
84
|
commonjs(),
|
|
52
85
|
typescript({
|
|
@@ -73,4 +106,13 @@ export default [
|
|
|
73
106
|
plugins: [dts()],
|
|
74
107
|
external
|
|
75
108
|
},
|
|
109
|
+
{
|
|
110
|
+
input: 'packages/atlas-index/index.ts',
|
|
111
|
+
output: {
|
|
112
|
+
file: 'dist/atlas-index.d.ts',
|
|
113
|
+
format: 'es',
|
|
114
|
+
},
|
|
115
|
+
plugins: [dts()],
|
|
116
|
+
external
|
|
117
|
+
},
|
|
76
118
|
];
|
|
@@ -1,70 +1,59 @@
|
|
|
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
|
-
export const $subtitle = {
|
|
62
|
-
host: css`
|
|
63
|
-
font-size: 15px;
|
|
64
|
-
font-weight: 600;
|
|
65
|
-
`,
|
|
66
|
-
link: css`
|
|
67
|
-
text-decoration: none;
|
|
68
|
-
`,
|
|
69
|
-
}
|
|
3
|
+
export const ApiRefItemTitleHost = css`
|
|
4
|
+
font-size: 30px;
|
|
5
|
+
font-weight: 400;
|
|
6
|
+
`;
|
|
7
|
+
|
|
8
|
+
export const ApiRefItemTitleLink = css`
|
|
9
|
+
`;
|
|
10
|
+
|
|
11
|
+
export const ApiRefItemNavbarHost = css`
|
|
12
|
+
`;
|
|
13
|
+
|
|
14
|
+
export const ApiRefItemNavbarContainer = css`
|
|
15
|
+
background: linear-gradient(45deg, rgb(247, 247, 248) 0%, rgb(247, 247, 248) 100%);
|
|
16
|
+
padding: 8px;
|
|
17
|
+
border: 1px solid var(--XydAtlas-Component-ApiRef-Item__color-border);
|
|
18
|
+
border-radius: 8px;
|
|
19
|
+
font-size: 13px;
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
export const ApiRefItemNavbarLabel = css`
|
|
23
|
+
color: var(--XydAtlas-Component-ApiRef-Item__color-navbar);
|
|
24
|
+
margin-right: 4px;
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
export const ApiRefItemHost = css`
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
gap: 16px;
|
|
31
|
+
padding-bottom: 25px;
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
export const ApiRefItemGrid = css`
|
|
35
|
+
display: grid;
|
|
36
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
37
|
+
align-items: normal;
|
|
38
|
+
gap: 100px;
|
|
39
|
+
`;
|
|
40
|
+
|
|
41
|
+
export const ApiRefItemPropertiesHost = css`
|
|
42
|
+
`;
|
|
43
|
+
|
|
44
|
+
export const ApiRefItemPropertiesItem = css`
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
gap: 25px;
|
|
48
|
+
margin-bottom: 25px;
|
|
49
|
+
`;
|
|
50
|
+
|
|
51
|
+
export const ApiRefItemSubtitleHost = css`
|
|
52
|
+
font-size: 15px;
|
|
53
|
+
font-weight: 600;
|
|
54
|
+
`;
|
|
55
|
+
|
|
56
|
+
export const ApiRefItemSubtitleLink = css`
|
|
57
|
+
text-decoration: none;
|
|
58
|
+
`;
|
|
70
59
|
|
|
@@ -7,13 +7,7 @@ import {
|
|
|
7
7
|
ApiRefProperties,
|
|
8
8
|
ApiRefSamples
|
|
9
9
|
} from "@/components/ApiRef";
|
|
10
|
-
import
|
|
11
|
-
$navbar,
|
|
12
|
-
$refItem,
|
|
13
|
-
$properties,
|
|
14
|
-
$subtitle,
|
|
15
|
-
$title
|
|
16
|
-
} from "@/components/ApiRef/ApiRefItem/ApiRefItem.styles";
|
|
10
|
+
import * as cn from "@/components/ApiRef/ApiRefItem/ApiRefItem.styles";
|
|
17
11
|
|
|
18
12
|
export interface ApiRefItemProps {
|
|
19
13
|
reference: MDXReference<Reference>
|
|
@@ -31,7 +25,7 @@ export function ApiRefItem({reference}: ApiRefItemProps) {
|
|
|
31
25
|
break;
|
|
32
26
|
}
|
|
33
27
|
// TODO: finish subitlte from ref
|
|
34
|
-
topNavbar =
|
|
28
|
+
topNavbar = <Navbar
|
|
35
29
|
label={ctx.method.title}
|
|
36
30
|
subtitle={`${decodeURIComponent(ctx.path.title)}`}
|
|
37
31
|
/>
|
|
@@ -39,27 +33,27 @@ export function ApiRefItem({reference}: ApiRefItemProps) {
|
|
|
39
33
|
}
|
|
40
34
|
}
|
|
41
35
|
|
|
42
|
-
return <div className={
|
|
43
|
-
|
|
36
|
+
return <div className={cn.ApiRefItemHost}>
|
|
37
|
+
<Title title={reference.title || ""}/>
|
|
44
38
|
|
|
45
39
|
{topNavbar}
|
|
46
40
|
|
|
47
41
|
{reference.description.children}
|
|
48
42
|
|
|
49
|
-
<div className={
|
|
50
|
-
|
|
43
|
+
<div className={cn.ApiRefItemGrid}>
|
|
44
|
+
<Properties reference={reference}/>
|
|
51
45
|
{reference.examples && <ApiRefSamples examples={reference.examples}/>}
|
|
52
46
|
</div>
|
|
53
47
|
|
|
54
48
|
</div>
|
|
55
49
|
}
|
|
56
50
|
|
|
57
|
-
function
|
|
58
|
-
return <div className={
|
|
51
|
+
function Properties({reference}: ApiRefItemProps) {
|
|
52
|
+
return <div className={cn.ApiRefItemPropertiesHost}>
|
|
59
53
|
{reference?.definitions?.map((definition, i) => <div key={i}>
|
|
60
54
|
{
|
|
61
|
-
definition.properties?.length && <div key={i} className={
|
|
62
|
-
|
|
55
|
+
definition.properties?.length && <div key={i} className={cn.ApiRefItemPropertiesItem}>
|
|
56
|
+
<Subtitle title={definition.title.title}/>
|
|
63
57
|
|
|
64
58
|
<ApiRefProperties properties={definition.properties}/>
|
|
65
59
|
</div>
|
|
@@ -68,11 +62,11 @@ function $Properties({reference}: ApiRefItemProps) {
|
|
|
68
62
|
</div>
|
|
69
63
|
}
|
|
70
64
|
|
|
71
|
-
function
|
|
65
|
+
function Navbar({label, subtitle}: { label: string, subtitle: string }) {
|
|
72
66
|
return <>
|
|
73
|
-
<div className={
|
|
74
|
-
<span className={
|
|
75
|
-
<span className={
|
|
67
|
+
<div className={cn.ApiRefItemNavbarHost}>
|
|
68
|
+
<span className={cn.ApiRefItemNavbarContainer}>
|
|
69
|
+
<span className={cn.ApiRefItemNavbarLabel}>
|
|
76
70
|
{label.toUpperCase()}
|
|
77
71
|
</span>
|
|
78
72
|
<span>
|
|
@@ -83,21 +77,20 @@ function $Navbar({label, subtitle}: { label: string, subtitle: string }) {
|
|
|
83
77
|
</>
|
|
84
78
|
}
|
|
85
79
|
|
|
86
|
-
|
|
87
|
-
function $Title({title}: { title: string }) {
|
|
80
|
+
function Title({title}: { title: string }) {
|
|
88
81
|
return <>
|
|
89
|
-
<h1 className={
|
|
90
|
-
<a className={
|
|
82
|
+
<h1 className={cn.ApiRefItemTitleHost}>
|
|
83
|
+
<a className={cn.ApiRefItemTitleLink}>
|
|
91
84
|
{title}
|
|
92
85
|
</a>
|
|
93
86
|
</h1>
|
|
94
87
|
</>
|
|
95
88
|
}
|
|
96
89
|
|
|
97
|
-
function
|
|
90
|
+
function Subtitle({title}: { title: string }) {
|
|
98
91
|
return <>
|
|
99
|
-
<h1 className={
|
|
100
|
-
<a className={
|
|
92
|
+
<h1 className={cn.ApiRefItemSubtitleHost}>
|
|
93
|
+
<a className={cn.ApiRefItemSubtitleLink}>
|
|
101
94
|
{title}
|
|
102
95
|
</a>
|
|
103
96
|
</h1>
|