jasmincss 1.0.7 → 1.0.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/JASMINCSS-GUIDE.md +32 -2
- package/bin/jasmin.js +0 -0
- package/dist/index.js +99 -11
- package/dist/index.mjs +99 -11
- package/dist/jasmin.css +557 -7
- package/dist/jasmin.min.css +1 -1
- package/dist/plugins/jasmin-loader.js +99 -11
- package/dist/plugins/jasmin-loader.mjs +99 -11
- package/dist/plugins/nextjs.js +102 -12
- package/dist/plugins/nextjs.mjs +102 -11
- package/dist/plugins/vite.js +102 -12
- package/dist/plugins/vite.mjs +102 -11
- package/package.json +1 -1
- package/src/cli/init.js +180 -11
- package/src/cli/run.js +18 -0
- package/src/components/buttons.js +1 -1
- package/src/components/forms.js +6 -6
- package/src/config/defaults.js +4 -1
- package/src/core/base.js +8 -0
- package/src/core/compiler.js +96 -5
- package/src/core/utilities/icons.js +0 -1
package/JASMINCSS-GUIDE.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **Complete reference of all available utility classes and components**
|
|
4
4
|
>
|
|
5
|
-
> Generated automatically from JasminCSS v1.0.
|
|
5
|
+
> Generated automatically from JasminCSS v1.0.9
|
|
6
6
|
|
|
7
7
|
## Table of Contents
|
|
8
8
|
|
|
@@ -1017,6 +1017,8 @@
|
|
|
1017
1017
|
| `rounded-xl` | `border-radius: 1rem;` |
|
|
1018
1018
|
| `rounded-2xl` | `border-radius: 1.5rem;` |
|
|
1019
1019
|
| `rounded-full` | `border-radius: 9999px;` |
|
|
1020
|
+
| `rounded-buttons` | `border-radius: 0.5rem;` |
|
|
1021
|
+
| `rounded-inputs` | `border-radius: 0.5rem;` |
|
|
1020
1022
|
| `rounded-t-none` | `border-top-left-radius: 0; border-top-right-radius: 0;` |
|
|
1021
1023
|
| `rounded-r-none` | `border-top-right-radius: 0; border-bottom-right-radius: 0;` |
|
|
1022
1024
|
| `rounded-b-none` | `border-bottom-left-radius: 0; border-bottom-right-radius: 0;` |
|
|
@@ -1129,6 +1131,34 @@
|
|
|
1129
1131
|
| `rounded-se-full` | `border-start-end-radius: 9999px;` |
|
|
1130
1132
|
| `rounded-ee-full` | `border-end-end-radius: 9999px;` |
|
|
1131
1133
|
| `rounded-es-full` | `border-end-start-radius: 9999px;` |
|
|
1134
|
+
| `rounded-t-buttons` | `border-top-left-radius: 0.5rem; border-top-right-radius: 0.5rem;` |
|
|
1135
|
+
| `rounded-r-buttons` | `border-top-right-radius: 0.5rem; border-bottom-right-radius: 0.5rem;` |
|
|
1136
|
+
| `rounded-b-buttons` | `border-bottom-left-radius: 0.5rem; border-bottom-right-radius: 0.5rem;` |
|
|
1137
|
+
| `rounded-l-buttons` | `border-top-left-radius: 0.5rem; border-bottom-left-radius: 0.5rem;` |
|
|
1138
|
+
| `rounded-tl-buttons` | `border-top-left-radius: 0.5rem;` |
|
|
1139
|
+
| `rounded-tr-buttons` | `border-top-right-radius: 0.5rem;` |
|
|
1140
|
+
| `rounded-br-buttons` | `border-bottom-right-radius: 0.5rem;` |
|
|
1141
|
+
| `rounded-bl-buttons` | `border-bottom-left-radius: 0.5rem;` |
|
|
1142
|
+
| `rounded-s-buttons` | `border-start-start-radius: 0.5rem; border-end-start-radius: 0.5rem;` |
|
|
1143
|
+
| `rounded-e-buttons` | `border-start-end-radius: 0.5rem; border-end-end-radius: 0.5rem;` |
|
|
1144
|
+
| `rounded-ss-buttons` | `border-start-start-radius: 0.5rem;` |
|
|
1145
|
+
| `rounded-se-buttons` | `border-start-end-radius: 0.5rem;` |
|
|
1146
|
+
| `rounded-ee-buttons` | `border-end-end-radius: 0.5rem;` |
|
|
1147
|
+
| `rounded-es-buttons` | `border-end-start-radius: 0.5rem;` |
|
|
1148
|
+
| `rounded-t-inputs` | `border-top-left-radius: 0.5rem; border-top-right-radius: 0.5rem;` |
|
|
1149
|
+
| `rounded-r-inputs` | `border-top-right-radius: 0.5rem; border-bottom-right-radius: 0.5rem;` |
|
|
1150
|
+
| `rounded-b-inputs` | `border-bottom-left-radius: 0.5rem; border-bottom-right-radius: 0.5rem;` |
|
|
1151
|
+
| `rounded-l-inputs` | `border-top-left-radius: 0.5rem; border-bottom-left-radius: 0.5rem;` |
|
|
1152
|
+
| `rounded-tl-inputs` | `border-top-left-radius: 0.5rem;` |
|
|
1153
|
+
| `rounded-tr-inputs` | `border-top-right-radius: 0.5rem;` |
|
|
1154
|
+
| `rounded-br-inputs` | `border-bottom-right-radius: 0.5rem;` |
|
|
1155
|
+
| `rounded-bl-inputs` | `border-bottom-left-radius: 0.5rem;` |
|
|
1156
|
+
| `rounded-s-inputs` | `border-start-start-radius: 0.5rem; border-end-start-radius: 0.5rem;` |
|
|
1157
|
+
| `rounded-e-inputs` | `border-start-end-radius: 0.5rem; border-end-end-radius: 0.5rem;` |
|
|
1158
|
+
| `rounded-ss-inputs` | `border-start-start-radius: 0.5rem;` |
|
|
1159
|
+
| `rounded-se-inputs` | `border-start-end-radius: 0.5rem;` |
|
|
1160
|
+
| `rounded-ee-inputs` | `border-end-end-radius: 0.5rem;` |
|
|
1161
|
+
| `rounded-es-inputs` | `border-end-start-radius: 0.5rem;` |
|
|
1132
1162
|
| `border-0` | `border-width: 0px;` |
|
|
1133
1163
|
| `border` | `border-width: 1px;` |
|
|
1134
1164
|
| `border-2` | `border-width: 2px;` |
|
|
@@ -2393,6 +2423,6 @@ export default withJasminCSS({});
|
|
|
2393
2423
|
|
|
2394
2424
|
---
|
|
2395
2425
|
|
|
2396
|
-
**Total utility classes: 5,
|
|
2426
|
+
**Total utility classes: 5,956**
|
|
2397
2427
|
|
|
2398
2428
|
Generated on 2026-01-16
|
package/bin/jasmin.js
CHANGED
|
File without changes
|
package/dist/index.js
CHANGED
|
@@ -46,6 +46,7 @@ var import_fs2 = __toESM(require("fs"), 1);
|
|
|
46
46
|
var import_fast_glob = __toESM(require("fast-glob"), 1);
|
|
47
47
|
var import_postcss = __toESM(require("postcss"), 1);
|
|
48
48
|
var import_cssnano = __toESM(require("cssnano"), 1);
|
|
49
|
+
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
49
50
|
|
|
50
51
|
// src/config/loader.js
|
|
51
52
|
var import_fs = __toESM(require("fs"), 1);
|
|
@@ -94,7 +95,12 @@ var defaultConfig = {
|
|
|
94
95
|
lg: "0.75rem",
|
|
95
96
|
xl: "1rem",
|
|
96
97
|
"2xl": "1.5rem",
|
|
97
|
-
full: "9999px"
|
|
98
|
+
full: "9999px",
|
|
99
|
+
// Component-specific border radius
|
|
100
|
+
buttons: "0.5rem",
|
|
101
|
+
// Separate radius for buttons
|
|
102
|
+
inputs: "0.5rem"
|
|
103
|
+
// Separate radius for form inputs, cards, etc.
|
|
98
104
|
},
|
|
99
105
|
shadows: {
|
|
100
106
|
sm: "0 1px 2px 0 rgb(0 0 0 / 0.05)",
|
|
@@ -3674,7 +3680,7 @@ function generateButtonStyles(config) {
|
|
|
3674
3680
|
font-size: 0.875rem;
|
|
3675
3681
|
font-weight: 500;
|
|
3676
3682
|
line-height: 1.25rem;
|
|
3677
|
-
border-radius: var(--j-radius-default, 0.5rem);
|
|
3683
|
+
border-radius: var(--j-radius-buttons, var(--j-radius-default, 0.5rem));
|
|
3678
3684
|
border: 1px solid transparent;
|
|
3679
3685
|
cursor: pointer;
|
|
3680
3686
|
transition: all 150ms ease-in-out;
|
|
@@ -4432,7 +4438,7 @@ function generateFormStyles(config) {
|
|
|
4432
4438
|
color: var(--j-text);
|
|
4433
4439
|
background-color: var(--j-bg);
|
|
4434
4440
|
border: 1px solid var(--j-border);
|
|
4435
|
-
border-radius: var(--j-radius-default, 0.5rem);
|
|
4441
|
+
border-radius: var(--j-radius-inputs, var(--j-radius-default, 0.5rem));
|
|
4436
4442
|
transition: border-color 150ms ease-in-out, box-shadow 150ms ease-in-out;
|
|
4437
4443
|
appearance: none;
|
|
4438
4444
|
}
|
|
@@ -4816,7 +4822,7 @@ input[type="range"].form-control::-webkit-slider-thumb:hover {
|
|
|
4816
4822
|
|
|
4817
4823
|
/* Square Switch */
|
|
4818
4824
|
.form-switch-square .form-switch-input {
|
|
4819
|
-
border-radius: var(--j-radius-default, 0.375rem);
|
|
4825
|
+
border-radius: var(--j-radius-inputs, var(--j-radius-default, 0.375rem));
|
|
4820
4826
|
}
|
|
4821
4827
|
|
|
4822
4828
|
.form-switch-square .form-switch-input::before {
|
|
@@ -4862,12 +4868,12 @@ input[type="range"].form-control::-webkit-slider-thumb:hover {
|
|
|
4862
4868
|
|
|
4863
4869
|
.input-group-text:first-child {
|
|
4864
4870
|
border-right: none;
|
|
4865
|
-
border-radius: var(--j-radius-
|
|
4871
|
+
border-radius: var(--j-radius-inputs, 0.5rem) 0 0 var(--j-radius-inputs, 0.5rem);
|
|
4866
4872
|
}
|
|
4867
4873
|
|
|
4868
4874
|
.input-group-text:last-child {
|
|
4869
4875
|
border-left: none;
|
|
4870
|
-
border-radius: 0 var(--j-radius-
|
|
4876
|
+
border-radius: 0 var(--j-radius-inputs, 0.5rem) var(--j-radius-inputs, 0.5rem) 0;
|
|
4871
4877
|
}
|
|
4872
4878
|
|
|
4873
4879
|
.input-group > .btn:first-child {
|
|
@@ -4904,7 +4910,7 @@ input[type="range"].form-control::-webkit-slider-thumb:hover {
|
|
|
4904
4910
|
|
|
4905
4911
|
.form-floating > .form-control:focus ~ .form-label,
|
|
4906
4912
|
.form-floating > .form-control:not(:placeholder-shown) ~ .form-label {
|
|
4907
|
-
transform: scale(0.85) translateY(-0.5rem);
|
|
4913
|
+
transform: scale(0.85) translateY(-0.5rem));
|
|
4908
4914
|
color: var(--j-primary);
|
|
4909
4915
|
}
|
|
4910
4916
|
|
|
@@ -4918,7 +4924,7 @@ input[type="range"].form-control::-webkit-slider-thumb:hover {
|
|
|
4918
4924
|
/* Fieldset */
|
|
4919
4925
|
fieldset {
|
|
4920
4926
|
border: 1px solid var(--j-border);
|
|
4921
|
-
border-radius: var(--j-radius-default, 0.5rem);
|
|
4927
|
+
border-radius: var(--j-radius-inputs, var(--j-radius-default, 0.5rem));
|
|
4922
4928
|
padding: 1.5rem;
|
|
4923
4929
|
margin-bottom: 1.5rem;
|
|
4924
4930
|
}
|
|
@@ -14557,6 +14563,14 @@ a {
|
|
|
14557
14563
|
|
|
14558
14564
|
button, [role="button"] {
|
|
14559
14565
|
cursor: pointer;
|
|
14566
|
+
appearance: none;
|
|
14567
|
+
-webkit-appearance: none;
|
|
14568
|
+
background: transparent;
|
|
14569
|
+
border: none;
|
|
14570
|
+
}
|
|
14571
|
+
|
|
14572
|
+
button:focus {
|
|
14573
|
+
outline: none;
|
|
14560
14574
|
}
|
|
14561
14575
|
|
|
14562
14576
|
:disabled {
|
|
@@ -14739,9 +14753,81 @@ code, kbd, samp, pre {
|
|
|
14739
14753
|
}
|
|
14740
14754
|
|
|
14741
14755
|
// src/core/compiler.js
|
|
14756
|
+
var COMPONENT_CLASS_PREFIXES = {
|
|
14757
|
+
"accordion": "accordion",
|
|
14758
|
+
"alert": "alerts",
|
|
14759
|
+
"avatar": "avatars",
|
|
14760
|
+
"badge": "badges",
|
|
14761
|
+
"btn": "buttons",
|
|
14762
|
+
"card": "cards",
|
|
14763
|
+
"carousel": "carousel",
|
|
14764
|
+
"chip": "chips",
|
|
14765
|
+
"command-palette": "command-palette",
|
|
14766
|
+
"datepicker": "datepicker",
|
|
14767
|
+
"calendar": "datepicker",
|
|
14768
|
+
"dropdown": "dropdown",
|
|
14769
|
+
"form-": "forms",
|
|
14770
|
+
"input-group": "forms",
|
|
14771
|
+
"modal": "modals",
|
|
14772
|
+
"navbar": "navigation",
|
|
14773
|
+
"nav-": "navigation",
|
|
14774
|
+
"breadcrumb": "navigation",
|
|
14775
|
+
"pagination": "navigation",
|
|
14776
|
+
"tabs": "navigation",
|
|
14777
|
+
"tab": "navigation",
|
|
14778
|
+
"offcanvas": "offcanvas",
|
|
14779
|
+
"popover": "popover",
|
|
14780
|
+
"progress": "progress",
|
|
14781
|
+
"rating": "rating",
|
|
14782
|
+
"skeleton": "skeleton",
|
|
14783
|
+
"spinner": "spinner",
|
|
14784
|
+
"stepper": "stepper",
|
|
14785
|
+
"table": "tables",
|
|
14786
|
+
"timeline": "timeline",
|
|
14787
|
+
"timepicker": "timepicker",
|
|
14788
|
+
"tooltip": "tooltips",
|
|
14789
|
+
"upload": "upload"
|
|
14790
|
+
};
|
|
14791
|
+
function detectUsedComponents(usedClasses) {
|
|
14792
|
+
const detectedComponents = /* @__PURE__ */ new Set();
|
|
14793
|
+
if (!usedClasses)
|
|
14794
|
+
return detectedComponents;
|
|
14795
|
+
for (const className of usedClasses) {
|
|
14796
|
+
for (const [prefix, component] of Object.entries(COMPONENT_CLASS_PREFIXES)) {
|
|
14797
|
+
if (className.startsWith(prefix) || className === prefix.replace(/-$/, "")) {
|
|
14798
|
+
detectedComponents.add(component);
|
|
14799
|
+
}
|
|
14800
|
+
}
|
|
14801
|
+
}
|
|
14802
|
+
return detectedComponents;
|
|
14803
|
+
}
|
|
14804
|
+
function getMissingComponents(configComponents, detectedComponents) {
|
|
14805
|
+
const missing = [];
|
|
14806
|
+
for (const comp of detectedComponents) {
|
|
14807
|
+
if (!configComponents || !configComponents.includes(comp)) {
|
|
14808
|
+
missing.push(comp);
|
|
14809
|
+
}
|
|
14810
|
+
}
|
|
14811
|
+
return missing;
|
|
14812
|
+
}
|
|
14742
14813
|
async function compileCSS(config, options = {}) {
|
|
14743
|
-
const { usedClasses, minify = false, includeAll = false } = options;
|
|
14814
|
+
const { usedClasses, minify = false, includeAll = false, autoDetectComponents = true } = options;
|
|
14744
14815
|
const resolvedConfig = resolveConfig(config);
|
|
14816
|
+
let selectedComponents = config.components || [];
|
|
14817
|
+
let detectedComponents = /* @__PURE__ */ new Set();
|
|
14818
|
+
let missingComponents = [];
|
|
14819
|
+
if (usedClasses && autoDetectComponents) {
|
|
14820
|
+
detectedComponents = detectUsedComponents(usedClasses);
|
|
14821
|
+
missingComponents = getMissingComponents(selectedComponents, detectedComponents);
|
|
14822
|
+
if (missingComponents.length > 0) {
|
|
14823
|
+
console.log(import_picocolors.default.yellow(`
|
|
14824
|
+
\u26A0\uFE0F Auto-detected ${missingComponents.length} additional component(s):`));
|
|
14825
|
+
console.log(import_picocolors.default.dim(` ${missingComponents.join(", ")}`));
|
|
14826
|
+
console.log(import_picocolors.default.dim(` Adding them to this build automatically.
|
|
14827
|
+
`));
|
|
14828
|
+
selectedComponents = [.../* @__PURE__ */ new Set([...selectedComponents, ...missingComponents])];
|
|
14829
|
+
}
|
|
14830
|
+
}
|
|
14745
14831
|
const parts = [];
|
|
14746
14832
|
parts.push(generateBase(resolvedConfig));
|
|
14747
14833
|
const utilities = generateUtilities(resolvedConfig, {
|
|
@@ -14750,7 +14836,7 @@ async function compileCSS(config, options = {}) {
|
|
|
14750
14836
|
});
|
|
14751
14837
|
parts.push(utilities.css);
|
|
14752
14838
|
const components2 = generateComponents(resolvedConfig, {
|
|
14753
|
-
selected:
|
|
14839
|
+
selected: selectedComponents,
|
|
14754
14840
|
usedClasses,
|
|
14755
14841
|
includeAll
|
|
14756
14842
|
});
|
|
@@ -14773,7 +14859,9 @@ async function compileCSS(config, options = {}) {
|
|
|
14773
14859
|
minified,
|
|
14774
14860
|
stats: {
|
|
14775
14861
|
utilities: utilities.count,
|
|
14776
|
-
components: components2.count
|
|
14862
|
+
components: components2.count,
|
|
14863
|
+
autoDetected: missingComponents,
|
|
14864
|
+
totalComponents: selectedComponents.length
|
|
14777
14865
|
}
|
|
14778
14866
|
};
|
|
14779
14867
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import fs2 from "fs";
|
|
|
3
3
|
import fg from "fast-glob";
|
|
4
4
|
import postcss from "postcss";
|
|
5
5
|
import cssnano from "cssnano";
|
|
6
|
+
import pc from "picocolors";
|
|
6
7
|
|
|
7
8
|
// src/config/loader.js
|
|
8
9
|
import fs from "fs";
|
|
@@ -51,7 +52,12 @@ var defaultConfig = {
|
|
|
51
52
|
lg: "0.75rem",
|
|
52
53
|
xl: "1rem",
|
|
53
54
|
"2xl": "1.5rem",
|
|
54
|
-
full: "9999px"
|
|
55
|
+
full: "9999px",
|
|
56
|
+
// Component-specific border radius
|
|
57
|
+
buttons: "0.5rem",
|
|
58
|
+
// Separate radius for buttons
|
|
59
|
+
inputs: "0.5rem"
|
|
60
|
+
// Separate radius for form inputs, cards, etc.
|
|
55
61
|
},
|
|
56
62
|
shadows: {
|
|
57
63
|
sm: "0 1px 2px 0 rgb(0 0 0 / 0.05)",
|
|
@@ -3631,7 +3637,7 @@ function generateButtonStyles(config) {
|
|
|
3631
3637
|
font-size: 0.875rem;
|
|
3632
3638
|
font-weight: 500;
|
|
3633
3639
|
line-height: 1.25rem;
|
|
3634
|
-
border-radius: var(--j-radius-default, 0.5rem);
|
|
3640
|
+
border-radius: var(--j-radius-buttons, var(--j-radius-default, 0.5rem));
|
|
3635
3641
|
border: 1px solid transparent;
|
|
3636
3642
|
cursor: pointer;
|
|
3637
3643
|
transition: all 150ms ease-in-out;
|
|
@@ -4389,7 +4395,7 @@ function generateFormStyles(config) {
|
|
|
4389
4395
|
color: var(--j-text);
|
|
4390
4396
|
background-color: var(--j-bg);
|
|
4391
4397
|
border: 1px solid var(--j-border);
|
|
4392
|
-
border-radius: var(--j-radius-default, 0.5rem);
|
|
4398
|
+
border-radius: var(--j-radius-inputs, var(--j-radius-default, 0.5rem));
|
|
4393
4399
|
transition: border-color 150ms ease-in-out, box-shadow 150ms ease-in-out;
|
|
4394
4400
|
appearance: none;
|
|
4395
4401
|
}
|
|
@@ -4773,7 +4779,7 @@ input[type="range"].form-control::-webkit-slider-thumb:hover {
|
|
|
4773
4779
|
|
|
4774
4780
|
/* Square Switch */
|
|
4775
4781
|
.form-switch-square .form-switch-input {
|
|
4776
|
-
border-radius: var(--j-radius-default, 0.375rem);
|
|
4782
|
+
border-radius: var(--j-radius-inputs, var(--j-radius-default, 0.375rem));
|
|
4777
4783
|
}
|
|
4778
4784
|
|
|
4779
4785
|
.form-switch-square .form-switch-input::before {
|
|
@@ -4819,12 +4825,12 @@ input[type="range"].form-control::-webkit-slider-thumb:hover {
|
|
|
4819
4825
|
|
|
4820
4826
|
.input-group-text:first-child {
|
|
4821
4827
|
border-right: none;
|
|
4822
|
-
border-radius: var(--j-radius-
|
|
4828
|
+
border-radius: var(--j-radius-inputs, 0.5rem) 0 0 var(--j-radius-inputs, 0.5rem);
|
|
4823
4829
|
}
|
|
4824
4830
|
|
|
4825
4831
|
.input-group-text:last-child {
|
|
4826
4832
|
border-left: none;
|
|
4827
|
-
border-radius: 0 var(--j-radius-
|
|
4833
|
+
border-radius: 0 var(--j-radius-inputs, 0.5rem) var(--j-radius-inputs, 0.5rem) 0;
|
|
4828
4834
|
}
|
|
4829
4835
|
|
|
4830
4836
|
.input-group > .btn:first-child {
|
|
@@ -4861,7 +4867,7 @@ input[type="range"].form-control::-webkit-slider-thumb:hover {
|
|
|
4861
4867
|
|
|
4862
4868
|
.form-floating > .form-control:focus ~ .form-label,
|
|
4863
4869
|
.form-floating > .form-control:not(:placeholder-shown) ~ .form-label {
|
|
4864
|
-
transform: scale(0.85) translateY(-0.5rem);
|
|
4870
|
+
transform: scale(0.85) translateY(-0.5rem));
|
|
4865
4871
|
color: var(--j-primary);
|
|
4866
4872
|
}
|
|
4867
4873
|
|
|
@@ -4875,7 +4881,7 @@ input[type="range"].form-control::-webkit-slider-thumb:hover {
|
|
|
4875
4881
|
/* Fieldset */
|
|
4876
4882
|
fieldset {
|
|
4877
4883
|
border: 1px solid var(--j-border);
|
|
4878
|
-
border-radius: var(--j-radius-default, 0.5rem);
|
|
4884
|
+
border-radius: var(--j-radius-inputs, var(--j-radius-default, 0.5rem));
|
|
4879
4885
|
padding: 1.5rem;
|
|
4880
4886
|
margin-bottom: 1.5rem;
|
|
4881
4887
|
}
|
|
@@ -14514,6 +14520,14 @@ a {
|
|
|
14514
14520
|
|
|
14515
14521
|
button, [role="button"] {
|
|
14516
14522
|
cursor: pointer;
|
|
14523
|
+
appearance: none;
|
|
14524
|
+
-webkit-appearance: none;
|
|
14525
|
+
background: transparent;
|
|
14526
|
+
border: none;
|
|
14527
|
+
}
|
|
14528
|
+
|
|
14529
|
+
button:focus {
|
|
14530
|
+
outline: none;
|
|
14517
14531
|
}
|
|
14518
14532
|
|
|
14519
14533
|
:disabled {
|
|
@@ -14696,9 +14710,81 @@ code, kbd, samp, pre {
|
|
|
14696
14710
|
}
|
|
14697
14711
|
|
|
14698
14712
|
// src/core/compiler.js
|
|
14713
|
+
var COMPONENT_CLASS_PREFIXES = {
|
|
14714
|
+
"accordion": "accordion",
|
|
14715
|
+
"alert": "alerts",
|
|
14716
|
+
"avatar": "avatars",
|
|
14717
|
+
"badge": "badges",
|
|
14718
|
+
"btn": "buttons",
|
|
14719
|
+
"card": "cards",
|
|
14720
|
+
"carousel": "carousel",
|
|
14721
|
+
"chip": "chips",
|
|
14722
|
+
"command-palette": "command-palette",
|
|
14723
|
+
"datepicker": "datepicker",
|
|
14724
|
+
"calendar": "datepicker",
|
|
14725
|
+
"dropdown": "dropdown",
|
|
14726
|
+
"form-": "forms",
|
|
14727
|
+
"input-group": "forms",
|
|
14728
|
+
"modal": "modals",
|
|
14729
|
+
"navbar": "navigation",
|
|
14730
|
+
"nav-": "navigation",
|
|
14731
|
+
"breadcrumb": "navigation",
|
|
14732
|
+
"pagination": "navigation",
|
|
14733
|
+
"tabs": "navigation",
|
|
14734
|
+
"tab": "navigation",
|
|
14735
|
+
"offcanvas": "offcanvas",
|
|
14736
|
+
"popover": "popover",
|
|
14737
|
+
"progress": "progress",
|
|
14738
|
+
"rating": "rating",
|
|
14739
|
+
"skeleton": "skeleton",
|
|
14740
|
+
"spinner": "spinner",
|
|
14741
|
+
"stepper": "stepper",
|
|
14742
|
+
"table": "tables",
|
|
14743
|
+
"timeline": "timeline",
|
|
14744
|
+
"timepicker": "timepicker",
|
|
14745
|
+
"tooltip": "tooltips",
|
|
14746
|
+
"upload": "upload"
|
|
14747
|
+
};
|
|
14748
|
+
function detectUsedComponents(usedClasses) {
|
|
14749
|
+
const detectedComponents = /* @__PURE__ */ new Set();
|
|
14750
|
+
if (!usedClasses)
|
|
14751
|
+
return detectedComponents;
|
|
14752
|
+
for (const className of usedClasses) {
|
|
14753
|
+
for (const [prefix, component] of Object.entries(COMPONENT_CLASS_PREFIXES)) {
|
|
14754
|
+
if (className.startsWith(prefix) || className === prefix.replace(/-$/, "")) {
|
|
14755
|
+
detectedComponents.add(component);
|
|
14756
|
+
}
|
|
14757
|
+
}
|
|
14758
|
+
}
|
|
14759
|
+
return detectedComponents;
|
|
14760
|
+
}
|
|
14761
|
+
function getMissingComponents(configComponents, detectedComponents) {
|
|
14762
|
+
const missing = [];
|
|
14763
|
+
for (const comp of detectedComponents) {
|
|
14764
|
+
if (!configComponents || !configComponents.includes(comp)) {
|
|
14765
|
+
missing.push(comp);
|
|
14766
|
+
}
|
|
14767
|
+
}
|
|
14768
|
+
return missing;
|
|
14769
|
+
}
|
|
14699
14770
|
async function compileCSS(config, options = {}) {
|
|
14700
|
-
const { usedClasses, minify = false, includeAll = false } = options;
|
|
14771
|
+
const { usedClasses, minify = false, includeAll = false, autoDetectComponents = true } = options;
|
|
14701
14772
|
const resolvedConfig = resolveConfig(config);
|
|
14773
|
+
let selectedComponents = config.components || [];
|
|
14774
|
+
let detectedComponents = /* @__PURE__ */ new Set();
|
|
14775
|
+
let missingComponents = [];
|
|
14776
|
+
if (usedClasses && autoDetectComponents) {
|
|
14777
|
+
detectedComponents = detectUsedComponents(usedClasses);
|
|
14778
|
+
missingComponents = getMissingComponents(selectedComponents, detectedComponents);
|
|
14779
|
+
if (missingComponents.length > 0) {
|
|
14780
|
+
console.log(pc.yellow(`
|
|
14781
|
+
\u26A0\uFE0F Auto-detected ${missingComponents.length} additional component(s):`));
|
|
14782
|
+
console.log(pc.dim(` ${missingComponents.join(", ")}`));
|
|
14783
|
+
console.log(pc.dim(` Adding them to this build automatically.
|
|
14784
|
+
`));
|
|
14785
|
+
selectedComponents = [.../* @__PURE__ */ new Set([...selectedComponents, ...missingComponents])];
|
|
14786
|
+
}
|
|
14787
|
+
}
|
|
14702
14788
|
const parts = [];
|
|
14703
14789
|
parts.push(generateBase(resolvedConfig));
|
|
14704
14790
|
const utilities = generateUtilities(resolvedConfig, {
|
|
@@ -14707,7 +14793,7 @@ async function compileCSS(config, options = {}) {
|
|
|
14707
14793
|
});
|
|
14708
14794
|
parts.push(utilities.css);
|
|
14709
14795
|
const components2 = generateComponents(resolvedConfig, {
|
|
14710
|
-
selected:
|
|
14796
|
+
selected: selectedComponents,
|
|
14711
14797
|
usedClasses,
|
|
14712
14798
|
includeAll
|
|
14713
14799
|
});
|
|
@@ -14730,7 +14816,9 @@ async function compileCSS(config, options = {}) {
|
|
|
14730
14816
|
minified,
|
|
14731
14817
|
stats: {
|
|
14732
14818
|
utilities: utilities.count,
|
|
14733
|
-
components: components2.count
|
|
14819
|
+
components: components2.count,
|
|
14820
|
+
autoDetected: missingComponents,
|
|
14821
|
+
totalComponents: selectedComponents.length
|
|
14734
14822
|
}
|
|
14735
14823
|
};
|
|
14736
14824
|
}
|