@tokenami/config 0.0.18 → 0.0.20

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.mts CHANGED
@@ -38,19 +38,15 @@ declare const defaultConfig: {
38
38
  readonly 'border-block-end': readonly "border"[];
39
39
  readonly 'border-block-end-color': readonly "color"[];
40
40
  readonly 'border-block-end-style': readonly "line-style"[];
41
- readonly 'border-block-end-width': readonly "grid"[];
42
41
  readonly 'border-block-start': readonly "border"[];
43
42
  readonly 'border-block-start-color': readonly "color"[];
44
43
  readonly 'border-block-start-style': readonly "line-style"[];
45
- readonly 'border-block-start-width': readonly "grid"[];
46
44
  readonly 'border-block-style': readonly "line-style"[];
47
- readonly 'border-block-width': readonly "grid"[];
48
45
  readonly 'border-bottom': readonly "border"[];
49
46
  readonly 'border-bottom-color': readonly "color"[];
50
47
  readonly 'border-bottom-left-radius': readonly "radii"[];
51
48
  readonly 'border-bottom-right-radius': readonly "radii"[];
52
49
  readonly 'border-bottom-style': readonly "line-style"[];
53
- readonly 'border-bottom-width': readonly "grid"[];
54
50
  readonly 'border-color': readonly "color"[];
55
51
  readonly 'border-end-end-radius': readonly "radii"[];
56
52
  readonly 'border-end-start-radius': readonly "radii"[];
@@ -59,22 +55,17 @@ declare const defaultConfig: {
59
55
  readonly 'border-inline-end': readonly "border"[];
60
56
  readonly 'border-inline-end-color': readonly "color"[];
61
57
  readonly 'border-inline-end-style': readonly "line-style"[];
62
- readonly 'border-inline-end-width': readonly "grid"[];
63
58
  readonly 'border-inline-start': readonly "border"[];
64
59
  readonly 'border-inline-start-color': readonly "color"[];
65
60
  readonly 'border-inline-start-style': readonly "line-style"[];
66
- readonly 'border-inline-start-width': readonly "grid"[];
67
61
  readonly 'border-inline-style': readonly "line-style"[];
68
- readonly 'border-inline-width': readonly "grid"[];
69
62
  readonly 'border-left': readonly "border"[];
70
63
  readonly 'border-left-color': readonly "color"[];
71
64
  readonly 'border-left-style': readonly "line-style"[];
72
- readonly 'border-left-width': readonly "grid"[];
73
65
  readonly 'border-radius': readonly "radii"[];
74
66
  readonly 'border-right': readonly "border"[];
75
67
  readonly 'border-right-color': readonly "color"[];
76
68
  readonly 'border-right-style': readonly "line-style"[];
77
- readonly 'border-right-width': readonly "grid"[];
78
69
  readonly 'border-start-end-radius': readonly "radii"[];
79
70
  readonly 'border-start-start-radius': readonly "radii"[];
80
71
  readonly 'border-style': readonly "line-style"[];
@@ -83,8 +74,6 @@ declare const defaultConfig: {
83
74
  readonly 'border-top-left-radius': readonly "radii"[];
84
75
  readonly 'border-top-right-radius': readonly "radii"[];
85
76
  readonly 'border-top-style': readonly "line-style"[];
86
- readonly 'border-top-width': readonly "grid"[];
87
- readonly 'border-width': readonly "grid"[];
88
77
  readonly bottom: readonly "grid"[];
89
78
  readonly 'box-shadow': readonly "shadow"[];
90
79
  readonly 'caret-color': readonly "color"[];
@@ -172,10 +161,9 @@ declare function tokenProperty(name: string): TokenProperty;
172
161
  declare function variantProperty(variant: string, name: string): TokenProperty;
173
162
  declare function tokenValue<TK extends string, N extends string>(themeKey: TK, name: N): TokenValue<TK, N>;
174
163
  declare function arbitraryValue(value: string): ArbitraryValue;
175
- declare const gridValueSchema: v.NumberSchema<number>;
176
- type GridValue = v.Output<typeof gridValueSchema>;
164
+ type GridValue = number;
177
165
  declare const GridValue: {
178
- safeParse: (input: unknown) => v.SafeParseResult<v.NumberSchema<number>>;
166
+ safeParse: (input: unknown) => v.SafeParseResult<v.StringSchema<string>>;
179
167
  };
180
168
  type TokenProperty<P extends string = string> = `--${P}`;
181
169
  declare const TokenProperty: {
@@ -190,7 +178,9 @@ declare const TokenValue: {
190
178
  safeParse: (input: unknown) => v.SafeParseResult<v.StringSchema<`var(--${string}_${string})`>>;
191
179
  };
192
180
  type ArbitraryValue = `var(---,${string})`;
193
- declare const ArbitraryValue: v.StringSchema<string>;
181
+ declare const ArbitraryValue: {
182
+ safeParse: (input: unknown) => v.SafeParseResult<v.StringSchema<`var(---,${string})`>>;
183
+ };
194
184
  type ThemeKey = 'alpha' | 'border' | 'color' | 'ease' | 'font-size' | 'leading' | 'line-style' | 'radii' | 'size' | 'shadow' | 'tracking' | 'transition' | 'weight' | 'z' | (string & {});
195
185
  type ThemeValues = Record<string, string | number>;
196
186
  type Theme = Partial<Record<ThemeKey, ThemeValues>>;
package/dist/index.d.ts CHANGED
@@ -38,19 +38,15 @@ declare const defaultConfig: {
38
38
  readonly 'border-block-end': readonly "border"[];
39
39
  readonly 'border-block-end-color': readonly "color"[];
40
40
  readonly 'border-block-end-style': readonly "line-style"[];
41
- readonly 'border-block-end-width': readonly "grid"[];
42
41
  readonly 'border-block-start': readonly "border"[];
43
42
  readonly 'border-block-start-color': readonly "color"[];
44
43
  readonly 'border-block-start-style': readonly "line-style"[];
45
- readonly 'border-block-start-width': readonly "grid"[];
46
44
  readonly 'border-block-style': readonly "line-style"[];
47
- readonly 'border-block-width': readonly "grid"[];
48
45
  readonly 'border-bottom': readonly "border"[];
49
46
  readonly 'border-bottom-color': readonly "color"[];
50
47
  readonly 'border-bottom-left-radius': readonly "radii"[];
51
48
  readonly 'border-bottom-right-radius': readonly "radii"[];
52
49
  readonly 'border-bottom-style': readonly "line-style"[];
53
- readonly 'border-bottom-width': readonly "grid"[];
54
50
  readonly 'border-color': readonly "color"[];
55
51
  readonly 'border-end-end-radius': readonly "radii"[];
56
52
  readonly 'border-end-start-radius': readonly "radii"[];
@@ -59,22 +55,17 @@ declare const defaultConfig: {
59
55
  readonly 'border-inline-end': readonly "border"[];
60
56
  readonly 'border-inline-end-color': readonly "color"[];
61
57
  readonly 'border-inline-end-style': readonly "line-style"[];
62
- readonly 'border-inline-end-width': readonly "grid"[];
63
58
  readonly 'border-inline-start': readonly "border"[];
64
59
  readonly 'border-inline-start-color': readonly "color"[];
65
60
  readonly 'border-inline-start-style': readonly "line-style"[];
66
- readonly 'border-inline-start-width': readonly "grid"[];
67
61
  readonly 'border-inline-style': readonly "line-style"[];
68
- readonly 'border-inline-width': readonly "grid"[];
69
62
  readonly 'border-left': readonly "border"[];
70
63
  readonly 'border-left-color': readonly "color"[];
71
64
  readonly 'border-left-style': readonly "line-style"[];
72
- readonly 'border-left-width': readonly "grid"[];
73
65
  readonly 'border-radius': readonly "radii"[];
74
66
  readonly 'border-right': readonly "border"[];
75
67
  readonly 'border-right-color': readonly "color"[];
76
68
  readonly 'border-right-style': readonly "line-style"[];
77
- readonly 'border-right-width': readonly "grid"[];
78
69
  readonly 'border-start-end-radius': readonly "radii"[];
79
70
  readonly 'border-start-start-radius': readonly "radii"[];
80
71
  readonly 'border-style': readonly "line-style"[];
@@ -83,8 +74,6 @@ declare const defaultConfig: {
83
74
  readonly 'border-top-left-radius': readonly "radii"[];
84
75
  readonly 'border-top-right-radius': readonly "radii"[];
85
76
  readonly 'border-top-style': readonly "line-style"[];
86
- readonly 'border-top-width': readonly "grid"[];
87
- readonly 'border-width': readonly "grid"[];
88
77
  readonly bottom: readonly "grid"[];
89
78
  readonly 'box-shadow': readonly "shadow"[];
90
79
  readonly 'caret-color': readonly "color"[];
@@ -172,10 +161,9 @@ declare function tokenProperty(name: string): TokenProperty;
172
161
  declare function variantProperty(variant: string, name: string): TokenProperty;
173
162
  declare function tokenValue<TK extends string, N extends string>(themeKey: TK, name: N): TokenValue<TK, N>;
174
163
  declare function arbitraryValue(value: string): ArbitraryValue;
175
- declare const gridValueSchema: v.NumberSchema<number>;
176
- type GridValue = v.Output<typeof gridValueSchema>;
164
+ type GridValue = number;
177
165
  declare const GridValue: {
178
- safeParse: (input: unknown) => v.SafeParseResult<v.NumberSchema<number>>;
166
+ safeParse: (input: unknown) => v.SafeParseResult<v.StringSchema<string>>;
179
167
  };
180
168
  type TokenProperty<P extends string = string> = `--${P}`;
181
169
  declare const TokenProperty: {
@@ -190,7 +178,9 @@ declare const TokenValue: {
190
178
  safeParse: (input: unknown) => v.SafeParseResult<v.StringSchema<`var(--${string}_${string})`>>;
191
179
  };
192
180
  type ArbitraryValue = `var(---,${string})`;
193
- declare const ArbitraryValue: v.StringSchema<string>;
181
+ declare const ArbitraryValue: {
182
+ safeParse: (input: unknown) => v.SafeParseResult<v.StringSchema<`var(---,${string})`>>;
183
+ };
194
184
  type ThemeKey = 'alpha' | 'border' | 'color' | 'ease' | 'font-size' | 'leading' | 'line-style' | 'radii' | 'size' | 'shadow' | 'tracking' | 'transition' | 'weight' | 'z' | (string & {});
195
185
  type ThemeValues = Record<string, string | number>;
196
186
  type Theme = Partial<Record<ThemeKey, ThemeValues>>;
package/dist/index.js CHANGED
@@ -66,7 +66,9 @@ var tokenPropertyRegex = /(?<!var\()--((\w)([\w-]+)?)/;
66
66
  var variantPropertyRegex = /(?<!var\()--((\w)([\w-]+)_([\w-]+))/;
67
67
  var tokenValueRegex = /var\(--([\w-]+)_([\w-]+)\)/;
68
68
  var aritraryValueRegex = /var\(---,(.+)\)/;
69
- var gridValueSchema = v.number();
69
+ var gridValueRegex = /^\d+/;
70
+ var gridValueRegexSchema = v.regex(gridValueRegex);
71
+ var gridValueSchema = v.string([gridValueRegexSchema]);
70
72
  var GridValue = { safeParse: (input) => v.safeParse(gridValueSchema, input) };
71
73
  var tokenPropertyRegexSchema = v.regex(tokenPropertyRegex);
72
74
  var tokenPropertySchema = v.string([tokenPropertyRegexSchema]);
@@ -81,7 +83,11 @@ var VariantProperty = {
81
83
  var tokenValueRegexSchema = v.regex(tokenValueRegex);
82
84
  var tokenValueSchema = v.string([tokenValueRegexSchema]);
83
85
  var TokenValue = { safeParse: (input) => v.safeParse(tokenValueSchema, input) };
84
- var ArbitraryValue = v.string([v.regex(aritraryValueRegex)]);
86
+ var arbitraryValueRegexSchema = v.regex(aritraryValueRegex);
87
+ var arbitraryValueSchema = v.string([
88
+ arbitraryValueRegexSchema
89
+ ]);
90
+ var ArbitraryValue = { safeParse: (input) => v.safeParse(arbitraryValueSchema, input) };
85
91
  var createConfig = (obj) => {
86
92
  return obj;
87
93
  };
@@ -152,19 +158,15 @@ var defaultConfig = createConfig({
152
158
  "border-block-end": ["border"],
153
159
  "border-block-end-color": ["color"],
154
160
  "border-block-end-style": ["line-style"],
155
- "border-block-end-width": ["grid"],
156
161
  "border-block-start": ["border"],
157
162
  "border-block-start-color": ["color"],
158
163
  "border-block-start-style": ["line-style"],
159
- "border-block-start-width": ["grid"],
160
164
  "border-block-style": ["line-style"],
161
- "border-block-width": ["grid"],
162
165
  "border-bottom": ["border"],
163
166
  "border-bottom-color": ["color"],
164
167
  "border-bottom-left-radius": ["radii"],
165
168
  "border-bottom-right-radius": ["radii"],
166
169
  "border-bottom-style": ["line-style"],
167
- "border-bottom-width": ["grid"],
168
170
  "border-color": ["color"],
169
171
  "border-end-end-radius": ["radii"],
170
172
  "border-end-start-radius": ["radii"],
@@ -173,22 +175,17 @@ var defaultConfig = createConfig({
173
175
  "border-inline-end": ["border"],
174
176
  "border-inline-end-color": ["color"],
175
177
  "border-inline-end-style": ["line-style"],
176
- "border-inline-end-width": ["grid"],
177
178
  "border-inline-start": ["border"],
178
179
  "border-inline-start-color": ["color"],
179
180
  "border-inline-start-style": ["line-style"],
180
- "border-inline-start-width": ["grid"],
181
181
  "border-inline-style": ["line-style"],
182
- "border-inline-width": ["grid"],
183
182
  "border-left": ["border"],
184
183
  "border-left-color": ["color"],
185
184
  "border-left-style": ["line-style"],
186
- "border-left-width": ["grid"],
187
185
  "border-radius": ["radii"],
188
186
  "border-right": ["border"],
189
187
  "border-right-color": ["color"],
190
188
  "border-right-style": ["line-style"],
191
- "border-right-width": ["grid"],
192
189
  "border-start-end-radius": ["radii"],
193
190
  "border-start-start-radius": ["radii"],
194
191
  "border-style": ["line-style"],
@@ -197,8 +194,6 @@ var defaultConfig = createConfig({
197
194
  "border-top-left-radius": ["radii"],
198
195
  "border-top-right-radius": ["radii"],
199
196
  "border-top-style": ["line-style"],
200
- "border-top-width": ["grid"],
201
- "border-width": ["grid"],
202
197
  bottom: ["grid"],
203
198
  "box-shadow": ["shadow"],
204
199
  "caret-color": ["color"],
package/dist/index.mjs CHANGED
@@ -16,7 +16,9 @@ var tokenPropertyRegex = /(?<!var\()--((\w)([\w-]+)?)/;
16
16
  var variantPropertyRegex = /(?<!var\()--((\w)([\w-]+)_([\w-]+))/;
17
17
  var tokenValueRegex = /var\(--([\w-]+)_([\w-]+)\)/;
18
18
  var aritraryValueRegex = /var\(---,(.+)\)/;
19
- var gridValueSchema = v.number();
19
+ var gridValueRegex = /^\d+/;
20
+ var gridValueRegexSchema = v.regex(gridValueRegex);
21
+ var gridValueSchema = v.string([gridValueRegexSchema]);
20
22
  var GridValue = { safeParse: (input) => v.safeParse(gridValueSchema, input) };
21
23
  var tokenPropertyRegexSchema = v.regex(tokenPropertyRegex);
22
24
  var tokenPropertySchema = v.string([tokenPropertyRegexSchema]);
@@ -31,7 +33,11 @@ var VariantProperty = {
31
33
  var tokenValueRegexSchema = v.regex(tokenValueRegex);
32
34
  var tokenValueSchema = v.string([tokenValueRegexSchema]);
33
35
  var TokenValue = { safeParse: (input) => v.safeParse(tokenValueSchema, input) };
34
- var ArbitraryValue = v.string([v.regex(aritraryValueRegex)]);
36
+ var arbitraryValueRegexSchema = v.regex(aritraryValueRegex);
37
+ var arbitraryValueSchema = v.string([
38
+ arbitraryValueRegexSchema
39
+ ]);
40
+ var ArbitraryValue = { safeParse: (input) => v.safeParse(arbitraryValueSchema, input) };
35
41
  var createConfig = (obj) => {
36
42
  return obj;
37
43
  };
@@ -102,19 +108,15 @@ var defaultConfig = createConfig({
102
108
  "border-block-end": ["border"],
103
109
  "border-block-end-color": ["color"],
104
110
  "border-block-end-style": ["line-style"],
105
- "border-block-end-width": ["grid"],
106
111
  "border-block-start": ["border"],
107
112
  "border-block-start-color": ["color"],
108
113
  "border-block-start-style": ["line-style"],
109
- "border-block-start-width": ["grid"],
110
114
  "border-block-style": ["line-style"],
111
- "border-block-width": ["grid"],
112
115
  "border-bottom": ["border"],
113
116
  "border-bottom-color": ["color"],
114
117
  "border-bottom-left-radius": ["radii"],
115
118
  "border-bottom-right-radius": ["radii"],
116
119
  "border-bottom-style": ["line-style"],
117
- "border-bottom-width": ["grid"],
118
120
  "border-color": ["color"],
119
121
  "border-end-end-radius": ["radii"],
120
122
  "border-end-start-radius": ["radii"],
@@ -123,22 +125,17 @@ var defaultConfig = createConfig({
123
125
  "border-inline-end": ["border"],
124
126
  "border-inline-end-color": ["color"],
125
127
  "border-inline-end-style": ["line-style"],
126
- "border-inline-end-width": ["grid"],
127
128
  "border-inline-start": ["border"],
128
129
  "border-inline-start-color": ["color"],
129
130
  "border-inline-start-style": ["line-style"],
130
- "border-inline-start-width": ["grid"],
131
131
  "border-inline-style": ["line-style"],
132
- "border-inline-width": ["grid"],
133
132
  "border-left": ["border"],
134
133
  "border-left-color": ["color"],
135
134
  "border-left-style": ["line-style"],
136
- "border-left-width": ["grid"],
137
135
  "border-radius": ["radii"],
138
136
  "border-right": ["border"],
139
137
  "border-right-color": ["color"],
140
138
  "border-right-style": ["line-style"],
141
- "border-right-width": ["grid"],
142
139
  "border-start-end-radius": ["radii"],
143
140
  "border-start-start-radius": ["radii"],
144
141
  "border-style": ["line-style"],
@@ -147,8 +144,6 @@ var defaultConfig = createConfig({
147
144
  "border-top-left-radius": ["radii"],
148
145
  "border-top-right-radius": ["radii"],
149
146
  "border-top-style": ["line-style"],
150
- "border-top-width": ["grid"],
151
- "border-width": ["grid"],
152
147
  bottom: ["grid"],
153
148
  "box-shadow": ["shadow"],
154
149
  "caret-color": ["color"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tokenami/config",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
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.18"
20
+ "@tokenami/dev": "0.0.20"
21
21
  },
22
22
  "scripts": {
23
23
  "build": "tsup src/index.ts --format=esm,cjs --dts",