From 90b4eaba2c4caf99f9f0a08cfe6f6a9b9c4e022b Mon Sep 17 00:00:00 2001 From: "Willow (GHOST)" Date: Mon, 11 May 2026 22:24:09 +0100 Subject: [PATCH 1/2] docs: add multi-line text and update text/password sections --- src/content/docs/clack/packages/prompts.mdx | 49 +++++++++++++++++++-- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/src/content/docs/clack/packages/prompts.mdx b/src/content/docs/clack/packages/prompts.mdx index 27d7888..eaeb03b 100644 --- a/src/content/docs/clack/packages/prompts.mdx +++ b/src/content/docs/clack/packages/prompts.mdx @@ -103,6 +103,8 @@ const name = await text({ ### Text Input +The text prompt accepts a single line of text. + ```ts twoslash // @errors: 2339 18048 import { text } from '@clack/prompts'; @@ -122,8 +124,19 @@ const name = await text({ John Doe +Options: + +- `message`: The prompt message shown to the user above the input. +- `placeholder`: A visual hint shown when the field has no content. +- `defaultValue`: A fallback value returned when the user provides nothing (empty input). +- `initialValue`: The starting value shown when the prompt first renders. Users can edit this value before submitting. +- `validate`: A function that validates user input. Return a `string` or `Error` to show as a validation error, or `undefined` to accept the result. +- All [Common Options](#common-options) + ### Password Input +Behaves like the text component, but the input is masked. + ```ts twoslash import { password } from '@clack/prompts'; @@ -147,9 +160,39 @@ const secret = await password({ Options: -- `message`: The prompt message to display -- `mask`: Character used to mask input (default: `'▪'`) -- `clearOnError`: When `true`, clears the input field when validation fails (useful for security) + +- `message`: The prompt message or question shown to the user above the input. +- `mask`: Character to use for masking input. Default: `'▪/•'`. +- `validate`: A function that validates user input. Return a `string` or `Error` to show as a validation error, or `undefined` to accept the result. +- `clearOnError`: When enabled it causes the input to be cleared if/when validation fails. Default: `false`. +- All [Common Options](#common-options) + +Common options (`withGuide`, `signal`, `input`, `output`) are also supported. + +### Multi-line Text + +The multi-line component accepts multiple lines of text input. By default, pressing Enter twice submits the input. + +```ts twoslash +import { multiline } from '@clack/prompts'; + +const bio = await multiline({ + message: 'Enter your bio', + placeholder: 'Tell us about yourself...', + showSubmit: true, +}); +``` + +

+ Enter your bio
+  Tell us about yourself...
+
+  [ submit ]
+ +Options: + +- `showSubmit`: When enabled it shows a `[ submit ]` button that can be focused with tab. By default, pressing Enter twice submits the input. Default: `false`. +- All [Text Options](#text-input) ### Selection From abb6fcb7a0298bc41e0a2035f802cf4c3203f48a Mon Sep 17 00:00:00 2001 From: "Willow (GHOST)" Date: Mon, 11 May 2026 22:24:15 +0100 Subject: [PATCH 2/2] deps: update clack --- package.json | 4 ++-- pnpm-lock.yaml | 52 ++++++++++++++++++++++++++------------------------ 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index 9e60aab..1dfa822 100644 --- a/package.json +++ b/package.json @@ -14,8 +14,8 @@ "dependencies": { "@astrojs/starlight": "^0.37.1", "@bomb.sh/args": "^0.3.1", - "@clack/core": "^1.2.0", - "@clack/prompts": "^1.2.0", + "@clack/core": "^1.3.0", + "@clack/prompts": "^1.3.0", "@types/node": "^22.19.3", "@webcontainer/api": "^1.6.1", "@webcontainer/snapshot": "^0.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a8a71be..b810e5a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,11 +15,11 @@ importers: specifier: ^0.3.1 version: 0.3.1 '@clack/core': - specifier: ^1.2.0 - version: 1.2.0 + specifier: ^1.3.0 + version: 1.3.0 '@clack/prompts': - specifier: ^1.2.0 - version: 1.2.0 + specifier: ^1.3.0 + version: 1.3.0 '@types/node': specifier: ^22.19.3 version: 22.19.3 @@ -128,11 +128,13 @@ packages: resolution: {integrity: sha512-8XqW8xGn++Eqqbz3e9wKuK7mxryeRjs4LOHLxbh2lwKeSbuNR4NFifDZT4KzvjU6HMOPbiNTsWpniK5EJfTWkg==} engines: {node: '>=18'} - '@clack/core@1.2.0': - resolution: {integrity: sha512-qfxof/3T3t9DPU/Rj3OmcFyZInceqj/NVtO9rwIuJqCUgh32gwPjpFQQp/ben07qKlhpwq7GzfWpST4qdJ5Drg==} + '@clack/core@1.3.0': + resolution: {integrity: sha512-xJPHpAmEQUBrXSLx0gF+q5K/IyihXpsHZcha+jB+tyahsKRK3Dxo4D0coZDewHo12NhiuzC3dTtMPbm53GEAAA==} + engines: {node: '>= 20.12.0'} - '@clack/prompts@1.2.0': - resolution: {integrity: sha512-4jmztR9fMqPMjz6H/UZXj0zEmE43ha1euENwkckKKel4XpSfokExPo5AiVStdHSAlHekz4d0CA/r45Ok1E4D3w==} + '@clack/prompts@1.3.0': + resolution: {integrity: sha512-GgcWwRCs/xPtaqlMy8qRhPnZf9vlWcWZNHAitnVQ3yk7JmSralSiq5q07yaffYE8SogtDm7zFeKccx1QNVARpw==} + engines: {node: '>= 20.12.0'} '@cloudflare/kv-asset-handler@0.4.2': resolution: {integrity: sha512-SIOD2DxrRRwQ+jgzlXCqoEFiKOFqaPjhnNTGKXSRLvp1HiOvapLaFG2kEr9dYQTYe8rKrd9uvDUzmAITeNyaHQ==} @@ -1439,14 +1441,14 @@ packages: fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} - fast-string-truncated-width@1.2.1: - resolution: {integrity: sha512-Q9acT/+Uu3GwGj+5w/zsGuQjh9O1TyywhIwAxHudtWrgF09nHOPrvTLhQevPbttcxjr/SNN7mJmfOw/B1bXgow==} + fast-string-truncated-width@3.0.3: + resolution: {integrity: sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g==} - fast-string-width@1.1.0: - resolution: {integrity: sha512-O3fwIVIH5gKB38QNbdg+3760ZmGz0SZMgvwJbA1b2TGXceKE6A2cOlfogh1iw8lr049zPyd7YADHy+B7U4W9bQ==} + fast-string-width@3.0.2: + resolution: {integrity: sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg==} - fast-wrap-ansi@0.1.6: - resolution: {integrity: sha512-HlUwET7a5gqjURj70D5jl7aC3Zmy4weA1SHUfM0JFI0Ptq987NH2TwbBFLoERhfwk+E+eaq4EK3jXoT+R3yp3w==} + fast-wrap-ansi@0.2.0: + resolution: {integrity: sha512-rLV8JHxTyhVmFYhBJuMujcrHqOT2cnO5Zxj37qROj23CP39GXubJRBUFF0z8KFK77Uc0SukZUf7JZhsVEQ6n8w==} fdir@6.5.0: resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} @@ -2554,16 +2556,16 @@ snapshots: dependencies: fontkit: 2.0.4 - '@clack/core@1.2.0': + '@clack/core@1.3.0': dependencies: - fast-wrap-ansi: 0.1.6 + fast-wrap-ansi: 0.2.0 sisteransi: 1.0.5 - '@clack/prompts@1.2.0': + '@clack/prompts@1.3.0': dependencies: - '@clack/core': 1.2.0 - fast-string-width: 1.1.0 - fast-wrap-ansi: 0.1.6 + '@clack/core': 1.3.0 + fast-string-width: 3.0.2 + fast-wrap-ansi: 0.2.0 sisteransi: 1.0.5 '@cloudflare/kv-asset-handler@0.4.2': {} @@ -3679,15 +3681,15 @@ snapshots: fast-deep-equal@3.1.3: {} - fast-string-truncated-width@1.2.1: {} + fast-string-truncated-width@3.0.3: {} - fast-string-width@1.1.0: + fast-string-width@3.0.2: dependencies: - fast-string-truncated-width: 1.2.1 + fast-string-truncated-width: 3.0.3 - fast-wrap-ansi@0.1.6: + fast-wrap-ansi@0.2.0: dependencies: - fast-string-width: 1.1.0 + fast-string-width: 3.0.2 fdir@6.5.0(picomatch@4.0.3): optionalDependencies: