@xyd-js/atlas 0.1.0-xyd.1

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 (52) hide show
  1. package/.babelrc +6 -0
  2. package/.storybook/index.css +32 -0
  3. package/.storybook/main.ts +19 -0
  4. package/.storybook/preview.ts +18 -0
  5. package/.storybook/public/fonts/fustat-ext-500.woff2 +0 -0
  6. package/.storybook/public/fonts/fustat-ext-600.woff2 +0 -0
  7. package/.storybook/public/fonts/fustat-ext-700.woff2 +0 -0
  8. package/.storybook/public/fonts/fustat-regular.woff2 +0 -0
  9. package/README.md +3 -0
  10. package/declarations.d.ts +4 -0
  11. package/dist/index.css +58 -0
  12. package/dist/index.d.ts +18 -0
  13. package/dist/index.js +1 -0
  14. package/index.ts +3 -0
  15. package/package.json +61 -0
  16. package/postcss.config.cjs +5 -0
  17. package/rollup.config.js +75 -0
  18. package/src/components/ApiRef/ApiRefItem/ApiRefItem.styles.tsx +70 -0
  19. package/src/components/ApiRef/ApiRefItem/ApiRefItem.tsx +97 -0
  20. package/src/components/ApiRef/ApiRefItem/index.ts +7 -0
  21. package/src/components/ApiRef/ApiRefProperties/ApiRefProperties.styles.tsx +154 -0
  22. package/src/components/ApiRef/ApiRefProperties/ApiRefProperties.tsx +134 -0
  23. package/src/components/ApiRef/ApiRefProperties/index.ts +7 -0
  24. package/src/components/ApiRef/ApiRefSamples/ApiRefSamples.styles.tsx +28 -0
  25. package/src/components/ApiRef/ApiRefSamples/ApiRefSamples.tsx +48 -0
  26. package/src/components/ApiRef/ApiRefSamples/index.ts +7 -0
  27. package/src/components/ApiRef/index.ts +5 -0
  28. package/src/components/Atlas/Atlas.styles.tsx +7 -0
  29. package/src/components/Atlas/Atlas.tsx +25 -0
  30. package/src/components/Atlas/AtlasLazy/AtlasLazy.styles.tsx +10 -0
  31. package/src/components/Atlas/AtlasLazy/AtlasLazy.tsx +45 -0
  32. package/src/components/Atlas/AtlasLazy/hooks.ts +29 -0
  33. package/src/components/Atlas/AtlasLazy/index.ts +7 -0
  34. package/src/components/Atlas/index.ts +3 -0
  35. package/src/components/Code/CodeCopy/CodeCopy.style.tsx +21 -0
  36. package/src/components/Code/CodeCopy/CodeCopy.tsx +32 -0
  37. package/src/components/Code/CodeCopy/index.ts +7 -0
  38. package/src/components/Code/CodeSample/CodeSample.styles.tsx +134 -0
  39. package/src/components/Code/CodeSample/CodeSample.tsx +149 -0
  40. package/src/components/Code/CodeSample/index.ts +8 -0
  41. package/src/components/Code/CodeSample/withLocalStored.tsx +52 -0
  42. package/src/components/Code/CodeSampleButtons/CodeSampleButtons.styles.tsx +67 -0
  43. package/src/components/Code/CodeSampleButtons/CodeSampleButtons.tsx +106 -0
  44. package/src/components/Code/CodeSampleButtons/index.ts +7 -0
  45. package/src/components/Code/default-theme.ts +266 -0
  46. package/src/components/Code/index.ts +6 -0
  47. package/src/docs/AtlasExample/AtlasExample.stories.tsx +47 -0
  48. package/src/docs/AtlasExample/todo-app.uniform.json +625 -0
  49. package/src/docs/AtlasExample/uniform-to-references.ts +101 -0
  50. package/src/utils/mdx.ts +31 -0
  51. package/tsconfig.json +44 -0
  52. package/vite.config.ts +25 -0
@@ -0,0 +1,266 @@
1
+ // from: https://marketplace.visualstudio.com/items?itemName=smockle.xcode-default-theme
2
+
3
+ import {Theme} from "@code-hike/lighter";
4
+
5
+ export const theme: Theme = {
6
+ type: "light",
7
+ colors: {
8
+ "list.focusForeground": "#FFFFFF",
9
+ "scrollbar.shadow": "#ffffff00",
10
+ "tab.activeBorder": "#ffffff",
11
+ "widget.shadow": "#ffffff00",
12
+ "activityBar.border": "#D9D7D5",
13
+ "editorGroup.border": "#D9D7D5",
14
+ "editorGroupHeader.tabsBorder": "#D9D7D5",
15
+ "editorWidget.border": "#D9D7D5",
16
+ "editorWidget.resizeBorder": "#D9D7D5",
17
+ "input.border": "#D9D7D5",
18
+ "notificationCenter.border": "#D9D7D5",
19
+ "notifications.border": "#D9D7D5",
20
+ "panel.border": "#D9D7D5",
21
+ "sideBar.border": "#D9D7D5",
22
+ "statusBar.border": "#D9D7D5",
23
+ "tab.border": "#D9D7D5",
24
+ "activityBar.background": "#ECECEC",
25
+ "statusBar.background": "#ECECEC",
26
+ "statusBar.noFolderBackground": "#ECECEC",
27
+ "statusBar.debuggingBackground": "#ECECEC",
28
+ "editorGroupHeader.tabsBackground": "#F5F5F5",
29
+ "editorWidget.background": "#F5F5F5",
30
+ "sideBar.background": "#F5F5F5",
31
+ "sideBarSectionHeader.background": "#F5F5F5",
32
+ "tab.inactiveBackground": "#F5F5F5",
33
+ "activityBarBadge.background": "#282828",
34
+ "activityBar.foreground": "#282828",
35
+ "statusBar.foreground": "#565456",
36
+ "input.placeholderForeground": "#C7C6C5",
37
+ "editorLineNumber.foreground": "#A6A6A6",
38
+ "editorLineNumber.activeForeground": "#282828",
39
+ foreground: "#282828",
40
+ "panelTitle.activeForeground": "#282828",
41
+ "sideBarTitle.foreground": "#282828",
42
+ "sideBarSectionHeader.foreground": "#282828",
43
+ "panelTitle.inactiveForeground": "#242424",
44
+ "tab.inactiveForeground": "#242424",
45
+ "list.highlightForeground": "#242424",
46
+ "editor.lineHighlightBackground": "#EEF5FE",
47
+ focusBorder: "#82ADF3",
48
+ "button.background": "#3C93FD",
49
+ "list.activeSelectionBackground": "#3C93FD",
50
+ "list.focusBackground": "#3C93FD",
51
+ "selection.background": "#B3D7FF",
52
+ "list.inactiveSelectionBackground": "#CECECE",
53
+ "terminal.ansiBlack": "#000000",
54
+ "terminal.ansiBrightBlack": "#000000",
55
+ "terminal.ansiRed": "#C41A16",
56
+ "terminal.ansiBrightRed": "#C41A16",
57
+ "terminal.ansiGreen": "#007400",
58
+ "terminal.ansiBrightGreen": "#007400",
59
+ "terminal.ansiYellow": "#643820",
60
+ "terminal.ansiBrightYellow": "#643820",
61
+ "terminal.ansiBlue": "#272AD8",
62
+ "terminal.ansiBrightBlue": "#272AD8",
63
+ "terminal.ansiMagenta": "#AA0D91",
64
+ "terminal.ansiBrightMagenta": "#AA0D91",
65
+ "terminal.ansiCyan": "#3F6E74",
66
+ "terminal.ansiBrightCyan": "#3F6E74",
67
+ },
68
+ tokenColors: [
69
+ {
70
+ scope: "new.expr entity.name",
71
+ settings: {
72
+ foreground: "#713DA9",
73
+ },
74
+ },
75
+ {
76
+ name: "Comments",
77
+ scope: ["comment", "comment storage.type"],
78
+ settings: {
79
+ foreground: "#536579",
80
+ fontStyle: "italic",
81
+ },
82
+ },
83
+ {
84
+ name: "CSS",
85
+ scope: [
86
+ "entity.other.attribute-name.pseudo-class.css",
87
+ "entity.other.attribute-name.pseudo-class.scss",
88
+ "entity.other.attribute-name.pseudo-element.css",
89
+ "entity.other.attribute-name.pseudo-element.scss",
90
+ "support.function.calc.css",
91
+ "support.function.calc.scss",
92
+ "support.type.property-name.css",
93
+ "support.type.property-name.scss",
94
+ "support.type.vendored.property-name.css",
95
+ "support.type.vendored.property-name.scss",
96
+ "meta.property-value.css support.constant",
97
+ "meta.property-value.scss support.constant",
98
+ "meta.property-value.css support.constant.property-value",
99
+ "meta.property-value.scss support.constant.property-value",
100
+ "support.function.transform.css",
101
+ "support.function.transform.scss",
102
+ ],
103
+ settings: {
104
+ foreground: "#AA0D91",
105
+ },
106
+ },
107
+ {
108
+ name: "Decorator",
109
+ scope: [
110
+ "meta.decorator",
111
+ "meta.decorator punctuation.decorator",
112
+ "meta.decorator variable.other.readwrite",
113
+ "meta.decorator meta.function-call entity.name.function",
114
+ ],
115
+ settings: {
116
+ foreground: "#643820",
117
+ },
118
+ },
119
+ {
120
+ name: "Doctype",
121
+ scope: ["meta.tag.sgml.html"],
122
+ settings: {
123
+ foreground: "#A6A6A6",
124
+ },
125
+ },
126
+ {
127
+ name: "Functions",
128
+ scope: ["entity.name.function", "support.function"],
129
+ settings: {
130
+ foreground: "#7051d4",
131
+ },
132
+ },
133
+ {
134
+ name: "Keys",
135
+ scope: [
136
+ "meta.property-list meta.property-name",
137
+ "support.type.property-name",
138
+ "support.type.map.key",
139
+ "entity.name.tag.yaml",
140
+ ],
141
+ settings: {
142
+ foreground: "#7051d4",
143
+ },
144
+ },
145
+ {
146
+ name: "Keywords",
147
+ scope: [
148
+ "keyword.control",
149
+ "keyword.declaration",
150
+ "keyword.expressions-and-types",
151
+ "keyword.operator.new",
152
+ "keyword.reserved",
153
+ "keyword.statement",
154
+ "storage.type",
155
+ "storage.modifier",
156
+ "constant.language",
157
+ "variable.language.super",
158
+ "variable.language.this",
159
+ "text.html entity.name.tag",
160
+ "meta.tag entity.name.tag",
161
+ "meta.tag support.class",
162
+ "string.regexp keyword.other",
163
+ ],
164
+ settings: {
165
+ foreground: "#AD3DA4",
166
+ fontStyle: "bold",
167
+ },
168
+ },
169
+ {
170
+ name: "Operators",
171
+ scope: [
172
+ "storage.type.function.arrow",
173
+ "meta.template.expression punctuation",
174
+ "punctuation.separator.key-value",
175
+ "meta.object-literal.key meta.brace.square",
176
+ "meta.template.expression keyword.operator",
177
+ "keyword.operator.or.regexp",
178
+ "keyword.operator.quantifier",
179
+ "punctuation.definition.group.regexp",
180
+ "punctuation.definition.character-class",
181
+ ],
182
+ settings: {
183
+ foreground: "#000000",
184
+ },
185
+ },
186
+ {
187
+ scope: [
188
+ "meta.tag entity.other.attribute-name",
189
+ "constant.character.escape.backslash",
190
+ ],
191
+ settings: {
192
+ foreground: "#816927",
193
+ },
194
+ },
195
+ {
196
+ name: "Numbers",
197
+ scope: ["constant.numeric", "keyword.other.unit", "constant.other.color"],
198
+ settings: {
199
+ foreground: "#272AD8",
200
+ },
201
+ },
202
+ {
203
+ name: "Strings",
204
+ scope: [
205
+ "string",
206
+ "variable.parameter.url.scss",
207
+ "markup.heading.markdown",
208
+ "beginning.punctuation.definition.list.markdown",
209
+ "meta.template.expression meta.embedded punctuation.definition.string.begin",
210
+ "meta.template.expression meta.embedded punctuation.definition.string.end",
211
+ ],
212
+ settings: {
213
+ foreground: "#D12F1B",
214
+ },
215
+ },
216
+ {
217
+ name: "Types",
218
+ scope: [
219
+ "meta.type",
220
+ "meta.return.type",
221
+ "entity.name.type",
222
+ "support.type.primitive",
223
+ ],
224
+ settings: {
225
+ foreground: "#713DA9",
226
+ },
227
+ },
228
+ {
229
+ scope: [
230
+ "meta.objectliteral variable.other.object",
231
+ "entity.name.type.module",
232
+ "entity.other.inherited-class",
233
+ "variable.scss",
234
+ "variable.other.bracket.shell",
235
+ "entity.name.function.scss",
236
+ ],
237
+ settings: {
238
+ foreground: "#3F6E74",
239
+ },
240
+ },
241
+ {
242
+ scope: [
243
+ "keyword.control.at-rule",
244
+ "meta.import variable.other.readwrite",
245
+ "meta.definition.variable variable.other.readwrite",
246
+ "meta.definition.variable variable.other.constant",
247
+ "meta.template.expression variable.other.readwrite",
248
+ "meta.template.expression variable.other.constant",
249
+ "support.constant.property-value",
250
+ ],
251
+ settings: {
252
+ foreground: "#000000",
253
+ },
254
+ },
255
+ {
256
+ scope: [
257
+ "variable.other.property",
258
+ "variable.other.object.property",
259
+ "support.variable.property",
260
+ ],
261
+ settings: {
262
+ foreground: "#713DA9",
263
+ },
264
+ },
265
+ ],
266
+ }
@@ -0,0 +1,6 @@
1
+ export * from "./CodeCopy";
2
+
3
+ export * from "./CodeSample";
4
+
5
+ export * from "./CodeSampleButtons";
6
+
@@ -0,0 +1,47 @@
1
+ import React, {useState, useEffect} from 'react';
2
+ import type {Meta} from '@storybook/react';
3
+
4
+ import {Reference} from '@xyd-js/uniform';
5
+
6
+ import {MDXReference} from "@/utils/mdx";
7
+ import {Atlas} from '@/components/Atlas';
8
+ import {uniformToReferences} from "./uniform-to-references";
9
+
10
+ const HelloWorld = () => {
11
+ return <h1>Hello, World!</h1>;
12
+ };
13
+
14
+ export default {
15
+ title: 'Atlas/Atlas',
16
+ component: HelloWorld,
17
+ } as Meta;
18
+
19
+ // const Template = (args) => <Atlas/>;
20
+
21
+ const Template = (args) => {
22
+ const [references, setReferences] = useState<MDXReference<Reference[]> | []>([])
23
+
24
+ async function load() {
25
+ const resp = await uniformToReferences()
26
+ if (resp && resp.length) {
27
+ setReferences(resp)
28
+ }
29
+ }
30
+
31
+ useEffect(() => {
32
+ load()
33
+ }, [])
34
+
35
+ return <div style={{
36
+ width: "1200px",
37
+ display: "flex",
38
+ alignItems: "center",
39
+ flexDirection: "column",
40
+ margin: "0 auto"
41
+ }}>
42
+ <Atlas references={references}/>
43
+ </div>
44
+ }
45
+
46
+ export const Default = Template.bind({});
47
+ Default.args = {};