@next-library/theme 1.0.3 → 1.0.5

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 (39) hide show
  1. package/README.md +106 -76
  2. package/dist/client.d.ts +1 -0
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +2082 -287
  5. package/dist/client.js.map +1 -1
  6. package/dist/components/layout/doc-pager.d.ts +18 -0
  7. package/dist/components/layout/doc-pager.d.ts.map +1 -0
  8. package/dist/components/layout/documentation-layout.d.ts +2 -0
  9. package/dist/components/layout/documentation-layout.d.ts.map +1 -1
  10. package/dist/components/layout/footer.d.ts +1 -1
  11. package/dist/components/layout/footer.d.ts.map +1 -1
  12. package/dist/components/layout/navigation-bar.d.ts +3 -1
  13. package/dist/components/layout/navigation-bar.d.ts.map +1 -1
  14. package/dist/components/layout/reading-progress.d.ts +3 -0
  15. package/dist/components/layout/reading-progress.d.ts.map +1 -0
  16. package/dist/components/markdown/markdown-renderer.d.ts.map +1 -1
  17. package/dist/components/navigation/navbar/logo.d.ts.map +1 -1
  18. package/dist/components/navigation/navbar/mobile-menu.d.ts.map +1 -1
  19. package/dist/components/navigation/navbar/search-bar.d.ts.map +1 -1
  20. package/dist/components/navigation/sidebar-left/parent.d.ts.map +1 -1
  21. package/dist/components/navigation/sidebar-left/sidebar.d.ts +1 -1
  22. package/dist/components/navigation/sidebar-left/sidebar.d.ts.map +1 -1
  23. package/dist/components/navigation/sidebar-right/table-of-contents.d.ts +6 -0
  24. package/dist/components/navigation/sidebar-right/table-of-contents.d.ts.map +1 -1
  25. package/dist/components/ui/anchor-link-handler.d.ts.map +1 -1
  26. package/dist/index.js +2346 -320
  27. package/dist/index.js.map +1 -1
  28. package/dist/lib/translations/index.d.ts +3 -35
  29. package/dist/lib/translations/index.d.ts.map +1 -1
  30. package/dist/lib/translations/locale-names.d.ts +1 -1
  31. package/dist/lib/translations/locale-names.d.ts.map +1 -1
  32. package/dist/lib/translations/theme-translations-types.d.ts +35 -0
  33. package/dist/lib/translations/theme-translations-types.d.ts.map +1 -0
  34. package/dist/server.d.ts +1 -0
  35. package/dist/server.d.ts.map +1 -1
  36. package/dist/server.js +1895 -53
  37. package/dist/server.js.map +1 -1
  38. package/package.json +4 -4
  39. package/src/style.css +185 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next-library/theme",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -94,7 +94,7 @@
94
94
  "rehype-highlight": "^7.0.2",
95
95
  "rehype-autolink-headings": "^7.1.0",
96
96
  "react-github-btn": "^1.4.0",
97
- "@next-library/core": "1.0.24"
97
+ "@next-library/core": "1.0.38"
98
98
  },
99
99
  "devDependencies": {
100
100
  "@testing-library/jest-dom": "^6.1.0",
@@ -111,10 +111,10 @@
111
111
  "typescript": "^5.9.3"
112
112
  },
113
113
  "scripts": {
114
- "build": "tsup && npm run build:types",
114
+ "build": "tsup && pnpm run build:types",
115
115
  "build:types": "tsc --emitDeclarationOnly --declaration --declarationMap --outDir dist",
116
116
  "dev": "tsup --watch",
117
- "lint": "eslint src",
117
+ "lint": "pnpm -w exec eslint packages/theme/src",
118
118
  "test": "jest",
119
119
  "test:watch": "jest --watch",
120
120
  "test:coverage": "jest --coverage",
package/src/style.css CHANGED
@@ -17,3 +17,188 @@
17
17
  @source "./**/*.{js,jsx,ts,tsx}";
18
18
  @source "../dist/**/*.{js,jsx}";
19
19
 
20
+
21
+ /* ── Inline code: render as a crisp snippet, not Tailwind Typography's backticked bold ── */
22
+ .prose code:not(pre code) {
23
+ font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
24
+ font-size: 0.85em;
25
+ font-weight: 500;
26
+ background: color-mix(in oklab, var(--foreground) 7%, transparent);
27
+ border: 1px solid var(--border);
28
+ border-radius: 0.375rem;
29
+ padding: 0.1em 0.36em;
30
+ white-space: break-word;
31
+ }
32
+ .prose code:not(pre code)::before,
33
+ .prose code:not(pre code)::after { content: none !important; }
34
+
35
+ /* ── Fenced code blocks: premium card + copy + language, with real syntax colors ── */
36
+ .cl-code {
37
+ position: relative;
38
+ margin: 1.25em 0;
39
+ border: 1px solid var(--border);
40
+ border-radius: 0.65rem;
41
+ background: var(--card);
42
+ overflow: hidden;
43
+ }
44
+ .cl-code-bar {
45
+ position: absolute;
46
+ top: 0.4rem;
47
+ right: 0.5rem;
48
+ display: flex;
49
+ align-items: center;
50
+ gap: 0.25rem;
51
+ z-index: 1;
52
+ }
53
+ .cl-code-lang {
54
+ font-family: var(--font-mono, ui-monospace, monospace);
55
+ font-size: 0.68rem;
56
+ letter-spacing: 0.04em;
57
+ text-transform: lowercase;
58
+ color: var(--muted-foreground);
59
+ opacity: 0.75;
60
+ padding-right: 0.15rem;
61
+ }
62
+ .cl-code-copy {
63
+ display: inline-flex;
64
+ align-items: center;
65
+ justify-content: center;
66
+ height: 1.6rem;
67
+ width: 1.6rem;
68
+ border-radius: 0.4rem;
69
+ color: var(--muted-foreground);
70
+ background: color-mix(in oklab, var(--card) 70%, transparent);
71
+ opacity: 0;
72
+ transition: opacity 0.15s, background 0.15s, color 0.15s;
73
+ }
74
+ .cl-code:hover .cl-code-copy, .cl-code-copy:focus-visible { opacity: 1; }
75
+ .cl-code-copy:hover { background: color-mix(in oklab, var(--foreground) 10%, transparent); color: var(--foreground); }
76
+ .cl-code pre {
77
+ margin: 0;
78
+ padding: 0.95rem 1.05rem;
79
+ overflow-x: auto;
80
+ background: transparent;
81
+ font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
82
+ font-size: 0.82rem;
83
+ line-height: 1.65;
84
+ color: var(--foreground);
85
+ }
86
+ .cl-code pre code {
87
+ background: transparent !important;
88
+ border: 0 !important;
89
+ padding: 0 !important;
90
+ font-size: inherit;
91
+ white-space: pre;
92
+ color: inherit;
93
+ }
94
+
95
+ /* Syntax theme (One Light by default, One Dark under .dark). Scoped to code blocks. */
96
+ .cl-code .hljs { color: #383a42; background: transparent; }
97
+ .cl-code .hljs-comment, .cl-code .hljs-quote { color: #a0a1a7; font-style: italic; }
98
+ .cl-code .hljs-keyword, .cl-code .hljs-selector-tag, .cl-code .hljs-literal, .cl-code .hljs-section, .cl-code .hljs-doctag, .cl-code .hljs-name, .cl-code .hljs-strong { color: #a626a4; }
99
+ .cl-code .hljs-string, .cl-code .hljs-regexp, .cl-code .hljs-addition { color: #50a14f; }
100
+ .cl-code .hljs-number, .cl-code .hljs-bullet { color: #986801; }
101
+ .cl-code .hljs-title, .cl-code .hljs-title.function_, .cl-code .hljs-function .hljs-title { color: #4078f2; }
102
+ .cl-code .hljs-type, .cl-code .hljs-class .hljs-title, .cl-code .hljs-built_in, .cl-code .hljs-params { color: #c18401; }
103
+ .cl-code .hljs-variable, .cl-code .hljs-template-variable, .cl-code .hljs-attr, .cl-code .hljs-attribute, .cl-code .hljs-selector-attr, .cl-code .hljs-selector-class, .cl-code .hljs-selector-id, .cl-code .hljs-tag { color: #e45649; }
104
+ .cl-code .hljs-symbol, .cl-code .hljs-link, .cl-code .hljs-meta, .cl-code .hljs-subst { color: #0184bc; }
105
+ .cl-code .hljs-deletion { color: #e45649; }
106
+ .cl-code .hljs-emphasis { font-style: italic; }
107
+
108
+ .dark .cl-code .hljs { color: #abb2bf; }
109
+ .dark .cl-code .hljs-comment, .dark .cl-code .hljs-quote { color: #7f848e; }
110
+ .dark .cl-code .hljs-keyword, .dark .cl-code .hljs-selector-tag, .dark .cl-code .hljs-literal, .dark .cl-code .hljs-section, .dark .cl-code .hljs-doctag, .dark .cl-code .hljs-name, .dark .cl-code .hljs-strong { color: #c678dd; }
111
+ .dark .cl-code .hljs-string, .dark .cl-code .hljs-regexp, .dark .cl-code .hljs-addition { color: #98c379; }
112
+ .dark .cl-code .hljs-number, .dark .cl-code .hljs-bullet { color: #d19a66; }
113
+ .dark .cl-code .hljs-title, .dark .cl-code .hljs-title.function_, .dark .cl-code .hljs-function .hljs-title { color: #61afef; }
114
+ .dark .cl-code .hljs-type, .dark .cl-code .hljs-class .hljs-title, .dark .cl-code .hljs-built_in, .dark .cl-code .hljs-params { color: #e5c07b; }
115
+ .dark .cl-code .hljs-variable, .dark .cl-code .hljs-template-variable, .dark .cl-code .hljs-attr, .dark .cl-code .hljs-attribute, .dark .cl-code .hljs-selector-attr, .dark .cl-code .hljs-selector-class, .dark .cl-code .hljs-selector-id, .dark .cl-code .hljs-tag { color: #e06c75; }
116
+ .dark .cl-code .hljs-symbol, .dark .cl-code .hljs-link, .dark .cl-code .hljs-meta, .dark .cl-code .hljs-subst { color: #56b6c2; }
117
+ .dark .cl-code .hljs-deletion { color: #e06c75; }
118
+
119
+ /* ── Tabbed content groups ── */
120
+ .cl-tabs { margin: 1.25em 0; }
121
+ .cl-tabs-list { display: flex; flex-wrap: wrap; gap: 1.25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
122
+ .cl-tab-btn {
123
+ position: relative;
124
+ padding: 0 0 0.6rem;
125
+ font-size: 0.875rem;
126
+ font-weight: 500;
127
+ color: var(--muted-foreground);
128
+ background: transparent;
129
+ cursor: pointer;
130
+ transition: color 0.15s;
131
+ }
132
+ .cl-tab-btn:hover { color: var(--foreground); }
133
+ .cl-tab-btn.is-active { color: var(--foreground); }
134
+ .cl-tab-btn.is-active::after {
135
+ content: '';
136
+ position: absolute;
137
+ left: 0;
138
+ right: 0;
139
+ bottom: -1px;
140
+ height: 2px;
141
+ border-radius: 2px;
142
+ background: var(--foreground);
143
+ }
144
+ .cl-tabs-panel > :first-child { margin-top: 0; }
145
+ .cl-tabs-panel > :last-child { margin-bottom: 0; }
146
+
147
+ /* ── Callouts / admonitions (rehype-callouts output) ── */
148
+ .prose .callout {
149
+ --cl-accent: var(--muted-foreground);
150
+ margin: 1.25em 0;
151
+ border: 1px solid var(--border);
152
+ border-left: 3px solid var(--cl-accent);
153
+ border-radius: 0.55rem;
154
+ background: color-mix(in oklab, var(--cl-accent) 7%, var(--card));
155
+ padding: 0.85rem 1rem;
156
+ }
157
+ .prose .callout-title { display: flex; align-items: center; gap: 0.5rem; margin: 0; font-weight: 600; font-size: 0.9rem; color: var(--foreground); }
158
+ .prose .callout-title-icon { display: inline-flex; color: var(--cl-accent); }
159
+ .prose .callout-title-icon svg { width: 1.05rem; height: 1.05rem; }
160
+ .prose .callout-content { margin-top: 0.4rem; font-size: 0.92rem; color: var(--muted-foreground); }
161
+ .prose .callout-content > :first-child { margin-top: 0; }
162
+ .prose .callout-content > :last-child { margin-bottom: 0; }
163
+ .prose .callout[data-callout="note"], .prose .callout[data-callout="info"] { --cl-accent: #3b82f6; }
164
+ .prose .callout[data-callout="tip"], .prose .callout[data-callout="hint"], .prose .callout[data-callout="success"], .prose .callout[data-callout="check"], .prose .callout[data-callout="done"] { --cl-accent: #22c55e; }
165
+ .prose .callout[data-callout="warning"], .prose .callout[data-callout="caution"], .prose .callout[data-callout="attention"] { --cl-accent: #f59e0b; }
166
+ .prose .callout[data-callout="danger"], .prose .callout[data-callout="error"], .prose .callout[data-callout="bug"], .prose .callout[data-callout="failure"], .prose .callout[data-callout="missing"] { --cl-accent: #ef4444; }
167
+ .prose .callout[data-callout="important"], .prose .callout[data-callout="example"] { --cl-accent: #a855f7; }
168
+
169
+ /* ── Tables ── */
170
+ .prose table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 1.5em 0; font-size: 0.875rem; border: 1px solid var(--border); border-radius: 0.55rem; overflow: hidden; }
171
+ .prose thead { background: color-mix(in oklab, var(--foreground) 4%, transparent); }
172
+ .prose th { text-align: left; font-weight: 600; padding: 0.55rem 0.9rem; border-bottom: 1px solid var(--border); }
173
+ .prose td { padding: 0.55rem 0.9rem; border-bottom: 1px solid var(--border); }
174
+ .prose tbody tr:last-child td { border-bottom: 0; }
175
+ .prose tbody tr:hover { background: color-mix(in oklab, var(--foreground) 3%, transparent); }
176
+
177
+ /* ── Heading anchors (rehype-autolink-headings, behavior: append) ── */
178
+ .prose .heading-anchor { margin-left: 0.4em; color: var(--muted-foreground); text-decoration: none; opacity: 0; transition: opacity 0.15s, color 0.15s; font-weight: 400; }
179
+ .prose h1:hover .heading-anchor, .prose h2:hover .heading-anchor, .prose h3:hover .heading-anchor, .prose h4:hover .heading-anchor { opacity: 1; }
180
+ .prose .heading-anchor:hover { color: var(--foreground); }
181
+
182
+ /* ── Blockquote, images, selection ── */
183
+ .prose blockquote { border-left: 3px solid var(--border); padding-left: 1rem; font-style: normal; color: var(--muted-foreground); }
184
+ .prose img { border: 1px solid var(--border); border-radius: 0.55rem; }
185
+ ::selection { background: color-mix(in oklab, var(--foreground) 18%, transparent); }
186
+
187
+ /* ── Content entrance motion ── */
188
+ @keyframes cl-content-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
189
+ .cl-content-in { animation: cl-content-in 0.4s cubic-bezier(.4,0,.2,1); }
190
+
191
+ /* ── Reading progress bar ── */
192
+ .cl-progress { position: fixed; top: 0; left: 0; height: 2px; z-index: 50; background: var(--foreground); width: 0; transition: width 0.1s linear; }
193
+ @media (prefers-reduced-motion: reduce) { .cl-content-in { animation: none; } .cl-progress { transition: none; } }
194
+
195
+ /* ── Prev/Next pager + edit link ── */
196
+ .cl-pager { display: grid; gap: 1rem; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
197
+ @media (min-width: 640px) { .cl-pager-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; } }
198
+ .cl-pager-card { display: flex; flex-direction: column; gap: 0.2rem; border: 1px solid var(--border); border-radius: 0.6rem; padding: 0.85rem 1rem; transition: background 0.15s, border-color 0.15s; }
199
+ .cl-pager-card:hover { background: var(--accent); border-color: color-mix(in oklab, var(--foreground) 20%, var(--border)); }
200
+ .cl-pager-card.is-next { text-align: right; align-items: flex-end; }
201
+ .cl-pager-dir { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-foreground); }
202
+ .cl-pager-title { font-size: 0.95rem; font-weight: 500; color: var(--foreground); }
203
+ .cl-edit-link { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--muted-foreground); transition: color 0.15s; }
204
+ .cl-edit-link:hover { color: var(--foreground); }