@navecss/core 0.2.0 → 0.3.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.3.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,33 @@
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"
36
57
  },
37
58
  "./package.json": "./package.json"
38
59
  },
60
+ "bin": {
61
+ "navecss-core": "./dist/bin.js"
62
+ },
39
63
  "files": [
40
64
  "dist",
41
65
  "CONSUMER-ATOMS.md",
@@ -52,20 +76,31 @@
52
76
  }
53
77
  },
54
78
  "dependencies": {
55
- "@navecss/tokens": "^0.2.0"
79
+ "@navecss/tokens": "^0.3.0"
56
80
  },
57
81
  "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",
82
+ "@rmenke/css-tokenizer-tests": "1.4.0",
83
+ "@sveltejs/vite-plugin-svelte": "7.3.1",
84
+ "@types/node": "^26.6.4",
85
+ "@vitejs/plugin-vue": "6.0.9",
86
+ "@vitest/browser": "5.0.3",
87
+ "@vitest/browser-playwright": "5.0.3",
88
+ "@vitest/coverage-v8": "5.0.3",
89
+ "lightningcss": "1.33.0",
90
+ "lightningcss-1-24": "npm:lightningcss@1.24.1",
62
91
  "playwright": "1.63.0",
63
92
  "postcss": "^8.5.28",
64
93
  "prettier": "3.9.9",
94
+ "sass": "1.105.1",
95
+ "source-map": "^0.8.0",
96
+ "svelte": "5.57.2",
65
97
  "tsup": "^8.5.1",
66
98
  "typescript": "6.0.3",
67
- "vitest": "5.0.1",
68
- "vscode-css-languageservice": "6.3.10"
99
+ "vite": "8.3.3",
100
+ "vite-floor": "npm:vite@8.2.1",
101
+ "vitest": "5.0.3",
102
+ "vscode-css-languageservice": "6.3.10",
103
+ "vue": "3.5.43"
69
104
  },
70
105
  "engines": {
71
106
  "node": ">=22.18"
@@ -86,11 +121,10 @@
86
121
  "dev": "tsup --watch",
87
122
  "clean": "rm -rf dist",
88
123
  "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"
124
+ "lint": "eslint src scripts \"test/**/*.ts\" --max-warnings 0 && stylelint \"src/**/*.css\" --max-warnings 0",
125
+ "lint:fix": "eslint src scripts \"test/**/*.ts\" --fix && stylelint \"src/**/*.css\" --fix",
126
+ "test": "node scripts/generate-consumer-theming-fixtures.ts && node scripts/generate-vite-plugin-fixtures.ts && vitest run",
127
+ "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",
128
+ "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
129
  }
96
130
  }
@@ -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,6 +186,7 @@ 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
189
192
  - `--nave-color-action-primary`
@@ -260,7 +263,7 @@ renders nothing.
260
263
  - `--nave-motion-easing-standard`: General-purpose — enters and exits
261
264
  - `--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
265
  - `--nave-radius-card`: Cards, panels, dialogs
263
- - `--nave-radius-control`: Inputs, buttons, tags
266
+ - `--nave-radius-control`: Inputs, buttons, tags, and the popovers, menus and select lists anchored to a control
264
267
  - `--nave-radius-full`: Pill / badge shape
265
268
  - `--nave-radius-none`
266
269
  - `--nave-radius-overlay`: Modals, drawers, sheets