@sola-air-ui/tokens 1.0.1 → 1.1.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/README.md +39 -0
- package/package.json +22 -22
- package/src/index.js +22 -0
- package/src/tokens.css +25 -0
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# @sola-air-ui/tokens
|
|
2
|
+
|
|
3
|
+
Design tokens for [Sola AIR](https://sola-air.dev) — spacing, radius, type scale, color, and semantic palette values, shared across `@sola-air-ui/ui` components so everything renders from one consistent system instead of hardcoded values scattered per component.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @sola-air-ui/tokens
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
**As CSS custom properties** (drop into any stylesheet or `.sola` component):
|
|
14
|
+
|
|
15
|
+
```css
|
|
16
|
+
@import '@sola-air-ui/tokens/css';
|
|
17
|
+
|
|
18
|
+
.my-panel {
|
|
19
|
+
padding: var(--sola-space-lg);
|
|
20
|
+
border-radius: var(--sola-radius-lg);
|
|
21
|
+
color: var(--sola-text-primary);
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**As JS values** (for computed styles, chart theming, etc.):
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
import tokens from '@sola-air-ui/tokens';
|
|
29
|
+
|
|
30
|
+
console.log(tokens.space.lg, tokens.radius.lg, tokens.color.primary);
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Scoping note for widget/iframe environments
|
|
34
|
+
|
|
35
|
+
If you're embedding Sola output inside something that auto-scopes CSS to a container (e.g. a CMS widget sandbox), point the token stylesheet's root selector at your actual mount element rather than `:root` — a scoped `:root` selector matches nothing, since `:root` always resolves to `<html>` regardless of nesting.
|
|
36
|
+
|
|
37
|
+
## License
|
|
38
|
+
|
|
39
|
+
MIT — see the [repo root](https://github.com/rbm3267/sola-air) for the full license and [changelog](https://github.com/rbm3267/sola-air/blob/main/CHANGELOG.md).
|
package/package.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@sola-air-ui/tokens",
|
|
3
|
-
"version": "1.0
|
|
4
|
-
"description": "Design tokens for Sola AIR — spacing, radius, type scale, color, and semantic palette",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./src/index.js",
|
|
7
|
-
"exports": {
|
|
8
|
-
".": "./src/index.js",
|
|
9
|
-
"./css": "./src/tokens.css"
|
|
10
|
-
},
|
|
11
|
-
"keywords": ["sola", "design-tokens", "css-variables", "design-system", "tokens"],
|
|
12
|
-
"license": "MIT",
|
|
13
|
-
"homepage": "https://sola-air.dev",
|
|
14
|
-
"repository": {
|
|
15
|
-
"type": "git",
|
|
16
|
-
"url": "https://github.com/rbm3267/sola-air"
|
|
17
|
-
},
|
|
18
|
-
"publishConfig": {
|
|
19
|
-
"access": "public",
|
|
20
|
-
"registry": "https://registry.npmjs.org/"
|
|
21
|
-
}
|
|
22
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@sola-air-ui/tokens",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Design tokens for Sola AIR — spacing, radius, type scale, color, and semantic palette",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./src/index.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./src/index.js",
|
|
9
|
+
"./css": "./src/tokens.css"
|
|
10
|
+
},
|
|
11
|
+
"keywords": ["sola", "design-tokens", "css-variables", "design-system", "tokens"],
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"homepage": "https://sola-air.dev",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/rbm3267/sola-air"
|
|
17
|
+
},
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public",
|
|
20
|
+
"registry": "https://registry.npmjs.org/"
|
|
21
|
+
}
|
|
22
|
+
}
|
package/src/index.js
CHANGED
|
@@ -94,6 +94,28 @@ export const tokens = {
|
|
|
94
94
|
high: { fg: '#dc2626', bg: '#fef2f2' },
|
|
95
95
|
critical: { fg: '#9333ea', bg: '#faf5ff' },
|
|
96
96
|
},
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Stacking order. nav < dropdown < overlay-scrim < modal/sheet (same tier
|
|
100
|
+
* — mutually exclusive, focused overlays) < toast (always topmost).
|
|
101
|
+
*/
|
|
102
|
+
zIndex: {
|
|
103
|
+
nav: 40,
|
|
104
|
+
dropdown: 100,
|
|
105
|
+
overlay: 800,
|
|
106
|
+
modal: 900,
|
|
107
|
+
sheet: 900,
|
|
108
|
+
toast: 1000,
|
|
109
|
+
},
|
|
110
|
+
|
|
111
|
+
/** One easing curve, two durations — see tokens.css for the rationale. */
|
|
112
|
+
motion: {
|
|
113
|
+
ease: 'cubic-bezier(0.16, 1, 0.3, 1)',
|
|
114
|
+
duration: {
|
|
115
|
+
fast: '160ms',
|
|
116
|
+
base: '240ms',
|
|
117
|
+
},
|
|
118
|
+
},
|
|
97
119
|
};
|
|
98
120
|
|
|
99
121
|
export default tokens;
|
package/src/tokens.css
CHANGED
|
@@ -159,6 +159,31 @@
|
|
|
159
159
|
|
|
160
160
|
/* ─── Focus ring ────────────────────────────────────────────────────────────*/
|
|
161
161
|
--sola-focus-ring: 0 0 0 3px rgba(16, 185, 129, 0.4);
|
|
162
|
+
|
|
163
|
+
/* ─── Z-index scale ─────────────────────────────────────────────────────────
|
|
164
|
+
* Every stacking-context component in the library should sit on one of
|
|
165
|
+
* these steps, never a bare magic number. nav < dropdown < overlay-scrim
|
|
166
|
+
* < modal/sheet (same tier — both are focused, blocking overlays that
|
|
167
|
+
* shouldn't appear at once) < toast (always topmost, so a confirmation
|
|
168
|
+
* or error stays visible even while a modal is open).
|
|
169
|
+
*/
|
|
170
|
+
--sola-z-nav: 40;
|
|
171
|
+
--sola-z-dropdown: 100;
|
|
172
|
+
--sola-z-overlay: 800;
|
|
173
|
+
--sola-z-modal: 900;
|
|
174
|
+
--sola-z-sheet: 900;
|
|
175
|
+
--sola-z-toast: 1000;
|
|
176
|
+
|
|
177
|
+
/* ─── Motion ─────────────────────────────────────────────────────────────────
|
|
178
|
+
* One easing curve, two durations. `fast` for micro-interactions (hover,
|
|
179
|
+
* toggle); `base` for anything that opens/closes a surface (modal, sheet,
|
|
180
|
+
* dropdown). Components should reference these rather than hardcoding
|
|
181
|
+
* their own timing — three different curves across a handful of overlay
|
|
182
|
+
* components is what "inconsistent" looks like in practice.
|
|
183
|
+
*/
|
|
184
|
+
--sola-ease-standard: cubic-bezier(0.16, 1, 0.3, 1);
|
|
185
|
+
--sola-duration-fast: 160ms;
|
|
186
|
+
--sola-duration-base: 240ms;
|
|
162
187
|
}
|
|
163
188
|
|
|
164
189
|
/* ─── Dark mode — system default ─────────────────────────────────────────────
|