@docubook/create 1.15.0 → 1.15.1

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docubook/create",
3
- "version": "1.15.0",
3
+ "version": "1.15.1",
4
4
  "description": "CLI to create DocuBook projects",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -26,5 +26,6 @@
26
26
  "figlet": "^1.8.0",
27
27
  "ora": "^8.1.0",
28
28
  "prompts": "^2.4.2"
29
- }
29
+ },
30
+ "packageManager": "yarn@4.9.2+sha512.1fc009bc09d13cfd0e19efa44cbfc2b9cf6ca61482725eb35bbc5e257e093ebf4130db6dfe15d604ff4b79efd8e1e8e99b25fa7d0a6197c9f9826358d4d65c3c"
30
31
  }
@@ -7,7 +7,6 @@ import { Footer } from "@/components/footer";
7
7
  import docuConfig from "@/docu.json";
8
8
  import { Toaster } from "@/components/ui/sonner";
9
9
  import "@/styles/globals.css";
10
- import "@/styles/algolia.css";
11
10
 
12
11
  const { meta } = docuConfig;
13
12
 
@@ -25,7 +25,7 @@ export default function Home() {
25
25
  )}
26
26
  >
27
27
  <AnimatedShinyText className="inline-flex items-center justify-center px-4 py-1 transition ease-out hover:text-neutral-100 hover:duration-300 hover:dark:text-neutral-200">
28
- <span>🚀 New Version - Release v1.15.0</span>
28
+ <span>🚀 New Version - Release v1.15.1</span>
29
29
  <ArrowRightIcon className="ml-1 size-3 transition-transform duration-300 ease-in-out group-hover:translate-x-0.5" />
30
30
  </AnimatedShinyText>
31
31
  </div>
@@ -2,7 +2,6 @@
2
2
 
3
3
  import React from "react";
4
4
  import { DocSearch } from "@docsearch/react";
5
- import "@docsearch/css";
6
5
 
7
6
  export default function DocSearchComponent() {
8
7
  const appId = process.env.NEXT_PUBLIC_ALGOLIA_DOCSEARCH_APP_ID;
@@ -9,10 +9,10 @@ date: 02-08-2025
9
9
  </Note>
10
10
 
11
11
  <div className="sr-only">
12
- ### v 1.15.0
12
+ ### v 1.15.1
13
13
  </div>
14
14
 
15
- <Release version="1.15.0" date="2025-08-06" title="Algolia DocSearch for better search result">
15
+ <Release version="1.15.1" date="2025-08-06" title="Algolia DocSearch for better search result">
16
16
  <Changes type="added">
17
17
  - new DocSearch.tsx components
18
18
  - add props type algolia
@@ -29,6 +29,12 @@ NEXT_PUBLIC_ALGOLIA_DOCSEARCH_APP_ID="your_app_id"
29
29
  NEXT_PUBLIC_ALGOLIA_DOCSEARCH_API_KEY="your_api_key"
30
30
  NEXT_PUBLIC_ALGOLIA_DOCSEARCH_INDEX_NAME="your_index_name"
31
31
  ```
32
+
33
+ in the navbar component, add a prop to the class
34
+
35
+ ```
36
+ Change <Search /> to <Search type="algolia" />
37
+ ```
32
38
  </Note>
33
39
 
34
40
  <div className="sr-only">
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docubook",
3
- "version": "1.15.0",
3
+ "version": "1.15.1",
4
4
  "private": true,
5
5
  "scripts": {
6
6
  "dev": "next dev",
@@ -1,44 +1,67 @@
1
1
  /*
2
2
  ================================================================================
3
- DocSearch Component Styling (Themed Version)
4
- - This version uses the CSS variables defined in :root and .dark
5
- to automatically adapt to your site's light and dark themes.
3
+ DocSearch Component Styling (Refactored Version)
6
4
  ================================================================================
7
5
  */
8
- .docsearch {
9
- /* Map theme variables to DocSearch's internal variables */
6
+
7
+ /* -- LANGKAH 1: Definisi Variabel Global --
8
+ Variabel tema DocSearch sekarang didefinisikan secara global di :root.
9
+ Ini menyederhanakan pewarisan tema dan memastikan konsistensi.
10
+ Mode gelap secara otomatis menimpa variabel ini karena .dark di globals.css.
11
+ */
12
+ :root {
10
13
  --docsearch-primary-color: hsl(var(--primary));
11
- --docsearch-text-color: hsl(var(--foreground));
12
- --docsearch-container-background: hsla(var(--background) / 0.8); /* Use theme background with transparency */
13
- --docsearch-modal-background: hsl(var(--card)); /* Modals should use card color */
14
- --docsearch-modal-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
15
- --docsearch-searchbox-background: hsl(var(--secondary));
16
- --docsearch-searchbox-focus-background: hsl(var(--secondary));
14
+ --docsearch-text-color: hsl(var(--muted-foreground));
15
+ --docsearch-spacing: 12px;
16
+ --docsearch-icon-stroke-width: 1.4;
17
+ --docsearch-highlight-color: var(--docsearch-primary-color);
18
+ --docsearch-muted-color: hsl(var(--muted-foreground));
19
+ --docsearch-container-background: rgba(0, 0, 0, 0.7);
20
+ --docsearch-logo-color: hsl(var(--primary-foreground));
21
+
22
+ /* Modal */
23
+ --docsearch-modal-width: 560px;
24
+ --docsearch-modal-height: 600px;
25
+ --docsearch-modal-background: hsl(var(--background));
26
+ --docsearch-modal-shadow: 0 0 0 1px hsl(var(--border)), 0 8px 20px rgba(0, 0, 0, 0.2);
27
+
28
+ /* SearchBox */
29
+ --docsearch-searchbox-height: 56px;
30
+ --docsearch-searchbox-background: hsl(var(--input));
31
+ --docsearch-searchbox-focus-background: hsl(var(--card));
32
+ --docsearch-searchbox-shadow: none;
33
+
34
+ /* Hit (Hasil Pencarian) */
35
+ --docsearch-hit-height: 56px;
17
36
  --docsearch-hit-color: hsl(var(--foreground));
37
+ --docsearch-hit-active-color: hsl(var(--primary-foreground));
18
38
  --docsearch-hit-background: hsl(var(--card));
19
39
  --docsearch-hit-shadow: none;
20
- --docsearch-hit-active-color: hsl(var(--primary-foreground));
21
- --docsearch-selected-background: hsl(var(--secondary)); /* Use secondary for selection */
22
- --docsearch-footer-background: hsl(var(--card));
23
- --docsearch-footer-shadow: inset 0 1px 0 0 hsl(var(--border));
24
- --docsearch-key-gradient: transparent;
40
+
41
+ /* Keys */
42
+ --docsearch-key-gradient: none;
25
43
  --docsearch-key-shadow: none;
26
- --docsearch-muted-color: hsl(var(--muted-foreground)); /* Use muted for less important text */
44
+ --docsearch-key-pressed-shadow: none;
45
+
46
+ /* Footer */
47
+ --docsearch-footer-height: 44px;
48
+ --docsearch-footer-background: hsl(var(--background));
49
+ --docsearch-footer-shadow: none;
27
50
  }
28
51
 
29
- /*
30
- * =====================================
31
- * 1. Initial Search Button Styling
32
- * =====================================
33
- */
52
+ /* -- LANGKAH 2: Gaya untuk Tombol Awal --
53
+ Gaya ini spesifik untuk tombol yang ada di Navbar,
54
+ yang dibungkus oleh <div class="docsearch">.
55
+ */
34
56
  .docsearch .DocSearch-Button {
35
- background-color: hsl(var(--secondary)); /* Use secondary for the button background */
36
- border: 1px solid hsl(var(--border)); /* Use the standard border color */
37
- border-radius: 9999px; /* Pill shape */
38
- width: 160px; /* Lebar default untuk desktop */
57
+ background-color: hsl(var(--secondary));
58
+ border: 1px solid hsl(var(--border));
59
+ border-radius: 9999px;
60
+ width: 160px;
39
61
  height: 40px;
40
- color: hsl(var(--muted-foreground)); /* Use muted text color for the placeholder */
41
- transition: width 0.3s ease; /* Transisi untuk perubahan lebar */
62
+ color: hsl(var(--muted-foreground));
63
+ transition: width 0.3s ease;
64
+ margin: 0;
42
65
  }
43
66
 
44
67
  .docsearch .DocSearch-Button:hover {
@@ -46,21 +69,24 @@
46
69
  box-shadow: none;
47
70
  }
48
71
 
49
- /* Magnifying glass icon */
50
72
  .docsearch .DocSearch-Search-Icon {
51
- color: hsl(var(--muted-foreground));
73
+ color: var(--docsearch-muted-color);
74
+ width: 1rem;
75
+ height: 1rem;
52
76
  }
53
77
 
54
- /* The 'Search' placeholder text */
55
78
  .docsearch .DocSearch-Button-Placeholder {
56
79
  font-style: normal;
80
+ margin-left: 0.25rem;
81
+ font-size: 0.875rem;
82
+ line-height: 1.25rem;
83
+ color: var(--docsearch-muted-color);
57
84
  }
58
85
 
59
- /* Styling for the '⌘K' keys */
60
86
  .docsearch .DocSearch-Button-Key {
61
- background: hsl(var(--primary)); /* Use primary color for the key background */
87
+ background: var(--docsearch-primary-color);
88
+ color: var(--docsearch-logo-color); /* Menggunakan variabel yg relevan */
62
89
  border-radius: 6px;
63
- color: hsl(var(--primary-foreground)); /* Use primary-foreground for the key text */
64
90
  font-size: 14px;
65
91
  font-weight: 500;
66
92
  height: 24px;
@@ -70,85 +96,65 @@
70
96
  top: 0;
71
97
  }
72
98
 
73
-
74
- /*
75
- * =====================================
76
- * 2. Modal and Results Styling
77
- * =====================================
78
- */
79
-
80
- /* Main modal window */
81
- .docsearch .DocSearch-Modal {
99
+ /* -- LANGKAH 3: Gaya untuk Modal dan Isinya --
100
+ Gaya ini menargetkan elemen-elemen modal yang dirender terpisah.
101
+ Karena variabel sudah global, kita hanya perlu menata elemennya.
102
+ */
103
+ .DocSearch-Container .DocSearch-Modal {
82
104
  backdrop-filter: blur(8px);
83
105
  }
84
106
 
85
- .docsearch .DocSearch-Container {
86
- box-shadow: var(--docsearch-modal-shadow);
87
- }
88
-
89
- /* Search input form */
90
- .docsearch .DocSearch-Form {
107
+ .DocSearch-Form {
91
108
  border: 1px solid hsl(var(--border));
92
- box-shadow: none;
93
109
  background-color: transparent;
94
110
  }
95
111
 
96
- /* The 'Return' and 'Esc' hints */
97
- .docsearch .DocSearch-Reset-Icon,
98
- .docsearch .DocSearch-Cancel {
99
- color: hsl(var(--muted-foreground));
100
- }
101
-
102
- /* Style for each search result item */
103
- .docsearch .DocSearch-Hit a {
104
- border-radius: 4px;
112
+ .DocSearch-Input {
113
+ font-size: 15px !important;
105
114
  }
106
115
 
107
- /* Selected search result */
108
- .docsearch .DocSearch-Hit[aria-selected="true"] a {
109
- background: var(--docsearch-selected-background); /* Highlight color for selected item */
116
+ .DocSearch-Footer {
117
+ border-top: 1px solid hsl(var(--border));
110
118
  }
111
119
 
112
- /* Hide category headers if not needed */
113
- .docsearch .DocSearch-Hit-source {
114
- display: none;
120
+ /* Gaya untuk tombol keyboard di footer */
121
+ .DocSearch-Footer--commands kbd {
122
+ background-color: hsl(var(--secondary));
123
+ border: 1px solid hsl(var(--border));
124
+ border-bottom-width: 2px;
125
+ border-radius: 6px;
126
+ color: var(--docsearch-muted-color);
127
+ padding: 4px 8px;
128
+ display: flex;
129
+ align-items: center;
130
+ justify-content: center;
115
131
  }
116
132
 
117
- /* Icon next to each result title */
118
- .docsearch .DocSearch-Hit-icon {
133
+ /* Menghilangkan gaya default dari ikon di dalam tombol footer */
134
+ .DocSearch-Commands-Key {
135
+ background: none;
119
136
  color: hsl(var(--muted-foreground));
120
- }
121
-
122
- /* Footer instructions ('to navigate', 'to select', etc.) */
123
- .docsearch .DocSearch-Footer {
124
- border-top: 1px solid hsl(var(--border));
125
- }
126
-
127
- .docsearch .DocSearch-Footer--commands kbd {
128
- background: hsl(var(--muted)); /* Use muted for the background of keyboard hints */
129
137
  border: 1px solid hsl(var(--border));
130
- border-radius: 4px;
131
- color: hsl(var(--muted-foreground));
138
+ box-shadow: none;
139
+ padding: 2px 4px;
140
+ margin-right: 0.4em;
141
+ height: 20px;
142
+ width: 32px;
143
+ border-radius: 6px;
132
144
  }
133
145
 
134
- /*
135
- * =====================================
136
- * 3. Responsive Styling (Mobile)
137
- * =====================================
138
- */
146
+ /* -- LANGKAH 4: Gaya Responsif --
147
+ Tidak ada perubahan, hanya mempertahankan fungsionalitas mobile.
148
+ */
139
149
  @media (max-width: 768px) {
140
- /* Aturan ini akan aktif pada layar 768px ke bawah */
141
-
142
150
  .docsearch .DocSearch-Button {
143
- width: 40px; /* Mengubah lebar tombol menjadi seukuran ikon */
144
- height: 40px; /* Memastikan tinggi tetap sama */
145
- padding: 0; /* Menghapus padding agar ikon bisa di tengah */
146
- justify-content: center; /* Memusatkan ikon di dalam tombol */
151
+ width: 40px;
152
+ height: 40px;
153
+ padding: 0;
154
+ justify-content: center;
147
155
  background: none;
148
156
  border: none;
149
157
  }
150
-
151
- /* Menyembunyikan teks "Search..." dan shortcut keyboard */
152
158
  .docsearch .DocSearch-Button-Placeholder,
153
159
  .docsearch .DocSearch-Button-Key {
154
160
  display: none;
@@ -1,9 +1,11 @@
1
+ @import "@docsearch/css";
2
+ @import "./algolia.css";
3
+
1
4
  @tailwind base;
2
5
  @tailwind components;
3
6
  @tailwind utilities;
4
7
 
5
- @import url("../styles/syntax.css");
6
-
8
+ @import url("./syntax.css");
7
9
  /* Modern Blue Theme */
8
10
  @layer base {
9
11
  :root {
@@ -136,4 +138,4 @@ pre>code {
136
138
  background-position: 0% 0%;
137
139
  }
138
140
  }
139
- }
141
+ }