@chassis-ui/docs 0.1.8 → 0.1.10
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 +65 -58
- package/package.json +7 -7
- package/src/components/FeatureCard.astro +1 -1
- package/src/layouts/BaseLayout.astro +19 -7
- package/src/layouts/DocsLayout.astro +4 -1
- package/src/layouts/SingleLayout.astro +17 -20
- package/src/layouts/footer/Footer.astro +6 -5
- package/src/layouts/header/Navigation.astro +24 -21
- package/src/libs/utils.ts +5 -2
- package/src/scss/_docsearch.scss +86 -72
- package/src/scss/_layout.scss +11 -8
- package/src/layouts/IconsLayout.astro +0 -25
package/README.md
CHANGED
|
@@ -1,98 +1,105 @@
|
|
|
1
1
|
# @chassis-ui/docs
|
|
2
2
|
|
|
3
|
-
Shared Astro components and
|
|
3
|
+
> Shared Astro layouts, components, and utilities for Chassis documentation sites.
|
|
4
|
+
|
|
5
|
+
[](https://opensource.org/licenses/MIT) [](https://www.npmjs.com/package/@chassis-ui/docs) [](https://www.npmjs.com/package/@chassis-ui/docs)
|
|
4
6
|
|
|
5
7
|
## Overview
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
`@chassis-ui/docs` powers every documentation site in the Chassis ecosystem — the main `chassis-ui.com` website and the per-package docs for `chassis-css`, `chassis-tokens`, `chassis-icons`, `chassis-figma`, and `chassis-assets`. It ships pre-built layouts, navigation components, content-processing utilities, and SCSS helpers so each site stays consistent without duplicating code.
|
|
10
|
+
|
|
11
|
+
> [!NOTE] This package is developed inside the [`chassis-website`](https://github.com/chassis-ui/website) monorepo at `packages/docs/` and published to npm. Source, issues, and pull requests live in that repository.
|
|
8
12
|
|
|
9
13
|
## Installation
|
|
10
14
|
|
|
11
|
-
```
|
|
12
|
-
|
|
15
|
+
```sh
|
|
16
|
+
pnpm add @chassis-ui/docs
|
|
13
17
|
```
|
|
14
18
|
|
|
15
|
-
or
|
|
19
|
+
or:
|
|
16
20
|
|
|
17
|
-
```
|
|
18
|
-
|
|
21
|
+
```sh
|
|
22
|
+
npm install @chassis-ui/docs
|
|
19
23
|
```
|
|
20
24
|
|
|
21
|
-
|
|
25
|
+
### Peer Dependencies
|
|
22
26
|
|
|
23
|
-
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"astro": "^5.0.0"
|
|
30
|
+
}
|
|
31
|
+
```
|
|
24
32
|
|
|
25
|
-
|
|
26
|
-
- `@chassis-ui/icons`: Chassis icon library
|
|
27
|
-
- `@chassis-ui/tokens`: Chassis design tokens
|
|
28
|
-
- `astro`: ^4.0.0 || ^5.0.0
|
|
33
|
+
In practice, sites also install the rest of the Chassis stack — `@chassis-ui/css`, `@chassis-ui/tokens`, `@chassis-ui/icons` — to render the layouts and styles correctly.
|
|
29
34
|
|
|
30
35
|
## Usage
|
|
31
36
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
// Import layouts
|
|
36
|
-
import Layout from '@chassis-ui/docs/layouts/Layout.astro'
|
|
37
|
+
```astro
|
|
38
|
+
---
|
|
39
|
+
import BaseLayout from '@chassis-ui/docs/layouts/BaseLayout.astro'
|
|
37
40
|
import DocsLayout from '@chassis-ui/docs/layouts/DocsLayout.astro'
|
|
41
|
+
import SingleLayout from '@chassis-ui/docs/layouts/SingleLayout.astro'
|
|
38
42
|
|
|
39
|
-
|
|
40
|
-
import
|
|
41
|
-
import Callout from '@chassis-ui/docs/components/Callout.astro'
|
|
43
|
+
import TableOfContents from '@chassis-ui/docs/components/TableOfContents.astro'
|
|
44
|
+
import ThemeToggler from '@chassis-ui/docs/components/ThemeToggler.astro'
|
|
42
45
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
import { processImage } from '@chassis-ui/docs'
|
|
46
|
-
```
|
|
46
|
+
import { generateTOC, processImage } from '@chassis-ui/docs'
|
|
47
|
+
---
|
|
47
48
|
|
|
48
|
-
|
|
49
|
+
<SingleLayout title="About" description="…">
|
|
50
|
+
<slot />
|
|
51
|
+
</SingleLayout>
|
|
52
|
+
```
|
|
49
53
|
|
|
50
|
-
|
|
54
|
+
## Exports
|
|
51
55
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
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
|
+
| `@chassis-ui/docs/components/*` | `DocsSidebar`, `FeatureCard`, `NavLink`, `ResponsiveImage`, `TableOfContents`, `ThemeToggler` |
|
|
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 |
|
|
58
65
|
|
|
59
|
-
###
|
|
66
|
+
### Source Layout
|
|
60
67
|
|
|
61
68
|
```
|
|
62
69
|
src/
|
|
63
|
-
├── components/
|
|
64
|
-
|
|
65
|
-
├──
|
|
66
|
-
├──
|
|
67
|
-
|
|
68
|
-
└── scss/ # Styling utilities
|
|
70
|
+
├── components/ # Astro components (+ shortcodes/)
|
|
71
|
+
├── layouts/ # Page layouts (+ head/, header/, footer/)
|
|
72
|
+
├── libs/ # Utility libraries
|
|
73
|
+
├── js/ # Client-side scripts
|
|
74
|
+
└── scss/ # Styling utilities
|
|
69
75
|
```
|
|
70
76
|
|
|
71
|
-
##
|
|
77
|
+
## Chassis Ecosystem
|
|
72
78
|
|
|
73
|
-
|
|
74
|
-
- **Table of Contents**: Automatic TOC generation from headings
|
|
75
|
-
- **Image Optimization**: Helper functions for responsive images
|
|
76
|
-
- **Syntax Highlighting**: Code block components with syntax highlighting
|
|
77
|
-
- **Navigation**: Responsive documentation navigation components
|
|
78
|
-
- **Search Integration**: Ready-to-use search components
|
|
79
|
-
- **Accessibility**: WCAG-compliant components with proper ARIA attributes
|
|
79
|
+
This package is part of the Chassis Design System's multi-repository architecture:
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
| Project | Description |
|
|
82
|
+
| --- | --- |
|
|
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) | 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 |
|
|
82
89
|
|
|
83
|
-
|
|
90
|
+
All documentation sites in the ecosystem share this package for consistent layouts, components, and styling.
|
|
84
91
|
|
|
85
|
-
##
|
|
92
|
+
## Contributing
|
|
86
93
|
|
|
87
|
-
|
|
94
|
+
Issues and pull requests are welcome — please file them in [`chassis-ui/website`](https://github.com/chassis-ui/website). For larger changes, open an issue first so we can agree on the approach before you write the code.
|
|
88
95
|
|
|
89
|
-
##
|
|
96
|
+
## License
|
|
90
97
|
|
|
91
|
-
|
|
98
|
+
MIT © [Chassis UI](https://github.com/chassis-ui)
|
|
92
99
|
|
|
93
100
|
## Links
|
|
94
101
|
|
|
95
|
-
- [
|
|
96
|
-
- [
|
|
97
|
-
- [
|
|
98
|
-
- [
|
|
102
|
+
- [chassis-ui.com](https://chassis-ui.com)
|
|
103
|
+
- [npm package](https://www.npmjs.com/package/@chassis-ui/docs)
|
|
104
|
+
- [Source repository](https://github.com/chassis-ui/website/tree/main/packages/docs)
|
|
105
|
+
- [Issue tracker](https://github.com/chassis-ui/website/issues)
|
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.1.
|
|
4
|
+
"version": "0.1.10",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -44,20 +44,20 @@
|
|
|
44
44
|
"astro": "^5.0.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@docsearch/css": "^
|
|
48
|
-
"@docsearch/js": "^
|
|
47
|
+
"@docsearch/css": "^4.6.2",
|
|
48
|
+
"@docsearch/js": "^4.6.2",
|
|
49
49
|
"@types/hast": "^3.0.4",
|
|
50
50
|
"@types/mdast": "^4.0.4",
|
|
51
|
-
"astro": "^
|
|
51
|
+
"astro": "^6.1.9",
|
|
52
52
|
"github-slugger": "^2.0.0",
|
|
53
53
|
"image-size": "^2.0.2",
|
|
54
|
-
"mdast-util-from-markdown": "^2.0.
|
|
54
|
+
"mdast-util-from-markdown": "^2.0.3",
|
|
55
55
|
"mdast-util-mdx-jsx": "^3.2.0",
|
|
56
56
|
"mdast-util-to-string": "^4.0.0",
|
|
57
57
|
"remark": "^15.0.1",
|
|
58
58
|
"remark-html": "^16.0.1",
|
|
59
59
|
"unified": "^11.0.5",
|
|
60
|
-
"unist-util-visit": "^5.
|
|
61
|
-
"zod": "^4.
|
|
60
|
+
"unist-util-visit": "^5.1.0",
|
|
61
|
+
"zod": "^4.3.6"
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -27,7 +27,7 @@ const hasContent = Astro.slots.has('default')
|
|
|
27
27
|
const cardClasses = [
|
|
28
28
|
'feature-item bg-even d-flex flex-column rounded-large',
|
|
29
29
|
'p-medium p-large-xlarge gap-medium gap-medium-xlarge',
|
|
30
|
-
horizontal ? '
|
|
30
|
+
horizontal ? '' : 'h-100',
|
|
31
31
|
classes
|
|
32
32
|
]
|
|
33
33
|
.filter(Boolean)
|
|
@@ -28,24 +28,34 @@ type Props = {
|
|
|
28
28
|
// any override.
|
|
29
29
|
main?: LayoutOverridesHTMLAttributes<'main'>
|
|
30
30
|
}
|
|
31
|
-
// A string containing the robots meta tag content. If not set, the tag will not be rendered.
|
|
32
|
-
robots?: string
|
|
33
31
|
// An override for the page title. If not defined, the title will either be the content of the `title` frontmatter
|
|
34
32
|
// property when rendering a markdown page or default back to the one defined in the `config.yml` file.
|
|
35
33
|
title?: string
|
|
34
|
+
// An override for the page description. If not defined, the description will either be the content of the
|
|
35
|
+
// `description` frontmatter property when rendering a markdown page or default back to the one defined in
|
|
36
|
+
// the `config.yml` file.
|
|
37
|
+
description?: string
|
|
38
|
+
// A string containing the robots meta tag content. If not set, the tag will not be rendered.
|
|
39
|
+
robots?: string
|
|
36
40
|
} & MarkdownProps
|
|
37
41
|
|
|
38
42
|
// The following props are automatically set by Astro (if defined) based on the markdown frontmatter when rendering a
|
|
39
43
|
// markdown page. They can be accessed through the `Astro.props.frontmatter` object but note that they won't be set when
|
|
40
44
|
// not rendering a markdown page.
|
|
41
|
-
type MarkdownProps = { frontmatter?: Partial<CollectionEntry<'docs'
|
|
45
|
+
type MarkdownProps = { frontmatter?: Partial<CollectionEntry<'docs'>['data']> }
|
|
46
|
+
|
|
47
|
+
// This type is used to define the shape of the `extra_js` frontmatter property which allows adding extra JavaScript
|
|
48
|
+
// files to a page by passing an array of objects containing the `src` and `async` properties.
|
|
49
|
+
type ExtraJS = NonNullable<CollectionEntry<'docs'>['data']['extra_js']>[number]
|
|
42
50
|
|
|
43
51
|
const { frontmatter, layout, overrides, robots } = Astro.props
|
|
44
52
|
|
|
45
53
|
const title = Astro.props.title ?? frontmatter?.title ?? getConfig().title
|
|
46
|
-
const description =
|
|
47
|
-
? stripMarkdown(
|
|
48
|
-
:
|
|
54
|
+
const description = Astro.props.description
|
|
55
|
+
? stripMarkdown(Astro.props.description)
|
|
56
|
+
: frontmatter?.description
|
|
57
|
+
? stripMarkdown(frontmatter.description)
|
|
58
|
+
: getConfig().description
|
|
49
59
|
const thumbnail = frontmatter?.thumbnail
|
|
50
60
|
? `${frontmatter.thumbnail}`
|
|
51
61
|
: 'static/images/social-image.png'
|
|
@@ -87,7 +97,9 @@ const mainProps = overrides?.main ?? {}
|
|
|
87
97
|
|
|
88
98
|
{
|
|
89
99
|
frontmatter?.extra_js &&
|
|
90
|
-
frontmatter.extra_js.map((js) =>
|
|
100
|
+
frontmatter.extra_js.map((js: ExtraJS) => (
|
|
101
|
+
<script is:inline async={js.async} src={js.src} />
|
|
102
|
+
))
|
|
91
103
|
}
|
|
92
104
|
|
|
93
105
|
{
|
|
@@ -26,6 +26,8 @@ interface Props {
|
|
|
26
26
|
|
|
27
27
|
const { frontmatter, headings, id } = Astro.props
|
|
28
28
|
|
|
29
|
+
type DocSection = NonNullable<typeof frontmatter.sections>[number]
|
|
30
|
+
|
|
29
31
|
// Extract the directory/section from the ID (format: "directory/filename.mdx")
|
|
30
32
|
const parentDirectory = id.includes('/') ? id.split('/')[0] : ''
|
|
31
33
|
|
|
@@ -44,6 +46,7 @@ if (frontmatter.toc) {
|
|
|
44
46
|
<aside class="cxd-sidebar">
|
|
45
47
|
<div
|
|
46
48
|
class="offcanvas-large offcanvas-start"
|
|
49
|
+
role="dialog"
|
|
47
50
|
tabindex="-1"
|
|
48
51
|
id="cxdSidebar"
|
|
49
52
|
aria-labelledby="cxdSidebarOffcanvasLabel"
|
|
@@ -139,7 +142,7 @@ if (frontmatter.toc) {
|
|
|
139
142
|
{
|
|
140
143
|
frontmatter.sections && (
|
|
141
144
|
<div class="row g-xlarge">
|
|
142
|
-
{frontmatter.sections.map((section) => (
|
|
145
|
+
{frontmatter.sections.map((section: DocSection) => (
|
|
143
146
|
<div class="col-medium-6">
|
|
144
147
|
<a
|
|
145
148
|
class="d-block text-decoration-none"
|
|
@@ -6,36 +6,33 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import BaseLayout from './BaseLayout.astro'
|
|
9
|
+
import type { LayoutOverridesHTMLAttributes } from '../libs/layout'
|
|
9
10
|
|
|
10
11
|
interface Props {
|
|
11
|
-
/** Page description */
|
|
12
|
-
description: string
|
|
13
12
|
/** Page title */
|
|
14
13
|
title: string
|
|
14
|
+
/** Page description */
|
|
15
|
+
description: string
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
const { description, title } = Astro.props
|
|
19
|
+
|
|
20
|
+
const mainProps: LayoutOverridesHTMLAttributes<'main'> = {}
|
|
21
|
+
mainProps['class'] = 'min-vh-100'
|
|
18
22
|
---
|
|
19
23
|
|
|
20
|
-
<BaseLayout {...Astro.props} layout="single">
|
|
21
|
-
<
|
|
22
|
-
<
|
|
23
|
-
<div class="
|
|
24
|
-
<div class="
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
<slot name="header-content" />
|
|
29
|
-
</div>
|
|
24
|
+
<BaseLayout {...Astro.props} layout="single" overrides={{ main: mainProps }}>
|
|
25
|
+
<header class="py-xlarge py-medium-3xlarge border-bottom border-subtle">
|
|
26
|
+
<div class="container-2xlarge">
|
|
27
|
+
<div class="row">
|
|
28
|
+
<div class="col col-large-10 col-2xlarge-8">
|
|
29
|
+
<h1 class="mt-0">{title}</h1>
|
|
30
|
+
<p class="font-lead">{description}</p>
|
|
31
|
+
<slot name="header-content" />
|
|
30
32
|
</div>
|
|
31
33
|
</div>
|
|
32
|
-
</
|
|
34
|
+
</div>
|
|
35
|
+
</header>
|
|
33
36
|
|
|
34
|
-
|
|
35
|
-
<div class="container-2xlarge cxd-gutter">
|
|
36
|
-
<slot />
|
|
37
|
-
<slot name="main-content" />
|
|
38
|
-
</div>
|
|
39
|
-
</main>
|
|
40
|
-
</Fragment>
|
|
37
|
+
<slot />
|
|
41
38
|
</BaseLayout>
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
</p>
|
|
24
24
|
</div>
|
|
25
25
|
<div class="col-small-4 col-large-2 offset-large-1 mb-medium">
|
|
26
|
-
<
|
|
26
|
+
<p class="h6 mb-xsmall">Docs</p>
|
|
27
27
|
<ul class="nav">
|
|
28
28
|
<li><a href="/tokens">Design Tokens</a></li>
|
|
29
29
|
<li><a href="/assets">Asset Distributor</a></li>
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
</ul>
|
|
34
34
|
</div>
|
|
35
35
|
<div class="col-small-4 col-large-2 mb-medium">
|
|
36
|
-
<
|
|
36
|
+
<p class="h6 mb-xsmall">Github</p>
|
|
37
37
|
<ul class="nav">
|
|
38
38
|
<li><a href="https://github.com/chassis-ui/tokens">Chassis Tokens</a></li>
|
|
39
39
|
<li><a href="https://github.com/chassis-ui/assets">Chassis Assets</a></li>
|
|
@@ -43,12 +43,13 @@
|
|
|
43
43
|
</ul>
|
|
44
44
|
</div>
|
|
45
45
|
<div class="col-small-4 col-large-2 mb-medium">
|
|
46
|
-
<
|
|
46
|
+
<p class="h6 mb-xsmall">Project</p>
|
|
47
47
|
<ul class="nav">
|
|
48
|
+
<li><a href="/about">About</a></li>
|
|
48
49
|
<li><a href="/blog">Blog</a></li>
|
|
49
|
-
<li><a href="
|
|
50
|
+
<li><a href="/examples">Examples</a></li>
|
|
50
51
|
<li><a href="https://github.com/chassis-ui">Contribute</a></li>
|
|
51
|
-
<li><a href="https://
|
|
52
|
+
<li><a href="https://x.com/chassis_ui">@chassis_ui on X</a></li>
|
|
52
53
|
</ul>
|
|
53
54
|
</div>
|
|
54
55
|
</div>
|
|
@@ -17,7 +17,18 @@ interface Props {
|
|
|
17
17
|
title: string
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
const { layout
|
|
20
|
+
const { layout } = Astro.props
|
|
21
|
+
const { pathname } = Astro.url
|
|
22
|
+
const isActive = (path: string) => {
|
|
23
|
+
if (path === '/') {
|
|
24
|
+
return pathname === '/' || pathname === ''
|
|
25
|
+
}
|
|
26
|
+
// Remove trailing slashes for a cleaner comparison
|
|
27
|
+
const cleanPathname = pathname.endsWith('/') ? pathname.slice(0, -1) : pathname
|
|
28
|
+
const cleanLinkPath = path.endsWith('/') ? path.slice(0, -1) : path
|
|
29
|
+
|
|
30
|
+
return cleanPathname.startsWith(cleanLinkPath)
|
|
31
|
+
}
|
|
21
32
|
---
|
|
22
33
|
|
|
23
34
|
<header class="navbar navbar-expand-large cxd-navbar sticky-top">
|
|
@@ -64,6 +75,7 @@ const { layout, title } = Astro.props
|
|
|
64
75
|
|
|
65
76
|
<div
|
|
66
77
|
class="offcanvas-large offcanvas-end flex-grow-1"
|
|
78
|
+
role="dialog"
|
|
67
79
|
tabindex="-1"
|
|
68
80
|
id="cxdNavbar"
|
|
69
81
|
aria-labelledby="cxdNavbarOffcanvasLabel"
|
|
@@ -79,27 +91,18 @@ const { layout, title } = Astro.props
|
|
|
79
91
|
</div>
|
|
80
92
|
|
|
81
93
|
<div class="offcanvas-body p-large pt-0 p-large-0">
|
|
82
|
-
<hr class="d-large-none
|
|
94
|
+
<hr class="d-large-none" />
|
|
83
95
|
<ul class="navbar-nav flex-row flex-wrap cxd-navbar-nav mx-0 mx-large-medium">
|
|
84
|
-
<NavLink active={
|
|
85
|
-
<NavLink active={
|
|
86
|
-
<NavLink active={
|
|
87
|
-
<NavLink active={
|
|
88
|
-
<NavLink active={
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
<
|
|
92
|
-
class="nav-link dropdown-toggle"
|
|
93
|
-
href="/#"
|
|
94
|
-
role="button"
|
|
95
|
-
data-cx-toggle="dropdown"
|
|
96
|
-
aria-expanded="false">More</a
|
|
97
|
-
>
|
|
98
|
-
<ul class="dropdown-menu">
|
|
99
|
-
<li><a class="dropdown-item" href="/examples">Examples</a></li>
|
|
100
|
-
<li><a class="dropdown-item" href="/blog">Blog</a></li>
|
|
101
|
-
</ul>
|
|
96
|
+
<NavLink active={isActive('/tokens')} href="/tokens">Tokens</NavLink>
|
|
97
|
+
<NavLink active={isActive('/figma')} href="/figma">Figma</NavLink>
|
|
98
|
+
<NavLink active={isActive('/css')} href="/css">CSS</NavLink>
|
|
99
|
+
<NavLink active={isActive('/assets')} href="/assets">Assets</NavLink>
|
|
100
|
+
<NavLink active={isActive('/icons')} href="/icons">Icons</NavLink>
|
|
101
|
+
<li class="nav-item col-12 col-large-auto d-large-flex">
|
|
102
|
+
<div class="vr d-none d-large-flex my-auto mx-large-2"></div>
|
|
103
|
+
<hr class="d-large-none" />
|
|
102
104
|
</li>
|
|
105
|
+
<NavLink active={isActive('/examples')} href="/examples">Examples</NavLink>
|
|
103
106
|
</ul>
|
|
104
107
|
|
|
105
108
|
<hr class="d-large-none" />
|
|
@@ -124,7 +127,7 @@ const { layout, title } = Astro.props
|
|
|
124
127
|
<small class="d-large-none ms-xsmall">X</small>
|
|
125
128
|
</NavLink>
|
|
126
129
|
<li class="nav-item col-12 col-large-auto">
|
|
127
|
-
<div class="vr d-none d-large-flex h-100 mx-large-2
|
|
130
|
+
<div class="vr d-none d-large-flex h-100 mx-large-2"></div>
|
|
128
131
|
<hr class="d-large-none" />
|
|
129
132
|
</li>
|
|
130
133
|
|
package/src/libs/utils.ts
CHANGED
|
@@ -107,9 +107,12 @@ export function getSiteUrl(config: any) {
|
|
|
107
107
|
return `http://${host}:${port}`
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
// Vercel Production:
|
|
110
|
+
// Vercel Production: Prefer config.baseURL because it already has the correct
|
|
111
|
+
// path-prefixed chassis-ui.com URL (e.g. https://chassis-ui.com/tokens/).
|
|
112
|
+
// VERCEL_PROJECT_PRODUCTION_URL is the sub-project's own custom domain
|
|
113
|
+
// (e.g. tokens.chassis-ui.com) which is NOT the canonical URL we want in sitemaps.
|
|
111
114
|
if (process.env.VERCEL_ENV === 'production') {
|
|
112
|
-
return `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}`
|
|
115
|
+
return config.baseURL || `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}`
|
|
113
116
|
}
|
|
114
117
|
|
|
115
118
|
// Vercel Preview: Branch deployments and previews
|
package/src/scss/_docsearch.scss
CHANGED
|
@@ -1,53 +1,68 @@
|
|
|
1
1
|
// stylelint-disable selector-class-pattern
|
|
2
2
|
|
|
3
3
|
:root {
|
|
4
|
+
/* Colors */
|
|
4
5
|
--docsearch-primary-color: var(--cx-primary);
|
|
6
|
+
--docsearch-soft-primary-color: var(--cx-primary-fg-subtle);
|
|
7
|
+
--docsearch-subtle-color: var(--cx-border-subtle);
|
|
5
8
|
--docsearch-text-color: var(--cx-fg-main);
|
|
6
|
-
--docsearch-
|
|
7
|
-
|
|
8
|
-
--docsearch-
|
|
9
|
-
--docsearch-
|
|
9
|
+
--docsearch-error-color: var(--cx-danger-fg-main);
|
|
10
|
+
--docsearch-success-color: var(--cx-success-fg-main);
|
|
11
|
+
--docsearch-secondary-text-color: var(--cx-fg-subtle);
|
|
12
|
+
--docsearch-background-color: var(--cx-bg-main);
|
|
13
|
+
--docsearch-icon-color: var(--cx-fg-subtle);
|
|
10
14
|
--docsearch-container-background: var(--cx-black-dim-main);
|
|
11
15
|
--docsearch-logo-color: var(--cx-primary);
|
|
12
|
-
|
|
16
|
+
--docsearch-muted-color: var(--cx-fg-subtle);
|
|
17
|
+
--docsearch-muted-color-darker: var(--cx-fg-slight);
|
|
18
|
+
|
|
19
|
+
/* Spacing & Layout */
|
|
20
|
+
--docsearch-spacing: var(--cx-space-medium);
|
|
21
|
+
--docsearch-border-radius: var(--cx-border-radius-medium);
|
|
22
|
+
--docsearch-icon-stroke-width: var(--cx-border-width-medium);
|
|
23
|
+
|
|
24
|
+
/* Highlights & Focus */
|
|
25
|
+
--docsearch-focus-color: var(--cx-primary);
|
|
26
|
+
--docsearch-highlight-color: var(--cx-primary);
|
|
27
|
+
|
|
28
|
+
/* Button */
|
|
29
|
+
--docsearch-search-button-background: var(--cx-bg-main);
|
|
30
|
+
--docsearch-search-button-text-color: var(--cx-fg-subtle);
|
|
31
|
+
|
|
32
|
+
/* Modal */
|
|
33
|
+
--docsearch-modal-width: 640px;
|
|
13
34
|
// --docsearch-modal-height: 600px;
|
|
35
|
+
// --docsearch-modal-variable-height: 60dvh;
|
|
14
36
|
--docsearch-modal-background: var(--cx-bg-even);
|
|
15
|
-
--docsearch-modal-shadow: var(--cx-box-shadow-large);
|
|
37
|
+
--docsearch-modal-shadow: var(--cx-box-shadow-large);
|
|
38
|
+
|
|
39
|
+
/* Searchbox */
|
|
16
40
|
// --docsearch-searchbox-height: 56px;
|
|
17
|
-
--docsearch-searchbox-
|
|
18
|
-
--docsearch-searchbox-
|
|
19
|
-
|
|
41
|
+
// --docsearch-searchbox-initial-height: 56px;
|
|
42
|
+
--docsearch-searchbox-background: var(--cx-bg-even);
|
|
43
|
+
--docsearch-searchbox-focus-background: var(--cx-bg-main);
|
|
44
|
+
// --docsearch-actions-width: 99px;
|
|
45
|
+
// --docsearch-actions-height: 44px;
|
|
46
|
+
|
|
47
|
+
/* Hit */
|
|
20
48
|
// --docsearch-hit-height: 56px;
|
|
21
49
|
--docsearch-hit-color: var(--cx-fg-main);
|
|
22
|
-
--docsearch-hit-
|
|
50
|
+
--docsearch-hit-highlight-color: var(--cx-bg-highlight);
|
|
23
51
|
--docsearch-hit-background: var(--cx-bg-main);
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
52
|
+
|
|
53
|
+
/* Key */
|
|
54
|
+
--docsearch-key-background: var(--cx-bg-main);
|
|
55
|
+
--docsearch-key-color: var(--cx-fg-subtle);
|
|
56
|
+
--docsearch-key-pressed-shadow: var(--cx-box-shadow-small);
|
|
57
|
+
|
|
58
|
+
/* Footer */
|
|
59
|
+
--docsearch-footer-height: 52px;
|
|
29
60
|
--docsearch-footer-background: var(--cx-bg-evident);
|
|
30
|
-
--docsearch-footer-shadow:
|
|
31
|
-
}
|
|
61
|
+
--docsearch-footer-shadow: var(--cx-box-shadow-small);
|
|
32
62
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
// and are slightly modified for formatting purpose
|
|
37
|
-
// --docsearch-text-color: var(--cx-fg-main);
|
|
38
|
-
// --docsearch-container-background: var(--cx-dim-main);
|
|
39
|
-
// --docsearch-modal-background: var(--cx-bg-even);
|
|
40
|
-
// --docsearch-modal-shadow: var(--cx-box-shadow-large); // inset 1px 1px 0 0 #2c2e40, 0 3px 8px 0 #000309;
|
|
41
|
-
// --docsearch-searchbox-background: var(--cx-bg-main, #fc0);
|
|
42
|
-
// --docsearch-searchbox-focus-background: var(--cx-bg-hover, #fc0);
|
|
43
|
-
// --docsearch-hit-color: #bec3c9;
|
|
44
|
-
// --docsearch-hit-shadow: none;
|
|
45
|
-
// --docsearch-hit-background: #090a11;
|
|
46
|
-
// --docsearch-key-gradient: linear-gradient(-26.5deg, #565872, #31355b);
|
|
47
|
-
// --docsearch-key-shadow: inset 0 -2px 0 0 #282d55, inset 0 0 1px 1px #51577d, 0 2px 2px 0 rgba(3, 4, 9, .3);
|
|
48
|
-
// --docsearch-footer-background: #1e2136;
|
|
49
|
-
// --docsearch-footer-shadow: inset 0 1px 0 0 rgba(73, 76, 106, .5), 0 -4px 8px 0 rgba(0, 0, 0, .2);
|
|
50
|
-
// --docsearch-muted-color: #7f8497;
|
|
63
|
+
/* Dropdown Menu */
|
|
64
|
+
--docsearch-dropdown-menu-background: var(--docsearch-hit-background);
|
|
65
|
+
--docsearch-dropdown-menu-item-hover-background: var(--docsearch-modal-background);
|
|
51
66
|
}
|
|
52
67
|
|
|
53
68
|
.cxd-search {
|
|
@@ -61,17 +76,11 @@
|
|
|
61
76
|
}
|
|
62
77
|
@include media-breakpoint-up(2xlarge) {
|
|
63
78
|
left: 50%;
|
|
64
|
-
|
|
65
|
-
margin-left: 12rem;
|
|
79
|
+
margin-left: 16rem;
|
|
66
80
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
81
|
}
|
|
70
82
|
|
|
71
83
|
.DocSearch-Container {
|
|
72
|
-
// --docsearch-muted-color: var(--cx-fg-subtle);
|
|
73
|
-
// --docsearch-hit-shadow: none;
|
|
74
|
-
|
|
75
84
|
position: fixed;
|
|
76
85
|
z-index: 2000; // Make sure to be over all components showcased in the documentation
|
|
77
86
|
cursor: auto; // Needed because of [role="button"] in Algolia search modal. Remove once https://github.com/algolia/docsearch/issues/1370 is tackled.
|
|
@@ -82,15 +91,8 @@
|
|
|
82
91
|
}
|
|
83
92
|
|
|
84
93
|
.DocSearch-Button {
|
|
85
|
-
--docsearch-searchbox-background: var(--cx-bg-main);
|
|
86
|
-
--docsearch-searchbox-color: var(--cx-fg-subtle);
|
|
87
|
-
--docsearch-searchbox-focus-background: var(--cx-bg-hover);
|
|
88
|
-
--docsearch-searchbox-shadow: none;
|
|
89
|
-
--docsearch-text-color: var(--cx-fg-subtle);
|
|
90
|
-
--docsearch-muted-color: var(--cx-fg-subtle);
|
|
91
|
-
|
|
92
94
|
width: 100%;
|
|
93
|
-
height: 38px; // Match Chassis
|
|
95
|
+
height: 38px; // Match Chassis inputs
|
|
94
96
|
margin: 0;
|
|
95
97
|
border: var(--cx-border-width-medium) solid var(--cx-border-subtle);
|
|
96
98
|
@include border-radius(var(--cx-border-radius-medium));
|
|
@@ -102,8 +104,6 @@
|
|
|
102
104
|
&:active,
|
|
103
105
|
&:focus,
|
|
104
106
|
&:hover {
|
|
105
|
-
// border-color: rgba($cxd-accent, 1);
|
|
106
|
-
|
|
107
107
|
.DocSearch-Search-Icon {
|
|
108
108
|
opacity: 1;
|
|
109
109
|
}
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
|
|
133
133
|
.DocSearch-Button-Keys {
|
|
134
134
|
min-width: 0;
|
|
135
|
-
padding: .
|
|
135
|
+
padding: .125rem .5rem;
|
|
136
136
|
background: var(--cx-bg-evident);
|
|
137
137
|
@include border-radius(var(--cx-border-radius-small));
|
|
138
138
|
}
|
|
@@ -140,31 +140,29 @@
|
|
|
140
140
|
.DocSearch-Button-Key {
|
|
141
141
|
top: 0;
|
|
142
142
|
width: auto;
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
padding-left: .125rem;
|
|
146
|
-
margin-right: 0;
|
|
147
|
-
// font-size: .875rem;
|
|
143
|
+
padding: 0;
|
|
144
|
+
@include font-size(.875rem);
|
|
148
145
|
background: none;
|
|
146
|
+
border: 0;
|
|
149
147
|
box-shadow: none;
|
|
150
148
|
}
|
|
151
149
|
|
|
152
150
|
.DocSearch-Commands-Key {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
151
|
+
width: 16px;
|
|
152
|
+
height: 16px;
|
|
153
|
+
padding: 0;
|
|
154
|
+
color: var(--cx-icon-subtle);
|
|
155
|
+
background: none;
|
|
157
156
|
box-shadow: none;
|
|
157
|
+
@include border-radius(var(--cx-border-radius-small));
|
|
158
|
+
.DocSearch-Escape-Key {
|
|
159
|
+
@include font-size(var(--cx-font-size-xsmall));
|
|
160
|
+
}
|
|
158
161
|
}
|
|
159
162
|
|
|
160
|
-
.DocSearch-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
.DocSearch-Hits {
|
|
165
|
-
mark {
|
|
166
|
-
padding: 0;
|
|
167
|
-
}
|
|
163
|
+
.DocSearch-Action:hover,
|
|
164
|
+
.DocSearch-AskAi-Return:hover {
|
|
165
|
+
background: none;
|
|
168
166
|
}
|
|
169
167
|
|
|
170
168
|
.DocSearch-Hit {
|
|
@@ -174,12 +172,12 @@
|
|
|
174
172
|
a {
|
|
175
173
|
@include border-radius(0);
|
|
176
174
|
border: solid var(--cx-border-subtle);
|
|
177
|
-
border-width: 0
|
|
175
|
+
border-width: 0 var(--cx-border-width) var(--cx-border-width);
|
|
178
176
|
}
|
|
179
177
|
|
|
180
178
|
&:first-child a {
|
|
181
179
|
@include border-top-radius(var(--cx-border-radius));
|
|
182
|
-
border-top-width:
|
|
180
|
+
border-top-width: var(--cx-border-width);
|
|
183
181
|
}
|
|
184
182
|
&:last-child a {
|
|
185
183
|
@include border-bottom-radius(var(--cx-border-radius));
|
|
@@ -189,6 +187,22 @@
|
|
|
189
187
|
.DocSearch-Hit-icon {
|
|
190
188
|
display: flex;
|
|
191
189
|
align-items: center;
|
|
190
|
+
margin-right: var(--cx-space-xsmall);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.DocSearch-Hit-content-wrapper {
|
|
194
|
+
gap: 0;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.DocSearch-Hit-action-button:focus,
|
|
198
|
+
.DocSearch-Hit-action-button:hover {
|
|
199
|
+
color: var(--cx-primary-fg-main);
|
|
200
|
+
background: none;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.DocSearch-Hit-action-button:focus path,
|
|
204
|
+
.DocSearch-Hit-action-button:hover path {
|
|
205
|
+
fill: none;
|
|
192
206
|
}
|
|
193
207
|
|
|
194
208
|
// Fix --docsearch-logo-color that doesn't do anything
|
package/src/scss/_layout.scss
CHANGED
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
|
|
24
24
|
.cxd-intro {
|
|
25
25
|
grid-area: intro;
|
|
26
|
-
|
|
26
|
+
max-width: 960px;
|
|
27
|
+
margin: 2rem auto 0;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
.cxd-main {
|
|
@@ -61,12 +62,14 @@
|
|
|
61
62
|
.cxd-content {
|
|
62
63
|
grid-area: content;
|
|
63
64
|
min-width: 1px; // Fix width when cxd-content contains a `<pre>` https://github.com/chassis-ui/css/issues/25410
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.cxd-content,
|
|
67
|
-
.cxd-intro {
|
|
68
|
-
width: 100%;
|
|
69
65
|
max-width: 960px;
|
|
70
|
-
margin
|
|
71
|
-
margin-left: auto;
|
|
66
|
+
margin: 0 auto;
|
|
72
67
|
}
|
|
68
|
+
|
|
69
|
+
// .cxd-content,
|
|
70
|
+
// .cxd-intro {
|
|
71
|
+
// width: 100%;
|
|
72
|
+
// max-width: 960px;
|
|
73
|
+
// margin-right: auto;
|
|
74
|
+
// margin-left: auto;
|
|
75
|
+
// }
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
/**
|
|
3
|
-
* Icons Layout
|
|
4
|
-
*
|
|
5
|
-
* Specialized layout for icon documentation pages with scrollspy navigation.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import type { LayoutOverridesHTMLAttributes } from '../libs/layout'
|
|
9
|
-
import BaseLayout from './BaseLayout.astro'
|
|
10
|
-
|
|
11
|
-
const bodyProps: LayoutOverridesHTMLAttributes<'body'> = {}
|
|
12
|
-
|
|
13
|
-
bodyProps['id'] = 'icons-body'
|
|
14
|
-
bodyProps['data-cx-spy'] = 'scroll'
|
|
15
|
-
bodyProps['data-cx-target'] = '#icons-nav'
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
<BaseLayout {...Astro.props} layout="icons" overrides={{ body: bodyProps }}>
|
|
19
|
-
<div
|
|
20
|
-
slot="main"
|
|
21
|
-
class="container-2xlarge px-medium px-medium-4xlarge cxd-gutter icon-docs icon-reset pt-medium-large pb-medium-large"
|
|
22
|
-
>
|
|
23
|
-
<slot />
|
|
24
|
-
</div>
|
|
25
|
-
</BaseLayout>
|