@conduction/docusaurus-preset 3.19.0 → 3.20.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conduction/docusaurus-preset",
3
- "version": "3.19.0",
3
+ "version": "3.20.0",
4
4
  "scripts": {
5
5
  "prepack": "node scripts/prepack-bundle-css.js"
6
6
  },
@@ -0,0 +1,81 @@
1
+ /**
2
+ * <SetupSteps /> + <SetupStep />
3
+ *
4
+ * Vertical numbered-step list for docs setup/install/walkthrough
5
+ * sections and editorial action prompts. A small orange hex with a
6
+ * white number sits on the left of each row; bold title + one short
7
+ * body paragraph sit on the right.
8
+ *
9
+ * Distinct from <HowSteps />, which renders a 3-up card row for
10
+ * marketing surfaces (How install works, How to get help, …).
11
+ * SetupSteps lives in body prose where steps are sequential and
12
+ * detailed, and the list reads top to bottom.
13
+ *
14
+ * Numbers are auto-assigned in document order. Pass `start` to
15
+ * resume after a break (e.g. a continued procedure split across
16
+ * sections).
17
+ *
18
+ * Usage:
19
+ *
20
+ * <SetupSteps title="Setup" lede="Numbered steps you read top to bottom.">
21
+ * <SetupStep title="Add an xWiki source">
22
+ * Open *Integrations → Sources → New source*, paste the base URL.
23
+ * </SetupStep>
24
+ * <SetupStep title="Pick the spaces to index">
25
+ * Per source, choose one or more xWiki spaces.
26
+ * </SetupStep>
27
+ * <SetupStep title="Verify">
28
+ * Open the app's chat sidebar and ask a matching question.
29
+ * </SetupStep>
30
+ * </SetupSteps>
31
+ *
32
+ * // Editorial / action-prompt use, no h2 above the list:
33
+ * <SetupSteps title={null}>
34
+ * <SetupStep title="Call Nextcloud by its proper name.">
35
+ * In tenders, in policy documents, in architecture diagrams.
36
+ * </SetupStep>
37
+ * ...
38
+ * </SetupSteps>
39
+ *
40
+ * Mirrors preview/components/setup-steps.html.
41
+ */
42
+
43
+ import React, {Children, cloneElement, isValidElement} from 'react';
44
+ import styles from './SetupSteps.module.css';
45
+
46
+ export function SetupStep({number, title, children, className}) {
47
+ const composed = [styles.row, className].filter(Boolean).join(' ');
48
+ return (
49
+ <div className={composed}>
50
+ {number != null && <div className={styles.num}>{number}</div>}
51
+ {/* div not p: MDX may wrap inline children in its own <p>,
52
+ which would be invalid nested inside another <p>. */}
53
+ <div className={styles.body}>
54
+ {title && <span className={styles.bodyTitle}>{title}</span>}
55
+ {children}
56
+ </div>
57
+ </div>
58
+ );
59
+ }
60
+
61
+ export default function SetupSteps({
62
+ title,
63
+ lede,
64
+ start = 1,
65
+ children,
66
+ className,
67
+ }) {
68
+ const numbered = Children.map(children, (child, i) => {
69
+ if (!isValidElement(child)) return child;
70
+ if (child.props.number != null) return child;
71
+ return cloneElement(child, {number: start + i});
72
+ });
73
+ const composed = [styles.wrap, className].filter(Boolean).join(' ');
74
+ return (
75
+ <section className={composed}>
76
+ {title && <h2 className={styles.title}>{title}</h2>}
77
+ {lede && <p className={styles.lede}>{lede}</p>}
78
+ {numbered}
79
+ </section>
80
+ );
81
+ }
@@ -0,0 +1,82 @@
1
+ /**
2
+ * <SetupSteps /> + <SetupStep /> styles. Vertical numbered-row
3
+ * pattern for docs setup/install/walkthrough sections and editorial
4
+ * action lists. Small orange hex with a white number on the left,
5
+ * bold title + one short body paragraph on the right.
6
+ *
7
+ * Distinct from <HowSteps /> which is a 3-up card row for marketing
8
+ * surfaces. SetupSteps lives inside body prose, so steps stack
9
+ * vertically and read like sentences in a list.
10
+ *
11
+ * Mirrors preview/components/setup-steps.html.
12
+ */
13
+
14
+ .wrap {
15
+ margin: var(--space-7) 0;
16
+ font-family: var(--conduction-typography-font-family-body);
17
+ }
18
+
19
+ .title {
20
+ font-size: 28px;
21
+ font-weight: 700;
22
+ letter-spacing: -0.01em;
23
+ color: var(--c-cobalt-900);
24
+ margin: 0 0 var(--space-3);
25
+ line-height: 1.2;
26
+ }
27
+
28
+ .lede {
29
+ font-size: 16px;
30
+ line-height: 1.6;
31
+ color: var(--c-cobalt-700);
32
+ margin: 0 0 var(--space-5);
33
+ max-width: 60ch;
34
+ }
35
+
36
+ .row {
37
+ display: flex;
38
+ align-items: flex-start;
39
+ gap: var(--space-4);
40
+ margin: var(--space-4) 0;
41
+ }
42
+
43
+ .num {
44
+ width: 36px;
45
+ height: 42px;
46
+ clip-path: var(--hex-pointy-top);
47
+ background: var(--c-orange-knvb);
48
+ color: white;
49
+ display: flex;
50
+ align-items: center;
51
+ justify-content: center;
52
+ font-weight: 600;
53
+ flex-shrink: 0;
54
+ }
55
+
56
+ .body {
57
+ font-size: 14px;
58
+ line-height: 1.55;
59
+ color: var(--c-cobalt-700);
60
+ }
61
+
62
+ .body strong,
63
+ .bodyTitle {
64
+ display: block;
65
+ margin-bottom: 4px;
66
+ color: var(--c-cobalt-900);
67
+ font-size: 17px;
68
+ font-weight: 600;
69
+ }
70
+
71
+ .body p {
72
+ margin: 0;
73
+ }
74
+
75
+ .body code {
76
+ background: var(--c-cobalt-50);
77
+ padding: 1px 6px;
78
+ border-radius: 3px;
79
+ font-family: var(--conduction-typography-font-family-code);
80
+ font-size: 13px;
81
+ color: var(--c-cobalt-900);
82
+ }
@@ -48,6 +48,7 @@ export {default as ReferenceCard, ReferenceGrid} from './ReferenceCard/Reference
48
48
  export {default as PairCard, PairRow} from './PairCard/PairCard.jsx';
49
49
  export {default as FeatureList, FeatureItem} from './FeatureList/FeatureList.jsx';
50
50
  export {default as HowSteps, HowStep} from './HowSteps/HowSteps.jsx';
51
+ export {default as SetupSteps, SetupStep} from './SetupSteps/SetupSteps.jsx';
51
52
  export {default as FAQ, FAQItem} from './FAQ/FAQ.jsx';
52
53
  export {default as EmployeeCard, TeamGrid} from './EmployeeCard/EmployeeCard.jsx';
53
54
  export {default as DetailHero} from './DetailHero/DetailHero.jsx';