@chassis-ui/docs 0.1.7 → 0.1.8

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/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.7",
4
+ "version": "0.1.8",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",
@@ -16,8 +16,6 @@ interface Props {
16
16
  rel?: HTMLAnchorElement['rel']
17
17
  /** Link target attribute */
18
18
  target?: HTMLAnchorElement['target']
19
- /** Enable analytics tracking */
20
- track?: boolean
21
19
  }
22
20
 
23
21
  const { active, class: className, ...props } = Astro.props
@@ -102,7 +102,16 @@
102
102
  container.id = 'chassis-icons-sprite'
103
103
  container.style.display = 'none'
104
104
  container.setAttribute('aria-hidden', 'true')
105
- container.innerHTML = spriteContent
105
+
106
+ // Use DOMParser to safely parse SVG content instead of innerHTML
107
+ const parsed = new DOMParser().parseFromString(spriteContent, 'image/svg+xml')
108
+ const svgEl = parsed.querySelector('svg')
109
+ if (svgEl) {
110
+ container.appendChild(svgEl)
111
+ } else {
112
+ // Fallback: should not happen given fetchSprite validation
113
+ container.innerHTML = spriteContent
114
+ }
106
115
 
107
116
  // Insert at the end of body
108
117
  document.body.appendChild(container)
package/src/js/search.js CHANGED
@@ -24,16 +24,11 @@ import docsearch from '@docsearch/js'
24
24
  return
25
25
  }
26
26
 
27
- const siteDocsVersion = searchElement.getAttribute('data-cxd-docs-version')
28
-
29
27
  docsearch({
30
28
  apiKey: CONFIG.apiKey,
31
29
  indexName: CONFIG.indexName,
32
30
  appId: CONFIG.appId,
33
31
  container: searchElement,
34
- searchParameters: {
35
- facetFilters: [`version:${siteDocsVersion}`]
36
- },
37
32
  transformItems(items) {
38
33
  return items.map((item) => {
39
34
  const liveUrl = 'https://chassis-ui.com/'
@@ -41,7 +36,7 @@ import docsearch from '@docsearch/js'
41
36
  item.url = window.location.origin.startsWith(liveUrl)
42
37
  ? // On production, return the result as is
43
38
  item.url
44
- : // On development or Netlify, replace `item.url` with a trailing slash,
39
+ : // On development or Vercel, replace `item.url` with a trailing slash,
45
40
  // so that the result link is relative to the server root
46
41
  item.url.replace(liveUrl, '/')
47
42
 
package/src/js/sidebar.js CHANGED
@@ -1,7 +1,3 @@
1
- // NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
2
- // IT'S ALL JUST JUNK FOR OUR DOCS!
3
- // ++++++++++++++++++++++++++++++++++++++++++
4
-
5
1
  /*
6
2
  * JavaScript for Chassis's docs (https://chassis-ui.com/)
7
3
  * Copyright 2011-2025 The Chassis Authors
@@ -31,8 +31,9 @@ const parentDirectory = id.includes('/') ? id.split('/')[0] : ''
31
31
 
32
32
  const bodyProps: LayoutOverridesHTMLAttributes<'body'> = {}
33
33
 
34
+ bodyProps['class'] = 'docs-body'
35
+
34
36
  if (frontmatter.toc) {
35
- bodyProps['class'] = 'docs-body'
36
37
  bodyProps['data-cx-spy'] = 'scroll'
37
38
  bodyProps['data-cx-target'] = '#TableOfContents'
38
39
  }
@@ -14,8 +14,6 @@ interface Props {
14
14
  }
15
15
 
16
16
  const { layout } = Astro.props
17
-
18
- console.log('layout in Scripts:', layout)
19
17
  ---
20
18
 
21
19
  <script is:inline {...getChassisJsProps()}></script>
@@ -35,7 +35,7 @@ const canonicalUrl = new URL(Astro.url.pathname, Astro.site)
35
35
  const isHome = Astro.url.pathname === '/'
36
36
  const pageTitle = isHome
37
37
  ? `${getConfig().title} · ${getConfig().subtitle}`
38
- : `${title} · ${getConfig().title} v${getConfig().docs_version}`
38
+ : `${title} · ${getConfig().title}`
39
39
  ---
40
40
 
41
41
  <meta charset="UTF-8" />
@@ -46,11 +46,10 @@ const pageTitle = isHome
46
46
  <meta name="author" content={getConfig().authors} />
47
47
  <meta name="generator" content={Astro.generator} />
48
48
  <meta name="docsearch:language" content="en" />
49
- <meta name="docsearch:version" content={getConfig().docs_version} />
50
49
 
51
50
  <link rel="canonical" href={canonicalUrl} />
52
51
 
53
- <link rel="preconnect" href=`https://${getConfig().algolia.app_id}-dsn.algolia.net` crossorigin />
52
+ <link rel="preconnect" href={`https://${getConfig().algolia.app_id}-dsn.algolia.net`} crossorigin />
54
53
 
55
54
  <title>{pageTitle}</title>
56
55
 
@@ -48,7 +48,7 @@ const { layout, title } = Astro.props
48
48
  </a>
49
49
 
50
50
  <div class="d-flex">
51
- <div class="cxd-search" id="docsearch" data-cxd-docs-version={getConfig().docs_version}></div>
51
+ <div class="cxd-search" id="docsearch"></div>
52
52
 
53
53
  <button
54
54
  class="navbar-toggler d-flex d-large-none order-3 p-xsmall"
@@ -81,12 +81,12 @@ const { layout, title } = Astro.props
81
81
  <div class="offcanvas-body p-large pt-0 p-large-0">
82
82
  <hr class="d-large-none text-white-50" />
83
83
  <ul class="navbar-nav flex-row flex-wrap cxd-navbar-nav mx-0 mx-large-medium">
84
- <NavLink active={layout === 'docs'} href="/docs" track>Docs</NavLink>
85
- <NavLink active={title === 'Tokens'} href="/tokens" track>Tokens</NavLink>
86
- <NavLink active={title === 'Assets'} href="/assets" track>Assets</NavLink>
87
- <NavLink active={title === 'Figma'} href="/figma" track>Figma</NavLink>
88
- <NavLink active={layout === 'icons'} href="/icons" track>Icons</NavLink>
89
- <NavLink active={title === 'CSS'} href="/css" track>CSS</NavLink>
84
+ <NavLink active={layout === 'docs'} href="/docs">Docs</NavLink>
85
+ <NavLink active={title === 'Tokens'} href="/tokens">Tokens</NavLink>
86
+ <NavLink active={title === 'Assets'} href="/assets">Assets</NavLink>
87
+ <NavLink active={title === 'Figma'} href="/figma">Figma</NavLink>
88
+ <NavLink active={layout === 'icons'} href="/icons">Icons</NavLink>
89
+ <NavLink active={title === 'CSS'} href="/css">CSS</NavLink>
90
90
  <li class="nav-item dropdown ms-medium">
91
91
  <a
92
92
  class="nav-link dropdown-toggle"
@@ -1,29 +1,53 @@
1
1
  // stylelint-disable selector-class-pattern
2
2
 
3
3
  :root {
4
- --docsearch-primary-color: var(--cxd-subtle);
5
- --docsearch-logo-color: var(--cxd-subtle);
4
+ --docsearch-primary-color: var(--cx-primary);
5
+ --docsearch-text-color: var(--cx-fg-main);
6
+ --docsearch-spacing: var(--cx-space-medium);
7
+ // --docsearch-icon-stroke-width: 1.4;
8
+ --docsearch-highlight-color: var(--cx-primary);
9
+ --docsearch-muted-color: var(--cx-fg-subtle);
10
+ --docsearch-container-background: var(--cx-black-dim-main);
11
+ --docsearch-logo-color: var(--cx-primary);
12
+ // --docsearch-modal-width: 560px;
13
+ // --docsearch-modal-height: 600px;
14
+ --docsearch-modal-background: var(--cx-bg-even);
15
+ --docsearch-modal-shadow: var(--cx-box-shadow-large); // inset 1px 1px 0 0 #2c2e40, 0 3px 8px 0 #000309;
16
+ // --docsearch-searchbox-height: 56px;
17
+ --docsearch-searchbox-background: var(--cx-bg-main);
18
+ --docsearch-searchbox-focus-background: var(--cx-bg-hover);
19
+ // --docsearch-searchbox-shadow: inset 0 0 0 2px var(--docsearch-primary-color);
20
+ // --docsearch-hit-height: 56px;
21
+ --docsearch-hit-color: var(--cx-fg-main);
22
+ --docsearch-hit-active-color: var(--cx-primary-fg-solid);
23
+ --docsearch-hit-background: var(--cx-bg-main);
24
+ --docsearch-hit-shadow: none;
25
+ // --docsearch-key-gradient: linear-gradient(-26.5deg, #565872, #31355b);
26
+ // --docsearch-key-shadow: inset 0 -2px 0 0 #282d55, inset 0 0 1px 1px #51577d, 0 2px 2px 0 rgba(3, 4, 9, .3);
27
+ // --docsearch-key-pressed-shadow: inset 0 -2px 0 0 #cdcde6, inset 0 0 1px 1px #fff, 0 1px 1px 0 rgba(30, 35, 90, .4);
28
+ // --docsearch-footer-height: 44px;
29
+ --docsearch-footer-background: var(--cx-bg-evident);
30
+ --docsearch-footer-shadow: none; // inset 0 1px 0 0 rgba(73, 76, 106, .5), 0 -4px 8px 0 rgba(0, 0, 0, .2);
6
31
  }
7
32
 
8
33
  @include color-mode(dark, true) {
9
34
  // From here, the values are copied from https://cdn.jsdelivr.net/npm/@docsearch/css@3
10
35
  // in html[data-theme="dark"] selector
11
36
  // and are slightly modified for formatting purpose
12
- --docsearch-text-color: var(--cx-fg-main);
13
- --docsearch-container-background: rgba(9, 10, 17, .8);
14
- --docsearch-modal-background: #15172a;
15
- --docsearch-modal-shadow: inset 1px 1px 0 0 #2c2e40, 0 3px 8px 0 #000309;
16
- --docsearch-searchbox-background: var(--cx-bg-main, #fc0);
17
- --docsearch-searchbox-focus-background:
18
- var(--cx-bg-hover, #fc0)
19
- --docsearch-hit-color: #bec3c9;
20
- --docsearch-hit-shadow: none;
21
- --docsearch-hit-background: #090a11;
22
- --docsearch-key-gradient: linear-gradient(-26.5deg, #565872, #31355b);
23
- --docsearch-key-shadow: inset 0 -2px 0 0 #282d55, inset 0 0 1px 1px #51577d, 0 2px 2px 0 rgba(3, 4, 9, .3);
24
- --docsearch-footer-background: #1e2136;
25
- --docsearch-footer-shadow: inset 0 1px 0 0 rgba(73, 76, 106, .5), 0 -4px 8px 0 rgba(0, 0, 0, .2);
26
- --docsearch-muted-color: #7f8497;
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;
27
51
  }
28
52
 
29
53
  .cxd-search {
@@ -149,7 +173,7 @@
149
173
 
150
174
  a {
151
175
  @include border-radius(0);
152
- border: solid var(--cx-border-color);
176
+ border: solid var(--cx-border-subtle);
153
177
  border-width: 0 1px 1px;
154
178
  }
155
179
 
@@ -12,6 +12,7 @@ $enable-cssgrid: true !default;
12
12
  $enable-dark-mode: true !default;
13
13
  $enable-deprecation-messages: true !default;
14
14
  $enable-elevation-shadows: true !default;
15
+ $enable-exclude-strokes: true !default;
15
16
  $enable-grid-classes: true !default;
16
17
  $enable-important-utilities: true !default;
17
18
  $enable-negative-margins: true !default;