css-calipers 0.4.0 β 0.7.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 +5 -3
- package/dist/cjs/core.js +5 -3
- package/dist/cjs/units/index.js +29 -0
- package/dist/esm/core.d.ts +2 -1
- package/dist/esm/core.d.ts.map +1 -1
- package/dist/esm/core.js +3 -1
- package/dist/esm/units/index.d.ts +14 -0
- package/dist/esm/units/index.d.ts.map +1 -0
- package/dist/esm/units/index.js +13 -0
- package/package.json +16 -6
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ compile-time unit safety, and output CSS only at the edges.
|
|
|
9
9
|
|
|
10
10
|
At a glance:
|
|
11
11
|
|
|
12
|
-
- Create measurements with `m` from a number and a unit
|
|
12
|
+
- Create measurements with `m` from a number and a unit; if you omit the unit, it defaults to `px` and is typed as the px measurement type.
|
|
13
13
|
- Do unit-safe math with methods like `add` and `multiply`, then call `.css()`
|
|
14
14
|
at the edge to get a CSS string (for example "10px").
|
|
15
15
|
|
|
@@ -36,7 +36,7 @@ npm install css-calipers
|
|
|
36
36
|
import { m } from "css-calipers";
|
|
37
37
|
|
|
38
38
|
// Declare vars
|
|
39
|
-
const paddingBase = m(4); // defaults to
|
|
39
|
+
const paddingBase = m(4); // defaults to px (and is typed as a px measurement) when no unit is specified
|
|
40
40
|
const rotation = m(45, "deg"); // equivalent to a dedicated helper: mDeg(45)
|
|
41
41
|
|
|
42
42
|
// Do safe arithmetic
|
|
@@ -50,6 +50,8 @@ const style = {
|
|
|
50
50
|
};
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
+
If you prefer, you can also import unit helpers from dedicated subpaths. For example, `mPercent` is available from the root entrypoint and from `css-calipers/units/percent`, and all unit helpers are aggregated under `css-calipers/units`.
|
|
54
|
+
|
|
53
55
|
---
|
|
54
56
|
|
|
55
57
|
## Features
|
|
@@ -103,7 +105,7 @@ Itβs probably overkill if:
|
|
|
103
105
|
import { m, mPercent, mVw, mVh, assertCondition } from "css-calipers";
|
|
104
106
|
|
|
105
107
|
// Token-style measurements (px by default)
|
|
106
|
-
const spacing = m(8); // Defaults to px; equivalent to mPx(8)
|
|
108
|
+
const spacing = m(8); // Defaults to px and is typed as a PxMeasurement; equivalent to mPx(8)
|
|
107
109
|
const cardPadding = spacing.multiply(2); // 16px
|
|
108
110
|
const gutter = spacing.multiply(1.5); // 12px
|
|
109
111
|
|
package/dist/cjs/core.js
CHANGED
|
@@ -12,8 +12,9 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
12
12
|
};
|
|
13
13
|
var _Measurement_instances, _a, _Measurement_value, _Measurement_unit, _Measurement_clone;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.assertCondition = exports.assertUnit = exports.measurementMax = exports.measurementMin = exports.hasCssMethod = exports.makeUnitAssert = exports.makeUnitGuard = exports.measurementUnitMetadata = exports.makeUnitHelperFromDefinition = exports.makeUnitHelper = exports.
|
|
15
|
+
exports.assertCondition = exports.assertUnit = exports.measurementMax = exports.measurementMin = exports.hasCssMethod = exports.makeUnitAssert = exports.makeUnitGuard = exports.measurementUnitMetadata = exports.makeUnitHelperFromDefinition = exports.makeUnitHelper = exports.isMeasurement = void 0;
|
|
16
16
|
exports.assertMatchingUnits = assertMatchingUnits;
|
|
17
|
+
exports.m = m;
|
|
17
18
|
const unitDefinitions_1 = require("./unitDefinitions");
|
|
18
19
|
const errors_1 = require("./internal/errors");
|
|
19
20
|
function assertMatchingUnits(left, right, context) {
|
|
@@ -216,8 +217,9 @@ _a = Measurement, _Measurement_clone = function _Measurement_clone(value) {
|
|
|
216
217
|
const createMeasurement = (value, unit) => new Measurement(value, unit);
|
|
217
218
|
const isMeasurement = (x) => x instanceof Measurement;
|
|
218
219
|
exports.isMeasurement = isMeasurement;
|
|
219
|
-
|
|
220
|
-
|
|
220
|
+
function m(value, unit = 'px') {
|
|
221
|
+
return createMeasurement(value, unit.toLowerCase());
|
|
222
|
+
}
|
|
221
223
|
const makeUnitHelper = (unit) => {
|
|
222
224
|
const normalizedUnit = unit.toLowerCase();
|
|
223
225
|
const factory = (value) => createMeasurement(value, normalizedUnit);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
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);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./percent"), exports);
|
|
18
|
+
__exportStar(require("./absolute"), exports);
|
|
19
|
+
__exportStar(require("./font-relative"), exports);
|
|
20
|
+
__exportStar(require("./viewport"), exports);
|
|
21
|
+
__exportStar(require("./viewport-small"), exports);
|
|
22
|
+
__exportStar(require("./viewport-large"), exports);
|
|
23
|
+
__exportStar(require("./viewport-dynamic"), exports);
|
|
24
|
+
__exportStar(require("./container"), exports);
|
|
25
|
+
__exportStar(require("./angle"), exports);
|
|
26
|
+
__exportStar(require("./time"), exports);
|
|
27
|
+
__exportStar(require("./frequency"), exports);
|
|
28
|
+
__exportStar(require("./resolution"), exports);
|
|
29
|
+
__exportStar(require("./grid"), exports);
|
package/dist/esm/core.d.ts
CHANGED
|
@@ -32,7 +32,8 @@ export interface IMeasurement<Unit extends string = string> {
|
|
|
32
32
|
type DeltaInput = number | IMeasurement<string>;
|
|
33
33
|
export declare function assertMatchingUnits<Unit extends string>(left: IMeasurement<Unit>, right: IMeasurement<Unit>, context: string): void;
|
|
34
34
|
export declare const isMeasurement: (x: unknown) => x is IMeasurement<string>;
|
|
35
|
-
export declare
|
|
35
|
+
export declare function m(value: number): BrandedMeasurement<'px'>;
|
|
36
|
+
export declare function m<Unit extends string>(value: number, unit: Unit): IMeasurement<Lowercase<Unit>> & UnitBrand<Lowercase<Unit>>;
|
|
36
37
|
export type BrandedMeasurement<Unit extends string> = IMeasurement<Unit> & UnitBrand<Unit>;
|
|
37
38
|
export type UnitHelper<Unit extends string = string> = ((value: number) => BrandedMeasurement<Unit>) & {
|
|
38
39
|
unit: Unit;
|
package/dist/esm/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAM3B,KAAK,UAAU,GAAG,oBAAoB,CAAC,MAAM,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3E,MAAM,MAAM,iBAAiB,CAAC,IAAI,SAAS,MAAM,GAAG,UAAU,IAC5D,GAAG,MAAM,GAAG,IAAI,EAAE,CAAC;AAErB,KAAK,SAAS,CAAC,IAAI,SAAS,MAAM,IAAI;IAAE,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAA;CAAE,CAAC;AAErE,MAAM,WAAW,YAAY,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM;IACxD,GAAG,EAAE,MAAM,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,MA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MAAM,YAAY,GACvB,GAAG,OAAO,KACT,CAAC,IAAI;IAAE,GAAG,EAAE,MAAM,MAAM,CAAA;CAO1B,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,IAAI,SAAS,MAAM,EAChD,GAAG,YAAY,CAAC,IAAI,CAAC,EACrB,GAAG,YAAY,CAAC,IAAI,CAAC,KACpB,YAAY,CAAC,IAAI,CAGnB,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,IAAI,SAAS,MAAM,EAChD,GAAG,YAAY,CAAC,IAAI,CAAC,EACrB,GAAG,YAAY,CAAC,IAAI,CAAC,KACpB,YAAY,CAAC,IAAI,CAGnB,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,IAAI,SAAS,MAAM,EAC5C,aAAa,YAAY,CAAC,IAAI,CAAC,EAC/B,cAAc,MAAM,EACpB,UAAU,MAAM,SACgC,CAAC;AAEnD,eAAO,MAAM,eAAe,GAC1B,WAAW,OAAO,GAAG,CAAC,MAAM,OAAO,CAAC,EACpC,SAAS,MAAM,KACd,IAUF,CAAC"}
|
package/dist/esm/core.js
CHANGED
|
@@ -211,7 +211,9 @@ _a = Measurement, _Measurement_clone = function _Measurement_clone(value) {
|
|
|
211
211
|
};
|
|
212
212
|
const createMeasurement = (value, unit) => new Measurement(value, unit);
|
|
213
213
|
export const isMeasurement = (x) => x instanceof Measurement;
|
|
214
|
-
export
|
|
214
|
+
export function m(value, unit = 'px') {
|
|
215
|
+
return createMeasurement(value, unit.toLowerCase());
|
|
216
|
+
}
|
|
215
217
|
export const makeUnitHelper = (unit) => {
|
|
216
218
|
const normalizedUnit = unit.toLowerCase();
|
|
217
219
|
const factory = (value) => createMeasurement(value, normalizedUnit);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './percent';
|
|
2
|
+
export * from './absolute';
|
|
3
|
+
export * from './font-relative';
|
|
4
|
+
export * from './viewport';
|
|
5
|
+
export * from './viewport-small';
|
|
6
|
+
export * from './viewport-large';
|
|
7
|
+
export * from './viewport-dynamic';
|
|
8
|
+
export * from './container';
|
|
9
|
+
export * from './angle';
|
|
10
|
+
export * from './time';
|
|
11
|
+
export * from './frequency';
|
|
12
|
+
export * from './resolution';
|
|
13
|
+
export * from './grid';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/units/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './percent';
|
|
2
|
+
export * from './absolute';
|
|
3
|
+
export * from './font-relative';
|
|
4
|
+
export * from './viewport';
|
|
5
|
+
export * from './viewport-small';
|
|
6
|
+
export * from './viewport-large';
|
|
7
|
+
export * from './viewport-dynamic';
|
|
8
|
+
export * from './container';
|
|
9
|
+
export * from './angle';
|
|
10
|
+
export * from './time';
|
|
11
|
+
export * from './frequency';
|
|
12
|
+
export * from './resolution';
|
|
13
|
+
export * from './grid';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "css-calipers",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Compile-time unit safety for numeric, unit-bearing CSS values via typed measurements.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -42,6 +42,16 @@
|
|
|
42
42
|
"import": "./dist/esm/index.js",
|
|
43
43
|
"require": "./dist/cjs/index.js"
|
|
44
44
|
},
|
|
45
|
+
"./units": {
|
|
46
|
+
"types": "./dist/esm/units/index.d.ts",
|
|
47
|
+
"import": "./dist/esm/units/index.js",
|
|
48
|
+
"require": "./dist/cjs/units/index.js"
|
|
49
|
+
},
|
|
50
|
+
"./units/*": {
|
|
51
|
+
"types": "./dist/esm/units/*.d.ts",
|
|
52
|
+
"import": "./dist/esm/units/*.js",
|
|
53
|
+
"require": "./dist/cjs/units/*.js"
|
|
54
|
+
},
|
|
45
55
|
"./package.json": "./package.json"
|
|
46
56
|
},
|
|
47
57
|
"devDependencies": {
|
|
@@ -61,12 +71,12 @@
|
|
|
61
71
|
"prepublishOnly": "node -e \"if (!process.env.CSS_CALIPERS_RELEASE) { console.error('Direct npm publish is disabled; use \\\"npm run release\\\" instead.'); process.exit(1); }\"",
|
|
62
72
|
"release": "node scripts/release.mjs",
|
|
63
73
|
"release:dry": "node scripts/release.mjs --dry-run",
|
|
64
|
-
"test": "vitest tests/core.test.ts",
|
|
65
|
-
"test:core": "vitest run tests/core.test.ts",
|
|
66
|
-
"test:cjs": "vitest run tests/core.cjs.test.ts",
|
|
67
|
-
"test:esm": "vitest run tests/core.esm.test.ts",
|
|
74
|
+
"test": "vitest tests/runtime/core/core.src.test.ts",
|
|
75
|
+
"test:core": "vitest run tests/runtime/core/core.src.test.ts",
|
|
76
|
+
"test:cjs": "vitest run tests/runtime/core/core.cjs.test.ts tests/runtime/api-surface/api-surface.cjs.test.ts",
|
|
77
|
+
"test:esm": "vitest run tests/runtime/core/core.esm.test.ts tests/runtime/api-surface/api-surface.esm.test.ts",
|
|
68
78
|
"test:dist": "npm run test:cjs && npm run test:esm",
|
|
69
|
-
"test:all": "npm run test:core && npm run test:dist",
|
|
79
|
+
"test:all": "npm run test:core && npm run test:dist && npm run test:types",
|
|
70
80
|
"test:types": "echo \"\n π§ͺ Starting tsd type checks...\n\" && tsd --files tests/types/**/*.test-d.ts && echo \"β
tsd type checks passed!\n\""
|
|
71
81
|
}
|
|
72
82
|
}
|