@rxova/astro-ui 0.6.1 → 0.7.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 (52) hide show
  1. package/README.md +14 -14
  2. package/package.json +11 -8
  3. package/src/components/BackLink.astro +4 -4
  4. package/src/components/CodeRecipes.astro +7 -7
  5. package/src/components/CopyButton.astro +20 -20
  6. package/src/components/CtaBand.astro +10 -10
  7. package/src/components/DataTable.astro +9 -9
  8. package/src/components/DocAccordionItem.astro +6 -6
  9. package/src/components/DocsMenu.astro +46 -0
  10. package/src/components/Header.astro +11 -11
  11. package/src/components/Icon.astro +9 -9
  12. package/src/components/ModeTabs.astro +7 -7
  13. package/src/components/PageHeader.astro +8 -8
  14. package/src/components/ProjectSwitcher.astro +10 -12
  15. package/src/components/ProofStats.astro +29 -29
  16. package/src/components/QuickStart.astro +3 -3
  17. package/src/components/ScreenshotGrid.astro +13 -13
  18. package/src/components/Section.astro +7 -7
  19. package/src/components/SectionNav.astro +8 -8
  20. package/src/components/ShowMore.astro +3 -3
  21. package/src/components/SiteFooter.astro +17 -17
  22. package/src/components/SizeTable.astro +7 -7
  23. package/src/components/ThemeScript.astro +12 -12
  24. package/src/components/ThemeToggle.astro +35 -35
  25. package/src/components/ValueGrid.astro +6 -6
  26. package/src/components/VisuallyHidden.astro +4 -4
  27. package/src/components/icons/Check.astro +3 -3
  28. package/src/components/icons/Collapse.astro +3 -3
  29. package/src/components/icons/Copy.astro +3 -3
  30. package/src/components/icons/Expand.astro +3 -3
  31. package/src/components/icons/Next.astro +3 -3
  32. package/src/components/icons/Pause.astro +3 -3
  33. package/src/components/icons/Play.astro +3 -3
  34. package/src/components/icons/Prev.astro +3 -3
  35. package/src/components/icons/Replay.astro +3 -3
  36. package/src/env.d.ts +3 -3
  37. package/src/lib/entries.ts +27 -27
  38. package/src/lib/icons.ts +7 -7
  39. package/src/scripts/show-more.ts +23 -23
  40. package/src/starlight/Footer.astro +4 -4
  41. package/src/starlight/Header.astro +75 -0
  42. package/src/starlight/MenuContent.astro +25 -0
  43. package/src/starlight/MobileMenuFooter.astro +9 -0
  44. package/src/starlight/SiteTitle.astro +5 -5
  45. package/src/starlight/SocialIcons.astro +4 -4
  46. package/src/starlight/ThemeSelect.astro +14 -14
  47. package/src/starlight/index.ts +34 -30
  48. package/src/styles/chrome.css +2 -2
  49. package/src/styles/document.css +1 -1
  50. package/src/styles/footer.css +1 -1
  51. package/src/styles/mermaid.css +2 -2
  52. package/src/styles/starlight.css +180 -45
@@ -3,7 +3,7 @@
3
3
  * Imported by `starlight.css` and `chrome.css`; uses `--rx-*` tokens only.
4
4
  */
5
5
 
6
- @import '@rxova/brand/tokens.css';
6
+ @import "@rxova/brand/tokens.css";
7
7
 
8
8
  .rx-footer {
9
9
  margin-top: 4rem;
@@ -65,11 +65,11 @@
65
65
  }
66
66
 
67
67
  /* Sequence-diagram participant boxes and lifelines. */
68
- .sl-markdown-content svg[aria-roledescription='sequence'] .actor {
68
+ .sl-markdown-content svg[aria-roledescription="sequence"] .actor {
69
69
  fill: var(--rx-card) !important;
70
70
  stroke: var(--rx-rule-strong) !important;
71
71
  }
72
72
 
73
- .sl-markdown-content svg[aria-roledescription='sequence'] .actor-line {
73
+ .sl-markdown-content svg[aria-roledescription="sequence"] .actor-line {
74
74
  stroke: var(--rx-rule-strong) !important;
75
75
  }
@@ -3,8 +3,8 @@
3
3
  * !important. One block covers both modes because every --rx-* neutral already flips.
4
4
  */
5
5
 
6
- @import '@rxova/brand/tokens.css';
7
- @import './footer.css';
6
+ @import "@rxova/brand/tokens.css";
7
+ @import "./footer.css";
8
8
 
9
9
  :root {
10
10
  /* Accent. */
@@ -108,7 +108,7 @@ header.header {
108
108
  }
109
109
 
110
110
  .rx-switcher__current::before {
111
- content: '';
111
+ content: "";
112
112
  display: inline-block;
113
113
  width: 0.5rem;
114
114
  height: 0.5rem;
@@ -117,7 +117,7 @@ header.header {
117
117
  background: var(--rx-gradient);
118
118
  }
119
119
 
120
- /* Umbrella navigation: the switcher and the rxova.org sections, beside the social icons. */
120
+ /* Umbrella navigation: the switcher and the rxova.dev sections, beside the social icons. */
121
121
  .rx-sections {
122
122
  display: flex;
123
123
  align-items: center;
@@ -135,63 +135,198 @@ header.header {
135
135
  color: var(--sl-color-white);
136
136
  }
137
137
 
138
- /* In the mobile menu the icons share a row with the theme picker; the navigation takes a row
139
- of its own above them. */
140
- .mobile-preferences .social-icons {
141
- flex-wrap: wrap;
138
+ /* --- Phone menu ----------------------------------------------------------- */
139
+
140
+ /* One row on phones: the mark and project, then search and the menu button. Every control is at
141
+ least 44px square, Starlight's menu button included. */
142
+ @media (max-width: 49.99rem) {
143
+ :root {
144
+ --sl-menu-button-size: 2.75rem;
145
+ }
146
+
147
+ /* Room for the menu button, which is fixed over the right edge like Starlight's. */
148
+ :root:not([data-has-sidebar]) header.header {
149
+ padding-inline-end: calc(var(--sl-nav-gap) + var(--sl-nav-pad-x) + var(--sl-menu-button-size));
150
+ }
151
+
152
+ site-search button[data-open-modal] {
153
+ min-width: 2.75rem;
154
+ min-height: 2.75rem;
155
+ justify-content: center;
156
+ }
142
157
  }
143
158
 
144
- .mobile-preferences .rx-sections {
145
- flex-basis: 100%;
159
+ /* Both menu buttons look like the site header's theme toggle, a quiet outlined square. Unlayered,
160
+ so they beat Starlight's `starlight.core` rules, light-theme ones included. */
161
+ .sl-menu-button,
162
+ .rx-menu__toggle {
163
+ place-items: center;
164
+ width: var(--sl-menu-button-size);
165
+ height: var(--sl-menu-button-size);
166
+ padding: 0;
167
+ border: 1px solid var(--rx-rule-strong);
168
+ border-radius: var(--rx-radius-sm);
169
+ background: var(--rx-bg);
170
+ color: var(--rx-fg);
171
+ box-shadow: none;
172
+ cursor: pointer;
146
173
  }
147
174
 
148
- /* In the phone menu the switcher sits at the left edge and at the bottom of the menu, so its
149
- list opens rightward and upward instead of off-screen. */
150
- .mobile-preferences .rx-switcher .rx-switcher__menu {
151
- inset-inline: 0 auto;
152
- inset-block-end: 100%;
153
- margin: 0 0 0.4rem;
175
+ .sl-menu-button:has(~ :popover-open),
176
+ .rx-menu[open] > .rx-menu__toggle {
177
+ background: var(--rx-tag-bg);
154
178
  }
155
179
 
156
- /* A page with no sidebar (a splash landing) has no phone menu, so on phones the header takes a
157
- second row for the switcher and the sections. Starlight offsets the page by --sl-nav-height. */
158
- @media (max-width: 49.99rem) {
159
- :root:not([data-has-sidebar]) {
160
- --sl-nav-height: 6rem;
161
- }
180
+ .sl-menu-button:hover,
181
+ .rx-menu__toggle:hover {
182
+ border-color: var(--rx-faint);
183
+ }
162
184
 
163
- :root:not([data-has-sidebar]) header.header > .header {
164
- flex-wrap: wrap;
165
- align-content: space-between;
166
- }
185
+ .sl-menu-button:focus-visible,
186
+ .rx-menu__toggle:focus-visible {
187
+ outline: 2px solid var(--rx-fg);
188
+ outline-offset: 2px;
189
+ }
167
190
 
168
- :root:not([data-has-sidebar]) header.header .title-wrapper {
169
- flex: 1;
170
- }
191
+ .sl-menu-button svg {
192
+ width: 1.25rem;
193
+ height: 1.25rem;
194
+ }
171
195
 
172
- :root:not([data-has-sidebar]) header.header .right-group {
173
- display: flex;
174
- flex-basis: 100%;
196
+ /* `display` only on phones: unlayered, it would otherwise beat Starlight's `md:sl-hidden`. */
197
+ @media (max-width: 49.99rem) {
198
+ .sl-menu-button,
199
+ .rx-menu__toggle {
200
+ display: grid;
175
201
  }
202
+ }
176
203
 
177
- /* Only the switcher and the sections: the social icons and theme picker do not fit. */
178
- :root:not([data-has-sidebar]) header.header .right-group > :not(.social-icons),
179
- :root:not([data-has-sidebar]) header.header .social-icons > :not(.rx-sections) {
204
+ @media (min-width: 50rem) {
205
+ .rx-menu {
180
206
  display: none;
181
207
  }
208
+ }
182
209
 
183
- :root:not([data-has-sidebar]) header.header .social-icons::after {
184
- content: none;
185
- }
210
+ .rx-menu__toggle {
211
+ position: fixed;
212
+ z-index: var(--sl-z-index-navbar);
213
+ top: calc((var(--sl-nav-height) - var(--sl-menu-button-size)) / 2);
214
+ inset-inline-end: var(--sl-nav-pad-x);
215
+ list-style: none;
216
+ }
186
217
 
187
- /* Flush with the logo above, and opening rightward from the left edge. */
188
- :root:not([data-has-sidebar]) header.header .rx-switcher__trigger {
189
- margin-inline-start: -0.5rem;
190
- }
218
+ .rx-menu__toggle::-webkit-details-marker {
219
+ display: none;
220
+ }
191
221
 
192
- :root:not([data-has-sidebar]) header.header .rx-switcher .rx-switcher__menu {
193
- inset-inline: 0 auto;
194
- }
222
+ .rx-menu:not([open]) .rx-menu__close,
223
+ .rx-menu[open] .rx-menu__open {
224
+ display: none;
225
+ }
226
+
227
+ /* A sheet under the header bar, as tall as it needs and scrolling past the viewport. */
228
+ .rx-menu__panel {
229
+ position: fixed;
230
+ z-index: var(--sl-z-index-menu);
231
+ inset-block-start: var(--sl-nav-height);
232
+ inset-inline: 0;
233
+ max-height: calc(100dvh - var(--sl-nav-height));
234
+ overflow-y: auto;
235
+ padding: 0.5rem var(--sl-nav-pad-x) 1rem;
236
+ border-bottom: 1px solid var(--sl-color-hairline-shade);
237
+ background: var(--sl-color-bg-nav);
238
+ box-shadow: var(--sl-shadow-lg);
239
+ }
240
+
241
+ /* The menu's links: the project docs, then the sections, as full-width 44px rows. */
242
+ .rx-docs-menu__label {
243
+ margin: 0.75rem 0 0.25rem;
244
+ padding-inline: 0.5rem;
245
+ color: var(--rx-muted);
246
+ font-family: var(--rx-font-mono);
247
+ font-size: var(--sl-text-xs);
248
+ letter-spacing: 0.08em;
249
+ text-transform: uppercase;
250
+ }
251
+
252
+ .rx-docs-menu__list {
253
+ margin: 0;
254
+ padding: 0;
255
+ list-style: none;
256
+ }
257
+
258
+ .rx-docs-menu__list li {
259
+ margin: 0;
260
+ }
261
+
262
+ .rx-docs-menu__link {
263
+ display: flex;
264
+ align-items: center;
265
+ min-height: 2.75rem;
266
+ padding-inline: 0.5rem;
267
+ border-radius: var(--rx-radius-sm);
268
+ color: var(--rx-fg);
269
+ font-size: var(--sl-text-base);
270
+ text-decoration: none;
271
+ }
272
+
273
+ .rx-docs-menu__link:hover {
274
+ color: var(--rx-fg);
275
+ background: var(--rx-tag-bg);
276
+ }
277
+
278
+ .rx-docs-menu__link:focus-visible {
279
+ outline: 2px solid var(--rx-fg);
280
+ outline-offset: -2px;
281
+ }
282
+
283
+ /* The current project: the gradient dot the desktop switcher uses, and bold for everyone. */
284
+ .rx-docs-menu__link[aria-current="page"] {
285
+ font-weight: 600;
286
+ }
287
+
288
+ .rx-docs-menu__link[aria-current="page"]::before {
289
+ content: "";
290
+ width: 0.5rem;
291
+ height: 0.5rem;
292
+ margin-inline-end: 0.5rem;
293
+ border-radius: var(--rx-radius-pill);
294
+ background: var(--rx-gradient);
295
+ }
296
+
297
+ /* GitHub, npm and the theme picker share the last row, under a hairline. */
298
+ .rx-menu-content__prefs {
299
+ display: flex;
300
+ flex-wrap: wrap;
301
+ align-items: center;
302
+ justify-content: space-between;
303
+ gap: 0.5rem 1rem;
304
+ margin-top: 0.75rem;
305
+ padding-top: 0.5rem;
306
+ border-top: 1px solid var(--sl-color-hairline);
307
+ }
308
+
309
+ .rx-menu-content__social {
310
+ display: flex;
311
+ gap: 0.25rem;
312
+ }
313
+
314
+ .rx-menu-content__social a {
315
+ display: grid;
316
+ place-items: center;
317
+ min-width: 2.75rem;
318
+ min-height: 2.75rem;
319
+ padding: 0;
320
+ }
321
+
322
+ .rx-menu-content__prefs starlight-theme-select select {
323
+ min-height: 2.75rem;
324
+ }
325
+
326
+ /* Inside Starlight's own menu, below the sidebar. */
327
+ .sidebar-content .rx-menu-content {
328
+ padding-bottom: 1rem;
329
+ border-top: 1px solid var(--sl-color-hairline);
195
330
  }
196
331
 
197
332
  /* --- Footer -------------------------------------------------------------- */