@ilamanownuk/blog-kit 0.1.0 → 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.
package/dist/styles.css CHANGED
@@ -1,5 +1,10 @@
1
- /* @ilamanownuk/blog-kit — no Tailwind needed. Override the --bk-* variables on :root or any ancestor. */
1
+ /*
2
+ * @ilamanownuk/blog-kit — no Tailwind needed.
3
+ * Customize by overriding the --bk-* variables on :root or any ancestor (or `[data-bk-theme="dark"]`).
4
+ * Every rule lives in `@layer blog-kit` in dist/styles.css, so your own unlayered CSS always wins.
5
+ */
2
6
  :root {
7
+ /* colors */
3
8
  --bk-accent: #997b2d;
4
9
  --bk-accent-contrast: #fff;
5
10
  --bk-fg: #1c1c1c;
@@ -9,18 +14,95 @@
9
14
  --bk-muted: #f3f4f6;
10
15
  --bk-border: #e5e7eb;
11
16
  --bk-danger: #b91c1c;
12
- --bk-radius: 0.5rem;
13
- --bk-font: inherit;
14
- --bk-editor-min-height: 360px;
15
17
  --bk-code-bg: #1c1c1c;
16
18
  --bk-code-fg: #f5f5f5;
19
+ --bk-code-inline-bg: rgb(0 0 0 / 0.06);
17
20
  --bk-mark-bg: #fde68a;
21
+ --bk-hr-color: rgb(0 0 0 / 0.12);
22
+ --bk-table-border: rgb(0 0 0 / 0.15);
23
+ --bk-table-head-bg: rgb(0 0 0 / 0.04);
24
+ --bk-backdrop: rgb(0 0 0 / 0.5);
25
+ /* typography */
26
+ --bk-font: inherit;
27
+ --bk-code-font: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
28
+ --bk-font-size: 1rem;
29
+ --bk-line-height: 2.1;
30
+ --bk-h2-size: 1.35rem;
31
+ --bk-h3-size: 1.15rem;
32
+ --bk-h4-size: 1rem;
33
+ --bk-heading-weight: 800;
34
+ /* shape + spacing */
35
+ --bk-radius: 0.5rem;
36
+ --bk-media-radius: 1rem;
37
+ --bk-block-gap: 1rem;
38
+ --bk-editor-min-height: 360px;
39
+ --bk-editor-padding: 0.75rem 1rem;
40
+ --bk-toolbar-padding: 0.375rem;
41
+ --bk-toolbar-gap: 0.25rem;
42
+ --bk-control-size: 2rem;
43
+ --bk-dialog-width: 28rem;
44
+ --bk-dialog-wide-width: 56rem;
45
+ /* shadows + layers */
46
+ --bk-popover-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
47
+ --bk-dialog-shadow: 0 16px 48px rgb(0 0 0 / 0.2);
48
+ --bk-z-toolbar: 10;
49
+ --bk-z-popover: 20;
50
+ /*
51
+ * Optional (not set by default, fall back to the values shown):
52
+ * --bk-link (var(--bk-accent)), --bk-heading-color (inherit), --bk-quote-border (var(--bk-accent)),
53
+ * --bk-radius-sm (radius - 2px), --bk-radius-lg (radius + 4px), --bk-focus-ring (var(--bk-accent))
54
+ */
55
+ }
56
+
57
+ /* Dark preset: put data-bk-theme="dark" (or Tailwind's .dark) on <html>/<body>.
58
+ Dialogs render into <body>, so set it on html/body, not only on a wrapper. */
59
+ [data-bk-theme="dark"],
60
+ .dark {
61
+ --bk-accent: #d4b25a;
62
+ --bk-accent-contrast: #1c1c1c;
63
+ --bk-fg: #ededed;
64
+ --bk-muted-fg: #9ca3af;
65
+ --bk-bg: #141414;
66
+ --bk-surface: #1c1c1c;
67
+ --bk-muted: #262626;
68
+ --bk-border: #333;
69
+ --bk-danger: #f87171;
70
+ --bk-code-bg: #0a0a0a;
71
+ --bk-code-fg: #f5f5f5;
72
+ --bk-code-inline-bg: rgb(255 255 255 / 0.1);
73
+ --bk-mark-bg: #854d0e;
74
+ --bk-hr-color: rgb(255 255 255 / 0.15);
75
+ --bk-table-border: rgb(255 255 255 / 0.18);
76
+ --bk-table-head-bg: rgb(255 255 255 / 0.06);
77
+ --bk-popover-shadow: 0 8px 24px rgb(0 0 0 / 0.5);
78
+ --bk-dialog-shadow: 0 16px 48px rgb(0 0 0 / 0.6);
79
+ }
80
+ @media (prefers-color-scheme: dark) {
81
+ [data-bk-theme="auto"] {
82
+ --bk-accent: #d4b25a;
83
+ --bk-accent-contrast: #1c1c1c;
84
+ --bk-fg: #ededed;
85
+ --bk-muted-fg: #9ca3af;
86
+ --bk-bg: #141414;
87
+ --bk-surface: #1c1c1c;
88
+ --bk-muted: #262626;
89
+ --bk-border: #333;
90
+ --bk-danger: #f87171;
91
+ --bk-code-bg: #0a0a0a;
92
+ --bk-code-inline-bg: rgb(255 255 255 / 0.1);
93
+ --bk-mark-bg: #854d0e;
94
+ --bk-hr-color: rgb(255 255 255 / 0.15);
95
+ --bk-table-border: rgb(255 255 255 / 0.18);
96
+ --bk-table-head-bg: rgb(255 255 255 / 0.06);
97
+ --bk-popover-shadow: 0 8px 24px rgb(0 0 0 / 0.5);
98
+ --bk-dialog-shadow: 0 16px 48px rgb(0 0 0 / 0.6);
99
+ }
18
100
  }
19
101
 
20
102
  /* ---------- Content (editor + renderer) ---------- */
21
103
  .bk-rich {
22
- font-size: 1rem;
23
- line-height: 2.1;
104
+ font-size: var(--bk-font-size);
105
+ line-height: var(--bk-line-height);
24
106
  overflow-wrap: anywhere;
25
107
  color: var(--bk-fg);
26
108
  font-family: var(--bk-font);
@@ -28,12 +110,12 @@
28
110
  .bk-rich[dir="rtl"] { text-align: right; }
29
111
  .bk-rich[dir="ltr"] { text-align: left; }
30
112
  .bk-rich > *:first-child { margin-top: 0; }
31
- .bk-rich p { margin: 0 0 1rem; }
32
- .bk-rich h2 { margin: 2rem 0 0.75rem; font-size: 1.35rem; font-weight: 800; line-height: 1.5; }
33
- .bk-rich h3 { margin: 1.5rem 0 0.5rem; font-size: 1.15rem; font-weight: 700; line-height: 1.5; }
34
- .bk-rich h4 { margin: 1.25rem 0 0.5rem; font-size: 1rem; font-weight: 700; line-height: 1.5; }
35
- .bk-rich a { color: var(--bk-accent); text-decoration: underline; text-underline-offset: 4px; }
36
- .bk-rich ul, .bk-rich ol { margin: 0 0 1rem; padding-inline-start: 1.25rem; }
113
+ .bk-rich p { margin: 0 0 var(--bk-block-gap); }
114
+ .bk-rich h2 { margin: 2rem 0 0.75rem; font-size: var(--bk-h2-size); font-weight: var(--bk-heading-weight); line-height: 1.5; color: var(--bk-heading-color, inherit); }
115
+ .bk-rich h3 { margin: 1.5rem 0 0.5rem; font-size: var(--bk-h3-size); font-weight: 700; line-height: 1.5; color: var(--bk-heading-color, inherit); }
116
+ .bk-rich h4 { margin: 1.25rem 0 0.5rem; font-size: var(--bk-h4-size); font-weight: 700; line-height: 1.5; color: var(--bk-heading-color, inherit); }
117
+ .bk-rich a { color: var(--bk-link, var(--bk-accent)); text-decoration: underline; text-underline-offset: 4px; }
118
+ .bk-rich ul, .bk-rich ol { margin: 0 0 var(--bk-block-gap); padding-inline-start: 1.25rem; }
37
119
  .bk-rich ul { list-style-type: disc; }
38
120
  .bk-rich ol { list-style-type: decimal; }
39
121
  .bk-rich li + li { margin-top: 0.4rem; }
@@ -41,13 +123,13 @@
41
123
  .bk-rich blockquote {
42
124
  margin-block: 1.5rem;
43
125
  margin-inline: 0;
44
- border-inline-start: 4px solid var(--bk-accent);
126
+ border-inline-start: 4px solid var(--bk-quote-border, var(--bk-accent));
45
127
  padding-inline-start: 1rem;
46
128
  font-style: italic;
47
129
  opacity: 0.85;
48
130
  }
49
131
  .bk-rich pre {
50
- margin-block: 1rem;
132
+ margin-block: var(--bk-block-gap);
51
133
  overflow-x: auto;
52
134
  border-radius: var(--bk-radius);
53
135
  background: var(--bk-code-bg);
@@ -55,18 +137,19 @@
55
137
  padding: 0.75rem 1rem;
56
138
  direction: ltr;
57
139
  text-align: left;
140
+ font-family: var(--bk-code-font);
58
141
  font-size: 0.875rem;
59
142
  line-height: 1.6;
60
143
  }
61
- .bk-rich code { border-radius: 0.25rem; background: rgb(0 0 0 / 0.06); padding: 0.1rem 0.3rem; font-size: 0.875em; }
144
+ .bk-rich code { border-radius: 0.25rem; background: var(--bk-code-inline-bg); padding: 0.1rem 0.3rem; font-family: var(--bk-code-font); font-size: 0.875em; }
62
145
  .bk-rich pre code { background: none; padding: 0; }
63
146
  .bk-rich mark { border-radius: 0.2rem; background-color: var(--bk-mark-bg); padding: 0 0.15rem; color: inherit; }
64
- .bk-rich hr { margin-block: 2rem; border: 0; border-top: 1px solid rgb(0 0 0 / 0.12); }
65
- .bk-rich img { display: block; margin-block: 1.5rem; height: auto; max-width: 100%; border-radius: 1rem; }
66
- .bk-rich iframe { display: block; margin-block: 1.5rem; aspect-ratio: 16 / 9; width: 100%; border: 0; border-radius: 1rem; }
147
+ .bk-rich hr { margin-block: 2rem; border: 0; border-top: 1px solid var(--bk-hr-color); }
148
+ .bk-rich img { display: block; margin-block: 1.5rem; height: auto; max-width: 100%; border-radius: var(--bk-media-radius); }
149
+ .bk-rich iframe { display: block; margin-block: 1.5rem; aspect-ratio: 16 / 9; width: 100%; border: 0; border-radius: var(--bk-media-radius); }
67
150
  .bk-rich table { display: block; margin-block: 1.5rem; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
68
- .bk-rich th, .bk-rich td { min-width: 4rem; border: 1px solid rgb(0 0 0 / 0.15); padding: 0.4rem 0.75rem; vertical-align: top; }
69
- .bk-rich th { background: rgb(0 0 0 / 0.04); font-weight: 700; }
151
+ .bk-rich th, .bk-rich td { min-width: 4rem; border: 1px solid var(--bk-table-border); padding: 0.4rem 0.75rem; vertical-align: top; }
152
+ .bk-rich th { background: var(--bk-table-head-bg); font-weight: 700; }
70
153
  .bk-rich th > p, .bk-rich td > p { margin-bottom: 0; }
71
154
 
72
155
  /* ---------- Tiptap / ProseMirror ---------- */
@@ -79,7 +162,7 @@
79
162
  }
80
163
  .tiptap .selectedCell { background: var(--bk-muted); }
81
164
  .tiptap img.ProseMirror-selectednode,
82
- .tiptap iframe.ProseMirror-selectednode { outline: 2px solid var(--bk-accent); }
165
+ .tiptap iframe.ProseMirror-selectednode { outline: 2px solid var(--bk-focus-ring, var(--bk-accent)); }
83
166
  .tiptap iframe { pointer-events: none; }
84
167
 
85
168
  /* ---------- Editor shell ---------- */
@@ -92,18 +175,18 @@
92
175
  font-family: var(--bk-font);
93
176
  }
94
177
  .bk-editor.bk-invalid { border-color: var(--bk-danger); }
95
- .bk-editor-content { min-height: var(--bk-editor-min-height); padding: 0.75rem 1rem; outline: none; }
178
+ .bk-editor-content { min-height: var(--bk-editor-min-height); padding: var(--bk-editor-padding); outline: none; }
96
179
  .bk-editor-content:focus { outline: none; }
97
180
 
98
181
  .bk-toolbar {
99
182
  position: sticky;
100
183
  top: 0;
101
- z-index: 10;
184
+ z-index: var(--bk-z-toolbar);
102
185
  display: flex;
103
186
  flex-wrap: wrap;
104
187
  align-items: center;
105
- gap: 0.25rem;
106
- padding: 0.375rem;
188
+ gap: var(--bk-toolbar-gap);
189
+ padding: var(--bk-toolbar-padding);
107
190
  border-bottom: 1px solid var(--bk-border);
108
191
  background: var(--bk-surface);
109
192
  }
@@ -117,7 +200,7 @@
117
200
  justify-content: center;
118
201
  gap: 0.375rem;
119
202
  border: 1px solid transparent;
120
- border-radius: calc(var(--bk-radius) - 2px);
203
+ border-radius: var(--bk-radius-sm, calc(var(--bk-radius) - 2px));
121
204
  background: transparent;
122
205
  color: inherit;
123
206
  font: inherit;
@@ -127,9 +210,9 @@
127
210
  white-space: nowrap;
128
211
  }
129
212
  .bk-btn:disabled { opacity: 0.45; cursor: not-allowed; }
130
- .bk-btn:focus-visible { outline: 2px solid var(--bk-accent); outline-offset: 1px; }
213
+ .bk-btn:focus-visible { outline: 2px solid var(--bk-focus-ring, var(--bk-accent)); outline-offset: 1px; }
131
214
  .bk-btn svg { flex: none; width: 1rem; height: 1rem; }
132
- .bk-btn-icon { width: 2rem; height: 2rem; padding: 0; }
215
+ .bk-btn-icon { width: var(--bk-control-size); height: var(--bk-control-size); padding: 0; }
133
216
  .bk-btn-sm { height: 1.75rem; padding: 0 0.5rem; font-size: 0.75rem; }
134
217
  .bk-btn-md { height: 2.25rem; padding: 0 0.875rem; }
135
218
  .bk-btn-ghost:hover:not(:disabled) { background: var(--bk-muted); }
@@ -145,13 +228,13 @@
145
228
  height: 2.25rem;
146
229
  padding: 0 0.625rem;
147
230
  border: 1px solid var(--bk-border);
148
- border-radius: calc(var(--bk-radius) - 2px);
231
+ border-radius: var(--bk-radius-sm, calc(var(--bk-radius) - 2px));
149
232
  background: var(--bk-bg);
150
233
  color: inherit;
151
234
  font: inherit;
152
235
  font-size: 0.875rem;
153
236
  }
154
- .bk-input:focus-visible { outline: 2px solid var(--bk-accent); outline-offset: 0; }
237
+ .bk-input:focus-visible { outline: 2px solid var(--bk-focus-ring, var(--bk-accent)); outline-offset: 0; }
155
238
  .bk-label { font-size: 0.875rem; font-weight: 600; }
156
239
  .bk-error { margin: 0; font-size: 0.75rem; color: var(--bk-danger); }
157
240
  .bk-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }
@@ -163,12 +246,12 @@
163
246
  position: absolute;
164
247
  inset-block-start: calc(100% + 0.25rem);
165
248
  inset-inline-start: 0;
166
- z-index: 20;
249
+ z-index: var(--bk-z-popover);
167
250
  padding: 0.5rem;
168
251
  border: 1px solid var(--bk-border);
169
252
  border-radius: var(--bk-radius);
170
253
  background: var(--bk-bg);
171
- box-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
254
+ box-shadow: var(--bk-popover-shadow);
172
255
  }
173
256
  .bk-colors { display: flex; align-items: center; gap: 0.375rem; }
174
257
  .bk-swatch { width: 1.5rem; height: 1.5rem; padding: 0; border: 1px solid var(--bk-border); border-radius: 999px; cursor: pointer; }
@@ -176,18 +259,18 @@
176
259
  /* ---------- Dialogs ---------- */
177
260
  .bk-dialog {
178
261
  box-sizing: border-box;
179
- width: min(28rem, calc(100vw - 2rem));
262
+ width: min(var(--bk-dialog-width), calc(100vw - 2rem));
180
263
  margin: auto;
181
264
  padding: 0;
182
265
  border: 1px solid var(--bk-border);
183
- border-radius: calc(var(--bk-radius) + 4px);
266
+ border-radius: var(--bk-radius-lg, calc(var(--bk-radius) + 4px));
184
267
  background: var(--bk-bg);
185
268
  color: var(--bk-fg);
186
269
  font-family: var(--bk-font);
187
- box-shadow: 0 16px 48px rgb(0 0 0 / 0.2);
270
+ box-shadow: var(--bk-dialog-shadow);
188
271
  }
189
- .bk-dialog::backdrop { background: rgb(0 0 0 / 0.5); }
190
- .bk-dialog-wide { width: min(56rem, calc(100vw - 2rem)); }
272
+ .bk-dialog::backdrop { background: var(--bk-backdrop); }
273
+ .bk-dialog-wide { width: min(var(--bk-dialog-wide-width), calc(100vw - 2rem)); }
191
274
  .bk-dialog-body { display: flex; flex-direction: column; max-height: 85vh; }
192
275
  .bk-form { display: flex; flex-direction: column; gap: 1rem; padding: 1.25rem; }
193
276
  .bk-field { display: flex; flex-direction: column; gap: 0.375rem; }
@@ -208,7 +291,7 @@
208
291
  @media (min-width: 640px) { .bk-media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
209
292
  @media (min-width: 768px) { .bk-media-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
210
293
  .bk-media-item { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; overflow: hidden; border: 1px solid var(--bk-border); border-radius: var(--bk-radius); background: var(--bk-muted); cursor: pointer; }
211
- .bk-media-item:focus-visible { outline: 2px solid var(--bk-accent); }
294
+ .bk-media-item:focus-visible { outline: 2px solid var(--bk-focus-ring, var(--bk-accent)); }
212
295
  .bk-media-item.bk-selected { border-color: var(--bk-accent); box-shadow: 0 0 0 2px var(--bk-accent); }
213
296
  .bk-media-item img { width: 100%; height: 100%; object-fit: cover; margin: 0; border-radius: 0; }
214
297
  .bk-media-check { position: absolute; inset-block-start: 0.375rem; inset-inline-end: 0.375rem; display: flex; width: 1.5rem; height: 1.5rem; align-items: center; justify-content: center; border-radius: 999px; background: var(--bk-accent); color: var(--bk-accent-contrast); }
@@ -0,0 +1,301 @@
1
+ @layer blog-kit {
2
+ /*
3
+ * @ilamanownuk/blog-kit — no Tailwind needed.
4
+ * Customize by overriding the --bk-* variables on :root or any ancestor (or `[data-bk-theme="dark"]`).
5
+ * Every rule lives in `@layer blog-kit` in dist/styles.css, so your own unlayered CSS always wins.
6
+ */
7
+ :root {
8
+ /* colors */
9
+ --bk-accent: #997b2d;
10
+ --bk-accent-contrast: #fff;
11
+ --bk-fg: #1c1c1c;
12
+ --bk-muted-fg: #6b7280;
13
+ --bk-bg: #fff;
14
+ --bk-surface: #f9fafb;
15
+ --bk-muted: #f3f4f6;
16
+ --bk-border: #e5e7eb;
17
+ --bk-danger: #b91c1c;
18
+ --bk-code-bg: #1c1c1c;
19
+ --bk-code-fg: #f5f5f5;
20
+ --bk-code-inline-bg: rgb(0 0 0 / 0.06);
21
+ --bk-mark-bg: #fde68a;
22
+ --bk-hr-color: rgb(0 0 0 / 0.12);
23
+ --bk-table-border: rgb(0 0 0 / 0.15);
24
+ --bk-table-head-bg: rgb(0 0 0 / 0.04);
25
+ --bk-backdrop: rgb(0 0 0 / 0.5);
26
+ /* typography */
27
+ --bk-font: inherit;
28
+ --bk-code-font: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
29
+ --bk-font-size: 1rem;
30
+ --bk-line-height: 2.1;
31
+ --bk-h2-size: 1.35rem;
32
+ --bk-h3-size: 1.15rem;
33
+ --bk-h4-size: 1rem;
34
+ --bk-heading-weight: 800;
35
+ /* shape + spacing */
36
+ --bk-radius: 0.5rem;
37
+ --bk-media-radius: 1rem;
38
+ --bk-block-gap: 1rem;
39
+ --bk-editor-min-height: 360px;
40
+ --bk-editor-padding: 0.75rem 1rem;
41
+ --bk-toolbar-padding: 0.375rem;
42
+ --bk-toolbar-gap: 0.25rem;
43
+ --bk-control-size: 2rem;
44
+ --bk-dialog-width: 28rem;
45
+ --bk-dialog-wide-width: 56rem;
46
+ /* shadows + layers */
47
+ --bk-popover-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
48
+ --bk-dialog-shadow: 0 16px 48px rgb(0 0 0 / 0.2);
49
+ --bk-z-toolbar: 10;
50
+ --bk-z-popover: 20;
51
+ /*
52
+ * Optional (not set by default, fall back to the values shown):
53
+ * --bk-link (var(--bk-accent)), --bk-heading-color (inherit), --bk-quote-border (var(--bk-accent)),
54
+ * --bk-radius-sm (radius - 2px), --bk-radius-lg (radius + 4px), --bk-focus-ring (var(--bk-accent))
55
+ */
56
+ }
57
+
58
+ /* Dark preset: put data-bk-theme="dark" (or Tailwind's .dark) on <html>/<body>.
59
+ Dialogs render into <body>, so set it on html/body, not only on a wrapper. */
60
+ [data-bk-theme="dark"],
61
+ .dark {
62
+ --bk-accent: #d4b25a;
63
+ --bk-accent-contrast: #1c1c1c;
64
+ --bk-fg: #ededed;
65
+ --bk-muted-fg: #9ca3af;
66
+ --bk-bg: #141414;
67
+ --bk-surface: #1c1c1c;
68
+ --bk-muted: #262626;
69
+ --bk-border: #333;
70
+ --bk-danger: #f87171;
71
+ --bk-code-bg: #0a0a0a;
72
+ --bk-code-fg: #f5f5f5;
73
+ --bk-code-inline-bg: rgb(255 255 255 / 0.1);
74
+ --bk-mark-bg: #854d0e;
75
+ --bk-hr-color: rgb(255 255 255 / 0.15);
76
+ --bk-table-border: rgb(255 255 255 / 0.18);
77
+ --bk-table-head-bg: rgb(255 255 255 / 0.06);
78
+ --bk-popover-shadow: 0 8px 24px rgb(0 0 0 / 0.5);
79
+ --bk-dialog-shadow: 0 16px 48px rgb(0 0 0 / 0.6);
80
+ }
81
+ @media (prefers-color-scheme: dark) {
82
+ [data-bk-theme="auto"] {
83
+ --bk-accent: #d4b25a;
84
+ --bk-accent-contrast: #1c1c1c;
85
+ --bk-fg: #ededed;
86
+ --bk-muted-fg: #9ca3af;
87
+ --bk-bg: #141414;
88
+ --bk-surface: #1c1c1c;
89
+ --bk-muted: #262626;
90
+ --bk-border: #333;
91
+ --bk-danger: #f87171;
92
+ --bk-code-bg: #0a0a0a;
93
+ --bk-code-inline-bg: rgb(255 255 255 / 0.1);
94
+ --bk-mark-bg: #854d0e;
95
+ --bk-hr-color: rgb(255 255 255 / 0.15);
96
+ --bk-table-border: rgb(255 255 255 / 0.18);
97
+ --bk-table-head-bg: rgb(255 255 255 / 0.06);
98
+ --bk-popover-shadow: 0 8px 24px rgb(0 0 0 / 0.5);
99
+ --bk-dialog-shadow: 0 16px 48px rgb(0 0 0 / 0.6);
100
+ }
101
+ }
102
+
103
+ /* ---------- Content (editor + renderer) ---------- */
104
+ .bk-rich {
105
+ font-size: var(--bk-font-size);
106
+ line-height: var(--bk-line-height);
107
+ overflow-wrap: anywhere;
108
+ color: var(--bk-fg);
109
+ font-family: var(--bk-font);
110
+ }
111
+ .bk-rich[dir="rtl"] { text-align: right; }
112
+ .bk-rich[dir="ltr"] { text-align: left; }
113
+ .bk-rich > *:first-child { margin-top: 0; }
114
+ .bk-rich p { margin: 0 0 var(--bk-block-gap); }
115
+ .bk-rich h2 { margin: 2rem 0 0.75rem; font-size: var(--bk-h2-size); font-weight: var(--bk-heading-weight); line-height: 1.5; color: var(--bk-heading-color, inherit); }
116
+ .bk-rich h3 { margin: 1.5rem 0 0.5rem; font-size: var(--bk-h3-size); font-weight: 700; line-height: 1.5; color: var(--bk-heading-color, inherit); }
117
+ .bk-rich h4 { margin: 1.25rem 0 0.5rem; font-size: var(--bk-h4-size); font-weight: 700; line-height: 1.5; color: var(--bk-heading-color, inherit); }
118
+ .bk-rich a { color: var(--bk-link, var(--bk-accent)); text-decoration: underline; text-underline-offset: 4px; }
119
+ .bk-rich ul, .bk-rich ol { margin: 0 0 var(--bk-block-gap); padding-inline-start: 1.25rem; }
120
+ .bk-rich ul { list-style-type: disc; }
121
+ .bk-rich ol { list-style-type: decimal; }
122
+ .bk-rich li + li { margin-top: 0.4rem; }
123
+ .bk-rich li > p { margin-bottom: 0; }
124
+ .bk-rich blockquote {
125
+ margin-block: 1.5rem;
126
+ margin-inline: 0;
127
+ border-inline-start: 4px solid var(--bk-quote-border, var(--bk-accent));
128
+ padding-inline-start: 1rem;
129
+ font-style: italic;
130
+ opacity: 0.85;
131
+ }
132
+ .bk-rich pre {
133
+ margin-block: var(--bk-block-gap);
134
+ overflow-x: auto;
135
+ border-radius: var(--bk-radius);
136
+ background: var(--bk-code-bg);
137
+ color: var(--bk-code-fg);
138
+ padding: 0.75rem 1rem;
139
+ direction: ltr;
140
+ text-align: left;
141
+ font-family: var(--bk-code-font);
142
+ font-size: 0.875rem;
143
+ line-height: 1.6;
144
+ }
145
+ .bk-rich code { border-radius: 0.25rem; background: var(--bk-code-inline-bg); padding: 0.1rem 0.3rem; font-family: var(--bk-code-font); font-size: 0.875em; }
146
+ .bk-rich pre code { background: none; padding: 0; }
147
+ .bk-rich mark { border-radius: 0.2rem; background-color: var(--bk-mark-bg); padding: 0 0.15rem; color: inherit; }
148
+ .bk-rich hr { margin-block: 2rem; border: 0; border-top: 1px solid var(--bk-hr-color); }
149
+ .bk-rich img { display: block; margin-block: 1.5rem; height: auto; max-width: 100%; border-radius: var(--bk-media-radius); }
150
+ .bk-rich iframe { display: block; margin-block: 1.5rem; aspect-ratio: 16 / 9; width: 100%; border: 0; border-radius: var(--bk-media-radius); }
151
+ .bk-rich table { display: block; margin-block: 1.5rem; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
152
+ .bk-rich th, .bk-rich td { min-width: 4rem; border: 1px solid var(--bk-table-border); padding: 0.4rem 0.75rem; vertical-align: top; }
153
+ .bk-rich th { background: var(--bk-table-head-bg); font-weight: 700; }
154
+ .bk-rich th > p, .bk-rich td > p { margin-bottom: 0; }
155
+
156
+ /* ---------- Tiptap / ProseMirror ---------- */
157
+ .tiptap p.is-editor-empty:first-child::before {
158
+ content: attr(data-placeholder);
159
+ float: inline-start;
160
+ height: 0;
161
+ pointer-events: none;
162
+ color: var(--bk-muted-fg);
163
+ }
164
+ .tiptap .selectedCell { background: var(--bk-muted); }
165
+ .tiptap img.ProseMirror-selectednode,
166
+ .tiptap iframe.ProseMirror-selectednode { outline: 2px solid var(--bk-focus-ring, var(--bk-accent)); }
167
+ .tiptap iframe { pointer-events: none; }
168
+
169
+ /* ---------- Editor shell ---------- */
170
+ .bk-editor {
171
+ overflow: hidden;
172
+ border: 1px solid var(--bk-border);
173
+ border-radius: var(--bk-radius);
174
+ background: var(--bk-bg);
175
+ color: var(--bk-fg);
176
+ font-family: var(--bk-font);
177
+ }
178
+ .bk-editor.bk-invalid { border-color: var(--bk-danger); }
179
+ .bk-editor-content { min-height: var(--bk-editor-min-height); padding: var(--bk-editor-padding); outline: none; }
180
+ .bk-editor-content:focus { outline: none; }
181
+
182
+ .bk-toolbar {
183
+ position: sticky;
184
+ top: 0;
185
+ z-index: var(--bk-z-toolbar);
186
+ display: flex;
187
+ flex-wrap: wrap;
188
+ align-items: center;
189
+ gap: var(--bk-toolbar-gap);
190
+ padding: var(--bk-toolbar-padding);
191
+ border-bottom: 1px solid var(--bk-border);
192
+ background: var(--bk-surface);
193
+ }
194
+ .bk-sep { width: 1px; height: 1.25rem; margin-inline: 0.125rem; background: var(--bk-border); }
195
+ .bk-table-tools { display: flex; flex-wrap: wrap; gap: 0.25rem; width: 100%; padding-top: 0.375rem; border-top: 1px solid var(--bk-border); }
196
+
197
+ /* ---------- Primitives ---------- */
198
+ .bk-btn {
199
+ display: inline-flex;
200
+ align-items: center;
201
+ justify-content: center;
202
+ gap: 0.375rem;
203
+ border: 1px solid transparent;
204
+ border-radius: var(--bk-radius-sm, calc(var(--bk-radius) - 2px));
205
+ background: transparent;
206
+ color: inherit;
207
+ font: inherit;
208
+ font-size: 0.875rem;
209
+ line-height: 1;
210
+ cursor: pointer;
211
+ white-space: nowrap;
212
+ }
213
+ .bk-btn:disabled { opacity: 0.45; cursor: not-allowed; }
214
+ .bk-btn:focus-visible { outline: 2px solid var(--bk-focus-ring, var(--bk-accent)); outline-offset: 1px; }
215
+ .bk-btn svg { flex: none; width: 1rem; height: 1rem; }
216
+ .bk-btn-icon { width: var(--bk-control-size); height: var(--bk-control-size); padding: 0; }
217
+ .bk-btn-sm { height: 1.75rem; padding: 0 0.5rem; font-size: 0.75rem; }
218
+ .bk-btn-md { height: 2.25rem; padding: 0 0.875rem; }
219
+ .bk-btn-ghost:hover:not(:disabled) { background: var(--bk-muted); }
220
+ .bk-btn-outline { border-color: var(--bk-border); background: var(--bk-bg); }
221
+ .bk-btn-outline:hover:not(:disabled) { background: var(--bk-muted); }
222
+ .bk-btn-primary { background: var(--bk-accent); color: var(--bk-accent-contrast); }
223
+ .bk-btn-primary:hover:not(:disabled) { filter: brightness(0.92); }
224
+ .bk-btn.bk-pressed { background: var(--bk-muted); color: var(--bk-accent); }
225
+
226
+ .bk-input {
227
+ box-sizing: border-box;
228
+ width: 100%;
229
+ height: 2.25rem;
230
+ padding: 0 0.625rem;
231
+ border: 1px solid var(--bk-border);
232
+ border-radius: var(--bk-radius-sm, calc(var(--bk-radius) - 2px));
233
+ background: var(--bk-bg);
234
+ color: inherit;
235
+ font: inherit;
236
+ font-size: 0.875rem;
237
+ }
238
+ .bk-input:focus-visible { outline: 2px solid var(--bk-focus-ring, var(--bk-accent)); outline-offset: 0; }
239
+ .bk-label { font-size: 0.875rem; font-weight: 600; }
240
+ .bk-error { margin: 0; font-size: 0.75rem; color: var(--bk-danger); }
241
+ .bk-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }
242
+ .bk-spin { animation: bk-spin 1s linear infinite; }
243
+ @keyframes bk-spin { to { transform: rotate(360deg); } }
244
+
245
+ .bk-popover { position: relative; display: inline-flex; }
246
+ .bk-popover-content {
247
+ position: absolute;
248
+ inset-block-start: calc(100% + 0.25rem);
249
+ inset-inline-start: 0;
250
+ z-index: var(--bk-z-popover);
251
+ padding: 0.5rem;
252
+ border: 1px solid var(--bk-border);
253
+ border-radius: var(--bk-radius);
254
+ background: var(--bk-bg);
255
+ box-shadow: var(--bk-popover-shadow);
256
+ }
257
+ .bk-colors { display: flex; align-items: center; gap: 0.375rem; }
258
+ .bk-swatch { width: 1.5rem; height: 1.5rem; padding: 0; border: 1px solid var(--bk-border); border-radius: 999px; cursor: pointer; }
259
+
260
+ /* ---------- Dialogs ---------- */
261
+ .bk-dialog {
262
+ box-sizing: border-box;
263
+ width: min(var(--bk-dialog-width), calc(100vw - 2rem));
264
+ margin: auto;
265
+ padding: 0;
266
+ border: 1px solid var(--bk-border);
267
+ border-radius: var(--bk-radius-lg, calc(var(--bk-radius) + 4px));
268
+ background: var(--bk-bg);
269
+ color: var(--bk-fg);
270
+ font-family: var(--bk-font);
271
+ box-shadow: var(--bk-dialog-shadow);
272
+ }
273
+ .bk-dialog::backdrop { background: var(--bk-backdrop); }
274
+ .bk-dialog-wide { width: min(var(--bk-dialog-wide-width), calc(100vw - 2rem)); }
275
+ .bk-dialog-body { display: flex; flex-direction: column; max-height: 85vh; }
276
+ .bk-form { display: flex; flex-direction: column; gap: 1rem; padding: 1.25rem; }
277
+ .bk-field { display: flex; flex-direction: column; gap: 0.375rem; }
278
+ .bk-dialog-title, .bk-dialog-header h2 { margin: 0; font-size: 1.05rem; font-weight: 700; }
279
+ .bk-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 1rem; border-bottom: 1px solid var(--bk-border); }
280
+ .bk-dialog-footer { display: flex; justify-content: flex-end; gap: 0.5rem; }
281
+ .bk-actions { display: flex; gap: 0.5rem; }
282
+ .bk-actions-start { justify-content: flex-start; flex-wrap: wrap; }
283
+ .bk-image-preview { max-width: 100%; max-height: 12rem; object-fit: contain; border-radius: var(--bk-radius); border: 1px solid var(--bk-border); }
284
+
285
+ .bk-media-toolbar { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.75rem; padding: 1rem; border-bottom: 1px solid var(--bk-border); }
286
+ .bk-media-toolbar .bk-input { max-width: 20rem; flex: 1; }
287
+ .bk-media-upload { display: flex; flex-direction: column; gap: 0.375rem; }
288
+ .bk-media-body { flex: 1; min-height: 12rem; overflow-y: auto; padding: 1rem; }
289
+ .bk-media-footer { align-items: center; justify-content: space-between; padding: 1rem; border-top: 1px solid var(--bk-border); }
290
+ .bk-media-empty { padding: 2rem; border: 1px dashed var(--bk-border); border-radius: var(--bk-radius); text-align: center; font-size: 0.875rem; color: var(--bk-muted-fg); }
291
+ .bk-media-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
292
+ @media (min-width: 640px) { .bk-media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
293
+ @media (min-width: 768px) { .bk-media-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
294
+ .bk-media-item { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; overflow: hidden; border: 1px solid var(--bk-border); border-radius: var(--bk-radius); background: var(--bk-muted); cursor: pointer; }
295
+ .bk-media-item:focus-visible { outline: 2px solid var(--bk-focus-ring, var(--bk-accent)); }
296
+ .bk-media-item.bk-selected { border-color: var(--bk-accent); box-shadow: 0 0 0 2px var(--bk-accent); }
297
+ .bk-media-item img { width: 100%; height: 100%; object-fit: cover; margin: 0; border-radius: 0; }
298
+ .bk-media-check { position: absolute; inset-block-start: 0.375rem; inset-inline-end: 0.375rem; display: flex; width: 1.5rem; height: 1.5rem; align-items: center; justify-content: center; border-radius: 999px; background: var(--bk-accent); color: var(--bk-accent-contrast); }
299
+ .bk-pager { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; }
300
+
301
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ilamanownuk/blog-kit",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Reusable Tiptap blog editor for Next.js: Aparat/YouTube embeds, image upload, media library picker, server-side sanitizer and renderer.",
5
5
  "license": "MIT",
6
6
  "packageManager": "pnpm@12.18.0",
@@ -30,6 +30,8 @@
30
30
  "files": [
31
31
  "dist",
32
32
  "README.md",
33
+ "AI_INSTALL_PROMPT.md",
34
+ "CHANGELOG.md",
33
35
  "LICENSE"
34
36
  ],
35
37
  "main": "./dist/index.cjs",
@@ -67,6 +69,7 @@
67
69
  }
68
70
  },
69
71
  "./styles.css": "./dist/styles.css",
72
+ "./styles.layered.css": "./dist/styles.layered.css",
70
73
  "./package.json": "./package.json"
71
74
  },
72
75
  "publishConfig": {