@lssm/example.learning-journey-registry 0.0.0-canary-20251212004227

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/.turbo/turbo-build.log +35 -0
  2. package/CHANGELOG.md +13 -0
  3. package/README.md +22 -0
  4. package/dist/api-types.js +0 -0
  5. package/dist/api.js +1 -0
  6. package/dist/docs/index.js +1 -0
  7. package/dist/docs/learning-journey-registry.docblock.js +1 -0
  8. package/dist/index.js +1 -0
  9. package/dist/libs/contracts/src/docs/PUBLISHING.docblock.js +76 -0
  10. package/dist/libs/contracts/src/docs/accessibility_wcag_compliance_specs.docblock.js +350 -0
  11. package/dist/libs/contracts/src/docs/index.js +1 -0
  12. package/dist/libs/contracts/src/docs/presentations.js +1 -0
  13. package/dist/libs/contracts/src/docs/registry.js +1 -0
  14. package/dist/libs/contracts/src/docs/tech/PHASE_1_QUICKSTART.docblock.js +383 -0
  15. package/dist/libs/contracts/src/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +68 -0
  16. package/dist/libs/contracts/src/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +140 -0
  17. package/dist/libs/contracts/src/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +86 -0
  18. package/dist/libs/contracts/src/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +1 -0
  19. package/dist/libs/contracts/src/docs/tech/lifecycle-stage-system.docblock.js +213 -0
  20. package/dist/libs/contracts/src/docs/tech/mcp-endpoints.docblock.js +1 -0
  21. package/dist/libs/contracts/src/docs/tech/presentation-runtime.docblock.js +1 -0
  22. package/dist/libs/contracts/src/docs/tech/schema/README.docblock.js +262 -0
  23. package/dist/libs/contracts/src/docs/tech/templates/runtime.docblock.js +1 -0
  24. package/dist/libs/contracts/src/docs/tech/workflows/overview.docblock.js +1 -0
  25. package/dist/presentations/index.js +1 -0
  26. package/dist/progress-store.js +1 -0
  27. package/dist/tracks.js +1 -0
  28. package/package.json +59 -0
  29. package/src/api-types.ts +43 -0
  30. package/src/api.test.ts +46 -0
  31. package/src/api.ts +301 -0
  32. package/src/docs/index.ts +1 -0
  33. package/src/docs/learning-journey-registry.docblock.ts +36 -0
  34. package/src/index.ts +5 -0
  35. package/src/presentations/index.ts +61 -0
  36. package/src/progress-store.ts +39 -0
  37. package/src/tracks.ts +91 -0
  38. package/tsconfig.json +9 -0
  39. package/tsconfig.tsbuildinfo +1 -0
  40. package/tsdown.config.js +7 -0
@@ -0,0 +1,35 @@
1
+ $ bun build:bundle && bun build:types
2
+ $ tsdown
3
+ ℹ tsdown v0.17.0 powered by rolldown v1.0.0-beta.53
4
+ ℹ config file: /home/runner/work/contractspec/contractspec/packages/examples/learning-journey-registry/tsdown.config.js
5
+ ℹ entry: src/api-types.ts, src/api.ts, src/index.ts, src/progress-store.ts, src/tracks.ts, src/docs/index.ts, src/docs/learning-journey-registry.docblock.ts, src/presentations/index.ts
6
+ ℹ target: esnext
7
+ ℹ tsconfig: tsconfig.json
8
+ ℹ Build start
9
+ ℹ dist/api.js  3.28 kB │ gzip: 1.37 kB
10
+ ℹ dist/tracks.js  1.30 kB │ gzip: 0.50 kB
11
+ ℹ dist/docs/learning-journey-registry.docblock.js  1.21 kB │ gzip: 0.63 kB
12
+ ℹ dist/presentations/index.js  0.99 kB │ gzip: 0.39 kB
13
+ ℹ dist/index.js  0.85 kB │ gzip: 0.31 kB
14
+ ℹ dist/progress-store.js  0.43 kB │ gzip: 0.29 kB
15
+ ℹ dist/docs/index.js  0.05 kB │ gzip: 0.07 kB
16
+ ℹ dist/api-types.js  0.00 kB │ gzip: 0.02 kB
17
+ ℹ dist/libs/contracts/src/docs/accessibility_wcag_compliance_specs.docblock.js 16.53 kB │ gzip: 7.16 kB
18
+ ℹ dist/libs/contracts/src/docs/tech/schema/README.docblock.js 10.99 kB │ gzip: 4.29 kB
19
+ ℹ dist/libs/contracts/src/docs/tech/lifecycle-stage-system.docblock.js  9.67 kB │ gzip: 3.78 kB
20
+ ℹ dist/libs/contracts/src/docs/tech/PHASE_1_QUICKSTART.docblock.js  8.76 kB │ gzip: 2.68 kB
21
+ ℹ dist/libs/contracts/src/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js  5.93 kB │ gzip: 2.61 kB
22
+ ℹ dist/libs/contracts/src/docs/tech/templates/runtime.docblock.js  5.63 kB │ gzip: 2.58 kB
23
+ ℹ dist/libs/contracts/src/docs/tech/workflows/overview.docblock.js  5.44 kB │ gzip: 2.26 kB
24
+ ℹ dist/libs/contracts/src/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js  4.37 kB │ gzip: 2.06 kB
25
+ ℹ dist/libs/contracts/src/docs/PUBLISHING.docblock.js  3.43 kB │ gzip: 1.59 kB
26
+ ℹ dist/libs/contracts/src/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js  3.00 kB │ gzip: 1.53 kB
27
+ ℹ dist/libs/contracts/src/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js  2.83 kB │ gzip: 1.41 kB
28
+ ℹ dist/libs/contracts/src/docs/tech/presentation-runtime.docblock.js  2.75 kB │ gzip: 1.30 kB
29
+ ℹ dist/libs/contracts/src/docs/presentations.js  1.23 kB │ gzip: 0.59 kB
30
+ ℹ dist/libs/contracts/src/docs/tech/mcp-endpoints.docblock.js  1.07 kB │ gzip: 0.61 kB
31
+ ℹ dist/libs/contracts/src/docs/index.js  0.85 kB │ gzip: 0.35 kB
32
+ ℹ dist/libs/contracts/src/docs/registry.js  0.74 kB │ gzip: 0.42 kB
33
+ ℹ 24 files, total: 91.33 kB
34
+ ✔ Build complete in 43ms
35
+ $ tsc --noEmit
package/CHANGELOG.md ADDED
@@ -0,0 +1,13 @@
1
+ # @lssm/example.learning-journey-registry
2
+
3
+ ## 0.0.0-canary-20251212004227
4
+
5
+ ### Patch Changes
6
+
7
+ - @lssm/example.learning-journey.crm-onboarding@0.0.0-canary-20251212004227
8
+ - @lssm/example.learning-journey.ambient-coach@0.0.0-canary-20251212004227
9
+ - @lssm/example.learning-journey.duo-drills@0.0.0-canary-20251212004227
10
+ - @lssm/example.learning-journey.platform-tour@0.0.0-canary-20251212004227
11
+ - @lssm/example.learning-journey.quest-challenges@0.0.0-canary-20251212004227
12
+ - @lssm/example.learning-journey.studio-onboarding@0.0.0-canary-20251212004227
13
+ - @lssm/module.learning-journey@0.0.0-canary-20251212004227
package/README.md ADDED
@@ -0,0 +1,22 @@
1
+ # @lssm/example.learning-journey-registry
2
+
3
+ Aggregated registry for learning journey example tracks.
4
+
5
+ ## Contents
6
+
7
+ - `learningJourneyTracks`: all track specs
8
+ - `onboardingTrackCatalog`: DTOs aligned with onboarding API outputs
9
+ - `mapTrackSpecToDto`: helper for adapters
10
+ - Re-exports per-track arrays: Studio onboarding, Platform tour, CRM first win
11
+
12
+ ## Usage
13
+
14
+ ```ts
15
+ import { onboardingTrackCatalog } from '@lssm/example.learning-journey-registry';
16
+ // Feed into API/service that implements learning.onboarding.listTracks
17
+ ```
18
+
19
+ ## Docs
20
+
21
+ - Docblock: `src/docs/learning-journey-registry.docblock.ts`
22
+ - Route suggestion: `/docs/learning-journey/registry`
File without changes
package/dist/api.js ADDED
@@ -0,0 +1 @@
1
+ import{learningJourneyTracks as e}from"./tracks.js";import{getLearnerTracks as t,getTrackResolver as n,initProgress as r}from"./progress-store.js";const i=n(e),a=(e,t)=>e?t?Object.entries(e).every(([e,n])=>t[e]===n):!1:!0,o=(e,t)=>e.eventName!==t.name||e.eventVersion!==void 0&&t.version!==void 0&&e.eventVersion!==t.version||e.sourceModule&&t.sourceModule&&e.sourceModule!==t.sourceModule?!1:a(e.payloadFilter,t.payload),s=(e,t,n,r)=>{if(e.kind===`count`){if(!o(e,t))return{matched:!1};let i=(n.occurrences??0)+1;return{matched:(e.withinHours===void 0||!!(r&&t.occurredAt&&(t.occurredAt.getTime()-r.getTime())/(1e3*60*60)<=e.withinHours))&&i>=e.atLeast,occurrences:i}}if(e.kind===`time_window`)return!o(e,t)||e.withinHoursOfStart!==void 0&&r&&t.occurredAt&&(t.occurredAt.getTime()-r.getTime())/(1e3*60*60)>e.withinHoursOfStart?{matched:!1}:{matched:!0};if(e.kind===`srs_mastery`){if(t.name!==e.eventName)return{matched:!1};let r=t.payload;if(!a(e.payloadFilter,r))return{matched:!1};let i=e.skillIdField??`skillId`,o=e.masteryField??`mastery`,s=r?.[i],c=r?.[o];if(s===void 0||c===void 0||typeof c!=`number`||c<e.minimumMastery)return{matched:!1};let l=(n.masteryCount??0)+1;return{matched:l>=(e.requiredCount??1),masteryCount:l}}return{matched:o(e,t)}},c=(e,t)=>{if(!e||!t)return{};let n=t.getTime(),r=n;e.unlockOnDay!==void 0&&(r=n+(e.unlockOnDay-1)*24*60*60*1e3),e.unlockAfterHours!==void 0&&(r=n+e.unlockAfterHours*60*60*1e3);let i=new Date(r);return{availableAt:i,dueAt:e.dueWithinHours===void 0?void 0:new Date(i.getTime()+e.dueWithinHours*60*60*1e3)}},l=e=>{let t=e.length||1,n=e.filter(e=>e.status===`COMPLETED`).length;return Math.round(n/t*100)},u=(e,t)=>{if(t.isCompleted)return t;let n=new Date,r=t.startedAt??n,i=(n.getTime()-r.getTime())/(1e3*60*60),a=t.xpEarned,{completionRewards:o,streakRule:s}=e;return o?.xpBonus&&(a+=o.xpBonus),s?.hoursWindow!==void 0&&i<=s.hoursWindow&&s.bonusXp&&(a+=s.bonusXp),{...t,xpEarned:a,isCompleted:!0,completedAt:n,lastActivityAt:n}},d=n=>{let r=n?t(n):void 0;return{tracks:e,progress:n&&r?Array.from(r.values()):[]}},f=(e,n)=>{let a=i(e);if(!a)return;let o=t(n),s=o.get(e)??r(n,a);return o.set(e,s),s},p=n=>{let i=n.trackId===void 0?e:e.filter(e=>e.id===n.trackId),a=[],o=n.occurredAt??new Date;for(let e of i){let i=t(n.learnerId),d=i.get(e.id)??r(n.learnerId,e),f=d.startedAt??o,p=d.startedAt===void 0,m=d.steps.map(t=>{if(t.status===`COMPLETED`)return t;let r=e.steps.find(e=>e.id===t.id);if(!r)return t;let{availableAt:i,dueAt:a}=c(r.availability,f);if(i&&o<i||a&&o>a)return{...t,availableAt:i,dueAt:a};let l=s(r.completion,n,t,f);return l.matched?(p=!0,{...t,status:`COMPLETED`,xpEarned:r.xpReward??0,completedAt:o,triggeringEvent:n.name,eventPayload:n.payload,occurrences:l.occurrences??t.occurrences,masteryCount:l.masteryCount??t.masteryCount,availableAt:i,dueAt:a}):((l.occurrences!==void 0||l.masteryCount!==void 0)&&(p=!0),{...t,occurrences:l.occurrences??t.occurrences,masteryCount:l.masteryCount??t.masteryCount,availableAt:i,dueAt:a})});if(!p)continue;let h=m.reduce((e,t)=>e+t.xpEarned,0)+(e.totalXp??0),g={...d,steps:m,xpEarned:h,startedAt:f,lastActivityAt:o,progress:l(m)};m.every(e=>e.status===`COMPLETED`)&&(g=u(e,g)),i.set(e.id,g),a.push(g)}return a};export{f as getProgress,d as listTracks,p as recordEvent};
@@ -0,0 +1 @@
1
+ import"./learning-journey-registry.docblock.js";
@@ -0,0 +1 @@
1
+ import{registerDocBlocks as e}from"../libs/contracts/src/docs/registry.js";import"../libs/contracts/src/docs/index.js";e([{id:`docs.learning-journey.registry`,title:`Learning Journey — Example Track Registry`,summary:`Aggregates learning journey example tracks (Studio onboarding, Platform tour, CRM first win, Drills, Ambient Coach, Quest challenges).`,kind:`usage`,visibility:`public`,route:`/docs/learning-journey/registry`,tags:[`learning`,`registry`,`onboarding`],body:"## Tracks\n- `studio_getting_started` (Studio onboarding)\n- `platform_primitives_tour` (Platform primitives)\n- `crm_first_win` (CRM pipeline onboarding)\n- `drills_language_basics` (Drills & SRS)\n- `money_ambient_coach`, `coliving_ambient_coach` (Ambient tips)\n- `money_reset_7day` (Quest/challenge)\n\n## Exports\n- `learningJourneyTracks` — raw specs\n- `onboardingTrackCatalog` — DTOs aligned with onboarding API\n- `mapTrackSpecToDto` — helper to map individual tracks\n\n## Wiring\n- Use with onboarding API contracts:\n - `learning.onboarding.listTracks`\n - `learning.onboarding.getProgress`\n - `learning.onboarding.recordEvent`\n- Intended for registry/adapters in Studio UI or services that surface tracks."}]);
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ import{crmLearningTracks as e,learningJourneyTracks as t,mapStep as n,mapTrackSpecToDto as r,onboardingTrackCatalog as i,platformLearningTracks as a,studioLearningTracks as o}from"./tracks.js";import{getProgress as s,listTracks as c,recordEvent as l}from"./api.js";import"./docs/index.js";import{LearningTrackDetailPresentation as u,LearningTrackListPresentation as d,LearningTrackProgressWidgetPresentation as f,learningJourneyPresentations as p}from"./presentations/index.js";export{u as LearningTrackDetailPresentation,d as LearningTrackListPresentation,f as LearningTrackProgressWidgetPresentation,e as crmLearningTracks,s as getProgress,p as learningJourneyPresentations,t as learningJourneyTracks,c as listTracks,n as mapStep,r as mapTrackSpecToDto,i as onboardingTrackCatalog,a as platformLearningTracks,l as recordEvent,o as studioLearningTracks};
@@ -0,0 +1,76 @@
1
+ import{registerDocBlocks as e}from"./registry.js";e([{id:`docs.PUBLISHING`,title:`Publishing ContractSpec Libraries`,summary:`This guide describes how we release the ContractSpec libraries to npm. We use a dual-track release system: **Stable** (manual) and **Canary** (automatic).`,kind:`reference`,visibility:`public`,route:`/docs/PUBLISHING`,tags:[`PUBLISHING`],body:`# Publishing ContractSpec Libraries
2
+
3
+ This guide describes how we release the ContractSpec libraries to npm. We use a dual-track release system: **Stable** (manual) and **Canary** (automatic).
4
+
5
+ ## Release Tracks
6
+
7
+ | Track | Branch | npm Tag | Frequency | Versioning | Use Case |
8
+ |-------|--------|---------|-----------|------------|----------|
9
+ | **Stable** | \`release\` | \`latest\` | Manual | SemVer (e.g., \`1.7.4\`) | Production, external users |
10
+ | **Canary** | \`main\` | \`canary\` | Every Push | Snapshot (e.g., \`1.7.4-canary...\`) | Dev, internal testing |
11
+
12
+ ## Prerequisites
13
+
14
+ - ✅ \`NPM_TOKEN\` secret is configured in GitHub (owner or automation token with _publish_ scope).
15
+ - ✅ \`GITHUB_TOKEN\` (built-in) has permissions to create PRs (enabled by default in new repos).
16
+ - ✅ For stable releases: \`release\` branch exists and is protected.
17
+
18
+ ## Canary Workflow (Automatic)
19
+
20
+ Every commit pushed to \`main\` triggers the \`.github/workflows/publish-canary.yml\` workflow.
21
+
22
+ 1. **Trigger**: Push to \`main\`.
23
+ 2. **Versioning**: Runs \`changeset version --snapshot canary\` to generate a temporary snapshot version.
24
+ 3. **Publish**: Packages are published to npm with the \`canary\` tag using \`changeset publish --tag canary\`.
25
+
26
+ ### Consuming Canary Builds
27
+
28
+ To install the latest bleeding-edge version:
29
+
30
+ \`\`\`bash
31
+ npm install @lssm/lib.contracts@canary
32
+ # or
33
+ bun add @lssm/lib.contracts@canary
34
+ \`\`\`
35
+
36
+ ## Stable Release Workflow (Manual)
37
+
38
+ Stable releases are managed via the \`release\` branch using the standard [Changesets Action](https://github.com/changesets/action).
39
+
40
+ 1. **Develop on \`main\`**: Create features and fixes.
41
+ 2. **Add Changesets**: Run \`bun changeset\` to document changes and impact (major/minor/patch).
42
+ 3. **Merge to \`release\`**: When ready to ship, open a PR from \`main\` to \`release\` or merge manually.
43
+ 4. **"Version Packages" PR**:
44
+ - The GitHub Action detects new changesets and automatically creates a Pull Request titled **"Version Packages"**.
45
+ - This PR contains the version bumps and updated \`CHANGELOG.md\` files.
46
+ 5. **Merge & Publish**:
47
+ - Review and merge the "Version Packages" PR.
48
+ - The Action runs again, detects the versions have been bumped, builds the libraries, and publishes them to npm with the \`latest\` tag.
49
+
50
+ ### Publishing Steps
51
+
52
+ 1. Ensure all changesets are present on \`main\`.
53
+ 2. Merge \`main\` into \`release\`:
54
+ \`\`\`bash
55
+ git checkout release
56
+ git pull origin release
57
+ git merge main
58
+ git push origin release
59
+ \`\`\`
60
+ 3. Go to GitHub Pull Requests. You will see a **"Version Packages"** PR created by the bot.
61
+ 4. Merge that PR.
62
+ 5. The release is now live on npm!
63
+
64
+ ## Manual Verification (Optional)
65
+
66
+ Before publishing a new version you can run:
67
+
68
+ \`\`\`bash
69
+ bun run build:not-apps
70
+ npx npm-packlist --json packages/libs/contracts
71
+ \`\`\`
72
+
73
+ ## Rollback
74
+
75
+ If a publish fails mid-way, re-run the workflow once the issue is fixed. Already published packages are skipped automatically. Use \`npm deprecate <package>@<version>\` if we need to warn consumers about a broken release.
76
+ `}]);
@@ -0,0 +1,350 @@
1
+ import{registerDocBlocks as e}from"./registry.js";e([{id:`docs.accessibility_wcag_compliance_specs`,title:`Accessibility & WCAG Compliance — **specs.md**`,summary:`> **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)**.`,kind:`reference`,visibility:`public`,route:`/docs/accessibility_wcag_compliance_specs`,tags:[`accessibility_wcag_compliance_specs`],body:`# Accessibility & WCAG Compliance — **specs.md**
2
+
3
+ > **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)**.
4
+
5
+ ---
6
+
7
+ ## 0) Scope & Principles
8
+
9
+ - **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.
10
+ - **Principles:** Perceivable, Operable, Understandable, Robust (POUR).
11
+ - **Rule of ARIA:** “No ARIA is better than bad ARIA.” Prefer native elements.
12
+ - **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.
13
+ - **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.
14
+
15
+ ---
16
+
17
+ ## 1) Design Requirements (Design System & Tokens)
18
+
19
+ **1.1 Color & Contrast**
20
+
21
+ - Body text, icons essential to meaning: **≥\xA04.5:1**; large text (≥\xA018.66px regular / 14px bold): **≥\xA03:1**.
22
+ - Interactive states (default/hover/active/disabled/focus) must maintain contrast **≥\xA03:1** against adjacent colors; text within components follows text ratios.
23
+ - Provide light & dark themes with tokens that guarantee minimums. **Never rely solely on color** to convey meaning; pair with text, shape, or icon.
24
+
25
+ **1.2 Focus Indicators (WCAG\xA02.4.11/12)**
26
+
27
+ - Every interactive element has a **visible focus** with clear offset; indicator contrast **≥\xA03:1** vs adjacent colors and indicator **area ≥\xA02\xA0CSS\xA0px** thick.
28
+ - Focus **must not be obscured** by sticky headers/footers or scroll containers.
29
+
30
+ **1.3 Motion & Preferences**
31
+
32
+ - Respect \`prefers-reduced-motion\`: suppress large parallax, auto‑animations; provide instant alternatives.
33
+ - Avoid motion that could trigger vestibular issues; under PRM, use fade/scale under **150ms**.
34
+
35
+ **1.4 Target Size (2.5.8)**
36
+
37
+ - Hit areas **≥\xA024×24\xA0CSS\xA0px** (web) and **≥\xA044×44\xA0dp** (mobile) unless exempt.
38
+
39
+ **1.5 Typography & Layout**
40
+
41
+ - Support zoom to **400%** without loss of content/functionality; responsive reflow at **320\xA0CSS\xA0px** width.
42
+ - Maintain clear heading hierarchy (h1…h6), one **h1** per view.
43
+
44
+ - 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\`.
45
+ - 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.
46
+ - When increasing font size, ensure line height supports readability. Prefer Tailwind defaults or \`leading-relaxed\`/\`leading-7\` for body text where dense blocks appear.
47
+
48
+ **1.6 Iconography & Imagery**
49
+
50
+ - Decorative images: \`alt=""\` or \`aria-hidden="true"\`.
51
+ - Informative images: concise, specific **alt**; complex charts require a **data table or long description**.
52
+
53
+ ---
54
+
55
+ ## 2) Content Requirements (UX Writing)
56
+
57
+ - Links say **what happens** (avoid “click here”).
58
+ - Buttons start with verbs; avoid ambiguous labels.
59
+ - Form labels are **visible**; placeholders are **not labels**.
60
+ - Error messages: human + programmatic association; avoid color‑only.
61
+ - Authentication: allow **copy/paste**, password managers, and avoid cognitive tests alone (**3.3.7/3.3.8/3.3.9**).
62
+ - Avoid CAPTCHAs that block users; if unavoidable, provide **multiple alternatives** (logic-free).
63
+
64
+ ---
65
+
66
+ ## 3) Engineering Requirements (Web — Next.js/React)
67
+
68
+ > 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.
69
+
70
+ **3.1 Semantics & Landmarks**
71
+
72
+ - Use native elements: \`<button>\`, \`<a href>\`, \`<label for>\`, \`<fieldset>\`, \`<legend>\`, \`<table>\`, etc.
73
+ - Landmarks per page: \`header\`, \`nav\`, \`main\`, \`aside\`, \`footer\`. Provide a **Skip to main content** link.
74
+ - Provide a **Route Announcer** (\`aria-live="polite"\`) and move focus to page **h1** after navigation.
75
+
76
+ **3.2 Keyboard**
77
+
78
+ - All functionality available with keyboard alone. Tab order follows DOM/visual order; **no keyboard traps**.
79
+ - Common bindings:
80
+ - Space/Enter → activate button; Enter on link;
81
+ - Esc closes dialogs/menus;
82
+ - Arrow keys for lists/menus/tablists with **roving tabindex**.
83
+
84
+ **3.3 Focus Management**
85
+
86
+ - On route change (Next.js), move focus to the page \`<h1>\` or container and announce via a live region.
87
+ - Dialogs/menus: **trap focus** inside; return focus to invoking control on close.
88
+ - Don’t steal focus except after explicit user action.
89
+
90
+ **3.4 Forms**
91
+
92
+ - Each input has a \`<label>\` or \`aria-label\`. Group related inputs with \`<fieldset><legend>\`.
93
+ - Associate errors via \`aria-describedby\` or inline IDs; announce with \`role="alert"\` (assertive only for critical).
94
+ - Provide **autocomplete** tokens for known fields; show **inline validation** and do not block on **onBlur** alone.
95
+
96
+ **3.5 ARIA Usage**
97
+
98
+ - Only when needed; match patterns (dialog, menu, combobox, tablist, listbox) per ARIA Authoring Practices.
99
+ - Ensure **name/role/value** are programmatically determinable.
100
+
101
+ **3.6 Media**
102
+
103
+ - Videos: **captions**; provide **transcripts** for audio; audio descriptions for essential visual info.
104
+ - No auto‑playing audio. Auto‑playing video must be muted and pausable; provide controls.
105
+
106
+ **3.7 Tables & Data**
107
+
108
+ - Use \`<th scope>\` for headers; captions via \`<caption>\`; announce sorting via \`aria-sort\`.
109
+ - Provide CSV/JSON export where charts are primary.
110
+
111
+ **3.8 Performance & Robustness**
112
+
113
+ - Avoid content shifts that move focus; reserve space or use skeletons.
114
+ - Maintain accessible names through hydration/SSR; avoid \`dangerouslySetInnerHTML\` where possible.
115
+
116
+ **3.9 Next.js specifics**
117
+
118
+ - Use \`next/link\` for navigation; ensure links are **links**, not buttons.
119
+ - \`next/image\` must include **alt** (empty if decorative).
120
+ - Announce route changes with a **global live region** and shift focus to the new view.
121
+
122
+ **3.10 Accessibility library integration**
123
+
124
+ - 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:
125
+
126
+ \`\`\`tsx
127
+ // app/layout.tsx
128
+ import '@lssm/lib.accessibility'; // includes tokens and provider exports
129
+ // or if needed: import '@lssm/lib.accessibility/src/styles.css';
130
+ \`\`\`
131
+
132
+ - Wrap the app with \`AccessibilityProvider\` and include an element with \`id="main"\` for the skip link target.
133
+
134
+ ---
135
+
136
+ ## 3b) lssm/ui-kit-web — Component Patterns & Defaults
137
+
138
+ > Source: \`packages/lssm/libs/ui-kit-web/ui/*\`
139
+
140
+ - **Button/Input/Textarea**: Built‑in \`focus-visible\` rings; ensure visible labels via \`FormLabel\` or \`aria-label\`.
141
+ - **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.
142
+ - **Dialog/Sheet/Dropdown**: Use Radix wrappers for focus‑trap and return‑focus. Provide \`DialogTitle\` + \`DialogDescription\` for name/description.
143
+ - **Select/Combobox**: Prefer \`SelectTrigger\` with visible label; for icon‑only triggers, supply \`aria-label\`. Document examples in each app.
144
+ - **Tabs**: Use \`TabsList\`, \`TabsTrigger\`, \`TabsContent\`; names are programmatically determinable.
145
+ - **Toast/Toaster**: Prefer non‑blocking announcements; map critical to assertive region; include action buttons with clear labels.
146
+ - **Table**: Use \`TableCaption\`; ensure \`TableHead\` cells use proper \`scope\`. Provide \`aria-sort\` on sortable headers.
147
+ - **Utilities to add (repo action)**:
148
+ - \`SkipLink\` component and pattern in layouts.
149
+ - \`RouteAnnouncer\` (\`aria-live="polite"\`) and **FocusOnRouteChange** helper.
150
+ - \`VisuallyHidden\` wrapper (Radix visually-hidden or minimal utility).
151
+ - \`useReducedMotion\` helper; honor in animated components.
152
+ - Touch‑size variants (≥44×44) for interactive atoms.
153
+
154
+ ---
155
+
156
+ ## 4) Engineering Requirements (Mobile — Expo/React\xA0Native)
157
+
158
+ - Set \`accessibilityLabel\`, \`accessibilityHint\`, and \`accessibilityRole\` on touchables.
159
+ - Ensure **hit slop** / min size **≥\xA044×44\xA0dp**.
160
+ - Support Dynamic Type / font scaling; no clipped text at **200%**.
161
+ - Respect **Invert Colors** and **Reduce Motion**; avoid flashing.
162
+ - Group related items with \`accessibilityElements\` ordering; hide decoration with \`accessible={false}\` or \`importantForAccessibility="no-hide-descendants"\` when appropriate.
163
+ - Test with **VoiceOver (iOS)** and **TalkBack (Android)**.
164
+
165
+ ---
166
+
167
+ ## 5) Component Patterns (Acceptance Rules)
168
+
169
+ **Buttons & Links**
170
+
171
+ - Use \`<button>\` for actions, \`<a href>\` for navigation. Provide disabled states that are perceivable beyond color.
172
+
173
+ **Navigation**
174
+
175
+ - Provide **Skip link**. One primary nav landmark. Indicate current page (\`aria-current="page"\`).
176
+
177
+ **Menus/Combobox/Autocomplete**
178
+
179
+ - Follow ARIA patterns: focus moves into list; \`aria-expanded\`, \`aria-controls\`, \`aria-activedescendant\` when applicable; Esc closes; typing filters.
180
+
181
+ **Modals/Dialogs**
182
+
183
+ - \`role="dialog"\` or \`alertdialog\` with **label**; focus trapped; background inert; Esc closes; return focus to trigger.
184
+
185
+ **Tabs**
186
+
187
+ - \`role="tablist"\`; tabs are in the tab order; arrow keys switch focus; content is \`role="tabpanel"\` with \`aria-labelledby\`.
188
+
189
+ **Toasts/Notifications**
190
+
191
+ - Non-critical: \`aria-live="polite"\`; critical: \`role="alert"\` sparingly.
192
+
193
+ **Infinite Scroll / “Load More”**
194
+
195
+ - Provide **Load more** control; announce new content to SR; preserve keyboard position.
196
+
197
+ **Drag & Drop (2.5.7)**
198
+
199
+ - Provide **non‑drag** alternative (e.g., move up/down buttons).
200
+
201
+ **Charts & Maps**
202
+
203
+ - Provide **table alternative** or textual summary; keyboard access to datapoints where interactive.
204
+
205
+ ---
206
+
207
+ ## 6) Testing & CI (Blocking Gates)
208
+
209
+ **Static & Unit**
210
+
211
+ - \`eslint-plugin-jsx-a11y\` — error on violations.
212
+ - \`jest-axe\` — unit tests for components.
213
+
214
+ **Automated Integration**
215
+
216
+ - \`axe-core\` via Playwright or Cypress on critical flows.
217
+ - \`pa11y-ci\` on key routes; threshold: **0 Critical / 0 Serious** to merge.
218
+ - Lighthouse CI a11y score **≥\xA095** on target pages.
219
+
220
+ **Manual QA (per release)**
221
+
222
+ - **Keyboard patrol:** navigate primary flows without mouse.
223
+ - **Screen reader smoke:** NVDA (Windows) or VoiceOver (macOS/iOS) across login, navigation, forms, dialogs.
224
+ - **Zoom & Reflow:** 200–400% & 320\xA0px width.
225
+ - **Color/Contrast check:** tokens in both themes.
226
+
227
+ **Reporting**
228
+
229
+ - A11y issues labeled: \`a11y-blocker\`, \`a11y-bug\`, \`a11y-enhancement\` with WCAG ref.
230
+
231
+ ---
232
+
233
+ ## 7) Repository‑Specific Adoption Plan
234
+
235
+ - Centralize UI usage on \`packages/lssm/libs/ui-kit-web\` and de‑duplicate per‑app \`components/ui\` where feasible.
236
+ - Introduce \`SkipLink\`, \`RouteAnnouncer\`, \`FocusOnRouteChange\`, and \`VisuallyHidden\` in \`ui-kit-web\`. Adopt in app layouts (\`app/layout.tsx\`) first.
237
+ - Add \`useReducedMotion\` and wire into animated components (e.g., \`drawer\`, \`tooltip\`, \`carousel\`).
238
+ - Add touch‑size variants to \`Button\`, \`IconButton\`, \`TabsTrigger\`, toggles.
239
+ - Document Select label patterns and error association in Forms.
240
+
241
+ ---
242
+
243
+ ## 8) Code Snippets
244
+
245
+ **Skip Link**
246
+
247
+ \`\`\`html
248
+ <a
249
+ class="sr-only focus:not-sr-only focus-visible:outline focus-visible:ring-4 focus-visible:ring-offset-2"
250
+ href="#main"
251
+ >Skip to main content</a
252
+ >
253
+ <main id="main">…</main>
254
+ \`\`\`
255
+
256
+ **Dialog (Radix + shadcn/ui) — essentials**
257
+
258
+ \`\`\`tsx
259
+ // Ensure label, description, focus trap, and return focus on close remain intact
260
+ <Dialog>
261
+ <DialogTrigger asChild>
262
+ <button aria-haspopup="dialog">Open settings</button>
263
+ </DialogTrigger>
264
+ <DialogContent aria-describedby="settings-desc">
265
+ <DialogTitle>Settings</DialogTitle>
266
+ <p id="settings-desc">Update your preferences.</p>
267
+ <DialogClose asChild>
268
+ <button>Close</button>
269
+ </DialogClose>
270
+ </DialogContent>
271
+ </Dialog>
272
+ \`\`\`
273
+
274
+ **Form error association**
275
+
276
+ \`\`\`tsx
277
+ <label htmlFor="email">Email</label>
278
+ <input id="email" name="email" type="email" aria-describedby="email-err" />
279
+ <p id="email-err" role="alert">Enter a valid email.</p>
280
+ \`\`\`
281
+
282
+ **Route change announcement (Next.js)**
283
+
284
+ \`\`\`tsx
285
+ // Add once at app root
286
+ <div
287
+ aria-live="polite"
288
+ aria-atomic="true"
289
+ id="route-announcer"
290
+ className="sr-only"
291
+ />
292
+ \`\`\`
293
+
294
+ ---
295
+
296
+ ## 9) Exceptions & Waivers
297
+
298
+ - If a criterion cannot be met, file an issue with: context, attempted alternatives, WCAG reference, impact assessment, and a remediation date. **Temporary waivers only.**
299
+
300
+ ---
301
+
302
+ ## 10) Ownership
303
+
304
+ - **Design:** maintains token contrast, component specs.
305
+ - **Engineering:** enforces CI gates, implements patterns.
306
+ - **QA:** runs manual checks per release.
307
+ - **PM:** blocks release if AA not met on user‑visible flows.
308
+
309
+ ---
310
+
311
+ ## 11) References (internalize; no external dependency at runtime)
312
+
313
+ - WCAG\xA02.2 (AA), EN\xA0301\xA0549. ARIA Authoring Practices. Platform HIG (Apple, Material).
314
+ - \`packages/lssm/libs/ui-kit-web\` as the canonical UI source for web.
315
+
316
+ > **Bottom line:** Shipping means **accessible by default**. We don’t trade a11y for speed; we bake it into speed.
317
+
318
+ ---
319
+
320
+ ## 12) Adoption Status (2025-09-23)
321
+
322
+ - web-artisan: AccessibilityProvider integrated; sr-only/forced-colors applied; 44x44 targets; forms announce errors; jest-axe and cypress-axe in place.
323
+ - 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.
324
+ - 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.
325
+
326
+ > CI gates: run eslint a11y, jest-axe on components, and cypress-axe on critical flows per app.
327
+
328
+ ---
329
+
330
+ ## 13) CI Hardening & Visual QA
331
+
332
+ - Linting: Run eslint with jsx-a11y rules across all web apps; block on violations.
333
+ - Unit: Run jest-axe for ui-kit-web and app-level components.
334
+ - Integration: cypress-axe on key flows (auth, forms, dialogs, tables).
335
+ - Synthetic scans: pa11y-ci on critical pages (0 Critical/Serious policy).
336
+ - Performance/A11y audit: Lighthouse CI with a11y score >= 95 on target routes.
337
+ - Artifacts: Upload pa11y and Lighthouse reports per PR; annotate failures.
338
+
339
+ ### Recent additions (2025-09-26)
340
+
341
+ - AutocompleteInput (groceries): Upgraded to ARIA combobox pattern with \`aria-controls\`, \`aria-activedescendant\`, \`Escape\`/\`Tab\` handling, and labelled listbox.
342
+ - Cypress a11y tests added for furniture and incidents modules on \`/modules\` and operators flows; checks run axe with critical/serious impacts.
343
+
344
+ ## 14) Accessibility Telemetry (PostHog)
345
+
346
+ - Events (anonymized): a11y_pref_changed (text_scale, contrast_mode, reduce_motion), a11y_panel_opened.
347
+ - Properties: app, route, previous_value, new_value, timestamp.
348
+ - Dashboards: Adoption over time, per app/route; correlation with reduced bounce on forms.
349
+ - Privacy: No PII; aggregate only.
350
+ `}]);
@@ -0,0 +1 @@
1
+ import{docBlockToPresentationSpec as e,docBlockToPresentationV2 as t,docBlocksToPresentationRoutes as n}from"./presentations.js";import{DocRegistry as r,defaultDocRegistry as i,registerDocBlocks as a}from"./registry.js";import"./PUBLISHING.docblock.js";import"./accessibility_wcag_compliance_specs.docblock.js";import"./tech/PHASE_1_QUICKSTART.docblock.js";import"./tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js";import"./tech/PHASE_3_AUTO_EVOLUTION.docblock.js";import"./tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js";import"./tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js";import"./tech/lifecycle-stage-system.docblock.js";import"./tech/presentation-runtime.docblock.js";import"./tech/schema/README.docblock.js";import"./tech/templates/runtime.docblock.js";import"./tech/workflows/overview.docblock.js";import"./tech/mcp-endpoints.docblock.js";
@@ -0,0 +1 @@
1
+ const e=[`markdown`,`application/json`,`application/xml`,`react`];function t(e){if(!e.length)return`/`;let t=e.startsWith(`/`)?e:`/${e}`;return t===`/`?`/`:t.replace(/\/+$/,``)}function n(e,n){if(e.route)return t(e.route);let r=n??`/docs`,i=e.id.replace(/^docs\.?/,``).replace(/\./g,`/`).replace(/\/+/g,`/`);return t(i.startsWith(`/`)?i:`${r}/${i}`)}function r(e,t){return t?`${t}.${e.id}`:e.id}function i(t,n){let i=n?.defaultTargets??e,a=t.version??n?.defaultVersion??1,o=t.stability??n?.defaultStability??`stable`;return{meta:{name:r(t,n?.namespace),version:a,description:t.summary??t.title,tags:t.tags,owners:t.owners,domain:t.domain,stability:o},policy:t.visibility&&t.visibility!==`public`?{flags:[t.visibility]}:void 0,source:{type:`blocknotejs`,docJson:t.body},targets:i}}function a(e,t){let n=e.version??t?.defaultVersion??1,i=e.stability??t?.defaultStability??`stable`;return{meta:{name:r(e,t?.namespace),version:n,stability:i,tags:e.tags,owners:e.owners,description:e.summary??e.title},content:{kind:`markdown`,content:e.body}}}function o(e,t){return e.map(e=>({block:e,route:n(e,t?.routePrefix),descriptor:i(e,t)}))}export{a as docBlockToPresentationSpec,i as docBlockToPresentationV2,o as docBlocksToPresentationRoutes};
@@ -0,0 +1 @@
1
+ import{docBlockToPresentationSpec as e,docBlocksToPresentationRoutes as t}from"./presentations.js";var n=class{routes=new Map;constructor(e=[],t){e.forEach(e=>this.register(e,t))}register(e,n){let[r]=t([e],n);return r&&this.routes.set(e.id,r),this}list(){return[...this.routes.values()]}get(e){return this.routes.get(e)}toRouteTuples(){return this.list().map(({route:e,descriptor:t})=>[e,t])}toPresentationSpecs(t){return this.list().map(({block:n})=>e(n,t))}};const r=[`id`,`title`,`body`,`kind`,`visibility`,`route`],i=new n;function a(e){for(let t of e){for(let e of r)if(!t[e])throw Error(`DocBlock ${t.id??`<missing id>`} missing field ${String(e)}`);i.register(t)}}export{n as DocRegistry,i as defaultDocRegistry,a as registerDocBlocks};