rafters 0.0.29 → 0.0.30

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.
Files changed (2) hide show
  1. package/dist/index.js +13 -8
  2. 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(allItems, cwd);
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
- h: oklch2.coords[2] ?? 0,
53308
- // Handle undefined hue for achromatic colors
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
- // 3 decimal places for chroma
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rafters",
3
- "version": "0.0.29",
3
+ "version": "0.0.30",
4
4
  "description": "CLI for Rafters design system - scaffold tokens and add components",
5
5
  "license": "MIT",
6
6
  "type": "module",