@inquirer/password 5.0.6 → 5.0.8

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/dist/index.d.ts CHANGED
@@ -1,10 +1,15 @@
1
1
  import { type Theme } from '@inquirer/core';
2
2
  import type { PartialDeep } from '@inquirer/type';
3
+ type PasswordTheme = {
4
+ style: {
5
+ maskedText: string;
6
+ };
7
+ };
3
8
  type PasswordConfig = {
4
9
  message: string;
5
10
  mask?: boolean | string;
6
11
  validate?: (value: string) => boolean | string | Promise<string | boolean>;
7
- theme?: PartialDeep<Theme>;
12
+ theme?: PartialDeep<Theme<PasswordTheme>>;
8
13
  };
9
14
  declare const _default: import("@inquirer/type").Prompt<string, PasswordConfig>;
10
15
  export default _default;
package/dist/index.js CHANGED
@@ -1,8 +1,13 @@
1
1
  import { createPrompt, useState, useKeypress, usePrefix, isEnterKey, makeTheme, } from '@inquirer/core';
2
2
  import { cursorHide } from '@inquirer/ansi';
3
+ const passwordTheme = {
4
+ style: {
5
+ maskedText: '[input is masked]',
6
+ },
7
+ };
3
8
  export default createPrompt((config, done) => {
4
9
  const { validate = () => true } = config;
5
- const theme = makeTheme(config.theme);
10
+ const theme = makeTheme(passwordTheme, config.theme);
6
11
  const [status, setStatus] = useState('idle');
7
12
  const [errorMsg, setError] = useState();
8
13
  const [value, setValue] = useState('');
@@ -42,7 +47,7 @@ export default createPrompt((config, done) => {
42
47
  formattedValue = maskChar.repeat(value.length);
43
48
  }
44
49
  else if (status !== 'done') {
45
- helpTip = `${theme.style.help('[input is masked]')}${cursorHide}`;
50
+ helpTip = `${theme.style.help(theme.style.maskedText)}${cursorHide}`;
46
51
  }
47
52
  if (status === 'done') {
48
53
  formattedValue = theme.style.answer(formattedValue);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inquirer/password",
3
- "version": "5.0.6",
3
+ "version": "5.0.8",
4
4
  "description": "Inquirer password prompt",
5
5
  "keywords": [
6
6
  "answer",
@@ -68,11 +68,11 @@
68
68
  },
69
69
  "dependencies": {
70
70
  "@inquirer/ansi": "^2.0.3",
71
- "@inquirer/core": "^11.1.3",
71
+ "@inquirer/core": "^11.1.5",
72
72
  "@inquirer/type": "^4.0.3"
73
73
  },
74
74
  "devDependencies": {
75
- "@inquirer/testing": "^3.1.1",
75
+ "@inquirer/testing": "^3.3.0",
76
76
  "typescript": "^5.9.3"
77
77
  },
78
78
  "peerDependencies": {
@@ -88,5 +88,5 @@
88
88
  },
89
89
  "main": "./dist/index.js",
90
90
  "types": "./dist/index.d.ts",
91
- "gitHead": "48b5d7e8b14d5c9fc4a19a8f1ead20a7593b29e1"
91
+ "gitHead": "526eca2e64853510821ffd457561840ec0cbfb93"
92
92
  }