@navecss/core 0.2.0 → 0.4.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/package.json CHANGED
@@ -1,15 +1,17 @@
1
1
  {
2
2
  "name": "@navecss/core",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
- "description": "Nave design system — layer architecture, reset, atomic utilities, PostCSS plugin",
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",
7
7
  "keywords": [
8
8
  "css",
9
9
  "design-system",
10
10
  "css-layers",
11
11
  "atomic-css",
12
12
  "postcss-plugin",
13
+ "vite-plugin",
14
+ "lightningcss",
13
15
  "zero-runtime"
14
16
  ],
15
17
  "homepage": "https://github.com/navecss/navecss/tree/main/packages/core#readme",
@@ -31,11 +33,37 @@
31
33
  "import": "./dist/atoms.js"
32
34
  },
33
35
  "./postcss": {
34
- "types": "./dist/postcss.d.ts",
35
- "import": "./dist/postcss.js"
36
+ "import": {
37
+ "types": "./dist/postcss.d.ts",
38
+ "default": "./dist/postcss.js"
39
+ },
40
+ "require": {
41
+ "types": "./dist/postcss.d.cts",
42
+ "default": "./dist/postcss.cjs"
43
+ }
44
+ },
45
+ "./vite": {
46
+ "types": "./dist/vite.d.ts",
47
+ "import": "./dist/vite.js"
48
+ },
49
+ "./lightningcss": {
50
+ "types": "./dist/lightningcss.d.ts",
51
+ "import": "./dist/lightningcss.js"
52
+ },
53
+ "./standalone": "./dist/standalone.css",
54
+ "./check": {
55
+ "types": "./dist/check.d.ts",
56
+ "import": "./dist/check.js"
57
+ },
58
+ "./collect": {
59
+ "types": "./dist/collect.d.ts",
60
+ "import": "./dist/collect.js"
36
61
  },
37
62
  "./package.json": "./package.json"
38
63
  },
64
+ "bin": {
65
+ "navecss-core": "./dist/bin.js"
66
+ },
39
67
  "files": [
40
68
  "dist",
41
69
  "CONSUMER-ATOMS.md",
@@ -52,20 +80,31 @@
52
80
  }
53
81
  },
54
82
  "dependencies": {
55
- "@navecss/tokens": "^0.2.0"
83
+ "@navecss/tokens": "^0.4.0"
56
84
  },
57
85
  "devDependencies": {
58
- "@types/node": "^26.6.2",
59
- "@vitest/browser": "5.0.1",
60
- "@vitest/browser-playwright": "5.0.1",
61
- "@vitest/coverage-v8": "5.0.1",
86
+ "@rmenke/css-tokenizer-tests": "1.4.0",
87
+ "@sveltejs/vite-plugin-svelte": "7.3.1",
88
+ "@types/node": "^26.6.4",
89
+ "@vitejs/plugin-vue": "6.0.9",
90
+ "@vitest/browser": "5.0.3",
91
+ "@vitest/browser-playwright": "5.0.3",
92
+ "@vitest/coverage-v8": "5.0.3",
93
+ "lightningcss": "1.33.0",
94
+ "lightningcss-1-24": "npm:lightningcss@1.24.1",
62
95
  "playwright": "1.63.0",
63
96
  "postcss": "^8.5.28",
64
97
  "prettier": "3.9.9",
98
+ "sass": "1.105.1",
99
+ "source-map": "^0.8.0",
100
+ "svelte": "5.57.2",
65
101
  "tsup": "^8.5.1",
66
102
  "typescript": "6.0.3",
67
- "vitest": "5.0.1",
68
- "vscode-css-languageservice": "6.3.10"
103
+ "vite": "8.3.3",
104
+ "vite-floor": "npm:vite@8.2.1",
105
+ "vitest": "5.0.3",
106
+ "vscode-css-languageservice": "6.3.10",
107
+ "vue": "3.5.43"
69
108
  },
70
109
  "engines": {
71
110
  "node": ">=22.18"
@@ -86,11 +125,10 @@
86
125
  "dev": "tsup --watch",
87
126
  "clean": "rm -rf dist",
88
127
  "typecheck": "tsc --noEmit && tsc --noEmit -p test/browser/tsconfig.json",
89
- "lint": "eslint src scripts --max-warnings 0 && stylelint \"src/**/*.css\" --max-warnings 0",
90
- "lint:fix": "eslint src scripts --fix && stylelint \"src/**/*.css\" --fix",
91
- "test": "node scripts/generate-consumer-theming-fixtures.ts && vitest run",
92
- "test:coverage": "node scripts/generate-consumer-theming-fixtures.ts && vitest run --coverage",
93
- "test:browser": "node scripts/generate-consumer-theming-fixtures.ts && vitest run --config vitest.browser.config.ts",
94
- "check:pack": "node ../../scripts/without-dry-run.mjs publint && node ../../scripts/without-dry-run.mjs attw --pack . --profile esm-only --exclude-entrypoints . layers no-tokens reset atomic"
128
+ "lint": "eslint src scripts \"test/**/*.ts\" --max-warnings 0 && stylelint \"src/**/*.css\" --max-warnings 0",
129
+ "lint:fix": "eslint src scripts \"test/**/*.ts\" --fix && stylelint \"src/**/*.css\" --fix",
130
+ "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
+ "check:pack": "node ../../scripts/without-dry-run.mjs publint && node ../../scripts/without-dry-run.mjs attw --pack . --profile esm-only --exclude-entrypoints . layers no-tokens reset atomic standalone"
95
133
  }
96
134
  }
@@ -58,6 +58,8 @@ built-in atom it names, and `cx()` takes built-in atoms and nothing else.
58
58
  Its type check is TypeScript only: a JavaScript consumer gets none of it. A type error from
59
59
  `cx()` means the name is wrong: it is never a reason to reach for `cx.raw()` or a cast.
60
60
 
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`. The build's report names its remedies, most preferred first: take the first one that fits. Never set `atomic: 'all'`, 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
+
61
63
  ## `cx.raw()`
62
64
 
63
65
  `cx.raw()` is for a class from outside any system Nave sees, the project’s own classes
@@ -139,7 +141,7 @@ a name that is in neither is not used, so do not invent one.
139
141
  | Atom | Declarations | Variants |
140
142
  | --------------- | ------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
141
143
  | `interactive` | `cursor: pointer;`<br>`-webkit-user-select: none;`<br>`user-select: none;`<br>`-webkit-tap-highlight-color: transparent;` | — |
142
- | `focusRing` | `outline: none;` | `:focus-visible` — `outline: var(--nave-border-width-focus) solid var(--nave-color-border-focus);`<br>`outline-offset: 2px;` |
144
+ | `focusRing` | `outline: none;` | `:focus-visible` — `outline-style: solid;`<br>`outline-width: var(--nave-border-width-focus, 2px);`<br>`outline-color: var(--nave-color-border-focus, currentColor);`<br>`outline-offset: 2px;` |
143
145
  | `disabledState` | — | `:disabled, [aria-disabled="true"]` — `color: var(--nave-color-content-disabled);`<br>`border-color: var(--nave-color-border-disabled);`<br>`pointer-events: none;`<br>On the aria-disabled branch the element stays focusable by design: this atom only blocks pointer activation (pointer-events: none), so the component's own activation handler must also check the attribute and no-op on Enter and Space, since CSS cannot prevent keyboard activation. |
144
146
 
145
147
  ### Visual
@@ -184,12 +186,15 @@ renders nothing.
184
186
 
185
187
  - `--nave-border-width-focus`: Focus ring indicator outline width
186
188
  - `--nave-border-width-lg`
189
+ - `--nave-border-width-mark`: Strokes of glyphs drawn in CSS: check marks, indeterminate bars
187
190
  - `--nave-border-width-none`
188
191
  - `--nave-border-width-sm`: Default border / divider
192
+ - `--nave-color-action-highlight`: Fill for a control under the pointer, the keyboard or a press: a highlighted list or menu item, or a ghost button. Never the only cue for focus or for a state such as selected, checked, open or current, and not for disabled controls.
189
193
  - `--nave-color-action-primary`
190
194
  - `--nave-color-action-primary-active`
191
195
  - `--nave-color-action-primary-hover`
192
196
  - `--nave-color-action-secondary`
197
+ - `--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.
193
198
  - `--nave-color-border-control`: Identifying boundary for a control (inputs, form boundaries, and the secondary action control).
194
199
  - `--nave-color-border-default`: Decorative dividers and card edges.
195
200
  - `--nave-color-border-disabled`
@@ -260,7 +265,7 @@ renders nothing.
260
265
  - `--nave-motion-easing-standard`: General-purpose — enters and exits
261
266
  - `--nave-opacity-disabled`: Opacity multiplier for muting content that is inert and contains nothing focusable (e.g. a disabled icon or illustration). Nave's own interactive-disabled state is expressed through content.disabled and border.disabled instead, not this token: opacity composites everything an element paints, including a focus indicator inside it.
262
267
  - `--nave-radius-card`: Cards, panels, dialogs
263
- - `--nave-radius-control`: Inputs, buttons, tags
268
+ - `--nave-radius-control`: Inputs, buttons, tags, and the popovers, menus and select lists anchored to a control
264
269
  - `--nave-radius-full`: Pill / badge shape
265
270
  - `--nave-radius-none`
266
271
  - `--nave-radius-overlay`: Modals, drawers, sheets