@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
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React, {createContext, ReactElement, SVGProps, use} from "react";
|
|
2
|
+
import parse from 'html-react-parser';
|
|
3
|
+
|
|
4
|
+
// TODO: html-react-parser is not the best choice, but it works for now
|
|
5
|
+
|
|
6
|
+
export const IconProvider = createContext({
|
|
7
|
+
iconSet: {}
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
interface IconProps {
|
|
11
|
+
name: string;
|
|
12
|
+
size?: number;
|
|
13
|
+
color?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function Icon(props: IconProps): ReactElement | null {
|
|
17
|
+
const {name, size = 24, color} = props
|
|
18
|
+
|
|
19
|
+
const iconProvider = use(IconProvider)
|
|
20
|
+
const iconSet = iconProvider?.iconSet
|
|
21
|
+
|
|
22
|
+
if (!iconSet) {
|
|
23
|
+
return null
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const ico = iconSet[name]
|
|
27
|
+
if (!ico || !ico.svg) {
|
|
28
|
+
return null
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const icon = parse(ico.svg) as ReactElement<SVGProps<SVGSVGElement>>
|
|
32
|
+
if (React.isValidElement(icon)) {
|
|
33
|
+
return React.cloneElement(icon, {
|
|
34
|
+
width: size,
|
|
35
|
+
height: size,
|
|
36
|
+
color: color || icon.props.color || 'currentColor',
|
|
37
|
+
style: {
|
|
38
|
+
width: size,
|
|
39
|
+
height: size,
|
|
40
|
+
color: color || icon.props.color || 'currentColor',
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return null
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Icon"
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
import * as cn from "./Image.styles"
|
|
6
|
+
|
|
7
|
+
export interface ImageProps {
|
|
8
|
+
src: string
|
|
9
|
+
alt: string
|
|
10
|
+
style?: React.CSSProperties
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function Image(props: ImageProps) {
|
|
14
|
+
return <img
|
|
15
|
+
src={props.src}
|
|
16
|
+
alt={props.alt}
|
|
17
|
+
className={cn.ImageHost}
|
|
18
|
+
/>
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Image } from "./Image"
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { css } from '@linaria/core'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
List: css`
|
|
5
|
+
@layer defaults {
|
|
6
|
+
list-style: none;
|
|
7
|
+
margin: 0;
|
|
8
|
+
padding: 0;
|
|
9
|
+
|
|
10
|
+
ol& {
|
|
11
|
+
list-style-type: decimal;
|
|
12
|
+
padding-inline-start: 1.625em;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
`,
|
|
16
|
+
Item: css`
|
|
17
|
+
@layer defaults {
|
|
18
|
+
ul & {
|
|
19
|
+
margin-bottom: 0.5rem;
|
|
20
|
+
position: relative;
|
|
21
|
+
padding-inline-start: .375em;
|
|
22
|
+
padding-left: 2em !important;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* TODO: IN THE FUTURE BETTER SOLUTION IS NEEDED */
|
|
26
|
+
xyd-grid-decorator ul & {
|
|
27
|
+
padding-left: 0 !important;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
ul &::before {
|
|
31
|
+
content: "";
|
|
32
|
+
width: .375em;
|
|
33
|
+
height: .375em;
|
|
34
|
+
position: absolute;
|
|
35
|
+
top: 0.5em;
|
|
36
|
+
left: .5em;
|
|
37
|
+
border-radius: 50%;
|
|
38
|
+
background-color: var(--xyd-list-item-bgcolor);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
ol &::marker {
|
|
42
|
+
padding-inline-start: .375em;
|
|
43
|
+
color: var(--xyd-list-marker-color);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
`
|
|
47
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
|
|
3
|
+
import cn from "./List.styles";
|
|
4
|
+
|
|
5
|
+
export interface ListProps {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function List({ children }: ListProps) {
|
|
10
|
+
return <ul className={cn.List}>
|
|
11
|
+
{children}
|
|
12
|
+
</ul>
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function ListOl({ children }: ListProps) {
|
|
16
|
+
return <ol className={cn.List}>
|
|
17
|
+
{children}
|
|
18
|
+
</ol>
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface ListItemProps {
|
|
22
|
+
children: React.ReactNode;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function ListItem({ children }: ListItemProps) {
|
|
26
|
+
return <li className={cn.Item}>{children}</li>
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
List.Item = ListItem;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import {css} from "@linaria/core";
|
|
2
2
|
|
|
3
|
-
export const
|
|
4
|
-
|
|
3
|
+
export const NavLinksHost = css`
|
|
4
|
+
@layer defaults {
|
|
5
|
+
font-weight: var(--xyd-font-weight-semibold);
|
|
5
6
|
display: flex;
|
|
6
7
|
padding-top: 2rem;
|
|
7
8
|
margin-top: 2rem;
|
|
@@ -9,25 +10,23 @@ export const $navLinks = {
|
|
|
9
10
|
justify-content: space-between;
|
|
10
11
|
align-items: center;
|
|
11
12
|
border-top-width: 1px;
|
|
12
|
-
border-color:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
`,
|
|
33
|
-
};
|
|
13
|
+
border-color: var(--xyd-navlinks-border-color);
|
|
14
|
+
|
|
15
|
+
[part="link"] {
|
|
16
|
+
display: flex;
|
|
17
|
+
gap: 8px;
|
|
18
|
+
align-items: center;
|
|
19
|
+
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
|
|
20
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
21
|
+
transition-duration: 300ms;
|
|
22
|
+
max-width: 50%;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
[part="icon"] {
|
|
26
|
+
display: inline;
|
|
27
|
+
height: 1.25rem;
|
|
28
|
+
flex-shrink: 0;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import React from "react"
|
|
2
|
-
import {ArrowLeftIcon, ArrowRightIcon} from '@radix-ui/react-icons'
|
|
3
2
|
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
function Anchor({children, ...rest}) {
|
|
7
|
-
return <a {...rest}>
|
|
8
|
-
{children}
|
|
9
|
-
</a>
|
|
10
|
-
}
|
|
3
|
+
import * as cn from "./NavLinks.styles";
|
|
11
4
|
|
|
12
5
|
export interface NavLinksProps {
|
|
13
6
|
prev?: {
|
|
@@ -18,31 +11,85 @@ export interface NavLinksProps {
|
|
|
18
11
|
title: string
|
|
19
12
|
href: string
|
|
20
13
|
}
|
|
14
|
+
|
|
15
|
+
as?: React.ElementType
|
|
16
|
+
|
|
17
|
+
className?: string
|
|
21
18
|
}
|
|
22
19
|
|
|
23
|
-
export function NavLinks(
|
|
20
|
+
export function NavLinks(
|
|
21
|
+
props: NavLinksProps
|
|
22
|
+
) {
|
|
23
|
+
const Link = props.as || $Anchor
|
|
24
|
+
|
|
24
25
|
return (
|
|
25
|
-
<
|
|
26
|
+
<xyd-navlinks
|
|
27
|
+
className={`${cn.NavLinksHost} ${props.className || ""}`}
|
|
28
|
+
>
|
|
26
29
|
{props.prev ? (
|
|
27
|
-
<
|
|
30
|
+
<Link
|
|
28
31
|
href={props.prev.href}
|
|
29
32
|
title={props.prev.title}
|
|
30
|
-
|
|
33
|
+
part="link"
|
|
31
34
|
>
|
|
32
|
-
|
|
35
|
+
<$ArrowLeftIcon part="icon"/>
|
|
33
36
|
{props.prev.title}
|
|
34
|
-
</
|
|
37
|
+
</Link>
|
|
35
38
|
) : <div/>}
|
|
36
39
|
{props.next && (
|
|
37
|
-
<
|
|
40
|
+
<Link
|
|
38
41
|
href={props.next.href}
|
|
39
42
|
title={props.next.title}
|
|
40
|
-
|
|
43
|
+
part="link"
|
|
41
44
|
>
|
|
42
45
|
{props.next.title}
|
|
43
|
-
|
|
44
|
-
</
|
|
46
|
+
<$ArrowRightIcon part="icon"/>
|
|
47
|
+
</Link>
|
|
45
48
|
)}
|
|
46
|
-
</
|
|
49
|
+
</xyd-navlinks>
|
|
47
50
|
)
|
|
48
51
|
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
function $Anchor({children, ...rest}) {
|
|
55
|
+
return <a {...rest}>
|
|
56
|
+
{children}
|
|
57
|
+
</a>
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
function $ArrowRightIcon(props: React.SVGProps<SVGSVGElement>) {
|
|
62
|
+
return <svg
|
|
63
|
+
width={15}
|
|
64
|
+
height={15}
|
|
65
|
+
viewBox="0 0 15 15"
|
|
66
|
+
fill="none"
|
|
67
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
68
|
+
{...props}
|
|
69
|
+
>
|
|
70
|
+
<path
|
|
71
|
+
d="M8.14645 3.14645C8.34171 2.95118 8.65829 2.95118 8.85355 3.14645L12.8536 7.14645C13.0488 7.34171 13.0488 7.65829 12.8536 7.85355L8.85355 11.8536C8.65829 12.0488 8.34171 12.0488 8.14645 11.8536C7.95118 11.6583 7.95118 11.3417 8.14645 11.1464L11.2929 8H2.5C2.22386 8 2 7.77614 2 7.5C2 7.22386 2.22386 7 2.5 7H11.2929L8.14645 3.85355C7.95118 3.65829 7.95118 3.34171 8.14645 3.14645Z"
|
|
72
|
+
fill="currentColor"
|
|
73
|
+
fillRule="evenodd"
|
|
74
|
+
clipRule="evenodd"
|
|
75
|
+
/>
|
|
76
|
+
</svg>
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function $ArrowLeftIcon(props: React.SVGProps<SVGSVGElement>) {
|
|
80
|
+
return <svg
|
|
81
|
+
width={15}
|
|
82
|
+
height={15}
|
|
83
|
+
viewBox="0 0 15 15"
|
|
84
|
+
fill="none"
|
|
85
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
86
|
+
{...props}
|
|
87
|
+
>
|
|
88
|
+
<path
|
|
89
|
+
d="M6.85355 3.14645C7.04882 3.34171 7.04882 3.65829 6.85355 3.85355L3.70711 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H3.70711L6.85355 11.1464C7.04882 11.3417 7.04882 11.6583 6.85355 11.8536C6.65829 12.0488 6.34171 12.0488 6.14645 11.8536L2.14645 7.85355C1.95118 7.65829 1.95118 7.34171 2.14645 7.14645L6.14645 3.14645C6.34171 2.95118 6.65829 2.95118 6.85355 3.14645Z"
|
|
90
|
+
fill="currentColor"
|
|
91
|
+
fillRule="evenodd"
|
|
92
|
+
clipRule="evenodd"
|
|
93
|
+
/>
|
|
94
|
+
</svg>
|
|
95
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {css} from "@linaria/core";
|
|
2
2
|
|
|
3
|
-
export const
|
|
4
|
-
|
|
3
|
+
export const PreHost = css`
|
|
4
|
+
@layer defaults {
|
|
5
5
|
margin-top: 0;
|
|
6
6
|
border-radius: 6px;
|
|
7
7
|
padding: 16px;
|
|
8
8
|
border: 0;
|
|
9
9
|
|
|
10
|
-
background-color:
|
|
10
|
+
background-color: var(--xyd-pre-bgcolor);
|
|
11
11
|
overflow: auto;
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
}
|
|
13
|
+
`;
|
package/src/writer/Pre/Pre.tsx
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import * as cn from "./Pre.styles"
|
|
4
4
|
|
|
5
5
|
export interface PreProps {
|
|
6
6
|
children: React.ReactNode
|
|
7
|
+
className?: string
|
|
7
8
|
}
|
|
8
9
|
|
|
9
|
-
export function Pre({children}: PreProps) {
|
|
10
|
-
return <pre className={
|
|
10
|
+
export function Pre({ children, className }: PreProps) {
|
|
11
|
+
return <pre className={`${cn.PreHost} ${className || ""}`}>
|
|
11
12
|
{children}
|
|
12
13
|
</pre>
|
|
13
14
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {css} from "@linaria/core";
|
|
2
2
|
|
|
3
|
-
export const
|
|
4
|
-
|
|
3
|
+
export const StepsHost = css`
|
|
4
|
+
@layer defaults {
|
|
5
5
|
padding-left: 0;
|
|
6
6
|
list-style: none;
|
|
7
7
|
counter-reset: ordered-listitem;
|
|
@@ -9,11 +9,13 @@ export const $steps = {
|
|
|
9
9
|
display: flex;
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
gap: 6px;
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
export const StepsLi = css`
|
|
16
|
+
@layer defaults {
|
|
14
17
|
padding-left: 32px;
|
|
15
18
|
position: relative;
|
|
16
|
-
line-height: 1.5;
|
|
17
19
|
|
|
18
20
|
&::after {
|
|
19
21
|
position: absolute;
|
|
@@ -22,15 +24,15 @@ export const $steps = {
|
|
|
22
24
|
counter-increment: ordered-listitem;
|
|
23
25
|
content: counter(ordered-listitem);
|
|
24
26
|
|
|
25
|
-
background:
|
|
26
|
-
color:
|
|
27
|
-
font-size:
|
|
28
|
-
line-height:
|
|
29
|
-
font-weight:
|
|
27
|
+
background: var(--xyd-steps-marker-bgcolor);
|
|
28
|
+
color: var(--xyd-steps-marker-color);
|
|
29
|
+
font-size: var(--xyd-font-size-xsmall);
|
|
30
|
+
line-height: var(--xyd-line-height-medium);
|
|
31
|
+
font-weight: var(--xyd-font-weight-medium);
|
|
30
32
|
text-align: center;
|
|
31
33
|
height: 24px;
|
|
32
34
|
width: 24px;
|
|
33
35
|
border-radius: 12px;
|
|
34
36
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
@@ -1,24 +1,53 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import * as cn from "./Steps.styles";
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Props for the Steps component
|
|
7
|
+
*/
|
|
5
8
|
export interface StepsProps {
|
|
9
|
+
/** Content to be rendered inside the steps list */
|
|
6
10
|
children: React.ReactNode;
|
|
7
|
-
}
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
</ol>
|
|
12
|
+
/** Optional CSS class name to be applied to the steps container */
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
13
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Steps component that renders a numbered list of steps or stages.
|
|
18
|
+
* Use this component to display a sequence of steps in a process or workflow.
|
|
19
|
+
*
|
|
20
|
+
* @category Component
|
|
21
|
+
*/
|
|
22
|
+
export function Steps({ children, className }: StepsProps) {
|
|
23
|
+
return <xyd-steps>
|
|
24
|
+
<ol className={`${cn.StepsHost} ${className || ""}`}>
|
|
25
|
+
{children}
|
|
26
|
+
</ol>
|
|
27
|
+
</xyd-steps>
|
|
14
28
|
}
|
|
15
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Props for the Steps.Item component
|
|
32
|
+
*/
|
|
16
33
|
export interface StepsItemProps {
|
|
34
|
+
/** Content to be rendered inside the step item */
|
|
17
35
|
children: React.ReactNode;
|
|
36
|
+
|
|
37
|
+
/** Optional CSS class name to be applied to the step item */
|
|
38
|
+
className?: string;
|
|
18
39
|
}
|
|
19
40
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Individual step item component that represents a single step in the sequence.
|
|
43
|
+
* This component should be used as a child of the Steps component.
|
|
44
|
+
*
|
|
45
|
+
* @category Component
|
|
46
|
+
*/
|
|
47
|
+
Steps.Item = function StepsItem({ children, className }: StepsItemProps) {
|
|
48
|
+
return <xyd-steps-item>
|
|
49
|
+
<li className={`${cn.StepsLi} ${className || ""}`}>
|
|
50
|
+
{children}
|
|
51
|
+
</li>
|
|
52
|
+
</xyd-steps-item>
|
|
24
53
|
}
|
|
@@ -1,39 +1,71 @@
|
|
|
1
1
|
import {css} from "@linaria/core";
|
|
2
2
|
|
|
3
|
-
const colors = {
|
|
4
|
-
primary: "#D1D5DB"
|
|
5
|
-
}
|
|
6
3
|
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
export default {
|
|
5
|
+
Host: css`
|
|
6
|
+
@layer defaults {
|
|
7
|
+
display: table;
|
|
8
|
+
width: 100%;
|
|
9
|
+
min-width: 640px; // Ensures table doesn't get too squished
|
|
10
|
+
border-collapse: separate;
|
|
11
|
+
border-spacing: 0;
|
|
12
|
+
border: 1px solid var(--xyd-table-border-color);
|
|
13
|
+
border-radius: 8px;
|
|
14
|
+
margin-top: 1rem;
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
}
|
|
14
17
|
`,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
Thead: css`
|
|
19
|
+
@layer defaults {
|
|
20
|
+
background: var(--xyd-table-bgcolor);
|
|
21
|
+
}
|
|
22
|
+
`,
|
|
23
|
+
Tbody: css`
|
|
24
|
+
|
|
25
|
+
`,
|
|
26
|
+
Th: css`
|
|
27
|
+
@layer defaults {
|
|
28
|
+
text-align: left;
|
|
29
|
+
font-weight: var(--xyd-font-weight-medium);
|
|
30
|
+
padding: 0.5rem 1rem;
|
|
31
|
+
white-space: nowrap;
|
|
32
|
+
vertical-align: middle;
|
|
33
|
+
color: var(--xyd-table-color);
|
|
34
|
+
border-bottom: 1px solid var(--xyd-table-border-color);
|
|
35
|
+
border-right: 1px solid var(--xyd-table-border-color);
|
|
36
|
+
}
|
|
23
37
|
`,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
38
|
+
Tr: css`
|
|
39
|
+
@layer defaults {
|
|
40
|
+
&:not(:last-child) {
|
|
41
|
+
border-bottom: 1px solid var(--xyd-table-border-color);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
29
44
|
`,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
45
|
+
Td: css`
|
|
46
|
+
@layer defaults {
|
|
47
|
+
padding: 0.5rem 1rem;
|
|
48
|
+
vertical-align: middle;
|
|
49
|
+
border-top: 1px solid var(--xyd-table-border-color);
|
|
50
|
+
border-right: 1px solid var(--xyd-table-border-color);
|
|
33
51
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
52
|
+
@media (max-width: 768px) {
|
|
53
|
+
padding: 0.5rem;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
`,
|
|
57
|
+
Cell: css`
|
|
58
|
+
@layer defaults {
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: baseline;
|
|
61
|
+
width: 100%;
|
|
62
|
+
gap: 0.5rem;
|
|
38
63
|
|
|
64
|
+
[part="child"] {
|
|
65
|
+
flex: 1;
|
|
66
|
+
text-align: right;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
`
|
|
70
|
+
}
|
|
39
71
|
|