@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.
Files changed (44) hide show
  1. package/.storybook/index.css +2 -27
  2. package/CHANGELOG.md +7 -0
  3. package/LICENSE +21 -0
  4. package/dist/{CodeSample-Cp42Adjc-C5AHaCBx.js → CodeSample-B9VUhTKF-DJ2leksk.js} +2 -2
  5. package/dist/{CodeSample-Cp42Adjc-C5AHaCBx.js.map → CodeSample-B9VUhTKF-DJ2leksk.js.map} +1 -1
  6. package/dist/{CodeSample-DxPp80ID-C5AHaCBx.js → CodeSample-BSXeFy0x-DJ2leksk.js} +2 -2
  7. package/dist/{CodeSample-DxPp80ID-C5AHaCBx.js.map → CodeSample-BSXeFy0x-DJ2leksk.js.map} +1 -1
  8. package/dist/CodeSample-BwP208sQ-DJ2leksk.js +2 -0
  9. package/dist/CodeSample-BwP208sQ-DJ2leksk.js.map +1 -0
  10. package/dist/CodeSample-CUemtj_W-DJ2leksk.js +2 -0
  11. package/dist/CodeSample-CUemtj_W-DJ2leksk.js.map +1 -0
  12. package/dist/CodeSample-D0iKih-A-DJ2leksk.js +2 -0
  13. package/dist/CodeSample-D0iKih-A-DJ2leksk.js.map +1 -0
  14. package/dist/CodeSample-D33vTa6M-DJ2leksk.js +2 -0
  15. package/dist/CodeSample-D33vTa6M-DJ2leksk.js.map +1 -0
  16. package/dist/CodeSample-DUSx2KBt-DJ2leksk.js +2 -0
  17. package/dist/CodeSample-DUSx2KBt-DJ2leksk.js.map +1 -0
  18. package/dist/CodeSample-P4yxkHPW-DJ2leksk.js +2 -0
  19. package/dist/CodeSample-P4yxkHPW-DJ2leksk.js.map +1 -0
  20. package/dist/atlas-index.js +1 -1
  21. package/dist/atlas-index.js.map +1 -1
  22. package/dist/index.css +58 -58
  23. package/dist/index.js +1 -1
  24. package/dist/index.js.map +1 -1
  25. package/package.json +3 -3
  26. package/rollup.config.js +2 -2
  27. package/src/components/ApiRef/ApiRefItem/ApiRefItem.styles.tsx +56 -67
  28. package/src/components/ApiRef/ApiRefItem/ApiRefItem.tsx +20 -27
  29. package/src/components/ApiRef/ApiRefProperties/ApiRefProperties.styles.tsx +124 -139
  30. package/src/components/ApiRef/ApiRefProperties/ApiRefProperties.tsx +27 -37
  31. package/src/components/ApiRef/ApiRefSamples/ApiRefSamples.styles.tsx +18 -23
  32. package/src/components/ApiRef/ApiRefSamples/ApiRefSamples.tsx +3 -6
  33. package/src/components/Atlas/Atlas.styles.tsx +3 -5
  34. package/src/components/Atlas/Atlas.tsx +2 -5
  35. package/src/components/Atlas/AtlasLazy/AtlasLazy.styles.tsx +7 -8
  36. package/src/components/Atlas/AtlasLazy/AtlasLazy.tsx +2 -4
  37. package/src/components/Code/CodeCopy/CodeCopy.styles.tsx +17 -0
  38. package/src/components/Code/CodeCopy/CodeCopy.tsx +2 -4
  39. package/src/components/Code/CodeSample/CodeSample.styles.tsx +129 -132
  40. package/src/components/Code/CodeSample/CodeSample.tsx +12 -18
  41. package/src/components/Code/CodeSampleButtons/CodeSampleButtons.styles.tsx +56 -134
  42. package/src/components/Code/CodeSampleButtons/CodeSampleButtons.tsx +13 -20
  43. package/src/components/Code/CodeCopy/CodeCopy.style.tsx +0 -19
  44. package/src/utils/linaria.ts +0 -20
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyd-js/atlas",
3
- "version": "0.1.0-xyd.12",
3
+ "version": "0.1.0-xyd.13",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -21,7 +21,7 @@
21
21
  "@radix-ui/react-tabs": "^1.1.1",
22
22
  "codehike": "^1.0.2",
23
23
  "lucide-react": "^0.447.0",
24
- "@xyd-js/uniform": "0.1.0-xyd.11"
24
+ "@xyd-js/uniform": "0.1.0-xyd.12"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "react": "^19.0.0"
@@ -60,7 +60,7 @@
60
60
  "rimraf": "^3.0.2",
61
61
  "prop-types": "^15.8.1",
62
62
  "storybook": "^8.4.5",
63
- "@xyd-js/gql": "0.1.0-xyd.9"
63
+ "@xyd-js/gql": "0.1.0-xyd.10"
64
64
  },
65
65
  "scripts": {
66
66
  "clean": "rimraf build",
package/rollup.config.js CHANGED
@@ -62,7 +62,7 @@ export default [
62
62
  // Get the full path after 'src/components/'
63
63
  const pathParts = file.split('/');
64
64
  const componentsIndex = pathParts.indexOf('components');
65
- if (componentsIndex === -1) return `XydAtlas-Component-${title}_${hash}`;
65
+ if (componentsIndex === -1) return `XydAtlas-Component-${title}`;
66
66
 
67
67
  // Get everything after 'components' directory
68
68
  const componentPath = pathParts
@@ -73,7 +73,7 @@ export default [
73
73
  // Use the title as the style name (it's already the variable name)
74
74
  const styleName = title.replace(/^\$/, ''); // Remove $ prefix if present
75
75
 
76
- return `XydAtlas-Component-${componentPath}__${styleName}_${hash}`;
76
+ return `XydAtlas-Component-${componentPath}__${styleName}`;
77
77
  }
78
78
  }),
79
79
  css({
@@ -1,70 +1,59 @@
1
1
  import {css} from "@linaria/core";
2
2
 
3
- export const $title = {
4
- host: css`
5
- font-size: 30px;
6
- font-weight: 400;
7
- `,
8
- link: css`
9
- `,
10
- }
11
-
12
- export const $navbar = {
13
- host: css`
14
- `,
15
- container: css`
16
- background: linear-gradient(45deg, rgb(247, 247, 248) 0%, rgb(247, 247, 248) 100%);
17
-
18
- padding: 8px;
19
-
20
- border: 1px solid var(--XydAtlas-Component-ApiRef-Item__color-border);
21
- border-radius: 8px;
22
-
23
- font-size: 13px;
24
- `,
25
- label: css`
26
- color: var(--XydAtlas-Component-ApiRef-Item__color-navbar);
27
-
28
- margin-right: 4px;
29
- `,
30
- }
31
-
32
- export const $refItem = {
33
- host: css`
34
- display: flex;
35
- flex-direction: column;
36
- gap: 16px;
37
-
38
- padding-bottom: 25px;
39
- `,
40
- grid: css`
41
- display: grid;
42
- grid-template-columns: repeat(2, minmax(0, 1fr));
43
- align-items: normal;
44
- gap: 100px;
45
- `,
46
- }
47
-
48
- export const $properties = {
49
- host: css`
50
-
51
- `,
52
- item: css`
53
- display: flex;
54
- flex-direction: column;
55
- gap: 25px;
56
-
57
- margin-bottom: 25px;
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 = <$Navbar
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={$refItem.host}>
43
- <$Title title={reference.title || ""}/>
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={$refItem.grid}>
50
- <$Properties reference={reference}/>
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 $Properties({reference}: ApiRefItemProps) {
58
- return <div className={$properties.host}>
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={$properties.item}>
62
- <$Subtitle title={definition.title.title}/>
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 $Navbar({label, subtitle}: { label: string, subtitle: string }) {
65
+ function Navbar({label, subtitle}: { label: string, subtitle: string }) {
72
66
  return <>
73
- <div className={$navbar.host}>
74
- <span className={$navbar.container}>
75
- <span className={$navbar.label}>
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={$title.host}>
90
- <a className={$title.link}>
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 $Subtitle({title}: { title: string }) {
90
+ function Subtitle({title}: { title: string }) {
98
91
  return <>
99
- <h1 className={$subtitle.host}>
100
- <a className={$subtitle.link}>
92
+ <h1 className={cn.ApiRefItemSubtitleHost}>
93
+ <a className={cn.ApiRefItemSubtitleLink}>
101
94
  {title}
102
95
  </a>
103
96
  </h1>
@@ -1,160 +1,145 @@
1
1
  import {css} from "@linaria/core";
2
2
 
3
- export const $ul = {
4
- host: css`
5
- display: flex;
6
- flex-wrap: wrap;
7
- flex-direction: column;
8
- gap: 16px;
9
-
10
- padding: 0;
11
- margin: 0;
3
+ export const ApiRefPropertiesUlHost = css`
4
+ display: flex;
5
+ flex-wrap: wrap;
6
+ flex-direction: column;
7
+ gap: 16px;
8
+
9
+ padding: 0;
10
+ margin: 0;
11
+
12
+ list-style: none;
13
+
14
+ border: none;
15
+ `;
16
+
17
+ export const ApiRefPropertiesLiHost = css`
18
+ margin: 0;
19
+ padding: 0;
20
+
21
+ &:first-child {
22
+ padding-top: 0;
23
+ }
24
+
25
+ &:last-child {
26
+ padding-bottom: 0;
27
+ }
28
+ `;
29
+
30
+ export const ApiRefPropertiesDescriptionHost = css`
31
+ font-size: 14px;
32
+ line-height: 22px;
33
+ color: var(--XydAtlas-Component-ApiRef-Properties__color-description);
34
+ `;
35
+
36
+ export const ApiRefPropertiesDlHost = css`
37
+ position: relative;
38
+ display: flex;
39
+ align-items: center;
40
+ justify-content: flex-start;
41
+ flex-wrap: wrap;
42
+ gap: 10px;
43
+
44
+ margin: 8px 0;
45
+
46
+ dd {
47
+ margin-inline-start: 0px;
48
+ }
49
+ `;
50
+
51
+ export const ApiRefPropertiesPropNameCodeHost = css`
52
+ display: inline-flex;
53
+ padding: 4px 0;
54
+ font-weight: 600;
55
+ font-size: 13px;
56
+ color: var(--XydAtlas-Component-ApiRef-Properties__color-propName);
57
+ `;
58
+
59
+ export const ApiRefPropertiesPropTypeCodeHost = css`
60
+ display: inline-flex;
61
+ padding: 4px 0;
62
+ border-radius: 4px;
63
+ font-size: 10px;
64
+ color: var(--XydAtlas-Component-ApiRef-Properties__color-propType);
65
+ `;
66
+
67
+ export const ApiRefPropertiesPropTypeCodeLink = css`
68
+ color: var(--XydAtlas-Component-ApiRef-Properties__color--active);
69
+ text-decoration: underline;
70
+
71
+ &:hover {
72
+ text-decoration: none;
73
+ color: var(--XydAtlas-Sys-Color-Primary--hover);
74
+ }
75
+ `;
12
76
 
13
- list-style: none;
77
+ export const ApiRefPropertiesSubPropsHost = css`
78
+ padding: 8px;
79
+ border-style: none;
80
+ display: none;
81
+ `;
14
82
 
15
- border: none;
16
- `,
17
- }
83
+ export const ApiRefPropertiesSubPropsHostExpanded = css`
84
+ display: unset;
85
+ `;
18
86
 
19
- export const $li = {
20
- host: css`
21
- margin: 0;
22
- padding: 0;
87
+ export const ApiRefPropertiesSubPropsBox = css`
88
+ `;
23
89
 
24
- &:first-child {
25
- padding-top: 0;
26
- }
90
+ export const ApiRefPropertiesSubPropsUl = css`
91
+ display: flex;
92
+ flex-wrap: wrap;
93
+ flex-direction: column;
94
+ gap: 16px;
27
95
 
28
- &:last-child {
29
- padding-bottom: 0;
30
- }
31
- `,
32
- }
33
-
34
- export const $description = {
35
- host: css`
36
- font-size: 14px;
37
- line-height: 22px;
38
- color: var(--XydAtlas-Component-ApiRef-Properties__color-description);
39
- `
40
- }
41
-
42
- export const $dl = {
43
- host: css`
44
- position: relative;
45
- display: flex;
46
- align-items: center;
47
- justify-content: flex-start;
48
- flex-wrap: wrap;
49
- gap: 10px;
50
-
51
- margin: 8px 0;
52
-
53
- dd {
54
- margin-inline-start: 0px;
55
- }
56
- `,
57
- }
96
+ padding: 0;
97
+ margin: 0;
58
98
 
59
- export const $propNameCode = {
60
- host: css`
61
- display: inline-flex;
99
+ list-style: none;
62
100
 
63
- padding: 4px 0;
101
+ border: none;
102
+ border-left: 1px solid var(--XydAtlas-Component-ApiRef-Properties__color-border);
103
+ `;
64
104
 
65
- font-weight: 600;
66
- font-size: 13px;
67
- color: var(--XydAtlas-Component-ApiRef-Properties__color-propName);
68
- `,
69
- }
105
+ export const ApiRefPropertiesSubPropsLi = css`
106
+ padding: 0 16px;
107
+ `;
70
108
 
71
- export const $propTypeCode = {
72
- host: css`
73
- display: inline-flex;
109
+ export const ApiRefPropertiesPropToggleHost = css`
110
+ display: flex;
111
+ align-items: center;
112
+ padding: 0;
113
+ margin-top: 16px;
74
114
 
75
- padding: 4px 0;
115
+ background: none;
116
+ outline: inherit;
117
+ border: none;
76
118
 
77
- border-radius: 4px;
119
+ cursor: pointer;
120
+ color: inherit;
78
121
 
79
- font-size: 10px;
80
- color: var(--XydAtlas-Component-ApiRef-Properties__color-propType);
81
- `,
82
- link: css`
83
- color: var(--XydAtlas-Component-ApiRef-Properties__color--active);
84
- text-decoration: underline;
85
-
86
- &:hover {
87
- text-decoration: none;
88
- color: var(--XydAtlas-Sys-Color-Primary--hover);
89
- }
90
- `
91
- }
92
-
93
- export const $subProps = {
94
- host: css`
95
- padding: 8px;
96
- border-style: none;
97
- display: none;
98
- `,
99
- host$$expanded: css`
100
- display: unset;
101
- `,
102
- box: css`
103
- `,
104
- ul: css`
105
- display: flex;
106
- flex-wrap: wrap;
107
- flex-direction: column;
108
- gap: 16px;
109
-
110
- padding: 0;
111
- margin: 0;
112
-
113
- list-style: none;
114
-
115
- border: none;
116
- border-left: 1px solid var(--XydAtlas-Component-ApiRef-Properties__color-border);
117
- `,
118
- li: css`
119
- padding: 0 16px;
120
- `,
121
- }
122
-
123
- export const $propToggle = {
124
- host: css`
125
- display: flex;
126
- align-items: center;
127
- padding: 0;
128
- margin-top: 16px;
129
-
130
- background: none;
131
- outline: inherit;
132
- border: none;
133
-
134
- cursor: pointer;
135
- color: inherit;
122
+ font-size: 13px;
136
123
 
124
+ svg {
137
125
  font-size: 13px;
126
+ }
138
127
 
128
+ &:hover {
139
129
  svg {
140
- font-size: 13px;
141
- }
142
-
143
- &:hover {
144
- svg {
145
- transition: all ease-in .1s;
146
- color: var(--XydAtlas-Component-ApiRef-Properties__color--active);
147
- }
148
- }
149
- `,
150
- link: css`
151
- text-decoration: none;
152
- cursor: pointer;
153
- margin-left: 4px;
154
-
155
- &:hover {
156
130
  transition: all ease-in .1s;
157
131
  color: var(--XydAtlas-Component-ApiRef-Properties__color--active);
158
132
  }
159
- `
160
- }
133
+ }
134
+ `;
135
+
136
+ export const ApiRefPropertiesPropToggleLink = css`
137
+ text-decoration: none;
138
+ cursor: pointer;
139
+ margin-left: 4px;
140
+
141
+ &:hover {
142
+ transition: all ease-in .1s;
143
+ color: var(--XydAtlas-Component-ApiRef-Properties__color--active);
144
+ }
145
+ `;