@clay-design-system/tokens 0.14.1 → 0.15.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/MIGRATION.md +25 -0
- package/README.md +2 -2
- package/dist/index.cjs +2 -0
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/mq.cjs +20 -0
- package/dist/mq.d.cts +17 -0
- package/dist/tokens.cjs +1144 -0
- package/dist/tokens.d.cts +1142 -0
- package/dist/tokens.d.ts +10 -0
- package/package.json +20 -6
package/MIGRATION.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Migrating `@clay-design-system/tokens` (Phase 2 release)
|
|
2
|
+
|
|
3
|
+
This release adds a CommonJS entry. Nothing is removed, so ESM consumers change nothing.
|
|
4
|
+
|
|
5
|
+
## New: `require()` and `import` conditions
|
|
6
|
+
|
|
7
|
+
`.` and `./mq` now have nested `import` and `require` conditions, each with its own `types` (`.d.ts` for ESM, `.d.cts` for CJS):
|
|
8
|
+
|
|
9
|
+
```js
|
|
10
|
+
const { mq, breakpoints } = require('@clay-design-system/tokens/mq') // dist/mq.cjs
|
|
11
|
+
const tokens = require('@clay-design-system/tokens') // dist/index.cjs
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The CJS and ESM builds expose the same 1,142 constants with the same values. The tokens package has no dependencies, so `require()`
|
|
15
|
+
works on any supported Node version.
|
|
16
|
+
|
|
17
|
+
## Fixed: type declarations
|
|
18
|
+
|
|
19
|
+
`dist/index.d.ts` now declares all 1,142 constants (ten long-valued shadow and font-family constants were missing) and no longer
|
|
20
|
+
declares a `tokens` export that never existed at runtime. If you imported `tokens` as a type, import the constants you need instead.
|
|
21
|
+
|
|
22
|
+
## Unchanged, and one new subpath
|
|
23
|
+
|
|
24
|
+
`./css` (`dist/tokens.css`), `./css-resolved` and `./stylelint-plugin/*` (ESM files loaded by stylelint's config). `./package.json` is a new exported subpath.
|
|
25
|
+
Packed size grew from 0.05 MB to 0.07 MB for the CJS twins and declarations.
|
package/README.md
CHANGED
|
@@ -65,8 +65,8 @@ src/
|
|
|
65
65
|
|
|
66
66
|
- `dist/tokens.css` (`@clay-design-system/tokens/css`) — every tier as CSS custom properties on `:root`; aliases stay `var()` so changes cascade
|
|
67
67
|
- `dist/tokens.resolved.css` (`@clay-design-system/tokens/css-resolved`) — the same with literal values
|
|
68
|
-
- `dist/tokens.js` + `.d.ts` (`@clay-design-system/tokens`) — JS constants (used by `@clay-design-system/email`)
|
|
69
|
-
- `dist/mq.js` (`@clay-design-system/tokens/mq`) — `mq` / `breakpoints` media-query helpers
|
|
68
|
+
- `dist/tokens.js` + `.d.ts` (`@clay-design-system/tokens`) — JS constants (used by `@clay-design-system/email`); `dist/index.cjs` + `.d.cts` for `require()`
|
|
69
|
+
- `dist/mq.js` / `mq.cjs` (`@clay-design-system/tokens/mq`) — `mq` / `breakpoints` media-query helpers, ESM and CJS
|
|
70
70
|
- `dist/TOKEN_REFERENCE.md` — a generated listing of every token
|
|
71
71
|
|
|
72
72
|
## Usage
|
package/dist/index.cjs
ADDED
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tokens.cjs';
|
package/dist/index.d.ts
CHANGED
package/dist/mq.cjs
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
// Auto-generated by @clay-design-system/tokens build from src/semantic/breakpoints.json — do not edit.
|
|
3
|
+
const breakpoints = {
|
|
4
|
+
mobile: 0,
|
|
5
|
+
largeMobile: 480,
|
|
6
|
+
tablet: 768,
|
|
7
|
+
laptop: 992,
|
|
8
|
+
smallDesktop: 1024,
|
|
9
|
+
desktop: 1280,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const mq = {
|
|
13
|
+
largeMobile: '@media (min-width: 480px)',
|
|
14
|
+
tablet: '@media (min-width: 768px)',
|
|
15
|
+
laptop: '@media (min-width: 992px)',
|
|
16
|
+
smallDesktop: '@media (min-width: 1024px)',
|
|
17
|
+
desktop: '@media (min-width: 1280px)',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
module.exports = { breakpoints, mq };
|
package/dist/mq.d.cts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Auto-generated by @clay-design-system/tokens build from src/semantic/breakpoints.json — do not edit.
|
|
2
|
+
export declare const breakpoints: {
|
|
3
|
+
mobile: 0;
|
|
4
|
+
largeMobile: 480;
|
|
5
|
+
tablet: 768;
|
|
6
|
+
laptop: 992;
|
|
7
|
+
smallDesktop: 1024;
|
|
8
|
+
desktop: 1280;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export declare const mq: {
|
|
12
|
+
largeMobile: string;
|
|
13
|
+
tablet: string;
|
|
14
|
+
laptop: string;
|
|
15
|
+
smallDesktop: string;
|
|
16
|
+
desktop: string;
|
|
17
|
+
};
|