@yarnpkg/libui
Advanced tools
Comparing version 2.1.1 to 2.1.2-rc.1
{ | ||
"name": "@yarnpkg/libui", | ||
"version": "2.1.1", | ||
"version": "2.1.2-rc.1", | ||
"license": "BSD-2-Clause", | ||
@@ -12,3 +12,3 @@ "sideEffects": false, | ||
"@types/react": "^16.8.0", | ||
"ink": "^3.0.7", | ||
"ink": "^3.0.8", | ||
"react": "^16.13.1" | ||
@@ -18,3 +18,4 @@ }, | ||
"type": "git", | ||
"url": "ssh://git@github.com/yarnpkg/berry.git" | ||
"url": "ssh://git@github.com/yarnpkg/berry.git", | ||
"directory": "packages/yarnpkg-libui" | ||
}, | ||
@@ -32,3 +33,4 @@ "dependencies": { | ||
"node": ">=10.19.0" | ||
} | ||
}, | ||
"stableVersion": "2.1.1" | ||
} |
@@ -28,6 +28,12 @@ "use strict"; | ||
}) { | ||
const values = options.map(({ | ||
// Our possible values are those that have been provided with a label so that | ||
// the user can see what they're selecting. | ||
const values = options.filter(({ | ||
label | ||
}) => !!label).map(({ | ||
value | ||
}) => value); | ||
const selectedIndex = values.indexOf(value); | ||
const selectedIndex = options.findIndex(o => { | ||
return o.value === value && o.label != ``; | ||
}); | ||
(0, _useListInput.useListInput)(value, values, { | ||
@@ -48,2 +54,11 @@ active, | ||
const padWidth = Math.max(0, boxWidth - simpleLabel.length - 2); | ||
if (!label) { | ||
return /*#__PURE__*/_react.default.createElement(_ink.Box, { | ||
key: `spacer-${index}`, | ||
width: boxWidth, | ||
marginLeft: 1 | ||
}); | ||
} | ||
return /*#__PURE__*/_react.default.createElement(_ink.Box, { | ||
@@ -54,3 +69,3 @@ key: label, | ||
}, /*#__PURE__*/_react.default.createElement(_ink.Text, { | ||
wrap: "truncate" | ||
wrap: `truncate` | ||
}, /*#__PURE__*/_react.default.createElement(_Gem.Gem, { | ||
@@ -57,0 +72,0 @@ active: isGemActive |
@@ -8,4 +8,2 @@ "use strict"; | ||
var _chalk = _interopRequireDefault(require("chalk")); | ||
var _ink = require("ink"); | ||
@@ -22,3 +20,3 @@ | ||
if (length === 0) return null; | ||
const text = length > 1 ? ` ${_chalk.default.underline(` `.repeat(length - 1))}` : ` `; | ||
const text = length > 1 ? ` ${`-`.repeat(length - 1)}` : ` `; | ||
return /*#__PURE__*/_react.default.createElement(_ink.Text, { | ||
@@ -25,0 +23,0 @@ dimColor: !active |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
25300
663
2