@tokenami/config 0.0.12 → 0.0.14

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
@@ -8,62 +8,18 @@ declare const defaultConfig: {
8
8
  readonly aliases: {};
9
9
  readonly selectors: {
10
10
  readonly active: string;
11
- readonly 'any-link': string;
12
- readonly checked: string;
13
- readonly current: string;
14
- readonly default: string;
15
- readonly defined: string;
11
+ readonly after: string;
12
+ readonly before: string;
16
13
  readonly disabled: string;
17
- readonly empty: string;
18
- readonly enabled: string;
19
- readonly first: string;
14
+ readonly even: string;
20
15
  readonly 'first-child': string;
21
- readonly 'first-of-type': string;
22
16
  readonly focus: string;
23
17
  readonly 'focus-visible': string;
24
18
  readonly 'focus-within': string;
25
- readonly fullscreen: string;
26
19
  readonly hover: string;
27
- readonly 'in-range': string;
28
- readonly indeterminate: string;
29
- readonly invalid: string;
30
20
  readonly 'last-child': string;
31
- readonly 'last-of-type': string;
32
- readonly left: string;
33
- readonly link: string;
34
- readonly 'local-link': string;
35
- readonly 'nth-col': string;
36
- readonly 'nth-last-col': string;
37
- readonly 'only-child': string;
38
- readonly 'only-of-type': string;
39
- readonly optional: string;
40
- readonly 'out-of-range': string;
41
- readonly paused: string;
42
- readonly 'picture-in-picture': string;
43
- readonly 'placeholder-shown': string;
44
- readonly playing: string;
45
- readonly 'read-only': string;
46
- readonly 'read-write': string;
47
- readonly required: string;
48
- readonly right: string;
49
- readonly root: string;
50
- readonly scope: string;
51
- readonly target: string;
52
- readonly 'user-invalid': string;
53
- readonly 'user-valid': string;
54
- readonly valid: string;
55
- readonly visited: string;
56
- readonly after: string;
57
- readonly backdrop: string;
58
- readonly before: string;
59
- readonly cue: string;
60
- readonly 'cue-region': string;
61
- readonly 'file-selector-button': string;
62
- readonly 'first-letter': string;
63
- readonly 'first-line': string;
64
- readonly marker: string;
21
+ readonly odd: string;
65
22
  readonly placeholder: string;
66
- readonly selection: string;
67
23
  };
68
24
  readonly properties: {
69
25
  readonly 'accent-color': readonly "color"[];
@@ -223,11 +179,11 @@ declare const GridValue: {
223
179
  };
224
180
  type TokenProperty<P extends string = string> = `--${P}`;
225
181
  declare const TokenProperty: {
226
- safeParse: (input: unknown) => v.SafeParseResult<v.StringSchema<string>>;
182
+ safeParse: (input: unknown) => v.SafeParseResult<v.StringSchema<`--${string}`>>;
227
183
  };
228
184
  type TokenValue<TK extends string = string, V extends string = string> = `var(--${TK}_${V})`;
229
185
  declare const TokenValue: {
230
- safeParse: (input: unknown) => v.SafeParseResult<v.StringSchema<string>>;
186
+ safeParse: (input: unknown) => v.SafeParseResult<v.StringSchema<`var(--${string}_${string})`>>;
231
187
  };
232
188
  type ArbitraryValue = `var(---,${string})`;
233
189
  declare const ArbitraryValue: v.StringSchema<string>;
@@ -267,6 +223,6 @@ declare function getTokenPropertyName(tokenProperty: TokenProperty): string;
267
223
  declare function getTokenValueParts(tokenValue: TokenValue): {
268
224
  themeKey: string;
269
225
  token: string;
270
- } | undefined;
226
+ };
271
227
 
272
228
  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
@@ -90,62 +92,18 @@ var defaultConfig = createConfig({
90
92
  aliases: {},
91
93
  selectors: {
92
94
  active: "&:active",
93
- "any-link": "&:any-link",
94
- checked: "&:checked",
95
- current: "&:current",
96
- default: "&:default",
97
- defined: "&:defined",
95
+ after: "&::after",
96
+ before: "&::before",
98
97
  disabled: "&:disabled",
99
- empty: "&:empty",
100
- enabled: "&:enabled",
101
- first: "&:first",
98
+ even: "&:nth-child(even)",
102
99
  "first-child": "&:first-child",
103
- "first-of-type": "&:first-of-type",
104
100
  focus: "&:focus",
105
101
  "focus-visible": "&:focus-visible",
106
102
  "focus-within": "&:focus-within",
107
- fullscreen: "&:fullscreen",
108
103
  hover: "&:hover",
109
- "in-range": "&:in-range",
110
- indeterminate: "&:indeterminate",
111
- invalid: "&:invalid",
112
104
  "last-child": "&:last-child",
113
- "last-of-type": "&:last-of-type",
114
- left: "&:left",
115
- link: "&:link",
116
- "local-link": "&:local-link",
117
- "nth-col": "&:nth-col",
118
- "nth-last-col": "&:nth-last-col",
119
- "only-child": "&:only-child",
120
- "only-of-type": "&:only-of-type",
121
- optional: "&:optional",
122
- "out-of-range": "&:out-of-range",
123
- paused: "&:paused",
124
- "picture-in-picture": "&:picture-in-picture",
125
- "placeholder-shown": "&:placeholder-shown",
126
- playing: "&:playing",
127
- "read-only": "&:read-only",
128
- "read-write": "&:read-write",
129
- required: "&:required",
130
- right: "&:right",
131
- root: "&:root",
132
- scope: "&:scope",
133
- target: "&:target",
134
- "user-invalid": "&:user-invalid",
135
- "user-valid": "&:user-valid",
136
- valid: "&:valid",
137
- visited: "&:visited",
138
- after: "&::after",
139
- backdrop: "&::backdrop",
140
- before: "&::before",
141
- cue: "&::cue",
142
- "cue-region": "&::cue-region",
143
- "file-selector-button": "&::file-selector-button",
144
- "first-letter": "&::first-letter",
145
- "first-line": "&::first-line",
146
- marker: "&::marker",
147
- placeholder: "&::placeholder",
148
- selection: "&::selection"
105
+ odd: "&:nth-child(odd)",
106
+ placeholder: "&::placeholder"
149
107
  },
150
108
  properties: {
151
109
  "accent-color": ["color"],
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
@@ -42,62 +44,18 @@ var defaultConfig = createConfig({
42
44
  aliases: {},
43
45
  selectors: {
44
46
  active: "&:active",
45
- "any-link": "&:any-link",
46
- checked: "&:checked",
47
- current: "&:current",
48
- default: "&:default",
49
- defined: "&:defined",
47
+ after: "&::after",
48
+ before: "&::before",
50
49
  disabled: "&:disabled",
51
- empty: "&:empty",
52
- enabled: "&:enabled",
53
- first: "&:first",
50
+ even: "&:nth-child(even)",
54
51
  "first-child": "&:first-child",
55
- "first-of-type": "&:first-of-type",
56
52
  focus: "&:focus",
57
53
  "focus-visible": "&:focus-visible",
58
54
  "focus-within": "&:focus-within",
59
- fullscreen: "&:fullscreen",
60
55
  hover: "&:hover",
61
- "in-range": "&:in-range",
62
- indeterminate: "&:indeterminate",
63
- invalid: "&:invalid",
64
56
  "last-child": "&:last-child",
65
- "last-of-type": "&:last-of-type",
66
- left: "&:left",
67
- link: "&:link",
68
- "local-link": "&:local-link",
69
- "nth-col": "&:nth-col",
70
- "nth-last-col": "&:nth-last-col",
71
- "only-child": "&:only-child",
72
- "only-of-type": "&:only-of-type",
73
- optional: "&:optional",
74
- "out-of-range": "&:out-of-range",
75
- paused: "&:paused",
76
- "picture-in-picture": "&:picture-in-picture",
77
- "placeholder-shown": "&:placeholder-shown",
78
- playing: "&:playing",
79
- "read-only": "&:read-only",
80
- "read-write": "&:read-write",
81
- required: "&:required",
82
- right: "&:right",
83
- root: "&:root",
84
- scope: "&:scope",
85
- target: "&:target",
86
- "user-invalid": "&:user-invalid",
87
- "user-valid": "&:user-valid",
88
- valid: "&:valid",
89
- visited: "&:visited",
90
- after: "&::after",
91
- backdrop: "&::backdrop",
92
- before: "&::before",
93
- cue: "&::cue",
94
- "cue-region": "&::cue-region",
95
- "file-selector-button": "&::file-selector-button",
96
- "first-letter": "&::first-letter",
97
- "first-line": "&::first-line",
98
- marker: "&::marker",
99
- placeholder: "&::placeholder",
100
- selection: "&::selection"
57
+ odd: "&:nth-child(odd)",
58
+ placeholder: "&::placeholder"
101
59
  },
102
60
  properties: {
103
61
  "accent-color": ["color"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tokenami/config",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
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.14"
21
21
  },
22
22
  "scripts": {
23
23
  "build": "tsup src/index.ts --format=esm,cjs --dts",