@xyd-js/storybook 0.0.1-xyd.0 → 0.0.1-xyd.10

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 (155) hide show
  1. package/.storybook/main.ts +173 -4
  2. package/.storybook/preview.ts +1 -2
  3. package/CHANGELOG.md +105 -0
  4. package/LICENSE +21 -0
  5. package/package.json +10 -5
  6. package/src/components/DemoWireframe.tsx +237 -0
  7. package/src/components/logo.tsx +37 -0
  8. package/src/content/atlas-index/package-index.mdx +192 -0
  9. package/src/content/atlas-index/wip1.mdx +131 -0
  10. package/src/content/atlas-index.mdx +53 -0
  11. package/src/docs/atlas/Atlas.stories.tsx +4 -9
  12. package/src/docs/atlas/AtlasIndex.stories.tsx +130 -0
  13. package/src/docs/components/writer/Badge.stories.tsx +17 -29
  14. package/src/docs/components/writer/Table.stories.tsx +32 -0
  15. package/src/docs/themes/themes.stories.tsx +29 -25
  16. package/storybook-static/assets/Atlas.stories-BJDXANWf.js +252 -0
  17. package/storybook-static/assets/AtlasIndex.stories-C-4vZswz.js +41 -0
  18. package/storybook-static/assets/Badge.stories-DSo7Lasr.js +6 -0
  19. package/storybook-static/assets/Breadcrumbs.stories-APB9UDIU.js +21 -0
  20. package/storybook-static/assets/{Button.stories-BUAUswSC.js → Button.stories-BaoDkNl6.js} +2 -2
  21. package/storybook-static/assets/CTABanner-n3vc4xW5-VHHsd4-C.js +4 -0
  22. package/storybook-static/assets/{CTABanner.stories-D5CtnW6h.js → CTABanner.stories-DeIwzLSu.js} +1 -1
  23. package/storybook-static/assets/Callout.stories-ESozWgIi.js +16 -0
  24. package/storybook-static/assets/CodeSample-Dkob5gWa-CI-Jdg_T-FUmAtsNF.js +9 -0
  25. package/storybook-static/assets/CodeSample.stories-DNLDwmyz.js +22 -0
  26. package/storybook-static/assets/{CodeSample.stories-B8_z15cp.js → CodeSample.stories-npLtCIKw.js} +1 -1
  27. package/storybook-static/assets/Color-YHDXOIA2-D-wdyPVE.js +1 -0
  28. package/storybook-static/assets/DocsRenderer-CFRXHY34-CIYeQ6fu.js +575 -0
  29. package/storybook-static/assets/{GuideCard.stories-B8wFh9oh.js → GuideCard.stories-R-2HMLEF.js} +2 -2
  30. package/storybook-static/assets/Heading.stories-CHw8GXC6.js +40 -0
  31. package/storybook-static/assets/Nav.stories-BeFIh2Vg.js +13 -0
  32. package/storybook-static/assets/NavLinks.stories-DxWAb2TV.js +19 -0
  33. package/storybook-static/assets/Pre.stories-CR1zlLen.js +11 -0
  34. package/storybook-static/assets/Sidebar.stories-B-5LyJIe.js +9 -0
  35. package/storybook-static/assets/Steps.stories-Bg2orGdz.js +16 -0
  36. package/storybook-static/assets/SubNav.stories-B1aQLvvq.js +19 -0
  37. package/storybook-static/assets/Table.stories-DxxdJGx9.js +72 -0
  38. package/storybook-static/assets/UnderlineNav-9lJPvnIp-I5-GGpts.js +48 -0
  39. package/storybook-static/assets/_rollupPluginBabelHelpers-C8nLsqZ7-DyHbsKhl.js +4 -0
  40. package/storybook-static/assets/{chevron-right-Dfa2nijf.js → chevron-right-B9VhLASW.js} +1 -1
  41. package/storybook-static/assets/{chunk-K6AXKMTT-DXBwE8Vx.js → chunk-K6AXKMTT-BnQROexa.js} +1 -1
  42. package/storybook-static/assets/{chunk-XP5HYGXS-DH4vAeCa.js → chunk-XP5HYGXS-BpfKkqn7.js} +1 -1
  43. package/storybook-static/assets/content-C0yN9Wvw.js +22 -0
  44. package/storybook-static/assets/copy-C0mF-zfo.js +20 -0
  45. package/storybook-static/assets/entry-preview-VSbqQKti.js +2 -0
  46. package/storybook-static/assets/entry-preview-docs-B1zb5AAd.js +46 -0
  47. package/storybook-static/assets/iframe-3uG_AAyK.js +211 -0
  48. package/storybook-static/assets/index-0nua7n0t.js +1 -0
  49. package/storybook-static/assets/index-B7gF9TUu.js +9 -0
  50. package/storybook-static/assets/{index-CQ7VjfMi.js → index-BxVt_j7t.js} +1 -1
  51. package/storybook-static/assets/index-C2_NlWRN.js +8 -0
  52. package/storybook-static/assets/index-Ci6h_Amb.js +240 -0
  53. package/storybook-static/assets/index-D1ZprCIH.js +9 -0
  54. package/storybook-static/assets/index-DrFu-skq.js +6 -0
  55. package/storybook-static/assets/index-po7oPx12.js +16 -0
  56. package/storybook-static/assets/jsx-runtime-BjG_zV1W.js +9 -0
  57. package/storybook-static/assets/layouts-CzEI4S2T.js +26 -0
  58. package/storybook-static/assets/preview-B8lJiyuQ.js +34 -0
  59. package/storybook-static/assets/preview-BBWR9nbA.js +1 -0
  60. package/storybook-static/assets/preview-BDbHSxwO.css +1 -0
  61. package/storybook-static/assets/preview-BLZCCP69.js +2 -0
  62. package/storybook-static/assets/{preview-DY_pW_WS.js → preview-BWzBA1C2.js} +1 -1
  63. package/storybook-static/assets/preview-CvbIS5ZJ.js +1 -0
  64. package/storybook-static/assets/preview-DD_OYowb.js +1 -0
  65. package/storybook-static/assets/preview-DHQbi4pV.js +1 -0
  66. package/storybook-static/assets/preview-ik5anPOD.js +1 -0
  67. package/storybook-static/assets/react-18-BsB9_d4u.js +25 -0
  68. package/storybook-static/assets/test-utils-LZCCjomP.js +9 -0
  69. package/storybook-static/assets/themes-designsystem.stories-DsoSBFrP.js +11 -0
  70. package/storybook-static/assets/themes.stories-CGSgiZ_W.js +41 -0
  71. package/storybook-static/assets/writer-DhJZ-Wpq.js +4 -0
  72. package/storybook-static/iframe.html +28 -1
  73. package/storybook-static/index.html +6 -6
  74. package/storybook-static/index.json +1 -1
  75. package/storybook-static/project.json +1 -1
  76. package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js +28 -28
  77. package/storybook-static/sb-addons/docs-12/manager-bundle.js +242 -0
  78. package/storybook-static/sb-addons/essentials-actions-4/manager-bundle.js +1 -1
  79. package/storybook-static/sb-addons/essentials-backgrounds-5/manager-bundle.js +8 -8
  80. package/storybook-static/sb-addons/essentials-controls-3/manager-bundle.js +87 -76
  81. package/storybook-static/sb-addons/essentials-measure-8/manager-bundle.js +1 -1
  82. package/storybook-static/sb-addons/essentials-outline-9/manager-bundle.js +1 -1
  83. package/storybook-static/sb-addons/essentials-toolbars-7/manager-bundle.js +1 -1
  84. package/storybook-static/sb-addons/essentials-viewport-6/manager-bundle.js +1 -1
  85. package/storybook-static/sb-addons/interactions-11/manager-bundle.js +73 -61
  86. package/storybook-static/sb-addons/links-2/manager-bundle.js +1 -1
  87. package/storybook-static/sb-addons/onboarding-1/manager-bundle.js +18 -18
  88. package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +1 -1
  89. package/storybook-static/sb-manager/globals-module-info.js +26 -3
  90. package/storybook-static/sb-manager/globals-runtime.js +14231 -13501
  91. package/storybook-static/sb-manager/runtime.js +4961 -6251
  92. package/tsconfig.json +16 -11
  93. package/storybook-static/assets/Atlas.stories-CXIW65Hs.js +0 -255
  94. package/storybook-static/assets/Badge.stories-xjDbGZ5c.js +0 -21
  95. package/storybook-static/assets/Breadcrumbs.stories-DUn-OgPN.js +0 -21
  96. package/storybook-static/assets/CTABanner-7_fa6QIU-6vh6ca3a.js +0 -4
  97. package/storybook-static/assets/Callout.stories-DonqcNeI.js +0 -16
  98. package/storybook-static/assets/CodeSample.stories-4-beIs6I.js +0 -22
  99. package/storybook-static/assets/Color-F6OSRLHC-D5TfMBnc.js +0 -1
  100. package/storybook-static/assets/DocsRenderer-CFRXHY34-BrPAHo60.js +0 -730
  101. package/storybook-static/assets/Heading.stories-D82-EGrg.js +0 -40
  102. package/storybook-static/assets/Nav.stories-CM_STIcN.js +0 -13
  103. package/storybook-static/assets/NavLinks.stories-D0QuD0H3.js +0 -19
  104. package/storybook-static/assets/Pre.stories-1WB_X0Ix.js +0 -11
  105. package/storybook-static/assets/Sidebar.stories-CwyChgiy.js +0 -9
  106. package/storybook-static/assets/Steps.stories-gANyLY_H.js +0 -16
  107. package/storybook-static/assets/SubNav.stories-D5TbjJj2.js +0 -19
  108. package/storybook-static/assets/Table.stories-BSZMHwDX.js +0 -43
  109. package/storybook-static/assets/UnderlineNav-C0OvjpyZ-D7c5zIhU.js +0 -41
  110. package/storybook-static/assets/_rollupPluginBabelHelpers-CAjWVhpp-BWJe-8U1.js +0 -4
  111. package/storybook-static/assets/browser.esm-BOPNWGdv.js +0 -20
  112. package/storybook-static/assets/client-jctswkVR.js +0 -25
  113. package/storybook-static/assets/content-DfDGXctA.js +0 -8
  114. package/storybook-static/assets/entry-preview-Com-SXI0.js +0 -10
  115. package/storybook-static/assets/entry-preview-docs-Bs0lZRn3.js +0 -47
  116. package/storybook-static/assets/iframe-B0k8DGQG.js +0 -2
  117. package/storybook-static/assets/index-B-gRCko5.js +0 -1
  118. package/storybook-static/assets/index-B0Jt8usF.js +0 -9
  119. package/storybook-static/assets/index-CBUcM4bS.js +0 -8
  120. package/storybook-static/assets/index-CC-8bvy6.js +0 -9
  121. package/storybook-static/assets/index-Cu4lwwaE.js +0 -1
  122. package/storybook-static/assets/index-DIXNDbo9.js +0 -1
  123. package/storybook-static/assets/index-D_kIG38s.js +0 -1
  124. package/storybook-static/assets/index-DthG7GmK.js +0 -17
  125. package/storybook-static/assets/index-ogSvIofg.js +0 -6
  126. package/storybook-static/assets/jsx-runtime-C-_spy54.js +0 -9
  127. package/storybook-static/assets/layouts-CHVz-oC2.js +0 -15
  128. package/storybook-static/assets/preview--rrl-Bev.js +0 -234
  129. package/storybook-static/assets/preview-B3PTUHS7.js +0 -1
  130. package/storybook-static/assets/preview-CFgKly6U.js +0 -1
  131. package/storybook-static/assets/preview-DFfOCnyz.css +0 -1
  132. package/storybook-static/assets/preview-NdwLIjRI.js +0 -2
  133. package/storybook-static/assets/preview-RFMnorYX.js +0 -1
  134. package/storybook-static/assets/preview-Zk6Lo_wo.js +0 -1
  135. package/storybook-static/assets/preview-iUmqt_lp.js +0 -34
  136. package/storybook-static/assets/react-18-C4NQogKe.js +0 -1
  137. package/storybook-static/assets/themes-designsystem.stories-DyoY6VQ9.js +0 -11
  138. package/storybook-static/assets/themes.stories-BUr1Iju1.js +0 -41
  139. package/storybook-static/assets/writer-BQ7yPg-n.js +0 -4
  140. package/storybook-static/sb-addons/essentials-actions-4/manager-bundle.js.LEGAL.txt +0 -0
  141. package/storybook-static/sb-addons/essentials-backgrounds-5/manager-bundle.js.LEGAL.txt +0 -0
  142. package/storybook-static/sb-addons/essentials-controls-3/manager-bundle.js.LEGAL.txt +0 -0
  143. package/storybook-static/sb-addons/essentials-measure-8/manager-bundle.js.LEGAL.txt +0 -0
  144. package/storybook-static/sb-addons/essentials-outline-9/manager-bundle.js.LEGAL.txt +0 -0
  145. package/storybook-static/sb-addons/essentials-toolbars-7/manager-bundle.js.LEGAL.txt +0 -0
  146. package/storybook-static/sb-addons/essentials-viewport-6/manager-bundle.js.LEGAL.txt +0 -0
  147. package/storybook-static/sb-addons/interactions-11/manager-bundle.js.LEGAL.txt +0 -0
  148. package/storybook-static/sb-addons/links-2/manager-bundle.js.LEGAL.txt +0 -0
  149. package/storybook-static/sb-addons/onboarding-1/manager-bundle.js.LEGAL.txt +0 -12
  150. package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js.LEGAL.txt +0 -0
  151. package/storybook-static/sb-preview/globals.js +0 -33
  152. package/storybook-static/sb-preview/runtime.js +0 -7174
  153. package/tsconfig.app.json +0 -24
  154. package/tsconfig.node.json +0 -13
  155. /package/storybook-static/assets/{preview-CsjPNNCI.js → preview-ChdjpSTW.js} +0 -0
@@ -1,8 +1,13 @@
1
+ import {join, dirname} from "path";
2
+
3
+ import React from "react";
1
4
  import type {StorybookConfig} from "@storybook/react-vite";
2
5
  import remarkGfm from 'remark-gfm';
6
+ import remarkDirective from 'remark-directive';
3
7
  import {visit} from 'unist-util-visit';
4
-
5
- import {join, dirname} from "path";
8
+ import {unified} from 'unified';
9
+ import remarkParse from 'remark-parse';
10
+ import remarkMdx from 'remark-mdx';
6
11
 
7
12
  /**
8
13
  * This function is used to resolve the absolute path of a package.
@@ -26,6 +31,167 @@ function remarkInjectMeta() { // TODO: move to @xyd-js/content
26
31
  };
27
32
  }
28
33
 
34
+ // TODO: get from @xyd-js/content/md but curently error when importing a `content` lib: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /Users/zdunecki/Code/livesession/xyd/node_modules/.pnpm/estree-util-build-jsx@3.0.1/node_modules/estree-walker/package.json
35
+ export function mdCodeGroup() {
36
+ return (tree: any) => {
37
+ visit(tree, 'containerDirective', (node) => {
38
+ if (node.name !== 'code-group') return;
39
+
40
+ const description = node.attributes?.title || '';
41
+ const codeblocks = [];
42
+
43
+ for (const child of node.children) {
44
+ if (child.type === 'code') {
45
+ const meta = child.meta || '';
46
+ const value = child.value || '';
47
+ const lang = child.lang || '';
48
+
49
+ codeblocks.push({value, lang, meta});
50
+ }
51
+ }
52
+
53
+ // Add metadata to the node
54
+ node.data = {
55
+ hName: 'DirectiveCodeSample',
56
+ hProperties: {
57
+ description,
58
+ codeblocks: JSON.stringify(codeblocks),
59
+ },
60
+ };
61
+
62
+ node.children = [];
63
+ });
64
+ };
65
+ }
66
+
67
+ function toPascalCase(str) {
68
+ return str
69
+ .replace(/([a-z])([A-Z])/g, "$1 $2") // Add space before capital letters
70
+ .replace(/[^a-zA-Z0-9]/g, " ") // Replace special characters with space
71
+ .split(" ") // Split by space
72
+ .map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()) // Capitalize first letter
73
+ .join("");
74
+ }
75
+
76
+
77
+ const supportedDirectives = {
78
+ Details: true,
79
+ details: true,
80
+ TableV2: true
81
+ }
82
+
83
+ const tableComponents: { [key: string]: boolean } = {
84
+ TableV2: true
85
+ }
86
+
87
+ const parseMarkdown = (content: string) => {
88
+ const ast = unified()
89
+ .use(remarkParse)
90
+ .use(remarkMdx)
91
+ .parse(content);
92
+ return ast.children;
93
+ };
94
+
95
+ export function remarkDirectiveWithMarkdown() {
96
+ return (tree) => {
97
+ visit(tree, 'containerDirective', (node) => {
98
+ if (!supportedDirectives[node.name]) {
99
+ return;
100
+ }
101
+
102
+ const isTable = tableComponents[node.name];
103
+ const attributes = [];
104
+
105
+ // TODO: MORE GENERIC CUZ IT HAS IMPL DETAILS OF TABLE
106
+ if (isTable) {
107
+ // TODO: support tsx tables like: [<>`Promise<Reference[]>`</>] ?
108
+ const tableData = JSON.parse(node.children[0].value);
109
+ const [header, ...rows] = tableData;
110
+
111
+ const jsxNode = {
112
+ type: 'mdxJsxFlowElement',
113
+ name: 'TableV2',
114
+ attributes: [],
115
+ children: [
116
+ {
117
+ type: 'mdxJsxFlowElement',
118
+ name: 'TableV2.Head',
119
+ attributes: [],
120
+ children: [
121
+ {
122
+ type: 'mdxJsxFlowElement',
123
+ name: 'TableV2.Tr',
124
+ attributes: [],
125
+ children: header.map((cell: string) => ({
126
+ type: 'mdxJsxFlowElement',
127
+ name: 'TableV2.Th',
128
+ attributes: [],
129
+ children: parseMarkdown(cell)
130
+ }))
131
+ }
132
+ ]
133
+ },
134
+ ...rows.map((row: string[]) => ({
135
+ type: 'mdxJsxFlowElement',
136
+ name: 'TableV2.Tr',
137
+ attributes: [],
138
+ children: row.map((cell: string) => ({
139
+ type: 'mdxJsxFlowElement',
140
+ name: 'TableV2.Td',
141
+ attributes: [],
142
+ children: parseMarkdown(cell)
143
+ }))
144
+ }))
145
+ ]
146
+ };
147
+
148
+ Object.assign(node, jsxNode);
149
+ return;
150
+ }
151
+
152
+ if (node.attributes) {
153
+ const jsxProps = []
154
+
155
+ for (let [key, value] of Object.entries(node.attributes)) {
156
+ if (typeof value === "string" && !value.startsWith("<")) {
157
+ attributes.push({
158
+ type: 'mdxJsxAttribute',
159
+ name: key,
160
+ value: value
161
+ });
162
+ } else {
163
+ jsxProps.push(`${key}={${value}}`)
164
+
165
+ }
166
+ }
167
+
168
+ const mdxString = `<Fragment ${jsxProps.join(" ")}></Fragment>`
169
+
170
+ const ast = unified()
171
+ .use(remarkParse)
172
+ .use(remarkMdx)
173
+ .parse(mdxString);
174
+
175
+ if (ast && ast.children[0] && ast.children[0].attributes) {
176
+ for (const attr of ast.children[0].attributes) {
177
+ // TODO: support markdown also e.g Hello `World` - currently it mus be: Hello <code>World</code>
178
+ attributes.push(attr);
179
+ }
180
+ }
181
+ }
182
+
183
+ const jsxNode = {
184
+ type: 'mdxJsxFlowElement',
185
+ name: toPascalCase(node.name),
186
+ attributes: attributes,
187
+ children: node.children
188
+ };
189
+
190
+ Object.assign(node, jsxNode);
191
+ });
192
+ };
193
+ }
194
+
29
195
  const config: StorybookConfig = {
30
196
  stories: ["../src/docs/**/*.mdx", "../src/docs/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
31
197
  addons: [
@@ -41,8 +207,11 @@ const config: StorybookConfig = {
41
207
  mdxCompileOptions: {
42
208
  remarkPlugins: [
43
209
  remarkGfm,
44
- remarkInjectMeta
45
- ],
210
+ remarkDirective,
211
+ mdCodeGroup,
212
+ remarkDirectiveWithMarkdown,
213
+ // mdComponentDirective
214
+ ]
46
215
  },
47
216
  },
48
217
  },
@@ -1,7 +1,6 @@
1
1
  import type {Preview} from "@storybook/react";
2
2
 
3
- import "@xyd-js/atlas/index.css"
4
- import "@xyd-js/fable-wiki/theme.css"
3
+ import "@xyd-js/theme-poetry/index.css" // TODO: in the future configurable themes via UI?
5
4
 
6
5
  import './styles.css'
7
6
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,110 @@
1
1
  # @xyd-js/storybook
2
2
 
3
+ ## 0.0.1-xyd.10
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @xyd-js/atlas@0.1.0-xyd.16
9
+ - @xyd-js/components@0.1.0-xyd.11
10
+ - @xyd-js/content@0.1.0-xyd.14
11
+ - @xyd-js/theme-poetry@0.1.0-xyd.27
12
+ - @xyd-js/ui@0.1.0-xyd.16
13
+ - @xyd-js/fable-wiki@0.1.0-xyd.14
14
+
15
+ ## 0.0.1-xyd.9
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+ - @xyd-js/atlas@0.1.0-xyd.15
21
+ - @xyd-js/components@0.1.0-xyd.10
22
+ - @xyd-js/content@0.1.0-xyd.13
23
+ - @xyd-js/theme-poetry@0.1.0-xyd.26
24
+ - @xyd-js/ui@0.1.0-xyd.15
25
+ - @xyd-js/fable-wiki@0.1.0-xyd.13
26
+
27
+ ## 0.0.1-xyd.8
28
+
29
+ ### Patch Changes
30
+
31
+ - Updated dependencies
32
+ - @xyd-js/atlas@0.1.0-xyd.14
33
+ - @xyd-js/components@0.1.0-xyd.9
34
+ - @xyd-js/content@0.1.0-xyd.12
35
+ - @xyd-js/theme-poetry@0.1.0-xyd.25
36
+ - @xyd-js/ui@0.1.0-xyd.14
37
+ - @xyd-js/fable-wiki@0.1.0-xyd.12
38
+
39
+ ## 0.0.1-xyd.7
40
+
41
+ ### Patch Changes
42
+
43
+ - Updated dependencies
44
+ - @xyd-js/atlas@0.1.0-xyd.13
45
+ - @xyd-js/components@0.1.0-xyd.8
46
+ - @xyd-js/content@0.1.0-xyd.11
47
+ - @xyd-js/theme-poetry@0.1.0-xyd.24
48
+ - @xyd-js/ui@0.1.0-xyd.13
49
+ - @xyd-js/fable-wiki@0.1.0-xyd.11
50
+
51
+ ## 0.0.1-xyd.6
52
+
53
+ ### Patch Changes
54
+
55
+ - @xyd-js/fable-wiki@0.1.0-xyd.10
56
+
57
+ ## 0.0.1-xyd.5
58
+
59
+ ### Patch Changes
60
+
61
+ - Updated dependencies
62
+ - @xyd-js/atlas@0.1.0-xyd.12
63
+ - @xyd-js/components@0.1.0-xyd.7
64
+ - @xyd-js/content@0.1.0-xyd.10
65
+ - @xyd-js/ui@0.1.0-xyd.12
66
+ - @xyd-js/fable-wiki@0.1.0-xyd.9
67
+
68
+ ## 0.0.1-xyd.4
69
+
70
+ ### Patch Changes
71
+
72
+ - Updated dependencies
73
+ - @xyd-js/atlas@0.1.0-xyd.11
74
+ - @xyd-js/components@0.1.0-xyd.6
75
+ - @xyd-js/ui@0.1.0-xyd.11
76
+ - @xyd-js/fable-wiki@0.1.0-xyd.8
77
+
78
+ ## 0.0.1-xyd.3
79
+
80
+ ### Patch Changes
81
+
82
+ - Updated dependencies
83
+ - @xyd-js/atlas@0.1.0-xyd.10
84
+ - @xyd-js/components@0.1.0-xyd.5
85
+ - @xyd-js/ui@0.1.0-xyd.10
86
+ - @xyd-js/fable-wiki@0.1.0-xyd.7
87
+
88
+ ## 0.0.1-xyd.2
89
+
90
+ ### Patch Changes
91
+
92
+ - Updated dependencies
93
+ - @xyd-js/atlas@0.1.0-xyd.9
94
+ - @xyd-js/components@0.1.0-xyd.4
95
+ - @xyd-js/ui@0.1.0-xyd.9
96
+ - @xyd-js/fable-wiki@0.1.0-xyd.6
97
+
98
+ ## 0.0.1-xyd.1
99
+
100
+ ### Patch Changes
101
+
102
+ - Updated dependencies
103
+ - @xyd-js/atlas@0.1.0-xyd.8
104
+ - @xyd-js/components@0.1.0-xyd.3
105
+ - @xyd-js/ui@0.1.0-xyd.8
106
+ - @xyd-js/fable-wiki@0.1.0-xyd.5
107
+
3
108
  ## 0.0.1-xyd.0
4
109
 
5
110
  ### Patch Changes
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 xyd
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/package.json CHANGED
@@ -1,17 +1,22 @@
1
1
  {
2
2
  "name": "@xyd-js/storybook",
3
- "version": "0.0.1-xyd.0",
3
+ "version": "0.0.1-xyd.10",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@mdx-js/react": "^3.0.1",
7
7
  "@mdx-js/rollup": "^3.0.1",
8
+ "acorn": "^8.14.1",
9
+ "acorn-jsx": "^5.3.2",
8
10
  "react": "^19.0.0",
9
11
  "react-dom": "^19.0.0",
12
+ "rehype-stringify": "^10.0.1",
10
13
  "remark-gfm": "^4.0.0",
11
- "@xyd-js/components": "0.1.0-xyd.1",
12
- "@xyd-js/atlas": "0.1.0-xyd.7",
13
- "@xyd-js/fable-wiki": "0.1.0-xyd.4",
14
- "@xyd-js/ui": "0.1.0-xyd.7"
14
+ "@xyd-js/atlas": "0.1.0-xyd.16",
15
+ "@xyd-js/content": "0.1.0-xyd.14",
16
+ "@xyd-js/fable-wiki": "0.1.0-xyd.14",
17
+ "@xyd-js/components": "0.1.0-xyd.11",
18
+ "@xyd-js/ui": "0.1.0-xyd.16",
19
+ "@xyd-js/theme-poetry": "0.1.0-xyd.27"
15
20
  },
16
21
  "devDependencies": {
17
22
  "@chromatic-com/storybook": "^1.9.0",
@@ -0,0 +1,237 @@
1
+ import React, {useState} from "react";
2
+
3
+ import {
4
+ Breadcrumbs,
5
+ NavLinks
6
+ } from "@xyd-js/components/writer"
7
+ import {
8
+ Nav,
9
+ Toc,
10
+ SubNav,
11
+ UISidebar
12
+ } from "@xyd-js/ui"
13
+
14
+ import {LiveSessionPlatformLogo} from "./logo"
15
+
16
+ export function DemoNavbar() {
17
+ return <>
18
+ <Nav
19
+ value="api-reference"
20
+ logo={<LiveSessionPlatformLogo/>}
21
+ kind="middle"
22
+ >
23
+ <Nav.Item value="docs" href="/docs">
24
+ Docs
25
+ </Nav.Item>
26
+ <Nav.Item value="api-reference" href="/api">
27
+ API Reference
28
+ </Nav.Item>
29
+ <Nav.Item value="graphql" href="/graphql">
30
+ GraphQL
31
+ </Nav.Item>
32
+ </Nav>
33
+ </>
34
+ }
35
+
36
+ export function DemoSubNav() {
37
+ return <SubNav title="Apps" value="build">
38
+ <SubNav.Item value="build" href="/build">
39
+ Build
40
+ </SubNav.Item>
41
+ <SubNav.Item value="design" href="/design">
42
+ Design
43
+ </SubNav.Item>
44
+ <SubNav.Item value="launch" href="/launch">
45
+ Launch
46
+ </SubNav.Item>
47
+ </SubNav>
48
+ }
49
+
50
+ export function DemoSidebar() {
51
+ const [isOpen, setIsOpen] = useState(false)
52
+
53
+ function onClick() {
54
+ setIsOpen(!isOpen)
55
+ }
56
+
57
+ const items = new Array(40).fill(0).map((_, i) => <UISidebar.Item key={i} href="#">
58
+ {`Item ${i}`}
59
+ </UISidebar.Item>
60
+ )
61
+
62
+ return <UISidebar footerItems={<DemoSidebarFooter/>}>
63
+ <UISidebar.ItemHeader>
64
+ GET STARTED
65
+ </UISidebar.ItemHeader>
66
+ <UISidebar.Item
67
+ button
68
+ active={isOpen}
69
+ activeTheme="secondary"
70
+ onClick={onClick}
71
+ >
72
+ Root nested
73
+ <UISidebar.SubTree isOpen={isOpen}>
74
+ <UISidebar.Item href="#">
75
+ Nested A
76
+ </UISidebar.Item>
77
+ <UISidebar.Item href="#">
78
+ Nested B
79
+ </UISidebar.Item>
80
+ <UISidebar.Item button active>
81
+ Nested root C
82
+ <UISidebar.SubTree>
83
+ <UISidebar.Item href="#">
84
+ Nested C.A
85
+ </UISidebar.Item>
86
+ <UISidebar.Item href="#">
87
+ Nested C.B
88
+ </UISidebar.Item>
89
+ </UISidebar.SubTree>
90
+ </UISidebar.Item>
91
+ </UISidebar.SubTree>
92
+ </UISidebar.Item>
93
+
94
+ <UISidebar.ItemHeader>
95
+ APIS
96
+ </UISidebar.ItemHeader>
97
+ <UISidebar.Item href="#">
98
+ Authentication
99
+ </UISidebar.Item>
100
+
101
+ <UISidebar.Item href="#">
102
+ Making requests
103
+ </UISidebar.Item>
104
+
105
+ {items}
106
+ </UISidebar>
107
+ }
108
+
109
+ export function DemoSidebarFooter() {
110
+ return <>
111
+ <UISidebar.FooterItem
112
+ href="#"
113
+ icon={
114
+ <svg
115
+ xmlns="http://www.w3.org/2000/svg"
116
+ viewBox="0 0 24 24"
117
+ >
118
+ <path
119
+ fillRule="evenodd"
120
+ d="M14.447 7.106a1 1 0 0 1 .447 1.341l-4 8a1 1 0 1 1-1.788-.894l4-8a1 1 0 0 1 1.341-.447ZM6.6 7.2a1 1 0 0 1 .2 1.4L4.25 12l2.55 3.4a1 1 0 0 1-1.6 1.2l-3-4a1 1 0 0 1 0-1.2l3-4a1 1 0 0 1 1.4-.2Zm10.8 0a1 1 0 0 1 1.4.2l3 4a1 1 0 0 1 0 1.2l-3 4a1 1 0 0 1-1.6-1.2l2.55-3.4-2.55-3.4a1 1 0 0 1 .2-1.4Z"
121
+ clipRule="evenodd"
122
+ />
123
+ </svg>
124
+ }
125
+ >
126
+ Cookbook
127
+ </UISidebar.FooterItem>
128
+ <UISidebar.FooterItem
129
+ href="#"
130
+ icon={
131
+ <svg
132
+ xmlns="http://www.w3.org/2000/svg"
133
+ fill="currentColor"
134
+ viewBox="0 0 24 24"
135
+ >
136
+ <path
137
+ fillRule="evenodd"
138
+ d="M10.5 8.5a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0ZM12 5a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7ZM3 9.5a1 1 0 1 1 2 0 1 1 0 0 1-2 0Zm1-3a3 3 0 1 0 0 6 3 3 0 0 0 0-6Zm16 2a1 1 0 1 0 0 2 1 1 0 0 0 0-2Zm-3 1a3 3 0 1 1 6 0 3 3 0 0 1-6 0ZM8 18c0-.974.438-1.684 1.142-2.185C9.876 15.293 10.911 15 12 15c1.09 0 2.124.293 2.858.815.704.5 1.142 1.21 1.142 2.185a1 1 0 1 0 2 0c0-1.692-.812-2.982-1.983-3.815C14.876 13.373 13.411 13 12 13c-1.41 0-2.876.373-4.017 1.185C6.812 15.018 6 16.308 6 18a1 1 0 1 0 2 0Zm-3.016-3.675a1 1 0 0 1-.809 1.16C2.79 15.732 2 16.486 2 17.5a1 1 0 1 1-2 0c0-2.41 1.978-3.655 3.825-3.985a1 1 0 0 1 1.16.81Zm14.84 1.16a1 1 0 1 1 .351-1.97C22.022 13.845 24 15.09 24 17.5a1 1 0 1 1-2 0c0-1.014-.79-1.768-2.175-2.015Z"
139
+ clipRule="evenodd"
140
+ />
141
+ </svg>
142
+ }
143
+ >
144
+ Community
145
+ </UISidebar.FooterItem>
146
+ <UISidebar.FooterItem
147
+ href="#"
148
+ icon={
149
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"
150
+ fill="none">
151
+ <path fill-rule="evenodd" clip-rule="evenodd"
152
+ d="M3.78163 3.28449C3.8768 2.96725 4.16879 2.75 4.5 2.75H19.5C19.8312 2.75 20.1232 2.96725 20.2184 3.28449L21.7184 8.28449C21.7393 8.3544 21.75 8.42701 21.75 8.5C21.75 10.5711 20.0711 12.25 18 12.25C16.7733 12.25 15.6842 11.661 15 10.7504C14.3158 11.661 13.2267 12.25 12 12.25C10.7733 12.25 9.68417 11.661 9 10.7504C8.31583 11.661 7.2267 12.25 6 12.25C3.92893 12.25 2.25 10.5711 2.25 8.5C2.25 8.42701 2.26066 8.3544 2.28163 8.28449L3.78163 3.28449ZM9.75 8.5C9.75 9.74264 10.7574 10.75 12 10.75C13.2426 10.75 14.25 9.74264 14.25 8.5C14.25 8.08579 14.5858 7.75 15 7.75C15.4142 7.75 15.75 8.08579 15.75 8.5C15.75 9.74264 16.7574 10.75 18 10.75C19.2083 10.75 20.1942 9.79754 20.2477 8.60244L18.942 4.25H5.05802L3.75229 8.60244C3.80584 9.79753 4.79169 10.75 6 10.75C7.24264 10.75 8.25 9.74264 8.25 8.5C8.25 8.08579 8.58579 7.75 9 7.75C9.41421 7.75 9.75 8.08579 9.75 8.5Z"
153
+ />
154
+ <path fill-rule="evenodd" clip-rule="evenodd"
155
+ d="M4 10.25C4.41421 10.25 4.75 10.5858 4.75 11V19.75H6.5C6.91421 19.75 7.25 20.0858 7.25 20.5C7.25 20.9142 6.91421 21.25 6.5 21.25H4C3.58579 21.25 3.25 20.9142 3.25 20.5V11C3.25 10.5858 3.58579 10.25 4 10.25ZM20 10.25C20.4142 10.25 20.75 10.5858 20.75 11V20.5C20.75 20.9142 20.4142 21.25 20 21.25H10.5C10.0858 21.25 9.75 20.9142 9.75 20.5C9.75 20.0858 10.0858 19.75 10.5 19.75H19.25V11C19.25 10.5858 19.5858 10.25 20 10.25Z"
156
+ />
157
+ <path
158
+ d="M12.003 19C11.31 18.9996 10.6384 18.7598 10.102 18.3213C9.56564 17.8829 9.19745 17.2726 9.05983 16.594C8.92222 15.9154 9.02364 15.2101 9.34693 14.5976C9.67022 13.9852 10.1955 13.5032 10.8337 13.2333C11.5673 12.9262 12.393 12.9221 13.1296 13.2222C13.8661 13.5222 14.4536 14.1018 14.7631 14.8338C15.0727 15.5659 15.0791 16.3907 14.7808 17.1274C14.4827 17.8642 13.9042 18.4527 13.1724 18.7641C12.8025 18.9205 12.4047 19.0007 12.003 19ZM11.1458 14.7215C11.1124 14.7215 11.0803 14.7348 11.0567 14.7584C11.0331 14.782 11.0198 14.8141 11.0198 14.8475V17.1923C11.0198 17.2258 11.0331 17.2578 11.0567 17.2814C11.0803 17.305 11.1124 17.3183 11.1458 17.3183C11.1671 17.3183 11.188 17.3128 11.2065 17.3024L13.3399 16.13C13.3597 16.1192 13.3761 16.1032 13.3876 16.0838C13.3991 16.0644 13.4052 16.0423 13.4052 16.0197C13.4052 15.9972 13.3991 15.9751 13.3876 15.9557C13.3761 15.9362 13.3597 15.9203 13.3399 15.9094L11.2063 14.7373C11.1879 14.727 11.1671 14.7215 11.1458 14.7215Z"
159
+ />
160
+ </svg>
161
+ }
162
+ >
163
+ Marketplace
164
+ </UISidebar.FooterItem>
165
+ <UISidebar.FooterItem
166
+ href="#"
167
+ icon={
168
+ <svg
169
+ viewBox="0 0 15 15"
170
+ xmlns="http://www.w3.org/2000/svg"
171
+ >
172
+ <path
173
+ d="M7.28856 0.796908C7.42258 0.734364 7.57742 0.734364 7.71144 0.796908L13.7114 3.59691C13.8875 3.67906 14 3.85574 14 4.05V10.95C14 11.1443 13.8875 11.3209 13.7114 11.4031L7.71144 14.2031C7.57742 14.2656 7.42258 14.2656 7.28856 14.2031L1.28856 11.4031C1.11252 11.3209 1 11.1443 1 10.95V4.05C1 3.85574 1.11252 3.67906 1.28856 3.59691L7.28856 0.796908ZM2 4.80578L7 6.93078V12.9649L2 10.6316V4.80578ZM8 12.9649L13 10.6316V4.80578L8 6.93078V12.9649ZM7.5 6.05672L12.2719 4.02866L7.5 1.80176L2.72809 4.02866L7.5 6.05672Z"
174
+ fill="currentColor"
175
+ fillRule="evenodd"
176
+ clipRule="evenodd"
177
+ />
178
+ </svg>
179
+ }
180
+ >
181
+ SDKs
182
+ </UISidebar.FooterItem>
183
+ </>
184
+ }
185
+
186
+
187
+ export function DemoContent({children, breadcrumbs = true}: { children?: React.ReactNode, breadcrumbs?: boolean }) {
188
+ return <>
189
+ {breadcrumbs && <Breadcrumbs
190
+ items={[
191
+ {
192
+ title: "APIs",
193
+ href: "/apis"
194
+ },
195
+ {
196
+ title: "GraphQL API",
197
+ href: "/apis/graphql"
198
+ }
199
+ ]}
200
+ />}
201
+
202
+ <div style={{
203
+ display: "flex",
204
+ flexDirection: "column",
205
+ gap: "24px"
206
+ }}>
207
+ {children}
208
+ </div>
209
+
210
+ <NavLinks
211
+ prev={{
212
+ title: "Prev",
213
+ href: "/prev"
214
+ }}
215
+ next={{
216
+ title: "Next",
217
+ href: "/next"
218
+ }}
219
+ />
220
+ </>
221
+ }
222
+
223
+ export function DemoTOC() {
224
+ return <Toc defaultValue="quickstart">
225
+ <Toc.Item value="quickstart">
226
+ Quickstart
227
+ </Toc.Item>
228
+ <Toc.Item value="api-features">
229
+ API Features
230
+ </Toc.Item>
231
+ <Toc.Item value="example-use-cases">
232
+ Example Use Cases
233
+ </Toc.Item>
234
+ </Toc>
235
+ }
236
+
237
+