note-blog-kit 0.0.0-stage → 0.1.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.
@@ -0,0 +1,218 @@
1
+ /*
2
+ * note-blog-kit のデフォルト CSS(任意)。import 'note-blog-kit/styles.css' で読み込む。
3
+ *
4
+ * - すべてのルールは @layer note-blog-kit の中にある。レイヤーに入っていない利用者の CSS はこれより優先される
5
+ * (利用者がレイヤーを使っている場合の順序は README を参照)
6
+ * - 色・フォント・余白などは --nbk-* 変数で上書きできる(:root や任意の親要素で指定する)
7
+ * - セレクタは :root と nbk- から始まるクラス名だけを使い、サイトの他の要素には影響しない
8
+ */
9
+ @layer note-blog-kit {
10
+ :root {
11
+ --nbk-font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", meiryo, sans-serif;
12
+ --nbk-color-text: #08131a;
13
+ --nbk-color-muted: #6e7b85;
14
+ --nbk-color-accent: #41c9b4;
15
+ --nbk-color-border: #e6e6e6;
16
+ --nbk-color-placeholder: #f2f2f2;
17
+ /* カードの背景。既定は透明(ページの背景色をそのまま使う) */
18
+ --nbk-color-surface: transparent;
19
+ --nbk-color-badge-bg: #08131a;
20
+ --nbk-color-badge-text: #fff;
21
+ --nbk-radius: 8px;
22
+ --nbk-list-gap: 24px;
23
+ --nbk-card-min-width: 280px;
24
+ }
25
+
26
+ /* 一覧 */
27
+ .nbk-article-list {
28
+ display: grid;
29
+ grid-template-columns: repeat(auto-fill, minmax(min(var(--nbk-card-min-width), 100%), 1fr));
30
+ gap: var(--nbk-list-gap);
31
+ margin: 0;
32
+ padding: 0;
33
+ list-style: none;
34
+ font-family: var(--nbk-font-family);
35
+ color: var(--nbk-color-text);
36
+ }
37
+
38
+ .nbk-article-list__item {
39
+ display: flex;
40
+ min-width: 0;
41
+ }
42
+
43
+ .nbk-article-list--empty {
44
+ display: block;
45
+ }
46
+
47
+ .nbk-article-list__empty {
48
+ margin: 0;
49
+ padding: calc(var(--nbk-list-gap) * 2) 0;
50
+ color: var(--nbk-color-muted);
51
+ font-size: 0.875rem;
52
+ text-align: center;
53
+ }
54
+
55
+ /* カード */
56
+ .nbk-card {
57
+ position: relative;
58
+ display: flex;
59
+ flex-direction: column;
60
+ gap: 8px;
61
+ width: 100%;
62
+ min-width: 0;
63
+ font-family: var(--nbk-font-family);
64
+ color: var(--nbk-color-text);
65
+ background: var(--nbk-color-surface);
66
+ }
67
+
68
+ .nbk-card__eyecatch {
69
+ display: block;
70
+ width: 100%;
71
+ height: auto;
72
+ aspect-ratio: 1280 / 670;
73
+ object-fit: cover;
74
+ border: 1px solid var(--nbk-color-border);
75
+ border-radius: var(--nbk-radius);
76
+ background: var(--nbk-color-placeholder);
77
+ }
78
+
79
+ .nbk-card__title {
80
+ display: -webkit-box;
81
+ margin: 4px 0 0;
82
+ overflow: hidden;
83
+ font-size: 1rem;
84
+ font-weight: 700;
85
+ line-height: 1.5;
86
+ overflow-wrap: anywhere;
87
+ -webkit-box-orient: vertical;
88
+ -webkit-line-clamp: 3;
89
+ line-clamp: 3;
90
+ }
91
+
92
+ .nbk-card__link {
93
+ color: inherit;
94
+ text-decoration: none;
95
+ transition: color 0.15s ease;
96
+ }
97
+
98
+ /*
99
+ * カード全体をクリックできるようにする。
100
+ * カード内に別のリンク(タグなど)を足す場合は、その要素に position: relative と z-index を付けて上に出す
101
+ */
102
+ .nbk-card__link::after {
103
+ position: absolute;
104
+ inset: 0;
105
+ content: "";
106
+ border-radius: var(--nbk-radius);
107
+ }
108
+
109
+ .nbk-card__link:hover {
110
+ color: var(--nbk-color-accent);
111
+ }
112
+
113
+ .nbk-card__link:focus-visible {
114
+ outline: none;
115
+ }
116
+
117
+ .nbk-card__link:focus-visible::after {
118
+ outline: 2px solid var(--nbk-color-accent);
119
+ outline-offset: 4px;
120
+ }
121
+
122
+ .nbk-card__date {
123
+ color: var(--nbk-color-muted);
124
+ font-size: 0.75rem;
125
+ line-height: 1.5;
126
+ }
127
+
128
+ .nbk-card__badge {
129
+ align-self: flex-start;
130
+ padding: 2px 8px;
131
+ color: var(--nbk-color-badge-text);
132
+ font-size: 0.6875rem;
133
+ font-weight: 700;
134
+ line-height: 1.5;
135
+ background: var(--nbk-color-badge-bg);
136
+ border-radius: 999px;
137
+ }
138
+
139
+ .nbk-card__excerpt {
140
+ display: -webkit-box;
141
+ margin: 0;
142
+ overflow: hidden;
143
+ color: var(--nbk-color-muted);
144
+ font-size: 0.875rem;
145
+ line-height: 1.7;
146
+ overflow-wrap: anywhere;
147
+ -webkit-box-orient: vertical;
148
+ -webkit-line-clamp: 3;
149
+ line-clamp: 3;
150
+ }
151
+
152
+ .nbk-card__tags {
153
+ display: flex;
154
+ flex-wrap: wrap;
155
+ gap: 4px 8px;
156
+ margin: 0;
157
+ padding: 0;
158
+ list-style: none;
159
+ }
160
+
161
+ .nbk-card__tag {
162
+ color: var(--nbk-color-muted);
163
+ font-size: 0.75rem;
164
+ line-height: 1.5;
165
+ }
166
+
167
+ /* ページ送り */
168
+ .nbk-pagination {
169
+ display: flex;
170
+ align-items: center;
171
+ justify-content: center;
172
+ gap: 16px;
173
+ margin: calc(var(--nbk-list-gap) * 1.5) 0;
174
+ font-family: var(--nbk-font-family);
175
+ color: var(--nbk-color-text);
176
+ }
177
+
178
+ .nbk-pagination__prev,
179
+ .nbk-pagination__next {
180
+ display: inline-flex;
181
+ align-items: center;
182
+ padding: 8px 20px;
183
+ color: inherit;
184
+ font-size: 0.875rem;
185
+ font-weight: 700;
186
+ text-decoration: none;
187
+ border: 1px solid var(--nbk-color-border);
188
+ border-radius: 999px;
189
+ transition:
190
+ color 0.15s ease,
191
+ border-color 0.15s ease;
192
+ }
193
+
194
+ .nbk-pagination__prev:hover,
195
+ .nbk-pagination__next:hover {
196
+ color: var(--nbk-color-accent);
197
+ border-color: var(--nbk-color-accent);
198
+ }
199
+
200
+ .nbk-pagination__prev:focus-visible,
201
+ .nbk-pagination__next:focus-visible {
202
+ outline: 2px solid var(--nbk-color-accent);
203
+ outline-offset: 2px;
204
+ }
205
+
206
+ .nbk-pagination__status {
207
+ color: var(--nbk-color-muted);
208
+ font-size: 0.875rem;
209
+ }
210
+
211
+ @media (prefers-reduced-motion: reduce) {
212
+ .nbk-card__link,
213
+ .nbk-pagination__prev,
214
+ .nbk-pagination__next {
215
+ transition: none;
216
+ }
217
+ }
218
+ }
package/package.json CHANGED
@@ -1,6 +1,111 @@
1
1
  {
2
2
  "name": "note-blog-kit",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Show your own note articles as a blog on React / Next.js sites (unofficial)",
5
+ "license": "MIT",
6
+ "author": "ludy-kida",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/ludy-kida/note-blog-kit.git",
10
+ "directory": "packages/note-blog-kit"
11
+ },
12
+ "keywords": [
13
+ "note",
14
+ "blog",
15
+ "react",
16
+ "nextjs",
17
+ "rss"
18
+ ],
19
+ "type": "module",
20
+ "sideEffects": [
21
+ "**/*.css"
22
+ ],
23
+ "engines": {
24
+ "node": ">=20"
25
+ },
26
+ "files": [
27
+ "dist"
28
+ ],
29
+ "bin": {
30
+ "note-blog-kit": "./dist/cli/index.js"
31
+ },
32
+ "exports": {
33
+ ".": {
34
+ "import": {
35
+ "types": "./dist/index.d.ts",
36
+ "default": "./dist/index.js"
37
+ },
38
+ "require": {
39
+ "types": "./dist/index.d.cts",
40
+ "default": "./dist/index.cjs"
41
+ }
42
+ },
43
+ "./server": {
44
+ "import": {
45
+ "types": "./dist/server/index.d.ts",
46
+ "default": "./dist/server/index.js"
47
+ },
48
+ "require": {
49
+ "types": "./dist/server/index.d.cts",
50
+ "default": "./dist/server/index.cjs"
51
+ }
52
+ },
53
+ "./react": {
54
+ "import": {
55
+ "types": "./dist/react/index.d.ts",
56
+ "default": "./dist/react/index.js"
57
+ },
58
+ "require": {
59
+ "types": "./dist/react/index.d.cts",
60
+ "default": "./dist/react/index.cjs"
61
+ }
62
+ },
63
+ "./next": {
64
+ "import": {
65
+ "types": "./dist/next/index.d.ts",
66
+ "default": "./dist/next/index.js"
67
+ },
68
+ "require": {
69
+ "types": "./dist/next/index.d.cts",
70
+ "default": "./dist/next/index.cjs"
71
+ }
72
+ },
73
+ "./styles.css": "./dist/styles.css",
74
+ "./package.json": "./package.json"
75
+ },
76
+ "main": "./dist/index.cjs",
77
+ "module": "./dist/index.js",
78
+ "types": "./dist/index.d.ts",
79
+ "scripts": {
80
+ "build": "tsup",
81
+ "typecheck": "tsc --noEmit",
82
+ "api": "node ../../scripts/run-api-extractor.mjs",
83
+ "api:check": "node ../../scripts/run-api-extractor.mjs --check",
84
+ "check:dist": "publint --strict && attw --pack . --profile node16 --exclude-entrypoints ./styles.css",
85
+ "size": "size-limit"
86
+ },
87
+ "publishConfig": {
88
+ "access": "public",
89
+ "provenance": true
90
+ },
91
+ "dependencies": {
92
+ "zod": "^4.6.7"
93
+ },
94
+ "peerDependencies": {
95
+ "react": "^18.0.0 || ^19.0.0"
96
+ },
97
+ "peerDependenciesMeta": {
98
+ "react": {
99
+ "optional": true
100
+ }
101
+ },
102
+ "devDependencies": {
103
+ "@testing-library/dom": "^10.4.2",
104
+ "@testing-library/react": "^16.3.3",
105
+ "@types/react": "^19.3.0",
106
+ "@types/react-dom": "^19.3.0",
107
+ "happy-dom": "^21.0.4",
108
+ "react": "^19.3.1",
109
+ "react-dom": "^19.3.1"
110
+ }
111
+ }