@xyd-js/components 0.1.0-xyd.5 → 0.1.0-xyd.7
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/CHANGELOG.md +12 -0
- package/dist/{CTABanner-B-metiuR.js → CTABanner-BrdYlhnD.js} +1 -1
- package/dist/{CTABanner-hcWUnRIm.js.map → CTABanner-BrdYlhnD.js.map} +1 -1
- package/dist/{CTABanner-hcWUnRIm.js → CTABanner-XQNnnpUx.js} +1 -1
- package/dist/{CTABanner-B-metiuR.js.map → CTABanner-XQNnnpUx.js.map} +1 -1
- package/dist/CodeSample-Cp42Adjc.js +2 -0
- package/dist/CodeSample-Cp42Adjc.js.map +1 -0
- package/dist/CodeSample-DxPp80ID.js +2 -0
- package/dist/CodeSample-DxPp80ID.js.map +1 -0
- package/dist/{HomeView-C70Vzl0K.js → HomeView-BN9mZXh9.js} +1 -1
- package/dist/{HomeView-C70Vzl0K.js.map → HomeView-BN9mZXh9.js.map} +1 -1
- package/dist/{HomeView-DA0hRPl2.js → HomeView-BVaaV0uE.js} +1 -1
- package/dist/{HomeView-DA0hRPl2.js.map → HomeView-BVaaV0uE.js.map} +1 -1
- package/dist/UnderlineNav-Bs7Ot9Ch.js +2 -0
- package/dist/UnderlineNav-Bs7Ot9Ch.js.map +1 -0
- package/dist/UnderlineNav-C2aEVraN.js +2 -0
- package/dist/UnderlineNav-C2aEVraN.js.map +1 -0
- package/dist/{_rollupPluginBabelHelpers-CdarGYFF.js → _rollupPluginBabelHelpers-BMmCG_qQ.js} +2 -2
- package/dist/_rollupPluginBabelHelpers-BMmCG_qQ.js.map +1 -0
- package/dist/{_rollupPluginBabelHelpers-DNCsaSlj.js → _rollupPluginBabelHelpers-DsEzE6Ab.js} +2 -2
- package/dist/_rollupPluginBabelHelpers-DsEzE6Ab.js.map +1 -0
- package/dist/brand.js +1 -1
- package/dist/coder.d.ts +5 -1
- package/dist/coder.js +1 -1
- package/dist/coder.js.map +1 -1
- package/dist/content.d.ts +54 -29
- package/dist/content.js +1 -1
- package/dist/content.js.map +1 -1
- package/dist/index-BVUz77Tm.js +2 -0
- package/dist/index-BVUz77Tm.js.map +1 -0
- package/dist/index-jxd3nv2J.js +2 -0
- package/dist/index-jxd3nv2J.js.map +1 -0
- package/dist/index.css +119 -40
- package/dist/layouts.d.ts +12 -2
- package/dist/layouts.js +1 -1
- package/dist/layouts.js.map +1 -1
- package/dist/pages.js +1 -1
- package/dist/{tslib.es6-BJOaQ_lJ.js → tslib.es6-DDIOdJiV.js} +1 -1
- package/dist/{tslib.es6-BS8I3nP0.js.map → tslib.es6-DDIOdJiV.js.map} +1 -1
- package/dist/{tslib.es6-BS8I3nP0.js → tslib.es6-DUrRPhZd.js} +1 -1
- package/dist/{tslib.es6-DNz-U5oh.js.map → tslib.es6-DUrRPhZd.js.map} +1 -1
- package/dist/views.js +1 -1
- package/dist/writer.d.ts +47 -6
- package/dist/writer.js +1 -1
- package/dist/writer.js.map +1 -1
- package/package.json +4 -3
- package/src/coder/Code/Code.tsx +5 -8
- package/src/coder/Code/CodeLoader.tsx +10 -0
- package/src/coder/Code/index.ts +4 -1
- package/src/coder/CodeSample/CodeSample.tsx +12 -0
- package/src/coder/CodeTabs/CodeTabs.styles.tsx +11 -0
- package/src/coder/CodeTabs/CodeTabs.tsx +21 -5
- package/src/coder/CodeTheme/CodeTheme.tsx +2 -1
- package/src/coder/hooks/highlight.ts +182 -0
- package/src/coder/index.ts +3 -3
- package/src/content/Content.tsx +15 -6
- package/src/content/Subtitle/Subtitle.tsx +4 -4
- package/src/layouts/LayoutPrimary/LayoutPrimary.styles.tsx +320 -0
- package/src/layouts/LayoutPrimary/LayoutPrimary.tsx +160 -0
- package/src/layouts/LayoutPrimary/index.ts +5 -0
- package/src/layouts/index.ts +7 -1
- package/src/ui/Loader/Loader.styles.tsx +52 -0
- package/src/ui/Loader/Loader.tsx +26 -0
- package/src/ui/index.ts +1 -0
- package/src/writer/Badge/Badge.styles.tsx +3 -3
- package/src/writer/Details/Details.styles.tsx +17 -0
- package/src/writer/Details/Details.tsx +28 -11
- package/src/writer/Icon/index.tsx +13 -0
- package/src/writer/NavLinks/NavLinks.styles.ts +1 -0
- package/src/writer/Table/TableV2.styles.tsx +117 -0
- package/src/writer/Table/TableV2.tsx +83 -0
- package/src/writer/Table/index.ts +4 -0
- package/dist/CTABanner-BytLRAOg.js +0 -2
- package/dist/CTABanner-BytLRAOg.js.map +0 -1
- package/dist/CodeSample-Bkdm9TLb.js +0 -2
- package/dist/CodeSample-Bkdm9TLb.js.map +0 -1
- package/dist/CodeSample-Bt6WJOYx.js +0 -2
- package/dist/CodeSample-Bt6WJOYx.js.map +0 -1
- package/dist/CodeSample-D-bGz40b.js +0 -2
- package/dist/CodeSample-D-bGz40b.js.map +0 -1
- package/dist/HomeView-sbl_99l1.js +0 -2
- package/dist/HomeView-sbl_99l1.js.map +0 -1
- package/dist/UnderlineNav-3vpnAIF7.js +0 -2
- package/dist/UnderlineNav-3vpnAIF7.js.map +0 -1
- package/dist/UnderlineNav-CnSXtQ0o.js +0 -2
- package/dist/UnderlineNav-CnSXtQ0o.js.map +0 -1
- package/dist/UnderlineNav-hAt4ieuk.js +0 -2
- package/dist/UnderlineNav-hAt4ieuk.js.map +0 -1
- package/dist/_rollupPluginBabelHelpers-CdarGYFF.js.map +0 -1
- package/dist/_rollupPluginBabelHelpers-DNCsaSlj.js.map +0 -1
- package/dist/_rollupPluginBabelHelpers-Dyp77Dty.js +0 -2
- package/dist/_rollupPluginBabelHelpers-Dyp77Dty.js.map +0 -1
- package/dist/index-Bj8cSv3b.js +0 -2
- package/dist/index-Bj8cSv3b.js.map +0 -1
- package/dist/index-ByyyJDhj.js +0 -2
- package/dist/index-ByyyJDhj.js.map +0 -1
- package/dist/index-DcT-QJgO.js +0 -2
- package/dist/index-DcT-QJgO.js.map +0 -1
- package/dist/tslib.es6-BJOaQ_lJ.js.map +0 -1
- package/dist/tslib.es6-DNz-U5oh.js +0 -2
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import React, {useEffect, useState} from "react"
|
|
2
|
+
|
|
3
|
+
import {$layout, $page, $article, globalHeaderHeight} from "./LayoutPrimary.styles.tsx"
|
|
4
|
+
|
|
5
|
+
export interface LayoutPrimaryProps {
|
|
6
|
+
header: React.ReactNode;
|
|
7
|
+
aside: React.ReactNode;
|
|
8
|
+
content: React.ReactNode;
|
|
9
|
+
contentNav: React.ReactNode;
|
|
10
|
+
|
|
11
|
+
subheader?: React.ReactNode;
|
|
12
|
+
layoutSize?: "large"
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// TODO: move scroller to xyd-foo
|
|
16
|
+
export function LayoutPrimary(props: LayoutPrimaryProps) {
|
|
17
|
+
const [isMobileNavOpen, setIsMobileNavOpen] = useState(false)
|
|
18
|
+
|
|
19
|
+
const {hideMainHeader} = props.subheader ? useSubHeader() : {hideMainHeader: false}
|
|
20
|
+
|
|
21
|
+
return <div className={$layout.host}>
|
|
22
|
+
<header className={`
|
|
23
|
+
${$layout.header}
|
|
24
|
+
${props.subheader && $layout.header$$sub}
|
|
25
|
+
${hideMainHeader && $layout.header$$hideMain}
|
|
26
|
+
`}>
|
|
27
|
+
<div className={$layout.primaryHeaderContent}>
|
|
28
|
+
{props.header}
|
|
29
|
+
<button
|
|
30
|
+
className={$layout.hamburgerButton}
|
|
31
|
+
onClick={() => setIsMobileNavOpen(!isMobileNavOpen)}
|
|
32
|
+
aria-label="Toggle navigation menu"
|
|
33
|
+
>
|
|
34
|
+
<div className={$layout.hamburgerIcon}>
|
|
35
|
+
<span className={`${$layout.hamburgerLine} ${isMobileNavOpen ? $layout.hamburgerLine$$open : ''}`}/>
|
|
36
|
+
<span className={`${$layout.hamburgerLine} ${isMobileNavOpen ? $layout.hamburgerLine$$open : ''}`}/>
|
|
37
|
+
<span className={`${$layout.hamburgerLine} ${isMobileNavOpen ? $layout.hamburgerLine$$open : ''}`}/>
|
|
38
|
+
</div>
|
|
39
|
+
</button>
|
|
40
|
+
</div>
|
|
41
|
+
{props.subheader}
|
|
42
|
+
</header>
|
|
43
|
+
|
|
44
|
+
{/* Mobile Drawer Sidebar */}
|
|
45
|
+
<div
|
|
46
|
+
className={`${$layout.overlay} ${isMobileNavOpen ? $layout.overlay$$visible : ''}`}
|
|
47
|
+
onClick={() => setIsMobileNavOpen(false)}
|
|
48
|
+
/>
|
|
49
|
+
<aside className={`
|
|
50
|
+
${$layout.mobileSidebar}
|
|
51
|
+
${isMobileNavOpen ? $layout.mobileSidebar$$open : ''}
|
|
52
|
+
`}>
|
|
53
|
+
<div className={$layout.sidebarContent}>
|
|
54
|
+
{props.aside}
|
|
55
|
+
</div>
|
|
56
|
+
<button
|
|
57
|
+
className={$layout.closeButton}
|
|
58
|
+
onClick={() => setIsMobileNavOpen(false)}
|
|
59
|
+
aria-label="Close navigation menu"
|
|
60
|
+
>
|
|
61
|
+
<div className={$layout.closeIcon}/>
|
|
62
|
+
</button>
|
|
63
|
+
</aside>
|
|
64
|
+
|
|
65
|
+
<main className={`
|
|
66
|
+
${$layout.main}
|
|
67
|
+
${!hideMainHeader && props.subheader && $layout.main$$sub}
|
|
68
|
+
`}>
|
|
69
|
+
{/* Desktop Static Sidebar */}
|
|
70
|
+
<aside className={$layout.staticSidebar}>
|
|
71
|
+
{props.aside}
|
|
72
|
+
</aside>
|
|
73
|
+
|
|
74
|
+
<div className={$page.host}>
|
|
75
|
+
<div className={$page.scroll}>
|
|
76
|
+
<div className={`
|
|
77
|
+
${$page.container}
|
|
78
|
+
${props.layoutSize == "large" && $page.container$$large}
|
|
79
|
+
`}>
|
|
80
|
+
<div className={`
|
|
81
|
+
${$page.articleContainer}
|
|
82
|
+
`}>
|
|
83
|
+
<article className={$article.host}>
|
|
84
|
+
<section className={$article.content}>
|
|
85
|
+
{props.content}
|
|
86
|
+
</section>
|
|
87
|
+
{
|
|
88
|
+
props.contentNav && <nav className={`
|
|
89
|
+
${$article.nav}
|
|
90
|
+
`}>
|
|
91
|
+
{props.contentNav}
|
|
92
|
+
</nav>
|
|
93
|
+
}
|
|
94
|
+
</article>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
</main>
|
|
100
|
+
</div>
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// TODO: move to `xyd-foo` or somewhere else
|
|
104
|
+
function useSubHeader() {
|
|
105
|
+
const [hideMainHeader, setHideMainHeader] = useState(false)
|
|
106
|
+
const [scrollTop, setScrollTop] = useState(0)
|
|
107
|
+
const [controlScrollPos, setControlScrollPos] = useState(0)
|
|
108
|
+
|
|
109
|
+
useEffect(() => {
|
|
110
|
+
if (scrollTop === controlScrollPos) {
|
|
111
|
+
return
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const checkpoint = parseInt(globalHeaderHeight, 10) / 2
|
|
115
|
+
const diff = scrollTop - controlScrollPos
|
|
116
|
+
const reversePosDiff = Math.abs(scrollTop - controlScrollPos)
|
|
117
|
+
|
|
118
|
+
if (diff > checkpoint) {
|
|
119
|
+
setHideMainHeader(true)
|
|
120
|
+
} else if (reversePosDiff > checkpoint) {
|
|
121
|
+
setHideMainHeader(false)
|
|
122
|
+
}
|
|
123
|
+
}, [
|
|
124
|
+
scrollTop,
|
|
125
|
+
controlScrollPos,
|
|
126
|
+
]);
|
|
127
|
+
|
|
128
|
+
function onScroll(e: Event) {
|
|
129
|
+
if (!(e.target instanceof HTMLElement)) {
|
|
130
|
+
return
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const scroll = e.target?.scrollTop
|
|
134
|
+
setScrollTop(scroll)
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function onScrollFinish(e: Event) {
|
|
138
|
+
if (!(e.target instanceof HTMLElement)) {
|
|
139
|
+
return
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
setControlScrollPos(e.target?.scrollTop)
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// TODO: by ref?
|
|
146
|
+
// TODO: MOVE SOMEWHERE ELSE BECAUSE IT DECREASE PERFORMANCE (RERENDER)
|
|
147
|
+
useEffect(() => {
|
|
148
|
+
document.querySelector(`.${$page.scroll}`)?.addEventListener("scroll", onScroll)
|
|
149
|
+
document.querySelector(`.${$page.scroll}`)?.addEventListener("scrollend", onScrollFinish)
|
|
150
|
+
|
|
151
|
+
return () => {
|
|
152
|
+
document.querySelector(`.${$page.scroll}`)?.removeEventListener("scroll", onScroll)
|
|
153
|
+
document.querySelector(`.${$page.scroll}`)?.removeEventListener("scrollend", onScrollFinish)
|
|
154
|
+
}
|
|
155
|
+
}, []);
|
|
156
|
+
|
|
157
|
+
return {
|
|
158
|
+
hideMainHeader,
|
|
159
|
+
}
|
|
160
|
+
}
|
package/src/layouts/index.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
// TODO: move this pkg @xyd-js/layouts ?
|
|
2
2
|
|
|
3
|
+
export {
|
|
4
|
+
LayoutPrimary,
|
|
5
|
+
type LayoutPrimaryProps
|
|
6
|
+
} from "./LayoutPrimary";
|
|
7
|
+
|
|
3
8
|
export {
|
|
4
9
|
Layout
|
|
5
10
|
} from "./Layout";
|
|
6
11
|
|
|
7
|
-
export type {LayoutProps} from "./Layout";
|
|
12
|
+
export type {LayoutProps} from "./Layout";
|
|
13
|
+
|
|
@@ -0,0 +1,52 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
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
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Loader/Loader";
|
|
@@ -12,12 +12,12 @@ export const $badge = {
|
|
|
12
12
|
text-transform: none;
|
|
13
13
|
`,
|
|
14
14
|
host$$warning: css`
|
|
15
|
-
color: #
|
|
16
|
-
background-color: #
|
|
15
|
+
color: #434e4e;
|
|
16
|
+
background-color: #ffffe1
|
|
17
17
|
`,
|
|
18
18
|
host$$info: css`
|
|
19
19
|
color: #fff;
|
|
20
|
-
background-color: #
|
|
20
|
+
background-color: #1971a8;
|
|
21
21
|
`,
|
|
22
22
|
host$$sm: css`
|
|
23
23
|
font-size: 12px;
|
|
@@ -38,6 +38,9 @@ export const $details = {
|
|
|
38
38
|
cursor: pointer;
|
|
39
39
|
padding: 20px 24px;
|
|
40
40
|
`,
|
|
41
|
+
summary$$tertiary: css`
|
|
42
|
+
padding: 10px 24px;
|
|
43
|
+
`,
|
|
41
44
|
summaryDeep: css`
|
|
42
45
|
display: flex;
|
|
43
46
|
align-items: center;
|
|
@@ -52,9 +55,19 @@ export const $details = {
|
|
|
52
55
|
margin-left: 8px;
|
|
53
56
|
font-weight: 700;
|
|
54
57
|
`,
|
|
58
|
+
summaryDeep$text$$tertiary: css`
|
|
59
|
+
text-transform: none;
|
|
60
|
+
|
|
61
|
+
code {
|
|
62
|
+
background: white;
|
|
63
|
+
}
|
|
64
|
+
`,
|
|
55
65
|
label: css`
|
|
56
66
|
flex: 1 1 auto;
|
|
57
67
|
`,
|
|
68
|
+
label$$tertriary: css`
|
|
69
|
+
padding: 10px;
|
|
70
|
+
`,
|
|
58
71
|
icon: css`
|
|
59
72
|
flex: 0 0 auto;
|
|
60
73
|
font-size: 16px;
|
|
@@ -72,5 +85,9 @@ export const $details = {
|
|
|
72
85
|
code {
|
|
73
86
|
background: white;
|
|
74
87
|
}
|
|
88
|
+
`,
|
|
89
|
+
content$$tertiary: css`
|
|
90
|
+
background: white;
|
|
91
|
+
padding-top: 20px;
|
|
75
92
|
`
|
|
76
93
|
}
|
|
@@ -5,24 +5,34 @@ import {$details} from "./Details.styles";
|
|
|
5
5
|
interface BaseDetailsProps {
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
label: string;
|
|
8
|
+
|
|
9
|
+
icon?: React.SVGProps<SVGSVGElement>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface TertiaryDetailsProps extends BaseDetailsProps {
|
|
13
|
+
kind: "tertiary";
|
|
14
|
+
title: string | React.ReactNode;
|
|
8
15
|
}
|
|
9
16
|
|
|
10
17
|
interface SecondaryDetailsProps extends BaseDetailsProps {
|
|
11
18
|
kind: "secondary";
|
|
12
|
-
title: string;
|
|
19
|
+
title: string | React.ReactNode;
|
|
13
20
|
}
|
|
14
21
|
|
|
15
22
|
interface PrimaryDetailsProps extends BaseDetailsProps {
|
|
16
23
|
kind?: "primary";
|
|
17
24
|
}
|
|
18
25
|
|
|
19
|
-
export type DetailsProps = PrimaryDetailsProps | SecondaryDetailsProps
|
|
26
|
+
export type DetailsProps = PrimaryDetailsProps | SecondaryDetailsProps | TertiaryDetailsProps
|
|
20
27
|
|
|
21
28
|
export function Details(props: DetailsProps) {
|
|
22
|
-
let title = "";
|
|
23
29
|
const {children, label} = props;
|
|
24
30
|
|
|
25
|
-
|
|
31
|
+
let title
|
|
32
|
+
|
|
33
|
+
const isDeepKind = ["secondary", "tertiary"].includes(props.kind || "");
|
|
34
|
+
|
|
35
|
+
if (isDeepKind && "title" in props) {
|
|
26
36
|
title = props.title;
|
|
27
37
|
}
|
|
28
38
|
|
|
@@ -30,23 +40,29 @@ export function Details(props: DetailsProps) {
|
|
|
30
40
|
|
|
31
41
|
return <details className={`
|
|
32
42
|
${$details.host}
|
|
33
|
-
${
|
|
43
|
+
${isDeepKind && $details.host$$secondary}
|
|
34
44
|
`}>
|
|
35
45
|
<summary className={`
|
|
36
46
|
${$details.summary}
|
|
37
|
-
${
|
|
47
|
+
${isDeepKind && $details.summary$$secondary}
|
|
48
|
+
${kind === "tertiary" ? $details.summary$$tertiary : ""}
|
|
38
49
|
`}>
|
|
39
50
|
{kind === "primary" && <>
|
|
40
|
-
|
|
51
|
+
{props.icon ? props.icon : <$Icon/>}
|
|
41
52
|
<$Label>
|
|
42
53
|
{label}
|
|
43
54
|
</$Label>
|
|
44
55
|
</>}
|
|
45
|
-
{
|
|
56
|
+
{isDeepKind && <>
|
|
46
57
|
<div>
|
|
47
58
|
<div className={$details.summaryDeep}>
|
|
48
|
-
|
|
49
|
-
|
|
59
|
+
<>
|
|
60
|
+
{props.icon ? props.icon : <$IconDeep/>}
|
|
61
|
+
</>
|
|
62
|
+
<div className={`
|
|
63
|
+
${$details.summaryDeep$text}
|
|
64
|
+
${$details.summaryDeep$text$$tertiary}
|
|
65
|
+
`}>
|
|
50
66
|
{title}
|
|
51
67
|
</div>
|
|
52
68
|
</div>
|
|
@@ -60,7 +76,8 @@ export function Details(props: DetailsProps) {
|
|
|
60
76
|
|
|
61
77
|
<div className={`
|
|
62
78
|
${$details.content}
|
|
63
|
-
${
|
|
79
|
+
${isDeepKind && $details.content$$secondary}
|
|
80
|
+
${kind === "tertiary" && $details.content$$tertiary}
|
|
64
81
|
`}>
|
|
65
82
|
{children}
|
|
66
83
|
</div>
|
|
@@ -339,4 +339,17 @@ export function IconAppTemplate() {
|
|
|
339
339
|
</clipPath>
|
|
340
340
|
</defs>
|
|
341
341
|
</svg>
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
export function IconQuote() {
|
|
345
|
+
return <svg
|
|
346
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
347
|
+
viewBox="0 0 24 24"
|
|
348
|
+
width="1em"
|
|
349
|
+
height="1em"
|
|
350
|
+
stroke="currentColor"
|
|
351
|
+
fill="currentColor"
|
|
352
|
+
>
|
|
353
|
+
<path d="M14 17h3l2-4V7h-6v6h3M6 17h3l2-4V7H5v6h3z"/>
|
|
354
|
+
</svg>
|
|
342
355
|
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import {css} from "@linaria/core";
|
|
2
|
+
|
|
3
|
+
const colors = {
|
|
4
|
+
primary: "#D1D5DB",
|
|
5
|
+
gray: {
|
|
6
|
+
50: "#F7F7F8",
|
|
7
|
+
100: "#ECECF1",
|
|
8
|
+
600: "#6E6E80",
|
|
9
|
+
800: "#353740",
|
|
10
|
+
900: "#202123"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const TableV2 = {
|
|
15
|
+
Host: css`
|
|
16
|
+
width: 100%;
|
|
17
|
+
overflow-x: auto;
|
|
18
|
+
-webkit-overflow-scrolling: touch;
|
|
19
|
+
`,
|
|
20
|
+
Table: css`
|
|
21
|
+
display: table;
|
|
22
|
+
width: 100%;
|
|
23
|
+
min-width: 640px; // Ensures table doesn't get too squished
|
|
24
|
+
border-collapse: separate;
|
|
25
|
+
border-spacing: 0;
|
|
26
|
+
border: 1px solid ${colors.gray[100]};
|
|
27
|
+
border-radius: 8px;
|
|
28
|
+
font-size: 0.875rem;
|
|
29
|
+
line-height: 1.25rem;
|
|
30
|
+
margin-top: 1rem;
|
|
31
|
+
overflow: hidden;
|
|
32
|
+
`,
|
|
33
|
+
Thead: css`
|
|
34
|
+
background: ${colors.gray[50]};
|
|
35
|
+
`,
|
|
36
|
+
Th: css`
|
|
37
|
+
text-align: left;
|
|
38
|
+
font-weight: 500;
|
|
39
|
+
padding: 0.5rem 1rem;
|
|
40
|
+
color: ${colors.gray[800]};
|
|
41
|
+
vertical-align: middle;
|
|
42
|
+
border-bottom: 1px solid ${colors.gray[100]};
|
|
43
|
+
white-space: nowrap;
|
|
44
|
+
|
|
45
|
+
&:first-child {
|
|
46
|
+
width: 24rem;
|
|
47
|
+
max-width: 40%;
|
|
48
|
+
border-right: 1px solid ${colors.gray[100]};
|
|
49
|
+
|
|
50
|
+
@media (max-width: 768px) {
|
|
51
|
+
width: auto;
|
|
52
|
+
min-width: 12rem;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&.numeric {
|
|
57
|
+
text-align: right;
|
|
58
|
+
font-weight: 400;
|
|
59
|
+
min-width: 5rem;
|
|
60
|
+
|
|
61
|
+
@media (max-width: 768px) {
|
|
62
|
+
min-width: 4rem;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
`,
|
|
66
|
+
Tr: css`
|
|
67
|
+
&:not(:last-child) {
|
|
68
|
+
border-bottom: 1px solid ${colors.gray[100]};
|
|
69
|
+
}
|
|
70
|
+
`,
|
|
71
|
+
Td: css`
|
|
72
|
+
padding: 0.5rem 1rem;
|
|
73
|
+
vertical-align: middle;
|
|
74
|
+
border-top: 1px solid ${colors.gray[100]};
|
|
75
|
+
|
|
76
|
+
&:first-child {
|
|
77
|
+
border-right: 1px solid ${colors.gray[100]};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&.numeric {
|
|
81
|
+
text-align: right;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&.muted {
|
|
85
|
+
color: ${colors.gray[600]};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@media (max-width: 768px) {
|
|
89
|
+
padding: 0.5rem;
|
|
90
|
+
}
|
|
91
|
+
`,
|
|
92
|
+
Cell: css`
|
|
93
|
+
display: flex;
|
|
94
|
+
align-items: baseline;
|
|
95
|
+
width: 100%;
|
|
96
|
+
gap: 0.5rem;
|
|
97
|
+
`,
|
|
98
|
+
CellContent: css`
|
|
99
|
+
flex: 1;
|
|
100
|
+
text-align: right;
|
|
101
|
+
`,
|
|
102
|
+
ModelCell: css`
|
|
103
|
+
display: flex;
|
|
104
|
+
align-items: center;
|
|
105
|
+
gap: 0.5rem;
|
|
106
|
+
white-space: nowrap;
|
|
107
|
+
color: ${colors.gray[900]};
|
|
108
|
+
|
|
109
|
+
@media (max-width: 768px) {
|
|
110
|
+
font-size: 0.8125rem;
|
|
111
|
+
}
|
|
112
|
+
`
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export default {
|
|
116
|
+
TableV2
|
|
117
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
|
|
3
|
+
import cn from "./TableV2.styles";
|
|
4
|
+
|
|
5
|
+
export interface TableV2Props {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function TableV2({children, className}: TableV2Props) {
|
|
11
|
+
return (
|
|
12
|
+
<div className={cn.TableV2.Host}>
|
|
13
|
+
<table className={`${cn.TableV2.Table} ${className || ''}`}>
|
|
14
|
+
{children}
|
|
15
|
+
</table>
|
|
16
|
+
</div>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface TableHeadProps {
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
TableV2.Head = function TableHead({children}: TableHeadProps) {
|
|
25
|
+
return <thead className={cn.TableV2.Thead}>
|
|
26
|
+
{children}
|
|
27
|
+
</thead>
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface TableThProps {
|
|
31
|
+
children: React.ReactNode;
|
|
32
|
+
numeric?: boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
TableV2.Th = function TableTh({children, numeric}: TableThProps) {
|
|
36
|
+
return <th className={`${cn.TableV2.Th} ${numeric ? 'numeric' : ''}`}>
|
|
37
|
+
{children}
|
|
38
|
+
</th>
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface TableTrProps {
|
|
42
|
+
children: React.ReactNode;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
TableV2.Tr = function TableTr({children}: TableTrProps) {
|
|
46
|
+
return <tr className={cn.TableV2.Tr}>
|
|
47
|
+
{children}
|
|
48
|
+
</tr>
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface TableTdProps {
|
|
52
|
+
children: React.ReactNode;
|
|
53
|
+
numeric?: boolean;
|
|
54
|
+
muted?: boolean;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
TableV2.Td = function TableTd({children, numeric, muted}: TableTdProps) {
|
|
58
|
+
return <td className={`${cn.TableV2.Td} ${numeric ? 'numeric' : ''} ${muted ? 'muted' : ''}`}>
|
|
59
|
+
{children}
|
|
60
|
+
</td>
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface TableCellProps {
|
|
64
|
+
children: React.ReactNode;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
TableV2.Cell = function TableCell({children}: TableCellProps) {
|
|
68
|
+
return <div className={cn.TableV2.Cell}>
|
|
69
|
+
<div className={cn.TableV2.CellContent}>
|
|
70
|
+
{children}
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface TableModelCellProps {
|
|
76
|
+
children: React.ReactNode;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
TableV2.ModelCell = function TableModelCell({children}: TableModelCellProps) {
|
|
80
|
+
return <div className={cn.TableV2.ModelCell}>
|
|
81
|
+
{children}
|
|
82
|
+
</div>
|
|
83
|
+
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import e from"react";var a="hn2r3b2",n="hgvnekf";function t(t){var r=t.children,c=t.kind;return e.createElement("button",{className:"\n ".concat(a,"\n ").concat("secondary"===c&&n,"\n ")},r)}var r="h1vbgqbd",c="c1qluffv",l="h7zyorj",s="h10nnuqu";function m(a){var n=a.children;return e.createElement("div",{className:r},e.createElement("div",{className:c},e.createElement("div",{className:l},n)))}var i="h1xgyvqe",v="t1rx1fna",u="s9nduqh";m.Heading=function(a){var n=a.title,t=a.subtitle,r=a.headingEffect;return e.createElement("div",{className:i},e.createElement("h1",{className:v},r?e.createElement("span",{className:s},n):n),e.createElement("p",{className:u},t))};var o="hth6on8";m.ButtonGroup=function(a){var n=a.children;return e.createElement("div",{className:o},n)};export{t as B,m as C};
|
|
2
|
-
//# sourceMappingURL=CTABanner-BytLRAOg.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CTABanner-BytLRAOg.js","sources":["../src/brand/Button/Button.tsx","../src/brand/CTABanner/CTABanner.tsx"],"sourcesContent":["import React from \"react\";\nimport {css} from \"@linaria/core\";\n\nconst $button = {\n host: css`\n display: inline-block;\n border: 1px solid transparent;\n text-align: center;\n font-weight: 600;\n white-space: nowrap;\n border-radius: 20px;\n padding: 0 20px;\n line-height: 38px;\n font-size: 14px;\n border-color: transparent;\n color: #3c3c43;\n background-color: #f7f7f8;\n\n transition: color .25s, border-color .25s, background-color .25s;\n\n &:hover {\n background: #e3e3e6;\n }\n `,\n\n host$$secondary: css`\n color: #fff;\n background-color: rgb(112, 81, 212);\n\n &:hover {\n background-color: rgb(95, 59, 211)\n }\n `\n}\n\nexport interface ButtonProps {\n children: React.ReactNode\n kind?: \"secondary\"\n}\n\nexport function Button({children, kind}: ButtonProps) {\n return <button className={`\n ${$button.host}\n ${kind === \"secondary\" && $button.host$$secondary}\n `}>\n {children}\n </button>\n}","import React from \"react\"\nimport {css} from \"@linaria/core\";\n\nconst $banner = {\n host: css`\n padding: 20px;\n `,\n container: css`\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 80px;\n `,\n hero: css`\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n gap: 40px;\n `,\n headingEffect: css`\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n\n background: -webkit-linear-gradient(\n 120deg,\n var(--headingEffect-color-tertiary) 20%,\n var(--headingEffect-color-tertiary) 30%,\n var(--headingEffect-color-secondary) 60%,\n var(--headingEffect-color-primary) 75%,\n var(--headingEffect-color-primary) 85%\n );\n background-clip: text;\n -webkit-text-fill-color: transparent;\n animation: wave 5s infinite;\n background-size: 200% 200%;\n background-position: 50% 50%; // Start with all colors visible\n\n @keyframes wave {\n 0% {\n background-position: 50% 50%;\n }\n 50% {\n background-position: 0% 50%;\n }\n 100% {\n background-position: 50% 50%;\n }\n }\n `\n}\n\nexport interface CTABannerProps {\n children: React.ReactNode\n}\n\nexport function CTABanner({children}: CTABannerProps) {\n return <div className={$banner.host}>\n <div className={$banner.container}>\n <div className={$banner.hero}>\n {children}\n </div>\n </div>\n </div>\n}\n\nconst $heading = {\n host: css`\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n `,\n title: css`\n font-size: 76px;\n font-weight: 900;\n text-align: center;\n letter-spacing: 3px;\n margin: 0;\n `,\n subtitle: css`\n color: #3c3c43;\n font-size: 46px;\n font-weight: 600;\n text-align: center;\n `\n}\n\nexport interface CTABannerHeadingProps {\n title: string\n subtitle: string | React.ReactNode\n headingEffect?: boolean\n}\n\nCTABanner.Heading = function CTABannerHeading({title, subtitle, headingEffect}: CTABannerHeadingProps) {\n return <div className={$heading.host}>\n <h1 className={$heading.title}>\n {\n headingEffect\n ? <span className={$banner.headingEffect}>\n {title}\n </span>\n : title\n }\n </h1>\n <p className={$heading.subtitle}>\n {subtitle}\n </p>\n </div>\n}\n\nconst $btnGroup = {\n host: css`\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 10px;\n `\n}\n\nCTABanner.ButtonGroup = function CTABannerButtonGroup({children}) {\n return <div className={$btnGroup.host}>\n {children}\n </div>\n}"],"names":["$button","Button","children","_ref","kind","React","createElement","className","concat","$banner","CTABanner","$heading","Heading","CTABannerHeading","title","_ref2","subtitle","headingEffect","$btnGroup","ButtonGroup","CTABannerButtonGroup"],"mappings":"qBAGA,IAAMA,EAoBD,UApBCA,EAsBa,mBAeHC,EAAMA,GAA8B,IAA5BC,EAAQC,EAARD,SAAUE,EAAAA,EAAAA,KAC9B,OAAOC,EAAAC,cAAA,SAAA,CAAQC,UAASC,aAAAA,OAClBR,EAAY,cAAAQ,OACH,cAATJ,GAAwBJ,EAAuB,WAEhDE,EAET,CC5CA,IAAMO,EAGD,WAHCA,EASD,WATCA,EAgBD,UAhBCA,EAiBW,WAsCD,SAAAC,EAASA,GAA2B,IAAzBR,EAAAA,EAAAA,SACvB,OAAOG,EAAKC,cAAA,MAAA,CAAAC,UAAWE,GACnBJ,EAAAC,cAAA,MAAA,CAAKC,UAAWE,GACZJ,EAAKC,cAAA,MAAA,CAAAC,UAAWE,GACXP,IAIjB,CAEA,IAAMS,EAMD,WANCA,EAaD,WAbCA,EAcM,UAcZD,EAAUE,QAAU,SAAyBC,GAAwD,IAAtDC,EAAKC,EAALD,MAAOE,EAAQD,EAARC,SAAUC,EAAAA,EAAAA,cAC5D,OAAOZ,EAAKC,cAAA,MAAA,CAAAC,UAAWI,GACnBN,EAAAC,cAAA,KAAA,CAAIC,UAAWI,GAEPM,EACMZ,wBAAME,UAAWE,GACdK,GAEHA,GAGdT,EAAGC,cAAA,IAAA,CAAAC,UAAWI,GACTK,GAGb,EAEA,IAAME,EACE,UAQRR,EAAUS,YAAc,SAA6BC,GAAW,IAATlB,EAAAA,EAAAA,SACnD,OAAOG,EAAAC,cAAA,MAAA,CAAKC,UAAWW,GAClBhB,EAET"}
|