@tokenami/config 0.0.12 → 0.0.13

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/index.d.ts CHANGED
@@ -223,11 +223,11 @@ declare const GridValue: {
223
223
  };
224
224
  type TokenProperty<P extends string = string> = `--${P}`;
225
225
  declare const TokenProperty: {
226
- safeParse: (input: unknown) => v.SafeParseResult<v.StringSchema<string>>;
226
+ safeParse: (input: unknown) => v.SafeParseResult<v.StringSchema<`--${string}`>>;
227
227
  };
228
228
  type TokenValue<TK extends string = string, V extends string = string> = `var(--${TK}_${V})`;
229
229
  declare const TokenValue: {
230
- safeParse: (input: unknown) => v.SafeParseResult<v.StringSchema<string>>;
230
+ safeParse: (input: unknown) => v.SafeParseResult<v.StringSchema<`var(--${string}_${string})`>>;
231
231
  };
232
232
  type ArbitraryValue = `var(---,${string})`;
233
233
  declare const ArbitraryValue: v.StringSchema<string>;
@@ -267,6 +267,6 @@ declare function getTokenPropertyName(tokenProperty: TokenProperty): string;
267
267
  declare function getTokenValueParts(tokenValue: TokenValue): {
268
268
  themeKey: string;
269
269
  token: string;
270
- } | undefined;
270
+ };
271
271
 
272
272
  export { Aliases, ArbitraryValue, CSSProperty, Config, DefaultConfig, GridValue, Theme, TokenProperty, TokenValue, arbitraryValue, createConfig, defaultConfig, getTokenPropertyName, getTokenValueParts, properties, tokenProperty, tokenValue, variantProperty };
package/dist/index.js CHANGED
@@ -60,14 +60,16 @@ function tokenValue(themeKey, name) {
60
60
  function arbitraryValue(value) {
61
61
  return `var(---,${value})`;
62
62
  }
63
- var tokenPropertyRegex = /--((\w)([\w-]+)?)/;
63
+ var tokenPropertyRegex = /(?<!var\()--((\w)([\w-]+)?)/;
64
64
  var tokenValueRegex = /var\(--([\w-]+)_([\w-]+)\)/;
65
65
  var aritraryValueRegex = /var\(---,(.+)\)/;
66
66
  var gridValueSchema = v.number();
67
67
  var GridValue = { safeParse: (input) => v.safeParse(gridValueSchema, input) };
68
- var tokenPropertySchema = v.string([v.regex(tokenPropertyRegex)]);
68
+ var tokenPropertyRegexSchema = v.regex(tokenPropertyRegex);
69
+ var tokenPropertySchema = v.string([tokenPropertyRegexSchema]);
69
70
  var TokenProperty = { safeParse: (input) => v.safeParse(tokenPropertySchema, input) };
70
- var tokenValueSchema = v.string([v.regex(tokenValueRegex)]);
71
+ var tokenValueRegexSchema = v.regex(tokenValueRegex);
72
+ var tokenValueSchema = v.string([tokenValueRegexSchema]);
71
73
  var TokenValue = { safeParse: (input) => v.safeParse(tokenValueSchema, input) };
72
74
  var ArbitraryValue = v.string([v.regex(aritraryValueRegex)]);
73
75
  var createConfig = (obj) => {
@@ -78,7 +80,7 @@ function getTokenPropertyName(tokenProperty2) {
78
80
  }
79
81
  function getTokenValueParts(tokenValue2) {
80
82
  const [, key, token] = tokenValue2.split(tokenValueRegex);
81
- return key && token ? { themeKey: key, token } : void 0;
83
+ return { themeKey: key, token };
82
84
  }
83
85
 
84
86
  // src/config.default.ts
package/dist/index.mjs CHANGED
@@ -12,14 +12,16 @@ function tokenValue(themeKey, name) {
12
12
  function arbitraryValue(value) {
13
13
  return `var(---,${value})`;
14
14
  }
15
- var tokenPropertyRegex = /--((\w)([\w-]+)?)/;
15
+ var tokenPropertyRegex = /(?<!var\()--((\w)([\w-]+)?)/;
16
16
  var tokenValueRegex = /var\(--([\w-]+)_([\w-]+)\)/;
17
17
  var aritraryValueRegex = /var\(---,(.+)\)/;
18
18
  var gridValueSchema = v.number();
19
19
  var GridValue = { safeParse: (input) => v.safeParse(gridValueSchema, input) };
20
- var tokenPropertySchema = v.string([v.regex(tokenPropertyRegex)]);
20
+ var tokenPropertyRegexSchema = v.regex(tokenPropertyRegex);
21
+ var tokenPropertySchema = v.string([tokenPropertyRegexSchema]);
21
22
  var TokenProperty = { safeParse: (input) => v.safeParse(tokenPropertySchema, input) };
22
- var tokenValueSchema = v.string([v.regex(tokenValueRegex)]);
23
+ var tokenValueRegexSchema = v.regex(tokenValueRegex);
24
+ var tokenValueSchema = v.string([tokenValueRegexSchema]);
23
25
  var TokenValue = { safeParse: (input) => v.safeParse(tokenValueSchema, input) };
24
26
  var ArbitraryValue = v.string([v.regex(aritraryValueRegex)]);
25
27
  var createConfig = (obj) => {
@@ -30,7 +32,7 @@ function getTokenPropertyName(tokenProperty2) {
30
32
  }
31
33
  function getTokenValueParts(tokenValue2) {
32
34
  const [, key, token] = tokenValue2.split(tokenValueRegex);
33
- return key && token ? { themeKey: key, token } : void 0;
35
+ return { themeKey: key, token };
34
36
  }
35
37
 
36
38
  // src/config.default.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tokenami/config",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -17,7 +17,7 @@
17
17
  "csstype": "^3.1.2",
18
18
  "tsup": "^7.0.0",
19
19
  "typescript": "^5.1.3",
20
- "@tokenami/dev": "0.0.12"
20
+ "@tokenami/dev": "0.0.13"
21
21
  },
22
22
  "scripts": {
23
23
  "build": "tsup src/index.ts --format=esm,cjs --dts",