···11+---
22+"@clack/prompts": patch
33+---
44+55+docs: add jsdoc for `text`, `password`, and `multiline` prompts
+2-2
packages/prompts/README.md
···65656666### Password
67676868-The password component behaves like `text`, but masks the input as the user types.
6868+The password prompt behaves like the [`text`](#text) prompt, but masks the input as the user types.
69697070```js
7171import { password } from '@clack/prompts';
···201201202202### Multi-Line Text
203203204204-The multi-line text component accepts multiple lines of text input. By default, pressing `Enter` twice submits the input.
204204+The multi-line prompt accepts multiple lines of text input. By default, pressing `Enter` twice submits the input.
205205206206```js
207207import { multiline } from '@clack/prompts';
+26
packages/prompts/src/multi-line.ts
···33import { S_BAR, S_BAR_END, symbol } from './common.js';
44import type { TextOptions } from './text.js';
5566+/**
77+ * Options for the {@link multiline} prompt
88+ */
69export interface MultiLineOptions extends TextOptions {
1010+ /**
1111+ * When enabled it shows a `[ submit ]` button that can be focused with tab.
1212+ * By default, pressing `Enter` twice submits the input
1313+ *
1414+ * @default false
1515+ */
716 showSubmit?: boolean;
817}
9181919+/**
2020+ * The multi-line prompt accepts multiple lines of text input.
2121+ * By default, pressing `Enter` twice submits the input.
2222+ *
2323+ * @see https://bomb.sh/docs/clack/packages/prompts/#multi-line-text
2424+ *
2525+ * @example
2626+ * ```ts
2727+ * import { multiline } from '@clack/prompts';
2828+ *
2929+ * const bio = await multiline({
3030+ * message: 'Enter your bio',
3131+ * placeholder: 'Tell us about yourself...',
3232+ * showSubmit: true,
3333+ * });
3434+ * ```
3535+ */
1036export const multiline = (opts: MultiLineOptions) => {
1137 return new MultiLinePrompt({
1238 validate: opts.validate,
+36
packages/prompts/src/password.ts
···22import { PasswordPrompt, settings } from '@clack/core';
33import { type CommonOptions, S_BAR, S_BAR_END, S_PASSWORD_MASK, symbol } from './common.js';
4455+/**
66+ * Options for the {@link password} prompt
77+ */
58export interface PasswordOptions extends CommonOptions {
99+ /**
1010+ * The prompt message or question shown to the user above the input.
1111+ */
612 message: string;
1313+1414+ /**
1515+ * Character to use for masking input.
1616+ * @default ▪/•
1717+ */
718 mask?: string;
1919+2020+ /**
2121+ * A function that validates user input. Return a `string` or `Error` to show as a
2222+ * validation error, or `undefined` to accept the result.
2323+ */
824 validate?: (value: string | undefined) => string | Error | undefined;
2525+2626+ /**
2727+ * When enabled it causes the input to be cleared if/when validation fails.
2828+ * @default false
2929+ */
930 clearOnError?: boolean;
1031}
3232+3333+/**
3434+ * The password prompt behaves like the {@link text} prompt, but the input is masked.
3535+ *
3636+ * @see https://bomb.sh/docs/clack/packages/prompts/#password-input
3737+ *
3838+ * @example
3939+ * ```ts
4040+ * import { password } from '@clack/prompts';
4141+ *
4242+ * const result = await password({
4343+ * message: 'Enter your password',
4444+ * });
4545+ * ```
4646+ */
1147export const password = (opts: PasswordOptions) => {
1248 return new PasswordPrompt({
1349 validate: opts.validate,
+43
packages/prompts/src/text.ts
···22import { settings, TextPrompt } from '@clack/core';
33import { type CommonOptions, S_BAR, S_BAR_END, symbol } from './common.js';
4455+/**
66+ * Options for the {@link text} prompt
77+ */
58export interface TextOptions extends CommonOptions {
99+ /**
1010+ * The prompt message or question shown to the user above the input.
1111+ */
612 message: string;
1313+1414+ /**
1515+ * A visual hint shown when the field has no content.
1616+ */
717 placeholder?: string;
1818+1919+ /**
2020+ * A fallback value returned when the user provides nothing (empty input).
2121+ */
822 defaultValue?: string;
2323+2424+ /**
2525+ * The starting value shown when the prompt first renders.
2626+ * Users can edit this value before submitting.
2727+ */
928 initialValue?: string;
2929+3030+ /**
3131+ * A function that validates user input. Return a `string` or `Error` to show as a
3232+ * validation error, or `undefined` to accept the result.
3333+ */
1034 validate?: (value: string | undefined) => string | Error | undefined;
1135}
12363737+/**
3838+ * The text prompt accepts a single line of text.
3939+ *
4040+ * @see https://bomb.sh/docs/clack/packages/prompts/#text-input
4141+ *
4242+ * @example
4343+ * ```ts
4444+ * import { text } from '@clack/prompts';
4545+ *
4646+ * const name = await text({
4747+ * message: 'What is your name?',
4848+ * placeholder: 'John Doe',
4949+ * validate: (value) => {
5050+ * if (!value || value.length < 2) return 'Name must be at least 2 characters';
5151+ * return undefined;
5252+ * },
5353+ * });
5454+ * ```
5555+ */
1356export const text = (opts: TextOptions) => {
1457 return new TextPrompt({
1558 validate: opts.validate,