@inquirer/select 4.1.1 → 4.2.1

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/README.md CHANGED
@@ -95,14 +95,15 @@ const answer = await select({
95
95
 
96
96
  ## Options
97
97
 
98
- | Property | Type | Required | Description |
99
- | -------- | ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
100
- | message | `string` | yes | The question to ask |
101
- | choices | `Choice[]` | yes | List of the available choices. |
102
- | default | `string` | no | Defines in front of which item the cursor will initially appear. When omitted, the cursor will appear on the first selectable item. |
103
- | pageSize | `number` | no | By default, lists of choice longer than 7 will be paginated. Use this option to control how many choices will appear on the screen at once. |
104
- | loop | `boolean` | no | Defaults to `true`. When set to `false`, the cursor will be constrained to the top and bottom of the choice list without looping. |
105
- | theme | [See Theming](#Theming) | no | Customize look of the prompt. |
98
+ | Property | Type | Required | Description |
99
+ | ------------ | ---------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
100
+ | message | `string` | yes | The question to ask |
101
+ | choices | `Choice[]` | yes | List of the available choices. |
102
+ | default | `string` | no | Defines in front of which item the cursor will initially appear. When omitted, the cursor will appear on the first selectable item. |
103
+ | pageSize | `number` | no | By default, lists of choice longer than 7 will be paginated. Use this option to control how many choices will appear on the screen at once. |
104
+ | loop | `boolean` | no | Defaults to `true`. When set to `false`, the cursor will be constrained to the top and bottom of the choice list without looping. |
105
+ | instructions | `{ navigation: string; pager: string; }` | no | Defines the help tip content. |
106
+ | theme | [See Theming](#Theming) | no | Customize look of the prompt. |
106
107
 
107
108
  `Separator` objects can be used in the `choices` array to render non-selectable lines in the choice list. By default it'll render a line, but you can provide the text as argument (`new Separator('-- Dependencies --')`). This option is often used to add labels to groups within long list of options.
108
109
 
@@ -25,6 +25,10 @@ declare const _default: <Value>(config: {
25
25
  pageSize?: number | undefined;
26
26
  loop?: boolean | undefined;
27
27
  default?: unknown;
28
+ instructions?: {
29
+ navigation: string;
30
+ pager: string;
31
+ } | undefined;
28
32
  theme?: PartialDeep<Theme<SelectTheme>> | undefined;
29
33
  }, context?: import("@inquirer/type").Context) => Promise<Value> & {
30
34
  cancel: () => void;
@@ -127,10 +127,10 @@ exports.default = (0, core_1.createPrompt)((config, done) => {
127
127
  (theme.helpMode === 'auto' && firstRender.current)) {
128
128
  firstRender.current = false;
129
129
  if (items.length > pageSize) {
130
- helpTipBottom = `\n${theme.style.help('(Use arrow keys to reveal more choices)')}`;
130
+ helpTipBottom = `\n${theme.style.help(`(${config.instructions?.pager ?? 'Use arrow keys to reveal more choices'})`)}`;
131
131
  }
132
132
  else {
133
- helpTipTop = theme.style.help('(Use arrow keys)');
133
+ helpTipTop = theme.style.help(`(${config.instructions?.navigation ?? 'Use arrow keys'})`);
134
134
  }
135
135
  }
136
136
  const page = (0, core_1.usePagination)({
@@ -25,6 +25,10 @@ declare const _default: <Value>(config: {
25
25
  pageSize?: number | undefined;
26
26
  loop?: boolean | undefined;
27
27
  default?: unknown;
28
+ instructions?: {
29
+ navigation: string;
30
+ pager: string;
31
+ } | undefined;
28
32
  theme?: PartialDeep<Theme<SelectTheme>> | undefined;
29
33
  }, context?: import("@inquirer/type").Context) => Promise<Value> & {
30
34
  cancel: () => void;
package/dist/esm/index.js CHANGED
@@ -121,10 +121,10 @@ export default createPrompt((config, done) => {
121
121
  (theme.helpMode === 'auto' && firstRender.current)) {
122
122
  firstRender.current = false;
123
123
  if (items.length > pageSize) {
124
- helpTipBottom = `\n${theme.style.help('(Use arrow keys to reveal more choices)')}`;
124
+ helpTipBottom = `\n${theme.style.help(`(${config.instructions?.pager ?? 'Use arrow keys to reveal more choices'})`)}`;
125
125
  }
126
126
  else {
127
- helpTipTop = theme.style.help('(Use arrow keys)');
127
+ helpTipTop = theme.style.help(`(${config.instructions?.navigation ?? 'Use arrow keys'})`);
128
128
  }
129
129
  }
130
130
  const page = usePagination({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inquirer/select",
3
- "version": "4.1.1",
3
+ "version": "4.2.1",
4
4
  "description": "Inquirer select/list prompt",
5
5
  "keywords": [
6
6
  "answer",
@@ -74,7 +74,7 @@
74
74
  "tsc": "tshy"
75
75
  },
76
76
  "dependencies": {
77
- "@inquirer/core": "^10.1.10",
77
+ "@inquirer/core": "^10.1.11",
78
78
  "@inquirer/figures": "^1.0.11",
79
79
  "@inquirer/type": "^3.0.6",
80
80
  "ansi-escapes": "^4.3.2",
@@ -83,7 +83,6 @@
83
83
  "devDependencies": {
84
84
  "@arethetypeswrong/cli": "^0.17.4",
85
85
  "@inquirer/testing": "^2.1.46",
86
- "@repo/tsconfig": "workspace:*",
87
86
  "tshy": "^3.0.2"
88
87
  },
89
88
  "engines": {
@@ -109,5 +108,5 @@
109
108
  "optional": true
110
109
  }
111
110
  },
112
- "gitHead": "d367155a8d64d8b3e93f9c763adccf708aedc8a8"
111
+ "gitHead": "50bac82683b9a8d8e06ec87972894d56b2883bcd"
113
112
  }