@zomako/elearning-components 2.0.3 → 2.0.5

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,211 @@
1
+ /* ---- Wrapper ---- */
2
+ .wrapper {
3
+ --timeline-accent: #2563eb;
4
+ --timeline-accent-hover: #1d4ed8;
5
+ --timeline-bg: #f8fafc;
6
+ --timeline-line: #e2e8f0;
7
+ --timeline-text: #1e293b;
8
+ --timeline-muted: #64748b;
9
+ --timeline-radius: 12px;
10
+ --timeline-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
11
+ font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
12
+ color: var(--timeline-text);
13
+ max-width: 100%;
14
+ display: flex;
15
+ flex-direction: column;
16
+ gap: 1.5rem;
17
+ }
18
+
19
+ /* ---- Content panel ---- */
20
+ .contentPanel {
21
+ background: var(--timeline-bg);
22
+ border-radius: var(--timeline-radius);
23
+ padding: 1.75rem 2rem;
24
+ box-shadow: var(--timeline-shadow);
25
+ min-height: 140px;
26
+ overflow: hidden;
27
+ }
28
+
29
+ .contentSlide {
30
+ animation: contentIn 0.35s ease-out forwards;
31
+ }
32
+
33
+ @keyframes contentIn {
34
+ from {
35
+ opacity: 0;
36
+ transform: translateY(8px);
37
+ }
38
+ to {
39
+ opacity: 1;
40
+ transform: translateY(0);
41
+ }
42
+ }
43
+
44
+ .contentYear {
45
+ display: inline-block;
46
+ font-size: 0.8125rem;
47
+ font-weight: 600;
48
+ letter-spacing: 0.05em;
49
+ text-transform: uppercase;
50
+ color: var(--timeline-accent);
51
+ margin-bottom: 0.35rem;
52
+ }
53
+
54
+ .contentTitle {
55
+ font-size: 1.375rem;
56
+ font-weight: 700;
57
+ line-height: 1.3;
58
+ margin: 0 0 0.75rem 0;
59
+ color: var(--timeline-text);
60
+ }
61
+
62
+ .contentBody {
63
+ font-size: 1rem;
64
+ line-height: 1.6;
65
+ color: var(--timeline-muted);
66
+ }
67
+
68
+ .contentBody p {
69
+ margin: 0 0 0.5rem 0;
70
+ }
71
+
72
+ .contentBody p:last-child {
73
+ margin-bottom: 0;
74
+ }
75
+
76
+ /* ---- Timeline section ---- */
77
+ .timelineSection {
78
+ display: flex;
79
+ align-items: center;
80
+ gap: 0.5rem;
81
+ }
82
+
83
+ .navButton {
84
+ flex-shrink: 0;
85
+ width: 2.5rem;
86
+ height: 2.5rem;
87
+ border-radius: 50%;
88
+ border: 2px solid var(--timeline-line);
89
+ background: #fff;
90
+ color: var(--timeline-text);
91
+ font-size: 1.5rem;
92
+ line-height: 1;
93
+ cursor: pointer;
94
+ display: flex;
95
+ align-items: center;
96
+ justify-content: center;
97
+ transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
98
+ }
99
+
100
+ .navButton:hover:not(:disabled) {
101
+ border-color: var(--timeline-accent);
102
+ background: var(--timeline-accent);
103
+ color: #fff;
104
+ }
105
+
106
+ .navButton:disabled {
107
+ opacity: 0.4;
108
+ cursor: not-allowed;
109
+ }
110
+
111
+ /* ---- Track (draggable scroll area) ---- */
112
+ .track {
113
+ flex: 1;
114
+ overflow-x: auto;
115
+ overflow-y: hidden;
116
+ scroll-behavior: smooth;
117
+ scrollbar-width: thin;
118
+ scrollbar-color: var(--timeline-line) transparent;
119
+ cursor: grab;
120
+ padding: 0.5rem 0;
121
+ margin: 0 -0.5rem;
122
+ }
123
+
124
+ .track.dragging {
125
+ cursor: grabbing;
126
+ scroll-behavior: auto;
127
+ }
128
+
129
+ .track::-webkit-scrollbar {
130
+ height: 6px;
131
+ }
132
+
133
+ .track::-webkit-scrollbar-track {
134
+ background: transparent;
135
+ }
136
+
137
+ .track::-webkit-scrollbar-thumb {
138
+ background: var(--timeline-line);
139
+ border-radius: 3px;
140
+ }
141
+
142
+ .trackInner {
143
+ display: flex;
144
+ gap: 0.75rem;
145
+ padding: 0 0.25rem;
146
+ min-width: min-content;
147
+ }
148
+
149
+ /* ---- Event markers ---- */
150
+ .marker {
151
+ flex-shrink: 0;
152
+ display: flex;
153
+ flex-direction: column;
154
+ align-items: center;
155
+ gap: 0.25rem;
156
+ padding: 0.75rem 1rem;
157
+ min-width: 100px;
158
+ border: 2px solid var(--timeline-line);
159
+ border-radius: var(--timeline-radius);
160
+ background: #fff;
161
+ color: var(--timeline-muted);
162
+ font: inherit;
163
+ cursor: pointer;
164
+ text-align: center;
165
+ transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease,
166
+ color 0.25s ease, box-shadow 0.25s ease;
167
+ }
168
+
169
+ .marker:hover {
170
+ border-color: var(--timeline-accent);
171
+ color: var(--timeline-accent);
172
+ }
173
+
174
+ .markerActive {
175
+ border-color: var(--timeline-accent);
176
+ background: var(--timeline-accent);
177
+ color: #fff;
178
+ transform: scale(1.08);
179
+ box-shadow: var(--timeline-shadow);
180
+ }
181
+
182
+ .markerActive:hover {
183
+ background: var(--timeline-accent-hover);
184
+ border-color: var(--timeline-accent-hover);
185
+ color: #fff;
186
+ }
187
+
188
+ .markerYear {
189
+ font-size: 0.8125rem;
190
+ font-weight: 700;
191
+ letter-spacing: 0.02em;
192
+ }
193
+
194
+ .markerTitle {
195
+ font-size: 0.8125rem;
196
+ font-weight: 500;
197
+ line-height: 1.25;
198
+ display: -webkit-box;
199
+ -webkit-line-clamp: 2;
200
+ -webkit-box-orient: vertical;
201
+ overflow: hidden;
202
+ }
203
+
204
+ /* ---- Empty state ---- */
205
+ .empty {
206
+ margin: 0;
207
+ padding: 2rem;
208
+ text-align: center;
209
+ color: var(--timeline-muted);
210
+ font-size: 1rem;
211
+ }
package/src/index.ts CHANGED
@@ -1,3 +1,8 @@
1
1
  // src/index.ts
2
2
  export { default as FlashcardDeck } from './components/FlashcardDeck';
3
- export { default as Accordion, type AccordionProps, type AccordionItem } from './components/Accordion';
3
+ export { default as Accordion, type AccordionProps, type AccordionItem } from './components/Accordion';
4
+ export {
5
+ default as InteractiveTimeline,
6
+ type TimelineEvent,
7
+ type InteractiveTimelineProps,
8
+ } from './components/InteractiveTimeline';