@navecss/core 0.4.0 → 0.6.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/CONSUMER-ATOMS.md +15 -11
- package/LICENSE +22 -0
- package/README.md +300 -33
- package/dist/{atom-names-2OreuBx9.d.ts → atom-names-B8Ud-7zD.d.ts} +2 -1
- package/dist/atoms.d.ts +3 -2
- package/dist/bin.js +98 -15
- package/dist/check.d.ts +2 -1
- package/dist/check.js +4 -3
- package/dist/{chunk-NFS2REPQ.js → chunk-2K5EBBF2.js} +1 -191
- package/dist/chunk-2TNTYI4L.js +7 -0
- package/dist/{chunk-LQSGQ2OA.js → chunk-B5CWZIBK.js} +3 -2
- package/dist/{chunk-XQQCDUV6.js → chunk-CTFEYJBE.js} +1 -1
- package/dist/{chunk-E5F6YF7A.js → chunk-EYMFWE3A.js} +2273 -126
- package/dist/chunk-KDLLTOAM.js +4031 -0
- package/dist/{chunk-2A7IUZBH.js → chunk-R6R5DSTT.js} +8 -8
- package/dist/chunk-UVHGEVMV.js +204 -0
- package/dist/{chunk-UANF3FGO.js → chunk-ZNTNLGEC.js} +2 -1
- package/dist/collect.d.ts +340 -6
- package/dist/collect.js +38 -1
- package/dist/css.d.ts +1 -0
- package/dist/cx.d.ts +1 -1
- package/dist/lightningcss.d.ts +3 -2
- package/dist/lightningcss.js +7 -4
- package/dist/postcss.d.ts +29 -3
- package/dist/postcss.js +331 -81
- package/dist/standalone.css +2 -0
- package/dist/{vite-options-D1-hGA9L.d.ts → vite-options-sOCeGn9B.d.ts} +3 -2
- package/dist/vite.d.ts +24 -3
- package/dist/vite.js +1541 -2284
- package/package.json +53 -24
- package/skills/navecss/SKILL.md +15 -1
- package/dist/chunk-LADFXRWQ.js +0 -1089
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@navecss/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Nave design system — layer architecture, reset, atomic utilities, and the Vite, PostCSS and Lightning CSS adapters and a command line for the @nave directive",
|
|
@@ -19,11 +19,26 @@
|
|
|
19
19
|
"access": "public"
|
|
20
20
|
},
|
|
21
21
|
"exports": {
|
|
22
|
-
".":
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"./
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/css.d.ts",
|
|
24
|
+
"default": "./dist/index.css"
|
|
25
|
+
},
|
|
26
|
+
"./layers": {
|
|
27
|
+
"types": "./dist/css.d.ts",
|
|
28
|
+
"default": "./dist/layers.css"
|
|
29
|
+
},
|
|
30
|
+
"./no-tokens": {
|
|
31
|
+
"types": "./dist/css.d.ts",
|
|
32
|
+
"default": "./dist/no-tokens.css"
|
|
33
|
+
},
|
|
34
|
+
"./reset": {
|
|
35
|
+
"types": "./dist/css.d.ts",
|
|
36
|
+
"default": "./dist/reset.css"
|
|
37
|
+
},
|
|
38
|
+
"./atomic": {
|
|
39
|
+
"types": "./dist/css.d.ts",
|
|
40
|
+
"default": "./dist/atomic.css"
|
|
41
|
+
},
|
|
27
42
|
"./cx": {
|
|
28
43
|
"types": "./dist/cx.d.ts",
|
|
29
44
|
"import": "./dist/cx.js"
|
|
@@ -50,7 +65,10 @@
|
|
|
50
65
|
"types": "./dist/lightningcss.d.ts",
|
|
51
66
|
"import": "./dist/lightningcss.js"
|
|
52
67
|
},
|
|
53
|
-
"./standalone":
|
|
68
|
+
"./standalone": {
|
|
69
|
+
"types": "./dist/css.d.ts",
|
|
70
|
+
"default": "./dist/standalone.css"
|
|
71
|
+
},
|
|
54
72
|
"./check": {
|
|
55
73
|
"types": "./dist/check.d.ts",
|
|
56
74
|
"import": "./dist/check.js"
|
|
@@ -80,31 +98,40 @@
|
|
|
80
98
|
}
|
|
81
99
|
},
|
|
82
100
|
"dependencies": {
|
|
83
|
-
"@navecss/tokens": "^0.
|
|
101
|
+
"@navecss/tokens": "^0.6.0"
|
|
84
102
|
},
|
|
85
103
|
"devDependencies": {
|
|
104
|
+
"@astrojs/node": "11.1.11",
|
|
105
|
+
"@astrojs/react": "7.1.4",
|
|
86
106
|
"@rmenke/css-tokenizer-tests": "1.4.0",
|
|
87
107
|
"@sveltejs/vite-plugin-svelte": "7.3.1",
|
|
88
|
-
"@types/node": "^26.6.
|
|
89
|
-
"@vitejs/plugin-vue": "6.0.
|
|
90
|
-
"@vitest/browser": "5.0
|
|
91
|
-
"@vitest/browser-playwright": "5.0
|
|
92
|
-
"@vitest/coverage-v8": "5.0
|
|
108
|
+
"@types/node": "^26.6.6",
|
|
109
|
+
"@vitejs/plugin-vue": "6.0.10",
|
|
110
|
+
"@vitest/browser": "5.1.0",
|
|
111
|
+
"@vitest/browser-playwright": "5.1.0",
|
|
112
|
+
"@vitest/coverage-v8": "5.1.0",
|
|
113
|
+
"astro": "7.4.0",
|
|
93
114
|
"lightningcss": "1.33.0",
|
|
94
115
|
"lightningcss-1-24": "npm:lightningcss@1.24.1",
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
116
|
+
"mdn-data": "2.37.2",
|
|
117
|
+
"playwright": "1.65.0",
|
|
118
|
+
"postcss": "^8.5.32",
|
|
119
|
+
"prettier": "3.9.10",
|
|
120
|
+
"react": "^19.3.0",
|
|
121
|
+
"react-dom": "^19.3.0",
|
|
122
|
+
"sass": "1.108.1",
|
|
99
123
|
"source-map": "^0.8.0",
|
|
100
|
-
"
|
|
101
|
-
"
|
|
124
|
+
"stylelint": "17.16.0",
|
|
125
|
+
"stylelint-16-16": "npm:stylelint@16.16.0",
|
|
126
|
+
"stylelint-16-17": "npm:stylelint@16.17.0",
|
|
127
|
+
"svelte": "5.57.3",
|
|
128
|
+
"tsup": "^9.0.0",
|
|
102
129
|
"typescript": "6.0.3",
|
|
103
|
-
"vite": "8.3.
|
|
130
|
+
"vite": "8.3.5",
|
|
104
131
|
"vite-floor": "npm:vite@8.2.1",
|
|
105
|
-
"vitest": "5.0
|
|
132
|
+
"vitest": "5.1.0",
|
|
106
133
|
"vscode-css-languageservice": "6.3.10",
|
|
107
|
-
"vue": "3.5.
|
|
134
|
+
"vue": "3.5.45"
|
|
108
135
|
},
|
|
109
136
|
"engines": {
|
|
110
137
|
"node": ">=22.18"
|
|
@@ -123,12 +150,14 @@
|
|
|
123
150
|
"scripts": {
|
|
124
151
|
"build": "node scripts/build-css.ts && tsup",
|
|
125
152
|
"dev": "tsup --watch",
|
|
153
|
+
"generate:property-table": "node scripts/generate-property-table.ts",
|
|
126
154
|
"clean": "rm -rf dist",
|
|
127
155
|
"typecheck": "tsc --noEmit && tsc --noEmit -p test/browser/tsconfig.json",
|
|
128
156
|
"lint": "eslint src scripts \"test/**/*.ts\" --max-warnings 0 && stylelint \"src/**/*.css\" --max-warnings 0",
|
|
129
157
|
"lint:fix": "eslint src scripts \"test/**/*.ts\" --fix && stylelint \"src/**/*.css\" --fix",
|
|
130
158
|
"test": "node scripts/generate-consumer-theming-fixtures.ts && node scripts/generate-vite-plugin-fixtures.ts && vitest run",
|
|
131
|
-
"test:browser": "node scripts/generate-consumer-theming-fixtures.ts && node scripts/generate-vite-plugin-fixtures.ts && node scripts/generate-lightningcss-fixtures.ts && node scripts/generate-no-bundler-fixture.ts && vitest run --config vitest.browser.config.ts && vitest run --config vitest.chromium.config.ts",
|
|
132
|
-
"
|
|
159
|
+
"test:browser": "node scripts/generate-consumer-theming-fixtures.ts && node scripts/generate-vite-plugin-fixtures.ts && node scripts/generate-lightningcss-fixtures.ts && node scripts/generate-native-order-lightningcss-fixture.ts && node scripts/generate-no-bundler-fixture.ts && vitest run --config vitest.browser.config.ts && vitest run --config vitest.chromium.config.ts && pnpm run test:browser:engines",
|
|
160
|
+
"test:browser:engines": "node scripts/generate-native-order-engine-fixtures.ts && vitest run --config vitest.browser.engines.config.ts",
|
|
161
|
+
"check:pack": "node ../../scripts/without-dry-run.mjs publint && node ../../scripts/without-dry-run.mjs attw --pack . --profile esm-only"
|
|
133
162
|
}
|
|
134
163
|
}
|
package/skills/navecss/SKILL.md
CHANGED
|
@@ -48,6 +48,18 @@ Consumer rules go in `@layer components.consumer`, and a deliberate exception in
|
|
|
48
48
|
`@layer overrides`; never write an unlayered rule. Atom names are the camelCase keys listed
|
|
49
49
|
under Atoms below (`focusRing`, `justifyBetween`), never the `nave-` class they emit.
|
|
50
50
|
|
|
51
|
+
`@nave a b;` expands in place, atom by atom, each atom's pseudo-class, `@media` and `@container`
|
|
52
|
+
blocks right after its declarations, and what the rule says after the directive comes after all of
|
|
53
|
+
it. A later declaration overrides an atom's declarations and its `@media` and `@container` blocks.
|
|
54
|
+
Over a pseudo-class block, such as the `:focus-visible` of `focusRing`, a later nested block such
|
|
55
|
+
as `&:focus { ... }` wins too, but a plain declaration does not, because the block's selector is
|
|
56
|
+
more specific. Name responsive and state atoms (`hide*`, `*PhoneOnly`, `focusRing`) after the atoms
|
|
57
|
+
they adjust, and write a declaration that should give way to them above the directive. When the
|
|
58
|
+
build warns that something later in the rule overrides an atom's block, make the move or
|
|
59
|
+
reorder the warning names. Where it names neither, write the atom the task wants to win
|
|
60
|
+
last and add the marker the warning then prints; otherwise add a `nave-allow-override`
|
|
61
|
+
marker only when the override is what the task asks for.
|
|
62
|
+
|
|
51
63
|
See where `@nave` is valid (nesting depth, `@media`/`@container`, `@keyframes`) in
|
|
52
64
|
[the package README](../../README.md#where-nave-is-valid).
|
|
53
65
|
|
|
@@ -58,7 +70,7 @@ built-in atom it names, and `cx()` takes built-in atoms and nothing else.
|
|
|
58
70
|
Its type check is TypeScript only: a JavaScript consumer gets none of it. A type error from
|
|
59
71
|
`cx()` means the name is wrong: it is never a reason to reach for `cx.raw()` or a cast.
|
|
60
72
|
|
|
61
|
-
In a project whose Vite config uses `navePlugin()` from `@navecss/core/vite`, the build reads every `cx()` call and fails on one whose atoms it cannot list. Pass names it can read (a literal, a condition between literals, a `const` in the same file); to choose by a value, call `cx()` once per case and pick between the results; pass a name known only at run time to `cx.dynamic()`, with its atoms in `keep
|
|
73
|
+
In a project whose Vite config uses `navePlugin()` from `@navecss/core/vite`, or whose Next.js config is wrapped in `withNave()` from `@navecss/prune`, the build reads every `cx()` call and fails on one whose atoms it cannot list. On Next.js that means the calls in the JavaScript and TypeScript modules your entry files import: a module that reaches the page another way, such as one that only Markdown or MDX files import or one loaded through `import()` or `require()` with a specifier built at run time, is not read, and `@navecss/prune`'s README lists what else the build cannot see. Pass names it can read (a literal, a condition between literals, a `const` in the same file); to choose by a value, call `cx()` once per case and pick between the results; pass a name known only at run time to `cx.dynamic()`, with its atoms in `keep`, an option of `navePlugin()` on Vite and of `withNave()` on Next.js. The build's report names its remedies, most preferred first: take the first one that fits; on Next.js, `next dev` prints it in its terminal, not in the browser. Never set `atomic: 'all'`, never move a Next.js project back to `@navecss/core/postcss` or remove `withNave()`, never build a `nave-` class from pieces, and never apply a class taken from `@navecss/core/atoms`, to make a report go away. The dev server serves the atoms the build would ship, chosen from the code it has read, so a `nave-*` class with no rule in dev is written where the build cannot see it: move it into code the build reads, or list its atom in `keep`.
|
|
62
74
|
|
|
63
75
|
## `cx.raw()`
|
|
64
76
|
|
|
@@ -194,6 +206,8 @@ renders nothing.
|
|
|
194
206
|
- `--nave-color-action-primary-active`
|
|
195
207
|
- `--nave-color-action-primary-hover`
|
|
196
208
|
- `--nave-color-action-secondary`
|
|
209
|
+
- `--nave-color-action-secondary-active`
|
|
210
|
+
- `--nave-color-action-secondary-hover`
|
|
197
211
|
- `--nave-color-backdrop-modal`: Translucent layer between a modal panel and the page, which it recedes. Only behind a fully modal panel; never under text, a control or a focus indicator the reader can reach.
|
|
198
212
|
- `--nave-color-border-control`: Identifying boundary for a control (inputs, form boundaries, and the secondary action control).
|
|
199
213
|
- `--nave-color-border-default`: Decorative dividers and card edges.
|