@exxatdesignux/ui 0.1.0 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/bin/cli.mjs +176 -0
  2. package/bin/init.mjs +15 -1
  3. package/bin/sync-extras.mjs +65 -0
  4. package/consumer-extras/README.md +21 -0
  5. package/consumer-extras/cursor-skills/exxat-accessibility/SKILL.md +282 -0
  6. package/consumer-extras/cursor-skills/exxat-board-cards/SKILL.md +68 -0
  7. package/consumer-extras/cursor-skills/exxat-centralized-list-dataset/SKILL.md +99 -0
  8. package/consumer-extras/cursor-skills/exxat-ds-skill/SKILL.md +713 -0
  9. package/consumer-extras/cursor-skills/exxat-fontawesome-icons/SKILL.md +31 -0
  10. package/consumer-extras/cursor-skills/exxat-list-page-view-shells/SKILL.md +36 -0
  11. package/consumer-extras/cursor-skills/exxat-primary-nav-secondary-panel/SKILL.md +27 -0
  12. package/consumer-extras/patterns/command-menu-pattern.md +45 -0
  13. package/consumer-extras/patterns/data-views-pattern.md +167 -0
  14. package/package.json +7 -3
  15. package/src/components/ui/sidebar.tsx +7 -2
  16. package/template/.agents/skills/shadcn/SKILL.md +242 -0
  17. package/template/.agents/skills/shadcn/agents/openai.yml +5 -0
  18. package/template/.agents/skills/shadcn/assets/shadcn-small.png +0 -0
  19. package/template/.agents/skills/shadcn/assets/shadcn.png +0 -0
  20. package/template/.agents/skills/shadcn/cli.md +257 -0
  21. package/template/.agents/skills/shadcn/customization.md +202 -0
  22. package/template/.agents/skills/shadcn/evals/evals.json +47 -0
  23. package/template/.agents/skills/shadcn/mcp.md +94 -0
  24. package/template/.agents/skills/shadcn/rules/base-vs-radix.md +306 -0
  25. package/template/.agents/skills/shadcn/rules/composition.md +195 -0
  26. package/template/.agents/skills/shadcn/rules/forms.md +192 -0
  27. package/template/.agents/skills/shadcn/rules/icons.md +101 -0
  28. package/template/.agents/skills/shadcn/rules/styling.md +162 -0
  29. package/template/.claude/skills/exxat-ds-skill/SKILL.md +712 -0
  30. package/template/.cursor/rules/exxat-accessibility.mdc +33 -0
  31. package/template/.cursor/rules/exxat-command-menu.mdc +23 -0
  32. package/template/.cursor/rules/exxat-dashboard-view-charts.mdc +53 -0
  33. package/template/.cursor/rules/exxat-data-tables.mdc +31 -0
  34. package/template/.cursor/rules/exxat-ds-agents.mdc +26 -0
  35. package/template/.cursor/rules/exxat-kbd-shortcuts.mdc +100 -0
  36. package/template/.cursor/rules/exxat-list-page-connected-views.mdc +16 -0
  37. package/template/.cursor/rules/exxat-no-toast.mdc +26 -0
  38. package/template/.cursor/rules/exxat-page-vs-drawer.mdc +22 -0
  39. package/template/.cursor/rules/exxat-table-properties-drawer.mdc +40 -0
  40. package/template/AGENTS.md +52 -11
  41. package/template/app/(app)/dashboard/page.tsx +1 -1
  42. package/template/app/(app)/data-list/[id]/page.tsx +24 -8
  43. package/template/app/(app)/data-list/new/page.tsx +7 -4
  44. package/template/app/(app)/data-list/page.tsx +1 -1
  45. package/template/app/(app)/examples/page.tsx +41 -0
  46. package/template/app/(app)/question-bank/page.tsx +3 -3
  47. package/template/app/globals.css +1 -1
  48. package/template/components/app-sidebar.tsx +52 -35
  49. package/template/components/compliance-table.tsx +79 -0
  50. package/template/components/data-list-client.tsx +36 -25
  51. package/template/components/data-list-table.tsx +797 -10
  52. package/template/components/data-views/finder-panel-view.tsx +405 -0
  53. package/template/components/data-views/folder-grid-view.tsx +86 -0
  54. package/template/components/data-views/index.ts +59 -0
  55. package/template/components/data-views/list-page-split-details-placeholder.tsx +39 -0
  56. package/template/components/data-views/list-page-split-hub-chrome.tsx +60 -0
  57. package/template/components/data-views/list-page-split-hub-tokens.ts +16 -0
  58. package/template/components/data-views/list-page-tree-column-header.tsx +31 -0
  59. package/template/components/data-views/list-page-tree-panel-shell.tsx +91 -0
  60. package/template/components/data-views/list-page-view-frame.tsx +53 -0
  61. package/template/components/data-views/os-folder-glyph.tsx +121 -0
  62. package/template/components/folder-details-shell.tsx +230 -0
  63. package/template/components/hub-tree-panel-view.tsx +672 -0
  64. package/template/components/list-hub-status-badge.tsx +17 -3
  65. package/template/components/page-header.tsx +149 -7
  66. package/template/components/placements-page-header.tsx +14 -8
  67. package/template/components/placements-table-columns.tsx +8 -8
  68. package/template/components/question-bank-client.tsx +157 -39
  69. package/template/components/question-bank-new-folder-sheet.tsx +248 -0
  70. package/template/components/question-bank-os-folder-view.tsx +648 -0
  71. package/template/components/question-bank-page-header.tsx +31 -2
  72. package/template/components/question-bank-panel-activator.tsx +9 -0
  73. package/template/components/question-bank-secondary-nav.tsx +226 -0
  74. package/template/components/question-bank-table.tsx +707 -22
  75. package/template/components/secondary-panel.tsx +41 -107
  76. package/template/components/sites-table.tsx +66 -0
  77. package/template/components/team-client.tsx +7 -0
  78. package/template/components/team-table.tsx +156 -1
  79. package/template/components/templates/list-page.tsx +2 -2
  80. package/template/components/ui/avatar.tsx +1 -1
  81. package/template/components/ui/badge.tsx +1 -1
  82. package/template/components/ui/banner.tsx +1 -1
  83. package/template/components/ui/breadcrumb.tsx +1 -1
  84. package/template/components/ui/button.tsx +1 -1
  85. package/template/components/ui/calendar.tsx +1 -1
  86. package/template/components/ui/card.tsx +1 -1
  87. package/template/components/ui/chart.tsx +1 -1
  88. package/template/components/ui/checkbox.tsx +1 -1
  89. package/template/components/ui/coach-mark.tsx +1 -1
  90. package/template/components/ui/collapsible.tsx +1 -1
  91. package/template/components/ui/command.tsx +1 -1
  92. package/template/components/ui/date-picker-field.tsx +1 -1
  93. package/template/components/ui/dialog.tsx +1 -1
  94. package/template/components/ui/drag-handle-grip.tsx +1 -1
  95. package/template/components/ui/drawer.tsx +1 -1
  96. package/template/components/ui/dropdown-menu.tsx +1 -1
  97. package/template/components/ui/field.tsx +1 -1
  98. package/template/components/ui/form.tsx +1 -1
  99. package/template/components/ui/input-group.tsx +1 -1
  100. package/template/components/ui/input-mask.tsx +1 -1
  101. package/template/components/ui/input.tsx +1 -1
  102. package/template/components/ui/kbd.tsx +1 -1
  103. package/template/components/ui/label.tsx +1 -1
  104. package/template/components/ui/payment-card-fields.tsx +1 -1
  105. package/template/components/ui/popover.tsx +1 -1
  106. package/template/components/ui/radio-group.tsx +1 -1
  107. package/template/components/ui/resizable.tsx +68 -0
  108. package/template/components/ui/select.tsx +1 -1
  109. package/template/components/ui/selection-tile-grid.tsx +1 -1
  110. package/template/components/ui/separator.tsx +1 -1
  111. package/template/components/ui/sheet.tsx +1 -1
  112. package/template/components/ui/sidebar.tsx +1 -1
  113. package/template/components/ui/skeleton.tsx +1 -1
  114. package/template/components/ui/sonner.tsx +1 -1
  115. package/template/components/ui/status-badge.tsx +1 -1
  116. package/template/components/ui/table.tsx +1 -1
  117. package/template/components/ui/tabs.tsx +1 -1
  118. package/template/components/ui/textarea.tsx +1 -1
  119. package/template/components/ui/tip.tsx +1 -1
  120. package/template/components/ui/toggle-group.tsx +1 -1
  121. package/template/components/ui/toggle-switch.tsx +1 -1
  122. package/template/components/ui/toggle.tsx +1 -1
  123. package/template/components/ui/tooltip.tsx +1 -1
  124. package/template/components/ui/view-segmented-control.tsx +1 -1
  125. package/template/docs/data-views-pattern.md +7 -0
  126. package/template/hooks/use-app-theme.ts +1 -1
  127. package/template/hooks/use-coach-mark.ts +1 -1
  128. package/template/hooks/use-location-hash.ts +15 -0
  129. package/template/hooks/use-mobile.ts +1 -1
  130. package/template/hooks/use-mod-key-label.ts +1 -1
  131. package/template/hooks/use-sidebar-reflow-zoom.ts +40 -0
  132. package/template/lib/ask-leo-route-context.ts +25 -57
  133. package/template/lib/coach-mark-registry.ts +13 -13
  134. package/template/lib/command-menu-config.ts +28 -23
  135. package/template/lib/command-menu-search-data.ts +10 -9
  136. package/template/lib/data-list-view-surface.ts +12 -1
  137. package/template/lib/data-list-view.ts +6 -3
  138. package/template/lib/date-filter.ts +1 -1
  139. package/template/lib/mock/dashboard.ts +11 -11
  140. package/template/lib/mock/navigation.tsx +22 -63
  141. package/template/lib/mock/placements-kpi.ts +19 -19
  142. package/template/lib/mock/question-bank-folders.ts +167 -0
  143. package/template/lib/mock/question-bank-header-collaborators.ts +14 -0
  144. package/template/lib/mock/question-bank-inspector.ts +109 -0
  145. package/template/lib/mock/question-bank-kpi.ts +1 -1
  146. package/template/lib/mock/question-bank.ts +80 -0
  147. package/template/lib/question-bank-nav.ts +91 -0
  148. package/template/lib/utils.ts +1 -1
  149. package/template/next.config.mjs +8 -0
  150. package/template/package.json +1 -0
  151. package/template/public/folders/icons8-folder-windows-11.svg +1 -0
  152. package/template/app/(app)/compliance/page.tsx +0 -10
  153. package/template/app/(app)/rotations/page.tsx +0 -15
  154. package/template/app/(app)/sites/all/page.tsx +0 -13
  155. package/template/app/(app)/team/page.tsx +0 -10
package/bin/cli.mjs ADDED
@@ -0,0 +1,176 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Primary CLI for `@exxatdesignux/ui`.
4
+ *
5
+ * Usage (after publish) — prefer **scoped** install so you always run this package’s binary
6
+ * (plain `npx exxat-ui` would fetch a different npm package named `exxat-ui` if it exists):
7
+ * npx --package=@exxatdesignux/ui@latest exxat-ui init
8
+ * npx --package=@exxatdesignux/ui@latest exxat-ui update
9
+ *
10
+ * `npm create exxat-app` still maps to `bin/init.mjs` for empty-folder scaffolding.
11
+ */
12
+
13
+ import { execFileSync } from "child_process"
14
+ import { readFileSync } from "fs"
15
+ import { dirname, resolve } from "path"
16
+ import { fileURLToPath } from "url"
17
+
18
+ const __dirname = dirname(fileURLToPath(import.meta.url))
19
+
20
+ const cmd = process.argv[2] ?? "help"
21
+
22
+ function runInitScript() {
23
+ execFileSync(process.execPath, [resolve(__dirname, "init.mjs")], {
24
+ stdio: "inherit",
25
+ cwd: process.cwd(),
26
+ })
27
+ }
28
+
29
+ function runSyncExtras() {
30
+ execFileSync(process.execPath, [resolve(__dirname, "sync-extras.mjs")], {
31
+ stdio: "inherit",
32
+ cwd: process.cwd(),
33
+ })
34
+ }
35
+
36
+ /** @returns {number} negative if a < b, 0 if equal, positive if a > b (x.y.z only) */
37
+ function compareSemver(a, b) {
38
+ const pa = a.split(".").map(n => parseInt(n, 10) || 0)
39
+ const pb = b.split(".").map(n => parseInt(n, 10) || 0)
40
+ for (let i = 0; i < Math.max(pa.length, pb.length); i++) {
41
+ const da = pa[i] ?? 0
42
+ const db = pb[i] ?? 0
43
+ if (da !== db) return da - db
44
+ }
45
+ return 0
46
+ }
47
+
48
+ function printHelp() {
49
+ console.log(`
50
+ @exxatdesignux/ui — CLI
51
+
52
+ Commands:
53
+ init Scaffold the Exxat DS starter app (must run in an empty directory).
54
+ sync-extras Copy packaged Cursor skills + pattern docs into this repo (DS-only paths).
55
+ update How to upgrade an existing project that depends on this package.
56
+ doctor Compare this CLI version vs npm registry "latest" (diagnose stale installs).
57
+
58
+ Do NOT use plain npx @exxatdesignux/ui — use the scoped form below.
59
+
60
+ Examples:
61
+ npx --package=@exxatdesignux/ui@latest exxat-ui init
62
+ npx --package=@exxatdesignux/ui@latest exxat-ui sync-extras
63
+ npx --package=@exxatdesignux/ui@latest exxat-ui doctor
64
+ npx --package=@exxatdesignux/ui@latest exxat-ui update
65
+
66
+ Legacy (npm create):
67
+ npm create exxat-app@latest
68
+ `)
69
+ }
70
+
71
+ function printUpdate() {
72
+ console.log(`
73
+ Update @exxatdesignux/ui in your application:
74
+
75
+ npm install @exxatdesignux/ui@latest
76
+
77
+ # If the lockfile still pins an old release, force the resolver:
78
+ npm install @exxatdesignux/ui@latest --save --prefer-online
79
+
80
+ # or (pnpm)
81
+ pnpm add @exxatdesignux/ui@latest
82
+
83
+ # or (yarn)
84
+ yarn add @exxatdesignux/ui@latest
85
+
86
+ That refreshes **components / hooks / tokens** under node_modules only — your app
87
+ routes and product copy are unchanged.
88
+
89
+ **Still seeing old code?** Run **exxat-ui doctor** — the npm "latest" tag often lags
90
+ this Git repo until maintainers publish (git tag **ui-v<version>**).
91
+
92
+ To also refresh **bundled Cursor skills** and **pattern reference docs** from the
93
+ same package version (overwrites only .cursor/skills/exxat-* and docs/exxat-ds/):
94
+
95
+ npx --package=@exxatdesignux/ui@latest exxat-ui sync-extras
96
+
97
+ CLI (always pulls this scope): npx --package=@exxatdesignux/ui@latest exxat-ui <init|sync-extras|update|doctor|help>
98
+
99
+ Monorepo / design-system contributors (this workspace): pull latest Git and run
100
+ pnpm install
101
+ from the repository root — apps use "workspace:*" for the local package.
102
+
103
+ Scaffold: exxat-ui init pins @exxatdesignux/ui in the new app to the same semver as
104
+ this CLI tarball so npm does not resolve a stale "latest" from cache.
105
+ `)
106
+ }
107
+
108
+ function printDoctor() {
109
+ const pkgPath = resolve(__dirname, "../package.json")
110
+ let cliVersion = "unknown"
111
+ try {
112
+ cliVersion = JSON.parse(readFileSync(pkgPath, "utf8")).version
113
+ } catch {
114
+ /* ignore */
115
+ }
116
+ console.log(`This exxat-ui CLI (package on disk / npx extract): ${cliVersion}`)
117
+ try {
118
+ const reg = execFileSync("npm", ["view", "@exxatdesignux/ui", "version"], {
119
+ encoding: "utf8",
120
+ stdio: ["ignore", "pipe", "pipe"],
121
+ }).trim()
122
+ console.log(`npm registry dist-tag "latest": ${reg || "(no response)"}`)
123
+ if (reg && reg !== cliVersion) {
124
+ console.log("")
125
+ if (compareSemver(reg, cliVersion) < 0) {
126
+ console.log(
127
+ "The registry is **behind** this CLI package: Git has a newer version that has not been published to npm yet.",
128
+ )
129
+ console.log(
130
+ "Running `npm install @exxatdesignux/ui@latest` only installs **" + reg + "** until maintainers publish (push tag **ui-v" + cliVersion + "**).",
131
+ )
132
+ } else {
133
+ console.log(
134
+ "The registry reports a **newer** version than this CLI — refresh npx/npm cache or run `npx --package=@exxatdesignux/ui@" +
135
+ reg +
136
+ " exxat-ui …` so the CLI matches the registry.",
137
+ )
138
+ }
139
+ console.log("")
140
+ console.log("Options:")
141
+ console.log(" • Install the latest **published** build: npm install @exxatdesignux/ui@" + reg)
142
+ console.log(" • Or pack from a Git checkout: cd packages/ui && npm pack && npm i ../exxatdesignux-ui-*.tgz")
143
+ } else if (reg === cliVersion) {
144
+ console.log("")
145
+ console.log("Registry matches this CLI — @latest should resolve to the same release.")
146
+ }
147
+ } catch (e) {
148
+ console.log("")
149
+ console.log("Could not run `npm view` (offline or npm not in PATH). Error:", (e && e.message) || e)
150
+ }
151
+ console.log("")
152
+ }
153
+
154
+ switch (cmd) {
155
+ case "init":
156
+ runInitScript()
157
+ break
158
+ case "sync-extras":
159
+ runSyncExtras()
160
+ break
161
+ case "update":
162
+ printUpdate()
163
+ break
164
+ case "doctor":
165
+ printDoctor()
166
+ break
167
+ case "help":
168
+ case "--help":
169
+ case "-h":
170
+ printHelp()
171
+ break
172
+ default:
173
+ console.error(`Unknown command: ${cmd}\n`)
174
+ printHelp()
175
+ process.exitCode = 1
176
+ }
package/bin/init.mjs CHANGED
@@ -1,11 +1,12 @@
1
1
  #!/usr/bin/env node
2
- import { cpSync, existsSync, readdirSync } from 'fs'
2
+ import { cpSync, readFileSync, readdirSync, writeFileSync } from 'fs'
3
3
  import { resolve, dirname } from 'path'
4
4
  import { fileURLToPath } from 'url'
5
5
  import { execSync } from 'child_process'
6
6
 
7
7
  const __dirname = dirname(fileURLToPath(import.meta.url))
8
8
  const templateDir = resolve(__dirname, '../template')
9
+ const selfPkgPath = resolve(__dirname, '../package.json')
9
10
  const targetDir = process.cwd()
10
11
 
11
12
  const files = readdirSync(targetDir)
@@ -19,6 +20,16 @@ if (!isEmpty) {
19
20
  console.log('📦 Copying Exxat DS starter app...')
20
21
  cpSync(templateDir, targetDir, { recursive: true })
21
22
 
23
+ /** Pin DS to this CLI tarball version so `npm install` does not resolve a stale `latest` from cache. */
24
+ const selfVersion = JSON.parse(readFileSync(selfPkgPath, 'utf8')).version
25
+ const targetPkgPath = resolve(targetDir, 'package.json')
26
+ const targetPkg = JSON.parse(readFileSync(targetPkgPath, 'utf8'))
27
+ if (targetPkg.dependencies?.['@exxatdesignux/ui']) {
28
+ targetPkg.dependencies['@exxatdesignux/ui'] = `^${selfVersion}`
29
+ writeFileSync(targetPkgPath, `${JSON.stringify(targetPkg, null, 2)}\n`)
30
+ console.log(`📌 Pinned @exxatdesignux/ui to ^${selfVersion} (matches this scaffold).`)
31
+ }
32
+
22
33
  console.log('📥 Installing dependencies...')
23
34
  execSync('npm install', { stdio: 'inherit', cwd: targetDir })
24
35
 
@@ -27,3 +38,6 @@ console.log('✅ Done! Your Exxat DS app is ready.')
27
38
  console.log('')
28
39
  console.log(' npm run dev → start dev server')
29
40
  console.log('')
41
+ console.log(' Optional — refresh Cursor skills + pattern docs from the same package:')
42
+ console.log(` npx --package=@exxatdesignux/ui@${selfVersion} exxat-ui sync-extras`)
43
+ console.log('')
@@ -0,0 +1,65 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Consumer: copy packaged design-system extras into the app repo.
4
+ *
5
+ * Overwrites ONLY:
6
+ * - `.cursor/skills/<bundled exxat-* skill folders>/`
7
+ * - `docs/exxat-ds/*.md` (pattern reference docs from the package)
8
+ *
9
+ * Does NOT touch `app/`, `pages/`, `src/` product code, or npm dependencies.
10
+ * Run after `npm install @exxatdesignux/ui@…` / `pnpm update @exxatdesignux/ui`.
11
+ *
12
+ * npx --package=@exxatdesignux/ui@latest exxat-ui sync-extras
13
+ */
14
+
15
+ import { cpSync, existsSync, mkdirSync, readdirSync, rmSync, statSync } from "node:fs"
16
+ import { dirname, join, resolve } from "node:path"
17
+ import { fileURLToPath } from "node:url"
18
+
19
+ const __dirname = dirname(fileURLToPath(import.meta.url))
20
+ const pkgRoot = resolve(__dirname, "..")
21
+ const cwd = process.cwd()
22
+
23
+ const skillsSrc = join(pkgRoot, "consumer-extras", "cursor-skills")
24
+ const skillsDest = join(cwd, ".cursor", "skills")
25
+
26
+ const patternsSrc = join(pkgRoot, "consumer-extras", "patterns")
27
+ const patternsDest = join(cwd, "docs", "exxat-ds")
28
+
29
+ function syncSkills() {
30
+ if (!existsSync(skillsSrc)) {
31
+ console.error(
32
+ "[sync-extras] Missing packaged skills. Is @exxatdesignux/ui installed? Expected:",
33
+ skillsSrc,
34
+ )
35
+ process.exit(1)
36
+ }
37
+ mkdirSync(skillsDest, { recursive: true })
38
+ for (const name of readdirSync(skillsSrc)) {
39
+ const src = join(skillsSrc, name)
40
+ if (!statSync(src).isDirectory()) continue
41
+ if (!name.startsWith("exxat-")) continue
42
+ const dest = join(skillsDest, name)
43
+ if (existsSync(dest)) rmSync(dest, { recursive: true, force: true })
44
+ cpSync(src, dest, { recursive: true })
45
+ console.log(`[sync-extras] wrote .cursor/skills/${name}/`)
46
+ }
47
+ }
48
+
49
+ function syncPatterns() {
50
+ if (!existsSync(patternsSrc)) {
51
+ console.warn("[sync-extras] no packaged patterns (optional).")
52
+ return
53
+ }
54
+ mkdirSync(patternsDest, { recursive: true })
55
+ for (const name of readdirSync(patternsSrc)) {
56
+ const src = join(patternsSrc, name)
57
+ if (!statSync(src).isFile()) continue
58
+ cpSync(src, join(patternsDest, name))
59
+ console.log(`[sync-extras] wrote docs/exxat-ds/${name}`)
60
+ }
61
+ }
62
+
63
+ syncSkills()
64
+ syncPatterns()
65
+ console.log("[sync-extras] Done. Product routes and app content were not modified.")
@@ -0,0 +1,21 @@
1
+ # Consumer extras (ships with `@exxatdesignux/ui`)
2
+
3
+ These folders are **not** application content. They are design-system reference
4
+ material that other repositories can **refresh from the npm package** without
5
+ touching product routes or pages.
6
+
7
+ | Path in this tarball | After `exxat-ui sync-extras` in your repo |
8
+ |----------------------|-------------------------------------------|
9
+ | `cursor-skills/exxat-*` | `.cursor/skills/exxat-*` (replaced) |
10
+ | `patterns/*.md` | `docs/exxat-ds/*.md` (replaced) |
11
+
12
+ **Components and hooks** still come only from `node_modules/@exxatdesignux/ui`
13
+ via normal semver installs — `sync-extras` does not copy TS source into your app.
14
+
15
+ **Maintainers** (this monorepo): when skills or web docs change, run:
16
+
17
+ ```bash
18
+ pnpm --filter @exxatdesignux/ui vendor:consumer-extras
19
+ ```
20
+
21
+ …then bump `packages/ui` version and publish so consumers get the new bundle.
@@ -0,0 +1,282 @@
1
+ ---
2
+ name: exxat-accessibility
3
+ description: WCAG 2.x / ARIA checklist for Exxat DS — tablists, touch targets, contrast, and audit follow-ups. Use when fixing axe/Deque issues, building nav or tab UIs, or reviewing accessibility.
4
+ user-invocable: true
5
+ ---
6
+
7
+ # Exxat DS — accessibility checklist
8
+
9
+ Standard target: **WCAG 2.1 Level AA** (and 2.2 where noted).
10
+
11
+ **Canonical for agents (MUST/MUST NOT, checklist):** `exxat-ds/AGENTS.md` **§8** in the repo (same content summarized there; this skill stays the detailed checklist + product tokens).
12
+
13
+ ## ARIA roles & structure (SC 1.3.1)
14
+
15
+ - **`role="tablist"`** may only contain **`role="tab"`** (or elements that resolve to tabs). Do **not** place `role="button"`, menus (`aria-haspopup`), or ad-hoc controls **inside** the same `tablist` container.
16
+ - **Composite view switchers** (tabs + per-tab settings menu + remove control): use **`role="toolbar"`** with **`aria-label`**, and **`aria-pressed`** on view toggle buttons instead of misusing `tab`/`tablist`.
17
+ - Prefer **`<button type="button">`** over **`span role="button"`** for clickable icons (keyboard + AT).
18
+
19
+ ## Touch targets (WCAG 2.2 AA — 2.5.8 Target Size Minimum)
20
+
21
+ - Interactive controls (including icon-only chevrons and close icons) should be at least **24×24 CSS pixels**, or have **24px** spacing so their **24px** hit circles do not overlap adjacent targets.
22
+ - Use **`min-h-6 min-w-6`** (or `size-6`) with centered icons; avoid `size-4` (16px) for sole click targets.
23
+
24
+ ## Icons that communicate information — always have a text alternative (SC 1.1.1, 3.3.2, 2.4.6)
25
+
26
+ This rule covers **every icon that carries meaning**, not only icon-only buttons. FA glyphs, inline SVGs, avatar placeholders, trend arrows, status dots, chart-legend squares, calendar/clock/pin icons in cells — if the icon **tells the user something**, that something MUST be reachable by screen readers AND discoverable to sighted users who don't recognise the glyph.
27
+
28
+ There are three cases. Pick the one that matches the icon's context:
29
+
30
+ ### Case A — Decorative icon next to text that already names it
31
+
32
+ When the icon sits adjacent to a visible text label that already carries the meaning, the icon is **decorative**. It MUST be `aria-hidden` and MUST NOT carry `aria-label` (screen readers would announce the meaning twice).
33
+
34
+ ```tsx
35
+ <span className="flex items-center gap-1.5">
36
+ <i className="fa-light fa-calendar-days" aria-hidden />
37
+ <span>12/14/2025 – 12/20/2025</span>
38
+ </span>
39
+
40
+ <Button>
41
+ <i className="fa-light fa-plus" aria-hidden />
42
+ <span>New placement</span>
43
+ </Button>
44
+ ```
45
+
46
+ No tooltip needed — the text is the alt. This is the default in table cells, buttons with text labels, breadcrumbs, badges, menu items.
47
+
48
+ ### Case B — Informational icon standing alone (no adjacent label)
49
+
50
+ When the icon is the **only visible carrier** of the information — e.g.:
51
+
52
+ - `fa-calendar-days` in a compact table column header meaning "date range"
53
+ - `fa-clock` meaning "updated at" or "time remaining"
54
+ - `fa-location-dot` meaning "site" / "location"
55
+ - `fa-graduation-cap` meaning "student"
56
+ - trending arrow in a KPI card (↑ / ↓)
57
+ - status dot (a coloured circle meaning "on track / at risk / blocked")
58
+ - icon-only legend key on a chart
59
+ - `fa-paperclip` meaning "has attachments"
60
+ - `fa-lock` meaning "restricted"
61
+
62
+ …the icon MUST:
63
+
64
+ 1. Announce itself to AT via **`role="img"` + `aria-label`** on a wrapping element (span/div), OR inherit the name from a labelled ancestor via `aria-labelledby`.
65
+ 2. Expose a visible **`Tooltip`** so sighted mouse/keyboard users who don't recognise the glyph learn the meaning.
66
+
67
+ ```tsx
68
+ <Tooltip>
69
+ <TooltipTrigger asChild>
70
+ {/* Non-interactive: wrap in a span with role="img".
71
+ tabIndex={0} so the tooltip opens on keyboard focus, not just hover. */}
72
+ <span
73
+ role="img"
74
+ aria-label="Placement date range"
75
+ tabIndex={0}
76
+ className="inline-flex size-6 items-center justify-center rounded-md text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
77
+ >
78
+ <i className="fa-light fa-calendar-days" aria-hidden />
79
+ </span>
80
+ </TooltipTrigger>
81
+ <TooltipContent side="top">Placement date range</TooltipContent>
82
+ </Tooltip>
83
+ ```
84
+
85
+ Rules:
86
+ 1. `TooltipContent` text MUST match the `aria-label`.
87
+ 2. The inner `<i>` / `<svg>` is always `aria-hidden`; the accessible name lives on the wrapper.
88
+ 3. If a visible text label could fit, **prefer Case A** (add the label) over tooltip-only.
89
+ 4. Target/focus size still **≥ 24×24 CSS px** so keyboard users can focus the icon reliably.
90
+ 5. Status dots MUST additionally carry a **text or shape cue** (not colour alone — SC 1.4.1). E.g. pair a coloured dot with a status label nearby, or differentiate by icon shape (`circle-check` vs `triangle-exclamation` vs `circle-xmark`).
91
+
92
+ ### Case C — Interactive icon-only button / link
93
+
94
+ Any button or link whose visible content is a **single icon** — close (`×`), chevron, overflow (`⋯`), sort direction, filter chip dismiss, copy-to-clipboard, Ask Leo toggle, expand/collapse, row actions — MUST carry BOTH:
95
+
96
+ 1. **`aria-label`** on the `<button>` / `<a>` (programmatic name for AT and axe).
97
+ 2. A wrapping **`Tooltip`** whose content repeats the same name (plus a `Kbd` when a shortcut exists).
98
+
99
+ ```tsx
100
+ import { Tooltip, TooltipTrigger, TooltipContent } from "@/components/ui/tooltip"
101
+ import { Kbd } from "@/components/ui/kbd"
102
+
103
+ <Tooltip>
104
+ <TooltipTrigger asChild>
105
+ <button
106
+ type="button"
107
+ aria-label="Close insight"
108
+ onClick={onClose}
109
+ className="inline-flex size-7 min-h-7 min-w-7 items-center justify-center rounded-md …"
110
+ >
111
+ <i className="fa-solid fa-xmark" aria-hidden />
112
+ </button>
113
+ </TooltipTrigger>
114
+ <TooltipContent side="top" className="flex items-center gap-1.5">
115
+ <span>Close</span>
116
+ <Kbd>Esc</Kbd>
117
+ </TooltipContent>
118
+ </Tooltip>
119
+ ```
120
+
121
+ Rules:
122
+ 1. `TooltipContent` MUST match or extend the `aria-label`.
123
+ 2. Inside the tooltip use the **default tile** `<Kbd>` (NOT `variant="bare"`).
124
+ 3. The inner `<i>` / `<svg>` MUST have `aria-hidden`.
125
+ 4. Click target **≥ 24×24 CSS px** (see Touch targets section).
126
+
127
+ ### Narrow exceptions (all cases)
128
+
129
+ - A chevron inside a labelled composite (`Select`, `Combobox`, `Breadcrumb` separator) where the parent already names the whole control or the glyph is purely structural — mark it `aria-hidden`.
130
+ - Drag handles inside a `dnd-kit` listener that reference a labelled ancestor via `aria-describedby`.
131
+ - Decorative icons that purely decorate (e.g. the Leo star next to an already-named "Ask Leo" button) — `aria-hidden`, no tooltip.
132
+
133
+ ### Decision tree
134
+
135
+ ```
136
+ Icon appears somewhere →
137
+ Is there adjacent visible text that already names the meaning?
138
+ YES → Case A: aria-hidden, no tooltip. Done.
139
+ NO → Is the icon the visible content of a button/link?
140
+ YES → Case C: aria-label on the control + Tooltip.
141
+ NO → Case B: span[role="img", aria-label, tabIndex=0] + Tooltip.
142
+ ```
143
+
144
+ **When in doubt: add the accessible name + tooltip.** Silence is never correct for an icon that means something.
145
+
146
+ ## Keyboard shortcuts inside buttons — `<Kbd variant="bare">` only
147
+
148
+ The `Kbd` primitive (`@/components/ui/kbd`) has two variants:
149
+
150
+ | Variant | Where it goes | Chrome |
151
+ |---------|---------------|--------|
152
+ | `tile` (default) | Inside `TooltipContent`, menu `shortcut=` slots, standalone surfaces | Background + border, fixed contrast |
153
+ | `bare` | Inline **inside** a `Button` (primary, secondary, wizard Next/Back/Submit) | No background, no border, inherits `currentColor` at 70 % opacity |
154
+
155
+ Inside a filled/solid button the `tile` variant looks like a pasted-on patch (wrong background color against the button fill). Always glue multi-key chords into **one** bare kbd:
156
+
157
+ ```tsx
158
+ // ✅ correct — bare inside a button
159
+ <Button>
160
+ <span>Ask Leo</span>
161
+ <KbdGroup className="ml-1.5">
162
+ <Kbd variant="bare">⌘⌥K</Kbd>
163
+ </KbdGroup>
164
+ </Button>
165
+
166
+ // ❌ wrong — tile variant on a primary button
167
+ <Button>
168
+ <span>Ask Leo</span>
169
+ <KbdGroup className="ml-1.5">
170
+ <Kbd>⌘</Kbd><Kbd>⌥</Kbd><Kbd>K</Kbd>
171
+ </KbdGroup>
172
+ </Button>
173
+ ```
174
+
175
+ Reference pattern: `components/new-placement-form.tsx` (Next = `<Kbd variant="bare">{mod}⏎</Kbd>`, Back = `<Kbd variant="bare">{mod}{alt}←</Kbd>`). See `.cursor/rules/exxat-kbd-shortcuts.mdc` for the full shortcut table.
176
+
177
+ ## Color (SC 1.4.3 / 1.4.11)
178
+
179
+ - **Normal text** (including small badge labels): **≥ 4.5:1** against its background.
180
+ - **UI components** (borders, focus rings): **≥ 3:1** where required by 1.4.11.
181
+ - **Muted text on tinted surfaces** (e.g. sidebar): use tokens mixed against **`--sidebar`**, not only against `--background` (see `--sidebar-section-label-foreground`).
182
+
183
+ ## Sidebar badges (design tokens)
184
+
185
+ - **Count / numeric (sidebar):** **red** (`bg-red-600` + white). Placement toolbar counts use **status colors** (see below).
186
+ - **“New”:** use **brand** (`bg-brand` + `text-brand-foreground`).
187
+ - **“Beta”:** bright yellow fill + **dark** text (`bg-yellow-400` + `text-yellow-950`) for contrast.
188
+
189
+ ## Placements toolbar count pills (`filterId`)
190
+
191
+ - **`all`:** slate
192
+ - **`upcoming`:** amber
193
+ - **`ongoing`:** blue
194
+ - **`completed`:** emerald
195
+ - Unknown `filterId` falls back to **all** (slate).
196
+
197
+ ## Form fields — format hints MUST be persistent (SC 3.3.2, 1.3.1)
198
+
199
+ Placeholder text disappears on focus, is low-contrast by default, and is not reliably announced by assistive tech. For any field with a **required format**, render the format as **persistent helper text** tied to the input via `aria-describedby` — never rely on the placeholder alone.
200
+
201
+ **When this applies (non-exhaustive):**
202
+
203
+ - Dates, times, date ranges (even when a picker is present — the typed-format fallback must show the mask).
204
+ - Phone / fax, country-specific formats.
205
+ - Currency, GPA, percentages, hours, durations, unit-bearing numbers ("hrs/wk", "USD").
206
+ - IDs with a pattern (Student ID `STU-YYYY-####`, NPI, license #).
207
+ - Email / URL where a domain or protocol is required.
208
+ - Credit hours, scores, weights — anything whose scale is not obvious from the label.
209
+
210
+ **Pattern — use `FormDescription` from shadcn `Form`:**
211
+
212
+ ```tsx
213
+ <FormField name="dob" render={({ field }) => (
214
+ <FormItem>
215
+ <FormLabel>Date of birth<span aria-hidden="true"> *</span></FormLabel>
216
+ <FormControl>
217
+ <Input {...field} inputMode="numeric" placeholder="MM/DD/YYYY" />
218
+ </FormControl>
219
+ {/* Persistent — announced via aria-describedby, survives focus */}
220
+ <FormDescription>MM/DD/YYYY</FormDescription>
221
+ <FormMessage />
222
+ </FormItem>
223
+ )} />
224
+ ```
225
+
226
+ **Rules:**
227
+
228
+ 1. The format MUST appear as visible text **outside** the placeholder — `FormDescription`, a helper `<p>` with `id` referenced by `aria-describedby`, or an adjacent `<small>`.
229
+ 2. Placeholder MAY mirror the format as extra affordance, but is never the sole source.
230
+ 3. Prefer a **picker primitive** over free-text where one exists: `DatePickerField` for dates, `Select` for enumerated values, masked input for phone/IDs.
231
+ 4. Required marker (`*`) is decorative — always pair with `aria-required="true"` on the input.
232
+ 5. Error messages (`FormMessage`) replace description announcement while active; keep the description concise so the combined `aria-describedby` string stays readable.
233
+ 6. Units belong in the description, not the label suffix, when they vary by context (e.g. "Out of 4.0" under GPA rather than in the label).
234
+
235
+ ## High-Contrast modes
236
+
237
+ There are **two** HC paths in this app. Fix both or the bar will still look broken in one of them:
238
+
239
+ 1. **App HC theme — `html[data-contrast="high"]`** (user toggle in Settings). Use the **`hc:`** Tailwind variant defined in `globals.css` (line 22: `@custom-variant hc (&:is([data-contrast="high"] *));`). This is what the user sees when they switch to High Contrast in-app.
240
+ 2. **OS / browser forced-colors** — Windows High Contrast, some Linux DEs, `prefers-contrast: more`. Use `forced-colors:` variants mapping to system colors (`Canvas`, `CanvasText`, `Highlight`, `HighlightText`, `GrayText`).
241
+
242
+ ### Why tokens collapse in HC
243
+
244
+ In HC themes many surfaces resolve to near-identical values (e.g. `bg-muted` ≈ `bg-background` in HC dark, `bg-brand` gets desaturated). Any UI encoding state **only via fill/track color** (progress bars, quota gauges, chart ranges, meter pills, dashed reference lines, status pills) flattens into a single rectangle. The fix is to force distinct contrast in HC:
245
+
246
+ - **Track / container:** `hc:border hc:border-border hc:bg-background` + `forced-colors:border-[CanvasText] forced-colors:bg-[Canvas]`
247
+ - **Active fill / progress:** `hc:bg-foreground` + `forced-colors:bg-[Highlight]`
248
+ - **Dashed marker / divider:** `hc:border-foreground` + `forced-colors:border-[CanvasText]`
249
+ - **Pill on colored bg:** invert to `hc:bg-background hc:text-foreground hc:border hc:border-foreground` + `forced-colors:bg-[Canvas] forced-colors:text-[CanvasText] forced-colors:border-[CanvasText]`
250
+ - **Disabled state:** `forced-colors:text-[GrayText]`
251
+
252
+ Never rely on `box-shadow` alone for separation in HC — shadows are suppressed; pair with a border.
253
+
254
+ Windows HC mode (and the CSS `forced-colors: active` media query) strips every custom `background-color`, `border-color`, and `box-shadow` and remaps text/icons to a small palette of system colors. Progress bars, pills, chart legends, avg-markers, and any "color-only" indicator collapse into a single flat rectangle if you rely purely on tokens like `bg-brand` or `bg-muted`.
255
+
256
+ **Rule:** for every UI that encodes state **via fill / track color** (progress bars, quota gauges, chart ranges, meter pills, status pills, dashed reference lines):
257
+
258
+ 1. Keep the default `bg-*` tokens for light/dark themes.
259
+ 2. Add `forced-colors:` variants mapping to system colors:
260
+ - **Track / container:** `forced-colors:bg-[Canvas] forced-colors:border forced-colors:border-[CanvasText]`
261
+ - **Active fill / progress:** `forced-colors:bg-[Highlight]` (text on it → `forced-colors:text-[HighlightText]`)
262
+ - **Dashed marker / divider:** `forced-colors:border-[CanvasText]`
263
+ - **Tooltip / pill on colored bg:** `forced-colors:bg-[Canvas] forced-colors:text-[CanvasText] forced-colors:border forced-colors:border-[CanvasText]`
264
+ - **Disabled state:** `forced-colors:text-[GrayText]`
265
+ 3. Never rely on `box-shadow` alone for separation in HC — shadows are suppressed; pair with a border.
266
+
267
+ Reference fix: `components/dashboard-quota-progress-card.tsx` `StudentScoreProgressRow` — track → `Canvas`, fill → `Highlight`, avg-marker pill → `Canvas` + `CanvasText` border.
268
+
269
+ ## Audit rules to track (examples)
270
+
271
+ | Severity | Rule | Criterion |
272
+ |----------|------|-----------|
273
+ | Critical | Certain ARIA roles must contain particular children | 1.3.1 |
274
+ | Serious | Touch targets must be ≥24px or spaced accordingly | 2.5.8 |
275
+
276
+ When fixing, re-run **axe** or your preferred checker on the **Placements** page after changing the Views toolbar.
277
+
278
+ ## Charts (keyboard exploration)
279
+
280
+ - **Chart region:** Product charts that support arrow-key exploration use **`ChartFigure`** (`role="application"`, focus ring on the chart container, click-or-Tab to focus per `charts-overview`).
281
+ - **Selected datum:** Prefer **visible** feedback that matches the **`/dashboard` gallery** — Recharts **`activeBar`** + **`activeIndex`** for bars, **`activeShape`** + **`activeIndex`** for pies — via **`@/lib/chart-keyboard-selection`**. Avoid relying on **opacity-only** dimming as the only “selected” indicator; pair with ring/stroke so focus is perceivable (WCAG **2.4.7 Focus Visible** where applicable).
282
+ - **Tables under charts:** **`ChartDataTable`** (`sr-only`) provides an equivalent programmatic structure for screen-reader users.
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: exxat-board-cards
3
+ description: >-
4
+ Build and maintain kanban board cards in Exxat DS — ListPageBoardCard shell, title/avatar/badge/body hierarchy, BoardCardTwoLineBlock, list-status-badges, ListPageBoardTemplate. Use when adding board view, Team/Compliance/Placements cards, or status chips on cards.
5
+ user-invocable: true
6
+ ---
7
+
8
+ # Exxat DS — board (kanban) cards
9
+
10
+ **Canonical MUST/MUST NOT:** **`exxat-ds/AGENTS.md` §4.4** (or **`./AGENTS.md`** when the workspace is the `exxat-ds` app folder only). **Claude:** **`.claude/skills/exxat-board-cards/SKILL.md`** (repo root) or **`exxat-ds/.claude/skills/exxat-board-cards/SKILL.md`** (app-only workspace) — same body as this file. This skill is the **how-to**; the handbook stays the contract.
11
+
12
+ ## When to use this skill
13
+
14
+ - Adding or changing **`viewType === "board"`** on a **`ListPageTemplate`** hub.
15
+ - Building a new **`EntityBoardView`** or **`renderCard`** for **`ListPageBoardTemplate`**.
16
+ - Aligning **Team** / **Compliance** board cards with **Placements**.
17
+ - Wiring **status** on cards so it matches **table** and **list** views.
18
+
19
+ ## Shell: `ListPageBoardCard`
20
+
21
+ Import from **`@/components/data-views/list-page-board-card`**:
22
+
23
+ | Part | Component | Role |
24
+ |------|-----------|------|
25
+ | Outer | **`ListPageBoardCard`** | **`Card` `size="sm"`**; pass **`onClick`**, **`isNew`**, **`style`** (e.g. conditional row bg) like **`BoardPlacementCard`**. |
26
+ | Header wrapper | **`ListPageBoardCardHeader`** | Vertical rhythm inside the card. |
27
+ | Title row | **`ListPageBoardCardTitleRow`** | **`title`** + optional **`trailing`** + **`titleClassName`** (`truncate`, `line-clamp-2`, **`lineClampClass`**). |
28
+ | Avatar | **`ListPageBoardCardAvatar`** | **`initials`** string; **`size-7`**, **`--avatar-initials-bg` / `--avatar-initials-fg`**. |
29
+ | Status / tags | **`ListPageBoardCardBadgeRow`** | **`ListHubStatusBadge`** **`surface="board"`** (+ maps from **`lib/list-status-badges.ts`**) — **not** raw status text or one-off **`Badge`** markup in the body. |
30
+ | Body | **`ListPageBoardCardBody`** | Icon rows and two-line blocks (facts). |
31
+ | Hint | **`ListPageBoardCardSecondary`** | Empty states / helper copy. |
32
+
33
+ ## Primitives: `board-card-primitives.tsx`
34
+
35
+ - **`BoardCardTwoLineBlock`** — icon + **primary** line (`font-medium text-foreground`) + optional **secondary** (muted). Omit **`line2`** for a single-line fact row.
36
+ - **`BoardCardIconRow`** — when mirroring rich **table cells** (see **`BoardPlacementCard`**).
37
+ - **`lineClampClass`** — pass into title or cell wrappers when density options apply.
38
+ - **`BoardNewCardPlaceholder`** — column chrome for **`ListPageBoardTemplate`**.
39
+
40
+ Prefer **two-line blocks** for stacked **primary / secondary** facts so cards match Placements’ visual rhythm.
41
+
42
+ ## Status badges (list hubs: Team, Compliance, Question bank, …)
43
+
44
+ - **Maps (single source):** **`lib/list-status-badges.ts`** — per-entity `*_STATUS_LABEL`, `*_STATUS_BADGE_CLASS`, `*_STATUS_ICON`, plus semantic **`LIST_HUB_STATUS_TINT_*`** (success / warning / neutral / danger) for new domains.
45
+ - **Component:** **`ListHubStatusBadge`** from **`@/components/list-hub-status-badge`** — **`surface="table"`** for **DataTable** cells and **list** rows; **`surface="board"`** inside **`ListPageBoardCardBadgeRow`**. Do not duplicate the shell classes on each page.
46
+ - Use the **same** maps everywhere for that entity so copy and colors never drift.
47
+ - **Do not** add **`uppercase`** or **`tracking-wide`** — **sentence / title case**, consistent with **`BoardStatusBadge`** on Placements (`placement-board-card.tsx`).
48
+ - **Placements** lifecycle uses **`StatusBadge`** in **`data-list-table-cells.tsx`** — thin wrapper over **`ListHubStatusBadge`** + **`PLACEMENT_STATUS_*`** in **`list-status-badges.ts`** (same visuals as Team / Question bank).
49
+
50
+ ## Avatar when mock has no `initials`
51
+
52
+ Use **`initialsFromDisplayName`** from **`lib/initials-from-name.ts`** (e.g. compliance **owner** name).
53
+
54
+ ## Column template (simple hubs)
55
+
56
+ **`ListPageBoardTemplate`** (`list-page-board-template.tsx`) — define **`ListPageBoardColumnDef<T>`** (`id`, `label`, `description`, **`filter`**, **`renderCard`**). Placements uses a **custom** board with richer headers; new hubs usually start here.
57
+
58
+ ## Placements
59
+
60
+ **`BoardPlacementCard`** (`placement-board-card.tsx`) — domain-specific (lifecycle tabs, **`ColumnDef`**, conditional background). It **still** composes **`ListPageBoardCard`** parts and primitives; copy that structure for new dense entities.
61
+
62
+ ## Checklist
63
+
64
+ - [ ] **`ListPageBoardCard`** (not one-off button/card markup).
65
+ - [ ] Title row; avatar when product shows a person/owner chip.
66
+ - [ ] Status in **`ListPageBoardCardBadgeRow`** with **`ListHubStatusBadge`** **`surface="board"`** + **`list-status-badges`** (if entity has status).
67
+ - [ ] Body facts via **`BoardCardTwoLineBlock`** / **`BoardCardIconRow`**.
68
+ - [ ] No **`uppercase`** on status **`Badge`** labels.