File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed
Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ "@clack/prompts": patch
3+ ---
4+
5+ Change styling of disabled multi-select options to have strikethrough.
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ export const multiselect = <Value>(opts: MultiSelectOptions<Value>) => {
4242 ) => {
4343 const label = option.label ?? String(option.value);
4444 if (state === 'disabled') {
45- return `${color.gray(S_CHECKBOX_INACTIVE)} ${computeLabel(label, color.gray)}${
45+ return `${color.gray(S_CHECKBOX_INACTIVE)} ${computeLabel(label, (str) => color.strikethrough(color. gray(str)) )}${
4646 option.hint ? ` ${color.dim(`(${option.hint ?? 'disabled'})`)}` : ''
4747 }`;
4848 }
Original file line number Diff line number Diff line change @@ -245,9 +245,9 @@ exports[`multiselect (isCI = false) > renders disabled options 1`] = `
245245 "<cursor.hide>",
246246 "[90m│[39m
247247[36m◆[39m foo
248- [36m│[39m [90m◻[39m [90mopt0[39m
248+ [36m│[39m [90m◻[39m [9m[ 90mopt0[39m[29m
249249[36m│[39m [36m◻[39m opt1
250- [36m│[39m [90m◻[39m [90mopt2[39m [2m(Hint 2)[22m
250+ [36m│[39m [90m◻[39m [9m[ 90mopt2[39m[29m [2m(Hint 2)[22m
251251[36m└[39m
252252",
253253 "<cursor.backward count=999><cursor.up count=6>",
@@ -979,9 +979,9 @@ exports[`multiselect (isCI = true) > renders disabled options 1`] = `
979979 "<cursor.hide>",
980980 "[90m│[39m
981981[36m◆[39m foo
982- [36m│[39m [90m◻[39m [90mopt0[39m
982+ [36m│[39m [90m◻[39m [9m[ 90mopt0[39m[29m
983983[36m│[39m [36m◻[39m opt1
984- [36m│[39m [90m◻[39m [90mopt2[39m [2m(Hint 2)[22m
984+ [36m│[39m [90m◻[39m [9m[ 90mopt2[39m[29m [2m(Hint 2)[22m
985985[36m└[39m
986986",
987987 "<cursor.backward count=999><cursor.up count=6>",
You can’t perform that action at this time.
0 commit comments