@nsaa/tokens 0.0.0-stage → 0.1.0-alpha.1
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/LICENSE +28 -0
- package/NOTICE +154 -0
- package/README.md +66 -2
- package/dist/contrast-report.md +1484 -0
- package/dist/figma-variables.json +4288 -0
- package/dist/motion.ts +180 -0
- package/dist/nsaa.css +2491 -0
- package/dist/shadcn-theme.json +90 -0
- package/dist/tokens.resolved.json +1351 -0
- package/package.json +31 -3
- package/src/color.json +850 -0
- package/src/effects.json +73 -0
- package/src/primitives-p3.json +686 -0
- package/src/primitives.json +688 -0
- package/src/shadcn.json +38 -0
- package/src/theme.json +70 -0
- package/src/type.json +208 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Orim Studio
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
This licence covers the free packages in this repository. The Pro package
|
|
26
|
+
(`packages/blocks`, when it exists) ships under its own commercial licence,
|
|
27
|
+
stated in that folder. Third-party code adapted into Nsaa keeps its original
|
|
28
|
+
notice in the file header; colour scales come from Radix Colors (MIT).
|
package/NOTICE
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
Nsaa
|
|
2
|
+
Copyright (c) 2026 Orim Studio. Licensed under the MIT License (see LICENSE).
|
|
3
|
+
|
|
4
|
+
This product includes code from the projects below. Their notices follow, as their licences require.
|
|
5
|
+
Runtime dependencies that are not copied in (Base UI, cmdk, input-otp, UISFX, ...) carry their own
|
|
6
|
+
licences in their packages; THIRD_PARTY.md lists every source.
|
|
7
|
+
|
|
8
|
+
-------------------------------------------------------------------------------
|
|
9
|
+
loading.dev (https://github.com/jakubkrehel/loading), pinned at
|
|
10
|
+
755235bf7eea3dfb05ec4c3661088e3521ee2d75. Used in packages/core/src/loaders (vendored).
|
|
11
|
+
|
|
12
|
+
MIT License
|
|
13
|
+
|
|
14
|
+
Copyright (c) 2026 Jakub Krehel
|
|
15
|
+
|
|
16
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
17
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
18
|
+
in the Software without restriction, including without limitation the rights
|
|
19
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
20
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
21
|
+
furnished to do so, subject to the following conditions:
|
|
22
|
+
|
|
23
|
+
The above copyright notice and this permission notice shall be included in all
|
|
24
|
+
copies or substantial portions of the Software.
|
|
25
|
+
|
|
26
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
27
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
28
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
29
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
30
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
31
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
32
|
+
SOFTWARE.
|
|
33
|
+
|
|
34
|
+
-------------------------------------------------------------------------------
|
|
35
|
+
Loading UI (https://github.com/turbostarter/loading-ui), pinned at
|
|
36
|
+
d78e09e09f9963ae87974593784a4948f612f80d. Rebuilt in packages/core/src/loaders/text.
|
|
37
|
+
|
|
38
|
+
MIT License
|
|
39
|
+
|
|
40
|
+
Copyright (c) 2026 Bartosz Zagrodzki
|
|
41
|
+
|
|
42
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
43
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
44
|
+
in the Software without restriction, including without limitation the rights
|
|
45
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
46
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
47
|
+
furnished to do so, subject to the following conditions:
|
|
48
|
+
|
|
49
|
+
The above copyright notice and this permission notice shall be included in all
|
|
50
|
+
copies or substantial portions of the Software.
|
|
51
|
+
|
|
52
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
53
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
54
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
55
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
56
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
57
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
58
|
+
SOFTWARE.
|
|
59
|
+
|
|
60
|
+
-------------------------------------------------------------------------------
|
|
61
|
+
shadcn/ui (https://github.com/shadcn-ui/ui), style base-nova. Adapted in
|
|
62
|
+
packages/core/src (the base-nova components), packages/data-table/src/ui and registry/.
|
|
63
|
+
|
|
64
|
+
MIT License
|
|
65
|
+
|
|
66
|
+
Copyright (c) 2023 shadcn
|
|
67
|
+
|
|
68
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
69
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
70
|
+
in the Software without restriction, including without limitation the rights
|
|
71
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
72
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
73
|
+
furnished to do so, subject to the following conditions:
|
|
74
|
+
|
|
75
|
+
The above copyright notice and this permission notice shall be included in all
|
|
76
|
+
copies or substantial portions of the Software.
|
|
77
|
+
|
|
78
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
79
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
80
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
81
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
82
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
83
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
84
|
+
SOFTWARE.
|
|
85
|
+
|
|
86
|
+
-------------------------------------------------------------------------------
|
|
87
|
+
ReUI (https://github.com/keenthemes/reui), free repository, v2.8.1. Adapted in
|
|
88
|
+
packages/data-table/src/reui and packages/data-table/src/transactions.example.tsx.
|
|
89
|
+
|
|
90
|
+
MIT License
|
|
91
|
+
|
|
92
|
+
Copyright (c) 2025 Keenthemes Inc.
|
|
93
|
+
|
|
94
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
95
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
96
|
+
in the Software without restriction, including without limitation the rights
|
|
97
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
98
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
99
|
+
furnished to do so, subject to the following conditions:
|
|
100
|
+
|
|
101
|
+
The above copyright notice and this permission notice shall be included in all
|
|
102
|
+
copies or substantial portions of the Software.
|
|
103
|
+
|
|
104
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
105
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
106
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
107
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
108
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
109
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
110
|
+
SOFTWARE.
|
|
111
|
+
|
|
112
|
+
-------------------------------------------------------------------------------
|
|
113
|
+
Lucide (https://lucide.dev). Icons inlined in packages/core/src (check, chevrons, x
|
|
114
|
+
and others). Some of these icons derive from Feather; its MIT notice follows.
|
|
115
|
+
|
|
116
|
+
ISC License
|
|
117
|
+
|
|
118
|
+
Copyright (c) 2026 Lucide Icons and Contributors
|
|
119
|
+
|
|
120
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
121
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
122
|
+
copyright notice and this permission notice appear in all copies.
|
|
123
|
+
|
|
124
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
125
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
126
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
127
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
128
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
129
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
130
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
131
|
+
|
|
132
|
+
Feather (https://github.com/feathericons/feather), for the Lucide icons derived from it.
|
|
133
|
+
|
|
134
|
+
The MIT License (MIT)
|
|
135
|
+
|
|
136
|
+
Copyright (c) 2013-present Cole Bemis
|
|
137
|
+
|
|
138
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
139
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
140
|
+
in the Software without restriction, including without limitation the rights
|
|
141
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
142
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
143
|
+
furnished to do so, subject to the following conditions:
|
|
144
|
+
|
|
145
|
+
The above copyright notice and this permission notice shall be included in all
|
|
146
|
+
copies or substantial portions of the Software.
|
|
147
|
+
|
|
148
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
149
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
150
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
151
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
152
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
153
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
154
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,67 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @nsaa/tokens
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Nsaa's design tokens: one source, every output. Colours are **Radix Colors v3 (MIT)**, the same palette Interfere uses, with Nsaa's contrast fixes so every text pairing passes WCAG AA.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
src/ the source of truth (edit these)
|
|
7
|
+
primitives.json Radix scales, light + dark (gray, blue, green, orange, tomato, iris, black/white alpha), sRGB
|
|
8
|
+
primitives-p3.json the same scales in Display-P3, used on wide-gamut screens
|
|
9
|
+
shadcn.json shadcn/ui base-nova neutral values (#84, #85): copied into our tokens by build.py; shadcn names are emitted as aliases and checked for exact parity
|
|
10
|
+
color.json 116 semantic colours, brand palettes (neutral default, blue; #81) + 19 effect colours (shadow/*, surface/*) ({name} = primitive, {@name} = semantic, {"mix": [a, b, amount]} = OKLab mix, {"alpha": [ref, a]} = ref at opacity a)
|
|
11
|
+
type.json Geist / Newsreader / Geist Mono roles + text styles
|
|
12
|
+
theme.json the axes: theme, corners, surface; radius scale
|
|
13
|
+
effects.json shadows, spacing, motion (feel spec), sound (`shadow-inset`: the 0.5 px inset hairline of the soft input, #66)
|
|
14
|
+
build.py python3 build.py (stdlib only)
|
|
15
|
+
dist/ generated, do not edit
|
|
16
|
+
nsaa.css CSS variables (--nsaa-*), axes (incl. data-brand), shadcn alias layer (#81), helper classes, Tailwind v4 @theme mapping
|
|
17
|
+
tokens.resolved.json every value resolved to hex per mode
|
|
18
|
+
figma-variables.json collections + modes for Figma variables
|
|
19
|
+
motion.ts springs, easings, durations, gesture helpers, sound map for Motion
|
|
20
|
+
contrast-report.md every checked pairing and its ratio
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Use
|
|
24
|
+
|
|
25
|
+
```html
|
|
26
|
+
<link rel="stylesheet" href="@nsaa/tokens/css">
|
|
27
|
+
<html data-mode="system" data-theme="default" data-corners="round" data-surface="flat">
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Any element can override an axis for its subtree:
|
|
31
|
+
|
|
32
|
+
| Attribute | Values | Controls |
|
|
33
|
+
|---|---|---|
|
|
34
|
+
| `data-mode` (or `.dark`) | `light`, `dark`, `system` | All colours, shadows, surfaces |
|
|
35
|
+
| `data-theme` | `default`, `editorial`, `soft`, `pill`, `sharp` | Heading font, weight, tracking; radius roles (`radius-control-multiline` for fields that grow to several lines, #78) |
|
|
36
|
+
| `data-corners` | `round`, `squircle` | Radius multiplier (1 / 1.25) and `corner-shape` |
|
|
37
|
+
| `data-surface` | `flat`, `halo`, `glass`, `neu` | `--nsaa-surface-*` (bg, border, shadow, blur, rim) |
|
|
38
|
+
| `data-contrast` | `more` | Opt-in to the `prefers-contrast: more` overrides marked `contrastMore` (today `border-input` → `border-control`, 3:1), for apps that must meet WCAG 1.4.11 everywhere (#62) |
|
|
39
|
+
|
|
40
|
+
Set the mode on `<html>` (or above any surface) so surfaces pick up the right mode.
|
|
41
|
+
|
|
42
|
+
Helper classes: `.nsaa-surface` (applies the current surface), `.nsaa-shape` (applies squircles where supported), `.nsaa-rtl-mirror` (flips a direction-bearing icon such as an arrow or chevron under `dir="rtl"`; mark only those icons), `.text-heading-1` … `.text-code-xs`.
|
|
43
|
+
|
|
44
|
+
With Tailwind v4, import `nsaa.css` after Tailwind: utilities like `bg-brand-solid`, `text-secondary-foreground`, `rounded-button-md`, `shadow-large`, `ease-drawer` map to the Nsaa variables.
|
|
45
|
+
|
|
46
|
+
## Quality gate
|
|
47
|
+
|
|
48
|
+
`build.py` checks every pairing (light, dark, light + high contrast) in both sRGB and Display-P3: all text needs 4.5:1, focus rings, control borders and brand fills need 3:1. **The build fails if any pair is under.** Current result: PASS, 0 failing.
|
|
49
|
+
|
|
50
|
+
## Contrast fixes over Interfere
|
|
51
|
+
|
|
52
|
+
| Token | Interfere | Nsaa |
|
|
53
|
+
|---|---|---|
|
|
54
|
+
| `brand-solid` (light) | blue-9, white text 3.3:1 | blue-11 (4.8:1); `brand-fill` = blue-9 for text-free fills |
|
|
55
|
+
| `positive/warning/danger-solid` (light) | step 9, white 3.0–3.9:1 | step 11 (4.5–5.0:1); dark mode keeps step 9 with dark text |
|
|
56
|
+
| `*-foreground` (coloured text, light) | step a10 | step 11 deepened 18% (passes on page, shell, card, component) |
|
|
57
|
+
| `on-*-subtle-foreground` | step a9/a11 | step 12 (light) / 11 (dark) |
|
|
58
|
+
| `tertiary-foreground` | gray-a9 (3.3:1) | gray-a11; new `icon-tertiary` = gray-a9 for icons only |
|
|
59
|
+
| `brand-border-focus` | blue-a8 (2.3:1) | blue-9 (3.3:1) |
|
|
60
|
+
| new `border-control` | n/a | gray-a9 for input / checkbox outlines (3:1, WCAG 1.4.11) |
|
|
61
|
+
| high-contrast `primary-foreground` | white (bug) | gray-a12 |
|
|
62
|
+
|
|
63
|
+
## Notes
|
|
64
|
+
|
|
65
|
+
- Squircles: native `corner-shape` works in Chromium 139+; others fall back to round. Figma corner smoothing can't be bound to variables, so the Figma script sets it from `Corners/corner/smoothing`.
|
|
66
|
+
- Glass falls back to Flat under `prefers-reduced-transparency`; reduced motion removes movement, scale and blur (fades stay).
|
|
67
|
+
- Sound is on by default with safeguards (see `effects.json`); cue values are UISFX 0.4.0 cue names and `feel` is a UISFX pack (#57).
|