@chassis-ui/docs 0.1.10 → 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.
Files changed (79) hide show
  1. package/README.md +16 -16
  2. package/index.ts +6 -1
  3. package/package.json +20 -8
  4. package/src/components/DocsSidebar.astro +63 -23
  5. package/src/components/FeatureCard.astro +8 -8
  6. package/src/components/NavLink.astro +1 -1
  7. package/src/components/TableOfContents.astro +8 -7
  8. package/src/components/ThemeToggler.astro +16 -37
  9. package/src/components/shortcodes/Blockquote.astro +31 -0
  10. package/src/components/shortcodes/CSSOnly.astro +22 -0
  11. package/src/components/shortcodes/Callout.astro +6 -2
  12. package/src/components/shortcodes/Code.astro +289 -0
  13. package/src/components/shortcodes/DeprecatedIn.astro +18 -0
  14. package/src/components/shortcodes/Example.astro +132 -0
  15. package/src/components/shortcodes/Icon.astro +57 -0
  16. package/src/components/shortcodes/InFigma.astro +26 -0
  17. package/src/components/shortcodes/JsDocs.astro +64 -0
  18. package/src/components/shortcodes/Placeholder.astro +28 -0
  19. package/src/components/shortcodes/ResizableExample.astro +126 -0
  20. package/src/components/shortcodes/ScssDocs.astro +108 -0
  21. package/src/components/shortcodes/ScssDocsSimple.astro +66 -0
  22. package/src/js/color-modes.js +3 -3
  23. package/src/js/example-mode.js +75 -0
  24. package/src/js/search.js +501 -39
  25. package/src/js/theme-color.js +1 -1
  26. package/src/layouts/DocsLayout.astro +18 -21
  27. package/src/layouts/RedirectLayout.astro +1 -0
  28. package/src/layouts/SingleLayout.astro +3 -3
  29. package/src/layouts/footer/Footer.astro +5 -5
  30. package/src/layouts/footer/Scripts.astro +14 -7
  31. package/src/layouts/head/Analytics.astro +12 -6
  32. package/src/layouts/head/Favicons.astro +0 -2
  33. package/src/layouts/head/Head.astro +2 -7
  34. package/src/layouts/head/Stylesheet.astro +18 -11
  35. package/src/layouts/header/Header.astro +2 -5
  36. package/src/layouts/header/Navigation.astro +40 -42
  37. package/src/layouts/header/SearchDialog.astro +74 -0
  38. package/src/layouts/header/SearchTrigger.astro +41 -0
  39. package/src/layouts/header/Skippy.astro +1 -1
  40. package/src/libs/highlight.ts +91 -0
  41. package/src/libs/icon.ts +75 -0
  42. package/src/libs/image.ts +12 -1
  43. package/src/libs/layout.ts +18 -0
  44. package/src/libs/markdown.ts +128 -0
  45. package/src/libs/placeholder.ts +250 -0
  46. package/src/libs/rehype.ts +0 -17
  47. package/src/libs/shortcodes.ts +129 -0
  48. package/src/libs/site.ts +95 -0
  49. package/src/libs/toc.ts +40 -6
  50. package/src/libs/utils.ts +34 -82
  51. package/src/libs/vite.ts +45 -0
  52. package/src/scss/_anchor.scss +20 -16
  53. package/src/scss/_callouts.scss +29 -28
  54. package/src/scss/_content.scss +72 -103
  55. package/src/scss/_footer.scss +18 -19
  56. package/src/scss/_layout.scss +56 -61
  57. package/src/scss/_navbar.scss +19 -126
  58. package/src/scss/_placeholder-img.scss +11 -7
  59. package/src/scss/_scrolling.scss +14 -12
  60. package/src/scss/_search.scss +418 -0
  61. package/src/scss/_shiki.scss +120 -0
  62. package/src/scss/_sidebar.scss +137 -132
  63. package/src/scss/_skippy.scss +6 -4
  64. package/src/scss/_snippets.scss +181 -0
  65. package/src/scss/_toc.scss +97 -93
  66. package/src/scss/_vars.scss +89 -0
  67. package/src/scss/main.scss +75 -81
  68. package/src/js/icon-loader.js +0 -229
  69. package/src/libs/chassis.ts +0 -38
  70. package/src/scss/_brand.scss +0 -59
  71. package/src/scss/_buttons.scss +0 -33
  72. package/src/scss/_clipboard-js.scss +0 -63
  73. package/src/scss/_code.scss +0 -116
  74. package/src/scss/_colors.scss +0 -140
  75. package/src/scss/_docsearch.scss +0 -212
  76. package/src/scss/_masthead.scss +0 -124
  77. package/src/scss/_settings.scss +0 -29
  78. package/src/scss/_syntax.scss +0 -160
  79. package/src/scss/_variables.scss +0 -78
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
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![Version: 0.1.10](https://img.shields.io/badge/Version-0.1.10-blue.svg)](https://www.npmjs.com/package/@chassis-ui/docs) [![npm](https://img.shields.io/npm/v/@chassis-ui/docs.svg)](https://www.npmjs.com/package/@chassis-ui/docs)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![Version: 0.3.0](https://img.shields.io/badge/Version-0.3.0-blue.svg)](https://www.npmjs.com/package/@chassis-ui/docs) [![npm](https://img.shields.io/npm/v/@chassis-ui/docs.svg)](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 | Contents |
57
- | --- | --- |
58
- | `@chassis-ui/docs` | Library functions: `chassis`, `image`, `layout`, `rehype`, `toc`, `utils` |
59
- | `@chassis-ui/docs/layouts/*` | `BaseLayout`, `DocsLayout`, `RedirectLayout`, `SingleLayout` |
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/*` | Direct access to individual library modules |
63
- | `@chassis-ui/docs/js/*` | Client-side scripts |
64
- | `@chassis-ui/docs/scss/*` | SCSS utilities and partials |
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 | Description |
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) | 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 |
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/chassis'
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.1.10",
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
- "astro": "^5.0.0"
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
- "@types/mdast": "^4.0.4",
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
- "zod": "^4.3.6"
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
- <ul class="cxd-links-nav bulletless">
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
- <svg
33
- class="icon"
33
+ <Icon
34
+ name={group.icon}
34
35
  style={group.icon_color && `color: var(--cx-${group.icon_color});`}
35
- aria-hidden="true"
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((page) => {
44
- const docSlug = getSlug(page.title)
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 '${page.title}' referenced in 'data/sidebar.yml' does not exist at '${url}'.`
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
- {page.title}
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
- <li class="cxd-links-span-all">
81
- <a
82
- href={`${getConfig().docsPath}/${groupSlug}/`}
83
- class:list={['cxd-links-link', { active }]}
84
- aria-current={active ? 'page' : undefined}
85
- >
86
- {group.title}
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
- </ul>
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
@@ -26,7 +28,7 @@ const hasContent = Astro.slots.has('default')
26
28
  // Build class strings
27
29
  const cardClasses = [
28
30
  'feature-item bg-even d-flex flex-column rounded-large',
29
- 'p-medium p-large-xlarge gap-medium gap-medium-xlarge',
31
+ 'p-medium large:p-xlarge gap-medium medium:gap-xlarge',
30
32
  horizontal ? '' : 'h-100',
31
33
  classes
32
34
  ]
@@ -35,8 +37,8 @@ const cardClasses = [
35
37
 
36
38
  const headerClasses = [
37
39
  'feature-header d-flex',
38
- 'gap-medium gap-medium-xlarge',
39
- horizontal ? 'flex-column flex-medium-row' : 'flex-column'
40
+ 'gap-medium medium:gap-xlarge',
41
+ horizontal ? 'flex-column medium:flex-row' : 'flex-column'
40
42
  ].join(' ')
41
43
  ---
42
44
 
@@ -45,17 +47,15 @@ const headerClasses = [
45
47
  {
46
48
  icon && (
47
49
  <div class="feature-thumb">
48
- <svg class="icon feature-icon icon-3xlarge icon-medium-4xlarge" aria-hidden="true">
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
  }
54
54
  <div>
55
- <h3 class="feature-title font-large font-medium-xlarge mb-3xsmall mb-medium-2xsmall">
55
+ <h3 class="feature-title font-large medium:font-xlarge mb-3xsmall medium:mb-2xsmall">
56
56
  <slot name="title" />
57
57
  </h3>
58
- <p class="feature-body font-medium-large mb-0">
58
+ <p class="feature-body medium:font-large mb-0">
59
59
  <slot name="body" />
60
60
  </p>
61
61
  </div>
@@ -21,7 +21,7 @@ interface Props {
21
21
  const { active, class: className, ...props } = Astro.props
22
22
  ---
23
23
 
24
- <li class="nav-item col-6 col-large-auto">
24
+ <li class="nav-item col-6 large:col-auto">
25
25
  <a
26
26
  aria-current={active ? true : undefined}
27
27
  class:list={['nav-link', className, { active }]}
@@ -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 generation configuration */
19
- config?: any
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=`nav-link dropdown-toggle`
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="dropdown"
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
- <svg class="icon theme-icon-active" aria-hidden="true"><use href="#circle-half-solid"></use></svg>
28
+ <Icon name="circle-half-solid" class="theme-icon-active" />
28
29
  <span
29
- class=`${layout === 'examples' ? 'visually-hidden' : 'd-large-none ms-xsmall'}`
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
- type="button"
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
- <svg class="icon ms-auto d-none" aria-hidden="true"><use href="#check-solid"></use></svg>
39
+ <Icon name="check-solid" class="menu-item-check" />
47
40
  </button>
48
41
  </li>
49
42
  <li>
50
- <button
51
- type="button"
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
- <svg class="icon ms-auto d-none" aria-hidden="true"><use href="#check-solid"></use></svg>
46
+ <Icon name="check-solid" class="menu-item-check" />
61
47
  </button>
62
48
  </li>
63
49
  <li>
64
- <button
65
- type="button"
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
- <svg class="icon ms-auto d-none" aria-hidden="true"><use href="#check-solid"></use></svg>
53
+ <Icon name="check-solid" class="menu-item-check" />
75
54
  </button>
76
55
  </li>
77
56
  </ul>
@@ -0,0 +1,31 @@
1
+ ---
2
+ /**
3
+ * Blockquote
4
+ *
5
+ * Render a blockquote with optional attribution.
6
+ */
7
+
8
+ interface Props {
9
+ /** Attribution text or HTML for the quote */
10
+ attr?: string
11
+ }
12
+
13
+ const { attr } = Astro.props
14
+ ---
15
+
16
+ {
17
+ attr ? (
18
+ <figure>
19
+ <blockquote class="blockquote">
20
+ <slot />
21
+ </blockquote>
22
+ <figcaption class="attribution">
23
+ <Fragment set:html={attr} />
24
+ </figcaption>
25
+ </figure>
26
+ ) : (
27
+ <blockquote class="blockquote">
28
+ <slot />
29
+ </blockquote>
30
+ )
31
+ }
@@ -0,0 +1,22 @@
1
+ ---
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.
7
+ */
8
+
9
+ interface Props {
10
+ /** Tooltip text shown on hover. */
11
+ tooltip?: string
12
+ }
13
+
14
+ const { tooltip = 'This feature is only available in CSS and not in Figma components.' } =
15
+ Astro.props
16
+ ---
17
+
18
+ <span
19
+ class="badge large info smooth mb-medium rounded-medium"
20
+ data-cx-toggle="tooltip"
21
+ title={tooltip}>CSS Only</span
22
+ >
@@ -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>