@xyd-js/storybook 0.0.1-xyd.0
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/main.ts +59 -0
- package/.storybook/preview.ts +30 -0
- package/.storybook/styles.css +5 -0
- package/CHANGELOG.md +12 -0
- package/README.md +50 -0
- package/eslint.config.js +28 -0
- package/package.json +50 -0
- package/src/content/Icons.tsx +83 -0
- package/src/content/code-sample.mdx +15 -0
- package/src/content/hello-world.mdx +116 -0
- package/src/docs/atlas/Atlas.stories.tsx +47 -0
- package/src/docs/atlas/todo-app.uniform.json +625 -0
- package/src/docs/atlas/uniform-to-references.ts +101 -0
- package/src/docs/components/brand/Button.stories.tsx +32 -0
- package/src/docs/components/brand/CTABanner.stories.tsx +36 -0
- package/src/docs/components/coder/CodeSample.stories.tsx +26 -0
- package/src/docs/components/writer/Badge.stories.tsx +32 -0
- package/src/docs/components/writer/Breadcrumbs.stories.tsx +34 -0
- package/src/docs/components/writer/Callout.stories.tsx +25 -0
- package/src/docs/components/writer/GuideCard.stories.tsx +151 -0
- package/src/docs/components/writer/Heading.stories.tsx +52 -0
- package/src/docs/components/writer/NavLinks.stories.tsx +31 -0
- package/src/docs/components/writer/Pre.stories.tsx +23 -0
- package/src/docs/components/writer/Steps.stories.tsx +27 -0
- package/src/docs/components/writer/Table.stories.tsx +54 -0
- package/src/docs/templates/CodeSample.stories.tsx +15 -0
- package/src/docs/themes/logo.tsx +37 -0
- package/src/docs/themes/themes-designsystem.stories.tsx +156 -0
- package/src/docs/themes/themes.stories.tsx +261 -0
- package/src/docs/ui/Nav.stories.tsx +58 -0
- package/src/docs/ui/Sidebar.stories.tsx +161 -0
- package/src/docs/ui/SubNav.stories.tsx +29 -0
- package/src/utils/mdx.ts +31 -0
- package/storybook-static/assets/Atlas.stories-CXIW65Hs.js +255 -0
- package/storybook-static/assets/Badge.stories-xjDbGZ5c.js +21 -0
- package/storybook-static/assets/Breadcrumbs.stories-DUn-OgPN.js +21 -0
- package/storybook-static/assets/Button.stories-BUAUswSC.js +21 -0
- package/storybook-static/assets/CTABanner-7_fa6QIU-6vh6ca3a.js +4 -0
- package/storybook-static/assets/CTABanner.stories-D5CtnW6h.js +22 -0
- package/storybook-static/assets/Callout.stories-DonqcNeI.js +16 -0
- package/storybook-static/assets/CodeSample.stories-4-beIs6I.js +22 -0
- package/storybook-static/assets/CodeSample.stories-B8_z15cp.js +8 -0
- package/storybook-static/assets/Color-F6OSRLHC-D5TfMBnc.js +1 -0
- package/storybook-static/assets/DocsRenderer-CFRXHY34-BrPAHo60.js +730 -0
- package/storybook-static/assets/GuideCard.stories-B8wFh9oh.js +65 -0
- package/storybook-static/assets/Heading.stories-D82-EGrg.js +40 -0
- package/storybook-static/assets/Nav.stories-CM_STIcN.js +13 -0
- package/storybook-static/assets/NavLinks.stories-D0QuD0H3.js +19 -0
- package/storybook-static/assets/Pre.stories-1WB_X0Ix.js +11 -0
- package/storybook-static/assets/Sidebar.stories-CwyChgiy.js +9 -0
- package/storybook-static/assets/Steps.stories-gANyLY_H.js +16 -0
- package/storybook-static/assets/SubNav.stories-D5TbjJj2.js +19 -0
- package/storybook-static/assets/Table.stories-BSZMHwDX.js +43 -0
- package/storybook-static/assets/UnderlineNav-C0OvjpyZ-D7c5zIhU.js +41 -0
- package/storybook-static/assets/_rollupPluginBabelHelpers-CAjWVhpp-BWJe-8U1.js +4 -0
- package/storybook-static/assets/browser.esm-BOPNWGdv.js +20 -0
- package/storybook-static/assets/chevron-right-Dfa2nijf.js +31 -0
- package/storybook-static/assets/chunk-K6AXKMTT-DXBwE8Vx.js +12 -0
- package/storybook-static/assets/chunk-XP5HYGXS-DH4vAeCa.js +1 -0
- package/storybook-static/assets/client-jctswkVR.js +25 -0
- package/storybook-static/assets/content-DfDGXctA.js +8 -0
- package/storybook-static/assets/entry-preview-Com-SXI0.js +10 -0
- package/storybook-static/assets/entry-preview-docs-Bs0lZRn3.js +47 -0
- package/storybook-static/assets/entry-preview-rsc-56ExrKd2.js +1 -0
- package/storybook-static/assets/iframe-B0k8DGQG.js +2 -0
- package/storybook-static/assets/index-B-gRCko5.js +1 -0
- package/storybook-static/assets/index-B0Jt8usF.js +9 -0
- package/storybook-static/assets/index-CBUcM4bS.js +8 -0
- package/storybook-static/assets/index-CC-8bvy6.js +9 -0
- package/storybook-static/assets/index-CQ7VjfMi.js +1 -0
- package/storybook-static/assets/index-Cu4lwwaE.js +1 -0
- package/storybook-static/assets/index-DIXNDbo9.js +1 -0
- package/storybook-static/assets/index-D_kIG38s.js +1 -0
- package/storybook-static/assets/index-DthG7GmK.js +17 -0
- package/storybook-static/assets/index-ogSvIofg.js +6 -0
- package/storybook-static/assets/jsx-runtime-C-_spy54.js +9 -0
- package/storybook-static/assets/layouts-CHVz-oC2.js +15 -0
- package/storybook-static/assets/preview--rrl-Bev.js +234 -0
- package/storybook-static/assets/preview-B3PTUHS7.js +1 -0
- package/storybook-static/assets/preview-CFgKly6U.js +1 -0
- package/storybook-static/assets/preview-CsjPNNCI.js +1 -0
- package/storybook-static/assets/preview-DFfOCnyz.css +1 -0
- package/storybook-static/assets/preview-DGUiP6tS.js +7 -0
- package/storybook-static/assets/preview-DY_pW_WS.js +396 -0
- package/storybook-static/assets/preview-NdwLIjRI.js +2 -0
- package/storybook-static/assets/preview-RFMnorYX.js +1 -0
- package/storybook-static/assets/preview-Zk6Lo_wo.js +1 -0
- package/storybook-static/assets/preview-iUmqt_lp.js +34 -0
- package/storybook-static/assets/react-18-C4NQogKe.js +1 -0
- package/storybook-static/assets/themes-designsystem.stories-DyoY6VQ9.js +11 -0
- package/storybook-static/assets/themes.stories-BUr1Iju1.js +41 -0
- package/storybook-static/assets/writer-BQ7yPg-n.js +4 -0
- package/storybook-static/favicon.svg +1 -0
- package/storybook-static/iframe.html +639 -0
- package/storybook-static/index.html +186 -0
- package/storybook-static/index.json +1 -0
- package/storybook-static/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/project.json +1 -0
- package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js +331 -0
- package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js.LEGAL.txt +51 -0
- package/storybook-static/sb-addons/essentials-actions-4/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-actions-4/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-backgrounds-5/manager-bundle.js +12 -0
- package/storybook-static/sb-addons/essentials-backgrounds-5/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-controls-3/manager-bundle.js +391 -0
- package/storybook-static/sb-addons/essentials-controls-3/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-measure-8/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-measure-8/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-outline-9/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-outline-9/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-toolbars-7/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-toolbars-7/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-viewport-6/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-viewport-6/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/interactions-11/manager-bundle.js +210 -0
- package/storybook-static/sb-addons/interactions-11/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/links-2/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/links-2/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/onboarding-1/manager-bundle.js +127 -0
- package/storybook-static/sb-addons/onboarding-1/manager-bundle.js.LEGAL.txt +12 -0
- package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +3 -0
- package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-common-assets/favicon.svg +1 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/sb-manager/globals-module-info.js +1028 -0
- package/storybook-static/sb-manager/globals-runtime.js +40861 -0
- package/storybook-static/sb-manager/globals.js +48 -0
- package/storybook-static/sb-manager/runtime.js +13338 -0
- package/storybook-static/sb-preview/globals.js +33 -0
- package/storybook-static/sb-preview/runtime.js +7174 -0
- package/tsconfig.app.json +24 -0
- package/tsconfig.json +17 -0
- package/tsconfig.node.json +13 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/vite.config.ts +8 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import React, {useState} from 'react';
|
|
2
|
+
import type {Meta} from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
import {UISidebar} from '@xyd-js/ui';
|
|
5
|
+
import {Layout} from "@xyd-js/components/layouts";
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'UI/Sidebar',
|
|
9
|
+
} as Meta;
|
|
10
|
+
|
|
11
|
+
export const Default = () => {
|
|
12
|
+
return <div style={{
|
|
13
|
+
padding: "100px",
|
|
14
|
+
paddingTop: "0px",
|
|
15
|
+
margin: "0 auto",
|
|
16
|
+
}}>
|
|
17
|
+
<Layout
|
|
18
|
+
header={<></>}
|
|
19
|
+
aside={<DemoSidebar/>}
|
|
20
|
+
content={<></>}
|
|
21
|
+
contentNav={<></>}
|
|
22
|
+
/>
|
|
23
|
+
</div>
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
function DemoSidebar() {
|
|
28
|
+
const [isOpen, setIsOpen] = useState(false)
|
|
29
|
+
|
|
30
|
+
function onClick() {
|
|
31
|
+
setIsOpen(!isOpen)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const items = new Array(40).fill(0).map((_, i) => <UISidebar.Item key={i} href="#">
|
|
35
|
+
{`Item ${i}`}
|
|
36
|
+
</UISidebar.Item>
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
return <UISidebar footerItems={<DemoSidebarFooter/>}>
|
|
40
|
+
<UISidebar.ItemHeader>
|
|
41
|
+
GET STARTED
|
|
42
|
+
</UISidebar.ItemHeader>
|
|
43
|
+
<UISidebar.Item
|
|
44
|
+
button
|
|
45
|
+
active={isOpen}
|
|
46
|
+
activeTheme="secondary"
|
|
47
|
+
onClick={onClick}
|
|
48
|
+
>
|
|
49
|
+
Root nested
|
|
50
|
+
<UISidebar.SubTree isOpen={isOpen}>
|
|
51
|
+
<UISidebar.Item href="#">
|
|
52
|
+
Nested A
|
|
53
|
+
</UISidebar.Item>
|
|
54
|
+
<UISidebar.Item href="#">
|
|
55
|
+
Nested B
|
|
56
|
+
</UISidebar.Item>
|
|
57
|
+
<UISidebar.Item button active>
|
|
58
|
+
Nested root C
|
|
59
|
+
<UISidebar.SubTree>
|
|
60
|
+
<UISidebar.Item href="#">
|
|
61
|
+
Nested C.A
|
|
62
|
+
</UISidebar.Item>
|
|
63
|
+
<UISidebar.Item href="#">
|
|
64
|
+
Nested C.B
|
|
65
|
+
</UISidebar.Item>
|
|
66
|
+
</UISidebar.SubTree>
|
|
67
|
+
</UISidebar.Item>
|
|
68
|
+
</UISidebar.SubTree>
|
|
69
|
+
</UISidebar.Item>
|
|
70
|
+
|
|
71
|
+
<UISidebar.ItemHeader>
|
|
72
|
+
APIS
|
|
73
|
+
</UISidebar.ItemHeader>
|
|
74
|
+
<UISidebar.Item href="#">
|
|
75
|
+
Authentication
|
|
76
|
+
</UISidebar.Item>
|
|
77
|
+
|
|
78
|
+
<UISidebar.Item href="#">
|
|
79
|
+
Making requests
|
|
80
|
+
</UISidebar.Item>
|
|
81
|
+
|
|
82
|
+
{items}
|
|
83
|
+
</UISidebar>
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function DemoSidebarFooter() {
|
|
87
|
+
return <>
|
|
88
|
+
<UISidebar.FooterItem
|
|
89
|
+
href="#"
|
|
90
|
+
icon={
|
|
91
|
+
<svg
|
|
92
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
93
|
+
viewBox="0 0 24 24"
|
|
94
|
+
>
|
|
95
|
+
<path
|
|
96
|
+
fillRule="evenodd"
|
|
97
|
+
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"
|
|
98
|
+
clipRule="evenodd"
|
|
99
|
+
/>
|
|
100
|
+
</svg>
|
|
101
|
+
}
|
|
102
|
+
>
|
|
103
|
+
Cookbook
|
|
104
|
+
</UISidebar.FooterItem>
|
|
105
|
+
<UISidebar.FooterItem
|
|
106
|
+
href="#"
|
|
107
|
+
icon={
|
|
108
|
+
<svg
|
|
109
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
110
|
+
fill="currentColor"
|
|
111
|
+
viewBox="0 0 24 24"
|
|
112
|
+
>
|
|
113
|
+
<path
|
|
114
|
+
fillRule="evenodd"
|
|
115
|
+
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"
|
|
116
|
+
clipRule="evenodd"
|
|
117
|
+
/>
|
|
118
|
+
</svg>
|
|
119
|
+
}
|
|
120
|
+
>
|
|
121
|
+
Community
|
|
122
|
+
</UISidebar.FooterItem>
|
|
123
|
+
<UISidebar.FooterItem
|
|
124
|
+
href="#"
|
|
125
|
+
icon={
|
|
126
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"
|
|
127
|
+
fill="none">
|
|
128
|
+
<path fill-rule="evenodd" clip-rule="evenodd"
|
|
129
|
+
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"
|
|
130
|
+
/>
|
|
131
|
+
<path fill-rule="evenodd" clip-rule="evenodd"
|
|
132
|
+
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"
|
|
133
|
+
/>
|
|
134
|
+
<path
|
|
135
|
+
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"
|
|
136
|
+
/>
|
|
137
|
+
</svg>
|
|
138
|
+
}
|
|
139
|
+
>
|
|
140
|
+
Marketplace
|
|
141
|
+
</UISidebar.FooterItem>
|
|
142
|
+
<UISidebar.FooterItem
|
|
143
|
+
href="#"
|
|
144
|
+
icon={
|
|
145
|
+
<svg
|
|
146
|
+
viewBox="0 0 15 15"
|
|
147
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
148
|
+
>
|
|
149
|
+
<path
|
|
150
|
+
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"
|
|
151
|
+
fill="currentColor"
|
|
152
|
+
fillRule="evenodd"
|
|
153
|
+
clipRule="evenodd"
|
|
154
|
+
/>
|
|
155
|
+
</svg>
|
|
156
|
+
}
|
|
157
|
+
>
|
|
158
|
+
SDKs
|
|
159
|
+
</UISidebar.FooterItem>
|
|
160
|
+
</>
|
|
161
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React, {} from 'react';
|
|
2
|
+
import type {Meta} from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
import {SubNav} from '@xyd-js/ui';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'UI/SubNav',
|
|
8
|
+
} as Meta;
|
|
9
|
+
|
|
10
|
+
export const Default = () => {
|
|
11
|
+
return <div style={{
|
|
12
|
+
padding: "100px",
|
|
13
|
+
paddingTop: "0px",
|
|
14
|
+
margin: "0 auto",
|
|
15
|
+
}}>
|
|
16
|
+
<SubNav title="Apps" value="build">
|
|
17
|
+
<SubNav.Item value="build" href="/build">
|
|
18
|
+
Build
|
|
19
|
+
</SubNav.Item>
|
|
20
|
+
<SubNav.Item value="design" href="/design">
|
|
21
|
+
Design
|
|
22
|
+
</SubNav.Item>
|
|
23
|
+
<SubNav.Item value="launch" href="/launch">
|
|
24
|
+
Launch
|
|
25
|
+
</SubNav.Item>
|
|
26
|
+
</SubNav>
|
|
27
|
+
</div>
|
|
28
|
+
}
|
|
29
|
+
|
package/src/utils/mdx.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export type MDXReferenceWrapper<T> = {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
title: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export type MDXReference<T> = T extends object
|
|
9
|
+
? MDXReferenceWrapper<T> & {
|
|
10
|
+
[K in keyof T]: MDXReference<T[K]>;
|
|
11
|
+
}
|
|
12
|
+
: MDXReferenceWrapper<T>;
|
|
13
|
+
|
|
14
|
+
// TODO: unify xyd reference props with react
|
|
15
|
+
export function mdxValue<T>(val: MDXReferenceWrapper<T> | null): string {
|
|
16
|
+
if (!val) {
|
|
17
|
+
return ""
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (val.title) {
|
|
21
|
+
return val.title
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// if we have case like below
|
|
25
|
+
/*
|
|
26
|
+
#### !!<key> <name>
|
|
27
|
+
|
|
28
|
+
!<key> string
|
|
29
|
+
*/
|
|
30
|
+
return val as unknown as string
|
|
31
|
+
}
|