@lssm/example.learning-journey-ui-gamified 0.0.0-canary-20251217083314 → 0.0.0-canary-20251220002821
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 +483 -403
- package/.turbo/turbo-build.log +484 -24
- package/CHANGELOG.md +9 -9
- package/LICENSE +21 -0
- package/dist/GamifiedMiniApp.d.ts +2 -1
- package/dist/GamifiedMiniApp.d.ts.map +1 -0
- package/dist/GamifiedMiniApp.js +2 -1
- package/dist/GamifiedMiniApp.js.map +1 -0
- package/dist/components/DayCalendar.d.ts +4 -3
- package/dist/components/DayCalendar.d.ts.map +1 -0
- package/dist/components/DayCalendar.js +2 -1
- package/dist/components/DayCalendar.js.map +1 -0
- package/dist/components/FlashCard.d.ts +2 -1
- package/dist/components/FlashCard.d.ts.map +1 -0
- package/dist/components/FlashCard.js +5 -4
- package/dist/components/FlashCard.js.map +1 -0
- package/dist/components/MasteryRing.d.ts +4 -3
- package/dist/components/MasteryRing.d.ts.map +1 -0
- package/dist/components/MasteryRing.js +2 -1
- package/dist/components/MasteryRing.js.map +1 -0
- package/dist/docs/learning-journey-ui-gamified.docblock.js +2 -1
- package/dist/docs/learning-journey-ui-gamified.docblock.js.map +1 -0
- package/dist/example.d.ts +2 -1
- package/dist/example.d.ts.map +1 -0
- package/dist/example.js +2 -1
- package/dist/example.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/components/BadgeDisplay.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/components/BadgeDisplay.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/components/StreakCounter.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/components/StreakCounter.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/components/ViewTabs.js +4 -3
- package/dist/examples/learning-journey-ui-shared/dist/components/ViewTabs.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/components/XpBar.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/components/XpBar.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/docs/learning-journey-ui-shared.docblock.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/docs/learning-journey-ui-shared.docblock.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/hooks/useLearningProgress.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/hooks/useLearningProgress.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/index.js +2 -6
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/meta.docs.js +29 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/meta.docs.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/presentations.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/presentations.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/registry.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/registry.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech-contracts.docs.js +96 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech-contracts.docs.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/design-system/dist/_virtual/rolldown_runtime.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/libs/design-system/dist/_virtual/rolldown_runtime.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/design-system/dist/components/atoms/Button.js +5 -4
- package/dist/examples/learning-journey-ui-shared/dist/libs/design-system/dist/components/atoms/Button.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/design-system/dist/ui-kit-web/dist/ui/button.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/libs/design-system/dist/ui-kit-web/dist/ui/button.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/design-system/dist/ui-kit-web/dist/ui-kit-core/dist/utils.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/libs/design-system/dist/ui-kit-web/dist/ui-kit-core/dist/utils.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/ui-kit-web/dist/ui/progress.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/libs/ui-kit-web/dist/ui/progress.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/ui-kit-web/dist/ui/utils.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/libs/ui-kit-web/dist/ui/utils.js.map +1 -0
- package/dist/examples/learning-journey-ui-shared/dist/libs/ui-kit-web/dist/ui-kit-core/dist/utils.js +2 -1
- package/dist/examples/learning-journey-ui-shared/dist/libs/ui-kit-web/dist/ui-kit-core/dist/utils.js.map +1 -0
- package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/index.js +2 -6
- package/dist/libs/contracts/dist/docs/meta.docs.js +30 -0
- package/dist/libs/contracts/dist/docs/meta.docs.js.map +1 -0
- package/dist/libs/contracts/dist/docs/presentations.js +2 -1
- package/dist/libs/contracts/dist/docs/presentations.js.map +1 -0
- package/dist/libs/contracts/dist/docs/registry.js +2 -1
- package/dist/libs/contracts/dist/docs/registry.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech-contracts.docs.js +97 -0
- package/dist/libs/contracts/dist/docs/tech-contracts.docs.js.map +1 -0
- package/dist/libs/design-system/dist/_virtual/rolldown_runtime.js +2 -1
- package/dist/libs/design-system/dist/_virtual/rolldown_runtime.js.map +1 -0
- package/dist/libs/design-system/dist/components/atoms/Button.js +5 -4
- package/dist/libs/design-system/dist/components/atoms/Button.js.map +1 -0
- package/dist/libs/design-system/dist/ui-kit-web/dist/ui/button.js +2 -1
- package/dist/libs/design-system/dist/ui-kit-web/dist/ui/button.js.map +1 -0
- package/dist/libs/design-system/dist/ui-kit-web/dist/ui-kit-core/dist/utils.js +2 -1
- package/dist/libs/design-system/dist/ui-kit-web/dist/ui-kit-core/dist/utils.js.map +1 -0
- package/dist/libs/ui-kit-web/dist/ui/card.js +2 -1
- package/dist/libs/ui-kit-web/dist/ui/card.js.map +1 -0
- package/dist/libs/ui-kit-web/dist/ui/utils.js +2 -1
- package/dist/libs/ui-kit-web/dist/ui/utils.js.map +1 -0
- package/dist/libs/ui-kit-web/dist/ui-kit-core/dist/utils.js +2 -1
- package/dist/libs/ui-kit-web/dist/ui-kit-core/dist/utils.js.map +1 -0
- package/dist/views/Overview.d.ts +2 -1
- package/dist/views/Overview.d.ts.map +1 -0
- package/dist/views/Overview.js +4 -3
- package/dist/views/Overview.js.map +1 -0
- package/dist/views/Progress.d.ts +4 -3
- package/dist/views/Progress.d.ts.map +1 -0
- package/dist/views/Progress.js +2 -1
- package/dist/views/Progress.js.map +1 -0
- package/dist/views/Steps.d.ts +4 -3
- package/dist/views/Steps.d.ts.map +1 -0
- package/dist/views/Steps.js +2 -1
- package/dist/views/Steps.js.map +1 -0
- package/dist/views/Timeline.d.ts +2 -1
- package/dist/views/Timeline.d.ts.map +1 -0
- package/dist/views/Timeline.js +2 -1
- package/dist/views/Timeline.js.map +1 -0
- package/package.json +22 -14
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +0 -15
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +0 -15
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +0 -15
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +0 -15
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +0 -15
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +0 -15
- package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +0 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @lssm/example.learning-journey-ui-gamified
|
|
2
2
|
|
|
3
|
-
## 0.0.0-canary-
|
|
3
|
+
## 0.0.0-canary-20251220002821
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
### Patch Changes
|
|
10
10
|
|
|
11
11
|
- Updated dependencies [66a5dfd]
|
|
12
|
-
- @lssm/example.learning-journey-duo-drills@0.0.0-canary-
|
|
13
|
-
- @lssm/example.learning-journey-quest-challenges@0.0.0-canary-
|
|
14
|
-
- @lssm/example.learning-journey-ui-shared@0.0.0-canary-
|
|
15
|
-
- @lssm/lib.contracts@0.0.0-canary-
|
|
16
|
-
- @lssm/lib.design-system@0.0.0-canary-
|
|
17
|
-
- @lssm/lib.schema@0.0.0-canary-
|
|
18
|
-
- @lssm/lib.ui-kit-web@0.0.0-canary-
|
|
19
|
-
- @lssm/module.learning-journey@0.0.0-canary-
|
|
12
|
+
- @lssm/example.learning-journey-duo-drills@0.0.0-canary-20251220002821
|
|
13
|
+
- @lssm/example.learning-journey-quest-challenges@0.0.0-canary-20251220002821
|
|
14
|
+
- @lssm/example.learning-journey-ui-shared@0.0.0-canary-20251220002821
|
|
15
|
+
- @lssm/lib.contracts@0.0.0-canary-20251220002821
|
|
16
|
+
- @lssm/lib.design-system@0.0.0-canary-20251220002821
|
|
17
|
+
- @lssm/lib.schema@0.0.0-canary-20251220002821
|
|
18
|
+
- @lssm/lib.ui-kit-web@0.0.0-canary-20251220002821
|
|
19
|
+
- @lssm/module.learning-journey@0.0.0-canary-20251220002821
|
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.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GamifiedMiniApp.d.ts","names":[],"sources":["../src/GamifiedMiniApp.tsx"],"sourcesContent":[],"mappings":";;;;KAeK,oBAAA,GAAuB,KAAK;aACpB;;AADR,iBAIW,eAAA,CAJS;EAAA,KAAA;EAAA,QAAA,EAMb,gBANa;EAAA,cAAA,EAOP,sBAPO;EAAA,YAAA;EAAA;AAAA,CAAA,EAUtB,oBAVsB,CAAA,EAUF,kBAAA,CAAA,GAAA,CAAA,OAVE"}
|
package/dist/GamifiedMiniApp.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GamifiedMiniApp.js","names":[],"sources":["../src/GamifiedMiniApp.tsx"],"sourcesContent":["'use client';\n\nimport { useState, useCallback } from 'react';\nimport { Card, CardContent } from '@lssm/lib.ui-kit-web/ui/card';\nimport {\n ViewTabs,\n useLearningProgress,\n type LearningView,\n type LearningMiniAppProps,\n} from '@lssm/example.learning-journey-ui-shared';\nimport { Overview } from './views/Overview';\nimport { Steps } from './views/Steps';\nimport { Progress } from './views/Progress';\nimport { Timeline } from './views/Timeline';\n\ntype GamifiedMiniAppProps = Omit<LearningMiniAppProps, 'progress'> & {\n progress?: LearningMiniAppProps['progress'];\n};\n\nexport function GamifiedMiniApp({\n track,\n progress: externalProgress,\n onStepComplete: externalOnStepComplete,\n onViewChange,\n initialView = 'overview',\n}: GamifiedMiniAppProps) {\n const [currentView, setCurrentView] = useState<LearningView>(initialView);\n\n // Use internal progress if not provided externally\n const { progress: internalProgress, completeStep: internalCompleteStep } =\n useLearningProgress(track);\n\n const progress = externalProgress ?? internalProgress;\n\n const handleViewChange = useCallback(\n (view: LearningView) => {\n setCurrentView(view);\n onViewChange?.(view);\n },\n [onViewChange]\n );\n\n const handleStepComplete = useCallback(\n (stepId: string) => {\n if (externalOnStepComplete) {\n externalOnStepComplete(stepId);\n } else {\n internalCompleteStep(stepId);\n }\n },\n [externalOnStepComplete, internalCompleteStep]\n );\n\n const handleStartFromOverview = useCallback(() => {\n setCurrentView('steps');\n onViewChange?.('steps');\n }, [onViewChange]);\n\n const renderView = () => {\n const viewProps = {\n track,\n progress,\n onStepComplete: handleStepComplete,\n };\n\n switch (currentView) {\n case 'overview':\n return <Overview {...viewProps} onStart={handleStartFromOverview} />;\n case 'steps':\n return <Steps {...viewProps} />;\n case 'progress':\n return <Progress {...viewProps} />;\n case 'timeline':\n return <Timeline {...viewProps} />;\n default:\n return <Overview {...viewProps} onStart={handleStartFromOverview} />;\n }\n };\n\n return (\n <div className=\"space-y-6\">\n {/* Navigation */}\n <Card>\n <CardContent className=\"p-4\">\n <ViewTabs currentView={currentView} onViewChange={handleViewChange} />\n </CardContent>\n </Card>\n\n {/* Current View */}\n {renderView()}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAmBA,SAAgB,gBAAgB,EAC9B,OACA,UAAU,kBACV,gBAAgB,wBAChB,cACA,cAAc,cACS;CACvB,MAAM,CAAC,aAAa,kBAAkB,SAAuB,YAAY;CAGzE,MAAM,EAAE,UAAU,kBAAkB,cAAc,yBAChD,oBAAoB,MAAM;CAE5B,MAAM,WAAW,oBAAoB;CAErC,MAAM,mBAAmB,aACtB,SAAuB;AACtB,iBAAe,KAAK;AACpB,iBAAe,KAAK;IAEtB,CAAC,aAAa,CACf;CAED,MAAM,qBAAqB,aACxB,WAAmB;AAClB,MAAI,uBACF,wBAAuB,OAAO;MAE9B,sBAAqB,OAAO;IAGhC,CAAC,wBAAwB,qBAAqB,CAC/C;CAED,MAAM,0BAA0B,kBAAkB;AAChD,iBAAe,QAAQ;AACvB,iBAAe,QAAQ;IACtB,CAAC,aAAa,CAAC;CAElB,MAAM,mBAAmB;EACvB,MAAM,YAAY;GAChB;GACA;GACA,gBAAgB;GACjB;AAED,UAAQ,aAAR;GACE,KAAK,WACH,QAAO,oBAAC;IAAS,GAAI;IAAW,SAAS;KAA2B;GACtE,KAAK,QACH,QAAO,oBAAC,SAAM,GAAI,YAAa;GACjC,KAAK,WACH,QAAO,oBAAC,YAAS,GAAI,YAAa;GACpC,KAAK,WACH,QAAO,oBAAC,YAAS,GAAI,YAAa;GACpC,QACE,QAAO,oBAAC;IAAS,GAAI;IAAW,SAAS;KAA2B;;;AAI1E,QACE,qBAAC;EAAI,WAAU;aAEb,oBAAC,kBACC,oBAAC;GAAY,WAAU;aACrB,oBAAC;IAAsB;IAAa,cAAc;KAAoB;IAC1D,GACT,EAGN,YAAY;GACT"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/components/DayCalendar.d.ts
|
|
4
4
|
interface DayCalendarProps {
|
|
@@ -10,6 +10,7 @@ declare function DayCalendar({
|
|
|
10
10
|
totalDays,
|
|
11
11
|
currentDay,
|
|
12
12
|
completedDays
|
|
13
|
-
}: DayCalendarProps):
|
|
13
|
+
}: DayCalendarProps): react_jsx_runtime0.JSX.Element;
|
|
14
14
|
//#endregion
|
|
15
|
-
export { DayCalendar };
|
|
15
|
+
export { DayCalendar };
|
|
16
|
+
//# sourceMappingURL=DayCalendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DayCalendar.d.ts","names":[],"sources":["../../src/components/DayCalendar.tsx"],"sourcesContent":[],"mappings":";;;UAIU,gBAAA;;;EAAA,aAAA,EAAA,MAAgB,EAAA;AAM1B;AACE,iBADc,WAAA,CACd;EAAA,SAAA;EAAA,UAAA;EAAA;AAAA,CAAA,EAGC,gBAHD,CAAA,EAGiB,kBAAA,CAAA,GAAA,CAAA,OAHjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DayCalendar.js","names":[],"sources":["../../src/components/DayCalendar.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@lssm/lib.ui-kit-web/ui/utils';\n\ninterface DayCalendarProps {\n totalDays: number;\n currentDay: number;\n completedDays: number[];\n}\n\nexport function DayCalendar({\n totalDays,\n currentDay,\n completedDays,\n}: DayCalendarProps) {\n const days = Array.from({ length: totalDays }, (_, i) => i + 1);\n\n return (\n <div className=\"grid grid-cols-7 gap-2\">\n {days.map((day) => {\n const isCompleted = completedDays.includes(day);\n const isCurrent = day === currentDay;\n const isLocked = day > currentDay;\n\n return (\n <div\n key={day}\n className={cn(\n 'flex h-12 w-12 flex-col items-center justify-center rounded-lg border text-sm font-medium transition-all',\n isCompleted && 'border-green-500 bg-green-500/10 text-green-500',\n isCurrent &&\n !isCompleted &&\n 'border-violet-500 bg-violet-500/10 text-violet-500 ring-2 ring-violet-500/50',\n isLocked && 'border-muted bg-muted/50 text-muted-foreground',\n !isCompleted && !isCurrent && !isLocked && 'border-border bg-card'\n )}\n >\n {isCompleted ? (\n <span className=\"text-lg\">✓</span>\n ) : isLocked ? (\n <span className=\"text-lg\">🔒</span>\n ) : (\n <>\n <span className=\"text-muted-foreground text-xs\">Day</span>\n <span>{day}</span>\n </>\n )}\n </div>\n );\n })}\n </div>\n );\n}\n"],"mappings":";;;;;;AAUA,SAAgB,YAAY,EAC1B,WACA,YACA,iBACmB;AAGnB,QACE,oBAAC;EAAI,WAAU;YAHJ,MAAM,KAAK,EAAE,QAAQ,WAAW,GAAG,GAAG,MAAM,IAAI,EAAE,CAIrD,KAAK,QAAQ;GACjB,MAAM,cAAc,cAAc,SAAS,IAAI;GAC/C,MAAM,YAAY,QAAQ;GAC1B,MAAM,WAAW,MAAM;AAEvB,UACE,oBAAC;IAEC,WAAW,GACT,4GACA,eAAe,mDACf,aACE,CAAC,eACD,gFACF,YAAY,kDACZ,CAAC,eAAe,CAAC,aAAa,CAAC,YAAY,wBAC5C;cAEA,cACC,oBAAC;KAAK,WAAU;eAAU;MAAQ,GAChC,WACF,oBAAC;KAAK,WAAU;eAAU;MAAS,GAEnC,4CACE,oBAAC;KAAK,WAAU;eAAgC;MAAU,EAC1D,oBAAC,oBAAM,MAAW,IACjB;MAnBA,IAqBD;IAER;GACE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FlashCard.d.ts","names":[],"sources":["../../src/components/FlashCard.tsx"],"sourcesContent":[],"mappings":";;;;UAQU,cAAA;QACF;;EADE,SAAA,EAAA,OAAc;EAOR,UAAA,CAAA,EAAS,GAAA,GAAA,IAAA;;AAEvB,iBAFc,SAAA,CAEd;EAAA,IAAA;EAAA,WAAA;EAAA,SAAA;EAAA;AAAA,CAAA,EAGC,cAHD,CAAA,EAGe,kBAAA,CAAA,GAAA,CAAA,OAHf"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { Card, CardContent } from "../libs/ui-kit-web/dist/ui/card.js";
|
|
4
|
-
import { Button
|
|
4
|
+
import { Button } from "../libs/design-system/dist/components/atoms/Button.js";
|
|
5
5
|
import { cn } from "../libs/ui-kit-web/dist/ui/utils.js";
|
|
6
6
|
import { useState } from "react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -56,12 +56,12 @@ function FlashCard({ step, isCompleted, isCurrent, onComplete }) {
|
|
|
56
56
|
children: step.instructions ?? "Complete this step to earn XP"
|
|
57
57
|
}), /* @__PURE__ */ jsxs("div", {
|
|
58
58
|
className: "flex gap-2",
|
|
59
|
-
children: [/* @__PURE__ */ jsx(Button
|
|
59
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
60
60
|
variant: "outline",
|
|
61
61
|
size: "sm",
|
|
62
62
|
onClick: () => setIsFlipped(false),
|
|
63
63
|
children: "Back"
|
|
64
|
-
}), /* @__PURE__ */ jsx(Button
|
|
64
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
65
65
|
size: "sm",
|
|
66
66
|
onClick: (e) => {
|
|
67
67
|
e.stopPropagation();
|
|
@@ -76,4 +76,5 @@ function FlashCard({ step, isCompleted, isCurrent, onComplete }) {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
//#endregion
|
|
79
|
-
export { FlashCard };
|
|
79
|
+
export { FlashCard };
|
|
80
|
+
//# sourceMappingURL=FlashCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FlashCard.js","names":[],"sources":["../../src/components/FlashCard.tsx"],"sourcesContent":["'use client';\n\nimport { useState } from 'react';\nimport { Button } from '@lssm/lib.design-system';\nimport { Card, CardContent } from '@lssm/lib.ui-kit-web/ui/card';\nimport { cn } from '@lssm/lib.ui-kit-web/ui/utils';\nimport type { LearningJourneyStepSpec } from '@lssm/module.learning-journey/track-spec';\n\ninterface FlashCardProps {\n step: LearningJourneyStepSpec;\n isCompleted: boolean;\n isCurrent: boolean;\n onComplete?: () => void;\n}\n\nexport function FlashCard({\n step,\n isCompleted,\n isCurrent,\n onComplete,\n}: FlashCardProps) {\n const [isFlipped, setIsFlipped] = useState(false);\n\n return (\n <Card\n className={cn(\n 'relative cursor-pointer overflow-hidden transition-all duration-300',\n isCurrent && 'ring-primary ring-2',\n isCompleted && 'opacity-60'\n )}\n onClick={() => !isCompleted && setIsFlipped(!isFlipped)}\n >\n <CardContent className=\"p-6\">\n {/* Front of card */}\n <div\n className={cn(\n 'space-y-4 transition-opacity duration-200',\n isFlipped ? 'opacity-0' : 'opacity-100'\n )}\n >\n <div className=\"flex items-start justify-between\">\n <div className=\"flex-1\">\n <h3 className=\"text-lg font-semibold\">{step.title}</h3>\n {step.description && (\n <p className=\"text-muted-foreground mt-1 text-sm\">\n {step.description}\n </p>\n )}\n </div>\n {step.xpReward && (\n <span className=\"rounded-full bg-green-500/10 px-2 py-1 text-xs font-semibold text-green-500\">\n +{step.xpReward} XP\n </span>\n )}\n </div>\n\n {isCompleted && (\n <div className=\"flex items-center gap-2 text-green-500\">\n <span>✓</span>\n <span className=\"text-sm font-medium\">Completed</span>\n </div>\n )}\n\n {isCurrent && !isCompleted && (\n <p className=\"text-muted-foreground text-xs\">\n Tap to reveal action\n </p>\n )}\n </div>\n\n {/* Back of card (action) */}\n {isFlipped && !isCompleted && (\n <div className=\"absolute inset-0 flex flex-col items-center justify-center gap-4 bg-gradient-to-br from-violet-500/10 to-violet-600/10 p-6\">\n <p className=\"text-center text-sm\">\n {step.instructions ?? 'Complete this step to earn XP'}\n </p>\n <div className=\"flex gap-2\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => setIsFlipped(false)}\n >\n Back\n </Button>\n <Button\n size=\"sm\"\n onClick={(e) => {\n e.stopPropagation();\n onComplete?.();\n }}\n >\n Mark Complete\n </Button>\n </div>\n </div>\n )}\n </CardContent>\n </Card>\n );\n}\n"],"mappings":";;;;;;;;;AAeA,SAAgB,UAAU,EACxB,MACA,aACA,WACA,cACiB;CACjB,MAAM,CAAC,WAAW,gBAAgB,SAAS,MAAM;AAEjD,QACE,oBAAC;EACC,WAAW,GACT,uEACA,aAAa,uBACb,eAAe,aAChB;EACD,eAAe,CAAC,eAAe,aAAa,CAAC,UAAU;YAEvD,qBAAC;GAAY,WAAU;cAErB,qBAAC;IACC,WAAW,GACT,6CACA,YAAY,cAAc,cAC3B;;KAED,qBAAC;MAAI,WAAU;iBACb,qBAAC;OAAI,WAAU;kBACb,oBAAC;QAAG,WAAU;kBAAyB,KAAK;SAAW,EACtD,KAAK,eACJ,oBAAC;QAAE,WAAU;kBACV,KAAK;SACJ;QAEF,EACL,KAAK,YACJ,qBAAC;OAAK,WAAU;;QAA8E;QAC1F,KAAK;QAAS;;QACX;OAEL;KAEL,eACC,qBAAC;MAAI,WAAU;iBACb,oBAAC,oBAAK,MAAQ,EACd,oBAAC;OAAK,WAAU;iBAAsB;QAAgB;OAClD;KAGP,aAAa,CAAC,eACb,oBAAC;MAAE,WAAU;gBAAgC;OAEzC;;KAEF,EAGL,aAAa,CAAC,eACb,qBAAC;IAAI,WAAU;eACb,oBAAC;KAAE,WAAU;eACV,KAAK,gBAAgB;MACpB,EACJ,qBAAC;KAAI,WAAU;gBACb,oBAAC;MACC,SAAQ;MACR,MAAK;MACL,eAAe,aAAa,MAAM;gBACnC;OAEQ,EACT,oBAAC;MACC,MAAK;MACL,UAAU,MAAM;AACd,SAAE,iBAAiB;AACnB,qBAAc;;gBAEjB;OAEQ;MACL;KACF;IAEI;GACT"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/components/MasteryRing.d.ts
|
|
4
4
|
interface MasteryRingProps {
|
|
@@ -12,6 +12,7 @@ declare function MasteryRing({
|
|
|
12
12
|
percentage,
|
|
13
13
|
size,
|
|
14
14
|
color
|
|
15
|
-
}: MasteryRingProps):
|
|
15
|
+
}: MasteryRingProps): react_jsx_runtime2.JSX.Element;
|
|
16
16
|
//#endregion
|
|
17
|
-
export { MasteryRing };
|
|
17
|
+
export { MasteryRing };
|
|
18
|
+
//# sourceMappingURL=MasteryRing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MasteryRing.d.ts","names":[],"sources":["../../src/components/MasteryRing.tsx"],"sourcesContent":[],"mappings":";;;UAIU,gBAAA;;;EAAA,IAAA,CAAA,EAAA,IAAA,GAAA,IAAA,GAAgB,IAAA;EAoBV,KAAA,CAAA,EAAA,OAAW,GAAA,MAAA,GAAA,QAAA,GAAA,QAAA;;AAEzB,iBAFc,WAAA,CAEd;EAAA,KAAA;EAAA,UAAA;EAAA,IAAA;EAAA;AAAA,CAAA,EAGC,gBAHD,CAAA,EAGiB,kBAAA,CAAA,GAAA,CAAA,OAHjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MasteryRing.js","names":[],"sources":["../../src/components/MasteryRing.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@lssm/lib.ui-kit-web/ui/utils';\n\ninterface MasteryRingProps {\n label: string;\n percentage: number;\n size?: 'sm' | 'md' | 'lg';\n color?: 'green' | 'blue' | 'violet' | 'orange';\n}\n\nconst sizeStyles = {\n sm: { container: 'h-16 w-16', text: 'text-xs', ring: 48, stroke: 4 },\n md: { container: 'h-24 w-24', text: 'text-sm', ring: 72, stroke: 6 },\n lg: { container: 'h-32 w-32', text: 'text-base', ring: 96, stroke: 8 },\n};\n\nconst colorStyles = {\n green: 'stroke-green-500',\n blue: 'stroke-blue-500',\n violet: 'stroke-violet-500',\n orange: 'stroke-orange-500',\n};\n\nexport function MasteryRing({\n label,\n percentage,\n size = 'md',\n color = 'violet',\n}: MasteryRingProps) {\n const styles = sizeStyles[size];\n const radius = (styles.ring - styles.stroke) / 2;\n const circumference = 2 * Math.PI * radius;\n const strokeDashoffset = circumference - (percentage / 100) * circumference;\n\n return (\n <div\n className={cn(\n 'relative flex flex-col items-center gap-1',\n styles.container\n )}\n >\n <svg\n className=\"absolute -rotate-90\"\n width={styles.ring}\n height={styles.ring}\n viewBox={`0 0 ${styles.ring} ${styles.ring}`}\n >\n {/* Background ring */}\n <circle\n cx={styles.ring / 2}\n cy={styles.ring / 2}\n r={radius}\n fill=\"none\"\n strokeWidth={styles.stroke}\n className=\"stroke-muted\"\n />\n {/* Progress ring */}\n <circle\n cx={styles.ring / 2}\n cy={styles.ring / 2}\n r={radius}\n fill=\"none\"\n strokeWidth={styles.stroke}\n strokeLinecap=\"round\"\n strokeDasharray={circumference}\n strokeDashoffset={strokeDashoffset}\n className={cn('transition-all duration-500', colorStyles[color])}\n />\n </svg>\n <div className=\"flex h-full flex-col items-center justify-center\">\n <span className={cn('font-bold', styles.text)}>\n {Math.round(percentage)}%\n </span>\n </div>\n <span className={cn('text-muted-foreground mt-1 truncate', styles.text)}>\n {label}\n </span>\n </div>\n );\n}\n"],"mappings":";;;;;;AAWA,MAAM,aAAa;CACjB,IAAI;EAAE,WAAW;EAAa,MAAM;EAAW,MAAM;EAAI,QAAQ;EAAG;CACpE,IAAI;EAAE,WAAW;EAAa,MAAM;EAAW,MAAM;EAAI,QAAQ;EAAG;CACpE,IAAI;EAAE,WAAW;EAAa,MAAM;EAAa,MAAM;EAAI,QAAQ;EAAG;CACvE;AAED,MAAM,cAAc;CAClB,OAAO;CACP,MAAM;CACN,QAAQ;CACR,QAAQ;CACT;AAED,SAAgB,YAAY,EAC1B,OACA,YACA,OAAO,MACP,QAAQ,YACW;CACnB,MAAM,SAAS,WAAW;CAC1B,MAAM,UAAU,OAAO,OAAO,OAAO,UAAU;CAC/C,MAAM,gBAAgB,IAAI,KAAK,KAAK;CACpC,MAAM,mBAAmB,gBAAiB,aAAa,MAAO;AAE9D,QACE,qBAAC;EACC,WAAW,GACT,6CACA,OAAO,UACR;;GAED,qBAAC;IACC,WAAU;IACV,OAAO,OAAO;IACd,QAAQ,OAAO;IACf,SAAS,OAAO,OAAO,KAAK,GAAG,OAAO;eAGtC,oBAAC;KACC,IAAI,OAAO,OAAO;KAClB,IAAI,OAAO,OAAO;KAClB,GAAG;KACH,MAAK;KACL,aAAa,OAAO;KACpB,WAAU;MACV,EAEF,oBAAC;KACC,IAAI,OAAO,OAAO;KAClB,IAAI,OAAO,OAAO;KAClB,GAAG;KACH,MAAK;KACL,aAAa,OAAO;KACpB,eAAc;KACd,iBAAiB;KACC;KAClB,WAAW,GAAG,+BAA+B,YAAY,OAAO;MAChE;KACE;GACN,oBAAC;IAAI,WAAU;cACb,qBAAC;KAAK,WAAW,GAAG,aAAa,OAAO,KAAK;gBAC1C,KAAK,MAAM,WAAW,EAAC;MACnB;KACH;GACN,oBAAC;IAAK,WAAW,GAAG,uCAAuC,OAAO,KAAK;cACpE;KACI;;GACH"}
|
|
@@ -17,4 +17,5 @@ registerDocBlocks([{
|
|
|
17
17
|
body: `## Includes\n- Gamified mini-app shell\n- Views: overview, steps, progress, timeline\n- Components: flash card, mastery ring, day calendar\n\n## Notes\n- Compose with design system components.\n- Respect prefers-reduced-motion; keep tap targets large.`
|
|
18
18
|
}]);
|
|
19
19
|
|
|
20
|
-
//#endregion
|
|
20
|
+
//#endregion
|
|
21
|
+
//# sourceMappingURL=learning-journey-ui-gamified.docblock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"learning-journey-ui-gamified.docblock.js","names":[],"sources":["../../src/docs/learning-journey-ui-gamified.docblock.ts"],"sourcesContent":["import type { DocBlock } from '@lssm/lib.contracts/docs';\nimport { registerDocBlocks } from '@lssm/lib.contracts/docs';\n\nconst blocks: DocBlock[] = [\n {\n id: 'docs.examples.learning-journey-ui-gamified',\n title: 'Learning Journey UI — Gamified',\n summary:\n 'UI mini-app components for gamified learning: flashcards, mastery, streak/calendar.',\n kind: 'reference',\n visibility: 'public',\n route: '/docs/examples/learning-journey-ui-gamified',\n tags: ['learning', 'ui', 'gamified'],\n body: `## Includes\\n- Gamified mini-app shell\\n- Views: overview, steps, progress, timeline\\n- Components: flash card, mastery ring, day calendar\\n\\n## Notes\\n- Compose with design system components.\\n- Respect prefers-reduced-motion; keep tap targets large.`,\n },\n];\n\nregisterDocBlocks(blocks);\n"],"mappings":";;;;AAiBA,kBAd2B,CACzB;CACE,IAAI;CACJ,OAAO;CACP,SACE;CACF,MAAM;CACN,YAAY;CACZ,OAAO;CACP,MAAM;EAAC;EAAY;EAAM;EAAW;CACpC,MAAM;CACP,CACF,CAEwB"}
|
package/dist/example.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"example.d.ts","names":[],"sources":["../src/example.ts"],"sourcesContent":[],"mappings":";cAAM;EAAA,SAAA,EAqBI,EAAA,8BAAA"}
|
package/dist/example.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"example.js","names":[],"sources":["../src/example.ts"],"sourcesContent":["const example = {\n id: 'learning-journey-ui-gamified',\n title: 'Learning Journey UI — Gamified',\n summary:\n 'UI mini-app for gamified learning: flashcards, mastery ring, calendar.',\n tags: ['learning', 'ui', 'gamified'],\n kind: 'ui',\n visibility: 'public',\n docs: {\n rootDocId: 'docs.examples.learning-journey-ui-gamified',\n },\n entrypoints: {\n packageName: '@lssm/example.learning-journey-ui-gamified',\n docs: './docs',\n },\n surfaces: {\n templates: true,\n sandbox: { enabled: true, modes: ['playground', 'markdown'] },\n studio: { enabled: true, installable: true },\n mcp: { enabled: true },\n },\n} as const;\n\nexport default example;\n"],"mappings":";AAAA,MAAM,UAAU;CACd,IAAI;CACJ,OAAO;CACP,SACE;CACF,MAAM;EAAC;EAAY;EAAM;EAAW;CACpC,MAAM;CACN,YAAY;CACZ,MAAM,EACJ,WAAW,8CACZ;CACD,aAAa;EACX,aAAa;EACb,MAAM;EACP;CACD,UAAU;EACR,WAAW;EACX,SAAS;GAAE,SAAS;GAAM,OAAO,CAAC,cAAc,WAAW;GAAE;EAC7D,QAAQ;GAAE,SAAS;GAAM,aAAa;GAAM;EAC5C,KAAK,EAAE,SAAS,MAAM;EACvB;CACF;AAED,sBAAe"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BadgeDisplay.js","names":[],"sources":["../../../../../../learning-journey-ui-shared/dist/components/BadgeDisplay.js"],"sourcesContent":["'use client';\n\nimport { cn } from \"../libs/ui-kit-web/dist/ui/utils.js\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\n\n//#region src/components/BadgeDisplay.tsx\nconst BADGE_ICONS = {\n\tstudio_first_30m: \"🎯\",\n\tplatform_tour: \"🗺️\",\n\tcrm_first_win: \"🏆\",\n\tdrill_master: \"🧠\",\n\tcoach_listener: \"👂\",\n\tquest_complete: \"⭐\",\n\tstreak_7: \"🔥\",\n\tstreak_30: \"💎\",\n\tdefault: \"🏅\"\n};\nconst sizeStyles = {\n\tsm: \"h-6 w-6 text-sm\",\n\tmd: \"h-8 w-8 text-base\",\n\tlg: \"h-10 w-10 text-lg\"\n};\nfunction BadgeDisplay({ badges, maxVisible = 5, size = \"md\" }) {\n\tconst visibleBadges = badges.slice(0, maxVisible);\n\tconst hiddenCount = badges.length - maxVisible;\n\tif (badges.length === 0) return /* @__PURE__ */ jsx(\"div\", {\n\t\tclassName: \"text-muted-foreground text-sm\",\n\t\tchildren: \"No badges earned yet\"\n\t});\n\treturn /* @__PURE__ */ jsxs(\"div\", {\n\t\tclassName: \"flex items-center gap-1\",\n\t\tchildren: [visibleBadges.map((badge) => /* @__PURE__ */ jsx(\"div\", {\n\t\t\tclassName: cn(\"flex items-center justify-center rounded-full bg-gradient-to-br from-amber-400/20 to-amber-600/20\", sizeStyles[size]),\n\t\t\ttitle: badge.replace(/_/g, \" \"),\n\t\t\tchildren: BADGE_ICONS[badge] ?? BADGE_ICONS.default\n\t\t}, badge)), hiddenCount > 0 && /* @__PURE__ */ jsxs(\"div\", {\n\t\t\tclassName: cn(\"text-muted-foreground bg-muted flex items-center justify-center rounded-full\", sizeStyles[size], \"text-xs font-medium\"),\n\t\t\tchildren: [\"+\", hiddenCount]\n\t\t})]\n\t});\n}\n\n//#endregion\nexport { BadgeDisplay };\n//# sourceMappingURL=BadgeDisplay.js.map"],"mappings":";;;;;;AAMA,MAAM,cAAc;CACnB,kBAAkB;CAClB,eAAe;CACf,eAAe;CACf,cAAc;CACd,gBAAgB;CAChB,gBAAgB;CAChB,UAAU;CACV,WAAW;CACX,SAAS;CACT;AACD,MAAM,aAAa;CAClB,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ;AACD,SAAS,aAAa,EAAE,QAAQ,aAAa,GAAG,OAAO,QAAQ;CAC9D,MAAM,gBAAgB,OAAO,MAAM,GAAG,WAAW;CACjD,MAAM,cAAc,OAAO,SAAS;AACpC,KAAI,OAAO,WAAW,EAAG,QAAuB,oBAAI,OAAO;EAC1D,WAAW;EACX,UAAU;EACV,CAAC;AACF,QAAuB,qBAAK,OAAO;EAClC,WAAW;EACX,UAAU,CAAC,cAAc,KAAK,UAA0B,oBAAI,OAAO;GAClE,WAAW,GAAG,qGAAqG,WAAW,MAAM;GACpI,OAAO,MAAM,QAAQ,MAAM,IAAI;GAC/B,UAAU,YAAY,UAAU,YAAY;GAC5C,EAAE,MAAM,CAAC,EAAE,cAAc,KAAqB,qBAAK,OAAO;GAC1D,WAAW,GAAG,gFAAgF,WAAW,OAAO,sBAAsB;GACtI,UAAU,CAAC,KAAK,YAAY;GAC5B,CAAC,CAAC;EACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StreakCounter.js","names":[],"sources":["../../../../../../learning-journey-ui-shared/dist/components/StreakCounter.js"],"sourcesContent":["'use client';\n\nimport { cn } from \"../libs/ui-kit-web/dist/ui/utils.js\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\n\n//#region src/components/StreakCounter.tsx\nconst sizeStyles = {\n\tsm: {\n\t\tcontainer: \"gap-1 px-2 py-1\",\n\t\ticon: \"text-base\",\n\t\ttext: \"text-xs\"\n\t},\n\tmd: {\n\t\tcontainer: \"gap-1.5 px-3 py-1.5\",\n\t\ticon: \"text-lg\",\n\t\ttext: \"text-sm\"\n\t},\n\tlg: {\n\t\tcontainer: \"gap-2 px-4 py-2\",\n\t\ticon: \"text-xl\",\n\t\ttext: \"text-base\"\n\t}\n};\nfunction StreakCounter({ days, isActive = true, size = \"md\" }) {\n\tconst styles = sizeStyles[size];\n\treturn /* @__PURE__ */ jsxs(\"div\", {\n\t\tclassName: cn(\"inline-flex items-center rounded-full font-semibold\", styles.container, isActive ? \"bg-orange-500/10 text-orange-500\" : \"bg-muted text-muted-foreground\"),\n\t\tchildren: [/* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: styles.icon,\n\t\t\trole: \"img\",\n\t\t\t\"aria-label\": \"streak\",\n\t\t\tchildren: \"🔥\"\n\t\t}), /* @__PURE__ */ jsxs(\"span\", {\n\t\t\tclassName: styles.text,\n\t\t\tchildren: [\n\t\t\t\tdays,\n\t\t\t\t\" \",\n\t\t\t\tdays === 1 ? \"day\" : \"days\"\n\t\t\t]\n\t\t})]\n\t});\n}\n\n//#endregion\nexport { StreakCounter };\n//# sourceMappingURL=StreakCounter.js.map"],"mappings":";;;;;;AAMA,MAAM,aAAa;CAClB,IAAI;EACH,WAAW;EACX,MAAM;EACN,MAAM;EACN;CACD,IAAI;EACH,WAAW;EACX,MAAM;EACN,MAAM;EACN;CACD,IAAI;EACH,WAAW;EACX,MAAM;EACN,MAAM;EACN;CACD;AACD,SAAS,cAAc,EAAE,MAAM,WAAW,MAAM,OAAO,QAAQ;CAC9D,MAAM,SAAS,WAAW;AAC1B,QAAuB,qBAAK,OAAO;EAClC,WAAW,GAAG,uDAAuD,OAAO,WAAW,WAAW,qCAAqC,iCAAiC;EACxK,UAAU,CAAiB,oBAAI,QAAQ;GACtC,WAAW,OAAO;GAClB,MAAM;GACN,cAAc;GACd,UAAU;GACV,CAAC,EAAkB,qBAAK,QAAQ;GAChC,WAAW,OAAO;GAClB,UAAU;IACT;IACA;IACA,SAAS,IAAI,QAAQ;IACrB;GACD,CAAC,CAAC;EACH,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { Button
|
|
3
|
+
import { Button } from "../libs/design-system/dist/components/atoms/Button.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region ../learning-journey-ui-shared/dist/components/ViewTabs.js
|
|
@@ -33,7 +33,7 @@ function ViewTabs({ currentView, onViewChange, availableViews = DEFAULT_VIEWS })
|
|
|
33
33
|
className: "flex flex-wrap gap-2",
|
|
34
34
|
children: availableViews.map((view) => {
|
|
35
35
|
const { label, icon } = VIEW_LABELS[view];
|
|
36
|
-
return /* @__PURE__ */ jsxs(Button
|
|
36
|
+
return /* @__PURE__ */ jsxs(Button, {
|
|
37
37
|
variant: currentView === view ? "default" : "outline",
|
|
38
38
|
size: "sm",
|
|
39
39
|
onClick: () => onViewChange(view),
|
|
@@ -45,4 +45,5 @@ function ViewTabs({ currentView, onViewChange, availableViews = DEFAULT_VIEWS })
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
//#endregion
|
|
48
|
-
export { ViewTabs };
|
|
48
|
+
export { ViewTabs };
|
|
49
|
+
//# sourceMappingURL=ViewTabs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViewTabs.js","names":[],"sources":["../../../../../../learning-journey-ui-shared/dist/components/ViewTabs.js"],"sourcesContent":["'use client';\n\nimport { Button } from \"../libs/design-system/dist/components/atoms/Button.js\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\n\n//#region src/components/ViewTabs.tsx\nconst VIEW_LABELS = {\n\toverview: {\n\t\tlabel: \"Overview\",\n\t\ticon: \"📊\"\n\t},\n\tsteps: {\n\t\tlabel: \"Steps\",\n\t\ticon: \"📝\"\n\t},\n\tprogress: {\n\t\tlabel: \"Progress\",\n\t\ticon: \"📈\"\n\t},\n\ttimeline: {\n\t\tlabel: \"Timeline\",\n\t\ticon: \"📅\"\n\t}\n};\nconst DEFAULT_VIEWS = [\n\t\"overview\",\n\t\"steps\",\n\t\"progress\",\n\t\"timeline\"\n];\nfunction ViewTabs({ currentView, onViewChange, availableViews = DEFAULT_VIEWS }) {\n\treturn /* @__PURE__ */ jsx(\"div\", {\n\t\tclassName: \"flex flex-wrap gap-2\",\n\t\tchildren: availableViews.map((view) => {\n\t\t\tconst { label, icon } = VIEW_LABELS[view];\n\t\t\treturn /* @__PURE__ */ jsxs(Button, {\n\t\t\t\tvariant: currentView === view ? \"default\" : \"outline\",\n\t\t\t\tsize: \"sm\",\n\t\t\t\tonClick: () => onViewChange(view),\n\t\t\t\tclassName: \"gap-1.5\",\n\t\t\t\tchildren: [/* @__PURE__ */ jsx(\"span\", { children: icon }), /* @__PURE__ */ jsx(\"span\", { children: label })]\n\t\t\t}, view);\n\t\t})\n\t});\n}\n\n//#endregion\nexport { ViewTabs };\n//# sourceMappingURL=ViewTabs.js.map"],"mappings":";;;;;;AAMA,MAAM,cAAc;CACnB,UAAU;EACT,OAAO;EACP,MAAM;EACN;CACD,OAAO;EACN,OAAO;EACP,MAAM;EACN;CACD,UAAU;EACT,OAAO;EACP,MAAM;EACN;CACD,UAAU;EACT,OAAO;EACP,MAAM;EACN;CACD;AACD,MAAM,gBAAgB;CACrB;CACA;CACA;CACA;CACA;AACD,SAAS,SAAS,EAAE,aAAa,cAAc,iBAAiB,iBAAiB;AAChF,QAAuB,oBAAI,OAAO;EACjC,WAAW;EACX,UAAU,eAAe,KAAK,SAAS;GACtC,MAAM,EAAE,OAAO,SAAS,YAAY;AACpC,UAAuB,qBAAK,QAAQ;IACnC,SAAS,gBAAgB,OAAO,YAAY;IAC5C,MAAM;IACN,eAAe,aAAa,KAAK;IACjC,WAAW;IACX,UAAU,CAAiB,oBAAI,QAAQ,EAAE,UAAU,MAAM,CAAC,EAAkB,oBAAI,QAAQ,EAAE,UAAU,OAAO,CAAC,CAAC;IAC7G,EAAE,KAAK;IACP;EACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"XpBar.js","names":[],"sources":["../../../../../../learning-journey-ui-shared/dist/components/XpBar.js"],"sourcesContent":["'use client';\n\nimport { Progress } from \"../libs/ui-kit-web/dist/ui/progress.js\";\nimport { cn } from \"../libs/ui-kit-web/dist/ui/utils.js\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\n\n//#region src/components/XpBar.tsx\nconst sizeStyles = {\n\tsm: \"h-2\",\n\tmd: \"h-3\",\n\tlg: \"h-4\"\n};\nconst labelSizeStyles = {\n\tsm: \"text-xs\",\n\tmd: \"text-sm\",\n\tlg: \"text-base\"\n};\nfunction XpBar({ current, max, level, showLabel = true, size = \"md\" }) {\n\tconst percentage = max > 0 ? Math.min(current / max * 100, 100) : 0;\n\treturn /* @__PURE__ */ jsxs(\"div\", {\n\t\tclassName: \"w-full space-y-1\",\n\t\tchildren: [showLabel && /* @__PURE__ */ jsxs(\"div\", {\n\t\t\tclassName: cn(\"flex items-center justify-between\", labelSizeStyles[size]),\n\t\t\tchildren: [/* @__PURE__ */ jsxs(\"span\", {\n\t\t\t\tclassName: \"text-muted-foreground font-medium\",\n\t\t\t\tchildren: [level !== void 0 && /* @__PURE__ */ jsxs(\"span\", {\n\t\t\t\t\tclassName: \"text-primary mr-1\",\n\t\t\t\t\tchildren: [\"Lvl \", level]\n\t\t\t\t}), \"XP\"]\n\t\t\t}), /* @__PURE__ */ jsxs(\"span\", {\n\t\t\t\tclassName: \"font-semibold\",\n\t\t\t\tchildren: [\n\t\t\t\t\tcurrent.toLocaleString(),\n\t\t\t\t\t\" / \",\n\t\t\t\t\tmax.toLocaleString()\n\t\t\t\t]\n\t\t\t})]\n\t\t}), /* @__PURE__ */ jsx(Progress, {\n\t\t\tvalue: percentage,\n\t\t\tclassName: cn(\"bg-muted\", sizeStyles[size])\n\t\t})]\n\t});\n}\n\n//#endregion\nexport { XpBar };\n//# sourceMappingURL=XpBar.js.map"],"mappings":";;;;;;;AAOA,MAAM,aAAa;CAClB,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ;AACD,MAAM,kBAAkB;CACvB,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ;AACD,SAAS,MAAM,EAAE,SAAS,KAAK,OAAO,YAAY,MAAM,OAAO,QAAQ;CACtE,MAAM,aAAa,MAAM,IAAI,KAAK,IAAI,UAAU,MAAM,KAAK,IAAI,GAAG;AAClE,QAAuB,qBAAK,OAAO;EAClC,WAAW;EACX,UAAU,CAAC,aAA6B,qBAAK,OAAO;GACnD,WAAW,GAAG,qCAAqC,gBAAgB,MAAM;GACzE,UAAU,CAAiB,qBAAK,QAAQ;IACvC,WAAW;IACX,UAAU,CAAC,UAAU,KAAK,KAAqB,qBAAK,QAAQ;KAC3D,WAAW;KACX,UAAU,CAAC,QAAQ,MAAM;KACzB,CAAC,EAAE,KAAK;IACT,CAAC,EAAkB,qBAAK,QAAQ;IAChC,WAAW;IACX,UAAU;KACT,QAAQ,gBAAgB;KACxB;KACA,IAAI,gBAAgB;KACpB;IACD,CAAC,CAAC;GACH,CAAC,EAAkB,oBAAI,UAAU;GACjC,OAAO;GACP,WAAW,GAAG,YAAY,WAAW,MAAM;GAC3C,CAAC,CAAC;EACH,CAAC"}
|
package/dist/examples/learning-journey-ui-shared/dist/docs/learning-journey-ui-shared.docblock.js
CHANGED
|
@@ -17,4 +17,5 @@ registerDocBlocks([{
|
|
|
17
17
|
body: `## Includes\n- Hooks: useLearningProgress\n- Components: XpBar, StreakCounter, BadgeDisplay, ViewTabs\n\n## Notes\n- Keep components accessible (labels, focus, contrast).\n- Prefer design-system tokens and components.`
|
|
18
18
|
}]);
|
|
19
19
|
|
|
20
|
-
//#endregion
|
|
20
|
+
//#endregion
|
|
21
|
+
//# sourceMappingURL=learning-journey-ui-shared.docblock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"learning-journey-ui-shared.docblock.js","names":[],"sources":["../../../../../../learning-journey-ui-shared/dist/docs/learning-journey-ui-shared.docblock.js"],"sourcesContent":["import { registerDocBlocks } from \"../libs/contracts/dist/docs/registry.js\";\nimport \"../libs/contracts/dist/docs/index.js\";\n\n//#region src/docs/learning-journey-ui-shared.docblock.ts\nregisterDocBlocks([{\n\tid: \"docs.examples.learning-journey-ui-shared\",\n\ttitle: \"Learning Journey UI — Shared\",\n\tsummary: \"Shared UI components and hooks for learning journey mini-apps.\",\n\tkind: \"reference\",\n\tvisibility: \"public\",\n\troute: \"/docs/examples/learning-journey-ui-shared\",\n\ttags: [\n\t\t\"learning\",\n\t\t\"ui\",\n\t\t\"shared\"\n\t],\n\tbody: `## Includes\\n- Hooks: useLearningProgress\\n- Components: XpBar, StreakCounter, BadgeDisplay, ViewTabs\\n\\n## Notes\\n- Keep components accessible (labels, focus, contrast).\\n- Prefer design-system tokens and components.`\n}]);\n\n//#endregion\n//# sourceMappingURL=learning-journey-ui-shared.docblock.js.map"],"mappings":";;;;AAIA,kBAAkB,CAAC;CAClB,IAAI;CACJ,OAAO;CACP,SAAS;CACT,MAAM;CACN,YAAY;CACZ,OAAO;CACP,MAAM;EACL;EACA;EACA;EACA;CACD,MAAM;CACN,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLearningProgress.js","names":[],"sources":["../../../../../../learning-journey-ui-shared/dist/hooks/useLearningProgress.js"],"sourcesContent":["'use client';\n\nimport { useCallback, useMemo, useState } from \"react\";\n\n//#region src/hooks/useLearningProgress.ts\n/** Default progress state for a new track */\nfunction createDefaultProgress(trackId) {\n\treturn {\n\t\ttrackId,\n\t\tcompletedStepIds: [],\n\t\tcurrentStepId: null,\n\t\txpEarned: 0,\n\t\tstreakDays: 0,\n\t\tlastActivityDate: null,\n\t\tbadges: []\n\t};\n}\n/** Hook for managing learning progress state */\nfunction useLearningProgress(track) {\n\tconst [progress, setProgress] = useState(() => createDefaultProgress(track.id));\n\tconst completeStep = useCallback((stepId) => {\n\t\tconst step = track.steps.find((s) => s.id === stepId);\n\t\tif (!step || progress.completedStepIds.includes(stepId)) return;\n\t\tsetProgress((prev) => {\n\t\t\tconst newCompletedIds = [...prev.completedStepIds, stepId];\n\t\t\tconst xpReward = step.xpReward ?? 0;\n\t\t\tconst nextStep = track.steps.find((s) => !newCompletedIds.includes(s.id));\n\t\t\tconst isTrackComplete = newCompletedIds.length === track.steps.length;\n\t\t\tconst completionBonus = isTrackComplete ? track.completionRewards?.xpBonus ?? 0 : 0;\n\t\t\treturn {\n\t\t\t\t...prev,\n\t\t\t\tcompletedStepIds: newCompletedIds,\n\t\t\t\tcurrentStepId: nextStep?.id ?? null,\n\t\t\t\txpEarned: prev.xpEarned + xpReward + completionBonus,\n\t\t\t\tlastActivityDate: (/* @__PURE__ */ new Date()).toISOString(),\n\t\t\t\tbadges: isTrackComplete && track.completionRewards?.badgeKey ? [...prev.badges, track.completionRewards.badgeKey] : prev.badges\n\t\t\t};\n\t\t});\n\t}, [track, progress.completedStepIds]);\n\tconst resetProgress = useCallback(() => {\n\t\tsetProgress(createDefaultProgress(track.id));\n\t}, [track.id]);\n\tconst incrementStreak = useCallback(() => {\n\t\tsetProgress((prev) => ({\n\t\t\t...prev,\n\t\t\tstreakDays: prev.streakDays + 1,\n\t\t\tlastActivityDate: (/* @__PURE__ */ new Date()).toISOString()\n\t\t}));\n\t}, []);\n\treturn {\n\t\tprogress,\n\t\tstats: useMemo(() => {\n\t\t\tconst totalSteps = track.steps.length;\n\t\t\tconst completedSteps = progress.completedStepIds.length;\n\t\t\tconst percentComplete = totalSteps > 0 ? Math.round(completedSteps / totalSteps * 100) : 0;\n\t\t\tconst totalXp = track.totalXp ?? track.steps.reduce((sum, s) => sum + (s.xpReward ?? 0), 0) + (track.completionRewards?.xpBonus ?? 0);\n\t\t\treturn {\n\t\t\t\ttotalSteps,\n\t\t\t\tcompletedSteps,\n\t\t\t\tremainingSteps: totalSteps - completedSteps,\n\t\t\t\tpercentComplete,\n\t\t\t\ttotalXp,\n\t\t\t\tisComplete: completedSteps === totalSteps\n\t\t\t};\n\t\t}, [track, progress.completedStepIds]),\n\t\tcompleteStep,\n\t\tresetProgress,\n\t\tincrementStreak\n\t};\n}\n\n//#endregion\nexport { useLearningProgress };\n//# sourceMappingURL=useLearningProgress.js.map"],"mappings":";;;;;;AAMA,SAAS,sBAAsB,SAAS;AACvC,QAAO;EACN;EACA,kBAAkB,EAAE;EACpB,eAAe;EACf,UAAU;EACV,YAAY;EACZ,kBAAkB;EAClB,QAAQ,EAAE;EACV;;;AAGF,SAAS,oBAAoB,OAAO;CACnC,MAAM,CAAC,UAAU,eAAe,eAAe,sBAAsB,MAAM,GAAG,CAAC;CAC/E,MAAM,eAAe,aAAa,WAAW;EAC5C,MAAM,OAAO,MAAM,MAAM,MAAM,MAAM,EAAE,OAAO,OAAO;AACrD,MAAI,CAAC,QAAQ,SAAS,iBAAiB,SAAS,OAAO,CAAE;AACzD,eAAa,SAAS;GACrB,MAAM,kBAAkB,CAAC,GAAG,KAAK,kBAAkB,OAAO;GAC1D,MAAM,WAAW,KAAK,YAAY;GAClC,MAAM,WAAW,MAAM,MAAM,MAAM,MAAM,CAAC,gBAAgB,SAAS,EAAE,GAAG,CAAC;GACzE,MAAM,kBAAkB,gBAAgB,WAAW,MAAM,MAAM;GAC/D,MAAM,kBAAkB,kBAAkB,MAAM,mBAAmB,WAAW,IAAI;AAClF,UAAO;IACN,GAAG;IACH,kBAAkB;IAClB,eAAe,UAAU,MAAM;IAC/B,UAAU,KAAK,WAAW,WAAW;IACrC,mCAAmC,IAAI,MAAM,EAAE,aAAa;IAC5D,QAAQ,mBAAmB,MAAM,mBAAmB,WAAW,CAAC,GAAG,KAAK,QAAQ,MAAM,kBAAkB,SAAS,GAAG,KAAK;IACzH;IACA;IACA,CAAC,OAAO,SAAS,iBAAiB,CAAC;CACtC,MAAM,gBAAgB,kBAAkB;AACvC,cAAY,sBAAsB,MAAM,GAAG,CAAC;IAC1C,CAAC,MAAM,GAAG,CAAC;CACd,MAAM,kBAAkB,kBAAkB;AACzC,eAAa,UAAU;GACtB,GAAG;GACH,YAAY,KAAK,aAAa;GAC9B,mCAAmC,IAAI,MAAM,EAAE,aAAa;GAC5D,EAAE;IACD,EAAE,CAAC;AACN,QAAO;EACN;EACA,OAAO,cAAc;GACpB,MAAM,aAAa,MAAM,MAAM;GAC/B,MAAM,iBAAiB,SAAS,iBAAiB;GACjD,MAAM,kBAAkB,aAAa,IAAI,KAAK,MAAM,iBAAiB,aAAa,IAAI,GAAG;GACzF,MAAM,UAAU,MAAM,WAAW,MAAM,MAAM,QAAQ,KAAK,MAAM,OAAO,EAAE,YAAY,IAAI,EAAE,IAAI,MAAM,mBAAmB,WAAW;AACnI,UAAO;IACN;IACA;IACA,gBAAgB,aAAa;IAC7B;IACA;IACA,YAAY,mBAAmB;IAC/B;KACC,CAAC,OAAO,SAAS,iBAAiB,CAAC;EACtC;EACA;EACA;EACA"}
|
|
@@ -12,4 +12,5 @@ registerDocBlocks([{
|
|
|
12
12
|
body: "# Accessibility & WCAG Compliance — **specs.md**\n\n> **Goal:** Ship interfaces that are usable by everyone, by default. This spec sets non‑negotiable rules, checklists, and CI gates to meet **WCAG\xA02.2 AA** (aim for AAA where low‑cost), align with **EN\xA0301\xA0549** (EU), and keep parity on **web (Next.js)** and **mobile (Expo/React\xA0Native)**.\n\n---\n\n## 0) Scope & Principles\n\n- **Standards:** WCAG\xA02.2\xA0AA (incl. new 2.2 SCs: Focus Not Obscured, Focus Appearance, Target Size, Dragging Movements, Accessible Authentication, Redundant Entry). EN\xA0301\xA0549 compliance by conformance to WCAG.\n- **Principles:** Perceivable, Operable, Understandable, Robust (POUR).\n- **Rule of ARIA:** “No ARIA is better than bad ARIA.” Prefer native elements.\n- **Definition of Done (DoD):** No Critical/Major a11y issues in CI; keyboard complete; SR (screen reader) smoke test passed; contrasts pass; acceptance criteria below satisfied.\n- **Repo Alignment:** Web apps use **Radix Primitives + shadcn** wrappers centralized in `packages/lssm/libs/ui-kit-web`. Prefer those components over per‑app duplicates (`packages/*/apps/*/src/components/ui`). When missing, add to `ui-kit-web` first, then adopt app‑side.\n\n---\n\n## 1) Design Requirements (Design System & Tokens)\n\n**1.1 Color & Contrast**\n\n- Body text, icons essential to meaning: **≥\xA04.5:1**; large text (≥\xA018.66px regular / 14px bold): **≥\xA03:1**.\n- Interactive states (default/hover/active/disabled/focus) must maintain contrast **≥\xA03:1** against adjacent colors; text within components follows text ratios.\n- Provide light & dark themes with tokens that guarantee minimums. **Never rely solely on color** to convey meaning; pair with text, shape, or icon.\n\n**1.2 Focus Indicators (WCAG\xA02.4.11/12)**\n\n- Every interactive element has a **visible focus** with clear offset; indicator contrast **≥\xA03:1** vs adjacent colors and indicator **area ≥\xA02\xA0CSS\xA0px** thick.\n- Focus **must not be obscured** by sticky headers/footers or scroll containers.\n\n**1.3 Motion & Preferences**\n\n- Respect `prefers-reduced-motion`: suppress large parallax, auto‑animations; provide instant alternatives.\n- Avoid motion that could trigger vestibular issues; under PRM, use fade/scale under **150ms**.\n\n**1.4 Target Size (2.5.8)**\n\n- Hit areas **≥\xA024×24\xA0CSS\xA0px** (web) and **≥\xA044×44\xA0dp** (mobile) unless exempt.\n\n**1.5 Typography & Layout**\n\n- Support zoom to **400%** without loss of content/functionality; responsive reflow at **320\xA0CSS\xA0px** width.\n- Maintain clear heading hierarchy (h1…h6), one **h1** per view.\n\n- Repository baseline (Web): default body text uses Tailwind `text-lg` (≈18px). As of 2025‑09‑20, the repository bumped all Tailwind typography scale usages by +1 step (e.g., `text-sm`→`text-base`, `text-base`→`text-lg`, …, `text-8xl`→`text-9xl`). For long‑form content, default to `prose-lg`.\n- Do not use `text-xs` for body copy. Reserve `text-sm` only for non‑essential meta (timestamps, fine print) while ensuring contrast and touch targets remain compliant.\n- When increasing font size, ensure line height supports readability. Prefer Tailwind defaults or `leading-relaxed`/`leading-7` for body text where dense blocks appear.\n\n**1.6 Iconography & Imagery**\n\n- Decorative images: `alt=\"\"` or `aria-hidden=\"true\"`.\n- Informative images: concise, specific **alt**; complex charts require a **data table or long description**.\n\n---\n\n## 2) Content Requirements (UX Writing)\n\n- Links say **what happens** (avoid “click here”).\n- Buttons start with verbs; avoid ambiguous labels.\n- Form labels are **visible**; placeholders are **not labels**.\n- Error messages: human + programmatic association; avoid color‑only.\n- Authentication: allow **copy/paste**, password managers, and avoid cognitive tests alone (**3.3.7/3.3.8/3.3.9**).\n- Avoid CAPTCHAs that block users; if unavoidable, provide **multiple alternatives** (logic-free).\n\n---\n\n## 3) Engineering Requirements (Web — Next.js/React)\n\n> Use and extend `packages/lssm/libs/ui-kit-web` as the default UI surface. It wraps **Radix** primitives with sensible a11y defaults (focus rings, roles, keyboard, ARIA binding). When a gap exists, add it to `ui-kit-web` first.\n\n**3.1 Semantics & Landmarks**\n\n- Use native elements: `<button>`, `<a href>`, `<label for>`, `<fieldset>`, `<legend>`, `<table>`, etc.\n- Landmarks per page: `header`, `nav`, `main`, `aside`, `footer`. Provide a **Skip to main content** link.\n- Provide a **Route Announcer** (`aria-live=\"polite\"`) and move focus to page **h1** after navigation.\n\n**3.2 Keyboard**\n\n- All functionality available with keyboard alone. Tab order follows DOM/visual order; **no keyboard traps**.\n- Common bindings:\n - Space/Enter → activate button; Enter on link;\n - Esc closes dialogs/menus;\n - Arrow keys for lists/menus/tablists with **roving tabindex**.\n\n**3.3 Focus Management**\n\n- On route change (Next.js), move focus to the page `<h1>` or container and announce via a live region.\n- Dialogs/menus: **trap focus** inside; return focus to invoking control on close.\n- Don’t steal focus except after explicit user action.\n\n**3.4 Forms**\n\n- Each input has a `<label>` or `aria-label`. Group related inputs with `<fieldset><legend>`.\n- Associate errors via `aria-describedby` or inline IDs; announce with `role=\"alert\"` (assertive only for critical).\n- Provide **autocomplete** tokens for known fields; show **inline validation** and do not block on **onBlur** alone.\n\n**3.5 ARIA Usage**\n\n- Only when needed; match patterns (dialog, menu, combobox, tablist, listbox) per ARIA Authoring Practices.\n- Ensure **name/role/value** are programmatically determinable.\n\n**3.6 Media**\n\n- Videos: **captions**; provide **transcripts** for audio; audio descriptions for essential visual info.\n- No auto‑playing audio. Auto‑playing video must be muted and pausable; provide controls.\n\n**3.7 Tables & Data**\n\n- Use `<th scope>` for headers; captions via `<caption>`; announce sorting via `aria-sort`.\n- Provide CSV/JSON export where charts are primary.\n\n**3.8 Performance & Robustness**\n\n- Avoid content shifts that move focus; reserve space or use skeletons.\n- Maintain accessible names through hydration/SSR; avoid `dangerouslySetInnerHTML` where possible.\n\n**3.9 Next.js specifics**\n\n- Use `next/link` for navigation; ensure links are **links**, not buttons.\n- `next/image` must include **alt** (empty if decorative).\n- Announce route changes with a **global live region** and shift focus to the new view.\n\n**3.10 Accessibility library integration**\n\n- Import `@lssm/lib.accessibility` at app root. It auto-imports its `styles.css` via the package entry; ensure bundlers keep CSS side effects. If your app tree-shakes CSS, explicitly import the stylesheet once in your root layout:\n\n```tsx\n// app/layout.tsx\nimport '@lssm/lib.accessibility'; // includes tokens and provider exports\n// or if needed: import '@lssm/lib.accessibility/src/styles.css';\n```\n\n- Wrap the app with `AccessibilityProvider` and include an element with `id=\"main\"` for the skip link target.\n\n---\n\n## 3b) lssm/ui-kit-web — Component Patterns & Defaults\n\n> Source: `packages/lssm/libs/ui-kit-web/ui/*`\n\n- **Button/Input/Textarea**: Built‑in `focus-visible` rings; ensure visible labels via `FormLabel` or `aria-label`.\n- **Form** (`form.tsx`): `FormControl` wires `aria-invalid` and `aria-describedby` to `FormMessage` and `FormDescription`. Prefer `FormMessage` for inline errors. Add `role=\"alert\"` only for critical.\n- **Dialog/Sheet/Dropdown**: Use Radix wrappers for focus‑trap and return‑focus. Provide `DialogTitle` + `DialogDescription` for name/description.\n- **Select/Combobox**: Prefer `SelectTrigger` with visible label; for icon‑only triggers, supply `aria-label`. Document examples in each app.\n- **Tabs**: Use `TabsList`, `TabsTrigger`, `TabsContent`; names are programmatically determinable.\n- **Toast/Toaster**: Prefer non‑blocking announcements; map critical to assertive region; include action buttons with clear labels.\n- **Table**: Use `TableCaption`; ensure `TableHead` cells use proper `scope`. Provide `aria-sort` on sortable headers.\n- **Utilities to add (repo action)**:\n - `SkipLink` component and pattern in layouts.\n - `RouteAnnouncer` (`aria-live=\"polite\"`) and **FocusOnRouteChange** helper.\n - `VisuallyHidden` wrapper (Radix visually-hidden or minimal utility).\n - `useReducedMotion` helper; honor in animated components.\n - Touch‑size variants (≥44×44) for interactive atoms.\n\n---\n\n## 4) Engineering Requirements (Mobile — Expo/React\xA0Native)\n\n- Set `accessibilityLabel`, `accessibilityHint`, and `accessibilityRole` on touchables.\n- Ensure **hit slop** / min size **≥\xA044×44\xA0dp**.\n- Support Dynamic Type / font scaling; no clipped text at **200%**.\n- Respect **Invert Colors** and **Reduce Motion**; avoid flashing.\n- Group related items with `accessibilityElements` ordering; hide decoration with `accessible={false}` or `importantForAccessibility=\"no-hide-descendants\"` when appropriate.\n- Test with **VoiceOver (iOS)** and **TalkBack (Android)**.\n\n---\n\n## 5) Component Patterns (Acceptance Rules)\n\n**Buttons & Links**\n\n- Use `<button>` for actions, `<a href>` for navigation. Provide disabled states that are perceivable beyond color.\n\n**Navigation**\n\n- Provide **Skip link**. One primary nav landmark. Indicate current page (`aria-current=\"page\"`).\n\n**Menus/Combobox/Autocomplete**\n\n- Follow ARIA patterns: focus moves into list; `aria-expanded`, `aria-controls`, `aria-activedescendant` when applicable; Esc closes; typing filters.\n\n**Modals/Dialogs**\n\n- `role=\"dialog\"` or `alertdialog` with **label**; focus trapped; background inert; Esc closes; return focus to trigger.\n\n**Tabs**\n\n- `role=\"tablist\"`; tabs are in the tab order; arrow keys switch focus; content is `role=\"tabpanel\"` with `aria-labelledby`.\n\n**Toasts/Notifications**\n\n- Non-critical: `aria-live=\"polite\"`; critical: `role=\"alert\"` sparingly.\n\n**Infinite Scroll / “Load More”**\n\n- Provide **Load more** control; announce new content to SR; preserve keyboard position.\n\n**Drag & Drop (2.5.7)**\n\n- Provide **non‑drag** alternative (e.g., move up/down buttons).\n\n**Charts & Maps**\n\n- Provide **table alternative** or textual summary; keyboard access to datapoints where interactive.\n\n---\n\n## 6) Testing & CI (Blocking Gates)\n\n**Static & Unit**\n\n- `eslint-plugin-jsx-a11y` — error on violations.\n- `jest-axe` — unit tests for components.\n\n**Automated Integration**\n\n- `axe-core` via Playwright or Cypress on critical flows.\n- `pa11y-ci` on key routes; threshold: **0 Critical / 0 Serious** to merge.\n- Lighthouse CI a11y score **≥\xA095** on target pages.\n\n**Manual QA (per release)**\n\n- **Keyboard patrol:** navigate primary flows without mouse.\n- **Screen reader smoke:** NVDA (Windows) or VoiceOver (macOS/iOS) across login, navigation, forms, dialogs.\n- **Zoom & Reflow:** 200–400% & 320\xA0px width.\n- **Color/Contrast check:** tokens in both themes.\n\n**Reporting**\n\n- A11y issues labeled: `a11y-blocker`, `a11y-bug`, `a11y-enhancement` with WCAG ref.\n\n---\n\n## 7) Repository‑Specific Adoption Plan\n\n- Centralize UI usage on `packages/lssm/libs/ui-kit-web` and de‑duplicate per‑app `components/ui` where feasible.\n- Introduce `SkipLink`, `RouteAnnouncer`, `FocusOnRouteChange`, and `VisuallyHidden` in `ui-kit-web`. Adopt in app layouts (`app/layout.tsx`) first.\n- Add `useReducedMotion` and wire into animated components (e.g., `drawer`, `tooltip`, `carousel`).\n- Add touch‑size variants to `Button`, `IconButton`, `TabsTrigger`, toggles.\n- Document Select label patterns and error association in Forms.\n\n---\n\n## 8) Code Snippets\n\n**Skip Link**\n\n```html\n<a\n class=\"sr-only focus:not-sr-only focus-visible:outline focus-visible:ring-4 focus-visible:ring-offset-2\"\n href=\"#main\"\n >Skip to main content</a\n>\n<main id=\"main\">…</main>\n```\n\n**Dialog (Radix + shadcn/ui) — essentials**\n\n```tsx\n// Ensure label, description, focus trap, and return focus on close remain intact\n<Dialog>\n <DialogTrigger asChild>\n <button aria-haspopup=\"dialog\">Open settings</button>\n </DialogTrigger>\n <DialogContent aria-describedby=\"settings-desc\">\n <DialogTitle>Settings</DialogTitle>\n <p id=\"settings-desc\">Update your preferences.</p>\n <DialogClose asChild>\n <button>Close</button>\n </DialogClose>\n </DialogContent>\n</Dialog>\n```\n\n**Form error association**\n\n```tsx\n<label htmlFor=\"email\">Email</label>\n<input id=\"email\" name=\"email\" type=\"email\" aria-describedby=\"email-err\" />\n<p id=\"email-err\" role=\"alert\">Enter a valid email.</p>\n```\n\n**Route change announcement (Next.js)**\n\n```tsx\n// Add once at app root\n<div\n aria-live=\"polite\"\n aria-atomic=\"true\"\n id=\"route-announcer\"\n className=\"sr-only\"\n/>\n```\n\n---\n\n## 9) Exceptions & Waivers\n\n- If a criterion cannot be met, file an issue with: context, attempted alternatives, WCAG reference, impact assessment, and a remediation date. **Temporary waivers only.**\n\n---\n\n## 10) Ownership\n\n- **Design:** maintains token contrast, component specs.\n- **Engineering:** enforces CI gates, implements patterns.\n- **QA:** runs manual checks per release.\n- **PM:** blocks release if AA not met on user‑visible flows.\n\n---\n\n## 11) References (internalize; no external dependency at runtime)\n\n- WCAG\xA02.2 (AA), EN\xA0301\xA0549. ARIA Authoring Practices. Platform HIG (Apple, Material).\n- `packages/lssm/libs/ui-kit-web` as the canonical UI source for web.\n\n> **Bottom line:** Shipping means **accessible by default**. We don’t trade a11y for speed; we bake it into speed.\n\n---\n\n## 12) Adoption Status (2025-09-23)\n\n- web-artisan: AccessibilityProvider integrated; sr-only/forced-colors applied; 44x44 targets; forms announce errors; jest-axe and cypress-axe in place.\n- web-strit: AccessibilityProvider integrated; forced-colors, sr-only; forms announce errors; 44x44 targets; contrast tokens and text-scale wired; jest-axe and cypress-axe in place.\n- web-coliving: AccessibilityProvider integrated; forced-colors and focus visibility added; text-scale wired; landing pages converted to `Section`/stacks with text-lg defaults; CTA capture standardized; ESLint guard for text-xs in main content; jest-axe and cypress-axe in place. Next: audit icon-only controls and ensure 44x44 targets; add role=\"alert\" where critical.\n\n> CI gates: run eslint a11y, jest-axe on components, and cypress-axe on critical flows per app.\n\n---\n\n## 13) CI Hardening & Visual QA\n\n- Linting: Run eslint with jsx-a11y rules across all web apps; block on violations.\n- Unit: Run jest-axe for ui-kit-web and app-level components.\n- Integration: cypress-axe on key flows (auth, forms, dialogs, tables).\n- Synthetic scans: pa11y-ci on critical pages (0 Critical/Serious policy).\n- Performance/A11y audit: Lighthouse CI with a11y score >= 95 on target routes.\n- Artifacts: Upload pa11y and Lighthouse reports per PR; annotate failures.\n\n### Recent additions (2025-09-26)\n\n- AutocompleteInput (groceries): Upgraded to ARIA combobox pattern with `aria-controls`, `aria-activedescendant`, `Escape`/`Tab` handling, and labelled listbox.\n- Cypress a11y tests added for furniture and incidents modules on `/modules` and operators flows; checks run axe with critical/serious impacts.\n\n## 14) Accessibility Telemetry (PostHog)\n\n- Events (anonymized): a11y_pref_changed (text_scale, contrast_mode, reduce_motion), a11y_panel_opened.\n- Properties: app, route, previous_value, new_value, timestamp.\n- Dashboards: Adoption over time, per app/route; correlation with reduced bounce on forms.\n- Privacy: No PII; aggregate only.\n"
|
|
13
13
|
}]);
|
|
14
14
|
|
|
15
|
-
//#endregion
|
|
15
|
+
//#endregion
|
|
16
|
+
//# sourceMappingURL=accessibility_wcag_compliance_specs.docblock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accessibility_wcag_compliance_specs.docblock.js","names":[],"sources":["../../../../../../../../../learning-journey-ui-shared/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js"],"sourcesContent":["import { registerDocBlocks } from \"./registry.js\";\n\n//#region ../../libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js\nconst accessibility_wcag_compliance_specs_DocBlocks = [{\n\tid: \"docs.accessibility_wcag_compliance_specs\",\n\ttitle: \"Accessibility & WCAG Compliance — **specs.md**\",\n\tsummary: \"> **Goal:** Ship interfaces that are usable by everyone, by default. This spec sets non‑negotiable rules, checklists, and CI gates to meet **WCAG\\xA02.2 AA** (aim for AAA where low‑cost), align with **EN\\xA0301\\xA0549** (EU), and keep parity on **web (Next.js)** and **mobile (Expo/React\\xA0Native)**.\",\n\tkind: \"reference\",\n\tvisibility: \"public\",\n\troute: \"/docs/accessibility_wcag_compliance_specs\",\n\ttags: [\"accessibility_wcag_compliance_specs\"],\n\tbody: \"# Accessibility & WCAG Compliance — **specs.md**\\n\\n> **Goal:** Ship interfaces that are usable by everyone, by default. This spec sets non‑negotiable rules, checklists, and CI gates to meet **WCAG\\xA02.2 AA** (aim for AAA where low‑cost), align with **EN\\xA0301\\xA0549** (EU), and keep parity on **web (Next.js)** and **mobile (Expo/React\\xA0Native)**.\\n\\n---\\n\\n## 0) Scope & Principles\\n\\n- **Standards:** WCAG\\xA02.2\\xA0AA (incl. new 2.2 SCs: Focus Not Obscured, Focus Appearance, Target Size, Dragging Movements, Accessible Authentication, Redundant Entry). EN\\xA0301\\xA0549 compliance by conformance to WCAG.\\n- **Principles:** Perceivable, Operable, Understandable, Robust (POUR).\\n- **Rule of ARIA:** “No ARIA is better than bad ARIA.” Prefer native elements.\\n- **Definition of Done (DoD):** No Critical/Major a11y issues in CI; keyboard complete; SR (screen reader) smoke test passed; contrasts pass; acceptance criteria below satisfied.\\n- **Repo Alignment:** Web apps use **Radix Primitives + shadcn** wrappers centralized in `packages/lssm/libs/ui-kit-web`. Prefer those components over per‑app duplicates (`packages/*/apps/*/src/components/ui`). When missing, add to `ui-kit-web` first, then adopt app‑side.\\n\\n---\\n\\n## 1) Design Requirements (Design System & Tokens)\\n\\n**1.1 Color & Contrast**\\n\\n- Body text, icons essential to meaning: **≥\\xA04.5:1**; large text (≥\\xA018.66px regular / 14px bold): **≥\\xA03:1**.\\n- Interactive states (default/hover/active/disabled/focus) must maintain contrast **≥\\xA03:1** against adjacent colors; text within components follows text ratios.\\n- Provide light & dark themes with tokens that guarantee minimums. **Never rely solely on color** to convey meaning; pair with text, shape, or icon.\\n\\n**1.2 Focus Indicators (WCAG\\xA02.4.11/12)**\\n\\n- Every interactive element has a **visible focus** with clear offset; indicator contrast **≥\\xA03:1** vs adjacent colors and indicator **area ≥\\xA02\\xA0CSS\\xA0px** thick.\\n- Focus **must not be obscured** by sticky headers/footers or scroll containers.\\n\\n**1.3 Motion & Preferences**\\n\\n- Respect `prefers-reduced-motion`: suppress large parallax, auto‑animations; provide instant alternatives.\\n- Avoid motion that could trigger vestibular issues; under PRM, use fade/scale under **150ms**.\\n\\n**1.4 Target Size (2.5.8)**\\n\\n- Hit areas **≥\\xA024×24\\xA0CSS\\xA0px** (web) and **≥\\xA044×44\\xA0dp** (mobile) unless exempt.\\n\\n**1.5 Typography & Layout**\\n\\n- Support zoom to **400%** without loss of content/functionality; responsive reflow at **320\\xA0CSS\\xA0px** width.\\n- Maintain clear heading hierarchy (h1…h6), one **h1** per view.\\n\\n- Repository baseline (Web): default body text uses Tailwind `text-lg` (≈18px). As of 2025‑09‑20, the repository bumped all Tailwind typography scale usages by +1 step (e.g., `text-sm`→`text-base`, `text-base`→`text-lg`, …, `text-8xl`→`text-9xl`). For long‑form content, default to `prose-lg`.\\n- Do not use `text-xs` for body copy. Reserve `text-sm` only for non‑essential meta (timestamps, fine print) while ensuring contrast and touch targets remain compliant.\\n- When increasing font size, ensure line height supports readability. Prefer Tailwind defaults or `leading-relaxed`/`leading-7` for body text where dense blocks appear.\\n\\n**1.6 Iconography & Imagery**\\n\\n- Decorative images: `alt=\\\"\\\"` or `aria-hidden=\\\"true\\\"`.\\n- Informative images: concise, specific **alt**; complex charts require a **data table or long description**.\\n\\n---\\n\\n## 2) Content Requirements (UX Writing)\\n\\n- Links say **what happens** (avoid “click here”).\\n- Buttons start with verbs; avoid ambiguous labels.\\n- Form labels are **visible**; placeholders are **not labels**.\\n- Error messages: human + programmatic association; avoid color‑only.\\n- Authentication: allow **copy/paste**, password managers, and avoid cognitive tests alone (**3.3.7/3.3.8/3.3.9**).\\n- Avoid CAPTCHAs that block users; if unavoidable, provide **multiple alternatives** (logic-free).\\n\\n---\\n\\n## 3) Engineering Requirements (Web — Next.js/React)\\n\\n> Use and extend `packages/lssm/libs/ui-kit-web` as the default UI surface. It wraps **Radix** primitives with sensible a11y defaults (focus rings, roles, keyboard, ARIA binding). When a gap exists, add it to `ui-kit-web` first.\\n\\n**3.1 Semantics & Landmarks**\\n\\n- Use native elements: `<button>`, `<a href>`, `<label for>`, `<fieldset>`, `<legend>`, `<table>`, etc.\\n- Landmarks per page: `header`, `nav`, `main`, `aside`, `footer`. Provide a **Skip to main content** link.\\n- Provide a **Route Announcer** (`aria-live=\\\"polite\\\"`) and move focus to page **h1** after navigation.\\n\\n**3.2 Keyboard**\\n\\n- All functionality available with keyboard alone. Tab order follows DOM/visual order; **no keyboard traps**.\\n- Common bindings:\\n - Space/Enter → activate button; Enter on link;\\n - Esc closes dialogs/menus;\\n - Arrow keys for lists/menus/tablists with **roving tabindex**.\\n\\n**3.3 Focus Management**\\n\\n- On route change (Next.js), move focus to the page `<h1>` or container and announce via a live region.\\n- Dialogs/menus: **trap focus** inside; return focus to invoking control on close.\\n- Don’t steal focus except after explicit user action.\\n\\n**3.4 Forms**\\n\\n- Each input has a `<label>` or `aria-label`. Group related inputs with `<fieldset><legend>`.\\n- Associate errors via `aria-describedby` or inline IDs; announce with `role=\\\"alert\\\"` (assertive only for critical).\\n- Provide **autocomplete** tokens for known fields; show **inline validation** and do not block on **onBlur** alone.\\n\\n**3.5 ARIA Usage**\\n\\n- Only when needed; match patterns (dialog, menu, combobox, tablist, listbox) per ARIA Authoring Practices.\\n- Ensure **name/role/value** are programmatically determinable.\\n\\n**3.6 Media**\\n\\n- Videos: **captions**; provide **transcripts** for audio; audio descriptions for essential visual info.\\n- No auto‑playing audio. Auto‑playing video must be muted and pausable; provide controls.\\n\\n**3.7 Tables & Data**\\n\\n- Use `<th scope>` for headers; captions via `<caption>`; announce sorting via `aria-sort`.\\n- Provide CSV/JSON export where charts are primary.\\n\\n**3.8 Performance & Robustness**\\n\\n- Avoid content shifts that move focus; reserve space or use skeletons.\\n- Maintain accessible names through hydration/SSR; avoid `dangerouslySetInnerHTML` where possible.\\n\\n**3.9 Next.js specifics**\\n\\n- Use `next/link` for navigation; ensure links are **links**, not buttons.\\n- `next/image` must include **alt** (empty if decorative).\\n- Announce route changes with a **global live region** and shift focus to the new view.\\n\\n**3.10 Accessibility library integration**\\n\\n- Import `@lssm/lib.accessibility` at app root. It auto-imports its `styles.css` via the package entry; ensure bundlers keep CSS side effects. If your app tree-shakes CSS, explicitly import the stylesheet once in your root layout:\\n\\n```tsx\\n// app/layout.tsx\\nimport '@lssm/lib.accessibility'; // includes tokens and provider exports\\n// or if needed: import '@lssm/lib.accessibility/src/styles.css';\\n```\\n\\n- Wrap the app with `AccessibilityProvider` and include an element with `id=\\\"main\\\"` for the skip link target.\\n\\n---\\n\\n## 3b) lssm/ui-kit-web — Component Patterns & Defaults\\n\\n> Source: `packages/lssm/libs/ui-kit-web/ui/*`\\n\\n- **Button/Input/Textarea**: Built‑in `focus-visible` rings; ensure visible labels via `FormLabel` or `aria-label`.\\n- **Form** (`form.tsx`): `FormControl` wires `aria-invalid` and `aria-describedby` to `FormMessage` and `FormDescription`. Prefer `FormMessage` for inline errors. Add `role=\\\"alert\\\"` only for critical.\\n- **Dialog/Sheet/Dropdown**: Use Radix wrappers for focus‑trap and return‑focus. Provide `DialogTitle` + `DialogDescription` for name/description.\\n- **Select/Combobox**: Prefer `SelectTrigger` with visible label; for icon‑only triggers, supply `aria-label`. Document examples in each app.\\n- **Tabs**: Use `TabsList`, `TabsTrigger`, `TabsContent`; names are programmatically determinable.\\n- **Toast/Toaster**: Prefer non‑blocking announcements; map critical to assertive region; include action buttons with clear labels.\\n- **Table**: Use `TableCaption`; ensure `TableHead` cells use proper `scope`. Provide `aria-sort` on sortable headers.\\n- **Utilities to add (repo action)**:\\n - `SkipLink` component and pattern in layouts.\\n - `RouteAnnouncer` (`aria-live=\\\"polite\\\"`) and **FocusOnRouteChange** helper.\\n - `VisuallyHidden` wrapper (Radix visually-hidden or minimal utility).\\n - `useReducedMotion` helper; honor in animated components.\\n - Touch‑size variants (≥44×44) for interactive atoms.\\n\\n---\\n\\n## 4) Engineering Requirements (Mobile — Expo/React\\xA0Native)\\n\\n- Set `accessibilityLabel`, `accessibilityHint`, and `accessibilityRole` on touchables.\\n- Ensure **hit slop** / min size **≥\\xA044×44\\xA0dp**.\\n- Support Dynamic Type / font scaling; no clipped text at **200%**.\\n- Respect **Invert Colors** and **Reduce Motion**; avoid flashing.\\n- Group related items with `accessibilityElements` ordering; hide decoration with `accessible={false}` or `importantForAccessibility=\\\"no-hide-descendants\\\"` when appropriate.\\n- Test with **VoiceOver (iOS)** and **TalkBack (Android)**.\\n\\n---\\n\\n## 5) Component Patterns (Acceptance Rules)\\n\\n**Buttons & Links**\\n\\n- Use `<button>` for actions, `<a href>` for navigation. Provide disabled states that are perceivable beyond color.\\n\\n**Navigation**\\n\\n- Provide **Skip link**. One primary nav landmark. Indicate current page (`aria-current=\\\"page\\\"`).\\n\\n**Menus/Combobox/Autocomplete**\\n\\n- Follow ARIA patterns: focus moves into list; `aria-expanded`, `aria-controls`, `aria-activedescendant` when applicable; Esc closes; typing filters.\\n\\n**Modals/Dialogs**\\n\\n- `role=\\\"dialog\\\"` or `alertdialog` with **label**; focus trapped; background inert; Esc closes; return focus to trigger.\\n\\n**Tabs**\\n\\n- `role=\\\"tablist\\\"`; tabs are in the tab order; arrow keys switch focus; content is `role=\\\"tabpanel\\\"` with `aria-labelledby`.\\n\\n**Toasts/Notifications**\\n\\n- Non-critical: `aria-live=\\\"polite\\\"`; critical: `role=\\\"alert\\\"` sparingly.\\n\\n**Infinite Scroll / “Load More”**\\n\\n- Provide **Load more** control; announce new content to SR; preserve keyboard position.\\n\\n**Drag & Drop (2.5.7)**\\n\\n- Provide **non‑drag** alternative (e.g., move up/down buttons).\\n\\n**Charts & Maps**\\n\\n- Provide **table alternative** or textual summary; keyboard access to datapoints where interactive.\\n\\n---\\n\\n## 6) Testing & CI (Blocking Gates)\\n\\n**Static & Unit**\\n\\n- `eslint-plugin-jsx-a11y` — error on violations.\\n- `jest-axe` — unit tests for components.\\n\\n**Automated Integration**\\n\\n- `axe-core` via Playwright or Cypress on critical flows.\\n- `pa11y-ci` on key routes; threshold: **0 Critical / 0 Serious** to merge.\\n- Lighthouse CI a11y score **≥\\xA095** on target pages.\\n\\n**Manual QA (per release)**\\n\\n- **Keyboard patrol:** navigate primary flows without mouse.\\n- **Screen reader smoke:** NVDA (Windows) or VoiceOver (macOS/iOS) across login, navigation, forms, dialogs.\\n- **Zoom & Reflow:** 200–400% & 320\\xA0px width.\\n- **Color/Contrast check:** tokens in both themes.\\n\\n**Reporting**\\n\\n- A11y issues labeled: `a11y-blocker`, `a11y-bug`, `a11y-enhancement` with WCAG ref.\\n\\n---\\n\\n## 7) Repository‑Specific Adoption Plan\\n\\n- Centralize UI usage on `packages/lssm/libs/ui-kit-web` and de‑duplicate per‑app `components/ui` where feasible.\\n- Introduce `SkipLink`, `RouteAnnouncer`, `FocusOnRouteChange`, and `VisuallyHidden` in `ui-kit-web`. Adopt in app layouts (`app/layout.tsx`) first.\\n- Add `useReducedMotion` and wire into animated components (e.g., `drawer`, `tooltip`, `carousel`).\\n- Add touch‑size variants to `Button`, `IconButton`, `TabsTrigger`, toggles.\\n- Document Select label patterns and error association in Forms.\\n\\n---\\n\\n## 8) Code Snippets\\n\\n**Skip Link**\\n\\n```html\\n<a\\n class=\\\"sr-only focus:not-sr-only focus-visible:outline focus-visible:ring-4 focus-visible:ring-offset-2\\\"\\n href=\\\"#main\\\"\\n >Skip to main content</a\\n>\\n<main id=\\\"main\\\">…</main>\\n```\\n\\n**Dialog (Radix + shadcn/ui) — essentials**\\n\\n```tsx\\n// Ensure label, description, focus trap, and return focus on close remain intact\\n<Dialog>\\n <DialogTrigger asChild>\\n <button aria-haspopup=\\\"dialog\\\">Open settings</button>\\n </DialogTrigger>\\n <DialogContent aria-describedby=\\\"settings-desc\\\">\\n <DialogTitle>Settings</DialogTitle>\\n <p id=\\\"settings-desc\\\">Update your preferences.</p>\\n <DialogClose asChild>\\n <button>Close</button>\\n </DialogClose>\\n </DialogContent>\\n</Dialog>\\n```\\n\\n**Form error association**\\n\\n```tsx\\n<label htmlFor=\\\"email\\\">Email</label>\\n<input id=\\\"email\\\" name=\\\"email\\\" type=\\\"email\\\" aria-describedby=\\\"email-err\\\" />\\n<p id=\\\"email-err\\\" role=\\\"alert\\\">Enter a valid email.</p>\\n```\\n\\n**Route change announcement (Next.js)**\\n\\n```tsx\\n// Add once at app root\\n<div\\n aria-live=\\\"polite\\\"\\n aria-atomic=\\\"true\\\"\\n id=\\\"route-announcer\\\"\\n className=\\\"sr-only\\\"\\n/>\\n```\\n\\n---\\n\\n## 9) Exceptions & Waivers\\n\\n- If a criterion cannot be met, file an issue with: context, attempted alternatives, WCAG reference, impact assessment, and a remediation date. **Temporary waivers only.**\\n\\n---\\n\\n## 10) Ownership\\n\\n- **Design:** maintains token contrast, component specs.\\n- **Engineering:** enforces CI gates, implements patterns.\\n- **QA:** runs manual checks per release.\\n- **PM:** blocks release if AA not met on user‑visible flows.\\n\\n---\\n\\n## 11) References (internalize; no external dependency at runtime)\\n\\n- WCAG\\xA02.2 (AA), EN\\xA0301\\xA0549. ARIA Authoring Practices. Platform HIG (Apple, Material).\\n- `packages/lssm/libs/ui-kit-web` as the canonical UI source for web.\\n\\n> **Bottom line:** Shipping means **accessible by default**. We don’t trade a11y for speed; we bake it into speed.\\n\\n---\\n\\n## 12) Adoption Status (2025-09-23)\\n\\n- web-artisan: AccessibilityProvider integrated; sr-only/forced-colors applied; 44x44 targets; forms announce errors; jest-axe and cypress-axe in place.\\n- web-strit: AccessibilityProvider integrated; forced-colors, sr-only; forms announce errors; 44x44 targets; contrast tokens and text-scale wired; jest-axe and cypress-axe in place.\\n- web-coliving: AccessibilityProvider integrated; forced-colors and focus visibility added; text-scale wired; landing pages converted to `Section`/stacks with text-lg defaults; CTA capture standardized; ESLint guard for text-xs in main content; jest-axe and cypress-axe in place. Next: audit icon-only controls and ensure 44x44 targets; add role=\\\"alert\\\" where critical.\\n\\n> CI gates: run eslint a11y, jest-axe on components, and cypress-axe on critical flows per app.\\n\\n---\\n\\n## 13) CI Hardening & Visual QA\\n\\n- Linting: Run eslint with jsx-a11y rules across all web apps; block on violations.\\n- Unit: Run jest-axe for ui-kit-web and app-level components.\\n- Integration: cypress-axe on key flows (auth, forms, dialogs, tables).\\n- Synthetic scans: pa11y-ci on critical pages (0 Critical/Serious policy).\\n- Performance/A11y audit: Lighthouse CI with a11y score >= 95 on target routes.\\n- Artifacts: Upload pa11y and Lighthouse reports per PR; annotate failures.\\n\\n### Recent additions (2025-09-26)\\n\\n- AutocompleteInput (groceries): Upgraded to ARIA combobox pattern with `aria-controls`, `aria-activedescendant`, `Escape`/`Tab` handling, and labelled listbox.\\n- Cypress a11y tests added for furniture and incidents modules on `/modules` and operators flows; checks run axe with critical/serious impacts.\\n\\n## 14) Accessibility Telemetry (PostHog)\\n\\n- Events (anonymized): a11y_pref_changed (text_scale, contrast_mode, reduce_motion), a11y_panel_opened.\\n- Properties: app, route, previous_value, new_value, timestamp.\\n- Dashboards: Adoption over time, per app/route; correlation with reduced bounce on forms.\\n- Privacy: No PII; aggregate only.\\n\"\n}];\nregisterDocBlocks(accessibility_wcag_compliance_specs_DocBlocks);\n\n//#endregion\n//# sourceMappingURL=accessibility_wcag_compliance_specs.docblock.js.map"],"mappings":";;;AAaA,kBAVsD,CAAC;CACtD,IAAI;CACJ,OAAO;CACP,SAAS;CACT,MAAM;CACN,YAAY;CACZ,OAAO;CACP,MAAM,CAAC,sCAAsC;CAC7C,MAAM;CACN,CAAC,CAC8D"}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import "./registry.js";
|
|
2
|
-
import "./
|
|
2
|
+
import "./tech-contracts.docs.js";
|
|
3
|
+
import "./meta.docs.js";
|
|
3
4
|
import "./accessibility_wcag_compliance_specs.docblock.js";
|
|
4
|
-
import "./tech/PHASE_1_QUICKSTART.docblock.js";
|
|
5
|
-
import "./tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js";
|
|
6
|
-
import "./tech/PHASE_3_AUTO_EVOLUTION.docblock.js";
|
|
7
|
-
import "./tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js";
|
|
8
|
-
import "./tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js";
|
|
9
5
|
import "./tech/lifecycle-stage-system.docblock.js";
|
|
10
6
|
import "./tech/presentation-runtime.docblock.js";
|
|
11
7
|
import "./tech/auth/better-auth-nextjs.docblock.js";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { registerDocBlocks } from "./registry.js";
|
|
2
|
+
|
|
3
|
+
//#region ../learning-journey-ui-shared/dist/libs/contracts/dist/docs/meta.docs.js
|
|
4
|
+
const metaDocs = [{
|
|
5
|
+
id: "docs.meta.docblocks-process",
|
|
6
|
+
title: "DocBlocks process",
|
|
7
|
+
summary: "How to author goal/how/usage DocBlocks close to code.",
|
|
8
|
+
kind: "reference",
|
|
9
|
+
visibility: "mixed",
|
|
10
|
+
route: "/docs/meta/docblocks-process",
|
|
11
|
+
tags: ["docs", "process"],
|
|
12
|
+
body: `## DocBlocks authoring rules
|
|
13
|
+
|
|
14
|
+
- Colocate docs beside implementation; avoid barrel /docs folders.
|
|
15
|
+
- Split intent:
|
|
16
|
+
- **goal**: why this exists (before implementation).
|
|
17
|
+
- **how**: operational/runbook steps.
|
|
18
|
+
- **usage**: quick checklist for consumers.
|
|
19
|
+
- Use \`visibility\`: public | internal | mixed.
|
|
20
|
+
- Prefer routes like \`/docs/<domain>/<topic>/<kind>\`; ids mirror that.
|
|
21
|
+
- Keep body Markdown LLM-friendly; avoid HTML.
|
|
22
|
+
- Add owners/tags/domain/stability when known.
|
|
23
|
+
- For presentations/markdown outputs, rely on TransformEngine via DocRegistry.
|
|
24
|
+
- No sourcePath; DocBlocks are canonical.`
|
|
25
|
+
}];
|
|
26
|
+
registerDocBlocks(metaDocs);
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
//# sourceMappingURL=meta.docs.js.map
|
package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/meta.docs.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.docs.js","names":[],"sources":["../../../../../../../../../learning-journey-ui-shared/dist/libs/contracts/dist/docs/meta.docs.js"],"sourcesContent":["import { registerDocBlocks } from \"./registry.js\";\n\n//#region ../../libs/contracts/dist/docs/meta.docs.js\nconst metaDocs = [{\n\tid: \"docs.meta.docblocks-process\",\n\ttitle: \"DocBlocks process\",\n\tsummary: \"How to author goal/how/usage DocBlocks close to code.\",\n\tkind: \"reference\",\n\tvisibility: \"mixed\",\n\troute: \"/docs/meta/docblocks-process\",\n\ttags: [\"docs\", \"process\"],\n\tbody: `## DocBlocks authoring rules\n\n- Colocate docs beside implementation; avoid barrel /docs folders.\n- Split intent:\n - **goal**: why this exists (before implementation).\n - **how**: operational/runbook steps.\n - **usage**: quick checklist for consumers.\n- Use \\`visibility\\`: public | internal | mixed.\n- Prefer routes like \\`/docs/<domain>/<topic>/<kind>\\`; ids mirror that.\n- Keep body Markdown LLM-friendly; avoid HTML.\n- Add owners/tags/domain/stability when known.\n- For presentations/markdown outputs, rely on TransformEngine via DocRegistry.\n- No sourcePath; DocBlocks are canonical.`\n}];\nregisterDocBlocks(metaDocs);\n\n//#endregion\nexport { metaDocs };\n//# sourceMappingURL=meta.docs.js.map"],"mappings":";;;AAGA,MAAM,WAAW,CAAC;CACjB,IAAI;CACJ,OAAO;CACP,SAAS;CACT,MAAM;CACN,YAAY;CACZ,OAAO;CACP,MAAM,CAAC,QAAQ,UAAU;CACzB,MAAM;;;;;;;;;;;;;CAaN,CAAC;AACF,kBAAkB,SAAS"}
|
package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/presentations.js
CHANGED
|
@@ -68,4 +68,5 @@ function docBlocksToPresentationRoutes(blocks, options) {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
//#endregion
|
|
71
|
-
export { docBlockToPresentationSpec, docBlocksToPresentationRoutes };
|
|
71
|
+
export { docBlockToPresentationSpec, docBlocksToPresentationRoutes };
|
|
72
|
+
//# sourceMappingURL=presentations.js.map
|
package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/presentations.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentations.js","names":[],"sources":["../../../../../../../../../learning-journey-ui-shared/dist/libs/contracts/dist/docs/presentations.js"],"sourcesContent":["//#region ../../libs/contracts/dist/docs/presentations.js\nconst DEFAULT_TARGETS = [\n\t\"markdown\",\n\t\"application/json\",\n\t\"application/xml\",\n\t\"react\"\n];\nfunction normalizeRoute(route) {\n\tif (!route.length) return \"/\";\n\tconst withLeading = route.startsWith(\"/\") ? route : `/${route}`;\n\treturn withLeading === \"/\" ? \"/\" : withLeading.replace(/\\/+$/, \"\");\n}\nfunction deriveRoute(block, routePrefix) {\n\tif (block.route) return normalizeRoute(block.route);\n\tconst prefix = routePrefix ?? \"/docs\";\n\tconst slug = block.id.replace(/^docs\\.?/, \"\").replace(/\\./g, \"/\").replace(/\\/+/g, \"/\");\n\treturn normalizeRoute(slug.startsWith(\"/\") ? slug : `${prefix}/${slug}`);\n}\nfunction buildName(block, namespace) {\n\treturn namespace ? `${namespace}.${block.id}` : block.id;\n}\nfunction docBlockToPresentationV2(block, options) {\n\tconst targets = options?.defaultTargets ?? DEFAULT_TARGETS;\n\tconst version = block.version ?? options?.defaultVersion ?? 1;\n\tconst stability = block.stability ?? options?.defaultStability ?? \"stable\";\n\treturn {\n\t\tmeta: {\n\t\t\tname: buildName(block, options?.namespace),\n\t\t\tversion,\n\t\t\tdescription: block.summary ?? block.title,\n\t\t\ttags: block.tags,\n\t\t\towners: block.owners,\n\t\t\tdomain: block.domain,\n\t\t\tstability\n\t\t},\n\t\tpolicy: block.visibility && block.visibility !== \"public\" ? { flags: [block.visibility] } : void 0,\n\t\tsource: {\n\t\t\ttype: \"blocknotejs\",\n\t\t\tdocJson: block.body\n\t\t},\n\t\ttargets\n\t};\n}\nfunction docBlockToPresentationSpec(block, options) {\n\tconst version = block.version ?? options?.defaultVersion ?? 1;\n\tconst stability = block.stability ?? options?.defaultStability ?? \"stable\";\n\treturn {\n\t\tmeta: {\n\t\t\tname: buildName(block, options?.namespace),\n\t\t\tversion,\n\t\t\tstability,\n\t\t\ttags: block.tags,\n\t\t\towners: block.owners,\n\t\t\tdescription: block.summary ?? block.title\n\t\t},\n\t\tcontent: {\n\t\t\tkind: \"markdown\",\n\t\t\tcontent: block.body\n\t\t}\n\t};\n}\nfunction docBlocksToPresentationRoutes(blocks, options) {\n\treturn blocks.map((block) => ({\n\t\tblock,\n\t\troute: deriveRoute(block, options?.routePrefix),\n\t\tdescriptor: docBlockToPresentationV2(block, options)\n\t}));\n}\n\n//#endregion\nexport { docBlockToPresentationSpec, docBlockToPresentationV2, docBlocksToPresentationRoutes };\n//# sourceMappingURL=presentations.js.map"],"mappings":";AACA,MAAM,kBAAkB;CACvB;CACA;CACA;CACA;CACA;AACD,SAAS,eAAe,OAAO;AAC9B,KAAI,CAAC,MAAM,OAAQ,QAAO;CAC1B,MAAM,cAAc,MAAM,WAAW,IAAI,GAAG,QAAQ,IAAI;AACxD,QAAO,gBAAgB,MAAM,MAAM,YAAY,QAAQ,QAAQ,GAAG;;AAEnE,SAAS,YAAY,OAAO,aAAa;AACxC,KAAI,MAAM,MAAO,QAAO,eAAe,MAAM,MAAM;CACnD,MAAM,SAAS,eAAe;CAC9B,MAAM,OAAO,MAAM,GAAG,QAAQ,YAAY,GAAG,CAAC,QAAQ,OAAO,IAAI,CAAC,QAAQ,QAAQ,IAAI;AACtF,QAAO,eAAe,KAAK,WAAW,IAAI,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO;;AAEzE,SAAS,UAAU,OAAO,WAAW;AACpC,QAAO,YAAY,GAAG,UAAU,GAAG,MAAM,OAAO,MAAM;;AAEvD,SAAS,yBAAyB,OAAO,SAAS;CACjD,MAAM,UAAU,SAAS,kBAAkB;CAC3C,MAAM,UAAU,MAAM,WAAW,SAAS,kBAAkB;CAC5D,MAAM,YAAY,MAAM,aAAa,SAAS,oBAAoB;AAClE,QAAO;EACN,MAAM;GACL,MAAM,UAAU,OAAO,SAAS,UAAU;GAC1C;GACA,aAAa,MAAM,WAAW,MAAM;GACpC,MAAM,MAAM;GACZ,QAAQ,MAAM;GACd,QAAQ,MAAM;GACd;GACA;EACD,QAAQ,MAAM,cAAc,MAAM,eAAe,WAAW,EAAE,OAAO,CAAC,MAAM,WAAW,EAAE,GAAG,KAAK;EACjG,QAAQ;GACP,MAAM;GACN,SAAS,MAAM;GACf;EACD;EACA;;AAEF,SAAS,2BAA2B,OAAO,SAAS;CACnD,MAAM,UAAU,MAAM,WAAW,SAAS,kBAAkB;CAC5D,MAAM,YAAY,MAAM,aAAa,SAAS,oBAAoB;AAClE,QAAO;EACN,MAAM;GACL,MAAM,UAAU,OAAO,SAAS,UAAU;GAC1C;GACA;GACA,MAAM,MAAM;GACZ,QAAQ,MAAM;GACd,aAAa,MAAM,WAAW,MAAM;GACpC;EACD,SAAS;GACR,MAAM;GACN,SAAS,MAAM;GACf;EACD;;AAEF,SAAS,8BAA8B,QAAQ,SAAS;AACvD,QAAO,OAAO,KAAK,WAAW;EAC7B;EACA,OAAO,YAAY,OAAO,SAAS,YAAY;EAC/C,YAAY,yBAAyB,OAAO,QAAQ;EACpD,EAAE"}
|
package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/registry.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","names":[],"sources":["../../../../../../../../../learning-journey-ui-shared/dist/libs/contracts/dist/docs/registry.js"],"sourcesContent":["import { docBlockToPresentationSpec, docBlocksToPresentationRoutes } from \"./presentations.js\";\n\n//#region ../../libs/contracts/dist/docs/registry.js\nvar DocRegistry = class {\n\troutes = /* @__PURE__ */ new Map();\n\tconstructor(blocks = [], options) {\n\t\tblocks.forEach((block) => this.register(block, options));\n\t}\n\tregister(block, options) {\n\t\tconst [route] = docBlocksToPresentationRoutes([block], options);\n\t\tif (route) this.routes.set(block.id, route);\n\t\treturn this;\n\t}\n\tlist() {\n\t\treturn [...this.routes.values()];\n\t}\n\tget(id) {\n\t\treturn this.routes.get(id);\n\t}\n\ttoRouteTuples() {\n\t\treturn this.list().map(({ route, descriptor }) => [route, descriptor]);\n\t}\n\ttoPresentationSpecs(options) {\n\t\treturn this.list().map(({ block }) => docBlockToPresentationSpec(block, options));\n\t}\n};\nconst requiredFields = [\n\t\"id\",\n\t\"title\",\n\t\"body\",\n\t\"kind\",\n\t\"visibility\",\n\t\"route\"\n];\nconst defaultDocRegistry = new DocRegistry();\nfunction registerDocBlocks(blocks) {\n\tfor (const block of blocks) {\n\t\tfor (const field of requiredFields) if (!block[field]) throw new Error(`DocBlock ${block.id ?? \"<missing id>\"} missing field ${String(field)}`);\n\t\tdefaultDocRegistry.register(block);\n\t}\n}\n\n//#endregion\nexport { DocRegistry, defaultDocRegistry, registerDocBlocks };\n//# sourceMappingURL=registry.js.map"],"mappings":";;;AAGA,IAAI,cAAc,MAAM;CACvB,yBAAyB,IAAI,KAAK;CAClC,YAAY,SAAS,EAAE,EAAE,SAAS;AACjC,SAAO,SAAS,UAAU,KAAK,SAAS,OAAO,QAAQ,CAAC;;CAEzD,SAAS,OAAO,SAAS;EACxB,MAAM,CAAC,SAAS,8BAA8B,CAAC,MAAM,EAAE,QAAQ;AAC/D,MAAI,MAAO,MAAK,OAAO,IAAI,MAAM,IAAI,MAAM;AAC3C,SAAO;;CAER,OAAO;AACN,SAAO,CAAC,GAAG,KAAK,OAAO,QAAQ,CAAC;;CAEjC,IAAI,IAAI;AACP,SAAO,KAAK,OAAO,IAAI,GAAG;;CAE3B,gBAAgB;AACf,SAAO,KAAK,MAAM,CAAC,KAAK,EAAE,OAAO,iBAAiB,CAAC,OAAO,WAAW,CAAC;;CAEvE,oBAAoB,SAAS;AAC5B,SAAO,KAAK,MAAM,CAAC,KAAK,EAAE,YAAY,2BAA2B,OAAO,QAAQ,CAAC;;;AAGnF,MAAM,iBAAiB;CACtB;CACA;CACA;CACA;CACA;CACA;CACA;AACD,MAAM,qBAAqB,IAAI,aAAa;AAC5C,SAAS,kBAAkB,QAAQ;AAClC,MAAK,MAAM,SAAS,QAAQ;AAC3B,OAAK,MAAM,SAAS,eAAgB,KAAI,CAAC,MAAM,OAAQ,OAAM,IAAI,MAAM,YAAY,MAAM,MAAM,eAAe,iBAAiB,OAAO,MAAM,GAAG;AAC/I,qBAAmB,SAAS,MAAM"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"better-auth-nextjs.docblock.js","names":[],"sources":["../../../../../../../../../../../learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js"],"sourcesContent":["import { registerDocBlocks } from \"../../registry.js\";\n\n//#region ../../libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js\nconst tech_auth_better_auth_nextjs_DocBlocks = [{\n\tid: \"docs.tech.auth.better-auth-nextjs\",\n\ttitle: \"Better Auth + Next.js integration (ContractSpec)\",\n\tsummary: \"How ContractSpec wires Better Auth into Next.js (server config, client singleton, and proxy cookie-only redirects).\",\n\tkind: \"reference\",\n\tvisibility: \"public\",\n\troute: \"/docs/tech/auth/better-auth-nextjs\",\n\ttags: [\n\t\t\"auth\",\n\t\t\"better-auth\",\n\t\t\"nextjs\",\n\t\t\"cookies\",\n\t\t\"proxy\",\n\t\t\"hmr\"\n\t],\n\tbody: `# Better Auth + Next.js integration (ContractSpec)\n\nThis repo uses Better Auth as the primary auth layer (sessions, organizations, teams, API keys, and OAuth).\n\n## Server config (Better Auth)\n\n- Source: \\`packages/bundles/contractspec-studio/src/application/services/auth.ts\\`\n- Important: \\`nextCookies()\\` must be the **last** plugin in the Better Auth plugin list so \\`Set-Cookie\\` is applied correctly in Next.js environments.\n\n## Better Auth Admin plugin\n\nContractSpec Studio enables the Better Auth **Admin plugin** to support platform-admin user operations (list users, impersonation, etc.).\n\n- Server: \\`admin()\\` plugin in \\`packages/bundles/contractspec-studio/src/application/services/auth.ts\\`\n- Client: \\`adminClient()\\` in \\`packages/bundles/contractspec-studio/src/presentation/providers/auth/client.ts\\`\n\n### PLATFORM_ADMIN ⇒ Better Auth admin role\n\nBetter Auth Admin endpoints authorize via \\`user.role\\`. ContractSpec enforces an org-driven rule:\n\n- If the **active organization** has \\`type = PLATFORM_ADMIN\\`, the signed-in user is ensured to have \\`User.role\\` containing \\`admin\\`.\n- This is applied in the session creation hook and re-checked in \\`assertsPlatformAdmin()\\`.\n\nThis keeps admin enablement deterministic and avoids manual role backfills.\n\n## Client config (React web + Expo)\n\nTo avoid duplicate background refresh/polling loops in dev (Fast Refresh/HMR), the Better Auth client is implemented as a singleton cached on \\`globalThis\\`.\n\n- Web client: \\`packages/bundles/contractspec-studio/src/presentation/providers/auth/client.ts\\`\n- Native client: \\`packages/bundles/contractspec-studio/src/presentation/providers/auth/client.native.ts\\`\n\nImport guidance:\n\n- If you only need the context/hook, prefer importing from \\`@lssm/bundle.contractspec-studio/presentation/providers/auth\\`.\n- If you explicitly need the Better Auth client instance (e.g. admin impersonation, direct API calls), import from \\`@lssm/bundle.contractspec-studio/presentation/providers/auth/client\\`.\n\n## Public routes (login / signup)\n\nPublic auth pages should avoid eager \\`authClient\\` initialization.\n\nPattern used:\n\n- In the submit handler, dynamically import \\`@lssm/bundle.contractspec-studio/presentation/providers/auth/index.web\\` and call \\`authClient.signIn.*\\` / \\`authClient.signUp.*\\`.\n\nThis prevents session refresh behavior from starting just because a public page rendered.\n\n## Next.js proxy auth (web-landing)\n\nThe Next.js proxy/middleware is used for **redirect decisions only**. It must not perform DB-backed session reads on every request.\n\n- Source: \\`packages/apps/web-landing/src/proxy.ts\\`\n- Approach: cookie-only checks via Better Auth cookies helpers:\n - \\`getSessionCookie(request)\\`\n - \\`getCookieCache(request)\\`\n\nThese checks are intentionally optimistic and should only gate routing. Full authorization must still be enforced on server-side actions/routes and GraphQL resolvers.\n`\n}];\nregisterDocBlocks(tech_auth_better_auth_nextjs_DocBlocks);\n\n//#endregion\n//# sourceMappingURL=better-auth-nextjs.docblock.js.map"],"mappings":";;;AA6EA,kBA1E+C,CAAC;CAC/C,IAAI;CACJ,OAAO;CACP,SAAS;CACT,MAAM;CACN,YAAY;CACZ,OAAO;CACP,MAAM;EACL;EACA;EACA;EACA;EACA;EACA;EACA;CACD,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DN,CAAC,CACuD"}
|