@jaamd/jaad 0.0.0-stage → 0.11.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 (89) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +52 -2
  3. package/dist/jaad.css +1446 -0
  4. package/index.ts +45 -0
  5. package/package.json +70 -3
  6. package/site.ts +19 -0
  7. package/src/@types/docs.ts +47 -0
  8. package/src/advanced.ts +21 -0
  9. package/src/collection.ts +97 -0
  10. package/src/components/Footer.astro +18 -0
  11. package/src/components/Head.astro +119 -0
  12. package/src/components/Header.astro +47 -0
  13. package/src/components/LocaleSwitcher.astro +111 -0
  14. package/src/components/Nav.astro +22 -0
  15. package/src/components/NavMobile.astro +105 -0
  16. package/src/components/ScrollToTop.astro +43 -0
  17. package/src/components/SearchPalette.astro +328 -0
  18. package/src/components/SocialLinks.astro +27 -0
  19. package/src/components/ThemeSwitcher.astro +55 -0
  20. package/src/components/docs/Breadcrumbs.astro +36 -0
  21. package/src/components/docs/DocsMobileNav.astro +93 -0
  22. package/src/components/docs/DocsPage.astro +68 -0
  23. package/src/components/docs/DocsPageNav.astro +53 -0
  24. package/src/components/docs/DocsSidebarLeft.astro +82 -0
  25. package/src/components/docs/PageActions.astro +81 -0
  26. package/src/components/docs/StructuredData.astro +55 -0
  27. package/src/components/docs/TableOfContents.astro +73 -0
  28. package/src/components/locale-switcher.ts +6 -0
  29. package/src/config.ts +236 -0
  30. package/src/content.ts +42 -0
  31. package/src/docs-config.ts +30 -0
  32. package/src/env.d.ts +13 -0
  33. package/src/fonts/OFL.txt +94 -0
  34. package/src/fonts/inter.woff2 +0 -0
  35. package/src/fonts/merriweather-italic.woff2 +0 -0
  36. package/src/fonts/merriweather.woff2 +0 -0
  37. package/src/fonts.ts +29 -0
  38. package/src/forges.ts +60 -0
  39. package/src/infer.ts +75 -0
  40. package/src/integration.ts +270 -0
  41. package/src/layouts/DefaultDocsFrame.astro +31 -0
  42. package/src/layouts/Docs.astro +168 -0
  43. package/src/layouts/Page.astro +38 -0
  44. package/src/locale-tree.ts +51 -0
  45. package/src/locales.ts +191 -0
  46. package/src/navigation.ts +97 -0
  47. package/src/routes/404.astro +16 -0
  48. package/src/routes/docs-index.astro +19 -0
  49. package/src/routes/docs-slug.astro +58 -0
  50. package/src/routes/docs-slug.md.ts +37 -0
  51. package/src/routes/llms-locale.txt.ts +8 -0
  52. package/src/routes/llms.txt.ts +4 -0
  53. package/src/routes/search-index-locale.json.ts +8 -0
  54. package/src/routes/search-index.json.ts +4 -0
  55. package/src/social.ts +44 -0
  56. package/src/styles/components/breadcrumbs.css +13 -0
  57. package/src/styles/components/docs-mobile-nav.css +9 -0
  58. package/src/styles/components/docs-page-nav.css +31 -0
  59. package/src/styles/components/docs-page.css +9 -0
  60. package/src/styles/components/docs-sidebar.css +42 -0
  61. package/src/styles/components/footer.css +8 -0
  62. package/src/styles/components/header.css +20 -0
  63. package/src/styles/components/locale-switcher.css +20 -0
  64. package/src/styles/components/nav-mobile.css +15 -0
  65. package/src/styles/components/nav.css +11 -0
  66. package/src/styles/components/not-found.css +11 -0
  67. package/src/styles/components/page-actions.css +13 -0
  68. package/src/styles/components/scroll-to-top.css +11 -0
  69. package/src/styles/components/search.css +98 -0
  70. package/src/styles/components/shell.css +73 -0
  71. package/src/styles/components/social-links.css +8 -0
  72. package/src/styles/components/theme-switcher.css +14 -0
  73. package/src/styles/components/toc.css +21 -0
  74. package/src/styles/docs.css +112 -0
  75. package/src/styles/global.css +162 -0
  76. package/src/styles/jaamd-forward.css +16 -0
  77. package/src/styles/jaamd-reverse.css +18 -0
  78. package/src/styles/jaamd.css +11 -0
  79. package/src/styles/tailwind.css +30 -0
  80. package/src/themes/index.ts +26 -0
  81. package/src/ui/en.ts +29 -0
  82. package/src/ui/it.ts +30 -0
  83. package/src/ui.ts +49 -0
  84. package/src/urls.ts +49 -0
  85. package/src/utils/docs.ts +300 -0
  86. package/src/utils/endpoints.ts +80 -0
  87. package/src/utils/helpers.ts +4 -0
  88. package/src/utils/search.ts +83 -0
  89. package/src/virtual.ts +48 -0
@@ -0,0 +1,4 @@
1
+ import type { APIRoute } from 'astro'
2
+ import { llmsResponse } from '../utils/endpoints.ts'
3
+
4
+ export const GET: APIRoute = ({ site }) => llmsResponse(site)
@@ -0,0 +1,8 @@
1
+ import type { APIRoute, GetStaticPaths } from 'astro'
2
+ import { getServedLocales } from '../collection.ts'
3
+ import { searchIndexResponse } from '../utils/endpoints.ts'
4
+
5
+ export const getStaticPaths: GetStaticPaths = async () =>
6
+ (await getServedLocales()).map((locale) => ({ params: { locale } }))
7
+
8
+ export const GET: APIRoute = ({ params }) => searchIndexResponse(params.locale)
@@ -0,0 +1,4 @@
1
+ import type { APIRoute } from 'astro'
2
+ import { searchIndexResponse } from '../utils/endpoints.ts'
3
+
4
+ export const GET: APIRoute = () => searchIndexResponse()
package/src/social.ts ADDED
@@ -0,0 +1,44 @@
1
+ import type { JaadResolvedConfig } from './config.ts'
2
+ import { FORGES, forgeForUrl } from './forges.ts'
3
+
4
+ export interface SocialLink {
5
+ href: string
6
+ label: string
7
+ /** Bundled forge icon. */
8
+ path?: string
9
+ /** User-supplied markup, which wins over the bundled icon. */
10
+ svg?: string
11
+ }
12
+
13
+ /** The configured links, plus the inferred repository unless already listed. */
14
+ export function buildSocialLinks(config: JaadResolvedConfig): SocialLink[] {
15
+ const links: SocialLink[] = []
16
+
17
+ for (const [key, value] of Object.entries(config.social)) {
18
+ const entry = typeof value === 'string' ? { href: value } : value
19
+ const forge = FORGES[key]
20
+ links.push({
21
+ href: entry.href,
22
+ label:
23
+ // FORGES has no index signature guarantee: a missing key is undefined.
24
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
25
+ ('label' in entry ? entry.label : undefined) ?? forge?.label ?? key,
26
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
27
+ path: forge?.path,
28
+ svg: 'svg' in entry ? entry.svg : undefined,
29
+ })
30
+ }
31
+
32
+ const namedAForge = Object.keys(config.social).some((key) => key in FORGES)
33
+
34
+ if (config.repoUrl && !namedAForge && !links.some((l) => l.href === config.repoUrl)) {
35
+ const forge = forgeForUrl(config.repoUrl)
36
+ links.push({
37
+ href: config.repoUrl,
38
+ label: forge ? FORGES[forge].label : 'Repository',
39
+ path: forge ? FORGES[forge].path : undefined,
40
+ })
41
+ }
42
+
43
+ return links
44
+ }
@@ -0,0 +1,13 @@
1
+ @layer components {
2
+ .docs-breadcrumbs {
3
+ @apply text-foreground-muted mb-4 flex items-center gap-1.5 text-xs;
4
+ }
5
+
6
+ .docs-breadcrumbs-link {
7
+ @apply hover:text-foreground-bright no-underline;
8
+ }
9
+
10
+ .docs-breadcrumbs-current {
11
+ @apply text-foreground-bright font-medium;
12
+ }
13
+ }
@@ -0,0 +1,9 @@
1
+ @layer components {
2
+ .docs-mobile-nav {
3
+ @apply mb-8 space-y-4 lg:hidden;
4
+ }
5
+
6
+ .docs-select-field {
7
+ @apply border-primary/20 bg-surface text-foreground focus:border-primary w-full appearance-none rounded-lg border py-3 pr-10 pl-4 transition-colors focus:outline-none;
8
+ }
9
+ }
@@ -0,0 +1,31 @@
1
+ @layer components {
2
+ .docs-page-nav {
3
+ @apply py-8;
4
+ }
5
+
6
+ .docs-page-nav-row {
7
+ @apply flex items-center justify-between gap-4;
8
+ }
9
+
10
+ .docs-page-nav-link {
11
+ @apply border-border-dark bg-background-tertiary text-foreground-bright hover:border-primary hover:bg-border-dark hover:text-primary flex max-w-[calc(45%-1rem)] min-w-0 items-center gap-2 rounded-lg border px-4 py-3 no-underline transition-all duration-300;
12
+ }
13
+
14
+ .docs-page-nav-icon {
15
+ @apply h-4 w-4 shrink-0 transition-transform;
16
+ }
17
+
18
+ @media (hover: hover) {
19
+ .docs-page-nav-link:hover .docs-page-nav-icon-prev {
20
+ @apply -translate-x-1;
21
+ }
22
+
23
+ .docs-page-nav-link:hover .docs-page-nav-icon-next {
24
+ @apply translate-x-1;
25
+ }
26
+ }
27
+
28
+ .docs-page-nav-label {
29
+ @apply overflow-hidden font-medium text-ellipsis whitespace-nowrap;
30
+ }
31
+ }
@@ -0,0 +1,9 @@
1
+ @layer components {
2
+ .docs-content {
3
+ @apply w-full leading-relaxed wrap-break-word;
4
+ }
5
+
6
+ .docs-updated {
7
+ @apply text-foreground-muted mt-8 text-xs;
8
+ }
9
+ }
@@ -0,0 +1,42 @@
1
+ @layer components {
2
+ .docs-sidebar-page {
3
+ @apply mb-0.5;
4
+ }
5
+
6
+ .docs-sidebar-page:not(:first-child) {
7
+ @apply mt-0.5;
8
+ }
9
+
10
+ .docs-sidebar-link,
11
+ .docs-sidebar-sublink {
12
+ @apply text-foreground hover:bg-primary/10 hover:text-primary block px-3 py-1.5 text-sm no-underline transition-colors;
13
+ }
14
+
15
+ .docs-sidebar-link {
16
+ @apply rounded;
17
+ }
18
+
19
+ .docs-sidebar-sublink {
20
+ @apply rounded-r;
21
+ }
22
+
23
+ .docs-sidebar-link[aria-current='page'] {
24
+ @apply bg-primary/10 text-primary font-semibold;
25
+ }
26
+
27
+ .docs-sidebar-sublink[aria-current='page'] {
28
+ @apply border-primary bg-primary/10 text-primary -ml-px border-l-2 pl-2.75 font-semibold;
29
+ }
30
+
31
+ .docs-sidebar-chapter {
32
+ @apply mt-5 mb-5;
33
+ }
34
+
35
+ .docs-sidebar-chapter-title {
36
+ @apply text-primary/50 mb-1 px-3 text-[0.825rem] font-semibold tracking-widest uppercase;
37
+ }
38
+
39
+ .docs-sidebar-chapter-list {
40
+ @apply border-border/40 ml-3 space-y-0.5 border-l pl-0;
41
+ }
42
+ }
@@ -0,0 +1,8 @@
1
+ @layer components {
2
+ .jaad-footer {
3
+ @apply border-border-dark mt-4 border-t pt-2;
4
+ }
5
+ .jaad-footer-credit {
6
+ @apply text-foreground-muted mb-1 text-center text-[0.95rem] leading-[1.6] italic;
7
+ }
8
+ }
@@ -0,0 +1,20 @@
1
+ @layer components {
2
+ .jaad-header-inner {
3
+ @apply container mx-auto p-4;
4
+ }
5
+ .jaad-header-row {
6
+ @apply flex items-center gap-4;
7
+ }
8
+ .jaad-brand {
9
+ @apply text-foreground-bright text-xl;
10
+ }
11
+ .jaad-brand-link {
12
+ @apply text-primary no-underline;
13
+ }
14
+ .jaad-logo {
15
+ @apply h-7;
16
+ }
17
+ .jaad-header-actions {
18
+ @apply ml-auto flex items-center gap-2;
19
+ }
20
+ }
@@ -0,0 +1,20 @@
1
+ @layer components {
2
+ .jaad-locale-switcher {
3
+ @apply relative;
4
+ }
5
+ .jaad-locale-trigger {
6
+ @apply w-auto gap-1.5 px-2;
7
+ }
8
+ .jaad-locale-code {
9
+ @apply text-xs font-medium uppercase;
10
+ }
11
+ .jaad-locale-chevron {
12
+ @apply h-3 w-3 shrink-0;
13
+ }
14
+ .jaad-locale-menu {
15
+ @apply p-1;
16
+ }
17
+ .jaad-locale-item {
18
+ @apply flex items-center gap-2 aria-[current]:font-semibold;
19
+ }
20
+ }
@@ -0,0 +1,15 @@
1
+ @layer components {
2
+ .jaad-nav-mobile {
3
+ @apply relative md:hidden;
4
+ }
5
+ .jaad-nav-mobile [aria-expanded='true'] [data-icon-open],
6
+ .jaad-nav-mobile [aria-expanded='false'] [data-icon-close] {
7
+ @apply hidden;
8
+ }
9
+ .jaad-nav-mobile-links {
10
+ @apply p-2;
11
+ }
12
+ .jaad-nav-mobile-list {
13
+ @apply flex flex-col gap-1;
14
+ }
15
+ }
@@ -0,0 +1,11 @@
1
+ @layer components {
2
+ .jaad-nav {
3
+ @apply hidden md:block;
4
+ }
5
+ .jaad-nav-list {
6
+ @apply flex space-x-4;
7
+ }
8
+ .jaad-nav-link {
9
+ @apply text-foreground-secondary hover:text-foreground-bright no-underline hover:underline;
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ @layer components {
2
+ .jaad-not-found {
3
+ @apply m-auto flex h-full w-full flex-col items-center justify-center px-16 text-center;
4
+ }
5
+ .jaad-not-found-title {
6
+ @apply mb-16 text-6xl font-bold;
7
+ }
8
+ .jaad-not-found-text {
9
+ @apply mb-32 text-xl;
10
+ }
11
+ }
@@ -0,0 +1,13 @@
1
+ @layer components {
2
+ .docs-page-actions {
3
+ @apply mb-4 flex items-center gap-2 text-xs;
4
+ }
5
+
6
+ .docs-page-action {
7
+ @apply border-border bg-surface hover:bg-surface-hover text-foreground-secondary hover:text-foreground-bright flex cursor-pointer items-center gap-1.5 rounded-lg border px-3 py-1.5 no-underline transition-colors;
8
+ }
9
+
10
+ .docs-page-action-icon {
11
+ @apply h-3.5 w-3.5 shrink-0;
12
+ }
13
+ }
@@ -0,0 +1,11 @@
1
+ @layer components {
2
+ .jaad-scroll-top-button {
3
+ @apply bg-background text-foreground hover:bg-background/80 border-foreground/20 pointer-events-none fixed right-6 bottom-6 z-50 flex h-12 w-12 items-center justify-center rounded-full border opacity-0 shadow-lg transition-opacity duration-300 lg:hidden;
4
+ }
5
+ .jaad-scroll-top-button[data-visible] {
6
+ @apply pointer-events-auto opacity-100;
7
+ }
8
+ .jaad-scroll-top-icon {
9
+ @apply h-6 w-6;
10
+ }
11
+ }
@@ -0,0 +1,98 @@
1
+ @layer components {
2
+ .jaad-search-trigger {
3
+ @apply border-border bg-surface hover:bg-surface-hover text-foreground-muted hidden cursor-pointer items-center gap-2 rounded-lg border px-3 py-1.5 text-sm transition-colors md:flex;
4
+ }
5
+
6
+ .jaad-search-trigger-icon {
7
+ @apply h-4 w-4 shrink-0;
8
+ }
9
+
10
+ .jaad-search-trigger-label {
11
+ @apply hidden lg:inline;
12
+ }
13
+
14
+ .jaad-search-shortcut {
15
+ @apply bg-background-secondary text-foreground-muted rounded px-1.5 py-0.5 text-xs font-medium;
16
+ }
17
+
18
+ /* Icon trigger on a docs page, where the desktop field is shown from md. */
19
+ .jaad-search-trigger-compact {
20
+ @apply md:hidden;
21
+ }
22
+
23
+ .jaad-search-overlay {
24
+ @apply fixed inset-0 z-50 flex items-start justify-center px-4 pt-[15vh];
25
+ }
26
+
27
+ .jaad-search-backdrop {
28
+ @apply absolute inset-0 bg-black/60 backdrop-blur-sm;
29
+ }
30
+
31
+ .jaad-search-panel {
32
+ @apply bg-surface border-border relative z-10 w-full max-w-lg overflow-hidden rounded-xl border shadow-2xl;
33
+ }
34
+
35
+ .jaad-search-bar {
36
+ @apply border-border flex items-center gap-3 border-b px-4 py-3;
37
+ }
38
+
39
+ .jaad-search-bar-icon {
40
+ @apply text-foreground-muted h-5 w-5 shrink-0;
41
+ }
42
+
43
+ .jaad-search-input {
44
+ @apply text-foreground placeholder:text-foreground-muted min-w-0 flex-1 bg-transparent text-sm outline-none;
45
+ }
46
+
47
+ .jaad-search-close {
48
+ @apply bg-background-secondary text-foreground-muted shrink-0 cursor-pointer rounded px-1.5 py-0.5 text-xs;
49
+ }
50
+
51
+ .jaad-search-results {
52
+ @apply max-h-80 overflow-y-auto p-2;
53
+ }
54
+
55
+ .jaad-search-footer {
56
+ @apply border-border text-foreground-muted flex items-center gap-4 border-t px-4 py-2 text-xs;
57
+ }
58
+
59
+ .jaad-search-key {
60
+ @apply bg-background-secondary rounded px-1 py-0.5;
61
+ }
62
+
63
+ .jaad-search-result {
64
+ @apply text-foreground cursor-pointer rounded-lg px-3 py-2.5 text-left transition-colors;
65
+ }
66
+
67
+ .jaad-search-result:not([aria-selected='true']) {
68
+ @apply hover:bg-primary/5;
69
+ }
70
+
71
+ .jaad-search-result[aria-selected='true'] {
72
+ @apply bg-primary/10 text-foreground-bright;
73
+ }
74
+
75
+ .jaad-search-result-head {
76
+ @apply flex items-center gap-2;
77
+ }
78
+
79
+ .jaad-search-result-title {
80
+ @apply text-sm font-medium;
81
+ }
82
+
83
+ .jaad-search-result-badge {
84
+ @apply text-foreground-muted bg-background-secondary rounded px-1.5 py-0.5 text-[0.65rem];
85
+ }
86
+
87
+ .jaad-search-result-snippet {
88
+ @apply text-foreground-secondary mt-1 line-clamp-1 text-xs;
89
+ }
90
+
91
+ .jaad-search-mark {
92
+ @apply bg-primary/20 text-foreground-bright rounded-sm px-0.5 font-semibold not-italic;
93
+ }
94
+
95
+ .jaad-search-message {
96
+ @apply text-foreground-muted px-3 py-6 text-center text-sm;
97
+ }
98
+ }
@@ -0,0 +1,73 @@
1
+ /* Shared shell classes; first in the layer so component files override them. */
2
+ @layer components {
3
+ /* Header, footer and docs content share one measure. */
4
+ .jaad-chrome {
5
+ width: 100%;
6
+ max-width: var(--jaad-chrome-width);
7
+ margin-inline: auto;
8
+ }
9
+
10
+ .jaad-main {
11
+ flex: 1;
12
+ margin-block: 4rem;
13
+ padding-inline: var(--jaad-page-padding);
14
+ }
15
+
16
+ @media (min-width: 64rem) {
17
+ .jaad-main {
18
+ padding-inline: calc(var(--jaad-page-padding) * 2);
19
+ }
20
+ }
21
+
22
+ /* `bare` keeps the landmark without the spacing. */
23
+ .jaad-main-bare {
24
+ flex: 1;
25
+ }
26
+
27
+ .jaad-body {
28
+ @apply bg-background text-foreground flex min-h-screen flex-col text-[14px] leading-[1.6];
29
+ }
30
+
31
+ .jaad-icon {
32
+ @apply h-5 w-5;
33
+ }
34
+
35
+ .jaad-sr-only {
36
+ @apply sr-only;
37
+ }
38
+
39
+ .jaad-sidebar {
40
+ width: var(--jaad-sidebar-width);
41
+ overflow-y: auto;
42
+ }
43
+
44
+ .jaad-sidebar::-webkit-scrollbar {
45
+ width: 6px;
46
+ }
47
+
48
+ .jaad-sidebar::-webkit-scrollbar-track {
49
+ background: transparent;
50
+ }
51
+
52
+ .jaad-sidebar::-webkit-scrollbar-thumb {
53
+ background: rgb(from var(--color-primary) r g b / 0.2);
54
+ border-radius: 3px;
55
+ }
56
+
57
+ .jaad-sidebar::-webkit-scrollbar-thumb:hover {
58
+ background: rgb(from var(--color-primary) r g b / 0.4);
59
+ }
60
+
61
+ /* The header controls sit in one row and have to stay identical. */
62
+ .jaad-icon-button {
63
+ @apply text-foreground-secondary hover:text-foreground-bright flex h-9 w-9 cursor-pointer items-center justify-center rounded-lg no-underline transition-colors;
64
+ }
65
+
66
+ .jaad-menu {
67
+ @apply bg-surface border-border absolute top-full right-0 z-40 mt-2 w-44 overflow-hidden rounded-xl border shadow-lg;
68
+ }
69
+
70
+ .jaad-menu-item {
71
+ @apply text-foreground-secondary hover:text-foreground-bright hover:bg-primary/5 block rounded-lg px-3 py-2 text-sm no-underline transition-colors;
72
+ }
73
+ }
@@ -0,0 +1,8 @@
1
+ @layer components {
2
+ .jaad-social-icon {
3
+ @apply flex h-5 w-5 items-center justify-center;
4
+ }
5
+ .jaad-social-label {
6
+ @apply text-xs;
7
+ }
8
+ }
@@ -0,0 +1,14 @@
1
+ @layer components {
2
+ /* Both icons ship; CSS picks one, so the server-rendered control is correct. */
3
+ .jaad-theme-icon-to-light {
4
+ display: none;
5
+ }
6
+
7
+ html.dark .jaad-theme-icon-to-dark {
8
+ display: none;
9
+ }
10
+
11
+ html.dark .jaad-theme-icon-to-light {
12
+ display: block;
13
+ }
14
+ }
@@ -0,0 +1,21 @@
1
+ @layer components {
2
+ .docs-toc-title {
3
+ @apply text-primary/60 mb-4 text-xs font-semibold tracking-wider uppercase;
4
+ }
5
+
6
+ .docs-toc-list {
7
+ @apply space-y-2;
8
+ }
9
+
10
+ .docs-toc-link {
11
+ @apply text-foreground/60 hover:text-primary block border-l-2 border-transparent py-1 pl-3 text-xs no-underline transition-colors;
12
+ }
13
+
14
+ .docs-toc-link-nested {
15
+ @apply pl-6;
16
+ }
17
+
18
+ .docs-toc-link[aria-current='location'] {
19
+ @apply border-primary;
20
+ }
21
+ }
@@ -0,0 +1,112 @@
1
+ /* Layered, so a page's own utilities still win. */
2
+ @layer components {
3
+ .docs-frame {
4
+ display: contents;
5
+ }
6
+
7
+ .docs-container {
8
+ position: relative;
9
+ width: 100%;
10
+ min-height: calc(100vh - 6.5rem);
11
+ display: flex;
12
+ justify-content: center;
13
+ }
14
+
15
+ /* The inline margin is deliberate and survives every breakpoint: it sits
16
+ outside the page padding, which only starts at 48rem. */
17
+ .docs-page-main {
18
+ flex: 1;
19
+ margin-block: 2rem;
20
+ margin-inline: 1rem;
21
+ }
22
+
23
+ @media (min-width: 48rem) {
24
+ .docs-page-main {
25
+ margin-block: 4rem;
26
+ padding-inline: var(--jaad-page-padding);
27
+ }
28
+ }
29
+
30
+ @media (min-width: 64rem) {
31
+ .docs-page-main {
32
+ margin-bottom: 8rem;
33
+ padding-inline: calc(var(--jaad-page-padding) * 2);
34
+ }
35
+ }
36
+
37
+ .docs-main {
38
+ width: 100%;
39
+ max-width: var(--jaad-content-width);
40
+ position: relative;
41
+ }
42
+
43
+ /* The room the sidebars need, so widening them widens the gutters too. */
44
+ @media (min-width: 64rem) {
45
+ .docs-main-gutters {
46
+ margin-inline: var(--jaad-sidebar-width);
47
+ }
48
+ }
49
+
50
+ @media (min-width: 64rem) {
51
+ [data-jaad-default-frame] .docs-sidebar-left,
52
+ [data-jaad-default-frame] .docs-sidebar-right {
53
+ position: fixed;
54
+ top: 0;
55
+ height: 100vh;
56
+ padding: 6rem 1.5rem 2rem;
57
+ }
58
+
59
+ /* max() keeps the sidebar on screen when the centred offset would be
60
+ negative, whatever the content and sidebar tokens are set to. */
61
+ [data-jaad-default-frame] .docs-sidebar-left {
62
+ left: max(1rem, var(--jaad-sidebar-offset));
63
+ }
64
+
65
+ [data-jaad-default-frame] .docs-sidebar-right {
66
+ right: max(1rem, var(--jaad-sidebar-offset));
67
+ }
68
+ }
69
+
70
+ @media (width < 64rem) {
71
+ [data-jaad-default-frame] .docs-sidebar-left,
72
+ [data-jaad-default-frame] .docs-sidebar-right {
73
+ display: none;
74
+ }
75
+ }
76
+
77
+ /* A mask, so the colour comes from the token and follows the theme.
78
+ Override --jaad-select-arrow for a different shape. */
79
+ .docs-select {
80
+ position: relative;
81
+ }
82
+
83
+ .docs-select::after {
84
+ content: '';
85
+ position: absolute;
86
+ top: 50%;
87
+ right: 0.75rem;
88
+ width: 1.25rem;
89
+ height: 1.25rem;
90
+ transform: translateY(-50%);
91
+ pointer-events: none;
92
+ background-color: var(--color-foreground);
93
+ mask: var(
94
+ --jaad-select-arrow,
95
+ url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' viewBox='0 0 20 20'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E")
96
+ )
97
+ center / contain no-repeat;
98
+ }
99
+
100
+ .docs-mobile-nav optgroup {
101
+ font-weight: 600;
102
+ color: var(--color-primary);
103
+ background: var(--color-surface);
104
+ }
105
+
106
+ .docs-mobile-nav option {
107
+ font-weight: 400;
108
+ color: var(--color-foreground);
109
+ background: var(--color-surface);
110
+ padding: 0.5rem;
111
+ }
112
+ }