@zomako/elearning-components 2.0.5 → 2.0.7

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/src/App.jsx CHANGED
@@ -1,9 +1,16 @@
1
1
  import React from 'react';
2
- import { Accordion, FlashcardDeck } from './index';
2
+ import {
3
+ Accordion,
4
+ FlashcardDeck,
5
+ InteractiveTimeline,
6
+ MatchingActivity,
7
+ SortingActivity,
8
+ DragAndDropActivity,
9
+ } from './index';
3
10
 
4
11
  const accordionItems = [
5
12
  { id: 'getting-started', title: 'Getting started', content: 'Install the package and import the components you need.' },
6
- { id: 'components', title: 'Components', content: 'FlashcardDeck and Accordion are available. See each component README for usage.' },
13
+ { id: 'components', title: 'Components', content: 'Accordion, FlashcardDeck, InteractiveTimeline, MatchingActivity, SortingActivity, and DragAndDropActivity are available.' },
7
14
  { id: 'support', title: 'Support', content: 'Check the repository for documentation and issues.' },
8
15
  ];
9
16
 
@@ -12,18 +19,91 @@ const sampleCards = [
12
19
  { front: 'Front 2', back: 'Back 2' },
13
20
  ];
14
21
 
22
+ const timelineEvents = [
23
+ { id: '1', year: '2020', title: 'Project kickoff', content: <p>The project started with a small team and a clear roadmap.</p> },
24
+ { id: '2', year: '2021', title: 'First release', content: <p>We shipped the first public version and gathered feedback.</p> },
25
+ { id: '3', year: '2022', title: 'Scale and grow', content: <p>Focus shifted to performance and scaling for enterprise.</p> },
26
+ ];
27
+
28
+ const matchingItems = [
29
+ { id: 'a', content: 'Paris', matchId: 'capital-france' },
30
+ { id: 'b', content: 'Berlin', matchId: 'capital-germany' },
31
+ { id: 'c', content: 'Madrid', matchId: 'capital-spain' },
32
+ ];
33
+
34
+ const matchingTargets = [
35
+ { id: 'capital-france', content: 'France' },
36
+ { id: 'capital-germany', content: 'Germany' },
37
+ { id: 'capital-spain', content: 'Spain' },
38
+ ];
39
+
40
+ const sortableItems = [
41
+ { id: '1', content: 'First step: Plan the project' },
42
+ { id: '2', content: 'Second step: Build the prototype' },
43
+ { id: '3', content: 'Third step: Test and iterate' },
44
+ { id: '4', content: 'Fourth step: Launch' },
45
+ ];
46
+
47
+ const correctOrder = ['1', '2', '3', '4'];
48
+
49
+ const dragDropItems = [
50
+ { id: 'paris', content: 'Paris' },
51
+ { id: 'berlin', content: 'Berlin' },
52
+ { id: 'madrid', content: 'Madrid' },
53
+ ];
54
+
55
+ const dragDropTargets = [
56
+ { id: 'target-fr', accepts: ['paris'], label: 'Capital of France' },
57
+ { id: 'target-de', accepts: ['berlin'], label: 'Capital of Germany' },
58
+ { id: 'target-es', accepts: ['madrid'], label: 'Capital of Spain' },
59
+ ];
60
+
15
61
  export default function App() {
16
62
  return (
17
- <div style={{ padding: '2rem', maxWidth: 640, margin: '0 auto' }}>
63
+ <div style={{ padding: '2rem', maxWidth: 800, margin: '0 auto' }}>
18
64
  <h1>E-learning Components</h1>
19
- <section style={{ marginBottom: '2rem' }}>
65
+
66
+ <section style={{ marginBottom: '2.5rem' }}>
20
67
  <h2>Accordion</h2>
21
68
  <Accordion items={accordionItems} />
22
69
  </section>
23
- <section>
70
+
71
+ <section style={{ marginBottom: '2.5rem' }}>
24
72
  <h2>FlashcardDeck</h2>
25
73
  <FlashcardDeck cards={sampleCards} />
26
74
  </section>
75
+
76
+ <section style={{ marginBottom: '2.5rem' }}>
77
+ <h2>InteractiveTimeline</h2>
78
+ <InteractiveTimeline events={timelineEvents} />
79
+ </section>
80
+
81
+ <section style={{ marginBottom: '2.5rem' }}>
82
+ <h2>MatchingActivity</h2>
83
+ <MatchingActivity
84
+ items={matchingItems}
85
+ targets={matchingTargets}
86
+ onComplete={(result) => console.log('Matching result:', result)}
87
+ />
88
+ </section>
89
+
90
+ <section style={{ marginBottom: '2.5rem' }}>
91
+ <h2>SortingActivity</h2>
92
+ <SortingActivity
93
+ items={sortableItems}
94
+ correctOrder={correctOrder}
95
+ onComplete={(result) => console.log('Sorting result:', result)}
96
+ />
97
+ </section>
98
+
99
+ <section>
100
+ <h2>DragAndDropActivity</h2>
101
+ <DragAndDropActivity
102
+ items={dragDropItems}
103
+ targets={dragDropTargets}
104
+ onComplete={(result) => console.log('Drag and drop result:', result)}
105
+ />
106
+ </section>
27
107
  </div>
28
108
  );
29
109
  }
package/src/index.ts CHANGED
@@ -1,8 +1,25 @@
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 '../Accordion';
4
4
  export {
5
5
  default as InteractiveTimeline,
6
6
  type TimelineEvent,
7
7
  type InteractiveTimelineProps,
8
- } from './components/InteractiveTimeline';
8
+ } from './components/InteractiveTimeline';
9
+ export {
10
+ default as MatchingActivity,
11
+ type MatchItem,
12
+ type MatchTarget,
13
+ type MatchingActivityProps,
14
+ } from '../MatchingActivity';
15
+ export {
16
+ default as SortingActivity,
17
+ type SortableItem,
18
+ type SortingActivityProps,
19
+ } from '../SortingActivity';
20
+ export {
21
+ default as DragAndDropActivity,
22
+ type DraggableItem,
23
+ type DropTarget,
24
+ type DragAndDropProps,
25
+ } from '../DragAndDropActivity';