rafters 0.0.29 → 0.0.31
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.js +21 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13599,6 +13599,8 @@ async function add(componentArgs, options) {
|
|
|
13599
13599
|
const installed = [];
|
|
13600
13600
|
const skipped = [];
|
|
13601
13601
|
const installedItems = [];
|
|
13602
|
+
const filteredItems = [];
|
|
13603
|
+
const target = getComponentTarget(config3);
|
|
13602
13604
|
for (const item of allItems) {
|
|
13603
13605
|
if (!options.overwrite && isAlreadyInstalled(config3, item)) {
|
|
13604
13606
|
log({
|
|
@@ -13614,6 +13616,12 @@ async function add(componentArgs, options) {
|
|
|
13614
13616
|
if (result.installed) {
|
|
13615
13617
|
installed.push(item.name);
|
|
13616
13618
|
installedItems.push(item);
|
|
13619
|
+
if (item.type === "ui") {
|
|
13620
|
+
const selection = selectFilesForFramework(item.files, target);
|
|
13621
|
+
filteredItems.push({ ...item, files: selection.files });
|
|
13622
|
+
} else {
|
|
13623
|
+
filteredItems.push(item);
|
|
13624
|
+
}
|
|
13617
13625
|
log({
|
|
13618
13626
|
event: "add:installed",
|
|
13619
13627
|
component: item.name,
|
|
@@ -13642,7 +13650,7 @@ async function add(componentArgs, options) {
|
|
|
13642
13650
|
};
|
|
13643
13651
|
let depsResult = emptyDeps;
|
|
13644
13652
|
try {
|
|
13645
|
-
depsResult = await installRegistryDependencies(
|
|
13653
|
+
depsResult = await installRegistryDependencies(filteredItems, cwd);
|
|
13646
13654
|
} catch (err) {
|
|
13647
13655
|
const message = err instanceof Error ? err.message : String(err);
|
|
13648
13656
|
log({
|
|
@@ -53304,8 +53312,8 @@ function hexToOKLCH(hex3) {
|
|
|
53304
53312
|
return {
|
|
53305
53313
|
l: oklch2.coords[0] ?? 0,
|
|
53306
53314
|
c: oklch2.coords[1] ?? 0,
|
|
53307
|
-
|
|
53308
|
-
|
|
53315
|
+
// Achromatic colors (grays) get NaN hue from colorjs.io, not undefined
|
|
53316
|
+
h: Number.isNaN(oklch2.coords[2]) ? 0 : oklch2.coords[2] ?? 0,
|
|
53309
53317
|
alpha: oklch2.alpha ?? 1
|
|
53310
53318
|
};
|
|
53311
53319
|
} catch (_error) {
|
|
@@ -53315,13 +53323,10 @@ function hexToOKLCH(hex3) {
|
|
|
53315
53323
|
function roundOKLCH(oklch2) {
|
|
53316
53324
|
return {
|
|
53317
53325
|
l: Math.round(oklch2.l * 1e3) / 1e3,
|
|
53318
|
-
// 3 decimal places for lightness
|
|
53319
53326
|
c: Math.round(oklch2.c * 1e3) / 1e3,
|
|
53320
|
-
//
|
|
53321
|
-
h: Math.round(oklch2.h),
|
|
53322
|
-
// Whole degrees for hue
|
|
53327
|
+
// NaN hue from achromatic colors defaults to 0
|
|
53328
|
+
h: Number.isNaN(oklch2.h) ? 0 : Math.round(oklch2.h),
|
|
53323
53329
|
alpha: oklch2.alpha !== void 0 ? Math.round(oklch2.alpha * 100) / 100 : 1
|
|
53324
|
-
// 2 decimal places for alpha
|
|
53325
53330
|
};
|
|
53326
53331
|
}
|
|
53327
53332
|
|
|
@@ -57649,11 +57654,13 @@ function generateRadiusTokens(config3, radiusDefs) {
|
|
|
57649
57654
|
} else if (def.step === "full") {
|
|
57650
57655
|
value2 = "9999px";
|
|
57651
57656
|
mathRelationship = "infinite (9999px)";
|
|
57657
|
+
} else if (def.step === 0) {
|
|
57658
|
+
value2 = "var(--rafters-radius-base)";
|
|
57659
|
+
mathRelationship = `${baseRadiusRem}rem (base)`;
|
|
57652
57660
|
} else {
|
|
57653
|
-
const
|
|
57654
|
-
|
|
57655
|
-
|
|
57656
|
-
mathRelationship = def.step === 0 ? `${baseRadiusRem}rem (base)` : `${baseRadiusRem} \xD7 ${progression.ratio}^${def.step}`;
|
|
57661
|
+
const multiplier = Math.round(progression.ratio ** def.step * 1e3) / 1e3;
|
|
57662
|
+
value2 = `calc(var(--rafters-radius-base) * ${multiplier})`;
|
|
57663
|
+
mathRelationship = `base \xD7 ${progression.ratio}^${def.step} (\xD7${multiplier})`;
|
|
57657
57664
|
}
|
|
57658
57665
|
tokens.push({
|
|
57659
57666
|
name: scale3 === "DEFAULT" ? "radius" : `radius-${scale3}`,
|
|
@@ -57905,9 +57912,10 @@ function generateSpacingTokens(config3, spacingMultipliers) {
|
|
|
57905
57912
|
usageContext = ["hero-spacing", "page-margins", "major-sections"];
|
|
57906
57913
|
}
|
|
57907
57914
|
const remValue = value2 / 16;
|
|
57915
|
+
const cssValue = multiplier === 0 ? "0" : multiplier === 1 ? "var(--rafters-spacing-base)" : `calc(var(--rafters-spacing-base) * ${multiplier})`;
|
|
57908
57916
|
tokens.push({
|
|
57909
57917
|
name: `spacing-${scale3}`,
|
|
57910
|
-
value:
|
|
57918
|
+
value: cssValue,
|
|
57911
57919
|
category: "spacing",
|
|
57912
57920
|
namespace: "spacing",
|
|
57913
57921
|
semanticMeaning: meaning,
|