mdx-forge 0.1.1 → 0.1.4
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/LICENSE +21 -21
- package/README.md +64 -64
- package/dist/components/base/styles/callout.css +64 -64
- package/dist/components/base/styles/collapsible.css +96 -96
- package/dist/components/base/styles/index.css +7 -7
- package/dist/components/base/styles/tabs.css +97 -97
- package/dist/components/docusaurus/styles.css +291 -291
- package/dist/components/generic/styles.css +102 -102
- package/dist/components/nextra/styles.css +500 -500
- package/dist/components/shared/callout-variants.css +81 -81
- package/dist/components/shared/index.css +6 -6
- package/dist/components/shared/tokens.css +105 -105
- package/dist/components/starlight/styles.css +602 -602
- package/dist/components/styles/docusaurus.css +2 -2
- package/dist/components/styles/generic.css +2 -2
- package/dist/components/styles/nextjs.css +1 -1
- package/dist/components/styles/nextra.css +2 -2
- package/dist/components/styles/starlight.css +2 -2
- package/dist/components/styles/tokens.css +1 -1
- package/dist/esm/browser/errors.js +2 -0
- package/dist/esm/browser/eval/evaluateModule.js +1 -1
- package/dist/esm/browser/index.js +1 -1
- package/dist/esm/browser/internal/constants.js +7 -0
- package/dist/esm/browser/internal/lru-cache.js +2 -0
- package/dist/esm/browser/internal/module-id.js +2 -0
- package/dist/esm/browser/internal/runtime-config.js +2 -0
- package/dist/esm/browser/internal/semaphore.js +2 -0
- package/dist/esm/browser/internal/style-injector.js +2 -0
- package/dist/esm/browser/loader/loadModule.js +4 -6
- package/dist/esm/browser/preload/core.js +2 -0
- package/dist/esm/browser/preload/index.js +2 -0
- package/dist/esm/browser/preload/shimLoader.js +3 -17
- package/dist/esm/browser/registry/DependencyTracker.js +1 -1
- package/dist/esm/browser/registry/ModuleCache.js +2 -5
- package/dist/esm/browser/registry/ModuleRegistry.js +1 -1
- package/dist/esm/browser/registry/StyleCache.js +2 -2
- package/dist/esm/browser/registry/index.js +2 -0
- package/dist/esm/browser/runtime/require.js +1 -1
- package/dist/esm/browser/styles/injectStyles.js +1 -1
- package/dist/esm/compiler/index.js +2 -0
- package/dist/esm/compiler/internal/css-classes.js +63 -0
- package/dist/esm/compiler/internal/logging.js +2 -0
- package/dist/esm/compiler/internal/path.js +17 -0
- package/dist/esm/compiler/internal/plugin-loader.js +2 -0
- package/dist/esm/compiler/internal/trust.js +5 -2
- package/dist/esm/compiler/pipeline/common/mdx-common.js +1 -1
- package/dist/esm/compiler/pipeline/common/pipeline-config.js +2 -150
- package/dist/esm/compiler/pipeline/common/pipeline-warnings.js +1 -0
- package/dist/esm/compiler/pipeline/rehype/create-diagram-placeholder.js +1 -1
- package/dist/esm/compiler/pipeline/rehype/graphviz-placeholder.js +1 -1
- package/dist/esm/compiler/pipeline/rehype/lazy-images.js +1 -1
- package/dist/esm/compiler/pipeline/rehype/mermaid-placeholder.js +1 -1
- package/dist/esm/compiler/pipeline/rehype/plantuml-placeholder.js +1 -1
- package/dist/esm/compiler/pipeline/rehype/rehype-raw.js +1 -1
- package/dist/esm/compiler/pipeline/rehype/shiki-helpers.js +1 -1
- package/dist/esm/compiler/pipeline/rehype/shiki.js +8 -7
- package/dist/esm/compiler/pipeline/remark/admonitions.js +53 -64
- package/dist/esm/compiler/pipeline/remark/generic-components.js +2 -2
- package/dist/esm/compiler/pipeline/remark/github-alerts.js +8 -8
- package/dist/esm/compiler/pipeline/transforms/callout.js +21 -20
- package/dist/esm/compiler/pipeline/transforms/code-group.js +6 -8
- package/dist/esm/compiler/pipeline/transforms/collapsible.js +5 -4
- package/dist/esm/compiler/pipeline/transforms/index.js +1 -1
- package/dist/esm/compiler/pipeline/transforms/tabs.js +9 -11
- package/dist/esm/compiler/pipeline/transforms/utils.js +8 -1
- package/dist/esm/compiler/plugins/builder.js +5 -20
- package/dist/esm/compiler/plugins/index.js +4 -1
- package/dist/esm/compiler/plugins/loader.js +2 -0
- package/dist/esm/compiler/plugins/shared-plugins.js +1 -1
- package/dist/esm/compiler/plugins/utils.js +1 -1
- package/dist/esm/compiler/safe/compile.js +56 -57
- package/dist/esm/compiler/transforms/index.js +2 -0
- package/dist/esm/compiler/trusted/compile.js +27 -35
- package/dist/esm/compiler/trusted/component-mapper.js +3 -1
- package/dist/esm/compiler/trusted/hasDefaultExport.js +1 -1
- package/dist/esm/compiler/types/compiler.js +2 -0
- package/dist/esm/compiler/types/index.js +2 -0
- package/dist/esm/compiler/types/mdx.js +1 -1
- package/dist/esm/compiler/types/pipeline.js +1 -1
- package/dist/esm/components/base/BaseCallout.js +2 -3
- package/dist/esm/components/base/BaseCodeBlock.js +3 -2
- package/dist/esm/components/base/BaseTabs.js +3 -5
- package/dist/esm/components/base/createCollapsible.js +1 -1
- package/dist/esm/components/base/extractTextContent.js +1 -1
- package/dist/esm/components/base/index.js +1 -1
- package/dist/esm/components/base/useCopyToClipboard.js +1 -1
- package/dist/esm/components/base/useTabState.js +1 -1
- package/dist/esm/components/docusaurus/CodeBlock.js +1 -1
- package/dist/esm/components/docusaurus/Details.js +1 -1
- package/dist/esm/components/docusaurus/Tabs.js +1 -1
- package/dist/esm/components/docusaurus/index.js +2 -0
- package/dist/esm/components/generic/CodeGroup.js +3 -2
- package/dist/esm/components/generic/Collapsible.js +1 -1
- package/dist/esm/components/generic/Tabs.js +1 -1
- package/dist/esm/components/generic/index.js +2 -0
- package/dist/esm/components/generic/types.js +1 -1
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/components/internal/clipboard.js +2 -0
- package/dist/esm/components/internal/cn.js +1 -0
- package/dist/esm/components/internal/constants.js +2 -0
- package/dist/esm/components/nextjs/index.js +2 -0
- package/dist/esm/components/nextra/Bleed.js +2 -12
- package/dist/esm/components/nextra/FileTree.js +1 -1
- package/dist/esm/components/nextra/Steps.js +1 -1
- package/dist/esm/components/nextra/Tabs.js +1 -1
- package/dist/esm/components/nextra/createNextraWrapper.js +2 -1
- package/dist/esm/components/nextra/index.js +2 -0
- package/dist/esm/components/registry/index.js +2 -0
- package/dist/esm/components/registry/queries.js +5 -1
- package/dist/esm/components/registry/registry-data.js +1 -1
- package/dist/esm/components/registry/shim-config.js +1 -0
- package/dist/esm/components/registry/types.js +1 -0
- package/dist/esm/components/starlight/CardGrid.js +2 -1
- package/dist/esm/components/starlight/Code.js +1 -1
- package/dist/esm/components/starlight/FileTree.js +3 -2
- package/dist/esm/components/starlight/Tabs.js +1 -1
- package/dist/esm/components/starlight/index.js +2 -0
- package/dist/esm/internal/callout.js +1 -0
- package/dist/esm/internal/errors.js +1 -0
- package/dist/esm/internal/icons.js +1 -2
- package/dist/types/browser/internal/constants.d.ts +3 -0
- package/dist/types/compiler/internal/css-classes.d.ts +51 -0
- package/dist/types/compiler/internal/path.d.ts +4 -0
- package/dist/types/compiler/pipeline/common/pipeline-config.d.ts +0 -35
- package/dist/types/compiler/pipeline/transforms/callout.d.ts +2 -6
- package/dist/types/compiler/pipeline/transforms/utils.d.ts +4 -2
- package/dist/types/compiler/plugins/builder.d.ts +0 -3
- package/dist/types/compiler/plugins/index.d.ts +2 -1
- package/dist/types/compiler/types/mdx.d.ts +19 -3
- package/dist/types/components/registry/queries.d.ts +1 -0
- package/dist/types/internal/callout.d.ts +5 -0
- package/dist/types/internal/icons.d.ts +0 -9
- package/package.json +151 -150
- package/dist/esm/browser/internal/logger.js +0 -9
- package/dist/esm/browser/loader/circular.js +0 -15
- package/dist/esm/compiler/internal/components.js +0 -28
- package/dist/esm/compiler/pipeline/common/icon-registry.js +0 -1
- package/dist/types/browser/internal/logger.d.ts +0 -9
- package/dist/types/browser/loader/circular.d.ts +0 -4
- package/dist/types/compiler/internal/components.d.ts +0 -21
- package/dist/types/compiler/pipeline/common/icon-registry.d.ts +0 -1
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Garrett Fincke
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Garrett Fincke
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
# mdx-forge
|
|
2
|
-
|
|
3
|
-
`mdx-forge` is a unified MDX runtime toolkit with three domain exports:
|
|
4
|
-
|
|
5
|
-
- `mdx-forge/compiler` for safe and trusted MDX compilation
|
|
6
|
-
- `mdx-forge/browser` for browser-side module loading/evaluation
|
|
7
|
-
- `mdx-forge/components` for framework shim components and CSS
|
|
8
|
-
|
|
9
|
-
## Install
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm install mdx-forge
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
Peer dependencies:
|
|
16
|
-
|
|
17
|
-
- `react >= 18` for `components`
|
|
18
|
-
- `unified` and `@mdx-js/mdx` for `compiler`
|
|
19
|
-
|
|
20
|
-
## Quick Start
|
|
21
|
-
|
|
22
|
-
```ts
|
|
23
|
-
import { compileSafe } from 'mdx-forge/compiler';
|
|
24
|
-
|
|
25
|
-
const result = await compileSafe('# Hello', {
|
|
26
|
-
logger: { debug() {}, warn() {}, error() {} },
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
console.log(result.html);
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Subpath Exports
|
|
33
|
-
|
|
34
|
-
- `mdx-forge/compiler`
|
|
35
|
-
- `mdx-forge/compiler/plugins`
|
|
36
|
-
- `mdx-forge/compiler/transforms`
|
|
37
|
-
- `mdx-forge/browser`
|
|
38
|
-
- `mdx-forge/browser/registry`
|
|
39
|
-
- `mdx-forge/components`
|
|
40
|
-
- `mdx-forge/components/generic`
|
|
41
|
-
- `mdx-forge/components/docusaurus`
|
|
42
|
-
- `mdx-forge/components/starlight`
|
|
43
|
-
- `mdx-forge/components/nextra`
|
|
44
|
-
- `mdx-forge/components/nextjs`
|
|
45
|
-
- `mdx-forge/components/registry`
|
|
46
|
-
- `mdx-forge/components/styles/*.css`
|
|
47
|
-
|
|
48
|
-
## Security Model
|
|
49
|
-
|
|
50
|
-
- `mdx-forge/browser` evaluates code via `new Function()`.
|
|
51
|
-
- Consumers must allow `unsafe-eval` in CSP for `mdx-forge/browser`.
|
|
52
|
-
- Runtime style injection may require `style-src 'unsafe-inline'` or a nonce-aware strategy.
|
|
53
|
-
- The library does not validate trust boundaries for fetched code; host code must enforce trust.
|
|
54
|
-
- `compileSafe` is a compilation mode, not a full sanitization layer.
|
|
55
|
-
|
|
56
|
-
## Limitations
|
|
57
|
-
|
|
58
|
-
- Browser-domain runtime assumes a browser environment.
|
|
59
|
-
- Component domain requires matching CSS imports.
|
|
60
|
-
- Trusted mode compilation/execution is not suitable for untrusted code without additional controls.
|
|
61
|
-
|
|
62
|
-
## License
|
|
63
|
-
|
|
64
|
-
MIT. See `LICENSE`.
|
|
1
|
+
# mdx-forge
|
|
2
|
+
|
|
3
|
+
`mdx-forge` is a unified MDX runtime toolkit with three domain exports:
|
|
4
|
+
|
|
5
|
+
- `mdx-forge/compiler` for safe and trusted MDX compilation
|
|
6
|
+
- `mdx-forge/browser` for browser-side module loading/evaluation
|
|
7
|
+
- `mdx-forge/components` for framework shim components and CSS
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install mdx-forge
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Peer dependencies:
|
|
16
|
+
|
|
17
|
+
- `react >= 18` for `components`
|
|
18
|
+
- `unified` and `@mdx-js/mdx` for `compiler`
|
|
19
|
+
|
|
20
|
+
## Quick Start
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import { compileSafe } from 'mdx-forge/compiler';
|
|
24
|
+
|
|
25
|
+
const result = await compileSafe('# Hello', {
|
|
26
|
+
logger: { debug() {}, warn() {}, error() {} },
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
console.log(result.html);
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Subpath Exports
|
|
33
|
+
|
|
34
|
+
- `mdx-forge/compiler`
|
|
35
|
+
- `mdx-forge/compiler/plugins`
|
|
36
|
+
- `mdx-forge/compiler/transforms`
|
|
37
|
+
- `mdx-forge/browser`
|
|
38
|
+
- `mdx-forge/browser/registry`
|
|
39
|
+
- `mdx-forge/components`
|
|
40
|
+
- `mdx-forge/components/generic`
|
|
41
|
+
- `mdx-forge/components/docusaurus`
|
|
42
|
+
- `mdx-forge/components/starlight`
|
|
43
|
+
- `mdx-forge/components/nextra`
|
|
44
|
+
- `mdx-forge/components/nextjs`
|
|
45
|
+
- `mdx-forge/components/registry`
|
|
46
|
+
- `mdx-forge/components/styles/*.css`
|
|
47
|
+
|
|
48
|
+
## Security Model
|
|
49
|
+
|
|
50
|
+
- `mdx-forge/browser` evaluates code via `new Function()`.
|
|
51
|
+
- Consumers must allow `unsafe-eval` in CSP for `mdx-forge/browser`.
|
|
52
|
+
- Runtime style injection may require `style-src 'unsafe-inline'` or a nonce-aware strategy.
|
|
53
|
+
- The library does not validate trust boundaries for fetched code; host code must enforce trust.
|
|
54
|
+
- `compileSafe` is a compilation mode, not a full sanitization layer.
|
|
55
|
+
|
|
56
|
+
## Limitations
|
|
57
|
+
|
|
58
|
+
- Browser-domain runtime assumes a browser environment.
|
|
59
|
+
- Component domain requires matching CSS imports.
|
|
60
|
+
- Trusted mode compilation/execution is not suitable for untrusted code without additional controls.
|
|
61
|
+
|
|
62
|
+
## License
|
|
63
|
+
|
|
64
|
+
MIT. See `LICENSE`.
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
/* packages/webview-app/src/components/shims/base/styles/callout.css */
|
|
2
|
-
/* Shared callout/aside/admonition styles using data-attribute selectors */
|
|
3
|
-
/* Works w/ all frameworks that use createCallout() factory */
|
|
4
|
-
|
|
5
|
-
/* Import shared tokens & callout color variants */
|
|
6
|
-
@import '../../shared/index.css';
|
|
7
|
-
|
|
8
|
-
/* ==================== Base Structure ==================== */
|
|
9
|
-
[data-callout-type] {
|
|
10
|
-
padding: var(--mdx-space-lg) var(--mdx-space-xl);
|
|
11
|
-
margin: var(--mdx-space-lg) 0;
|
|
12
|
-
border-left: var(--mdx-callout-border-width) solid
|
|
13
|
-
var(--callout-color, var(--mdx-text-muted));
|
|
14
|
-
border-radius: 0 var(--mdx-radius-lg) var(--mdx-radius-lg) 0;
|
|
15
|
-
background-color: var(
|
|
16
|
-
--callout-bg,
|
|
17
|
-
rgba(128, 128, 128, var(--mdx-alpha-subtle))
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/* Header layout (Generic, Starlight) */
|
|
22
|
-
[data-callout-type] > [class*='-header'] {
|
|
23
|
-
display: flex;
|
|
24
|
-
align-items: center;
|
|
25
|
-
gap: var(--mdx-space-sm);
|
|
26
|
-
font-weight: var(--mdx-font-weight-semibold);
|
|
27
|
-
margin-bottom: var(--mdx-space-md);
|
|
28
|
-
color: var(--callout-color);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/* Title text - uppercase for header layout */
|
|
32
|
-
[data-callout-type] > [class*='-header'] > [class*='-title'] {
|
|
33
|
-
text-transform: uppercase;
|
|
34
|
-
font-size: var(--mdx-font-size-sm);
|
|
35
|
-
letter-spacing: var(--mdx-letter-spacing-wide);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/* Icon container */
|
|
39
|
-
[data-callout-type] [class*='-icon'] {
|
|
40
|
-
display: inline-flex;
|
|
41
|
-
align-items: center;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
[data-callout-type] [class*='-icon'] svg {
|
|
45
|
-
width: 1.25em;
|
|
46
|
-
height: 1.25em;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/* Content container */
|
|
50
|
-
[data-callout-type] > [class*='-content'] > :first-child {
|
|
51
|
-
margin-top: 0;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
[data-callout-type] > [class*='-content'] > :last-child {
|
|
55
|
-
margin-bottom: 0;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/* ==================== Color Variants ==================== */
|
|
59
|
-
/* Color variants are defined in shared/callout-variants.css using tokens */
|
|
60
|
-
/* No need to duplicate them here - they're imported via shared/index.css */
|
|
61
|
-
|
|
62
|
-
/* ==================== Dark Mode ==================== */
|
|
63
|
-
/* Dark mode alpha adjustment is handled by --mdx-alpha-subtle in tokens.css */
|
|
64
|
-
/* No need to duplicate dark mode rules - they use CSS custom properties */
|
|
1
|
+
/* packages/webview-app/src/components/shims/base/styles/callout.css */
|
|
2
|
+
/* Shared callout/aside/admonition styles using data-attribute selectors */
|
|
3
|
+
/* Works w/ all frameworks that use createCallout() factory */
|
|
4
|
+
|
|
5
|
+
/* Import shared tokens & callout color variants */
|
|
6
|
+
@import '../../shared/index.css';
|
|
7
|
+
|
|
8
|
+
/* ==================== Base Structure ==================== */
|
|
9
|
+
[data-callout-type] {
|
|
10
|
+
padding: var(--mdx-space-lg) var(--mdx-space-xl);
|
|
11
|
+
margin: var(--mdx-space-lg) 0;
|
|
12
|
+
border-left: var(--mdx-callout-border-width) solid
|
|
13
|
+
var(--callout-color, var(--mdx-text-muted));
|
|
14
|
+
border-radius: 0 var(--mdx-radius-lg) var(--mdx-radius-lg) 0;
|
|
15
|
+
background-color: var(
|
|
16
|
+
--callout-bg,
|
|
17
|
+
rgba(128, 128, 128, var(--mdx-alpha-subtle))
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* Header layout (Generic, Starlight) */
|
|
22
|
+
[data-callout-type] > [class*='-header'] {
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
gap: var(--mdx-space-sm);
|
|
26
|
+
font-weight: var(--mdx-font-weight-semibold);
|
|
27
|
+
margin-bottom: var(--mdx-space-md);
|
|
28
|
+
color: var(--callout-color);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* Title text - uppercase for header layout */
|
|
32
|
+
[data-callout-type] > [class*='-header'] > [class*='-title'] {
|
|
33
|
+
text-transform: uppercase;
|
|
34
|
+
font-size: var(--mdx-font-size-sm);
|
|
35
|
+
letter-spacing: var(--mdx-letter-spacing-wide);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* Icon container */
|
|
39
|
+
[data-callout-type] [class*='-icon'] {
|
|
40
|
+
display: inline-flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
[data-callout-type] [class*='-icon'] svg {
|
|
45
|
+
width: 1.25em;
|
|
46
|
+
height: 1.25em;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* Content container */
|
|
50
|
+
[data-callout-type] > [class*='-content'] > :first-child {
|
|
51
|
+
margin-top: 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
[data-callout-type] > [class*='-content'] > :last-child {
|
|
55
|
+
margin-bottom: 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* ==================== Color Variants ==================== */
|
|
59
|
+
/* Color variants are defined in shared/callout-variants.css using tokens */
|
|
60
|
+
/* No need to duplicate them here - they're imported via shared/index.css */
|
|
61
|
+
|
|
62
|
+
/* ==================== Dark Mode ==================== */
|
|
63
|
+
/* Dark mode alpha adjustment is handled by --mdx-alpha-subtle in tokens.css */
|
|
64
|
+
/* No need to duplicate dark mode rules - they use CSS custom properties */
|
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
/* packages/webview-app/src/components/shims/base/styles/collapsible.css */
|
|
2
|
-
/* Shared collapsible/details styles using data-attribute selectors */
|
|
3
|
-
/* Works w/ all frameworks that use createCollapsible */
|
|
4
|
-
|
|
5
|
-
/* Import shared tokens */
|
|
6
|
-
@import '../../shared/tokens.css';
|
|
7
|
-
|
|
8
|
-
/* ==================== Base Structure ==================== */
|
|
9
|
-
[data-component='collapsible'] {
|
|
10
|
-
margin: var(--mdx-space-lg) 0;
|
|
11
|
-
border: 1px solid var(--vscode-panel-border, var(--mdx-border-color));
|
|
12
|
-
border-radius: var(--mdx-radius-lg);
|
|
13
|
-
overflow: hidden;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/* Summary / header element */
|
|
17
|
-
[data-component='collapsible'] > summary {
|
|
18
|
-
display: flex;
|
|
19
|
-
align-items: center;
|
|
20
|
-
gap: var(--mdx-space-sm);
|
|
21
|
-
padding: var(--mdx-space-md) var(--mdx-space-lg);
|
|
22
|
-
cursor: pointer;
|
|
23
|
-
background-color: var(--vscode-editor-background, var(--mdx-bg-secondary));
|
|
24
|
-
font-weight: var(--mdx-font-weight-medium);
|
|
25
|
-
list-style: none;
|
|
26
|
-
user-select: none;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/* Hide native disclosure markers */
|
|
30
|
-
[data-component='collapsible'] > summary::-webkit-details-marker {
|
|
31
|
-
display: none;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
[data-component='collapsible'] > summary::marker {
|
|
35
|
-
display: none;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
[data-component='collapsible'] > summary:hover {
|
|
39
|
-
background-color: var(
|
|
40
|
-
--vscode-list-hoverBackground,
|
|
41
|
-
rgba(0, 0, 0, var(--mdx-alpha-hover))
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/* Icon container */
|
|
46
|
-
[data-component='collapsible'] > summary > [class*='-icon'] {
|
|
47
|
-
display: inline-flex;
|
|
48
|
-
align-items: center;
|
|
49
|
-
transition: transform var(--mdx-transition-normal) ease;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/* Icon rotation when open */
|
|
53
|
-
[data-component='collapsible'] > summary > [class*='-icon'].open,
|
|
54
|
-
[data-component='collapsible'] > summary > [class*='-icon'].expanded {
|
|
55
|
-
transform: rotate(90deg);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
[data-component='collapsible'] > summary > [class*='-icon'] svg {
|
|
59
|
-
width: 1em;
|
|
60
|
-
height: 1em;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/* Title text */
|
|
64
|
-
[data-component='collapsible'] > summary > [class*='-title'],
|
|
65
|
-
[data-component='collapsible'] > summary > [class*='-text'] {
|
|
66
|
-
flex: 1;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/* Content container */
|
|
70
|
-
[data-component='collapsible'] > [class*='-content'] {
|
|
71
|
-
padding: var(--mdx-space-lg);
|
|
72
|
-
border-top: 1px solid var(--vscode-panel-border, var(--mdx-border-color));
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
[data-component='collapsible'] > [class*='-content'] > :first-child {
|
|
76
|
-
margin-top: 0;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
[data-component='collapsible'] > [class*='-content'] > :last-child {
|
|
80
|
-
margin-bottom: 0;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/* ==================== Dark Mode ==================== */
|
|
84
|
-
/* Dark mode values are handled by VS Code CSS variables w/ fallbacks to tokens */
|
|
85
|
-
|
|
86
|
-
.vscode-dark [data-component='collapsible'] {
|
|
87
|
-
border-color: var(--vscode-panel-border, var(--mdx-border-color));
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.vscode-dark [data-component='collapsible'] > summary {
|
|
91
|
-
background-color: var(--vscode-editor-background, var(--mdx-bg-primary));
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.vscode-dark [data-component='collapsible'] > [class*='-content'] {
|
|
95
|
-
border-top-color: var(--vscode-panel-border, var(--mdx-border-color));
|
|
96
|
-
}
|
|
1
|
+
/* packages/webview-app/src/components/shims/base/styles/collapsible.css */
|
|
2
|
+
/* Shared collapsible/details styles using data-attribute selectors */
|
|
3
|
+
/* Works w/ all frameworks that use createCollapsible */
|
|
4
|
+
|
|
5
|
+
/* Import shared tokens */
|
|
6
|
+
@import '../../shared/tokens.css';
|
|
7
|
+
|
|
8
|
+
/* ==================== Base Structure ==================== */
|
|
9
|
+
[data-component='collapsible'] {
|
|
10
|
+
margin: var(--mdx-space-lg) 0;
|
|
11
|
+
border: 1px solid var(--vscode-panel-border, var(--mdx-border-color));
|
|
12
|
+
border-radius: var(--mdx-radius-lg);
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/* Summary / header element */
|
|
17
|
+
[data-component='collapsible'] > summary {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
gap: var(--mdx-space-sm);
|
|
21
|
+
padding: var(--mdx-space-md) var(--mdx-space-lg);
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
background-color: var(--vscode-editor-background, var(--mdx-bg-secondary));
|
|
24
|
+
font-weight: var(--mdx-font-weight-medium);
|
|
25
|
+
list-style: none;
|
|
26
|
+
user-select: none;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* Hide native disclosure markers */
|
|
30
|
+
[data-component='collapsible'] > summary::-webkit-details-marker {
|
|
31
|
+
display: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
[data-component='collapsible'] > summary::marker {
|
|
35
|
+
display: none;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
[data-component='collapsible'] > summary:hover {
|
|
39
|
+
background-color: var(
|
|
40
|
+
--vscode-list-hoverBackground,
|
|
41
|
+
rgba(0, 0, 0, var(--mdx-alpha-hover))
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* Icon container */
|
|
46
|
+
[data-component='collapsible'] > summary > [class*='-icon'] {
|
|
47
|
+
display: inline-flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
transition: transform var(--mdx-transition-normal) ease;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* Icon rotation when open */
|
|
53
|
+
[data-component='collapsible'] > summary > [class*='-icon'].open,
|
|
54
|
+
[data-component='collapsible'] > summary > [class*='-icon'].expanded {
|
|
55
|
+
transform: rotate(90deg);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
[data-component='collapsible'] > summary > [class*='-icon'] svg {
|
|
59
|
+
width: 1em;
|
|
60
|
+
height: 1em;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* Title text */
|
|
64
|
+
[data-component='collapsible'] > summary > [class*='-title'],
|
|
65
|
+
[data-component='collapsible'] > summary > [class*='-text'] {
|
|
66
|
+
flex: 1;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* Content container */
|
|
70
|
+
[data-component='collapsible'] > [class*='-content'] {
|
|
71
|
+
padding: var(--mdx-space-lg);
|
|
72
|
+
border-top: 1px solid var(--vscode-panel-border, var(--mdx-border-color));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
[data-component='collapsible'] > [class*='-content'] > :first-child {
|
|
76
|
+
margin-top: 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
[data-component='collapsible'] > [class*='-content'] > :last-child {
|
|
80
|
+
margin-bottom: 0;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* ==================== Dark Mode ==================== */
|
|
84
|
+
/* Dark mode values are handled by VS Code CSS variables w/ fallbacks to tokens */
|
|
85
|
+
|
|
86
|
+
.vscode-dark [data-component='collapsible'] {
|
|
87
|
+
border-color: var(--vscode-panel-border, var(--mdx-border-color));
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.vscode-dark [data-component='collapsible'] > summary {
|
|
91
|
+
background-color: var(--vscode-editor-background, var(--mdx-bg-primary));
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.vscode-dark [data-component='collapsible'] > [class*='-content'] {
|
|
95
|
+
border-top-color: var(--vscode-panel-border, var(--mdx-border-color));
|
|
96
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/* packages/webview-app/src/components/shims/base/styles/index.css */
|
|
2
|
-
/* Base component styles - imported by App.tsx */
|
|
3
|
-
/* These provide shared styles for all framework shims via data-attribute selectors */
|
|
4
|
-
|
|
5
|
-
@import './callout.css';
|
|
6
|
-
@import './tabs.css';
|
|
7
|
-
@import './collapsible.css';
|
|
1
|
+
/* packages/webview-app/src/components/shims/base/styles/index.css */
|
|
2
|
+
/* Base component styles - imported by App.tsx */
|
|
3
|
+
/* These provide shared styles for all framework shims via data-attribute selectors */
|
|
4
|
+
|
|
5
|
+
@import './callout.css';
|
|
6
|
+
@import './tabs.css';
|
|
7
|
+
@import './collapsible.css';
|