@usequeek/theme-kit 0.5.12 → 0.5.14
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.
|
@@ -55,7 +55,7 @@ export function DefaultCheckoutShell({
|
|
|
55
55
|
{/* Left pane: white — form */}
|
|
56
56
|
<div className="core-checkout__page-form">
|
|
57
57
|
<div className="core-checkout__page-header">
|
|
58
|
-
<Link href={href('/')} className="core-checkout__back">
|
|
58
|
+
<Link href={href('/shop')} className="core-checkout__back">
|
|
59
59
|
<svg viewBox="0 0 16 16" fill="none" aria-hidden="true" width="14" height="14">
|
|
60
60
|
<path d="M10 13L5 8l5-5" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
|
|
61
61
|
</svg>
|
package/package.json
CHANGED
|
@@ -1222,6 +1222,17 @@
|
|
|
1222
1222
|
line-height: 1.6;
|
|
1223
1223
|
}
|
|
1224
1224
|
|
|
1225
|
+
/* A formatted answer (markdown): paragraphs and lists sit flush with the answer box, one clear gap between them. The `> :is() + :is()`
|
|
1226
|
+
* selector outranks a theme's bare `.theme-x p { margin: 0 }`, so the gap survives every theme. */
|
|
1227
|
+
.core-block-faq__answer > :is(p, ul, ol) {
|
|
1228
|
+
margin-top: 0;
|
|
1229
|
+
margin-bottom: 0;
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
.core-block-faq__answer > :is(p, ul, ol) + :is(p, ul, ol) {
|
|
1233
|
+
margin-top: 1em;
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1225
1236
|
/* ── Policies listing (core fallback for /policies) ──────────────
|
|
1226
1237
|
* Themeable via `.theme-<slug> .core-policies__*` overrides. Pure CSS
|
|
1227
1238
|
* variables — tint follows the active theme automatically.
|
package/shared-blocks/faq.tsx
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
import type { JSX } from 'react';
|
|
4
4
|
import type { FaqBlockData } from '../types/block';
|
|
5
|
+
import { renderMarkdown } from '../utils/markdown';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* An answer carrying formatting (a line break, **bold**, _italic_, a [link](/x) or `code`) renders as markdown: paragraphs and inline
|
|
9
|
+
* emphasis, never raw HTML. A plain answer keeps rendering as the bare text it always did, so no existing store's FAQ markup moves.
|
|
10
|
+
*/
|
|
11
|
+
const FORMATTED_ANSWER = /\n|\*|_|\[|`/;
|
|
12
|
+
|
|
13
|
+
function FaqAnswer({ answer }: { answer: unknown }): JSX.Element {
|
|
14
|
+
const text = typeof answer === 'string' ? answer : '';
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<div className="core-block-faq__answer">{FORMATTED_ANSWER.test(text) ? renderMarkdown(text) : text}</div>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
5
20
|
|
|
6
21
|
/**
|
|
7
22
|
* Framework-owned FAQ block. Renders an accessible, SSR-friendly accordion
|
|
@@ -36,7 +51,7 @@ export function CoreFaqBlock({ heading, items }: FaqBlockData): JSX.Element | nu
|
|
|
36
51
|
<polyline points="6 9 12 15 18 9" />
|
|
37
52
|
</svg>
|
|
38
53
|
</summary>
|
|
39
|
-
<
|
|
54
|
+
<FaqAnswer answer={item.answer} />
|
|
40
55
|
</details>
|
|
41
56
|
))}
|
|
42
57
|
</div>
|