@santi020k/lumen 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/cli.js +2 -6
- package/dist/consumer-rollout.d.ts +6 -1
- package/dist/consumer-rollout.d.ts.map +1 -1
- package/dist/consumer-rollout.js +21 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/integration-diagnostics.d.ts.map +1 -1
- package/dist/integration-diagnostics.js +186 -55
- package/dist/registry-data.d.ts +26 -1
- package/dist/registry-data.d.ts.map +1 -1
- package/dist/registry-data.js +55 -1
- package/package.json +11 -3
- package/styles.css +123 -4
package/README.md
CHANGED
|
@@ -55,7 +55,9 @@ Complete product recipes are also bundled for `analytics-dashboard`, `saas-admin
|
|
|
55
55
|
`dashboard-shell`, and `validated-form`.
|
|
56
56
|
|
|
57
57
|
Run `lumen doctor` to check adapter/style agreement, Tailwind layer order, Astro runtime mounts,
|
|
58
|
-
and fragile internal selector dependencies.
|
|
58
|
+
and fragile internal selector dependencies. In a workspace, diagnostics are scoped to the nearest
|
|
59
|
+
package boundary, generated build trees are ignored, and application-controlled Astro `Toggle`
|
|
60
|
+
instances do not require the shared runtime. Use `--json` for CI and rollout automation. `lumen
|
|
59
61
|
init --framework <astro|react|elements> [--tailwind]` prints the canonical non-destructive setup.
|
|
60
62
|
|
|
61
63
|
Run `lumen audit-tokens [path]` before incremental adoption when an existing stylesheet may already
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readdir, readFile, stat } from 'node:fs/promises';
|
|
2
2
|
import { resolve } from 'node:path';
|
|
3
|
-
import { consumerRolloutSucceeded, formatConsumerRollout, runConsumerRollout } from './consumer-rollout.js';
|
|
3
|
+
import { consumerRolloutSucceeded, formatConsumerRollout, resolveConsumerRolloutTargets, runConsumerRollout } from './consumer-rollout.js';
|
|
4
4
|
import { createLumenSetup, formatLumenDiagnostics, inspectLumenIntegration } from './integration-diagnostics.js';
|
|
5
5
|
import { addLumenRegistryItem, getLumenRegistryEntries, getLumenRegistryItem, loadLumenRegistry, lumenRegistry } from './registry.js';
|
|
6
6
|
import { auditLumenTokenCss } from './token-audit.js';
|
|
@@ -47,11 +47,7 @@ const getRolloutArguments = () => {
|
|
|
47
47
|
if (!value.startsWith('--'))
|
|
48
48
|
values.push(value);
|
|
49
49
|
}
|
|
50
|
-
|
|
51
|
-
return {
|
|
52
|
-
repositories: repositories.length ? repositories : [process.cwd()],
|
|
53
|
-
...(targetVersion ? { targetVersion } : {})
|
|
54
|
-
};
|
|
50
|
+
return resolveConsumerRolloutTargets(values);
|
|
55
51
|
};
|
|
56
52
|
const getAddTarget = (value, provided = false) => {
|
|
57
53
|
if (provided && !value) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type LumenDiagnosticReport } from './integration-diagnostics.js';
|
|
2
|
-
export type LumenFramework = 'astro' | 'elements' | 'react';
|
|
2
|
+
export type LumenFramework = 'astro' | 'elements' | 'react' | 'react-native';
|
|
3
3
|
export interface ConsumerReference {
|
|
4
4
|
file: string;
|
|
5
5
|
packageName: string;
|
|
@@ -43,7 +43,12 @@ export interface ConsumerRolloutReport {
|
|
|
43
43
|
})[];
|
|
44
44
|
targetVersion?: string;
|
|
45
45
|
}
|
|
46
|
+
export interface ConsumerRolloutTargets {
|
|
47
|
+
repositories: string[];
|
|
48
|
+
targetVersion?: string;
|
|
49
|
+
}
|
|
46
50
|
export declare const consumerRolloutSucceeded: (report: ConsumerRolloutReport) => boolean;
|
|
51
|
+
export declare const resolveConsumerRolloutTargets: (values: string[], currentDirectory?: string) => ConsumerRolloutTargets;
|
|
47
52
|
export declare const satisfiesNodeEngine: (engine: string | undefined, currentVersion?: string) => boolean | undefined;
|
|
48
53
|
export declare const inspectLumenConsumer: (repository: string, targetVersion?: string) => Promise<ConsumerInventory>;
|
|
49
54
|
export declare const updateLumenManifestSource: (source: string, targetVersion: string) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consumer-rollout.d.ts","sourceRoot":"","sources":["../src/consumer-rollout.ts"],"names":[],"mappings":"AAOA,OAAO,EAA2B,KAAK,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"consumer-rollout.d.ts","sourceRoot":"","sources":["../src/consumer-rollout.ts"],"names":[],"mappings":"AAOA,OAAO,EAA2B,KAAK,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AAuBlG,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,UAAU,GAAG,OAAO,GAAG,cAAc,CAAA;AAE5E,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,CAAA;IAC3C,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,aAAa,EAAE,MAAM,GAAG,SAAS,CAAA;IACjC,KAAK,EAAE,OAAO,CAAA;IACd,UAAU,EAAE,cAAc,EAAE,CAAA;IAC5B,WAAW,EAAE,qBAAqB,CAAA;IAClC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAA;IAC9B,mBAAmB,EAAE,OAAO,GAAG,SAAS,CAAA;IACxC,cAAc,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC,UAAU,EAAE,iBAAiB,EAAE,CAAA;IAC/B,UAAU,EAAE,MAAM,CAAA;IAClB,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;IAC1C,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,EAAE,OAAO,CAAA;IACd,QAAQ,EAAE,MAAM,EAAE,CAAA;CACnB;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,CAAC,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AAmB,GAAI,QAAQ,MAAM,EAAE,UAAU,MAAM,EAAE,EAAE,SAAS,MAAM,KAAG,MAoCzF,CAAA;AAsGD,eAAO,MAAM,kBAAkB,GAAU,SAAS,sBAAsB,KAAG,OAAO,CAAC,qBAAqB,CAwCvG,CAAA;AAED,eAAO,MAAM,qBAAqB,GAAI,QAAQ,qBAAqB,KAAG,MAqBrE,CAAA"}
|
package/dist/consumer-rollout.js
CHANGED
|
@@ -2,14 +2,27 @@ import { execFile } from 'node:child_process';
|
|
|
2
2
|
import { readdir, readFile, stat, writeFile } from 'node:fs/promises';
|
|
3
3
|
import { join, relative, resolve } from 'node:path';
|
|
4
4
|
import { promisify } from 'node:util';
|
|
5
|
-
import { satisfies } from 'semver';
|
|
5
|
+
import { satisfies, valid } from 'semver';
|
|
6
6
|
import { inspectLumenIntegration } from './integration-diagnostics.js';
|
|
7
7
|
/* eslint-disable complexity -- Consumer inventory, semver checks, mutation, and verification intentionally evaluate full repository contracts. */
|
|
8
8
|
const execFileAsync = promisify(execFile);
|
|
9
|
-
const
|
|
9
|
+
const lumenPackageSuffixPattern = '(?:astro|core|elements|icons-brand|mcp|react(?:-hook-form|-native)?|tokens)';
|
|
10
|
+
const lumenPackageNamePattern = `@santi020k/lumen(?:-${lumenPackageSuffixPattern})?`;
|
|
11
|
+
const lumenPackagePattern = new RegExp(`^${lumenPackageNamePattern}$`);
|
|
12
|
+
const lumenYamlReferencePattern = new RegExp(`^\\s*['"]?(${lumenPackageNamePattern})['"]?\\s*:\\s*['"]?([^'"\\s#]+)['"]?`);
|
|
13
|
+
const lumenLockReferencePattern = new RegExp(`@santi020k/(lumen(?:-${lumenPackageSuffixPattern})?)@(\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?)`, 'g');
|
|
10
14
|
const dependencyFields = ['dependencies', 'devDependencies', 'optionalDependencies', 'peerDependencies'];
|
|
11
15
|
export const consumerRolloutSucceeded = (report) => report.repositories.every(repository => repository.valid && repository.commands.every(command => command.ok));
|
|
12
16
|
const isLumenPackage = (name) => lumenPackagePattern.test(name);
|
|
17
|
+
export const resolveConsumerRolloutTargets = (values, currentDirectory = process.cwd()) => {
|
|
18
|
+
const [firstValue, ...remainingValues] = values;
|
|
19
|
+
const targetVersion = firstValue && valid(firstValue) ? firstValue : undefined;
|
|
20
|
+
const repositories = targetVersion ? remainingValues : values;
|
|
21
|
+
return {
|
|
22
|
+
repositories: repositories.length ? repositories : [currentDirectory],
|
|
23
|
+
...(targetVersion ? { targetVersion } : {})
|
|
24
|
+
};
|
|
25
|
+
};
|
|
13
26
|
const pathExists = async (path) => {
|
|
14
27
|
try {
|
|
15
28
|
await stat(path);
|
|
@@ -64,7 +77,7 @@ const collectManifestReferences = (manifest, file, root) => dependencyFields.fla
|
|
|
64
77
|
const collectYamlReferences = (source, file) => {
|
|
65
78
|
const references = [];
|
|
66
79
|
for (const line of source.split(/\r?\n/)) {
|
|
67
|
-
const match =
|
|
80
|
+
const match = lumenYamlReferencePattern.exec(line);
|
|
68
81
|
if (match?.[1] && match[2]) {
|
|
69
82
|
references.push({ file, packageName: match[1], source: 'catalog', version: match[2] });
|
|
70
83
|
}
|
|
@@ -73,8 +86,7 @@ const collectYamlReferences = (source, file) => {
|
|
|
73
86
|
};
|
|
74
87
|
const collectLockReferences = (source) => {
|
|
75
88
|
const references = [];
|
|
76
|
-
const
|
|
77
|
-
for (const match of source.matchAll(pattern)) {
|
|
89
|
+
for (const match of source.matchAll(lumenLockReferencePattern)) {
|
|
78
90
|
if (match[1] && match[2]) {
|
|
79
91
|
references.push({
|
|
80
92
|
file: 'pnpm-lock.yaml',
|
|
@@ -119,7 +131,8 @@ export const inspectLumenConsumer = async (repository, targetVersion) => {
|
|
|
119
131
|
const frameworks = [
|
|
120
132
|
references.some(item => item.packageName === '@santi020k/lumen-astro') && 'astro',
|
|
121
133
|
references.some(item => item.packageName === '@santi020k/lumen-elements') && 'elements',
|
|
122
|
-
references.some(item => item.packageName === '@santi020k/lumen-react') && 'react'
|
|
134
|
+
references.some(item => item.packageName === '@santi020k/lumen-react') && 'react',
|
|
135
|
+
references.some(item => item.packageName === '@santi020k/lumen-react-native') && 'react-native'
|
|
123
136
|
].filter(Boolean);
|
|
124
137
|
const warnings = [];
|
|
125
138
|
const integration = await inspectLumenIntegration(root);
|
|
@@ -192,9 +205,10 @@ const lumenWorkspaceVersionPattern = new RegExp([
|
|
|
192
205
|
export const updateLumenWorkspaceSource = (source, targetVersion) => source.replaceAll(lumenWorkspaceVersionPattern, (_match, before, prefix, _version, after) => `${before}${prefix}${targetVersion}${after}`);
|
|
193
206
|
const getVerificationScripts = (manifest, frameworks) => {
|
|
194
207
|
const scripts = manifest.scripts ?? {};
|
|
208
|
+
const shouldTypecheck = frameworks.some(framework => ['elements', 'react', 'react-native'].includes(framework));
|
|
195
209
|
const preferred = [
|
|
196
210
|
frameworks.includes('astro') && 'check',
|
|
197
|
-
|
|
211
|
+
shouldTypecheck && 'typecheck',
|
|
198
212
|
'build',
|
|
199
213
|
scripts['test:browser'] && 'test:browser',
|
|
200
214
|
scripts['test:e2e'] && 'test:e2e'
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { type ConsumerInventory, type ConsumerReference, type ConsumerRolloutOptions, type ConsumerRolloutReport, formatConsumerRollout, inspectLumenConsumer, type LumenFramework, runConsumerRollout, updateLumenManifestSource, updateLumenWorkspaceSource } from './consumer-rollout.js';
|
|
2
2
|
export { addLumenRegistryItem, getLumenRegistryEntries, getLumenRegistryItem, loadLumenRegistry, type LumenAddOptions, type LumenAddResult, type LumenAddTarget, type LumenMergeConflict, type LumenRegistry, lumenRegistry, type LumenRegistryComponent, type LumenRegistryEntry, type LumenRegistryFile, type LumenRegistryItem, type LumenRegistryLoadOptions } from './registry.js';
|
|
3
|
-
export { alignLumenChartSeries, applyDataViewState, canPlaceScheduleEvent, coerceThemeBuilderExportFormat, coerceThemeBuilderMode, coerceThemeBuilderScheme, composeClassName, createDataViewRequestUrl, createDataViewSearchParams, createDataViewServerRequest, createDataViewState, createDataViewStorageKey, createLumenBarGeometry, createLumenFormFailure, createLumenFormSuccess, createLumenLineGeometry, createLumenPieGeometry, createScheduleSlots, createScheduleStorageKey, createThemeBuilderTokens, createThemePalette, expandRecurringScheduleEvent, exportThemeBuilderCss, exportThemeBuilderValue, exportThemeCss, filterDataRecords, getContrastRatio, getLumenChartCategories, getLumenChartDomain, getLumenChartTicks, getLumenChartValueRatio, getLumenFieldErrors, getScheduleConflicts, getVirtualRange, hasLumenPieData, loadDataViewState, loadScheduleEvents, type LumenBarChartLayout, type LumenBarGeometry, type LumenBarGeometryCategory, type LumenBarGeometryMark, type LumenBarGeometryOptions, lumenChart, type LumenChartDatum, type LumenChartDomain, type LumenChartGeometryPoint, type LumenChartOrientation, type LumenChartSeries, type LumenChartTone, lumenChartTones, type LumenCodeToken, lumenCodeTokenClassNames, type LumenCodeTokenKind, lumenColors, type LumenColorTokenName, lumenColorTokenNames, type LumenComponentName, lumenComponentNames, type LumenContrastScore, lumenDarkTheme, type LumenDataRecord, type LumenDataViewServerRequest, type LumenDataViewState, type LumenFieldError, type LumenFormErrorInput, type LumenFormErrors, type LumenFormFailure, type LumenFormResult, type LumenFormStatus, lumenFormStatuses, type LumenFormSuccess, lumenGlass, type LumenGlassColorTokenName, lumenGlassColorTokenNames, type LumenGlassEffectTokenName, lumenGlassEffectTokenNames, type LumenGlassTokenName, lumenGlassTokenNames, type LumenKeyValueReader, type LumenKeyValueStorage, type LumenKeyValueWriter, lumenLightTheme, type LumenLineGeometry, type LumenLineGeometryOptions, lumenPackages, type LumenPackageTarget, type LumenPieChartVariant, type LumenPieGeometry, type LumenPieGeometryOptions, type LumenPieGeometrySlice, type LumenScheduleConflict, type LumenScheduleEvent, type LumenScheduleKeyValueReader, type LumenScheduleKeyValueStorage, type LumenScheduleKeyValueWriter, type LumenScheduleResizeEdge, type LumenScheduleResizeOptions, type LumenScheduleResource, type LumenScheduleSlot, type LumenSemanticColorTokenName, lumenSemanticColorTokenNames, type LumenSortDirection, lumenThemeAttribute, type LumenThemeBuilderExportFormat, type LumenThemeBuilderMode, type LumenThemeBuilderOptions, type LumenThemeBuilderResult, type LumenThemeBuilderScheme, type LumenThemeContrastSuggestion, type LumenThemeTokens, lumenTokenNames, mergeThemeTokens, moveScheduleEvent, normalizeLumenCode, normalizeLumenFormErrors, normalizeThemeBuilderHex, normalizeThemeBuilderHue, paginateDataRecords, parseDataViewState, parseScheduleEvents, parseThemeCss, pinDataViewColumn, renderLumenCodeHtml, resizeScheduleEvent, resizeScheduleEvents, resolveLumenChartTone, saveDataViewState, saveScheduleEvents, scaleLumenChartValue, scheduleEventsOverlap, scoreThemeContrast, serializeDataViewState, serializeScheduleEvents, sortDataRecords, suggestReadableInk, themeBuilderHexToHsl, toggleDataViewSelection, tokenizeLumenCode, tuneThemeContrast, unpinDataViewColumn } from '@santi020k/lumen-core';
|
|
3
|
+
export { alignLumenChartSeries, applyDataViewState, canPlaceScheduleEvent, coerceThemeBuilderExportFormat, coerceThemeBuilderMode, coerceThemeBuilderScheme, composeClassName, createDataViewRequestUrl, createDataViewSearchParams, createDataViewServerRequest, createDataViewState, createDataViewStorageKey, createLumenBarGeometry, createLumenFormFailure, createLumenFormSuccess, createLumenLineGeometry, createLumenPieGeometry, createScheduleSlots, createScheduleStorageKey, createThemeBuilderTokens, createThemePalette, expandRecurringScheduleEvent, exportThemeBuilderCss, exportThemeBuilderValue, exportThemeCss, filterDataRecords, getContrastRatio, getLumenChartCategories, getLumenChartDomain, getLumenChartTicks, getLumenChartValueRatio, getLumenFieldErrors, getScheduleConflicts, getVirtualRange, hasLumenPieData, loadDataViewState, loadScheduleEvents, type LumenBarChartLayout, type LumenBarGeometry, type LumenBarGeometryCategory, type LumenBarGeometryMark, type LumenBarGeometryOptions, lumenChart, type LumenChartDatum, type LumenChartDomain, type LumenChartGeometryPoint, type LumenChartOrientation, type LumenChartSeries, type LumenChartTone, lumenChartTones, type LumenCodeToken, lumenCodeTokenClassNames, type LumenCodeTokenKind, lumenColors, type LumenColorScheme, type LumenColorTokenName, lumenColorTokenNames, lumenColorTokens, type LumenComponentName, lumenComponentNames, type LumenContrastScore, lumenCssColorTokens, lumenDarkColors, lumenDarkTheme, type LumenDataRecord, type LumenDataViewServerRequest, type LumenDataViewState, lumenDurations, lumenEasings, lumenElevation, type LumenFieldError, lumenFontFamilies, lumenFontSizes, lumenFontWeights, type LumenFormErrorInput, type LumenFormErrors, type LumenFormFailure, type LumenFormResult, type LumenFormStatus, lumenFormStatuses, type LumenFormSuccess, lumenGlass, type LumenGlassColorTokenName, lumenGlassColorTokenNames, type LumenGlassEffectTokenName, lumenGlassEffectTokenNames, type LumenGlassTokenName, lumenGlassTokenNames, type LumenKeyValueReader, type LumenKeyValueStorage, type LumenKeyValueWriter, lumenLightTheme, type LumenLineGeometry, type LumenLineGeometryOptions, lumenPackages, type LumenPackageTarget, type LumenPieChartVariant, type LumenPieGeometry, type LumenPieGeometryOptions, type LumenPieGeometrySlice, lumenRadii, type LumenScheduleConflict, type LumenScheduleEvent, type LumenScheduleKeyValueReader, type LumenScheduleKeyValueStorage, type LumenScheduleKeyValueWriter, type LumenScheduleResizeEdge, type LumenScheduleResizeOptions, type LumenScheduleResource, type LumenScheduleSlot, type LumenSemanticColor, type LumenSemanticColorTokenName, lumenSemanticColorTokenNames, type LumenSortDirection, lumenSpacing, lumenThemeAttribute, type LumenThemeBuilderExportFormat, type LumenThemeBuilderMode, type LumenThemeBuilderOptions, type LumenThemeBuilderResult, type LumenThemeBuilderScheme, type LumenThemeContrastSuggestion, type LumenThemeTokens, lumenTokenNames, mergeThemeTokens, moveScheduleEvent, normalizeLumenCode, normalizeLumenFormErrors, normalizeThemeBuilderHex, normalizeThemeBuilderHue, paginateDataRecords, parseDataViewState, parseScheduleEvents, parseThemeCss, pinDataViewColumn, renderLumenCodeHtml, resizeScheduleEvent, resizeScheduleEvents, resolveLumenChartTone, saveDataViewState, saveScheduleEvents, scaleLumenChartValue, scheduleEventsOverlap, scoreThemeContrast, serializeDataViewState, serializeScheduleEvents, sortDataRecords, suggestReadableInk, themeBuilderHexToHsl, toggleDataViewSelection, tokenizeLumenCode, tuneThemeContrast, unpinDataViewColumn } from '@santi020k/lumen-core';
|
|
4
4
|
export declare const lumen: {
|
|
5
5
|
readonly name: "Lumen";
|
|
6
6
|
readonly packageName: "@santi020k/lumen";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,qBAAqB,EACrB,oBAAoB,EACpB,KAAK,cAAc,EACnB,kBAAkB,EAClB,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,EACjB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,aAAa,EACb,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC9B,MAAM,eAAe,CAAA;AACtB,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,8BAA8B,EAC9B,sBAAsB,EACtB,wBAAwB,EACxB,gBAAgB,EAChB,wBAAwB,EACxB,0BAA0B,EAC1B,2BAA2B,EAC3B,mBAAmB,EACnB,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,EACxB,kBAAkB,EAClB,4BAA4B,EAC5B,qBAAqB,E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4BAA4B,EACjC,KAAK,gBAAgB,EACrB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,uBAAuB,CAAA;AAE9B,eAAO,MAAM,KAAK;;;;CAIR,CAAA;AAEV,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC7B,MAAM,8BAA8B,CAAA;AACrC,OAAO,EACL,kBAAkB,EAClB,KAAK,sBAAsB,EAC5B,MAAM,kBAAkB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { formatConsumerRollout, inspectLumenConsumer, runConsumerRollout, updateLumenManifestSource, updateLumenWorkspaceSource } from './consumer-rollout.js';
|
|
2
2
|
export { addLumenRegistryItem, getLumenRegistryEntries, getLumenRegistryItem, loadLumenRegistry, lumenRegistry } from './registry.js';
|
|
3
|
-
export { alignLumenChartSeries, applyDataViewState, canPlaceScheduleEvent, coerceThemeBuilderExportFormat, coerceThemeBuilderMode, coerceThemeBuilderScheme, composeClassName, createDataViewRequestUrl, createDataViewSearchParams, createDataViewServerRequest, createDataViewState, createDataViewStorageKey, createLumenBarGeometry, createLumenFormFailure, createLumenFormSuccess, createLumenLineGeometry, createLumenPieGeometry, createScheduleSlots, createScheduleStorageKey, createThemeBuilderTokens, createThemePalette, expandRecurringScheduleEvent, exportThemeBuilderCss, exportThemeBuilderValue, exportThemeCss, filterDataRecords, getContrastRatio, getLumenChartCategories, getLumenChartDomain, getLumenChartTicks, getLumenChartValueRatio, getLumenFieldErrors, getScheduleConflicts, getVirtualRange, hasLumenPieData, loadDataViewState, loadScheduleEvents, lumenChart, lumenChartTones, lumenCodeTokenClassNames, lumenColors, lumenColorTokenNames, lumenComponentNames, lumenDarkTheme, lumenFormStatuses, lumenGlass, lumenGlassColorTokenNames, lumenGlassEffectTokenNames, lumenGlassTokenNames, lumenLightTheme, lumenPackages, lumenSemanticColorTokenNames, lumenThemeAttribute, lumenTokenNames, mergeThemeTokens, moveScheduleEvent, normalizeLumenCode, normalizeLumenFormErrors, normalizeThemeBuilderHex, normalizeThemeBuilderHue, paginateDataRecords, parseDataViewState, parseScheduleEvents, parseThemeCss, pinDataViewColumn, renderLumenCodeHtml, resizeScheduleEvent, resizeScheduleEvents, resolveLumenChartTone, saveDataViewState, saveScheduleEvents, scaleLumenChartValue, scheduleEventsOverlap, scoreThemeContrast, serializeDataViewState, serializeScheduleEvents, sortDataRecords, suggestReadableInk, themeBuilderHexToHsl, toggleDataViewSelection, tokenizeLumenCode, tuneThemeContrast, unpinDataViewColumn } from '@santi020k/lumen-core';
|
|
3
|
+
export { alignLumenChartSeries, applyDataViewState, canPlaceScheduleEvent, coerceThemeBuilderExportFormat, coerceThemeBuilderMode, coerceThemeBuilderScheme, composeClassName, createDataViewRequestUrl, createDataViewSearchParams, createDataViewServerRequest, createDataViewState, createDataViewStorageKey, createLumenBarGeometry, createLumenFormFailure, createLumenFormSuccess, createLumenLineGeometry, createLumenPieGeometry, createScheduleSlots, createScheduleStorageKey, createThemeBuilderTokens, createThemePalette, expandRecurringScheduleEvent, exportThemeBuilderCss, exportThemeBuilderValue, exportThemeCss, filterDataRecords, getContrastRatio, getLumenChartCategories, getLumenChartDomain, getLumenChartTicks, getLumenChartValueRatio, getLumenFieldErrors, getScheduleConflicts, getVirtualRange, hasLumenPieData, loadDataViewState, loadScheduleEvents, lumenChart, lumenChartTones, lumenCodeTokenClassNames, lumenColors, lumenColorTokenNames, lumenColorTokens, lumenComponentNames, lumenCssColorTokens, lumenDarkColors, lumenDarkTheme, lumenDurations, lumenEasings, lumenElevation, lumenFontFamilies, lumenFontSizes, lumenFontWeights, lumenFormStatuses, lumenGlass, lumenGlassColorTokenNames, lumenGlassEffectTokenNames, lumenGlassTokenNames, lumenLightTheme, lumenPackages, lumenRadii, lumenSemanticColorTokenNames, lumenSpacing, lumenThemeAttribute, lumenTokenNames, mergeThemeTokens, moveScheduleEvent, normalizeLumenCode, normalizeLumenFormErrors, normalizeThemeBuilderHex, normalizeThemeBuilderHue, paginateDataRecords, parseDataViewState, parseScheduleEvents, parseThemeCss, pinDataViewColumn, renderLumenCodeHtml, resizeScheduleEvent, resizeScheduleEvents, resolveLumenChartTone, saveDataViewState, saveScheduleEvents, scaleLumenChartValue, scheduleEventsOverlap, scoreThemeContrast, serializeDataViewState, serializeScheduleEvents, sortDataRecords, suggestReadableInk, themeBuilderHexToHsl, toggleDataViewSelection, tokenizeLumenCode, tuneThemeContrast, unpinDataViewColumn } from '@santi020k/lumen-core';
|
|
4
4
|
export const lumen = {
|
|
5
5
|
name: 'Lumen',
|
|
6
6
|
packageName: '@santi020k/lumen',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-diagnostics.d.ts","sourceRoot":"","sources":["../src/integration-diagnostics.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"integration-diagnostics.d.ts","sourceRoot":"","sources":["../src/integration-diagnostics.ts"],"names":[],"mappings":"AAWA,MAAM,MAAM,uBAAuB,GAAG,UAAU,GAAG,OAAO,CAAA;AAE1D,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,uBAAuB,CAAA;CAClC;AAED,MAAM,WAAW,qBAAqB;IACpC,kBAAkB,EAAE,MAAM,CAAA;IAC1B,QAAQ,EAAE,sBAAsB,EAAE,CAAA;IAClC,UAAU,EAAE,CAAC,OAAO,GAAG,UAAU,GAAG,OAAO,CAAC,EAAE,CAAA;IAC9C,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,iBAAiB,EAAE,MAAM,EAAE,CAAA;CAC5B;AAoZD,eAAO,MAAM,uBAAuB,GAAU,YAAY,MAAM,KAAG,OAAO,CAAC,qBAAqB,CA6C/F,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAI,QAAQ,qBAAqB,KAAG,MAWtE,CAAA;AAED,eAAO,MAAM,gBAAgB,GAAI,WAAW,OAAO,GAAG,UAAU,GAAG,OAAO,EAAE,kBAAgB,KAAG,MAsC9F,CAAA"}
|
|
@@ -1,25 +1,48 @@
|
|
|
1
1
|
import { createHash } from 'node:crypto';
|
|
2
2
|
import { readdir, readFile, stat } from 'node:fs/promises';
|
|
3
|
-
import { extname, join, relative, resolve } from 'node:path';
|
|
4
|
-
import { lumenComponentBehavior, lumenStylingContracts } from '@santi020k/lumen-core';
|
|
3
|
+
import { extname, join, relative, resolve, sep } from 'node:path';
|
|
4
|
+
import { lumenComponentBehavior, lumenGlobalBehaviors, lumenStylingContracts } from '@santi020k/lumen-core';
|
|
5
5
|
const sourceExtensions = new Set(['.astro', '.css', '.js', '.jsx', '.mjs', '.ts', '.tsx']);
|
|
6
|
-
const ignoredDirectories = new Set([
|
|
6
|
+
const ignoredDirectories = new Set([
|
|
7
|
+
'.astro',
|
|
8
|
+
'.git',
|
|
9
|
+
'.next',
|
|
10
|
+
'.open-next',
|
|
11
|
+
'.output',
|
|
12
|
+
'.turbo',
|
|
13
|
+
'.vercel',
|
|
14
|
+
'.vite',
|
|
15
|
+
'.wrangler',
|
|
16
|
+
'build',
|
|
17
|
+
'coverage',
|
|
18
|
+
'dist',
|
|
19
|
+
'node_modules',
|
|
20
|
+
'out'
|
|
21
|
+
]);
|
|
7
22
|
const publicRootSlots = new Set(Object.values(lumenStylingContracts).flatMap(contract => [contract.rootSlot, ...contract.parts]));
|
|
8
|
-
const
|
|
9
|
-
const
|
|
23
|
+
const discoverProject = async (root) => {
|
|
24
|
+
const packageRoots = [];
|
|
25
|
+
const sourceFiles = [];
|
|
10
26
|
const visit = async (directory) => {
|
|
11
27
|
for (const entry of await readdir(directory, { withFileTypes: true })) {
|
|
12
28
|
if (ignoredDirectories.has(entry.name))
|
|
13
29
|
continue;
|
|
14
30
|
const path = join(directory, entry.name);
|
|
15
|
-
if (entry.isDirectory())
|
|
31
|
+
if (entry.isDirectory()) {
|
|
16
32
|
await visit(path);
|
|
17
|
-
|
|
18
|
-
|
|
33
|
+
}
|
|
34
|
+
else if (entry.name === 'package.json') {
|
|
35
|
+
packageRoots.push(directory);
|
|
36
|
+
}
|
|
37
|
+
else if (sourceExtensions.has(extname(entry.name))) {
|
|
38
|
+
sourceFiles.push(path);
|
|
39
|
+
}
|
|
19
40
|
}
|
|
20
41
|
};
|
|
21
42
|
await visit(root);
|
|
22
|
-
|
|
43
|
+
if (!packageRoots.includes(root))
|
|
44
|
+
packageRoots.push(root);
|
|
45
|
+
return { packageRoots, sourceFiles };
|
|
23
46
|
};
|
|
24
47
|
const importedNames = (source, packageName) => {
|
|
25
48
|
const names = [];
|
|
@@ -34,11 +57,48 @@ const importedNames = (source, packageName) => {
|
|
|
34
57
|
return names;
|
|
35
58
|
};
|
|
36
59
|
const finding = (file, rule, message, remediation, severity = 'error') => ({ file, message, remediation, rule, severity });
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
60
|
+
const packageNamePattern = String.raw `@santi020k\/lumen-(?:astro|elements|react)(?:\/[^'"]*)?`;
|
|
61
|
+
const packageReferencePattern = new RegExp(String.raw `(?:^|\n)\s*(?:export|import)\s+(?:type\s+)?(?:[^'"\n]*?\s+from\s+)?['"]` +
|
|
62
|
+
String.raw `(${packageNamePattern})['"]`, 'g');
|
|
63
|
+
const dynamicPackageReferencePattern = new RegExp(String.raw `import\(\s*['"](${packageNamePattern})['"]\s*\)`, 'g');
|
|
64
|
+
const cssPackageReferencePattern = new RegExp(String.raw `(?:^|\n)\s*@import\s+(?:url\(\s*)?['"](${packageNamePattern})['"]`, 'g');
|
|
65
|
+
const layoutFilePattern = /(?:^|\/)(?:layouts?\/[^/]+|[^/]*layout[^/]*)\.astro$/iu;
|
|
66
|
+
const getPackageReferences = (source) => [
|
|
67
|
+
...source.matchAll(packageReferencePattern),
|
|
68
|
+
...source.matchAll(dynamicPackageReferencePattern),
|
|
69
|
+
...source.matchAll(cssPackageReferencePattern)
|
|
70
|
+
].flatMap(match => match[1] ? [match[1]] : []);
|
|
71
|
+
const packageFramework = (packageName) => {
|
|
72
|
+
const framework = /^@santi020k\/lumen-(astro|elements|react)(?:\/|$)/u.exec(packageName)?.[1];
|
|
73
|
+
return framework === 'astro' || framework === 'elements' || framework === 'react' ?
|
|
74
|
+
framework :
|
|
75
|
+
undefined;
|
|
76
|
+
};
|
|
77
|
+
const getFrameworks = (sources) => [
|
|
78
|
+
...new Set(sources.flatMap(item => getPackageReferences(item.source))
|
|
79
|
+
.filter(packageName => !packageName.endsWith('/styles.css') &&
|
|
80
|
+
!packageName.endsWith('/layers.css'))
|
|
81
|
+
.flatMap(packageName => {
|
|
82
|
+
const framework = packageFramework(packageName);
|
|
83
|
+
return framework ? [framework] : [];
|
|
84
|
+
}))
|
|
85
|
+
];
|
|
86
|
+
const getBoundaryRoot = (file, packageRoots, fallback) => packageRoots
|
|
87
|
+
.filter(packageRoot => file === packageRoot || file.startsWith(`${packageRoot}${sep}`))
|
|
88
|
+
.sort((left, right) => right.length - left.length)[0] ?? fallback;
|
|
89
|
+
const createBoundaries = (root, packageRoots, sources) => {
|
|
90
|
+
const grouped = new Map();
|
|
91
|
+
for (const source of sources) {
|
|
92
|
+
const boundaryRoot = getBoundaryRoot(source.file, packageRoots, root);
|
|
93
|
+
const entries = grouped.get(boundaryRoot) ?? [];
|
|
94
|
+
entries.push(source);
|
|
95
|
+
grouped.set(boundaryRoot, entries);
|
|
96
|
+
}
|
|
97
|
+
return [...grouped].map(([boundaryRoot, boundarySources]) => ({
|
|
98
|
+
root: boundaryRoot,
|
|
99
|
+
sources: boundarySources
|
|
100
|
+
}));
|
|
101
|
+
};
|
|
42
102
|
const collectCompatibilityFindings = (root, sources) => sources.flatMap(item => {
|
|
43
103
|
const file = relative(root, item.file);
|
|
44
104
|
const findings = [];
|
|
@@ -60,25 +120,86 @@ const getCatalogFingerprint = (sources) => {
|
|
|
60
120
|
const contracts = names.map(name => [name, lumenComponentBehavior[name]]);
|
|
61
121
|
return createHash('sha256').update(JSON.stringify(contracts)).digest('hex');
|
|
62
122
|
};
|
|
63
|
-
const
|
|
64
|
-
const
|
|
65
|
-
const
|
|
123
|
+
const hasOnlyRuntimeBypassedComponents = (source, componentName, bypassAttribute) => {
|
|
124
|
+
const tagPattern = new RegExp(`<${componentName}(?=\\s|/|>)([^>]*)>`, 'g');
|
|
125
|
+
const tags = [...source.matchAll(tagPattern)];
|
|
126
|
+
const falsePattern = new RegExp(String.raw `\b${bypassAttribute}\s*=\s*(?:\{false\}|["']false["'])`, 'u');
|
|
127
|
+
const truePattern = new RegExp(String.raw `\b${bypassAttribute}(?:\s|/|$)|` +
|
|
128
|
+
String.raw `\b${bypassAttribute}\s*=\s*(?:\{true\}|["']true["'])`, 'u');
|
|
129
|
+
return tags.length > 0 && tags.every(match => {
|
|
130
|
+
const attributes = match[1] ?? '';
|
|
131
|
+
if (falsePattern.test(attributes))
|
|
132
|
+
return false;
|
|
133
|
+
return truePattern.test(attributes);
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
const componentNeedsAstroRuntime = (name, importingSources) => {
|
|
137
|
+
if (!(name in lumenComponentBehavior))
|
|
138
|
+
return false;
|
|
139
|
+
const behavior = lumenComponentBehavior[name];
|
|
140
|
+
if (behavior.astro !== 'ui-primitives')
|
|
141
|
+
return false;
|
|
142
|
+
if ('astroRuntimeBypass' in behavior && importingSources.length > 0 &&
|
|
143
|
+
importingSources.every(item => hasOnlyRuntimeBypassedComponents(item.source, name, behavior.astroRuntimeBypass)))
|
|
144
|
+
return false;
|
|
145
|
+
return true;
|
|
146
|
+
};
|
|
147
|
+
const getRuntimeImports = (sources) => {
|
|
148
|
+
const imports = sources.flatMap(item => importedNames(item.source, '@santi020k/lumen-astro')
|
|
149
|
+
.map(name => ({ file: item.file, name })));
|
|
150
|
+
return imports.filter(item => componentNeedsAstroRuntime(item.name, sources.filter(source => importedNames(source.source, '@santi020k/lumen-astro').includes(item.name))));
|
|
151
|
+
};
|
|
152
|
+
const getGlobalRuntimeBehaviors = (sources) => lumenGlobalBehaviors
|
|
153
|
+
.filter(behavior => sources.some(item => {
|
|
154
|
+
if (behavior.name === 'form-validation')
|
|
155
|
+
return item.source.includes('data-ui-form');
|
|
156
|
+
return behavior.authoredBy.split(',').some(eventName => item.source.includes(eventName.trim()));
|
|
157
|
+
}))
|
|
158
|
+
.map(behavior => behavior.name);
|
|
159
|
+
const collectRuntimeFindings = (repositoryRoot, boundary) => {
|
|
160
|
+
const runtimeImports = getRuntimeImports(boundary.sources);
|
|
161
|
+
const runtimeComponents = [
|
|
162
|
+
...new Set([
|
|
163
|
+
...runtimeImports.map(item => item.name),
|
|
164
|
+
...getGlobalRuntimeBehaviors(boundary.sources)
|
|
165
|
+
])
|
|
166
|
+
];
|
|
167
|
+
const mountSources = boundary.sources.filter(item => /<UIPrimitives(?:\s|\/|>)/u.test(item.source));
|
|
66
168
|
const findings = [];
|
|
67
|
-
if (runtimeComponents.length > 0 &&
|
|
68
|
-
|
|
169
|
+
if (runtimeComponents.length > 0 && mountSources.length === 0) {
|
|
170
|
+
const firstRuntimeImport = runtimeImports[0];
|
|
171
|
+
findings.push(finding(firstRuntimeImport ? relative(repositoryRoot, firstRuntimeImport.file) : relative(repositoryRoot, boundary.root), 'astro-runtime-missing', `Interactive Astro usage requires UIPrimitives: ${runtimeComponents.join(', ')}.`, 'Mount <UIPrimitives /> once in the application root, or use a documented controlled prop when application code owns the behavior.'));
|
|
69
172
|
}
|
|
70
|
-
for (const mount of
|
|
71
|
-
|
|
173
|
+
for (const mount of mountSources) {
|
|
174
|
+
const mountCount = [...mount.source.matchAll(/<UIPrimitives(?:\s|\/|>)/g)].length;
|
|
175
|
+
if (mountCount > 1) {
|
|
176
|
+
findings.push(finding(relative(repositoryRoot, mount.file), 'astro-runtime-duplicate', 'UIPrimitives is mounted more than once in this file.', 'Keep one mount in the application root layout.'));
|
|
177
|
+
}
|
|
72
178
|
}
|
|
73
|
-
|
|
179
|
+
const layoutMounts = mountSources.filter(item => layoutFilePattern.test(item.file));
|
|
180
|
+
if (layoutMounts.length > 0) {
|
|
181
|
+
for (const mount of mountSources.filter(item => !layoutMounts.includes(item))) {
|
|
182
|
+
findings.push(finding(relative(repositoryRoot, mount.file), 'astro-runtime-duplicate', 'UIPrimitives is mounted in both a layout and a route within this application boundary.', 'Keep the layout mount and remove the route-level mount.'));
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
return { findings, runtimeComponents };
|
|
74
186
|
};
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
187
|
+
const styleImportByFramework = {
|
|
188
|
+
astro: '@santi020k/lumen-astro/styles.css',
|
|
189
|
+
elements: '@santi020k/lumen-elements/styles.css',
|
|
190
|
+
react: '@santi020k/lumen-react/styles.css'
|
|
191
|
+
};
|
|
192
|
+
const countOccurrences = (source, value) => source.split(value).length - 1;
|
|
193
|
+
const collectCssFindings = (root, sources) => sources
|
|
194
|
+
.filter(item => item.file.endsWith('.css'))
|
|
195
|
+
.flatMap(item => {
|
|
196
|
+
const layerIndex = item.source.search(/^\s*@import\s+(?:url\(\s*)?["'][^"']*\/layers\.css["']/mu);
|
|
197
|
+
const tailwindIndex = item.source.search(/^\s*@import\s+(?:url\(\s*)?["']tailwindcss["']/mu);
|
|
198
|
+
const styleIndex = item.source.search(/^\s*@import\s+(?:url\(\s*)?["'][^"']*\/styles\.css["']/mu);
|
|
79
199
|
const findings = [];
|
|
80
200
|
if (tailwindIndex >= 0 &&
|
|
81
|
-
|
|
201
|
+
styleIndex >= 0 &&
|
|
202
|
+
(layerIndex < 0 || !(layerIndex < tailwindIndex && tailwindIndex < styleIndex))) {
|
|
82
203
|
findings.push(finding(relative(root, item.file), 'tailwind-layer-order', 'Tailwind and Lumen imports do not use the verified cascade order.', 'Import Lumen layers.css, then tailwindcss, then the matching Lumen styles.css.'));
|
|
83
204
|
}
|
|
84
205
|
for (const match of item.source.matchAll(/\.ui-([a-z0-9-]+)/g)) {
|
|
@@ -89,52 +210,62 @@ const collectCssFindings = (root, sources) => sources.filter(item => item.file.e
|
|
|
89
210
|
}
|
|
90
211
|
return findings;
|
|
91
212
|
});
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
react: '@santi020k/lumen-react/styles.css'
|
|
96
|
-
};
|
|
97
|
-
const collectFrameworkStyleFindings = (root, sources, frameworks) => frameworks.flatMap(framework => {
|
|
98
|
-
const references = sources.filter(item => item.source.includes(styleImportByFramework[framework]));
|
|
213
|
+
const collectFrameworkStyleFindings = (repositoryRoot, boundary, frameworks) => frameworks.flatMap(framework => {
|
|
214
|
+
const styleImport = styleImportByFramework[framework];
|
|
215
|
+
const references = boundary.sources.filter(item => item.source.includes(styleImport));
|
|
99
216
|
if (references.length === 0) {
|
|
100
|
-
return [finding('
|
|
217
|
+
return [finding(relative(repositoryRoot, boundary.root) || '.', 'framework-style-missing', `No ${styleImport} import was found in this application boundary.`, 'Load the matching adapter stylesheet once in the application root.')];
|
|
101
218
|
}
|
|
102
|
-
return references.
|
|
219
|
+
return references.flatMap(item => countOccurrences(item.source, styleImport) > 1 ?
|
|
220
|
+
[finding(relative(repositoryRoot, item.file), 'framework-style-duplicate', `The ${framework} stylesheet is loaded more than once in this file.`, 'Keep one stylesheet import in the application root.')] :
|
|
221
|
+
[]);
|
|
103
222
|
});
|
|
104
|
-
const collectAdapterMismatchFindings = (
|
|
105
|
-
const adapters =
|
|
106
|
-
.
|
|
107
|
-
|
|
223
|
+
const collectAdapterMismatchFindings = (repositoryRoot, boundary, frameworks) => {
|
|
224
|
+
const adapters = Object.entries(styleImportByFramework)
|
|
225
|
+
.flatMap(([framework, styleImport]) => boundary.sources.some(item => item.source.includes(styleImport)) ?
|
|
226
|
+
[framework] :
|
|
227
|
+
[]);
|
|
108
228
|
return [...new Set(adapters)]
|
|
109
229
|
.filter(adapter => !frameworks.includes(adapter))
|
|
110
|
-
.map(adapter => finding('
|
|
230
|
+
.map(adapter => finding(relative(repositoryRoot, boundary.root) || '.', 'adapter-style-mismatch', `The ${adapter} stylesheet is loaded without matching ${adapter} imports in this application boundary.`, 'Load the stylesheet from the adapter used by this application boundary.'));
|
|
111
231
|
};
|
|
232
|
+
const uniqueFindings = (findings) => [
|
|
233
|
+
...new Map(findings.map(item => [
|
|
234
|
+
`${item.file}\u0000${item.rule}\u0000${item.message}`,
|
|
235
|
+
item
|
|
236
|
+
])).values()
|
|
237
|
+
];
|
|
112
238
|
export const inspectLumenIntegration = async (repository) => {
|
|
113
239
|
const root = resolve(repository);
|
|
114
240
|
if (!(await stat(root)).isDirectory())
|
|
115
241
|
throw new Error(`Not a directory: ${root}`);
|
|
116
|
-
const
|
|
117
|
-
const sources = await Promise.all(
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
const
|
|
122
|
-
|
|
242
|
+
const discovered = await discoverProject(root);
|
|
243
|
+
const sources = await Promise.all(discovered.sourceFiles.map(async (file) => ({
|
|
244
|
+
file,
|
|
245
|
+
source: await readFile(file, 'utf8')
|
|
246
|
+
})));
|
|
247
|
+
const boundaries = createBoundaries(root, discovered.packageRoots, sources);
|
|
248
|
+
const frameworks = [...new Set(boundaries.flatMap(boundary => getFrameworks(boundary.sources)))];
|
|
249
|
+
const runtimeComponents = new Set();
|
|
123
250
|
const findings = [
|
|
124
251
|
...collectCompatibilityFindings(root, sources),
|
|
125
|
-
...
|
|
126
|
-
...collectCssFindings(root, sources),
|
|
127
|
-
...collectFrameworkStyleFindings(root, sources, frameworks),
|
|
128
|
-
...collectAdapterMismatchFindings(joined, frameworks)
|
|
252
|
+
...collectCssFindings(root, sources)
|
|
129
253
|
];
|
|
254
|
+
for (const boundary of boundaries) {
|
|
255
|
+
const boundaryFrameworks = getFrameworks(boundary.sources);
|
|
256
|
+
const runtime = collectRuntimeFindings(root, boundary);
|
|
257
|
+
runtime.runtimeComponents.forEach(component => runtimeComponents.add(component));
|
|
258
|
+
findings.push(...runtime.findings, ...collectFrameworkStyleFindings(root, boundary, boundaryFrameworks), ...collectAdapterMismatchFindings(root, boundary, boundaryFrameworks));
|
|
259
|
+
}
|
|
260
|
+
const deduplicatedFindings = uniqueFindings(findings);
|
|
130
261
|
return {
|
|
131
262
|
catalogFingerprint: getCatalogFingerprint(sources),
|
|
132
|
-
findings,
|
|
263
|
+
findings: deduplicatedFindings,
|
|
133
264
|
frameworks,
|
|
134
265
|
generatedAt: new Date().toISOString(),
|
|
135
|
-
healthy:
|
|
266
|
+
healthy: deduplicatedFindings.every(item => item.severity !== 'error'),
|
|
136
267
|
repository: root,
|
|
137
|
-
runtimeComponents
|
|
268
|
+
runtimeComponents: [...runtimeComponents]
|
|
138
269
|
};
|
|
139
270
|
};
|
|
140
271
|
export const formatLumenDiagnostics = (report) => {
|
package/dist/registry-data.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export declare const lumenRegistry: {
|
|
|
2
2
|
readonly name: "lumen";
|
|
3
3
|
readonly version: 1;
|
|
4
4
|
readonly description: "Astro-first Lumen UI primitives, recipes, tokens, runtime, and AI docs.";
|
|
5
|
-
readonly packages: readonly ["@santi020k/lumen-astro", "@santi020k/lumen-react", "@santi020k/lumen-elements", "@santi020k/lumen-core"];
|
|
5
|
+
readonly packages: readonly ["@santi020k/lumen-astro", "@santi020k/lumen-react", "@santi020k/lumen-elements", "@santi020k/lumen-core", "@santi020k/lumen-react-native", "@santi020k/lumen-tokens"];
|
|
6
6
|
readonly items: readonly [{
|
|
7
7
|
readonly name: "all-components";
|
|
8
8
|
readonly type: "component-set";
|
|
@@ -15,6 +15,10 @@ export declare const lumenRegistry: {
|
|
|
15
15
|
readonly name: "scheduler";
|
|
16
16
|
readonly type: "recipe";
|
|
17
17
|
readonly components: readonly ["Schedule", "Agenda", "Calendar", "DatePicker"];
|
|
18
|
+
}, {
|
|
19
|
+
readonly name: "context-navigation";
|
|
20
|
+
readonly type: "recipe";
|
|
21
|
+
readonly components: readonly ["ContextNavigation", "NavigationMenu", "NativeSelect", "Link"];
|
|
18
22
|
}, {
|
|
19
23
|
readonly name: "data-collections";
|
|
20
24
|
readonly type: "recipe";
|
|
@@ -314,6 +318,13 @@ export declare const lumenRegistry: {
|
|
|
314
318
|
readonly category: "Navigation";
|
|
315
319
|
readonly files: readonly ["packages/astro/components/Input.astro", "packages/astro/components/Command.astro", "packages/astro/styles/lumen.css", "packages/astro/runtime/UIPrimitives.astro"];
|
|
316
320
|
readonly dependencies: readonly ["Input", "styles", "runtime"];
|
|
321
|
+
}, {
|
|
322
|
+
readonly name: "ContextNavigation";
|
|
323
|
+
readonly type: "component";
|
|
324
|
+
readonly description: "Pairs a stable scope selector or identity with horizontally scrollable contextual links.";
|
|
325
|
+
readonly category: "Navigation";
|
|
326
|
+
readonly files: readonly ["packages/astro/components/ContextNavigation.astro", "packages/astro/styles/lumen.css"];
|
|
327
|
+
readonly dependencies: readonly ["NavigationMenu", "styles"];
|
|
317
328
|
}, {
|
|
318
329
|
readonly name: "ContextMenu";
|
|
319
330
|
readonly type: "component";
|
|
@@ -482,6 +493,20 @@ export declare const lumenRegistry: {
|
|
|
482
493
|
readonly category: "Data display";
|
|
483
494
|
readonly files: readonly ["packages/astro/components/Item.astro", "packages/astro/styles/lumen.css"];
|
|
484
495
|
readonly dependencies: readonly ["styles"];
|
|
496
|
+
}, {
|
|
497
|
+
readonly name: "KanbanBoard";
|
|
498
|
+
readonly type: "component";
|
|
499
|
+
readonly description: "Organizes controlled workflow columns and emits accessible move requests.";
|
|
500
|
+
readonly category: "Layout";
|
|
501
|
+
readonly files: readonly ["packages/astro/components/KanbanBoard.astro", "packages/astro/styles/lumen.css", "packages/astro/runtime/UIPrimitives.astro"];
|
|
502
|
+
readonly dependencies: readonly ["styles", "runtime"];
|
|
503
|
+
}, {
|
|
504
|
+
readonly name: "KanbanColumn";
|
|
505
|
+
readonly type: "component";
|
|
506
|
+
readonly description: "Defines a named destination inside a controlled Kanban board.";
|
|
507
|
+
readonly category: "Layout";
|
|
508
|
+
readonly files: readonly ["packages/astro/components/KanbanColumn.astro", "packages/astro/styles/lumen.css"];
|
|
509
|
+
readonly dependencies: readonly ["styles"];
|
|
485
510
|
}, {
|
|
486
511
|
readonly name: "Kbd";
|
|
487
512
|
readonly type: "component";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry-data.d.ts","sourceRoot":"","sources":["../src/registry-data.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"registry-data.d.ts","sourceRoot":"","sources":["../src/registry-data.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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'@santi020k/lumen-core',
|
|
10
|
+
'@santi020k/lumen-react-native',
|
|
11
|
+
'@santi020k/lumen-tokens'
|
|
10
12
|
],
|
|
11
13
|
items: [
|
|
12
14
|
{
|
|
@@ -42,6 +44,16 @@ export const lumenRegistry = {
|
|
|
42
44
|
'DatePicker'
|
|
43
45
|
]
|
|
44
46
|
},
|
|
47
|
+
{
|
|
48
|
+
name: 'context-navigation',
|
|
49
|
+
type: 'recipe',
|
|
50
|
+
components: [
|
|
51
|
+
'ContextNavigation',
|
|
52
|
+
'NavigationMenu',
|
|
53
|
+
'NativeSelect',
|
|
54
|
+
'Link'
|
|
55
|
+
]
|
|
56
|
+
},
|
|
45
57
|
{
|
|
46
58
|
name: 'data-collections',
|
|
47
59
|
type: 'recipe',
|
|
@@ -713,6 +725,20 @@ export const lumenRegistry = {
|
|
|
713
725
|
'runtime'
|
|
714
726
|
]
|
|
715
727
|
},
|
|
728
|
+
{
|
|
729
|
+
name: 'ContextNavigation',
|
|
730
|
+
type: 'component',
|
|
731
|
+
description: 'Pairs a stable scope selector or identity with horizontally scrollable contextual links.',
|
|
732
|
+
category: 'Navigation',
|
|
733
|
+
files: [
|
|
734
|
+
'packages/astro/components/ContextNavigation.astro',
|
|
735
|
+
'packages/astro/styles/lumen.css'
|
|
736
|
+
],
|
|
737
|
+
dependencies: [
|
|
738
|
+
'NavigationMenu',
|
|
739
|
+
'styles'
|
|
740
|
+
]
|
|
741
|
+
},
|
|
716
742
|
{
|
|
717
743
|
name: 'ContextMenu',
|
|
718
744
|
type: 'component',
|
|
@@ -1057,6 +1083,34 @@ export const lumenRegistry = {
|
|
|
1057
1083
|
'styles'
|
|
1058
1084
|
]
|
|
1059
1085
|
},
|
|
1086
|
+
{
|
|
1087
|
+
name: 'KanbanBoard',
|
|
1088
|
+
type: 'component',
|
|
1089
|
+
description: 'Organizes controlled workflow columns and emits accessible move requests.',
|
|
1090
|
+
category: 'Layout',
|
|
1091
|
+
files: [
|
|
1092
|
+
'packages/astro/components/KanbanBoard.astro',
|
|
1093
|
+
'packages/astro/styles/lumen.css',
|
|
1094
|
+
'packages/astro/runtime/UIPrimitives.astro'
|
|
1095
|
+
],
|
|
1096
|
+
dependencies: [
|
|
1097
|
+
'styles',
|
|
1098
|
+
'runtime'
|
|
1099
|
+
]
|
|
1100
|
+
},
|
|
1101
|
+
{
|
|
1102
|
+
name: 'KanbanColumn',
|
|
1103
|
+
type: 'component',
|
|
1104
|
+
description: 'Defines a named destination inside a controlled Kanban board.',
|
|
1105
|
+
category: 'Layout',
|
|
1106
|
+
files: [
|
|
1107
|
+
'packages/astro/components/KanbanColumn.astro',
|
|
1108
|
+
'packages/astro/styles/lumen.css'
|
|
1109
|
+
],
|
|
1110
|
+
dependencies: [
|
|
1111
|
+
'styles'
|
|
1112
|
+
]
|
|
1113
|
+
},
|
|
1060
1114
|
{
|
|
1061
1115
|
name: 'Kbd',
|
|
1062
1116
|
type: 'component',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@santi020k/lumen",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"semver": "^7.8.0",
|
|
42
|
-
"@santi020k/lumen-core": "^1.
|
|
42
|
+
"@santi020k/lumen-core": "^1.2.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/node": "^26.1.1",
|
|
@@ -59,10 +59,18 @@
|
|
|
59
59
|
"url": "https://github.com/santi020k/lumen.git",
|
|
60
60
|
"directory": "packages/lumen"
|
|
61
61
|
},
|
|
62
|
-
"homepage": "https://lumen.santi020k.com",
|
|
62
|
+
"homepage": "https://lumen.santi020k.com/docs",
|
|
63
63
|
"bugs": {
|
|
64
64
|
"url": "https://github.com/santi020k/lumen/issues"
|
|
65
65
|
},
|
|
66
|
+
"keywords": [
|
|
67
|
+
"accessible-ui",
|
|
68
|
+
"component-library",
|
|
69
|
+
"cross-platform",
|
|
70
|
+
"design-system",
|
|
71
|
+
"lumen",
|
|
72
|
+
"ui"
|
|
73
|
+
],
|
|
66
74
|
"author": {
|
|
67
75
|
"name": "Santiago Molina",
|
|
68
76
|
"url": "https://santi020k.com"
|
package/styles.css
CHANGED
|
@@ -22,10 +22,12 @@
|
|
|
22
22
|
--brand: 221 83% 53%;
|
|
23
23
|
--brand-solid: 221 83% 46%;
|
|
24
24
|
--brand-soft: 218 100% 97%;
|
|
25
|
+
--on-brand: 0 0% 100%;
|
|
25
26
|
--accent: 168 76% 36%;
|
|
26
27
|
--success: 142 71% 36%;
|
|
27
28
|
--warning: 38 92% 50%;
|
|
28
29
|
--danger: 0 84% 60%;
|
|
30
|
+
--on-danger: 0 0% 0%;
|
|
29
31
|
--chart-axis: var(--ink-muted);
|
|
30
32
|
--chart-diverging-mid: 220 13% 91%;
|
|
31
33
|
--chart-diverging-negative: 0 84% 60%;
|
|
@@ -42,7 +44,7 @@
|
|
|
42
44
|
--chart-series-6: 190 82% 42%;
|
|
43
45
|
--chart-series-7: 52 92% 45%;
|
|
44
46
|
--chart-series-8: 215 16% 47%;
|
|
45
|
-
--ui-on-danger:
|
|
47
|
+
--ui-on-danger: var(--on-danger);
|
|
46
48
|
--ui-radius: 0.625rem;
|
|
47
49
|
--ui-radius-sm: 0.375rem;
|
|
48
50
|
--ui-radius-lg: 0.75rem;
|
|
@@ -87,10 +89,12 @@
|
|
|
87
89
|
--brand: 199 91% 56%;
|
|
88
90
|
--brand-solid: 199 91% 36%;
|
|
89
91
|
--brand-soft: 199 84% 16%;
|
|
92
|
+
--on-brand: 0 0% 100%;
|
|
90
93
|
--accent: 166 76% 43%;
|
|
91
94
|
--success: 142 69% 45%;
|
|
92
95
|
--warning: 38 92% 55%;
|
|
93
96
|
--danger: 0 84% 65%;
|
|
97
|
+
--on-danger: 224 24% 8%;
|
|
94
98
|
--chart-axis: var(--ink-muted);
|
|
95
99
|
--chart-diverging-mid: 222 14% 22%;
|
|
96
100
|
--chart-diverging-negative: 0 84% 65%;
|
|
@@ -128,6 +132,7 @@
|
|
|
128
132
|
}
|
|
129
133
|
|
|
130
134
|
:root[data-theme$="-dark"] {
|
|
135
|
+
--on-danger: var(--canvas);
|
|
131
136
|
--ui-on-danger: var(--canvas);
|
|
132
137
|
}
|
|
133
138
|
}
|
|
@@ -225,6 +230,7 @@
|
|
|
225
230
|
.ui-combobox,
|
|
226
231
|
.ui-code,
|
|
227
232
|
.ui-command,
|
|
233
|
+
.ui-context-navigation,
|
|
228
234
|
.ui-callout,
|
|
229
235
|
.ui-color-picker,
|
|
230
236
|
.ui-dialog,
|
|
@@ -761,7 +767,7 @@
|
|
|
761
767
|
.ui-button--default {
|
|
762
768
|
background: hsl(var(--brand-solid));
|
|
763
769
|
border-color: hsl(var(--brand-solid));
|
|
764
|
-
color:
|
|
770
|
+
color: hsl(var(--on-brand));
|
|
765
771
|
box-shadow: 0 8px 20px hsl(var(--brand) / 0.22);
|
|
766
772
|
}
|
|
767
773
|
|
|
@@ -773,7 +779,7 @@
|
|
|
773
779
|
.ui-button--primary {
|
|
774
780
|
background: hsl(var(--brand-solid));
|
|
775
781
|
border-color: hsl(var(--brand-solid));
|
|
776
|
-
color:
|
|
782
|
+
color: hsl(var(--on-brand));
|
|
777
783
|
box-shadow: 0 8px 20px hsl(var(--brand) / 0.22);
|
|
778
784
|
}
|
|
779
785
|
|
|
@@ -816,7 +822,7 @@
|
|
|
816
822
|
.ui-button--destructive {
|
|
817
823
|
background: hsl(var(--danger));
|
|
818
824
|
border-color: hsl(var(--danger));
|
|
819
|
-
color: hsl(var(--
|
|
825
|
+
color: hsl(var(--on-danger));
|
|
820
826
|
}
|
|
821
827
|
|
|
822
828
|
.ui-button--destructive:hover {
|
|
@@ -2181,6 +2187,50 @@
|
|
|
2181
2187
|
color: hsl(var(--brand));
|
|
2182
2188
|
}
|
|
2183
2189
|
|
|
2190
|
+
.ui-context-navigation {
|
|
2191
|
+
--ui-context-navigation-gap: 1rem;
|
|
2192
|
+
--ui-context-navigation-min-height: 3.25rem;
|
|
2193
|
+
--ui-context-navigation-padding: 0.5rem 1rem;
|
|
2194
|
+
|
|
2195
|
+
display: flex;
|
|
2196
|
+
min-width: 0;
|
|
2197
|
+
min-height: var(--ui-context-navigation-min-height);
|
|
2198
|
+
align-items: center;
|
|
2199
|
+
gap: var(--ui-context-navigation-gap);
|
|
2200
|
+
border-block: 1px solid hsl(var(--line));
|
|
2201
|
+
background: hsl(var(--surface));
|
|
2202
|
+
padding: var(--ui-context-navigation-padding);
|
|
2203
|
+
}
|
|
2204
|
+
|
|
2205
|
+
.ui-context-navigation__context,
|
|
2206
|
+
.ui-context-navigation > [slot="context"] {
|
|
2207
|
+
display: flex;
|
|
2208
|
+
min-width: max-content;
|
|
2209
|
+
flex: 0 0 auto;
|
|
2210
|
+
align-items: center;
|
|
2211
|
+
padding-inline-end: var(--ui-context-navigation-gap);
|
|
2212
|
+
border-inline-end: 1px solid hsl(var(--line));
|
|
2213
|
+
}
|
|
2214
|
+
|
|
2215
|
+
.ui-context-navigation > :where(.ui-navigation-menu, lumen-navigation-menu) {
|
|
2216
|
+
display: flex;
|
|
2217
|
+
min-width: 0;
|
|
2218
|
+
flex: 1 1 auto;
|
|
2219
|
+
overflow-x: auto;
|
|
2220
|
+
overscroll-behavior-inline: contain;
|
|
2221
|
+
scrollbar-width: none;
|
|
2222
|
+
}
|
|
2223
|
+
|
|
2224
|
+
.ui-context-navigation > :where(.ui-navigation-menu, lumen-navigation-menu)::-webkit-scrollbar {
|
|
2225
|
+
display: none;
|
|
2226
|
+
}
|
|
2227
|
+
|
|
2228
|
+
.ui-context-navigation--unstyled {
|
|
2229
|
+
border: 0;
|
|
2230
|
+
background: transparent;
|
|
2231
|
+
padding: 0;
|
|
2232
|
+
}
|
|
2233
|
+
|
|
2184
2234
|
.ui-menubar,
|
|
2185
2235
|
.ui-navigation-menu,
|
|
2186
2236
|
.ui-button-group,
|
|
@@ -2727,10 +2777,79 @@
|
|
|
2727
2777
|
text-align: center;
|
|
2728
2778
|
}
|
|
2729
2779
|
|
|
2780
|
+
.ui-empty--compact {
|
|
2781
|
+
gap: 0.35rem;
|
|
2782
|
+
border-radius: var(--ui-radius);
|
|
2783
|
+
padding: 0.75rem;
|
|
2784
|
+
font-size: 0.8125rem;
|
|
2785
|
+
}
|
|
2786
|
+
|
|
2730
2787
|
.ui-empty > * {
|
|
2731
2788
|
margin: 0;
|
|
2732
2789
|
}
|
|
2733
2790
|
|
|
2791
|
+
.ui-kanban {
|
|
2792
|
+
--ui-kanban-column-width: clamp(18rem, 28vw, 22rem);
|
|
2793
|
+
--ui-kanban-column-min-height: 28rem;
|
|
2794
|
+
--ui-kanban-gap: 0.875rem;
|
|
2795
|
+
display: grid;
|
|
2796
|
+
min-width: 0;
|
|
2797
|
+
grid-auto-columns: var(--ui-kanban-column-width);
|
|
2798
|
+
grid-auto-flow: column;
|
|
2799
|
+
gap: var(--ui-kanban-gap);
|
|
2800
|
+
padding: 0.25rem 0.25rem 1rem;
|
|
2801
|
+
overflow-x: auto;
|
|
2802
|
+
overscroll-behavior-inline: contain;
|
|
2803
|
+
scroll-snap-type: inline proximity;
|
|
2804
|
+
scrollbar-gutter: stable;
|
|
2805
|
+
}
|
|
2806
|
+
|
|
2807
|
+
.ui-kanban:focus-visible {
|
|
2808
|
+
outline: 2px solid hsl(var(--brand));
|
|
2809
|
+
outline-offset: 2px;
|
|
2810
|
+
}
|
|
2811
|
+
|
|
2812
|
+
.ui-kanban__column {
|
|
2813
|
+
min-width: 0;
|
|
2814
|
+
min-height: var(--ui-kanban-column-min-height);
|
|
2815
|
+
padding: 0.875rem;
|
|
2816
|
+
border: 1px solid hsl(var(--line));
|
|
2817
|
+
border-radius: var(--ui-radius-lg);
|
|
2818
|
+
background: hsl(var(--surface-muted));
|
|
2819
|
+
scroll-snap-align: start;
|
|
2820
|
+
transition:
|
|
2821
|
+
border-color var(--ui-duration) var(--ui-ease),
|
|
2822
|
+
background var(--ui-duration) var(--ui-ease);
|
|
2823
|
+
}
|
|
2824
|
+
|
|
2825
|
+
.ui-kanban__column[data-state="drop-target"] {
|
|
2826
|
+
border-color: hsl(var(--brand));
|
|
2827
|
+
background: hsl(var(--brand-soft));
|
|
2828
|
+
}
|
|
2829
|
+
|
|
2830
|
+
[data-ui-kanban-item][data-state="dragging"] {
|
|
2831
|
+
opacity: 0.6;
|
|
2832
|
+
}
|
|
2833
|
+
|
|
2834
|
+
[data-ui-kanban-item][aria-busy="true"] {
|
|
2835
|
+
cursor: progress;
|
|
2836
|
+
}
|
|
2837
|
+
|
|
2838
|
+
[data-ui-kanban-handle] {
|
|
2839
|
+
touch-action: none;
|
|
2840
|
+
cursor: grab;
|
|
2841
|
+
}
|
|
2842
|
+
|
|
2843
|
+
[data-ui-kanban-handle]:active {
|
|
2844
|
+
cursor: grabbing;
|
|
2845
|
+
}
|
|
2846
|
+
|
|
2847
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2848
|
+
.ui-kanban__column {
|
|
2849
|
+
transition: none;
|
|
2850
|
+
}
|
|
2851
|
+
}
|
|
2852
|
+
|
|
2734
2853
|
.ui-item {
|
|
2735
2854
|
display: flex;
|
|
2736
2855
|
min-width: 0;
|