@opendocsdev/cli 0.2.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 (78) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +300 -0
  3. package/dist/bin/opendocs.js +712 -0
  4. package/dist/bin/opendocs.js.map +1 -0
  5. package/dist/templates/api-reference.mdx +308 -0
  6. package/dist/templates/components.mdx +286 -0
  7. package/dist/templates/configuration.mdx +190 -0
  8. package/dist/templates/docs.json +27 -0
  9. package/dist/templates/introduction.mdx +25 -0
  10. package/dist/templates/logo.svg +4 -0
  11. package/dist/templates/quickstart.mdx +59 -0
  12. package/dist/templates/writing-content.mdx +236 -0
  13. package/package.json +92 -0
  14. package/src/engine/astro.config.ts +75 -0
  15. package/src/engine/src/components/Analytics.astro +57 -0
  16. package/src/engine/src/components/ApiPlayground.astro +24 -0
  17. package/src/engine/src/components/Callout.astro +66 -0
  18. package/src/engine/src/components/Card.astro +75 -0
  19. package/src/engine/src/components/CardGroup.astro +29 -0
  20. package/src/engine/src/components/CodeGroup.astro +231 -0
  21. package/src/engine/src/components/CopyButton.astro +179 -0
  22. package/src/engine/src/components/Steps.astro +27 -0
  23. package/src/engine/src/components/Tab.astro +21 -0
  24. package/src/engine/src/components/TableOfContents.astro +119 -0
  25. package/src/engine/src/components/Tabs.astro +135 -0
  26. package/src/engine/src/components/index.ts +107 -0
  27. package/src/engine/src/components/react/ApiPlayground/AuthSection.tsx +91 -0
  28. package/src/engine/src/components/react/ApiPlayground/CodeBlock.tsx +66 -0
  29. package/src/engine/src/components/react/ApiPlayground/CodeSnippets.tsx +66 -0
  30. package/src/engine/src/components/react/ApiPlayground/CollapsibleSection.tsx +26 -0
  31. package/src/engine/src/components/react/ApiPlayground/KeyValueEditor.tsx +58 -0
  32. package/src/engine/src/components/react/ApiPlayground/ResponseDisplay.tsx +109 -0
  33. package/src/engine/src/components/react/ApiPlayground/Spinner.tsx +6 -0
  34. package/src/engine/src/components/react/ApiPlayground/constants.ts +16 -0
  35. package/src/engine/src/components/react/ApiPlayground/generators.test.ts +130 -0
  36. package/src/engine/src/components/react/ApiPlayground/generators.ts +75 -0
  37. package/src/engine/src/components/react/ApiPlayground/index.tsx +490 -0
  38. package/src/engine/src/components/react/ApiPlayground/types.ts +35 -0
  39. package/src/engine/src/components/react/Callout.tsx +54 -0
  40. package/src/engine/src/components/react/Card.tsx +48 -0
  41. package/src/engine/src/components/react/CardGroup.tsx +24 -0
  42. package/src/engine/src/components/react/FeedbackWidget.tsx +166 -0
  43. package/src/engine/src/components/react/GitHubLink.tsx +28 -0
  44. package/src/engine/src/components/react/NavigationCard.tsx +53 -0
  45. package/src/engine/src/components/react/PageActions.tsx +124 -0
  46. package/src/engine/src/components/react/PageFooter.tsx +91 -0
  47. package/src/engine/src/components/react/SearchModal.tsx +358 -0
  48. package/src/engine/src/components/react/SearchProvider.tsx +37 -0
  49. package/src/engine/src/components/react/Sidebar.tsx +369 -0
  50. package/src/engine/src/components/react/SidebarSearchTrigger.tsx +57 -0
  51. package/src/engine/src/components/react/Steps.tsx +25 -0
  52. package/src/engine/src/components/react/ThemeToggle.tsx +72 -0
  53. package/src/engine/src/components/react/index.ts +14 -0
  54. package/src/engine/src/env.d.ts +10 -0
  55. package/src/engine/src/layouts/DocsLayout.astro +357 -0
  56. package/src/engine/src/lib/__tests__/markdown.test.ts +124 -0
  57. package/src/engine/src/lib/__tests__/mdx-loader.test.ts +205 -0
  58. package/src/engine/src/lib/config.ts +79 -0
  59. package/src/engine/src/lib/markdown.ts +54 -0
  60. package/src/engine/src/lib/mdx-loader.ts +143 -0
  61. package/src/engine/src/lib/mdx-utils.ts +72 -0
  62. package/src/engine/src/lib/remark-opendocs.ts +195 -0
  63. package/src/engine/src/lib/utils.ts +221 -0
  64. package/src/engine/src/pages/[...slug].astro +115 -0
  65. package/src/engine/src/pages/index.astro +71 -0
  66. package/src/engine/src/scripts/mobile-sidebar.ts +56 -0
  67. package/src/engine/src/scripts/theme-init.ts +25 -0
  68. package/src/engine/src/styles/global.css +703 -0
  69. package/src/engine/tailwind.config.mjs +60 -0
  70. package/src/engine/tsconfig.json +15 -0
  71. package/src/templates/api-reference.mdx +308 -0
  72. package/src/templates/components.mdx +286 -0
  73. package/src/templates/configuration.mdx +190 -0
  74. package/src/templates/docs.json +27 -0
  75. package/src/templates/introduction.mdx +25 -0
  76. package/src/templates/logo.svg +4 -0
  77. package/src/templates/quickstart.mdx +59 -0
  78. package/src/templates/writing-content.mdx +236 -0
@@ -0,0 +1,703 @@
1
+ @import "@fontsource-variable/geist";
2
+ @import "@fontsource-variable/geist-mono";
3
+
4
+ @tailwind base;
5
+ @tailwind components;
6
+ @tailwind utilities;
7
+
8
+ /* ============================================
9
+ DESIGN TOKENS - Theme System
10
+ ============================================
11
+ These CSS custom properties enable theming.
12
+ Primary and accent colors are injected from docs.json config.
13
+ Neutral colors use a consistent gray scale.
14
+ */
15
+
16
+ @layer base {
17
+ :root {
18
+ /* Primary color - defaults only, overridden by docs.json theme config */
19
+ --color-primary-foreground: #ffffff;
20
+
21
+ /* Neutral scale - consistent grays */
22
+ --color-background: #ffffff;
23
+ --color-foreground: #111827;
24
+ --color-muted: #6b7280;
25
+ --color-muted-foreground: #9ca3af;
26
+
27
+ /* Surface colors */
28
+ --color-surface: #ffffff;
29
+ --color-surface-raised: #f9fafb;
30
+ --color-surface-sunken: #f3f4f6;
31
+
32
+ /* Border colors */
33
+ --color-border: #e5e7eb;
34
+ --color-border-muted: #f3f4f6;
35
+
36
+ /* Code block colors */
37
+ --color-code-bg: #1f2937;
38
+ --color-code-text: #f3f4f6;
39
+ --color-code-inline-bg: #f3f4f6;
40
+ --color-code-inline-text: #1f2937;
41
+
42
+ /* Semantic colors - fixed for accessibility/meaning */
43
+ --color-info: #3b82f6;
44
+ --color-info-light: #eff6ff;
45
+ --color-warning: #f59e0b;
46
+ --color-warning-light: #fffbeb;
47
+ --color-error: #ef4444;
48
+ --color-error-light: #fef2f2;
49
+ --color-success: #22c55e;
50
+ --color-success-light: #f0fdf4;
51
+ }
52
+
53
+ .dark {
54
+ /* Primary foreground for dark mode */
55
+ --color-primary-foreground: #111827;
56
+
57
+ /* Neutral scale - dark mode */
58
+ --color-background: #030712;
59
+ --color-foreground: #f9fafb;
60
+ --color-muted: #9ca3af;
61
+ --color-muted-foreground: #6b7280;
62
+
63
+ /* Surface colors - dark mode */
64
+ --color-surface: #111827;
65
+ --color-surface-raised: #1f2937;
66
+ --color-surface-sunken: #111827;
67
+
68
+ /* Border colors - dark mode */
69
+ --color-border: #374151;
70
+ --color-border-muted: #1f2937;
71
+
72
+ /* Code block colors - dark mode */
73
+ --color-code-bg: #111827;
74
+ --color-code-text: #f3f4f6;
75
+ --color-code-inline-bg: #1f2937;
76
+ --color-code-inline-text: #e5e7eb;
77
+
78
+ /* Semantic colors - dark mode variants */
79
+ --color-info: #60a5fa;
80
+ --color-info-light: rgba(59, 130, 246, 0.15);
81
+ --color-warning: #fbbf24;
82
+ --color-warning-light: rgba(245, 158, 11, 0.15);
83
+ --color-error: #f87171;
84
+ --color-error-light: rgba(239, 68, 68, 0.15);
85
+ --color-success: #4ade80;
86
+ --color-success-light: rgba(34, 197, 94, 0.15);
87
+ }
88
+
89
+ /* ============================================
90
+ BASE STYLES
91
+ ============================================ */
92
+
93
+ html {
94
+ @apply scroll-smooth;
95
+ }
96
+
97
+ body {
98
+ background-color: var(--color-background);
99
+ color: var(--color-foreground);
100
+ @apply antialiased font-sans;
101
+ }
102
+
103
+ /* Prevent text from causing horizontal overflow, but allow scrollable containers */
104
+ main, article, section {
105
+ overflow-wrap: break-word;
106
+ word-wrap: break-word;
107
+ }
108
+
109
+ /* Headings - responsive sizing for mobile */
110
+ /* scroll-margin-top accounts for sticky header */
111
+ article h1 {
112
+ color: var(--color-foreground);
113
+ @apply font-bold tracking-tight mb-3 sm:mb-4;
114
+ font-size: 1.75rem;
115
+ scroll-margin-top: 5rem;
116
+ }
117
+
118
+ @media (min-width: 640px) {
119
+ article h1 {
120
+ font-size: 2.25rem;
121
+ }
122
+ }
123
+
124
+ article h2 {
125
+ color: var(--color-foreground);
126
+ border-color: var(--color-border);
127
+ @apply font-semibold tracking-tight mt-6 sm:mt-8 mb-3 sm:mb-4 pt-4 sm:pt-6 border-t;
128
+ font-size: 1.25rem;
129
+ scroll-margin-top: 5rem;
130
+ }
131
+
132
+ @media (min-width: 640px) {
133
+ article h2 {
134
+ font-size: 1.5rem;
135
+ }
136
+ }
137
+
138
+ /* Remove top border from first h2 after h1 */
139
+ article h1 + h2,
140
+ article > h2:first-child {
141
+ @apply border-t-0 pt-0 mt-4 sm:mt-6;
142
+ }
143
+
144
+ article h3 {
145
+ color: var(--color-foreground);
146
+ @apply font-semibold tracking-tight mt-5 sm:mt-6 mb-2 sm:mb-3;
147
+ font-size: 1.125rem;
148
+ scroll-margin-top: 5rem;
149
+ }
150
+
151
+ @media (min-width: 640px) {
152
+ article h3 {
153
+ font-size: 1.25rem;
154
+ }
155
+ }
156
+
157
+ article h4 {
158
+ color: var(--color-foreground);
159
+ @apply font-semibold mt-4 sm:mt-6 mb-2;
160
+ font-size: 1rem;
161
+ scroll-margin-top: 5rem;
162
+ }
163
+
164
+ @media (min-width: 640px) {
165
+ article h4 {
166
+ font-size: 1.125rem;
167
+ }
168
+ }
169
+
170
+ article h5 {
171
+ color: var(--color-foreground);
172
+ @apply text-base font-semibold mt-4 mb-2;
173
+ scroll-margin-top: 5rem;
174
+ }
175
+
176
+ article h6 {
177
+ color: var(--color-foreground);
178
+ @apply text-sm font-semibold mt-4 mb-2;
179
+ scroll-margin-top: 5rem;
180
+ }
181
+
182
+ /* Global heading defaults (for non-article contexts) */
183
+ h1 {
184
+ color: var(--color-foreground);
185
+ @apply text-2xl font-bold tracking-tight;
186
+ }
187
+
188
+ h2 {
189
+ color: var(--color-foreground);
190
+ @apply text-xl font-semibold tracking-tight;
191
+ }
192
+
193
+ h3 {
194
+ color: var(--color-foreground);
195
+ @apply text-lg font-semibold tracking-tight;
196
+ }
197
+
198
+ /* Prose content - responsive */
199
+ p {
200
+ color: var(--color-muted);
201
+ @apply mb-3 sm:mb-4;
202
+ font-size: 0.9375rem; /* 15px on mobile */
203
+ line-height: 1.7;
204
+ }
205
+
206
+ @media (min-width: 640px) {
207
+ p {
208
+ font-size: 1rem; /* 16px on desktop */
209
+ line-height: 1.75;
210
+ }
211
+ }
212
+
213
+ /* Links - scoped to prose content only */
214
+ article a,
215
+ .prose a {
216
+ color: var(--color-primary);
217
+ @apply no-underline hover:underline;
218
+ }
219
+
220
+ strong {
221
+ color: var(--color-foreground);
222
+ @apply font-semibold;
223
+ }
224
+
225
+ /* Lists - scoped to prose content only to avoid affecting navigation */
226
+ article ul,
227
+ .prose ul {
228
+ @apply list-disc list-inside mb-3 sm:mb-4 space-y-1.5 sm:space-y-2;
229
+ }
230
+
231
+ article ol,
232
+ .prose ol {
233
+ @apply list-decimal list-inside mb-3 sm:mb-4 space-y-1.5 sm:space-y-2;
234
+ }
235
+
236
+ article li,
237
+ .prose li {
238
+ color: var(--color-muted);
239
+ @apply text-[0.9375rem] sm:text-base;
240
+ }
241
+
242
+ /* Code - using Geist Mono, responsive */
243
+ code {
244
+ background-color: var(--color-surface-raised);
245
+ color: var(--color-foreground);
246
+ @apply px-1 sm:px-1.5 py-0.5 rounded text-xs sm:text-sm font-mono;
247
+ }
248
+
249
+ /* Code blocks with Shiki dual theme support - responsive */
250
+ pre {
251
+ background-color: var(--color-surface-raised) !important;
252
+ @apply p-3 sm:p-4 overflow-x-auto font-mono text-xs sm:text-sm;
253
+ max-width: 100%;
254
+ }
255
+
256
+ pre code {
257
+ background-color: transparent !important;
258
+ @apply p-0 text-xs sm:text-sm;
259
+ }
260
+
261
+ /* Inline code should wrap */
262
+ :not(pre) > code {
263
+ @apply break-words;
264
+ }
265
+
266
+ /* Apply light/dark syntax highlighting based on color scheme */
267
+ pre code span {
268
+ color: var(--shiki-light);
269
+ background-color: transparent !important;
270
+ }
271
+
272
+ .dark pre code span {
273
+ color: var(--shiki-dark);
274
+ }
275
+
276
+ /* Standalone pre elements (before JS enhancement) get basic styling */
277
+ pre:not([data-enhanced]) {
278
+ @apply rounded-xl mb-4 border border-[var(--color-border)];
279
+ }
280
+
281
+ /* Blockquotes */
282
+ blockquote {
283
+ border-color: var(--color-border);
284
+ color: var(--color-muted);
285
+ @apply border-l-4 pl-4 italic my-4;
286
+ }
287
+
288
+ /* Horizontal rule */
289
+ hr {
290
+ border-color: var(--color-border);
291
+ @apply my-8;
292
+ }
293
+
294
+ /* Tables - wrapped in scrollable container via JS */
295
+ .table-wrapper {
296
+ @apply overflow-x-auto mb-6 rounded-lg border border-[var(--color-border)];
297
+ max-width: 100%;
298
+ }
299
+
300
+ .table-wrapper table {
301
+ @apply mb-0 border-0 rounded-none;
302
+ }
303
+
304
+ table {
305
+ @apply w-full border-collapse text-sm mb-6 rounded-lg border border-[var(--color-border)];
306
+ }
307
+
308
+ th {
309
+ background-color: var(--color-surface-raised);
310
+ color: var(--color-foreground);
311
+ @apply px-2 py-2 sm:px-4 sm:py-3 text-left font-semibold text-xs sm:text-sm border-b border-[var(--color-border)];
312
+ }
313
+
314
+ th:not(:last-child) {
315
+ @apply border-r border-[var(--color-border)];
316
+ }
317
+
318
+ td {
319
+ color: var(--color-muted);
320
+ @apply px-2 py-2 sm:px-4 sm:py-3 text-xs sm:text-sm border-b border-[var(--color-border)];
321
+ }
322
+
323
+ td:not(:last-child) {
324
+ @apply border-r border-[var(--color-border)];
325
+ }
326
+
327
+ tr:last-child td {
328
+ @apply border-b-0;
329
+ }
330
+
331
+ /* First column code styling */
332
+ td:first-child code {
333
+ @apply text-[var(--color-primary)] font-medium bg-[var(--color-primary-light)];
334
+ }
335
+
336
+ tbody tr:hover td {
337
+ background-color: var(--color-surface-raised);
338
+ }
339
+
340
+ /* Make code in tables smaller */
341
+ td code, th code {
342
+ @apply text-[0.7rem] sm:text-xs px-1 py-0.5;
343
+ }
344
+
345
+ /* Images - prevent overflow */
346
+ img {
347
+ @apply max-w-full h-auto rounded-lg;
348
+ height: auto;
349
+ }
350
+
351
+ /* Prevent long URLs and text from overflowing */
352
+ a {
353
+ word-break: break-word;
354
+ }
355
+ }
356
+
357
+ /* ============================================
358
+ COMPONENT STYLES
359
+ ============================================ */
360
+
361
+ @layer components {
362
+ /* Global overflow prevention for components */
363
+ .api-playground,
364
+ .code-group,
365
+ .card-group,
366
+ .callout,
367
+ .steps-list {
368
+ max-width: 100%;
369
+ overflow-x: auto;
370
+ }
371
+
372
+ /* Anchor links on headings */
373
+ .heading-anchor {
374
+ color: var(--color-muted-foreground);
375
+ @apply opacity-0 ml-2 transition-opacity;
376
+ }
377
+
378
+ .heading-anchor:hover {
379
+ color: var(--color-muted);
380
+ }
381
+
382
+ h1:hover .heading-anchor,
383
+ h2:hover .heading-anchor,
384
+ h3:hover .heading-anchor,
385
+ h4:hover .heading-anchor,
386
+ h5:hover .heading-anchor,
387
+ h6:hover .heading-anchor {
388
+ @apply opacity-100;
389
+ }
390
+
391
+ /* Callout component styles */
392
+ .callout {
393
+ color: var(--color-foreground);
394
+ }
395
+
396
+ .callout p {
397
+ @apply mb-0;
398
+ }
399
+
400
+ .callout code {
401
+ @apply bg-white/50 dark:bg-black/20;
402
+ }
403
+
404
+ /* Code group component styles */
405
+ .code-group pre {
406
+ @apply m-0 rounded-none border-0;
407
+ background-color: transparent !important;
408
+ }
409
+
410
+ .code-group-tab {
411
+ @apply focus:outline-none focus-visible:text-[var(--color-primary)];
412
+ }
413
+
414
+ /* Code group panel visibility for slotted pre elements */
415
+ /* Handle both direct children and nested pre elements (MDX may wrap them) */
416
+ .code-group .panels > pre:not(:first-child),
417
+ .code-group .panels pre:not(:first-of-type) {
418
+ @apply hidden; /* Hide non-first panels by default (prevents flash before JS) */
419
+ }
420
+
421
+ .code-group .panels > pre[data-active="true"],
422
+ .code-group .panels pre[data-active="true"] {
423
+ @apply block;
424
+ }
425
+
426
+ .code-group .panels > pre[data-active="false"],
427
+ .code-group .panels pre[data-active="false"] {
428
+ @apply hidden;
429
+ }
430
+
431
+ /* Tabs component styles - visibility for slotted tab panels */
432
+ .tabs-panels > .tab-panel:not(:first-child) {
433
+ @apply hidden; /* Hide non-first panels by default (prevents flash before JS) */
434
+ }
435
+
436
+ .tabs-panels > .tab-panel[data-active="true"] {
437
+ @apply block;
438
+ }
439
+
440
+ .tabs-panels > .tab-panel[data-active="false"] {
441
+ @apply hidden;
442
+ }
443
+
444
+ /* Card group styles - responsive grid */
445
+ .card-group {
446
+ display: grid;
447
+ grid-template-columns: 1fr;
448
+ gap: 1rem;
449
+ margin: 1.5rem 0;
450
+ }
451
+
452
+ @media (min-width: 640px) {
453
+ .card-group {
454
+ grid-template-columns: repeat(2, 1fr);
455
+ }
456
+ }
457
+
458
+ @media (min-width: 1024px) {
459
+ .card-group[data-cols="3"] {
460
+ grid-template-columns: repeat(3, 1fr);
461
+ }
462
+ }
463
+
464
+ .card-group .card {
465
+ margin: 0;
466
+ }
467
+
468
+ /* Card component styles */
469
+ .card {
470
+ margin-bottom: 1rem;
471
+ }
472
+
473
+ a.card,
474
+ div.card {
475
+ @apply text-inherit no-underline;
476
+ }
477
+
478
+ a.card:hover {
479
+ @apply no-underline;
480
+ }
481
+
482
+ a.card h4,
483
+ a.card p {
484
+ @apply no-underline;
485
+ }
486
+
487
+ .card:hover .card-title {
488
+ color: var(--color-primary);
489
+ }
490
+
491
+ /* Steps component styles */
492
+ .steps-list {
493
+ counter-reset: step-counter;
494
+ }
495
+
496
+ .steps-list h3,
497
+ .steps-list h4,
498
+ .steps-list h5,
499
+ .steps-list h6 {
500
+ color: var(--color-foreground);
501
+ @apply relative font-bold text-lg mt-0 pb-2;
502
+ counter-increment: step-counter;
503
+ }
504
+
505
+ .steps-list h3::before,
506
+ .steps-list h4::before,
507
+ .steps-list h5::before,
508
+ .steps-list h6::before {
509
+ content: counter(step-counter);
510
+ background-color: var(--color-primary);
511
+ color: var(--color-primary-foreground);
512
+ @apply absolute -left-12 top-0 w-8 h-8 flex items-center justify-center text-sm font-semibold rounded-full z-10;
513
+ }
514
+
515
+ /* Remove step numbers from headings inside nested components */
516
+ .steps-list .card h3::before,
517
+ .steps-list .card h4::before,
518
+ .steps-list .card-group h3::before,
519
+ .steps-list .card-group h4::before,
520
+ .steps-list .callout h3::before,
521
+ .steps-list .callout h4::before,
522
+ .steps-list .tabs-container h3::before,
523
+ .steps-list .tabs-container h4::before,
524
+ .steps-list .code-group h3::before,
525
+ .steps-list .code-group h4::before {
526
+ @apply hidden;
527
+ content: none;
528
+ }
529
+
530
+ .steps-list .card h3,
531
+ .steps-list .card h4,
532
+ .steps-list .card-group h3,
533
+ .steps-list .card-group h4,
534
+ .steps-list .callout h3,
535
+ .steps-list .callout h4 {
536
+ counter-increment: none;
537
+ }
538
+
539
+ .steps-list p {
540
+ color: var(--color-muted);
541
+ @apply mb-6 mt-0;
542
+ }
543
+
544
+ .steps-list pre,
545
+ .steps-list ul,
546
+ .steps-list ol {
547
+ @apply mb-6;
548
+ }
549
+
550
+ .steps-list p code,
551
+ .steps-list li code {
552
+ background-color: var(--color-code-inline-bg);
553
+ color: var(--color-code-inline-text);
554
+ @apply px-1.5 py-0.5 rounded text-sm;
555
+ }
556
+
557
+ /* Sidebar navigation styles */
558
+ .sidebar-nav ul {
559
+ @apply list-none m-0 p-0 space-y-1;
560
+ }
561
+
562
+ .sidebar-nav li {
563
+ @apply list-none m-0 p-0;
564
+ }
565
+
566
+ /* Table of Contents navigation styles */
567
+ .toc-nav ul {
568
+ @apply list-none m-0 p-0;
569
+ }
570
+
571
+ .toc-nav li {
572
+ @apply list-none m-0 p-0;
573
+ }
574
+
575
+ .toc-link {
576
+ @apply no-underline;
577
+ }
578
+
579
+ .toc-link.active {
580
+ color: var(--color-primary);
581
+ border-left-color: var(--color-primary);
582
+ background-color: var(--color-primary-light);
583
+ }
584
+
585
+ .toc-link:hover:not(.active) {
586
+ color: var(--color-foreground);
587
+ background-color: var(--color-surface-raised);
588
+ }
589
+
590
+ /* Search component styles */
591
+ .search-trigger {
592
+ @apply cursor-pointer;
593
+ }
594
+
595
+ .search-trigger:focus {
596
+ --tw-ring-color: var(--color-primary);
597
+ @apply outline-none ring-2 ring-offset-2;
598
+ }
599
+
600
+ .search-modal {
601
+ @apply opacity-0 invisible;
602
+ transition: opacity 0.15s ease, visibility 0.15s ease;
603
+ }
604
+
605
+ .search-modal.open {
606
+ @apply opacity-100 visible;
607
+ }
608
+
609
+ /* Pagefind UI customizations to match docs theme */
610
+ .pagefind-ui-container {
611
+ --pagefind-ui-scale: 1;
612
+ --pagefind-ui-primary: var(--color-primary);
613
+ --pagefind-ui-text: var(--color-foreground);
614
+ --pagefind-ui-background: var(--color-surface);
615
+ --pagefind-ui-border: var(--color-border);
616
+ --pagefind-ui-tag: var(--color-surface-sunken);
617
+ --pagefind-ui-border-width: 1px;
618
+ --pagefind-ui-border-radius: 8px;
619
+ --pagefind-ui-image-border-radius: 8px;
620
+ --pagefind-ui-image-box-ratio: 3 / 2;
621
+ --pagefind-ui-font: inherit;
622
+ }
623
+
624
+ /* Pagefind search input */
625
+ .pagefind-ui .pagefind-ui__search-input {
626
+ border-color: var(--color-border);
627
+ @apply px-5 py-4 text-base border-0 border-b rounded-none bg-transparent outline-none;
628
+ }
629
+
630
+ .pagefind-ui .pagefind-ui__search-input:focus {
631
+ @apply outline-none shadow-none;
632
+ }
633
+
634
+ /* Pagefind search clear button */
635
+ .pagefind-ui .pagefind-ui__search-clear {
636
+ color: var(--color-muted-foreground);
637
+ @apply right-4;
638
+ }
639
+
640
+ .pagefind-ui .pagefind-ui__search-clear:hover {
641
+ color: var(--color-muted);
642
+ }
643
+
644
+ /* Pagefind results container */
645
+ .pagefind-ui .pagefind-ui__results-area {
646
+ max-height: calc(70vh - 80px);
647
+ @apply overflow-y-auto p-2;
648
+ }
649
+
650
+ /* Pagefind individual results */
651
+ .pagefind-ui .pagefind-ui__result {
652
+ @apply px-4 py-3 my-1 rounded-lg border border-transparent;
653
+ }
654
+
655
+ .pagefind-ui .pagefind-ui__result:hover {
656
+ background-color: var(--color-surface-raised);
657
+ border-color: var(--color-border);
658
+ }
659
+
660
+ .pagefind-ui .pagefind-ui__result-link {
661
+ @apply no-underline block;
662
+ }
663
+
664
+ .pagefind-ui .pagefind-ui__result-title {
665
+ color: var(--color-foreground);
666
+ @apply font-semibold text-[0.95rem] mb-1;
667
+ }
668
+
669
+ .pagefind-ui .pagefind-ui__result-excerpt {
670
+ color: var(--color-muted);
671
+ @apply text-sm leading-relaxed;
672
+ }
673
+
674
+ .pagefind-ui .pagefind-ui__result-excerpt mark {
675
+ @apply bg-yellow-200 dark:bg-yellow-500/30 text-inherit px-0.5 rounded-sm;
676
+ }
677
+
678
+ /* Pagefind form element */
679
+ .pagefind-ui .pagefind-ui__form {
680
+ @apply relative;
681
+ }
682
+
683
+ /* Pagefind message styling */
684
+ .pagefind-ui .pagefind-ui__message {
685
+ color: var(--color-muted);
686
+ @apply py-8 text-center text-sm;
687
+ }
688
+
689
+ /* Pagefind loading indicator */
690
+ .pagefind-ui .pagefind-ui__loading {
691
+ color: var(--color-muted-foreground);
692
+ @apply py-8 text-center;
693
+ }
694
+
695
+ /* Pagefind drawer styles */
696
+ .pagefind-ui .pagefind-ui__drawer {
697
+ @apply p-0 m-0 gap-0;
698
+ }
699
+
700
+ .pagefind-ui .pagefind-ui__search-input::placeholder {
701
+ color: var(--color-muted-foreground);
702
+ }
703
+ }