@hyperfrontend/questions 0.1.0 → 0.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/CHANGELOG.md CHANGED
@@ -2,7 +2,23 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
- ## 0.1.0 - 2026-04-17
5
+ ## [0.2.1](https://github.com/AndrewRedican/hyperfrontend/compare/926d40cab470e589fc30a1ef3a61ca764ff047bd...466c0388c4cd516b9c704214140b4df1004098e6) - 2026-06-23
6
+
7
+ ### Other
8
+
9
+ - **@hyperfrontend/workspace:** remove lib-builder and tool-package as implicit dependencies for all lib projects
10
+
11
+ ## [0.2.0](https://github.com/AndrewRedican/hyperfrontend/compare/587d0dc108d5bb7f48c44a5a0065e349c774e4cf...b5f254d41cb9549c783146db48eff78ed39e5bf5) - 2026-04-25
12
+
13
+ ### Features
14
+
15
+ - add filter as you type search on select prompt
16
+
17
+ ### Bug Fixes
18
+
19
+ - prompt cursor math and add live text render hook
20
+
21
+ ## 0.1.0 - 2026-04-20
6
22
 
7
23
  ### Features
8
24
 
package/README.md CHANGED
@@ -89,6 +89,17 @@ if (nameResult.result === PromptResult.Submitted) {
89
89
  console.log(`Hello, ${nameResult.value}!`)
90
90
  }
91
91
 
92
+ // Text input with a live label — `renderMessage` is recomputed on every keystroke
93
+ import { style } from '@hyperfrontend/questions'
94
+
95
+ await text({
96
+ message: 'Title:',
97
+ renderMessage: (value) => {
98
+ const left = 72 - value.length
99
+ return `Title (${left >= 0 ? style.green(`${left} left`) : style.red(`${-left} over`)}):`
100
+ },
101
+ })
102
+
92
103
  // Confirmation
93
104
  const continueResult = await confirm({
94
105
  message: 'Continue?',
@@ -120,13 +131,14 @@ const featuresResult = await multiselect({
120
131
 
121
132
  ## API Overview
122
133
 
123
- | Function | Description |
124
- | -------------- | ------------------------------------------------- |
125
- | `text` | Free-form text input with optional validation |
126
- | `confirm` | Yes/no confirmation prompt |
127
- | `select` | Single selection from a list of choices |
128
- | `multiselect` | Multiple selections with optional search |
129
- | `PromptResult` | Discriminated union: `'submitted' \| 'cancelled'` |
134
+ | Function | Description |
135
+ | -------------- | ----------------------------------------------------------------------------- |
136
+ | `text` | Free-form text input with optional validation and live-updating labels |
137
+ | `confirm` | Yes/no confirmation prompt |
138
+ | `select` | Single selection from a list of choices |
139
+ | `multiselect` | Multiple selections with optional search |
140
+ | `style` | ANSI colour helpers (`green`, `yellow`, `red`, `cyan`, `bold`, `dim`, `gray`) |
141
+ | `PromptResult` | Discriminated union: `'submitted' \| 'cancelled'` |
130
142
 
131
143
  All prompts return `Promise<PromptOutcome<T>>` where:
132
144
 
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ const _Math = globalThis.Math;
4
+ const max = _Math.max;
5
+ const min = _Math.min;
6
+ exports.max = max;
7
+ exports.min = min;
@@ -0,0 +1,5 @@
1
+ const _Math = globalThis.Math;
2
+ const max = _Math.max;
3
+ const min = _Math.min;
4
+
5
+ export { max, min };
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ const _Object = globalThis.Object;
4
+ const freeze = _Object.freeze;
5
+ exports.freeze = freeze;
@@ -0,0 +1,4 @@
1
+ const _Object = globalThis.Object;
2
+ const freeze = _Object.freeze;
3
+
4
+ export { freeze };
@@ -0,0 +1,6 @@
1
+ 'use strict';
2
+
3
+ const _Promise = globalThis.Promise;
4
+ const _Reflect = globalThis.Reflect;
5
+ const createPromise = (executor) => _Reflect.construct(_Promise, [executor]);
6
+ exports.createPromise = createPromise;
@@ -0,0 +1,5 @@
1
+ const _Promise = globalThis.Promise;
2
+ const _Reflect = globalThis.Reflect;
3
+ const createPromise = (executor) => _Reflect.construct(_Promise, [executor]);
4
+
5
+ export { createPromise };