@knitli/docs-components 1.0.2 → 1.0.3

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.
package/package.json CHANGED
@@ -49,5 +49,5 @@
49
49
  },
50
50
  "type": "module",
51
51
  "types": "./dist/index.d.ts",
52
- "version": "1.0.2"
52
+ "version": "1.0.3"
53
53
  }
@@ -1,27 +1,6 @@
1
1
  ---
2
- // SPDX-FileCopyrightText: 2025 Knitli Inc.
3
- // SPDX-FileContributor: Adam Poulemanos <adam@knit.li>
4
- //
5
- // SPDX-License-Identifier: MIT OR Apache-2.0
6
- //
7
- // Main branded header for Knitli documentation sites
8
- // Provides navigation, branding, and breadcrumb support
9
-
10
- interface Props {
11
- currentProduct?: 'ReCoco' | 'CodeWeaver' | 'Thread';
12
- currentPath?: string;
13
- productUrl?: string;
14
- showBreadcrumb?: boolean;
15
- variant?: 'default' | 'minimal';
16
- }
17
-
18
- const {
19
- currentProduct,
20
- currentPath = '',
21
- productUrl = '',
22
- showBreadcrumb = true,
23
- variant = 'default',
24
- } = Astro.props;
2
+ // Custom header with actual Knitli logo
3
+ const { pathname } = Astro.url;
25
4
 
26
5
  // Environment-aware URL configuration
27
6
  const isDev = import.meta.env.DEV;
@@ -43,49 +22,29 @@ const getSiteUrls = () => {
43
22
  };
44
23
 
45
24
  const urls = getSiteUrls();
46
- const isDocsHome = currentPath === '/' || currentPath === '';
47
- const shouldShowBreadcrumb = showBreadcrumb && !isDocsHome && currentProduct;
25
+ const isDocsHome = pathname === '/' || pathname === '';
26
+ const shouldShowBreadcrumb = !isDocsHome;
27
+
48
28
  ---
49
29
 
50
- <header class:list={['docs-header', { minimal: variant === 'minimal' }]}>
30
+ <header class="docs-header">
51
31
  <div class="docs-header-content">
52
32
  <!-- Knitli Logo + Docs Section -->
53
33
  <a href={urls.marketing} class="docs-logo" aria-label="Knitli home">
54
- <svg class="logo-icon" width="32" height="32" viewBox="0 0 100 100" fill="none" aria-hidden="true">
55
- <!-- Simplified Knitli knot icon -->
56
- <circle cx="50" cy="50" r="35" fill="var(--docs-copper)" opacity="0.15"/>
57
- <path
58
- d="M50 20 L50 50 L65 50"
59
- stroke="var(--docs-slate)"
60
- stroke-width="4"
61
- fill="none"
62
- stroke-linecap="round"
63
- stroke-linejoin="round"
64
- />
65
- <path
66
- d="M35 50 L50 50 L50 80"
67
- stroke="var(--docs-slate)"
68
- stroke-width="4"
69
- fill="none"
70
- stroke-linecap="round"
71
- stroke-linejoin="round"
72
- />
73
- <circle cx="50" cy="50" r="6" fill="var(--docs-copper)"/>
74
- </svg>
34
+ <img src={`${import.meta.env.BASE_URL}/knitli-logo.svg`} alt="Knitli" class="logo-icon" />
75
35
  <span class="logo-text">
76
- <span class="logo-brand">Knitli</span>
77
36
  <span class="logo-separator">/</span>
78
37
  <span class="logo-section">docs</span>
79
38
  </span>
80
39
  </a>
81
40
 
82
- <!-- Breadcrumb (if not on docs home and product specified) -->
41
+ <!-- Breadcrumb -->
83
42
  {shouldShowBreadcrumb && (
84
43
  <nav class="docs-breadcrumb" aria-label="Breadcrumb">
85
44
  <a href="/">Documentation</a>
86
45
  <span class="breadcrumb-separator" aria-hidden="true">→</span>
87
- <a href={productUrl || `/${currentProduct}`} class="breadcrumb-product">
88
- {currentProduct}
46
+ <a href="/ReCoco" class="breadcrumb-product">
47
+ ReCoco
89
48
  </a>
90
49
  </nav>
91
50
  )}
@@ -122,28 +81,13 @@ const shouldShowBreadcrumb = showBreadcrumb && !isDocsHome && currentProduct;
122
81
  </header>
123
82
 
124
83
  <style>
125
- :root {
126
- --docs-copper: oklch(0.58 0.08 50); /* #b56c30 */
127
- --docs-slate: oklch(0.35 0.02 240); /* #485563 */
128
- --docs-parchment: oklch(0.96 0.015 70);
129
- }
130
-
131
84
  .docs-header {
132
- background: var(--docs-parchment);
133
- border-bottom: 1px solid oklch(0.85 0.01 50);
85
+ background: white;
86
+ border-bottom: 1px solid #e5e7eb;
87
+ border-radius: 0 0 6px 2px; /* Chamfered bottom corners only */
134
88
  position: sticky;
135
89
  top: 0;
136
90
  z-index: 100;
137
-
138
- /* Copper accent line */
139
- box-shadow:
140
- inset 0 -2px 0 var(--docs-copper),
141
- 0 1px 3px rgba(0, 0, 0, 0.05);
142
- }
143
-
144
- .docs-header.minimal {
145
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
146
- border-bottom: 1px solid oklch(0.90 0.01 60);
147
91
  }
148
92
 
149
93
  .docs-header-content {
@@ -158,7 +102,7 @@ const shouldShowBreadcrumb = showBreadcrumb && !isDocsHome && currentProduct;
158
102
  .docs-logo {
159
103
  display: flex;
160
104
  align-items: center;
161
- gap: 0.75rem;
105
+ gap: 0.5rem;
162
106
  text-decoration: none;
163
107
  transition: opacity 0.2s ease;
164
108
  }
@@ -168,48 +112,45 @@ const shouldShowBreadcrumb = showBreadcrumb && !isDocsHome && currentProduct;
168
112
  }
169
113
 
170
114
  .logo-icon {
115
+ height: 32px;
116
+ width: auto;
171
117
  flex-shrink: 0;
172
118
  }
173
119
 
174
120
  .logo-text {
175
- font-family: "DM Mono", "Roboto Mono", "Courier New", monospace;
121
+ font-family: system-ui, -apple-system, sans-serif;
176
122
  font-size: 1.125rem;
177
123
  font-weight: 600;
178
124
  line-height: 1;
179
- }
180
-
181
- .logo-brand {
182
- color: var(--docs-slate);
125
+ color: #374151;
183
126
  }
184
127
 
185
128
  .logo-separator {
186
- color: var(--docs-copper);
187
- opacity: 0.5;
188
- margin: 0 0.25rem;
129
+ color: #9ca3af;
130
+ margin: 0 0.5rem;
189
131
  }
190
132
 
191
133
  .logo-section {
192
- color: var(--docs-copper);
134
+ color: #6b7280;
193
135
  }
194
136
 
195
137
  .docs-breadcrumb {
196
138
  display: flex;
197
139
  align-items: center;
140
+ align-self: flex-end;
198
141
  gap: 0.5rem;
199
- font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
200
142
  font-size: 0.875rem;
201
- color: var(--docs-slate);
202
- opacity: 0.7;
143
+ color: #6b7280;
203
144
  }
204
145
 
205
146
  .docs-breadcrumb a {
206
147
  color: inherit;
207
148
  text-decoration: none;
208
- transition: opacity 0.2s ease;
149
+ transition: color 0.2s ease;
209
150
  }
210
151
 
211
152
  .docs-breadcrumb a:hover {
212
- opacity: 1;
153
+ color: #111827;
213
154
  text-decoration: underline;
214
155
  }
215
156
 
@@ -219,7 +160,7 @@ const shouldShowBreadcrumb = showBreadcrumb && !isDocsHome && currentProduct;
219
160
 
220
161
  .breadcrumb-product {
221
162
  font-weight: 500;
222
- opacity: 1;
163
+ color: #111827;
223
164
  }
224
165
 
225
166
  .spacer {
@@ -233,33 +174,20 @@ const shouldShowBreadcrumb = showBreadcrumb && !isDocsHome && currentProduct;
233
174
  }
234
175
 
235
176
  .docs-nav a {
236
- font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
237
177
  font-size: 0.9375rem;
238
- color: var(--docs-slate);
178
+ color: #374151;
239
179
  text-decoration: none;
240
180
  position: relative;
241
181
  padding: 0.25rem 0;
242
182
  transition: color 0.2s ease;
243
183
  }
244
184
 
245
- .docs-nav a::after {
246
- content: '';
247
- position: absolute;
248
- bottom: 0;
249
- left: 0;
250
- width: 0;
251
- height: 1px;
252
- background: var(--docs-copper);
253
- transition: width 0.2s ease;
254
- }
255
-
256
- .docs-nav a:hover::after,
257
- .docs-nav a.active::after {
258
- width: 100%;
185
+ .docs-nav a:hover {
186
+ color: #111827;
259
187
  }
260
188
 
261
189
  .docs-nav a.active {
262
- color: var(--docs-copper);
190
+ color: #111827;
263
191
  font-weight: 500;
264
192
  }
265
193
 
@@ -285,7 +213,6 @@ const shouldShowBreadcrumb = showBreadcrumb && !isDocsHome && currentProduct;
285
213
  .docs-breadcrumb {
286
214
  order: 3;
287
215
  width: 100%;
288
- padding-left: 0;
289
216
  }
290
217
 
291
218
  .spacer {
@@ -297,32 +224,8 @@ const shouldShowBreadcrumb = showBreadcrumb && !isDocsHome && currentProduct;
297
224
  font-size: 0.875rem;
298
225
  }
299
226
 
300
- .logo-text {
301
- font-size: 1rem;
302
- }
303
- }
304
-
305
- /* Tablet */
306
- @media (min-width: 769px) and (max-width: 1024px) {
307
- .docs-nav {
308
- gap: 1.5rem;
309
- }
310
- }
311
-
312
- /* Accessibility */
313
- .docs-logo:focus-visible,
314
- .docs-nav a:focus-visible,
315
- .docs-breadcrumb a:focus-visible {
316
- outline: 3px solid var(--docs-copper);
317
- outline-offset: 4px;
318
- border-radius: 4px;
319
- }
320
-
321
- /* Reduced motion */
322
- @media (prefers-reduced-motion: reduce) {
323
- * {
324
- animation-duration: 0.01ms !important;
325
- transition-duration: 0.01ms !important;
227
+ .logo-icon {
228
+ height: 28px;
326
229
  }
327
230
  }
328
231
  </style>