@chassis-ui/docs 0.2.0 → 0.3.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/README.md +16 -16
- package/index.ts +6 -1
- package/package.json +20 -8
- package/src/components/DocsSidebar.astro +63 -23
- package/src/components/FeatureCard.astro +3 -3
- package/src/components/TableOfContents.astro +8 -7
- package/src/components/ThemeToggler.astro +15 -36
- package/src/components/shortcodes/Blockquote.astro +1 -1
- package/src/components/shortcodes/CSSOnly.astro +6 -2
- package/src/components/shortcodes/Callout.astro +6 -2
- package/src/components/shortcodes/Code.astro +289 -0
- package/src/components/shortcodes/DeprecatedIn.astro +5 -2
- package/src/components/shortcodes/Example.astro +132 -0
- package/src/components/shortcodes/Icon.astro +57 -0
- package/src/components/shortcodes/InFigma.astro +7 -2
- package/src/components/shortcodes/JsDocs.astro +64 -0
- package/src/components/shortcodes/Placeholder.astro +28 -0
- package/src/components/shortcodes/ResizableExample.astro +126 -0
- package/src/components/shortcodes/ScssDocs.astro +108 -0
- package/src/components/shortcodes/ScssDocsSimple.astro +66 -0
- package/src/js/color-modes.js +3 -3
- package/src/js/example-mode.js +75 -0
- package/src/js/search.js +501 -39
- package/src/js/theme-color.js +1 -1
- package/src/layouts/DocsLayout.astro +11 -14
- package/src/layouts/RedirectLayout.astro +1 -0
- package/src/layouts/footer/Scripts.astro +14 -9
- package/src/layouts/head/Analytics.astro +12 -6
- package/src/layouts/head/Favicons.astro +0 -2
- package/src/layouts/head/Head.astro +2 -7
- package/src/layouts/head/Stylesheet.astro +18 -11
- package/src/layouts/header/Header.astro +2 -5
- package/src/layouts/header/Navigation.astro +31 -33
- package/src/layouts/header/SearchDialog.astro +74 -0
- package/src/layouts/header/SearchTrigger.astro +41 -0
- package/src/libs/highlight.ts +91 -0
- package/src/libs/icon.ts +75 -0
- package/src/libs/image.ts +12 -1
- package/src/libs/layout.ts +18 -0
- package/src/libs/markdown.ts +128 -0
- package/src/libs/placeholder.ts +250 -0
- package/src/libs/rehype.ts +0 -17
- package/src/libs/shortcodes.ts +129 -0
- package/src/libs/site.ts +95 -0
- package/src/libs/toc.ts +40 -6
- package/src/libs/utils.ts +34 -82
- package/src/libs/vite.ts +45 -0
- package/src/scss/_anchor.scss +20 -16
- package/src/scss/_callouts.scss +29 -28
- package/src/scss/_content.scss +72 -103
- package/src/scss/_footer.scss +18 -19
- package/src/scss/_layout.scss +56 -63
- package/src/scss/_navbar.scss +19 -123
- package/src/scss/_placeholder-img.scss +11 -7
- package/src/scss/_scrolling.scss +14 -12
- package/src/scss/_search.scss +418 -0
- package/src/scss/_shiki.scss +120 -0
- package/src/scss/_sidebar.scss +137 -132
- package/src/scss/_skippy.scss +6 -4
- package/src/scss/_snippets.scss +181 -0
- package/src/scss/_toc.scss +97 -93
- package/src/scss/_vars.scss +89 -0
- package/src/scss/main.scss +75 -80
- package/src/js/icon-loader.js +0 -229
- package/src/libs/chassis.ts +0 -38
- package/src/scss/_brand.scss +0 -59
- package/src/scss/_buttons.scss +0 -33
- package/src/scss/_clipboard-js.scss +0 -63
- package/src/scss/_code.scss +0 -116
- package/src/scss/_colors.scss +0 -140
- package/src/scss/_docsearch.scss +0 -212
- package/src/scss/_settings.scss +0 -29
- package/src/scss/_syntax.scss +0 -160
- package/src/scss/_variables.scss +0 -73
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Shared Astro layouts, components, and utilities for Chassis documentation sites.
|
|
4
4
|
|
|
5
|
-
[](https://opensource.org/licenses/MIT) [](https://opensource.org/licenses/MIT) [](https://www.npmjs.com/package/@chassis-ui/docs) [](https://www.npmjs.com/package/@chassis-ui/docs)
|
|
6
6
|
|
|
7
7
|
## Overview
|
|
8
8
|
|
|
@@ -53,15 +53,15 @@ import { generateTOC, processImage } from '@chassis-ui/docs'
|
|
|
53
53
|
|
|
54
54
|
## Exports
|
|
55
55
|
|
|
56
|
-
| Subpath
|
|
57
|
-
|
|
|
58
|
-
| `@chassis-ui/docs`
|
|
59
|
-
| `@chassis-ui/docs/layouts/*`
|
|
56
|
+
| Subpath | Contents |
|
|
57
|
+
| ------------------------------- | --------------------------------------------------------------------------------------------- |
|
|
58
|
+
| `@chassis-ui/docs` | Library functions: `chassis`, `image`, `layout`, `rehype`, `toc`, `utils` |
|
|
59
|
+
| `@chassis-ui/docs/layouts/*` | `BaseLayout`, `DocsLayout`, `RedirectLayout`, `SingleLayout` |
|
|
60
60
|
| `@chassis-ui/docs/components/*` | `DocsSidebar`, `FeatureCard`, `NavLink`, `ResponsiveImage`, `TableOfContents`, `ThemeToggler` |
|
|
61
|
-
| `@chassis-ui/docs/shortcodes/*` | MDX shortcode components
|
|
62
|
-
| `@chassis-ui/docs/libs/*`
|
|
63
|
-
| `@chassis-ui/docs/js/*`
|
|
64
|
-
| `@chassis-ui/docs/scss/*`
|
|
61
|
+
| `@chassis-ui/docs/shortcodes/*` | MDX shortcode components |
|
|
62
|
+
| `@chassis-ui/docs/libs/*` | Direct access to individual library modules |
|
|
63
|
+
| `@chassis-ui/docs/js/*` | Client-side scripts |
|
|
64
|
+
| `@chassis-ui/docs/scss/*` | SCSS utilities and partials |
|
|
65
65
|
|
|
66
66
|
### Source Layout
|
|
67
67
|
|
|
@@ -78,14 +78,14 @@ src/
|
|
|
78
78
|
|
|
79
79
|
This package is part of the Chassis Design System's multi-repository architecture:
|
|
80
80
|
|
|
81
|
-
| Project
|
|
82
|
-
|
|
|
81
|
+
| Project | Description |
|
|
82
|
+
| -------------------------------------------------------- | -------------------------------------------------------------- |
|
|
83
83
|
| [chassis-website](https://github.com/chassis-ui/website) | **Main website and home of `@chassis-ui/docs` (this package)** |
|
|
84
|
-
| [chassis-css](https://github.com/chassis-ui/css)
|
|
85
|
-
| [chassis-tokens](https://github.com/chassis-ui/tokens)
|
|
86
|
-
| [chassis-icons](https://github.com/chassis-ui/icons)
|
|
87
|
-
| [chassis-assets](https://github.com/chassis-ui/assets)
|
|
88
|
-
| [chassis-figma](https://github.com/chassis-ui/figma)
|
|
84
|
+
| [chassis-css](https://github.com/chassis-ui/css) | CSS framework and component library |
|
|
85
|
+
| [chassis-tokens](https://github.com/chassis-ui/tokens) | Design token generation and management |
|
|
86
|
+
| [chassis-icons](https://github.com/chassis-ui/icons) | Icon library and build toolkit |
|
|
87
|
+
| [chassis-assets](https://github.com/chassis-ui/assets) | Multi-platform asset management |
|
|
88
|
+
| [chassis-figma](https://github.com/chassis-ui/figma) | Figma component documentation |
|
|
89
89
|
|
|
90
90
|
All documentation sites in the ecosystem share this package for consistent layouts, components, and styling.
|
|
91
91
|
|
package/index.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
// Shared libraries for documentation sites
|
|
2
|
-
export * from './src/libs/
|
|
2
|
+
export * from './src/libs/highlight'
|
|
3
3
|
export * from './src/libs/image'
|
|
4
4
|
export * from './src/libs/layout'
|
|
5
|
+
export * from './src/libs/markdown'
|
|
6
|
+
export * from './src/libs/placeholder'
|
|
5
7
|
export * from './src/libs/rehype'
|
|
8
|
+
export * from './src/libs/shortcodes'
|
|
9
|
+
export * from './src/libs/site'
|
|
6
10
|
export * from './src/libs/toc'
|
|
7
11
|
export * from './src/libs/utils'
|
|
12
|
+
export * from './src/libs/vite'
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chassis-ui/docs",
|
|
3
3
|
"description": "Shared Astro components and layouts for Chassis documentation sites.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -40,24 +40,36 @@
|
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"astro": "astro"
|
|
45
|
+
},
|
|
43
46
|
"peerDependencies": {
|
|
44
|
-
"
|
|
47
|
+
"@astrojs/markdown-remark": "^7.0.0",
|
|
48
|
+
"@chassis-ui/css": ">=0.3.1",
|
|
49
|
+
"@pagefind/component-ui": "^1.0.0",
|
|
50
|
+
"@shikijs/transformers": "^4.3.1",
|
|
51
|
+
"astro": "^7.0.0",
|
|
52
|
+
"htmlparser2": "^10.1.0",
|
|
53
|
+
"rehype-autolink-headings": "^7.0.0",
|
|
54
|
+
"sass": "1.99.0",
|
|
55
|
+
"shiki": "^4.3.1"
|
|
56
|
+
},
|
|
57
|
+
"peerDependenciesMeta": {
|
|
58
|
+
"@pagefind/component-ui": {
|
|
59
|
+
"optional": true
|
|
60
|
+
}
|
|
45
61
|
},
|
|
46
62
|
"devDependencies": {
|
|
47
|
-
"@docsearch/css": "^4.6.2",
|
|
48
|
-
"@docsearch/js": "^4.6.2",
|
|
49
63
|
"@types/hast": "^3.0.4",
|
|
50
|
-
"
|
|
51
|
-
"astro": "^6.1.9",
|
|
64
|
+
"astro": "^7.0.6",
|
|
52
65
|
"github-slugger": "^2.0.0",
|
|
53
66
|
"image-size": "^2.0.2",
|
|
54
67
|
"mdast-util-from-markdown": "^2.0.3",
|
|
55
|
-
"mdast-util-mdx-jsx": "^3.2.0",
|
|
56
68
|
"mdast-util-to-string": "^4.0.0",
|
|
57
69
|
"remark": "^15.0.1",
|
|
58
70
|
"remark-html": "^16.0.1",
|
|
59
71
|
"unified": "^11.0.5",
|
|
60
72
|
"unist-util-visit": "^5.1.0",
|
|
61
|
-
"
|
|
73
|
+
"vite": "^8.1.3"
|
|
62
74
|
}
|
|
63
75
|
}
|
|
@@ -5,16 +5,17 @@
|
|
|
5
5
|
* Navigation sidebar for documentation pages with hierarchical menu structure.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { getData } from '@libs/data'
|
|
8
|
+
import { getData, type SidebarItem, type SidebarSubItem } from '@libs/data'
|
|
9
9
|
import { getConfig } from '@libs/config'
|
|
10
10
|
import { docsPages } from '@libs/content'
|
|
11
11
|
import { getSlug } from '../libs/utils'
|
|
12
|
+
import Icon from './shortcodes/Icon.astro'
|
|
12
13
|
|
|
13
14
|
const sidebar = getData('sidebar')
|
|
14
15
|
---
|
|
15
16
|
|
|
16
17
|
<nav class="cxd-links w-100" id="cxd-docs-nav" aria-label="Docs navigation">
|
|
17
|
-
<
|
|
18
|
+
<menu class="p-0 m-0">
|
|
18
19
|
{
|
|
19
20
|
sidebar.map((group) => {
|
|
20
21
|
const groupSlug = getSlug(group.title)
|
|
@@ -29,19 +30,60 @@ const sidebar = getData('sidebar')
|
|
|
29
30
|
>
|
|
30
31
|
<strong class="cxd-links-heading">
|
|
31
32
|
{group.icon && (
|
|
32
|
-
<
|
|
33
|
-
|
|
33
|
+
<Icon
|
|
34
|
+
name={group.icon}
|
|
34
35
|
style={group.icon_color && `color: var(--cx-${group.icon_color});`}
|
|
35
|
-
|
|
36
|
-
>
|
|
37
|
-
<use xlink:href={`#${group.icon}`} />
|
|
38
|
-
</svg>
|
|
36
|
+
/>
|
|
39
37
|
)}
|
|
40
38
|
{group.title}
|
|
41
39
|
</strong>
|
|
42
|
-
<ul>
|
|
43
|
-
{group.pages?.map((
|
|
44
|
-
|
|
40
|
+
<ul class="nav flex-column cxd-links-nav">
|
|
41
|
+
{group.pages?.map((item: SidebarItem) => {
|
|
42
|
+
// Handle sub-groups
|
|
43
|
+
if (item.group && item.pages) {
|
|
44
|
+
return (
|
|
45
|
+
<>
|
|
46
|
+
<li class="cxd-links-subgroup">{item.group}</li>
|
|
47
|
+
{item.pages.map((page: SidebarSubItem) => {
|
|
48
|
+
const docSlug = getSlug(page.title)
|
|
49
|
+
const unversionedPageSlug = `${groupSlug}/${docSlug}`
|
|
50
|
+
|
|
51
|
+
const url = `${getConfig().docsPath}/${unversionedPageSlug}`
|
|
52
|
+
const active = Astro.params.slug === unversionedPageSlug
|
|
53
|
+
|
|
54
|
+
const generatedPage = docsPages.find(
|
|
55
|
+
(page) => page.id === unversionedPageSlug
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
// This test should not be necessary, see comments for `getSlug()` in `src/libs/utils.ts`.
|
|
59
|
+
if (!generatedPage) {
|
|
60
|
+
throw new Error(
|
|
61
|
+
`The page '${page.title}' referenced in 'site/data/sidebar.yml' does not exist at '${url}'.`
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<li>
|
|
67
|
+
<a
|
|
68
|
+
href={url}
|
|
69
|
+
class:list={['cxd-links-link', { active }]}
|
|
70
|
+
aria-current={active ? 'page' : undefined}
|
|
71
|
+
>
|
|
72
|
+
{page.title}
|
|
73
|
+
</a>
|
|
74
|
+
</li>
|
|
75
|
+
)
|
|
76
|
+
})}
|
|
77
|
+
</>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Handle regular pages
|
|
82
|
+
if (!item.title) {
|
|
83
|
+
return null
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const docSlug = getSlug(item.title)
|
|
45
87
|
const unversionedPageSlug = `${groupSlug}/${docSlug}`
|
|
46
88
|
|
|
47
89
|
const url = `${getConfig().docsPath}/${unversionedPageSlug}`
|
|
@@ -52,7 +94,7 @@ const sidebar = getData('sidebar')
|
|
|
52
94
|
// This test should not be necessary, see comments for `getSlug()` in `src/libs/utils.ts`.
|
|
53
95
|
if (!generatedPage) {
|
|
54
96
|
throw new Error(
|
|
55
|
-
`The page '${
|
|
97
|
+
`The page '${item.title}' referenced in 'data/sidebar.yml' does not exist at '${url}'.`
|
|
56
98
|
)
|
|
57
99
|
}
|
|
58
100
|
|
|
@@ -63,7 +105,7 @@ const sidebar = getData('sidebar')
|
|
|
63
105
|
class:list={['cxd-links-link', { active }]}
|
|
64
106
|
aria-current={active ? 'page' : undefined}
|
|
65
107
|
>
|
|
66
|
-
{
|
|
108
|
+
{item.title}
|
|
67
109
|
</a>
|
|
68
110
|
</li>
|
|
69
111
|
)
|
|
@@ -77,19 +119,17 @@ const sidebar = getData('sidebar')
|
|
|
77
119
|
return (
|
|
78
120
|
<>
|
|
79
121
|
<li class="cxd-links-span-all mt-2xsmall mb-medium mx-large border-top" />
|
|
80
|
-
<
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
</a>
|
|
88
|
-
</li>
|
|
122
|
+
<a
|
|
123
|
+
href={`${getConfig().docsPath}/${groupSlug}/`}
|
|
124
|
+
class:list={['cxd-links-link cxd-links-span-all', { active }]}
|
|
125
|
+
aria-current={active ? 'page' : undefined}
|
|
126
|
+
>
|
|
127
|
+
{group.title}
|
|
128
|
+
</a>
|
|
89
129
|
</>
|
|
90
130
|
)
|
|
91
131
|
}
|
|
92
132
|
})
|
|
93
133
|
}
|
|
94
|
-
</
|
|
134
|
+
</menu>
|
|
95
135
|
</nav>
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
* @slot default - Optional additional content (images, code blocks, etc.)
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
+
import Icon from './shortcodes/Icon.astro'
|
|
13
|
+
|
|
12
14
|
interface Props {
|
|
13
15
|
/** Icon ID from the SVG sprite (e.g., "cx-folder-tree") */
|
|
14
16
|
icon?: string
|
|
@@ -45,9 +47,7 @@ const headerClasses = [
|
|
|
45
47
|
{
|
|
46
48
|
icon && (
|
|
47
49
|
<div class="feature-thumb">
|
|
48
|
-
<
|
|
49
|
-
<use href={`#${icon}`} />
|
|
50
|
-
</svg>
|
|
50
|
+
<Icon name={icon} class="feature-icon icon-3xlarge medium:icon-4xlarge" sprite="" />
|
|
51
51
|
</div>
|
|
52
52
|
)
|
|
53
53
|
}
|
|
@@ -3,25 +3,26 @@
|
|
|
3
3
|
* Table of Contents
|
|
4
4
|
*
|
|
5
5
|
* Generate and render a hierarchical table of contents from headings.
|
|
6
|
+
* Can be called recursively to render nested children.
|
|
6
7
|
*/
|
|
7
8
|
|
|
8
9
|
import type { MarkdownHeading } from 'astro'
|
|
9
|
-
import { generateToc, type TocEntry } from '../libs/toc'
|
|
10
|
+
import { generateToc, type TocConfig, type TocEntry } from '../libs/toc'
|
|
10
11
|
|
|
11
12
|
interface Props {
|
|
12
|
-
/** Markdown headings to generate TOC from */
|
|
13
|
+
/** Markdown headings to generate TOC from. Required when `entries` is not provided. */
|
|
13
14
|
headings?: MarkdownHeading[]
|
|
14
|
-
/** Pre-generated TOC entries */
|
|
15
|
+
/** Pre-generated TOC entries. When provided, `headings` is ignored. */
|
|
15
16
|
entries?: TocEntry[]
|
|
16
|
-
/** Current nesting level */
|
|
17
|
+
/** Current nesting level. Set automatically during recursive rendering. */
|
|
17
18
|
level?: number
|
|
18
|
-
/** TOC
|
|
19
|
-
config?:
|
|
19
|
+
/** TOC depth configuration. Required when `entries` is not provided. */
|
|
20
|
+
config?: TocConfig
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
const { entries, headings, level, config } = Astro.props
|
|
23
24
|
|
|
24
|
-
const toc = entries ? entries : generateToc(headings ?? [], config)
|
|
25
|
+
const toc = entries ? entries : generateToc(headings ?? [], config!)
|
|
25
26
|
let entryLevel = level ? level + 1 : 1
|
|
26
27
|
---
|
|
27
28
|
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import type { Layout } from '../libs/layout'
|
|
9
|
+
import Icon from './shortcodes/Icon.astro'
|
|
9
10
|
|
|
10
11
|
interface Props {
|
|
11
12
|
/** Current layout context */
|
|
@@ -16,62 +17,40 @@ const { layout } = Astro.props
|
|
|
16
17
|
---
|
|
17
18
|
|
|
18
19
|
<button
|
|
19
|
-
class
|
|
20
|
+
class="nav-link gap-2xsmall px-0 large:px-small"
|
|
20
21
|
id="cxd-theme"
|
|
21
22
|
type="button"
|
|
22
23
|
aria-expanded="false"
|
|
23
|
-
data-cx-toggle="
|
|
24
|
-
{...layout !== 'examples' ? { 'data-cx-display': 'static' } : {}}
|
|
24
|
+
data-cx-toggle="menu"
|
|
25
25
|
aria-label="Toggle theme (auto)"
|
|
26
|
+
data-cx-placement="bottom-end"
|
|
26
27
|
>
|
|
27
|
-
<
|
|
28
|
+
<Icon name="circle-half-solid" class="theme-icon-active" />
|
|
28
29
|
<span
|
|
29
30
|
class=`${layout === 'examples' ? 'visually-hidden' : 'large:d-none ms-xsmall'}`
|
|
30
31
|
id="cxd-theme-text">Toggle theme</span
|
|
31
32
|
>
|
|
32
33
|
</button>
|
|
33
|
-
<ul
|
|
34
|
-
class=`dropdown-menu dropdown-menu-end${layout === 'examples' ? ' shadow' : ''}`
|
|
35
|
-
aria-labelledby="cxd-theme-text"
|
|
36
|
-
>
|
|
34
|
+
<ul class="menu" role="menu" aria-label="Theme options">
|
|
37
35
|
<li>
|
|
38
|
-
<button
|
|
39
|
-
|
|
40
|
-
class="dropdown-item d-flex align-items-center"
|
|
41
|
-
data-cx-theme-value="light"
|
|
42
|
-
aria-pressed="false"
|
|
43
|
-
>
|
|
44
|
-
<svg class="icon icon-reset me-xsmall" aria-hidden="true"><use href="#sun-solid"></use></svg>
|
|
36
|
+
<button type="button" class="menu-item" data-cx-theme-value="light">
|
|
37
|
+
<Icon name="sun-solid" class="menu-item-icon" />
|
|
45
38
|
Light
|
|
46
|
-
<
|
|
39
|
+
<Icon name="check-solid" class="menu-item-check" />
|
|
47
40
|
</button>
|
|
48
41
|
</li>
|
|
49
42
|
<li>
|
|
50
|
-
<button
|
|
51
|
-
|
|
52
|
-
class="dropdown-item d-flex align-items-center"
|
|
53
|
-
data-cx-theme-value="dark"
|
|
54
|
-
aria-pressed="false"
|
|
55
|
-
>
|
|
56
|
-
<svg class="icon icon-reset me-xsmall" aria-hidden="true"
|
|
57
|
-
><use href="#moon-stars-solid"></use></svg
|
|
58
|
-
>
|
|
43
|
+
<button type="button" class="menu-item" data-cx-theme-value="dark">
|
|
44
|
+
<Icon name="moon-stars-solid" class="menu-item-icon" />
|
|
59
45
|
Dark
|
|
60
|
-
<
|
|
46
|
+
<Icon name="check-solid" class="menu-item-check" />
|
|
61
47
|
</button>
|
|
62
48
|
</li>
|
|
63
49
|
<li>
|
|
64
|
-
<button
|
|
65
|
-
|
|
66
|
-
class="dropdown-item d-flex align-items-center active"
|
|
67
|
-
data-cx-theme-value="auto"
|
|
68
|
-
aria-pressed="true"
|
|
69
|
-
>
|
|
70
|
-
<svg class="icon icon-reset me-xsmall" aria-hidden="true"
|
|
71
|
-
><use href="#circle-half-solid"></use></svg
|
|
72
|
-
>
|
|
50
|
+
<button type="button" class="menu-item" data-cx-theme-value="auto">
|
|
51
|
+
<Icon name="circle-half-solid" class="menu-item-icon" />
|
|
73
52
|
Auto
|
|
74
|
-
<
|
|
53
|
+
<Icon name="check-solid" class="menu-item-check" />
|
|
75
54
|
</button>
|
|
76
55
|
</li>
|
|
77
56
|
</ul>
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
*
|
|
2
|
+
/**
|
|
3
|
+
* CSS Only
|
|
4
|
+
*
|
|
5
|
+
* Badge indicating a feature is available in CSS but has no equivalent
|
|
6
|
+
* Figma component. Renders with a tooltip that can be customized.
|
|
4
7
|
*/
|
|
5
8
|
|
|
6
9
|
interface Props {
|
|
10
|
+
/** Tooltip text shown on hover. */
|
|
7
11
|
tooltip?: string
|
|
8
12
|
}
|
|
9
13
|
|
|
@@ -20,9 +20,13 @@ interface Props {
|
|
|
20
20
|
* @default 'info'
|
|
21
21
|
*/
|
|
22
22
|
type?: 'danger' | 'info' | 'warning'
|
|
23
|
+
/**
|
|
24
|
+
* The CSS class(es) to be added to the callout wrapping `div` element.
|
|
25
|
+
*/
|
|
26
|
+
class?: string
|
|
23
27
|
}
|
|
24
28
|
|
|
25
|
-
const { name, type = 'info' } = Astro.props
|
|
29
|
+
const { name, type = 'info', class: className } = Astro.props
|
|
26
30
|
|
|
27
31
|
let Content: MarkdownInstance<{}>['Content'] | undefined
|
|
28
32
|
|
|
@@ -38,6 +42,6 @@ if (name) {
|
|
|
38
42
|
}
|
|
39
43
|
---
|
|
40
44
|
|
|
41
|
-
<div class={`cxd-callout cxd-callout-${type} context ${type}
|
|
45
|
+
<div class:list={[`cxd-callout cxd-callout-${type} context ${type}`, className]}>
|
|
42
46
|
{Content ? <Content /> : <slot />}
|
|
43
47
|
</div>
|