How to use the kleur.gray function in kleur

To help you get started, we’ve selected a few kleur examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github foo-software / lighthouse-check-action / node_modules / prompts / dist / elements / multiselect.js View on Github external
} else {
      title = cursor === i ? color.cyan().underline(v.title) : v.title;

      if (cursor === i && v.description) {
        desc = ` - ${v.description}`;

        if (prefix.length + title.length + desc.length >= this.out.columns || v.description.split(/\r?\n/).length > 1) {
          desc = '\n' + wrap(v.description, {
            margin: prefix.length,
            width: this.out.columns
          });
        }
      }
    }

    return prefix + title + color.gray(desc || '');
  } // shared with autocompleteMultiselect
github terkelg / prompts / lib / elements / select.js View on Github external
if (v.disabled) {
          title = this.cursor === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);
          prefix = (this.cursor === i ? color.bold().gray(figures.pointer) + ' ' : '  ') + prefix;
        } else {
          title = this.cursor === i ? color.cyan().underline(v.title) : v.title;
          prefix = (this.cursor === i ? color.cyan(figures.pointer) + ' ' : '  ') + prefix;
          if (v.description && this.cursor === i) {
            desc = ` - ${v.description}`;
            if (prefix.length + title.length + desc.length >= this.out.columns
                || v.description.split(/\r?\n/).length > 1) {
              desc = '\n' + wrap(v.description, { margin: 3, width: this.out.columns });
            }
          }
        }

        this.outputText += `${prefix} ${title}${color.gray(desc)}\n`;
      }
    }

    this.out.write(this.outputText);
  }
}
github terkelg / prompts / lib / elements / multiselect.js View on Github external
let title, desc;

    if (v.disabled) {
      title = cursor === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);
    } else {
      title = cursor === i ? color.cyan().underline(v.title) : v.title;
      if (cursor === i && v.description) {
        desc = ` - ${v.description}`;
        if (prefix.length + title.length + desc.length >= this.out.columns
          || v.description.split(/\r?\n/).length > 1) {
          desc = '\n' + wrap(v.description, { margin: prefix.length, width: this.out.columns });
        }
      }
    }

    return prefix + title + color.gray(desc || '');
  }
github terkelg / prompts / lib / util / style.js View on Github external
const item = (expandable, expanded) =>
  c.gray(expandable ? (expanded ? figures.pointerSmall : '+') : figures.line);
github moleculerjs / moleculer / src / metrics / reporters / console.js View on Github external
labelsToStr(labels) {
		const keys = Object.keys(labels);
		if (keys.length == 0)
			return kleur.gray("{}");

		return kleur.gray("{") + keys.map(key => `${kleur.gray(this.formatLabelName(key))}: ${kleur.magenta(labels[key])}`).join(", ") + kleur.gray("}");
	}
github Hotell / typescript-lib-starter / scripts / migrate / migrate-4-5.js View on Github external
function writePackage(pkg) {
    const updatedLibPkgToWrite = JSON.stringify(pkg, null, 2)
    writeFileSync(join(PACKAGE_ROOT, 'package.json'), updatedLibPkgToWrite)

    log(
      '\n' +
        kleur.green('updated package.json:') +
        '\n' +
        updatedLibPkgToWrite +
        '\n' +
        kleur.gray('========================\n')
    )
  }
}
github terkelg / prompts / lib / elements / autocompleteMultiselect.js View on Github external
renderCurrentInput() {
    return `
Filtered results for: ${this.inputValue ? this.inputValue : color.gray('Enter something to filter')}\n`;
  }
github terkelg / prompts / lib / elements / text.js View on Github external
set value(v) {
    if (!v && this.initial) {
      this.placeholder = true;
      this.rendered = color.gray(this.transform.render(this.initial));
    } else {
      this.placeholder = false;
      this.rendered = this.transform.render(v);
    }
    this._value = v;
    this.fire();
  }