@tokenami/config 0.0.52 → 0.0.54

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.cjs CHANGED
@@ -1,46 +1,4 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/index.ts
21
- var src_exports = {};
22
- __export(src_exports, {
23
- ArbitraryValue: () => ArbitraryValue,
24
- GridProperty: () => GridProperty,
25
- GridValue: () => GridValue,
26
- TokenProperty: () => TokenProperty,
27
- TokenValue: () => TokenValue,
28
- VariantProperty: () => VariantProperty,
29
- arbitraryValue: () => arbitraryValue,
30
- createConfig: () => createConfig,
31
- defaultConfig: () => defaultConfig,
32
- getCSSPropertiesForAlias: () => getCSSPropertiesForAlias,
33
- getTokenPropertyName: () => getTokenPropertyName,
34
- getTokenPropertyParts: () => getTokenPropertyParts,
35
- getTokenPropertySplit: () => getTokenPropertySplit,
36
- getTokenValueParts: () => getTokenValueParts,
37
- gridProperty: () => gridProperty,
38
- mapShorthandToLonghands: () => mapShorthandToLonghands,
39
- tokenProperty: () => tokenProperty,
40
- tokenValue: () => tokenValue,
41
- variantProperty: () => variantProperty
42
- });
43
- module.exports = __toCommonJS(src_exports);
1
+ 'use strict';
44
2
 
45
3
  // src/config.ts
46
4
  var defaultConfig = {
@@ -66,136 +24,136 @@ var defaultConfig = {
66
24
  disabled: "&:disabled"
67
25
  },
68
26
  properties: {
69
- "accent-color": ["color"],
70
- animation: ["anim"],
71
- "animation-timing-function": ["ease"],
72
- background: ["color", "surface"],
73
- "background-color": ["color"],
74
- "background-image": ["surface"],
75
- "background-position": ["grid"],
76
- "background-position-x": ["grid"],
77
- "background-position-y": ["grid"],
78
- "block-size": ["grid", "size"],
79
- border: ["border"],
80
- "border-block": ["border"],
81
- "border-block-color": ["color"],
82
- "border-block-end": ["border"],
83
- "border-block-end-color": ["color"],
84
- "border-block-end-style": ["line-style"],
85
- "border-block-start": ["border"],
86
- "border-block-start-color": ["color"],
87
- "border-block-start-style": ["line-style"],
88
- "border-block-style": ["line-style"],
89
- "border-bottom": ["border"],
90
- "border-bottom-color": ["color"],
91
- "border-bottom-left-radius": ["radii"],
92
- "border-bottom-right-radius": ["radii"],
93
- "border-bottom-style": ["line-style"],
94
- "border-color": ["color"],
95
- "border-end-end-radius": ["radii"],
96
- "border-end-start-radius": ["radii"],
97
- "border-inline": ["border"],
98
- "border-inline-color": ["color"],
99
- "border-inline-end": ["border"],
100
- "border-inline-end-color": ["color"],
101
- "border-inline-end-style": ["line-style"],
102
- "border-inline-start": ["border"],
103
- "border-inline-start-color": ["color"],
104
- "border-inline-start-style": ["line-style"],
105
- "border-inline-style": ["line-style"],
106
- "border-left": ["border"],
107
- "border-left-color": ["color"],
108
- "border-left-style": ["line-style"],
109
- "border-radius": ["radii"],
110
- "border-right": ["border"],
111
- "border-right-color": ["color"],
112
- "border-right-style": ["line-style"],
113
- "border-start-end-radius": ["radii"],
114
- "border-start-start-radius": ["radii"],
115
- "border-style": ["line-style"],
116
- "border-top": ["border"],
117
- "border-top-color": ["color"],
118
- "border-top-left-radius": ["radii"],
119
- "border-top-right-radius": ["radii"],
120
- "border-top-style": ["line-style"],
121
- bottom: ["grid"],
122
- "box-shadow": ["shadow"],
123
- "caret-color": ["color"],
124
- color: ["color"],
125
- "column-gap": ["grid"],
126
- "column-rule-color": ["color"],
127
- "column-rule-width": ["grid"],
128
- "column-width": ["grid", "size"],
129
- fill: ["color"],
130
- "flex-basis": ["grid", "size"],
131
- "font-family": ["font"],
132
- "font-size": ["font-size"],
133
- "font-weight": ["weight"],
134
- gap: ["grid"],
135
- height: ["grid", "size"],
136
- "inline-size": ["grid", "size"],
137
- inset: ["grid"],
138
- "inset-block": ["grid"],
139
- "inset-block-end": ["grid"],
140
- "inset-block-start": ["grid"],
141
- "inset-inline": ["grid"],
142
- "inset-inline-end": ["grid"],
143
- "inset-inline-start": ["grid"],
144
- left: ["grid"],
145
- "letter-spacing": ["tracking"],
146
- "line-height": ["leading"],
147
- margin: ["grid"],
148
- "margin-block": ["grid"],
149
- "margin-block-end": ["grid"],
150
- "margin-block-start": ["grid"],
151
- "margin-bottom": ["grid"],
152
- "margin-inline": ["grid"],
153
- "margin-inline-end": ["grid"],
154
- "margin-inline-start": ["grid"],
155
- "margin-left": ["grid"],
156
- "margin-right": ["grid"],
157
- "margin-top": ["grid"],
158
- "max-block-size": ["grid", "size"],
159
- "max-height": ["grid", "size"],
160
- "max-inline-size": ["grid", "size"],
161
- "max-width": ["grid", "size"],
162
- "min-block-size": ["grid", "size"],
163
- "min-height": ["grid", "size"],
164
- "min-inline-size": ["grid", "size"],
165
- "min-width": ["grid", "size"],
166
- opacity: ["alpha"],
167
- "outline-color": ["color"],
168
- padding: ["grid"],
169
- "padding-block": ["grid"],
170
- "padding-block-end": ["grid"],
171
- "padding-block-start": ["grid"],
172
- "padding-bottom": ["grid"],
173
- "padding-inline": ["grid"],
174
- "padding-inline-end": ["grid"],
175
- "padding-inline-start": ["grid"],
176
- "padding-left": ["grid"],
177
- "padding-right": ["grid"],
178
- "padding-top": ["grid"],
179
- right: ["grid"],
180
- "row-gap": ["grid"],
181
- "scroll-margin": ["grid"],
182
- "scroll-margin-bottom": ["grid"],
183
- "scroll-margin-left": ["grid"],
184
- "scroll-margin-right": ["grid"],
185
- "scroll-margin-top": ["grid"],
186
- "scroll-padding": ["grid"],
187
- "scroll-padding-bottom": ["grid"],
188
- "scroll-padding-left": ["grid"],
189
- "scroll-padding-right": ["grid"],
190
- "scroll-padding-top": ["grid"],
191
- stroke: ["color"],
192
- "text-decoration-color": ["color"],
193
- "text-shadow": ["shadow"],
194
- top: ["grid"],
195
- transition: ["transition"],
196
- "transition-timing-function": ["ease"],
197
- width: ["grid", "size"],
198
- "z-index": ["z"]
27
+ "--accent-color": ["color"],
28
+ "--animation": ["anim"],
29
+ "--animation-timing-function": ["ease"],
30
+ "--background": ["color", "surface"],
31
+ "--background-color": ["color"],
32
+ "--background-image": ["surface"],
33
+ "--background-position": ["grid"],
34
+ "--background-position-x": ["grid"],
35
+ "--background-position-y": ["grid"],
36
+ "--block-size": ["grid", "size"],
37
+ "--border": ["border"],
38
+ "--border-block": ["border"],
39
+ "--border-block-color": ["color"],
40
+ "--border-block-end": ["border"],
41
+ "--border-block-end-color": ["color"],
42
+ "--border-block-end-style": ["line-style"],
43
+ "--border-block-start": ["border"],
44
+ "--border-block-start-color": ["color"],
45
+ "--border-block-start-style": ["line-style"],
46
+ "--border-block-style": ["line-style"],
47
+ "--border-bottom": ["border"],
48
+ "--border-bottom-color": ["color"],
49
+ "--border-bottom-left-radius": ["radii"],
50
+ "--border-bottom-right-radius": ["radii"],
51
+ "--border-bottom-style": ["line-style"],
52
+ "--border-color": ["color"],
53
+ "--border-end-end-radius": ["radii"],
54
+ "--border-end-start-radius": ["radii"],
55
+ "--border-inline": ["border"],
56
+ "--border-inline-color": ["color"],
57
+ "--border-inline-end": ["border"],
58
+ "--border-inline-end-color": ["color"],
59
+ "--border-inline-end-style": ["line-style"],
60
+ "--border-inline-start": ["border"],
61
+ "--border-inline-start-color": ["color"],
62
+ "--border-inline-start-style": ["line-style"],
63
+ "--border-inline-style": ["line-style"],
64
+ "--border-left": ["border"],
65
+ "--border-left-color": ["color"],
66
+ "--border-left-style": ["line-style"],
67
+ "--border-radius": ["radii"],
68
+ "--border-right": ["border"],
69
+ "--border-right-color": ["color"],
70
+ "--border-right-style": ["line-style"],
71
+ "--border-start-end-radius": ["radii"],
72
+ "--border-start-start-radius": ["radii"],
73
+ "--border-style": ["line-style"],
74
+ "--border-top": ["border"],
75
+ "--border-top-color": ["color"],
76
+ "--border-top-left-radius": ["radii"],
77
+ "--border-top-right-radius": ["radii"],
78
+ "--border-top-style": ["line-style"],
79
+ "--bottom": ["grid"],
80
+ "--box-shadow": ["shadow"],
81
+ "--caret-color": ["color"],
82
+ "--color": ["color"],
83
+ "--column-gap": ["grid"],
84
+ "--column-rule-color": ["color"],
85
+ "--column-rule-width": ["grid"],
86
+ "--column-width": ["grid", "size"],
87
+ "--fill": ["color"],
88
+ "--flex-basis": ["grid", "size"],
89
+ "--font-family": ["font"],
90
+ "--font-size": ["font-size"],
91
+ "--font-weight": ["weight"],
92
+ "--gap": ["grid"],
93
+ "--height": ["grid", "size"],
94
+ "--inline-size": ["grid", "size"],
95
+ "--inset": ["grid"],
96
+ "--inset-block": ["grid"],
97
+ "--inset-block-end": ["grid"],
98
+ "--inset-block-start": ["grid"],
99
+ "--inset-inline": ["grid"],
100
+ "--inset-inline-end": ["grid"],
101
+ "--inset-inline-start": ["grid"],
102
+ "--left": ["grid"],
103
+ "--letter-spacing": ["tracking"],
104
+ "--line-height": ["leading"],
105
+ "--margin": ["grid"],
106
+ "--margin-block": ["grid"],
107
+ "--margin-block-end": ["grid"],
108
+ "--margin-block-start": ["grid"],
109
+ "--margin-bottom": ["grid"],
110
+ "--margin-inline": ["grid"],
111
+ "--margin-inline-end": ["grid"],
112
+ "--margin-inline-start": ["grid"],
113
+ "--margin-left": ["grid"],
114
+ "--margin-right": ["grid"],
115
+ "--margin-top": ["grid"],
116
+ "--max-block-size": ["grid", "size"],
117
+ "--max-height": ["grid", "size"],
118
+ "--max-inline-size": ["grid", "size"],
119
+ "--max-width": ["grid", "size"],
120
+ "--min-block-size": ["grid", "size"],
121
+ "--min-height": ["grid", "size"],
122
+ "--min-inline-size": ["grid", "size"],
123
+ "--min-width": ["grid", "size"],
124
+ "--opacity": ["alpha"],
125
+ "--outline-color": ["color"],
126
+ "--padding": ["grid"],
127
+ "--padding-block": ["grid"],
128
+ "--padding-block-end": ["grid"],
129
+ "--padding-block-start": ["grid"],
130
+ "--padding-bottom": ["grid"],
131
+ "--padding-inline": ["grid"],
132
+ "--padding-inline-end": ["grid"],
133
+ "--padding-inline-start": ["grid"],
134
+ "--padding-left": ["grid"],
135
+ "--padding-right": ["grid"],
136
+ "--padding-top": ["grid"],
137
+ "--right": ["grid"],
138
+ "--row-gap": ["grid"],
139
+ "--scroll-margin": ["grid"],
140
+ "--scroll-margin-bottom": ["grid"],
141
+ "--scroll-margin-left": ["grid"],
142
+ "--scroll-margin-right": ["grid"],
143
+ "--scroll-margin-top": ["grid"],
144
+ "--scroll-padding": ["grid"],
145
+ "--scroll-padding-bottom": ["grid"],
146
+ "--scroll-padding-left": ["grid"],
147
+ "--scroll-padding-right": ["grid"],
148
+ "--scroll-padding-top": ["grid"],
149
+ "--stroke": ["color"],
150
+ "--text-decoration-color": ["color"],
151
+ "--text-shadow": ["shadow"],
152
+ "--top": ["grid"],
153
+ "--transition": ["transition"],
154
+ "--transition-timing-function": ["ease"],
155
+ "--width": ["grid", "size"],
156
+ "--z-index": ["z"]
199
157
  }
200
158
  };
201
159
  function createConfig(obj) {
@@ -215,14 +173,16 @@ var gridValueRegex = /^\d+/;
215
173
  var GridValue = {
216
174
  safeParse: (input) => validate(gridValueRegex, input)
217
175
  };
218
- var charClass = `A-Za-z0-9!#$%&()*+,./:;<=>?@[\\]^_{|}~`;
219
- var tokenPropertyRegex = new RegExp(`(?<!var\\()--[${charClass}]([${charClass}-]+)?`);
176
+ var tokenPropertyRegex = /(?<!var\()--(?:[\w-]+|\{[^\{\}]*\})+/g;
220
177
  var TokenProperty = {
221
178
  safeParse: (input) => validate(tokenPropertyRegex, input)
222
179
  };
223
180
  function tokenProperty(name) {
224
181
  return `--${name}`;
225
182
  }
183
+ function parsedTokenProperty(name) {
184
+ return parseProperty(tokenProperty(name));
185
+ }
226
186
  var variantPropertyRegex = /(?<!var\()--((\w)([\w-]+)_([\w-]+))/;
227
187
  var VariantProperty = {
228
188
  safeParse: (input) => validate(variantPropertyRegex, input)
@@ -230,6 +190,9 @@ var VariantProperty = {
230
190
  function variantProperty(variant, name) {
231
191
  return `--${variant}_${name}`;
232
192
  }
193
+ function parsedVariantProperty(variant, name) {
194
+ return parseProperty(variantProperty(variant, name));
195
+ }
233
196
  var tokenValueRegex = /var\((--([\w-]+)_([\w-]+))\)/;
234
197
  var TokenValue = {
235
198
  safeParse: (input) => validate(tokenValueRegex, input)
@@ -260,24 +223,36 @@ function getTokenPropertyName(property) {
260
223
  const propertyPrefix = tokenProperty("");
261
224
  return property.replace(propertyPrefix, "");
262
225
  }
226
+ var propertySplitRegex = /_(?![^{}]*\])/;
263
227
  function getTokenPropertySplit(property) {
264
228
  const name = getTokenPropertyName(property);
265
- const [alias, ...variants] = name.split("_").reverse();
229
+ const [alias, ...variants] = name.split(propertySplitRegex).reverse();
266
230
  return { alias, variants: variants.reverse() };
267
231
  }
268
232
  function getTokenPropertyParts(tokenProperty2, config) {
269
- var _a, _b, _c;
233
+ var _a;
270
234
  const { alias, variants } = getTokenPropertySplit(tokenProperty2);
271
235
  const [firstVariant, secondVariant] = variants;
272
- const firstSelector = ((_a = config.selectors) == null ? void 0 : _a[firstVariant]) && firstVariant;
273
- const secondSelector = ((_b = config.selectors) == null ? void 0 : _b[secondVariant]) && secondVariant;
274
- const responsive = ((_c = config.responsive) == null ? void 0 : _c[firstVariant]) && firstVariant;
236
+ const firstSelector = getValidSelector(firstVariant, config);
237
+ const secondSelector = getValidSelector(secondVariant, config);
238
+ const responsive = ((_a = config.responsive) == null ? void 0 : _a[firstVariant]) && firstVariant;
275
239
  const selector = firstSelector || secondSelector;
276
240
  const validVariant = [responsive, selector].filter(Boolean).join("_");
277
- if (firstVariant && variantProperty(validVariant, alias) !== tokenProperty2)
241
+ const variantProp = variantProperty(validVariant, alias);
242
+ if (firstVariant && variantProp !== tokenProperty2)
278
243
  return null;
279
244
  return { alias, responsive, selector, variant: validVariant };
280
245
  }
246
+ function getValidSelector(selector, config) {
247
+ var _a;
248
+ if (!selector)
249
+ return;
250
+ return (getArbitrarySelector(selector) || ((_a = config.selectors) == null ? void 0 : _a[selector])) && selector;
251
+ }
252
+ function getArbitrarySelector(selector) {
253
+ const [, arbitrarySelector] = (selector == null ? void 0 : selector.match(/^{(.+)}$/)) || [];
254
+ return arbitrarySelector ? decodeColon(arbitrarySelector) : void 0;
255
+ }
281
256
  function getTokenValueParts(tokenValue2) {
282
257
  const [, property, themeKey, token] = tokenValue2.split(tokenValueRegex);
283
258
  return { property, themeKey, token };
@@ -285,241 +260,114 @@ function getTokenValueParts(tokenValue2) {
285
260
  function getCSSPropertiesForAlias(alias, aliases) {
286
261
  return (aliases == null ? void 0 : aliases[alias]) || [alias];
287
262
  }
263
+ var escapeSpecialCharsRegex = /[&#.:;>~*[\]=,"'()+{}]/g;
264
+ function parseProperty(str, options) {
265
+ const { escapeSpecialChars = true } = options || {};
266
+ const noColon = encodeColon(str);
267
+ if (!escapeSpecialChars)
268
+ return noColon;
269
+ return noColon.replace(escapeSpecialCharsRegex, (match) => `\\${match}`);
270
+ }
271
+ var encodeColon = (str) => str.replace(/:/g, ";");
272
+ var decodeColon = (str) => str.replace(/;/g, ":");
288
273
 
289
274
  // src/shorthands.ts
290
- var mapShorthandToLonghands = {
291
- all: [],
292
- animation: [
293
- "animation-name",
294
- "animation-duration",
295
- "animation-timing-function",
296
- "animation-delay",
297
- "animation-iteration-count",
298
- "animation-direction",
299
- "animation-fill-mode",
300
- "animation-play-state",
301
- "animation-timeline"
302
- ],
303
- background: [
304
- "background-attachment",
305
- "background-clip",
306
- "background-color",
307
- "background-image",
308
- "background-position",
309
- "background-repeat",
310
- "background-size"
311
- ],
312
- "background-position": ["background-position-x", "background-position-y"],
313
- border: [
314
- "border-top",
315
- "border-right",
316
- "border-bottom",
317
- "border-left",
318
- "border-color",
319
- "border-style",
320
- "border-width",
321
- "border-image",
322
- "border-block",
323
- "border-inline"
324
- ],
325
- "border-top": ["border-top-width", "border-top-style", "border-top-color"],
326
- "border-right": ["border-right-width", "border-right-style", "border-right-color"],
327
- "border-bottom": ["border-bottom-width", "border-bottom-style", "border-bottom-color"],
328
- "border-left": ["border-left-width", "border-left-style", "border-left-color"],
329
- "border-color": [
330
- "border-top-color",
331
- "border-right-color",
332
- "border-bottom-color",
333
- "border-left-color"
334
- ],
335
- "border-style": [
336
- "border-top-style",
337
- "border-right-style",
338
- "border-bottom-style",
339
- "border-left-style"
340
- ],
341
- "border-width": [
342
- "border-top-width",
343
- "border-right-width",
344
- "border-bottom-width",
345
- "border-left-width"
346
- ],
347
- "border-image": [
348
- "border-image-source",
349
- "border-image-slice",
350
- "border-image-width",
351
- "border-image-outset",
352
- "border-image-repeat"
353
- ],
354
- "border-radius": [
355
- "border-top-left-radius",
356
- "border-top-right-radius",
357
- "border-bottom-right-radius",
358
- "border-bottom-left-radius"
359
- ],
360
- "border-block": [
361
- "border-block-width",
362
- "border-block-style",
363
- "border-block-color",
364
- "border-block-start",
365
- "border-block-end"
366
- ],
367
- "border-block-width": ["border-block-start-width", "border-block-end-width"],
368
- "border-block-style": ["border-block-start-style", "border-block-end-style"],
369
- "border-block-color": ["border-block-start-color", "border-block-end-color"],
370
- "border-block-start": [
371
- "border-block-start-width",
372
- "border-block-start-style",
373
- "border-block-start-color"
374
- ],
375
- "border-block-end": [
376
- "border-block-end-width",
377
- "border-block-end-style",
378
- "border-block-end-color"
379
- ],
380
- "border-inline": [
381
- "border-inline-width",
382
- "border-inline-style",
383
- "border-inline-color",
384
- "border-inline-start",
385
- "border-inline-end"
386
- ],
387
- "border-inline-width": ["border-inline-start-width", "border-inline-end-width"],
388
- "border-inline-style": ["border-inline-start-style", "border-inline-end-style"],
389
- "border-inline-color": ["border-inline-start-color", "border-inline-end-color"],
390
- "border-inline-start": [
391
- "border-inline-start-width",
392
- "border-inline-start-style",
393
- "border-inline-start-color"
394
- ],
395
- "border-inline-end": [
396
- "border-inline-end-width",
397
- "border-inline-end-style",
398
- "border-inline-end-color"
399
- ],
400
- "column-rule": ["column-rule-width", "column-rule-style", "column-rule-color"],
401
- columns: ["column-width", "column-count"],
402
- container: ["container-name", "container-type"],
403
- "contain-intrinsic-size": ["contain-intrinsic-width", "contain-intrinsic-height"],
404
- flex: ["flex-grow", "flex-shrink", "flex-basis"],
405
- "flex-flow": ["flex-direction", "flex-wrap"],
406
- font: [
407
- "font-style",
408
- "font-variant",
409
- "font-weight",
410
- "font-stretch",
411
- "font-size",
412
- "line-height",
413
- "font-family"
414
- ],
415
- "font-variant": [
416
- "font-variant-alternates",
417
- "font-variant-caps",
418
- "font-variant-east-asian",
419
- "font-variant-emoji",
420
- "font-variant-ligatures",
421
- "font-variant-numeric",
422
- "font-variant-position"
423
- ],
424
- gap: ["row-gap", "column-gap"],
425
- grid: [
426
- "grid-auto-columns",
427
- "grid-auto-flow",
428
- "grid-auto-rows",
429
- "grid-template-areas",
430
- "grid-template-columns",
431
- "grid-template-rows"
432
- ],
433
- "grid-area": ["grid-row-start", "grid-column-start", "grid-row-end", "grid-column-end"],
434
- "grid-column": ["grid-column-start", "grid-column-end"],
435
- "grid-row": ["grid-row-start", "grid-row-end"],
436
- "grid-template": ["grid-template-rows", "grid-template-columns", "grid-template-areas"],
437
- inset: ["top", "right", "bottom", "left"],
438
- "list-style": ["list-style-type", "list-style-position", "list-style-image"],
439
- "inset-block": ["inset-block-start", "inset-block-end"],
440
- "inset-inline": ["inset-inline-start", "inset-inline-end"],
441
- margin: ["margin-top", "margin-right", "margin-bottom", "margin-left"],
442
- "margin-block": ["margin-block-start", "margin-block-end"],
443
- "margin-inline": ["margin-inline-start", "margin-inline-end"],
444
- mask: [
445
- "mask-image",
446
- "mask-mode",
447
- "mask-position",
448
- "mask-size",
449
- "mask-repeat",
450
- "mask-origin",
451
- "mask-clip",
452
- "mask-composite",
453
- "mask-type"
454
- ],
455
- "mask-border": [
456
- "mask-border-mode",
457
- "mask-border-outset",
458
- "mask-border-repeat",
459
- "mask-border-slice",
460
- "mask-border-source",
461
- "mask-border-width"
462
- ],
463
- offset: ["offset-position", "offset-path", "offset-distance", "offset-anchor", "offset-rotate"],
464
- outline: ["outline-color", "outline-style", "outline-width"],
465
- overflow: ["overflow-x", "overflow-y"],
466
- "overscroll-behavior": ["overscroll-behavior-x", "overscroll-behavior-y"],
467
- padding: ["padding-top", "padding-right", "padding-bottom", "padding-left"],
468
- "padding-block": ["padding-block-start", "padding-block-end"],
469
- "padding-inline": ["padding-inline-start", "padding-inline-end"],
470
- "place-content": ["align-content", "justify-content"],
471
- "place-items": ["align-items", "justify-items"],
472
- "place-self": ["align-self", "justify-self"],
473
- "scroll-margin": [
474
- "scroll-margin-top",
475
- "scroll-margin-right",
476
- "scroll-margin-bottom",
477
- "scroll-margin-left"
478
- ],
479
- "scroll-margin-block": ["scroll-margin-block-start", "scroll-margin-block-end"],
480
- "scroll-margin-inline": ["scroll-margin-inline-start", "scroll-margin-inline-end"],
481
- "scroll-padding": [
482
- "scroll-padding-top",
483
- "scroll-padding-right",
484
- "scroll-padding-bottom",
485
- "scroll-padding-left"
486
- ],
487
- "scroll-padding-block": ["scroll-padding-block-start", "scroll-padding-block-end"],
488
- "scroll-padding-inline": ["scroll-padding-inline-start", "scroll-padding-inline-end"],
489
- "scroll-timeline": ["scroll-timeline-name", "scroll-timeline-axis"],
490
- "text-decoration": [
491
- "text-decoration-line",
492
- "text-decoration-style",
493
- "text-decoration-color",
494
- "text-decoration-thickness"
495
- ],
496
- "text-emphasis": ["text-emphasis-style", "text-emphasis-color"],
497
- transition: [
498
- "transition-delay",
499
- "transition-duration",
500
- "transition-property",
501
- "transition-timing-function"
502
- ]
503
- };
504
- // Annotate the CommonJS export names for ESM import in node:
505
- 0 && (module.exports = {
506
- ArbitraryValue,
507
- GridProperty,
508
- GridValue,
509
- TokenProperty,
510
- TokenValue,
511
- VariantProperty,
512
- arbitraryValue,
513
- createConfig,
514
- defaultConfig,
515
- getCSSPropertiesForAlias,
516
- getTokenPropertyName,
517
- getTokenPropertyParts,
518
- getTokenPropertySplit,
519
- getTokenValueParts,
520
- gridProperty,
521
- mapShorthandToLonghands,
522
- tokenProperty,
523
- tokenValue,
524
- variantProperty
525
- });
275
+ var shorthandsToLonghands = [
276
+ ["all", []],
277
+ ["animation", ["&-name", "&-duration", "&-timing-function", "&-delay", "&-iteration-count", "&-direction", "&-fill-mode", "&-play-state", "&-timeline"]],
278
+ ["background", ["&-attachment", "&-clip", "&-color", "&-image", "&-position", "&-repeat", "&-size"]],
279
+ ["background-position", ["&-x", "&-y"]],
280
+ ["border", ["&-top", "&-right", "&-bottom", "&-left", "&-color", "&-style", "&-width", "&-image", "&-block", "&-inline"]],
281
+ ["border-top", ["&-width", "&-style", "&-color"]],
282
+ ["border-right", ["&-width", "&-style", "&-color"]],
283
+ ["border-bottom", ["&-width", "&-style", "&-color"]],
284
+ ["border-left", ["&-width", "&-style", "&-color"]],
285
+ ["border-color", ["border-top-color", "border-right-color", "border-bottom-color", "border-left-color"]],
286
+ ["border-style", ["border-top-style", "border-right-style", "border-bottom-style", "border-left-style"]],
287
+ ["border-width", ["border-top-width", "border-right-width", "border-bottom-width", "border-left-width"]],
288
+ ["border-image", ["&-source", "&-slice", "&-width", "&-outset", "&-repeat"]],
289
+ ["border-radius", ["border-top-left-radius", "border-top-right-radius", "border-bottom-right-radius", "border-bottom-left-radius"]],
290
+ ["border-block", ["&-width", "&-style", "&-color", "&-start", "&-end"]],
291
+ ["border-block-width", ["border-block-start-width", "border-block-end-width"]],
292
+ ["border-block-style", ["border-block-start-style", "border-block-end-style"]],
293
+ ["border-block-color", ["border-block-start-color", "border-block-end-color"]],
294
+ ["border-block-start", ["&-width", "&-style", "&-color"]],
295
+ ["border-block-end", ["&-width", "&-style", "&-color"]],
296
+ ["border-inline", ["&-width", "&-style", "&-color", "&-start", "&-end"]],
297
+ ["border-inline-width", ["border-inline-start-width", "border-inline-end-width"]],
298
+ ["border-inline-style", ["border-inline-start-style", "border-inline-end-style"]],
299
+ ["border-inline-color", ["border-inline-start-color", "border-inline-end-color"]],
300
+ ["border-inline-start", ["&-width", "&-style", "&-color"]],
301
+ ["border-inline-end", ["&-width", "&-style", "&-color"]],
302
+ ["column-rule", ["&-width", "&-style", "&-color"]],
303
+ ["columns", ["column-width", "column-count"]],
304
+ ["container", ["&-name", "&-type"]],
305
+ ["contain-intrinsic-size", ["contain-intrinsic-width", "contain-intrinsic-height"]],
306
+ ["flex", ["&-grow", "&-shrink", "&-basis"]],
307
+ ["flex-flow", ["flex-direction", "flex-wrap"]],
308
+ ["font", ["&-style", "&-variant", "&-weight", "&-stretch", "&-size", "line-height", "&-family"]],
309
+ ["font-variant", ["&-alternates", "&-caps", "&-east-asian", "&-emoji", "&-ligatures", "&-numeric", "&-position"]],
310
+ ["gap", ["row-gap", "column-gap"]],
311
+ ["grid", ["&-auto-columns", "&-auto-flow", "&-auto-rows", "&-template-areas", "&-template-columns", "&-template-rows"]],
312
+ ["grid-area", ["grid-row-start", "grid-column-start", "grid-row-end", "grid-column-end"]],
313
+ ["grid-column", ["&-start", "&-end"]],
314
+ ["grid-row", ["&-start", "&-end"]],
315
+ ["grid-template", ["&-rows", "&-columns", "&-areas"]],
316
+ ["inset", ["top", "right", "bottom", "left"]],
317
+ ["list-style", ["&-type", "&-position", "&-image"]],
318
+ ["inset-block", ["&-start", "&-end"]],
319
+ ["inset-inline", ["&-start", "&-end"]],
320
+ ["margin", ["&-top", "&-right", "&-bottom", "&-left"]],
321
+ ["margin-block", ["&-start", "&-end"]],
322
+ ["margin-inline", ["&-start", "&-end"]],
323
+ ["mask", ["&-image", "&-mode", "&-position", "&-size", "&-repeat", "&-origin", "&-clip", "&-composite", "&-type"]],
324
+ ["mask-border", ["&-mode", "&-outset", "&-repeat", "&-slice", "&-source", "&-width"]],
325
+ ["offset", ["&-position", "&-path", "&-distance", "&-anchor", "&-rotate"]],
326
+ ["outline", ["&-color", "&-style", "&-width"]],
327
+ ["overflow", ["&-x", "&-y"]],
328
+ ["overscroll-behavior", ["&-x", "&-y"]],
329
+ ["padding", ["&-top", "&-right", "&-bottom", "&-left"]],
330
+ ["padding-block", ["&-start", "&-end"]],
331
+ ["padding-inline", ["&-start", "&-end"]],
332
+ ["place-content", ["align-content", "justify-content"]],
333
+ ["place-items", ["align-items", "justify-items"]],
334
+ ["place-self", ["align-self", "justify-self"]],
335
+ ["scroll-margin", ["&-top", "&-right", "&-bottom", "&-left"]],
336
+ ["scroll-margin-block", ["&-start", "&-end"]],
337
+ ["scroll-margin-inline", ["&-start", "&-end"]],
338
+ ["scroll-padding", ["&-top", "&-right", "&-bottom", "&-left"]],
339
+ ["scroll-padding-block", ["&-start", "&-end"]],
340
+ ["scroll-padding-inline", ["&-start", "&-end"]],
341
+ ["scroll-timeline", ["&-name", "&-axis"]],
342
+ ["text-decoration", ["&-line", "&-style", "&-color", "&-thickness"]],
343
+ ["text-emphasis", ["&-style", "&-color"]],
344
+ ["transition", ["&-delay", "&-duration", "&-property", "&-timing-function"]]
345
+ ];
346
+ var replacedAmpersands = shorthandsToLonghands.map(
347
+ ([key, values]) => [key, values.map((value) => value.replace("&", key))]
348
+ );
349
+ var mapShorthandToLonghands = new Map(replacedAmpersands);
350
+
351
+ exports.ArbitraryValue = ArbitraryValue;
352
+ exports.GridProperty = GridProperty;
353
+ exports.GridValue = GridValue;
354
+ exports.TokenProperty = TokenProperty;
355
+ exports.TokenValue = TokenValue;
356
+ exports.VariantProperty = VariantProperty;
357
+ exports.arbitraryValue = arbitraryValue;
358
+ exports.createConfig = createConfig;
359
+ exports.defaultConfig = defaultConfig;
360
+ exports.getArbitrarySelector = getArbitrarySelector;
361
+ exports.getCSSPropertiesForAlias = getCSSPropertiesForAlias;
362
+ exports.getTokenPropertyName = getTokenPropertyName;
363
+ exports.getTokenPropertyParts = getTokenPropertyParts;
364
+ exports.getTokenPropertySplit = getTokenPropertySplit;
365
+ exports.getTokenValueParts = getTokenValueParts;
366
+ exports.gridProperty = gridProperty;
367
+ exports.mapShorthandToLonghands = mapShorthandToLonghands;
368
+ exports.parseProperty = parseProperty;
369
+ exports.parsedTokenProperty = parsedTokenProperty;
370
+ exports.parsedVariantProperty = parsedVariantProperty;
371
+ exports.tokenProperty = tokenProperty;
372
+ exports.tokenValue = tokenValue;
373
+ exports.variantProperty = variantProperty;