ionbase-ui 0.59.0 → 0.69.0

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.
Files changed (102) hide show
  1. package/dist/components/AgentActivity.d.ts +2 -1
  2. package/dist/components/AgentActivity.d.ts.map +1 -1
  3. package/dist/components/AgentActivity.js +4 -17
  4. package/dist/components/AgentActivity.js.map +1 -1
  5. package/dist/components/Calendar.d.ts +20 -0
  6. package/dist/components/Calendar.d.ts.map +1 -0
  7. package/dist/components/Calendar.js +151 -0
  8. package/dist/components/Calendar.js.map +1 -0
  9. package/dist/components/CalendarPopover.d.ts +26 -0
  10. package/dist/components/CalendarPopover.d.ts.map +1 -0
  11. package/dist/components/CalendarPopover.js +45 -0
  12. package/dist/components/CalendarPopover.js.map +1 -0
  13. package/dist/components/DateField.d.ts +15 -0
  14. package/dist/components/DateField.d.ts.map +1 -0
  15. package/dist/components/DateField.js +74 -0
  16. package/dist/components/DateField.js.map +1 -0
  17. package/dist/components/DatePicker.d.ts +81 -0
  18. package/dist/components/DatePicker.d.ts.map +1 -0
  19. package/dist/components/DatePicker.js +102 -0
  20. package/dist/components/DatePicker.js.map +1 -0
  21. package/dist/components/DateRangePicker.d.ts +117 -0
  22. package/dist/components/DateRangePicker.d.ts.map +1 -0
  23. package/dist/components/DateRangePicker.js +152 -0
  24. package/dist/components/DateRangePicker.js.map +1 -0
  25. package/dist/components/Header.d.ts +10 -0
  26. package/dist/components/Header.d.ts.map +1 -1
  27. package/dist/components/Header.js +18 -3
  28. package/dist/components/Header.js.map +1 -1
  29. package/dist/components/NumberInput.d.ts +63 -0
  30. package/dist/components/NumberInput.d.ts.map +1 -0
  31. package/dist/components/NumberInput.js +102 -0
  32. package/dist/components/NumberInput.js.map +1 -0
  33. package/dist/components/PromptInput.d.ts +89 -0
  34. package/dist/components/PromptInput.d.ts.map +1 -0
  35. package/dist/components/PromptInput.js +130 -0
  36. package/dist/components/PromptInput.js.map +1 -0
  37. package/dist/components/SegmentedControl.d.ts +63 -0
  38. package/dist/components/SegmentedControl.d.ts.map +1 -0
  39. package/dist/components/SegmentedControl.js +79 -0
  40. package/dist/components/SegmentedControl.js.map +1 -0
  41. package/dist/components/Sidebar.d.ts +109 -0
  42. package/dist/components/Sidebar.d.ts.map +1 -0
  43. package/dist/components/Sidebar.js +106 -0
  44. package/dist/components/Sidebar.js.map +1 -0
  45. package/dist/components/Stepper.d.ts +73 -0
  46. package/dist/components/Stepper.d.ts.map +1 -0
  47. package/dist/components/Stepper.js +82 -0
  48. package/dist/components/Stepper.js.map +1 -0
  49. package/dist/components/ToolCall.d.ts +66 -0
  50. package/dist/components/ToolCall.d.ts.map +1 -0
  51. package/dist/components/ToolCall.js +78 -0
  52. package/dist/components/ToolCall.js.map +1 -0
  53. package/dist/components/agent-status.d.ts +14 -0
  54. package/dist/components/agent-status.d.ts.map +1 -0
  55. package/dist/components/agent-status.js +16 -0
  56. package/dist/components/agent-status.js.map +1 -0
  57. package/dist/components/index.d.ts +17 -0
  58. package/dist/components/index.d.ts.map +1 -1
  59. package/dist/components/index.js +8 -0
  60. package/dist/components/index.js.map +1 -1
  61. package/dist/components/iso-date.d.ts +53 -0
  62. package/dist/components/iso-date.d.ts.map +1 -0
  63. package/dist/components/iso-date.js +102 -0
  64. package/dist/components/iso-date.js.map +1 -0
  65. package/dist/figma-descriptions.json +107 -52
  66. package/dist/figma-map.json +735 -2
  67. package/dist/meta/AgentActivityStep.json +2 -2
  68. package/dist/meta/DatePicker.json +270 -0
  69. package/dist/meta/DateRangePicker.json +284 -0
  70. package/dist/meta/Header.json +32 -2
  71. package/dist/meta/NumberInput.json +407 -0
  72. package/dist/meta/PromptInput.json +212 -0
  73. package/dist/meta/SegmentedControl.json +217 -0
  74. package/dist/meta/SegmentedControlItem.json +122 -0
  75. package/dist/meta/Sidebar.json +150 -0
  76. package/dist/meta/SidebarItem.json +184 -0
  77. package/dist/meta/SidebarSection.json +131 -0
  78. package/dist/meta/Stepper.json +135 -0
  79. package/dist/meta/StepperStep.json +148 -0
  80. package/dist/meta/Tabs.json +5 -0
  81. package/dist/meta/ToolCall.json +192 -0
  82. package/dist/meta/components.json +5784 -3297
  83. package/dist/meta/contrast.json +7776 -2478
  84. package/dist/meta/index.json +139 -2
  85. package/dist/meta/patterns/AgentRun.json +27 -0
  86. package/dist/meta/patterns/Form.json +9 -0
  87. package/dist/meta/patterns/PageShell.json +43 -3
  88. package/dist/meta/patterns/Wizard.json +20 -1
  89. package/dist/meta/patterns/index.json +10 -1
  90. package/dist/styles/date-picker.css +420 -0
  91. package/dist/styles/date-range-picker.css +280 -0
  92. package/dist/styles/header.css +26 -0
  93. package/dist/styles/index.css +15 -0
  94. package/dist/styles/number-input.css +83 -0
  95. package/dist/styles/prompt-input.css +127 -0
  96. package/dist/styles/segmented-control.css +182 -0
  97. package/dist/styles/sidebar.css +307 -0
  98. package/dist/styles/stepper.css +250 -0
  99. package/dist/styles/tool-call.css +202 -0
  100. package/llms.txt +2 -2
  101. package/package.json +20 -19
  102. package/LICENSE +0 -21
@@ -0,0 +1,407 @@
1
+ {
2
+ "name": "NumberInput",
3
+ "source": "src/components/NumberInput.tsx",
4
+ "propsType": "NumberInputProps",
5
+ "description": "NumberInput — a quantity, with formatting, bounds and steps.\n\nNOT `<input type=\"number\">`, and the list of reasons is the component:\n\n It scrolls. A focused `type=\"number\"` changes value under the mouse wheel,\n so a user scrolling the page past a price field edits the price. The wheel\n is OFF here by default (`isWheelDisabled`), and a caller has to ask for it.\n\n It cannot format. \"1,234.50\", \"€12\", \"15%\" are text to the browser's number\n input, which rejects them. `formatOptions` takes `Intl.NumberFormatOptions`,\n so currency, percent and units display and parse in the user's locale —\n including \"1.234,50\" for a German user.\n\n It is not a number to the browser's validation either. `type=\"text\"` with\n the right `inputMode` gets the numeric keyboard on a phone without\n Firefox letting letters in and Chrome silently reporting an empty value.\n\nEMPTY IS `null`, NOT `NaN`. React Aria reports an empty field as `NaN`, and\n`NaN === NaN` is false — so every \"is it empty\" check a caller writes is\nwrong. This converts at the boundary, both ways.\n\n− AND + SIT SIDE BY SIDE, NOT STACKED. Stacked chevrons split the field's\nheight in two, which puts a Small field's targets at 16px — under the 24px\nWCAG 2.5.8 asks. Side by side, every size clears it. They are out of the tab\norder, as React Aria sets them: the arrow keys do the same job from the field,\nand two extra tab stops per number on a form is a tax on every keyboard user.\n\nThe box is Input's, class for class, so every state — hover, focus, invalid,\nread-only, disabled — is Input's and cannot drift from it.",
6
+ "import": "import { NumberInput } from 'ionbase-ui';",
7
+ "status": "stable",
8
+ "summary": "A quantity field: formats and parses in the user's locale, clamps to bounds, steps with − and + or the arrow keys, and never changes under the scroll wheel unless asked.",
9
+ "useWhen": [
10
+ "the value is a quantity someone might add to or compare — a price, a count, a percentage, a duration",
11
+ "the value has bounds or a step the field should enforce",
12
+ "the value needs formatting — currency, percent, units — in the user's locale"
13
+ ],
14
+ "useInstead": [
15
+ {
16
+ "when": "the value is made of digits but is not a quantity — a phone number, postcode, card number, account or order ID",
17
+ "use": "Input",
18
+ "why": "a number field strips leading zeros, adds grouping separators and offers + and −, all of which corrupt an identifier. Nobody increments a postcode"
19
+ },
20
+ {
21
+ "when": "the value is a phone number",
22
+ "use": "PhoneInput"
23
+ },
24
+ {
25
+ "when": "a rough value within a range matters more than an exact one — volume, a zoom level",
26
+ "use": "Input",
27
+ "why": "there is no Slider yet; do not stand one in with a stepper that takes forty presses"
28
+ }
29
+ ],
30
+ "variants": {
31
+ "size": {
32
+ "sm": {
33
+ "use": "dense forms and table cells"
34
+ },
35
+ "md": {
36
+ "use": "the default"
37
+ },
38
+ "lg": {
39
+ "use": "a form where this value is the main input"
40
+ }
41
+ }
42
+ },
43
+ "a11y": {
44
+ "requires": [
45
+ "`label` or `aria-label` — the accessible name. A unit shown by `formatOptions` is not a name"
46
+ ],
47
+ "guarantees": [
48
+ "Arrow Up and Down step the value from the field; Page Up and Down step by ten; Home and End go to the bounds",
49
+ "the − and + buttons are named and out of the tab order, because the arrow keys already do their job from the field",
50
+ "every size's step buttons are at least 24px square — WCAG 2.5.8",
51
+ "the field is `type=\"text\"` with the matching `inputMode`, so phones show a numeric keyboard without the native number input's parsing quirks"
52
+ ],
53
+ "notes": [
54
+ "the scroll wheel does not change the value unless `isWheelDisabled={false}` — a focused number input edited by scrolling past it is the classic bug",
55
+ "`onChange` fires on commit — blur, Enter, a step — not per keystroke. `null` means empty; `NaN` never reaches the caller"
56
+ ]
57
+ },
58
+ "antiPatterns": [
59
+ {
60
+ "dont": "<NumberInput label=\"Postcode\" />",
61
+ "do": "<Input label=\"Postcode\" inputMode=\"numeric\" />",
62
+ "why": "\"02134\" becomes 2,134 — leading zero gone, separator added, and a + button nobody should press"
63
+ },
64
+ {
65
+ "dont": "<Input type=\"number\" />",
66
+ "do": "<NumberInput />",
67
+ "why": "the native number input changes under the scroll wheel, cannot show currency or grouping, and reports an empty string for input it cannot parse"
68
+ },
69
+ {
70
+ "dont": "a unit typed into the label and the value — label=\"Price ($)\" with a \"$\" typed in",
71
+ "do": "formatOptions={{ style: 'currency', currency: 'USD' }}",
72
+ "why": "formatOptions displays and parses the unit in the user's locale; a hand-typed symbol is text the parser has to reject"
73
+ },
74
+ {
75
+ "dont": "checking `Number.isNaN(value)` for empty",
76
+ "do": "`value === null`",
77
+ "why": "this component converts the hook's NaN to null at the boundary, so NaN never arrives"
78
+ }
79
+ ],
80
+ "stylesheet": "src/styles/number-input.css",
81
+ "tokens": [
82
+ "--icon-default",
83
+ "--icon-disabled",
84
+ "--icon-secondary",
85
+ "--ion-input-height",
86
+ "--ion-input-icon-size",
87
+ "--radius-sm",
88
+ "--spacing-2",
89
+ "--spacing-4",
90
+ "--spacing-8",
91
+ "--surface-default",
92
+ "--surface-hover",
93
+ "--surface-pressed"
94
+ ],
95
+ "props": {
96
+ "value": {
97
+ "type": "number | null | undefined",
98
+ "required": false,
99
+ "origin": "own",
100
+ "description": "Controlled value. `null` is empty — never `NaN`, which is what the\nunderlying hook uses and which fails every `===` check a caller writes."
101
+ },
102
+ "defaultValue": {
103
+ "type": "number | null | undefined",
104
+ "required": false,
105
+ "origin": "own",
106
+ "description": "Uncontrolled starting value. `null` for empty."
107
+ },
108
+ "onChange": {
109
+ "type": "((value: number | null) => void) | undefined",
110
+ "required": false,
111
+ "origin": "own",
112
+ "description": "Fires when the value is committed — on blur, Enter, a step button or an\narrow key — not on every keystroke. `null` when the field was cleared."
113
+ },
114
+ "size": {
115
+ "type": "NumberInputSize | undefined",
116
+ "required": false,
117
+ "origin": "own",
118
+ "description": "Matches Input's `size`: Small, Medium, Large.",
119
+ "values": [
120
+ "sm",
121
+ "md",
122
+ "lg"
123
+ ],
124
+ "default": "md"
125
+ },
126
+ "showStepper": {
127
+ "type": "boolean | undefined",
128
+ "required": false,
129
+ "origin": "own",
130
+ "description": "The − and + buttons. On by default; turn off for a dense table cell where\nthe arrow keys are enough.",
131
+ "default": true
132
+ },
133
+ "className": {
134
+ "type": "string | undefined",
135
+ "required": false,
136
+ "origin": "own",
137
+ "description": "Class names for the control box (`.ion-input`)."
138
+ },
139
+ "wrapperClassName": {
140
+ "type": "string | undefined",
141
+ "required": false,
142
+ "origin": "own",
143
+ "description": "Class names for the `.ion-field` wrapper when a label or helper is shown."
144
+ },
145
+ "autoFocus": {
146
+ "type": "boolean | undefined",
147
+ "required": false,
148
+ "origin": "aria",
149
+ "description": "Whether the element should receive focus on render."
150
+ },
151
+ "id": {
152
+ "type": "string | undefined",
153
+ "required": false,
154
+ "origin": "aria",
155
+ "description": "The element's unique identifier. See\n[MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id)."
156
+ },
157
+ "aria-describedby": {
158
+ "type": "string | undefined",
159
+ "required": false,
160
+ "origin": "aria",
161
+ "description": "Identifies the element (or elements) that describes the object."
162
+ },
163
+ "aria-details": {
164
+ "type": "string | undefined",
165
+ "required": false,
166
+ "origin": "aria",
167
+ "description": "Identifies the element (or elements) that provide a detailed, extended description for the\nobject."
168
+ },
169
+ "aria-label": {
170
+ "type": "string | undefined",
171
+ "required": false,
172
+ "origin": "aria",
173
+ "description": "Defines a string value that labels the current element."
174
+ },
175
+ "aria-labelledby": {
176
+ "type": "string | undefined",
177
+ "required": false,
178
+ "origin": "aria",
179
+ "description": "Identifies the element (or elements) that labels the current element."
180
+ },
181
+ "onCopy": {
182
+ "type": "ClipboardEventHandler<HTMLInputElement> | undefined",
183
+ "required": false,
184
+ "origin": "aria",
185
+ "description": "Handler that is called when the user copies text. See\n[MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/oncopy)."
186
+ },
187
+ "onCut": {
188
+ "type": "ClipboardEventHandler<HTMLInputElement> | undefined",
189
+ "required": false,
190
+ "origin": "aria",
191
+ "description": "Handler that is called when the user cuts text. See\n[MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/oncut)."
192
+ },
193
+ "onPaste": {
194
+ "type": "ClipboardEventHandler<HTMLInputElement> | undefined",
195
+ "required": false,
196
+ "origin": "aria",
197
+ "description": "Handler that is called when the user pastes text. See\n[MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/onpaste)."
198
+ },
199
+ "onCompositionEnd": {
200
+ "type": "CompositionEventHandler<HTMLInputElement> | undefined",
201
+ "required": false,
202
+ "origin": "aria",
203
+ "description": "Handler that is called when a text composition system completes or cancels the current text\ncomposition session. See\n[MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionend_event)."
204
+ },
205
+ "onCompositionStart": {
206
+ "type": "CompositionEventHandler<HTMLInputElement> | undefined",
207
+ "required": false,
208
+ "origin": "aria",
209
+ "description": "Handler that is called when a text composition system starts a new text composition session.\nSee [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionstart_event)."
210
+ },
211
+ "onCompositionUpdate": {
212
+ "type": "CompositionEventHandler<HTMLInputElement> | undefined",
213
+ "required": false,
214
+ "origin": "aria",
215
+ "description": "Handler that is called when a new character is received in the current text composition\nsession. See\n[MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionupdate_event)."
216
+ },
217
+ "onFocus": {
218
+ "type": "((e: FocusEvent<Element, Element>) => void) | undefined",
219
+ "required": false,
220
+ "origin": "aria",
221
+ "description": "Handler that is called when the element receives focus."
222
+ },
223
+ "onBlur": {
224
+ "type": "((e: FocusEvent<Element, Element>) => void) | undefined",
225
+ "required": false,
226
+ "origin": "aria",
227
+ "description": "Handler that is called when the element loses focus."
228
+ },
229
+ "onBeforeInput": {
230
+ "type": "FormEventHandler<HTMLInputElement> | undefined",
231
+ "required": false,
232
+ "origin": "aria",
233
+ "description": "Handler that is called when the input value is about to be modified. See\n[MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/beforeinput_event)."
234
+ },
235
+ "onInput": {
236
+ "type": "FormEventHandler<HTMLInputElement> | undefined",
237
+ "required": false,
238
+ "origin": "aria",
239
+ "description": "Handler that is called when the input value is modified. See\n[MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event)."
240
+ },
241
+ "onKeyDown": {
242
+ "type": "((e: KeyboardEvent) => void) | undefined",
243
+ "required": false,
244
+ "origin": "aria",
245
+ "description": "Handler that is called when a key is pressed."
246
+ },
247
+ "onKeyUp": {
248
+ "type": "((e: KeyboardEvent) => void) | undefined",
249
+ "required": false,
250
+ "origin": "aria",
251
+ "description": "Handler that is called when a key is released."
252
+ },
253
+ "onSelect": {
254
+ "type": "ReactEventHandler<HTMLInputElement> | undefined",
255
+ "required": false,
256
+ "origin": "aria",
257
+ "description": "Handler that is called when text in the input is selected. See\n[MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/select_event)."
258
+ },
259
+ "step": {
260
+ "type": "number | undefined",
261
+ "required": false,
262
+ "origin": "aria",
263
+ "description": "The amount that the input value changes with each increment or decrement \"tick\"."
264
+ },
265
+ "placeholder": {
266
+ "type": "string | undefined",
267
+ "required": false,
268
+ "origin": "aria",
269
+ "description": "Temporary text that occupies the text input when it is empty."
270
+ },
271
+ "isDisabled": {
272
+ "type": "boolean | undefined",
273
+ "required": false,
274
+ "origin": "aria",
275
+ "description": "Whether the input is disabled."
276
+ },
277
+ "isReadOnly": {
278
+ "type": "boolean | undefined",
279
+ "required": false,
280
+ "origin": "aria",
281
+ "description": "Whether the input can be selected but not changed by the user."
282
+ },
283
+ "isRequired": {
284
+ "type": "boolean | undefined",
285
+ "required": false,
286
+ "origin": "aria",
287
+ "description": "Whether user input is required on the input before form submission."
288
+ },
289
+ "isInvalid": {
290
+ "type": "boolean | undefined",
291
+ "required": false,
292
+ "origin": "aria",
293
+ "description": "Whether the input value is invalid."
294
+ },
295
+ "validationState": {
296
+ "type": "ValidationState | undefined",
297
+ "required": false,
298
+ "origin": "aria",
299
+ "values": [
300
+ "valid",
301
+ "invalid"
302
+ ],
303
+ "tags": {
304
+ "deprecated": "Use `isInvalid` instead."
305
+ }
306
+ },
307
+ "validationBehavior": {
308
+ "type": "\"aria\" | \"native\" | undefined",
309
+ "required": false,
310
+ "origin": "aria",
311
+ "description": "Whether to use native HTML form validation to prevent form submission\nwhen the value is missing or invalid, or mark the field as required\nor invalid via ARIA.",
312
+ "values": [
313
+ "aria",
314
+ "native"
315
+ ],
316
+ "tags": {
317
+ "default": "'aria'"
318
+ }
319
+ },
320
+ "validate": {
321
+ "type": "((value: number) => ValidationError | true | null | undefined) | undefined",
322
+ "required": false,
323
+ "origin": "aria",
324
+ "description": "A function that returns an error message if a given value is invalid.\nValidation errors are displayed to the user when the form is submitted\nif `validationBehavior=\"native\"`. For realtime validation, use the `isInvalid`\nprop instead."
325
+ },
326
+ "description": {
327
+ "type": "ReactNode",
328
+ "required": false,
329
+ "origin": "aria",
330
+ "description": "A description for the field. Provides a hint such as specific requirements for what to choose."
331
+ },
332
+ "errorMessage": {
333
+ "type": "ReactNode | ((v: ValidationResult) => ReactNode)",
334
+ "required": false,
335
+ "origin": "aria",
336
+ "description": "An error message for the field."
337
+ },
338
+ "onFocusChange": {
339
+ "type": "((isFocused: boolean) => void) | undefined",
340
+ "required": false,
341
+ "origin": "aria",
342
+ "description": "Handler that is called when the element's focus status changes."
343
+ },
344
+ "label": {
345
+ "type": "ReactNode",
346
+ "required": false,
347
+ "origin": "aria",
348
+ "description": "The content to display as the label."
349
+ },
350
+ "decrementAriaLabel": {
351
+ "type": "string | undefined",
352
+ "required": false,
353
+ "origin": "aria",
354
+ "description": "A custom aria-label for the decrement button. If not provided, the localized string \"Decrement\"\nis used."
355
+ },
356
+ "incrementAriaLabel": {
357
+ "type": "string | undefined",
358
+ "required": false,
359
+ "origin": "aria",
360
+ "description": "A custom aria-label for the increment button. If not provided, the localized string \"Increment\"\nis used."
361
+ },
362
+ "isWheelDisabled": {
363
+ "type": "boolean | undefined",
364
+ "required": false,
365
+ "origin": "aria",
366
+ "description": "Enables or disables changing the value with scroll.",
367
+ "default": true
368
+ },
369
+ "formatOptions": {
370
+ "type": "Intl.NumberFormatOptions | undefined",
371
+ "required": false,
372
+ "origin": "other",
373
+ "description": "Formatting options for the value displayed in the number field.\nThis also affects what characters are allowed to be typed by the user."
374
+ },
375
+ "commitBehavior": {
376
+ "type": "\"validate\" | \"snap\" | undefined",
377
+ "required": false,
378
+ "origin": "other",
379
+ "description": "Controls the behavior of the number field when the user blurs the field after editing. 'snap'\nwill clamp the value to the min/max values, and snap to the nearest step value. 'validate' will\nnot clamp the value, and will validate that the value is within the min/max range and on a\nvalid step.",
380
+ "values": [
381
+ "validate",
382
+ "snap"
383
+ ],
384
+ "tags": {
385
+ "default": "'snap'"
386
+ }
387
+ },
388
+ "minValue": {
389
+ "type": "number | undefined",
390
+ "required": false,
391
+ "origin": "aria",
392
+ "description": "The smallest value allowed for the input."
393
+ },
394
+ "maxValue": {
395
+ "type": "number | undefined",
396
+ "required": false,
397
+ "origin": "aria",
398
+ "description": "The largest value allowed for the input."
399
+ }
400
+ },
401
+ "propCounts": {
402
+ "own": 7,
403
+ "aria": 37,
404
+ "dom": 278,
405
+ "other": 2
406
+ }
407
+ }
@@ -0,0 +1,212 @@
1
+ {
2
+ "name": "PromptInput",
3
+ "source": "src/components/PromptInput.tsx",
4
+ "propsType": "PromptInputProps",
5
+ "description": "PromptInput — where a person writes to an agent.\n\nWHY IT IS NOT A TEXTAREA AND A BUTTON\n\nEvery composer is assembled that way, and every one re-implements the same\nfour bugs:\n\n Enter during IME composition sends half a word. Japanese, Chinese and\n Korean input confirm a candidate with Enter; a handler that does not check\n `isComposing` sends the message mid-character. That excludes whole\n languages from the product, silently, and nobody on an English keyboard\n ever sees it.\n\n The prompt is lost when sending fails. Clearing on submit is right —\n waiting for the server makes the composer feel broken — but clearing and\n never restoring destroys what may have been a long message. Uncontrolled,\n a rejected `onSubmit` promise puts the text back.\n\n The stop control lives somewhere else. While a run is going, the send\n button's place is exactly where the user's pointer and attention already\n are, so that is where `AgentStop` goes — the same control, the same\n guarantees, not a second stop button with different ones.\n\n The keyboard contract is invisible. \"Enter sends, Shift+Enter for a new\n line\" is announced through `aria-describedby`, because a screen-reader\n user who presses Enter expecting a newline has just sent a message.\n\nWHAT IT DOES NOT DO\n\nIt does not upload, pick models or render messages. `attachments` and\n`actions` are slots, because what a product attaches and which tools it\noffers are the product's decisions.",
6
+ "import": "import { PromptInput } from 'ionbase-ui';",
7
+ "status": "stable",
8
+ "summary": "Where a person writes to an agent: a growing text field, a send control that becomes the stop control while a run is going, and slots for attachments and tools.",
9
+ "useWhen": [
10
+ "a chat or assistant surface where the user's message starts a run",
11
+ "a command bar that sends free text to an agent"
12
+ ],
13
+ "useInstead": [
14
+ {
15
+ "when": "the text is a form value submitted with other fields",
16
+ "use": "Textarea",
17
+ "why": "Enter-to-send inside a form fights the form's own submit, and a single field of a larger form is not a composer"
18
+ },
19
+ {
20
+ "when": "the input is a single-line search",
21
+ "use": "Input",
22
+ "why": "a search box does not grow, does not stop runs, and Enter means search rather than send"
23
+ },
24
+ {
25
+ "when": "the run needs a stop control and was not started from this composer",
26
+ "use": "AgentStop",
27
+ "why": "the composer's stop belongs to the run it sent; a run started elsewhere keeps its stop beside its own activity"
28
+ }
29
+ ],
30
+ "variants": {
31
+ "submitKey": {
32
+ "enter": {
33
+ "use": "the default — chat. Enter sends, Shift+Enter is a new line"
34
+ },
35
+ "mod-enter": {
36
+ "use": "long messages, where a stray Enter is expensive. Cmd/Ctrl+Enter sends and Enter is a new line"
37
+ }
38
+ }
39
+ },
40
+ "slots": {
41
+ "actions": {
42
+ "accepts": "Button",
43
+ "note": "attach, a model picker, a tool toggle — at the start of the toolbar. Icon-only buttons need their own aria-label"
44
+ },
45
+ "attachments": {
46
+ "accepts": "Badge",
47
+ "note": "what is attached, above the text. Each removable item needs a remove control named for the file"
48
+ }
49
+ },
50
+ "a11y": {
51
+ "requires": [
52
+ "`label` — the accessible name of the field. A placeholder is not one: it disappears on the first keystroke"
53
+ ],
54
+ "guarantees": [
55
+ "the send key is described through aria-describedby, so a screen-reader user knows Enter sends before pressing it",
56
+ "Enter pressed while an IME is composing never sends — Japanese, Chinese and Korean input confirm candidates with Enter",
57
+ "while `isRunning` with `onStop`, the send control is replaced in place by AgentStop, with its guarantees: it keeps its place while stopping and announces once",
58
+ "focus stays in the field after sending, so the next message can be typed straight away"
59
+ ],
60
+ "notes": [
61
+ "the field stays editable while a run is going; only submitting is refused",
62
+ "uncontrolled, the field clears on send and a rejected onSubmit promise restores the text — unless the user has already started typing something new"
63
+ ]
64
+ },
65
+ "antiPatterns": [
66
+ {
67
+ "dont": "<Textarea> beside a <Button> with an onKeyDown that checks for Enter",
68
+ "do": "<PromptInput label=\"Message\" onSubmit={send} />",
69
+ "why": "the hand-built version sends mid-character for IME users and loses the prompt when sending fails"
70
+ },
71
+ {
72
+ "dont": "a separate AgentStop elsewhere on screen as well as `isRunning` with `onStop`",
73
+ "why": "two stop controls for one run raises the question of whether they do different things"
74
+ },
75
+ {
76
+ "dont": "`isRunning` without `onStop`",
77
+ "why": "the send control disables and nothing replaces it — the user can see the agent working and has no way to stop it"
78
+ },
79
+ {
80
+ "dont": "controlled `value` cleared in onSubmit before the request settles",
81
+ "why": "controlled, restoring the text on failure is the caller's job; clearing early and not restoring loses the message"
82
+ }
83
+ ],
84
+ "stylesheet": "src/styles/prompt-input.css",
85
+ "tokens": [
86
+ "--border-default",
87
+ "--border-disabled",
88
+ "--border-focus",
89
+ "--border-strong",
90
+ "--border-width-default",
91
+ "--font-family-sans",
92
+ "--ion-duration-base",
93
+ "--ion-ease-out",
94
+ "--radius-lg",
95
+ "--spacing-32",
96
+ "--spacing-4",
97
+ "--spacing-8",
98
+ "--surface-default",
99
+ "--surface-disabled",
100
+ "--text-default",
101
+ "--text-disabled",
102
+ "--text-tertiary",
103
+ "--type-body",
104
+ "--type-body-line-height"
105
+ ],
106
+ "props": {
107
+ "label": {
108
+ "type": "string",
109
+ "required": true,
110
+ "origin": "own",
111
+ "description": "The accessible name of the text field. Required, and not a placeholder:\nplaceholder text disappears the moment the user types, and is not reliably\nannounced as a name."
112
+ },
113
+ "value": {
114
+ "type": "string | undefined",
115
+ "required": false,
116
+ "origin": "own",
117
+ "description": "Controlled text. Pass `onChange` with it."
118
+ },
119
+ "defaultValue": {
120
+ "type": "string | undefined",
121
+ "required": false,
122
+ "origin": "own",
123
+ "description": "Uncontrolled starting text."
124
+ },
125
+ "onChange": {
126
+ "type": "((value: string) => void) | undefined",
127
+ "required": false,
128
+ "origin": "own"
129
+ },
130
+ "onSubmit": {
131
+ "type": "((value: string) => void | Promise<unknown>) | undefined",
132
+ "required": false,
133
+ "origin": "own",
134
+ "description": "Fires with the text as typed. Uncontrolled, the field clears straight away;\nif the returned promise rejects, the text is put back — a prompt lost to a\nnetwork error is the one thing a composer must never do."
135
+ },
136
+ "submitKey": {
137
+ "type": "PromptInputSubmitKey | undefined",
138
+ "required": false,
139
+ "origin": "own",
140
+ "description": "Which key sends. `enter` sends on Enter with Shift+Enter for a new line —\na chat. `mod-enter` sends on Cmd/Ctrl+Enter and leaves Enter for new lines —\na composer where messages are long and a stray Enter is expensive.",
141
+ "values": [
142
+ "enter",
143
+ "mod-enter"
144
+ ]
145
+ },
146
+ "isRunning": {
147
+ "type": "boolean | undefined",
148
+ "required": false,
149
+ "origin": "own",
150
+ "description": "A run is in progress. The send control becomes an `AgentStop` in the same\nplace, and submitting is refused. The field stays editable, so the user can\ndraft the next message while the agent works."
151
+ },
152
+ "onStop": {
153
+ "type": "(() => void) | undefined",
154
+ "required": false,
155
+ "origin": "own",
156
+ "description": "Called by the stop control while `isRunning`."
157
+ },
158
+ "isStopping": {
159
+ "type": "boolean | undefined",
160
+ "required": false,
161
+ "origin": "own",
162
+ "description": "Passed to the stop control once the stop has been requested."
163
+ },
164
+ "isDisabled": {
165
+ "type": "boolean | undefined",
166
+ "required": false,
167
+ "origin": "own"
168
+ },
169
+ "minRows": {
170
+ "type": "number | undefined",
171
+ "required": false,
172
+ "origin": "own",
173
+ "description": "Rows the field starts at."
174
+ },
175
+ "maxRows": {
176
+ "type": "number | undefined",
177
+ "required": false,
178
+ "origin": "own",
179
+ "description": "Rows the field grows to before it scrolls."
180
+ },
181
+ "actions": {
182
+ "type": "React.ReactNode",
183
+ "required": false,
184
+ "origin": "own",
185
+ "description": "Controls at the start of the toolbar — attach, a model picker, a tool\ntoggle. Icon-only controls here need their own `aria-label`."
186
+ },
187
+ "attachments": {
188
+ "type": "React.ReactNode",
189
+ "required": false,
190
+ "origin": "own",
191
+ "description": "Rendered above the text — attached files, a quoted message."
192
+ },
193
+ "sendLabel": {
194
+ "type": "string | undefined",
195
+ "required": false,
196
+ "origin": "own",
197
+ "description": "Accessible name of the send control."
198
+ },
199
+ "className": {
200
+ "type": "string | undefined",
201
+ "required": false,
202
+ "origin": "own",
203
+ "description": "Class names for the outer box."
204
+ }
205
+ },
206
+ "propCounts": {
207
+ "own": 16,
208
+ "aria": 0,
209
+ "dom": 284,
210
+ "other": 0
211
+ }
212
+ }