@chassis-ui/docs 0.6.3 → 0.8.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/CHANGELOG.md +13 -0
- package/README.md +50 -7
- package/UPGRADING.md +140 -0
- package/package.json +11 -3
- package/src/cli/assets.js +57 -9
- package/src/cli/main.js +32 -5
- package/src/components/DocsSidebar.astro +100 -102
- package/src/components/FeatureCard.astro +5 -7
- package/src/components/NavLink.astro +1 -1
- package/src/components/TableOfContents.astro +10 -12
- package/src/components/ThemeToggler.astro +5 -2
- package/src/components/shortcodes/Blockquote.astro +11 -13
- package/src/components/shortcodes/CSSOnly.astro +3 -3
- package/src/components/shortcodes/Code.astro +104 -108
- package/src/components/shortcodes/DeprecatedIn.astro +1 -3
- package/src/components/shortcodes/Example.astro +29 -33
- package/src/components/shortcodes/Icon.astro +19 -21
- package/src/components/shortcodes/InFigma.astro +3 -3
- package/src/components/shortcodes/Placeholder.astro +14 -16
- package/src/components/shortcodes/ResizableExample.astro +3 -5
- package/src/js/search.js +2 -2
- package/src/layouts/BaseLayout.astro +14 -20
- package/src/layouts/DocsLayout.astro +51 -52
- package/src/layouts/SingleLayout.astro +2 -2
- package/src/layouts/footer/Consent.astro +18 -20
- package/src/layouts/footer/Footer.astro +62 -26
- package/src/layouts/head/Head.astro +7 -10
- package/src/layouts/header/Navigation.astro +73 -58
- package/src/layouts/header/SearchDialog.astro +10 -4
- package/src/layouts/header/SearchTrigger.astro +2 -4
- package/src/layouts/header/Skippy.astro +8 -8
- package/src/scss/_layout.scss +1 -1
|
@@ -16,120 +16,118 @@ const docsPages = await getDocsPages()
|
|
|
16
16
|
|
|
17
17
|
<nav class="cxd-links w-100" id="cxd-docs-nav" aria-label="Docs navigation">
|
|
18
18
|
<menu class="p-0 m-0">
|
|
19
|
-
{
|
|
20
|
-
|
|
21
|
-
const groupSlug = getSlug(group.title)
|
|
19
|
+
{sidebar.map((group) => {
|
|
20
|
+
const groupSlug = getSlug(group.title)
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const url = getDocsPath(unversionedPageSlug)
|
|
52
|
-
const active = Astro.params.slug === unversionedPageSlug
|
|
22
|
+
if (group.pages) {
|
|
23
|
+
return (
|
|
24
|
+
<li
|
|
25
|
+
class:list={[
|
|
26
|
+
'cxd-links-group',
|
|
27
|
+
groupSlug === Astro.params.slug?.split('/')[0] ? 'active' : undefined
|
|
28
|
+
]}
|
|
29
|
+
>
|
|
30
|
+
<strong class="cxd-links-heading">
|
|
31
|
+
{group.icon && (
|
|
32
|
+
<Icon
|
|
33
|
+
name={group.icon}
|
|
34
|
+
style={group.iconColor && `color: var(--cx-${group.iconColor});`}
|
|
35
|
+
/>
|
|
36
|
+
)}
|
|
37
|
+
{group.title}
|
|
38
|
+
</strong>
|
|
39
|
+
<ul class="nav flex-column cxd-links-nav">
|
|
40
|
+
{group.pages?.map((item: SidebarItem) => {
|
|
41
|
+
// Handle sub-groups
|
|
42
|
+
if (item.group && item.pages) {
|
|
43
|
+
return (
|
|
44
|
+
<>
|
|
45
|
+
<li class="cxd-links-subgroup">{item.group}</li>
|
|
46
|
+
{item.pages.map((page: SidebarSubItem) => {
|
|
47
|
+
const docSlug = getSlug(page.title)
|
|
48
|
+
const unversionedPageSlug = `${groupSlug}/${docSlug}`
|
|
53
49
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
)
|
|
50
|
+
const url = getDocsPath(unversionedPageSlug)
|
|
51
|
+
const active = Astro.params.slug === unversionedPageSlug
|
|
57
52
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
`The page '${page.title}' referenced in 'data/sidebar.yml' does not exist at '${url}'.`
|
|
62
|
-
)
|
|
63
|
-
}
|
|
53
|
+
const generatedPage = docsPages.find(
|
|
54
|
+
(page) => page.id === unversionedPageSlug
|
|
55
|
+
)
|
|
64
56
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
class:list={['cxd-links-link', { active }]}
|
|
70
|
-
aria-current={active ? 'page' : undefined}
|
|
71
|
-
>
|
|
72
|
-
{page.title}
|
|
73
|
-
</a>
|
|
74
|
-
</li>
|
|
57
|
+
// This test should not be necessary, see comments for `getSlug()` in `src/libs/utils.ts`.
|
|
58
|
+
if (!generatedPage) {
|
|
59
|
+
throw new Error(
|
|
60
|
+
`The page '${page.title}' referenced in 'data/sidebar.yml' does not exist at '${url}'.`
|
|
75
61
|
)
|
|
76
|
-
}
|
|
77
|
-
</>
|
|
78
|
-
)
|
|
79
|
-
}
|
|
62
|
+
}
|
|
80
63
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
64
|
+
return (
|
|
65
|
+
<li>
|
|
66
|
+
<a
|
|
67
|
+
href={url}
|
|
68
|
+
class:list={['cxd-links-link', { active }]}
|
|
69
|
+
aria-current={active ? 'page' : undefined}
|
|
70
|
+
>
|
|
71
|
+
{page.title}
|
|
72
|
+
</a>
|
|
73
|
+
</li>
|
|
74
|
+
)
|
|
75
|
+
})}
|
|
76
|
+
</>
|
|
77
|
+
)
|
|
78
|
+
}
|
|
85
79
|
|
|
86
|
-
|
|
87
|
-
|
|
80
|
+
// Handle regular pages
|
|
81
|
+
if (!item.title) {
|
|
82
|
+
return null
|
|
83
|
+
}
|
|
88
84
|
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
const docSlug = getSlug(item.title)
|
|
86
|
+
const unversionedPageSlug = `${groupSlug}/${docSlug}`
|
|
91
87
|
|
|
92
|
-
|
|
88
|
+
const url = getDocsPath(unversionedPageSlug)
|
|
89
|
+
const active = Astro.params.slug === unversionedPageSlug
|
|
93
90
|
|
|
94
|
-
|
|
95
|
-
if (!generatedPage) {
|
|
96
|
-
throw new Error(
|
|
97
|
-
`The page '${item.title}' referenced in 'data/sidebar.yml' does not exist at '${url}'.`
|
|
98
|
-
)
|
|
99
|
-
}
|
|
91
|
+
const generatedPage = docsPages.find((page) => page.id === unversionedPageSlug)
|
|
100
92
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
class:list={['cxd-links-link', { active }]}
|
|
106
|
-
aria-current={active ? 'page' : undefined}
|
|
107
|
-
>
|
|
108
|
-
{item.title}
|
|
109
|
-
</a>
|
|
110
|
-
</li>
|
|
93
|
+
// This test should not be necessary, see comments for `getSlug()` in `src/libs/utils.ts`.
|
|
94
|
+
if (!generatedPage) {
|
|
95
|
+
throw new Error(
|
|
96
|
+
`The page '${item.title}' referenced in 'data/sidebar.yml' does not exist at '${url}'.`
|
|
111
97
|
)
|
|
112
|
-
}
|
|
113
|
-
</ul>
|
|
114
|
-
</li>
|
|
115
|
-
)
|
|
116
|
-
} else {
|
|
117
|
-
const active = Astro.params.slug === groupSlug
|
|
98
|
+
}
|
|
118
99
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
100
|
+
return (
|
|
101
|
+
<li>
|
|
102
|
+
<a
|
|
103
|
+
href={url}
|
|
104
|
+
class:list={['cxd-links-link', { active }]}
|
|
105
|
+
aria-current={active ? 'page' : undefined}
|
|
106
|
+
>
|
|
107
|
+
{item.title}
|
|
108
|
+
</a>
|
|
109
|
+
</li>
|
|
110
|
+
)
|
|
111
|
+
})}
|
|
112
|
+
</ul>
|
|
113
|
+
</li>
|
|
114
|
+
)
|
|
115
|
+
} else {
|
|
116
|
+
const active = Astro.params.slug === groupSlug
|
|
117
|
+
|
|
118
|
+
return (
|
|
119
|
+
<>
|
|
120
|
+
<li class="cxd-links-span-all mt-2xs mb-md mx-lg border-top" />
|
|
121
|
+
<a
|
|
122
|
+
href={getDocsPath(`${groupSlug}/`)}
|
|
123
|
+
class:list={['cxd-links-link cxd-links-span-all', { active }]}
|
|
124
|
+
aria-current={active ? 'page' : undefined}
|
|
125
|
+
>
|
|
126
|
+
{group.title}
|
|
127
|
+
</a>
|
|
128
|
+
</>
|
|
129
|
+
)
|
|
130
|
+
}
|
|
131
|
+
})}
|
|
134
132
|
</menu>
|
|
135
133
|
</nav>
|
|
@@ -44,13 +44,11 @@ const headerClasses = [
|
|
|
44
44
|
|
|
45
45
|
<div class={cardClasses}>
|
|
46
46
|
<div class={headerClasses}>
|
|
47
|
-
{
|
|
48
|
-
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
)
|
|
53
|
-
}
|
|
47
|
+
{icon && (
|
|
48
|
+
<div class="feature-thumb">
|
|
49
|
+
<Icon name={icon} class="feature-icon icon-3xl md:icon-4xl" sprite="" />
|
|
50
|
+
</div>
|
|
51
|
+
)}
|
|
54
52
|
<div>
|
|
55
53
|
<h3 class="feature-title font-lg md:font-xl mb-3xs md:mb-2xs">
|
|
56
54
|
<slot name="title" />
|
|
@@ -27,16 +27,14 @@ let entryLevel = level ? level + 1 : 1
|
|
|
27
27
|
---
|
|
28
28
|
|
|
29
29
|
<ul>
|
|
30
|
-
{
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
})
|
|
41
|
-
}
|
|
30
|
+
{toc.map(({ children, slug, text }) => {
|
|
31
|
+
return (
|
|
32
|
+
<li>
|
|
33
|
+
<a href={`#${slug}`} class={`level-${entryLevel}`}>
|
|
34
|
+
{text}
|
|
35
|
+
</a>
|
|
36
|
+
{children.length > 0 && <Astro.self entries={children} level={entryLevel} />}
|
|
37
|
+
</li>
|
|
38
|
+
)
|
|
39
|
+
})}
|
|
42
40
|
</ul>
|
|
@@ -26,9 +26,12 @@ const { layout } = Astro.props
|
|
|
26
26
|
data-cx-placement="bottom-end"
|
|
27
27
|
>
|
|
28
28
|
<Icon name="circle-half-solid" class="theme-icon-active" />
|
|
29
|
-
<span
|
|
30
|
-
|
|
29
|
+
<span
|
|
30
|
+
class=`${layout === 'examples' ? 'visually-hidden' : 'lg:d-none ms-xs'}`
|
|
31
|
+
id="cxd-theme-text"
|
|
31
32
|
>
|
|
33
|
+
Toggle theme
|
|
34
|
+
</span>
|
|
32
35
|
</button>
|
|
33
36
|
<ul class="menu" role="menu" aria-label="Theme options">
|
|
34
37
|
<li>
|
|
@@ -13,19 +13,17 @@ interface Props {
|
|
|
13
13
|
const { attr } = Astro.props
|
|
14
14
|
---
|
|
15
15
|
|
|
16
|
-
{
|
|
17
|
-
|
|
18
|
-
<figure>
|
|
19
|
-
<blockquote class="blockquote">
|
|
20
|
-
<slot />
|
|
21
|
-
</blockquote>
|
|
22
|
-
<figcaption class="attribution">
|
|
23
|
-
<Fragment set:html={attr} />
|
|
24
|
-
</figcaption>
|
|
25
|
-
</figure>
|
|
26
|
-
) : (
|
|
16
|
+
{attr ? (
|
|
17
|
+
<figure>
|
|
27
18
|
<blockquote class="blockquote">
|
|
28
19
|
<slot />
|
|
29
20
|
</blockquote>
|
|
30
|
-
|
|
31
|
-
}
|
|
21
|
+
<figcaption class="attribution">
|
|
22
|
+
<Fragment set:html={attr} />
|
|
23
|
+
</figcaption>
|
|
24
|
+
</figure>
|
|
25
|
+
) : (
|
|
26
|
+
<blockquote class="blockquote">
|
|
27
|
+
<slot />
|
|
28
|
+
</blockquote>
|
|
29
|
+
)}
|
|
@@ -15,6 +15,6 @@ const { tooltip = 'This feature is only available in CSS and not in Figma compon
|
|
|
15
15
|
Astro.props
|
|
16
16
|
---
|
|
17
17
|
|
|
18
|
-
<span class="badge lg info smooth mb-md rounded-md" data-cx-toggle="tooltip" title={tooltip}
|
|
19
|
-
|
|
20
|
-
>
|
|
18
|
+
<span class="badge lg info smooth mb-md rounded-md" data-cx-toggle="tooltip" title={tooltip}>
|
|
19
|
+
CSS Only
|
|
20
|
+
</span>
|
|
@@ -164,103 +164,86 @@ if (codeToDisplay && detectedLang) {
|
|
|
164
164
|
})
|
|
165
165
|
</script>
|
|
166
166
|
|
|
167
|
-
{
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
167
|
+
{nestedInExample && !noToolbar && (
|
|
168
|
+
<div class="cxd-snippet-toolbar">
|
|
169
|
+
{file ? (
|
|
170
|
+
<a
|
|
171
|
+
class="text-decoration-none font-code fg-subtle text-uppercase"
|
|
172
|
+
href={fileUrl}
|
|
173
|
+
target="_blank"
|
|
174
|
+
rel="noopener noreferrer"
|
|
175
|
+
>
|
|
176
|
+
{file}
|
|
177
|
+
</a>
|
|
178
|
+
) : (
|
|
179
|
+
<small class="font-code fg-subtle text-uppercase">{displayLang}</small>
|
|
180
|
+
)}
|
|
181
|
+
<div class="d-flex ms-auto gap-2xs">
|
|
182
|
+
{hasPreview && (
|
|
183
|
+
<>
|
|
184
|
+
<button
|
|
185
|
+
type="button"
|
|
186
|
+
class="button-mode"
|
|
187
|
+
title="Toggle color mode"
|
|
188
|
+
aria-label="Toggle color mode"
|
|
189
|
+
onclick="toggleTheme(this)"
|
|
190
|
+
>
|
|
191
|
+
<Icon name="swatchbook-solid" />
|
|
192
|
+
</button>
|
|
193
|
+
<span class="vr mx-2xs" />
|
|
194
|
+
<button
|
|
195
|
+
type="button"
|
|
196
|
+
class="button-edit"
|
|
197
|
+
title="Try it on StackBlitz"
|
|
198
|
+
aria-label="Try it on StackBlitz"
|
|
199
|
+
data-sb-js-snippet={addStackblitzJs ? true : undefined}
|
|
200
|
+
>
|
|
201
|
+
<Icon name="lightning-solid" />
|
|
202
|
+
</button>
|
|
203
|
+
</>
|
|
181
204
|
)}
|
|
182
|
-
<
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
onclick="toggleTheme(this)"
|
|
191
|
-
>
|
|
192
|
-
<Icon name="swatchbook-solid" />
|
|
193
|
-
</button>
|
|
194
|
-
<span class="vr mx-2xs" />
|
|
195
|
-
<button
|
|
196
|
-
type="button"
|
|
197
|
-
class="button-edit"
|
|
198
|
-
title="Try it on StackBlitz"
|
|
199
|
-
aria-label="Try it on StackBlitz"
|
|
200
|
-
data-sb-js-snippet={addStackblitzJs ? true : undefined}
|
|
201
|
-
>
|
|
202
|
-
<Icon name="lightning-solid" />
|
|
203
|
-
</button>
|
|
204
|
-
</>
|
|
205
|
-
)}
|
|
206
|
-
<button
|
|
207
|
-
type="button"
|
|
208
|
-
class="button-clipboard"
|
|
209
|
-
title="Copy to clipboard"
|
|
210
|
-
aria-label="Copy to clipboard"
|
|
211
|
-
>
|
|
212
|
-
<Icon name="clipboard-outline" />
|
|
213
|
-
</button>
|
|
214
|
-
</div>
|
|
205
|
+
<button
|
|
206
|
+
type="button"
|
|
207
|
+
class="button-clipboard"
|
|
208
|
+
title="Copy to clipboard"
|
|
209
|
+
aria-label="Copy to clipboard"
|
|
210
|
+
>
|
|
211
|
+
<Icon name="clipboard-outline" />
|
|
212
|
+
</button>
|
|
215
213
|
</div>
|
|
216
|
-
|
|
217
|
-
}
|
|
214
|
+
</div>
|
|
215
|
+
)}
|
|
218
216
|
|
|
219
|
-
{
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
{
|
|
223
|
-
<
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
<div class="d-flex ms-auto gap-2xs">
|
|
250
|
-
<button
|
|
251
|
-
type="button"
|
|
252
|
-
class="button-clipboard"
|
|
253
|
-
title="Copy to clipboard"
|
|
254
|
-
aria-label="Copy to clipboard"
|
|
255
|
-
>
|
|
256
|
-
<Icon name="clipboard-outline" />
|
|
257
|
-
</button>
|
|
258
|
-
</div>
|
|
259
|
-
</div>
|
|
260
|
-
)}
|
|
261
|
-
<slot name="pre" />
|
|
262
|
-
{!Astro.slots.has('pre') && noToolbar ? (
|
|
263
|
-
<div class="cxd-clipboard">
|
|
217
|
+
{nestedInExample ? (
|
|
218
|
+
<>
|
|
219
|
+
{highlightedCode ? (
|
|
220
|
+
<div class:list={['cxd-code', { 'line-numbers': lineNumbers }]}>
|
|
221
|
+
<Fragment set:html={highlightedCode} />
|
|
222
|
+
</div>
|
|
223
|
+
) : (
|
|
224
|
+
<div class:list={['cxd-code', { 'line-numbers': lineNumbers }]}>
|
|
225
|
+
{/* prettier-ignore */}
|
|
226
|
+
<pre class={className} tabindex="0"><slot /></pre>
|
|
227
|
+
</div>
|
|
228
|
+
)}
|
|
229
|
+
</>
|
|
230
|
+
) : (
|
|
231
|
+
<div class:list={['cxd-code-snippet', containerClass]} data-pagefind-ignore>
|
|
232
|
+
{!noToolbar && (
|
|
233
|
+
<div class="cxd-snippet-toolbar">
|
|
234
|
+
{file ? (
|
|
235
|
+
<a
|
|
236
|
+
class="text-decoration-none font-code fg-subtle"
|
|
237
|
+
href={fileUrl}
|
|
238
|
+
target="_blank"
|
|
239
|
+
rel="noopener noreferrer"
|
|
240
|
+
>
|
|
241
|
+
{file}
|
|
242
|
+
</a>
|
|
243
|
+
) : (
|
|
244
|
+
<small class="font-code fg-subtle text-uppercase">{displayLang}</small>
|
|
245
|
+
)}
|
|
246
|
+
<div class="d-flex ms-auto gap-2xs">
|
|
264
247
|
<button
|
|
265
248
|
type="button"
|
|
266
249
|
class="button-clipboard"
|
|
@@ -270,18 +253,31 @@ if (codeToDisplay && detectedLang) {
|
|
|
270
253
|
<Icon name="clipboard-outline" />
|
|
271
254
|
</button>
|
|
272
255
|
</div>
|
|
273
|
-
|
|
256
|
+
</div>
|
|
257
|
+
)}
|
|
258
|
+
<slot name="pre" />
|
|
259
|
+
{!Astro.slots.has('pre') && noToolbar ? (
|
|
260
|
+
<div class="cxd-clipboard">
|
|
261
|
+
<button
|
|
262
|
+
type="button"
|
|
263
|
+
class="button-clipboard"
|
|
264
|
+
title="Copy to clipboard"
|
|
265
|
+
aria-label="Copy to clipboard"
|
|
266
|
+
>
|
|
267
|
+
<Icon name="clipboard-outline" />
|
|
268
|
+
</button>
|
|
269
|
+
</div>
|
|
270
|
+
) : null}
|
|
274
271
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
}
|
|
272
|
+
{highlightedCode ? (
|
|
273
|
+
<div class:list={['cxd-code', { 'line-numbers': lineNumbers }]}>
|
|
274
|
+
<Fragment set:html={highlightedCode} />
|
|
275
|
+
</div>
|
|
276
|
+
) : (
|
|
277
|
+
<div class:list={['cxd-code', { 'line-numbers': lineNumbers }]}>
|
|
278
|
+
{/* prettier-ignore */}
|
|
279
|
+
<pre class={className} tabindex="0"><slot /></pre>
|
|
280
|
+
</div>
|
|
281
|
+
)}
|
|
282
|
+
</div>
|
|
283
|
+
)}
|
|
@@ -97,37 +97,33 @@ const simplifiedMarkup = sourceMarkup
|
|
|
97
97
|
---
|
|
98
98
|
|
|
99
99
|
<div class="cxd-example-snippet cxd-code-snippet not-prose" data-pagefind-ignore>
|
|
100
|
-
{
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
<
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
hasPreview={showPreview}
|
|
130
|
-
/>
|
|
131
|
-
)
|
|
132
|
-
}
|
|
100
|
+
{showPreview && (
|
|
101
|
+
<div id={id} class:list={['cxd-example m-0 border-0 context', className]}>
|
|
102
|
+
{!showMarkup && (
|
|
103
|
+
<div class="cxd-mode">
|
|
104
|
+
<button
|
|
105
|
+
type="button"
|
|
106
|
+
class="button-mode"
|
|
107
|
+
title="Toggle color mode"
|
|
108
|
+
aria-label="Toggle color mode"
|
|
109
|
+
onclick="toggleTheme(this)"
|
|
110
|
+
>
|
|
111
|
+
<Icon name="swatchbook-solid" />
|
|
112
|
+
</button>
|
|
113
|
+
</div>
|
|
114
|
+
)}
|
|
115
|
+
<Fragment set:html={markup} />
|
|
116
|
+
</div>
|
|
117
|
+
)}
|
|
118
|
+
{showMarkup && (
|
|
119
|
+
<Code
|
|
120
|
+
code={simplifiedMarkup}
|
|
121
|
+
lang={lang}
|
|
122
|
+
file={file}
|
|
123
|
+
lineNumbers={lineNumbers}
|
|
124
|
+
nestedInExample={true}
|
|
125
|
+
addStackblitzJs={addStackblitzJs}
|
|
126
|
+
hasPreview={showPreview}
|
|
127
|
+
/>
|
|
128
|
+
)}
|
|
133
129
|
</div>
|