@tamagui/get-token 1.135.4-1761749240853 → 1.135.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/dist/cjs/index.native.js +72 -96
- package/dist/cjs/index.native.js.map +6 -1
- package/package.json +3 -4
package/dist/cjs/index.native.js
CHANGED
|
@@ -1,25 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
6
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
});
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
-
value: !0
|
|
22
|
-
}), mod);
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
23
16
|
var index_exports = {};
|
|
24
17
|
__export(index_exports, {
|
|
25
18
|
getRadius: () => getRadius,
|
|
@@ -29,90 +22,73 @@ __export(index_exports, {
|
|
|
29
22
|
stepTokenUpOrDown: () => stepTokenUpOrDown
|
|
30
23
|
});
|
|
31
24
|
module.exports = __toCommonJS(index_exports);
|
|
32
|
-
var import_web = require("@tamagui/web"),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return a.val - b.val;
|
|
63
|
-
}),
|
|
64
|
-
_iteratorNormalCompletion = !0,
|
|
65
|
-
_didIteratorError = !1,
|
|
66
|
-
_iteratorError = void 0;
|
|
25
|
+
var import_web = require("@tamagui/web"), defaultOptions = {
|
|
26
|
+
shift: 0,
|
|
27
|
+
bounds: [
|
|
28
|
+
0
|
|
29
|
+
]
|
|
30
|
+
}, getSize = function(size, options) {
|
|
31
|
+
return getTokenRelative("size", size, options);
|
|
32
|
+
}, getSpace = function(space, options) {
|
|
33
|
+
return getTokenRelative("space", space, options);
|
|
34
|
+
}, getRadius = function(radius, options) {
|
|
35
|
+
return getTokenRelative("radius", radius, options);
|
|
36
|
+
}, cacheVariables = {}, cacheWholeVariables = {}, cacheKeys = {}, cacheWholeKeys = {}, stepTokenUpOrDown = function(type, current) {
|
|
37
|
+
var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : defaultOptions, _options_bounds, _options_bounds1, tokens = (0, import_web.getTokens)({
|
|
38
|
+
prefixed: !0
|
|
39
|
+
})[type];
|
|
40
|
+
if (!(type in cacheVariables)) {
|
|
41
|
+
cacheKeys[type] = [], cacheVariables[type] = [], cacheWholeKeys[type] = [], cacheWholeVariables[type] = [];
|
|
42
|
+
var sorted = Object.keys(tokens).map(function(k) {
|
|
43
|
+
return tokens[k];
|
|
44
|
+
}).sort(function(a, b) {
|
|
45
|
+
return a.val - b.val;
|
|
46
|
+
}), _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
47
|
+
try {
|
|
48
|
+
for (var _iterator = sorted[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
49
|
+
var token = _step.value;
|
|
50
|
+
cacheKeys[type].push(token.key), cacheVariables[type].push(token);
|
|
51
|
+
}
|
|
52
|
+
} catch (err) {
|
|
53
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
54
|
+
} finally {
|
|
67
55
|
try {
|
|
68
|
-
|
|
69
|
-
var token = _step.value;
|
|
70
|
-
cacheKeys[type].push(token.key), cacheVariables[type].push(token);
|
|
71
|
-
}
|
|
72
|
-
} catch (err) {
|
|
73
|
-
_didIteratorError = !0, _iteratorError = err;
|
|
56
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
74
57
|
} finally {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
58
|
+
if (_didIteratorError)
|
|
59
|
+
throw _iteratorError;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
var sortedExcludingHalfSteps = sorted.filter(function(x) {
|
|
63
|
+
return !x.key.endsWith(".5");
|
|
64
|
+
}), _iteratorNormalCompletion1 = !0, _didIteratorError1 = !1, _iteratorError1 = void 0;
|
|
65
|
+
try {
|
|
66
|
+
for (var _iterator1 = sortedExcludingHalfSteps[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0) {
|
|
67
|
+
var token1 = _step1.value;
|
|
68
|
+
cacheWholeKeys[type].push(token1.key), cacheWholeVariables[type].push(token1);
|
|
80
69
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
_iteratorNormalCompletion1 = !0,
|
|
85
|
-
_didIteratorError1 = !1,
|
|
86
|
-
_iteratorError1 = void 0;
|
|
70
|
+
} catch (err) {
|
|
71
|
+
_didIteratorError1 = !0, _iteratorError1 = err;
|
|
72
|
+
} finally {
|
|
87
73
|
try {
|
|
88
|
-
|
|
89
|
-
var token1 = _step1.value;
|
|
90
|
-
cacheWholeKeys[type].push(token1.key), cacheWholeVariables[type].push(token1);
|
|
91
|
-
}
|
|
92
|
-
} catch (err) {
|
|
93
|
-
_didIteratorError1 = !0, _iteratorError1 = err;
|
|
74
|
+
!_iteratorNormalCompletion1 && _iterator1.return != null && _iterator1.return();
|
|
94
75
|
} finally {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
} finally {
|
|
98
|
-
if (_didIteratorError1) throw _iteratorError1;
|
|
99
|
-
}
|
|
76
|
+
if (_didIteratorError1)
|
|
77
|
+
throw _iteratorError1;
|
|
100
78
|
}
|
|
101
79
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
getTokenRelative = stepTokenUpOrDown;
|
|
118
|
-
//# sourceMappingURL=index.native.js.map
|
|
80
|
+
}
|
|
81
|
+
var isString = typeof current == "string", cache = options.excludeHalfSteps ? isString ? cacheWholeKeys : cacheWholeVariables : isString ? cacheKeys : cacheVariables, tokensOrdered = cache[type], _options_bounds_, min = (_options_bounds_ = (_options_bounds = options.bounds) === null || _options_bounds === void 0 ? void 0 : _options_bounds[0]) !== null && _options_bounds_ !== void 0 ? _options_bounds_ : 0, _options_bounds_1, max = (_options_bounds_1 = (_options_bounds1 = options.bounds) === null || _options_bounds1 === void 0 ? void 0 : _options_bounds1[1]) !== null && _options_bounds_1 !== void 0 ? _options_bounds_1 : tokensOrdered.length - 1, currentIndex = tokensOrdered.indexOf(current), shift = options.shift || 0;
|
|
82
|
+
shift && (current === "$true" || (0, import_web.isVariable)(current) && current.name === "true") && (shift += shift > 0 ? 1 : -1);
|
|
83
|
+
var index = Math.min(max, Math.max(min, currentIndex + shift)), found = tokensOrdered[index], result = (typeof found == "string" ? tokens[found] : found) || tokens.$true;
|
|
84
|
+
return result;
|
|
85
|
+
}, getTokenRelative = stepTokenUpOrDown;
|
|
86
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
87
|
+
0 && (module.exports = {
|
|
88
|
+
getRadius,
|
|
89
|
+
getSize,
|
|
90
|
+
getSpace,
|
|
91
|
+
getTokenRelative,
|
|
92
|
+
stepTokenUpOrDown
|
|
93
|
+
});
|
|
94
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAsC,yBAElC,iBAAiB;AAAA,EACjB,OAAO;AAAA,EACP,QAAQ;AAAA,IACJ;AAAA,EACJ;AACJ,GACW,UAAU,SAAS,MAAM,SAAS;AACzC,SAAO,iBAAiB,QAAQ,MAAM,OAAO;AACjD,GACW,WAAW,SAAS,OAAO,SAAS;AAC3C,SAAO,iBAAiB,SAAS,OAAO,OAAO;AACnD,GACW,YAAY,SAAS,QAAQ,SAAS;AAC7C,SAAO,iBAAiB,UAAU,QAAQ,OAAO;AACrD,GACI,iBAAiB,CAAC,GAClB,sBAAsB,CAAC,GACvB,YAAY,CAAC,GACb,iBAAiB,CAAC,GAC2D,oBAAoB,SAAS,MAAM,SAAS;AACzH,MAAI,UAAU,UAAU,SAAS,KAAK,UAAU,CAAC,MAAM,SAAS,UAAU,CAAC,IAAI,gBAC3E,iBAAiB,kBACjB,aAAS,sBAAU;AAAA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index",
|
|
7
6
|
"module": "dist/esm/index",
|
|
@@ -32,10 +31,10 @@
|
|
|
32
31
|
}
|
|
33
32
|
},
|
|
34
33
|
"dependencies": {
|
|
35
|
-
"@tamagui/web": "1.135.4
|
|
34
|
+
"@tamagui/web": "1.135.4"
|
|
36
35
|
},
|
|
37
36
|
"devDependencies": {
|
|
38
|
-
"@tamagui/build": "1.135.4
|
|
37
|
+
"@tamagui/build": "1.135.4",
|
|
39
38
|
"react": "*"
|
|
40
39
|
},
|
|
41
40
|
"peerDependencies": {
|