@chassis-ui/docs 0.7.0 → 0.8.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.
@@ -26,9 +26,12 @@ const { layout } = Astro.props
26
26
  data-cx-placement="bottom-end"
27
27
  >
28
28
  <Icon name="circle-half-solid" class="theme-icon-active" />
29
- <span class=`${layout === 'examples' ? 'visually-hidden' : 'lg:d-none ms-xs'}` id="cxd-theme-text"
30
- >Toggle theme</span
29
+ <span
30
+ class=`${layout === 'examples' ? 'visually-hidden' : 'lg:d-none ms-xs'}`
31
+ id="cxd-theme-text"
31
32
  >
33
+ Toggle theme
34
+ </span>
32
35
  </button>
33
36
  <ul class="menu" role="menu" aria-label="Theme options">
34
37
  <li>
@@ -13,19 +13,17 @@ interface Props {
13
13
  const { attr } = Astro.props
14
14
  ---
15
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
- ) : (
16
+ {attr ? (
17
+ <figure>
27
18
  <blockquote class="blockquote">
28
19
  <slot />
29
20
  </blockquote>
30
- )
31
- }
21
+ <figcaption class="attribution">
22
+ <Fragment set:html={attr} />
23
+ </figcaption>
24
+ </figure>
25
+ ) : (
26
+ <blockquote class="blockquote">
27
+ <slot />
28
+ </blockquote>
29
+ )}
@@ -15,6 +15,6 @@ const { tooltip = 'This feature is only available in CSS and not in Figma compon
15
15
  Astro.props
16
16
  ---
17
17
 
18
- <span class="badge lg info smooth mb-md rounded-md" data-cx-toggle="tooltip" title={tooltip}
19
- >CSS Only</span
20
- >
18
+ <span class="badge lg info smooth mb-md rounded-md" data-cx-toggle="tooltip" title={tooltip}>
19
+ CSS Only
20
+ </span>
@@ -164,103 +164,86 @@ if (codeToDisplay && detectedLang) {
164
164
  })
165
165
  </script>
166
166
 
167
- {
168
- nestedInExample && !noToolbar && (
169
- <div class="cxd-snippet-toolbar">
170
- {file ? (
171
- <a
172
- class="text-decoration-none font-code fg-subtle text-uppercase"
173
- href={fileUrl}
174
- target="_blank"
175
- rel="noopener noreferrer"
176
- >
177
- {file}
178
- </a>
179
- ) : (
180
- <small class="font-code fg-subtle text-uppercase">{displayLang}</small>
167
+ {nestedInExample && !noToolbar && (
168
+ <div class="cxd-snippet-toolbar">
169
+ {file ? (
170
+ <a
171
+ class="text-decoration-none font-code fg-subtle text-uppercase"
172
+ href={fileUrl}
173
+ target="_blank"
174
+ rel="noopener noreferrer"
175
+ >
176
+ {file}
177
+ </a>
178
+ ) : (
179
+ <small class="font-code fg-subtle text-uppercase">{displayLang}</small>
180
+ )}
181
+ <div class="d-flex ms-auto gap-2xs">
182
+ {hasPreview && (
183
+ <>
184
+ <button
185
+ type="button"
186
+ class="button-mode"
187
+ title="Toggle color mode"
188
+ aria-label="Toggle color mode"
189
+ onclick="toggleTheme(this)"
190
+ >
191
+ <Icon name="swatchbook-solid" />
192
+ </button>
193
+ <span class="vr mx-2xs" />
194
+ <button
195
+ type="button"
196
+ class="button-edit"
197
+ title="Try it on StackBlitz"
198
+ aria-label="Try it on StackBlitz"
199
+ data-sb-js-snippet={addStackblitzJs ? true : undefined}
200
+ >
201
+ <Icon name="lightning-solid" />
202
+ </button>
203
+ </>
181
204
  )}
182
- <div class="d-flex ms-auto gap-2xs">
183
- {hasPreview && (
184
- <>
185
- <button
186
- type="button"
187
- class="button-mode"
188
- title="Toggle color mode"
189
- aria-label="Toggle color mode"
190
- onclick="toggleTheme(this)"
191
- >
192
- <Icon name="swatchbook-solid" />
193
- </button>
194
- <span class="vr mx-2xs" />
195
- <button
196
- type="button"
197
- class="button-edit"
198
- title="Try it on StackBlitz"
199
- aria-label="Try it on StackBlitz"
200
- data-sb-js-snippet={addStackblitzJs ? true : undefined}
201
- >
202
- <Icon name="lightning-solid" />
203
- </button>
204
- </>
205
- )}
206
- <button
207
- type="button"
208
- class="button-clipboard"
209
- title="Copy to clipboard"
210
- aria-label="Copy to clipboard"
211
- >
212
- <Icon name="clipboard-outline" />
213
- </button>
214
- </div>
205
+ <button
206
+ type="button"
207
+ class="button-clipboard"
208
+ title="Copy to clipboard"
209
+ aria-label="Copy to clipboard"
210
+ >
211
+ <Icon name="clipboard-outline" />
212
+ </button>
215
213
  </div>
216
- )
217
- }
214
+ </div>
215
+ )}
218
216
 
219
- {
220
- nestedInExample ? (
221
- <>
222
- {highlightedCode ? (
223
- <div class:list={['cxd-code', { 'line-numbers': lineNumbers }]}>
224
- <Fragment set:html={highlightedCode} />
225
- </div>
226
- ) : (
227
- <div class:list={['cxd-code', { 'line-numbers': lineNumbers }]}>
228
- {/* prettier-ignore */}
229
- <pre class={className} tabindex="0"><slot /></pre>
230
- </div>
231
- )}
232
- </>
233
- ) : (
234
- <div class:list={['cxd-code-snippet', containerClass]} data-pagefind-ignore>
235
- {!noToolbar && (
236
- <div class="cxd-snippet-toolbar">
237
- {file ? (
238
- <a
239
- class="text-decoration-none font-code fg-subtle"
240
- href={fileUrl}
241
- target="_blank"
242
- rel="noopener noreferrer"
243
- >
244
- {file}
245
- </a>
246
- ) : (
247
- <small class="font-code fg-subtle text-uppercase">{displayLang}</small>
248
- )}
249
- <div class="d-flex ms-auto gap-2xs">
250
- <button
251
- type="button"
252
- class="button-clipboard"
253
- title="Copy to clipboard"
254
- aria-label="Copy to clipboard"
255
- >
256
- <Icon name="clipboard-outline" />
257
- </button>
258
- </div>
259
- </div>
260
- )}
261
- <slot name="pre" />
262
- {!Astro.slots.has('pre') && noToolbar ? (
263
- <div class="cxd-clipboard">
217
+ {nestedInExample ? (
218
+ <>
219
+ {highlightedCode ? (
220
+ <div class:list={['cxd-code', { 'line-numbers': lineNumbers }]}>
221
+ <Fragment set:html={highlightedCode} />
222
+ </div>
223
+ ) : (
224
+ <div class:list={['cxd-code', { 'line-numbers': lineNumbers }]}>
225
+ {/* prettier-ignore */}
226
+ <pre class={className} tabindex="0"><slot /></pre>
227
+ </div>
228
+ )}
229
+ </>
230
+ ) : (
231
+ <div class:list={['cxd-code-snippet', containerClass]} data-pagefind-ignore>
232
+ {!noToolbar && (
233
+ <div class="cxd-snippet-toolbar">
234
+ {file ? (
235
+ <a
236
+ class="text-decoration-none font-code fg-subtle"
237
+ href={fileUrl}
238
+ target="_blank"
239
+ rel="noopener noreferrer"
240
+ >
241
+ {file}
242
+ </a>
243
+ ) : (
244
+ <small class="font-code fg-subtle text-uppercase">{displayLang}</small>
245
+ )}
246
+ <div class="d-flex ms-auto gap-2xs">
264
247
  <button
265
248
  type="button"
266
249
  class="button-clipboard"
@@ -270,18 +253,31 @@ if (codeToDisplay && detectedLang) {
270
253
  <Icon name="clipboard-outline" />
271
254
  </button>
272
255
  </div>
273
- ) : null}
256
+ </div>
257
+ )}
258
+ <slot name="pre" />
259
+ {!Astro.slots.has('pre') && noToolbar ? (
260
+ <div class="cxd-clipboard">
261
+ <button
262
+ type="button"
263
+ class="button-clipboard"
264
+ title="Copy to clipboard"
265
+ aria-label="Copy to clipboard"
266
+ >
267
+ <Icon name="clipboard-outline" />
268
+ </button>
269
+ </div>
270
+ ) : null}
274
271
 
275
- {highlightedCode ? (
276
- <div class:list={['cxd-code', { 'line-numbers': lineNumbers }]}>
277
- <Fragment set:html={highlightedCode} />
278
- </div>
279
- ) : (
280
- <div class:list={['cxd-code', { 'line-numbers': lineNumbers }]}>
281
- {/* prettier-ignore */}
282
- <pre class={className} tabindex="0"><slot /></pre>
283
- </div>
284
- )}
285
- </div>
286
- )
287
- }
272
+ {highlightedCode ? (
273
+ <div class:list={['cxd-code', { 'line-numbers': lineNumbers }]}>
274
+ <Fragment set:html={highlightedCode} />
275
+ </div>
276
+ ) : (
277
+ <div class:list={['cxd-code', { 'line-numbers': lineNumbers }]}>
278
+ {/* prettier-ignore */}
279
+ <pre class={className} tabindex="0"><slot /></pre>
280
+ </div>
281
+ )}
282
+ </div>
283
+ )}
@@ -13,6 +13,4 @@ interface Props {
13
13
  const { version } = Astro.props
14
14
  ---
15
15
 
16
- <span class="badge lg warning smooth mb-md rounded-md">
17
- Deprecated in v{version}
18
- </span>
16
+ <span class="badge lg warning smooth mb-md rounded-md">Deprecated in v{version}</span>
@@ -97,37 +97,33 @@ const simplifiedMarkup = sourceMarkup
97
97
  ---
98
98
 
99
99
  <div class="cxd-example-snippet cxd-code-snippet not-prose" data-pagefind-ignore>
100
- {
101
- showPreview && (
102
- <div id={id} class:list={['cxd-example m-0 border-0 context', className]}>
103
- {!showMarkup && (
104
- <div class="cxd-mode">
105
- <button
106
- type="button"
107
- class="button-mode"
108
- title="Toggle color mode"
109
- aria-label="Toggle color mode"
110
- onclick="toggleTheme(this)"
111
- >
112
- <Icon name="swatchbook-solid" />
113
- </button>
114
- </div>
115
- )}
116
- <Fragment set:html={markup} />
117
- </div>
118
- )
119
- }
120
- {
121
- showMarkup && (
122
- <Code
123
- code={simplifiedMarkup}
124
- lang={lang}
125
- file={file}
126
- lineNumbers={lineNumbers}
127
- nestedInExample={true}
128
- addStackblitzJs={addStackblitzJs}
129
- hasPreview={showPreview}
130
- />
131
- )
132
- }
100
+ {showPreview && (
101
+ <div id={id} class:list={['cxd-example m-0 border-0 context', className]}>
102
+ {!showMarkup && (
103
+ <div class="cxd-mode">
104
+ <button
105
+ type="button"
106
+ class="button-mode"
107
+ title="Toggle color mode"
108
+ aria-label="Toggle color mode"
109
+ onclick="toggleTheme(this)"
110
+ >
111
+ <Icon name="swatchbook-solid" />
112
+ </button>
113
+ </div>
114
+ )}
115
+ <Fragment set:html={markup} />
116
+ </div>
117
+ )}
118
+ {showMarkup && (
119
+ <Code
120
+ code={simplifiedMarkup}
121
+ lang={lang}
122
+ file={file}
123
+ lineNumbers={lineNumbers}
124
+ nestedInExample={true}
125
+ addStackblitzJs={addStackblitzJs}
126
+ hasPreview={showPreview}
127
+ />
128
+ )}
133
129
  </div>
@@ -36,24 +36,22 @@ const {
36
36
  } = Astro.props
37
37
  ---
38
38
 
39
- {
40
- font ? (
41
- <span
42
- class:list={['icon', `cx-${name}`, className]}
43
- aria-hidden={title ? undefined : 'true'}
44
- aria-label={title}
45
- {...rest}
46
- />
47
- ) : (
48
- <svg
49
- class:list={['icon', className]}
50
- width={size}
51
- height={size}
52
- aria-hidden={title ? undefined : 'true'}
53
- {...rest}
54
- >
55
- {title && <title>{title}</title>}
56
- <use href={`${sprite}#${name}`} />
57
- </svg>
58
- )
59
- }
39
+ {font ? (
40
+ <span
41
+ class:list={['icon', `cx-${name}`, className]}
42
+ aria-hidden={title ? undefined : 'true'}
43
+ aria-label={title}
44
+ {...rest}
45
+ />
46
+ ) : (
47
+ <svg
48
+ class:list={['icon', className]}
49
+ width={size}
50
+ height={size}
51
+ aria-hidden={title ? undefined : 'true'}
52
+ {...rest}
53
+ >
54
+ {title && <title>{title}</title>}
55
+ <use href={`${sprite}#${name}`} />
56
+ </svg>
57
+ )}
@@ -19,6 +19,6 @@ const tooltipText =
19
19
  `This variant${plural ? 's' : ''} exist${plural ? '' : 's'} in the Figma component library with bound design tokens.`
20
20
  ---
21
21
 
22
- <span class="badge lg primary smooth mb-md rounded-md" data-cx-toggle="tooltip" title={tooltipText}
23
- >In Figma</span
24
- >
22
+ <span class="badge lg primary smooth mb-md rounded-md" data-cx-toggle="tooltip" title={tooltipText}>
23
+ In Figma
24
+ </span>
@@ -10,19 +10,17 @@ const {
10
10
  } = getPlaceholder(Astro.props)
11
11
  ---
12
12
 
13
- {
14
- type === 'img' ? (
15
- // eslint-disable-next-line astro/jsx-a11y/alt-text
16
- <img {...props} />
17
- ) : (
18
- <svg {...props}>
19
- {showTitle && <title>{title}</title>}
20
- <rect width="100%" height="100%" fill={background} />
21
- {showText && (
22
- <text x="50%" y="50%" fill={color} dy=".3em">
23
- {text}
24
- </text>
25
- )}
26
- </svg>
27
- )
28
- }
13
+ {type === 'img' ? (
14
+ // eslint-disable-next-line astro/jsx-a11y/alt-text
15
+ <img {...props} />
16
+ ) : (
17
+ <svg {...props}>
18
+ {showTitle && <title>{title}</title>}
19
+ <rect width="100%" height="100%" fill={background} />
20
+ {showText && (
21
+ <text x="50%" y="50%" fill={color} dy=".3em">
22
+ {text}
23
+ </text>
24
+ )}
25
+ </svg>
26
+ )}
@@ -119,9 +119,7 @@ const simplifiedMarkup = sourceMarkup
119
119
  <Fragment set:html={previewMarkup} />
120
120
  </div>
121
121
  </div>
122
- {
123
- showMarkup && (
124
- <Code code={simplifiedMarkup} lang="html" nestedInExample={true} lineNumbers={lineNumbers} />
125
- )
126
- }
122
+ {showMarkup && (
123
+ <Code code={simplifiedMarkup} lang="html" nestedInExample={true} lineNumbers={lineNumbers} />
124
+ )}
127
125
  </div>
@@ -81,15 +81,13 @@ const mainProps = { id: 'content', ...overrides?.main }
81
81
  <body {...bodyProps}>
82
82
  <Header layout={layout} title={title} />
83
83
 
84
- {
85
- Astro.slots.has('main') ? (
86
- <slot name="main" />
87
- ) : (
88
- <main {...mainProps}>
89
- <slot />
90
- </main>
91
- )
92
- }
84
+ {Astro.slots.has('main') ? (
85
+ <slot name="main" />
86
+ ) : (
87
+ <main {...mainProps}>
88
+ <slot />
89
+ </main>
90
+ )}
93
91
 
94
92
  <Footer />
95
93
  <Consent />
@@ -98,17 +96,13 @@ const mainProps = { id: 'content', ...overrides?.main }
98
96
  <slot name="scripts" slot="scripts" />
99
97
  </Scripts>
100
98
 
101
- {
102
- frontmatter?.extraJs &&
103
- frontmatter.extraJs.map((js: ExtraJS) => <script is:inline async={js.async} src={js.src} />)
104
- }
99
+ {frontmatter?.extraJs &&
100
+ frontmatter.extraJs.map((js: ExtraJS) => <script is:inline async={js.async} src={js.src} />)}
105
101
 
106
- {
107
- (layout === 'docs' || layout === 'icons') && (
108
- <div class="position-fixed" aria-hidden="true">
109
- <input type="text" tabindex="-1" />
110
- </div>
111
- )
112
- }
102
+ {(layout === 'docs' || layout === 'icons') && (
103
+ <div class="position-fixed" aria-hidden="true">
104
+ <input type="text" tabindex="-1" />
105
+ </div>
106
+ )}
113
107
  </body>
114
108
  </html>
@@ -61,13 +61,16 @@ if (frontmatter.toc) {
61
61
  aria-labelledby="cxdSidebarOffcanvasLabel"
62
62
  >
63
63
  <div class="drawer-header">
64
- <h2 class="drawer-title" id="cxdSidebarOffcanvasLabel">Browse docs</h2>
64
+ <h2 class="drawer-title" id="cxdSidebarOffcanvasLabel">
65
+ Browse docs
66
+ </h2>
65
67
  <button
66
68
  type="button"
67
69
  class="close-button"
68
70
  data-cx-dismiss="drawer"
69
71
  aria-label="Close"
70
- data-cx-target="#cxdSidebar"></button>
72
+ data-cx-target="#cxdSidebar"
73
+ ></button>
71
74
  </div>
72
75
  <hr class="lg:d-none m-0" />
73
76
  <div class="drawer-body lg:p-0">
@@ -104,65 +107,61 @@ if (frontmatter.toc) {
104
107
  View on GitHub
105
108
  </a>
106
109
  </div>
107
- <h1 class="cxd-title mb-sm" id="content">{frontmatter.title}</h1>
110
+ <h1 class="cxd-title mb-sm" id="content">
111
+ {frontmatter.title}
112
+ </h1>
108
113
  </div>
109
114
  <div class="cxd-subtitle">
110
- {
111
- frontmatter.description && (
112
- <Fragment set:html={processMarkdownToHtml(frontmatter.description)} />
113
- )
114
- }
115
+ {frontmatter.description && (
116
+ <Fragment set:html={processMarkdownToHtml(frontmatter.description)} />
117
+ )}
115
118
  </div>
116
119
  </slot>
117
120
  </div>
118
121
 
119
- {
120
- frontmatter.toc && headings && (
121
- <div class="cxd-toc">
122
- <button
123
- class="button default mb-lg text-decoration-none cxd-toc-toggle md:d-none"
124
- type="button"
125
- data-cx-toggle="collapse"
126
- data-cx-target="#tocContents"
127
- aria-expanded="false"
128
- aria-controls="tocContents"
129
- >
130
- On this page
131
- <Icon name="chevron-sort-solid" class="icon-sm" />
132
- </button>
133
- <strong class="d-none md:d-block h6 my-xs">On this page</strong>
134
- <hr class="d-none md:d-block my-xs" />
135
- <div class="collapse cxd-toc-collapse" id="tocContents">
136
- <nav id="TableOfContents" aria-label="Table of contents">
137
- <slot name="toc">
138
- <TableOfContents headings={headings} config={getConfig()} />
139
- </slot>
140
- </nav>
141
- </div>
122
+ {frontmatter.toc && headings && (
123
+ <div class="cxd-toc">
124
+ <button
125
+ class="button default mb-lg text-decoration-none cxd-toc-toggle md:d-none"
126
+ type="button"
127
+ data-cx-toggle="collapse"
128
+ data-cx-target="#tocContents"
129
+ aria-expanded="false"
130
+ aria-controls="tocContents"
131
+ >
132
+ On this page
133
+ <Icon name="chevron-sort-solid" class="icon-sm" />
134
+ </button>
135
+ <strong class="d-none md:d-block h6 my-xs">On this page</strong>
136
+ <hr class="d-none md:d-block my-xs" />
137
+ <div class="collapse cxd-toc-collapse" id="tocContents">
138
+ <nav id="TableOfContents" aria-label="Table of contents">
139
+ <slot name="toc">
140
+ <TableOfContents headings={headings} config={getConfig()} />
141
+ </slot>
142
+ </nav>
142
143
  </div>
143
- )
144
- }
144
+ </div>
145
+ )}
145
146
 
146
147
  <div class="cxd-content">
147
- {
148
- frontmatter.sections && (
149
- <div class="grid grid-cols-1 md:grid-cols-2 gap-xl">
150
- {frontmatter.sections.map((section: DocSection) => (
151
- <div>
152
- <a
153
- class="d-block text-decoration-none"
154
- href={getDocsPath(
155
- `${parentDirectory ? parentDirectory + '/' : ''}${section.slug ? section.slug : getSlug(section.title)}/`
156
- )}
157
- >
158
- <strong class="d-block h5 mb-2xs">{section.title}</strong>
159
- <span class="fg-subtle">{section.description}</span>
160
- </a>
161
- </div>
162
- ))}
163
- </div>
164
- )
165
- }
148
+ {frontmatter.sections && (
149
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-xl">
150
+ {frontmatter.sections.map((section: DocSection) => (
151
+ <div>
152
+ <a
153
+ class="d-block text-decoration-none"
154
+ href={getDocsPath(
155
+ `${parentDirectory ? parentDirectory + '/' : ''}${section.slug ? section.slug : getSlug(section.title)}/`
156
+ )}
157
+ >
158
+ <strong class="d-block h5 mb-2xs">{section.title}</strong>
159
+ <span class="fg-subtle">{section.description}</span>
160
+ </a>
161
+ </div>
162
+ ))}
163
+ </div>
164
+ )}
166
165
 
167
166
  <slot />
168
167
  </div>