@xyd-js/storybook 0.0.1-xyd.1 → 0.0.1-xyd.12

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 (145) hide show
  1. package/.storybook/main.ts +172 -4
  2. package/.storybook/preview.ts +1 -2
  3. package/.storybook/styles.css +0 -5
  4. package/CHANGELOG.md +119 -0
  5. package/LICENSE +21 -0
  6. package/package.json +10 -6
  7. package/src/__fixtures__/atlas-index/package-index.mdx +194 -0
  8. package/src/__fixtures__/atlas-index/wip1.mdx +131 -0
  9. package/src/__fixtures__/atlas-index.mdx +53 -0
  10. package/src/__fixtures__/example-source-uniform.ts +41 -0
  11. package/src/{content → __fixtures__}/hello-world.mdx +1 -1
  12. package/src/components/DemoDocs.tsx +237 -0
  13. package/src/components/logo.tsx +37 -0
  14. package/src/decorators/DocsTemplate.tsx +23 -0
  15. package/src/docs/atlas/Atlas.stories.tsx +30 -26
  16. package/src/docs/components/coder/CodeSample.stories.tsx +6 -3
  17. package/src/docs/components/writer/Badge.stories.tsx +15 -28
  18. package/src/docs/components/writer/GuideCard.stories.tsx +2 -3
  19. package/src/docs/components/writer/Table.stories.tsx +23 -27
  20. package/src/docs/components/writer/Tabs.stories.tsx +55 -0
  21. package/src/docs/components/writer/TocCard.stories.tsx +30 -0
  22. package/src/docs/components/writer/UnderlineNav.stories.tsx +114 -0
  23. package/src/docs/components/writer/Update.stories.tsx +91 -0
  24. package/src/docs/components/writer/VideoGuide.stories.tsx +17 -0
  25. package/src/docs/themes/TODO.md +1 -0
  26. package/src/docs/themes/themes-designsystem.stories.tsx +3 -2
  27. package/src/docs/themes/themes.stories.tsx +35 -27
  28. package/src/docs/ui/Sidebar.stories.tsx +8 -2
  29. package/storybook-static/assets/Atlas.stories-CERP-lKH.js +153 -0
  30. package/storybook-static/assets/Badge.stories-DakswLpg.js +6 -0
  31. package/storybook-static/assets/Breadcrumbs.stories-wdrli8P8.js +21 -0
  32. package/storybook-static/assets/{Button.stories-DN0HVOTz.js → Button.stories-DnfjGLtF.js} +1 -1
  33. package/storybook-static/assets/CTABanner-DLG0_gv8-1gNhmGHe.js +4 -0
  34. package/storybook-static/assets/{CTABanner.stories-DzPZmZH5.js → CTABanner.stories-CmBj9U2A.js} +1 -1
  35. package/storybook-static/assets/Callout.stories-rp4kMO8N.js +16 -0
  36. package/storybook-static/assets/{CodeSample.stories-npLtCIKw.js → CodeSample.stories-R6WeHzql.js} +1 -1
  37. package/storybook-static/assets/CodeSample.stories-prKrGyG7.js +22 -0
  38. package/storybook-static/assets/Color-YHDXOIA2-D4kH6-fL.js +1 -0
  39. package/storybook-static/assets/DocsRenderer-CFRXHY34-DczdxYfS.js +575 -0
  40. package/storybook-static/assets/{GuideCard.stories-BD_08DOF.js → GuideCard.stories-D2fmdhxW.js} +2 -2
  41. package/storybook-static/assets/Heading.stories-BwtFnfuE.js +40 -0
  42. package/storybook-static/assets/Icons-CaV53C2x.js +1 -0
  43. package/storybook-static/assets/Nav.stories-DOdsEXEe.js +13 -0
  44. package/storybook-static/assets/NavLinks.stories-v2TFSIgK.js +19 -0
  45. package/storybook-static/assets/Pre.stories-bsCA3tqM.js +11 -0
  46. package/storybook-static/assets/Sidebar.stories-Bo8NQxnh.js +9 -0
  47. package/storybook-static/assets/Steps.stories-CuIyGdUg.js +16 -0
  48. package/storybook-static/assets/SubNav.stories-gbx99ZSe.js +19 -0
  49. package/storybook-static/assets/Table.stories-B4EyLt9m.js +38 -0
  50. package/storybook-static/assets/Tabs.stories-CBSgQj02.js +42 -0
  51. package/storybook-static/assets/TocCard.stories-BgvJ6BbB.js +7 -0
  52. package/storybook-static/assets/UnderlineNav.stories-CBzxJ_ET.js +96 -0
  53. package/storybook-static/assets/Update-D5e_yqty-DsN8mVwO.js +33 -0
  54. package/storybook-static/assets/Update.stories-FtwGebQp.js +56 -0
  55. package/storybook-static/assets/VideoGuide.stories-BRSeChyH.js +3 -0
  56. package/storybook-static/assets/__vite-browser-external-FmFgRqLi.js +1 -0
  57. package/storybook-static/assets/_rollupPluginBabelHelpers-CiqSP2w--CY8sTQTJ.js +4 -0
  58. package/storybook-static/assets/{browser.esm-CjKZlQaR.js → browser.esm-BWgQ7tuZ.js} +1 -1
  59. package/storybook-static/assets/chunk-NL6KNZEE-BC1iDMSp.js +3 -0
  60. package/storybook-static/assets/content-CLSEZPMe.js +8 -0
  61. package/storybook-static/assets/entry-preview-BQ1RV56y.js +2 -0
  62. package/storybook-static/assets/{entry-preview-docs-B1zb5AAd.js → entry-preview-docs-CxQPtM_Y.js} +1 -1
  63. package/storybook-static/assets/iframe-B1jb8VLQ.js +211 -0
  64. package/storybook-static/assets/{index-Ci6h_Amb.js → index-Bd6o6BX5.js} +2 -2
  65. package/storybook-static/assets/index-BsiG4v0x.js +3 -0
  66. package/storybook-static/assets/index-CXQShRbs.js +8 -0
  67. package/storybook-static/assets/index-CXwkSlW-.js +1 -0
  68. package/storybook-static/assets/index-CzKwSnp0.js +9 -0
  69. package/storybook-static/assets/index-D_kTjGoR.js +9 -0
  70. package/storybook-static/assets/index-DgnBCu_c.js +1 -0
  71. package/storybook-static/assets/{index-BxVt_j7t.js → index-H0MBf5rE.js} +1 -1
  72. package/storybook-static/assets/jsx-runtime-D_zvdyIk.js +9 -0
  73. package/storybook-static/assets/layouts-Jper_Qis.js +1 -0
  74. package/storybook-static/assets/preview-BBHl5jls.css +1 -0
  75. package/storybook-static/assets/preview-D6WjBDEw.js +2 -0
  76. package/storybook-static/assets/{preview-ik5anPOD.js → preview-N1j9pG9L.js} +1 -1
  77. package/storybook-static/assets/react-18-Tf4JhPOR.js +25 -0
  78. package/storybook-static/assets/test-utils-BaXAOqRT.js +9 -0
  79. package/storybook-static/assets/themes-designsystem.stories-COcmw0uR.js +11 -0
  80. package/storybook-static/assets/themes.stories-PoLDJGzT.js +41 -0
  81. package/storybook-static/assets/writer-2j4DdIYZ.js +1 -0
  82. package/storybook-static/iframe.html +1 -1
  83. package/storybook-static/index.html +1 -1
  84. package/storybook-static/index.json +1 -1
  85. package/storybook-static/project.json +1 -1
  86. package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js +15 -15
  87. package/storybook-static/sb-addons/docs-12/manager-bundle.js +34 -34
  88. package/storybook-static/sb-addons/essentials-actions-4/manager-bundle.js +1 -1
  89. package/storybook-static/sb-addons/essentials-backgrounds-5/manager-bundle.js +8 -8
  90. package/storybook-static/sb-addons/essentials-controls-3/manager-bundle.js +8 -8
  91. package/storybook-static/sb-addons/essentials-measure-8/manager-bundle.js +1 -1
  92. package/storybook-static/sb-addons/essentials-outline-9/manager-bundle.js +1 -1
  93. package/storybook-static/sb-addons/essentials-toolbars-7/manager-bundle.js +1 -1
  94. package/storybook-static/sb-addons/essentials-viewport-6/manager-bundle.js +1 -1
  95. package/storybook-static/sb-addons/interactions-11/manager-bundle.js +1 -1
  96. package/storybook-static/sb-addons/links-2/manager-bundle.js +1 -1
  97. package/storybook-static/sb-addons/onboarding-1/manager-bundle.js +5 -5
  98. package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +1 -1
  99. package/storybook-static/sb-manager/globals-module-info.js +1 -0
  100. package/storybook-static/sb-manager/globals-runtime.js +10372 -9836
  101. package/storybook-static/sb-manager/runtime.js +119 -119
  102. package/tsconfig.json +33 -11
  103. package/vite.config.ts +1 -1
  104. package/storybook-static/assets/Atlas.stories-D5un33wq.js +0 -255
  105. package/storybook-static/assets/Badge.stories-CYqDghXe.js +0 -21
  106. package/storybook-static/assets/Breadcrumbs.stories-4uE3oXMP.js +0 -21
  107. package/storybook-static/assets/CTABanner-CAp2EJcY-D4ZzKv-X.js +0 -4
  108. package/storybook-static/assets/Callout.stories-B78pmczw.js +0 -16
  109. package/storybook-static/assets/CodeSample.stories-B8oGXilQ.js +0 -22
  110. package/storybook-static/assets/Color-YHDXOIA2-Zc6AbI-v.js +0 -1
  111. package/storybook-static/assets/DocsRenderer-CFRXHY34-Eqm2UMSC.js +0 -575
  112. package/storybook-static/assets/Heading.stories-Zf0yGs9N.js +0 -40
  113. package/storybook-static/assets/Nav.stories-DpHSEq4D.js +0 -13
  114. package/storybook-static/assets/NavLinks.stories-Dn8rkMsi.js +0 -19
  115. package/storybook-static/assets/Pre.stories-C5ZvjJNZ.js +0 -11
  116. package/storybook-static/assets/Sidebar.stories-Czn5gDax.js +0 -9
  117. package/storybook-static/assets/Steps.stories-DF1LEkVJ.js +0 -16
  118. package/storybook-static/assets/SubNav.stories-C6zqzDri.js +0 -19
  119. package/storybook-static/assets/Table.stories-B8fxPf6g.js +0 -43
  120. package/storybook-static/assets/UnderlineNav-4pD9CR2B-Cm0ZvG04.js +0 -41
  121. package/storybook-static/assets/_rollupPluginBabelHelpers-CDahOOgk-DyHbsKhl.js +0 -4
  122. package/storybook-static/assets/chevron-right-B9VhLASW.js +0 -31
  123. package/storybook-static/assets/chunk-GNGMS2XR-BcRZYG7M.js +0 -12
  124. package/storybook-static/assets/content-BPRhJd5I.js +0 -8
  125. package/storybook-static/assets/entry-preview-B6o8mmQF.js +0 -2
  126. package/storybook-static/assets/iframe-CQwnRjvS.js +0 -211
  127. package/storybook-static/assets/index-0nua7n0t.js +0 -1
  128. package/storybook-static/assets/index-B7gF9TUu.js +0 -9
  129. package/storybook-static/assets/index-C2_NlWRN.js +0 -8
  130. package/storybook-static/assets/index-D1ZprCIH.js +0 -9
  131. package/storybook-static/assets/index-UoN3NoLW.js +0 -17
  132. package/storybook-static/assets/jsx-runtime-BjG_zV1W.js +0 -9
  133. package/storybook-static/assets/layouts-CyY4vppc.js +0 -15
  134. package/storybook-static/assets/preview-B3IBgtzx.css +0 -1
  135. package/storybook-static/assets/preview-DbF9BiFG.js +0 -2
  136. package/storybook-static/assets/react-18-BsB9_d4u.js +0 -25
  137. package/storybook-static/assets/test-utils-CHVDXiZU.js +0 -9
  138. package/storybook-static/assets/themes-designsystem.stories-viVZlmij.js +0 -11
  139. package/storybook-static/assets/themes.stories-B-IUyI8I.js +0 -41
  140. package/storybook-static/assets/writer-sJckUxDD.js +0 -4
  141. package/tsconfig.app.json +0 -24
  142. package/tsconfig.node.json +0 -13
  143. /package/src/{content → __fixtures__}/Icons.tsx +0 -0
  144. /package/src/{content → __fixtures__}/code-sample.mdx +0 -0
  145. /package/storybook-static/assets/{preview-BRSmb3j6.js → preview-ppqJ5XSc.js} +0 -0
@@ -1,32 +1,19 @@
1
- import React, {} from 'react';
2
- import type {Meta} from '@storybook/react';
1
+ import React from 'react';
2
+ import type { Meta, StoryObj } from '@storybook/react';
3
+ import { Badge } from '@xyd-js/components/writer';
3
4
 
4
- import {Badge} from "@xyd-js/components/writer";
5
-
6
- export default {
5
+ const meta: Meta<typeof Badge> = {
7
6
  title: 'Components/Writer/Badge',
8
- } as Meta;
7
+ component: Badge,
8
+ };
9
9
 
10
- export const Default = () => {
11
- return <div style={{
12
- padding: "100px",
13
- paddingTop: "0px",
14
- margin: "0 auto",
15
- }}>
16
- <Badge kind="">
17
- Default
18
- </Badge>
19
- </div>
20
- }
10
+ export default meta;
11
+ type Story = StoryObj<typeof Badge>;
21
12
 
22
- export const Warning = () => {
23
- return <div style={{
24
- padding: "100px",
25
- paddingTop: "0px",
26
- margin: "0 auto",
27
- }}>
28
- <Badge kind="warning">
29
- Warning
30
- </Badge>
31
- </div>
32
- }
13
+ // Basic usage
14
+ export const Default: Story = {
15
+ args: {
16
+ children: 'Default Badge',
17
+ kind: 'warning',
18
+ },
19
+ };
@@ -1,12 +1,11 @@
1
1
  import React, {} from 'react';
2
2
  import type {Meta} from '@storybook/react';
3
3
 
4
+ import { GuideCard } from '@xyd-js/components/writer';
4
5
  import {
5
- GuideCard,
6
-
7
6
  IconSessionReplay,
8
7
  IconMetrics
9
- } from '@xyd-js/components/writer';
8
+ } from '../../../__fixtures__/Icons';
10
9
 
11
10
  export default {
12
11
  title: 'Components/Writer/GuideCard',
@@ -2,7 +2,7 @@ import React, {} from 'react';
2
2
  import type {Meta} from '@storybook/react';
3
3
 
4
4
  import {
5
- Table,
5
+ Table
6
6
  } from '@xyd-js/components/writer';
7
7
 
8
8
  export default {
@@ -16,39 +16,35 @@ export const Default = () => {
16
16
  margin: "0 auto",
17
17
  }}>
18
18
  <Table>
19
- <Table.Th>
20
- Name
21
- </Table.Th>
22
- <Table.Th>
23
- Default
24
- </Table.Th>
25
- <Table.Th>
26
- Description
27
- </Table.Th>
28
-
19
+ <Table.Head>
29
20
  <Table.Tr>
30
- <Table.Td>
31
- disabled
32
- </Table.Td>
33
- <Table.Td>
34
- false
35
- </Table.Td>
36
- <Table.Td>
37
- Controls the disabled state of the tab
38
- </Table.Td>
21
+ <Table.Th>Model</Table.Th>
22
+ <Table.Th numeric>Training</Table.Th>
23
+ <Table.Th numeric>Input</Table.Th>
24
+ <Table.Th numeric>Cached input</Table.Th>
25
+ <Table.Th numeric>Output</Table.Th>
39
26
  </Table.Tr>
40
-
27
+ </Table.Head>
28
+ <Table.Body>
41
29
  <Table.Tr>
42
30
  <Table.Td>
43
- active
31
+ <Table.Cell>gpt-4o-2024-08-06</Table.Cell>
44
32
  </Table.Td>
45
- <Table.Td>
46
- false
33
+ <Table.Td numeric>
34
+ <Table.Cell>$25.00</Table.Cell>
47
35
  </Table.Td>
48
- <Table.Td>
49
- Controls the active state of the tab
36
+ <Table.Td numeric>
37
+ <Table.Cell>$3.75</Table.Cell>
38
+ </Table.Td>
39
+ <Table.Td numeric muted>
40
+ <Table.Cell>$1.875</Table.Cell>
41
+ </Table.Td>
42
+ <Table.Td numeric>
43
+ <Table.Cell>$15.00</Table.Cell>
50
44
  </Table.Td>
51
45
  </Table.Tr>
52
- </Table>
46
+ </Table.Body>
47
+ </Table>
53
48
  </div>
54
49
  }
50
+
@@ -0,0 +1,55 @@
1
+ import React, { } from 'react';
2
+ import type { Meta } from '@storybook/react';
3
+
4
+ import {
5
+ Tabs,
6
+ } from '@xyd-js/components/writer';
7
+
8
+ export default {
9
+ title: 'Components/Writer/Tabs',
10
+ } as Meta;
11
+
12
+ export const Default = () => {
13
+ return <div style={{
14
+ padding: "100px",
15
+ paddingTop: "0px",
16
+ margin: "0 auto",
17
+ }}>
18
+ <Tabs items={["User Behavior", "Feature Adoption", "Churn Analysis", "Churn Analysis2", "Churn Analysis3", "Churn Analysis4", "Churn Analysis5", "Churn Analysis6"]}>
19
+ <Tabs.Content value="User Behavior">
20
+ Gain insights into user behavior by replaying sessions and analyzing click patterns. This helps uncover friction
21
+ points in your app's user experience.
22
+ </Tabs.Content>
23
+ <Tabs.Content value="Feature Adoption">
24
+ Understand how users engage with new features. Track metrics like time to adoption and overall usage to measure
25
+ feature success.
26
+ </Tabs.Content>
27
+ <Tabs.Content value="Churn Analysis">
28
+ Use session data to identify behavioral patterns of users who are at risk of churning and implement targeted
29
+ retention strategies.
30
+ </Tabs.Content>
31
+ <Tabs.Content value="Churn Analysis2">
32
+ Use session data to identify behavioral patterns of users who are at risk of churning and implement targeted
33
+ retention strategies.
34
+ </Tabs.Content>
35
+ <Tabs.Content value="Churn Analysis3">
36
+ Use session data to identify behavioral patterns of users who are at risk of churning and implement targeted
37
+ retention strategies.
38
+ </Tabs.Content>
39
+ <Tabs.Content value="Churn Analysis4">
40
+ Use session data to identify behavioral patterns of users who are at risk of churning and implement targeted
41
+ retention strategies.
42
+ </Tabs.Content>
43
+ <Tabs.Content value="Churn Analysis5">
44
+ Use session data to identify behavioral patterns of users who are at risk of churning and implement targeted
45
+ retention strategies.
46
+ </Tabs.Content>
47
+ <Tabs.Content value="Churn Analysis6">
48
+ Use session data to identify behavioral patterns of users who are at risk of churning and implement targeted
49
+ retention strategies.
50
+ </Tabs.Content>
51
+ </Tabs>
52
+ </div>
53
+ }
54
+
55
+
@@ -0,0 +1,30 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+
3
+ import { TocCard } from '@xyd-js/components/writer';
4
+
5
+ const meta: Meta<typeof TocCard> = {
6
+ title: 'Components/Writer/TocCard',
7
+ component: TocCard,
8
+ parameters: {
9
+ layout: 'centered',
10
+ docs: {
11
+ description: {
12
+ component: 'A server-side rendered card component for table of contents entries. Displays a title, description, and favicon for a linked resource without client-side fetching.',
13
+ },
14
+ },
15
+ },
16
+ tags: [],
17
+ };
18
+
19
+ export default meta;
20
+ type Story = StoryObj<typeof TocCard>;
21
+
22
+ export const Default: Story = {
23
+ args: {
24
+ title: 'Example App',
25
+ description: 'Explore our example app to see how the TocCard component works.',
26
+ href: 'https://github.com/livesession/xyd',
27
+ },
28
+ };
29
+
30
+
@@ -0,0 +1,114 @@
1
+ import { useState } from 'react';
2
+ import type { Meta, StoryObj } from '@storybook/react';
3
+
4
+ import { UnderlineNav } from '@xyd-js/components/writer';
5
+
6
+ const meta: Meta<typeof UnderlineNav> = {
7
+ title: 'Components/Writer/UnderlineNav',
8
+ component: UnderlineNav,
9
+ parameters: {
10
+ layout: 'padded',
11
+ },
12
+ tags: [],
13
+ };
14
+
15
+ export default meta;
16
+ type Story = StoryObj<typeof UnderlineNav>;
17
+
18
+ export const Default: Story = {
19
+ args: {
20
+ value: 'tab1',
21
+ onChange: (value) => console.log('Selected tab:', value),
22
+ },
23
+ render: (args) => {
24
+ const [value, setValue] = useState('tab1');
25
+
26
+ return <div style={{ width: 600 }}>
27
+ <UnderlineNav value={value} onChange={setValue}>
28
+ <UnderlineNav.Item value="tab1" href="#tab1">
29
+ First Tab
30
+ </UnderlineNav.Item>
31
+ <UnderlineNav.Item value="tab2" href="#tab2">
32
+ Second Tab
33
+ </UnderlineNav.Item>
34
+ <UnderlineNav.Item value="tab3" href="#tab3">
35
+ Third Tab
36
+ </UnderlineNav.Item>
37
+
38
+ <UnderlineNav.Content value="tab1">
39
+ This is tab 1
40
+ </UnderlineNav.Content>
41
+ <UnderlineNav.Content value="tab2">
42
+ This is tab 2
43
+ </UnderlineNav.Content>
44
+ <UnderlineNav.Content value="tab3">
45
+ This is tab 3
46
+ </UnderlineNav.Content>
47
+ </UnderlineNav>
48
+ </div>
49
+ }
50
+ };
51
+
52
+ export const WithoutSlide: Story = {
53
+ args: {
54
+ value: 'tab1',
55
+ onChange: (value) => console.log('Selected tab:', value),
56
+ slide: false,
57
+ },
58
+ render: (args) => {
59
+ const [value, setValue] = useState('tab1');
60
+
61
+ return <div style={{ width: 600 }}>
62
+ <UnderlineNav value={value} onChange={setValue} slide={false}>
63
+ <UnderlineNav.Item value="tab1" href="#tab1">
64
+ First Tab
65
+ </UnderlineNav.Item>
66
+ <UnderlineNav.Item value="tab2" href="#tab2">
67
+ Second Tab
68
+ </UnderlineNav.Item>
69
+ <UnderlineNav.Item value="tab3" href="#tab3">
70
+ Third Tab
71
+ </UnderlineNav.Item>
72
+
73
+ <UnderlineNav.Content value="tab1">
74
+ This is tab 1
75
+ </UnderlineNav.Content>
76
+ <UnderlineNav.Content value="tab2">
77
+ This is tab 2
78
+ </UnderlineNav.Content>
79
+ <UnderlineNav.Content value="tab3">
80
+ This is tab 3
81
+ </UnderlineNav.Content>
82
+ </UnderlineNav>
83
+ </div>
84
+ }
85
+ };
86
+
87
+ export const Uncontrolled: Story = {
88
+ render: () => {
89
+ return <div style={{ width: 600 }}>
90
+ <UnderlineNav>
91
+ <UnderlineNav.Item value="tab1" href="#tab1">
92
+ First Tab
93
+ </UnderlineNav.Item>
94
+ <UnderlineNav.Item value="tab2" href="#tab2">
95
+ Second Tab
96
+ </UnderlineNav.Item>
97
+ <UnderlineNav.Item value="tab3" href="#tab3">
98
+ Third Tab
99
+ </UnderlineNav.Item>
100
+
101
+ <UnderlineNav.Content value="tab1">
102
+ This is tab 1
103
+ </UnderlineNav.Content>
104
+ <UnderlineNav.Content value="tab2">
105
+ This is tab 2
106
+ </UnderlineNav.Content>
107
+ <UnderlineNav.Content value="tab3">
108
+ This is tab 3
109
+ </UnderlineNav.Content>
110
+ </UnderlineNav>
111
+ </div>
112
+ }
113
+ };
114
+
@@ -0,0 +1,91 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+
3
+ import { ContentDecorator } from '@xyd-js/components/content';
4
+ import { Heading, Image, List, Text, Update } from '@xyd-js/components/writer';
5
+
6
+ const meta: Meta<typeof Update> = {
7
+ title: 'Components/Writer/Update',
8
+ component: Update,
9
+ parameters: {
10
+ layout: 'centered',
11
+ docs: {
12
+ description: {
13
+ component: '',
14
+ },
15
+ },
16
+ },
17
+ tags: [],
18
+ };
19
+
20
+ export default meta;
21
+ type Story = StoryObj<typeof Update>;
22
+
23
+ export const Default: Story = {
24
+ args: {
25
+ date: '2024-10-12',
26
+ version: 'v0.1.1',
27
+ features: [
28
+ 'Responsive design',
29
+ 'Sticky section for each changelog',
30
+ ],
31
+ children: <ContentDecorator>
32
+ <Image
33
+ src="https://placehold.co/600x300?text=Screenshot+or+Content"
34
+ alt="Screenshot placeholder"
35
+ />
36
+ <Heading size={2}>
37
+ Changelog
38
+ </Heading>
39
+ <Text>
40
+ You can add anything here, like a screenshot, a code snippet, or a list of changes.
41
+ </Text>
42
+
43
+ <Heading size={3}>
44
+ Features
45
+ </Heading>
46
+ <List>
47
+ <List.Item>Initial layout</List.Item>
48
+ <List.Item>Basic navigation</List.Item>
49
+ </List>
50
+ </ContentDecorator>,
51
+ },
52
+ };
53
+
54
+ export const MultipleUpdates: Story = {
55
+ render: () => (
56
+ <div style={{ display: 'flex', flexDirection: 'column', gap: '3rem', alignItems: 'stretch' }}>
57
+ <Update date="2024-10-12" version="v0.1.1">
58
+ <ContentDecorator>
59
+ <Image
60
+ src="https://placehold.co/600x300?text=Screenshot+or+Content+1"
61
+ alt="Screenshot 1"
62
+ />
63
+ <Heading size={2}>Changelog</Heading>
64
+ <Text>First update: new features and improvements.</Text>
65
+ <Heading size={3}>Features</Heading>
66
+ <List>
67
+ <List.Item>Initial layout</List.Item>
68
+ <List.Item>Basic navigation</List.Item>
69
+ </List>
70
+ </ContentDecorator>
71
+ </Update>
72
+ <Update date="2024-09-01" version="v0.1.0">
73
+ <ContentDecorator>
74
+ <Image
75
+ src="https://placehold.co/600x300?text=Screenshot+or+Content+2"
76
+ alt="Screenshot 2"
77
+ />
78
+ <Heading size={2}>Changelog</Heading>
79
+ <Text>Initial release with basic functionality.</Text>
80
+ <Heading size={3}>Features</Heading>
81
+ <List>
82
+ <List.Item>Initial layout</List.Item>
83
+ <List.Item>Basic navigation</List.Item>
84
+ </List>
85
+ </ContentDecorator>
86
+ </Update>
87
+ </div>
88
+ ),
89
+ };
90
+
91
+
@@ -0,0 +1,17 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import { VideoGuide } from '@xyd-js/components/writer';
3
+
4
+ const meta: Meta<typeof VideoGuide> = {
5
+ title: 'Components/Writer/VideoGuide',
6
+ component: VideoGuide,
7
+ parameters: {
8
+ layout: 'centered',
9
+ },
10
+ };
11
+
12
+ export default meta;
13
+ type Story = StoryObj<typeof VideoGuide>;
14
+
15
+ export const Miniature: Story = {
16
+ render: () => <VideoGuide.Miniature />,
17
+ };
@@ -0,0 +1 @@
1
+ move this to "templates" and here should be showcase of "gusto" | "poetry"
@@ -7,14 +7,15 @@ import {
7
7
  Table,
8
8
  UnderlineNav,
9
9
  } from '@xyd-js/components/writer';
10
- import getContentComponents from "@xyd-js/components/content";
10
+ import {ReactContent} from "@xyd-js/components/content";
11
11
 
12
+ const reactContent = new ReactContent()
12
13
  const {
13
14
  h1: H1,
14
15
  h3: H3,
15
16
  h4: H4,
16
17
  p: Text,
17
- } = getContentComponents();
18
+ } = reactContent.components()
18
19
 
19
20
  export default {
20
21
  title: 'Themes',
@@ -3,10 +3,14 @@ import type {Meta} from '@storybook/react';
3
3
  import {MemoryRouter} from "react-router";
4
4
 
5
5
  import {
6
- Layout,
6
+ LayoutPrimary
7
7
  } from '@xyd-js/components/layouts';
8
8
 
9
- import getContentComponents from "@xyd-js/components/content";
9
+ import {ReactContent} from "@xyd-js/components/content";
10
+
11
+ const reactContent = new ReactContent()
12
+ const getContentComponents = reactContent.components
13
+
10
14
  import {
11
15
  Breadcrumbs,
12
16
  NavLinks
@@ -18,8 +22,8 @@ import {
18
22
  UISidebar
19
23
  } from "@xyd-js/ui"
20
24
 
21
- import {LiveSessionPlatformLogo} from "./logo.tsx";
22
- import Content from "../../content/hello-world.mdx";
25
+ import {LiveSessionPlatformLogo} from "./logo";
26
+ import Content from "../../__fixtures__/hello-world.mdx";
23
27
 
24
28
  export default {
25
29
  title: 'Themes/Default',
@@ -31,18 +35,19 @@ export default {
31
35
  } as Meta;
32
36
 
33
37
  export const Default = () => {
34
- return <Layout
35
- header={<DemoNavbar/>}
36
- subheader
37
- aside={<DemoSidebar/>}
38
- content={<DemoContent/>}
39
- contentNav={<DemoTOC/>}
38
+ return <LayoutPrimary
39
+ header={<$DemoNavbar/>}
40
+ subheader={<$DemoSubNav/>}
41
+ aside={<$DemoSidebar/>}
42
+ content={<$DemoContent/>}
43
+ contentNav={<$DemoTOC/>}
40
44
  />
41
45
  }
42
46
 
43
- function DemoNavbar() {
47
+ function $DemoNavbar() {
44
48
  return <>
45
49
  <Nav
50
+ onChange={() => {}}
46
51
  value="api-reference"
47
52
  logo={<LiveSessionPlatformLogo/>}
48
53
  kind="middle"
@@ -57,21 +62,24 @@ function DemoNavbar() {
57
62
  GraphQL
58
63
  </Nav.Item>
59
64
  </Nav>
60
- <SubNav title="Apps" value="build">
61
- <SubNav.Item value="build" href="/build">
62
- Build
63
- </SubNav.Item>
64
- <SubNav.Item value="design" href="/design">
65
- Design
66
- </SubNav.Item>
67
- <SubNav.Item value="launch" href="/launch">
68
- Launch
69
- </SubNav.Item>
70
- </SubNav>
71
65
  </>
72
66
  }
73
67
 
74
- function DemoSidebar() {
68
+ function $DemoSubNav() {
69
+ return <SubNav onChange={() => {}} title="Apps" value="build">
70
+ <SubNav.Item value="build" href="/build">
71
+ Build
72
+ </SubNav.Item>
73
+ <SubNav.Item value="design" href="/design">
74
+ Design
75
+ </SubNav.Item>
76
+ <SubNav.Item value="launch" href="/launch">
77
+ Launch
78
+ </SubNav.Item>
79
+ </SubNav>
80
+ }
81
+
82
+ function $DemoSidebar() {
75
83
  const [isOpen, setIsOpen] = useState(false)
76
84
 
77
85
  function onClick() {
@@ -83,7 +91,7 @@ function DemoSidebar() {
83
91
  </UISidebar.Item>
84
92
  )
85
93
 
86
- return <UISidebar footerItems={<DemoSidebarFooter/>}>
94
+ return <UISidebar footerItems={<$DemoSidebarFooter/>}>
87
95
  <UISidebar.ItemHeader>
88
96
  GET STARTED
89
97
  </UISidebar.ItemHeader>
@@ -130,7 +138,7 @@ function DemoSidebar() {
130
138
  </UISidebar>
131
139
  }
132
140
 
133
- function DemoSidebarFooter() {
141
+ function $DemoSidebarFooter() {
134
142
  return <>
135
143
  <UISidebar.FooterItem
136
144
  href="#"
@@ -208,7 +216,7 @@ function DemoSidebarFooter() {
208
216
  }
209
217
 
210
218
 
211
- function DemoContent() {
219
+ function $DemoContent() {
212
220
  return <>
213
221
  <Breadcrumbs
214
222
  items={[
@@ -244,7 +252,7 @@ function DemoContent() {
244
252
  </>
245
253
  }
246
254
 
247
- function DemoTOC() {
255
+ function $DemoTOC() {
248
256
  return <Toc defaultValue="quickstart">
249
257
  <Toc.Item value="quickstart">
250
258
  Quickstart
@@ -1,11 +1,17 @@
1
1
  import React, {useState} from 'react';
2
2
  import type {Meta} from '@storybook/react';
3
+ import {MemoryRouter} from "react-router";
3
4
 
4
5
  import {UISidebar} from '@xyd-js/ui';
5
- import {Layout} from "@xyd-js/components/layouts";
6
+ import {LayoutPrimary} from "@xyd-js/components/layouts";
6
7
 
7
8
  export default {
8
9
  title: 'UI/Sidebar',
10
+ decorators: [
11
+ (Story) => <MemoryRouter>
12
+ <Story />
13
+ </MemoryRouter>,
14
+ ],
9
15
  } as Meta;
10
16
 
11
17
  export const Default = () => {
@@ -14,7 +20,7 @@ export const Default = () => {
14
20
  paddingTop: "0px",
15
21
  margin: "0 auto",
16
22
  }}>
17
- <Layout
23
+ <LayoutPrimary
18
24
  header={<></>}
19
25
  aside={<DemoSidebar/>}
20
26
  content={<></>}