@contractspec/example.learning-journey-ui-shared 1.44.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/.turbo/turbo-build$colon$bundle.log +48 -0
- package/.turbo/turbo-build.log +49 -0
- package/CHANGELOG.md +211 -0
- package/LICENSE +21 -0
- package/README.md +42 -0
- package/dist/components/BadgeDisplay.d.ts +12 -0
- package/dist/components/BadgeDisplay.d.ts.map +1 -0
- package/dist/components/BadgeDisplay.js +45 -0
- package/dist/components/BadgeDisplay.js.map +1 -0
- package/dist/components/StreakCounter.d.ts +12 -0
- package/dist/components/StreakCounter.d.ts.map +1 -0
- package/dist/components/StreakCounter.js +46 -0
- package/dist/components/StreakCounter.js.map +1 -0
- package/dist/components/ViewTabs.d.ts +12 -0
- package/dist/components/ViewTabs.d.ts.map +1 -0
- package/dist/components/ViewTabs.js +49 -0
- package/dist/components/ViewTabs.js.map +1 -0
- package/dist/components/XpBar.d.ts +14 -0
- package/dist/components/XpBar.d.ts.map +1 -0
- package/dist/components/XpBar.js +47 -0
- package/dist/components/XpBar.js.map +1 -0
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.js +6 -0
- package/dist/docs/index.d.ts +1 -0
- package/dist/docs/index.js +1 -0
- package/dist/docs/learning-journey-ui-shared.docblock.d.ts +1 -0
- package/dist/docs/learning-journey-ui-shared.docblock.js +20 -0
- package/dist/docs/learning-journey-ui-shared.docblock.js.map +1 -0
- package/dist/example.d.ts +33 -0
- package/dist/example.d.ts.map +1 -0
- package/dist/example.js +35 -0
- package/dist/example.js.map +1 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +3 -0
- package/dist/hooks/useLearningProgress.d.ts +22 -0
- package/dist/hooks/useLearningProgress.d.ts.map +1 -0
- package/dist/hooks/useLearningProgress.js +74 -0
- package/dist/hooks/useLearningProgress.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +11 -0
- package/dist/types.d.ts +58 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +0 -0
- package/example.ts +1 -0
- package/package.json +75 -0
- package/src/components/BadgeDisplay.tsx +65 -0
- package/src/components/StreakCounter.tsx +49 -0
- package/src/components/ViewTabs.tsx +46 -0
- package/src/components/XpBar.tsx +54 -0
- package/src/components/index.ts +4 -0
- package/src/docs/index.ts +1 -0
- package/src/docs/learning-journey-ui-shared.docblock.ts +17 -0
- package/src/example.ts +23 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useLearningProgress.ts +101 -0
- package/src/index.ts +20 -0
- package/src/types.ts +61 -0
- package/tsconfig.json +9 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/tsdown.config.js +17 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
$ tsdown
|
|
2
|
+
[34mℹ[39m tsdown [2mv0.18.3[22m powered by rolldown [2mv1.0.0-beta.57[22m
|
|
3
|
+
[34mℹ[39m config file: [4m/home/runner/work/contractspec/contractspec/packages/examples/learning-journey-ui-shared/tsdown.config.js[24m
|
|
4
|
+
[34mℹ[39m entry: [34msrc/example.ts, src/index.ts, src/types.ts, src/components/BadgeDisplay.tsx, src/components/StreakCounter.tsx, src/components/ViewTabs.tsx, src/components/XpBar.tsx, src/components/index.ts, src/docs/index.ts, src/docs/learning-journey-ui-shared.docblock.ts, src/hooks/index.ts, src/hooks/useLearningProgress.ts[39m
|
|
5
|
+
[34mℹ[39m target: [34mesnext[39m
|
|
6
|
+
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
7
|
+
[34mℹ[39m Build start
|
|
8
|
+
[34mℹ[39m Cleaning 41 files
|
|
9
|
+
[34mℹ[39m [2mdist/[22m[1mhooks/useLearningProgress.js[22m [2m2.54 kB[22m [2m│ gzip: 0.90 kB[22m
|
|
10
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/BadgeDisplay.js[22m [2m1.51 kB[22m [2m│ gzip: 0.78 kB[22m
|
|
11
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/XpBar.js[22m [2m1.31 kB[22m [2m│ gzip: 0.63 kB[22m
|
|
12
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/StreakCounter.js[22m [2m1.11 kB[22m [2m│ gzip: 0.59 kB[22m
|
|
13
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/ViewTabs.js[22m [2m1.10 kB[22m [2m│ gzip: 0.59 kB[22m
|
|
14
|
+
[34mℹ[39m [2mdist/[22m[1mdocs/learning-journey-ui-shared.docblock.js[22m [2m0.77 kB[22m [2m│ gzip: 0.45 kB[22m
|
|
15
|
+
[34mℹ[39m [2mdist/[22m[1mexample.js[22m [2m0.76 kB[22m [2m│ gzip: 0.42 kB[22m
|
|
16
|
+
[34mℹ[39m [2mdist/[22m[1mindex.js[22m [2m0.53 kB[22m [2m│ gzip: 0.21 kB[22m
|
|
17
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/index.js[22m [2m0.24 kB[22m [2m│ gzip: 0.12 kB[22m
|
|
18
|
+
[34mℹ[39m [2mdist/[22m[1mhooks/index.js[22m [2m0.10 kB[22m [2m│ gzip: 0.07 kB[22m
|
|
19
|
+
[34mℹ[39m [2mdist/[22m[1mdocs/index.js[22m [2m0.05 kB[22m [2m│ gzip: 0.07 kB[22m
|
|
20
|
+
[34mℹ[39m [2mdist/[22m[1mtypes.js[22m [2m0.00 kB[22m [2m│ gzip: 0.02 kB[22m
|
|
21
|
+
[34mℹ[39m [2mdist/[22mhooks/useLearningProgress.js.map [2m4.65 kB[22m [2m│ gzip: 1.63 kB[22m
|
|
22
|
+
[34mℹ[39m [2mdist/[22mcomponents/BadgeDisplay.js.map [2m2.41 kB[22m [2m│ gzip: 1.14 kB[22m
|
|
23
|
+
[34mℹ[39m [2mdist/[22mcomponents/ViewTabs.js.map [2m1.93 kB[22m [2m│ gzip: 0.89 kB[22m
|
|
24
|
+
[34mℹ[39m [2mdist/[22mcomponents/XpBar.js.map [2m1.92 kB[22m [2m│ gzip: 0.90 kB[22m
|
|
25
|
+
[34mℹ[39m [2mdist/[22mcomponents/StreakCounter.js.map [2m1.64 kB[22m [2m│ gzip: 0.79 kB[22m
|
|
26
|
+
[34mℹ[39m [2mdist/[22mexample.js.map [2m1.10 kB[22m [2m│ gzip: 0.59 kB[22m
|
|
27
|
+
[34mℹ[39m [2mdist/[22mdocs/learning-journey-ui-shared.docblock.js.map [2m1.09 kB[22m [2m│ gzip: 0.60 kB[22m
|
|
28
|
+
[34mℹ[39m [2mdist/[22mtypes.d.ts.map [2m0.65 kB[22m [2m│ gzip: 0.33 kB[22m
|
|
29
|
+
[34mℹ[39m [2mdist/[22mhooks/useLearningProgress.d.ts.map [2m0.19 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
30
|
+
[34mℹ[39m [2mdist/[22mcomponents/StreakCounter.d.ts.map [2m0.19 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
31
|
+
[34mℹ[39m [2mdist/[22mcomponents/BadgeDisplay.d.ts.map [2m0.19 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
32
|
+
[34mℹ[39m [2mdist/[22mcomponents/ViewTabs.d.ts.map [2m0.18 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
33
|
+
[34mℹ[39m [2mdist/[22mcomponents/XpBar.d.ts.map [2m0.17 kB[22m [2m│ gzip: 0.15 kB[22m
|
|
34
|
+
[34mℹ[39m [2mdist/[22mexample.d.ts.map [2m0.14 kB[22m [2m│ gzip: 0.13 kB[22m
|
|
35
|
+
[34mℹ[39m [2mdist/[22m[32m[1mtypes.d.ts[22m[39m [2m1.70 kB[22m [2m│ gzip: 0.61 kB[22m
|
|
36
|
+
[34mℹ[39m [2mdist/[22m[32m[1mexample.d.ts[22m[39m [2m0.99 kB[22m [2m│ gzip: 0.42 kB[22m
|
|
37
|
+
[34mℹ[39m [2mdist/[22m[32m[1mindex.d.ts[22m[39m [2m0.81 kB[22m [2m│ gzip: 0.25 kB[22m
|
|
38
|
+
[34mℹ[39m [2mdist/[22m[32m[1mhooks/useLearningProgress.d.ts[22m[39m [2m0.72 kB[22m [2m│ gzip: 0.35 kB[22m
|
|
39
|
+
[34mℹ[39m [2mdist/[22m[32m[1mcomponents/StreakCounter.d.ts[22m[39m [2m0.35 kB[22m [2m│ gzip: 0.23 kB[22m
|
|
40
|
+
[34mℹ[39m [2mdist/[22m[32m[1mcomponents/BadgeDisplay.d.ts[22m[39m [2m0.35 kB[22m [2m│ gzip: 0.23 kB[22m
|
|
41
|
+
[34mℹ[39m [2mdist/[22m[32m[1mcomponents/ViewTabs.d.ts[22m[39m [2m0.34 kB[22m [2m│ gzip: 0.24 kB[22m
|
|
42
|
+
[34mℹ[39m [2mdist/[22m[32m[1mcomponents/XpBar.d.ts[22m[39m [2m0.32 kB[22m [2m│ gzip: 0.23 kB[22m
|
|
43
|
+
[34mℹ[39m [2mdist/[22m[32m[1mcomponents/index.d.ts[22m[39m [2m0.24 kB[22m [2m│ gzip: 0.12 kB[22m
|
|
44
|
+
[34mℹ[39m [2mdist/[22m[32m[1mhooks/index.d.ts[22m[39m [2m0.10 kB[22m [2m│ gzip: 0.07 kB[22m
|
|
45
|
+
[34mℹ[39m [2mdist/[22m[32m[1mdocs/index.d.ts[22m[39m [2m0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
46
|
+
[34mℹ[39m [2mdist/[22m[32m[1mdocs/learning-journey-ui-shared.docblock.d.ts[22m[39m [2m0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
47
|
+
[34mℹ[39m 38 files, total: 32.40 kB
|
|
48
|
+
[32m✔[39m Build complete in [32m13433ms[39m
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
$ bun build:types && bun build:bundle
|
|
2
|
+
$ tsc --noEmit
|
|
3
|
+
$ tsdown
|
|
4
|
+
[34mℹ[39m tsdown [2mv0.18.3[22m powered by rolldown [2mv1.0.0-beta.57[22m
|
|
5
|
+
[34mℹ[39m config file: [4m/home/runner/work/contractspec/contractspec/packages/examples/learning-journey-ui-shared/tsdown.config.js[24m
|
|
6
|
+
[34mℹ[39m entry: [34msrc/example.ts, src/index.ts, src/types.ts, src/components/BadgeDisplay.tsx, src/components/StreakCounter.tsx, src/components/ViewTabs.tsx, src/components/XpBar.tsx, src/components/index.ts, src/docs/index.ts, src/docs/learning-journey-ui-shared.docblock.ts, src/hooks/index.ts, src/hooks/useLearningProgress.ts[39m
|
|
7
|
+
[34mℹ[39m target: [34mesnext[39m
|
|
8
|
+
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
9
|
+
[34mℹ[39m Build start
|
|
10
|
+
[34mℹ[39m [2mdist/[22m[1mhooks/useLearningProgress.js[22m [2m2.54 kB[22m [2m│ gzip: 0.90 kB[22m
|
|
11
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/BadgeDisplay.js[22m [2m1.51 kB[22m [2m│ gzip: 0.78 kB[22m
|
|
12
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/XpBar.js[22m [2m1.31 kB[22m [2m│ gzip: 0.63 kB[22m
|
|
13
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/StreakCounter.js[22m [2m1.11 kB[22m [2m│ gzip: 0.59 kB[22m
|
|
14
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/ViewTabs.js[22m [2m1.10 kB[22m [2m│ gzip: 0.59 kB[22m
|
|
15
|
+
[34mℹ[39m [2mdist/[22m[1mdocs/learning-journey-ui-shared.docblock.js[22m [2m0.77 kB[22m [2m│ gzip: 0.45 kB[22m
|
|
16
|
+
[34mℹ[39m [2mdist/[22m[1mexample.js[22m [2m0.76 kB[22m [2m│ gzip: 0.42 kB[22m
|
|
17
|
+
[34mℹ[39m [2mdist/[22m[1mindex.js[22m [2m0.53 kB[22m [2m│ gzip: 0.21 kB[22m
|
|
18
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/index.js[22m [2m0.24 kB[22m [2m│ gzip: 0.12 kB[22m
|
|
19
|
+
[34mℹ[39m [2mdist/[22m[1mhooks/index.js[22m [2m0.10 kB[22m [2m│ gzip: 0.07 kB[22m
|
|
20
|
+
[34mℹ[39m [2mdist/[22m[1mdocs/index.js[22m [2m0.05 kB[22m [2m│ gzip: 0.07 kB[22m
|
|
21
|
+
[34mℹ[39m [2mdist/[22m[1mtypes.js[22m [2m0.00 kB[22m [2m│ gzip: 0.02 kB[22m
|
|
22
|
+
[34mℹ[39m [2mdist/[22mhooks/useLearningProgress.js.map [2m4.65 kB[22m [2m│ gzip: 1.63 kB[22m
|
|
23
|
+
[34mℹ[39m [2mdist/[22mcomponents/BadgeDisplay.js.map [2m2.41 kB[22m [2m│ gzip: 1.14 kB[22m
|
|
24
|
+
[34mℹ[39m [2mdist/[22mcomponents/ViewTabs.js.map [2m1.93 kB[22m [2m│ gzip: 0.89 kB[22m
|
|
25
|
+
[34mℹ[39m [2mdist/[22mcomponents/XpBar.js.map [2m1.92 kB[22m [2m│ gzip: 0.90 kB[22m
|
|
26
|
+
[34mℹ[39m [2mdist/[22mcomponents/StreakCounter.js.map [2m1.64 kB[22m [2m│ gzip: 0.79 kB[22m
|
|
27
|
+
[34mℹ[39m [2mdist/[22mexample.js.map [2m1.10 kB[22m [2m│ gzip: 0.59 kB[22m
|
|
28
|
+
[34mℹ[39m [2mdist/[22mdocs/learning-journey-ui-shared.docblock.js.map [2m1.09 kB[22m [2m│ gzip: 0.60 kB[22m
|
|
29
|
+
[34mℹ[39m [2mdist/[22mtypes.d.ts.map [2m0.65 kB[22m [2m│ gzip: 0.33 kB[22m
|
|
30
|
+
[34mℹ[39m [2mdist/[22mhooks/useLearningProgress.d.ts.map [2m0.19 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
31
|
+
[34mℹ[39m [2mdist/[22mcomponents/StreakCounter.d.ts.map [2m0.19 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
32
|
+
[34mℹ[39m [2mdist/[22mcomponents/BadgeDisplay.d.ts.map [2m0.19 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
33
|
+
[34mℹ[39m [2mdist/[22mcomponents/ViewTabs.d.ts.map [2m0.18 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
34
|
+
[34mℹ[39m [2mdist/[22mcomponents/XpBar.d.ts.map [2m0.17 kB[22m [2m│ gzip: 0.15 kB[22m
|
|
35
|
+
[34mℹ[39m [2mdist/[22mexample.d.ts.map [2m0.14 kB[22m [2m│ gzip: 0.13 kB[22m
|
|
36
|
+
[34mℹ[39m [2mdist/[22m[32m[1mtypes.d.ts[22m[39m [2m1.70 kB[22m [2m│ gzip: 0.61 kB[22m
|
|
37
|
+
[34mℹ[39m [2mdist/[22m[32m[1mexample.d.ts[22m[39m [2m0.99 kB[22m [2m│ gzip: 0.42 kB[22m
|
|
38
|
+
[34mℹ[39m [2mdist/[22m[32m[1mindex.d.ts[22m[39m [2m0.81 kB[22m [2m│ gzip: 0.25 kB[22m
|
|
39
|
+
[34mℹ[39m [2mdist/[22m[32m[1mhooks/useLearningProgress.d.ts[22m[39m [2m0.72 kB[22m [2m│ gzip: 0.35 kB[22m
|
|
40
|
+
[34mℹ[39m [2mdist/[22m[32m[1mcomponents/StreakCounter.d.ts[22m[39m [2m0.35 kB[22m [2m│ gzip: 0.23 kB[22m
|
|
41
|
+
[34mℹ[39m [2mdist/[22m[32m[1mcomponents/BadgeDisplay.d.ts[22m[39m [2m0.35 kB[22m [2m│ gzip: 0.23 kB[22m
|
|
42
|
+
[34mℹ[39m [2mdist/[22m[32m[1mcomponents/ViewTabs.d.ts[22m[39m [2m0.34 kB[22m [2m│ gzip: 0.23 kB[22m
|
|
43
|
+
[34mℹ[39m [2mdist/[22m[32m[1mcomponents/XpBar.d.ts[22m[39m [2m0.32 kB[22m [2m│ gzip: 0.23 kB[22m
|
|
44
|
+
[34mℹ[39m [2mdist/[22m[32m[1mcomponents/index.d.ts[22m[39m [2m0.24 kB[22m [2m│ gzip: 0.12 kB[22m
|
|
45
|
+
[34mℹ[39m [2mdist/[22m[32m[1mhooks/index.d.ts[22m[39m [2m0.10 kB[22m [2m│ gzip: 0.07 kB[22m
|
|
46
|
+
[34mℹ[39m [2mdist/[22m[32m[1mdocs/index.d.ts[22m[39m [2m0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
47
|
+
[34mℹ[39m [2mdist/[22m[32m[1mdocs/learning-journey-ui-shared.docblock.d.ts[22m[39m [2m0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
48
|
+
[34mℹ[39m 38 files, total: 32.40 kB
|
|
49
|
+
[32m✔[39m Build complete in [32m14906ms[39m
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
# @contractspec/example.learning-journey-ui-shared
|
|
2
|
+
|
|
3
|
+
## 1.44.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 5f3a868: chore: isolate branding to contractspec.io
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [5f3a868]
|
|
12
|
+
- @contractspec/module.learning-journey@1.44.0
|
|
13
|
+
- @contractspec/lib.design-system@1.44.0
|
|
14
|
+
- @contractspec/lib.ui-kit-web@1.44.0
|
|
15
|
+
- @contractspec/lib.contracts@1.44.0
|
|
16
|
+
- @contractspec/lib.schema@1.44.0
|
|
17
|
+
|
|
18
|
+
## 1.43.4
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- 9216062: fix: cross-platform compatibility
|
|
23
|
+
- Updated dependencies [9216062]
|
|
24
|
+
- @contractspec/module.learning-journey@1.43.4
|
|
25
|
+
- @contractspec/lib.design-system@1.43.4
|
|
26
|
+
- @contractspec/lib.ui-kit-web@1.43.3
|
|
27
|
+
- @contractspec/lib.contracts@1.43.4
|
|
28
|
+
- @contractspec/lib.schema@1.43.3
|
|
29
|
+
|
|
30
|
+
## 1.43.3
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- 24d9759: improve documentation
|
|
35
|
+
- Updated dependencies [24d9759]
|
|
36
|
+
- @contractspec/module.learning-journey@1.43.3
|
|
37
|
+
- @contractspec/lib.design-system@1.43.3
|
|
38
|
+
- @contractspec/lib.ui-kit-web@1.43.2
|
|
39
|
+
- @contractspec/lib.contracts@1.43.3
|
|
40
|
+
- @contractspec/lib.schema@1.43.2
|
|
41
|
+
|
|
42
|
+
## 1.43.2
|
|
43
|
+
|
|
44
|
+
### Patch Changes
|
|
45
|
+
|
|
46
|
+
- e147271: fix: improve stability
|
|
47
|
+
- Updated dependencies [e147271]
|
|
48
|
+
- @contractspec/module.learning-journey@1.43.2
|
|
49
|
+
- @contractspec/lib.design-system@1.43.2
|
|
50
|
+
- @contractspec/lib.contracts@1.43.2
|
|
51
|
+
- @contractspec/lib.schema@1.43.1
|
|
52
|
+
- @contractspec/lib.ui-kit-web@1.43.1
|
|
53
|
+
|
|
54
|
+
## 1.43.1
|
|
55
|
+
|
|
56
|
+
### Patch Changes
|
|
57
|
+
|
|
58
|
+
- Updated dependencies [f28fdad]
|
|
59
|
+
- @contractspec/lib.contracts@1.43.1
|
|
60
|
+
- @contractspec/lib.design-system@1.43.1
|
|
61
|
+
- @contractspec/module.learning-journey@1.43.1
|
|
62
|
+
|
|
63
|
+
## 1.43.0
|
|
64
|
+
|
|
65
|
+
### Minor Changes
|
|
66
|
+
|
|
67
|
+
- 042d072: feat: schema declaration using json schema, including zod
|
|
68
|
+
|
|
69
|
+
### Patch Changes
|
|
70
|
+
|
|
71
|
+
- Updated dependencies [042d072]
|
|
72
|
+
- @contractspec/module.learning-journey@1.43.0
|
|
73
|
+
- @contractspec/lib.design-system@1.43.0
|
|
74
|
+
- @contractspec/lib.ui-kit-web@1.43.0
|
|
75
|
+
- @contractspec/lib.contracts@1.43.0
|
|
76
|
+
- @contractspec/lib.schema@1.43.0
|
|
77
|
+
|
|
78
|
+
## 1.42.10
|
|
79
|
+
|
|
80
|
+
### Patch Changes
|
|
81
|
+
|
|
82
|
+
- 1e6a0f1: fix: mcp server
|
|
83
|
+
- Updated dependencies [1e6a0f1]
|
|
84
|
+
- @contractspec/module.learning-journey@1.42.10
|
|
85
|
+
- @contractspec/lib.design-system@1.42.10
|
|
86
|
+
- @contractspec/lib.ui-kit-web@1.42.10
|
|
87
|
+
- @contractspec/lib.contracts@1.42.10
|
|
88
|
+
- @contractspec/lib.schema@1.42.10
|
|
89
|
+
|
|
90
|
+
## 1.42.9
|
|
91
|
+
|
|
92
|
+
### Patch Changes
|
|
93
|
+
|
|
94
|
+
- 9281db7: fix ModelRegistry
|
|
95
|
+
- Updated dependencies [9281db7]
|
|
96
|
+
- @contractspec/module.learning-journey@1.42.9
|
|
97
|
+
- @contractspec/lib.design-system@1.42.9
|
|
98
|
+
- @contractspec/lib.ui-kit-web@1.42.9
|
|
99
|
+
- @contractspec/lib.contracts@1.42.9
|
|
100
|
+
- @contractspec/lib.schema@1.42.9
|
|
101
|
+
|
|
102
|
+
## 1.42.8
|
|
103
|
+
|
|
104
|
+
### Patch Changes
|
|
105
|
+
|
|
106
|
+
- e07b5ac: fix
|
|
107
|
+
- Updated dependencies [e07b5ac]
|
|
108
|
+
- @contractspec/module.learning-journey@1.42.8
|
|
109
|
+
- @contractspec/lib.design-system@1.42.8
|
|
110
|
+
- @contractspec/lib.ui-kit-web@1.42.8
|
|
111
|
+
- @contractspec/lib.contracts@1.42.8
|
|
112
|
+
- @contractspec/lib.schema@1.42.8
|
|
113
|
+
|
|
114
|
+
## 1.42.7
|
|
115
|
+
|
|
116
|
+
### Patch Changes
|
|
117
|
+
|
|
118
|
+
- e9b575d: fix release
|
|
119
|
+
- Updated dependencies [e9b575d]
|
|
120
|
+
- @contractspec/module.learning-journey@1.42.7
|
|
121
|
+
- @contractspec/lib.design-system@1.42.7
|
|
122
|
+
- @contractspec/lib.ui-kit-web@1.42.7
|
|
123
|
+
- @contractspec/lib.contracts@1.42.7
|
|
124
|
+
- @contractspec/lib.schema@1.42.7
|
|
125
|
+
|
|
126
|
+
## 1.42.6
|
|
127
|
+
|
|
128
|
+
### Patch Changes
|
|
129
|
+
|
|
130
|
+
- 1500242: fix tooling
|
|
131
|
+
- Updated dependencies [1500242]
|
|
132
|
+
- @contractspec/module.learning-journey@1.42.6
|
|
133
|
+
- @contractspec/lib.design-system@1.42.6
|
|
134
|
+
- @contractspec/lib.ui-kit-web@1.42.6
|
|
135
|
+
- @contractspec/lib.contracts@1.42.6
|
|
136
|
+
- @contractspec/lib.schema@1.42.6
|
|
137
|
+
|
|
138
|
+
## 1.42.5
|
|
139
|
+
|
|
140
|
+
### Patch Changes
|
|
141
|
+
|
|
142
|
+
- 1299719: fix vscode
|
|
143
|
+
- Updated dependencies [1299719]
|
|
144
|
+
- @contractspec/module.learning-journey@1.42.5
|
|
145
|
+
- @contractspec/lib.design-system@1.42.5
|
|
146
|
+
- @contractspec/lib.ui-kit-web@1.42.5
|
|
147
|
+
- @contractspec/lib.contracts@1.42.5
|
|
148
|
+
- @contractspec/lib.schema@1.42.5
|
|
149
|
+
|
|
150
|
+
## 1.42.4
|
|
151
|
+
|
|
152
|
+
### Patch Changes
|
|
153
|
+
|
|
154
|
+
- ac28b99: fix: generate from openapi
|
|
155
|
+
- Updated dependencies [ac28b99]
|
|
156
|
+
- @contractspec/module.learning-journey@1.42.4
|
|
157
|
+
- @contractspec/lib.design-system@1.42.4
|
|
158
|
+
- @contractspec/lib.ui-kit-web@1.42.4
|
|
159
|
+
- @contractspec/lib.contracts@1.42.4
|
|
160
|
+
- @contractspec/lib.schema@1.42.4
|
|
161
|
+
|
|
162
|
+
## 1.42.3
|
|
163
|
+
|
|
164
|
+
### Patch Changes
|
|
165
|
+
|
|
166
|
+
- 3f5d015: fix(tooling): cicd
|
|
167
|
+
- Updated dependencies [3f5d015]
|
|
168
|
+
- @contractspec/lib.contracts@1.42.3
|
|
169
|
+
- @contractspec/lib.design-system@1.42.3
|
|
170
|
+
- @contractspec/lib.schema@1.42.3
|
|
171
|
+
- @contractspec/lib.ui-kit-web@1.42.3
|
|
172
|
+
- @contractspec/module.learning-journey@1.42.3
|
|
173
|
+
|
|
174
|
+
## 1.42.2
|
|
175
|
+
|
|
176
|
+
### Patch Changes
|
|
177
|
+
|
|
178
|
+
- 1f9ac4c: fix
|
|
179
|
+
- Updated dependencies [1f9ac4c]
|
|
180
|
+
- @contractspec/lib.contracts@1.42.2
|
|
181
|
+
- @contractspec/lib.design-system@1.42.2
|
|
182
|
+
- @contractspec/lib.schema@1.42.2
|
|
183
|
+
- @contractspec/lib.ui-kit-web@1.42.2
|
|
184
|
+
- @contractspec/module.learning-journey@1.42.2
|
|
185
|
+
|
|
186
|
+
## 1.42.1
|
|
187
|
+
|
|
188
|
+
### Patch Changes
|
|
189
|
+
|
|
190
|
+
- f043995: Fix release
|
|
191
|
+
- Updated dependencies [f043995]
|
|
192
|
+
- @contractspec/module.learning-journey@1.42.1
|
|
193
|
+
- @contractspec/lib.design-system@1.42.1
|
|
194
|
+
- @contractspec/lib.ui-kit-web@1.42.1
|
|
195
|
+
- @contractspec/lib.contracts@1.42.1
|
|
196
|
+
- @contractspec/lib.schema@1.42.1
|
|
197
|
+
|
|
198
|
+
## 1.42.0
|
|
199
|
+
|
|
200
|
+
### Minor Changes
|
|
201
|
+
|
|
202
|
+
- 8eefd9c: initial release
|
|
203
|
+
|
|
204
|
+
### Patch Changes
|
|
205
|
+
|
|
206
|
+
- Updated dependencies [8eefd9c]
|
|
207
|
+
- @contractspec/lib.contracts@1.42.0
|
|
208
|
+
- @contractspec/lib.design-system@1.42.0
|
|
209
|
+
- @contractspec/lib.schema@1.42.0
|
|
210
|
+
- @contractspec/lib.ui-kit-web@1.42.0
|
|
211
|
+
- @contractspec/module.learning-journey@1.42.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Chaman Ventures, SASU
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# @contractspec/example.learning-journey-ui-shared
|
|
2
|
+
|
|
3
|
+
Website: https://contractspec.io/
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
Shared UI components and hooks for learning journey mini-apps.
|
|
7
|
+
|
|
8
|
+
## Components
|
|
9
|
+
|
|
10
|
+
- **XpBar** - Progress bar showing XP earned vs total
|
|
11
|
+
- **StreakCounter** - Display streak days with fire icon
|
|
12
|
+
- **BadgeDisplay** - Grid of earned badges
|
|
13
|
+
- **ViewTabs** - Tab navigation between views
|
|
14
|
+
|
|
15
|
+
## Hooks
|
|
16
|
+
|
|
17
|
+
- **useLearningProgress** - Manage learning progress state for a track
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
import {
|
|
23
|
+
XpBar,
|
|
24
|
+
StreakCounter,
|
|
25
|
+
BadgeDisplay,
|
|
26
|
+
ViewTabs,
|
|
27
|
+
useLearningProgress,
|
|
28
|
+
} from '@contractspec/example.learning-journey-ui-shared';
|
|
29
|
+
|
|
30
|
+
function MyLearningApp({ track }) {
|
|
31
|
+
const { progress, stats, completeStep } = useLearningProgress(track);
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<div>
|
|
35
|
+
<XpBar current={progress.xpEarned} max={stats.totalXp} />
|
|
36
|
+
<StreakCounter days={progress.streakDays} />
|
|
37
|
+
<BadgeDisplay badges={progress.badges} />
|
|
38
|
+
</div>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BadgeDisplayProps } from "../types.js";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/BadgeDisplay.d.ts
|
|
5
|
+
declare function BadgeDisplay({
|
|
6
|
+
badges,
|
|
7
|
+
maxVisible,
|
|
8
|
+
size
|
|
9
|
+
}: BadgeDisplayProps): react_jsx_runtime0.JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { BadgeDisplay };
|
|
12
|
+
//# sourceMappingURL=BadgeDisplay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BadgeDisplay.d.ts","names":[],"sources":["../../src/components/BadgeDisplay.tsx"],"sourcesContent":[],"mappings":";;;;iBAuBgB,YAAA;;;;GAIb,oBAAiB,kBAAA,CAAA,GAAA,CAAA"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { cn } from "@contractspec/lib.ui-kit-web/ui/utils";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/BadgeDisplay.tsx
|
|
7
|
+
const BADGE_ICONS = {
|
|
8
|
+
studio_first_30m: "🎯",
|
|
9
|
+
platform_tour: "🗺️",
|
|
10
|
+
crm_first_win: "🏆",
|
|
11
|
+
drill_master: "🧠",
|
|
12
|
+
coach_listener: "👂",
|
|
13
|
+
quest_complete: "⭐",
|
|
14
|
+
streak_7: "🔥",
|
|
15
|
+
streak_30: "💎",
|
|
16
|
+
default: "🏅"
|
|
17
|
+
};
|
|
18
|
+
const sizeStyles = {
|
|
19
|
+
sm: "h-6 w-6 text-sm",
|
|
20
|
+
md: "h-8 w-8 text-base",
|
|
21
|
+
lg: "h-10 w-10 text-lg"
|
|
22
|
+
};
|
|
23
|
+
function BadgeDisplay({ badges, maxVisible = 5, size = "md" }) {
|
|
24
|
+
const visibleBadges = badges.slice(0, maxVisible);
|
|
25
|
+
const hiddenCount = badges.length - maxVisible;
|
|
26
|
+
if (badges.length === 0) return /* @__PURE__ */ jsx("div", {
|
|
27
|
+
className: "text-muted-foreground text-sm",
|
|
28
|
+
children: "No badges earned yet"
|
|
29
|
+
});
|
|
30
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
31
|
+
className: "flex items-center gap-1",
|
|
32
|
+
children: [visibleBadges.map((badge) => /* @__PURE__ */ jsx("div", {
|
|
33
|
+
className: cn("flex items-center justify-center rounded-full bg-gradient-to-br from-amber-400/20 to-amber-600/20", sizeStyles[size]),
|
|
34
|
+
title: badge.replace(/_/g, " "),
|
|
35
|
+
children: BADGE_ICONS[badge] ?? BADGE_ICONS.default
|
|
36
|
+
}, badge)), hiddenCount > 0 && /* @__PURE__ */ jsxs("div", {
|
|
37
|
+
className: cn("text-muted-foreground bg-muted flex items-center justify-center rounded-full", sizeStyles[size], "text-xs font-medium"),
|
|
38
|
+
children: ["+", hiddenCount]
|
|
39
|
+
})]
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
export { BadgeDisplay };
|
|
45
|
+
//# sourceMappingURL=BadgeDisplay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BadgeDisplay.js","names":["BADGE_ICONS: Record<string, string>"],"sources":["../../src/components/BadgeDisplay.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@contractspec/lib.ui-kit-web/ui/utils';\nimport type { BadgeDisplayProps } from '../types';\n\nconst BADGE_ICONS: Record<string, string> = {\n studio_first_30m: '🎯',\n platform_tour: '🗺️',\n crm_first_win: '🏆',\n drill_master: '🧠',\n coach_listener: '👂',\n quest_complete: '⭐',\n streak_7: '🔥',\n streak_30: '💎',\n default: '🏅',\n};\n\nconst sizeStyles = {\n sm: 'h-6 w-6 text-sm',\n md: 'h-8 w-8 text-base',\n lg: 'h-10 w-10 text-lg',\n};\n\nexport function BadgeDisplay({\n badges,\n maxVisible = 5,\n size = 'md',\n}: BadgeDisplayProps) {\n const visibleBadges = badges.slice(0, maxVisible);\n const hiddenCount = badges.length - maxVisible;\n\n if (badges.length === 0) {\n return (\n <div className=\"text-muted-foreground text-sm\">No badges earned yet</div>\n );\n }\n\n return (\n <div className=\"flex items-center gap-1\">\n {visibleBadges.map((badge) => (\n <div\n key={badge}\n className={cn(\n 'flex items-center justify-center rounded-full bg-gradient-to-br from-amber-400/20 to-amber-600/20',\n sizeStyles[size]\n )}\n title={badge.replace(/_/g, ' ')}\n >\n {BADGE_ICONS[badge] ?? BADGE_ICONS.default}\n </div>\n ))}\n {hiddenCount > 0 && (\n <div\n className={cn(\n 'text-muted-foreground bg-muted flex items-center justify-center rounded-full',\n sizeStyles[size],\n 'text-xs font-medium'\n )}\n >\n +{hiddenCount}\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;AAKA,MAAMA,cAAsC;CAC1C,kBAAkB;CAClB,eAAe;CACf,eAAe;CACf,cAAc;CACd,gBAAgB;CAChB,gBAAgB;CAChB,UAAU;CACV,WAAW;CACX,SAAS;CACV;AAED,MAAM,aAAa;CACjB,IAAI;CACJ,IAAI;CACJ,IAAI;CACL;AAED,SAAgB,aAAa,EAC3B,QACA,aAAa,GACb,OAAO,QACa;CACpB,MAAM,gBAAgB,OAAO,MAAM,GAAG,WAAW;CACjD,MAAM,cAAc,OAAO,SAAS;AAEpC,KAAI,OAAO,WAAW,EACpB,QACE,oBAAC;EAAI,WAAU;YAAgC;GAA0B;AAI7E,QACE,qBAAC;EAAI,WAAU;aACZ,cAAc,KAAK,UAClB,oBAAC;GAEC,WAAW,GACT,qGACA,WAAW,MACZ;GACD,OAAO,MAAM,QAAQ,MAAM,IAAI;aAE9B,YAAY,UAAU,YAAY;KAP9B,MAQD,CACN,EACD,cAAc,KACb,qBAAC;GACC,WAAW,GACT,gFACA,WAAW,OACX,sBACD;cACF,KACG;IACE;GAEJ"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StreakCounterProps } from "../types.js";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/StreakCounter.d.ts
|
|
5
|
+
declare function StreakCounter({
|
|
6
|
+
days,
|
|
7
|
+
isActive,
|
|
8
|
+
size
|
|
9
|
+
}: StreakCounterProps): react_jsx_runtime0.JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { StreakCounter };
|
|
12
|
+
//# sourceMappingURL=StreakCounter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StreakCounter.d.ts","names":[],"sources":["../../src/components/StreakCounter.tsx"],"sourcesContent":[],"mappings":";;;;iBAuBgB,aAAA;;;;GAIb,qBAAkB,kBAAA,CAAA,GAAA,CAAA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { cn } from "@contractspec/lib.ui-kit-web/ui/utils";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/StreakCounter.tsx
|
|
7
|
+
const sizeStyles = {
|
|
8
|
+
sm: {
|
|
9
|
+
container: "gap-1 px-2 py-1",
|
|
10
|
+
icon: "text-base",
|
|
11
|
+
text: "text-xs"
|
|
12
|
+
},
|
|
13
|
+
md: {
|
|
14
|
+
container: "gap-1.5 px-3 py-1.5",
|
|
15
|
+
icon: "text-lg",
|
|
16
|
+
text: "text-sm"
|
|
17
|
+
},
|
|
18
|
+
lg: {
|
|
19
|
+
container: "gap-2 px-4 py-2",
|
|
20
|
+
icon: "text-xl",
|
|
21
|
+
text: "text-base"
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
function StreakCounter({ days, isActive = true, size = "md" }) {
|
|
25
|
+
const styles = sizeStyles[size];
|
|
26
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
27
|
+
className: cn("inline-flex items-center rounded-full font-semibold", styles.container, isActive ? "bg-orange-500/10 text-orange-500" : "bg-muted text-muted-foreground"),
|
|
28
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
29
|
+
className: styles.icon,
|
|
30
|
+
role: "img",
|
|
31
|
+
"aria-label": "streak",
|
|
32
|
+
children: "🔥"
|
|
33
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
34
|
+
className: styles.text,
|
|
35
|
+
children: [
|
|
36
|
+
days,
|
|
37
|
+
" ",
|
|
38
|
+
days === 1 ? "day" : "days"
|
|
39
|
+
]
|
|
40
|
+
})]
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
45
|
+
export { StreakCounter };
|
|
46
|
+
//# sourceMappingURL=StreakCounter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StreakCounter.js","names":[],"sources":["../../src/components/StreakCounter.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@contractspec/lib.ui-kit-web/ui/utils';\nimport type { StreakCounterProps } from '../types';\n\nconst sizeStyles = {\n sm: {\n container: 'gap-1 px-2 py-1',\n icon: 'text-base',\n text: 'text-xs',\n },\n md: {\n container: 'gap-1.5 px-3 py-1.5',\n icon: 'text-lg',\n text: 'text-sm',\n },\n lg: {\n container: 'gap-2 px-4 py-2',\n icon: 'text-xl',\n text: 'text-base',\n },\n};\n\nexport function StreakCounter({\n days,\n isActive = true,\n size = 'md',\n}: StreakCounterProps) {\n const styles = sizeStyles[size];\n\n return (\n <div\n className={cn(\n 'inline-flex items-center rounded-full font-semibold',\n styles.container,\n isActive\n ? 'bg-orange-500/10 text-orange-500'\n : 'bg-muted text-muted-foreground'\n )}\n >\n <span className={styles.icon} role=\"img\" aria-label=\"streak\">\n 🔥\n </span>\n <span className={styles.text}>\n {days} {days === 1 ? 'day' : 'days'}\n </span>\n </div>\n );\n}\n"],"mappings":";;;;;;AAKA,MAAM,aAAa;CACjB,IAAI;EACF,WAAW;EACX,MAAM;EACN,MAAM;EACP;CACD,IAAI;EACF,WAAW;EACX,MAAM;EACN,MAAM;EACP;CACD,IAAI;EACF,WAAW;EACX,MAAM;EACN,MAAM;EACP;CACF;AAED,SAAgB,cAAc,EAC5B,MACA,WAAW,MACX,OAAO,QACc;CACrB,MAAM,SAAS,WAAW;AAE1B,QACE,qBAAC;EACC,WAAW,GACT,uDACA,OAAO,WACP,WACI,qCACA,iCACL;aAED,oBAAC;GAAK,WAAW,OAAO;GAAM,MAAK;GAAM,cAAW;aAAS;IAEtD,EACP,qBAAC;GAAK,WAAW,OAAO;;IACrB;IAAK;IAAE,SAAS,IAAI,QAAQ;;IACxB;GACH"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ViewTabsProps } from "../types.js";
|
|
2
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/ViewTabs.d.ts
|
|
5
|
+
declare function ViewTabs({
|
|
6
|
+
currentView,
|
|
7
|
+
onViewChange,
|
|
8
|
+
availableViews
|
|
9
|
+
}: ViewTabsProps): react_jsx_runtime2.JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { ViewTabs };
|
|
12
|
+
//# sourceMappingURL=ViewTabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViewTabs.d.ts","names":[],"sources":["../../src/components/ViewTabs.tsx"],"sourcesContent":[],"mappings":";;;;iBAmBgB,QAAA;;;;GAIb,gBAAa,kBAAA,CAAA,GAAA,CAAA"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Button } from "@contractspec/lib.design-system";
|
|
5
|
+
|
|
6
|
+
//#region src/components/ViewTabs.tsx
|
|
7
|
+
const VIEW_LABELS = {
|
|
8
|
+
overview: {
|
|
9
|
+
label: "Overview",
|
|
10
|
+
icon: "📊"
|
|
11
|
+
},
|
|
12
|
+
steps: {
|
|
13
|
+
label: "Steps",
|
|
14
|
+
icon: "📝"
|
|
15
|
+
},
|
|
16
|
+
progress: {
|
|
17
|
+
label: "Progress",
|
|
18
|
+
icon: "📈"
|
|
19
|
+
},
|
|
20
|
+
timeline: {
|
|
21
|
+
label: "Timeline",
|
|
22
|
+
icon: "📅"
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const DEFAULT_VIEWS = [
|
|
26
|
+
"overview",
|
|
27
|
+
"steps",
|
|
28
|
+
"progress",
|
|
29
|
+
"timeline"
|
|
30
|
+
];
|
|
31
|
+
function ViewTabs({ currentView, onViewChange, availableViews = DEFAULT_VIEWS }) {
|
|
32
|
+
return /* @__PURE__ */ jsx("div", {
|
|
33
|
+
className: "flex flex-wrap gap-2",
|
|
34
|
+
children: availableViews.map((view) => {
|
|
35
|
+
const { label, icon } = VIEW_LABELS[view];
|
|
36
|
+
return /* @__PURE__ */ jsxs(Button, {
|
|
37
|
+
variant: currentView === view ? "default" : "outline",
|
|
38
|
+
size: "sm",
|
|
39
|
+
onClick: () => onViewChange(view),
|
|
40
|
+
className: "gap-1.5",
|
|
41
|
+
children: [/* @__PURE__ */ jsx("span", { children: icon }), /* @__PURE__ */ jsx("span", { children: label })]
|
|
42
|
+
}, view);
|
|
43
|
+
})
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
export { ViewTabs };
|
|
49
|
+
//# sourceMappingURL=ViewTabs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViewTabs.js","names":["VIEW_LABELS: Record<LearningView, { label: string; icon: string }>","DEFAULT_VIEWS: LearningView[]"],"sources":["../../src/components/ViewTabs.tsx"],"sourcesContent":["'use client';\n\nimport { Button } from '@contractspec/lib.design-system';\nimport type { ViewTabsProps, LearningView } from '../types';\n\nconst VIEW_LABELS: Record<LearningView, { label: string; icon: string }> = {\n overview: { label: 'Overview', icon: '📊' },\n steps: { label: 'Steps', icon: '📝' },\n progress: { label: 'Progress', icon: '📈' },\n timeline: { label: 'Timeline', icon: '📅' },\n};\n\nconst DEFAULT_VIEWS: LearningView[] = [\n 'overview',\n 'steps',\n 'progress',\n 'timeline',\n];\n\nexport function ViewTabs({\n currentView,\n onViewChange,\n availableViews = DEFAULT_VIEWS,\n}: ViewTabsProps) {\n return (\n <div className=\"flex flex-wrap gap-2\">\n {availableViews.map((view) => {\n const { label, icon } = VIEW_LABELS[view];\n const isActive = currentView === view;\n\n return (\n <Button\n key={view}\n variant={isActive ? 'default' : 'outline'}\n size=\"sm\"\n onClick={() => onViewChange(view)}\n className=\"gap-1.5\"\n >\n <span>{icon}</span>\n <span>{label}</span>\n </Button>\n );\n })}\n </div>\n );\n}\n"],"mappings":";;;;;;AAKA,MAAMA,cAAqE;CACzE,UAAU;EAAE,OAAO;EAAY,MAAM;EAAM;CAC3C,OAAO;EAAE,OAAO;EAAS,MAAM;EAAM;CACrC,UAAU;EAAE,OAAO;EAAY,MAAM;EAAM;CAC3C,UAAU;EAAE,OAAO;EAAY,MAAM;EAAM;CAC5C;AAED,MAAMC,gBAAgC;CACpC;CACA;CACA;CACA;CACD;AAED,SAAgB,SAAS,EACvB,aACA,cACA,iBAAiB,iBACD;AAChB,QACE,oBAAC;EAAI,WAAU;YACZ,eAAe,KAAK,SAAS;GAC5B,MAAM,EAAE,OAAO,SAAS,YAAY;AAGpC,UACE,qBAAC;IAEC,SALa,gBAAgB,OAKT,YAAY;IAChC,MAAK;IACL,eAAe,aAAa,KAAK;IACjC,WAAU;eAEV,oBAAC,oBAAM,OAAY,EACnB,oBAAC,oBAAM,QAAa;MAPf,KAQE;IAEX;GACE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { XpBarProps } from "../types.js";
|
|
2
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/XpBar.d.ts
|
|
5
|
+
declare function XpBar({
|
|
6
|
+
current,
|
|
7
|
+
max,
|
|
8
|
+
level,
|
|
9
|
+
showLabel,
|
|
10
|
+
size
|
|
11
|
+
}: XpBarProps): react_jsx_runtime1.JSX.Element;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { XpBar };
|
|
14
|
+
//# sourceMappingURL=XpBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"XpBar.d.ts","names":[],"sources":["../../src/components/XpBar.tsx"],"sourcesContent":[],"mappings":";;;;iBAkBgB,KAAA;;;;;;GAMb,aAAU,kBAAA,CAAA,GAAA,CAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Progress } from "@contractspec/lib.ui-kit-web/ui/progress";
|
|
4
|
+
import { cn } from "@contractspec/lib.ui-kit-web/ui/utils";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/components/XpBar.tsx
|
|
8
|
+
const sizeStyles = {
|
|
9
|
+
sm: "h-2",
|
|
10
|
+
md: "h-3",
|
|
11
|
+
lg: "h-4"
|
|
12
|
+
};
|
|
13
|
+
const labelSizeStyles = {
|
|
14
|
+
sm: "text-xs",
|
|
15
|
+
md: "text-sm",
|
|
16
|
+
lg: "text-base"
|
|
17
|
+
};
|
|
18
|
+
function XpBar({ current, max, level, showLabel = true, size = "md" }) {
|
|
19
|
+
const percentage = max > 0 ? Math.min(current / max * 100, 100) : 0;
|
|
20
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
21
|
+
className: "w-full space-y-1",
|
|
22
|
+
children: [showLabel && /* @__PURE__ */ jsxs("div", {
|
|
23
|
+
className: cn("flex items-center justify-between", labelSizeStyles[size]),
|
|
24
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
25
|
+
className: "text-muted-foreground font-medium",
|
|
26
|
+
children: [level !== void 0 && /* @__PURE__ */ jsxs("span", {
|
|
27
|
+
className: "text-primary mr-1",
|
|
28
|
+
children: ["Lvl ", level]
|
|
29
|
+
}), "XP"]
|
|
30
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
31
|
+
className: "font-semibold",
|
|
32
|
+
children: [
|
|
33
|
+
current.toLocaleString(),
|
|
34
|
+
" / ",
|
|
35
|
+
max.toLocaleString()
|
|
36
|
+
]
|
|
37
|
+
})]
|
|
38
|
+
}), /* @__PURE__ */ jsx(Progress, {
|
|
39
|
+
value: percentage,
|
|
40
|
+
className: cn("bg-muted", sizeStyles[size])
|
|
41
|
+
})]
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
//#endregion
|
|
46
|
+
export { XpBar };
|
|
47
|
+
//# sourceMappingURL=XpBar.js.map
|