create-trellis-docs 1.0.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.
Files changed (148) hide show
  1. package/bin/index.js +29 -0
  2. package/lib/index.js +178 -0
  3. package/package.json +23 -0
  4. package/template/_gitignore +6 -0
  5. package/template/blog/2025-01-01-welcome.md +15 -0
  6. package/template/design-tokens.json +218 -0
  7. package/template/docs/faq/general.mdx +16 -0
  8. package/template/docs/faq/index.mdx +13 -0
  9. package/template/docs/getting-started.mdx +54 -0
  10. package/template/docs/guides/writing-docs.mdx +90 -0
  11. package/template/docusaurus.config.js.tpl +200 -0
  12. package/template/package.json.tpl +60 -0
  13. package/template/packages/faq-index-plugin/README.md +104 -0
  14. package/template/packages/faq-index-plugin/index.js +91 -0
  15. package/template/packages/faq-index-plugin/package.json +15 -0
  16. package/template/packages/redirects-plugin/README.md +186 -0
  17. package/template/packages/redirects-plugin/index.js +167 -0
  18. package/template/packages/redirects-plugin/package.json +15 -0
  19. package/template/packages/redirects-plugin/yarn.lock +31 -0
  20. package/template/redirects.json +1 -0
  21. package/template/scripts/build-tokens.js +34 -0
  22. package/template/sidebars.js +17 -0
  23. package/template/src/components/CustomSearch/CustomSearch.js +241 -0
  24. package/template/src/components/CustomSearch/CustomSearchContent.js +171 -0
  25. package/template/src/components/CustomSearch/NavbarSearch.js +211 -0
  26. package/template/src/components/CustomSearch/SearchContext.js +26 -0
  27. package/template/src/components/CustomSearch/styles.module.css +171 -0
  28. package/template/src/components/CustomSearch/wrapperInit.js +11 -0
  29. package/template/src/components/FaqTableOfContents/index.jsx +176 -0
  30. package/template/src/components/FaqTableOfContents/styles.module.css +167 -0
  31. package/template/src/components/Feedback/Feedback.js +310 -0
  32. package/template/src/components/Feedback/api.js +77 -0
  33. package/template/src/components/FlippingCard/FlippingCard.js +197 -0
  34. package/template/src/components/FlippingCard/styles.module.css +248 -0
  35. package/template/src/components/Glossary.js +57 -0
  36. package/template/src/css/custom.css +765 -0
  37. package/template/src/data/glossary.json +1 -0
  38. package/template/src/pages/index.js.tpl +38 -0
  39. package/template/src/theme/Admonition/Icon/Danger.js +11 -0
  40. package/template/src/theme/Admonition/Icon/Info.js +11 -0
  41. package/template/src/theme/Admonition/Icon/Note.js +11 -0
  42. package/template/src/theme/Admonition/Icon/Tip.js +11 -0
  43. package/template/src/theme/Admonition/Icon/Warning.js +11 -0
  44. package/template/src/theme/Admonition/Layout/index.js +39 -0
  45. package/template/src/theme/Admonition/Layout/styles.module.css +36 -0
  46. package/template/src/theme/Admonition/Type/Caution.js +28 -0
  47. package/template/src/theme/Admonition/Type/Danger.js +26 -0
  48. package/template/src/theme/Admonition/Type/Info.js +26 -0
  49. package/template/src/theme/Admonition/Type/Note.js +26 -0
  50. package/template/src/theme/Admonition/Type/Tip.js +26 -0
  51. package/template/src/theme/Admonition/Type/Warning.js +26 -0
  52. package/template/src/theme/Admonition/Types.js +27 -0
  53. package/template/src/theme/Admonition/index.js +18 -0
  54. package/template/src/theme/AnnouncementBar/CloseButton/index.js +20 -0
  55. package/template/src/theme/AnnouncementBar/CloseButton/styles.module.css +4 -0
  56. package/template/src/theme/AnnouncementBar/Content/index.js +17 -0
  57. package/template/src/theme/AnnouncementBar/Content/styles.module.css +10 -0
  58. package/template/src/theme/AnnouncementBar/index.js +33 -0
  59. package/template/src/theme/AnnouncementBar/styles.module.css +55 -0
  60. package/template/src/theme/BlogSidebar/Content/index.js +35 -0
  61. package/template/src/theme/BlogSidebar/Desktop/index.js +44 -0
  62. package/template/src/theme/BlogSidebar/Desktop/styles.module.css +60 -0
  63. package/template/src/theme/BlogSidebar/Mobile/index.js +38 -0
  64. package/template/src/theme/BlogSidebar/Mobile/styles.module.css +3 -0
  65. package/template/src/theme/BlogSidebar/index.js +15 -0
  66. package/template/src/theme/Details/index.js +23 -0
  67. package/template/src/theme/Details/styles.module.css +52 -0
  68. package/template/src/theme/DocBreadcrumbs/Items/Home/index.js +22 -0
  69. package/template/src/theme/DocBreadcrumbs/Items/Home/styles.module.css +7 -0
  70. package/template/src/theme/DocBreadcrumbs/StructuredData/index.js +15 -0
  71. package/template/src/theme/DocBreadcrumbs/index.js +75 -0
  72. package/template/src/theme/DocBreadcrumbs/styles.module.css +5 -0
  73. package/template/src/theme/DocCard/index.js +93 -0
  74. package/template/src/theme/DocCard/styles.module.css +53 -0
  75. package/template/src/theme/DocCardList/index.js +27 -0
  76. package/template/src/theme/DocCardList/styles.module.css +7 -0
  77. package/template/src/theme/DocItem/Content/index.js +121 -0
  78. package/template/src/theme/DocItem/Content/styles.module.css +96 -0
  79. package/template/src/theme/DocItem/Footer/index.js +43 -0
  80. package/template/src/theme/DocItem/Footer/styles.module.css +19 -0
  81. package/template/src/theme/DocItem/Layout/index.js +55 -0
  82. package/template/src/theme/DocItem/Layout/styles.module.css +14 -0
  83. package/template/src/theme/DocItem/Metadata/index.js +17 -0
  84. package/template/src/theme/DocItem/Paginator/index.js +17 -0
  85. package/template/src/theme/DocItem/TOC/Desktop/index.js +15 -0
  86. package/template/src/theme/DocItem/TOC/Mobile/index.js +17 -0
  87. package/template/src/theme/DocItem/TOC/Mobile/styles.module.css +12 -0
  88. package/template/src/theme/DocItem/index.js +19 -0
  89. package/template/src/theme/DocItem/styles.module.css +28 -0
  90. package/template/src/theme/DocRoot/Layout/Main/index.js +23 -0
  91. package/template/src/theme/DocRoot/Layout/Main/styles.module.css +31 -0
  92. package/template/src/theme/DocRoot/Layout/Sidebar/ExpandButton/index.js +28 -0
  93. package/template/src/theme/DocRoot/Layout/Sidebar/ExpandButton/styles.module.css +27 -0
  94. package/template/src/theme/DocRoot/Layout/Sidebar/index.js +70 -0
  95. package/template/src/theme/DocRoot/Layout/Sidebar/styles.module.css +32 -0
  96. package/template/src/theme/DocRoot/Layout/index.js +27 -0
  97. package/template/src/theme/DocRoot/Layout/styles.module.css +9 -0
  98. package/template/src/theme/DocRoot/index.js +25 -0
  99. package/template/src/theme/DocSidebar/Desktop/CollapseButton/index.js +28 -0
  100. package/template/src/theme/DocSidebar/Desktop/CollapseButton/styles.module.css +40 -0
  101. package/template/src/theme/DocSidebar/Desktop/Content/index.js +44 -0
  102. package/template/src/theme/DocSidebar/Desktop/Content/styles.module.css +16 -0
  103. package/template/src/theme/DocSidebar/Desktop/index.js +28 -0
  104. package/template/src/theme/DocSidebar/Desktop/styles.module.css +37 -0
  105. package/template/src/theme/DocSidebar/Mobile/index.js +39 -0
  106. package/template/src/theme/DocSidebar/index.js +18 -0
  107. package/template/src/theme/DocSidebarItem/Category/index.js +203 -0
  108. package/template/src/theme/DocSidebarItem/Html/index.js +20 -0
  109. package/template/src/theme/DocSidebarItem/Html/styles.module.css +6 -0
  110. package/template/src/theme/DocSidebarItem/Link/index.js +49 -0
  111. package/template/src/theme/DocSidebarItem/Link/styles.module.css +3 -0
  112. package/template/src/theme/DocSidebarItem/index.js +15 -0
  113. package/template/src/theme/EditMetaRow/index.js +25 -0
  114. package/template/src/theme/EditMetaRow/styles.module.css +11 -0
  115. package/template/src/theme/EditThisPage/index.js +29 -0
  116. package/template/src/theme/ErrorPageContent.js +34 -0
  117. package/template/src/theme/Footer/Copyright/index.js +11 -0
  118. package/template/src/theme/Footer/Layout/index.js +21 -0
  119. package/template/src/theme/Footer/LinkItem/index.js +26 -0
  120. package/template/src/theme/Footer/Links/MultiColumn/index.js +44 -0
  121. package/template/src/theme/Footer/Links/Simple/index.js +32 -0
  122. package/template/src/theme/Footer/Links/index.js +11 -0
  123. package/template/src/theme/Footer/Logo/index.js +35 -0
  124. package/template/src/theme/Footer/Logo/styles.module.css +9 -0
  125. package/template/src/theme/Footer/index.js +22 -0
  126. package/template/src/theme/MDXComponents/Heading.js +120 -0
  127. package/template/src/theme/MDXComponents/index.js +17 -0
  128. package/template/src/theme/MDXComponents/styles.module.css +110 -0
  129. package/template/src/theme/MDXContent/index.js +6 -0
  130. package/template/src/theme/NavbarItem/DropdownNavbarItem/Desktop/index.js +110 -0
  131. package/template/src/theme/NavbarItem/DropdownNavbarItem/Mobile/index.js +136 -0
  132. package/template/src/theme/NavbarItem/DropdownNavbarItem/Mobile/styles.module.css +3 -0
  133. package/template/src/theme/NavbarItem/DropdownNavbarItem/index.js +7 -0
  134. package/template/src/theme/NotFound/Content/index.js +46 -0
  135. package/template/src/theme/NotFound/index.js +19 -0
  136. package/template/src/theme/NotFound.js +49 -0
  137. package/template/src/theme/PaginatorNavLink/index.js +17 -0
  138. package/template/src/theme/TOC/index.js +19 -0
  139. package/template/src/theme/TOC/styles.module.css +16 -0
  140. package/template/src/theme/TOCItems/Tree.js +30 -0
  141. package/template/src/theme/TOCItems/index.js +47 -0
  142. package/template/src/theme/TabItem/index.js +15 -0
  143. package/template/src/theme/TabItem/styles.module.css +10 -0
  144. package/template/src/theme/Tabs/index.js +189 -0
  145. package/template/src/theme/Tabs/styles.module.css +74 -0
  146. package/template/static/img/favicon.svg +4 -0
  147. package/template/static/img/oops-404.svg +11 -0
  148. package/template/static/searchIndex.json +1 -0
@@ -0,0 +1,197 @@
1
+ import React, { useState } from 'react';
2
+ import styles from './styles.module.css';
3
+
4
+ function ArrowLeftIcon({ className }) {
5
+ return (
6
+ <svg
7
+ className={className}
8
+ width="16"
9
+ height="16"
10
+ viewBox="0 0 24 24"
11
+ fill="none"
12
+ stroke="currentColor"
13
+ strokeWidth="2"
14
+ strokeLinecap="round"
15
+ strokeLinejoin="round"
16
+ >
17
+ <polyline points="15 18 9 12 15 6" />
18
+ </svg>
19
+ );
20
+ }
21
+
22
+ const FlippingCard = ({ data }) => {
23
+ const [flippedCardIndex, setFlippedCardIndex] = useState(null);
24
+
25
+ const handleCardFlip = (index) => {
26
+ if (flippedCardIndex === index) {
27
+ setFlippedCardIndex(null);
28
+ } else {
29
+ setFlippedCardIndex(index);
30
+ }
31
+ };
32
+
33
+ return (
34
+ <div className={styles.cardGallery}>
35
+ {data.map((card, index) => (
36
+ <div className={styles.cardGridItem} key={index}>
37
+ <CardComponent
38
+ byline={card.byline}
39
+ title={card.title}
40
+ description={card.description}
41
+ frontContent={card.frontContent}
42
+ checkYourKnowledge={card.checkYourKnowledge}
43
+ isFlipped={flippedCardIndex === index}
44
+ onFlip={() => handleCardFlip(index)}
45
+ />
46
+ </div>
47
+ ))}
48
+ </div>
49
+ );
50
+ };
51
+
52
+ const CardComponent = ({
53
+ byline,
54
+ title,
55
+ description,
56
+ frontContent,
57
+ checkYourKnowledge,
58
+ isFlipped,
59
+ onFlip,
60
+ }) => {
61
+ const [selectedAnswer, setSelectedAnswer] = useState(null);
62
+ const [showExplanation, setShowExplanation] = useState(false);
63
+
64
+ const handleFlip = () => {
65
+ onFlip();
66
+ if (!isFlipped) {
67
+ setSelectedAnswer(null);
68
+ setShowExplanation(false);
69
+ }
70
+ };
71
+
72
+ const handleKeyPress = (e) => {
73
+ if (e.key === 'Enter' || e.key === ' ') {
74
+ handleFlip();
75
+ }
76
+ };
77
+
78
+ const handleAnswerSelect = (event) => {
79
+ setSelectedAnswer(Number(event.target.value));
80
+ };
81
+
82
+ const handleSubmit = (e) => {
83
+ e.stopPropagation();
84
+ setShowExplanation(true);
85
+ };
86
+
87
+ const getExplanations = () => {
88
+ const correctExplanation = checkYourKnowledge.explanations.find(
89
+ (exp) => exp.isCorrect
90
+ );
91
+ const selectedExplanation = checkYourKnowledge.explanations[selectedAnswer];
92
+ return {
93
+ correct: correctExplanation ? correctExplanation.text : '',
94
+ selected: selectedExplanation ? selectedExplanation.text : '',
95
+ };
96
+ };
97
+
98
+ return (
99
+ <div
100
+ className={`${styles.flipCard} ${isFlipped ? styles.flipped : ''}`}
101
+ onClick={handleFlip}
102
+ onKeyPress={handleKeyPress}
103
+ role="button"
104
+ aria-label={
105
+ isFlipped ? 'Show front of the card' : 'Show back of the card'
106
+ }
107
+ aria-live="polite"
108
+ tabIndex="0"
109
+ >
110
+ <div className={styles.flipCardInner}>
111
+ <div className={styles.flipCardFront}>
112
+ <div className={styles.cardContainer}>
113
+ <div className={styles.cardContent}>
114
+ <div className={styles.smallByline}>{byline}</div>
115
+ <h3 className={styles.cardTitle}>{title}</h3>
116
+ <div className={styles.cardDescription}>
117
+ <p>{description}</p>
118
+ {frontContent.map((content, index) => (
119
+ <p key={index}>{content}</p>
120
+ ))}
121
+ </div>
122
+ </div>
123
+ <div className={styles.ctaContainer}>
124
+ <button className="button button--primary" onClick={handleFlip}>
125
+ Quiz Yourself
126
+ </button>
127
+ </div>
128
+ </div>
129
+ </div>
130
+ <div className={styles.flipCardBack}>
131
+ <div className={styles.cardContainer}>
132
+ <div className={styles.cardContent}>
133
+ <div className={styles.smallBylineBack}>{title}</div>
134
+ <div
135
+ className={styles.quizContainer}
136
+ onClick={(e) => e.stopPropagation()}
137
+ >
138
+ {showExplanation ? (
139
+ <div className={styles.explanation}>
140
+ <h3 className={styles.explanationResult}>
141
+ {selectedAnswer === checkYourKnowledge.correctAnswer
142
+ ? 'Correct!'
143
+ : 'Incorrect.'}
144
+ </h3>
145
+ <div className={styles.explanationText}>
146
+ {selectedAnswer !== checkYourKnowledge.correctAnswer && (
147
+ <p className={styles.incorrectExplanation}>
148
+ {getExplanations().selected}
149
+ </p>
150
+ )}
151
+ <p className={styles.correctExplanation}>
152
+ {getExplanations().correct}
153
+ </p>
154
+ </div>
155
+ </div>
156
+ ) : (
157
+ <>
158
+ <h5 className={styles.quizQuestion}>
159
+ {checkYourKnowledge.question}
160
+ </h5>
161
+ <div className={styles.quizForm}>
162
+ {checkYourKnowledge.options.map((option, index) => (
163
+ <label key={index} className={styles.quizOption}>
164
+ <input
165
+ type="radio"
166
+ name="quizOptions"
167
+ value={index}
168
+ checked={selectedAnswer === index}
169
+ onChange={handleAnswerSelect}
170
+ className={styles.quizRadio}
171
+ />
172
+ <span className={styles.quizLabel}>{option}</span>
173
+ </label>
174
+ ))}
175
+ </div>
176
+ <button
177
+ className={styles.checkAnswerButton}
178
+ onClick={handleSubmit}
179
+ disabled={selectedAnswer === null}
180
+ >
181
+ Check Your Answer
182
+ </button>
183
+ </>
184
+ )}
185
+ </div>
186
+ </div>
187
+ <div className={styles.ctaContainer}>
188
+ <ArrowLeftIcon className={styles.ctaArrow} />
189
+ </div>
190
+ </div>
191
+ </div>
192
+ </div>
193
+ </div>
194
+ );
195
+ };
196
+
197
+ export default FlippingCard;
@@ -0,0 +1,248 @@
1
+ .flipCard {
2
+ perspective: 1000px;
3
+ width: 100%;
4
+ height: 415px;
5
+ margin-bottom: 0.25rem;
6
+ border-radius: 8px;
7
+ }
8
+
9
+ .flipCard:focus {
10
+ outline: 2px solid var(--ifm-color-primary);
11
+ outline-offset: 2px;
12
+ }
13
+
14
+ .flipCardInner {
15
+ position: relative;
16
+ width: 100%;
17
+ height: 100%;
18
+ transition: transform 0.6s;
19
+ transform-style: preserve-3d;
20
+ }
21
+
22
+ .flipCard.flipped .flipCardInner {
23
+ transform: rotateY(180deg);
24
+ }
25
+
26
+ [data-theme='dark'] .flipCardFront {
27
+ background-color: var(--ifm-background-color);
28
+ }
29
+
30
+ .flipCardFront,
31
+ .flipCardBack {
32
+ position: absolute;
33
+ width: 100%;
34
+ height: 100%;
35
+ backface-visibility: hidden;
36
+ display: flex;
37
+ align-items: stretch;
38
+ justify-content: flex-start;
39
+ border-radius: 8px;
40
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
41
+ }
42
+
43
+ .flipCardBack {
44
+ transform: rotateY(180deg);
45
+ background-color: var(--ifm-color-primary);
46
+ color: var(--ifm-color-white);
47
+ overflow-y: auto;
48
+ }
49
+
50
+ .flipCardFront {
51
+ border: 0.25px solid var(--ifm-color-primary-lighter);
52
+ }
53
+
54
+ [data-theme='dark'] .flipCardBack {
55
+ color: var(--accent-teal-400-value, #2dd4bf);
56
+ }
57
+
58
+ .cardGallery {
59
+ padding: 10px 0 0;
60
+ display: grid;
61
+ grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
62
+ gap: 1.5rem;
63
+ }
64
+
65
+ .cardGridItem {
66
+ min-width: 0;
67
+ }
68
+
69
+ .cardContainer {
70
+ width: 100%;
71
+ height: 100%;
72
+ padding: 1rem;
73
+ display: flex;
74
+ flex-direction: column;
75
+ justify-content: space-between;
76
+ }
77
+ [data-theme='dark'] .cardContainer {
78
+ background-color: none;
79
+ }
80
+
81
+ .cardContent {
82
+ flex-grow: 1;
83
+ overflow-y: auto;
84
+ display: flex;
85
+ flex-direction: column;
86
+ }
87
+
88
+ .smallByline {
89
+ font-size: 11px;
90
+ color: var(--ifm-color-primary-light);
91
+ font-weight: bold;
92
+ text-transform: uppercase;
93
+ letter-spacing: 1.5px;
94
+ margin-bottom: 1.25rem;
95
+ }
96
+
97
+ .smallBylineBack {
98
+ font-size: 12px;
99
+ color: white;
100
+ font-weight: bold;
101
+ text-transform: uppercase;
102
+ letter-spacing: 1.5px;
103
+ margin-bottom: 1.25rem;
104
+ }
105
+
106
+ .cardTitle {
107
+ font-size: 1.25rem;
108
+ margin-bottom: 0.75rem;
109
+ }
110
+
111
+ .cardDescription p {
112
+ font-size: 0.9rem;
113
+ line-height: 1.4;
114
+ margin-top: 0;
115
+ margin-bottom: 1.5rem;
116
+ }
117
+
118
+ .cardDescription p:last-child {
119
+ margin-bottom: 0;
120
+ }
121
+
122
+ .ctaContainer {
123
+ cursor: pointer;
124
+ display: flex;
125
+ justify-content: flex-end;
126
+ padding-top: 1rem;
127
+ border-top: 1px solid rgba(0, 0, 0, 0.1);
128
+ }
129
+
130
+ [data-theme='dark'] .ctaContainer {
131
+ border-top: 1px solid rgba(255, 255, 255, 0.1);
132
+ }
133
+
134
+ .flipCardBack .ctaContainer {
135
+ border-top-color: rgba(255, 255, 255, 0.1);
136
+ }
137
+
138
+ .ctaArrow {
139
+ color: var(--ifm-color-primary);
140
+ }
141
+
142
+ .flipCardBack .ctaArrow {
143
+ color: var(--ifm-color-white);
144
+ }
145
+
146
+ .quizContainer {
147
+ margin-top: 0.25rem;
148
+ }
149
+
150
+ .quizQuestion {
151
+ font-size: 18px;
152
+ font-weight: 500;
153
+ margin-bottom: 1rem;
154
+ }
155
+
156
+ .quizForm {
157
+ display: flex;
158
+ flex-direction: column;
159
+ gap: 0.5rem;
160
+ }
161
+
162
+ .quizOption {
163
+ display: flex;
164
+ align-items: center;
165
+ gap: 0.5rem;
166
+ font-size: 0.875rem;
167
+ cursor: pointer;
168
+ padding: 0.25rem 0;
169
+ }
170
+
171
+ .quizRadio {
172
+ accent-color: var(--ifm-color-white);
173
+ width: 16px;
174
+ height: 16px;
175
+ cursor: pointer;
176
+ }
177
+
178
+ .quizLabel {
179
+ cursor: pointer;
180
+ }
181
+
182
+ .explanation {
183
+ margin-top: 1rem;
184
+ padding: 1rem;
185
+ background-color: rgba(255, 255, 255, 0.1);
186
+ border-radius: 4px;
187
+ }
188
+
189
+ .explanationResult {
190
+ font-size: 15px;
191
+ font-weight: 600;
192
+ margin-bottom: 0.5rem;
193
+ }
194
+
195
+ .explanationText {
196
+ font-size: 14px;
197
+ }
198
+
199
+ .checkAnswerButton {
200
+ display: inline-block;
201
+ margin-top: 1rem;
202
+ padding: 0.5rem 1rem;
203
+ font-size: 1rem;
204
+ font-weight: 500;
205
+ text-align: center;
206
+ text-decoration: none;
207
+ background-color: transparent;
208
+ color: white;
209
+ border: 1px solid white;
210
+ border-radius: 6px;
211
+ cursor: pointer;
212
+ transition:
213
+ background-color 0.3s,
214
+ color 0.3s;
215
+ }
216
+
217
+ [data-theme='dark'] .checkAnswerButton {
218
+ color: var(--accent-teal-400-value, #2dd4bf);
219
+ border: 1px solid var(--accent-teal-400-value, #2dd4bf);
220
+ }
221
+
222
+ .checkAnswerButton:hover:not(:disabled) {
223
+ background-color: white;
224
+ color: var(--ifm-color-primary);
225
+ }
226
+
227
+ [data-theme='dark'] .checkAnswerButton:hover:not(:disabled) {
228
+ background-color: rgba(45, 212, 191, 0.15);
229
+ }
230
+
231
+ .checkAnswerButton:disabled {
232
+ opacity: 0.7;
233
+ cursor: not-allowed;
234
+ }
235
+
236
+ @media (min-width: 768px) {
237
+ .cardContainer {
238
+ padding: 1.25rem;
239
+ }
240
+
241
+ .cardTitle {
242
+ font-size: 1.5rem;
243
+ }
244
+
245
+ .cardDescription {
246
+ font-size: 1rem;
247
+ }
248
+ }
@@ -0,0 +1,57 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import glossaryData from '../data/glossary.json';
3
+
4
+ const Glossary = () => {
5
+ const [glossary, setGlossary] = useState([]);
6
+
7
+ useEffect(() => {
8
+ // Extract and sort glossary entries
9
+ const sortedGlossary = Object.entries(glossaryData)
10
+ .map(([term, definition]) => {
11
+ if (typeof definition === 'object') {
12
+ return {
13
+ term,
14
+ definition: Object.entries(definition).map(
15
+ ([subTerm, subDefinition]) => ({
16
+ term: subTerm,
17
+ definition: subDefinition,
18
+ })
19
+ ),
20
+ };
21
+ }
22
+ return { term, definition };
23
+ })
24
+ .sort((a, b) => a.term.localeCompare(b.term));
25
+
26
+ setGlossary(sortedGlossary);
27
+ }, []);
28
+
29
+ return (
30
+ <div>
31
+ <dl>
32
+ {glossary.map(({ term, definition }) => (
33
+ <div key={term}>
34
+ <dt>
35
+ <strong>{term}</strong>
36
+ </dt>
37
+ {Array.isArray(definition) ? (
38
+ <dd>
39
+ <ul>
40
+ {definition.map((subItem) => (
41
+ <li key={subItem.term}>
42
+ <strong>{subItem.term}:</strong> {subItem.definition}
43
+ </li>
44
+ ))}
45
+ </ul>
46
+ </dd>
47
+ ) : (
48
+ <dd>{definition}</dd>
49
+ )}
50
+ </div>
51
+ ))}
52
+ </dl>
53
+ </div>
54
+ );
55
+ };
56
+
57
+ export default Glossary;