@moda/tokens 5.5.1 → 5.5.4
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/CHANGELOG.md +22 -0
- package/dist/helpers.d.ts +28 -28
- package/dist/helpers.js +13 -10
- package/dist/helpers.js.map +1 -1
- package/dist/includePaths.js +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/package.json +20 -10
- package/src/helpers.ts +22 -19
- package/src/includePaths.js +1 -1
- package/src/includePaths.ts +2 -2
- package/src/index.ts +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See
|
|
4
4
|
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [5.5.4](https://github.com/ModaOperandi/tokens/compare/v5.5.3...v5.5.4) (2022-09-05)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* netlify build ([d163d37](https://github.com/ModaOperandi/tokens/commit/d163d3738110be38946781215846313b97cabe01))
|
|
12
|
+
* predeploy ([3053346](https://github.com/ModaOperandi/tokens/commit/305334685845108d85ca28dd2b8951289808c7b3))
|
|
13
|
+
|
|
14
|
+
## [5.5.3](https://github.com/ModaOperandi/tokens/compare/v5.5.2...v5.5.3) (2022-07-05)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **config:** put root dir back to "src" ([bbe7eb5](https://github.com/ModaOperandi/tokens/commit/bbe7eb5a0efb21d86bd7e97fc89fa14dc01f7db2))
|
|
20
|
+
|
|
21
|
+
## [5.5.2](https://github.com/ModaOperandi/tokens/compare/v5.5.1...v5.5.2) (2022-07-01)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
25
|
+
|
|
26
|
+
* **storybook:** fix the reference to root package ([81b90cc](https://github.com/ModaOperandi/tokens/commit/81b90cc5664b1037f115a18d9bd96f237884ffa9))
|
|
27
|
+
|
|
6
28
|
## [5.5.1](https://github.com/ModaOperandi/tokens/compare/v5.5.0...v5.5.1) (2021-10-27)
|
|
7
29
|
|
|
8
30
|
|
package/dist/helpers.d.ts
CHANGED
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
import { colors } from
|
|
2
|
-
import { typography } from
|
|
1
|
+
import { colors } from './colors';
|
|
2
|
+
import { typography } from './typography';
|
|
3
3
|
export declare type Font = keyof typeof typography.fonts;
|
|
4
|
-
export declare type TextTreatment = keyof typeof typography[
|
|
4
|
+
export declare type TextTreatment = keyof typeof typography['text-treatments'];
|
|
5
5
|
export declare type Color = keyof typeof colors.all;
|
|
6
|
-
export declare const text: (name: TextTreatment, font?: "
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
export declare const text: (name: TextTreatment, font?: "code" | "serif" | "sans") => {
|
|
7
|
+
'font-family': string;
|
|
8
|
+
'line-height': string;
|
|
9
9
|
"font-size": string;
|
|
10
10
|
"letter-spacing": number;
|
|
11
11
|
} | {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
'font-family': string;
|
|
13
|
+
'line-height': string;
|
|
14
14
|
"font-size": string;
|
|
15
15
|
"letter-spacing": number;
|
|
16
16
|
} | {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
'font-family': string;
|
|
18
|
+
'line-height': string;
|
|
19
19
|
"font-size": string;
|
|
20
20
|
"letter-spacing": number;
|
|
21
21
|
} | {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
'font-family': string;
|
|
23
|
+
'line-height': string;
|
|
24
24
|
"font-size": string;
|
|
25
25
|
"letter-spacing": number;
|
|
26
26
|
} | {
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
'font-family': string;
|
|
28
|
+
'line-height': string;
|
|
29
29
|
"font-size": string;
|
|
30
30
|
"letter-spacing": number;
|
|
31
31
|
} | {
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
'font-family': string;
|
|
33
|
+
'line-height': string;
|
|
34
34
|
"font-size": string;
|
|
35
35
|
"letter-spacing": string;
|
|
36
36
|
} | {
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
'font-family': string;
|
|
38
|
+
'line-height': string;
|
|
39
39
|
"font-size": string;
|
|
40
40
|
"letter-spacing": string;
|
|
41
41
|
} | {
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
'font-family': string;
|
|
43
|
+
'line-height': string;
|
|
44
44
|
"font-size": string;
|
|
45
45
|
"letter-spacing": string;
|
|
46
46
|
} | {
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
'font-family': string;
|
|
48
|
+
'line-height': string;
|
|
49
49
|
"font-size": string;
|
|
50
50
|
"letter-spacing": string;
|
|
51
51
|
"font-weight": string;
|
|
52
52
|
} | {
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
'font-family': string;
|
|
54
|
+
'line-height': string;
|
|
55
55
|
"font-size": string;
|
|
56
56
|
"letter-spacing": string;
|
|
57
57
|
} | {
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
'font-family': string;
|
|
59
|
+
'line-height': string;
|
|
60
60
|
"font-size": string;
|
|
61
61
|
"letter-spacing": string;
|
|
62
62
|
"text-transform": string;
|
|
63
63
|
};
|
|
64
64
|
export declare const remToUnitlessPx: (value: string) => number;
|
|
65
|
-
export declare const color: (name: Color, alpha?: number
|
|
66
|
-
export declare const spacing: (
|
|
65
|
+
export declare const color: (name: Color, alpha?: number) => string;
|
|
66
|
+
export declare const spacing: (topY: number | string, rightX?: number | string, bottom?: number | string, left?: number | string) => string | number | undefined;
|
package/dist/helpers.js
CHANGED
|
@@ -26,28 +26,31 @@ var colors_1 = require("./colors");
|
|
|
26
26
|
var space_1 = require("./space");
|
|
27
27
|
var typography_1 = require("./typography");
|
|
28
28
|
var text = function (name, font) {
|
|
29
|
-
if (font === void 0) { font =
|
|
30
|
-
var treatment = typography_1.typography[
|
|
31
|
-
return __assign(__assign({}, treatment), {
|
|
29
|
+
if (font === void 0) { font = 'sans'; }
|
|
30
|
+
var treatment = typography_1.typography['text-treatments'][name];
|
|
31
|
+
return __assign(__assign({}, treatment), { 'font-family': typography_1.typography.fonts[font].join(','), 'line-height': "".concat(treatment['line-height']) });
|
|
32
32
|
};
|
|
33
33
|
exports.text = text;
|
|
34
34
|
var remToUnitlessPx = function (value) {
|
|
35
|
-
return parseFloat(value) * parseInt(typography_1.typography[
|
|
35
|
+
return parseFloat(value) * parseInt(typography_1.typography['root-font-size'], 10);
|
|
36
36
|
};
|
|
37
37
|
exports.remToUnitlessPx = remToUnitlessPx;
|
|
38
38
|
var color = function (name, alpha) {
|
|
39
39
|
var _a;
|
|
40
40
|
var color = colors_1.colors.all[name];
|
|
41
|
-
return alpha != null
|
|
41
|
+
return alpha != null
|
|
42
|
+
? // eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
43
|
+
colorString.to.rgb(__spreadArray(__spreadArray([], (((_a = colorString.get.rgb(color)) === null || _a === void 0 ? void 0 : _a.slice(0, 3)) || []), true), [alpha], false))
|
|
44
|
+
: color;
|
|
42
45
|
};
|
|
43
46
|
exports.color = color;
|
|
44
|
-
var spacing = function (
|
|
45
|
-
return [
|
|
47
|
+
var spacing = function (topY, rightX, bottom, left) {
|
|
48
|
+
return [topY, rightX, bottom, left].reduce(function (acc, value) {
|
|
46
49
|
var _a;
|
|
47
|
-
if (
|
|
50
|
+
if (value === undefined)
|
|
48
51
|
return acc;
|
|
49
|
-
return [acc, (_a = space_1.space.scale[
|
|
50
|
-
},
|
|
52
|
+
return [acc, (_a = space_1.space.scale[value]) !== null && _a !== void 0 ? _a : value].join(' ');
|
|
53
|
+
}, '');
|
|
51
54
|
};
|
|
52
55
|
exports.spacing = spacing;
|
|
53
56
|
//# sourceMappingURL=helpers.js.map
|
package/dist/helpers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sour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CAAC;IAC/B,OAAO,KAAK,IAAI,IAAI;QAClB,CAAC,CAAC,+DAA+D;YAC/D,WAAW,CAAC,EAAE,CAAC,GAAG,iCAAK,CAAC,CAAA,MAAA,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,0CAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,KAAI,EAAE,CAAC,UAAE,KAAK,UAAE;QACjF,CAAC,CAAC,KAAK,CAAC;AACZ,CAAC,CAAC;AANW,QAAA,KAAK,SAMhB;AAEK,IAAM,OAAO,GAAG,UACrB,IAAqB,EACrB,MAAwB,EACxB,MAAwB,EACxB,IAAsB;IAEtB,OAAA,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,MAAM,CAAC,UAAC,GAAG,EAAE,KAAK;;QAC7C,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,GAAG,CAAC;QACpC,OAAO,CAAC,GAAG,EAAE,MAAA,aAAK,CAAC,KAAK,CAAC,KAAK,CAAC,mCAAI,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACtD,CAAC,EAAE,EAAE,CAAC;AAHN,CAGM,CAAC;AATI,QAAA,OAAO,WASX"}
|
package/dist/includePaths.js
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.includePaths = void 0;
|
|
4
4
|
var path = require("path");
|
|
5
|
-
exports.includePaths = [path.join(__dirname,
|
|
5
|
+
exports.includePaths = [path.join(__dirname, '../lib/assets/stylesheets')];
|
|
6
6
|
//# sourceMappingURL=includePaths.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { colors } from
|
|
2
|
-
export { typography } from
|
|
3
|
-
export { space } from
|
|
4
|
-
export { breakpoints } from
|
|
5
|
-
export * from
|
|
1
|
+
export { colors } from './colors';
|
|
2
|
+
export { typography } from './typography';
|
|
3
|
+
export { space } from './space';
|
|
4
|
+
export { breakpoints } from './breakpoints';
|
|
5
|
+
export * from './helpers';
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,iCAAgC;AAAvB,8FAAA,KAAK,OAAA;AACd,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,4CAA0B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moda/tokens",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.4",
|
|
4
4
|
"description": "Constant values for modaoperandi.com",
|
|
5
5
|
"repository": "git@github.com:ModaOperandi/tokens.git",
|
|
6
6
|
"author": "Moda Operandi",
|
|
@@ -27,19 +27,29 @@
|
|
|
27
27
|
"postpublish": "pinst --enable"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@commitlint/cli": "^
|
|
31
|
-
"@commitlint/config-conventional": "^
|
|
30
|
+
"@commitlint/cli": "^17.0.0",
|
|
31
|
+
"@commitlint/config-conventional": "^17.0.0",
|
|
32
32
|
"@jedmao/semantic-release-npm-github-config": "^1.0.9",
|
|
33
33
|
"@types/color-string": "^1.5.0",
|
|
34
|
-
"@types/node": "^
|
|
34
|
+
"@types/node": "^17.0.0",
|
|
35
|
+
"@types/node-sass": "^4.11.3",
|
|
36
|
+
"@typescript-eslint/eslint-plugin": "^5.30.0",
|
|
37
|
+
"@typescript-eslint/parser": "^5.30.0",
|
|
35
38
|
"cz-conventional-changelog": "3.3.0",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
39
|
+
"eslint": "^8.18.0",
|
|
40
|
+
"eslint-config-prettier": "^8.5.0",
|
|
41
|
+
"eslint-plugin-import": "^2.26.0",
|
|
42
|
+
"eslint-plugin-no-loops": "^0.3.0",
|
|
43
|
+
"eslint-plugin-node": "^11.1.0",
|
|
44
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
45
|
+
"gh-pages": "4.0.0",
|
|
46
|
+
"husky": "^8.0.1",
|
|
47
|
+
"jest": "^28.0.2",
|
|
48
|
+
"node-sass": "^7.0.0",
|
|
40
49
|
"node-sass-export": "^0.0.7",
|
|
41
|
-
"pinst": "^
|
|
42
|
-
"
|
|
50
|
+
"pinst": "^3.0.0",
|
|
51
|
+
"prettier": "^2.7.1",
|
|
52
|
+
"semantic-release": "^19.0.2",
|
|
43
53
|
"typescript": "^4.0.2"
|
|
44
54
|
},
|
|
45
55
|
"config": {
|
package/src/helpers.ts
CHANGED
|
@@ -1,36 +1,39 @@
|
|
|
1
1
|
import * as colorString from 'color-string';
|
|
2
|
-
import { colors } from
|
|
3
|
-
import { space } from
|
|
4
|
-
import { typography } from
|
|
2
|
+
import { colors } from './colors';
|
|
3
|
+
import { space } from './space';
|
|
4
|
+
import { typography } from './typography';
|
|
5
5
|
|
|
6
6
|
export type Font = keyof typeof typography.fonts;
|
|
7
|
-
export type TextTreatment = keyof typeof typography[
|
|
7
|
+
export type TextTreatment = keyof typeof typography['text-treatments'];
|
|
8
8
|
export type Color = keyof typeof colors.all;
|
|
9
9
|
|
|
10
|
-
export const text = (name: TextTreatment, font =
|
|
11
|
-
const treatment = typography[
|
|
10
|
+
export const text = (name: TextTreatment, font = 'sans' as Font) => {
|
|
11
|
+
const treatment = typography['text-treatments'][name];
|
|
12
12
|
return {
|
|
13
13
|
...treatment,
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
'font-family': typography.fonts[font].join(','),
|
|
15
|
+
'line-height': `${treatment['line-height']}`
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export const remToUnitlessPx = (value: string) =>
|
|
20
|
-
parseFloat(value) * parseInt(typography[
|
|
20
|
+
parseFloat(value) * parseInt(typography['root-font-size'], 10);
|
|
21
21
|
|
|
22
22
|
export const color = (name: Color, alpha?: number) => {
|
|
23
23
|
const color = colors.all[name];
|
|
24
|
-
return alpha != null
|
|
25
|
-
|
|
24
|
+
return alpha != null
|
|
25
|
+
? // eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
26
|
+
colorString.to.rgb([...(colorString.get.rgb(color)?.slice(0, 3) || []), alpha])
|
|
27
|
+
: color;
|
|
28
|
+
};
|
|
26
29
|
|
|
27
30
|
export const spacing = (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
topY: number | string,
|
|
32
|
+
rightX?: number | string,
|
|
33
|
+
bottom?: number | string,
|
|
34
|
+
left?: number | string
|
|
32
35
|
) =>
|
|
33
|
-
[
|
|
34
|
-
if (
|
|
35
|
-
return [acc, space.scale[
|
|
36
|
-
},
|
|
36
|
+
[topY, rightX, bottom, left].reduce((acc, value) => {
|
|
37
|
+
if (value === undefined) return acc;
|
|
38
|
+
return [acc, space.scale[value] ?? value].join(' ');
|
|
39
|
+
}, '');
|
package/src/includePaths.js
CHANGED
package/src/includePaths.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import * as path from
|
|
1
|
+
import * as path from 'path';
|
|
2
2
|
|
|
3
|
-
export const includePaths = [path.join(__dirname,
|
|
3
|
+
export const includePaths = [path.join(__dirname, '../lib/assets/stylesheets')];
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { colors } from
|
|
2
|
-
export { typography } from
|
|
3
|
-
export { space } from
|
|
4
|
-
export { breakpoints } from
|
|
5
|
-
export * from
|
|
1
|
+
export { colors } from './colors';
|
|
2
|
+
export { typography } from './typography';
|
|
3
|
+
export { space } from './space';
|
|
4
|
+
export { breakpoints } from './breakpoints';
|
|
5
|
+
export * from './helpers';
|