tailwind-zag 1.0.4 → 1.0.5
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 +488 -204
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -24
- package/dist/index.d.mts +38 -0
- package/dist/index.mjs +470 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +16 -15
- package/dist/index.d.ts +0 -36
- package/dist/index.js +0 -208
- package/dist/index.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,214 +1,498 @@
|
|
|
1
|
-
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
+
__defProp(to, key, {
|
|
14
|
+
get: ((k) => from[k]).bind(null, key),
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
+
value: mod,
|
|
24
|
+
enumerable: true
|
|
25
|
+
}) : target, mod));
|
|
2
26
|
|
|
3
|
-
|
|
27
|
+
//#endregion
|
|
28
|
+
let tailwindcss_plugin_js = require("tailwindcss/plugin.js");
|
|
29
|
+
tailwindcss_plugin_js = __toESM(tailwindcss_plugin_js);
|
|
4
30
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
31
|
+
//#region src/index.ts
|
|
32
|
+
const STATIC_VARIANT_ENTRIES = [
|
|
33
|
+
{
|
|
34
|
+
key: "hover",
|
|
35
|
+
values: [null]
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
key: "focus",
|
|
39
|
+
values: [null]
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
key: "focus-visible",
|
|
43
|
+
values: [null]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
key: "focusable",
|
|
47
|
+
values: [null]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
key: "active",
|
|
51
|
+
values: [null]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
key: "valid",
|
|
55
|
+
values: [null]
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
key: "invalid",
|
|
59
|
+
values: [null]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
key: "disabled",
|
|
63
|
+
values: [null]
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
key: "readonly",
|
|
67
|
+
values: [null, "read-only"]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
key: "current",
|
|
71
|
+
values: [null]
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
key: "inview",
|
|
75
|
+
values: [null]
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
key: "copied",
|
|
79
|
+
values: [null]
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
key: "collapsible",
|
|
83
|
+
values: [null]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
key: "highlighted",
|
|
87
|
+
values: [null]
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
key: "selected",
|
|
91
|
+
values: [null]
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
key: "placeholder",
|
|
95
|
+
values: [null]
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
key: "placeholder-shown",
|
|
99
|
+
values: [null]
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
key: "autoresize",
|
|
103
|
+
values: [null]
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
key: "required",
|
|
107
|
+
values: [null]
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
key: "grabbed",
|
|
111
|
+
values: [null]
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
key: "dragging",
|
|
115
|
+
values: [null]
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
key: "complete",
|
|
119
|
+
values: [null]
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
key: "incomplete",
|
|
123
|
+
values: [null]
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
key: "expanded",
|
|
127
|
+
values: [null, "state=\"expanded\""]
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
key: "half",
|
|
131
|
+
values: [null]
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
key: "first",
|
|
135
|
+
values: [null]
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
key: "mounted",
|
|
139
|
+
values: [null]
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
key: "overlap",
|
|
143
|
+
values: [null]
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
key: "sibling",
|
|
147
|
+
values: [null]
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
key: "paused",
|
|
151
|
+
values: [null]
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
key: "pressed",
|
|
155
|
+
values: [null]
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
key: "on",
|
|
159
|
+
values: ["state=\"on\""]
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
key: "off",
|
|
163
|
+
values: ["state=\"off\""]
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
key: "open",
|
|
167
|
+
values: ["state=\"open\""]
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
key: "closed",
|
|
171
|
+
values: ["state=\"closed\""]
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
key: "hidden",
|
|
175
|
+
values: [null, "state=\"hidden\""]
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
key: "visible",
|
|
179
|
+
values: [null, "state=\"visible\""]
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
key: "checked",
|
|
183
|
+
values: [null, "state=\"checked\""]
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
key: "unchecked",
|
|
187
|
+
values: [null, "state=\"unchecked\""]
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
key: "indeterminate",
|
|
191
|
+
values: [null, "state=\"indeterminate\""]
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
key: "vertical",
|
|
195
|
+
values: ["orientation=\"vertical\""]
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
key: "horizontal",
|
|
199
|
+
values: ["orientation=\"horizontal\""]
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
key: "placement-top",
|
|
203
|
+
values: ["placement=\"top\""]
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
key: "placement-top-end",
|
|
207
|
+
values: ["placement=\"top-end\""]
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
key: "placement-top-start",
|
|
211
|
+
values: ["placement=\"top-start\""]
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
key: "placement-left",
|
|
215
|
+
values: ["placement=\"left\""]
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
key: "placement-left-end",
|
|
219
|
+
values: ["placement=\"left-end\""]
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
key: "placement-left-start",
|
|
223
|
+
values: ["placement=\"left-start\""]
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
key: "placement-right",
|
|
227
|
+
values: ["placement=\"right\""]
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
key: "placement-right-end",
|
|
231
|
+
values: ["placement=\"right-end\""]
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
key: "placement-right-start",
|
|
235
|
+
values: ["placement=\"right-start\""]
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
key: "placement-bottom",
|
|
239
|
+
values: ["placement=\"bottom\""]
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
key: "placement-bottom-end",
|
|
243
|
+
values: ["placement=\"bottom-end\""]
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
key: "placement-bottom-start",
|
|
247
|
+
values: ["placement=\"bottom-start\""]
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
key: "side-top",
|
|
251
|
+
values: ["side=\"top\""]
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
key: "side-left",
|
|
255
|
+
values: ["side=\"left\""]
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
key: "side-right",
|
|
259
|
+
values: ["side=\"right\""]
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
key: "side-bottom",
|
|
263
|
+
values: ["side=\"bottom\""]
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
key: "align-center",
|
|
267
|
+
values: ["align=\"center\""]
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
key: "align-start",
|
|
271
|
+
values: ["align=\"start\""]
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
key: "align-end",
|
|
275
|
+
values: ["align=\"end\""]
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
key: "now",
|
|
279
|
+
values: [null]
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
key: "today",
|
|
283
|
+
values: [null]
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
key: "weekend",
|
|
287
|
+
values: [null]
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
key: "in-range",
|
|
291
|
+
values: [null]
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
key: "out-of-range",
|
|
295
|
+
values: ["outside-range"]
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
key: "range-start",
|
|
299
|
+
values: [null]
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
key: "range-end",
|
|
303
|
+
values: [null]
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
key: "unavailable",
|
|
307
|
+
values: [null]
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
key: "topmost",
|
|
311
|
+
values: [null]
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
key: "view-day",
|
|
315
|
+
values: ["view=\"day\""]
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
key: "view-month",
|
|
319
|
+
values: ["view=\"month\""]
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
key: "view-year",
|
|
323
|
+
values: ["view=\"year\""]
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
key: "under-value",
|
|
327
|
+
values: ["state=\"under-value\""]
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
key: "over-value",
|
|
331
|
+
values: ["state=\"over-value\""]
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
key: "at-value",
|
|
335
|
+
values: ["state=\"at-value\""]
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
key: "delete-intent",
|
|
339
|
+
values: [null]
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
key: "unit-hour",
|
|
343
|
+
values: ["unit=\"hour\""]
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
key: "unit-minute",
|
|
347
|
+
values: ["unit=\"minute\""]
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
key: "unit-second",
|
|
351
|
+
values: ["unit=\"second\""]
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
key: "unit-period",
|
|
355
|
+
values: ["unit=\"period\""]
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
key: "channel-hue",
|
|
359
|
+
values: ["channel=\"hue\""]
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
key: "channel-saturation",
|
|
363
|
+
values: ["channel=\"saturation\""]
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
key: "channel-brightness",
|
|
367
|
+
values: ["channel=\"brightness\""]
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
key: "channel-lightness",
|
|
371
|
+
values: ["channel=\"lightness\""]
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
key: "channel-red",
|
|
375
|
+
values: ["channel=\"red\""]
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
key: "channel-green",
|
|
379
|
+
values: ["channel=\"green\""]
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
key: "channel-blue",
|
|
383
|
+
values: ["channel=\"blue\""]
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
key: "channel-alpha",
|
|
387
|
+
values: ["channel=\"alpha\""]
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
key: "channel-hex",
|
|
391
|
+
values: ["channel=\"hex\""]
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
key: "channel-css",
|
|
395
|
+
values: ["channel=\"css\""]
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
key: "tour-highlighted",
|
|
399
|
+
values: [null]
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
key: "scroll-lock",
|
|
403
|
+
values: [null]
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
key: "inert",
|
|
407
|
+
values: [null]
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
key: "empty",
|
|
411
|
+
values: [null]
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
key: "fullscreen",
|
|
415
|
+
values: [null]
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
key: "loading",
|
|
419
|
+
values: [null]
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
key: "loaded",
|
|
423
|
+
values: [null]
|
|
424
|
+
}
|
|
108
425
|
];
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
o[i] = i.toString();
|
|
113
|
-
return o;
|
|
426
|
+
const DEFAULT_DYNAMIC_VARIANT_ENTRY_KNOWN_INT_VALUES = Array.from({ length: 10 }).reduce((o, _v, i) => {
|
|
427
|
+
o[i] = i.toString();
|
|
428
|
+
return o;
|
|
114
429
|
}, {});
|
|
115
430
|
function isInt(subject) {
|
|
116
|
-
|
|
431
|
+
return !Number.isNaN(Number.parseInt(subject, 36));
|
|
117
432
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
159
|
-
}
|
|
433
|
+
const DYNAMIC_VARIANT_ENTRIES = [
|
|
434
|
+
{ key: "scope" },
|
|
435
|
+
{ key: "part" },
|
|
436
|
+
{ key: "value" },
|
|
437
|
+
{ key: "valuetext" },
|
|
438
|
+
{
|
|
439
|
+
key: "index",
|
|
440
|
+
validate: isInt,
|
|
441
|
+
knownValues: DEFAULT_DYNAMIC_VARIANT_ENTRY_KNOWN_INT_VALUES
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
key: "columns",
|
|
445
|
+
validate: isInt,
|
|
446
|
+
knownValues: DEFAULT_DYNAMIC_VARIANT_ENTRY_KNOWN_INT_VALUES
|
|
447
|
+
},
|
|
448
|
+
{ key: "branch" },
|
|
449
|
+
{
|
|
450
|
+
key: "depth",
|
|
451
|
+
validate: isInt,
|
|
452
|
+
knownValues: DEFAULT_DYNAMIC_VARIANT_ENTRY_KNOWN_INT_VALUES
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
key: "path",
|
|
456
|
+
validate: isInt,
|
|
457
|
+
knownValues: DEFAULT_DYNAMIC_VARIANT_ENTRY_KNOWN_INT_VALUES
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
key: "type",
|
|
461
|
+
knownValues: {
|
|
462
|
+
info: "info",
|
|
463
|
+
error: "error",
|
|
464
|
+
warning: "warning",
|
|
465
|
+
success: "success",
|
|
466
|
+
loading: "loading",
|
|
467
|
+
floating: "floating",
|
|
468
|
+
tooltip: "tooltip",
|
|
469
|
+
dialog: "dialog",
|
|
470
|
+
wait: "wait"
|
|
471
|
+
}
|
|
472
|
+
}
|
|
160
473
|
];
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
values.map(
|
|
182
|
-
(value) => value === null ? `.peer[data-${key}] ~ &` : `.peer[data-${value}] ~ &`
|
|
183
|
-
)
|
|
184
|
-
);
|
|
185
|
-
}
|
|
186
|
-
for (const { key, knownValues, validate } of DYNAMIC_VARIANT_ENTRIES) {
|
|
187
|
-
const isValid = validate ?? (() => true);
|
|
188
|
-
matchVariant(
|
|
189
|
-
`${prefix}-${key}`,
|
|
190
|
-
(value) => !isValid(value) ? [] : `&[data-${key}="${value}"]`,
|
|
191
|
-
{ values: knownValues }
|
|
192
|
-
);
|
|
193
|
-
matchVariant(
|
|
194
|
-
`${prefix}-not-${key}`,
|
|
195
|
-
(value) => !isValid(value) ? [] : `&:not([data-${key}="${value}"])`,
|
|
196
|
-
{ values: knownValues }
|
|
197
|
-
);
|
|
198
|
-
matchVariant(
|
|
199
|
-
`${prefix}-group-${key}`,
|
|
200
|
-
(value) => !isValid(value) ? [] : `.group[data-${key}="${value}"] &`,
|
|
201
|
-
{ values: knownValues }
|
|
202
|
-
);
|
|
203
|
-
matchVariant(
|
|
204
|
-
`${prefix}-peer-${key}`,
|
|
205
|
-
(value) => !isValid(value) ? [] : `.peer[data-${value}="${value}"] ~ &`,
|
|
206
|
-
{ values: knownValues }
|
|
207
|
-
);
|
|
208
|
-
}
|
|
209
|
-
};
|
|
474
|
+
/**
|
|
475
|
+
* @see https://github.com/calvo-jp/tailwindcss-plugin-zag
|
|
476
|
+
*/
|
|
477
|
+
var src_default = tailwindcss_plugin_js.default.withOptions((config = {}) => {
|
|
478
|
+
const prefix = config.prefix ?? "ui";
|
|
479
|
+
return ({ addVariant, matchVariant }) => {
|
|
480
|
+
for (const { key, values } of STATIC_VARIANT_ENTRIES) {
|
|
481
|
+
addVariant(`${prefix}-${key}`, values.map((value) => value === null ? `&[data-${key}]` : `&[data-${value}]`));
|
|
482
|
+
addVariant(`${prefix}-not-${key}`, values.map((value) => value === null ? `&:not([data-${key}])` : `&:not([data-${value}])`));
|
|
483
|
+
addVariant(`${prefix}-group-${key}`, values.map((value) => value === null ? `.group[data-${key}] &` : `.group[data-${value}] &`));
|
|
484
|
+
addVariant(`${prefix}-peer-${key}`, values.map((value) => value === null ? `.peer[data-${key}] ~ &` : `.peer[data-${value}] ~ &`));
|
|
485
|
+
}
|
|
486
|
+
for (const { key, knownValues, validate } of DYNAMIC_VARIANT_ENTRIES) {
|
|
487
|
+
const isValid = validate ?? (() => true);
|
|
488
|
+
matchVariant(`${prefix}-${key}`, (value) => !isValid(value) ? [] : `&[data-${key}="${value}"]`, { values: knownValues });
|
|
489
|
+
matchVariant(`${prefix}-not-${key}`, (value) => !isValid(value) ? [] : `&:not([data-${key}="${value}"])`, { values: knownValues });
|
|
490
|
+
matchVariant(`${prefix}-group-${key}`, (value) => !isValid(value) ? [] : `.group[data-${key}="${value}"] &`, { values: knownValues });
|
|
491
|
+
matchVariant(`${prefix}-peer-${key}`, (value) => !isValid(value) ? [] : `.peer[data-${value}="${value}"] ~ &`, { values: knownValues });
|
|
492
|
+
}
|
|
493
|
+
};
|
|
210
494
|
});
|
|
211
495
|
|
|
212
|
-
|
|
213
|
-
|
|
496
|
+
//#endregion
|
|
497
|
+
module.exports = src_default;
|
|
214
498
|
//# sourceMappingURL=index.cjs.map
|