@xyd-js/components 0.1.0-xyd.7 → 0.1.0-xyd.94
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/.idea/git_toolbox_blame.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/.idea/xyd-components.iml +12 -0
- package/CHANGELOG.md +718 -0
- package/LICENSE +21 -0
- package/TODO.md +1 -0
- package/content.ts +0 -2
- package/dist/CTABanner-Bc77pnms.js +2 -0
- package/dist/CTABanner-Bc77pnms.js.map +1 -0
- package/dist/CTABanner-DzO62aGj.js +2 -0
- package/dist/CTABanner-DzO62aGj.js.map +1 -0
- package/dist/CodeSample-BWPDgd2G.js +2 -0
- package/dist/CodeSample-BWPDgd2G.js.map +1 -0
- package/dist/CodeSample-DLnR-knP.js +2 -0
- package/dist/CodeSample-DLnR-knP.js.map +1 -0
- package/dist/HomeView-C8QlNdKh.js +2 -0
- package/dist/HomeView-C8QlNdKh.js.map +1 -0
- package/dist/HomeView-ZAP5saNy.js +2 -0
- package/dist/HomeView-ZAP5saNy.js.map +1 -0
- package/dist/Icon-BESh23UN.js +2 -0
- package/dist/Icon-BESh23UN.js.map +1 -0
- package/dist/Icon-xNucOqd2.js +2 -0
- package/dist/Icon-xNucOqd2.js.map +1 -0
- package/dist/Text-CfN9RkYA.js +2 -0
- package/dist/Text-CfN9RkYA.js.map +1 -0
- package/dist/Text-DKycD2zu.js +2 -0
- package/dist/Text-DKycD2zu.js.map +1 -0
- package/dist/Update-0XruJHjj.js +2 -0
- package/dist/Update-0XruJHjj.js.map +1 -0
- package/dist/Update-DKOAw8p9.js +2 -0
- package/dist/Update-DKOAw8p9.js.map +1 -0
- package/dist/VideoGuide-BUyomFVz.js +2 -0
- package/dist/VideoGuide-BUyomFVz.js.map +1 -0
- package/dist/VideoGuide-B_iUKKv7.js +2 -0
- package/dist/VideoGuide-B_iUKKv7.js.map +1 -0
- package/dist/_rollupPluginBabelHelpers-CxSUtGup.js +4 -0
- package/dist/_rollupPluginBabelHelpers-CxSUtGup.js.map +1 -0
- package/dist/_rollupPluginBabelHelpers-DZ-ucadG.js +4 -0
- package/dist/_rollupPluginBabelHelpers-DZ-ucadG.js.map +1 -0
- package/dist/brand.d.ts +9 -9
- package/dist/brand.js +1 -1
- package/dist/brand.js.map +1 -1
- package/dist/coder/themes/cosmo-light.js.map +1 -1
- package/dist/coder.d.ts +29 -9
- package/dist/coder.js +1 -1
- package/dist/coder.js.map +1 -1
- package/dist/content.d.ts +268 -204
- package/dist/content.js +1 -1
- package/dist/content.js.map +1 -1
- package/dist/index.css +267 -216
- package/dist/layouts.d.ts +20 -21
- package/dist/layouts.js +1 -1
- package/dist/layouts.js.map +1 -1
- package/dist/pages.js +1 -1
- package/dist/pages.js.map +1 -1
- package/dist/system.d.ts +10 -0
- package/dist/system.js +2 -0
- package/dist/system.js.map +1 -0
- package/dist/tslib.es6-DyL9kPq9.js +2 -0
- package/dist/{tslib.es6-DDIOdJiV.js.map → tslib.es6-DyL9kPq9.js.map} +1 -1
- package/dist/tslib.es6-Hqk-Mdr9.js +2 -0
- package/dist/{tslib.es6-DUrRPhZd.js.map → tslib.es6-Hqk-Mdr9.js.map} +1 -1
- package/dist/views.js +1 -1
- package/dist/writer.d.ts +411 -78
- package/dist/writer.js +1 -1
- package/dist/writer.js.map +1 -1
- package/docs/.nojekyll +1 -0
- package/docs/assets/hierarchy.js +1 -0
- package/docs/assets/highlight.css +22 -0
- package/docs/assets/icons.js +18 -0
- package/docs/assets/icons.svg +1 -0
- package/docs/assets/main.js +60 -0
- package/docs/assets/navigation.js +1 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1640 -0
- package/docs/functions/GuideCard.html +6 -0
- package/docs/hierarchy.html +1 -0
- package/docs/index.html +2 -0
- package/docs/interfaces/GuideCardProps.html +18 -0
- package/docs/modules.html +1 -0
- package/index.ts +0 -1
- package/package.json +13 -18
- package/project.json +677 -0
- package/rollup.config.js +32 -3
- package/src/brand/Button/Button.styles.tsx +28 -0
- package/src/brand/Button/Button.tsx +3 -35
- package/src/brand/CTABanner/CTABanner.styles.tsx +80 -0
- package/src/brand/CTABanner/CTABanner.tsx +34 -112
- package/src/brand/Footer/Footer.styles.tsx +18 -0
- package/src/brand/Footer/Footer.tsx +4 -24
- package/src/brand/TODO.md +1 -0
- package/src/coder/Code/Code.styles.tsx +134 -35
- package/src/coder/Code/Code.tsx +131 -40
- package/src/coder/Code/CodeLoader.tsx +4 -4
- package/src/coder/Code/annotations.tsx +28 -8
- package/src/coder/Code/highlight.ts +38 -0
- package/src/coder/Code/index.ts +2 -1
- package/src/coder/CodeCopy/{CodeCopy.style.tsx → CodeCopy.styles.tsx} +6 -6
- package/src/coder/CodeCopy/CodeCopy.tsx +6 -6
- package/src/coder/CodeSample/CodeSample.tsx +83 -27
- package/src/coder/CodeTabs/CodeTabs.styles.tsx +99 -78
- package/src/coder/CodeTabs/CodeTabs.tsx +71 -56
- package/src/coder/CodeTheme/CodeTheme.tsx +89 -49
- package/src/coder/CodeTheme/index.ts +0 -1
- package/src/coder/CoderProvider.tsx +26 -0
- package/src/coder/index.ts +8 -4
- package/src/content/ContentDecoator.styles.tsx +113 -0
- package/src/content/ContentDecorator.tsx +17 -0
- package/src/content/GridDecorator.styles.tsx +67 -0
- package/src/content/GridDecorator.tsx +21 -0
- package/src/content/ReactContent.tsx +575 -0
- package/src/content/index.ts +10 -2
- package/src/icons/index.ts +0 -0
- package/src/kit/Loader/Loader.styles.tsx +53 -0
- package/src/kit/Loader/Loader.tsx +22 -0
- package/src/kit/TODO.md +2 -0
- package/src/kit/index.ts +1 -0
- package/src/layouts/LayoutPrimary/LayoutPrimary.styles.tsx +263 -278
- package/src/layouts/LayoutPrimary/LayoutPrimary.tsx +173 -96
- package/src/layouts/LayoutPrimary/index.ts +0 -2
- package/src/layouts/index.ts +0 -7
- package/src/pages/HomePage/HomePage.styles.tsx +16 -0
- package/src/pages/HomePage/HomePage.tsx +7 -21
- package/src/pages/TODO.md +1 -0
- package/src/system/SearchButton/SearchButton.styles.tsx +86 -0
- package/src/system/SearchButton/SearchButton.tsx +116 -0
- package/src/system/SearchButton/index.ts +1 -0
- package/src/system/index.ts +1 -0
- package/src/utils/useStyle.ts +19 -0
- package/src/views/HomeView/HomeView.styles.tsx +37 -0
- package/src/views/HomeView/HomeView.tsx +5 -45
- package/src/views/TODO.md +1 -0
- package/src/writer/Anchor/Anchor.styles.tsx +11 -0
- package/src/writer/Anchor/Anchor.tsx +51 -0
- package/src/writer/Anchor/index.tsx +1 -0
- package/src/writer/Badge/Badge.styles.tsx +39 -28
- package/src/writer/Badge/Badge.tsx +37 -20
- package/src/writer/Banner/Banner.styles.tsx +91 -0
- package/src/writer/Banner/Banner.tsx +70 -0
- package/src/writer/Banner/index.ts +1 -0
- package/src/writer/Blockquote/Blockquote.styles.tsx +4 -4
- package/src/writer/Blockquote/Blockquote.tsx +6 -3
- package/src/writer/Breadcrumbs/Breadcrumbs.styles.ts +22 -21
- package/src/writer/Breadcrumbs/Breadcrumbs.tsx +19 -13
- package/src/writer/Button/Button.styles.tsx +137 -0
- package/src/writer/Button/Button.tsx +75 -0
- package/src/writer/Button/index.ts +2 -0
- package/src/writer/Callout/Callout.styles.tsx +29 -40
- package/src/writer/Callout/Callout.tsx +31 -16
- package/src/writer/Card/Card.styles.tsx +47 -0
- package/src/writer/Card/Card.tsx +69 -0
- package/src/writer/Card/index.ts +1 -0
- package/src/writer/Code/Code.styles.tsx +10 -11
- package/src/writer/Code/Code.tsx +7 -4
- package/src/writer/ColorSchemeButton/ColorSchemeButton.tsx +172 -0
- package/src/writer/ColorSchemeButton/index.ts +1 -0
- package/src/writer/Details/Details.styles.tsx +84 -84
- package/src/writer/Details/Details.tsx +71 -51
- package/src/writer/Example/index.tsx +5 -0
- package/src/writer/GuideCard/GuideCard.styles.tsx +108 -107
- package/src/writer/GuideCard/GuideCard.tsx +72 -37
- package/src/writer/Heading/Heading.styles.tsx +69 -49
- package/src/writer/Heading/Heading.tsx +92 -22
- package/src/writer/Hr/Hr.styles.tsx +5 -5
- package/src/writer/Hr/Hr.tsx +3 -6
- package/src/writer/Icon/Icon.tsx +48 -0
- package/src/writer/Icon/index.ts +1 -0
- package/src/writer/Image/Image.styles.tsx +9 -0
- package/src/writer/Image/Image.tsx +19 -0
- package/src/writer/Image/index.ts +1 -0
- package/src/writer/List/List.styles.tsx +47 -0
- package/src/writer/List/List.tsx +29 -0
- package/src/writer/List/index.ts +4 -0
- package/src/writer/NavLinks/NavLinks.styles.ts +23 -24
- package/src/writer/NavLinks/NavLinks.tsx +66 -19
- package/src/writer/Pre/Pre.styles.tsx +5 -5
- package/src/writer/Pre/Pre.tsx +4 -3
- package/src/writer/Steps/Steps.styles.tsx +14 -12
- package/src/writer/Steps/Steps.tsx +39 -10
- package/src/writer/Table/Table.styles.tsx +62 -30
- package/src/writer/Table/Table.tsx +121 -11
- package/src/writer/Table/index.ts +0 -11
- package/src/writer/Tabs/Tabs.styles.tsx +63 -70
- package/src/writer/Tabs/Tabs.tsx +31 -29
- package/src/writer/Text/Text.styles.tsx +66 -0
- package/src/writer/Text/Text.tsx +79 -0
- package/src/writer/Text/index.ts +3 -0
- package/src/writer/TocCard/TocCard.module.css +44 -0
- package/src/writer/TocCard/TocCard.tsx +42 -0
- package/src/writer/TocCard/index.ts +3 -0
- package/src/writer/UnderlineNav/Tabs.tsx +51 -0
- package/src/writer/UnderlineNav/TabsPrimary.styles.tsx +184 -0
- package/src/writer/UnderlineNav/TabsPrimary.tsx +209 -0
- package/src/writer/UnderlineNav/TabsSecondary.styles.tsx +77 -0
- package/src/writer/UnderlineNav/TabsSecondary.tsx +171 -0
- package/src/writer/UnderlineNav/UnderlineNav.styles.tsx +181 -45
- package/src/writer/UnderlineNav/UnderlineNav.tsx +258 -23
- package/src/writer/UnderlineNav/index.ts +2 -1
- package/src/writer/UnderlineNav/useValueChange.ts +60 -0
- package/src/writer/Update/Update.styles.tsx +33 -0
- package/src/writer/Update/Update.tsx +37 -0
- package/src/writer/Update/index.ts +1 -0
- package/src/writer/VideoGuide/VideoGuide.module.css +105 -0
- package/src/writer/VideoGuide/VideoGuide.tsx +75 -0
- package/src/writer/VideoGuide/index.ts +1 -0
- package/src/writer/index.ts +23 -1
- package/tsconfig.json +11 -6
- package/types.d.ts +50 -0
- package/writer.ts +1 -1
- package/dist/CTABanner-BrdYlhnD.js +0 -2
- package/dist/CTABanner-BrdYlhnD.js.map +0 -1
- package/dist/CTABanner-XQNnnpUx.js +0 -2
- package/dist/CTABanner-XQNnnpUx.js.map +0 -1
- package/dist/CodeSample-Cp42Adjc.js +0 -2
- package/dist/CodeSample-Cp42Adjc.js.map +0 -1
- package/dist/CodeSample-DxPp80ID.js +0 -2
- package/dist/CodeSample-DxPp80ID.js.map +0 -1
- package/dist/HomeView-BN9mZXh9.js +0 -2
- package/dist/HomeView-BN9mZXh9.js.map +0 -1
- package/dist/HomeView-BVaaV0uE.js +0 -2
- package/dist/HomeView-BVaaV0uE.js.map +0 -1
- package/dist/UnderlineNav-Bs7Ot9Ch.js +0 -2
- package/dist/UnderlineNav-Bs7Ot9Ch.js.map +0 -1
- package/dist/UnderlineNav-C2aEVraN.js +0 -2
- package/dist/UnderlineNav-C2aEVraN.js.map +0 -1
- package/dist/_rollupPluginBabelHelpers-BMmCG_qQ.js +0 -2
- package/dist/_rollupPluginBabelHelpers-BMmCG_qQ.js.map +0 -1
- package/dist/_rollupPluginBabelHelpers-DsEzE6Ab.js +0 -2
- package/dist/_rollupPluginBabelHelpers-DsEzE6Ab.js.map +0 -1
- package/dist/index-BVUz77Tm.js +0 -2
- package/dist/index-BVUz77Tm.js.map +0 -1
- package/dist/index-jxd3nv2J.js +0 -2
- package/dist/index-jxd3nv2J.js.map +0 -1
- package/dist/tslib.es6-DDIOdJiV.js +0 -2
- package/dist/tslib.es6-DUrRPhZd.js +0 -2
- package/src/content/Anchor/Anchor.tsx +0 -63
- package/src/content/Anchor/index.tsx +0 -3
- package/src/content/Content/Content.tsx +0 -21
- package/src/content/Content/index.tsx +0 -3
- package/src/content/Content.tsx +0 -180
- package/src/content/Subtitle/Subtitle.tsx +0 -21
- package/src/content/Subtitle/index.tsx +0 -3
- package/src/layouts/Layout.styles.tsx +0 -151
- package/src/layouts/Layout.tsx +0 -121
- package/src/ui/Loader/Loader.styles.tsx +0 -52
- package/src/ui/Loader/Loader.tsx +0 -26
- package/src/ui/index.ts +0 -1
- package/src/writer/Icon/index.tsx +0 -355
- package/src/writer/Table/TableV2.styles.tsx +0 -117
- package/src/writer/Table/TableV2.tsx +0 -83
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function t(t,n){var e={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.indexOf(r)<0&&(e[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(e[r[o]]=t[r[o]])}return e}function n(t,n,e,r){return new(e||(e=Promise))((function(o,c){function p(t){try{f(r.next(t))}catch(t){c(t)}}function a(t){try{f(r.throw(t))}catch(t){c(t)}}function f(t){var n;t.done?o(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(p,a)}f((r=r.apply(t,n||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;export{t as _,n as a};
|
|
2
|
-
//# sourceMappingURL=tslib.es6-DUrRPhZd.js.map
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import React, {forwardRef} from 'react'
|
|
2
|
-
import type {ComponentProps, ReactElement} from 'react'
|
|
3
|
-
|
|
4
|
-
import {css} from "@linaria/core";
|
|
5
|
-
|
|
6
|
-
const $anchor = {
|
|
7
|
-
host: css`
|
|
8
|
-
color: #7051d4;
|
|
9
|
-
`,
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export type AnchorProps = Omit<ComponentProps<'a'>, 'ref'> & {
|
|
13
|
-
newWindow?: boolean
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// TODO: where react-router?
|
|
17
|
-
|
|
18
|
-
export const Anchor = forwardRef<HTMLAnchorElement, AnchorProps>(function (
|
|
19
|
-
{href = '', children, newWindow},
|
|
20
|
-
// ref is used in <NavbarMenu />
|
|
21
|
-
forwardedRef
|
|
22
|
-
): ReactElement {
|
|
23
|
-
if (newWindow) {
|
|
24
|
-
return (
|
|
25
|
-
<a
|
|
26
|
-
ref={forwardedRef}
|
|
27
|
-
to={href}
|
|
28
|
-
href={href}
|
|
29
|
-
target="_blank"
|
|
30
|
-
rel="noreferrer"
|
|
31
|
-
className={$anchor.host}
|
|
32
|
-
>
|
|
33
|
-
{children}
|
|
34
|
-
</a>
|
|
35
|
-
)
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
if (!href) {
|
|
39
|
-
return (
|
|
40
|
-
<a
|
|
41
|
-
ref={forwardedRef}
|
|
42
|
-
to={href}
|
|
43
|
-
href={href}
|
|
44
|
-
className={$anchor.host}
|
|
45
|
-
>
|
|
46
|
-
{children}
|
|
47
|
-
</a>
|
|
48
|
-
)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return (
|
|
52
|
-
<a
|
|
53
|
-
ref={forwardedRef}
|
|
54
|
-
to={href}
|
|
55
|
-
href={href}
|
|
56
|
-
className={$anchor.host}
|
|
57
|
-
>
|
|
58
|
-
{children}
|
|
59
|
-
</a>
|
|
60
|
-
)
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
Anchor.displayName = 'Anchor'
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
import {css} from "@linaria/core";
|
|
3
|
-
|
|
4
|
-
const $content = {
|
|
5
|
-
host: css`
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: column;
|
|
8
|
-
//align-items: center;
|
|
9
|
-
gap: 24px;
|
|
10
|
-
`
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface ContentProps {
|
|
14
|
-
children: React.ReactNode
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function Content({children}: ContentProps) {
|
|
18
|
-
return <div className={$content.host}>
|
|
19
|
-
{children}
|
|
20
|
-
</div>
|
|
21
|
-
}
|
package/src/content/Content.tsx
DELETED
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
Badge,
|
|
5
|
-
Blockquote,
|
|
6
|
-
Callout,
|
|
7
|
-
Code,
|
|
8
|
-
Details,
|
|
9
|
-
GuideCard,
|
|
10
|
-
Heading,
|
|
11
|
-
Hr,
|
|
12
|
-
Table,
|
|
13
|
-
TableV2,
|
|
14
|
-
Tabs,
|
|
15
|
-
Steps,
|
|
16
|
-
|
|
17
|
-
IconCode,
|
|
18
|
-
IconCustomEvent,
|
|
19
|
-
IconFunnels,
|
|
20
|
-
IconMetrics,
|
|
21
|
-
IconSessionReplay,
|
|
22
|
-
IconAlert,
|
|
23
|
-
IconBrowser,
|
|
24
|
-
IconREST,
|
|
25
|
-
IconGraphQL,
|
|
26
|
-
IconWebhooks,
|
|
27
|
-
IconJSBrowser,
|
|
28
|
-
IconJSNode,
|
|
29
|
-
IconStorybook,
|
|
30
|
-
IconReactRouter,
|
|
31
|
-
IconNextJS,
|
|
32
|
-
IconAppTemplate,
|
|
33
|
-
IconQuote
|
|
34
|
-
} from '../writer'
|
|
35
|
-
import {CodeSample} from "../coder";
|
|
36
|
-
|
|
37
|
-
import {Content as ContentComponent} from "./Content/index";
|
|
38
|
-
import {Subtitle} from "./Subtitle";
|
|
39
|
-
import {Anchor} from "./Anchor";
|
|
40
|
-
|
|
41
|
-
const EXTERNAL_HREF_REGEX = /https?:\/\//
|
|
42
|
-
|
|
43
|
-
const Link = ({href = '', className = "", ...props}) => (
|
|
44
|
-
<Anchor
|
|
45
|
-
href={href}
|
|
46
|
-
newWindow={EXTERNAL_HREF_REGEX.test(href)}
|
|
47
|
-
{...props}
|
|
48
|
-
/>
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
// TODO: options?
|
|
52
|
-
export default function content() {
|
|
53
|
-
return {
|
|
54
|
-
...stdContent(),
|
|
55
|
-
...writerContent(),
|
|
56
|
-
...helperContent(),
|
|
57
|
-
...iconContent(),
|
|
58
|
-
...coderContent(),
|
|
59
|
-
...directiveContent(),
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export function stdContent() {
|
|
64
|
-
return {
|
|
65
|
-
h1: (props) => <div><Heading id={props.children} {...props}/></div>,
|
|
66
|
-
h2: props => <div><Heading id={props.children} size={2} {...props} /></div>,
|
|
67
|
-
h3: props => <div><Heading id={props.children} size={3} {...props} /></div>,
|
|
68
|
-
h4: props => <div><Heading id={props.children} size={4} {...props} /></div>,
|
|
69
|
-
h5: props => <div><Heading id={props.children} size={5} {...props} /></div>,
|
|
70
|
-
h6: props => <div><Heading id={props.children} size={6} {...props} /></div>,
|
|
71
|
-
p: props => <p {...props} />,
|
|
72
|
-
|
|
73
|
-
ul: props => (
|
|
74
|
-
<ul{...props}>
|
|
75
|
-
{props.children}
|
|
76
|
-
</ul>
|
|
77
|
-
),
|
|
78
|
-
ol: props => (
|
|
79
|
-
<ol{...props}
|
|
80
|
-
>
|
|
81
|
-
{props.children}
|
|
82
|
-
</ol>
|
|
83
|
-
),
|
|
84
|
-
li: props => <li {...props} >
|
|
85
|
-
{props.children}
|
|
86
|
-
</li>,
|
|
87
|
-
|
|
88
|
-
table: TableV2,
|
|
89
|
-
tr: TableV2.Tr,
|
|
90
|
-
th: TableV2.Th,
|
|
91
|
-
td: TableV2.Td,
|
|
92
|
-
td: (props) => <TableV2.Td {...props} >
|
|
93
|
-
<TableV2.Cell>
|
|
94
|
-
{props.children}
|
|
95
|
-
</TableV2.Cell>
|
|
96
|
-
</TableV2.Td>,
|
|
97
|
-
|
|
98
|
-
code: Code,
|
|
99
|
-
pre: props => {
|
|
100
|
-
const lang = (props?.children?.props?.className || "").replace("language-", "") // TODO: better solution
|
|
101
|
-
|
|
102
|
-
return <CodeSample
|
|
103
|
-
name={lang}
|
|
104
|
-
description={props?.children?.props?.meta}
|
|
105
|
-
codeblocks={[
|
|
106
|
-
{
|
|
107
|
-
value: props?.children?.props?.children,
|
|
108
|
-
lang: lang,
|
|
109
|
-
meta: lang,
|
|
110
|
-
}
|
|
111
|
-
]}
|
|
112
|
-
size="full" // TODO: in the future configurable
|
|
113
|
-
/>
|
|
114
|
-
},
|
|
115
|
-
details: Details,
|
|
116
|
-
blockquote: Blockquote,
|
|
117
|
-
|
|
118
|
-
hr: Hr,
|
|
119
|
-
a: Link,
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
export function writerContent() {
|
|
124
|
-
return {
|
|
125
|
-
Callout,
|
|
126
|
-
Details,
|
|
127
|
-
GuideCard,
|
|
128
|
-
Steps,
|
|
129
|
-
Tabs,
|
|
130
|
-
Table: TableV2,
|
|
131
|
-
Badge,
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
export function directiveContent() {
|
|
136
|
-
return {
|
|
137
|
-
// TODO: deprecate?
|
|
138
|
-
DirectiveCodeSample: (props) => {
|
|
139
|
-
return <CodeSample
|
|
140
|
-
{...props}
|
|
141
|
-
codeblocks={JSON.parse(props.codeblocks)}
|
|
142
|
-
/>
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
export function helperContent() {
|
|
148
|
-
return {
|
|
149
|
-
Content: ContentComponent,
|
|
150
|
-
Subtitle
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
export function iconContent() {
|
|
155
|
-
return {
|
|
156
|
-
IconSessionReplay,
|
|
157
|
-
IconMetrics,
|
|
158
|
-
IconFunnels,
|
|
159
|
-
IconCode,
|
|
160
|
-
IconCustomEvent,
|
|
161
|
-
IconAlert,
|
|
162
|
-
IconBrowser,
|
|
163
|
-
IconREST,
|
|
164
|
-
IconGraphQL,
|
|
165
|
-
IconWebhooks,
|
|
166
|
-
IconJSBrowser,
|
|
167
|
-
IconJSNode,
|
|
168
|
-
IconStorybook,
|
|
169
|
-
IconReactRouter,
|
|
170
|
-
IconNextJS,
|
|
171
|
-
IconAppTemplate,
|
|
172
|
-
IconQuote,
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
export function coderContent() {
|
|
177
|
-
return {
|
|
178
|
-
CodeSample,
|
|
179
|
-
}
|
|
180
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
import {css} from "@linaria/core";
|
|
3
|
-
|
|
4
|
-
const cn = {
|
|
5
|
-
Host: css`
|
|
6
|
-
margin-top: -18px;
|
|
7
|
-
font-size: 18px;
|
|
8
|
-
color: #6e6e80;
|
|
9
|
-
font-weight: 300;
|
|
10
|
-
`
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface SubtitleProps {
|
|
14
|
-
children: React.ReactNode
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function Subtitle({children}: SubtitleProps) {
|
|
18
|
-
return <div className={cn.Host}>
|
|
19
|
-
{children}
|
|
20
|
-
</div>
|
|
21
|
-
}
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import {css} from "@linaria/core";
|
|
2
|
-
|
|
3
|
-
const globalPageGutter = '8px';
|
|
4
|
-
export const globalHeaderHeight = '46px';
|
|
5
|
-
const globalHeaderWarningHeight = "0px";
|
|
6
|
-
const contentTopSpace = "12px";
|
|
7
|
-
|
|
8
|
-
const globalHeaderHeightWithSub = '90px';
|
|
9
|
-
|
|
10
|
-
const cubicMove = "cubic-bezier(.65, 0, .35, 1)";
|
|
11
|
-
const sidebarWidth = "210px";
|
|
12
|
-
|
|
13
|
-
// TODO: better solution - design tokens
|
|
14
|
-
export const globals = css`
|
|
15
|
-
:global() {
|
|
16
|
-
:root {
|
|
17
|
-
--xyd-navbar-height: ${globalHeaderHeight};
|
|
18
|
-
--xyd-global-page-gutter: ${globalPageGutter};
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
`;
|
|
22
|
-
|
|
23
|
-
export const $layout = {
|
|
24
|
-
host: css`
|
|
25
|
-
width: 100%;
|
|
26
|
-
`,
|
|
27
|
-
header: css`
|
|
28
|
-
display: flex;
|
|
29
|
-
justify-content: space-between;
|
|
30
|
-
align-items: center;
|
|
31
|
-
|
|
32
|
-
position: fixed;
|
|
33
|
-
top: ${globalHeaderWarningHeight};
|
|
34
|
-
right: ${globalPageGutter};
|
|
35
|
-
left: ${globalPageGutter};
|
|
36
|
-
|
|
37
|
-
height: ${globalHeaderHeight};
|
|
38
|
-
`,
|
|
39
|
-
header$$sub: css`
|
|
40
|
-
flex-direction: column;
|
|
41
|
-
height: ${globalHeaderHeightWithSub};
|
|
42
|
-
transition: transform 200ms;
|
|
43
|
-
`,
|
|
44
|
-
header$$hideMain: css`
|
|
45
|
-
transform: translateY(calc(-${globalHeaderHeight} + 3px));
|
|
46
|
-
`,
|
|
47
|
-
main: css`
|
|
48
|
-
position: fixed;
|
|
49
|
-
top: calc(${globalHeaderHeight} + ${globalHeaderWarningHeight});
|
|
50
|
-
bottom: ${globalPageGutter};
|
|
51
|
-
left: ${globalPageGutter};
|
|
52
|
-
right: ${globalPageGutter};
|
|
53
|
-
}`,
|
|
54
|
-
main$$sub: css`
|
|
55
|
-
top: calc(${globalHeaderHeightWithSub} + ${globalHeaderWarningHeight});
|
|
56
|
-
transition: top 200ms;
|
|
57
|
-
`,
|
|
58
|
-
sidebar: css`
|
|
59
|
-
flex-direction: column;
|
|
60
|
-
position: absolute;
|
|
61
|
-
top: 0;
|
|
62
|
-
left: 0;
|
|
63
|
-
bottom: 0;
|
|
64
|
-
right: 0;
|
|
65
|
-
z-index: 101;
|
|
66
|
-
width: ${sidebarWidth};
|
|
67
|
-
border: 0;
|
|
68
|
-
padding: ${contentTopSpace} 0 0;
|
|
69
|
-
overflow: visible;
|
|
70
|
-
background: none;
|
|
71
|
-
border-radius: 0;
|
|
72
|
-
opacity: 1;
|
|
73
|
-
visibility: visible;
|
|
74
|
-
transition: opacity .3s ${cubicMove};
|
|
75
|
-
`,
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export const $page = {
|
|
79
|
-
host: css`
|
|
80
|
-
position: absolute;
|
|
81
|
-
top: ${contentTopSpace};
|
|
82
|
-
right: 0;
|
|
83
|
-
bottom: 0;
|
|
84
|
-
z-index: 201;
|
|
85
|
-
background: #fff;
|
|
86
|
-
|
|
87
|
-
//border-radius: 8px;
|
|
88
|
-
//border: 1px solid #ececf1;
|
|
89
|
-
|
|
90
|
-
overflow: hidden;
|
|
91
|
-
transition: opacity .3s ${cubicMove};
|
|
92
|
-
|
|
93
|
-
left: ${sidebarWidth};
|
|
94
|
-
`,
|
|
95
|
-
scroll: css`
|
|
96
|
-
//position: absolute;
|
|
97
|
-
//top: 0;
|
|
98
|
-
//right: 0;
|
|
99
|
-
//bottom: 0;
|
|
100
|
-
//left: 0;
|
|
101
|
-
//overflow: auto;
|
|
102
|
-
|
|
103
|
-
overflow: scroll;
|
|
104
|
-
height: 100%;
|
|
105
|
-
|
|
106
|
-
`,
|
|
107
|
-
container: css`
|
|
108
|
-
padding: 0;
|
|
109
|
-
width: 100%;
|
|
110
|
-
//position: relative; TODO: unset if during client render?
|
|
111
|
-
min-height: 100%;
|
|
112
|
-
|
|
113
|
-
max-width: 100%;
|
|
114
|
-
margin: 0 auto;
|
|
115
|
-
font-size: 15px;
|
|
116
|
-
line-height: 24px;
|
|
117
|
-
`,
|
|
118
|
-
articleContainer: css`
|
|
119
|
-
width: 980px;
|
|
120
|
-
padding: 40px 56px;
|
|
121
|
-
padding-top: 20px;
|
|
122
|
-
max-width: 100%;
|
|
123
|
-
margin: 0 auto;
|
|
124
|
-
`,
|
|
125
|
-
articleContainer$$fullWidth: css`
|
|
126
|
-
width: 1200px;
|
|
127
|
-
`,
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
export const $article = {
|
|
132
|
-
host: css`
|
|
133
|
-
display: flex;
|
|
134
|
-
gap: 30px;
|
|
135
|
-
width: 100%;
|
|
136
|
-
align-items: flex-start;;
|
|
137
|
-
`,
|
|
138
|
-
content: css`
|
|
139
|
-
flex: 1 1 0;
|
|
140
|
-
overflow: hidden;
|
|
141
|
-
`,
|
|
142
|
-
nav: css`
|
|
143
|
-
position: sticky;
|
|
144
|
-
top: 30px;
|
|
145
|
-
width: 180px;
|
|
146
|
-
margin-top: 0;
|
|
147
|
-
margin-left: 50px;
|
|
148
|
-
padding-left: 16px;
|
|
149
|
-
flex: none;
|
|
150
|
-
`
|
|
151
|
-
}
|
package/src/layouts/Layout.tsx
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import React, {useEffect, useState} from "react"
|
|
2
|
-
|
|
3
|
-
import {$layout, $page, $article, globalHeaderHeight} from "./Layout.styles"
|
|
4
|
-
|
|
5
|
-
export interface LayoutProps {
|
|
6
|
-
header: React.ReactNode;
|
|
7
|
-
aside: React.ReactNode;
|
|
8
|
-
content: React.ReactNode;
|
|
9
|
-
contentNav: React.ReactNode;
|
|
10
|
-
subheader?: boolean;
|
|
11
|
-
kind?: "fullwidth"
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function Layout(props: LayoutProps) {
|
|
15
|
-
const [hideMainHeader, setHideMainHeader] = useState(false)
|
|
16
|
-
const [scrollTop, setScrollTop] = useState(0)
|
|
17
|
-
const [controlScrollPos, setControlScrollPos] = useState(0)
|
|
18
|
-
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
if (scrollTop === controlScrollPos) {
|
|
21
|
-
return
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const checkpoint = parseInt(globalHeaderHeight, 10) / 2
|
|
25
|
-
const diff = scrollTop - controlScrollPos
|
|
26
|
-
const reversePosDiff = Math.abs(scrollTop - controlScrollPos)
|
|
27
|
-
|
|
28
|
-
if (diff > checkpoint) {
|
|
29
|
-
setHideMainHeader(true)
|
|
30
|
-
} else if (reversePosDiff > checkpoint) {
|
|
31
|
-
setHideMainHeader(false)
|
|
32
|
-
}
|
|
33
|
-
}, [
|
|
34
|
-
scrollTop,
|
|
35
|
-
controlScrollPos,
|
|
36
|
-
]);
|
|
37
|
-
|
|
38
|
-
function onScroll(e: Event) {
|
|
39
|
-
if (!(e.target instanceof HTMLElement)) {
|
|
40
|
-
return
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const scroll = e.target?.scrollTop
|
|
44
|
-
setScrollTop(scroll)
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function onScrollFinish(e: Event) {
|
|
48
|
-
if (!(e.target instanceof HTMLElement)) {
|
|
49
|
-
return
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
setControlScrollPos(e.target?.scrollTop)
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// TODO: by ref?
|
|
56
|
-
// TODO: MOVE SOMEWHERE ELSE BECAUSE IT DECREASE PERFORMANCE (RERENDER)
|
|
57
|
-
useEffect(() => {
|
|
58
|
-
// return // TODO: UNCOMMENT
|
|
59
|
-
|
|
60
|
-
if (!props.subheader) {
|
|
61
|
-
return
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
document.querySelector(`.${$page.scroll}`)?.addEventListener("scroll", onScroll)
|
|
65
|
-
document.querySelector(`.${$page.scroll}`)?.addEventListener("scrollend", onScrollFinish)
|
|
66
|
-
|
|
67
|
-
return () => {
|
|
68
|
-
document.querySelector(`.${$page.scroll}`)?.removeEventListener("scroll", onScroll)
|
|
69
|
-
document.querySelector(`.${$page.scroll}`)?.removeEventListener("scrollend", onScrollFinish)
|
|
70
|
-
}
|
|
71
|
-
}, []);
|
|
72
|
-
|
|
73
|
-
return <div className={$layout.host}>
|
|
74
|
-
<Layout.Header className={`
|
|
75
|
-
${props.subheader && $layout.header$$sub}
|
|
76
|
-
${hideMainHeader && $layout.header$$hideMain}
|
|
77
|
-
`}>
|
|
78
|
-
{props.header}
|
|
79
|
-
</Layout.Header>
|
|
80
|
-
<main className={`
|
|
81
|
-
${$layout.main}
|
|
82
|
-
${!hideMainHeader && props.subheader && $layout.main$$sub}
|
|
83
|
-
`}>
|
|
84
|
-
<aside className={$layout.sidebar}>
|
|
85
|
-
{props.aside}
|
|
86
|
-
</aside>
|
|
87
|
-
<div className={$page.host}>
|
|
88
|
-
<div className={$page.scroll}>
|
|
89
|
-
<div className={$page.container}>
|
|
90
|
-
<div className={`
|
|
91
|
-
${$page.articleContainer}
|
|
92
|
-
${props.kind == "fullwidth" && $page.articleContainer$$fullWidth}
|
|
93
|
-
`}>
|
|
94
|
-
<article className={$article.host}>
|
|
95
|
-
<section className={$article.content}>
|
|
96
|
-
{props.content}
|
|
97
|
-
</section>
|
|
98
|
-
{
|
|
99
|
-
props.contentNav && <nav className={`
|
|
100
|
-
${$article.nav}
|
|
101
|
-
`}>
|
|
102
|
-
{props.contentNav}
|
|
103
|
-
</nav>
|
|
104
|
-
}
|
|
105
|
-
</article>
|
|
106
|
-
</div>
|
|
107
|
-
</div>
|
|
108
|
-
</div>
|
|
109
|
-
</div>
|
|
110
|
-
</main>
|
|
111
|
-
</div>
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
Layout.Header = function LayoutHeader({className, children}: { className?: string, children: React.ReactNode }) {
|
|
115
|
-
return <header className={`
|
|
116
|
-
${$layout.header}
|
|
117
|
-
${className}
|
|
118
|
-
`}>
|
|
119
|
-
{children}
|
|
120
|
-
</header>
|
|
121
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import {css} from "@linaria/core";
|
|
2
|
-
|
|
3
|
-
export const $loader = {
|
|
4
|
-
host: css`
|
|
5
|
-
display: inline-flex;
|
|
6
|
-
align-items: center;
|
|
7
|
-
justify-content: center;
|
|
8
|
-
`,
|
|
9
|
-
dots: css`
|
|
10
|
-
display: flex;
|
|
11
|
-
gap: 4px;
|
|
12
|
-
`,
|
|
13
|
-
dot: css`
|
|
14
|
-
width: 8px;
|
|
15
|
-
height: 8px;
|
|
16
|
-
background-color: currentColor;
|
|
17
|
-
border-radius: 50%;
|
|
18
|
-
animation: pulse 1.4s infinite ease-in-out;
|
|
19
|
-
opacity: 0.6;
|
|
20
|
-
|
|
21
|
-
&:nth-of-type(2) {
|
|
22
|
-
animation-delay: 0.2s;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
&:nth-of-type(3) {
|
|
26
|
-
animation-delay: 0.4s;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
@keyframes pulse {
|
|
30
|
-
0%, 80%, 100% {
|
|
31
|
-
transform: scale(0.6);
|
|
32
|
-
opacity: 0.4;
|
|
33
|
-
}
|
|
34
|
-
40% {
|
|
35
|
-
transform: scale(1);
|
|
36
|
-
opacity: 1;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
`,
|
|
40
|
-
$$small: css`
|
|
41
|
-
.${$loader.dot} {
|
|
42
|
-
width: 6px;
|
|
43
|
-
height: 6px;
|
|
44
|
-
}
|
|
45
|
-
`,
|
|
46
|
-
$$large: css`
|
|
47
|
-
.${$loader.dot} {
|
|
48
|
-
width: 12px;
|
|
49
|
-
height: 12px;
|
|
50
|
-
}
|
|
51
|
-
`
|
|
52
|
-
}
|
package/src/ui/Loader/Loader.tsx
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import {$loader} from "./Loader.styles.tsx";
|
|
3
|
-
|
|
4
|
-
export interface LoaderProps {
|
|
5
|
-
size?: "small" | "medium" | "large";
|
|
6
|
-
className?: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function Loader({ size = "medium", className }: LoaderProps) {
|
|
10
|
-
return (
|
|
11
|
-
<div
|
|
12
|
-
className={`
|
|
13
|
-
${$loader.host}
|
|
14
|
-
${size === "small" && $loader.$$small}
|
|
15
|
-
${size === "large" && $loader.$$large}
|
|
16
|
-
${className}
|
|
17
|
-
`}
|
|
18
|
-
>
|
|
19
|
-
<div className={$loader.dots}>
|
|
20
|
-
<div className={$loader.dot} />
|
|
21
|
-
<div className={$loader.dot} />
|
|
22
|
-
<div className={$loader.dot} />
|
|
23
|
-
</div>
|
|
24
|
-
</div>
|
|
25
|
-
);
|
|
26
|
-
}
|
package/src/ui/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Loader/Loader";
|