@xyd-js/components 0.1.0-xyd.11 → 0.1.0-xyd.13
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 +16 -0
- package/TODO.md +1 -0
- package/content.ts +0 -2
- package/dist/CTABanner-BD4wweO5.js +2 -0
- package/dist/CTABanner-BD4wweO5.js.map +1 -0
- package/dist/CTABanner-DLG0_gv8.js +2 -0
- package/dist/CTABanner-DLG0_gv8.js.map +1 -0
- package/dist/CTABanner-DpPtA-FL.js +2 -0
- package/dist/CTABanner-DpPtA-FL.js.map +1 -0
- package/dist/CodeSample--qfqZ1hL.js +2 -0
- package/dist/CodeSample--qfqZ1hL.js.map +1 -0
- package/dist/CodeSample-CqFaFwwz.js +2 -0
- package/dist/CodeSample-CqFaFwwz.js.map +1 -0
- package/dist/CodeSample-GbqwRbcO.js +2 -0
- package/dist/CodeSample-GbqwRbcO.js.map +1 -0
- package/dist/HomeView-BZdY0g_7.js +2 -0
- package/dist/{HomeView-DHdqouwJ.js.map → HomeView-BZdY0g_7.js.map} +1 -1
- package/dist/HomeView-C_mEMzjV.js +2 -0
- package/dist/{HomeView-TDx2tcP_.js.map → HomeView-C_mEMzjV.js.map} +1 -1
- package/dist/HomeView-RATm-3zT.js +2 -0
- package/dist/HomeView-RATm-3zT.js.map +1 -0
- package/dist/Icon-BkXdTctK.js +2 -0
- package/dist/Icon-BkXdTctK.js.map +1 -0
- package/dist/Icon-BoKcRZAF.js +2 -0
- package/dist/Icon-BoKcRZAF.js.map +1 -0
- package/dist/Icon-CouPZRkJ.js +2 -0
- package/dist/Icon-CouPZRkJ.js.map +1 -0
- package/dist/Text-B-E3eaWW.js +2 -0
- package/dist/Text-B-E3eaWW.js.map +1 -0
- package/dist/Text-B5Ba_pci.js +2 -0
- package/dist/Text-B5Ba_pci.js.map +1 -0
- package/dist/Text-QH4jjPUM.js +2 -0
- package/dist/Text-QH4jjPUM.js.map +1 -0
- package/dist/Update-BlhP2VFR.js +2 -0
- package/dist/Update-BlhP2VFR.js.map +1 -0
- package/dist/Update-CMM38Snc.js +2 -0
- package/dist/Update-CMM38Snc.js.map +1 -0
- package/dist/Update-D5e_yqty.js +2 -0
- package/dist/Update-D5e_yqty.js.map +1 -0
- package/dist/VideoGuide-C5aW4OXW.js +2 -0
- package/dist/VideoGuide-C5aW4OXW.js.map +1 -0
- package/dist/VideoGuide-CoQXlHjQ.js +2 -0
- package/dist/VideoGuide-CoQXlHjQ.js.map +1 -0
- package/dist/VideoGuide-CwkedH8b.js +2 -0
- package/dist/VideoGuide-CwkedH8b.js.map +1 -0
- package/dist/_rollupPluginBabelHelpers-9wcO9jN6.js +4 -0
- package/dist/_rollupPluginBabelHelpers-9wcO9jN6.js.map +1 -0
- package/dist/_rollupPluginBabelHelpers-CiqSP2w-.js +4 -0
- package/dist/_rollupPluginBabelHelpers-CiqSP2w-.js.map +1 -0
- package/dist/_rollupPluginBabelHelpers-DmvUE1MU.js +4 -0
- package/dist/_rollupPluginBabelHelpers-DmvUE1MU.js.map +1 -0
- 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 +32 -10
- package/dist/coder.js +1 -1
- package/dist/coder.js.map +1 -1
- package/dist/content.d.ts +264 -201
- package/dist/content.js +1 -1
- package/dist/content.js.map +1 -1
- package/dist/index.css +260 -210
- 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-Bb9zBh0L.js +2 -0
- package/dist/{tslib.es6-BI9zka_a.js.map → tslib.es6-Bb9zBh0L.js.map} +1 -1
- package/dist/tslib.es6-Bd9lzVn6.js +2 -0
- package/dist/{tslib.es6-sxmRJynD.js.map → tslib.es6-Bd9lzVn6.js.map} +1 -1
- package/dist/tslib.es6-DwnOrHRg.js +2 -0
- package/dist/tslib.es6-DwnOrHRg.js.map +1 -0
- package/dist/views.js +1 -1
- package/dist/writer.d.ts +409 -77
- 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 +10 -6
- package/project.json +677 -0
- package/rollup.config.js +30 -20
- package/src/brand/Button/Button.styles.tsx +0 -3
- package/src/brand/CTABanner/CTABanner.styles.tsx +2 -4
- package/src/brand/Footer/Footer.styles.tsx +0 -3
- package/src/coder/Code/Code.styles.tsx +132 -33
- package/src/coder/Code/Code.tsx +129 -38
- package/src/coder/Code/CodeLoader.tsx +3 -3
- 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.styles.tsx +13 -11
- package/src/coder/CodeCopy/CodeCopy.tsx +5 -3
- package/src/coder/CodeSample/CodeSample.tsx +83 -27
- package/src/coder/CodeTabs/CodeTabs.styles.tsx +111 -94
- package/src/coder/CodeTabs/CodeTabs.tsx +69 -51
- 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/index.ts +1 -0
- package/src/layouts/LayoutPrimary/LayoutPrimary.styles.tsx +270 -306
- package/src/layouts/LayoutPrimary/LayoutPrimary.tsx +171 -91
- package/src/layouts/LayoutPrimary/index.ts +0 -2
- package/src/layouts/index.ts +0 -7
- 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/writer/Anchor/Anchor.styles.tsx +11 -0
- package/src/{content → writer}/Anchor/Anchor.tsx +20 -22
- package/src/writer/Anchor/index.tsx +1 -0
- package/src/writer/Badge/Badge.styles.tsx +37 -27
- package/src/writer/Badge/Badge.tsx +34 -48
- 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 +6 -4
- package/src/writer/Blockquote/Blockquote.tsx +5 -2
- package/src/writer/Breadcrumbs/Breadcrumbs.styles.ts +25 -25
- package/src/writer/Breadcrumbs/Breadcrumbs.tsx +18 -12
- 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 +35 -42
- package/src/writer/Callout/Callout.tsx +30 -15
- 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 +12 -11
- package/src/writer/Code/Code.tsx +6 -3
- package/src/writer/ColorSchemeButton/ColorSchemeButton.tsx +172 -0
- package/src/writer/ColorSchemeButton/index.ts +1 -0
- package/src/writer/Details/Details.styles.tsx +87 -98
- package/src/writer/Details/Details.tsx +65 -44
- package/src/writer/Example/index.tsx +5 -0
- package/src/writer/GuideCard/GuideCard.styles.tsx +100 -103
- package/src/writer/GuideCard/GuideCard.tsx +72 -37
- package/src/writer/Heading/Heading.styles.tsx +76 -60
- package/src/writer/Heading/Heading.tsx +92 -22
- package/src/writer/Hr/Hr.styles.tsx +3 -1
- package/src/writer/Hr/Hr.tsx +2 -5
- 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 +26 -26
- package/src/writer/NavLinks/NavLinks.tsx +65 -18
- package/src/writer/Pre/Pre.styles.tsx +8 -6
- package/src/writer/Pre/Pre.tsx +3 -2
- package/src/writer/Steps/Steps.styles.tsx +27 -24
- package/src/writer/Steps/Steps.tsx +38 -8
- package/src/writer/Table/Table.styles.tsx +65 -34
- package/src/writer/Table/Table.tsx +121 -11
- package/src/writer/Table/index.ts +0 -11
- package/src/writer/Tabs/Tabs.styles.tsx +51 -55
- package/src/writer/Tabs/Tabs.tsx +30 -23
- 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 +165 -31
- package/src/writer/UnderlineNav/UnderlineNav.tsx +257 -22
- 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 +9 -3
- package/types.d.ts +50 -0
- package/writer.ts +1 -1
- package/dist/CTABanner-BLDHbq5h.js +0 -2
- package/dist/CTABanner-BLDHbq5h.js.map +0 -1
- package/dist/CTABanner-n3vc4xW5.js +0 -2
- package/dist/CTABanner-n3vc4xW5.js.map +0 -1
- package/dist/CodeSample-CVki5fdQ.js +0 -2
- package/dist/CodeSample-CVki5fdQ.js.map +0 -1
- package/dist/CodeSample-Dkob5gWa.js +0 -2
- package/dist/CodeSample-Dkob5gWa.js.map +0 -1
- package/dist/HomeView-DHdqouwJ.js +0 -2
- package/dist/HomeView-TDx2tcP_.js +0 -2
- package/dist/UnderlineNav-9lJPvnIp.js +0 -2
- package/dist/UnderlineNav-9lJPvnIp.js.map +0 -1
- package/dist/UnderlineNav-VqB7jDQD.js +0 -2
- package/dist/UnderlineNav-VqB7jDQD.js.map +0 -1
- package/dist/_rollupPluginBabelHelpers-C8nLsqZ7.js +0 -2
- package/dist/_rollupPluginBabelHelpers-C8nLsqZ7.js.map +0 -1
- package/dist/_rollupPluginBabelHelpers-CrdNG0jb.js +0 -2
- package/dist/_rollupPluginBabelHelpers-CrdNG0jb.js.map +0 -1
- package/dist/index-TkBHKzGT.js +0 -2
- package/dist/index-TkBHKzGT.js.map +0 -1
- package/dist/index-YH6Q3iH2.js +0 -2
- package/dist/index-YH6Q3iH2.js.map +0 -1
- package/dist/tslib.es6-BI9zka_a.js +0 -2
- package/dist/tslib.es6-sxmRJynD.js +0 -2
- package/src/content/Anchor/Anchor.styles.tsx +0 -5
- package/src/content/Anchor/index.tsx +0 -3
- package/src/content/Content/Content.styles.tsx +0 -9
- package/src/content/Content/Content.tsx +0 -13
- package/src/content/Content/index.tsx +0 -3
- package/src/content/Content.tsx +0 -179
- package/src/content/Subtitle/Subtitle.styles.ts +0 -8
- package/src/content/Subtitle/Subtitle.tsx +0 -12
- package/src/content/Subtitle/index.tsx +0 -3
- package/src/layouts/Layout.styles.tsx +0 -155
- package/src/layouts/Layout.tsx +0 -119
- package/src/ui/Loader/Loader.styles.tsx +0 -54
- 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
- /package/src/{ui → kit}/TODO.md +0 -0
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import {css} from "@linaria/core";
|
|
2
|
-
import colors from "@livesession/design-system-colors";
|
|
3
2
|
|
|
4
3
|
export const NavLinksHost = css`
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
@layer defaults {
|
|
5
|
+
font-weight: var(--xyd-font-weight-semibold);
|
|
6
|
+
display: flex;
|
|
7
|
+
padding-top: 2rem;
|
|
8
|
+
margin-top: 2rem;
|
|
9
|
+
margin-bottom: 2rem;
|
|
10
|
+
justify-content: space-between;
|
|
11
|
+
align-items: center;
|
|
12
|
+
border-top-width: 1px;
|
|
13
|
+
border-color: var(--xyd-navlinks-border-color);
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
transition-duration: 300ms;
|
|
25
|
-
max-width: 50%;
|
|
26
|
-
`;
|
|
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
|
+
}
|
|
27
24
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
[part="icon"] {
|
|
26
|
+
display: inline;
|
|
27
|
+
height: 1.25rem;
|
|
28
|
+
flex-shrink: 0;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
32
31
|
`;
|
|
32
|
+
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import React from "react"
|
|
2
|
-
import {ArrowLeftIcon, ArrowRightIcon} from '@radix-ui/react-icons'
|
|
3
2
|
|
|
4
3
|
import * as cn from "./NavLinks.styles";
|
|
5
4
|
|
|
6
|
-
function Anchor({children, ...rest}) {
|
|
7
|
-
return <a {...rest}>
|
|
8
|
-
{children}
|
|
9
|
-
</a>
|
|
10
|
-
}
|
|
11
|
-
|
|
12
5
|
export interface NavLinksProps {
|
|
13
6
|
prev?: {
|
|
14
7
|
title: string
|
|
@@ -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,11 +1,13 @@
|
|
|
1
1
|
import {css} from "@linaria/core";
|
|
2
2
|
|
|
3
3
|
export const PreHost = css`
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
@layer defaults {
|
|
5
|
+
margin-top: 0;
|
|
6
|
+
border-radius: 6px;
|
|
7
|
+
padding: 16px;
|
|
8
|
+
border: 0;
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
background-color: var(--xyd-pre-bgcolor);
|
|
11
|
+
overflow: auto;
|
|
12
|
+
}
|
|
11
13
|
`;
|
package/src/writer/Pre/Pre.tsx
CHANGED
|
@@ -4,10 +4,11 @@ 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={cn.PreHost}>
|
|
10
|
+
export function Pre({ children, className }: PreProps) {
|
|
11
|
+
return <pre className={`${cn.PreHost} ${className || ""}`}>
|
|
11
12
|
{children}
|
|
12
13
|
</pre>
|
|
13
14
|
}
|
|
@@ -1,35 +1,38 @@
|
|
|
1
1
|
import {css} from "@linaria/core";
|
|
2
2
|
|
|
3
3
|
export const StepsHost = css`
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
@layer defaults {
|
|
5
|
+
padding-left: 0;
|
|
6
|
+
list-style: none;
|
|
7
|
+
counter-reset: ordered-listitem;
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
gap: 6px;
|
|
12
|
+
}
|
|
11
13
|
`;
|
|
12
14
|
|
|
13
15
|
export const StepsLi = css`
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
@layer defaults {
|
|
17
|
+
padding-left: 32px;
|
|
18
|
+
position: relative;
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
&::after {
|
|
21
|
+
position: absolute;
|
|
22
|
+
top: 0;
|
|
23
|
+
left: 0;
|
|
24
|
+
counter-increment: ordered-listitem;
|
|
25
|
+
content: counter(ordered-listitem);
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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);
|
|
32
|
+
text-align: center;
|
|
33
|
+
height: 24px;
|
|
34
|
+
width: 24px;
|
|
35
|
+
border-radius: 12px;
|
|
36
|
+
}
|
|
34
37
|
}
|
|
35
38
|
`;
|
|
@@ -2,22 +2,52 @@ import React from "react"
|
|
|
2
2
|
|
|
3
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;
|
|
11
|
+
|
|
12
|
+
/** Optional CSS class name to be applied to the steps container */
|
|
13
|
+
className?: string;
|
|
7
14
|
}
|
|
8
15
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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>
|
|
13
28
|
}
|
|
14
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Props for the Steps.Item component
|
|
32
|
+
*/
|
|
15
33
|
export interface StepsItemProps {
|
|
34
|
+
/** Content to be rendered inside the step item */
|
|
16
35
|
children: React.ReactNode;
|
|
36
|
+
|
|
37
|
+
/** Optional CSS class name to be applied to the step item */
|
|
38
|
+
className?: string;
|
|
17
39
|
}
|
|
18
40
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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>
|
|
23
53
|
}
|
|
@@ -1,40 +1,71 @@
|
|
|
1
1
|
import {css} from "@linaria/core";
|
|
2
2
|
|
|
3
|
-
const colors = {
|
|
4
|
-
primary: "#D1D5DB"
|
|
5
|
-
}
|
|
6
3
|
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
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
|
+
}
|
|
17
|
+
`,
|
|
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
|
+
}
|
|
37
|
+
`,
|
|
38
|
+
Tr: css`
|
|
39
|
+
@layer defaults {
|
|
40
|
+
&:not(:last-child) {
|
|
41
|
+
border-bottom: 1px solid var(--xyd-table-border-color);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
`,
|
|
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);
|
|
10
51
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
background: rgba(234, 238, 242, 0.5);
|
|
23
|
-
`;
|
|
24
|
-
|
|
25
|
-
export const TableTr = css`
|
|
26
|
-
padding: 0;
|
|
27
|
-
margin: 0;
|
|
28
|
-
border-top-width: 1px;
|
|
29
|
-
border-color: ${colors.primary};
|
|
30
|
-
`;
|
|
31
|
-
|
|
32
|
-
export const TableTd = css`
|
|
33
|
-
padding: 0.5rem 1rem;
|
|
34
|
-
margin: 0;
|
|
35
|
-
|
|
36
|
-
border-width: 1px;
|
|
37
|
-
border-color: ${colors.primary};
|
|
38
|
-
`;
|
|
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;
|
|
39
63
|
|
|
64
|
+
[part="child"] {
|
|
65
|
+
flex: 1;
|
|
66
|
+
text-align: right;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
`
|
|
70
|
+
}
|
|
40
71
|
|
|
@@ -1,45 +1,155 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import cn from "./Table.styles";
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Props for the Table component
|
|
7
|
+
*/
|
|
5
8
|
export interface TableProps {
|
|
9
|
+
/** The content to be rendered inside the table */
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
|
|
12
|
+
/** Optional CSS class name to be applied to the table */
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A table component that provides a structured way to display tabular data.
|
|
18
|
+
* It supports custom styling through className prop and can contain various table elements.
|
|
19
|
+
*
|
|
20
|
+
* @category Component
|
|
21
|
+
*/
|
|
22
|
+
export function Table({ children, className }: TableProps) {
|
|
23
|
+
return (
|
|
24
|
+
<table className={`${cn.Host} ${className || ''}`}>
|
|
25
|
+
{children}
|
|
26
|
+
</table>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Props for the TableHead component
|
|
32
|
+
*/
|
|
33
|
+
export interface TableHeadProps {
|
|
34
|
+
/** The content to be rendered inside the table header */
|
|
6
35
|
children: React.ReactNode;
|
|
7
36
|
}
|
|
8
37
|
|
|
9
|
-
|
|
10
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Represents the header section of a table.
|
|
40
|
+
* Use this component to group header content at the top of the table.
|
|
41
|
+
*/
|
|
42
|
+
Table.Head = function TableHead({ children }: TableHeadProps) {
|
|
43
|
+
return <thead className={cn.Thead}>
|
|
11
44
|
{children}
|
|
12
|
-
</
|
|
45
|
+
</thead>
|
|
13
46
|
}
|
|
14
47
|
|
|
48
|
+
/**
|
|
49
|
+
* Props for the TableTh component
|
|
50
|
+
*/
|
|
15
51
|
export interface TableThProps {
|
|
52
|
+
/** The content to be rendered inside the table header cell */
|
|
16
53
|
children: React.ReactNode;
|
|
54
|
+
|
|
55
|
+
/** Whether the cell content should be right-aligned (for numeric values) */
|
|
56
|
+
numeric?: boolean;
|
|
17
57
|
}
|
|
18
58
|
|
|
19
|
-
|
|
20
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Represents a header cell in the table.
|
|
61
|
+
* Use this component for column headers in the table.
|
|
62
|
+
*/
|
|
63
|
+
Table.Th = function TableTh({ children, numeric }: TableThProps) {
|
|
64
|
+
return <th className={`${cn.Th} ${numeric ? 'numeric' : ''}`}>
|
|
21
65
|
{children}
|
|
22
66
|
</th>
|
|
23
67
|
}
|
|
24
68
|
|
|
69
|
+
/**
|
|
70
|
+
* Props for the TableTr component
|
|
71
|
+
*/
|
|
25
72
|
export interface TableTrProps {
|
|
73
|
+
/** The content to be rendered inside the table row */
|
|
26
74
|
children: React.ReactNode;
|
|
27
75
|
}
|
|
28
76
|
|
|
29
|
-
|
|
30
|
-
|
|
77
|
+
/**
|
|
78
|
+
* Represents a row in the table.
|
|
79
|
+
* Use this component to create rows in the table body or header.
|
|
80
|
+
*/
|
|
81
|
+
Table.Tr = function TableTr({ children }: TableTrProps) {
|
|
82
|
+
return <tr className={cn.Tr}>
|
|
31
83
|
{children}
|
|
32
84
|
</tr>
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Props for the TableBody component
|
|
89
|
+
*/
|
|
90
|
+
export interface TableBodyProps {
|
|
91
|
+
/** The content to be rendered inside the table body */
|
|
92
|
+
children: React.ReactNode;
|
|
93
|
+
}
|
|
33
94
|
|
|
95
|
+
/**
|
|
96
|
+
* Represents the main content area of the table.
|
|
97
|
+
* Use this component to group the main content rows of the table.
|
|
98
|
+
*/
|
|
99
|
+
Table.Body = function TableBody({ children }: TableBodyProps) {
|
|
100
|
+
return <tbody className={cn.Tbody}>
|
|
101
|
+
{children}
|
|
102
|
+
</tbody>
|
|
34
103
|
}
|
|
35
104
|
|
|
105
|
+
/**
|
|
106
|
+
* Props for the TableTd component
|
|
107
|
+
*/
|
|
36
108
|
export interface TableTdProps {
|
|
109
|
+
/** The content to be rendered inside the table cell */
|
|
37
110
|
children: React.ReactNode;
|
|
111
|
+
|
|
112
|
+
/** Whether the cell content should be right-aligned (for numeric values) */
|
|
113
|
+
numeric?: boolean;
|
|
114
|
+
|
|
115
|
+
/** Whether the cell should have a muted appearance */
|
|
116
|
+
muted?: boolean;
|
|
38
117
|
}
|
|
39
118
|
|
|
40
|
-
|
|
41
|
-
|
|
119
|
+
/**
|
|
120
|
+
* Represents a data cell in the table.
|
|
121
|
+
* Use this component for regular data cells in the table body.
|
|
122
|
+
*/
|
|
123
|
+
Table.Td = function TableTd({ children, numeric, muted }: TableTdProps) {
|
|
124
|
+
return <td className={`${cn.Td} ${numeric ? 'numeric' : ''} ${muted ? 'muted' : ''}`}>
|
|
42
125
|
{children}
|
|
43
126
|
</td>
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Props for the TableCell component
|
|
131
|
+
*/
|
|
132
|
+
export interface TableCellProps {
|
|
133
|
+
/** The content to be rendered inside the table cell */
|
|
134
|
+
children: React.ReactNode;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* A custom table cell component that wraps content in a div with specific styling.
|
|
139
|
+
* Use this component when you need a custom-styled cell with additional structure.
|
|
140
|
+
*/
|
|
141
|
+
Table.Cell = function TableCell({ children }: TableCellProps) {
|
|
142
|
+
return <xyd-table-cell className={cn.Cell}>
|
|
143
|
+
<div part="child">
|
|
144
|
+
{children}
|
|
145
|
+
</div>
|
|
146
|
+
</xyd-table-cell>
|
|
147
|
+
}
|
|
44
148
|
|
|
45
|
-
|
|
149
|
+
/**
|
|
150
|
+
* Props for the TableModelCell component
|
|
151
|
+
*/
|
|
152
|
+
export interface TableModelCellProps {
|
|
153
|
+
/** The content to be rendered inside the model cell */
|
|
154
|
+
children: React.ReactNode;
|
|
155
|
+
}
|