@unisphere/nx 3.14.0 → 3.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generators/add-documentation/USAGE.md +64 -0
- package/dist/generators/add-documentation/add-documentation.d.ts +1 -1
- package/dist/generators/add-documentation/add-documentation.d.ts.map +1 -1
- package/dist/generators/add-documentation/add-documentation.js +80 -41
- package/dist/generators/add-documentation/schema.d.ts +4 -1
- package/dist/generators/add-documentation/schema.json +19 -10
- package/dist/generators/add-documentation/templates/babel.config.js +3 -0
- package/dist/generators/add-documentation/templates/docs/api/overview.md +8 -0
- package/dist/generators/add-documentation/templates/docs/changelog/overview.md +8 -0
- package/dist/generators/add-documentation/templates/docs/getting-started/overview.md +8 -0
- package/dist/generators/add-documentation/templates/docusaurus.config.ts.template +116 -0
- package/dist/generators/add-documentation/templates/package.json.template +57 -0
- package/dist/generators/add-documentation/templates/postcss.config.js +6 -0
- package/dist/generators/add-documentation/templates/sidebars.ts +9 -0
- package/dist/generators/add-documentation/templates/src/components/demo-placeholder-card.tsx +33 -0
- package/dist/generators/add-documentation/templates/src/components/guides/experiences/genie/integrate-genie-guide.tsx +149 -0
- package/dist/generators/add-documentation/templates/src/components/guides/experiences/notifications/notifications-react-guide.tsx +211 -0
- package/dist/generators/add-documentation/templates/src/components/homepage-features/index.tsx +239 -0
- package/dist/generators/add-documentation/templates/src/components/homepage-features/styles.module.css +87 -0
- package/dist/generators/add-documentation/templates/src/components/homepage-modules/index.tsx +76 -0
- package/dist/generators/add-documentation/templates/src/components/homepage-modules/styles.module.css +120 -0
- package/dist/generators/add-documentation/templates/src/components/homepage-start-now/index.tsx +22 -0
- package/dist/generators/add-documentation/templates/src/components/homepage-start-now/styles.module.css +38 -0
- package/dist/generators/add-documentation/templates/src/components/interactive-code-panel.tsx +258 -0
- package/dist/generators/add-documentation/templates/src/components/introductions/developer-toolbox-experience.tsx +84 -0
- package/dist/generators/add-documentation/templates/src/components/introductions/hello-world-experience.tsx +130 -0
- package/dist/generators/add-documentation/templates/src/components/introductions/notificaitons-experience.tsx +635 -0
- package/dist/generators/add-documentation/templates/src/components/introductions/reactions-experience.tsx +117 -0
- package/dist/generators/add-documentation/templates/src/components/ui-shared/introduction-card.tsx +117 -0
- package/dist/generators/add-documentation/templates/src/components/ui-shared/playground-card.tsx +67 -0
- package/dist/generators/add-documentation/templates/src/components/ui-shared/use-color-mode.ts +20 -0
- package/dist/generators/add-documentation/templates/src/components/ui-shared/utils.ts +8 -0
- package/dist/generators/add-documentation/templates/src/css/custom.css +487 -0
- package/dist/generators/add-documentation/templates/src/css/hero.module.css +190 -0
- package/dist/generators/add-documentation/templates/src/pages/index.module.css +59 -0
- package/dist/generators/add-documentation/templates/src/pages/index.tsx.template +191 -0
- package/dist/generators/add-documentation/templates/src/theme/Navbar/Content/index.tsx +145 -0
- package/dist/generators/add-documentation/templates/src/theme/Navbar/Content/styles.module.css +132 -0
- package/dist/generators/add-documentation/templates/src/theme/Navbar/MobileSidebar/Header/index.tsx +45 -0
- package/dist/generators/add-documentation/templates/static/.nojekyll +0 -0
- package/dist/generators/add-documentation/templates/static/docs/overview/unisphere-for-dummies-1.png +0 -0
- package/dist/generators/add-documentation/templates/static/docs/overview/unisphere-for-dummies-2.png +0 -0
- package/dist/generators/add-documentation/templates/static/docs/overview/unisphere-for-dummies-3.png +0 -0
- package/dist/generators/add-documentation/templates/static/docs/overview/unisphere-for-dummies-4.png +0 -0
- package/dist/generators/add-documentation/templates/static/homepage/divider.svg +5 -0
- package/dist/generators/add-documentation/templates/static/homepage/icons/Architecture.svg +4 -0
- package/dist/generators/add-documentation/templates/static/homepage/icons/Cost.svg +4 -0
- package/dist/generators/add-documentation/templates/static/homepage/icons/ExternalLink.svg +3 -0
- package/dist/generators/add-documentation/templates/static/homepage/icons/Infra.svg +8 -0
- package/dist/generators/add-documentation/templates/static/homepage/icons/Redundancies.svg +6 -0
- package/dist/generators/add-documentation/templates/static/homepage/icons/Speed.svg +6 -0
- package/dist/generators/add-documentation/templates/static/homepage/icons/Standards.svg +4 -0
- package/dist/generators/add-documentation/templates/static/homepage/icons/Unified.svg +12 -0
- package/dist/generators/add-documentation/templates/static/homepage/services/custo.jpg +0 -0
- package/dist/generators/add-documentation/templates/static/homepage/services/flame.jpg +0 -0
- package/dist/generators/add-documentation/templates/static/homepage/services/keepr.jpg +0 -0
- package/dist/generators/add-documentation/templates/static/homepage/services/loggi.jpg +0 -0
- package/dist/generators/add-documentation/templates/static/homepage/services/palleto.jpg +0 -0
- package/dist/generators/add-documentation/templates/static/homepage/services/publi.jpg +0 -0
- package/dist/generators/add-documentation/templates/static/homepage/services/tinker.jpg +0 -0
- package/dist/generators/add-documentation/templates/static/img/favicon.ico +0 -0
- package/dist/generators/add-documentation/templates/static/img/logo.svg +6 -0
- package/dist/generators/add-documentation/templates/static/img/logo_big.svg +12 -0
- package/dist/generators/add-documentation/templates/static/img/logo_big_dark.svg +12 -0
- package/dist/generators/add-documentation/templates/static/img/logo_dark.svg +6 -0
- package/dist/generators/add-documentation/templates/static/img/unisphere-social-card.jpg +0 -0
- package/dist/generators/add-documentation/templates/static/llm/INTEGRATE.md +497 -0
- package/dist/generators/add-documentation/templates/static/robots.txt +5 -0
- package/dist/generators/add-documentation/templates/static/team/amirc.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/erans.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/hadass.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/hillelc.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/idoz.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/lianb.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/nirb.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/nivs.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/omric.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/roeed.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/sivana.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/stask.png +0 -0
- package/dist/generators/add-documentation/templates/static/team/tanyal.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/tomere.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/tornikem.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/yairn.jpeg +0 -0
- package/dist/generators/add-documentation/templates/tailwind.config.js +30 -0
- package/dist/generators/add-documentation/templates/tsconfig.json +7 -0
- package/dist/generators/add-package/add-package.d.ts.map +1 -1
- package/dist/generators/add-package/add-package.js +9 -4
- package/dist/generators/add-package/schema.d.ts +1 -1
- package/dist/generators/add-package/schema.json +18 -10
- package/dist/generators/rename-package/rename-package.d.ts.map +1 -1
- package/dist/generators/rename-package/rename-package.js +12 -0
- package/dist/generators/utils.d.ts +1 -1
- package/dist/generators/utils.d.ts.map +1 -1
- package/dist/generators/utils.js +8 -10
- package/dist/migrations/3-15-0/add-experience-documentation.d.ts +10 -0
- package/dist/migrations/3-15-0/add-experience-documentation.d.ts.map +1 -0
- package/dist/migrations/3-15-0/add-experience-documentation.js +20 -0
- package/dist/migrations/3-16-0/remove-rollup-patch.d.ts +10 -0
- package/dist/migrations/3-16-0/remove-rollup-patch.d.ts.map +1 -0
- package/dist/migrations/3-16-0/remove-rollup-patch.js +32 -0
- package/dist/migrations/3-6-3/remove-rollup-patch.d.ts +1 -1
- package/dist/migrations/3-6-3/remove-rollup-patch.d.ts.map +1 -1
- package/dist/migrations/3-6-3/remove-rollup-patch.js +16 -6
- package/dist/migrations/3-7-0/update-gitignore-claude-exclusions.d.ts +9 -0
- package/dist/migrations/3-7-0/update-gitignore-claude-exclusions.d.ts.map +1 -0
- package/dist/migrations/3-7-0/update-gitignore-claude-exclusions.js +68 -0
- package/dist/shared.d.ts +4 -2
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +3 -1
- package/migrations.json +35 -0
- package/package.json +1 -1
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { getUnisphereInstance } from '@unisphere/runtime-js'
|
|
4
|
+
import { useEffect } from 'react'
|
|
5
|
+
import { useState } from 'react';
|
|
6
|
+
import { PlaygroundCard } from '@site/src/components/ui-shared/playground-card';
|
|
7
|
+
|
|
8
|
+
export const ReactionsExperience = ({ preload }: { preload?: boolean }) => {
|
|
9
|
+
|
|
10
|
+
const [loaded, setLoaded] = useState(false);
|
|
11
|
+
|
|
12
|
+
const loadReactionsExperience = async () => {
|
|
13
|
+
try {
|
|
14
|
+
setLoaded(true);
|
|
15
|
+
const workspace = await getUnisphereInstance('')
|
|
16
|
+
const runtime = await workspace.loadRuntime('unisphere.widget.reactions', 'showcase', {
|
|
17
|
+
autoStart: true
|
|
18
|
+
});
|
|
19
|
+
(runtime?.runtime as any).assignArea('reactions-experience-container');
|
|
20
|
+
|
|
21
|
+
} catch (e) {
|
|
22
|
+
console.error(e)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
if (preload) {
|
|
28
|
+
loadReactionsExperience();
|
|
29
|
+
}
|
|
30
|
+
}, [preload])
|
|
31
|
+
|
|
32
|
+
const playIcon = (
|
|
33
|
+
<svg
|
|
34
|
+
width="32"
|
|
35
|
+
height="32"
|
|
36
|
+
viewBox="0 0 24 24"
|
|
37
|
+
fill="none"
|
|
38
|
+
stroke="currentColor"
|
|
39
|
+
strokeWidth="1.5"
|
|
40
|
+
style={{
|
|
41
|
+
color: 'var(--ifm-color-content-secondary)',
|
|
42
|
+
opacity: 0.7
|
|
43
|
+
}}
|
|
44
|
+
>
|
|
45
|
+
<circle cx="12" cy="12" r="10" />
|
|
46
|
+
<polygon points="10,8 16,12 10,16 10,8" />
|
|
47
|
+
</svg>
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<PlaygroundCard
|
|
52
|
+
title="Playground - Loading Experience"
|
|
53
|
+
icon={!loaded ? playIcon : undefined}
|
|
54
|
+
>
|
|
55
|
+
<div style={{ marginBottom: '1rem' }}>
|
|
56
|
+
{loaded ? (
|
|
57
|
+
<div style={{ color: 'var(--ifm-color-content-secondary)', fontSize: '0.9rem', marginBottom: '0.5rem' }}>
|
|
58
|
+
This reactions experience is {preload ? 'preloaded' : 'dynamically loaded at runtime'} with just about five lines of code.
|
|
59
|
+
<br />
|
|
60
|
+
<strong style={{ color: 'var(--ifm-color-content)' }}>Try hovering over the reactions below!</strong>
|
|
61
|
+
</div>
|
|
62
|
+
) : (
|
|
63
|
+
<div style={{ color: 'var(--ifm-color-content-secondary)', fontSize: '0.9rem' }}>
|
|
64
|
+
Lazy load the reactions experience in demo mode (backend connection disabled)
|
|
65
|
+
</div>
|
|
66
|
+
)}
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<div
|
|
70
|
+
style={{
|
|
71
|
+
display: 'inline-flex',
|
|
72
|
+
alignItems: 'center',
|
|
73
|
+
gap: '12px',
|
|
74
|
+
padding: '12px 24px',
|
|
75
|
+
backgroundColor: 'var(--ifm-background-surface-color)',
|
|
76
|
+
borderRadius: 'var(--ifm-code-border-radius)',
|
|
77
|
+
border: '1px solid var(--uc-border-color)',
|
|
78
|
+
boxShadow: 'var(--ifm-global-shadow-lw)',
|
|
79
|
+
flexWrap: 'wrap',
|
|
80
|
+
justifyContent: 'center',
|
|
81
|
+
minHeight: '48px',
|
|
82
|
+
}}
|
|
83
|
+
>
|
|
84
|
+
<div id="reactions-experience-container"></div>
|
|
85
|
+
{!loaded && (
|
|
86
|
+
<button
|
|
87
|
+
onClick={loadReactionsExperience}
|
|
88
|
+
style={{
|
|
89
|
+
padding: '8px 16px',
|
|
90
|
+
background: 'var(--ifm-color-primary)',
|
|
91
|
+
color: 'white',
|
|
92
|
+
border: 'none',
|
|
93
|
+
borderRadius: 'var(--ifm-code-border-radius)',
|
|
94
|
+
fontSize: '14px',
|
|
95
|
+
fontWeight: '500',
|
|
96
|
+
cursor: 'pointer',
|
|
97
|
+
transition: 'all 0.2s ease',
|
|
98
|
+
boxShadow: 'var(--ifm-global-shadow-lw)',
|
|
99
|
+
}}
|
|
100
|
+
onMouseEnter={(e) => {
|
|
101
|
+
e.currentTarget.style.backgroundColor = 'var(--ifm-color-primary-dark)';
|
|
102
|
+
e.currentTarget.style.transform = 'translateY(-1px)';
|
|
103
|
+
e.currentTarget.style.boxShadow = 'var(--ifm-global-shadow-md)';
|
|
104
|
+
}}
|
|
105
|
+
onMouseLeave={(e) => {
|
|
106
|
+
e.currentTarget.style.backgroundColor = 'var(--ifm-color-primary)';
|
|
107
|
+
e.currentTarget.style.transform = 'translateY(0)';
|
|
108
|
+
e.currentTarget.style.boxShadow = 'var(--ifm-global-shadow-lw)';
|
|
109
|
+
}}
|
|
110
|
+
>
|
|
111
|
+
Load Reactions Experience
|
|
112
|
+
</button>
|
|
113
|
+
)}
|
|
114
|
+
</div>
|
|
115
|
+
</PlaygroundCard>
|
|
116
|
+
);
|
|
117
|
+
}
|
package/dist/generators/add-documentation/templates/src/components/ui-shared/introduction-card.tsx
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { invertHex } from '@site/src/components/ui-shared/utils';
|
|
3
|
+
import { useColorMode } from '@site/src/components/ui-shared/use-color-mode';
|
|
4
|
+
|
|
5
|
+
interface IntroductionCardProps {
|
|
6
|
+
title: string;
|
|
7
|
+
header?: string;
|
|
8
|
+
content: string;
|
|
9
|
+
backgroundColor: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const IntroductionCard: React.FC<IntroductionCardProps> = ({
|
|
14
|
+
title,
|
|
15
|
+
header,
|
|
16
|
+
content,
|
|
17
|
+
backgroundColor,
|
|
18
|
+
className = ''
|
|
19
|
+
}) => {
|
|
20
|
+
const colorMode = useColorMode();
|
|
21
|
+
|
|
22
|
+
// More subtle background colors with better contrast
|
|
23
|
+
const cardBgColor = colorMode === 'dark'
|
|
24
|
+
? `${invertHex(backgroundColor)}15` // Very subtle tint
|
|
25
|
+
: `${backgroundColor}40`; // Reduced opacity for subtlety
|
|
26
|
+
const textColor = colorMode === 'dark' ? '#f1f5f9' : '#0f172a';
|
|
27
|
+
const headerColor = colorMode === 'dark' ? '#94a3b8' : '#475569';
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<article
|
|
31
|
+
className={`group relative flex-1 min-w-0 transition-all duration-200 ease-out hover:scale-[1.01] focus-within:scale-[1.01] ${className}`}
|
|
32
|
+
style={{
|
|
33
|
+
minWidth: '280px',
|
|
34
|
+
}}
|
|
35
|
+
role="article"
|
|
36
|
+
aria-labelledby={`card-title-${title.toLowerCase().replace(/\s+/g, '-')}`}
|
|
37
|
+
>
|
|
38
|
+
{/* Card container with modern styling */}
|
|
39
|
+
<div
|
|
40
|
+
className="relative h-full overflow-hidden"
|
|
41
|
+
style={{
|
|
42
|
+
backgroundColor: cardBgColor,
|
|
43
|
+
borderRadius: '12px',
|
|
44
|
+
border: colorMode === 'dark'
|
|
45
|
+
? '1px solid rgba(255, 255, 255, 0.08)'
|
|
46
|
+
: '1px solid rgba(0, 0, 0, 0.08)',
|
|
47
|
+
boxShadow: colorMode === 'dark'
|
|
48
|
+
? '0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 1px 2px -1px rgba(0, 0, 0, 0.1)'
|
|
49
|
+
: '0 2px 4px -1px rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.04)',
|
|
50
|
+
}}
|
|
51
|
+
>
|
|
52
|
+
{/* Subtle gradient overlay for depth */}
|
|
53
|
+
<div
|
|
54
|
+
className="absolute inset-0 opacity-30"
|
|
55
|
+
style={{
|
|
56
|
+
background: colorMode === 'dark'
|
|
57
|
+
? 'linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%)'
|
|
58
|
+
: 'linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.2) 100%)',
|
|
59
|
+
}}
|
|
60
|
+
/>
|
|
61
|
+
|
|
62
|
+
{/* Content container */}
|
|
63
|
+
<div className="relative z-10 p-4 sm:p-5 h-full flex flex-col">
|
|
64
|
+
{/* Title */}
|
|
65
|
+
<h2
|
|
66
|
+
id={`card-title-${title.toLowerCase().replace(/\s+/g, '-')}`}
|
|
67
|
+
className="text-base sm:text-lg font-semibold leading-tight mb-2 text-center"
|
|
68
|
+
style={{
|
|
69
|
+
color: textColor,
|
|
70
|
+
fontWeight: '600',
|
|
71
|
+
letterSpacing: '-0.015em',
|
|
72
|
+
}}
|
|
73
|
+
>
|
|
74
|
+
{title}
|
|
75
|
+
</h2>
|
|
76
|
+
|
|
77
|
+
{/* Header/Subtitle */}
|
|
78
|
+
{header && (
|
|
79
|
+
<div className="mb-3">
|
|
80
|
+
<h3
|
|
81
|
+
className="text-xs sm:text-sm font-medium italic text-center leading-snug"
|
|
82
|
+
style={{
|
|
83
|
+
color: headerColor,
|
|
84
|
+
fontWeight: '500',
|
|
85
|
+
}}
|
|
86
|
+
>
|
|
87
|
+
{header}
|
|
88
|
+
</h3>
|
|
89
|
+
</div>
|
|
90
|
+
)}
|
|
91
|
+
|
|
92
|
+
{/* Content */}
|
|
93
|
+
<div className="flex-1 flex items-center justify-center">
|
|
94
|
+
<p
|
|
95
|
+
className="text-xs sm:text-sm leading-relaxed text-center max-w-none"
|
|
96
|
+
style={{
|
|
97
|
+
color: textColor,
|
|
98
|
+
lineHeight: '1.5',
|
|
99
|
+
opacity: 0.85,
|
|
100
|
+
}}
|
|
101
|
+
>
|
|
102
|
+
{content}
|
|
103
|
+
</p>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
{/* Hover effect border */}
|
|
108
|
+
<div
|
|
109
|
+
className="absolute inset-0 rounded-xl opacity-0 group-hover:opacity-60 transition-opacity duration-200 pointer-events-none"
|
|
110
|
+
style={{
|
|
111
|
+
border: '1px solid rgba(59, 130, 246, 0.2)',
|
|
112
|
+
}}
|
|
113
|
+
/>
|
|
114
|
+
</div>
|
|
115
|
+
</article>
|
|
116
|
+
);
|
|
117
|
+
};
|
package/dist/generators/add-documentation/templates/src/components/ui-shared/playground-card.tsx
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React, { ReactNode, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
interface PlaygroundCardProps {
|
|
4
|
+
title: string;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
maxWidth?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const PlaygroundCard: React.FC<PlaygroundCardProps> = ({
|
|
11
|
+
title,
|
|
12
|
+
children,
|
|
13
|
+
icon,
|
|
14
|
+
maxWidth = '600px'
|
|
15
|
+
}) => {
|
|
16
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div
|
|
20
|
+
className="playground-card"
|
|
21
|
+
style={{
|
|
22
|
+
maxWidth,
|
|
23
|
+
margin: '2rem auto',
|
|
24
|
+
backgroundColor: isHovered ? 'var(--ifm-background-surface-color)' : 'var(--ifm-background-color)',
|
|
25
|
+
border: `1px solid ${isHovered ? 'var(--ifm-color-primary)' : 'var(--uc-border-color)'}`,
|
|
26
|
+
borderRadius: 'var(--ifm-card-border-radius)',
|
|
27
|
+
padding: '2rem',
|
|
28
|
+
textAlign: 'center',
|
|
29
|
+
transition: 'all 0.2s ease-in-out',
|
|
30
|
+
boxShadow: isHovered ? 'var(--ifm-global-shadow-md)' : 'var(--ifm-global-shadow-lw)',
|
|
31
|
+
transform: isHovered ? 'translateY(-2px)' : 'translateY(0)',
|
|
32
|
+
}}
|
|
33
|
+
onMouseEnter={() => setIsHovered(true)}
|
|
34
|
+
onMouseLeave={() => setIsHovered(false)}
|
|
35
|
+
>
|
|
36
|
+
{icon && (
|
|
37
|
+
<div style={{ marginBottom: '1rem' }}>
|
|
38
|
+
{icon}
|
|
39
|
+
</div>
|
|
40
|
+
)}
|
|
41
|
+
|
|
42
|
+
<h3
|
|
43
|
+
style={{
|
|
44
|
+
color: 'var(--ifm-heading-color)',
|
|
45
|
+
fontWeight: 'var(--ifm-heading-font-weight)',
|
|
46
|
+
marginBottom: '1rem',
|
|
47
|
+
fontSize: '1.25rem',
|
|
48
|
+
margin: '0 0 1rem 0'
|
|
49
|
+
}}
|
|
50
|
+
>
|
|
51
|
+
{title}
|
|
52
|
+
</h3>
|
|
53
|
+
|
|
54
|
+
<div
|
|
55
|
+
style={{
|
|
56
|
+
color: 'var(--ifm-color-content-secondary)',
|
|
57
|
+
lineHeight: 'var(--ifm-line-height-base)',
|
|
58
|
+
fontSize: '0.9rem'
|
|
59
|
+
}}
|
|
60
|
+
>
|
|
61
|
+
{children}
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export default PlaygroundCard;
|
package/dist/generators/add-documentation/templates/src/components/ui-shared/use-color-mode.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useMemo, useRef } from 'react';
|
|
2
|
+
import { useColorMode as useDocuColorMode } from '@docusaurus/theme-common';
|
|
3
|
+
import useIsBrowser from '@docusaurus/useIsBrowser';
|
|
4
|
+
|
|
5
|
+
export const useColorMode = () => {
|
|
6
|
+
const { colorMode } = useDocuColorMode();
|
|
7
|
+
const isBrowser = useIsBrowser();
|
|
8
|
+
const renderCount = useRef(0);
|
|
9
|
+
|
|
10
|
+
return useMemo(() => {
|
|
11
|
+
if (!isBrowser) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
renderCount.current += 1;
|
|
15
|
+
if (renderCount.current === 1) {
|
|
16
|
+
return document.documentElement.getAttribute('data-theme');
|
|
17
|
+
}
|
|
18
|
+
return colorMode;
|
|
19
|
+
}, [colorMode, isBrowser]);
|
|
20
|
+
};
|