@aiquants/console-ui 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBEDKWWJCcjs = require('./chunk-BEDKWWJC.cjs');var R=/color|background|fill|stroke|shadow|^border(?:-(?:top|right|bottom|left|block|inline)(?:-(?:start|end))?)?$|^border-image|^(?:outline|text-decoration|column-rule|text-emphasis|opacity)$|filter$|blend-mode$/,y=s=>{let e=s.style,o=[];for(let t=0;t<e.length;t+=1){let r=e.item(t);R.test(r)&&o.push(r)}return o},$= exports.scanColourRoles =s=>{let e=[],o=new Set,t=0,r=s.ownerDocument.createTreeWalker(s,NodeFilter.SHOW_TEXT);for(let l=r.nextNode();l!==null;l=r.nextNode()){let a=l.data.trim();if(a==="")continue;t+=1;let d=l.parentElement,i=d.closest("[data-cui-fg]"),c=d.closest("[data-cui-surface]");if(i===null||c===null){e.push(`\u5F79\u5272\u306E\u7121\u3044\u6587\u5B57: ${a}`);continue}let u=i.getAttribute("data-cui-fg"),f=c.getAttribute("data-cui-surface");if(!(Object.hasOwn(_chunkBEDKWWJCcjs.d,u)&&Object.hasOwn(_chunkBEDKWWJCcjs.d[u],f))){e.push(`\u8868\u306B\u7121\u3044\u7D44: ${a}: ${u} on ${f}`);continue}let g=i.contains(c)?i:c;for(let n=d;n!==null;n=n.parentElement){let p=y(n);if(p.length>0&&e.push(`\u30A4\u30F3\u30E9\u30A4\u30F3\u306E\u8272: ${a} \u306E ${n.tagName} \u306E ${p.join(", ")}`),n===g)break}o.add(`${u}/${f}`)}return{failures:e,measured:o,texts:t}};exports.scanColourRoles = $;
@@ -0,0 +1,7 @@
1
+ type RoleScanResult = {
2
+ readonly failures: readonly string[];
3
+ readonly measured: ReadonlySet<string>;
4
+ readonly texts: number;
5
+ };
6
+ declare const scanColourRoles: (root: Element) => RoleScanResult;
7
+ export { type RoleScanResult, scanColourRoles };
@@ -0,0 +1,7 @@
1
+ type RoleScanResult = {
2
+ readonly failures: readonly string[];
3
+ readonly measured: ReadonlySet<string>;
4
+ readonly texts: number;
5
+ };
6
+ declare const scanColourRoles: (root: Element) => RoleScanResult;
7
+ export { type RoleScanResult, scanColourRoles };
@@ -0,0 +1 @@
1
+ import{d as m}from"./chunk-MYMCHY7C.js";var R=/color|background|fill|stroke|shadow|^border(?:-(?:top|right|bottom|left|block|inline)(?:-(?:start|end))?)?$|^border-image|^(?:outline|text-decoration|column-rule|text-emphasis|opacity)$|filter$|blend-mode$/,y=s=>{let e=s.style,o=[];for(let t=0;t<e.length;t+=1){let r=e.item(t);R.test(r)&&o.push(r)}return o},$=s=>{let e=[],o=new Set,t=0,r=s.ownerDocument.createTreeWalker(s,NodeFilter.SHOW_TEXT);for(let l=r.nextNode();l!==null;l=r.nextNode()){let a=l.data.trim();if(a==="")continue;t+=1;let d=l.parentElement,i=d.closest("[data-cui-fg]"),c=d.closest("[data-cui-surface]");if(i===null||c===null){e.push(`\u5F79\u5272\u306E\u7121\u3044\u6587\u5B57: ${a}`);continue}let u=i.getAttribute("data-cui-fg"),f=c.getAttribute("data-cui-surface");if(!(Object.hasOwn(m,u)&&Object.hasOwn(m[u],f))){e.push(`\u8868\u306B\u7121\u3044\u7D44: ${a}: ${u} on ${f}`);continue}let g=i.contains(c)?i:c;for(let n=d;n!==null;n=n.parentElement){let p=y(n);if(p.length>0&&e.push(`\u30A4\u30F3\u30E9\u30A4\u30F3\u306E\u8272: ${a} \u306E ${n.tagName} \u306E ${p.join(", ")}`),n===g)break}o.add(`${u}/${f}`)}return{failures:e,measured:o,texts:t}};export{$ as scanColourRoles};
package/package.json ADDED
@@ -0,0 +1,105 @@
1
+ {
2
+ "name": "@aiquants/console-ui",
3
+ "version": "0.1.0",
4
+ "description": "Host-agnostic UI foundation for React admin consoles, with a React entry, a React-free core entry, a DOM testing entry and a stylesheet.",
5
+ "sideEffects": [
6
+ "**/*.css"
7
+ ],
8
+ "type": "module",
9
+ "main": "./dist/index.cjs",
10
+ "module": "./dist/index.js",
11
+ "types": "./dist/index.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "import": {
15
+ "types": "./dist/index.d.ts",
16
+ "default": "./dist/index.js"
17
+ },
18
+ "require": {
19
+ "types": "./dist/index.d.cts",
20
+ "default": "./dist/index.cjs"
21
+ }
22
+ },
23
+ "./core": {
24
+ "import": {
25
+ "types": "./dist/core.d.ts",
26
+ "default": "./dist/core.js"
27
+ },
28
+ "require": {
29
+ "types": "./dist/core.d.cts",
30
+ "default": "./dist/core.cjs"
31
+ }
32
+ },
33
+ "./testing": {
34
+ "import": {
35
+ "types": "./dist/testing.d.ts",
36
+ "default": "./dist/testing.js"
37
+ },
38
+ "require": {
39
+ "types": "./dist/testing.d.cts",
40
+ "default": "./dist/testing.cjs"
41
+ }
42
+ },
43
+ "./styles/console-ui.css": "./dist/styles/console-ui.css"
44
+ },
45
+ "files": [
46
+ "dist",
47
+ "README.md",
48
+ "LICENSE"
49
+ ],
50
+ "keywords": [
51
+ "react",
52
+ "design-tokens",
53
+ "css-custom-properties",
54
+ "container-queries",
55
+ "wcag",
56
+ "accessibility",
57
+ "admin-console",
58
+ "typescript"
59
+ ],
60
+ "author": "AI Quants",
61
+ "license": "MIT",
62
+ "peerDependencies": {
63
+ "react": ">=19",
64
+ "react-dom": ">=19"
65
+ },
66
+ "devDependencies": {
67
+ "@testing-library/jest-dom": "^6.9.1",
68
+ "@testing-library/react": "^16.3.2",
69
+ "@testing-library/user-event": "^14.6.1",
70
+ "@types/node": "^25.0.3",
71
+ "@types/react": "^19.2.7",
72
+ "@types/react-dom": "^19.2.3",
73
+ "@vitest/coverage-v8": "^4.1.8",
74
+ "jsdom": "^27.4.0",
75
+ "postcss": "^8.5.6",
76
+ "react": "^19.2.7",
77
+ "react-dom": "^19.2.7",
78
+ "rimraf": "^6.1.2",
79
+ "tsup": "^8.5.1",
80
+ "typescript": "^5.9.3",
81
+ "vitest": "^4.1.10"
82
+ },
83
+ "engines": {
84
+ "node": ">=18.0.0",
85
+ "pnpm": ">=8.0.0"
86
+ },
87
+ "publishConfig": {
88
+ "access": "public"
89
+ },
90
+ "scripts": {
91
+ "build": "tsup && node ../../.config/scripts/strip-dts-comments.mjs dist",
92
+ "build:watch": "tsup --watch",
93
+ "dev": "tsup --watch",
94
+ "publish:patch": "pnpm run typecheck && pnpm run --if-present test && pnpm version patch --no-git-tag-version --no-git-checks && pnpm publish --no-git-checks",
95
+ "publish:minor": "pnpm run typecheck && pnpm run --if-present test && pnpm version minor --no-git-tag-version --no-git-checks && pnpm publish --no-git-checks",
96
+ "publish:major": "pnpm run typecheck && pnpm run --if-present test && pnpm version major --no-git-tag-version --no-git-checks && pnpm publish --no-git-checks",
97
+ "typecheck": "tsc --noEmit",
98
+ "clean": "rimraf dist",
99
+ "lint": "biome lint src/",
100
+ "check": "biome check src/ tests/",
101
+ "check:fix": "biome check --write src/ tests/",
102
+ "test": "vitest run",
103
+ "test:coverage": "vitest run --coverage"
104
+ }
105
+ }