@kbach/react 0.6.8 → 0.6.9
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/{chunk-HOWJ3U6D.mjs → chunk-35CBHSAG.mjs} +1 -1
- package/dist/{chunk-ELFAWQI6.mjs → chunk-XJFOY7HN.mjs} +24 -1
- package/dist/index.js +24 -1
- package/dist/index.mjs +1 -1
- package/dist/jsx-dev-runtime.js +24 -1
- package/dist/jsx-dev-runtime.mjs +2 -2
- package/dist/jsx-runtime.js +24 -1
- package/dist/jsx-runtime.mjs +2 -2
- package/dist/vite-plugin.js +46 -10
- package/dist/vite-plugin.mjs +46 -10
- package/package.json +1 -1
|
@@ -2559,8 +2559,31 @@ var BASE_RESET = [
|
|
|
2559
2559
|
"a { color: inherit; text-decoration: none; }",
|
|
2560
2560
|
"ul, ol { margin: 0; padding: 0; list-style: none; }",
|
|
2561
2561
|
"img, video, svg { display: block; max-width: 100%; }",
|
|
2562
|
-
|
|
2562
|
+
// appearance: none is deliberately NOT applied to checkbox/radio/select below —
|
|
2563
|
+
// stripping it hides their native checkmark/arrow with nothing rendered in its
|
|
2564
|
+
// place, leaving an invisible checkbox or an arrow-less <select> that looks like
|
|
2565
|
+
// plain text. Text-like inputs, textarea, and button don't have that problem
|
|
2566
|
+
// (their native chrome is just a skin around content utilities can fully
|
|
2567
|
+
// restyle), so they keep the blank-canvas treatment.
|
|
2568
|
+
"input:not([type='checkbox']):not([type='radio']), textarea { appearance: none; -webkit-appearance: none; background: transparent; padding: 0; margin: 0; font: inherit; color: inherit; line-height: inherit; }",
|
|
2569
|
+
// Native checkbox/radio/range still get typography + spacing normalized, and
|
|
2570
|
+
// accent-color re-themes their native indicator to the current text color
|
|
2571
|
+
// instead of the browser/OS default blue, so they stay on-brand without
|
|
2572
|
+
// needing to be rebuilt from scratch.
|
|
2573
|
+
"input[type='checkbox'], input[type='radio'], input[type='range'] { margin: 0; font: inherit; accent-color: currentColor; }",
|
|
2574
|
+
// select keeps its native chrome (border/background/arrow are all part of the
|
|
2575
|
+
// same OS-drawn widget that appearance: none would blank out) — only typography
|
|
2576
|
+
// and spacing are normalized so it still matches surrounding text.
|
|
2577
|
+
"select { margin: 0; font: inherit; color: inherit; line-height: inherit; }",
|
|
2563
2578
|
"button { appearance: none; -webkit-appearance: none; background: transparent; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; line-height: inherit; text-align: inherit; }",
|
|
2579
|
+
"button, [role='button'] { cursor: pointer; }",
|
|
2580
|
+
":disabled { cursor: default; }",
|
|
2581
|
+
"textarea { resize: vertical; }",
|
|
2582
|
+
// Firefox renders placeholders at ~54% opacity by default; every other browser uses 1 —
|
|
2583
|
+
// normalize to 1 so placeholder color is consistent and fully controlled by the placeholder: modifier.
|
|
2584
|
+
"::placeholder { opacity: 1; }",
|
|
2585
|
+
"input[type='number']::-webkit-inner-spin-button, input[type='number']::-webkit-outer-spin-button { margin: 0; }",
|
|
2586
|
+
"input[type='search']::-webkit-search-decoration, input[type='search']::-webkit-search-cancel-button { -webkit-appearance: none; }",
|
|
2564
2587
|
"fieldset { padding: 0; margin: 0; }",
|
|
2565
2588
|
"table { border-collapse: collapse; border-spacing: 0; }"
|
|
2566
2589
|
].join("\n");
|
package/dist/index.js
CHANGED
|
@@ -2678,8 +2678,31 @@ var BASE_RESET = [
|
|
|
2678
2678
|
"a { color: inherit; text-decoration: none; }",
|
|
2679
2679
|
"ul, ol { margin: 0; padding: 0; list-style: none; }",
|
|
2680
2680
|
"img, video, svg { display: block; max-width: 100%; }",
|
|
2681
|
-
|
|
2681
|
+
// appearance: none is deliberately NOT applied to checkbox/radio/select below —
|
|
2682
|
+
// stripping it hides their native checkmark/arrow with nothing rendered in its
|
|
2683
|
+
// place, leaving an invisible checkbox or an arrow-less <select> that looks like
|
|
2684
|
+
// plain text. Text-like inputs, textarea, and button don't have that problem
|
|
2685
|
+
// (their native chrome is just a skin around content utilities can fully
|
|
2686
|
+
// restyle), so they keep the blank-canvas treatment.
|
|
2687
|
+
"input:not([type='checkbox']):not([type='radio']), textarea { appearance: none; -webkit-appearance: none; background: transparent; padding: 0; margin: 0; font: inherit; color: inherit; line-height: inherit; }",
|
|
2688
|
+
// Native checkbox/radio/range still get typography + spacing normalized, and
|
|
2689
|
+
// accent-color re-themes their native indicator to the current text color
|
|
2690
|
+
// instead of the browser/OS default blue, so they stay on-brand without
|
|
2691
|
+
// needing to be rebuilt from scratch.
|
|
2692
|
+
"input[type='checkbox'], input[type='radio'], input[type='range'] { margin: 0; font: inherit; accent-color: currentColor; }",
|
|
2693
|
+
// select keeps its native chrome (border/background/arrow are all part of the
|
|
2694
|
+
// same OS-drawn widget that appearance: none would blank out) — only typography
|
|
2695
|
+
// and spacing are normalized so it still matches surrounding text.
|
|
2696
|
+
"select { margin: 0; font: inherit; color: inherit; line-height: inherit; }",
|
|
2682
2697
|
"button { appearance: none; -webkit-appearance: none; background: transparent; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; line-height: inherit; text-align: inherit; }",
|
|
2698
|
+
"button, [role='button'] { cursor: pointer; }",
|
|
2699
|
+
":disabled { cursor: default; }",
|
|
2700
|
+
"textarea { resize: vertical; }",
|
|
2701
|
+
// Firefox renders placeholders at ~54% opacity by default; every other browser uses 1 —
|
|
2702
|
+
// normalize to 1 so placeholder color is consistent and fully controlled by the placeholder: modifier.
|
|
2703
|
+
"::placeholder { opacity: 1; }",
|
|
2704
|
+
"input[type='number']::-webkit-inner-spin-button, input[type='number']::-webkit-outer-spin-button { margin: 0; }",
|
|
2705
|
+
"input[type='search']::-webkit-search-decoration, input[type='search']::-webkit-search-cancel-button { -webkit-appearance: none; }",
|
|
2683
2706
|
"fieldset { padding: 0; margin: 0; }",
|
|
2684
2707
|
"table { border-collapse: collapse; border-spacing: 0; }"
|
|
2685
2708
|
].join("\n");
|
package/dist/index.mjs
CHANGED
package/dist/jsx-dev-runtime.js
CHANGED
|
@@ -2637,8 +2637,31 @@ var BASE_RESET = [
|
|
|
2637
2637
|
"a { color: inherit; text-decoration: none; }",
|
|
2638
2638
|
"ul, ol { margin: 0; padding: 0; list-style: none; }",
|
|
2639
2639
|
"img, video, svg { display: block; max-width: 100%; }",
|
|
2640
|
-
|
|
2640
|
+
// appearance: none is deliberately NOT applied to checkbox/radio/select below —
|
|
2641
|
+
// stripping it hides their native checkmark/arrow with nothing rendered in its
|
|
2642
|
+
// place, leaving an invisible checkbox or an arrow-less <select> that looks like
|
|
2643
|
+
// plain text. Text-like inputs, textarea, and button don't have that problem
|
|
2644
|
+
// (their native chrome is just a skin around content utilities can fully
|
|
2645
|
+
// restyle), so they keep the blank-canvas treatment.
|
|
2646
|
+
"input:not([type='checkbox']):not([type='radio']), textarea { appearance: none; -webkit-appearance: none; background: transparent; padding: 0; margin: 0; font: inherit; color: inherit; line-height: inherit; }",
|
|
2647
|
+
// Native checkbox/radio/range still get typography + spacing normalized, and
|
|
2648
|
+
// accent-color re-themes their native indicator to the current text color
|
|
2649
|
+
// instead of the browser/OS default blue, so they stay on-brand without
|
|
2650
|
+
// needing to be rebuilt from scratch.
|
|
2651
|
+
"input[type='checkbox'], input[type='radio'], input[type='range'] { margin: 0; font: inherit; accent-color: currentColor; }",
|
|
2652
|
+
// select keeps its native chrome (border/background/arrow are all part of the
|
|
2653
|
+
// same OS-drawn widget that appearance: none would blank out) — only typography
|
|
2654
|
+
// and spacing are normalized so it still matches surrounding text.
|
|
2655
|
+
"select { margin: 0; font: inherit; color: inherit; line-height: inherit; }",
|
|
2641
2656
|
"button { appearance: none; -webkit-appearance: none; background: transparent; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; line-height: inherit; text-align: inherit; }",
|
|
2657
|
+
"button, [role='button'] { cursor: pointer; }",
|
|
2658
|
+
":disabled { cursor: default; }",
|
|
2659
|
+
"textarea { resize: vertical; }",
|
|
2660
|
+
// Firefox renders placeholders at ~54% opacity by default; every other browser uses 1 —
|
|
2661
|
+
// normalize to 1 so placeholder color is consistent and fully controlled by the placeholder: modifier.
|
|
2662
|
+
"::placeholder { opacity: 1; }",
|
|
2663
|
+
"input[type='number']::-webkit-inner-spin-button, input[type='number']::-webkit-outer-spin-button { margin: 0; }",
|
|
2664
|
+
"input[type='search']::-webkit-search-decoration, input[type='search']::-webkit-search-cancel-button { -webkit-appearance: none; }",
|
|
2642
2665
|
"fieldset { padding: 0; margin: 0; }",
|
|
2643
2666
|
"table { border-collapse: collapse; border-spacing: 0; }"
|
|
2644
2667
|
].join("\n");
|
package/dist/jsx-dev-runtime.mjs
CHANGED
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
Fragment,
|
|
4
4
|
jsx,
|
|
5
5
|
jsxs
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-35CBHSAG.mjs";
|
|
7
|
+
import "./chunk-XJFOY7HN.mjs";
|
|
8
8
|
|
|
9
9
|
// src/jsx-dev-runtime.tsx
|
|
10
10
|
function jsxDEV(type, props, key, isStaticChildren, source, self) {
|
package/dist/jsx-runtime.js
CHANGED
|
@@ -2638,8 +2638,31 @@ var BASE_RESET = [
|
|
|
2638
2638
|
"a { color: inherit; text-decoration: none; }",
|
|
2639
2639
|
"ul, ol { margin: 0; padding: 0; list-style: none; }",
|
|
2640
2640
|
"img, video, svg { display: block; max-width: 100%; }",
|
|
2641
|
-
|
|
2641
|
+
// appearance: none is deliberately NOT applied to checkbox/radio/select below —
|
|
2642
|
+
// stripping it hides their native checkmark/arrow with nothing rendered in its
|
|
2643
|
+
// place, leaving an invisible checkbox or an arrow-less <select> that looks like
|
|
2644
|
+
// plain text. Text-like inputs, textarea, and button don't have that problem
|
|
2645
|
+
// (their native chrome is just a skin around content utilities can fully
|
|
2646
|
+
// restyle), so they keep the blank-canvas treatment.
|
|
2647
|
+
"input:not([type='checkbox']):not([type='radio']), textarea { appearance: none; -webkit-appearance: none; background: transparent; padding: 0; margin: 0; font: inherit; color: inherit; line-height: inherit; }",
|
|
2648
|
+
// Native checkbox/radio/range still get typography + spacing normalized, and
|
|
2649
|
+
// accent-color re-themes their native indicator to the current text color
|
|
2650
|
+
// instead of the browser/OS default blue, so they stay on-brand without
|
|
2651
|
+
// needing to be rebuilt from scratch.
|
|
2652
|
+
"input[type='checkbox'], input[type='radio'], input[type='range'] { margin: 0; font: inherit; accent-color: currentColor; }",
|
|
2653
|
+
// select keeps its native chrome (border/background/arrow are all part of the
|
|
2654
|
+
// same OS-drawn widget that appearance: none would blank out) — only typography
|
|
2655
|
+
// and spacing are normalized so it still matches surrounding text.
|
|
2656
|
+
"select { margin: 0; font: inherit; color: inherit; line-height: inherit; }",
|
|
2642
2657
|
"button { appearance: none; -webkit-appearance: none; background: transparent; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; line-height: inherit; text-align: inherit; }",
|
|
2658
|
+
"button, [role='button'] { cursor: pointer; }",
|
|
2659
|
+
":disabled { cursor: default; }",
|
|
2660
|
+
"textarea { resize: vertical; }",
|
|
2661
|
+
// Firefox renders placeholders at ~54% opacity by default; every other browser uses 1 —
|
|
2662
|
+
// normalize to 1 so placeholder color is consistent and fully controlled by the placeholder: modifier.
|
|
2663
|
+
"::placeholder { opacity: 1; }",
|
|
2664
|
+
"input[type='number']::-webkit-inner-spin-button, input[type='number']::-webkit-outer-spin-button { margin: 0; }",
|
|
2665
|
+
"input[type='search']::-webkit-search-decoration, input[type='search']::-webkit-search-cancel-button { -webkit-appearance: none; }",
|
|
2643
2666
|
"fieldset { padding: 0; margin: 0; }",
|
|
2644
2667
|
"table { border-collapse: collapse; border-spacing: 0; }"
|
|
2645
2668
|
].join("\n");
|
package/dist/jsx-runtime.mjs
CHANGED
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
_invalidateDefaultFontCache,
|
|
5
5
|
jsx,
|
|
6
6
|
jsxs
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-35CBHSAG.mjs";
|
|
8
8
|
import {
|
|
9
9
|
registerWebElement
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-XJFOY7HN.mjs";
|
|
11
11
|
export {
|
|
12
12
|
Fragment,
|
|
13
13
|
_invalidateDefaultFontCache,
|
package/dist/vite-plugin.js
CHANGED
|
@@ -70,8 +70,31 @@ var BASE_RESET = [
|
|
|
70
70
|
"a { color: inherit; text-decoration: none; }",
|
|
71
71
|
"ul, ol { margin: 0; padding: 0; list-style: none; }",
|
|
72
72
|
"img, video, svg { display: block; max-width: 100%; }",
|
|
73
|
-
|
|
73
|
+
// appearance: none is deliberately NOT applied to checkbox/radio/select below —
|
|
74
|
+
// stripping it hides their native checkmark/arrow with nothing rendered in its
|
|
75
|
+
// place, leaving an invisible checkbox or an arrow-less <select> that looks like
|
|
76
|
+
// plain text. Text-like inputs, textarea, and button don't have that problem
|
|
77
|
+
// (their native chrome is just a skin around content utilities can fully
|
|
78
|
+
// restyle), so they keep the blank-canvas treatment.
|
|
79
|
+
"input:not([type='checkbox']):not([type='radio']), textarea { appearance: none; -webkit-appearance: none; background: transparent; padding: 0; margin: 0; font: inherit; color: inherit; line-height: inherit; }",
|
|
80
|
+
// Native checkbox/radio/range still get typography + spacing normalized, and
|
|
81
|
+
// accent-color re-themes their native indicator to the current text color
|
|
82
|
+
// instead of the browser/OS default blue, so they stay on-brand without
|
|
83
|
+
// needing to be rebuilt from scratch.
|
|
84
|
+
"input[type='checkbox'], input[type='radio'], input[type='range'] { margin: 0; font: inherit; accent-color: currentColor; }",
|
|
85
|
+
// select keeps its native chrome (border/background/arrow are all part of the
|
|
86
|
+
// same OS-drawn widget that appearance: none would blank out) — only typography
|
|
87
|
+
// and spacing are normalized so it still matches surrounding text.
|
|
88
|
+
"select { margin: 0; font: inherit; color: inherit; line-height: inherit; }",
|
|
74
89
|
"button { appearance: none; -webkit-appearance: none; background: transparent; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; line-height: inherit; text-align: inherit; }",
|
|
90
|
+
"button, [role='button'] { cursor: pointer; }",
|
|
91
|
+
":disabled { cursor: default; }",
|
|
92
|
+
"textarea { resize: vertical; }",
|
|
93
|
+
// Firefox renders placeholders at ~54% opacity by default; every other browser uses 1 —
|
|
94
|
+
// normalize to 1 so placeholder color is consistent and fully controlled by the placeholder: modifier.
|
|
95
|
+
"::placeholder { opacity: 1; }",
|
|
96
|
+
"input[type='number']::-webkit-inner-spin-button, input[type='number']::-webkit-outer-spin-button { margin: 0; }",
|
|
97
|
+
"input[type='search']::-webkit-search-decoration, input[type='search']::-webkit-search-cancel-button { -webkit-appearance: none; }",
|
|
75
98
|
"fieldset { padding: 0; margin: 0; }",
|
|
76
99
|
"table { border-collapse: collapse; border-spacing: 0; }"
|
|
77
100
|
].join("\n");
|
|
@@ -3202,6 +3225,23 @@ function toNumericScreens(screens) {
|
|
|
3202
3225
|
}
|
|
3203
3226
|
return out;
|
|
3204
3227
|
}
|
|
3228
|
+
function pushTemplateLiteralBody(body, into) {
|
|
3229
|
+
const interpolationRe = /\$\{(?:[^{}]|\{[^{}]*\})*\}/g;
|
|
3230
|
+
let im;
|
|
3231
|
+
while ((im = interpolationRe.exec(body)) !== null) {
|
|
3232
|
+
pushClassLikeStrings(im[0], into);
|
|
3233
|
+
}
|
|
3234
|
+
pushTokens(body.replace(/\$\{(?:[^{}]|\{[^{}]*\})*\}/g, " "), into);
|
|
3235
|
+
}
|
|
3236
|
+
function pushClassLikeStrings(text, into) {
|
|
3237
|
+
const quotedStringRe = /(["'`])((?:(?!\1).)*)\1/g;
|
|
3238
|
+
let qm;
|
|
3239
|
+
while ((qm = quotedStringRe.exec(text)) !== null) {
|
|
3240
|
+
const [, quote, content] = qm;
|
|
3241
|
+
if (quote === "`") pushTemplateLiteralBody(content, into);
|
|
3242
|
+
else pushTokens(content, into);
|
|
3243
|
+
}
|
|
3244
|
+
}
|
|
3205
3245
|
function extractClassStrings(code) {
|
|
3206
3246
|
const found = /* @__PURE__ */ new Set();
|
|
3207
3247
|
const simpleRe = /(?:className|kb)=["']([^"']+)["']/g;
|
|
@@ -3222,8 +3262,7 @@ function extractClassStrings(code) {
|
|
|
3222
3262
|
i++;
|
|
3223
3263
|
}
|
|
3224
3264
|
jsxExprRe.lastIndex = i + 1;
|
|
3225
|
-
|
|
3226
|
-
for (const s of innerStrings) pushTokens(s.slice(1, -1), found);
|
|
3265
|
+
pushClassLikeStrings(block, found);
|
|
3227
3266
|
}
|
|
3228
3267
|
const clsxCallRe = /(?:clsx|cn|classnames|cx)\(/g;
|
|
3229
3268
|
while ((m = clsxCallRe.exec(code)) !== null) {
|
|
@@ -3240,19 +3279,16 @@ function extractClassStrings(code) {
|
|
|
3240
3279
|
i++;
|
|
3241
3280
|
}
|
|
3242
3281
|
clsxCallRe.lastIndex = i + 1;
|
|
3243
|
-
|
|
3244
|
-
for (const s of innerStrings) pushTokens(s.slice(1, -1), found);
|
|
3282
|
+
pushClassLikeStrings(block, found);
|
|
3245
3283
|
}
|
|
3246
3284
|
const templateRe = /`([^`]{1,2000})`/g;
|
|
3247
|
-
while ((m = templateRe.exec(code)) !== null)
|
|
3248
|
-
const staticParts = m[1].replace(/\$\{(?:[^{}]|\{[^{}]*\})*\}/g, " ");
|
|
3249
|
-
pushTokens(staticParts, found);
|
|
3250
|
-
}
|
|
3285
|
+
while ((m = templateRe.exec(code)) !== null) pushTemplateLiteralBody(m[1], found);
|
|
3251
3286
|
return [...found];
|
|
3252
3287
|
}
|
|
3288
|
+
var NOT_A_CLASS_NAME_RE = /[${}]|-$|^[?:&|!"'=<>]+$/;
|
|
3253
3289
|
function pushTokens(str, into) {
|
|
3254
3290
|
for (const tok of splitClassTokens(str)) {
|
|
3255
|
-
if (tok) into.add(tok);
|
|
3291
|
+
if (tok && !NOT_A_CLASS_NAME_RE.test(tok)) into.add(tok);
|
|
3256
3292
|
}
|
|
3257
3293
|
}
|
|
3258
3294
|
function scanDir(dir, onFile) {
|
package/dist/vite-plugin.mjs
CHANGED
|
@@ -36,8 +36,31 @@ var BASE_RESET = [
|
|
|
36
36
|
"a { color: inherit; text-decoration: none; }",
|
|
37
37
|
"ul, ol { margin: 0; padding: 0; list-style: none; }",
|
|
38
38
|
"img, video, svg { display: block; max-width: 100%; }",
|
|
39
|
-
|
|
39
|
+
// appearance: none is deliberately NOT applied to checkbox/radio/select below —
|
|
40
|
+
// stripping it hides their native checkmark/arrow with nothing rendered in its
|
|
41
|
+
// place, leaving an invisible checkbox or an arrow-less <select> that looks like
|
|
42
|
+
// plain text. Text-like inputs, textarea, and button don't have that problem
|
|
43
|
+
// (their native chrome is just a skin around content utilities can fully
|
|
44
|
+
// restyle), so they keep the blank-canvas treatment.
|
|
45
|
+
"input:not([type='checkbox']):not([type='radio']), textarea { appearance: none; -webkit-appearance: none; background: transparent; padding: 0; margin: 0; font: inherit; color: inherit; line-height: inherit; }",
|
|
46
|
+
// Native checkbox/radio/range still get typography + spacing normalized, and
|
|
47
|
+
// accent-color re-themes their native indicator to the current text color
|
|
48
|
+
// instead of the browser/OS default blue, so they stay on-brand without
|
|
49
|
+
// needing to be rebuilt from scratch.
|
|
50
|
+
"input[type='checkbox'], input[type='radio'], input[type='range'] { margin: 0; font: inherit; accent-color: currentColor; }",
|
|
51
|
+
// select keeps its native chrome (border/background/arrow are all part of the
|
|
52
|
+
// same OS-drawn widget that appearance: none would blank out) — only typography
|
|
53
|
+
// and spacing are normalized so it still matches surrounding text.
|
|
54
|
+
"select { margin: 0; font: inherit; color: inherit; line-height: inherit; }",
|
|
40
55
|
"button { appearance: none; -webkit-appearance: none; background: transparent; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; line-height: inherit; text-align: inherit; }",
|
|
56
|
+
"button, [role='button'] { cursor: pointer; }",
|
|
57
|
+
":disabled { cursor: default; }",
|
|
58
|
+
"textarea { resize: vertical; }",
|
|
59
|
+
// Firefox renders placeholders at ~54% opacity by default; every other browser uses 1 —
|
|
60
|
+
// normalize to 1 so placeholder color is consistent and fully controlled by the placeholder: modifier.
|
|
61
|
+
"::placeholder { opacity: 1; }",
|
|
62
|
+
"input[type='number']::-webkit-inner-spin-button, input[type='number']::-webkit-outer-spin-button { margin: 0; }",
|
|
63
|
+
"input[type='search']::-webkit-search-decoration, input[type='search']::-webkit-search-cancel-button { -webkit-appearance: none; }",
|
|
41
64
|
"fieldset { padding: 0; margin: 0; }",
|
|
42
65
|
"table { border-collapse: collapse; border-spacing: 0; }"
|
|
43
66
|
].join("\n");
|
|
@@ -3168,6 +3191,23 @@ function toNumericScreens(screens) {
|
|
|
3168
3191
|
}
|
|
3169
3192
|
return out;
|
|
3170
3193
|
}
|
|
3194
|
+
function pushTemplateLiteralBody(body, into) {
|
|
3195
|
+
const interpolationRe = /\$\{(?:[^{}]|\{[^{}]*\})*\}/g;
|
|
3196
|
+
let im;
|
|
3197
|
+
while ((im = interpolationRe.exec(body)) !== null) {
|
|
3198
|
+
pushClassLikeStrings(im[0], into);
|
|
3199
|
+
}
|
|
3200
|
+
pushTokens(body.replace(/\$\{(?:[^{}]|\{[^{}]*\})*\}/g, " "), into);
|
|
3201
|
+
}
|
|
3202
|
+
function pushClassLikeStrings(text, into) {
|
|
3203
|
+
const quotedStringRe = /(["'`])((?:(?!\1).)*)\1/g;
|
|
3204
|
+
let qm;
|
|
3205
|
+
while ((qm = quotedStringRe.exec(text)) !== null) {
|
|
3206
|
+
const [, quote, content] = qm;
|
|
3207
|
+
if (quote === "`") pushTemplateLiteralBody(content, into);
|
|
3208
|
+
else pushTokens(content, into);
|
|
3209
|
+
}
|
|
3210
|
+
}
|
|
3171
3211
|
function extractClassStrings(code) {
|
|
3172
3212
|
const found = /* @__PURE__ */ new Set();
|
|
3173
3213
|
const simpleRe = /(?:className|kb)=["']([^"']+)["']/g;
|
|
@@ -3188,8 +3228,7 @@ function extractClassStrings(code) {
|
|
|
3188
3228
|
i++;
|
|
3189
3229
|
}
|
|
3190
3230
|
jsxExprRe.lastIndex = i + 1;
|
|
3191
|
-
|
|
3192
|
-
for (const s of innerStrings) pushTokens(s.slice(1, -1), found);
|
|
3231
|
+
pushClassLikeStrings(block, found);
|
|
3193
3232
|
}
|
|
3194
3233
|
const clsxCallRe = /(?:clsx|cn|classnames|cx)\(/g;
|
|
3195
3234
|
while ((m = clsxCallRe.exec(code)) !== null) {
|
|
@@ -3206,19 +3245,16 @@ function extractClassStrings(code) {
|
|
|
3206
3245
|
i++;
|
|
3207
3246
|
}
|
|
3208
3247
|
clsxCallRe.lastIndex = i + 1;
|
|
3209
|
-
|
|
3210
|
-
for (const s of innerStrings) pushTokens(s.slice(1, -1), found);
|
|
3248
|
+
pushClassLikeStrings(block, found);
|
|
3211
3249
|
}
|
|
3212
3250
|
const templateRe = /`([^`]{1,2000})`/g;
|
|
3213
|
-
while ((m = templateRe.exec(code)) !== null)
|
|
3214
|
-
const staticParts = m[1].replace(/\$\{(?:[^{}]|\{[^{}]*\})*\}/g, " ");
|
|
3215
|
-
pushTokens(staticParts, found);
|
|
3216
|
-
}
|
|
3251
|
+
while ((m = templateRe.exec(code)) !== null) pushTemplateLiteralBody(m[1], found);
|
|
3217
3252
|
return [...found];
|
|
3218
3253
|
}
|
|
3254
|
+
var NOT_A_CLASS_NAME_RE = /[${}]|-$|^[?:&|!"'=<>]+$/;
|
|
3219
3255
|
function pushTokens(str, into) {
|
|
3220
3256
|
for (const tok of splitClassTokens(str)) {
|
|
3221
|
-
if (tok) into.add(tok);
|
|
3257
|
+
if (tok && !NOT_A_CLASS_NAME_RE.test(tok)) into.add(tok);
|
|
3222
3258
|
}
|
|
3223
3259
|
}
|
|
3224
3260
|
function scanDir(dir, onFile) {
|