@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/ATOMS.md +1 -1
- package/CONSUMER-ATOMS.md +41 -8
- package/LICENSE +36 -0
- package/README.md +611 -46
- package/dist/atom-names-2OreuBx9.d.ts +27 -0
- package/dist/atomic.css +3 -1
- package/dist/atoms.d.ts +10 -14
- package/dist/atoms.js +2 -1
- package/dist/bin.d.ts +1 -0
- package/dist/bin.js +453 -0
- package/dist/check.d.ts +31 -0
- package/dist/check.js +11 -0
- package/dist/chunk-2A7IUZBH.js +31 -0
- package/dist/{chunk-BVON7XKC.js → chunk-CUL5PLPI.js} +8 -6
- package/dist/chunk-E5F6YF7A.js +2428 -0
- package/dist/chunk-GZL2VW7C.js +57 -0
- package/dist/chunk-LADFXRWQ.js +1089 -0
- package/dist/chunk-LQSGQ2OA.js +94 -0
- package/dist/chunk-NFS2REPQ.js +747 -0
- package/dist/chunk-NKUZNRF4.js +42 -0
- package/dist/chunk-SYNQJNVB.js +302 -0
- package/dist/chunk-UANF3FGO.js +115 -0
- package/dist/chunk-XQQCDUV6.js +152 -0
- package/dist/collect.d.ts +279 -0
- package/dist/collect.js +4 -0
- package/dist/cx.d.ts +23 -4
- package/dist/cx.js +19 -1
- package/dist/lightningcss.d.ts +51 -0
- package/dist/lightningcss.js +44 -0
- package/dist/no-tokens.css +7 -7
- package/dist/postcss.cjs +1 -0
- package/dist/postcss.d.cts +2 -0
- package/dist/postcss.d.ts +30 -15
- package/dist/postcss.js +237 -243
- package/dist/standalone.css +1139 -0
- package/dist/vite-options-D1-hGA9L.d.ts +86 -0
- package/dist/vite.d.ts +368 -0
- package/dist/vite.js +3318 -0
- package/package.json +55 -17
- package/skills/navecss/SKILL.md +7 -2
package/ATOMS.md
CHANGED
|
@@ -67,7 +67,7 @@ variants, if any.
|
|
|
67
67
|
| Atom | Class | Declarations | Variants |
|
|
68
68
|
| --------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
69
69
|
| `interactive` | `nave-interactive` | `cursor: pointer;`<br>`-webkit-user-select: none;`<br>`user-select: none;`<br>`-webkit-tap-highlight-color: transparent;` | — |
|
|
70
|
-
| `focusRing` | `nave-focus-ring` | `outline: none;` | `:focus-visible` — `outline: var(--nave-border-width-focus)
|
|
70
|
+
| `focusRing` | `nave-focus-ring` | `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;` |
|
|
71
71
|
| `disabledState` | `nave-disabled-state` | — | `: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. |
|
|
72
72
|
|
|
73
73
|
## Visual
|
package/CONSUMER-ATOMS.md
CHANGED
|
@@ -17,7 +17,7 @@ not.
|
|
|
17
17
|
|
|
18
18
|
```ts
|
|
19
19
|
// src/design-system/atoms.ts
|
|
20
|
-
import type { AtomDefinition } from '@navecss/core/
|
|
20
|
+
import type { AtomDefinition } from '@navecss/core/atoms'
|
|
21
21
|
import { media } from '@navecss/tokens/breakpoints'
|
|
22
22
|
|
|
23
23
|
export const myAtoms: Record<string, AtomDefinition> = {
|
|
@@ -50,22 +50,53 @@ export const myAtoms: Record<string, AtomDefinition> = {
|
|
|
50
50
|
|
|
51
51
|
## Registering with the plugin
|
|
52
52
|
|
|
53
|
+
On Vite, pass `extend` to the Vite plugin:
|
|
54
|
+
|
|
53
55
|
```ts
|
|
54
56
|
// vite.config.ts
|
|
55
57
|
import { defineConfig } from 'vite'
|
|
56
|
-
import { navePlugin } from '@navecss/core/
|
|
58
|
+
import { navePlugin } from '@navecss/core/vite'
|
|
57
59
|
import { myAtoms } from './src/design-system/atoms'
|
|
58
60
|
|
|
59
61
|
export default defineConfig({
|
|
60
|
-
// your existing options
|
|
61
|
-
|
|
62
|
+
// your existing options stay as they are; add navePlugin() to your existing plugins
|
|
63
|
+
plugins: [navePlugin({ extend: myAtoms })],
|
|
62
64
|
build: { cssTarget: ['chrome125', 'edge125', 'firefox128', 'safari18', 'ios18'] },
|
|
63
65
|
})
|
|
64
66
|
```
|
|
65
67
|
|
|
66
68
|
`build.cssTarget` is the browser floor, in Vite's terms:
|
|
67
|
-
[
|
|
68
|
-
without it.
|
|
69
|
+
[Vite plugin setup](./README.md#vite-plugin-setup) says what goes wrong
|
|
70
|
+
without it. On Next.js, webpack or another pipeline that runs PostCSS plugins, pass
|
|
71
|
+
the same `extend` to `navePlugin` from `@navecss/core/postcss`, in your PostCSS
|
|
72
|
+
config ([PostCSS plugin setup](./README.md#postcss-plugin-setup)).
|
|
73
|
+
|
|
74
|
+
**An `extend` object, written inline in a cached host's config or imported
|
|
75
|
+
into it as above, does not invalidate that host's cache.** A host with a
|
|
76
|
+
persistent build cache (webpack's, for instance) does not know your atoms
|
|
77
|
+
module is an input to the CSS it cached, so a warm rebuild after you edit an
|
|
78
|
+
atom can still ship the old value. Pass `extend` as a path to the module
|
|
79
|
+
instead, and the plugin declares that file to the host as a dependency, which
|
|
80
|
+
lets the host's own cache key see it (the PostCSS plugin on every stylesheet it
|
|
81
|
+
processes, the Vite plugin on every stylesheet that holds a directive):
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
navePlugin({ extend: './src/design-system/atoms.mjs' })
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The path is resolved from the directory the build runs in (`process.cwd()`) for
|
|
88
|
+
the PostCSS plugin, and from Vite's project root for the Vite plugin, not from
|
|
89
|
+
the config file, and it names a file, extension included: a package name is not
|
|
90
|
+
looked up. Node's own `import()` loads it, with no bundler in between, so it has
|
|
91
|
+
to be a JavaScript module or a JSON file, and its default export (or, for JSON,
|
|
92
|
+
its parsed top-level value) is the atoms object: for the module above,
|
|
93
|
+
`export default myAtoms`.
|
|
94
|
+
|
|
95
|
+
With a path the PostCSS plugin is async: call `process(css).then(cb)`, not the
|
|
96
|
+
sync `.css` getter. Either plugin re-reads the file whenever the file changes,
|
|
97
|
+
so a dev server sees an edit to it without a restart. Only that file: an edit to
|
|
98
|
+
a module it imports is neither re-read nor visible to the host's cache, so keep
|
|
99
|
+
the atoms themselves in the file you name.
|
|
69
100
|
|
|
70
101
|
## Using consumer atoms
|
|
71
102
|
|
|
@@ -100,7 +131,9 @@ Compiles to:
|
|
|
100
131
|
border-radius: var(--nave-radius-control);
|
|
101
132
|
font-weight: var(--nave-font-weight-medium);
|
|
102
133
|
&:focus-visible {
|
|
103
|
-
outline:
|
|
134
|
+
outline-style: solid;
|
|
135
|
+
outline-width: var(--nave-border-width-focus, 2px);
|
|
136
|
+
outline-color: var(--nave-color-border-focus, currentColor);
|
|
104
137
|
outline-offset: 2px;
|
|
105
138
|
}
|
|
106
139
|
&:hover {
|
|
@@ -195,7 +228,7 @@ Container thresholds are component-specific — there is no universal
|
|
|
195
228
|
|
|
196
229
|
```ts
|
|
197
230
|
// src/design-system/atoms.ts
|
|
198
|
-
import type { AtomDefinition } from '@navecss/core/
|
|
231
|
+
import type { AtomDefinition } from '@navecss/core/atoms'
|
|
199
232
|
|
|
200
233
|
export const myAtoms: Record<string, AtomDefinition> = {
|
|
201
234
|
adaptiveCard: {
|
package/LICENSE
CHANGED
|
@@ -19,3 +19,39 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
THIRD-PARTY MATERIAL
|
|
24
|
+
|
|
25
|
+
This package includes material copied from or derived from the CSS Syntax
|
|
26
|
+
Module Level 3 specification (css-syntax-3/Overview.bs in the w3c/csswg-drafts
|
|
27
|
+
repository, at commit f971255463f01fb740e2a3a7ecfe83e319cddab9, and
|
|
28
|
+
https://drafts.csswg.org/css-syntax-3/#tokenization). Copyright (c) 2026 World
|
|
29
|
+
Wide Web Consortium. That specification, and the repository carrying it, are
|
|
30
|
+
published under the W3C Software and Document License
|
|
31
|
+
(https://www.w3.org/copyright/software-license-2023/).
|
|
32
|
+
|
|
33
|
+
What is copied is implemented in src/directive/tokenizer.ts, the files in
|
|
34
|
+
src/directive/tokenizer/ and src/directive/block-reader.ts, all built into the
|
|
35
|
+
JavaScript under dist/: the names of the token types and of their type flags,
|
|
36
|
+
the definitions of the code point classes (among them the ranges of non-ASCII
|
|
37
|
+
ident code points and of non-printable code points, and the maximum allowed
|
|
38
|
+
code point), the order of the steps of the tokenization algorithms, and the
|
|
39
|
+
rule that tells a declaration from a qualified rule. The code implementing them
|
|
40
|
+
is this package's own, and everything in this package is offered under the MIT
|
|
41
|
+
licence above.
|
|
42
|
+
|
|
43
|
+
This package also includes material copied from or derived from ECMA-426,
|
|
44
|
+
Source map format specification (spec.emu in the tc39/ecma426 repository, at
|
|
45
|
+
commit c724f0f494b44b21b651fdbd6412d3437eef0e72, and
|
|
46
|
+
https://tc39.es/ecma426/#sec-base64-vlq). Copyright (c) Ecma International.
|
|
47
|
+
That specification is published under Ecma's alternative copyright notice
|
|
48
|
+
(https://ecma-international.org/policies/by-ipr/ecma-text-copyright-policy/).
|
|
49
|
+
The base64 digits it uses are those of RFC 4648, The Base16, Base32, and
|
|
50
|
+
Base64 Data Encodings (https://www.rfc-editor.org/rfc/rfc4648). Copyright (C)
|
|
51
|
+
The Internet Society (2006).
|
|
52
|
+
|
|
53
|
+
What is copied is implemented in src/directive/source-map.ts, built into the
|
|
54
|
+
JavaScript under dist/: the member names of a version 3 source map, the
|
|
55
|
+
layout of its mappings string, the base64 VLQ encoding of each field in it,
|
|
56
|
+
and the base64 alphabet. The code implementing them is this package's own, and
|
|
57
|
+
everything in this package is offered under the MIT licence above.
|